import type { ModelMessage, ToolSet, TypedToolCall } from "ai";
import type { RuntimeToolCallActionRequest } from "#runtime/actions/types.js";
import type { InputRequest } from "#runtime/input/types.js";
import type { HarnessSession, SessionStateMap, StepInput } from "#harness/types.js";
/**
 * Returns true when the step input carries user-facing turn input.
 */
export declare function hasStepInput(input?: StepInput): boolean;
/**
 * Merges any queued follow-up input into the current step input and clears it
 * from session state.
 *
 * Used when the harness has to process a pending tool-approval response first
 * and defer the user's new message to the next internal model step.
 */
export declare function consumeDeferredStepInput(input: {
    readonly input?: StepInput;
    readonly session: HarnessSession;
}): {
    readonly input?: StepInput;
    readonly session: HarnessSession;
};
/**
 * Returns true when the session carries queued follow-up input for the next
 * internal harness step.
 */
export declare function hasDeferredStepInput(session: HarnessSession): boolean;
/**
 * Resolves pending input at the start of a harness step.
 *
 * When the pending batch contains tool-approval requests and the step input
 * also carries a follow-up user message, the message is deferred to the next
 * internal harness step rather than appended to the current turn. This is
 * necessary because AI SDK cannot process tool-approval responses and a new
 * user message in the same request -- the approval must be resolved in
 * isolation first, and the user message replayed on the subsequent step via
 * {@link consumeDeferredStepInput}.
 */
export declare function resolvePendingInput(input: {
    readonly history?: readonly ModelMessage[];
    readonly resolveApprovalKey?: (request: InputRequest) => string | undefined;
    readonly session: HarnessSession;
    readonly stepInput?: StepInput;
}): ResolvePendingInputResult;
type ResolvePendingInputResult = {
    readonly deferredMessage?: boolean;
    readonly outcome: "resolved" | "continue" | "unresolved";
    readonly messages: ModelMessage[];
    readonly session: HarnessSession;
};
/**
 * Returns true when the session is parked on a pending HITL batch
 * (tool approvals or `ask_question` prompts).
 */
export declare function hasPendingInputBatch(state: SessionStateMap | undefined): boolean;
/**
 * Stores one pending HITL batch on the session until the user responds.
 */
export declare function setPendingInputBatch(input: {
    readonly requests: readonly InputRequest[];
    readonly responseMessages: readonly ModelMessage[];
    readonly session: HarnessSession;
}): HarnessSession;
/**
 * Returns the set of tool names that have been approved at least once
 * during this session.
 */
export declare function getApprovedTools(session: HarnessSession): ReadonlySet<string>;
/**
 * Creates a runtime tool-call action shape from an AI SDK tool call.
 */
export declare function createRuntimeToolCallActionFromToolCall(input: {
    readonly toolCall: TypedToolCall<ToolSet>;
}): RuntimeToolCallActionRequest;
export {};
