import { StatusLevel } from '#src/core/types.js'; export interface PlainToolIndicationObserver { /** Feed every streamed message/chunk (the string path's existing loop) through this. */ observe(chunk: unknown): void; } /** * Create the observer. * * **Its state lives for a TURN, not for a stream, and the caller is what decides that.** * `GthAbstractAgent` builds one on the first `streamFromInput` of a turn and reuses it for every * later stream of the same turn, discarding it when the next turn opens or `/clear` lands. This * is [[TUI-C106]]: an approval-gated call is announced in the stream that suspends at the gate and * answered in the stream that resumes, so a per-stream observer met the `ToolMessage` having never * seen its producer, threw away arguments it had correctly accumulated, and rendered `name()` — * issue #445. Nothing in this module changed to fix that; only how long it is kept. * * tool_call deltas are accumulated from `tool_call_chunks` (keyed by the provider's chunk * `index`, which restarts per LLM round — the map is closed into the round's tracking whenever a * `ToolMessage` arrives, mirroring `processEventStream`'s reset-per-round). Deliberately does * NOT `concat()` whole `AIMessageChunk`s: only the tool-call slices are needed, which also * sidesteps the TUI-C29 `__raw_response` aggregation-growth trap entirely. * * `emit` is injectable for tests; production uses `displayToolIndication`, which gates on the * level this module passes it — `TOOL_STATUS_LEVEL`, which is module-private deliberately: the * mapping is this surface's rendering decision, not an API another package should key on. */ export declare function createPlainToolIndication(emit?: (text: string, level: StatusLevel) => void, /** * [[TUI-C69]] §5.4 — **was this call refused back to the agent as a negotiation round?** Asked * per tool-call id at the moment the result is rendered, never earlier: the gate decides while * this stream is being drained, so a snapshot taken when the observer was built would always * say no. * * Defaults to *"nothing is a clarification"*, which is what a surface with no gate behind it * (and every existing caller) means. */ isRaterClarification?: (toolCallId: string) => boolean): PlainToolIndicationObserver;