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,26 @@
|
|
|
1
|
+
import type { MemoryFileSystemLimits } from "./limits.js";
|
|
2
|
+
export declare class MemoryLedger {
|
|
3
|
+
readonly limits: Readonly<MemoryFileSystemLimits>;
|
|
4
|
+
private retainedBytes;
|
|
5
|
+
private metadataUnits;
|
|
6
|
+
readonly maxFileBytesSmi: number;
|
|
7
|
+
readonly maxRetainedBytesSmi: number;
|
|
8
|
+
readonly maxMetadataUnitsSmi: number;
|
|
9
|
+
readonly hasInfiniteRetained: boolean;
|
|
10
|
+
readonly hasInfiniteFileBytes: boolean;
|
|
11
|
+
constructor(limits: Readonly<MemoryFileSystemLimits>);
|
|
12
|
+
get availableBytes(): number;
|
|
13
|
+
canPreallocate64(nameBytes: number): boolean;
|
|
14
|
+
fileSize(length: number, syscall: string, path: string): void;
|
|
15
|
+
check(bytes: number, units: number, syscall: string, path: string): void;
|
|
16
|
+
reserve(bytes: number, units: number, syscall: string, path: string): void;
|
|
17
|
+
release(bytes: number, units: number): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class MemoryAllocation {
|
|
20
|
+
private references;
|
|
21
|
+
readonly data: Uint8Array;
|
|
22
|
+
private ledger;
|
|
23
|
+
constructor(data: Uint8Array, ledger: MemoryLedger);
|
|
24
|
+
retain(): void;
|
|
25
|
+
release(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { FsError } from "../../contracts/errors.js";
|
|
2
|
+
const MAX_SMI = 1073741823;
|
|
3
|
+
export class MemoryLedger {
|
|
4
|
+
limits;
|
|
5
|
+
retainedBytes = 0;
|
|
6
|
+
metadataUnits = 0;
|
|
7
|
+
maxFileBytesSmi;
|
|
8
|
+
maxRetainedBytesSmi;
|
|
9
|
+
maxMetadataUnitsSmi;
|
|
10
|
+
hasInfiniteRetained;
|
|
11
|
+
constructor(limits) {
|
|
12
|
+
this.limits = limits;
|
|
13
|
+
this.maxFileBytesSmi = limits.maxFileBytes >= MAX_SMI ? MAX_SMI : (limits.maxFileBytes | 0);
|
|
14
|
+
this.maxRetainedBytesSmi = limits.maxRetainedBytes >= MAX_SMI ? MAX_SMI : (limits.maxRetainedBytes | 0);
|
|
15
|
+
this.maxMetadataUnitsSmi = limits.maxMetadataUnits >= MAX_SMI ? MAX_SMI : (limits.maxMetadataUnits | 0);
|
|
16
|
+
this.hasInfiniteRetained = limits.maxRetainedBytes === Infinity;
|
|
17
|
+
if (limits.maxFileBytes !== Infinity)
|
|
18
|
+
this.hasInfiniteFileBytes = false;
|
|
19
|
+
}
|
|
20
|
+
get availableBytes() {
|
|
21
|
+
const max = this.limits.maxRetainedBytes;
|
|
22
|
+
return max === Infinity ? Infinity : max - this.retainedBytes;
|
|
23
|
+
}
|
|
24
|
+
canPreallocate64(nameBytes) {
|
|
25
|
+
return this.maxFileBytesSmi >= 64 && (this.hasInfiniteRetained || this.maxRetainedBytesSmi - this.retainedBytes > 65536 + nameBytes);
|
|
26
|
+
}
|
|
27
|
+
fileSize(length, syscall, path) {
|
|
28
|
+
if ((length | 0) === length && length >= 0 && length <= this.maxFileBytesSmi)
|
|
29
|
+
return;
|
|
30
|
+
if (!Number.isSafeInteger(length) || length < 0 || length > this.limits.maxFileBytes) {
|
|
31
|
+
throw new FsError("EFBIG", { syscall, path });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
check(bytes, units, syscall, path) {
|
|
35
|
+
if ((bytes | 0) === bytes && bytes >= 0 &&
|
|
36
|
+
(units | 0) === units && units >= 0 &&
|
|
37
|
+
this.retainedBytes <= this.maxRetainedBytesSmi - bytes &&
|
|
38
|
+
this.metadataUnits <= this.maxMetadataUnitsSmi - units) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const maxRetained = this.limits.maxRetainedBytes;
|
|
42
|
+
const maxUnits = this.limits.maxMetadataUnits;
|
|
43
|
+
if (!Number.isSafeInteger(bytes) || bytes < 0 ||
|
|
44
|
+
(maxRetained !== Infinity && bytes > maxRetained - this.retainedBytes) ||
|
|
45
|
+
!Number.isSafeInteger(units) || units < 0 ||
|
|
46
|
+
(maxUnits !== Infinity && units > maxUnits - this.metadataUnits)) {
|
|
47
|
+
throw new FsError("ENOSPC", { syscall, path });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
reserve(bytes, units, syscall, path) {
|
|
51
|
+
if ((bytes | 0) === bytes && bytes >= 0 &&
|
|
52
|
+
(units | 0) === units && units >= 0 &&
|
|
53
|
+
this.retainedBytes <= this.maxRetainedBytesSmi - bytes &&
|
|
54
|
+
this.metadataUnits <= this.maxMetadataUnitsSmi - units) {
|
|
55
|
+
this.retainedBytes = (this.retainedBytes + bytes) | 0;
|
|
56
|
+
this.metadataUnits = (this.metadataUnits + units) | 0;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.check(bytes, units, syscall, path);
|
|
60
|
+
this.retainedBytes += bytes;
|
|
61
|
+
this.metadataUnits += units;
|
|
62
|
+
}
|
|
63
|
+
release(bytes, units) {
|
|
64
|
+
if (bytes < 0 || units < 0 || bytes > this.retainedBytes || units > this.metadataUnits) {
|
|
65
|
+
throw new Error("Invalid Memory filesystem reservation release");
|
|
66
|
+
}
|
|
67
|
+
this.retainedBytes -= bytes;
|
|
68
|
+
this.metadataUnits -= units;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export class MemoryAllocation {
|
|
72
|
+
constructor(data, ledger) {
|
|
73
|
+
this.references = 1;
|
|
74
|
+
this.data = data;
|
|
75
|
+
this.ledger = ledger;
|
|
76
|
+
}
|
|
77
|
+
retain() {
|
|
78
|
+
if (this.data.byteLength === 0)
|
|
79
|
+
return;
|
|
80
|
+
this.references++;
|
|
81
|
+
}
|
|
82
|
+
release() {
|
|
83
|
+
if (this.data.byteLength === 0)
|
|
84
|
+
return;
|
|
85
|
+
if (this.references <= 0)
|
|
86
|
+
throw new Error("Memory allocation already released");
|
|
87
|
+
if (--this.references === 0) {
|
|
88
|
+
this.data.fill(0);
|
|
89
|
+
this.ledger.release(this.data.byteLength, 0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
Object.assign(MemoryAllocation.prototype, {
|
|
94
|
+
references: 1,
|
|
95
|
+
});
|
|
96
|
+
Object.assign(MemoryLedger.prototype, { hasInfiniteFileBytes: true });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MemoryFileSystemLimits {
|
|
2
|
+
readonly maxBytes?: number;
|
|
3
|
+
readonly maxPathBytes: number;
|
|
4
|
+
readonly maxPathComponents: number;
|
|
5
|
+
readonly maxFileBytes: number;
|
|
6
|
+
readonly maxRetainedBytes: number;
|
|
7
|
+
readonly maxMetadataUnits: number;
|
|
8
|
+
}
|
|
9
|
+
export type MemoryFileSystemOptions = {
|
|
10
|
+
readonly [Key in keyof MemoryFileSystemLimits]?: MemoryFileSystemLimits[Key] | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const defaultMemoryFileSystemLimits: Readonly<MemoryFileSystemLimits>;
|
|
13
|
+
export declare function normalizeMemoryFileSystemLimits(options: unknown): Readonly<MemoryFileSystemLimits>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readConfigRecord } from "../../config.js";
|
|
2
|
+
export const defaultMemoryFileSystemLimits = Object.freeze({
|
|
3
|
+
maxPathBytes: Infinity,
|
|
4
|
+
maxPathComponents: Infinity,
|
|
5
|
+
maxFileBytes: Infinity,
|
|
6
|
+
maxRetainedBytes: Infinity,
|
|
7
|
+
maxMetadataUnits: Infinity,
|
|
8
|
+
});
|
|
9
|
+
export function normalizeMemoryFileSystemLimits(options) {
|
|
10
|
+
if (options === undefined || (typeof options === "object" && options !== null && Object.getPrototypeOf(options) === Object.prototype && Reflect.ownKeys(options).length === 0)) {
|
|
11
|
+
return defaultMemoryFileSystemLimits;
|
|
12
|
+
}
|
|
13
|
+
const keys = ["maxPathBytes", "maxPathComponents", "maxFileBytes", "maxRetainedBytes", "maxMetadataUnits"];
|
|
14
|
+
const record = readConfigRecord(options, "memory option", [...keys, "maxBytes"]);
|
|
15
|
+
const limits = { ...defaultMemoryFileSystemLimits };
|
|
16
|
+
for (const key of [...keys, "maxBytes"]) {
|
|
17
|
+
const value = record[key];
|
|
18
|
+
if (value === undefined || value === Infinity)
|
|
19
|
+
continue;
|
|
20
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < (key === "maxMetadataUnits" ? 1 : 0)) {
|
|
21
|
+
throw new RangeError(`${key} must be a ${key === "maxMetadataUnits" ? "positive" : "nonnegative"} safe integer or Infinity`);
|
|
22
|
+
}
|
|
23
|
+
limits[key] = value;
|
|
24
|
+
}
|
|
25
|
+
return Object.freeze(limits);
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PathLimits } from "../../contracts/virtual-path.js";
|
|
2
|
+
type Node = {
|
|
3
|
+
type: "file";
|
|
4
|
+
mode: number;
|
|
5
|
+
} | {
|
|
6
|
+
type: "symlink";
|
|
7
|
+
mode: number;
|
|
8
|
+
target: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "directory";
|
|
11
|
+
mode: number;
|
|
12
|
+
entries: ReadonlyMap<string, Node>;
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveMissingTarget(root: Node, path: string, signal?: AbortSignal, limits?: PathLimits): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { pathByteLength, validatePath } from "../../contracts/virtual-path.js";
|
|
2
|
+
import { FsError } from "../../contracts/errors.js";
|
|
3
|
+
function utf8ByteLength(value) {
|
|
4
|
+
let bytes = 0;
|
|
5
|
+
for (let i = 0; i < value.length; i++) {
|
|
6
|
+
const code = value.charCodeAt(i);
|
|
7
|
+
if (code < 0x80)
|
|
8
|
+
bytes += 1;
|
|
9
|
+
else if (code < 0x800)
|
|
10
|
+
bytes += 2;
|
|
11
|
+
else if (code >= 0xd800 && code <= 0xdbff && i + 1 < value.length && value.charCodeAt(i + 1) >= 0xdc00 && value.charCodeAt(i + 1) <= 0xdfff) {
|
|
12
|
+
bytes += 4;
|
|
13
|
+
i++;
|
|
14
|
+
}
|
|
15
|
+
else
|
|
16
|
+
bytes += 3;
|
|
17
|
+
}
|
|
18
|
+
return bytes;
|
|
19
|
+
}
|
|
20
|
+
function exceedsComponentByteLimit(value) {
|
|
21
|
+
return value.length > 85 && (value.length > 255 || utf8ByteLength(value) > 255);
|
|
22
|
+
}
|
|
23
|
+
function components(path, signal) {
|
|
24
|
+
const result = [];
|
|
25
|
+
let start = 0;
|
|
26
|
+
for (let offset = 0; offset <= path.length; offset++) {
|
|
27
|
+
signal?.throwIfAborted();
|
|
28
|
+
if (offset !== path.length && path.charCodeAt(offset) !== 47)
|
|
29
|
+
continue;
|
|
30
|
+
if (offset > start)
|
|
31
|
+
result.push({ name: path.slice(start, offset), start });
|
|
32
|
+
start = offset + 1;
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
export function resolveMissingTarget(root, path, signal, limits = {}) {
|
|
37
|
+
validatePath(path, limits);
|
|
38
|
+
const fail = (code, failedPath = path) => {
|
|
39
|
+
throw new FsError(code, { syscall: "realpath", path: failedPath });
|
|
40
|
+
};
|
|
41
|
+
const origin = components(path, signal);
|
|
42
|
+
let remainingBytes = (limits.maxPathBytes ?? Infinity) - pathByteLength(path);
|
|
43
|
+
let remainingComponents = (limits.maxPathComponents ?? Infinity) - origin.length;
|
|
44
|
+
const initial = { node: root, name: "" };
|
|
45
|
+
let position = initial;
|
|
46
|
+
let links = 0;
|
|
47
|
+
let missing = origin.length;
|
|
48
|
+
let missingLink = false;
|
|
49
|
+
for (let index = 0; index <= origin.length; index++) {
|
|
50
|
+
const token = origin[index];
|
|
51
|
+
if (!token && path.length > 0 && !path.endsWith("/"))
|
|
52
|
+
break;
|
|
53
|
+
const before = position;
|
|
54
|
+
const frames = [{ names: [token ?? { name: ".", start: path.length }], next: 0 }];
|
|
55
|
+
let first = true;
|
|
56
|
+
let originLink = false;
|
|
57
|
+
let found = true;
|
|
58
|
+
while (frames.length > 0) {
|
|
59
|
+
signal?.throwIfAborted();
|
|
60
|
+
const frame = frames.at(-1);
|
|
61
|
+
if (!frame)
|
|
62
|
+
break;
|
|
63
|
+
const component = frame.names[frame.next++];
|
|
64
|
+
if (!component) {
|
|
65
|
+
frames.pop();
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const current = position.node;
|
|
69
|
+
if (current.type !== "directory")
|
|
70
|
+
return fail("ENOTDIR");
|
|
71
|
+
if (((current.mode >> 6) & 1) !== 1)
|
|
72
|
+
return fail("EACCES");
|
|
73
|
+
const name = component.name;
|
|
74
|
+
if (name === ".") {
|
|
75
|
+
first = false;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (name === "..") {
|
|
79
|
+
position = position.parent ?? initial;
|
|
80
|
+
first = false;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (exceedsComponentByteLimit(name))
|
|
84
|
+
return fail("ENAMETOOLONG");
|
|
85
|
+
const node = current.entries.get(name);
|
|
86
|
+
if (!node) {
|
|
87
|
+
found = false;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (first)
|
|
91
|
+
originLink = node.type === "symlink";
|
|
92
|
+
first = false;
|
|
93
|
+
if (node.type === "symlink") {
|
|
94
|
+
if (++links > 40)
|
|
95
|
+
return fail("ELOOP");
|
|
96
|
+
validatePath(node.target, { maxPathBytes: remainingBytes, maxPathComponents: remainingComponents });
|
|
97
|
+
const names = components(node.target, signal);
|
|
98
|
+
remainingBytes -= pathByteLength(node.target);
|
|
99
|
+
remainingComponents -= names.length;
|
|
100
|
+
if (node.target.endsWith("/"))
|
|
101
|
+
names.push({ name: ".", start: node.target.length });
|
|
102
|
+
if (node.target.startsWith("/"))
|
|
103
|
+
position = initial;
|
|
104
|
+
frames.push({ names, next: 0 });
|
|
105
|
+
}
|
|
106
|
+
else
|
|
107
|
+
position = { node, name, parent: position };
|
|
108
|
+
}
|
|
109
|
+
if (!found) {
|
|
110
|
+
position = before;
|
|
111
|
+
missing = index;
|
|
112
|
+
missingLink = originLink;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (missingLink) {
|
|
117
|
+
let end = path.length;
|
|
118
|
+
for (let count = origin.length; count > missing; count--) {
|
|
119
|
+
signal?.throwIfAborted();
|
|
120
|
+
if (count === missing + 1 && path[end - 1] !== "/")
|
|
121
|
+
return fail("ENOENT", path.slice(0, end));
|
|
122
|
+
const last = origin[count - 1];
|
|
123
|
+
if (!last)
|
|
124
|
+
break;
|
|
125
|
+
const boundary = last.start - 1;
|
|
126
|
+
end = boundary <= 0 ? 1 : boundary === 1 && path.startsWith("/") ? 2 : boundary;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const names = [];
|
|
130
|
+
for (let current = position; current?.parent; current = current.parent) {
|
|
131
|
+
signal?.throwIfAborted();
|
|
132
|
+
names.push(current.name);
|
|
133
|
+
}
|
|
134
|
+
names.reverse();
|
|
135
|
+
for (let index = missing; index < origin.length; index++) {
|
|
136
|
+
signal?.throwIfAborted();
|
|
137
|
+
const name = origin[index]?.name;
|
|
138
|
+
if (name === "..")
|
|
139
|
+
names.pop();
|
|
140
|
+
else if (name && name !== ".")
|
|
141
|
+
names.push(name);
|
|
142
|
+
}
|
|
143
|
+
return `/${names.join("/")}`;
|
|
144
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EntryComparison, FileStat, FileSystem, FsOptions } from "../../contracts/filesystem.js";
|
|
2
|
+
export interface EntryLocation {
|
|
3
|
+
readonly filesystem: FileSystem;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly readOnly?: boolean;
|
|
6
|
+
readonly stat?: FileStat;
|
|
7
|
+
}
|
|
8
|
+
export interface EntryView extends EntryLocation {
|
|
9
|
+
readonly stat: FileStat;
|
|
10
|
+
readonly readOnly: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type EntryViewResolver = (path: string, options: FsOptions) => Promise<EntryLocation>;
|
|
13
|
+
export type EntryAuthority = (own: EntryView, peer: EntryView, options: FsOptions) => Promise<EntryComparison>;
|
|
14
|
+
export declare function assertCallbackAuthorityAllowed(): void;
|
|
15
|
+
export declare function registerEntryView(filesystem: FileSystem, resolver: EntryViewResolver): void;
|
|
16
|
+
export declare function registerEntryAuthority(filesystem: FileSystem, authority: EntryAuthority): void;
|
|
17
|
+
export declare function resolveEntryView(filesystem: FileSystem, path: string, options?: FsOptions): Promise<EntryView>;
|
|
18
|
+
export declare function compareResolvedEntries(own: EntryView, peer: EntryView, options?: FsOptions): Promise<EntryComparison>;
|
|
19
|
+
export declare function compareEntries(filesystem: FileSystem, path: string, peer: FileSystem, peerPath: string, options?: FsOptions): Promise<EntryComparison>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { comparisonContext, platform } from "#safe-fs-platform";
|
|
2
|
+
import { FsError } from "../../contracts/errors.js";
|
|
3
|
+
import { compareIdentity } from "./identity.js";
|
|
4
|
+
const resolvers = new WeakMap();
|
|
5
|
+
const authorities = new WeakMap();
|
|
6
|
+
export function assertCallbackAuthorityAllowed() {
|
|
7
|
+
if (!platform.callbackAuthorities)
|
|
8
|
+
throw new FsError("ENOTSUP", { message: "custom comparison authorities require Node context" });
|
|
9
|
+
}
|
|
10
|
+
export function registerEntryView(filesystem, resolver) {
|
|
11
|
+
if (resolvers.has(filesystem))
|
|
12
|
+
throw new TypeError("entry view already registered");
|
|
13
|
+
resolvers.set(filesystem, resolver);
|
|
14
|
+
}
|
|
15
|
+
export function registerEntryAuthority(filesystem, authority) {
|
|
16
|
+
if (authorities.has(filesystem))
|
|
17
|
+
throw new TypeError("entry authority already registered");
|
|
18
|
+
authorities.set(filesystem, authority);
|
|
19
|
+
}
|
|
20
|
+
export async function resolveEntryView(filesystem, path, options = {}) {
|
|
21
|
+
let location = { filesystem, path };
|
|
22
|
+
let readOnly = false;
|
|
23
|
+
const visited = new Set();
|
|
24
|
+
for (;;) {
|
|
25
|
+
options.signal?.throwIfAborted();
|
|
26
|
+
if (visited.has(location.filesystem))
|
|
27
|
+
throw new FsError("EIO", { path, message: "cyclic entry view" });
|
|
28
|
+
visited.add(location.filesystem);
|
|
29
|
+
readOnly ||= location.readOnly === true || location.filesystem.capabilities.readOnly === true;
|
|
30
|
+
if (location.stat)
|
|
31
|
+
return { filesystem: location.filesystem, path: location.path, stat: location.stat, readOnly };
|
|
32
|
+
const resolve = resolvers.get(location.filesystem) ?? location.filesystem._resolveEntryView;
|
|
33
|
+
if (!resolve) {
|
|
34
|
+
let stat;
|
|
35
|
+
let followedPath;
|
|
36
|
+
try {
|
|
37
|
+
followedPath = await location.filesystem.realpath(location.path, options);
|
|
38
|
+
options.signal?.throwIfAborted();
|
|
39
|
+
stat = await location.filesystem.lstat(followedPath, options);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
options.signal?.throwIfAborted();
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
options.signal?.throwIfAborted();
|
|
46
|
+
if (stat.type === "symlink")
|
|
47
|
+
throw new FsError("EIO", { path, message: "followed entry changed during observation" });
|
|
48
|
+
return { filesystem: location.filesystem, path: followedPath, stat, readOnly };
|
|
49
|
+
}
|
|
50
|
+
let next;
|
|
51
|
+
try {
|
|
52
|
+
next = await resolve.call(location.filesystem, location.path, options);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
options.signal?.throwIfAborted();
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
options.signal?.throwIfAborted();
|
|
59
|
+
if (next.filesystem === location.filesystem && next.stat) {
|
|
60
|
+
return { filesystem: next.filesystem, path: next.path, stat: next.stat, readOnly: readOnly || next.readOnly === true };
|
|
61
|
+
}
|
|
62
|
+
location = next;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export async function compareResolvedEntries(own, peer, options = {}) {
|
|
66
|
+
options.signal?.throwIfAborted();
|
|
67
|
+
if (comparisonContext.active(options))
|
|
68
|
+
return "unknown";
|
|
69
|
+
const identity = compareIdentity(own.stat, peer.stat);
|
|
70
|
+
if (identity !== "unknown")
|
|
71
|
+
return identity;
|
|
72
|
+
return comparisonContext.run(options, async (options) => {
|
|
73
|
+
const queried = new Set();
|
|
74
|
+
let result = "unknown";
|
|
75
|
+
for (const [left, right] of [[own, peer], [peer, own]]) {
|
|
76
|
+
options.signal?.throwIfAborted();
|
|
77
|
+
const authority = authorities.get(left.filesystem) ?? left.filesystem._entryAuthority;
|
|
78
|
+
const key = authority ?? left.filesystem;
|
|
79
|
+
if (queried.has(key))
|
|
80
|
+
continue;
|
|
81
|
+
queried.add(key);
|
|
82
|
+
let answer;
|
|
83
|
+
try {
|
|
84
|
+
if (authority)
|
|
85
|
+
answer = await authority(left, right, options);
|
|
86
|
+
else if (left.filesystem.compareEntry) {
|
|
87
|
+
assertCallbackAuthorityAllowed();
|
|
88
|
+
answer = await left.filesystem.compareEntry(left.path, right.filesystem, right.path, options);
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
options.signal?.throwIfAborted();
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
options.signal?.throwIfAborted();
|
|
98
|
+
if (answer !== "same" && answer !== "distinct" && answer !== "unknown") {
|
|
99
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "invalid entry comparison answer" });
|
|
100
|
+
}
|
|
101
|
+
if (answer === "unknown")
|
|
102
|
+
continue;
|
|
103
|
+
if (result !== "unknown" && result !== answer) {
|
|
104
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "conflicting entry comparison answers" });
|
|
105
|
+
}
|
|
106
|
+
result = answer;
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
export async function compareEntries(filesystem, path, peer, peerPath, options = {}) {
|
|
112
|
+
options.signal?.throwIfAborted();
|
|
113
|
+
if (comparisonContext.active(options))
|
|
114
|
+
return "unknown";
|
|
115
|
+
const own = await resolveEntryView(filesystem, path, options);
|
|
116
|
+
const other = await resolveEntryView(peer, peerPath, options);
|
|
117
|
+
return compareResolvedEntries(own, other, options);
|
|
118
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FileStat } from "../../contracts/filesystem.js";
|
|
2
|
+
export declare function compareIdentity(left: FileStat | undefined, right: FileStat | undefined): "same" | "distinct" | "unknown";
|
|
3
|
+
/** Compare content snapshots, including adapter generations when supplied.
|
|
4
|
+
* Identity is checked separately so identityless streaming adapters remain usable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function compareFileVersion(left: FileStat, right: FileStat): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function complete(stat) {
|
|
2
|
+
const { identityScope, dev, ino } = stat;
|
|
3
|
+
return ((typeof identityScope === "object" && identityScope !== null) || typeof identityScope === "symbol")
|
|
4
|
+
&& typeof dev === "number" && Number.isSafeInteger(dev) && dev >= 0
|
|
5
|
+
&& typeof ino === "number" && Number.isSafeInteger(ino) && ino >= 0;
|
|
6
|
+
}
|
|
7
|
+
function opaqueComplete(stat) {
|
|
8
|
+
return ((typeof stat.identityScope === "object" && stat.identityScope !== null) || typeof stat.identityScope === "symbol")
|
|
9
|
+
&& typeof stat.opaqueIdentity === "string" && stat.opaqueIdentity.length > 0 && stat.opaqueIdentity.length <= 4096;
|
|
10
|
+
}
|
|
11
|
+
export function compareIdentity(left, right) {
|
|
12
|
+
if (!left || !right)
|
|
13
|
+
return "unknown";
|
|
14
|
+
if (complete(left) && complete(right))
|
|
15
|
+
return left.identityScope === right.identityScope && left.dev === right.dev && left.ino === right.ino ? "same" : "distinct";
|
|
16
|
+
if (opaqueComplete(left) && opaqueComplete(right))
|
|
17
|
+
return left.identityScope === right.identityScope && left.opaqueIdentity === right.opaqueIdentity ? "same" : "distinct";
|
|
18
|
+
if ((complete(left) || opaqueComplete(left)) && (complete(right) || opaqueComplete(right)) && left.identityScope !== right.identityScope)
|
|
19
|
+
return "distinct";
|
|
20
|
+
return "unknown";
|
|
21
|
+
}
|
|
22
|
+
/** Compare content snapshots, including adapter generations when supplied.
|
|
23
|
+
* Identity is checked separately so identityless streaming adapters remain usable.
|
|
24
|
+
*/
|
|
25
|
+
export function compareFileVersion(left, right) {
|
|
26
|
+
return left.type === right.type && left.size === right.size
|
|
27
|
+
&& left.mtimeMs === right.mtimeMs && left.ctimeMs === right.ctimeMs
|
|
28
|
+
&& left.revision === right.revision && left.opaqueVersion === right.opaqueVersion;
|
|
29
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AppendFileOptions, CapabilityQueryOptions, CopyFileOptions, DirectoryEntry, FileReadHandle, FileResizeHandle, FileResizeOperation, FileResizeOptions, FileStat, FileSystem, OpenReadFileOptions, OpenResizeFileOptions, FileSystemCapabilities, FsOptions, ChmodOptions, RenameOptions, MkdirOptions, ReadDirectoryOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions, ConditionalFilePublicationOptions, ConditionalWriteFileOptions, ConditionalRemoveFileOptions, ConditionalRemoveEntryOptions, ConditionalRemoveEntryReceiptOptions, CreateStagedFileOptions, FileStaging, FileStagingEntry, FileStagingResolution, PublishStagedFileOptions, PrepareDirectoryOptions, StagedFileContent } from "../../contracts/filesystem.js";
|
|
2
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
3
|
+
import type { FileDescriptor, OpenFileOptions } from "../../contracts/descriptor.js";
|
|
4
|
+
export interface MountFileSystemOptions {
|
|
5
|
+
readonly root: FileSystem;
|
|
6
|
+
readonly mounts?: Readonly<Record<string, FileSystem>>;
|
|
7
|
+
}
|
|
8
|
+
export declare class MountFileSystem implements FileSystem {
|
|
9
|
+
readonly capabilities: FileSystemCapabilities;
|
|
10
|
+
private readonly mounts;
|
|
11
|
+
private activeNamespaceOperations;
|
|
12
|
+
private namespaceMutation;
|
|
13
|
+
private readonly namespaceWaiters;
|
|
14
|
+
constructor(options: MountFileSystemOptions);
|
|
15
|
+
confineExtraction(roots: readonly string[], options?: FsOptions): Promise<FileSystem>;
|
|
16
|
+
private select;
|
|
17
|
+
capabilitiesFor(path: string, options?: CapabilityQueryOptions): Promise<FileSystemCapabilities>;
|
|
18
|
+
private supportsStagingAncestry;
|
|
19
|
+
private supportsDirectoryValidation;
|
|
20
|
+
prepareDirectoryAncestry(ancestors: readonly FileStagingEntry[], options?: FsOptions): Promise<() => true>;
|
|
21
|
+
prepareStagingResolution(path: string, options?: FsOptions): Promise<FileStagingResolution>;
|
|
22
|
+
private prepareAncestry;
|
|
23
|
+
private protected;
|
|
24
|
+
openReadFile(path: string, options?: OpenReadFileOptions): Promise<FileReadHandle>;
|
|
25
|
+
resizeFile(path: string, operation: FileResizeOperation, options?: FileResizeOptions): Promise<void>;
|
|
26
|
+
openResizeFile(path: string, options?: OpenResizeFileOptions): Promise<FileResizeHandle>;
|
|
27
|
+
private error;
|
|
28
|
+
private acquireNamespace;
|
|
29
|
+
private operation;
|
|
30
|
+
private components;
|
|
31
|
+
private lookup;
|
|
32
|
+
private resolve;
|
|
33
|
+
private mutable;
|
|
34
|
+
private entryPath;
|
|
35
|
+
private optional;
|
|
36
|
+
readFile(path: string, options?: ReadFileOptions): Promise<Uint8Array>;
|
|
37
|
+
open(path: string, options: OpenFileOptions): Promise<FileDescriptor>;
|
|
38
|
+
writeFile(path: string, data: Uint8Array, options?: WriteFileOptions): Promise<void>;
|
|
39
|
+
appendFile(path: string, data: Uint8Array, options?: AppendFileOptions): Promise<void>;
|
|
40
|
+
stat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
41
|
+
lstat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
42
|
+
readdir(path: string, options?: ReadDirectoryOptions): Promise<DirectoryEntry[]>;
|
|
43
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
44
|
+
rmdir(path: string, options?: FsOptions): Promise<void>;
|
|
45
|
+
unlink(path: string, options?: FsOptions): Promise<void>;
|
|
46
|
+
rm(path: string, options?: RemoveOptions): Promise<void>;
|
|
47
|
+
private localStaging;
|
|
48
|
+
publishFileConditional(path: string, source: ByteSource, options: ConditionalFilePublicationOptions): Promise<FileStat>;
|
|
49
|
+
writeFileConditional(path: string, data: Uint8Array, options: ConditionalWriteFileOptions): Promise<FileStat>;
|
|
50
|
+
removeEntryConditional(path: string, options: ConditionalRemoveEntryOptions & {
|
|
51
|
+
readonly returnRemainingStat?: false | undefined;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
removeEntryConditional(path: string, options: ConditionalRemoveEntryReceiptOptions): Promise<void | FileStat>;
|
|
54
|
+
removeFileConditional(path: string, options: ConditionalRemoveFileOptions): Promise<void>;
|
|
55
|
+
removeTreeConditional(path: string, options: ConditionalRemoveEntryOptions): Promise<void>;
|
|
56
|
+
createStagedFile(path: string, name: string, content: StagedFileContent, options: CreateStagedFileOptions): Promise<FileStaging>;
|
|
57
|
+
publishStagedFile(staging: FileStaging, destination: string, options: PublishStagedFileOptions): Promise<void>;
|
|
58
|
+
removeStagedFile(staging: FileStaging, options?: FsOptions): Promise<void>;
|
|
59
|
+
prepareDirectory(path: string, options: PrepareDirectoryOptions): Promise<FileStat>;
|
|
60
|
+
rename(source: string, destination: string, options?: RenameOptions): Promise<void>;
|
|
61
|
+
copyFile(source: string, destination: string, options?: CopyFileOptions): Promise<void>;
|
|
62
|
+
realpath(path: string, options?: FsOptions): Promise<string>;
|
|
63
|
+
compareEntry(path: string, peer: FileSystem, peerPath: string, options?: FsOptions): Promise<import("../../contracts/filesystem.js").EntryComparison>;
|
|
64
|
+
access(path: string, mode?: number, options?: FsOptions): Promise<void>;
|
|
65
|
+
readlink(path: string, options?: FsOptions): Promise<string>;
|
|
66
|
+
symlink(target: string, path: string, options?: FsOptions): Promise<void>;
|
|
67
|
+
link(existingPath: string, newPath: string, options?: FsOptions): Promise<void>;
|
|
68
|
+
chmod(path: string, mode: number, options?: ChmodOptions): Promise<void>;
|
|
69
|
+
utimes(path: string, atimeMs: number, mtimeMs: number, options?: FsOptions): Promise<void>;
|
|
70
|
+
truncate(path: string, length?: number, options?: FsOptions): Promise<void>;
|
|
71
|
+
readStream(path: string, options?: ReadStreamOptions): ByteSource;
|
|
72
|
+
writeStream(path: string, source: ByteSource, options?: WriteFileOptions): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export declare function createMountFileSystem(options: MountFileSystemOptions): MountFileSystem;
|