export declare const COURSE_SKILLS_BINDING_SCHEMA: "course-skills-binding/0.1"; export declare const COURSE_SKILLS_PROTOCOL: "course-skills/0.1"; export declare const COURSE_SKILLS_CALL_SCHEMA: "course-skills-call/0.1"; export interface RuntimeSkillGrant { assetVersionId: string; ref: string; digest: string; } export interface RuntimeSkillProviderBinding { schemaVersion: typeof COURSE_SKILLS_BINDING_SCHEMA; protocol: typeof COURSE_SKILLS_PROTOCOL; endpoint: string; bearerToken: string; expiresAt: string; effectiveSkillGrants: RuntimeSkillGrant[]; } export interface RuntimeSkillCatalogEntry extends RuntimeSkillGrant { name: string; description: string; version: string; requiredCapabilities: string[]; } export interface RuntimeLoadedSkill { ref: string; digest: string; content: string; bytes: number; truncated: boolean; } export interface RuntimeSkillReference extends RuntimeLoadedSkill { path: string; } export interface RuntimeSkillPackageFile { path: string; content: Uint8Array; } export interface RuntimeSkillPackage { ref: string; digest: string; envelopeDigest: string; entrypoint: string; files: RuntimeSkillPackageFile[]; bytes: number; } export interface RuntimeSkillProvider { listEligibleSkills(): Promise; loadSkill(ref: string): Promise; loadReference(ref: string, referencePath: string): Promise; /** * Fetch every file of one authorized Skill in a single call. * * Materializing a Skill into the runtime's skills directory needs the whole package: * `loadSkill`/`loadReference` only expose one caller-named path at a time and cannot * enumerate the package, so they can never produce a complete directory. */ fetchPackage(ref: string): Promise; } export interface PreparedRuntimeSkillProvider { binding: RuntimeSkillProviderBinding; provider: RuntimeSkillProvider; catalog: RuntimeSkillCatalogEntry[]; } export type RuntimeSkillEventState = "applied" | "selected" | "loaded" | "reference_loaded" | "load_failed"; export interface RuntimeSkillEvent { schema_version: "agent-skill-event/0.1"; kind: "skill_event"; state: RuntimeSkillEventState; ref: string; digest: string; load_mode: "mcp" | "native"; bytes?: number; truncated?: boolean; code?: string; } export declare class RuntimeSkillProviderError extends Error { readonly code: string; constructor(code: string, message: string); } export type RuntimeSkillProviderFactory = (rawBinding: unknown) => Promise; interface RuntimeSkillBindingParseOptions { allowInsecureLoopbackForTests?: boolean; } export declare function parseRuntimeSkillProviderBinding(raw: unknown, now?: number, options?: RuntimeSkillBindingParseOptions): RuntimeSkillProviderBinding; /** * Parse only the stable grant identity of a replayed binding. * * Credential values remain the first accepted activation snapshot, so replay validation * deliberately checks their shape but not their endpoint/expiry semantics. */ export declare function parseRuntimeSkillProviderGrantSet(raw: unknown): RuntimeSkillGrant[]; export declare function prepareRuntimeSkillProvider(rawBinding: unknown, options?: { fetchFn?: typeof fetch; now?: () => number; /** Tests only: production bindings must use HTTPS. */ allowInsecureLoopbackForTests?: boolean; }): Promise; export declare class HttpRuntimeSkillProvider implements RuntimeSkillProvider { private readonly binding; private readonly fetchFn; private readonly now; private readonly grantsByRef; constructor(binding: RuntimeSkillProviderBinding, options?: { fetchFn?: typeof fetch; now?: () => number; }); listEligibleSkills(): Promise; loadSkill(ref: string): Promise; fetchPackage(ref: string): Promise; loadReference(ref: string, referencePath: string): Promise; private requireEligible; private call; } export declare function safeReferencePath(value: unknown): string; export {};