import { Effect, Schema } from "effect"; import type { ParseOptions } from "effect/SchemaAST"; /** @experimental Version string for a durable driver implementation. */ export declare const DriverVersion: Schema.String; /** @experimental */ export type DriverVersion = typeof DriverVersion.Type; /** @experimental Current durable driver contract version. */ export declare const currentDriverVersion: "1"; /** @experimental How a host may replay one persisted operation after recovery. */ export declare const ReplayPolicy: Schema.Literals; /** @experimental */ export type ReplayPolicy = typeof ReplayPolicy.Type; /** @experimental Bounded operation kinds the driver may schedule. */ export declare const DriverOperationKind: Schema.Literals; /** @experimental */ export type DriverOperationKind = typeof DriverOperationKind.Type; /** @experimental One schedulable nondeterministic operation with deterministic identity. */ export declare const DriverOperation: Schema.Struct<{ readonly key: Schema.String; readonly kind: Schema.Literals; readonly input: Schema.Unknown; readonly inputDigest: Schema.String; readonly replayPolicy: Schema.Literals; }>; /** @experimental */ export type DriverOperation = typeof DriverOperation.Type; /** @experimental Persisted outcome for one operation attempt. */ export declare const OperationOutcome: Schema.Union; readonly value: Schema.Unknown; }>, Schema.Struct<{ readonly _tag: Schema.tag<"Failed">; readonly error: Schema.Unknown; }>, Schema.Struct<{ readonly _tag: Schema.tag<"Unknown">; readonly operationId: Schema.String; }>]>; /** @experimental */ export type OperationOutcome = typeof OperationOutcome.Type; /** @experimental Wait the driver requests before the next decision. */ export declare const WaitDefinition: Schema.Struct<{ readonly waitId: Schema.String; readonly reason: Schema.String; readonly replayToken: Schema.optionalKey; }>; /** @experimental */ export type WaitDefinition = typeof WaitDefinition.Type; /** @experimental Reconstructable durable checkpoint for one agent run. */ export declare const DriverCheckpoint: Schema.Struct<{ readonly driverVersion: Schema.String; readonly executable: Schema.optionalKey; readonly active: Schema.Union, Schema.brand]>; }>>; readonly turn: Schema.Finite; readonly budget: Schema.Struct<{ readonly allocation: Schema.Struct<{ readonly modelCalls: Schema.optionalKey; readonly toolCalls: Schema.optionalKey; readonly totalTokens: Schema.optionalKey; readonly childRuns: Schema.optionalKey; readonly handoffs: Schema.optionalKey; readonly depth: Schema.optionalKey; readonly deadline: Schema.optionalKey; }>; readonly remaining: Schema.Struct<{ readonly modelCalls: Schema.optionalKey; readonly toolCalls: Schema.optionalKey; readonly totalTokens: Schema.optionalKey; readonly childRuns: Schema.optionalKey; readonly handoffs: Schema.optionalKey; readonly depth: Schema.optionalKey; readonly deadline: Schema.optionalKey; }>; readonly depth: Schema.Int; }>; readonly state: Schema.Unknown; }>; /** @experimental */ export type DriverCheckpoint = typeof DriverCheckpoint.Type; /** @experimental Terminal structured result carried by a Complete decision. */ export declare const DriverResult: Schema.Struct<{ readonly text: Schema.String; readonly turns: Schema.Finite; }>; /** @experimental */ export type DriverResult = typeof DriverResult.Type; /** @experimental Next step chosen deterministically from one checkpoint. */ export declare const DriverDecision: Schema.Union; readonly operation: Schema.Struct<{ readonly key: Schema.String; readonly kind: Schema.Literals; readonly input: Schema.Unknown; readonly inputDigest: Schema.String; readonly replayPolicy: Schema.Literals; }>; }>, Schema.Struct<{ readonly _tag: Schema.tag<"Wait">; readonly wait: Schema.Struct<{ readonly waitId: Schema.String; readonly reason: Schema.String; readonly replayToken: Schema.optionalKey; }>; }>, Schema.Struct<{ readonly _tag: Schema.tag<"Continue">; readonly checkpoint: Schema.Struct<{ readonly driverVersion: Schema.String; readonly executable: Schema.optionalKey; readonly active: Schema.Union, Schema.brand]>; }>>; readonly turn: Schema.Finite; readonly budget: Schema.Struct<{ readonly allocation: Schema.Struct<{ readonly modelCalls: Schema.optionalKey; readonly toolCalls: Schema.optionalKey; readonly totalTokens: Schema.optionalKey; readonly childRuns: Schema.optionalKey; readonly handoffs: Schema.optionalKey; readonly depth: Schema.optionalKey; readonly deadline: Schema.optionalKey; }>; readonly remaining: Schema.Struct<{ readonly modelCalls: Schema.optionalKey; readonly toolCalls: Schema.optionalKey; readonly totalTokens: Schema.optionalKey; readonly childRuns: Schema.optionalKey; readonly handoffs: Schema.optionalKey; readonly depth: Schema.optionalKey; readonly deadline: Schema.optionalKey; }>; readonly depth: Schema.Int; }>; readonly state: Schema.Unknown; }>; }>, Schema.Struct<{ readonly _tag: Schema.tag<"Complete">; readonly result: Schema.Struct<{ readonly text: Schema.String; readonly turns: Schema.Finite; }>; }>]>; /** @experimental */ export type DriverDecision = typeof DriverDecision.Type; /** @experimental */ export declare const operationKey: (parts: ReadonlyArray) => string; /** @experimental */ export declare const inputDigest: (input: unknown) => string; /** @experimental */ export declare const makeOperation: (input: { readonly key: string; readonly kind: DriverOperationKind; readonly input: unknown; readonly replayPolicy: ReplayPolicy; }) => DriverOperation; /** @experimental */ export declare const encodeCheckpoint: { (input: DriverCheckpoint, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: DriverCheckpoint) => Effect.Effect; }; /** @experimental */ export declare const decodeCheckpoint: { (input: typeof DriverCheckpoint.Encoded, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: typeof DriverCheckpoint.Encoded) => Effect.Effect; }; /** @experimental */ export declare const encodeDecision: { (input: DriverDecision, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: DriverDecision) => Effect.Effect; }; /** @experimental */ export declare const decodeDecision: { (input: typeof DriverDecision.Encoded, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: typeof DriverDecision.Encoded) => Effect.Effect; }; /** @experimental */ export declare const encodeOutcome: { (input: OperationOutcome, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: OperationOutcome) => Effect.Effect; }; /** @experimental */ export declare const decodeOutcome: { (input: typeof OperationOutcome.Encoded, options?: ParseOptions): Effect.Effect; (options?: ParseOptions): (input: typeof OperationOutcome.Encoded) => Effect.Effect; }; /** @experimental */ export declare const isUnknownOutcome: (outcome: OperationOutcome) => outcome is Extract; /** @experimental */ export declare const isSucceededOutcome: (outcome: OperationOutcome) => outcome is Extract; /** @experimental */ export declare const isFailedOutcome: (outcome: OperationOutcome) => outcome is Extract;