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,121 @@
|
|
|
1
|
+
import { type Pbkdf2Opt } from './pbkdf2.ts';
|
|
2
|
+
import { type KDFInput, type TArg, type TRet } from './utils.ts';
|
|
3
|
+
/** Callable WebCrypto hash function descriptor. */
|
|
4
|
+
export type WebHash = {
|
|
5
|
+
/**
|
|
6
|
+
* Hashes one message with the selected WebCrypto digest.
|
|
7
|
+
* @param msg - message bytes to hash
|
|
8
|
+
* @returns Promise resolving to digest bytes.
|
|
9
|
+
*/
|
|
10
|
+
(msg: TArg<Uint8Array>): Promise<TRet<Uint8Array>>;
|
|
11
|
+
/** WebCrypto algorithm name passed to `crypto.subtle`. */
|
|
12
|
+
webCryptoName: string;
|
|
13
|
+
/** Digest size in bytes. */
|
|
14
|
+
outputLen: number;
|
|
15
|
+
/** Input block size in bytes. */
|
|
16
|
+
blockLen: number;
|
|
17
|
+
};
|
|
18
|
+
/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */
|
|
19
|
+
/**
|
|
20
|
+
* WebCrypto SHA2-256 hash function from RFC 6234.
|
|
21
|
+
* @param msg - message bytes to hash
|
|
22
|
+
* @returns Promise resolving to digest bytes.
|
|
23
|
+
* @example
|
|
24
|
+
* Hash a message with WebCrypto SHA2-256.
|
|
25
|
+
* ```ts
|
|
26
|
+
* await sha256(new Uint8Array([97, 98, 99]));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const sha256: TRet<WebHash>;
|
|
30
|
+
/**
|
|
31
|
+
* WebCrypto SHA2-384 hash function from RFC 6234.
|
|
32
|
+
* @param msg - message bytes to hash
|
|
33
|
+
* @returns Promise resolving to digest bytes.
|
|
34
|
+
* @example
|
|
35
|
+
* Hash a message with WebCrypto SHA2-384.
|
|
36
|
+
* ```ts
|
|
37
|
+
* await sha384(new Uint8Array([97, 98, 99]));
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const sha384: TRet<WebHash>;
|
|
41
|
+
/**
|
|
42
|
+
* WebCrypto SHA2-512 hash function from RFC 6234.
|
|
43
|
+
* @param msg - message bytes to hash
|
|
44
|
+
* @returns Promise resolving to digest bytes.
|
|
45
|
+
* @example
|
|
46
|
+
* Hash a message with WebCrypto SHA2-512.
|
|
47
|
+
* ```ts
|
|
48
|
+
* await sha512(new Uint8Array([97, 98, 99]));
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const sha512: TRet<WebHash>;
|
|
52
|
+
/** WebCrypto HMAC function type. See {@link hmac} for usage. */
|
|
53
|
+
type WebHmacFn = {
|
|
54
|
+
(hash: TArg<WebHash>, key: TArg<Uint8Array>, message: TArg<Uint8Array>): Promise<TRet<Uint8Array>>;
|
|
55
|
+
create(hash: TArg<WebHash>, key: TArg<Uint8Array>): any;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* WebCrypto HMAC: RFC2104 message authentication code.
|
|
59
|
+
* @param hash - function that would be used e.g. sha256. Webcrypto version.
|
|
60
|
+
* @param key - authentication key bytes
|
|
61
|
+
* @param message - message bytes to authenticate
|
|
62
|
+
* @returns Promise resolving to authentication tag bytes.
|
|
63
|
+
* `.create()` exists only to mirror the synchronous API surface
|
|
64
|
+
* and always throws `not implemented`.
|
|
65
|
+
* @example
|
|
66
|
+
* Compute an RFC 2104 HMAC with WebCrypto.
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { hmac, sha256 } from '@noble/hashes/webcrypto.js';
|
|
69
|
+
* const key = new Uint8Array([1, 2, 3]);
|
|
70
|
+
* const message = new Uint8Array([4, 5, 6]);
|
|
71
|
+
* const mac = await hmac(sha256, key, message);
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const hmac: TRet<WebHmacFn>;
|
|
75
|
+
/**
|
|
76
|
+
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
|
|
77
|
+
* Combines hkdf_extract + hkdf_expand in one step
|
|
78
|
+
* @param hash - hash function that would be used (e.g. sha256). Webcrypto version.
|
|
79
|
+
* @param ikm - input keying material, the initial key
|
|
80
|
+
* @param salt - optional salt value (a non-secret random value)
|
|
81
|
+
* @param info - optional context and application specific information bytes
|
|
82
|
+
* @param length - length of output keying material in bytes.
|
|
83
|
+
* RFC 5869 §2.3 allows `0..255*HashLen`, so `0` requests an empty OKM.
|
|
84
|
+
* @returns Promise resolving to derived key bytes.
|
|
85
|
+
* The RFC `L <= 255 * HashLen` bound is enforced before calling WebCrypto.
|
|
86
|
+
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
|
|
87
|
+
* @example
|
|
88
|
+
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
|
|
89
|
+
* ```ts
|
|
90
|
+
* import { hkdf, sha256 } from '@noble/hashes/webcrypto.js';
|
|
91
|
+
* import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
|
|
92
|
+
* const inputKey = randomBytes(32);
|
|
93
|
+
* const salt = randomBytes(32);
|
|
94
|
+
* const info = utf8ToBytes('application-key');
|
|
95
|
+
* const okm = await hkdf(sha256, inputKey, salt, info, 32);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function hkdf(hash: TArg<WebHash>, ikm: TArg<Uint8Array>, salt: TArg<Uint8Array | undefined>, info: TArg<Uint8Array | undefined>, length: number): Promise<TRet<Uint8Array>>;
|
|
99
|
+
/**
|
|
100
|
+
* WebCrypto PBKDF2-HMAC: RFC 8018 key derivation function.
|
|
101
|
+
* @param hash - hash function that would be used e.g. sha256. Webcrypto version.
|
|
102
|
+
* @param password - password from which a derived key is generated; string
|
|
103
|
+
* inputs are normalized through `kdfInputToBytes()`, i.e. UTF-8
|
|
104
|
+
* @param salt - cryptographic salt; string inputs are normalized through
|
|
105
|
+
* `kdfInputToBytes()`, i.e. UTF-8
|
|
106
|
+
* @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,
|
|
107
|
+
* must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.
|
|
108
|
+
* @returns Promise resolving to derived key bytes.
|
|
109
|
+
* Positive-iteration enforcement is currently delegated to backend
|
|
110
|
+
* `deriveBits()` rejection (for example `c = 0`), not a dedicated
|
|
111
|
+
* library-side guard. Values above the signed 32-bit backend range are rejected locally.
|
|
112
|
+
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
|
|
113
|
+
* @example
|
|
114
|
+
* WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function.
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { pbkdf2, sha256 } from '@noble/hashes/webcrypto.js';
|
|
117
|
+
* const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function pbkdf2(hash: TArg<WebHash>, password: TArg<KDFInput>, salt: TArg<KDFInput>, opts: Pbkdf2Opt): Promise<TRet<Uint8Array>>;
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {} from "./pbkdf2.js";
|
|
2
|
+
import { abytes, ahash, anumber, checkOpts, clean, copyBytes, kdfInputToBytes, } from "./utils.js";
|
|
3
|
+
function _subtle() {
|
|
4
|
+
const cr = typeof globalThis === 'object' ? globalThis.crypto : null;
|
|
5
|
+
const sb = cr?.subtle;
|
|
6
|
+
if (typeof sb === 'object' && sb != null)
|
|
7
|
+
return sb;
|
|
8
|
+
throw new Error('crypto.subtle must be defined');
|
|
9
|
+
}
|
|
10
|
+
function createWebHash(name, blockLen, outputLen) {
|
|
11
|
+
const hashC = async (msg) => {
|
|
12
|
+
abytes(msg);
|
|
13
|
+
const crypto = _subtle();
|
|
14
|
+
return new Uint8Array(await crypto.digest(name, msg));
|
|
15
|
+
};
|
|
16
|
+
hashC.webCryptoName = name; // make sure it won't interfere with function name
|
|
17
|
+
hashC.outputLen = outputLen;
|
|
18
|
+
hashC.blockLen = blockLen;
|
|
19
|
+
hashC.create = () => {
|
|
20
|
+
// Present only so this async wrapper satisfies the shared
|
|
21
|
+
// hash-wrapper shape checked by `ahashWeb()`.
|
|
22
|
+
throw new Error('not implemented');
|
|
23
|
+
};
|
|
24
|
+
// Later WebCrypto HMAC/HKDF/PBKDF2 calls read descriptor metadata directly, so freezing prevents
|
|
25
|
+
// callers from retargeting a `sha256` wrapper into a different backend digest by mutation.
|
|
26
|
+
return Object.freeze(hashC);
|
|
27
|
+
}
|
|
28
|
+
function ahashWeb(hash) {
|
|
29
|
+
ahash(hash);
|
|
30
|
+
const name = hash.webCryptoName;
|
|
31
|
+
if (typeof name !== 'string')
|
|
32
|
+
throw new Error('non-web hash');
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */
|
|
36
|
+
// export const sha1: WebHash = createHash('SHA-1', 64, 20);
|
|
37
|
+
/**
|
|
38
|
+
* WebCrypto SHA2-256 hash function from RFC 6234.
|
|
39
|
+
* @param msg - message bytes to hash
|
|
40
|
+
* @returns Promise resolving to digest bytes.
|
|
41
|
+
* @example
|
|
42
|
+
* Hash a message with WebCrypto SHA2-256.
|
|
43
|
+
* ```ts
|
|
44
|
+
* await sha256(new Uint8Array([97, 98, 99]));
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export const sha256 = /* @__PURE__ */ createWebHash('SHA-256', 64, 32);
|
|
48
|
+
/**
|
|
49
|
+
* WebCrypto SHA2-384 hash function from RFC 6234.
|
|
50
|
+
* @param msg - message bytes to hash
|
|
51
|
+
* @returns Promise resolving to digest bytes.
|
|
52
|
+
* @example
|
|
53
|
+
* Hash a message with WebCrypto SHA2-384.
|
|
54
|
+
* ```ts
|
|
55
|
+
* await sha384(new Uint8Array([97, 98, 99]));
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export const sha384 = /* @__PURE__ */ createWebHash('SHA-384', 128, 48);
|
|
59
|
+
/**
|
|
60
|
+
* WebCrypto SHA2-512 hash function from RFC 6234.
|
|
61
|
+
* @param msg - message bytes to hash
|
|
62
|
+
* @returns Promise resolving to digest bytes.
|
|
63
|
+
* @example
|
|
64
|
+
* Hash a message with WebCrypto SHA2-512.
|
|
65
|
+
* ```ts
|
|
66
|
+
* await sha512(new Uint8Array([97, 98, 99]));
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export const sha512 = /* @__PURE__ */ createWebHash('SHA-512', 128, 64);
|
|
70
|
+
/**
|
|
71
|
+
* WebCrypto HMAC: RFC2104 message authentication code.
|
|
72
|
+
* @param hash - function that would be used e.g. sha256. Webcrypto version.
|
|
73
|
+
* @param key - authentication key bytes
|
|
74
|
+
* @param message - message bytes to authenticate
|
|
75
|
+
* @returns Promise resolving to authentication tag bytes.
|
|
76
|
+
* `.create()` exists only to mirror the synchronous API surface
|
|
77
|
+
* and always throws `not implemented`.
|
|
78
|
+
* @example
|
|
79
|
+
* Compute an RFC 2104 HMAC with WebCrypto.
|
|
80
|
+
* ```ts
|
|
81
|
+
* import { hmac, sha256 } from '@noble/hashes/webcrypto.js';
|
|
82
|
+
* const key = new Uint8Array([1, 2, 3]);
|
|
83
|
+
* const message = new Uint8Array([4, 5, 6]);
|
|
84
|
+
* const mac = await hmac(sha256, key, message);
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export const hmac = /* @__PURE__ */ (() => {
|
|
88
|
+
const hmac_ = async (hash, key, message) => {
|
|
89
|
+
const crypto = _subtle();
|
|
90
|
+
abytes(key, undefined, 'key');
|
|
91
|
+
abytes(message, undefined, 'message');
|
|
92
|
+
const hashName = ahashWeb(hash);
|
|
93
|
+
// importKey() snapshots key synchronously, but message is not passed to sign() until after
|
|
94
|
+
// importKey() resolves. Keep the wrapper's inputs stable across that await.
|
|
95
|
+
const _message = copyBytes(message);
|
|
96
|
+
try {
|
|
97
|
+
// WebCrypto keys can't be zeroized
|
|
98
|
+
// prettier-ignore
|
|
99
|
+
const wkey = await crypto.importKey('raw', key, { name: 'HMAC', hash: hashName }, false, ['sign']);
|
|
100
|
+
return new Uint8Array(await crypto.sign('HMAC', wkey, _message));
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
clean(_message);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
hmac_.create = (_hash, _key) => {
|
|
107
|
+
throw new Error('not implemented');
|
|
108
|
+
};
|
|
109
|
+
return hmac_;
|
|
110
|
+
})();
|
|
111
|
+
/**
|
|
112
|
+
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
|
|
113
|
+
* Combines hkdf_extract + hkdf_expand in one step
|
|
114
|
+
* @param hash - hash function that would be used (e.g. sha256). Webcrypto version.
|
|
115
|
+
* @param ikm - input keying material, the initial key
|
|
116
|
+
* @param salt - optional salt value (a non-secret random value)
|
|
117
|
+
* @param info - optional context and application specific information bytes
|
|
118
|
+
* @param length - length of output keying material in bytes.
|
|
119
|
+
* RFC 5869 §2.3 allows `0..255*HashLen`, so `0` requests an empty OKM.
|
|
120
|
+
* @returns Promise resolving to derived key bytes.
|
|
121
|
+
* The RFC `L <= 255 * HashLen` bound is enforced before calling WebCrypto.
|
|
122
|
+
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
|
|
123
|
+
* @example
|
|
124
|
+
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { hkdf, sha256 } from '@noble/hashes/webcrypto.js';
|
|
127
|
+
* import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
|
|
128
|
+
* const inputKey = randomBytes(32);
|
|
129
|
+
* const salt = randomBytes(32);
|
|
130
|
+
* const info = utf8ToBytes('application-key');
|
|
131
|
+
* const okm = await hkdf(sha256, inputKey, salt, info, 32);
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export async function hkdf(hash, ikm, salt, info, length) {
|
|
135
|
+
const crypto = _subtle();
|
|
136
|
+
const hashName = ahashWeb(hash);
|
|
137
|
+
const hashOutputLen = hash.outputLen;
|
|
138
|
+
abytes(ikm, undefined, 'ikm');
|
|
139
|
+
anumber(length, 'length');
|
|
140
|
+
if (length > 255 * hashOutputLen)
|
|
141
|
+
throw new Error('Length must be <= 255*HashLen');
|
|
142
|
+
if (salt !== undefined)
|
|
143
|
+
abytes(salt, undefined, 'salt');
|
|
144
|
+
if (info !== undefined)
|
|
145
|
+
abytes(info, undefined, 'info');
|
|
146
|
+
// salt and info reach deriveBits() only after importKey() resolves, so snapshot them now.
|
|
147
|
+
const _salt = salt === undefined ? new Uint8Array(0) : copyBytes(salt);
|
|
148
|
+
const _info = info === undefined ? new Uint8Array(0) : copyBytes(info);
|
|
149
|
+
try {
|
|
150
|
+
const wkey = await crypto.importKey('raw', ikm, 'HKDF', false, ['deriveBits']);
|
|
151
|
+
const opts = { name: 'HKDF', hash: hashName, salt: _salt, info: _info };
|
|
152
|
+
const out = new Uint8Array(await crypto.deriveBits(opts, wkey, 8 * length));
|
|
153
|
+
if (out.length !== length) {
|
|
154
|
+
clean(out);
|
|
155
|
+
throw new Error('WebCrypto returned an invalid derived key length');
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
clean(_salt, _info);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* WebCrypto PBKDF2-HMAC: RFC 8018 key derivation function.
|
|
165
|
+
* @param hash - hash function that would be used e.g. sha256. Webcrypto version.
|
|
166
|
+
* @param password - password from which a derived key is generated; string
|
|
167
|
+
* inputs are normalized through `kdfInputToBytes()`, i.e. UTF-8
|
|
168
|
+
* @param salt - cryptographic salt; string inputs are normalized through
|
|
169
|
+
* `kdfInputToBytes()`, i.e. UTF-8
|
|
170
|
+
* @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,
|
|
171
|
+
* must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.
|
|
172
|
+
* @returns Promise resolving to derived key bytes.
|
|
173
|
+
* Positive-iteration enforcement is currently delegated to backend
|
|
174
|
+
* `deriveBits()` rejection (for example `c = 0`), not a dedicated
|
|
175
|
+
* library-side guard. Values above the signed 32-bit backend range are rejected locally.
|
|
176
|
+
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
|
|
177
|
+
* @example
|
|
178
|
+
* WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function.
|
|
179
|
+
* ```ts
|
|
180
|
+
* import { pbkdf2, sha256 } from '@noble/hashes/webcrypto.js';
|
|
181
|
+
* const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export async function pbkdf2(hash, password, salt, opts) {
|
|
185
|
+
const crypto = _subtle();
|
|
186
|
+
const hashName = ahashWeb(hash);
|
|
187
|
+
const _opts = checkOpts({ dkLen: 32 }, opts);
|
|
188
|
+
const { c, dkLen } = _opts;
|
|
189
|
+
anumber(c, 'c');
|
|
190
|
+
anumber(dkLen, 'dkLen');
|
|
191
|
+
// Node's native WebCrypto PBKDF2 binding accepts only a signed 32-bit iteration count and aborts
|
|
192
|
+
// the process on larger values instead of returning a rejected promise.
|
|
193
|
+
if (c > 0x7fffffff)
|
|
194
|
+
throw new Error('"c" exceeds WebCrypto backend limit');
|
|
195
|
+
// RFC 8018 §5.2 defines dkLen as a positive integer.
|
|
196
|
+
if (dkLen < 1)
|
|
197
|
+
throw new Error('"dkLen" must be >= 1');
|
|
198
|
+
// SubtleCrypto.deriveBits() accepts an unsigned-long bit count. Byte lengths at or above
|
|
199
|
+
// 2^29 would wrap after multiplication by eight instead of requesting the intended length.
|
|
200
|
+
if (dkLen >= 2 ** 29)
|
|
201
|
+
throw new Error('derived key too long');
|
|
202
|
+
const _password = kdfInputToBytes(password, 'password');
|
|
203
|
+
try {
|
|
204
|
+
const saltBytes = kdfInputToBytes(salt, 'salt');
|
|
205
|
+
// String conversion already returns an owned array. Caller-owned byte salts need a snapshot
|
|
206
|
+
// because deriveBits() does not receive them until after importKey() resolves.
|
|
207
|
+
const _salt = typeof salt === 'string' ? saltBytes : copyBytes(saltBytes);
|
|
208
|
+
try {
|
|
209
|
+
const key = await crypto.importKey('raw', _password, 'PBKDF2', false, [
|
|
210
|
+
'deriveBits',
|
|
211
|
+
]);
|
|
212
|
+
const deriveOpts = { name: 'PBKDF2', salt: _salt, iterations: c, hash: hashName };
|
|
213
|
+
const out = new Uint8Array(await crypto.deriveBits(deriveOpts, key, 8 * dkLen));
|
|
214
|
+
if (out.length !== dkLen) {
|
|
215
|
+
clean(out);
|
|
216
|
+
throw new Error('WebCrypto returned an invalid derived key length');
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
clean(_salt);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
if (typeof password === 'string')
|
|
226
|
+
clean(_password);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isDeepStrictEqual } from "node:util";
|
|
1
|
+
import { dirname } from "@poe-code/safe-fs/contracts";
|
|
3
2
|
import { runMutations, configMutation, fileMutation } from "@poe-code/config-mutations";
|
|
4
3
|
import { getAgentConfig, resolveConfigPath, isSupported } from "./configs.js";
|
|
5
4
|
import { getShapeTransformer } from "./shapes.js";
|
|
6
|
-
function getConfigDirectory(configPath) {
|
|
7
|
-
return path.dirname(configPath);
|
|
8
|
-
}
|
|
9
5
|
export class UnsupportedAgentError extends Error {
|
|
10
6
|
constructor(agentId) {
|
|
11
7
|
super(`Unsupported agent: ${agentId}`);
|
|
@@ -69,7 +65,7 @@ export async function configure(agentId, server, options) {
|
|
|
69
65
|
await unconfigure(agentId, enabledServer, options);
|
|
70
66
|
return;
|
|
71
67
|
}
|
|
72
|
-
const configDir =
|
|
68
|
+
const configDir = dirname(configPath);
|
|
73
69
|
await runMutations([
|
|
74
70
|
fileMutation.ensureDirectory({
|
|
75
71
|
path: configDir,
|
|
@@ -87,12 +83,12 @@ export async function configure(agentId, server, options) {
|
|
|
87
83
|
: undefined;
|
|
88
84
|
const shapedServer = shaped;
|
|
89
85
|
const enabledShapedServer = enabledShaped;
|
|
90
|
-
if (existingServer !== undefined &&
|
|
86
|
+
if (existingServer !== undefined && sameConfiguration(existingServer, shapedServer)) {
|
|
91
87
|
return { changed: false, content: document };
|
|
92
88
|
}
|
|
93
89
|
if (existingServer !== undefined &&
|
|
94
90
|
(enabledShapedServer === undefined ||
|
|
95
|
-
!
|
|
91
|
+
!sameConfiguration(existingServer, enabledShapedServer))) {
|
|
96
92
|
throw new Error(`MCP server "${server.name}" already exists with different configuration in ${configPath}.`);
|
|
97
93
|
}
|
|
98
94
|
const newServers = {
|
|
@@ -131,7 +127,7 @@ export async function unconfigure(agentId, server, options) {
|
|
|
131
127
|
return { changed: false, content: document };
|
|
132
128
|
}
|
|
133
129
|
if (expectedServer !== undefined &&
|
|
134
|
-
!
|
|
130
|
+
!sameConfiguration(servers[serverName], expectedServer)) {
|
|
135
131
|
return { changed: false, content: document };
|
|
136
132
|
}
|
|
137
133
|
const newServers = { ...servers };
|
|
@@ -155,3 +151,21 @@ export async function unconfigure(agentId, server, options) {
|
|
|
155
151
|
observers: options.observers
|
|
156
152
|
});
|
|
157
153
|
}
|
|
154
|
+
function sameConfiguration(left, right) {
|
|
155
|
+
if (Object.is(left, right))
|
|
156
|
+
return true;
|
|
157
|
+
if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
if (Array.isArray(left) !== Array.isArray(right))
|
|
161
|
+
return false;
|
|
162
|
+
if (left instanceof Date || right instanceof Date) {
|
|
163
|
+
return left instanceof Date && right instanceof Date && Object.is(left.getTime(), right.getTime());
|
|
164
|
+
}
|
|
165
|
+
if (Array.isArray(left) && Array.isArray(right) && left.length !== right.length)
|
|
166
|
+
return false;
|
|
167
|
+
const keys = Object.keys(left);
|
|
168
|
+
if (keys.length !== Object.keys(right).length)
|
|
169
|
+
return false;
|
|
170
|
+
return keys.every(key => Object.hasOwn(right, key) && sameConfiguration(left[key], right[key]));
|
|
171
|
+
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Composable file and config mutation engine.
|
|
4
4
|
|
|
5
|
+
The runtime works without Node built-ins: paths default to portable POSIX semantics, atomic writes use Web Crypto IDs, and filesystem access is injected. The testing filesystem returns `Uint8Array` bytes when no encoding is requested.
|
|
6
|
+
|
|
5
7
|
This package applies ordered filesystem, JSON, TOML, YAML, and template
|
|
6
8
|
mutations with dry-run support and observer hooks. Callers inject the filesystem
|
|
7
9
|
so tests can use in-memory adapters and production flows can use
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { renderTemplate } from "toolcraft-design";
|
|
1
|
+
import { posixPath as defaultPath } from "@poe-code/safe-fs/contracts";
|
|
2
|
+
import { renderTemplate } from "toolcraft-design/components/template";
|
|
4
3
|
import { isConfigObject } from "../types.js";
|
|
5
4
|
import { getConfigFormat, detectFormat } from "../formats/index.js";
|
|
6
5
|
import { cloneConfigObject, setConfigEntry } from "../formats/object.js";
|
|
@@ -47,7 +46,7 @@ async function assertRegularWriteTarget(context, targetPath) {
|
|
|
47
46
|
// plant one to redirect a credential/config write outside it. Symlinks at or
|
|
48
47
|
// above home are legitimate system links (e.g. /tmp -> /private/tmp on macOS,
|
|
49
48
|
// /var -> /private/var) and must not block writes, so bound the walk at home.
|
|
50
|
-
const path = context.paths ??
|
|
49
|
+
const path = context.paths ?? defaultPath;
|
|
51
50
|
const boundary = path.dirname(path.resolve(context.homeDir));
|
|
52
51
|
let currentPath = path.resolve(targetPath);
|
|
53
52
|
while (currentPath !== boundary) {
|
|
@@ -71,7 +70,7 @@ async function assertRegularWriteTarget(context, targetPath) {
|
|
|
71
70
|
async function writeAtomically(context, targetPath, content) {
|
|
72
71
|
await assertRegularWriteTarget(context, targetPath);
|
|
73
72
|
for (let attempt = 0; attempt < 10; attempt += 1) {
|
|
74
|
-
const tempPath = `${targetPath}.mutation-tmp-${
|
|
73
|
+
const tempPath = `${targetPath}.mutation-tmp-${globalThis.crypto.randomUUID()}`;
|
|
75
74
|
let tempCreated = false;
|
|
76
75
|
try {
|
|
77
76
|
await assertRegularWriteTarget(context, tempPath);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PathMapper } from "../types.js";
|
|
1
|
+
import type { MutationContext, PathMapper } from "../types.js";
|
|
3
2
|
/**
|
|
4
3
|
* Expand ~ shortcut to the provided home directory.
|
|
5
4
|
*/
|
|
6
|
-
export declare function expandHome(targetPath: string, homeDir: string, path?:
|
|
5
|
+
export declare function expandHome(targetPath: string, homeDir: string, path?: NonNullable<MutationContext["paths"]>): string;
|
|
7
6
|
/**
|
|
8
7
|
* Validate that a path is home-relative (starts with ~).
|
|
9
8
|
* Throws if the path is not home-relative.
|
|
@@ -15,4 +14,4 @@ export declare function validateHomePath(targetPath: string): void;
|
|
|
15
14
|
* 2. Expands ~ to home directory
|
|
16
15
|
* 3. If pathMapper is provided, maps the directory portion and reconstructs the path
|
|
17
16
|
*/
|
|
18
|
-
export declare function resolvePath(rawPath: string, homeDir: string, pathMapper?: PathMapper, path?:
|
|
17
|
+
export declare function resolvePath(rawPath: string, homeDir: string, pathMapper?: PathMapper, path?: NonNullable<MutationContext["paths"]>): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { posixPath as defaultPath } from "@poe-code/safe-fs/contracts";
|
|
2
2
|
/**
|
|
3
3
|
* Expand ~ shortcut to the provided home directory.
|
|
4
4
|
*/
|
|
5
|
-
export function expandHome(targetPath, homeDir, path =
|
|
5
|
+
export function expandHome(targetPath, homeDir, path = defaultPath) {
|
|
6
6
|
if (!targetPath?.startsWith("~")) {
|
|
7
7
|
return targetPath;
|
|
8
8
|
}
|
|
@@ -42,7 +42,7 @@ export function validateHomePath(targetPath) {
|
|
|
42
42
|
* 2. Expands ~ to home directory
|
|
43
43
|
* 3. If pathMapper is provided, maps the directory portion and reconstructs the path
|
|
44
44
|
*/
|
|
45
|
-
export function resolvePath(rawPath, homeDir, pathMapper, path =
|
|
45
|
+
export function resolvePath(rawPath, homeDir, pathMapper, path = defaultPath) {
|
|
46
46
|
validateHomePath(rawPath);
|
|
47
47
|
const expanded = expandHome(rawPath, homeDir, path);
|
|
48
48
|
const canonicalHome = path.resolve(homeDir);
|
|
@@ -9,8 +9,8 @@ export interface MockFileSystem extends FileSystem {
|
|
|
9
9
|
/** Get file content or undefined if not found */
|
|
10
10
|
getContent(path: string): string | undefined;
|
|
11
11
|
/** Read file with encoding overloads for compatibility */
|
|
12
|
-
readFile(path: string, encoding:
|
|
13
|
-
readFile(path: string): Promise<
|
|
12
|
+
readFile(path: string, encoding: "utf8"): Promise<string>;
|
|
13
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
14
14
|
}
|
|
15
15
|
export interface MockFsOptions {
|
|
16
16
|
/** Initial files - paths can use ~ which will be expanded to homeDir */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path from "
|
|
1
|
+
import { posixPath as path } from "@poe-code/safe-fs/contracts";
|
|
2
2
|
const DEFAULT_HOME_DIR = "/home/test";
|
|
3
3
|
/**
|
|
4
4
|
* Create an in-memory mock filesystem for testing mutations.
|
|
@@ -43,7 +43,7 @@ export function createMockFs(initialFiles, homeDir = DEFAULT_HOME_DIR) {
|
|
|
43
43
|
if (encoding) {
|
|
44
44
|
return content;
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return new TextEncoder().encode(content);
|
|
47
47
|
},
|
|
48
48
|
async writeFile(filePath, content, options) {
|
|
49
49
|
const absolutePath = expandPath(filePath, homeDir);
|
|
@@ -62,11 +62,8 @@ export function createMockFs(initialFiles, homeDir = DEFAULT_HOME_DIR) {
|
|
|
62
62
|
if (typeof content === "string") {
|
|
63
63
|
files[absolutePath] = content;
|
|
64
64
|
}
|
|
65
|
-
else if (Buffer.isBuffer(content)) {
|
|
66
|
-
files[absolutePath] = content.toString("utf8");
|
|
67
|
-
}
|
|
68
65
|
else {
|
|
69
|
-
files[absolutePath] =
|
|
66
|
+
files[absolutePath] = new TextDecoder().decode(new Uint8Array(content.buffer, content.byteOffset, content.byteLength));
|
|
70
67
|
}
|
|
71
68
|
},
|
|
72
69
|
async mkdir(dirPath, options) {
|
|
@@ -52,8 +52,10 @@ export interface PathMapper {
|
|
|
52
52
|
}): string;
|
|
53
53
|
}
|
|
54
54
|
export interface MutationContext {
|
|
55
|
-
/** Path operations for the filesystem namespace; defaults to
|
|
56
|
-
paths?: typeof import("
|
|
55
|
+
/** Path operations for the filesystem namespace; defaults to portable POSIX paths. */
|
|
56
|
+
paths?: Pick<typeof import("@poe-code/safe-fs/contracts").posixPath, "join" | "resolve" | "relative" | "isAbsolute" | "dirname" | "basename"> & {
|
|
57
|
+
readonly sep: string;
|
|
58
|
+
};
|
|
57
59
|
/** Filesystem interface - required */
|
|
58
60
|
fs: FileSystem;
|
|
59
61
|
/** Home directory for ~ expansion - required */
|
|
@@ -4,7 +4,6 @@ Low-level process execution abstraction. Single interface for launching processe
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
- No external dependencies
|
|
8
7
|
- Consumed by `@poe-code/agent-spawn`
|
|
9
8
|
- Consumed by `process-launcher`
|
|
10
9
|
|
|
@@ -40,4 +39,6 @@ This package exposes no environment variables.
|
|
|
40
39
|
|
|
41
40
|
This package currently exposes no package-level configuration options.
|
|
42
41
|
|
|
42
|
+
Import `uploadWorkspace` and `downloadWorkspace` from `@poe-code/process-runner/workspace-transfer` for portable transfers. Pass SafeFS `FileSystem` instances as `fs` and `remoteFs` in Workers; the host filesystem remains the default in Node.
|
|
43
|
+
|
|
43
44
|
Workspace transfer validates a positive finite upload limit and applies gitignore traversal rules: an ignored parent must be unignored before its children can be included. Docker template hashing honors `.dockerignore`. Docker port mappings, wait output, and detached completion markers are validated before use.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createHostFileSystem as createDefaultFileSystem } from "@poe-code/safe-fs/node";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createHostFileSystem as createDefaultFileSystem } from "@poe-code/safe-fs/node";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createDefaultFileSystem() { throw new Error("Workspace transfer requires an injected filesystem in Workers."); }
|
|
@@ -59,7 +59,7 @@ export interface OpenSpec {
|
|
|
59
59
|
stderr?: RunSpec["stderr"];
|
|
60
60
|
env?: RunSpec["env"];
|
|
61
61
|
tty?: boolean;
|
|
62
|
-
input?: string |
|
|
62
|
+
input?: string | Uint8Array;
|
|
63
63
|
captureOutput?: boolean;
|
|
64
64
|
/** Keep stdout callbacks and draining, without retaining its full text when false. */
|
|
65
65
|
captureStdout?: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FileSystem } from "@poe-code/safe-fs/contracts";
|
|
1
2
|
import type { DownloadResult, UploadResult } from "./types.js";
|
|
2
3
|
export type { DownloadResult, UploadResult } from "./types.js";
|
|
3
4
|
export interface WorkspaceTransferDirent {
|
|
@@ -19,9 +20,9 @@ export interface WorkspaceTransferFileSystem {
|
|
|
19
20
|
readdir(path: string, options: {
|
|
20
21
|
withFileTypes: true;
|
|
21
22
|
}): Promise<WorkspaceTransferDirent[]>;
|
|
22
|
-
readFile(path: string): Promise<
|
|
23
|
-
readFile(path: string, encoding:
|
|
24
|
-
writeFile(path: string, data: string |
|
|
23
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
24
|
+
readFile(path: string, encoding: "utf8"): Promise<string>;
|
|
25
|
+
writeFile(path: string, data: string | Uint8Array, options?: {
|
|
25
26
|
flag?: string;
|
|
26
27
|
mode?: number;
|
|
27
28
|
}): Promise<void>;
|
|
@@ -39,8 +40,8 @@ export interface WorkspaceTransferEnv {
|
|
|
39
40
|
cwd: string;
|
|
40
41
|
uploadDir: string;
|
|
41
42
|
workspaceDir?: string;
|
|
42
|
-
fs?: WorkspaceTransferFileSystem;
|
|
43
|
-
remoteFs?: WorkspaceTransferFileSystem;
|
|
43
|
+
fs?: WorkspaceTransferFileSystem | FileSystem;
|
|
44
|
+
remoteFs?: WorkspaceTransferFileSystem | FileSystem;
|
|
44
45
|
}
|
|
45
46
|
export interface WorkspaceTransferOptions {
|
|
46
47
|
runner?: WorkspaceTransferRunnerOptions;
|