Skip to content

GthAgentInterface

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:536

optional cleanup(): Promise<void>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:649

Promise<void>


optional clearRaterClarifications(): 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.

void


optional getDeclaredMcpToolAnnotations(): 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.

ReadonlyMap<string, DeclaredToolAnnotations>


optional getPendingToolInterrupts(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.

RunnableConfig

Promise<PendingToolInterrupt[]>


optional getRegisteredToolNames(): 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).

string[]


optional getRunStats(): 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.

GthRunStats


init(command, configIn, checkpointSaver?, options?): Promise<void>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:537

GthCommand | undefined

GthConfig

BaseCheckpointSaver<number>

GthAgentInitOptions

Promise<void>


invoke(messages, runConfig): Promise<string>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:544

Message[]

RunnableConfig

Promise<string>


optional noteRaterClarification(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.

string

void


optional resetRunStats(): 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.

void


stream(messages, runConfig): Promise<IterableReadableStream<string>>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/types.ts:546

Message[]

RunnableConfig

Promise<IterableReadableStream<string>>


optional streamResume(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.

unknown

RunnableConfig

Promise<IterableReadableStream<string>>


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.

Message[]

RunnableConfig

AbortSignal

AsyncGenerator<AgentStreamEvent>


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.

unknown

RunnableConfig

BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]

AbortSignal

AsyncGenerator<AgentStreamEvent>