@sema-agent/core
Version:
Stateless, task-oriented AI agent core
31 lines (30 loc) • 1.79 kB
TypeScript
/**
* The resume ladder's gate-match rung and the review / park TWINS (E3), verbatim from
* `Runner.resumeStream`: the outcome arm must match the persisted gate kind; a review-gate outcome
* (plan_review / dry_run_review) is captured into a plain twin with its domain and text-payload checks, the
* break-out-tag hygiene and the env_failed replay guard; the two tool-less park lanes (wake / resource_limit)
* get their twins too, so no lane hands the caller's object downstream. Synchronous; every refusal throws
* pre-CAS.
*/
import { type Checkpoint, type PendingSteerEntry, type ResumeOutcome } from "../checkpoint-store.js";
export interface ResumeReviewOutcomeInput {
/** borrowed-readonly — the pending row (the lane is keyed on the STORED gate kind). */
cp: Checkpoint;
/** borrowed-readonly — the caller's outcome; each review field is read exactly once, into the twin. */
outcome: ResumeOutcome;
/** borrowed-readonly — the ONE read of the outcome discriminant, taken at admission. */
outcomeGate: ResumeOutcome["gate"];
/** borrowed-readonly — the validated wake message, carried into the wake twin. */
wakeMessage: Omit<PendingSteerEntry, "seq"> | undefined;
}
export interface ResumeReviewOutcomeResult {
/** The review lane's plain twin (a plan_review / needs_review row), else undefined. */
plainReviewOutcome: Extract<ResumeOutcome, {
gate: "plan_review" | "dry_run_review";
}> | undefined;
/** The tool-less park lanes' plain twin (a wake or a resource_limit continue), else undefined. */
plainParkOutcome: Extract<ResumeOutcome, {
gate: "wake" | "resource_limit";
}> | undefined;
}
export declare function resumeReviewOutcome(input: ResumeReviewOutcomeInput): ResumeReviewOutcomeResult;