import { createDefaultCommandRunner } from './run-command.js'; import { type UpdateChannel } from './update-channels.js'; import { type ExtensionPostUpdateResult } from '../extensions/update.js'; import { type GlobalInstallManager } from './update-global.js'; import { type InProcessRestartTrigger, type UpdateRestartResult } from './update-restart.js'; export type UpdateStepResult = { name: string; command: string; cwd: string; durationMs: number; exitCode: number | null; stdoutTail?: string | null; stderrTail?: string | null; }; export type UpdatePostUpdateResult = { extensions?: ExtensionPostUpdateResult; restart?: UpdateRestartResult; }; export type UpdateRunResult = { status: 'ok' | 'error' | 'skipped'; mode: 'git' | 'pnpm' | 'npm' | 'unknown'; root?: string; reason?: string; before?: { sha?: string | null; version?: string | null; }; after?: { sha?: string | null; version?: string | null; }; steps: UpdateStepResult[]; durationMs: number; postUpdate?: UpdatePostUpdateResult; }; export type UpdateStepInfo = { name: string; command: string; index: number; total: number; }; export type UpdateStepCompletion = UpdateStepInfo & { durationMs: number; exitCode: number | null; stderrTail?: string | null; }; export type UpdateStepProgress = { onStepStart?: (step: UpdateStepInfo) => void; onStepComplete?: (step: UpdateStepCompletion) => void; }; export type UpdateInstallSurface = { kind: 'git'; mode: 'git'; root: string; packageRoot: string; } | { kind: 'global'; mode: GlobalInstallManager; root: string; packageRoot: string; } | { kind: 'package-root'; mode: 'unknown'; root: string; packageRoot: string; } | { kind: 'missing'; mode: 'unknown'; root?: string; packageRoot?: undefined; }; type UpdateRunnerOptions = { cwd?: string; argv1?: string; channel?: UpdateChannel; timeoutMs?: number; progress?: UpdateStepProgress; skipExtensionSync?: boolean; shouldRestart?: boolean; triggerInProcessRestart?: InProcessRestartTrigger; }; export declare function resolveUpdateInstallSurface(opts?: Pick): Promise; export declare function runGatewayUpdate(opts?: UpdateRunnerOptions): Promise; export declare function runGatewayUpdateWithPostSteps(opts?: UpdateRunnerOptions): Promise; export declare function formatUpdateApiResult(result: UpdateRunResult, channel: UpdateChannel): Record; export type AutoUpdateResult = { ok: boolean; exitCode: number | null; reason?: string; stdout?: string; stderr?: string; result?: UpdateRunResult; }; export declare function runAutoUpdateCommand(params: { channel: UpdateChannel; root?: string | null; timeoutMs?: number; triggerInProcessRestart?: InProcessRestartTrigger; }): Promise; export declare function runAutoUpdateCommandWithProgress(params: { channel: UpdateChannel; root?: string | null; timeoutMs?: number; triggerInProcessRestart?: InProcessRestartTrigger; onProgress?: (line: string, source: 'stdout' | 'stderr') => void | Promise; }): Promise; export { createDefaultCommandRunner };