UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

16 lines (15 loc) • 1.64 kB
import type { ToolOccurrence } from "./tool-occurrence.js"; /** The engine's own judgment refused this call and it was never let go to an executor: the latest gate record is a * refusal and the life never left `announced` — positive evidence the call did not run (a refusal recorded AFTER the * release, by a station inside the execution, is not). A call whose start this stream never carried (a recovered * one, closed by a station that knows only its own class) is not read here. */ export declare function refusedBeforeRelease(occ: Pick<ToolOccurrence, "life" | "gateRounds" | "startEmitted">): boolean; /** `details` as a persisted `toolResult` row carries it: `notExecuted` is the ENGINE's key — the settlement's fact when it holds, * absent otherwise, whatever a tool wrote under that name. Returns `details` itself unless the key has to move; never mutates it. */ export declare function rowDetailsOf(details: unknown, notExecuted: boolean): unknown; /** A row the resumed leg mints (`toolResultMsg`) with the settlement's fact on it. */ export declare function withRowNotExecuted<T extends object>(row: T, notExecuted: boolean): T; /** Write the end projection's one `notExecuted` onto the result the live loop persists as the call's row: the loop builds that message * from this very result right after the end event. The frame's card was projected from the previous `details` first and keeps its * members (a row mark is never part of a card). `Reflect.set`: a result that refuses the write keeps its row as it was. */ export declare function stampRowNotExecuted(result: unknown, notExecuted: boolean): void;