UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

27 lines (26 loc) • 1.65 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 reader that lets the leg's first request with a terminal message correct the entry value (once). */ import 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 { /** Read one `message_end` message of the leg's harness — the git lane's subscription hands every one here. */ observeReasoningMessage: (message: unknown) => void; /** The leg's resolution as a READ FACE over this lane's own `let` (the leg-entry mint, then at most one * first-request correction): the settle lane's result assembly reads it for `effectiveReasoning`. */ reasoningResolution: { readonly current: ResolvedReasoning | undefined; }; } export declare function runReasoningSeat(input: RunReasoningSeatInput): RunReasoningSeatResult;