@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,519 @@
1
+ const require_exceptions = require("./exceptions-D5YrO9Vm.js");
2
+ //#region src/lib/exceptions/runtime.ts
3
+ /**
4
+ * Thrown by {@link @nhtio/adk!TurnRunner} when the supplied config object fails schema validation at
5
+ * construction time.
6
+ *
7
+ * @remarks
8
+ * Marked fatal — a misconfigured runner must not be allowed to execute turns.
9
+ *
10
+ * @group Turn Runner Construction
11
+ */
12
+ var E_INVALID_TURN_RUNNER_CONFIG = require_exceptions.createException("E_INVALID_TURN_RUNNER_CONFIG", "The turn runner cannot be instantiated with the provided configuration.", "E_INVALID_TURN_RUNNER_CONFIG", 529, true);
13
+ /**
14
+ * Thrown by {@link @nhtio/adk!TurnRunner} when the {@link @nhtio/adk!TurnContext} supplied to `run` fails schema
15
+ * validation.
16
+ *
17
+ * @remarks
18
+ * Marked fatal — an invalid context indicates a programming error in the caller, not a
19
+ * recoverable runtime condition. Thrown synchronously out of `run()` before `turnStart` is
20
+ * emitted.
21
+ *
22
+ * @group Turn Input Validation
23
+ */
24
+ var E_INVALID_TURN_CONTEXT = require_exceptions.createException("E_INVALID_TURN_CONTEXT", "The turn runner received an invalid context object.", "E_INVALID_TURN_CONTEXT", 529, true);
25
+ /**
26
+ * Emitted (via the `error` event) when a non-abort error propagates out of the input
27
+ * middleware pipeline during {@link @nhtio/adk!TurnRunner.run}.
28
+ *
29
+ * @remarks
30
+ * Not fatal — the turn runner emits this on the `error` event rather than throwing, so
31
+ * registered listeners can handle or log the failure without crashing the pipeline. Dispatch
32
+ * and output middleware are skipped; `turnEnd` still fires.
33
+ *
34
+ * @group Pipelines
35
+ */
36
+ var E_INPUT_PIPELINE_ERROR = require_exceptions.createException("E_INPUT_PIPELINE_ERROR", "An error occurred in the input pipeline.", "E_INPUT_PIPELINE_ERROR", 500, false);
37
+ /**
38
+ * Emitted (via the `error` event) when a non-abort error propagates out of the output
39
+ * middleware pipeline during {@link @nhtio/adk!TurnRunner.run}.
40
+ *
41
+ * @remarks
42
+ * Not fatal — the turn runner emits this on the `error` event rather than throwing, so
43
+ * registered listeners can handle or log the failure without crashing the pipeline. `turnEnd`
44
+ * still fires.
45
+ *
46
+ * @group Pipelines
47
+ */
48
+ var E_OUTPUT_PIPELINE_ERROR = require_exceptions.createException("E_OUTPUT_PIPELINE_ERROR", "An error occurred in the output pipeline.", "E_OUTPUT_PIPELINE_ERROR", 500, false);
49
+ /**
50
+ * Emitted (via the `error` event) when a middleware pipeline resolves without reaching its
51
+ * terminal handler and without the turn being aborted. Indicates that some middleware
52
+ * returned without calling `next` and without signalling a deliberate refusal via the turn's
53
+ * abort controller.
54
+ *
55
+ * @remarks
56
+ * Not fatal — the runner emits this on the `error` event so the failure is observable, then
57
+ * proceeds to short-circuit the remainder of the turn the same way any other pipeline error
58
+ * would. The constructor takes a single positional argument identifying the pipeline that
59
+ * short-circuited: one of `'turn-input'`, `'turn-output'`, `'dispatch-input'`, or `'dispatch-output'`.
60
+ *
61
+ * Deliberate refusals should call `ctx.abort(reason)`, which sets the `'aborted'` outcome
62
+ * instead of emitting this error.
63
+ *
64
+ * @warning
65
+ * This is a **detection condition**, not a thrown exception. The runner constructs and emits
66
+ * the code itself when it detects a missing `next()` on the unwind — nothing in user code
67
+ * throws it. Upstream post-steps still run normally.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * throw new E_PIPELINE_SHORT_CIRCUITED(['turn-input'])
72
+ * ```
73
+ *
74
+ * @group Pipelines
75
+ */
76
+ var E_PIPELINE_SHORT_CIRCUITED = require_exceptions.createException("E_PIPELINE_SHORT_CIRCUITED", "The '%s' middleware pipeline short-circuited without calling next or aborting the turn.", "E_PIPELINE_SHORT_CIRCUITED", 500, false);
77
+ /**
78
+ * Thrown when a registry is initialised with a value that is defined but not a plain object.
79
+ *
80
+ * @remarks
81
+ * Registries expect either `undefined` (empty start) or a plain object as their initial value.
82
+ * Passing a primitive, array, class instance, or other non-object signals a programming error
83
+ * in the caller.
84
+ *
85
+ * @group Primitive Validation
86
+ */
87
+ var E_INVALID_INITIAL_REGISTRY_VALUE = require_exceptions.createException("E_INVALID_INITIAL_REGISTRY_VALUE", "Attempted to initialize a registry with a defined non-object value.", "E_INVALID_INITIAL_REGISTRY_VALUE", 500, true);
88
+ /**
89
+ * Thrown when a {@link @nhtio/adk!Memory} is initialised with a value that fails schema validation.
90
+ *
91
+ * @remarks
92
+ * `Memory` requires all fields — `id`, `content`, `confidence`, `importance`, `createdAt`,
93
+ * `updatedAt` — to be present and of the correct type. Passing an incomplete or incorrectly
94
+ * typed object signals a programming error in the caller, not a recoverable runtime condition.
95
+ *
96
+ * @group Primitive Validation
97
+ */
98
+ var E_INVALID_INITIAL_MEMORY_VALUE = require_exceptions.createException("E_INVALID_INITIAL_MEMORY_VALUE", "Attempted to initialize a memory with an invalid value.", "E_INVALID_INITIAL_MEMORY_VALUE", 500, true);
99
+ /**
100
+ * Thrown when a {@link @nhtio/adk!Retrievable} is initialised with a value that fails schema validation.
101
+ *
102
+ * @remarks
103
+ * `Retrievable` requires `id`, `content`, `trustTier`, `createdAt`, and `updatedAt` to be present
104
+ * and of the correct type, and `trustTier` must be one of `'first-party'`, `'third-party-public'`,
105
+ * or `'third-party-private'`. The `trustTier` decision must be made consciously by the retrieval
106
+ * middleware at construction time — there is no default. Passing an incomplete or incorrectly
107
+ * typed object signals a programming error in the caller, not a recoverable runtime condition.
108
+ *
109
+ * @group Primitive Validation
110
+ */
111
+ var E_INVALID_INITIAL_RETRIEVABLE_VALUE = require_exceptions.createException("E_INVALID_INITIAL_RETRIEVABLE_VALUE", "Invalid initial value supplied to Retrievable constructor.", "E_INVALID_INITIAL_RETRIEVABLE_VALUE", 500, true);
112
+ /**
113
+ * Thrown when a {@link @nhtio/adk!Message} is initialised with a value that fails schema validation.
114
+ *
115
+ * @remarks
116
+ * `Message` requires `id`, `role` (`user` or `assistant`), `content`, `createdAt`, and
117
+ * `updatedAt` to be present and of the correct type. Passing an incomplete or incorrectly
118
+ * typed object signals a programming error in the caller, not a recoverable runtime condition.
119
+ *
120
+ * @group Primitive Validation
121
+ */
122
+ var E_INVALID_INITIAL_MESSAGE_VALUE = require_exceptions.createException("E_INVALID_INITIAL_MESSAGE_VALUE", "Attempted to initialize a message with an invalid value.", "E_INVALID_INITIAL_MESSAGE_VALUE", 500, true);
123
+ /**
124
+ * Thrown when an {@link @nhtio/adk!Identity} is initialised with a value that fails schema validation.
125
+ *
126
+ * @remarks
127
+ * `Identity` requires both `identifier` (string or number) and `representation` (string or
128
+ * {@link @nhtio/adk!Tokenizable}) to be present and of the correct type. Passing an incomplete or
129
+ * incorrectly typed object signals a programming error in the caller.
130
+ *
131
+ * @group Primitive Validation
132
+ */
133
+ var E_INVALID_INITIAL_IDENTITY_VALUE = require_exceptions.createException("E_INVALID_INITIAL_IDENTITY_VALUE", "Attempted to initialize an identity with an invalid value.", "E_INVALID_INITIAL_IDENTITY_VALUE", 500, true);
134
+ /**
135
+ * Thrown when a {@link @nhtio/adk!Thought} is initialised with a value that fails schema validation.
136
+ *
137
+ * @remarks
138
+ * `Thought` requires `id`, `content`, `createdAt`, and `updatedAt` to be present and of the
139
+ * correct type. Passing an incomplete or incorrectly typed object signals a programming error
140
+ * in the caller, not a recoverable runtime condition.
141
+ *
142
+ * @group Primitive Validation
143
+ */
144
+ var E_INVALID_INITIAL_THOUGHT_VALUE = require_exceptions.createException("E_INVALID_INITIAL_THOUGHT_VALUE", "Attempted to initialize a thought with an invalid value.", "E_INVALID_INITIAL_THOUGHT_VALUE", 500, true);
145
+ /**
146
+ * Thrown when a {@link @nhtio/adk!TurnGate} is constructed with a value that fails schema validation.
147
+ *
148
+ * @remarks
149
+ * Fatal — bad construction arguments indicate a programming error in the caller.
150
+ *
151
+ * @group Gates
152
+ */
153
+ var E_INVALID_INITIAL_TURN_GATE_VALUE = require_exceptions.createException("E_INVALID_INITIAL_TURN_GATE_VALUE", "Attempted to initialize a turn gate with an invalid value.", "E_INVALID_INITIAL_TURN_GATE_VALUE", 500, true);
154
+ /**
155
+ * Thrown synchronously in the caller's context when {@link @nhtio/adk!TurnGate.resolve} is called with a
156
+ * value that fails the gate's schema.
157
+ *
158
+ * @remarks
159
+ * Fatal — passing the wrong type to `resolve()` is a programming error. The internal promise is
160
+ * NOT settled when this is thrown; the gate remains open.
161
+ *
162
+ * @group Gates
163
+ */
164
+ var E_INVALID_TURN_GATE_RESOLUTION = require_exceptions.createException("E_INVALID_TURN_GATE_RESOLUTION", "The value supplied to TurnGate.resolve() failed schema validation.", "E_INVALID_TURN_GATE_RESOLUTION", 500, true);
165
+ /**
166
+ * Thrown (as a rejection reason) when a {@link @nhtio/adk!TurnGate} times out before being resolved.
167
+ *
168
+ * @remarks
169
+ * Not fatal — a timeout is a recoverable runtime condition; the caller may retry or surface it
170
+ * to the user.
171
+ *
172
+ * @warning
173
+ * A timeout does **not** cancel the external event or clear any remote queue. The gate closes
174
+ * locally, but whatever external system was expected to call `gate.resolve()` may still fire
175
+ * later. Orphaned external state must be handled by the caller.
176
+ *
177
+ * @group Gates
178
+ */
179
+ var E_TURN_GATE_TIMEOUT = require_exceptions.createException("E_TURN_GATE_TIMEOUT", "The turn gate timed out before being resolved.", "E_TURN_GATE_TIMEOUT", 408, false);
180
+ /**
181
+ * Thrown (as a rejection reason) when a {@link @nhtio/adk!TurnGate} is aborted — either because the turn's
182
+ * `AbortSignal` fired or because {@link @nhtio/adk!TurnGate.abort} was called directly.
183
+ *
184
+ * @remarks
185
+ * Not fatal — abort is an intentional cancellation, not an error in the caller.
186
+ *
187
+ * @group Gates
188
+ */
189
+ var E_TURN_GATE_ABORTED = require_exceptions.createException("E_TURN_GATE_ABORTED", "The turn gate was aborted before being resolved.", "E_TURN_GATE_ABORTED", 499, false);
190
+ /**
191
+ * Thrown when a {@link @nhtio/adk!SpooledArtifact} is constructed with a value that does not implement the
192
+ * {@link @nhtio/adk!SpoolReader} interface.
193
+ *
194
+ * @remarks
195
+ * Validated at construction time via {@link @nhtio/adk!implementsSpoolReader}. Passing anything that lacks
196
+ * `line`, `byteLength`, or `lineCount` as callable functions signals a programming error in the
197
+ * caller.
198
+ *
199
+ * @group Artifacts
200
+ */
201
+ var E_NOT_A_SPOOL_READER = require_exceptions.createException("E_NOT_A_SPOOL_READER", "The provided value does not implement the SpoolReader interface.", "E_NOT_A_SPOOL_READER", 500, true);
202
+ /**
203
+ * Thrown when a Media is constructed with a value that does not implement the MediaReader
204
+ * interface.
205
+ *
206
+ * @remarks
207
+ * Validated at construction time. Passing anything that lacks `stream` or `byteLength` as
208
+ * callable functions signals a programming error in the caller.
209
+ *
210
+ * @group Artifacts
211
+ */
212
+ var E_NOT_A_MEDIA_READER = require_exceptions.createException("E_NOT_A_MEDIA_READER", "The provided value does not implement the MediaReader interface.", "E_NOT_A_MEDIA_READER", 500, true);
213
+ /**
214
+ * Thrown when a Media is initialised with a value that fails schema validation.
215
+ *
216
+ * @remarks
217
+ * Fatal — bad construction arguments indicate a programming error in the caller.
218
+ *
219
+ * @group Artifacts
220
+ */
221
+ var E_INVALID_INITIAL_MEDIA_VALUE = require_exceptions.createException("E_INVALID_INITIAL_MEDIA_VALUE", "Attempted to initialize a media with an invalid value.", "E_INVALID_INITIAL_MEDIA_VALUE", 500, true);
222
+ /**
223
+ * Thrown when a {@link @nhtio/adk!ToolCall} is initialised with a value that fails schema validation.
224
+ *
225
+ * @remarks
226
+ * `ToolCall` requires `id`, `tool`, `args`, `checksum`, `isComplete`, `isError`, `createdAt`,
227
+ * and `updatedAt` to be present and of the correct type. Passing an incomplete or incorrectly
228
+ * typed object signals a programming error in the caller, not a recoverable runtime condition.
229
+ *
230
+ * @group Primitive Validation
231
+ */
232
+ var E_INVALID_INITIAL_TOOL_CALL_VALUE = require_exceptions.createException("E_INVALID_INITIAL_TOOL_CALL_VALUE", "Attempted to initialize a tool call with an invalid value.", "E_INVALID_INITIAL_TOOL_CALL_VALUE", 500, true);
233
+ /**
234
+ * Thrown when a {@link @nhtio/adk!Tool} is constructed with a value that fails schema validation.
235
+ *
236
+ * @remarks
237
+ * Fatal — bad construction arguments indicate a programming error in the caller.
238
+ *
239
+ * @group Tools
240
+ */
241
+ var E_INVALID_INITIAL_TOOL_VALUE = require_exceptions.createException("E_INVALID_INITIAL_TOOL_VALUE", "Attempted to initialize a tool with an invalid value.", "E_INVALID_INITIAL_TOOL_VALUE", 500, true);
242
+ /**
243
+ * Thrown synchronously when {@link @nhtio/adk!Tool.validate} is called with arguments that fail the tool's
244
+ * input schema.
245
+ *
246
+ * @remarks
247
+ * Not fatal — an arg validation failure in the tool call loop is a caller mistake that can be
248
+ * surfaced as an error response. The tool handler is NOT called when this is thrown.
249
+ *
250
+ * @group Tools
251
+ */
252
+ var E_INVALID_TOOL_ARGS = require_exceptions.createException("E_INVALID_TOOL_ARGS", "The arguments supplied to the tool failed input schema validation.", "E_INVALID_TOOL_ARGS", 422, false);
253
+ /**
254
+ * Thrown (as a rejection reason) when a {@link @nhtio/adk!Tool}'s handler throws during execution.
255
+ *
256
+ * @remarks
257
+ * Not fatal — a downstream tool failure is a recoverable runtime condition. The tool call loop
258
+ * catches this error specifically to report the failure back to the model rather than crashing
259
+ * the pipeline.
260
+ *
261
+ * @group Tools
262
+ */
263
+ var E_TOOL_DOWNSTREAM_ERROR = require_exceptions.createException("E_TOOL_DOWNSTREAM_ERROR", "The tool handler threw an error during execution.", "E_TOOL_DOWNSTREAM_ERROR", 500, false);
264
+ /**
265
+ * Thrown when {@link @nhtio/adk!ToolRegistry.register} is called for a tool name that is already registered
266
+ * and `overwrite` is not `true`.
267
+ *
268
+ * @remarks
269
+ * Fatal — accidentally overwriting a registered tool indicates a programming error. Pass
270
+ * `overwrite: true` to replace an existing tool intentionally.
271
+ *
272
+ * @group Tools
273
+ */
274
+ var E_TOOL_ALREADY_REGISTERED = require_exceptions.createException("E_TOOL_ALREADY_REGISTERED", "A tool with this name is already registered. Pass overwrite: true to replace it.", "E_TOOL_ALREADY_REGISTERED", 409, true);
275
+ /**
276
+ * Thrown when {@link @nhtio/adk!DispatchContext} is constructed with a value that fails schema validation.
277
+ *
278
+ * @remarks
279
+ * Fatal — bad construction arguments indicate a programming error in the caller.
280
+ *
281
+ * @group Dispatch
282
+ */
283
+ var E_INVALID_LLM_EXECUTION_CONTEXT = require_exceptions.createException("E_INVALID_LLM_EXECUTION_CONTEXT", "The LLM execution context cannot be instantiated with the provided value.", "E_INVALID_LLM_EXECUTION_CONTEXT", 529, true);
284
+ /**
285
+ * Thrown (as a rejection reason) when {@link @nhtio/adk!DispatchContext.waitFor} is called on a
286
+ * standalone context that was constructed without a `waitFor` function.
287
+ *
288
+ * @remarks
289
+ * Not fatal — the caller can catch this and handle the case where gate suspension is not
290
+ * supported for this execution context.
291
+ *
292
+ * @group Dispatch
293
+ */
294
+ var E_LLM_EXECUTION_GATE_NOT_SUPPORTED = require_exceptions.createException("E_LLM_EXECUTION_GATE_NOT_SUPPORTED", "waitFor was called on a standalone DispatchContext with no gate function provided.", "E_LLM_EXECUTION_GATE_NOT_SUPPORTED", 501, false);
295
+ /**
296
+ * Thrown when {@link @nhtio/adk!DispatchContext.ack} or {@link @nhtio/adk!DispatchContext.nack} is called on a
297
+ * context that has already been signalled.
298
+ *
299
+ * @remarks
300
+ * Fatal — signalling twice is a programming error in the caller. The first signal wins; the
301
+ * second call is rejected loudly so callers cannot accidentally race between ack and nack.
302
+ *
303
+ * @danger
304
+ * Signalling is **not** silently idempotent. The first `ack()` or `nack()` wins; the second
305
+ * throws immediately. Guard with `if (!ctx.isSignalled)` when more than one seam may signal.
306
+ *
307
+ * @group Dispatch
308
+ */
309
+ var E_LLM_EXECUTION_ALREADY_SIGNALLED = require_exceptions.createException("E_LLM_EXECUTION_ALREADY_SIGNALLED", "ack() or nack() was called on an DispatchContext that has already been signalled.", "E_LLM_EXECUTION_ALREADY_SIGNALLED", 500, true);
310
+ /**
311
+ * Thrown when {@link @nhtio/adk!DispatchRunner.dispatch} receives an input that fails schema validation.
312
+ *
313
+ * @remarks
314
+ * Fatal — invalid dispatch input indicates a programming error in the caller.
315
+ *
316
+ * @group Dispatch
317
+ */
318
+ var E_INVALID_LLM_DISPATCH_INPUT = require_exceptions.createException("E_INVALID_LLM_DISPATCH_INPUT", "The LLM execution runner received an invalid dispatch input.", "E_INVALID_LLM_DISPATCH_INPUT", 529, true);
319
+ /**
320
+ * Emitted (via the observability `error` hook) and re-thrown when a non-abort error propagates
321
+ * out of the input or output middleware pipeline during {@link @nhtio/adk!DispatchRunner.dispatch}.
322
+ *
323
+ * @remarks
324
+ * Not fatal — pipeline errors are recoverable runtime conditions. `dispatch()` rejects with this
325
+ * exception so callers can handle the failure via try/catch. Both `dispatchInputPipeline` and
326
+ * `dispatchOutputPipeline` share this one code — the runner does not split input vs. output at
327
+ * this layer.
328
+ *
329
+ * @group Pipelines
330
+ */
331
+ var E_DISPATCH_PIPELINE_ERROR = require_exceptions.createException("E_DISPATCH_PIPELINE_ERROR", "An error occurred in an LLM execution pipeline.", "E_DISPATCH_PIPELINE_ERROR", 500, false);
332
+ /**
333
+ * Emitted (via the observability `error` hook) and re-thrown when the user-supplied executor
334
+ * callback throws during {@link @nhtio/adk!DispatchRunner.dispatch}.
335
+ *
336
+ * @remarks
337
+ * Not fatal — executor errors are recoverable runtime conditions. `dispatch()` rejects with this
338
+ * exception so callers can handle the failure via try/catch.
339
+ *
340
+ * @group Dispatch
341
+ */
342
+ var E_LLM_EXECUTION_EXECUTOR_ERROR = require_exceptions.createException("E_LLM_EXECUTION_EXECUTOR_ERROR", "The LLM execution executor callback threw an error.", "E_LLM_EXECUTION_EXECUTOR_ERROR", 500, false);
343
+ //#endregion
344
+ Object.defineProperty(exports, "E_DISPATCH_PIPELINE_ERROR", {
345
+ enumerable: true,
346
+ get: function() {
347
+ return E_DISPATCH_PIPELINE_ERROR;
348
+ }
349
+ });
350
+ Object.defineProperty(exports, "E_INPUT_PIPELINE_ERROR", {
351
+ enumerable: true,
352
+ get: function() {
353
+ return E_INPUT_PIPELINE_ERROR;
354
+ }
355
+ });
356
+ Object.defineProperty(exports, "E_INVALID_INITIAL_IDENTITY_VALUE", {
357
+ enumerable: true,
358
+ get: function() {
359
+ return E_INVALID_INITIAL_IDENTITY_VALUE;
360
+ }
361
+ });
362
+ Object.defineProperty(exports, "E_INVALID_INITIAL_MEDIA_VALUE", {
363
+ enumerable: true,
364
+ get: function() {
365
+ return E_INVALID_INITIAL_MEDIA_VALUE;
366
+ }
367
+ });
368
+ Object.defineProperty(exports, "E_INVALID_INITIAL_MEMORY_VALUE", {
369
+ enumerable: true,
370
+ get: function() {
371
+ return E_INVALID_INITIAL_MEMORY_VALUE;
372
+ }
373
+ });
374
+ Object.defineProperty(exports, "E_INVALID_INITIAL_MESSAGE_VALUE", {
375
+ enumerable: true,
376
+ get: function() {
377
+ return E_INVALID_INITIAL_MESSAGE_VALUE;
378
+ }
379
+ });
380
+ Object.defineProperty(exports, "E_INVALID_INITIAL_REGISTRY_VALUE", {
381
+ enumerable: true,
382
+ get: function() {
383
+ return E_INVALID_INITIAL_REGISTRY_VALUE;
384
+ }
385
+ });
386
+ Object.defineProperty(exports, "E_INVALID_INITIAL_RETRIEVABLE_VALUE", {
387
+ enumerable: true,
388
+ get: function() {
389
+ return E_INVALID_INITIAL_RETRIEVABLE_VALUE;
390
+ }
391
+ });
392
+ Object.defineProperty(exports, "E_INVALID_INITIAL_THOUGHT_VALUE", {
393
+ enumerable: true,
394
+ get: function() {
395
+ return E_INVALID_INITIAL_THOUGHT_VALUE;
396
+ }
397
+ });
398
+ Object.defineProperty(exports, "E_INVALID_INITIAL_TOOL_CALL_VALUE", {
399
+ enumerable: true,
400
+ get: function() {
401
+ return E_INVALID_INITIAL_TOOL_CALL_VALUE;
402
+ }
403
+ });
404
+ Object.defineProperty(exports, "E_INVALID_INITIAL_TOOL_VALUE", {
405
+ enumerable: true,
406
+ get: function() {
407
+ return E_INVALID_INITIAL_TOOL_VALUE;
408
+ }
409
+ });
410
+ Object.defineProperty(exports, "E_INVALID_INITIAL_TURN_GATE_VALUE", {
411
+ enumerable: true,
412
+ get: function() {
413
+ return E_INVALID_INITIAL_TURN_GATE_VALUE;
414
+ }
415
+ });
416
+ Object.defineProperty(exports, "E_INVALID_LLM_DISPATCH_INPUT", {
417
+ enumerable: true,
418
+ get: function() {
419
+ return E_INVALID_LLM_DISPATCH_INPUT;
420
+ }
421
+ });
422
+ Object.defineProperty(exports, "E_INVALID_LLM_EXECUTION_CONTEXT", {
423
+ enumerable: true,
424
+ get: function() {
425
+ return E_INVALID_LLM_EXECUTION_CONTEXT;
426
+ }
427
+ });
428
+ Object.defineProperty(exports, "E_INVALID_TOOL_ARGS", {
429
+ enumerable: true,
430
+ get: function() {
431
+ return E_INVALID_TOOL_ARGS;
432
+ }
433
+ });
434
+ Object.defineProperty(exports, "E_INVALID_TURN_CONTEXT", {
435
+ enumerable: true,
436
+ get: function() {
437
+ return E_INVALID_TURN_CONTEXT;
438
+ }
439
+ });
440
+ Object.defineProperty(exports, "E_INVALID_TURN_GATE_RESOLUTION", {
441
+ enumerable: true,
442
+ get: function() {
443
+ return E_INVALID_TURN_GATE_RESOLUTION;
444
+ }
445
+ });
446
+ Object.defineProperty(exports, "E_INVALID_TURN_RUNNER_CONFIG", {
447
+ enumerable: true,
448
+ get: function() {
449
+ return E_INVALID_TURN_RUNNER_CONFIG;
450
+ }
451
+ });
452
+ Object.defineProperty(exports, "E_LLM_EXECUTION_ALREADY_SIGNALLED", {
453
+ enumerable: true,
454
+ get: function() {
455
+ return E_LLM_EXECUTION_ALREADY_SIGNALLED;
456
+ }
457
+ });
458
+ Object.defineProperty(exports, "E_LLM_EXECUTION_EXECUTOR_ERROR", {
459
+ enumerable: true,
460
+ get: function() {
461
+ return E_LLM_EXECUTION_EXECUTOR_ERROR;
462
+ }
463
+ });
464
+ Object.defineProperty(exports, "E_LLM_EXECUTION_GATE_NOT_SUPPORTED", {
465
+ enumerable: true,
466
+ get: function() {
467
+ return E_LLM_EXECUTION_GATE_NOT_SUPPORTED;
468
+ }
469
+ });
470
+ Object.defineProperty(exports, "E_NOT_A_MEDIA_READER", {
471
+ enumerable: true,
472
+ get: function() {
473
+ return E_NOT_A_MEDIA_READER;
474
+ }
475
+ });
476
+ Object.defineProperty(exports, "E_NOT_A_SPOOL_READER", {
477
+ enumerable: true,
478
+ get: function() {
479
+ return E_NOT_A_SPOOL_READER;
480
+ }
481
+ });
482
+ Object.defineProperty(exports, "E_OUTPUT_PIPELINE_ERROR", {
483
+ enumerable: true,
484
+ get: function() {
485
+ return E_OUTPUT_PIPELINE_ERROR;
486
+ }
487
+ });
488
+ Object.defineProperty(exports, "E_PIPELINE_SHORT_CIRCUITED", {
489
+ enumerable: true,
490
+ get: function() {
491
+ return E_PIPELINE_SHORT_CIRCUITED;
492
+ }
493
+ });
494
+ Object.defineProperty(exports, "E_TOOL_ALREADY_REGISTERED", {
495
+ enumerable: true,
496
+ get: function() {
497
+ return E_TOOL_ALREADY_REGISTERED;
498
+ }
499
+ });
500
+ Object.defineProperty(exports, "E_TOOL_DOWNSTREAM_ERROR", {
501
+ enumerable: true,
502
+ get: function() {
503
+ return E_TOOL_DOWNSTREAM_ERROR;
504
+ }
505
+ });
506
+ Object.defineProperty(exports, "E_TURN_GATE_ABORTED", {
507
+ enumerable: true,
508
+ get: function() {
509
+ return E_TURN_GATE_ABORTED;
510
+ }
511
+ });
512
+ Object.defineProperty(exports, "E_TURN_GATE_TIMEOUT", {
513
+ enumerable: true,
514
+ get: function() {
515
+ return E_TURN_GATE_TIMEOUT;
516
+ }
517
+ });
518
+
519
+ //# sourceMappingURL=runtime-BJVkrGQe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-BJVkrGQe.js","names":[],"sources":["../src/lib/exceptions/runtime.ts"],"sourcesContent":["import { createException } from '../utils/exceptions'\n\n/**\n * Thrown by {@link @nhtio/adk!TurnRunner} when the supplied config object fails schema validation at\n * construction time.\n *\n * @remarks\n * Marked fatal — a misconfigured runner must not be allowed to execute turns.\n *\n * @group Turn Runner Construction\n */\nexport const E_INVALID_TURN_RUNNER_CONFIG = createException(\n 'E_INVALID_TURN_RUNNER_CONFIG',\n 'The turn runner cannot be instantiated with the provided configuration.',\n 'E_INVALID_TURN_RUNNER_CONFIG',\n 529,\n true\n)\n\n/**\n * Thrown by {@link @nhtio/adk!TurnRunner} when the {@link @nhtio/adk!TurnContext} supplied to `run` fails schema\n * validation.\n *\n * @remarks\n * Marked fatal — an invalid context indicates a programming error in the caller, not a\n * recoverable runtime condition. Thrown synchronously out of `run()` before `turnStart` is\n * emitted.\n *\n * @group Turn Input Validation\n */\nexport const E_INVALID_TURN_CONTEXT = createException(\n 'E_INVALID_TURN_CONTEXT',\n 'The turn runner received an invalid context object.',\n 'E_INVALID_TURN_CONTEXT',\n 529,\n true\n)\n\n/**\n * Emitted (via the `error` event) when a non-abort error propagates out of the input\n * middleware pipeline during {@link @nhtio/adk!TurnRunner.run}.\n *\n * @remarks\n * Not fatal — the turn runner emits this on the `error` event rather than throwing, so\n * registered listeners can handle or log the failure without crashing the pipeline. Dispatch\n * and output middleware are skipped; `turnEnd` still fires.\n *\n * @group Pipelines\n */\nexport const E_INPUT_PIPELINE_ERROR = createException(\n 'E_INPUT_PIPELINE_ERROR',\n 'An error occurred in the input pipeline.',\n 'E_INPUT_PIPELINE_ERROR',\n 500,\n false\n)\n\n/**\n * Emitted (via the `error` event) when a non-abort error propagates out of the output\n * middleware pipeline during {@link @nhtio/adk!TurnRunner.run}.\n *\n * @remarks\n * Not fatal — the turn runner emits this on the `error` event rather than throwing, so\n * registered listeners can handle or log the failure without crashing the pipeline. `turnEnd`\n * still fires.\n *\n * @group Pipelines\n */\nexport const E_OUTPUT_PIPELINE_ERROR = createException(\n 'E_OUTPUT_PIPELINE_ERROR',\n 'An error occurred in the output pipeline.',\n 'E_OUTPUT_PIPELINE_ERROR',\n 500,\n false\n)\n\n/**\n * Emitted (via the `error` event) when a middleware pipeline resolves without reaching its\n * terminal handler and without the turn being aborted. Indicates that some middleware\n * returned without calling `next` and without signalling a deliberate refusal via the turn's\n * abort controller.\n *\n * @remarks\n * Not fatal — the runner emits this on the `error` event so the failure is observable, then\n * proceeds to short-circuit the remainder of the turn the same way any other pipeline error\n * would. The constructor takes a single positional argument identifying the pipeline that\n * short-circuited: one of `'turn-input'`, `'turn-output'`, `'dispatch-input'`, or `'dispatch-output'`.\n *\n * Deliberate refusals should call `ctx.abort(reason)`, which sets the `'aborted'` outcome\n * instead of emitting this error.\n *\n * @warning\n * This is a **detection condition**, not a thrown exception. The runner constructs and emits\n * the code itself when it detects a missing `next()` on the unwind — nothing in user code\n * throws it. Upstream post-steps still run normally.\n *\n * @example\n * ```ts\n * throw new E_PIPELINE_SHORT_CIRCUITED(['turn-input'])\n * ```\n *\n * @group Pipelines\n */\nexport const E_PIPELINE_SHORT_CIRCUITED = createException<[string]>(\n 'E_PIPELINE_SHORT_CIRCUITED',\n \"The '%s' middleware pipeline short-circuited without calling next or aborting the turn.\",\n 'E_PIPELINE_SHORT_CIRCUITED',\n 500,\n false\n)\n\n/**\n * Thrown when a registry is initialised with a value that is defined but not a plain object.\n *\n * @remarks\n * Registries expect either `undefined` (empty start) or a plain object as their initial value.\n * Passing a primitive, array, class instance, or other non-object signals a programming error\n * in the caller.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_REGISTRY_VALUE = createException(\n 'E_INVALID_INITIAL_REGISTRY_VALUE',\n 'Attempted to initialize a registry with a defined non-object value.',\n 'E_INVALID_INITIAL_REGISTRY_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!Memory} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `Memory` requires all fields — `id`, `content`, `confidence`, `importance`, `createdAt`,\n * `updatedAt` — to be present and of the correct type. Passing an incomplete or incorrectly\n * typed object signals a programming error in the caller, not a recoverable runtime condition.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_MEMORY_VALUE = createException(\n 'E_INVALID_INITIAL_MEMORY_VALUE',\n 'Attempted to initialize a memory with an invalid value.',\n 'E_INVALID_INITIAL_MEMORY_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!Retrievable} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `Retrievable` requires `id`, `content`, `trustTier`, `createdAt`, and `updatedAt` to be present\n * and of the correct type, and `trustTier` must be one of `'first-party'`, `'third-party-public'`,\n * or `'third-party-private'`. The `trustTier` decision must be made consciously by the retrieval\n * middleware at construction time — there is no default. Passing an incomplete or incorrectly\n * typed object signals a programming error in the caller, not a recoverable runtime condition.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_RETRIEVABLE_VALUE = createException(\n 'E_INVALID_INITIAL_RETRIEVABLE_VALUE',\n 'Invalid initial value supplied to Retrievable constructor.',\n 'E_INVALID_INITIAL_RETRIEVABLE_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!Message} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `Message` requires `id`, `role` (`user` or `assistant`), `content`, `createdAt`, and\n * `updatedAt` to be present and of the correct type. Passing an incomplete or incorrectly\n * typed object signals a programming error in the caller, not a recoverable runtime condition.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_MESSAGE_VALUE = createException(\n 'E_INVALID_INITIAL_MESSAGE_VALUE',\n 'Attempted to initialize a message with an invalid value.',\n 'E_INVALID_INITIAL_MESSAGE_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when an {@link @nhtio/adk!Identity} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `Identity` requires both `identifier` (string or number) and `representation` (string or\n * {@link @nhtio/adk!Tokenizable}) to be present and of the correct type. Passing an incomplete or\n * incorrectly typed object signals a programming error in the caller.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_IDENTITY_VALUE = createException(\n 'E_INVALID_INITIAL_IDENTITY_VALUE',\n 'Attempted to initialize an identity with an invalid value.',\n 'E_INVALID_INITIAL_IDENTITY_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!Thought} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `Thought` requires `id`, `content`, `createdAt`, and `updatedAt` to be present and of the\n * correct type. Passing an incomplete or incorrectly typed object signals a programming error\n * in the caller, not a recoverable runtime condition.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_THOUGHT_VALUE = createException(\n 'E_INVALID_INITIAL_THOUGHT_VALUE',\n 'Attempted to initialize a thought with an invalid value.',\n 'E_INVALID_INITIAL_THOUGHT_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!TurnGate} is constructed with a value that fails schema validation.\n *\n * @remarks\n * Fatal — bad construction arguments indicate a programming error in the caller.\n *\n * @group Gates\n */\nexport const E_INVALID_INITIAL_TURN_GATE_VALUE = createException(\n 'E_INVALID_INITIAL_TURN_GATE_VALUE',\n 'Attempted to initialize a turn gate with an invalid value.',\n 'E_INVALID_INITIAL_TURN_GATE_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown synchronously in the caller's context when {@link @nhtio/adk!TurnGate.resolve} is called with a\n * value that fails the gate's schema.\n *\n * @remarks\n * Fatal — passing the wrong type to `resolve()` is a programming error. The internal promise is\n * NOT settled when this is thrown; the gate remains open.\n *\n * @group Gates\n */\nexport const E_INVALID_TURN_GATE_RESOLUTION = createException(\n 'E_INVALID_TURN_GATE_RESOLUTION',\n 'The value supplied to TurnGate.resolve() failed schema validation.',\n 'E_INVALID_TURN_GATE_RESOLUTION',\n 500,\n true\n)\n\n/**\n * Thrown (as a rejection reason) when a {@link @nhtio/adk!TurnGate} times out before being resolved.\n *\n * @remarks\n * Not fatal — a timeout is a recoverable runtime condition; the caller may retry or surface it\n * to the user.\n *\n * @warning\n * A timeout does **not** cancel the external event or clear any remote queue. The gate closes\n * locally, but whatever external system was expected to call `gate.resolve()` may still fire\n * later. Orphaned external state must be handled by the caller.\n *\n * @group Gates\n */\nexport const E_TURN_GATE_TIMEOUT = createException(\n 'E_TURN_GATE_TIMEOUT',\n 'The turn gate timed out before being resolved.',\n 'E_TURN_GATE_TIMEOUT',\n 408,\n false\n)\n\n/**\n * Thrown (as a rejection reason) when a {@link @nhtio/adk!TurnGate} is aborted — either because the turn's\n * `AbortSignal` fired or because {@link @nhtio/adk!TurnGate.abort} was called directly.\n *\n * @remarks\n * Not fatal — abort is an intentional cancellation, not an error in the caller.\n *\n * @group Gates\n */\nexport const E_TURN_GATE_ABORTED = createException(\n 'E_TURN_GATE_ABORTED',\n 'The turn gate was aborted before being resolved.',\n 'E_TURN_GATE_ABORTED',\n 499,\n false\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!SpooledArtifact} is constructed with a value that does not implement the\n * {@link @nhtio/adk!SpoolReader} interface.\n *\n * @remarks\n * Validated at construction time via {@link @nhtio/adk!implementsSpoolReader}. Passing anything that lacks\n * `line`, `byteLength`, or `lineCount` as callable functions signals a programming error in the\n * caller.\n *\n * @group Artifacts\n */\nexport const E_NOT_A_SPOOL_READER = createException(\n 'E_NOT_A_SPOOL_READER',\n 'The provided value does not implement the SpoolReader interface.',\n 'E_NOT_A_SPOOL_READER',\n 500,\n true\n)\n\n/**\n * Thrown when a Media is constructed with a value that does not implement the MediaReader\n * interface.\n *\n * @remarks\n * Validated at construction time. Passing anything that lacks `stream` or `byteLength` as\n * callable functions signals a programming error in the caller.\n *\n * @group Artifacts\n */\nexport const E_NOT_A_MEDIA_READER = createException(\n 'E_NOT_A_MEDIA_READER',\n 'The provided value does not implement the MediaReader interface.',\n 'E_NOT_A_MEDIA_READER',\n 500,\n true\n)\n\n/**\n * Thrown when a Media is initialised with a value that fails schema validation.\n *\n * @remarks\n * Fatal — bad construction arguments indicate a programming error in the caller.\n *\n * @group Artifacts\n */\nexport const E_INVALID_INITIAL_MEDIA_VALUE = createException(\n 'E_INVALID_INITIAL_MEDIA_VALUE',\n 'Attempted to initialize a media with an invalid value.',\n 'E_INVALID_INITIAL_MEDIA_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!ToolCall} is initialised with a value that fails schema validation.\n *\n * @remarks\n * `ToolCall` requires `id`, `tool`, `args`, `checksum`, `isComplete`, `isError`, `createdAt`,\n * and `updatedAt` to be present and of the correct type. Passing an incomplete or incorrectly\n * typed object signals a programming error in the caller, not a recoverable runtime condition.\n *\n * @group Primitive Validation\n */\nexport const E_INVALID_INITIAL_TOOL_CALL_VALUE = createException(\n 'E_INVALID_INITIAL_TOOL_CALL_VALUE',\n 'Attempted to initialize a tool call with an invalid value.',\n 'E_INVALID_INITIAL_TOOL_CALL_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown when a {@link @nhtio/adk!Tool} is constructed with a value that fails schema validation.\n *\n * @remarks\n * Fatal — bad construction arguments indicate a programming error in the caller.\n *\n * @group Tools\n */\nexport const E_INVALID_INITIAL_TOOL_VALUE = createException(\n 'E_INVALID_INITIAL_TOOL_VALUE',\n 'Attempted to initialize a tool with an invalid value.',\n 'E_INVALID_INITIAL_TOOL_VALUE',\n 500,\n true\n)\n\n/**\n * Thrown synchronously when {@link @nhtio/adk!Tool.validate} is called with arguments that fail the tool's\n * input schema.\n *\n * @remarks\n * Not fatal — an arg validation failure in the tool call loop is a caller mistake that can be\n * surfaced as an error response. The tool handler is NOT called when this is thrown.\n *\n * @group Tools\n */\nexport const E_INVALID_TOOL_ARGS = createException(\n 'E_INVALID_TOOL_ARGS',\n 'The arguments supplied to the tool failed input schema validation.',\n 'E_INVALID_TOOL_ARGS',\n 422,\n false\n)\n\n/**\n * Thrown (as a rejection reason) when a {@link @nhtio/adk!Tool}'s handler throws during execution.\n *\n * @remarks\n * Not fatal — a downstream tool failure is a recoverable runtime condition. The tool call loop\n * catches this error specifically to report the failure back to the model rather than crashing\n * the pipeline.\n *\n * @group Tools\n */\nexport const E_TOOL_DOWNSTREAM_ERROR = createException(\n 'E_TOOL_DOWNSTREAM_ERROR',\n 'The tool handler threw an error during execution.',\n 'E_TOOL_DOWNSTREAM_ERROR',\n 500,\n false\n)\n\n/**\n * Thrown when {@link @nhtio/adk!ToolRegistry.register} is called for a tool name that is already registered\n * and `overwrite` is not `true`.\n *\n * @remarks\n * Fatal — accidentally overwriting a registered tool indicates a programming error. Pass\n * `overwrite: true` to replace an existing tool intentionally.\n *\n * @group Tools\n */\nexport const E_TOOL_ALREADY_REGISTERED = createException(\n 'E_TOOL_ALREADY_REGISTERED',\n 'A tool with this name is already registered. Pass overwrite: true to replace it.',\n 'E_TOOL_ALREADY_REGISTERED',\n 409,\n true\n)\n\n/**\n * Thrown when {@link @nhtio/adk!DispatchContext} is constructed with a value that fails schema validation.\n *\n * @remarks\n * Fatal — bad construction arguments indicate a programming error in the caller.\n *\n * @group Dispatch\n */\nexport const E_INVALID_LLM_EXECUTION_CONTEXT = createException(\n 'E_INVALID_LLM_EXECUTION_CONTEXT',\n 'The LLM execution context cannot be instantiated with the provided value.',\n 'E_INVALID_LLM_EXECUTION_CONTEXT',\n 529,\n true\n)\n\n/**\n * Thrown (as a rejection reason) when {@link @nhtio/adk!DispatchContext.waitFor} is called on a\n * standalone context that was constructed without a `waitFor` function.\n *\n * @remarks\n * Not fatal — the caller can catch this and handle the case where gate suspension is not\n * supported for this execution context.\n *\n * @group Dispatch\n */\nexport const E_LLM_EXECUTION_GATE_NOT_SUPPORTED = createException(\n 'E_LLM_EXECUTION_GATE_NOT_SUPPORTED',\n 'waitFor was called on a standalone DispatchContext with no gate function provided.',\n 'E_LLM_EXECUTION_GATE_NOT_SUPPORTED',\n 501,\n false\n)\n\n/**\n * Thrown when {@link @nhtio/adk!DispatchContext.ack} or {@link @nhtio/adk!DispatchContext.nack} is called on a\n * context that has already been signalled.\n *\n * @remarks\n * Fatal — signalling twice is a programming error in the caller. The first signal wins; the\n * second call is rejected loudly so callers cannot accidentally race between ack and nack.\n *\n * @danger\n * Signalling is **not** silently idempotent. The first `ack()` or `nack()` wins; the second\n * throws immediately. Guard with `if (!ctx.isSignalled)` when more than one seam may signal.\n *\n * @group Dispatch\n */\nexport const E_LLM_EXECUTION_ALREADY_SIGNALLED = createException(\n 'E_LLM_EXECUTION_ALREADY_SIGNALLED',\n 'ack() or nack() was called on an DispatchContext that has already been signalled.',\n 'E_LLM_EXECUTION_ALREADY_SIGNALLED',\n 500,\n true\n)\n\n/**\n * Thrown when {@link @nhtio/adk!DispatchRunner.dispatch} receives an input that fails schema validation.\n *\n * @remarks\n * Fatal — invalid dispatch input indicates a programming error in the caller.\n *\n * @group Dispatch\n */\nexport const E_INVALID_LLM_DISPATCH_INPUT = createException(\n 'E_INVALID_LLM_DISPATCH_INPUT',\n 'The LLM execution runner received an invalid dispatch input.',\n 'E_INVALID_LLM_DISPATCH_INPUT',\n 529,\n true\n)\n\n/**\n * Emitted (via the observability `error` hook) and re-thrown when a non-abort error propagates\n * out of the input or output middleware pipeline during {@link @nhtio/adk!DispatchRunner.dispatch}.\n *\n * @remarks\n * Not fatal — pipeline errors are recoverable runtime conditions. `dispatch()` rejects with this\n * exception so callers can handle the failure via try/catch. Both `dispatchInputPipeline` and\n * `dispatchOutputPipeline` share this one code — the runner does not split input vs. output at\n * this layer.\n *\n * @group Pipelines\n */\nexport const E_DISPATCH_PIPELINE_ERROR = createException(\n 'E_DISPATCH_PIPELINE_ERROR',\n 'An error occurred in an LLM execution pipeline.',\n 'E_DISPATCH_PIPELINE_ERROR',\n 500,\n false\n)\n\n/**\n * Emitted (via the observability `error` hook) and re-thrown when the user-supplied executor\n * callback throws during {@link @nhtio/adk!DispatchRunner.dispatch}.\n *\n * @remarks\n * Not fatal — executor errors are recoverable runtime conditions. `dispatch()` rejects with this\n * exception so callers can handle the failure via try/catch.\n *\n * @group Dispatch\n */\nexport const E_LLM_EXECUTION_EXECUTOR_ERROR = createException(\n 'E_LLM_EXECUTION_EXECUTOR_ERROR',\n 'The LLM execution executor callback threw an error.',\n 'E_LLM_EXECUTION_EXECUTOR_ERROR',\n 500,\n false\n)\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,+BAA+B,mBAAA,gBAC1C,gCACA,2EACA,gCACA,KACA,IACF;;;;;;;;;;;;AAaA,IAAa,yBAAyB,mBAAA,gBACpC,0BACA,uDACA,0BACA,KACA,IACF;;;;;;;;;;;;AAaA,IAAa,yBAAyB,mBAAA,gBACpC,0BACA,4CACA,0BACA,KACA,KACF;;;;;;;;;;;;AAaA,IAAa,0BAA0B,mBAAA,gBACrC,2BACA,6CACA,2BACA,KACA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,6BAA6B,mBAAA,gBACxC,8BACA,2FACA,8BACA,KACA,KACF;;;;;;;;;;;AAYA,IAAa,mCAAmC,mBAAA,gBAC9C,oCACA,uEACA,oCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,iCAAiC,mBAAA,gBAC5C,kCACA,2DACA,kCACA,KACA,IACF;;;;;;;;;;;;;AAcA,IAAa,sCAAsC,mBAAA,gBACjD,uCACA,8DACA,uCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,kCAAkC,mBAAA,gBAC7C,mCACA,4DACA,mCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,mCAAmC,mBAAA,gBAC9C,oCACA,8DACA,oCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,kCAAkC,mBAAA,gBAC7C,mCACA,4DACA,mCACA,KACA,IACF;;;;;;;;;AAUA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,8DACA,qCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,iCAAiC,mBAAA,gBAC5C,kCACA,sEACA,kCACA,KACA,IACF;;;;;;;;;;;;;;;AAgBA,IAAa,sBAAsB,mBAAA,gBACjC,uBACA,kDACA,uBACA,KACA,KACF;;;;;;;;;;AAWA,IAAa,sBAAsB,mBAAA,gBACjC,uBACA,oDACA,uBACA,KACA,KACF;;;;;;;;;;;;AAaA,IAAa,uBAAuB,mBAAA,gBAClC,wBACA,oEACA,wBACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,uBAAuB,mBAAA,gBAClC,wBACA,oEACA,wBACA,KACA,IACF;;;;;;;;;AAUA,IAAa,gCAAgC,mBAAA,gBAC3C,iCACA,0DACA,iCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,8DACA,qCACA,KACA,IACF;;;;;;;;;AAUA,IAAa,+BAA+B,mBAAA,gBAC1C,gCACA,yDACA,gCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,sBAAsB,mBAAA,gBACjC,uBACA,sEACA,uBACA,KACA,KACF;;;;;;;;;;;AAYA,IAAa,0BAA0B,mBAAA,gBACrC,2BACA,qDACA,2BACA,KACA,KACF;;;;;;;;;;;AAYA,IAAa,4BAA4B,mBAAA,gBACvC,6BACA,oFACA,6BACA,KACA,IACF;;;;;;;;;AAUA,IAAa,kCAAkC,mBAAA,gBAC7C,mCACA,6EACA,mCACA,KACA,IACF;;;;;;;;;;;AAYA,IAAa,qCAAqC,mBAAA,gBAChD,sCACA,sFACA,sCACA,KACA,KACF;;;;;;;;;;;;;;;AAgBA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,qFACA,qCACA,KACA,IACF;;;;;;;;;AAUA,IAAa,+BAA+B,mBAAA,gBAC1C,gCACA,gEACA,gCACA,KACA,IACF;;;;;;;;;;;;;AAcA,IAAa,4BAA4B,mBAAA,gBACvC,6BACA,mDACA,6BACA,KACA,KACF;;;;;;;;;;;AAYA,IAAa,iCAAiC,mBAAA,gBAC5C,kCACA,uDACA,kCACA,KACA,KACF"}