Skip to content
3 min read · 592 words

Interface: RawDispatchContext

Plain input object supplied to DispatchContext at construction time.

Remarks

All fetch and mutation callbacks are required — every execution context must have a persistence layer wired up, even in standalone mode. Optional pre-fetched arrays populate the context's Sets at construction time without replacing the callbacks (the callbacks are still invoked on subsequent fetch calls).

Properties

PropertyTypeDescription
deleteMemoryDispatchMemoryDeleteFnRemoves a memory by ID.
deleteMessageDispatchMessageDeleteFnRemoves a message by ID.
deleteRetrievableDispatchRetrievableDeleteFnRemoves a retrievable record by ID.
deleteStandingInstructionDispatchStandingInstructionDeleteFnRemoves a standing instruction.
deleteThoughtDispatchThoughtDeleteFnRemoves a thought by ID.
deleteToolCallDispatchToolCallDeleteFnRemoves a tool call by ID.
fetchMemoriesDispatchMemoryRetrievalFnRetrieves memories for this execution.
fetchMessagesDispatchMessageRetrievalFnRetrieves messages for this execution.
fetchRetrievablesDispatchRetrievableRetrievalFnRetrieves retrievable records for this execution.
fetchThoughtsDispatchThoughtRetrievalFnRetrieves thoughts for this execution.
fetchToolCallsDispatchToolCallRetrievalFnRetrieves tool calls for this execution.
fetchToolsDispatchToolsRetrievalFnRetrieves tools for this execution.
hooks?DispatchContextHookRegistrationsOptional hook registrations for emit events.
memories?Memory[]Pre-fetched memories to populate the context at construction.
messages?Message[]Pre-fetched messages to populate the context at construction.
mutateMemoryDispatchMemoryMutateFnUpdates an existing memory.
mutateMessageDispatchMessageMutateFnUpdates an existing message.
mutateRetrievableDispatchRetrievableMutateFnUpdates an existing retrievable record.
mutateStandingInstructionDispatchStandingInstructionMutateFnUpdates an existing standing instruction.
mutateThoughtDispatchThoughtMutateFnUpdates an existing thought.
mutateToolCallDispatchToolCallMutateFnUpdates an existing tool call.
refreshStandingInstructionsDispatchStandingInstructionsRefreshFnRefreshes and returns standing instructions for this execution.
retrievables?Retrievable[]Pre-fetched retrievable records to populate the context at construction.
standingInstructions?(string | Tokenizable)[]Standing instructions for this execution.
stash?Record<string, unknown>Arbitrary key-value store for cross-step state.
storeMemoryDispatchMemoryStoreFnStores a new memory.
storeMessageDispatchMessageStoreFnStores a new message.
storeRetrievableDispatchRetrievableStoreFnStores a new retrievable record.
storeStandingInstructionDispatchStandingInstructionStoreFnStores a new standing instruction.
storeThoughtDispatchThoughtStoreFnStores a new thought.
storeToolCallDispatchToolCallStoreFnStores a new tool call.
systemPromptstring | TokenizableThe system prompt for this execution.
thoughts?Thought[]Pre-fetched thoughts to populate the context at construction.
toolCalls?ToolCall[]Pre-fetched tool calls to populate the context at construction.
tools?Tool<SpooledArtifact>[]Pre-fetched tools to populate the tool registry at construction.
turnAbortController?AbortControllerAbortController whose signal can cancel execution mid-flight.
waitFor?OpenGateFnOptional gate suspension function. When absent, waitFor rejects with @nhtio/adk!E_LLM_EXECUTION_GATE_NOT_SUPPORTED.