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
|
@@ -48,6 +48,41 @@ to `~/.auth-store/keychain-locks`; `keychainStore.lock` can select another
|
|
|
48
48
|
directory or filesystem adapter. Injected encrypted-file adapters need
|
|
49
49
|
`readdir` support when using transactions.
|
|
50
50
|
|
|
51
|
+
## Workers and portable hosts
|
|
52
|
+
|
|
53
|
+
The `workerd`, `worker`, `browser`, and fallback exports contain no Node built-ins.
|
|
54
|
+
Node retains the desktop API above. Use `auth-store/portable` to select the portable
|
|
55
|
+
API explicitly on any host. It exports `SafeFsSecretStore`, `MigratingSecretStore`,
|
|
56
|
+
`key`, and the portable `SecretStore` contract.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { SafeFsSecretStore } from "auth-store/portable";
|
|
60
|
+
|
|
61
|
+
const store = new SafeFsSecretStore({
|
|
62
|
+
fs, // Host-owned @poe-code/safe-fs FileSystem
|
|
63
|
+
filePath: "/credentials/service.enc",
|
|
64
|
+
key: encryptionKey, // Host-managed AES-256-GCM CryptoKey; encrypt + decrypt usages
|
|
65
|
+
});
|
|
66
|
+
await store.set("secret-value");
|
|
67
|
+
const value = await store.get();
|
|
68
|
+
await store.delete();
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Keep the key in host-managed secret storage; use the same key to read persisted
|
|
72
|
+
credentials across requests. No machine identity, home directory, process, or
|
|
73
|
+
Keychain access is inferred. Web Crypto encrypts UTF-8 bytes with a fresh nonce
|
|
74
|
+
for every write. The AES-GCM document format matches the desktop store when the
|
|
75
|
+
host imports the same derived key. Missing files return `null`; malformed or
|
|
76
|
+
unauthenticated documents throw and remain untouched.
|
|
77
|
+
|
|
78
|
+
The filesystem must support exclusive creation and atomic rename, and its
|
|
79
|
+
namespace must be controlled by the trusted host. Writes stage a private `0600`
|
|
80
|
+
file and publish it by rename; path checks reject existing symbolic links.
|
|
81
|
+
These checks do not protect against an untrusted actor concurrently changing
|
|
82
|
+
filesystem ancestry. The portable store does not advertise `withLock`: hosts
|
|
83
|
+
must provide transaction coordination across requests or Workers when needed.
|
|
84
|
+
Desktop PID locks and automatic dead-process recovery are not portable.
|
|
85
|
+
|
|
51
86
|
## Backends
|
|
52
87
|
|
|
53
88
|
| `backendEnvVar` value | Platform | Backend |
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SafeFsSecretStore } from "./safe-fs-secret-store.js";
|
|
2
|
+
export type { SafeFsSecretStoreInput } from "./safe-fs-secret-store.js";
|
|
3
|
+
export { key, MigratingSecretStore } from "./provider-store.js";
|
|
4
|
+
export type { SecretStore, SecretStoreLockOptions } from "./secret-store.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type FileSystem } from "@poe-code/safe-fs/core";
|
|
2
|
+
import type { SecretStore } from "./secret-store.js";
|
|
3
|
+
export interface SafeFsSecretStoreInput {
|
|
4
|
+
/** Host-owned filesystem with exclusive creation and atomic rename support. */
|
|
5
|
+
fs: FileSystem;
|
|
6
|
+
/** Absolute path inside a trusted, host-controlled filesystem namespace. */
|
|
7
|
+
filePath: string;
|
|
8
|
+
/** Host-managed AES-256-GCM key, with encrypt and decrypt usages. */
|
|
9
|
+
key: CryptoKey;
|
|
10
|
+
}
|
|
11
|
+
/** Portable encrypted storage. Hosts own key management and transaction coordination. */
|
|
12
|
+
export declare class SafeFsSecretStore implements SecretStore {
|
|
13
|
+
private readonly fs;
|
|
14
|
+
private readonly filePath;
|
|
15
|
+
private readonly key;
|
|
16
|
+
constructor(input: SafeFsSecretStoreInput);
|
|
17
|
+
get(): Promise<string | null>;
|
|
18
|
+
set(value: string): Promise<void>;
|
|
19
|
+
delete(): Promise<void>;
|
|
20
|
+
private assertSafePath;
|
|
21
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { dirname, normalizePath } from "@poe-code/safe-fs/core";
|
|
2
|
+
import { hasOwnErrorCode } from "./error-codes.js";
|
|
3
|
+
/** Portable encrypted storage. Hosts own key management and transaction coordination. */
|
|
4
|
+
export class SafeFsSecretStore {
|
|
5
|
+
fs;
|
|
6
|
+
filePath;
|
|
7
|
+
key;
|
|
8
|
+
constructor(input) {
|
|
9
|
+
this.fs = input.fs;
|
|
10
|
+
if (!input.filePath.startsWith("/"))
|
|
11
|
+
throw new Error("Credential filePath must be absolute");
|
|
12
|
+
this.filePath = normalizePath(input.filePath);
|
|
13
|
+
if (this.filePath === "/")
|
|
14
|
+
throw new Error("Credential filePath must name a file");
|
|
15
|
+
this.key = input.key;
|
|
16
|
+
if (this.key.type !== "secret" || this.key.algorithm.name !== "AES-GCM" ||
|
|
17
|
+
this.key.algorithm.length !== 256 ||
|
|
18
|
+
!this.key.usages.includes("encrypt") || !this.key.usages.includes("decrypt")) {
|
|
19
|
+
throw new Error("Credential key must be an AES-256-GCM key with encrypt and decrypt usages");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async get() {
|
|
23
|
+
await this.assertSafePath();
|
|
24
|
+
let bytes;
|
|
25
|
+
try {
|
|
26
|
+
bytes = await this.fs.readFile(this.filePath);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (hasOwnErrorCode(error, "ENOENT"))
|
|
30
|
+
return null;
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const document = JSON.parse(new TextDecoder().decode(bytes));
|
|
35
|
+
if (!document || typeof document !== "object" || Array.isArray(document))
|
|
36
|
+
throw new Error();
|
|
37
|
+
const record = document;
|
|
38
|
+
if (!["version", "iv", "authTag", "ciphertext"].every(key => Object.hasOwn(record, key)) ||
|
|
39
|
+
record.version !== 1 || typeof record.iv !== "string" ||
|
|
40
|
+
typeof record.authTag !== "string" || typeof record.ciphertext !== "string")
|
|
41
|
+
throw new Error();
|
|
42
|
+
const iv = decodeBase64(record.iv);
|
|
43
|
+
const tag = decodeBase64(record.authTag);
|
|
44
|
+
const ciphertext = decodeBase64(record.ciphertext);
|
|
45
|
+
if (iv.length !== 12 || tag.length !== 16)
|
|
46
|
+
throw new Error();
|
|
47
|
+
const sealed = new Uint8Array(ciphertext.length + tag.length);
|
|
48
|
+
sealed.set(ciphertext);
|
|
49
|
+
sealed.set(tag, ciphertext.length);
|
|
50
|
+
const plaintext = await crypto.subtle.decrypt({ name: "AES-GCM", iv }, this.key, sealed);
|
|
51
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(plaintext);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
throw new Error("Invalid encrypted credential document; reset the store explicitly to recover");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async set(value) {
|
|
58
|
+
await this.assertSafePath();
|
|
59
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
60
|
+
const sealed = new Uint8Array(await crypto.subtle.encrypt({ name: "AES-GCM", iv }, this.key, new TextEncoder().encode(value)));
|
|
61
|
+
const document = JSON.stringify({
|
|
62
|
+
version: 1, iv: encodeBase64(iv),
|
|
63
|
+
authTag: encodeBase64(sealed.subarray(sealed.length - 16)),
|
|
64
|
+
ciphertext: encodeBase64(sealed.subarray(0, sealed.length - 16)),
|
|
65
|
+
});
|
|
66
|
+
await this.fs.mkdir(dirname(this.filePath), { recursive: true, mode: 0o700 });
|
|
67
|
+
await this.assertSafePath();
|
|
68
|
+
const staging = `${this.filePath}.${crypto.randomUUID()}.tmp`;
|
|
69
|
+
// Exclusive creation must succeed before this operation owns staging cleanup.
|
|
70
|
+
await this.fs.writeFile(staging, new TextEncoder().encode(document), { flag: "wx", mode: 0o600 });
|
|
71
|
+
try {
|
|
72
|
+
await this.fs.rename(staging, this.filePath);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
try {
|
|
76
|
+
await this.fs.rm(staging);
|
|
77
|
+
}
|
|
78
|
+
catch (cleanup) {
|
|
79
|
+
throw new AggregateError([error, cleanup], "Credential publication and cleanup failed");
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async delete() {
|
|
85
|
+
await this.assertSafePath();
|
|
86
|
+
try {
|
|
87
|
+
await this.fs.rm(this.filePath);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (!hasOwnErrorCode(error, "ENOENT"))
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async assertSafePath() {
|
|
95
|
+
let current = "";
|
|
96
|
+
for (const segment of this.filePath.slice(1).split("/")) {
|
|
97
|
+
current += `/${segment}`;
|
|
98
|
+
try {
|
|
99
|
+
if ((await this.fs.lstat(current)).type === "symlink") {
|
|
100
|
+
throw new Error("Refusing encrypted credential path through symbolic link");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (hasOwnErrorCode(error, "ENOENT"))
|
|
105
|
+
return;
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function encodeBase64(bytes) {
|
|
112
|
+
let binary = "";
|
|
113
|
+
for (const byte of bytes)
|
|
114
|
+
binary += String.fromCharCode(byte);
|
|
115
|
+
return btoa(binary);
|
|
116
|
+
}
|
|
117
|
+
function decodeBase64(value) {
|
|
118
|
+
return Uint8Array.from(atob(value), character => character.charCodeAt(0));
|
|
119
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SecretStoreLockOptions {
|
|
2
|
+
signal?: AbortSignal;
|
|
3
|
+
timeoutMs?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface SecretStore {
|
|
6
|
+
get(options?: {
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
}): Promise<string | null>;
|
|
9
|
+
set(value: string): Promise<void>;
|
|
10
|
+
delete(): Promise<void>;
|
|
11
|
+
withLock?<T>(operation: () => Promise<T>, options?: SecretStoreLockOptions): Promise<T>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
timeoutMs?: number;
|
|
4
|
-
}
|
|
1
|
+
import type { SecretStoreLockOptions } from "./secret-store.js";
|
|
2
|
+
export type { SecretStoreLockOptions } from "./secret-store.js";
|
|
5
3
|
export interface SecretStoreLockFileSystem {
|
|
6
4
|
mkdir(path: string, options?: {
|
|
7
5
|
recursive?: boolean;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { EncryptedFileStoreInput } from "./encrypted-file-store.js";
|
|
2
2
|
import type { KeychainStoreInput } from "./keychain-store.js";
|
|
3
|
-
import type {
|
|
4
|
-
export
|
|
5
|
-
get(options?: {
|
|
6
|
-
readOnly?: boolean;
|
|
7
|
-
}): Promise<string | null>;
|
|
8
|
-
set(value: string): Promise<void>;
|
|
9
|
-
delete(): Promise<void>;
|
|
10
|
-
withLock?<T>(operation: () => Promise<T>, options?: SecretStoreLockOptions): Promise<T>;
|
|
11
|
-
}
|
|
3
|
+
import type { SecretStore } from "./secret-store.js";
|
|
4
|
+
export type { SecretStore } from "./secret-store.js";
|
|
12
5
|
export type StoreBackend = "file" | "keychain";
|
|
13
6
|
export interface CreateSecretStoreInput {
|
|
14
7
|
backend?: StoreBackend;
|
|
@@ -6,8 +6,22 @@
|
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"types":
|
|
10
|
-
|
|
9
|
+
"types": {
|
|
10
|
+
"workerd": "./dist/index.browser.d.ts",
|
|
11
|
+
"browser": "./dist/index.browser.d.ts",
|
|
12
|
+
"worker": "./dist/index.browser.d.ts",
|
|
13
|
+
"node": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.browser.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"workerd": "./dist/index.browser.js",
|
|
17
|
+
"browser": "./dist/index.browser.js",
|
|
18
|
+
"worker": "./dist/index.browser.js",
|
|
19
|
+
"node": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.browser.js"
|
|
21
|
+
},
|
|
22
|
+
"./portable": {
|
|
23
|
+
"types": "./dist/index.browser.d.ts",
|
|
24
|
+
"default": "./dist/index.browser.js"
|
|
11
25
|
}
|
|
12
26
|
},
|
|
13
27
|
"scripts": {
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packages": [
|
|
4
|
+
{
|
|
5
|
+
"name": "@noble/hashes",
|
|
6
|
+
"version": "2.4.0",
|
|
7
|
+
"license": "MIT"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "@poe-code/safe-fs",
|
|
11
|
+
"version": "0.0.0-dev",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "@poe-code/xml-ast",
|
|
16
|
+
"version": "0.0.1",
|
|
17
|
+
"license": "MIT"
|
|
18
|
+
},
|
|
4
19
|
{
|
|
5
20
|
"name": "auth-store",
|
|
6
21
|
"version": "0.0.1",
|
|
@@ -18,7 +33,7 @@
|
|
|
18
33
|
},
|
|
19
34
|
{
|
|
20
35
|
"name": "tiny-http-mcp-server",
|
|
21
|
-
"version": "0.1.
|
|
36
|
+
"version": "0.1.124",
|
|
22
37
|
"license": "MIT"
|
|
23
38
|
},
|
|
24
39
|
{
|
|
@@ -50,6 +50,31 @@ or pending callback promise. Supply a statically registered client and trusted
|
|
|
50
50
|
discovery. See [the public MCP example](../safe-bash-command-mcp/README.md#resumable-https-oauth)
|
|
51
51
|
for callback routing and the required atomic storage contract.
|
|
52
52
|
|
|
53
|
+
Hosts with an existing durable issuance journal can use
|
|
54
|
+
`prepareRemoteMcpAuthorization` to obtain `{ authorizationUrl, transaction }`
|
|
55
|
+
without persisting or exchanging. Store the sensitive transaction before
|
|
56
|
+
exposing the URL. Optional `statePrefix` (at most 32 ASCII letters, digits,
|
|
57
|
+
underscores or hyphens) adds a routing hint to a fresh 256-bit nonce; it never
|
|
58
|
+
identifies or authorizes the caller. `beginRemoteMcpAuthorization` uses the same
|
|
59
|
+
preparation before calling `store.create`.
|
|
60
|
+
|
|
61
|
+
`registerOAuthClient`, `exchangeAuthorizationCode`, `refreshAccessToken`,
|
|
62
|
+
`revokeOAuthToken`, and `discoverOAuthMetadata`
|
|
63
|
+
are also available through the bundled MCP API. They use the existing protocol
|
|
64
|
+
implementation; token operations return normalized `StoredOAuthTokens` and never
|
|
65
|
+
persist or retry the exchange. Supply a policy-checked fetch and signal. A host
|
|
66
|
+
using these operations owns one-use callback validation, issuer/redirect/expiry
|
|
67
|
+
checks, durable dispatch/settlement, and credential generation fences. Returned
|
|
68
|
+
tokens and `OAuthError` diagnostics are private; redact them at user boundaries.
|
|
69
|
+
Revocation uses RFC 7009 form authentication, accepts empty success bodies, and
|
|
70
|
+
never clears host credentials or retries a request. It shares token-operation
|
|
71
|
+
authentication and has a 30-second deadline and a 1 MiB response limit.
|
|
72
|
+
Registration accepts a host-approved `registrationEndpoint`, `redirectUri`, optional
|
|
73
|
+
`metadata` and `tokenEndpointAuthMethod`, plus the policy-checked fetch. It reuses
|
|
74
|
+
the native client registration path without consent or persistence; it bounds the
|
|
75
|
+
request to 64 KiB and response to 1 MiB with a 30-second deadline, and never
|
|
76
|
+
retries. Bind and store the returned registration privately before starting consent.
|
|
77
|
+
|
|
53
78
|
## Configuration
|
|
54
79
|
|
|
55
80
|
`createDefaultOAuthClientProvider(options)` accepts:
|
package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-state.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { base64url } from "jose";
|
|
2
2
|
export function createAuthorizationState(input) {
|
|
3
3
|
const payload = {
|
|
4
4
|
v: 1,
|
|
5
|
-
n: crypto.
|
|
5
|
+
n: base64url.encode(crypto.getRandomValues(new Uint8Array(16))),
|
|
6
6
|
i: input.issuer,
|
|
7
7
|
r: input.requireIssuer,
|
|
8
8
|
};
|
|
9
|
-
return
|
|
9
|
+
return base64url.encode(JSON.stringify(payload));
|
|
10
10
|
}
|
|
11
11
|
export function parseAuthorizationState(value) {
|
|
12
12
|
if (value === null || value.length === 0) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
15
|
try {
|
|
16
|
-
const decoded =
|
|
16
|
+
const decoded = new TextDecoder().decode(base64url.decode(value));
|
|
17
17
|
const parsed = JSON.parse(decoded);
|
|
18
18
|
if (!isObjectRecord(parsed)) {
|
|
19
19
|
return null;
|
|
@@ -4,13 +4,13 @@ import { normalizeStoredOAuthClient, parseOAuthClientRegistration, registrationM
|
|
|
4
4
|
import { normalizeOAuthScope } from "./scope.js";
|
|
5
5
|
import { normalizeOAuthTokenEndpointAuthMethod } from "./token-auth-method.js";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
|
-
import {
|
|
7
|
+
import { registerOAuthClient } from "./register-client.js";
|
|
8
8
|
import { URL } from "node:url";
|
|
9
9
|
import { createAuthStoreClientStore, createAuthStoreSessionStore, assertPersistenceNamespace } from "./auth-store-session-store.js";
|
|
10
10
|
import { createLoopbackAuthorizationSession, validateAuthorizationRedirect, snapshotLoopbackAuthorizationOptions } from "./loopback-authorization.js";
|
|
11
11
|
import { createAuthorizationState } from "./authorization-state.js";
|
|
12
12
|
import { generateCodeChallenge, generateCodeVerifier } from "./pkce.js";
|
|
13
|
-
import { exchangeAuthorizationCode, OAuthError, refreshAccessToken, isRetryableOAuthError
|
|
13
|
+
import { exchangeAuthorizationCode, OAuthError, refreshAccessToken, isRetryableOAuthError } from "./token-endpoint.js";
|
|
14
14
|
import { canonicalizeResourceIndicator } from "../resource-indicator.js";
|
|
15
15
|
import { withOAuthSessionTransaction } from "./session-transaction.js";
|
|
16
16
|
import { waitForOAuthOperation } from "./cancellable-operation.js";
|
|
@@ -466,20 +466,11 @@ export function createDefaultOAuthClientProvider(options) {
|
|
|
466
466
|
["none", "client_secret_basic", "client_secret_post"].find(method => supported.includes(method)));
|
|
467
467
|
if (registrationMethod === undefined || (supported !== undefined && !supported.includes(registrationMethod)))
|
|
468
468
|
throw new Error("Authorization server does not support the requested OAuth token endpoint authentication");
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
method: "POST",
|
|
474
|
-
headers: {
|
|
475
|
-
Accept: "application/json",
|
|
476
|
-
"Content-Type": "application/json"
|
|
477
|
-
},
|
|
478
|
-
body: JSON.stringify(registrationBody),
|
|
479
|
-
signal
|
|
469
|
+
const registration = await registerOAuthClient({
|
|
470
|
+
registrationEndpoint, redirectUri, metadata: clientMetadata,
|
|
471
|
+
tokenEndpointAuthMethod: normalizeOAuthTokenEndpointAuthMethod(registrationMethod),
|
|
472
|
+
fetch, signal: parentSignal
|
|
480
473
|
});
|
|
481
|
-
const payload = await readOAuthJsonObjectResponse(response, signal);
|
|
482
|
-
const registration = parseOAuthClientRegistration(payload);
|
|
483
474
|
const registeredSecret = getOwnString(registration, "client_secret");
|
|
484
475
|
const responseMethod = normalizeOAuthTokenEndpointAuthMethod(getOwnEntry(registration, "token_endpoint_auth_method")) ??
|
|
485
476
|
requestedTokenMethod ?? (supported === undefined ? undefined : normalizeOAuthTokenEndpointAuthMethod(registrationMethod));
|
|
@@ -829,31 +820,6 @@ function assertTokenEndpointAuthentication(client, metadata) {
|
|
|
829
820
|
if (supported !== undefined && !supported.includes(method))
|
|
830
821
|
throw new Error("Authorization server does not support the requested OAuth token endpoint authentication");
|
|
831
822
|
}
|
|
832
|
-
function buildClientRegistrationBody(metadata, redirectUri, tokenEndpointAuthMethod) {
|
|
833
|
-
const body = {
|
|
834
|
-
redirect_uris: [redirectUri],
|
|
835
|
-
grant_types: ["authorization_code", "refresh_token"],
|
|
836
|
-
response_types: ["code"],
|
|
837
|
-
token_endpoint_auth_method: tokenEndpointAuthMethod
|
|
838
|
-
};
|
|
839
|
-
const clientName = metadata === undefined ? undefined : getOwnString(metadata, "clientName");
|
|
840
|
-
const scope = metadata === undefined ? undefined : getOwnString(metadata, "scope");
|
|
841
|
-
const softwareId = metadata === undefined ? undefined : getOwnString(metadata, "softwareId");
|
|
842
|
-
const softwareVersion = metadata === undefined ? undefined : getOwnString(metadata, "softwareVersion");
|
|
843
|
-
if (clientName !== undefined && clientName.length > 0) {
|
|
844
|
-
body.client_name = clientName;
|
|
845
|
-
}
|
|
846
|
-
if (scope !== undefined && scope.length > 0) {
|
|
847
|
-
body.scope = scope;
|
|
848
|
-
}
|
|
849
|
-
if (softwareId !== undefined && softwareId.length > 0) {
|
|
850
|
-
body.software_id = softwareId;
|
|
851
|
-
}
|
|
852
|
-
if (softwareVersion !== undefined && softwareVersion.length > 0) {
|
|
853
|
-
body.software_version = softwareVersion;
|
|
854
|
-
}
|
|
855
|
-
return body;
|
|
856
|
-
}
|
|
857
823
|
function toStoredDiscovery(discovery) {
|
|
858
824
|
return {
|
|
859
825
|
resourceMetadataUrl: discovery.resourceMetadataUrl,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OAuthTokenEndpointAuthMethod } from "./types.js";
|
|
2
|
+
export declare function createOAuthFormRequest(input: {
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret?: string;
|
|
5
|
+
tokenEndpointAuthMethod?: OAuthTokenEndpointAuthMethod;
|
|
6
|
+
params: Record<string, string>;
|
|
7
|
+
}): {
|
|
8
|
+
body: URLSearchParams;
|
|
9
|
+
headers: Headers;
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { normalizeOAuthTokenEndpointAuthMethod } from "./token-auth-method.js";
|
|
2
|
+
export function createOAuthFormRequest(input) {
|
|
3
|
+
const method = normalizeOAuthTokenEndpointAuthMethod(input.tokenEndpointAuthMethod) ??
|
|
4
|
+
(input.clientSecret === undefined ? "none" : "client_secret_post");
|
|
5
|
+
if (method !== "none" && (input.clientSecret === undefined || input.clientSecret.trim() === ""))
|
|
6
|
+
throw new Error("OAuth token endpoint authentication requires a client secret");
|
|
7
|
+
const body = new URLSearchParams(input.params);
|
|
8
|
+
const headers = new Headers({ Accept: "application/json", "Content-Type": "application/x-www-form-urlencoded" });
|
|
9
|
+
if (method === "client_secret_basic") {
|
|
10
|
+
const encoded = new URLSearchParams({ credential: input.clientId }).toString().slice("credential=".length);
|
|
11
|
+
const encodedSecret = new URLSearchParams({ credential: input.clientSecret }).toString().slice("credential=".length);
|
|
12
|
+
headers.set("Authorization", `Basic ${btoa(`${encoded}:${encodedSecret}`)}`);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
body.set("client_id", input.clientId);
|
|
16
|
+
if (method === "client_secret_post")
|
|
17
|
+
body.set("client_secret", input.clientSecret);
|
|
18
|
+
}
|
|
19
|
+
return { body, headers };
|
|
20
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { sha256 } from "@noble/hashes/sha2.js";
|
|
2
|
+
import { base64url } from "jose";
|
|
2
3
|
export function generateCodeVerifier() {
|
|
3
|
-
return crypto.
|
|
4
|
+
return base64url.encode(crypto.getRandomValues(new Uint8Array(32)));
|
|
4
5
|
}
|
|
5
6
|
export function generateCodeChallenge(verifier) {
|
|
6
|
-
return
|
|
7
|
+
return base64url.encode(sha256(new TextEncoder().encode(verifier)));
|
|
7
8
|
}
|
package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OAuthClientMetadata, OAuthClientRegistration, OAuthMetadataFetch, OAuthTokenEndpointAuthMethod } from "./types.js";
|
|
2
|
+
export interface RegisterOAuthClientOptions {
|
|
3
|
+
/** Discovered endpoint approved by the host's network and issuer policy. */
|
|
4
|
+
registrationEndpoint: string;
|
|
5
|
+
redirectUri: string;
|
|
6
|
+
metadata?: OAuthClientMetadata;
|
|
7
|
+
tokenEndpointAuthMethod?: OAuthTokenEndpointAuthMethod;
|
|
8
|
+
fetch: OAuthMetadataFetch;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
/** RFC 7591 registration only: no consent, persistence, or automatic retries.
|
|
12
|
+
* The host owns issuer/redirect binding and private persistence of the returned registration.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerOAuthClient(input: RegisterOAuthClientOptions): Promise<OAuthClientRegistration>;
|
package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { fetchMcpResponse } from "../http-fetch.js";
|
|
2
|
+
import { parseOAuthClientRegistration } from "./client-registration.js";
|
|
3
|
+
import { loopbackTarget, validateHostedOAuthRedirect } from "./redirect-target.js";
|
|
4
|
+
import { readOAuthJsonObjectResponse } from "./token-endpoint.js";
|
|
5
|
+
import { normalizeOAuthTokenEndpointAuthMethod } from "./token-auth-method.js";
|
|
6
|
+
/** RFC 7591 registration only: no consent, persistence, or automatic retries.
|
|
7
|
+
* The host owns issuer/redirect binding and private persistence of the returned registration.
|
|
8
|
+
*/
|
|
9
|
+
export async function registerOAuthClient(input) {
|
|
10
|
+
if (new URL(input.redirectUri).protocol === "https:")
|
|
11
|
+
validateHostedOAuthRedirect(input.redirectUri);
|
|
12
|
+
else
|
|
13
|
+
loopbackTarget({ redirectUri: input.redirectUri });
|
|
14
|
+
const body = JSON.stringify(buildClientRegistrationBody(input.metadata, input.redirectUri, normalizeOAuthTokenEndpointAuthMethod(input.tokenEndpointAuthMethod) ?? "none"));
|
|
15
|
+
if (new TextEncoder().encode(body).byteLength > 65_536)
|
|
16
|
+
throw new Error("OAuth registration request is too large");
|
|
17
|
+
input.signal?.throwIfAborted();
|
|
18
|
+
const deadline = AbortSignal.timeout(30_000);
|
|
19
|
+
const signal = input.signal === undefined ? deadline : AbortSignal.any([input.signal, deadline]);
|
|
20
|
+
const response = await fetchMcpResponse(input.fetch, input.registrationEndpoint, {
|
|
21
|
+
method: "POST", headers: { Accept: "application/json", "Content-Type": "application/json" }, body, signal
|
|
22
|
+
});
|
|
23
|
+
return parseOAuthClientRegistration(await readOAuthJsonObjectResponse(response, signal));
|
|
24
|
+
}
|
|
25
|
+
function getOwnString(input, key) {
|
|
26
|
+
const descriptor = Object.getOwnPropertyDescriptor(input, key);
|
|
27
|
+
return descriptor !== undefined && "value" in descriptor && typeof descriptor.value === "string" ? descriptor.value : undefined;
|
|
28
|
+
}
|
|
29
|
+
function buildClientRegistrationBody(metadata, redirectUri, tokenEndpointAuthMethod) {
|
|
30
|
+
const body = {
|
|
31
|
+
redirect_uris: [redirectUri],
|
|
32
|
+
grant_types: ["authorization_code", "refresh_token"],
|
|
33
|
+
response_types: ["code"],
|
|
34
|
+
token_endpoint_auth_method: tokenEndpointAuthMethod
|
|
35
|
+
};
|
|
36
|
+
const clientName = metadata === undefined ? undefined : getOwnString(metadata, "clientName");
|
|
37
|
+
const scope = metadata === undefined ? undefined : getOwnString(metadata, "scope");
|
|
38
|
+
const softwareId = metadata === undefined ? undefined : getOwnString(metadata, "softwareId");
|
|
39
|
+
const softwareVersion = metadata === undefined ? undefined : getOwnString(metadata, "softwareVersion");
|
|
40
|
+
if (clientName !== undefined && clientName.length > 0) {
|
|
41
|
+
body.client_name = clientName;
|
|
42
|
+
}
|
|
43
|
+
if (scope !== undefined && scope.length > 0) {
|
|
44
|
+
body.scope = scope;
|
|
45
|
+
}
|
|
46
|
+
if (softwareId !== undefined && softwareId.length > 0) {
|
|
47
|
+
body.software_id = softwareId;
|
|
48
|
+
}
|
|
49
|
+
if (softwareVersion !== undefined && softwareVersion.length > 0) {
|
|
50
|
+
body.software_version = softwareVersion;
|
|
51
|
+
}
|
|
52
|
+
return body;
|
|
53
|
+
}
|
|
@@ -20,12 +20,14 @@ export interface RemoteMcpAuthorizationStore {
|
|
|
20
20
|
*/
|
|
21
21
|
commit(transaction: RemoteMcpAuthorizationTransaction, session: StoredOAuthSession): Promise<boolean>;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface PrepareRemoteMcpAuthorizationOptions {
|
|
24
24
|
readonly resource: string;
|
|
25
25
|
readonly redirectUri: string;
|
|
26
|
+
/** Consent preparation needs only public client identity; a durable host may load the secret at exchange. */
|
|
26
27
|
readonly client: StoredOAuthClient;
|
|
27
28
|
readonly scope?: string;
|
|
28
|
-
|
|
29
|
+
/** Optional routing hint; entropy always comes from a fresh 256-bit nonce. */
|
|
30
|
+
readonly statePrefix?: string;
|
|
29
31
|
/** Host-validated discovery, including issuer trust and network policy. No implicit network access. */
|
|
30
32
|
readonly discover: (resource: string, signal?: AbortSignal) => Promise<OAuthDiscoveryResult>;
|
|
31
33
|
readonly signal?: AbortSignal;
|
|
@@ -33,6 +35,9 @@ export interface BeginRemoteMcpAuthorizationOptions {
|
|
|
33
35
|
/** Transaction lifetime, at most ten minutes. */
|
|
34
36
|
readonly ttlMs?: number;
|
|
35
37
|
}
|
|
38
|
+
export interface BeginRemoteMcpAuthorizationOptions extends PrepareRemoteMcpAuthorizationOptions {
|
|
39
|
+
readonly store: RemoteMcpAuthorizationStore;
|
|
40
|
+
}
|
|
36
41
|
export interface CompleteRemoteMcpAuthorizationOptions {
|
|
37
42
|
readonly callbackUrl: string;
|
|
38
43
|
readonly store: RemoteMcpAuthorizationStore;
|
|
@@ -41,6 +46,15 @@ export interface CompleteRemoteMcpAuthorizationOptions {
|
|
|
41
46
|
readonly signal?: AbortSignal;
|
|
42
47
|
readonly now?: () => number;
|
|
43
48
|
}
|
|
49
|
+
/** Prepare consent for a host that owns a durable issuance journal.
|
|
50
|
+
* The transaction contains secrets: persist privately before exposing the URL.
|
|
51
|
+
* The host must consume state once, validate callback issuer/redirect/expiry,
|
|
52
|
+
* and fence token persistence against reset or superseding grants.
|
|
53
|
+
*/
|
|
54
|
+
export declare function prepareRemoteMcpAuthorization(options: PrepareRemoteMcpAuthorizationOptions): Promise<{
|
|
55
|
+
authorizationUrl: string;
|
|
56
|
+
transaction: RemoteMcpAuthorizationTransaction;
|
|
57
|
+
}>;
|
|
44
58
|
/** Start consent without a listener or a pending callback promise. Only the URL leaves private storage. */
|
|
45
59
|
export declare function beginRemoteMcpAuthorization(options: BeginRemoteMcpAuthorizationOptions): Promise<{
|
|
46
60
|
authorizationUrl: string;
|