@nhtio/adk 1.20260601.0 → 1.20260603.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to `@nhtio/adk` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 2026-06-03
9
+
10
+ ### Changed
11
+
12
+ - **MCP install examples now render the current package version at docs build time.** The ADK MCP
13
+ guide uses a `{{ADK_VERSION}}` token for pinned `@nhtio/adk@...` examples, and the docs build
14
+ rewrites it from `package.json` for VitePress pages, LLM artifacts, the Ask ADK index, and the
15
+ packaged MCP corpus. Release docs now stay aligned with the published package version without
16
+ hand-editing install snippets before every tag.
17
+
18
+ ## 2026-06-02
19
+
20
+ ### Fixed
21
+
22
+ - **Corrected the `callId` documentation on the tool-execution events.** `ToolExecutionStartEvent.callId`
23
+ and `ToolExecutionEndEvent.callId` were documented as correlating with `ToolCall.id`. They do not:
24
+ `callId` is `sha256({ tool, args })` — the same value as `TurnToolCallContent.checksum` and
25
+ `ToolCall.checksum`. The two buses join on **`toolCall.checksum === toolExecution*.callId`**, never
26
+ on `toolCall.id`. The hash collides by design for identical `(tool, args)` (that is what
27
+ `DispatchContext.toolCallCount` counts), so order or disambiguate repeated calls by the `DateTime`
28
+ fields (`createdAt` / `updatedAt`, `startedAt` / `endedAt`). TSDoc and the Events guides now state
29
+ this contract; no runtime behavior changed.
30
+
8
31
  ## 2026-06-01
9
32
 
10
33
  ### Added
package/index.cjs CHANGED
@@ -5,7 +5,6 @@ const require_tool_registry = require("./tool_registry-CoM6fy7F.js");
5
5
  const require_runtime = require("./runtime-MFFcJrRv.js");
6
6
  const require_dispatch_runner = require("./dispatch_runner-D_EIoEwR.js");
7
7
  require("./dispatch_runner.cjs");
8
- require("./exceptions.cjs");
9
8
  const require_thought = require("./thought-pxBGk4lN.js");
10
9
  const require_tool = require("./tool-CxIEutdk.js");
11
10
  const require_spooled_artifact = require("./spooled_artifact-Chp6PEr8.js");
@@ -13,8 +12,9 @@ const require_common = require("./common-Bfqzwdpd.js");
13
12
  const require_tool_call = require("./tool_call-BPPa_KYu.js");
14
13
  const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-b72JfMYo.js");
15
14
  const require_turn_runner = require("./turn_runner-DFW9OuBj.js");
16
- require("./turn_runner.cjs");
17
15
  const require_guards = require("./guards.cjs");
16
+ require("./exceptions.cjs");
17
+ require("./turn_runner.cjs");
18
18
  //#region src/index.ts
19
19
  /**
20
20
  * Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
@@ -26,7 +26,7 @@ const require_guards = require("./guards.cjs");
26
26
  *
27
27
  * @tip This is a constant that is replaced during the build process with the actual version of the package.
28
28
  */
29
- var version = "1.20260601.0";
29
+ var version = "1.20260603.0";
30
30
  //#endregion
31
31
  exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
32
32
  exports.DispatchRunner = require_dispatch_runner.DispatchRunner;
