@nhtio/adk 0.1.0-master-f0aa531d

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 (297) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +3 -0
  3. package/batteries/index.d.ts +28 -0
  4. package/batteries/llm/index.d.ts +11 -0
  5. package/batteries/llm/openai_chat_completions/adapter.cjs +916 -0
  6. package/batteries/llm/openai_chat_completions/adapter.cjs.map +1 -0
  7. package/batteries/llm/openai_chat_completions/adapter.d.ts +101 -0
  8. package/batteries/llm/openai_chat_completions/adapter.mjs +914 -0
  9. package/batteries/llm/openai_chat_completions/adapter.mjs.map +1 -0
  10. package/batteries/llm/openai_chat_completions/exceptions.cjs +89 -0
  11. package/batteries/llm/openai_chat_completions/exceptions.cjs.map +1 -0
  12. package/batteries/llm/openai_chat_completions/exceptions.d.ts +97 -0
  13. package/batteries/llm/openai_chat_completions/exceptions.mjs +81 -0
  14. package/batteries/llm/openai_chat_completions/exceptions.mjs.map +1 -0
  15. package/batteries/llm/openai_chat_completions/helpers.cjs +819 -0
  16. package/batteries/llm/openai_chat_completions/helpers.cjs.map +1 -0
  17. package/batteries/llm/openai_chat_completions/helpers.d.ts +233 -0
  18. package/batteries/llm/openai_chat_completions/helpers.mjs +783 -0
  19. package/batteries/llm/openai_chat_completions/helpers.mjs.map +1 -0
  20. package/batteries/llm/openai_chat_completions/index.d.ts +27 -0
  21. package/batteries/llm/openai_chat_completions/types.cjs +1 -0
  22. package/batteries/llm/openai_chat_completions/types.d.ts +524 -0
  23. package/batteries/llm/openai_chat_completions/types.mjs +0 -0
  24. package/batteries/llm/openai_chat_completions/validation.cjs +190 -0
  25. package/batteries/llm/openai_chat_completions/validation.cjs.map +1 -0
  26. package/batteries/llm/openai_chat_completions/validation.d.ts +31 -0
  27. package/batteries/llm/openai_chat_completions/validation.mjs +187 -0
  28. package/batteries/llm/openai_chat_completions/validation.mjs.map +1 -0
  29. package/batteries/llm/openai_chat_completions.cjs +51 -0
  30. package/batteries/llm/openai_chat_completions.mjs +5 -0
  31. package/batteries/llm/webllm_chat_completions/adapter.cjs +658 -0
  32. package/batteries/llm/webllm_chat_completions/adapter.cjs.map +1 -0
  33. package/batteries/llm/webllm_chat_completions/adapter.d.ts +103 -0
  34. package/batteries/llm/webllm_chat_completions/adapter.mjs +656 -0
  35. package/batteries/llm/webllm_chat_completions/adapter.mjs.map +1 -0
  36. package/batteries/llm/webllm_chat_completions/exceptions.cjs +70 -0
  37. package/batteries/llm/webllm_chat_completions/exceptions.cjs.map +1 -0
  38. package/batteries/llm/webllm_chat_completions/exceptions.d.ts +74 -0
  39. package/batteries/llm/webllm_chat_completions/exceptions.mjs +65 -0
  40. package/batteries/llm/webllm_chat_completions/exceptions.mjs.map +1 -0
  41. package/batteries/llm/webllm_chat_completions/helpers.cjs +38 -0
  42. package/batteries/llm/webllm_chat_completions/helpers.d.ts +6 -0
  43. package/batteries/llm/webllm_chat_completions/helpers.mjs +2 -0
  44. package/batteries/llm/webllm_chat_completions/index.d.ts +25 -0
  45. package/batteries/llm/webllm_chat_completions/types.d.ts +31 -0
  46. package/batteries/llm/webllm_chat_completions/validation.cjs +115 -0
  47. package/batteries/llm/webllm_chat_completions/validation.cjs.map +1 -0
  48. package/batteries/llm/webllm_chat_completions/validation.d.ts +8 -0
  49. package/batteries/llm/webllm_chat_completions/validation.mjs +112 -0
  50. package/batteries/llm/webllm_chat_completions/validation.mjs.map +1 -0
  51. package/batteries/llm/webllm_chat_completions.cjs +50 -0
  52. package/batteries/llm/webllm_chat_completions.mjs +6 -0
  53. package/batteries/llm.cjs +63 -0
  54. package/batteries/llm.mjs +10 -0
  55. package/batteries/storage/flydrive/index.d.ts +167 -0
  56. package/batteries/storage/flydrive.cjs +249 -0
  57. package/batteries/storage/flydrive.cjs.map +1 -0
  58. package/batteries/storage/flydrive.mjs +249 -0
  59. package/batteries/storage/flydrive.mjs.map +1 -0
  60. package/batteries/storage/in_memory/index.d.ts +106 -0
  61. package/batteries/storage/in_memory.cjs +121 -0
  62. package/batteries/storage/in_memory.cjs.map +1 -0
  63. package/batteries/storage/in_memory.mjs +119 -0
  64. package/batteries/storage/in_memory.mjs.map +1 -0
  65. package/batteries/storage/index.d.ts +18 -0
  66. package/batteries/storage/opfs/index.d.ts +299 -0
  67. package/batteries/storage/opfs.cjs +368 -0
  68. package/batteries/storage/opfs.cjs.map +1 -0
  69. package/batteries/storage/opfs.mjs +366 -0
  70. package/batteries/storage/opfs.mjs.map +1 -0
  71. package/batteries/storage.cjs +4 -0
  72. package/batteries/storage.mjs +2 -0
  73. package/batteries/tools/color/index.d.ts +37 -0
  74. package/batteries/tools/color.cjs +659 -0
  75. package/batteries/tools/color.cjs.map +1 -0
  76. package/batteries/tools/color.mjs +655 -0
  77. package/batteries/tools/color.mjs.map +1 -0
  78. package/batteries/tools/comparison/index.d.ts +29 -0
  79. package/batteries/tools/comparison.cjs +171 -0
  80. package/batteries/tools/comparison.cjs.map +1 -0
  81. package/batteries/tools/comparison.mjs +168 -0
  82. package/batteries/tools/comparison.mjs.map +1 -0
  83. package/batteries/tools/data_structure/index.d.ts +30 -0
  84. package/batteries/tools/data_structure.cjs +270 -0
  85. package/batteries/tools/data_structure.cjs.map +1 -0
  86. package/batteries/tools/data_structure.mjs +267 -0
  87. package/batteries/tools/data_structure.mjs.map +1 -0
  88. package/batteries/tools/datetime_extended/index.d.ts +51 -0
  89. package/batteries/tools/datetime_extended.cjs +309 -0
  90. package/batteries/tools/datetime_extended.cjs.map +1 -0
  91. package/batteries/tools/datetime_extended.mjs +302 -0
  92. package/batteries/tools/datetime_extended.mjs.map +1 -0
  93. package/batteries/tools/datetime_math/index.d.ts +36 -0
  94. package/batteries/tools/datetime_math.cjs +175 -0
  95. package/batteries/tools/datetime_math.cjs.map +1 -0
  96. package/batteries/tools/datetime_math.mjs +171 -0
  97. package/batteries/tools/datetime_math.mjs.map +1 -0
  98. package/batteries/tools/encoding/index.d.ts +36 -0
  99. package/batteries/tools/encoding.cjs +156 -0
  100. package/batteries/tools/encoding.cjs.map +1 -0
  101. package/batteries/tools/encoding.mjs +152 -0
  102. package/batteries/tools/encoding.mjs.map +1 -0
  103. package/batteries/tools/formatting/index.d.ts +28 -0
  104. package/batteries/tools/formatting.cjs +120 -0
  105. package/batteries/tools/formatting.cjs.map +1 -0
  106. package/batteries/tools/formatting.mjs +117 -0
  107. package/batteries/tools/formatting.mjs.map +1 -0
  108. package/batteries/tools/geo_basics/index.d.ts +33 -0
  109. package/batteries/tools/geo_basics.cjs +136 -0
  110. package/batteries/tools/geo_basics.cjs.map +1 -0
  111. package/batteries/tools/geo_basics.mjs +132 -0
  112. package/batteries/tools/geo_basics.mjs.map +1 -0
  113. package/batteries/tools/index.d.ts +32 -0
  114. package/batteries/tools/math/index.d.ts +37 -0
  115. package/batteries/tools/math.cjs +136 -0
  116. package/batteries/tools/math.cjs.map +1 -0
  117. package/batteries/tools/math.mjs +133 -0
  118. package/batteries/tools/math.mjs.map +1 -0
  119. package/batteries/tools/memory/index.d.ts +73 -0
  120. package/batteries/tools/memory.cjs +193 -0
  121. package/batteries/tools/memory.cjs.map +1 -0
  122. package/batteries/tools/memory.mjs +187 -0
  123. package/batteries/tools/memory.mjs.map +1 -0
  124. package/batteries/tools/parsing/index.d.ts +47 -0
  125. package/batteries/tools/parsing.cjs +191 -0
  126. package/batteries/tools/parsing.cjs.map +1 -0
  127. package/batteries/tools/parsing.mjs +185 -0
  128. package/batteries/tools/parsing.mjs.map +1 -0
  129. package/batteries/tools/retrievables/index.d.ts +81 -0
  130. package/batteries/tools/retrievables.cjs +215 -0
  131. package/batteries/tools/retrievables.cjs.map +1 -0
  132. package/batteries/tools/retrievables.mjs +209 -0
  133. package/batteries/tools/retrievables.mjs.map +1 -0
  134. package/batteries/tools/standing_instructions/index.d.ts +64 -0
  135. package/batteries/tools/standing_instructions.cjs +126 -0
  136. package/batteries/tools/standing_instructions.cjs.map +1 -0
  137. package/batteries/tools/standing_instructions.mjs +121 -0
  138. package/batteries/tools/standing_instructions.mjs.map +1 -0
  139. package/batteries/tools/statistics/index.d.ts +46 -0
  140. package/batteries/tools/statistics.cjs +253 -0
  141. package/batteries/tools/statistics.cjs.map +1 -0
  142. package/batteries/tools/statistics.mjs +248 -0
  143. package/batteries/tools/statistics.mjs.map +1 -0
  144. package/batteries/tools/string_processing/index.d.ts +29 -0
  145. package/batteries/tools/string_processing.cjs +154 -0
  146. package/batteries/tools/string_processing.cjs.map +1 -0
  147. package/batteries/tools/string_processing.mjs +151 -0
  148. package/batteries/tools/string_processing.mjs.map +1 -0
  149. package/batteries/tools/structured_data/index.d.ts +34 -0
  150. package/batteries/tools/structured_data.cjs +189 -0
  151. package/batteries/tools/structured_data.cjs.map +1 -0
  152. package/batteries/tools/structured_data.mjs +185 -0
  153. package/batteries/tools/structured_data.mjs.map +1 -0
  154. package/batteries/tools/text_analysis/index.d.ts +31 -0
  155. package/batteries/tools/text_analysis.cjs +120 -0
  156. package/batteries/tools/text_analysis.cjs.map +1 -0
  157. package/batteries/tools/text_analysis.mjs +117 -0
  158. package/batteries/tools/text_analysis.mjs.map +1 -0
  159. package/batteries/tools/text_comparison/index.d.ts +28 -0
  160. package/batteries/tools/text_comparison.cjs +96 -0
  161. package/batteries/tools/text_comparison.cjs.map +1 -0
  162. package/batteries/tools/text_comparison.mjs +93 -0
  163. package/batteries/tools/text_comparison.mjs.map +1 -0
  164. package/batteries/tools/time/index.d.ts +27 -0
  165. package/batteries/tools/time.cjs +63 -0
  166. package/batteries/tools/time.cjs.map +1 -0
  167. package/batteries/tools/time.mjs +60 -0
  168. package/batteries/tools/time.mjs.map +1 -0
  169. package/batteries/tools/unit_conversion/index.d.ts +19 -0
  170. package/batteries/tools/unit_conversion.cjs +452 -0
  171. package/batteries/tools/unit_conversion.cjs.map +1 -0
  172. package/batteries/tools/unit_conversion.mjs +450 -0
  173. package/batteries/tools/unit_conversion.mjs.map +1 -0
  174. package/batteries/tools.cjs +80 -0
  175. package/batteries/tools.mjs +21 -0
  176. package/batteries.cjs +142 -0
  177. package/batteries.mjs +30 -0
  178. package/chunk-KmRHZBOW.js +35 -0
  179. package/common-DeZaonK1.mjs +208 -0
  180. package/common-DeZaonK1.mjs.map +1 -0
  181. package/common-Od8edUXU.js +232 -0
  182. package/common-Od8edUXU.js.map +1 -0
  183. package/common.cjs +31 -0
  184. package/common.d.ts +108 -0
  185. package/common.mjs +8 -0
  186. package/dispatch_runner-9j6bXHL3.mjs +1609 -0
  187. package/dispatch_runner-9j6bXHL3.mjs.map +1 -0
  188. package/dispatch_runner-CsoH0nld.js +1627 -0
  189. package/dispatch_runner-CsoH0nld.js.map +1 -0
  190. package/dispatch_runner.cjs +3 -0
  191. package/dispatch_runner.d.ts +17 -0
  192. package/dispatch_runner.mjs +2 -0
  193. package/exceptions-D5YrO9Vm.js +280 -0
  194. package/exceptions-D5YrO9Vm.js.map +1 -0
  195. package/exceptions-NrzIHw_R.mjs +244 -0
  196. package/exceptions-NrzIHw_R.mjs.map +1 -0
  197. package/exceptions.cjs +33 -0
  198. package/exceptions.d.ts +52 -0
  199. package/exceptions.mjs +3 -0
  200. package/factories.cjs +4 -0
  201. package/factories.d.ts +39 -0
  202. package/factories.mjs +2 -0
  203. package/forge.cjs +9 -0
  204. package/forge.d.ts +49 -0
  205. package/forge.mjs +5 -0
  206. package/guards.cjs +96 -0
  207. package/guards.cjs.map +1 -0
  208. package/guards.d.ts +83 -0
  209. package/guards.mjs +72 -0
  210. package/guards.mjs.map +1 -0
  211. package/index.cjs +107 -0
  212. package/index.cjs.map +1 -0
  213. package/index.d.ts +18 -0
  214. package/index.mjs +31 -0
  215. package/index.mjs.map +1 -0
  216. package/lib/classes/artifact_tool.d.ts +129 -0
  217. package/lib/classes/base_exception.d.ts +83 -0
  218. package/lib/classes/identity.d.ts +71 -0
  219. package/lib/classes/media.d.ts +326 -0
  220. package/lib/classes/memory.d.ts +72 -0
  221. package/lib/classes/message.d.ts +137 -0
  222. package/lib/classes/registry.d.ts +79 -0
  223. package/lib/classes/retrievable.d.ts +100 -0
  224. package/lib/classes/spooled_artifact.d.ts +296 -0
  225. package/lib/classes/spooled_json_artifact.d.ts +158 -0
  226. package/lib/classes/spooled_markdown_artifact.d.ts +202 -0
  227. package/lib/classes/thought.d.ts +142 -0
  228. package/lib/classes/tokenizable.d.ts +124 -0
  229. package/lib/classes/tool.d.ts +228 -0
  230. package/lib/classes/tool_call.d.ts +190 -0
  231. package/lib/classes/tool_registry.d.ts +159 -0
  232. package/lib/classes/turn_gate.d.ts +109 -0
  233. package/lib/contracts/dispatch_context.d.ts +345 -0
  234. package/lib/contracts/media_reader.d.ts +60 -0
  235. package/lib/contracts/spool_reader.d.ts +80 -0
  236. package/lib/contracts/spooled_artifact_constructor.d.ts +38 -0
  237. package/lib/contracts/turn_runner_config.d.ts +101 -0
  238. package/lib/contracts/turn_runner_context.d.ts +267 -0
  239. package/lib/dispatch_runner.d.ts +98 -0
  240. package/lib/exceptions/runtime.d.ts +370 -0
  241. package/lib/helpers/media_readers.d.ts +39 -0
  242. package/lib/turn_runner.d.ts +144 -0
  243. package/lib/types/dispatch_context.d.ts +233 -0
  244. package/lib/types/dispatch_runner.d.ts +387 -0
  245. package/lib/types/turn_runner.d.ts +322 -0
  246. package/lib/utils/canonical_json.d.ts +18 -0
  247. package/lib/utils/exceptions.d.ts +78 -0
  248. package/lib/utils/guards.d.ts +32 -0
  249. package/lib/utils/validation.d.ts +77 -0
  250. package/package.json +334 -0
  251. package/runtime-BJVkrGQe.js +519 -0
  252. package/runtime-BJVkrGQe.js.map +1 -0
  253. package/runtime-CrEPIFgr.mjs +346 -0
  254. package/runtime-CrEPIFgr.mjs.map +1 -0
  255. package/skills/adk-assembly/SKILL.md +109 -0
  256. package/skills/adk-assembly/references/assembly-contract.md +66 -0
  257. package/skills/adk-assembly/references/executors-tools-pipelines-events.md +113 -0
  258. package/skills/adk-assembly/references/first-integration.md +93 -0
  259. package/skills/adk-assembly/references/storage-and-context.md +102 -0
  260. package/spooled_artifact-C5ZtGxuJ.mjs +544 -0
  261. package/spooled_artifact-C5ZtGxuJ.mjs.map +1 -0
  262. package/spooled_artifact-Cm9Te22K.js +568 -0
  263. package/spooled_artifact-Cm9Te22K.js.map +1 -0
  264. package/spooled_artifact.cjs +7 -0
  265. package/spooled_artifact.d.ts +40 -0
  266. package/spooled_artifact.mjs +3 -0
  267. package/spooled_markdown_artifact-BpUJol0W.mjs +771 -0
  268. package/spooled_markdown_artifact-BpUJol0W.mjs.map +1 -0
  269. package/spooled_markdown_artifact-RRB113sy.js +786 -0
  270. package/spooled_markdown_artifact-RRB113sy.js.map +1 -0
  271. package/thought-CDb457b4.mjs +470 -0
  272. package/thought-CDb457b4.mjs.map +1 -0
  273. package/thought-DuN2PgdO.js +494 -0
  274. package/thought-DuN2PgdO.js.map +1 -0
  275. package/tool-COSeH8I6.js +302 -0
  276. package/tool-COSeH8I6.js.map +1 -0
  277. package/tool-D2WB1EA1.mjs +296 -0
  278. package/tool-D2WB1EA1.mjs.map +1 -0
  279. package/tool_call-BKyyxGaZ.mjs +578 -0
  280. package/tool_call-BKyyxGaZ.mjs.map +1 -0
  281. package/tool_call-DFgzcVcU.js +608 -0
  282. package/tool_call-DFgzcVcU.js.map +1 -0
  283. package/tool_registry-Dkfprsck.js +641 -0
  284. package/tool_registry-Dkfprsck.js.map +1 -0
  285. package/tool_registry-DqLOyGyG.mjs +592 -0
  286. package/tool_registry-DqLOyGyG.mjs.map +1 -0
  287. package/turn_runner-CMm2BHdX.js +615 -0
  288. package/turn_runner-CMm2BHdX.js.map +1 -0
  289. package/turn_runner-y7eyEcJH.mjs +603 -0
  290. package/turn_runner-y7eyEcJH.mjs.map +1 -0
  291. package/turn_runner.cjs +3 -0
  292. package/turn_runner.d.ts +21 -0
  293. package/turn_runner.mjs +2 -0
  294. package/types.cjs +1 -0
  295. package/types.d.ts +56 -0
  296. package/types.mjs +0 -0
  297. package/vite-env.d.ts +23 -0
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Core ADK exception classes and reusable runtime error constructors.
3
+ *
4
+ * Every exception has a stable `E_*` code. The `fatal` flag on each code controls whether it
5
+ * throws synchronously (programming error — no recovery path) or is emitted on the observability
6
+ * `error` bus (runtime failure — `run()` still resolves).
7
+ *
8
+ * @groupDescription Turn Runner Construction
9
+ * Exceptions thrown when a {@link @nhtio/adk!TurnRunner} is misconfigured at construction time. Fatal —
10
+ * a misconfigured runner cannot execute turns.
11
+ *
12
+ * @groupDescription Turn Input Validation
13
+ * Exceptions thrown when the raw turn context supplied to `runner.run()` fails validation. Fatal
14
+ * and synchronous — thrown before `turnStart` is emitted.
15
+ *
16
+ * @groupDescription Pipelines
17
+ * Non-fatal pipeline errors emitted on the observability `error` bus when middleware throws or
18
+ * a pipeline short-circuits. `run()` resolves; `turnEnd` still fires.
19
+ *
20
+ * @groupDescription Dispatch
21
+ * Exceptions from the dispatch loop and its executor. A mix of fatal (programming errors) and
22
+ * non-fatal (runtime failures that nack the dispatch). The loop terminates as `'ack'`, `'nack'`,
23
+ * or `'aborted'` — inspect `dispatchEnd.status` to classify.
24
+ *
25
+ * @groupDescription Gates
26
+ * Exceptions from {@link @nhtio/adk!TurnGate} construction and settlement. All four settlement outcomes
27
+ * (resolved, invalid-resolution, aborted, timed-out) also emit `turnGateClosed` on the
28
+ * observability bus.
29
+ *
30
+ * @groupDescription Tools
31
+ * Exceptions from tool construction, registration, argument validation, and handler execution.
32
+ * `E_TOOL_DOWNSTREAM_ERROR` wraps handler throws — the original error is on `.cause`.
33
+ *
34
+ * @groupDescription Primitive Validation
35
+ * Fatal exceptions thrown at construction time when a primitive ({@link @nhtio/adk!Message}, {@link @nhtio/adk!Memory},
36
+ * {@link @nhtio/adk!Thought}, {@link @nhtio/adk!ToolCall}, {@link @nhtio/adk!Retrievable}, {@link @nhtio/adk!Identity}, {@link @nhtio/adk!Registry})
37
+ * receives an invalid initial value. If a primitive constructed, it is valid.
38
+ *
39
+ * @groupDescription Artifacts
40
+ * Exceptions from spool and media artifact construction. Fatal — wrap-site validation that the
41
+ * supplied value implements the required reader interface.
42
+ *
43
+ * @module @nhtio/adk/exceptions
44
+ */
45
+ /**
46
+ * @primaryExport
47
+ */
48
+ export { ValidationException } from "./lib/utils/validation";
49
+ /**
50
+ * @primaryExport
51
+ */
52
+ export { E_INVALID_TURN_RUNNER_CONFIG, E_INVALID_TURN_CONTEXT, E_INPUT_PIPELINE_ERROR, E_OUTPUT_PIPELINE_ERROR, E_PIPELINE_SHORT_CIRCUITED, E_INVALID_INITIAL_REGISTRY_VALUE, E_INVALID_INITIAL_MEMORY_VALUE, E_INVALID_INITIAL_MESSAGE_VALUE, E_INVALID_INITIAL_IDENTITY_VALUE, E_INVALID_INITIAL_THOUGHT_VALUE, E_INVALID_INITIAL_RETRIEVABLE_VALUE, E_INVALID_INITIAL_MEDIA_VALUE, E_NOT_A_MEDIA_READER, E_INVALID_INITIAL_TURN_GATE_VALUE, E_INVALID_TURN_GATE_RESOLUTION, E_TURN_GATE_TIMEOUT, E_TURN_GATE_ABORTED, E_NOT_A_SPOOL_READER, E_INVALID_INITIAL_TOOL_CALL_VALUE, E_INVALID_INITIAL_TOOL_VALUE, E_INVALID_TOOL_ARGS, E_TOOL_DOWNSTREAM_ERROR, E_TOOL_ALREADY_REGISTERED, E_INVALID_LLM_EXECUTION_CONTEXT, E_LLM_EXECUTION_GATE_NOT_SUPPORTED, E_LLM_EXECUTION_ALREADY_SIGNALLED, E_INVALID_LLM_DISPATCH_INPUT, E_DISPATCH_PIPELINE_ERROR, E_LLM_EXECUTION_EXECUTOR_ERROR, } from "./lib/exceptions/runtime";
package/exceptions.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { n as ValidationException } from "./exceptions-NrzIHw_R.mjs";
2
+ 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, S as E_NOT_A_MEDIA_READER, 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, c as E_INVALID_INITIAL_RETRIEVABLE_VALUE, 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, i as E_INVALID_INITIAL_MEDIA_VALUE, 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-CrEPIFgr.mjs";
3
+ export { E_DISPATCH_PIPELINE_ERROR, E_INPUT_PIPELINE_ERROR, E_INVALID_INITIAL_IDENTITY_VALUE, E_INVALID_INITIAL_MEDIA_VALUE, E_INVALID_INITIAL_MEMORY_VALUE, E_INVALID_INITIAL_MESSAGE_VALUE, E_INVALID_INITIAL_REGISTRY_VALUE, E_INVALID_INITIAL_RETRIEVABLE_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_MEDIA_READER, 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, ValidationException };
package/factories.cjs ADDED
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_exceptions = require("./exceptions-D5YrO9Vm.js");
3
+ exports.BaseException = require_exceptions.BaseException;
4
+ exports.createException = require_exceptions.createException;
package/factories.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Factory helpers for creating configured runtime values and exception classes.
3
+ *
4
+ * @module @nhtio/adk/factories
5
+ *
6
+ * @remarks
7
+ * Public factory surface for the ADK. A "factory" here means a function that produces a
8
+ * configured runtime value — typically a class or a class instance — rather than a value
9
+ * primitive. The ADK's data primitives (value classes plus their `Raw*` companion types)
10
+ * live in `@nhtio/adk/common`; the ADK's exception classes that are part of the core
11
+ * contract live in `@nhtio/adk/exceptions`. This barrel hosts the factory helpers that
12
+ * downstream consumers (including in-tree batteries) use to mint their own configured
13
+ * runtime values.
14
+ *
15
+ * Today the only factory exposed here is {@link @nhtio/adk/factories!createException}, which mints a named
16
+ * {@link @nhtio/adk!BaseException} subclass with a fixed printf-style message template, error code,
17
+ * HTTP status, and fatality flag. The `BaseException` class itself is re-exported so
18
+ * consumers writing patterns the factory does not cover (e.g. richer constructor signatures
19
+ * carrying structured context payloads) can extend it directly.
20
+ *
21
+ * Battery-scoped exceptions belong in their own battery's barrel — `createException`
22
+ * imported from here is what battery code calls to mint them. The ADK's core exception
23
+ * module (`@nhtio/adk/exceptions`) does not grow a new symbol every time a battery is added.
24
+ *
25
+ * Future factories (middleware factories, helper-builder factories, etc.) will be added
26
+ * here as they appear.
27
+ */
28
+ /**
29
+ * @primaryExport
30
+ */
31
+ export { createException } from "./lib/utils/exceptions";
32
+ /**
33
+ * @primaryExport
34
+ */
35
+ export { BaseException } from "./lib/classes/base_exception";
36
+ /**
37
+ * @primaryExport
38
+ */
39
+ export type { ExceptionOptions, CreatedException } from "./lib/utils/exceptions";
package/factories.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { o as BaseException, t as createException } from "./exceptions-NrzIHw_R.mjs";
2
+ export { BaseException, createException };
package/forge.cjs ADDED
@@ -0,0 +1,9 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tool_registry = require("./tool_registry-Dkfprsck.js");
3
+ const require_tool_call = require("./tool_call-DFgzcVcU.js");
4
+ const require_tool = require("./tool-COSeH8I6.js");
5
+ const require_spooled_artifact = require("./spooled_artifact-Cm9Te22K.js");
6
+ exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
7
+ exports.Tool = require_tool.Tool;
8
+ exports.ToolCall = require_tool_call.ToolCall;
9
+ exports.ToolRegistry = require_tool_registry.ToolRegistry;
package/forge.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Schema-first tool construction, invocation records, artifact tools, and registries.
3
+ *
4
+ * @module @nhtio/adk/forge
5
+ *
6
+ * @remarks
7
+ * The forge — where tools are made. Schema-first primitives consumers compose into a working
8
+ * tool surface: {@link @nhtio/adk!Tool} (the standard tool definition), {@link @nhtio/adk!ArtifactTool} (the
9
+ * artifact-bound variant for custom spooled-artifact query tools), {@link @nhtio/adk!ToolCall} (the
10
+ * persisted record of an invocation), and {@link @nhtio/adk!ToolRegistry} (the collection of tools
11
+ * available within a turn). These are almost always used together — a runner registers tools,
12
+ * the model emits tool calls, the executor invokes them via the registry, and the resulting
13
+ * record is persisted as a `ToolCall`.
14
+ *
15
+ * Pairs with `@nhtio/adk/batteries/tools`, which ships ready-made tool *instances* built with
16
+ * this forge. The forge defines what a tool is; the batteries provide tools already made.
17
+ */
18
+ /**
19
+ * @primaryExport
20
+ */
21
+ export { Tool } from "./lib/classes/tool";
22
+ /**
23
+ * @primaryExport
24
+ */
25
+ export type { RawTool, ToolHandler } from "./lib/classes/tool";
26
+ /**
27
+ * @primaryExport
28
+ */
29
+ export type { SpooledArtifactConstructor } from "./lib/classes/spooled_artifact";
30
+ /**
31
+ * @primaryExport
32
+ */
33
+ export { ArtifactTool } from "./lib/classes/artifact_tool";
34
+ /**
35
+ * @primaryExport
36
+ */
37
+ export type { RawArtifactTool, ArtifactToolHandler } from "./lib/classes/artifact_tool";
38
+ /**
39
+ * @primaryExport
40
+ */
41
+ export { ToolCall } from "./lib/classes/tool_call";
42
+ /**
43
+ * @primaryExport
44
+ */
45
+ export type { RawToolCall } from "./lib/classes/tool_call";
46
+ /**
47
+ * @primaryExport
48
+ */
49
+ export { ToolRegistry } from "./lib/classes/tool_registry";
package/forge.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import { t as ToolRegistry } from "./tool_registry-DqLOyGyG.mjs";
2
+ import { t as ToolCall } from "./tool_call-BKyyxGaZ.mjs";
3
+ import { t as Tool } from "./tool-D2WB1EA1.mjs";
4
+ import { i as ArtifactTool } from "./spooled_artifact-C5ZtGxuJ.mjs";
5
+ export { ArtifactTool, Tool, ToolCall, ToolRegistry };
package/guards.cjs ADDED
@@ -0,0 +1,96 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_exceptions = require("./exceptions-D5YrO9Vm.js");
3
+ const require_tool_registry = require("./tool_registry-Dkfprsck.js");
4
+ const require_thought = require("./thought-DuN2PgdO.js");
5
+ const require_tool_call = require("./tool_call-DFgzcVcU.js");
6
+ const require_tool = require("./tool-COSeH8I6.js");
7
+ const require_spooled_artifact = require("./spooled_artifact-Cm9Te22K.js");
8
+ const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-RRB113sy.js");
9
+ const require_dispatch_runner = require("./dispatch_runner-CsoH0nld.js");
10
+ const require_turn_runner = require("./turn_runner-CMm2BHdX.js");
11
+ //#region src/guards.ts
12
+ /**
13
+ * Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.
14
+ *
15
+ * @module @nhtio/adk/guards
16
+ *
17
+ * @remarks
18
+ * Type guards for every value-bearing primitive in the ADK. Each `is*` function is a
19
+ * freestanding TypeScript type predicate (returns `value is X`) that delegates to the
20
+ * cross-realm-safe {@link @nhtio/adk!isInstanceOf} helper.
21
+ *
22
+ * For internal primitives that are not exported as runtime classes (`BaseException`,
23
+ * `TurnContext`, `DispatchContext`), the freestanding guard here is the canonical runtime
24
+ * detection. For user-constructable classes (`Memory`, `Tool`, etc.) these freestanding guards
25
+ * complement the static `ClassName.isClassName(value)` methods already on each class.
26
+ */
27
+ /** Returns `true` if `value` is a {@link @nhtio/adk!BaseException} instance. */
28
+ var isBaseException = (value) => require_exceptions.BaseException.isBaseException(value);
29
+ /** Returns `true` if `value` is an {@link @nhtio/adk!Identity} instance. */
30
+ var isIdentity = (value) => require_thought.Identity.isIdentity(value);
31
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Memory} instance. */
32
+ var isMemory = (value) => require_thought.Memory.isMemory(value);
33
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Message} instance. */
34
+ var isMessage = (value) => require_thought.Message.isMessage(value);
35
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Registry} instance. */
36
+ var isRegistry = (value) => require_tool_registry.Registry.isRegistry(value);
37
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Thought} instance. */
38
+ var isThought = (value) => require_thought.Thought.isThought(value);
39
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tokenizable} instance. */
40
+ var isTokenizable = (value) => require_tool_registry.Tokenizable.isTokenizable(value);
41
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tool} instance. */
42
+ var isTool = (value) => require_tool.Tool.isTool(value);
43
+ /** Returns `true` if `value` is an {@link @nhtio/adk!ArtifactTool} instance. */
44
+ var isArtifactTool = (value) => require_spooled_artifact.ArtifactTool.isArtifactTool(value);
45
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolCall} instance. */
46
+ var isToolCall = (value) => require_tool_call.ToolCall.isToolCall(value);
47
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolRegistry} instance. */
48
+ var isToolRegistry = (value) => require_tool_registry.ToolRegistry.isToolRegistry(value);
49
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnGate} instance. */
50
+ var isTurnGate = (value) => require_turn_runner.TurnGate.isTurnGate(value);
51
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledArtifact} instance. */
52
+ var isSpooledArtifact = (value) => require_spooled_artifact.SpooledArtifact.isSpooledArtifact(value);
53
+ /**
54
+ * Returns `true` if `value` is a constructor function for {@link @nhtio/adk!SpooledArtifact} or any of
55
+ * its subclasses (including `SpooledArtifact` itself).
56
+ */
57
+ var isSpooledArtifactConstructor = (value) => require_spooled_artifact.SpooledArtifact.isSpooledArtifactConstructor(value);
58
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledJsonArtifact} instance. */
59
+ var isSpooledJsonArtifact = (value) => require_spooled_markdown_artifact.SpooledJsonArtifact.isSpooledJsonArtifact(value);
60
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledMarkdownArtifact} instance. */
61
+ var isSpooledMarkdownArtifact = (value) => require_spooled_markdown_artifact.SpooledMarkdownArtifact.isSpooledMarkdownArtifact(value);
62
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnContext} instance. */
63
+ var isTurnContext = (value) => require_dispatch_runner.TurnContext.isTurnContext(value);
64
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnRunner} instance. */
65
+ var isTurnRunner = (value) => require_turn_runner.TurnRunner.isTurnRunner(value);
66
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchContext} instance. */
67
+ var isDispatchContext = (value) => require_dispatch_runner.DispatchContext.isDispatchContext(value);
68
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchRunner} instance. */
69
+ var isDispatchRunner = (value) => require_dispatch_runner.DispatchRunner.isDispatchRunner(value);
70
+ //#endregion
71
+ exports.implementsSpoolReader = require_spooled_artifact.implementsSpoolReader;
72
+ exports.isArtifactTool = isArtifactTool;
73
+ exports.isBaseException = isBaseException;
74
+ exports.isDispatchContext = isDispatchContext;
75
+ exports.isDispatchRunner = isDispatchRunner;
76
+ exports.isError = require_tool_registry.isError;
77
+ exports.isIdentity = isIdentity;
78
+ exports.isInstanceOf = require_tool_registry.isInstanceOf;
79
+ exports.isMemory = isMemory;
80
+ exports.isMessage = isMessage;
81
+ exports.isObject = require_tool_registry.isObject;
82
+ exports.isRegistry = isRegistry;
83
+ exports.isSpooledArtifact = isSpooledArtifact;
84
+ exports.isSpooledArtifactConstructor = isSpooledArtifactConstructor;
85
+ exports.isSpooledJsonArtifact = isSpooledJsonArtifact;
86
+ exports.isSpooledMarkdownArtifact = isSpooledMarkdownArtifact;
87
+ exports.isThought = isThought;
88
+ exports.isTokenizable = isTokenizable;
89
+ exports.isTool = isTool;
90
+ exports.isToolCall = isToolCall;
91
+ exports.isToolRegistry = isToolRegistry;
92
+ exports.isTurnContext = isTurnContext;
93
+ exports.isTurnGate = isTurnGate;
94
+ exports.isTurnRunner = isTurnRunner;
95
+
96
+ //# sourceMappingURL=guards.cjs.map
package/guards.cjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.cjs","names":[],"sources":["../src/guards.ts"],"sourcesContent":["/**\n * Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.\n *\n * @module @nhtio/adk/guards\n *\n * @remarks\n * Type guards for every value-bearing primitive in the ADK. Each `is*` function is a\n * freestanding TypeScript type predicate (returns `value is X`) that delegates to the\n * cross-realm-safe {@link @nhtio/adk!isInstanceOf} helper.\n *\n * For internal primitives that are not exported as runtime classes (`BaseException`,\n * `TurnContext`, `DispatchContext`), the freestanding guard here is the canonical runtime\n * detection. For user-constructable classes (`Memory`, `Tool`, etc.) these freestanding guards\n * complement the static `ClassName.isClassName(value)` methods already on each class.\n */\n\nimport { Tool } from './lib/classes/tool'\nimport { Memory } from './lib/classes/memory'\nimport { TurnRunner } from './lib/turn_runner'\nimport { Message } from './lib/classes/message'\nimport { Thought } from './lib/classes/thought'\nimport { Registry } from './lib/classes/registry'\nimport { Identity } from './lib/classes/identity'\nimport { TurnGate } from './lib/classes/turn_gate'\nimport { ToolCall } from './lib/classes/tool_call'\nimport { DispatchRunner } from './lib/dispatch_runner'\nimport { Tokenizable } from './lib/classes/tokenizable'\nimport { ArtifactTool } from './lib/classes/artifact_tool'\nimport { ToolRegistry } from './lib/classes/tool_registry'\nimport { BaseException } from './lib/classes/base_exception'\nimport { SpooledArtifact } from './lib/classes/spooled_artifact'\nimport { TurnContext } from './lib/contracts/turn_runner_context'\nimport { DispatchContext } from './lib/contracts/dispatch_context'\nimport { SpooledJsonArtifact } from './lib/classes/spooled_json_artifact'\nimport { SpooledMarkdownArtifact } from './lib/classes/spooled_markdown_artifact'\nimport type { SpooledArtifactConstructor } from './lib/classes/spooled_artifact'\n\n/**\n * @primaryExport\n */\nexport { isInstanceOf, isError, isObject } from './lib/utils/guards'\nexport { implementsSpoolReader } from './lib/contracts/spool_reader'\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!BaseException} instance. */\nexport const isBaseException = (value: unknown): value is BaseException =>\n BaseException.isBaseException(value)\n\n/** Returns `true` if `value` is an {@link @nhtio/adk!Identity} instance. */\nexport const isIdentity = (value: unknown): value is Identity => Identity.isIdentity(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Memory} instance. */\nexport const isMemory = (value: unknown): value is Memory => Memory.isMemory(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Message} instance. */\nexport const isMessage = (value: unknown): value is Message => Message.isMessage(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Registry} instance. */\nexport const isRegistry = (value: unknown): value is Registry => Registry.isRegistry(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Thought} instance. */\nexport const isThought = (value: unknown): value is Thought => Thought.isThought(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Tokenizable} instance. */\nexport const isTokenizable = (value: unknown): value is Tokenizable =>\n Tokenizable.isTokenizable(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Tool} instance. */\nexport const isTool = (value: unknown): value is Tool => Tool.isTool(value)\n\n/** Returns `true` if `value` is an {@link @nhtio/adk!ArtifactTool} instance. */\nexport const isArtifactTool = (value: unknown): value is ArtifactTool =>\n ArtifactTool.isArtifactTool(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!ToolCall} instance. */\nexport const isToolCall = (value: unknown): value is ToolCall => ToolCall.isToolCall(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!ToolRegistry} instance. */\nexport const isToolRegistry = (value: unknown): value is ToolRegistry =>\n ToolRegistry.isToolRegistry(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnGate} instance. */\nexport const isTurnGate = (value: unknown): value is TurnGate => TurnGate.isTurnGate(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledArtifact} instance. */\nexport const isSpooledArtifact = (value: unknown): value is SpooledArtifact =>\n SpooledArtifact.isSpooledArtifact(value)\n\n/**\n * Returns `true` if `value` is a constructor function for {@link @nhtio/adk!SpooledArtifact} or any of\n * its subclasses (including `SpooledArtifact` itself).\n */\nexport const isSpooledArtifactConstructor = (\n value: unknown\n): value is SpooledArtifactConstructor<SpooledArtifact> =>\n SpooledArtifact.isSpooledArtifactConstructor(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledJsonArtifact} instance. */\nexport const isSpooledJsonArtifact = (value: unknown): value is SpooledJsonArtifact =>\n SpooledJsonArtifact.isSpooledJsonArtifact(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledMarkdownArtifact} instance. */\nexport const isSpooledMarkdownArtifact = (value: unknown): value is SpooledMarkdownArtifact =>\n SpooledMarkdownArtifact.isSpooledMarkdownArtifact(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnContext} instance. */\nexport const isTurnContext = (value: unknown): value is TurnContext =>\n TurnContext.isTurnContext(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnRunner} instance. */\nexport const isTurnRunner = (value: unknown): value is TurnRunner => TurnRunner.isTurnRunner(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!DispatchContext} instance. */\nexport const isDispatchContext = (value: unknown): value is DispatchContext =>\n DispatchContext.isDispatchContext(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!DispatchRunner} instance. */\nexport const isDispatchRunner = (value: unknown): value is DispatchRunner =>\n DispatchRunner.isDispatchRunner(value)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,mBAAmB,UAC9B,mBAAA,cAAc,gBAAgB,KAAK;;AAGrC,IAAa,cAAc,UAAsC,gBAAA,SAAS,WAAW,KAAK;;AAG1F,IAAa,YAAY,UAAoC,gBAAA,OAAO,SAAS,KAAK;;AAGlF,IAAa,aAAa,UAAqC,gBAAA,QAAQ,UAAU,KAAK;;AAGtF,IAAa,cAAc,UAAsC,sBAAA,SAAS,WAAW,KAAK;;AAG1F,IAAa,aAAa,UAAqC,gBAAA,QAAQ,UAAU,KAAK;;AAGtF,IAAa,iBAAiB,UAC5B,sBAAA,YAAY,cAAc,KAAK;;AAGjC,IAAa,UAAU,UAAkC,aAAA,KAAK,OAAO,KAAK;;AAG1E,IAAa,kBAAkB,UAC7B,yBAAA,aAAa,eAAe,KAAK;;AAGnC,IAAa,cAAc,UAAsC,kBAAA,SAAS,WAAW,KAAK;;AAG1F,IAAa,kBAAkB,UAC7B,sBAAA,aAAa,eAAe,KAAK;;AAGnC,IAAa,cAAc,UAAsC,oBAAA,SAAS,WAAW,KAAK;;AAG1F,IAAa,qBAAqB,UAChC,yBAAA,gBAAgB,kBAAkB,KAAK;;;;;AAMzC,IAAa,gCACX,UAEA,yBAAA,gBAAgB,6BAA6B,KAAK;;AAGpD,IAAa,yBAAyB,UACpC,kCAAA,oBAAoB,sBAAsB,KAAK;;AAGjD,IAAa,6BAA6B,UACxC,kCAAA,wBAAwB,0BAA0B,KAAK;;AAGzD,IAAa,iBAAiB,UAC5B,wBAAA,YAAY,cAAc,KAAK;;AAGjC,IAAa,gBAAgB,UAAwC,oBAAA,WAAW,aAAa,KAAK;;AAGlG,IAAa,qBAAqB,UAChC,wBAAA,gBAAgB,kBAAkB,KAAK;;AAGzC,IAAa,oBAAoB,UAC/B,wBAAA,eAAe,iBAAiB,KAAK"}
package/guards.d.ts ADDED
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.
3
+ *
4
+ * @module @nhtio/adk/guards
5
+ *
6
+ * @remarks
7
+ * Type guards for every value-bearing primitive in the ADK. Each `is*` function is a
8
+ * freestanding TypeScript type predicate (returns `value is X`) that delegates to the
9
+ * cross-realm-safe {@link @nhtio/adk!isInstanceOf} helper.
10
+ *
11
+ * For internal primitives that are not exported as runtime classes (`BaseException`,
12
+ * `TurnContext`, `DispatchContext`), the freestanding guard here is the canonical runtime
13
+ * detection. For user-constructable classes (`Memory`, `Tool`, etc.) these freestanding guards
14
+ * complement the static `ClassName.isClassName(value)` methods already on each class.
15
+ */
16
+ import { Tool } from "./lib/classes/tool";
17
+ import { Memory } from "./lib/classes/memory";
18
+ import { TurnRunner } from "./lib/turn_runner";
19
+ import { Message } from "./lib/classes/message";
20
+ import { Thought } from "./lib/classes/thought";
21
+ import { Registry } from "./lib/classes/registry";
22
+ import { Identity } from "./lib/classes/identity";
23
+ import { TurnGate } from "./lib/classes/turn_gate";
24
+ import { ToolCall } from "./lib/classes/tool_call";
25
+ import { DispatchRunner } from "./lib/dispatch_runner";
26
+ import { Tokenizable } from "./lib/classes/tokenizable";
27
+ import { ArtifactTool } from "./lib/classes/artifact_tool";
28
+ import { ToolRegistry } from "./lib/classes/tool_registry";
29
+ import { BaseException } from "./lib/classes/base_exception";
30
+ import { SpooledArtifact } from "./lib/classes/spooled_artifact";
31
+ import { TurnContext } from "./lib/contracts/turn_runner_context";
32
+ import { DispatchContext } from "./lib/contracts/dispatch_context";
33
+ import { SpooledJsonArtifact } from "./lib/classes/spooled_json_artifact";
34
+ import { SpooledMarkdownArtifact } from "./lib/classes/spooled_markdown_artifact";
35
+ import type { SpooledArtifactConstructor } from "./lib/classes/spooled_artifact";
36
+ /**
37
+ * @primaryExport
38
+ */
39
+ export { isInstanceOf, isError, isObject } from "./lib/utils/guards";
40
+ export { implementsSpoolReader } from "./lib/contracts/spool_reader";
41
+ /** Returns `true` if `value` is a {@link @nhtio/adk!BaseException} instance. */
42
+ export declare const isBaseException: (value: unknown) => value is BaseException;
43
+ /** Returns `true` if `value` is an {@link @nhtio/adk!Identity} instance. */
44
+ export declare const isIdentity: (value: unknown) => value is Identity;
45
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Memory} instance. */
46
+ export declare const isMemory: (value: unknown) => value is Memory;
47
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Message} instance. */
48
+ export declare const isMessage: (value: unknown) => value is Message;
49
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Registry} instance. */
50
+ export declare const isRegistry: (value: unknown) => value is Registry;
51
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Thought} instance. */
52
+ export declare const isThought: (value: unknown) => value is Thought;
53
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tokenizable} instance. */
54
+ export declare const isTokenizable: (value: unknown) => value is Tokenizable;
55
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tool} instance. */
56
+ export declare const isTool: (value: unknown) => value is Tool;
57
+ /** Returns `true` if `value` is an {@link @nhtio/adk!ArtifactTool} instance. */
58
+ export declare const isArtifactTool: (value: unknown) => value is ArtifactTool;
59
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolCall} instance. */
60
+ export declare const isToolCall: (value: unknown) => value is ToolCall;
61
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolRegistry} instance. */
62
+ export declare const isToolRegistry: (value: unknown) => value is ToolRegistry;
63
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnGate} instance. */
64
+ export declare const isTurnGate: (value: unknown) => value is TurnGate;
65
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledArtifact} instance. */
66
+ export declare const isSpooledArtifact: (value: unknown) => value is SpooledArtifact;
67
+ /**
68
+ * Returns `true` if `value` is a constructor function for {@link @nhtio/adk!SpooledArtifact} or any of
69
+ * its subclasses (including `SpooledArtifact` itself).
70
+ */
71
+ export declare const isSpooledArtifactConstructor: (value: unknown) => value is SpooledArtifactConstructor<SpooledArtifact>;
72
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledJsonArtifact} instance. */
73
+ export declare const isSpooledJsonArtifact: (value: unknown) => value is SpooledJsonArtifact;
74
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledMarkdownArtifact} instance. */
75
+ export declare const isSpooledMarkdownArtifact: (value: unknown) => value is SpooledMarkdownArtifact;
76
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnContext} instance. */
77
+ export declare const isTurnContext: (value: unknown) => value is TurnContext;
78
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnRunner} instance. */
79
+ export declare const isTurnRunner: (value: unknown) => value is TurnRunner;
80
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchContext} instance. */
81
+ export declare const isDispatchContext: (value: unknown) => value is DispatchContext;
82
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchRunner} instance. */
83
+ export declare const isDispatchRunner: (value: unknown) => value is DispatchRunner;
package/guards.mjs ADDED
@@ -0,0 +1,72 @@
1
+ import { o as BaseException } from "./exceptions-NrzIHw_R.mjs";
2
+ import { a as Tokenizable, c as isObject, o as isError, r as Registry, s as isInstanceOf, t as ToolRegistry } from "./tool_registry-DqLOyGyG.mjs";
3
+ import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-CDb457b4.mjs";
4
+ import { t as ToolCall } from "./tool_call-BKyyxGaZ.mjs";
5
+ import { t as Tool } from "./tool-D2WB1EA1.mjs";
6
+ import { i as ArtifactTool, r as implementsSpoolReader, t as SpooledArtifact } from "./spooled_artifact-C5ZtGxuJ.mjs";
7
+ import { n as SpooledJsonArtifact, t as SpooledMarkdownArtifact } from "./spooled_markdown_artifact-BpUJol0W.mjs";
8
+ import { n as DispatchContext, r as TurnContext, t as DispatchRunner } from "./dispatch_runner-9j6bXHL3.mjs";
9
+ import { n as TurnGate, t as TurnRunner } from "./turn_runner-y7eyEcJH.mjs";
10
+ //#region src/guards.ts
11
+ /**
12
+ * Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.
13
+ *
14
+ * @module @nhtio/adk/guards
15
+ *
16
+ * @remarks
17
+ * Type guards for every value-bearing primitive in the ADK. Each `is*` function is a
18
+ * freestanding TypeScript type predicate (returns `value is X`) that delegates to the
19
+ * cross-realm-safe {@link @nhtio/adk!isInstanceOf} helper.
20
+ *
21
+ * For internal primitives that are not exported as runtime classes (`BaseException`,
22
+ * `TurnContext`, `DispatchContext`), the freestanding guard here is the canonical runtime
23
+ * detection. For user-constructable classes (`Memory`, `Tool`, etc.) these freestanding guards
24
+ * complement the static `ClassName.isClassName(value)` methods already on each class.
25
+ */
26
+ /** Returns `true` if `value` is a {@link @nhtio/adk!BaseException} instance. */
27
+ var isBaseException = (value) => BaseException.isBaseException(value);
28
+ /** Returns `true` if `value` is an {@link @nhtio/adk!Identity} instance. */
29
+ var isIdentity = (value) => Identity.isIdentity(value);
30
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Memory} instance. */
31
+ var isMemory = (value) => Memory.isMemory(value);
32
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Message} instance. */
33
+ var isMessage = (value) => Message.isMessage(value);
34
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Registry} instance. */
35
+ var isRegistry = (value) => Registry.isRegistry(value);
36
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Thought} instance. */
37
+ var isThought = (value) => Thought.isThought(value);
38
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tokenizable} instance. */
39
+ var isTokenizable = (value) => Tokenizable.isTokenizable(value);
40
+ /** Returns `true` if `value` is a {@link @nhtio/adk!Tool} instance. */
41
+ var isTool = (value) => Tool.isTool(value);
42
+ /** Returns `true` if `value` is an {@link @nhtio/adk!ArtifactTool} instance. */
43
+ var isArtifactTool = (value) => ArtifactTool.isArtifactTool(value);
44
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolCall} instance. */
45
+ var isToolCall = (value) => ToolCall.isToolCall(value);
46
+ /** Returns `true` if `value` is a {@link @nhtio/adk!ToolRegistry} instance. */
47
+ var isToolRegistry = (value) => ToolRegistry.isToolRegistry(value);
48
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnGate} instance. */
49
+ var isTurnGate = (value) => TurnGate.isTurnGate(value);
50
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledArtifact} instance. */
51
+ var isSpooledArtifact = (value) => SpooledArtifact.isSpooledArtifact(value);
52
+ /**
53
+ * Returns `true` if `value` is a constructor function for {@link @nhtio/adk!SpooledArtifact} or any of
54
+ * its subclasses (including `SpooledArtifact` itself).
55
+ */
56
+ var isSpooledArtifactConstructor = (value) => SpooledArtifact.isSpooledArtifactConstructor(value);
57
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledJsonArtifact} instance. */
58
+ var isSpooledJsonArtifact = (value) => SpooledJsonArtifact.isSpooledJsonArtifact(value);
59
+ /** Returns `true` if `value` is a {@link @nhtio/adk!SpooledMarkdownArtifact} instance. */
60
+ var isSpooledMarkdownArtifact = (value) => SpooledMarkdownArtifact.isSpooledMarkdownArtifact(value);
61
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnContext} instance. */
62
+ var isTurnContext = (value) => TurnContext.isTurnContext(value);
63
+ /** Returns `true` if `value` is a {@link @nhtio/adk!TurnRunner} instance. */
64
+ var isTurnRunner = (value) => TurnRunner.isTurnRunner(value);
65
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchContext} instance. */
66
+ var isDispatchContext = (value) => DispatchContext.isDispatchContext(value);
67
+ /** Returns `true` if `value` is a {@link @nhtio/adk!DispatchRunner} instance. */
68
+ var isDispatchRunner = (value) => DispatchRunner.isDispatchRunner(value);
69
+ //#endregion
70
+ export { implementsSpoolReader, isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isError, isIdentity, isInstanceOf, isMemory, isMessage, isObject, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner };
71
+
72
+ //# sourceMappingURL=guards.mjs.map
package/guards.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.mjs","names":[],"sources":["../src/guards.ts"],"sourcesContent":["/**\n * Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.\n *\n * @module @nhtio/adk/guards\n *\n * @remarks\n * Type guards for every value-bearing primitive in the ADK. Each `is*` function is a\n * freestanding TypeScript type predicate (returns `value is X`) that delegates to the\n * cross-realm-safe {@link @nhtio/adk!isInstanceOf} helper.\n *\n * For internal primitives that are not exported as runtime classes (`BaseException`,\n * `TurnContext`, `DispatchContext`), the freestanding guard here is the canonical runtime\n * detection. For user-constructable classes (`Memory`, `Tool`, etc.) these freestanding guards\n * complement the static `ClassName.isClassName(value)` methods already on each class.\n */\n\nimport { Tool } from './lib/classes/tool'\nimport { Memory } from './lib/classes/memory'\nimport { TurnRunner } from './lib/turn_runner'\nimport { Message } from './lib/classes/message'\nimport { Thought } from './lib/classes/thought'\nimport { Registry } from './lib/classes/registry'\nimport { Identity } from './lib/classes/identity'\nimport { TurnGate } from './lib/classes/turn_gate'\nimport { ToolCall } from './lib/classes/tool_call'\nimport { DispatchRunner } from './lib/dispatch_runner'\nimport { Tokenizable } from './lib/classes/tokenizable'\nimport { ArtifactTool } from './lib/classes/artifact_tool'\nimport { ToolRegistry } from './lib/classes/tool_registry'\nimport { BaseException } from './lib/classes/base_exception'\nimport { SpooledArtifact } from './lib/classes/spooled_artifact'\nimport { TurnContext } from './lib/contracts/turn_runner_context'\nimport { DispatchContext } from './lib/contracts/dispatch_context'\nimport { SpooledJsonArtifact } from './lib/classes/spooled_json_artifact'\nimport { SpooledMarkdownArtifact } from './lib/classes/spooled_markdown_artifact'\nimport type { SpooledArtifactConstructor } from './lib/classes/spooled_artifact'\n\n/**\n * @primaryExport\n */\nexport { isInstanceOf, isError, isObject } from './lib/utils/guards'\nexport { implementsSpoolReader } from './lib/contracts/spool_reader'\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!BaseException} instance. */\nexport const isBaseException = (value: unknown): value is BaseException =>\n BaseException.isBaseException(value)\n\n/** Returns `true` if `value` is an {@link @nhtio/adk!Identity} instance. */\nexport const isIdentity = (value: unknown): value is Identity => Identity.isIdentity(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Memory} instance. */\nexport const isMemory = (value: unknown): value is Memory => Memory.isMemory(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Message} instance. */\nexport const isMessage = (value: unknown): value is Message => Message.isMessage(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Registry} instance. */\nexport const isRegistry = (value: unknown): value is Registry => Registry.isRegistry(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Thought} instance. */\nexport const isThought = (value: unknown): value is Thought => Thought.isThought(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Tokenizable} instance. */\nexport const isTokenizable = (value: unknown): value is Tokenizable =>\n Tokenizable.isTokenizable(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!Tool} instance. */\nexport const isTool = (value: unknown): value is Tool => Tool.isTool(value)\n\n/** Returns `true` if `value` is an {@link @nhtio/adk!ArtifactTool} instance. */\nexport const isArtifactTool = (value: unknown): value is ArtifactTool =>\n ArtifactTool.isArtifactTool(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!ToolCall} instance. */\nexport const isToolCall = (value: unknown): value is ToolCall => ToolCall.isToolCall(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!ToolRegistry} instance. */\nexport const isToolRegistry = (value: unknown): value is ToolRegistry =>\n ToolRegistry.isToolRegistry(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnGate} instance. */\nexport const isTurnGate = (value: unknown): value is TurnGate => TurnGate.isTurnGate(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledArtifact} instance. */\nexport const isSpooledArtifact = (value: unknown): value is SpooledArtifact =>\n SpooledArtifact.isSpooledArtifact(value)\n\n/**\n * Returns `true` if `value` is a constructor function for {@link @nhtio/adk!SpooledArtifact} or any of\n * its subclasses (including `SpooledArtifact` itself).\n */\nexport const isSpooledArtifactConstructor = (\n value: unknown\n): value is SpooledArtifactConstructor<SpooledArtifact> =>\n SpooledArtifact.isSpooledArtifactConstructor(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledJsonArtifact} instance. */\nexport const isSpooledJsonArtifact = (value: unknown): value is SpooledJsonArtifact =>\n SpooledJsonArtifact.isSpooledJsonArtifact(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!SpooledMarkdownArtifact} instance. */\nexport const isSpooledMarkdownArtifact = (value: unknown): value is SpooledMarkdownArtifact =>\n SpooledMarkdownArtifact.isSpooledMarkdownArtifact(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnContext} instance. */\nexport const isTurnContext = (value: unknown): value is TurnContext =>\n TurnContext.isTurnContext(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!TurnRunner} instance. */\nexport const isTurnRunner = (value: unknown): value is TurnRunner => TurnRunner.isTurnRunner(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!DispatchContext} instance. */\nexport const isDispatchContext = (value: unknown): value is DispatchContext =>\n DispatchContext.isDispatchContext(value)\n\n/** Returns `true` if `value` is a {@link @nhtio/adk!DispatchRunner} instance. */\nexport const isDispatchRunner = (value: unknown): value is DispatchRunner =>\n DispatchRunner.isDispatchRunner(value)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,mBAAmB,UAC9B,cAAc,gBAAgB,KAAK;;AAGrC,IAAa,cAAc,UAAsC,SAAS,WAAW,KAAK;;AAG1F,IAAa,YAAY,UAAoC,OAAO,SAAS,KAAK;;AAGlF,IAAa,aAAa,UAAqC,QAAQ,UAAU,KAAK;;AAGtF,IAAa,cAAc,UAAsC,SAAS,WAAW,KAAK;;AAG1F,IAAa,aAAa,UAAqC,QAAQ,UAAU,KAAK;;AAGtF,IAAa,iBAAiB,UAC5B,YAAY,cAAc,KAAK;;AAGjC,IAAa,UAAU,UAAkC,KAAK,OAAO,KAAK;;AAG1E,IAAa,kBAAkB,UAC7B,aAAa,eAAe,KAAK;;AAGnC,IAAa,cAAc,UAAsC,SAAS,WAAW,KAAK;;AAG1F,IAAa,kBAAkB,UAC7B,aAAa,eAAe,KAAK;;AAGnC,IAAa,cAAc,UAAsC,SAAS,WAAW,KAAK;;AAG1F,IAAa,qBAAqB,UAChC,gBAAgB,kBAAkB,KAAK;;;;;AAMzC,IAAa,gCACX,UAEA,gBAAgB,6BAA6B,KAAK;;AAGpD,IAAa,yBAAyB,UACpC,oBAAoB,sBAAsB,KAAK;;AAGjD,IAAa,6BAA6B,UACxC,wBAAwB,0BAA0B,KAAK;;AAGzD,IAAa,iBAAiB,UAC5B,YAAY,cAAc,KAAK;;AAGjC,IAAa,gBAAgB,UAAwC,WAAW,aAAa,KAAK;;AAGlG,IAAa,qBAAqB,UAChC,gBAAgB,kBAAkB,KAAK;;AAGzC,IAAa,oBAAoB,UAC/B,eAAe,iBAAiB,KAAK"}
package/index.cjs ADDED
@@ -0,0 +1,107 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_exceptions = require("./exceptions-D5YrO9Vm.js");
3
+ const require_tool_registry = require("./tool_registry-Dkfprsck.js");
4
+ const require_runtime = require("./runtime-BJVkrGQe.js");
5
+ const require_thought = require("./thought-DuN2PgdO.js");
6
+ const require_common = require("./common-Od8edUXU.js");
7
+ const require_tool_call = require("./tool_call-DFgzcVcU.js");
8
+ const require_tool = require("./tool-COSeH8I6.js");
9
+ const require_spooled_artifact = require("./spooled_artifact-Cm9Te22K.js");
10
+ const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-RRB113sy.js");
11
+ const require_dispatch_runner = require("./dispatch_runner-CsoH0nld.js");
12
+ require("./dispatch_runner.cjs");
13
+ require("./exceptions.cjs");
14
+ const require_turn_runner = require("./turn_runner-CMm2BHdX.js");
15
+ const require_guards = require("./guards.cjs");
16
+ require("./turn_runner.cjs");
17
+ //#region src/index.ts
18
+ /**
19
+ * Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
20
+ *
21
+ * @module @nhtio/adk
22
+ */
23
+ /**
24
+ * The current version of the package.
25
+ *
26
+ * @tip This is a constant that is replaced during the build process with the actual version of the package.
27
+ */
28
+ var version = "0.1.0-master-f0aa531d";
29
+ //#endregion
30
+ exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
31
+ exports.DispatchRunner = require_dispatch_runner.DispatchRunner;
32
+ exports.E_DISPATCH_PIPELINE_ERROR = require_runtime.E_DISPATCH_PIPELINE_ERROR;
33
+ exports.E_INPUT_PIPELINE_ERROR = require_runtime.E_INPUT_PIPELINE_ERROR;
34
+ exports.E_INVALID_INITIAL_IDENTITY_VALUE = require_runtime.E_INVALID_INITIAL_IDENTITY_VALUE;
35
+ exports.E_INVALID_INITIAL_MEMORY_VALUE = require_runtime.E_INVALID_INITIAL_MEMORY_VALUE;
36
+ exports.E_INVALID_INITIAL_MESSAGE_VALUE = require_runtime.E_INVALID_INITIAL_MESSAGE_VALUE;
37
+ exports.E_INVALID_INITIAL_REGISTRY_VALUE = require_runtime.E_INVALID_INITIAL_REGISTRY_VALUE;
38
+ exports.E_INVALID_INITIAL_THOUGHT_VALUE = require_runtime.E_INVALID_INITIAL_THOUGHT_VALUE;
39
+ exports.E_INVALID_INITIAL_TOOL_CALL_VALUE = require_runtime.E_INVALID_INITIAL_TOOL_CALL_VALUE;
40
+ exports.E_INVALID_INITIAL_TOOL_VALUE = require_runtime.E_INVALID_INITIAL_TOOL_VALUE;
41
+ exports.E_INVALID_INITIAL_TURN_GATE_VALUE = require_runtime.E_INVALID_INITIAL_TURN_GATE_VALUE;
42
+ exports.E_INVALID_LLM_DISPATCH_INPUT = require_runtime.E_INVALID_LLM_DISPATCH_INPUT;
43
+ exports.E_INVALID_LLM_EXECUTION_CONTEXT = require_runtime.E_INVALID_LLM_EXECUTION_CONTEXT;
44
+ exports.E_INVALID_TOOL_ARGS = require_runtime.E_INVALID_TOOL_ARGS;
45
+ exports.E_INVALID_TURN_CONTEXT = require_runtime.E_INVALID_TURN_CONTEXT;
46
+ exports.E_INVALID_TURN_GATE_RESOLUTION = require_runtime.E_INVALID_TURN_GATE_RESOLUTION;
47
+ exports.E_INVALID_TURN_RUNNER_CONFIG = require_runtime.E_INVALID_TURN_RUNNER_CONFIG;
48
+ exports.E_LLM_EXECUTION_ALREADY_SIGNALLED = require_runtime.E_LLM_EXECUTION_ALREADY_SIGNALLED;
49
+ exports.E_LLM_EXECUTION_EXECUTOR_ERROR = require_runtime.E_LLM_EXECUTION_EXECUTOR_ERROR;
50
+ exports.E_LLM_EXECUTION_GATE_NOT_SUPPORTED = require_runtime.E_LLM_EXECUTION_GATE_NOT_SUPPORTED;
51
+ exports.E_NOT_A_SPOOL_READER = require_runtime.E_NOT_A_SPOOL_READER;
52
+ exports.E_OUTPUT_PIPELINE_ERROR = require_runtime.E_OUTPUT_PIPELINE_ERROR;
53
+ exports.E_PIPELINE_SHORT_CIRCUITED = require_runtime.E_PIPELINE_SHORT_CIRCUITED;
54
+ exports.E_TOOL_ALREADY_REGISTERED = require_runtime.E_TOOL_ALREADY_REGISTERED;
55
+ exports.E_TOOL_DOWNSTREAM_ERROR = require_runtime.E_TOOL_DOWNSTREAM_ERROR;
56
+ exports.E_TURN_GATE_ABORTED = require_runtime.E_TURN_GATE_ABORTED;
57
+ exports.E_TURN_GATE_TIMEOUT = require_runtime.E_TURN_GATE_TIMEOUT;
58
+ exports.Identity = require_thought.Identity;
59
+ exports.Media = require_tool_call.Media;
60
+ exports.Memory = require_thought.Memory;
61
+ exports.Message = require_thought.Message;
62
+ exports.Registry = require_tool_registry.Registry;
63
+ exports.Retrievable = require_common.Retrievable;
64
+ exports.SpooledArtifact = require_spooled_artifact.SpooledArtifact;
65
+ exports.SpooledJsonArtifact = require_spooled_markdown_artifact.SpooledJsonArtifact;
66
+ exports.SpooledMarkdownArtifact = require_spooled_markdown_artifact.SpooledMarkdownArtifact;
67
+ exports.Thought = require_thought.Thought;
68
+ exports.TokenEncoding = require_tool_registry.TokenEncoding;
69
+ exports.Tokenizable = require_tool_registry.Tokenizable;
70
+ exports.Tool = require_tool.Tool;
71
+ exports.ToolCall = require_tool_call.ToolCall;
72
+ exports.ToolRegistry = require_tool_registry.ToolRegistry;
73
+ exports.TurnRunner = require_turn_runner.TurnRunner;
74
+ exports.ValidationException = require_exceptions.ValidationException;
75
+ exports.fromFetch = require_common.fromFetch;
76
+ exports.fromWebFile = require_common.fromWebFile;
77
+ exports.implementsMediaReader = require_tool_call.implementsMediaReader;
78
+ exports.implementsSpoolReader = require_spooled_artifact.implementsSpoolReader;
79
+ exports.inMemoryMediaReader = require_common.inMemoryMediaReader;
80
+ exports.isArtifactTool = require_guards.isArtifactTool;
81
+ exports.isBaseException = require_guards.isBaseException;
82
+ exports.isDispatchContext = require_guards.isDispatchContext;
83
+ exports.isDispatchRunner = require_guards.isDispatchRunner;
84
+ exports.isError = require_tool_registry.isError;
85
+ exports.isIdentity = require_guards.isIdentity;
86
+ exports.isInstanceOf = require_tool_registry.isInstanceOf;
87
+ exports.isMedia = require_tool_call.isMedia;
88
+ exports.isMemory = require_guards.isMemory;
89
+ exports.isMessage = require_guards.isMessage;
90
+ exports.isObject = require_tool_registry.isObject;
91
+ exports.isRegistry = require_guards.isRegistry;
92
+ exports.isSpooledArtifact = require_guards.isSpooledArtifact;
93
+ exports.isSpooledArtifactConstructor = require_guards.isSpooledArtifactConstructor;
94
+ exports.isSpooledJsonArtifact = require_guards.isSpooledJsonArtifact;
95
+ exports.isSpooledMarkdownArtifact = require_guards.isSpooledMarkdownArtifact;
96
+ exports.isThought = require_guards.isThought;
97
+ exports.isTokenizable = require_guards.isTokenizable;
98
+ exports.isTool = require_guards.isTool;
99
+ exports.isToolCall = require_guards.isToolCall;
100
+ exports.isToolRegistry = require_guards.isToolRegistry;
101
+ exports.isTurnContext = require_guards.isTurnContext;
102
+ exports.isTurnGate = require_guards.isTurnGate;
103
+ exports.isTurnRunner = require_guards.isTurnRunner;
104
+ exports.mediaReaderSchema = require_tool_call.mediaReaderSchema;
105
+ exports.version = version;
106
+
107
+ //# sourceMappingURL=index.cjs.map
package/index.cjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.\n *\n * @module @nhtio/adk\n */\n\n/**\n * The current version of the package.\n *\n * @tip This is a constant that is replaced during the build process with the actual version of the package.\n */\nexport const version = __VERSION__\n\n// ── Data primitives (value classes + Raw* types) ──────────────────────────────\n\nexport {\n Tokenizable,\n TokenEncoding,\n Registry,\n Identity,\n Memory,\n Message,\n Retrievable,\n Thought,\n ToolCall,\n Tool,\n ArtifactTool,\n ToolRegistry,\n SpooledArtifact,\n SpooledJsonArtifact,\n SpooledMarkdownArtifact,\n implementsSpoolReader,\n Media,\n isMedia,\n implementsMediaReader,\n mediaReaderSchema,\n inMemoryMediaReader,\n fromFetch,\n fromWebFile,\n} from './common'\n\nexport type {\n RawMedia,\n SerializedMedia,\n MediaKind,\n MediaTrustTier,\n MediaModalityHazard,\n MediaStashEntry,\n MediaReader,\n} from './common'\n\n// ── Runners (the entry points for executing turns and dispatches) ─────────────\n\nexport { TurnRunner } from './turn_runner'\nexport { DispatchRunner } from './dispatch_runner'\n\n// ── Freestanding guards ───────────────────────────────────────────────────────\n\nexport {\n isInstanceOf,\n isError,\n isObject,\n isBaseException,\n isIdentity,\n isMemory,\n isMessage,\n isRegistry,\n isThought,\n isTokenizable,\n isTool,\n isArtifactTool,\n isToolCall,\n isToolRegistry,\n isTurnGate,\n isSpooledArtifact,\n isSpooledArtifactConstructor,\n isSpooledJsonArtifact,\n isSpooledMarkdownArtifact,\n isTurnContext,\n isTurnRunner,\n isDispatchContext,\n isDispatchRunner,\n} from './guards'\n\n// ── Exceptions ────────────────────────────────────────────────────────────────\n\nexport {\n ValidationException,\n E_INVALID_TURN_RUNNER_CONFIG,\n E_INVALID_TURN_CONTEXT,\n E_INPUT_PIPELINE_ERROR,\n E_OUTPUT_PIPELINE_ERROR,\n E_PIPELINE_SHORT_CIRCUITED,\n E_INVALID_INITIAL_REGISTRY_VALUE,\n E_INVALID_INITIAL_MEMORY_VALUE,\n E_INVALID_INITIAL_MESSAGE_VALUE,\n E_INVALID_INITIAL_IDENTITY_VALUE,\n E_INVALID_INITIAL_THOUGHT_VALUE,\n E_INVALID_INITIAL_TURN_GATE_VALUE,\n E_INVALID_TURN_GATE_RESOLUTION,\n E_TURN_GATE_TIMEOUT,\n E_TURN_GATE_ABORTED,\n E_NOT_A_SPOOL_READER,\n E_INVALID_INITIAL_TOOL_CALL_VALUE,\n E_INVALID_INITIAL_TOOL_VALUE,\n E_INVALID_TOOL_ARGS,\n E_TOOL_DOWNSTREAM_ERROR,\n E_TOOL_ALREADY_REGISTERED,\n E_INVALID_LLM_EXECUTION_CONTEXT,\n E_LLM_EXECUTION_GATE_NOT_SUPPORTED,\n E_LLM_EXECUTION_ALREADY_SIGNALLED,\n E_INVALID_LLM_DISPATCH_INPUT,\n E_DISPATCH_PIPELINE_ERROR,\n E_LLM_EXECUTION_EXECUTOR_ERROR,\n} from './exceptions'\n\n// ── Types (re-exported via `export type *` form) ──────────────────────────────\n\nexport type {\n BaseException,\n TurnContext,\n DispatchContext,\n TurnGate,\n RawIdentity,\n RawMemory,\n RawMessage,\n MessageRole,\n RawThought,\n RawToolCall,\n RawTool,\n ToolHandler,\n RawArtifactTool,\n ArtifactToolHandler,\n MergeOptions,\n SpooledArtifactConstructor,\n ToolMethodDescriptor,\n RawTurnGate,\n SpoolReader,\n JsonArtifactFormat,\n MarkdownHeadingEntry,\n MarkdownCodeEntry,\n MarkdownSection,\n RawTurnContext,\n ResolvedTurnContext,\n MemoryRetrievalFn,\n MessageRetrievalFn,\n ThoughtRetrievalFn,\n ToolCallRetrievalFn,\n ToolsRetrievalFn,\n RetrievableRetrievalFn,\n StandingInstructionsRefreshFn,\n StandingInstructionStoreFn,\n StandingInstructionMutateFn,\n StandingInstructionDeleteFn,\n MemoryStoreFn,\n MemoryMutateFn,\n MemoryDeleteFn,\n MessageStoreFn,\n MessageMutateFn,\n MessageDeleteFn,\n ThoughtStoreFn,\n ThoughtMutateFn,\n ThoughtDeleteFn,\n ToolCallStoreFn,\n ToolCallMutateFn,\n ToolCallDeleteFn,\n RetrievableStoreFn,\n RetrievableMutateFn,\n RetrievableDeleteFn,\n TurnRunnerConfig,\n ResolvedTurnRunnerConfig,\n TurnPipelineMiddlewareFn,\n TurnStreamableContent,\n TurnToolCallContent,\n TurnStartEvent,\n TurnEndEvent,\n TurnGateClosedEvent,\n ToolExecutionStartEvent,\n ToolExecutionEndEvent,\n EmitMessageFn,\n EmitThoughtFn,\n EmitToolCallFn,\n EmitToolExecutionStartFn,\n EmitToolExecutionEndFn,\n OpenGateFn,\n TurnEvents,\n TurnEvent,\n TurnEventListener,\n TurnObservabilityEvents,\n TurnObservabilityEvent,\n TurnObservabilityEventListener,\n RawDispatchContext,\n DispatchMemoryRetrievalFn,\n DispatchMessageRetrievalFn,\n DispatchThoughtRetrievalFn,\n DispatchToolCallRetrievalFn,\n DispatchToolsRetrievalFn,\n DispatchStandingInstructionsRefreshFn,\n DispatchStandingInstructionStoreFn,\n DispatchStandingInstructionMutateFn,\n DispatchStandingInstructionDeleteFn,\n DispatchMemoryStoreFn,\n DispatchMemoryMutateFn,\n DispatchMemoryDeleteFn,\n DispatchMessageStoreFn,\n DispatchMessageMutateFn,\n DispatchMessageDeleteFn,\n DispatchThoughtStoreFn,\n DispatchThoughtMutateFn,\n DispatchThoughtDeleteFn,\n DispatchToolCallStoreFn,\n DispatchToolCallMutateFn,\n DispatchToolCallDeleteFn,\n DispatchContextHooks,\n DispatchContextHookRegistrations,\n RawDispatchRunnerInput,\n DispatchPipelineMiddlewareFn,\n DispatchExecutorFn,\n DispatchExecutorHelpers,\n DispatchExecutorLogChannel,\n DispatchExecutorLogEntry,\n DispatchExecutorLogLevel,\n LogEvent,\n DispatchStartEvent,\n DispatchEndEvent,\n IterationStartEvent,\n IterationEndEvent,\n DispatchRunnerFunctionalHooks,\n DispatchRunnerObservabilityHooks,\n DispatchRunnerFunctionalHookRegistrations,\n DispatchRunnerObservabilityHookRegistrations,\n} from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,UAAA"}
package/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
3
+ *
4
+ * @module @nhtio/adk
5
+ */
6
+ /**
7
+ * The current version of the package.
8
+ *
9
+ * @tip This is a constant that is replaced during the build process with the actual version of the package.
10
+ */
11
+ export declare const version: string;
12
+ export { Tokenizable, TokenEncoding, Registry, Identity, Memory, Message, Retrievable, Thought, ToolCall, Tool, ArtifactTool, ToolRegistry, SpooledArtifact, SpooledJsonArtifact, SpooledMarkdownArtifact, implementsSpoolReader, Media, isMedia, implementsMediaReader, mediaReaderSchema, inMemoryMediaReader, fromFetch, fromWebFile, } from "./common";
13
+ export type { RawMedia, SerializedMedia, MediaKind, MediaTrustTier, MediaModalityHazard, MediaStashEntry, MediaReader, } from "./common";
14
+ export { TurnRunner } from "./turn_runner";
15
+ export { DispatchRunner } from "./dispatch_runner";
16
+ export { isInstanceOf, isError, isObject, isBaseException, isIdentity, isMemory, isMessage, isRegistry, isThought, isTokenizable, isTool, isArtifactTool, isToolCall, isToolRegistry, isTurnGate, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isTurnContext, isTurnRunner, isDispatchContext, isDispatchRunner, } from "./guards";
17
+ export { ValidationException, E_INVALID_TURN_RUNNER_CONFIG, E_INVALID_TURN_CONTEXT, E_INPUT_PIPELINE_ERROR, E_OUTPUT_PIPELINE_ERROR, E_PIPELINE_SHORT_CIRCUITED, E_INVALID_INITIAL_REGISTRY_VALUE, E_INVALID_INITIAL_MEMORY_VALUE, E_INVALID_INITIAL_MESSAGE_VALUE, E_INVALID_INITIAL_IDENTITY_VALUE, E_INVALID_INITIAL_THOUGHT_VALUE, E_INVALID_INITIAL_TURN_GATE_VALUE, E_INVALID_TURN_GATE_RESOLUTION, E_TURN_GATE_TIMEOUT, E_TURN_GATE_ABORTED, E_NOT_A_SPOOL_READER, E_INVALID_INITIAL_TOOL_CALL_VALUE, E_INVALID_INITIAL_TOOL_VALUE, E_INVALID_TOOL_ARGS, E_TOOL_DOWNSTREAM_ERROR, E_TOOL_ALREADY_REGISTERED, E_INVALID_LLM_EXECUTION_CONTEXT, E_LLM_EXECUTION_GATE_NOT_SUPPORTED, E_LLM_EXECUTION_ALREADY_SIGNALLED, E_INVALID_LLM_DISPATCH_INPUT, E_DISPATCH_PIPELINE_ERROR, E_LLM_EXECUTION_EXECUTOR_ERROR, } from "./exceptions";
18
+ export type { BaseException, TurnContext, DispatchContext, TurnGate, RawIdentity, RawMemory, RawMessage, MessageRole, RawThought, RawToolCall, RawTool, ToolHandler, RawArtifactTool, ArtifactToolHandler, MergeOptions, SpooledArtifactConstructor, ToolMethodDescriptor, RawTurnGate, SpoolReader, JsonArtifactFormat, MarkdownHeadingEntry, MarkdownCodeEntry, MarkdownSection, RawTurnContext, ResolvedTurnContext, MemoryRetrievalFn, MessageRetrievalFn, ThoughtRetrievalFn, ToolCallRetrievalFn, ToolsRetrievalFn, RetrievableRetrievalFn, StandingInstructionsRefreshFn, StandingInstructionStoreFn, StandingInstructionMutateFn, StandingInstructionDeleteFn, MemoryStoreFn, MemoryMutateFn, MemoryDeleteFn, MessageStoreFn, MessageMutateFn, MessageDeleteFn, ThoughtStoreFn, ThoughtMutateFn, ThoughtDeleteFn, ToolCallStoreFn, ToolCallMutateFn, ToolCallDeleteFn, RetrievableStoreFn, RetrievableMutateFn, RetrievableDeleteFn, TurnRunnerConfig, ResolvedTurnRunnerConfig, TurnPipelineMiddlewareFn, TurnStreamableContent, TurnToolCallContent, TurnStartEvent, TurnEndEvent, TurnGateClosedEvent, ToolExecutionStartEvent, ToolExecutionEndEvent, EmitMessageFn, EmitThoughtFn, EmitToolCallFn, EmitToolExecutionStartFn, EmitToolExecutionEndFn, OpenGateFn, TurnEvents, TurnEvent, TurnEventListener, TurnObservabilityEvents, TurnObservabilityEvent, TurnObservabilityEventListener, RawDispatchContext, DispatchMemoryRetrievalFn, DispatchMessageRetrievalFn, DispatchThoughtRetrievalFn, DispatchToolCallRetrievalFn, DispatchToolsRetrievalFn, DispatchStandingInstructionsRefreshFn, DispatchStandingInstructionStoreFn, DispatchStandingInstructionMutateFn, DispatchStandingInstructionDeleteFn, DispatchMemoryStoreFn, DispatchMemoryMutateFn, DispatchMemoryDeleteFn, DispatchMessageStoreFn, DispatchMessageMutateFn, DispatchMessageDeleteFn, DispatchThoughtStoreFn, DispatchThoughtMutateFn, DispatchThoughtDeleteFn, DispatchToolCallStoreFn, DispatchToolCallMutateFn, DispatchToolCallDeleteFn, DispatchContextHooks, DispatchContextHookRegistrations, RawDispatchRunnerInput, DispatchPipelineMiddlewareFn, DispatchExecutorFn, DispatchExecutorHelpers, DispatchExecutorLogChannel, DispatchExecutorLogEntry, DispatchExecutorLogLevel, LogEvent, DispatchStartEvent, DispatchEndEvent, IterationStartEvent, IterationEndEvent, DispatchRunnerFunctionalHooks, DispatchRunnerObservabilityHooks, DispatchRunnerFunctionalHookRegistrations, DispatchRunnerObservabilityHookRegistrations, } from "./types";