import type { NodeIdDTO, NodeStatusDTO } from './common.js'; /** `POST /v1/nodes/{id}/revive` body. */ export interface ReviveRequest { /** Resume the saved conversation (true) vs a fresh launch (false). */ resume?: boolean; /** Clear the finalization latch before reviving (#339 `--reopen` gate). The * latch clear is a canvas write, so the gate is enforced server-side: with * `reopen:false` (default) a finalized node is REJECTED (`node_finalized`); * with `reopen:true` a node that is NOT finalized is rejected * (`not_finalized`). */ reopen?: boolean; /** Wake provenance: the cron whose run drove this revive (`CRTR_CRON_ID`, * set by the daemon in every cron run's environment and forwarded by the * CLI). With `resume:false` and a still-live cron row, crtrd injects the * `` block so the revived node learns a CLOCK woke it, not a * message. Prose only — an unknown id is ignored, never an error. */ cron_id?: string; } /** Result of a revive. `revived` is false on the idempotent double-revive no-op. */ export interface ReviveResultDTO { node_id: NodeIdDTO; revived: boolean; resumed: boolean; status: NodeStatusDTO; } /** `POST /v1/nodes/{id}/relaunch-root` result. A null id means the target * was not a relaunchable live root, or its replacement failed to launch. */ export interface RelaunchRootResultDTO { newNodeId: NodeIdDTO | null; } /** `POST /v1/nodes/revive-all` result. Node ids relaunched, plus any that * failed to revive with the reason (the reader reports both). */ export interface ReviveAllResultDTO { revived: NodeIdDTO[]; failed: { node_id: NodeIdDTO; error: string; }[]; } /** `POST /v1/nodes/{id}/close` body. The cascade set is computed server-side * from edges; the flag only opts out of cascading descendants. */ export interface CloseRequest { cascade?: boolean; /** Root close disposition: `true` finalizes the root to `done` (the browse `x` * "finish" semantics); default/`false` cancels it. The cascade set (computed * server-side) is torn down either way. */ finish?: boolean; } /** Result of a close. */ export interface CloseResultDTO { /** The closed node — the cascade root. */ root: NodeIdDTO; /** Every node torn down (root + cascaded descendants), leaves-first. */ closed: NodeIdDTO[]; /** Descendants left alive because an out-of-subtree manager still subscribes. */ spared: NodeIdDTO[]; } /** `POST /v1/nodes/{id}/promote` body. */ export interface PromoteRequest { /** Specialize as this kind of orchestrator; defaults to the node's current kind. */ kind?: string; /** Also flip lifecycle→resident (interactable). */ resident?: boolean; /** Durably change the model tier (ultra|strong). */ model?: string; } /** `POST /v1/nodes/{id}/yield` body. */ export interface YieldRequest { note?: string; promote?: boolean; /** Respecialize the kind as the node refreshes. */ kind?: string; /** Durably raise the model tier (ultra|strong) for the fresh revive. */ model?: string; } /** `POST /v1/nodes/{id}/wait` body. */ export interface WaitRequest { controller: NodeIdDTO; }