import type { SkillLoader } from '../types/skill.js'; import { type InstalledSkillEntry } from './manifest-store.js'; import type { RegistrySearchOptions, RegistrySearchResult, SkillRegistryAdapter } from './registry/registry-adapter.js'; export interface SkillInstallerOptions { /** Path to the profile manifest file (profiles//installed-skills.json) */ manifestPath: string; /** Path to project-level skills dir (/.wrongstack/skills/) */ projectSkillsDir: string; /** Path to profile skills dir (~/.wrongstack/profiles//skills/) */ globalSkillsDir: string; /** Current project hash (for manifest tracking) */ projectHash: string; /** Skill loader — cache will be invalidated after mutations */ skillLoader?: SkillLoader | undefined; /** Logger for status messages */ log?: ((msg: string) => void) | undefined; /** * Skill registries used to resolve `:` refs and to * serve `/skill-search`. Defaults to `[githubDirectAdapter]` (the original * direct `user/repo` install path). Add a skills.sh adapter to enable * searching the marketplace and installing registry hits by id. */ registryAdapters?: SkillRegistryAdapter[] | undefined; } export interface InstallResult { name: string; path: string; scope: 'project' | 'user'; source: string; ref: string; skillCount: number; } export interface UpdateResult { updated: Array<{ name: string; oldRef: string; newRef: string; }>; unchanged: string[]; errors: Array<{ name: string; error: string; }>; } export declare class SkillInstaller { private readonly opts; private readonly manifest; private readonly adapters; constructor(opts: SkillInstallerOptions); /** * Install skills from a skill reference. * * Accepts two ref formats: * - `user/repo[@ref]` — direct GitHub install (original path) * - `:` — registry-resolved (e.g. * `skills.sh:owner/repo@v1`); the * adapter resolves it to a `user/repo` * ref and the install proceeds as above. * * Supports both single-skill repos (SKILL.md at root) and multi-skill repos * (skills/ subdirectory). The manifest records the GitHub source as * `github:owner/repo` (so `/skill-update` keeps working) plus the originating * registry in `registryFrom` when the install came through a registry. */ install(refInput: string, opts?: { global?: boolean | undefined; }): Promise; /** * Import skills from a local directory (e.g. `.claude/skills`) into the * project or user skills dir, optionally as symlinks. Used by `/skill-import` * to take ownership of foreign skills so they can be edited/committed. * Each direct subdirectory containing a valid `SKILL.md` is copied verbatim. */ importFromDir(srcDir: string, opts?: { global?: boolean | undefined; link?: boolean | undefined; }): Promise; /** * Update installed skills. * - No args: update all * - Name: update that specific skill * - Name + newRef: update to a different ref */ update(nameOrRef?: string | undefined, _opts?: { global?: boolean | undefined; } | undefined): Promise; /** * Uninstall a skill by name. */ uninstall(name: string, opts?: { global?: boolean | undefined; }): Promise; /** * List all installed skills from the manifest. */ listInstalled(): Promise; /** * Search across all configured registry adapters. Results from each adapter * are merged (deduplicated by `installRef`, adapters earlier in the list win * conflicts). Adapters that don't support search (e.g. github-direct) * contribute nothing. */ search(query: string, opts?: RegistrySearchOptions): Promise; /** * Detect skills in an extracted repository. * Returns an array of detected skills with their files. */ private detectSkills; /** * Remove all files for an installed skill. */ private removeSkillFiles; /** * Invalidate the skill loader's cache so newly installed skills appear. */ private invalidateLoaderCache; /** * Resolve an install ref, dispatching registry-prefixed refs to the matching * adapter. Returns the concrete `user/repo[@ref]` install ref plus provenance * (which adapter resolved it, if any). */ private resolveRef; } //# sourceMappingURL=skill-installer.d.ts.map