import type { ModelMessage } from "ai"; import type { resolveInlineAuthorizationInterrupt } from "#harness/inline-tool-authorization.js"; import type { StepCoordinates } from "#harness/session-machine/view.js"; import type { Step } from "#harness/step/context.js"; import type { HarnessSessionBase, HarnessToolLookup, StepInput, StepResult } from "#harness/types.js"; import type { RuntimeWorkflowTaskRequest } from "#shared/action-types.js"; import type { InputRequest } from "#shared/input.js"; export { acceptHumanInput, admitApprovedWork, dispatchApprovedWorkflows, hasApprovedWork, runApprovedLocalCalls, type ApprovedWork, type HumanInputIntake, } from "./intake.js"; export { extractToolApprovalInputRequests } from "#harness/input-extraction.js"; export { hasRunnableQueue } from "./approvals.js"; /** * A model step made calls that need a person's approval: the step parks on them beside any * runtime calls it made. The turn holds for the answers, unless the runtime runs calls for it * meanwhile, or queued input can already run. */ export declare function parkOnApprovals(step: Step, input: { readonly event: StepCoordinates; readonly messages: readonly ModelMessage[]; readonly requests: readonly InputRequest[]; readonly tasks: readonly RuntimeWorkflowTaskRequest[]; /** The entries the step's calls ran, whose approvals the requests ask for. */ readonly tools: HarnessToolLookup; /** The step made calls the runtime runs, so the turn waits on them instead. */ readonly waitsOnRuntime: boolean; }): Promise; /** * A call the model step ran needs a sign-in: the calls that need it stop, and the model calls * them again once it completes. */ export declare function stopForToolSignIn(step: Step, interrupt: NonNullable>): Promise; /** * The gate before each model call. A spent budget asks whether to continue when someone can * answer, and fails the session otherwise. `messages` are the step's: they park with the prompt, * so the input that triggered it survives into the turn that resumes. */ export declare function enforceBudget(step: Step, messages: readonly ModelMessage[]): Promise; /** * What a model call needs from the approvals: the keys `once()` approvals of `tools` granted, and * a note on the calls still awaiting approval, which a message may revise. */ export declare function humanInputContext(step: Step, tools: HarnessToolLookup): { readonly approvedTools: ReadonlySet; readonly pendingApprovalsNote?: string; }; /** * Drops what a cleared context owned: sign-in attempts and responders' approval progress. `clear` * reported each close; relay routes for live tasks stay. */ export declare function discardClearedHumanInput(session: T): T; /** The cancelled turn's responders stop checking its approvals: their candidates stale. */ export declare function retireCancelledCandidates(session: T): T; /** * Takes the message a delivery's answers deferred into the turn queue out of it, so a cancelled * turn can keep it in history once instead of also leaving it queued. The rest of the queue stays. */ export declare function takeDeferredMessage(session: T): { readonly message?: StepInput["message"]; readonly session: T; };