@nhtio/adk 1.20260529.0 → 1.20260531.1

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.
Files changed (187) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/adk-mcp.cjs +20307 -0
  3. package/adk-mcp.cjs.map +1 -0
  4. package/adk-mcp.mjs +20305 -0
  5. package/adk-mcp.mjs.map +1 -0
  6. package/batteries/llm/openai_chat_completions/adapter.cjs +10 -10
  7. package/batteries/llm/openai_chat_completions/adapter.cjs.map +1 -1
  8. package/batteries/llm/openai_chat_completions/adapter.mjs +9 -9
  9. package/batteries/llm/openai_chat_completions/adapter.mjs.map +1 -1
  10. package/batteries/llm/openai_chat_completions/exceptions.cjs +2 -1
  11. package/batteries/llm/openai_chat_completions/exceptions.cjs.map +1 -1
  12. package/batteries/llm/openai_chat_completions/exceptions.mjs +1 -1
  13. package/batteries/llm/openai_chat_completions/helpers.cjs +17 -16
  14. package/batteries/llm/openai_chat_completions/helpers.cjs.map +1 -1
  15. package/batteries/llm/openai_chat_completions/helpers.d.ts +10 -10
  16. package/batteries/llm/openai_chat_completions/helpers.mjs +16 -16
  17. package/batteries/llm/openai_chat_completions/helpers.mjs.map +1 -1
  18. package/batteries/llm/openai_chat_completions/types.cjs +1 -0
  19. package/batteries/llm/openai_chat_completions/types.d.ts +26 -6
  20. package/batteries/llm/openai_chat_completions/validation.cjs +3 -1
  21. package/batteries/llm/openai_chat_completions/validation.cjs.map +1 -1
  22. package/batteries/llm/openai_chat_completions/validation.mjs +2 -0
  23. package/batteries/llm/openai_chat_completions/validation.mjs.map +1 -1
  24. package/batteries/llm/openai_chat_completions.cjs +1 -0
  25. package/batteries/llm/webllm_chat_completions/adapter.cjs +10 -10
  26. package/batteries/llm/webllm_chat_completions/adapter.cjs.map +1 -1
  27. package/batteries/llm/webllm_chat_completions/adapter.mjs +9 -9
  28. package/batteries/llm/webllm_chat_completions/adapter.mjs.map +1 -1
  29. package/batteries/llm/webllm_chat_completions/exceptions.cjs +2 -1
  30. package/batteries/llm/webllm_chat_completions/exceptions.cjs.map +1 -1
  31. package/batteries/llm/webllm_chat_completions/exceptions.mjs +1 -1
  32. package/batteries/llm/webllm_chat_completions/helpers.cjs +1 -0
  33. package/batteries/llm/webllm_chat_completions/validation.cjs +3 -1
  34. package/batteries/llm/webllm_chat_completions/validation.cjs.map +1 -1
  35. package/batteries/llm/webllm_chat_completions/validation.mjs +2 -0
  36. package/batteries/llm/webllm_chat_completions/validation.mjs.map +1 -1
  37. package/batteries/llm/webllm_chat_completions.cjs +1 -0
  38. package/batteries/llm.cjs +1 -0
  39. package/batteries/storage/flydrive/index.d.ts +10 -4
  40. package/batteries/storage/flydrive.cjs +13 -3
  41. package/batteries/storage/flydrive.cjs.map +1 -1
  42. package/batteries/storage/flydrive.mjs +12 -4
  43. package/batteries/storage/flydrive.mjs.map +1 -1
  44. package/batteries/storage/in_memory/index.d.ts +31 -17
  45. package/batteries/storage/in_memory.cjs +90 -30
  46. package/batteries/storage/in_memory.cjs.map +1 -1
  47. package/batteries/storage/in_memory.mjs +89 -30
  48. package/batteries/storage/in_memory.mjs.map +1 -1
  49. package/batteries/storage/opfs/index.d.ts +10 -4
  50. package/batteries/storage/opfs.cjs +56 -5
  51. package/batteries/storage/opfs.cjs.map +1 -1
  52. package/batteries/storage/opfs.mjs +55 -5
  53. package/batteries/storage/opfs.mjs.map +1 -1
  54. package/batteries/storage.cjs +1 -0
  55. package/batteries/tools/color.cjs +3 -3
  56. package/batteries/tools/color.mjs +2 -2
  57. package/batteries/tools/comparison.cjs +4 -4
  58. package/batteries/tools/comparison.mjs +3 -3
  59. package/batteries/tools/data_structure.cjs +4 -4
  60. package/batteries/tools/data_structure.mjs +3 -3
  61. package/batteries/tools/datetime_extended.cjs +3 -3
  62. package/batteries/tools/datetime_extended.mjs +2 -2
  63. package/batteries/tools/datetime_math.cjs +3 -3
  64. package/batteries/tools/datetime_math.mjs +2 -2
  65. package/batteries/tools/encoding.cjs +4 -4
  66. package/batteries/tools/encoding.mjs +3 -3
  67. package/batteries/tools/formatting.cjs +4 -4
  68. package/batteries/tools/formatting.mjs +3 -3
  69. package/batteries/tools/geo_basics.cjs +3 -3
  70. package/batteries/tools/geo_basics.mjs +2 -2
  71. package/batteries/tools/math.cjs +4 -4
  72. package/batteries/tools/math.mjs +3 -3
  73. package/batteries/tools/memory.cjs +7 -7
  74. package/batteries/tools/memory.mjs +6 -6
  75. package/batteries/tools/parsing.cjs +5 -5
  76. package/batteries/tools/parsing.mjs +4 -4
  77. package/batteries/tools/retrievables.cjs +12 -11
  78. package/batteries/tools/retrievables.cjs.map +1 -1
  79. package/batteries/tools/retrievables.mjs +11 -10
  80. package/batteries/tools/retrievables.mjs.map +1 -1
  81. package/batteries/tools/standing_instructions.cjs +5 -5
  82. package/batteries/tools/standing_instructions.mjs +4 -4
  83. package/batteries/tools/statistics.cjs +5 -5
  84. package/batteries/tools/statistics.mjs +4 -4
  85. package/batteries/tools/string_processing.cjs +4 -4
  86. package/batteries/tools/string_processing.mjs +3 -3
  87. package/batteries/tools/structured_data.cjs +4 -4
  88. package/batteries/tools/structured_data.mjs +3 -3
  89. package/batteries/tools/text_analysis.cjs +4 -4
  90. package/batteries/tools/text_analysis.mjs +3 -3
  91. package/batteries/tools/text_comparison.cjs +3 -3
  92. package/batteries/tools/text_comparison.mjs +2 -2
  93. package/batteries/tools/time.cjs +3 -3
  94. package/batteries/tools/time.mjs +2 -2
  95. package/batteries/tools/unit_conversion.cjs +3 -3
  96. package/batteries/tools/unit_conversion.mjs +2 -2
  97. package/batteries/tools.cjs +2 -1
  98. package/batteries/tools.mjs +1 -1
  99. package/batteries.cjs +2 -1
  100. package/batteries.mjs +1 -1
  101. package/chunk-Ble4zEEl.js +64 -0
  102. package/{chunk-KmRHZBOW.js → chunk-kRvK8_k2.mjs} +12 -12
  103. package/{common-DeZaonK1.mjs → common-ClCHam5-.mjs} +78 -12
  104. package/common-ClCHam5-.mjs.map +1 -0
  105. package/{common-Od8edUXU.js → common-DuKWGTVd.js} +90 -12
  106. package/common-DuKWGTVd.js.map +1 -0
  107. package/common.cjs +10 -7
  108. package/common.d.ts +8 -0
  109. package/common.mjs +8 -8
  110. package/{dispatch_runner-CsoH0nld.js → dispatch_runner-CEFHXRJZ.js} +38 -6
  111. package/dispatch_runner-CEFHXRJZ.js.map +1 -0
  112. package/{dispatch_runner-9j6bXHL3.mjs → dispatch_runner-uNtS-XSP.mjs} +37 -5
  113. package/dispatch_runner-uNtS-XSP.mjs.map +1 -0
  114. package/dispatch_runner.cjs +2 -1
  115. package/dispatch_runner.mjs +1 -1
  116. package/{exceptions-NrzIHw_R.mjs → exceptions-BeWH2FwP.mjs} +1 -1
  117. package/{exceptions-NrzIHw_R.mjs.map → exceptions-BeWH2FwP.mjs.map} +1 -1
  118. package/{exceptions-D5YrO9Vm.js → exceptions-CitH5wZI.js} +2 -2
  119. package/{exceptions-D5YrO9Vm.js.map → exceptions-CitH5wZI.js.map} +1 -1
  120. package/exceptions.cjs +3 -2
  121. package/exceptions.mjs +2 -2
  122. package/factories.cjs +2 -1
  123. package/factories.mjs +1 -1
  124. package/forge.cjs +5 -4
  125. package/forge.mjs +4 -4
  126. package/guards.cjs +10 -9
  127. package/guards.cjs.map +1 -1
  128. package/guards.mjs +9 -9
  129. package/index.cjs +14 -13
  130. package/index.cjs.map +1 -1
  131. package/index.d.ts +1 -1
  132. package/index.mjs +13 -13
  133. package/index.mjs.map +1 -1
  134. package/lib/classes/retrievable.d.ts +47 -4
  135. package/lib/contracts/byte_store.d.ts +93 -0
  136. package/lib/contracts/dispatch_context.d.ts +44 -0
  137. package/lib/contracts/turn_runner_config.d.ts +5 -1
  138. package/lib/contracts/turn_runner_context.d.ts +25 -0
  139. package/mcp/adk-docs-corpus.json +1 -0
  140. package/mcp/corpus.d.ts +26 -0
  141. package/mcp/server.d.ts +2 -0
  142. package/package.json +84 -65
  143. package/{runtime-CrEPIFgr.mjs → runtime-CDIZwCT0.mjs} +2 -2
  144. package/{runtime-CrEPIFgr.mjs.map → runtime-CDIZwCT0.mjs.map} +1 -1
  145. package/{runtime-BJVkrGQe.js → runtime-DyD9oQjH.js} +2 -2
  146. package/{runtime-BJVkrGQe.js.map → runtime-DyD9oQjH.js.map} +1 -1
  147. package/skills/adk-assembly/SKILL.md +2 -2
  148. package/{spooled_artifact-Cm9Te22K.js → spooled_artifact-CHvDDYGA.js} +6 -6
  149. package/{spooled_artifact-Cm9Te22K.js.map → spooled_artifact-CHvDDYGA.js.map} +1 -1
  150. package/{spooled_artifact-C5ZtGxuJ.mjs → spooled_artifact-D-JrpY4W.mjs} +5 -5
  151. package/{spooled_artifact-C5ZtGxuJ.mjs.map → spooled_artifact-D-JrpY4W.mjs.map} +1 -1
  152. package/spooled_artifact.cjs +3 -2
  153. package/spooled_artifact.mjs +2 -2
  154. package/{spooled_markdown_artifact-BpUJol0W.mjs → spooled_markdown_artifact-B4eWOfCX.mjs} +3 -3
  155. package/{spooled_markdown_artifact-BpUJol0W.mjs.map → spooled_markdown_artifact-B4eWOfCX.mjs.map} +1 -1
  156. package/{spooled_markdown_artifact-RRB113sy.js → spooled_markdown_artifact-BYfPqFvk.js} +4 -4
  157. package/{spooled_markdown_artifact-RRB113sy.js.map → spooled_markdown_artifact-BYfPqFvk.js.map} +1 -1
  158. package/{thought-CDb457b4.mjs → thought-D9IS11b5.mjs} +5 -5
  159. package/{thought-CDb457b4.mjs.map → thought-D9IS11b5.mjs.map} +1 -1
  160. package/{thought-DuN2PgdO.js → thought-DBNsR6l8.js} +6 -6
  161. package/{thought-DuN2PgdO.js.map → thought-DBNsR6l8.js.map} +1 -1
  162. package/{tool-D2WB1EA1.mjs → tool-CsYuHhiS.mjs} +4 -4
  163. package/{tool-D2WB1EA1.mjs.map → tool-CsYuHhiS.mjs.map} +1 -1
  164. package/{tool-COSeH8I6.js → tool-DIHzOZiV.js} +5 -5
  165. package/{tool-COSeH8I6.js.map → tool-DIHzOZiV.js.map} +1 -1
  166. package/{tool_call-BKyyxGaZ.mjs → tool_call-Bs_Q5LOG.mjs} +5 -5
  167. package/{tool_call-BKyyxGaZ.mjs.map → tool_call-Bs_Q5LOG.mjs.map} +1 -1
  168. package/{tool_call-DFgzcVcU.js → tool_call-CkOVOhg0.js} +6 -6
  169. package/{tool_call-DFgzcVcU.js.map → tool_call-CkOVOhg0.js.map} +1 -1
  170. package/{tool_registry-Dkfprsck.js → tool_registry-CKk5ooxm.js} +4 -4
  171. package/{tool_registry-Dkfprsck.js.map → tool_registry-CKk5ooxm.js.map} +1 -1
  172. package/{tool_registry-DqLOyGyG.mjs → tool_registry-CX3ofUh9.mjs} +3 -3
  173. package/{tool_registry-DqLOyGyG.mjs.map → tool_registry-CX3ofUh9.mjs.map} +1 -1
  174. package/{turn_runner-y7eyEcJH.mjs → turn_runner-C1-mup84.mjs} +10 -6
  175. package/turn_runner-C1-mup84.mjs.map +1 -0
  176. package/{turn_runner-CMm2BHdX.js → turn_runner-D0qGIrRI.js} +11 -7
  177. package/turn_runner-D0qGIrRI.js.map +1 -0
  178. package/turn_runner.cjs +2 -1
  179. package/turn_runner.mjs +1 -1
  180. package/types.cjs +1 -0
  181. package/types.d.ts +2 -2
  182. package/common-DeZaonK1.mjs.map +0 -1
  183. package/common-Od8edUXU.js.map +0 -1
  184. package/dispatch_runner-9j6bXHL3.mjs.map +0 -1
  185. package/dispatch_runner-CsoH0nld.js.map +0 -1
  186. package/turn_runner-CMm2BHdX.js.map +0 -1
  187. package/turn_runner-y7eyEcJH.mjs.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,67 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@nhtio/adk` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 2026-05-31
9
+
10
+ ### Added
11
+
12
+ - **Packaged ADK Assembly MCP server** (`src/mcp/server.ts`) — `@nhtio/adk` now ships a local
13
+ stdio MCP server that can be launched with `npx -y @nhtio/adk`. The server exposes ADK assembly
14
+ guidance, packaged documentation search, document reads, generated API lookup, and pasted-code
15
+ assembly review through MCP tools, resources, and prompts.
16
+ - **Version-aligned MCP documentation corpus** (`dist/mcp/adk-docs-corpus.json`) — package
17
+ generation now copies hand-written docs, generated TypeDoc API pages, changelog content, and the
18
+ ADK assembly Skill into a read-only corpus for the MCP server. The corpus is built from the docs
19
+ available at package time so MCP answers match the installed package version.
20
+ - **ADK MCP documentation page** (`docs/mcp.md`) — added a VitePress guide for installing and using
21
+ the ADK MCP across common coding-agent clients, including VS Code / Copilot, Claude Code, Claude
22
+ Desktop, Cursor, Windsurf, Cline / Roo Code, and Continue.
23
+ - **Unified `ByteStore<R>` storage contract** (`src/lib/contracts/byte_store.ts`) — the single
24
+ low-level "give bytes, get a reader" shape every storage layer implements, with `SpoolStore`
25
+ (`ByteStore<SpoolReader>`) and `MediaStore` (`ByteStore<MediaReader>`) semantic aliases. `write`
26
+ accepts `string | Uint8Array | ReadableStream<Uint8Array>`; string input is UTF-8-encoded.
27
+ Exported alongside `implementsByteStore` and `byteStoreSchema`.
28
+ - **Injectable `spoolStore` option** on the OpenAI and WebLLM Chat Completions batteries — back
29
+ tool-output artifacts with durable storage (`OpfsSpoolStore`, a Flydrive-backed store) instead of
30
+ the default per-dispatch in-memory store. Durable stores also stream large/binary tool output to
31
+ disk rather than buffering it in memory.
32
+ - **`ctx.storeMediaBytes(id, bytes)` → `MediaReader`** and **`ctx.storeRetrievableBytes(id, bytes)`
33
+ → `SpoolReader`** — handler-reachable byte-persistence conduits that route tool-generated media
34
+ and large extracted RAG text into consumer storage. Both accept a `ReadableStream`. Exposed on
35
+ `TurnContext` and `DispatchContext`; `ConduitBytes` is exported from the public API.
36
+ - **Reader-backed `Retrievable.content`** — `content` now accepts a `SpooledArtifact` in addition
37
+ to `string | Tokenizable`, so large extracted RAG text can live in a consumer `ByteStore` instead
38
+ of permanently on the heap. New `Retrievable.estimateTokens(encoding)` and
39
+ `Retrievable.contentString()` accessors. (Note: token estimation and render still materialise the
40
+ body transiently; reader-backing removes *permanent* heap residency, not the transient
41
+ allocation.)
42
+
43
+ ### Fixed
44
+
45
+ - **`InMemorySpoolStore` no longer corrupts binary tool output.** It previously UTF-8-decoded every
46
+ `Uint8Array` at write time, mangling non-text bytes (PDFs, images). Bytes are now stored
47
+ byte-faithfully; `InMemorySpoolReader` decodes on demand for line/text reads and reports the true
48
+ stored byte length.
49
+
50
+ ### Changed (BREAKING)
51
+
52
+ - **Documentation now builds before the library package in CI.** The package build consumes the
53
+ generated docs, API reference, and changelog artifact so the npm package always includes the MCP
54
+ documentation corpus when built from tagged/default-branch CI jobs.
55
+ - **The generated npm package now exposes an `adk` binary.** `bin/package.ts` writes
56
+ `bin.adk = "./adk-mcp.mjs"` into the packaged manifest and bundles the MCP SDK/Zod-backed server
57
+ entry while keeping those MCP implementation dependencies out of the published runtime dependency
58
+ list.
59
+ - **Render helpers are now async.** `renderFirstPartyRetrievables`,
60
+ `renderThirdPartyPublicRetrievables`, `renderThirdPartyPrivateRetrievables`, `renderRetrievables`,
61
+ and `renderChatCompletionsSystemPrompt` on `ChatCompletionsHelpers` now return `Promise<string>`
62
+ (previously `string`). Consumers who override these helpers must update their signatures.
63
+ - **`TurnRunnerConfig` gains two required callbacks** — `storeMediaBytesCallback` and
64
+ `storeRetrievableBytesCallback` (both arity 3). `RawDispatchContext` gains the matching required
65
+ `storeMediaBytes` / `storeRetrievableBytes` fields.
66
+ - **Tool-output spool writes are now awaited** — a custom `spoolStore.write()` may return a
67
+ `Promise` (required for `ReadableStream` input).