UNPKG

eve

Version:

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

59 lines (58 loc) • 2.42 kB
import type { BackgroundWorkflowToolRunInput } from "#execution/tools/workflow/types.js"; import { type TaskCommand, type TaskRunInboundPayload } from "#tasks/types.js"; /** * Node-side admission and cancellation for session-owned workflow invocations. * * Every export must be called from inside a `"use step"` body; none of * these are steps themselves so dispatch and tool steps can compose them * inside one durable boundary. */ /** Starts a session-owned invocation through the common workflow entry. */ export declare function startTaskRun(input: BackgroundWorkflowToolRunInput): Promise<void>; /** Resolves the task run that won ownership of one replay-stable command token. */ export declare function waitForTaskCommandOwner(input: { readonly taskInboxToken: string; }): Promise<{ readonly runId: string; }>; /** * Submits one command to a task run. * * `unreachable` means the hook is not resumable — either the run * already finished and disposed it (the task is terminal; read the * final view) or, right after creation, the freshly started run has * not registered it yet. Senders racing that startup window pass * `retryUnreachable`; senders addressing an established task treat * `unreachable` as the terminal signal. */ export declare function sendTaskCommand(input: { readonly command: TaskCommand; readonly taskInboxToken: string; readonly retryUnreachable?: { readonly attempts: number; readonly delayMs: number; }; }): Promise<"delivered" | "unreachable">; /** Delivers one command and returns the accepting task workflow's run id. */ export declare function sendTaskCommandToOwner(input: { readonly command: TaskCommand; readonly taskInboxToken: string; readonly retryUnreachable?: { readonly attempts: number; readonly delayMs: number; }; }): Promise<{ readonly runId: string; } | undefined>; /** * Hands one non-command inbound payload to a task run. * * Used for payloads the run must act on before it may record them — * today only answered input batches, which it forwards to the child * first. `unreachable` means the task already finished and disposed its * hook, so the payload is stale by definition. */ export declare function sendTaskInboundPayload(input: { readonly taskInboxToken: string; readonly payload: TaskRunInboundPayload; }): Promise<"delivered" | "unreachable">;