@sema-agent/core
Version:
Stateless, task-oriented AI agent core
23 lines (22 loc) • 1.31 kB
TypeScript
import type { CheckpointGate, CheckpointToken } from "../checkpoint-store.js";
import type { TaskResult, TaskStatus, TerminalCause } from "../types.js";
/** The plane words a {@link TerminalCause} reads as — one derivation, called by the faces that speak
* them. The paused arm's `status` is its gate kind's registry row (`suspended` for an approval,
* a resource slice or a platform pause; `needs_review` for a plan or dry-run review, which also
* carries the `review.pending` code the review consumers key on). */
export declare function terminalProjection(terminal: TerminalCause): {
status: TaskStatus;
errorCode?: string;
errorMessage?: string;
blockedReason?: string;
checkpointToken?: CheckpointToken;
checkpointId?: string;
checkpointGate?: CheckpointGate;
workspaceRestoreMode?: "snapshot" | "park_only";
};
/**
* A compensation that changes WHY a settled result ended (a resume leg's approval reopened / could not
* be reopened) amends the CAUSE — the one record there is. The code fills only an empty seat (the leg's
* own terminal code, when it had one, still names the ending); the message is extended, not replaced.
*/
export declare function amendTerminal(result: TaskResult, code: string, message: (prior: string | undefined) => string): void;