UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

27 lines (26 loc) • 1.65 kB
/** * The execution-record settle half of the pending-call resolver's belt (run-loop machinery, layer 1): * what the resolver does with the word the row's `recordExecutionOutcome` verb answered. The verb itself * is bound by `resumeStream` (ResumeRun.recordExecutionOutcome); the resolver calls it once per * resolution, right after the resolved call's `tool_end` frame, and hands the answer here. The rule is a * table lookup, not a condition list: the words that leave the row unrecorded * (`EXECUTION_RECORD_LEAVES_ROW_UNRECORDED`) announce `checkpoint.execution_outcome_unrecorded`; the * others say nothing. The execution result is never changed by the answer — the record is an account of * what ran, not a gate on it — so this module has no return value and no throw of its own (a conflict is * the verb's own throw and propagates past the resolver untouched). */ import { type ExecutionOutcomeRecordWord } from "../checkpoint-execution-record.js"; import type { GateOutcome } from "../gate-outcome.js"; import { type RunnerDeps } from "../types.js"; /** The facts the unrecorded notice carries — all from the resumed leg; the secret token never rides. */ export interface ExecutionRecordFacts { toolName: string; gate: GateOutcome; sessionId: string; runId: string; scope: string; checkpointId?: string; } /** Settle the record verb's answer: announce the unrecorded words through the deployment's notice sink; * the recorded words are silent. */ export declare function settleExecutionRecord(onNotice: RunnerDeps["onNotice"], word: ExecutionOutcomeRecordWord, facts: ExecutionRecordFacts): void;