import { type Skill } from "./skills.ts"; export declare const DEFAULT_SKILL_IDLE_TIMEOUT_MS: number; export declare const MAX_ACTIVE_SKILL_BODY_BYTES: number; export declare const MIN_ACTIVE_SKILL_BODY_BYTES: number; export declare const MAX_LOADED_SKILLS = 3; export declare const MAX_PINNED_SKILLS = 2; type SkillVaultRequester = "model" | "user"; type SkillVaultUnloadReason = "explicit" | "idle_expired" | "resource_unavailable" | "budget_exceeded"; interface LoadedSkill { skill: Skill; bodyBytes: number; systemPromptSection: string; requester: SkillVaultRequester; pinned: boolean; loadedAtMs: number; fileDevice: number; fileInode: number; fileSize: number; fileModifiedAtMs: number; fileChangedAtMs: number; } type SkillSlotState = ({ state: "loaded_pending"; } & LoadedSkill) | ({ state: "active"; lastUsedAtMs: number; useCount: number; } & LoadedSkill); export interface SkillSlotStatus { state: SkillSlotState["state"]; name: string; pinned: boolean; loadedAtMs: number; lastUsedAtMs?: number; idleForMs?: number; expiresInMs?: number; useCount?: number; } export interface SkillVaultStatus { idleTimeoutMs: number; slots: SkillSlotStatus[]; reason?: SkillVaultUnloadReason; } export interface SkillSearchResult { candidates: Array<{ name: string; description: string; }>; } export type SkillLoadResult = { ok: true; state: "loaded_pending"; name: string; baseDir: string; pinned: boolean; evicted?: string[]; } | { ok: false; reason: "not_found" | "body_too_large" | "invalid_body" | "read_failed" | "pin_limit"; message: string; }; export type SkillReadResult = { ok: true; name: string; description: string; body: string; } | { ok: false; reason: "not_found" | "body_too_large" | "invalid_body" | "read_failed"; message: string; }; export interface SkillVaultControllerOptions { getSkills(): readonly Skill[]; now?: () => number; idleTimeoutMs?: number; getMaxBodyBytes?: () => number; onSkillUsed?: (skill: Skill, usedAtMs: number) => void; } /** Reserve at most roughly one context token's worth of bytes per advertised context token. */ export declare function resolveActiveSkillBodyByteLimit(contextWindow: number | undefined): number; /** One host-owned, event-driven lifecycle for lazy skill discovery and transient context projection. */ export declare class SkillVaultController { private readonly getSkills; private readonly now; private readonly idleTimeoutMs; private readonly getMaxBodyBytes; private readonly onSkillUsed; private slots; private unloadReason; private contextRevision; constructor(options: SkillVaultControllerOptions); search(rawQuery: string): SkillSearchResult; /** Read one eligible skill body without loading, evicting, or otherwise mutating the vault. */ read(name: string, requester?: SkillVaultRequester): SkillReadResult; /** Host-only metadata snapshot for read-only audit brokers; paths never cross the tool boundary. */ getSkillsSnapshot(): readonly Skill[]; load(name: string, requester: SkillVaultRequester, pin?: boolean): SkillLoadResult; unload(name?: string): { ok: true; unloaded: string[]; }; status(): SkillVaultStatus; commitSystemPromptSection(): string | undefined; /** Model the next request's transient system cost without treating a diagnostic read as use. */ previewSystemPromptSection(): string | undefined; /** Compose the exact provider system prompt for read-only diagnostics. */ previewRequestSystemPrompt(base: string | undefined): string | undefined; /** Monotonic identity for provider-visible skill projection changes. */ getContextRevision(): number; /** Record host-observed work derived from an active skill, independent of agent cooperation. */ noteActivity(): void; private slotStatus; private readSkillBody; private reconcile; private reconcileSlot; private replaceState; private resolveMaxBodyBytes; } export {}; //# sourceMappingURL=skill-vault.d.ts.map