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,8 @@
|
|
|
1
|
+
import type { FileStagingEntry, FileStagingResolution, FileStat, PublishStagedFileOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export declare function directoryAncestryPaths(directory: string): string[];
|
|
3
|
+
export declare function snapshotDirectoryAncestry(ancestors: readonly FileStagingEntry[]): readonly FileStagingEntry[];
|
|
4
|
+
export declare function runStagingGuard(guard: () => true): void;
|
|
5
|
+
export declare function snapshotStagingResolution(resolution: FileStagingResolution): FileStagingResolution;
|
|
6
|
+
/** Diagnose failed admission against supplied receipts; this is never a commit
|
|
7
|
+
* guard. Successful publication still requires the backend's atomic checks. */
|
|
8
|
+
export declare function inspectStagingBindings(read: (path: string) => Promise<FileStat>, destination: string, options: PublishStagedFileOptions): Promise<void>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { FsError, toFsError } from "../contracts/errors.js";
|
|
2
|
+
import { compareIdentity } from "./mount/identity.js";
|
|
3
|
+
import { normalizePath, validatePath } from "../contracts/virtual-path.js";
|
|
4
|
+
export function directoryAncestryPaths(directory) {
|
|
5
|
+
validatePath(directory);
|
|
6
|
+
if (!directory.startsWith("/") || normalizePath(directory) !== directory)
|
|
7
|
+
throw new FsError("EINVAL", { path: directory });
|
|
8
|
+
let path = "";
|
|
9
|
+
return ["/", ...directory.split("/").filter(Boolean).map(component => path += `/${component}`)];
|
|
10
|
+
}
|
|
11
|
+
export function snapshotDirectoryAncestry(ancestors) {
|
|
12
|
+
const entries = ancestors.map(entry => Object.freeze({ path: entry.path, stat: Object.freeze({ ...entry.stat }) }));
|
|
13
|
+
const paths = directoryAncestryPaths(entries.at(-1)?.path ?? "");
|
|
14
|
+
if (entries.length !== paths.length || entries.some((entry, index) => entry.path !== paths[index])) {
|
|
15
|
+
throw new FsError("EINVAL", { message: "directory ancestry requires a complete ordered root-to-directory list" });
|
|
16
|
+
}
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
if (entry.stat.type !== "directory")
|
|
19
|
+
throw new FsError("EINVAL", { path: entry.path });
|
|
20
|
+
if (compareIdentity(entry.stat, entry.stat) !== "same")
|
|
21
|
+
throw new FsError("ENOTSUP", { path: entry.path });
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze(entries);
|
|
24
|
+
}
|
|
25
|
+
export function runStagingGuard(guard) {
|
|
26
|
+
const result = guard();
|
|
27
|
+
if (result !== true) {
|
|
28
|
+
// A void callback would accept async implementations. Require a literal
|
|
29
|
+
// success value and observe a misdeclared asynchronous rejection.
|
|
30
|
+
void Promise.resolve(result).catch(() => { });
|
|
31
|
+
throw new FsError("ENOTSUP", { message: "staging validation must return true synchronously" });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function snapshotStagingResolution(resolution) {
|
|
35
|
+
const path = resolution.path;
|
|
36
|
+
validatePath(path);
|
|
37
|
+
const ancestors = snapshotDirectoryAncestry(resolution.ancestors);
|
|
38
|
+
const validate = resolution.validate;
|
|
39
|
+
if (normalizePath(path) !== path || !path.startsWith("/") || path === "/"
|
|
40
|
+
|| ancestors.at(-1).path !== (path.slice(0, path.lastIndexOf("/")) || "/")
|
|
41
|
+
|| typeof validate !== "function")
|
|
42
|
+
throw new FsError("EINVAL", { path });
|
|
43
|
+
const parent = Object.freeze({ ...resolution.parent });
|
|
44
|
+
if (parent.type !== "directory")
|
|
45
|
+
throw new FsError("EINVAL", { path });
|
|
46
|
+
if (compareIdentity(parent, ancestors.at(-1).stat) !== "same")
|
|
47
|
+
throw new FsError("ENOTSUP", { path });
|
|
48
|
+
const supplied = resolution.destination;
|
|
49
|
+
const destination = supplied === null ? null : Object.freeze({ ...supplied });
|
|
50
|
+
const requireSnapshot = (stat) => {
|
|
51
|
+
if (compareIdentity(stat, stat) !== "same" || stat.type !== "directory" && (!Number.isSafeInteger(stat.revision) || stat.revision < 0)) {
|
|
52
|
+
throw new FsError("ENOTSUP", { path });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (destination !== null) {
|
|
56
|
+
if (destination.type !== "file")
|
|
57
|
+
throw new FsError("EINVAL", { path });
|
|
58
|
+
requireSnapshot(destination);
|
|
59
|
+
}
|
|
60
|
+
if (!resolution.traversed.length)
|
|
61
|
+
throw new FsError("EINVAL", { path });
|
|
62
|
+
if (resolution.traversed.length > 4096)
|
|
63
|
+
throw new FsError("EFBIG", { path });
|
|
64
|
+
let recordedUnits = 0;
|
|
65
|
+
const traversed = resolution.traversed.map(entry => {
|
|
66
|
+
const entryPath = entry.path, stat = Object.freeze({ ...entry.stat }), linkTarget = entry.linkTarget;
|
|
67
|
+
validatePath(entryPath);
|
|
68
|
+
if (!entryPath.startsWith("/") || normalizePath(entryPath) !== entryPath
|
|
69
|
+
|| !["directory", "file", "symlink"].includes(stat.type)
|
|
70
|
+
|| stat.type === "symlink" && typeof linkTarget !== "string"
|
|
71
|
+
|| stat.type !== "symlink" && linkTarget !== undefined)
|
|
72
|
+
throw new FsError("EINVAL", { path: entryPath });
|
|
73
|
+
requireSnapshot(stat);
|
|
74
|
+
recordedUnits += entryPath.length + (linkTarget?.length ?? 0);
|
|
75
|
+
if (recordedUnits > 1_048_576)
|
|
76
|
+
throw new FsError("EFBIG", { path });
|
|
77
|
+
return Object.freeze({ path: entryPath, stat, ...(linkTarget === undefined ? {} : { linkTarget }) });
|
|
78
|
+
});
|
|
79
|
+
return Object.freeze({ path, parent, destination, ancestors, traversed: Object.freeze(traversed), validate });
|
|
80
|
+
}
|
|
81
|
+
/** Diagnose failed admission against supplied receipts; this is never a commit
|
|
82
|
+
* guard. Successful publication still requires the backend's atomic checks. */
|
|
83
|
+
export async function inspectStagingBindings(read, destination, options) {
|
|
84
|
+
options.signal?.throwIfAborted();
|
|
85
|
+
const ancestors = snapshotDirectoryAncestry(options.ancestors);
|
|
86
|
+
const parent = destination.slice(0, destination.lastIndexOf("/")) || "/";
|
|
87
|
+
if (normalizePath(destination) !== destination || ancestors.at(-1)?.path !== parent)
|
|
88
|
+
throw new FsError("EINVAL", { path: destination });
|
|
89
|
+
const expected = options.destination === null ? null : { ...options.destination };
|
|
90
|
+
if (expected !== null && (compareIdentity(expected, expected) !== "same"
|
|
91
|
+
|| expected.type === "file" && (!Number.isSafeInteger(expected.revision) || expected.revision < 0)))
|
|
92
|
+
throw new FsError("ENOTSUP", { path: destination });
|
|
93
|
+
const entries = [...ancestors.map(entry => ({ ...entry, directory: true })), { path: destination, stat: expected, directory: false }];
|
|
94
|
+
for (const entry of entries) {
|
|
95
|
+
let current;
|
|
96
|
+
try {
|
|
97
|
+
current = await read(entry.path);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
options.signal?.throwIfAborted();
|
|
101
|
+
const code = toFsError(error).code;
|
|
102
|
+
if (code === "ENOENT" && entry.stat === null)
|
|
103
|
+
continue;
|
|
104
|
+
if (["ENOENT", "ENOTDIR", "ELOOP"].includes(code))
|
|
105
|
+
throw new FsError("EAGAIN", { path: entry.path, cause: error });
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
options.signal?.throwIfAborted();
|
|
109
|
+
if (entry.stat === null || current.type !== entry.stat.type || compareIdentity(current, entry.stat) !== "same")
|
|
110
|
+
throw new FsError("EAGAIN", { path: entry.path });
|
|
111
|
+
if (!entry.directory && ["revision", "size", "mode", "nlink", "mtimeMs", "ctimeMs"].some(field => current[field] !== entry.stat[field])) {
|
|
112
|
+
throw new FsError("EAGAIN", { path: entry.path });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreateStagedFileOptions, FileStagingCleanup, FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
/** Capture creation controls before awaits or allocation can split their meaning. */
|
|
3
|
+
export declare function snapshotStagingCreation(options: CreateStagedFileOptions, path: string): CreateStagedFileOptions;
|
|
4
|
+
/** Own admission and release outside wrappers that can fail before dispatch. */
|
|
5
|
+
export declare function createStagingCleanup(path: string, remove: (options: FsOptions) => void | Promise<void>, release: () => void | Promise<void>): FileStagingCleanup;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FsError } from "../contracts/errors.js";
|
|
2
|
+
import { finishCleanup } from "../contracts/cleanup.js";
|
|
3
|
+
/** Capture creation controls before awaits or allocation can split their meaning. */
|
|
4
|
+
export function snapshotStagingCreation(options, path) {
|
|
5
|
+
const captured = { ...options };
|
|
6
|
+
for (const key of ["signal", "retainCleanup", "parent", "mode", "atimeMs", "mtimeMs"]) {
|
|
7
|
+
if (!Object.hasOwn(captured, key))
|
|
8
|
+
Object.defineProperty(captured, key, { value: options[key], enumerable: true });
|
|
9
|
+
}
|
|
10
|
+
const { signal, retainCleanup, parent, mode, atimeMs, mtimeMs, ...extra } = captured;
|
|
11
|
+
signal?.throwIfAborted();
|
|
12
|
+
if (retainCleanup !== undefined && typeof retainCleanup !== "boolean")
|
|
13
|
+
throw new FsError("EINVAL", { syscall: "createStagedFile", path });
|
|
14
|
+
return {
|
|
15
|
+
...extra, parent,
|
|
16
|
+
...(signal === undefined ? {} : { signal }),
|
|
17
|
+
...(retainCleanup === undefined ? {} : { retainCleanup }),
|
|
18
|
+
...(mode === undefined ? {} : { mode }),
|
|
19
|
+
...(atimeMs === undefined ? {} : { atimeMs }),
|
|
20
|
+
...(mtimeMs === undefined ? {} : { mtimeMs }),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Own admission and release outside wrappers that can fail before dispatch. */
|
|
24
|
+
export function createStagingCleanup(path, remove, release) {
|
|
25
|
+
let accepting = true;
|
|
26
|
+
let removal;
|
|
27
|
+
let closing;
|
|
28
|
+
let released;
|
|
29
|
+
const dispose = () => released ??= Promise.resolve().then(release);
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
remove(options = {}) {
|
|
32
|
+
if (removal)
|
|
33
|
+
return removal;
|
|
34
|
+
if (!accepting) {
|
|
35
|
+
const rejected = Promise.reject(new FsError("EBADF", { syscall: "removeStagedFile", path }));
|
|
36
|
+
void rejected.catch(() => { });
|
|
37
|
+
return rejected;
|
|
38
|
+
}
|
|
39
|
+
accepting = false;
|
|
40
|
+
removal = Promise.resolve().then(async () => {
|
|
41
|
+
let failed = true;
|
|
42
|
+
try {
|
|
43
|
+
await remove(options);
|
|
44
|
+
failed = false;
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await finishCleanup(dispose, failed);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
void removal.catch(() => { });
|
|
51
|
+
return removal;
|
|
52
|
+
},
|
|
53
|
+
close() {
|
|
54
|
+
accepting = false;
|
|
55
|
+
closing ??= (async () => {
|
|
56
|
+
await removal?.catch(() => { });
|
|
57
|
+
await dispose();
|
|
58
|
+
})();
|
|
59
|
+
void closing.catch(() => { });
|
|
60
|
+
return closing;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WebDavFileSystem } from "./webdav.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FileStat, FileSystem, FsOptions } from "../../contracts/filesystem.js";
|
|
2
|
+
import type { EntryAuthority, EntryView } from "../mount/comparison.js";
|
|
3
|
+
export interface OwnedWebDavEntry {
|
|
4
|
+
readonly storage: object;
|
|
5
|
+
readonly resource: object;
|
|
6
|
+
}
|
|
7
|
+
export interface OwnedWebDavResource extends OwnedWebDavEntry {
|
|
8
|
+
readonly identifier: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function registerOwnedResourceResponse(response: Response, entries: ReadonlyMap<string, OwnedWebDavResource>): void;
|
|
11
|
+
export declare function recordOwnedResourceStat(response: Response, filesystem: FileSystem, path: string, stat: FileStat): void;
|
|
12
|
+
export declare function getOwnedWebDavEntry(view: EntryView): OwnedWebDavEntry | undefined;
|
|
13
|
+
export declare function ownedResponseIdentifier(response: Response, path: string): string | undefined;
|
|
14
|
+
type ResourceQuery = (path: string, options: FsOptions) => Promise<string | undefined>;
|
|
15
|
+
export declare function registerResourceQuery(filesystem: FileSystem, query: ResourceQuery, baseComparison: NonNullable<FileSystem["compareEntry"]>, callback?: NonNullable<FileSystem["compareEntry"]>): void;
|
|
16
|
+
export declare function resourceIdentifier(value: string): string;
|
|
17
|
+
export declare const compareWebDavResources: EntryAuthority;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { FsError } from "../../contracts/errors.js";
|
|
2
|
+
import { assertCallbackAuthorityAllowed } from "../mount/comparison.js";
|
|
3
|
+
const responses = new WeakMap();
|
|
4
|
+
const observations = new WeakMap();
|
|
5
|
+
export function registerOwnedResourceResponse(response, entries) {
|
|
6
|
+
if (responses.has(response))
|
|
7
|
+
throw new TypeError("resource response already registered");
|
|
8
|
+
responses.set(response, new Map(entries));
|
|
9
|
+
}
|
|
10
|
+
export function recordOwnedResourceStat(response, filesystem, path, stat) {
|
|
11
|
+
const entry = responses.get(response)?.get(path);
|
|
12
|
+
if (entry)
|
|
13
|
+
observations.set(stat, { filesystem, path, entry });
|
|
14
|
+
}
|
|
15
|
+
export function getOwnedWebDavEntry(view) {
|
|
16
|
+
const observation = observations.get(view.stat);
|
|
17
|
+
return observation?.filesystem === view.filesystem && observation.path === view.path
|
|
18
|
+
? observation.entry : undefined;
|
|
19
|
+
}
|
|
20
|
+
export function ownedResponseIdentifier(response, path) {
|
|
21
|
+
return responses.get(response)?.get(path)?.identifier;
|
|
22
|
+
}
|
|
23
|
+
const queries = new WeakMap();
|
|
24
|
+
const comparisons = new WeakMap();
|
|
25
|
+
const callbacks = new WeakMap();
|
|
26
|
+
export function registerResourceQuery(filesystem, query, baseComparison, callback) {
|
|
27
|
+
comparisons.set(filesystem, baseComparison);
|
|
28
|
+
if (callback)
|
|
29
|
+
callbacks.set(filesystem, callback);
|
|
30
|
+
queries.set(filesystem, async (path, options) => {
|
|
31
|
+
options.signal?.throwIfAborted();
|
|
32
|
+
const identifier = await query(path, options);
|
|
33
|
+
options.signal?.throwIfAborted();
|
|
34
|
+
return identifier;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function resourceIdentifier(value) {
|
|
38
|
+
if (!/^[A-Za-z][A-Za-z0-9+.-]*:[^\s<>"{}|\\^`]+$/.test(value) || /%(?![0-9A-Fa-f]{2})/.test(value)
|
|
39
|
+
|| /[^\x21-\x7e]/.test(value))
|
|
40
|
+
throw new Error("invalid DAV:resource-id URI");
|
|
41
|
+
new URL(value);
|
|
42
|
+
if (/^urn:uuid:/i.test(value)) {
|
|
43
|
+
if (!/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)) {
|
|
44
|
+
throw new Error("invalid DAV:resource-id UUID");
|
|
45
|
+
}
|
|
46
|
+
return value.toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
export const compareWebDavResources = async (own, peer, options) => {
|
|
51
|
+
options.signal?.throwIfAborted();
|
|
52
|
+
let explicit = false;
|
|
53
|
+
let answer = "unknown";
|
|
54
|
+
const visited = new Set();
|
|
55
|
+
for (const [left, right] of [[own, peer], [peer, own]]) {
|
|
56
|
+
const baseComparison = comparisons.get(left.filesystem);
|
|
57
|
+
if (!baseComparison)
|
|
58
|
+
continue;
|
|
59
|
+
const method = left.filesystem.compareEntry;
|
|
60
|
+
const comparison = method === baseComparison ? callbacks.get(left.filesystem) : method;
|
|
61
|
+
if (method === baseComparison && !comparison)
|
|
62
|
+
continue;
|
|
63
|
+
explicit = true;
|
|
64
|
+
if (!comparison || visited.has(left.filesystem))
|
|
65
|
+
continue;
|
|
66
|
+
visited.add(left.filesystem);
|
|
67
|
+
options.signal?.throwIfAborted();
|
|
68
|
+
assertCallbackAuthorityAllowed();
|
|
69
|
+
const result = await comparison.call(left.filesystem, left.path, right.filesystem, right.path, options);
|
|
70
|
+
options.signal?.throwIfAborted();
|
|
71
|
+
if (result !== "same" && result !== "distinct" && result !== "unknown") {
|
|
72
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "invalid explicit WebDAV comparison" });
|
|
73
|
+
}
|
|
74
|
+
if (result === "unknown")
|
|
75
|
+
continue;
|
|
76
|
+
if (answer !== "unknown" && answer !== result) {
|
|
77
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "conflicting explicit WebDAV comparisons" });
|
|
78
|
+
}
|
|
79
|
+
answer = result;
|
|
80
|
+
}
|
|
81
|
+
const builtin = await compareProtocolEntries(own, peer, options);
|
|
82
|
+
if (builtin === "same" && answer === "distinct") {
|
|
83
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "explicit WebDAV comparison contradicts built-in identity" });
|
|
84
|
+
}
|
|
85
|
+
if (builtin === "same")
|
|
86
|
+
return "same";
|
|
87
|
+
return explicit ? answer : builtin;
|
|
88
|
+
};
|
|
89
|
+
async function compareProtocolEntries(own, peer, options) {
|
|
90
|
+
const left = getOwnedWebDavEntry(own);
|
|
91
|
+
const right = getOwnedWebDavEntry(peer);
|
|
92
|
+
const ownQuery = queries.get(own.filesystem);
|
|
93
|
+
const peerQuery = queries.get(peer.filesystem);
|
|
94
|
+
if (!ownQuery || !peerQuery)
|
|
95
|
+
return "unknown";
|
|
96
|
+
options.signal?.throwIfAborted();
|
|
97
|
+
const ownId = await ownQuery(own.path, options);
|
|
98
|
+
options.signal?.throwIfAborted();
|
|
99
|
+
const peerId = await peerQuery(peer.path, options);
|
|
100
|
+
options.signal?.throwIfAborted();
|
|
101
|
+
if (ownId === undefined || peerId === undefined)
|
|
102
|
+
return "unknown";
|
|
103
|
+
if (left && right) {
|
|
104
|
+
const same = left.storage === right.storage && left.resource === right.resource;
|
|
105
|
+
if (same !== (ownId === peerId))
|
|
106
|
+
throw new FsError("EIO", { path: own.path, dest: peer.path, message: "conflicting owned and protocol WebDAV identities" });
|
|
107
|
+
}
|
|
108
|
+
return ownId === peerId ? "same" : "distinct";
|
|
109
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { PlatformComparisonCallback } from "#safe-fs-platform";
|
|
2
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
3
|
+
import type { AppendFileOptions, CopyFileOptions, DirectoryEntry, EntryComparison, FileStat, FileSystem, FsOptions, RenameOptions, MkdirOptions, ReadDirectoryOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions } from "../../contracts/filesystem.js";
|
|
4
|
+
import type { FileDescriptor, OpenFileOptions } from "../../contracts/descriptor.js";
|
|
5
|
+
import type { XmlLimits } from "./xml.js";
|
|
6
|
+
export type WebDavFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
7
|
+
export interface WebDavAtomicEmptyDirectoryRequest {
|
|
8
|
+
readonly operation: "atomic-empty-rmdir/v1";
|
|
9
|
+
readonly namespaceUrl: string;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export interface WebDavAtomicEmptyDirectoryResult {
|
|
14
|
+
readonly operation: "atomic-empty-rmdir/v1";
|
|
15
|
+
readonly namespaceUrl: string;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly outcome: "removed";
|
|
18
|
+
}
|
|
19
|
+
export interface WebDavAtomicEmptyDirectoryBinding {
|
|
20
|
+
readonly namespaceUrl: string;
|
|
21
|
+
readonly removeEmptyDirectory: (request: WebDavAtomicEmptyDirectoryRequest) => Promise<WebDavAtomicEmptyDirectoryResult>;
|
|
22
|
+
}
|
|
23
|
+
export interface WebDavFileSystemOptions {
|
|
24
|
+
readonly baseUrl: string;
|
|
25
|
+
readonly fetch: WebDavFetch;
|
|
26
|
+
readonly requestStreamSupport?: "native" | boolean;
|
|
27
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
28
|
+
/** Response ceiling; unlimited unless configured. */
|
|
29
|
+
readonly maxResponseBytes?: number;
|
|
30
|
+
/** Metadata response ceiling before decoding/parsing; unlimited unless configured. */
|
|
31
|
+
readonly maxXmlBytes?: number;
|
|
32
|
+
/** Timestamp property UTF-8 byte ceiling; unlimited unless configured. */
|
|
33
|
+
readonly maxTimestampPropertyBytes?: number;
|
|
34
|
+
readonly maxEntries?: number;
|
|
35
|
+
/** XML structure ceilings; unlimited unless configured. */
|
|
36
|
+
readonly xmlLimits?: Pick<XmlLimits, "maxNodes" | "maxContentNodes" | "maxDepth" | "maxAttributes">;
|
|
37
|
+
/** Per-request and aggregate stat/write-preflight walk timeout; unlimited unless configured. */
|
|
38
|
+
readonly timeoutMs?: number;
|
|
39
|
+
readonly overwritePolicy?: "lock" | "etag";
|
|
40
|
+
readonly atomicEmptyDirectory?: WebDavAtomicEmptyDirectoryBinding;
|
|
41
|
+
readonly compareEntry?: PlatformComparisonCallback<(this: FileSystem, ...args: Parameters<NonNullable<FileSystem["compareEntry"]>>) => ReturnType<NonNullable<FileSystem["compareEntry"]>>>;
|
|
42
|
+
}
|
|
43
|
+
export declare class WebDavFileSystem implements FileSystem {
|
|
44
|
+
open(path: string, options: OpenFileOptions): Promise<FileDescriptor>;
|
|
45
|
+
readonly capabilities: Readonly<{
|
|
46
|
+
open: false;
|
|
47
|
+
read: true;
|
|
48
|
+
stat: true;
|
|
49
|
+
readdir: true;
|
|
50
|
+
realpath: true;
|
|
51
|
+
access: true;
|
|
52
|
+
write: true;
|
|
53
|
+
append: true;
|
|
54
|
+
exclusiveCreate: true;
|
|
55
|
+
explicitDirectories: true;
|
|
56
|
+
implicitDirectories: false;
|
|
57
|
+
mkdir: true;
|
|
58
|
+
recursiveMkdir: true;
|
|
59
|
+
remove: true;
|
|
60
|
+
recursiveRemove: true;
|
|
61
|
+
rename: true;
|
|
62
|
+
atomicRenameNoReplace: false;
|
|
63
|
+
copy: true;
|
|
64
|
+
exclusiveCopy: true;
|
|
65
|
+
readlink: false;
|
|
66
|
+
truncate: false;
|
|
67
|
+
randomAccessWrite: false;
|
|
68
|
+
removeDirectory: boolean;
|
|
69
|
+
streamingAppend: boolean;
|
|
70
|
+
symlinks: false;
|
|
71
|
+
hardlinks: false;
|
|
72
|
+
permissions: false;
|
|
73
|
+
timestamps: true;
|
|
74
|
+
atomicRename: false;
|
|
75
|
+
streamingRead: true;
|
|
76
|
+
streamingWrite: true;
|
|
77
|
+
}>;
|
|
78
|
+
private readonly base;
|
|
79
|
+
private readonly baseSegments;
|
|
80
|
+
private readonly transport;
|
|
81
|
+
private readonly requestStreamSupport;
|
|
82
|
+
private readonly headers;
|
|
83
|
+
private readonly maxResponseBytes;
|
|
84
|
+
private readonly maxXmlBytes;
|
|
85
|
+
private readonly maxTimestampPropertyBytes;
|
|
86
|
+
private readonly maxEntries;
|
|
87
|
+
private readonly xmlLimits;
|
|
88
|
+
private readonly timeoutMs;
|
|
89
|
+
private readonly walkDeadlines;
|
|
90
|
+
private readonly overwritePolicy;
|
|
91
|
+
private readonly configuredComparison;
|
|
92
|
+
private readonly atomicEmptyDirectory;
|
|
93
|
+
private readonly etags;
|
|
94
|
+
constructor(options: WebDavFileSystemOptions);
|
|
95
|
+
compareEntry(path: string, peer: FileSystem, peerPath: string, options?: FsOptions): Promise<EntryComparison>;
|
|
96
|
+
private resourceId;
|
|
97
|
+
private url;
|
|
98
|
+
private hrefPath;
|
|
99
|
+
private httpError;
|
|
100
|
+
private request;
|
|
101
|
+
private requestStream;
|
|
102
|
+
private bytes;
|
|
103
|
+
private responseLength;
|
|
104
|
+
private bodyChunks;
|
|
105
|
+
private xml;
|
|
106
|
+
private multistatus;
|
|
107
|
+
private lockFailure;
|
|
108
|
+
private entryStat;
|
|
109
|
+
private entries;
|
|
110
|
+
private mutation;
|
|
111
|
+
private unsupported;
|
|
112
|
+
private maybeStat;
|
|
113
|
+
private withWalkDeadline;
|
|
114
|
+
stat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
115
|
+
private statWithAncestors;
|
|
116
|
+
lstat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
117
|
+
readdir(path: string, options?: ReadDirectoryOptions): Promise<DirectoryEntry[]>;
|
|
118
|
+
readFile(path: string, options?: ReadFileOptions): Promise<Uint8Array>;
|
|
119
|
+
readStream(path: string, options?: ReadStreamOptions): AsyncGenerator<Uint8Array>;
|
|
120
|
+
private prepareWrite;
|
|
121
|
+
writeFile(path: string, data: Uint8Array, options?: WriteFileOptions): Promise<void>;
|
|
122
|
+
writeStream(path: string, source: ByteSource, options?: WriteFileOptions): Promise<void>;
|
|
123
|
+
appendFile(path: string, data: Uint8Array, options?: AppendFileOptions): Promise<void>;
|
|
124
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
125
|
+
rmdir(path: string, options?: FsOptions): Promise<void>;
|
|
126
|
+
private atomicRmdir;
|
|
127
|
+
rm(path: string, options?: RemoveOptions): Promise<void>;
|
|
128
|
+
private guardTransferIdentity;
|
|
129
|
+
private transfer;
|
|
130
|
+
private withDestinationLock;
|
|
131
|
+
rename(source: string, destination: string, options?: RenameOptions): Promise<void>;
|
|
132
|
+
copyFile(source: string, destination: string, options?: CopyFileOptions): Promise<void>;
|
|
133
|
+
realpath(path: string, options?: FsOptions): Promise<string>;
|
|
134
|
+
access(path: string, mode?: number, options?: FsOptions): Promise<void>;
|
|
135
|
+
readlink(path: string, _options?: FsOptions): Promise<string>;
|
|
136
|
+
symlink(_target: string, path: string, _options?: FsOptions): Promise<void>;
|
|
137
|
+
link(_source: string, path: string, _options?: FsOptions): Promise<void>;
|
|
138
|
+
chmod(path: string, _mode: number, _options?: FsOptions): Promise<void>;
|
|
139
|
+
utimes(path: string, atimeMs: number, mtimeMs: number, options?: FsOptions): Promise<void>;
|
|
140
|
+
truncate(path: string, _length?: number, _options?: FsOptions): Promise<void>;
|
|
141
|
+
}
|