export declare const DECISIONS_HEADER = "# Decisions\n\nShared, agent-authored log of cross-cutting decisions the fleet must honor. The conductor records plan/rebase/steer decisions here; workers record interface contracts + adjustments. Each entry is a `##` heading with **What / Why / By** so it scans. Re-read before each significant step; jj merges concurrent edits as first-class conflicts on fan-in.";
export declare const SHARED_CONTEXT_FILE = "RUDDER_SHARED.md";
/** Render ONE canonical DECISIONS.md entry: a `## title` heading, labeled body lines,
 *  and a `**By:** owner · when` footer. Shared shape for every writer (remember, the
 *  conductor, completion notes) so the log stays uniform and scannable. */
export declare function renderDecisionEntry(opts: {
    title: string;
    body: string[];
    owner: string;
    when?: string;
}): string;
export declare const PROPAGATION_RULES: string[];
export declare function sharedContextPath(repoRoot: string): string;
/**
 * Surface B: ensure a TRACKED DECISIONS.md exists at the repo root (and is NOT
 * gitignored, unlike RUDDER.md). Agents append cross-cutting decisions to it in
 * their jj workspace; jj merges concurrent edits as first-class conflicts on
 * fan-in. Idempotent: only writes the header when the file is absent. Returns
 * the absolute path.
 */
export declare function ensureDecisionsFile(repoRoot: string): Promise<string>;
export declare function appendSharedContext(repoRoot: string, text: string, source?: string): Promise<boolean>;
export declare function captureSharedContextFromInput(repoRoot: string, input: string): Promise<boolean>;
export declare function extractSharedContextSnippet(input: string): string | null;
export declare function redactSharedSecretValues(value: string): string;
export declare function syncSharedContextToWorkspaces(repoRoot: string, workspaces: Iterable<string>): Promise<void>;
/**
 * Append an insight as a DECISIONS.md bullet. Used by `rudder remember` (the
 * bd-remember equivalent) and any code path that records a decision. The bullet
 * carries an "(owner: X, <iso>)" suffix so the board parser can attribute it.
 */
export declare function appendDecision(repoRoot: string, insight: string, owner?: string): Promise<void>;
export declare const RUDDER_DONE_START = "RUDDER_DONE_START";
export declare const RUDDER_DONE_END = "RUDDER_DONE_END";
/** One piece of follow-up work a finishing agent recommends. `scope: "out"` marks
 *  work outside the agent's lane (recorded but not auto-injected by the brain). */
export type FollowupProposal = {
    title: string;
    prompt?: string;
    deps?: string[];
    why?: string;
    scope?: "in" | "out";
};
/** A worker's structured end-of-task report: what it did, the interfaces it
 *  created/assumed, and follow-up work it recommends. Appended to DECISIONS.md and
 *  echoed (RUDDER_DONE markers) so siblings AND the orchestrator pick it up. */
export type CompletionNote = {
    node?: string;
    summary?: string;
    interfaces?: string;
    followups?: FollowupProposal[];
};
/** Parse a `rudder done` argument into a CompletionNote. Accepts a bare JSON object, a
 *  fenced ```json block (models love to wrap output in fences), and falls back to a
 *  freeform `{ summary: raw }` for prose, arrays, or primitives — anything that is not a
 *  JSON OBJECT. Keeping arrays/primitives out of the note matters: the orchestrator reads
 *  `note.followups`, and a stray array cast would yield nothing AND lose the text. */
export declare function parseCompletionNoteArg(raw: string): CompletionNote;
/** Drop the structured completion note as a machine-readable JSON file the orchestrator
 *  reads straight off disk. This is the AUTHORITATIVE, terminal-independent channel: it
 *  never passes through the agent's interactive TUI, so a real Claude/Codex worker's
 *  report survives however that UI boxes/truncates/wraps the echoed block in the PTY.
 *  The launcher sets RUDDER_DONE_FILE to <workspace>/.rudder/done/<node>.json and the
 *  orchestrator reads that exact path on completion. Atomic (temp + rename) so the reader
 *  never sees a partial file. Best-effort: returns false on any error (the DECISIONS.md
 *  and stdout channels still carry the note). */
export declare function writeCompletionNoteFile(doneFile: string, note: CompletionNote): Promise<boolean>;
/** Append a worker's completion note to DECISIONS.md as human-legible bullets (so
 *  siblings re-reading DECISIONS.md and the board both see it). The orchestrator
 *  also reads the same note from the RUDDER_DONE block `rudder done` echoes to
 *  stdout. No jj management - just an append, exactly like appendDecision. */
export declare function appendCompletionNote(repoRoot: string, note: CompletionNote, owner?: string): Promise<void>;
/**
 * Render the live RUDDER.md at repoRoot from the current graph.json. For nodes
 * that have a runId, the status is recomputed from the worker-owned run.json so
 * the surface reflects the live RunStatus, not the last graph snapshot. Never
 * throws on a missing run record; degrades to the graph status.
 */
export declare function renderLiveRudderMd(repoRoot: string): Promise<void>;
