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
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path from "node:path";
|
|
1
|
+
import { path } from "../paths.js";
|
|
3
2
|
const LOCK_WAIT_MS = 30_000;
|
|
4
3
|
const LOCK_RETRY_MS = 10;
|
|
5
4
|
export function compareCreated(left, right) {
|
|
@@ -86,9 +85,8 @@ export async function statIfExists(fs, filePath) {
|
|
|
86
85
|
}
|
|
87
86
|
export async function rejectSymbolicLinkComponents(fs, filePath) {
|
|
88
87
|
const resolvedPath = path.resolve(filePath);
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
let currentPath = rootPath;
|
|
88
|
+
const components = resolvedPath.slice(1).split("/").filter(Boolean);
|
|
89
|
+
let currentPath = "/";
|
|
92
90
|
for (const component of components) {
|
|
93
91
|
currentPath = path.join(currentPath, component);
|
|
94
92
|
try {
|
|
@@ -108,7 +106,7 @@ export async function rejectSymbolicLinkComponents(fs, filePath) {
|
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
108
|
export async function writeAtomically(fs, filePath, content) {
|
|
111
|
-
const tempPath = `${filePath}.${
|
|
109
|
+
const tempPath = `${filePath}.${crypto.randomUUID()}.tmp`;
|
|
112
110
|
let tempCreated = false;
|
|
113
111
|
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
114
112
|
try {
|
|
@@ -134,7 +132,7 @@ export async function writeAtomically(fs, filePath, content) {
|
|
|
134
132
|
export async function withFileLock(fs, lockPath, operation) {
|
|
135
133
|
await rejectSymbolicLinkComponents(fs, lockPath);
|
|
136
134
|
await fs.mkdir(path.dirname(lockPath), { recursive: true });
|
|
137
|
-
const ownerPath = path.join(lockPath,
|
|
135
|
+
const ownerPath = path.join(lockPath, crypto.randomUUID());
|
|
138
136
|
const deadline = Date.now() + LOCK_WAIT_MS;
|
|
139
137
|
for (;;) {
|
|
140
138
|
await rejectSymbolicLinkComponents(fs, lockPath);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function createDefaultFileSystem() {
|
|
2
|
+
throw new Error("Task lists require an injected filesystem in this runtime.");
|
|
3
|
+
}
|
|
4
|
+
export function createDefaultRunner() {
|
|
5
|
+
throw new Error("GitHub authentication requires an explicit token or injected runner in this runtime.");
|
|
6
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createDefaultFileSystem } from "#task-list-host";
|
|
2
|
+
export function taskListFileSystem(fs = createDefaultFileSystem()) {
|
|
3
|
+
if (!("capabilities" in fs))
|
|
4
|
+
return fs;
|
|
5
|
+
return {
|
|
6
|
+
async lstat(path) { const stat = await fs.lstat(path); return { isSymbolicLink: () => stat.type === "symlink" }; },
|
|
7
|
+
mkdir: (path, options) => fs.mkdir(path, options),
|
|
8
|
+
async readFile(path) { return new TextDecoder("utf-8", { ignoreBOM: true }).decode(await fs.readFile(path)); },
|
|
9
|
+
async readdir(path) { return (await fs.readdir(path)).map(entry => entry.name); },
|
|
10
|
+
rename: (from, to) => fs.rename(from, to),
|
|
11
|
+
async rmdir(path) {
|
|
12
|
+
if (!fs.rmdir)
|
|
13
|
+
throw new Error("Task lists require filesystem rmdir support.");
|
|
14
|
+
await fs.rmdir(path);
|
|
15
|
+
},
|
|
16
|
+
async stat(path) {
|
|
17
|
+
const stat = await fs.stat(path);
|
|
18
|
+
return { isDirectory: () => stat.type === "directory", isFile: () => stat.type === "file", mtimeMs: stat.mtimeMs };
|
|
19
|
+
},
|
|
20
|
+
async unlink(path) {
|
|
21
|
+
if (!fs.unlink)
|
|
22
|
+
throw new Error("Task lists require filesystem unlink support.");
|
|
23
|
+
await fs.unlink(path);
|
|
24
|
+
},
|
|
25
|
+
async writeFile(path, data, options) {
|
|
26
|
+
const flag = typeof options === "object" ? options.flag : undefined;
|
|
27
|
+
if (flag !== undefined && flag !== "w" && flag !== "wx" && flag !== "a" && flag !== "ax")
|
|
28
|
+
throw new Error("Unsupported task-list write flag.");
|
|
29
|
+
await fs.writeFile(path, typeof data === "string" ? new TextEncoder().encode(data) : data, { flag });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import path from "
|
|
1
|
+
import { taskListFileSystem } from "./filesystem.js";
|
|
2
|
+
import { path } from "./paths.js";
|
|
3
3
|
import { findEvent } from "./state-machine.js";
|
|
4
4
|
import { openTaskList } from "./open.js";
|
|
5
5
|
export async function moveTasks(options) {
|
|
@@ -127,7 +127,7 @@ function readOnlyTargetOptions(options, dryRun) {
|
|
|
127
127
|
return {
|
|
128
128
|
...options,
|
|
129
129
|
create: true,
|
|
130
|
-
fs: createDryRunFs(options.fs
|
|
130
|
+
fs: createDryRunFs(taskListFileSystem(options.fs), options.path, options.type)
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
function createDryRunFs(fs, targetPath, targetType) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { taskListFileSystem } from "./filesystem.js";
|
|
2
2
|
import { ghIssuesBackend } from "./backends/gh-issues.js";
|
|
3
3
|
import { resolveAuth, resolveEndpoint } from "./backends/gh-issues-client.js";
|
|
4
4
|
import { markdownDirBackend } from "./backends/markdown-dir.js";
|
|
@@ -9,9 +9,6 @@ export const backendFactories = {
|
|
|
9
9
|
"markdown-dir": markdownDirBackend,
|
|
10
10
|
"yaml-file": yamlFileBackend
|
|
11
11
|
};
|
|
12
|
-
function createDefaultFs() {
|
|
13
|
-
return fsPromises;
|
|
14
|
-
}
|
|
15
12
|
export async function openTaskList(options) {
|
|
16
13
|
const type = getOwnProperty(options, "type");
|
|
17
14
|
switch (type) {
|
|
@@ -43,7 +40,7 @@ async function openFileBackend(options) {
|
|
|
43
40
|
? "strict"
|
|
44
41
|
: (getOwnProperty(markdownOptions, "frontmatterMode") ?? "strict"),
|
|
45
42
|
create: getOwnProperty(options, "create") ?? false,
|
|
46
|
-
fs: getOwnProperty(options, "fs")
|
|
43
|
+
fs: taskListFileSystem(getOwnProperty(options, "fs")),
|
|
47
44
|
stateMachine
|
|
48
45
|
};
|
|
49
46
|
return factory(deps);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const path: {
|
|
2
|
+
resolve(...parts: string[]): string;
|
|
3
|
+
basename: typeof import("@poe-code/safe-fs/contracts").basename;
|
|
4
|
+
dirname: typeof import("packages/safe-fs/dist/contracts/virtual-path.js").dirname;
|
|
5
|
+
extname: typeof import("@poe-code/safe-fs/contracts").extname;
|
|
6
|
+
join: typeof import("@poe-code/safe-fs/contracts").joinPath;
|
|
7
|
+
isAbsolute: typeof import("@poe-code/safe-fs/contracts").isAbsolutePath;
|
|
8
|
+
normalize: typeof import("@poe-code/safe-fs/contracts").joinPath;
|
|
9
|
+
relative: (from: string, to: string) => string;
|
|
10
|
+
sep: "/";
|
|
11
|
+
delimiter: ":";
|
|
12
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FileSystem } from "@poe-code/safe-fs/contracts";
|
|
1
2
|
import type { StateMachineDef } from "./state-machine.js";
|
|
2
3
|
export type TaskState = "draft" | "planned" | "in-progress" | "done" | "archived";
|
|
3
4
|
export interface Task {
|
|
@@ -70,7 +71,7 @@ export interface TaskListFs {
|
|
|
70
71
|
mkdir(path: string, options?: {
|
|
71
72
|
recursive?: boolean;
|
|
72
73
|
}): Promise<void>;
|
|
73
|
-
readFile(path: string, encoding:
|
|
74
|
+
readFile(path: string, encoding: "utf8"): Promise<string>;
|
|
74
75
|
readdir(path: string): Promise<string[]>;
|
|
75
76
|
rename(fromPath: string, toPath: string): Promise<void>;
|
|
76
77
|
rmdir(path: string): Promise<void>;
|
|
@@ -80,8 +81,8 @@ export interface TaskListFs {
|
|
|
80
81
|
mtimeMs: number;
|
|
81
82
|
}>;
|
|
82
83
|
unlink(path: string): Promise<void>;
|
|
83
|
-
writeFile(path: string, data: string |
|
|
84
|
-
encoding?:
|
|
84
|
+
writeFile(path: string, data: string | Uint8Array, options?: "utf8" | {
|
|
85
|
+
encoding?: "utf8";
|
|
85
86
|
flag?: string;
|
|
86
87
|
}): Promise<void>;
|
|
87
88
|
}
|
|
@@ -132,7 +133,7 @@ export interface OpenMarkdownDirOptions {
|
|
|
132
133
|
create?: boolean;
|
|
133
134
|
singleList?: string;
|
|
134
135
|
frontmatterMode?: "strict" | "passthrough";
|
|
135
|
-
fs?: TaskListFs;
|
|
136
|
+
fs?: TaskListFs | FileSystem;
|
|
136
137
|
stateMachine?: StateMachineDef;
|
|
137
138
|
}
|
|
138
139
|
export interface OpenYamlFileOptions {
|
|
@@ -140,7 +141,7 @@ export interface OpenYamlFileOptions {
|
|
|
140
141
|
path: string;
|
|
141
142
|
defaults?: TaskDefaults;
|
|
142
143
|
create?: boolean;
|
|
143
|
-
fs?: TaskListFs;
|
|
144
|
+
fs?: TaskListFs | FileSystem;
|
|
144
145
|
stateMachine?: StateMachineDef;
|
|
145
146
|
}
|
|
146
147
|
export interface OpenGhIssuesOptions {
|
|
@@ -23,5 +23,14 @@
|
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git+https://github.com/poe-platform/poe-code.git",
|
|
25
25
|
"directory": "packages/task-list"
|
|
26
|
+
},
|
|
27
|
+
"imports": {
|
|
28
|
+
"#task-list-host": {
|
|
29
|
+
"types": "./src/default-host.ts",
|
|
30
|
+
"workerd": "./dist/default-host.workerd.js",
|
|
31
|
+
"browser": "./dist/default-host.workerd.js",
|
|
32
|
+
"worker": "./dist/default-host.workerd.js",
|
|
33
|
+
"default": "./dist/default-host.js"
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Poe Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Terminal text
|
|
2
|
+
|
|
3
|
+
Make untrusted text safe to display in terminal fields without dropping characters.
|
|
4
|
+
Works in browsers, Workers and Node.js with no runtime dependencies.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import { escapeTerminalText } from "@poe-code/terminal-text";
|
|
8
|
+
|
|
9
|
+
escapeTerminalText("Résumé 日本語"); // ordinary Unicode is unchanged
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Control characters and bidirectional formatting marks become visible Unicode escapes.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Makes untrusted text safe to embed in a human-readable terminal field. */
|
|
2
|
+
export function escapeTerminalText(text) {
|
|
3
|
+
let result = "";
|
|
4
|
+
for (const character of text) {
|
|
5
|
+
const code = character.codePointAt(0);
|
|
6
|
+
if (code <= 0x1f ||
|
|
7
|
+
(code >= 0x7f && code <= 0x9f) ||
|
|
8
|
+
code === 0x061c ||
|
|
9
|
+
code === 0x200e ||
|
|
10
|
+
code === 0x200f ||
|
|
11
|
+
(code >= 0x202a && code <= 0x202e) ||
|
|
12
|
+
(code >= 0x2066 && code <= 0x2069)) {
|
|
13
|
+
result += `\\u${code.toString(16).padStart(4, "0")}`;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
result += character;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "node ../../scripts/guard-package-dist.mjs && tsc",
|
|
19
|
+
"test:unit": "cd ../.. && vitest run packages/terminal-text",
|
|
20
|
+
"lint": "eslint src && tsc --noEmit"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Poe Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# XML AST
|
|
2
|
+
|
|
3
|
+
Read XML as namespace-aware elements, attributes, text, CDATA, comments, and processing instructions in Node.js, browsers, and Workers. The parser has no filesystem, network, or Node.js dependencies.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { parseXml, XmlLimitError } from "@poe-code/xml-ast";
|
|
7
|
+
|
|
8
|
+
const document = parseXml(
|
|
9
|
+
'<doc xmlns="urn:example"><name>A & B</name></doc>',
|
|
10
|
+
{ maxDepth: 16, maxNodes: 1000, maxTextLength: 100_000 }
|
|
11
|
+
);
|
|
12
|
+
console.log(document.namespace); // urn:example
|
|
13
|
+
console.log(document.children[0].text); // A & B
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| API | Use |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `parseXml(source, limits?)` | Parse a string into an `XmlElement`. |
|
|
19
|
+
| `parseXmlSteps(source, limits?)` | Advance a parser through work checkpoints; the generator returns the completed element. |
|
|
20
|
+
| `XmlLimitError` | Inspect which configured resource limit was exceeded through its `limit` property. |
|
|
21
|
+
| `XmlElement`, `XmlContent`, `XmlAttribute`, `XmlName`, `XmlLimits` | Describe and consume the XML tree without Node.js types. |
|
|
22
|
+
|
|
23
|
+
Pass positive integer limits for depth, element and content counts, attributes, namespaces, and text. Omitted limits are unlimited. `retainContent` preserves ordered mixed content; `onElement` observes element names, parents, and depths during parsing. `expectedEncoding` checks an XML declaration against the caller's decoded input.
|
|
24
|
+
|
|
25
|
+
`parseXmlSteps` yields work counts so a host can account for parsing and yield between checkpoints. Syntax errors and resource limits remain errors by default; parsing never fetches external entities.
|
|
26
|
+
Pass `recover: message => report(message)` to repair truncated elements,
|
|
27
|
+
mismatched closing tags, and undeclared entities. Each repair calls the callback.
|
|
28
|
+
Resource limits and the prohibition on DTDs remain in force.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface XmlName {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly namespace: string;
|
|
4
|
+
readonly localName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface XmlAttribute extends XmlName {
|
|
7
|
+
readonly value: string;
|
|
8
|
+
}
|
|
9
|
+
export type XmlContent = XmlElement | {
|
|
10
|
+
readonly kind: "text" | "cdata" | "comment";
|
|
11
|
+
readonly text: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "processing-instruction";
|
|
14
|
+
readonly target: string;
|
|
15
|
+
readonly text: string;
|
|
16
|
+
};
|
|
17
|
+
export interface XmlElement extends XmlName {
|
|
18
|
+
readonly kind: "element";
|
|
19
|
+
readonly children: XmlElement[];
|
|
20
|
+
readonly content: readonly XmlContent[];
|
|
21
|
+
readonly attributes: readonly XmlAttribute[];
|
|
22
|
+
readonly namespaces: ReadonlyMap<string, string>;
|
|
23
|
+
text: string;
|
|
24
|
+
readonly declaration?: string;
|
|
25
|
+
readonly prolog?: readonly XmlContent[];
|
|
26
|
+
readonly epilog?: readonly XmlContent[];
|
|
27
|
+
}
|
|
28
|
+
export interface XmlLimits {
|
|
29
|
+
/** Opt-in best-effort parsing; each repaired syntax error is reported. DTDs remain forbidden. */
|
|
30
|
+
readonly recover?: (message: string) => void;
|
|
31
|
+
readonly expectedEncoding?: "UTF-8" | "UTF-16" | "UTF-16LE" | "UTF-16BE";
|
|
32
|
+
readonly retainContent?: boolean;
|
|
33
|
+
readonly maxDepth?: number;
|
|
34
|
+
readonly maxNodes?: number;
|
|
35
|
+
readonly maxAttributes?: number;
|
|
36
|
+
readonly maxAttributesPerElement?: number;
|
|
37
|
+
readonly maxNamespaces?: number;
|
|
38
|
+
readonly maxContentNodes?: number;
|
|
39
|
+
readonly maxTextLength?: number;
|
|
40
|
+
readonly onElement?: (element: XmlName, parent: XmlName | undefined, depth: number) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare class XmlLimitError extends SyntaxError {
|
|
43
|
+
readonly limit: string;
|
|
44
|
+
constructor(limit: string, message: string);
|
|
45
|
+
}
|
|
46
|
+
export declare function parseXmlSteps(input: string, limits?: XmlLimits): Generator<number, XmlElement, void>;
|
|
47
|
+
export declare function parseXml(input: string, limits?: XmlLimits): XmlElement;
|