eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
50 lines (49 loc) • 2.64 kB
TypeScript
import type { CancelTurnInput, CancelTurnResult, Runtime } from "#channel/types.js";
import { type Run, type StartOptionsWithoutDeploymentId, type WorkflowFunction, type WorkflowMetadata } from "#internal/workflow/runtime.js";
import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
export declare const LATEST_DEPLOYMENT_UNSUPPORTED_MESSAGE = "deploymentId 'latest' requires a World that implements resolveLatestDeploymentId()";
/**
* Workflow function names whose bundled id is stable across deployments
* (no `@<pkg.version>` stamp). The bundler reads this set when emitting
* the workflow id so cross-deployment routing — `start(ref, args, {
* deploymentId: "latest" })` — finds the same workflow on a newer
* deployment even when the eve version differs.
*
* Both halves of the contract (bundler output and runtime reference
* template) read this single set so they cannot drift.
*/
export declare const STABLE_WORKFLOW_NAMES: ReadonlySet<string>;
/**
* Stable workflow reference used by `start()` to locate the workflow
* entrypoint registered by the Workflow DevKit builder. The id omits
* the package version stamp so the long-lived driver can rotate across
* deployments without rewriting the registry key.
*/
export declare const workflowEntryReference: {
workflowId: string;
};
/**
* Stable workflow reference used by the driver to dispatch per-turn
* child workflow runs. The id omits the package version stamp so
* `start(turnWorkflowReference, args, { deploymentId: "latest" })`
* routes to the latest deployment's turn workflow even when the eve
* version differs from the caller's deployment.
*/
export declare const turnWorkflowReference: {
workflowId: string;
};
/**
* Creates a workflow-backed runtime whose long-lived driver owns the
* event stream and dispatches each turn as a child workflow run.
*/
export declare function createWorkflowRuntime(config: {
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
readonly nodeId?: string;
}): Runtime;
/** Requests cancellation through a session's stable workflow hook. */
export declare function requestWorkflowTurnCancellation(input: CancelTurnInput): Promise<CancelTurnResult>;
/**
* Starts a workflow on the latest deployment when latest routing applies,
* while preserving local/dev worlds that do not implement latest routing.
*/
export declare function startWorkflowPreferLatest<TArgs extends unknown[], TResult>(workflow: WorkflowFunction<TArgs, TResult> | WorkflowMetadata, args: TArgs, options?: StartOptionsWithoutDeploymentId): Promise<Run<unknown> | Run<TResult>>;