package/index.mjs CHANGED
@@ -3,7 +3,6 @@ import { c as isObject, i as Registry, n as TokenEncoding, o as isError, r as To
3
3
  import { C as E_NOT_A_SPOOL_READER, D as E_TOOL_DOWNSTREAM_ERROR, E as E_TOOL_ALREADY_REGISTERED, O as E_TURN_GATE_ABORTED, T as E_PIPELINE_SHORT_CIRCUITED, _ as E_INVALID_TURN_GATE_RESOLUTION, a as E_INVALID_INITIAL_MEMORY_VALUE, b as E_LLM_EXECUTION_EXECUTOR_ERROR, d as E_INVALID_INITIAL_TOOL_VALUE, f as E_INVALID_INITIAL_TURN_GATE_VALUE, g as E_INVALID_TURN_CONTEXT, h as E_INVALID_TOOL_ARGS, k as E_TURN_GATE_TIMEOUT, l as E_INVALID_INITIAL_THOUGHT_VALUE, m as E_INVALID_LLM_EXECUTION_CONTEXT, n as E_INPUT_PIPELINE_ERROR, o as E_INVALID_INITIAL_MESSAGE_VALUE, p as E_INVALID_LLM_DISPATCH_INPUT, r as E_INVALID_INITIAL_IDENTITY_VALUE, s as E_INVALID_INITIAL_REGISTRY_VALUE, t as E_DISPATCH_PIPELINE_ERROR, u as E_INVALID_INITIAL_TOOL_CALL_VALUE, v as E_INVALID_TURN_RUNNER_CONFIG, w as E_OUTPUT_PIPELINE_ERROR, x as E_LLM_EXECUTION_GATE_NOT_SUPPORTED, y as E_LLM_EXECUTION_ALREADY_SIGNALLED } from "./runtime-j92CNi5z.mjs";
4
4
  import { t as DispatchRunner } from "./dispatch_runner-DNy8EuK2.mjs";
5
5
  import "./dispatch_runner.mjs";
6
- import "./exceptions.mjs";
7
6
  import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-BhoBfz9K.mjs";
8
7
  import { t as Tool } from "./tool-C381-NLO.mjs";
9
8
  import { i as ArtifactTool, r as implementsSpoolReader, t as SpooledArtifact } from "./spooled_artifact-xpzZicMR.mjs";
@@ -11,8 +10,9 @@ import { n as fromWebFile, o as Retrievable, r as inMemoryMediaReader, t as from
11
10
  import { a as mediaReaderSchema, i as implementsMediaReader, n as Media, r as isMedia, t as ToolCall } from "./tool_call-H02gzSIs.mjs";
12
11
  import { n as SpooledJsonArtifact, t as SpooledMarkdownArtifact } from "./spooled_markdown_artifact-CigJMNOl.mjs";
13
12
  import { t as TurnRunner } from "./turn_runner-CJke8_wy.mjs";
14
- import "./turn_runner.mjs";
15
13
  import { isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isIdentity, isMemory, isMessage, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner } from "./guards.mjs";
14
+ import "./exceptions.mjs";
15
+ import "./turn_runner.mjs";
16
16
  //#region src/index.ts
17
17
  /**
18
18
  * Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
@@ -24,7 +24,7 @@ import { isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, i
24
24
  *
25
25
  * @tip This is a constant that is replaced during the build process with the actual version of the package.
26
26
  */
27
- var version = "1.20260601.0";
27
+ var version = "1.20260603.0";
28
28
  //#endregion
29
29
  export { ArtifactTool, DispatchRunner, E_DISPATCH_PIPELINE_ERROR, E_INPUT_PIPELINE_ERROR, E_INVALID_INITIAL_IDENTITY_VALUE, E_INVALID_INITIAL_MEMORY_VALUE, E_INVALID_INITIAL_MESSAGE_VALUE, E_INVALID_INITIAL_REGISTRY_VALUE, E_INVALID_INITIAL_THOUGHT_VALUE, E_INVALID_INITIAL_TOOL_CALL_VALUE, E_INVALID_INITIAL_TOOL_VALUE, E_INVALID_INITIAL_TURN_GATE_VALUE, E_INVALID_LLM_DISPATCH_INPUT, E_INVALID_LLM_EXECUTION_CONTEXT, E_INVALID_TOOL_ARGS, E_INVALID_TURN_CONTEXT, E_INVALID_TURN_GATE_RESOLUTION, E_INVALID_TURN_RUNNER_CONFIG, E_LLM_EXECUTION_ALREADY_SIGNALLED, E_LLM_EXECUTION_EXECUTOR_ERROR, E_LLM_EXECUTION_GATE_NOT_SUPPORTED, E_NOT_A_SPOOL_READER, E_OUTPUT_PIPELINE_ERROR, E_PIPELINE_SHORT_CIRCUITED, E_TOOL_ALREADY_REGISTERED, E_TOOL_DOWNSTREAM_ERROR, E_TURN_GATE_ABORTED, E_TURN_GATE_TIMEOUT, Identity, Media, Memory, Message, Registry, Retrievable, SpooledArtifact, SpooledJsonArtifact, SpooledMarkdownArtifact, Thought, TokenEncoding, Tokenizable, Tool, ToolCall, ToolRegistry, TurnRunner, ValidationException, fromFetch, fromWebFile, implementsMediaReader, implementsSpoolReader, inMemoryMediaReader, isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isError, isIdentity, isInstanceOf, isMedia, isMemory, isMessage, isObject, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner, mediaReaderSchema, version };
30
30
 
@@ -45,13 +45,23 @@ export interface TurnStreamableContent {
45
45
  * execution fails, `isError` is `true` and `results` contains the error detail.
46
46
  */
47
47
  export interface TurnToolCallContent {
48
- /** Stable identifier for this tool call; correlates the initial request with its result. */
48
+ /**
49
+ * Stable stream id for this tool call; ties the initial request to its result on **this** bus
50
+ * (the announce emission and the completion emission share it). This is the model/stream id, not
51
+ * a cross-bus key — to correlate with the observability `toolExecution*` events, use `checksum`.
52
+ */
49
53
  id: string;
50
54
  /** Name of the tool the model has requested. */
51
55
  tool: string;
52
56
  /** Arguments the model supplied for the tool call. */
53
57
  args: unknown;
54
- /** Integrity checksum over `tool` and `args`; can be used to detect tampering before execution. */
58
+ /**
59
+ * `sha256({ tool, args })` over the raw arguments. Doubles as the **cross-bus join key**: equal to
60
+ * {@link ToolExecutionStartEvent.callId} / {@link ToolExecutionEndEvent.callId} and to
61
+ * {@link @nhtio/adk!ToolCall.checksum}. Collides by design for identical `(tool, args)` within a
62
+ * turn — that is what {@link @nhtio/adk!DispatchContext.toolCallCount} counts — so order or
63
+ * disambiguate repeated calls by `createdAt` / `updatedAt`, not by `checksum` alone.
64
+ */
55
65
  checksum: string;
56
66
  /** Timestamp when this tool call was first emitted. */
57
67
  createdAt: DateTime;
@@ -109,16 +119,22 @@ export interface TurnEndEvent {
109
119
  *
110
120
  * @remarks
111
121
  * Fired after arg validation passes and immediately before the handler is called.
112
- * `callId` correlates the event with the {@link @nhtio/adk!ToolCall} record if one is being tracked. Fires
113
- * for both {@link @nhtio/adk!Tool} and
114
- * {@link @nhtio/adk!ArtifactTool} invocations — the payload is identical.
122
+ * `callId` is the cross-bus join key — equal to {@link TurnToolCallContent.checksum} and
123
+ * {@link @nhtio/adk!ToolCall.checksum}, **not** {@link @nhtio/adk!ToolCall.id}. Fires for both
124
+ * {@link @nhtio/adk!Tool} and {@link @nhtio/adk!ArtifactTool} invocations — the payload is identical.
115
125
  */
116
126
  export interface ToolExecutionStartEvent {
117
127
  /** Name of the tool being executed. */
118
128
  toolName: string;
119
129
  /** ID of the turn in which the tool is being executed. */
120
130
  turnId: string;
121
- /** Correlates with the associated ToolCall id, if known. Empty string when not provided. */
131
+ /**
132
+ * Cross-bus join key: `sha256({ tool, args })`, identical to {@link TurnToolCallContent.checksum}
133
+ * and {@link @nhtio/adk!ToolCall.checksum}. This is **not** {@link @nhtio/adk!ToolCall.id}. It
134
+ * collides by design for identical `(tool, args)` within a turn — that is what
135
+ * {@link @nhtio/adk!DispatchContext.toolCallCount} counts. Order or disambiguate repeated calls by
136
+ * `startedAt`. Empty string when not provided.
137
+ */
122
138
  callId: string;
123
139
  /** The validated arguments that will be passed to the handler. */
124
140
  args: unknown;
@@ -130,16 +146,22 @@ export interface ToolExecutionStartEvent {
130
146
  *
131
147
  * @remarks
132
148
  * Fired after the handler returns or throws. When `isError` is `true`, the handler threw and the
133
- * error has been wrapped in {@link @nhtio/adk!E_TOOL_DOWNSTREAM_ERROR}. Fires for both
134
- * {@link @nhtio/adk!Tool} and
135
- * {@link @nhtio/adk!ArtifactTool} invocations — the payload is identical.
149
+ * error has been wrapped in {@link @nhtio/adk!E_TOOL_DOWNSTREAM_ERROR}. `callId` carries the same
150
+ * cross-bus join key as {@link ToolExecutionStartEvent.callId}. Fires for both
151
+ * {@link @nhtio/adk!Tool} and {@link @nhtio/adk!ArtifactTool} invocations — the payload is identical.
136
152
  */
137
153
  export interface ToolExecutionEndEvent {
138
154
  /** Name of the tool that was executed. */
139
155
  toolName: string;
140
156
  /** ID of the turn in which the tool was executed. */
141
157
  turnId: string;
142
- /** Correlates with the associated ToolCall id, if known. Empty string when not provided. */
158
+ /**
159
+ * Cross-bus join key: `sha256({ tool, args })`, identical to {@link TurnToolCallContent.checksum}
160
+ * and {@link @nhtio/adk!ToolCall.checksum}. This is **not** {@link @nhtio/adk!ToolCall.id}. It
161
+ * collides by design for identical `(tool, args)` within a turn — that is what
162
+ * {@link @nhtio/adk!DispatchContext.toolCallCount} counts. Order or disambiguate repeated calls by
163
+ * `startedAt` / `endedAt`. Empty string when not provided.
164
+ */
143
165
  callId: string;
144
166
  /** When execution started. */
145
167
  startedAt: DateTime;