toolcraft 0.0.749 → 0.0.750
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,279 @@
|
|
|
1
|
+
import { FsError } from "../contracts/errors.js";
|
|
2
|
+
import { finishCleanup } from "../contracts/cleanup.js";
|
|
3
|
+
function admitCapabilities(path, options, capabilities) {
|
|
4
|
+
if (![capabilities.positionedRead, capabilities.positionedWrite, capabilities.truncate].every(value => typeof value === "boolean")
|
|
5
|
+
|| capabilities.noFollow !== undefined && typeof capabilities.noFollow !== "boolean"
|
|
6
|
+
|| capabilities.publication !== undefined && capabilities.publication !== "conditional"
|
|
7
|
+
|| capabilities.position !== undefined && typeof capabilities.position !== "boolean"
|
|
8
|
+
|| capabilities.readObservation !== undefined && typeof capabilities.readObservation !== "boolean"
|
|
9
|
+
|| capabilities.openTruncate !== undefined && typeof capabilities.openTruncate !== "boolean"
|
|
10
|
+
|| capabilities.positionedAppendWrite !== undefined && typeof capabilities.positionedAppendWrite !== "boolean"
|
|
11
|
+
|| capabilities.delegateZeroLengthWrite !== undefined && typeof capabilities.delegateZeroLengthWrite !== "boolean"
|
|
12
|
+
|| !["none", "volatile", "storage"].includes(capabilities.synchronization))
|
|
13
|
+
throw new FsError("EINVAL", { syscall: "open", path });
|
|
14
|
+
if (options.noFollow && capabilities.noFollow !== true
|
|
15
|
+
|| options.truncate && !(capabilities.openTruncate ?? capabilities.truncate) || options.synchronization !== undefined && capabilities.synchronization === "none") {
|
|
16
|
+
throw new FsError("ENOTSUP", { syscall: "open", path });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function forwardFileDescriptor(descriptor, operation, capabilities, snapshot = stat => ({ ...stat })) {
|
|
20
|
+
const retainedCapabilities = Object.freeze({ ...descriptor.capabilities });
|
|
21
|
+
const selected = Object.freeze({ ...(capabilities ?? retainedCapabilities) });
|
|
22
|
+
const getPosition = selected.position === true && retainedCapabilities.position === true ? descriptor.getPosition : undefined;
|
|
23
|
+
if (selected.position === true && typeof getPosition !== "function")
|
|
24
|
+
throw new FsError("ENOTSUP", { syscall: "getPosition" });
|
|
25
|
+
const probeRead = selected.readObservation === true && retainedCapabilities.readObservation === true ? descriptor.probeRead : undefined;
|
|
26
|
+
if (selected.readObservation === true && typeof probeRead !== "function")
|
|
27
|
+
throw new FsError("ENOTSUP", { syscall: "probeRead" });
|
|
28
|
+
return {
|
|
29
|
+
resource: descriptor, capabilities: selected,
|
|
30
|
+
...(getPosition === undefined ? {} : {
|
|
31
|
+
getPosition: (retained, options) => operation("getPosition", options, () => getPosition.call(retained, options)),
|
|
32
|
+
}),
|
|
33
|
+
...(probeRead === undefined ? {} : {
|
|
34
|
+
probeRead: (retained, options) => operation("probeRead", options, () => probeRead.call(retained, options)),
|
|
35
|
+
}),
|
|
36
|
+
stat: (retained, options) => operation("fstat", options, async () => snapshot(await retained.stat(options))),
|
|
37
|
+
read: (retained, buffer, position, options) => operation("read", options, () => retained.read(buffer, position, options)),
|
|
38
|
+
write: (retained, buffer, position, options) => operation("write", options, () => retained.write(buffer, position, options)),
|
|
39
|
+
truncate: (retained, length, options) => operation("ftruncate", options, () => retained.truncate(length, options)),
|
|
40
|
+
sync: (retained, dataOnly, options) => operation(dataOnly ? "fdatasync" : "fsync", options, () => retained.sync(dataOnly, options)),
|
|
41
|
+
close: (retained, options) => operation("close", {}, () => retained.close(options)),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function integer(value, syscall, path) {
|
|
45
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
46
|
+
throw new FsError("EINVAL", { syscall, path });
|
|
47
|
+
}
|
|
48
|
+
const OPEN_FILE_OPTION_KEYS = new Set(["access", "creation", "truncate", "append", "mode", "exactMode", "noFollow", "synchronization", "signal"]);
|
|
49
|
+
const managedCapabilitiesCache = new WeakMap();
|
|
50
|
+
function getManagedCapabilities(capabilities, access, append) {
|
|
51
|
+
let byKey = managedCapabilitiesCache.get(capabilities);
|
|
52
|
+
const key = `${access}:${append ? 1 : 0}`;
|
|
53
|
+
if (byKey) {
|
|
54
|
+
const cached = byKey.get(key);
|
|
55
|
+
if (cached)
|
|
56
|
+
return cached;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
byKey = new Map();
|
|
60
|
+
managedCapabilitiesCache.set(capabilities, byKey);
|
|
61
|
+
}
|
|
62
|
+
const positionedAppendWrite = capabilities.positionedAppendWrite === true && capabilities.positionedWrite && access !== "read";
|
|
63
|
+
const frozen = Object.freeze({
|
|
64
|
+
...(capabilities.noFollow === undefined ? {} : { noFollow: capabilities.noFollow }),
|
|
65
|
+
...(capabilities.publication === undefined ? {} : { publication: capabilities.publication }),
|
|
66
|
+
...(capabilities.position === undefined ? {} : { position: capabilities.position }),
|
|
67
|
+
...(capabilities.readObservation === undefined ? {} : { readObservation: capabilities.readObservation }),
|
|
68
|
+
...(capabilities.openTruncate === undefined ? {} : { openTruncate: capabilities.openTruncate }),
|
|
69
|
+
positionedRead: capabilities.positionedRead && access !== "write",
|
|
70
|
+
positionedWrite: capabilities.positionedWrite && access !== "read" && (!append || positionedAppendWrite),
|
|
71
|
+
...(capabilities.positionedAppendWrite === undefined ? {} : { positionedAppendWrite }),
|
|
72
|
+
...(capabilities.delegateZeroLengthWrite === undefined ? {} : { delegateZeroLengthWrite: capabilities.delegateZeroLengthWrite && access !== "read" }),
|
|
73
|
+
truncate: capabilities.truncate && access !== "read",
|
|
74
|
+
synchronization: capabilities.synchronization,
|
|
75
|
+
});
|
|
76
|
+
byKey.set(key, frozen);
|
|
77
|
+
return frozen;
|
|
78
|
+
}
|
|
79
|
+
class ManagedFileDescriptor {
|
|
80
|
+
capabilities;
|
|
81
|
+
#path;
|
|
82
|
+
#access;
|
|
83
|
+
#append;
|
|
84
|
+
#getPosition;
|
|
85
|
+
#probeRead;
|
|
86
|
+
#backend;
|
|
87
|
+
#pending = Promise.resolve();
|
|
88
|
+
#closing;
|
|
89
|
+
constructor(path, options, capabilities, backend) {
|
|
90
|
+
this.#path = path;
|
|
91
|
+
this.#access = options.access;
|
|
92
|
+
this.#append = options.append;
|
|
93
|
+
const getPosition = capabilities.position === true ? backend.getPosition : undefined;
|
|
94
|
+
if (capabilities.position === true && typeof getPosition !== "function")
|
|
95
|
+
throw new FsError("ENOTSUP", { syscall: "getPosition", path });
|
|
96
|
+
this.#getPosition = getPosition;
|
|
97
|
+
const probeRead = capabilities.readObservation === true ? backend.probeRead : undefined;
|
|
98
|
+
if (capabilities.readObservation === true && typeof probeRead !== "function")
|
|
99
|
+
throw new FsError("ENOTSUP", { syscall: "probeRead", path });
|
|
100
|
+
this.#probeRead = probeRead;
|
|
101
|
+
this.#backend = backend;
|
|
102
|
+
this.capabilities = getManagedCapabilities(capabilities, options.access, options.append);
|
|
103
|
+
}
|
|
104
|
+
#run(syscall, options, action) {
|
|
105
|
+
const signal = options.signal;
|
|
106
|
+
try {
|
|
107
|
+
signal?.throwIfAborted();
|
|
108
|
+
if (this.#closing || !this.#backend)
|
|
109
|
+
throw new FsError("EBADF", { syscall, path: this.#path });
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return Promise.reject(error);
|
|
113
|
+
}
|
|
114
|
+
const forwarded = signal === undefined ? {} : { signal };
|
|
115
|
+
const operation = this.#pending.then(async () => {
|
|
116
|
+
signal?.throwIfAborted();
|
|
117
|
+
try {
|
|
118
|
+
const result = await action(this.#backend, forwarded);
|
|
119
|
+
signal?.throwIfAborted();
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
signal?.throwIfAborted();
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
this.#pending = operation.then(() => { }, () => { });
|
|
128
|
+
return operation;
|
|
129
|
+
}
|
|
130
|
+
#position(buffer, position, syscall) {
|
|
131
|
+
if (!(buffer instanceof Uint8Array))
|
|
132
|
+
throw new FsError("EINVAL", { syscall, path: this.#path });
|
|
133
|
+
if (position !== null) {
|
|
134
|
+
integer(position, syscall, this.#path);
|
|
135
|
+
if (syscall === "write" && this.#append && this.capabilities.positionedAppendWrite !== true)
|
|
136
|
+
throw new FsError("EINVAL", { syscall, path: this.#path });
|
|
137
|
+
if (!(syscall === "read" ? this.capabilities.positionedRead : this.capabilities.positionedWrite)) {
|
|
138
|
+
throw new FsError("ESPIPE", { syscall, path: this.#path });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
stat(options = {}) {
|
|
143
|
+
return this.#run("fstat", options, (backend, forwarded) => backend.stat(backend.resource, forwarded));
|
|
144
|
+
}
|
|
145
|
+
getPosition(options = {}) {
|
|
146
|
+
return this.#run("getPosition", options, async (backend, forwarded) => {
|
|
147
|
+
if (!this.capabilities.position || !this.#getPosition)
|
|
148
|
+
throw new FsError("ENOTSUP", { syscall: "getPosition", path: this.#path });
|
|
149
|
+
const position = await this.#getPosition.call(backend, backend.resource, forwarded);
|
|
150
|
+
if (!Number.isSafeInteger(position) || position < 0)
|
|
151
|
+
throw new FsError("EIO", { syscall: "getPosition", path: this.#path });
|
|
152
|
+
return position;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
probeRead(options = {}) {
|
|
156
|
+
return this.#run("probeRead", options, async (backend, forwarded) => {
|
|
157
|
+
if (!this.capabilities.readObservation || !this.#probeRead)
|
|
158
|
+
throw new FsError("ENOTSUP", { syscall: "probeRead", path: this.#path });
|
|
159
|
+
const readiness = await this.#probeRead.call(backend, backend.resource, forwarded);
|
|
160
|
+
if (readiness !== "ready" && readiness !== "blocked" && readiness !== "unknown")
|
|
161
|
+
throw new FsError("EIO", { syscall: "probeRead", path: this.#path });
|
|
162
|
+
return readiness;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
read(buffer, position, options = {}) {
|
|
166
|
+
return this.#run("read", options, async (backend, forwarded) => {
|
|
167
|
+
if (this.#access === "write")
|
|
168
|
+
throw new FsError("EBADF", { syscall: "read", path: this.#path });
|
|
169
|
+
this.#position(buffer, position, "read");
|
|
170
|
+
if (buffer.byteLength === 0)
|
|
171
|
+
return 0;
|
|
172
|
+
const count = await backend.read(backend.resource, buffer, position, forwarded);
|
|
173
|
+
if (!Number.isSafeInteger(count) || count < 0 || count > buffer.byteLength)
|
|
174
|
+
throw new FsError("EIO", { syscall: "read", path: this.#path });
|
|
175
|
+
return count;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
write(buffer, position, options = {}) {
|
|
179
|
+
return this.#run("write", options, async (backend, forwarded) => {
|
|
180
|
+
if (this.#access === "read")
|
|
181
|
+
throw new FsError("EBADF", { syscall: "write", path: this.#path });
|
|
182
|
+
this.#position(buffer, position, "write");
|
|
183
|
+
if (buffer.byteLength === 0 && this.capabilities.delegateZeroLengthWrite !== true)
|
|
184
|
+
return 0;
|
|
185
|
+
const count = await backend.write(backend.resource, buffer, position, forwarded);
|
|
186
|
+
if (!Number.isSafeInteger(count) || count < 0 || count > buffer.byteLength)
|
|
187
|
+
throw new FsError("EIO", { syscall: "write", path: this.#path });
|
|
188
|
+
return count;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
truncate(length, options = {}) {
|
|
192
|
+
return this.#run("ftruncate", options, async (backend, forwarded) => {
|
|
193
|
+
if (this.#access === "read")
|
|
194
|
+
throw new FsError("EBADF", { syscall: "ftruncate", path: this.#path });
|
|
195
|
+
integer(length, "ftruncate", this.#path);
|
|
196
|
+
if (!this.capabilities.truncate)
|
|
197
|
+
throw new FsError("ENOTSUP", { syscall: "ftruncate", path: this.#path });
|
|
198
|
+
await backend.truncate(backend.resource, length, forwarded);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
sync(dataOnly, options = {}) {
|
|
202
|
+
return this.#run(dataOnly ? "fdatasync" : "fsync", options, async (backend, forwarded) => {
|
|
203
|
+
if (typeof dataOnly !== "boolean")
|
|
204
|
+
throw new FsError("EINVAL", { syscall: "fsync", path: this.#path });
|
|
205
|
+
if (this.capabilities.synchronization === "none")
|
|
206
|
+
throw new FsError("ENOTSUP", { syscall: dataOnly ? "fdatasync" : "fsync", path: this.#path });
|
|
207
|
+
await backend.sync(backend.resource, dataOnly, forwarded);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
close(options = {}) {
|
|
211
|
+
this.#closing ??= this.#pending.then(async () => {
|
|
212
|
+
try {
|
|
213
|
+
await this.#backend.close(this.#backend.resource, options);
|
|
214
|
+
}
|
|
215
|
+
finally {
|
|
216
|
+
this.#backend = undefined;
|
|
217
|
+
this.#getPosition = undefined;
|
|
218
|
+
this.#probeRead = undefined;
|
|
219
|
+
this.#pending = Promise.resolve();
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return this.#closing;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
export async function openFileDescriptor(path, options, capabilities, acquire) {
|
|
226
|
+
if (!options || typeof options !== "object")
|
|
227
|
+
throw new FsError("EINVAL", { syscall: "open", path });
|
|
228
|
+
const signal = options.signal;
|
|
229
|
+
signal?.throwIfAborted();
|
|
230
|
+
const { access, creation = "never", truncate = false, append = false, mode = 0o666, synchronization } = options;
|
|
231
|
+
let invalidKey = false;
|
|
232
|
+
for (const key in options) {
|
|
233
|
+
if (Object.prototype.hasOwnProperty.call(options, key) && !OPEN_FILE_OPTION_KEYS.has(key)) {
|
|
234
|
+
invalidKey = true;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (invalidKey
|
|
239
|
+
|| (access !== "read" && access !== "write" && access !== "readwrite")
|
|
240
|
+
|| (creation !== "never" && creation !== "ifMissing" && creation !== "exclusive")
|
|
241
|
+
|| options.noFollow !== undefined && typeof options.noFollow !== "boolean"
|
|
242
|
+
|| options.exactMode !== undefined && typeof options.exactMode !== "boolean"
|
|
243
|
+
|| typeof truncate !== "boolean" || typeof append !== "boolean"
|
|
244
|
+
|| access === "read" && (truncate || append)
|
|
245
|
+
|| synchronization !== undefined && !["data", "all"].includes(synchronization)
|
|
246
|
+
|| !Number.isSafeInteger(mode) || mode < 0 || mode > 0o7777) {
|
|
247
|
+
throw new FsError("EINVAL", { syscall: "open", path });
|
|
248
|
+
}
|
|
249
|
+
const admitted = Object.freeze({ access, creation, truncate, append, mode,
|
|
250
|
+
...(options.noFollow === undefined ? {} : { noFollow: options.noFollow }),
|
|
251
|
+
...(options.exactMode === undefined ? {} : { exactMode: options.exactMode }),
|
|
252
|
+
...(signal === undefined ? {} : { signal }), ...(synchronization === undefined ? {} : { synchronization }) });
|
|
253
|
+
const admittedCapabilities = Object.isFrozen(capabilities) ? capabilities : Object.freeze({ ...capabilities });
|
|
254
|
+
admitCapabilities(path, admitted, admittedCapabilities);
|
|
255
|
+
let backend;
|
|
256
|
+
try {
|
|
257
|
+
backend = await acquire(admitted);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
signal?.throwIfAborted();
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
signal?.throwIfAborted();
|
|
265
|
+
const rawBackendCapabilities = backend.capabilities;
|
|
266
|
+
const selected = rawBackendCapabilities ? Object.freeze({ ...rawBackendCapabilities }) : admittedCapabilities;
|
|
267
|
+
signal?.throwIfAborted();
|
|
268
|
+
if (rawBackendCapabilities)
|
|
269
|
+
admitCapabilities(path, admitted, selected);
|
|
270
|
+
const descriptor = new ManagedFileDescriptor(path, admitted, selected, backend);
|
|
271
|
+
signal?.throwIfAborted();
|
|
272
|
+
return descriptor;
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
await finishCleanup(() => backend.close(backend.resource, {}), true);
|
|
276
|
+
signal?.throwIfAborted();
|
|
277
|
+
throw error;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { FileDescriptor, OpenFileOptions } from "../../contracts/descriptor.js";
|
|
2
|
+
import type { AppendFileOptions, CapabilityQueryOptions, CopyFileOptions, DirectoryEntry, FileReadHandle, FileResizeHandle, FileResizeOperation, FileResizeOptions, FileStat, FileSystem, OpenReadFileOptions, OpenResizeFileOptions, FileSystemCapabilities, FsOptions, RenameOptions, MkdirOptions, ReadDirectoryOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions, ConditionalFilePublicationOptions, ConditionalWriteFileOptions, ConditionalRemoveFileOptions, ConditionalRemoveEntryOptions, ConditionalRemoveEntryReceiptOptions, CreateStagedFileOptions, FileStaging, FileStagingEntry, FileStagingResolution, PublishStagedFileOptions, PublishStagedFileSetOptions, PrepareDirectoryOptions, StagedFileContent } from "../../contracts/filesystem.js";
|
|
3
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
4
|
+
import { type EntryLocation } from "../mount/comparison.js";
|
|
5
|
+
import { pathNamespace } from "../path-namespace.js";
|
|
6
|
+
export declare class DeviceFileSystem implements FileSystem {
|
|
7
|
+
#private;
|
|
8
|
+
readonly capabilities: FileSystemCapabilities;
|
|
9
|
+
get [pathNamespace](): any;
|
|
10
|
+
_resolveEntryView: (path: string, options: FsOptions) => Promise<EntryLocation>;
|
|
11
|
+
_entryAuthority: () => Promise<"unknown">;
|
|
12
|
+
constructor(filesystem: FileSystem);
|
|
13
|
+
canonicalizeMissingTarget(path: string, options?: FsOptions): string | undefined;
|
|
14
|
+
capabilitiesFor(path: string, options?: CapabilityQueryOptions): Promise<FileSystemCapabilities>;
|
|
15
|
+
stat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
16
|
+
lstat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
17
|
+
compareEntry(path: string, peer: FileSystem, peerPath: string, options?: FsOptions): Promise<import("../../runtime-core.js").EntryComparison>;
|
|
18
|
+
realpath(path: string, options?: FsOptions): Promise<string>;
|
|
19
|
+
readFile(path: string, options?: ReadFileOptions): Promise<Uint8Array>;
|
|
20
|
+
readStream(path: string, options?: ReadStreamOptions): ByteSource;
|
|
21
|
+
openReadFile(path: string, options?: OpenReadFileOptions): Promise<FileReadHandle>;
|
|
22
|
+
open(path: string, options: OpenFileOptions): Promise<FileDescriptor>;
|
|
23
|
+
resizeFile(path: string, operation: FileResizeOperation, options?: FileResizeOptions): Promise<void>;
|
|
24
|
+
openResizeFile(path: string, options?: OpenResizeFileOptions): Promise<FileResizeHandle>;
|
|
25
|
+
writeFile(path: string, data: Uint8Array, options?: WriteFileOptions): Promise<void>;
|
|
26
|
+
appendFile(path: string, data: Uint8Array, options?: AppendFileOptions): Promise<void>;
|
|
27
|
+
writeStream(path: string, source: ByteSource, options?: WriteFileOptions): Promise<void>;
|
|
28
|
+
readdir(path: string, options?: ReadDirectoryOptions): Promise<DirectoryEntry[]>;
|
|
29
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
30
|
+
rm(path: string, options?: RemoveOptions): Promise<void>;
|
|
31
|
+
unlink(path: string, options?: FsOptions): Promise<void>;
|
|
32
|
+
rmdir(path: string, options?: FsOptions): Promise<void>;
|
|
33
|
+
publishFileConditional(path: string, source: ByteSource, options: ConditionalFilePublicationOptions): Promise<FileStat>;
|
|
34
|
+
writeFileConditional(path: string, data: Uint8Array, options: ConditionalWriteFileOptions): Promise<FileStat>;
|
|
35
|
+
removeEntryConditional(path: string, options: ConditionalRemoveEntryOptions & {
|
|
36
|
+
readonly returnRemainingStat?: false | undefined;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
removeEntryConditional(path: string, options: ConditionalRemoveEntryReceiptOptions): Promise<void | FileStat>;
|
|
39
|
+
removeFileConditional(path: string, options: ConditionalRemoveFileOptions): Promise<void>;
|
|
40
|
+
removeTreeConditional(path: string, options: ConditionalRemoveEntryOptions): Promise<void>;
|
|
41
|
+
createStagedFile(path: string, name: string, content: StagedFileContent, options: CreateStagedFileOptions): Promise<FileStaging>;
|
|
42
|
+
publishStagedFile(staging: FileStaging, destination: string, options: PublishStagedFileOptions): Promise<void>;
|
|
43
|
+
publishStagedFileSet(receipt: FileStaging, destination: string, supplied: PublishStagedFileSetOptions): Promise<FileStat>;
|
|
44
|
+
prepareDirectoryAncestry(ancestors: readonly FileStagingEntry[], options?: FsOptions): Promise<() => true>;
|
|
45
|
+
prepareStagingResolution(path: string, options?: FsOptions): Promise<FileStagingResolution>;
|
|
46
|
+
removeStagedFile(staging: FileStaging, options?: FsOptions): Promise<void>;
|
|
47
|
+
prepareDirectory(path: string, options: PrepareDirectoryOptions): Promise<FileStat>;
|
|
48
|
+
rename(source: string, destination: string, options?: RenameOptions): Promise<void>;
|
|
49
|
+
copyFile(source: string, destination: string, options?: CopyFileOptions): Promise<void>;
|
|
50
|
+
access(path: string, mode?: number, options?: FsOptions): Promise<void>;
|
|
51
|
+
readlink(path: string, options?: FsOptions): Promise<string>;
|
|
52
|
+
symlink(target: string, path: string, options?: FsOptions): Promise<void>;
|
|
53
|
+
confineExtraction(roots: readonly string[], options?: FsOptions): Promise<FileSystem>;
|
|
54
|
+
link(existingPath: string, newPath: string, options?: FsOptions): Promise<void>;
|
|
55
|
+
chmod(path: string, mode: number, options?: FsOptions): Promise<void>;
|
|
56
|
+
utimes(path: string, atimeMs: number, mtimeMs: number, options?: FsOptions): Promise<void>;
|
|
57
|
+
truncate(path: string, length?: number, options?: FsOptions): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export declare function createDeviceFileSystem(filesystem: FileSystem): DeviceFileSystem;
|