import { AGENTS_REGISTRY, type AgentDefinition } from "../agents/agents-registry.js"; import type { ParsedSkill } from "./transformers/index.js"; export type AgentInstallStatus = "installed" | "exported" | "skipped" | "error"; export interface AgentInstallResult { agentId: string; status: AgentInstallStatus; /** Installed: absolute path of the written file (or comma list when many). * Exported: human-readable label including any downgrade warning. * Skipped: reason. * Error: error message. */ detail: string; /** Tier 3 only: the blob to be copied to clipboard. */ blob?: string; /** Tier 3 only: paste-instructions URL. */ pasteInstructionsUrl?: string; /** Tier 3 only: docs URL. */ docsUrl?: string; } export interface MultiInstallResult { skill: string; scope: "project" | "user"; agents: AgentInstallResult[]; installedCount: number; exportedCount: number; errorCount: number; } export interface MultiInstallOptions { skill: ParsedSkill; agentIds: string[]; scope: "project" | "user"; /** Project root for project-scoped installs and for Tier-1 canonical writes. */ projectRoot: string; /** Optional pre-rendered SKILL.md content. When omitted, the multi-install * reconstructs it from the parsedSkill (frontmatter + body). */ rawSkillContent?: string; } /** * Install a skill to multiple agents in a single pass. Returns one result * row per agent in the same order as `agentIds`. Never throws — each * agent's outcome is captured in its own result row. */ export declare function installSkillToMultipleAgents(opts: MultiInstallOptions): Promise; /** * Dispatch a SINGLE agent through the tier matrix. This is the one shared * code path for both surfaces — Studio (installSkillToMultipleAgents) and the * CLI (installSkillToAgents) call it so Tier-2/Tier-3 behaviour can never drift * between the two. Never throws — every outcome (including unexpected escapes) * is captured in the returned result row. */ export declare function installSkillForAgent(agent: AgentDefinition, skill: ParsedSkill, scope: "project" | "user", projectRoot: string, rawSkillContent?: string): AgentInstallResult; /** * Build a ParsedSkill from raw SKILL.md text. The CLI install path has only * the raw markdown string (fetched from GitHub or read from a plugin dir), * whereas Studio receives a pre-parsed ParsedSkill over the wire. This helper * gives the CLI the same shape so transformers see identical input regardless * of surface. Mirrors the server-side parser in install-skill-routes.ts. */ export declare function parseSkillForInstall(rawContent: string, fallbackName: string, bundleFiles?: Record): ParsedSkill; export interface InstallToAgentsOptions { /** Skill name (already namespaced if applicable) used for Tier-1 dir/symlink. */ skillName: string; /** Raw SKILL.md content — Tier-1 keeps full frontmatter, Tier-2 reparses it. */ rawContent: string; /** Selected agents (already filtered/namespaced by the caller). */ agents: AgentDefinition[]; scope: "project" | "user"; projectRoot: string; /** When true, Tier-1 agents are copied instead of symlinked (CLI --copy). */ copy?: boolean; /** Optional bundled resources (agents/*, scripts/*, …). */ bundleFiles?: Record; } /** * F9 — the CLI-facing install entry point. Dispatches the SAME per-agent * tier matrix as Studio, so a CLI install of a Tier-2 agent (cursor, windsurf, * aider, github-copilot-ext) now produces its real artifact instead of a * dead-letter `/skills//SKILL.md`. * * Tier-1 agents are installed as a single batch through installSymlink / * installCopy — preserving the canonical `.agents/skills` store with relative * symlinks, the claude-code COPY_FALLBACK with full frontmatter, and the * `--copy` option. Tier-2/Tier-3 agents are dispatched one-by-one through the * shared `installSkillForAgent`. * * Returns the flat list of written paths (Tier-1 + Tier-2) for the CLI summary; * Tier-3 (clipboard) agents contribute no path. */ export declare function installSkillToAgents(opts: InstallToAgentsOptions): string[]; export { AGENTS_REGISTRY };