export type SfSkillsMethod = 'skills-cli' | 'git-clone' | 'skipped'; export type SfSkillsStatus = 'installed' | 'tools-missing' | 'install-failed'; export type SfSkillsAttempt = { method: Exclude; failure: 'command-failed' | 'invalid-layout' | 'no-skills' | 'copy-failed'; detail?: string; }; export type SfSkillsResult = { installed: boolean; method: SfSkillsMethod; status: SfSkillsStatus; attempts?: SfSkillsAttempt[]; /** Number of skill directories installed (null when the count is unknown). */ skillCount: number | null; /** User-facing message describing what happened / the manual fallback. */ message: string; }; /** * Injectable command runner so tests can mock `npx`/`git` without spawning real * processes or hitting the network. Defaults to the real implementations. */ export type SfSkillsRunner = { /** True when `name` resolves on PATH. */ hasBinary: (name: string) => boolean; /** Run a command; throw on non-zero exit. `cwd` is optional. */ exec: (file: string, args: string[], cwd?: string) => void; }; /** * Install the official Salesforce Agent Skills into a workspace, best-effort, * with a three-level fallback so a missing `npx` or network never breaks setup. * * Level 1: `npx skills add forcedotcom/sf-skills` into a scratch dir, then * relocate the installed skills into `.setup-agents/sf-skills/`. The CLI itself * targets `.agents/skills/` (auto-scanned) — we never leave anything there. * Level 2: `git clone --depth 1` then copy `skills/*` into * `.setup-agents/sf-skills/`, used when `npx` is unavailable but `git` is. * Level 3: skip with guidance when neither tool is available (or both fail). * * Idempotent: every path copies into the on-demand dir, overwriting same-named * skill folders rather than duplicating them. */ export declare function installSfSkills(cwd: string, runner?: SfSkillsRunner): SfSkillsResult;