/** * `GET /api/v1/sessions/:id/narrative` — the session narrative * (issue #314, ADR 0051 §7, design sketch §G.2). * * An agent that may legitimately inspect one session has, until now, had two * options and no good one: the aggregate metrics say nothing about a single * session, and `/sessions/:id/events` returns the whole raw stream — tens of * thousands of sampled telemetry lines that no model can read. This route serves * the middle ground: an ordered, compacted account of what the session did, with * timestamps relative to its first event and a hard cap on entries. * * **The gate is the same double gate as the raw stream (ADR 0003 / ADR 0051 §9):** * `ENABLE_RAW_SESSION_RETENTION` must be on *and* the key must hold `query:raw`. * A plain `query` key is authenticated — an unknown key still gets a 401 — and * then refused with the same 403 body as the events route, so the two surfaces * are indistinguishable to a caller probing for a way in. * * It lives in its own plugin rather than in `routes/query.ts` for two reasons: * the file is already 2 400 lines and under concurrent change, and this route * deliberately does **not** want `queryRoutes`' `format` hook (see `format` * below). Registered in `app.ts`, so the app-level audit hook records every call * — including the refusals, which is exactly what a project owner wants to see. */ import type { FastifyPluginAsync } from "fastify"; import type { CollectorConfig } from "../config.js"; import type { CollectorStore } from "../store.js"; interface Options { store: CollectorStore; config: CollectorConfig; } /** * Session-narrative route. Separate plugin, one registration line in `app.ts`. */ export declare const narrativeRoutes: FastifyPluginAsync; export {}; //# sourceMappingURL=narrative.d.ts.map