/** * peaks-prd handoff service — v2.11.0 (D1 in * `v2-11-rm-rd-techdoc-immutable-handoff`). * * Owns the immutable handoff at * `.peaks/_runtime//prd/handoff.md`: * * - `initHandoff` — pure; computes sha256 of the body and returns * a Handoff whose frontmatter `handoffHash` matches. * - `writeHandoff` — writes the file under `.peaks/_runtime//prd/`, * creating the dir if missing. * - `readHandoff` — reads + parses; throws on malformed input. * - `verifyHandoff` — re-reads + recomputes hash; returns a * `HandoffProbe` (never throws on hash mismatch — that's a * verification outcome, not a fatal error). * - `showHandoff` — returns the raw markdown content (frontmatter * + body verbatim) for human display via `peaks prd handoff show`. * * Hash contract (D1): `handoffHash` is the lowercase hex sha256 of * the body content as UTF-8 bytes. The body MUST be the literal * markdown source — no normalization, no trailing-newline padding. */ import type { Handoff, HandoffProbe } from './handoff-types.js'; /** Compute the lowercase hex sha256 of a UTF-8 string. */ export declare function sha256OfBody(body: string): string; /** Pure: produce a Handoff with the frontmatter populated. Hash is * computed here; callers MUST NOT pre-populate `handoffHash`. */ export declare function initHandoff(opts: { requestId: string; sessionId: string; body: string; writtenAt: string; goals: readonly string[]; acceptanceCriteria: readonly string[]; preservedBehavior: readonly string[]; /** Override path; defaults to `.peaks/_runtime//prd/handoff.md`. */ handoffPath?: string; }): Handoff; /** Write a Handoff to disk. `projectRoot` is the absolute project * root (so the `.peaks/_runtime/...` path is resolved absolutely). * Creates intermediate dirs. */ export declare function writeHandoff(handoff: Handoff, projectRoot: string): Promise<{ path: string; hash: string; }>; /** Read + parse a handoff from disk. Throws on missing file or * malformed frontmatter. */ export declare function readHandoff(filePath: string): Promise; /** Verify a handoff by re-reading and re-hashing. Returns a probe * (never throws on hash mismatch — that's the outcome). */ export declare function verifyHandoff(filePath: string): Promise; /** Return the raw markdown content of a handoff file (frontmatter + * body verbatim). For human display. */ export declare function showHandoff(filePath: string): Promise;