/**
 * olam update — Friendly wrapper around `npm install -g @pleri/olam-cli@<channel>`.
 *
 * F1: core install flow with snapshot-prev → install → restore-on-failure (D24)
 *     + scan-and-reconcile skill symlinks (T22/OQ29).
 * F2: --to=<ver>, --rollback, --check, --channel=<ch>.
 * F3: --freeze, --force, upgrade_blocked field check.
 *
 * T23 note: self-replace while running is harmless on POSIX — the OS keeps the
 * old inode open until exit; the new binary is a separate inode. No special
 * handling needed.
 */
import type { Command } from 'commander';
import { reconcileSkillSymlinks } from '../lib/symlink-reconcile.js';
export interface ExecResult {
    readonly exitCode: number;
    readonly stdout: string;
    readonly stderr: string;
}
export type ExecFn = (cmd: string) => ExecResult;
export declare function getCurrentVersion(_exec?: ExecFn): string | null;
export declare function readLastStable(file?: string): string | null;
export declare function writeLastStable(version: string, file?: string): void;
export interface UpdateOptions {
    readonly channel?: string;
    readonly quiet?: boolean;
    readonly force?: boolean;
}
export interface UpdateResult {
    readonly action: 'installed' | 'restored' | 'failed';
    readonly version?: string;
    readonly prevVersion?: string;
    readonly exitCode: 0 | 11;
    readonly symlinks?: {
        added: string[];
        removed: string[];
    };
}
/** Exit code 10: `--check` returns "already on latest". */
export interface CheckResult {
    readonly action: 'already-current' | 'update-available';
    readonly current: string | null;
    readonly latest: string | null;
    readonly exitCode: 0 | 10;
}
/** Exit code 14: `--rollback` with no cache. */
export interface RollbackResult {
    readonly action: 'rolled-back' | 'nothing-to-rollback' | 'already-at-cached' | 'failed';
    readonly restoredVersion?: string;
    readonly exitCode: 0 | 11 | 14;
}
export type WriteConfigFn = (channel: string) => Promise<void>;
/**
 * Check whether the published package has upgrade_blocked: true in its package.json.
 * Returns true when the field is present and truthy; false otherwise (including on error).
 */
export declare function isUpgradeBlocked(channelOrVersion: string, _exec?: ExecFn): boolean;
export type ReadConfigFn = () => Promise<{
    channel?: string;
} | null>;
export declare function doUpdate(opts: UpdateOptions, _exec?: ExecFn, _reconcile?: typeof reconcileSkillSymlinks, _readConfig?: ReadConfigFn, _getNpmRoot?: ExecFn): Promise<UpdateResult>;
export declare function doCheck(_exec?: ExecFn): Promise<CheckResult>;
export declare function doRollback(_exec?: ExecFn, _reconcile?: typeof reconcileSkillSymlinks, _getNpmRoot?: ExecFn): Promise<RollbackResult>;
export declare function registerUpdate(program: Command): void;
//# sourceMappingURL=update.d.ts.map