toolcraft 0.0.749 → 0.0.751

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,70 @@
1
+ /**
2
+ * HKDF (RFC 5869): extract + expand in one step.
3
+ * See {@link https://soatok.blog/2021/11/17/understanding-hkdf/}.
4
+ * @module
5
+ */
6
+ import { type _HMAC } from './hmac.ts';
7
+ import { type CHash, type TArg, type TRet } from './utils.ts';
8
+ /**
9
+ * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK`
10
+ * Arguments position differs from spec (IKM is first one, since it is not optional)
11
+ * Local validation only checks `hash`; `ikm` / `salt` byte validation is delegated to `hmac()`.
12
+ * @param hash - hash function that would be used (e.g. sha256)
13
+ * @param ikm - input keying material, the initial key
14
+ * @param salt - optional salt value (a non-secret random value)
15
+ * @returns Pseudorandom key derived from input keying material.
16
+ * @example
17
+ * Run the HKDF extract step.
18
+ * ```ts
19
+ * import { extract } from '@noble/hashes/hkdf.js';
20
+ * import { sha256 } from '@noble/hashes/sha2.js';
21
+ * extract(sha256, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
22
+ * ```
23
+ */
24
+ export declare function extract(hash: TArg<CHash>, ikm: TArg<Uint8Array>, salt?: TArg<Uint8Array>): TRet<Uint8Array>;
25
+ /**
26
+ * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM`
27
+ * @param hash - hash function that would be used (e.g. sha256)
28
+ * @param prk - a pseudorandom key of at least HashLen octets
29
+ * (usually, the output from the extract step)
30
+ * @param info - optional context and application specific information (can be a zero-length string)
31
+ * @param length - length of output keying material in bytes.
32
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
33
+ * @param _recycled - Internal destroyed extract hashes owned by the combined `hkdf()` call.
34
+ * @returns Output keying material with the requested length.
35
+ * @throws If the requested output length exceeds the HKDF limit
36
+ * for the selected hash. {@link Error}
37
+ * @example
38
+ * Run the HKDF expand step.
39
+ * ```ts
40
+ * import { expand } from '@noble/hashes/hkdf.js';
41
+ * import { sha256 } from '@noble/hashes/sha2.js';
42
+ * expand(sha256, new Uint8Array(32), new Uint8Array([1, 2, 3]), 16);
43
+ * ```
44
+ */
45
+ export declare function expand(hash: TArg<CHash>, prk: TArg<Uint8Array>, info?: TArg<Uint8Array>, length?: number, _recycled?: _HMAC<any>): TRet<Uint8Array>;
46
+ /**
47
+ * HKDF (RFC 5869): derive keys from an initial input.
48
+ * Combines hkdf_extract + hkdf_expand in one step
49
+ * @param hash - hash function that would be used (e.g. sha256)
50
+ * @param ikm - input keying material, the initial key
51
+ * @param salt - optional salt value (a non-secret random value)
52
+ * @param info - optional context and application specific information bytes
53
+ * @param length - length of output keying material in bytes.
54
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
55
+ * @returns Output keying material derived from the input key.
56
+ * @throws If the requested output length exceeds the HKDF limit
57
+ * for the selected hash. {@link Error}
58
+ * @example
59
+ * HKDF (RFC 5869): derive keys from an initial input.
60
+ * ```ts
61
+ * import { hkdf } from '@noble/hashes/hkdf.js';
62
+ * import { sha256 } from '@noble/hashes/sha2.js';
63
+ * import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
64
+ * const inputKey = randomBytes(32);
65
+ * const salt = randomBytes(32);
66
+ * const info = utf8ToBytes('application-key');
67
+ * const okm = hkdf(sha256, inputKey, salt, info, 32);
68
+ * ```
69
+ */
70
+ export declare const hkdf: (hash: TArg<CHash>, ikm: TArg<Uint8Array>, salt: TArg<Uint8Array | undefined>, info: TArg<Uint8Array | undefined>, length: number) => TRet<Uint8Array>;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * HKDF (RFC 5869): extract + expand in one step.
3
+ * See {@link https://soatok.blog/2021/11/17/understanding-hkdf/}.
4
+ * @module
5
+ */
6
+ import { hmac } from "./hmac.js";
7
+ import { abytes, ahash, anumber, clean } from "./utils.js";
8
+ /**
9
+ * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK`
10
+ * Arguments position differs from spec (IKM is first one, since it is not optional)
11
+ * Local validation only checks `hash`; `ikm` / `salt` byte validation is delegated to `hmac()`.
12
+ * @param hash - hash function that would be used (e.g. sha256)
13
+ * @param ikm - input keying material, the initial key
14
+ * @param salt - optional salt value (a non-secret random value)
15
+ * @returns Pseudorandom key derived from input keying material.
16
+ * @example
17
+ * Run the HKDF extract step.
18
+ * ```ts
19
+ * import { extract } from '@noble/hashes/hkdf.js';
20
+ * import { sha256 } from '@noble/hashes/sha2.js';
21
+ * extract(sha256, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
22
+ * ```
23
+ */
24
+ export function extract(hash, ikm, salt) {
25
+ ahash(hash);
26
+ // NOTE: some libraries treat zero-length array as 'not provided';
27
+ // we don't, since we have undefined as 'not provided'
28
+ // https://github.com/RustCrypto/KDFs/issues/15
29
+ if (salt === undefined)
30
+ salt = new Uint8Array(hash.outputLen);
31
+ return hmac(hash, salt, ikm);
32
+ }
33
+ // Shared mutable scratch byte for the RFC 5869 block counter `N`.
34
+ // Safe to reuse because `expand()` is synchronous and resets it with `clean(...)` before returning.
35
+ const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0);
36
+ // Shared RFC 5869 empty string for both `info === undefined` and the first-block `T(0)` input.
37
+ const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
38
+ /**
39
+ * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM`
40
+ * @param hash - hash function that would be used (e.g. sha256)
41
+ * @param prk - a pseudorandom key of at least HashLen octets
42
+ * (usually, the output from the extract step)
43
+ * @param info - optional context and application specific information (can be a zero-length string)
44
+ * @param length - length of output keying material in bytes.
45
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
46
+ * @param _recycled - Internal destroyed extract hashes owned by the combined `hkdf()` call.
47
+ * @returns Output keying material with the requested length.
48
+ * @throws If the requested output length exceeds the HKDF limit
49
+ * for the selected hash. {@link Error}
50
+ * @example
51
+ * Run the HKDF expand step.
52
+ * ```ts
53
+ * import { expand } from '@noble/hashes/hkdf.js';
54
+ * import { sha256 } from '@noble/hashes/sha2.js';
55
+ * expand(sha256, new Uint8Array(32), new Uint8Array([1, 2, 3]), 16);
56
+ * ```
57
+ */
58
+ export function expand(hash, prk, info, length = 32, _recycled) {
59
+ ahash(hash);
60
+ anumber(length, 'length');
61
+ abytes(prk, undefined, 'prk');
62
+ const olen = hash.outputLen;
63
+ // RFC 5869 §2.3: PRK is "a pseudorandom key of at least HashLen octets".
64
+ if (prk.length < olen)
65
+ throw new Error('"prk" must be at least HashLen octets');
66
+ // RFC 5869 §2.3 only bounds `L` by `<= 255*HashLen`; `L=0` is valid and yields empty OKM.
67
+ if (length > 255 * olen)
68
+ throw new Error('Length must be <= 255*HashLen');
69
+ const blocks = Math.ceil(length / olen);
70
+ if (info === undefined)
71
+ info = EMPTY_BUFFER;
72
+ else
73
+ abytes(info, undefined, 'info');
74
+ if (!blocks) {
75
+ if (_recycled)
76
+ clean(prk); // Full hkdf() owns this intermediate PRK.
77
+ return new Uint8Array();
78
+ }
79
+ // first L(ength) octets of T
80
+ // The private PRK can become both T and a one-block result after HMAC consumes the key.
81
+ const okm = _recycled && blocks === 1 ? prk : new Uint8Array(blocks * olen);
82
+ const { iHash, oHash } = hmac.create(hash, prk);
83
+ // Driving them directly also skips `_HMAC.digestInto`'s per-digest destroy.
84
+ const T = _recycled ? prk : new Uint8Array(olen);
85
+ // Full hkdf() donates one destroyed extract hash; standalone creates one alternating worker.
86
+ const worker = blocks > 1 ? _recycled?.iHash || hash.create() : undefined;
87
+ for (let counter = 0; counter < blocks - 1; counter++) {
88
+ HKDF_COUNTER[0] = counter + 1;
89
+ const iWork = iHash._cloneInto(worker);
90
+ // T(0) = empty string (zero length)
91
+ // T(N) = HMAC-Hash(PRK, T(N-1) | info | N)
92
+ if (counter)
93
+ iWork.update(T);
94
+ iWork.update(info).update(HKDF_COUNTER).digestInto(T);
95
+ oHash._cloneInto(worker).update(T).digestInto(T);
96
+ okm.set(T, olen * counter);
97
+ }
98
+ // Midstates are key-equivalent: they allow computing HMAC(prk, ...) for any message.
99
+ HKDF_COUNTER[0] = blocks; // Final block consumes them; retain worker for cleanup.
100
+ if (blocks > 1)
101
+ iHash.update(T);
102
+ iHash.update(info).update(HKDF_COUNTER).digestInto(T);
103
+ oHash.update(T).digestInto(T);
104
+ okm.set(T, olen * (blocks - 1));
105
+ iHash.destroy(); // Raw digests may leave key-derived base/worker state; wipe all explicitly.
106
+ oHash.destroy();
107
+ worker?.destroy();
108
+ if (T !== okm)
109
+ clean(T); // Wipe private T/PRK; standalone preserves caller-owned PRK.
110
+ clean(HKDF_COUNTER);
111
+ // Exact fit: return without the extra copy.
112
+ if (length === okm.length)
113
+ return okm;
114
+ // Copy the requested prefix, then wipe the full buffer: its tail holds
115
+ // up to HashLen-1 bytes of derived key material past `length`.
116
+ const res = okm.slice(0, length);
117
+ clean(okm);
118
+ return res;
119
+ }
120
+ /**
121
+ * HKDF (RFC 5869): derive keys from an initial input.
122
+ * Combines hkdf_extract + hkdf_expand in one step
123
+ * @param hash - hash function that would be used (e.g. sha256)
124
+ * @param ikm - input keying material, the initial key
125
+ * @param salt - optional salt value (a non-secret random value)
126
+ * @param info - optional context and application specific information bytes
127
+ * @param length - length of output keying material in bytes.
128
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
129
+ * @returns Output keying material derived from the input key.
130
+ * @throws If the requested output length exceeds the HKDF limit
131
+ * for the selected hash. {@link Error}
132
+ * @example
133
+ * HKDF (RFC 5869): derive keys from an initial input.
134
+ * ```ts
135
+ * import { hkdf } from '@noble/hashes/hkdf.js';
136
+ * import { sha256 } from '@noble/hashes/sha2.js';
137
+ * import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
138
+ * const inputKey = randomBytes(32);
139
+ * const salt = randomBytes(32);
140
+ * const info = utf8ToBytes('application-key');
141
+ * const okm = hkdf(sha256, inputKey, salt, info, 32);
142
+ * ```
143
+ */
144
+ export const hkdf = (hash, ikm, salt, info, length) => {
145
+ ahash(hash);
146
+ if (salt === undefined)
147
+ salt = new Uint8Array(hash.outputLen);
148
+ const HMAC = hmac.create(hash, salt).update(ikm);
149
+ // The intermediate PRK is secret key material; wipe it instead of
150
+ // leaving it for GC.
151
+ return expand(hash, HMAC.digest(), info, length, HMAC); // expand() owns and consumes it.
152
+ };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * HMAC: RFC2104 message authentication code.
3
+ * @module
4
+ */
5
+ import { type CHash, type Hash, type TArg, type TRet } from './utils.ts';
6
+ /**
7
+ * Internal class for HMAC.
8
+ * Accepts any byte key, although RFC 2104 §3 recommends keys at least
9
+ * `HashLen` bytes long.
10
+ */
11
+ export declare class _HMAC<T extends Hash<T>> implements Hash<_HMAC<T>> {
12
+ oHash: T;
13
+ iHash: T;
14
+ blockLen: number;
15
+ outputLen: number;
16
+ canXOF: boolean;
17
+ private finished;
18
+ private destroyed;
19
+ constructor(hash: TArg<CHash>, key: TArg<Uint8Array>);
20
+ update(buf: TArg<Uint8Array>): this;
21
+ digestInto(out: TArg<Uint8Array>): void;
22
+ digest(): TRet<Uint8Array>;
23
+ _cloneInto(to?: _HMAC<T>): _HMAC<T>;
24
+ clone(): _HMAC<T>;
25
+ destroy(): void;
26
+ }
27
+ /**
28
+ * HMAC: RFC2104 message authentication code.
29
+ * @param hash - function that would be used e.g. sha256
30
+ * @param key - authentication key bytes
31
+ * @param message - message bytes to authenticate
32
+ * @returns Authentication tag bytes.
33
+ * @example
34
+ * Compute an RFC 2104 HMAC directly and with an incremental state.
35
+ * ```ts
36
+ * import { hmac } from '@noble/hashes/hmac.js';
37
+ * import { sha256 } from '@noble/hashes/sha2.js';
38
+ * const key = new Uint8Array([1, 2, 3]);
39
+ * const message = new Uint8Array([4, 5, 6]);
40
+ * const mac = hmac(sha256, key, message);
41
+ * const out = new Uint8Array(sha256.outputLen);
42
+ * hmac.create(sha256, key).update(message).digestInto(out);
43
+ * ```
44
+ */
45
+ type HmacFn = {
46
+ (hash: TArg<CHash>, key: TArg<Uint8Array>, message: TArg<Uint8Array>): TRet<Uint8Array>;
47
+ create(hash: TArg<CHash>, key: TArg<Uint8Array>): TRet<_HMAC<any>>;
48
+ };
49
+ export declare const hmac: TRet<HmacFn>;
50
+ export {};
@@ -0,0 +1,93 @@
1
+ /**
2
+ * HMAC: RFC2104 message authentication code.
3
+ * @module
4
+ */
5
+ import { abytes, aexists, ahash, aoutput, clean, } from "./utils.js";
6
+ /**
7
+ * Internal class for HMAC.
8
+ * Accepts any byte key, although RFC 2104 §3 recommends keys at least
9
+ * `HashLen` bytes long.
10
+ */
11
+ export class _HMAC {
12
+ oHash;
13
+ iHash;
14
+ blockLen;
15
+ outputLen;
16
+ canXOF = false;
17
+ finished = false;
18
+ destroyed = false;
19
+ constructor(hash, key) {
20
+ ahash(hash);
21
+ abytes(key, undefined, 'key');
22
+ this.iHash = hash.create();
23
+ if (typeof this.iHash.update !== 'function')
24
+ throw new Error('expected Hash instance');
25
+ this.blockLen = this.iHash.blockLen;
26
+ this.outputLen = this.iHash.outputLen;
27
+ const blockLen = this.blockLen;
28
+ const pad = new Uint8Array(blockLen);
29
+ // blockLen can be bigger than outputLen
30
+ pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
31
+ for (let i = 0; i < pad.length; i++)
32
+ pad[i] ^= 0x36;
33
+ this.iHash.update(pad);
34
+ // By doing update (processing of the first block) of the outer hash here,
35
+ // we can re-use it between multiple calls via clone.
36
+ this.oHash = hash.create();
37
+ // Undo internal XOR && apply outer XOR
38
+ for (let i = 0; i < pad.length; i++)
39
+ pad[i] ^= 0x36 ^ 0x5c;
40
+ this.oHash.update(pad);
41
+ clean(pad);
42
+ }
43
+ update(buf) {
44
+ aexists(this);
45
+ this.iHash.update(buf);
46
+ return this;
47
+ }
48
+ digestInto(out) {
49
+ aexists(this);
50
+ aoutput(out, this);
51
+ this.finished = true;
52
+ const buf = out.subarray(0, this.outputLen);
53
+ // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before
54
+ // overwriting that same prefix with the final tag, leaving any oversized tail untouched.
55
+ this.iHash.digestInto(buf);
56
+ this.oHash.update(buf);
57
+ this.oHash.digestInto(buf);
58
+ this.destroy();
59
+ }
60
+ digest() {
61
+ const out = new Uint8Array(this.oHash.outputLen);
62
+ this.digestInto(out);
63
+ return out;
64
+ }
65
+ _cloneInto(to) {
66
+ // Create new instance without calling constructor since the key
67
+ // is already in state and we don't know it.
68
+ to ||= Object.create(Object.getPrototypeOf(this), {});
69
+ const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;
70
+ to = to;
71
+ to.finished = finished;
72
+ to.destroyed = destroyed;
73
+ to.blockLen = blockLen;
74
+ to.outputLen = outputLen;
75
+ to.canXOF = canXOF;
76
+ to.oHash = oHash._cloneInto(to.oHash);
77
+ to.iHash = iHash._cloneInto(to.iHash);
78
+ return to;
79
+ }
80
+ clone() {
81
+ return this._cloneInto();
82
+ }
83
+ destroy() {
84
+ this.destroyed = true;
85
+ this.oHash.destroy();
86
+ this.iHash.destroy();
87
+ }
88
+ }
89
+ export const hmac = /* @__PURE__ */ (() => {
90
+ const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());
91
+ hmac_.create = (hash, key) => new _HMAC(hash, key);
92
+ return hmac_;
93
+ })();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Audited & minimal JS implementation of hash functions, MACs, and KDFs.
3
+ * Check out individual modules.
4
+ * @module
5
+ * @example
6
+ ```js
7
+ import {
8
+ sha256, sha384, sha512, sha224, sha512_224, sha512_256
9
+ } from '@noble/hashes/sha2.js';
10
+ import {
11
+ sha3_224, sha3_256, sha3_384, sha3_512,
12
+ keccak_224, keccak_256, keccak_384, keccak_512,
13
+ shake128, shake256
14
+ } from '@noble/hashes/sha3.js';
15
+ import {
16
+ cshake128, cshake256,
17
+ turboshake128, turboshake256,
18
+ kt128, kt256,
19
+ kmac128, kmac256,
20
+ tuplehash256, parallelhash256,
21
+ keccakprg
22
+ } from '@noble/hashes/sha3-addons.js';
23
+ import { blake3 } from '@noble/hashes/blake3.js';
24
+ import { blake2b, blake2s } from '@noble/hashes/blake2.js';
25
+ import { hmac } from '@noble/hashes/hmac.js';
26
+ import { hkdf } from '@noble/hashes/hkdf.js';
27
+ import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js';
28
+ import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js';
29
+ import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js';
30
+ import * as utils from '@noble/hashes/utils.js';
31
+ ```
32
+ */
33
+ throw new Error('root module cannot be imported: import submodules instead. Check out README');
34
+ export {};
@@ -0,0 +1,107 @@
1
+ /**
2
+
3
+ SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.
4
+ RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,
5
+ not the base RIPEMD-160 compression spec.
6
+ Don't use them in a new protocol. What "weak" means:
7
+
8
+ - Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.
9
+ - No practical pre-image attacks (only theoretical, 2^123.4)
10
+ - HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151
11
+ * @module
12
+ */
13
+ import { HashMD } from './_md.ts';
14
+ import { type CHash, type TRet } from './utils.ts';
15
+ /** Internal SHA1 legacy hash class. */
16
+ export declare class _SHA1 extends HashMD<_SHA1> {
17
+ private A;
18
+ private B;
19
+ private C;
20
+ private D;
21
+ private E;
22
+ constructor();
23
+ protected get(): [number, number, number, number, number];
24
+ protected set(A: number, B: number, C: number, D: number, E: number): void;
25
+ _cloneInto(to?: _SHA1): _SHA1;
26
+ protected process(view: DataView, offset: number): void;
27
+ protected roundClean(): void;
28
+ destroy(): void;
29
+ }
30
+ /**
31
+ * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.
32
+ * @param msg - message bytes to hash
33
+ * @param opts - Reserved hash options.
34
+ * @returns Digest bytes.
35
+ * @example
36
+ * Hash a message with SHA1.
37
+ * ```ts
38
+ * sha1(new Uint8Array([97, 98, 99]));
39
+ * ```
40
+ */
41
+ export declare const sha1: TRet<CHash>;
42
+ /** Internal MD5 legacy hash class. */
43
+ export declare class _MD5 extends HashMD<_MD5> {
44
+ private A;
45
+ private B;
46
+ private C;
47
+ private D;
48
+ constructor();
49
+ protected get(): [number, number, number, number];
50
+ protected set(A: number, B: number, C: number, D: number): void;
51
+ _cloneInto(to?: _MD5): _MD5;
52
+ protected process(view: DataView, offset: number): void;
53
+ protected roundClean(): void;
54
+ destroy(): void;
55
+ }
56
+ /**
57
+ * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.
58
+ * MD5 architecture is similar to SHA1, with some differences:
59
+ * - Reduced output length: 16 bytes (128 bit) instead of 20
60
+ * - 64 rounds, instead of 80
61
+ * - Little-endian: could be faster, but will require more code
62
+ * - Non-linear index selection: huge speed-up for unroll
63
+ * - Per round constants: more memory accesses, additional speed-up for unroll
64
+ * @param msg - message bytes to hash
65
+ * @param opts - Reserved hash options.
66
+ * @returns Digest bytes.
67
+ * @example
68
+ * Hash a message with MD5.
69
+ * ```ts
70
+ * md5(new Uint8Array([97, 98, 99]));
71
+ * ```
72
+ */
73
+ export declare const md5: TRet<CHash>;
74
+ /**
75
+ * Internal RIPEMD-160 legacy hash class.
76
+ * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.
77
+ */
78
+ export declare class _RIPEMD160 extends HashMD<_RIPEMD160> {
79
+ private h0;
80
+ private h1;
81
+ private h2;
82
+ private h3;
83
+ private h4;
84
+ constructor();
85
+ protected get(): [number, number, number, number, number];
86
+ protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void;
87
+ _cloneInto(to?: _RIPEMD160): _RIPEMD160;
88
+ protected process(view: DataView, offset: number): void;
89
+ protected roundClean(): void;
90
+ destroy(): void;
91
+ }
92
+ /**
93
+ * RIPEMD-160 - a legacy hash function from 1990s.
94
+ * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point
95
+ * at the base RIPEMD-160 references.
96
+ * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}
97
+ * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}
98
+ * @param msg - message bytes to hash
99
+ * @param opts - Reserved hash options.
100
+ * @returns Digest bytes.
101
+ * @example
102
+ * Hash a message with RIPEMD-160.
103
+ * ```ts
104
+ * ripemd160(new Uint8Array([97, 98, 99]));
105
+ * ```
106
+ */
107
+ export declare const ripemd160: TRet<CHash>;