import { type SubscriptionRef } from '../canvas/index.js'; /** The doctrine wake: fan a system notice to every given subscriber of a node * whose lifecycle just ended out from under it (closed, or crashed to dead) — * the runtime guarantee that a manager waiting dormant on a child always * learns of its terminal outcome instead of hanging forever. Active subscriber * → inbox (wakes a dormant manager via its live watcher / the daemon's * dormant-revive pass); passive → the passive accumulator (delivered, not * woken). Shared by closeNode (step 4, below) and reviveNode's launch-refusal * crash path (revive.ts). */ export declare function fanDoctrineWake(fromId: string, subscribers: readonly SubscriptionRef[], label: string, data: Record): void; export interface CloseNodeResult { /** The focused node that was closed — the cascade root. */ root: string; /** Every node torn down (root + cascaded descendants), in kill order * (leaves first, root last). */ closed: string[]; /** Descendants left alive because a manager outside the subtree still * subscribes to them. */ spared: string[]; } /** Close `rootId` and its exclusive subtree. Best-effort throughout: a tmux/db * failure on one node never aborts the cascade. Throws only on an unknown root * so the command can surface a clean not-found error. * * `rootEvent` decides the ROOT's terminal status (descendants are always * `cancel`led — they did not finish their own work, they were torn down with the * parent): * 'cancel' (default) — the node was abandoned/torn down → canceled (⊜). * 'finish' — the user is marking it COMPLETE → done (✓). Used by * the canvas browser's `x` (close-out) action. A root already in a terminal * status keeps it (finish is only legal from a live status). */ export declare function closeNode(rootId: string, opts?: { rootEvent?: 'cancel' | 'finish'; }): CloseNodeResult;