/** * Derived markdown view of a session handoff. * * IMPORTANT: this module produces a one-way *view* of the canonical * handoff data that already lives in `session.handoffJson` (SQLite). * The markdown is NEVER read back by CLEO — it exists only as a UI * artifact for humans / external systems. Source of truth remains * TASKS + BRAIN, exposed via `cleo briefing`. * * Operator directive (2026-04-29, T1593): markdown handoffs are an * anti-pattern when used as canonical state. They lie when agents * "update" them by deletion. This emitter is opt-in via * `cleo session end --emit-markdown ` and produces a clearly * labelled derived snapshot. * * @task T1593 */ import type { HandoffData } from './handoff.js'; /** * Optional context attached to the rendered markdown view. */ export interface HandoffMarkdownContext { /** Session id whose handoff is being rendered. */ sessionId?: string; /** ISO timestamp when the session ended. */ endedAt?: string; /** Session scope label (e.g. `global`, `epic:T1593`). */ scope?: string; /** Project root absolute path (for traceability). */ projectRoot?: string; } /** * Render a HandoffData record as a human-readable markdown view. * * The output is a derived snapshot. It MUST NOT be re-ingested by * CLEO; instead, run `cleo briefing` which reads the canonical state * from tasks.db + brain.db. * * @param handoff - Canonical handoff payload from `session.handoffJson`. * @param ctx - Optional rendering context (session id, scope, etc.). * @returns Markdown string ready to write to disk. */ export declare function renderHandoffMarkdown(handoff: HandoffData, ctx?: HandoffMarkdownContext): string; /** * Write a markdown handoff view to disk. Creates parent directories as * needed. Atomic via write-then-rename pattern. * * @param outputPath - Absolute path of the destination markdown file. * @param handoff - Canonical handoff payload to render. * @param ctx - Optional rendering context (session id, scope, etc.). */ export declare function emitHandoffMarkdown(outputPath: string, handoff: HandoffData, ctx?: HandoffMarkdownContext): Promise; //# sourceMappingURL=handoff-markdown.d.ts.map