/** * Skill setup and project preferences. * * Skills are discovered through the CLI/MCP registry and executed from the bundled * package or the remote platform. Project state remains metadata-only pins. Agent skill * folders, however, are now written by the last-mile sync: installSkillForAgent() writes a * per-tool-adapted SKILL.md into an agent's folder, non-clobbering, marking each directory * it owns so a re-sync never overwrites a skill the user hand-authored. */ import { type SkillMeta } from "./registry.js"; import { type ProjectSkillPin } from "./project-state.js"; export interface InstallResult { skill: string; success: boolean; error?: string; path?: string; mode?: InstallMode; source?: InstallSource; } export interface InstallOptions { targetDir?: string; overwrite?: boolean; } export type InstallMode = "pin" | "source" | "manifest"; export type InstallSource = ProjectSkillPin["source"]; export interface SkillInstallManifest { name: string; skillMd: string; version?: string; source?: InstallSource; metadata?: Record; } export interface ManifestInstallOptions extends InstallOptions { source?: InstallSource; createRuntimeDirs?: boolean; writeManifestFile?: boolean; } interface InstallMetaEntry { installedAt: string; version: string; mode?: InstallMode; source?: InstallSource; } interface MetaFile { skills: Record; disabled?: string[]; } /** * Get the path to a bundled skill in the package. */ export declare function getSkillPath(name: string): string; /** * Check if a skill exists in the bundled/registered catalog. */ export declare function skillExists(name: string): boolean; /** * Pin a skill in .skills/project.json. * * This intentionally does not write .skills/skills or any SKILL.md/source files. */ export declare function installSkill(name: string, options?: InstallOptions): InstallResult; export declare function installRemoteSkill(skill: SkillMeta, options?: InstallOptions): InstallResult; /** * Source installs are disabled by design. Runtime source stays in the package * or on the platform, never in a user project. */ export declare function installSkillSource(name: string, _options?: InstallOptions): InstallResult; /** * SKILL.md manifest installs are disabled. Docs are served by the remote or * bundled registry and must not be cached into project skill folders. */ export declare function installSkillManifest(manifest: SkillInstallManifest, _options?: ManifestInstallOptions): InstallResult; /** * Build an in-memory manifest from a bundled local skill. */ export declare function createLocalSkillManifest(name: string, generateSkillMd?: (name: string) => string | null): SkillInstallManifest | null; export declare function installSkills(names: string[], options?: InstallOptions): InstallResult[]; export declare function getInstallMeta(targetDir?: string): MetaFile; export declare function disableSkill(name: string, targetDir?: string): boolean; export declare function enableSkill(name: string, targetDir?: string): boolean; export declare function getDisabledSkills(targetDir?: string): string[]; /** * Project-pinned skills. Historically this represented copied installs; it now * reads .skills/project.json only. */ export declare function getInstalledSkills(targetDir?: string): string[]; export declare function removeSkill(name: string, targetDir?: string): boolean; export declare function pinSkill(name: string, options?: InstallOptions): InstallResult; export declare function unpinSkill(name: string, targetDir?: string): boolean; export declare function getPinnedSkills(targetDir?: string): string[]; export type AgentTarget = "claude" | "codex" | "gemini" | "pi" | "opencode" | "cursor" | "windsurf"; export type AgentScope = "global" | "project"; export declare const AGENT_TARGETS: AgentTarget[]; export declare const AGENT_LABELS: Record; export declare function resolveAgents(agentArg: string): AgentTarget[]; export interface AgentInstallOptions { agent: AgentTarget; scope?: AgentScope; projectDir?: string; } export declare function getAgentSkillsDir(agent: AgentTarget, scope?: AgentScope, projectDir?: string): string; export declare function getAgentSkillPath(name: string, agent: AgentTarget, scope?: AgentScope, projectDir?: string): string; /** * Write a skill's SKILL.md into one agent's skill folder, per-tool adapted and * non-clobbering. * * This used to be a stub that refused every call ("pins, not installs"). The last-mile * work reverses that: agents load skills from these folders, so `skills sync` writes them * there. An unmanaged directory with SKILL.md can be explicitly adopted with * `overwrite`; any other pre-existing unmarked directory is never touched. Managed * writes replace the complete owned directory — see writeManagedSkillDir. */ export declare function installSkillForAgent(name: string, options: AgentInstallOptions & { overwrite?: boolean; dryRun?: boolean; }, generateSkillMd?: (name: string) => string | null): InstallResult; export declare function removeSkillForAgent(name: string, options: AgentInstallOptions): boolean; export {};