/** * `agent-native skills` is the friendly install surface for app-backed skills. * The lower-level `app-skill` commands remain the packaging primitives; this * command handles the common "install Assets for my agent" path in one step. */ import { type AppSkillManifest } from "./app-skill.js"; import { type ClientId } from "./mcp-config-writers.js"; import { installScreenMemoryForClient } from "./mcp.js"; import { CANVAS_REFERENCE_MD, CONNECTION_REFERENCE_MD, DOCUMENT_QUALITY_REFERENCE_MD, EXEMPLAR_REFERENCE_MD, LOCAL_FILES_REFERENCE_MD, VISUAL_PLANS_SKILL_MD, VISUAL_RECAP_SKILL_MD, VISUALIZE_REPO_SKILL_MD, WIREFRAME_REFERENCE_MD } from "./skills-content/index.js"; import { type CliTelemetry } from "./telemetry.js"; export { CANVAS_REFERENCE_MD, CONNECTION_REFERENCE_MD, DOCUMENT_QUALITY_REFERENCE_MD, EXEMPLAR_REFERENCE_MD, LOCAL_FILES_REFERENCE_MD, VISUAL_PLANS_SKILL_MD, VISUAL_RECAP_SKILL_MD, VISUALIZE_REPO_SKILL_MD, WIREFRAME_REFERENCE_MD, }; export declare const BUILT_IN_APP_SKILLS: { assets: { skillName: string; manifest: AppSkillManifest; skillMarkdown: string; }; content: { skillName: string; manifest: AppSkillManifest; skillMarkdown: string; }; rewind: { skillName: string; screenMemoryMcp: true; manifest: AppSkillManifest; skillMarkdown: string; }; design: { skillName: string; extraSkills: { "visual-edit": string; }; manifest: AppSkillManifest; skillMarkdown: string; }; "visual-plans": { skillName: string; extraSkills: { "visual-recap": string; "visualize-repo": string; }; extraFiles: { "visual-plan": { "references/wireframe.md": string; "references/canvas.md": string; "references/document-quality.md": string; "references/exemplar.md": string; "references/connection.md": string; "references/local-files.md": string; }; "visual-recap": { "references/wireframe.md": string; "references/connection.md": string; "references/local-files.md": string; }; }; manifest: AppSkillManifest; skillMarkdown: string; }; "context-xray": { skillName: string; localOnly: true; manifest: AppSkillManifest; skillMarkdown: string; }; }; export declare const AGENT_NATIVE_SKILL_METADATA_FILE = "agent-native-skill.json"; type SkillInstructionClientId = ClientId | "pi"; type SkillsCommand = "list" | "add" | "status" | "update" | "help"; type PlanInstallMode = "hosted" | "local-files" | "self-hosted"; export interface ParsedSkillsArgs { command: SkillsCommand; target?: string; baseDir?: string; client: string; clientExplicit: boolean; clients?: SkillInstructionClientId[]; plainSkillNames?: string[]; scope: string; scopeExplicit: boolean; yes: boolean; dryRun: boolean; printJson: boolean; instructions: boolean; mcp: boolean; /** * Run the browser/device auth flow after registering a hosted MCP connector * so the user does not hit an OAuth wall on the first tool call. Default true; * `--no-connect` opts out and leaves authentication for the host/`agent-native * connect`. */ connect: boolean; /** * Optional MCP URL override. When set, the skill's hosted MCP connector is * registered against this URL instead of the built-in hosted default — e.g. * an ngrok tunnel, a local dev origin, or a self-hosted deployment. */ mcpUrl?: string; /** * Storage/backend mode for app-backed skills that support install modes. The * field name is kept for CLI/API compatibility with the original Plan-only * implementation. */ planMode?: PlanInstallMode; /** * When installing the visual-plan skill, also write the PR Visual Recap * GitHub Action workflow into `.github/workflows/` so PRs get automatic * recaps. Only applies to the `visual-plan` target. */ withGithubAction?: boolean; /** * Set once the PR Visual Recap workflow decision has already been made up * front (in `runSkills`, before any install/registration) so the per-target * `addAgentNativeSkill` doesn't prompt for it again mid-flow. The chosen * value lands in `withGithubAction`. */ githubActionResolved?: boolean; /** * Plain skill repos can add a managed AGENTS.md / CLAUDE.md block for skills * that only become automatic through project instructions. */ updateInstructions?: boolean; /** * When `--with-github-action` is set and the existing workflow file differs * from the bundled template, overwrite it. Without this flag the command * refuses and prints a message. */ force?: boolean; } export interface SkillsAddResult { id: string; displayName: string; instructionSource?: string; skillNames: string[]; skillsAgents: string[]; mcpUrl: string; mcpClients: ClientId[]; dryRun: boolean; commands: string[]; local?: boolean; scriptPath?: string; written?: string[]; /** * True when the install also kicked off (or prepared) the browser/device auth * flow for the hosted MCP connector. False when connect was skipped * (`--no-connect`, no-auth skills, or non-interactive without a connect step). */ connected?: boolean; /** * The exact `npx @agent-native/core@latest connect ` command to run when interactive auth * was skipped (non-interactive shell / CI). Empty when connect ran inline or * was not needed. */ connectCommand?: string; /** * When `--with-github-action` installed the PR Visual Recap workflow, the * repo-relative path it was written to (and whether it overwrote an existing * file). */ githubActionPath?: string; githubActionExisted?: boolean; githubActionSuggestedCommand?: string; localManifestPath?: string; planMode?: PlanInstallMode; } interface RunCommandOptions { stdio?: "inherit" | "stderr" | "silent"; } export type SkillsCatalogMode = "agent-native" | "all"; export interface PublicSkillCatalogEntry { name: string; description?: string; } interface ConnectSpinner { start(message?: string): void; clear(): void; } export interface RunSkillsOptions { baseDir?: string; /** * Which skills appear in the shared add/list picker. `agent-native` is the * core CLI surface; `all` is used by @agent-native/skills to append public * skill-repo entries while keeping every prompt and install decision here. */ catalogMode?: SkillsCatalogMode; /** * The plain skills repo/source to install when a public catalog entry is * selected. @agent-native/skills usually passes the materialized source root. */ publicSkillSource?: string; /** * Public skill-repo entries discovered by @agent-native/skills. Core owns the * user-facing flow; the wrapper owns materializing the broader catalog. */ publicSkillEntries?: PublicSkillCatalogEntry[]; /** * Built-in Agent Native skill prompt/list entries to hide for wrapper CLIs. * Direct installs by explicit name still work; this only controls discovery. */ hiddenBuiltInSkillTargets?: string[]; isInteractive?: () => boolean; log?: (message: string) => void; /** * Optional output hook for the embedded `agent-native connect` transcript. * Defaults to `log`; the clack-based CLI uses this to render the multi-line * auth details as one continuous guide block instead of separate status logs. */ connectLog?: (message: string) => void; /** * Optional spinner factory for the embedded connect flow. The default CLI only * enables this for real TTYs so captured/test output stays deterministic. */ createConnectSpinner?: () => ConnectSpinner | undefined; promptClients?: (context: SkillsClientPromptContext) => Promise; promptSkills?: (context: SkillsTargetPromptContext) => Promise; promptGithubAction?: (context: SkillsGithubActionPromptContext) => Promise; promptScope?: (context: SkillsScopePromptContext) => Promise<"project" | "user" | null>; promptPlanMode?: (context: SkillsPlanModePromptContext) => Promise; promptPlanMcpUrl?: () => Promise; promptUpdateInstructions?: () => Promise; runCommand?: (cmd: string, args: string[], options?: RunCommandOptions) => Promise; /** * Injectable connect/auth entrypoint (defaults to the real `agent-native * connect`). Tests stub this so the install flow does not perform a real * browser/device OAuth round-trip. */ runConnect?: (args: string[]) => Promise; installScreenMemory?: typeof installScreenMemoryForClient; /** * Best-effort install-funnel telemetry. Created once per `runSkills` run and * threaded through resolution/install/connect so each `track` is fire-and- * forget and never blocks or throws into the install flow. Absent when * `addAgentNativeSkill` is called directly (e.g. tests). */ telemetry?: CliTelemetry; } interface SkillsClientPromptContext { initialClients: SkillInstructionClientId[]; options: Array<{ value: SkillInstructionClientId; label: string; hint: string; }>; installsMcp: boolean; } interface SkillsTargetPromptContext { initialTargets: string[]; options: Array<{ value: string; label: string; hint: string; }>; } interface SkillsGithubActionPromptContext { workflowPath: string; setupCommand: string; docsUrl: string; } interface SkillsScopePromptContext { initialScope: "project" | "user"; } interface SkillsPlanModePromptContext { initialMode: PlanInstallMode; } export declare function parseSkillsArgs(argv: string[]): ParsedSkillsArgs; export declare function addAgentNativeSkill(parsed: ParsedSkillsArgs, options?: RunSkillsOptions): Promise; export declare function runSkills(argv: string[], options?: RunSkillsOptions): Promise; //# sourceMappingURL=skills.d.ts.map