toolcraft 0.0.749 → 0.0.751
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composition.json +23 -3
- package/dist/composition.json +23 -3
- package/dist/human-in-loop/approvals-commands.d.ts +1 -1
- package/dist/index.d.ts +1 -262
- package/dist/index.js +1 -573
- package/dist/runtime-platform.d.ts +2 -0
- package/dist/runtime-platform.js +2 -0
- package/dist/runtime-platform.workerd.d.ts +3 -0
- package/dist/runtime-platform.workerd.js +10 -0
- package/dist/runtime.d.ts +262 -0
- package/dist/runtime.js +576 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +478 -0
- package/node_modules/@noble/hashes/_blake.d.ts +20 -0
- package/node_modules/@noble/hashes/_blake.js +59 -0
- package/node_modules/@noble/hashes/_md.d.ts +95 -0
- package/node_modules/@noble/hashes/_md.js +209 -0
- package/node_modules/@noble/hashes/_u64.d.ts +36 -0
- package/node_modules/@noble/hashes/_u64.js +77 -0
- package/node_modules/@noble/hashes/argon2.d.ts +148 -0
- package/node_modules/@noble/hashes/argon2.js +577 -0
- package/node_modules/@noble/hashes/blake1.d.ts +162 -0
- package/node_modules/@noble/hashes/blake1.js +630 -0
- package/node_modules/@noble/hashes/blake2.d.ts +203 -0
- package/node_modules/@noble/hashes/blake2.js +573 -0
- package/node_modules/@noble/hashes/blake3.d.ts +68 -0
- package/node_modules/@noble/hashes/blake3.js +310 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +91 -0
- package/node_modules/@noble/hashes/eskdf.js +225 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +70 -0
- package/node_modules/@noble/hashes/hkdf.js +152 -0
- package/node_modules/@noble/hashes/hmac.d.ts +50 -0
- package/node_modules/@noble/hashes/hmac.js +93 -0
- package/node_modules/@noble/hashes/index.d.ts +1 -0
- package/node_modules/@noble/hashes/index.js +34 -0
- package/node_modules/@noble/hashes/legacy.d.ts +107 -0
- package/node_modules/@noble/hashes/legacy.js +348 -0
- package/node_modules/@noble/hashes/package.json +91 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +66 -0
- package/node_modules/@noble/hashes/pbkdf2.js +176 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +98 -0
- package/node_modules/@noble/hashes/scrypt.js +304 -0
- package/node_modules/@noble/hashes/sha2.d.ts +176 -0
- package/node_modules/@noble/hashes/sha2.js +446 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +533 -0
- package/node_modules/@noble/hashes/sha3-addons.js +973 -0
- package/node_modules/@noble/hashes/sha3.d.ts +208 -0
- package/node_modules/@noble/hashes/sha3.js +475 -0
- package/node_modules/@noble/hashes/src/_blake.ts +67 -0
- package/node_modules/@noble/hashes/src/_md.ts +227 -0
- package/node_modules/@noble/hashes/src/_u64.ts +111 -0
- package/node_modules/@noble/hashes/src/argon2.ts +693 -0
- package/node_modules/@noble/hashes/src/blake1.ts +677 -0
- package/node_modules/@noble/hashes/src/blake2.ts +648 -0
- package/node_modules/@noble/hashes/src/blake3.ts +344 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +265 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +161 -0
- package/node_modules/@noble/hashes/src/hmac.ts +130 -0
- package/node_modules/@noble/hashes/src/index.ts +33 -0
- package/node_modules/@noble/hashes/src/legacy.ts +361 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +219 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +375 -0
- package/node_modules/@noble/hashes/src/sha2.ts +486 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +1157 -0
- package/node_modules/@noble/hashes/src/sha3.ts +525 -0
- package/node_modules/@noble/hashes/src/utils.ts +978 -0
- package/node_modules/@noble/hashes/src/webcrypto.ts +283 -0
- package/node_modules/@noble/hashes/utils.d.ts +560 -0
- package/node_modules/@noble/hashes/utils.js +687 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts +121 -0
- package/node_modules/@noble/hashes/webcrypto.js +228 -0
- package/node_modules/@poe-code/agent-mcp-config/dist/apply.js +23 -9
- package/node_modules/@poe-code/config-mutations/README.md +2 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +4 -5
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +3 -4
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +3 -3
- package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +2 -2
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +3 -6
- package/node_modules/@poe-code/config-mutations/dist/types.d.ts +4 -2
- package/node_modules/@poe-code/process-runner/README.md +2 -1
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.d.ts +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.d.ts +2 -0
- package/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.js +1 -0
- package/node_modules/@poe-code/process-runner/dist/types.d.ts +1 -1
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +6 -5
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +67 -29
- package/node_modules/@poe-code/process-runner/package.json +13 -0
- package/node_modules/@poe-code/safe-fs/LICENSE +21 -0
- package/node_modules/@poe-code/safe-fs/PROVENANCE.json +428 -0
- package/node_modules/@poe-code/safe-fs/README.md +411 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/confinement.js +171 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.d.ts +93 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.js +453 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/index.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/stats.js +37 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.d.ts +81 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/bridge/values.js +65 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config/memory.js +7 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/config/real.js +16 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config/registry.js +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/config.js +46 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/config.node.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/config.portable.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/abort.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.d.ts +38 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.d.ts +53 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/errors.js +99 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.d.ts +379 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/index.js +6 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/io.js +321 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.d.ts +134 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/object.js +97 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/path.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.js +162 -0
- package/node_modules/@poe-code/safe-fs/dist/core.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/core.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/capabilities.js +216 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.js +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.d.ts +21 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/descriptor.js +279 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.d.ts +59 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/index.js +875 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/path.js +250 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.js +136 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.d.ts +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.js +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.d.ts +186 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/index.js +3771 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +96 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.js +26 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.js +144 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.js +118 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.d.ts +6 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.js +29 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.d.ts +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/mount/index.js +1291 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-authority.js +287 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +45 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +531 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.d.ts +87 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.js +1185 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.d.ts +42 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.js +558 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.d.ts +12 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/quota/index.js +520 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.d.ts +37 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.js +208 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.js +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.d.ts +105 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/real/index.js +1259 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.d.ts +7 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.js +38 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.d.ts +130 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.js +1137 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.js +9 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.js +74 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.d.ts +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.js +111 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.d.ts +17 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.js +89 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.d.ts +20 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.js +76 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.js +478 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.d.ts +30 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.d.ts +14 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.js +192 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/index.js +4 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.js +11 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.js +167 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.d.ts +48 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.js +249 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.d.ts +13 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.js +400 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.d.ts +10 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.js +73 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.d.ts +103 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.js +28 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +663 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.js +115 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.js +63 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.js +109 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.d.ts +141 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.js +1377 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.js +59 -0
- package/node_modules/@poe-code/safe-fs/dist/index.d.ts +25 -0
- package/node_modules/@poe-code/safe-fs/dist/index.js +21 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/linux-x64-glibc.node +0 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.d.ts +5 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.mjs +120 -0
- package/node_modules/@poe-code/safe-fs/dist/native/fs-seek/manifest.json +46 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/node/filesystem.js +30 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/host.js +78 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/index.js +2 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/node/native-seek.js +54 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/stats.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node/values.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-host.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/node-unavailable.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/package.json +29 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/browser.js +58 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node-path.js +1 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.d.ts +26 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/node.js +64 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.js +17 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.d.ts +15 -0
- package/node_modules/@poe-code/safe-fs/dist/python/emscripten.js +357 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.d.ts +51 -0
- package/node_modules/@poe-code/safe-fs/dist/python/filesystem.js +243 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.d.ts +3 -0
- package/node_modules/@poe-code/safe-fs/dist/python/flags.js +14 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.d.ts +9 -0
- package/node_modules/@poe-code/safe-fs/dist/python/index.js +5 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.d.ts +18 -0
- package/node_modules/@poe-code/safe-fs/dist/python/native.js +446 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.d.ts +2 -0
- package/node_modules/@poe-code/safe-fs/dist/python/request.js +61 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.d.ts +8 -0
- package/node_modules/@poe-code/safe-fs/dist/python/stat.js +34 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.d.ts +27 -0
- package/node_modules/@poe-code/safe-fs/dist/runtime-core.js +57 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.d.ts +16 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.js +496 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.d.ts +23 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.js +39 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.d.ts +31 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.js +143 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.d.ts +19 -0
- package/node_modules/@poe-code/safe-fs/dist/testing/object-publication.js +209 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/xml.js +1 -0
- package/node_modules/@poe-code/safe-fs/package.json +189 -0
- package/node_modules/@poe-code/task-list/README.md +2 -0
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +1 -1
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +11 -4
- package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +2 -2
- package/node_modules/@poe-code/task-list/dist/backends/utils.js +5 -7
- package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +1 -1
- package/node_modules/@poe-code/task-list/dist/default-host.d.ts +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.js +2 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.d.ts +4 -0
- package/node_modules/@poe-code/task-list/dist/default-host.workerd.js +6 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.d.ts +3 -0
- package/node_modules/@poe-code/task-list/dist/filesystem.js +32 -0
- package/node_modules/@poe-code/task-list/dist/move.js +3 -3
- package/node_modules/@poe-code/task-list/dist/open.js +2 -5
- package/node_modules/@poe-code/task-list/dist/paths.d.ts +12 -0
- package/node_modules/@poe-code/task-list/dist/paths.js +7 -0
- package/node_modules/@poe-code/task-list/dist/types.d.ts +6 -5
- package/node_modules/@poe-code/task-list/package.json +9 -0
- package/node_modules/@poe-code/terminal-text/LICENSE +21 -0
- package/node_modules/@poe-code/terminal-text/README.md +12 -0
- package/node_modules/@poe-code/terminal-text/dist/index.d.ts +2 -0
- package/node_modules/@poe-code/terminal-text/dist/index.js +20 -0
- package/node_modules/@poe-code/terminal-text/package.json +22 -0
- package/node_modules/@poe-code/xml-ast/LICENSE +21 -0
- package/node_modules/@poe-code/xml-ast/README.md +28 -0
- package/node_modules/@poe-code/xml-ast/dist/index.d.ts +47 -0
- package/node_modules/@poe-code/xml-ast/dist/index.js +635 -0
- package/node_modules/@poe-code/xml-ast/package.json +25 -0
- package/node_modules/auth-store/README.md +35 -0
- package/node_modules/auth-store/dist/index.browser.d.ts +4 -0
- package/node_modules/auth-store/dist/index.browser.js +2 -0
- package/node_modules/auth-store/dist/provider-store.d.ts +1 -1
- package/node_modules/auth-store/dist/safe-fs-secret-store.d.ts +21 -0
- package/node_modules/auth-store/dist/safe-fs-secret-store.js +119 -0
- package/node_modules/auth-store/dist/secret-store.d.ts +12 -0
- package/node_modules/auth-store/dist/secret-store.js +1 -0
- package/node_modules/auth-store/dist/transaction-lock.d.ts +2 -4
- package/node_modules/auth-store/dist/types.d.ts +2 -9
- package/node_modules/auth-store/package.json +16 -2
- package/node_modules/tiny-http-mcp-server/dist/composition.json +16 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +25 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-state.js +4 -4
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +6 -40
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.d.ts +10 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.js +20 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/pkce.js +4 -3
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts +14 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js +53 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.d.ts +16 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.js +29 -9
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.d.ts +12 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.js +23 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.js +6 -19
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.js +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +6 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +5 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.d.ts +5 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.js +4 -1
- package/node_modules/tiny-http-mcp-server/package.json +4 -4
- package/node_modules/tiny-mcp-client/README.md +2 -0
- package/node_modules/tiny-mcp-client/dist/index.browser.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.browser.js +116 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +25 -23
- package/node_modules/tiny-mcp-client/dist/index.js +1034 -561
- package/node_modules/tiny-mcp-client/package.json +15 -0
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-design/dist/components/table.js +6 -0
- package/node_modules/toolcraft-design/dist/escape-terminal-text.d.ts +1 -2
- package/node_modules/toolcraft-design/dist/escape-terminal-text.js +1 -20
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +2 -1
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +2 -1
- package/node_modules/toolcraft-schema/dist/json-schema/utils.js +3 -0
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +32 -7
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FsError } from "../contracts/errors.js";
|
|
2
|
+
import { chargeTransportOptions } from "./transport-budget.js";
|
|
3
|
+
export const platform = Object.freeze({
|
|
4
|
+
nativeFileSystem: Object.freeze({ open: false, permissions: false, timestamps: false, conditionalChmod: false, trustedOwnedStaging: false, atomicRename: false }),
|
|
5
|
+
maxCollectionBytes: Infinity,
|
|
6
|
+
errno(_code) {
|
|
7
|
+
return undefined;
|
|
8
|
+
},
|
|
9
|
+
callbackAuthorities: false,
|
|
10
|
+
randomUUID() {
|
|
11
|
+
const crypto = globalThis.crypto;
|
|
12
|
+
if (typeof crypto?.randomUUID === "function")
|
|
13
|
+
return crypto.randomUUID();
|
|
14
|
+
if (typeof crypto?.getRandomValues !== "function") {
|
|
15
|
+
throw new FsError("ENOTSUP", { message: "secure crypto is required for overlay staging" });
|
|
16
|
+
}
|
|
17
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
18
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
19
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
20
|
+
const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, "0")).join("");
|
|
21
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const operationKey = Symbol("filesystem-comparison");
|
|
25
|
+
const contexts = new WeakSet();
|
|
26
|
+
export const comparisonContext = Object.freeze({
|
|
27
|
+
active(options) {
|
|
28
|
+
const context = options[operationKey];
|
|
29
|
+
return context !== undefined && contexts.has(context);
|
|
30
|
+
},
|
|
31
|
+
async run(options, action) {
|
|
32
|
+
const context = Object.freeze({});
|
|
33
|
+
contexts.add(context);
|
|
34
|
+
const nested = { ...options, [operationKey]: context };
|
|
35
|
+
try {
|
|
36
|
+
return await action(nested);
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
contexts.delete(context);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
// Browser operations carry request budgets in their options, including streams.
|
|
44
|
+
export function getScopedTransportBudget() {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
export function withScopedTransportBudget(frames, action) {
|
|
48
|
+
if (frames !== undefined)
|
|
49
|
+
throw new FsError("ENOTSUP", { message: "S3 transport budget contexts require Node" });
|
|
50
|
+
return action();
|
|
51
|
+
}
|
|
52
|
+
export function runScopedTransportBudget(_admit, action, _credit = 1) {
|
|
53
|
+
return action();
|
|
54
|
+
}
|
|
55
|
+
export function chargeScopedTransportCall(options) {
|
|
56
|
+
options?.signal?.throwIfAborted();
|
|
57
|
+
chargeTransportOptions(options);
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { posix } from "node:path";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { posix } from "node:path";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
import { type ScopedTransportBudgetFrame } from "./transport-budget.js";
|
|
3
|
+
export type PlatformErrno = number;
|
|
4
|
+
export type PlatformComparisonCallback<Callback> = Callback;
|
|
5
|
+
export declare const platform: Readonly<{
|
|
6
|
+
nativeFileSystem: Readonly<{
|
|
7
|
+
open: true;
|
|
8
|
+
permissions: true;
|
|
9
|
+
timestamps: true;
|
|
10
|
+
conditionalChmod: true;
|
|
11
|
+
trustedOwnedStaging: true;
|
|
12
|
+
atomicRename: true;
|
|
13
|
+
}>;
|
|
14
|
+
maxCollectionBytes: number;
|
|
15
|
+
errno(code: string): PlatformErrno;
|
|
16
|
+
callbackAuthorities: true;
|
|
17
|
+
randomUUID: () => string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const comparisonContext: Readonly<{
|
|
20
|
+
active(_options: FsOptions): boolean;
|
|
21
|
+
run<Result>(options: FsOptions, action: (nested: FsOptions) => Promise<Result>): Promise<Result>;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function getScopedTransportBudget(): readonly ScopedTransportBudgetFrame[] | undefined;
|
|
24
|
+
export declare function withScopedTransportBudget<Result>(frames: readonly ScopedTransportBudgetFrame[] | undefined, action: () => Result): Result;
|
|
25
|
+
export declare function runScopedTransportBudget<Result>(admit: (options?: FsOptions) => void, action: () => Result, credit?: number): Result;
|
|
26
|
+
export declare function chargeScopedTransportCall(options?: FsOptions): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import * as util from "node:util";
|
|
4
|
+
import { constants } from "node:os";
|
|
5
|
+
import { hasRegisteredS3FileSystem } from "./transport-budget.js";
|
|
6
|
+
const systemErrnos = (() => {
|
|
7
|
+
const fallback = new Map(Object.entries(constants.errno).map(([name, errno]) => [name, -Math.abs(errno)]));
|
|
8
|
+
if (typeof util.getSystemErrorMap !== "function")
|
|
9
|
+
return fallback;
|
|
10
|
+
try {
|
|
11
|
+
return new Map([...util.getSystemErrorMap()].map(([errno, [name]]) => [name, errno]));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
})();
|
|
17
|
+
const negotiating = new AsyncLocalStorage();
|
|
18
|
+
export const platform = Object.freeze({
|
|
19
|
+
nativeFileSystem: Object.freeze({ open: true, permissions: true, timestamps: true, conditionalChmod: true, trustedOwnedStaging: true, atomicRename: true }),
|
|
20
|
+
maxCollectionBytes: Infinity,
|
|
21
|
+
errno(code) {
|
|
22
|
+
const errno = systemErrnos.get(code === "EOPNOTSUPP" ? "ENOTSUP" : code);
|
|
23
|
+
if (errno === undefined)
|
|
24
|
+
throw new TypeError(`Unsupported platform errno code: ${code}`);
|
|
25
|
+
return errno;
|
|
26
|
+
},
|
|
27
|
+
callbackAuthorities: true,
|
|
28
|
+
randomUUID: randomUUID
|
|
29
|
+
});
|
|
30
|
+
export const comparisonContext = Object.freeze({
|
|
31
|
+
active(_options) {
|
|
32
|
+
return negotiating.getStore() === true;
|
|
33
|
+
},
|
|
34
|
+
run(options, action) {
|
|
35
|
+
return negotiating.run(true, () => action(options));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const transportBudgets = new AsyncLocalStorage();
|
|
39
|
+
export function getScopedTransportBudget() {
|
|
40
|
+
return hasRegisteredS3FileSystem ? transportBudgets.getStore() : undefined;
|
|
41
|
+
}
|
|
42
|
+
export function withScopedTransportBudget(frames, action) {
|
|
43
|
+
return frames ? transportBudgets.run(frames, action) : action();
|
|
44
|
+
}
|
|
45
|
+
export function runScopedTransportBudget(admit, action, credit = 1) {
|
|
46
|
+
if (!hasRegisteredS3FileSystem)
|
|
47
|
+
return action();
|
|
48
|
+
const parent = transportBudgets.getStore() ?? [];
|
|
49
|
+
const frame = { credit, admit };
|
|
50
|
+
return transportBudgets.run([...parent, frame], action);
|
|
51
|
+
}
|
|
52
|
+
export function chargeScopedTransportCall(options) {
|
|
53
|
+
if (!hasRegisteredS3FileSystem)
|
|
54
|
+
return;
|
|
55
|
+
const frames = transportBudgets.getStore();
|
|
56
|
+
if (!frames)
|
|
57
|
+
return;
|
|
58
|
+
for (const frame of frames) {
|
|
59
|
+
if (frame.credit > 0)
|
|
60
|
+
frame.credit--;
|
|
61
|
+
else
|
|
62
|
+
frame.admit(options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export interface ScopedTransportBudgetFrame {
|
|
3
|
+
credit: number;
|
|
4
|
+
readonly admit: (options?: FsOptions) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare let hasRegisteredS3FileSystem: boolean;
|
|
7
|
+
export declare function enableS3TransportBudget(): void;
|
|
8
|
+
export declare function scopeTransportOptions(options: FsOptions, admit: (options?: FsOptions) => void, credit: number): FsOptions;
|
|
9
|
+
export declare function chargeTransportOptions(options?: FsOptions): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export let hasRegisteredS3FileSystem = false;
|
|
2
|
+
export function enableS3TransportBudget() {
|
|
3
|
+
hasRegisteredS3FileSystem = true;
|
|
4
|
+
}
|
|
5
|
+
const budgetKey = Symbol("scoped-transport-budget");
|
|
6
|
+
export function scopeTransportOptions(options, admit, credit) {
|
|
7
|
+
const parent = options[budgetKey] ?? [];
|
|
8
|
+
return { ...options, [budgetKey]: [...parent, { credit, admit }] };
|
|
9
|
+
}
|
|
10
|
+
export function chargeTransportOptions(options) {
|
|
11
|
+
for (const frame of options?.[budgetKey] ?? []) {
|
|
12
|
+
if (frame.credit > 0)
|
|
13
|
+
frame.credit--;
|
|
14
|
+
else
|
|
15
|
+
frame.admit(options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PythonMountOptions {
|
|
2
|
+
request: (operation: string, ...args: any[]) => any;
|
|
3
|
+
cwd: string;
|
|
4
|
+
runtimeMount: string;
|
|
5
|
+
maxTransferBytes: number;
|
|
6
|
+
errno: Record<string, number>;
|
|
7
|
+
synchronizationFlags: number;
|
|
8
|
+
runtimeModule: any;
|
|
9
|
+
getUmask?: () => number;
|
|
10
|
+
}
|
|
11
|
+
export declare function mountPythonFileSystem(FS: any, options: PythonMountOptions): void;
|
|
12
|
+
/** Encode the pinned wasm32 musl stat layout without truncating canonical values. */
|
|
13
|
+
export declare function writePythonStat(heap: Uint8Array, pointer: number, stat: Record<string, any>): number;
|
|
14
|
+
/** Runtime storage and application storage occupy disjoint guest device ranges. */
|
|
15
|
+
export declare function createPythonRuntimeStatMapper(maxDevices?: number): (stat: Record<string | symbol, any>) => Record<string | symbol, any>;
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { translatePythonOpenFlags } from './flags.js';
|
|
2
|
+
export function mountPythonFileSystem(FS, options) {
|
|
3
|
+
const { request: rpc, cwd, runtimeMount, maxTransferBytes, errno, synchronizationFlags } = options;
|
|
4
|
+
const canonicalStat = Symbol('canonical Python stat');
|
|
5
|
+
const runtimeDevices = createPythonRuntimeStatMapper();
|
|
6
|
+
const mapRuntimeStat = (stat) => {
|
|
7
|
+
try {
|
|
8
|
+
return runtimeDevices(stat);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
throw new FS.ErrnoError(errno.EOVERFLOW);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const originalWriteStat = options.runtimeModule.SYSCALLS.writeStat;
|
|
15
|
+
options.runtimeModule.SYSCALLS.writeStat = (pointer, stat) => {
|
|
16
|
+
if (!stat[canonicalStat]) {
|
|
17
|
+
try {
|
|
18
|
+
return originalWriteStat(pointer, mapRuntimeStat(stat));
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new FS.ErrnoError(errno.EOVERFLOW);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return writePythonStat(options.runtimeModule.HEAPU8, pointer, stat);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
throw new FS.ErrnoError(errno.EOVERFLOW);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
function path(node) { return node.parent === node ? "/" : `${path(node.parent) === '/' ? '' : path(node.parent)}/${node.name}`; }
|
|
32
|
+
function attr(stat) {
|
|
33
|
+
return { [canonicalStat]: true, dev: stat.dev, ino: stat.ino, mode: stat.mode | (stat.type === 'directory' ? 16384 : stat.type === 'symlink' ? 40960 : stat.type === 'character' ? 8192 : 32768), nlink: stat.nlink, uid: stat.uid, gid: stat.gid, rdev: stat.type === 'character' ? undefined : 0, size: stat.size, atime: new Date(stat.atimeMs), mtime: new Date(stat.mtimeMs), ctime: new Date(stat.ctimeMs), atimeMs: stat.atimeMs, mtimeMs: stat.mtimeMs, ctimeMs: stat.ctimeMs, blksize: stat.ioBlockSize ?? stat.preferredIoBlockSize, blocks: stat.allocatedBytes === undefined ? undefined : Math.ceil(stat.allocatedBytes / 512) };
|
|
34
|
+
}
|
|
35
|
+
function node(parent, name, stat) {
|
|
36
|
+
const value = FS.createNode(parent, name, attr(stat).mode, 0);
|
|
37
|
+
value.node_ops = nodeOps;
|
|
38
|
+
value.stream_ops = streamOps;
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
let bootstrapMountNode;
|
|
42
|
+
const nodeOps = {
|
|
43
|
+
getattr: (n) => attr(n === bootstrapMountNode ? { type: 'directory', mode: 365, size: 0, atimeMs: 0, mtimeMs: 0, ctimeMs: 0 } : rpc('lstat', path(n))),
|
|
44
|
+
setattr(n, attributes) {
|
|
45
|
+
if (attributes.size !== undefined)
|
|
46
|
+
rpc('truncate', path(n), attributes.size);
|
|
47
|
+
if (attributes.mode !== undefined)
|
|
48
|
+
rpc('chmod', path(n), attributes.mode & 4095);
|
|
49
|
+
if (attributes.atime !== undefined || attributes.mtime !== undefined) {
|
|
50
|
+
const previous = attributes.atime === undefined || attributes.mtime === undefined ? rpc('stat', path(n)) : undefined;
|
|
51
|
+
rpc('utimes', path(n), attributes.atime ?? previous.atimeMs, attributes.mtime ?? previous.mtimeMs);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
lookup(parent, name) {
|
|
55
|
+
if (parent.parent === parent && name === runtimeMount.slice(1))
|
|
56
|
+
return bootstrapMountNode ??= node(parent, name, { type: 'directory', mode: 365, size: 0, atimeMs: 0, mtimeMs: 0, ctimeMs: 0 });
|
|
57
|
+
return node(parent, name, rpc('lstat', `${path(parent)}/${name}`));
|
|
58
|
+
},
|
|
59
|
+
mknod(parent, name, mode) {
|
|
60
|
+
const target = `${path(parent)}/${name}`;
|
|
61
|
+
if (FS.isDir(mode))
|
|
62
|
+
rpc('mkdir', target, { mode: mode & 4095 & ~(options.getUmask?.() ?? 0), exactMode: true });
|
|
63
|
+
else {
|
|
64
|
+
const handle = rpc('open', target, { access: 'write', creation: 'exclusive', mode: mode & 4095 & ~(options.getUmask?.() ?? 0), exactMode: true });
|
|
65
|
+
rpc('close', handle);
|
|
66
|
+
}
|
|
67
|
+
return node(parent, name, rpc('lstat', target));
|
|
68
|
+
},
|
|
69
|
+
rename(n, parent, name) { rpc('rename', path(n), `${path(parent)}/${name}`); n.name = name; n.parent = parent; },
|
|
70
|
+
unlink: (parent, name) => rpc('rm', `${path(parent)}/${name}`),
|
|
71
|
+
rmdir: (parent, name) => rpc('rmdir', `${path(parent)}/${name}`),
|
|
72
|
+
readdir: (n) => ['.', '..', ...rpc('readdir', path(n)).map((entry) => entry.name)],
|
|
73
|
+
readlink: (n) => rpc('readlink', path(n)),
|
|
74
|
+
symlink(parent, name, target) { rpc('symlink', target, `${path(parent)}/${name}`); return node(parent, name, rpc('lstat', `${path(parent)}/${name}`)); },
|
|
75
|
+
};
|
|
76
|
+
const streamOps = {
|
|
77
|
+
getattr: (stream) => attr(stream.handle ? rpc('fstat', stream.handle) : rpc('stat', path(stream.node))),
|
|
78
|
+
setattr(stream, attributes) {
|
|
79
|
+
if (Object.keys(attributes).some(key => key !== 'size' && key !== 'ctime' && !(key === 'timestamp' && attributes.size !== undefined)))
|
|
80
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
81
|
+
if (attributes.size !== undefined)
|
|
82
|
+
rpc('ftruncate', stream.handle, attributes.size);
|
|
83
|
+
},
|
|
84
|
+
open(stream) {
|
|
85
|
+
if (FS.isDir(stream.node.mode))
|
|
86
|
+
return;
|
|
87
|
+
stream.retained = { references: 1 };
|
|
88
|
+
stream.handle = rpc('open', path(stream.node), { access: (stream.flags & 3) === 0 ? 'read' : (stream.flags & 3) === 1 ? 'write' : 'readwrite', creation: 'never', append: Boolean(stream.flags & 1024) });
|
|
89
|
+
},
|
|
90
|
+
dup: (stream) => { if (stream.retained)
|
|
91
|
+
stream.retained.references++; },
|
|
92
|
+
close: (stream) => { if (stream.handle && --stream.retained.references === 0)
|
|
93
|
+
rpc('close', stream.handle); },
|
|
94
|
+
fsync: (stream) => { rpc('sync', stream.handle, false); return 0; },
|
|
95
|
+
read(stream, buffer, offset, length, position) { const data = rpc('read', stream.handle, Math.min(length, maxTransferBytes), stream.seekable ? position : null); buffer.set(data, offset); return data.length; },
|
|
96
|
+
write: (stream, buffer, offset, length, position) => rpc('write', stream.handle, Uint8Array.from(buffer.subarray(offset, offset + Math.min(length, maxTransferBytes))), stream.pythonExplicitPosition ?? (stream.flags & 1024 || !stream.seekable ? null : position)),
|
|
97
|
+
llseek(stream, offset, whence) { if (![0, 1, 2].includes(whence) || !Number.isSafeInteger(offset))
|
|
98
|
+
throw new FS.ErrnoError(errno.EINVAL); const position = whence === 0 ? offset : whence === 1 ? stream.position + offset : rpc('fstat', stream.handle).size + offset; if (!Number.isSafeInteger(position) || position < 0)
|
|
99
|
+
throw new FS.ErrnoError(28); return position; },
|
|
100
|
+
};
|
|
101
|
+
const originalLookupNode = FS.lookupNode.bind(FS);
|
|
102
|
+
FS.lookupNode = (parent, name) => {
|
|
103
|
+
const cached = originalLookupNode(parent, name);
|
|
104
|
+
return parent.node_ops === nodeOps && !cached.mounted ? nodeOps.lookup(parent, name) : cached;
|
|
105
|
+
};
|
|
106
|
+
const bootstrapRoot = FS.root;
|
|
107
|
+
FS.root = null;
|
|
108
|
+
FS.mount({ mount: () => node(null, '/', rpc('stat', '/')) }, {}, '/');
|
|
109
|
+
FS.mount({ mount: () => bootstrapRoot }, {}, runtimeMount);
|
|
110
|
+
FS.chdir(rpc('realpath', cwd));
|
|
111
|
+
// Intercept before Emscripten decomposes atomic exclusive/truncating open.
|
|
112
|
+
const originalOpen = FS.open.bind(FS);
|
|
113
|
+
FS.open = function (inputPath, flags, mode = 438) {
|
|
114
|
+
if (typeof flags === 'string') {
|
|
115
|
+
const modes = { r: 0, 'r+': 2, w: 577, 'w+': 578, a: 1089, 'a+': 1090 };
|
|
116
|
+
const numeric = modes[flags];
|
|
117
|
+
if (numeric === undefined)
|
|
118
|
+
throw new FS.ErrnoError(errno.EINVAL);
|
|
119
|
+
flags = numeric;
|
|
120
|
+
}
|
|
121
|
+
if (typeof inputPath !== 'string') {
|
|
122
|
+
if ((flags & 3) !== 0 || (flags & (64 | 512)))
|
|
123
|
+
throw new FS.ErrnoError(errno.EROFS);
|
|
124
|
+
return originalOpen(inputPath, flags, mode);
|
|
125
|
+
}
|
|
126
|
+
if (inputPath.length === 0)
|
|
127
|
+
throw new FS.ErrnoError(errno.ENOENT);
|
|
128
|
+
const absolute = inputPath.startsWith('/') ? inputPath : `${FS.cwd()}/${inputPath}`;
|
|
129
|
+
if (absolute === runtimeMount || absolute.startsWith(runtimeMount + '/')) {
|
|
130
|
+
if (absolute.split('/').includes('..'))
|
|
131
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
132
|
+
if (typeof flags !== 'number' || (flags & 3) !== 0 || (flags & (64 | 512)))
|
|
133
|
+
throw new FS.ErrnoError(errno.EROFS);
|
|
134
|
+
return originalOpen(inputPath, flags, mode);
|
|
135
|
+
}
|
|
136
|
+
if (typeof flags !== 'number')
|
|
137
|
+
return originalOpen(inputPath, flags, mode);
|
|
138
|
+
if (flags & synchronizationFlags)
|
|
139
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
140
|
+
// Atomic exclusive creation already refuses symlinks and all existing entries.
|
|
141
|
+
const exclusive = (flags & 192) === 192;
|
|
142
|
+
if ((flags & 131072) && !exclusive)
|
|
143
|
+
throw new FS.ErrnoError(138);
|
|
144
|
+
if (flags & 65536)
|
|
145
|
+
throw new FS.ErrnoError(54);
|
|
146
|
+
let openOptions;
|
|
147
|
+
try {
|
|
148
|
+
openOptions = { ...translatePythonOpenFlags(flags, mode & ~(options.getUmask?.() ?? 0)), exactMode: true };
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
throw new FS.ErrnoError(errno[error.code] ?? errno.EIO);
|
|
152
|
+
}
|
|
153
|
+
const handle = rpc('open', absolute, openOptions);
|
|
154
|
+
try {
|
|
155
|
+
// Bind the stream to the acquired identity, without re-opening its pathname.
|
|
156
|
+
// A concurrent rename or unlink after acquisition must not invalidate open().
|
|
157
|
+
const capabilities = rpc('descriptorCapabilities', handle);
|
|
158
|
+
if ((flags & 1024) && !capabilities.position)
|
|
159
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
160
|
+
const seekable = ((flags & 3) === 1 || capabilities.positionedRead) && ((flags & 3) === 0 || ((flags & 1024) ? capabilities.position : capabilities.positionedWrite));
|
|
161
|
+
const retainedStat = rpc('fstat', handle);
|
|
162
|
+
if (retainedStat.type === 'directory')
|
|
163
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
164
|
+
const retainedNode = node(FS.root, absolute.slice(1), retainedStat);
|
|
165
|
+
return FS.createStream({ node: retainedNode, path: absolute, flags: flags & ~(128 | 512), seekable, position: 0, stream_ops: streamOps, ungotten: [], error: false, handle, pythonCapabilities: capabilities, retained: { references: 1 } });
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
rpc('close', handle);
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
// Pass application operands intact to the authoritative resolver. Emscripten's
|
|
173
|
+
// lexical dot-segment normalization must not run before canonical symlink traversal.
|
|
174
|
+
const absolutePath = (target) => target.length === 0 || target.startsWith('/') ? target : `${FS.cwd()}/${target}`;
|
|
175
|
+
const bootstrapPath = (target) => {
|
|
176
|
+
const absolute = absolutePath(target);
|
|
177
|
+
const bootstrap = absolute === runtimeMount || absolute.startsWith(runtimeMount + '/');
|
|
178
|
+
if (bootstrap && absolute.split('/').includes('..'))
|
|
179
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
180
|
+
return bootstrap;
|
|
181
|
+
};
|
|
182
|
+
for (const operation of ['stat', 'lstat']) {
|
|
183
|
+
const original = FS[operation].bind(FS);
|
|
184
|
+
FS[operation] = (target, ...args) => bootstrapPath(target)
|
|
185
|
+
? mapRuntimeStat(original(target, ...args)) : attr(rpc(operation, absolutePath(target)));
|
|
186
|
+
}
|
|
187
|
+
const originalFstat = FS.fstat.bind(FS);
|
|
188
|
+
FS.fstat = (fd) => {
|
|
189
|
+
const value = originalFstat(fd);
|
|
190
|
+
return value[canonicalStat] ? value : mapRuntimeStat(value);
|
|
191
|
+
};
|
|
192
|
+
for (const [operation, canonical] of [['unlink', 'rm'], ['rmdir', 'rmdir'], ['chmod', 'chmod'], ['truncate', 'truncate'], ['utime', 'utimes']]) {
|
|
193
|
+
const original = FS[operation].bind(FS);
|
|
194
|
+
FS[operation] = (target, ...args) => bootstrapPath(target)
|
|
195
|
+
? original(target, ...args) : rpc(canonical, absolutePath(target), ...args);
|
|
196
|
+
}
|
|
197
|
+
const originalMkdir = FS.mkdir.bind(FS);
|
|
198
|
+
FS.mkdir = (target, mode = 0o777) => {
|
|
199
|
+
if (bootstrapPath(target))
|
|
200
|
+
return originalMkdir(target, mode);
|
|
201
|
+
const absolute = absolutePath(target);
|
|
202
|
+
rpc('mkdir', absolute, { mode: mode & ~(options.getUmask?.() ?? 0), exactMode: true });
|
|
203
|
+
return node(FS.root, absolute.slice(1), rpc('lstat', absolute));
|
|
204
|
+
};
|
|
205
|
+
const originalRename = FS.rename.bind(FS);
|
|
206
|
+
FS.rename = (source, destination) => bootstrapPath(source) || bootstrapPath(destination)
|
|
207
|
+
? originalRename(source, destination) : rpc('rename', absolutePath(source), absolutePath(destination));
|
|
208
|
+
const originalChdir = FS.chdir.bind(FS);
|
|
209
|
+
FS.chdir = (target) => bootstrapPath(target) ? originalChdir(target) : originalChdir(rpc('realpath', absolutePath(target)));
|
|
210
|
+
const runtimeNode = (node) => {
|
|
211
|
+
const seen = new Set();
|
|
212
|
+
while (node && !seen.has(node)) {
|
|
213
|
+
if (node === bootstrapRoot || node.mount?.mountpoint === runtimeMount)
|
|
214
|
+
return true;
|
|
215
|
+
seen.add(node);
|
|
216
|
+
node = node.parent;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
};
|
|
220
|
+
const assertWritablePath = (target) => {
|
|
221
|
+
if (bootstrapPath(target))
|
|
222
|
+
throw new FS.ErrnoError(errno.EROFS);
|
|
223
|
+
};
|
|
224
|
+
const originalSymlink = FS.symlink.bind(FS);
|
|
225
|
+
FS.symlink = (source, destination) => bootstrapPath(destination)
|
|
226
|
+
? originalSymlink(source, destination) : rpc('symlink', source, absolutePath(destination));
|
|
227
|
+
const originalReaddir = FS.readdir.bind(FS);
|
|
228
|
+
FS.readdir = (target) => bootstrapPath(target) ? originalReaddir(target)
|
|
229
|
+
: ['.', '..', ...rpc('readdir', absolutePath(target)).map((entry) => entry.name)];
|
|
230
|
+
const originalReadlink = FS.readlink.bind(FS);
|
|
231
|
+
FS.readlink = (target) => bootstrapPath(target) ? originalReadlink(target) : rpc('readlink', absolutePath(target));
|
|
232
|
+
for (const operation of ['chown', 'lchown', 'lchmod']) {
|
|
233
|
+
FS[operation] = (target) => { assertWritablePath(target); throw new FS.ErrnoError(errno.ENOTSUP); };
|
|
234
|
+
}
|
|
235
|
+
const originalMknod = FS.mknod.bind(FS);
|
|
236
|
+
FS.mknod = (target, mode, device) => {
|
|
237
|
+
if (bootstrapPath(target))
|
|
238
|
+
return originalMknod(target, mode, device);
|
|
239
|
+
if (!FS.isFile(mode))
|
|
240
|
+
throw new FS.ErrnoError(errno.ENOTSUP);
|
|
241
|
+
const handle = rpc('open', absolutePath(target), { access: 'write', creation: 'exclusive', mode: mode & 4095 & ~(options.getUmask?.() ?? 0), exactMode: true });
|
|
242
|
+
rpc('close', handle);
|
|
243
|
+
return node(FS.root, absolutePath(target).slice(1), rpc('lstat', absolutePath(target)));
|
|
244
|
+
};
|
|
245
|
+
for (const operation of ['mkdir', 'mknod', 'unlink', 'rmdir', 'chmod', 'lchmod', 'chown', 'lchown', 'truncate', 'utime']) {
|
|
246
|
+
if (typeof FS[operation] !== 'function')
|
|
247
|
+
continue;
|
|
248
|
+
const original = FS[operation].bind(FS);
|
|
249
|
+
FS[operation] = (target, ...args) => { assertWritablePath(target); return original(target, ...args); };
|
|
250
|
+
}
|
|
251
|
+
for (const operation of ['rename', 'symlink']) {
|
|
252
|
+
const original = FS[operation].bind(FS);
|
|
253
|
+
FS[operation] = (source, destination, ...args) => {
|
|
254
|
+
if (operation === 'rename')
|
|
255
|
+
assertWritablePath(source);
|
|
256
|
+
assertWritablePath(destination);
|
|
257
|
+
return original(source, destination, ...args);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
for (const operation of ['fchmod', 'fchown', 'ftruncate']) {
|
|
261
|
+
if (typeof FS[operation] !== 'function')
|
|
262
|
+
continue;
|
|
263
|
+
const original = FS[operation].bind(FS);
|
|
264
|
+
FS[operation] = (fd, ...args) => {
|
|
265
|
+
if (runtimeNode(FS.getStreamChecked(fd).node))
|
|
266
|
+
throw new FS.ErrnoError(errno.EROFS);
|
|
267
|
+
return original(fd, ...args);
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const originalWrite = FS.write.bind(FS);
|
|
271
|
+
FS.write = (stream, ...args) => {
|
|
272
|
+
if (stream.fd > 2 && runtimeNode(stream.node))
|
|
273
|
+
throw new FS.ErrnoError(errno.EROFS);
|
|
274
|
+
const explicit = typeof args[3] === 'number';
|
|
275
|
+
if (stream.handle && (stream.flags & 1024) && explicit && !stream.pythonCapabilities.positionedAppendWrite)
|
|
276
|
+
throw new FS.ErrnoError(errno.EINVAL);
|
|
277
|
+
const previousPosition = stream.position;
|
|
278
|
+
stream.pythonExplicitPosition = explicit ? args[3] : undefined;
|
|
279
|
+
let written;
|
|
280
|
+
try {
|
|
281
|
+
written = originalWrite(stream, ...args);
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
stream.pythonExplicitPosition = undefined;
|
|
285
|
+
if (explicit)
|
|
286
|
+
stream.position = previousPosition;
|
|
287
|
+
}
|
|
288
|
+
if (stream.handle && (stream.flags & 1024) && args[3] === undefined)
|
|
289
|
+
stream.position = rpc('position', stream.handle);
|
|
290
|
+
return written;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/** Encode the pinned wasm32 musl stat layout without truncating canonical values. */
|
|
294
|
+
export function writePythonStat(heap, pointer, stat) {
|
|
295
|
+
const view = new DataView(heap.buffer, heap.byteOffset, heap.byteLength);
|
|
296
|
+
const integer = (key, max) => {
|
|
297
|
+
const value = stat[key];
|
|
298
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > max)
|
|
299
|
+
throw new Error('EOVERFLOW');
|
|
300
|
+
return value;
|
|
301
|
+
};
|
|
302
|
+
const values = {
|
|
303
|
+
dev: integer('dev', 0xffffffff), mode: integer('mode', 0xffffffff),
|
|
304
|
+
nlink: integer('nlink', 0xffffffff), uid: integer('uid', 0xffffffff),
|
|
305
|
+
gid: integer('gid', 0xffffffff), rdev: integer('rdev', 0xffffffff),
|
|
306
|
+
size: integer('size', Number.MAX_SAFE_INTEGER), ino: integer('ino', Number.MAX_SAFE_INTEGER),
|
|
307
|
+
blksize: integer('blksize', 0x7fffffff), blocks: integer('blocks', 0x7fffffff),
|
|
308
|
+
};
|
|
309
|
+
const times = ['atime', 'mtime', 'ctime'].map(key => {
|
|
310
|
+
const time = stat[key + 'Ms'] ?? stat[key]?.getTime();
|
|
311
|
+
if (!Number.isFinite(time))
|
|
312
|
+
throw new Error('EOVERFLOW');
|
|
313
|
+
let seconds = Math.floor(time / 1000);
|
|
314
|
+
let nanoseconds = Math.round((time - seconds * 1000) * 1000000);
|
|
315
|
+
if (nanoseconds === 1000000000) {
|
|
316
|
+
seconds++;
|
|
317
|
+
nanoseconds = 0;
|
|
318
|
+
}
|
|
319
|
+
if (!Number.isSafeInteger(seconds) || nanoseconds < 0 || nanoseconds >= 1000000000)
|
|
320
|
+
throw new Error('EOVERFLOW');
|
|
321
|
+
return { seconds, nanoseconds };
|
|
322
|
+
});
|
|
323
|
+
if (!Number.isSafeInteger(pointer) || pointer < 0 || pointer + 96 > heap.byteLength)
|
|
324
|
+
throw new Error('EOVERFLOW');
|
|
325
|
+
for (const [index, key] of ['dev', 'mode', 'nlink', 'uid', 'gid', 'rdev'].entries())
|
|
326
|
+
view.setUint32(pointer + index * 4, values[key], true);
|
|
327
|
+
view.setBigInt64(pointer + 24, BigInt(values.size), true);
|
|
328
|
+
view.setInt32(pointer + 32, values.blksize, true);
|
|
329
|
+
view.setInt32(pointer + 36, values.blocks, true);
|
|
330
|
+
times.forEach((time, index) => { view.setBigInt64(pointer + 40 + index * 16, BigInt(time.seconds), true); view.setUint32(pointer + 48 + index * 16, time.nanoseconds, true); });
|
|
331
|
+
view.setBigInt64(pointer + 88, BigInt(values.ino), true);
|
|
332
|
+
return 0;
|
|
333
|
+
}
|
|
334
|
+
/** Runtime storage and application storage occupy disjoint guest device ranges. */
|
|
335
|
+
export function createPythonRuntimeStatMapper(maxDevices = Infinity) {
|
|
336
|
+
if (maxDevices !== Infinity && (!Number.isSafeInteger(maxDevices) || maxDevices < 1))
|
|
337
|
+
throw new RangeError('Invalid runtime device limit');
|
|
338
|
+
const mapped = Symbol('mapped Python runtime device');
|
|
339
|
+
const devices = new Map();
|
|
340
|
+
return stat => {
|
|
341
|
+
if (stat[mapped])
|
|
342
|
+
return stat;
|
|
343
|
+
if (!Number.isSafeInteger(stat.dev) || stat.dev < 0 || stat.dev > 0xffffffff)
|
|
344
|
+
throw new Error('EOVERFLOW');
|
|
345
|
+
let device = devices.get(stat.dev);
|
|
346
|
+
if (device === undefined) {
|
|
347
|
+
if (devices.size >= maxDevices)
|
|
348
|
+
throw new Error('EOVERFLOW');
|
|
349
|
+
// Preserve the uint32 guest ABI even when the resource budget is unlimited.
|
|
350
|
+
if (devices.size >= 0x80000000)
|
|
351
|
+
throw new Error('EOVERFLOW');
|
|
352
|
+
device = 0x80000000 + devices.size;
|
|
353
|
+
devices.set(stat.dev, device);
|
|
354
|
+
}
|
|
355
|
+
return { ...stat, dev: device, [mapped]: true };
|
|
356
|
+
};
|
|
357
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { FileDescriptor, FileSystem, OpenFileOptions, MkdirOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export type PythonFsRequest = {
|
|
3
|
+
readonly op: "open";
|
|
4
|
+
readonly args: readonly [string, OpenFileOptions];
|
|
5
|
+
} | {
|
|
6
|
+
readonly op: "read";
|
|
7
|
+
readonly args: readonly [number, number, number | null];
|
|
8
|
+
} | {
|
|
9
|
+
readonly op: "write";
|
|
10
|
+
readonly args: readonly [number, Uint8Array, number | null];
|
|
11
|
+
} | {
|
|
12
|
+
readonly op: "fstat" | "close" | "position" | "descriptorCapabilities";
|
|
13
|
+
readonly args: readonly [number];
|
|
14
|
+
} | {
|
|
15
|
+
readonly op: "ftruncate";
|
|
16
|
+
readonly args: readonly [number, number];
|
|
17
|
+
} | {
|
|
18
|
+
readonly op: "sync";
|
|
19
|
+
readonly args: readonly [number, boolean];
|
|
20
|
+
} | {
|
|
21
|
+
readonly op: "stat" | "lstat" | "readdir" | "realpath" | "readlink" | "rm" | "rmdir" | "rmtree" | "rmtreeSupported";
|
|
22
|
+
readonly args: readonly [string];
|
|
23
|
+
} | {
|
|
24
|
+
readonly op: "rename" | "symlink" | "link";
|
|
25
|
+
readonly args: readonly [string, string];
|
|
26
|
+
} | {
|
|
27
|
+
readonly op: "mkdir";
|
|
28
|
+
readonly args: readonly [string, MkdirOptions?];
|
|
29
|
+
} | {
|
|
30
|
+
readonly op: "chmod" | "truncate" | "access";
|
|
31
|
+
readonly args: readonly [string, number];
|
|
32
|
+
} | {
|
|
33
|
+
readonly op: "utimes";
|
|
34
|
+
readonly args: readonly [string, number, number];
|
|
35
|
+
};
|
|
36
|
+
export interface PythonFileSystemOptions {
|
|
37
|
+
readonly cwd: string;
|
|
38
|
+
readonly signal?: AbortSignal;
|
|
39
|
+
readonly maxTransferBytes?: number;
|
|
40
|
+
readonly maxOpenFiles?: number;
|
|
41
|
+
readonly maxDirectoryEntries?: number;
|
|
42
|
+
/** Caller-owned acquisition wrapper, e.g. shell descriptor quota enrollment. */
|
|
43
|
+
readonly open?: (path: string, options: OpenFileOptions) => Promise<FileDescriptor>;
|
|
44
|
+
}
|
|
45
|
+
/** Async half of a worker RPC filesystem. Never run this on an Atomics.wait-blocked interpreter thread. */
|
|
46
|
+
export declare class PythonFileSystem {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(fs: FileSystem, options: PythonFileSystemOptions);
|
|
49
|
+
dispatch(value: unknown): Promise<unknown>;
|
|
50
|
+
close(): Promise<void>;
|
|
51
|
+
}
|