toolcraft 0.0.749 → 0.0.750

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 (374) hide show
  1. package/composition.json +23 -3
  2. package/dist/composition.json +23 -3
  3. package/dist/human-in-loop/approvals-commands.d.ts +1 -1
  4. package/dist/index.d.ts +1 -262
  5. package/dist/index.js +1 -573
  6. package/dist/runtime-platform.d.ts +2 -0
  7. package/dist/runtime-platform.js +2 -0
  8. package/dist/runtime-platform.workerd.d.ts +3 -0
  9. package/dist/runtime-platform.workerd.js +10 -0
  10. package/dist/runtime.d.ts +262 -0
  11. package/dist/runtime.js +576 -0
  12. package/node_modules/@noble/hashes/LICENSE +21 -0
  13. package/node_modules/@noble/hashes/README.md +478 -0
  14. package/node_modules/@noble/hashes/_blake.d.ts +20 -0
  15. package/node_modules/@noble/hashes/_blake.js +59 -0
  16. package/node_modules/@noble/hashes/_md.d.ts +95 -0
  17. package/node_modules/@noble/hashes/_md.js +209 -0
  18. package/node_modules/@noble/hashes/_u64.d.ts +36 -0
  19. package/node_modules/@noble/hashes/_u64.js +77 -0
  20. package/node_modules/@noble/hashes/argon2.d.ts +148 -0
  21. package/node_modules/@noble/hashes/argon2.js +577 -0
  22. package/node_modules/@noble/hashes/blake1.d.ts +162 -0
  23. package/node_modules/@noble/hashes/blake1.js +630 -0
  24. package/node_modules/@noble/hashes/blake2.d.ts +203 -0
  25. package/node_modules/@noble/hashes/blake2.js +573 -0
  26. package/node_modules/@noble/hashes/blake3.d.ts +68 -0
  27. package/node_modules/@noble/hashes/blake3.js +310 -0
  28. package/node_modules/@noble/hashes/eskdf.d.ts +91 -0
  29. package/node_modules/@noble/hashes/eskdf.js +225 -0
  30. package/node_modules/@noble/hashes/hkdf.d.ts +70 -0
  31. package/node_modules/@noble/hashes/hkdf.js +152 -0
  32. package/node_modules/@noble/hashes/hmac.d.ts +50 -0
  33. package/node_modules/@noble/hashes/hmac.js +93 -0
  34. package/node_modules/@noble/hashes/index.d.ts +1 -0
  35. package/node_modules/@noble/hashes/index.js +34 -0
  36. package/node_modules/@noble/hashes/legacy.d.ts +107 -0
  37. package/node_modules/@noble/hashes/legacy.js +348 -0
  38. package/node_modules/@noble/hashes/package.json +91 -0
  39. package/node_modules/@noble/hashes/pbkdf2.d.ts +66 -0
  40. package/node_modules/@noble/hashes/pbkdf2.js +176 -0
  41. package/node_modules/@noble/hashes/scrypt.d.ts +98 -0
  42. package/node_modules/@noble/hashes/scrypt.js +304 -0
  43. package/node_modules/@noble/hashes/sha2.d.ts +176 -0
  44. package/node_modules/@noble/hashes/sha2.js +446 -0
  45. package/node_modules/@noble/hashes/sha3-addons.d.ts +533 -0
  46. package/node_modules/@noble/hashes/sha3-addons.js +973 -0
  47. package/node_modules/@noble/hashes/sha3.d.ts +208 -0
  48. package/node_modules/@noble/hashes/sha3.js +475 -0
  49. package/node_modules/@noble/hashes/src/_blake.ts +67 -0
  50. package/node_modules/@noble/hashes/src/_md.ts +227 -0
  51. package/node_modules/@noble/hashes/src/_u64.ts +111 -0
  52. package/node_modules/@noble/hashes/src/argon2.ts +693 -0
  53. package/node_modules/@noble/hashes/src/blake1.ts +677 -0
  54. package/node_modules/@noble/hashes/src/blake2.ts +648 -0
  55. package/node_modules/@noble/hashes/src/blake3.ts +344 -0
  56. package/node_modules/@noble/hashes/src/eskdf.ts +265 -0
  57. package/node_modules/@noble/hashes/src/hkdf.ts +161 -0
  58. package/node_modules/@noble/hashes/src/hmac.ts +130 -0
  59. package/node_modules/@noble/hashes/src/index.ts +33 -0
  60. package/node_modules/@noble/hashes/src/legacy.ts +361 -0
  61. package/node_modules/@noble/hashes/src/pbkdf2.ts +219 -0
  62. package/node_modules/@noble/hashes/src/scrypt.ts +375 -0
  63. package/node_modules/@noble/hashes/src/sha2.ts +486 -0
  64. package/node_modules/@noble/hashes/src/sha3-addons.ts +1157 -0
  65. package/node_modules/@noble/hashes/src/sha3.ts +525 -0
  66. package/node_modules/@noble/hashes/src/utils.ts +978 -0
  67. package/node_modules/@noble/hashes/src/webcrypto.ts +283 -0
  68. package/node_modules/@noble/hashes/utils.d.ts +560 -0
  69. package/node_modules/@noble/hashes/utils.js +687 -0
  70. package/node_modules/@noble/hashes/webcrypto.d.ts +121 -0
  71. package/node_modules/@noble/hashes/webcrypto.js +228 -0
  72. package/node_modules/@poe-code/agent-mcp-config/dist/apply.js +23 -9
  73. package/node_modules/@poe-code/config-mutations/README.md +2 -0
  74. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +4 -5
  75. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +3 -4
  76. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +3 -3
  77. package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
  78. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +2 -2
  79. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +3 -6
  80. package/node_modules/@poe-code/config-mutations/dist/types.d.ts +4 -2
  81. package/node_modules/@poe-code/process-runner/README.md +2 -1
  82. package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.d.ts +1 -0
  83. package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.js +1 -0
  84. package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.d.ts +2 -0
  85. package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.js +1 -0
  86. package/node_modules/@poe-code/process-runner/dist/types.d.ts +1 -1
  87. package/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +6 -5
  88. package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +67 -29
  89. package/node_modules/@poe-code/process-runner/package.json +13 -0
  90. package/node_modules/@poe-code/safe-fs/LICENSE +21 -0
  91. package/node_modules/@poe-code/safe-fs/PROVENANCE.json +428 -0
  92. package/node_modules/@poe-code/safe-fs/README.md +411 -0
  93. package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.d.ts +3 -0
  94. package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.js +171 -0
  95. package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.d.ts +93 -0
  96. package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.js +453 -0
  97. package/node_modules/@poe-code/safe-fs/dist/bridge/index.d.ts +7 -0
  98. package/node_modules/@poe-code/safe-fs/dist/bridge/index.js +19 -0
  99. package/node_modules/@poe-code/safe-fs/dist/bridge/stats.d.ts +4 -0
  100. package/node_modules/@poe-code/safe-fs/dist/bridge/stats.js +37 -0
  101. package/node_modules/@poe-code/safe-fs/dist/bridge/types.d.ts +81 -0
  102. package/node_modules/@poe-code/safe-fs/dist/bridge/types.js +1 -0
  103. package/node_modules/@poe-code/safe-fs/dist/bridge/values.d.ts +6 -0
  104. package/node_modules/@poe-code/safe-fs/dist/bridge/values.js +65 -0
  105. package/node_modules/@poe-code/safe-fs/dist/config/memory.d.ts +3 -0
  106. package/node_modules/@poe-code/safe-fs/dist/config/memory.js +7 -0
  107. package/node_modules/@poe-code/safe-fs/dist/config/real.d.ts +5 -0
  108. package/node_modules/@poe-code/safe-fs/dist/config/real.js +16 -0
  109. package/node_modules/@poe-code/safe-fs/dist/config/registry.d.ts +2 -0
  110. package/node_modules/@poe-code/safe-fs/dist/config/registry.js +15 -0
  111. package/node_modules/@poe-code/safe-fs/dist/config.d.ts +15 -0
  112. package/node_modules/@poe-code/safe-fs/dist/config.js +46 -0
  113. package/node_modules/@poe-code/safe-fs/dist/config.node.d.ts +2 -0
  114. package/node_modules/@poe-code/safe-fs/dist/config.node.js +11 -0
  115. package/node_modules/@poe-code/safe-fs/dist/config.portable.d.ts +3 -0
  116. package/node_modules/@poe-code/safe-fs/dist/config.portable.js +9 -0
  117. package/node_modules/@poe-code/safe-fs/dist/contracts/abort.d.ts +5 -0
  118. package/node_modules/@poe-code/safe-fs/dist/contracts/abort.js +34 -0
  119. package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.d.ts +1 -0
  120. package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.js +9 -0
  121. package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.d.ts +38 -0
  122. package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.js +1 -0
  123. package/node_modules/@poe-code/safe-fs/dist/contracts/errors.d.ts +53 -0
  124. package/node_modules/@poe-code/safe-fs/dist/contracts/errors.js +99 -0
  125. package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.d.ts +379 -0
  126. package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.js +1 -0
  127. package/node_modules/@poe-code/safe-fs/dist/contracts/index.d.ts +6 -0
  128. package/node_modules/@poe-code/safe-fs/dist/contracts/index.js +6 -0
  129. package/node_modules/@poe-code/safe-fs/dist/contracts/io.d.ts +12 -0
  130. package/node_modules/@poe-code/safe-fs/dist/contracts/io.js +321 -0
  131. package/node_modules/@poe-code/safe-fs/dist/contracts/object.d.ts +134 -0
  132. package/node_modules/@poe-code/safe-fs/dist/contracts/object.js +97 -0
  133. package/node_modules/@poe-code/safe-fs/dist/contracts/path.d.ts +3 -0
  134. package/node_modules/@poe-code/safe-fs/dist/contracts/path.js +2 -0
  135. package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.d.ts +21 -0
  136. package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.js +78 -0
  137. package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.d.ts +15 -0
  138. package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.js +162 -0
  139. package/node_modules/@poe-code/safe-fs/dist/core.d.ts +19 -0
  140. package/node_modules/@poe-code/safe-fs/dist/core.js +17 -0
  141. package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.d.ts +10 -0
  142. package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.js +216 -0
  143. package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.d.ts +7 -0
  144. package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.js +19 -0
  145. package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.d.ts +21 -0
  146. package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.js +279 -0
  147. package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.d.ts +59 -0
  148. package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.js +875 -0
  149. package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.d.ts +7 -0
  150. package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.js +250 -0
  151. package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.d.ts +6 -0
  152. package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.js +136 -0
  153. package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.d.ts +3 -0
  154. package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.js +14 -0
  155. package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.d.ts +11 -0
  156. package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.js +13 -0
  157. package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.d.ts +186 -0
  158. package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.js +3771 -0
  159. package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.d.ts +26 -0
  160. package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +96 -0
  161. package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.d.ts +13 -0
  162. package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.js +26 -0
  163. package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.d.ts +15 -0
  164. package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.js +144 -0
  165. package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.d.ts +19 -0
  166. package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.js +118 -0
  167. package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.d.ts +6 -0
  168. package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.js +29 -0
  169. package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.d.ts +74 -0
  170. package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.js +1291 -0
  171. package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.d.ts +27 -0
  172. package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.js +287 -0
  173. package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +45 -0
  174. package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +531 -0
  175. package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.d.ts +87 -0
  176. package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.js +1185 -0
  177. package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.d.ts +42 -0
  178. package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.js +558 -0
  179. package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.d.ts +4 -0
  180. package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.js +63 -0
  181. package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.d.ts +12 -0
  182. package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.js +520 -0
  183. package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.d.ts +37 -0
  184. package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.js +208 -0
  185. package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.d.ts +1 -0
  186. package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.js +8 -0
  187. package/node_modules/@poe-code/safe-fs/dist/fs/real/index.d.ts +105 -0
  188. package/node_modules/@poe-code/safe-fs/dist/fs/real/index.js +1259 -0
  189. package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.d.ts +7 -0
  190. package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.js +38 -0
  191. package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.d.ts +130 -0
  192. package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.js +1137 -0
  193. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.d.ts +1 -0
  194. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.js +9 -0
  195. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.d.ts +2 -0
  196. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.js +1 -0
  197. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.d.ts +15 -0
  198. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.js +74 -0
  199. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.d.ts +4 -0
  200. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.js +111 -0
  201. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.d.ts +17 -0
  202. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.js +89 -0
  203. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.d.ts +20 -0
  204. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.js +76 -0
  205. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.d.ts +3 -0
  206. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.js +478 -0
  207. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.d.ts +30 -0
  208. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.js +1 -0
  209. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.d.ts +14 -0
  210. package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.js +192 -0
  211. package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.d.ts +8 -0
  212. package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.js +4 -0
  213. package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.d.ts +2 -0
  214. package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.js +11 -0
  215. package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.d.ts +8 -0
  216. package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.js +167 -0
  217. package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.d.ts +48 -0
  218. package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.js +249 -0
  219. package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.d.ts +13 -0
  220. package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.js +400 -0
  221. package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.d.ts +10 -0
  222. package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.js +73 -0
  223. package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.d.ts +103 -0
  224. package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.js +28 -0
  225. package/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +19 -0
  226. package/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +663 -0
  227. package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.d.ts +8 -0
  228. package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.js +115 -0
  229. package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.d.ts +5 -0
  230. package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.js +63 -0
  231. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.d.ts +2 -0
  232. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.js +1 -0
  233. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.d.ts +18 -0
  234. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.js +109 -0
  235. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.d.ts +141 -0
  236. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.js +1377 -0
  237. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.d.ts +15 -0
  238. package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.js +59 -0
  239. package/node_modules/@poe-code/safe-fs/dist/index.d.ts +25 -0
  240. package/node_modules/@poe-code/safe-fs/dist/index.js +21 -0
  241. package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/linux-x64-glibc.node +0 -0
  242. package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.d.ts +5 -0
  243. package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.mjs +120 -0
  244. package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/manifest.json +46 -0
  245. package/node_modules/@poe-code/safe-fs/dist/node/filesystem.d.ts +19 -0
  246. package/node_modules/@poe-code/safe-fs/dist/node/filesystem.js +30 -0
  247. package/node_modules/@poe-code/safe-fs/dist/node/host.d.ts +3 -0
  248. package/node_modules/@poe-code/safe-fs/dist/node/host.js +78 -0
  249. package/node_modules/@poe-code/safe-fs/dist/node/index.d.ts +3 -0
  250. package/node_modules/@poe-code/safe-fs/dist/node/index.js +2 -0
  251. package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.d.ts +1 -0
  252. package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.js +5 -0
  253. package/node_modules/@poe-code/safe-fs/dist/node/native-seek.d.ts +3 -0
  254. package/node_modules/@poe-code/safe-fs/dist/node/native-seek.js +54 -0
  255. package/node_modules/@poe-code/safe-fs/dist/node/stats.d.ts +1 -0
  256. package/node_modules/@poe-code/safe-fs/dist/node/stats.js +1 -0
  257. package/node_modules/@poe-code/safe-fs/dist/node/values.d.ts +1 -0
  258. package/node_modules/@poe-code/safe-fs/dist/node/values.js +1 -0
  259. package/node_modules/@poe-code/safe-fs/dist/node-host.d.ts +1 -0
  260. package/node_modules/@poe-code/safe-fs/dist/node-host.js +1 -0
  261. package/node_modules/@poe-code/safe-fs/dist/node-unavailable.d.ts +1 -0
  262. package/node_modules/@poe-code/safe-fs/dist/node-unavailable.js +1 -0
  263. package/node_modules/@poe-code/safe-fs/dist/package.json +29 -0
  264. package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.d.ts +1 -0
  265. package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.js +1 -0
  266. package/node_modules/@poe-code/safe-fs/dist/platform/browser.d.ts +26 -0
  267. package/node_modules/@poe-code/safe-fs/dist/platform/browser.js +58 -0
  268. package/node_modules/@poe-code/safe-fs/dist/platform/node-path.d.ts +1 -0
  269. package/node_modules/@poe-code/safe-fs/dist/platform/node-path.js +1 -0
  270. package/node_modules/@poe-code/safe-fs/dist/platform/node.d.ts +26 -0
  271. package/node_modules/@poe-code/safe-fs/dist/platform/node.js +64 -0
  272. package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.d.ts +9 -0
  273. package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.js +17 -0
  274. package/node_modules/@poe-code/safe-fs/dist/python/emscripten.d.ts +15 -0
  275. package/node_modules/@poe-code/safe-fs/dist/python/emscripten.js +357 -0
  276. package/node_modules/@poe-code/safe-fs/dist/python/filesystem.d.ts +51 -0
  277. package/node_modules/@poe-code/safe-fs/dist/python/filesystem.js +243 -0
  278. package/node_modules/@poe-code/safe-fs/dist/python/flags.d.ts +3 -0
  279. package/node_modules/@poe-code/safe-fs/dist/python/flags.js +14 -0
  280. package/node_modules/@poe-code/safe-fs/dist/python/index.d.ts +9 -0
  281. package/node_modules/@poe-code/safe-fs/dist/python/index.js +5 -0
  282. package/node_modules/@poe-code/safe-fs/dist/python/native.d.ts +18 -0
  283. package/node_modules/@poe-code/safe-fs/dist/python/native.js +446 -0
  284. package/node_modules/@poe-code/safe-fs/dist/python/request.d.ts +2 -0
  285. package/node_modules/@poe-code/safe-fs/dist/python/request.js +61 -0
  286. package/node_modules/@poe-code/safe-fs/dist/python/stat.d.ts +8 -0
  287. package/node_modules/@poe-code/safe-fs/dist/python/stat.js +34 -0
  288. package/node_modules/@poe-code/safe-fs/dist/runtime-core.d.ts +27 -0
  289. package/node_modules/@poe-code/safe-fs/dist/runtime-core.js +57 -0
  290. package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.d.ts +16 -0
  291. package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.js +496 -0
  292. package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.d.ts +23 -0
  293. package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.js +39 -0
  294. package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.d.ts +31 -0
  295. package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.js +143 -0
  296. package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.d.ts +19 -0
  297. package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.js +209 -0
  298. package/node_modules/@poe-code/safe-fs/dist/xml.d.ts +1 -0
  299. package/node_modules/@poe-code/safe-fs/dist/xml.js +1 -0
  300. package/node_modules/@poe-code/safe-fs/package.json +189 -0
  301. package/node_modules/@poe-code/task-list/README.md +2 -0
  302. package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +1 -1
  303. package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +11 -4
  304. package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +2 -2
  305. package/node_modules/@poe-code/task-list/dist/backends/utils.js +5 -7
  306. package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +1 -1
  307. package/node_modules/@poe-code/task-list/dist/default-host.d.ts +2 -0
  308. package/node_modules/@poe-code/task-list/dist/default-host.js +2 -0
  309. package/node_modules/@poe-code/task-list/dist/default-host.workerd.d.ts +4 -0
  310. package/node_modules/@poe-code/task-list/dist/default-host.workerd.js +6 -0
  311. package/node_modules/@poe-code/task-list/dist/filesystem.d.ts +3 -0
  312. package/node_modules/@poe-code/task-list/dist/filesystem.js +32 -0
  313. package/node_modules/@poe-code/task-list/dist/move.js +3 -3
  314. package/node_modules/@poe-code/task-list/dist/open.js +2 -5
  315. package/node_modules/@poe-code/task-list/dist/paths.d.ts +12 -0
  316. package/node_modules/@poe-code/task-list/dist/paths.js +7 -0
  317. package/node_modules/@poe-code/task-list/dist/types.d.ts +6 -5
  318. package/node_modules/@poe-code/task-list/package.json +9 -0
  319. package/node_modules/@poe-code/terminal-text/LICENSE +21 -0
  320. package/node_modules/@poe-code/terminal-text/README.md +12 -0
  321. package/node_modules/@poe-code/terminal-text/dist/index.d.ts +2 -0
  322. package/node_modules/@poe-code/terminal-text/dist/index.js +20 -0
  323. package/node_modules/@poe-code/terminal-text/package.json +22 -0
  324. package/node_modules/@poe-code/xml-ast/LICENSE +21 -0
  325. package/node_modules/@poe-code/xml-ast/README.md +28 -0
  326. package/node_modules/@poe-code/xml-ast/dist/index.d.ts +47 -0
  327. package/node_modules/@poe-code/xml-ast/dist/index.js +635 -0
  328. package/node_modules/@poe-code/xml-ast/package.json +25 -0
  329. package/node_modules/auth-store/README.md +35 -0
  330. package/node_modules/auth-store/dist/index.browser.d.ts +4 -0
  331. package/node_modules/auth-store/dist/index.browser.js +2 -0
  332. package/node_modules/auth-store/dist/provider-store.d.ts +1 -1
  333. package/node_modules/auth-store/dist/safe-fs-secret-store.d.ts +21 -0
  334. package/node_modules/auth-store/dist/safe-fs-secret-store.js +119 -0
  335. package/node_modules/auth-store/dist/secret-store.d.ts +12 -0
  336. package/node_modules/auth-store/dist/secret-store.js +1 -0
  337. package/node_modules/auth-store/dist/transaction-lock.d.ts +2 -4
  338. package/node_modules/auth-store/dist/types.d.ts +2 -9
  339. package/node_modules/auth-store/package.json +16 -2
  340. package/node_modules/tiny-http-mcp-server/dist/composition.json +16 -1
  341. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +25 -0
  342. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-state.js +4 -4
  343. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +6 -40
  344. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.d.ts +10 -0
  345. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.js +20 -0
  346. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/pkce.js +4 -3
  347. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts +14 -0
  348. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js +53 -0
  349. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.d.ts +16 -2
  350. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.js +29 -9
  351. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.d.ts +12 -0
  352. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.js +23 -0
  353. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.js +6 -19
  354. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.js +1 -1
  355. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +6 -2
  356. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +5 -1
  357. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.d.ts +5 -2
  358. package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.js +4 -1
  359. package/node_modules/tiny-http-mcp-server/package.json +4 -4
  360. package/node_modules/tiny-mcp-client/README.md +2 -0
  361. package/node_modules/tiny-mcp-client/dist/index.browser.d.ts +25 -23
  362. package/node_modules/tiny-mcp-client/dist/index.browser.js +116 -1
  363. package/node_modules/tiny-mcp-client/dist/index.d.ts +25 -23
  364. package/node_modules/tiny-mcp-client/dist/index.js +1034 -561
  365. package/node_modules/tiny-mcp-client/package.json +15 -0
  366. package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
  367. package/node_modules/toolcraft-design/dist/components/table.js +6 -0
  368. package/node_modules/toolcraft-design/dist/escape-terminal-text.d.ts +1 -2
  369. package/node_modules/toolcraft-design/dist/escape-terminal-text.js +1 -20
  370. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +2 -1
  371. package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +2 -1
  372. package/node_modules/toolcraft-schema/dist/json-schema/utils.js +3 -0
  373. package/node_modules/toolcraft-schema/package.json +1 -1
  374. package/package.json +32 -7
