/** Scope classification — where a skill lives in the three-part world. */ export type SkillScope = "own" | "installed" | "global"; /** * 0698 T-001: new scope vocabulary aligned with Anthropic docs. * Coexists with legacy `SkillScope`; api.ts boundary normalizer translates. */ export type SkillScopeV2 = "available-project" | "available-personal" | "available-plugin" | "authoring-project" | "authoring-plugin"; export type SkillGroup = "available" | "authoring"; export type SkillSource = "project" | "personal" | "plugin"; /** How the skill ended up on disk: authored in-project, copied from a cache, * or symlinked to a canonical source (typically a plugin cache). */ export type SkillInstallMethod = "authored" | "copied" | "symlinked"; export interface SkillInfo { plugin: string; skill: string; dir: string; hasEvals: boolean; hasBenchmark: boolean; /** 0682 origin split — still populated for back-compat (SSoT for 0683). */ origin: "source" | "installed"; /** 0686 tri-scope classification. Defaults to "own" for the two-scope * `scanSkills()` path to stay backward-compatible. */ scope?: SkillScope; /** 0686 symlink metadata — always set by scanSkillsTriScope(). */ isSymlink?: boolean; symlinkTarget?: string | null; installMethod?: SkillInstallMethod; /** 0686 sourceAgent — the registry agent id whose scope owns this skill. * null for own-scope skills. */ sourceAgent?: string | null; scopeV2?: SkillScopeV2; group?: SkillGroup; source?: SkillSource; precedenceRank?: number; shadowedBy?: SkillScopeV2 | null; /** 0698 T-004/T-005 plugin metadata — set when source === "plugin". */ pluginName?: string | null; pluginNamespace?: string | null; pluginMarketplace?: string | null; pluginManifestPath?: string | null; pluginVersion?: string | null; /** * 0769 T-002: editable upstream source path for plugin-cache skills. * For installed plugin skills, points at the marketplace clone * (~/.claude/plugins/marketplaces//plugins//skills/) when * that directory exists, otherwise null. The cache snapshot at `dir` is a * per-version copy; the marketplace clone is what users edit + git-track. */ sourcePath?: string | null; /** * 0802: friendly tool display name (e.g. "Claude Code") for the plugin * group header caption. Set when the `plugin` label maps to a known agent * (personal scope always; project scope when the folder name matches an * agent's localSkillsDir prefix). Absent for unknown plugin folders so * the UI can hide the caption cleanly. */ pluginDisplay?: string; } /** Test-only — reset the per-process warn de-bouncer between cases. */ export declare function __resetDedupeWarnCache(): void; export declare function dedupeByDir(skills: SkillInfo[]): SkillInfo[]; /** * Classify a skill's origin based on its filesystem path relative to root. * Skills inside agent config directories or plugin caches are "installed". */ export declare function classifyOrigin(skillDir: string, root: string): "source" | "installed"; export declare function scanSkills(root: string): Promise; export interface TriScopeOptions { /** Registry id of the active agent whose installed + global scopes we surface. */ agentId: string; /** Override the home dir used for the global scope. Primarily for tests and * for contexts that want to point at a fixture home. When unset, the global * dir is resolved via `resolveGlobalSkillsDir(agent)` (which reads * `os.homedir()` + platform fallback rules). */ home?: string; } /** * Scan a project root and an agent's global skills dir, returning all three * scopes tagged with scope/installMethod/symlink metadata. */ export declare function scanSkillsTriScope(root: string, opts: TriScopeOptions): Promise; /** * 0769 T-004: exported for plugin-scanner.ts so cache-installed plugin skills * derive installMethod from lstat truth instead of a hardcoded "symlinked". */ export declare function installMethodFor(skillDir: string, scope: SkillScope, isSymlink?: boolean): SkillInstallMethod;