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,121 @@
1
+ import { type Pbkdf2Opt } from './pbkdf2.ts';
2
+ import { type KDFInput, type TArg, type TRet } from './utils.ts';
3
+ /** Callable WebCrypto hash function descriptor. */
4
+ export type WebHash = {
5
+ /**
6
+ * Hashes one message with the selected WebCrypto digest.
7
+ * @param msg - message bytes to hash
8
+ * @returns Promise resolving to digest bytes.
9
+ */
10
+ (msg: TArg<Uint8Array>): Promise<TRet<Uint8Array>>;
11
+ /** WebCrypto algorithm name passed to `crypto.subtle`. */
12
+ webCryptoName: string;
13
+ /** Digest size in bytes. */
14
+ outputLen: number;
15
+ /** Input block size in bytes. */
16
+ blockLen: number;
17
+ };
18
+ /** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */
19
+ /**
20
+ * WebCrypto SHA2-256 hash function from RFC 6234.
21
+ * @param msg - message bytes to hash
22
+ * @returns Promise resolving to digest bytes.
23
+ * @example
24
+ * Hash a message with WebCrypto SHA2-256.
25
+ * ```ts
26
+ * await sha256(new Uint8Array([97, 98, 99]));
27
+ * ```
28
+ */
29
+ export declare const sha256: TRet<WebHash>;
30
+ /**
31
+ * WebCrypto SHA2-384 hash function from RFC 6234.
32
+ * @param msg - message bytes to hash
33
+ * @returns Promise resolving to digest bytes.
34
+ * @example
35
+ * Hash a message with WebCrypto SHA2-384.
36
+ * ```ts
37
+ * await sha384(new Uint8Array([97, 98, 99]));
38
+ * ```
39
+ */
40
+ export declare const sha384: TRet<WebHash>;
41
+ /**
42
+ * WebCrypto SHA2-512 hash function from RFC 6234.
43
+ * @param msg - message bytes to hash
44
+ * @returns Promise resolving to digest bytes.
45
+ * @example
46
+ * Hash a message with WebCrypto SHA2-512.
47
+ * ```ts
48
+ * await sha512(new Uint8Array([97, 98, 99]));
49
+ * ```
50
+ */
51
+ export declare const sha512: TRet<WebHash>;
52
+ /** WebCrypto HMAC function type. See {@link hmac} for usage. */
53
+ type WebHmacFn = {
54
+ (hash: TArg<WebHash>, key: TArg<Uint8Array>, message: TArg<Uint8Array>): Promise<TRet<Uint8Array>>;
55
+ create(hash: TArg<WebHash>, key: TArg<Uint8Array>): any;
56
+ };
57
+ /**
58
+ * WebCrypto HMAC: RFC2104 message authentication code.
59
+ * @param hash - function that would be used e.g. sha256. Webcrypto version.
60
+ * @param key - authentication key bytes
61
+ * @param message - message bytes to authenticate
62
+ * @returns Promise resolving to authentication tag bytes.
63
+ * `.create()` exists only to mirror the synchronous API surface
64
+ * and always throws `not implemented`.
65
+ * @example
66
+ * Compute an RFC 2104 HMAC with WebCrypto.
67
+ * ```ts
68
+ * import { hmac, sha256 } from '@noble/hashes/webcrypto.js';
69
+ * const key = new Uint8Array([1, 2, 3]);
70
+ * const message = new Uint8Array([4, 5, 6]);
71
+ * const mac = await hmac(sha256, key, message);
72
+ * ```
73
+ */
74
+ export declare const hmac: TRet<WebHmacFn>;
75
+ /**
76
+ * WebCrypto HKDF (RFC 5869): derive keys from an initial input.
77
+ * Combines hkdf_extract + hkdf_expand in one step
78
+ * @param hash - hash function that would be used (e.g. sha256). Webcrypto version.
79
+ * @param ikm - input keying material, the initial key
80
+ * @param salt - optional salt value (a non-secret random value)
81
+ * @param info - optional context and application specific information bytes
82
+ * @param length - length of output keying material in bytes.
83
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` requests an empty OKM.
84
+ * @returns Promise resolving to derived key bytes.
85
+ * The RFC `L <= 255 * HashLen` bound is enforced before calling WebCrypto.
86
+ * @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
87
+ * @example
88
+ * WebCrypto HKDF (RFC 5869): derive keys from an initial input.
89
+ * ```ts
90
+ * import { hkdf, sha256 } from '@noble/hashes/webcrypto.js';
91
+ * import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
92
+ * const inputKey = randomBytes(32);
93
+ * const salt = randomBytes(32);
94
+ * const info = utf8ToBytes('application-key');
95
+ * const okm = await hkdf(sha256, inputKey, salt, info, 32);
96
+ * ```
97
+ */
98
+ export declare function hkdf(hash: TArg<WebHash>, ikm: TArg<Uint8Array>, salt: TArg<Uint8Array | undefined>, info: TArg<Uint8Array | undefined>, length: number): Promise<TRet<Uint8Array>>;
99
+ /**
100
+ * WebCrypto PBKDF2-HMAC: RFC 8018 key derivation function.
101
+ * @param hash - hash function that would be used e.g. sha256. Webcrypto version.
102
+ * @param password - password from which a derived key is generated; string
103
+ * inputs are normalized through `kdfInputToBytes()`, i.e. UTF-8
104
+ * @param salt - cryptographic salt; string inputs are normalized through
105
+ * `kdfInputToBytes()`, i.e. UTF-8
106
+ * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,
107
+ * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.
108
+ * @returns Promise resolving to derived key bytes.
109
+ * Positive-iteration enforcement is currently delegated to backend
110
+ * `deriveBits()` rejection (for example `c = 0`), not a dedicated
111
+ * library-side guard. Values above the signed 32-bit backend range are rejected locally.
112
+ * @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
113
+ * @example
114
+ * WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function.
115
+ * ```ts
116
+ * import { pbkdf2, sha256 } from '@noble/hashes/webcrypto.js';
117
+ * const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
118
+ * ```
119
+ */
120
+ export declare function pbkdf2(hash: TArg<WebHash>, password: TArg<KDFInput>, salt: TArg<KDFInput>, opts: Pbkdf2Opt): Promise<TRet<Uint8Array>>;
121
+ export {};
@@ -0,0 +1,228 @@
1
+ import {} from "./pbkdf2.js";
2
+ import { abytes, ahash, anumber, checkOpts, clean, copyBytes, kdfInputToBytes, } from "./utils.js";
3
+ function _subtle() {
4
+ const cr = typeof globalThis === 'object' ? globalThis.crypto : null;
5
+ const sb = cr?.subtle;
6
+ if (typeof sb === 'object' && sb != null)
7
+ return sb;
8
+ throw new Error('crypto.subtle must be defined');
9
+ }
10
+ function createWebHash(name, blockLen, outputLen) {
11
+ const hashC = async (msg) => {
12
+ abytes(msg);
13
+ const crypto = _subtle();
14
+ return new Uint8Array(await crypto.digest(name, msg));
15
+ };
16
+ hashC.webCryptoName = name; // make sure it won't interfere with function name
17
+ hashC.outputLen = outputLen;
18
+ hashC.blockLen = blockLen;
19
+ hashC.create = () => {
20
+ // Present only so this async wrapper satisfies the shared
21
+ // hash-wrapper shape checked by `ahashWeb()`.
22
+ throw new Error('not implemented');
23
+ };
24
+ // Later WebCrypto HMAC/HKDF/PBKDF2 calls read descriptor metadata directly, so freezing prevents
25
+ // callers from retargeting a `sha256` wrapper into a different backend digest by mutation.
26
+ return Object.freeze(hashC);
27
+ }
28
+ function ahashWeb(hash) {
29
+ ahash(hash);
30
+ const name = hash.webCryptoName;
31
+ if (typeof name !== 'string')
32
+ throw new Error('non-web hash');
33
+ return name;
34
+ }
35
+ /** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */
36
+ // export const sha1: WebHash = createHash('SHA-1', 64, 20);
37
+ /**
38
+ * WebCrypto SHA2-256 hash function from RFC 6234.
39
+ * @param msg - message bytes to hash
40
+ * @returns Promise resolving to digest bytes.
41
+ * @example
42
+ * Hash a message with WebCrypto SHA2-256.
43
+ * ```ts
44
+ * await sha256(new Uint8Array([97, 98, 99]));
45
+ * ```
46
+ */
47
+ export const sha256 = /* @__PURE__ */ createWebHash('SHA-256', 64, 32);
48
+ /**
49
+ * WebCrypto SHA2-384 hash function from RFC 6234.
50
+ * @param msg - message bytes to hash
51
+ * @returns Promise resolving to digest bytes.
52
+ * @example
53
+ * Hash a message with WebCrypto SHA2-384.
54
+ * ```ts
55
+ * await sha384(new Uint8Array([97, 98, 99]));
56
+ * ```
57
+ */
58
+ export const sha384 = /* @__PURE__ */ createWebHash('SHA-384', 128, 48);
59
+ /**
60
+ * WebCrypto SHA2-512 hash function from RFC 6234.
61
+ * @param msg - message bytes to hash
62
+ * @returns Promise resolving to digest bytes.
63
+ * @example
64
+ * Hash a message with WebCrypto SHA2-512.
65
+ * ```ts
66
+ * await sha512(new Uint8Array([97, 98, 99]));
67
+ * ```
68
+ */
69
+ export const sha512 = /* @__PURE__ */ createWebHash('SHA-512', 128, 64);
70
+ /**
71
+ * WebCrypto HMAC: RFC2104 message authentication code.
72
+ * @param hash - function that would be used e.g. sha256. Webcrypto version.
73
+ * @param key - authentication key bytes
74
+ * @param message - message bytes to authenticate
75
+ * @returns Promise resolving to authentication tag bytes.
76
+ * `.create()` exists only to mirror the synchronous API surface
77
+ * and always throws `not implemented`.
78
+ * @example
79
+ * Compute an RFC 2104 HMAC with WebCrypto.
80
+ * ```ts
81
+ * import { hmac, sha256 } from '@noble/hashes/webcrypto.js';
82
+ * const key = new Uint8Array([1, 2, 3]);
83
+ * const message = new Uint8Array([4, 5, 6]);
84
+ * const mac = await hmac(sha256, key, message);
85
+ * ```
86
+ */
87
+ export const hmac = /* @__PURE__ */ (() => {
88
+ const hmac_ = async (hash, key, message) => {
89
+ const crypto = _subtle();
90
+ abytes(key, undefined, 'key');
91
+ abytes(message, undefined, 'message');
92
+ const hashName = ahashWeb(hash);
93
+ // importKey() snapshots key synchronously, but message is not passed to sign() until after
94
+ // importKey() resolves. Keep the wrapper's inputs stable across that await.
95
+ const _message = copyBytes(message);
96
+ try {
97
+ // WebCrypto keys can't be zeroized
98
+ // prettier-ignore
99
+ const wkey = await crypto.importKey('raw', key, { name: 'HMAC', hash: hashName }, false, ['sign']);
100
+ return new Uint8Array(await crypto.sign('HMAC', wkey, _message));
101
+ }
102
+ finally {
103
+ clean(_message);
104
+ }
105
+ };
106
+ hmac_.create = (_hash, _key) => {
107
+ throw new Error('not implemented');
108
+ };
109
+ return hmac_;
110
+ })();
111
+ /**
112
+ * WebCrypto HKDF (RFC 5869): derive keys from an initial input.
113
+ * Combines hkdf_extract + hkdf_expand in one step
114
+ * @param hash - hash function that would be used (e.g. sha256). Webcrypto version.
115
+ * @param ikm - input keying material, the initial key
116
+ * @param salt - optional salt value (a non-secret random value)
117
+ * @param info - optional context and application specific information bytes
118
+ * @param length - length of output keying material in bytes.
119
+ * RFC 5869 §2.3 allows `0..255*HashLen`, so `0` requests an empty OKM.
120
+ * @returns Promise resolving to derived key bytes.
121
+ * The RFC `L <= 255 * HashLen` bound is enforced before calling WebCrypto.
122
+ * @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
123
+ * @example
124
+ * WebCrypto HKDF (RFC 5869): derive keys from an initial input.
125
+ * ```ts
126
+ * import { hkdf, sha256 } from '@noble/hashes/webcrypto.js';
127
+ * import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
128
+ * const inputKey = randomBytes(32);
129
+ * const salt = randomBytes(32);
130
+ * const info = utf8ToBytes('application-key');
131
+ * const okm = await hkdf(sha256, inputKey, salt, info, 32);
132
+ * ```
133
+ */
134
+ export async function hkdf(hash, ikm, salt, info, length) {
135
+ const crypto = _subtle();
136
+ const hashName = ahashWeb(hash);
137
+ const hashOutputLen = hash.outputLen;
138
+ abytes(ikm, undefined, 'ikm');
139
+ anumber(length, 'length');
140
+ if (length > 255 * hashOutputLen)
141
+ throw new Error('Length must be <= 255*HashLen');
142
+ if (salt !== undefined)
143
+ abytes(salt, undefined, 'salt');
144
+ if (info !== undefined)
145
+ abytes(info, undefined, 'info');
146
+ // salt and info reach deriveBits() only after importKey() resolves, so snapshot them now.
147
+ const _salt = salt === undefined ? new Uint8Array(0) : copyBytes(salt);
148
+ const _info = info === undefined ? new Uint8Array(0) : copyBytes(info);
149
+ try {
150
+ const wkey = await crypto.importKey('raw', ikm, 'HKDF', false, ['deriveBits']);
151
+ const opts = { name: 'HKDF', hash: hashName, salt: _salt, info: _info };
152
+ const out = new Uint8Array(await crypto.deriveBits(opts, wkey, 8 * length));
153
+ if (out.length !== length) {
154
+ clean(out);
155
+ throw new Error('WebCrypto returned an invalid derived key length');
156
+ }
157
+ return out;
158
+ }
159
+ finally {
160
+ clean(_salt, _info);
161
+ }
162
+ }
163
+ /**
164
+ * WebCrypto PBKDF2-HMAC: RFC 8018 key derivation function.
165
+ * @param hash - hash function that would be used e.g. sha256. Webcrypto version.
166
+ * @param password - password from which a derived key is generated; string
167
+ * inputs are normalized through `kdfInputToBytes()`, i.e. UTF-8
168
+ * @param salt - cryptographic salt; string inputs are normalized through
169
+ * `kdfInputToBytes()`, i.e. UTF-8
170
+ * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,
171
+ * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.
172
+ * @returns Promise resolving to derived key bytes.
173
+ * Positive-iteration enforcement is currently delegated to backend
174
+ * `deriveBits()` rejection (for example `c = 0`), not a dedicated
175
+ * library-side guard. Values above the signed 32-bit backend range are rejected locally.
176
+ * @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
177
+ * @example
178
+ * WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function.
179
+ * ```ts
180
+ * import { pbkdf2, sha256 } from '@noble/hashes/webcrypto.js';
181
+ * const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
182
+ * ```
183
+ */
184
+ export async function pbkdf2(hash, password, salt, opts) {
185
+ const crypto = _subtle();
186
+ const hashName = ahashWeb(hash);
187
+ const _opts = checkOpts({ dkLen: 32 }, opts);
188
+ const { c, dkLen } = _opts;
189
+ anumber(c, 'c');
190
+ anumber(dkLen, 'dkLen');
191
+ // Node's native WebCrypto PBKDF2 binding accepts only a signed 32-bit iteration count and aborts
192
+ // the process on larger values instead of returning a rejected promise.
193
+ if (c > 0x7fffffff)
194
+ throw new Error('"c" exceeds WebCrypto backend limit');
195
+ // RFC 8018 §5.2 defines dkLen as a positive integer.
196
+ if (dkLen < 1)
197
+ throw new Error('"dkLen" must be >= 1');
198
+ // SubtleCrypto.deriveBits() accepts an unsigned-long bit count. Byte lengths at or above
199
+ // 2^29 would wrap after multiplication by eight instead of requesting the intended length.
200
+ if (dkLen >= 2 ** 29)
201
+ throw new Error('derived key too long');
202
+ const _password = kdfInputToBytes(password, 'password');
203
+ try {
204
+ const saltBytes = kdfInputToBytes(salt, 'salt');
205
+ // String conversion already returns an owned array. Caller-owned byte salts need a snapshot
206
+ // because deriveBits() does not receive them until after importKey() resolves.
207
+ const _salt = typeof salt === 'string' ? saltBytes : copyBytes(saltBytes);
208
+ try {
209
+ const key = await crypto.importKey('raw', _password, 'PBKDF2', false, [
210
+ 'deriveBits',
211
+ ]);
212
+ const deriveOpts = { name: 'PBKDF2', salt: _salt, iterations: c, hash: hashName };
213
+ const out = new Uint8Array(await crypto.deriveBits(deriveOpts, key, 8 * dkLen));
214
+ if (out.length !== dkLen) {
215
+ clean(out);
216
+ throw new Error('WebCrypto returned an invalid derived key length');
217
+ }
218
+ return out;
219
+ }
220
+ finally {
221
+ clean(_salt);
222
+ }
223
+ }
224
+ finally {
225
+ if (typeof password === 'string')
226
+ clean(_password);
227
+ }
228
+ }
@@ -1,11 +1,7 @@
1
- import path from "node:path";
2
- import { isDeepStrictEqual } from "node:util";
1
+ import { dirname } from "@poe-code/safe-fs/contracts";
3
2
  import { runMutations, configMutation, fileMutation } from "@poe-code/config-mutations";
