import { SkillL1, SkillReference, SkillListResult, SkillPreview, ToolDeclaration, SkillRegistryEntry, IDependencyInstaller } from './types'; import { SkillSearchResult, MirrorConfig } from './finder/skill-finder'; export interface SkillFrameworkOptions { /** Custom dependency installers. Defaults to built-in npm + pip. */ dependencyInstallers?: IDependencyInstaller[]; /** Mirror URLs for GitHub and ClawHub APIs. Also configurable via env vars SKILL_GITHUB_API, SKILL_GITHUB_DOWNLOAD, SKILL_CLAWHUB_API. */ mirror?: MirrorConfig; } /** * Unified entry point for the SKILL framework. * * Usage: * ```ts * const skillFramework = SkillFramework.init('./skills-storage'); * * // List installed skills (L0) * const skills = skillFramework.listSkills(); * * // Install a skill from directory or zip * await skillFramework.install('./my-skill'); * * // Uninstall a skill * await skillFramework.uninstall('my-skill'); * * // Load skill main content (L0→L1) * const main = skillFramework.loadMain('my-skill'); * * // Load a reference file (L1→L2) * const ref = skillFramework.loadReference('my-skill', 'references/guide.md'); * * // List tools declared by a skill * const tools = skillFramework.listTools('my-skill'); * * // Get all tool declarations for model prompting * const frameworkDecls = skillFramework.getFrameworkToolDeclarations(); * const businessDecls = skillFramework.getAllSkillToolDeclarations(); * * // Extend with custom language installers: * const sf = SkillFramework.init('./skills', { * dependencyInstallers: [new MyCargoInstaller()], * }); * ``` */ export declare class SkillFramework { private readonly storageDir; private readonly registry; private readonly installer; private readonly _tools; private constructor(); /** * Initialize the framework with the given skills storage directory. * Creates the directory if it doesn't exist. */ static init(skillsFolder: string, options?: SkillFrameworkOptions): SkillFramework; /** Configure mirror URLs for GitHub and ClawHub APIs. */ static configureMirror(config: MirrorConfig): void; /** Install a skill from a source path (directory or .zip file). */ install(source: string): Promise; /** Uninstall a skill by name. */ uninstall(name: string): Promise; /** List all installed skills as L0 summaries. */ listSkills(): SkillListResult; /** Check if a skill is installed. */ hasSkill(name: string): boolean; /** Get full registry entry for a skill. */ getSkill(name: string): SkillRegistryEntry; /** Load the full SKILL.md content for a skill (L0→L1). */ loadMain(name: string): SkillL1; /** Load a reference file from a skill package (L1→L2). */ loadReference(name: string, referencePath: string): SkillReference; /** * Preview a skill package before installation. * Copies/extracts the source to a temp directory under the skills storage, * parses SKILL.md and manifest.json, and returns L0 summary + tool list + tempDir. * Use `installPreviewed(tempDir)` to finalize or `cancelPreview(tempDir)` to discard. */ previewSkill(source: string): SkillPreview; /** * Install a previously previewed skill from its temp directory. * Renames the temp dir to the final skill directory, installs deps, and registers. */ installPreviewed(tempDir: string): Promise; /** * Cancel a preview and clean up the temp directory. */ cancelPreview(tempDir: string): void; /** List tools declared by a specific skill. */ listTools(name: string): ToolDeclaration[]; /** Get framework-level tool declarations for model prompting. */ getFrameworkToolDeclarations(): ToolDeclaration[]; /** Get namespaced business tool declarations for a specific skill. */ getSkillToolDeclarations(skillName: string): ToolDeclaration[]; /** Get all namespaced business tool declarations across all skills. */ getAllSkillToolDeclarations(): ToolDeclaration[]; /** Parse a namespaced business tool name into { skillName, toolName }. */ parseNamespacedToolName(namespacedToolName: string): { skillName: string; toolName: string; } | null; /** Execute a skill tool script. */ runScript(params: { name: string; toolName: string; args?: string; }): Promise<{ stdout: string; stderr: string; exitCode: number; }>; /** Search for skills from all sources (GitHub + ClawHub). */ static searchSkills(query: string): Promise; /** Download a skill zip from the given source (GitHub or ClawHub). Returns the temp zip path. */ private downloadSkillZip; /** Preview a skill from the network (GitHub owner/repo or ClawHub slug). */ previewSkillFromNetwork(source: string): Promise; /** Install a skill from the network (GitHub owner/repo or ClawHub slug). */ installFromNetwork(source: string): Promise; /** Remove the .download temp directory if it's empty. */ private cleanupDownloadDir; /** Remove any leftover .preview-* directories. */ private cleanupPreviewDirs; } export * from './types'; export type { MirrorConfig, SkillSearchResult } from './finder/skill-finder'; //# sourceMappingURL=index.d.ts.map