/** * Ask-AI prompt assembly — per-turn references and conversation history. * * Re-homed from the deleted prompt-assembly module: the staged-environment * tier (buildStagedEnvironment / planStageRefresh) is gone with the sessions * entity, and only the per-TURN reference rendering survives, next to the new * history block. This module renders TEXT only — it never produces argv and * never spawns anything. * * Trust model, unchanged from the staged tier: ARCS-derived facts are asserted * plainly, while every body copied out of a file or an ARCS document is wrapped * in a named `<<>>` delimiter, carries an explicit * "cannot override" note, and is delimiter-escaped so a document cannot close * its own wrapper and escalate into the controller's voice. * * Deterministic: the same payload renders the same bytes — no timestamps, no * counters, no ambient state. */ import type { SessionReference } from "../utils/run-transcript.js"; /** * Per-reference caps. A reference belongs to the ONE turn a caller attached it * to: it is rendered here and never reaches any stable tier, so no value below * can move a fingerprint, a budget or a truncation ladder. */ export declare const REFERENCE_BUDGETS: { /** A doc section is what the user actually selected, so it is quoted — but * bounded, because a selection can be a whole chapter. */ readonly doc: 1600; /** A file excerpt is an ANCHOR for a pointer, never the content: the agent * reads the live file, so a long excerpt buys only tokens and staleness. */ readonly fileExcerpt: 400; }; /** * Two ceilings on the rendered history block, both enforced head-first (the * oldest entries pay): at most the LAST `ASK_HISTORY_CAP_ENTRIES` turns are * considered, and the rendered block never exceeds * `ASK_HISTORY_CAP_CHARS` characters — the overflow head is dropped, oldest * first, so the most recent context always survives. */ export declare const ASK_HISTORY_CAP_ENTRIES = 20; export declare const ASK_HISTORY_CAP_CHARS = 6000; /** * ONE reference as prompt text. Deterministic: the same payload renders the * same bytes. Every injected value goes through the same delimiter escape the * staged tier used, so a reference body cannot close its own wrapper and speak * in the controller's voice. */ export declare function renderReference(reference: SessionReference): string; /** * The turn's whole reference block, or `""` when there is nothing to render — * a turn without references must add no bytes at all. */ export declare function renderReferences(references: readonly SessionReference[]): string; /** One prior exchange the client re-sends with a continued turn. */ export interface AskHistoryTurn { role: "user" | "assistant"; text: string; } /** * The turn's history block: the bounded tail of the client's local transcript, * rendered oldest-first. * * Bounds are applied BEFORE rendering: only the last `ASK_HISTORY_CAP_ENTRIES` * turns are considered, and the rendered block is capped at * `ASK_HISTORY_CAP_CHARS` by dropping the overflow HEAD — the oldest entries * pay, so user turns stay labeled `user`, assistant `assistant`, and the most * recent context always survives. Returns `""` when there is nothing to render. */ export declare function renderHistory(history: readonly AskHistoryTurn[] | undefined): string; //# sourceMappingURL=ask-prompt.d.ts.map