export type UpdateStatus = 'available' | 'current' | 'disabled' | 'native-managed' | 'busy' | 'offline' | 'authentication-required' | 'forbidden' | 'not-found' | 'rate-limited' | 'unavailable'; export type UpdateHost = 'claude' | 'codex' | 'gemini' | 'cursor'; export interface ReleaseInfo { readonly version: string; readonly tag: string; readonly assetId: number; readonly fileName: string; readonly sha256: string; readonly size: number; } export type ReleaseResult = { readonly status: 'available'; readonly release: ReleaseInfo; } | { readonly status: Exclude; }; export interface ReleaseClient { latest(version?: string): Promise; download(release: ReleaseInfo): Promise; } export interface UpdateSettings { readonly enabled: boolean; readonly channel: 'local' | 'native'; } export interface UpdateCheck { readonly status: UpdateStatus; readonly version?: string; readonly cached?: boolean; readonly message?: string; } export interface ReleaseCommandResult { readonly code: number; readonly stdout: Buffer; readonly stderr: string; readonly timedOut?: boolean; } export type ReleaseCommandRunner = (args: readonly string[], options: { timeoutMs: number; maxBytes: number; }) => Promise; /** Only fixed private GitHub endpoints; gh uses the employee's existing authentication. */ export declare class GithubReleaseClient implements ReleaseClient { readonly runner: ReleaseCommandRunner; constructor(runner?: ReleaseCommandRunner); latest(version?: string): Promise; download(release: ReleaseInfo): Promise; } export declare function createUpdateService(options: { dataRoot: string; currentVersion: string; client: ReleaseClient; now?: () => number; defaultChannel?: 'local' | 'native'; }): { check: (request?: { notify?: boolean; host?: UpdateHost; channel?: "local" | "native"; }) => Promise; configure: (changes: Partial) => Promise; fetch: (version?: string, channel?: "local" | "native") => Promise<{ status: string; path?: string; version?: string; sha256?: string; }>; }; export declare function handleUpdateCommand(args: readonly string[], options: { packageRoot: string; cwd: string; productVersion: string; releaseClient?: ReleaseClient; }): Promise;