@sammorrowdrums/mcpi 0.70.9 → 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 +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 +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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Overlay QA Tests - comprehensive overlay positioning and edge case tests
|
|
3
3
|
*
|
|
4
|
-
* Usage:
|
|
4
|
+
* Usage: mcpi --extension ./examples/extensions/overlay-qa-tests.ts
|
|
5
5
|
*
|
|
6
6
|
* Commands:
|
|
7
7
|
* /overlay-animation - Real-time animation demo (~30 FPS, proves DOOM-like rendering works)
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
* /overlay-sidepanel - Responsive sidepanel (hides when terminal < 100 cols)
|
|
16
16
|
* /overlay-toggle - Toggle visibility demo (demonstrates OverlayHandle.setHidden)
|
|
17
17
|
* /overlay-passive - Non-capturing overlay demo (passive info panel alongside active overlay)
|
|
18
|
-
* /overlay-focus - Focus cycling and rendering order with
|
|
18
|
+
* /overlay-focus - Focus cycling, input routing, dismissal, and rendering order with overlays
|
|
19
19
|
* /overlay-streaming - Multiple input panels with simulated streaming (Tab to cycle focus)
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { Component, OverlayAnchor, OverlayHandle, OverlayOptions, TUI } from "@mariozechner/pi-tui";
|
|
23
|
-
import { matchesKey, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
|
|
24
22
|
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@sammorrowdrums/mcpi";
|
|
23
|
+
import type { Component, OverlayAnchor, OverlayHandle, OverlayOptions, TUI } from "@sammorrowdrums/mcpi-tui";
|
|
24
|
+
import { Input, matchesKey, truncateToWidth, visibleWidth } from "@sammorrowdrums/mcpi-tui";
|
|
25
25
|
import { spawn } from "child_process";
|
|
26
26
|
|
|
27
27
|
// Global handle for toggle demo (in real code, use a more elegant pattern)
|
|
@@ -272,9 +272,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
272
272
|
},
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
-
// Focus cycling demo - demonstrates focus(),
|
|
275
|
+
// Focus cycling demo - demonstrates focus(), input routing, per-panel dismissal, and rendering order
|
|
276
276
|
pi.registerCommand("overlay-focus", {
|
|
277
|
-
description: "Test focus cycling and rendering order with
|
|
277
|
+
description: "Test focus cycling, input routing, dismissal, and rendering order with overlays",
|
|
278
278
|
handler: async (_args: string, ctx: ExtensionCommandContext) => {
|
|
279
279
|
ctx.ui.setEditorText("");
|
|
280
280
|
await ctx.ui.custom<void>((tui, theme, _kb, done) => new FocusDemoController(tui, theme, done), {
|
|
@@ -303,7 +303,11 @@ function sleep(ms: number): Promise<void> {
|
|
|
303
303
|
|
|
304
304
|
// Base overlay component with common rendering
|
|
305
305
|
abstract class BaseOverlay {
|
|
306
|
-
|
|
306
|
+
protected theme: Theme;
|
|
307
|
+
|
|
308
|
+
constructor(theme: Theme) {
|
|
309
|
+
this.theme = theme;
|
|
310
|
+
}
|
|
307
311
|
|
|
308
312
|
protected box(lines: string[], width: number, title?: string): string[] {
|
|
309
313
|
const th = this.theme;
|
|
@@ -330,12 +334,13 @@ abstract class BaseOverlay {
|
|
|
330
334
|
|
|
331
335
|
// Anchor position test
|
|
332
336
|
class AnchorTestComponent extends BaseOverlay {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
) {
|
|
337
|
+
private anchor: OverlayAnchor;
|
|
338
|
+
private done: (result: "next" | "confirm" | "cancel") => void;
|
|
339
|
+
|
|
340
|
+
constructor(theme: Theme, anchor: OverlayAnchor, done: (result: "next" | "confirm" | "cancel") => void) {
|
|
338
341
|
super(theme);
|
|
342
|
+
this.anchor = anchor;
|
|
343
|
+
this.done = done;
|
|
339
344
|
}
|
|
340
345
|
|
|
341
346
|
handleInput(data: string): void {
|
|
@@ -368,12 +373,17 @@ class AnchorTestComponent extends BaseOverlay {
|
|
|
368
373
|
|
|
369
374
|
// Margin/offset test
|
|
370
375
|
class MarginTestComponent extends BaseOverlay {
|
|
376
|
+
private config: { name: string; options: OverlayOptions };
|
|
377
|
+
private done: (result: "next" | "close") => void;
|
|
378
|
+
|
|
371
379
|
constructor(
|
|
372
380
|
theme: Theme,
|
|
373
|
-
|
|
374
|
-
|
|
381
|
+
config: { name: string; options: OverlayOptions },
|
|
382
|
+
done: (result: "next" | "close") => void,
|
|
375
383
|
) {
|
|
376
384
|
super(theme);
|
|
385
|
+
this.config = config;
|
|
386
|
+
this.done = done;
|
|
377
387
|
}
|
|
378
388
|
|
|
379
389
|
handleInput(data: string): void {
|
|
@@ -403,13 +413,15 @@ class MarginTestComponent extends BaseOverlay {
|
|
|
403
413
|
|
|
404
414
|
// Stacked overlay test
|
|
405
415
|
class StackOverlayComponent extends BaseOverlay {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
) {
|
|
416
|
+
private num: number;
|
|
417
|
+
private position: string;
|
|
418
|
+
private done: (result: string) => void;
|
|
419
|
+
|
|
420
|
+
constructor(theme: Theme, num: number, position: string, done: (result: string) => void) {
|
|
412
421
|
super(theme);
|
|
422
|
+
this.num = num;
|
|
423
|
+
this.position = position;
|
|
424
|
+
this.done = done;
|
|
413
425
|
}
|
|
414
426
|
|
|
415
427
|
handleInput(data: string): void {
|
|
@@ -446,19 +458,19 @@ class StackOverlayComponent extends BaseOverlay {
|
|
|
446
458
|
|
|
447
459
|
// Streaming overflow test - spawns real process with colored output (original crash scenario)
|
|
448
460
|
class StreamingOverflowComponent extends BaseOverlay {
|
|
461
|
+
private tui: TUI;
|
|
449
462
|
private lines: string[] = [];
|
|
450
463
|
private proc: ReturnType<typeof spawn> | null = null;
|
|
451
464
|
private scrollOffset = 0;
|
|
452
465
|
private maxVisibleLines = 15;
|
|
453
466
|
private finished = false;
|
|
454
467
|
private disposed = false;
|
|
468
|
+
private done: () => void;
|
|
455
469
|
|
|
456
|
-
constructor(
|
|
457
|
-
private tui: TUI,
|
|
458
|
-
theme: Theme,
|
|
459
|
-
private done: () => void,
|
|
460
|
-
) {
|
|
470
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
461
471
|
super(theme);
|
|
472
|
+
this.tui = tui;
|
|
473
|
+
this.done = done;
|
|
462
474
|
this.startProcess();
|
|
463
475
|
}
|
|
464
476
|
|
|
@@ -473,13 +485,13 @@ class StreamingOverflowComponent extends BaseOverlay {
|
|
|
473
485
|
echo ""
|
|
474
486
|
for i in $(seq 1 100); do
|
|
475
487
|
# Simulate long file paths with OSC 8 hyperlinks (clickable) - tests width overflow
|
|
476
|
-
DIR="/Users/nicobailon/Documents/development/
|
|
488
|
+
DIR="/Users/nicobailon/Documents/development/mcpi/packages/coding-agent/src/modes/interactive"
|
|
477
489
|
FILE="\${DIR}/components/very-long-component-name-that-exceeds-width-\${i}.ts"
|
|
478
490
|
echo -e "\\033]8;;file://\${FILE}\\007▶ read: \${FILE}\\033]8;;\\007"
|
|
479
491
|
|
|
480
492
|
# Add some colored status messages with long text
|
|
481
493
|
if [ $((i % 5)) -eq 0 ]; then
|
|
482
|
-
echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/
|
|
494
|
+
echo -e " \\033[32m✓ Successfully processed \${i} files in /Users/nicobailon/Documents/development/mcpi\\033[0m"
|
|
483
495
|
fi
|
|
484
496
|
if [ $((i % 7)) -eq 0 ]; then
|
|
485
497
|
echo -e " \\033[33m⚠ Warning: potential issue detected at line \${i} in very-long-component-name-that-exceeds-width.ts\\033[0m"
|
|
@@ -579,11 +591,11 @@ class StreamingOverflowComponent extends BaseOverlay {
|
|
|
579
591
|
|
|
580
592
|
// Edge position test
|
|
581
593
|
class EdgeTestComponent extends BaseOverlay {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
) {
|
|
594
|
+
private done: () => void;
|
|
595
|
+
|
|
596
|
+
constructor(theme: Theme, done: () => void) {
|
|
586
597
|
super(theme);
|
|
598
|
+
this.done = done;
|
|
587
599
|
}
|
|
588
600
|
|
|
589
601
|
handleInput(data: string): void {
|
|
@@ -614,12 +626,17 @@ class EdgeTestComponent extends BaseOverlay {
|
|
|
614
626
|
|
|
615
627
|
// Percentage positioning test
|
|
616
628
|
class PercentTestComponent extends BaseOverlay {
|
|
629
|
+
private config: { name: string; row: number; col: number };
|
|
630
|
+
private done: (result: "next" | "close") => void;
|
|
631
|
+
|
|
617
632
|
constructor(
|
|
618
633
|
theme: Theme,
|
|
619
|
-
|
|
620
|
-
|
|
634
|
+
config: { name: string; row: number; col: number },
|
|
635
|
+
done: (result: "next" | "close") => void,
|
|
621
636
|
) {
|
|
622
637
|
super(theme);
|
|
638
|
+
this.config = config;
|
|
639
|
+
this.done = done;
|
|
623
640
|
}
|
|
624
641
|
|
|
625
642
|
handleInput(data: string): void {
|
|
@@ -649,11 +666,11 @@ class PercentTestComponent extends BaseOverlay {
|
|
|
649
666
|
|
|
650
667
|
// MaxHeight test - renders 20 lines, truncated to 10 by maxHeight
|
|
651
668
|
class MaxHeightTestComponent extends BaseOverlay {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
) {
|
|
669
|
+
private done: () => void;
|
|
670
|
+
|
|
671
|
+
constructor(theme: Theme, done: () => void) {
|
|
656
672
|
super(theme);
|
|
673
|
+
this.done = done;
|
|
657
674
|
}
|
|
658
675
|
|
|
659
676
|
handleInput(data: string): void {
|
|
@@ -684,15 +701,15 @@ class MaxHeightTestComponent extends BaseOverlay {
|
|
|
684
701
|
|
|
685
702
|
// Responsive sidepanel - demonstrates percentage width and visibility callback
|
|
686
703
|
class SidepanelComponent extends BaseOverlay {
|
|
704
|
+
private tui: TUI;
|
|
687
705
|
private items = ["Dashboard", "Messages", "Settings", "Help", "About"];
|
|
688
706
|
private selectedIndex = 0;
|
|
707
|
+
private done: () => void;
|
|
689
708
|
|
|
690
|
-
constructor(
|
|
691
|
-
private tui: TUI,
|
|
692
|
-
theme: Theme,
|
|
693
|
-
private done: () => void,
|
|
694
|
-
) {
|
|
709
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
695
710
|
super(theme);
|
|
711
|
+
this.tui = tui;
|
|
712
|
+
this.done = done;
|
|
696
713
|
}
|
|
697
714
|
|
|
698
715
|
handleInput(data: string): void {
|
|
@@ -745,18 +762,18 @@ class SidepanelComponent extends BaseOverlay {
|
|
|
745
762
|
|
|
746
763
|
// Animation demo - proves overlays can handle real-time updates like pi-doom
|
|
747
764
|
class AnimationDemoComponent extends BaseOverlay {
|
|
765
|
+
private tui: TUI;
|
|
748
766
|
private frame = 0;
|
|
749
767
|
private interval: ReturnType<typeof setInterval> | null = null;
|
|
750
768
|
private fps = 0;
|
|
751
769
|
private lastFpsUpdate = Date.now();
|
|
752
770
|
private framesSinceLastFps = 0;
|
|
771
|
+
private done: () => void;
|
|
753
772
|
|
|
754
|
-
constructor(
|
|
755
|
-
private tui: TUI,
|
|
756
|
-
theme: Theme,
|
|
757
|
-
private done: () => void,
|
|
758
|
-
) {
|
|
773
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
759
774
|
super(theme);
|
|
775
|
+
this.tui = tui;
|
|
776
|
+
this.done = done;
|
|
760
777
|
this.startAnimation();
|
|
761
778
|
}
|
|
762
779
|
|
|
@@ -860,15 +877,15 @@ function hslToRgb(h: number, s: number, l: number): [number, number, number] {
|
|
|
860
877
|
|
|
861
878
|
// Toggle demo - demonstrates OverlayHandle.setHidden() via onHandle callback
|
|
862
879
|
class ToggleDemoComponent extends BaseOverlay {
|
|
880
|
+
private tui: TUI;
|
|
863
881
|
private toggleCount = 0;
|
|
864
882
|
private isToggling = false;
|
|
883
|
+
private done: () => void;
|
|
865
884
|
|
|
866
|
-
constructor(
|
|
867
|
-
private tui: TUI,
|
|
868
|
-
theme: Theme,
|
|
869
|
-
private done: () => void,
|
|
870
|
-
) {
|
|
885
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
871
886
|
super(theme);
|
|
887
|
+
this.tui = tui;
|
|
888
|
+
this.done = done;
|
|
872
889
|
}
|
|
873
890
|
|
|
874
891
|
handleInput(data: string): void {
|
|
@@ -923,19 +940,19 @@ class ToggleDemoComponent extends BaseOverlay {
|
|
|
923
940
|
|
|
924
941
|
class PassiveDemoController extends BaseOverlay {
|
|
925
942
|
focused = false;
|
|
943
|
+
private tui: TUI;
|
|
926
944
|
private typed = "";
|
|
927
945
|
private timerComponent: TimerPanel;
|
|
928
946
|
private timerHandle: OverlayHandle | null = null;
|
|
929
947
|
private interval: ReturnType<typeof setInterval> | null = null;
|
|
930
948
|
private inputCount = 0;
|
|
931
949
|
private lastInputDebug = "";
|
|
950
|
+
private done: () => void;
|
|
932
951
|
|
|
933
|
-
constructor(
|
|
934
|
-
private tui: TUI,
|
|
935
|
-
theme: Theme,
|
|
936
|
-
private done: () => void,
|
|
937
|
-
) {
|
|
952
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
938
953
|
super(theme);
|
|
954
|
+
this.tui = tui;
|
|
955
|
+
this.done = done;
|
|
939
956
|
this.timerComponent = new TimerPanel(theme);
|
|
940
957
|
this.timerHandle = this.tui.showOverlay(this.timerComponent, {
|
|
941
958
|
nonCapturing: true,
|
|
@@ -1014,57 +1031,66 @@ class TimerPanel extends BaseOverlay {
|
|
|
1014
1031
|
|
|
1015
1032
|
// === Focus cycling demo ===
|
|
1016
1033
|
|
|
1034
|
+
type FocusPanelColor = "error" | "success" | "accent";
|
|
1035
|
+
type FocusPanelConfig = { label: string; color: FocusPanelColor; options: OverlayOptions };
|
|
1036
|
+
type FocusPanelEntry = { panel: FocusPanel; handle: OverlayHandle };
|
|
1037
|
+
|
|
1038
|
+
const FOCUS_PANEL_CONFIGS = [
|
|
1039
|
+
{ label: "Alpha", color: "error", options: { row: 2, col: 4, width: 34 } },
|
|
1040
|
+
{ label: "Beta", color: "success", options: { row: 5, col: 28, width: 34 } },
|
|
1041
|
+
{ label: "Gamma", color: "accent", options: { row: 8, col: 52, width: 34 } },
|
|
1042
|
+
] satisfies FocusPanelConfig[];
|
|
1043
|
+
|
|
1017
1044
|
class FocusDemoController extends BaseOverlay {
|
|
1018
|
-
private
|
|
1019
|
-
private
|
|
1020
|
-
private
|
|
1045
|
+
private readonly tui: TUI;
|
|
1046
|
+
private entries: FocusPanelEntry[] = [];
|
|
1047
|
+
private readonly done: () => void;
|
|
1048
|
+
private closed = false;
|
|
1021
1049
|
|
|
1022
|
-
constructor(
|
|
1023
|
-
private tui: TUI,
|
|
1024
|
-
theme: Theme,
|
|
1025
|
-
private done: () => void,
|
|
1026
|
-
) {
|
|
1050
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
1027
1051
|
super(theme);
|
|
1028
|
-
|
|
1029
|
-
|
|
1052
|
+
this.tui = tui;
|
|
1053
|
+
this.done = done;
|
|
1030
1054
|
|
|
1031
|
-
for (
|
|
1032
|
-
const panel = new FocusPanel(
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
colors[i]!,
|
|
1036
|
-
() => this.cycleFocus(),
|
|
1037
|
-
() => this.close(),
|
|
1038
|
-
);
|
|
1039
|
-
const handle = this.tui.showOverlay(panel, {
|
|
1040
|
-
nonCapturing: true,
|
|
1041
|
-
row: 2,
|
|
1042
|
-
col: 5 + i * 6,
|
|
1043
|
-
width: 28,
|
|
1044
|
-
});
|
|
1045
|
-
panel.handle = handle;
|
|
1046
|
-
this.panels.push(panel);
|
|
1047
|
-
this.handles.push(handle);
|
|
1055
|
+
for (const config of FOCUS_PANEL_CONFIGS) {
|
|
1056
|
+
const panel = new FocusPanel({ theme, config, controller: this });
|
|
1057
|
+
const handle = this.tui.showOverlay(panel, { nonCapturing: true, ...config.options });
|
|
1058
|
+
this.entries.push({ panel, handle });
|
|
1048
1059
|
}
|
|
1060
|
+
|
|
1061
|
+
this.focusFirstOpenPanel();
|
|
1049
1062
|
}
|
|
1050
1063
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1064
|
+
focusNext(current: FocusPanel, direction: 1 | -1 = 1): void {
|
|
1065
|
+
const openEntries = this.openEntries();
|
|
1066
|
+
const currentOpenPosition = openEntries.findIndex((entry) => entry.panel === current);
|
|
1067
|
+
if (currentOpenPosition === -1) throw new Error(`Panel ${current.label} is not open`);
|
|
1068
|
+
const nextOpenPosition = (currentOpenPosition + direction + openEntries.length) % openEntries.length;
|
|
1069
|
+
this.focusEntryAt(openEntries, nextOpenPosition);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
dismiss(panel: FocusPanel): void {
|
|
1073
|
+
const openEntries = this.openEntries();
|
|
1074
|
+
const currentOpenPosition = openEntries.findIndex((candidate) => candidate.panel === panel);
|
|
1075
|
+
if (currentOpenPosition === -1) return;
|
|
1076
|
+
const entry = openEntries[currentOpenPosition];
|
|
1077
|
+
if (!entry) throw new Error(`Invalid focus panel index ${currentOpenPosition}`);
|
|
1078
|
+
const remainingEntries = openEntries.filter((candidate) => candidate.panel !== panel);
|
|
1079
|
+
|
|
1080
|
+
entry.panel.closed = true;
|
|
1081
|
+
entry.handle.hide();
|
|
1082
|
+
if (remainingEntries.length === 0) {
|
|
1083
|
+
this.close();
|
|
1084
|
+
return;
|
|
1060
1085
|
}
|
|
1061
|
-
|
|
1086
|
+
|
|
1087
|
+
this.focusEntryAt(remainingEntries, currentOpenPosition % remainingEntries.length);
|
|
1062
1088
|
}
|
|
1063
1089
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
this.
|
|
1067
|
-
this.
|
|
1090
|
+
close(): void {
|
|
1091
|
+
if (this.closed) return;
|
|
1092
|
+
this.closed = true;
|
|
1093
|
+
this.hidePanels();
|
|
1068
1094
|
this.done();
|
|
1069
1095
|
}
|
|
1070
1096
|
|
|
@@ -1072,80 +1098,148 @@ class FocusDemoController extends BaseOverlay {
|
|
|
1072
1098
|
if (matchesKey(data, "escape") || matchesKey(data, "ctrl+c")) {
|
|
1073
1099
|
this.close();
|
|
1074
1100
|
} else if (matchesKey(data, "tab")) {
|
|
1075
|
-
this.
|
|
1101
|
+
this.focusFirstOpenPanel();
|
|
1076
1102
|
}
|
|
1077
1103
|
}
|
|
1078
1104
|
|
|
1079
1105
|
render(width: number): string[] {
|
|
1080
1106
|
const th = this.theme;
|
|
1081
|
-
const focused = this.
|
|
1107
|
+
const focused = this.entries.find((entry) => entry.handle.isFocused())?.panel.label ?? "Controller";
|
|
1082
1108
|
return this.box(
|
|
1083
1109
|
[
|
|
1084
1110
|
"",
|
|
1085
1111
|
` Current focus: ${th.fg("accent", focused)}`,
|
|
1086
1112
|
"",
|
|
1087
1113
|
" Three overlapping panels above are",
|
|
1088
|
-
`
|
|
1089
|
-
"
|
|
1114
|
+
` ${th.fg("accent", "nonCapturing")} overlays controlled with`,
|
|
1115
|
+
" raw OverlayHandle.focus()/hide().",
|
|
1090
1116
|
"",
|
|
1091
|
-
"
|
|
1092
|
-
"
|
|
1117
|
+
" Type in the focused panel's input.",
|
|
1118
|
+
" Focused panel renders on top.",
|
|
1093
1119
|
"",
|
|
1094
|
-
th.fg("dim", " Tab = cycle
|
|
1120
|
+
th.fg("dim", " Tab/Shift+Tab = cycle panels"),
|
|
1121
|
+
th.fg("dim", " Esc/Ctrl+D = dismiss panel"),
|
|
1122
|
+
th.fg("dim", " Ctrl+C = close all"),
|
|
1095
1123
|
"",
|
|
1096
1124
|
],
|
|
1097
1125
|
width,
|
|
1098
|
-
"Focus Demo",
|
|
1126
|
+
"Focus + Input Demo",
|
|
1099
1127
|
);
|
|
1100
1128
|
}
|
|
1101
1129
|
|
|
1102
1130
|
override dispose(): void {
|
|
1103
|
-
|
|
1131
|
+
if (this.closed) return;
|
|
1132
|
+
this.closed = true;
|
|
1133
|
+
this.hidePanels();
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
private focusFirstOpenPanel(): void {
|
|
1137
|
+
const firstOpen = this.openEntries()[0];
|
|
1138
|
+
if (firstOpen) {
|
|
1139
|
+
firstOpen.handle.focus();
|
|
1140
|
+
this.tui.requestRender();
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
private focusEntryAt(entries: FocusPanelEntry[], index: number): void {
|
|
1145
|
+
const entry = entries[index];
|
|
1146
|
+
if (!entry) throw new Error(`Invalid focus panel index ${index}`);
|
|
1147
|
+
entry.handle.focus();
|
|
1148
|
+
this.tui.requestRender();
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
private hidePanels(): void {
|
|
1152
|
+
for (const entry of this.entries) {
|
|
1153
|
+
if (!entry.panel.closed) {
|
|
1154
|
+
entry.panel.closed = true;
|
|
1155
|
+
entry.handle.hide();
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
this.entries = [];
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
private openEntries(): FocusPanelEntry[] {
|
|
1162
|
+
return this.entries.filter((entry) => !entry.panel.closed);
|
|
1104
1163
|
}
|
|
1105
1164
|
}
|
|
1106
1165
|
|
|
1107
1166
|
class FocusPanel extends BaseOverlay {
|
|
1108
|
-
|
|
1167
|
+
focused = false;
|
|
1168
|
+
closed = false;
|
|
1109
1169
|
readonly label: string;
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1170
|
+
private readonly color: FocusPanelColor;
|
|
1171
|
+
private readonly controller: FocusDemoController;
|
|
1172
|
+
private readonly input = new Input();
|
|
1173
|
+
private inputs: string[] = [];
|
|
1174
|
+
|
|
1175
|
+
constructor({
|
|
1176
|
+
theme,
|
|
1177
|
+
config,
|
|
1178
|
+
controller,
|
|
1179
|
+
}: {
|
|
1180
|
+
theme: Theme;
|
|
1181
|
+
config: FocusPanelConfig;
|
|
1182
|
+
controller: FocusDemoController;
|
|
1183
|
+
}) {
|
|
1118
1184
|
super(theme);
|
|
1119
|
-
this.label = label;
|
|
1185
|
+
this.label = config.label;
|
|
1186
|
+
this.color = config.color;
|
|
1187
|
+
this.controller = controller;
|
|
1120
1188
|
}
|
|
1121
1189
|
|
|
1122
1190
|
handleInput(data: string): void {
|
|
1123
1191
|
if (matchesKey(data, "tab")) {
|
|
1124
|
-
this.
|
|
1125
|
-
} else if (matchesKey(data, "
|
|
1126
|
-
this.
|
|
1192
|
+
this.controller.focusNext(this);
|
|
1193
|
+
} else if (matchesKey(data, "shift+tab")) {
|
|
1194
|
+
this.controller.focusNext(this, -1);
|
|
1195
|
+
} else if (matchesKey(data, "escape") || matchesKey(data, "ctrl+d")) {
|
|
1196
|
+
this.controller.dismiss(this);
|
|
1197
|
+
} else if (matchesKey(data, "ctrl+c")) {
|
|
1198
|
+
this.controller.close();
|
|
1199
|
+
} else if (matchesKey(data, "return")) {
|
|
1200
|
+
this.inputs.push("Enter");
|
|
1201
|
+
} else if (matchesKey(data, "up")) {
|
|
1202
|
+
this.inputs.push("↑");
|
|
1203
|
+
} else if (matchesKey(data, "down")) {
|
|
1204
|
+
this.inputs.push("↓");
|
|
1205
|
+
} else if (matchesKey(data, "left")) {
|
|
1206
|
+
this.input.handleInput(data);
|
|
1207
|
+
this.inputs.push("←");
|
|
1208
|
+
} else if (matchesKey(data, "right")) {
|
|
1209
|
+
this.input.handleInput(data);
|
|
1210
|
+
this.inputs.push("→");
|
|
1211
|
+
} else if (matchesKey(data, "backspace")) {
|
|
1212
|
+
this.input.handleInput(data);
|
|
1213
|
+
this.inputs.push("Backspace");
|
|
1214
|
+
} else {
|
|
1215
|
+
this.input.handleInput(data);
|
|
1216
|
+
this.inputs.push(JSON.stringify(data));
|
|
1127
1217
|
}
|
|
1128
1218
|
}
|
|
1129
1219
|
|
|
1130
1220
|
render(width: number): string[] {
|
|
1131
1221
|
const th = this.theme;
|
|
1132
|
-
const focused = this.handle?.isFocused() ?? false;
|
|
1133
1222
|
const innerW = Math.max(1, width - 2);
|
|
1134
|
-
const border = (c: string) => th.fg(this.color, c);
|
|
1223
|
+
const border = (c: string) => th.fg(this.focused ? this.color : "dim", c);
|
|
1135
1224
|
const padLine = (s: string) => truncateToWidth(s, innerW, "...", true);
|
|
1225
|
+
const recent = this.inputs.length === 0 ? "(none)" : this.inputs.slice(-6).join(" ");
|
|
1136
1226
|
const lines: string[] = [];
|
|
1137
1227
|
|
|
1228
|
+
this.input.focused = this.focused;
|
|
1229
|
+
const [inputLine = ""] = this.input.render(Math.max(1, innerW - 8));
|
|
1138
1230
|
lines.push(border(`╭${"─".repeat(innerW)}╮`));
|
|
1139
|
-
lines.push(
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
lines.push(border("│") + padLine(th.fg("dim", " (passive)")) + border("│"));
|
|
1147
|
-
}
|
|
1231
|
+
lines.push(
|
|
1232
|
+
border("│") +
|
|
1233
|
+
padLine(
|
|
1234
|
+
` ${th.fg(this.color, this.label)} ${this.focused ? th.fg("success", "FOCUSED") : th.fg("dim", "visible")}`,
|
|
1235
|
+
) +
|
|
1236
|
+
border("│"),
|
|
1237
|
+
);
|
|
1148
1238
|
lines.push(border("│") + padLine("") + border("│"));
|
|
1239
|
+
lines.push(border("│") + padLine(` Input: ${inputLine}`) + border("│"));
|
|
1240
|
+
lines.push(border("│") + padLine(` Keys: ${recent}`) + border("│"));
|
|
1241
|
+
lines.push(border("│") + padLine(th.fg("dim", " Tab/Shift+Tab focus")) + border("│"));
|
|
1242
|
+
lines.push(border("│") + padLine(th.fg("dim", " Esc/Ctrl+D dismiss")) + border("│"));
|
|
1149
1243
|
lines.push(border(`╰${"─".repeat(innerW)}╯`));
|
|
1150
1244
|
|
|
1151
1245
|
return lines;
|
|
@@ -1155,19 +1249,19 @@ class FocusPanel extends BaseOverlay {
|
|
|
1155
1249
|
// === Streaming input panel test (/overlay-streaming) ===
|
|
1156
1250
|
|
|
1157
1251
|
class StreamingInputController extends BaseOverlay {
|
|
1252
|
+
private tui: TUI;
|
|
1158
1253
|
private panels: StreamingInputPanel[] = [];
|
|
1159
1254
|
private handles: OverlayHandle[] = [];
|
|
1160
1255
|
private focusIndex = -1; // -1 = controller focused, 0-2 = panel focused
|
|
1161
1256
|
private streamLines: string[] = [];
|
|
1162
1257
|
private streamInterval: ReturnType<typeof setInterval> | null = null;
|
|
1163
1258
|
private lineCount = 0;
|
|
1259
|
+
private done: () => void;
|
|
1164
1260
|
|
|
1165
|
-
constructor(
|
|
1166
|
-
private tui: TUI,
|
|
1167
|
-
theme: Theme,
|
|
1168
|
-
private done: () => void,
|
|
1169
|
-
) {
|
|
1261
|
+
constructor(tui: TUI, theme: Theme, done: () => void) {
|
|
1170
1262
|
super(theme);
|
|
1263
|
+
this.tui = tui;
|
|
1264
|
+
this.done = done;
|
|
1171
1265
|
|
|
1172
1266
|
// Create 3 input panels as non-capturing overlays
|
|
1173
1267
|
const colors = ["error", "success", "accent"] as const;
|
|
@@ -1287,17 +1381,25 @@ class StreamingInputController extends BaseOverlay {
|
|
|
1287
1381
|
|
|
1288
1382
|
class StreamingInputPanel implements Component {
|
|
1289
1383
|
handle: OverlayHandle | null = null;
|
|
1384
|
+
private theme: Theme;
|
|
1290
1385
|
private typed = "";
|
|
1291
1386
|
readonly label: string;
|
|
1387
|
+
private color: "error" | "success" | "accent";
|
|
1388
|
+
private onTab: () => void;
|
|
1389
|
+
private onClose: () => void;
|
|
1292
1390
|
|
|
1293
1391
|
constructor(
|
|
1294
|
-
|
|
1392
|
+
theme: Theme,
|
|
1295
1393
|
label: string,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1394
|
+
color: "error" | "success" | "accent",
|
|
1395
|
+
onTab: () => void,
|
|
1396
|
+
onClose: () => void,
|
|
1299
1397
|
) {
|
|
1398
|
+
this.theme = theme;
|
|
1300
1399
|
this.label = label;
|
|
1400
|
+
this.color = color;
|
|
1401
|
+
this.onTab = onTab;
|
|
1402
|
+
this.onClose = onClose;
|
|
1301
1403
|
}
|
|
1302
1404
|
|
|
1303
1405
|
handleInput(data: string): void {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Overlay Test - validates overlay compositing with inline text inputs
|
|
3
3
|
*
|
|
4
|
-
* Usage:
|
|
4
|
+
* Usage: mcpi --extension ./examples/extensions/overlay-test.ts
|
|
5
5
|
*
|
|
6
6
|
* Run /overlay-test to show a floating overlay with:
|
|
7
7
|
* - Inline text inputs within menu items
|
|
8
8
|
* - Edge case tests (wide chars, styled text, emoji)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { CURSOR_MARKER, type Focusable, matchesKey, visibleWidth } from "@mariozechner/pi-tui";
|
|
12
11
|
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@sammorrowdrums/mcpi";
|
|
12
|
+
import { CURSOR_MARKER, type Focusable, matchesKey, visibleWidth } from "@sammorrowdrums/mcpi-tui";
|
|
13
13
|
|
|
14
14
|
export default function (pi: ExtensionAPI) {
|
|
15
15
|
pi.registerCommand("overlay-test", {
|
|
@@ -42,10 +42,13 @@ class OverlayTestComponent implements Focusable {
|
|
|
42
42
|
{ label: "Cancel", hasInput: false, text: "", cursor: 0 },
|
|
43
43
|
];
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
) {
|
|
45
|
+
private theme: Theme;
|
|
46
|
+
private done: (result: { action: string; query?: string } | undefined) => void;
|
|
47
|
+
|
|
48
|
+
constructor(theme: Theme, done: (result: { action: string; query?: string } | undefined) => void) {
|
|
49
|
+
this.theme = theme;
|
|
50
|
+
this.done = done;
|
|
51
|
+
}
|
|
49
52
|
|
|
50
53
|
handleInput(data: string): void {
|
|
51
54
|
if (matchesKey(data, "escape")) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* change agent behavior based on extension state.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* 1. Copy this file to
|
|
8
|
+
* 1. Copy this file to the mcpi config directory's extensions/ or your project's .mcpi/extensions/
|
|
9
9
|
* 2. Use /pirate to toggle pirate mode
|
|
10
10
|
* 3. When enabled, the agent will respond like a pirate
|
|
11
11
|
*/
|