@kamilio/wire 0.1.9 → 0.1.10
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/dist/adapters/root.d.ts +2 -1
- package/dist/adapters/root.d.ts.map +1 -1
- package/dist/adapters/root.js +12 -2
- package/dist/adapters/root.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/executable.d.ts.map +1 -1
- package/dist/executable.js +2 -1
- package/dist/executable.js.map +1 -1
- package/dist/mcp.d.ts +2 -3
- package/dist/mcp.d.ts.map +1 -1
- package/node_modules/provider-slack/dist/index.d.ts +1 -1
- package/node_modules/provider-slack/dist/index.d.ts.map +1 -1
- package/node_modules/provider-slack/dist/index.js +1 -1
- package/node_modules/provider-slack/dist/index.js.map +1 -1
- package/node_modules/provider-slack/dist/slack.d.ts +10 -0
- package/node_modules/provider-slack/dist/slack.d.ts.map +1 -1
- package/node_modules/provider-slack/dist/slack.js +395 -22
- package/node_modules/provider-slack/dist/slack.js.map +1 -1
- package/node_modules/provider-slack/package.json +10 -4
- package/node_modules/provider-slack/src/index.ts +1 -1
- package/node_modules/provider-slack/src/slack.ts +314 -20
- package/node_modules/toolcraft/LICENSE +21 -0
- package/node_modules/toolcraft/README.md +268 -23
- package/node_modules/toolcraft/composition.json +165 -0
- package/node_modules/toolcraft/dist/agent-defs.d.ts +1 -0
- package/node_modules/toolcraft/dist/agent-defs.js +1 -0
- package/node_modules/toolcraft/dist/agent-mcp-config.d.ts +1 -0
- package/node_modules/toolcraft/dist/agent-mcp-config.js +1 -0
- package/node_modules/toolcraft/dist/applied-default.d.ts +3 -0
- package/node_modules/toolcraft/dist/applied-default.js +16 -0
- package/node_modules/toolcraft/dist/auth-store.d.ts +1 -0
- package/node_modules/toolcraft/dist/auth-store.js +1 -0
- package/node_modules/toolcraft/dist/cli.compile-check.js +20 -2
- package/node_modules/toolcraft/dist/cli.d.ts +97 -4
- package/node_modules/toolcraft/dist/cli.js +1322 -412
- package/node_modules/toolcraft/dist/composition.d.ts +15 -0
- package/node_modules/toolcraft/dist/composition.js +10 -0
- package/node_modules/toolcraft/dist/composition.json +165 -0
- package/node_modules/toolcraft/dist/config-mutations.d.ts +1 -0
- package/node_modules/toolcraft/dist/config-mutations.js +1 -0
- package/node_modules/toolcraft/dist/design/help-formatter.d.ts +2 -2
- package/node_modules/toolcraft/dist/design/help-formatter.js +1 -1
- package/node_modules/toolcraft/dist/design/render-markdown-plaintext.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-markdown-plaintext.js +1 -0
- package/node_modules/toolcraft/dist/design/render-markdown.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-markdown.js +1 -0
- package/node_modules/toolcraft/dist/discriminator.d.ts +9 -0
- package/node_modules/toolcraft/dist/discriminator.js +32 -0
- package/node_modules/toolcraft/dist/error-report.d.ts +12 -17
- package/node_modules/toolcraft/dist/error-report.js +25 -16
- package/node_modules/toolcraft/dist/file-change-renderer.d.ts +9 -0
- package/node_modules/toolcraft/dist/file-change-renderer.js +10 -0
- package/node_modules/toolcraft/dist/frontmatter.d.ts +1 -0
- package/node_modules/toolcraft/dist/frontmatter.js +1 -0
- package/node_modules/toolcraft/dist/http-hosted-oauth.compile-check.js +60 -0
- package/node_modules/toolcraft/dist/http-hosted-oauth.d.ts +124 -0
- package/node_modules/toolcraft/dist/http-hosted-oauth.js +473 -0
- package/node_modules/toolcraft/dist/http.compile-check.js +31 -0
- package/node_modules/toolcraft/dist/http.d.ts +31 -0
- package/node_modules/toolcraft/dist/http.js +161 -0
- package/node_modules/toolcraft/dist/human-in-loop/approval-tasks.d.ts +8 -2
- package/node_modules/toolcraft/dist/human-in-loop/approval-tasks.js +33 -19
- package/node_modules/toolcraft/dist/human-in-loop/approvals-commands.d.ts +3 -3
- package/node_modules/toolcraft/dist/human-in-loop/approvals-commands.js +27 -33
- package/node_modules/toolcraft/dist/human-in-loop/config.js +3 -0
- package/node_modules/toolcraft/dist/human-in-loop/gate.d.ts +7 -3
- package/node_modules/toolcraft/dist/human-in-loop/gate.js +33 -31
- package/node_modules/toolcraft/dist/human-in-loop/index.d.ts +4 -1
- package/node_modules/toolcraft/dist/human-in-loop/index.js +2 -0
- package/node_modules/toolcraft/dist/human-in-loop/plan-hash.d.ts +13 -0
- package/node_modules/toolcraft/dist/human-in-loop/plan-hash.js +78 -0
- package/node_modules/toolcraft/dist/human-in-loop/runner.d.ts +1 -1
- package/node_modules/toolcraft/dist/human-in-loop/runner.js +45 -32
- package/node_modules/toolcraft/dist/human-in-loop/runtime-options.d.ts +19 -0
- package/node_modules/toolcraft/dist/human-in-loop/runtime.d.ts +2 -0
- package/node_modules/toolcraft/dist/human-in-loop/runtime.js +14 -0
- package/node_modules/toolcraft/dist/human-in-loop/spawn.d.ts +2 -2
- package/node_modules/toolcraft/dist/human-in-loop/types.d.ts +14 -14
- package/node_modules/toolcraft/dist/human-in-loop/wiring.d.ts +11 -0
- package/node_modules/toolcraft/dist/human-in-loop/wiring.js +36 -0
- package/node_modules/toolcraft/dist/index.compile-check.js +50 -1
- package/node_modules/toolcraft/dist/index.d.ts +1 -210
- package/node_modules/toolcraft/dist/index.js +1 -475
- package/node_modules/toolcraft/dist/json-schema-converter.d.ts +14 -6
- package/node_modules/toolcraft/dist/json-schema-converter.js +150 -20
- package/node_modules/toolcraft/dist/mcp-proxy-metadata.d.ts +2 -0
- package/node_modules/toolcraft/dist/mcp-proxy-metadata.js +13 -0
- package/node_modules/toolcraft/dist/mcp-proxy.d.ts +2 -1
- package/node_modules/toolcraft/dist/mcp-proxy.js +69 -64
- package/node_modules/toolcraft/dist/mcp-result.d.ts +3 -0
- package/node_modules/toolcraft/dist/mcp-result.js +10 -0
- package/node_modules/toolcraft/dist/mcp.compile-check.js +4 -1
- package/node_modules/toolcraft/dist/mcp.d.ts +13 -3
- package/node_modules/toolcraft/dist/mcp.js +391 -217
- package/node_modules/toolcraft/dist/node-require-shim.js +4 -0
- package/node_modules/toolcraft/dist/package-metadata.js +9 -2
- package/node_modules/toolcraft/dist/process-runner.d.ts +1 -0
- package/node_modules/toolcraft/dist/process-runner.js +1 -0
- package/node_modules/toolcraft/dist/project-root.d.ts +1 -0
- package/node_modules/toolcraft/dist/project-root.js +15 -0
- package/node_modules/toolcraft/dist/redaction.js +26 -17
- package/node_modules/toolcraft/dist/renderer.d.ts +1 -1
- package/node_modules/toolcraft/dist/renderer.js +43 -42
- package/node_modules/toolcraft/dist/runtime/io.d.ts +5 -0
- package/node_modules/toolcraft/dist/runtime/io.js +59 -0
- package/node_modules/toolcraft/dist/runtime-platform.d.ts +2 -0
- package/node_modules/toolcraft/dist/runtime-platform.js +2 -0
- package/node_modules/toolcraft/dist/runtime-platform.workerd.d.ts +3 -0
- package/node_modules/toolcraft/dist/runtime-platform.workerd.js +10 -0
- package/node_modules/toolcraft/dist/runtime.d.ts +266 -0
- package/node_modules/toolcraft/dist/runtime.js +576 -0
- package/node_modules/toolcraft/dist/safe-bash-capabilities.compile-check.js +11 -0
- package/node_modules/toolcraft/dist/safe-bash.compile-check.js +16 -0
- package/node_modules/toolcraft/dist/safe-bash.d.ts +75 -0
- package/node_modules/toolcraft/dist/safe-bash.js +226 -0
- package/node_modules/toolcraft/dist/schema-member-names.d.ts +2 -0
- package/node_modules/toolcraft/dist/schema-member-names.js +39 -0
- package/node_modules/toolcraft/dist/schema-scope.d.ts +1 -0
- package/node_modules/toolcraft/dist/schema-scope.js +29 -16
- package/node_modules/toolcraft/dist/schema-standard.compile-check.js +4 -0
- package/node_modules/toolcraft/dist/schema.d.ts +2 -0
- package/node_modules/toolcraft/dist/schema.js +1 -0
- package/node_modules/toolcraft/dist/sdk.compile-check.js +31 -1
- package/node_modules/toolcraft/dist/sdk.d.ts +22 -13
- package/node_modules/toolcraft/dist/sdk.js +237 -108
- package/node_modules/toolcraft/dist/stream.d.ts +19 -0
- package/node_modules/toolcraft/dist/stream.js +93 -0
- package/node_modules/toolcraft/dist/testing/diagnostic-value.d.ts +1 -0
- package/node_modules/toolcraft/dist/testing/diagnostic-value.js +57 -0
- package/node_modules/toolcraft/dist/testing/fakes.d.ts +20 -0
- package/node_modules/toolcraft/dist/testing/fakes.js +84 -0
- package/node_modules/toolcraft/dist/testing/fixtures.d.ts +8 -0
- package/node_modules/toolcraft/dist/testing/fixtures.js +248 -0
- package/node_modules/toolcraft/dist/testing/harness.d.ts +97 -0
- package/node_modules/toolcraft/dist/testing/harness.js +490 -0
- package/node_modules/toolcraft/dist/testing/hosted-oauth-storage.d.ts +6 -0
- package/node_modules/toolcraft/dist/testing/hosted-oauth-storage.js +140 -0
- package/node_modules/toolcraft/dist/testing/index.d.ts +5 -0
- package/node_modules/toolcraft/dist/testing/index.js +4 -0
- package/node_modules/toolcraft/dist/testing/memory-fs.d.ts +11 -0
- package/node_modules/toolcraft/dist/testing/memory-fs.js +102 -0
- package/node_modules/toolcraft/dist/testing/parity.d.ts +25 -0
- package/node_modules/toolcraft/dist/testing/parity.js +428 -0
- package/node_modules/toolcraft/dist/testing/render-capture.d.ts +6 -0
- package/node_modules/toolcraft/dist/testing/render-capture.js +55 -0
- package/node_modules/toolcraft/dist/tiny-mcp-client.d.ts +1 -0
- package/node_modules/toolcraft/dist/tiny-mcp-client.js +1 -0
- package/node_modules/toolcraft/dist/union-validation.d.ts +5 -0
- package/node_modules/toolcraft/dist/union-validation.js +36 -0
- package/node_modules/toolcraft/dist/user-error.d.ts +8 -0
- package/node_modules/toolcraft/dist/user-error.js +10 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/README.md +478 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_blake.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_blake.js +59 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_md.d.ts +95 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_md.js +209 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_u64.d.ts +36 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/_u64.js +77 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/argon2.d.ts +148 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/argon2.js +577 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake1.d.ts +162 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake1.js +630 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake2.d.ts +203 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake2.js +573 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake3.d.ts +68 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/blake3.js +310 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/eskdf.d.ts +91 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/eskdf.js +225 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/hkdf.d.ts +70 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/hkdf.js +152 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/hmac.d.ts +50 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/hmac.js +93 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/index.js +34 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/legacy.d.ts +107 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/legacy.js +348 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/package.json +91 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/pbkdf2.d.ts +66 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/pbkdf2.js +176 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/scrypt.d.ts +98 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/scrypt.js +304 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha2.d.ts +176 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha2.js +446 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha3-addons.d.ts +533 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha3-addons.js +973 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha3.d.ts +208 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/sha3.js +475 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/_blake.ts +67 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/_md.ts +227 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/_u64.ts +111 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/argon2.ts +693 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/blake1.ts +677 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/blake2.ts +648 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/blake3.ts +344 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/eskdf.ts +265 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/hkdf.ts +161 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/hmac.ts +130 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/index.ts +33 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/legacy.ts +361 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/pbkdf2.ts +219 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/scrypt.ts +375 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/sha2.ts +486 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/sha3-addons.ts +1157 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/sha3.ts +525 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/utils.ts +978 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/src/webcrypto.ts +283 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/utils.d.ts +560 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/utils.js +687 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/webcrypto.d.ts +121 -0
- package/node_modules/toolcraft/node_modules/@noble/hashes/webcrypto.js +228 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/README.md +15 -2
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +2 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/codex.js +2 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.js +2 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/goose.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/index.js +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +2 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/{kimi.d.ts → pi.d.ts} +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/pi.js +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/capabilities.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/capabilities.js +63 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/index.d.ts +3 -2
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/index.js +2 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/registry.js +5 -2
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/types.d.ts +8 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/package.json +11 -5
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/README.md +12 -2
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/package.json +10 -4
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/README.md +7 -7
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/apply.js +23 -9
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/configs.js +0 -6
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/package.json +9 -6
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/README.md +17 -8
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +17 -19
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +3 -3
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +4 -4
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/json.js +1 -3
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/toml.js +1 -3
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +1 -3
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +2 -2
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +3 -6
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/types.d.ts +5 -1
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/types.js +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/package.json +9 -8
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/README.md +7 -2
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/index.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/index.js +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/parse.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/parse.js +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/package.json +7 -5
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/README.md +5 -2
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/build-context.js +2 -3
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/docker-execution-env.js +66 -34
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/host/host-execution-env.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/transfer-filesystem.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/transfer-filesystem.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/transfer-filesystem.workerd.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/types.d.ts +12 -5
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +6 -5
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +67 -29
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/package.json +22 -7
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/PROVENANCE.json +428 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/README.md +453 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/confinement.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/confinement.js +171 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.d.ts +93 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/filesystem.js +453 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/index.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/index.js +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/stats.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/stats.js +37 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/types.d.ts +81 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/values.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/bridge/values.js +65 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/memory.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/memory.js +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/real.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/real.js +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/registry.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config/registry.js +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.js +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.node.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.node.js +11 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.portable.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/config.portable.js +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/abort.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/abort.js +34 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/cleanup.js +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.d.ts +38 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/descriptor.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/errors.d.ts +53 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/errors.js +99 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.d.ts +411 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/filesystem.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/index.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/index.js +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/io.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/io.js +321 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/object.d.ts +134 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/object.js +97 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/path.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/path.js +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/portable-path.js +78 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/contracts/virtual-path.js +162 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/core.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/core.js +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/capabilities.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/capabilities.js +223 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/conditional-chmod.js +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/descriptor.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/descriptor.js +279 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/index.d.ts +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/index.js +926 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/path.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/path.js +256 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/plain-path.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/plain-path.js +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/devices/stream.js +136 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/directory-admission.js +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/atomic-view.js +13 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/index.d.ts +190 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/index.js +3862 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.d.ts +27 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +90 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/limits.js +26 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/memory/missing-target.js +144 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/comparison.js +118 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/identity.js +29 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/index.d.ts +79 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/mount/index.js +1490 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/object-authority.d.ts +27 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/object-authority.js +287 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +536 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.d.ts +91 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/overlay/index.js +1305 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.d.ts +43 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/overlay/memory-publication.js +583 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/path-namespace.js +63 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/quota/index.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/quota/index.js +525 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/read-file-stream.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/read-file-stream.js +103 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.d.ts +38 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/readonly/index.js +218 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/real/allocation.js +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/real/index.d.ts +109 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/real/index.js +1393 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/authority.js +38 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.d.ts +131 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/filesystem.js +1176 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/bytes.js +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/index.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-fetch.js +74 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request-node.js +111 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/request.js +89 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/signature.js +76 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/transport.js +478 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.d.ts +30 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/types.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/http/xml.js +192 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/index.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/index.js +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/key-order.js +11 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/manifest-admission.js +167 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.d.ts +48 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/mock.js +249 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/namespace.js +400 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/registry.js +73 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.d.ts +103 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/s3/transport.js +28 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +668 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/staging-ancestry.js +115 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/staging-cleanup.js +63 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/index.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/resource-id.js +109 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.d.ts +141 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/webdav.js +1377 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/fs/webdav/xml.js +59 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/index.d.ts +26 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/index.js +22 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/native/fs-seek/linux-x64-glibc.node +0 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/native/fs-seek/loader.mjs +120 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/native/fs-seek/manifest.json +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/filesystem.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/filesystem.js +30 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/host.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/host.js +78 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/index.js +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/native-seek-unavailable.js +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/native-seek.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/native-seek.js +54 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/stats.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/stats.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/values.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node/values.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node-host.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node-host.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node-unavailable.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/node-unavailable.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/package.json +29 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/browser-path.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/browser-path.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/browser.d.ts +26 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/browser.js +58 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/node-path.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/node-path.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/node.d.ts +26 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/node.js +64 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/platform/transport-budget.js +17 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/directory.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/directory.js +38 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/emscripten.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/emscripten.js +372 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/filesystem.d.ts +51 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/filesystem.js +258 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/flags.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/flags.js +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/index.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/index.js +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/native.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/native.js +477 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/request.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/request.js +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/stat.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/python/stat.js +34 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/runtime-core.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/runtime-core.js +58 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/storage.d.ts +81 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/storage.js +430 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/atomic-filesystem.js +496 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-io-control.js +39 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-io-metrics.js +144 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-publication.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/testing/object-publication.js +209 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/xml.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/dist/xml.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/safe-fs/package.json +196 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/README.md +28 -3
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +15 -4
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +3 -4
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/utils.js +36 -43
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +2 -5
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/default-host.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/default-host.js +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/default-host.workerd.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/default-host.workerd.js +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/filesystem.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/filesystem.js +32 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/move.js +3 -3
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/open.js +2 -5
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/paths.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/paths.js +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/ids.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/ids.js +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/types.d.ts +7 -5
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/package.json +16 -5
- package/node_modules/toolcraft/node_modules/@poe-code/terminal-text/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/terminal-text/README.md +12 -0
- package/node_modules/toolcraft/node_modules/@poe-code/terminal-text/dist/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/terminal-text/dist/index.js +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/terminal-text/package.json +22 -0
- package/node_modules/toolcraft/node_modules/@poe-code/user-error/README.md +56 -0
- package/node_modules/toolcraft/node_modules/@poe-code/user-error/dist/index.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/@poe-code/user-error/dist/index.js +21 -0
- package/node_modules/toolcraft/node_modules/{mcp-oauth → @poe-code/user-error}/package.json +4 -10
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/README.md +139 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/attributes.d.ts +69 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/attributes.js +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/characters.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/characters.js +53 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/errors.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/errors.js +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/frames.d.ts +67 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/frames.js +87 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/index.d.ts +101 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/index.js +945 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/source.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/source.js +71 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/stream.d.ts +32 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/dist/stream.js +179 -0
- package/node_modules/toolcraft/node_modules/@poe-code/xml-ast/package.json +25 -0
- package/node_modules/toolcraft/node_modules/auth-store/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/auth-store/README.md +77 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/create-secret-store.d.ts +3 -1
- package/node_modules/toolcraft/node_modules/auth-store/dist/create-secret-store.js +3 -2
- package/node_modules/toolcraft/node_modules/auth-store/dist/encrypted-file-store.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/encrypted-file-store.js +16 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.browser.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.browser.js +2 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.d.ts +2 -1
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.js +1 -1
- package/node_modules/toolcraft/node_modules/auth-store/dist/keychain-store.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/keychain-store.js +13 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/provider-store.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/auth-store/dist/provider-store.js +3 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/safe-fs-secret-store.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/safe-fs-secret-store.js +119 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/secret-store.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/secret-store.js +1 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/transaction-lock.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/transaction-lock.js +153 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/types.d.ts +2 -7
- package/node_modules/toolcraft/node_modules/auth-store/package.json +21 -6
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/toolcraft/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/toolcraft/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/toolcraft/node_modules/fast-string-width/license +21 -0
- package/node_modules/toolcraft/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/toolcraft/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/toolcraft/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/toolcraft/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/toolcraft/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/toolcraft/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/toolcraft/node_modules/ignore/LICENSE-MIT +21 -0
- package/node_modules/toolcraft/node_modules/ignore/README.md +412 -0
- package/node_modules/toolcraft/node_modules/ignore/index.d.ts +61 -0
- package/node_modules/toolcraft/node_modules/ignore/index.js +636 -0
- package/node_modules/toolcraft/node_modules/ignore/legacy.js +559 -0
- package/node_modules/toolcraft/node_modules/ignore/package.json +74 -0
- package/node_modules/toolcraft/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/toolcraft/node_modules/jose/README.md +153 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/index.d.ts +55 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +65 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +83 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +38 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwk/embedded.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwk/thumbprint.d.ts +32 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwks/local.d.ts +29 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwks/remote.d.ts +237 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/compact/sign.d.ts +36 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/compact/verify.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/flattened/sign.d.ts +42 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/flattened/verify.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/general/sign.d.ts +53 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jws/general/verify.d.ts +41 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwt/decrypt.d.ts +35 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwt/encrypt.d.ts +91 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwt/sign.d.ts +43 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwt/unsecured.d.ts +43 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/jwt/verify.d.ts +37 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/key/export.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/key/generate_key_pair.d.ts +47 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/key/generate_secret.d.ts +35 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/key/import.d.ts +83 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/types.d.ts +852 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/util/base64url.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/util/decode_jwt.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/util/decode_protected_header.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/jose/dist/types/util/errors.d.ts +213 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/index.js +32 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +27 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +159 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +167 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/general/decrypt.js +31 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwe/general/encrypt.js +182 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwk/embedded.js +17 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwks/local.js +119 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwks/remote.js +179 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/compact/sign.js +18 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/compact/verify.js +21 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/flattened/sign.js +89 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/flattened/verify.js +110 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/general/sign.js +70 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jws/general/verify.js +24 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwt/encrypt.js +101 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwt/sign.js +52 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwt/unsecured.js +63 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/key/export.js +11 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/key/generate_key_pair.js +97 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/key/import.js +57 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/aesgcmkw.js +15 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/aeskw.js +25 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/asn1.js +243 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/buffer_utils.js +43 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/check_key_type.js +122 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/content_encryption.js +217 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/crypto_key.js +136 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/deflate.js +44 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/ecdhes.js +52 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/helpers.js +19 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/invalid_key_input.js +27 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/jwk_to_key.js +107 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +238 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/key_management.js +186 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/key_to_jwk.js +31 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/normalize_key.js +166 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/pbes2kw.js +42 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/rsaes.js +24 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/signing.js +68 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/type_checks.js +40 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/validate_algorithms.js +10 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/lib/validate_crit.js +33 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/util/base64url.js +30 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/util/decode_protected_header.js +34 -0
- package/node_modules/toolcraft/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/node_modules/toolcraft/node_modules/jose/package.json +200 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/README.md +364 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/node_modules/toolcraft/node_modules/jsonc-parser/package.json +37 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth-server/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth-server/README.md +192 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth-server/dist/index.d.ts +161 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth-server/dist/index.js +723 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth-server/package.json +34 -0
- package/node_modules/toolcraft/node_modules/saxes/README.md +323 -0
- package/node_modules/toolcraft/node_modules/saxes/package.json +71 -0
- package/node_modules/toolcraft/node_modules/saxes/saxes.d.ts +635 -0
- package/node_modules/toolcraft/node_modules/saxes/saxes.js +2053 -0
- package/node_modules/toolcraft/node_modules/saxes/saxes.js.map +1 -0
- package/node_modules/toolcraft/node_modules/sisteransi/license +21 -0
- package/node_modules/toolcraft/node_modules/sisteransi/package.json +34 -0
- package/node_modules/toolcraft/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/toolcraft/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/toolcraft/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/toolcraft/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/toolcraft/node_modules/smol-toml/README.md +404 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/date.d.ts +42 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/date.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/date.js +128 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/date.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/error.d.ts +39 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/error.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/error.js +64 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/error.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/extract.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/extract.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/extract.js +101 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/extract.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.cjs +708 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.cjs.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.d.ts +44 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.js +34 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/index.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/parse.d.ts +38 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/parse.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/parse.js +148 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/parse.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/primitive.d.ts +32 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/primitive.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/primitive.js +237 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/primitive.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/stringify.d.ts +32 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/stringify.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/stringify.js +168 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/stringify.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/struct.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/struct.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/struct.js +179 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/struct.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/util.d.ts +42 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/util.d.ts.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/util.js +86 -0
- package/node_modules/toolcraft/node_modules/smol-toml/dist/util.js.map +1 -0
- package/node_modules/toolcraft/node_modules/smol-toml/package.json +64 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/date.ts +152 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/error.ts +77 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/extract.ts +112 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/index.ts +42 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/parse.ts +184 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/primitive.ts +247 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/stringify.ts +191 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/struct.ts +199 -0
- package/node_modules/toolcraft/node_modules/smol-toml/src/util.ts +101 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/README.md +836 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/auth.d.ts +69 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/auth.js +261 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/cli.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/cli.js +493 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/composition.json +65 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/express-middleware.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/express-middleware.js +90 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/fetch-body.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/fetch-body.js +47 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/fetch.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/fetch.js +130 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/http-server.d.ts +53 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/http-server.js +262 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/http-transport.d.ts +173 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/http-transport.js +1097 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/index.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/index.js +6 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/load-oauth-verifier.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/load-oauth-verifier.js +43 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/modern-headers.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/modern-headers.js +34 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/parse-body.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/parse-body.js +161 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/server.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/server.js +4 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/session.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/session.js +37 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/sse.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/sse.js +22 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/test-support.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/test-support.js +415 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/testing.d.ts +59 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/dist/testing.js +192 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +390 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/auth-store-session-store.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/auth-store-session-store.js +61 -36
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-error.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/authorization-error.js +16 -0
- package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/authorization-state.js +4 -4
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/bounded-json.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/bounded-json.js +44 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/cancellable-operation.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/cancellable-operation.js +18 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/client-registration.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/client-registration.js +118 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +841 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +36 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/loopback-authorization.js +317 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/oauth-form.js +20 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/persistence-options.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/persistence-options.js +10 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/pkce.js +8 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/redirect-target.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/redirect-target.js +42 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/register-client.js +68 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resource-bound-store.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resource-bound-store.js +179 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.d.ts +66 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resumable.js +153 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/revoke-token.js +23 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/scope.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/scope.js +9 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/session-transaction.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/session-transaction.js +50 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-auth-method.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-auth-method.js +7 -0
- package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/token-endpoint.d.ts +11 -3
- package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/token-endpoint.js +66 -29
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-grant.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-grant.js +56 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/types.d.ts +196 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/types.js +1 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-fetch.js +45 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-response.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/http-response.js +50 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +24 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +31 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.js +19 -0
- package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/server/jwks-token-verifier.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +406 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/package.json +35 -0
- package/node_modules/toolcraft/node_modules/tiny-http-mcp-server/package.json +65 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/README.md +150 -49
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.browser.d.ts +909 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.browser.js +6923 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.d.ts +909 -2
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.js +10285 -1
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/package.json +42 -3
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/README.md +296 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/base64.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/base64.js +10 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/composition.json +15 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/audio.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/audio.js +84 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/convert.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/convert.js +96 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/file-type.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/file-type.js +93 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/file.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/file.js +110 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/image.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/image.js +72 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/index.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/index.js +9 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/mime.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/mime.js +52 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/remote.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/content/remote.js +69 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/core.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/core.js +4 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/headers.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/headers.js +181 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/index.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/index.js +7 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/input-request-schema.d.ts +220 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/input-request-schema.js +1995 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/jsonrpc.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/jsonrpc.js +131 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/metadata.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/metadata.js +37 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol-server.d.ts +48 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol-server.js +1169 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol-validation.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol-validation.js +53 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/protocol.js +228 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/request-cancellation.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/request-cancellation.js +18 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/sampling-messages.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/sampling-messages.js +34 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/schema.d.ts +26 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/schema.js +26 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/server.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/server.js +7 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/standard-schema.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/standard-schema.compile-check.js +15 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/stdio-input.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/stdio-input.js +67 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/stdio-output.d.ts +24 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/stdio-output.js +131 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/subscriptions.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/subscriptions.js +128 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/testing.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/testing.js +20 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/tool-call-admission.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/tool-call-admission.js +51 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/tool-schema.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/tool-schema.js +53 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/types.d.ts +299 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/types.js +23 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/uri-template.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/uri-template.js +363 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/uri.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/dist/uri.js +41 -0
- package/node_modules/toolcraft/node_modules/tiny-stdio-mcp-server/package.json +66 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/README.md +47 -7
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/components.d.ts +8 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/components.js +11 -6
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/index.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/plan.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/plan.js +50 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/command-registry.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/command-registry.js +24 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/command-errors.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/command-errors.js +8 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/file-changes.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/file-changes.js +162 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +61 -25
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter.js +128 -29
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/index.d.ts +5 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/index.js +3 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/table.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/table.js +58 -5
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/template.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/template.js +27 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/ansi.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/ansi.js +81 -27
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/buffer.js +39 -25
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/border.js +6 -5
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/context-pane.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/context-pane.js +22 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/footer.d.ts +2 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/footer.js +46 -24
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/output-pane.d.ts +6 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/output-pane.js +128 -10
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/run-view.d.ts +27 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/run-view.js +283 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.d.ts +3 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.js +60 -19
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/composer-layout.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/composer-layout.js +45 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/composer.d.ts +24 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/composer.js +107 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/dashboard.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/dashboard.js +268 -13
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/elapsed.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/elapsed.js +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/index.d.ts +4 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/index.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/keymap.js +26 -6
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/layout.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/layout.js +19 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/line-buffer.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/line-buffer.js +63 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/output-preview.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/output-preview.js +70 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/snapshot.js +3 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/store.js +10 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-strings.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-strings.js +108 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-width.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-width.js +27 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal.js +39 -12
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/testing/pipeline-scenario.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/testing/pipeline-scenario.js +128 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/types.d.ts +47 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/escape-terminal-text.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/escape-terminal-text.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/event-groups.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/event-groups.js +49 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/actions.d.ts +8 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/actions.js +52 -4
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/demo.js +3 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/detail-content.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/detail-content.js +24 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/events.d.ts +12 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/filter.js +48 -9
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/index.d.ts +2 -4
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/index.js +1 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/jobs.d.ts +2 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/jobs.js +29 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/keymap.d.ts +13 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/keymap.js +89 -348
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/layout.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/layout.js +22 -4
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/reducer.js +198 -45
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/detail.d.ts +2 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/detail.js +37 -31
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/footer.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/footer.js +18 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/header.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/header.js +6 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/index.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/index.js +2 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/list.d.ts +16 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/list.js +49 -43
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/modal.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/modal.js +26 -13
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/pane.d.ts +6 -3
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/pane.js +10 -14
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.js +3 -4
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.js +141 -75
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.d.ts +23 -37
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.js +32 -83
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/state.d.ts +95 -8
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/state.js +77 -22
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter.d.ts +2 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter.js +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/index.d.ts +22 -9
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/index.js +15 -6
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/inline-notice.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/inline-notice.js +28 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/metric.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/metric.js +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/overlay-manager.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/overlay-manager.js +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/primitives.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/primitives.js +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/progress-group.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/progress-group.js +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/core.d.ts +9 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/core.js +208 -31
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.js +3 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/pagination.js +21 -27
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/password.js +11 -8
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/select.js +3 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/text.js +12 -9
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/note.d.ts +1 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/note.js +4 -4
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/spinner.js +2 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown-plaintext.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown-plaintext.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-performance.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-performance.js +71 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/ansi-text.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/ansi-text.js +35 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/screen.d.ts +40 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/screen.js +122 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/style.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/screen/style.js +55 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/task-tree.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/task-tree.js +79 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/driver.d.ts +34 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/driver.js +65 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/input.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/input.js +197 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/output.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal/output.js +44 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/index.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +2 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.js +64 -13
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +2 -1
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/plaintext-renderer.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/plaintext-renderer.js +228 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/viewport.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/viewport.js +56 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/package.json +13 -9
- package/node_modules/toolcraft/node_modules/toolcraft-schema/LICENSE +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/README.md +151 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/clone-default.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/clone-default.js +26 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/index.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/index.compile-check.js +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/index.d.ts +220 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/index.js +354 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/compiler.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/compiler.js +396 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/evaluate.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/evaluate.js +445 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/index.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/index.js +19 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/normalize-nullability.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/normalize-nullability.js +69 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/properties.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/properties.js +129 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/types.d.ts +34 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/types.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/utils.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema/utils.js +174 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema-document.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json-schema-document.js +17 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json.compile-check.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/json.js +81 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/native-json-schema.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/native-json-schema.js +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/oneof.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/oneof.compile-check.js +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/oneof.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/oneof.js +19 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/record.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/record.compile-check.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/record.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/record.js +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/standard.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/standard.compile-check.js +20 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/standard.d.ts +92 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/standard.js +38 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/union.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/union.compile-check.js +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/union.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/union.js +46 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/validate.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/dist/validate.js +393 -0
- package/node_modules/toolcraft/node_modules/toolcraft-schema/package.json +33 -0
- package/node_modules/toolcraft/node_modules/xmlchars/LICENSE +18 -0
- package/node_modules/toolcraft/node_modules/xmlchars/README.md +33 -0
- package/node_modules/toolcraft/node_modules/xmlchars/package.json +51 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed4.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed4.js +44 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed4.js.map +1 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed5.d.ts +51 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed5.js +105 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.0/ed5.js.map +1 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.1/ed2.d.ts +73 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.1/ed2.js +145 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xml/1.1/ed2.js.map +1 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlchars.d.ts +170 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlchars.js +191 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlchars.js.map +1 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlns/1.0/ed3.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlns/1.0/ed3.js +65 -0
- package/node_modules/toolcraft/node_modules/xmlchars/xmlns/1.0/ed3.js.map +1 -0
- package/node_modules/toolcraft/node_modules/yaml/LICENSE +13 -0
- package/node_modules/toolcraft/node_modules/yaml/README.md +172 -0
- package/node_modules/toolcraft/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/toolcraft/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/toolcraft/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/toolcraft/node_modules/yaml/package.json +97 -0
- package/node_modules/toolcraft/node_modules/yaml/util.js +2 -0
- package/node_modules/toolcraft/package.json +121 -12
- package/package.json +2 -2
- package/src/adapters/root.ts +12 -2
- package/src/cli.ts +3 -1
- package/src/executable.ts +3 -1
- package/src/mcp.ts +1 -1
- package/node_modules/toolcraft/dist/design/run-two-pane-explorer.d.ts +0 -2
- package/node_modules/toolcraft/dist/design/run-two-pane-explorer.js +0 -1
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +0 -16
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/store.schema.json +0 -32
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/task.schema.json +0 -33
- package/node_modules/toolcraft/node_modules/mcp-oauth/README.md +0 -31
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/auth-store-session-store.d.ts +0 -14
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +0 -627
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +0 -20
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/loopback-authorization.js +0 -207
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/pkce.js +0 -7
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/types.d.ts +0 -113
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/index.d.ts +0 -10
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/index.js +0 -7
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +0 -304
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/.turbo/turbo-build.log +0 -7
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/internal.d.ts +0 -556
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/internal.js +0 -2688
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.js +0 -37
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.js +0 -50
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.js +0 -50
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.js +0 -51
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.js +0 -99
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.js +0 -56
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.js +0 -145
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/oauth-discovery.d.ts +0 -24
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/oauth-discovery.js +0 -382
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/http-oauth.integration.test.ts +0 -808
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/http-oauth.test.ts +0 -922
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/index.ts +0 -94
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/internal.ts +0 -3904
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/jsonrpc-types.compile-check.ts +0 -66
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-http-transport.integration.test.ts +0 -222
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-sdk.test.ts +0 -1326
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-tiny-stdio-test-server-tools.test.ts +0 -143
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-lifecycle-types.compile-check.ts +0 -65
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-prompt-types.compile-check.ts +0 -66
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-resource-types.compile-check.ts +0 -70
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-tool-types.compile-check.ts +0 -127
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-transport-types.compile-check.ts +0 -75
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-utility-types.compile-check.ts +0 -181
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mock-servers.test.ts +0 -980
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/oauth-discovery.ts +0 -578
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/package-runtime.test.ts +0 -25
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/transports.test.ts +0 -9018
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/utilities.test.ts +0 -372
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/tsconfig.json +0 -11
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/two-pane.d.ts +0 -102
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/two-pane.js +0 -510
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-two-pane-explorer.d.ts +0 -2
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-two-pane-explorer.js +0 -1
- /package/node_modules/toolcraft/{node_modules/mcp-oauth/dist/client/types.js → dist/http-hosted-oauth.compile-check.d.ts} +0 -0
- /package/node_modules/toolcraft/{node_modules/mcp-oauth/dist/types.compile-check.d.ts → dist/http.compile-check.d.ts} +0 -0
- /package/node_modules/toolcraft/{node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.d.ts → dist/human-in-loop/runtime-options.js} +0 -0
- /package/node_modules/toolcraft/{node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.d.ts → dist/node-require-shim.d.ts} +0 -0
- /package/node_modules/toolcraft/{node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.d.ts → dist/safe-bash-capabilities.compile-check.d.ts} +0 -0
- /package/node_modules/toolcraft/{node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.d.ts → dist/safe-bash.compile-check.d.ts} +0 -0
- /package/node_modules/toolcraft/{node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.d.ts → dist/schema-standard.compile-check.d.ts} +0 -0
- /package/node_modules/toolcraft/node_modules/{tiny-mcp-client/dist/mcp-transport-types.compile-check.d.ts → @noble/hashes/index.d.ts} +0 -0
- /package/node_modules/toolcraft/node_modules/{tiny-mcp-client/dist/mcp-utility-types.compile-check.d.ts → @poe-code/safe-fs/dist/bridge/types.js} +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/authorization-state.d.ts +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/default-oauth-client-provider.d.ts +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/client/pkce.d.ts +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/resource-indicator.d.ts +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/resource-indicator.js +0 -0
- /package/node_modules/toolcraft/node_modules/{mcp-oauth → tiny-http-mcp-server/node_modules/mcp-oauth}/dist/types.compile-check.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./node-require-shim.js";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { Command as CommanderCommand, CommanderError, InvalidArgumentError, Option } from "commander";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { cloneDefaultValue, nativeJsonSchema, unicodeLength, validate as validateSchema } from "toolcraft-schema";
|
|
6
|
+
import { configureTheme, confirm, createLogger, formatCommandList, formatOptionList, getTheme, helpFormatterPlain, isCancel, note, promptText, renderHelpTokens, renderTable, select, text, withOutputFormat } from "toolcraft-design";
|
|
7
|
+
import { ApprovalDeclinedError, ToolcraftBugError, UserError, assertCommandRequirements, getCommandSourcePath, hasMcpProxyConfig, isUserError, resolveCommandSecrets } from "./index.js";
|
|
6
8
|
import { hasOwnErrorCode } from "./error-codes.js";
|
|
7
|
-
import { mergeApprovalsGroup } from "./human-in-loop/approvals-commands.js";
|
|
8
9
|
import { writeErrorReport } from "./error-report.js";
|
|
9
|
-
import {
|
|
10
|
-
import { resolveMcpProxies } from "./mcp-proxy.js";
|
|
10
|
+
import { assertHumanInLoopWired, mergeApprovalsRoot } from "./human-in-loop/wiring.js";
|
|
11
11
|
import { getExpectedNumberDescription, isValidNumberSchemaValue } from "./number-schema.js";
|
|
12
12
|
import { findEntrypointPackageMetadata } from "./package-metadata.js";
|
|
13
13
|
import { redactHttpBody, redactHttpHeaderValue } from "./redaction.js";
|
|
@@ -18,21 +18,39 @@ import { renderSourceSnippet } from "./source-snippet.js";
|
|
|
18
18
|
import { enableSourceMaps, formatDebugStack } from "./stack-trim.js";
|
|
19
19
|
import { suggest } from "./suggest.js";
|
|
20
20
|
import { throwValidationErrors } from "./validation-errors.js";
|
|
21
|
+
import { RESERVED_SERVICE_NAMES, createEnv, createFs, validateServices } from "./runtime/io.js";
|
|
22
|
+
import { createManagedStream } from "./stream.js";
|
|
23
|
+
export { renderErrorReport } from "./error-report.js";
|
|
21
24
|
configureTheme({ brand: "blue", label: "Toolcraft" });
|
|
22
25
|
export { configureTheme };
|
|
23
|
-
const RESERVED_SERVICE_NAMES = new Set([
|
|
24
|
-
"params",
|
|
25
|
-
"secrets",
|
|
26
|
-
"fetch",
|
|
27
|
-
"fs",
|
|
28
|
-
"env",
|
|
29
|
-
"diagnostics",
|
|
30
|
-
"progress",
|
|
31
|
-
"runtimeOptions",
|
|
32
|
-
"root"
|
|
33
|
-
]);
|
|
34
|
-
const RESERVED_SERVICE_NAMES_MESSAGE = "Available reserved names: params, secrets, fetch, fs, env, diagnostics, progress, runtimeOptions, root.";
|
|
35
26
|
const NULL_OPTION_VALUE = Symbol("toolcraft.cli.null");
|
|
27
|
+
const optionalModulePaths = {
|
|
28
|
+
mcpProxy: "./mcp-proxy.js"
|
|
29
|
+
};
|
|
30
|
+
function importOptionalModule(specifier) {
|
|
31
|
+
return import(specifier);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns the resolved CLI command surface as deterministic plain data.
|
|
35
|
+
*
|
|
36
|
+
* Schema version 1 is independent of human-facing help layout. Nodes and options retain
|
|
37
|
+
* declaration order, paths exclude the root name, non-CLI nodes are omitted, hidden commands
|
|
38
|
+
* remain present, and Toolcraft-controlled global options are reported separately. A future
|
|
39
|
+
* incompatible shape change will increment `schemaVersion`.
|
|
40
|
+
*/
|
|
41
|
+
export async function createCLICommandTreeSnapshot(roots, options = {}) {
|
|
42
|
+
const argv = [...(options.argv ?? ["node", "toolcraft"])];
|
|
43
|
+
const normalizedRoot = normalizeRoots(roots, argv);
|
|
44
|
+
const root = mergeApprovalsRoot(normalizedRoot, options);
|
|
45
|
+
const controls = resolveCLIControls(options.controls);
|
|
46
|
+
const presetsEnabled = options.presets === true;
|
|
47
|
+
const globalLongOptionFlags = getGlobalLongOptionFlags(presetsEnabled, options.version !== undefined, controls);
|
|
48
|
+
return {
|
|
49
|
+
schemaVersion: 1,
|
|
50
|
+
globalOptions: createGlobalSnapshotOptions(presetsEnabled, options.version !== undefined, controls),
|
|
51
|
+
root: createSnapshotGroup(root, options.casing ?? "kebab", globalLongOptionFlags, [], false)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
36
54
|
function inferProgramName(argv) {
|
|
37
55
|
const entrypoint = argv[1];
|
|
38
56
|
if (typeof entrypoint !== "string" || entrypoint.length === 0) {
|
|
@@ -94,17 +112,18 @@ function splitWords(value) {
|
|
|
94
112
|
}
|
|
95
113
|
return words;
|
|
96
114
|
}
|
|
97
|
-
|
|
115
|
+
/** @internal */
|
|
116
|
+
export function formatCLIName(segment, casing) {
|
|
98
117
|
const separator = casing === "snake" ? "_" : "-";
|
|
99
118
|
return splitWords(segment).join(separator);
|
|
100
119
|
}
|
|
101
120
|
function toOptionFlag(path, casing) {
|
|
102
|
-
return `--${path.map((segment) =>
|
|
121
|
+
return `--${path.map((segment) => formatCLIName(segment, casing)).join(".")}`;
|
|
103
122
|
}
|
|
104
123
|
function toOptionAttribute(path, casing) {
|
|
105
124
|
return path
|
|
106
125
|
.map((segment) => {
|
|
107
|
-
const formatted =
|
|
126
|
+
const formatted = formatCLIName(segment, casing);
|
|
108
127
|
if (casing === "snake") {
|
|
109
128
|
return formatted;
|
|
110
129
|
}
|
|
@@ -146,7 +165,7 @@ function createSyntheticEnumSchema(values) {
|
|
|
146
165
|
function getRequiredBranchFingerprint(branch, casing) {
|
|
147
166
|
const requiredKeys = Object.entries(branch.shape)
|
|
148
167
|
.filter(([, schema]) => schema.kind !== "optional")
|
|
149
|
-
.map(([key]) =>
|
|
168
|
+
.map(([key]) => formatCLIName(key, casing))
|
|
150
169
|
.sort();
|
|
151
170
|
return requiredKeys.join("+");
|
|
152
171
|
}
|
|
@@ -185,10 +204,20 @@ function collectFields(schema, casing, globalLongOptionFlags, path = [], inherit
|
|
|
185
204
|
optional: runtimeOptional,
|
|
186
205
|
hasDefault: false,
|
|
187
206
|
defaultValue: undefined,
|
|
188
|
-
requiredWhenActive
|
|
207
|
+
requiredWhenActive,
|
|
208
|
+
variantId: variantContext?.id,
|
|
209
|
+
variantBranchId: variantContext?.branchId
|
|
189
210
|
};
|
|
190
211
|
collected.fields.push(controlField);
|
|
191
212
|
const branches = [];
|
|
213
|
+
collected.variants.push({
|
|
214
|
+
id: variantId,
|
|
215
|
+
controlDisplayPath: controlField.displayPath,
|
|
216
|
+
controlFieldId: controlField.id,
|
|
217
|
+
optional: variantContext === undefined ? runtimeOptional : !requiredWhenActive,
|
|
218
|
+
parent: variantContext,
|
|
219
|
+
branches
|
|
220
|
+
});
|
|
192
221
|
for (const [branchId, branchSchema] of Object.entries(childSchema.branches)) {
|
|
193
222
|
const branch = collectFields(branchSchema, casing, globalLongOptionFlags, nextPath, true, {
|
|
194
223
|
id: variantId,
|
|
@@ -209,20 +238,21 @@ function collectFields(schema, casing, globalLongOptionFlags, path = [], inherit
|
|
|
209
238
|
.map((field) => field.id)
|
|
210
239
|
});
|
|
211
240
|
}
|
|
212
|
-
collected.variants.push({
|
|
213
|
-
id: variantId,
|
|
214
|
-
controlDisplayPath: controlField.displayPath,
|
|
215
|
-
controlFieldId: controlField.id,
|
|
216
|
-
optional: runtimeOptional,
|
|
217
|
-
branches
|
|
218
|
-
});
|
|
219
241
|
continue;
|
|
220
242
|
}
|
|
221
243
|
if (childSchema.kind === "union") {
|
|
222
244
|
const variantId = `${toDisplayPath(nextPath)}:union`;
|
|
223
245
|
const controlPath = toUnionKindControlPath(nextPath);
|
|
224
246
|
const controlDisplayPath = toUnionKindDisplayPath(nextPath);
|
|
225
|
-
const
|
|
247
|
+
const seenFingerprints = new Set();
|
|
248
|
+
const branchIds = childSchema.branches.map((branch, index) => {
|
|
249
|
+
const fingerprint = getRequiredBranchFingerprint(branch, casing);
|
|
250
|
+
const branchId = seenFingerprints.has(fingerprint)
|
|
251
|
+
? `${fingerprint} (branch ${index + 1})`
|
|
252
|
+
: fingerprint;
|
|
253
|
+
seenFingerprints.add(fingerprint);
|
|
254
|
+
return branchId;
|
|
255
|
+
});
|
|
226
256
|
const controlField = {
|
|
227
257
|
id: controlDisplayPath,
|
|
228
258
|
path: controlPath,
|
|
@@ -238,10 +268,20 @@ function collectFields(schema, casing, globalLongOptionFlags, path = [], inherit
|
|
|
238
268
|
hasDefault: false,
|
|
239
269
|
defaultValue: undefined,
|
|
240
270
|
requiredWhenActive,
|
|
241
|
-
synthetic: true
|
|
271
|
+
synthetic: true,
|
|
272
|
+
variantId: variantContext?.id,
|
|
273
|
+
variantBranchId: variantContext?.branchId
|
|
242
274
|
};
|
|
243
275
|
collected.fields.push(controlField);
|
|
244
276
|
const branches = [];
|
|
277
|
+
collected.variants.push({
|
|
278
|
+
id: variantId,
|
|
279
|
+
controlDisplayPath,
|
|
280
|
+
controlFieldId: controlField.id,
|
|
281
|
+
optional: variantContext === undefined ? runtimeOptional : !requiredWhenActive,
|
|
282
|
+
parent: variantContext,
|
|
283
|
+
branches
|
|
284
|
+
});
|
|
245
285
|
childSchema.branches.forEach((branchSchema, index) => {
|
|
246
286
|
const branchId = branchIds[index] ?? "";
|
|
247
287
|
const branch = collectFields(branchSchema, casing, globalLongOptionFlags, nextPath, true, {
|
|
@@ -263,13 +303,6 @@ function collectFields(schema, casing, globalLongOptionFlags, path = [], inherit
|
|
|
263
303
|
.map((field) => field.id)
|
|
264
304
|
});
|
|
265
305
|
});
|
|
266
|
-
collected.variants.push({
|
|
267
|
-
id: variantId,
|
|
268
|
-
controlDisplayPath,
|
|
269
|
-
controlFieldId: controlField.id,
|
|
270
|
-
optional: runtimeOptional,
|
|
271
|
-
branches
|
|
272
|
-
});
|
|
273
306
|
continue;
|
|
274
307
|
}
|
|
275
308
|
if (childSchema.kind === "record") {
|
|
@@ -320,7 +353,7 @@ function collectFields(schema, casing, globalLongOptionFlags, path = [], inherit
|
|
|
320
353
|
longAliases: [...(childSchema.cliAliases ?? [])].map((alias) => alias.startsWith("--") ? alias : `--${alias}`),
|
|
321
354
|
shortFlag: childSchema.short,
|
|
322
355
|
schema: childSchema,
|
|
323
|
-
description: childSchema.description,
|
|
356
|
+
description: childSchema.cliDescription ?? childSchema.description,
|
|
324
357
|
optional: runtimeOptional,
|
|
325
358
|
hasDefault: childSchema.default !== undefined,
|
|
326
359
|
defaultValue: childSchema.default,
|
|
@@ -378,6 +411,13 @@ function formatOptionFlags(field, globalLongOptionFlags) {
|
|
|
378
411
|
}
|
|
379
412
|
return [`-${field.shortFlag}`, field.optionFlag, ...field.longAliases].join(", ");
|
|
380
413
|
}
|
|
414
|
+
function formatMissingParameterMessage(field) {
|
|
415
|
+
const message = `Missing required parameter "${field.displayPath}".`;
|
|
416
|
+
if (field.schema.kind !== "enum") {
|
|
417
|
+
return message;
|
|
418
|
+
}
|
|
419
|
+
return `${message} Expected one of: ${field.schema.values.map((value) => String(value)).join(", ")}.`;
|
|
420
|
+
}
|
|
381
421
|
function formatPositionalToken(field) {
|
|
382
422
|
const optionalPositional = field.optional || field.hasDefault;
|
|
383
423
|
if (field.variadicPosition === true) {
|
|
@@ -393,23 +433,24 @@ function parseBooleanText(value, label) {
|
|
|
393
433
|
if (normalized === "false") {
|
|
394
434
|
return false;
|
|
395
435
|
}
|
|
396
|
-
throw new
|
|
436
|
+
throw new UserError(`Invalid value for "${label}". Expected true or false, got ${describeReceived(value)}.`);
|
|
397
437
|
}
|
|
398
438
|
function parseEnumValue(value, values, label) {
|
|
399
439
|
const match = values.find((candidate) => String(candidate) === value);
|
|
400
440
|
if (match === undefined) {
|
|
401
441
|
const suggestions = suggest(value, values.map((candidate) => String(candidate)));
|
|
402
442
|
const suggestionLine = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(", ")}?\n` : " ";
|
|
403
|
-
throw new
|
|
443
|
+
throw new UserError(`Invalid value for "${label}".${suggestionLine}Expected one of: ${values.map((candidate) => String(candidate)).join(", ")}, got ${describeReceived(value)}.`);
|
|
404
444
|
}
|
|
405
445
|
return match;
|
|
406
446
|
}
|
|
407
447
|
function validateStringPattern(value, schema, label) {
|
|
408
|
-
|
|
409
|
-
|
|
448
|
+
const length = unicodeLength(value);
|
|
449
|
+
if (schema.minLength !== undefined && length < schema.minLength) {
|
|
450
|
+
throw new UserError(`Invalid value for "${label}". Expected a string with length at least ${schema.minLength}, got string with length ${length}.`);
|
|
410
451
|
}
|
|
411
|
-
if (schema.maxLength !== undefined &&
|
|
412
|
-
throw new UserError(`Invalid value for "${label}". Expected a string with length at most ${schema.maxLength}, got string with length ${
|
|
452
|
+
if (schema.maxLength !== undefined && length > schema.maxLength) {
|
|
453
|
+
throw new UserError(`Invalid value for "${label}". Expected a string with length at most ${schema.maxLength}, got string with length ${length}.`);
|
|
413
454
|
}
|
|
414
455
|
if (schema.pattern !== undefined && !matchesStringPattern(value, schema.pattern)) {
|
|
415
456
|
throw new UserError(`Invalid value for "${label}": "${value}" does not match pattern "${schema.pattern}".`);
|
|
@@ -424,7 +465,7 @@ function parseJsonText(value, label) {
|
|
|
424
465
|
return JSON.parse(value);
|
|
425
466
|
}
|
|
426
467
|
catch (error) {
|
|
427
|
-
throw new
|
|
468
|
+
throw new UserError(`Invalid value for "${label}". Expected valid JSON, got ${describeReceived(value)} (parser: ${getErrorMessage(error)}).`);
|
|
428
469
|
}
|
|
429
470
|
}
|
|
430
471
|
function describeReceived(value) {
|
|
@@ -548,8 +589,8 @@ function parseScalarValue(value, schema, label) {
|
|
|
548
589
|
return validateStringPattern(value, schema, label);
|
|
549
590
|
case "number": {
|
|
550
591
|
const parsed = Number(value);
|
|
551
|
-
if (!isValidNumberSchemaValue(parsed, schema)) {
|
|
552
|
-
throw new
|
|
592
|
+
if (value.trim().length === 0 || !isValidNumberSchemaValue(parsed, schema)) {
|
|
593
|
+
throw new UserError(`Invalid value for "${label}". Expected ${getExpectedNumberDescription(schema)}, got ${describeReceived(value)}.`);
|
|
553
594
|
}
|
|
554
595
|
return parsed;
|
|
555
596
|
}
|
|
@@ -591,19 +632,66 @@ function parseArrayValue(value, schema, label) {
|
|
|
591
632
|
}
|
|
592
633
|
return splitArrayInput(value).map((item) => parseScalarValue(item, itemSchema, label));
|
|
593
634
|
}
|
|
594
|
-
function
|
|
635
|
+
function isNegativeNumericToken(token) {
|
|
595
636
|
if (!token.startsWith("-") || token.startsWith("--")) {
|
|
596
637
|
return false;
|
|
597
638
|
}
|
|
598
|
-
const itemSchema = unwrapOptional(schema.item);
|
|
599
|
-
if (itemSchema.kind !== "number") {
|
|
600
|
-
return false;
|
|
601
|
-
}
|
|
602
639
|
const items = splitArrayInput(token);
|
|
603
|
-
return (items.length > 0 && items.every((item) =>
|
|
640
|
+
return (items.length > 0 && items.every((item) => Number.isFinite(Number(item))));
|
|
604
641
|
}
|
|
605
642
|
function isNextArrayOptionToken(token, schema) {
|
|
606
|
-
|
|
643
|
+
if (token === "-" && unwrapOptional(schema.item).kind === "string") {
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
return token.startsWith("-") &&
|
|
647
|
+
!(unwrapOptional(schema.item).kind === "number" && isNegativeNumericToken(token));
|
|
648
|
+
}
|
|
649
|
+
function normalizeNumericArrayOptions(argv, options, numericArrayOptions) {
|
|
650
|
+
if (numericArrayOptions.size === 0) {
|
|
651
|
+
return argv;
|
|
652
|
+
}
|
|
653
|
+
const normalized = [];
|
|
654
|
+
let activeFlag;
|
|
655
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
656
|
+
const token = argv[index];
|
|
657
|
+
if (token === "--") {
|
|
658
|
+
normalized.push(...argv.slice(index));
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
const option = options.find((candidate) => candidate.short === token || candidate.long === token);
|
|
662
|
+
const attachedOption = token.startsWith("-") && !token.startsWith("--") && token.length > 2
|
|
663
|
+
? options.find((candidate) => candidate.short === token.slice(0, 2))
|
|
664
|
+
: undefined;
|
|
665
|
+
if (activeFlag !== undefined && option === undefined && attachedOption === undefined) {
|
|
666
|
+
if (token.startsWith("-") && !token.startsWith("--")) {
|
|
667
|
+
if (isNegativeNumericToken(token)) {
|
|
668
|
+
normalized.push(activeFlag);
|
|
669
|
+
}
|
|
670
|
+
else if (token !== "-") {
|
|
671
|
+
activeFlag = undefined;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
else if (token.startsWith("--")) {
|
|
675
|
+
activeFlag = undefined;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
activeFlag = undefined;
|
|
680
|
+
}
|
|
681
|
+
normalized.push(token);
|
|
682
|
+
if (option !== undefined) {
|
|
683
|
+
const nextToken = argv[index + 1];
|
|
684
|
+
if (nextToken !== undefined && (option.required ||
|
|
685
|
+
(option.optional && !(nextToken.length > 1 && nextToken.startsWith("-"))))) {
|
|
686
|
+
normalized.push(nextToken);
|
|
687
|
+
index += 1;
|
|
688
|
+
}
|
|
689
|
+
if (numericArrayOptions.has(option)) {
|
|
690
|
+
activeFlag = token;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return normalized;
|
|
607
695
|
}
|
|
608
696
|
function validateArrayBounds(value, schema, label) {
|
|
609
697
|
if (schema.minItems !== undefined && value.length < schema.minItems) {
|
|
@@ -614,41 +702,69 @@ function validateArrayBounds(value, schema, label) {
|
|
|
614
702
|
}
|
|
615
703
|
}
|
|
616
704
|
function createOption(field, globalLongOptionFlags) {
|
|
617
|
-
const flags = formatOptionFlags(field, globalLongOptionFlags);
|
|
618
705
|
const collidesWithGlobalFlag = globalLongOptionFlags.has(field.optionFlag);
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
mainOption.preset(true);
|
|
625
|
-
// Commander v14 passes the preset value through argParser too, so guard with typeof check
|
|
626
|
-
mainOption.argParser((value) => (typeof value === "boolean" ? value : value));
|
|
627
|
-
return [
|
|
628
|
-
mainOption,
|
|
629
|
-
createCommanderOption(`--no-${field.optionFlag.slice(2)}`, field.description, field)
|
|
630
|
-
];
|
|
631
|
-
}
|
|
632
|
-
if (field.schema.kind === "array") {
|
|
633
|
-
return [
|
|
634
|
-
createCommanderOption(`${flags} <value...>`, field.description, field).argParser((value, previous = []) => [...previous, value])
|
|
706
|
+
const flagGroups = collidesWithGlobalFlag
|
|
707
|
+
? [formatOptionFlags(field, globalLongOptionFlags)]
|
|
708
|
+
: [
|
|
709
|
+
field.shortFlag === undefined ? field.optionFlag : `-${field.shortFlag}, ${field.optionFlag}`,
|
|
710
|
+
...field.longAliases
|
|
635
711
|
];
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
712
|
+
return flagGroups.flatMap((flags, index) => {
|
|
713
|
+
if (field.schema.kind === "boolean") {
|
|
714
|
+
if (collidesWithGlobalFlag) {
|
|
715
|
+
return [createCommanderOption(flags, field.description, field)];
|
|
716
|
+
}
|
|
717
|
+
const mainOption = createCommanderOption(`${flags} [value]`, field.description, field);
|
|
718
|
+
mainOption.preset(true);
|
|
719
|
+
// Commander v14 passes the preset value through argParser too, so guard with typeof check
|
|
720
|
+
mainOption.argParser((value) => (typeof value === "boolean" ? value : value));
|
|
721
|
+
return index === 0
|
|
722
|
+
? [mainOption, createCommanderOption(`--no-${field.optionFlag.slice(2)}`, field.description, field)]
|
|
723
|
+
: [mainOption];
|
|
724
|
+
}
|
|
725
|
+
if (field.schema.kind === "array") {
|
|
726
|
+
return [
|
|
727
|
+
createCommanderOption(`${flags} <value...>`, field.description, field).argParser((value, previous = []) => [...previous, value])
|
|
728
|
+
];
|
|
729
|
+
}
|
|
730
|
+
if (field.schema.kind === "json") {
|
|
731
|
+
return [createCommanderOption(`${flags} <json>`, field.description, field)];
|
|
732
|
+
}
|
|
733
|
+
const option = createCommanderOption(`${flags} <value>`, field.description, field);
|
|
734
|
+
return [option];
|
|
735
|
+
});
|
|
642
736
|
}
|
|
643
737
|
function resolveCLIControls(controls) {
|
|
738
|
+
const outputFormats = typeof controls?.output === "object" ? (controls.output.formats ?? {}) : {};
|
|
739
|
+
validateOutputFormats(outputFormats);
|
|
644
740
|
return {
|
|
645
741
|
debug: controls?.debug === true,
|
|
742
|
+
help: controls?.help === "concise" ? "concise" : "extended",
|
|
646
743
|
logLevel: controls?.logLevel === true,
|
|
647
|
-
output: controls?.output === true,
|
|
744
|
+
output: controls?.output === true || typeof controls?.output === "object",
|
|
745
|
+
outputFormats,
|
|
648
746
|
verbose: controls?.verbose === true,
|
|
649
747
|
yes: controls?.yes === true
|
|
650
748
|
};
|
|
651
749
|
}
|
|
750
|
+
const BUILT_IN_OUTPUT_FORMATS = ["rich", "md", "markdown", "json"];
|
|
751
|
+
function outputFormatNames(controls) {
|
|
752
|
+
return [...BUILT_IN_OUTPUT_FORMATS, ...Object.keys(controls.outputFormats)];
|
|
753
|
+
}
|
|
754
|
+
function validateOutputFormats(formats) {
|
|
755
|
+
for (const [name, renderer] of Object.entries(formats)) {
|
|
756
|
+
const hasWhitespace = name.split("").some((character) => character.trim() === "");
|
|
757
|
+
if (name.length === 0 || name.trim() !== name || hasWhitespace) {
|
|
758
|
+
throw new ToolcraftBugError(`Custom output format names must be non-empty and contain no whitespace: ${JSON.stringify(name)}.`);
|
|
759
|
+
}
|
|
760
|
+
if (BUILT_IN_OUTPUT_FORMATS.includes(name)) {
|
|
761
|
+
throw new ToolcraftBugError(`Custom output format "${name}" conflicts with a built-in format.`);
|
|
762
|
+
}
|
|
763
|
+
if (typeof renderer !== "function") {
|
|
764
|
+
throw new ToolcraftBugError(`Custom output format "${name}" must define a renderer function.`);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
652
768
|
function getGlobalLongOptionFlags(presetsEnabled, versionEnabled, controls) {
|
|
653
769
|
const flags = [];
|
|
654
770
|
if (presetsEnabled) {
|
|
@@ -702,11 +818,101 @@ function createCommanderOption(flags, description, field) {
|
|
|
702
818
|
}
|
|
703
819
|
return option;
|
|
704
820
|
}
|
|
705
|
-
function
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
821
|
+
function prepareCliArguments(program, argv, fieldLoaders, casing, controls) {
|
|
822
|
+
const normalized = argv.slice(0, 2);
|
|
823
|
+
const path = [];
|
|
824
|
+
let current = program;
|
|
825
|
+
let helpPath;
|
|
826
|
+
let output;
|
|
827
|
+
for (let index = 2; index < argv.length; index += 1) {
|
|
828
|
+
let token = argv[index];
|
|
829
|
+
if (token === "--") {
|
|
830
|
+
normalized.push(...argv.slice(index));
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
if (HELP_FLAGS.has(token)) {
|
|
834
|
+
helpPath ??= [...path];
|
|
835
|
+
normalized.push(token);
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (controls.verbose && token === "-v") {
|
|
839
|
+
token = "--verbose";
|
|
840
|
+
}
|
|
841
|
+
const dynamicFields = fieldLoaders.get(current)?.() ?? [];
|
|
842
|
+
const equalsIndex = token.startsWith("--") ? token.indexOf("=") : -1;
|
|
843
|
+
const flag = equalsIndex < 0 ? token : token.slice(0, equalsIndex);
|
|
844
|
+
let option = current.options.find((candidate) => candidate.long === flag || candidate.short === flag);
|
|
845
|
+
let attached = equalsIndex >= 0;
|
|
846
|
+
if (option === undefined && token.startsWith("-") && !token.startsWith("--") && token.length > 2) {
|
|
847
|
+
for (let offset = 1; offset < token.length; offset += 1) {
|
|
848
|
+
const candidate = current.options.find((entry) => entry.short === `-${token[offset]}`);
|
|
849
|
+
if (candidate === undefined) {
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
option = candidate;
|
|
853
|
+
if (candidate.required || candidate.optional) {
|
|
854
|
+
attached = offset < token.length - 1;
|
|
855
|
+
break;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
if (option !== undefined) {
|
|
860
|
+
normalized.push(token);
|
|
861
|
+
const next = argv[index + 1];
|
|
862
|
+
if (flag === "--output" && controls.output) {
|
|
863
|
+
output = attached ? token.slice(equalsIndex + 1) : next;
|
|
864
|
+
}
|
|
865
|
+
if (!attached && next !== undefined && (option.required ||
|
|
866
|
+
(option.optional && !(next.length > 1 && next.startsWith("-"))))) {
|
|
867
|
+
normalized.push(next);
|
|
868
|
+
index += 1;
|
|
869
|
+
}
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
const child = current.commands.find((command) => command.name() === token || command.aliases().includes(token));
|
|
873
|
+
if (child !== undefined) {
|
|
874
|
+
current = child;
|
|
875
|
+
path.push(token);
|
|
876
|
+
normalized.push(token);
|
|
877
|
+
continue;
|
|
878
|
+
}
|
|
879
|
+
const defaultName = getDefaultCommanderCommandName(current);
|
|
880
|
+
const defaultCommand = current.commands.find((command) => command.name() === defaultName);
|
|
881
|
+
if (defaultCommand !== undefined) {
|
|
882
|
+
current = defaultCommand;
|
|
883
|
+
index -= 1;
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
if (token.startsWith("--") && equalsIndex < 0) {
|
|
887
|
+
const normalizedFlag = token.startsWith("--no-") ? token.slice(5) : token.slice(2);
|
|
888
|
+
let dynamic;
|
|
889
|
+
try {
|
|
890
|
+
dynamic = resolveDynamicOption(dynamicFields, normalizedFlag, casing);
|
|
891
|
+
}
|
|
892
|
+
catch (error) {
|
|
893
|
+
if (!isUserError(error)) {
|
|
894
|
+
throw error;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
const next = argv[index + 1];
|
|
898
|
+
if (dynamic !== undefined && next !== undefined &&
|
|
899
|
+
dynamic.leaf.schema.kind !== "boolean" && dynamic.leaf.schema.kind !== "array") {
|
|
900
|
+
normalized.push(`${token}=${next}`);
|
|
901
|
+
index += 1;
|
|
902
|
+
continue;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (!token.startsWith("-") && current.commands.length > 0) {
|
|
906
|
+
path.push(token);
|
|
907
|
+
}
|
|
908
|
+
normalized.push(token);
|
|
909
|
+
}
|
|
910
|
+
return {
|
|
911
|
+
argv: normalized,
|
|
912
|
+
...(helpPath === undefined ? {} : {
|
|
913
|
+
helpArgv: [...argv.slice(0, 2), ...helpPath, ...(output === undefined ? [] : ["--output", output])]
|
|
914
|
+
})
|
|
915
|
+
};
|
|
710
916
|
}
|
|
711
917
|
function resolveHelpOutput(argv) {
|
|
712
918
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -804,13 +1010,44 @@ function appendHelpMetadata(description, metadata) {
|
|
|
804
1010
|
return description;
|
|
805
1011
|
}
|
|
806
1012
|
if (description.length === 0) {
|
|
807
|
-
return `(${
|
|
1013
|
+
return metadata.map((entry) => `(${entry})`).join(" ");
|
|
808
1014
|
}
|
|
809
|
-
return `${description}
|
|
1015
|
+
return `${description} ${metadata.map((entry) => `(${entry})`).join(" ")}`;
|
|
1016
|
+
}
|
|
1017
|
+
function normalizeHelpEchoKey(value) {
|
|
1018
|
+
let normalized = "";
|
|
1019
|
+
for (const character of value.trim().toLowerCase()) {
|
|
1020
|
+
if (character !== " " &&
|
|
1021
|
+
character !== "\t" &&
|
|
1022
|
+
character !== "\n" &&
|
|
1023
|
+
character !== "\r" &&
|
|
1024
|
+
character !== "_" &&
|
|
1025
|
+
character !== "." &&
|
|
1026
|
+
character !== "-") {
|
|
1027
|
+
normalized += character;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
return normalized;
|
|
1031
|
+
}
|
|
1032
|
+
function isEchoHelpDescription(description, name) {
|
|
1033
|
+
if (description.length === 0) {
|
|
1034
|
+
return false;
|
|
1035
|
+
}
|
|
1036
|
+
return normalizeHelpEchoKey(description) === normalizeHelpEchoKey(name);
|
|
1037
|
+
}
|
|
1038
|
+
function suppressEchoHelpDescription(description, name) {
|
|
1039
|
+
return isEchoHelpDescription(description, name) ? "" : description;
|
|
810
1040
|
}
|
|
811
1041
|
function formatHelpFieldDescription(field) {
|
|
812
|
-
const
|
|
1042
|
+
const rawDescription = field.description ?? field.displayPath;
|
|
1043
|
+
const description = suppressEchoHelpDescription(rawDescription, field.displayPath);
|
|
813
1044
|
const metadata = [];
|
|
1045
|
+
if (field.schema.kind === "enum" && field.schema.values.length <= 8) {
|
|
1046
|
+
const values = field.schema.values.map((value) => String(value)).join(", ");
|
|
1047
|
+
if (values.length <= 120) {
|
|
1048
|
+
metadata.push(`values: ${values}`);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
814
1051
|
if (!field.optional && !field.hasDefault) {
|
|
815
1052
|
metadata.push("required");
|
|
816
1053
|
}
|
|
@@ -960,53 +1197,55 @@ function formatDynamicHelpMetadata(field) {
|
|
|
960
1197
|
}
|
|
961
1198
|
return metadata;
|
|
962
1199
|
}
|
|
1200
|
+
function createHelpOptionRow(flags, description) {
|
|
1201
|
+
return {
|
|
1202
|
+
flags,
|
|
1203
|
+
flagTokens: tokenizeHelpFlags(flags),
|
|
1204
|
+
description
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
963
1207
|
function collectDynamicObjectHelpRows(schema, casing, optionPrefix, displayPrefix, metadata) {
|
|
964
1208
|
const rows = [];
|
|
965
1209
|
for (const [key, rawChildSchema] of Object.entries(schema.shape)) {
|
|
966
1210
|
const childSchema = unwrapOptional(rawChildSchema);
|
|
967
|
-
const optionFlag = `${optionPrefix}.${
|
|
1211
|
+
const optionFlag = `${optionPrefix}.${formatCLIName(key, casing)}`;
|
|
968
1212
|
const displayPath = `${displayPrefix}.${key}`;
|
|
969
|
-
const
|
|
1213
|
+
const rawDescription = childSchema.description ?? displayPath;
|
|
1214
|
+
const description = suppressEchoHelpDescription(rawDescription, displayPath);
|
|
970
1215
|
if (childSchema.kind === "object") {
|
|
971
1216
|
rows.push(...collectDynamicObjectHelpRows(childSchema, casing, optionFlag, displayPath, metadata));
|
|
972
1217
|
continue;
|
|
973
1218
|
}
|
|
974
1219
|
if (childSchema.kind === "record") {
|
|
975
|
-
rows.push({
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
})}>`,
|
|
991
|
-
description: appendHelpMetadata(description, metadata)
|
|
992
|
-
});
|
|
1220
|
+
rows.push(createHelpOptionRow(`${optionFlag}.<key> <${describeDynamicFieldType({
|
|
1221
|
+
...{
|
|
1222
|
+
id: displayPath,
|
|
1223
|
+
path: [],
|
|
1224
|
+
displayPath,
|
|
1225
|
+
optionPath: [],
|
|
1226
|
+
optionPathDisplay: `${displayPath}.<key>`,
|
|
1227
|
+
optionFlag: `${optionFlag}.<key>`,
|
|
1228
|
+
optional: false,
|
|
1229
|
+
hasDefault: false,
|
|
1230
|
+
defaultValue: undefined,
|
|
1231
|
+
requiredWhenActive: false,
|
|
1232
|
+
schema: childSchema
|
|
1233
|
+
}
|
|
1234
|
+
})}>`, appendHelpMetadata(description, metadata)));
|
|
993
1235
|
continue;
|
|
994
1236
|
}
|
|
995
1237
|
if (childSchema.kind === "array" && unwrapOptional(childSchema.item).kind === "object") {
|
|
996
1238
|
rows.push(...collectDynamicObjectHelpRows(unwrapOptional(childSchema.item), casing, `${optionFlag}.<index>`, `${displayPath}.<index>`, metadata));
|
|
997
1239
|
continue;
|
|
998
1240
|
}
|
|
999
|
-
rows.push(
|
|
1000
|
-
|
|
1001
|
-
?
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
})}>`,
|
|
1008
|
-
description: appendHelpMetadata(description, metadata)
|
|
1009
|
-
});
|
|
1241
|
+
rows.push(createHelpOptionRow(childSchema.kind === "boolean"
|
|
1242
|
+
? childSchema.default === true
|
|
1243
|
+
? `--no-${optionFlag.slice(2)}`
|
|
1244
|
+
: optionFlag
|
|
1245
|
+
: `${optionFlag} <${describeHelpValueToken(childSchema, {
|
|
1246
|
+
displayPath,
|
|
1247
|
+
optionFlag
|
|
1248
|
+
})}>`, appendHelpMetadata(description, metadata)));
|
|
1010
1249
|
}
|
|
1011
1250
|
return rows;
|
|
1012
1251
|
}
|
|
@@ -1025,17 +1264,11 @@ function formatDynamicHelpFields(field, casing) {
|
|
|
1025
1264
|
}
|
|
1026
1265
|
}
|
|
1027
1266
|
return [
|
|
1028
|
-
{
|
|
1029
|
-
flags: `${field.optionFlag} <${describeDynamicFieldType(field)}>`,
|
|
1030
|
-
description: appendHelpMetadata(field.description ?? field.optionPathDisplay, metadata)
|
|
1031
|
-
}
|
|
1267
|
+
createHelpOptionRow(`${field.optionFlag} <${describeDynamicFieldType(field)}>`, appendHelpMetadata(suppressEchoHelpDescription(field.description ?? field.optionPathDisplay, field.optionPathDisplay), metadata))
|
|
1032
1268
|
];
|
|
1033
1269
|
}
|
|
1034
1270
|
function formatSecretRows(secrets) {
|
|
1035
|
-
return Object.values(secrets).map((secret) => (
|
|
1036
|
-
flags: secret.env,
|
|
1037
|
-
description: formatSecretDescription(secret)
|
|
1038
|
-
}));
|
|
1271
|
+
return Object.values(secrets).map((secret) => createHelpOptionRow(secret.env, formatSecretDescription(secret)));
|
|
1039
1272
|
}
|
|
1040
1273
|
function formatSecretDescription(secret) {
|
|
1041
1274
|
if (secret.description !== undefined && secret.description.length > 0) {
|
|
@@ -1064,34 +1297,160 @@ function formatExampleCommand(breadcrumb, rootUsageName, params) {
|
|
|
1064
1297
|
function formatExampleRows(examples, breadcrumb, rootUsageName) {
|
|
1065
1298
|
return examples.map((example) => `${example.title}\n ${formatExampleCommand(breadcrumb, rootUsageName, example.params)}`);
|
|
1066
1299
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1300
|
+
const MAX_INLINE_OPTIONAL_PARAMETER_TOKENS = 8;
|
|
1301
|
+
/** Mirrors the fallback width used by the design system's column layout. */
|
|
1302
|
+
const DEFAULT_HELP_TOTAL_WIDTH = 100;
|
|
1303
|
+
function tokenizeHelpFlags(flags) {
|
|
1304
|
+
const tokens = [];
|
|
1305
|
+
let index = 0;
|
|
1306
|
+
while (index < flags.length) {
|
|
1307
|
+
if (flags[index] === " ") {
|
|
1308
|
+
let end = index + 1;
|
|
1309
|
+
while (end < flags.length && flags[end] === " ") {
|
|
1310
|
+
end += 1;
|
|
1311
|
+
}
|
|
1312
|
+
tokens.push({ text: flags.slice(index, end), role: "literal" });
|
|
1313
|
+
index = end;
|
|
1314
|
+
continue;
|
|
1315
|
+
}
|
|
1316
|
+
if (flags[index] === "[" || flags[index] === "]") {
|
|
1317
|
+
tokens.push({ text: flags[index], role: "dim" });
|
|
1318
|
+
index += 1;
|
|
1319
|
+
continue;
|
|
1320
|
+
}
|
|
1321
|
+
if (flags[index] === "<") {
|
|
1322
|
+
const close = flags.indexOf(">", index);
|
|
1323
|
+
if (close === -1) {
|
|
1324
|
+
tokens.push({ text: flags.slice(index), role: "literal" });
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
tokens.push({ text: flags.slice(index, close + 1), role: "argument" });
|
|
1328
|
+
index = close + 1;
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
if (flags.startsWith("--", index) ||
|
|
1332
|
+
(flags[index] === "-" && flags[index + 1] !== undefined && flags[index + 1] !== "-")) {
|
|
1333
|
+
let end = index + 1;
|
|
1334
|
+
while (end < flags.length &&
|
|
1335
|
+
flags[end] !== " " &&
|
|
1336
|
+
flags[end] !== "[" &&
|
|
1337
|
+
flags[end] !== "]" &&
|
|
1338
|
+
flags[end] !== "<") {
|
|
1339
|
+
end += 1;
|
|
1340
|
+
}
|
|
1341
|
+
tokens.push({ text: flags.slice(index, end), role: "option" });
|
|
1342
|
+
index = end;
|
|
1343
|
+
continue;
|
|
1344
|
+
}
|
|
1345
|
+
// Enum literals (a|b) or bare words after a flag.
|
|
1346
|
+
let end = index + 1;
|
|
1347
|
+
while (end < flags.length &&
|
|
1348
|
+
flags[end] !== " " &&
|
|
1349
|
+
flags[end] !== "[" &&
|
|
1350
|
+
flags[end] !== "]" &&
|
|
1351
|
+
flags[end] !== "<") {
|
|
1352
|
+
end += 1;
|
|
1353
|
+
}
|
|
1354
|
+
const piece = flags.slice(index, end);
|
|
1355
|
+
tokens.push({
|
|
1356
|
+
text: piece,
|
|
1357
|
+
role: piece.includes("|") ? "literal" : piece.startsWith("+") ? "dim" : "literal"
|
|
1358
|
+
});
|
|
1359
|
+
index = end;
|
|
1360
|
+
}
|
|
1361
|
+
return tokens;
|
|
1362
|
+
}
|
|
1363
|
+
function wrapOptionalParameterTokens(tokens, optional) {
|
|
1364
|
+
if (!optional) {
|
|
1365
|
+
return tokens;
|
|
1366
|
+
}
|
|
1367
|
+
return [{ text: "[", role: "dim" }, ...tokens, { text: "]", role: "dim" }];
|
|
1368
|
+
}
|
|
1369
|
+
function createCommandParameterToken(text, optional) {
|
|
1370
|
+
return {
|
|
1371
|
+
text: optional ? `[${text}]` : text,
|
|
1372
|
+
optional,
|
|
1373
|
+
tokens: wrapOptionalParameterTokens(tokenizeHelpFlags(text), optional)
|
|
1374
|
+
};
|
|
1069
1375
|
}
|
|
1070
1376
|
function formatCommandDynamicParameterTokens(field, casing) {
|
|
1071
1377
|
const optional = field.optional || field.hasDefault;
|
|
1072
|
-
return formatDynamicHelpFields(field, casing).map((row) =>
|
|
1378
|
+
return formatDynamicHelpFields(field, casing).map((row) => createCommandParameterToken(row.flags, optional));
|
|
1073
1379
|
}
|
|
1074
1380
|
function formatCommandParameterTokens(command, casing, globalLongOptionFlags) {
|
|
1075
1381
|
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
1076
1382
|
const fields = assignPositionals(collected.fields, command.positional);
|
|
1077
1383
|
return fields
|
|
1078
1384
|
.filter((field) => field.global !== true)
|
|
1079
|
-
.map((field) =>
|
|
1385
|
+
.map((field) => createCommandParameterToken(formatCommandParameterFieldFlags(field, globalLongOptionFlags), field.positionalIndex === undefined && (field.optional || field.hasDefault)))
|
|
1080
1386
|
.concat(collected.dynamicFields.flatMap((field) => formatCommandDynamicParameterTokens(field, casing)));
|
|
1081
1387
|
}
|
|
1082
|
-
function
|
|
1388
|
+
function collapseOptionalParameterTokens(parameterTokens, inlineWidthBudget = Number.POSITIVE_INFINITY) {
|
|
1389
|
+
const optionalCount = parameterTokens.filter((token) => token.optional).length;
|
|
1390
|
+
if (optionalCount === 0) {
|
|
1391
|
+
return parameterTokens;
|
|
1392
|
+
}
|
|
1393
|
+
const inlineWidth = parameterTokens.reduce((total, token) => total + token.text.length + 1, 0);
|
|
1394
|
+
if (optionalCount <= MAX_INLINE_OPTIONAL_PARAMETER_TOKENS && inlineWidth <= inlineWidthBudget) {
|
|
1395
|
+
return parameterTokens;
|
|
1396
|
+
}
|
|
1397
|
+
const required = parameterTokens.filter((token) => !token.optional);
|
|
1398
|
+
const collapsedText = `+${optionalCount} options`;
|
|
1399
|
+
return [
|
|
1400
|
+
...required,
|
|
1401
|
+
{
|
|
1402
|
+
text: `[${collapsedText}]`,
|
|
1403
|
+
optional: true,
|
|
1404
|
+
tokens: [
|
|
1405
|
+
{ text: "[", role: "dim" },
|
|
1406
|
+
{ text: collapsedText, role: "dim" },
|
|
1407
|
+
{ text: "]", role: "dim" }
|
|
1408
|
+
]
|
|
1409
|
+
}
|
|
1410
|
+
];
|
|
1411
|
+
}
|
|
1412
|
+
function formatCommandRowNameTokens(node, casing, globalLongOptionFlags) {
|
|
1083
1413
|
const baseName = node.aliases.length === 0 ? node.name : `${node.name} (${node.aliases.join(", ")})`;
|
|
1414
|
+
const nameTokens = [{ text: baseName, role: "command" }];
|
|
1415
|
+
// formatCommandList indents rows by two columns, so anything wider than the rest of the
|
|
1416
|
+
// terminal wraps onto continuation lines and makes the command list unreadable.
|
|
1417
|
+
const inlineWidthBudget = Math.max(0, (process.stdout.columns ?? DEFAULT_HELP_TOTAL_WIDTH) - 2 - baseName.length);
|
|
1084
1418
|
const parameterTokens = node.kind === "command"
|
|
1085
|
-
? formatCommandParameterTokens(node, casing, globalLongOptionFlags)
|
|
1419
|
+
? collapseOptionalParameterTokens(formatCommandParameterTokens(node, casing, globalLongOptionFlags), inlineWidthBudget)
|
|
1086
1420
|
: [];
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1421
|
+
for (const token of parameterTokens) {
|
|
1422
|
+
nameTokens.push({ text: " ", role: "literal" }, ...token.tokens);
|
|
1423
|
+
}
|
|
1424
|
+
const name = parameterTokens.length === 0
|
|
1425
|
+
? baseName
|
|
1426
|
+
: `${baseName} ${parameterTokens.map((token) => token.text).join(" ")}`;
|
|
1427
|
+
return { name, nameTokens };
|
|
1089
1428
|
}
|
|
1090
|
-
function formatCommandRows(group, scope, casing, globalLongOptionFlags) {
|
|
1091
|
-
|
|
1092
|
-
name
|
|
1093
|
-
|
|
1094
|
-
|
|
1429
|
+
function formatCommandRows(group, scope, casing, globalLongOptionFlags, help) {
|
|
1430
|
+
const toRow = (child, depth) => {
|
|
1431
|
+
const { name, nameTokens } = formatCommandRowNameTokens(child, casing, globalLongOptionFlags);
|
|
1432
|
+
return {
|
|
1433
|
+
name,
|
|
1434
|
+
nameTokens,
|
|
1435
|
+
description: suppressEchoHelpDescription(child.description ?? "", child.name),
|
|
1436
|
+
kind: child.kind,
|
|
1437
|
+
depth
|
|
1438
|
+
};
|
|
1439
|
+
};
|
|
1440
|
+
if (help === "concise") {
|
|
1441
|
+
return getHelpChildren(group, scope).map((child) => toRow(child, 0));
|
|
1442
|
+
}
|
|
1443
|
+
const rows = [];
|
|
1444
|
+
const visit = (node, depth) => {
|
|
1445
|
+
for (const child of getHelpChildren(node, scope)) {
|
|
1446
|
+
rows.push(toRow(child, depth));
|
|
1447
|
+
if (child.kind === "group") {
|
|
1448
|
+
visit(child, depth + 1);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
visit(group, 0);
|
|
1453
|
+
return rows;
|
|
1095
1454
|
}
|
|
1096
1455
|
function formatGlobalOptionsLine(ctx) {
|
|
1097
1456
|
const flags = [];
|
|
@@ -1102,7 +1461,7 @@ function formatGlobalOptionsLine(ctx) {
|
|
|
1102
1461
|
flags.push("--yes");
|
|
1103
1462
|
}
|
|
1104
1463
|
if (ctx.controls.output) {
|
|
1105
|
-
flags.push(
|
|
1464
|
+
flags.push(`--output <${outputFormatNames(ctx.controls).join("|")}>`);
|
|
1106
1465
|
}
|
|
1107
1466
|
if (ctx.controls.verbose) {
|
|
1108
1467
|
flags.push("-v, --verbose");
|
|
@@ -1110,10 +1469,10 @@ function formatGlobalOptionsLine(ctx) {
|
|
|
1110
1469
|
if (ctx.showVersion) {
|
|
1111
1470
|
flags.push("--version");
|
|
1112
1471
|
}
|
|
1113
|
-
return flags.length > 0 ? `${text.section("Options:")} ${flags.join(" ")}` : "";
|
|
1472
|
+
return flags.length > 0 ? `${text.section("Global Options:")} ${flags.join(" ")}` : "";
|
|
1114
1473
|
}
|
|
1115
1474
|
function formatLeafGlobalOptionsLine(ctx) {
|
|
1116
|
-
return ctx.controls.verbose ? `${text.section("Options:")} -v, --verbose` : "";
|
|
1475
|
+
return ctx.controls.verbose ? `${text.section("Global Options:")} -v, --verbose` : "";
|
|
1117
1476
|
}
|
|
1118
1477
|
function collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags) {
|
|
1119
1478
|
const seen = new Map();
|
|
@@ -1131,10 +1490,7 @@ function collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlag
|
|
|
1131
1490
|
if (seen.has(dedupeKey)) {
|
|
1132
1491
|
continue;
|
|
1133
1492
|
}
|
|
1134
|
-
seen.set(dedupeKey,
|
|
1135
|
-
flags: formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
1136
|
-
description: formatHelpFieldDescription(field)
|
|
1137
|
-
});
|
|
1493
|
+
seen.set(dedupeKey, createHelpOptionRow(formatHelpFieldFlags(field, globalLongOptionFlags), formatHelpFieldDescription(field)));
|
|
1138
1494
|
}
|
|
1139
1495
|
return;
|
|
1140
1496
|
}
|
|
@@ -1158,6 +1514,18 @@ function formatHelpOptionList(rows) {
|
|
|
1158
1514
|
? helpFormatterPlain.formatOptionList(rows)
|
|
1159
1515
|
: formatOptionList(rows);
|
|
1160
1516
|
}
|
|
1517
|
+
function sortLeafHelpOptionFields(fields) {
|
|
1518
|
+
const required = [];
|
|
1519
|
+
const optional = [];
|
|
1520
|
+
for (const field of fields) {
|
|
1521
|
+
if (!field.optional && !field.hasDefault) {
|
|
1522
|
+
required.push(field);
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
optional.push(field);
|
|
1526
|
+
}
|
|
1527
|
+
return [...required, ...optional];
|
|
1528
|
+
}
|
|
1161
1529
|
function buildUsageLine(breadcrumb, rootUsageName, suffix) {
|
|
1162
1530
|
const visibleBreadcrumb = breadcrumb.filter((segment) => segment.length > 0);
|
|
1163
1531
|
const usageBreadcrumb = breadcrumb[0] === "" ? [rootUsageName, ...visibleBreadcrumb] : visibleBreadcrumb;
|
|
@@ -1169,28 +1537,51 @@ function formatGroupUsageSuffix(group, scope, casing, globalLongOptionFlags) {
|
|
|
1169
1537
|
if (group.default !== undefined &&
|
|
1170
1538
|
group.default.hidden === true &&
|
|
1171
1539
|
group.default.scope.includes(scope)) {
|
|
1172
|
-
const parameterTokens = formatCommandParameterTokens(group.default, casing, globalLongOptionFlags);
|
|
1173
|
-
return ["[command]", "[OPTIONS]", ...parameterTokens].join(" ");
|
|
1540
|
+
const parameterTokens = collapseOptionalParameterTokens(formatCommandParameterTokens(group.default, casing, globalLongOptionFlags));
|
|
1541
|
+
return ["[command]", "[OPTIONS]", ...parameterTokens.map((token) => token.text)].join(" ");
|
|
1174
1542
|
}
|
|
1175
1543
|
return "[command] [OPTIONS]";
|
|
1176
1544
|
}
|
|
1545
|
+
function formatHelpDrillDownFooter(rootUsageName) {
|
|
1546
|
+
return text.muted(`Run ${rootUsageName} <command> --help for full options.`);
|
|
1547
|
+
}
|
|
1548
|
+
function formatStyledUsageLine(usageLine) {
|
|
1549
|
+
const parts = usageLine.split(" ").filter((part) => part.length > 0);
|
|
1550
|
+
if (parts.length === 0) {
|
|
1551
|
+
return text.usageCommand(usageLine);
|
|
1552
|
+
}
|
|
1553
|
+
const commandEnd = parts.findIndex((part) => part.startsWith("-") || part.startsWith("[") || part.startsWith("<"));
|
|
1554
|
+
const commandParts = commandEnd === -1 ? parts : parts.slice(0, commandEnd);
|
|
1555
|
+
const argParts = commandEnd === -1 ? [] : parts.slice(commandEnd);
|
|
1556
|
+
const command = commandParts.join(" ");
|
|
1557
|
+
if (argParts.length === 0) {
|
|
1558
|
+
return text.usageCommand(command);
|
|
1559
|
+
}
|
|
1560
|
+
return `${text.usageCommand(command)} ${renderHelpTokens(argParts.flatMap((part, index) => [
|
|
1561
|
+
...(index === 0 ? [] : [{ text: " ", role: "literal" }]),
|
|
1562
|
+
...tokenizeHelpFlags(part)
|
|
1563
|
+
]))}`;
|
|
1564
|
+
}
|
|
1177
1565
|
function renderGroupHelp(group, breadcrumb, scope, casing, globalOptions, rootUsageName, isRoot) {
|
|
1178
1566
|
const sections = [];
|
|
1179
1567
|
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1180
|
-
const commandRows = formatCommandRows(group, scope, casing, globalLongOptionFlags);
|
|
1568
|
+
const commandRows = formatCommandRows(group, scope, casing, globalLongOptionFlags, globalOptions.controls.help);
|
|
1181
1569
|
if (commandRows.length > 0) {
|
|
1182
|
-
sections.push(`${text.
|
|
1570
|
+
sections.push(`${text.section("Commands:")}\n${formatHelpCommandList(commandRows)}`);
|
|
1183
1571
|
}
|
|
1184
1572
|
if (isRoot) {
|
|
1185
1573
|
const schemaGlobalRows = collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags);
|
|
1186
1574
|
const builtInLine = formatGlobalOptionsLine(globalOptions);
|
|
1187
1575
|
if (schemaGlobalRows.length > 0) {
|
|
1188
|
-
sections.push(`${text.
|
|
1576
|
+
sections.push(`${text.section("Options:")}\n${formatHelpOptionList(schemaGlobalRows)}\n${builtInLine}`);
|
|
1189
1577
|
}
|
|
1190
1578
|
else {
|
|
1191
1579
|
sections.push(builtInLine);
|
|
1192
1580
|
}
|
|
1193
1581
|
}
|
|
1582
|
+
if (commandRows.length > 0) {
|
|
1583
|
+
sections.push(formatHelpDrillDownFooter(rootUsageName));
|
|
1584
|
+
}
|
|
1194
1585
|
return renderHelpDocument({
|
|
1195
1586
|
breadcrumb,
|
|
1196
1587
|
rootUsageName,
|
|
@@ -1205,15 +1596,19 @@ function renderLeafHelp(command, breadcrumb, casing, globalOptions, rootUsageNam
|
|
|
1205
1596
|
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1206
1597
|
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
1207
1598
|
const fields = assignPositionals(collected.fields, command.positional);
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1599
|
+
const localFields = fields.filter((field) => field.global !== true);
|
|
1600
|
+
const toHelpRow = (field) => createHelpOptionRow(formatHelpFieldFlags(field, globalLongOptionFlags), formatHelpFieldDescription(field));
|
|
1601
|
+
const argumentRows = localFields
|
|
1602
|
+
.filter((field) => field.positionalIndex !== undefined)
|
|
1603
|
+
.map(toHelpRow);
|
|
1604
|
+
const optionRows = sortLeafHelpOptionFields(localFields.filter((field) => field.positionalIndex === undefined))
|
|
1605
|
+
.map(toHelpRow)
|
|
1214
1606
|
.concat(collected.dynamicFields.flatMap((field) => formatDynamicHelpFields(field, casing)));
|
|
1607
|
+
if (argumentRows.length > 0) {
|
|
1608
|
+
sections.push(`${text.section("Arguments:")}\n${formatHelpOptionList(argumentRows)}`);
|
|
1609
|
+
}
|
|
1215
1610
|
if (optionRows.length > 0) {
|
|
1216
|
-
sections.push(`${text.
|
|
1611
|
+
sections.push(`${text.section("Options:")}\n${formatHelpOptionList(optionRows)}`);
|
|
1217
1612
|
}
|
|
1218
1613
|
const builtInLine = formatLeafGlobalOptionsLine(globalOptions);
|
|
1219
1614
|
if (builtInLine.length > 0) {
|
|
@@ -1221,10 +1616,10 @@ function renderLeafHelp(command, breadcrumb, casing, globalOptions, rootUsageNam
|
|
|
1221
1616
|
}
|
|
1222
1617
|
const secretRows = formatSecretRows(command.secrets);
|
|
1223
1618
|
if (secretRows.length > 0) {
|
|
1224
|
-
sections.push(`${text.
|
|
1619
|
+
sections.push(`${text.section("Secrets (environment):")}\n${formatHelpOptionList(secretRows)}`);
|
|
1225
1620
|
}
|
|
1226
1621
|
if (command.examples.length > 0) {
|
|
1227
|
-
sections.push(`${text.
|
|
1622
|
+
sections.push(`${text.section("Examples:")}\n${formatExampleRows(command.examples, breadcrumb, rootUsageName).join("\n")}`);
|
|
1228
1623
|
}
|
|
1229
1624
|
const positionalFields = fields.filter((f) => f.positionalIndex !== undefined);
|
|
1230
1625
|
const usageSuffix = positionalFields.length > 0
|
|
@@ -1243,7 +1638,7 @@ function renderJsonHelp(target, root, casing, globalOptions, rootUsageName) {
|
|
|
1243
1638
|
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1244
1639
|
const node = target.node;
|
|
1245
1640
|
if (node.kind === "group") {
|
|
1246
|
-
const commandRows = formatCommandRows(node, "cli", casing, globalLongOptionFlags);
|
|
1641
|
+
const commandRows = formatCommandRows(node, "cli", casing, globalLongOptionFlags, globalOptions.controls.help);
|
|
1247
1642
|
const isRoot = node === root;
|
|
1248
1643
|
return `${JSON.stringify({
|
|
1249
1644
|
schemaVersion: 1,
|
|
@@ -1252,7 +1647,12 @@ function renderJsonHelp(target, root, casing, globalOptions, rootUsageName) {
|
|
|
1252
1647
|
path: target.breadcrumb.filter((segment) => segment.length > 0),
|
|
1253
1648
|
usage: buildUsageLine(target.breadcrumb, rootUsageName, formatGroupUsageSuffix(node, "cli", casing, globalLongOptionFlags)),
|
|
1254
1649
|
...(node.description === undefined ? {} : { description: node.description }),
|
|
1255
|
-
commands: commandRows.map((row) => ({
|
|
1650
|
+
commands: commandRows.map((row) => ({
|
|
1651
|
+
name: row.name,
|
|
1652
|
+
description: row.description,
|
|
1653
|
+
kind: row.kind,
|
|
1654
|
+
depth: row.depth
|
|
1655
|
+
})),
|
|
1256
1656
|
options: isRoot
|
|
1257
1657
|
? collectSchemaGlobalFieldRows(node, "cli", casing, globalLongOptionFlags).map((row) => ({
|
|
1258
1658
|
name: row.flags.split(/[ ,]+/)[0]?.replace(/^--/, "") ?? row.flags,
|
|
@@ -1294,12 +1694,20 @@ function formatJsonHelpOption(field, globalLongOptionFlags) {
|
|
|
1294
1694
|
name: field.displayPath,
|
|
1295
1695
|
flags: formatHelpFieldFlags(field, globalLongOptionFlags).split(", "),
|
|
1296
1696
|
type: formatJsonHelpSchemaType(field.schema),
|
|
1697
|
+
...(field.schema.kind === "enum" ? { choices: formatCLIEnumChoices(field.schema) } : {}),
|
|
1297
1698
|
...(field.description === undefined ? {} : { description: field.description }),
|
|
1298
1699
|
required: field.requiredWhenActive,
|
|
1299
1700
|
...(field.hasDefault ? { default: field.defaultValue } : {}),
|
|
1300
1701
|
...(field.positionalIndex === undefined ? {} : { positional: true })
|
|
1301
1702
|
};
|
|
1302
1703
|
}
|
|
1704
|
+
function formatCLIEnumChoices(schema) {
|
|
1705
|
+
const choices = schema.values.map((value) => String(value));
|
|
1706
|
+
if (schema.nullable === true && !choices.includes("null")) {
|
|
1707
|
+
choices.push("null");
|
|
1708
|
+
}
|
|
1709
|
+
return choices;
|
|
1710
|
+
}
|
|
1303
1711
|
function formatJsonHelpSchemaType(schema) {
|
|
1304
1712
|
if (schema.kind === "enum") {
|
|
1305
1713
|
return "enum";
|
|
@@ -1323,7 +1731,7 @@ function renderHelpDocument(input) {
|
|
|
1323
1731
|
if (remainingDescription.length > 0) {
|
|
1324
1732
|
lines.push(remainingDescription, "");
|
|
1325
1733
|
}
|
|
1326
|
-
lines.push(`Usage: ${
|
|
1734
|
+
lines.push(`Usage: ${formatStyledUsageLine(input.usageLine)}`, "");
|
|
1327
1735
|
if (input.requiresAuth) {
|
|
1328
1736
|
lines.push("Requires: authentication");
|
|
1329
1737
|
}
|
|
@@ -1333,21 +1741,22 @@ function renderHelpDocument(input) {
|
|
|
1333
1741
|
lines.push(renderHelpSections(input.sections));
|
|
1334
1742
|
return `${lines.join("\n").trimEnd()}\n`;
|
|
1335
1743
|
}
|
|
1336
|
-
async function renderGeneratedHelp(root, argv, options) {
|
|
1744
|
+
async function renderGeneratedHelp(root, argv, options, invocation) {
|
|
1745
|
+
const write = invocation?.write ?? ((chunk) => { process.stdout.write(chunk); });
|
|
1337
1746
|
const output = resolveHelpOutput(argv);
|
|
1338
1747
|
const casing = options.casing ?? "kebab";
|
|
1339
1748
|
const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
|
|
1340
1749
|
const target = resolveHelpTarget(root, argv, "cli", rootUsageName, options.rootDisplayName);
|
|
1341
1750
|
const controls = resolveCLIControls(options.controls);
|
|
1342
1751
|
if (output === "json") {
|
|
1343
|
-
|
|
1752
|
+
write(renderJsonHelp(target, root, casing, {
|
|
1344
1753
|
controls,
|
|
1345
1754
|
showVersion: options.version !== undefined,
|
|
1346
1755
|
presetsEnabled: options.presets === true
|
|
1347
1756
|
}, rootUsageName));
|
|
1348
1757
|
return;
|
|
1349
1758
|
}
|
|
1350
|
-
await withOutputFormat(output, async () => {
|
|
1759
|
+
await withOutputFormat(toDesignSystemOutput(output), async () => {
|
|
1351
1760
|
const rendered = target.node.kind === "group"
|
|
1352
1761
|
? renderGroupHelp(target.node, target.breadcrumb, "cli", casing, {
|
|
1353
1762
|
controls,
|
|
@@ -1359,21 +1768,20 @@ async function renderGeneratedHelp(root, argv, options) {
|
|
|
1359
1768
|
showVersion: options.version !== undefined,
|
|
1360
1769
|
presetsEnabled: options.presets === true
|
|
1361
1770
|
}, rootUsageName);
|
|
1362
|
-
|
|
1771
|
+
write(rendered);
|
|
1363
1772
|
});
|
|
1364
1773
|
}
|
|
1365
|
-
function createNodeCommand(node, casing, globalLongOptionFlags, execute, presetsEnabled, controls, pathSegments = []) {
|
|
1774
|
+
function createNodeCommand(node, casing, globalLongOptionFlags, execute, presetsEnabled, controls, fieldLoaders, pathSegments = []) {
|
|
1366
1775
|
const nextPathSegments = [...pathSegments, node.name];
|
|
1367
1776
|
if (node.kind === "command") {
|
|
1368
1777
|
if (!node.scope.includes("cli")) {
|
|
1369
1778
|
return null;
|
|
1370
1779
|
}
|
|
1371
1780
|
const command = new CommanderCommand(node.name);
|
|
1781
|
+
let unknownArgv = [];
|
|
1782
|
+
let loadedFields;
|
|
1372
1783
|
Reflect.set(command, "_toolcraftHidden", node.hidden);
|
|
1373
1784
|
Reflect.set(command, "_toolcraftOriginalName", node.name);
|
|
1374
|
-
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
1375
|
-
const fields = assignPositionals(collected.fields, node.positional);
|
|
1376
|
-
validateUniqueOptionFlags(fields, globalLongOptionFlags);
|
|
1377
1785
|
if (node.description !== undefined) {
|
|
1378
1786
|
command.description(node.description);
|
|
1379
1787
|
}
|
|
@@ -1381,33 +1789,64 @@ function createNodeCommand(node, casing, globalLongOptionFlags, execute, presets
|
|
|
1381
1789
|
command.addHelpCommand(false);
|
|
1382
1790
|
addGlobalOptions(command, presetsEnabled, controls);
|
|
1383
1791
|
command.allowExcessArguments(true);
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1792
|
+
fieldLoaders.set(command, () => {
|
|
1793
|
+
if (loadedFields !== undefined) {
|
|
1794
|
+
return loadedFields;
|
|
1795
|
+
}
|
|
1796
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
1797
|
+
const fields = assignPositionals(collected.fields, node.positional);
|
|
1798
|
+
validateUniqueOptionFlags(fields, globalLongOptionFlags);
|
|
1799
|
+
if (collected.dynamicFields.length > 0) {
|
|
1800
|
+
command.allowUnknownOption(true);
|
|
1801
|
+
}
|
|
1802
|
+
const numericArrayOptions = new Set();
|
|
1803
|
+
for (const field of fields) {
|
|
1804
|
+
if (field.positionalIndex !== undefined) {
|
|
1805
|
+
// Positionals are declared optional so resolveParams stays the single owner of argument
|
|
1806
|
+
// validation: Commander would otherwise report a missing positional in its own words
|
|
1807
|
+
// before prompts, defaults, and presets have had a chance to supply the value.
|
|
1808
|
+
command.argument(field.variadicPosition === true ? `[${field.displayPath}...]` : `[${field.displayPath}]`);
|
|
1809
|
+
continue;
|
|
1810
|
+
}
|
|
1811
|
+
for (const option of createOption(field, globalLongOptionFlags)) {
|
|
1812
|
+
command.addOption(option);
|
|
1813
|
+
if (field.schema.kind === "array" && unwrapOptional(field.schema.item).kind === "number") {
|
|
1814
|
+
numericArrayOptions.add(option);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1391
1817
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1818
|
+
const parseOptions = command.parseOptions.bind(command);
|
|
1819
|
+
command.parseOptions = (argv) => {
|
|
1820
|
+
const parsed = parseOptions(normalizeNumericArrayOptions(argv, command.options, numericArrayOptions));
|
|
1821
|
+
const firstUnknownOption = parsed.unknown.findIndex((token) => token.length > 1 && token.startsWith("-") && !isNegativeNumericToken(token));
|
|
1822
|
+
const operandCount = firstUnknownOption < 0 ? parsed.unknown.length : firstUnknownOption;
|
|
1823
|
+
parsed.operands.push(...parsed.unknown.splice(0, operandCount));
|
|
1824
|
+
if (parsed.unknown[0] === "--") {
|
|
1825
|
+
parsed.operands.push(...parsed.unknown.slice(1));
|
|
1826
|
+
parsed.unknown.length = 0;
|
|
1827
|
+
}
|
|
1828
|
+
unknownArgv = parsed.unknown;
|
|
1829
|
+
return parsed;
|
|
1830
|
+
};
|
|
1831
|
+
command.action(async (...args) => {
|
|
1832
|
+
const actionCommand = args[args.length - 1];
|
|
1833
|
+
const positionalValues = actionCommand.args.slice(0, actionCommand.args.length - unknownArgv.length);
|
|
1834
|
+
await execute({
|
|
1835
|
+
command: node,
|
|
1836
|
+
commandPath: nextPathSegments.join("."),
|
|
1837
|
+
declarationPath: nextPathSegments,
|
|
1838
|
+
casing,
|
|
1839
|
+
dynamicFields: collected.dynamicFields,
|
|
1840
|
+
fields,
|
|
1841
|
+
positionalValues,
|
|
1842
|
+
presetsEnabled,
|
|
1843
|
+
rawArgv: unknownArgv,
|
|
1844
|
+
actionCommand,
|
|
1845
|
+
variants: collected.variants
|
|
1846
|
+
});
|
|
1410
1847
|
});
|
|
1848
|
+
loadedFields = collected.dynamicFields;
|
|
1849
|
+
return loadedFields;
|
|
1411
1850
|
});
|
|
1412
1851
|
return command;
|
|
1413
1852
|
}
|
|
@@ -1418,7 +1857,7 @@ function createNodeCommand(node, casing, globalLongOptionFlags, execute, presets
|
|
|
1418
1857
|
.filter((child) => !isNodeVisibleInScope(child, "cli"))
|
|
1419
1858
|
.flatMap((child) => getNodeCommandNames(child));
|
|
1420
1859
|
const visibleChildren = node.children
|
|
1421
|
-
.map((child) => createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls, nextPathSegments))
|
|
1860
|
+
.map((child) => createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls, fieldLoaders, nextPathSegments))
|
|
1422
1861
|
.filter((child) => child !== null);
|
|
1423
1862
|
const group = new CommanderCommand(node.name);
|
|
1424
1863
|
Reflect.set(group, "_toolcraftReservedChildNames", reservedChildNames);
|
|
@@ -1476,6 +1915,155 @@ function getToolcraftReservedChildNames(command) {
|
|
|
1476
1915
|
function getNodeCommandNames(node) {
|
|
1477
1916
|
return [node.name, ...node.aliases].filter((name) => name.length > 0);
|
|
1478
1917
|
}
|
|
1918
|
+
function createGlobalSnapshotOptions(presetsEnabled, versionEnabled, controls) {
|
|
1919
|
+
const options = [
|
|
1920
|
+
{
|
|
1921
|
+
name: "help",
|
|
1922
|
+
flags: ["-h", "--help"],
|
|
1923
|
+
type: "boolean",
|
|
1924
|
+
required: false,
|
|
1925
|
+
hidden: false,
|
|
1926
|
+
description: "Display help for command."
|
|
1927
|
+
}
|
|
1928
|
+
];
|
|
1929
|
+
if (presetsEnabled) {
|
|
1930
|
+
options.push({
|
|
1931
|
+
name: "preset",
|
|
1932
|
+
flags: ["--preset"],
|
|
1933
|
+
type: "string",
|
|
1934
|
+
required: false,
|
|
1935
|
+
hidden: true,
|
|
1936
|
+
description: "Load parameter defaults from a JSON file."
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
if (controls.yes) {
|
|
1940
|
+
options.push({
|
|
1941
|
+
name: "yes",
|
|
1942
|
+
flags: ["--yes"],
|
|
1943
|
+
type: "boolean",
|
|
1944
|
+
required: false,
|
|
1945
|
+
hidden: true,
|
|
1946
|
+
description: "Accept defaults and skip prompts."
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
if (controls.output) {
|
|
1950
|
+
const choices = outputFormatNames(controls);
|
|
1951
|
+
options.push({
|
|
1952
|
+
name: "output",
|
|
1953
|
+
flags: ["--output"],
|
|
1954
|
+
type: "enum",
|
|
1955
|
+
required: false,
|
|
1956
|
+
hidden: true,
|
|
1957
|
+
description: "Output format.",
|
|
1958
|
+
choices
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
if (controls.debug) {
|
|
1962
|
+
options.push({
|
|
1963
|
+
name: "debug",
|
|
1964
|
+
flags: ["--debug"],
|
|
1965
|
+
type: "enum",
|
|
1966
|
+
required: false,
|
|
1967
|
+
hidden: true,
|
|
1968
|
+
description: "Print stack traces for unexpected errors.",
|
|
1969
|
+
choices: ["trim", "raw"]
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
if (controls.logLevel) {
|
|
1973
|
+
options.push({
|
|
1974
|
+
name: "logLevel",
|
|
1975
|
+
flags: ["--log-level"],
|
|
1976
|
+
type: "enum",
|
|
1977
|
+
required: false,
|
|
1978
|
+
hidden: true,
|
|
1979
|
+
description: "Set runtime diagnostic log level.",
|
|
1980
|
+
choices: [...LOG_LEVELS]
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
if (controls.verbose) {
|
|
1984
|
+
options.push({
|
|
1985
|
+
name: "verbose",
|
|
1986
|
+
flags: ["-v", "--verbose"],
|
|
1987
|
+
type: "boolean",
|
|
1988
|
+
required: false,
|
|
1989
|
+
hidden: true,
|
|
1990
|
+
description: "Print detailed runtime diagnostics."
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
if (versionEnabled) {
|
|
1994
|
+
options.push({
|
|
1995
|
+
name: "version",
|
|
1996
|
+
flags: ["--version"],
|
|
1997
|
+
type: "boolean",
|
|
1998
|
+
required: false,
|
|
1999
|
+
hidden: false,
|
|
2000
|
+
description: "Output the version number."
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
return options;
|
|
2004
|
+
}
|
|
2005
|
+
function createSnapshotGroup(group, casing, globalLongOptionFlags, pathSegments, isDefault) {
|
|
2006
|
+
const children = group.children
|
|
2007
|
+
.filter((child) => isNodeVisibleInScope(child, "cli"))
|
|
2008
|
+
.map((child) => createSnapshotNode(child, casing, globalLongOptionFlags, [...pathSegments, child.name], group.default === child));
|
|
2009
|
+
return {
|
|
2010
|
+
kind: "group",
|
|
2011
|
+
name: group.name,
|
|
2012
|
+
path: pathSegments,
|
|
2013
|
+
aliases: [...group.aliases],
|
|
2014
|
+
hidden: false,
|
|
2015
|
+
default: isDefault,
|
|
2016
|
+
...(group.description === undefined ? {} : { description: group.description }),
|
|
2017
|
+
children
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
function createSnapshotNode(node, casing, globalLongOptionFlags, pathSegments, isDefault) {
|
|
2021
|
+
if (node.kind === "group") {
|
|
2022
|
+
return createSnapshotGroup(node, casing, globalLongOptionFlags, pathSegments, isDefault);
|
|
2023
|
+
}
|
|
2024
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
2025
|
+
const fields = assignPositionals(collected.fields, node.positional);
|
|
2026
|
+
validateUniqueOptionFlags(fields, globalLongOptionFlags);
|
|
2027
|
+
return {
|
|
2028
|
+
kind: "command",
|
|
2029
|
+
name: node.name,
|
|
2030
|
+
path: pathSegments,
|
|
2031
|
+
aliases: [...node.aliases],
|
|
2032
|
+
hidden: node.hidden,
|
|
2033
|
+
default: isDefault,
|
|
2034
|
+
...(node.description === undefined ? {} : { description: node.description }),
|
|
2035
|
+
options: [
|
|
2036
|
+
...fields.map((field) => createFieldSnapshotOption(field, globalLongOptionFlags)),
|
|
2037
|
+
...collected.dynamicFields.flatMap((field) => createDynamicSnapshotOptions(field, casing))
|
|
2038
|
+
]
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
function createFieldSnapshotOption(field, globalLongOptionFlags) {
|
|
2042
|
+
return {
|
|
2043
|
+
name: field.displayPath,
|
|
2044
|
+
flags: formatHelpFieldFlags(field, globalLongOptionFlags).split(", "),
|
|
2045
|
+
type: formatJsonHelpSchemaType(field.schema),
|
|
2046
|
+
...(field.schema.kind === "enum" ? { choices: formatCLIEnumChoices(field.schema) } : {}),
|
|
2047
|
+
required: field.requiredWhenActive,
|
|
2048
|
+
hidden: false,
|
|
2049
|
+
...(field.description === undefined ? {} : { description: field.description }),
|
|
2050
|
+
...(field.hasDefault ? { default: field.defaultValue } : {}),
|
|
2051
|
+
...(field.positionalIndex === undefined ? {} : { positional: true }),
|
|
2052
|
+
...(field.global === true ? { global: true } : {})
|
|
2053
|
+
};
|
|
2054
|
+
}
|
|
2055
|
+
function createDynamicSnapshotOptions(field, casing) {
|
|
2056
|
+
return formatDynamicHelpFields(field, casing).map((row) => ({
|
|
2057
|
+
name: field.displayPath,
|
|
2058
|
+
flags: [row.flags],
|
|
2059
|
+
type: describeDynamicFieldType(field),
|
|
2060
|
+
required: field.requiredWhenActive,
|
|
2061
|
+
hidden: false,
|
|
2062
|
+
...(field.description === undefined ? {} : { description: field.description }),
|
|
2063
|
+
...(field.hasDefault ? { default: field.defaultValue } : {}),
|
|
2064
|
+
dynamic: true
|
|
2065
|
+
}));
|
|
2066
|
+
}
|
|
1479
2067
|
function addGlobalOptions(command, presetsEnabled, controls) {
|
|
1480
2068
|
const options = [];
|
|
1481
2069
|
if (presetsEnabled) {
|
|
@@ -1485,15 +2073,21 @@ function addGlobalOptions(command, presetsEnabled, controls) {
|
|
|
1485
2073
|
options.push(new Option("--yes", "Accept defaults and skip prompts."));
|
|
1486
2074
|
}
|
|
1487
2075
|
if (controls.output) {
|
|
1488
|
-
|
|
2076
|
+
const choices = outputFormatNames(controls);
|
|
2077
|
+
options.push(new Option("--output <format>", "Output format.")
|
|
2078
|
+
.choices(choices)
|
|
2079
|
+
.argParser((value) => {
|
|
1489
2080
|
if (value === "rich" || value === "md" || value === "json") {
|
|
1490
2081
|
return value;
|
|
1491
2082
|
}
|
|
1492
2083
|
if (value === "markdown") {
|
|
1493
2084
|
return "md";
|
|
1494
2085
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
2086
|
+
if (Object.hasOwn(controls.outputFormats, value)) {
|
|
2087
|
+
return value;
|
|
2088
|
+
}
|
|
2089
|
+
throw new InvalidArgumentError(formatInvalidEnumMessage("--output", value, choices, {
|
|
2090
|
+
candidates: ["rich", "markdown", "json", ...Object.keys(controls.outputFormats)],
|
|
1497
2091
|
threshold: 3
|
|
1498
2092
|
}));
|
|
1499
2093
|
}));
|
|
@@ -1592,7 +2186,17 @@ function enumOptionLabel(schema, value) {
|
|
|
1592
2186
|
}
|
|
1593
2187
|
return schema.labels[key] ?? key;
|
|
1594
2188
|
}
|
|
1595
|
-
|
|
2189
|
+
function withPromptStreams(options, streams) {
|
|
2190
|
+
return {
|
|
2191
|
+
...options,
|
|
2192
|
+
...(streams.input === undefined ? {} : { input: streams.input }),
|
|
2193
|
+
...(streams.output === undefined ? {} : { output: streams.output })
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
function throwPromptCancellation() {
|
|
2197
|
+
throw new UserError("Operation cancelled.");
|
|
2198
|
+
}
|
|
2199
|
+
async function promptForField(field, streams = {}) {
|
|
1596
2200
|
const schema = field.schema;
|
|
1597
2201
|
if (schema.kind === "enum") {
|
|
1598
2202
|
const options = schema.loadOptions
|
|
@@ -1601,43 +2205,40 @@ async function promptForField(field) {
|
|
|
1601
2205
|
label: enumOptionLabel(schema, value),
|
|
1602
2206
|
value
|
|
1603
2207
|
}));
|
|
1604
|
-
const selected = await select({
|
|
2208
|
+
const selected = await select(withPromptStreams({
|
|
1605
2209
|
message: field.description ?? fieldPromptLabel(field),
|
|
1606
2210
|
options,
|
|
1607
2211
|
initialValue: field.hasDefault ? field.defaultValue : undefined
|
|
1608
|
-
});
|
|
2212
|
+
}, streams));
|
|
1609
2213
|
if (isCancel(selected)) {
|
|
1610
|
-
|
|
1611
|
-
throw new UserError("Operation cancelled.");
|
|
2214
|
+
throwPromptCancellation();
|
|
1612
2215
|
}
|
|
1613
2216
|
return selected;
|
|
1614
2217
|
}
|
|
1615
2218
|
if (field.schema.kind === "boolean") {
|
|
1616
|
-
const selected = await confirm({
|
|
2219
|
+
const selected = await confirm(withPromptStreams({
|
|
1617
2220
|
message: fieldPromptLabel(field),
|
|
1618
2221
|
initialValue: field.hasDefault ? Boolean(field.defaultValue) : undefined
|
|
1619
|
-
});
|
|
2222
|
+
}, streams));
|
|
1620
2223
|
if (isCancel(selected)) {
|
|
1621
|
-
|
|
1622
|
-
throw new UserError("Operation cancelled.");
|
|
2224
|
+
throwPromptCancellation();
|
|
1623
2225
|
}
|
|
1624
2226
|
return selected;
|
|
1625
2227
|
}
|
|
1626
|
-
const entered = await promptText({
|
|
2228
|
+
const entered = await promptText(withPromptStreams({
|
|
1627
2229
|
message: fieldPromptLabel(field),
|
|
1628
2230
|
initialValue: field.hasDefault && field.defaultValue !== undefined
|
|
1629
2231
|
? formatResolvedValue(field.defaultValue)
|
|
1630
2232
|
: undefined
|
|
1631
|
-
});
|
|
2233
|
+
}, streams));
|
|
1632
2234
|
if (isCancel(entered)) {
|
|
1633
|
-
|
|
1634
|
-
throw new UserError("Operation cancelled.");
|
|
2235
|
+
throwPromptCancellation();
|
|
1635
2236
|
}
|
|
1636
2237
|
if (typeof entered !== "string") {
|
|
1637
2238
|
throw new UserError(`Missing required parameter "${field.displayPath}".`);
|
|
1638
2239
|
}
|
|
1639
2240
|
if (entered.trim().length === 0 && field.hasDefault) {
|
|
1640
|
-
return field.defaultValue;
|
|
2241
|
+
return cloneDefaultValue(field.defaultValue);
|
|
1641
2242
|
}
|
|
1642
2243
|
if (field.schema.kind === "array") {
|
|
1643
2244
|
return parseArrayValue(entered, field.schema, field.displayPath);
|
|
@@ -1655,11 +2256,11 @@ function resolveOutput(resolvedFlags) {
|
|
|
1655
2256
|
return "json";
|
|
1656
2257
|
}
|
|
1657
2258
|
if (resolvedFlags.output !== undefined) {
|
|
1658
|
-
return resolvedFlags.output;
|
|
2259
|
+
return resolvedFlags.output === "markdown" ? "md" : resolvedFlags.output;
|
|
1659
2260
|
}
|
|
1660
2261
|
return "rich";
|
|
1661
2262
|
}
|
|
1662
|
-
function resolveOutputFromArgv(argv) {
|
|
2263
|
+
function resolveOutputFromArgv(argv, formats = {}) {
|
|
1663
2264
|
for (let index = 0; index < argv.length; index += 1) {
|
|
1664
2265
|
const token = argv[index] ?? "";
|
|
1665
2266
|
if (token === "--json") {
|
|
@@ -1676,6 +2277,9 @@ function resolveOutputFromArgv(argv) {
|
|
|
1676
2277
|
if (value === "markdown") {
|
|
1677
2278
|
return "md";
|
|
1678
2279
|
}
|
|
2280
|
+
if (value !== undefined && Object.hasOwn(formats, value)) {
|
|
2281
|
+
return value;
|
|
2282
|
+
}
|
|
1679
2283
|
continue;
|
|
1680
2284
|
}
|
|
1681
2285
|
if (token.startsWith("--output=")) {
|
|
@@ -1686,61 +2290,21 @@ function resolveOutputFromArgv(argv) {
|
|
|
1686
2290
|
if (value === "markdown") {
|
|
1687
2291
|
return "md";
|
|
1688
2292
|
}
|
|
2293
|
+
if (Object.hasOwn(formats, value)) {
|
|
2294
|
+
return value;
|
|
2295
|
+
}
|
|
1689
2296
|
}
|
|
1690
2297
|
}
|
|
1691
2298
|
return "rich";
|
|
1692
2299
|
}
|
|
1693
|
-
const DESIGN_SYSTEM_OUTPUT_BY_MODE = {
|
|
1694
|
-
rich: "terminal",
|
|
1695
|
-
md: "markdown",
|
|
1696
|
-
json: "json"
|
|
1697
|
-
};
|
|
1698
2300
|
function toDesignSystemOutput(output) {
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
async function withOutputFormat(output, fn) {
|
|
1702
|
-
const previous = process.env.OUTPUT_FORMAT;
|
|
1703
|
-
process.env.OUTPUT_FORMAT = toDesignSystemOutput(output);
|
|
1704
|
-
resetOutputFormatCache();
|
|
1705
|
-
try {
|
|
1706
|
-
return await fn();
|
|
2301
|
+
if (output === "md") {
|
|
2302
|
+
return "markdown";
|
|
1707
2303
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
delete process.env.OUTPUT_FORMAT;
|
|
1711
|
-
}
|
|
1712
|
-
else {
|
|
1713
|
-
process.env.OUTPUT_FORMAT = previous;
|
|
1714
|
-
}
|
|
1715
|
-
resetOutputFormatCache();
|
|
2304
|
+
if (output === "json") {
|
|
2305
|
+
return "json";
|
|
1716
2306
|
}
|
|
1717
|
-
|
|
1718
|
-
function createFs() {
|
|
1719
|
-
return {
|
|
1720
|
-
readFile: async (path, encoding = "utf8") => readFile(path, { encoding }),
|
|
1721
|
-
writeFile: async (path, contents, options) => {
|
|
1722
|
-
await writeFile(path, contents, options);
|
|
1723
|
-
},
|
|
1724
|
-
exists: async (path) => {
|
|
1725
|
-
try {
|
|
1726
|
-
await access(path);
|
|
1727
|
-
return true;
|
|
1728
|
-
}
|
|
1729
|
-
catch {
|
|
1730
|
-
return false;
|
|
1731
|
-
}
|
|
1732
|
-
},
|
|
1733
|
-
lstat: async (path) => lstat(path),
|
|
1734
|
-
rename: async (fromPath, toPath) => rename(fromPath, toPath),
|
|
1735
|
-
unlink: async (path) => unlink(path)
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
function createEnv(values = process.env) {
|
|
1739
|
-
return {
|
|
1740
|
-
get(key) {
|
|
1741
|
-
return values[key];
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
2307
|
+
return "terminal";
|
|
1744
2308
|
}
|
|
1745
2309
|
function isPlainObject(value) {
|
|
1746
2310
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -1772,20 +2336,22 @@ function validatePresetScalarValue(value, schema, fieldPath, presetPath) {
|
|
|
1772
2336
|
return null;
|
|
1773
2337
|
}
|
|
1774
2338
|
switch (schema.kind) {
|
|
1775
|
-
case "string":
|
|
2339
|
+
case "string": {
|
|
1776
2340
|
if (typeof value !== "string") {
|
|
1777
2341
|
break;
|
|
1778
2342
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
2343
|
+
const length = unicodeLength(value);
|
|
2344
|
+
if (schema.minLength !== undefined && length < schema.minLength) {
|
|
2345
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected a string with length at least ${schema.minLength}, got string with length ${length}.`);
|
|
1781
2346
|
}
|
|
1782
|
-
if (schema.maxLength !== undefined &&
|
|
1783
|
-
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected a string with length at most ${schema.maxLength}, got string with length ${
|
|
2347
|
+
if (schema.maxLength !== undefined && length > schema.maxLength) {
|
|
2348
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected a string with length at most ${schema.maxLength}, got string with length ${length}.`);
|
|
1784
2349
|
}
|
|
1785
2350
|
if (schema.pattern !== undefined && !matchesStringPattern(value, schema.pattern)) {
|
|
1786
2351
|
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}": "${value}" does not match pattern "${schema.pattern}".`);
|
|
1787
2352
|
}
|
|
1788
2353
|
return value;
|
|
2354
|
+
}
|
|
1789
2355
|
case "number":
|
|
1790
2356
|
if (!isValidNumberSchemaValue(value, schema)) {
|
|
1791
2357
|
break;
|
|
@@ -1813,6 +2379,9 @@ function validatePresetFieldValue(value, field, presetPath) {
|
|
|
1813
2379
|
if (field.schema.kind !== "array") {
|
|
1814
2380
|
return validatePresetScalarValue(value, field.schema, field.displayPath, presetPath);
|
|
1815
2381
|
}
|
|
2382
|
+
if (value === null && field.schema.nullable === true) {
|
|
2383
|
+
return null;
|
|
2384
|
+
}
|
|
1816
2385
|
const itemSchema = unwrapOptional(field.schema.item);
|
|
1817
2386
|
if (itemSchema.kind === "array" || itemSchema.kind === "object") {
|
|
1818
2387
|
throw new UserError(`Array parameter "${field.displayPath}" must use scalar items.`);
|
|
@@ -1828,7 +2397,7 @@ function validatePresetFieldValue(value, field, presetPath) {
|
|
|
1828
2397
|
}
|
|
1829
2398
|
return value.map((item) => validatePresetScalarValue(item, itemSchema, field.displayPath, presetPath));
|
|
1830
2399
|
}
|
|
1831
|
-
async function loadPresetValues(fields, presetPath) {
|
|
2400
|
+
async function loadPresetValues(fields, dynamicFields, presetPath) {
|
|
1832
2401
|
let rawPreset;
|
|
1833
2402
|
try {
|
|
1834
2403
|
rawPreset = await readFile(presetPath, {
|
|
@@ -1855,7 +2424,10 @@ async function loadPresetValues(fields, presetPath) {
|
|
|
1855
2424
|
throw new UserError(`Preset file "${presetPath}" must contain a JSON object.`);
|
|
1856
2425
|
}
|
|
1857
2426
|
const fieldByPath = new Map(fields.map((field) => [field.displayPath, field]));
|
|
2427
|
+
const dynamicFieldByPath = new Map(dynamicFields.map((field) => [field.displayPath, field]));
|
|
2428
|
+
const allFields = [...fields, ...dynamicFields];
|
|
1858
2429
|
const presetValues = {};
|
|
2430
|
+
const dynamicValues = new Map();
|
|
1859
2431
|
function visitObject(current, path) {
|
|
1860
2432
|
for (const [key, value] of Object.entries(current)) {
|
|
1861
2433
|
const nextPath = [...path, key];
|
|
@@ -1865,7 +2437,18 @@ async function loadPresetValues(fields, presetPath) {
|
|
|
1865
2437
|
presetValues[field.optionAttribute] = validatePresetFieldValue(value, field, presetPath);
|
|
1866
2438
|
continue;
|
|
1867
2439
|
}
|
|
1868
|
-
|
|
2440
|
+
const dynamicField = dynamicFieldByPath.get(displayPath);
|
|
2441
|
+
if (dynamicField !== undefined) {
|
|
2442
|
+
const validation = validateSchema(dynamicField.schema, value, { defaults: "all" });
|
|
2443
|
+
if (!validation.ok) {
|
|
2444
|
+
const issue = validation.issues[0];
|
|
2445
|
+
const issuePath = [displayPath, ...issue.path].join(".");
|
|
2446
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${issuePath}". ${issue.message}`);
|
|
2447
|
+
}
|
|
2448
|
+
dynamicValues.set(dynamicField.id, validation.value);
|
|
2449
|
+
continue;
|
|
2450
|
+
}
|
|
2451
|
+
if (!hasNestedField(allFields, nextPath)) {
|
|
1869
2452
|
throw new UserError(`Preset file "${presetPath}" contains unknown parameter "${displayPath}".`);
|
|
1870
2453
|
}
|
|
1871
2454
|
if (!isPlainObject(value)) {
|
|
@@ -1875,7 +2458,7 @@ async function loadPresetValues(fields, presetPath) {
|
|
|
1875
2458
|
}
|
|
1876
2459
|
}
|
|
1877
2460
|
visitObject(parsedPreset, []);
|
|
1878
|
-
return presetValues;
|
|
2461
|
+
return { fields: presetValues, dynamic: dynamicValues };
|
|
1879
2462
|
}
|
|
1880
2463
|
function isNumericFixtureSelector(value) {
|
|
1881
2464
|
if (value.length === 0) {
|
|
@@ -2143,16 +2726,16 @@ function createFixtureEnvValues(command) {
|
|
|
2143
2726
|
}
|
|
2144
2727
|
return values;
|
|
2145
2728
|
}
|
|
2146
|
-
async function resolveFixtureRuntime(command, services, requirementOptions, runtimeFetch) {
|
|
2147
|
-
const selector = process.env.TOOLCRAFT_FIXTURE;
|
|
2729
|
+
async function resolveFixtureRuntime(command, services, requirementOptions, runtimeFetch, runtimeEnv, runtimeFs, embedded = false) {
|
|
2730
|
+
const selector = embedded ? undefined : process.env.TOOLCRAFT_FIXTURE;
|
|
2148
2731
|
if (selector === undefined || selector.length === 0) {
|
|
2149
2732
|
return {
|
|
2150
|
-
env: createEnv(),
|
|
2733
|
+
env: createEnv(runtimeEnv),
|
|
2151
2734
|
fetch: runtimeFetch,
|
|
2152
|
-
fs: createFs(),
|
|
2735
|
+
fs: createFs(runtimeFs),
|
|
2153
2736
|
isFixture: false,
|
|
2154
2737
|
requirementOptions,
|
|
2155
|
-
secrets: resolveCommandSecrets(command),
|
|
2738
|
+
secrets: resolveCommandSecrets(command, runtimeEnv),
|
|
2156
2739
|
services
|
|
2157
2740
|
};
|
|
2158
2741
|
}
|
|
@@ -2189,18 +2772,19 @@ function isHumanInLoopPending(result) {
|
|
|
2189
2772
|
typeof result.message === "string" &&
|
|
2190
2773
|
typeof result.enqueuedAt === "string");
|
|
2191
2774
|
}
|
|
2192
|
-
function renderHumanInLoopPending(pending) {
|
|
2193
|
-
|
|
2775
|
+
function renderHumanInLoopPending(pending, rootUsageName, outputEmitter) {
|
|
2776
|
+
const message = `✓ Queued for human approval (id: ${pending.approvalId})\n` +
|
|
2194
2777
|
` Message: ${pending.message}\n` +
|
|
2195
|
-
` Track:
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2778
|
+
` Track: ${rootUsageName} approvals show --approval-id ${pending.approvalId}`;
|
|
2779
|
+
if (outputEmitter === undefined) {
|
|
2780
|
+
process.stdout.write(`${message}\n`);
|
|
2781
|
+
}
|
|
2782
|
+
else {
|
|
2783
|
+
outputEmitter(message);
|
|
2784
|
+
}
|
|
2201
2785
|
}
|
|
2202
|
-
function renderCliErrorPattern(pattern) {
|
|
2203
|
-
const logger = createLogger();
|
|
2786
|
+
function renderCliErrorPattern(pattern, outputEmitter) {
|
|
2787
|
+
const logger = createLogger(outputEmitter);
|
|
2204
2788
|
if (pattern.kind === "usage") {
|
|
2205
2789
|
logger.error(appendUsagePointer(pattern.message, {
|
|
2206
2790
|
rootUsageName: pattern.rootUsageName,
|
|
@@ -2216,8 +2800,8 @@ function renderCliErrorPattern(pattern) {
|
|
|
2216
2800
|
}
|
|
2217
2801
|
if (pattern.kind === "definition") {
|
|
2218
2802
|
logger.error(`Command definition error: ${pattern.error.message}\n` +
|
|
2219
|
-
"This is a bug in the generated command definition, not in your command arguments
|
|
2220
|
-
"
|
|
2803
|
+
"This is a bug in the generated command definition, not in your command arguments." +
|
|
2804
|
+
(pattern.debugControlEnabled ? "\nRun with --debug for a stack trace." : ""));
|
|
2221
2805
|
if (pattern.debugStackMode !== undefined && pattern.error.stack) {
|
|
2222
2806
|
process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}\n`);
|
|
2223
2807
|
}
|
|
@@ -2227,15 +2811,17 @@ function renderCliErrorPattern(pattern) {
|
|
|
2227
2811
|
if (pattern.kind === "toolcraft-bug") {
|
|
2228
2812
|
logger.error(`toolcraft hit an internal invariant: ${pattern.error.message}\n` +
|
|
2229
2813
|
`This is a bug in toolcraft or in the command definition; ` +
|
|
2230
|
-
`it cannot be worked around by changing argv
|
|
2231
|
-
|
|
2814
|
+
`it cannot be worked around by changing argv.` +
|
|
2815
|
+
(pattern.debugControlEnabled
|
|
2816
|
+
? ` Re-run with --debug for a stack trace and file an issue.`
|
|
2817
|
+
: " File an issue."));
|
|
2232
2818
|
if (pattern.debugStackMode !== undefined && pattern.error.stack) {
|
|
2233
2819
|
process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}\n`);
|
|
2234
2820
|
}
|
|
2235
2821
|
process.exitCode = 1;
|
|
2236
2822
|
return;
|
|
2237
2823
|
}
|
|
2238
|
-
logger.error(pattern.debugStackMode !== undefined
|
|
2824
|
+
logger.error(pattern.debugStackMode !== undefined || !pattern.debugControlEnabled
|
|
2239
2825
|
? pattern.message
|
|
2240
2826
|
: `${pattern.message} Use --debug for a stack trace.`);
|
|
2241
2827
|
if (pattern.debugStackMode !== undefined && pattern.stack !== undefined) {
|
|
@@ -2243,15 +2829,8 @@ function renderCliErrorPattern(pattern) {
|
|
|
2243
2829
|
}
|
|
2244
2830
|
process.exitCode = 1;
|
|
2245
2831
|
}
|
|
2246
|
-
function validateServices(services) {
|
|
2247
|
-
for (const name of Object.keys(services)) {
|
|
2248
|
-
if (RESERVED_SERVICE_NAMES.has(name)) {
|
|
2249
|
-
throw new Error(`Service name "${name}" is reserved. Choose a different name. ${RESERVED_SERVICE_NAMES_MESSAGE}`);
|
|
2250
|
-
}
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
2832
|
function getNestedValue(target, path) {
|
|
2254
|
-
return path.reduce((current, segment) => current !== null && typeof current === "object"
|
|
2833
|
+
return path.reduce((current, segment) => current !== null && typeof current === "object" && Object.prototype.hasOwnProperty.call(current, segment)
|
|
2255
2834
|
? current[segment]
|
|
2256
2835
|
: undefined, target);
|
|
2257
2836
|
}
|
|
@@ -2294,7 +2873,7 @@ function parseOptionFieldValue(field, value, errors) {
|
|
|
2294
2873
|
return { ok: true, value: parsedValue };
|
|
2295
2874
|
}
|
|
2296
2875
|
catch (error) {
|
|
2297
|
-
if (error
|
|
2876
|
+
if (isUserError(error) || error instanceof InvalidArgumentError) {
|
|
2298
2877
|
errors.push({
|
|
2299
2878
|
path: field.displayPath,
|
|
2300
2879
|
message: error.message
|
|
@@ -2390,12 +2969,12 @@ function resolveDynamicLeaf(schema, rawSegments, casing, outputPath = [], displa
|
|
|
2390
2969
|
case "object": {
|
|
2391
2970
|
const [head, ...rest] = rawSegments;
|
|
2392
2971
|
for (const [key, childSchema] of Object.entries(unwrappedSchema.shape)) {
|
|
2393
|
-
if (
|
|
2972
|
+
if (formatCLIName(key, casing) !== head) {
|
|
2394
2973
|
continue;
|
|
2395
2974
|
}
|
|
2396
2975
|
return resolveDynamicLeaf(childSchema, rest, casing, [...outputPath, key], [...displayPath, key], displayPathPrefix);
|
|
2397
2976
|
}
|
|
2398
|
-
throw new UserError(`Unknown parameter "${qualifyDisplayPath(displayPathPrefix, [...displayPath, head].join("."))}". ${formatAvailableList(Object.keys(unwrappedSchema.shape).map((key) => qualifyDisplayPath(displayPathPrefix, toDisplayPath([...displayPath,
|
|
2977
|
+
throw new UserError(`Unknown parameter "${qualifyDisplayPath(displayPathPrefix, [...displayPath, head].join("."))}". ${formatAvailableList(Object.keys(unwrappedSchema.shape).map((key) => qualifyDisplayPath(displayPathPrefix, toDisplayPath([...displayPath, formatCLIName(key, casing)]))))}`);
|
|
2399
2978
|
}
|
|
2400
2979
|
case "record": {
|
|
2401
2980
|
const [head, ...rest] = rawSegments;
|
|
@@ -2418,6 +2997,10 @@ function resolveDynamicLeaf(schema, rawSegments, casing, outputPath = [], displa
|
|
|
2418
2997
|
: [qualifyDisplayPath(displayPathPrefix, toDisplayPath(displayPath))])}`);
|
|
2419
2998
|
}
|
|
2420
2999
|
}
|
|
3000
|
+
function formatFieldValidationIssue(issue, displayPath) {
|
|
3001
|
+
const path = [displayPath, ...issue.path].filter((part) => part !== "").join(".") || "parameters";
|
|
3002
|
+
return { path, message: `Invalid value for "${path}". ${issue.message}` };
|
|
3003
|
+
}
|
|
2421
3004
|
function finalizeDynamicValue(schema, value, displayPath, errors) {
|
|
2422
3005
|
const unwrappedSchema = unwrapOptional(schema);
|
|
2423
3006
|
if (value === undefined) {
|
|
@@ -2431,8 +3014,14 @@ function finalizeDynamicValue(schema, value, displayPath, errors) {
|
|
|
2431
3014
|
case "number":
|
|
2432
3015
|
case "boolean":
|
|
2433
3016
|
case "enum":
|
|
2434
|
-
case "json":
|
|
2435
3017
|
return value;
|
|
3018
|
+
case "json": {
|
|
3019
|
+
const validation = validateSchema(unwrappedSchema, value);
|
|
3020
|
+
if (!validation.ok) {
|
|
3021
|
+
errors.push(...validation.issues.map((issue) => formatFieldValidationIssue(issue, displayPath)));
|
|
3022
|
+
}
|
|
3023
|
+
return value;
|
|
3024
|
+
}
|
|
2436
3025
|
case "array": {
|
|
2437
3026
|
const itemSchema = unwrapOptional(unwrappedSchema.item);
|
|
2438
3027
|
if (itemSchema.kind !== "object") {
|
|
@@ -2480,7 +3069,7 @@ function finalizeDynamicValue(schema, value, displayPath, errors) {
|
|
|
2480
3069
|
const childDisplayPath = displayPath.length === 0 ? key : `${displayPath}.${key}`;
|
|
2481
3070
|
if (childValue === undefined) {
|
|
2482
3071
|
if (childSchema.default !== undefined) {
|
|
2483
|
-
result[key] = childSchema.default;
|
|
3072
|
+
result[key] = cloneDefaultValue(childSchema.default);
|
|
2484
3073
|
continue;
|
|
2485
3074
|
}
|
|
2486
3075
|
if (rawChildSchema.kind === "optional") {
|
|
@@ -2521,7 +3110,7 @@ function formatCliSchemaKind(kind) {
|
|
|
2521
3110
|
return kind === "oneOf" ? "oneof" : kind;
|
|
2522
3111
|
}
|
|
2523
3112
|
function formatUnsupportedDynamicSchemaMessage(kind, displayPath) {
|
|
2524
|
-
return `Unsupported
|
|
3113
|
+
return `Unsupported CLI argument shape for "${displayPath}" (type "${kind}").`;
|
|
2525
3114
|
}
|
|
2526
3115
|
function qualifyDisplayPath(prefix, displayPath) {
|
|
2527
3116
|
if (prefix.length === 0) {
|
|
@@ -2532,13 +3121,38 @@ function qualifyDisplayPath(prefix, displayPath) {
|
|
|
2532
3121
|
}
|
|
2533
3122
|
return `${prefix}.${displayPath}`;
|
|
2534
3123
|
}
|
|
3124
|
+
function resolveDynamicOption(dynamicFields, flagName, casing) {
|
|
3125
|
+
const flagPath = flagName.split(".");
|
|
3126
|
+
const match = [...dynamicFields]
|
|
3127
|
+
.sort((left, right) => right.optionPath.length - left.optionPath.length)
|
|
3128
|
+
.find((field) => {
|
|
3129
|
+
const optionPath = field.optionPath.map((segment) => formatCLIName(segment, casing));
|
|
3130
|
+
return flagPath.length > optionPath.length &&
|
|
3131
|
+
optionPath.every((segment, index) => flagPath[index] === segment);
|
|
3132
|
+
});
|
|
3133
|
+
if (match === undefined) {
|
|
3134
|
+
return undefined;
|
|
3135
|
+
}
|
|
3136
|
+
return {
|
|
3137
|
+
match,
|
|
3138
|
+
leaf: resolveDynamicLeaf(match.schema, flagPath.slice(match.optionPath.length), casing, [], [], match.displayPath)
|
|
3139
|
+
};
|
|
3140
|
+
}
|
|
2535
3141
|
function parseDynamicValues(dynamicFields, rawArgv, casing, errors) {
|
|
2536
3142
|
const rawValues = new Map();
|
|
2537
3143
|
const providedFieldIds = new Set();
|
|
2538
|
-
const
|
|
3144
|
+
const positionals = [];
|
|
2539
3145
|
for (let index = 0; index < rawArgv.length; index += 1) {
|
|
2540
3146
|
const token = rawArgv[index] ?? "";
|
|
3147
|
+
if (token === "--") {
|
|
3148
|
+
positionals.push(...rawArgv.slice(index + 1));
|
|
3149
|
+
break;
|
|
3150
|
+
}
|
|
2541
3151
|
if (!token.startsWith("--")) {
|
|
3152
|
+
if (token.length > 1 && token.startsWith("-") && !isNegativeNumericToken(token)) {
|
|
3153
|
+
throw new UserError(`Unknown option "${token}".`);
|
|
3154
|
+
}
|
|
3155
|
+
positionals.push(token);
|
|
2542
3156
|
continue;
|
|
2543
3157
|
}
|
|
2544
3158
|
const negated = token.startsWith("--no-");
|
|
@@ -2546,18 +3160,11 @@ function parseDynamicValues(dynamicFields, rawArgv, casing, errors) {
|
|
|
2546
3160
|
const equalsIndex = normalized.indexOf("=");
|
|
2547
3161
|
const flagName = equalsIndex >= 0 ? normalized.slice(2, equalsIndex) : normalized.slice(2);
|
|
2548
3162
|
const inlineValue = equalsIndex >= 0 ? normalized.slice(equalsIndex + 1) : undefined;
|
|
2549
|
-
const
|
|
2550
|
-
|
|
2551
|
-
const optionPath = field.optionPath.map((segment) => formatSegment(segment, casing));
|
|
2552
|
-
return (flagPath.length > optionPath.length &&
|
|
2553
|
-
optionPath.every((segment, segmentIndex) => flagPath[segmentIndex] === segment));
|
|
2554
|
-
});
|
|
2555
|
-
if (match === undefined) {
|
|
3163
|
+
const dynamic = resolveDynamicOption(dynamicFields, flagName, casing);
|
|
3164
|
+
if (dynamic === undefined) {
|
|
2556
3165
|
throw new UserError(`Unknown parameter "${flagName}". ${formatAvailableList(dynamicFields.map((field) => field.optionPathDisplay))}`);
|
|
2557
3166
|
}
|
|
2558
|
-
const
|
|
2559
|
-
const remainder = flagPath.slice(optionPath.length);
|
|
2560
|
-
const leaf = resolveDynamicLeaf(match.schema, remainder, casing, [], [], match.displayPath);
|
|
3167
|
+
const { match, leaf } = dynamic;
|
|
2561
3168
|
const rawStore = rawValues.get(match.id) ?? {};
|
|
2562
3169
|
const label = `${match.displayPath}.${leaf.displayPath}`.replace(/^\./u, "");
|
|
2563
3170
|
const parsed = negated && leaf.schema.kind === "boolean"
|
|
@@ -2573,6 +3180,7 @@ function parseDynamicValues(dynamicFields, rawArgv, casing, errors) {
|
|
|
2573
3180
|
}
|
|
2574
3181
|
return {
|
|
2575
3182
|
providedFieldIds,
|
|
3183
|
+
positionals,
|
|
2576
3184
|
values: new Map(dynamicFields
|
|
2577
3185
|
.filter((field) => rawValues.has(field.id))
|
|
2578
3186
|
.map((field) => [
|
|
@@ -2581,9 +3189,10 @@ function parseDynamicValues(dynamicFields, rawArgv, casing, errors) {
|
|
|
2581
3189
|
]))
|
|
2582
3190
|
};
|
|
2583
3191
|
}
|
|
2584
|
-
async function enforceVariantConstraints(params, fields, dynamicFields, variants, resolvedFieldValues, providedDynamicFieldIds, providedFieldIds, shouldPrompt, errors) {
|
|
3192
|
+
async function enforceVariantConstraints(params, fields, dynamicFields, variants, resolvedFieldValues, providedDynamicFieldIds, providedFieldIds, shouldPrompt, errors, promptStreams) {
|
|
2585
3193
|
const fieldById = new Map(fields.map((field) => [field.id, field]));
|
|
2586
3194
|
const dynamicFieldById = new Map(dynamicFields.map((field) => [field.id, field]));
|
|
3195
|
+
const activeBranches = new Map();
|
|
2587
3196
|
const getAvailableBranchParameters = (branch) => [
|
|
2588
3197
|
...branch.fieldIds
|
|
2589
3198
|
.map((fieldId) => fieldById.get(fieldId))
|
|
@@ -2595,12 +3204,16 @@ async function enforceVariantConstraints(params, fields, dynamicFields, variants
|
|
|
2595
3204
|
.map((field) => field.optionPathDisplay)
|
|
2596
3205
|
];
|
|
2597
3206
|
for (const variant of variants) {
|
|
3207
|
+
if (variant.parent !== undefined && activeBranches.get(variant.parent.id) !== variant.parent.branchId) {
|
|
3208
|
+
continue;
|
|
3209
|
+
}
|
|
2598
3210
|
let selectedBranchId = resolvedFieldValues.get(variant.controlFieldId);
|
|
2599
3211
|
if (selectedBranchId === undefined && shouldPrompt) {
|
|
2600
3212
|
const controlField = fieldById.get(variant.controlFieldId);
|
|
2601
3213
|
if (controlField !== undefined) {
|
|
2602
|
-
selectedBranchId = await promptForField(controlField);
|
|
3214
|
+
selectedBranchId = await promptForField(controlField, promptStreams);
|
|
2603
3215
|
resolvedFieldValues.set(controlField.id, selectedBranchId);
|
|
3216
|
+
providedFieldIds.add(controlField.id);
|
|
2604
3217
|
if (!controlField.synthetic) {
|
|
2605
3218
|
setNestedValue(params, controlField.path, selectedBranchId);
|
|
2606
3219
|
}
|
|
@@ -2655,16 +3268,33 @@ async function enforceVariantConstraints(params, fields, dynamicFields, variants
|
|
|
2655
3268
|
if (hasInvalidBranchParameter) {
|
|
2656
3269
|
continue;
|
|
2657
3270
|
}
|
|
3271
|
+
activeBranches.set(variant.id, selectedBranch.branchId);
|
|
3272
|
+
for (const fieldId of selectedBranch.fieldIds) {
|
|
3273
|
+
const field = fieldById.get(fieldId);
|
|
3274
|
+
if (field?.variantId !== variant.id || !field.hasDefault || getNestedValue(params, field.path) !== undefined) {
|
|
3275
|
+
continue;
|
|
3276
|
+
}
|
|
3277
|
+
const value = cloneDefaultValue(field.defaultValue);
|
|
3278
|
+
resolvedFieldValues.set(field.id, value);
|
|
3279
|
+
setNestedValue(params, field.path, value);
|
|
3280
|
+
}
|
|
3281
|
+
for (const fieldId of selectedBranch.dynamicFieldIds) {
|
|
3282
|
+
const field = dynamicFieldById.get(fieldId);
|
|
3283
|
+
if (field?.variantId !== variant.id || !field.hasDefault || getNestedValue(params, field.path) !== undefined) {
|
|
3284
|
+
continue;
|
|
3285
|
+
}
|
|
3286
|
+
setNestedValue(params, field.path, cloneDefaultValue(field.defaultValue));
|
|
3287
|
+
}
|
|
2658
3288
|
for (const fieldId of selectedBranch.requiredFieldIds) {
|
|
2659
3289
|
const field = fieldById.get(fieldId);
|
|
2660
|
-
if (field
|
|
3290
|
+
if (field?.variantId !== variant.id || field.synthetic) {
|
|
2661
3291
|
continue;
|
|
2662
3292
|
}
|
|
2663
3293
|
if (getNestedValue(params, field.path) !== undefined) {
|
|
2664
3294
|
continue;
|
|
2665
3295
|
}
|
|
2666
3296
|
if (shouldPrompt) {
|
|
2667
|
-
const promptedValue = await promptForField(field);
|
|
3297
|
+
const promptedValue = await promptForField(field, promptStreams);
|
|
2668
3298
|
resolvedFieldValues.set(field.id, promptedValue);
|
|
2669
3299
|
setNestedValue(params, field.path, promptedValue);
|
|
2670
3300
|
providedFieldIds.add(field.id);
|
|
@@ -2677,7 +3307,7 @@ async function enforceVariantConstraints(params, fields, dynamicFields, variants
|
|
|
2677
3307
|
}
|
|
2678
3308
|
for (const fieldId of selectedBranch.requiredDynamicFieldIds) {
|
|
2679
3309
|
const field = dynamicFieldById.get(fieldId);
|
|
2680
|
-
if (field
|
|
3310
|
+
if (field?.variantId !== variant.id) {
|
|
2681
3311
|
continue;
|
|
2682
3312
|
}
|
|
2683
3313
|
if (getNestedValue(params, field.path) !== undefined) {
|
|
@@ -2690,19 +3320,48 @@ async function enforceVariantConstraints(params, fields, dynamicFields, variants
|
|
|
2690
3320
|
}
|
|
2691
3321
|
}
|
|
2692
3322
|
}
|
|
2693
|
-
async function resolveParams(fields, dynamicFields, variants, positionalValues, optionValues, rawArgv, casing, presetPath, shouldPrompt) {
|
|
3323
|
+
async function resolveParams(fields, dynamicFields, variants, positionalValues, optionValues, rawArgv, casing, presetPath, shouldPrompt, missingParameterContext, promptStreams, parameterDefaults = {}) {
|
|
2694
3324
|
const params = {};
|
|
3325
|
+
const errors = [];
|
|
3326
|
+
const dynamicResults = parseDynamicValues(dynamicFields, rawArgv, casing, errors);
|
|
3327
|
+
const positionalTokens = [...positionalValues, ...dynamicResults.positionals];
|
|
3328
|
+
const fieldRoot = (field) => field.synthetic
|
|
3329
|
+
? (field.path.length === 1 ? field.path[0].slice(0, -"Kind".length) : field.path[0])
|
|
3330
|
+
: field.path[0];
|
|
3331
|
+
const explicitRoots = new Set();
|
|
3332
|
+
for (const field of fields) {
|
|
3333
|
+
if (hasFieldValue(optionValues[field.commanderOptionAttribute]) ||
|
|
3334
|
+
(field.positionalIndex !== undefined && positionalTokens[field.positionalIndex] !== undefined)) {
|
|
3335
|
+
explicitRoots.add(fieldRoot(field));
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
for (const field of dynamicFields) {
|
|
3339
|
+
if (dynamicResults.values.has(field.id))
|
|
3340
|
+
explicitRoots.add(field.path[0]);
|
|
3341
|
+
}
|
|
3342
|
+
const defaultRoots = new Set(Object.keys(parameterDefaults).filter(key => !explicitRoots.has(key)));
|
|
3343
|
+
for (const key of defaultRoots)
|
|
3344
|
+
params[key] = cloneDefaultValue(parameterDefaults[key]);
|
|
3345
|
+
const positionalFields = fields.filter((field) => field.positionalIndex !== undefined);
|
|
3346
|
+
if (!positionalFields.some((field) => field.variadicPosition === true) &&
|
|
3347
|
+
positionalTokens.length > positionalFields.length) {
|
|
3348
|
+
throw new UserError(`Unexpected arguments: ${positionalTokens.slice(positionalFields.length).map((token) => JSON.stringify(token)).join(", ")}.`);
|
|
3349
|
+
}
|
|
2695
3350
|
const presetValues = typeof presetPath === "string" && presetPath.length > 0
|
|
2696
|
-
? await loadPresetValues(fields, presetPath)
|
|
2697
|
-
: {};
|
|
3351
|
+
? await loadPresetValues(fields, dynamicFields, presetPath)
|
|
3352
|
+
: { fields: {}, dynamic: new Map() };
|
|
2698
3353
|
const providedFieldIds = new Set();
|
|
2699
3354
|
const resolvedFieldValues = new Map();
|
|
2700
|
-
const errors = [];
|
|
2701
3355
|
for (const field of fields) {
|
|
3356
|
+
if (defaultRoots.has(fieldRoot(field)))
|
|
3357
|
+
continue;
|
|
2702
3358
|
let value;
|
|
3359
|
+
let resolvedMissing = false;
|
|
2703
3360
|
let source;
|
|
2704
3361
|
if (field.positionalIndex !== undefined) {
|
|
2705
|
-
const positionalValue =
|
|
3362
|
+
const positionalValue = field.variadicPosition === true
|
|
3363
|
+
? positionalTokens.slice(field.positionalIndex)
|
|
3364
|
+
: positionalTokens[field.positionalIndex];
|
|
2706
3365
|
if (field.schema.kind === "array") {
|
|
2707
3366
|
if (Array.isArray(positionalValue) && positionalValue.length > 0) {
|
|
2708
3367
|
const itemSchema = unwrapOptional(field.schema.item);
|
|
@@ -2713,7 +3372,7 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2713
3372
|
source = "positional";
|
|
2714
3373
|
}
|
|
2715
3374
|
}
|
|
2716
|
-
else if (typeof positionalValue === "string"
|
|
3375
|
+
else if (typeof positionalValue === "string") {
|
|
2717
3376
|
value = parseFieldInputValue(positionalValue, field.schema, field.displayPath);
|
|
2718
3377
|
source = "positional";
|
|
2719
3378
|
}
|
|
@@ -2739,8 +3398,8 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2739
3398
|
source = "option";
|
|
2740
3399
|
}
|
|
2741
3400
|
if (value === undefined &&
|
|
2742
|
-
Object.prototype.hasOwnProperty.call(presetValues, field.optionAttribute)) {
|
|
2743
|
-
value = presetValues[field.optionAttribute];
|
|
3401
|
+
Object.prototype.hasOwnProperty.call(presetValues.fields, field.optionAttribute)) {
|
|
3402
|
+
value = presetValues.fields[field.optionAttribute];
|
|
2744
3403
|
source = "preset";
|
|
2745
3404
|
}
|
|
2746
3405
|
if (source === "option") {
|
|
@@ -2750,12 +3409,53 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2750
3409
|
}
|
|
2751
3410
|
value = parsed.value;
|
|
2752
3411
|
}
|
|
3412
|
+
if (value === undefined &&
|
|
3413
|
+
field.optional &&
|
|
3414
|
+
missingParameterContext !== undefined &&
|
|
3415
|
+
field.schema.cli?.resolveMissing !== undefined) {
|
|
3416
|
+
const resolution = await field.schema.cli.resolveMissing({
|
|
3417
|
+
...missingParameterContext,
|
|
3418
|
+
params: { ...params }
|
|
3419
|
+
});
|
|
3420
|
+
const choices = resolution?.choices ?? [];
|
|
3421
|
+
if (choices.length === 1) {
|
|
3422
|
+
value = choices[0]?.value;
|
|
3423
|
+
resolvedMissing = true;
|
|
3424
|
+
source = "prompt";
|
|
3425
|
+
}
|
|
3426
|
+
else if (choices.length > 1) {
|
|
3427
|
+
const selected = await select(withPromptStreams({
|
|
3428
|
+
message: resolution?.message ?? field.description ?? fieldPromptLabel(field),
|
|
3429
|
+
options: choices.map((choice) => ({
|
|
3430
|
+
label: choice.label,
|
|
3431
|
+
value: choice.value
|
|
3432
|
+
}))
|
|
3433
|
+
}, promptStreams));
|
|
3434
|
+
if (isCancel(selected)) {
|
|
3435
|
+
throwPromptCancellation();
|
|
3436
|
+
}
|
|
3437
|
+
value = selected;
|
|
3438
|
+
resolvedMissing = true;
|
|
3439
|
+
source = "prompt";
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
if (resolvedMissing) {
|
|
3443
|
+
const validation = validateSchema(field.schema, value);
|
|
3444
|
+
if (!validation.ok) {
|
|
3445
|
+
errors.push(...validation.issues.map((issue) => ({
|
|
3446
|
+
path: field.displayPath,
|
|
3447
|
+
message: issue.message
|
|
3448
|
+
})));
|
|
3449
|
+
continue;
|
|
3450
|
+
}
|
|
3451
|
+
value = validation.value;
|
|
3452
|
+
}
|
|
2753
3453
|
if (value === undefined && shouldPrompt && !field.optional) {
|
|
2754
|
-
value = await promptForField(field);
|
|
3454
|
+
value = await promptForField(field, promptStreams);
|
|
2755
3455
|
source = "prompt";
|
|
2756
3456
|
}
|
|
2757
|
-
if (value === undefined && field.hasDefault) {
|
|
2758
|
-
value = field.defaultValue;
|
|
3457
|
+
if (value === undefined && field.hasDefault && field.variantId === undefined) {
|
|
3458
|
+
value = cloneDefaultValue(field.defaultValue);
|
|
2759
3459
|
source = "default";
|
|
2760
3460
|
}
|
|
2761
3461
|
if (value === undefined) {
|
|
@@ -2764,10 +3464,18 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2764
3464
|
}
|
|
2765
3465
|
errors.push({
|
|
2766
3466
|
path: field.displayPath,
|
|
2767
|
-
message:
|
|
3467
|
+
message: formatMissingParameterMessage(field)
|
|
2768
3468
|
});
|
|
2769
3469
|
continue;
|
|
2770
3470
|
}
|
|
3471
|
+
if (field.schema.kind === "json") {
|
|
3472
|
+
const validation = validateSchema(field.schema, value);
|
|
3473
|
+
if (!validation.ok) {
|
|
3474
|
+
errors.push(...validation.issues.map((issue) => formatFieldValidationIssue(issue, field.displayPath)));
|
|
3475
|
+
continue;
|
|
3476
|
+
}
|
|
3477
|
+
value = validation.value;
|
|
3478
|
+
}
|
|
2771
3479
|
resolvedFieldValues.set(field.id, value);
|
|
2772
3480
|
if (source !== undefined && source !== "default") {
|
|
2773
3481
|
providedFieldIds.add(field.id);
|
|
@@ -2776,16 +3484,17 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2776
3484
|
setNestedValue(params, field.path, value);
|
|
2777
3485
|
}
|
|
2778
3486
|
}
|
|
2779
|
-
const dynamicResults = dynamicFields.length > 0
|
|
2780
|
-
? parseDynamicValues(dynamicFields, rawArgv, casing, errors)
|
|
2781
|
-
: {
|
|
2782
|
-
providedFieldIds: new Set(),
|
|
2783
|
-
values: new Map()
|
|
2784
|
-
};
|
|
2785
3487
|
for (const field of dynamicFields) {
|
|
3488
|
+
if (defaultRoots.has(field.path[0]))
|
|
3489
|
+
continue;
|
|
2786
3490
|
let value = dynamicResults.values.get(field.id);
|
|
2787
|
-
if (
|
|
2788
|
-
value
|
|
3491
|
+
if (presetValues.dynamic.has(field.id)) {
|
|
3492
|
+
if (value === undefined)
|
|
3493
|
+
value = presetValues.dynamic.get(field.id);
|
|
3494
|
+
dynamicResults.providedFieldIds.add(field.id);
|
|
3495
|
+
}
|
|
3496
|
+
if (value === undefined && field.hasDefault && field.variantId === undefined) {
|
|
3497
|
+
value = cloneDefaultValue(field.defaultValue);
|
|
2789
3498
|
}
|
|
2790
3499
|
if (value === undefined) {
|
|
2791
3500
|
if (field.optional || field.variantId !== undefined) {
|
|
@@ -2799,36 +3508,61 @@ async function resolveParams(fields, dynamicFields, variants, positionalValues,
|
|
|
2799
3508
|
}
|
|
2800
3509
|
setNestedValue(params, field.path, value);
|
|
2801
3510
|
}
|
|
2802
|
-
await enforceVariantConstraints(params, fields, dynamicFields, variants, resolvedFieldValues, dynamicResults.providedFieldIds, providedFieldIds, shouldPrompt, errors);
|
|
3511
|
+
await enforceVariantConstraints(params, fields, dynamicFields, variants.filter(variant => !defaultRoots.has(fieldRoot(fields.find(field => field.id === variant.controlFieldId)))), resolvedFieldValues, dynamicResults.providedFieldIds, providedFieldIds, shouldPrompt, errors, promptStreams);
|
|
2803
3512
|
throwValidationErrors(errors);
|
|
2804
3513
|
return params;
|
|
2805
3514
|
}
|
|
2806
3515
|
function getResolvedFlags(command) {
|
|
2807
|
-
const flags =
|
|
3516
|
+
const flags = {};
|
|
3517
|
+
const commands = [];
|
|
3518
|
+
for (let current = command; current !== null; current = current.parent) {
|
|
3519
|
+
commands.unshift(current);
|
|
3520
|
+
}
|
|
3521
|
+
for (const current of commands) {
|
|
3522
|
+
Object.assign(flags, current.opts());
|
|
3523
|
+
}
|
|
2808
3524
|
return flags;
|
|
2809
3525
|
}
|
|
2810
|
-
async function executeCommand(state, services, requirementOptions, runtimeFetch,
|
|
2811
|
-
const logger = createLogger();
|
|
3526
|
+
async function executeCommand(state, rootUsageName, services, requirementOptions, runtimeFetch, humanInLoop, runtimeEnv, runtimeFs, outputEmitter, outputFormats, promptStreams, diagnosticsOptions, onErrorReportContext, invocation) {
|
|
3527
|
+
const logger = createLogger(outputEmitter);
|
|
3528
|
+
const optionValues = getResolvedFlags(state.actionCommand);
|
|
3529
|
+
const resolvedFlags = optionValues;
|
|
3530
|
+
const output = resolveOutput(resolvedFlags);
|
|
2812
3531
|
const primitives = {
|
|
2813
3532
|
logger,
|
|
2814
3533
|
renderTable,
|
|
2815
3534
|
getTheme,
|
|
2816
|
-
note
|
|
3535
|
+
note: invocation ? (message, title) => note(message, title, invocation.write) : note,
|
|
3536
|
+
outputFormat: output
|
|
2817
3537
|
};
|
|
2818
|
-
const optionValues = state.actionCommand.optsWithGlobals();
|
|
2819
|
-
const resolvedFlags = optionValues;
|
|
2820
|
-
const output = resolveOutput(resolvedFlags);
|
|
2821
3538
|
const diagnostics = createRuntimeLogger({
|
|
2822
3539
|
level: resolvedFlags.logLevel ??
|
|
2823
3540
|
(diagnosticsOptions.verboseControlEnabled && resolvedFlags.verbose
|
|
2824
3541
|
? "trace"
|
|
2825
3542
|
: diagnosticsOptions.logLevel),
|
|
2826
|
-
logger: diagnosticsOptions.logger ??
|
|
3543
|
+
logger: diagnosticsOptions.logger ?? (invocation
|
|
3544
|
+
? (event) => invocation.write(`${event.message}\n`, "stderr")
|
|
3545
|
+
: writeCLIDiagnosticEvent)
|
|
2827
3546
|
});
|
|
2828
|
-
const
|
|
2829
|
-
const
|
|
3547
|
+
const promptInput = promptStreams.input ?? (invocation ? { isTTY: false } : process.stdin);
|
|
3548
|
+
const promptOutput = promptStreams.output ?? (invocation ? { isTTY: false } : process.stdout);
|
|
3549
|
+
const stdinTTY = Boolean(promptInput.isTTY);
|
|
3550
|
+
const stdoutTTY = Boolean(promptOutput.isTTY);
|
|
3551
|
+
const shouldPrompt = !resolvedFlags.yes && stdinTTY;
|
|
3552
|
+
const missingParameterContext = !resolvedFlags.yes && output === "rich" && stdinTTY && stdoutTTY
|
|
3553
|
+
? {
|
|
3554
|
+
commandPath: state.commandPath,
|
|
3555
|
+
params: {},
|
|
3556
|
+
output: "rich",
|
|
3557
|
+
stdinTTY,
|
|
3558
|
+
stdoutTTY
|
|
3559
|
+
}
|
|
3560
|
+
: undefined;
|
|
3561
|
+
const runtime = await resolveFixtureRuntime(state.command, services, requirementOptions, runtimeFetch, runtimeEnv, runtimeFs, invocation !== undefined);
|
|
2830
3562
|
const preflightContext = {
|
|
2831
3563
|
...runtime.services,
|
|
3564
|
+
...invocation?.capabilities,
|
|
3565
|
+
...(invocation ? { signal: invocation.signal } : {}),
|
|
2832
3566
|
secrets: runtime.secrets,
|
|
2833
3567
|
fetch: runtime.fetch,
|
|
2834
3568
|
fs: runtime.fs,
|
|
@@ -2842,19 +3576,96 @@ async function executeCommand(state, services, requirementOptions, runtimeFetch,
|
|
|
2842
3576
|
let runtimeSecrets;
|
|
2843
3577
|
let resolvedParams;
|
|
2844
3578
|
try {
|
|
2845
|
-
await withOutputFormat(output, async () => {
|
|
2846
|
-
|
|
2847
|
-
|
|
3579
|
+
await withOutputFormat(toDesignSystemOutput(output), async () => {
|
|
3580
|
+
if (!invocation)
|
|
3581
|
+
await assertCommandRequirements(state.command, preflightContext, runtime.requirementOptions);
|
|
3582
|
+
const params = await resolveParams(state.fields, state.dynamicFields, state.variants, state.positionalValues, optionValues, state.rawArgv, state.casing, state.presetsEnabled ? resolvedFlags.preset : undefined, shouldPrompt, missingParameterContext, promptStreams, invocation?.defaults?.[state.declarationPath.join("/")]);
|
|
3583
|
+
const paramsSchema = state.command.params;
|
|
3584
|
+
if (paramsSchema !== undefined && paramsSchema[nativeJsonSchema] !== undefined) {
|
|
3585
|
+
const validation = validateSchema(paramsSchema, params);
|
|
3586
|
+
if (!validation.ok)
|
|
3587
|
+
throwValidationErrors(validation.issues.map((issue) => formatFieldValidationIssue(issue, "")));
|
|
3588
|
+
}
|
|
3589
|
+
if (invocation) {
|
|
3590
|
+
const validation = validateSchema(state.command.params, params);
|
|
3591
|
+
if (!validation.ok) {
|
|
3592
|
+
throwValidationErrors(validation.issues.map((issue) => formatFieldValidationIssue(issue, "")));
|
|
3593
|
+
return;
|
|
3594
|
+
}
|
|
3595
|
+
Object.assign(params, validation.value);
|
|
3596
|
+
invocation.signal.throwIfAborted();
|
|
3597
|
+
await assertCommandRequirements(state.command, { ...preflightContext, params }, runtime.requirementOptions);
|
|
3598
|
+
if (state.command.confirm && !state.command.humanInLoop && !resolvedFlags.yes) {
|
|
3599
|
+
throw new UserError("Confirmation required; supply --yes to authorize this command.");
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
2848
3602
|
resolvedParams = params;
|
|
2849
3603
|
runtimeSecrets = runtime.secrets;
|
|
2850
3604
|
const context = {
|
|
2851
3605
|
...preflightContext,
|
|
2852
3606
|
params
|
|
2853
3607
|
};
|
|
3608
|
+
if (state.command.stream !== undefined) {
|
|
3609
|
+
const stream = createManagedStream({
|
|
3610
|
+
eventSchema: state.command.stream.event,
|
|
3611
|
+
signal: invocation?.signal,
|
|
3612
|
+
onStatus(event) {
|
|
3613
|
+
diagnostics.emit({
|
|
3614
|
+
level: "info",
|
|
3615
|
+
message: event.message ?? event.type,
|
|
3616
|
+
category: "runtime"
|
|
3617
|
+
});
|
|
3618
|
+
if (output === "rich" && event.message !== undefined) {
|
|
3619
|
+
logger.info(event.message);
|
|
3620
|
+
}
|
|
3621
|
+
},
|
|
3622
|
+
async create(signal, status) {
|
|
3623
|
+
return await state.command.handler({
|
|
3624
|
+
...context,
|
|
3625
|
+
signal,
|
|
3626
|
+
status,
|
|
3627
|
+
async refreshSecrets() {
|
|
3628
|
+
return resolveCommandSecrets(state.command, runtimeEnv);
|
|
3629
|
+
}
|
|
3630
|
+
});
|
|
3631
|
+
}
|
|
3632
|
+
});
|
|
3633
|
+
const interrupt = () => {
|
|
3634
|
+
void stream.cancel(new UserError("Operation cancelled.")).catch(() => undefined);
|
|
3635
|
+
};
|
|
3636
|
+
if (!invocation)
|
|
3637
|
+
process.once("SIGINT", interrupt);
|
|
3638
|
+
try {
|
|
3639
|
+
for await (const event of stream) {
|
|
3640
|
+
invocation?.signal.throwIfAborted();
|
|
3641
|
+
if (output === "json") {
|
|
3642
|
+
const line = JSON.stringify(event);
|
|
3643
|
+
if (outputEmitter === undefined) {
|
|
3644
|
+
process.stdout.write(`${line}\n`);
|
|
3645
|
+
}
|
|
3646
|
+
else {
|
|
3647
|
+
outputEmitter(line);
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
else {
|
|
3651
|
+
renderCLIResult(state.command, state.commandPath, event, output, primitives, outputFormats, invocation?.write ?? (outputEmitter === undefined
|
|
3652
|
+
? undefined
|
|
3653
|
+
: (chunk) => outputEmitter(chunk.endsWith("\n") ? chunk.slice(0, -1) : chunk)), outputEmitter);
|
|
3654
|
+
}
|
|
3655
|
+
await invocation?.flush();
|
|
3656
|
+
}
|
|
3657
|
+
invocation?.signal.throwIfAborted();
|
|
3658
|
+
}
|
|
3659
|
+
finally {
|
|
3660
|
+
if (!invocation)
|
|
3661
|
+
process.removeListener("SIGINT", interrupt);
|
|
3662
|
+
await stream.cancel();
|
|
3663
|
+
}
|
|
3664
|
+
return;
|
|
3665
|
+
}
|
|
2854
3666
|
if (state.command.confirm &&
|
|
2855
3667
|
!state.command.humanInLoop &&
|
|
2856
|
-
|
|
2857
|
-
process.stdin.isTTY) {
|
|
3668
|
+
shouldPrompt) {
|
|
2858
3669
|
for (const field of state.fields) {
|
|
2859
3670
|
const value = field.path.reduce((current, segment) => current && typeof current === "object"
|
|
2860
3671
|
? current[segment]
|
|
@@ -2865,27 +3676,36 @@ async function executeCommand(state, services, requirementOptions, runtimeFetch,
|
|
|
2865
3676
|
}
|
|
2866
3677
|
const proceed = await confirm({
|
|
2867
3678
|
message: "Proceed?",
|
|
2868
|
-
initialValue: true
|
|
3679
|
+
initialValue: true,
|
|
3680
|
+
...promptStreams
|
|
2869
3681
|
});
|
|
2870
3682
|
if (isCancel(proceed)) {
|
|
2871
|
-
cancel("Operation cancelled.");
|
|
2872
3683
|
throw new UserError("Operation cancelled.");
|
|
2873
3684
|
}
|
|
2874
3685
|
if (proceed !== true) {
|
|
2875
3686
|
throw new UserError("Operation cancelled.");
|
|
2876
3687
|
}
|
|
2877
3688
|
}
|
|
2878
|
-
const result =
|
|
3689
|
+
const result = state.command.humanInLoop && humanInLoop !== undefined
|
|
3690
|
+
? await humanInLoop.invoke(state.command, context, state.commandPath)
|
|
3691
|
+
: await state.command.handler(context);
|
|
2879
3692
|
if (output === "rich" && runtime.isFixture) {
|
|
2880
3693
|
writeRichHeader(`${state.command.name} (fixture)`);
|
|
2881
3694
|
}
|
|
2882
|
-
|
|
2883
|
-
|
|
3695
|
+
invocation?.signal.throwIfAborted();
|
|
3696
|
+
const pendingApproval = isHumanInLoopPending(result);
|
|
3697
|
+
if (pendingApproval && output === "rich") {
|
|
3698
|
+
renderHumanInLoopPending(result, rootUsageName, outputEmitter);
|
|
2884
3699
|
return;
|
|
2885
3700
|
}
|
|
2886
|
-
const renderStatus =
|
|
3701
|
+
const renderStatus = renderCLIResult(pendingApproval ? { ...state.command, render: undefined } : state.command, state.commandPath, result, output, primitives, outputFormats, invocation?.write ?? (outputEmitter === undefined
|
|
3702
|
+
? undefined
|
|
3703
|
+
: (chunk) => outputEmitter(chunk.endsWith("\n") ? chunk.slice(0, -1) : chunk)), outputEmitter);
|
|
2887
3704
|
if (renderStatus.mcpError) {
|
|
2888
|
-
|
|
3705
|
+
if (invocation)
|
|
3706
|
+
invocation.exitCode = 1;
|
|
3707
|
+
else
|
|
3708
|
+
process.exitCode = 1;
|
|
2889
3709
|
}
|
|
2890
3710
|
});
|
|
2891
3711
|
}
|
|
@@ -2899,6 +3719,25 @@ async function executeCommand(state, services, requirementOptions, runtimeFetch,
|
|
|
2899
3719
|
throw error;
|
|
2900
3720
|
}
|
|
2901
3721
|
}
|
|
3722
|
+
function renderCLIResult(command, commandPath, result, output, primitives, outputFormats, write, emitExact) {
|
|
3723
|
+
const customRenderer = outputFormats[output];
|
|
3724
|
+
if (customRenderer === undefined) {
|
|
3725
|
+
return renderResult(command, result, output, primitives, write);
|
|
3726
|
+
}
|
|
3727
|
+
const payload = customRenderer({ command, commandPath, primitives, result });
|
|
3728
|
+
if (payload !== undefined && payload.length > 0) {
|
|
3729
|
+
if (emitExact !== undefined) {
|
|
3730
|
+
emitExact(payload);
|
|
3731
|
+
}
|
|
3732
|
+
else if (write === undefined) {
|
|
3733
|
+
process.stdout.write(payload);
|
|
3734
|
+
}
|
|
3735
|
+
else {
|
|
3736
|
+
write(payload);
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
return { mcpError: false };
|
|
3740
|
+
}
|
|
2902
3741
|
function isStringRecord(value) {
|
|
2903
3742
|
return isPlainObject(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
2904
3743
|
}
|
|
@@ -3085,7 +3924,9 @@ function renderHttpError(error, options) {
|
|
|
3085
3924
|
else {
|
|
3086
3925
|
lines.push(`Response body: ${formatHttpErrorSnippet(error.response.body)}`);
|
|
3087
3926
|
}
|
|
3088
|
-
|
|
3927
|
+
if (options.verboseControlEnabled) {
|
|
3928
|
+
lines.push("Re-run with --verbose to see headers and full body.");
|
|
3929
|
+
}
|
|
3089
3930
|
}
|
|
3090
3931
|
process.stderr.write(`${lines.join("\n")}\n`);
|
|
3091
3932
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
@@ -3094,13 +3935,14 @@ function renderHttpError(error, options) {
|
|
|
3094
3935
|
}
|
|
3095
3936
|
}
|
|
3096
3937
|
async function handleRunError(error, options) {
|
|
3097
|
-
const logger = createLogger();
|
|
3098
|
-
await withOutputFormat(options.output, async () => {
|
|
3099
|
-
if (error
|
|
3938
|
+
const logger = createLogger(options.outputEmitter);
|
|
3939
|
+
await withOutputFormat(toDesignSystemOutput(options.output), async () => {
|
|
3940
|
+
if (isUserError(error)) {
|
|
3100
3941
|
renderCliErrorPattern(options.userErrorPattern === "definition"
|
|
3101
3942
|
? {
|
|
3102
3943
|
kind: "definition",
|
|
3103
3944
|
error,
|
|
3945
|
+
debugControlEnabled: options.debugControlEnabled,
|
|
3104
3946
|
debugStackMode: options.debugStackMode
|
|
3105
3947
|
}
|
|
3106
3948
|
: options.userErrorPattern === "usage"
|
|
@@ -3113,15 +3955,16 @@ async function handleRunError(error, options) {
|
|
|
3113
3955
|
: {
|
|
3114
3956
|
kind: "runtime-user",
|
|
3115
3957
|
message: error.message
|
|
3116
|
-
});
|
|
3958
|
+
}, options.outputEmitter);
|
|
3117
3959
|
return;
|
|
3118
3960
|
}
|
|
3119
3961
|
if (error instanceof Error && error.name === "ToolcraftBugError") {
|
|
3120
3962
|
renderCliErrorPattern({
|
|
3121
3963
|
kind: "toolcraft-bug",
|
|
3122
3964
|
error,
|
|
3965
|
+
debugControlEnabled: options.debugControlEnabled,
|
|
3123
3966
|
debugStackMode: options.debugStackMode
|
|
3124
|
-
});
|
|
3967
|
+
}, options.outputEmitter);
|
|
3125
3968
|
return;
|
|
3126
3969
|
}
|
|
3127
3970
|
if (error instanceof CommanderError) {
|
|
@@ -3164,8 +4007,9 @@ async function handleRunError(error, options) {
|
|
|
3164
4007
|
kind: "unexpected",
|
|
3165
4008
|
message,
|
|
3166
4009
|
stack: error instanceof Error ? error.stack : undefined,
|
|
4010
|
+
debugControlEnabled: options.debugControlEnabled,
|
|
3167
4011
|
debugStackMode: options.debugStackMode
|
|
3168
|
-
});
|
|
4012
|
+
}, options.outputEmitter);
|
|
3169
4013
|
});
|
|
3170
4014
|
}
|
|
3171
4015
|
function formatCommanderErrorMessage(error) {
|
|
@@ -3384,7 +4228,7 @@ function isCommandNameCharacter(character) {
|
|
|
3384
4228
|
const isLowercaseLetter = code >= 97 && code <= 122;
|
|
3385
4229
|
const isUppercaseLetter = code >= 65 && code <= 90;
|
|
3386
4230
|
const isDigit = code >= 48 && code <= 57;
|
|
3387
|
-
return isLowercaseLetter || isUppercaseLetter || isDigit || character === "-" || character === "_";
|
|
4231
|
+
return (isLowercaseLetter || isUppercaseLetter || isDigit || character === "-" || character === "_");
|
|
3388
4232
|
}
|
|
3389
4233
|
function getDefaultCommanderCommandName(command) {
|
|
3390
4234
|
const candidate = command;
|
|
@@ -3392,57 +4236,65 @@ function getDefaultCommanderCommandName(command) {
|
|
|
3392
4236
|
? candidate._defaultCommandName
|
|
3393
4237
|
: undefined;
|
|
3394
4238
|
}
|
|
3395
|
-
function configureCommanderSuggestionOutput(command) {
|
|
4239
|
+
function configureCommanderSuggestionOutput(command, version) {
|
|
3396
4240
|
command.exitOverride();
|
|
4241
|
+
command.enablePositionalOptions();
|
|
4242
|
+
command.helpOption(false);
|
|
4243
|
+
if (version !== undefined && !command.options.some((option) => option.long === "--version")) {
|
|
4244
|
+
command.version(version, "--version");
|
|
4245
|
+
}
|
|
3397
4246
|
command.configureOutput({
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
}
|
|
3402
|
-
write(message);
|
|
3403
|
-
}
|
|
4247
|
+
// Every Commander error throws through exitOverride and is rendered once by handleRunError
|
|
4248
|
+
// in the design-system error pattern; writing it here as well double-reports one mistake.
|
|
4249
|
+
outputError: () => { }
|
|
3404
4250
|
});
|
|
3405
|
-
command.commands.forEach((child) => configureCommanderSuggestionOutput(child));
|
|
4251
|
+
command.commands.forEach((child) => configureCommanderSuggestionOutput(child, version));
|
|
3406
4252
|
}
|
|
3407
4253
|
export async function runCLI(roots, options = {}) {
|
|
3408
4254
|
enableSourceMaps();
|
|
4255
|
+
await executeCLICommand(roots, options);
|
|
4256
|
+
}
|
|
4257
|
+
/** Shared parser, validation and dispatch; native callers supply a local runtime. */
|
|
4258
|
+
export async function executeCLICommand(roots, options, invocation) {
|
|
3409
4259
|
const controls = resolveCLIControls(options.controls);
|
|
3410
|
-
|
|
3411
|
-
? normalizeVerboseAlias([...(options.argv ?? process.argv)])
|
|
3412
|
-
: [...(options.argv ?? process.argv)];
|
|
4260
|
+
let argv = [...(options.argv ?? process.argv)];
|
|
3413
4261
|
const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
|
|
3414
4262
|
let lastActionCommand;
|
|
3415
4263
|
let resolvedCommandPath = "";
|
|
3416
4264
|
let program;
|
|
3417
4265
|
let version;
|
|
4266
|
+
let proxyCleanup;
|
|
3418
4267
|
let userErrorPattern = "definition";
|
|
3419
4268
|
let errorReportContext;
|
|
3420
4269
|
try {
|
|
3421
4270
|
const normalizedRoot = normalizeRoots(roots, argv);
|
|
3422
|
-
const root =
|
|
3423
|
-
|
|
4271
|
+
const root = mergeApprovalsRoot(normalizedRoot, options);
|
|
4272
|
+
assertHumanInLoopWired(root, options.humanInLoop);
|
|
4273
|
+
if (hasMcpProxyConfig(root)) {
|
|
4274
|
+
if (invocation)
|
|
4275
|
+
throw new UserError("MCP proxy discovery requires the standalone CLI; native library plugins support in-process handlers only.");
|
|
4276
|
+
const proxyRuntime = await importOptionalModule(optionalModulePaths.mcpProxy);
|
|
4277
|
+
await proxyRuntime.resolveMcpProxies(root, { projectRoot: options.projectRoot });
|
|
4278
|
+
proxyCleanup = { dispose: proxyRuntime.disposeMcpProxies, root };
|
|
4279
|
+
}
|
|
3424
4280
|
const casing = options.casing ?? "kebab";
|
|
3425
4281
|
const services = (options.services ?? {});
|
|
3426
|
-
const
|
|
4282
|
+
const humanInLoop = options.humanInLoop;
|
|
3427
4283
|
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
3428
|
-
version = options.version ?? findEntrypointPackageMetadata(argv[1])?.version;
|
|
4284
|
+
version = options.version ?? (invocation ? undefined : findEntrypointPackageMetadata(argv[1])?.version);
|
|
3429
4285
|
const servicesWithBuiltIns = {
|
|
3430
4286
|
...services,
|
|
3431
|
-
|
|
4287
|
+
humanInLoop,
|
|
3432
4288
|
root
|
|
3433
4289
|
};
|
|
3434
4290
|
const requirementOptions = {
|
|
3435
|
-
apiVersion: options.apiVersion
|
|
4291
|
+
apiVersion: options.apiVersion,
|
|
4292
|
+
env: options.env
|
|
3436
4293
|
};
|
|
3437
4294
|
validateServices(services);
|
|
3438
|
-
if (hasHelpFlag(argv)) {
|
|
3439
|
-
userErrorPattern = "usage";
|
|
3440
|
-
await renderGeneratedHelp(root, argv, { ...options, version });
|
|
3441
|
-
return;
|
|
3442
|
-
}
|
|
3443
4295
|
if (argv.length <= 2 && root.default?.scope.includes("cli") !== true) {
|
|
3444
4296
|
userErrorPattern = "usage";
|
|
3445
|
-
await renderGeneratedHelp(root, argv, { ...options, version });
|
|
4297
|
+
await renderGeneratedHelp(root, argv, { ...options, version }, invocation);
|
|
3446
4298
|
return;
|
|
3447
4299
|
}
|
|
3448
4300
|
program = new CommanderCommand();
|
|
@@ -3452,6 +4304,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
3452
4304
|
program.addHelpCommand(false);
|
|
3453
4305
|
const presetsEnabled = options.presets === true;
|
|
3454
4306
|
const globalLongOptionFlags = getGlobalLongOptionFlags(presetsEnabled, version !== undefined, controls);
|
|
4307
|
+
const fieldLoaders = new Map();
|
|
3455
4308
|
addGlobalOptions(program, presetsEnabled, controls);
|
|
3456
4309
|
if (version !== undefined) {
|
|
3457
4310
|
program.version(version, "--version");
|
|
@@ -3462,19 +4315,22 @@ export async function runCLI(roots, options = {}) {
|
|
|
3462
4315
|
const execute = async (state) => {
|
|
3463
4316
|
lastActionCommand = state.actionCommand;
|
|
3464
4317
|
resolvedCommandPath = formatCliCommandPath(state.commandPath);
|
|
3465
|
-
await executeCommand(state, servicesWithBuiltIns, requirementOptions, runtimeFetch,
|
|
4318
|
+
await executeCommand(state, rootUsageName, servicesWithBuiltIns, requirementOptions, runtimeFetch, humanInLoop, options.env, options.fs, options.outputEmitter, controls.outputFormats, {
|
|
4319
|
+
input: options.promptInput,
|
|
4320
|
+
output: options.promptOutput
|
|
4321
|
+
}, {
|
|
3466
4322
|
logLevel: options.logLevel,
|
|
3467
4323
|
logger: options.logger,
|
|
3468
4324
|
verboseControlEnabled: controls.verbose
|
|
3469
4325
|
}, (context) => {
|
|
3470
4326
|
errorReportContext = context;
|
|
3471
|
-
});
|
|
4327
|
+
}, invocation);
|
|
3472
4328
|
};
|
|
3473
4329
|
const rootChildNames = new Set(root.children
|
|
3474
4330
|
.filter((candidate) => isNodeVisibleInScope(candidate, "cli"))
|
|
3475
4331
|
.map((candidate) => candidate.name));
|
|
3476
4332
|
for (const child of root.children) {
|
|
3477
|
-
const command = createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls);
|
|
4333
|
+
const command = createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls, fieldLoaders);
|
|
3478
4334
|
if (command === null) {
|
|
3479
4335
|
continue;
|
|
3480
4336
|
}
|
|
@@ -3483,25 +4339,60 @@ export async function runCLI(roots, options = {}) {
|
|
|
3483
4339
|
(command.name() === root.default.name || command.aliases().includes(root.default.name));
|
|
3484
4340
|
addCommanderChild(program, command, isDefaultChild, rootChildNames);
|
|
3485
4341
|
}
|
|
3486
|
-
configureCommanderSuggestionOutput(program);
|
|
4342
|
+
configureCommanderSuggestionOutput(program, version);
|
|
4343
|
+
if (invocation) {
|
|
4344
|
+
const configure = (command) => {
|
|
4345
|
+
command.configureOutput({ writeOut: chunk => invocation.write(chunk), writeErr: chunk => invocation.write(chunk, "stderr") });
|
|
4346
|
+
command.commands.forEach(configure);
|
|
4347
|
+
};
|
|
4348
|
+
configure(program);
|
|
4349
|
+
}
|
|
4350
|
+
const prepared = prepareCliArguments(program, argv, fieldLoaders, casing, controls);
|
|
4351
|
+
argv = prepared.argv;
|
|
4352
|
+
if (prepared.helpArgv !== undefined) {
|
|
4353
|
+
userErrorPattern = "usage";
|
|
4354
|
+
await renderGeneratedHelp(root, prepared.helpArgv, { ...options, version }, invocation);
|
|
4355
|
+
return;
|
|
4356
|
+
}
|
|
4357
|
+
for (const loadFields of fieldLoaders.values()) {
|
|
4358
|
+
loadFields();
|
|
4359
|
+
}
|
|
3487
4360
|
const unknownCommand = findUnknownCommanderCommand(program, argv);
|
|
3488
4361
|
if (unknownCommand !== undefined) {
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
4362
|
+
if (invocation)
|
|
4363
|
+
throw new UserError(formatUnknownCommandMessage(unknownCommand.input, unknownCommand.currentCommand));
|
|
4364
|
+
await withOutputFormat(toDesignSystemOutput(resolveOutputFromArgv(argv, controls.outputFormats)), async () => {
|
|
4365
|
+
renderCliErrorPattern({
|
|
4366
|
+
kind: "usage",
|
|
4367
|
+
message: formatUnknownCommandMessage(unknownCommand.input, unknownCommand.currentCommand),
|
|
4368
|
+
rootUsageName,
|
|
4369
|
+
commandPath: unknownCommand.commandPath
|
|
4370
|
+
}, options.outputEmitter);
|
|
4371
|
+
});
|
|
3494
4372
|
return;
|
|
3495
4373
|
}
|
|
3496
4374
|
userErrorPattern = "usage";
|
|
3497
4375
|
await program.parseAsync(argv);
|
|
3498
4376
|
}
|
|
3499
4377
|
catch (error) {
|
|
3500
|
-
if (
|
|
3501
|
-
|
|
4378
|
+
if (invocation) {
|
|
4379
|
+
if (invocation.signal.aborted)
|
|
4380
|
+
throw invocation.signal.reason;
|
|
4381
|
+
invocation.exitCode = error instanceof CommanderError ? error.exitCode : 1;
|
|
4382
|
+
if (!(error instanceof CommanderError && error.exitCode === 0)) {
|
|
4383
|
+
invocation.write(`${error instanceof Error ? error.message : String(error)}\n`, "stderr");
|
|
4384
|
+
}
|
|
3502
4385
|
return;
|
|
3503
4386
|
}
|
|
3504
4387
|
const resolvedFlags = lastActionCommand ? getResolvedFlags(lastActionCommand) : undefined;
|
|
4388
|
+
if (error instanceof ApprovalDeclinedError) {
|
|
4389
|
+
await withOutputFormat(toDesignSystemOutput(resolvedFlags !== undefined
|
|
4390
|
+
? resolveOutput(resolvedFlags)
|
|
4391
|
+
: resolveOutputFromArgv(argv, controls.outputFormats)), async () => {
|
|
4392
|
+
renderCliErrorPattern({ kind: "runtime-user", message: error.message }, options.outputEmitter);
|
|
4393
|
+
});
|
|
4394
|
+
return;
|
|
4395
|
+
}
|
|
3505
4396
|
const report = await writeErrorReport({
|
|
3506
4397
|
argv,
|
|
3507
4398
|
command: errorReportContext?.command,
|
|
@@ -3518,16 +4409,35 @@ export async function runCLI(roots, options = {}) {
|
|
|
3518
4409
|
process.stderr.write(`Saved error report to ${report.displayPath}\n`);
|
|
3519
4410
|
}
|
|
3520
4411
|
await handleRunError(error, {
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
4412
|
+
debugControlEnabled: controls.debug,
|
|
4413
|
+
debugStackMode: controls.debug
|
|
4414
|
+
? resolvedFlags !== undefined
|
|
4415
|
+
? resolveDebugStackMode(resolvedFlags.debug)
|
|
4416
|
+
: getDebugStackModeFromArgv(argv)
|
|
4417
|
+
: undefined,
|
|
4418
|
+
output: resolvedFlags !== undefined
|
|
4419
|
+
? resolveOutput(resolvedFlags)
|
|
4420
|
+
: resolveOutputFromArgv(argv, controls.outputFormats),
|
|
3525
4421
|
verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
|
|
4422
|
+
verboseControlEnabled: controls.verbose,
|
|
3526
4423
|
program,
|
|
3527
4424
|
argv,
|
|
3528
4425
|
rootUsageName,
|
|
3529
4426
|
commandPath: resolvedCommandPath,
|
|
4427
|
+
outputEmitter: options.outputEmitter,
|
|
3530
4428
|
userErrorPattern: errorReportContext?.params === undefined ? userErrorPattern : "runtime-user"
|
|
3531
4429
|
});
|
|
3532
4430
|
}
|
|
4431
|
+
finally {
|
|
4432
|
+
await invocation?.flush();
|
|
4433
|
+
if (proxyCleanup !== undefined) {
|
|
4434
|
+
try {
|
|
4435
|
+
await proxyCleanup.dispose(proxyCleanup.root);
|
|
4436
|
+
}
|
|
4437
|
+
catch (error) {
|
|
4438
|
+
process.exitCode = 1;
|
|
4439
|
+
process.stderr.write(`Failed to close MCP proxy connections: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
3533
4443
|
}
|