@maxmo74/pi-coding-agent 1.6.0-max.16 → 1.7.0-max.17
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 +106 -0
- package/LICENSE +1 -1
- package/dist/bundle/chunks/anthropic-messages-VOAE66ME.js +3 -0
- package/dist/bundle/chunks/azure-openai-responses-FWQRNMCY.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +6 -6
- package/dist/bundle/chunks/chunk-2BKJ4UF2.js +6 -0
- package/dist/bundle/chunks/{chunk-YOWSKVK7.js → chunk-2HV66XRA.js} +1 -1
- package/dist/bundle/chunks/chunk-7TLS4DNZ.js +30 -0
- package/dist/bundle/chunks/{chunk-E6LJTZYC.js → chunk-AIIDHDL2.js} +1 -1
- package/dist/bundle/chunks/chunk-ARDROFM7.js +20 -0
- package/dist/bundle/chunks/{chunk-36QC74V4.js → chunk-D5E4JUBX.js} +1 -1
- package/dist/bundle/chunks/{chunk-EVSO24NP.js → chunk-D5U74ZAG.js} +1 -1
- package/dist/bundle/chunks/{chunk-ILDLA2JW.js → chunk-E3GEPN3H.js} +1 -1
- package/dist/bundle/chunks/{chunk-XGGZYFNG.js → chunk-G5K7SYL7.js} +2 -2
- package/dist/bundle/chunks/chunk-GBB3EUD7.js +16 -0
- package/dist/bundle/chunks/chunk-GMDZZCKH.js +2 -0
- package/dist/bundle/chunks/{chunk-NRY4NBZW.js → chunk-HFTJRRFR.js} +2 -2
- package/dist/bundle/chunks/{chunk-NRLRGOCX.js → chunk-IOF7AZCL.js} +1 -1
- package/dist/bundle/chunks/chunk-J35HXFD7.js +2 -0
- package/dist/bundle/chunks/{chunk-KREOSXD7.js → chunk-KPWXWGGJ.js} +1 -1
- package/dist/bundle/chunks/chunk-MDJ5LWZA.js +44 -0
- package/dist/bundle/chunks/{chunk-I6HYYNH6.js → chunk-O5MXS5TI.js} +1 -1
- package/dist/bundle/chunks/chunk-OVXT2WQH.js +2 -0
- package/dist/bundle/chunks/{chunk-EXXWEFU5.js → chunk-PADKDPJN.js} +99 -104
- package/dist/bundle/chunks/chunk-PST3NXKM.js +2 -0
- package/dist/bundle/chunks/chunk-S2GRKWHT.js +14 -0
- package/dist/bundle/chunks/{chunk-X26YOAEH.js → chunk-V7D5E4XS.js} +13 -12
- package/dist/bundle/chunks/chunk-Z2XZSUHM.js +2 -0
- package/dist/bundle/chunks/{cli-QMJEURSM.js → cli-OH5BEVHD.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-Z73UPEZ7.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-7CBVPJQ3.js → easter-egg-3d-BOWYTYMI.js} +1 -1
- package/dist/bundle/chunks/{execute-XDNPBEMU.js → execute-UXTJZEKY.js} +3 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-VI7CGXA2.js +2 -0
- package/dist/bundle/chunks/google-vertex-UGCMSJWH.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-XXZYF3RR.js → llama-cpp-classify-SKDW7RUG.js} +2 -2
- package/dist/bundle/chunks/mistral-conversations-F2GKIAZI.js +4 -0
- package/dist/bundle/chunks/openai-codex-responses-B54DADY4.js +2 -0
- package/dist/bundle/chunks/openai-completions-5UNXROMA.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-LZ2RLVRX.js → openai-decisions-IN2F5D4R.js} +1 -1
- package/dist/bundle/chunks/openai-responses-2567WJBU.js +4 -0
- package/dist/bundle/chunks/openrouter-images-MPCL4RTO.js +2 -0
- package/dist/bundle/chunks/pi-decision-GZ2BG2JB.js +2 -0
- package/dist/bundle/chunks/pi-image-CXEQM6AW.js +2 -0
- package/dist/bundle/chunks/pi-messages-PDCTBGXV.js +2 -0
- package/dist/bundle/chunks/{runtime-F3SXQONS.js → runtime-JESTW74H.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-6M47QHZX.js +2 -0
- package/dist/bundle/chunks/virtual-modules-QBVXFHBM.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/agent-dir-arg.d.ts +20 -0
- package/dist/cli/agent-dir-arg.d.ts.map +1 -0
- package/dist/cli/agent-dir-arg.js +38 -0
- package/dist/cli/agent-dir-arg.js.map +1 -0
- package/dist/cli/args.d.ts +6 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +45 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +0 -5
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js +6 -6
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +3 -2
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +17 -23
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +6 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -2
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +6 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -0
- 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 +7 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +3 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +24 -13
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/client-identity.d.ts +2 -3
- package/dist/core/client-identity.d.ts.map +1 -1
- package/dist/core/client-identity.js +3 -4
- package/dist/core/client-identity.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +3 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +2 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/messages.d.ts +4 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +10 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +36 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -4
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -2
- package/dist/core/model-runtime.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/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -0
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +2 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +4 -0
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +10 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +6 -2
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +6 -2
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -6
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +23 -16
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +16 -3
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +23 -8
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/tools/bash.d.ts +3 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +24 -9
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +16 -4
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +47 -41
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +9 -3
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +11 -5
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +3 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +36 -5
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +3 -13
- 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 +2 -1
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +3 -3
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +1 -9
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +8 -124
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +18 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +7 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- 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 +13 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
- package/dist/modes/interactive/components/extension-editor.js +2 -2
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +3 -5
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +15 -45
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +13 -4
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +10 -9
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +3 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -5
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +57 -46
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +3 -3
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +13 -3
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +18 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +105 -75
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/program-resume-reporter.d.ts +32 -0
- package/dist/modes/interactive/program-resume-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-resume-reporter.js +56 -0
- package/dist/modes/interactive/program-resume-reporter.js.map +1 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +4 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js +9 -1
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +1 -4
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +13 -13
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -4
- 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 +10 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard.js +1 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/output-files.d.ts +20 -4
- package/dist/utils/output-files.d.ts.map +1 -1
- package/dist/utils/output-files.js +37 -2
- package/dist/utils/output-files.js.map +1 -1
- package/dist/utils/shell.d.ts +2 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +56 -7
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +9 -8
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +3 -1
- package/docs/codemode.md +16 -5
- package/docs/environment-variables.md +4 -4
- package/docs/extensions.md +14 -4
- package/docs/llama-cpp.md +3 -3
- package/docs/message-types.md +1 -0
- package/docs/models-configuration.md +14 -3
- package/docs/models.md +34 -14
- package/docs/providers.md +3 -3
- package/docs/rpc-commands.md +1 -1
- package/docs/settings.md +5 -3
- package/docs/shell-aliases.md +1 -1
- package/docs/terminal-setup.md +53 -0
- package/docs/windows.md +2 -1
- package/examples/extensions/subagent/index.ts +3 -2
- package/examples/rpc-extension-ui.ts +8 -7
- package/package.json +9 -9
- package/schemas/models.schema.json +20 -7
- package/schemas/settings.schema.json +30 -10
- package/dist/bundle/chunks/anthropic-messages-WAFIHSF7.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-EB4MRIM4.js +0 -2
- package/dist/bundle/chunks/chunk-EEBRZED2.js +0 -44
- package/dist/bundle/chunks/chunk-F7LEMV2T.js +0 -2
- package/dist/bundle/chunks/chunk-NV3NPOPF.js +0 -20
- package/dist/bundle/chunks/chunk-PMRZO46Y.js +0 -2
- package/dist/bundle/chunks/chunk-RCNEHRMW.js +0 -2
- package/dist/bundle/chunks/chunk-X6RQRO3L.js +0 -16
- package/dist/bundle/chunks/chunk-XJ2YV77J.js +0 -30
- package/dist/bundle/chunks/chunk-Y55SJART.js +0 -13
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-AMCR7QEI.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-43M4N5LK.js +0 -2
- package/dist/bundle/chunks/google-vertex-2B3PASK2.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-E3D5ZQKB.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-MSQDSDUR.js +0 -10
- package/dist/bundle/chunks/openai-completions-4IC6AGTR.js +0 -7
- package/dist/bundle/chunks/openai-responses-MCO3BHCC.js +0 -4
- package/dist/bundle/chunks/openrouter-images-SHUJ3VSG.js +0 -2
- package/dist/bundle/chunks/pi-messages-NIKOQ4O7.js +0 -8
- package/dist/bundle/chunks/typesafe-system-one-R2CDUWNO.js +0 -2
- package/dist/bundle/chunks/virtual-modules-2WYTGPJ3.js +0 -2
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js +0 -9
- package/dist/core/telemetry.js.map +0 -1
package/docs/extensions.md
CHANGED
|
@@ -355,7 +355,7 @@ The model request runs these hooks in order:
|
|
|
355
355
|
2. `context_with_system` (can modify the full transcript)
|
|
356
356
|
3. `before_provider_headers` (can mutate headers)
|
|
357
357
|
4. `before_provider_request` (can inspect or replace the payload)
|
|
358
|
-
5. `after_provider_response` (status and headers, before
|
|
358
|
+
5. `after_provider_response` (status and headers of each HTTP response, including errors and retried attempts; successful responses fire before their stream is consumed)
|
|
359
359
|
6. `provider_stream_event` (raw parsed stream events) and `message_start` / `message_update` / `message_end` for the assistant message
|
|
360
360
|
|
|
361
361
|
A tool call that executes runs these hooks in order:
|
|
@@ -882,7 +882,7 @@ The payload is the full request. Providers that continue from a previous respons
|
|
|
882
882
|
|
|
883
883
|
#### after_provider_response
|
|
884
884
|
|
|
885
|
-
Fired
|
|
885
|
+
Fired for each HTTP response the provider receives, including error responses (4xx/5xx) and responses to retried attempts, so one request can fire it more than once. Successful responses fire before their stream body is consumed. Handlers run in extension load order.
|
|
886
886
|
|
|
887
887
|
```typescript
|
|
888
888
|
pi.on("after_provider_response", (event, ctx) => {
|
|
@@ -894,7 +894,7 @@ pi.on("after_provider_response", (event, ctx) => {
|
|
|
894
894
|
});
|
|
895
895
|
```
|
|
896
896
|
|
|
897
|
-
|
|
897
|
+
Coverage depends on provider and transport. Some providers report empty headers or only some responses. It does not fire for errors that arrive inside an already started SSE stream, or for WebSocket transports, including a WebSocket connection that fails to open.
|
|
898
898
|
|
|
899
899
|
#### provider_stream_event
|
|
900
900
|
|
|
@@ -1225,7 +1225,7 @@ Use `ctx.modelRegistry.streamSimple(model, context, options)` for provider-neutr
|
|
|
1225
1225
|
|
|
1226
1226
|
`streamSimple()` returns an `AssistantMessageEventStream`. Iterate it for response events and await `.result()` for the final message. Setup failures produce error events and error results.
|
|
1227
1227
|
|
|
1228
|
-
For non-chat models, `findOfType()`, `getModelsOfType()`, `getAvailableOfType()`, and `getModelOfType()` look up image and classifier models, and `classify()` and `generateImages()` call them. See [Use
|
|
1228
|
+
For non-chat models, `findOfType()`, `getModelsOfType()`, `getAvailableOfType()`, and `getModelOfType()` look up image and decision (`"classifier"`) models, and `classify()` and `generateImages()` call them. See [Use decision models](models.md#use-decision-models) and [Use image models](models.md#use-image-models).
|
|
1229
1229
|
|
|
1230
1230
|
### ctx.signal
|
|
1231
1231
|
|
|
@@ -2888,6 +2888,16 @@ if (confirmed) {
|
|
|
2888
2888
|
|
|
2889
2889
|
See [examples/extensions/timed-confirm.ts](../examples/extensions/timed-confirm.ts) for complete examples.
|
|
2890
2890
|
|
|
2891
|
+
#### Program Status Kind
|
|
2892
|
+
|
|
2893
|
+
While a dialog waits, terminals that support [program status](terminal-setup.md#program-status) show pi as blocked, with the first line of the title as the message. `confirm()` reports `"permission"`, `select()` and `input()` report `"question"`. Pass `blockedKind` when the dialog asks for something else, for example a select that approves an action:
|
|
2894
|
+
|
|
2895
|
+
```typescript
|
|
2896
|
+
const choice = await ctx.ui.select("Deploy to production?", ["Deploy", "Deploy and tag", "Cancel"], {
|
|
2897
|
+
blockedKind: "permission", // "permission" | "question" | "auth"
|
|
2898
|
+
});
|
|
2899
|
+
```
|
|
2900
|
+
|
|
2891
2901
|
### Widgets, Status, and Footer
|
|
2892
2902
|
|
|
2893
2903
|
```typescript
|
package/docs/llama-cpp.md
CHANGED
|
@@ -96,10 +96,10 @@ If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconne
|
|
|
96
96
|
|
|
97
97
|
## Classification
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
Decision models answer typed `choice`, `bool`, and `score` questions about JSON state, like TypeSafe's Jev models. The model reaches them from [`codemode`](cli.md#enable-codemode) scripts, and extensions through `ctx.modelRegistry.classify()`; see [Use decision models](models.md#use-decision-models). Pi lists llama.cpp models under the `classifier` model type in two ways:
|
|
100
100
|
|
|
101
|
-
- **Decision models** such as [Julia-1, Laya, Kev, lev, and OpenJev](https://huggingface.co/collections/ggml-org/decision-models-6abf80cca3c83f127060a769) answer natively through llama.cpp's `/v1/systemone` endpoint. They appear only
|
|
102
|
-
- **Chat models** are also listed
|
|
101
|
+
- **Decision models** such as [Julia-1, Laya, Kev, lev, and OpenJev](https://huggingface.co/collections/ggml-org/decision-models-6abf80cca3c83f127060a769) answer natively through llama.cpp's `/v1/systemone` endpoint. They appear only under the `classifier` model type, with the `typesafe-system-one` API, and not in `/model`.
|
|
102
|
+
- **Chat models** are also listed under the `classifier` model type with the same ID and the `llama-cpp-classify` API, which reads answers from next-token probabilities as described below.
|
|
103
103
|
|
|
104
104
|
llama.cpp 0.6.0 and later report decision models in the router's model list: their `architecture.output_modalities` contains `decisions`. The router reads this from the GGUF metadata without loading the model, so Pi recognizes unloaded and sleeping decision models too. Older llama.cpp builds do not report it, and Pi lists their decision models as chat models.
|
|
105
105
|
|
package/docs/message-types.md
CHANGED
|
@@ -210,6 +210,7 @@ interface BashExecutionMessage {
|
|
|
210
210
|
cancelled: boolean;
|
|
211
211
|
truncated: boolean;
|
|
212
212
|
fullOutputPath?: string;
|
|
213
|
+
fullOutputError?: string; // why the full output could not be saved, when truncated
|
|
213
214
|
excludeFromContext?: boolean;
|
|
214
215
|
timestamp: number;
|
|
215
216
|
}
|
|
@@ -34,7 +34,7 @@ Each `models` entry adds a model to the provider. An entry whose `id` matches an
|
|
|
34
34
|
| `api` | string | | Overrides the provider api. |
|
|
35
35
|
| `baseUrl` | string | | Overrides the provider baseUrl. |
|
|
36
36
|
| `reasoning` | boolean | `false` | Whether the model supports thinking. |
|
|
37
|
-
| `thinkingLevelMap` | object | | Provider value sent for each thinking level.
|
|
37
|
+
| `thinkingLevelMap` | object | | Provider value sent for each thinking level. A string is sent to the provider; null hides the level. Levels left out use the provider's default value for off through high; xhigh and max are opt-in and only offered when mapped to a string. |
|
|
38
38
|
| `input` | `("text" \| "image")[]` | `["text"]` | |
|
|
39
39
|
| `inputLimits` | [object](#input-limits) | | |
|
|
40
40
|
| `cost` | object | | |
|
|
@@ -42,6 +42,7 @@ Each `models` entry adds a model to the provider. An entry whose `id` matches an
|
|
|
42
42
|
| `cost.output` | number | | Required. Output cost in USD per million tokens. |
|
|
43
43
|
| `cost.cacheRead` | number | | Required. Cache-read cost in USD per million tokens. |
|
|
44
44
|
| `cost.cacheWrite` | number | | Required. Cache-write cost in USD per million tokens. |
|
|
45
|
+
| `cost.imageOutput` | number | | Image output cost in USD per million tokens, for models that generate images. Image output tokens use this rate and the rest of output (text and reasoning) uses `output`. Unset means image tokens cost `output`. |
|
|
45
46
|
| `cost.tiers` | `object[]` | | Request-wide pricing tiers. The highest matching input threshold applies to the full request. |
|
|
46
47
|
| `cost.tiers[].inputTokensAbove` | number | | Required. Use this tier when total request input exceeds this token count. |
|
|
47
48
|
| `cost.tiers[].input` | number | | Required. Input cost in USD per million tokens. |
|
|
@@ -64,7 +65,7 @@ Each `modelOverrides` key is the ID of a built-in or extension model. Unknown ID
|
|
|
64
65
|
|---|---|---|---|
|
|
65
66
|
| `name` | string | | Display name, also matched by --model patterns. |
|
|
66
67
|
| `reasoning` | boolean | | Whether the model supports thinking. |
|
|
67
|
-
| `thinkingLevelMap` | object | | Provider value sent for each thinking level.
|
|
68
|
+
| `thinkingLevelMap` | object | | Provider value sent for each thinking level. A string is sent to the provider; null hides the level. Levels left out use the provider's default value for off through high; xhigh and max are opt-in and only offered when mapped to a string. |
|
|
68
69
|
| `input` | `("text" \| "image")[]` | | |
|
|
69
70
|
| `inputLimits` | [object](#input-limits) | | |
|
|
70
71
|
| `cost` | object | | |
|
|
@@ -72,6 +73,7 @@ Each `modelOverrides` key is the ID of a built-in or extension model. Unknown ID
|
|
|
72
73
|
| `cost.output` | number | | Output cost in USD per million tokens. |
|
|
73
74
|
| `cost.cacheRead` | number | | Cache-read cost in USD per million tokens. |
|
|
74
75
|
| `cost.cacheWrite` | number | | Cache-write cost in USD per million tokens. |
|
|
76
|
+
| `cost.imageOutput` | number | | Image output cost in USD per million tokens, for models that generate images. Image output tokens use this rate and the rest of output (text and reasoning) uses `output`. Unset means image tokens cost `output`. |
|
|
75
77
|
| `cost.tiers` | `object[]` | | Request-wide pricing tiers. The highest matching input threshold applies to the full request. |
|
|
76
78
|
| `cost.tiers[].inputTokensAbove` | number | | Required. Use this tier when total request input exceeds this token count. |
|
|
77
79
|
| `cost.tiers[].input` | number | | Required. Input cost in USD per million tokens. |
|
|
@@ -122,7 +124,7 @@ See [Describe model input and caching](models.md#describe-model-input-and-cachin
|
|
|
122
124
|
| `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. |
|
|
123
125
|
| `requiresThinkingAsText` | boolean | | Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL. |
|
|
124
126
|
| `requiresReasoningContentOnAssistantMessages` | boolean | | Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. |
|
|
125
|
-
| `thinkingFormat` | `"openai" \| "openrouter" \| "deepseek" \| "together" \| "baseten" \| "zai" \| "qwen" \| "chat-template" \| "qwen-chat-template" \| "string-thinking"
|
|
127
|
+
| `thinkingFormat` | `"openai" \| "openrouter" \| "deepseek" \| "ant-ling" \| "together" \| "baseten" \| "zai" \| "qwen" \| "chat-template" \| "qwen-chat-template" \| "string-thinking"` | | 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" (deprecated alias: "ant-ling") 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, and "string-thinking" uses top-level thinking. |
|
|
126
128
|
| `chatTemplateKwargs` | object | | Kwargs sent as chat_template_kwargs when thinkingFormat is "chat-template". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values. |
|
|
127
129
|
| `chatTemplateArgs` | object | | Arguments sent as chat_template_args when thinkingFormat is "baseten". Use $var with "thinking.enabled", "thinking.effort", or "thinking.budget" for pi-controlled values. |
|
|
128
130
|
| `openRouterRouting` | object | | OpenRouter provider routing preferences. Controls which upstream providers OpenRouter routes requests to. Sent as the provider field in the OpenRouter API request body. See https://openrouter.ai/docs/guides/routing/provider-selection. |
|
|
@@ -184,6 +186,7 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
|
|
|
184
186
|
| Field | Type | Default | Description |
|
|
185
187
|
|---|---|---|---|
|
|
186
188
|
| `supportsStrictMode` | boolean | `false` | Whether the model supports Bedrock strict tool schemas. |
|
|
189
|
+
| `supportsReasoningReplay` | boolean | `true` | Whether the model accepts reasoning blocks from earlier assistant messages. When false, earlier reasoning is not sent back. The generated catalog disables this for Kimi K3 models, which fail on Converse when it is sent. |
|
|
187
190
|
|
|
188
191
|
### `mistral-conversations`
|
|
189
192
|
|
|
@@ -192,6 +195,14 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
|
|
|
192
195
|
| `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system messages after the conversation has started. When false, later system messages are folded into the leading system message. |
|
|
193
196
|
| `supportsStrictMode` | boolean | `false` | Whether the model supports strict (schema-constrained) function tools. |
|
|
194
197
|
|
|
198
|
+
### `google-generative-ai`
|
|
199
|
+
|
|
200
|
+
Also applies to `google-vertex`.
|
|
201
|
+
|
|
202
|
+
| Field | Type | Default | Description |
|
|
203
|
+
|---|---|---|---|
|
|
204
|
+
| `supportsStrictMode` | boolean | | Whether the model enforces strict tools through Gemini's VALIDATED function-calling mode. Default: true for model IDs containing gemini-3 or a later version, such as gemini-3-pro or vendor-gemini-4-argon, false otherwise. Set true for Gemini 3+ models served under IDs without the version. |
|
|
205
|
+
|
|
195
206
|
### `typesafe-system-one`
|
|
196
207
|
|
|
197
208
|
Also applies to `cloudflare-workers-ai-system-one`.
|
package/docs/models.md
CHANGED
|
@@ -111,6 +111,20 @@ Use `promptCache` to declare the provider's best-effort cache lifetime in second
|
|
|
111
111
|
|
|
112
112
|
Choose the conservative end of any published range. A model without a lifetime for the active tier is not eligible for cache warming. A `modelOverrides` entry can set `inputLimits` or `promptCache` for a built-in or extension model, including a model accessed through a validated proxy. See [`cacheWarming`](settings.md#model-and-thinking).
|
|
113
113
|
|
|
114
|
+
### Map thinking levels
|
|
115
|
+
|
|
116
|
+
Use `thinkingLevelMap` to choose which thinking levels `/thinking` offers and which provider value Pi sends for each:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"id": "reasoning-model",
|
|
121
|
+
"reasoning": true,
|
|
122
|
+
"thinkingLevelMap": { "minimal": null, "xhigh": "xhigh", "max": "max" }
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A string is sent to the provider as the effort value, and `null` hides the level. Levels left out use the provider's default value for `off` through `high`. `xhigh` and `max` are opt-in: Pi offers them only when the map gives them a string, which must be a value the provider accepts. Set the map in `models.json`, on a custom model or in a `modelOverrides` entry for a built-in model, not in `settings.json`.
|
|
127
|
+
|
|
114
128
|
### Configure sampling by thinking level
|
|
115
129
|
|
|
116
130
|
OpenAI-compatible APIs support free-form `samplingParams` model defaults and `samplingParamsByThinkingLevel` overrides. The latter uses Pi thinking-level keys (`off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`), not provider values from `thinkingLevelMap`:
|
|
@@ -139,9 +153,11 @@ Pi first clamps unsupported thinking levels, then merges model `samplingParams`,
|
|
|
139
153
|
|
|
140
154
|
Compatibility settings should describe verified differences in the endpoint's request or response behavior. Do not enable them based only on an endpoint advertising OpenAI or Anthropic compatibility.
|
|
141
155
|
|
|
142
|
-
|
|
156
|
+
<a id="use-classifier-models"></a>
|
|
143
157
|
|
|
144
|
-
|
|
158
|
+
## Use decision models
|
|
159
|
+
|
|
160
|
+
Decision models (listed in Pi's API under the `classifier` model type) 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 GPT-6 Luna Decisions and Microsoft-Decision-1 through GitHub Copilot:
|
|
145
161
|
|
|
146
162
|
| Provider | Model IDs | Authentication |
|
|
147
163
|
|---|---|---|
|
|
@@ -151,13 +167,15 @@ Classifier models do not chat. They answer typed questions about JSON state: pic
|
|
|
151
167
|
| `vercel-ai-gateway` | `typesafe-ai/jev` | `AI_GATEWAY_API_KEY` |
|
|
152
168
|
| `opencode` | `jev-1.13`, `jev-1.13-free` | `OPENCODE_API_KEY` |
|
|
153
169
|
| `openai` | `gpt-6-luna` | `OPENAI_API_KEY` |
|
|
154
|
-
| `github-copilot` | `microsoft-decision-1` | `COPILOT_GITHUB_TOKEN` or `/login` |
|
|
170
|
+
| `github-copilot` | `gpt-6-luna-decisions`, `microsoft-decision-1` | `COPILOT_GITHUB_TOKEN` or `/login` |
|
|
155
171
|
|
|
156
|
-
Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed
|
|
172
|
+
Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed under the `classifier` model type.
|
|
157
173
|
|
|
158
174
|
OpenAI's Decisions API needs an API key. Sign in with ChatGPT credentials do not work with it, so `gpt-6-luna` is not listed as available while `openai` is logged in through `/login`, even when `OPENAI_API_KEY` is set; log out of `openai` to use the key. The API rejects inputs above 922K tokens, but requests that run longer than about five seconds, currently above roughly 600K input tokens, fail with a gateway timeout.
|
|
159
175
|
|
|
160
|
-
|
|
176
|
+
Which GitHub Copilot decision models an account can use depends on its plan: Microsoft-Decision-1 is limited to Business and Enterprise, and organizations can turn models off. With `/login`, pi lists only the decision models in the account's Copilot model catalog. With `COPILOT_GITHUB_TOKEN` it lists both.
|
|
177
|
+
|
|
178
|
+
Decision models do not appear in `/model`. The model reaches them through the [`codemode`](cli.md#enable-codemode) tool, which is off unless an MCP server turned it on. Enable it with `"defaultTools": ["+codemode"]` in [settings](settings.md#tools). Scripts then list decision models with `models.getAvailableOfType("classifier")` and call `models.classify(model, { state, questions })`:
|
|
161
179
|
|
|
162
180
|
```js
|
|
163
181
|
const jev = await models.getModelOfType("classifier", "typesafe", "jev-latest");
|
|
@@ -176,25 +194,27 @@ return result.answers;
|
|
|
176
194
|
|
|
177
195
|
[Codemode](codemode.md#classify) describes the question and answer types.
|
|
178
196
|
|
|
179
|
-
|
|
197
|
+
Decision models whose `input` includes `"image"` also judge images passed in `images`; other decision models return an error for them. Image input works with GPT-6 Luna, with Jev from `typesafe` and `cloudflare-workers-ai`, with Clef from `cloudflare-workers-ai`, and with the OpenRouter models whose catalog lists image input. Jev takes PNG and JPEG images, and image input is experimental on TypeSafe's own API. Clef takes PNG, JPEG, and WebP images, at most four per request. Jev from `vercel-ai-gateway` and `opencode` takes text only.
|
|
180
198
|
|
|
181
|
-
Each System One service takes images in its own request format, set by the model's `compat.imageInput`. Built-in models set it, so overriding a provider's `baseUrl` keeps it. A custom provider that proxies another service's
|
|
199
|
+
Each System One service takes images in its own request format, set by the model's `compat.imageInput`. Built-in models set it, so overriding a provider's `baseUrl` keeps it. A custom provider that proxies another service's decision models sets it in its provider-level `compat` in `models.json` (see [System One compatibility](models-configuration.md#typesafe-system-one)). OpenRouter in particular answers requests in TypeSafe's format without an error but drops the images.
|
|
182
200
|
|
|
183
|
-
When the service reports token counts, as all System One services do, `result.usage` carries them with their cost. Pi adds the usage of a script's
|
|
201
|
+
When the service reports token counts, as all System One services do, `result.usage` carries them with their cost. Pi adds the usage of a script's `classify()` calls to the `codemode` tool result, so it counts toward the session cost in the footer and `/session`. The cost uses the model's catalog price; models without one, such as TypeSafe's direct `jev-latest`, report tokens at no cost.
|
|
184
202
|
|
|
185
|
-
Extensions call
|
|
203
|
+
Extensions call decision models through `ctx.modelRegistry.classify()`, without codemode. [Virtual models](virtual-models.md#route-requests) can use them to route requests; see the `jev-router.ts` example.
|
|
186
204
|
|
|
187
205
|
## Use image models
|
|
188
206
|
|
|
189
|
-
Image models generate images from a prompt and optional input images. Pi lists
|
|
207
|
+
Image models generate images from a prompt and optional input images. Pi lists image models from OpenRouter (such as `google/gemini-2.5-flash-image` and `black-forest-labs/flux.2-pro`) and Radius (when enabled for the organization); each uses the same API key or `/login` credential as its chat models.
|
|
190
208
|
|
|
191
|
-
Like
|
|
209
|
+
Like decision models, image models do not appear in `/model`; the model reaches them through the [`codemode`](cli.md#enable-codemode) tool. Scripts list them with `models.getAvailableOfType("image")` and call `models.generateImages(model, { input }, options?)`. The result's `output` holds base64 image blocks, which `image()` attaches to the `codemode` result so the model sees them:
|
|
192
210
|
|
|
193
211
|
```js
|
|
194
212
|
const painter = await models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
|
|
195
|
-
const result = await models.generateImages(
|
|
196
|
-
|
|
197
|
-
}
|
|
213
|
+
const result = await models.generateImages(
|
|
214
|
+
painter,
|
|
215
|
+
{ input: [{ type: "text", text: "A red fox in the snow, watercolor" }] },
|
|
216
|
+
{ aspectRatio: "16:9", size: "2K" },
|
|
217
|
+
);
|
|
198
218
|
if (result.stopReason !== "stop") return result.errorMessage;
|
|
199
219
|
for (const block of result.output) if (block.type === "image") image(block);
|
|
200
220
|
```
|
package/docs/providers.md
CHANGED
|
@@ -47,7 +47,7 @@ This table covers providers with a single primary API-key variable. Providers th
|
|
|
47
47
|
| ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` |
|
|
48
48
|
| OpenCode Zen and Go | `OPENCODE_API_KEY` |
|
|
49
49
|
| Radius | `RADIUS_API_KEY` |
|
|
50
|
-
| TypeSafe ([
|
|
50
|
+
| TypeSafe ([decision models](models.md#use-decision-models)) | `TYPESAFE_API_KEY` |
|
|
51
51
|
| Hugging Face | `HF_TOKEN` |
|
|
52
52
|
| Fireworks | `FIREWORKS_API_KEY` |
|
|
53
53
|
| Together AI | `TOGETHER_API_KEY` |
|
|
@@ -83,7 +83,7 @@ To use a secret manager without writing the resolved key to disk, set a provider
|
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Pi runs the command when the key is first needed and caches its standard output for the process lifetime. Empty output, a timeout, or a nonzero exit leaves the key unresolved
|
|
86
|
+
Pi runs the command when the key is first needed and caches its standard output for the process lifetime. Empty output, a timeout, or a nonzero exit leaves the key unresolved: `/login` shows the provider as `stored key did not resolve`. To retry, for example after signing in to the secret manager, enter the same `!command` again in `/login`, or restart Pi.
|
|
87
87
|
|
|
88
88
|
## Provider Specific Config
|
|
89
89
|
|
|
@@ -119,7 +119,7 @@ Radius authentication uses its gateway catalog and caches refreshed model metada
|
|
|
119
119
|
|
|
120
120
|
Authenticate with `/login openrouter` or `OPENROUTER_API_KEY`.
|
|
121
121
|
|
|
122
|
-
With a key, Pi lists only the OpenRouter chat models that key may use, with the key's context size, max output, and prices. These come from OpenRouter's `/models/user` endpoint and reflect guardrails and provider restrictions set in OpenRouter. Image and
|
|
122
|
+
With a key, Pi lists only the OpenRouter chat models that key may use, with the key's context size, max output, and prices. These come from OpenRouter's `/models/user` endpoint and reflect guardrails and provider restrictions set in OpenRouter. Image and decision models are not filtered.
|
|
123
123
|
|
|
124
124
|
Pi refreshes the list in the background at startup in interactive mode, when `/model` opens, after `/login`, and on `pi update --models`. The last list is saved and used offline and in `pi -p` and RPC mode. After switching keys outside `/login`, the previous key's list stays until the next refresh.
|
|
125
125
|
|
package/docs/rpc-commands.md
CHANGED
|
@@ -474,7 +474,7 @@ Response:
|
|
|
474
474
|
}
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
If output was truncated, includes `fullOutputPath
|
|
477
|
+
If output was truncated, includes `fullOutputPath`, or `fullOutputError` with the reason when the full output could not be saved (for example a full temp directory):
|
|
478
478
|
```json
|
|
479
479
|
{
|
|
480
480
|
"type": "response",
|
package/docs/settings.md
CHANGED
|
@@ -17,7 +17,10 @@ Add `"$schema": "https://pi.dev/schemas/settings.schema.json"` to `settings.json
|
|
|
17
17
|
| `thinkingBudgets` | object | Built-in budgets | Token budgets for `minimal`, `low`, `medium`, and `high` thinking levels. |
|
|
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
|
+
| `notices.cacheMisses` | boolean | `false` | Show a notice when a response re-bills a significant part of the prompt cache, such as after a model switch or an idle gap. |
|
|
21
|
+
| `notices.cacheWarming` | boolean | `false` | Show the cost of cache warming requests. |
|
|
22
|
+
| `notices.compactionCosts` | boolean | `false` | Show the cost of compactions and branch summaries. |
|
|
23
|
+
| `notices.reasoningDrops` | boolean | `false` | Show a notice when a provider drops reasoning items from a request, such as OpenAI reasoning items after a prefix mismatch or Anthropic thinking blocks during recovery. |
|
|
21
24
|
| `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
25
|
|
|
23
26
|
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).
|
|
@@ -163,11 +166,10 @@ Resource arrays support glob exclusions with `!pattern`, exact inclusion with `+
|
|
|
163
166
|
|
|
164
167
|
The built-in extensions are named `builtin:mcp`, `builtin:llama.cpp`, `builtin:codemode`, and `builtin:tool-search` in `extensions`. They load by default; `-builtin:mcp` disables one. A `+builtin:<name>` or `-builtin:<name>` entry in project settings overrides the user setting. `pi config` lists them under Built-in. `--no-extensions` disables them too, and `-e builtin:<name>` loads one explicitly.
|
|
165
168
|
|
|
166
|
-
## Updates
|
|
169
|
+
## Updates and warnings
|
|
167
170
|
|
|
168
171
|
| Setting | Type | Default | Description |
|
|
169
172
|
|---|---|---|---|
|
|
170
173
|
| `collapseChangelog` | boolean | `false` | Show a condensed changelog after an update. Also condenses extension package changelogs to one line per package. |
|
|
171
|
-
| `enableInstallTelemetry` | boolean | `true` | Enable anonymous install/update reporting and selected provider attribution headers. Does not control update checks. |
|
|
172
174
|
| `enableAnalytics` | boolean | `false` | Opt in to analytics data sharing. Currently used only by the experimental first-run setup. |
|
|
173
175
|
| `warnings.anthropicExtraUsage` | boolean | `true` | Warn when Anthropic subscription authentication may use paid extra usage. |
|
package/docs/shell-aliases.md
CHANGED
|
@@ -13,7 +13,7 @@ Use `shellPath` to choose the Bash executable and `shellCommandPrefix` to run se
|
|
|
13
13
|
| Model calls the optional `powershell` tool | PowerShell 7 (`pwsh.exe`) or Windows PowerShell |
|
|
14
14
|
| An extension provides or replaces a shell tool | The operations implemented by that extension |
|
|
15
15
|
|
|
16
|
-
Pi normally invokes Bash with `bash -c`. On Unix systems, it uses `/bin/bash`, then `bash` on `PATH`, and finally `sh` when Bash is unavailable. Native Windows first checks the configured path, then Git Bash, then `bash.exe` on `PATH`.
|
|
16
|
+
Pi normally invokes Bash with `bash -c`. On Unix systems, it uses `/bin/bash`, then `bash` on `PATH`, and finally `sh` when Bash is unavailable. Native Windows first checks the configured path, then Git Bash under Program Files, then Git Bash of the `git.exe` on `PATH`, then `bash.exe` on `PATH`.
|
|
17
17
|
|
|
18
18
|
## Choose a Bash executable
|
|
19
19
|
|
package/docs/terminal-setup.md
CHANGED
|
@@ -15,6 +15,7 @@ Pi uses extended-key protocols so terminals can distinguish combinations such as
|
|
|
15
15
|
| Inline images or colors are not detected | [Override detected capabilities](#override-detected-capabilities) |
|
|
16
16
|
| An IME candidate window appears in the wrong place | [WezTerm](#wezterm) or [IntelliJ IDEA](#intellij-idea-integrated-terminal) |
|
|
17
17
|
| Modified keys fail only inside tmux | [Run Pi in tmux](tmux.md) |
|
|
18
|
+
| After Pi exits, moving the mouse or typing puts text such as `[<35;12;5M` or `[;;;129:3u` into the shell prompt | [Recover the terminal after Pi was killed](#recover-the-terminal-after-pi-was-killed) |
|
|
18
19
|
|
|
19
20
|
Use `/hotkeys` to inspect Pi's active shortcuts. See [Keybindings](keybindings.md) to change them.
|
|
20
21
|
|
|
@@ -220,6 +221,30 @@ Settings take precedence over environment variables. An unset value or `auto` pr
|
|
|
220
221
|
|
|
221
222
|
Only force a capability supported by the complete terminal path. Unsupported escape sequences can corrupt rendering. See [Environment Variables](environment-variables.md#pi-process-configuration) and [Settings](settings.md) for the canonical value definitions.
|
|
222
223
|
|
|
224
|
+
## Recover the terminal after Pi was killed
|
|
225
|
+
|
|
226
|
+
Pi turns on key, mouse, and paste reporting while it runs, and the alternate screen in fullscreen mode. It turns them off when it exits. If Pi is killed (`kill -9`, Task Manager, out of memory), they stay on and the shell types the reports into the prompt.
|
|
227
|
+
|
|
228
|
+
The real fix is to find what kills Pi and stop it. Look for `JavaScript heap out of memory` in the terminal, or a script or IDE that ends the process, and [open an issue](https://github.com/earendil-works/pi/issues) with what you find.
|
|
229
|
+
|
|
230
|
+
To reset the terminal, run this in the affected pane. Starting and quitting Pi again is not enough.
|
|
231
|
+
|
|
232
|
+
bash or zsh:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
printf '\e[<16u\e[=0;1u\e[>4;0m\e[?2004;1000;1002;1003;1004;1006l\e[?7;25h'
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
PowerShell:
|
|
239
|
+
|
|
240
|
+
```powershell
|
|
241
|
+
$e = [char]27; [Console]::Write("$e[<16u$e[=0;1u$e[>4;0m$e[?2004;1000;1002;1003;1004;1006l$e[?7;25h")
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
If the prompt still shows Pi's last screen, also run `printf '\e[?1049l'` or `[Console]::Write("$([char]27)[?1049l")`. Only in that case: otherwise it confuses the shell's line editor.
|
|
245
|
+
|
|
246
|
+
If you cannot type in the pane, start Pi in another tab and ask it: "Reset my other terminal tab with the reset sequence from Pi's terminal-setup docs." Then press `Ctrl+C` in the fixed tab to clear the line.
|
|
247
|
+
|
|
223
248
|
## Program status
|
|
224
249
|
|
|
225
250
|
Pi reports its state with the [Program Status Protocol (OSC 7501)](https://www.superlogical.com/rex/docs/build/program-status), so terminals and agent dashboards can show whether it is working, waiting for you, done, or failed:
|
|
@@ -233,3 +258,31 @@ Pi reports its state with the [Program Status Protocol (OSC 7501)](https://www.s
|
|
|
233
258
|
| `idle` | Pi started, or you cancelled the run. |
|
|
234
259
|
|
|
235
260
|
Reports never contain prompts or model output. Pi sends them only after the terminal answers the protocol's support query; tmux and screen do not forward them. Set `PI_PROGRAM_STATUS=1` to send reports without asking, or `PI_PROGRAM_STATUS=0` to turn them off.
|
|
261
|
+
|
|
262
|
+
## Program resume
|
|
263
|
+
|
|
264
|
+
Pi tells the terminal how to bring the session back after the terminal restarts, with the [Program Resume Protocol (OSC 7577)](https://www.superlogical.com/rex/docs/build/program-resume). Terminals that support it set `OSC7577_TOKEN` in the environment; Pi reports only when it is set.
|
|
265
|
+
|
|
266
|
+
The command contains everything needed to resume the session, because the terminal runs it without Pi's environment: the session ID, `--agent-dir` and `--session-dir` when those folders are not the default, and the restriction and resource flags Pi was started with, as typed (tools, extensions, skills, prompt templates, themes, context files, system prompts, project trust, `--models`). For example, `pi --session <id> -t read,grep`. The terminal runs it in the session's directory. Other flags are left out, because the session keeps its model, thinking level, and name. The command Pi prints when you quit is the same without the repeated flags.
|
|
267
|
+
|
|
268
|
+
Pi updates the command when you start, resume, or fork a session, and once a new session has its first message. It removes the command while a new session has no messages, when you quit (`Ctrl+D`, `Ctrl+C` twice, `/quit`), and, if Pi was started with flags, when you open a session from another directory, because relative paths in the flags would point elsewhere. When the terminal closes or restarts and ends Pi, Pi leaves the command in place, so the terminal can resume it.
|
|
269
|
+
|
|
270
|
+
The terminal resumes a command only if a rule trusts it. Rex rules with a `flags` table do not work for Pi yet (Node overwrites the command line Rex checks them against), so add one rule per flag combination you use, with the flags in the order you type them. In Rex's `init.lua`:
|
|
271
|
+
|
|
272
|
+
```lua
|
|
273
|
+
-- One rule per command: the words after `pi`, as Pi reports them.
|
|
274
|
+
local function trust_pi(name, ...)
|
|
275
|
+
rex.set("resume.trust.pi_" .. name, { command = { "pi", ... } })
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
local id = rex.match.uuid
|
|
279
|
+
trust_pi("plain", "--session", id)
|
|
280
|
+
trust_pi("readonly", "--session", id, "-t", "read,grep,find,ls")
|
|
281
|
+
trust_pi("readonly_noext", "--session", id, "-t", "read,grep,find,ls", "--no-extensions")
|
|
282
|
+
-- A separate profile set with PI_CODING_AGENT_DIR and PI_CODING_AGENT_SESSION_DIR: absolute paths, before --session
|
|
283
|
+
trust_pi("work", "--agent-dir", "/home/you/.pi/work/agent", "--session-dir", "/home/you/.pi/work/agent/sessions", "--session", id)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
A Pi started with a combination no rule lists comes back as a plain shell, not without its flags.
|
|
287
|
+
|
|
288
|
+
Pi removes `OSC7577_TOKEN` from its own environment at startup, so shells, editors, and extension processes it starts cannot replace its command or register commands of their own. Whether and when the terminal resumes a command is up to the terminal.
|
package/docs/windows.md
CHANGED
|
@@ -21,7 +21,8 @@ Pi resolves Bash in this order:
|
|
|
21
21
|
1. `shellPath` from `~/.pi/agent/settings.json`
|
|
22
22
|
2. Git Bash at `%ProgramFiles%\Git\bin\bash.exe`
|
|
23
23
|
3. Git Bash at `%ProgramFiles(x86)%\Git\bin\bash.exe`
|
|
24
|
-
4. `
|
|
24
|
+
4. Git Bash of the Git for Windows installation whose `git.exe` is on `PATH`, wherever it is installed (Git 2.47 or later)
|
|
25
|
+
5. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
|
|
25
26
|
|
|
26
27
|
Start Pi and enter this command to verify the shell:
|
|
27
28
|
|
|
@@ -510,8 +510,9 @@ async function runSingleAgent(
|
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
proc.stdout?.on("data", (data) => {
|
|
513
|
-
|
|
514
|
-
const lines =
|
|
513
|
+
// Split only the new text, so a long line arriving in many chunks is not rescanned per chunk.
|
|
514
|
+
const lines = data.toString().split("\n");
|
|
515
|
+
lines[0] = buffer + lines[0];
|
|
515
516
|
buffer = lines.pop() || "";
|
|
516
517
|
for (const line of lines) processLine(line);
|
|
517
518
|
});
|
|
@@ -587,15 +587,16 @@ async function main() {
|
|
|
587
587
|
let stdoutBuffer = "";
|
|
588
588
|
|
|
589
589
|
agent.stdout!.on("data", (chunk: Buffer) => {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
590
|
+
const text = stdoutDecoder.write(chunk);
|
|
591
|
+
// Only the new text is scanned, so a long line arriving in many chunks is not rescanned per chunk.
|
|
592
|
+
let start = 0;
|
|
593
|
+
for (let newlineIndex = text.indexOf("\n"); newlineIndex !== -1; newlineIndex = text.indexOf("\n", start)) {
|
|
594
|
+
const line = stdoutBuffer + text.slice(start, newlineIndex);
|
|
595
|
+
stdoutBuffer = "";
|
|
596
|
+
start = newlineIndex + 1;
|
|
597
597
|
handleAgentLine(line.endsWith("\r") ? line.slice(0, -1) : line);
|
|
598
598
|
}
|
|
599
|
+
stdoutBuffer += text.slice(start);
|
|
599
600
|
});
|
|
600
601
|
|
|
601
602
|
agent.stdout!.on("end", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxmo74/pi-coding-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-max.17",
|
|
4
4
|
"description": "Unofficial pi fork by maxmo74. Adds a move action to the /resume picker, so a session recorded under another directory opens here without copying files, and refuses to open a session another pi process already holds, which silently forks its history (reported upstream as #11684 and declined). Builds are cut from upstream release tags. Not affiliated with pi.dev.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@earendil-works/pi-agent-core": "1.
|
|
34
|
-
"@earendil-works/pi-ai": "1.
|
|
35
|
-
"@earendil-works/pi-codemode": "1.
|
|
36
|
-
"@earendil-works/pi-mcp": "1.
|
|
37
|
-
"@earendil-works/pi-tui": "1.
|
|
33
|
+
"@earendil-works/pi-agent-core": "1.7.0",
|
|
34
|
+
"@earendil-works/pi-ai": "1.7.0",
|
|
35
|
+
"@earendil-works/pi-codemode": "1.7.0",
|
|
36
|
+
"@earendil-works/pi-mcp": "1.7.0",
|
|
37
|
+
"@earendil-works/pi-tui": "1.7.0",
|
|
38
38
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
39
39
|
"brace-expansion": "5.0.12",
|
|
40
40
|
"chalk": "6.0.0",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
89
|
"piFork": {
|
|
90
|
-
"upstreamVersion": "1.
|
|
91
|
-
"sourceCommit": "
|
|
92
|
-
"builtAt": "2026-11-
|
|
90
|
+
"upstreamVersion": "1.7.0",
|
|
91
|
+
"sourceCommit": "70f548dfdd4816a94b8218f7579b3b6392be8035",
|
|
92
|
+
"builtAt": "2026-11-29T18:26:27.213Z"
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"thinkingLevelMap": {
|
|
96
96
|
"$ref": "#/$defs/ThinkingLevelMap",
|
|
97
|
-
"description": "Provider value sent for each thinking level.
|
|
97
|
+
"description": "Provider value sent for each thinking level. A string is sent to the provider; null hides the level. Levels left out use the provider's default value for off through high; xhigh and max are opt-in and only offered when mapped to a string."
|
|
98
98
|
},
|
|
99
99
|
"input": {
|
|
100
100
|
"type": "array",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
},
|
|
219
219
|
"thinkingLevelMap": {
|
|
220
220
|
"$ref": "#/$defs/ThinkingLevelMap",
|
|
221
|
-
"description": "Provider value sent for each thinking level.
|
|
221
|
+
"description": "Provider value sent for each thinking level. A string is sent to the provider; null hides the level. Levels left out use the provider's default value for off through high; xhigh and max are opt-in and only offered when mapped to a string."
|
|
222
222
|
},
|
|
223
223
|
"input": {
|
|
224
224
|
"type": "array",
|
|
@@ -251,6 +251,10 @@
|
|
|
251
251
|
"type": "number",
|
|
252
252
|
"description": "Cache-write cost in USD per million tokens."
|
|
253
253
|
},
|
|
254
|
+
"imageOutput": {
|
|
255
|
+
"type": "number",
|
|
256
|
+
"description": "Image output cost in USD per million tokens, for models that generate images. Image output tokens use this rate and the rest of output (text and reasoning) uses `output`. Unset means image tokens cost `output`."
|
|
257
|
+
},
|
|
254
258
|
"tiers": {
|
|
255
259
|
"type": "array",
|
|
256
260
|
"items": {
|
|
@@ -400,6 +404,10 @@
|
|
|
400
404
|
"type": "number",
|
|
401
405
|
"description": "Cache-write cost in USD per million tokens."
|
|
402
406
|
},
|
|
407
|
+
"imageOutput": {
|
|
408
|
+
"type": "number",
|
|
409
|
+
"description": "Image output cost in USD per million tokens, for models that generate images. Image output tokens use this rate and the rest of output (text and reasoning) uses `output`. Unset means image tokens cost `output`."
|
|
410
|
+
},
|
|
403
411
|
"tiers": {
|
|
404
412
|
"type": "array",
|
|
405
413
|
"items": {
|
|
@@ -582,6 +590,10 @@
|
|
|
582
590
|
"type": "string",
|
|
583
591
|
"const": "deepseek"
|
|
584
592
|
},
|
|
593
|
+
{
|
|
594
|
+
"type": "string",
|
|
595
|
+
"const": "ant-ling"
|
|
596
|
+
},
|
|
585
597
|
{
|
|
586
598
|
"type": "string",
|
|
587
599
|
"const": "together"
|
|
@@ -609,13 +621,9 @@
|
|
|
609
621
|
{
|
|
610
622
|
"type": "string",
|
|
611
623
|
"const": "string-thinking"
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
"type": "string",
|
|
615
|
-
"const": "ant-ling"
|
|
616
624
|
}
|
|
617
625
|
],
|
|
618
|
-
"description": "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
|
|
626
|
+
"description": "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\" (deprecated alias: \"ant-ling\") 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, and \"string-thinking\" uses top-level thinking."
|
|
619
627
|
},
|
|
620
628
|
"chatTemplateKwargs": {
|
|
621
629
|
"type": "object",
|
|
@@ -1137,6 +1145,11 @@
|
|
|
1137
1145
|
"maxItems": 3,
|
|
1138
1146
|
"description": "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."
|
|
1139
1147
|
},
|
|
1148
|
+
"supportsReasoningReplay": {
|
|
1149
|
+
"type": "boolean",
|
|
1150
|
+
"description": "Whether the model accepts reasoning blocks from earlier assistant messages. When false, earlier reasoning is not sent back. The generated catalog disables this for Kimi K3 models, which fail on Converse when it is sent.",
|
|
1151
|
+
"default": true
|
|
1152
|
+
},
|
|
1140
1153
|
"imageInput": {
|
|
1141
1154
|
"anyOf": [
|
|
1142
1155
|
{
|