/** * Execute an update: confirm, run the detected package manager, verify, and * bring generated assets back in step. * * Shared by `auden update` and `auden doctor`'s offer-to-update prompt so the * confirmation wording, the channel-preserving package spec, and the * post-install verification cannot drift between the two entry points. */ import { spawnSync } from 'node:child_process'; import { type InstallManager } from './install-manager.js'; import type { AvailableUpdate } from './notice.js'; export type PerformUpdateResult = { status: 'declined'; } | { status: 'unknown-manager'; command: string; } | { status: 'failed'; detail: string; command: string; } /** Install succeeded but the binary on PATH is still behind `expected`. */ | { status: 'stale-after-install'; installedVersion: string; expected: string; command: string; } | { status: 'updated'; installedVersion: string | null; }; export type PerformUpdateOptions = { assumeYes: boolean; /** * Injected in tests. Defaults to detecting from the running module's path, * which in a source checkout (as under vitest) resolves to `unknown` — so * every spawn-path test must supply one explicitly. * * Takes the package spec rather than a resolved manager so the * channel-qualification step stays under test rather than being bypassed. */ detectManager?: (packageSpec: string) => InstallManager; /** Injected in tests so the spawn branches are exercisable without installing anything. */ spawn?: typeof spawnSync; /** Injected in tests; defaults to the real platform. */ platform?: NodeJS.Platform; /** Injected in tests; defaults to the interactive readline prompt. */ confirm?: (command: string) => Promise; /** Injected in tests; defaults to whether stdin is a terminal. */ isTTY?: boolean; }; /** * Prompt (unless `assumeYes`) and run the upgrade. * * Returns rather than exiting so callers decide the exit code — `auden update` * treats a failure as a failed command, while `auden doctor` must not fail its * own run over a declined or broken update. */ export declare function performUpdate(update: AvailableUpdate, options: PerformUpdateOptions): Promise; /** * The success line for a completed install. * * `installedVersion` is null when the post-install `auden --version` probe * could not be run — that is reported as an install we cannot confirm rather * than a version we can name, and both entry points must say so identically. */ export declare function formatUpdateSuccess(update: AvailableUpdate, installedVersion: string | null): string; /** * Report repo-local skill drift, stale eval Stop hooks, and a missing * `PostToolUseFailure` hook after an update. * * Runs on both the just-updated and the already-current paths: skills can be * stale even when the package is current, because a user who upgraded with * plain `npm i -g` never re-ran anything that rewrites them. */ export declare function syncGeneratedAssets(cwd: string): Promise; //# sourceMappingURL=perform.d.ts.map