aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
54 lines • 2.28 kB
TypeScript
import { type JwkSet } from './jws.js';
import type { AgentCard } from './types.js';
export interface FetchAgentCardOptions {
/** Pre-loaded JWKS — preferred when the JWKS path is known up-front. */
jwks?: JwkSet;
/** File path or URL to the JWKS. Resolved if `jwks` is not set and
* verification is requested. */
jwksSource?: string;
/** Bearer token, if the card endpoint requires one. */
bearer?: string;
/** Skip JWS verification (NOT recommended; reserved for bootstrap flows). */
skipVerify?: boolean;
/** Custom fetch implementation. */
fetch?: typeof fetch;
/** AbortSignal. */
signal?: AbortSignal;
}
export interface VerifiedAgentCard {
card: AgentCard;
/** RFC 3339 timestamp of when this card was fetched and verified. */
verifiedAt: string;
/** The `kid` from the JWS header used to verify; undefined when skipVerify. */
kid?: string;
/** Raw bytes of the card as served (preserved for re-verification). */
raw: string;
}
export declare class AgentCardCache {
private readonly ttlMs;
private readonly entries;
constructor(ttlMs?: number);
get(key: string): VerifiedAgentCard | undefined;
set(key: string, verified: VerifiedAgentCard): void;
/** Invalidate a single instance (call this on `instance state change` events). */
invalidate(key: string): void;
clear(): void;
size(): number;
}
/**
* Fetch + verify an AgentCard. Bypasses any cache the caller may have.
* Throws on fetch failure or signature mismatch.
*/
export declare function fetchAgentCard(host: string, instanceId: string, opts?: FetchAgentCardOptions): Promise<VerifiedAgentCard>;
/**
* Cache-aware variant: returns the cached entry when fresh, otherwise
* fetches and stores. Cache key is `${host}|${instanceId}`.
*/
export declare function fetchAgentCardCached(cache: AgentCardCache, host: string, instanceId: string, opts?: FetchAgentCardOptions): Promise<VerifiedAgentCard>;
/**
* Extract the required-set extension URIs from an AgentCard.
* Used by A2AClient to know which `A2A-Extensions: <URI>` values to inject
* on every mutating call (#1254).
*/
export declare function requiredExtensionUris(card: AgentCard): string[];
//# sourceMappingURL=agent-card.d.ts.map