UNPKG

eve

Version:

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

39 lines (38 loc) • 1.71 kB
import type { RuntimeActionResultHookPayload, SessionCommand } from "#channel/types.js"; import type { DeliveryAdmission, SessionInputQueue } from "#execution/session/input-queue.js"; import { type SessionInboxPayload } from "#execution/session-inbox/inbox.js"; import type { SessionStateCursor } from "#execution/session/state-cursor.js"; import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js"; export type SessionCancellation = Extract<SessionCommand, { readonly kind: "cancel"; }>; /** One canonical admission result, after wire decoding but before turn policy. */ export type SessionAdmission = { readonly admission: DeliveryAdmission; readonly kind: "delivery"; } | { readonly command: SessionCancellation; readonly kind: "cancel"; } | { readonly kind: "consumed"; } | { readonly kind: "runtime-action-result"; readonly payload: RuntimeActionResultHookPayload; } | { readonly kind: "workflow"; readonly message: WorkflowToolRunMessage; }; /** * Decodes and admits one inbox payload. This boundary never decides whether a * delivery steers, starts a turn, or routes to a child; those are selection * and delivery-routing policies owned by their respective layers. */ export declare function admitSessionInboxPayload(value: SessionInboxPayload, input: { readonly cursor: SessionStateCursor; readonly queue: SessionInputQueue; }): Promise<SessionAdmission>; /** Applies accepted cancellation effects after the active-turn guard passes. */ export declare function applySessionCancellation(command: SessionCancellation, input: { readonly cursor: SessionStateCursor; readonly queue: SessionInputQueue; }): Promise<void>;