@sammorrowdrums/mcpi 0.70.9 → 0.85.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 +1623 -1
- 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 +658 -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 +160 -87
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +32 -13
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +192 -4
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +217 -69
- 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 -7
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +220 -188
- 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 +29 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +102 -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
package/docs/tui.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
>
|
|
1
|
+
> mcpi can create TUI components. Ask it to build one for your use case.
|
|
2
2
|
|
|
3
3
|
# TUI Components
|
|
4
4
|
|
|
5
5
|
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
|
|
6
6
|
|
|
7
|
-
**Source:** [`@
|
|
7
|
+
**Source:** [`@sammorrowdrums/mcpi-tui`](https://github.com/SamMorrowDrums/mcpi/tree/main/packages/tui)
|
|
8
8
|
|
|
9
9
|
## Component Interface
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered lin
|
|
|
33
33
|
Components that display a text cursor and need IME (Input Method Editor) support should implement the `Focusable` interface:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { CURSOR_MARKER, type Component, type Focusable } from "@
|
|
36
|
+
import { CURSOR_MARKER, type Component, type Focusable } from "@sammorrowdrums/mcpi-tui";
|
|
37
37
|
|
|
38
38
|
class MyInput implements Component, Focusable {
|
|
39
39
|
focused: boolean = false; // Set by TUI when focus changes
|
|
@@ -50,16 +50,16 @@ When a `Focusable` component has focus, TUI:
|
|
|
50
50
|
1. Sets `focused = true` on the component
|
|
51
51
|
2. Scans rendered output for `CURSOR_MARKER` (a zero-width APC escape sequence)
|
|
52
52
|
3. Positions the hardware terminal cursor at that location
|
|
53
|
-
4. Shows the hardware cursor
|
|
53
|
+
4. Shows the hardware cursor only when `showHardwareCursor` is enabled
|
|
54
54
|
|
|
55
|
-
This
|
|
55
|
+
The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with `showHardwareCursor`, `setShowHardwareCursor(true)`, or `MCPI_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
|
|
56
56
|
|
|
57
57
|
### Container Components with Embedded Inputs
|
|
58
58
|
|
|
59
59
|
When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child. Otherwise, the hardware cursor won't be positioned correctly for IME input.
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
|
-
import { Container, type Focusable, Input } from "@
|
|
62
|
+
import { Container, type Focusable, Input } from "@sammorrowdrums/mcpi-tui";
|
|
63
63
|
|
|
64
64
|
class SearchDialog extends Container implements Focusable {
|
|
65
65
|
private searchInput: Input;
|
|
@@ -90,19 +90,32 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
|
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
92
|
pi.on("session_start", async (_event, ctx) => {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const result = await ctx.ui.custom<string | null>((tui, theme, keybindings, done) =>
|
|
94
|
+
new MyComponent({
|
|
95
|
+
theme,
|
|
96
|
+
keybindings,
|
|
97
|
+
onChange: () => tui.requestRender(),
|
|
98
|
+
onSelect: (value) => done(value),
|
|
99
|
+
onCancel: () => done(null),
|
|
100
|
+
})
|
|
101
|
+
);
|
|
96
102
|
});
|
|
97
103
|
```
|
|
98
104
|
|
|
99
|
-
**In custom tools** via `
|
|
105
|
+
**In custom tools** via `ctx.ui.custom()`:
|
|
100
106
|
|
|
101
107
|
```typescript
|
|
102
|
-
async execute(toolCallId, params, onUpdate, ctx
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
async execute(toolCallId, params, signal, onUpdate, ctx) {
|
|
109
|
+
const result = await ctx.ui.custom<string | null>((tui, theme, keybindings, done) =>
|
|
110
|
+
new MyComponent({
|
|
111
|
+
theme,
|
|
112
|
+
keybindings,
|
|
113
|
+
onChange: () => tui.requestRender(),
|
|
114
|
+
onSelect: (value) => done(value),
|
|
115
|
+
onCancel: () => done(null),
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
// Use result...
|
|
106
119
|
}
|
|
107
120
|
```
|
|
108
121
|
|
|
@@ -145,8 +158,11 @@ const result = await ctx.ui.custom<string | null>(
|
|
|
145
158
|
// Responsive: hide on narrow terminals
|
|
146
159
|
visible: (termWidth, termHeight) => termWidth >= 80,
|
|
147
160
|
},
|
|
148
|
-
// Get handle for programmatic visibility control
|
|
161
|
+
// Get handle for programmatic focus and visibility control
|
|
149
162
|
onHandle: (handle) => {
|
|
163
|
+
// handle.focus() - focus this overlay and bring it to the visual front
|
|
164
|
+
// handle.unfocus() - release input to normal fallback
|
|
165
|
+
// handle.unfocus({ target }) - release input to a specific component or null
|
|
150
166
|
// handle.setHidden(true/false) - toggle visibility
|
|
151
167
|
// handle.hide() - permanently remove
|
|
152
168
|
},
|
|
@@ -154,6 +170,12 @@ const result = await ctx.ui.custom<string | null>(
|
|
|
154
170
|
);
|
|
155
171
|
```
|
|
156
172
|
|
|
173
|
+
### Overlay Focus
|
|
174
|
+
|
|
175
|
+
A focused visible overlay keeps input ownership across temporary non-overlay UI. If an overlay opens another `ctx.ui.custom()` component without `{ overlay: true }`, that replacement UI receives input while it is active; when it closes, the focused overlay can reclaim input.
|
|
176
|
+
|
|
177
|
+
Use `handle.unfocus()` when a visible overlay should stop owning input and let TUI fall back to another visible capturing overlay or the previous focus target. Use `handle.unfocus({ target })` when a specific component should receive input while the overlay stays visible. Passing `{ target: null }` intentionally leaves no focused component until focus is set again.
|
|
178
|
+
|
|
157
179
|
### Overlay Lifecycle
|
|
158
180
|
|
|
159
181
|
Overlay components are disposed when closed. Don't reuse references - create fresh instances:
|
|
@@ -179,10 +201,10 @@ See [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for compre
|
|
|
179
201
|
|
|
180
202
|
## Built-in Components
|
|
181
203
|
|
|
182
|
-
Import from `@
|
|
204
|
+
Import from `@sammorrowdrums/mcpi-tui`:
|
|
183
205
|
|
|
184
206
|
```typescript
|
|
185
|
-
import { Text, Box, Container, Spacer, Markdown } from "@
|
|
207
|
+
import { Text, Box, Container, Spacer, Markdown } from "@sammorrowdrums/mcpi-tui";
|
|
186
208
|
```
|
|
187
209
|
|
|
188
210
|
### Text
|
|
@@ -248,7 +270,7 @@ md.setText("Updated markdown");
|
|
|
248
270
|
|
|
249
271
|
### Image
|
|
250
272
|
|
|
251
|
-
Renders images in supported terminals (Kitty, iTerm2, Ghostty, WezTerm).
|
|
273
|
+
Renders images in supported terminals (Kitty, iTerm2, Ghostty, WezTerm, Warp).
|
|
252
274
|
|
|
253
275
|
```typescript
|
|
254
276
|
const image = new Image(
|
|
@@ -264,7 +286,7 @@ const image = new Image(
|
|
|
264
286
|
Use `matchesKey()` for key detection:
|
|
265
287
|
|
|
266
288
|
```typescript
|
|
267
|
-
import { matchesKey, Key } from "@
|
|
289
|
+
import { matchesKey, Key } from "@sammorrowdrums/mcpi-tui";
|
|
268
290
|
|
|
269
291
|
handleInput(data: string) {
|
|
270
292
|
if (matchesKey(data, Key.up)) {
|
|
@@ -290,7 +312,7 @@ handleInput(data: string) {
|
|
|
290
312
|
**Critical:** Each line from `render()` must not exceed the `width` parameter.
|
|
291
313
|
|
|
292
314
|
```typescript
|
|
293
|
-
import { visibleWidth, truncateToWidth } from "@
|
|
315
|
+
import { visibleWidth, truncateToWidth } from "@sammorrowdrums/mcpi-tui";
|
|
294
316
|
|
|
295
317
|
render(width: number): string[] {
|
|
296
318
|
// Truncate long lines
|
|
@@ -311,7 +333,7 @@ Example: Interactive selector
|
|
|
311
333
|
import {
|
|
312
334
|
matchesKey, Key,
|
|
313
335
|
truncateToWidth, visibleWidth
|
|
314
|
-
} from "@
|
|
336
|
+
} from "@sammorrowdrums/mcpi-tui";
|
|
315
337
|
|
|
316
338
|
class MySelector {
|
|
317
339
|
private items: string[];
|
|
@@ -365,24 +387,26 @@ Usage in an extension:
|
|
|
365
387
|
```typescript
|
|
366
388
|
pi.registerCommand("pick", {
|
|
367
389
|
description: "Pick an item",
|
|
368
|
-
handler: async (
|
|
390
|
+
handler: async (_args, ctx) => {
|
|
369
391
|
const items = ["Option A", "Option B", "Option C"];
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
resolve();
|
|
392
|
+
const selected = await ctx.ui.custom<string | null>((tui, _theme, _keybindings, done) => {
|
|
393
|
+
const selector = new MySelector(items);
|
|
394
|
+
selector.onSelect = done;
|
|
395
|
+
selector.onCancel = () => done(null);
|
|
396
|
+
|
|
397
|
+
return {
|
|
398
|
+
render: (width) => selector.render(width),
|
|
399
|
+
handleInput: (data) => {
|
|
400
|
+
selector.handleInput(data);
|
|
401
|
+
tui.requestRender();
|
|
402
|
+
},
|
|
403
|
+
invalidate: () => selector.invalidate(),
|
|
383
404
|
};
|
|
384
|
-
handle = ctx.ui.custom(selector);
|
|
385
405
|
});
|
|
406
|
+
|
|
407
|
+
if (selected !== null) {
|
|
408
|
+
ctx.ui.notify(`Selected: ${selected}`, "info");
|
|
409
|
+
}
|
|
386
410
|
}
|
|
387
411
|
});
|
|
388
412
|
```
|
|
@@ -407,7 +431,7 @@ renderResult(result, options, theme, context) {
|
|
|
407
431
|
|
|
408
432
|
| Category | Colors |
|
|
409
433
|
|----------|--------|
|
|
410
|
-
| General | `text`, `accent`, `muted`, `dim` |
|
|
434
|
+
| General | `text`, `accent`, `muted`, `dim`, `searchMatchText` |
|
|
411
435
|
| Status | `success`, `error`, `warning` |
|
|
412
436
|
| Borders | `border`, `borderAccent`, `borderMuted` |
|
|
413
437
|
| Messages | `userMessageText`, `customMessageText`, `customMessageLabel` |
|
|
@@ -415,18 +439,18 @@ renderResult(result, options, theme, context) {
|
|
|
415
439
|
| Diffs | `toolDiffAdded`, `toolDiffRemoved`, `toolDiffContext` |
|
|
416
440
|
| Markdown | `mdHeading`, `mdLink`, `mdLinkUrl`, `mdCode`, `mdCodeBlock`, `mdCodeBlockBorder`, `mdQuote`, `mdQuoteBorder`, `mdHr`, `mdListBullet` |
|
|
417
441
|
| Syntax | `syntaxComment`, `syntaxKeyword`, `syntaxFunction`, `syntaxVariable`, `syntaxString`, `syntaxNumber`, `syntaxType`, `syntaxOperator`, `syntaxPunctuation` |
|
|
418
|
-
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
|
|
442
|
+
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh`, `thinkingMax` |
|
|
419
443
|
| Modes | `bashMode` |
|
|
420
444
|
|
|
421
445
|
**Background colors** (`theme.bg(color, text)`):
|
|
422
446
|
|
|
423
|
-
`selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`
|
|
447
|
+
`selectedBg`, `searchMatchBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`
|
|
424
448
|
|
|
425
449
|
**For Markdown**, use `getMarkdownTheme()`:
|
|
426
450
|
|
|
427
451
|
```typescript
|
|
428
|
-
import { getMarkdownTheme } from "@
|
|
429
|
-
import { Markdown } from "@
|
|
452
|
+
import { getMarkdownTheme } from "@sammorrowdrums/mcpi";
|
|
453
|
+
import { Markdown } from "@sammorrowdrums/mcpi-tui";
|
|
430
454
|
|
|
431
455
|
renderResult(result, options, theme, context) {
|
|
432
456
|
const mdTheme = getMarkdownTheme();
|
|
@@ -445,10 +469,10 @@ interface MyTheme {
|
|
|
445
469
|
|
|
446
470
|
## Debug logging
|
|
447
471
|
|
|
448
|
-
Set `
|
|
472
|
+
Set `MCPI_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
|
|
449
473
|
|
|
450
474
|
```bash
|
|
451
|
-
|
|
475
|
+
MCPI_TUI_WRITE_LOG="${XDG_STATE_HOME:-$HOME/.local/state}/mcpi/tui-ansi.log" npx tsx packages/tui/test/chat-simple.ts
|
|
452
476
|
```
|
|
453
477
|
|
|
454
478
|
## Performance
|
|
@@ -477,7 +501,7 @@ class CachedComponent {
|
|
|
477
501
|
}
|
|
478
502
|
```
|
|
479
503
|
|
|
480
|
-
Call `invalidate()` when state changes, then `
|
|
504
|
+
Call `invalidate()` when state changes, then use the injected `tui.requestRender()` to trigger re-render.
|
|
481
505
|
|
|
482
506
|
## Invalidation and Theme Changes
|
|
483
507
|
|
|
@@ -587,12 +611,12 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
|
|
|
587
611
|
|
|
588
612
|
### Pattern 1: Selection Dialog (SelectList)
|
|
589
613
|
|
|
590
|
-
For letting users pick from a list of options. Use `SelectList` from `@
|
|
614
|
+
For letting users pick from a list of options. Use `SelectList` from `@sammorrowdrums/mcpi-tui` with `DynamicBorder` for framing.
|
|
591
615
|
|
|
592
616
|
```typescript
|
|
593
|
-
import type { ExtensionAPI } from "@
|
|
594
|
-
import { DynamicBorder } from "@
|
|
595
|
-
import { Container, type SelectItem, SelectList, Text } from "@
|
|
617
|
+
import type { ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
618
|
+
import { DynamicBorder } from "@sammorrowdrums/mcpi";
|
|
619
|
+
import { Container, type SelectItem, SelectList, Text } from "@sammorrowdrums/mcpi-tui";
|
|
596
620
|
|
|
597
621
|
pi.registerCommand("pick", {
|
|
598
622
|
handler: async (_args, ctx) => {
|
|
@@ -650,7 +674,7 @@ pi.registerCommand("pick", {
|
|
|
650
674
|
For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
|
|
651
675
|
|
|
652
676
|
```typescript
|
|
653
|
-
import { BorderedLoader } from "@
|
|
677
|
+
import { BorderedLoader } from "@sammorrowdrums/mcpi";
|
|
654
678
|
|
|
655
679
|
pi.registerCommand("fetch", {
|
|
656
680
|
handler: async (_args, ctx) => {
|
|
@@ -679,11 +703,11 @@ pi.registerCommand("fetch", {
|
|
|
679
703
|
|
|
680
704
|
### Pattern 3: Settings/Toggles (SettingsList)
|
|
681
705
|
|
|
682
|
-
For toggling multiple settings. Use `SettingsList` from `@
|
|
706
|
+
For toggling multiple settings. Use `SettingsList` from `@sammorrowdrums/mcpi-tui` with `getSettingsListTheme()`.
|
|
683
707
|
|
|
684
708
|
```typescript
|
|
685
|
-
import { getSettingsListTheme } from "@
|
|
686
|
-
import { Container, type SettingItem, SettingsList, Text } from "@
|
|
709
|
+
import { getSettingsListTheme } from "@sammorrowdrums/mcpi";
|
|
710
|
+
import { Container, type SettingItem, SettingsList, Text } from "@sammorrowdrums/mcpi-tui";
|
|
687
711
|
|
|
688
712
|
pi.registerCommand("settings", {
|
|
689
713
|
handler: async (_args, ctx) => {
|
|
@@ -733,11 +757,11 @@ ctx.ui.setStatus("my-ext", ctx.ui.theme.fg("accent", "● active"));
|
|
|
733
757
|
ctx.ui.setStatus("my-ext", undefined);
|
|
734
758
|
```
|
|
735
759
|
|
|
736
|
-
**Examples:** [status-line.ts](../examples/extensions/status-line.ts), [plan-mode.ts](../examples/extensions/plan-mode.ts), [preset.ts](../examples/extensions/preset.ts)
|
|
760
|
+
**Examples:** [status-line.ts](../examples/extensions/status-line.ts), [plan-mode/index.ts](../examples/extensions/plan-mode/index.ts), [preset.ts](../examples/extensions/preset.ts)
|
|
737
761
|
|
|
738
762
|
### Pattern 4b: Working Indicator Customization
|
|
739
763
|
|
|
740
|
-
Customize the inline working indicator shown while
|
|
764
|
+
Customize the inline working indicator shown while mcpi is streaming a response.
|
|
741
765
|
|
|
742
766
|
```typescript
|
|
743
767
|
// Static indicator
|
|
@@ -757,7 +781,7 @@ ctx.ui.setWorkingIndicator({
|
|
|
757
781
|
// Hide the indicator entirely
|
|
758
782
|
ctx.ui.setWorkingIndicator({ frames: [] });
|
|
759
783
|
|
|
760
|
-
// Restore
|
|
784
|
+
// Restore mcpi's default spinner
|
|
761
785
|
ctx.ui.setWorkingIndicator();
|
|
762
786
|
```
|
|
763
787
|
|
|
@@ -793,7 +817,7 @@ ctx.ui.setWidget("my-widget", (_tui, theme) => {
|
|
|
793
817
|
ctx.ui.setWidget("my-widget", undefined);
|
|
794
818
|
```
|
|
795
819
|
|
|
796
|
-
**Examples:** [plan-mode.ts](../examples/extensions/plan-mode.ts)
|
|
820
|
+
**Examples:** [plan-mode/index.ts](../examples/extensions/plan-mode/index.ts)
|
|
797
821
|
|
|
798
822
|
### Pattern 6: Custom Footer
|
|
799
823
|
|
|
@@ -822,8 +846,8 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
|
|
|
822
846
|
Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
|
|
823
847
|
|
|
824
848
|
```typescript
|
|
825
|
-
import { CustomEditor, type ExtensionAPI } from "@
|
|
826
|
-
import { matchesKey, truncateToWidth } from "@
|
|
849
|
+
import { CustomEditor, type ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
850
|
+
import { matchesKey, truncateToWidth } from "@sammorrowdrums/mcpi-tui";
|
|
827
851
|
|
|
828
852
|
type Mode = "normal" | "insert";
|
|
829
853
|
|
|
@@ -876,9 +900,9 @@ class VimEditor extends CustomEditor {
|
|
|
876
900
|
|
|
877
901
|
export default function (pi: ExtensionAPI) {
|
|
878
902
|
pi.on("session_start", (_event, ctx) => {
|
|
879
|
-
// Factory receives theme and keybindings from the app
|
|
903
|
+
// Factory receives the TUI, theme, and keybindings from the app
|
|
880
904
|
ctx.ui.setEditorComponent((tui, theme, keybindings) =>
|
|
881
|
-
new VimEditor(theme, keybindings)
|
|
905
|
+
new VimEditor(tui, theme, keybindings)
|
|
882
906
|
);
|
|
883
907
|
});
|
|
884
908
|
}
|
|
@@ -910,7 +934,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
910
934
|
- **Selection UI**: [examples/extensions/preset.ts](../examples/extensions/preset.ts) - SelectList with DynamicBorder framing
|
|
911
935
|
- **Async with cancel**: [examples/extensions/qna.ts](../examples/extensions/qna.ts) - BorderedLoader for LLM calls
|
|
912
936
|
- **Settings toggles**: [examples/extensions/tools.ts](../examples/extensions/tools.ts) - SettingsList for tool enable/disable
|
|
913
|
-
- **Status indicators**: [examples/extensions/plan-mode.ts](../examples/extensions/plan-mode.ts) - setStatus and setWidget
|
|
937
|
+
- **Status indicators**: [examples/extensions/plan-mode/index.ts](../examples/extensions/plan-mode/index.ts) - setStatus and setWidget
|
|
914
938
|
- **Working indicator**: [examples/extensions/working-indicator.ts](../examples/extensions/working-indicator.ts) - setWorkingIndicator
|
|
915
939
|
- **Custom footer**: [examples/extensions/custom-footer.ts](../examples/extensions/custom-footer.ts) - setFooter with stats
|
|
916
940
|
- **Custom editor**: [examples/extensions/modal-editor.ts](../examples/extensions/modal-editor.ts) - Vim-like modal editing
|
package/docs/usage.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Using mcpi
|
|
2
|
+
|
|
3
|
+
This page collects day-to-day usage details that do not fit on the quickstart page.
|
|
4
|
+
|
|
5
|
+
## Interactive Mode
|
|
6
|
+
|
|
7
|
+
<p align="center"><img src="images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
8
|
+
|
|
9
|
+
The interface has four main areas:
|
|
10
|
+
|
|
11
|
+
- **Startup header** - shortcuts, loaded context files, prompt templates, skills, and extensions
|
|
12
|
+
- **Messages** - user messages, assistant responses, tool calls, tool results, notifications, errors, and extension UI
|
|
13
|
+
- **Editor** - where you type; border color indicates the current thinking level
|
|
14
|
+
- **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model. Totals include assistant responses, usage reported by tools, and summary generation.
|
|
15
|
+
|
|
16
|
+
The editor can be replaced temporarily by built-in UI such as `/settings` or by custom extension UI.
|
|
17
|
+
|
|
18
|
+
### Editor Features
|
|
19
|
+
|
|
20
|
+
| Feature | How |
|
|
21
|
+
|---------|-----|
|
|
22
|
+
| File reference | Type `@` to fuzzy-search project files |
|
|
23
|
+
| Path completion | Press Tab to complete paths |
|
|
24
|
+
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
|
+
| Copy response | Ctrl+X copies the last assistant message; in `/tree`, it copies the selected message |
|
|
26
|
+
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
27
|
+
| Shell command | `!command` runs and sends output to the model |
|
|
28
|
+
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
29
|
+
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
30
|
+
|
|
31
|
+
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
32
|
+
|
|
33
|
+
## Slash Commands
|
|
34
|
+
|
|
35
|
+
Type `/` in the editor to open command completion. Extensions can register custom commands, skills are available as `/skill:name`, and prompt templates expand via `/templatename`.
|
|
36
|
+
|
|
37
|
+
| Command | Description |
|
|
38
|
+
|---------|-------------|
|
|
39
|
+
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
40
|
+
| [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
41
|
+
| `/model` | Switch models |
|
|
42
|
+
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
43
|
+
| `/settings` | Thinking level, theme, message delivery, transport |
|
|
44
|
+
| `/resume` | Pick from previous sessions |
|
|
45
|
+
| `/new` | Start a new session |
|
|
46
|
+
| `/name <name>` | Set session display name |
|
|
47
|
+
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
48
|
+
| `/tree` | Jump to any point in the session and continue from there |
|
|
49
|
+
| `/trust` | Save project trust decision for future sessions |
|
|
50
|
+
| `/fork` | Create a new session from a previous user message |
|
|
51
|
+
| `/clone` | Duplicate the current active branch into a new session |
|
|
52
|
+
| `/compact [prompt]` | Manually compact context, optionally with custom instructions |
|
|
53
|
+
| `/copy` | Copy last assistant message to clipboard |
|
|
54
|
+
| `/export [file]` | Export session to HTML or JSONL |
|
|
55
|
+
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
56
|
+
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
57
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
58
|
+
| `/hotkeys` | Show all keyboard shortcuts |
|
|
59
|
+
| `/changelog` | Display version history |
|
|
60
|
+
| `/quit` | Quit mcpi |
|
|
61
|
+
|
|
62
|
+
## Message Queue
|
|
63
|
+
|
|
64
|
+
You can submit messages while the agent is still working:
|
|
65
|
+
|
|
66
|
+
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
67
|
+
- **Alt+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
68
|
+
- **Escape** aborts and restores queued messages to the editor.
|
|
69
|
+
- **Alt+Up** retrieves queued messages back to the editor.
|
|
70
|
+
|
|
71
|
+
On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want mcpi to receive the shortcut.
|
|
72
|
+
|
|
73
|
+
Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
|
|
74
|
+
|
|
75
|
+
## Sessions
|
|
76
|
+
|
|
77
|
+
Sessions are saved automatically to `$XDG_STATE_HOME/mcpi/sessions/` (fallback `~/.local/state/mcpi/sessions/`; `%LOCALAPPDATA%\mcpi\sessions\` on Windows), organized by working directory.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
mcpi -c # Continue most recent session
|
|
81
|
+
mcpi -r # Browse and select a session
|
|
82
|
+
mcpi --no-session # Ephemeral mode; do not save
|
|
83
|
+
mcpi --name "my task" # Set session display name at startup
|
|
84
|
+
mcpi --session <path|id> # Use a specific session file or session ID
|
|
85
|
+
mcpi --fork <path|id> # Fork a session into a new session file
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Useful session commands:
|
|
89
|
+
|
|
90
|
+
- `/session` shows the current session file and ID.
|
|
91
|
+
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
92
|
+
- `/fork` creates a new session from an earlier user message.
|
|
93
|
+
- `/clone` duplicates the current active branch into a new session file.
|
|
94
|
+
- `/compact` summarizes older messages to free context.
|
|
95
|
+
|
|
96
|
+
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
97
|
+
|
|
98
|
+
## Context Files
|
|
99
|
+
|
|
100
|
+
mcpi loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
101
|
+
|
|
102
|
+
- `$XDG_CONFIG_HOME/mcpi/AGENTS.md` for global instructions (fallback `~/.config/mcpi/AGENTS.md`; `%APPDATA%\mcpi\AGENTS.md` on Windows)
|
|
103
|
+
- parent directories, walking up from the current working directory
|
|
104
|
+
- the current directory
|
|
105
|
+
|
|
106
|
+
If a directory contains `AGENTS.override.md`, mcpi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory. Context files from other directories still layer normally.
|
|
107
|
+
|
|
108
|
+
Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
|
|
109
|
+
|
|
110
|
+
### System Prompt Files
|
|
111
|
+
|
|
112
|
+
Replace the default system prompt with:
|
|
113
|
+
|
|
114
|
+
- `.mcpi/SYSTEM.md` for a project
|
|
115
|
+
- `$XDG_CONFIG_HOME/mcpi/SYSTEM.md` globally (fallback `~/.config/mcpi/SYSTEM.md`; `%APPDATA%\mcpi\SYSTEM.md` on Windows)
|
|
116
|
+
|
|
117
|
+
Append to the default prompt without replacing it with `APPEND_SYSTEM.md` in either location.
|
|
118
|
+
|
|
119
|
+
### Project Trust
|
|
120
|
+
|
|
121
|
+
On interactive startup, mcpi asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in the global config `trust.json`. Trusting a project allows mcpi to load `.mcpi/settings.json` and `.mcpi` resources, install missing project packages, and execute project extensions.
|
|
122
|
+
|
|
123
|
+
Before the trust decision, mcpi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
|
|
124
|
+
|
|
125
|
+
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
126
|
+
|
|
127
|
+
If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in the global config `settings.json`, or change it with `/settings`.
|
|
128
|
+
|
|
129
|
+
`mcpi config` and package commands use the same project trust flow, except `mcpi update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
|
|
130
|
+
|
|
131
|
+
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes the global config `trust.json` only; the current session is not reloaded, so restart mcpi for changes to take effect.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Exporting and Sharing Sessions
|
|
135
|
+
|
|
136
|
+
Use `/export [file]` to write a session to HTML.
|
|
137
|
+
|
|
138
|
+
Use `/share` to upload a private GitHub gist with a shareable HTML link.
|
|
139
|
+
|
|
140
|
+
## CLI Reference
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
mcpi [options] [@files...] [messages...]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Package Commands
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
mcpi install <source> [-l] # Install package, -l for project-local
|
|
150
|
+
mcpi remove <source> [-l] # Remove package
|
|
151
|
+
mcpi uninstall <source> [-l] # Alias for remove
|
|
152
|
+
mcpi update [source|self|mcpi] # Update mcpi only, or one package source
|
|
153
|
+
mcpi update --all # Update mcpi and packages; reconcile pinned git refs
|
|
154
|
+
mcpi update --extensions # Update packages only; reconcile pinned git refs
|
|
155
|
+
mcpi update --models # Refresh model catalogs only
|
|
156
|
+
mcpi update --self # Update mcpi only
|
|
157
|
+
mcpi update --extension <src> # Update one package
|
|
158
|
+
mcpi list # List installed packages
|
|
159
|
+
mcpi config # Enable/disable package resources
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
These commands manage mcpi packages and `mcpi update` can update the mcpi CLI installation. To uninstall mcpi itself, see [Quickstart](quickstart.md#uninstall). `mcpi config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `mcpi update` never prompts for project trust.
|
|
163
|
+
|
|
164
|
+
See [mcpi Packages](packages.md) for package sources and security notes.
|
|
165
|
+
|
|
166
|
+
### Modes
|
|
167
|
+
|
|
168
|
+
| Flag | Description |
|
|
169
|
+
|------|-------------|
|
|
170
|
+
| default | Interactive mode |
|
|
171
|
+
| `-p`, `--print` | Print response and exit |
|
|
172
|
+
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
173
|
+
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
174
|
+
| `--export <in> [out]` | Export a session to HTML |
|
|
175
|
+
|
|
176
|
+
In print mode, mcpi also reads piped stdin and merges it into the initial prompt:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
cat README.md | mcpi -p "Summarize this text"
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Model Options
|
|
183
|
+
|
|
184
|
+
| Option | Description |
|
|
185
|
+
|--------|-------------|
|
|
186
|
+
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
187
|
+
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
188
|
+
| `--api-key <key>` | API key, overriding environment variables |
|
|
189
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
190
|
+
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
191
|
+
| `--list-models [search]` | List available models |
|
|
192
|
+
|
|
193
|
+
### Session Options
|
|
194
|
+
|
|
195
|
+
| Option | Description |
|
|
196
|
+
|--------|-------------|
|
|
197
|
+
| `-c`, `--continue` | Continue the most recent session |
|
|
198
|
+
| `-r`, `--resume` | Browse and select a session |
|
|
199
|
+
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
200
|
+
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
201
|
+
| `--session-dir <dir>` | Custom session storage directory |
|
|
202
|
+
| `--no-session` | Ephemeral mode; do not save |
|
|
203
|
+
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
204
|
+
|
|
205
|
+
### Tool Options
|
|
206
|
+
|
|
207
|
+
| Option | Description |
|
|
208
|
+
|--------|-------------|
|
|
209
|
+
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
210
|
+
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
211
|
+
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
212
|
+
| `--no-tools`, `-nt` | Disable all tools |
|
|
213
|
+
|
|
214
|
+
Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
|
|
215
|
+
|
|
216
|
+
### Resource Options
|
|
217
|
+
|
|
218
|
+
| Option | Description |
|
|
219
|
+
|--------|-------------|
|
|
220
|
+
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
221
|
+
| `--no-extensions` | Disable extension discovery |
|
|
222
|
+
| `--skill <path>` | Load a skill; repeatable |
|
|
223
|
+
| `--no-skills` | Disable skill discovery |
|
|
224
|
+
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
225
|
+
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
226
|
+
| `--theme <path>` | Load a theme; repeatable |
|
|
227
|
+
| `--no-themes` | Disable theme discovery |
|
|
228
|
+
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
229
|
+
|
|
230
|
+
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
mcpi --no-extensions -e ./my-extension.ts
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Other Options
|
|
237
|
+
|
|
238
|
+
| Option | Description |
|
|
239
|
+
|--------|-------------|
|
|
240
|
+
| `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
|
|
241
|
+
| `--append-system-prompt <text>` | Append to system prompt |
|
|
242
|
+
| `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
|
|
243
|
+
| `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
|
|
244
|
+
| `--verbose` | Force verbose startup |
|
|
245
|
+
| `-a`, `--approve` | Trust project-local files for this run |
|
|
246
|
+
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
247
|
+
| `-h`, `--help` | Show help |
|
|
248
|
+
| `-v`, `--version` | Show version |
|
|
249
|
+
|
|
250
|
+
In `fullscreen` mode, the transcript scrolls inside the terminal viewport while queued messages, working status, extension widgets, editor, and footer remain fixed at the bottom. Mouse/trackpad input scrolls the region under the pointer; keyboard viewport actions always remain available. Inline images work in terminals that support the Kitty graphics protocol, including Kitty and Ghostty. In iTerm2 they render as text placeholders because its inline-image protocol cannot delete or crop placements during application-owned scrolling. In `regular` mode, mcpi uses the main screen and terminal-owned scrollback, and iTerm2 inline images continue to render normally. See [Terminal setup](terminal-setup.md) for terminal-specific settings and workarounds.
|
|
251
|
+
|
|
252
|
+
Set **TUI mode** in `/settings` to switch between `regular` and `fullscreen` immediately and choose the default for future sessions. **Fullscreen exit output** controls whether exiting fullscreen prints the final transcript or restores the previous screen and prints only the session resume hint.
|
|
253
|
+
|
|
254
|
+
### File Arguments
|
|
255
|
+
|
|
256
|
+
Prefix files with `@` to include them in the message:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
mcpi @prompt.md "Answer this"
|
|
260
|
+
mcpi -p @screenshot.png "What's in this image?"
|
|
261
|
+
mcpi @code.ts @test.ts "Review these files"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Examples
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Interactive with initial prompt
|
|
268
|
+
mcpi "List all .ts files in src/"
|
|
269
|
+
|
|
270
|
+
# Non-interactive
|
|
271
|
+
mcpi -p "Summarize this codebase"
|
|
272
|
+
|
|
273
|
+
# Non-interactive with piped stdin
|
|
274
|
+
cat README.md | mcpi -p "Summarize this text"
|
|
275
|
+
|
|
276
|
+
# Named one-shot session
|
|
277
|
+
mcpi --name "release audit" -p "Audit this repository"
|
|
278
|
+
|
|
279
|
+
# Different model
|
|
280
|
+
mcpi --provider openai --model gpt-4o "Help me refactor"
|
|
281
|
+
|
|
282
|
+
# Model with provider prefix
|
|
283
|
+
mcpi --model openai/gpt-4o "Help me refactor"
|
|
284
|
+
|
|
285
|
+
# Model with thinking level shorthand
|
|
286
|
+
mcpi --model sonnet:high "Solve this complex problem"
|
|
287
|
+
|
|
288
|
+
# Limit model cycling
|
|
289
|
+
mcpi --models "claude-*,gpt-4o"
|
|
290
|
+
|
|
291
|
+
# Read-only mode
|
|
292
|
+
mcpi --tools read,grep,find,ls -p "Review the code"
|
|
293
|
+
|
|
294
|
+
# Disable one extension or built-in tool while keeping the rest available
|
|
295
|
+
mcpi --exclude-tools ask_question
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Design Principles
|
|
299
|
+
|
|
300
|
+
mcpi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
|
|
301
|
+
|
|
302
|
+
It intentionally does not include built-in MCP, sub-agents, permission popups, plan mode, to-dos, or background bash. You can build or install those workflows as extensions or packages, or use external tools such as containers and tmux.
|
package/docs/windows.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Windows Setup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
mcpi requires a bash shell on Windows. Checked locations (in order):
|
|
4
4
|
|
|
5
|
-
1. Custom path from
|
|
5
|
+
1. Custom path from `%APPDATA%\mcpi\settings.json`
|
|
6
6
|
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
|
|
7
7
|
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
|
|
8
8
|
|