Type Alias: DispatchContextHooks
ts
type DispatchContextHooks = {
deletedMemory: [[string], []];
deletedMessage: [[string], []];
deletedRetrievable: [[string], []];
deletedStandingInstruction: [[Tokenizable], []];
deletedThought: [[string], []];
deletedToolCall: [[string], []];
message: [[TurnStreamableContent], []];
mutatedMemory: [[Memory], []];
mutatedMessage: [[Message], []];
mutatedRetrievable: [[Retrievable], []];
mutatedStandingInstruction: [[Tokenizable], []];
mutatedThought: [[Thought], []];
mutatedToolCall: [[ToolCall], []];
storedMemory: [[Memory], []];
storedMessage: [[Message], []];
storedRetrievable: [[Retrievable], []];
storedStandingInstruction: [[Tokenizable], []];
storedThought: [[Thought], []];
storedToolCall: [[ToolCall], []];
thought: [[TurnStreamableContent], []];
toolCall: [[TurnToolCallContent], []];
toolExecutionEnd: [[ToolExecutionEndEvent], []];
toolExecutionStart: [[ToolExecutionStartEvent], []];
};Defined in: lib/types/dispatch_context.ts:28
Hook event map for @nhtio/adk!DispatchContext.
Remarks
Each key maps to a tuple of [HookArgs, CleanupArgs]. These events mirror the functional and observability events on @nhtio/adk!TurnRunner but are surfaced through @nhtio/hooks rather than TypedEventEmitter, which allows the entire execution context to be garbage-collected once execution completes — no lingering listener references.
Mutation hooks (stored* / mutated* / deleted*) fire on every mutation in both standalone and derived paths. The DispatchRunner subscribes to these hooks to queue deltas for later bubbling to a parent TurnContext; users may subscribe for observability or testing.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
deletedMemory | [[string], []] | Fired after a memory is removed locally and from persistence. Payload is the deleted id. | lib/types/dispatch_context.ts:50 |
deletedMessage | [[string], []] | Fired after a message is removed locally and from persistence. Payload is the deleted id. | lib/types/dispatch_context.ts:62 |
deletedRetrievable | [[string], []] | Fired after a retrievable record is removed locally and from persistence. Payload is the deleted id. | lib/types/dispatch_context.ts:56 |
deletedStandingInstruction | [[Tokenizable], []] | Fired after a standing instruction is removed locally and from persistence. | lib/types/dispatch_context.ts:44 |
deletedThought | [[string], []] | Fired after a thought is removed locally and from persistence. Payload is the deleted id. | lib/types/dispatch_context.ts:68 |
deletedToolCall | [[string], []] | Fired after a tool call is removed locally and from persistence. Payload is the deleted id. | lib/types/dispatch_context.ts:90 |
message | [[TurnStreamableContent], []] | Fired when a streaming message chunk is emitted during execution. | lib/types/dispatch_context.ts:30 |
mutatedMemory | [[Memory], []] | Fired after a memory is mutated locally and persisted. | lib/types/dispatch_context.ts:48 |
mutatedMessage | [[Message], []] | Fired after a message is mutated locally and persisted. | lib/types/dispatch_context.ts:60 |
mutatedRetrievable | [[Retrievable], []] | Fired after a retrievable record is mutated locally and persisted. | lib/types/dispatch_context.ts:54 |
mutatedStandingInstruction | [[Tokenizable], []] | Fired after a standing instruction is mutated locally and persisted. | lib/types/dispatch_context.ts:42 |
mutatedThought | [[Thought], []] | Fired after a thought is mutated locally and persisted. | lib/types/dispatch_context.ts:66 |
mutatedToolCall | [[ToolCall], []] | Fired after a tool call is mutated locally and persisted. Remarks See DispatchContextHooks.storedToolCall for the fromArtifactTool / Tokenizable-shaped results invariant. | lib/types/dispatch_context.ts:88 |
storedMemory | [[Memory], []] | Fired after a memory is stored locally and persisted. | lib/types/dispatch_context.ts:46 |
storedMessage | [[Message], []] | Fired after a message is stored locally and persisted. | lib/types/dispatch_context.ts:58 |
storedRetrievable | [[Retrievable], []] | Fired after a retrievable record is stored locally and persisted. | lib/types/dispatch_context.ts:52 |
storedStandingInstruction | [[Tokenizable], []] | Fired after a standing instruction is stored locally and persisted. | lib/types/dispatch_context.ts:40 |
storedThought | [[Thought], []] | Fired after a thought is stored locally and persisted. | lib/types/dispatch_context.ts:64 |
storedToolCall | [[ToolCall], []] | Fired after a tool call is stored locally and persisted. Remarks ToolCalls with fromArtifactTool === true originated from an @nhtio/adk!ArtifactTool invocation and carry a @nhtio/adk!Tokenizable in results (NOT a @nhtio/adk!SpooledArtifact). Subsequent SpooledArtifact.forgeTools(ctx) calls filter these out of the callId enum to prevent the artifact-grep-on-an-artifact-grep recursion. | lib/types/dispatch_context.ts:80 |
thought | [[TurnStreamableContent], []] | Fired when a reasoning trace chunk is emitted during execution. | lib/types/dispatch_context.ts:32 |
toolCall | [[TurnToolCallContent], []] | Fired when a tool call is emitted (on request and again on settlement). | lib/types/dispatch_context.ts:34 |
toolExecutionEnd | [[ToolExecutionEndEvent], []] | Fired after a tool handler returns or throws. | lib/types/dispatch_context.ts:38 |
toolExecutionStart | [[ToolExecutionStartEvent], []] | Fired immediately before a tool handler is called (after arg validation). | lib/types/dispatch_context.ts:36 |