/** * Skill Manager - Manages skills loading and expansion * * Handles skill initialization, reloading, and command expansion. */ import type { Skill, SkillDiagnostic, SkillRuntimeStatus } from './types.js'; export interface SkillLoadResult { skills: Skill[]; prompt: string; diagnostics: SkillDiagnostic[]; } export interface SkillManagerOptions { isWorkspaceTrusted?: (workspaceDir: string) => boolean; } export declare class SkillManager { private skillPrompt; private skills; private skillLoader; private workspace; private bundledSkillsDir; private version; private loadedAt; private reloadInProgress; private reloadPending; private lastReloadStartedAt; private lastReloadFinishedAt; private lastReloadReason; private lastReloadOk; private lastReloadError; constructor(workspace: string, bundledSkillsDir?: string, options?: SkillManagerOptions); /** * Initialize skills from workspace and bundled directories */ private initialize; /** * Recompute skill XML prompt from current skills.json (no disk rescan). */ refreshPromptFromConfig(): void; /** * Reload skills from disk */ reload(reason?: 'disk' | 'trust'): void; private runReload; private applyLoadResult; /** * Get the skill prompt to append to system prompt */ getPrompt(): string; /** * `` XML with optional per-agent allowlist and/or tool-based gating. * When both arguments are omitted, returns the cached prompt from disk load (no tool gating). */ getPromptForSkillAllowlist(allowlist: string[] | undefined, registeredToolNames?: string[]): string; /** Skills visible for prompts and skills_list given the same indexing options as {@link getPromptForSkillAllowlist}. */ selectSkillsForAgentIndexing(options?: { skillAllowlist?: string[]; registeredToolNames?: string[]; }): Skill[]; /** * Get all loaded skills */ getSkills(): Skill[]; getDiagnostics(): SkillDiagnostic[]; getVersion(): string; getLoadedAt(): number; getStatus(): SkillRuntimeStatus; /** * Get skill names */ getSkillNames(): string[]; /** Names of skills included in the agent system prompt (``). */ getSkillNamesForPrompt(): string[]; /** * Skills that are enabled for model discovery (respects skills.json and requirement checks). */ getEnabledSkills(): Skill[]; /** * Like {@link getEnabledSkills} plus optional allowlist and tool gating (matches ``). */ getEnabledSkillsForAgentSession(options?: { skillAllowlist?: string[]; registeredToolNames?: string[]; }): Skill[]; getActivatedCapabilitiesForText(text: string, options?: { skillAllowlist?: string[]; registeredToolNames?: string[]; }): string[]; /** * Find a skill by name */ findSkill(name: string): Skill | undefined; /** * Check if a skill exists */ hasSkill(name: string): boolean; /** * Expand a skill command into a full skill block */ expandCommand(text: string, options?: { skillAllowlist?: string[]; registeredToolNames?: string[]; }): string; /** * Parse a /skill: command */ private parseSkillCommand; /** * Build a skill block for inclusion in the prompt */ private buildSkillBlock; }