4
3
  import { getAgentConfig, resolveConfigPath, isSupported } from "./configs.js";
5
4
  import { getShapeTransformer } from "./shapes.js";
6
- function getConfigDirectory(configPath) {
7
- return path.dirname(configPath);
8
- }
9
5
  export class UnsupportedAgentError extends Error {
10
6
  constructor(agentId) {
11
7
  super(`Unsupported agent: ${agentId}`);
@@ -69,7 +65,7 @@ export async function configure(agentId, server, options) {
69
65
  await unconfigure(agentId, enabledServer, options);
70
66
  return;
71
67
  }
72
- const configDir = getConfigDirectory(configPath);
68
+ const configDir = dirname(configPath);
73
69
  await runMutations([
74
70
  fileMutation.ensureDirectory({
75
71
  path: configDir,
@@ -87,12 +83,12 @@ export async function configure(agentId, server, options) {
87
83
  : undefined;
88
84
  const shapedServer = shaped;
89
85
  const enabledShapedServer = enabledShaped;
90
- if (existingServer !== undefined && isDeepStrictEqual(existingServer, shapedServer)) {
86
+ if (existingServer !== undefined && sameConfiguration(existingServer, shapedServer)) {
91
87
  return { changed: false, content: document };
92
88
  }
93
89
  if (existingServer !== undefined &&
94
90
  (enabledShapedServer === undefined ||
95
- !isDeepStrictEqual(existingServer, enabledShapedServer))) {
91
+ !sameConfiguration(existingServer, enabledShapedServer))) {
96
92
  throw new Error(`MCP server "${server.name}" already exists with different configuration in ${configPath}.`);
97
93
  }
98
94
  const newServers = {
@@ -131,7 +127,7 @@ export async function unconfigure(agentId, server, options) {
131
127
  return { changed: false, content: document };
132
128
  }
133
129
  if (expectedServer !== undefined &&
134
- !isDeepStrictEqual(servers[serverName], expectedServer)) {
130
+ !sameConfiguration(servers[serverName], expectedServer)) {
135
131
  return { changed: false, content: document };
136
132
  }
137
133
  const newServers = { ...servers };
@@ -155,3 +151,21 @@ export async function unconfigure(agentId, server, options) {
155
151
  observers: options.observers
156
152
  });
157
153
  }
154
+ function sameConfiguration(left, right) {
155
+ if (Object.is(left, right))
156
+ return true;
157
+ if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
158
+ return false;
159
+ }
160
+ if (Array.isArray(left) !== Array.isArray(right))
161
+ return false;
162
+ if (left instanceof Date || right instanceof Date) {
163
+ return left instanceof Date && right instanceof Date && Object.is(left.getTime(), right.getTime());
164
+ }
165
+ if (Array.isArray(left) && Array.isArray(right) && left.length !== right.length)
166
+ return false;
167
+ const keys = Object.keys(left);
168
+ if (keys.length !== Object.keys(right).length)
169
+ return false;
170
+ return keys.every(key => Object.hasOwn(right, key) && sameConfiguration(left[key], right[key]));
171
+ }
@@ -2,6 +2,8 @@
2
2
 
3
3
  Composable file and config mutation engine.
4
4
 
5
+ The runtime works without Node built-ins: paths default to portable POSIX semantics, atomic writes use Web Crypto IDs, and filesystem access is injected. The testing filesystem returns `Uint8Array` bytes when no encoding is requested.
6
+
5
7
  This package applies ordered filesystem, JSON, TOML, YAML, and template
6
8
  mutations with dry-run support and observer hooks. Callers inject the filesystem
7
9
  so tests can use in-memory adapters and production flows can use
@@ -1,6 +1,5 @@
1
- import { randomUUID } from "node:crypto";
2
- import nativePath from "node:path";
3
- import { renderTemplate } from "toolcraft-design";
1
+ import { posixPath as defaultPath } from "@poe-code/safe-fs/contracts";
2
+ import { renderTemplate } from "toolcraft-design/components/template";
4
3
  import { isConfigObject } from "../types.js";
5
4
  import { getConfigFormat, detectFormat } from "../formats/index.js";
6
5
  import { cloneConfigObject, setConfigEntry } from "../formats/object.js";
@@ -47,7 +46,7 @@ async function assertRegularWriteTarget(context, targetPath) {
47
46
  // plant one to redirect a credential/config write outside it. Symlinks at or
48
47
  // above home are legitimate system links (e.g. /tmp -> /private/tmp on macOS,
49
48
  // /var -> /private/var) and must not block writes, so bound the walk at home.
50
- const path = context.paths ?? nativePath;
49
+ const path = context.paths ?? defaultPath;
51
50
  const boundary = path.dirname(path.resolve(context.homeDir));
52
51
  let currentPath = path.resolve(targetPath);
53
52
  while (currentPath !== boundary) {
@@ -71,7 +70,7 @@ async function assertRegularWriteTarget(context, targetPath) {
71
70
  async function writeAtomically(context, targetPath, content) {
72
71
  await assertRegularWriteTarget(context, targetPath);
73
72
  for (let attempt = 0; attempt < 10; attempt += 1) {
74
- const tempPath = `${targetPath}.mutation-tmp-${process.pid}-${randomUUID()}`;
73
+ const tempPath = `${targetPath}.mutation-tmp-${globalThis.crypto.randomUUID()}`;
75
74
  let tempCreated = false;
76
75
  try {
77
76
  await assertRegularWriteTarget(context, tempPath);
@@ -1,9 +1,8 @@
1
- import nativePath from "node:path";
2
- import type { PathMapper } from "../types.js";
1
+ import type { MutationContext, PathMapper } from "../types.js";
3
2
  /**
4
3
  * Expand ~ shortcut to the provided home directory.
5
4
  */
6
- export declare function expandHome(targetPath: string, homeDir: string, path?: typeof nativePath): string;
5
+ export declare function expandHome(targetPath: string, homeDir: string, path?: NonNullable<MutationContext["paths"]>): string;
7
6
  /**
8
7
  * Validate that a path is home-relative (starts with ~).
9
8
  * Throws if the path is not home-relative.
@@ -15,4 +14,4 @@ export declare function validateHomePath(targetPath: string): void;
15
14
  * 2. Expands ~ to home directory
16
15
  * 3. If pathMapper is provided, maps the directory portion and reconstructs the path
17
16
  */
18
- export declare function resolvePath(rawPath: string, homeDir: string, pathMapper?: PathMapper, path?: typeof nativePath): string;
17
+ export declare function resolvePath(rawPath: string, homeDir: string, pathMapper?: PathMapper, path?: NonNullable<MutationContext["paths"]>): string;
@@ -1,8 +1,8 @@
1
- import nativePath from "node:path";
1
+ import { posixPath as defaultPath } from "@poe-code/safe-fs/contracts";
2
2
  /**
3
3
  * Expand ~ shortcut to the provided home directory.
4
4
  */
5
- export function expandHome(targetPath, homeDir, path = nativePath) {
5
+ export function expandHome(targetPath, homeDir, path = defaultPath) {
6
6
  if (!targetPath?.startsWith("~")) {
7
7
  return targetPath;
8
8
  }
@@ -42,7 +42,7 @@ export function validateHomePath(targetPath) {
42
42
  * 2. Expands ~ to home directory
43
43
  * 3. If pathMapper is provided, maps the directory portion and reconstructs the path
44
44
  */
45
- export function resolvePath(rawPath, homeDir, pathMapper, path = nativePath) {
45
+ export function resolvePath(rawPath, homeDir, pathMapper, path = defaultPath) {
46
46
  validateHomePath(rawPath);
47
47
  const expanded = expandHome(rawPath, homeDir, path);
48
48
  const canonicalHome = path.resolve(homeDir);
@@ -1,4 +1,4 @@
1
- import { renderTemplate as renderDesignTemplate } from "toolcraft-design";
1
+ import { renderTemplate as renderDesignTemplate } from "toolcraft-design/components/template";
2
2
  /**
3
3
  * Render a mustache template with the given variables.
4
4
  * HTML escaping is disabled.
@@ -9,8 +9,8 @@ export interface MockFileSystem extends FileSystem {
9
9
  /** Get file content or undefined if not found */
10
10
  getContent(path: string): string | undefined;
11
11
  /** Read file with encoding overloads for compatibility */
12
- readFile(path: string, encoding: BufferEncoding): Promise<string>;
13
- readFile(path: string): Promise<Buffer>;
12
+ readFile(path: string, encoding: "utf8"): Promise<string>;
13
+ readFile(path: string): Promise<Uint8Array>;
14
14
  }
15
15
  export interface MockFsOptions {
16
16
  /** Initial files - paths can use ~ which will be expanded to homeDir */
@@ -1,4 +1,4 @@
1
- import path from "node:path";
1
+ import { posixPath as path } from "@poe-code/safe-fs/contracts";
2
2
  const DEFAULT_HOME_DIR = "/home/test";
3
3
  /**
4
4
  * Create an in-memory mock filesystem for testing mutations.
@@ -43,7 +43,7 @@ export function createMockFs(initialFiles, homeDir = DEFAULT_HOME_DIR) {
43
43
  if (encoding) {
44
44
  return content;
45
45
  }
46
- return Buffer.from(content, "utf8");
46
+ return new TextEncoder().encode(content);
47
47
  },
48
48
  async writeFile(filePath, content, options) {
49
49
  const absolutePath = expandPath(filePath, homeDir);
@@ -62,11 +62,8 @@ export function createMockFs(initialFiles, homeDir = DEFAULT_HOME_DIR) {
62
62
  if (typeof content === "string") {
63
63
  files[absolutePath] = content;
64
64
  }
65
- else if (Buffer.isBuffer(content)) {
66
- files[absolutePath] = content.toString("utf8");
67
- }
68
65
  else {
69
- files[absolutePath] = Buffer.from(content.buffer, content.byteOffset, content.byteLength).toString("utf8");
66
+ files[absolutePath] = new TextDecoder().decode(new Uint8Array(content.buffer, content.byteOffset, content.byteLength));
70
67
  }
71
68
  },
72
69
  async mkdir(dirPath, options) {
@@ -52,8 +52,10 @@ export interface PathMapper {
52
52
  }): string;
53
53
  }
54
54
  export interface MutationContext {
55
- /** Path operations for the filesystem namespace; defaults to native host paths. */
56
- paths?: typeof import("node:path");
55
+ /** Path operations for the filesystem namespace; defaults to portable POSIX paths. */
56
+ paths?: Pick<typeof import("@poe-code/safe-fs/contracts").posixPath, "join" | "resolve" | "relative" | "isAbsolute" | "dirname" | "basename"> & {
57
+ readonly sep: string;
58
+ };
57
59
  /** Filesystem interface - required */
58
60
  fs: FileSystem;
59
61
  /** Home directory for ~ expansion - required */
@@ -4,7 +4,6 @@ Low-level process execution abstraction. Single interface for launching processe
4
4
 
5
5
  ## Overview
6
6
 
7
- - No external dependencies
8
7
  - Consumed by `@poe-code/agent-spawn`
9
8
  - Consumed by `process-launcher`
10
9
 
@@ -40,4 +39,6 @@ This package exposes no environment variables.
40
39
 
41
40
  This package currently exposes no package-level configuration options.
42
41
 
42
+ Import `uploadWorkspace` and `downloadWorkspace` from `@poe-code/process-runner/workspace-transfer` for portable transfers. Pass SafeFS `FileSystem` instances as `fs` and `remoteFs` in Workers; the host filesystem remains the default in Node.
43
+
43
44
  Workspace transfer validates a positive finite upload limit and applies gitignore traversal rules: an ignored parent must be unignored before its children can be included. Docker template hashing honors `.dockerignore`. Docker port mappings, wait output, and detached completion markers are validated before use.
@@ -0,0 +1 @@
1
+ export { createHostFileSystem as createDefaultFileSystem } from "@poe-code/safe-fs/node";
@@ -0,0 +1 @@
1
+ export { createHostFileSystem as createDefaultFileSystem } from "@poe-code/safe-fs/node";
@@ -0,0 +1,2 @@
1
+ import type { FileSystem } from "@poe-code/safe-fs/contracts";
2
+ export declare function createDefaultFileSystem(): FileSystem;
@@ -0,0 +1 @@
1
+ export function createDefaultFileSystem() { throw new Error("Workspace transfer requires an injected filesystem in Workers."); }
@@ -59,7 +59,7 @@ export interface OpenSpec {
59
59
  stderr?: RunSpec["stderr"];
60
60
  env?: RunSpec["env"];
61
61
  tty?: boolean;
62
- input?: string | Buffer;
62
+ input?: string | Uint8Array;
63
63
  captureOutput?: boolean;
64
64
  /** Keep stdout callbacks and draining, without retaining its full text when false. */
65
65
  captureStdout?: boolean;
@@ -1,3 +1,4 @@
1
+ import type { FileSystem } from "@poe-code/safe-fs/contracts";
1
2
  import type { DownloadResult, UploadResult } from "./types.js";
2
3
  export type { DownloadResult, UploadResult } from "./types.js";
3
4
  export interface WorkspaceTransferDirent {
@@ -19,9 +20,9 @@ export interface WorkspaceTransferFileSystem {
19
20
  readdir(path: string, options: {
20
21
  withFileTypes: true;
21
22
  }): Promise<WorkspaceTransferDirent[]>;
22
- readFile(path: string): Promise<Buffer>;
23
- readFile(path: string, encoding: BufferEncoding): Promise<string>;
24
- writeFile(path: string, data: string | Buffer, options?: {
23
+ readFile(path: string): Promise<Uint8Array>;
24
+ readFile(path: string, encoding: "utf8"): Promise<string>;
25
+ writeFile(path: string, data: string | Uint8Array, options?: {
25
26
  flag?: string;
26
27
  mode?: number;
27
28
  }): Promise<void>;
@@ -39,8 +40,8 @@ export interface WorkspaceTransferEnv {
39
40
  cwd: string;
40
41
  uploadDir: string;
41
42
  workspaceDir?: string;
42
- fs?: WorkspaceTransferFileSystem;
43
- remoteFs?: WorkspaceTransferFileSystem;
43
+ fs?: WorkspaceTransferFileSystem | FileSystem;
44
+ remoteFs?: WorkspaceTransferFileSystem | FileSystem;
44
45
  }
45
46
  export interface WorkspaceTransferOptions {
46
47
  runner?: WorkspaceTransferRunnerOptions;