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,677 @@
1
+ /**
2
+ * Blake1 legacy hash function, one of SHA3 proposals.
3
+ * Rarely used. Check out blake2 or blake3 instead.
4
+ * {@link https://www.aumasson.jp/blake/blake.pdf}
5
+ *
6
+ * In the best case, there are 0 allocations.
7
+ *
8
+ * Differences from blake2:
9
+ *
10
+ * - BE instead of LE
11
+ * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but:
12
+ * - length flag is located before actual length
13
+ * - padding block is compressed differently (no lengths)
14
+ * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]`
15
+ * (-1 for g1, g2 without -1)
16
+ * - Salt is XOR-ed into constants instead of state
17
+ * - Salt is XOR-ed with output in `compress`
18
+ * - Additional rows (+64 bytes) in SIGMA for new rounds
19
+ * - Different round count:
20
+ * - 14 / 10 rounds in blake256 / blake2s
21
+ * - 16 / 12 rounds in blake512 / blake2b
22
+ * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11
23
+ * @module
24
+ */
25
+ import { BSIGMA, G1s, G2s } from './_blake.ts';
26
+ import { SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';
27
+ import * as u64 from './_u64.ts';
28
+ // prettier-ignore
29
+ import {
30
+ abytes, aexists, aoutput,
31
+ checkOpts,
32
+ clean, createHasher,
33
+ createView,
34
+ type CHash,
35
+ type Hash,
36
+ type TArg,
37
+ type TRet
38
+ } from './utils.ts';
39
+
40
+ // Unrealized speed-up: G1b/G2b call the tiny u64.* helpers (rotations, split adds) across
41
+ // the module boundary, which V8 does not inline — u64.add's {h,l} return even allocates
42
+ // per call. File-local copies of the helpers measured ~15% faster blake512 on Node 24.
43
+ // Kept deduplicated in _u64 for auditability. Also doesn't matter for bundles
44
+ // which don't do `import`.
45
+
46
+ /** Blake1 options. Basically just `salt`. */
47
+ export type BlakeOpts = {
48
+ /** Optional salt mixed into initialization. */
49
+ salt?: Uint8Array;
50
+ };
51
+
52
+ // Shared unsalted sentinel, sized for the 64-bit path and reused by the 32-bit path via prefix.
53
+ const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8);
54
+
55
+ abstract class BLAKE1<T extends BLAKE1<T>> implements Hash<T> {
56
+ readonly canXOF = false;
57
+ protected finished = false;
58
+ protected length = 0;
59
+ protected pos = 0;
60
+ protected destroyed = false;
61
+ // For partial updates less than block size
62
+ protected buffer: Uint8Array;
63
+ protected view: DataView;
64
+ protected salt: Uint32Array;
65
+ abstract compress(view: DataView, offset: number, withLength?: boolean): void;
66
+ protected abstract get(): number[];
67
+ // Each state layout must own this call site. At a monomorphic site TurboFan inlines get()/set()
68
+ // and scalar-replaces the tuple, so no secret-bearing array is allocated. Sharing this site
69
+ // across the 32/64-bit layouts materializes the tuple, which cannot be explicitly wiped, and
70
+ // regresses clone-heavy KDFs.
71
+ abstract _cloneInto(to?: T): T;
72
+
73
+ readonly blockLen: number;
74
+ readonly outputLen: number;
75
+ private lengthFlag: number;
76
+ private counterLen: number;
77
+ protected constants: Uint32Array;
78
+
79
+ constructor(
80
+ blockLen: number,
81
+ outputLen: number,
82
+ lengthFlag: number,
83
+ counterLen: number,
84
+ saltLen: number,
85
+ constants: Uint32Array,
86
+ opts: BlakeOpts = {}
87
+ ) {
88
+ opts = checkOpts({}, opts);
89
+ const { salt } = opts;
90
+ this.blockLen = blockLen;
91
+ this.outputLen = outputLen;
92
+ this.lengthFlag = lengthFlag;
93
+ this.counterLen = counterLen;
94
+ this.buffer = new Uint8Array(blockLen);
95
+ this.view = createView(this.buffer);
96
+ if (salt !== undefined) {
97
+ let slt = salt;
98
+ abytes(slt, 4 * saltLen, 'salt');
99
+ // if (slt.length !== 4 * saltLen) throw new Error('wrong salt length');
100
+ const salt32 = (this.salt = new Uint32Array(saltLen));
101
+ const sv = createView(slt);
102
+ this.constants = constants.slice();
103
+ for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) {
104
+ salt32[i] = sv.getUint32(offset, false);
105
+ this.constants[i] ^= salt32[i];
106
+ }
107
+ } else {
108
+ this.salt = EMPTY_SALT;
109
+ this.constants = constants;
110
+ }
111
+ }
112
+ update(data: TArg<Uint8Array>): this {
113
+ aexists(this);
114
+ abytes(data);
115
+ // From _md, but update length before each compress
116
+ const { view, buffer, blockLen } = this;
117
+ const len = data.length;
118
+ let dataView;
119
+ for (let pos = 0; pos < len;) {
120
+ const take = Math.min(blockLen - this.pos, len - pos);
121
+ // Fast path only when there is no buffered partial block: `take === blockLen` implies
122
+ // `this.pos === 0`, so we can process full blocks directly from the input view.
123
+ if (take === blockLen) {
124
+ if (!dataView) dataView = createView(data);
125
+ for (; blockLen <= len - pos; pos += blockLen) {
126
+ this.length += blockLen;
127
+ this.compress(dataView, pos);
128
+ }
129
+ continue;
130
+ }
131
+ // When the whole input is buffered in one go (common for short messages), passing `data`
132
+ // directly avoids allocating a subarray view.
133
+ buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
134
+ this.pos += take;
135
+ pos += take;
136
+ if (this.pos === blockLen) {
137
+ this.length += blockLen;
138
+ this.compress(view, 0, true);
139
+ this.pos = 0;
140
+ }
141
+ }
142
+ return this;
143
+ }
144
+ destroy(): void {
145
+ this.destroyed = true;
146
+ clean(this.buffer);
147
+ this.length = 0;
148
+ this.pos = 0;
149
+ if (this.salt !== EMPTY_SALT) {
150
+ clean(this.salt, this.constants);
151
+ }
152
+ }
153
+ protected _cloneIntoMeta(to: T): T {
154
+ const { buffer, length, finished, destroyed, constants, salt, pos } = this;
155
+ if (pos) to.buffer.set(buffer);
156
+ // At pos=0 the source buffer is dead. Discard an unfinished destination's old message bytes;
157
+ // finished digestInto() workers are already clean, so hot KDF resets skip this fill.
158
+ else if (to.destroyed || (!to.finished && (to.length || to.pos))) clean(to.buffer);
159
+ // Clone salt-derived arrays by value so destroying the clone cannot wipe the source instance.
160
+ if (salt === EMPTY_SALT) {
161
+ to.constants = constants; // Immutable; sentinel keeps destroy() from wiping it.
162
+ to.salt = EMPTY_SALT;
163
+ } else if (to.salt === EMPTY_SALT) {
164
+ to.constants = constants.slice();
165
+ to.salt = salt.slice();
166
+ } else {
167
+ to.constants.set(constants); // Reuse independently owned salted arrays.
168
+ to.salt.set(salt);
169
+ }
170
+ to.destroyed = destroyed;
171
+ to.finished = finished;
172
+ to.length = length;
173
+ to.pos = pos;
174
+ return to;
175
+ }
176
+ clone(): T {
177
+ return this._cloneInto();
178
+ }
179
+ digestInto(out: TArg<Uint8Array>): void {
180
+ aexists(this);
181
+ aoutput(out, this);
182
+ this.finished = true;
183
+ // Padding
184
+ const { buffer, blockLen, counterLen, lengthFlag, view } = this;
185
+ buffer.fill(0, this.pos); // clean buf
186
+ const counterBits = (this.length + this.pos) * 8;
187
+ const counterPos = blockLen - counterLen - 1;
188
+ buffer[this.pos] |= 0b1000_0000; // End block flag
189
+ this.length += this.pos; // add unwritten length
190
+ // Not enough in buffer for length: write what we have.
191
+ if (this.pos > counterPos) {
192
+ this.compress(view, 0);
193
+ clean(buffer);
194
+ this.pos = 0;
195
+ }
196
+ // Difference with md: here we have lengthFlag!
197
+ buffer[counterPos] |= lengthFlag; // Length flag
198
+ // We always set 8 byte length flag. Because length will overflow significantly sooner.
199
+ u64.setU64FromNum(view, blockLen - 8, counterBits, false);
200
+ // Blake1 omits the counter from the extra all-padding block; only the block that still carries
201
+ // message bytes mixes in the final bit length.
202
+ this.compress(view, 0, this.pos !== 0);
203
+ // Write output
204
+ clean(buffer);
205
+ // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.
206
+ const v = out === buffer ? view : createView(out);
207
+ const state = this.get();
208
+ for (let i = 0; i < this.outputLen / 4; ++i) v.setUint32(i * 4, state[i]);
209
+ }
210
+ digest(): TRet<Uint8Array> {
211
+ const { buffer, outputLen } = this;
212
+ this.digestInto(buffer);
213
+ // Return a copy so callers do not alias the instance scratch buffer used during finalization.
214
+ const res = buffer.slice(0, outputLen);
215
+ this.destroy();
216
+ return res as TRet<Uint8Array>;
217
+ }
218
+ }
219
+
220
+ // Blake1-512 / Blake1-384 constant table `C512`.
221
+ // Stored as sixteen 64-bit constants split into `[high32, low32]` halves so
222
+ // the Blake1-64 path can reuse one layout for both `v8..v15` initialization
223
+ // and the permuted constant lookups.
224
+ const B64C = /* @__PURE__ */ Uint32Array.from([
225
+ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
226
+ 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
227
+ 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
228
+ 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69,
229
+ ]);
230
+ // Blake1-256 / Blake1-224 constant table `C256`, derived as the first half of `C512`.
231
+ const B32C = /* @__PURE__ */ B64C.slice(0, 16);
232
+
233
+ // Blake1-256 IV cloned from SHA-256.
234
+ const B256_IV = /* @__PURE__ */ SHA256_IV.slice();
235
+ // Blake1-224 IV cloned from SHA-224.
236
+ const B224_IV = /* @__PURE__ */ SHA224_IV.slice();
237
+ // Blake1-384 IV cloned from the SHA-384 high-then-low 32-bit halves.
238
+ const B384_IV = /* @__PURE__ */ SHA384_IV.slice();
239
+ // Blake1-512 IV cloned from the SHA-512 high-then-low 32-bit halves.
240
+ const B512_IV = /* @__PURE__ */ SHA512_IV.slice();
241
+
242
+ // Precompute the odd/even companion constants used by all 14 Blake1-32 rounds.
243
+ // Each pair stores `u[sigma[2i + 1]]` then `u[sigma[2i]]`, matching the `G1s` / `G2s` xor order.
244
+ function generateTBL256() {
245
+ const TBL = [];
246
+ for (let i = 0, j = 0; i < 14; i++, j += 16) {
247
+ for (let offset = 1; offset < 16; offset += 2) {
248
+ TBL.push(B32C[BSIGMA[j + offset]]);
249
+ TBL.push(B32C[BSIGMA[j + offset - 1]]);
250
+ }
251
+ }
252
+ return new Uint32Array(TBL);
253
+ }
254
+ // Full 14-round companion-constant table for Blake1-32.
255
+ const TBL256 = /* @__PURE__ */ generateTBL256();
256
+
257
+ // Shared synchronous message-word scratch for the 32-bit Blake1 path.
258
+ const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16);
259
+
260
+ class BLAKE1_32B extends BLAKE1<BLAKE1_32B> {
261
+ private v0: number;
262
+ private v1: number;
263
+ private v2: number;
264
+ private v3: number;
265
+ private v4: number;
266
+ private v5: number;
267
+ private v6: number;
268
+ private v7: number;
269
+ constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) {
270
+ super(64, outputLen, lengthFlag, 8, 4, B32C, opts);
271
+ this.v0 = IV[0] | 0;
272
+ this.v1 = IV[1] | 0;
273
+ this.v2 = IV[2] | 0;
274
+ this.v3 = IV[3] | 0;
275
+ this.v4 = IV[4] | 0;
276
+ this.v5 = IV[5] | 0;
277
+ this.v6 = IV[6] | 0;
278
+ this.v7 = IV[7] | 0;
279
+ }
280
+ protected get(): [number, number, number, number, number, number, number, number] {
281
+ const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
282
+ return [v0, v1, v2, v3, v4, v5, v6, v7];
283
+ }
284
+ // prettier-ignore
285
+ protected set(
286
+ v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number
287
+ ): void {
288
+ this.v0 = v0 | 0;
289
+ this.v1 = v1 | 0;
290
+ this.v2 = v2 | 0;
291
+ this.v3 = v3 | 0;
292
+ this.v4 = v4 | 0;
293
+ this.v5 = v5 | 0;
294
+ this.v6 = v6 | 0;
295
+ this.v7 = v7 | 0;
296
+ }
297
+ _cloneInto(to?: BLAKE1_32B): BLAKE1_32B {
298
+ (to ||= new (this.constructor as any)() as BLAKE1_32B).set(...this.get());
299
+ return this._cloneIntoMeta(to);
300
+ }
301
+ destroy(): void {
302
+ super.destroy();
303
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
304
+ }
305
+ compress(view: DataView, offset: number, withLength = true): void {
306
+ for (let i = 0; i < 16; i++, offset += 4) BLAKE256_W[i] = view.getUint32(offset, false);
307
+ // Cannot reuse blake2s compress: Blake1 mixes each message word with the companion constants
308
+ // precomputed in `TBL256`, rather than using the raw schedule words directly.
309
+ let v00 = this.v0 | 0;
310
+ let v01 = this.v1 | 0;
311
+ let v02 = this.v2 | 0;
312
+ let v03 = this.v3 | 0;
313
+ let v04 = this.v4 | 0;
314
+ let v05 = this.v5 | 0;
315
+ let v06 = this.v6 | 0;
316
+ let v07 = this.v7 | 0;
317
+ let v08 = this.constants[0] | 0;
318
+ let v09 = this.constants[1] | 0;
319
+ let v10 = this.constants[2] | 0;
320
+ let v11 = this.constants[3] | 0;
321
+ // Blake1-32 injects the 64-bit bit counter as `[t0, t0, t1, t1]` across `v12..v15`; the
322
+ // final all-padding block passes `withLength = false`, leaving these lanes as raw constants.
323
+ const bits = withLength ? this.length * 8 : 0;
324
+ const h = u64.fromNumH(bits);
325
+ const l = u64.fromNumL(bits);
326
+ let v12 = (this.constants[4] ^ l) >>> 0;
327
+ let v13 = (this.constants[5] ^ l) >>> 0;
328
+ let v14 = (this.constants[6] ^ h) >>> 0;
329
+ let v15 = (this.constants[7] ^ h) >>> 0;
330
+ // prettier-ignore
331
+ for (let i = 0, k = 0, j = 0; i < 14; i++) {
332
+ ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
333
+ ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
334
+ ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
335
+ ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
336
+ ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
337
+ ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
338
+ ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
339
+ ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
340
+ ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
341
+ ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
342
+ ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
343
+ ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
344
+ ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
345
+ ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
346
+ ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
347
+ ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++]));
348
+ }
349
+ this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0;
350
+ this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0;
351
+ this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0;
352
+ this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0;
353
+ this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0;
354
+ this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0;
355
+ this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0;
356
+ this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0;
357
+ clean(BLAKE256_W);
358
+ }
359
+ }
360
+
361
+ // Shared Blake1-64 work vector storing 16 working words as adjacent high/low 32-bit halves.
362
+ const BBUF = /* @__PURE__ */ new Uint32Array(32);
363
+ // Shared synchronous message-word scratch for the 64-bit Blake1 path.
364
+ const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32);
365
+
366
+ // Precompute the high/low companion constants used by all 16 Blake1-64 rounds.
367
+ // Each quartet stores `u[sigma[2i + 1]]` high/low halves, then `u[sigma[2i]]` high/low halves.
368
+ function generateTBL512() {
369
+ const TBL = [];
370
+ for (let r = 0, k = 0; r < 16; r++, k += 16) {
371
+ for (let offset = 1; offset < 16; offset += 2) {
372
+ TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]);
373
+ TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]);
374
+ TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]);
375
+ TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]);
376
+ }
377
+ }
378
+ return new Uint32Array(TBL);
379
+ }
380
+ // Full 16-round companion-constant table as high/low halves.
381
+ const TBL512 = /* @__PURE__ */ generateTBL512();
382
+
383
+ // Blake1-64 first half-round with rotations `32` and `25`; `k` is the half-call schedule index.
384
+ function G1b(a: number, b: number, c: number, d: number, msg: TArg<Uint32Array>, k: number) {
385
+ const Xpos = 2 * BSIGMA[k];
386
+ const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
387
+ let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
388
+ let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
389
+ let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
390
+ let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
391
+ // v[a] = (v[a] + v[b] + x) | 0;
392
+ const ll = u64.add3L(Al, Bl, Xl);
393
+ Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0;
394
+ Al = (ll | 0) >>> 0;
395
+ // v[d] = rotr(v[d] ^ v[a], 32)
396
+ let xh = Dh ^ Ah, xl = Dl ^ Al; // prettier-ignore
397
+ Dh = u64.rotr32H(xh, xl);
398
+ Dl = u64.rotr32L(xh, xl);
399
+ // v[c] = (v[c] + v[d]) | 0;
400
+ ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
401
+ // v[b] = rotr(v[b] ^ v[c], 25)
402
+ xh = Bh ^ Ch;
403
+ xl = Bl ^ Cl;
404
+ Bh = u64.rotrSH(xh, xl, 25);
405
+ Bl = u64.rotrSL(xh, xl, 25);
406
+ BBUF[2 * a + 1] = Al;
407
+ BBUF[2 * a] = Ah;
408
+ BBUF[2 * b + 1] = Bl;
409
+ BBUF[2 * b] = Bh;
410
+ BBUF[2 * c + 1] = Cl;
411
+ BBUF[2 * c] = Ch;
412
+ BBUF[2 * d + 1] = Dl;
413
+ BBUF[2 * d] = Dh;
414
+ }
415
+
416
+ // Blake1-64 second half-round with rotations `16` and `11`; `k` is the half-call schedule index.
417
+ function G2b(a: number, b: number, c: number, d: number, msg: TArg<Uint32Array>, k: number) {
418
+ const Xpos = 2 * BSIGMA[k];
419
+ const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore
420
+ let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore
421
+ let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore
422
+ let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore
423
+ let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore
424
+ // v[a] = (v[a] + v[b] + x) | 0;
425
+ const ll = u64.add3L(Al, Bl, Xl);
426
+ Ah = u64.add3H(ll, Ah, Bh, Xh);
427
+ Al = ll | 0;
428
+ // v[d] = rotr(v[d] ^ v[a], 16)
429
+ let xh = Dh ^ Ah, xl = Dl ^ Al; // prettier-ignore
430
+ Dh = u64.rotrSH(xh, xl, 16);
431
+ Dl = u64.rotrSL(xh, xl, 16);
432
+ // v[c] = (v[c] + v[d]) | 0;
433
+ ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
434
+ // v[b] = rotr(v[b] ^ v[c], 11)
435
+ xh = Bh ^ Ch;
436
+ xl = Bl ^ Cl;
437
+ Bh = u64.rotrSH(xh, xl, 11);
438
+ Bl = u64.rotrSL(xh, xl, 11);
439
+ BBUF[2 * a + 1] = Al;
440
+ BBUF[2 * a] = Ah;
441
+ BBUF[2 * b + 1] = Bl;
442
+ BBUF[2 * b] = Bh;
443
+ BBUF[2 * c + 1] = Cl;
444
+ BBUF[2 * c] = Ch;
445
+ BBUF[2 * d + 1] = Dl;
446
+ BBUF[2 * d] = Dh;
447
+ }
448
+
449
+ // Legacy field names keep the local `l/h` spelling, but array/state order stays `[high, low]` to
450
+ // match the IV tables and `BBUF` layout.
451
+ class BLAKE1_64B extends BLAKE1<BLAKE1_64B> {
452
+ private v0l: number;
453
+ private v0h: number;
454
+ private v1l: number;
455
+ private v1h: number;
456
+ private v2l: number;
457
+ private v2h: number;
458
+ private v3l: number;
459
+ private v3h: number;
460
+ private v4l: number;
461
+ private v4h: number;
462
+ private v5l: number;
463
+ private v5h: number;
464
+ private v6l: number;
465
+ private v6h: number;
466
+ private v7l: number;
467
+ private v7h: number;
468
+ constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) {
469
+ super(128, outputLen, lengthFlag, 16, 8, B64C, opts);
470
+ this.v0l = IV[0] | 0;
471
+ this.v0h = IV[1] | 0;
472
+ this.v1l = IV[2] | 0;
473
+ this.v1h = IV[3] | 0;
474
+ this.v2l = IV[4] | 0;
475
+ this.v2h = IV[5] | 0;
476
+ this.v3l = IV[6] | 0;
477
+ this.v3h = IV[7] | 0;
478
+ this.v4l = IV[8] | 0;
479
+ this.v4h = IV[9] | 0;
480
+ this.v5l = IV[10] | 0;
481
+ this.v5h = IV[11] | 0;
482
+ this.v6l = IV[12] | 0;
483
+ this.v6h = IV[13] | 0;
484
+ this.v7l = IV[14] | 0;
485
+ this.v7h = IV[15] | 0;
486
+ }
487
+ // prettier-ignore
488
+ protected get(): [
489
+ number, number, number, number, number, number, number, number,
490
+ number, number, number, number, number, number, number, number
491
+ ] {
492
+ let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
493
+ return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
494
+ }
495
+ // prettier-ignore
496
+ protected set(
497
+ v0l: number, v0h: number, v1l: number, v1h: number,
498
+ v2l: number, v2h: number, v3l: number, v3h: number,
499
+ v4l: number, v4h: number, v5l: number, v5h: number,
500
+ v6l: number, v6h: number, v7l: number, v7h: number
501
+ ): void {
502
+ this.v0l = v0l | 0;
503
+ this.v0h = v0h | 0;
504
+ this.v1l = v1l | 0;
505
+ this.v1h = v1h | 0;
506
+ this.v2l = v2l | 0;
507
+ this.v2h = v2h | 0;
508
+ this.v3l = v3l | 0;
509
+ this.v3h = v3h | 0;
510
+ this.v4l = v4l | 0;
511
+ this.v4h = v4h | 0;
512
+ this.v5l = v5l | 0;
513
+ this.v5h = v5h | 0;
514
+ this.v6l = v6l | 0;
515
+ this.v6h = v6h | 0;
516
+ this.v7l = v7l | 0;
517
+ this.v7h = v7h | 0;
518
+ }
519
+ _cloneInto(to?: BLAKE1_64B): BLAKE1_64B {
520
+ (to ||= new (this.constructor as any)() as BLAKE1_64B).set(...this.get());
521
+ return this._cloneIntoMeta(to);
522
+ }
523
+ destroy(): void {
524
+ super.destroy();
525
+ this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
526
+ }
527
+ compress(view: DataView, offset: number, withLength = true): void {
528
+ for (let i = 0; i < 32; i++, offset += 4) BLAKE512_W[i] = view.getUint32(offset, false);
529
+ // First half from state. Direct writes: get() would allocate an array +
530
+ // closure per block (same reasoning as blake2b's compress).
531
+ // prettier-ignore
532
+ const { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
533
+ // prettier-ignore
534
+ { BBUF[0] = v0l; BBUF[1] = v0h; BBUF[2] = v1l; BBUF[3] = v1h;
535
+ BBUF[4] = v2l; BBUF[5] = v2h; BBUF[6] = v3l; BBUF[7] = v3h;
536
+ BBUF[8] = v4l; BBUF[9] = v4h; BBUF[10] = v5l; BBUF[11] = v5h;
537
+ BBUF[12] = v6l; BBUF[13] = v6h; BBUF[14] = v7l; BBUF[15] = v7h; }
538
+ BBUF.set(this.constants.subarray(0, 16), 16);
539
+ if (withLength) {
540
+ // Blake1-64 injects the 64-bit bit counter into `v12` and `v13`; the final all-padding
541
+ // block passes `withLength = false`, leaving the trailing constant lanes untouched.
542
+ const bits = this.length * 8;
543
+ const h = u64.fromNumH(bits);
544
+ const l = u64.fromNumL(bits);
545
+ BBUF[24] = (BBUF[24] ^ h) >>> 0;
546
+ BBUF[25] = (BBUF[25] ^ l) >>> 0;
547
+ BBUF[26] = (BBUF[26] ^ h) >>> 0;
548
+ BBUF[27] = (BBUF[27] ^ l) >>> 0;
549
+ }
550
+ for (let i = 0, k = 0; i < 16; i++) {
551
+ G1b(0, 4, 8, 12, BLAKE512_W, k++);
552
+ G2b(0, 4, 8, 12, BLAKE512_W, k++);
553
+ G1b(1, 5, 9, 13, BLAKE512_W, k++);
554
+ G2b(1, 5, 9, 13, BLAKE512_W, k++);
555
+ G1b(2, 6, 10, 14, BLAKE512_W, k++);
556
+ G2b(2, 6, 10, 14, BLAKE512_W, k++);
557
+ G1b(3, 7, 11, 15, BLAKE512_W, k++);
558
+ G2b(3, 7, 11, 15, BLAKE512_W, k++);
559
+
560
+ G1b(0, 5, 10, 15, BLAKE512_W, k++);
561
+ G2b(0, 5, 10, 15, BLAKE512_W, k++);
562
+ G1b(1, 6, 11, 12, BLAKE512_W, k++);
563
+ G2b(1, 6, 11, 12, BLAKE512_W, k++);
564
+ G1b(2, 7, 8, 13, BLAKE512_W, k++);
565
+ G2b(2, 7, 8, 13, BLAKE512_W, k++);
566
+ G1b(3, 4, 9, 14, BLAKE512_W, k++);
567
+ G2b(3, 4, 9, 14, BLAKE512_W, k++);
568
+ }
569
+ this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0];
570
+ this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1];
571
+ this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2];
572
+ this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3];
573
+ this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4];
574
+ this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5];
575
+ this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6];
576
+ this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7];
577
+ this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0];
578
+ this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1];
579
+ this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2];
580
+ this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3];
581
+ this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4];
582
+ this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5];
583
+ this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6];
584
+ this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7];
585
+ clean(BBUF, BLAKE512_W);
586
+ }
587
+ }
588
+
589
+ /** Internal blake1-224 hash class. */
590
+ export class _BLAKE224 extends BLAKE1_32B {
591
+ constructor(opts: BlakeOpts = {}) {
592
+ super(28, B224_IV, 0b0000_0000, opts);
593
+ }
594
+ }
595
+ /** Internal blake1-256 hash class. */
596
+ export class _BLAKE256 extends BLAKE1_32B {
597
+ constructor(opts: BlakeOpts = {}) {
598
+ super(32, B256_IV, 0b0000_0001, opts);
599
+ }
600
+ }
601
+ /** Internal blake1-384 hash class. */
602
+ export class _BLAKE384 extends BLAKE1_64B {
603
+ constructor(opts: BlakeOpts = {}) {
604
+ super(48, B384_IV, 0b0000_0000, opts);
605
+ }
606
+ }
607
+ /** Internal blake1-512 hash class. */
608
+ export class _BLAKE512 extends BLAKE1_64B {
609
+ constructor(opts: BlakeOpts = {}) {
610
+ super(64, B512_IV, 0b0000_0001, opts);
611
+ }
612
+ }
613
+ /**
614
+ * Blake1-224 hash function.
615
+ * @param msg - message bytes to hash
616
+ * @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
617
+ * `opts.salt` must be exactly 16 bytes.
618
+ * @returns Digest bytes.
619
+ * @example
620
+ * Hash a message with Blake1-224.
621
+ * ```ts
622
+ * blake224(new Uint8Array([97, 98, 99]));
623
+ * ```
624
+ */
625
+ export const blake224: TRet<CHash<_BLAKE224, BlakeOpts>> = /* @__PURE__ */ createHasher(
626
+ (opts) => new _BLAKE224(opts)
627
+ );
628
+ /**
629
+ * Blake1-256 hash function.
630
+ * @param msg - message bytes to hash
631
+ * @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
632
+ * `opts.salt` must be exactly 16 bytes.
633
+ * @returns Digest bytes.
634
+ * @example
635
+ * Hash a message with Blake1-256.
636
+ * ```ts
637
+ * blake256(new Uint8Array([97, 98, 99]));
638
+ * ```
639
+ * @example
640
+ * Hash a message with Blake1-256 and a 16-byte salt.
641
+ * ```ts
642
+ * blake256(new Uint8Array([97, 98, 99]), { salt: new Uint8Array(16) });
643
+ * ```
644
+ */
645
+ export const blake256: TRet<CHash<_BLAKE256, BlakeOpts>> = /* @__PURE__ */ createHasher(
646
+ (opts) => new _BLAKE256(opts)
647
+ );
648
+ /**
649
+ * Blake1-384 hash function.
650
+ * @param msg - message bytes to hash
651
+ * @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
652
+ * `opts.salt` must be exactly 32 bytes.
653
+ * @returns Digest bytes.
654
+ * @example
655
+ * Hash a message with Blake1-384.
656
+ * ```ts
657
+ * blake384(new Uint8Array([97, 98, 99]));
658
+ * ```
659
+ */
660
+ export const blake384: TRet<CHash<_BLAKE384, BlakeOpts>> = /* @__PURE__ */ createHasher(
661
+ (opts) => new _BLAKE384(opts)
662
+ );
663
+ /**
664
+ * Blake1-512 hash function.
665
+ * @param msg - message bytes to hash
666
+ * @param opts - Optional Blake1 settings. See {@link BlakeOpts}. If set,
667
+ * `opts.salt` must be exactly 32 bytes.
668
+ * @returns Digest bytes.
669
+ * @example
670
+ * Hash a message with Blake1-512.
671
+ * ```ts
672
+ * blake512(new Uint8Array([97, 98, 99]));
673
+ * ```
674
+ */
675
+ export const blake512: TRet<CHash<_BLAKE512, BlakeOpts>> = /* @__PURE__ */ createHasher(
676
+ (opts) => new _BLAKE512(opts)
677
+ );