@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,232 @@
1
+ require("./chunk-KmRHZBOW.js");
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
+ require("./thought-DuN2PgdO.js");
6
+ require("./tool_call-DFgzcVcU.js");
7
+ require("./tool-COSeH8I6.js");
8
+ require("./spooled_artifact-Cm9Te22K.js");
9
+ require("./spooled_markdown_artifact-RRB113sy.js");
10
+ let _nhtio_validation = require("@nhtio/validation");
11
+ //#region src/lib/classes/retrievable.ts
12
+ /**
13
+ * Validator schema used to validate a {@link RawRetrievable} before constructing a
14
+ * {@link Retrievable}.
15
+ *
16
+ * @remarks
17
+ * - `id` — required non-empty string.
18
+ * - `content` — required {@link @nhtio/adk!Tokenizable.schema}.
19
+ * - `trustTier` — required, one of `'first-party'`, `'third-party-public'`,
20
+ * `'third-party-private'`. Unknown / missing values reject.
21
+ * - `source` / `kind` — optional strings.
22
+ * - `score` — optional number in `[0, 1]`.
23
+ * - `createdAt` / `updatedAt` — required datetime-parseable values.
24
+ *
25
+ * Throws {@link @nhtio/adk/exceptions!E_INVALID_INITIAL_RETRIEVABLE_VALUE} (via the {@link Retrievable} constructor)
26
+ * when validation fails.
27
+ */
28
+ var rawRetrievableSchema = _nhtio_validation.validator.object({
29
+ id: _nhtio_validation.validator.string().required(),
30
+ content: require_tool_registry.Tokenizable.schema.required(),
31
+ trustTier: _nhtio_validation.validator.string().valid("first-party", "third-party-public", "third-party-private").required(),
32
+ source: _nhtio_validation.validator.string().optional(),
33
+ kind: _nhtio_validation.validator.string().optional(),
34
+ score: _nhtio_validation.validator.number().min(0).max(1).optional(),
35
+ createdAt: _nhtio_validation.validator.datetime().required(),
36
+ updatedAt: _nhtio_validation.validator.datetime().required()
37
+ });
38
+ /**
39
+ * An immutable, validated retrieved record (RAG content) held by the agent.
40
+ *
41
+ * @remarks
42
+ * Peer of {@link @nhtio/adk!Memory} / `Message` / `Thought` / `ToolCall`. Carries an explicit `trustTier`
43
+ * that LLM batteries branch on to choose the rendering envelope. The retrieval middleware that
44
+ * produced the record is the only party that knows its provenance — batteries MUST NOT
45
+ * auto-classify or infer the tier from `source`.
46
+ */
47
+ var Retrievable = class Retrievable {
48
+ /**
49
+ * Validator schema that accepts a {@link RawRetrievable} object.
50
+ *
51
+ * @remarks
52
+ * Reusable fragment for any schema that needs to validate or nest a retrievable record.
53
+ */
54
+ static schema = rawRetrievableSchema;
55
+ /**
56
+ * Returns `true` if `value` is a {@link Retrievable} instance.
57
+ *
58
+ * @remarks
59
+ * Uses {@link @nhtio/adk!isInstanceOf} for cross-realm safety.
60
+ */
61
+ static isRetrievable(value) {
62
+ return require_tool_registry.isInstanceOf(value, "Retrievable", Retrievable);
63
+ }
64
+ #id;
65
+ #content;
66
+ #trustTier;
67
+ #source;
68
+ #kind;
69
+ #score;
70
+ #createdAt;
71
+ #updatedAt;
72
+ /**
73
+ * @param raw - The raw retrievable input validated against `rawRetrievableSchema`.
74
+ * @throws {@link @nhtio/adk/exceptions!E_INVALID_INITIAL_RETRIEVABLE_VALUE} when `raw` does not satisfy the schema.
75
+ */
76
+ constructor(raw) {
77
+ let resolved;
78
+ try {
79
+ resolved = require_exceptions.validateOrThrow(rawRetrievableSchema, raw, true);
80
+ } catch (err) {
81
+ throw new require_runtime.E_INVALID_INITIAL_RETRIEVABLE_VALUE({ cause: require_tool_registry.isError(err) ? err : void 0 });
82
+ }
83
+ this.#id = resolved.id;
84
+ this.#content = require_tool_registry.Tokenizable.isTokenizable(resolved.content) ? resolved.content : new require_tool_registry.Tokenizable(resolved.content);
85
+ this.#trustTier = resolved.trustTier;
86
+ this.#source = resolved.source;
87
+ this.#kind = resolved.kind;
88
+ this.#score = resolved.score;
89
+ this.#createdAt = resolved.createdAt;
90
+ this.#updatedAt = resolved.updatedAt;
91
+ Object.defineProperties(this, {
92
+ id: {
93
+ get: () => this.#id,
94
+ enumerable: true,
95
+ configurable: false
96
+ },
97
+ content: {
98
+ get: () => this.#content,
99
+ enumerable: true,
100
+ configurable: false
101
+ },
102
+ trustTier: {
103
+ get: () => this.#trustTier,
104
+ enumerable: true,
105
+ configurable: false
106
+ },
107
+ source: {
108
+ get: () => this.#source,
109
+ enumerable: true,
110
+ configurable: false
111
+ },
112
+ kind: {
113
+ get: () => this.#kind,
114
+ enumerable: true,
115
+ configurable: false
116
+ },
117
+ score: {
118
+ get: () => this.#score,
119
+ enumerable: true,
120
+ configurable: false
121
+ },
122
+ createdAt: {
123
+ get: () => this.#createdAt,
124
+ enumerable: true,
125
+ configurable: false
126
+ },
127
+ updatedAt: {
128
+ get: () => this.#updatedAt,
129
+ enumerable: true,
130
+ configurable: false
131
+ }
132
+ });
133
+ }
134
+ };
135
+ //#endregion
136
+ //#region src/lib/helpers/media_readers.ts
137
+ /**
138
+ * Constructs a {@link @nhtio/adk!MediaReader} backed by an in-memory `Uint8Array`.
139
+ *
140
+ * @remarks
141
+ * Each `stream()` call returns a fresh single-chunk `ReadableStream` over the same buffer. The
142
+ * reader is re-openable by construction — call `stream()` as many times as needed.
143
+ *
144
+ * @param bytes - The buffer to serve.
145
+ * @returns A {@link @nhtio/adk!MediaReader} that re-reads `bytes` on every call.
146
+ */
147
+ var inMemoryMediaReader = (bytes) => {
148
+ return {
149
+ stream() {
150
+ return new ReadableStream({ start(controller) {
151
+ controller.enqueue(bytes);
152
+ controller.close();
153
+ } });
154
+ },
155
+ byteLength() {
156
+ return bytes.byteLength;
157
+ }
158
+ };
159
+ };
160
+ /**
161
+ * Constructs a {@link @nhtio/adk!MediaReader} backed by a fetch call.
162
+ *
163
+ * @remarks
164
+ * Each `stream()` call re-issues the fetch. Tool authors whose underlying source is rate-limited
165
+ * or expensive must cache locally before constructing the reader — the framework cannot make
166
+ * that decision for them.
167
+ *
168
+ * `byteLength()` returns `undefined` because most remote sources do not promise it without an
169
+ * extra HEAD request; consumers that need a byte size should resolve it out-of-band.
170
+ *
171
+ * @param url - The URL to fetch on each call.
172
+ * @param init - Optional `fetch` init forwarded verbatim.
173
+ * @returns A {@link @nhtio/adk!MediaReader} that re-issues `fetch(url, init)` on every call.
174
+ */
175
+ var fromFetch = (url, init) => {
176
+ return {
177
+ async stream() {
178
+ const response = await fetch(url, init);
179
+ if (!response.ok) throw new Error(`fromFetch: fetch failed with status ${response.status}`);
180
+ if (!response.body) throw new Error("fromFetch: response has no body");
181
+ return response.body;
182
+ },
183
+ byteLength() {}
184
+ };
185
+ };
186
+ /**
187
+ * Constructs a {@link @nhtio/adk!MediaReader} backed by a browser `File` or `Blob`.
188
+ *
189
+ * @remarks
190
+ * Each `stream()` call re-streams the underlying File via `File.stream()`. `byteLength()`
191
+ * resolves from `file.size`.
192
+ *
193
+ * @param file - The browser `File` or `Blob` to stream.
194
+ * @returns A {@link @nhtio/adk!MediaReader} that re-streams `file` on every call.
195
+ */
196
+ var fromWebFile = (file) => {
197
+ return {
198
+ stream() {
199
+ return file.stream();
200
+ },
201
+ byteLength() {
202
+ return file.size;
203
+ }
204
+ };
205
+ };
206
+ //#endregion
207
+ Object.defineProperty(exports, "Retrievable", {
208
+ enumerable: true,
209
+ get: function() {
210
+ return Retrievable;
211
+ }
212
+ });
213
+ Object.defineProperty(exports, "fromFetch", {
214
+ enumerable: true,
215
+ get: function() {
216
+ return fromFetch;
217
+ }
218
+ });
219
+ Object.defineProperty(exports, "fromWebFile", {
220
+ enumerable: true,
221
+ get: function() {
222
+ return fromWebFile;
223
+ }
224
+ });
225
+ Object.defineProperty(exports, "inMemoryMediaReader", {
226
+ enumerable: true,
227
+ get: function() {
228
+ return inMemoryMediaReader;
229
+ }
230
+ });
231
+
232
+ //# sourceMappingURL=common-Od8edUXU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-Od8edUXU.js","names":["#id","#content","#trustTier","#source","#kind","#score","#createdAt","#updatedAt"],"sources":["../src/lib/classes/retrievable.ts","../src/lib/helpers/media_readers.ts"],"sourcesContent":["import { Tokenizable } from './tokenizable'\nimport { validator } from '@nhtio/validation'\nimport { validateOrThrow } from '../utils/validation'\nimport { isInstanceOf, isError } from '../utils/guards'\nimport { E_INVALID_INITIAL_RETRIEVABLE_VALUE } from '../exceptions/runtime'\nimport type { DateTime } from 'luxon'\n\n/**\n * Trust-tier discriminator declared by the retrieval middleware at construction time. Drives\n * which envelope the LLM battery wraps the record in.\n *\n * @remarks\n * Vocabulary deliberately mirrors the published security-research taxonomy (\"first-party /\n * third-party\" per *Hidden-in-Plain-Text* WWW '26 and *When AI Meets the Web* IEEE S&P 2026)\n * and explicitly avoids the words \"user\" or \"system\" so the names cannot leak into the model's\n * OpenAI-Model-Spec role-tier authority resolution.\n *\n * - `'first-party'` — deployer-vetted corpora (signed internal docs, policy KBs, curated\n * reference material). Rendered as a `<retrieved_corpus>` parent with per-record nonce-keyed\n * `<retrieved>` children. The label \"first-party\" never appears in the envelope itself.\n * - `'third-party-public'` — open-web scrapes, search results, public APIs. Rendered through\n * the untrusted-content envelope with `kind: 'retrieved-third-party-public'`.\n * - `'third-party-private'` — user uploads, pasted attachments, partner APIs. Rendered through\n * the untrusted-content envelope with `kind: 'retrieved-third-party-private'`.\n */\nexport type RetrievableTrustTier = 'first-party' | 'third-party-public' | 'third-party-private'\n\n/**\n * Plain input object supplied to {@link Retrievable} at construction time.\n *\n * @remarks\n * Validated against `rawRetrievableSchema` before the `Retrievable` instance is created.\n * Temporal fields accept any value that Luxon can parse — ISO strings, Unix timestamps,\n * `Date` objects, or existing `DateTime` instances.\n */\nexport interface RawRetrievable {\n /**\n * Stable unique identifier for this retrieved record. Used as the closing-tag nonce in the\n * rendered envelope, so it must be unguessable from the payload.\n */\n id: string\n /** The retrieved content as a plain string or an existing {@link @nhtio/adk!Tokenizable} instance. */\n content: string | Tokenizable\n /**\n * Trust tier declared by the retrieval middleware at construction time. Required — there is\n * NO default. The decision must be conscious. See {@link RetrievableTrustTier}.\n */\n trustTier: RetrievableTrustTier\n /** Optional provenance string: URL, document path, knowledge-base id, etc. */\n source?: string\n /** Optional semantic label: 'policy' | 'reference' | 'web-page' | 'pdf' | etc. */\n kind?: string\n /** Optional relevance / similarity score in `[0, 1]` from the retrieval middleware. */\n score?: number\n /** When the source record was created (publication date, upload date, etc.). */\n createdAt: string | number | Date | DateTime\n /** When the source record was last modified. */\n updatedAt: string | number | Date | DateTime\n}\n\n/**\n * A fully-resolved {@link RawRetrievable} where all fields have been validated and temporal\n * values normalised to Luxon `DateTime` instances.\n */\ninterface ResolvedRetrievable {\n id: string\n content: Tokenizable\n trustTier: RetrievableTrustTier\n source?: string\n kind?: string\n score?: number\n createdAt: DateTime\n updatedAt: DateTime\n}\n\n/**\n * Validator schema used to validate a {@link RawRetrievable} before constructing a\n * {@link Retrievable}.\n *\n * @remarks\n * - `id` — required non-empty string.\n * - `content` — required {@link @nhtio/adk!Tokenizable.schema}.\n * - `trustTier` — required, one of `'first-party'`, `'third-party-public'`,\n * `'third-party-private'`. Unknown / missing values reject.\n * - `source` / `kind` — optional strings.\n * - `score` — optional number in `[0, 1]`.\n * - `createdAt` / `updatedAt` — required datetime-parseable values.\n *\n * Throws {@link @nhtio/adk/exceptions!E_INVALID_INITIAL_RETRIEVABLE_VALUE} (via the {@link Retrievable} constructor)\n * when validation fails.\n */\nconst rawRetrievableSchema = validator.object<RawRetrievable>({\n id: validator.string().required(),\n content: Tokenizable.schema.required(),\n trustTier: validator\n .string()\n .valid('first-party', 'third-party-public', 'third-party-private')\n .required(),\n source: validator.string().optional(),\n kind: validator.string().optional(),\n score: validator.number().min(0).max(1).optional(),\n createdAt: validator.datetime().required(),\n updatedAt: validator.datetime().required(),\n})\n\n/**\n * An immutable, validated retrieved record (RAG content) held by the agent.\n *\n * @remarks\n * Peer of {@link @nhtio/adk!Memory} / `Message` / `Thought` / `ToolCall`. Carries an explicit `trustTier`\n * that LLM batteries branch on to choose the rendering envelope. The retrieval middleware that\n * produced the record is the only party that knows its provenance — batteries MUST NOT\n * auto-classify or infer the tier from `source`.\n */\nexport class Retrievable {\n /**\n * Validator schema that accepts a {@link RawRetrievable} object.\n *\n * @remarks\n * Reusable fragment for any schema that needs to validate or nest a retrievable record.\n */\n public static schema = rawRetrievableSchema\n\n /**\n * Returns `true` if `value` is a {@link Retrievable} instance.\n *\n * @remarks\n * Uses {@link @nhtio/adk!isInstanceOf} for cross-realm safety.\n */\n public static isRetrievable(value: unknown): value is Retrievable {\n return isInstanceOf(value, 'Retrievable', Retrievable)\n }\n\n /** Stable unique identifier for this retrieved record. */\n declare readonly id: string\n /** The retrieved content as a {@link @nhtio/adk!Tokenizable} for inline token estimation. */\n declare readonly content: Tokenizable\n /** Trust tier declared by the retrieval middleware. */\n declare readonly trustTier: RetrievableTrustTier\n /** Optional provenance string. */\n declare readonly source: string | undefined\n /** Optional semantic label. */\n declare readonly kind: string | undefined\n /** Optional relevance / similarity score in `[0, 1]`. */\n declare readonly score: number | undefined\n /** When the source record was created. */\n declare readonly createdAt: DateTime\n /** When the source record was last modified. */\n declare readonly updatedAt: DateTime\n\n #id: string\n #content: Tokenizable\n #trustTier: RetrievableTrustTier\n #source: string | undefined\n #kind: string | undefined\n #score: number | undefined\n #createdAt: DateTime\n #updatedAt: DateTime\n\n /**\n * @param raw - The raw retrievable input validated against `rawRetrievableSchema`.\n * @throws {@link @nhtio/adk/exceptions!E_INVALID_INITIAL_RETRIEVABLE_VALUE} when `raw` does not satisfy the schema.\n */\n constructor(raw: RawRetrievable) {\n let resolved: ResolvedRetrievable\n try {\n resolved = validateOrThrow<ResolvedRetrievable>(rawRetrievableSchema, raw, true)\n } catch (err) {\n throw new E_INVALID_INITIAL_RETRIEVABLE_VALUE({ cause: isError(err) ? err : undefined })\n }\n this.#id = resolved.id\n this.#content = Tokenizable.isTokenizable(resolved.content)\n ? resolved.content\n : new Tokenizable(resolved.content)\n this.#trustTier = resolved.trustTier\n this.#source = resolved.source\n this.#kind = resolved.kind\n this.#score = resolved.score\n this.#createdAt = resolved.createdAt\n this.#updatedAt = resolved.updatedAt\n\n Object.defineProperties(this, {\n id: {\n get: () => this.#id,\n enumerable: true,\n configurable: false,\n },\n content: {\n get: () => this.#content,\n enumerable: true,\n configurable: false,\n },\n trustTier: {\n get: () => this.#trustTier,\n enumerable: true,\n configurable: false,\n },\n source: {\n get: () => this.#source,\n enumerable: true,\n configurable: false,\n },\n kind: {\n get: () => this.#kind,\n enumerable: true,\n configurable: false,\n },\n score: {\n get: () => this.#score,\n enumerable: true,\n configurable: false,\n },\n createdAt: {\n get: () => this.#createdAt,\n enumerable: true,\n configurable: false,\n },\n updatedAt: {\n get: () => this.#updatedAt,\n enumerable: true,\n configurable: false,\n },\n })\n }\n}\n","import type { MediaReader } from '../contracts/media_reader'\n\n/**\n * Constructs a {@link @nhtio/adk!MediaReader} backed by an in-memory `Uint8Array`.\n *\n * @remarks\n * Each `stream()` call returns a fresh single-chunk `ReadableStream` over the same buffer. The\n * reader is re-openable by construction — call `stream()` as many times as needed.\n *\n * @param bytes - The buffer to serve.\n * @returns A {@link @nhtio/adk!MediaReader} that re-reads `bytes` on every call.\n */\nexport const inMemoryMediaReader = (bytes: Uint8Array): MediaReader => {\n return {\n stream(): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n start(controller) {\n controller.enqueue(bytes)\n controller.close()\n },\n })\n },\n byteLength(): number {\n return bytes.byteLength\n },\n }\n}\n\n/**\n * Constructs a {@link @nhtio/adk!MediaReader} backed by a fetch call.\n *\n * @remarks\n * Each `stream()` call re-issues the fetch. Tool authors whose underlying source is rate-limited\n * or expensive must cache locally before constructing the reader — the framework cannot make\n * that decision for them.\n *\n * `byteLength()` returns `undefined` because most remote sources do not promise it without an\n * extra HEAD request; consumers that need a byte size should resolve it out-of-band.\n *\n * @param url - The URL to fetch on each call.\n * @param init - Optional `fetch` init forwarded verbatim.\n * @returns A {@link @nhtio/adk!MediaReader} that re-issues `fetch(url, init)` on every call.\n */\nexport const fromFetch = (url: string | URL, init?: RequestInit): MediaReader => {\n return {\n async stream(): Promise<ReadableStream<Uint8Array>> {\n const response = await fetch(url, init)\n if (!response.ok) {\n throw new Error(`fromFetch: fetch failed with status ${response.status}`)\n }\n if (!response.body) {\n throw new Error('fromFetch: response has no body')\n }\n return response.body as ReadableStream<Uint8Array>\n },\n byteLength(): undefined {\n return undefined\n },\n }\n}\n\n/**\n * Constructs a {@link @nhtio/adk!MediaReader} backed by a browser `File` or `Blob`.\n *\n * @remarks\n * Each `stream()` call re-streams the underlying File via `File.stream()`. `byteLength()`\n * resolves from `file.size`.\n *\n * @param file - The browser `File` or `Blob` to stream.\n * @returns A {@link @nhtio/adk!MediaReader} that re-streams `file` on every call.\n */\nexport const fromWebFile = (file: Blob): MediaReader => {\n return {\n stream(): ReadableStream<Uint8Array> {\n return file.stream() as ReadableStream<Uint8Array>\n },\n byteLength(): number {\n return file.size\n },\n }\n}\n"],"mappings":"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"}
package/common.cjs ADDED
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tool_registry = require("./tool_registry-Dkfprsck.js");
3
+ const require_thought = require("./thought-DuN2PgdO.js");
4
+ const require_common = require("./common-Od8edUXU.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
+ exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
10
+ exports.Identity = require_thought.Identity;
11
+ exports.Media = require_tool_call.Media;
12
+ exports.Memory = require_thought.Memory;
13
+ exports.Message = require_thought.Message;
14
+ exports.Registry = require_tool_registry.Registry;
15
+ exports.Retrievable = require_common.Retrievable;
16
+ exports.SpooledArtifact = require_spooled_artifact.SpooledArtifact;
17
+ exports.SpooledJsonArtifact = require_spooled_markdown_artifact.SpooledJsonArtifact;
18
+ exports.SpooledMarkdownArtifact = require_spooled_markdown_artifact.SpooledMarkdownArtifact;
19
+ exports.Thought = require_thought.Thought;
20
+ exports.TokenEncoding = require_tool_registry.TokenEncoding;
21
+ exports.Tokenizable = require_tool_registry.Tokenizable;
22
+ exports.Tool = require_tool.Tool;
23
+ exports.ToolCall = require_tool_call.ToolCall;
24
+ exports.ToolRegistry = require_tool_registry.ToolRegistry;
25
+ exports.fromFetch = require_common.fromFetch;
26
+ exports.fromWebFile = require_common.fromWebFile;
27
+ exports.implementsMediaReader = require_tool_call.implementsMediaReader;
28
+ exports.implementsSpoolReader = require_spooled_artifact.implementsSpoolReader;
29
+ exports.inMemoryMediaReader = require_common.inMemoryMediaReader;
30
+ exports.isMedia = require_tool_call.isMedia;
31
+ exports.mediaReaderSchema = require_tool_call.mediaReaderSchema;
package/common.d.ts ADDED
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Core value classes, runtime primitives, media helpers, and their companion input types.
3
+ *
4
+ * @module @nhtio/adk/common
5
+ *
6
+ * @remarks
7
+ * A convenience barrel that re-exports the data primitives most consumers reach for: the
8
+ * value classes ({@link @nhtio/adk!Tokenizable}, {@link @nhtio/adk!Registry}, {@link @nhtio/adk!Identity}, {@link @nhtio/adk!Memory},
9
+ * {@link @nhtio/adk!Message}, {@link @nhtio/adk!Thought}, {@link @nhtio/adk!ToolCall}, {@link @nhtio/adk!Tool}, {@link @nhtio/adk!ToolRegistry},
10
+ * and the spooled artifact family) plus their `Raw*` constructor inputs and small companion
11
+ * types. {@link @nhtio/adk!TurnGate} is exported as a **type only** — it is constructed internally by the
12
+ * runner and only surfaced to observers, never instantiated by user code.
13
+ *
14
+ * Use this barrel when you want one import for the everyday primitives without pulling the
15
+ * runners or context surfaces. Per-class barrels remain available when you want narrower imports.
16
+ */
17
+ /**
18
+ * @primaryExport
19
+ */
20
+ export { Tokenizable, TokenEncoding } from "./lib/classes/tokenizable";
21
+ /**
22
+ * @primaryExport
23
+ */
24
+ export { Registry } from "./lib/classes/registry";
25
+ /**
26
+ * @primaryExport
27
+ */
28
+ export { Identity } from "./lib/classes/identity";
29
+ /**
30
+ * @primaryExport
31
+ */
32
+ export type { RawIdentity } from "./lib/classes/identity";
33
+ /**
34
+ * @primaryExport
35
+ */
36
+ export { Memory } from "./lib/classes/memory";
37
+ /**
38
+ * @primaryExport
39
+ */
40
+ export type { RawMemory } from "./lib/classes/memory";
41
+ /**
42
+ * @primaryExport
43
+ */
44
+ export { Retrievable } from "./lib/classes/retrievable";
45
+ /**
46
+ * @primaryExport
47
+ */
48
+ export type { RawRetrievable, RetrievableTrustTier } from "./lib/classes/retrievable";
49
+ /**
50
+ * @primaryExport
51
+ */
52
+ export { Message } from "./lib/classes/message";
53
+ /**
54
+ * @primaryExport
55
+ */
56
+ export type { RawMessage, MessageRole } from "./lib/classes/message";
57
+ /**
58
+ * @primaryExport
59
+ */
60
+ export { Thought } from "./lib/classes/thought";
61
+ /**
62
+ * @primaryExport
63
+ */
64
+ export type { RawThought } from "./lib/classes/thought";
65
+ export { ToolCall } from "./lib/classes/tool_call";
66
+ export type { RawToolCall, ToolCallResults } from "./lib/classes/tool_call";
67
+ export { Tool } from "./lib/classes/tool";
68
+ export type { RawTool, ToolHandler } from "./lib/classes/tool";
69
+ export type { SpooledArtifactConstructor, ToolMethodDescriptor, } from "./lib/classes/spooled_artifact";
70
+ export { ArtifactTool } from "./lib/classes/artifact_tool";
71
+ export type { RawArtifactTool, ArtifactToolHandler } from "./lib/classes/artifact_tool";
72
+ export { ToolRegistry } from "./lib/classes/tool_registry";
73
+ export type { MergeOptions } from "./lib/classes/tool_registry";
74
+ /**
75
+ * @primaryExport
76
+ */
77
+ export type { TurnGate } from "./lib/classes/turn_gate";
78
+ /**
79
+ * @primaryExport
80
+ */
81
+ export type { RawTurnGate } from "./lib/classes/turn_gate";
82
+ export { SpooledArtifact } from "./lib/classes/spooled_artifact";
83
+ export { implementsSpoolReader } from "./lib/contracts/spool_reader";
84
+ export type { SpoolReader } from "./lib/contracts/spool_reader";
85
+ /**
86
+ * @primaryExport
87
+ */
88
+ export { Media, isMedia } from "./lib/classes/media";
89
+ /**
90
+ * @primaryExport
91
+ */
92
+ export type { RawMedia, SerializedMedia, MediaKind, MediaTrustTier, MediaModalityHazard, MediaStashEntry, } from "./lib/classes/media";
93
+ /**
94
+ * @primaryExport
95
+ */
96
+ export { implementsMediaReader, mediaReaderSchema } from "./lib/contracts/media_reader";
97
+ /**
98
+ * @primaryExport
99
+ */
100
+ export type { MediaReader } from "./lib/contracts/media_reader";
101
+ /**
102
+ * @primaryExport
103
+ */
104
+ export { inMemoryMediaReader, fromFetch, fromWebFile } from "./lib/helpers/media_readers";
105
+ export { SpooledJsonArtifact } from "./lib/classes/spooled_json_artifact";
106
+ export type { JsonArtifactFormat } from "./lib/classes/spooled_json_artifact";
107
+ export { SpooledMarkdownArtifact } from "./lib/classes/spooled_markdown_artifact";
108
+ export type { MarkdownHeadingEntry, MarkdownCodeEntry, MarkdownSection, } from "./lib/classes/spooled_markdown_artifact";
package/common.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import { a as Tokenizable, i as TokenEncoding, r as Registry, t as ToolRegistry } from "./tool_registry-DqLOyGyG.mjs";
2
+ import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-CDb457b4.mjs";
3
+ import { i as Retrievable, n as fromWebFile, r as inMemoryMediaReader, t as fromFetch } from "./common-DeZaonK1.mjs";
4
+ import { a as mediaReaderSchema, i as implementsMediaReader, n as Media, r as isMedia, 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
+ export { ArtifactTool, Identity, Media, Memory, Message, Registry, Retrievable, SpooledArtifact, SpooledJsonArtifact, SpooledMarkdownArtifact, Thought, TokenEncoding, Tokenizable, Tool, ToolCall, ToolRegistry, fromFetch, fromWebFile, implementsMediaReader, implementsSpoolReader, inMemoryMediaReader, isMedia, mediaReaderSchema };