UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

33 lines (32 loc) • 1.94 kB
import type { PushQueue } from "../push-queue.js"; import type { TaskEvent, TaskSpec } from "../types.js"; import type { Stats } from "./assemble-result.js"; import type { InstallingPhaseResult, Prepared, RunnerDepsSeat, RunState } from "./contracts.js"; export interface RunStopAndFinalVerifyInput { /** borrowed-readonly — the task spec: the hooks slot and the `finalVerification` opt-in. */ spec: TaskSpec; /** borrowed-mutable — the leg's prepared seat: the stop gate is installed on its harness; the abort signal, the * pause and halt holders, the output seat, the session, the hook bound and identity are read inside the gate. */ prepared: Prepared; /** borrowed-mutable — the run's event queue: the injection echo frames. */ queue: PushQueue<TaskEvent>; /** borrowed-mutable — the run's mutable state: the injection counter (`counters.finalVerifyInjections`) is bumped; * the grounding latches, the write latch and the turn cap are read. */ rs: RunState; /** borrowed-readonly — the run's usage counters, read by the headroom guards. */ stats: Stats; /** borrowed-readonly — the run's event-identity mint (the echo frames). */ ident: () => { eventId: string; parentToolCallId?: string; sourceTaskId?: string; }; /** borrowed-readonly — the monotonic walltime deadline (the clock lane's), read by the budget fill. */ walltimeMonotonicDeadline: number | undefined; /** borrowed-readonly — the Runner's deployment deps, read LIVE (`hooks` at resolution, `onError` in the gate). */ runner: RunnerDepsSeat; } /** Nothing comes back: the gate is INSTALLED on the borrowed harness, and the seat's closures are read by it alone. */ export interface RunStopAndFinalVerifyResult extends InstallingPhaseResult { } export declare function runStopAndFinalVerify(input: RunStopAndFinalVerifyInput): RunStopAndFinalVerifyResult;