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,192 @@
|
|
|
1
|
+
import { S3ServiceError } from "../transport.js";
|
|
2
|
+
export function malformed(message = "invalid S3 XML response") {
|
|
3
|
+
throw new S3ServiceError("InvalidResponse", 502, message);
|
|
4
|
+
}
|
|
5
|
+
function validCharacter(code) {
|
|
6
|
+
return code === 9 || code === 10 || code === 13 || (code >= 32 && code <= 0xd7ff)
|
|
7
|
+
|| (code >= 0xe000 && code <= 0xfffd) || (code >= 0x10000 && code <= 0x10ffff);
|
|
8
|
+
}
|
|
9
|
+
function decodeEntities(text) {
|
|
10
|
+
let result = "";
|
|
11
|
+
let position = 0;
|
|
12
|
+
while (position < text.length) {
|
|
13
|
+
const start = text.indexOf("&", position);
|
|
14
|
+
if (start < 0)
|
|
15
|
+
return result + text.slice(position);
|
|
16
|
+
result += text.slice(position, start);
|
|
17
|
+
const end = text.indexOf(";", start + 1);
|
|
18
|
+
if (end < 0 || end - start > 12)
|
|
19
|
+
malformed("invalid XML entity");
|
|
20
|
+
const entity = text.slice(start + 1, end);
|
|
21
|
+
const named = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" };
|
|
22
|
+
if (Object.hasOwn(named, entity))
|
|
23
|
+
result += named[entity];
|
|
24
|
+
else {
|
|
25
|
+
const hexadecimal = entity.startsWith("#x");
|
|
26
|
+
const digits = entity.slice(hexadecimal ? 2 : 1);
|
|
27
|
+
if (!entity.startsWith("#") || !(hexadecimal ? /^[0-9a-fA-F]+$/ : /^[0-9]+$/).test(digits))
|
|
28
|
+
malformed("unknown XML entity");
|
|
29
|
+
const code = Number.parseInt(digits, hexadecimal ? 16 : 10);
|
|
30
|
+
if (!validCharacter(code))
|
|
31
|
+
malformed("invalid XML code point");
|
|
32
|
+
result += String.fromCodePoint(code);
|
|
33
|
+
}
|
|
34
|
+
position = end + 1;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
export function parseXml(bytes, limits = {}) {
|
|
39
|
+
for (const limit of [limits.maxNodes, limits.maxDepth]) {
|
|
40
|
+
if (limit !== undefined && limit !== Infinity && (!Number.isSafeInteger(limit) || limit < 1))
|
|
41
|
+
throw new RangeError("XML limits must be positive safe integers or Infinity");
|
|
42
|
+
}
|
|
43
|
+
let xml;
|
|
44
|
+
try {
|
|
45
|
+
xml = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return malformed("XML is not UTF-8");
|
|
49
|
+
}
|
|
50
|
+
for (const character of xml)
|
|
51
|
+
if (!validCharacter(character.codePointAt(0)))
|
|
52
|
+
malformed("invalid XML character");
|
|
53
|
+
xml = xml.replace(/\r\n?/g, "\n");
|
|
54
|
+
let position = 0;
|
|
55
|
+
let nodes = 0;
|
|
56
|
+
let root;
|
|
57
|
+
const stack = [];
|
|
58
|
+
const whitespace = () => { while (position < xml.length && /[ \t\r\n]/.test(xml[position]))
|
|
59
|
+
position++; };
|
|
60
|
+
const name = () => {
|
|
61
|
+
const start = position;
|
|
62
|
+
if (!/[A-Za-z_]/.test(xml[position] ?? ""))
|
|
63
|
+
malformed("invalid XML name");
|
|
64
|
+
while (position < xml.length && /[A-Za-z0-9_.:-]/.test(xml[position]))
|
|
65
|
+
position++;
|
|
66
|
+
const result = xml.slice(start, position);
|
|
67
|
+
if (result.length > 256)
|
|
68
|
+
malformed("XML name too long");
|
|
69
|
+
return result;
|
|
70
|
+
};
|
|
71
|
+
while (position < xml.length) {
|
|
72
|
+
if (xml[position] !== "<") {
|
|
73
|
+
const end = xml.indexOf("<", position);
|
|
74
|
+
const text = xml.slice(position, end < 0 ? xml.length : end);
|
|
75
|
+
if (text.includes("]]>"))
|
|
76
|
+
malformed();
|
|
77
|
+
const current = stack.at(-1);
|
|
78
|
+
if (current)
|
|
79
|
+
current.text += decodeEntities(text);
|
|
80
|
+
else if (text.trim())
|
|
81
|
+
malformed("text outside XML root");
|
|
82
|
+
position = end < 0 ? xml.length : end;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (xml.startsWith("<?xml ", position) && !root && position === 0) {
|
|
86
|
+
const end = xml.indexOf("?>", position);
|
|
87
|
+
if (end < 0 || end > 256)
|
|
88
|
+
malformed();
|
|
89
|
+
const declaration = xml.slice(position, end);
|
|
90
|
+
if (!/^<\?xml\s+version\s*=\s*(?:"1\.0"|'1\.0')(?:\s+encoding\s*=\s*(?:"[Uu][Tt][Ff]-8"|'[Uu][Tt][Ff]-8'))?(?:\s+standalone\s*=\s*(?:"(?:yes|no)"|'(?:yes|no)'))?\s*$/.test(declaration))
|
|
91
|
+
malformed("unsupported XML declaration");
|
|
92
|
+
position = end + 2;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (xml.startsWith("<!--", position)) {
|
|
96
|
+
const end = xml.indexOf("-->", position + 4);
|
|
97
|
+
const comment = xml.slice(position + 4, end);
|
|
98
|
+
if (end < 0 || comment.includes("--") || comment.endsWith("-"))
|
|
99
|
+
malformed();
|
|
100
|
+
position = end + 3;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (xml.startsWith("<![CDATA[", position)) {
|
|
104
|
+
const end = xml.indexOf("]]>", position + 9);
|
|
105
|
+
const current = stack.at(-1);
|
|
106
|
+
if (end < 0 || !current)
|
|
107
|
+
malformed();
|
|
108
|
+
current.text += xml.slice(position + 9, end);
|
|
109
|
+
position = end + 3;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
position++;
|
|
113
|
+
const closing = xml[position] === "/";
|
|
114
|
+
if (closing)
|
|
115
|
+
position++;
|
|
116
|
+
const tag = name();
|
|
117
|
+
if (closing) {
|
|
118
|
+
whitespace();
|
|
119
|
+
if (xml[position++] !== ">" || stack.pop()?.name !== tag)
|
|
120
|
+
malformed("mismatched XML close tag");
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const attributes = new Set();
|
|
124
|
+
while (true) {
|
|
125
|
+
const previous = position;
|
|
126
|
+
whitespace();
|
|
127
|
+
if (xml[position] === ">" || xml[position] === "/")
|
|
128
|
+
break;
|
|
129
|
+
if (previous === position || attributes.size >= 32)
|
|
130
|
+
malformed("invalid XML attributes");
|
|
131
|
+
const attribute = name();
|
|
132
|
+
if (attributes.has(attribute))
|
|
133
|
+
malformed("duplicate XML attribute");
|
|
134
|
+
attributes.add(attribute);
|
|
135
|
+
whitespace();
|
|
136
|
+
if (xml[position++] !== "=")
|
|
137
|
+
malformed();
|
|
138
|
+
whitespace();
|
|
139
|
+
const quote = xml[position++];
|
|
140
|
+
if (quote !== '"' && quote !== "'")
|
|
141
|
+
malformed();
|
|
142
|
+
const end = xml.indexOf(quote, position);
|
|
143
|
+
if (end < 0 || xml.slice(position, end).includes("<"))
|
|
144
|
+
malformed();
|
|
145
|
+
decodeEntities(xml.slice(position, end));
|
|
146
|
+
position = end + 1;
|
|
147
|
+
}
|
|
148
|
+
const selfClosing = xml[position] === "/";
|
|
149
|
+
if (selfClosing)
|
|
150
|
+
position++;
|
|
151
|
+
if (xml[position++] !== ">")
|
|
152
|
+
malformed();
|
|
153
|
+
if (++nodes > (limits.maxNodes ?? Infinity) || stack.length >= (limits.maxDepth ?? Infinity))
|
|
154
|
+
malformed("XML structure limit exceeded");
|
|
155
|
+
const node = { name: tag, text: "", children: [] };
|
|
156
|
+
const parent = stack.at(-1);
|
|
157
|
+
if (parent)
|
|
158
|
+
parent.children.push(node);
|
|
159
|
+
else if (root)
|
|
160
|
+
malformed("multiple XML roots");
|
|
161
|
+
else
|
|
162
|
+
root = node;
|
|
163
|
+
if (!selfClosing)
|
|
164
|
+
stack.push(node);
|
|
165
|
+
}
|
|
166
|
+
if (!root || stack.length)
|
|
167
|
+
malformed("incomplete XML");
|
|
168
|
+
return root;
|
|
169
|
+
}
|
|
170
|
+
export function children(node, name) {
|
|
171
|
+
return node.children.filter(child => child.name === name);
|
|
172
|
+
}
|
|
173
|
+
export function text(node, name, required = false) {
|
|
174
|
+
const matches = children(node, name);
|
|
175
|
+
if (matches.length > 1 || (required && matches.length !== 1))
|
|
176
|
+
malformed(`invalid ${name} count`);
|
|
177
|
+
const child = matches[0];
|
|
178
|
+
if (child?.children.length)
|
|
179
|
+
malformed(`invalid ${name} value`);
|
|
180
|
+
return child?.text;
|
|
181
|
+
}
|
|
182
|
+
export function integer(value) {
|
|
183
|
+
if (!/^[0-9]+$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
184
|
+
malformed("invalid integer");
|
|
185
|
+
return Number(value);
|
|
186
|
+
}
|
|
187
|
+
export function timestamp(value) {
|
|
188
|
+
const date = new Date(value);
|
|
189
|
+
if (!Number.isFinite(date.getTime()))
|
|
190
|
+
malformed("invalid timestamp");
|
|
191
|
+
return date;
|
|
192
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { S3FileSystem, S3RenameError } from "./filesystem.js";
|
|
2
|
+
export type { S3FileSystemOptions } from "./filesystem.js";
|
|
3
|
+
export { createS3NamespaceFileSystem } from './namespace.js';
|
|
4
|
+
export type { S3NamespaceOptions } from './namespace.js';
|
|
5
|
+
export { MockS3Client } from "./mock.js";
|
|
6
|
+
export type { MockS3ClientOptions, MockS3Operation, MockS3Request } from "./mock.js";
|
|
7
|
+
export { createS3Transport, encodeCopySource, S3ServiceError } from "./transport.js";
|
|
8
|
+
export type { S3Body, S3Client, S3CopyInput, S3CopyOutput, S3DeleteInput, S3GetOutput, S3HeadOutput, S3ListInput, S3ListOutput, S3ObjectInput, S3ObjectSummary, S3PutInput, S3RequestOptions, S3Transport, S3TransportCapabilities, } from "./transport.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** S3 orders keys lexicographically by their UTF-8 bytes. */
|
|
2
|
+
export function compareKeys(left, right) {
|
|
3
|
+
const encoder = new TextEncoder();
|
|
4
|
+
const a = encoder.encode(left), b = encoder.encode(right);
|
|
5
|
+
for (let index = 0; index < Math.min(a.length, b.length); index++) {
|
|
6
|
+
const difference = a[index] - b[index];
|
|
7
|
+
if (difference)
|
|
8
|
+
return difference;
|
|
9
|
+
}
|
|
10
|
+
return a.length - b.length;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ByteSource } from '../../contracts/io.js';
|
|
2
|
+
/** Admit the fixed manifest grammar before JSON.parse can allocate its graph. */
|
|
3
|
+
export declare function admitManifest(source: ByteSource, options: {
|
|
4
|
+
maxManifestBytes: number;
|
|
5
|
+
maxEntries: number;
|
|
6
|
+
maxBytes: number;
|
|
7
|
+
signal?: AbortSignal | undefined;
|
|
8
|
+
}): ByteSource;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { FsError } from '../../contracts/errors.js';
|
|
2
|
+
import { readBytes } from '../../contracts/io.js';
|
|
3
|
+
/** Admit the fixed manifest grammar before JSON.parse can allocate its graph. */
|
|
4
|
+
export async function* admitManifest(source, options) {
|
|
5
|
+
const decoder = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
|
|
6
|
+
const frames = [];
|
|
7
|
+
let started = false;
|
|
8
|
+
let done = false;
|
|
9
|
+
let token = '';
|
|
10
|
+
let quoted = false;
|
|
11
|
+
let escaped = false;
|
|
12
|
+
let entries = 0;
|
|
13
|
+
let bytes = 0;
|
|
14
|
+
let wireBytes = 0;
|
|
15
|
+
let allocation = 0;
|
|
16
|
+
// Conservative accounting for graph storage, array growth, and validation
|
|
17
|
+
// tables. This is an admission estimate, not a process-RSS guarantee.
|
|
18
|
+
const allocationLimit = options.maxManifestBytes * 4;
|
|
19
|
+
const invalid = () => { throw new FsError('EIO', { message: 'Invalid S3 namespace structure' }); };
|
|
20
|
+
const reserve = (amount) => {
|
|
21
|
+
if (amount > allocationLimit - allocation)
|
|
22
|
+
throw new FsError('EFBIG', { message: 'S3 namespace graph exceeds allocation budget' });
|
|
23
|
+
allocation += amount;
|
|
24
|
+
};
|
|
25
|
+
const open = (shape) => {
|
|
26
|
+
reserve(256);
|
|
27
|
+
frames.push({ shape, state: shape === 'bytes' ? 'valueOrEnd' : 'keyOrEnd', key: '', keys: new Set() });
|
|
28
|
+
};
|
|
29
|
+
const scalar = () => {
|
|
30
|
+
const frame = frames.at(-1) ?? invalid();
|
|
31
|
+
let value;
|
|
32
|
+
try {
|
|
33
|
+
value = JSON.parse(token);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
invalid();
|
|
37
|
+
}
|
|
38
|
+
token = '';
|
|
39
|
+
if (frame.state === 'key' || frame.state === 'keyOrEnd') {
|
|
40
|
+
if (typeof value !== 'string' || frame.keys.has(value))
|
|
41
|
+
invalid();
|
|
42
|
+
const key = value;
|
|
43
|
+
if (frame.shape === 'nodes') {
|
|
44
|
+
if (++entries > options.maxEntries)
|
|
45
|
+
throw new FsError('ENOSPC');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const fields = frame.shape === 'namespace' ? ['version', 'identity', 'nextInode', 'nodes']
|
|
49
|
+
: ['ino', 'revision', 'type', 'mode', 'time', 'bytes'];
|
|
50
|
+
if (!fields.includes(key))
|
|
51
|
+
invalid();
|
|
52
|
+
}
|
|
53
|
+
reserve(64 + key.length * 2);
|
|
54
|
+
frame.keys.add(key);
|
|
55
|
+
frame.key = key;
|
|
56
|
+
frame.state = 'colon';
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (frame.state !== 'value' && frame.state !== 'valueOrEnd')
|
|
60
|
+
invalid();
|
|
61
|
+
if (frame.shape === 'bytes') {
|
|
62
|
+
if (!Number.isInteger(value) || value < 0 || value > 255)
|
|
63
|
+
invalid();
|
|
64
|
+
if (++bytes > options.maxBytes)
|
|
65
|
+
throw new FsError('ENOSPC');
|
|
66
|
+
reserve(16);
|
|
67
|
+
}
|
|
68
|
+
else if (frame.shape === 'nodes' || frame.key === 'nodes' || frame.key === 'bytes')
|
|
69
|
+
invalid();
|
|
70
|
+
else if (frame.key === 'identity' || frame.key === 'type') {
|
|
71
|
+
if (typeof value !== 'string' || (frame.key === 'identity' ? value.length < 1 || value.length > 128 : !['file', 'directory'].includes(value)))
|
|
72
|
+
invalid();
|
|
73
|
+
reserve(value.length * 2);
|
|
74
|
+
}
|
|
75
|
+
else if (typeof value !== 'number' || !Number.isFinite(value))
|
|
76
|
+
invalid();
|
|
77
|
+
frame.state = 'commaOrEnd';
|
|
78
|
+
};
|
|
79
|
+
const feed = (text) => {
|
|
80
|
+
for (const character of text) {
|
|
81
|
+
if (token) {
|
|
82
|
+
if (quoted) {
|
|
83
|
+
token += character;
|
|
84
|
+
if (escaped)
|
|
85
|
+
escaped = false;
|
|
86
|
+
else if (character === '\\')
|
|
87
|
+
escaped = true;
|
|
88
|
+
else if (character === '"') {
|
|
89
|
+
quoted = false;
|
|
90
|
+
scalar();
|
|
91
|
+
}
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (![' ', '\n', '\r', '\t', ',', '}', ']'].includes(character)) {
|
|
95
|
+
if (token.length >= 64)
|
|
96
|
+
invalid();
|
|
97
|
+
token += character;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
scalar();
|
|
101
|
+
}
|
|
102
|
+
if ([' ', '\n', '\r', '\t'].includes(character))
|
|
103
|
+
continue;
|
|
104
|
+
if (done)
|
|
105
|
+
invalid();
|
|
106
|
+
if (!started) {
|
|
107
|
+
if (character !== '{')
|
|
108
|
+
invalid();
|
|
109
|
+
started = true;
|
|
110
|
+
open('namespace');
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const frame = frames.at(-1) ?? invalid();
|
|
114
|
+
if (character === '}' || character === ']') {
|
|
115
|
+
if ((character === ']') !== (frame.shape === 'bytes')
|
|
116
|
+
|| !['commaOrEnd', 'keyOrEnd', 'valueOrEnd'].includes(frame.state))
|
|
117
|
+
invalid();
|
|
118
|
+
if (frame.shape === 'namespace' && frame.keys.size !== 4 || frame.shape === 'node' && frame.keys.size !== 6)
|
|
119
|
+
invalid();
|
|
120
|
+
frames.pop();
|
|
121
|
+
if (!frames.length)
|
|
122
|
+
done = true;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (frame.state === 'commaOrEnd') {
|
|
126
|
+
if (character !== ',')
|
|
127
|
+
invalid();
|
|
128
|
+
frame.state = frame.shape === 'bytes' ? 'value' : 'key';
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (frame.state === 'colon') {
|
|
132
|
+
if (character !== ':')
|
|
133
|
+
invalid();
|
|
134
|
+
frame.state = 'value';
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (frame.state === 'key' || frame.state === 'keyOrEnd') {
|
|
138
|
+
if (character !== '"')
|
|
139
|
+
invalid();
|
|
140
|
+
}
|
|
141
|
+
else if (character === '{' || character === '[') {
|
|
142
|
+
const shape = frame.shape === 'namespace' && frame.key === 'nodes' ? 'nodes'
|
|
143
|
+
: frame.shape === 'nodes' ? 'node' : frame.shape === 'node' && frame.key === 'bytes' ? 'bytes' : invalid();
|
|
144
|
+
if ((character === '[') !== (shape === 'bytes'))
|
|
145
|
+
invalid();
|
|
146
|
+
frame.state = 'commaOrEnd';
|
|
147
|
+
open(shape);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
else if (frame.shape === 'nodes' || frame.key === 'nodes' || frame.key === 'bytes')
|
|
151
|
+
invalid();
|
|
152
|
+
quoted = character === '"';
|
|
153
|
+
escaped = false;
|
|
154
|
+
token = character;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
for await (const chunk of readBytes(source, options.signal)) {
|
|
158
|
+
if (chunk.byteLength > options.maxManifestBytes - wireBytes)
|
|
159
|
+
throw new FsError('EFBIG');
|
|
160
|
+
wireBytes += chunk.byteLength;
|
|
161
|
+
feed(decoder.decode(chunk, { stream: true }));
|
|
162
|
+
yield chunk;
|
|
163
|
+
}
|
|
164
|
+
feed(decoder.decode());
|
|
165
|
+
if (!done || token || frames.length)
|
|
166
|
+
invalid();
|
|
167
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { S3StreamGetInput, S3StreamGetOutput, S3StreamPutInput } from "./transport.js";
|
|
2
|
+
import type { S3CopyInput, S3CopyOutput, S3DeleteInput, S3GetOutput, S3HeadOutput, S3ListInput, S3ListOutput, S3ObjectInput, S3PutInput, S3RequestOptions, S3Transport } from "./transport.js";
|
|
3
|
+
export type MockS3Operation = "headObject" | "getObject" | "putObject" | "deleteObject" | "copyObject" | "listObjectsV2";
|
|
4
|
+
export interface MockS3Request {
|
|
5
|
+
readonly operation: MockS3Operation;
|
|
6
|
+
readonly input: S3ObjectInput | S3ListInput | S3CopyInput | S3PutInput | S3DeleteInput;
|
|
7
|
+
}
|
|
8
|
+
export interface MockS3ClientOptions {
|
|
9
|
+
readonly buckets: readonly string[];
|
|
10
|
+
readonly pageSize?: number;
|
|
11
|
+
readonly now?: () => Date;
|
|
12
|
+
readonly authorize?: (request: MockS3Request) => void | Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class MockS3Client implements S3Transport {
|
|
15
|
+
readonly capabilities: Readonly<{
|
|
16
|
+
conditionalPut: true;
|
|
17
|
+
conditionalCopy: true;
|
|
18
|
+
conditionalDelete: true;
|
|
19
|
+
streamingRead: true;
|
|
20
|
+
streamingWrite: true;
|
|
21
|
+
}>;
|
|
22
|
+
private readonly buckets;
|
|
23
|
+
private readonly cursors;
|
|
24
|
+
private readonly history;
|
|
25
|
+
private readonly pageSize;
|
|
26
|
+
private readonly now;
|
|
27
|
+
private readonly authorize;
|
|
28
|
+
private nextToken;
|
|
29
|
+
constructor(options: MockS3ClientOptions);
|
|
30
|
+
get requests(): readonly MockS3Request[];
|
|
31
|
+
private begin;
|
|
32
|
+
private bucket;
|
|
33
|
+
private object;
|
|
34
|
+
private head;
|
|
35
|
+
private store;
|
|
36
|
+
headObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3HeadOutput>;
|
|
37
|
+
getObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3GetOutput>;
|
|
38
|
+
putObject(input: S3PutInput, options?: S3RequestOptions): Promise<{
|
|
39
|
+
ETag: string;
|
|
40
|
+
}>;
|
|
41
|
+
getObjectStream(input: S3StreamGetInput, options?: S3RequestOptions): Promise<S3StreamGetOutput>;
|
|
42
|
+
putObjectStream(input: S3StreamPutInput, options?: S3RequestOptions): Promise<{
|
|
43
|
+
ETag: string;
|
|
44
|
+
}>;
|
|
45
|
+
deleteObject(input: S3DeleteInput, options?: S3RequestOptions): Promise<Record<string, never>>;
|
|
46
|
+
copyObject(input: S3CopyInput, options?: S3RequestOptions): Promise<S3CopyOutput>;
|
|
47
|
+
listObjectsV2(input: S3ListInput, options?: S3RequestOptions): Promise<S3ListOutput>;
|
|
48
|
+
}
|