/** * `agentsmarket install ` — download a skill's SKILL.md to the local agent's skill directory. * * MCP-first philosophy: the LLM/agent knows where it lives, so it does the install. * This CLI is a fallback for users without an LLM in the loop — it tries env-var-driven * detection + auto-detection of common agent dirs. If none found, prints content to stdout * so the user can copy-paste manually. * * Lookup strategy (R23, mirrored from pipelines): try by display name first * (`/v1/skills/by-slug/`), fall back to id (`/v1/skills/`). The user-facing * slug on the marketplace page matches the URL, not the internal id * (e.g. `apple-ui-design` not `skill_apple_design_v1`). * * Install dir + layout detection priority (in order): * 1. $AGENTSMARKET_INSTALL_DIR (universal override; legacy `.md` flat) * 2. $AGENTSMARKET_SKILLS_DIR / `/.agents/skills/` / `~/.agents/skills/` * (cross-client `.agents/skills//SKILL.md` layout per Agent Skills v1.1) * 3. $OPENCODE_DIR / $CLAUDE_CODE_DIR / $CURSOR_DIR / $CODEX_DIR / * $WINDSURF_DIR / $AIDER_DIR (agent-specific env vars; legacy flat) * 4. Auto-detect: ~/.config/opencode/skills, ~/.claude/skills, ~/.cursor/skills, * ~/.codex/skills, ~/.windsurf/skills, ~/.aider/skills (legacy flat) * 5. Fallback: print content to stdout */ import { buildVariantDPayment } from '../lib/variant-d-payment.js'; import { tryLoadIdentity } from './call.js'; /** * Buying a paid skill reaches two places the tests cannot: the token's * on-chain nonce (to sign the permit) and the identity on disk. Both are * seams, the same way `pipeline install` treats them. */ export interface InstallDeps { buildPayment?: typeof buildVariantDPayment; loadIdentity?: typeof tryLoadIdentity; } export interface InstalledSkillFile { path: string; name: string | null; version: string | null; } export interface InstalledSkillsDir { dir: string; files: InstalledSkillFile[]; } /** * Every skill file the agent can see, across the directories the installer knows. * * The MCP handle that answers "what do I have installed, and is it current" * has to read the same directories the installer writes to. A second list of * directories would drift, and the handle would then report a different truth * than the one the agent lives in — which is worse than no answer at all. * * Both layouts are read: `//SKILL.md` (the Agent Skills standard) * and `/.md` (the flat one). */ export declare function findInstalledSkills(): InstalledSkillsDir[]; export declare function installCommand(skillId: string, deps?: InstallDeps): Promise;