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,143 @@
1
+ export class ObjectIoMetrics {
2
+ now;
3
+ phases = {};
4
+ current = "setup";
5
+ started;
6
+ constructor(now = () => performance.now()) {
7
+ this.now = now;
8
+ this.started = now();
9
+ this.phases[this.current] = { elapsedMs: 0, operations: {} };
10
+ }
11
+ phase(name) {
12
+ const time = this.now();
13
+ this.phases[this.current].elapsedMs += time - this.started;
14
+ this.started = time;
15
+ this.current = name;
16
+ this.phases[name] ??= { elapsedMs: 0, operations: {} };
17
+ }
18
+ async measure(category, name, operation) {
19
+ const operations = this.phases[this.current].operations;
20
+ const entry = operations[`${category}.${name}`] ??= { count: 0, failed: 0, elapsedMs: 0 };
21
+ entry.count++;
22
+ const started = this.now();
23
+ try {
24
+ return await operation();
25
+ }
26
+ catch (error) {
27
+ entry.failed++;
28
+ throw error;
29
+ }
30
+ finally {
31
+ entry.elapsedMs += this.now() - started;
32
+ }
33
+ }
34
+ snapshot() {
35
+ const result = structuredClone(this.phases);
36
+ result[this.current].elapsedMs += this.now() - this.started;
37
+ return result;
38
+ }
39
+ }
40
+ /** Timings are inclusive: store publication can contain staging reads and backend I/O. */
41
+ export function measureObjectIoStore(store, metrics) {
42
+ const version = (head) => ({
43
+ revision: head.revision, stat: head.stat,
44
+ ...(head.publicationToken === undefined ? {} : { publicationToken: head.publicationToken }),
45
+ read: (...args) => metrics.measure("version", "read", () => head.read(...args)),
46
+ close: () => metrics.measure("version", "close", () => head.close()),
47
+ });
48
+ const publish = store.publish;
49
+ const createStaging = store.createStaging;
50
+ return {
51
+ async acquire(...args) {
52
+ const head = await metrics.measure("store", "acquire", () => store.acquire(...args));
53
+ return head && version(head);
54
+ },
55
+ ...(publish ? { async publish(...args) {
56
+ return version(await metrics.measure("store", "publish", () => publish.apply(store, args)));
57
+ } } : {}),
58
+ ...(createStaging ? { async createStaging(...args) {
59
+ const staging = await metrics.measure("store", "createStaging", () => createStaging.apply(store, args));
60
+ return {
61
+ readPage: (...values) => metrics.measure("staging", "readPage", () => staging.readPage(...values)),
62
+ writePage: (...values) => metrics.measure("staging", "writePage", () => staging.writePage(...values)),
63
+ truncate: (...values) => metrics.measure("staging", "truncate", () => staging.truncate(...values)),
64
+ close: () => metrics.measure("staging", "close", () => staging.close()),
65
+ };
66
+ } } : {}),
67
+ };
68
+ }
69
+ export function delayObjectIoBackend(backend, metrics, delayMs, sleep = duration => new Promise(resolve => setTimeout(resolve, duration))) {
70
+ if (!Number.isSafeInteger(delayMs) || delayMs < 0)
71
+ throw new RangeError("Backend delay must be a nonnegative integer");
72
+ return new Proxy(backend, { get(target, property) {
73
+ const value = Reflect.get(target, property, target);
74
+ if (typeof value !== "function")
75
+ return value;
76
+ return (...args) => metrics.measure("backend", String(property), async () => {
77
+ if (delayMs)
78
+ await sleep(delayMs);
79
+ return value.apply(target, args);
80
+ });
81
+ } });
82
+ }
83
+ export function createObjectIoReadbackStream(options) {
84
+ const reader = options.body.getReader({ mode: "byob" });
85
+ const encoder = new TextEncoder();
86
+ let offset = 0;
87
+ let cleanup;
88
+ const dispose = () => cleanup ??= (async () => {
89
+ options.metrics.phase("fixtureCleanup");
90
+ await options.dispose();
91
+ options.metrics.phase("complete");
92
+ })();
93
+ options.metrics.phase("canonicalStream");
94
+ return new ReadableStream({
95
+ async pull(controller) {
96
+ try {
97
+ const chunk = await options.metrics.measure("stream", "read", () => reader.read(new Uint8Array(65536)));
98
+ if (chunk.done) {
99
+ if (offset !== options.size)
100
+ throw new Error("Canonical readback size mismatch");
101
+ await dispose();
102
+ controller.enqueue(encoder.encode(JSON.stringify({ ...options.summary(), type: "summary", completed: true,
103
+ canonicalBytes: offset, phases: options.metrics.snapshot() }) + "\n"));
104
+ controller.close();
105
+ reader.releaseLock();
106
+ return;
107
+ }
108
+ if (offset + chunk.value.length > options.size)
109
+ throw new Error("Canonical readback size mismatch");
110
+ const base64 = btoa(String.fromCharCode(...chunk.value));
111
+ controller.enqueue(encoder.encode(JSON.stringify({ type: "chunk", offset, base64 }) + "\n"));
112
+ offset += chunk.value.length;
113
+ }
114
+ catch (error) {
115
+ let failure = error;
116
+ try {
117
+ await reader.cancel(error);
118
+ }
119
+ catch (cancelError) {
120
+ if (cancelError !== error)
121
+ failure = new AggregateError([error, cancelError], "Readback and cancellation failed");
122
+ }
123
+ try {
124
+ await dispose();
125
+ }
126
+ catch (cleanupError) {
127
+ failure = new AggregateError([failure, cleanupError], "Readback and cleanup failed");
128
+ }
129
+ reader.releaseLock();
130
+ controller.error(failure);
131
+ }
132
+ },
133
+ async cancel(reason) {
134
+ try {
135
+ await reader.cancel(reason);
136
+ }
137
+ finally {
138
+ await dispose();
139
+ reader.releaseLock();
140
+ }
141
+ },
142
+ });
143
+ }
@@ -0,0 +1,19 @@
1
+ import type { FileSystem } from "../contracts/filesystem.js";
2
+ import type { ObjectFileDescriptorOptions, ObjectFilePublicationStore } from "../fs/object-publication/index.js";
3
+ export interface ObjectFilePublicationConformanceFixture {
4
+ readonly fs: FileSystem;
5
+ readonly store: ObjectFilePublicationStore;
6
+ readonly root: string;
7
+ readonly descriptorOptions?: ObjectFileDescriptorOptions;
8
+ dispose(): void | Promise<void>;
9
+ }
10
+ export interface ObjectFilePublicationConformanceOptions {
11
+ readonly createFixture: () => ObjectFilePublicationConformanceFixture | Promise<ObjectFilePublicationConformanceFixture>;
12
+ readonly requireStaging?: boolean;
13
+ readonly descriptorOptions?: ObjectFileDescriptorOptions;
14
+ }
15
+ export interface ObjectFilePublicationConformanceCase {
16
+ readonly name: string;
17
+ run(): Promise<void>;
18
+ }
19
+ export declare function createObjectFilePublicationConformanceCases(options: ObjectFilePublicationConformanceOptions): ObjectFilePublicationConformanceCase[];
@@ -0,0 +1,209 @@
1
+ import { finishCleanup } from "../contracts/cleanup.js";
2
+ import { toByteSource } from "../contracts/io.js";
3
+ import { validatePath } from "../contracts/virtual-path.js";
4
+ import { withObjectFileDescriptors } from "../fs/object-publication/index.js";
5
+ function check(condition, message) {
6
+ if (!condition)
7
+ throw new Error(message);
8
+ }
9
+ function bytes(actual, expected) {
10
+ check(actual instanceof Uint8Array && actual.length === expected.length
11
+ && actual.every((value, index) => value === expected[index]), "object publication returned incorrect bytes");
12
+ }
13
+ function conflict(reason) {
14
+ check(typeof reason === "object" && reason !== null && "code" in reason
15
+ && (reason.code === "EAGAIN" || reason.code === "EEXIST"), "conditional publication must report a version/create conflict");
16
+ }
17
+ export function createObjectFilePublicationConformanceCases(options) {
18
+ const cases = [
19
+ {
20
+ name: "object publication: immutable reads survive replacement",
21
+ async run({ fixture, path, track, publish }) {
22
+ const name = path("pinned");
23
+ const initial = await publish(name, null, new Uint8Array([1, 2, 3, 4]));
24
+ const acquired = await fixture.store.acquire(name, { access: "read" });
25
+ check(acquired, "published file could not be acquired");
26
+ track(acquired);
27
+ check(acquired.revision === initial.revision, "acquisition did not observe the published namespace revision");
28
+ const replacement = await publish(name, initial.revision, new Uint8Array([5, 6, 7]));
29
+ check(replacement.revision !== initial.revision, "namespace revisions must change on publication");
30
+ bytes(await acquired.read(1, 2), new Uint8Array([2, 3]));
31
+ const mutable = await acquired.read(0, 4);
32
+ mutable.fill(0);
33
+ bytes(await acquired.read(0, 4), new Uint8Array([1, 2, 3, 4]));
34
+ bytes(await fixture.fs.readFile(name), new Uint8Array([5, 6, 7]));
35
+ },
36
+ },
37
+ {
38
+ name: "object publication: exclusive create has exactly one winner",
39
+ async run({ fixture, path, publish }) {
40
+ const name = path("exclusive");
41
+ const results = await Promise.allSettled([
42
+ publish(name, null, new Uint8Array([1])), publish(name, null, new Uint8Array([2])),
43
+ ]);
44
+ const winners = results.filter(result => result.status === "fulfilled");
45
+ const failures = results.filter(result => result.status === "rejected");
46
+ check(winners.length === 1 && failures.length === 1, "atomic creation must admit exactly one concurrent writer");
47
+ conflict(failures[0].reason);
48
+ bytes(await fixture.fs.readFile(name), new Uint8Array([results[0].status === "fulfilled" ? 1 : 2]));
49
+ },
50
+ },
51
+ {
52
+ name: "object publication: stale updates cannot replace an acknowledged generation",
53
+ async run({ fixture, path, publish }) {
54
+ const name = path("conditional");
55
+ const initial = await publish(name, null, new Uint8Array([0]));
56
+ const results = await Promise.allSettled([
57
+ publish(name, initial.revision, new Uint8Array([1])),
58
+ publish(name, initial.revision, new Uint8Array([2])),
59
+ ]);
60
+ const failures = results.filter(result => result.status === "rejected");
61
+ check(results.filter(result => result.status === "fulfilled").length === 1 && failures.length === 1, "conditional publication admitted conflicting revisions");
62
+ conflict(failures[0].reason);
63
+ bytes(await fixture.fs.readFile(name), new Uint8Array([results[0].status === "fulfilled" ? 1 : 2]));
64
+ },
65
+ },
66
+ {
67
+ name: "object publication: cancelled creation does not publish",
68
+ async run({ fixture, path, track }) {
69
+ const name = path("cancelled");
70
+ const controller = new AbortController();
71
+ const reason = new Error("conformance cancellation");
72
+ controller.abort(reason);
73
+ let rejected = false;
74
+ try {
75
+ track(await fixture.store.publish(name, null, toByteSource(new Uint8Array([1])), {
76
+ signal: controller.signal, size: 1, mode: 0o600,
77
+ }));
78
+ }
79
+ catch (error) {
80
+ check(error === reason, "publication must preserve cancellation identity");
81
+ rejected = true;
82
+ }
83
+ check(rejected, "cancelled publication succeeded");
84
+ const visible = await fixture.store.acquire(name, { access: "read" });
85
+ if (visible)
86
+ track(visible);
87
+ check(visible === undefined, "cancelled creation left a published key");
88
+ },
89
+ },
90
+ {
91
+ name: "object publication: descriptor updates flush conditionally",
92
+ async run({ fixture, path, track, publish }) {
93
+ const name = path("descriptor");
94
+ await publish(name, null, new Uint8Array([1, 2, 3, 4]));
95
+ const fs = withObjectFileDescriptors(fixture.fs, fixture.store, { chunkBytes: 4, maxStagedBytes: 16, maxFileBytes: 16, ...options.descriptorOptions, ...fixture.descriptorOptions });
96
+ const descriptor = track(await fs.open(name, { access: "readwrite" }));
97
+ check(descriptor.capabilities.publication === "conditional", "descriptor publication profile was lost");
98
+ await descriptor.write(new Uint8Array([7]), 1);
99
+ bytes(await fixture.fs.readFile(name), new Uint8Array([1, 2, 3, 4]));
100
+ await descriptor.sync(false);
101
+ bytes(await fixture.fs.readFile(name), new Uint8Array([1, 7, 3, 4]));
102
+ await descriptor.truncate(2);
103
+ await descriptor.truncate(4);
104
+ await descriptor.sync(false);
105
+ bytes(await fixture.fs.readFile(name), new Uint8Array([1, 7, 0, 0]));
106
+ },
107
+ },
108
+ ];
109
+ if (options.requireStaging)
110
+ cases.push({
111
+ name: "object staging: private pages have owned reads and truncation semantics",
112
+ async run({ fixture, path, track }) {
113
+ const name = path("staged");
114
+ const staging = track(await fixture.store.createStaging(name, { chunkBytes: 4, maxFileBytes: 16 }));
115
+ const sibling = track(await fixture.store.createStaging(name, { chunkBytes: 4, maxFileBytes: 16 }));
116
+ check(await staging.readPage(0) === undefined, "new staging contains an unowned page");
117
+ const input = new Uint8Array([1, 2, 3, 4]);
118
+ await staging.writePage(0, input);
119
+ input.fill(0);
120
+ const retained = await staging.readPage(0);
121
+ check(retained !== undefined, "staging lost an acknowledged page");
122
+ bytes(retained, new Uint8Array([1, 2, 3, 4]));
123
+ retained.fill(0);
124
+ bytes((await staging.readPage(0)), new Uint8Array([1, 2, 3, 4]));
125
+ check(await sibling.readPage(0) === undefined, "staging leaked across descriptors");
126
+ await staging.writePage(2, new Uint8Array([5, 6, 7, 8]));
127
+ await staging.truncate(2);
128
+ bytes((await staging.readPage(0)), new Uint8Array([1, 2, 0, 0]));
129
+ check(await staging.readPage(2) === undefined, "truncate retained a removed page");
130
+ const visible = await fixture.store.acquire(name, { access: "read" });
131
+ if (visible)
132
+ track(visible);
133
+ check(visible === undefined, "private staging published a namespace entry");
134
+ },
135
+ }, {
136
+ name: "object staging: cancelled writes preserve acknowledged pages",
137
+ async run({ fixture, path, track }) {
138
+ const staging = track(await fixture.store.createStaging(path("stage-cancelled"), { chunkBytes: 4, maxFileBytes: 16 }));
139
+ await staging.writePage(0, new Uint8Array([1, 2, 3, 4]));
140
+ const controller = new AbortController();
141
+ const reason = new Error("staging cancellation");
142
+ controller.abort(reason);
143
+ let rejected = false;
144
+ try {
145
+ await staging.writePage(0, new Uint8Array(4), { signal: controller.signal });
146
+ }
147
+ catch (error) {
148
+ check(error === reason, "staging must preserve cancellation identity");
149
+ rejected = true;
150
+ }
151
+ check(rejected, "cancelled staging write succeeded");
152
+ bytes((await staging.readPage(0)), new Uint8Array([1, 2, 3, 4]));
153
+ },
154
+ }, {
155
+ name: "object staging: writes larger than memory stay private until conditional sync",
156
+ async run({ fixture, path, track, publish }) {
157
+ const name = path("stage-descriptor");
158
+ await publish(name, null, new Uint8Array([1, 2, 3, 4]));
159
+ const fs = withObjectFileDescriptors(fixture.fs, fixture.store, { chunkBytes: 4, maxStagedBytes: 4, maxStagedPages: 1, maxFileBytes: 16, ...options.descriptorOptions, ...fixture.descriptorOptions });
160
+ const descriptor = track(await fs.open(name, { access: "readwrite" }));
161
+ const content = new Uint8Array([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
162
+ await descriptor.write(content, 0);
163
+ bytes(await fixture.fs.readFile(name), new Uint8Array([1, 2, 3, 4]));
164
+ const buffer = new Uint8Array(content.length);
165
+ check(await descriptor.read(buffer, 0) === buffer.length, "staging read was incomplete");
166
+ bytes(buffer, content);
167
+ await descriptor.sync(false);
168
+ bytes(await fixture.fs.readFile(name), content);
169
+ },
170
+ });
171
+ return cases.map(entry => ({
172
+ name: entry.name,
173
+ async run() {
174
+ const fixture = await options.createFixture();
175
+ const resources = [];
176
+ let failed = false;
177
+ try {
178
+ validatePath(fixture.root);
179
+ check(fixture.root.startsWith("/"), "conformance fixture root must be absolute");
180
+ check(typeof fixture.store.publish === "function", "conformance requires authoritative conditional publication");
181
+ if (options.requireStaging)
182
+ check(typeof fixture.store.createStaging === "function", "conformance requires private object staging");
183
+ const root = fixture.root.endsWith("/") ? fixture.root.slice(0, -1) : fixture.root;
184
+ const track = (value) => {
185
+ resources.push(value);
186
+ return value;
187
+ };
188
+ await entry.run({ fixture, path: name => `${root}/${name}`, track,
189
+ async publish(path, revision, data) {
190
+ return track(await fixture.store.publish(path, revision, toByteSource(data), { size: data.length, mode: 0o600 }));
191
+ },
192
+ });
193
+ }
194
+ catch (error) {
195
+ failed = true;
196
+ throw error;
197
+ }
198
+ finally {
199
+ await finishCleanup(async () => {
200
+ const closed = await Promise.allSettled(resources.map(resource => resource.close()));
201
+ const rejected = closed.find(result => result.status === "rejected");
202
+ await finishCleanup(() => fixture.dispose(), rejected !== undefined);
203
+ if (rejected?.status === "rejected")
204
+ throw rejected.reason;
205
+ }, failed);
206
+ }
207
+ },
208
+ }));
209
+ }
@@ -0,0 +1 @@
1
+ export * from "@poe-code/xml-ast";
@@ -0,0 +1 @@
1
+ export * from "@poe-code/xml-ast";
@@ -0,0 +1,189 @@
1
+ {
2
+ "private": true,
3
+ "type": "module",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "imports": {
7
+ "#safe-fs-native-seek": {
8
+ "types": "./src/native/loader.d.ts",
9
+ "workerd": "./src/node/native-seek-unavailable.ts",
10
+ "browser": null,
11
+ "worker": null,
12
+ "default": "./dist/native/fs-seek/loader.mjs"
13
+ },
14
+ "#safe-fs-platform": {
15
+ "types": {
16
+ "workerd": "./src/platform/browser.ts",
17
+ "browser": "./src/platform/browser.ts",
18
+ "worker": "./src/platform/browser.ts",
19
+ "default": "./src/platform/node.ts"
20
+ },
21
+ "workerd": "./dist/platform/browser.js",
22
+ "browser": "./dist/platform/browser.js",
23
+ "worker": "./dist/platform/browser.js",
24
+ "default": "./dist/platform/node.js"
25
+ },
26
+ "#safe-fs-platform-path": {
27
+ "types": {
28
+ "workerd": "./src/platform/browser-path.ts",
29
+ "browser": "./src/platform/browser-path.ts",
30
+ "worker": "./src/platform/browser-path.ts",
31
+ "default": "./src/platform/node-path.ts"
32
+ },
33
+ "workerd": "./dist/platform/browser-path.js",
34
+ "browser": "./dist/platform/browser-path.js",
35
+ "worker": "./dist/platform/browser-path.js",
36
+ "default": "./dist/platform/node-path.js"
37
+ },
38
+ "#safe-fs-s3-request": {
39
+ "types": {
40
+ "workerd": "./src/fs/s3/http/request-fetch.ts",
41
+ "browser": "./src/fs/s3/http/request-fetch.ts",
42
+ "worker": "./src/fs/s3/http/request-fetch.ts",
43
+ "default": "./src/fs/s3/http/request-node.ts"
44
+ },
45
+ "workerd": "./dist/fs/s3/http/request-fetch.js",
46
+ "browser": "./dist/fs/s3/http/request-fetch.js",
47
+ "worker": "./dist/fs/s3/http/request-fetch.js",
48
+ "default": "./dist/fs/s3/http/request-node.js"
49
+ }
50
+ },
51
+ "exports": {
52
+ ".": {
53
+ "types": {
54
+ "workerd": "./dist/core.d.ts",
55
+ "browser": "./dist/core.d.ts",
56
+ "worker": "./dist/core.d.ts",
57
+ "default": "./dist/index.d.ts"
58
+ },
59
+ "workerd": "./dist/core.js",
60
+ "browser": "./dist/core.js",
61
+ "worker": "./dist/core.js",
62
+ "import": "./dist/index.js"
63
+ },
64
+ "./contracts": {
65
+ "types": "./dist/contracts/index.d.ts",
66
+ "workerd": "./dist/contracts/index.js",
67
+ "browser": "./dist/contracts/index.js",
68
+ "worker": "./dist/contracts/index.js",
69
+ "import": "./dist/contracts/index.js"
70
+ },
71
+ "./xml": {
72
+ "types": "./dist/xml.d.ts",
73
+ "import": "./dist/xml.js"
74
+ },
75
+ "./core": {
76
+ "types": "./dist/core.d.ts",
77
+ "import": "./dist/core.js"
78
+ },
79
+ "./testing/atomic": {
80
+ "types": "./dist/testing/atomic-filesystem.d.ts",
81
+ "workerd": "./dist/testing/atomic-filesystem.js",
82
+ "browser": "./dist/testing/atomic-filesystem.js",
83
+ "worker": "./dist/testing/atomic-filesystem.js",
84
+ "import": "./dist/testing/atomic-filesystem.js"
85
+ },
86
+ "./testing/object-publication": {
87
+ "types": "./dist/testing/object-publication.d.ts",
88
+ "workerd": "./dist/testing/object-publication.js",
89
+ "browser": "./dist/testing/object-publication.js",
90
+ "worker": "./dist/testing/object-publication.js",
91
+ "import": "./dist/testing/object-publication.js"
92
+ },
93
+ "./node": {
94
+ "types": "./dist/node/index.d.ts",
95
+ "workerd": null,
96
+ "browser": null,
97
+ "import": "./dist/node/index.js"
98
+ },
99
+ "./node/filesystem": {
100
+ "types": {
101
+ "workerd": "./dist/node-unavailable.d.ts",
102
+ "browser": "./dist/node-unavailable.d.ts",
103
+ "worker": "./dist/node-unavailable.d.ts",
104
+ "default": "./dist/node/filesystem.d.ts"
105
+ },
106
+ "workerd": null,
107
+ "browser": null,
108
+ "worker": null,
109
+ "import": "./dist/node/filesystem.js"
110
+ },
111
+ "./fs/memory": {
112
+ "types": "./dist/fs/memory/index.d.ts",
113
+ "import": "./dist/fs/memory/index.js"
114
+ },
115
+ "./fs/real": {
116
+ "types": "./dist/fs/real/index.d.ts",
117
+ "workerd": null,
118
+ "browser": null,
119
+ "import": "./dist/fs/real/index.js"
120
+ },
121
+ "./fs/s3/http": {
122
+ "types": "./dist/fs/s3/http/index.d.ts",
123
+ "import": "./dist/fs/s3/http/index.js"
124
+ },
125
+ "./fs/s3": {
126
+ "types": "./dist/fs/s3/index.d.ts",
127
+ "import": "./dist/fs/s3/index.js"
128
+ },
129
+ "./fs/webdav": {
130
+ "types": "./dist/fs/webdav/index.d.ts",
131
+ "import": "./dist/fs/webdav/index.js"
132
+ },
133
+ "./fs/readonly": {
134
+ "types": "./dist/fs/readonly/index.d.ts",
135
+ "import": "./dist/fs/readonly/index.js"
136
+ },
137
+ "./fs/mount": {
138
+ "types": "./dist/fs/mount/index.d.ts",
139
+ "import": "./dist/fs/mount/index.js"
140
+ },
141
+ "./fs/overlay": {
142
+ "types": "./dist/fs/overlay/index.d.ts",
143
+ "import": "./dist/fs/overlay/index.js"
144
+ },
145
+ "./fs/quota": {
146
+ "types": "./dist/fs/quota/index.d.ts",
147
+ "import": "./dist/fs/quota/index.js"
148
+ },
149
+ "./contracts/object": {
150
+ "types": "./dist/contracts/object.d.ts",
151
+ "import": "./dist/contracts/object.js"
152
+ },
153
+ "./contracts/errors": {
154
+ "types": "./dist/contracts/errors.d.ts",
155
+ "import": "./dist/contracts/errors.js"
156
+ },
157
+ "./runtime-core": {
158
+ "types": "./dist/runtime-core.d.ts",
159
+ "import": "./dist/runtime-core.js"
160
+ },
161
+ "./bridge": {
162
+ "types": "./dist/bridge/index.d.ts",
163
+ "import": "./dist/bridge/index.js"
164
+ }
165
+ },
166
+ "files": [
167
+ "dist",
168
+ "README.md",
169
+ "PROVENANCE.json",
170
+ "LICENSE"
171
+ ],
172
+ "devDependencies": {
173
+ "node-api-headers": "1.9.0"
174
+ },
175
+ "scripts": {
176
+ "build": "node ../../scripts/guard-package-dist.mjs && tsc -p tsconfig.json && node scripts/native-assets.mjs",
177
+ "build:portable": "node ../../scripts/guard-package-dist.mjs && tsc -p tsconfig.json && node scripts/native-assets.mjs --portable",
178
+ "typecheck": "tsc -p tsconfig.json --noEmit",
179
+ "typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
180
+ "test:staging-native": "node --import tsx --test tests/integration/real-staging-hardlinks.test.mjs",
181
+ "test:unit": "cd ../.. && vitest run packages/safe-fs"
182
+ },
183
+ "repository": {
184
+ "type": "git",
185
+ "url": "git+https://github.com/poe-platform/poe-code.git",
186
+ "directory": "packages/safe-fs"
187
+ },
188
+ "license": "MIT"
189
+ }
@@ -14,6 +14,8 @@ Multi-list task manager with pluggable storage backends.
14
14
 
15
15
  The task lifecycle is `draft -> planned -> in-progress -> done -> archived`. `archived` is terminal.
16
16
 
17
+ In Workers or browsers, pass a `@poe-code/safe-fs` filesystem through `fs` for Markdown and YAML stores. It must support exclusive writes, rename, unlink, and rmdir for atomic updates and locks. Node uses its host filesystem by default. GitHub stores work with an explicit `auth.token`; automatic `gh` authentication requires a host runner.
18
+
17
19
  ## Public API
18
20
 
19
21
  - `openTaskList(options)`: opens a task store and returns a `TaskList`
@@ -1,4 +1,4 @@
1
- import { type Runner } from "@poe-code/process-runner";
1
+ import type { Runner } from "@poe-code/process-runner";
2
2
  export interface GhClientOptions {
3
3
  token: string;
4
4
  endpoint?: string;
@@ -1,5 +1,4 @@
1
- import { text } from "node:stream/consumers";
2
- import { createHostRunner } from "@poe-code/process-runner";
1
+ import { createDefaultRunner } from "#task-list-host";
3
2
  import { UserError } from "@poe-code/user-error";
4
3
  const DEFAULT_ENDPOINT = "https://api.github.com/graphql";
5
4
  const USER_AGENT = "poe-code-task-list/0.0.1";
@@ -41,7 +40,7 @@ export async function resolveAuth(options) {
41
40
  if (options.explicitToken !== undefined) {
42
41
  return options.explicitToken;
43
42
  }
44
- const runner = options.runner ?? createHostRunner();
43
+ const runner = options.runner ?? createDefaultRunner();
45
44
  const handle = runner.exec({
46
45
  command: "gh",
47
46
  args: ["auth", "token"],
@@ -60,10 +59,18 @@ export async function resolveAuth(options) {
60
59
  return token;
61
60
  }
62
61
  export function resolveEndpoint(options = {}) {
63
- const env = options.env ?? process.env;
62
+ const env = options.env ?? globalThis.process?.env ?? {};
64
63
  const host = env.GH_HOST;
65
64
  if (host !== undefined && host !== "" && host !== "github.com") {
66
65
  return `https://${host}/api/graphql`;
67
66
  }
68
67
  return DEFAULT_ENDPOINT;
69
68
  }
69
+ async function text(stream) {
70
+ const decoder = new TextDecoder();
71
+ let result = "";
72
+ for await (const chunk of stream) {
73
+ result += typeof chunk === "string" ? decoder.decode() + chunk : decoder.decode(chunk, { stream: true });
74
+ }
75
+ return result + decoder.decode();
76
+ }
@@ -1,4 +1,4 @@
1
- import path from "node:path";
1
+ import { path } from "../paths.js";
2
2
  import { parseDocument, stringify } from "yaml";
3
3
  import { TASK_SCHEMA_ID } from "../schema/ids.js";
4
4
  import { eventsFromState, findEvent } from "../state-machine.js";
@@ -503,7 +503,7 @@ function createTasksView(deps, layout, list) {
503
503
  const desiredFilename = activeTaskFilename(entry.id, desiredOrder, width);
504
504
  if (entry.filename !== desiredFilename) {
505
505
  const fromPath = path.join(listDirectoryPath, entry.filename);
506
- const stagingPath = path.join(listDirectoryPath, `${desiredFilename}.staging-${process.pid}-${index}`);
506
+ const stagingPath = path.join(listDirectoryPath, `${desiredFilename}.staging-${crypto.randomUUID()}-${index}`);
507
507
  const targetPath = path.join(listDirectoryPath, desiredFilename);
508
508
  try {
509
509
  await deps.fs.rename(fromPath, stagingPath);