@sammorrowdrums/mcpi 0.70.8 → 0.85.0-bootstrap.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1621 -0
- package/LICENSE +21 -0
- package/README.md +196 -141
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +4 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +1 -1
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +9 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +116 -16
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +103 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +6 -4
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +4 -4
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/experimental/auth.d.ts +16 -0
- package/dist/cli/experimental/auth.d.ts.map +1 -0
- package/dist/cli/experimental/auth.js +13 -0
- package/dist/cli/experimental/auth.js.map +1 -0
- package/dist/cli/experimental/cli.d.ts +6 -0
- package/dist/cli/experimental/cli.d.ts.map +1 -0
- package/dist/cli/experimental/cli.js +5 -0
- package/dist/cli/experimental/cli.js.map +1 -0
- package/dist/cli/experimental/command-options.d.ts +17 -0
- package/dist/cli/experimental/command-options.d.ts.map +1 -0
- package/dist/cli/experimental/command-options.js +35 -0
- package/dist/cli/experimental/command-options.js.map +1 -0
- package/dist/cli/experimental/command.d.ts +63 -0
- package/dist/cli/experimental/command.d.ts.map +1 -0
- package/dist/cli/experimental/command.js +130 -0
- package/dist/cli/experimental/command.js.map +1 -0
- package/dist/cli/experimental/commands/client.d.ts +13 -0
- package/dist/cli/experimental/commands/client.d.ts.map +1 -0
- package/dist/cli/experimental/commands/client.js +25 -0
- package/dist/cli/experimental/commands/client.js.map +1 -0
- package/dist/cli/experimental/commands/mcpi.d.ts +15 -0
- package/dist/cli/experimental/commands/mcpi.d.ts.map +1 -0
- package/dist/cli/experimental/commands/mcpi.js +28 -0
- package/dist/cli/experimental/commands/mcpi.js.map +1 -0
- package/dist/cli/experimental/commands/server.d.ts +13 -0
- package/dist/cli/experimental/commands/server.d.ts.map +1 -0
- package/dist/cli/experimental/commands/server.js +25 -0
- package/dist/cli/experimental/commands/server.js.map +1 -0
- package/dist/cli/experimental/transport-address.d.ts +10 -0
- package/dist/cli/experimental/transport-address.d.ts.map +1 -0
- package/dist/cli/experimental/transport-address.js +38 -0
- package/dist/cli/experimental/transport-address.js.map +1 -0
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +13 -26
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.d.ts +2 -2
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +4 -4
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/session-picker.d.ts +3 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +5 -4
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +184 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -3
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/config.d.ts +34 -12
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +312 -61
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +11 -9
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -7
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +13 -12
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +34 -14
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +110 -53
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +662 -488
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-guidance.js.map +1 -1
- package/dist/core/auth-storage.d.ts +35 -104
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +272 -286
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +11 -8
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +16 -6
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +13 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +25 -9
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +163 -133
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts +3 -3
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +3 -3
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +7 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/env-overlay.d.ts +21 -0
- package/dist/core/env-overlay.d.ts.map +1 -0
- package/dist/core/env-overlay.js +25 -0
- package/dist/core/env-overlay.js.map +1 -0
- package/dist/core/exec.d.ts +8 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +7 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts +6 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +8 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +2 -2
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +8 -6
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +53 -4
- package/dist/core/export-html/template.js +129 -35
- package/dist/core/export-html/tool-renderer.d.ts +2 -8
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +15 -2
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/export-html/vendor/marked.min.js +75 -3
- package/dist/core/extensions/index.d.ts +8 -8
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +5 -7
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +161 -79
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +32 -12
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +194 -3
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +217 -59
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +3 -3
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +22 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +12 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +30 -2
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +96 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +9 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +79 -10
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +11 -10
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +2 -2
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +571 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +254 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +23 -110
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +65 -616
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +20 -7
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +139 -43
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +100 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +602 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +113 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/output-guard.d.ts +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +52 -22
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +21 -4
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +428 -191
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts +8 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +25 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +4 -2
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +36 -50
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +72 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-composer.d.ts +58 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +396 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +17 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +137 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +13 -6
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +143 -22
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +40 -12
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +236 -87
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +26 -25
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +56 -49
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +42 -19
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +454 -223
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +77 -8
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +255 -67
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +2 -2
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +12 -34
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +1 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +15 -25
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts +7 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js +7 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts +5 -3
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +26 -16
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +11 -5
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +224 -185
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +26 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +110 -23
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +11 -5
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +67 -100
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +27 -12
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/find.d.ts +10 -3
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +41 -37
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +7 -3
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +12 -8
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +18 -18
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +7 -3
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +17 -15
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +2 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +39 -21
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/read.d.ts +7 -3
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +101 -51
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +5 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +18 -2
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +2 -2
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -3
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +12 -2
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +6 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +35 -45
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +202 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/core/usage-totals.d.ts +19 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +52 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +3 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +302 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +141 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +217 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +121 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +416 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- package/dist/index.d.ts +34 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +311 -101
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +5 -5
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +10 -10
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +6 -5
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +8 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +55 -26
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -2
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +4 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +2 -2
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -2
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -2
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +37 -6
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +318 -34
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +3 -3
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +2 -2
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +2 -2
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +9 -2
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +6 -4
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +11 -3
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +5 -4
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +19 -32
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +3 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +7 -2
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +9 -4
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +52 -31
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +33 -31
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +2 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +6 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +20 -6
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +12 -6
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +46 -17
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +13 -6
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +92 -44
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +7 -4
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -28
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +5 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +52 -14
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +4 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +18 -16
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +23 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +322 -22
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -2
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +2 -2
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +3 -2
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -2
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +33 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +7 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +179 -26
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +9 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +26 -6
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +104 -26
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1565 -692
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +34 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +10 -5
- package/dist/modes/interactive/theme/light.json +10 -5
- package/dist/modes/interactive/theme/theme-controller.d.ts +40 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +125 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +22 -5
- package/dist/modes/interactive/theme/theme.d.ts +48 -7
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +194 -76
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +31 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +15 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +3 -3
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +16 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +33 -10
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +89 -11
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +69 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +43 -5
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +6 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +527 -25
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/path-migration.d.ts +13 -0
- package/dist/path-migration.d.ts.map +1 -0
- package/dist/path-migration.js +52 -0
- package/dist/path-migration.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/server/create-harness.d.ts +26 -0
- package/dist/server/create-harness.d.ts.map +1 -0
- package/dist/server/create-harness.js +106 -0
- package/dist/server/create-harness.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +48 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +2 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +85 -0
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts +12 -5
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +33 -5
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +4 -4
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +4 -1
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js +14 -8
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +129 -46
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +54 -22
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +1 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +21 -15
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +7 -27
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +75 -115
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +23 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +50 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +100 -16
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +28 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +97 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +18 -6
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +19 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +45 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +10 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +105 -36
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +19 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +85 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +39 -32
- package/docs/containerization.md +113 -0
- package/docs/custom-provider.md +212 -75
- package/docs/development.md +9 -9
- package/docs/docs.json +156 -0
- package/docs/environment-variables.md +186 -0
- package/docs/extensions.md +652 -140
- package/docs/index.md +81 -0
- package/docs/json.md +26 -15
- package/docs/keybindings.md +60 -21
- package/docs/llama-cpp.md +99 -0
- package/docs/models.md +168 -34
- package/docs/packages.md +46 -36
- package/docs/prompt-templates.md +13 -5
- package/docs/providers.md +147 -26
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +218 -36
- package/docs/sdk.md +190 -125
- package/docs/security.md +59 -0
- package/docs/{session.md → session-format.md} +48 -22
- package/docs/sessions.md +145 -0
- package/docs/settings.md +130 -25
- package/docs/shell-aliases.md +2 -2
- package/docs/skills.md +13 -14
- package/docs/terminal-setup.md +73 -16
- package/docs/termux.md +10 -10
- package/docs/themes.md +41 -16
- package/docs/tmux.md +6 -4
- package/docs/tui.md +85 -61
- package/docs/usage.md +302 -0
- package/docs/windows.md +2 -2
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +12 -9
- package/examples/extensions/bash-spawn-hook.ts +2 -2
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +2 -2
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/custom-compaction.ts +6 -16
- package/examples/extensions/custom-footer.ts +1 -1
- package/examples/extensions/custom-header.ts +7 -7
- package/examples/extensions/custom-provider-anthropic/index.ts +15 -8
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +3 -3
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +65 -9
- package/examples/extensions/custom-provider-gitlab-duo/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
- package/examples/extensions/doom-overlay/README.md +1 -1
- package/examples/extensions/doom-overlay/doom-component.ts +4 -4
- package/examples/extensions/doom-overlay/doom-keys.ts +1 -1
- package/examples/extensions/doom-overlay/index.ts +5 -5
- package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +2 -2
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +50 -14
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/inline-bash.ts +2 -2
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +2 -2
- package/examples/extensions/interactive-shell.ts +2 -2
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/mac-system-theme.ts +2 -2
- package/examples/extensions/message-renderer.ts +3 -3
- package/examples/extensions/minimal-mode.ts +2 -2
- package/examples/extensions/modal-editor.ts +2 -2
- package/examples/extensions/model-status.ts +1 -1
- package/examples/extensions/notify.ts +3 -3
- package/examples/extensions/overlay-qa-tests.ts +242 -140
- package/examples/extensions/overlay-test.ts +9 -6
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/plan-mode/README.md +3 -2
- package/examples/extensions/plan-mode/index.ts +90 -40
- package/examples/extensions/preset.ts +16 -10
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/provider-payload.ts +5 -5
- package/examples/extensions/qna.ts +4 -8
- package/examples/extensions/question.ts +41 -19
- package/examples/extensions/questionnaire.ts +50 -29
- package/examples/extensions/rainbow-editor.ts +1 -1
- package/examples/extensions/reload-runtime.ts +2 -2
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +9 -9
- package/examples/extensions/sandbox/package-lock.json +7 -7
- package/examples/extensions/sandbox/package.json +3 -3
- package/examples/extensions/shutdown-command.ts +5 -5
- package/examples/extensions/snake.ts +2 -2
- package/examples/extensions/space-invaders.ts +2 -2
- package/examples/extensions/ssh.ts +2 -2
- package/examples/extensions/structured-output.ts +1 -1
- package/examples/extensions/subagent/README.md +18 -13
- package/examples/extensions/subagent/agents.ts +42 -11
- package/examples/extensions/subagent/index.ts +76 -30
- package/examples/extensions/summarize.ts +12 -19
- package/examples/extensions/tic-tac-toe.ts +2 -2
- package/examples/extensions/titlebar-spinner.ts +3 -3
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +7 -2
- package/examples/extensions/truncated-tool.ts +2 -2
- package/examples/extensions/with-deps/package-lock.json +4 -4
- package/examples/extensions/with-deps/package.json +4 -4
- package/examples/extensions/working-indicator.ts +4 -4
- package/examples/extensions/working-message-test.ts +1 -1
- package/examples/rpc-extension-ui.ts +11 -2
- package/examples/sdk/01-minimal.ts +15 -11
- package/examples/sdk/02-custom-model.ts +18 -18
- package/examples/sdk/03-custom-prompt.ts +25 -17
- package/examples/sdk/04-skills.ts +3 -3
- package/examples/sdk/05-tools.ts +8 -4
- package/examples/sdk/06-extensions.ts +13 -9
- package/examples/sdk/07-context-files.ts +2 -2
- package/examples/sdk/08-prompt-templates.ts +3 -3
- package/examples/sdk/09-api-keys-and-oauth.ts +19 -33
- package/examples/sdk/10-settings.ts +4 -4
- package/examples/sdk/11-sessions.ts +4 -0
- package/examples/sdk/12-full-control.ts +22 -21
- package/examples/sdk/README.md +23 -30
- package/npm-shrinkwrap.json +1818 -0
- package/package.json +117 -99
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/auth-selector-status.d.ts +0 -20
- package/dist/modes/interactive/components/auth-selector-status.d.ts.map +0 -1
- package/dist/modes/interactive/components/auth-selector-status.js +0 -23
- package/dist/modes/interactive/components/auth-selector-status.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -40
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/docs/images/exy.png +0 -0
- package/docs/tree.md +0 -233
- package/examples/extensions/antigravity-image-gen.ts +0 -418
- package/examples/extensions/custom-provider-qwen-cli/index.ts +0 -345
- package/examples/extensions/custom-provider-qwen-cli/package.json +0 -16
|
@@ -4,7 +4,7 @@ Read-only exploration mode for safe code analysis.
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **Built-in write tools disabled**: Disables edit/write while preserving other active tools
|
|
8
8
|
- **Bash allowlist**: Only read-only bash commands are allowed
|
|
9
9
|
- **Plan extraction**: Extracts numbered steps from `Plan:` sections
|
|
10
10
|
- **Progress tracking**: Widget shows completion status during execution
|
|
@@ -37,7 +37,8 @@ Plan:
|
|
|
37
37
|
## How It Works
|
|
38
38
|
|
|
39
39
|
### Plan Mode (Read-Only)
|
|
40
|
-
-
|
|
40
|
+
- Built-in edit/write tools disabled
|
|
41
|
+
- Other active tools remain available
|
|
41
42
|
- Bash commands filtered through allowlist
|
|
42
43
|
- Agent creates a plan without making changes
|
|
43
44
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Plan Mode Extension
|
|
3
3
|
*
|
|
4
4
|
* Read-only exploration mode for safe code analysis.
|
|
5
|
-
* When enabled,
|
|
5
|
+
* When enabled, built-in write tools are disabled.
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
|
8
8
|
* - /plan command or Ctrl+Alt+P to toggle
|
|
@@ -12,15 +12,24 @@
|
|
|
12
12
|
* - Progress tracking widget during execution
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { Key } from "@mariozechner/pi-tui";
|
|
16
15
|
import type { ExtensionAPI, ExtensionContext } from "@sammorrowdrums/mcpi";
|
|
17
|
-
import type { AgentMessage } from "@sammorrowdrums/mcpi-agent";
|
|
16
|
+
import type { AgentMessage } from "@sammorrowdrums/mcpi-agent-core";
|
|
18
17
|
import type { AssistantMessage, TextContent } from "@sammorrowdrums/mcpi-ai";
|
|
19
|
-
import {
|
|
18
|
+
import { Key } from "@sammorrowdrums/mcpi-tui";
|
|
19
|
+
import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
|
|
20
20
|
|
|
21
21
|
// Tools
|
|
22
22
|
const PLAN_MODE_TOOLS = ["read", "bash", "grep", "find", "ls", "questionnaire"];
|
|
23
23
|
const NORMAL_MODE_TOOLS = ["read", "bash", "edit", "write"];
|
|
24
|
+
const PLAN_MODE_DISABLED_TOOLS = new Set<string>(["edit", "write"]);
|
|
25
|
+
const PLAN_MANAGED_TOOLS = new Set<string>([...PLAN_MODE_TOOLS, ...NORMAL_MODE_TOOLS]);
|
|
26
|
+
|
|
27
|
+
interface PlanModeState {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
todos?: TodoItem[];
|
|
30
|
+
executing?: boolean;
|
|
31
|
+
toolsBeforePlanMode?: string[];
|
|
32
|
+
}
|
|
24
33
|
|
|
25
34
|
// Type guard for assistant messages
|
|
26
35
|
function isAssistantMessage(m: AgentMessage): m is AssistantMessage {
|
|
@@ -39,6 +48,7 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
39
48
|
let planModeEnabled = false;
|
|
40
49
|
let executionMode = false;
|
|
41
50
|
let todoItems: TodoItem[] = [];
|
|
51
|
+
let toolsBeforePlanMode: string[] | undefined;
|
|
42
52
|
|
|
43
53
|
pi.registerFlag("plan", {
|
|
44
54
|
description: "Start in plan mode (read-only exploration)",
|
|
@@ -73,19 +83,34 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
todoItems = [];
|
|
86
|
+
function uniqueToolNames(toolNames: string[]): string[] {
|
|
87
|
+
return [...new Set(toolNames)];
|
|
88
|
+
}
|
|
80
89
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
function getPlanModeTools(activeToolNames: string[]): string[] {
|
|
91
|
+
return uniqueToolNames([
|
|
92
|
+
...activeToolNames.filter((name) => !PLAN_MODE_DISABLED_TOOLS.has(name)),
|
|
93
|
+
...PLAN_MODE_TOOLS,
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function getNormalModeTools(activeToolNames: string[]): string[] {
|
|
98
|
+
return uniqueToolNames([
|
|
99
|
+
...NORMAL_MODE_TOOLS,
|
|
100
|
+
...activeToolNames.filter((name) => !PLAN_MANAGED_TOOLS.has(name)),
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function enablePlanModeTools(): void {
|
|
105
|
+
if (toolsBeforePlanMode === undefined) {
|
|
106
|
+
toolsBeforePlanMode = pi.getActiveTools();
|
|
87
107
|
}
|
|
88
|
-
|
|
108
|
+
pi.setActiveTools(getPlanModeTools(toolsBeforePlanMode));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function restoreNormalModeTools(): void {
|
|
112
|
+
pi.setActiveTools(toolsBeforePlanMode ?? getNormalModeTools(pi.getActiveTools()));
|
|
113
|
+
toolsBeforePlanMode = undefined;
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
function persistState(): void {
|
|
@@ -93,9 +118,26 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
93
118
|
enabled: planModeEnabled,
|
|
94
119
|
todos: todoItems,
|
|
95
120
|
executing: executionMode,
|
|
121
|
+
toolsBeforePlanMode,
|
|
96
122
|
});
|
|
97
123
|
}
|
|
98
124
|
|
|
125
|
+
function togglePlanMode(ctx: ExtensionContext): void {
|
|
126
|
+
planModeEnabled = !planModeEnabled;
|
|
127
|
+
executionMode = false;
|
|
128
|
+
todoItems = [];
|
|
129
|
+
|
|
130
|
+
if (planModeEnabled) {
|
|
131
|
+
enablePlanModeTools();
|
|
132
|
+
ctx.ui.notify("Plan mode enabled. Built-in write tools disabled.");
|
|
133
|
+
} else {
|
|
134
|
+
restoreNormalModeTools();
|
|
135
|
+
ctx.ui.notify("Plan mode disabled. Full access restored.");
|
|
136
|
+
}
|
|
137
|
+
updateStatus(ctx);
|
|
138
|
+
persistState();
|
|
139
|
+
}
|
|
140
|
+
|
|
99
141
|
pi.registerCommand("plan", {
|
|
100
142
|
description: "Toggle plan mode (read-only exploration)",
|
|
101
143
|
handler: async (_args, ctx) => togglePlanMode(ctx),
|
|
@@ -165,8 +207,8 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
165
207
|
You are in plan mode - a read-only exploration mode for safe code analysis.
|
|
166
208
|
|
|
167
209
|
Restrictions:
|
|
168
|
-
-
|
|
169
|
-
-
|
|
210
|
+
- Built-in edit and write tools are disabled
|
|
211
|
+
- Other currently active tools remain available
|
|
170
212
|
- Bash is restricted to an allowlist of read-only commands
|
|
171
213
|
|
|
172
214
|
Ask clarifying questions using the questionnaire tool.
|
|
@@ -228,7 +270,6 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
228
270
|
);
|
|
229
271
|
executionMode = false;
|
|
230
272
|
todoItems = [];
|
|
231
|
-
pi.setActiveTools(NORMAL_MODE_TOOLS);
|
|
232
273
|
updateStatus(ctx);
|
|
233
274
|
persistState(); // Save cleared state so resume doesn't restore old execution mode
|
|
234
275
|
}
|
|
@@ -246,43 +287,51 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
246
287
|
}
|
|
247
288
|
}
|
|
248
289
|
|
|
290
|
+
if (todoItems.length === 0) return;
|
|
291
|
+
persistState();
|
|
292
|
+
|
|
249
293
|
// Show plan steps and prompt for next action
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
display: true,
|
|
257
|
-
},
|
|
258
|
-
{ triggerTurn: false },
|
|
259
|
-
);
|
|
260
|
-
}
|
|
294
|
+
const todoListText = todoItems.map((t, i) => `${i + 1}. ☐ ${t.text}`).join("\n");
|
|
295
|
+
const planTodoListMessage = {
|
|
296
|
+
customType: "plan-todo-list",
|
|
297
|
+
content: `**Plan Steps (${todoItems.length}):**\n\n${todoListText}`,
|
|
298
|
+
display: true,
|
|
299
|
+
};
|
|
261
300
|
|
|
262
301
|
const choice = await ctx.ui.select("Plan mode - what next?", [
|
|
263
|
-
|
|
302
|
+
"Execute the plan (track progress)",
|
|
264
303
|
"Stay in plan mode",
|
|
265
304
|
"Refine the plan",
|
|
266
305
|
]);
|
|
267
306
|
|
|
268
307
|
if (choice?.startsWith("Execute")) {
|
|
308
|
+
const firstTodoItem = todoItems[0];
|
|
309
|
+
if (!firstTodoItem) return;
|
|
310
|
+
|
|
269
311
|
planModeEnabled = false;
|
|
270
|
-
executionMode =
|
|
271
|
-
|
|
312
|
+
executionMode = true;
|
|
313
|
+
restoreNormalModeTools();
|
|
272
314
|
updateStatus(ctx);
|
|
315
|
+
persistState();
|
|
316
|
+
|
|
317
|
+
const remainingList = todoItems.map((t) => `${t.step}. ${t.text}`).join("\n");
|
|
318
|
+
const execMessage = `Execute the plan.
|
|
319
|
+
|
|
320
|
+
Remaining steps:
|
|
321
|
+
${remainingList}
|
|
273
322
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
: "Execute the plan you just created.";
|
|
323
|
+
Start with: ${firstTodoItem.text}
|
|
324
|
+
After completing a step, include a [DONE:n] tag in your response.`;
|
|
325
|
+
pi.sendMessage(planTodoListMessage, { deliverAs: "followUp" });
|
|
278
326
|
pi.sendMessage(
|
|
279
327
|
{ customType: "plan-mode-execute", content: execMessage, display: true },
|
|
280
|
-
{ triggerTurn: true },
|
|
328
|
+
{ triggerTurn: true, deliverAs: "followUp" },
|
|
281
329
|
);
|
|
282
330
|
} else if (choice === "Refine the plan") {
|
|
283
331
|
const refinement = await ctx.ui.editor("Refine the plan:", "");
|
|
284
332
|
if (refinement?.trim()) {
|
|
285
|
-
pi.
|
|
333
|
+
pi.sendMessage(planTodoListMessage, { deliverAs: "followUp" });
|
|
334
|
+
pi.sendUserMessage(refinement.trim(), { deliverAs: "followUp" });
|
|
286
335
|
}
|
|
287
336
|
}
|
|
288
337
|
});
|
|
@@ -298,12 +347,13 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
298
347
|
// Restore persisted state
|
|
299
348
|
const planModeEntry = entries
|
|
300
349
|
.filter((e: { type: string; customType?: string }) => e.type === "custom" && e.customType === "plan-mode")
|
|
301
|
-
.pop() as { data?:
|
|
350
|
+
.pop() as { data?: PlanModeState } | undefined;
|
|
302
351
|
|
|
303
352
|
if (planModeEntry?.data) {
|
|
304
353
|
planModeEnabled = planModeEntry.data.enabled ?? planModeEnabled;
|
|
305
354
|
todoItems = planModeEntry.data.todos ?? todoItems;
|
|
306
355
|
executionMode = planModeEntry.data.executing ?? executionMode;
|
|
356
|
+
toolsBeforePlanMode = planModeEntry.data.toolsBeforePlanMode ?? toolsBeforePlanMode;
|
|
307
357
|
}
|
|
308
358
|
|
|
309
359
|
// On resume: re-scan messages to rebuild completion state
|
|
@@ -333,7 +383,7 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
333
383
|
}
|
|
334
384
|
|
|
335
385
|
if (planModeEnabled) {
|
|
336
|
-
|
|
386
|
+
enablePlanModeTools();
|
|
337
387
|
}
|
|
338
388
|
updateStatus(ctx);
|
|
339
389
|
});
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* and can be activated via CLI flag, /preset command, or Ctrl+Shift+U to cycle.
|
|
7
7
|
*
|
|
8
8
|
* Config files (merged, project takes precedence):
|
|
9
|
-
* -
|
|
10
|
-
* - <cwd>/.
|
|
9
|
+
* - $XDG_CONFIG_HOME/mcpi/presets.json (global; platform fallback applies)
|
|
10
|
+
* - <cwd>/.mcpi/presets.json (project-local)
|
|
11
11
|
*
|
|
12
12
|
* Example presets.json:
|
|
13
13
|
* ```json
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
* Usage:
|
|
33
|
-
* - `
|
|
33
|
+
* - `mcpi --preset plan` - start with plan preset
|
|
34
34
|
* - `/preset` - show selector to switch presets mid-session
|
|
35
35
|
* - `/preset implement` - switch to implement preset directly
|
|
36
36
|
* - `Ctrl+Shift+U` - cycle through presets
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
|
|
41
41
|
import { existsSync, readFileSync } from "node:fs";
|
|
42
42
|
import { join } from "node:path";
|
|
43
|
-
import { Container, Key, type SelectItem, SelectList, Text } from "@mariozechner/pi-tui";
|
|
44
43
|
import type { ExtensionAPI, ExtensionContext } from "@sammorrowdrums/mcpi";
|
|
45
|
-
import { DynamicBorder, getAgentDir } from "@sammorrowdrums/mcpi";
|
|
44
|
+
import { CONFIG_DIR_NAME, DynamicBorder, getAgentDir } from "@sammorrowdrums/mcpi";
|
|
46
45
|
import type { Api, Model } from "@sammorrowdrums/mcpi-ai";
|
|
46
|
+
import { Container, Key, type SelectItem, SelectList, Text } from "@sammorrowdrums/mcpi-tui";
|
|
47
47
|
|
|
48
48
|
// Preset configuration
|
|
49
49
|
interface Preset {
|
|
@@ -52,7 +52,7 @@ interface Preset {
|
|
|
52
52
|
/** Model ID (e.g., "claude-sonnet-4-5") */
|
|
53
53
|
model?: string;
|
|
54
54
|
/** Thinking level */
|
|
55
|
-
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
55
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
56
56
|
/** Tools to enable (replaces default set) */
|
|
57
57
|
tools?: string[];
|
|
58
58
|
/** Instructions to append to system prompt */
|
|
@@ -69,7 +69,7 @@ interface PresetsConfig {
|
|
|
69
69
|
*/
|
|
70
70
|
function loadPresets(cwd: string): PresetsConfig {
|
|
71
71
|
const globalPath = join(getAgentDir(), "presets.json");
|
|
72
|
-
const projectPath = join(cwd,
|
|
72
|
+
const projectPath = join(cwd, CONFIG_DIR_NAME, "presets.json");
|
|
73
73
|
|
|
74
74
|
let globalPresets: PresetsConfig = {};
|
|
75
75
|
let projectPresets: PresetsConfig = {};
|
|
@@ -100,7 +100,7 @@ function loadPresets(cwd: string): PresetsConfig {
|
|
|
100
100
|
|
|
101
101
|
interface OriginalState {
|
|
102
102
|
model: Model<Api> | undefined;
|
|
103
|
-
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
103
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
104
104
|
tools: string[];
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -200,7 +200,10 @@ export default function presetExtension(pi: ExtensionAPI) {
|
|
|
200
200
|
const presetNames = Object.keys(presets);
|
|
201
201
|
|
|
202
202
|
if (presetNames.length === 0) {
|
|
203
|
-
ctx.ui.notify(
|
|
203
|
+
ctx.ui.notify(
|
|
204
|
+
`No presets defined. Add presets to ${join(getAgentDir(), "presets.json")} or ${join(ctx.cwd, CONFIG_DIR_NAME, "presets.json")}`,
|
|
205
|
+
"warning",
|
|
206
|
+
);
|
|
204
207
|
return;
|
|
205
208
|
}
|
|
206
209
|
|
|
@@ -308,7 +311,10 @@ export default function presetExtension(pi: ExtensionAPI) {
|
|
|
308
311
|
async function cyclePreset(ctx: ExtensionContext): Promise<void> {
|
|
309
312
|
const presetNames = getPresetOrder();
|
|
310
313
|
if (presetNames.length === 0) {
|
|
311
|
-
ctx.ui.notify(
|
|
314
|
+
ctx.ui.notify(
|
|
315
|
+
`No presets defined. Add presets to ${join(getAgentDir(), "presets.json")} or ${join(ctx.cwd, CONFIG_DIR_NAME, "presets.json")}`,
|
|
316
|
+
"warning",
|
|
317
|
+
);
|
|
312
318
|
return;
|
|
313
319
|
}
|
|
314
320
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Trust Extension
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates the project_trust event. Install globally or pass via -e:
|
|
5
|
+
*
|
|
6
|
+
* mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/mcpi/extensions"
|
|
7
|
+
* cp packages/coding-agent/examples/extensions/project-trust.ts "${XDG_CONFIG_HOME:-$HOME/.config}/mcpi/extensions/"
|
|
8
|
+
*
|
|
9
|
+
* Or:
|
|
10
|
+
*
|
|
11
|
+
* mcpi -e packages/coding-agent/examples/extensions/project-trust.ts
|
|
12
|
+
*
|
|
13
|
+
* Try it in a project containing .mcpi, AGENTS.md/CLAUDE.md, or .agents/skills.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { ExtensionAPI, ProjectTrustEventResult } from "@sammorrowdrums/mcpi";
|
|
17
|
+
|
|
18
|
+
export default function (pi: ExtensionAPI) {
|
|
19
|
+
let loadCount = 0;
|
|
20
|
+
loadCount++;
|
|
21
|
+
|
|
22
|
+
// Multiple handlers in one extension are allowed. The first handler that returns
|
|
23
|
+
// { trusted: "yes" } or { trusted: "no" } wins and suppresses the built-in
|
|
24
|
+
// trust prompt. Return { trusted: "undecided" } to let another handler or the
|
|
25
|
+
// built-in flow decide.
|
|
26
|
+
pi.on("project_trust", async (event, ctx): Promise<ProjectTrustEventResult> => {
|
|
27
|
+
ctx.ui.notify(`project_trust fired for ${event.cwd} (mode: ${ctx.mode}, load: ${loadCount})`, "info");
|
|
28
|
+
|
|
29
|
+
if (!ctx.hasUI) {
|
|
30
|
+
return { trusted: "undecided" };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const choice = await ctx.ui.select(`Project trust for:\n${event.cwd}`, [
|
|
34
|
+
"Trust and remember",
|
|
35
|
+
"Trust with note and remember",
|
|
36
|
+
"Trust this session",
|
|
37
|
+
"Do not trust this session",
|
|
38
|
+
"Let built-in prompt decide",
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
if (choice === "Trust with note and remember") {
|
|
42
|
+
const note = await ctx.ui.input("Project trust note", "Optional note for this demo");
|
|
43
|
+
ctx.ui.notify(note ? `Recorded demo note: ${note}` : "No demo note entered", "info");
|
|
44
|
+
return { trusted: "yes", remember: true };
|
|
45
|
+
}
|
|
46
|
+
if (choice === "Trust and remember") {
|
|
47
|
+
return { trusted: "yes", remember: true };
|
|
48
|
+
}
|
|
49
|
+
if (choice === "Trust this session") {
|
|
50
|
+
return { trusted: "yes" };
|
|
51
|
+
}
|
|
52
|
+
if (choice === "Do not trust this session") {
|
|
53
|
+
return { trusted: "no" };
|
|
54
|
+
}
|
|
55
|
+
if (choice === "Let built-in prompt decide") {
|
|
56
|
+
return { trusted: "undecided" };
|
|
57
|
+
}
|
|
58
|
+
return { trusted: "undecided" };
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
pi.on("session_start", (_event, ctx) => {
|
|
62
|
+
ctx.ui.notify(`project-trust example loaded after trust resolution in ${ctx.cwd}`, "info");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* are currently active, respecting whatever the user has configured.
|
|
9
9
|
*
|
|
10
10
|
* Usage:
|
|
11
|
-
* 1. Copy this file to
|
|
11
|
+
* 1. Copy this file to the mcpi config directory's extensions/ or your project's .mcpi/extensions/
|
|
12
12
|
* 2. Use the extension — it automatically adapts to your active tools and skills
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { appendFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import type
|
|
3
|
+
import { CONFIG_DIR_NAME, type ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
4
4
|
|
|
5
5
|
export default function (pi: ExtensionAPI) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
pi.on("before_provider_request", (event) => {
|
|
6
|
+
pi.on("before_provider_request", (event, ctx) => {
|
|
7
|
+
const logFile = join(ctx.cwd, CONFIG_DIR_NAME, "provider-payload.log");
|
|
9
8
|
appendFileSync(logFile, `${JSON.stringify(event.payload, null, 2)}\n\n`, "utf8");
|
|
10
9
|
|
|
11
10
|
// Optional: replace the payload instead of only logging it.
|
|
12
11
|
// return { ...event.payload, temperature: 0 };
|
|
13
12
|
});
|
|
14
13
|
|
|
15
|
-
pi.on("after_provider_response", (event) => {
|
|
14
|
+
pi.on("after_provider_response", (event, ctx) => {
|
|
15
|
+
const logFile = join(ctx.cwd, CONFIG_DIR_NAME, "provider-payload.log");
|
|
16
16
|
appendFileSync(logFile, `[${event.status}] ${JSON.stringify(event.headers)}\n\n`, "utf8");
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import type { ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
11
11
|
import { BorderedLoader } from "@sammorrowdrums/mcpi";
|
|
12
|
-
import {
|
|
12
|
+
import type { UserMessage } from "@sammorrowdrums/mcpi-ai";
|
|
13
13
|
|
|
14
14
|
const SYSTEM_PROMPT = `You are a question extractor. Given text from a conversation, extract any questions that need answering and format them for the user to fill in.
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
31
31
|
pi.registerCommand("qna", {
|
|
32
32
|
description: "Extract questions from last assistant message into editor",
|
|
33
33
|
handler: async (_args, ctx) => {
|
|
34
|
-
if (
|
|
34
|
+
if (ctx.mode !== "tui") {
|
|
35
35
|
ctx.ui.notify("qna requires interactive mode", "error");
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -77,20 +77,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
77
77
|
|
|
78
78
|
// Do the work
|
|
79
79
|
const doExtract = async () => {
|
|
80
|
-
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(ctx.model!);
|
|
81
|
-
if (!auth.ok || !auth.apiKey) {
|
|
82
|
-
throw new Error(auth.ok ? `No API key for ${ctx.model!.provider}` : auth.error);
|
|
83
|
-
}
|
|
84
80
|
const userMessage: UserMessage = {
|
|
85
81
|
role: "user",
|
|
86
82
|
content: [{ type: "text", text: lastAssistantText! }],
|
|
87
83
|
timestamp: Date.now(),
|
|
88
84
|
};
|
|
89
85
|
|
|
90
|
-
const response = await complete(
|
|
86
|
+
const response = await ctx.modelRegistry.complete(
|
|
91
87
|
ctx.model!,
|
|
92
88
|
{ systemPrompt: SYSTEM_PROMPT, messages: [userMessage] },
|
|
93
|
-
{
|
|
89
|
+
{ signal: loader.signal },
|
|
94
90
|
);
|
|
95
91
|
|
|
96
92
|
if (response.stopReason === "aborted") {
|
|
@@ -4,8 +4,16 @@
|
|
|
4
4
|
* Escape in editor returns to options, Escape in options cancels
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "@mariozechner/pi-tui";
|
|
8
7
|
import type { ExtensionAPI } from "@sammorrowdrums/mcpi";
|
|
8
|
+
import {
|
|
9
|
+
Editor,
|
|
10
|
+
type EditorTheme,
|
|
11
|
+
Key,
|
|
12
|
+
matchesKey,
|
|
13
|
+
Text,
|
|
14
|
+
visibleWidth,
|
|
15
|
+
wrapTextWithAnsi,
|
|
16
|
+
} from "@sammorrowdrums/mcpi-tui";
|
|
9
17
|
import { Type } from "typebox";
|
|
10
18
|
|
|
11
19
|
interface OptionWithDesc {
|
|
@@ -39,9 +47,10 @@ export default function question(pi: ExtensionAPI) {
|
|
|
39
47
|
label: "Question",
|
|
40
48
|
description: "Ask the user a question and let them pick from options. Use when you need user input to proceed.",
|
|
41
49
|
parameters: QuestionParams,
|
|
50
|
+
executionMode: "sequential",
|
|
42
51
|
|
|
43
52
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
44
|
-
if (
|
|
53
|
+
if (ctx.mode !== "tui") {
|
|
45
54
|
return {
|
|
46
55
|
content: [{ type: "text", text: "Error: UI not available (running in non-interactive mode)" }],
|
|
47
56
|
details: {
|
|
@@ -139,10 +148,27 @@ export default function question(pi: ExtensionAPI) {
|
|
|
139
148
|
if (cachedLines) return cachedLines;
|
|
140
149
|
|
|
141
150
|
const lines: string[] = [];
|
|
142
|
-
const
|
|
151
|
+
const renderWidth = Math.max(1, width);
|
|
143
152
|
|
|
144
|
-
|
|
145
|
-
|
|
153
|
+
function addWrapped(text: string) {
|
|
154
|
+
lines.push(...wrapTextWithAnsi(text, renderWidth));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function addWrappedWithPrefix(prefix: string, text: string) {
|
|
158
|
+
const prefixWidth = visibleWidth(prefix);
|
|
159
|
+
if (prefixWidth >= renderWidth) {
|
|
160
|
+
addWrapped(prefix + text);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const wrapped = wrapTextWithAnsi(text, renderWidth - prefixWidth);
|
|
164
|
+
const continuationPrefix = " ".repeat(prefixWidth);
|
|
165
|
+
for (let i = 0; i < wrapped.length; i++) {
|
|
166
|
+
lines.push(`${i === 0 ? prefix : continuationPrefix}${wrapped[i]}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
lines.push(theme.fg("accent", "─".repeat(renderWidth)));
|
|
171
|
+
addWrappedWithPrefix(" ", theme.fg("text", params.question));
|
|
146
172
|
lines.push("");
|
|
147
173
|
|
|
148
174
|
for (let i = 0; i < allOptions.length; i++) {
|
|
@@ -150,36 +176,32 @@ export default function question(pi: ExtensionAPI) {
|
|
|
150
176
|
const selected = i === optionIndex;
|
|
151
177
|
const isOther = opt.isOther === true;
|
|
152
178
|
const prefix = selected ? theme.fg("accent", "> ") : " ";
|
|
179
|
+
const label = `${i + 1}. ${opt.label}${isOther && editMode ? " ✎" : ""}`;
|
|
180
|
+
const color = selected || (isOther && editMode) ? "accent" : "text";
|
|
153
181
|
|
|
154
|
-
|
|
155
|
-
add(prefix + theme.fg("accent", `${i + 1}. ${opt.label} ✎`));
|
|
156
|
-
} else if (selected) {
|
|
157
|
-
add(prefix + theme.fg("accent", `${i + 1}. ${opt.label}`));
|
|
158
|
-
} else {
|
|
159
|
-
add(` ${theme.fg("text", `${i + 1}. ${opt.label}`)}`);
|
|
160
|
-
}
|
|
182
|
+
addWrappedWithPrefix(prefix, theme.fg(color, label));
|
|
161
183
|
|
|
162
184
|
// Show description if present
|
|
163
185
|
if (opt.description) {
|
|
164
|
-
|
|
186
|
+
addWrappedWithPrefix(" ", theme.fg("muted", opt.description));
|
|
165
187
|
}
|
|
166
188
|
}
|
|
167
189
|
|
|
168
190
|
if (editMode) {
|
|
169
191
|
lines.push("");
|
|
170
|
-
|
|
171
|
-
for (const line of editor.render(
|
|
172
|
-
|
|
192
|
+
addWrappedWithPrefix(" ", theme.fg("muted", "Your answer:"));
|
|
193
|
+
for (const line of editor.render(Math.max(1, renderWidth - 2))) {
|
|
194
|
+
lines.push(` ${line}`);
|
|
173
195
|
}
|
|
174
196
|
}
|
|
175
197
|
|
|
176
198
|
lines.push("");
|
|
177
199
|
if (editMode) {
|
|
178
|
-
|
|
200
|
+
addWrappedWithPrefix(" ", theme.fg("dim", "Enter to submit • Esc to go back"));
|
|
179
201
|
} else {
|
|
180
|
-
|
|
202
|
+
addWrappedWithPrefix(" ", theme.fg("dim", "↑↓ navigate • Enter to select • Esc to cancel"));
|
|
181
203
|
}
|
|
182
|
-
|
|
204
|
+
lines.push(theme.fg("accent", "─".repeat(renderWidth)));
|
|
183
205
|
|
|
184
206
|
cachedLines = lines;
|
|
185
207
|
return lines;
|