---
url: 'https://adk.nht.io/api/@nhtio/adk/types/type-aliases/DispatchContextHooks.md'
description: 'Hook event map for {@link @nhtio/adk!DispatchContext}.'
---

# 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](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L28)

Hook event map for [@nhtio/adk!DispatchContext](../interfaces/DispatchContext.md).

## Remarks

Each key maps to a tuple of `[HookArgs, CleanupArgs]`. These events mirror the functional and
observability events on [@nhtio/adk!TurnRunner](../../turn_runner/classes/TurnRunner.md) 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](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L50) |
|  `deletedMessage`                         | \[\[`string`], \[]]                                                                             | Fired after a message is removed locally and from persistence. Payload is the deleted id.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | [lib/types/dispatch\_context.ts:62](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L62) |
|  `deletedRetrievable`                 | \[\[`string`], \[]]                                                                             | Fired after a retrievable record is removed locally and from persistence. Payload is the deleted id.                                                                                                                                                                                                                                                                                                                                                                                                                                                | [lib/types/dispatch\_context.ts:56](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L56) |
|  `deletedStandingInstruction` | \[\[[`Tokenizable`](../../common/classes/Tokenizable.md)], \[]]                                 | Fired after a standing instruction is removed locally and from persistence.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | [lib/types/dispatch\_context.ts:44](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L44) |
|  `deletedThought`                         | \[\[`string`], \[]]                                                                             | Fired after a thought is removed locally and from persistence. Payload is the deleted id.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | [lib/types/dispatch\_context.ts:68](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L68) |
|  `deletedToolCall`                       | \[\[`string`], \[]]                                                                             | Fired after a tool call is removed locally and from persistence. Payload is the deleted id.                                                                                                                                                                                                                                                                                                                                                                                                                                                         | [lib/types/dispatch\_context.ts:90](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L90) |
|  `message`                                       | \[\[[`TurnStreamableContent`](../../turn_runner/interfaces/TurnStreamableContent.md)], \[]]     | Fired when a streaming message chunk is emitted during execution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [lib/types/dispatch\_context.ts:30](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L30) |
|  `mutatedMemory`                           | \[\[[`Memory`](../../common/classes/Memory.md)], \[]]                                           | Fired after a memory is mutated locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | [lib/types/dispatch\_context.ts:48](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L48) |
|  `mutatedMessage`                         | \[\[[`Message`](../../common/classes/Message.md)], \[]]                                         | Fired after a message is mutated locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [lib/types/dispatch\_context.ts:60](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L60) |
|  `mutatedRetrievable`                 | \[\[[`Retrievable`](../../common/classes/Retrievable.md)], \[]]                                 | Fired after a retrievable record is mutated locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | [lib/types/dispatch\_context.ts:54](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L54) |
|  `mutatedStandingInstruction` | \[\[[`Tokenizable`](../../common/classes/Tokenizable.md)], \[]]                                 | Fired after a standing instruction is mutated locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | [lib/types/dispatch\_context.ts:42](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L42) |
|  `mutatedThought`                         | \[\[[`Thought`](../../common/classes/Thought.md)], \[]]                                         | Fired after a thought is mutated locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [lib/types/dispatch\_context.ts:66](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L66) |
|  `mutatedToolCall`                       | \[\[[`ToolCall`](../../forge/classes/ToolCall.md)], \[]]                                        | Fired after a tool call is mutated locally and persisted. **Remarks** See [DispatchContextHooks.storedToolCall](#property-storedtoolcall) for the `fromArtifactTool` / `Tokenizable`-shaped `results` invariant.                                                                                                                                                                                                                                                                                                                                    | [lib/types/dispatch\_context.ts:88](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L88) |
|  `storedMemory`                             | \[\[[`Memory`](../../common/classes/Memory.md)], \[]]                                           | Fired after a memory is stored locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | [lib/types/dispatch\_context.ts:46](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L46) |
|  `storedMessage`                           | \[\[[`Message`](../../common/classes/Message.md)], \[]]                                         | Fired after a message is stored locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | [lib/types/dispatch\_context.ts:58](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L58) |
|  `storedRetrievable`                   | \[\[[`Retrievable`](../../common/classes/Retrievable.md)], \[]]                                 | Fired after a retrievable record is stored locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [lib/types/dispatch\_context.ts:52](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L52) |
|  `storedStandingInstruction`   | \[\[[`Tokenizable`](../../common/classes/Tokenizable.md)], \[]]                                 | Fired after a standing instruction is stored locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | [lib/types/dispatch\_context.ts:40](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L40) |
|  `storedThought`                           | \[\[[`Thought`](../../common/classes/Thought.md)], \[]]                                         | Fired after a thought is stored locally and persisted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | [lib/types/dispatch\_context.ts:64](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L64) |
|  `storedToolCall`                         | \[\[[`ToolCall`](../../forge/classes/ToolCall.md)], \[]]                                        | Fired after a tool call is stored locally and persisted. **Remarks** `ToolCall`s with `fromArtifactTool === true` originated from an [@nhtio/adk!ArtifactTool](../../forge/classes/ArtifactTool.md) invocation and carry a [@nhtio/adk!Tokenizable](../../common/classes/Tokenizable.md) in `results` (NOT a [@nhtio/adk!SpooledArtifact](../../spooled_artifact/classes/SpooledArtifact.md)). 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](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L80) |
|  `thought`                                       | \[\[[`TurnStreamableContent`](../../turn_runner/interfaces/TurnStreamableContent.md)], \[]]     | Fired when a reasoning trace chunk is emitted during execution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [lib/types/dispatch\_context.ts:32](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L32) |
|  `toolCall`                                     | \[\[[`TurnToolCallContent`](../../turn_runner/interfaces/TurnToolCallContent.md)], \[]]         | Fired when a tool call is emitted (on request and again on settlement).                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [lib/types/dispatch\_context.ts:34](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L34) |
|  `toolExecutionEnd`                     | \[\[[`ToolExecutionEndEvent`](../../turn_runner/interfaces/ToolExecutionEndEvent.md)], \[]]     | Fired after a tool handler returns or throws.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | [lib/types/dispatch\_context.ts:38](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L38) |
|  `toolExecutionStart`                 | \[\[[`ToolExecutionStartEvent`](../../turn_runner/interfaces/ToolExecutionStartEvent.md)], \[]] | Fired immediately before a tool handler is called (after arg validation).                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | [lib/types/dispatch\_context.ts:36](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/types/dispatch_context.ts#L36) |
