toolcraft 0.0.749 → 0.0.751
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composition.json +23 -3
- package/dist/composition.json +23 -3
- package/dist/human-in-loop/approvals-commands.d.ts +1 -1
- package/dist/index.d.ts +1 -262
- package/dist/index.js +1 -573
- package/dist/runtime-platform.d.ts +2 -0
- package/dist/runtime-platform.js +2 -0
- package/dist/runtime-platform.workerd.d.ts +3 -0
- package/dist/runtime-platform.workerd.js +10 -0
- package/dist/runtime.d.ts +262 -0
- package/dist/runtime.js +576 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +478 -0
- package/node_modules/@noble/hashes/_blake.d.ts +20 -0
- package/node_modules/@noble/hashes/_blake.js +59 -0
- package/node_modules/@noble/hashes/_md.d.ts +95 -0
- package/node_modules/@noble/hashes/_md.js +209 -0
- package/node_modules/@noble/hashes/_u64.d.ts +36 -0
- package/node_modules/@noble/hashes/_u64.js +77 -0
- package/node_modules/@noble/hashes/argon2.d.ts +148 -0
- package/node_modules/@noble/hashes/argon2.js +577 -0
- package/node_modules/@noble/hashes/blake1.d.ts +162 -0
- package/node_modules/@noble/hashes/blake1.js +630 -0
- package/node_modules/@noble/hashes/blake2.d.ts +203 -0
- package/node_modules/@noble/hashes/blake2.js +573 -0
- package/node_modules/@noble/hashes/blake3.d.ts +68 -0
- package/node_modules/@noble/hashes/blake3.js +310 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +91 -0
- package/node_modules/@noble/hashes/eskdf.js +225 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +70 -0
- package/node_modules/@noble/hashes/hkdf.js +152 -0
- package/node_modules/@noble/hashes/hmac.d.ts +50 -0
- package/node_modules/@noble/hashes/hmac.js +93 -0
- package/node_modules/@noble/hashes/index.d.ts +1 -0
- package/node_modules/@noble/hashes/index.js +34 -0
- package/node_modules/@noble/hashes/legacy.d.ts +107 -0
- package/node_modules/@noble/hashes/legacy.js +348 -0
- package/node_modules/@noble/hashes/package.json +91 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +66 -0
- package/node_modules/@noble/hashes/pbkdf2.js +176 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +98 -0
- package/node_modules/@noble/hashes/scrypt.js +304 -0
- package/node_modules/@noble/hashes/sha2.d.ts +176 -0
- package/node_modules/@noble/hashes/sha2.js +446 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +533 -0
- package/node_modules/@noble/hashes/sha3-addons.js +973 -0
- package/node_modules/@noble/hashes/sha3.d.ts +208 -0
- package/node_modules/@noble/hashes/sha3.js +475 -0
- package/node_modules/@noble/hashes/src/_blake.ts +67 -0
- package/node_modules/@noble/hashes/src/_md.ts +227 -0
- package/node_modules/@noble/hashes/src/_u64.ts +111 -0
- package/node_modules/@noble/hashes/src/argon2.ts +693 -0
- package/node_modules/@noble/hashes/src/blake1.ts +677 -0
- package/node_modules/@noble/hashes/src/blake2.ts +648 -0
- package/node_modules/@noble/hashes/src/blake3.ts +344 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +265 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +161 -0
- package/node_modules/@noble/hashes/src/hmac.ts +130 -0
- package/node_modules/@noble/hashes/src/index.ts +33 -0
- package/node_modules/@noble/hashes/src/legacy.ts +361 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +219 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +375 -0
- package/node_modules/@noble/hashes/src/sha2.ts +486 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +1157 -0
- package/node_modules/@noble/hashes/src/sha3.ts +525 -0
- package/node_modules/@noble/hashes/src/utils.ts +978 -0
- package/node_modules/@noble/hashes/src/webcrypto.ts +283 -0
- package/node_modules/@noble/hashes/utils.d.ts +560 -0
- package/node_modules/@noble/hashes/utils.js +687 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts +121 -0
- package/node_modules/@noble/hashes/webcrypto.js +228 -0
- package/node_modules/@poe-code/agent-mcp-config/dist/apply.js +23 -9
- package/node_modules/@poe-code/config-mutations/README.md +2 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +4 -5
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +3 -4
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +3 -3
- package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +2 -2
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +3 -6
- package/node_modules/@poe-code/config-mutations/dist/types.d.ts +4 -2
- package/node_modules/@poe-code/process-runner/README.md +2 -1
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.d.ts +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.d.ts +2 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/types.d.ts +1 -1
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +6 -5
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +67 -29
- package/node_modules/@poe-code/process-runner/package.json +13 -0
- package/node_modules/@poe-code/safe-fs/LICENSE +21 -0
- package/node_modules/@poe-code/safe-fs/PROVENANCE.json +428 -0
- package/node_modules/@poe-code/safe-fs/README.md +411 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.js +171 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.d.ts +93 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.js +453 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.js +37 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.d.ts +81 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.js +65 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.js +7 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.js +16 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.js +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.js +46 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.d.ts +38 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.d.ts +53 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.js +99 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.d.ts +379 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.js +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.js +321 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.d.ts +134 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.js +97 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.js +162 -0
- package/node_modules/@poe-code/safe-fs/dist/core.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/core.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.js +216 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.js +279 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.d.ts +59 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.js +875 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.js +250 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.js +136 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.d.ts +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.js +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.d.ts +186 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.js +3771 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +96 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.js +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.js +144 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.js +118 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.js +29 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.d.ts +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.js +1291 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.js +287 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +45 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +531 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.d.ts +87 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.js +1185 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.d.ts +42 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.js +558 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.js +520 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.d.ts +37 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.js +208 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.js +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.d.ts +105 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.js +1259 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.js +38 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.d.ts +130 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.js +1137 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.js +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.js +111 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.d.ts +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.js +89 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.d.ts +20 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.js +76 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.js +478 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.d.ts +30 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.d.ts +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.js +192 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.js +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.js +167 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.d.ts +48 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.js +249 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.js +400 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.js +73 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.d.ts +103 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.js +28 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +663 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.js +115 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.js +109 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.d.ts +141 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.js +1377 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.js +59 -0
- package/node_modules/@poe-code/safe-fs/dist/index.d.ts +25 -0
- package/node_modules/@poe-code/safe-fs/dist/index.js +21 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/linux-x64-glibc.node +0 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.mjs +120 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/manifest.json +46 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.js +30 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.js +54 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/package.json +29 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.js +58 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.js +64 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.js +357 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.d.ts +51 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.js +243 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.js +446 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.js +61 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.js +57 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.d.ts +16 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.js +496 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.d.ts +23 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.js +39 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.d.ts +31 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.js +143 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.js +209 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.js +1 -0
- package/node_modules/@poe-code/safe-fs/package.json +189 -0
- package/node_modules/@poe-code/task-list/README.md +2 -0
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +1 -1
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +11 -4
- package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +2 -2
- package/node_modules/@poe-code/task-list/dist/backends/utils.js +5 -7
- package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +1 -1
- package/node_modules/@poe-code/task-list/dist/default-host.d.ts +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.js +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.d.ts +4 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.js +6 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.d.ts +3 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.js +32 -0
- package/node_modules/@poe-code/task-list/dist/move.js +3 -3
- package/node_modules/@poe-code/task-list/dist/open.js +2 -5
- package/node_modules/@poe-code/task-list/dist/paths.d.ts +12 -0
- package/node_modules/@poe-code/task-list/dist/paths.js +7 -0
- package/node_modules/@poe-code/task-list/dist/types.d.ts +6 -5
- package/node_modules/@poe-code/task-list/package.json +9 -0
- package/node_modules/@poe-code/terminal-text/LICENSE +21 -0
- package/node_modules/@poe-code/terminal-text/README.md +12 -0
- package/node_modules/@poe-code/terminal-text/dist/index.d.ts +2 -0
- package/node_modules/@poe-code/terminal-text/dist/index.js +20 -0
- package/node_modules/@poe-code/terminal-text/package.json +22 -0
- package/node_modules/@poe-code/xml-ast/LICENSE +21 -0
- package/node_modules/@poe-code/xml-ast/README.md +28 -0
- package/node_modules/@poe-code/xml-ast/dist/index.d.ts +47 -0
- package/node_modules/@poe-code/xml-ast/dist/index.js +635 -0
- package/node_modules/@poe-code/xml-ast/package.json +25 -0
- package/node_modules/auth-store/README.md +35 -0
- package/node_modules/auth-store/dist/index.browser.d.ts +4 -0
- package/node_modules/auth-store/dist/index.browser.js +2 -0
- package/node_modules/auth-store/dist/provider-store.d.ts +1 -1
- package/node_modules/auth-store/dist/safe-fs-secret-store.d.ts +21 -0
- package/node_modules/auth-store/dist/safe-fs-secret-store.js +119 -0
- package/node_modules/auth-store/dist/secret-store.d.ts +12 -0
- package/node_modules/auth-store/dist/secret-store.js +1 -0
- package/node_modules/auth-store/dist/transaction-lock.d.ts +2 -4
- package/node_modules/auth-store/dist/types.d.ts +2 -9
- package/node_modules/auth-store/package.json +16 -2
- package/node_modules/tiny-http-mcp-server/dist/composition.json +16 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +25 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-state.js +4 -4
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +6 -40
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.d.ts +10 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.js +20 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/pkce.js +4 -3
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts +14 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js +53 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.d.ts +16 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.js +29 -9
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.d.ts +12 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.js +23 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.js +6 -19
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.js +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +6 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +5 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.d.ts +5 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.js +4 -1
- package/node_modules/tiny-http-mcp-server/package.json +4 -4
- package/node_modules/tiny-mcp-client/README.md +2 -0
- package/node_modules/tiny-mcp-client/dist/index.browser.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.browser.js +116 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.js +1034 -561
- package/node_modules/tiny-mcp-client/package.json +15 -0
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-design/dist/components/table.js +6 -0
- package/node_modules/toolcraft-design/dist/escape-terminal-text.d.ts +1 -2
- package/node_modules/toolcraft-design/dist/escape-terminal-text.js +1 -20
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +2 -1
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +2 -1
- package/node_modules/toolcraft-schema/dist/json-schema/utils.js +3 -0
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +32 -7
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
import { FsError, toFsError } from "../contracts/errors.js";
|
|
2
|
+
import { validatePath } from "../contracts/virtual-path.js";
|
|
3
|
+
import { finishCleanup } from "../contracts/cleanup.js";
|
|
4
|
+
import { registerEntryView } from "./mount/comparison.js";
|
|
5
|
+
import { getScopedTransportBudget, runScopedTransportBudget, withScopedTransportBudget } from "#safe-fs-platform";
|
|
6
|
+
import { hasRegisteredS3FileSystem, scopeTransportOptions } from "../platform/transport-budget.js";
|
|
7
|
+
import { openRetainedResizeFile, retainedResizeCapabilities, ownedMutationCapabilities, requireOwnedMutation } from "./capabilities.js";
|
|
8
|
+
import { createStagingCleanup, snapshotStagingCreation } from "./staging-cleanup.js";
|
|
9
|
+
import { inspectStagingBindings, runStagingGuard, snapshotDirectoryAncestry, snapshotStagingResolution } from "./staging-ancestry.js";
|
|
10
|
+
const originals = new WeakMap();
|
|
11
|
+
const retainedCleanupSymbol = Symbol.for("safe-fs.retainedCleanup");
|
|
12
|
+
const retargeters = new WeakMap();
|
|
13
|
+
export function retargetScopedFileSystem(scoped, charge, signal, cleanupCharge = charge, maxPathComponents) {
|
|
14
|
+
const fn = retargeters.get(scoped);
|
|
15
|
+
if (!fn)
|
|
16
|
+
return false;
|
|
17
|
+
fn(charge, signal, cleanupCharge, maxPathComponents);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
const operations = new Set([
|
|
21
|
+
"prepareDirectoryAncestry", "prepareStagingResolution", "publishStagedFileSet",
|
|
22
|
+
"publishFileConditional", "removeEntryConditional", "removeTreeConditional", "writeFileConditional", "removeFileConditional", "createStagedFile", "publishStagedFile", "removeStagedFile", "prepareDirectory",
|
|
23
|
+
"confineExtraction", "access", "appendFile", "canonicalizeMissingTarget", "capabilitiesFor", "chmod", "compareEntry",
|
|
24
|
+
"copyFile", "link", "lstat", "mkdir", "openReadFile", "openResizeFile", "readFile", "readStream", "readdir",
|
|
25
|
+
"readlink", "realpath", "rename", "resizeFile", "rm", "rmdir", "unlink", "stat", "symlink", "truncate", "utimes",
|
|
26
|
+
"writeFile", "writeStream",
|
|
27
|
+
]);
|
|
28
|
+
export function scopeFileSystem(filesystem, charge, signal, cleanupCharge = charge, options = {}) {
|
|
29
|
+
const original = originals.get(filesystem)?.filesystem ?? filesystem;
|
|
30
|
+
const creationMask = options.creationMask ?? originals.get(filesystem)?.creationMask;
|
|
31
|
+
let maxPathComponents = options.maxPathComponents ?? originals.get(filesystem)?.maxPathComponents;
|
|
32
|
+
if (creationMask !== undefined && (!Number.isInteger(creationMask) || creationMask < 0 || creationMask > 0o777))
|
|
33
|
+
throw new RangeError("creationMask must be a permission mask between 0 and 0777");
|
|
34
|
+
const creationOptions = (settings, directory = false) => {
|
|
35
|
+
// Explicit directory modes (mkdir -m) are independent of the shell mask.
|
|
36
|
+
// Modes remain advisory on adapters that do not enforce permissions.
|
|
37
|
+
if (creationMask === undefined || directory && settings.mode !== undefined)
|
|
38
|
+
return settings;
|
|
39
|
+
const mode = settings.mode ?? (directory ? 0o777 : 0o666);
|
|
40
|
+
if (!Number.isSafeInteger(mode) || mode < 0 || mode > 0o7777)
|
|
41
|
+
throw new FsError("EINVAL");
|
|
42
|
+
return { ...settings, mode: mode & ~creationMask };
|
|
43
|
+
};
|
|
44
|
+
const methods = new Map();
|
|
45
|
+
const assertOpen = (options) => {
|
|
46
|
+
signal.throwIfAborted();
|
|
47
|
+
options?.signal?.throwIfAborted();
|
|
48
|
+
};
|
|
49
|
+
const admit = (options) => {
|
|
50
|
+
assertOpen(options);
|
|
51
|
+
charge();
|
|
52
|
+
};
|
|
53
|
+
const wrapHandle = (handle) => {
|
|
54
|
+
let closed = false;
|
|
55
|
+
const close = handle.close.bind(handle);
|
|
56
|
+
return {
|
|
57
|
+
async stat(options) { admit(options); return handle.stat(options); },
|
|
58
|
+
async read(position, maxBytes, options) { admit(options); return handle.read(position, maxBytes, options); },
|
|
59
|
+
get seekEnd() {
|
|
60
|
+
const seek = handle.seekEnd;
|
|
61
|
+
if (typeof seek !== "function")
|
|
62
|
+
return undefined;
|
|
63
|
+
return async (options = {}) => {
|
|
64
|
+
assertOpen(options);
|
|
65
|
+
if (closed)
|
|
66
|
+
throw new FsError("EBADF");
|
|
67
|
+
admit(options);
|
|
68
|
+
assertOpen(options);
|
|
69
|
+
if (closed)
|
|
70
|
+
throw new FsError("EBADF");
|
|
71
|
+
try {
|
|
72
|
+
const result = await Reflect.apply(seek, handle, [resizeOptions(options)]);
|
|
73
|
+
assertOpen(options);
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
assertOpen(options);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
close() { closed = true; return close(); },
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
let cachedCallerSignal;
|
|
86
|
+
let cachedCombinedSignal;
|
|
87
|
+
const combineSignal = (callerSignal) => {
|
|
88
|
+
if (!callerSignal || callerSignal === signal)
|
|
89
|
+
return signal;
|
|
90
|
+
if (callerSignal === cachedCallerSignal && cachedCombinedSignal)
|
|
91
|
+
return cachedCombinedSignal;
|
|
92
|
+
cachedCallerSignal = callerSignal;
|
|
93
|
+
cachedCombinedSignal = AbortSignal.any([signal, callerSignal]);
|
|
94
|
+
return cachedCombinedSignal;
|
|
95
|
+
};
|
|
96
|
+
const resizeOptions = (options) => {
|
|
97
|
+
const scopedOptions = {
|
|
98
|
+
...options, signal: combineSignal(options.signal),
|
|
99
|
+
};
|
|
100
|
+
scopedOptions.signal.throwIfAborted();
|
|
101
|
+
return scopedOptions;
|
|
102
|
+
};
|
|
103
|
+
const wrapResizeHandle = (handle) => {
|
|
104
|
+
let closing;
|
|
105
|
+
const admitOperation = (options) => {
|
|
106
|
+
assertOpen(options);
|
|
107
|
+
if (closing)
|
|
108
|
+
throw new FsError("EBADF");
|
|
109
|
+
admit(options);
|
|
110
|
+
assertOpen(options);
|
|
111
|
+
if (closing)
|
|
112
|
+
throw new FsError("EBADF");
|
|
113
|
+
return resizeOptions(options);
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
async stat(options = {}) {
|
|
117
|
+
try {
|
|
118
|
+
const result = await handle.stat(admitOperation(options));
|
|
119
|
+
assertOpen(options);
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
assertOpen(options);
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
async truncate(length, options = {}) {
|
|
128
|
+
try {
|
|
129
|
+
await handle.truncate(length, admitOperation(options));
|
|
130
|
+
assertOpen(options);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
assertOpen(options);
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
get seekEnd() {
|
|
138
|
+
const seek = handle.seekEnd;
|
|
139
|
+
if (typeof seek !== "function")
|
|
140
|
+
return undefined;
|
|
141
|
+
return async (options = {}) => {
|
|
142
|
+
try {
|
|
143
|
+
const result = await Reflect.apply(seek, handle, [admitOperation(options)]);
|
|
144
|
+
assertOpen(options);
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
assertOpen(options);
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
close: () => closing ??= Promise.resolve().then(() => handle.close()),
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
const wrapDescriptor = (descriptor) => {
|
|
157
|
+
let closing;
|
|
158
|
+
const invoke = async (options, action, preserveReceipt = false) => {
|
|
159
|
+
assertOpen(options);
|
|
160
|
+
if (closing)
|
|
161
|
+
throw new FsError("EBADF");
|
|
162
|
+
admit(options);
|
|
163
|
+
assertOpen(options);
|
|
164
|
+
if (closing)
|
|
165
|
+
throw new FsError("EBADF");
|
|
166
|
+
try {
|
|
167
|
+
const result = await action(resizeOptions(options));
|
|
168
|
+
if (!preserveReceipt)
|
|
169
|
+
assertOpen(options);
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
assertOpen(options);
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const getPosition = descriptor.getPosition;
|
|
178
|
+
const probeRead = descriptor.probeRead;
|
|
179
|
+
return {
|
|
180
|
+
capabilities: Object.freeze({ ...descriptor.capabilities }),
|
|
181
|
+
...(getPosition === undefined ? {} : { getPosition: (options = {}) => invoke(options, scoped => getPosition.call(descriptor, scoped)) }),
|
|
182
|
+
...(probeRead === undefined ? {} : { probeRead: (options = {}) => invoke(options, scoped => probeRead.call(descriptor, scoped)) }),
|
|
183
|
+
stat: (options = {}) => invoke(options, scoped => descriptor.stat(scoped)),
|
|
184
|
+
read: (buffer, position, options = {}) => invoke(options, scoped => descriptor.read(buffer, position, scoped)),
|
|
185
|
+
write: (buffer, position, forwarded = {}) => invoke(forwarded, scoped => descriptor.write(buffer, position, scoped), options.preserveDescriptorWriteReceipt === true),
|
|
186
|
+
truncate: (length, options = {}) => invoke(options, scoped => descriptor.truncate(length, scoped)),
|
|
187
|
+
sync: (dataOnly, options = {}) => invoke(options, scoped => descriptor.sync(dataOnly, scoped)),
|
|
188
|
+
close: (options = {}) => closing ??= Promise.resolve().then(() => descriptor.close(options)),
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
const wrapStream = (source, options) => {
|
|
192
|
+
const budgetFrames = getScopedTransportBudget();
|
|
193
|
+
return {
|
|
194
|
+
[Symbol.asyncIterator]() {
|
|
195
|
+
assertOpen(options);
|
|
196
|
+
const iterator = source[Symbol.asyncIterator]();
|
|
197
|
+
let closing;
|
|
198
|
+
const close = (value) => closing ??= Promise.resolve().then(() => iterator.return ? iterator.return(value) : { done: true, value: undefined });
|
|
199
|
+
const advance = async (operation) => {
|
|
200
|
+
try {
|
|
201
|
+
assertOpen(options);
|
|
202
|
+
if (closing) {
|
|
203
|
+
await closing;
|
|
204
|
+
return { done: true, value: undefined };
|
|
205
|
+
}
|
|
206
|
+
const result = await withScopedTransportBudget(budgetFrames, operation);
|
|
207
|
+
assertOpen(options);
|
|
208
|
+
if (closing) {
|
|
209
|
+
await closing;
|
|
210
|
+
return { done: true, value: undefined };
|
|
211
|
+
}
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
await finishCleanup(close, true);
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
return {
|
|
220
|
+
next: () => advance(() => iterator.next()),
|
|
221
|
+
return: close,
|
|
222
|
+
...(iterator.throw ? { throw: (error) => advance(() => iterator.throw(error)) } : {}),
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
let cachedRawCaps;
|
|
228
|
+
let cachedCreateStaged;
|
|
229
|
+
let cachedOpenResize;
|
|
230
|
+
let cachedComputedCaps;
|
|
231
|
+
const view = new Proxy(Object.create(original), {
|
|
232
|
+
set(_target, property, value) {
|
|
233
|
+
cachedComputedCaps = undefined;
|
|
234
|
+
return Reflect.set(original, property, value, original);
|
|
235
|
+
},
|
|
236
|
+
get(_target, property) {
|
|
237
|
+
if (property === retainedCleanupSymbol)
|
|
238
|
+
return cleanupBinding;
|
|
239
|
+
if (property === "capabilities") {
|
|
240
|
+
const rawCaps = original.capabilities;
|
|
241
|
+
if (cachedComputedCaps !== undefined &&
|
|
242
|
+
cachedRawCaps === rawCaps &&
|
|
243
|
+
cachedCreateStaged === original.createStagedFile &&
|
|
244
|
+
cachedOpenResize === original.openResizeFile) {
|
|
245
|
+
return cachedComputedCaps;
|
|
246
|
+
}
|
|
247
|
+
const computed = ownedMutationCapabilities(original, retainedResizeCapabilities(original, rawCaps));
|
|
248
|
+
cachedRawCaps = rawCaps;
|
|
249
|
+
cachedCreateStaged = original.createStagedFile;
|
|
250
|
+
cachedOpenResize = original.openResizeFile;
|
|
251
|
+
cachedComputedCaps = computed;
|
|
252
|
+
return computed;
|
|
253
|
+
}
|
|
254
|
+
const method = Reflect.get(original, property, original);
|
|
255
|
+
if (typeof method !== "function")
|
|
256
|
+
return method;
|
|
257
|
+
const cached = methods.get(property);
|
|
258
|
+
if (cached?.original === method)
|
|
259
|
+
return cached.scoped;
|
|
260
|
+
const credit = operations.has(property) ? 1 : 0;
|
|
261
|
+
const executeDispatch = (args) => {
|
|
262
|
+
if (property === "removeEntryConditional")
|
|
263
|
+
args[1] = resizeOptions({ ...args[1] });
|
|
264
|
+
let stagingSignal;
|
|
265
|
+
if (property === "createStagedFile" || property === "publishStagedFile" || property === "publishStagedFileSet") {
|
|
266
|
+
signal.throwIfAborted();
|
|
267
|
+
if (property === "createStagedFile")
|
|
268
|
+
args[3] = snapshotStagingCreation(args[3], args[0]);
|
|
269
|
+
const callerSignal = args[property === "createStagedFile" ? 3 : 2]?.signal;
|
|
270
|
+
stagingSignal = combineSignal(callerSignal);
|
|
271
|
+
stagingSignal.throwIfAborted();
|
|
272
|
+
}
|
|
273
|
+
if (operations.has(property)) {
|
|
274
|
+
const options = args.at(-1);
|
|
275
|
+
admit(stagingSignal ? { signal: stagingSignal }
|
|
276
|
+
: options && typeof options === "object" && "signal" in options ? options : undefined);
|
|
277
|
+
if (property !== "symlink" && typeof args[0] === "string")
|
|
278
|
+
validatePath(args[0], maxPathComponents);
|
|
279
|
+
if (["copyFile", "rename", "link", "compareEntry"].includes(String(property)) && typeof args[1] === "string")
|
|
280
|
+
validatePath(args[1], maxPathComponents);
|
|
281
|
+
if (property === "symlink" && typeof args[1] === "string")
|
|
282
|
+
validatePath(args[1], maxPathComponents);
|
|
283
|
+
}
|
|
284
|
+
if (property === "publishStagedFileSet") {
|
|
285
|
+
if (original.capabilities.readOnly === true)
|
|
286
|
+
throw new FsError("EROFS", { path: args[1] });
|
|
287
|
+
const supplied = args[2];
|
|
288
|
+
const callerGuard = supplied.commitGuard;
|
|
289
|
+
const entry = (value) => ({ path: value.path, stat: { ...value.stat } });
|
|
290
|
+
const input = args[0];
|
|
291
|
+
const staging = { ...input, parent: entry(input.parent), directory: entry(input.directory), file: entry(input.file) };
|
|
292
|
+
const controls = {
|
|
293
|
+
...supplied,
|
|
294
|
+
signal: stagingSignal,
|
|
295
|
+
parent: { ...supplied.parent },
|
|
296
|
+
destination: supplied.destination === null ? null : { ...supplied.destination },
|
|
297
|
+
companions: supplied.companions.map(value => ({ ...value, expected: value.expected === null ? null : { ...value.expected } })),
|
|
298
|
+
...(supplied.ancestors === undefined ? {} : { ancestors: snapshotDirectoryAncestry(supplied.ancestors) }),
|
|
299
|
+
commitGuard: () => {
|
|
300
|
+
assertOpen({ signal: stagingSignal });
|
|
301
|
+
if (callerGuard !== undefined)
|
|
302
|
+
runStagingGuard(callerGuard);
|
|
303
|
+
assertOpen({ signal: stagingSignal });
|
|
304
|
+
return true;
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
for (const path of [staging.parent.path, staging.directory.path, staging.file.path, args[1],
|
|
308
|
+
...controls.companions.map(value => value.path), ...(controls.ancestors ?? []).map(value => value.path)]) {
|
|
309
|
+
validatePath(path, maxPathComponents);
|
|
310
|
+
}
|
|
311
|
+
assertOpen(controls);
|
|
312
|
+
return Reflect.apply(method, original, [staging, args[1], controls]);
|
|
313
|
+
}
|
|
314
|
+
if (["writeFile", "appendFile", "writeStream", "mkdir"].includes(String(property))) {
|
|
315
|
+
const index = property === "mkdir" ? 1 : 2;
|
|
316
|
+
args[index] = creationOptions((args[index] ?? {}), property === "mkdir");
|
|
317
|
+
}
|
|
318
|
+
if (["publishFileConditional", "removeEntryConditional", "removeTreeConditional", "writeFileConditional", "removeFileConditional", "createStagedFile", "publishStagedFile", "removeStagedFile", "prepareDirectory"].includes(String(property)))
|
|
319
|
+
return (async () => {
|
|
320
|
+
const path = typeof args[0] === "string" ? args[0] : args[0].directory.path;
|
|
321
|
+
const optionIndex = property === "createStagedFile" ? 3 : property === "publishFileConditional" || property === "publishStagedFile" || property === "writeFileConditional" ? 2 : 1;
|
|
322
|
+
const supplied = args[optionIndex];
|
|
323
|
+
const removalReceipt = property === "removeEntryConditional" && supplied !== undefined && "returnRemainingStat" in supplied && supplied.returnRemainingStat === true;
|
|
324
|
+
const options = stagingSignal ? { ...supplied, signal: stagingSignal } : supplied;
|
|
325
|
+
if (property === "createStagedFile" || property === "removeEntryConditional")
|
|
326
|
+
args[optionIndex] = options;
|
|
327
|
+
const assertReady = () => {
|
|
328
|
+
if (property === "createStagedFile" || property === "publishStagedFile")
|
|
329
|
+
options?.signal?.throwIfAborted();
|
|
330
|
+
assertOpen(options);
|
|
331
|
+
};
|
|
332
|
+
const callerGuard = property === "publishStagedFile" ? supplied?.commitGuard : undefined;
|
|
333
|
+
try {
|
|
334
|
+
const create = property === "createStagedFile" || (property === "publishFileConditional" || property === "writeFileConditional" || property === "prepareDirectory") && options !== undefined && "expected" in options && options.expected === null;
|
|
335
|
+
await requireOwnedMutation(original, path, property === "publishFileConditional" ? "atomicFilePublication" : property === "removeEntryConditional" ? "atomicEntryRemoval" : property === "removeTreeConditional" ? "atomicTreeRemoval" : property === "prepareDirectory" ? "atomicDirectoryMetadata" : property === "writeFileConditional" || property === "removeFileConditional" ? "atomicFileMutation" : "atomicFileStaging", options ?? {}, create);
|
|
336
|
+
if (removalReceipt)
|
|
337
|
+
await requireOwnedMutation(original, path, "atomicEntryRemovalReceipt", options);
|
|
338
|
+
if (property === "createStagedFile" && options && "retainCleanup" in options && options.retainCleanup === true) {
|
|
339
|
+
await requireOwnedMutation(original, path, "retainedStagingCleanup", options, true);
|
|
340
|
+
}
|
|
341
|
+
if (property === "publishStagedFile") {
|
|
342
|
+
const publishOptions = (options ?? {});
|
|
343
|
+
await requireOwnedMutation(original, args[1], "atomicFileStaging", publishOptions, publishOptions.destination === null);
|
|
344
|
+
const query = options.destination === null ? { ...options, create: true } : options;
|
|
345
|
+
const declared = ownedMutationCapabilities(original, await original.capabilitiesFor?.(args[1], query) ?? original.capabilities);
|
|
346
|
+
assertReady();
|
|
347
|
+
if (callerGuard !== undefined && declared.guardedStagingPublication !== true)
|
|
348
|
+
throw new FsError("ENOTSUP", { path: args[1], syscall: "guardedStagingPublication" });
|
|
349
|
+
// Guarded publication preserves the caller signal and observes scope
|
|
350
|
+
// cancellation at commit. Unguarded backends need a composed signal.
|
|
351
|
+
if (declared.guardedStagingPublication === true)
|
|
352
|
+
args[optionIndex] = {
|
|
353
|
+
...supplied,
|
|
354
|
+
commitGuard: () => {
|
|
355
|
+
assertReady();
|
|
356
|
+
if (callerGuard !== undefined)
|
|
357
|
+
runStagingGuard(callerGuard);
|
|
358
|
+
assertReady();
|
|
359
|
+
return true;
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
else
|
|
363
|
+
args[optionIndex] = options;
|
|
364
|
+
}
|
|
365
|
+
if (property === "publishStagedFile" && options && "ancestors" in options && options.ancestors !== undefined)
|
|
366
|
+
await requireOwnedMutation(original, args[1], "atomicStagingAncestry", options, options.destination === null);
|
|
367
|
+
assertReady();
|
|
368
|
+
if (property === "publishFileConditional") {
|
|
369
|
+
args[1] = wrapStream(args[1], options);
|
|
370
|
+
args[2] = resizeOptions(options ?? {});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
assertReady();
|
|
375
|
+
if (property === "publishStagedFile" && supplied && "ancestors" in supplied && supplied.ancestors !== undefined
|
|
376
|
+
&& ["ENOTSUP", "ENOENT", "ENOTDIR", "ELOOP"].includes(toFsError(error).code)) {
|
|
377
|
+
await inspectStagingBindings(path => original.lstat(path, options), args[1], options);
|
|
378
|
+
}
|
|
379
|
+
throw error;
|
|
380
|
+
}
|
|
381
|
+
if (property === "removeEntryConditional") {
|
|
382
|
+
const receipt = await Reflect.apply(method, original, args);
|
|
383
|
+
return removalReceipt && receipt !== undefined ? Object.freeze({ ...receipt }) : undefined;
|
|
384
|
+
}
|
|
385
|
+
if (property !== "createStagedFile")
|
|
386
|
+
return Reflect.apply(method, original, args);
|
|
387
|
+
const staging = await Reflect.apply(method, original, args);
|
|
388
|
+
if (!staging.cleanup)
|
|
389
|
+
return staging;
|
|
390
|
+
const backendCleanup = staging.cleanup;
|
|
391
|
+
try {
|
|
392
|
+
const cleanup = createStagingCleanup(staging.directory.path, controls => {
|
|
393
|
+
controls.signal?.throwIfAborted();
|
|
394
|
+
cleanupCharge();
|
|
395
|
+
controls.signal?.throwIfAborted();
|
|
396
|
+
return backendCleanup.remove(controls);
|
|
397
|
+
}, () => backendCleanup.close());
|
|
398
|
+
const backendWriter = staging.writer;
|
|
399
|
+
const writer = backendWriter && Object.freeze({
|
|
400
|
+
write: async (bytes, settings = {}) => {
|
|
401
|
+
const controls = resizeOptions(settings);
|
|
402
|
+
admit(controls);
|
|
403
|
+
await backendWriter.write(bytes, controls);
|
|
404
|
+
},
|
|
405
|
+
finish: async (settings = {}) => {
|
|
406
|
+
const controls = resizeOptions(settings);
|
|
407
|
+
admit(controls);
|
|
408
|
+
return backendWriter.finish(controls);
|
|
409
|
+
},
|
|
410
|
+
});
|
|
411
|
+
return Object.freeze({ ...staging, cleanup, ...(writer ? { writer } : {}) });
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
await finishCleanup(() => backendCleanup.close(), true);
|
|
415
|
+
throw error;
|
|
416
|
+
}
|
|
417
|
+
})();
|
|
418
|
+
if (property === "compareEntry") {
|
|
419
|
+
const peer = args[1];
|
|
420
|
+
args[1] = originals.get(peer)?.filesystem ?? peer;
|
|
421
|
+
}
|
|
422
|
+
if (property === "rename" && args[2]?.noReplace)
|
|
423
|
+
return (async () => {
|
|
424
|
+
const options = args[2];
|
|
425
|
+
const capabilities = await original.capabilitiesFor?.(args[1], options) ?? original.capabilities;
|
|
426
|
+
assertOpen(options);
|
|
427
|
+
if (capabilities.atomicRenameNoReplace !== true)
|
|
428
|
+
throw new FsError("ENOTSUP", {
|
|
429
|
+
syscall: "rename", path: args[0], dest: args[1],
|
|
430
|
+
});
|
|
431
|
+
return Reflect.apply(method, original, args);
|
|
432
|
+
})();
|
|
433
|
+
const result = Reflect.apply(method, original, args);
|
|
434
|
+
return property === "readStream" ? wrapStream(result, args[1]) : result;
|
|
435
|
+
};
|
|
436
|
+
const dispatch = (...args) => {
|
|
437
|
+
if (!hasRegisteredS3FileSystem)
|
|
438
|
+
return executeDispatch(args);
|
|
439
|
+
if (operations.has(property)) {
|
|
440
|
+
const optionIndex = ["compareEntry", "createStagedFile", "utimes"].includes(String(property)) ? 3
|
|
441
|
+
: ["writeFile", "appendFile", "writeStream", "rename", "copyFile", "link", "symlink", "access", "chmod", "truncate", "resizeFile", "publishFileConditional", "writeFileConditional", "publishStagedFile"].includes(String(property)) ? 2 : 1;
|
|
442
|
+
args[optionIndex] = scopeTransportOptions((args[optionIndex] ?? {}), admit, credit);
|
|
443
|
+
}
|
|
444
|
+
return runScopedTransportBudget(admit, () => executeDispatch(args), credit);
|
|
445
|
+
};
|
|
446
|
+
const scoped = property === "prepareStagingResolution"
|
|
447
|
+
? async (path, options = {}) => {
|
|
448
|
+
const controls = resizeOptions({ ...options });
|
|
449
|
+
controls.signal?.throwIfAborted();
|
|
450
|
+
admit(controls);
|
|
451
|
+
try {
|
|
452
|
+
const declared = ownedMutationCapabilities(original, await original.capabilitiesFor?.(path, { ...controls, stagingResolution: true }) ?? original.capabilities);
|
|
453
|
+
controls.signal?.throwIfAborted();
|
|
454
|
+
if (declared.synchronousStagingResolution !== true)
|
|
455
|
+
throw new FsError("ENOTSUP", { path });
|
|
456
|
+
const resolution = snapshotStagingResolution(await Reflect.apply(method, original, [path, controls]));
|
|
457
|
+
controls.signal?.throwIfAborted();
|
|
458
|
+
return snapshotStagingResolution({ ...resolution, validate: () => {
|
|
459
|
+
controls.signal?.throwIfAborted();
|
|
460
|
+
admit(controls);
|
|
461
|
+
controls.signal?.throwIfAborted();
|
|
462
|
+
runStagingGuard(resolution.validate);
|
|
463
|
+
return true;
|
|
464
|
+
} });
|
|
465
|
+
}
|
|
466
|
+
catch (error) {
|
|
467
|
+
controls.signal?.throwIfAborted();
|
|
468
|
+
throw error;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
: property === "prepareDirectoryAncestry"
|
|
472
|
+
? async (...args) => {
|
|
473
|
+
const options = (args[1] ?? {});
|
|
474
|
+
const controls = resizeOptions(options);
|
|
475
|
+
admit(controls);
|
|
476
|
+
controls.signal?.throwIfAborted();
|
|
477
|
+
const entries = snapshotDirectoryAncestry(args[0]);
|
|
478
|
+
try {
|
|
479
|
+
for (const entry of entries) {
|
|
480
|
+
const declared = await original.capabilitiesFor?.(entry.path, { ...controls, stagingAncestry: true }) ?? original.capabilities;
|
|
481
|
+
controls.signal?.throwIfAborted();
|
|
482
|
+
if (declared.synchronousDirectoryValidation !== true)
|
|
483
|
+
throw new FsError("ENOTSUP", { path: entry.path });
|
|
484
|
+
}
|
|
485
|
+
const guard = await Reflect.apply(method, original, [entries, controls]);
|
|
486
|
+
controls.signal?.throwIfAborted();
|
|
487
|
+
if (typeof guard !== "function")
|
|
488
|
+
throw new FsError("ENOTSUP", { syscall: "prepareDirectoryAncestry" });
|
|
489
|
+
return () => {
|
|
490
|
+
controls.signal?.throwIfAborted();
|
|
491
|
+
admit(controls);
|
|
492
|
+
controls.signal?.throwIfAborted();
|
|
493
|
+
runStagingGuard(guard);
|
|
494
|
+
return true;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
controls.signal?.throwIfAborted();
|
|
499
|
+
throw error;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
: property === "confineExtraction"
|
|
503
|
+
? async (...args) => scopeFileSystem(await dispatch(...args), charge, signal, cleanupCharge, options)
|
|
504
|
+
: property === "open"
|
|
505
|
+
? async (path, options) => {
|
|
506
|
+
admit(options);
|
|
507
|
+
const selected = resizeOptions(creationOptions(options));
|
|
508
|
+
let descriptor;
|
|
509
|
+
try {
|
|
510
|
+
descriptor = await Reflect.apply(method, original, [path, selected]);
|
|
511
|
+
assertOpen(options);
|
|
512
|
+
return wrapDescriptor(descriptor);
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
if (descriptor)
|
|
516
|
+
await finishCleanup(() => descriptor.close(), true);
|
|
517
|
+
assertOpen(options);
|
|
518
|
+
throw error;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
: property === "openResizeFile"
|
|
522
|
+
? async (path, options = {}) => {
|
|
523
|
+
admit(options);
|
|
524
|
+
assertOpen(options);
|
|
525
|
+
return wrapResizeHandle(await openRetainedResizeFile(original, path, resizeOptions(creationOptions(options))));
|
|
526
|
+
}
|
|
527
|
+
: property === "capabilitiesFor"
|
|
528
|
+
? async (...args) => ownedMutationCapabilities(original, retainedResizeCapabilities(original, await dispatch(...args)))
|
|
529
|
+
: property === "openReadFile"
|
|
530
|
+
? async (...args) => wrapHandle(await dispatch(...args))
|
|
531
|
+
: operations.has(property) && property !== "canonicalizeMissingTarget" && property !== "readStream"
|
|
532
|
+
? (...args) => {
|
|
533
|
+
try {
|
|
534
|
+
const res = dispatch(...args);
|
|
535
|
+
return res instanceof Promise ? res : Promise.resolve(res);
|
|
536
|
+
}
|
|
537
|
+
catch (error) {
|
|
538
|
+
return Promise.reject(error);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
: dispatch;
|
|
542
|
+
methods.set(property, { original: method, scoped });
|
|
543
|
+
return scoped;
|
|
544
|
+
},
|
|
545
|
+
});
|
|
546
|
+
const cleanupBinding = Object.freeze({ filesystem: view, retain: retainFileSystemCleanup });
|
|
547
|
+
const originalRecord = { filesystem: original, signal, cleanupCharge, creationMask, maxPathComponents };
|
|
548
|
+
originals.set(view, originalRecord);
|
|
549
|
+
retargeters.set(view, (nextCharge, nextSignal, nextCleanupCharge, nextMaxPathComponents) => {
|
|
550
|
+
charge = nextCharge;
|
|
551
|
+
if (signal !== nextSignal) {
|
|
552
|
+
cachedCallerSignal = undefined;
|
|
553
|
+
cachedCombinedSignal = undefined;
|
|
554
|
+
}
|
|
555
|
+
signal = nextSignal;
|
|
556
|
+
cleanupCharge = nextCleanupCharge;
|
|
557
|
+
maxPathComponents = nextMaxPathComponents ?? originals.get(filesystem)?.maxPathComponents;
|
|
558
|
+
originalRecord.signal = nextSignal;
|
|
559
|
+
originalRecord.cleanupCharge = nextCleanupCharge;
|
|
560
|
+
originalRecord.maxPathComponents = maxPathComponents;
|
|
561
|
+
});
|
|
562
|
+
registerEntryView(view, async (path, options) => {
|
|
563
|
+
assertOpen(options);
|
|
564
|
+
return { filesystem: original, path };
|
|
565
|
+
});
|
|
566
|
+
return view;
|
|
567
|
+
}
|
|
568
|
+
export function retainFileSystemCleanup(filesystem, cleanupCallback, options) {
|
|
569
|
+
const maximum = options?.maxOperations ?? Infinity;
|
|
570
|
+
if (maximum !== Infinity && (!Number.isSafeInteger(maximum) || maximum < 0))
|
|
571
|
+
throw new RangeError("cleanup maxOperations must be a nonnegative safe integer or Infinity");
|
|
572
|
+
if (typeof cleanupCallback !== "function")
|
|
573
|
+
throw new TypeError("cleanup callback must be a function");
|
|
574
|
+
const scope = originals.get(filesystem);
|
|
575
|
+
if (!scope) {
|
|
576
|
+
// Bundled commands can hold another module copy. Delegate only for this
|
|
577
|
+
// exact view, never through a wrapper that happens to forward its symbols.
|
|
578
|
+
const binding = Reflect.get(filesystem, retainedCleanupSymbol);
|
|
579
|
+
if (binding?.filesystem === filesystem && typeof binding.retain === "function" && binding.retain !== retainFileSystemCleanup)
|
|
580
|
+
return binding.retain(filesystem, cleanupCallback, options);
|
|
581
|
+
}
|
|
582
|
+
scope?.signal.throwIfAborted();
|
|
583
|
+
const backing = scope?.filesystem ?? filesystem;
|
|
584
|
+
const pending = new Set();
|
|
585
|
+
let operations = 0;
|
|
586
|
+
let active = false;
|
|
587
|
+
let closing;
|
|
588
|
+
const invoke = (method, input, settings) => {
|
|
589
|
+
const path = typeof input === "string" ? input : input.directory.path;
|
|
590
|
+
if (!active) {
|
|
591
|
+
const rejected = Promise.reject(new FsError("EBADF", { syscall: method, path, message: "cleanup callback is not active" }));
|
|
592
|
+
void rejected.catch(() => { });
|
|
593
|
+
return rejected;
|
|
594
|
+
}
|
|
595
|
+
let result;
|
|
596
|
+
try {
|
|
597
|
+
settings?.signal?.throwIfAborted();
|
|
598
|
+
if (operations >= maximum)
|
|
599
|
+
throw new FsError("EFBIG", { syscall: method, path, message: "cleanup operation limit exceeded" });
|
|
600
|
+
operations++;
|
|
601
|
+
scope?.cleanupCharge();
|
|
602
|
+
settings?.signal?.throwIfAborted();
|
|
603
|
+
const operation = backing[method];
|
|
604
|
+
if (typeof operation !== "function")
|
|
605
|
+
throw new FsError("ENOTSUP", { syscall: method, path });
|
|
606
|
+
const parameters = method === "rm" ? { ...settings, recursive: false, force: false } : settings;
|
|
607
|
+
result = method === "removeStagedFile" || method === "removeFileConditional"
|
|
608
|
+
? requireOwnedMutation(backing, path, method === "removeFileConditional" ? "atomicFileMutation" : "atomicFileStaging", settings ?? {}).then(() => Reflect.apply(operation, backing, [input, parameters]))
|
|
609
|
+
: Promise.resolve(Reflect.apply(operation, backing, [input, parameters]));
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
result = Promise.reject(error);
|
|
613
|
+
void result.catch(() => { });
|
|
614
|
+
return result;
|
|
615
|
+
}
|
|
616
|
+
const completion = result.then(() => { pending.delete(completion); return { status: "fulfilled", value: undefined }; }, error => { pending.delete(completion); return { status: "rejected", reason: error }; });
|
|
617
|
+
pending.add(completion);
|
|
618
|
+
return result;
|
|
619
|
+
};
|
|
620
|
+
const view = Object.freeze(Object.assign(Object.create(null), {
|
|
621
|
+
...(typeof backing.removeFileConditional === "function" ? { removeFileConditional: invoke.bind(undefined, "removeFileConditional") } : {}),
|
|
622
|
+
...(typeof backing.removeStagedFile === "function" ? { removeStagedFile: invoke.bind(undefined, "removeStagedFile") } : {}),
|
|
623
|
+
lstat: invoke.bind(undefined, "lstat"),
|
|
624
|
+
realpath: invoke.bind(undefined, "realpath"),
|
|
625
|
+
rm: invoke.bind(undefined, "rm"),
|
|
626
|
+
...(typeof backing.rmdir === "function" ? { rmdir: invoke.bind(undefined, "rmdir") } : {}),
|
|
627
|
+
}));
|
|
628
|
+
scope?.signal.throwIfAborted();
|
|
629
|
+
return () => {
|
|
630
|
+
if (!closing) {
|
|
631
|
+
closing = Promise.resolve().then(async () => {
|
|
632
|
+
active = true;
|
|
633
|
+
let callbackFailed = false;
|
|
634
|
+
let callbackFailure;
|
|
635
|
+
try {
|
|
636
|
+
const result = cleanupCallback(view);
|
|
637
|
+
if (result !== undefined)
|
|
638
|
+
await result;
|
|
639
|
+
}
|
|
640
|
+
catch (error) {
|
|
641
|
+
callbackFailed = true;
|
|
642
|
+
callbackFailure = error;
|
|
643
|
+
}
|
|
644
|
+
finally {
|
|
645
|
+
active = false;
|
|
646
|
+
}
|
|
647
|
+
const outcomes = await Promise.all(pending);
|
|
648
|
+
if (callbackFailed)
|
|
649
|
+
throw callbackFailure;
|
|
650
|
+
const failures = [];
|
|
651
|
+
for (const outcome of outcomes)
|
|
652
|
+
if (outcome.status === "rejected")
|
|
653
|
+
failures.push(outcome.reason);
|
|
654
|
+
if (failures.length === 1)
|
|
655
|
+
throw failures[0];
|
|
656
|
+
if (failures.length > 1)
|
|
657
|
+
throw new AggregateError(failures, "retained filesystem cleanup failed");
|
|
658
|
+
});
|
|
659
|
+
void closing.catch(() => { });
|
|
660
|
+
}
|
|
661
|
+
return closing;
|
|
662
|
+
};
|
|
663
|
+
}
|