Skip to content
4 min read · 786 words

Interface: TurnRunnerConfig

Defined in: lib/contracts/turn_runner_config.ts:49

Configuration supplied to @nhtio/adk!TurnRunner at construction time.

Remarks

Validated against turnRunnerConfigSchema at construction — a misconfigured runner throws immediately rather than failing on the first turn.

All fetch and mutation callbacks are required: they are injected into each @nhtio/adk!TurnContext so middleware can call fetch, refresh, and persistence methods directly on the context without coupling to the runner.

tools is optional at the caller level and defaults to [] after schema resolution — a runner with no baseline tools is valid.

Properties

PropertyTypeDescriptionDefined in
deleteMemoryCallbackMemoryDeleteFnRemoves a memory from the persistence layer by ID.lib/contracts/turn_runner_config.ts:75
deleteMessageCallbackMessageDeleteFnRemoves a message from the persistence layer by ID.lib/contracts/turn_runner_config.ts:89
deleteRetrievableCallbackRetrievableDeleteFnRemoves a retrievable record from the persistence layer by ID.lib/contracts/turn_runner_config.ts:83
deleteStandingInstructionCallbackStandingInstructionDeleteFnRemoves a standing instruction from the persistence layer.lib/contracts/turn_runner_config.ts:69
deleteThoughtCallbackThoughtDeleteFnRemoves a thought from the persistence layer by ID.lib/contracts/turn_runner_config.ts:95
deleteToolCallCallbackToolCallDeleteFnRemoves a tool call from the persistence layer by ID.lib/contracts/turn_runner_config.ts:101
dispatchInputPipeline?DispatchPipelineMiddlewareFn[]LLM-iteration input middleware, executed in order against the @nhtio/adk!DispatchContext before the executor on each iteration. Defaults to [].lib/contracts/turn_runner_config.ts:113
dispatchOutputPipeline?DispatchPipelineMiddlewareFn[]LLM-iteration output middleware, executed in order against the @nhtio/adk!DispatchContext after the executor on each iteration. Defaults to [].lib/contracts/turn_runner_config.ts:115
executorCallbackDispatchExecutorFnPerforms the LLM API/SDK call for each iteration of the dispatch loop; receives the active @nhtio/adk!DispatchContext and an @nhtio/adk!DispatchExecutorHelpers object for managing per-id stream state.lib/contracts/turn_runner_config.ts:51
fetchMemoriesCallbackMemoryRetrievalFnCalled once per turn to supply memories; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:53
fetchMessagesCallbackMessageRetrievalFnCalled once per turn to supply conversation history; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:55
fetchRetrievablesCallbackRetrievableRetrievalFnCalled once per turn to supply retrievable (RAG) records; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:77
fetchThoughtsCallbackThoughtRetrievalFnCalled once per turn to supply thought traces; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:57
fetchToolCallsCallbackToolCallRetrievalFnCalled once per turn to supply tool call records; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:59
fetchToolsCallbackToolsRetrievalFnCalled to supply available tools; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:61
mutateMemoryCallbackMemoryMutateFnUpdates an existing memory in the persistence layer.lib/contracts/turn_runner_config.ts:73
mutateMessageCallbackMessageMutateFnUpdates an existing message in the persistence layer.lib/contracts/turn_runner_config.ts:87
mutateRetrievableCallbackRetrievableMutateFnUpdates an existing retrievable record in the persistence layer.lib/contracts/turn_runner_config.ts:81
mutateStandingInstructionCallbackStandingInstructionMutateFnUpdates an existing standing instruction in the persistence layer.lib/contracts/turn_runner_config.ts:67
mutateThoughtCallbackThoughtMutateFnUpdates an existing thought in the persistence layer.lib/contracts/turn_runner_config.ts:93
mutateToolCallCallbackToolCallMutateFnUpdates an existing tool call in the persistence layer.lib/contracts/turn_runner_config.ts:99
refreshStandingInstructionsCallbackStandingInstructionsRefreshFnCalled to refresh and return standing instructions; receives the active @nhtio/adk!TurnContext.lib/contracts/turn_runner_config.ts:63
storeMediaBytesCallbackMediaBytesStoreFnPersists tool-generated media bytes into consumer storage; returns a MediaReader.lib/contracts/turn_runner_config.ts:103
storeMemoryCallbackMemoryStoreFnPersists a new memory.lib/contracts/turn_runner_config.ts:71
storeMessageCallbackMessageStoreFnPersists a new message.lib/contracts/turn_runner_config.ts:85
storeRetrievableBytesCallbackRetrievableBytesStoreFnPersists extracted retrievable text bytes into consumer storage; returns a SpoolReader.lib/contracts/turn_runner_config.ts:105
storeRetrievableCallbackRetrievableStoreFnPersists a new retrievable record.lib/contracts/turn_runner_config.ts:79
storeStandingInstructionCallbackStandingInstructionStoreFnPersists a new standing instruction.lib/contracts/turn_runner_config.ts:65
storeThoughtCallbackThoughtStoreFnPersists a new thought.lib/contracts/turn_runner_config.ts:91
storeToolCallCallbackToolCallStoreFnPersists a new tool call.lib/contracts/turn_runner_config.ts:97
tools?Tool<SpooledArtifact>[]Baseline tools available on every turn. Middleware may trim or extend this per-turn via ctx.tools. Defaults to [].lib/contracts/turn_runner_config.ts:107
turnInputPipeline?TurnPipelineMiddlewareFn[]Turn-level input middleware, executed in order against the @nhtio/adk!TurnContext before the LLM dispatch. Defaults to [].lib/contracts/turn_runner_config.ts:109
turnOutputPipeline?TurnPipelineMiddlewareFn[]Turn-level output middleware, executed in order against the @nhtio/adk!TurnContext after the LLM dispatch resolves successfully. Defaults to [].lib/contracts/turn_runner_config.ts:111