import { type NodeMeta } from '../canvas/index.js'; import { type WakeOrigin } from './bearings.js'; /** The goal file — the prompt/task a node was spawned with, persisted at birth * so a fresh revive can re-read its mandate. */ export declare function goalPath(nodeId: string): string; export declare function readGoal(nodeId: string): string | null; /** Persist the spawning prompt as the node's goal. No-op for an empty prompt * (e.g. a bare root). Idempotent enough — call once at spawn/boot. */ export declare function writeGoal(nodeId: string, text: string): void; /** Write the goal ONLY if the node has none yet. This is how a bare root (no * spawn prompt) acquires its mandate: the first real user message becomes the * goal. Returns true when it wrote one, false when a goal already existed or * the text was empty. Guarded so a later message never clobbers the mandate. */ export declare function captureGoalIfAbsent(nodeId: string, text: string): boolean; /** Sentinel opening the fresh-revive kickoff message (see buildReviveKickoff). * The goal-capture extension skips any input starting with this so a kickoff * prompt is never mistaken for a user's first mandate. */ export declare const REVIVE_KICKOFF_SENTINEL = "You have been revived fresh after a context refresh"; /** Injected only when a broker cleanly persisted an aborted in-flight turn * before a daemon restart. The transcript already carries the full picture, so * this is a bare nudge — a longer explanation only destabilizes the resume. */ export declare const RUNTIME_RESTART_CONTINUATION = "continue"; /** The yield-message file — a short note `crtr node yield` records for the next * fresh/cycling revive ("on wake, do X"). It remains durable through failed * launch attempts and is cleared only when session_start confirms a boot. */ export declare function yieldMessagePath(nodeId: string): string; export declare function writeYieldMessage(nodeId: string, text: string): void; /** Read the pending yield message without mutating its confirmation state. */ export declare function readYieldMessage(nodeId: string): string | null; /** Idempotently commit delivery of the yield message after a confirmed boot. */ export declare function clearYieldMessage(nodeId: string): void; /** List the node's context/ dir (filenames, sorted). Empty when absent. */ export declare function listContextDir(nodeId: string): string[]; export interface ReviveBearings { /** The one-shot yield note left by the prior self, pending boot confirmation. */ yieldMsg: string | null; /** Coalesced digest of unread reports, or null when the feed was empty. The * cursor now records the last physically covered entry. */ unreadDigest: string | null; /** Persona-transition guidance to surface when the node's role was changed * while it was away (its ack has already been committed), else null. */ driftGuidance: string | null; } /** Capture revive bearings for `meta`: read the pending yield note, advance the * feed cursor past unread reports, and capture+commit external persona drift. * Revive paths call it once, then pass the result to the pure kickoff builder. */ export declare function drainBearings(meta: NodeMeta): ReviveBearings; /** Assemble the auto-injected first message for a FRESH revive of `meta` from its * already-drained `bearings` (see drainBearings) plus pure on-disk reads of the * node's goal, roadmap, and context dir, framed so the revived node can rebuild * its bearings in one turn. PURE: no state mutation, so calling it twice yields * the same string and consumes nothing — drainBearings owns the one-shot reads. */ export declare function buildReviveKickoff(meta: NodeMeta, bearings: ReviveBearings, wakeReason?: WakeOrigin): string;