@averyyy/pi-coding-agent 0.80.3-piclient.8 → 0.80.6-piclient.10
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 +104 -0
- package/README.md +5 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +4 -2
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +100 -30
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +13 -5
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +1 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +56 -81
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +6 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +6 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +43 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +33 -11
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +22 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +8 -3
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +10 -9
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -6
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +39 -9
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +10 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +14 -17
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +4 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +75 -28
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-client-runtime-update.d.ts +14 -0
- package/dist/core/pi-client-runtime-update.d.ts.map +1 -0
- package/dist/core/pi-client-runtime-update.js +27 -0
- package/dist/core/pi-client-runtime-update.js.map +1 -0
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +122 -5
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js +0 -10
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -7
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +20 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +97 -68
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +9 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +3 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -2
- 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/config-selector.d.ts +34 -3
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +280 -25
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +4 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +9 -2
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +3 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +17 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +12 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +5 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +49 -12
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +16 -5
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +368 -97
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -0
- package/dist/modes/interactive/theme/light.json +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +6 -2
- package/dist/modes/interactive/theme/theme.d.ts +3 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +10 -3
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +3 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts +2 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +71 -17
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +13 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/docs/custom-provider.md +6 -3
- package/docs/extensions.md +213 -18
- package/docs/keybindings.md +1 -0
- package/docs/models.md +51 -8
- package/docs/packages.md +2 -2
- package/docs/providers.md +3 -0
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +15 -5
- package/docs/sdk.md +51 -1
- package/docs/session-format.md +18 -8
- package/docs/settings.md +3 -2
- package/docs/themes.md +5 -3
- package/docs/tui.md +1 -1
- package/docs/usage.md +3 -2
- package/examples/extensions/README.md +1 -0
- 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/entry-renderer.ts +41 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/question.ts +1 -0
- package/examples/extensions/reload-runtime.ts +2 -2
- 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/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +8 -4
package/docs/sdk.md
CHANGED
|
@@ -387,7 +387,7 @@ const available = await modelRegistry.getAvailable();
|
|
|
387
387
|
|
|
388
388
|
const { session } = await createAgentSession({
|
|
389
389
|
model: opus,
|
|
390
|
-
thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh
|
|
390
|
+
thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh, max
|
|
391
391
|
|
|
392
392
|
// Models for cycling (Ctrl+P in interactive mode)
|
|
393
393
|
scopedModels: [
|
|
@@ -405,6 +405,32 @@ If no model is provided:
|
|
|
405
405
|
2. Uses default from settings
|
|
406
406
|
3. Falls back to first available model
|
|
407
407
|
|
|
408
|
+
To match CLI model parsing, use the exported resolver helpers:
|
|
409
|
+
|
|
410
|
+
```typescript
|
|
411
|
+
import {
|
|
412
|
+
resolveCliModel,
|
|
413
|
+
resolveModelScopeWithDiagnostics,
|
|
414
|
+
} from "@earendil-works/pi-coding-agent";
|
|
415
|
+
|
|
416
|
+
const cliModel = resolveCliModel({
|
|
417
|
+
cliModel: "anthropic/claude-opus-4-5:high",
|
|
418
|
+
modelRegistry,
|
|
419
|
+
});
|
|
420
|
+
if (cliModel.error) throw new Error(cliModel.error);
|
|
421
|
+
if (cliModel.warning) console.warn(cliModel.warning);
|
|
422
|
+
|
|
423
|
+
const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(
|
|
424
|
+
["anthropic/*:high", "gpt-5"],
|
|
425
|
+
modelRegistry,
|
|
426
|
+
);
|
|
427
|
+
for (const diagnostic of diagnostics) {
|
|
428
|
+
console.warn(diagnostic.message);
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
`resolveCliModel()` uses all registered models so `--api-key` style first-time setup can resolve a model before stored auth exists. `resolveModelScopeWithDiagnostics()` matches `--models` and `enabledModels` semantics while returning warnings instead of printing them.
|
|
433
|
+
|
|
408
434
|
> See [examples/sdk/02-custom-model.ts](../examples/sdk/02-custom-model.ts)
|
|
409
435
|
|
|
410
436
|
### API Keys and OAuth
|
|
@@ -578,6 +604,27 @@ const { session } = await createAgentSession({ resourceLoader: loader });
|
|
|
578
604
|
|
|
579
605
|
Extensions can register tools, subscribe to events, add commands, and more. See [extensions.md](extensions.md) for the full API.
|
|
580
606
|
|
|
607
|
+
**Named inline extensions:** By default, inline factories display as `<inline:1>`, `<inline:2>`, etc. in the startup Extensions list. To show a descriptive name instead, wrap the factory:
|
|
608
|
+
|
|
609
|
+
```typescript
|
|
610
|
+
import type { InlineExtension } from "@earendil-works/pi-coding-agent";
|
|
611
|
+
|
|
612
|
+
const myProvider: InlineExtension = {
|
|
613
|
+
name: "my-provider",
|
|
614
|
+
factory: (pi) => {
|
|
615
|
+
pi.on("agent_start", () => {
|
|
616
|
+
console.log("[my-provider] Agent starting");
|
|
617
|
+
});
|
|
618
|
+
},
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
const loader = new DefaultResourceLoader({
|
|
622
|
+
extensionFactories: [myProvider],
|
|
623
|
+
});
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
This displays as `<inline:my-provider>` instead of `<inline:1>`. Bare factory functions are still accepted for backward compatibility.
|
|
627
|
+
|
|
581
628
|
**Event Bus:** Extensions can communicate via `pi.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
|
|
582
629
|
|
|
583
630
|
```typescript
|
|
@@ -1104,6 +1151,8 @@ AgentSessionRuntime
|
|
|
1104
1151
|
// Auth and Models
|
|
1105
1152
|
AuthStorage
|
|
1106
1153
|
ModelRegistry
|
|
1154
|
+
resolveCliModel
|
|
1155
|
+
resolveModelScopeWithDiagnostics
|
|
1107
1156
|
|
|
1108
1157
|
// Resource loading
|
|
1109
1158
|
DefaultResourceLoader
|
|
@@ -1133,6 +1182,7 @@ createGrepTool, createFindTool, createLsTool
|
|
|
1133
1182
|
type CreateAgentSessionOptions
|
|
1134
1183
|
type CreateAgentSessionResult
|
|
1135
1184
|
type ExtensionFactory
|
|
1185
|
+
type InlineExtension
|
|
1136
1186
|
type ExtensionAPI
|
|
1137
1187
|
type ToolDefinition
|
|
1138
1188
|
type Skill
|
package/docs/session-format.md
CHANGED
|
@@ -255,7 +255,7 @@ Extension state persistence. Does NOT participate in LLM context.
|
|
|
255
255
|
{"type":"custom","id":"h8i9j0k1","parentId":"g7h8i9j0","timestamp":"2024-12-03T14:20:00.000Z","customType":"my-extension","data":{"count":42}}
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
Use `customType` to identify your extension's entries on reload.
|
|
258
|
+
Use `customType` to identify your extension's entries on reload. Interactive mode can render custom entries via `pi.registerEntryRenderer(customType, renderer)`, but they still do not participate in LLM context.
|
|
259
259
|
|
|
260
260
|
### CustomMessageEntry
|
|
261
261
|
|
|
@@ -306,15 +306,24 @@ Entries form a tree:
|
|
|
306
306
|
|
|
307
307
|
## Context Building
|
|
308
308
|
|
|
309
|
-
`
|
|
309
|
+
`buildContextEntries()` walks from the current leaf to the root, producing the active entry list while honoring compaction:
|
|
310
310
|
|
|
311
311
|
1. Collects all entries on the path
|
|
312
|
-
2.
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
- Then
|
|
316
|
-
|
|
317
|
-
|
|
312
|
+
2. If a `CompactionEntry` is on the path:
|
|
313
|
+
- Includes the compaction entry first
|
|
314
|
+
- Then entries from `firstKeptEntryId` to compaction
|
|
315
|
+
- Then entries after compaction
|
|
316
|
+
3. Preserves non-message entries in the selected range so interactive mode can render them
|
|
317
|
+
|
|
318
|
+
`buildSessionContext()` builds on that entry list to produce the message list for the LLM:
|
|
319
|
+
|
|
320
|
+
1. Extracts current model and thinking level settings from the full path
|
|
321
|
+
2. Converts selected entries to messages:
|
|
322
|
+
- `message` -> stored `AgentMessage`
|
|
323
|
+
- `compaction` -> `compactionSummary`
|
|
324
|
+
- `branch_summary` -> `branchSummary`
|
|
325
|
+
- `custom_message` -> `CustomMessage`
|
|
326
|
+
- `custom` -> no context message
|
|
318
327
|
|
|
319
328
|
## Parsing Example
|
|
320
329
|
|
|
@@ -401,6 +410,7 @@ Key methods for working with sessions programmatically.
|
|
|
401
410
|
- `branchWithSummary(entryId, summary, details?, fromHook?)` - Branch with context summary
|
|
402
411
|
|
|
403
412
|
### Instance Methods - Context & Info
|
|
413
|
+
- `buildContextEntries()` - Get active branch entries with compaction applied
|
|
404
414
|
- `buildSessionContext()` - Get messages, thinkingLevel, and model for LLM
|
|
405
415
|
- `getEntries()` - All entries (excluding header)
|
|
406
416
|
- `getHeader()` - Session header metadata
|
package/docs/settings.md
CHANGED
|
@@ -29,8 +29,9 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
29
29
|
|---------|------|---------|-------------|
|
|
30
30
|
| `defaultProvider` | string | - | Default provider (e.g., `"anthropic"`, `"openai"`) |
|
|
31
31
|
| `defaultModel` | string | - | Default model ID |
|
|
32
|
-
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
|
|
32
|
+
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
|
|
33
33
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
34
|
+
| `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses |
|
|
34
35
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |
|
|
35
36
|
|
|
36
37
|
#### thinkingBudgets
|
|
@@ -184,7 +185,7 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
184
185
|
|
|
185
186
|
| Setting | Type | Default | Description |
|
|
186
187
|
|---------|------|---------|-------------|
|
|
187
|
-
| `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows) |
|
|
188
|
+
| `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows); supports a leading `~` for the home directory |
|
|
188
189
|
| `shellCommandPrefix` | string | - | Prefix for every bash command (e.g., `"shopt -s expand_aliases"`) |
|
|
189
190
|
| `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
|
|
190
191
|
|
package/docs/themes.md
CHANGED
|
@@ -109,6 +109,7 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
109
109
|
"thinkingMedium": "#00ffff",
|
|
110
110
|
"thinkingHigh": "#ff00ff",
|
|
111
111
|
"thinkingXhigh": "#ff0000",
|
|
112
|
+
"thinkingMax": "#ff0088",
|
|
112
113
|
"bashMode": "#ffaa00"
|
|
113
114
|
}
|
|
114
115
|
}
|
|
@@ -139,13 +140,13 @@ vim ~/.pi/agent/themes/my-theme.json
|
|
|
139
140
|
|
|
140
141
|
- `name` is required, must be unique, and must not contain `/`.
|
|
141
142
|
- `vars` is optional. Define reusable colors here, then reference them in `colors`.
|
|
142
|
-
- `colors` must define all 51 required tokens.
|
|
143
|
+
- `colors` must define all 51 required tokens. `thinkingMax` is optional and falls back to `thinkingXhigh`.
|
|
143
144
|
|
|
144
145
|
The `$schema` field enables editor auto-completion and validation.
|
|
145
146
|
|
|
146
147
|
## Color Tokens
|
|
147
148
|
|
|
148
|
-
Every theme must define all 51 color tokens.
|
|
149
|
+
Every theme must define all 51 required color tokens. `thinkingMax` is optional for compatibility with existing themes; when omitted, it uses `thinkingXhigh`.
|
|
149
150
|
|
|
150
151
|
### Core UI (11 colors)
|
|
151
152
|
|
|
@@ -216,7 +217,7 @@ Every theme must define all 51 color tokens. There are no optional colors.
|
|
|
216
217
|
| `syntaxOperator` | Operators |
|
|
217
218
|
| `syntaxPunctuation` | Punctuation |
|
|
218
219
|
|
|
219
|
-
### Thinking Level Borders (6
|
|
220
|
+
### Thinking Level Borders (6 required, 1 optional)
|
|
220
221
|
|
|
221
222
|
Editor border colors indicating thinking level (visual hierarchy from subtle to prominent):
|
|
222
223
|
|
|
@@ -228,6 +229,7 @@ Editor border colors indicating thinking level (visual hierarchy from subtle to
|
|
|
228
229
|
| `thinkingMedium` | Medium thinking |
|
|
229
230
|
| `thinkingHigh` | High thinking |
|
|
230
231
|
| `thinkingXhigh` | Extra high thinking |
|
|
232
|
+
| `thinkingMax` | Maximum thinking; optional, falls back to `thinkingXhigh` |
|
|
231
233
|
|
|
232
234
|
### Bash Mode (1 color)
|
|
233
235
|
|
package/docs/tui.md
CHANGED
|
@@ -424,7 +424,7 @@ renderResult(result, options, theme, context) {
|
|
|
424
424
|
| Diffs | `toolDiffAdded`, `toolDiffRemoved`, `toolDiffContext` |
|
|
425
425
|
| Markdown | `mdHeading`, `mdLink`, `mdLinkUrl`, `mdCode`, `mdCodeBlock`, `mdCodeBlockBorder`, `mdQuote`, `mdQuoteBorder`, `mdHr`, `mdListBullet` |
|
|
426
426
|
| Syntax | `syntaxComment`, `syntaxKeyword`, `syntaxFunction`, `syntaxVariable`, `syntaxString`, `syntaxNumber`, `syntaxType`, `syntaxOperator`, `syntaxPunctuation` |
|
|
427
|
-
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
|
|
427
|
+
| Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh`, `thinkingMax` |
|
|
428
428
|
| Modes | `bashMode` |
|
|
429
429
|
|
|
430
430
|
**Background colors** (`theme.bg(color, text)`):
|
package/docs/usage.md
CHANGED
|
@@ -22,6 +22,7 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
|
|
|
22
22
|
| File reference | Type `@` to fuzzy-search project files |
|
|
23
23
|
| Path completion | Press Tab to complete paths |
|
|
24
24
|
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
|
+
| Copy response | Ctrl+X copies the last assistant message; in `/tree`, it copies the selected message |
|
|
25
26
|
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
26
27
|
| Shell command | `!command` runs and sends output to the model |
|
|
27
28
|
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
@@ -52,7 +53,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
52
53
|
| `/export [file]` | Export session to HTML or JSONL |
|
|
53
54
|
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
54
55
|
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
55
|
-
| `/reload` | Reload keybindings, extensions, skills, prompts, and context files |
|
|
56
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
56
57
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
57
58
|
| `/changelog` | Display version history |
|
|
58
59
|
| `/quit` | Quit pi |
|
|
@@ -183,7 +184,7 @@ cat README.md | pi -p "Summarize this text"
|
|
|
183
184
|
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
184
185
|
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
185
186
|
| `--api-key <key>` | API key, overriding environment variables |
|
|
186
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
187
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
187
188
|
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
188
189
|
| `--list-models [search]` | List available models |
|
|
189
190
|
|
|
@@ -112,6 +112,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
112
112
|
| Extension | Description |
|
|
113
113
|
|-----------|-------------|
|
|
114
114
|
| `message-renderer.ts` | Custom message rendering with colors and expandable details via `registerMessageRenderer` |
|
|
115
|
+
| `entry-renderer.ts` | TUI-only session entry rendering via `appendEntry` and `registerEntryRenderer` |
|
|
115
116
|
| `event-bus.ts` | Inter-extension communication via `pi.events` |
|
|
116
117
|
|
|
117
118
|
### Session Metadata
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom entry rendering example.
|
|
3
|
+
*
|
|
4
|
+
* Shows how to render durable extension data inside the chat without sending it
|
|
5
|
+
* to the LLM. Custom entries are stored in the session via pi.appendEntry() and
|
|
6
|
+
* rendered in interactive mode via pi.registerEntryRenderer().
|
|
7
|
+
*
|
|
8
|
+
* Usage: /status-card [message]
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
|
+
import { Box, Text } from "@earendil-works/pi-tui";
|
|
13
|
+
|
|
14
|
+
interface StatusCardData {
|
|
15
|
+
message: string;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function (pi: ExtensionAPI) {
|
|
20
|
+
pi.registerEntryRenderer<StatusCardData>("status-card", (entry, { expanded }, theme) => {
|
|
21
|
+
const data = entry.data ?? { message: "No data", timestamp: Date.now() };
|
|
22
|
+
const box = new Box(1, 1, (text) => theme.bg("customMessageBg", text));
|
|
23
|
+
box.addChild(new Text(`${theme.fg("accent", "[status]")} ${data.message}`, 0, 0));
|
|
24
|
+
|
|
25
|
+
if (expanded) {
|
|
26
|
+
box.addChild(new Text(theme.fg("dim", new Date(data.timestamp).toLocaleString()), 0, 0));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return box;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
pi.registerCommand("status-card", {
|
|
33
|
+
description: "Render a durable status card that is not sent to the LLM",
|
|
34
|
+
handler: async (args) => {
|
|
35
|
+
pi.appendEntry<StatusCardData>("status-card", {
|
|
36
|
+
message: args.trim() || "Status card",
|
|
37
|
+
timestamp: Date.now(),
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -52,7 +52,7 @@ interface Preset {
|
|
|
52
52
|
/** Model ID (e.g., "claude-sonnet-4-5") */
|
|
53
53
|
model?: string;
|
|
54
54
|
/** Thinking level */
|
|
55
|
-
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
55
|
+
thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
56
56
|
/** Tools to enable (replaces default set) */
|
|
57
57
|
tools?: string[];
|
|
58
58
|
/** Instructions to append to system prompt */
|
|
@@ -100,7 +100,7 @@ function loadPresets(cwd: string): PresetsConfig {
|
|
|
100
100
|
|
|
101
101
|
interface OriginalState {
|
|
102
102
|
model: Model<Api> | undefined;
|
|
103
|
-
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
103
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
104
104
|
tools: string[];
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -47,6 +47,7 @@ export default function question(pi: ExtensionAPI) {
|
|
|
47
47
|
label: "Question",
|
|
48
48
|
description: "Ask the user a question and let them pick from options. Use when you need user input to proceed.",
|
|
49
49
|
parameters: QuestionParams,
|
|
50
|
+
executionMode: "sequential",
|
|
50
51
|
|
|
51
52
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
52
53
|
if (ctx.mode !== "tui") {
|
|
@@ -12,7 +12,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
12
12
|
// Command entrypoint for reload.
|
|
13
13
|
// Treat reload as terminal for this handler.
|
|
14
14
|
pi.registerCommand("reload-runtime", {
|
|
15
|
-
description: "Reload extensions, skills, prompts, and
|
|
15
|
+
description: "Reload extensions, skills, prompts, themes, and context files",
|
|
16
16
|
handler: async (_args, ctx) => {
|
|
17
17
|
await ctx.reload();
|
|
18
18
|
return;
|
|
@@ -24,7 +24,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
24
24
|
pi.registerTool({
|
|
25
25
|
name: "reload_runtime",
|
|
26
26
|
label: "Reload Runtime",
|
|
27
|
-
description: "Reload extensions, skills, prompts, and
|
|
27
|
+
description: "Reload extensions, skills, prompts, themes, and context files",
|
|
28
28
|
parameters: Type.Object({}),
|
|
29
29
|
async execute() {
|
|
30
30
|
pi.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.10.
|
|
9
|
+
"version": "1.10.6",
|
|
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.80.
|
|
3
|
+
"version": "0.80.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.6",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -26,7 +26,7 @@ if (process.env.MY_ANTHROPIC_KEY) {
|
|
|
26
26
|
// Model registry with no custom models.json
|
|
27
27
|
const modelRegistry = ModelRegistry.inMemory(authStorage);
|
|
28
28
|
|
|
29
|
-
const model = getModel("anthropic", "claude-sonnet-4-
|
|
29
|
+
const model = getModel("anthropic", "claude-sonnet-4-5");
|
|
30
30
|
if (!model) throw new Error("Model not found");
|
|
31
31
|
|
|
32
32
|
// In-memory settings with overrides
|
package/examples/sdk/README.md
CHANGED
|
@@ -116,7 +116,7 @@ await session.prompt("Hello");
|
|
|
116
116
|
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
|
117
117
|
| `tools` | `["read", "bash", "edit", "write"]` built-ins | Allowlist tool names across built-in, extension, and custom tools |
|
|
118
118
|
| `customTools` | `[]` | Additional tool definitions |
|
|
119
|
-
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes |
|
|
119
|
+
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes, and context files |
|
|
120
120
|
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
|
121
121
|
| `settingsManager` | `SettingsManager.create(cwd, agentDir)` | Settings overrides |
|
|
122
122
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@averyyy/pi-coding-agent",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.6-piclient.10",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"./pi-client-cli": {
|
|
23
23
|
"import": "./dist/pi-client-cli.js"
|
|
24
|
+
},
|
|
25
|
+
"./pi-server-request": {
|
|
26
|
+
"types": "./dist/core/pi-server-request.d.ts",
|
|
27
|
+
"import": "./dist/core/pi-server-request.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"files": [
|
|
@@ -42,9 +46,9 @@
|
|
|
42
46
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
45
|
-
"@earendil-works/pi-agent-core": "npm:@averyyy/pi-agent-core@0.80.
|
|
46
|
-
"@earendil-works/pi-ai": "npm:@averyyy/pi-ai@0.80.
|
|
47
|
-
"@earendil-works/pi-tui": "npm:@averyyy/pi-tui@0.80.
|
|
49
|
+
"@earendil-works/pi-agent-core": "npm:@averyyy/pi-agent-core@0.80.6-piclient.10",
|
|
50
|
+
"@earendil-works/pi-ai": "npm:@averyyy/pi-ai@0.80.6-piclient.10",
|
|
51
|
+
"@earendil-works/pi-tui": "npm:@averyyy/pi-tui@0.80.6-piclient.10",
|
|
48
52
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
49
53
|
"chalk": "5.6.2",
|
|
50
54
|
"cross-spawn": "7.0.6",
|