/** * Skill setup and project preferences. * * Skills are discovered through the CLI/MCP registry and executed from the * bundled package or the remote platform. This module deliberately does not * copy skill source, SKILL.md, package.json, scripts, or runtime folders into * projects or agent-native skill folders. */ 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; export declare function installSkillForAgent(name: string, options: AgentInstallOptions, _generateSkillMd?: (name: string) => string | null): InstallResult; export declare function removeSkillForAgent(_name: string, _options: AgentInstallOptions): boolean; export {};