@punch-bot/cli 1.5.0 → 1.5.3
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 +168 -1
- package/README.md +6 -8
- package/dist/bundle/chunks/anthropic-messages-WIBS5YKY.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-GP5GDEGO.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +7 -4
- package/dist/bundle/chunks/chunk-35EHANXE.js +2 -0
- package/dist/bundle/chunks/chunk-3IMHRFLG.js +6 -0
- package/dist/bundle/chunks/chunk-77CRE5SV.js +9 -0
- package/dist/bundle/chunks/chunk-CE33JMCE.js +861 -0
- package/dist/bundle/chunks/{chunk-MYNHUMKE.js → chunk-CXY7BILM.js} +2 -44
- package/dist/bundle/chunks/chunk-EISXNXOQ.js +41 -0
- package/dist/bundle/chunks/chunk-ENMVUQHE.js +26 -0
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/bundle/chunks/chunk-HQH636GU.js +361 -0
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/bundle/chunks/chunk-JAJLG57O.js +4 -0
- package/dist/bundle/chunks/{chunk-RFVYQ7ZX.js → chunk-LOHGXPCL.js} +2 -2
- package/dist/bundle/chunks/{chunk-NO2FNWW3.js → chunk-OV2VGRRS.js} +1 -1
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/bundle/chunks/chunk-PDENR63J.js +16 -0
- package/dist/bundle/chunks/chunk-RHOWRSGK.js +2 -0
- package/dist/bundle/chunks/{chunk-BRECMFDT.js → chunk-UZ3LUZDC.js} +1 -1
- package/dist/bundle/chunks/chunk-WN2D4UD4.js +2 -0
- package/dist/bundle/chunks/chunk-X4T5TGM4.js +82 -0
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/cli-OQNR6ESL.js +53 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-FDCKYGTP.js → cloudflare-workers-ai-system-one-36EDUVVN.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{execute-HXULRBCI.js → execute-EHT55MW7.js} +5 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-2ESDEFYR.js → google-generative-ai-KA6FZCHM.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-YERBWL2T.js → google-vertex-DXKQ4IYR.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/kimi-coding.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-M4KMJHPS.js → llama-cpp-classify-676UCBOD.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-PJ56UMXO.js +5 -0
- package/dist/bundle/chunks/openai-codex-responses-DWVG7MAQ.js +10 -0
- package/dist/bundle/chunks/openai-completions-OKI6KBNP.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-PPJMQ3W4.js → openai-decisions-SO57QA6O.js} +1 -1
- package/dist/bundle/chunks/openai-responses-3HV234HB.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-WWPCCAPX.js → openrouter-images-5X6D7HFS.js} +1 -1
- package/dist/bundle/chunks/pi-messages-BS5Z34RE.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-R5GXO4CV.js → runtime-74PFKASL.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-NLWRPIRL.js → typesafe-system-one-IPNULX2M.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-2Y422I6U.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 +0 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -12
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +26 -2
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/auth-login.d.ts +15 -0
- package/dist/cli/auth-login.d.ts.map +1 -0
- package/dist/cli/auth-login.js +232 -0
- package/dist/cli/auth-login.js.map +1 -0
- package/dist/cli/auth-logout.d.ts +14 -0
- package/dist/cli/auth-logout.d.ts.map +1 -0
- package/dist/cli/auth-logout.js +63 -0
- package/dist/cli/auth-logout.js.map +1 -0
- package/dist/cli/auth-terminal.d.ts +17 -0
- package/dist/cli/auth-terminal.d.ts.map +1 -0
- package/dist/cli/auth-terminal.js +63 -0
- package/dist/cli/auth-terminal.js.map +1 -0
- package/dist/cli/project-trust.js +1 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/config.d.ts +10 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -11
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +5 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +20 -5
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +31 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +158 -71
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -2
- 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 +3 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +4 -37
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +11 -89
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +4 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +16 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +9 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +104 -60
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.js +165 -45
- 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/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +10 -13
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +1 -4
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +0 -14
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -18
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +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/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +23 -41
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +51 -120
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1730 -2029
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +36 -29
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +11 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +24 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +210 -51
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +167 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -0
- package/dist/core/pi-ai-schemas.js +21 -0
- package/dist/core/pi-ai-schemas.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +1 -0
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +4 -0
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/preferred-providers.d.ts +17 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +24 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/project-trust.d.ts +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +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 +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +3 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-matching.d.ts +11 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +14 -0
- package/dist/core/provider-matching.js.map +1 -0
- package/dist/core/radius-mcp.d.ts +13 -0
- package/dist/core/radius-mcp.d.ts.map +1 -0
- package/dist/core/radius-mcp.js +29 -0
- package/dist/core/radius-mcp.js.map +1 -0
- package/dist/core/radius.d.ts +0 -3
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +0 -5
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +40 -25
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +8 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +3 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts +0 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +0 -3
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +32 -13
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -31
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -31
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -56
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -247
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -54
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +7 -101
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +0 -6
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -27
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +13 -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 +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.js +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/theme/theme.d.ts.map +1 -1
- package/dist/core/theme/theme.js +5 -1
- package/dist/core/theme/theme.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -14
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +182 -41
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +10 -11
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +82 -36
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +7 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +87 -75
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +10 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +141 -25
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +4 -14
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +23 -29
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- 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 +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/execute.js +4 -4
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +59 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +23 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +1 -1
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +2 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +83 -22
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +4 -7
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +5 -4
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +11 -49
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +56 -296
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +1 -1
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +4 -3
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +4 -3
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +7 -5
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +2 -23
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +6 -58
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/punch/index.d.ts.map +1 -1
- package/dist/extensions/punch/index.js +1 -1
- package/dist/extensions/punch/index.js.map +1 -1
- package/dist/extensions/punch/todos.js +1 -1
- package/dist/extensions/punch/todos.js.map +1 -1
- package/dist/extensions/subagent/index.d.ts.map +1 -1
- package/dist/extensions/subagent/index.js +278 -129
- package/dist/extensions/subagent/index.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +122 -42
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +106 -14
- package/dist/main.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +19 -10
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +53 -23
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +94 -12
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +5 -2
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/changelog.d.ts +2 -2
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +12 -9
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +4 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/fuzzy.d.ts.map +1 -1
- package/dist/utils/fuzzy.js +59 -44
- package/dist/utils/fuzzy.js.map +1 -1
- package/dist/utils/git.d.ts +11 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +44 -0
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +4 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +14 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/terminal-question.d.ts +8 -0
- package/dist/utils/terminal-question.d.ts.map +1 -0
- package/dist/utils/terminal-question.js +24 -0
- package/dist/utils/terminal-question.js.map +1 -0
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js +5 -0
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +30 -35
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/web-url.d.ts +12 -0
- package/dist/utils/web-url.d.ts.map +1 -0
- package/dist/utils/web-url.js +20 -0
- package/dist/utils/web-url.js.map +1 -0
- package/docs/cli-integration.md +3 -5
- package/docs/cli.md +45 -26
- package/docs/compaction.md +9 -9
- package/docs/configuration.md +1 -2
- package/docs/containerization.md +16 -14
- package/docs/custom-provider.md +5 -3
- package/docs/docs.json +9 -9
- package/docs/environment-variables.md +5 -12
- package/docs/extensions.md +683 -757
- package/docs/how-pi-works.md +5 -5
- package/docs/index.md +5 -5
- package/docs/llama-cpp.md +41 -39
- package/docs/mcp.md +12 -10
- package/docs/message-types.md +1 -1
- package/docs/models-configuration.md +6 -1
- package/docs/models.md +18 -19
- package/docs/nvidia-rtx-llama-cpp.md +1 -1
- package/docs/packages.md +21 -1
- package/docs/prompt-templates.md +11 -9
- package/docs/providers.md +8 -8
- package/docs/quickstart.md +28 -52
- package/docs/rpc-commands.md +2 -2
- package/docs/rpc-extension-ui.md +5 -7
- package/docs/rpc.md +4 -2
- package/docs/sdk.md +1 -1
- package/docs/security.md +9 -5
- package/docs/session-format.md +7 -9
- package/docs/sessions.md +26 -26
- package/docs/settings.md +36 -67
- package/docs/shell-aliases.md +7 -7
- package/docs/skills.md +4 -4
- package/docs/slash-commands.md +50 -58
- package/docs/termux.md +8 -9
- package/docs/themes.md +21 -41
- package/docs/usage.md +59 -177
- package/docs/virtual-models.md +4 -4
- package/docs/windows.md +8 -10
- package/examples/extensions/README.md +3 -2
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- 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/gondolin/package-lock.json +19 -29
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/rpc-demo.ts +2 -2
- package/examples/extensions/subagent/README.md +14 -11
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +208 -0
- package/npm-shrinkwrap.json +58 -53
- package/package.json +15 -17
- package/schemas/models.schema.json +65 -36
- package/schemas/settings.schema.json +17 -243
- package/dist/bundle/chunks/anthropic-messages-WCANLUXE.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-46GRAI5B.js +0 -2
- package/dist/bundle/chunks/chunk-37OLNCAX.js +0 -16
- package/dist/bundle/chunks/chunk-3V45WARH.js +0 -7
- package/dist/bundle/chunks/chunk-4LBJE4YM.js +0 -14
- package/dist/bundle/chunks/chunk-4NE64BTO.js +0 -82
- package/dist/bundle/chunks/chunk-5NXXRYVM.js +0 -2
- package/dist/bundle/chunks/chunk-7BOHO7TR.js +0 -1190
- package/dist/bundle/chunks/chunk-7XECPCHN.js +0 -2
- package/dist/bundle/chunks/chunk-NJK3U3WK.js +0 -8
- package/dist/bundle/chunks/chunk-PLK2QSUR.js +0 -2
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
- package/dist/bundle/chunks/chunk-UE7JCDFW.js +0 -2
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/bundle/chunks/chunk-WZONBDPY.js +0 -11
- package/dist/bundle/chunks/cli-W5KJM7YB.js +0 -51
- package/dist/bundle/chunks/mistral-conversations-D6VQXE7C.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-QSNSWBYG.js +0 -10
- package/dist/bundle/chunks/openai-completions-72VXSFHQ.js +0 -7
- package/dist/bundle/chunks/openai-responses-PMTL72CY.js +0 -4
- package/dist/bundle/chunks/pi-messages-WVCFUCBL.js +0 -8
- package/dist/bundle/chunks/virtual-modules-7Y5QW4VK.js +0 -2
- package/dist/core/bug-report-upload.d.ts +0 -12
- package/dist/core/bug-report-upload.d.ts.map +0 -1
- package/dist/core/bug-report-upload.js +0 -22
- package/dist/core/bug-report-upload.js.map +0 -1
- package/dist/core/bug-report.d.ts +0 -184
- package/dist/core/bug-report.d.ts.map +0 -1
- package/dist/core/bug-report.js +0 -292
- package/dist/core/bug-report.js.map +0 -1
- package/dist/core/crash-log.d.ts +0 -27
- package/dist/core/crash-log.d.ts.map +0 -1
- package/dist/core/crash-log.js +0 -140
- package/dist/core/crash-log.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -64
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js +0 -338
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/utils/zip.d.ts +0 -7
- package/dist/utils/zip.d.ts.map +0 -1
- package/dist/utils/zip.js +0 -60
- package/dist/utils/zip.js.map +0 -1
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/keybindings.md +0 -194
- package/docs/terminal-setup.md +0 -17
- package/docs/tmux.md +0 -55
- package/docs/tui.md +0 -125
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/sandbox/package.json +0 -19
package/docs/usage.md
CHANGED
|
@@ -1,26 +1,63 @@
|
|
|
1
1
|
# Using Pi
|
|
2
2
|
|
|
3
|
-
This page collects day-to-day usage details that do not fit on the quickstart page.
|
|
3
|
+
This page collects day-to-day usage details that do not fit on the quickstart page. Pi runs headless: it has no terminal UI, editor, or keyboard shortcuts. Every run uses one of these interfaces:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
| Interface | Start it with | Use it when |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Print mode | `pi -p "<prompt>"`, or `pi "<prompt>"` | You want the final answer as text and Pi should exit |
|
|
8
|
+
| JSON mode | `pi --mode json "<prompt>"` | A script consumes every event of one run; see [JSON Event Stream](json.md) |
|
|
9
|
+
| RPC mode | `pi --mode rpc` | A client drives a long-running Pi process; see [RPC Protocol](rpc.md) |
|
|
10
|
+
| SDK | `createAgentSession()` | An application runs Pi in process; see [SDK](sdk.md) |
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
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).
|
|
13
|
+
|
|
14
|
+
## Give Pi a task
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pi -p "List all .ts files in src/"
|
|
18
|
+
pi -p @prompt.md @screenshot.png "What does this screenshot show?"
|
|
19
|
+
git diff | pi -p "Review this change"
|
|
20
|
+
pi -p "Write the plan to plan.md" "Now implement the first step"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`@path` includes a text file or image in the first prompt. Piped stdin is prepended to the first prompt. Each further message argument is sent as another prompt after the previous run ends. Use `--` before a prompt that starts with `-`. See [Command Line](cli.md#invocation-and-output) for the exact rules.
|
|
24
|
+
|
|
25
|
+
## Run commands
|
|
26
|
+
|
|
27
|
+
A prompt that starts with `/` runs an extension command, a skill (`/skill:name`), or a prompt template. Pi has no built-in slash commands; text such as `/model` reaches the model unchanged. See [Slash Commands](slash-commands.md) for the commands that exist and the replacements for upstream pi's built-in commands.
|
|
28
|
+
|
|
29
|
+
RPC clients can run a shell command and add its output to the conversation with the [`bash`](rpc-commands.md#bash) command. Set `excludeFromContext` to keep the output out of model context.
|
|
30
|
+
|
|
31
|
+
## Change direction
|
|
32
|
+
|
|
33
|
+
RPC clients can send more input while Pi is working:
|
|
34
|
+
|
|
35
|
+
- [`steer`](rpc-commands.md#steer) queues a message that is delivered after the current assistant turn finishes its tool calls.
|
|
36
|
+
- [`follow_up`](rpc-commands.md#follow_up) queues a message that waits until Pi finishes the current task.
|
|
37
|
+
- [`abort`](rpc-commands.md#abort) stops the current run. Queued messages stay queued; send [`clear_queue`](rpc-commands.md#clear_queue) first to take them back.
|
|
38
|
+
|
|
39
|
+
`steeringMode` and `followUpMode` in [Settings](settings.md#interaction) control whether queued messages are delivered one at a time or together.
|
|
40
|
+
|
|
41
|
+
## Change the model or settings
|
|
8
42
|
|
|
9
|
-
|
|
43
|
+
```bash
|
|
44
|
+
pi --model sonnet:high -p "Solve this complex problem"
|
|
45
|
+
pi --provider openai --model gpt-4o -p "Help me refactor"
|
|
46
|
+
pi --models "claude-*,gpt-4o" --mode rpc
|
|
47
|
+
```
|
|
10
48
|
|
|
11
|
-
|
|
49
|
+
RPC clients change the model with [`set_model`](rpc-commands.md#set_model) and the thinking level with [`set_thinking_level`](rpc-commands.md#set_thinking_level). Log in to providers with `pi auth login <provider>`. Edit [`settings.json`](settings.md) for saved preferences. See [Choose a Model](models.md) and [Configuration](configuration.md).
|
|
12
50
|
|
|
13
51
|
## Sessions
|
|
14
52
|
|
|
15
53
|
Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by working directory.
|
|
16
54
|
|
|
17
55
|
```bash
|
|
18
|
-
pi -c
|
|
19
|
-
pi -
|
|
20
|
-
pi --
|
|
21
|
-
pi --
|
|
22
|
-
pi --
|
|
23
|
-
pi --fork <path|id> # Fork a session into a new session file
|
|
56
|
+
pi -c -p "What did we discuss?" # Continue the most recent session
|
|
57
|
+
pi --no-session -p "One-off task" # Ephemeral; do not save
|
|
58
|
+
pi --name "my task" -p "Start" # Set the session display name
|
|
59
|
+
pi --session <path|id> -p "Next" # Use a specific session file or session ID
|
|
60
|
+
pi --fork <path|id> -p "Branch" # Fork a session into a new session file
|
|
24
61
|
```
|
|
25
62
|
|
|
26
63
|
Useful RPC commands:
|
|
@@ -33,7 +70,11 @@ Useful RPC commands:
|
|
|
33
70
|
|
|
34
71
|
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
35
72
|
|
|
36
|
-
##
|
|
73
|
+
## Export a session
|
|
74
|
+
|
|
75
|
+
Use `pi --export <session> [output.html]` or the RPC [`export_html`](rpc-commands.md#export_html) command to write a session to HTML. Review exported sessions before sharing them: they can contain prompts, tool output, file contents, and credentials exposed during the conversation.
|
|
76
|
+
|
|
77
|
+
## Context files
|
|
37
78
|
|
|
38
79
|
Pi loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
39
80
|
|
|
@@ -45,7 +86,7 @@ If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md`
|
|
|
45
86
|
|
|
46
87
|
Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
|
|
47
88
|
|
|
48
|
-
### System
|
|
89
|
+
### System prompt files
|
|
49
90
|
|
|
50
91
|
Replace the opening of the default system prompt (Pi's persona and role) with:
|
|
51
92
|
|
|
@@ -54,33 +95,13 @@ Replace the opening of the default system prompt (Pi's persona and role) with:
|
|
|
54
95
|
|
|
55
96
|
The tool list and rules, including tool and extension guidelines, still follow the custom opening. Pi's documentation pointers are left out.
|
|
56
97
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Pi may ask whether you trust the working folder before loading its project resources. See [Project trust](security.md#understand-project-trust).
|
|
60
|
-
|
|
61
|
-
Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
|
|
62
|
-
|
|
63
|
-
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.
|
|
98
|
+
## Project trust
|
|
64
99
|
|
|
65
|
-
|
|
100
|
+
Trusting a project allows Pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions. See [Project trust](security.md#understand-project-trust).
|
|
66
101
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
To include files or images:
|
|
70
|
-
|
|
71
|
-
## Exporting and Sharing Sessions
|
|
72
|
-
|
|
73
|
-
Use `pi --export <session> [output.html]` or the RPC `export_html` command to write a session to HTML.
|
|
74
|
-
|
|
75
|
-
## Change direction
|
|
76
|
-
|
|
77
|
-
You can send more input while Pi is working:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
pi [options] [--] [@files...] [messages...]
|
|
81
|
-
```
|
|
102
|
+
Pi does not show a trust prompt. Without an applicable saved trust decision or extension, it uses `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
82
103
|
|
|
83
|
-
|
|
104
|
+
## Package commands
|
|
84
105
|
|
|
85
106
|
```bash
|
|
86
107
|
pi install <source> [-l] # Install package, -l for project-local
|
|
@@ -90,147 +111,8 @@ pi update [source|self|pi] # Update pi only, or one package source
|
|
|
90
111
|
pi update --all # Update pi and packages; reconcile pinned git refs
|
|
91
112
|
pi update --extensions # Update packages only; reconcile pinned git refs
|
|
92
113
|
pi update --models # Refresh model catalogs only
|
|
93
|
-
pi update --self # Update pi only
|
|
94
|
-
pi update --extension <src> # Update one package
|
|
95
114
|
pi list # List installed packages
|
|
96
115
|
pi config # Print resolved package resource paths as JSON
|
|
97
116
|
```
|
|
98
117
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Windows Terminal reserves some Alt shortcuts. See [Terminal Setup](terminal-setup.md) for the Windows alternatives.
|
|
102
|
-
|
|
103
|
-
## Change the model or settings
|
|
104
|
-
|
|
105
|
-
| Flag | Description |
|
|
106
|
-
|------|-------------|
|
|
107
|
-
| default | Print response and exit (same as `-p`) |
|
|
108
|
-
| `-p`, `--print` | Print response and exit |
|
|
109
|
-
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
110
|
-
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
111
|
-
| `--export <in> [out]` | Export a session to HTML |
|
|
112
|
-
|
|
113
|
-
- `/model` selects a model. Press `Ctrl+L` to open the same selector.
|
|
114
|
-
- `/thinking` selects how much reasoning the current model uses. Press `Shift+Tab` to cycle through supported levels.
|
|
115
|
-
- `/login` and `/logout` manage provider access.
|
|
116
|
-
- `/settings` changes common preferences.
|
|
117
|
-
|
|
118
|
-
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).
|
|
119
|
-
|
|
120
|
-
### Model Options
|
|
121
|
-
|
|
122
|
-
| Option | Description |
|
|
123
|
-
|--------|-------------|
|
|
124
|
-
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
125
|
-
| `--model <pattern>` | Model ID or partial match (warns), supports `provider/id` and optional `:<thinking>` |
|
|
126
|
-
| `--api-key <key>` | API key, overriding environment variables |
|
|
127
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
128
|
-
| `--models <patterns>` | Comma-separated model patterns or globs (e.g. `openrouter/*`) available to the session |
|
|
129
|
-
| `--list-models [search]` | List available models |
|
|
130
|
-
|
|
131
|
-
### Session Options
|
|
132
|
-
|
|
133
|
-
| Option | Description |
|
|
134
|
-
|--------|-------------|
|
|
135
|
-
| `-c`, `--continue` | Continue the most recent session |
|
|
136
|
-
| `-r`, `--resume` | Continue the most recent session (alias for `-c`) |
|
|
137
|
-
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
138
|
-
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
139
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
140
|
-
| `--no-session` | Ephemeral mode; do not save |
|
|
141
|
-
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
142
|
-
|
|
143
|
-
### Tool Options
|
|
144
|
-
|
|
145
|
-
| Option | Description |
|
|
146
|
-
|--------|-------------|
|
|
147
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
148
|
-
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
149
|
-
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
150
|
-
| `--no-tools`, `-nt` | Disable all tools |
|
|
151
|
-
|
|
152
|
-
Built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`.
|
|
153
|
-
|
|
154
|
-
### Resource Options
|
|
155
|
-
|
|
156
|
-
| Option | Description |
|
|
157
|
-
|--------|-------------|
|
|
158
|
-
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
159
|
-
| `--no-extensions` | Disable extension discovery |
|
|
160
|
-
| `--skill <path>` | Load a skill; repeatable |
|
|
161
|
-
| `--no-skills` | Disable skill discovery |
|
|
162
|
-
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
163
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
164
|
-
| `--theme <path>` | Load a theme; repeatable |
|
|
165
|
-
| `--no-themes` | Disable theme discovery |
|
|
166
|
-
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
167
|
-
|
|
168
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
pi --no-extensions -e ./my-extension.ts
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Pi saves sessions automatically unless session persistence is disabled.
|
|
175
|
-
|
|
176
|
-
| Option | Description |
|
|
177
|
-
|--------|-------------|
|
|
178
|
-
| `--system-prompt <text>` | Replace the default prompt's opening; tools, rules, context files, and skills are still appended |
|
|
179
|
-
| `--append-system-prompt <text>` | Append to system prompt |
|
|
180
|
-
| `--use-theme <name[/name]>` | Set the theme for this run without changing settings |
|
|
181
|
-
| `--verbose` | Force verbose startup |
|
|
182
|
-
| `-a`, `--approve` | Trust project-local files for this run |
|
|
183
|
-
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
184
|
-
| `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
|
|
185
|
-
| `-h`, `--help` | Show help |
|
|
186
|
-
| `-v`, `--version` | Show version |
|
|
187
|
-
|
|
188
|
-
### File Arguments
|
|
189
|
-
|
|
190
|
-
Prefix a command with `!` to run it and include its output in the conversation:
|
|
191
|
-
|
|
192
|
-
```text
|
|
193
|
-
!git status
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Examples
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
# Print a response for a prompt
|
|
200
|
-
pi "List all .ts files in src/"
|
|
201
|
-
|
|
202
|
-
# Explicit print mode
|
|
203
|
-
pi -p "Summarize this codebase"
|
|
204
|
-
|
|
205
|
-
Press `Ctrl+X` or run `/copy` to copy the last assistant response. Use `/export` to save the session as HTML or JSONL.
|
|
206
|
-
|
|
207
|
-
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.
|
|
208
|
-
|
|
209
|
-
## Adjust the terminal
|
|
210
|
-
|
|
211
|
-
# Different model
|
|
212
|
-
pi --provider openai --model gpt-4o "Help me refactor"
|
|
213
|
-
|
|
214
|
-
# Model with provider prefix
|
|
215
|
-
pi --model openai/gpt-4o "Help me refactor"
|
|
216
|
-
|
|
217
|
-
# Model with thinking level shorthand
|
|
218
|
-
pi --model sonnet:high "Solve this complex problem"
|
|
219
|
-
|
|
220
|
-
# Limit the models available to the session
|
|
221
|
-
pi --models "claude-*,gpt-4o"
|
|
222
|
-
|
|
223
|
-
# Read-only mode
|
|
224
|
-
pi --tools read,grep,find,ls -p "Review the code"
|
|
225
|
-
|
|
226
|
-
# Disable one extension or built-in tool while keeping the rest available
|
|
227
|
-
pi --exclude-tools ask_question
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
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.
|
|
231
|
-
|
|
232
|
-
## Collect diagnostic information
|
|
233
|
-
|
|
234
|
-
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).
|
|
235
|
-
|
|
236
|
-
Review this file before sharing it. It can contain prompts, model responses, tool output, file contents, and terminal data.
|
|
118
|
+
See [Pi Packages](packages.md) and [Command Line](cli.md#package-commands).
|
package/docs/virtual-models.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
Register virtual models from an [extension](extensions.md). They appear in
|
|
5
|
+
Register virtual models from an [extension](extensions.md). They appear in `--list-models`, `--model`, RPC `get_available_models`, 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
6
|
|
|
7
7
|
## Selection and dispatch
|
|
8
8
|
|
|
@@ -20,11 +20,11 @@ Pi keeps the two pairs apart:
|
|
|
20
20
|
| | Selection | Dispatch |
|
|
21
21
|
|---|---|---|
|
|
22
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`,
|
|
23
|
+
| Visible as | `ctx.model`, `ctx.thinkingLevel`, `PI_MODEL`, `PI_REASONING_LEVEL`, RPC `get_state` | The assistant message of each response |
|
|
24
24
|
|
|
25
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
26
|
|
|
27
|
-
|
|
27
|
+
Each assistant message records the physical model that answered, so per-model cost can be computed from the session entries.
|
|
28
28
|
|
|
29
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
30
|
|
|
@@ -104,7 +104,7 @@ pi.registerVirtualModel<{ phase: "plan" | "build" }>({
|
|
|
104
104
|
|
|
105
105
|
- State must be JSON-serializable. Returning `undefined` or `request.state` itself keeps the current state.
|
|
106
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
|
|
107
|
+
- State follows the session tree, so forks and tree navigation see the state of their branch. It survives compaction.
|
|
108
108
|
- `direct` requests have no state, and Pi ignores state they return.
|
|
109
109
|
|
|
110
110
|
The transcript already records the selection and every dispatched model, and `ctx.sessionManager.getBranch()` exposes both.
|
package/docs/windows.md
CHANGED
|
@@ -8,8 +8,8 @@ Follow the main [Quickstart](quickstart.md) to install and authenticate Pi. Use
|
|
|
8
8
|
|
|
9
9
|
| Environment | Command environment | Use it when |
|
|
10
10
|
|---|---|---|
|
|
11
|
-
| Native Windows with Git Bash | Git Bash for the built-in `bash` tool and
|
|
12
|
-
| Native Windows with the `powershell` tool | PowerShell for model tool calls; Bash remains available for
|
|
11
|
+
| Native Windows with Git Bash | Git Bash for the built-in `bash` tool and the RPC `bash` command | 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 the RPC `bash` command | The task depends on PowerShell modules or Windows-native commands |
|
|
13
13
|
| WSL | Linux Bash and tools inside the selected WSL distribution | Your files and toolchain already live in Linux or WSL |
|
|
14
14
|
|
|
15
15
|
## Use Git Bash on native Windows
|
|
@@ -23,10 +23,10 @@ Pi resolves Bash in this order:
|
|
|
23
23
|
3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
|
|
24
24
|
4. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Ask Pi to run a command to verify the shell:
|
|
27
27
|
|
|
28
|
-
```
|
|
29
|
-
|
|
28
|
+
```bash
|
|
29
|
+
pi --tools bash -p "Run: printf 'Bash is working'"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
If Pi cannot find Bash, it reports the locations it checked. Install Git for Windows, put another Bash executable on `PATH`, or configure `shellPath`.
|
|
@@ -52,13 +52,13 @@ To replace the model-facing `bash` tool with `powershell`, add this to `~/.pi/ag
|
|
|
52
52
|
|
|
53
53
|
`["-bash", "+powershell"]` does the same while keeping any other default tools you configured.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Then ask Pi to run a harmless PowerShell command. The RPC `bash` command continues to use Bash. The `powershell` tool is available only when Pi runs as a native Windows process.
|
|
56
56
|
|
|
57
57
|
See [Settings](settings.md#tools) for other tool combinations.
|
|
58
58
|
|
|
59
59
|
## WSL
|
|
60
60
|
|
|
61
|
-
WSL path conversion on Windows
|
|
61
|
+
WSL path conversion on Windows recognizes `/mnt/<drive>`, not custom mount roots.
|
|
62
62
|
|
|
63
63
|
When using the legacy WSL `bash.exe` launcher from Windows, Pi sends commands over stdin to avoid command-line quoting problems.
|
|
64
64
|
|
|
@@ -76,6 +76,4 @@ JSON uses backslashes for escape sequences. When you write a Windows path with b
|
|
|
76
76
|
|
|
77
77
|
See [Configure shell commands](shell-aliases.md) for command prefixes, aliases, and the complete shell-resolution behavior.
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
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.
|
|
79
|
+
Pi's headless modes do not depend on terminal features, so any Windows terminal or console host works.
|
|
@@ -23,9 +23,10 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
23
23
|
| `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |
|
|
24
24
|
| `confirm-destructive.ts` | Confirms before destructive session actions (clear, switch, fork) |
|
|
25
25
|
| `dirty-repo-guard.ts` | Prevents session changes with uncommitted git changes |
|
|
26
|
-
| `sandbox/` | OS-level sandboxing using `@anthropic-ai/sandbox-runtime` with per-project config |
|
|
27
26
|
| `gondolin/` | Route built-in tools and `!` commands into a Gondolin micro-VM |
|
|
28
27
|
|
|
28
|
+
For isolation setup and limitations, see [Run Pi in an isolated environment](../../docs/containerization.md).
|
|
29
|
+
|
|
29
30
|
### Custom Tools
|
|
30
31
|
|
|
31
32
|
| Extension | Description |
|
|
@@ -158,7 +159,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
158
159
|
|
|
159
160
|
**Use StringEnum for string parameters** (required for Google API compatibility):
|
|
160
161
|
```typescript
|
|
161
|
-
import { StringEnum } from "@punch-bot/
|
|
162
|
+
import { StringEnum } from "@punch-bot/cli";
|
|
162
163
|
|
|
163
164
|
// Good
|
|
164
165
|
action: StringEnum(["list", "add"] as const)
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
type TextContent,
|
|
43
43
|
type ThinkingContent,
|
|
44
44
|
type Tool,
|
|
45
|
-
|
|
45
|
+
ToolCallArgumentsStream,
|
|
46
46
|
type ToolResultMessage,
|
|
47
47
|
type TranscriptContext,
|
|
48
48
|
} from "@punch-bot/ai";
|
|
@@ -454,8 +454,9 @@ function streamCustomAnthropic(
|
|
|
454
454
|
const anthropicStream = client.messages.stream({ ...params }, { signal: options?.signal });
|
|
455
455
|
stream.push({ type: "start", partial: output });
|
|
456
456
|
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
// Stream state per Anthropic block index, kept off the content blocks so it never reaches partial messages.
|
|
458
|
+
// ToolCallArgumentsStream reads each argument delta once and shows the arguments parsed so far.
|
|
459
|
+
const openBlocks = new Map<number, { contentIndex: number; arguments?: ToolCallArgumentsStream }>();
|
|
459
460
|
|
|
460
461
|
for await (const event of anthropicStream) {
|
|
461
462
|
if (event.type === "message_start") {
|
|
@@ -468,15 +469,12 @@ function streamCustomAnthropic(
|
|
|
468
469
|
calculateCost(model, output.usage);
|
|
469
470
|
} else if (event.type === "content_block_start") {
|
|
470
471
|
if (event.content_block.type === "text") {
|
|
471
|
-
output.content.push({ type: "text", text: ""
|
|
472
|
+
output.content.push({ type: "text", text: "" });
|
|
473
|
+
openBlocks.set(event.index, { contentIndex: output.content.length - 1 });
|
|
472
474
|
stream.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output });
|
|
473
475
|
} else if (event.content_block.type === "thinking") {
|
|
474
|
-
output.content.push({
|
|
475
|
-
|
|
476
|
-
thinking: "",
|
|
477
|
-
thinkingSignature: "",
|
|
478
|
-
index: event.index,
|
|
479
|
-
} as any);
|
|
476
|
+
output.content.push({ type: "thinking", thinking: "", thinkingSignature: "" });
|
|
477
|
+
openBlocks.set(event.index, { contentIndex: output.content.length - 1 });
|
|
480
478
|
stream.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output });
|
|
481
479
|
} else if (event.content_block.type === "tool_use") {
|
|
482
480
|
output.content.push({
|
|
@@ -484,15 +482,18 @@ function streamCustomAnthropic(
|
|
|
484
482
|
id: event.content_block.id,
|
|
485
483
|
name: isOAuth ? fromClaudeCodeName(event.content_block.name, tools) : event.content_block.name,
|
|
486
484
|
arguments: {},
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
485
|
+
});
|
|
486
|
+
openBlocks.set(event.index, {
|
|
487
|
+
contentIndex: output.content.length - 1,
|
|
488
|
+
arguments: new ToolCallArgumentsStream(),
|
|
489
|
+
});
|
|
490
490
|
stream.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output });
|
|
491
491
|
}
|
|
492
492
|
} else if (event.type === "content_block_delta") {
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
const open = openBlocks.get(event.index);
|
|
494
|
+
if (!open) continue;
|
|
495
|
+
const index = open.contentIndex;
|
|
496
|
+
const block = output.content[index]!;
|
|
496
497
|
|
|
497
498
|
if (event.delta.type === "text_delta" && block.type === "text") {
|
|
498
499
|
block.text += event.delta.text;
|
|
@@ -505,11 +506,8 @@ function streamCustomAnthropic(
|
|
|
505
506
|
delta: event.delta.thinking,
|
|
506
507
|
partial: output,
|
|
507
508
|
});
|
|
508
|
-
} else if (event.delta.type === "input_json_delta" && block.type === "toolCall") {
|
|
509
|
-
|
|
510
|
-
try {
|
|
511
|
-
block.arguments = JSON.parse((block as any).partialJson);
|
|
512
|
-
} catch {}
|
|
509
|
+
} else if (event.delta.type === "input_json_delta" && block.type === "toolCall" && open.arguments) {
|
|
510
|
+
block.arguments = open.arguments.append(event.delta.partial_json);
|
|
513
511
|
stream.push({
|
|
514
512
|
type: "toolcall_delta",
|
|
515
513
|
contentIndex: index,
|
|
@@ -520,20 +518,19 @@ function streamCustomAnthropic(
|
|
|
520
518
|
block.thinkingSignature = (block.thinkingSignature || "") + (event.delta as any).signature;
|
|
521
519
|
}
|
|
522
520
|
} else if (event.type === "content_block_stop") {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
521
|
+
const open = openBlocks.get(event.index);
|
|
522
|
+
if (!open) continue;
|
|
523
|
+
openBlocks.delete(event.index);
|
|
524
|
+
const index = open.contentIndex;
|
|
525
|
+
const block = output.content[index]!;
|
|
526
526
|
|
|
527
|
-
delete (block as any).index;
|
|
528
527
|
if (block.type === "text") {
|
|
529
528
|
stream.push({ type: "text_end", contentIndex: index, content: block.text, partial: output });
|
|
530
529
|
} else if (block.type === "thinking") {
|
|
531
530
|
stream.push({ type: "thinking_end", contentIndex: index, content: block.thinking, partial: output });
|
|
532
|
-
} else if (block.type === "toolCall") {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
} catch {}
|
|
536
|
-
delete (block as any).partialJson;
|
|
531
|
+
} else if (block.type === "toolCall" && open.arguments) {
|
|
532
|
+
// One full parse of the complete text; malformed arguments are reported in `argumentsError`.
|
|
533
|
+
Object.assign(block, open.arguments.finish());
|
|
537
534
|
stream.push({ type: "toolcall_end", contentIndex: index, toolCall: block, partial: output });
|
|
538
535
|
}
|
|
539
536
|
} else if (event.type === "message_delta") {
|
|
@@ -563,7 +560,6 @@ function streamCustomAnthropic(
|
|
|
563
560
|
stream.push({ type: "done", reason: output.stopReason, message: output });
|
|
564
561
|
stream.end();
|
|
565
562
|
} catch (error) {
|
|
566
|
-
for (const block of output.content) delete (block as any).index;
|
|
567
563
|
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
568
564
|
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
569
565
|
stream.push({ type: "error", reason: output.stopReason, error: output });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.5.
|
|
9
|
+
"version": "1.5.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "1.5.
|
|
9
|
+
"version": "1.5.3",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@earendil-works/gondolin": "0.
|
|
11
|
+
"@earendil-works/gondolin": "0.14.0"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/@cto.af/wtf8": {
|
|
@@ -21,31 +21,30 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"node_modules/@earendil-works/gondolin": {
|
|
24
|
-
"version": "0.
|
|
25
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin/-/gondolin-0.
|
|
26
|
-
"integrity": "sha512-
|
|
24
|
+
"version": "0.14.0",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin/-/gondolin-0.14.0.tgz",
|
|
26
|
+
"integrity": "sha512-MSw+EGcqFJeyKHdXEfm+nMRr74ytT4x8DGIohav0oPCHeVQAB9AajquM94cv2xqvIU3VDAaZZVC07IXsOY6OVQ==",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"cbor2": "^2.3.0",
|
|
30
|
-
"node-forge": "^1.3.3",
|
|
31
30
|
"ssh2": "^1.17.0",
|
|
32
|
-
"undici": "^6.
|
|
31
|
+
"undici": "^6.29.0"
|
|
33
32
|
},
|
|
34
33
|
"bin": {
|
|
35
34
|
"gondolin": "dist/bin/gondolin.js"
|
|
36
35
|
},
|
|
37
36
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.19.0"
|
|
39
38
|
},
|
|
40
39
|
"optionalDependencies": {
|
|
41
|
-
"@earendil-works/gondolin-krun-runner-darwin-arm64": "0.
|
|
42
|
-
"@earendil-works/gondolin-krun-runner-linux-x64": "0.
|
|
40
|
+
"@earendil-works/gondolin-krun-runner-darwin-arm64": "0.14.0",
|
|
41
|
+
"@earendil-works/gondolin-krun-runner-linux-x64": "0.14.0"
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
"node_modules/@earendil-works/gondolin-krun-runner-darwin-arm64": {
|
|
46
|
-
"version": "0.
|
|
47
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-darwin-arm64/-/gondolin-krun-runner-darwin-arm64-0.
|
|
48
|
-
"integrity": "sha512-
|
|
45
|
+
"version": "0.14.0",
|
|
46
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-darwin-arm64/-/gondolin-krun-runner-darwin-arm64-0.14.0.tgz",
|
|
47
|
+
"integrity": "sha512-fvuhz1CZPaEbmXC0luZoXd1obAb0bjaaGJz33Jo63bhMlosYunAahItakh7cU0dnTlNFzufOSnpGOPqtuYjnpQ==",
|
|
49
48
|
"cpu": [
|
|
50
49
|
"arm64"
|
|
51
50
|
],
|
|
@@ -59,9 +58,9 @@
|
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"node_modules/@earendil-works/gondolin-krun-runner-linux-x64": {
|
|
62
|
-
"version": "0.
|
|
63
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-linux-x64/-/gondolin-krun-runner-linux-x64-0.
|
|
64
|
-
"integrity": "sha512-
|
|
61
|
+
"version": "0.14.0",
|
|
62
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/gondolin-krun-runner-linux-x64/-/gondolin-krun-runner-linux-x64-0.14.0.tgz",
|
|
63
|
+
"integrity": "sha512-91iw4smoOH/yOoAuQS6N2UZOxqSFwRhtk8rTyrokXBoWiWcveAzg4kHvnLcm40ZlNrWwzIDFrere4bkZeGDQcA==",
|
|
65
64
|
"cpu": [
|
|
66
65
|
"x64"
|
|
67
66
|
],
|
|
@@ -134,15 +133,6 @@
|
|
|
134
133
|
"license": "MIT",
|
|
135
134
|
"optional": true
|
|
136
135
|
},
|
|
137
|
-
"node_modules/node-forge": {
|
|
138
|
-
"version": "1.4.0",
|
|
139
|
-
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
|
140
|
-
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
|
141
|
-
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
142
|
-
"engines": {
|
|
143
|
-
"node": ">= 6.13.0"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
136
|
"node_modules/safer-buffer": {
|
|
147
137
|
"version": "2.1.2",
|
|
148
138
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
@@ -173,9 +163,9 @@
|
|
|
173
163
|
"license": "Unlicense"
|
|
174
164
|
},
|
|
175
165
|
"node_modules/undici": {
|
|
176
|
-
"version": "6.29.
|
|
177
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.
|
|
178
|
-
"integrity": "sha512-
|
|
166
|
+
"version": "6.29.1",
|
|
167
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",
|
|
168
|
+
"integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",
|
|
179
169
|
"license": "MIT",
|
|
180
170
|
"engines": {
|
|
181
171
|
"node": ">=18.17"
|