import { type HarnessModelMessage } from "#harness/messages.js"; import { getTurnClientContextState } from "#harness/turn-client-context.js"; import type { Step } from "./context.js"; import { type TurnInput } from "./intake.js"; type ClientContext = NonNullable>; /** * What the model reads this step: durable history, with the task results and notes the step * delivers and the turn's input, and the client's context for the turn, which keeps one position * across the turn's steps and never joins history. */ export interface Prompt { /** Durable messages. Compaction may rewrite them. */ messages: HarnessModelMessage[]; clientContext: ClientContext | undefined; } export declare function buildPrompt(step: Step, turn: TurnInput): Promise; /** * The prompt a step starts on while approved calls wait to run: history and the turn's input, * without the task results and the client context's position a prompt settles, which wait for * the prompt the model reads once the calls have run. */ export declare function previewPrompt(step: Step, turn: TurnInput): Prompt; /** * The turn's input after `messages`, past a tool-result boundary when they end in tool results. * The client's context takes its position here, and never joins the messages. */ export declare function placeTurnInput(step: Step, messages: readonly HarnessModelMessage[], turn: TurnInput): HarnessModelMessage[]; /** `messages`, the prompt's by default, with the client's context at its position. */ export declare function withClientContext(prompt: Prompt, messages?: readonly HarnessModelMessage[]): HarnessModelMessage[]; /** The prompt as the model reads it: with the client's context, projected for its history view. */ export declare function projectPrompt(step: Step, prompt: Prompt): HarnessModelMessage[]; /** * Compaction rewrote the durable messages: the client's context keeps its distance from the end, * so it stays after the turn's input. */ export declare function compactPrompt(step: Step, prompt: Prompt, messages: HarnessModelMessage[]): void; export {};