GthAgentInterface
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:536
Methods
Section titled “Methods”cleanup()?
Section titled “cleanup()?”
optionalcleanup():Promise<void>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:649
Returns
Section titled “Returns”Promise<void>
clearRaterClarifications()?
Section titled “clearRaterClarifications()?”
optionalclearRaterClarifications():void
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:611
[[TUI-C69]] §5.4 — drop the ids noteRaterClarification collected, at the top of
every turn and on /clear.
The runner owns the when because it owns the turn; the agent owns the set because it owns the rendering. Without this the ids live as long as the process, and a later call reusing one would be drawn as a negotiation round it had no part in.
Optional and fail-soft, like its sibling: an agent that never notes anything need not implement it.
Returns
Section titled “Returns”void
getDeclaredMcpToolAnnotations()?
Section titled “getDeclaredMcpToolAnnotations()?”
optionalgetDeclaredMcpToolAnnotations():ReadonlyMap<string,DeclaredToolAnnotations>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:633
EXT-70 (spec §4.7.1) — what the connected MCP servers declared about their own tools in their
tools/list responses, keyed by the REGISTERED tool name (mcp__<server>__<tool>). The runner
reads it as the mcp half of a declared-annotation lookup when it computes a call’s effective
annotation set.
These are claims, not credentials: nothing here has been trusted, and an entry only becomes
load-bearing where the user’s approvals.mcp block believes that hint from that server.
Optional — an agent that tracks no tools omits it, and every tool is then fail-closed, which is
exactly what a fully distrustful configuration computes anyway.
Returns
Section titled “Returns”ReadonlyMap<string, DeclaredToolAnnotations>
getPendingToolInterrupts()?
Section titled “getPendingToolInterrupts()?”
optionalgetPendingToolInterrupts(runConfig):Promise<PendingToolInterrupt[]>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:584
Inspect the checkpointed state for the thread and return any tool calls currently pending
human approval (empty when the run completed normally). Optional: only implemented by
agents whose graph exposes getState. Used by GthAgentRunner to drive the
approve/reject confirmation loop.
Parameters
Section titled “Parameters”runConfig
Section titled “runConfig”RunnableConfig
Returns
Section titled “Returns”Promise<PendingToolInterrupt[]>
getRegisteredToolNames()?
Section titled “getRegisteredToolNames()?”
optionalgetRegisteredToolNames():string[]
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:620
EXT-58 (spec §4.4) — the names of the tools registered with the graph at init. The runner
intersects them with the built-in summaries table to tell the rater which already-granted
built-ins it may offer as an alternative, so a suggestion can never name a tool the model does
not have. Optional: an agent that does not track its tools simply omits it, and the rater then
receives no granted list (and so suggests nothing).
Returns
Section titled “Returns”string[]
getRunStats()?
Section titled “getRunStats()?”
optionalgetRunStats():GthRunStats
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:647
GS2-16 — the analytics harvested from the run(s) since the last resetRunStats. Used by the runner to thread token/tool data into the opt-in history recorder. Optional; when absent the runner records no analytics for that turn. Reading must never throw.
Returns
Section titled “Returns”init()
Section titled “init()”init(
command,configIn,checkpointSaver?,options?):Promise<void>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:537
Parameters
Section titled “Parameters”command
Section titled “command”GthCommand | undefined
configIn
Section titled “configIn”checkpointSaver?
Section titled “checkpointSaver?”BaseCheckpointSaver<number>
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
invoke()
Section titled “invoke()”invoke(
messages,runConfig):Promise<string>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:544
Parameters
Section titled “Parameters”messages
Section titled “messages”Message[]
runConfig
Section titled “runConfig”RunnableConfig
Returns
Section titled “Returns”Promise<string>
noteRaterClarification()?
Section titled “noteRaterClarification()?”
optionalnoteRaterClarification(toolCallId):void
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:598
[[TUI-C69]] §5.4 — name the tool calls the auto-rater bounced back for clarification, so both display paths can tone those rows as a negotiation round rather than as a failed tool.
Called by GthAgentRunner with the id of a call it has just refused BACK TO THE MODEL under §5 — never for a human’s “no”, a deny entry or the §8 floor, which are refusals rather than rounds of an argument. The agent holds the ids only until the results carrying them have been rendered — clearRaterClarifications is what makes that true — and a run that never negotiates never calls this.
Optional: an agent that renders nothing simply omits it, and every row keeps today’s tone.
Parameters
Section titled “Parameters”toolCallId
Section titled “toolCallId”string
Returns
Section titled “Returns”void
resetRunStats()?
Section titled “resetRunStats()?”
optionalresetRunStats():void
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:640
GS2-16 — reset the per-run analytics accumulator so the NEXT turn’s token/tool totals start from zero. Called by GthAgentRunner at each turn boundary (the runner is reused across turns in interactive sessions). Optional: agents that don’t collect stats simply omit it.
Returns
Section titled “Returns”void
stream()
Section titled “stream()”stream(
messages,runConfig):Promise<IterableReadableStream<string>>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:546
Parameters
Section titled “Parameters”messages
Section titled “messages”Message[]
runConfig
Section titled “runConfig”RunnableConfig
Returns
Section titled “Returns”Promise<IterableReadableStream<string>>
streamResume()?
Section titled “streamResume()?”
optionalstreamResume(resumeValue,runConfig):Promise<IterableReadableStream<string>>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:573
Resume a graph suspended on a human-in-the-loop interrupt() and stream the continuation
as text (the string counterpart to streamWithEventsResume, for the readline path).
Optional: only implemented by agents that support tool-approval interrupts.
Parameters
Section titled “Parameters”resumeValue
Section titled “resumeValue”unknown
runConfig
Section titled “runConfig”RunnableConfig
Returns
Section titled “Returns”Promise<IterableReadableStream<string>>
streamWithEvents()
Section titled “streamWithEvents()”streamWithEvents(
messages,runConfig,signal?):AsyncGenerator<AgentStreamEvent>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:554
Stream the run as typed AgentStreamEvents. If a client tool triggers
interrupt() the underlying graph suspends; this generator ends cleanly so the
transport can finish the run with the tool call hanging. Resume via
streamWithEventsResume on the same thread_id.
Parameters
Section titled “Parameters”messages
Section titled “messages”Message[]
runConfig
Section titled “runConfig”RunnableConfig
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”AsyncGenerator<AgentStreamEvent>
streamWithEventsResume()
Section titled “streamWithEventsResume()”streamWithEventsResume(
resumeValue,runConfig,queuedMessages?,signal?):AsyncGenerator<AgentStreamEvent>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:561
Resume a graph suspended via interrupt() with the supplied value.
Parameters
Section titled “Parameters”resumeValue
Section titled “resumeValue”unknown
runConfig
Section titled “runConfig”RunnableConfig
queuedMessages?
Section titled “queuedMessages?”BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”AsyncGenerator<AgentStreamEvent>