import type { SkillPackage, SkillSource } from '../core/skills/types.js'; import type { AgentbuddySource } from '../core/skills/sources.js'; export interface DiscoveredSkillCandidate { name: string; displayName?: string; description?: string; version?: string; tags: string[]; path: string; } export interface SkillSourceDiscovery { commit?: string; skills: DiscoveredSkillCandidate[]; /** True when the source resolves its own skill set (agentbuddy) — the dashboard * installs it directly, skipping the discover-then-select step. */ directInstall?: boolean; /** True when discovery fell back to a full-depth recursive scan. The UI * surfaces this so the deeper (slower) scan is visible rather than silent. */ deepScanned?: boolean; } export interface SkillInstallSelection { skillNames?: string[]; all?: boolean; fullDepth?: boolean; } export interface SkillInstallAuditSummary { name: string; sourceType: SkillSource['type']; commit?: string; version?: string; files: number; directories: number; symlinks: number; bytes: number; executables: string[]; executablesTruncated: boolean; runtimes: string[]; } export interface SkillRegistryFile { schemaVersion: 1; skills: Record; } export declare function readSkillRegistry(): SkillRegistryFile; /** Static, non-executing install audit. Paths are relative to the Skill root; * source URLs and absolute host paths are deliberately excluded from logs. */ export declare function buildSkillInstallAuditSummary(pkg: SkillPackage): SkillInstallAuditSummary; export declare function installLocalSkill(dir: string, opts: { link: boolean; }): SkillPackage; export declare function installLocalSkillLinks(dirs: readonly string[]): SkillPackage[]; export declare function discoverLocalSkillCandidates(rootDir: string, opts?: { fullDepth?: boolean; fallbackToFullDepth?: boolean; }): SkillSourceDiscovery; export declare function installLocalSkillsFromSource(rootDir: string, opts: { link: boolean; } & SkillInstallSelection): SkillPackage[]; export declare function discoverGitSkillCandidates(opts: { url: string; ref?: string; path?: string; fullDepth?: boolean; fallbackToFullDepth?: boolean; }): SkillSourceDiscovery; export declare function discoverGitSkillCandidatesAsync(opts: { url: string; ref?: string; path?: string; fullDepth?: boolean; /** Retry recursively against the same checkout so mixed repository layouts * produce the same candidate set during discovery and installation. */ fallbackToFullDepth?: boolean; }): Promise; export declare function installGitSkill(opts: { url: string; path: string; ref?: string; sourceOverride?: SkillSource; }): SkillPackage; export declare function installGitSkillAsync(opts: { url: string; path: string; ref?: string; sourceOverride?: SkillSource; }): Promise; export declare function installGitSkillsFromSource(opts: { url: string; ref?: string; sourceOverride?: SkillSource; } & SkillInstallSelection): SkillPackage[]; export declare function installGitSkillsFromSourceAsync(opts: { url: string; ref?: string; sourceOverride?: SkillSource; } & SkillInstallSelection): Promise; export declare function installAgentbuddySkill(opts: AgentbuddySource, requireSkillName?: string): SkillPackage[]; /** Async twin of installAgentbuddySkill for the dashboard install job — same * behaviour, but awaits the (minutes-long, network-bound) agentbuddy calls off * the daemon event loop instead of blocking it with execFileSync. */ export declare function installAgentbuddySkillAsync(opts: AgentbuddySource, requireSkillName?: string): Promise; export declare function removeInstalledSkill(name: string): { ok: true; } | { ok: false; reason: string; }; /** Remove a store-managed skill tree WITHOUT blocking the caller (and, on the * dashboard, its whole event loop) on a large synchronous `rmSync`. * * A same-filesystem `renameSync` into a sibling `.trash-*` dir is an O(1) * metadata operation (measured <1ms even for a 700MB / 7k-file tree), so the * skill disappears from its rootDir instantly and the caller returns. The * actual recursive unlink then runs fire-and-forget off the event loop. * * A rename failure aborts before the registry is changed. Falling back to the * old recursive rmSync would both reintroduce the dashboard freeze and make a * partial batch impossible to roll back safely. */ type StoreTreeRemovalOps = { rename: (from: string, to: string) => void; removeAsync: (path: string) => Promise; }; /** Test seam for deterministic rename failures without touching host filesystem * permissions. Production callers always use the real operations. */ export declare function __testOnly_setStoreTreeRemovalOps(ops: StoreTreeRemovalOps | undefined): void; /** Best-effort reclamation of `.trash-*` dirs left behind by an interrupted * background unlink (process crash/restart mid-delete). Fire-and-forget; a * failure just defers reclamation to a later startup. Safe to call at boot. */ export declare function sweepStoreTrash(): void; export declare function removeInstalledSkills(names: readonly string[]): { ok: true; removed: string[]; } | { ok: false; reason: string; missing?: string[]; }; export declare function updateInstalledSkill(name: string): { ok: true; skill: SkillPackage; } | { ok: false; reason: string; }; export declare function updateInstalledSkillAsync(name: string): Promise<{ ok: true; skill: SkillPackage; } | { ok: false; reason: string; }>; export {}; //# sourceMappingURL=skill-registry-store.d.ts.map