/** * Shared ops / apply honesty contract. * Single source of truth for written | applied | blocked across API, core, web. */ /** * Control-plane apply lifecycle (honest; never mark applied without host success). * - planned / pending_execute: resource draft awaiting EXECUTE (legacy resource CRUD) */ export type ApplyStatus = 'draft' | 'written' | 'planned' | 'pending_execute' | 'applied' | 'blocked' | 'failed' | 'partial'; /** * Standard operator mutation result. * Rules: * - ok && blocked is forbidden * - apply_status === 'applied' implies ok && !blocked * - notes always preferred over raw shell homework in UI */ export interface OpsResultDto { ok: boolean; apply_status?: ApplyStatus; blocked?: boolean; blockMessage?: string; requiresExecute?: boolean; requiresRoot?: boolean; notes: string[]; written?: string[]; /** Optional resource / process facts for panels */ url?: string; port?: number; pid?: number; processStatus?: string; } export type OpsResultInput = Partial & { ok?: boolean; notes?: string[] | readonly string[]; }; /** * Normalize ops result honesty. * * Hard rule: `blocked: true` never coexists with `ok: true` or `applied`. * Soft flags `requiresExecute` / `requiresRoot` alone do **not** flip ok when * `apply_status` is `written` / `draft` / `partial` (control-plane success). * Missing notes → []. */ export declare function assertHonestOps(result: T): T & OpsResultDto; /** @deprecated use assertHonestOps */ export declare const normalizeOpsHonesty: typeof assertHonestOps; export declare function isApplyStatus(v: unknown): v is ApplyStatus; //# sourceMappingURL=ops.d.ts.map