@astralyn/pi 0.84.3 → 0.84.5
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 +54 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +11 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +5 -4
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js +1 -4
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/core/agent-session.d.ts +6 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/experimental.d.ts +4 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +10 -14
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +29 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +4 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +1 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +2 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +4 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/project-trust.js +2 -2
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/sdk.d.ts +5 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.js +2 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +12 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +2 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/extensions/background/index.d.ts +74 -0
- package/dist/extensions/background/index.d.ts.map +1 -0
- package/dist/extensions/background/index.js +332 -0
- package/dist/extensions/background/index.js.map +1 -0
- package/dist/extensions/background/manager.d.ts +81 -0
- package/dist/extensions/background/manager.d.ts.map +1 -0
- package/dist/extensions/background/manager.js +320 -0
- package/dist/extensions/background/manager.js.map +1 -0
- package/dist/extensions/background/registry.d.ts +138 -0
- package/dist/extensions/background/registry.d.ts.map +1 -0
- package/dist/extensions/background/registry.js +358 -0
- package/dist/extensions/background/registry.js.map +1 -0
- package/dist/extensions/background/render.d.ts +26 -0
- package/dist/extensions/background/render.d.ts.map +1 -0
- package/dist/extensions/background/render.js +118 -0
- package/dist/extensions/background/render.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/subagent/activity.d.ts +0 -1
- package/dist/extensions/subagent/activity.d.ts.map +1 -1
- package/dist/extensions/subagent/activity.js +2 -5
- package/dist/extensions/subagent/activity.js.map +1 -1
- package/dist/extensions/subagent/agents-command.d.ts +4 -0
- package/dist/extensions/subagent/agents-command.d.ts.map +1 -0
- package/dist/extensions/subagent/agents-command.js +385 -0
- package/dist/extensions/subagent/agents-command.js.map +1 -0
- package/dist/extensions/subagent/agents.d.ts +3 -6
- package/dist/extensions/subagent/agents.d.ts.map +1 -1
- package/dist/extensions/subagent/agents.js +22 -190
- package/dist/extensions/subagent/agents.js.map +1 -1
- package/dist/extensions/subagent/constants.d.ts +4 -5
- package/dist/extensions/subagent/constants.d.ts.map +1 -1
- package/dist/extensions/subagent/constants.js +11 -7
- package/dist/extensions/subagent/constants.js.map +1 -1
- package/dist/extensions/subagent/index.d.ts +0 -3
- package/dist/extensions/subagent/index.d.ts.map +1 -1
- package/dist/extensions/subagent/index.js +58 -315
- package/dist/extensions/subagent/index.js.map +1 -1
- package/dist/extensions/subagent/render.d.ts +1 -1
- package/dist/extensions/subagent/render.d.ts.map +1 -1
- package/dist/extensions/subagent/render.js +208 -585
- package/dist/extensions/subagent/render.js.map +1 -1
- package/dist/extensions/subagent/resolve.d.ts +2 -2
- package/dist/extensions/subagent/resolve.d.ts.map +1 -1
- package/dist/extensions/subagent/resolve.js +23 -15
- package/dist/extensions/subagent/resolve.js.map +1 -1
- package/dist/extensions/subagent/runner.d.ts +1 -2
- package/dist/extensions/subagent/runner.d.ts.map +1 -1
- package/dist/extensions/subagent/runner.js +109 -131
- package/dist/extensions/subagent/runner.js.map +1 -1
- package/dist/extensions/subagent/schema.d.ts +4 -10
- package/dist/extensions/subagent/schema.d.ts.map +1 -1
- package/dist/extensions/subagent/schema.js +8 -13
- package/dist/extensions/subagent/schema.js.map +1 -1
- package/dist/extensions/subagent/sdk-runner.d.ts.map +1 -1
- package/dist/extensions/subagent/sdk-runner.js +9 -20
- package/dist/extensions/subagent/sdk-runner.js.map +1 -1
- package/dist/extensions/subagent/settings.d.ts +2 -3
- package/dist/extensions/subagent/settings.d.ts.map +1 -1
- package/dist/extensions/subagent/settings.js +30 -21
- package/dist/extensions/subagent/settings.js.map +1 -1
- package/dist/extensions/subagent/text.d.ts +3 -0
- package/dist/extensions/subagent/text.d.ts.map +1 -0
- package/dist/extensions/subagent/text.js +16 -0
- package/dist/extensions/subagent/text.js.map +1 -0
- package/dist/extensions/subagent/types.d.ts +13 -33
- package/dist/extensions/subagent/types.d.ts.map +1 -1
- package/dist/extensions/subagent/types.js.map +1 -1
- package/dist/extensions/subagent/ui/model-list.d.ts +68 -0
- package/dist/extensions/subagent/ui/model-list.d.ts.map +1 -0
- package/dist/extensions/subagent/ui/model-list.js +248 -0
- package/dist/extensions/subagent/ui/model-list.js.map +1 -0
- package/dist/extensions/todo/constants.d.ts +6 -17
- package/dist/extensions/todo/constants.d.ts.map +1 -1
- package/dist/extensions/todo/constants.js +20 -31
- package/dist/extensions/todo/constants.js.map +1 -1
- package/dist/extensions/todo/index.d.ts.map +1 -1
- package/dist/extensions/todo/index.js +36 -57
- package/dist/extensions/todo/index.js.map +1 -1
- package/dist/extensions/todo/schema.d.ts +20 -59
- package/dist/extensions/todo/schema.d.ts.map +1 -1
- package/dist/extensions/todo/schema.js +23 -69
- package/dist/extensions/todo/schema.js.map +1 -1
- package/dist/extensions/todo/state.d.ts +23 -65
- package/dist/extensions/todo/state.d.ts.map +1 -1
- package/dist/extensions/todo/state.js +238 -1262
- package/dist/extensions/todo/state.js.map +1 -1
- package/dist/extensions/todo/view.d.ts +19 -10
- package/dist/extensions/todo/view.d.ts.map +1 -1
- package/dist/extensions/todo/view.js +411 -463
- package/dist/extensions/todo/view.js.map +1 -1
- package/dist/extensions/todo/widget.d.ts +15 -0
- package/dist/extensions/todo/widget.d.ts.map +1 -0
- package/dist/extensions/todo/widget.js +50 -0
- package/dist/extensions/todo/widget.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -2
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +5 -11
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +2 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +77 -25
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +36 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +2 -0
- package/dist/modes/interactive/theme/light.json +2 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +10 -2
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +23 -10
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +9 -1
- package/dist/modes/interactive/theme/theme.d.ts +5 -3
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +12 -2
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +4 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +5 -2
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -8
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.js +1 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/server/create-harness.d.ts.map +1 -1
- package/dist/server/create-harness.js +2 -0
- package/dist/server/create-harness.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +10 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +14 -19
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/bundled/README.md +2 -1
- package/docs/bundled/extensions/background.md +64 -0
- package/docs/bundled/extensions/subagent.md +84 -57
- package/docs/bundled/extensions/todo.md +84 -24
- package/docs/bundled/tool-presentation.md +1 -1
- package/docs/compaction.md +6 -6
- package/docs/custom-provider.md +1 -1
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +8 -2
- package/docs/extensions.md +6 -2
- package/docs/json.md +6 -4
- package/docs/keybindings.md +9 -2
- package/docs/rpc.md +15 -4
- package/docs/sdk.md +9 -0
- package/docs/settings.md +31 -0
- package/docs/terminal-setup.md +23 -2
- package/docs/themes.md +24 -3
- package/docs/tui.md +2 -2
- package/docs/usage.md +4 -3
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +0 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/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 +170 -221
- package/package.json +6 -6
- package/dist/extensions/subagent/picker.d.ts +0 -31
- package/dist/extensions/subagent/picker.d.ts.map +0 -1
- package/dist/extensions/subagent/picker.js +0 -109
- package/dist/extensions/subagent/picker.js.map +0 -1
- package/dist/extensions/todo/overlay.d.ts +0 -24
- package/dist/extensions/todo/overlay.d.ts.map +0 -1
- package/dist/extensions/todo/overlay.js +0 -135
- package/dist/extensions/todo/overlay.js.map +0 -1
- package/examples/extensions/subagent/README.md +0 -175
- package/examples/extensions/subagent/agents/planner.md +0 -37
- package/examples/extensions/subagent/agents/reviewer.md +0 -35
- package/examples/extensions/subagent/agents/scout.md +0 -50
- package/examples/extensions/subagent/agents/worker.md +0 -24
- package/examples/extensions/subagent/agents.ts +0 -126
- package/examples/extensions/subagent/index.ts +0 -1009
- package/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
- package/examples/extensions/subagent/prompts/implement.md +0 -10
- package/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
|
@@ -29,7 +29,7 @@ The native tool presentation owns:
|
|
|
29
29
|
|
|
30
30
|
Built-in renderers remain responsible for semantic content such as file paths, syntax highlighting, search results, Diff previews, and command output. The outer shell is native so built-in tools, bundled extensions, and compatible third-party tools share the same presentation.
|
|
31
31
|
|
|
32
|
-
Consecutive tools may opt into a shared collapsed group through `toolGroup`. Built-in `read`, `find`, `grep`, and `ls` calls use the `explore` group, and the bundled `todo` tool uses the `todo` group: their call rows render as one compact run with a single leading gap, while the configured expand-tools key (`Ctrl+O` by default) restores each tool's complete call and result. Collapsed Todo rows are result-aware: successful
|
|
32
|
+
Consecutive tools may opt into a shared collapsed group through `toolGroup`. Built-in `read`, `find`, `grep`, and `ls` calls use the `explore` group, and the bundled `todo` tool uses the `todo` group: their call rows render as one compact run with a single leading gap, while the configured expand-tools key (`Ctrl+O` by default) restores each tool's complete call and result. Collapsed Todo rows are result-aware: successful v2 snapshots report actual created IDs and subjects, update status and automatic active-task demotion, list counts, or deleted IDs rather than only echoing arguments. Failures include a sanitized reason capped at 120 characters; missing, malformed, or older result details fall back safely to the call summary.
|
|
33
33
|
|
|
34
34
|
## Renderer inheritance
|
|
35
35
|
|
package/docs/compaction.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Compaction & Branch Summarization
|
|
2
2
|
|
|
3
|
-
LLMs have limited context windows. When conversations grow too long,
|
|
3
|
+
LLMs have limited context windows. When conversations grow too long, Pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
|
|
4
4
|
|
|
5
5
|
## Public API
|
|
6
6
|
|
|
@@ -51,7 +51,7 @@ You can also trigger manually with `/compact [instructions]`, where optional ins
|
|
|
51
51
|
Before compaction:
|
|
52
52
|
|
|
53
53
|
entry: 0 1 2 3 4 5 6 7 8 9
|
|
54
|
-
|
|
54
|
+
┌─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┐
|
|
55
55
|
│ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│
|
|
56
56
|
└─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┘
|
|
57
57
|
└────────┬───────┘ └──────────────┬──────────────┘
|
|
@@ -62,7 +62,7 @@ Before compaction:
|
|
|
62
62
|
After compaction (new entry appended):
|
|
63
63
|
|
|
64
64
|
entry: 0 1 2 3 4 5 6 7 8 9 10
|
|
65
|
-
|
|
65
|
+
┌─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┬─────┬─────┐
|
|
66
66
|
│ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ tool │ ass │ tool│ cmp │
|
|
67
67
|
└─────┴─────┴─────┴──────┴─────┴─────┴──────┴──────┴─────┴─────┴─────┘
|
|
68
68
|
└──────────┬──────┘ └──────────────────────┬───────────────────┘
|
|
@@ -105,7 +105,7 @@ Split turn (one huge turn exceeds budget):
|
|
|
105
105
|
turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
For split turns,
|
|
108
|
+
For split turns, Pi generates two summaries and merges them:
|
|
109
109
|
1. **History summary**: Previous context (if any)
|
|
110
110
|
2. **Turn prefix summary**: The early part of the split turn
|
|
111
111
|
|
|
@@ -152,7 +152,7 @@ Pi uses an internal preparation step before `compact()`. For direct programmatic
|
|
|
152
152
|
|
|
153
153
|
### When It Triggers
|
|
154
154
|
|
|
155
|
-
When you use `/tree` to navigate to a different branch,
|
|
155
|
+
When you use `/tree` to navigate to a different branch, Pi offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
|
|
156
156
|
|
|
157
157
|
### How It Works
|
|
158
158
|
|
|
@@ -181,7 +181,7 @@ After navigation with summary:
|
|
|
181
181
|
|
|
182
182
|
### Cumulative File Tracking
|
|
183
183
|
|
|
184
|
-
Both compaction and branch summarization track files cumulatively. When generating a summary,
|
|
184
|
+
Both compaction and branch summarization track files cumulatively. When generating a summary, Pi extracts file operations from:
|
|
185
185
|
- Tool calls in the messages being summarized
|
|
186
186
|
- Previous compaction or branch summary `details` (if any)
|
|
187
187
|
|
package/docs/custom-provider.md
CHANGED
|
@@ -169,7 +169,7 @@ Set `api` on the provider as the default, or on a model when one provider has mo
|
|
|
169
169
|
| `openai-responses` | OpenAI Responses APIs |
|
|
170
170
|
| `azure-openai-responses` | Azure OpenAI Responses APIs |
|
|
171
171
|
| `openai-codex-responses` | OpenAI Codex Responses APIs |
|
|
172
|
-
| `mistral-conversations` | Mistral
|
|
172
|
+
| `mistral-conversations` | Native Mistral Chat Completions streaming |
|
|
173
173
|
| `google-generative-ai` | Google Generative AI APIs |
|
|
174
174
|
| `google-vertex` | Google Vertex AI APIs |
|
|
175
175
|
| `bedrock-converse-stream` | Amazon Bedrock Converse Stream APIs |
|
package/docs/docs.json
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
Pi uses environment variables in three ways:
|
|
4
4
|
|
|
5
5
|
- Variables such as `PI_OFFLINE` configure the Pi process.
|
|
6
|
-
- Pi sets
|
|
6
|
+
- Pi sets process markers so child processes can identify Pi as the launching agent.
|
|
7
7
|
- Commands run by the LLM-callable bash tool receive `PI_*` variables describing the current session.
|
|
8
8
|
|
|
9
9
|
Provider API-key variables are documented separately in [Providers](providers.md#environment-variables-or-auth-file).
|
|
10
10
|
|
|
11
11
|
## Process Marker
|
|
12
12
|
|
|
13
|
-
The CLI and RPC entry points set
|
|
13
|
+
The CLI and RPC entry points set two process markers:
|
|
14
|
+
|
|
15
|
+
- `AI_AGENT=pi` is a generic marker that lets tooling identify Pi as the agent that launched the process.
|
|
16
|
+
- `PI_CODING_AGENT=true` is Pi-specific and lets child processes detect that they run inside Pi.
|
|
17
|
+
|
|
18
|
+
Child processes inherit both markers. They are not session-specific and are not set automatically when Pi is embedded through the SDK.
|
|
14
19
|
|
|
15
20
|
## Bash Tool Session Environment
|
|
16
21
|
|
|
@@ -82,6 +87,7 @@ These variables are read by Pi itself:
|
|
|
82
87
|
| `PI_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
|
|
83
88
|
| `PI_SHARE_VIEWER_URL` | Override the base URL used by `/share` |
|
|
84
89
|
| `PI_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
|
|
90
|
+
| `PI_TUI_ESC_TIMEOUT` | How long to wait after a lone ESC before treating it as Escape, in milliseconds; defaults to `100` over SSH and `10` otherwise. Increase it if Alt-key input is misread as Escape |
|
|
85
91
|
| `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
|
|
86
92
|
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
|
|
87
93
|
|
package/docs/extensions.md
CHANGED
|
@@ -999,9 +999,9 @@ ctx.sessionManager.buildContextEntries() // Active branch entries with compac
|
|
|
999
999
|
ctx.sessionManager.getLeafId() // Current leaf entry ID
|
|
1000
1000
|
```
|
|
1001
1001
|
|
|
1002
|
-
### ctx.modelRegistry / ctx.model / ctx.thinkingLevel / ctx.scopedModels
|
|
1002
|
+
### ctx.modelRegistry / ctx.modelRuntime / ctx.model / ctx.thinkingLevel / ctx.scopedModels
|
|
1003
1003
|
|
|
1004
|
-
Access to models, providers, and resolved authentication. `ctx.modelRegistry.getProvider(id)` returns the effective pi-ai provider, while `getProviderAuth(id)` resolves its current API key, headers, base URL, and provider-scoped environment without requiring a loaded model. `ctx.model` is the active model (or `undefined` when none is active), and `ctx.thinkingLevel` is its current effective thinking level when the session runtime provides one.
|
|
1004
|
+
Access to models, providers, and resolved authentication. `ctx.modelRegistry.getProvider(id)` returns the effective pi-ai provider, while `getProviderAuth(id)` resolves its current API key, headers, base URL, and provider-scoped environment without requiring a loaded model. `ctx.modelRuntime` is the canonical `ModelRuntime` owned by the current session; use it when creating nested SDK sessions so they share the same provider registrations, model catalog, and credentials instead of constructing and synchronizing a mirror runtime. `ctx.model` is the active model (or `undefined` when none is active), and `ctx.thinkingLevel` is its current effective thinking level when the session runtime provides one.
|
|
1005
1005
|
|
|
1006
1006
|
`ctx.scopedModels` is the read-only list of models scoped to the current session—the same set shown by `/scoped-models`. Pi resolves it at session start from `--models` and the `enabledModels` setting, matching `provider/modelId` or bare `modelId` patterns with minimatch. An empty list means no scope is configured and every available model is usable. Each entry is `{ model, thinkingLevel? }`; use this list when a custom model picker should mirror the built-in scope rather than enumerate the full registry.
|
|
1007
1007
|
|
|
@@ -1448,12 +1448,16 @@ pi.sendUserMessage([
|
|
|
1448
1448
|
// During streaming - must specify delivery mode
|
|
1449
1449
|
pi.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
|
|
1450
1450
|
pi.sendUserMessage("And then summarize", { deliverAs: "followUp" });
|
|
1451
|
+
|
|
1452
|
+
// Opt in to extension command dispatch and skill/prompt template expansion
|
|
1453
|
+
pi.sendUserMessage("/review src/index.ts", { expandPromptTemplates: true });
|
|
1451
1454
|
```
|
|
1452
1455
|
|
|
1453
1456
|
**Options:**
|
|
1454
1457
|
- `deliverAs` - Required when agent is streaming:
|
|
1455
1458
|
- `"steer"` - Queues the message for delivery after the current assistant turn finishes executing its tool calls
|
|
1456
1459
|
- `"followUp"` - Waits for agent to finish all tools
|
|
1460
|
+
- `expandPromptTemplates` - Dispatch extension commands and expand skill commands and prompt templates. Defaults to `false`.
|
|
1457
1461
|
|
|
1458
1462
|
When not streaming, the message is sent immediately and triggers a new turn. When streaming without `deliverAs`, throws an error.
|
|
1459
1463
|
|
package/docs/json.md
CHANGED
|
@@ -17,6 +17,7 @@ type JsonAgentSessionEvent =
|
|
|
17
17
|
| Exclude<AgentSessionEvent, { type: "message_update" }>
|
|
18
18
|
| {
|
|
19
19
|
type: "message_update";
|
|
20
|
+
usage: Usage;
|
|
20
21
|
assistantMessageEvent: WithoutPartial<AssistantMessageEvent>;
|
|
21
22
|
};
|
|
22
23
|
```
|
|
@@ -93,16 +94,17 @@ Followed by events as they occur:
|
|
|
93
94
|
{"type":"agent_start"}
|
|
94
95
|
{"type":"turn_start"}
|
|
95
96
|
{"type":"message_start","message":{"role":"assistant","content":[],...}}
|
|
96
|
-
{"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
97
|
+
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
97
98
|
{"type":"message_end","message":{...}}
|
|
98
99
|
{"type":"turn_end","message":{...},"toolResults":[]}
|
|
99
100
|
{"type":"agent_end","messages":[...],"willRetry":false}
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
`message_update` records are delta-only. They omit both the cumulative `message` field and
|
|
103
|
-
`assistantMessageEvent.partial` to keep stream size linear.
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
`assistantMessageEvent.partial` to keep stream size linear. The top-level `usage` field contains
|
|
105
|
+
the latest cumulative provider-reported usage and may remain zero when a provider only reports
|
|
106
|
+
usage at completion. Use `contentIndex` and `delta` to assemble live text, thinking, or tool-call
|
|
107
|
+
arguments if needed. `message_end` contains the final authoritative message.
|
|
106
108
|
|
|
107
109
|
## Example
|
|
108
110
|
|
package/docs/keybindings.md
CHANGED
|
@@ -86,7 +86,7 @@ The dedicated history actions always change history entries, regardless of the c
|
|
|
86
86
|
|
|
87
87
|
### TUI Fullscreen Viewport
|
|
88
88
|
|
|
89
|
-
These actions apply when interactive mode uses `--tui-mode fullscreen` and target the primary transcript scroll region. Two-finger trackpad and mouse-wheel input scroll the region under the pointer, falling back to the transcript over the fixed editor/status/footer dock. Clicking an OSC 8 hyperlink opens it in the default handler. Dragging with the primary mouse button selects text and copies it to the clipboard; holding at the transcript's top or bottom edge auto-scrolls into off-screen content.
|
|
89
|
+
These actions apply when interactive mode uses `--tui-mode fullscreen` and target the primary transcript scroll region. Two-finger trackpad and mouse-wheel input scroll the region under the pointer, falling back to the transcript over the fixed editor/status/footer dock. Clicking an OSC 8 hyperlink opens it in the default handler. Dragging with the primary mouse button selects text and copies it to the clipboard; holding at the transcript's top or bottom edge auto-scrolls into off-screen content. See [Terminal setup](terminal-setup.md) for terminal-specific mouse and trackpad behavior.
|
|
90
90
|
|
|
91
91
|
Fullscreen transcript bindings take precedence over editor bindings. The default unmodified navigation keys therefore control the transcript in fullscreen mode, while their `ctrl` variants continue to control the editor. Outside fullscreen mode, both variants control the editor.
|
|
92
92
|
|
|
@@ -97,7 +97,7 @@ Fullscreen transcript bindings take precedence over editor bindings. The default
|
|
|
97
97
|
| `pageUp`, `pageDown` | Editor | Transcript |
|
|
98
98
|
| `ctrl+pageUp`, `ctrl+pageDown` | Editor | Editor |
|
|
99
99
|
|
|
100
|
-
This routing remains configurable through the ordinary action bindings. For example, `"tui.altScreen.pageUp": "ctrl+pageUp"` makes `pageUp` control the editor and `ctrl+pageUp` control the transcript in fullscreen mode. Bind `tui.altScreen.halfPageUp` and `tui.altScreen.halfPageDown` for
|
|
100
|
+
This routing remains configurable through the ordinary action bindings. For example, `"tui.altScreen.pageUp": "ctrl+pageUp"` makes `pageUp` control the editor and `ctrl+pageUp` control the transcript in fullscreen mode. Bind `tui.altScreen.halfPageUp` and `tui.altScreen.halfPageDown` for half-page steps, or bind `tui.altScreen.lineUp` and `tui.altScreen.lineDown` for single-line steps. Setting `"tui.altScreen.pageUp": []` disables that transcript shortcut entirely. User bindings replace the defaults for that action.
|
|
101
101
|
|
|
102
102
|
| Keybinding id | Default | Description |
|
|
103
103
|
|--------|---------|-------------|
|
|
@@ -105,8 +105,14 @@ This routing remains configurable through the ordinary action bindings. For exam
|
|
|
105
105
|
| `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
|
|
106
106
|
| `tui.altScreen.halfPageUp` | *(none)* | Scroll the transcript up by half a page |
|
|
107
107
|
| `tui.altScreen.halfPageDown` | *(none)* | Scroll the transcript down by half a page |
|
|
108
|
+
| `tui.altScreen.lineUp` | *(none)* | Scroll the transcript up by one line |
|
|
109
|
+
| `tui.altScreen.lineDown` | *(none)* | Scroll the transcript down by one line |
|
|
108
110
|
| `tui.altScreen.previousPrompt` | `ctrl+shift+up` | Jump to the previous marked message |
|
|
109
111
|
| `tui.altScreen.nextPrompt` | `ctrl+shift+down` | Jump to the next marked message |
|
|
112
|
+
| `tui.altScreen.search` | `ctrl+shift+f` | Search the rendered transcript |
|
|
113
|
+
| `tui.altScreen.searchNext` | `enter`, `ctrl+g` | Select the next search match while searching |
|
|
114
|
+
| `tui.altScreen.searchPrevious` | `shift+enter`, `ctrl+shift+g` | Select the previous search match while searching |
|
|
115
|
+
| `tui.altScreen.searchClose` | `escape` | Close transcript search |
|
|
110
116
|
| `tui.altScreen.top` | `home` | Scroll to the beginning of the transcript |
|
|
111
117
|
| `tui.altScreen.bottom` | `end` | Scroll to the transcript end and follow new output |
|
|
112
118
|
|
|
@@ -120,6 +126,7 @@ This routing remains configurable through the ordinary action bindings. For exam
|
|
|
120
126
|
| `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
|
|
121
127
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
|
|
122
128
|
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image or text from clipboard |
|
|
129
|
+
| `app.backgroundTasks.kill` | `k` | Stop the selected task in the Background task menu |
|
|
123
130
|
|
|
124
131
|
### Sessions
|
|
125
132
|
|
package/docs/rpc.md
CHANGED
|
@@ -954,6 +954,14 @@ Emitted during streaming of assistant messages. Contains a delta event without a
|
|
|
954
954
|
```json
|
|
955
955
|
{
|
|
956
956
|
"type": "message_update",
|
|
957
|
+
"usage": {
|
|
958
|
+
"input": 100,
|
|
959
|
+
"output": 1,
|
|
960
|
+
"cacheRead": 0,
|
|
961
|
+
"cacheWrite": 0,
|
|
962
|
+
"totalTokens": 101,
|
|
963
|
+
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0}
|
|
964
|
+
},
|
|
957
965
|
"assistantMessageEvent": {
|
|
958
966
|
"type": "text_delta",
|
|
959
967
|
"contentIndex": 0,
|
|
@@ -978,12 +986,15 @@ The `assistantMessageEvent` field contains one of these delta types:
|
|
|
978
986
|
|
|
979
987
|
Example streaming a text response:
|
|
980
988
|
```json
|
|
981
|
-
{"type":"message_update","assistantMessageEvent":{"type":"text_start","contentIndex":0}}
|
|
982
|
-
{"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
983
|
-
{"type":"message_update","assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":" world"}}
|
|
984
|
-
{"type":"message_update","assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world"}}
|
|
989
|
+
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_start","contentIndex":0}}
|
|
990
|
+
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
991
|
+
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":" world"}}
|
|
992
|
+
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world"}}
|
|
985
993
|
```
|
|
986
994
|
|
|
995
|
+
The top-level `usage` field contains the latest cumulative provider-reported usage. It may remain
|
|
996
|
+
zero until completion when a provider does not report usage during streaming.
|
|
997
|
+
|
|
987
998
|
`message_update` intentionally omits the former cumulative `message` field and
|
|
988
999
|
`assistantMessageEvent.partial`. Clients that need a live partial message must assemble it
|
|
989
1000
|
from `message_start` and subsequent events using `contentIndex`. Treat `message_end.message`
|
package/docs/sdk.md
CHANGED
|
@@ -408,6 +408,13 @@ import { createAgentSession, ModelRuntime } from "@astralyn/pi";
|
|
|
408
408
|
|
|
409
409
|
const modelRuntime = await ModelRuntime.create();
|
|
410
410
|
|
|
411
|
+
// create() restores cached catalogs but does not refresh them from pi.dev by default.
|
|
412
|
+
// Opt in to a create-time network refresh and bound how long it may take:
|
|
413
|
+
const refreshedRuntime = await ModelRuntime.create({
|
|
414
|
+
allowModelNetwork: true,
|
|
415
|
+
modelRefreshTimeoutMs: 15_000,
|
|
416
|
+
});
|
|
417
|
+
|
|
411
418
|
// Find specific built-in models (doesn't check whether API keys exist)
|
|
412
419
|
const opus = getModel("anthropic", "claude-opus-4-5");
|
|
413
420
|
const sonnet = getModel("anthropic", "claude-sonnet-4-5");
|
|
@@ -439,6 +446,8 @@ If no model is provided:
|
|
|
439
446
|
2. Uses default from settings
|
|
440
447
|
3. Prefers a known provider default among available models, then falls back to the first available model
|
|
441
448
|
|
|
449
|
+
Remote catalogs are persisted locally so later runtimes can restore them without a network request. The default file is `~/.pi/agent/models-store.json`; set `modelsStorePath` to choose another location, or inject `modelsStore` to control persistence. Network refreshes are throttled to once per provider every four hours unless forced. To force an immediate refresh, call `await modelRuntime.refresh({ allowNetwork: true, force: true, signal })`. Setting `PI_OFFLINE` disables model network access.
|
|
450
|
+
|
|
442
451
|
To match CLI model parsing, use the exported resolver helpers:
|
|
443
452
|
|
|
444
453
|
```typescript
|
package/docs/settings.md
CHANGED
|
@@ -66,6 +66,7 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
66
66
|
| `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
|
|
67
67
|
| `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
|
|
68
68
|
| `tuiMode` | string | `"fullscreen"` | Interactive TUI mode: `"fullscreen"` or `"regular"`. Changes from `/settings` apply immediately; `--tui-mode` overrides this setting at startup |
|
|
69
|
+
| `fullscreenExitOutput` | string | `"transcript"` | Fullscreen exit output: `"transcript"` prints the final transcript and resume hint, while `"resume-hint"` restores the previous screen and prints only the resume hint. Has no effect in regular TUI mode |
|
|
69
70
|
| `fullscreenScrollbar` | string | `"auto"` | Fullscreen transcript scrollbar: `"auto"` shows it temporarily while scrolling, `"always"` reserves the rightmost column and keeps it visible, and `"hidden"` hides it. Has no effect in regular TUI mode |
|
|
70
71
|
|
|
71
72
|
For VS Code, include `--wait` so pi resumes after the editor exits:
|
|
@@ -191,6 +192,20 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
191
192
|
| `shellCommandPrefix` | string | - | Prefix for every bash command (e.g., `"shopt -s expand_aliases"`) |
|
|
192
193
|
| `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
|
|
193
194
|
|
|
195
|
+
Windows paths in JSON must use forward slashes or escaped backslashes:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"shellPath": "C:/Program Files/Git/bin/bash.exe"
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"shellPath": "C:\\Program Files\\Git\\bin\\bash.exe"
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
194
209
|
```json
|
|
195
210
|
{
|
|
196
211
|
"npmCommand": ["mise", "exec", "node@20", "--", "npm"]
|
|
@@ -199,6 +214,22 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
199
214
|
|
|
200
215
|
`npmCommand` is used for all npm package-manager operations, including installs, uninstalls, and dependency installs inside git packages. User-scoped npm packages install under `~/.pi/agent/npm/`; project-scoped npm packages install under `.pi/npm/`. Use argv-style entries exactly as the process should be launched. When `npmCommand` is configured, git package dependency installs use plain `install` to avoid npm-specific flags in wrappers or alternate package managers.
|
|
201
216
|
|
|
217
|
+
### Tools
|
|
218
|
+
|
|
219
|
+
| Setting | Type | Default | Description |
|
|
220
|
+
|---------|------|---------|-------------|
|
|
221
|
+
| `defaultTools` | string[] | - | Built-in tools enabled initially. When omitted, Pi uses its standard defaults |
|
|
222
|
+
|
|
223
|
+
`defaultTools` selects the built-in tools enabled at startup. Extension and SDK custom tools remain enabled:
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"defaultTools": ["bash", "edit", "write"]
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
An empty array starts with no built-in tools while preserving extension and SDK custom tools. `--tools` replaces this behavior with a strict allowlist for all tools, `--no-tools` disables all tools, and `--no-builtin-tools` disables the built-in defaults. `--exclude-tools` filters the resulting list. A project `defaultTools` array replaces the global array.
|
|
232
|
+
|
|
202
233
|
### Sessions
|
|
203
234
|
|
|
204
235
|
| Setting | Type | Default | Description |
|
package/docs/terminal-setup.md
CHANGED
|
@@ -2,9 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Pi uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
|
|
4
4
|
|
|
5
|
-
## Kitty
|
|
5
|
+
## Kitty
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Works out of the box.
|
|
8
|
+
|
|
9
|
+
## iTerm2
|
|
10
|
+
|
|
11
|
+
### Regular TUI mode
|
|
12
|
+
|
|
13
|
+
Works out of the box.
|
|
14
|
+
|
|
15
|
+
### Fullscreen TUI mode
|
|
16
|
+
|
|
17
|
+
Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling its native scrollback. With iTerm2's default fast-trackpad behavior, those reports can lose most of an accelerated wheel delta, making fullscreen scrolling much slower than regular scrolling.
|
|
18
|
+
|
|
19
|
+
If fast mouse-wheel gestures move only about one line at a time in fullscreen mode:
|
|
20
|
+
|
|
21
|
+
1. Open **iTerm2 → Settings → Advanced**.
|
|
22
|
+
2. Search for **Trackpad scrolls fast?** and set it to **No**.
|
|
23
|
+
|
|
24
|
+
This is an iTerm2-wide workaround and may also change native trackpad scrolling. The underlying behavior is tracked in [iTerm2 issue 9619](https://gitlab.com/gnachman/iterm2/-/work_items/9619).
|
|
8
25
|
|
|
9
26
|
## Apple Terminal
|
|
10
27
|
|
|
@@ -32,6 +49,10 @@ If Claude Code 2.x or newer is the only reason you added that mapping, you can r
|
|
|
32
49
|
|
|
33
50
|
Pi binds `Ctrl+J` as a default newline alias, so `Shift+Enter` keeps working in tmux via that remap without extra pi configuration.
|
|
34
51
|
|
|
52
|
+
### Fullscreen TUI mode
|
|
53
|
+
|
|
54
|
+
In fullscreen mode, links remain clickable, but Ghostty does not show its hover underline or lower-left URL preview while pi captures mouse input. Hold `Shift+Command` on macOS or `Shift+Ctrl` on Linux to use Ghostty's native link handling.
|
|
55
|
+
|
|
35
56
|
## WezTerm
|
|
36
57
|
|
|
37
58
|
WezTerm usually works out of the box for `Shift+Enter` via xterm modifyOtherKeys. To use the Kitty keyboard protocol explicitly, create `~/.wezterm.lua`:
|
package/docs/themes.md
CHANGED
|
@@ -39,6 +39,23 @@ Select a theme via `/settings` or in `settings.json`:
|
|
|
39
39
|
|
|
40
40
|
On first run, pi detects your terminal background and defaults to `dark` or `light`.
|
|
41
41
|
|
|
42
|
+
### Initial Theme
|
|
43
|
+
|
|
44
|
+
Start an interactive run with a theme without changing the saved setting:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pi --use-theme light
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To follow terminal appearance, use `lightTheme/darkTheme` syntax:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pi --use-theme light/dark
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The CLI value is the initial theme for that run. Choosing another theme later in `/settings` applies it immediately
|
|
57
|
+
and saves it normally.
|
|
58
|
+
|
|
42
59
|
## Creating a Custom Theme
|
|
43
60
|
|
|
44
61
|
1. Create a theme file:
|
|
@@ -72,6 +89,8 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
72
89
|
"thinkingText": "secondary",
|
|
73
90
|
"selectedBg": "#2d2d30",
|
|
74
91
|
"scrollbarThumb": "#555566",
|
|
92
|
+
"searchMatchBg": "#2d2d30",
|
|
93
|
+
"searchMatchText": "",
|
|
75
94
|
"userMessageBg": "#2d2d30",
|
|
76
95
|
"userMessageText": "",
|
|
77
96
|
"customMessageBg": "#2d2d30",
|
|
@@ -141,13 +160,13 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
141
160
|
|
|
142
161
|
- `name` is required, must be unique, and must not contain `/`.
|
|
143
162
|
- `vars` is optional. Define reusable colors here, then reference them in `colors`.
|
|
144
|
-
- `colors` must define all 51 required tokens. `thinkingMax`
|
|
163
|
+
- `colors` must define all 51 required tokens. `thinkingMax`, `scrollbarThumb`, and the two search highlight tokens are optional and use the fallbacks listed below.
|
|
145
164
|
|
|
146
165
|
The `$schema` field enables editor auto-completion and validation.
|
|
147
166
|
|
|
148
167
|
## Color Tokens
|
|
149
168
|
|
|
150
|
-
Every theme must define all 51 required color tokens. `thinkingMax`
|
|
169
|
+
Every theme must define all 51 required color tokens. The optional tokens preserve compatibility with existing themes: `thinkingMax` falls back to `thinkingXhigh`, `scrollbarThumb` and `searchMatchBg` fall back to `selectedBg`, and `searchMatchText` falls back to `text`. Other search matches use `searchMatchText` on `searchMatchBg` with an underline; the current match reverses that foreground/background pair and uses bold text.
|
|
151
170
|
|
|
152
171
|
### Core UI (11 colors)
|
|
153
172
|
|
|
@@ -165,12 +184,14 @@ Every theme must define all 51 required color tokens. `thinkingMax` and `scrollb
|
|
|
165
184
|
| `text` | Default text (usually `""`) |
|
|
166
185
|
| `thinkingText` | Thinking block text |
|
|
167
186
|
|
|
168
|
-
### Backgrounds & Content (11 required,
|
|
187
|
+
### Backgrounds & Content (11 required, 3 optional)
|
|
169
188
|
|
|
170
189
|
| Token | Purpose |
|
|
171
190
|
|-------|---------|
|
|
172
191
|
| `selectedBg` | Selected line background |
|
|
173
192
|
| `scrollbarThumb` | Fullscreen scrollbar thumb background; optional, falls back to `selectedBg` |
|
|
193
|
+
| `searchMatchBg` | Transcript search match background and current-match text; optional, falls back to `selectedBg` |
|
|
194
|
+
| `searchMatchText` | Transcript search match text and current-match background; optional, falls back to `text` |
|
|
174
195
|
| `userMessageBg` | User message background |
|
|
175
196
|
| `userMessageText` | User message text |
|
|
176
197
|
| `customMessageBg` | Extension message background |
|
package/docs/tui.md
CHANGED
|
@@ -363,7 +363,7 @@ Foreground color names:
|
|
|
363
363
|
|
|
364
364
|
| Category | Colors |
|
|
365
365
|
|---|---|
|
|
366
|
-
| General | `text`, `accent`, `muted`, `dim` |
|
|
366
|
+
| General | `text`, `accent`, `muted`, `dim`, `searchMatchText` |
|
|
367
367
|
| Status | `success`, `error`, `warning` |
|
|
368
368
|
| Borders | `border`, `borderAccent`, `borderMuted` |
|
|
369
369
|
| Messages | `userMessageText`, `customMessageText`, `customMessageLabel` |
|
|
@@ -374,7 +374,7 @@ Foreground color names:
|
|
|
374
374
|
| Thinking | `thinkingText`, `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh`, `thinkingMax` |
|
|
375
375
|
| Mode | `bashMode` |
|
|
376
376
|
|
|
377
|
-
Background color names: `selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, and `toolErrorBg`.
|
|
377
|
+
Background color names: `selectedBg`, `searchMatchBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, and `toolErrorBg`.
|
|
378
378
|
|
|
379
379
|
For Markdown, use Pi's public helper:
|
|
380
380
|
|
package/docs/usage.md
CHANGED
|
@@ -234,15 +234,16 @@ pi --no-extensions -e ./my-extension.ts
|
|
|
234
234
|
| `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
|
|
235
235
|
| `--append-system-prompt <text>` | Append to system prompt |
|
|
236
236
|
| `--tui-mode <mode>` | TUI mode: `fullscreen` (default) or `regular` |
|
|
237
|
+
| `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
|
|
237
238
|
| `--verbose` | Force verbose startup |
|
|
238
239
|
| `-a`, `--approve` | Trust project-local files for this run |
|
|
239
240
|
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
240
241
|
| `-h`, `--help` | Show help |
|
|
241
242
|
| `-v`, `--version` | Show version |
|
|
242
243
|
|
|
243
|
-
In `fullscreen` mode, the transcript scrolls inside the terminal viewport while queued messages, working status, extension widgets, editor, and footer remain fixed at the bottom. Mouse/trackpad input scrolls the region under the pointer; keyboard viewport actions always remain available. Inline images work in terminals that support the Kitty graphics protocol, including Kitty and Ghostty. In iTerm2 they render as text placeholders because its inline-image protocol cannot delete or crop placements during application-owned scrolling. In `regular` mode, pi uses the main screen and terminal-owned scrollback, and iTerm2 inline images continue to render normally.
|
|
244
|
+
In `fullscreen` mode, the transcript scrolls inside the terminal viewport while queued messages, working status, extension widgets, editor, and footer remain fixed at the bottom. Mouse/trackpad input scrolls the region under the pointer; keyboard viewport actions always remain available. Inline images work in terminals that support the Kitty graphics protocol, including Kitty and Ghostty. In iTerm2 they render as text placeholders because its inline-image protocol cannot delete or crop placements during application-owned scrolling. In `regular` mode, pi uses the main screen and terminal-owned scrollback, and iTerm2 inline images continue to render normally. See [Terminal setup](terminal-setup.md) for terminal-specific settings and workarounds.
|
|
244
245
|
|
|
245
|
-
Set **TUI mode** in `/settings` to switch between `regular` and `fullscreen` immediately and choose the default for future sessions.
|
|
246
|
+
Set **TUI mode** in `/settings` to switch between `regular` and `fullscreen` immediately and choose the default for future sessions. **Fullscreen exit output** controls whether exiting fullscreen prints the final transcript or restores the previous screen and prints only the session resume hint.
|
|
246
247
|
|
|
247
248
|
### File Arguments
|
|
248
249
|
|
|
@@ -292,6 +293,6 @@ pi --exclude-tools ask_question
|
|
|
292
293
|
|
|
293
294
|
Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
|
|
294
295
|
|
|
295
|
-
This distribution ships selected workflows as hidden built-in extensions, including sub-agents
|
|
296
|
+
This distribution ships selected workflows as hidden built-in extensions, including sub-agents, to-dos, and background bash tasks. It does not include built-in MCP or permission popups. You can build or install additional workflows as extensions or packages, or use external tools such as containers and tmux.
|
|
296
297
|
|
|
297
298
|
For the full rationale, read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/).
|
package/examples/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Programmatic usage via `createAgentSession()`. Shows how to customize models, pr
|
|
|
15
15
|
### [extensions/](extensions/)
|
|
16
16
|
Example extensions demonstrating:
|
|
17
17
|
- Lifecycle event handlers (tool interception, safety gates, context modifications)
|
|
18
|
-
- Custom tools (todo lists, questions,
|
|
18
|
+
- Custom tools (todo lists, questions, output truncation)
|
|
19
19
|
- Commands and keyboard shortcuts
|
|
20
20
|
- Custom UI (footers, headers, editors, overlays)
|
|
21
21
|
- Git integration (checkpoints, auto-commit)
|
|
@@ -43,7 +43,6 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
43
43
|
| `minimal-mode.ts` | Override built-in tool rendering for minimal display (only tool calls, no output in collapsed mode) |
|
|
44
44
|
| `truncated-tool.ts` | Wraps ripgrep with proper output truncation (50KB/2000 lines) |
|
|
45
45
|
| `ssh.ts` | Delegate all tools to a remote machine via SSH using pluggable operations |
|
|
46
|
-
| `subagent/` | Delegate tasks to specialized subagents with isolated context windows |
|
|
47
46
|
|
|
48
47
|
### Commands & UI
|
|
49
48
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.84.
|
|
9
|
+
"version": "0.84.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.84.
|
|
9
|
+
"version": "0.84.2",
|
|
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.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.14.
|
|
9
|
+
"version": "1.14.2",
|
|
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": "0.84.
|
|
3
|
+
"version": "0.84.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.84.
|
|
9
|
+
"version": "0.84.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|