@astralyn/pi 1.4.10 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -0
- package/dist/bundle/chunks/anthropic-messages-G5ZGBHOH.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-EMPTMYNF.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +22 -15
- package/dist/bundle/chunks/chunk-AXX7FFFD.js +2 -0
- package/dist/bundle/chunks/chunk-FNGB3ASD.js +2 -0
- package/dist/bundle/chunks/chunk-FPALVF3F.js +4 -0
- package/dist/bundle/chunks/chunk-H3UF54OB.js +9 -0
- package/dist/bundle/chunks/chunk-IC6JXX2J.js +10 -0
- package/dist/bundle/chunks/{chunk-UCH27AVQ.js → chunk-IRUUTK4W.js} +1 -1
- package/dist/bundle/chunks/{chunk-MZJC45TM.js → chunk-J7L6O5XA.js} +3 -3
- package/dist/bundle/chunks/{chunk-DLVLAQEG.js → chunk-KBFO53OG.js} +3 -3
- package/dist/bundle/chunks/{chunk-TPVFPFJP.js → chunk-P7VXFB2M.js} +1 -1
- package/dist/bundle/chunks/chunk-PSYLMRL6.js +9 -0
- package/dist/bundle/chunks/chunk-QNZARXLE.js +82 -0
- package/dist/bundle/chunks/chunk-R3YHAMWH.js +1503 -0
- package/dist/bundle/chunks/chunk-RAIYJ5FC.js +4 -0
- package/dist/bundle/chunks/{chunk-OV2VMHBX.js → chunk-SR6EWNPW.js} +1 -1
- package/dist/bundle/chunks/chunk-TA3YH2ZI.js +16 -0
- package/dist/bundle/chunks/{chunk-MF3T3ETJ.js → chunk-THAJ4BZF.js} +58 -62
- package/dist/bundle/chunks/{chunk-24FY4C5S.js → chunk-TRSJS3FM.js} +1 -1
- package/dist/bundle/chunks/chunk-ZRI3ICDE.js +2 -0
- package/dist/bundle/chunks/{cli-MBFCFGI2.js → cli-LAZQG54B.js} +11 -9
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-7BKATOEJ.js → cloudflare-workers-ai-system-one-4L2ABUJE.js} +1 -1
- package/dist/bundle/chunks/{execute-FQKRO4XJ.js → execute-ACWDKC3C.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-HTUSU45F.js → google-generative-ai-OOVDGS5W.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-AVQV4P76.js → google-vertex-IK5RNG7J.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-27QYLJZY.js → llama-cpp-classify-XHAVT37C.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-Z56KY4OJ.js +5 -0
- package/dist/bundle/chunks/{openai-codex-responses-Q25MHDFX.js → openai-codex-responses-5NAH3SK6.js} +1 -1
- package/dist/bundle/chunks/openai-completions-S7S6PO3J.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-3WYFPGSK.js → openai-decisions-7A36EAHE.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-E4BNZIQK.js → openai-responses-ZQRZJKH4.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-CBP3OPOD.js → openrouter-images-X7PX72ON.js} +1 -1
- package/dist/bundle/chunks/pi-messages-TXNWPLI4.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-3RPOJS5T.js → runtime-X3XOMNXQ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-BNICP2LS.js → typesafe-system-one-XJGMSHWL.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-T2KLVAFL.js +2 -0
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -7
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -5
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +0 -5
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +12 -28
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -14
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +67 -96
- package/dist/core/agent-session.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/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/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +5 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- 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 +20 -12
- 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 +0 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -12
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +41 -23
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +11 -4
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +15 -5
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1678 -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 +16 -10
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +14 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +160 -46
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +163 -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/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/quiescence.d.ts +24 -0
- package/dist/core/quiescence.d.ts.map +1 -0
- package/dist/core/quiescence.js +81 -0
- package/dist/core/quiescence.js.map +1 -0
- 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 +41 -28
- package/dist/core/resource-loader.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-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-manager.d.ts +2 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +8 -1
- 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-command-name.d.ts +6 -0
- package/dist/core/slash-command-name.d.ts.map +1 -0
- package/dist/core/slash-command-name.js +11 -0
- package/dist/core/slash-command-name.js.map +1 -0
- package/dist/core/slash-commands.js +2 -2
- 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/tasks/codec.d.ts +14 -0
- package/dist/core/tasks/codec.d.ts.map +1 -1
- package/dist/core/tasks/codec.js +57 -4
- package/dist/core/tasks/codec.js.map +1 -1
- package/dist/core/tasks/delivery.d.ts +4 -20
- package/dist/core/tasks/delivery.d.ts.map +1 -1
- package/dist/core/tasks/delivery.js +5 -58
- package/dist/core/tasks/delivery.js.map +1 -1
- package/dist/core/tasks/limits.d.ts +3 -19
- package/dist/core/tasks/limits.d.ts.map +1 -1
- package/dist/core/tasks/limits.js +3 -24
- package/dist/core/tasks/limits.js.map +1 -1
- package/dist/core/tasks/record.d.ts +1 -7
- package/dist/core/tasks/record.d.ts.map +1 -1
- package/dist/core/tasks/record.js +0 -18
- package/dist/core/tasks/record.js.map +1 -1
- package/dist/core/tasks/reminder.d.ts +3 -2
- package/dist/core/tasks/reminder.d.ts.map +1 -1
- package/dist/core/tasks/reminder.js +4 -3
- package/dist/core/tasks/reminder.js.map +1 -1
- package/dist/core/tasks/runtime.d.ts +1 -14
- package/dist/core/tasks/runtime.d.ts.map +1 -1
- package/dist/core/tasks/runtime.js +3 -96
- package/dist/core/tasks/runtime.js.map +1 -1
- package/dist/core/tasks/session.d.ts +9 -5
- package/dist/core/tasks/session.d.ts.map +1 -1
- package/dist/core/tasks/session.js +22 -24
- package/dist/core/tasks/session.js.map +1 -1
- package/dist/core/tasks/types.d.ts +3 -92
- package/dist/core/tasks/types.d.ts.map +1 -1
- package/dist/core/tasks/types.js +3 -3
- package/dist/core/tasks/types.js.map +1 -1
- package/dist/core/tools/bash.d.ts +8 -7
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +6 -5
- package/dist/core/tools/bash.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 +2 -4
- 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.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- 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.map +1 -1
- package/dist/core/tools/powershell.d.ts +1 -5
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -6
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +19 -41
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +3 -25
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +18 -19
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/shell-execution.d.ts +20 -13
- package/dist/core/tools/shell-execution.d.ts.map +1 -1
- package/dist/core/tools/shell-execution.js +165 -183
- package/dist/core/tools/shell-execution.js.map +1 -1
- package/dist/core/tools/shell-tool.d.ts +9 -14
- package/dist/core/tools/shell-tool.d.ts.map +1 -1
- package/dist/core/tools/shell-tool.js +38 -66
- package/dist/core/tools/shell-tool.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -4
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -3
- package/dist/core/tools/tool-definition-wrapper.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 +30 -13
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +0 -9
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +24 -91
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/agent/activity-lines.d.ts +2 -3
- package/dist/extensions/agent/activity-lines.d.ts.map +1 -1
- package/dist/extensions/agent/activity-lines.js +5 -9
- package/dist/extensions/agent/activity-lines.js.map +1 -1
- package/dist/extensions/agent/activity.d.ts +0 -2
- package/dist/extensions/agent/activity.d.ts.map +1 -1
- package/dist/extensions/agent/activity.js +1 -1
- package/dist/extensions/agent/activity.js.map +1 -1
- package/dist/extensions/agent/progress.d.ts +0 -3
- package/dist/extensions/agent/progress.d.ts.map +1 -1
- package/dist/extensions/agent/progress.js +2 -8
- package/dist/extensions/agent/progress.js.map +1 -1
- package/dist/extensions/agent/render.js +1 -1
- package/dist/extensions/agent/render.js.map +1 -1
- package/dist/extensions/agent/tool.d.ts.map +1 -1
- package/dist/extensions/agent/tool.js +0 -6
- package/dist/extensions/agent/tool.js.map +1 -1
- package/dist/{core/isolated-session.d.ts → extensions/agent/worker-session.d.ts} +6 -6
- package/dist/extensions/agent/worker-session.d.ts.map +1 -0
- package/dist/{core/isolated-session.js → extensions/agent/worker-session.js} +9 -9
- package/dist/extensions/agent/worker-session.js.map +1 -0
- package/dist/extensions/agent/worker.d.ts +0 -3
- package/dist/extensions/agent/worker.d.ts.map +1 -1
- package/dist/extensions/agent/worker.js +2 -3
- package/dist/extensions/agent/worker.js.map +1 -1
- package/dist/extensions/btw/agent.d.ts.map +1 -1
- package/dist/extensions/btw/agent.js +2 -1
- package/dist/extensions/btw/agent.js.map +1 -1
- package/dist/extensions/cached-compaction/render.d.ts.map +1 -1
- package/dist/extensions/cached-compaction/render.js +3 -3
- package/dist/extensions/cached-compaction/render.js.map +1 -1
- package/dist/extensions/cached-compaction/summary.d.ts +1 -1
- package/dist/extensions/cached-compaction/summary.d.ts.map +1 -1
- package/dist/extensions/cached-compaction/summary.js +13 -16
- package/dist/extensions/cached-compaction/summary.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +6 -2
- package/dist/extensions/codemode/renderer.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 +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/deepwiki/schema.d.ts.map +1 -1
- package/dist/extensions/deepwiki/schema.js +1 -1
- package/dist/extensions/deepwiki/schema.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +16 -4
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +1 -1
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +36 -13
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +1 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +33 -24
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/run-summary/index.d.ts +1 -1
- package/dist/extensions/run-summary/index.d.ts.map +1 -1
- package/dist/extensions/run-summary/index.js +11 -23
- package/dist/extensions/run-summary/index.js.map +1 -1
- package/dist/extensions/statusline/usage.d.ts.map +1 -1
- package/dist/extensions/statusline/usage.js +2 -1
- package/dist/extensions/statusline/usage.js.map +1 -1
- package/dist/extensions/tasks/tool/actions.d.ts +1 -2
- package/dist/extensions/tasks/tool/actions.d.ts.map +1 -1
- package/dist/extensions/tasks/tool/actions.js +7 -79
- package/dist/extensions/tasks/tool/actions.js.map +1 -1
- package/dist/extensions/tasks/tool/constants.d.ts +1 -3
- package/dist/extensions/tasks/tool/constants.d.ts.map +1 -1
- package/dist/extensions/tasks/tool/constants.js +1 -3
- package/dist/extensions/tasks/tool/constants.js.map +1 -1
- package/dist/extensions/tasks/tool/schema.d.ts +1 -2
- package/dist/extensions/tasks/tool/schema.d.ts.map +1 -1
- package/dist/extensions/tasks/tool/schema.js +7 -15
- package/dist/extensions/tasks/tool/schema.js.map +1 -1
- package/dist/extensions/tasks/tool/types.d.ts +1 -19
- package/dist/extensions/tasks/tool/types.d.ts.map +1 -1
- package/dist/extensions/tasks/tool/types.js.map +1 -1
- package/dist/extensions/tasks/tool.d.ts +1 -2
- package/dist/extensions/tasks/tool.d.ts.map +1 -1
- package/dist/extensions/tasks/tool.js +2 -4
- package/dist/extensions/tasks/tool.js.map +1 -1
- package/dist/extensions/tasks/ui/completion-render.d.ts +5 -1
- package/dist/extensions/tasks/ui/completion-render.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/completion-render.js +25 -70
- package/dist/extensions/tasks/ui/completion-render.js.map +1 -1
- package/dist/extensions/tasks/ui/inspector.d.ts +1 -1
- package/dist/extensions/tasks/ui/inspector.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/inspector.js +0 -6
- package/dist/extensions/tasks/ui/inspector.js.map +1 -1
- package/dist/extensions/tasks/ui/manager.d.ts +1 -1
- package/dist/extensions/tasks/ui/manager.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/manager.js.map +1 -1
- package/dist/extensions/tasks/ui/render.d.ts +2 -16
- package/dist/extensions/tasks/ui/render.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/render.js +3 -79
- package/dist/extensions/tasks/ui/render.js.map +1 -1
- package/dist/extensions/tasks/ui/views.d.ts +2 -4
- package/dist/extensions/tasks/ui/views.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/views.js +3 -7
- package/dist/extensions/tasks/ui/views.js.map +1 -1
- package/dist/extensions/tool-presentation/fallback.d.ts.map +1 -0
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.js +5 -5
- package/dist/extensions/tool-presentation/fallback.js.map +1 -0
- package/dist/extensions/tool-presentation/index.js +1 -1
- package/dist/extensions/tool-presentation/index.js.map +1 -1
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.d.ts +1 -1
- package/dist/extensions/tool-presentation/shell.d.ts.map +1 -0
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.js +3 -3
- package/dist/extensions/tool-presentation/shell.js.map +1 -0
- 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 +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +3 -3
- 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 +15 -8
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +5 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +61 -45
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-skills.d.ts +54 -0
- package/dist/modes/interactive/components/config-selector-skills.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector-skills.js +178 -0
- package/dist/modes/interactive/components/config-selector-skills.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +2 -11
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +31 -181
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +7 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +4 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +103 -10
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +3 -2
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +17 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +13 -4
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +86 -22
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +15 -23
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +2 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +7 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +48 -9
- package/dist/modes/interactive/components/tool-execution.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 +5 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +9 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +4 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/editor-host.d.ts.map +1 -1
- package/dist/modes/interactive/editor-host.js +3 -2
- package/dist/modes/interactive/editor-host.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +17 -5
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -12
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +169 -112
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts +10 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js +21 -0
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +30 -23
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tool-view/chat.d.ts +2 -2
- package/dist/modes/interactive/tool-view/chat.d.ts.map +1 -1
- package/dist/modes/interactive/tool-view/chat.js +22 -19
- package/dist/modes/interactive/tool-view/chat.js.map +1 -1
- package/dist/modes/interactive/transcript-layout.d.ts +2 -0
- package/dist/modes/interactive/transcript-layout.d.ts.map +1 -1
- package/dist/modes/interactive/transcript-layout.js +5 -2
- package/dist/modes/interactive/transcript-layout.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +1 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +9 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +23 -23
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -3
- 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 +55 -4
- 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/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/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- 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/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/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +7 -0
- package/dist/utils/syntax-highlight.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/usage.d.ts +5 -0
- package/dist/utils/usage.d.ts.map +1 -0
- package/dist/utils/usage.js +16 -0
- package/dist/utils/usage.js.map +1 -0
- package/docs/bundled/README.md +1 -1
- package/docs/bundled/extensions/agent.md +7 -7
- package/docs/bundled/extensions/run-summary.md +4 -4
- package/docs/bundled/extensions/statusline.md +1 -1
- package/docs/bundled/tasks.md +12 -27
- package/docs/bundled/tool-presentation.md +2 -2
- package/docs/custom-provider.md +1 -1
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +41 -28
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +17 -12
- package/docs/mcp.md +6 -4
- package/docs/models-configuration.md +1 -1
- package/docs/models.md +7 -85
- package/docs/packages.md +26 -1
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +10 -8
- package/docs/session-format.md +3 -3
- package/docs/sessions.md +10 -0
- package/docs/settings.md +5 -4
- package/docs/terminal-setup.md +2 -2
- package/docs/tmux.md +6 -0
- package/docs/tui.md +12 -7
- package/docs/usage.md +19 -9
- package/docs/windows.md +29 -0
- package/examples/extensions/README.md +2 -1
- 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/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +19 -29
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +11 -12
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +17 -0
- package/dist/bundle/chunks/anthropic-messages-HWL6AS7T.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-4YYPDYV5.js +0 -2
- package/dist/bundle/chunks/chunk-6GTUUUCJ.js +0 -1499
- package/dist/bundle/chunks/chunk-6JS2SOFO.js +0 -11
- package/dist/bundle/chunks/chunk-ANCZPKX7.js +0 -2
- package/dist/bundle/chunks/chunk-FEZ5RM2B.js +0 -2
- package/dist/bundle/chunks/chunk-LPF7HQ3S.js +0 -4
- package/dist/bundle/chunks/chunk-MMNIHCU7.js +0 -2
- package/dist/bundle/chunks/chunk-R267VV5T.js +0 -82
- package/dist/bundle/chunks/chunk-RVKT7OUB.js +0 -9
- package/dist/bundle/chunks/chunk-SA2AQYEI.js +0 -7
- package/dist/bundle/chunks/chunk-ZAIGBRV5.js +0 -16
- package/dist/bundle/chunks/mistral-conversations-V2JJTMJ5.js +0 -5
- package/dist/bundle/chunks/openai-completions-TXZXILJR.js +0 -7
- package/dist/bundle/chunks/pi-messages-LBJQ4NGP.js +0 -8
- package/dist/bundle/chunks/virtual-modules-6IJ6V2CG.js +0 -2
- package/dist/core/isolated-session.d.ts.map +0 -1
- package/dist/core/isolated-session.js.map +0 -1
- package/dist/core/tasks/wait.d.ts +0 -19
- package/dist/core/tasks/wait.d.ts.map +0 -1
- package/dist/core/tasks/wait.js +0 -45
- package/dist/core/tasks/wait.js.map +0 -1
- package/dist/modes/interactive/tool-view/fallback.d.ts.map +0 -1
- package/dist/modes/interactive/tool-view/fallback.js.map +0 -1
- package/dist/modes/interactive/tool-view/shell.d.ts.map +0 -1
- package/dist/modes/interactive/tool-view/shell.js.map +0 -1
- package/dist/modes/interactive/tool-view/tool-execution.d.ts +0 -14
- package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/tool-view/tool-execution.js +0 -13
- package/dist/modes/interactive/tool-view/tool-execution.js.map +0 -1
- package/dist/utils/path-identity.d.ts +0 -12
- package/dist/utils/path-identity.d.ts.map +0 -1
- package/dist/utils/path-identity.js +0 -63
- package/dist/utils/path-identity.js.map +0 -1
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- 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/npm-shrinkwrap.json +0 -4207
- /package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.d.ts +0 -0
package/docs/extensions.md
CHANGED
|
@@ -143,7 +143,7 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
|
|
|
143
143
|
|---------|---------|
|
|
144
144
|
| `@astralyn/pi` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
|
|
145
145
|
| `typebox` | Schema definitions for tool parameters |
|
|
146
|
-
| `@earendil-works/pi-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
|
|
146
|
+
| `@earendil-works/pi-ai` | AI utilities (`StringEnum` for Google-compatible enums). Inside pi it also exports TypeBox's `Type`, `Static` and `TSchema`, which the published package no longer re-exports; import them from `typebox` in new code |
|
|
147
147
|
| `@earendil-works/pi-agent-core` | Agent-core types for advanced integrations |
|
|
148
148
|
| `@earendil-works/pi-tui` | TUI components for custom rendering |
|
|
149
149
|
|
|
@@ -153,6 +153,18 @@ For distributed pi packages installed with `pi install` (npm or git), runtime de
|
|
|
153
153
|
|
|
154
154
|
Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
|
|
155
155
|
|
|
156
|
+
### Tool parameter schemas and TypeBox
|
|
157
|
+
|
|
158
|
+
Pi validates tool arguments as JSON Schema with `@earendil-works/pi-schema`, whatever built the schema; TypeBox schemas are JSON Schema and work unchanged. Before validation, loosely typed arguments are coerced: numeric strings to numbers, `"true"` to `true`, a single value to a one-item array, `null` in an optional property dropped. TypeBox features outside JSON Schema do not apply to tool arguments:
|
|
159
|
+
|
|
160
|
+
- `Type.Refine()` refinements are not run. Check such constraints in `execute()`.
|
|
161
|
+
- `Type.BigInt()`, `Type.Undefined()` and `Type.Void()` reject every argument, since JSON has no such values. Codecs (`Type.Codec()`) do not decode: `execute()` receives the JSON value.
|
|
162
|
+
- Formats registered with TypeBox's `Format.Set()` are not checked. The standard formats are, plus `url` and `json-pointer-uri-fragment`.
|
|
163
|
+
- Property names are matched as names, not as regular expressions, and `additionalProperties` applies only to properties the object does not declare.
|
|
164
|
+
- A `$ref` that names nothing rejects only arguments at its place.
|
|
165
|
+
|
|
166
|
+
Validation errors the model sees use pi-schema's messages, such as `- path: missing` or `- limit: expected number, got string`, followed by field hints that name the legal fields and a bounded echo of the received arguments.
|
|
167
|
+
|
|
156
168
|
## Writing an Extension
|
|
157
169
|
|
|
158
170
|
An extension exports a default factory function that receives `ExtensionAPI`. The factory can be synchronous or asynchronous:
|
|
@@ -1259,10 +1271,7 @@ Session-bound `TasksContext` supervises native and extension-owned execution. Fo
|
|
|
1259
1271
|
|---|---|
|
|
1260
1272
|
| `execute<T>(execution)` | Returns `{ kind: "result", result, status, error? }` or `{ kind: "background", task, reason }`, where `reason` is `"submitted"` when the caller asked for `background` and `"detached"` when it was moved while the work ran |
|
|
1261
1273
|
| `list()` / `get(id)` | Bounded, read-only (frozen) retained snapshots; IDs support unique prefixes |
|
|
1262
|
-
| `
|
|
1263
|
-
| `read(id, options?)` | Bounded head, tail, or byte-offset model-readable output; excludes human-only display text. `options`: `mode`, `bytes`, `sinceBytes`. Without `mode`, a `report` is read from its start and a `log` from its end. With `sinceBytes`, `head` continues forward from that offset and `tail` keeps the newest window at or after it. Returned ranges and `endByte` use raw source bytes. A `wait` or `waitAny` read follows the same default |
|
|
1264
|
-
| `wait(id, options?)` | One observation of one task. `options`: `timeoutMs`, `signal`, `toolCallId`, and `read: { bytes?, sinceBytes? }`. Returns `{ outcome, waitedMs, task, read? }` where `outcome` is `settled`, `timed_out`, `interrupted` (host steering), or `closed` (host shut down; state unconfirmed). Timeout, cancellation, or interruption ends the wait, not execution |
|
|
1265
|
-
| `waitAny(options?)` | Observes the first task running at call time to settle, with `timeoutMs`, `signal`, `toolCallId`, and `read: { bytes? }`. Returns `{ outcome, waitedMs, task?, read?, running }`; `outcome` adds `no_tasks` for an empty cohort. Later tasks are excluded |
|
|
1274
|
+
| `read(id, options?)` | Bounded head, tail, or byte-offset model-readable output; excludes human-only display text. `options`: `mode`, `bytes`, `sinceBytes`. Without `mode`, a `report` is read from its start and a `log` from its end. With `sinceBytes`, `head` continues forward from that offset and `tail` keeps the newest window at or after it. Returned ranges and `endByte` use raw source bytes |
|
|
1266
1275
|
| `kill(id)` | Requests cancellation; `stopping` is not a terminal status |
|
|
1267
1276
|
| `detach(id)` / `detachForeground()` | Hands off one task, or eligible foreground tasks oldest first while background slots remain, without restarting them; throws when every background slot is taken. Returns `false` / `0` while the host cannot supervise background work (see below) |
|
|
1268
1277
|
| `canDetach(id)` | Reports whether an execution can move now, including host policy, the `tasks` tool being active, and available background slots; does not change the execution |
|
|
@@ -1275,23 +1284,22 @@ Session-bound `TasksContext` supervises native and extension-owned execution. Fo
|
|
|
1275
1284
|
|---|---|
|
|
1276
1285
|
| `label` | Human source name for the panel and completion card, such as `Bash` or `Agent`; defaults to `kind` |
|
|
1277
1286
|
| `output` | `"log"` (default) or `"report"`. A log's outcome is at its end, so a background completion gives the model an 8 KiB tail, and `read()` returns its end unless `mode` says otherwise. A report leads with its conclusion, so it arrives from its beginning, whole when it fits the 48 KiB context budget, as its foreground result would, and `read()` returns its start unless `mode` says otherwise; a completed report renders as Markdown in `/tasks` |
|
|
1278
|
-
| `input` | `{ label, text, truncated, language? }`: what the task was asked to do, such as a command or briefing. Shown in Details
|
|
1287
|
+
| `input` | `{ label, text, truncated, language? }`: what the task was asked to do, such as a command or briefing. Shown in `/tasks` Details, highlighted when `language` is set |
|
|
1279
1288
|
| `facts` | Up to 16 labelled `[label, value]` Details rows, such as `["Directory", cwd]` |
|
|
1280
1289
|
| `concurrency` | `{ key, limit }`: at most `limit` executions sharing `key` run at once. Lanes belong to one `kind`, so another executor can reuse the key. Later ones wait as `queued` tasks and `run` starts when a slot frees |
|
|
1281
1290
|
| `background`, `signal`, `onUpdate` | Requested handoff, parent cancellation, and foreground progress forwarding |
|
|
1282
|
-
| `present` | `(width, theme)` returning `string[]` or `undefined`: renders the running task's Output in `/tasks` with its own styling, such as colored columns or an elapsed time. Return lines already fitted to `width` (the panel clips any that are wider), or `undefined` for the default view. It runs synchronously on every repaint, so keep it cheap, and it must not return untrusted text without removing terminal sequences. It exists in memory for this execution only: never persisted, not part of any `TaskSnapshot`, dropped at settlement and absent after a restore. A throwing presenter is ignored. `display` stays the plain fallback for other consumers |
|
|
1283
1291
|
|
|
1284
|
-
`kind` is an executor-owned source label matching `[a-z][a-z0-9-]{0,63}`; the runtime never dispatches on it. Presentation is declared data: the panel
|
|
1292
|
+
`kind` is an executor-owned source label matching `[a-z][a-z0-9-]{0,63}`; the runtime never dispatches on it. Presentation is declared data: the panel renders `label`, `input`, `facts`, and `output` the same way for every executor, and the completion notification shows only the label, outcome, title and error. Input and facts restore with terminal task history; facts also appear in the model-facing completion text. At most eight background executions, queued ones included, are retained as active at once; foreground executions are not limited by them. Foreground and background results have separate history quotas.
|
|
1285
1293
|
|
|
1286
1294
|
A caller can be handed off to the background while its task is queued, before `run` starts, or after `run` calls `accept()`. A release requested while `run` is still preparing (a `background: true` submission, or a user detach) waits for `accept()`; if `run` settles first, the caller gets the result inline and the task stays `foreground`. `mode` is therefore `background` exactly when the caller was released with a background outcome. A queued task becomes `running` when its `run` starts; cancelling it settles it as `cancelled` without starting it.
|
|
1287
1295
|
|
|
1288
|
-
Background work is admitted, submitted or detached, only while the host can supervise it: the session's `tasks` management tool must be active, because the model could otherwise start work it cannot read
|
|
1296
|
+
Background work is admitted, submitted or detached, only while the host can supervise it: the session's `tasks` management tool must be active, because the model could otherwise start work it cannot read or stop. A rejected submission starts nothing and its error says so; work admitted earlier keeps running and delivering if the tool is deactivated later.
|
|
1289
1297
|
|
|
1290
|
-
`run` returns `TaskCompletion<T>`: `{ result, status?, display?, error?, facts?, usage? }`. The original tool result is returned to a foreground caller; task history keeps only its bounded text. Optional `display` is the human-only view that `/tasks` shows in place of the result; `tasks read
|
|
1298
|
+
`run` returns `TaskCompletion<T>`: `{ result, status?, display?, error?, facts?, usage? }`. The original tool result is returned to a foreground caller; task history keeps only its bounded text. Optional `display` is the human-only view that `/tasks` shows in place of the result; `tasks read` and completion context always use `result`. A terminal snapshot carries a display only if this completion supplies one: the last progress display does not survive settlement. Terminal `facts` replace launch facts with the same label, as the shell does with `["Exit", "42"]`. Explicit terminal statuses are `completed`, `partial`, `failed`, `cancelled`, and `timeout`. The host settles usage once, preferring `usage`, then `result.usage`, then the latest published usage; managed foreground results omit usage to avoid billing it twice.
|
|
1291
1299
|
|
|
1292
1300
|
`TaskControl<T>` exposes `id`, `signal`, `mode`, `onModeChange(listener)`, `accept()`, `publish(update)`, `attachOutput(path, cleanup?)`, and `cancel()`. `publish({ result, display?, usage? })` replaces the bounded model-readable result and optionally the live human-only display and cumulative usage; while it runs `/tasks` shows the display in place of the result, while model reads and completion notifications use only the result. A task with an attached output file is read from that file instead. Call `accept()` after whole-invocation preflight, before allowing a background handoff; `onModeChange` listeners run when the mode becomes `background`. Use the control's signal throughout execution. Parent-call cancellation is disconnected after handoff, while runtime shutdown still cancels the task. Mode subscriptions concern only this task; executors do not need the global registry to observe their own handoff or cancel themselves.
|
|
1293
1301
|
|
|
1294
|
-
Completion messages store `{ version: 3, task }` in `details`, a bounded terminal `TaskSnapshot`; only their bounded `content` enters model context.
|
|
1302
|
+
Completion messages store `{ version: 3, task }` in `details`, a bounded terminal `TaskSnapshot`; only their bounded `content` enters model context. Reads do not acknowledge delivery, and arbitrary tool-result detail fields cannot acknowledge a task. An undelivered completion is a retention lease the session holds on its task: the record and its output stay available until the model has it, and a runtime embedded without a session never holds one, so its settled records are ordinary bounded history.
|
|
1295
1303
|
|
|
1296
1304
|
```typescript
|
|
1297
1305
|
const outcome = await ctx.tasks.execute({
|
|
@@ -1313,7 +1321,7 @@ if (outcome.kind === "result") return outcome.result;
|
|
|
1313
1321
|
return { content: [{ type: "text", text: `Task ${outcome.task.id} continues in the background.` }], details: undefined };
|
|
1314
1322
|
```
|
|
1315
1323
|
|
|
1316
|
-
When Pi attaches the runtime to its durable session lifecycle, `ctx.tasks.session` exposes `stoppedByTreeNavigation(targetId)`, which lists running tasks that navigating to an entry would cancel. Standalone runtimes omit it.
|
|
1324
|
+
When Pi attaches the runtime to its durable session lifecycle, `ctx.tasks.session` exposes `stoppedByTreeNavigation(targetId)`, which lists running tasks that navigating to an entry would cancel. Standalone runtimes omit it.
|
|
1317
1325
|
|
|
1318
1326
|
`TaskRuntime`, `TaskRuntimeOptions`, and the public `Task*`/`TasksContext`/`TasksSessionContext` types are exported from `@astralyn/pi`. Captured capabilities close with their runtime; obtain the replacement from the new session context after reload or session replacement.
|
|
1319
1327
|
|
|
@@ -1913,6 +1921,7 @@ The transformer receives the Markdown string and a context with:
|
|
|
1913
1921
|
- `messageType` — `"user"`, `"assistant"`, or `"assistant-thinking"`
|
|
1914
1922
|
- `isStreaming` — `true` for partial assistant updates; `false` for user, finalized assistant, and restored messages
|
|
1915
1923
|
- `availableWidth` — exact terminal columns available for the transformed Markdown content
|
|
1924
|
+
- `messageId`, `timestamp` — session-entry ID and ISO timestamp when rendering from persisted session entries; `undefined` for live messages
|
|
1916
1925
|
|
|
1917
1926
|
Return the transformed Markdown:
|
|
1918
1927
|
|
|
@@ -1945,6 +1954,8 @@ pi.registerEntryRenderer("status-card", (entry, { expanded }, theme) => {
|
|
|
1945
1954
|
pi.appendEntry("status-card", { title: "Indexed files", count: 17 });
|
|
1946
1955
|
```
|
|
1947
1956
|
|
|
1957
|
+
`options.expanded` follows the transcript's expand toggle. `options.outputPad` is the horizontal padding from the `outputPad` setting; inset unboxed content by it to line up with the rest of the transcript.
|
|
1958
|
+
|
|
1948
1959
|
### pi.registerShortcut(shortcut, options)
|
|
1949
1960
|
|
|
1950
1961
|
Register a keyboard shortcut. See [keybindings.md](keybindings.md) for the shortcut format and built-in keybindings.
|
|
@@ -1977,13 +1988,15 @@ if (profile) {
|
|
|
1977
1988
|
|
|
1978
1989
|
### pi.exec(command, args, options?)
|
|
1979
1990
|
|
|
1980
|
-
Execute a shell
|
|
1991
|
+
Execute a command without a shell.
|
|
1981
1992
|
|
|
1982
1993
|
```typescript
|
|
1983
1994
|
const result = await pi.exec("git", ["status"], { signal, timeout: 5000 });
|
|
1984
|
-
// result.stdout, result.stderr, result.code, result.killed
|
|
1995
|
+
// result.stdout, result.stderr, result.code, result.killed, result.truncated
|
|
1985
1996
|
```
|
|
1986
1997
|
|
|
1998
|
+
Options: `signal` and `timeout` terminate the command, `cwd` sets the working directory, and `maxBuffer` limits stdout and stderr combined (default 256 MiB). When output exceeds `maxBuffer`, pi terminates the command and returns the output up to the limit with `truncated: true`, `killed: true`, and a nonzero `code`. `killed` is true whenever pi terminated the command: timeout, abort, or `maxBuffer`. A command that ignores SIGTERM gets SIGKILL after 5 seconds.
|
|
1999
|
+
|
|
1987
2000
|
### pi.getActiveTools() / pi.getAllTools() / pi.setActiveTools(names)
|
|
1988
2001
|
|
|
1989
2002
|
Manage active tools. This works for both built-in tools and dynamically registered tools. `pi.getActiveTools()` returns the active tool names as `string[]`; `pi.getAllTools()` returns metadata for all configured tools.
|
|
@@ -2568,7 +2581,7 @@ By default, tool output is wrapped in the active call/result shell, which owns t
|
|
|
2568
2581
|
|
|
2569
2582
|
Set `renderShell: "self"` when the tool should render its own shell instead of using the native shell. This is useful for tools that need complete control over framing or background behavior, for example large previews that must stay visually stable after the tool settles.
|
|
2570
2583
|
|
|
2571
|
-
For live progress UI (elapsed time, retry countdowns), schedule repaints from the renderer itself: store a timer handle in `context.state`, arm a `setTimeout` that calls `context.invalidate()` only while the current view contains changing text, and clear it on the first static or settled render.
|
|
2584
|
+
For live progress UI (elapsed time, retry countdowns), schedule repaints from the renderer itself: store a timer handle in `context.state`, arm a `setTimeout` that calls `context.invalidate()` only while the current view contains changing text, and clear it on the first static or settled render. When you arm a timer, register its cleanup with `context.onDispose(cleanup)`: the shell runs it once when the row is disposed, or immediately if the row already was. Register when you create the resource rather than on every render.
|
|
2572
2585
|
|
|
2573
2586
|
Derive displayed time from an absolute timestamp or deadline (`Date.now()`), not by decrementing a counter on every refresh. A refresh is only a repaint opportunity; event-loop stalls and machine sleep must not extend a wall-clock timeout.
|
|
2574
2587
|
|
|
@@ -2590,13 +2603,15 @@ pi.registerTool({
|
|
|
2590
2603
|
|
|
2591
2604
|
`renderCall` and `renderResult` each receive a `context` object with:
|
|
2592
2605
|
- `args` - the current tool call arguments
|
|
2593
|
-
- `state` - shared row-local state across `renderCall` and `renderResult
|
|
2606
|
+
- `state` - shared row-local state across `renderCall` and `renderResult`
|
|
2607
|
+
- `onDispose(cleanup)` - run `cleanup` once when the row is disposed, such as clearing a refresh timer; a cleanup that throws does not affect the row or its siblings
|
|
2594
2608
|
- `lastComponent` - the previously returned component for that slot, if any
|
|
2595
2609
|
- `invalidate()` - request a rerender of this tool row
|
|
2596
2610
|
- `toolCallId`, `cwd`, `executionStarted`, `argsComplete`, `isPartial`, `expanded`, `showImages`, `isError`
|
|
2597
2611
|
- `durationMs` - how long the tool's execution took, from the final result; `undefined` while it runs, when it did not run, or for results stored before durations were recorded
|
|
2598
2612
|
- `outputPad` - horizontal padding from the `outputPad` setting; renderers with `renderShell: "self"` apply it themselves
|
|
2599
2613
|
- `result` - the current partial or final result, if one has arrived
|
|
2614
|
+
- `keyText()`, `keyHint()` - format the user's configured keybindings, see [Keybinding Hints](#keybinding-hints)
|
|
2600
2615
|
|
|
2601
2616
|
Use `context.state` for cross-slot shared state. Keep slot-local caches on the returned component instance when you want to reuse and mutate the same component across renders.
|
|
2602
2617
|
|
|
@@ -2647,24 +2662,24 @@ If a slot intentionally has no visible content, return an empty `Component` such
|
|
|
2647
2662
|
|
|
2648
2663
|
#### Keybinding Hints
|
|
2649
2664
|
|
|
2650
|
-
Use `keyHint()` to display keybinding hints that respect the
|
|
2665
|
+
Use `keyHint()` and `keyText()` from the render context to display keybinding hints that respect the user's keybinding configuration:
|
|
2651
2666
|
|
|
2652
2667
|
```typescript
|
|
2653
|
-
import { keyHint } from "@astralyn/pi";
|
|
2654
|
-
|
|
2655
2668
|
renderResult(result, { expanded }, theme, context) {
|
|
2656
2669
|
let text = theme.fg("success", "✓ Done");
|
|
2657
2670
|
if (!expanded) {
|
|
2658
|
-
text += ` (${keyHint("app.tools.expand", "to expand")})`;
|
|
2671
|
+
text += ` (${context.keyHint("app.tools.expand", "to expand")})`;
|
|
2659
2672
|
}
|
|
2660
2673
|
return new Text(text, 0, 0);
|
|
2661
2674
|
}
|
|
2662
2675
|
```
|
|
2663
2676
|
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
- `
|
|
2667
|
-
- `
|
|
2677
|
+
The same functions are available as `options.keyHint()`/`options.keyText()` in message and entry renderers:
|
|
2678
|
+
|
|
2679
|
+
- `keyHint(keybinding, description)` - Formats a configured keybinding id such as `"app.tools.expand"` or `"tui.select.confirm"`, followed by the description
|
|
2680
|
+
- `keyText(keybinding)` - Returns the raw configured key text for a keybinding id, or `""` if the id has no keys
|
|
2681
|
+
|
|
2682
|
+
In renderers, use these instead of importing `keyHint()` or `keyText()` from `@astralyn/pi`. An extension can resolve its own copy of the package, for example from its own `node_modules`, and that copy does not see pi's configured keybindings: `app.*` ids then format as `""`. `rawKeyHint(key, description)` formats a literal key string and is safe to import.
|
|
2668
2683
|
|
|
2669
2684
|
Use namespaced keybinding ids:
|
|
2670
2685
|
- Coding-agent ids use the `app.*` namespace, for example `app.tools.expand`, `app.editor.external`, `app.session.rename`
|
|
@@ -2816,7 +2831,6 @@ Extensions can interact with users via `ctx.ui` methods and customize how messag
|
|
|
2816
2831
|
- Status indicators (setStatus)
|
|
2817
2832
|
- Working message, visibility, and indicator during streaming (`setWorkingMessage`, `setWorkingVisible`, `setWorkingIndicator`)
|
|
2818
2833
|
- Widgets above/below editor (setWidget)
|
|
2819
|
-
- Ephemeral transcript notes (addTranscriptNote)
|
|
2820
2834
|
- Autocomplete providers layered on top of built-in slash/path completion (addAutocompleteProvider)
|
|
2821
2835
|
- Custom footers (setFooter)
|
|
2822
2836
|
|
|
@@ -2989,9 +3003,6 @@ ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"], { placement: "belowEditor" }
|
|
|
2989
3003
|
ctx.ui.setWidget("my-widget", (tui, theme) => new Text(theme.fg("accent", "Custom"), 0, 0));
|
|
2990
3004
|
ctx.ui.setWidget("my-widget", undefined); // Clear
|
|
2991
3005
|
|
|
2992
|
-
// Ephemeral note after a session entry; not persisted or sent to the model
|
|
2993
|
-
ctx.ui.addTranscriptNote("my-note", "Worked for 8s", { afterEntryId: ctx.sessionManager.getLeafId()! });
|
|
2994
|
-
|
|
2995
3006
|
// Custom footer (replaces built-in footer entirely)
|
|
2996
3007
|
ctx.ui.setFooter((_tui, theme, footerData) => ({
|
|
2997
3008
|
render(_width) {
|
|
@@ -3247,6 +3258,8 @@ pi.registerMessageRenderer("my-extension", (message, options, theme) => {
|
|
|
3247
3258
|
|
|
3248
3259
|
if (expanded && message.details) {
|
|
3249
3260
|
text += "\n" + theme.fg("dim", JSON.stringify(message.details, null, 2));
|
|
3261
|
+
} else if (message.details) {
|
|
3262
|
+
text += ` (${options.keyHint("app.tools.expand", "to expand")})`;
|
|
3250
3263
|
}
|
|
3251
3264
|
|
|
3252
3265
|
return new Text(text, outputPad, 0);
|
package/docs/keybindings.md
CHANGED
|
@@ -90,7 +90,7 @@ These actions apply when interactive mode uses `--tui-mode fullscreen` and targe
|
|
|
90
90
|
|
|
91
91
|
Hold Alt while scrolling the mouse wheel for five-times-faster scrolling. Hovering over autocomplete or settings lists keeps their selection and scroll position unchanged; click an item to select it.
|
|
92
92
|
|
|
93
|
-
Fullscreen transcript bindings take precedence over editor bindings using the same key. `pageUp` and `pageDown` therefore control the transcript in fullscreen mode while their `ctrl` variants keep controlling the editor; `home` and `end` always control the editor, while `ctrl+home` and `ctrl+end` control the transcript in fullscreen mode. Outside fullscreen mode, all of these keys control the editor.
|
|
93
|
+
Fullscreen transcript bindings take precedence over editor bindings using the same key. `pageUp` and `pageDown` therefore control the transcript in fullscreen mode while their `ctrl` variants keep controlling the editor; `home` and `end` always control the editor, while `ctrl+home` and `ctrl+end` control the transcript in fullscreen mode. Outside fullscreen mode, all of these keys control the editor. While an overlay or a scrollable list such as autocomplete, `/settings`, or the model selector has focus, the scrolling and prompt-jump actions go to it instead of the transcript, so `tui.select.pageUp` and `tui.select.pageDown` move the list selection. Transcript search actions keep working.
|
|
94
94
|
|
|
95
95
|
| Key | Default mode | Fullscreen mode |
|
|
96
96
|
|-----|--------------|-----------------|
|
package/docs/llama-cpp.md
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
# llama.cpp
|
|
2
2
|
|
|
3
|
-
The llama.cpp integration is provided by [upstream Pi](https://github.com/earendil-works/pi) and included in `@astralyn/pi`. It supports the [llama.cpp](https://
|
|
3
|
+
The llama.cpp integration is provided by [upstream Pi](https://github.com/earendil-works/pi) and included in `@astralyn/pi`. It supports the [llama.cpp](https://llama.app) router server, which discovers multiple GGUF models and loads or unloads them on demand.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Install llama.cpp
|
|
6
|
+
|
|
7
|
+
Install llama.cpp with the [official installer](https://llama.app/docs/installation):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
curl -LsSf https://llama.app/install.sh | sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Verify the installation with `llama cli --version`. See [llama.app](https://llama.app) for other installation methods, including package managers and building from source.
|
|
6
14
|
|
|
7
15
|
## Start the router
|
|
8
16
|
|
|
9
|
-
Start `llama
|
|
17
|
+
Start `llama serve` without `--model`, `-m`, or `-hf`. Passing a model starts single-model mode instead of router mode. See the [llama.cpp server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode) for router configuration.
|
|
10
18
|
|
|
11
19
|
```bash
|
|
12
|
-
llama
|
|
13
|
-
--models-dir ~/models \
|
|
20
|
+
llama serve \
|
|
14
21
|
--no-models-autoload \
|
|
15
|
-
--jinja \
|
|
16
22
|
--host 127.0.0.1 \
|
|
17
23
|
--port 8080 \
|
|
18
|
-
-ngl
|
|
24
|
+
-ngl all \
|
|
19
25
|
-c 32768
|
|
20
26
|
```
|
|
21
27
|
|
|
22
28
|
Important options:
|
|
23
29
|
|
|
24
|
-
- `--models-dir ~/models` discovers local GGUF files.
|
|
25
30
|
- `--no-models-autoload` keeps loading explicit through `/llama`.
|
|
26
31
|
- `--jinja` enables compatible chat templates and tool calling.
|
|
27
|
-
- `-ngl
|
|
28
|
-
- `-c 32768` sets the context
|
|
32
|
+
- `-ngl all` offloads all layers to the GPU. Omit it to use automatic GPU offloading.
|
|
33
|
+
- `-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.
|
|
29
34
|
|
|
30
35
|
A single-file model can sit directly in the model directory. Put multimodal and multi-shard models in separate subdirectories:
|
|
31
36
|
|
|
@@ -41,7 +46,7 @@ A single-file model can sit directly in the model directory. Put multimodal and
|
|
|
41
46
|
└── large-model-Q4_K_M-00003-of-00003.gguf
|
|
42
47
|
```
|
|
43
48
|
|
|
44
|
-
Restart the router after manually adding files.
|
|
49
|
+
Restart the router after manually adding files. The router also supports cached models and preset files via `--models-preset`, as described in the [server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode). For settings tuned to a specific NVIDIA GPU and model, see [Run Pi with NVIDIA RTX and llama.cpp](nvidia-rtx-llama-cpp.md).
|
|
45
50
|
|
|
46
51
|
## Configure Pi
|
|
47
52
|
|
|
@@ -63,7 +68,7 @@ export LLAMA_API_KEY=optional-secret
|
|
|
63
68
|
pi
|
|
64
69
|
```
|
|
65
70
|
|
|
66
|
-
If the server uses an API key, start `llama
|
|
71
|
+
If the server uses an API key, start `llama serve` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
|
|
67
72
|
|
|
68
73
|
## Manage models
|
|
69
74
|
|
package/docs/mcp.md
CHANGED
|
@@ -126,7 +126,7 @@ Remote servers that use OAuth, such as Sentry, need no credentials in `mcp.json`
|
|
|
126
126
|
|
|
127
127
|
When the server rejects an unauthenticated connection, `/mcp` shows that it needs sign-in. Select "Sign in", run `/mcp login sentry`, or run `pi mcp login sentry`. Pi opens the authorization page and waits for approval. If the browser runs on another machine, such as over SSH, paste its redirected URL into the sign-in screen. A running session uses the new credentials on its next turn.
|
|
128
128
|
|
|
129
|
-
Pi
|
|
129
|
+
Pi identifies itself to the authorization server with its Client ID Metadata Document or by registering a client, stores tokens in `~/.pi/agent/mcp-auth.json`, and refreshes access tokens when they expire or the server rejects them. If a server later requests additional scope, Pi asks for sign-in again. Signing out deletes the stored credentials.
|
|
130
130
|
|
|
131
131
|
Credentials belong to a server name and URL. Servers with the same URL under different names, such as one per account, sign in separately; servers with the same name and URL in different `mcp.json` files share one sign-in.
|
|
132
132
|
|
|
@@ -159,17 +159,19 @@ Pi registers as `pi`. Some servers only accept registrations from known clients.
|
|
|
159
159
|
|
|
160
160
|
The name is only sent when Pi registers a client. To register again under a new name, sign out first.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
Without `clientId`, Pi identifies itself with its Client ID Metadata Document on pi.dev when the authorization server advertises support for documents and public clients. Otherwise it registers a client dynamically. A client registered before stays in use while its redirect URI matches, until you sign out. With the document, the client ID is `https://pi.dev/oauth/client.json` with the redirect URI `http://127.0.0.1:<port>/callback`. If the authorization server does not send the `iss` parameter in authorization responses (RFC 9207), Pi uses a document and redirect path specific to the MCP server instead: `https://pi.dev/oauth/<id>/client.json` with `http://127.0.0.1:<port>/callback/<id>`.
|
|
163
|
+
|
|
164
|
+
Pi registers instead of using the document when `clientName` is set or `callbackUrl` is not `/callback` on `localhost` or `127.0.0.1`. Set `clientRegistration` to choose the method: `auto` (default) as described, `dcr` to always register, or `cimd` to always use the document. With `cimd`, sign-in fails if the authorization server does not support documents for public clients. Use `dcr` when the authorization page reports an invalid client:
|
|
163
165
|
|
|
164
166
|
```json
|
|
165
167
|
{
|
|
166
168
|
"mcpServers": {
|
|
167
|
-
"example": { "url": "https://mcp.example.com/mcp", "oauth": { "clientRegistration": "
|
|
169
|
+
"example": { "url": "https://mcp.example.com/mcp", "oauth": { "clientRegistration": "dcr" } }
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
```
|
|
171
173
|
|
|
172
|
-
|
|
174
|
+
`pi mcp add --oauth-client-registration <mode>` sets it when adding a server. `cimd` cannot be combined with `clientId` or `clientName`, and a `callbackUrl` must use `localhost` or `127.0.0.1` with the path `/callback`.
|
|
173
175
|
|
|
174
176
|
Pi finds the authorization server through the server's protected resource metadata (RFC 9728) and checks that the authorization server's metadata names the expected issuer (RFC 8414). Some servers advertise the wrong authorization server or none, so sign-in opens a page that does not exist. Set `authServerMetadataUrl` to the metadata document of the right authorization server:
|
|
175
177
|
|
|
@@ -88,7 +88,7 @@ Each `modelOverrides` key is the ID of a built-in or extension model. Unknown ID
|
|
|
88
88
|
|
|
89
89
|
## Input limits
|
|
90
90
|
|
|
91
|
-
See [
|
|
91
|
+
See [Image Input Limits](models.md#image-input-limits).
|
|
92
92
|
|
|
93
93
|
| Field | Type | Default | Description |
|
|
94
94
|
|---|---|---|---|
|
package/docs/models.md
CHANGED
|
@@ -153,18 +153,7 @@ At provider level, `api` is the default for entries in that provider's `models`
|
|
|
153
153
|
|
|
154
154
|
Each key in `providers` is the provider ID used by `/model`, `--provider`, saved credentials, and model references.
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
| --- | --- |
|
|
158
|
-
| `name` | Optional display name for the provider. Defaults to its ID. |
|
|
159
|
-
| `baseUrl` | Default endpoint for this provider's models. A new provider normally needs this for its first custom model; a model may override it. |
|
|
160
|
-
| `api` | Default [API tag](#api-tags) for entries in `models`. |
|
|
161
|
-
| `apiKey` | Optional fallback API-key value; see [Value Resolution](#value-resolution) and [credential resolution](providers.md#resolution-order). |
|
|
162
|
-
| `oauth` | Dynamic OAuth provider type. `"radius"` is the only supported value and requires a Radius gateway `baseUrl`; see [Providers: Radius](providers.md#radius). |
|
|
163
|
-
| `headers` | Request headers for every model on the provider; see [Custom Headers](#custom-headers). |
|
|
164
|
-
| `authHeader` | Adds `Authorization: Bearer <resolved apiKey>` after resolving authentication. |
|
|
165
|
-
| `compat` | Compatibility defaults merged into the provider's models; see [Compatibility Options](#compatibility-options). |
|
|
166
|
-
| `models` | Custom model definitions. On a built-in provider they are added or replaced by `id`; other catalog models remain. |
|
|
167
|
-
| `modelOverrides` | Partial changes for matching final models, including built-in and extension-registered models; see [Per-model Overrides](#per-model-overrides). |
|
|
156
|
+
See [Provider fields](models-configuration.md#providers) for the complete field reference and defaults. `oauth: "radius"` selects the Radius OAuth flow and requires a gateway `baseUrl`; see [Providers: Radius](providers.md#radius).
|
|
168
157
|
|
|
169
158
|
A custom model needs an effective `baseUrl` and `api`. For a new provider, put both on the provider (the usual approach) or on its first model. On a built-in provider, a model that replaces an existing ID can fall back to that catalog model's endpoint and API. `contextWindow` and `maxTokens`, when supplied in a `models` entry, must be positive.
|
|
170
159
|
|
|
@@ -236,24 +225,7 @@ Provider headers apply to every request. A configured model header overrides the
|
|
|
236
225
|
|
|
237
226
|
A `models` entry supplies a complete custom model definition with useful defaults. A model matching a built-in ID replaces that catalog entry rather than partially modifying it; use [`modelOverrides`](#per-model-overrides) for partial changes.
|
|
238
227
|
|
|
239
|
-
|
|
240
|
-
| --- | --- | --- | --- |
|
|
241
|
-
| `id` | Yes | — | Model identifier sent to the API. |
|
|
242
|
-
| `name` | No | `id` | Human-readable label. It is searchable by `--model` patterns and shown as model detail text. |
|
|
243
|
-
| `api` | No | Provider `api` | [API tag](#api-tags) for this model. |
|
|
244
|
-
| `baseUrl` | No | Provider `baseUrl` | Endpoint override for this model. |
|
|
245
|
-
| `reasoning` | No | `false` | Whether the model supports Pi thinking levels. |
|
|
246
|
-
| `thinkingLevelMap` | No | omitted | Maps Pi thinking levels to provider values and declares unsupported levels; see below. |
|
|
247
|
-
| `input` | No | `["text"]` | Supported input kinds: `text` and `image`. |
|
|
248
|
-
| `inputLimits` | No | omitted | Request limits and image preprocessing for this model; see [Image Input Limits](#image-input-limits). |
|
|
249
|
-
| `contextWindow` | No | `128000` | Context window in tokens. |
|
|
250
|
-
| `maxTokens` | No | `16384` | Maximum generated tokens. |
|
|
251
|
-
| `samplingParamsByThinkingLevel` | No | omitted | Per-level sampling overrides; see [Configure sampling by thinking level](#configure-sampling-by-thinking-level). |
|
|
252
|
-
| `samplingParams` | No | omitted | Free-form sampling parameters merged verbatim into every request body; see [Sampling Parameters](#sampling-parameters). |
|
|
253
|
-
| `cost` | No | all rates `0` | Per-million-token rates and optional request-wide price tiers. |
|
|
254
|
-
| `promptCache` | No | omitted | Best-effort prompt cache lifetime in seconds per retention tier; see [Prompt Cache Lifetimes](#prompt-cache-lifetimes). |
|
|
255
|
-
| `headers` | No | omitted | Model-specific request headers; see [Custom Headers](#custom-headers). |
|
|
256
|
-
| `compat` | No | provider `compat` | Compatibility refinements merged with provider defaults. |
|
|
228
|
+
See [Model fields](models-configuration.md#models) for the complete field reference, including defaults and nested cost and input-limit shapes.
|
|
257
229
|
|
|
258
230
|
`/model`, `--list-models`, and the footer show a model's `id`; `name` does not replace it. The model selector and `--model` pattern matching also search `name`.
|
|
259
231
|
|
|
@@ -506,20 +478,7 @@ Set `compat` on a provider for defaults or on a `models`/`modelOverrides` entry
|
|
|
506
478
|
|
|
507
479
|
For `api: "anthropic-messages"`, use these options for Anthropic-compatible endpoints:
|
|
508
480
|
|
|
509
|
-
|
|
510
|
-
| --- | --- |
|
|
511
|
-
| `supportsEagerToolInputStreaming` | Accepts per-tool `eager_input_streaming`. Default: `true`. When `false`, Pi omits it and sends the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests. |
|
|
512
|
-
| `supportsLongCacheRetention` | Accepts `cache_control.ttl: "1h"` for long cache retention. Default: `true`. |
|
|
513
|
-
| `sendSessionAffinityHeaders` | Sends `x-session-affinity` from the session ID when caching is enabled. Default: `false`; built-in model metadata can enable it for providers that need it. |
|
|
514
|
-
| `supportsCacheControlOnTools` | Accepts Anthropic `cache_control` on tool definitions. Default: `true`. |
|
|
515
|
-
| `supportsTemperature` | Accepts non-default `temperature`. Default: `true`; set `false` for endpoints such as Claude Opus 4.7+ that reject it. |
|
|
516
|
-
| `forceAdaptiveThinking` | Uses adaptive thinking (`thinking.type: "adaptive"` and `output_config.effort`) regardless of model ID. Default: `false`. |
|
|
517
|
-
| `allowEmptySignature` | Replays an empty thinking signature as `signature: ""` instead of converting the thinking block to text. Default: `false`. |
|
|
518
|
-
| `supportsStrictTools` | Accepts strict JSON-schema tool definitions. Default: `false`; capable built-in Anthropic models set it in their metadata. |
|
|
519
|
-
| `supportsMidConvoEffort` | Accepts effort-only system messages and thinking binding controls. Default: `false`. |
|
|
520
|
-
| `supportsMidConvoSystemMessages` | Accepts system-role messages inside the conversation. When `false`, later system messages fold into the top-level system prompt. Default: `false`. |
|
|
521
|
-
| `supportsMidConvoToolChanges` | Accepts mid-conversation `tool_addition` and `tool_removal` blocks. Requires `supportsMidConvoSystemMessages`. Default: `false`. |
|
|
522
|
-
| `allowedFallbackModels` | Models Anthropic accepts in `fallbacks` for server-side refusal fallback, with local pricing metadata for returned fallback responses. Omit `fallbacks` when empty. |
|
|
481
|
+
See [Anthropic Messages compatibility fields](models-configuration.md#anthropic-messages) for the complete field reference and defaults.
|
|
523
482
|
|
|
524
483
|
For example, a proxy that lacks eager streaming but supports long cache retention and adaptive thinking can use:
|
|
525
484
|
|
|
@@ -554,36 +513,9 @@ For example, a proxy that lacks eager streaming but supports long cache retentio
|
|
|
554
513
|
|
|
555
514
|
For `api: "openai-completions"`, Pi auto-detects many defaults from the provider ID and base URL. Set an option only when the endpoint differs from that behavior.
|
|
556
515
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
| `supportsDeveloperRole` | Uses `developer` rather than `system` for reasoning models. Default: URL-detected. |
|
|
561
|
-
| `supportsReasoningEffort` | Accepts `reasoning_effort` when the selected thinking format uses it. Default: URL-detected. |
|
|
562
|
-
| `supportsUsageInStreaming` | Accepts `stream_options: { "include_usage": true }`. Default: `true`. |
|
|
563
|
-
| `supportsFinishReason` | Whether streamed responses include `finish_reason`. When `false`, Pi infers `stop` or `toolUse` when the stream ends. Default: `true`. |
|
|
564
|
-
| `maxTokensField` | Selects `max_completion_tokens` or `max_tokens`. Default: URL-detected. |
|
|
565
|
-
| `requiresToolResultName` | Requires `name` on tool-result messages. Default: URL-detected. |
|
|
566
|
-
| `requiresAssistantAfterToolResult` | Requires an assistant message before a user message following tool results. Default: URL-detected. |
|
|
567
|
-
| `requiresThinkingAsText` | Replays thinking blocks as text delimited by `<thinking>`. Default: URL-detected. |
|
|
568
|
-
| `requiresReasoningContentOnAssistantMessages` | Includes empty `reasoning_content` on replayed assistant messages when reasoning is enabled. Default: URL-detected. |
|
|
569
|
-
| `thinkingFormat` | One of `openai`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, `chat-template`, `qwen-chat-template`, `string-thinking`, or `ant-ling`. Default: `openai` unless URL detection selects a known provider format. |
|
|
570
|
-
| `chatTemplateKwargs` | `chat_template_kwargs` for `thinkingFormat: "chat-template"`. Values may be strings, numbers, booleans, `null`, or `{ "$var": "thinking.enabled" | "thinking.effort" | "thinking.budget", "omitWhenOff"?: true }`. |
|
|
571
|
-
| `chatTemplateArgs` | `chat_template_args` for `thinkingFormat: "baseten"`. Values may be strings, numbers, booleans, `null`, or `{ "$var": "thinking.enabled" | "thinking.effort" | "thinking.budget", "omitWhenOff"?: true }`. |
|
|
572
|
-
| `thinkingTokenBudgetField` | Top-level request field used to cap reasoning tokens from `thinkingBudgets`, clamped so at least 1024 tokens remain for the answer. Use `thinking_token_budget` for vLLM, `thinking_budget` for Qwen/DashScope/SGLang, or `thinking_budget_tokens` for llama.cpp. Off by default. |
|
|
573
|
-
| `supportsThinkingTokenBudget` | Alias for `thinkingTokenBudgetField: "thinking_token_budget"` (vLLM). Prefer `thinkingTokenBudgetField`. Default: `false`. |
|
|
574
|
-
| `zaiToolStream` | Sends top-level `tool_stream: true` when tools are present. Default: `false`; use only for Z.AI-compatible endpoints that require it. |
|
|
575
|
-
| `cacheControlFormat` | `anthropic` applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and final text content when caching is enabled. |
|
|
576
|
-
| `sendSessionAffinityHeaders` | Sends session-affinity headers from the session ID when caching is enabled. Default: `false`. |
|
|
577
|
-
| `sessionAffinityFormat` | `openai` sends `session_id`, `x-client-request-id`, and `x-session-affinity`; `openai-nosession` omits `session_id`; `openrouter` sends `x-session-id`. It does not change `prompt_cache_key`. Default: URL-detected. |
|
|
578
|
-
| `supportsStrictMode` | Accepts strict JSON-schema function tools. Default: URL-detected. |
|
|
579
|
-
| `supportsOpenAIGrammarTools` | Emits OpenAI Lark/regex grammar tools. When `false`, grammar-constrained tools fall back to normal function tools. Default: `false`. |
|
|
580
|
-
| `supportsMidConvoSystemMessages` | Accepts system or developer messages after the conversation has started. When `false`, later system messages fold into the leading system message. Default: `false`. |
|
|
581
|
-
| `supportsMidConvoToolAdditions` | Accepts tools introduced by mid-conversation system messages. Requires `supportsMidConvoSystemMessages`. Default: `false`. |
|
|
582
|
-
| `supportsLongCacheRetention` | Accepts long prompt-cache retention: `prompt_cache_retention: "24h"`, or `cache_control.ttl: "1h"` with `cacheControlFormat: "anthropic"`. Default: `true` except URL-detected incompatible endpoints. |
|
|
583
|
-
| `openRouterRouting` | OpenRouter routing preferences sent unchanged in the request `provider` field. |
|
|
584
|
-
| `vercelGatewayRouting` | Vercel AI Gateway routing preferences (`only`, `order`) sent as `providerOptions.gateway`. |
|
|
585
|
-
|
|
586
|
-
Thinking formats use these request shapes: `openai` sends `reasoning_effort`; `openrouter` sends `reasoning: { effort }`; `deepseek` sends `thinking: { type }` and, when enabled, `reasoning_effort`; `together` sends `reasoning: { enabled }` and optionally `reasoning_effort`; `zai` sends `thinking: { type }`; `qwen` sends `enable_thinking`; `qwen-chat-template` sends `chat_template_kwargs.enable_thinking` and `preserve_thinking`; `string-thinking` sends top-level `thinking` as a string; and `ant-ling` sends `reasoning: { effort }` only for a non-null mapped effort. `chat-template` sends the configured `chatTemplateKwargs`.
|
|
516
|
+
See [OpenAI Chat Completions compatibility fields](models-configuration.md#openai-completions) for the complete field reference and defaults.
|
|
517
|
+
|
|
518
|
+
Thinking formats use these request shapes: `openai` sends `reasoning_effort`; `openrouter` sends `reasoning: { effort }`; `deepseek` sends `thinking: { type }` and, when enabled, `reasoning_effort`; `together` sends `reasoning: { enabled }` and optionally `reasoning_effort`; `baseten` sends the configured `chatTemplateArgs` and optionally `reasoning_effort`; `zai` sends `thinking: { type }`; `qwen` sends `enable_thinking`; `qwen-chat-template` sends `chat_template_kwargs.enable_thinking` and `preserve_thinking`; `string-thinking` sends top-level `thinking` as a string; and `ant-ling` sends `reasoning: { effort }` only for a non-null mapped effort. `chat-template` sends the configured `chatTemplateKwargs`.
|
|
587
519
|
|
|
588
520
|
`thinkingTokenBudgetField` is independent of `thinkingFormat`. Do not enable it on the generated Qwen catalog: those models already send `reasoning_effort`, and DashScope rejects `thinking_budget` together with `reasoning_effort`.
|
|
589
521
|
|
|
@@ -686,17 +618,7 @@ Vercel AI Gateway example:
|
|
|
686
618
|
|
|
687
619
|
### OpenAI Responses
|
|
688
620
|
|
|
689
|
-
For `api: "openai-responses"`,
|
|
690
|
-
|
|
691
|
-
| Field | Description |
|
|
692
|
-
| --- | --- |
|
|
693
|
-
| `supportsDeveloperRole` | Uses `developer` rather than `system` for reasoning models. Default: `true`. |
|
|
694
|
-
| `sessionAffinityFormat` | `openai` sends `session_id` and `x-client-request-id`; `openai-nosession` omits `session_id`; `openrouter` sends `x-session-id`. It does not change `prompt_cache_key`. |
|
|
695
|
-
| `supportsLongCacheRetention` | Accepts long cache retention: `prompt_cache_options.ttl: "30m"` when `supportsExplicitPromptCacheMode` is enabled (including GPT-5.6+ Responses models), otherwise `prompt_cache_retention: "24h"`. Default: `true`. |
|
|
696
|
-
| `supportsStrictMode` | Accepts strict JSON-schema function tools. Default: `false`. |
|
|
697
|
-
| `supportsOpenAIGrammarTools` | Emits OpenAI Lark/regex grammar tools. Default: `false`. |
|
|
698
|
-
| `supportsToolSearch` | Supports client-executed deferred tool search. Default: `false`. |
|
|
699
|
-
| `supportsExplicitPromptCacheMode` | Accepts `prompt_cache_options: { mode: "explicit" }` when cache retention is `none`, which disables implicit prompt caching; long cache retention uses `{ ttl: "30m" }` when `supportsLongCacheRetention` is also enabled. Default: `false`. |
|
|
621
|
+
For `api: "openai-responses"`, see [Responses compatibility fields](models-configuration.md#openai-responses) for the complete field reference and defaults.
|
|
700
622
|
|
|
701
623
|
The public Pi AI model type also exposes the Responses compatibility shape for `azure-openai-responses` and `openai-codex-responses`. The Azure transport uses `supportsDeveloperRole`, `supportsStrictMode`, and `supportsOpenAIGrammarTools`; the Codex transport uses `supportsStrictMode`, `supportsOpenAIGrammarTools`, and `supportsToolSearch`. Other Responses options do not alter those transports.
|
|
702
624
|
|
package/docs/packages.md
CHANGED
|
@@ -9,6 +9,7 @@ Pi packages bundle extensions, skills, prompt templates, and themes so you can s
|
|
|
9
9
|
- [Install and Manage](#install-and-manage)
|
|
10
10
|
- [Package Sources](#package-sources)
|
|
11
11
|
- [Creating a Pi Package](#creating-a-pi-package)
|
|
12
|
+
- [Show a changelog](#show-a-changelog)
|
|
12
13
|
- [Package Structure](#package-structure)
|
|
13
14
|
- [Dependencies](#dependencies)
|
|
14
15
|
- [Package Filtering](#package-filtering)
|
|
@@ -42,13 +43,17 @@ These commands manage pi packages and `pi update` can update the pi CLI installa
|
|
|
42
43
|
|
|
43
44
|
By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup after the project is trusted.
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
If a configured package fails to install at startup, for example because npm cannot reach the registry, pi warns about it, skips that package's resources, and keeps running. It tries again on the next start or `/reload`. `pi install` and `pi update --extensions` still report the failure and exit non-zero.
|
|
47
|
+
|
|
48
|
+
To try a package without installing it, use `--extension` or `-e`. It is not added to settings:
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
51
|
pi -e npm:@foo/bar
|
|
49
52
|
pi -e git:github.com/user/repo
|
|
50
53
|
```
|
|
51
54
|
|
|
55
|
+
Pi caches `-e` packages under `~/.pi/agent/tmp/extensions/` and checks them on every start and `/reload`. An npm package is reinstalled when the registry has a newer version that matches the specification; an exact version such as `@1.2.3` is not checked. A git package is fetched and reset to the remote branch or ref; a commit hash that is already checked out is not fetched. If the check fails or offline mode is on, pi loads the cached copy.
|
|
56
|
+
|
|
52
57
|
## Package Sources
|
|
53
58
|
|
|
54
59
|
Pi accepts three source types in settings and `pi install`.
|
|
@@ -154,6 +159,26 @@ The [package gallery](https://pi.dev/packages) displays packages tagged with `pi
|
|
|
154
159
|
|
|
155
160
|
If both are set, video takes precedence.
|
|
156
161
|
|
|
162
|
+
## Show a changelog
|
|
163
|
+
|
|
164
|
+
After a package update, pi can show what changed. On the next fresh launch, pi reads the package changelog and shows entries newer than the last seen version under "Extension Updates", the same way it shows its own changelog. The first time pi sees a package, it records the version without showing anything.
|
|
165
|
+
|
|
166
|
+
This applies to packages that load at least one extension. Packages that only provide skills, prompt templates, or themes do not show a changelog.
|
|
167
|
+
|
|
168
|
+
By default pi reads `CHANGELOG.md` from the package root. Point `pi.changelogPath` at another file inside the package, or set it to `""` to disable the changelog:
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"name": "my-package",
|
|
173
|
+
"version": "1.2.0",
|
|
174
|
+
"pi": {
|
|
175
|
+
"changelogPath": "./docs/CHANGELOG.md"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Use version headings such as `## [1.2.0]` or `## 1.2.0 - 2026-01-01`. Entries are matched against the `version` field in `package.json`, so a git package only shows a changelog when that field increases. The `collapseChangelog` setting condenses the section to one line per package, such as `Updated my-package to v1.2.0.` `/changelog` does not show package changelogs; read the package's changelog file or repository for details.
|
|
181
|
+
|
|
157
182
|
## Package Structure
|
|
158
183
|
|
|
159
184
|
### Convention Directories
|
package/docs/rpc.md
CHANGED
|
@@ -959,7 +959,7 @@ Emitted when nothing more will happen without new input: no run, compaction, ret
|
|
|
959
959
|
{"type": "session_quiescent"}
|
|
960
960
|
```
|
|
961
961
|
|
|
962
|
-
`RpcClient.waitForQuiescence(timeout?)` resolves on this event, or at once when `get_state` reports `isQuiescent
|
|
962
|
+
`RpcClient.waitForQuiescence(timeout?)` resolves on this event, or at once when `get_state` reports `isQuiescent`. `collectEventsUntilQuiescent(timeout?)` collects events until the next one: start it before the prompt it should cover, since it does not resolve early when the session is quiescent before that prompt begins. `waitForIdle()` and `collectEvents()` still resolve on the first `agent_settled`. Closing stdin shuts the process down immediately, without waiting for Background work.
|
|
963
963
|
|
|
964
964
|
### turn_start / turn_end
|
|
965
965
|
|