import type { ToolDefinition } from "../tools/types.js"; export interface SkillDefinition { name: string; description: string; tools?: string[]; model?: string; content: string; sourcePath: string; /** Comma-separated tool patterns pre-approved during skill execution. */ allowedTools?: string[]; /** Hint for arguments (e.g. "[file-path]"). */ argumentHint?: string; /** If true, agent cannot auto-invoke — user only via /name. */ disableModelInvocation?: boolean; } /** * Structural policy used to scope which skill files may be loaded. A platform * RuntimePolicy satisfies this shape, so callers can keep skill loading inside * the task's allowed paths without importing platform internals. */ export interface SkillLoaderPolicyLike { assertPathAllowed(path: string): string; } export interface SkillLoaderOptions { /** When set, every skill file path is checked against this policy before reading. */ runtimePolicy?: SkillLoaderPolicyLike; } export declare class SkillLoader { private skills; private pendingInjection; private readonly policy?; /** Monotonically increasing version — bumps on any skill registration or load. */ version: number; constructor(options?: SkillLoaderOptions); /** * Scan a single directory (recursively) for SKILL.md files. */ static fromDirectory(dir: string, options?: SkillLoaderOptions): SkillLoader; /** * Scan multiple directories for SKILL.md files. */ static fromDirectories(dirs: string[], options?: SkillLoaderOptions): SkillLoader; private loadDirectory; private scanDirectory; private loadSkillFile; /** * Create a fork that shares the skill catalog but has its own isolated * pendingInjection state. Use when multiple concurrent agents share the * same SkillLoader to prevent one agent's skill invocation from being * consumed by another agent. */ fork(): SkillLoader; /** * Filter skills to only include those whose names are in the allowlist. * Mutates this loader in place. If allowlist is empty or undefined, no-op. */ filterByAllowlist(allowedSkills: string[] | undefined): void; /** * Register a skill definition programmatically (works in all runtimes). */ register(skill: SkillDefinition): void; /** * Load a single skill from a file path. * Works in Node.js runtimes. Returns true on success. */ loadSkillFromFile(filePath: string): boolean; /** * Get all registered skills. */ getAll(): SkillDefinition[]; /** * Get a single skill by name. */ get(name: string): SkillDefinition | undefined; /** * Returns `` XML string with lean descriptions. * Returns "" if no skills are registered. */ getDescriptionsForContext(): string; /** * Queue a skill's content for injection into the next turn. * Returns true if skill found, false otherwise. */ invoke(name: string, args?: string): boolean; /** * Get the pending injection content (if any). */ getPendingInjection(): string | null; /** * Clear the pending injection queue. */ clearPendingInjection(): void; /** * Returns an ONI-Core ToolDefinition for the "Skill" tool. * This tool allows the agent to invoke skills by name. */ getSkillTool(): ToolDefinition<{ name: string; }, string>; } //# sourceMappingURL=skill-loader.d.ts.map