import { Effect } from "effect"; import { type DriverCheckpoint, type DriverOperationKind } from "./driver-contract.js"; import { DriverStateInvalid, type DurableAgentDriver } from "./durable-driver.js"; import { type RunBudget, type RunBudgetExhausted, type BudgetLimits } from "./run-budget.js"; import { type PendingOperation } from "./loop-driver-state.js"; import type { HandoffControlState } from "../agent/handoff-state.js"; /** @experimental */ export interface LoopDriverOptions { readonly logicalOperationId: string; readonly sessionId: string; readonly modelCallOrdinalStart?: number; } /** @internal Apply the exact successful handoff value to both durable authorities. */ export declare const applyHandoffCommit: { (value: unknown): (checkpoint: DriverCheckpoint) => Effect.Effect; (checkpoint: DriverCheckpoint, value: unknown): Effect.Effect; }; /** @experimental Charge budget at operation schedule time before execution begins. */ export declare const chargeScheduled: { (kind: DriverOperationKind): (checkpoint: DriverCheckpoint) => Effect.Effect; (checkpoint: DriverCheckpoint, kind: DriverOperationKind): Effect.Effect; }; /** @experimental Apply token usage after a model boundary without scheduling a new operation. */ export declare const chargeUsage: { (usage: BudgetLimits): (checkpoint: DriverCheckpoint) => Effect.Effect; (checkpoint: DriverCheckpoint, usage: BudgetLimits): Effect.Effect; }; /** @experimental Replace checkpoint budget after child reservation or refund. */ export declare const withBudget: { (budget: RunBudget): (checkpoint: DriverCheckpoint) => DriverCheckpoint; (checkpoint: DriverCheckpoint, budget: RunBudget): DriverCheckpoint; }; /** @internal Replace the durable handoff control snapshot without scheduling an operation. */ export declare const withHandoffState: { (handoff: HandoffControlState): (checkpoint: DriverCheckpoint) => Effect.Effect; (checkpoint: DriverCheckpoint, handoff: HandoffControlState): Effect.Effect; }; /** @experimental Production durable driver backing inline Agent.stream runs. */ export declare const makeLoopDriver: (options: LoopDriverOptions) => DurableAgentDriver; /** @experimental Attach the next pending operation before interpreter decide. */ export declare const withPending: { (pending: PendingOperation, turn: number): (checkpoint: DriverCheckpoint) => DriverCheckpoint; (checkpoint: DriverCheckpoint, pending: PendingOperation, turn: number): DriverCheckpoint; };