@sammorrowdrums/mcpi 0.70.8 → 0.85.0-bootstrap.0
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/CHANGELOG.md +1621 -0
- package/LICENSE +21 -0
- package/README.md +196 -141
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +4 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +1 -1
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +9 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +116 -16
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +103 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +6 -4
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +4 -4
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/experimental/auth.d.ts +16 -0
- package/dist/cli/experimental/auth.d.ts.map +1 -0
- package/dist/cli/experimental/auth.js +13 -0
- package/dist/cli/experimental/auth.js.map +1 -0
- package/dist/cli/experimental/cli.d.ts +6 -0
- package/dist/cli/experimental/cli.d.ts.map +1 -0
- package/dist/cli/experimental/cli.js +5 -0
- package/dist/cli/experimental/cli.js.map +1 -0
- package/dist/cli/experimental/command-options.d.ts +17 -0
- package/dist/cli/experimental/command-options.d.ts.map +1 -0
- package/dist/cli/experimental/command-options.js +35 -0
- package/dist/cli/experimental/command-options.js.map +1 -0
- package/dist/cli/experimental/command.d.ts +63 -0
- package/dist/cli/experimental/command.d.ts.map +1 -0
- package/dist/cli/experimental/command.js +130 -0
- package/dist/cli/experimental/command.js.map +1 -0
- package/dist/cli/experimental/commands/client.d.ts +13 -0
- package/dist/cli/experimental/commands/client.d.ts.map +1 -0
- package/dist/cli/experimental/commands/client.js +25 -0
- package/dist/cli/experimental/commands/client.js.map +1 -0
- package/dist/cli/experimental/commands/mcpi.d.ts +15 -0
- package/dist/cli/experimental/commands/mcpi.d.ts.map +1 -0
- package/dist/cli/experimental/commands/mcpi.js +28 -0
- package/dist/cli/experimental/commands/mcpi.js.map +1 -0
- package/dist/cli/experimental/commands/server.d.ts +13 -0
- package/dist/cli/experimental/commands/server.d.ts.map +1 -0
- package/dist/cli/experimental/commands/server.js +25 -0
- package/dist/cli/experimental/commands/server.js.map +1 -0
- package/dist/cli/experimental/transport-address.d.ts +10 -0
- package/dist/cli/experimental/transport-address.d.ts.map +1 -0
- package/dist/cli/experimental/transport-address.js +38 -0
- package/dist/cli/experimental/transport-address.js.map +1 -0
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +13 -26
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.d.ts +2 -2
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +4 -4
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/session-picker.d.ts +3 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +5 -4
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +184 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -3
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/config.d.ts +34 -12
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +312 -61
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +11 -9
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -7
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +13 -12
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +34 -14
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +110 -53
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +662 -488
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-guidance.js.map +1 -1
- package/dist/core/auth-storage.d.ts +35 -104
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +272 -286
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +11 -8
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +16 -6
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +13 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +25 -9
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +163 -133
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts +3 -3
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +3 -3
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +7 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/env-overlay.d.ts +21 -0
- package/dist/core/env-overlay.d.ts.map +1 -0
- package/dist/core/env-overlay.js +25 -0
- package/dist/core/env-overlay.js.map +1 -0
- package/dist/core/exec.d.ts +8 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +7 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts +6 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +8 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +2 -2
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +8 -6
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +53 -4
- package/dist/core/export-html/template.js +129 -35
- package/dist/core/export-html/tool-renderer.d.ts +2 -8
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +15 -2
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/export-html/vendor/marked.min.js +75 -3
- package/dist/core/extensions/index.d.ts +8 -8
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +5 -7
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +161 -79
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +32 -12
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +194 -3
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +217 -59
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +3 -3
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +22 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +12 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +30 -2
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +96 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +9 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +79 -10
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +11 -10
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +2 -2
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +571 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +254 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +23 -110
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +65 -616
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +20 -7
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +139 -43
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +100 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +602 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +113 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/output-guard.d.ts +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +52 -22
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +21 -4
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +428 -191
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts +8 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +25 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +4 -2
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +36 -50
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +72 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-composer.d.ts +58 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +396 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +17 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +137 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +13 -6
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +143 -22
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +40 -12
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +236 -87
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +26 -25
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +56 -49
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +42 -19
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +454 -223
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +77 -8
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +255 -67
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +2 -2
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +12 -34
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +1 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +15 -25
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts +7 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js +7 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts +5 -3
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +26 -16
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +11 -5
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +224 -185
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +26 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +110 -23
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +11 -5
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +67 -100
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +27 -12
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/find.d.ts +10 -3
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +41 -37
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +7 -3
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +12 -8
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +18 -18
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +7 -3
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +17 -15
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +2 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +39 -21
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/read.d.ts +7 -3
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +101 -51
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +5 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +18 -2
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +2 -2
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -3
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +12 -2
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +6 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +35 -45
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +202 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/core/usage-totals.d.ts +19 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +52 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +3 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +302 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +141 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +217 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +121 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +416 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- package/dist/index.d.ts +34 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +311 -101
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +5 -5
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +10 -10
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +6 -5
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +8 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +55 -26
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -2
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +4 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +2 -2
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -2
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -2
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +37 -6
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +318 -34
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +3 -3
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +2 -2
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +2 -2
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +9 -2
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +6 -4
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +11 -3
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +5 -4
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +19 -32
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +3 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +7 -2
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +9 -4
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +52 -31
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +33 -31
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +2 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +6 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +20 -6
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +12 -6
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +46 -17
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +13 -6
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +92 -44
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +7 -4
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -28
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +5 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +52 -14
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +4 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +18 -16
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +23 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +322 -22
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -2
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +2 -2
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +3 -2
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -2
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +33 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +7 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +179 -26
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +9 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +26 -6
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +104 -26
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1565 -692
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +34 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +10 -5
- package/dist/modes/interactive/theme/light.json +10 -5
- package/dist/modes/interactive/theme/theme-controller.d.ts +40 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +125 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +22 -5
- package/dist/modes/interactive/theme/theme.d.ts +48 -7
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +194 -76
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +31 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +15 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +3 -3
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +16 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +33 -10
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +89 -11
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +69 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +43 -5
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +6 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +527 -25
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/path-migration.d.ts +13 -0
- package/dist/path-migration.d.ts.map +1 -0
- package/dist/path-migration.js +52 -0
- package/dist/path-migration.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/server/create-harness.d.ts +26 -0
- package/dist/server/create-harness.d.ts.map +1 -0
- package/dist/server/create-harness.js +106 -0
- package/dist/server/create-harness.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +48 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +2 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +85 -0
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts +12 -5
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +33 -5
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +4 -4
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +4 -1
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js +14 -8
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +129 -46
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +54 -22
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +1 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +21 -15
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +7 -27
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +75 -115
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +23 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +50 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +100 -16
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +28 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +97 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +18 -6
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +19 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +45 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +10 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +105 -36
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +19 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +85 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +39 -32
- package/docs/containerization.md +113 -0
- package/docs/custom-provider.md +212 -75
- package/docs/development.md +9 -9
- package/docs/docs.json +156 -0
- package/docs/environment-variables.md +186 -0
- package/docs/extensions.md +652 -140
- package/docs/index.md +81 -0
- package/docs/json.md +26 -15
- package/docs/keybindings.md +60 -21
- package/docs/llama-cpp.md +99 -0
- package/docs/models.md +168 -34
- package/docs/packages.md +46 -36
- package/docs/prompt-templates.md +13 -5
- package/docs/providers.md +147 -26
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +218 -36
- package/docs/sdk.md +190 -125
- package/docs/security.md +59 -0
- package/docs/{session.md → session-format.md} +48 -22
- package/docs/sessions.md +145 -0
- package/docs/settings.md +130 -25
- package/docs/shell-aliases.md +2 -2
- package/docs/skills.md +13 -14
- package/docs/terminal-setup.md +73 -16
- package/docs/termux.md +10 -10
- package/docs/themes.md +41 -16
- package/docs/tmux.md +6 -4
- package/docs/tui.md +85 -61
- package/docs/usage.md +302 -0
- package/docs/windows.md +2 -2
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +12 -9
- package/examples/extensions/bash-spawn-hook.ts +2 -2
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +2 -2
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/custom-compaction.ts +6 -16
- package/examples/extensions/custom-footer.ts +1 -1
- package/examples/extensions/custom-header.ts +7 -7
- package/examples/extensions/custom-provider-anthropic/index.ts +15 -8
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +3 -3
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +65 -9
- package/examples/extensions/custom-provider-gitlab-duo/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
- package/examples/extensions/doom-overlay/README.md +1 -1
- package/examples/extensions/doom-overlay/doom-component.ts +4 -4
- package/examples/extensions/doom-overlay/doom-keys.ts +1 -1
- package/examples/extensions/doom-overlay/index.ts +5 -5
- package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +2 -2
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +50 -14
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/inline-bash.ts +2 -2
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +2 -2
- package/examples/extensions/interactive-shell.ts +2 -2
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/mac-system-theme.ts +2 -2
- package/examples/extensions/message-renderer.ts +3 -3
- package/examples/extensions/minimal-mode.ts +2 -2
- package/examples/extensions/modal-editor.ts +2 -2
- package/examples/extensions/model-status.ts +1 -1
- package/examples/extensions/notify.ts +3 -3
- package/examples/extensions/overlay-qa-tests.ts +242 -140
- package/examples/extensions/overlay-test.ts +9 -6
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/plan-mode/README.md +3 -2
- package/examples/extensions/plan-mode/index.ts +90 -40
- package/examples/extensions/preset.ts +16 -10
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/provider-payload.ts +5 -5
- package/examples/extensions/qna.ts +4 -8
- package/examples/extensions/question.ts +41 -19
- package/examples/extensions/questionnaire.ts +50 -29
- package/examples/extensions/rainbow-editor.ts +1 -1
- package/examples/extensions/reload-runtime.ts +2 -2
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +9 -9
- package/examples/extensions/sandbox/package-lock.json +7 -7
- package/examples/extensions/sandbox/package.json +3 -3
- package/examples/extensions/shutdown-command.ts +5 -5
- package/examples/extensions/snake.ts +2 -2
- package/examples/extensions/space-invaders.ts +2 -2
- package/examples/extensions/ssh.ts +2 -2
- package/examples/extensions/structured-output.ts +1 -1
- package/examples/extensions/subagent/README.md +18 -13
- package/examples/extensions/subagent/agents.ts +42 -11
- package/examples/extensions/subagent/index.ts +76 -30
- package/examples/extensions/summarize.ts +12 -19
- package/examples/extensions/tic-tac-toe.ts +2 -2
- package/examples/extensions/titlebar-spinner.ts +3 -3
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +7 -2
- package/examples/extensions/truncated-tool.ts +2 -2
- package/examples/extensions/with-deps/package-lock.json +4 -4
- package/examples/extensions/with-deps/package.json +4 -4
- package/examples/extensions/working-indicator.ts +4 -4
- package/examples/extensions/working-message-test.ts +1 -1
- package/examples/rpc-extension-ui.ts +11 -2
- package/examples/sdk/01-minimal.ts +15 -11
- package/examples/sdk/02-custom-model.ts +18 -18
- package/examples/sdk/03-custom-prompt.ts +25 -17
- package/examples/sdk/04-skills.ts +3 -3
- package/examples/sdk/05-tools.ts +8 -4
- package/examples/sdk/06-extensions.ts +13 -9
- package/examples/sdk/07-context-files.ts +2 -2
- package/examples/sdk/08-prompt-templates.ts +3 -3
- package/examples/sdk/09-api-keys-and-oauth.ts +19 -33
- package/examples/sdk/10-settings.ts +4 -4
- package/examples/sdk/11-sessions.ts +4 -0
- package/examples/sdk/12-full-control.ts +22 -21
- package/examples/sdk/README.md +23 -30
- package/npm-shrinkwrap.json +1818 -0
- package/package.json +117 -99
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/auth-selector-status.d.ts +0 -20
- package/dist/modes/interactive/components/auth-selector-status.d.ts.map +0 -1
- package/dist/modes/interactive/components/auth-selector-status.js +0 -23
- package/dist/modes/interactive/components/auth-selector-status.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -40
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/docs/images/exy.png +0 -0
- package/docs/tree.md +0 -233
- package/examples/extensions/antigravity-image-gen.ts +0 -418
- package/examples/extensions/custom-provider-qwen-cli/index.ts +0 -345
- package/examples/extensions/custom-provider-qwen-cli/package.json +0 -16
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Containerization
|
|
2
|
+
|
|
3
|
+
mcpi runs with all permissions by default, but in some cases, you will want to have more control over what directories mcpi can write to and which accesses it has.
|
|
4
|
+
|
|
5
|
+
There are two general options. You can either
|
|
6
|
+
1. run the whole `mcpi` process inside an isolated environment, or
|
|
7
|
+
2. run `mcpi` on the host and route tool execution into an isolated environment.
|
|
8
|
+
|
|
9
|
+
## Choose a pattern
|
|
10
|
+
|
|
11
|
+
| Pattern | What is isolated | Best for | Notes |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
|
|
14
|
+
| Plain Docker | Whole `mcpi` process in a local container | Simple local isolation | Provider API keys enter the container. |
|
|
15
|
+
| OpenShell | Whole `mcpi` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
|
|
16
|
+
|
|
17
|
+
Extensions run wherever the `mcpi` process runs. If you run host `mcpi` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
|
|
18
|
+
|
|
19
|
+
## Gondolin
|
|
20
|
+
|
|
21
|
+
[Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM.
|
|
22
|
+
Use the [example extension](../examples/extensions/gondolin) when you want `mcpi` on the host but all built-in tools routed into the VM.
|
|
23
|
+
|
|
24
|
+
Setup:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cp -R packages/coding-agent/examples/extensions/gondolin "${XDG_CONFIG_HOME:-$HOME/.config}/mcpi/extensions/gondolin"
|
|
28
|
+
cd "${XDG_CONFIG_HOME:-$HOME/.config}/mcpi/extensions/gondolin"
|
|
29
|
+
npm install --ignore-scripts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run from the project you want mounted:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cd /path/to/project
|
|
36
|
+
mcpi -e "${XDG_CONFIG_HOME:-$HOME/.config}/mcpi/extensions/gondolin"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The extension mounts the host cwd at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`.
|
|
40
|
+
User `!` commands are routed into the VM, as well.
|
|
41
|
+
File changes under `/workspace` write through to the host.
|
|
42
|
+
|
|
43
|
+
Requirements: Node.js >= 23.6.0 for `@earendil-works/gondolin`, plus QEMU (requires installation through your package manager).
|
|
44
|
+
|
|
45
|
+
## Plain Docker
|
|
46
|
+
|
|
47
|
+
Run the whole `mcpi` process in Docker when you want the simplest local container boundary.
|
|
48
|
+
|
|
49
|
+
`Dockerfile.mcpi`:
|
|
50
|
+
|
|
51
|
+
```dockerfile
|
|
52
|
+
FROM node:24-bookworm-slim
|
|
53
|
+
|
|
54
|
+
RUN apt-get update \
|
|
55
|
+
&& apt-get install -y --no-install-recommends bash ca-certificates git ripgrep \
|
|
56
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
57
|
+
RUN npm install -g --ignore-scripts @sammorrowdrums/mcpi
|
|
58
|
+
|
|
59
|
+
WORKDIR /workspace
|
|
60
|
+
ENTRYPOINT ["mcpi"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Build and run:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
docker build -t mcpi-sandbox -f Dockerfile.mcpi .
|
|
67
|
+
|
|
68
|
+
docker run --rm -it \
|
|
69
|
+
-e ANTHROPIC_API_KEY \
|
|
70
|
+
-v "$PWD:/workspace" \
|
|
71
|
+
-v mcpi-config:/root/.config/mcpi \
|
|
72
|
+
-v mcpi-state:/root/.local/state/mcpi \
|
|
73
|
+
-v mcpi-cache:/root/.cache/mcpi \
|
|
74
|
+
mcpi-sandbox
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The `-v "$PWD:/workspace"` mounts your current directory into the container at /workspace such that reads and writes in `/workspace` inside Docker directly affect your host files, like in the Gondolin example.
|
|
78
|
+
|
|
79
|
+
Use named volumes for `/root/.config/mcpi`, `/root/.local/state/mcpi`, and `/root/.cache/mcpi` if you want container-local settings, sessions, and caches. Mounting host config or state directories exposes host auth or session files to the container.
|
|
80
|
+
|
|
81
|
+
## OpenShell
|
|
82
|
+
|
|
83
|
+
Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) when you want a policy-controlled sandbox with filesystem, process, network, credential, and inference controls.
|
|
84
|
+
OpenShell can run sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
|
|
85
|
+
|
|
86
|
+
Every sandbox requires an active gateway.
|
|
87
|
+
Register and select one before creating a sandbox:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
openshell gateway add <gateway-url> --name <name>
|
|
91
|
+
openshell gateway select <name>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Launch `mcpi` inside an OpenShell sandbox:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
openshell sandbox create --name mcpi-sandbox --from mcpi -- mcpi
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
In this pattern, the whole `mcpi` process runs inside the sandbox.
|
|
101
|
+
Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
|
|
102
|
+
|
|
103
|
+
If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
|
|
104
|
+
Clone the repository inside the sandbox or use OpenShell file transfer commands:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
openshell sandbox upload mcpi-sandbox ./repo /workspace
|
|
108
|
+
openshell sandbox download mcpi-sandbox /workspace/repo ./repo-out
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
OpenShell providers can keep raw model API keys outside the sandbox.
|
|
112
|
+
When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
|
|
113
|
+
Configure mcpi to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
|
package/docs/custom-provider.md
CHANGED
|
@@ -13,7 +13,6 @@ See these complete provider examples:
|
|
|
13
13
|
|
|
14
14
|
- [`examples/extensions/custom-provider-anthropic/`](../examples/extensions/custom-provider-anthropic/)
|
|
15
15
|
- [`examples/extensions/custom-provider-gitlab-duo/`](../examples/extensions/custom-provider-gitlab-duo/)
|
|
16
|
-
- [`examples/extensions/custom-provider-qwen-cli/`](../examples/extensions/custom-provider-qwen-cli/)
|
|
17
16
|
|
|
18
17
|
## Table of Contents
|
|
19
18
|
|
|
@@ -24,16 +23,45 @@ See these complete provider examples:
|
|
|
24
23
|
- [Unregister Provider](#unregister-provider)
|
|
25
24
|
- [OAuth Support](#oauth-support)
|
|
26
25
|
- [Custom Streaming API](#custom-streaming-api)
|
|
26
|
+
- [Context Overflow Errors](#context-overflow-errors)
|
|
27
27
|
- [Testing Your Implementation](#testing-your-implementation)
|
|
28
28
|
- [Config Reference](#config-reference)
|
|
29
29
|
- [Model Definition Reference](#model-definition-reference)
|
|
30
30
|
|
|
31
31
|
## Quick Reference
|
|
32
32
|
|
|
33
|
+
Extensions can register either a complete pi-ai `Provider` or use the legacy provider-config form. Prefer a complete provider when custom authentication, filtering, refresh, or streaming behavior is required. mcpi composes `models.json` overrides above registered native providers.
|
|
34
|
+
|
|
33
35
|
```typescript
|
|
34
|
-
import
|
|
36
|
+
import { createProvider, openAICompletionsApi } from "@sammorrowdrums/mcpi-ai";
|
|
37
|
+
import type { ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
35
38
|
|
|
36
39
|
export default function (pi: ExtensionAPI) {
|
|
40
|
+
pi.registerProvider(createProvider({
|
|
41
|
+
id: "native-local",
|
|
42
|
+
name: "Native Local",
|
|
43
|
+
baseUrl: "http://localhost:8080/v1",
|
|
44
|
+
auth: {
|
|
45
|
+
apiKey: {
|
|
46
|
+
name: "Local server API key",
|
|
47
|
+
async login(interaction) {
|
|
48
|
+
return {
|
|
49
|
+
type: "api_key",
|
|
50
|
+
key: await interaction.prompt({ type: "secret", message: "API key" })
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
async resolve({ credential }) {
|
|
54
|
+
return credential?.key
|
|
55
|
+
? { auth: { apiKey: credential.key }, source: "stored API key" }
|
|
56
|
+
: undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
models: [],
|
|
61
|
+
api: openAICompletionsApi()
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
// Legacy provider-config form:
|
|
37
65
|
// Override baseUrl for existing provider
|
|
38
66
|
pi.registerProvider("anthropic", {
|
|
39
67
|
baseUrl: "https://proxy.example.com"
|
|
@@ -41,8 +69,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
41
69
|
|
|
42
70
|
// Register new provider with models
|
|
43
71
|
pi.registerProvider("my-provider", {
|
|
72
|
+
name: "My Provider",
|
|
44
73
|
baseUrl: "https://api.example.com",
|
|
45
|
-
apiKey: "MY_API_KEY",
|
|
74
|
+
apiKey: "$MY_API_KEY",
|
|
46
75
|
api: "openai-completions",
|
|
47
76
|
models: [
|
|
48
77
|
{
|
|
@@ -59,7 +88,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
59
88
|
}
|
|
60
89
|
```
|
|
61
90
|
|
|
62
|
-
The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`.
|
|
91
|
+
The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`. mcpi waits for the factory before startup continues, so the provider is available during interactive startup and to `mcpi --list-models`.
|
|
63
92
|
|
|
64
93
|
## Override Existing Provider
|
|
65
94
|
|
|
@@ -82,7 +111,7 @@ pi.registerProvider("openai", {
|
|
|
82
111
|
pi.registerProvider("google", {
|
|
83
112
|
baseUrl: "https://ai-gateway.corp.com/google",
|
|
84
113
|
headers: {
|
|
85
|
-
"X-Corp-Auth": "CORP_AUTH_TOKEN" // env var or literal
|
|
114
|
+
"X-Corp-Auth": "$CORP_AUTH_TOKEN" // env var or literal
|
|
86
115
|
}
|
|
87
116
|
});
|
|
88
117
|
```
|
|
@@ -96,7 +125,7 @@ To add a completely new provider, specify `models` along with the required confi
|
|
|
96
125
|
If the model list comes from a remote endpoint, use an async extension factory:
|
|
97
126
|
|
|
98
127
|
```typescript
|
|
99
|
-
import type { ExtensionAPI } from "@
|
|
128
|
+
import type { ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
100
129
|
|
|
101
130
|
export default async function (pi: ExtensionAPI) {
|
|
102
131
|
const response = await fetch("http://localhost:1234/v1/models");
|
|
@@ -111,7 +140,7 @@ export default async function (pi: ExtensionAPI) {
|
|
|
111
140
|
|
|
112
141
|
pi.registerProvider("local-openai", {
|
|
113
142
|
baseUrl: "http://localhost:1234/v1",
|
|
114
|
-
apiKey: "LOCAL_OPENAI_API_KEY",
|
|
143
|
+
apiKey: "$LOCAL_OPENAI_API_KEY",
|
|
115
144
|
api: "openai-completions",
|
|
116
145
|
models: payload.data.map((model) => ({
|
|
117
146
|
id: model.id,
|
|
@@ -131,7 +160,7 @@ This registers the fetched models before startup finishes.
|
|
|
131
160
|
```typescript
|
|
132
161
|
pi.registerProvider("my-llm", {
|
|
133
162
|
baseUrl: "https://api.my-llm.com/v1",
|
|
134
|
-
apiKey: "MY_LLM_API_KEY", // env var
|
|
163
|
+
apiKey: "$MY_LLM_API_KEY", // env var reference
|
|
135
164
|
api: "openai-completions", // which streaming API to use
|
|
136
165
|
models: [
|
|
137
166
|
{
|
|
@@ -154,6 +183,8 @@ pi.registerProvider("my-llm", {
|
|
|
154
183
|
|
|
155
184
|
When `models` is provided, it **replaces** all existing models for that provider.
|
|
156
185
|
|
|
186
|
+
`apiKey` and custom header values use the same config value syntax as `models.json`: `!command` at the start executes a command for the whole value, `$ENV_VAR` and `${ENV_VAR}` interpolate environment variables, `$$` emits a literal `$`, and `$!` emits a literal `!`.
|
|
187
|
+
|
|
157
188
|
## Unregister Provider
|
|
158
189
|
|
|
159
190
|
Use `pi.unregisterProvider(name)` to remove a provider that was previously registered via `pi.registerProvider(name, ...)`:
|
|
@@ -162,7 +193,7 @@ Use `pi.unregisterProvider(name)` to remove a provider that was previously regis
|
|
|
162
193
|
// Register
|
|
163
194
|
pi.registerProvider("my-llm", {
|
|
164
195
|
baseUrl: "https://api.my-llm.com/v1",
|
|
165
|
-
apiKey: "MY_LLM_API_KEY",
|
|
196
|
+
apiKey: "$MY_LLM_API_KEY",
|
|
166
197
|
api: "openai-completions",
|
|
167
198
|
models: [
|
|
168
199
|
{
|
|
@@ -196,38 +227,41 @@ The `api` field determines which streaming implementation is used:
|
|
|
196
227
|
| `openai-responses` | OpenAI Responses API |
|
|
197
228
|
| `azure-openai-responses` | Azure OpenAI Responses API |
|
|
198
229
|
| `openai-codex-responses` | OpenAI Codex Responses API |
|
|
199
|
-
| `mistral-conversations` | Mistral
|
|
230
|
+
| `mistral-conversations` | Native Mistral Chat Completions streaming |
|
|
200
231
|
| `google-generative-ai` | Google Generative AI API |
|
|
201
|
-
| `google-gemini-cli` | Google Cloud Code Assist API |
|
|
202
232
|
| `google-vertex` | Google Vertex AI API |
|
|
203
233
|
| `bedrock-converse-stream` | Amazon Bedrock Converse API |
|
|
204
234
|
|
|
205
|
-
Most OpenAI-compatible providers work with `openai-completions`. Use `compat` for quirks:
|
|
235
|
+
Most OpenAI-compatible providers work with `openai-completions`. Use model-level `thinkingLevelMap` for model-specific thinking levels, and `compat` for provider quirks. The `xhigh` and `max` levels are opt-in, require non-null map entries, and may be separated by unsupported holes:
|
|
206
236
|
|
|
207
237
|
```typescript
|
|
208
238
|
models: [{
|
|
209
239
|
id: "custom-model",
|
|
210
240
|
// ...
|
|
241
|
+
reasoning: true,
|
|
242
|
+
thinkingLevelMap: { // map mcpi levels to provider values; null hides unsupported levels
|
|
243
|
+
minimal: null,
|
|
244
|
+
low: null,
|
|
245
|
+
medium: null,
|
|
246
|
+
high: "default",
|
|
247
|
+
xhigh: null,
|
|
248
|
+
max: "max"
|
|
249
|
+
},
|
|
211
250
|
compat: {
|
|
212
|
-
supportsDeveloperRole: false,
|
|
251
|
+
supportsDeveloperRole: false, // use "system" instead of "developer"
|
|
213
252
|
supportsReasoningEffort: true,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
maxTokensField: "max_tokens", // instead of "max_completion_tokens"
|
|
222
|
-
requiresToolResultName: true, // tool results need name field
|
|
223
|
-
thinkingFormat: "qwen", // top-level enable_thinking: true
|
|
224
|
-
cacheControlFormat: "anthropic" // Anthropic-style cache_control markers
|
|
225
|
-
}
|
|
226
|
-
}]
|
|
253
|
+
maxTokensField: "max_tokens", // instead of "max_completion_tokens"
|
|
254
|
+
requiresToolResultName: true, // tool results need name field
|
|
255
|
+
thinkingFormat: "qwen", // top-level enable_thinking: true
|
|
256
|
+
cacheControlFormat: "anthropic" // Anthropic-style cache_control markers
|
|
257
|
+
}
|
|
258
|
+
}]
|
|
227
259
|
```
|
|
228
260
|
|
|
229
|
-
Use `qwen-chat-template`
|
|
230
|
-
Use `cacheControlFormat: "anthropic"` for OpenAI-compatible providers that expose Anthropic-style prompt caching via `cache_control` on the system prompt, last tool definition, and last user
|
|
261
|
+
Use `openrouter` for OpenRouter-style `reasoning: { effort }` controls. Use `together` for Together-style `reasoning: { enabled }` controls; with `supportsReasoningEffort`, it also sends `reasoning_effort`. Use `qwen-chat-template` for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking` and need `preserve_thinking`.
|
|
262
|
+
Use `cacheControlFormat: "anthropic"` for OpenAI-compatible providers that expose Anthropic-style prompt caching via `cache_control` on the system prompt, last tool definition, and last user, assistant, or tool-result text content.
|
|
263
|
+
|
|
264
|
+
For Anthropic-compatible providers using `api: "anthropic-messages"`, set `compat.forceAdaptiveThinking: true` on models or providers whose upstream model requires adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`). Built-in adaptive Claude models set this automatically. Set `compat.allowEmptySignature: true` only for providers that emit empty thinking signatures and expect `signature: ""` on replay.
|
|
231
265
|
|
|
232
266
|
> Migration note: Mistral moved from `openai-completions` to `mistral-conversations`.
|
|
233
267
|
> Use `mistral-conversations` for native Mistral models.
|
|
@@ -240,19 +274,21 @@ If your provider expects `Authorization: Bearer <key>` but doesn't use a standar
|
|
|
240
274
|
```typescript
|
|
241
275
|
pi.registerProvider("custom-api", {
|
|
242
276
|
baseUrl: "https://api.example.com",
|
|
243
|
-
apiKey: "MY_API_KEY",
|
|
277
|
+
apiKey: "$MY_API_KEY",
|
|
244
278
|
authHeader: true, // adds Authorization: Bearer header
|
|
245
279
|
api: "openai-completions",
|
|
246
280
|
models: [...]
|
|
247
281
|
});
|
|
248
282
|
```
|
|
249
283
|
|
|
284
|
+
The key is resolved for each request. An explicit request `Authorization` header takes precedence over the generated value.
|
|
285
|
+
|
|
250
286
|
## OAuth Support
|
|
251
287
|
|
|
252
288
|
Add OAuth/SSO authentication that integrates with `/login`:
|
|
253
289
|
|
|
254
290
|
```typescript
|
|
255
|
-
import type { OAuthCredentials, OAuthLoginCallbacks } from "@
|
|
291
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@sammorrowdrums/mcpi-ai";
|
|
256
292
|
|
|
257
293
|
pi.registerProvider("corporate-ai", {
|
|
258
294
|
baseUrl: "https://ai.corp.com/v1",
|
|
@@ -262,17 +298,28 @@ pi.registerProvider("corporate-ai", {
|
|
|
262
298
|
name: "Corporate AI (SSO)",
|
|
263
299
|
|
|
264
300
|
async login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
verificationUri: "https://sso.corp.com/device"
|
|
301
|
+
const method = await callbacks.onSelect({
|
|
302
|
+
message: "Select login method:",
|
|
303
|
+
options: [
|
|
304
|
+
{ id: "browser", label: "Browser OAuth" },
|
|
305
|
+
{ id: "device", label: "Device code" }
|
|
306
|
+
]
|
|
272
307
|
});
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
308
|
+
if (!method) throw new Error("Login cancelled");
|
|
309
|
+
|
|
310
|
+
let code: string;
|
|
311
|
+
if (method === "device") {
|
|
312
|
+
callbacks.onDeviceCode({
|
|
313
|
+
userCode: "ABCD-1234",
|
|
314
|
+
verificationUri: "https://sso.corp.com/device",
|
|
315
|
+
intervalSeconds: 5,
|
|
316
|
+
expiresInSeconds: 900
|
|
317
|
+
});
|
|
318
|
+
code = await pollDeviceCodeUntilComplete();
|
|
319
|
+
} else {
|
|
320
|
+
callbacks.onAuth({ url: "https://sso.corp.com/authorize?..." });
|
|
321
|
+
code = await callbacks.onPrompt({ message: "Enter SSO code:" });
|
|
322
|
+
}
|
|
276
323
|
|
|
277
324
|
// Exchange for tokens (your implementation)
|
|
278
325
|
const tokens = await exchangeCodeForTokens(code);
|
|
@@ -284,8 +331,8 @@ pi.registerProvider("corporate-ai", {
|
|
|
284
331
|
};
|
|
285
332
|
},
|
|
286
333
|
|
|
287
|
-
async refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {
|
|
288
|
-
const tokens = await refreshAccessToken(credentials.refresh);
|
|
334
|
+
async refreshToken(credentials: OAuthCredentials, signal: AbortSignal): Promise<OAuthCredentials> {
|
|
335
|
+
const tokens = await refreshAccessToken(credentials.refresh, signal);
|
|
289
336
|
return {
|
|
290
337
|
refresh: tokens.refreshToken ?? credentials.refresh,
|
|
291
338
|
access: tokens.accessToken,
|
|
@@ -295,15 +342,6 @@ pi.registerProvider("corporate-ai", {
|
|
|
295
342
|
|
|
296
343
|
getApiKey(credentials: OAuthCredentials): string {
|
|
297
344
|
return credentials.access;
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
// Optional: modify models based on user's subscription
|
|
301
|
-
modifyModels(models, credentials) {
|
|
302
|
-
const region = decodeRegionFromToken(credentials.access);
|
|
303
|
-
return models.map(m => ({
|
|
304
|
-
...m,
|
|
305
|
-
baseUrl: `https://${region}.ai.corp.com/v1`
|
|
306
|
-
}));
|
|
307
345
|
}
|
|
308
346
|
}
|
|
309
347
|
});
|
|
@@ -313,7 +351,7 @@ After registration, users can authenticate via `/login corporate-ai`.
|
|
|
313
351
|
|
|
314
352
|
### OAuthLoginCallbacks
|
|
315
353
|
|
|
316
|
-
The `callbacks` object provides
|
|
354
|
+
The `callbacks` object provides UI-neutral interactions for the provider-owned flow:
|
|
317
355
|
|
|
318
356
|
```typescript
|
|
319
357
|
interface OAuthLoginCallbacks {
|
|
@@ -321,16 +359,30 @@ interface OAuthLoginCallbacks {
|
|
|
321
359
|
onAuth(params: { url: string }): void;
|
|
322
360
|
|
|
323
361
|
// Show device code (for device authorization flow)
|
|
324
|
-
onDeviceCode(params: {
|
|
362
|
+
onDeviceCode(params: {
|
|
363
|
+
userCode: string;
|
|
364
|
+
verificationUri: string;
|
|
365
|
+
intervalSeconds?: number;
|
|
366
|
+
expiresInSeconds?: number;
|
|
367
|
+
}): void;
|
|
368
|
+
|
|
369
|
+
// Show transient progress
|
|
370
|
+
onProgress?(message: string): void;
|
|
325
371
|
|
|
326
372
|
// Prompt user for input (for manual token entry)
|
|
327
373
|
onPrompt(params: { message: string }): Promise<string>;
|
|
374
|
+
|
|
375
|
+
// Show an interactive selector, e.g. to choose browser OAuth vs device code
|
|
376
|
+
onSelect(params: {
|
|
377
|
+
message: string;
|
|
378
|
+
options: { id: string; label: string }[];
|
|
379
|
+
}): Promise<string | undefined>;
|
|
328
380
|
}
|
|
329
381
|
```
|
|
330
382
|
|
|
331
383
|
### OAuthCredentials
|
|
332
384
|
|
|
333
|
-
Credentials are persisted in
|
|
385
|
+
Credentials are persisted in the mcpi config directory's `auth.json`:
|
|
334
386
|
|
|
335
387
|
```typescript
|
|
336
388
|
interface OAuthCredentials {
|
|
@@ -345,12 +397,12 @@ interface OAuthCredentials {
|
|
|
345
397
|
For providers with non-standard APIs, implement `streamSimple`. Study the existing provider implementations before writing your own:
|
|
346
398
|
|
|
347
399
|
**Reference implementations:**
|
|
348
|
-
- [anthropic.ts](https://github.com/
|
|
349
|
-
- [mistral.ts](https://github.com/
|
|
350
|
-
- [openai-completions.ts](https://github.com/
|
|
351
|
-
- [openai-responses.ts](https://github.com/
|
|
352
|
-
- [google.ts](https://github.com/
|
|
353
|
-
- [
|
|
400
|
+
- [anthropic-messages.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/anthropic-messages.ts) - Anthropic Messages API
|
|
401
|
+
- [mistral-conversations.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/mistral-conversations.ts) - Mistral Conversations API
|
|
402
|
+
- [openai-completions.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/openai-completions.ts) - OpenAI Chat Completions
|
|
403
|
+
- [openai-responses.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/openai-responses.ts) - OpenAI Responses API
|
|
404
|
+
- [google-generative-ai.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/google-generative-ai.ts) - Google Generative AI
|
|
405
|
+
- [bedrock-converse-stream.ts](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/api/bedrock-converse-stream.ts) - AWS Bedrock
|
|
354
406
|
|
|
355
407
|
### Stream Pattern
|
|
356
408
|
|
|
@@ -365,7 +417,7 @@ import {
|
|
|
365
417
|
type SimpleStreamOptions,
|
|
366
418
|
calculateCost,
|
|
367
419
|
createAssistantMessageEventStream,
|
|
368
|
-
} from "@
|
|
420
|
+
} from "@sammorrowdrums/mcpi-ai";
|
|
369
421
|
|
|
370
422
|
function streamMyProvider(
|
|
371
423
|
model: Model<any>,
|
|
@@ -390,7 +442,7 @@ function streamMyProvider(
|
|
|
390
442
|
totalTokens: 0,
|
|
391
443
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
392
444
|
},
|
|
393
|
-
stopReason: "
|
|
445
|
+
stopReason: "pending",
|
|
394
446
|
timestamp: Date.now(),
|
|
395
447
|
};
|
|
396
448
|
|
|
@@ -399,12 +451,18 @@ function streamMyProvider(
|
|
|
399
451
|
stream.push({ type: "start", partial: output });
|
|
400
452
|
|
|
401
453
|
// Make API request and process response...
|
|
402
|
-
// Push content events as they arrive
|
|
454
|
+
// Push content events as they arrive and set stopReason from the terminal event.
|
|
455
|
+
if (output.stopReason === "pending") {
|
|
456
|
+
throw new Error("Provider stream ended without a stop reason");
|
|
457
|
+
}
|
|
458
|
+
if (output.stopReason === "error" || output.stopReason === "aborted") {
|
|
459
|
+
throw new Error(output.errorMessage || "An unknown error occurred");
|
|
460
|
+
}
|
|
403
461
|
|
|
404
462
|
// Push done event
|
|
405
463
|
stream.push({
|
|
406
464
|
type: "done",
|
|
407
|
-
reason: output.stopReason
|
|
465
|
+
reason: output.stopReason,
|
|
408
466
|
message: output
|
|
409
467
|
});
|
|
410
468
|
stream.end();
|
|
@@ -506,6 +564,60 @@ output.usage.totalTokens = output.usage.input + output.usage.output +
|
|
|
506
564
|
calculateCost(model, output.usage);
|
|
507
565
|
```
|
|
508
566
|
|
|
567
|
+
### Context Overflow Errors
|
|
568
|
+
|
|
569
|
+
When a request exceeds the model's context window, mcpi can recover automatically by compacting the conversation and retrying. This recovery only kicks in if mcpi recognizes the failure as an overflow.
|
|
570
|
+
|
|
571
|
+
Detection runs on the finalized assistant message:
|
|
572
|
+
|
|
573
|
+
- `stopReason === "error"`
|
|
574
|
+
- `errorMessage` matches one of mcpi's known overflow patterns (see [`packages/ai/src/utils/overflow.ts`](https://github.com/SamMorrowDrums/mcpi/blob/main/packages/ai/src/utils/overflow.ts))
|
|
575
|
+
|
|
576
|
+
If your provider returns overflow errors with a message mcpi does not recognize, normalize the error from the same extension that registers the provider. Use a `message_end` handler to rewrite the assistant message so its `errorMessage` starts with a phrase mcpi recognizes. The generic fallback `context_length_exceeded` is the safest choice.
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
const MY_PROVIDER_OVERFLOW_PATTERN = /your provider's overflow phrase/i;
|
|
580
|
+
|
|
581
|
+
export default function (pi: ExtensionAPI) {
|
|
582
|
+
pi.registerProvider("my-provider", { /* ... */ });
|
|
583
|
+
|
|
584
|
+
pi.on("message_end", (event, ctx) => {
|
|
585
|
+
const message = event.message;
|
|
586
|
+
if (message.role !== "assistant") return;
|
|
587
|
+
if (message.stopReason !== "error") return;
|
|
588
|
+
if (
|
|
589
|
+
message.provider !== "my-provider" &&
|
|
590
|
+
ctx.model?.provider !== "my-provider"
|
|
591
|
+
)
|
|
592
|
+
return;
|
|
593
|
+
|
|
594
|
+
const errorMessage = message.errorMessage ?? "";
|
|
595
|
+
if (errorMessage.includes("context_length_exceeded")) return;
|
|
596
|
+
if (!MY_PROVIDER_OVERFLOW_PATTERN.test(errorMessage)) return;
|
|
597
|
+
|
|
598
|
+
return {
|
|
599
|
+
message: {
|
|
600
|
+
...message,
|
|
601
|
+
errorMessage: `context_length_exceeded: ${errorMessage}`,
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
`message_end` runs before mcpi tracks the assistant message for auto-compaction, so the rewritten `errorMessage` is what mcpi checks. With this in place, mcpi will:
|
|
609
|
+
|
|
610
|
+
1. Detect the overflow from `errorMessage`.
|
|
611
|
+
2. Drop the failed assistant message from live context.
|
|
612
|
+
3. Run compaction.
|
|
613
|
+
4. Retry the request once.
|
|
614
|
+
|
|
615
|
+
Guard the rewrite carefully:
|
|
616
|
+
|
|
617
|
+
- Scope it to your provider (`message.provider` and `ctx.model?.provider`) so unrelated errors from other providers are untouched.
|
|
618
|
+
- Match a provider-specific pattern, not mcpi's generic overflow patterns. Rewriting rate-limit or throttling errors (`rate limit`, `too many requests`) would falsely trigger compaction instead of mcpi's normal retry-with-backoff path.
|
|
619
|
+
- Skip when `errorMessage` already includes `context_length_exceeded` so the handler is idempotent.
|
|
620
|
+
|
|
509
621
|
### Registration
|
|
510
622
|
|
|
511
623
|
Register your stream function:
|
|
@@ -513,7 +625,7 @@ Register your stream function:
|
|
|
513
625
|
```typescript
|
|
514
626
|
pi.registerProvider("my-provider", {
|
|
515
627
|
baseUrl: "https://api.example.com",
|
|
516
|
-
apiKey: "MY_API_KEY",
|
|
628
|
+
apiKey: "$MY_API_KEY",
|
|
517
629
|
api: "my-custom-api",
|
|
518
630
|
models: [...],
|
|
519
631
|
streamSimple: streamMyProvider
|
|
@@ -522,7 +634,7 @@ pi.registerProvider("my-provider", {
|
|
|
522
634
|
|
|
523
635
|
## Testing Your Implementation
|
|
524
636
|
|
|
525
|
-
Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/
|
|
637
|
+
Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/SamMorrowDrums/mcpi/tree/main/packages/ai/test):
|
|
526
638
|
|
|
527
639
|
| Test | Purpose |
|
|
528
640
|
|------|---------|
|
|
@@ -544,10 +656,13 @@ Run tests with your provider/model pairs to verify compatibility.
|
|
|
544
656
|
|
|
545
657
|
```typescript
|
|
546
658
|
interface ProviderConfig {
|
|
659
|
+
/** Display name for the provider in UI such as /login. */
|
|
660
|
+
name?: string;
|
|
661
|
+
|
|
547
662
|
/** API endpoint URL. Required when defining models. */
|
|
548
663
|
baseUrl?: string;
|
|
549
664
|
|
|
550
|
-
/** API key or
|
|
665
|
+
/** API key literal, env interpolation ($ENV_VAR or ${ENV_VAR}), or !command. Required when defining models (unless oauth). */
|
|
551
666
|
apiKey?: string;
|
|
552
667
|
|
|
553
668
|
/** API type for streaming. Required at provider or model level when defining models. */
|
|
@@ -560,7 +675,7 @@ interface ProviderConfig {
|
|
|
560
675
|
options?: SimpleStreamOptions
|
|
561
676
|
) => AssistantMessageEventStream;
|
|
562
677
|
|
|
563
|
-
/** Custom headers to include in requests. Values
|
|
678
|
+
/** Custom headers to include in requests. Values use the same resolution syntax as apiKey. */
|
|
564
679
|
headers?: Record<string, string>;
|
|
565
680
|
|
|
566
681
|
/** If true, adds Authorization: Bearer header with the resolved API key. */
|
|
@@ -573,9 +688,8 @@ interface ProviderConfig {
|
|
|
573
688
|
oauth?: {
|
|
574
689
|
name: string;
|
|
575
690
|
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
|
|
576
|
-
refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
691
|
+
refreshToken(credentials: OAuthCredentials, signal: AbortSignal): Promise<OAuthCredentials>;
|
|
577
692
|
getApiKey(credentials: OAuthCredentials): string;
|
|
578
|
-
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
579
693
|
};
|
|
580
694
|
}
|
|
581
695
|
```
|
|
@@ -593,9 +707,15 @@ interface ProviderModelConfig {
|
|
|
593
707
|
/** API type override for this specific model. */
|
|
594
708
|
api?: Api;
|
|
595
709
|
|
|
710
|
+
/** API endpoint URL override for this specific model. */
|
|
711
|
+
baseUrl?: string;
|
|
712
|
+
|
|
596
713
|
/** Whether the model supports extended thinking. */
|
|
597
714
|
reasoning: boolean;
|
|
598
715
|
|
|
716
|
+
/** Maps mcpi thinking levels to provider/model-specific values; null marks a level unsupported. */
|
|
717
|
+
thinkingLevelMap?: Partial<Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", string | null>>;
|
|
718
|
+
|
|
599
719
|
/** Supported input types. */
|
|
600
720
|
input: ("text" | "image")[];
|
|
601
721
|
|
|
@@ -616,22 +736,39 @@ interface ProviderModelConfig {
|
|
|
616
736
|
/** Custom headers for this specific model. */
|
|
617
737
|
headers?: Record<string, string>;
|
|
618
738
|
|
|
619
|
-
/**
|
|
739
|
+
/** Compatibility settings for the selected API. */
|
|
620
740
|
compat?: {
|
|
741
|
+
// openai-completions
|
|
621
742
|
supportsStore?: boolean;
|
|
622
743
|
supportsDeveloperRole?: boolean;
|
|
623
744
|
supportsReasoningEffort?: boolean;
|
|
624
|
-
reasoningEffortMap?: Partial<Record<"minimal" | "low" | "medium" | "high" | "xhigh", string>>;
|
|
625
745
|
supportsUsageInStreaming?: boolean;
|
|
746
|
+
supportsFinishReason?: boolean;
|
|
747
|
+
supportsStrictMode?: boolean;
|
|
748
|
+
supportsOpenAIGrammarTools?: boolean; // openai-completions/openai-responses; false falls back to normal function tools
|
|
626
749
|
maxTokensField?: "max_completion_tokens" | "max_tokens";
|
|
627
750
|
requiresToolResultName?: boolean;
|
|
628
751
|
requiresAssistantAfterToolResult?: boolean;
|
|
629
752
|
requiresThinkingAsText?: boolean;
|
|
630
|
-
|
|
753
|
+
requiresReasoningContentOnAssistantMessages?: boolean;
|
|
754
|
+
thinkingFormat?: "openai" | "openrouter" | "deepseek" | "together" | "baseten" | "zai" | "qwen" | "chat-template" | "qwen-chat-template" | "string-thinking" | "ant-ling";
|
|
755
|
+
chatTemplateKwargs?: Record<string, string | number | boolean | null | { "$var": "thinking.enabled" | "thinking.effort"; omitWhenOff?: boolean }>;
|
|
756
|
+
chatTemplateArgs?: Record<string, string | number | boolean | null | { "$var": "thinking.enabled" | "thinking.effort"; omitWhenOff?: boolean }>;
|
|
631
757
|
cacheControlFormat?: "anthropic";
|
|
758
|
+
sessionAffinityFormat?: "openai" | "openai-nosession" | "openrouter";
|
|
759
|
+
sendSessionAffinityHeaders?: boolean;
|
|
760
|
+
|
|
761
|
+
// anthropic-messages
|
|
762
|
+
supportsEagerToolInputStreaming?: boolean;
|
|
763
|
+
supportsLongCacheRetention?: boolean;
|
|
764
|
+
sendSessionAffinityHeaders?: boolean;
|
|
765
|
+
supportsCacheControlOnTools?: boolean;
|
|
766
|
+
forceAdaptiveThinking?: boolean;
|
|
767
|
+
allowEmptySignature?: boolean;
|
|
768
|
+
supportsStrictTools?: boolean;
|
|
632
769
|
};
|
|
633
770
|
}
|
|
634
771
|
```
|
|
635
772
|
|
|
636
|
-
`qwen` is for DashScope-style top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking`.
|
|
637
|
-
`cacheControlFormat: "anthropic"` applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and last user
|
|
773
|
+
`openrouter` sends `reasoning: { effort }`. `deepseek` sends `thinking: { type: "enabled" | "disabled" }` and `reasoning_effort` when enabled. `together` sends `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` is for DashScope-style top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking` and need `preserve_thinking`. Use `chat-template` for configurable `chat_template_kwargs`, for example DeepSeek V3.x behind vLLM with `chatTemplateKwargs: { "thinking": { "$var": "thinking.enabled" } }`. Use `thinkingFormat: "baseten"` with `chatTemplateArgs` when the provider expects toggle values under `chat_template_args` and optionally supports top-level `reasoning_effort`.
|
|
774
|
+
`cacheControlFormat: "anthropic"` applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content.
|