@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/providers.md
CHANGED
|
@@ -5,15 +5,15 @@ Most hosted providers support one or both of these authentication methods:
|
|
|
5
5
|
- Sign in through a browser or device flow backed by OAuth.
|
|
6
6
|
- Provide an API key.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Run `pi auth login <provider>` to use the method a provider supports. An unknown provider ID prints the list of known provider IDs. Providers that built-in or user extensions register, such as llama.cpp, log in the same way. A project's own extensions do not load for this command. Amazon Bedrock and Google Vertex AI can also use ambient cloud credentials.
|
|
9
9
|
|
|
10
10
|
## Authenticate interactively
|
|
11
11
|
|
|
12
|
-
Run
|
|
12
|
+
Run `pi auth login <provider>` in a terminal. Pi guides you through its OAuth or API-key flow, saves the resulting credential in [`auth.json`](configuration.md#agent-directory), and exits. Add `--api-key` to save an API key instead of signing in with an account. See [Credential commands](cli.md#credential-commands).
|
|
13
13
|
|
|
14
|
-
On a remote or headless machine, an OAuth callback may not reach the local process.
|
|
14
|
+
On a remote or headless machine, an OAuth callback may not reach the local process. Add `--no-browser` to use another sign-in method, such as a device code, or paste the final redirect URL or authorization code back into Pi when prompted.
|
|
15
15
|
|
|
16
|
-
Run
|
|
16
|
+
Run `pi auth logout <provider>` to remove its stored credential. This does not unset environment variables, remove authentication from `models.json`, or revoke the credential at the provider.
|
|
17
17
|
|
|
18
18
|
`auth.json` can contain API keys and OAuth tokens. Keep it private and do not commit it.
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ Environment variables are useful in CI and anywhere Pi should not store the key.
|
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
26
|
-
pi
|
|
26
|
+
pi -p "Say hello"
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
This table covers providers with a single primary API-key variable. Providers that need additional configuration or support ambient credentials are covered under [Provider Specific Config](#provider-specific-config).
|
|
@@ -58,7 +58,7 @@ This table covers providers with a single primary API-key variable. Providers th
|
|
|
58
58
|
| MiniMax (China) | `MINIMAX_CN_API_KEY` |
|
|
59
59
|
| Moonshot AI (Global and China) | `MOONSHOT_API_KEY` |
|
|
60
60
|
| Qwen Token Plan and Individual | `QWEN_TOKEN_PLAN_API_KEY` |
|
|
61
|
-
| Qwen Token Plan (China) | `QWEN_TOKEN_PLAN_CN_API_KEY` |
|
|
61
|
+
| Qwen Token Plan (China) and Individual (China) | `QWEN_TOKEN_PLAN_CN_API_KEY` |
|
|
62
62
|
| Xiaomi MiMo | `XIAOMI_API_KEY` |
|
|
63
63
|
| Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` |
|
|
64
64
|
| Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` |
|
|
@@ -105,7 +105,7 @@ A stored API-key credential can include an `env` object. Its values take priorit
|
|
|
105
105
|
|
|
106
106
|
Radius is a service crafted for Pi by the builders of Pi, Earendil Works. It provides a customizable AI gateway with organization-level controls and analytics built in, and artifacts for sharing what you create with Pi.
|
|
107
107
|
|
|
108
|
-
To get started, run
|
|
108
|
+
To get started, run `pi auth login radius`. This adds Radius as a provider, and its models appear in `--list-models` like any other provider's.
|
|
109
109
|
|
|
110
110
|
Radius also has an MCP server, so Pi can manage Radius for you.
|
|
111
111
|
|
|
@@ -115,7 +115,7 @@ Radius authentication uses its gateway catalog and caches refreshed model metada
|
|
|
115
115
|
|
|
116
116
|
### OpenRouter
|
|
117
117
|
|
|
118
|
-
Authenticate with
|
|
118
|
+
Authenticate with `pi auth login openrouter` or `OPENROUTER_API_KEY`.
|
|
119
119
|
|
|
120
120
|
With a key, Pi lists only the OpenRouter chat models that key may use, with the key's context size, max output, and prices. These come from OpenRouter's `/models/user` endpoint and reflect guardrails and provider restrictions set in OpenRouter. Image and classifier models are not filtered.
|
|
121
121
|
|
package/docs/quickstart.md
CHANGED
|
@@ -6,13 +6,7 @@ For native Windows setup, read [Windows Setup](windows.md). For Android, read [T
|
|
|
6
6
|
|
|
7
7
|
## 1. Install Pi
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
curl -fsSL https://pi.dev/install.sh | sh
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
The installer pins all dependencies and updates Pi with `pi update`. Alternatively, install Pi from npm with the fork's generated shrinkwrap. This requires Node.js 22.19 or newer:
|
|
9
|
+
Install Pi from npm with the fork's generated shrinkwrap. This requires Node.js 22.19 or newer:
|
|
16
10
|
|
|
17
11
|
```bash
|
|
18
12
|
npm install -g --ignore-scripts @punch-bot/cli
|
|
@@ -26,68 +20,57 @@ Verify the installation:
|
|
|
26
20
|
pi --version
|
|
27
21
|
```
|
|
28
22
|
|
|
29
|
-
## 2.
|
|
23
|
+
## 2. Choose a model
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
A **model** generates Pi's responses. A **provider** is the service or account Pi uses to access that model.
|
|
26
|
+
|
|
27
|
+
Log in to a provider:
|
|
32
28
|
|
|
33
29
|
```bash
|
|
34
|
-
|
|
35
|
-
pi
|
|
30
|
+
pi auth login anthropic
|
|
36
31
|
```
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<p align="center"><img src="images/interactive-mode.png" alt="Pi running in a terminal with a conversation, input editor, and status footer" width="750"></p>
|
|
33
|
+
Pi signs in with an account in the browser, or asks for an API key when the provider has no account sign-in. Add `--api-key` to save an API key instead. You can also set the provider's environment variable, such as `ANTHROPIC_API_KEY`, without logging in.
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
Without `--model`, Pi uses the `defaultModel` [setting](settings.md) or a default model of an authenticated provider. Choose another model with `--model`, for example `pi --model sonnet:high`. Run `pi --list-models` to see the available models.
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
## 3. Give Pi a task
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
Change to the folder you want Pi to work with, then give it a task:
|
|
49
42
|
|
|
50
|
-
```
|
|
51
|
-
/
|
|
43
|
+
```bash
|
|
44
|
+
cd /path/to/folder
|
|
45
|
+
pi -p "Explain how this repository is structured and how to run its checks."
|
|
52
46
|
```
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
|
|
57
|
-
|
|
58
|
-
## 4. Give Pi a task
|
|
59
|
-
|
|
60
|
-
Pi shows each file read, search, command, and edit it performs. It does not ask before every tool call.
|
|
48
|
+
The working folder helps Pi discover relevant files, instructions, and configuration. Pi also uses it to group saved sessions.
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Pi runs headless: print mode (`-p`) writes the final answer to stdout and exits. Use `--mode json` to stream every event, or `--mode rpc` to drive Pi from another program. See [Use Pi from the command line](usage.md).
|
|
63
51
|
|
|
64
|
-
|
|
65
|
-
Summarize @meeting-notes.md and save the action items to action-items.md.
|
|
66
|
-
```
|
|
52
|
+
Pi runs file reads, searches, commands, and edits without asking before each tool call. Include files with separate `@path` arguments:
|
|
67
53
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```text
|
|
73
|
-
Compare @previous.csv with @current.csv and summarize the important changes.
|
|
54
|
+
```bash
|
|
55
|
+
pi -p @meeting-notes.md "Summarize these notes and save the action items to action-items.md."
|
|
56
|
+
pi -p @previous.csv @current.csv "Compare these files and summarize the important changes."
|
|
74
57
|
```
|
|
75
58
|
|
|
76
|
-
|
|
59
|
+
When Pi finishes, review its response and any changed files. Use version control or backups for important work. For untrusted or unattended work, use a container or another sandbox. See [Security](security.md).
|
|
77
60
|
|
|
78
61
|
## Continue later
|
|
79
62
|
|
|
80
|
-
Pi saves sessions automatically.
|
|
63
|
+
Pi saves sessions automatically. Continue the most recent session for the same working folder with:
|
|
81
64
|
|
|
82
65
|
```bash
|
|
83
|
-
pi --continue
|
|
66
|
+
pi --continue -p "Now add tests for it."
|
|
84
67
|
```
|
|
85
68
|
|
|
86
|
-
Use
|
|
69
|
+
Use `--session <path|id>` to open another saved session. See [Continue or branch a session](sessions.md) for session naming, branching, compaction, and export.
|
|
87
70
|
|
|
88
71
|
## Next steps
|
|
89
72
|
|
|
90
|
-
- [Use Pi
|
|
73
|
+
- [Use Pi from the command line](usage.md) to learn input, commands, and queued messages.
|
|
91
74
|
- [Add instructions](configuration.md#context-files) that Pi should follow whenever it works in a folder.
|
|
92
75
|
- [Choose a model and provider](models.md).
|
|
93
76
|
|
|
@@ -98,25 +81,18 @@ Start with the least powerful mechanism that meets your need:
|
|
|
98
81
|
| Need | Start with |
|
|
99
82
|
|---|---|
|
|
100
83
|
| Give Pi persistent instructions for a folder | [`AGENTS.md`](configuration.md#context-files) |
|
|
101
|
-
| Reuse a prompt
|
|
84
|
+
| Reuse a prompt as a `/` command | [Prompt template](prompt-templates.md) |
|
|
102
85
|
| Add task-specific instructions and supporting files | [Skill](skills.md) |
|
|
103
86
|
| Add executable tools, commands, or event handlers | [Extension](extensions.md) |
|
|
104
|
-
| Build a custom terminal component | [Terminal UI](tui.md) |
|
|
105
87
|
| Connect an unsupported model service | [Custom provider](custom-provider.md) |
|
|
106
88
|
| Install or distribute several resources | [Pi package](packages.md) |
|
|
107
89
|
|
|
108
90
|
## Uninstall Pi
|
|
109
91
|
|
|
110
|
-
|
|
92
|
+
Run:
|
|
111
93
|
|
|
112
94
|
```bash
|
|
113
95
|
npm uninstall -g @punch-bot/cli
|
|
114
96
|
```
|
|
115
97
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
curl -fsSL https://pi.dev/install.sh | sh
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Neither method removes configuration, credentials, sessions, or installed Pi packages from `~/.pi/agent/`.
|
|
98
|
+
This does not remove configuration, credentials, sessions, or installed Pi packages from `~/.pi/agent/`.
|
package/docs/rpc-commands.md
CHANGED
|
@@ -590,7 +590,7 @@ Response:
|
|
|
590
590
|
}
|
|
591
591
|
```
|
|
592
592
|
|
|
593
|
-
`tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction
|
|
593
|
+
`tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction.
|
|
594
594
|
|
|
595
595
|
`contextUsage` is omitted when no model or context window is available. `contextUsage.tokens` and `contextUsage.percent` are `null` immediately after compaction until a fresh post-compaction assistant response provides valid usage data.
|
|
596
596
|
|
|
@@ -859,7 +859,7 @@ Each command has:
|
|
|
859
859
|
- `origin`: `"top-level"` for a directly loaded resource or `"package"` for a package resource
|
|
860
860
|
- `baseDir`: Package base directory, when applicable
|
|
861
861
|
|
|
862
|
-
**Note**:
|
|
862
|
+
**Note**: Pi has no other slash commands. A `prompt` such as `/model` that matches no extension command, prompt template, or skill is sent to the model as plain text. Use RPC commands such as `set_model` instead.
|
|
863
863
|
|
|
864
864
|
## Model object
|
|
865
865
|
|
package/docs/rpc-extension-ui.md
CHANGED
|
@@ -11,18 +11,16 @@ If a dialog method includes a `timeout` field, the agent-side will auto-resolve
|
|
|
11
11
|
|
|
12
12
|
## Limitations
|
|
13
13
|
|
|
14
|
-
Some `ExtensionUIContext` methods are not supported or degraded in RPC mode
|
|
14
|
+
Some `ExtensionUIContext` methods are not supported or degraded in RPC mode:
|
|
15
15
|
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
- `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, `setFooter()`, `setHeader()`, `addAutocompleteProvider()`, `setEditorComponent()`, and `setToolsExpanded()` are no-ops.
|
|
19
|
-
- `getEditorText()` returns `""` and `getEditorComponent()` returns `undefined`.
|
|
16
|
+
- `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, and `setToolsExpanded()` are no-ops.
|
|
17
|
+
- `getEditorText()` returns `""`.
|
|
20
18
|
- `getToolsExpanded()` returns `false`.
|
|
21
19
|
- `pasteToEditor()` delegates to `setEditorText()` without terminal paste handling.
|
|
22
20
|
- `getAllThemes()` returns `[]`, and `getTheme()` returns `undefined`.
|
|
23
21
|
- `setTheme()` returns `{ success: false, error: "Theme switching not supported in RPC mode" }`.
|
|
24
22
|
|
|
25
|
-
Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol.
|
|
23
|
+
Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol.
|
|
26
24
|
|
|
27
25
|
## Requests from Pi
|
|
28
26
|
|
|
@@ -195,6 +193,6 @@ Dismiss any dialog method. The extension receives `undefined` (for select/input/
|
|
|
195
193
|
|
|
196
194
|
## Example
|
|
197
195
|
|
|
198
|
-
See the checked [
|
|
196
|
+
See the checked [demo extension](../examples/extensions/rpc-demo.ts), which exercises these requests.
|
|
199
197
|
|
|
200
198
|
The exported request and response unions are defined in [`rpc-types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/rpc/rpc-types.ts). See [Extensions](extensions.md#ui-and-modes) for mode-independent extension guidance.
|
package/docs/rpc.md
CHANGED
|
@@ -92,9 +92,11 @@ Clients must also handle child-process startup failures, unexpected exits, stder
|
|
|
92
92
|
|
|
93
93
|
## Shutdown
|
|
94
94
|
|
|
95
|
-
Close the child's stdin to request an orderly shutdown. Pi disposes the active runtime before exiting. Clients should still handle process signals and unexpected exits.
|
|
95
|
+
Close the child's stdin to request an orderly shutdown. Pi disposes the active runtime and waits for pending work to finish before exiting, so give it time to exit before killing it. Clients should still handle process signals and unexpected exits.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
SIGTERM and SIGHUP also start an orderly shutdown. Once a shutdown has started, from either stdin EOF or a signal, a stdin EOF or a single signal does not interrupt it; a second signal exits at once. Closing stdin and sending SIGTERM together is safe.
|
|
98
|
+
|
|
99
|
+
An extension can also request shutdown with `ctx.shutdown()`. If the session is idle and no command is being handled, Pi shuts down right away. Otherwise it shuts down once the current command finishes (for `prompt`, once the prompt settles) or the active run emits `agent_settled`. (A request made while an extension-started compaction is running waits for the next command or run to finish.)
|
|
98
100
|
|
|
99
101
|
## Minimal client
|
|
100
102
|
|
package/docs/sdk.md
CHANGED
|
@@ -109,7 +109,7 @@ Use `DefaultResourceLoader` when you want standard discovery with selected overr
|
|
|
109
109
|
|
|
110
110
|
<a id="inlineextension"></a>
|
|
111
111
|
|
|
112
|
-
Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output. A named inline extension with `replaceable: true` is left out when another extension registers a tool, command, or flag with a name it registers during loading, instead of both loading with a conflict. The CLI's built-in codemode, tool search, and MCP extensions are replaceable. A named entry with `builtin: true` is not an inline extension: it supplies the code of the `builtin:<name>` extension, which loads like a configured extension file. It loads by default, is listed
|
|
112
|
+
Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output. A named inline extension with `replaceable: true` is left out when another extension registers a tool, command, or flag with a name it registers during loading, instead of both loading with a conflict. The CLI's built-in codemode, tool search, and MCP extensions are replaceable. A named entry with `builtin: true` is not an inline extension: it supplies the code of the `builtin:<name>` extension, which loads like a configured extension file. It loads by default, is listed by `pi config`, and is disabled by `-builtin:<name>` in the `extensions` setting or by `noExtensions`; `additionalExtensionPaths: ["builtin:<name>"]` loads it explicitly. It loads after project trust is resolved, so it cannot handle `project_trust`. The CLI's built-in extensions use it.
|
|
113
113
|
|
|
114
114
|
<a id="codemode-mcp"></a>
|
|
115
115
|
|
package/docs/security.md
CHANGED
|
@@ -4,7 +4,7 @@ Treat model-generated commands and code as untrusted. Pi can read, change, and e
|
|
|
4
4
|
|
|
5
5
|
Files, comments, instructions, command output, and model responses can steer the model through prompt injection. Project trust controls which project resources load at startup, but it does not make that content or the resulting actions safe.
|
|
6
6
|
|
|
7
|
-
Safety comes from limiting the files, credentials, processes, and network services Pi can access and affect if a generated action is wrong or hostile. Watching the
|
|
7
|
+
Safety comes from limiting the files, credentials, processes, and network services Pi can access and affect if a generated action is wrong or hostile. Watching the event stream, using project trust, and reviewing changes do not create a security boundary.
|
|
8
8
|
|
|
9
9
|
## Choose how to run Pi
|
|
10
10
|
|
|
@@ -64,17 +64,21 @@ A command-line `--approve` or `--no-approve` override applies first. When protec
|
|
|
64
64
|
2. If no extension decides, Pi looks for a saved decision for the current directory or one of its parents. The closest decision applies.
|
|
65
65
|
3. If no saved decision applies, Pi follows the global `defaultProjectTrust` setting, whose default is `"ask"`.
|
|
66
66
|
|
|
67
|
-
Saved decisions use canonical directory paths and live in:
|
|
67
|
+
Saved decisions use canonical directory paths as keys and `true` or `false` as values, and live in:
|
|
68
68
|
|
|
69
69
|
```text
|
|
70
70
|
~/.pi/agent/trust.json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
```json
|
|
74
|
+
{ "/home/user/projects/app": true }
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Edit the file, or have a `project_trust` extension handler return `remember: true`, to save a decision for future Pi processes. See [`project_trust`](extensions.md#project_trust).
|
|
74
78
|
|
|
75
|
-
### Project trust without
|
|
79
|
+
### Project trust without a prompt
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
Pi has no built-in trust prompt. If no command-line override, extension, or saved decision applies:
|
|
78
82
|
|
|
79
83
|
- `defaultProjectTrust: "always"` loads protected project resources.
|
|
80
84
|
- `defaultProjectTrust: "ask"` or `"never"` skips them.
|
package/docs/session-format.md
CHANGED
|
@@ -17,8 +17,6 @@ By default, `<session-id>` is a UUID. Callers can supply a custom ID through the
|
|
|
17
17
|
|
|
18
18
|
Sessions can be removed by deleting their `.jsonl` files under `~/.pi/agent/sessions/`.
|
|
19
19
|
|
|
20
|
-
Pi also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, pi uses the `trash` CLI to avoid permanent deletion.
|
|
21
|
-
|
|
22
20
|
## Session Version
|
|
23
21
|
|
|
24
22
|
Sessions have a version field in the header:
|
|
@@ -69,7 +67,7 @@ First line of the file. Metadata only, not part of the tree (no `id`/`parentId`)
|
|
|
69
67
|
{"type":"session","version":3,"id":"uuid","timestamp":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project"}
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
For sessions with a parent (created via
|
|
70
|
+
For sessions with a parent (created via `--fork`, RPC `fork` or `clone`, or `newSession({ parentSession })`):
|
|
73
71
|
|
|
74
72
|
```json
|
|
75
73
|
{"type":"session","version":3,"id":"uuid","timestamp":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project","parentSession":"/path/to/original/session.jsonl"}
|
|
@@ -148,7 +146,7 @@ Targets may be user, assistant, tool-result, or custom-message entries. `replace
|
|
|
148
146
|
|
|
149
147
|
### BranchSummaryEntry
|
|
150
148
|
|
|
151
|
-
Created when switching branches via
|
|
149
|
+
Created when switching branches via `ctx.navigateTree()` with an LLM generated summary of the left branch up to the common ancestor. Captures context from the abandoned path.
|
|
152
150
|
|
|
153
151
|
```json
|
|
154
152
|
{"type":"branch_summary","id":"g7h8i9j0","parentId":"a1b2c3d4","timestamp":"2024-12-03T14:15:00.000Z","fromId":"f6g7h8i9","summary":"Branch explored approach A..."}
|
|
@@ -169,7 +167,7 @@ Extension state persistence. Does NOT participate in LLM context.
|
|
|
169
167
|
{"type":"custom","id":"h8i9j0k1","parentId":"g7h8i9j0","timestamp":"2024-12-03T14:20:00.000Z","customType":"my-extension","data":{"count":42}}
|
|
170
168
|
```
|
|
171
169
|
|
|
172
|
-
Use `customType` to identify your extension's entries on reload.
|
|
170
|
+
Use `customType` to identify your extension's entries on reload. Custom entries do not participate in LLM context.
|
|
173
171
|
|
|
174
172
|
Pi stores [virtual model](virtual-models.md) router state as custom entries with `customType` `pi.virtual-model-state` and `data` `{ provider, modelId, state }`.
|
|
175
173
|
|
|
@@ -183,7 +181,7 @@ Extension-injected messages that DO participate in LLM context.
|
|
|
183
181
|
|
|
184
182
|
Fields:
|
|
185
183
|
- `content`: String or `(TextContent | ImageContent)[]` (same as UserMessage)
|
|
186
|
-
- `display`: `true` =
|
|
184
|
+
- `display`: `true` = clients should show it, `false` = hidden
|
|
187
185
|
- `details`: Optional extension-specific metadata (not sent to LLM)
|
|
188
186
|
|
|
189
187
|
### LabelEntry
|
|
@@ -198,13 +196,13 @@ Set `label` to `undefined` to clear a label.
|
|
|
198
196
|
|
|
199
197
|
### SessionInfoEntry
|
|
200
198
|
|
|
201
|
-
Session metadata (e.g., user-defined display name). Set via
|
|
199
|
+
Session metadata (e.g., user-defined display name). Set via `--name` / `-n`, RPC `set_session_name`, or `pi.setSessionName()` in extensions.
|
|
202
200
|
|
|
203
201
|
```json
|
|
204
202
|
{"type":"session_info","id":"k1l2m3n4","parentId":"j0k1l2m3","timestamp":"2024-12-03T14:35:00.000Z","name":"Refactor auth module"}
|
|
205
203
|
```
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
RPC `get_state` returns the latest name as `sessionName`.
|
|
208
206
|
|
|
209
207
|
## Tree Structure
|
|
210
208
|
|
|
@@ -230,7 +228,7 @@ Entries normally form one tree, but navigation APIs can create multiple roots:
|
|
|
230
228
|
- Includes the compaction entry first
|
|
231
229
|
- Includes non-system entries from `firstKeptEntryId` up to, but not including, the compaction entry
|
|
232
230
|
- Includes entries after the compaction entry
|
|
233
|
-
3. Preserves non-message entries in the selected range so
|
|
231
|
+
3. Preserves non-message entries in the selected range so clients can render them
|
|
234
232
|
|
|
235
233
|
`buildSessionProjection()` then applies the latest `context_edit` for each selected target. It returns the model-visible messages together with their source entries. Omitted targets produce no message; replacements retain the source entry's role and metadata while changing only content. The raw selected entries are not modified.
|
|
236
234
|
|
package/docs/sessions.md
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
# Sessions and Context
|
|
2
2
|
|
|
3
|
-
Pi saves a conversation as a session. The active branch of that session supplies conversation history for the next model request. Use session commands to continue work, explore another branch, or reduce the amount of history sent to the model.
|
|
3
|
+
Pi saves a conversation as a session. The active branch of that session supplies conversation history for the next model request. Use session options and RPC commands to continue work, explore another branch, or reduce the amount of history sent to the model.
|
|
4
4
|
|
|
5
5
|
## Continue or switch sessions
|
|
6
6
|
|
|
7
7
|
Pi saves sessions automatically unless you start it with `--no-session`.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pi --continue
|
|
11
|
-
pi --
|
|
10
|
+
pi --continue -p "What did we discuss?"
|
|
11
|
+
pi --session <path|id> -p "Continue with the next step"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
`--continue` opens the most recent session for the current
|
|
14
|
+
`--continue` (or its alias `--resume`) opens the most recent session for the current directory. `--session` opens a session by file path or full or partial ID. RPC clients start a new session with [`new_session`](rpc-commands.md#new_session) and open another one with [`switch_session`](rpc-commands.md#switch_session); extensions use `ctx.newSession()` and `ctx.switchSession()`.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Each session records the working directory it was created in and never changes it. Pi runs a session in its working directory, so tools, `@path` references, project configuration, and context files resolve from there.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
| Entry point | Working directory |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `--continue` | The current directory |
|
|
21
|
+
| `--session`, RPC `switch_session` | The session's working directory. `--session` exits with an error when the session belongs to another directory and suggests `--fork`. |
|
|
22
|
+
| `--fork` | The current directory, in a new session |
|
|
23
|
+
|
|
24
|
+
If a session's working directory no longer exists, for example after the project folder was renamed, Pi exits with an error. Use `--fork` to copy the session into the current directory.
|
|
25
|
+
|
|
26
|
+
Use `--name`, the RPC [`set_session_name`](rpc-commands.md#set_session_name) command, or `pi.setSessionName()` to assign a recognizable session name. RPC [`get_session_stats`](rpc-commands.md#get_session_stats) returns the session file, ID, message count, token usage, and cost.
|
|
19
27
|
|
|
20
28
|
## Choose how to branch
|
|
21
29
|
|
|
@@ -23,13 +31,13 @@ Pi stores entries as a tree, so returning to an earlier point does not erase the
|
|
|
23
31
|
|
|
24
32
|
| Action | Result | Use it when |
|
|
25
33
|
|---|---|---|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
34
|
+
| `ctx.navigateTree()` in an extension command | Moves within the current session file | Related alternatives should stay together |
|
|
35
|
+
| `--fork`, RPC [`fork`](rpc-commands.md#fork) | Creates a new session from an earlier user message | The alternative should become separate work |
|
|
36
|
+
| RPC [`clone`](rpc-commands.md#clone) | Copies the active branch into a new session | You want a separate copy of the current state |
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
RPC [`get_tree`](rpc-commands.md#get_tree) returns the tree, and [`get_fork_messages`](rpc-commands.md#get_fork_messages) lists the user messages `fork` accepts.
|
|
31
39
|
|
|
32
|
-
When
|
|
40
|
+
When `ctx.navigateTree()` leaves a branch with `summarize: true`, Pi summarizes it and attaches that summary to the branch it enters. This preserves relevant work from the abandoned path without including every message from it.
|
|
33
41
|
|
|
34
42
|
For the persisted tree and entry types, see [Session Format](session-format.md).
|
|
35
43
|
|
|
@@ -37,11 +45,11 @@ For the persisted tree and entry types, see [Session Format](session-format.md).
|
|
|
37
45
|
|
|
38
46
|
The model receives the active branch, not every branch in the session file. Pi combines that history with the system prompt, discovered context files, available tools, and loaded skill descriptions. [How Pi Works](how-pi-works.md#context) describes how those inputs are assembled.
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
When the active context approaches the model's limit, Pi normally compacts older history automatically. Compaction adds a summary and keeps recent messages. It does not delete the original session entries. RPC `get_session_stats` reports current context usage.
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
Use the RPC [`compact`](rpc-commands.md#compact) command or `ctx.compact()` to compact manually. You can add instructions when the summary should preserve a particular topic or decision. Configure automatic compaction and retained history through [Settings](settings.md#compaction).
|
|
43
51
|
|
|
44
|
-
Compaction can fail if the provider is unavailable or cannot accept the summarization request. Correct the provider problem and
|
|
52
|
+
Compaction can fail if the provider is unavailable or cannot accept the summarization request. Correct the provider problem and compact again. Disabling automatic compaction does not disable manual compaction.
|
|
45
53
|
|
|
46
54
|
See [Compaction Reference](compaction.md) for thresholds, retained boundaries, branch-summary behavior, and extension hooks.
|
|
47
55
|
|
|
@@ -49,18 +57,10 @@ See [Compaction Reference](compaction.md) for thresholds, retained boundaries, b
|
|
|
49
57
|
|
|
50
58
|
By default, Pi stores sessions under `~/.pi/agent/sessions/`, grouped by working directory. Use `--session-dir`, `PI_CODING_AGENT_SESSION_DIR`, or the `sessionDir` setting to choose another location. The CLI option has highest precedence.
|
|
51
59
|
|
|
52
|
-
Use `--no-session` for an ephemeral run. An ephemeral session cannot be
|
|
53
|
-
|
|
54
|
-
Use `--session` when you already know the session path or ID. Use `--fork` to create a new session from an existing session before interactive mode starts.
|
|
55
|
-
|
|
56
|
-
## Export or share a session
|
|
57
|
-
|
|
58
|
-
Use `/export` to write the current session as HTML or JSONL. Use `/share` to upload it and get a viewer link. Pi uses a Radius artifact when Radius authentication is configured; otherwise, it uses a private GitHub gist.
|
|
59
|
-
|
|
60
|
-
Review exported or shared sessions first. They can contain prompts, model responses, tool arguments, command output, file contents, and extension messages.
|
|
60
|
+
Use `--no-session` for an ephemeral run. An ephemeral session cannot be continued after Pi exits.
|
|
61
61
|
|
|
62
|
-
##
|
|
62
|
+
## Export a session
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Use `pi --export <session> [output.html]` or the RPC [`export_html`](rpc-commands.md#export_html) command to write a session as HTML.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Review exported sessions before sharing them. They can contain prompts, model responses, tool arguments, command output, file contents, and extension messages.
|