Skip to content
4 min read · 729 words

Interface: RawDispatchContext ​

Defined in: src/lib/contracts/dispatch_context.ts:178

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 ​

PropertyTypeDescriptionDefined in
deleteMemoryDispatchMemoryDeleteFnRemoves a memory by ID.src/lib/contracts/dispatch_context.ts:230
deleteMessageDispatchMessageDeleteFnRemoves a message by ID.src/lib/contracts/dispatch_context.ts:242
deleteRetrievableDispatchRetrievableDeleteFnRemoves a retrievable record by ID.src/lib/contracts/dispatch_context.ts:236
deleteStandingInstructionDispatchStandingInstructionDeleteFnRemoves a standing instruction.src/lib/contracts/dispatch_context.ts:224
deleteThoughtDispatchThoughtDeleteFnRemoves a thought by ID.src/lib/contracts/dispatch_context.ts:248
deleteToolCallDispatchToolCallDeleteFnRemoves a tool call by ID.src/lib/contracts/dispatch_context.ts:254
fetchMemoriesDispatchMemoryRetrievalFnRetrieves memories for this execution.src/lib/contracts/dispatch_context.ts:204
fetchMessagesDispatchMessageRetrievalFnRetrieves messages for this execution.src/lib/contracts/dispatch_context.ts:208
fetchRetrievablesDispatchRetrievableRetrievalFnRetrieves retrievable records for this execution.src/lib/contracts/dispatch_context.ts:206
fetchThoughtsDispatchThoughtRetrievalFnRetrieves thoughts for this execution.src/lib/contracts/dispatch_context.ts:210
fetchToolCallsDispatchToolCallRetrievalFnRetrieves tool calls for this execution.src/lib/contracts/dispatch_context.ts:212
fetchToolsDispatchToolsRetrievalFnRetrieves tools for this execution.src/lib/contracts/dispatch_context.ts:214
hooks?DispatchContextHookRegistrationsOptional hook registrations for emit events.src/lib/contracts/dispatch_context.ts:263
memories?Memory[]Pre-fetched memories to populate the context at construction.src/lib/contracts/dispatch_context.ts:190
messages?Message[]Pre-fetched messages to populate the context at construction.src/lib/contracts/dispatch_context.ts:194
mutateMemoryDispatchMemoryMutateFnUpdates an existing memory.src/lib/contracts/dispatch_context.ts:228
mutateMessageDispatchMessageMutateFnUpdates an existing message.src/lib/contracts/dispatch_context.ts:240
mutateRetrievableDispatchRetrievableMutateFnUpdates an existing retrievable record.src/lib/contracts/dispatch_context.ts:234
mutateStandingInstructionDispatchStandingInstructionMutateFnUpdates an existing standing instruction.src/lib/contracts/dispatch_context.ts:222
mutateThoughtDispatchThoughtMutateFnUpdates an existing thought.src/lib/contracts/dispatch_context.ts:246
mutateToolCallDispatchToolCallMutateFnUpdates an existing tool call.src/lib/contracts/dispatch_context.ts:252
refreshStandingInstructionsDispatchStandingInstructionsRefreshFnRefreshes and returns standing instructions for this execution.src/lib/contracts/dispatch_context.ts:216
replaceToolCallGroup?ToolCallGroupReplaceFnOptionally replaces a complete tool-call id group in one transaction.src/lib/contracts/dispatch_context.ts:256
retrievables?Retrievable[]Pre-fetched retrievable records to populate the context at construction.src/lib/contracts/dispatch_context.ts:192
standingInstructions?(string | Tokenizable)[]Standing instructions for this execution.src/lib/contracts/dispatch_context.ts:186
stash?Record<string, unknown>Arbitrary key-value store for cross-step state.src/lib/contracts/dispatch_context.ts:182
storeMediaBytesDispatchMediaBytesStoreFnPersists tool-generated media bytes; returns a MediaReader.src/lib/contracts/dispatch_context.ts:258
storeMemoryDispatchMemoryStoreFnStores a new memory.src/lib/contracts/dispatch_context.ts:226
storeMessageDispatchMessageStoreFnStores a new message.src/lib/contracts/dispatch_context.ts:238
storeRetrievableDispatchRetrievableStoreFnStores a new retrievable record.src/lib/contracts/dispatch_context.ts:232
storeRetrievableBytesDispatchRetrievableBytesStoreFnPersists extracted retrievable text bytes; returns a SpoolReader.src/lib/contracts/dispatch_context.ts:260
storeStandingInstructionDispatchStandingInstructionStoreFnStores a new standing instruction.src/lib/contracts/dispatch_context.ts:220
storeThoughtDispatchThoughtStoreFnStores a new thought.src/lib/contracts/dispatch_context.ts:244
storeToolCallDispatchToolCallStoreFnStores a new tool call.src/lib/contracts/dispatch_context.ts:250
systemPromptstring | TokenizableThe system prompt for this execution.src/lib/contracts/dispatch_context.ts:184
thoughts?Thought[]Pre-fetched thoughts to populate the context at construction.src/lib/contracts/dispatch_context.ts:196
toolCalls?ToolCall[]Pre-fetched tool calls to populate the context at construction.src/lib/contracts/dispatch_context.ts:198
tools?Tool<SpooledArtifact>[]Pre-fetched tools to populate the tool registry at construction.src/lib/contracts/dispatch_context.ts:200
turnAbortController?AbortControllerAbortController whose signal can cancel execution mid-flight.src/lib/contracts/dispatch_context.ts:180
waitFor?OpenGateFnOptional gate suspension function. When absent, waitFor rejects with @nhtio/adk!E_LLM_EXECUTION_GATE_NOT_SUPPORTED.src/lib/contracts/dispatch_context.ts:265