@earendil-works/pi-coding-agent 0.87.0 → 0.99.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 +103 -0
- package/README.md +25 -711
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.js.map +1 -1
- package/dist/bun/runtime-setup.d.ts.map +1 -1
- package/dist/bun/runtime-setup.js +4 -1
- package/dist/bun/runtime-setup.js.map +1 -1
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
- package/dist/bundle/chunks/anthropic-messages-A6EXUBG6.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-EN5WOBET.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-4CSSZFEW.js +1435 -0
- package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
- package/dist/bundle/chunks/chunk-AXPY26X7.js +146 -0
- package/dist/bundle/chunks/chunk-EPDRUIU6.js +2 -0
- package/dist/bundle/chunks/chunk-GOPCREV2.js +4 -0
- package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
- package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-HSPCVFST.js} +1 -1
- package/dist/bundle/chunks/chunk-IMTXZUO7.js +82 -0
- package/dist/bundle/chunks/chunk-J4CWPC4N.js +2 -0
- package/dist/bundle/chunks/chunk-LLMKQWZS.js +21 -0
- package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-LRS5S6EK.js} +3 -3
- package/dist/bundle/chunks/chunk-PEHWOV5U.js +187 -0
- package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
- package/dist/bundle/chunks/cli-AZXNGIZH.js +49 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XJQQYGGU.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +295 -0
- package/dist/bundle/chunks/execute-7XXPZAWW.js +308 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-CQAKKJTA.js +2 -0
- package/dist/bundle/chunks/google-vertex-AE36YXJU.js +2 -0
- package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
- package/dist/bundle/chunks/llama-cpp-classify-PJJYKPLD.js +22 -0
- package/dist/bundle/chunks/mistral-conversations-KEYTXJM7.js +5 -0
- package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-JQTCOVEG.js} +2 -2
- package/dist/bundle/chunks/openai-codex.js +2 -2
- package/dist/bundle/chunks/{openai-completions-XHML6MTL.js → openai-completions-XW2Q5HVC.js} +2 -2
- package/dist/bundle/chunks/openai-responses-6AXWFL75.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +2 -2
- package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
- package/dist/bundle/chunks/radius.js +2 -2
- package/dist/bundle/chunks/runtime-G5WJPRBM.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
- package/dist/bundle/chunks/virtual-modules-AQ3FLU6H.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +18 -7
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +38 -30
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +18 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +13 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +135 -11
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +509 -253
- 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.map +1 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/bug-report-upload.d.ts.map +1 -1
- package/dist/core/bug-report-upload.js.map +1 -1
- package/dist/core/bug-report.d.ts +1 -1
- package/dist/core/bug-report.d.ts.map +1 -1
- package/dist/core/bug-report.js +1 -1
- package/dist/core/bug-report.js.map +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +10 -31
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +25 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/crash-log.d.ts.map +1 -1
- package/dist/core/crash-log.js +2 -1
- package/dist/core/crash-log.js.map +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +66 -17
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +55 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +18 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +99 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +296 -22
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +2 -2
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +3 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +98 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +157 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +13 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +25 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +5 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +41 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +167 -17
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +102 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +178 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +4 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +59 -12
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-composer.d.ts +40 -21
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +92 -40
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +8 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +18 -3
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +7 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +161 -35
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +24 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts +9 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +22 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts.map +1 -1
- package/dist/core/settings-diagnostics.js.map +1 -1
- package/dist/core/settings-manager.d.ts +31 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +72 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/source-info.d.ts +8 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +16 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +12 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- 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.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -0
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +6 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +26 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +9 -10
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/find.d.ts.map +1 -1
- package/dist/core/tools/renderers/find.js.map +1 -1
- package/dist/core/tools/renderers/grep.d.ts.map +1 -1
- package/dist/core/tools/renderers/grep.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/renderers/ls.d.ts.map +1 -1
- package/dist/core/tools/renderers/ls.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +3 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +14 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +29 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +1 -0
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +2 -0
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +23 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/core/virtual-models.d.ts +115 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +117 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +390 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +31 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +119 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +122 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +324 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +11 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/huggingface.d.ts.map +1 -1
- package/dist/extensions/llama/huggingface.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +65 -13
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +485 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +70 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +146 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +52 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +902 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +94 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +333 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +96 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +388 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +83 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +233 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +172 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +15 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +72 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +210 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -0
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.js.map +1 -1
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/chat-viewport.js.map +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.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +13 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +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.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +8 -2
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +43 -3
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo.js +25 -0
- package/dist/modes/interactive/components/pi-logo.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +28 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +29 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +2 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +199 -161
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +59 -72
- package/dist/modes/interactive/theme/light.json +57 -69
- package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +535 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +127 -47
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-json.js +3 -1
- package/dist/modes/interactive/theme/theme-json.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +7 -2
- package/dist/modes/interactive/theme/theme.d.ts +66 -39
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +238 -317
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +2 -1
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/tui-renderer.js +1 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +12 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +7 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -1
- 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.map +1 -1
- package/dist/package-manager-cli.js +6 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/rpc-entry.d.ts.map +1 -1
- package/dist/rpc-entry.js.map +1 -1
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +14 -17
- package/dist/utils/clipboard-image.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 +5 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/deprecation.d.ts.map +1 -1
- package/dist/utils/deprecation.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/fs-watch.js.map +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/html.d.ts.map +1 -1
- package/dist/utils/html.js.map +1 -1
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-process.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize-worker.d.ts.map +1 -1
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +3 -3
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +5 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -3
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +3 -30
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +2 -0
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/dist/utils/wsl.d.ts.map +1 -1
- package/dist/utils/wsl.js.map +1 -1
- package/dist/utils/zip.d.ts.map +1 -1
- package/dist/utils/zip.js.map +1 -1
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +329 -0
- package/docs/compaction.md +22 -22
- package/docs/configuration.md +47 -0
- package/docs/containerization.md +109 -82
- package/docs/custom-provider.md +109 -722
- package/docs/docs.json +147 -99
- package/docs/environment-variables.md +3 -5
- package/docs/extensions.md +165 -2996
- package/docs/how-pi-works.md +49 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +24 -69
- package/docs/json.md +193 -65
- package/docs/keybindings.md +58 -103
- package/docs/llama-cpp.md +16 -3
- package/docs/mcp.md +188 -0
- package/docs/message-types.md +261 -0
- package/docs/models.md +81 -556
- package/docs/packages.md +67 -166
- package/docs/prompt-templates.md +31 -68
- package/docs/providers.md +103 -240
- package/docs/quickstart.md +61 -106
- package/docs/rpc-commands.md +860 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +130 -1555
- package/docs/sdk.md +79 -1169
- package/docs/security.md +72 -32
- package/docs/session-format.md +15 -215
- package/docs/sessions.md +35 -141
- package/docs/settings.md +116 -377
- package/docs/shell-aliases.md +85 -5
- package/docs/skills.md +51 -190
- package/docs/slash-commands.md +60 -0
- package/docs/terminal-setup.md +105 -78
- package/docs/termux.md +74 -83
- package/docs/themes.md +88 -274
- package/docs/tmux.md +31 -39
- package/docs/tui.md +74 -910
- package/docs/usage.md +54 -272
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +45 -17
- package/examples/README.md +13 -2
- package/examples/extensions/README.md +2 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +26 -6
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/examples/sdk/README.md +3 -2
- package/npm-shrinkwrap.json +89 -39
- package/package.json +14 -12
- package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
- package/dist/bundle/chunks/chunk-4DKZACXI.js +0 -1568
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
- package/dist/bundle/chunks/chunk-GV2E3GBU.js +0 -2
- package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
- package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
- package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
- package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
- package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +0 -2
- package/dist/bundle/chunks/virtual-modules-BNWPZYDH.js +0 -2
- package/docs/development.md +0 -90
package/docs/usage.md
CHANGED
|
@@ -1,312 +1,94 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
This page collects day-to-day usage details that do not fit on the quickstart page.
|
|
4
|
-
|
|
5
|
-
## Interactive Mode
|
|
6
|
-
|
|
7
|
-
<p align="center"><img src="images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
8
|
-
|
|
9
|
-
The interface has four main areas:
|
|
10
|
-
|
|
11
|
-
- **Startup header** - shortcuts, loaded context files, prompt templates, skills, and extensions
|
|
12
|
-
- **Messages** - user messages, assistant responses, tool calls, tool results, notifications, errors, and extension UI
|
|
13
|
-
- **Editor** - where you type; border color indicates the current thinking level
|
|
14
|
-
- **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model. Totals include assistant responses, usage reported by tools, and summary generation.
|
|
15
|
-
|
|
16
|
-
The editor can be replaced temporarily by built-in UI such as `/settings` or by custom extension UI.
|
|
17
|
-
|
|
18
|
-
### Editor Features
|
|
19
|
-
|
|
20
|
-
| Feature | How |
|
|
21
|
-
|---------|-----|
|
|
22
|
-
| File reference | Type `@` to fuzzy-search project files |
|
|
23
|
-
| Path completion | Press Tab to complete paths |
|
|
24
|
-
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
|
-
| Copy response | Ctrl+X copies the selected message in `/tree`; otherwise it copies the last assistant message, or the active fullscreen text selection when `fullscreenCopyOnSelect` is disabled |
|
|
26
|
-
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
27
|
-
| Shell command | `!command` runs and sends output to the model |
|
|
28
|
-
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
29
|
-
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
30
|
-
|
|
31
|
-
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
32
|
-
|
|
33
|
-
## Slash Commands
|
|
34
|
-
|
|
35
|
-
Type `/` in the editor to open command completion. Extensions can register custom commands, skills are available as `/skill:name`, and prompt templates expand via `/templatename`.
|
|
36
|
-
|
|
37
|
-
| Command | Description |
|
|
38
|
-
|---------|-------------|
|
|
39
|
-
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
40
|
-
| [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
41
|
-
| `/model` | Switch models; Ctrl+S in the picker saves the startup default |
|
|
42
|
-
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
43
|
-
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
44
|
-
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
45
|
-
| `/resume` | Pick from previous sessions |
|
|
46
|
-
| `/new` | Start a new session |
|
|
47
|
-
| `/name <name>` | Set session display name |
|
|
48
|
-
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
49
|
-
| `/tree` | Jump to any point in the session and continue from there |
|
|
50
|
-
| `/trust` | Save project trust decision for future sessions |
|
|
51
|
-
| `/fork` | Create a new session from a previous user message |
|
|
52
|
-
| `/clone` | Duplicate the current active branch into a new session |
|
|
53
|
-
| `/compact [prompt]` | Manually compact context, optionally with custom instructions |
|
|
54
|
-
| `/copy` | Copy last assistant message to clipboard |
|
|
55
|
-
| `/export [file]` | Export session to HTML or JSONL |
|
|
56
|
-
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
57
|
-
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
58
|
-
| `/bug [description]` | Report a bug to the Pi developers; see [Sessions](sessions.md#reporting-bugs) |
|
|
59
|
-
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
60
|
-
| `/hotkeys` | Show all keyboard shortcuts |
|
|
61
|
-
| `/changelog` | Display version history |
|
|
62
|
-
| `/quit` | Quit pi |
|
|
63
|
-
|
|
64
|
-
## Message Queue
|
|
65
|
-
|
|
66
|
-
You can submit messages while the agent is still working:
|
|
67
|
-
|
|
68
|
-
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
69
|
-
- **Alt+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
70
|
-
- **Escape** aborts and restores queued messages to the editor.
|
|
71
|
-
- **Alt+Up** retrieves queued messages back to the editor.
|
|
72
|
-
|
|
73
|
-
On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want pi to receive the shortcut.
|
|
74
|
-
|
|
75
|
-
Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
|
|
76
|
-
|
|
77
|
-
## Sessions
|
|
78
|
-
|
|
79
|
-
Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by working directory.
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pi -c # Continue most recent session
|
|
83
|
-
pi -r # Browse and select a session
|
|
84
|
-
pi --no-session # Ephemeral mode; do not save
|
|
85
|
-
pi --name "my task" # Set session display name at startup
|
|
86
|
-
pi --session <path|id> # Use a specific session file or session ID
|
|
87
|
-
pi --fork <path|id> # Fork a session into a new session file
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Useful session commands:
|
|
91
|
-
|
|
92
|
-
- `/session` shows the current session file and ID.
|
|
93
|
-
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
94
|
-
- `/fork` creates a new session from an earlier user message.
|
|
95
|
-
- `/clone` duplicates the current active branch into a new session file.
|
|
96
|
-
- `/compact` summarizes older messages to free context.
|
|
97
|
-
|
|
98
|
-
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
99
|
-
|
|
100
|
-
## Context Files
|
|
101
|
-
|
|
102
|
-
Pi loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
103
|
-
|
|
104
|
-
- `~/.pi/agent/AGENTS.md` for global instructions
|
|
105
|
-
- parent directories, walking up from the current working directory
|
|
106
|
-
- the current directory
|
|
107
|
-
|
|
108
|
-
If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory. Context files from other directories still layer normally.
|
|
109
|
-
|
|
110
|
-
Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
|
|
111
|
-
|
|
112
|
-
### System Prompt Files
|
|
113
|
-
|
|
114
|
-
Replace the default system prompt with:
|
|
115
|
-
|
|
116
|
-
- `.pi/SYSTEM.md` for a project
|
|
117
|
-
- `~/.pi/agent/SYSTEM.md` globally
|
|
1
|
+
# Use Pi in the terminal
|
|
118
2
|
|
|
119
|
-
|
|
3
|
+
Run `pi` from the folder you want to work in. Pi uses that folder to discover files, instructions, and configuration, and to group saved sessions. If you have not installed Pi or chosen a model yet, follow the [Quickstart](quickstart.md).
|
|
120
4
|
|
|
121
|
-
|
|
5
|
+
Pi may ask whether you trust the working folder before loading its project resources. See [Project trust](security.md#understand-project-trust).
|
|
122
6
|
|
|
123
|
-
|
|
7
|
+
<p align="center"><img src="images/interactive-mode.png" alt="Pi interactive mode showing a conversation, editor, and status information" width="750"></p>
|
|
124
8
|
|
|
125
|
-
|
|
9
|
+
The transcript shows your prompts, Pi's responses, tool calls, results, and errors. You write prompts and commands in the editor. The footer shows the current folder, session, model, context usage, and accumulated usage and cost.
|
|
126
10
|
|
|
127
|
-
|
|
11
|
+
## Enter a prompt
|
|
128
12
|
|
|
129
|
-
|
|
13
|
+
Type a request and press `Enter` to send it. Use `Shift+Enter` to add a line, or press `Ctrl+G` to work on a longer prompt in your configured external editor.
|
|
130
14
|
|
|
131
|
-
|
|
15
|
+
To include files or images:
|
|
132
16
|
|
|
133
|
-
|
|
17
|
+
- Type `@` to search for a file and add it to your prompt.
|
|
18
|
+
- Press `Tab` to complete a path.
|
|
19
|
+
- Paste an image or drag it into a compatible terminal.
|
|
134
20
|
|
|
21
|
+
## Follow Pi's work
|
|
135
22
|
|
|
136
|
-
|
|
23
|
+
Pi shows each tool call and result while it works. Press `Ctrl+O` to expand or collapse tool output. Press `Ctrl+T` to show or hide thinking blocks.
|
|
137
24
|
|
|
138
|
-
|
|
25
|
+
The startup header lists the instructions and resources Pi loaded. The editor border indicates the current thinking level. The footer updates as the model uses context and reports usage.
|
|
139
26
|
|
|
140
|
-
|
|
27
|
+
Pi does not ask before every tool call. Review commands and changed files, and use a sandbox for untrusted or unattended work. See [Security](security.md).
|
|
141
28
|
|
|
142
|
-
|
|
29
|
+
## Change direction
|
|
143
30
|
|
|
144
|
-
|
|
31
|
+
You can send more input while Pi is working:
|
|
145
32
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
pi install <source> [-l] # Install package, -l for project-local
|
|
154
|
-
pi remove <source> [-l] # Remove package
|
|
155
|
-
pi uninstall <source> [-l] # Alias for remove
|
|
156
|
-
pi update [source|self|pi] # Update pi only, or one package source
|
|
157
|
-
pi update --all # Update pi and packages; reconcile pinned git refs
|
|
158
|
-
pi update --extensions # Update packages only; reconcile pinned git refs
|
|
159
|
-
pi update --models # Refresh model catalogs only
|
|
160
|
-
pi update --self # Update pi only
|
|
161
|
-
pi update --extension <src> # Update one package
|
|
162
|
-
pi list # List installed packages
|
|
163
|
-
pi config # Enable/disable package resources
|
|
164
|
-
```
|
|
33
|
+
| What you want | Action |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Adjust the current task | Type a message and press `Enter` |
|
|
36
|
+
| Add work after the current task | Type a message and press `Alt+Enter` |
|
|
37
|
+
| Return queued messages to the editor | Press `Alt+Up` |
|
|
38
|
+
| Stop the current task | Press `Escape` |
|
|
165
39
|
|
|
166
|
-
|
|
40
|
+
A message sent with `Enter` waits until the current response and its tool calls finish, then guides the next response. A follow-up sent with `Alt+Enter` waits until Pi finishes the current task. Aborting returns queued messages to the editor.
|
|
167
41
|
|
|
168
|
-
See [
|
|
42
|
+
Windows Terminal reserves some Alt shortcuts. See [Terminal Setup](terminal-setup.md) for the Windows alternatives.
|
|
169
43
|
|
|
170
|
-
|
|
44
|
+
## Change the model or settings
|
|
171
45
|
|
|
172
|
-
|
|
173
|
-
|------|-------------|
|
|
174
|
-
| default | Interactive mode |
|
|
175
|
-
| `-p`, `--print` | Print response and exit |
|
|
176
|
-
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
177
|
-
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
178
|
-
| `--export <in> [out]` | Export a session to HTML |
|
|
46
|
+
Type `/` to search the available commands. The commands you will use most often are:
|
|
179
47
|
|
|
180
|
-
|
|
48
|
+
- `/model` selects a model. Press `Ctrl+L` to open the same selector.
|
|
49
|
+
- `/thinking` selects how much reasoning the current model uses. Press `Shift+Tab` to cycle through supported levels.
|
|
50
|
+
- `/login` and `/logout` manage provider access.
|
|
51
|
+
- `/settings` changes common preferences.
|
|
181
52
|
|
|
182
|
-
|
|
183
|
-
cat README.md | pi -p "Summarize this text"
|
|
184
|
-
```
|
|
53
|
+
Prompt templates, skills, and extensions can add more commands to the same menu. See [Choose a Model](models.md), [Configuration](configuration.md), or the complete [Slash Commands reference](slash-commands.md).
|
|
185
54
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
| Option | Description |
|
|
189
|
-
|--------|-------------|
|
|
190
|
-
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
191
|
-
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
192
|
-
| `--api-key <key>` | API key, overriding environment variables |
|
|
193
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
194
|
-
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
195
|
-
| `--list-models [search]` | List available models |
|
|
196
|
-
|
|
197
|
-
### Session Options
|
|
198
|
-
|
|
199
|
-
| Option | Description |
|
|
200
|
-
|--------|-------------|
|
|
201
|
-
| `-c`, `--continue` | Continue the most recent session |
|
|
202
|
-
| `-r`, `--resume` | Browse and select a session |
|
|
203
|
-
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
204
|
-
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
205
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
206
|
-
| `--no-session` | Ephemeral mode; do not save |
|
|
207
|
-
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
208
|
-
|
|
209
|
-
### Tool Options
|
|
210
|
-
|
|
211
|
-
| Option | Description |
|
|
212
|
-
|--------|-------------|
|
|
213
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
214
|
-
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
215
|
-
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
216
|
-
| `--no-tools`, `-nt` | Disable all tools |
|
|
217
|
-
|
|
218
|
-
Built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`.
|
|
219
|
-
|
|
220
|
-
### Resource Options
|
|
221
|
-
|
|
222
|
-
| Option | Description |
|
|
223
|
-
|--------|-------------|
|
|
224
|
-
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
225
|
-
| `--no-extensions` | Disable extension discovery |
|
|
226
|
-
| `--skill <path>` | Load a skill; repeatable |
|
|
227
|
-
| `--no-skills` | Disable skill discovery |
|
|
228
|
-
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
229
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
230
|
-
| `--theme <path>` | Load a theme; repeatable |
|
|
231
|
-
| `--no-themes` | Disable theme discovery |
|
|
232
|
-
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
233
|
-
|
|
234
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
pi --no-extensions -e ./my-extension.ts
|
|
238
|
-
```
|
|
55
|
+
## Continue or start over
|
|
239
56
|
|
|
240
|
-
|
|
57
|
+
Pi saves sessions automatically unless session persistence is disabled.
|
|
241
58
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
| `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
|
|
247
|
-
| `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
|
|
248
|
-
| `--verbose` | Force verbose startup |
|
|
249
|
-
| `-a`, `--approve` | Trust project-local files for this run |
|
|
250
|
-
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
251
|
-
| `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
|
|
252
|
-
| `-h`, `--help` | Show help |
|
|
253
|
-
| `-v`, `--version` | Show version |
|
|
59
|
+
- `/new` starts a new session.
|
|
60
|
+
- `/resume` opens another saved session.
|
|
61
|
+
- `/name` gives the current session a recognizable name.
|
|
62
|
+
- `/session` shows its file, ID, message count, token usage, and cost.
|
|
254
63
|
|
|
255
|
-
|
|
64
|
+
Use `/tree`, `/fork`, or `/clone` when you want to explore another approach without losing existing work. Use `/compact` to reduce the conversation history sent to the model. See [Sessions and Context](sessions.md) for these workflows.
|
|
256
65
|
|
|
257
|
-
|
|
66
|
+
After leaving Pi, run `pi --continue` from the same folder to resume its most recent session.
|
|
258
67
|
|
|
259
|
-
|
|
68
|
+
## Run a terminal command
|
|
260
69
|
|
|
261
|
-
Prefix
|
|
70
|
+
Prefix a command with `!` to run it and include its output in the conversation:
|
|
262
71
|
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
pi -p @screenshot.png "What's in this image?"
|
|
266
|
-
pi @code.ts @test.ts "Review these files"
|
|
72
|
+
```text
|
|
73
|
+
!git status
|
|
267
74
|
```
|
|
268
75
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
# Interactive with initial prompt
|
|
273
|
-
pi "List all .ts files in src/"
|
|
76
|
+
Use `!!` when you want to run a command without sending its output to the model.
|
|
274
77
|
|
|
275
|
-
|
|
276
|
-
pi -p "Summarize this codebase"
|
|
78
|
+
## Copy, export, or share results
|
|
277
79
|
|
|
278
|
-
|
|
279
|
-
pi -p -- "- Summarize these points"
|
|
80
|
+
Press `Ctrl+X` or run `/copy` to copy the last assistant response. Use `/export` to save the session as HTML or JSONL.
|
|
280
81
|
|
|
281
|
-
|
|
282
|
-
cat README.md | pi -p "Summarize this text"
|
|
82
|
+
Use `/share` to upload the session and get a viewer link. With Radius authentication, the artifact is visible to your Radius organization. Otherwise, Pi creates a private GitHub gist through the GitHub CLI. Review the session first because it can contain prompts, tool output, file contents, and credentials exposed during the conversation.
|
|
283
83
|
|
|
284
|
-
|
|
285
|
-
pi --name "release audit" -p "Audit this repository"
|
|
84
|
+
## Adjust the terminal
|
|
286
85
|
|
|
287
|
-
|
|
288
|
-
pi --provider openai --model gpt-4o "Help me refactor"
|
|
289
|
-
|
|
290
|
-
# Model with provider prefix
|
|
291
|
-
pi --model openai/gpt-4o "Help me refactor"
|
|
292
|
-
|
|
293
|
-
# Model with thinking level shorthand
|
|
294
|
-
pi --model sonnet:high "Solve this complex problem"
|
|
295
|
-
|
|
296
|
-
# Limit model cycling
|
|
297
|
-
pi --models "claude-*,gpt-4o"
|
|
298
|
-
|
|
299
|
-
# Read-only mode
|
|
300
|
-
pi --tools read,grep,find,ls -p "Review the code"
|
|
301
|
-
|
|
302
|
-
# Disable one extension or built-in tool while keeping the rest available
|
|
303
|
-
pi --exclude-tools ask_question
|
|
304
|
-
```
|
|
86
|
+
Regular mode uses the terminal's normal scrollback. Fullscreen mode keeps the editor and status area fixed while the transcript scrolls within the terminal window. Choose a mode through `/settings` or `--tui-mode`.
|
|
305
87
|
|
|
306
|
-
|
|
88
|
+
Terminal support for mouse input, keyboard shortcuts, and inline images varies. See [Terminal Setup](terminal-setup.md) for platform-specific configuration and [Keybindings](keybindings.md) for every configurable shortcut. Run `/hotkeys` to inspect the shortcuts active in your current session.
|
|
307
89
|
|
|
308
|
-
|
|
90
|
+
## Collect diagnostic information
|
|
309
91
|
|
|
310
|
-
|
|
92
|
+
When troubleshooting terminal rendering or conversation state, run `/debug`. Pi writes the rendered terminal lines and current session messages to `pi-debug.log` in your [agent directory](configuration.md#agent-directory).
|
|
311
93
|
|
|
312
|
-
|
|
94
|
+
Review this file before sharing it. It can contain prompts, model responses, tool output, file contents, and terminal data.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Virtual Models
|
|
2
|
+
|
|
3
|
+
A virtual model is a selectable model that picks a physical model for each request. Use one to route by task, cost, or conversation state. For example, a router can send quick questions to a small model and hard problems to a large one, while the user selects a single model.
|
|
4
|
+
|
|
5
|
+
Register virtual models from an [extension](extensions.md). They appear in `/model`, `--model`, scoped models, and settings like any other model. A virtual model can be listed under any provider, including one with physical models, such as `openai-codex/auto`.
|
|
6
|
+
|
|
7
|
+
## Selection and dispatch
|
|
8
|
+
|
|
9
|
+
A virtual model selects a model and a thinking level. A router maps that pair to a physical pair for each request:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
selected (virtual model, virtual level) -> dispatched (physical model, physical level)
|
|
13
|
+
jev/auto:low -> anthropic/claude-sonnet-4-5:high
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The virtual thinking level is an input to the router. Its meaning is up to the router; it need not correspond to a reasoning budget.
|
|
17
|
+
|
|
18
|
+
Pi keeps the two pairs apart:
|
|
19
|
+
|
|
20
|
+
| | Selection | Dispatch |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| Recorded in | `model_change` and `thinking_level_change` entries | Each assistant message: `provider`, `api`, `model`, `thinkingLevel` |
|
|
23
|
+
| Visible as | `ctx.model`, `ctx.thinkingLevel`, `PI_MODEL`, `PI_REASONING_LEVEL`, `/model` | The assistant message of each response |
|
|
24
|
+
|
|
25
|
+
Providers only receive physical models. Assistant messages name the physical model, so replaying a conversation across different physical models works the same as after a manual model switch. Resuming a session restores the virtual selection from its latest `model_change` entry. If the virtual model is no longer registered, Pi falls back to the physical model that answered last.
|
|
26
|
+
|
|
27
|
+
In interactive mode, the footer shows the routed model next to the selection, for example `auto • high → gpt-5.6-luna • medium`. `/session` lists the cost for each physical model.
|
|
28
|
+
|
|
29
|
+
Context usage uses the limits of the physical model that produced the latest response, even if that response came before switching to the virtual model. Without such a response, it uses the limits declared on the virtual model, if any. Compaction checks the same limits, and again the limits of the model each request is routed to. If that model's context window is too small for the conversation, Pi compacts before sending the request; the route stays as the router chose it.
|
|
30
|
+
|
|
31
|
+
## Register a virtual model
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
35
|
+
|
|
36
|
+
export default function (pi: ExtensionAPI) {
|
|
37
|
+
pi.registerVirtualModel({
|
|
38
|
+
provider: "router",
|
|
39
|
+
id: "auto",
|
|
40
|
+
name: "Auto",
|
|
41
|
+
thinkingLevels: ["low", "high"],
|
|
42
|
+
route(request, ctx) {
|
|
43
|
+
// Tool follow-ups and retries stay on the model that handled the turn.
|
|
44
|
+
const sticky = request.failed ?? request.previous;
|
|
45
|
+
if (request.reason !== "user" && sticky) {
|
|
46
|
+
return { model: sticky.model, thinkingLevel: sticky.thinkingLevel ?? "medium" };
|
|
47
|
+
}
|
|
48
|
+
const id = request.thinkingLevel === "high" ? "claude-sonnet-4-5" : "claude-haiku-4-5";
|
|
49
|
+
return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium" };
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- `provider` is the provider the model is listed under. It can be any provider ID. A provider can list several virtual models next to its physical ones. On a physical provider, the virtual model is available when that provider has credentials. Under an ID that no provider uses, it is always available.
|
|
56
|
+
- `id` must not be the ID of a physical model of that provider. If a catalog refresh later adds a physical model with the same ID, the virtual model hides it.
|
|
57
|
+
- `thinkingLevels` lists the levels offered for selection. It defaults to `["off"]`.
|
|
58
|
+
- `contextWindow` and `maxTokens` are shown before the first response. Unset limits are unknown.
|
|
59
|
+
- `input` lists the input types offered for selection. It defaults to text and images; physical models without image support receive placeholders.
|
|
60
|
+
|
|
61
|
+
Registration follows the same queuing and reload rules as `pi.registerProvider()`. Registering the same provider and ID again replaces the virtual model. `pi.unregisterVirtualModel(provider, id)` removes it; `pi.unregisterProvider()` does not. SDK code can register one without an extension: `modelRuntime.registerVirtualModel(definition)`.
|
|
62
|
+
|
|
63
|
+
## Route requests
|
|
64
|
+
|
|
65
|
+
`route(request, ctx)` runs before every request made with the virtual model and returns `{ model, thinkingLevel }`. The model can be any physical model in the catalog whose provider has credentials; look it up with `ctx.modelRegistry`. A virtual model cannot route to another virtual model. Pi clamps the thinking level to the returned model.
|
|
66
|
+
|
|
67
|
+
| Field | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `model`, `thinkingLevel` | The selected virtual model and level |
|
|
70
|
+
| `reason` | Why the request is made, see below |
|
|
71
|
+
| `previous` | Physical model and thinking level of the latest successful response in `messages` |
|
|
72
|
+
| `failed` | For `retry`: physical model, thinking level, and assistant `message` of the failed request, which `messages` no longer contains. The message carries `stopReason` and `errorMessage`. Absent when routing itself failed |
|
|
73
|
+
| `state` | Router state last returned on this session branch, see below |
|
|
74
|
+
| `messages` | The conversation for this request, including system messages |
|
|
75
|
+
| `signal` | Abort signal of the request |
|
|
76
|
+
|
|
77
|
+
| `reason` | Request |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `user` | First request after a message the user wrote, including steering and follow-up messages |
|
|
80
|
+
| `continuation` | Any other request in the agent loop, such as after tool results or extension messages |
|
|
81
|
+
| `retry` | Automatic retry after a failed request, including after compaction for a context overflow |
|
|
82
|
+
| `direct` | Request made outside the agent loop, such as a compaction summary or an extension calling `ctx.modelRegistry.streamSimple()` |
|
|
83
|
+
|
|
84
|
+
Returning `previous` for `continuation` and `failed` for `retry` keeps prompt caches and thinking signatures valid. Switching models between turns is allowed but loses the prompt cache. A retry can also switch to another model, for example when `failed.message.errorMessage` reports that a provider is overloaded or the context overflowed.
|
|
85
|
+
|
|
86
|
+
If `route()` throws, or returns a virtual model or a model without credentials, the request ends with an error response.
|
|
87
|
+
|
|
88
|
+
## Keep routing state
|
|
89
|
+
|
|
90
|
+
`route()` can return `state` next to the model. Pi stores it on the session branch and passes it back as `request.state` on later requests. Use it for decisions the transcript does not record, such as classifier results or a routing phase:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
pi.registerVirtualModel<{ phase: "plan" | "build" }>({
|
|
94
|
+
provider: "router",
|
|
95
|
+
id: "phased",
|
|
96
|
+
name: "Phased",
|
|
97
|
+
route(request, ctx) {
|
|
98
|
+
const state = request.state ?? { phase: "plan" };
|
|
99
|
+
const id = state.phase === "plan" ? "claude-opus-4-5" : "claude-haiku-4-5";
|
|
100
|
+
return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium", state };
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- State must be JSON-serializable. Returning `undefined` or `request.state` itself keeps the current state.
|
|
106
|
+
- Pi stores any other returned object as new state, before the request is sent, even when it equals the current state. Return a new object only when the state changes. The state stays stored if the request later fails.
|
|
107
|
+
- State follows the session tree, so forks and `/tree` navigation see the state of their branch. It survives compaction.
|
|
108
|
+
- `direct` requests have no state, and Pi ignores state they return.
|
|
109
|
+
|
|
110
|
+
The transcript already records the selection and every dispatched model, and `ctx.sessionManager.getBranch()` exposes both.
|
|
111
|
+
|
|
112
|
+
Routers can call other models through `ctx.modelRegistry`, for example `ctx.modelRegistry.classify()` with a classifier model from `ctx.modelRegistry.findOfType("classifier", provider, id)`. The call adds latency before the first token of the turn.
|
|
113
|
+
|
|
114
|
+
See [`jev-router.ts`](../examples/extensions/jev-router.ts) for a complete router. It plans on a strong OpenAI Codex model chosen by the Jev classifier, lets that model make the first edit, and then switches once to a cheaper model, accepting a single prompt-cache miss. It keeps the phase as router state.
|
package/docs/windows.md
CHANGED
|
@@ -1,39 +1,67 @@
|
|
|
1
|
-
# Windows
|
|
1
|
+
# Run Pi on Windows
|
|
2
2
|
|
|
3
|
-
Pi uses Git Bash by default
|
|
3
|
+
Run Pi either as a native Windows process or inside Windows Subsystem for Linux (WSL). Native Windows uses Git Bash by default for Bash commands and can optionally expose PowerShell to the model. Pi inside WSL uses the Linux environment and its Bash installation.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
|
|
7
|
-
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
|
|
5
|
+
Follow the main [Quickstart](quickstart.md) to install and authenticate Pi. Use this page to choose and configure its command environment.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Choose native Windows or WSL
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
| Environment | Command environment | Use it when |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Native Windows with Git Bash | Git Bash for the built-in `bash` tool and `!` commands | Your files and development tools primarily live on Windows |
|
|
12
|
+
| Native Windows with the `powershell` tool | PowerShell for model tool calls; Bash remains available for `!` commands | The task depends on PowerShell modules or Windows-native commands |
|
|
13
|
+
| WSL | Linux Bash and tools inside the selected WSL distribution | Your files and toolchain already live in Linux or WSL |
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## Use Git Bash on native Windows
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
For most native Windows users, installing [Git for Windows](https://git-scm.com/download/win) is sufficient.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Pi resolves Bash in this order:
|
|
20
|
+
|
|
21
|
+
1. `shellPath` from `~/.pi/agent/settings.json`
|
|
22
|
+
2. Git Bash under `Program Files` or `Program Files (x86)`
|
|
23
|
+
3. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
|
|
24
|
+
|
|
25
|
+
Start Pi and enter this command to verify the shell:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
!printf 'Bash is working\n'
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
If Pi cannot find Bash, it reports the locations it checked. Install Git for Windows, put another Bash executable on `PATH`, or configure `shellPath`.
|
|
32
|
+
|
|
33
|
+
## Let the model use PowerShell
|
|
34
|
+
|
|
35
|
+
The optional `powershell` tool runs commands through `pwsh.exe` when available, then falls back to Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
|
|
36
|
+
|
|
37
|
+
To replace the model-facing `bash` tool with `powershell`, add this to `~/.pi/agent/settings.json`:
|
|
24
38
|
|
|
25
39
|
```json
|
|
26
40
|
{
|
|
27
|
-
"defaultTools": ["read", "
|
|
41
|
+
"defaultTools": ["read", "powershell", "edit", "write"]
|
|
28
42
|
}
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
`["-bash", "+powershell"]` does the same while keeping any other default tools you configured.
|
|
46
|
+
|
|
47
|
+
Restart Pi, then ask it to run a harmless PowerShell command. The `!` and `!!` editor commands continue to use Bash. The `powershell` tool is available only when Pi runs as a native Windows process.
|
|
48
|
+
|
|
49
|
+
See [Settings](settings.md#tools) for other tool combinations.
|
|
50
|
+
|
|
51
|
+
## Use a custom Bash executable
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
Set `shellPath` when Bash is installed somewhere Pi does not discover automatically:
|
|
34
54
|
|
|
35
55
|
```json
|
|
36
56
|
{
|
|
37
57
|
"shellPath": "C:\\cygwin64\\bin\\bash.exe"
|
|
38
58
|
}
|
|
39
59
|
```
|
|
60
|
+
|
|
61
|
+
JSON uses backslashes for escape sequences. When you write a Windows path with backslashes, write each backslash twice, as shown above.
|
|
62
|
+
|
|
63
|
+
See [Configure shell commands](shell-aliases.md) for command prefixes, aliases, and the complete shell-resolution behavior.
|
|
64
|
+
|
|
65
|
+
## Configure Windows Terminal
|
|
66
|
+
|
|
67
|
+
Windows Terminal reserves or rewrites some modified keys. See [Windows Terminal](terminal-setup.md#windows-terminal) to configure `Shift+Enter` and `Alt+Enter`, and [Keybindings](keybindings.md) for Pi's Windows and WSL shortcut defaults.
|
package/examples/README.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Examples
|
|
2
2
|
|
|
3
|
-
Example code for pi-coding-agent SDK and extensions.
|
|
3
|
+
Example code for the pi-coding-agent SDK, process integration, and extensions.
|
|
4
|
+
|
|
5
|
+
## CLI integration
|
|
6
|
+
|
|
7
|
+
[`rpc-client.ts`](rpc-client.ts) uses the typed `RpcClient` to run Pi in a child process, stream events, and wait for the run to settle.
|
|
8
|
+
|
|
9
|
+
Build the coding-agent package before running it from a repository checkout:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
node examples/rpc-client.ts "Explain this repository"
|
|
13
|
+
```
|
|
4
14
|
|
|
5
15
|
## Directories
|
|
6
16
|
|
|
@@ -23,6 +33,7 @@ An experimental plugin package that Pi automatically builds into separate Sessio
|
|
|
23
33
|
|
|
24
34
|
## Documentation
|
|
25
35
|
|
|
26
|
-
- [SDK
|
|
36
|
+
- [SDK Examples](sdk/README.md)
|
|
37
|
+
- [CLI Integration](../docs/cli-integration.md)
|
|
27
38
|
- [Extensions Documentation](../docs/extensions.md)
|
|
28
39
|
- [Skills Documentation](../docs/skills.md)
|
|
@@ -113,6 +113,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
113
113
|
|-----------|-------------|
|
|
114
114
|
| `message-renderer.ts` | Custom message rendering with colors and expandable details via `registerMessageRenderer` |
|
|
115
115
|
| `entry-renderer.ts` | TUI-only session entry rendering via `appendEntry` and `registerEntryRenderer` |
|
|
116
|
+
| `debug-provider.ts` | Toggle raw provider stream capture with `/debug-provider` and inspect each assistant message in a TUI-only session entry |
|
|
116
117
|
| `event-bus.ts` | Inter-extension communication via `pi.events` |
|
|
117
118
|
|
|
118
119
|
### Session Metadata
|
|
@@ -128,6 +129,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
128
129
|
|-----------|-------------|
|
|
129
130
|
| `custom-provider-anthropic/` | Custom Anthropic provider with OAuth support and custom streaming implementation |
|
|
130
131
|
| `custom-provider-gitlab-duo/` | GitLab Duo provider using pi-ai's built-in Anthropic/OpenAI streaming via proxy |
|
|
132
|
+
| `jev-router.ts` | Virtual model via `registerVirtualModel` that plans on Codex Sol or Terra (picked by the Jev classifier) and switches to Luna after the first edit |
|
|
131
133
|
|
|
132
134
|
### External Dependencies
|
|
133
135
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.99.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.99.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|