@astralyn/pi 1.0.4 → 1.1.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 +53 -0
- package/dist/bundle/chunks/{anthropic-messages-YIOJIMVL.js → anthropic-messages-3K3DWVY6.js} +1 -1
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-LDW4FGAQ.js → azure-openai-responses-CH74HGP4.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/{chunk-UCXU7KLO.js → chunk-3MMB5I7J.js} +1 -1
- package/dist/bundle/chunks/{chunk-GIG5IHES.js → chunk-5KJH3GGH.js} +1 -1
- package/dist/bundle/chunks/chunk-6VYRLG5F.js +2 -0
- package/dist/bundle/chunks/{chunk-73WG7F7N.js → chunk-C2ARIVS3.js} +1 -1
- package/dist/bundle/chunks/{chunk-23OTKHCH.js → chunk-D3XW5X3Z.js} +490 -260
- package/dist/bundle/chunks/{chunk-IFELM7MW.js → chunk-EJEOEBSJ.js} +1 -1
- package/dist/bundle/chunks/chunk-H35KWBT5.js +11 -0
- package/dist/bundle/chunks/chunk-KAC2YPTW.js +2 -0
- package/dist/bundle/chunks/chunk-MAC4N3BW.js +2 -0
- package/dist/bundle/chunks/chunk-QLU3LESZ.js +2 -0
- package/dist/bundle/chunks/{chunk-A6ALEEY5.js → chunk-TEAAYBTS.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XO45ZT3V.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +101 -5
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-S5A5IBU4.js → google-generative-ai-VVO64ZRQ.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-UBRQFDB4.js → google-vertex-LKS5NUHA.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-R7DQLTQN.js → llama-cpp-classify-H3IZDR5O.js} +2 -2
- package/dist/bundle/chunks/{mistral-conversations-A2N5FSOV.js → mistral-conversations-NJUOG4ET.js} +2 -2
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-Q6JHCWLE.js → openai-codex-responses-TZWBTTYM.js} +2 -2
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/{openai-completions-H4VMO7AU.js → openai-completions-7HTTU6FH.js} +1 -1
- package/dist/bundle/chunks/openai-decisions-776H4VDZ.js +5 -0
- package/dist/bundle/chunks/{openai-responses-G4PGNM2H.js → openai-responses-7A6BAQ5X.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-YP3YVB54.js → openrouter-images-TDLJV5N4.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-HZZ7GEEW.js → pi-messages-ZXNERWJG.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-2DQLG4R2.js +2 -0
- package/dist/bundle/chunks/{virtual-modules-IJTAY26N.js → virtual-modules-2NHGQRS6.js} +1 -1
- 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 +2 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +24 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +38 -10
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +190 -186
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +40 -45
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/context-snapshot.d.ts +4 -1
- package/dist/core/context-snapshot.d.ts.map +1 -1
- package/dist/core/context-snapshot.js +45 -0
- package/dist/core/context-snapshot.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/types.d.ts +13 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +8 -0
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +30 -7
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +1 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/dist/core/nested-tool-calls.js +1 -0
- package/dist/core/nested-tool-calls.js.map +1 -1
- package/dist/core/resource-loader.d.ts +3 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -3
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +13 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +19 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +37 -13
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +4 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +9 -4
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/session.d.ts +9 -0
- package/dist/core/tasks/session.d.ts.map +1 -1
- package/dist/core/tasks/session.js +21 -0
- package/dist/core/tasks/session.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +18 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +8 -3
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.js +1 -1
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +65 -8
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +1 -0
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +9 -2
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +14 -6
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/index.js +2 -2
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +34 -11
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/mcp/cli.js +17 -23
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +165 -64
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +5 -3
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +36 -10
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +3 -4
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +3 -4
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +4 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +22 -5
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +2 -1
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +2 -1
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +3 -3
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +10 -2
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/search/code-search.d.ts +29 -0
- package/dist/extensions/search/code-search.d.ts.map +1 -0
- package/dist/extensions/search/code-search.js +120 -0
- package/dist/extensions/search/code-search.js.map +1 -0
- package/dist/extensions/search/command.d.ts +5 -0
- package/dist/extensions/search/command.d.ts.map +1 -0
- package/dist/extensions/search/command.js +69 -0
- package/dist/extensions/search/command.js.map +1 -0
- package/dist/extensions/search/credential.d.ts +25 -0
- package/dist/extensions/search/credential.d.ts.map +1 -0
- package/dist/extensions/search/credential.js +117 -0
- package/dist/extensions/search/credential.js.map +1 -0
- package/dist/extensions/search/devin.d.ts +34 -0
- package/dist/extensions/search/devin.d.ts.map +1 -0
- package/dist/extensions/search/devin.js +210 -0
- package/dist/extensions/search/devin.js.map +1 -0
- package/dist/extensions/search/index.d.ts +5 -0
- package/dist/extensions/search/index.d.ts.map +1 -0
- package/dist/extensions/search/index.js +110 -0
- package/dist/extensions/search/index.js.map +1 -0
- package/dist/extensions/search/panel.d.ts +53 -0
- package/dist/extensions/search/panel.d.ts.map +1 -0
- package/dist/extensions/search/panel.js +157 -0
- package/dist/extensions/search/panel.js.map +1 -0
- package/dist/extensions/search/prompt.d.ts +14 -0
- package/dist/extensions/search/prompt.d.ts.map +1 -0
- package/dist/extensions/search/prompt.js +221 -0
- package/dist/extensions/search/prompt.js.map +1 -0
- package/dist/extensions/search/render.d.ts +28 -0
- package/dist/extensions/search/render.d.ts.map +1 -0
- package/dist/extensions/search/render.js +86 -0
- package/dist/extensions/search/render.js.map +1 -0
- package/dist/extensions/search/workspace.d.ts +38 -0
- package/dist/extensions/search/workspace.d.ts.map +1 -0
- package/dist/extensions/search/workspace.js +245 -0
- package/dist/extensions/search/workspace.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +14 -14
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +5 -2
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +7 -2
- 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 +1 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +52 -59
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-status-reporter.js +107 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/dist/modes/interactive/tasks/host-hooks.d.ts +14 -0
- package/dist/modes/interactive/tasks/host-hooks.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/host-hooks.js +31 -0
- package/dist/modes/interactive/tasks/host-hooks.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +1 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tool-view/tool-execution.d.ts +5 -0
- package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/tool-view/tool-execution.js +7 -0
- package/dist/modes/interactive/tool-view/tool-execution.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +24 -0
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts +8 -0
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +30 -11
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +12 -11
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts +12 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize-worker.js +3 -2
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +9 -10
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +6 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/bundled/README.md +1 -1
- package/docs/bundled/extensions/provider.md +1 -1
- package/docs/bundled/extensions/question.md +1 -1
- package/docs/bundled/extensions/search.md +50 -0
- package/docs/bundled/extensions/statusline.md +15 -41
- package/docs/codemode.md +26 -5
- package/docs/docs.json +0 -4
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +6 -2
- package/docs/json.md +2 -2
- package/docs/llama-cpp.md +8 -1
- package/docs/mcp.md +3 -1
- package/docs/models.md +4 -1
- package/docs/providers.md +17 -0
- package/docs/rpc.md +6 -3
- package/docs/session-format.md +1 -0
- package/docs/settings.md +4 -4
- package/docs/terminal-setup.md +14 -0
- package/docs/usage.md +19 -5
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +54 -54
- package/package.json +13 -11
- package/dist/bundle/chunks/chunk-57XI7YJH.js +0 -2
- package/dist/bundle/chunks/chunk-JI4WGISU.js +0 -2
- package/dist/bundle/chunks/chunk-TCQ4HHQD.js +0 -2
- package/dist/bundle/chunks/chunk-TXJO4AJ7.js +0 -11
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-OWU5SM6J.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-KYKKNU3E.js +0 -2
- package/dist/extensions/web-search/auth.d.ts +0 -12
- package/dist/extensions/web-search/auth.d.ts.map +0 -1
- package/dist/extensions/web-search/auth.js +0 -90
- package/dist/extensions/web-search/auth.js.map +0 -1
- package/dist/extensions/web-search/constants.d.ts +0 -13
- package/dist/extensions/web-search/constants.d.ts.map +0 -1
- package/dist/extensions/web-search/constants.js +0 -26
- package/dist/extensions/web-search/constants.js.map +0 -1
- package/dist/extensions/web-search/execute.d.ts +0 -9
- package/dist/extensions/web-search/execute.d.ts.map +0 -1
- package/dist/extensions/web-search/execute.js +0 -96
- package/dist/extensions/web-search/execute.js.map +0 -1
- package/dist/extensions/web-search/format.d.ts +0 -21
- package/dist/extensions/web-search/format.d.ts.map +0 -1
- package/dist/extensions/web-search/format.js +0 -117
- package/dist/extensions/web-search/format.js.map +0 -1
- package/dist/extensions/web-search/index.d.ts +0 -6
- package/dist/extensions/web-search/index.d.ts.map +0 -1
- package/dist/extensions/web-search/index.js +0 -50
- package/dist/extensions/web-search/index.js.map +0 -1
- package/dist/extensions/web-search/providers/deepseek.d.ts +0 -13
- package/dist/extensions/web-search/providers/deepseek.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/deepseek.js +0 -110
- package/dist/extensions/web-search/providers/deepseek.js.map +0 -1
- package/dist/extensions/web-search/providers/http.d.ts +0 -4
- package/dist/extensions/web-search/providers/http.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/http.js +0 -42
- package/dist/extensions/web-search/providers/http.js.map +0 -1
- package/dist/extensions/web-search/providers/minimax.d.ts +0 -12
- package/dist/extensions/web-search/providers/minimax.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/minimax.js +0 -61
- package/dist/extensions/web-search/providers/minimax.js.map +0 -1
- package/dist/extensions/web-search/render.d.ts +0 -15
- package/dist/extensions/web-search/render.d.ts.map +0 -1
- package/dist/extensions/web-search/render.js +0 -142
- package/dist/extensions/web-search/render.js.map +0 -1
- package/dist/extensions/web-search/results.d.ts +0 -35
- package/dist/extensions/web-search/results.d.ts.map +0 -1
- package/dist/extensions/web-search/results.js +0 -167
- package/dist/extensions/web-search/results.js.map +0 -1
- package/dist/extensions/web-search/schema.d.ts +0 -10
- package/dist/extensions/web-search/schema.d.ts.map +0 -1
- package/dist/extensions/web-search/schema.js +0 -36
- package/dist/extensions/web-search/schema.js.map +0 -1
- package/dist/extensions/web-search/types.d.ts +0 -51
- package/dist/extensions/web-search/types.d.ts.map +0 -1
- package/dist/extensions/web-search/types.js +0 -5
- package/dist/extensions/web-search/types.js.map +0 -1
- package/docs/bundled/extensions/web-search.md +0 -46
package/docs/mcp.md
CHANGED
|
@@ -225,6 +225,8 @@ Pi activates `codemode` when a server with `codemode` exposure connects. It acti
|
|
|
225
225
|
|
|
226
226
|
Tools with `codemode` or `deferred` exposure can be reached through either indirect mechanism: codemode scripts can call them, and `tool_search` can load them. Codemode calls do not depend on the active tool set, so they remain available after `/tree`, resume, and fork. Tools loaded by `tool_search` are recorded in the transcript and remain declared on that branch.
|
|
227
227
|
|
|
228
|
+
`--tools` does not remove MCP tools unless one of its entries starts with `mcp__`; `pi --tools read,codemode,'mcp__radius__*'` keeps only the tools of `radius`. `--exclude-tools` accepts the same patterns, and `--no-mcp` disables MCP for one run (see [Tools](usage.md#tool-options)).
|
|
229
|
+
|
|
228
230
|
To keep `codemode` active without MCP servers, add `"defaultTools": ["+codemode"]` to [settings](settings.md#tools). To prevent automatic codemode activation, set `"autoEnableCodemode": false` beside `mcpServers`. A project value overrides the user-level value. Pi warns once when neither `codemode` nor `tool_search` is active and non-direct tools cannot be called.
|
|
229
231
|
|
|
230
232
|
Text results over 20 KB reach the model with their middle removed around a `…N chars truncated…` marker. The full text is saved to a temporary file named in the result. Codemode scripts receive the complete result and can reduce it before returning output to the model.
|
|
@@ -261,7 +263,7 @@ Changes to enabled state or exposure apply only to the current session. A file-c
|
|
|
261
263
|
|
|
262
264
|
### Replace the built-in MCP support
|
|
263
265
|
|
|
264
|
-
An installed extension that registers `/mcp`, such as `pi-mcp-adapter`, replaces the built-in MCP support for sessions. Pi then does not read `mcp.json` or connect its servers in a session, and `/mcp` belongs to the extension. Remove the extension to restore the built-in behavior. To disable built-in MCP support without a replacement, disable `mcp` under Built-in in `pi config`,
|
|
266
|
+
An installed extension that registers `/mcp`, such as `pi-mcp-adapter`, replaces the built-in MCP support for sessions. Pi then does not read `mcp.json` or connect its servers in a session, and `/mcp` belongs to the extension. Remove the extension to restore the built-in behavior. To disable built-in MCP support without a replacement, disable `mcp` under Built-in in `pi config`, set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources), or pass `--no-mcp` to disable it for one run.
|
|
265
267
|
|
|
266
268
|
An extension that registers `codemode` or `tool_search` similarly replaces the built-in tool with that name. Shell-level `pi mcp` commands always use the built-in implementation.
|
|
267
269
|
|
package/docs/models.md
CHANGED
|
@@ -703,7 +703,7 @@ For `bedrock-converse-stream`, `compat.supportsStrictMode` controls Bedrock stri
|
|
|
703
703
|
|
|
704
704
|
## Use classifier models
|
|
705
705
|
|
|
706
|
-
Classifier models do not chat. They answer typed questions about JSON state: pick one of several choices, answer yes or no, or give a score, each with probabilities. Pi includes TypeSafe's Jev model from these providers,
|
|
706
|
+
Classifier models do not chat. They answer typed questions about JSON state: pick one of several choices, answer yes or no, or give a score, each with probabilities. Pi includes TypeSafe's Jev model from these providers, Cloudflare's Clef and Clef Flash models from Workers AI, and OpenAI's GPT-6 Luna through the [Decisions API](https://developers.openai.com/api/docs/guides/decisions):
|
|
707
707
|
|
|
708
708
|
| Provider | Model IDs | Authentication |
|
|
709
709
|
|---|---|---|
|
|
@@ -712,9 +712,12 @@ Classifier models do not chat. They answer typed questions about JSON state: pic
|
|
|
712
712
|
| `cloudflare-workers-ai` | `typesafe/jev`, `@cf/cloudflare/clef`, `@cf/cloudflare/clef-flash` | `CLOUDFLARE_API_KEY` and `CLOUDFLARE_ACCOUNT_ID` |
|
|
713
713
|
| `vercel-ai-gateway` | `typesafe-ai/jev` | `AI_GATEWAY_API_KEY` |
|
|
714
714
|
| `opencode` | `jev-1.13`, `jev-1.13-free` | `OPENCODE_API_KEY` |
|
|
715
|
+
| `openai` | `gpt-6-luna` | `OPENAI_API_KEY` |
|
|
715
716
|
|
|
716
717
|
Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed as classifier models.
|
|
717
718
|
|
|
719
|
+
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. GPT-6 Luna also judges images passed in `images` (see [Codemode](codemode.md#classify)); other classifier models return an error for them. 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.
|
|
720
|
+
|
|
718
721
|
Classifier models do not appear in `/model`. The model reaches them through the [`codemode`](usage.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 classifier models with `models.getAvailableOfType("classifier")` and call `models.classify(model, { state, questions })`:
|
|
719
722
|
|
|
720
723
|
```js
|
package/docs/providers.md
CHANGED
|
@@ -222,6 +222,23 @@ The `auth.json` key for this provider is `azure`, renamed from `azure-openai-res
|
|
|
222
222
|
|
|
223
223
|
The `azure` provider serves both Azure OpenAI Responses deployments and Azure AI Foundry Chat Completions deployments (for example `azure/deepseek-v4-pro`).
|
|
224
224
|
|
|
225
|
+
Pi sends the model ID as the deployment name. If a deployment has a different name, map it with `AZURE_OPENAI_DEPLOYMENT_NAME_MAP`.
|
|
226
|
+
|
|
227
|
+
To use a Foundry model that Pi does not include, add it under `azure` in [`models.json`](models.md#configure-a-compatible-endpoint) with `api: "openai-completions"`. Custom models require a `baseUrl`; `AZURE_OPENAI_BASE_URL` and `AZURE_OPENAI_RESOURCE_NAME` take priority over it when set:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"providers": {
|
|
232
|
+
"azure": {
|
|
233
|
+
"baseUrl": "https://your-resource.services.ai.azure.com",
|
|
234
|
+
"models": [
|
|
235
|
+
{ "id": "your-deployment", "api": "openai-completions" }
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
225
242
|
### Amazon Bedrock
|
|
226
243
|
|
|
227
244
|
Use `/login amazon-bedrock` to store a Bedrock API key, or configure one of the ambient AWS credential sources below:
|
package/docs/rpc.md
CHANGED
|
@@ -941,8 +941,10 @@ Emitted when one low-level agent run completes. Contains all messages generated
|
|
|
941
941
|
|
|
942
942
|
Emitted after the full session-level run settles. At this point Pi will not continue automatically through retry, compaction retry, or queued follow-up messages.
|
|
943
943
|
|
|
944
|
+
`aborted` is `true` when the run ended because it was aborted, for example with Escape.
|
|
945
|
+
|
|
944
946
|
```json
|
|
945
|
-
{"type": "agent_settled"}
|
|
947
|
+
{"type": "agent_settled", "aborted": false}
|
|
946
948
|
```
|
|
947
949
|
|
|
948
950
|
### turn_start / turn_end
|
|
@@ -1083,11 +1085,12 @@ When complete:
|
|
|
1083
1085
|
"content": [{"type": "text", "text": "total 48\n..."}],
|
|
1084
1086
|
"details": {...}
|
|
1085
1087
|
},
|
|
1086
|
-
"isError": false
|
|
1088
|
+
"isError": false,
|
|
1089
|
+
"durationMs": 42
|
|
1087
1090
|
}
|
|
1088
1091
|
```
|
|
1089
1092
|
|
|
1090
|
-
Use `toolCallId` to correlate events. The `partialResult` shape is tool-defined; built-in bash snapshots can be rendered by replacement, while other tools may use a different shape.
|
|
1093
|
+
`durationMs` is how long the tool's `execute()` took, measured with a monotonic clock; it is absent when the tool did not run. Use `toolCallId` to correlate events. The `partialResult` shape is tool-defined; built-in bash snapshots can be rendered by replacement, while other tools may use a different shape.
|
|
1091
1094
|
|
|
1092
1095
|
### queue_update
|
|
1093
1096
|
|
package/docs/session-format.md
CHANGED
|
@@ -125,6 +125,7 @@ interface AssistantMessage {
|
|
|
125
125
|
responseModel?: string;
|
|
126
126
|
responseId?: string;
|
|
127
127
|
providerThinkingLevel?: string;
|
|
128
|
+
thinkingLevel?: ModelThinkingLevel;
|
|
128
129
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
129
130
|
usage: Usage;
|
|
130
131
|
stopReason: "pending" | "stop" | "length" | "toolUse" | "error" | "aborted" | "deferred";
|
package/docs/settings.md
CHANGED
|
@@ -88,7 +88,7 @@ Selecting a model or thinking level with Enter changes only the current session.
|
|
|
88
88
|
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
|
|
89
89
|
| `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
|
|
90
90
|
| `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
|
|
91
|
-
| `outputPad` | number | `1` | Horizontal padding for
|
|
91
|
+
| `outputPad` | number | `1` | Horizontal padding for messages, `!` command output, and summary blocks, and for tool output that renders its own shell (0 or 1) |
|
|
92
92
|
| `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
|
|
93
93
|
| `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
|
|
94
94
|
| `tuiMode` | string | `"fullscreen"` | Interactive TUI mode: `"fullscreen"` or `"regular"`. Changes from `/settings` apply immediately; `--tui-mode` overrides this setting at startup |
|
|
@@ -301,7 +301,7 @@ On Windows, select `powershell` instead of `bash`, or include both:
|
|
|
301
301
|
}
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
An empty array starts with no built-in tools while preserving extension and SDK custom tools. `--tools` replaces this behavior with
|
|
304
|
+
An empty array starts with no built-in tools while preserving extension and SDK custom tools. `--tools` replaces this behavior with an allowlist of names or `*` patterns that keeps MCP tools unless an entry starts with `mcp__`, `--no-tools` disables all tools including MCP tools, and `--no-builtin-tools` disables the built-in defaults. `--exclude-tools` filters the resulting list and accepts the same patterns. A project `defaultTools` array replaces the global array.
|
|
305
305
|
|
|
306
306
|
### Sessions
|
|
307
307
|
|
|
@@ -440,9 +440,9 @@ A list of only `+name` and `-name` entries changes the inherited selection inste
|
|
|
440
440
|
|
|
441
441
|
This replaces `bash` with `powershell` and enables `grep`: `["-bash", "+powershell", "+grep"]`. Project settings apply on top of user settings: a project list with only `+name` and `-name` entries changes the user's selection, and a project list with a plain name replaces it. In one list, plain names form the selection, and `+name` and `-name` then apply in order.
|
|
442
442
|
|
|
443
|
-
`/reload` enables tools newly added to `defaultTools`. It does not disable tools removed from it or re-enable unchanged tools you turned off. `--tools
|
|
443
|
+
`/reload` enables tools newly added to `defaultTools`. It does not disable tools removed from it or re-enable unchanged tools you turned off. `--tools` with plain names, `--no-tools`, and `--no-builtin-tools` override `defaultTools`, also on reload.
|
|
444
444
|
|
|
445
|
-
CLI tool options override this setting for one invocation
|
|
445
|
+
CLI tool options override this setting for one invocation. `--tools` with only `+name` and `-name` entries changes the resolved `defaultTools` selection instead, for example `pi --tools +codemode`. On `/reload`, these entries apply to the reloaded setting too, so a tool removed with `-name` stays removed. See [Command Line](usage.md#tools).
|
|
446
446
|
|
|
447
447
|
| Setting | Default | Meaning |
|
|
448
448
|
|---|---|---|
|
package/docs/terminal-setup.md
CHANGED
|
@@ -175,3 +175,17 @@ The built-in terminal has limited escape sequence support. Shift+Enter cannot be
|
|
|
175
175
|
If you want the hardware cursor visible, set `PI_HARDWARE_CURSOR=1` before running pi (disabled by default for compatibility).
|
|
176
176
|
|
|
177
177
|
Consider using a dedicated terminal emulator for the best experience.
|
|
178
|
+
|
|
179
|
+
## Program status
|
|
180
|
+
|
|
181
|
+
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:
|
|
182
|
+
|
|
183
|
+
| State | When |
|
|
184
|
+
|---|---|
|
|
185
|
+
| `working` | An agent run or compaction is in progress. The message is the session name. |
|
|
186
|
+
| `blocked` | An extension dialog or login waits for you. The message is the dialog title. |
|
|
187
|
+
| `done` | A run finished. The message is the session name. |
|
|
188
|
+
| `error` | A run ended with an error that is not retried. The message is the first line of the error. |
|
|
189
|
+
| `idle` | Pi started, or you cancelled the run. |
|
|
190
|
+
|
|
191
|
+
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.
|
package/docs/usage.md
CHANGED
|
@@ -209,19 +209,30 @@ cat README.md | pi -p "Summarize this text"
|
|
|
209
209
|
|
|
210
210
|
| Option | Description |
|
|
211
211
|
|--------|-------------|
|
|
212
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
213
|
-
| `--exclude-tools <list>`, `-xt <list>` | Disable
|
|
212
|
+
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools; entries are names or `*` patterns, and MCP tools are kept unless an entry starts with `mcp__`. A list of only `+name` and `-name` entries changes the default selection instead |
|
|
213
|
+
| `--exclude-tools <list>`, `-xt <list>` | Disable tools by name or `*` pattern, MCP tools included |
|
|
214
214
|
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
215
|
-
| `--no-tools`, `-nt` | Disable all tools |
|
|
215
|
+
| `--no-tools`, `-nt` | Disable all tools, MCP tools included |
|
|
216
216
|
|
|
217
217
|
Built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`.
|
|
218
218
|
|
|
219
|
+
Like `defaultTools`, `--tools` also accepts a list of only `+name` and `-name` entries, which adds tools to or removes them from the default selection: `pi --tools +codemode,-write` keeps the other default tools, enables `codemode`, and disables `write`. These entries take exact tool names, not `*` patterns; use `--exclude-tools` to disable tools by pattern. Plain names and `+name`/`-name` entries cannot be mixed. `/reload` enables tools newly added to `defaultTools`, but a tool removed with `-name` stays removed.
|
|
220
|
+
|
|
221
|
+
`--tools` selects the tools declared to the model. It does not remove MCP tools, whose reach is set by their [exposure](mcp.md#control-tool-exposure): `pi --tools read,codemode` keeps every MCP tool callable from codemode scripts. An MCP tool that no entry names or matches is never declared directly, whatever its exposure; only `tool_search`, if listed, can load it. Once an entry starts with `mcp__`, `--tools` filters MCP tools too, so this keeps only the tools of the `radius` server:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
pi --tools read,bash,codemode,'mcp__radius__*'
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
The MCP resource tools (`list_mcp_resources`, `list_mcp_resource_templates`, `read_mcp_resource`) count as MCP tools. To remove MCP tools, use `--exclude-tools 'mcp__*'` or `--no-mcp`.
|
|
228
|
+
|
|
219
229
|
### Resource Options
|
|
220
230
|
|
|
221
231
|
| Option | Description |
|
|
222
232
|
|--------|-------------|
|
|
223
233
|
| `-e`, `--extension <source>` | Load an extension from path, npm, git, or `builtin:<name>`; repeatable |
|
|
224
234
|
| `--no-extensions` | Disable discovered, configured, and built-in extensions; explicit `-e` entries still load |
|
|
235
|
+
| `--no-mcp` | Disable built-in MCP support for this run: no servers connect, and there are no MCP tools or `/mcp`; does not affect an extension that replaces the built-in MCP support |
|
|
225
236
|
| `--skill <path>` | Load a skill; repeatable |
|
|
226
237
|
| `--no-skills` | Disable skill discovery |
|
|
227
238
|
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
@@ -298,6 +309,9 @@ pi --models "claude-*,gpt-4o"
|
|
|
298
309
|
# Read-only mode
|
|
299
310
|
pi --tools read,grep,find,ls -p "Review the code"
|
|
300
311
|
|
|
312
|
+
# Codemode with only the tools of one MCP server
|
|
313
|
+
pi --tools read,bash,codemode,'mcp__radius__*'
|
|
314
|
+
|
|
301
315
|
# Disable one extension or built-in tool while keeping the rest available
|
|
302
316
|
pi --exclude-tools ask_question
|
|
303
317
|
```
|
|
@@ -324,10 +338,10 @@ To turn on `codemode` for every session, add it to the default tools in `~/.pi/a
|
|
|
324
338
|
}
|
|
325
339
|
```
|
|
326
340
|
|
|
327
|
-
This keeps `read`, `bash`, `edit`, and `write` and adds `codemode`. For one invocation,
|
|
341
|
+
This keeps `read`, `bash`, `edit`, and `write` and adds `codemode`. For one invocation, add it with `--tools`:
|
|
328
342
|
|
|
329
343
|
```sh
|
|
330
|
-
pi --tools
|
|
344
|
+
pi --tools +codemode
|
|
331
345
|
```
|
|
332
346
|
|
|
333
347
|
Codemode is useful without MCP: scripts can run several tool calls in parallel, filter large output before it reaches the model, call classifier models such as TypeSafe's Jev through `models.classify()` (see [Classifier models](models.md#use-classifier-models)), and generate images through `models.generateImages()` (see [Image models](models.md#use-image-models)).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.1.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.1.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.1.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.1.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astralyn/pi",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@astralyn/pi",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.1.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@earendil-works/chord": "1.0
|
|
13
|
-
"@earendil-works/pi-agent-core": "1.0
|
|
14
|
-
"@earendil-works/pi-ai": "1.0
|
|
15
|
-
"@earendil-works/pi-codemode": "1.0
|
|
16
|
-
"@earendil-works/pi-mcp": "1.0
|
|
17
|
-
"@earendil-works/pi-tui": "1.0
|
|
12
|
+
"@earendil-works/chord": "1.1.0",
|
|
13
|
+
"@earendil-works/pi-agent-core": "1.1.0",
|
|
14
|
+
"@earendil-works/pi-ai": "1.1.0",
|
|
15
|
+
"@earendil-works/pi-codemode": "1.1.0",
|
|
16
|
+
"@earendil-works/pi-mcp": "1.1.0",
|
|
17
|
+
"@earendil-works/pi-tui": "1.1.0",
|
|
18
18
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
19
19
|
"chalk": "6.0.0",
|
|
20
20
|
"cross-spawn": "7.0.6",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@anthropic-ai/sandbox-runtime": "0.0.26",
|
|
40
40
|
"@anthropic-ai/sdk": "0.52.0",
|
|
41
41
|
"@biomejs/biome": "2.3.5",
|
|
42
|
-
"@earendil-works/pi-client": "1.0
|
|
43
|
-
"@earendil-works/pi-durable": "1.0
|
|
44
|
-
"@earendil-works/pi-protocol": "1.0
|
|
45
|
-
"@earendil-works/pi-server": "1.0
|
|
42
|
+
"@earendil-works/pi-client": "1.1.0",
|
|
43
|
+
"@earendil-works/pi-durable": "1.1.0",
|
|
44
|
+
"@earendil-works/pi-protocol": "1.1.0",
|
|
45
|
+
"@earendil-works/pi-server": "1.1.0",
|
|
46
46
|
"@types/cross-spawn": "6.0.6",
|
|
47
47
|
"@types/hosted-git-info": "3.0.5",
|
|
48
48
|
"@types/ms": "2.1.0",
|
|
@@ -630,9 +630,9 @@
|
|
|
630
630
|
}
|
|
631
631
|
},
|
|
632
632
|
"node_modules/@earendil-works/chord": {
|
|
633
|
-
"version": "1.0
|
|
634
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/chord/-/chord-1.0.
|
|
635
|
-
"integrity": "sha512-
|
|
633
|
+
"version": "1.1.0",
|
|
634
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/chord/-/chord-1.1.0.tgz",
|
|
635
|
+
"integrity": "sha512-gsHzKfyQ3t0ZIQ3cLBjJ5Vqy1TYnFyruHIV3g3BwmulCDYe5BW4yT9vaJk9QzN6YANILIO75uzuq+Gdxtzz1og==",
|
|
636
636
|
"license": "MIT",
|
|
637
637
|
"dependencies": {
|
|
638
638
|
"esbuild": "0.28.2"
|
|
@@ -642,12 +642,12 @@
|
|
|
642
642
|
}
|
|
643
643
|
},
|
|
644
644
|
"node_modules/@earendil-works/pi-agent-core": {
|
|
645
|
-
"version": "1.0
|
|
646
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-1.0.
|
|
647
|
-
"integrity": "sha512-
|
|
645
|
+
"version": "1.1.0",
|
|
646
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-1.1.0.tgz",
|
|
647
|
+
"integrity": "sha512-aX1KZomNCPmwYnXa3OivF3VYLJ+WPUkIJlEIZTgwdOZdY/+oToWTQ334WYpQeOz9POpiYFNMJLPwIhXQ4e48kg==",
|
|
648
648
|
"license": "MIT",
|
|
649
649
|
"dependencies": {
|
|
650
|
-
"@earendil-works/pi-ai": "^1.0
|
|
650
|
+
"@earendil-works/pi-ai": "^1.1.0",
|
|
651
651
|
"typebox": "1.3.27"
|
|
652
652
|
},
|
|
653
653
|
"engines": {
|
|
@@ -655,14 +655,14 @@
|
|
|
655
655
|
}
|
|
656
656
|
},
|
|
657
657
|
"node_modules/@earendil-works/pi-ai": {
|
|
658
|
-
"version": "1.0
|
|
659
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-1.0.
|
|
660
|
-
"integrity": "sha512-
|
|
658
|
+
"version": "1.1.0",
|
|
659
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-1.1.0.tgz",
|
|
660
|
+
"integrity": "sha512-1T7LAkc/5Bvc0v6w4vAGVdCrli0o/E0pEmYKTnixu95vSFArBjvbhS/G4ZwI0RUePgf0Imcu0VyqlM4EcXxqfw==",
|
|
661
661
|
"license": "MIT",
|
|
662
662
|
"dependencies": {
|
|
663
663
|
"@anthropic-ai/sdk": "0.129.0",
|
|
664
664
|
"@aws-sdk/client-bedrock-runtime": "3.1127.0",
|
|
665
|
-
"@earendil-works/pi-telemetry": "^1.0
|
|
665
|
+
"@earendil-works/pi-telemetry": "^1.1.0",
|
|
666
666
|
"@google/genai": "2.21.0",
|
|
667
667
|
"@smithy/node-http-handler": "4.12.1",
|
|
668
668
|
"http-proxy-agent": "9.1.0",
|
|
@@ -700,23 +700,23 @@
|
|
|
700
700
|
}
|
|
701
701
|
},
|
|
702
702
|
"node_modules/@earendil-works/pi-client": {
|
|
703
|
-
"version": "1.0
|
|
704
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-client/-/pi-client-1.0.
|
|
705
|
-
"integrity": "sha512-
|
|
703
|
+
"version": "1.1.0",
|
|
704
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-client/-/pi-client-1.1.0.tgz",
|
|
705
|
+
"integrity": "sha512-FARsu7NP59wA4tpzNaW6FqHG7N98OzPvwbdTbPE4dgkPzaIMjd0yMiW82Kfx8jqYLX5hujZfoj4SI80D6cOnrw==",
|
|
706
706
|
"dev": true,
|
|
707
707
|
"license": "MIT",
|
|
708
708
|
"dependencies": {
|
|
709
|
-
"@earendil-works/chord": "^1.0
|
|
710
|
-
"@earendil-works/pi-protocol": "^1.0
|
|
709
|
+
"@earendil-works/chord": "^1.1.0",
|
|
710
|
+
"@earendil-works/pi-protocol": "^1.1.0"
|
|
711
711
|
},
|
|
712
712
|
"engines": {
|
|
713
713
|
"node": ">=22.19.0"
|
|
714
714
|
}
|
|
715
715
|
},
|
|
716
716
|
"node_modules/@earendil-works/pi-codemode": {
|
|
717
|
-
"version": "1.0
|
|
718
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-codemode/-/pi-codemode-1.0.
|
|
719
|
-
"integrity": "sha512
|
|
717
|
+
"version": "1.1.0",
|
|
718
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-codemode/-/pi-codemode-1.1.0.tgz",
|
|
719
|
+
"integrity": "sha512-8Asc2AzhoNaXS1snmRFa96OhcWIlFM5k1Kuiz6p2DvIYgi5QHQccRAmDVY9oO92TzWrizpvQpconZGQ7JhlI7Q==",
|
|
720
720
|
"license": "MIT",
|
|
721
721
|
"dependencies": {
|
|
722
722
|
"quickjs-wasi": "3.6.2"
|
|
@@ -726,14 +726,14 @@
|
|
|
726
726
|
}
|
|
727
727
|
},
|
|
728
728
|
"node_modules/@earendil-works/pi-durable": {
|
|
729
|
-
"version": "1.0
|
|
730
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-durable/-/pi-durable-1.0.
|
|
731
|
-
"integrity": "sha512-
|
|
729
|
+
"version": "1.1.0",
|
|
730
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-durable/-/pi-durable-1.1.0.tgz",
|
|
731
|
+
"integrity": "sha512-NtuB3RY24vQ+0/rWYpeHupyFWBfXuKq17to3VMYUYqfD/uuGnz6F6UTPBEm51VSxxA6LZwRcDwLX2LtRehnIgQ==",
|
|
732
732
|
"dev": true,
|
|
733
733
|
"license": "MIT",
|
|
734
734
|
"dependencies": {
|
|
735
|
-
"@earendil-works/chord": "^1.0
|
|
736
|
-
"@earendil-works/pi-ai": "^1.0
|
|
735
|
+
"@earendil-works/chord": "^1.1.0",
|
|
736
|
+
"@earendil-works/pi-ai": "^1.1.0",
|
|
737
737
|
"diff": "8.0.4",
|
|
738
738
|
"typebox": "1.3.27"
|
|
739
739
|
},
|
|
@@ -742,9 +742,9 @@
|
|
|
742
742
|
}
|
|
743
743
|
},
|
|
744
744
|
"node_modules/@earendil-works/pi-mcp": {
|
|
745
|
-
"version": "1.0
|
|
746
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-mcp/-/pi-mcp-1.0.
|
|
747
|
-
"integrity": "sha512-
|
|
745
|
+
"version": "1.1.0",
|
|
746
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-mcp/-/pi-mcp-1.1.0.tgz",
|
|
747
|
+
"integrity": "sha512-xGKwvu3SvVTeoIx8Z7UGoJprB4VK20wKORMhufcWGx61fIauhu3J+UqfB5eeoF1oE/geYBA598K6nh1SdABQkg==",
|
|
748
748
|
"license": "MIT",
|
|
749
749
|
"dependencies": {
|
|
750
750
|
"cross-spawn": "7.0.6"
|
|
@@ -754,13 +754,13 @@
|
|
|
754
754
|
}
|
|
755
755
|
},
|
|
756
756
|
"node_modules/@earendil-works/pi-protocol": {
|
|
757
|
-
"version": "1.0
|
|
758
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-protocol/-/pi-protocol-1.0.
|
|
759
|
-
"integrity": "sha512-
|
|
757
|
+
"version": "1.1.0",
|
|
758
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-protocol/-/pi-protocol-1.1.0.tgz",
|
|
759
|
+
"integrity": "sha512-XMZIOJeqodY9QRfcnyBwDEKA1upgVgl2Rq0hm0Jnd/VmvGhgwHUvxu7PA/5aWLL+umJI2mwG10uW2SMzgEGvEA==",
|
|
760
760
|
"dev": true,
|
|
761
761
|
"license": "MIT",
|
|
762
762
|
"dependencies": {
|
|
763
|
-
"@earendil-works/chord": "^1.0
|
|
763
|
+
"@earendil-works/chord": "^1.1.0",
|
|
764
764
|
"typebox": "1.3.27"
|
|
765
765
|
},
|
|
766
766
|
"engines": {
|
|
@@ -768,32 +768,32 @@
|
|
|
768
768
|
}
|
|
769
769
|
},
|
|
770
770
|
"node_modules/@earendil-works/pi-server": {
|
|
771
|
-
"version": "1.0
|
|
772
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-server/-/pi-server-1.0.
|
|
773
|
-
"integrity": "sha512-
|
|
771
|
+
"version": "1.1.0",
|
|
772
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-server/-/pi-server-1.1.0.tgz",
|
|
773
|
+
"integrity": "sha512-L7yMVtBezWHo8KppSPULW89u1Tiu3c5bkU5/LIL25UgsTAZHU0K6U1iD6gJrbHAdTnl1wt6HBhqz7ZkjpzmkWg==",
|
|
774
774
|
"dev": true,
|
|
775
775
|
"license": "MIT",
|
|
776
776
|
"dependencies": {
|
|
777
|
-
"@earendil-works/chord": "^1.0
|
|
778
|
-
"@earendil-works/pi-protocol": "^1.0
|
|
777
|
+
"@earendil-works/chord": "^1.1.0",
|
|
778
|
+
"@earendil-works/pi-protocol": "^1.1.0"
|
|
779
779
|
},
|
|
780
780
|
"engines": {
|
|
781
781
|
"node": ">=22.19.0"
|
|
782
782
|
}
|
|
783
783
|
},
|
|
784
784
|
"node_modules/@earendil-works/pi-telemetry": {
|
|
785
|
-
"version": "1.0
|
|
786
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-telemetry/-/pi-telemetry-1.0.
|
|
787
|
-
"integrity": "sha512-
|
|
785
|
+
"version": "1.1.0",
|
|
786
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-telemetry/-/pi-telemetry-1.1.0.tgz",
|
|
787
|
+
"integrity": "sha512-8gAK05/2pPozZZz6hCLOi8x2vsqzvsmO9gG92kbvuvTPm0qMHaFlaXX98ndXsrOi5pmzha7vNLguuG4+0Rgxjw==",
|
|
788
788
|
"license": "MIT",
|
|
789
789
|
"engines": {
|
|
790
790
|
"node": ">=22.19.0"
|
|
791
791
|
}
|
|
792
792
|
},
|
|
793
793
|
"node_modules/@earendil-works/pi-tui": {
|
|
794
|
-
"version": "1.0
|
|
795
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-1.0.
|
|
796
|
-
"integrity": "sha512-
|
|
794
|
+
"version": "1.1.0",
|
|
795
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-1.1.0.tgz",
|
|
796
|
+
"integrity": "sha512-v7wkS0y2ErZvZkSfemqd9RrBZJ5x6p8Ujsv7NdJj01IXJyFM0kNL6rMdcKcvTe7EVTd6ugvDB9VPZSoaBF9QxQ==",
|
|
797
797
|
"license": "MIT",
|
|
798
798
|
"dependencies": {
|
|
799
799
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astralyn/pi",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"pretest": "npm run check:installed-deps",
|
|
55
55
|
"test:isolated": "node scripts/test-isolated.mjs",
|
|
56
56
|
"diff:upstream": "node scripts/diff-upstream.mjs",
|
|
57
|
+
"sync": "node scripts/sync-upstream.mjs",
|
|
58
|
+
"release": "node scripts/release.mjs",
|
|
57
59
|
"verify:package-install": "node scripts/verify-package-install.mjs",
|
|
58
60
|
"profile:tui": "node scripts/profile-node.mjs --mode tui",
|
|
59
61
|
"profile:rpc": "node scripts/profile-node.mjs --mode rpc",
|
|
@@ -62,12 +64,12 @@
|
|
|
62
64
|
"prepublishOnly": "npm run clean && npm run build"
|
|
63
65
|
},
|
|
64
66
|
"dependencies": {
|
|
65
|
-
"@earendil-works/chord": "1.0
|
|
66
|
-
"@earendil-works/pi-agent-core": "1.0
|
|
67
|
-
"@earendil-works/pi-ai": "1.0
|
|
68
|
-
"@earendil-works/pi-codemode": "1.0
|
|
69
|
-
"@earendil-works/pi-mcp": "1.0
|
|
70
|
-
"@earendil-works/pi-tui": "1.0
|
|
67
|
+
"@earendil-works/chord": "1.1.0",
|
|
68
|
+
"@earendil-works/pi-agent-core": "1.1.0",
|
|
69
|
+
"@earendil-works/pi-ai": "1.1.0",
|
|
70
|
+
"@earendil-works/pi-codemode": "1.1.0",
|
|
71
|
+
"@earendil-works/pi-mcp": "1.1.0",
|
|
72
|
+
"@earendil-works/pi-tui": "1.1.0",
|
|
71
73
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
72
74
|
"chalk": "6.0.0",
|
|
73
75
|
"cross-spawn": "7.0.6",
|
|
@@ -89,10 +91,10 @@
|
|
|
89
91
|
"@anthropic-ai/sandbox-runtime": "0.0.26",
|
|
90
92
|
"@anthropic-ai/sdk": "0.52.0",
|
|
91
93
|
"@biomejs/biome": "2.3.5",
|
|
92
|
-
"@earendil-works/pi-client": "1.0
|
|
93
|
-
"@earendil-works/pi-durable": "1.0
|
|
94
|
-
"@earendil-works/pi-protocol": "1.0
|
|
95
|
-
"@earendil-works/pi-server": "1.0
|
|
94
|
+
"@earendil-works/pi-client": "1.1.0",
|
|
95
|
+
"@earendil-works/pi-durable": "1.1.0",
|
|
96
|
+
"@earendil-works/pi-protocol": "1.1.0",
|
|
97
|
+
"@earendil-works/pi-server": "1.1.0",
|
|
96
98
|
"@types/cross-spawn": "6.0.6",
|
|
97
99
|
"@types/hosted-git-info": "3.0.5",
|
|
98
100
|
"@types/ms": "2.1.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{getSystemMessageText}from"./chunk-TXJO4AJ7.js";var CHARS_PER_TOKEN=4,ESTIMATED_IMAGE_CHARS=4800;function calculateContextTokens(usage){return usage.totalTokens||usage.input+usage.output+usage.cacheRead+usage.cacheWrite}function safeJsonStringify(value){try{return JSON.stringify(value)??"undefined"}catch{return"[unserializable]"}}function estimateTextAndImageContentChars(content){if(typeof content=="string")return content.length;let chars=0;for(let block of content)chars+=block.type==="text"?block.text.length:ESTIMATED_IMAGE_CHARS;return chars}function estimateTextTokens(text){return Math.ceil(text.length/CHARS_PER_TOKEN)}function estimateTextAndImageContentTokens(content){return Math.ceil(estimateTextAndImageContentChars(content)/CHARS_PER_TOKEN)}function estimateMessageTokens(message){let chars=0;if(message.role==="system")return estimateTextTokens(getSystemMessageText(message))+estimateToolsTokens(message.toolsAdded)+estimateToolsTokens(message.toolsRemoved);if(message.role==="user"||message.role==="toolResult")return estimateTextAndImageContentTokens(message.content);for(let block of message.content)block.type==="text"?chars+=block.text.length:block.type==="thinking"?chars+=block.thinking.length:chars+=block.name.length+safeJsonStringify(block.arguments).length;return Math.ceil(chars/CHARS_PER_TOKEN)}function getLastAssistantUsageInfo(messages){let latestPrefixTimestamp=Number.NEGATIVE_INFINITY,usageInfo;for(let i=0;i<messages.length;i++){let message=messages[i];if(message.role==="assistant"){let assistant=message;assistant.timestamp>=latestPrefixTimestamp&&assistant.stopReason!=="aborted"&&assistant.stopReason!=="error"&&calculateContextTokens(assistant.usage)>0&&(usageInfo={usage:assistant.usage,index:i})}latestPrefixTimestamp=Math.max(latestPrefixTimestamp,message.timestamp)}return usageInfo}function estimateContextTokens(context){let messages="messages"in context?context.messages:context,usageInfo=getLastAssistantUsageInfo(messages);if(usageInfo){let usageTokens=calculateContextTokens(usageInfo.usage),trailingTokens=0;for(let i=usageInfo.index+1;i<messages.length;i++)trailingTokens+=estimateMessageTokens(messages[i]);return{tokens:usageTokens+trailingTokens,usageTokens,trailingTokens,lastUsageIndex:usageInfo.index}}let tokens=0;for(let message of messages)tokens+=estimateMessageTokens(message);return{tokens,usageTokens:0,trailingTokens:tokens,lastUsageIndex:null}}function estimateToolsTokens(tools){return!tools||tools.length===0?0:estimateTextTokens(safeJsonStringify(tools))}export{estimateContextTokens};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
var FifoQueue=class{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(value){this.incoming.push(value)}dequeue(){if(this.outgoing.length===0)for(;this.incoming.length>0;)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}},EventStream=class{queue=new FifoQueue;waiting=new FifoQueue;done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(isComplete,extractResult){this.isComplete=isComplete,this.extractResult=extractResult,this.finalResultPromise=new Promise(resolve=>{this.resolveFinalResult=resolve})}push(event){if(this.done)return;this.isComplete(event)&&(this.done=!0,this.resolveFinalResult(this.extractResult(event)));let waiter=this.waiting.dequeue();waiter?waiter({value:event,done:!1}):this.queue.enqueue(event)}end(result){for(this.done=!0,result!==void 0&&this.resolveFinalResult(result);this.waiting.length>0;)this.waiting.dequeue()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){for(;;)if(this.queue.length>0)yield this.queue.dequeue();else{if(this.done)return;{let result=await new Promise(resolve=>this.waiting.enqueue(resolve));if(result.done)return;yield result.value}}}result(){return this.finalResultPromise}},AssistantMessageEventStream=class extends EventStream{constructor(){super(event=>event.type==="done"||event.type==="error",event=>{if(event.type==="done")return event.message;if(event.type==="error")return event.error;throw new Error("Unexpected event type for final result")})}};function createAssistantMessageEventStream(){return new AssistantMessageEventStream}function formatThrownValue(value){return value instanceof Error?value.message||value.name:typeof value=="string"?value:String(value)}function extractDiagnosticError(error){if(!(error instanceof Error))return{name:"ThrownValue",message:formatThrownValue(error)};let code=error.code;return{name:error.name||void 0,message:error.message||error.name,stack:error.stack,code:typeof code=="string"||typeof code=="number"?code:void 0}}function createAssistantMessageDiagnostic(type,error,details){return{type,timestamp:Date.now(),error:extractDiagnosticError(error),details}}function appendAssistantMessageDiagnostic(message,diagnostic){message.diagnostics=[...message.diagnostics??[],diagnostic]}export{EventStream,AssistantMessageEventStream,createAssistantMessageEventStream,formatThrownValue,extractDiagnosticError,createAssistantMessageDiagnostic,appendAssistantMessageDiagnostic};
|