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,162 @@
|
|
|
1
|
+
import { FsError } from "./errors.js";
|
|
2
|
+
export const MAX_PATH_BYTES = Infinity;
|
|
3
|
+
export const MAX_PATH_COMPONENTS = Infinity;
|
|
4
|
+
export function pathByteLength(path) {
|
|
5
|
+
let bytes = 0;
|
|
6
|
+
for (const point of path) {
|
|
7
|
+
const code = point.codePointAt(0);
|
|
8
|
+
bytes += code <= 0x7f ? 1 : code <= 0x7ff ? 2 : code <= 0xffff ? 3 : 4;
|
|
9
|
+
}
|
|
10
|
+
return bytes;
|
|
11
|
+
}
|
|
12
|
+
export function validatePath(path, limits = {}) {
|
|
13
|
+
const maxBytes = typeof limits === "number" ? Infinity : limits.maxPathBytes ?? Infinity;
|
|
14
|
+
const maxComponents = typeof limits === "number" ? limits : limits.maxPathComponents ?? Infinity;
|
|
15
|
+
for (const value of [maxBytes, maxComponents]) {
|
|
16
|
+
if (value !== Infinity && (!Number.isSafeInteger(value) || value < 0)) {
|
|
17
|
+
throw new RangeError("Path limits must be nonnegative safe integers or Infinity");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (typeof path !== "string" || path.includes("\0")) {
|
|
21
|
+
throw new FsError("EINVAL", { syscall: "resolve", message: "paths must be strings without NUL bytes" });
|
|
22
|
+
}
|
|
23
|
+
if (maxBytes !== Infinity && pathByteLength(path) > maxBytes) {
|
|
24
|
+
throw new FsError("ENAMETOOLONG", { syscall: "resolve", path });
|
|
25
|
+
}
|
|
26
|
+
if (maxComponents === Infinity)
|
|
27
|
+
return;
|
|
28
|
+
const limit = maxComponents;
|
|
29
|
+
let components = 0;
|
|
30
|
+
let inComponent = false;
|
|
31
|
+
for (let i = 0; i < path.length; i++) {
|
|
32
|
+
if (path.charCodeAt(i) === 47) {
|
|
33
|
+
inComponent = false;
|
|
34
|
+
}
|
|
35
|
+
else if (!inComponent) {
|
|
36
|
+
inComponent = true;
|
|
37
|
+
if (++components > limit) {
|
|
38
|
+
throw new FsError("ENAMETOOLONG", { syscall: "resolve", path });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function isFastCleanAbsPath(path) {
|
|
44
|
+
const len = path.length;
|
|
45
|
+
if (len === 0 || path.charCodeAt(0) !== 47)
|
|
46
|
+
return false;
|
|
47
|
+
if (len === 1)
|
|
48
|
+
return true;
|
|
49
|
+
if (path.charCodeAt(len - 1) === 47)
|
|
50
|
+
return false;
|
|
51
|
+
let segStart = 1;
|
|
52
|
+
for (let i = 1; i < len; i++) {
|
|
53
|
+
const c = path.charCodeAt(i);
|
|
54
|
+
if (c === 0)
|
|
55
|
+
return false;
|
|
56
|
+
if (c === 47) {
|
|
57
|
+
const segLen = i - segStart;
|
|
58
|
+
if (segLen === 0)
|
|
59
|
+
return false;
|
|
60
|
+
if (segLen === 1 && path.charCodeAt(segStart) === 46)
|
|
61
|
+
return false;
|
|
62
|
+
if (segLen === 2 && path.charCodeAt(segStart) === 46 && path.charCodeAt(segStart + 1) === 46)
|
|
63
|
+
return false;
|
|
64
|
+
segStart = i + 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const lastLen = len - segStart;
|
|
68
|
+
if (lastLen === 1 && path.charCodeAt(segStart) === 46)
|
|
69
|
+
return false;
|
|
70
|
+
if (lastLen === 2 && path.charCodeAt(segStart) === 46 && path.charCodeAt(segStart + 1) === 46)
|
|
71
|
+
return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
function resolvePathSlow(cwd, paths) {
|
|
75
|
+
const argLen = paths.length + 1;
|
|
76
|
+
const components = [];
|
|
77
|
+
for (let a = 0; a < argLen; a++) {
|
|
78
|
+
const path = a === 0 ? cwd : paths[a - 1];
|
|
79
|
+
if (a > 0)
|
|
80
|
+
validatePath(path);
|
|
81
|
+
if (path.startsWith("/"))
|
|
82
|
+
components.length = 0;
|
|
83
|
+
for (const component of path.split("/")) {
|
|
84
|
+
if (component === "" || component === ".")
|
|
85
|
+
continue;
|
|
86
|
+
if (component === "..")
|
|
87
|
+
components.pop();
|
|
88
|
+
else
|
|
89
|
+
components.push(component);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return `/${components.join("/")}`;
|
|
93
|
+
}
|
|
94
|
+
export function resolvePath2(cwd, path0) {
|
|
95
|
+
validatePath(cwd);
|
|
96
|
+
if (cwd.charCodeAt(0) !== 47)
|
|
97
|
+
throw new FsError("EINVAL", { syscall: "resolve", path: cwd, message: "cwd must be absolute" });
|
|
98
|
+
validatePath(path0);
|
|
99
|
+
if (isFastCleanAbsPath(path0))
|
|
100
|
+
return path0;
|
|
101
|
+
if (isFastCleanAbsPath(cwd) && path0.length > 0 && path0.charCodeAt(0) !== 47 && !path0.includes("/")) {
|
|
102
|
+
if (path0 === ".")
|
|
103
|
+
return cwd;
|
|
104
|
+
if (path0 !== "..")
|
|
105
|
+
return cwd === "/" ? `/${path0}` : `${cwd}/${path0}`;
|
|
106
|
+
}
|
|
107
|
+
return resolvePathSlow(cwd, [path0]);
|
|
108
|
+
}
|
|
109
|
+
export function resolvePath(cwd, ...paths) {
|
|
110
|
+
validatePath(cwd);
|
|
111
|
+
if (!cwd.startsWith("/"))
|
|
112
|
+
throw new FsError("EINVAL", { syscall: "resolve", path: cwd, message: "cwd must be absolute" });
|
|
113
|
+
const argLen = paths.length + 1;
|
|
114
|
+
if (argLen === 1) {
|
|
115
|
+
if (isFastCleanAbsPath(cwd))
|
|
116
|
+
return cwd;
|
|
117
|
+
return resolvePathSlow(cwd, paths);
|
|
118
|
+
}
|
|
119
|
+
if (argLen === 2) {
|
|
120
|
+
return resolvePath2(cwd, paths[0]);
|
|
121
|
+
}
|
|
122
|
+
return resolvePathSlow(cwd, paths);
|
|
123
|
+
}
|
|
124
|
+
export function normalizePath(path, cwd = "/") {
|
|
125
|
+
return resolvePath2(cwd, path);
|
|
126
|
+
}
|
|
127
|
+
export function dirname(path) {
|
|
128
|
+
if (typeof path !== "string")
|
|
129
|
+
throw new TypeError("path must be a string");
|
|
130
|
+
let end = path.length;
|
|
131
|
+
while (end > 0 && path[end - 1] === "/")
|
|
132
|
+
end--;
|
|
133
|
+
if (end === 0)
|
|
134
|
+
return path.startsWith("/") ? "/" : ".";
|
|
135
|
+
const boundary = path.lastIndexOf("/", end - 1);
|
|
136
|
+
if (boundary < 0)
|
|
137
|
+
return ".";
|
|
138
|
+
if (boundary === 0)
|
|
139
|
+
return "/";
|
|
140
|
+
if (boundary === 1 && path.startsWith("/"))
|
|
141
|
+
return "//";
|
|
142
|
+
return path.slice(0, boundary);
|
|
143
|
+
}
|
|
144
|
+
export function relativePath(from, to) {
|
|
145
|
+
const source = normalizePath(from).split("/").filter(Boolean);
|
|
146
|
+
const target = normalizePath(to).split("/").filter(Boolean);
|
|
147
|
+
let common = 0;
|
|
148
|
+
while (common < source.length && common < target.length && source[common] === target[common])
|
|
149
|
+
common++;
|
|
150
|
+
return [...Array(source.length - common).fill(".."), ...target.slice(common)].join("/");
|
|
151
|
+
}
|
|
152
|
+
export function isPathWithin(root, path) {
|
|
153
|
+
const normalizedRoot = normalizePath(root);
|
|
154
|
+
const normalizedPath = normalizePath(path);
|
|
155
|
+
return normalizedRoot === "/" || normalizedPath === normalizedRoot || normalizedPath.startsWith(`${normalizedRoot}/`);
|
|
156
|
+
}
|
|
157
|
+
export function assertPathWithin(root, path) {
|
|
158
|
+
const normalizedPath = normalizePath(path);
|
|
159
|
+
if (!isPathWithin(root, normalizedPath))
|
|
160
|
+
throw new FsError("EACCES", { syscall: "resolve", path, message: "path escapes the allowed root" });
|
|
161
|
+
return normalizedPath;
|
|
162
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./runtime-core.js";
|
|
2
|
+
export { MemoryFileSystem, MemoryRedirectHandle, createMemoryFileSystem, defaultMemoryFileSystemLimits, bindConditionalMutation, getLastReadMemoryFileSourceRef, isCleanAbsolutePath, tryGetMemoryDirectoryEntryNamesSync, tryMkdirMemorySync, tryOpenMemoryRedirectHandleSync, tryReadMemoryFileViewSync, tryResolveMemoryDevicePath, tryRmRfMemorySync, tryWriteMemoryFileInDirSync, tryWriteMemoryFileSync, utf8ByteLength } from "./fs/memory/index.js";
|
|
3
|
+
export * from "./fs/readonly/index.js";
|
|
4
|
+
export * from "./fs/mount/index.js";
|
|
5
|
+
export * from "./fs/overlay/index.js";
|
|
6
|
+
export * from "./fs/quota/index.js";
|
|
7
|
+
export * from "./fs/object-publication/index.js";
|
|
8
|
+
export * from "./fs/webdav/index.js";
|
|
9
|
+
export * from "./bridge/index.js";
|
|
10
|
+
export * from "./python/index.js";
|
|
11
|
+
export { parseXml, parseXmlSteps, XmlLimitError } from "./xml.js";
|
|
12
|
+
export type { XmlName, XmlAttribute, XmlContent, XmlElement, XmlLimits } from "./xml.js";
|
|
13
|
+
export * from "./contracts/object.js";
|
|
14
|
+
export { ObjectAuthority } from "./fs/object-authority.js";
|
|
15
|
+
export * from "./fs/s3/index.js";
|
|
16
|
+
export * from "./fs/s3/http/index.js";
|
|
17
|
+
export { createFileSystem, readConfigRecord, validateFileSystemConfig } from "./config.js";
|
|
18
|
+
export type { FileSystemConfig, FileSystemAdapterDescriptor, FileSystemAdapterRegistry } from "./config.js";
|
|
19
|
+
export { createPortableFileSystemAdapterRegistry } from "./config.portable.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./runtime-core.js";
|
|
2
|
+
export { MemoryFileSystem, MemoryRedirectHandle, createMemoryFileSystem, defaultMemoryFileSystemLimits, bindConditionalMutation, getLastReadMemoryFileSourceRef, isCleanAbsolutePath, tryGetMemoryDirectoryEntryNamesSync, tryMkdirMemorySync, tryOpenMemoryRedirectHandleSync, tryReadMemoryFileViewSync, tryResolveMemoryDevicePath, tryRmRfMemorySync, tryWriteMemoryFileInDirSync, tryWriteMemoryFileSync, utf8ByteLength } from "./fs/memory/index.js";
|
|
3
|
+
export * from "./fs/readonly/index.js";
|
|
4
|
+
export * from "./fs/mount/index.js";
|
|
5
|
+
export * from "./fs/overlay/index.js";
|
|
6
|
+
export * from "./fs/quota/index.js";
|
|
7
|
+
export * from "./fs/object-publication/index.js";
|
|
8
|
+
export * from "./fs/webdav/index.js";
|
|
9
|
+
export * from "./bridge/index.js";
|
|
10
|
+
export * from "./python/index.js";
|
|
11
|
+
export { parseXml, parseXmlSteps, XmlLimitError } from "./xml.js";
|
|
12
|
+
export * from "./contracts/object.js";
|
|
13
|
+
export { ObjectAuthority } from "./fs/object-authority.js";
|
|
14
|
+
export * from "./fs/s3/index.js";
|
|
15
|
+
export * from "./fs/s3/http/index.js";
|
|
16
|
+
export { createFileSystem, readConfigRecord, validateFileSystemConfig } from "./config.js";
|
|
17
|
+
export { createPortableFileSystemAdapterRegistry } from "./config.portable.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FsOptions, FileReadHandle, FileResizeHandle, FileSystem, FileSystemCapabilities, OpenReadFileOptions, OpenResizeFileOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export declare function retainedReadCapabilities(filesystem: FileSystem, capabilities?: FileSystemCapabilities): FileSystemCapabilities;
|
|
3
|
+
export declare function openRetainedReadFile(filesystem: FileSystem, path: string, options: OpenReadFileOptions): Promise<FileReadHandle>;
|
|
4
|
+
export declare function requireCapabilities(...values: readonly (boolean | undefined)[]): boolean | undefined;
|
|
5
|
+
export declare function retainedResizeCapabilities(filesystem: FileSystem, capabilities?: FileSystemCapabilities): FileSystemCapabilities;
|
|
6
|
+
export declare function openRetainedResizeFile(filesystem: FileSystem, path: string, options: OpenResizeFileOptions): Promise<FileResizeHandle>;
|
|
7
|
+
export declare function readOnlyCapabilities(capabilities: FileSystemCapabilities): FileSystemCapabilities;
|
|
8
|
+
export declare function quotaCapabilities(capabilities: FileSystemCapabilities): FileSystemCapabilities;
|
|
9
|
+
export declare function ownedMutationCapabilities(filesystem: FileSystem, capabilities?: FileSystemCapabilities): FileSystemCapabilities;
|
|
10
|
+
export declare function requireOwnedMutation(filesystem: FileSystem, path: string, capability: "retainedStagingCleanup" | "atomicFilePublication" | "atomicEntryRemoval" | "atomicEntryRemovalReceipt" | "atomicTreeRemoval" | "atomicFileMutation" | "atomicFileStaging" | "guardedStagingPublication" | "atomicStagingAncestry" | "atomicDirectoryMetadata", options: FsOptions, create?: boolean): Promise<void>;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { FsError, toFsError } from "../contracts/errors.js";
|
|
2
|
+
import { finishCleanup } from "../contracts/cleanup.js";
|
|
3
|
+
import { inspectStagingBindings } from "./staging-ancestry.js";
|
|
4
|
+
const signalWaiters = new WeakMap();
|
|
5
|
+
function getSignalWaiters(signal) {
|
|
6
|
+
let entry = signalWaiters.get(signal);
|
|
7
|
+
if (!entry) {
|
|
8
|
+
const waiters = new Set();
|
|
9
|
+
const listener = () => {
|
|
10
|
+
signalWaiters.delete(signal);
|
|
11
|
+
signal.removeEventListener("abort", listener);
|
|
12
|
+
const pending = [...waiters];
|
|
13
|
+
waiters.clear();
|
|
14
|
+
for (const fn of pending)
|
|
15
|
+
fn();
|
|
16
|
+
};
|
|
17
|
+
entry = { waiters, listener };
|
|
18
|
+
signalWaiters.set(signal, entry);
|
|
19
|
+
signal.addEventListener("abort", listener, { once: true });
|
|
20
|
+
}
|
|
21
|
+
return entry;
|
|
22
|
+
}
|
|
23
|
+
function releaseSignalWaiter(signal, entry, abort) {
|
|
24
|
+
entry.waiters.delete(abort);
|
|
25
|
+
if (entry.waiters.size === 0 && signalWaiters.get(signal) === entry) {
|
|
26
|
+
signalWaiters.delete(signal);
|
|
27
|
+
signal.removeEventListener("abort", entry.listener);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function awaitWithSignal(promise, signal) {
|
|
31
|
+
if (!signal)
|
|
32
|
+
return promise;
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const entry = getSignalWaiters(signal);
|
|
35
|
+
const abort = () => { releaseSignalWaiter(signal, entry, abort); reject(signal.reason); };
|
|
36
|
+
entry.waiters.add(abort);
|
|
37
|
+
promise.then(value => { releaseSignalWaiter(signal, entry, abort); resolve(value); }, error => { releaseSignalWaiter(signal, entry, abort); reject(error); });
|
|
38
|
+
if (signal.aborted)
|
|
39
|
+
abort();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function retainedReadCapabilities(filesystem, capabilities = filesystem.capabilities) {
|
|
43
|
+
return typeof filesystem.openReadFile === "function" ? capabilities : { ...capabilities, retainedRead: false };
|
|
44
|
+
}
|
|
45
|
+
export async function openRetainedReadFile(filesystem, path, options) {
|
|
46
|
+
const signal = options.signal;
|
|
47
|
+
let handle;
|
|
48
|
+
try {
|
|
49
|
+
signal?.throwIfAborted();
|
|
50
|
+
const available = typeof filesystem.openReadFile === "function";
|
|
51
|
+
signal?.throwIfAborted();
|
|
52
|
+
if (!available)
|
|
53
|
+
throw new FsError("ENOTSUP", { syscall: "openReadFile", path });
|
|
54
|
+
const query = filesystem.capabilitiesFor;
|
|
55
|
+
signal?.throwIfAborted();
|
|
56
|
+
const metadata = Promise.resolve(query == null ? undefined : Reflect.apply(query, filesystem, [path, options]));
|
|
57
|
+
const queried = await awaitWithSignal(metadata, signal);
|
|
58
|
+
signal?.throwIfAborted();
|
|
59
|
+
const capabilities = queried ?? filesystem.capabilities;
|
|
60
|
+
signal?.throwIfAborted();
|
|
61
|
+
const supported = capabilities.retainedRead;
|
|
62
|
+
signal?.throwIfAborted();
|
|
63
|
+
if (supported !== true)
|
|
64
|
+
throw new FsError("ENOTSUP", { syscall: "openReadFile", path });
|
|
65
|
+
const acquire = filesystem.openReadFile;
|
|
66
|
+
signal?.throwIfAborted();
|
|
67
|
+
if (typeof acquire !== "function")
|
|
68
|
+
throw new FsError("ENOTSUP", { syscall: "openReadFile", path });
|
|
69
|
+
handle = await Reflect.apply(acquire, filesystem, [path, options]);
|
|
70
|
+
signal?.throwIfAborted();
|
|
71
|
+
return handle;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (handle)
|
|
75
|
+
await finishCleanup(() => handle.close(), true);
|
|
76
|
+
signal?.throwIfAborted();
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export function requireCapabilities(...values) {
|
|
81
|
+
return values.some(value => value === false) ? false : values.every(value => value === true) ? true : undefined;
|
|
82
|
+
}
|
|
83
|
+
export function retainedResizeCapabilities(filesystem, capabilities = filesystem.capabilities) {
|
|
84
|
+
if (capabilities.retainedResize !== true)
|
|
85
|
+
return capabilities;
|
|
86
|
+
return typeof filesystem.openResizeFile === "function" && capabilities.readOnly !== true
|
|
87
|
+
? capabilities : { ...capabilities, retainedResize: false };
|
|
88
|
+
}
|
|
89
|
+
export async function openRetainedResizeFile(filesystem, path, options) {
|
|
90
|
+
const signal = options.signal;
|
|
91
|
+
let handle;
|
|
92
|
+
try {
|
|
93
|
+
signal?.throwIfAborted();
|
|
94
|
+
const available = typeof filesystem.openResizeFile === "function";
|
|
95
|
+
signal?.throwIfAborted();
|
|
96
|
+
if (!available)
|
|
97
|
+
throw new FsError("ENOTSUP", { syscall: "openResizeFile", path });
|
|
98
|
+
const query = filesystem.capabilitiesFor;
|
|
99
|
+
signal?.throwIfAborted();
|
|
100
|
+
const intent = { ...(signal === undefined ? {} : { signal }), create: options.create === true };
|
|
101
|
+
signal?.throwIfAborted();
|
|
102
|
+
const metadata = Promise.resolve(query === undefined ? filesystem.capabilities : Reflect.apply(query, filesystem, [path, intent]));
|
|
103
|
+
const capabilities = await awaitWithSignal(metadata, signal);
|
|
104
|
+
signal?.throwIfAborted();
|
|
105
|
+
const readOnly = capabilities.readOnly;
|
|
106
|
+
signal?.throwIfAborted();
|
|
107
|
+
if (readOnly === true)
|
|
108
|
+
throw new FsError("EROFS", { syscall: "openResizeFile", path });
|
|
109
|
+
const supported = capabilities.retainedResize;
|
|
110
|
+
signal?.throwIfAborted();
|
|
111
|
+
if (supported !== true)
|
|
112
|
+
throw new FsError("ENOTSUP", { syscall: "openResizeFile", path });
|
|
113
|
+
const acquire = filesystem.openResizeFile;
|
|
114
|
+
signal?.throwIfAborted();
|
|
115
|
+
if (typeof acquire !== "function")
|
|
116
|
+
throw new FsError("ENOTSUP", { syscall: "openResizeFile", path });
|
|
117
|
+
handle = await Reflect.apply(acquire, filesystem, [path, options]);
|
|
118
|
+
signal?.throwIfAborted();
|
|
119
|
+
return handle;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (handle)
|
|
123
|
+
await finishCleanup(() => handle.close(), true);
|
|
124
|
+
signal?.throwIfAborted();
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export function readOnlyCapabilities(capabilities) {
|
|
129
|
+
const inspection = Object.fromEntries([
|
|
130
|
+
"read", "stat", "readdir", "realpath", "access", "readlink", "explicitDirectories", "implicitDirectories",
|
|
131
|
+
"symlinks", "streamingRead", "open", "retainedRead", "versionedDescriptors",
|
|
132
|
+
].filter(name => capabilities[name] !== undefined).map(name => [name, capabilities[name]]));
|
|
133
|
+
return Object.freeze({
|
|
134
|
+
...inspection, retainedStagingCleanup: false, retainedStagingWrite: false, readOnly: true, write: false, append: false, exclusiveCreate: false,
|
|
135
|
+
synchronousStagingResolution: false,
|
|
136
|
+
mkdir: false, recursiveMkdir: false, remove: false, removeDirectory: false, recursiveRemove: false,
|
|
137
|
+
rename: false, copy: false, exclusiveCopy: false, truncate: false, streamingAppend: false,
|
|
138
|
+
randomAccessWrite: false, hardlinks: false, permissions: false, conditionalChmod: false, timestamps: false,
|
|
139
|
+
descriptorWriteStream: false, atomicResize: false, retainedResize: false, atomicFileMutation: false, atomicEntryRemoval: false, atomicEntryRemovalReceipt: false, atomicTreeRemoval: false, atomicFileStaging: false, atomicDirectoryMetadata: false, trustedOwnedStaging: false,
|
|
140
|
+
atomicFilePublication: false, atomicRename: false, atomicRenameNoReplace: false, streamingWrite: false,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
export function quotaCapabilities(capabilities) {
|
|
144
|
+
const streamingWrite = requireCapabilities(capabilities.write, capabilities.append, !capabilities.readOnly);
|
|
145
|
+
const streamingAppend = requireCapabilities(capabilities.append, !capabilities.readOnly);
|
|
146
|
+
const { streamingWrite: ignoredWrite, streamingAppend: ignoredAppend, ...rest } = capabilities;
|
|
147
|
+
return Object.freeze({ ...rest, synchronousStagingResolution: false, retainedStagingCleanup: false, retainedStagingWrite: false, atomicStagingAncestry: false, synchronousDirectoryValidation: false, guardedStagingPublication: false, atomicFilePublication: false, descriptorWriteStream: false, atomicResize: false, atomicFileMutation: false, atomicEntryRemoval: false, atomicEntryRemovalReceipt: false, atomicFileStaging: false, atomicDirectoryMetadata: false, trustedOwnedStaging: false,
|
|
148
|
+
...(streamingWrite === undefined ? {} : { streamingWrite }),
|
|
149
|
+
...(streamingAppend === undefined ? {} : { streamingAppend }),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
const TRUSTED_OWNED_STAGING_METHODS = [
|
|
153
|
+
"createStagedFile", "publishStagedFile", "removeStagedFile", "writeFileConditional", "removeFileConditional", "prepareDirectory",
|
|
154
|
+
];
|
|
155
|
+
export function ownedMutationCapabilities(filesystem, capabilities = filesystem.capabilities) {
|
|
156
|
+
let unavailable;
|
|
157
|
+
if (capabilities.atomicFilePublication === true && (capabilities.readOnly === true || typeof filesystem.publishFileConditional !== "function"))
|
|
158
|
+
(unavailable ??= {}).atomicFilePublication = false;
|
|
159
|
+
if (capabilities.atomicEntryRemoval === true && (capabilities.readOnly === true || typeof filesystem.removeEntryConditional !== "function"))
|
|
160
|
+
(unavailable ??= {}).atomicEntryRemoval = false;
|
|
161
|
+
if (capabilities.atomicEntryRemovalReceipt === true && (capabilities.atomicEntryRemoval !== true || unavailable?.atomicEntryRemoval === false))
|
|
162
|
+
(unavailable ??= {}).atomicEntryRemovalReceipt = false;
|
|
163
|
+
if (capabilities.atomicTreeRemoval === true && (capabilities.readOnly === true || typeof filesystem.removeTreeConditional !== "function"))
|
|
164
|
+
(unavailable ??= {}).atomicTreeRemoval = false;
|
|
165
|
+
if (capabilities.atomicFileMutation === true && (capabilities.readOnly === true || typeof filesystem.writeFileConditional !== "function" || typeof filesystem.removeFileConditional !== "function"))
|
|
166
|
+
(unavailable ??= {}).atomicFileMutation = false;
|
|
167
|
+
if (capabilities.atomicFileStaging === true && (capabilities.readOnly === true
|
|
168
|
+
|| typeof filesystem.createStagedFile !== "function" || typeof filesystem.publishStagedFile !== "function" || typeof filesystem.removeStagedFile !== "function"))
|
|
169
|
+
(unavailable ??= {}).atomicFileStaging = false;
|
|
170
|
+
if (capabilities.retainedStagingCleanup === true && (capabilities.atomicFileStaging !== true || unavailable?.atomicFileStaging === false))
|
|
171
|
+
(unavailable ??= {}).retainedStagingCleanup = false;
|
|
172
|
+
if (capabilities.retainedStagingWrite === true && (capabilities.retainedStagingCleanup !== true || unavailable?.retainedStagingCleanup === false))
|
|
173
|
+
(unavailable ??= {}).retainedStagingWrite = false;
|
|
174
|
+
if (capabilities.atomicStagingAncestry === true && (capabilities.atomicFileStaging !== true || unavailable?.atomicFileStaging === false))
|
|
175
|
+
(unavailable ??= {}).atomicStagingAncestry = false;
|
|
176
|
+
if (capabilities.synchronousDirectoryValidation === true && typeof filesystem.prepareDirectoryAncestry !== "function")
|
|
177
|
+
(unavailable ??= {}).synchronousDirectoryValidation = false;
|
|
178
|
+
if (capabilities.synchronousStagingResolution === true && (capabilities.readOnly === true || typeof filesystem.prepareStagingResolution !== "function"))
|
|
179
|
+
(unavailable ??= {}).synchronousStagingResolution = false;
|
|
180
|
+
if (capabilities.guardedStagingPublication === true && (capabilities.atomicFileStaging !== true || unavailable?.atomicFileStaging === false))
|
|
181
|
+
(unavailable ??= {}).guardedStagingPublication = false;
|
|
182
|
+
if (capabilities.atomicDirectoryMetadata === true && (capabilities.readOnly === true || typeof filesystem.prepareDirectory !== "function"))
|
|
183
|
+
(unavailable ??= {}).atomicDirectoryMetadata = false;
|
|
184
|
+
if (capabilities.trustedOwnedStaging === true) {
|
|
185
|
+
let missing = capabilities.readOnly === true;
|
|
186
|
+
if (!missing) {
|
|
187
|
+
for (let i = 0; i < TRUSTED_OWNED_STAGING_METHODS.length; i++) {
|
|
188
|
+
if (typeof filesystem[TRUSTED_OWNED_STAGING_METHODS[i]] !== "function") {
|
|
189
|
+
missing = true;
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (missing)
|
|
195
|
+
(unavailable ??= {}).trustedOwnedStaging = false;
|
|
196
|
+
}
|
|
197
|
+
return unavailable ? { ...capabilities, ...unavailable } : capabilities;
|
|
198
|
+
}
|
|
199
|
+
export async function requireOwnedMutation(filesystem, path, capability, options, create = false) {
|
|
200
|
+
try {
|
|
201
|
+
options.signal?.throwIfAborted();
|
|
202
|
+
const query = create ? { ...options, create: true } : options;
|
|
203
|
+
const capabilities = ownedMutationCapabilities(filesystem, await filesystem.capabilitiesFor?.(path, capability === "atomicStagingAncestry" ? { ...query, stagingAncestry: true } : query) ?? filesystem.capabilities);
|
|
204
|
+
options.signal?.throwIfAborted();
|
|
205
|
+
if (capabilities[capability] !== true && !(capabilities.trustedOwnedStaging === true && ["atomicFileStaging", "atomicFileMutation", "atomicDirectoryMetadata"].includes(capability)))
|
|
206
|
+
throw new FsError("ENOTSUP", { path, syscall: capability });
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
options.signal?.throwIfAborted();
|
|
210
|
+
if (capability === "atomicStagingAncestry" && "ancestors" in options && options.ancestors !== undefined
|
|
211
|
+
&& "destination" in options && ["ENOTSUP", "ENOENT", "ENOTDIR", "ELOOP"].includes(toFsError(error).code)) {
|
|
212
|
+
await inspectStagingBindings(entry => filesystem.lstat(entry, options), path, options);
|
|
213
|
+
}
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChmodOptions, FileStagingEntry, FileStat } from "../contracts/filesystem.js";
|
|
2
|
+
export interface ConditionalChmodOptions extends ChmodOptions {
|
|
3
|
+
readonly parent: FileStat;
|
|
4
|
+
readonly expected: FileStat;
|
|
5
|
+
readonly ancestors: readonly FileStagingEntry[];
|
|
6
|
+
}
|
|
7
|
+
export declare function snapshotConditionalChmod(path: string, options: ChmodOptions): ConditionalChmodOptions | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FsError } from "../contracts/errors.js";
|
|
2
|
+
import { dirname } from "../contracts/virtual-path.js";
|
|
3
|
+
import { snapshotDirectoryAncestry } from "./staging-ancestry.js";
|
|
4
|
+
export function snapshotConditionalChmod(path, options) {
|
|
5
|
+
const { signal, parent, expected, ancestors, commitGuard } = options;
|
|
6
|
+
signal?.throwIfAborted();
|
|
7
|
+
if (parent === undefined && expected === undefined && ancestors === undefined && commitGuard === undefined)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (parent === undefined || expected === undefined || ancestors === undefined) {
|
|
10
|
+
throw new FsError("EINVAL", { syscall: "chmod", path, message: "complete conditional chmod receipt is required" });
|
|
11
|
+
}
|
|
12
|
+
if (commitGuard !== undefined && typeof commitGuard !== "function")
|
|
13
|
+
throw new FsError("EINVAL", { syscall: "chmod", path });
|
|
14
|
+
const entries = snapshotDirectoryAncestry(ancestors);
|
|
15
|
+
if (entries.at(-1)?.path !== dirname(path))
|
|
16
|
+
throw new FsError("EINVAL", { syscall: "chmod", path });
|
|
17
|
+
return { ...(signal === undefined ? {} : { signal }), parent: { ...parent }, expected: { ...expected }, ancestors: entries,
|
|
18
|
+
...(commitGuard === undefined ? {} : { commitGuard }) };
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FileDescriptor, FileDescriptorCapabilities, FileStat, FsOptions, OpenFileOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export interface DescriptorOpenOptions extends OpenFileOptions {
|
|
3
|
+
readonly creation: "never" | "ifMissing" | "exclusive";
|
|
4
|
+
readonly truncate: boolean;
|
|
5
|
+
readonly append: boolean;
|
|
6
|
+
readonly mode: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DescriptorBackend<Resource> {
|
|
9
|
+
readonly resource: Resource;
|
|
10
|
+
readonly capabilities?: FileDescriptorCapabilities;
|
|
11
|
+
getPosition?(resource: Resource, options: FsOptions): Promise<number>;
|
|
12
|
+
probeRead?(resource: Resource, options: FsOptions): Promise<"ready" | "blocked" | "unknown">;
|
|
13
|
+
stat(resource: Resource, options: FsOptions): Promise<FileStat>;
|
|
14
|
+
read(resource: Resource, buffer: Uint8Array, position: number | null, options: FsOptions): Promise<number>;
|
|
15
|
+
write(resource: Resource, buffer: Uint8Array, position: number | null, options: FsOptions): Promise<number>;
|
|
16
|
+
truncate(resource: Resource, length: number, options: FsOptions): Promise<void>;
|
|
17
|
+
sync(resource: Resource, dataOnly: boolean, options: FsOptions): Promise<void>;
|
|
18
|
+
close(resource: Resource, options: FsOptions): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare function forwardFileDescriptor(descriptor: FileDescriptor, operation: <Result>(syscall: string, options: FsOptions, action: () => Promise<Result>) => Promise<Result>, capabilities?: FileDescriptorCapabilities, snapshot?: (stat: FileStat) => FileStat): DescriptorBackend<FileDescriptor>;
|
|
21
|
+
export declare function openFileDescriptor<Resource>(path: string, options: OpenFileOptions, capabilities: FileDescriptorCapabilities, acquire: (options: DescriptorOpenOptions) => Promise<DescriptorBackend<Resource>>): Promise<FileDescriptor>;
|