@@ -0,0 +1,560 @@
1
+ /**
2
+ * Utilities for hex, bytes, CSPRNG.
3
+ * @module
4
+ */
5
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6
+ /**
7
+ * Bytes API type helpers for old + new TypeScript.
8
+ *
9
+ * TS 5.6 has `Uint8Array`, while TS 5.9+ made it generic `Uint8Array<ArrayBuffer>`.
10
+ * We can't use specific return type, because TS 5.6 will error.
11
+ * We can't use generic return type, because most TS 5.9 software will expect specific type.
12
+ *
13
+ * Maps typed-array input leaves to broad forms.
14
+ * These are compatibility adapters, not ownership guarantees.
15
+ *
16
+ * - `TArg` keeps byte inputs broad.
17
+ * - `TRet` marks byte outputs for TS 5.6 and TS 5.9+ compatibility.
18
+ */
19
+ export type TypedArg<T> = T extends BigInt64Array ? BigInt64Array : T extends BigUint64Array ? BigUint64Array : T extends Float32Array ? Float32Array : T extends Float64Array ? Float64Array : T extends Int16Array ? Int16Array : T extends Int32Array ? Int32Array : T extends Int8Array ? Int8Array : T extends Uint16Array ? Uint16Array : T extends Uint32Array ? Uint32Array : T extends Uint8ClampedArray ? Uint8ClampedArray : T extends Uint8Array ? Uint8Array : never;
20
+ /** Maps typed-array output leaves to narrow TS-compatible forms. */
21
+ export type TypedRet<T> = T extends BigInt64Array ? ReturnType<typeof BigInt64Array.of> : T extends BigUint64Array ? ReturnType<typeof BigUint64Array.of> : T extends Float32Array ? ReturnType<typeof Float32Array.of> : T extends Float64Array ? ReturnType<typeof Float64Array.of> : T extends Int16Array ? ReturnType<typeof Int16Array.of> : T extends Int32Array ? ReturnType<typeof Int32Array.of> : T extends Int8Array ? ReturnType<typeof Int8Array.of> : T extends Uint16Array ? ReturnType<typeof Uint16Array.of> : T extends Uint32Array ? ReturnType<typeof Uint32Array.of> : T extends Uint8ClampedArray ? ReturnType<typeof Uint8ClampedArray.of> : T extends Uint8Array ? ReturnType<typeof Uint8Array.of> : never;
22
+ /** Recursively adapts byte-carrying API input types. See {@link TypedArg}. */
23
+ export type TArg<T> = T | ([TypedArg<T>] extends [never] ? T extends (...args: infer A) => infer R ? ((...args: {
24
+ [K in keyof A]: TRet<A[K]>;
25
+ }) => TArg<R>) & {
26
+ [K in keyof T]: T[K] extends (...args: any) => any ? T[K] : TArg<T[K]>;
27
+ } : T extends [infer A, ...infer R] ? [TArg<A>, ...{
28
+ [K in keyof R]: TArg<R[K]>;
29
+ }] : T extends readonly [infer A, ...infer R] ? readonly [TArg<A>, ...{
30
+ [K in keyof R]: TArg<R[K]>;
31
+ }] : T extends (infer A)[] ? TArg<A>[] : T extends readonly (infer A)[] ? readonly TArg<A>[] : T extends Promise<infer A> ? Promise<TArg<A>> : T extends object ? {
32
+ [K in keyof T]: TArg<T[K]>;
33
+ } : T : TypedArg<T>);
34
+ /** Recursively adapts byte-carrying API output types. See {@link TypedArg}. */
35
+ export type TRet<T> = T extends unknown ? T & ([TypedRet<T>] extends [never] ? T extends (...args: infer A) => infer R ? ((...args: {
36
+ [K in keyof A]: TArg<A[K]>;
37
+ }) => TRet<R>) & {
38
+ [K in keyof T]: T[K] extends (...args: any) => any ? T[K] : TRet<T[K]>;
39
+ } : T extends [infer A, ...infer R] ? [TRet<A>, ...{
40
+ [K in keyof R]: TRet<R[K]>;
41
+ }] : T extends readonly [infer A, ...infer R] ? readonly [TRet<A>, ...{
42
+ [K in keyof R]: TRet<R[K]>;
43
+ }] : T extends (infer A)[] ? TRet<A>[] : T extends readonly (infer A)[] ? readonly TRet<A>[] : T extends Promise<infer A> ? Promise<TRet<A>> : T extends object ? {
44
+ [K in keyof T]: TRet<T[K]>;
45
+ } : T : TypedRet<T>) : never;
46
+ /**
47
+ * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.
48
+ * @param a - value to test
49
+ * @returns `true` when the value is a Uint8Array-compatible view.
50
+ * @example
51
+ * Check whether a value is a Uint8Array-compatible view.
52
+ * ```ts
53
+ * isBytes(new Uint8Array([1, 2, 3]));
54
+ * ```
55
+ */
56
+ export declare function isBytes(a: unknown): a is Uint8Array;
57
+ /**
58
+ * Asserts something is a non-negative integer.
59
+ * @param n - number to validate
60
+ * @param title - label included in thrown errors
61
+ * @returns The validated number.
62
+ * @throws On wrong argument types. {@link TypeError}
63
+ * @throws On wrong argument ranges or values. {@link RangeError}
64
+ * @example
65
+ * Validate a non-negative integer option.
66
+ * ```ts
67
+ * anumber(32, 'length');
68
+ * ```
69
+ */
70
+ export declare function anumber(n: number, title?: string): number;
71
+ /**
72
+ * Asserts something is a boolean.
73
+ * @param value - value to validate
74
+ * @param title - label included in thrown errors
75
+ * @returns The validated boolean.
76
+ * @throws On wrong argument types. {@link TypeError}
77
+ * @example
78
+ * Validate a boolean option.
79
+ * ```ts
80
+ * abool(true, 'enableXOF');
81
+ * ```
82
+ */
83
+ export declare function abool(value: boolean, title?: string): boolean;
84
+ /**
85
+ * Asserts something is Uint8Array.
86
+ * @param value - value to validate
87
+ * @param length - optional exact length constraint
88
+ * @param title - label included in thrown errors
89
+ * @returns The validated byte array.
90
+ * @throws On wrong argument types. {@link TypeError}
91
+ * @throws On wrong argument ranges or values. {@link RangeError}
92
+ * @example
93
+ * Validate that a value is a byte array.
94
+ * ```ts
95
+ * abytes(new Uint8Array([1, 2, 3]));
96
+ * ```
97
+ */
98
+ export declare function abytes(value: TArg<Uint8Array>, length?: number, title?: string): TRet<Uint8Array>;
99
+ /**
100
+ * Copies bytes into a fresh Uint8Array.
101
+ * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.
102
+ * @param bytes - source bytes to clone
103
+ * @returns Freshly allocated copy of `bytes`.
104
+ * @throws On wrong argument types. {@link TypeError}
105
+ * @example
106
+ * Clone a byte array before mutating it.
107
+ * ```ts
108
+ * const copy = copyBytes(new Uint8Array([1, 2, 3]));
109
+ * ```
110
+ */
111
+ export declare function copyBytes(bytes: TArg<Uint8Array>): TRet<Uint8Array>;
112
+ /**
113
+ * Asserts something is a wrapped hash constructor.
114
+ * @param h - hash constructor to validate
115
+ * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}
116
+ * @throws On invalid hash metadata ranges or values. {@link RangeError}
117
+ * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}
118
+ * @example
119
+ * Validate a callable hash wrapper.
120
+ * ```ts
121
+ * import { ahash } from '@noble/hashes/utils.js';
122
+ * import { sha256 } from '@noble/hashes/sha2.js';
123
+ * ahash(sha256);
124
+ * ```
125
+ */
126
+ export declare function ahash(h: TArg<CHash>): void;
127
+ /**
128
+ * Asserts a hash instance has not been destroyed or finished.
129
+ * @param instance - hash instance to validate
130
+ * @param checkFinished - whether to reject finalized instances
131
+ * @throws If the hash instance has already been destroyed or finalized. {@link Error}
132
+ * @example
133
+ * Validate that a hash instance is still usable.
134
+ * ```ts
135
+ * import { aexists } from '@noble/hashes/utils.js';
136
+ * import { sha256 } from '@noble/hashes/sha2.js';
137
+ * const hash = sha256.create();
138
+ * aexists(hash);
139
+ * ```
140
+ */
141
+ export declare function aexists(instance: any, checkFinished?: boolean): void;
142
+ /**
143
+ * Asserts output is a sufficiently-sized byte array.
144
+ * @param out - destination buffer
145
+ * @param instance - hash instance providing output length
146
+ * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.
147
+ * @throws On wrong argument types. {@link TypeError}
148
+ * @throws On wrong argument ranges or values. {@link RangeError}
149
+ * @example
150
+ * Validate a caller-provided digest buffer.
151
+ * ```ts
152
+ * import { aoutput } from '@noble/hashes/utils.js';
153
+ * import { sha256 } from '@noble/hashes/sha2.js';
154
+ * const hash = sha256.create();
155
+ * aoutput(new Uint8Array(hash.outputLen), hash);
156
+ * ```
157
+ */
158
+ export declare function aoutput(out: any, instance: any): void;
159
+ /** Generic type encompassing 8/16/32-bit typed arrays, but not 64-bit. */
160
+ export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array;
161
+ /**
162
+ * Casts a typed array view to Uint8Array.
163
+ * @param arr - source typed array
164
+ * @returns Uint8Array view over the same buffer.
165
+ * @example
166
+ * Reinterpret a typed array as bytes.
167
+ * ```ts
168
+ * u8(new Uint32Array([1, 2]));
169
+ * ```
170
+ */
171
+ export declare function u8(arr: TArg<TypedArray>): TRet<Uint8Array>;
172
+ /**
173
+ * Casts a typed array view to Uint32Array.
174
+ * `arr.byteOffset` must already be 4-byte aligned or the platform
175
+ * Uint32Array constructor will throw.
176
+ * @param arr - source typed array
177
+ * @returns Uint32Array view over the same buffer.
178
+ * @example
179
+ * Reinterpret a byte array as 32-bit words.
180
+ * ```ts
181
+ * u32(new Uint8Array(8));
182
+ * ```
183
+ */
184
+ export declare function u32(arr: TArg<TypedArray>): TRet<Uint32Array>;
185
+ /**
186
+ * Zeroizes typed arrays in place. Warning: JS provides no guarantees.
187
+ * @param arrays - arrays to overwrite with zeros
188
+ * @example
189
+ * Zeroize sensitive buffers in place.
190
+ * ```ts
191
+ * clean(new Uint8Array([1, 2, 3]));
192
+ * ```
193
+ */
194
+ export declare function clean(...arrays: TArg<TypedArray[]>): void;
195
+ /**
196
+ * Creates a DataView for byte-level manipulation.
197
+ * @param arr - source typed array
198
+ * @returns DataView over the same buffer region.
199
+ * @example
200
+ * Create a DataView over an existing buffer.
201
+ * ```ts
202
+ * createView(new Uint8Array(4));
203
+ * ```
204
+ */
205
+ export declare function createView(arr: TArg<TypedArray>): DataView;
206
+ /**
207
+ * Rotate-right operation for uint32 values.
208
+ * @param word - source word
209
+ * @param shift - shift amount in bits
210
+ * @returns Rotated word.
211
+ * @example
212
+ * Rotate a 32-bit word to the right.
213
+ * ```ts
214
+ * rotr(0x12345678, 8);
215
+ * ```
216
+ */
217
+ export declare function rotr(word: number, shift: number): number;
218
+ /**
219
+ * Rotate-left operation for uint32 values.
220
+ * @param word - source word
221
+ * @param shift - shift amount in bits
222
+ * @returns Rotated word.
223
+ * @example
224
+ * Rotate a 32-bit word to the left.
225
+ * ```ts
226
+ * rotl(0x12345678, 8);
227
+ * ```
228
+ */
229
+ export declare function rotl(word: number, shift: number): number;
230
+ /** Whether the current platform is little-endian. */
231
+ export declare const isLE: boolean;
232
+ /**
233
+ * Byte-swap operation for uint32 values.
234
+ * @param word - source word
235
+ * @returns Word with reversed byte order.
236
+ * @example
237
+ * Reverse the byte order of a 32-bit word.
238
+ * ```ts
239
+ * byteSwap(0x11223344);
240
+ * ```
241
+ */
242
+ export declare function byteSwap(word: number): number;
243
+ /**
244
+ * Conditionally byte-swaps one 32-bit word on big-endian platforms.
245
+ * @param n - source word
246
+ * @returns Original or byte-swapped word depending on platform endianness.
247
+ * @example
248
+ * Normalize a 32-bit word for host endianness.
249
+ * ```ts
250
+ * swap8IfBE(0x11223344);
251
+ * ```
252
+ */
253
+ export declare const swap8IfBE: (n: number) => number;
254
+ /**
255
+ * Byte-swaps every word of a Uint32Array in place.
256
+ * @param arr - array to mutate
257
+ * @returns The same array after mutation; callers pass live state arrays here.
258
+ * @example
259
+ * Reverse the byte order of every word in place.
260
+ * ```ts
261
+ * byteSwap32(new Uint32Array([0x11223344]));
262
+ * ```
263
+ */
264
+ export declare function byteSwap32(arr: TArg<Uint32Array>): TRet<Uint32Array>;
265
+ /**
266
+ * Conditionally byte-swaps a Uint32Array on big-endian platforms.
267
+ * @param u - array to normalize for host endianness
268
+ * @returns Original or byte-swapped array depending on platform endianness.
269
+ * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.
270
+ * @example
271
+ * Normalize a word array for host endianness.
272
+ * ```ts
273
+ * swap32IfBE(new Uint32Array([0x11223344]));
274
+ * ```
275
+ */
276
+ export declare const swap32IfBE: (u: TArg<Uint32Array>) => TRet<Uint32Array>;
277
+ /**
278
+ * Convert byte array to hex string.
279
+ * Uses the built-in function when available and assumes it matches the tested
280
+ * fallback semantics.
281
+ * @param bytes - bytes to encode
282
+ * @returns Lowercase hexadecimal string.
283
+ * @throws On wrong argument types. {@link TypeError}
284
+ * @example
285
+ * Convert bytes to lowercase hexadecimal.
286
+ * ```ts
287
+ * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'
288
+ * ```
289
+ */
290
+ export declare function bytesToHex(bytes: TArg<Uint8Array>): string;
291
+ /**
292
+ * Convert hex string to byte array. Uses built-in function, when available.
293
+ * @param hex - hexadecimal string to decode
294
+ * @returns Decoded bytes.
295
+ * @throws On wrong argument types. {@link TypeError}
296
+ * @throws On wrong argument ranges or values. {@link RangeError}
297
+ * @example
298
+ * Decode lowercase hexadecimal into bytes.
299
+ * ```ts
300
+ * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
301
+ * ```
302
+ */
303
+ export declare function hexToBytes(hex: string): TRet<Uint8Array>;
304
+ /**
305
+ * Yields to the host task scheduler so timers, I/O, and rendering can make progress.
306
+ * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.
307
+ * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so
308
+ * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while
309
+ * still allowing other event-loop work to proceed.
310
+ * @param onReject - optional cleanup invoked only if the host yield fails
311
+ * @example
312
+ * Yield to the next scheduler tick.
313
+ * ```ts
314
+ * await nextTick();
315
+ * ```
316
+ */
317
+ export declare function nextTick(onReject?: () => void): Promise<void>;
318
+ /**
319
+ * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.
320
+ * @param iters - number of loop iterations to run
321
+ * @param tick - maximum time slice in milliseconds
322
+ * @param cb - callback executed on each iteration
323
+ * @param onReject - optional cleanup invoked only if a host yield fails
324
+ * @throws On wrong argument types. {@link TypeError}
325
+ * @throws On wrong argument ranges or values. {@link RangeError}
326
+ * @example
327
+ * Run a loop that periodically yields back to the event loop.
328
+ * ```ts
329
+ * await asyncLoop(2, 0, () => {});
330
+ * ```
331
+ */
332
+ export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void, onReject?: () => void): Promise<void>;
333
+ /**
334
+ * Converts string to bytes using UTF8 encoding.
335
+ * Built-in doesn't validate input to be string: we do the check.
336
+ * Non-ASCII details are delegated to the platform `TextEncoder`.
337
+ * @param str - string to encode
338
+ * @returns UTF-8 encoded bytes.
339
+ * @throws On wrong argument types. {@link TypeError}
340
+ * @example
341
+ * Encode a string as UTF-8 bytes.
342
+ * ```ts
343
+ * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])
344
+ * ```
345
+ */
346
+ export declare function utf8ToBytes(str: string): TRet<Uint8Array>;
347
+ /** KDFs can accept string or Uint8Array for user convenience. */
348
+ export type KDFInput = string | Uint8Array;
349
+ /**
350
+ * Helper for KDFs: consumes Uint8Array or string.
351
+ * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.
352
+ * @param data - user-provided KDF input
353
+ * @param errorTitle - label included in thrown errors
354
+ * @returns Byte representation of the input.
355
+ * @throws On wrong argument types. {@link TypeError}
356
+ * @example
357
+ * Normalize KDF input to bytes.
358
+ * ```ts
359
+ * kdfInputToBytes('password');
360
+ * ```
361
+ */
362
+ export declare function kdfInputToBytes(data: TArg<KDFInput>, errorTitle?: string): TRet<Uint8Array>;
363
+ /**
364
+ * Copies several Uint8Arrays into one.
365
+ * @param arrays - arrays to concatenate
366
+ * @returns Concatenated byte array.
367
+ * @throws On wrong argument types. {@link TypeError}
368
+ * @example
369
+ * Concatenate multiple byte arrays.
370
+ * ```ts
371
+ * concatBytes(new Uint8Array([1]), new Uint8Array([2]));
372
+ * ```
373
+ */
374
+ export declare function concatBytes(...arrays: TArg<Uint8Array[]>): TRet<Uint8Array>;
375
+ type EmptyObj = {};
376
+ /**
377
+ * Validates declared required and optional field types on a plain object.
378
+ * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct
379
+ * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.
380
+ * @param object - object to validate
381
+ * @param fields - map of required field names to expected types
382
+ * @param optFields - map of optional field names to expected types
383
+ * @param title - label included in thrown errors
384
+ * @throws On wrong argument types. {@link TypeError}
385
+ * @example
386
+ * Validate required and optional option fields.
387
+ * ```ts
388
+ * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });
389
+ * ```
390
+ */
391
+ export declare const validateObject: (object: Record<string, any>, fields?: Record<string, string>, optFields?: Record<string, string>, title?: string) => void;
392
+ /**
393
+ * Merges default options and passed options.
394
+ * @param defaults - base option object
395
+ * @param opts - user overrides
396
+ * @param title - label included in thrown override errors
397
+ * @returns Fresh merged option object with a null prototype.
398
+ * @throws On wrong argument types. {@link TypeError}
399
+ * @example
400
+ * Merge user overrides onto default options.
401
+ * ```ts
402
+ * checkOpts({ dkLen: 32 }, { asyncTick: 10 });
403
+ * ```
404
+ */
405
+ export declare function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(defaults: T1, opts?: T2, title?: string): T1 & T2;
406
+ /** Common interface for all hash instances. */
407
+ export interface Hash<T> {
408
+ /** Bytes processed per compression block. */
409
+ blockLen: number;
410
+ /** Bytes produced by `digest()`. */
411
+ outputLen: number;
412
+ /** Whether the instance supports XOF-style variable-length output via `xof()` / `xofInto()`. */
413
+ canXOF: boolean;
414
+ /**
415
+ * Absorbs more message bytes into the running hash state.
416
+ * @param buf - message chunk to absorb
417
+ * @returns The same hash instance for chaining.
418
+ */
419
+ update(buf: TArg<Uint8Array>): this;
420
+ /**
421
+ * Finalizes the hash into a caller-provided buffer.
422
+ * @param buf - destination buffer
423
+ * @returns Nothing. Implementations write into `buf` in place.
424
+ */
425
+ digestInto(buf: TArg<Uint8Array>): void;
426
+ /**
427
+ * Finalizes the hash and returns a freshly allocated digest.
428
+ * @returns Digest bytes.
429
+ */
430
+ digest(): TRet<Uint8Array>;
431
+ /** Wipes internal state and makes the instance unusable. */
432
+ destroy(): void;
433
+ /**
434
+ * Copies the current hash state into an existing or new instance.
435
+ * @param to - Optional destination instance to reuse.
436
+ * @returns Cloned hash state.
437
+ */
438
+ _cloneInto(to?: T): T;
439
+ /**
440
+ * Creates an independent copy of the current hash state.
441
+ * @returns Cloned hash instance.
442
+ */
443
+ clone(): T;
444
+ }
445
+ /**
446
+ * The pseudorandom number generator doesn't wipe current state:
447
+ * instead, it generates new one based on previous state + entropy.
448
+ * Not reseed/rekey, since AES CTR DRBG does rekey on each randomBytes,
449
+ * which is in fact `reseed`, since it changes counter too.
450
+ */
451
+ export interface PRG {
452
+ /**
453
+ * Mixes fresh entropy into the current generator state.
454
+ * @param seed - Non-empty entropy bytes to absorb. When omitted, the implementation uses its
455
+ * system RNG.
456
+ */
457
+ addEntropy(seed?: TArg<Uint8Array>): void;
458
+ /**
459
+ * Produces a requested number of pseudorandom bytes.
460
+ * @param bytesLength - Number of bytes to generate.
461
+ * @returns Random byte array.
462
+ */
463
+ randomBytes(bytesLength: number): TRet<Uint8Array>;
464
+ /** Destroys the generator state. */
465
+ clean(): void;
466
+ }
467
+ /**
468
+ * XOF: streaming API to read digest in chunks.
469
+ * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.
470
+ * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot
471
+ * destroy state, next call can require more bytes.
472
+ */
473
+ export type HashXOF<T extends Hash<T>> = Hash<T> & {
474
+ /**
475
+ * Reads more bytes from the XOF stream.
476
+ * @param bytes - number of bytes to read
477
+ * @returns Requested digest bytes.
478
+ */
479
+ xof(bytes: number): TRet<Uint8Array>;
480
+ /**
481
+ * Reads more bytes from the XOF stream into a caller-provided buffer.
482
+ * @param buf - destination buffer
483
+ * @returns Filled output buffer.
484
+ */
485
+ xofInto(buf: TArg<Uint8Array>): TRet<Uint8Array>;
486
+ };
487
+ /** Hash constructor or factory type. */
488
+ export type HasherCons<T, Opts = undefined> = Opts extends undefined ? () => T : (opts?: Opts) => T;
489
+ /** Optional hash metadata. */
490
+ export type HashInfo = {
491
+ /** DER-encoded object identifier bytes for the hash algorithm. */
492
+ oid?: TRet<Uint8Array>;
493
+ };
494
+ /** Callable hash function type. */
495
+ export type CHash<T extends Hash<T> = Hash<any>, Opts = undefined> = {
496
+ /** Digest size in bytes. */
497
+ outputLen: number;
498
+ /** Input block size in bytes. */
499
+ blockLen: number;
500
+ /** Whether `.create()` returns a hash instance that can be used as an XOF stream. */
501
+ canXOF: boolean;
502
+ } & HashInfo & (Opts extends undefined ? {
503
+ (msg: TArg<Uint8Array>): TRet<Uint8Array>;
504
+ create(): T;
505
+ } : {
506
+ (msg: TArg<Uint8Array>, opts?: TArg<Opts>): TRet<Uint8Array>;
507
+ create(opts?: Opts): T;
508
+ });
509
+ /** Callable extendable-output hash function type. */
510
+ export type CHashXOF<T extends HashXOF<T> = HashXOF<any>, Opts = undefined> = CHash<T, Opts>;
511
+ /**
512
+ * Creates a callable hash function from a stateful class constructor.
513
+ * @param hashCons - hash constructor or factory
514
+ * @param info - optional metadata such as DER OID
515
+ * @returns Frozen callable hash wrapper with `.create()`.
516
+ * Wrapper construction eagerly calls `hashCons(undefined)` once to read
517
+ * `outputLen` / `blockLen`, so constructor side effects happen at module
518
+ * init time.
519
+ * @throws On wrong argument types. {@link TypeError}
520
+ * @example
521
+ * Wrap a stateful hash constructor into a callable helper.
522
+ * ```ts
523
+ * import { createHasher } from '@noble/hashes/utils.js';
524
+ * import { sha256 } from '@noble/hashes/sha2.js';
525
+ * const wrapped = createHasher(sha256.create, { oid: sha256.oid });
526
+ * wrapped(new Uint8Array([1]));
527
+ * ```
528
+ */
529
+ export declare function createHasher<T extends Hash<T>, Opts = undefined>(hashCons: HasherCons<T, Opts>, info?: TArg<HashInfo>): TRet<CHash<T, Opts>>;
530
+ /**
531
+ * Cryptographically secure PRNG backed by `crypto.getRandomValues`.
532
+ * @param bytesLength - number of random bytes to generate
533
+ * @returns Random bytes.
534
+ * The platform `getRandomValues()` implementation still defines any
535
+ * single-call length cap, and this helper rejects oversize requests
536
+ * with a stable library `RangeError` instead of host-specific errors.
537
+ * @throws On wrong argument types. {@link TypeError}
538
+ * @throws On wrong argument ranges or values. {@link RangeError}
539
+ * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}
540
+ * @example
541
+ * Generate a fresh random key or nonce.
542
+ * ```ts
543
+ * const key = randomBytes(16);
544
+ * ```
545
+ */
546
+ export declare function randomBytes(bytesLength?: number): TRet<Uint8Array>;
547
+ /**
548
+ * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.
549
+ * @param suffix - final OID byte for the selected hash.
550
+ * The helper accepts any byte even though only the documented NIST hash
551
+ * suffixes are meaningful downstream.
552
+ * @returns Object containing the DER-encoded OID.
553
+ * @example
554
+ * Build OID metadata for a NIST hash.
555
+ * ```ts
556
+ * oidNist(0x01);
557
+ * ```
558
+ */
559
+ export declare const oidNist: (suffix: number) => TRet<Required<HashInfo>>;
560
+ export {};