@averyyy/pi-coding-agent 1.5.0-piclient.4 → 1.5.2-piclient.1
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 +134 -0
- package/dist/bundle/chunks/anthropic-messages-KT6DV7MK.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-M725JFGO.js → azure-openai-responses-E2Z734ES.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-27POX4KP.js +82 -0
- package/dist/bundle/chunks/{chunk-HLEWK4Q5.js → chunk-BWM3ZYWS.js} +1 -1
- package/dist/bundle/chunks/{chunk-GJFZM2RZ.js → chunk-D2CMHQWH.js} +9 -9
- package/dist/bundle/chunks/chunk-DGLLW4Y4.js +1590 -0
- package/dist/bundle/chunks/{chunk-N4CTF6DK.js → chunk-ECEUFETK.js} +1 -1
- package/dist/bundle/chunks/{chunk-3UW3IQIY.js → chunk-FA5D3PPT.js} +1 -1
- package/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/bundle/chunks/{chunk-OW4KH7CI.js → chunk-H36DQSY7.js} +1 -1
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/bundle/chunks/chunk-IYMNLY6C.js +4 -0
- package/dist/bundle/chunks/chunk-M4NMEBFE.js +2 -0
- package/dist/bundle/chunks/chunk-P4REYYCM.js +55 -0
- package/dist/bundle/chunks/chunk-RRE46THK.js +35 -0
- package/dist/bundle/chunks/chunk-RZHIIJ2O.js +2 -0
- package/dist/bundle/chunks/chunk-SHIWNICN.js +8 -0
- package/dist/bundle/chunks/{chunk-WATJAG5U.js → chunk-TCESBBFS.js} +1 -1
- package/dist/bundle/chunks/{chunk-GO33PKBT.js → chunk-V5KN6SNQ.js} +1 -1
- package/dist/bundle/chunks/chunk-V7WCKBVO.js +19 -0
- package/dist/bundle/chunks/{chunk-OXKIVFVM.js → chunk-VZFAYNKC.js} +1 -1
- package/dist/bundle/chunks/{chunk-JM6XUN2B.js → chunk-YAD6BXOQ.js} +5 -1
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/{cli-2Q4CKMZK.js → cli-OTDOMRGW.js} +7 -7
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEJELFEJ.js → cloudflare-workers-ai-system-one-6TWKBBSR.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-UEH5CVEM.js → easter-egg-3d-FREKSIW6.js} +1 -1
- package/dist/bundle/chunks/{execute-BOGNP5CQ.js → execute-MJMW76MP.js} +5 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-antigravity-runtime.js +2 -2
- package/dist/bundle/chunks/{google-generative-ai-UTHMOBSC.js → google-generative-ai-YSOYXY5K.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-MKY2BEE7.js → google-vertex-X3ELXR2J.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-CYHVVBOQ.js → llama-cpp-classify-R6PVLK5I.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-U2CRJEWX.js → mistral-conversations-J4IL2HMK.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-GULSUKQ4.js +10 -0
- package/dist/bundle/chunks/{openai-completions-VPNLDI5K.js → openai-completions-ZGWBSKNR.js} +3 -3
- package/dist/bundle/chunks/{openai-decisions-UZ6HF7LF.js → openai-decisions-BU2ER6AQ.js} +1 -1
- package/dist/bundle/chunks/openai-responses-WDSDROXC.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-P5CYCO4P.js → openrouter-images-MK6H7N26.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-XPX326L5.js → pi-messages-7PPZFV3U.js} +1 -1
- package/dist/bundle/chunks/{runtime-2Z3FBQRD.js → runtime-X3ZHEI2F.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-NKVLMGFF.js → typesafe-system-one-LXDZKNJW.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-J7Z5J7IR.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.js +1 -1
- 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 +234 -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 +74 -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/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +3 -1
- package/dist/cli/config-selector.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 +17 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +25 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +137 -54
- 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 -97
- package/dist/core/cache-warmer.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/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 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +9 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +28 -6
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +12 -37
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +42 -121
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +52 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +20 -19
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +8 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +10 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +50 -5
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +4 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +1 -0
- package/dist/core/pi-server-client.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/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 +6 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +8 -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/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/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/session-cwd.d.ts +7 -0
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +9 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -6
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +34 -9
- 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.map +1 -1
- package/dist/core/tools/edit.js +8 -7
- package/dist/core/tools/edit.js.map +1 -1
- 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 +5 -3
- 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.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 +8 -0
- 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/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/extensions/codemode/execute.js +4 -4
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +34 -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/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +15 -3
- package/dist/extensions/llama/ui.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 +49 -14
- 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 +4 -3
- 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 -319
- 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/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +18 -6
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +63 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -4
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -4
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +5 -2
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +10 -3
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +11 -5
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +9 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -18
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts +2 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +25 -20
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +14 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -5
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
- package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
- package/dist/modes/interactive/components/provider-brand.js +66 -0
- package/dist/modes/interactive/components/provider-brand.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +6 -37
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +12 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +19 -10
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +164 -91
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +4 -0
- package/dist/modes/interactive/theme/theme.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 +39 -8
- package/dist/package-manager-cli.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 -6
- package/dist/utils/changelog.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/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/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.md +14 -1
- package/docs/extensions.md +27 -7
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +5 -8
- package/docs/models-configuration.md +6 -1
- package/docs/models.md +2 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/rpc.md +4 -2
- package/docs/sessions.md +7 -1
- package/docs/settings.md +1 -1
- package/docs/tui.md +1 -1
- 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 +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/index.ts +23 -13
- package/examples/extensions/plan-mode/utils.ts +42 -16
- package/examples/extensions/subagent/README.md +14 -11
- package/examples/extensions/subagent/index.ts +392 -171
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +63 -35
- package/package.json +7 -7
- package/schemas/models.schema.json +29 -0
- package/schemas/settings.schema.json +1 -1
- package/dist/bundle/chunks/anthropic-messages-WU4RRDFO.js +0 -6
- package/dist/bundle/chunks/chunk-4RKLODCT.js +0 -2
- package/dist/bundle/chunks/chunk-G23G7KNC.js +0 -4
- package/dist/bundle/chunks/chunk-LTLKVIE2.js +0 -65
- package/dist/bundle/chunks/chunk-O5CTLHDX.js +0 -82
- package/dist/bundle/chunks/chunk-OV4EHN3Q.js +0 -2
- package/dist/bundle/chunks/chunk-PWQUNMKT.js +0 -4
- package/dist/bundle/chunks/chunk-TTZH2HU3.js +0 -1590
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/bundle/chunks/chunk-YH5RGRHQ.js +0 -7
- package/dist/bundle/chunks/openai-codex-responses-DK2NKO47.js +0 -10
- package/dist/bundle/chunks/openai-responses-S5QT5K5D.js +0 -4
- package/dist/bundle/chunks/virtual-modules-34ID7AB7.js +0 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createInterface } from "node:readline/promises";
|
|
2
|
+
/** Read one line from stdin, rejecting on abort, Ctrl+C, or EOF and always closing readline. */
|
|
3
|
+
export async function questionTerminal(message, options) {
|
|
4
|
+
const readline = createInterface({ input: process.stdin, output: options.output });
|
|
5
|
+
const interrupted = new AbortController();
|
|
6
|
+
// EOF closes readline without settling its pending question; Ctrl+C normally only pauses it.
|
|
7
|
+
const onInterrupt = () => interrupted.abort();
|
|
8
|
+
readline.on("SIGINT", onInterrupt);
|
|
9
|
+
readline.on("close", onInterrupt);
|
|
10
|
+
try {
|
|
11
|
+
return await readline.question(message, { signal: AbortSignal.any([options.signal, interrupted.signal]) });
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (interrupted.signal.aborted)
|
|
15
|
+
options.onInterrupt?.();
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
readline.off("close", onInterrupt);
|
|
20
|
+
readline.off("SIGINT", onInterrupt);
|
|
21
|
+
readline.close();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=terminal-question.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-question.js","sourceRoot":"","sources":["../../src/utils/terminal-question.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,gGAAgG;AAChG,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAAe,EACf,OAKC;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnF,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;IAC1C,6FAA6F;IAC7F,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAClC,IAAI,CAAC;QACJ,OAAO,MAAM,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO;YAAE,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QACxD,MAAM,KAAK,CAAC;IACb,CAAC;YAAS,CAAC;QACV,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACnC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACpC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACF,CAAC","sourcesContent":["import { createInterface } from \"node:readline/promises\";\n\n/** Read one line from stdin, rejecting on abort, Ctrl+C, or EOF and always closing readline. */\nexport async function questionTerminal(\n\tmessage: string,\n\toptions: {\n\t\toutput: NodeJS.WritableStream;\n\t\tsignal: AbortSignal;\n\t\t/** Called on Ctrl+C or EOF, not when the caller aborts just this prompt. */\n\t\tonInterrupt?: () => void;\n\t},\n): Promise<string> {\n\tconst readline = createInterface({ input: process.stdin, output: options.output });\n\tconst interrupted = new AbortController();\n\t// EOF closes readline without settling its pending question; Ctrl+C normally only pauses it.\n\tconst onInterrupt = () => interrupted.abort();\n\treadline.on(\"SIGINT\", onInterrupt);\n\treadline.on(\"close\", onInterrupt);\n\ttry {\n\t\treturn await readline.question(message, { signal: AbortSignal.any([options.signal, interrupted.signal]) });\n\t} catch (error) {\n\t\tif (interrupted.signal.aborted) options.onInterrupt?.();\n\t\tthrow error;\n\t} finally {\n\t\treadline.off(\"close\", onInterrupt);\n\t\treadline.off(\"SIGINT\", onInterrupt);\n\t\treadline.close();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `http:` or `https:` URL `value` names, normalized, or undefined. The shared launcher also opens files and custom
|
|
3
|
+
* protocols, so login only opens web URLs. Normalizing percent-encodes control characters, which would otherwise end a
|
|
4
|
+
* terminal hyperlink early.
|
|
5
|
+
*/
|
|
6
|
+
export declare function webUrl(value: string): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* `value` normalized as a web URL, else with control characters replaced: an untrusted string printed as is could end a
|
|
9
|
+
* hyperlink early or send its own escape sequences to the terminal.
|
|
10
|
+
*/
|
|
11
|
+
export declare function displayUrl(value: string): string;
|
|
12
|
+
//# sourceMappingURL=web-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-url.d.ts","sourceRoot":"","sources":["../../src/utils/web-url.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { replaceControlCharacters } from "@earendil-works/pi-tui";
|
|
2
|
+
/**
|
|
3
|
+
* The `http:` or `https:` URL `value` names, normalized, or undefined. The shared launcher also opens files and custom
|
|
4
|
+
* protocols, so login only opens web URLs. Normalizing percent-encodes control characters, which would otherwise end a
|
|
5
|
+
* terminal hyperlink early.
|
|
6
|
+
*/
|
|
7
|
+
export function webUrl(value) {
|
|
8
|
+
if (!URL.canParse(value))
|
|
9
|
+
return undefined;
|
|
10
|
+
const url = new URL(value);
|
|
11
|
+
return url.protocol === "https:" || url.protocol === "http:" ? url.href : undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `value` normalized as a web URL, else with control characters replaced: an untrusted string printed as is could end a
|
|
15
|
+
* hyperlink early or send its own escape sequences to the terminal.
|
|
16
|
+
*/
|
|
17
|
+
export function displayUrl(value) {
|
|
18
|
+
return webUrl(value) ?? replaceControlCharacters(value);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=web-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-url.js","sourceRoot":"","sources":["../../src/utils/web-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa;IACnC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACvC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import { replaceControlCharacters } from \"@earendil-works/pi-tui\";\n\n/**\n * The `http:` or `https:` URL `value` names, normalized, or undefined. The shared launcher also opens files and custom\n * protocols, so login only opens web URLs. Normalizing percent-encodes control characters, which would otherwise end a\n * terminal hyperlink early.\n */\nexport function webUrl(value: string): string | undefined {\n\tif (!URL.canParse(value)) return undefined;\n\tconst url = new URL(value);\n\treturn url.protocol === \"https:\" || url.protocol === \"http:\" ? url.href : undefined;\n}\n\n/**\n * `value` normalized as a web URL, else with control characters replaced: an untrusted string printed as is could end a\n * hyperlink early or send its own escape sequences to the terminal.\n */\nexport function displayUrl(value: string): string {\n\treturn webUrl(value) ?? replaceControlCharacters(value);\n}\n"]}
|
package/docs/cli.md
CHANGED
|
@@ -12,6 +12,8 @@ pi uninstall <source> [options]
|
|
|
12
12
|
pi update [target] [options]
|
|
13
13
|
pi list
|
|
14
14
|
pi config [options]
|
|
15
|
+
pi auth login <provider> [--api-key] [--no-browser]
|
|
16
|
+
pi auth logout <provider>
|
|
15
17
|
pi auth <check|print-api-key|print-bearer-token> [options]
|
|
16
18
|
pi mcp <add|remove|list|login|logout> [options]
|
|
17
19
|
```
|
|
@@ -302,11 +304,22 @@ export PI_SELF_UPDATE_COMMAND="mise use -g npm:{packageName}@{version}"
|
|
|
302
304
|
|
|
303
305
|
## Credential commands
|
|
304
306
|
|
|
307
|
+
`pi auth login <provider>` logs in to a provider in the terminal and exits, without starting a session. It signs in with an account and opens the browser, like `/login <provider>`. Providers without account sign-in ask for an API key. Logging in to Radius also adds the Radius MCP server to `~/.pi/agent/mcp.json` when no global server uses that login yet. It requires an interactive terminal.
|
|
308
|
+
|
|
309
|
+
| Option | Description |
|
|
310
|
+
|---|---|
|
|
311
|
+
| `--api-key` | Save an API key instead of signing in with an account; the key is read without echoing it |
|
|
312
|
+
| `--no-browser` | Do not open a browser; use the provider's other sign-in method, such as a device code, for example over SSH. Asks when there are several. Not allowed with `--api-key` |
|
|
313
|
+
|
|
314
|
+
`pi auth logout <provider>` removes the credentials that `pi auth login` or `/login` stored, like `/logout`. Environment variables and `models.json` config are unchanged. It exits with status `0` when nothing is stored, so it is safe to repeat.
|
|
315
|
+
|
|
305
316
|
```sh
|
|
317
|
+
pi auth login radius
|
|
318
|
+
pi auth logout radius
|
|
306
319
|
pi auth check --provider openai --json
|
|
307
320
|
```
|
|
308
321
|
|
|
309
|
-
|
|
322
|
+
The other authentication commands require `--provider <provider>` or `--model <model>`. See [Providers](providers.md) for supported methods.
|
|
310
323
|
|
|
311
324
|
| Command | Description |
|
|
312
325
|
|---|---|
|
package/docs/extensions.md
CHANGED
|
@@ -880,6 +880,8 @@ pi.on("before_provider_request", (event, ctx) => {
|
|
|
880
880
|
|
|
881
881
|
This is mainly useful for debugging provider serialization and cache behavior.
|
|
882
882
|
|
|
883
|
+
The payload is the full request. Providers that continue from a previous response (OpenAI Codex over WebSocket, Anthropic message threads) may send only the part that is new since the previous request.
|
|
884
|
+
|
|
883
885
|
#### after_provider_response
|
|
884
886
|
|
|
885
887
|
Fired after an HTTP response is received and before its stream body is consumed. Handlers run in extension load order.
|
|
@@ -1261,7 +1263,7 @@ Control flow helpers. `ctx.isIdle()` is false while Pi is processing an agent ru
|
|
|
1261
1263
|
Request a graceful shutdown of pi.
|
|
1262
1264
|
|
|
1263
1265
|
- **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
|
|
1264
|
-
- **RPC mode:**
|
|
1266
|
+
- **RPC mode:** Runs right away when the session is idle and no command is being handled. Otherwise deferred until the current command finishes (including its response) or the active run settles. (A request made while an extension-started compaction is running waits for the next command or run to finish.)
|
|
1265
1267
|
- **Print mode:** No-op. The process exits automatically when all prompts are processed.
|
|
1266
1268
|
|
|
1267
1269
|
Emits `session_shutdown` event to all extensions before exiting. Available in all contexts (event handlers, tools, commands, shortcuts).
|
|
@@ -1806,16 +1808,25 @@ mode and would not execute if sent via `prompt`.
|
|
|
1806
1808
|
|
|
1807
1809
|
Register a custom TUI renderer for custom messages with your `customType`. Custom messages are created with `pi.sendMessage()` and participate in LLM context. See [Custom UI](#custom-ui).
|
|
1808
1810
|
|
|
1809
|
-
### pi.registerMarkdownTransformer(transformer)
|
|
1811
|
+
### pi.registerMarkdownTransformer(transformer, options?)
|
|
1812
|
+
|
|
1813
|
+
Register a transformer for Markdown before Pi renders it in interactive mode. Transformers run in extension load order, and each transformer receives the Markdown returned by the previous transformer. After the chain finishes, Pi renders the transformed content with its built-in renderer.
|
|
1810
1814
|
|
|
1811
|
-
|
|
1815
|
+
By default a transformer runs on normal user text, assistant text, and thinking blocks. `options.messageTypes` lists the surfaces it runs on instead:
|
|
1816
|
+
|
|
1817
|
+
| `messageType` | Surface |
|
|
1818
|
+
|---------------|---------|
|
|
1819
|
+
| `"user"`, `"assistant"`, `"assistant-thinking"` | Transcript messages (default) |
|
|
1820
|
+
| `"custom"` | Custom messages from `pi.sendMessage()` without a registered message renderer, and expanded skill blocks (their content, without Pi's header) |
|
|
1821
|
+
| `"summary"` | Expanded branch and compaction summaries (the summary, without Pi's header) |
|
|
1822
|
+
| `"changelog"` | Pi's changelog ("What's New" at startup and `/changelog`), the startup "Extension Updates" notice, and the release note of the "Update Available" notice |
|
|
1812
1823
|
|
|
1813
1824
|
The transformer receives the Markdown string and a context with:
|
|
1814
1825
|
|
|
1815
|
-
- `messageType` —
|
|
1816
|
-
- `isStreaming` — `true` for partial assistant updates; `false`
|
|
1826
|
+
- `messageType` — one of the surfaces above
|
|
1827
|
+
- `isStreaming` — `true` for partial assistant updates; `false` otherwise
|
|
1817
1828
|
- `availableWidth` — exact terminal columns available for the transformed Markdown content
|
|
1818
|
-
- `messageId`, `timestamp` — session-entry ID and ISO timestamp when rendering from persisted session entries; `undefined` for live messages
|
|
1829
|
+
- `messageId`, `timestamp` — session-entry ID and ISO timestamp when rendering from persisted session entries; `undefined` for live messages and notices
|
|
1819
1830
|
|
|
1820
1831
|
Return the transformed Markdown:
|
|
1821
1832
|
|
|
@@ -1824,9 +1835,14 @@ pi.registerMarkdownTransformer((markdown, { messageType, isStreaming }) => {
|
|
|
1824
1835
|
if (isStreaming || messageType === "assistant-thinking") return markdown;
|
|
1825
1836
|
return markdown.replaceAll("-->", "→");
|
|
1826
1837
|
});
|
|
1838
|
+
|
|
1839
|
+
// Show :warning: shortcodes in changelogs as a symbol.
|
|
1840
|
+
pi.registerMarkdownTransformer((markdown) => markdown.replaceAll(":warning:", "⚠"), {
|
|
1841
|
+
messageTypes: ["changelog"],
|
|
1842
|
+
});
|
|
1827
1843
|
```
|
|
1828
1844
|
|
|
1829
|
-
If a transformer throws, Pi keeps the Markdown produced so far and continues with the next transformer. The hook is display-only: the original message remains unchanged in the session and model context. It runs for new
|
|
1845
|
+
If a transformer throws, Pi keeps the Markdown produced so far and continues with the next transformer. The hook is display-only: the original message remains unchanged in the session and model context. It runs for new messages, assistant streaming updates, restored session messages, and terminal width changes, so transformers should remain synchronous and inexpensive. An extension has one transformer; registering again replaces it.
|
|
1830
1846
|
|
|
1831
1847
|
### pi.registerEntryRenderer(customType, renderer)
|
|
1832
1848
|
|
|
@@ -2400,10 +2416,14 @@ pi.registerTool({
|
|
|
2400
2416
|
});
|
|
2401
2417
|
```
|
|
2402
2418
|
|
|
2419
|
+
`ReadOperations.createReadStream` is optional. When it returns the file as an async iterable of chunks (a Node `Readable` works), `read` keeps only the lines it shows in memory, so large files can be read with `offset`/`limit`; without it, `read` loads the whole file through `readFile`.
|
|
2420
|
+
|
|
2403
2421
|
The `create*ToolDefinition()` factories, such as `createReadToolDefinition()`, return complete tool definitions, including the built-in prompt snippet and guidelines, for the same purpose. Rendering does not need copying: a tool registered under a built-in name inherits the built-in renderer for each slot it leaves out (see [Overriding Built-in Tools](#overriding-built-in-tools)).
|
|
2404
2422
|
|
|
2405
2423
|
**Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `PowerShellOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
|
|
2406
2424
|
|
|
2425
|
+
`GrepOperations` only covers the directory check: grep always runs the local `rg`. To search a remote system, override grep's `execute()` instead, as the [Gondolin example](../examples/extensions/gondolin/index.ts) does.
|
|
2426
|
+
|
|
2407
2427
|
For `user_bash`, extensions can reuse Pi's local shell backend via `createLocalBashOperations()` (or `createLocalPowerShellOperations()`) instead of reimplementing local process spawning, shell resolution, and process-tree termination.
|
|
2408
2428
|
|
|
2409
2429
|
The `bash` and `powershell` tools also support a spawn hook to adjust the command, cwd, or env before execution:
|
package/docs/keybindings.md
CHANGED
|
@@ -126,7 +126,7 @@ In fullscreen mode, these actions control the transcript and take precedence ove
|
|
|
126
126
|
| `app.exit` | `ctrl+d` | Exit (when editor empty) |
|
|
127
127
|
| `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
|
|
128
128
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
|
|
129
|
-
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
|
|
129
|
+
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v`, `ctrl+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
|
|
130
130
|
|
|
131
131
|
On native Windows, `app.suspend` has no default because Windows terminals do not support Unix job control. If you assign it manually, Pi shows a status message instead of suspending. WSL uses the normal `ctrl+z` and `fg` behavior.
|
|
132
132
|
|
package/docs/llama-cpp.md
CHANGED
|
@@ -13,7 +13,7 @@ curl -LsSf https://llama.app/install.sh | sh
|
|
|
13
13
|
Verify the installation:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
llama
|
|
16
|
+
llama --version
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
See [llama.app](https://llama.app) for other installation methods, including package managers and building from source.
|
|
@@ -25,8 +25,6 @@ Start `llama serve` without `--model`, `-m`, or `-hf`. Passing a model starts si
|
|
|
25
25
|
```bash
|
|
26
26
|
llama serve \
|
|
27
27
|
--no-models-autoload \
|
|
28
|
-
--host 127.0.0.1 \
|
|
29
|
-
--port 8080 \
|
|
30
28
|
-ngl all \
|
|
31
29
|
-c 32768
|
|
32
30
|
```
|
|
@@ -34,7 +32,6 @@ llama serve \
|
|
|
34
32
|
Important options:
|
|
35
33
|
|
|
36
34
|
- `--no-models-autoload` keeps loading explicit through `/llama`.
|
|
37
|
-
- `--jinja` enables compatible chat templates and tool calling.
|
|
38
35
|
- `-ngl all` offloads all layers to the GPU. Omit it to use automatic GPU offloading.
|
|
39
36
|
- `-c 32768` sets the context size in tokens. Use `-c 0` for the model's full context window, which may require substantially more memory. Context is shared across parallel server slots.
|
|
40
37
|
|
|
@@ -62,14 +59,14 @@ Start Pi and configure the provider:
|
|
|
62
59
|
/login llama.cpp
|
|
63
60
|
```
|
|
64
61
|
|
|
65
|
-
Enter the router URL and optional API key. The default URL is `http://127.0.0.1:
|
|
62
|
+
Enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931`.
|
|
66
63
|
|
|
67
64
|
If you start the router with `--no-models-autoload`, `/login llama.cpp` only stores the connection. Run `/llama` to load a model, then `/model` to select the loaded model for the current session.
|
|
68
65
|
|
|
69
66
|
Environment variables can configure the same values without `/login`:
|
|
70
67
|
|
|
71
68
|
```bash
|
|
72
|
-
export LLAMA_BASE_URL=http://127.0.0.1:
|
|
69
|
+
export LLAMA_BASE_URL=http://127.0.0.1:9931
|
|
73
70
|
export LLAMA_API_KEY=optional-secret
|
|
74
71
|
pi
|
|
75
72
|
```
|
|
@@ -120,8 +117,8 @@ The model does not generate an answer. Each question becomes one chat prompt: th
|
|
|
120
117
|
Check that the router is reachable:
|
|
121
118
|
|
|
122
119
|
```bash
|
|
123
|
-
curl http://127.0.0.1:
|
|
124
|
-
curl http://127.0.0.1:
|
|
120
|
+
curl http://127.0.0.1:9931/health
|
|
121
|
+
curl http://127.0.0.1:9931/models
|
|
125
122
|
```
|
|
126
123
|
|
|
127
124
|
- **No models in `/llama`:** Check `--models-dir`, the directory layout, and restart the router.
|
|
@@ -118,6 +118,8 @@ See [Describe model input and caching](models.md#describe-model-input-and-cachin
|
|
|
118
118
|
| `maxTokensField` | `"max_completion_tokens" \| "max_tokens"` | | Which field to use for max tokens. Default: auto-detected from URL. |
|
|
119
119
|
| `requiresToolResultName` | boolean | | Whether tool results require the name field. Default: auto-detected from URL. |
|
|
120
120
|
| `requiresAssistantAfterToolResult` | boolean | | Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL. |
|
|
121
|
+
| `requiresNonNullAssistantContent` | boolean | | Whether replayed assistant messages with no text (e.g. tool-call-only messages) must send "" instead of null content. Default: false. |
|
|
122
|
+
| `requiresToolsWithToolHistory` | boolean | | Whether requests without tools must send "tools": [] when the conversation contains tool calls or tool results. Needed by some proxies in front of Anthropic, such as older LiteLLM versions. Default: false, the field is omitted. |
|
|
121
123
|
| `requiresThinkingAsText` | boolean | | Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL. |
|
|
122
124
|
| `requiresReasoningContentOnAssistantMessages` | boolean | | Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. |
|
|
123
125
|
| `thinkingFormat` | `"openai" \| "openrouter" \| "deepseek" \| "together" \| "baseten" \| "zai" \| "qwen" \| "chat-template" \| "qwen-chat-template" \| "string-thinking" \| "ant-ling"` | | Format for reasoning or thinking parameters. When omitted, Pi auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null. |
|
|
@@ -135,6 +137,7 @@ See [Describe model input and caching](models.md#describe-model-input-and-cachin
|
|
|
135
137
|
| `cacheControlFormat` | `"anthropic"` | | Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content. |
|
|
136
138
|
| `sendSessionAffinityHeaders` | boolean | | Whether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise. |
|
|
137
139
|
| `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
|
|
140
|
+
| `promptCacheKeyMode` | `"auto" \| "enabled" \| "disabled"` | | Controls the prompt_cache_key request field. auto sends it to api.openai.com, or with long cache retention when supportsLongCacheRetention is true; enabled sends it whenever caching is active, for compatible proxies; disabled never sends it. Default: auto. |
|
|
138
141
|
| `supportsLongCacheRetention` | boolean | | Whether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL. |
|
|
139
142
|
| `vllmPriority` | number | | vLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog. |
|
|
140
143
|
|
|
@@ -146,7 +149,8 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
|
|
|
146
149
|
|---|---|---|---|
|
|
147
150
|
| `supportsDeveloperRole` | boolean | `true` | Whether the provider supports the developer role instead of system. |
|
|
148
151
|
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models. |
|
|
149
|
-
| `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends
|
|
152
|
+
| `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session-id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
|
|
153
|
+
| `promptCacheKeyMode` | `"auto" \| "enabled" \| "disabled"` | | Controls the prompt_cache_key request field. auto and enabled send it whenever caching is active; disabled never sends it, for compatible proxies that reject it. Default: auto. |
|
|
150
154
|
| `supportsLongCacheRetention` | boolean | `true` | Whether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models. |
|
|
151
155
|
| `supportsStrictMode` | boolean | | Whether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly. |
|
|
152
156
|
| `supportsOpenAIGrammarTools` | boolean | `false` | Whether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models. |
|
|
@@ -172,6 +176,7 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
|
|
|
172
176
|
| `supportsMidConvoEffort` | boolean | `false` | Whether the exact model transport supports effort-only system messages and thinking binding controls. |
|
|
173
177
|
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt. |
|
|
174
178
|
| `supportsMidConvoToolChanges` | boolean | `false` | Whether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages. |
|
|
179
|
+
| `supportsMessageThreads` | boolean | | Whether the endpoint supports Anthropic message threads, which let a request with a session id send only the new messages and continue from the previous reply. Default: true for provider anthropic with a baseUrl on api.anthropic.com, false otherwise. Set true for gateways that forward the thread request field. |
|
|
175
180
|
| `allowedFallbackModels` | `object[]` | | Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets. |
|
|
176
181
|
|
|
177
182
|
### `bedrock-converse-stream`
|
package/docs/models.md
CHANGED
|
@@ -141,7 +141,7 @@ Compatibility settings should describe verified differences in the endpoint's re
|
|
|
141
141
|
|
|
142
142
|
## Use classifier models
|
|
143
143
|
|
|
144
|
-
Classifier models do not chat. They answer typed questions about JSON state: pick one of several choices, answer yes or no, or give a score, each with probabilities. Pi includes TypeSafe's Jev model from these providers, Cloudflare's Clef, Clef Flash, and Clef Omni models from Workers AI and OpenRouter,
|
|
144
|
+
Classifier models do not chat. They answer typed questions about JSON state: pick one of several choices, answer yes or no, or give a score, each with probabilities. Pi includes TypeSafe's Jev model from these providers, Cloudflare's Clef, Clef Flash, and Clef Omni models from Workers AI and OpenRouter, OpenAI's GPT-6 Luna through the [Decisions API](https://developers.openai.com/api/docs/guides/decisions), and Microsoft-Decision-1 through GitHub Copilot:
|
|
145
145
|
|
|
146
146
|
| Provider | Model IDs | Authentication |
|
|
147
147
|
|---|---|---|
|
|
@@ -151,6 +151,7 @@ Classifier models do not chat. They answer typed questions about JSON state: pic
|
|
|
151
151
|
| `vercel-ai-gateway` | `typesafe-ai/jev` | `AI_GATEWAY_API_KEY` |
|
|
152
152
|
| `opencode` | `jev-1.13`, `jev-1.13-free` | `OPENCODE_API_KEY` |
|
|
153
153
|
| `openai` | `gpt-6-luna` | `OPENAI_API_KEY` |
|
|
154
|
+
| `github-copilot` | `microsoft-decision-1` | `COPILOT_GITHUB_TOKEN` or `/login` |
|
|
154
155
|
|
|
155
156
|
Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed as classifier models.
|
|
156
157
|
|
package/docs/prompt-templates.md
CHANGED
|
@@ -46,7 +46,7 @@ Templates support these substitutions:
|
|
|
46
46
|
| `${@:N}` | Arguments starting at position `N` |
|
|
47
47
|
| `${@:N:L}` | `L` arguments starting at position `N` |
|
|
48
48
|
|
|
49
|
-
Arguments follow shell-like quoting, so `/review "API compatibility"` supplies one argument containing a space.
|
|
49
|
+
Arguments follow shell-like quoting, so `/review "API compatibility"` supplies one argument containing a space. A quote only starts quoting at the beginning of an argument, so apostrophes inside words such as `doesn't` stay as text, and a quote with no closing match is kept as text. Inside a quoted argument, a backslash before the same quote character keeps it as text, so `/review "the \"fast\" path"` supplies `the "fast" path`; other backslashes are kept as typed.
|
|
50
50
|
|
|
51
51
|
<a id="choose-where-it-loads"></a>
|
|
52
52
|
|
package/docs/providers.md
CHANGED
|
@@ -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` |
|
package/docs/rpc.md
CHANGED
|
@@ -90,9 +90,11 @@ Clients must also handle child-process startup failures, unexpected exits, stder
|
|
|
90
90
|
|
|
91
91
|
## Shutdown
|
|
92
92
|
|
|
93
|
-
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.
|
|
93
|
+
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.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
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.)
|
|
96
98
|
|
|
97
99
|
## Minimal client
|
|
98
100
|
|
package/docs/sessions.md
CHANGED
|
@@ -21,7 +21,13 @@ Each session records the working directory it was created in and never changes i
|
|
|
21
21
|
| `--resume`, `/resume`, `--session`, `/import` | The session's working directory, which can differ from the current directory |
|
|
22
22
|
| `--fork`, or a `--session` ID from another directory that you choose to fork | The current directory, in a new session |
|
|
23
23
|
|
|
24
|
-
If a session's working directory no longer exists,
|
|
24
|
+
If a session's working directory no longer exists, for example after the project folder was renamed, interactive mode asks how to open it:
|
|
25
|
+
|
|
26
|
+
- **Continue** runs the session in the current directory. Pi does not store that choice, so it asks again the next time you open the session.
|
|
27
|
+
- **Fork** copies the session into the current directory as a new session with a new ID, like `--fork`. The original stays unchanged. At startup the copy is stored like other new sessions for the current directory; from `/resume` or `/import` it is stored next to the current session, like `/new`.
|
|
28
|
+
- **Cancel** leaves the current session open, or exits at startup.
|
|
29
|
+
|
|
30
|
+
Other modes exit with an error.
|
|
25
31
|
|
|
26
32
|
Use `/name` or `--name` to assign a recognizable session name. Run `/session` to verify the current session file, ID, message count, token usage, and cost.
|
|
27
33
|
|
package/docs/settings.md
CHANGED
|
@@ -18,7 +18,7 @@ Add `"$schema": "https://pi.dev/schemas/settings.schema.json"` to `settings.json
|
|
|
18
18
|
| `enabledModels` | `string[]` | All available models | Model patterns used for startup selection and model cycling. Uses the same format as `--models`. |
|
|
19
19
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in the transcript. |
|
|
20
20
|
| `showCacheMissNotices` | boolean | `false` | Show notices for significant cache misses, successful cache warming, compaction usage, and provider recovery. |
|
|
21
|
-
| `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"
|
|
21
|
+
| `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"idle"` | Keep eligible provider prompt caches warm during active runs and, with `"idle"`, for up to 30 minutes between runs. `"streaming"` warms only during active runs. Global setting only. |
|
|
22
22
|
|
|
23
23
|
Cache warming runs only when the model declares a cache lifetime and Pi estimates at least $0.05 in avoided cache-miss cost. Refresh usage counts toward session totals but does not enter model context. `/session` shows the next decision; extensions can override it with `cache_warming_decision`. See [Prompt Cache Lifetimes](models.md#prompt-cache-lifetimes).
|
|
24
24
|
|
package/docs/tui.md
CHANGED
|
@@ -135,7 +135,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
135
135
|
|
|
136
136
|
This component does not display a text cursor, so it does not need `Focusable`. A component containing `Input` or `Editor` must implement `Focusable` and propagate its `focused` value to that child.
|
|
137
137
|
|
|
138
|
-
Custom components do not report pi as waiting for the user, because `ctx.ui.custom()` also hosts loaders and other non-blocking UI. When
|
|
138
|
+
Custom components do not report pi as waiting for the user, because `ctx.ui.custom()` also hosts loaders and other non-blocking UI. When a component waits for an answer, pass `blocked: { kind: "question", message: "Pick a color" }` so terminals that support [program status](terminal-setup.md#program-status) show pi as blocked. `kind` is `"question"`, `"permission"`, or `"auth"`. An inline component reports blocked while it is visible: a newer dialog or component shown in its place reports its own status instead. An overlay reports blocked from when it is shown until it calls `done()`, also while it is hidden with `setHidden()` or covered by another overlay. When several blocking prompts are open, the most recently shown one supplies `kind` and `message`.
|
|
139
139
|
|
|
140
140
|
Pass `overlay: true` to draw above existing content. Overlay options control size, anchors, offsets, margins, and responsive visibility. An overlay handle can change focus or temporarily hide and show the overlay with `setHidden()` while the interaction remains active.
|
|
141
141
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
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.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
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.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.14.0"
|
|
12
12
|
}
|
|
@@ -16,7 +16,7 @@ import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
|
16
16
|
import type { AssistantMessage, TextContent } from "@earendil-works/pi-ai";
|
|
17
17
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
18
18
|
import { Key } from "@earendil-works/pi-tui";
|
|
19
|
-
import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
|
|
19
|
+
import { allStepsComplete, extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
|
|
20
20
|
|
|
21
21
|
// Tools
|
|
22
22
|
const PLAN_MODE_TOOLS = ["read", "bash", "grep", "find", "ls", "questionnaire"];
|
|
@@ -36,11 +36,16 @@ function isAssistantMessage(m: AgentMessage): m is AssistantMessage {
|
|
|
36
36
|
return m.role === "assistant" && Array.isArray(m.content);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Extract text content from an assistant message
|
|
39
|
+
// Extract text content from an assistant message.
|
|
40
|
+
// Includes thinking blocks: with reasoning-max models the [DONE:n] tags and
|
|
41
|
+
// plan drafts usually land in thinking, not the visible text.
|
|
40
42
|
function getTextContent(message: AssistantMessage): string {
|
|
41
43
|
return message.content
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
+
.map((block) => {
|
|
45
|
+
if (block.type === "text") return block.text;
|
|
46
|
+
if (block.type === "thinking") return (block as { thinking?: string }).thinking ?? "";
|
|
47
|
+
return "";
|
|
48
|
+
})
|
|
44
49
|
.join("\n");
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -70,12 +75,11 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
70
75
|
// Widget showing todo list
|
|
71
76
|
if (executionMode && todoItems.length > 0) {
|
|
72
77
|
const lines = todoItems.map((item) => {
|
|
78
|
+
const text = item.text.length > 60 ? `${item.text.slice(0, 57)}...` : item.text;
|
|
73
79
|
if (item.completed) {
|
|
74
|
-
return (
|
|
75
|
-
ctx.ui.theme.fg("success", "☑ ") + ctx.ui.theme.fg("muted", ctx.ui.theme.strikethrough(item.text))
|
|
76
|
-
);
|
|
80
|
+
return ctx.ui.theme.fg("success", "☑ ") + ctx.ui.theme.fg("muted", ctx.ui.theme.strikethrough(text));
|
|
77
81
|
}
|
|
78
|
-
return `${ctx.ui.theme.fg("muted", "☐ ")}${
|
|
82
|
+
return `${ctx.ui.theme.fg("muted", "☐ ")}${text}`;
|
|
79
83
|
});
|
|
80
84
|
ctx.ui.setWidget("plan-todos", lines);
|
|
81
85
|
} else {
|
|
@@ -255,10 +259,9 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
255
259
|
if (!executionMode || todoItems.length === 0) return;
|
|
256
260
|
if (!isAssistantMessage(event.message)) return;
|
|
257
261
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
+
markCompletedSteps(getTextContent(event.message), todoItems);
|
|
263
|
+
// Always refresh: cheap, keeps the widget consistent even when nothing matched.
|
|
264
|
+
updateStatus(ctx);
|
|
262
265
|
persistState();
|
|
263
266
|
});
|
|
264
267
|
|
|
@@ -266,11 +269,18 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
266
269
|
pi.on("agent_end", async (event, ctx) => {
|
|
267
270
|
// Check if execution is complete
|
|
268
271
|
if (executionMode && todoItems.length > 0) {
|
|
272
|
+
// Fallback: the model wrapped up without [DONE:n] tags ("All steps complete").
|
|
273
|
+
const lastAssistant = [...event.messages].reverse().find(isAssistantMessage);
|
|
274
|
+
if (lastAssistant && allStepsComplete(getTextContent(lastAssistant))) {
|
|
275
|
+
for (const t of todoItems) t.completed = true;
|
|
276
|
+
}
|
|
269
277
|
if (todoItems.every((t) => t.completed)) {
|
|
270
278
|
const completedList = todoItems.map((t) => `~~${t.text}~~`).join("\n");
|
|
271
279
|
pi.sendMessage(
|
|
272
280
|
{ customType: "plan-complete", content: `**Plan Complete!** ✓\n\n${completedList}`, display: true },
|
|
273
|
-
|
|
281
|
+
// nextTurn: delivered with the next user prompt instead of triggering an
|
|
282
|
+
// extra (expensive, reasoning-max) LLM turn to acknowledge the card.
|
|
283
|
+
{ deliverAs: "nextTurn" },
|
|
274
284
|
);
|
|
275
285
|
executionMode = false;
|
|
276
286
|
todoItems = [];
|