eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
60 lines (59 loc) • 3.06 kB
TypeScript
import type { CancelTurnInput, CancelTurnResult, DeliverHookPayload, 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";
import type { SessionCheckpoint } from "#execution/session/handoff.js";
import type { DynamicSubagentAgentConfig } from "#runtime/subagents/dynamic-agent-config.js";
interface WorkflowHookRecord {
readonly runId: 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 owner can rotate across
* deployments without rewriting the registry key.
*/
export declare const workflowEntryReference: {
workflowId: string;
};
/** Stable workflow reference for session deadline timers. */
export declare const sessionTimeoutWorkflowReference: {
workflowId: string;
};
/** Stable workflow reference for root-session activity collectors. */
export declare const activityCollectorWorkflowReference: {
workflowId: string;
};
/** Stable workflow reference for authored workflow tool runs. */
export declare const workflowToolRunWorkflowReference: {
workflowId: string;
};
/**
* Creates a workflow-backed runtime whose current owner executes turns and
* whose original run retains the public event stream across owner handoffs.
*/
export declare function createWorkflowRuntime(config: {
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
readonly dynamicSubagentAgentConfig?: DynamicSubagentAgentConfig;
readonly nodeId?: string;
}): Runtime;
export interface SessionOwnerStartInput {
readonly activationToken: string;
/** Original run whose stream stays the public session stream. */
readonly anchorRunId: string;
readonly checkpoint: SessionCheckpoint;
readonly delivery: DeliverHookPayload;
readonly targetDeploymentId: string;
}
/** Starts a successor owner and binds its output to the original session stream. */
export declare function startSessionOwnerStep(input: SessionOwnerStartInput): Promise<void>;
/** Requests cancellation through a session's stable command inbox. */
export declare function requestWorkflowTurnCancellation(input: CancelTurnInput): Promise<CancelTurnResult>;
/**
* Resolves hook ownership for replay-idempotent work already running inside a
* durable step. Request handlers must return from start/resume acceptance and
* leave ownership arbitration to the workflow.
*/
export declare function waitForCommandHookOwner(token: string): Promise<WorkflowHookRecord>;
/** Starts a workflow on the deployment executing this call. */
export declare function startWorkflowOnCurrentDeployment<TArgs extends unknown[], TResult>(workflow: WorkflowFunction<TArgs, TResult> | WorkflowMetadata, args: TArgs, options?: StartOptionsWithoutDeploymentId): Promise<Run<unknown> | Run<TResult>>;
export {};