UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

28 lines (27 loc) • 1.75 kB
/** * The run body's REASONING seat (R5), verbatim from `Runner.runLocked`: the leg-entry resolution of * the requested reasoning intensity against the model's real capability, the ONE publisher that writes both faces * (the `reasoning.resolved` trace frame and the `TaskResult.effectiveReasoning` seat on the backstop carrier), and * the wire-facts consumer that lets the leg's FIRST committed request correct the cap-blind mint (once; foreign * reports are contained at their call sites, not here). */ import { type ReasoningWireFacts, type ResolvedReasoning } from "../../brain/reasoning.js"; import type { Prepared, RunState, TaskIdRef } from "./contracts.js"; export interface RunReasoningSeatInput { /** borrowed-readonly — the leg's prepared seat: the requested thinking level and the model. */ prepared: Prepared; /** borrowed-readonly — the run's mutable state, read for the trace frames' tracer and task id. */ rs: RunState; /** borrowed-mutable — the stream layer's backstop carrier: `effectiveReasoning` is published here at every mint. */ taskIdRef: TaskIdRef | undefined; } export interface RunReasoningSeatResult { /** The CONSUMPTION half of {@link ReasoningWireFacts} — installed as the third brain ALS sink. */ observeReasoningWireFacts: (facts: ReasoningWireFacts) => void; /** The leg's resolution as a READ FACE over this lane's own `let` (the leg-entry mint, then at most one * first-committed-request correction): the settle lane's result assembly reads it for `effectiveReasoning`. */ reasoningResolution: { readonly current: ResolvedReasoning | undefined; }; } export declare function runReasoningSeat(input: RunReasoningSeatInput): RunReasoningSeatResult;