eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
31 lines (30 loc) • 1.21 kB
TypeScript
import type { NextDriverAction } from "#execution/next-driver-action.js";
import { type TurnWorkflowInput } from "#execution/durable-session-migrations/turn-workflow.js";
/**
* Hook payload the turn child workflow delivers to the parent driver
* on completion. `turn-result` wraps a {@link NextDriverAction} the
* driver dispatches on; `turn-error` carries a normalized error the
* driver rethrows.
*/
export type TurnCompletionPayload = {
readonly kind: "turn-result";
readonly action: NextDriverAction;
} | {
readonly kind: "turn-error";
readonly error: unknown;
};
export type { TurnWorkflowInput };
/**
* Short-lived workflow that owns one runtime turn for the driver.
*
* `parentWritable` is threaded in from the driver run so event writes
* land on the driver's stream. Resolves the turn into a
* {@link NextDriverAction} and reports it back through
* {@link notifyDriverStep}.
*/
export declare function turnWorkflow(rawInput: unknown): Promise<void>;
/** Resumes the driver's one-shot completion hook with the turn result. */
export declare function notifyDriverStep(input: {
readonly completionToken: string;
readonly payload: TurnCompletionPayload;
}): Promise<void>;