import { type Cron } from '../canvas/index.js'; /** The `` block — the `` snapshot only: a * host/runtime line (platform, hostname, node version, tmux-or-not — the * headless engine's own process env, which its bash tools inherit), the cwd * dir listing, and git status/worktrees. Project guidance lives in the * document substrate, so this wrapper stays environment-only. It always emits * because the environment snapshot is always present. Exported for testing. */ /** The `customType` stamped on a node's injected bearings message. Lives here, * beside the builder, because BOTH delivery paths need it: the context-intro * pi-extension (session_start, the cold path) and the warm-pool claim's live * delivery. It is also the idempotency discriminator a later revive matches. */ export declare const CONTEXT_INTRO_CUSTOM_TYPE = "crtr-context"; export declare function buildProjectContextBlock(cwd: string): string; /** The context-directory note — names the path INLINE (no XML attribute, so it * never scopes a sibling block) and frames the dir as durable, shared scratch. * Present for every node, rendered as the `## Your context directory` * subsection of . */ export declare function contextDirNote(nodeId: string): string; /** The profile-purview note — rendered ONLY when `profile_id` resolves to a * manifest that names at least one project dir. Phrased as PURVIEW, not a cwd * replacement: the node's cwd is still its one working dir (bash/edits run * there), the profile just widens what it may ALSO read/act on. Omitted * entirely for a profile with no project purview (including the stable root * profile) or a deleted/unreadable manifest — never throws (mirrors * `assembleNodeSubject`'s profile resolution). This absolute-path disclosure * is intentional (spec-approved): the agent must know its full purview, not a * redacted count. */ export declare function profileNote(nodeId: string): string; /** Orchestrator-only framing: a resident orchestrator survives refresh cycles, * so its context dir is also where a future cycle of itself resumes the work. * Used inside the bearings block AND in the promotion guidance dump, so a * promoted node gets the same note a born-orchestrator gets. */ export declare function orchestratorContextNote(nodeId: string): string; /** The graph mini-map: the ancestry trunk (root first), then this node marked * `● you`, then its immediate children. Returns '' for a lone root with no * children (nothing to map). Exported for testing. */ export declare function buildGraphMap(nodeId: string): string; /** Minimal identity needed to render the assertion before a node is persisted. * Private human-work birth uses this to freeze the exact kickoff in the same * metadata write that creates the node, before any broker can exist. */ export interface IdentityAssertionInput { node_id: string; kind: string; mode: string; fork_from?: string | null; } /** Render the identity assertion for a known or not-yet-persisted node. A fork * copies the source's first-person conversation, so its kickoff names the new * identity and treats the inherited narrative as reference material. */ export declare function buildIdentityAssertionFor(meta: IdentityAssertionInput): string; /** The identity assertion injected at session start for an already-persisted * node. Exported for tests and spawn-time fork kickoff construction. */ export declare function buildIdentityAssertion(nodeId: string): string; /** Why a node was born or woken, as carried from the fired cron to the * injection seam. `ownerName` is the armer's resolved display name when it * still exists (a reaped cron's armer renders as a bare id, never crashes). */ export interface WakeOrigin { /** Which enactment the cron drove: a fresh node (`node_birth`) or a fresh * revive of an existing one (`schedule_revive`). */ kind: 'node_birth' | 'schedule_revive'; /** The armer node id (`crons.created_by`), or null if absent. */ ownerId: string | null; /** The armer's display name, resolved if it still exists. */ ownerName?: string; /** `crons.created` — when the cron was armed (ISO). */ armedAt: string; /** `crons.recur` JSON when recurring, else null/undefined for a one-shot. */ recur?: string | null; } /** Build the provenance a fired cron carries to its injection seam, resolving * the armer's display name if that node still exists. */ export declare function cronWakeOrigin(c: Cron, kind: WakeOrigin['kind']): WakeOrigin; /** Render the cron provenance block. The BIRTH variant names the ARMER * explicitly ("armed by node X") so a newborn never reads that id as its own; * the REVIVE variant drops armer attribution — a cron can revive a node it did * not create, and who armed it is not decision-relevant to a timed re-check — * and instead reframes the generic "you were revived" into "a clock woke you". * A recurrence surfaces its cadence either way, so the agent knows it is one * run of a standing job. No timestamp is rendered: "now"/the cadence already * carry the signal, and a raw ISO instant is noise an agent cannot cheaply turn * into an elapsed delta. */ export declare function buildWakeBearings(origin: WakeOrigin): string; /** The full boot intro, three top-level sections: * * 1. `` — the orienting facts about THIS node: the identity * assertion (always first, so it overrides any copied-in persona), then a * `## Your place in the canvas` graph map and a `## Your context directory` * note. The across-cycles context-dir framing is added ONLY for an * orchestrator (by mode) — the one node whose dir a future cycle resumes * from. * 2. `` — the consultable catalog, a SIBLING of the * bearings (never nested under the context dir). Dropped when empty. * 3. `` — the cwd/git environment snapshot. pi's own * AGENTS.md/CLAUDE.md system-prompt injection stays suppressed * (noContextFiles in broker.ts); project guidance instead rides the * `` block above via the document substrate * (`crtr sys sync project-guidance` migrates each CLAUDE.md/AGENTS.md into * that dir's own `.crouter/memory/AGENTS.md`). */ export declare function buildContextBearings(nodeId: string): string;