import { type AgentId } from '../agents/registry'; import { type Platform } from '../config/mcpConfig'; import { type ContentInstallItem } from './content'; export interface UpdateOptions { cwd: string; agents: AgentId[]; skills: boolean; skillsSourceOverride: string | null; skillsGlobal: boolean; force: boolean; dryRun: boolean; json: boolean; /** Refresh AGENTS.md and hooks/settings/mcp targets — match init opt-outs. */ instruction: boolean; hooks: boolean; /** Materialize the vendored mlua-lsp runtime for hook/runtime reuse. Default: true. */ mluaLsp: boolean; mcp: boolean; /** Refresh content skill sets recorded in the lock. Default: true. */ content: boolean; /** KEY=VALUE substitutions for `{KEY}` placeholders in mcp.yaml. Legacy * Unity client emits these via repeated --mcp-var; new code can also * go through --mcp-url / --mcp-client-path which write the same map. */ mcpVars: Record; /** MCP conflict resolution policy. When set, overrides the env-based * default (MSWAI_ENV=prod → overwrite, otherwise → keep) and the * interactive TTY prompt for the duration of this run. */ mcpConflict: 'keep' | 'overwrite' | null; /** Force non-interactive: skip prompts, use flags + defaults as-is. */ silent: boolean; /** Opt-in interactive selection. When false (default), update auto-detects * installed agents and proceeds with current feature flags as-is — no * prompts even on a TTY. Set via `-i/--interactive`. Ignored when * --silent / --json / non-TTY (those force non-interactive). */ interactive: boolean; /** True when the user passed `-a/--agent` explicitly. When false, update * auto-detects installed agents from on-disk footprint instead of touching * all four. Lets `--silent` runs stay scoped to whatever's installed. */ agentsExplicit: boolean; /** Override platform detection — used by tests to exercise non-host platforms. */ platform?: Platform; } type ItemAction = 'updated' | 'created' | 'noop' | 'skipped' | 'failed' | 'dry-run' | 'bundled-fallback'; interface ItemResult { action: ItemAction; reason?: string; stderrTail?: string; [key: string]: unknown; } interface InstructionItemResult extends ItemResult { path?: string; } export interface UpdateResult { dryRun: boolean; packageVersion: { current: string; latest: string | null; updateAvailable: boolean; }; instruction: ItemResult; /** Per-agent instruction file (CLAUDE.md, .cursorrules, .github/copilot-instructions.md). */ agents: Partial>; claudeSettings: ItemResult; hooks: Record; hookWarnings: string[]; removedHookTopics: string[]; removedHookFiles: string[]; keptUserOwnedHookFiles: string[]; skills: ItemResult; /** MCP config files (per-agent). Action covers the whole step; per-target results in `targets`. */ mcp: ItemResult & { servers?: string[]; targets?: Record; }; mluaLsp: ItemResult; /** Content skill sets recorded in the lock. Action covers the whole step; per (skill, agent) results in `items`. */ content: ItemResult & { items?: ContentInstallItem[]; }; skipped: { path: string; reason: string; }[]; } export declare function runUpdate(opts: UpdateOptions): Promise; export declare function printUpdateHelp(): void; export declare function parseUpdateArgs(args: string[]): UpdateOptions | { help: true; }; export declare function updateCommand(args: string[]): Promise; export {};