UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

51 lines (50 loc) 2.32 kB
/** * Turn workflow input migrations. * * The driver workflow can stay pinned while per-turn child workflows * route to latest, so the child workflow run input is a durable wire * shape newer code must read. Inputs written before * {@link TURN_WORKFLOW_INPUT_VERSION} carry no `version`; the chain reads * them as version 0 and the registered v0 → v1 migration lifts the flat * shape into the current input, so a turn dispatched by an older * deployment still runs after a rollout. Future shape changes bump * {@link TURN_WORKFLOW_INPUT_VERSION} and append a v{N} → v{N+1} migration. */ import type { HookPayload, SessionCapabilities } from "#channel/types.js"; import type { DurableSessionState } from "#execution/durable-session-store.js"; import type { RunMode } from "#shared/run-mode.js"; export declare const TURN_WORKFLOW_INPUT_VERSION = 1; export interface TurnStepInput { /** Cancellation signal forwarded into the turn step. */ readonly abortSignal?: AbortSignal; readonly input: HookPayload | undefined; readonly parentWritable: WritableStream<Uint8Array>; readonly serializedContext: Record<string, unknown>; readonly sessionState: DurableSessionState; } export interface TurnWorkflowInput { readonly version: typeof TURN_WORKFLOW_INPUT_VERSION; readonly capabilities: SessionCapabilities | undefined; readonly completionToken: string; /** * Additive driver feature negotiation. Older pinned drivers omit this, * which keeps runtime-action orchestration on the legacy entry-owned path. */ readonly driverCapabilities?: { readonly turnInbox?: true; readonly cancelledTurnSettle?: true; }; readonly mode: RunMode; readonly stepInput: TurnStepInput; } export interface TurnWorkflowDispatchInput { readonly capabilities: SessionCapabilities | undefined; readonly completionToken: string; readonly delivery: HookPayload; readonly mode: RunMode; readonly parentWritable: WritableStream<Uint8Array>; readonly serializedContext: Record<string, unknown>; readonly sessionState: DurableSessionState; } export declare function createTurnWorkflowInput(input: TurnWorkflowDispatchInput): TurnWorkflowInput; export declare function migrateTurnWorkflowInput(value: unknown): TurnWorkflowInput;