import type { UserContent } from "ai"; import type { StepInput } from "#harness/types.js"; import type { InputResponse } from "#shared/input.js"; import type { SuspendedStep } from "#harness/session-machine/state.js"; import type { SessionView } from "#harness/session-machine/view.js"; /** * The delivery a step answers with: input queued behind earlier work joins it, unless the * runtime still runs calls (queued input waits for them). A stale answer, to a request that * already closed, never authorizes anything: a stale session-limit answer is dropped, and * any other becomes plain text the model reads. */ export declare function deliver(view: SessionView, input: StepInput | undefined, options: { readonly takeQueued: boolean; }): { readonly input?: StepInput; readonly displayMessage?: string | UserContent; readonly takeQueued: boolean; }; export type ResolvedStepInput = StepInput & { readonly messageConsumed?: boolean; }; /** * Plain text answers a budget prompt; `resolveTypedApproval` answers approvals. A channel * that wraps the typed text in an envelope for the model attaches the text itself to answer with. * The answer consumes the message and the context the channel sent about it: the model reads * neither. */ export declare function resolveTextInput(batch: Pick, stepInput: StepInput | undefined): ResolvedStepInput | undefined; /** * Turns a typed reply into a response to the first open request when that request is one of * this turn's approvals. The approval coordinator then settles it, or asks its response policy * about the person who typed, as it does for a press. A batch's other approvals stay open for * later replies. */ export declare function resolveTypedApproval(view: Pick, stepInput: StepInput | undefined): ResolvedStepInput | undefined; export declare function canonicalize(responses: readonly InputResponse[]): readonly InputResponse[]; export declare function hasInput(input: StepInput | undefined): boolean; export declare function isEmptyInput(input: StepInput): boolean; export declare function withoutResponses(input: ResolvedStepInput | undefined): StepInput | undefined; /** The turn's own input: the message a plain-text answer didn't consume, and its context. */ export declare function turnInputOnly(input: ResolvedStepInput | undefined): StepInput | undefined; /** What of the input isn't the turn's: answers, and the output the session asks for. */ export declare function withoutTurnInput(input: ResolvedStepInput | undefined): ResolvedStepInput; export declare function compactInput(input: ResolvedStepInput | undefined): ResolvedStepInput;