@earendil-works/pi-coding-agent 0.77.0 → 0.78.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +5 -0
  3. package/dist/cli/args.d.ts +1 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +12 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/core/tools/edit.d.ts.map +1 -1
  8. package/dist/core/tools/edit.js +7 -10
  9. package/dist/core/tools/edit.js.map +1 -1
  10. package/dist/core/tools/find.d.ts.map +1 -1
  11. package/dist/core/tools/find.js.map +1 -1
  12. package/dist/core/tools/grep.d.ts.map +1 -1
  13. package/dist/core/tools/grep.js.map +1 -1
  14. package/dist/core/tools/ls.d.ts.map +1 -1
  15. package/dist/core/tools/ls.js +5 -7
  16. package/dist/core/tools/ls.js.map +1 -1
  17. package/dist/core/tools/read.d.ts.map +1 -1
  18. package/dist/core/tools/read.js +6 -7
  19. package/dist/core/tools/read.js.map +1 -1
  20. package/dist/core/tools/render-utils.d.ts +5 -2
  21. package/dist/core/tools/render-utils.d.ts.map +1 -1
  22. package/dist/core/tools/render-utils.js +17 -1
  23. package/dist/core/tools/render-utils.js.map +1 -1
  24. package/dist/core/tools/write.d.ts.map +1 -1
  25. package/dist/core/tools/write.js +5 -6
  26. package/dist/core/tools/write.js.map +1 -1
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/main.d.ts.map +1 -1
  32. package/dist/main.js +8 -0
  33. package/dist/main.js.map +1 -1
  34. package/dist/modes/interactive/interactive-mode.d.ts +3 -0
  35. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  36. package/dist/modes/interactive/interactive-mode.js +34 -0
  37. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  38. package/docs/quickstart.md +1 -0
  39. package/docs/rpc.md +2 -1
  40. package/docs/session-format.md +1 -1
  41. package/docs/sessions.md +8 -0
  42. package/docs/settings.md +1 -1
  43. package/docs/terminal-setup.md +2 -0
  44. package/docs/tui.md +2 -2
  45. package/docs/usage.md +5 -0
  46. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  47. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  48. package/examples/extensions/custom-provider-gitlab-duo/index.ts +53 -2
  49. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  50. package/examples/extensions/sandbox/package-lock.json +2 -2
  51. package/examples/extensions/sandbox/package.json +1 -1
  52. package/examples/extensions/with-deps/package-lock.json +2 -2
  53. package/examples/extensions/with-deps/package.json +1 -1
  54. package/npm-shrinkwrap.json +12 -12
  55. package/package.json +4 -4
@@ -136,6 +136,7 @@ Sessions are saved automatically:
136
136
  ```bash
137
137
  pi -c # Continue most recent session
138
138
  pi -r # Browse previous sessions
139
+ pi --name "my task" # Set session display name at startup
139
140
  pi --session <path|id> # Open a specific session
140
141
  ```
141
142
 
package/docs/rpc.md CHANGED
@@ -13,6 +13,7 @@ pi --mode rpc [options]
13
13
  Common options:
14
14
  - `--provider <name>`: Set the LLM provider (anthropic, openai, google, etc.)
15
15
  - `--model <pattern>`: Model pattern or ID (supports `provider/id` and optional `:<thinking>`)
16
+ - `--name <name>` / `-n <name>`: Set the session display name at startup
16
17
  - `--no-session`: Disable session persistence
17
18
  - `--session-dir <path>`: Custom session storage directory
18
19
 
@@ -694,7 +695,7 @@ Response:
694
695
  }
695
696
  ```
696
697
 
697
- The current session name is available via `get_state` in the `sessionName` field.
698
+ The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `pi --mode rpc` process.
698
699
 
699
700
  ### Commands
700
701
 
@@ -282,7 +282,7 @@ Set `label` to `undefined` to clear a label.
282
282
 
283
283
  ### SessionInfoEntry
284
284
 
285
- Session metadata (e.g., user-defined display name). Set via `/name` command or `pi.setSessionName()` in extensions.
285
+ Session metadata (e.g., user-defined display name). Set via `/name`, `--name` / `-n`, or `pi.setSessionName()` in extensions.
286
286
 
287
287
  ```json
288
288
  {"type":"session_info","id":"k1l2m3n4","parentId":"j0k1l2m3","timestamp":"2024-12-03T14:35:00.000Z","name":"Refactor auth module"}
package/docs/sessions.md CHANGED
@@ -10,6 +10,7 @@ Sessions auto-save to `~/.pi/agent/sessions/`, organized by working directory. E
10
10
  pi -c # Continue most recent session
11
11
  pi -r # Browse and select from past sessions
12
12
  pi --no-session # Ephemeral mode; do not save
13
+ pi --name "my task" # Set session display name at startup
13
14
  pi --session <path|id> # Use a specific session file or partial session ID
14
15
  pi --fork <path|id> # Fork a session file or partial session ID into a new session
15
16
  ```
@@ -56,6 +57,13 @@ Use `/name <name>` to set a human-readable session name:
56
57
  /name Refactor auth module
57
58
  ```
58
59
 
60
+ Set the name at startup with `--name` or `-n`:
61
+
62
+ ```bash
63
+ pi --name "Refactor auth module"
64
+ pi --name "CI audit" -p "Review this build failure"
65
+ ```
66
+
59
67
  Named sessions are easier to find in `/resume` and `pi -r`.
60
68
 
61
69
  ## Branching with `/tree`
package/docs/settings.md CHANGED
@@ -46,7 +46,7 @@ Edit directly or use `/settings` for common options.
46
46
  | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
47
47
  | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
48
48
  | `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
49
- | `showHardwareCursor` | boolean | `false` | Show terminal cursor |
49
+ | `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
50
50
 
51
51
  ### Telemetry and update checks
52
52
 
@@ -49,6 +49,8 @@ config.enable_kitty_keyboard = true
49
49
  return config
50
50
  ```
51
51
 
52
+ On WSL, WezTerm may require a visible hardware cursor for IME candidate window positioning. If CJK IME candidates do not follow the text cursor, set `PI_HARDWARE_CURSOR=1` before running pi or set `showHardwareCursor` to `true` in settings.
53
+
52
54
  ## VS Code (Integrated Terminal)
53
55
 
54
56
  `keybindings.json` locations:
package/docs/tui.md CHANGED
@@ -50,9 +50,9 @@ When a `Focusable` component has focus, TUI:
50
50
  1. Sets `focused = true` on the component
51
51
  2. Scans rendered output for `CURSOR_MARKER` (a zero-width APC escape sequence)
52
52
  3. Positions the hardware terminal cursor at that location
53
- 4. Shows the hardware cursor
53
+ 4. Shows the hardware cursor only when `showHardwareCursor` is enabled
54
54
 
55
- This enables IME candidate windows to appear at the correct position for CJK input methods. The `Editor` and `Input` built-in components already implement this interface.
55
+ The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with `showHardwareCursor`, `setShowHardwareCursor(true)`, or `PI_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
56
56
 
57
57
  ### Container Components with Embedded Inputs
58
58
 
package/docs/usage.md CHANGED
@@ -76,6 +76,7 @@ Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by workin
76
76
  pi -c # Continue most recent session
77
77
  pi -r # Browse and select a session
78
78
  pi --no-session # Ephemeral mode; do not save
79
+ pi --name "my task" # Set session display name at startup
79
80
  pi --session <path|id> # Use a specific session file or session ID
80
81
  pi --fork <path|id> # Fork a session into a new session file
81
82
  ```
@@ -178,6 +179,7 @@ cat README.md | pi -p "Summarize this text"
178
179
  | `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
179
180
  | `--session-dir <dir>` | Custom session storage directory |
180
181
  | `--no-session` | Ephemeral mode; do not save |
182
+ | `--name <name>`, `-n <name>` | Set session display name at startup |
181
183
 
182
184
  ### Tool Options
183
185
 
@@ -242,6 +244,9 @@ pi -p "Summarize this codebase"
242
244
  # Non-interactive with piped stdin
243
245
  cat README.md | pi -p "Summarize this text"
244
246
 
247
+ # Named one-shot session
248
+ pi --name "release audit" -p "Audit this repository"
249
+
245
250
  # Different model
246
251
  pi --provider openai --model gpt-4o "Help me refactor"
247
252
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.77.0",
9
+ "version": "0.78.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.77.0",
4
+ "version": "0.78.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -20,6 +20,7 @@ import {
20
20
  type SimpleStreamOptions,
21
21
  streamSimpleAnthropic,
22
22
  streamSimpleOpenAIResponses,
23
+ type ThinkingLevelMap,
23
24
  } from "@earendil-works/pi-ai";
24
25
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
25
26
 
@@ -49,6 +50,7 @@ interface GitLabModel {
49
50
  backend: Backend;
50
51
  baseUrl: string;
51
52
  reasoning: boolean;
53
+ thinkingLevelMap?: ThinkingLevelMap;
52
54
  input: ("text" | "image")[];
53
55
  cost: { input: number; output: number; cacheRead: number; cacheWrite: number };
54
56
  contextWindow: number;
@@ -57,12 +59,37 @@ interface GitLabModel {
57
59
 
58
60
  export const MODELS: GitLabModel[] = [
59
61
  // Anthropic
62
+ {
63
+ id: "claude-opus-4-8",
64
+ name: "Claude Opus 4.8",
65
+ backend: "anthropic",
66
+ baseUrl: ANTHROPIC_PROXY_URL,
67
+ reasoning: true,
68
+ thinkingLevelMap: { xhigh: "max" },
69
+ input: ["text", "image"],
70
+ cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
71
+ contextWindow: 1000000,
72
+ maxTokens: 128000,
73
+ },
74
+ {
75
+ id: "claude-sonnet-4-6",
76
+ name: "Claude Sonnet 4.6",
77
+ backend: "anthropic",
78
+ baseUrl: ANTHROPIC_PROXY_URL,
79
+ reasoning: true,
80
+ thinkingLevelMap: { xhigh: "max" },
81
+ input: ["text", "image"],
82
+ cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
83
+ contextWindow: 1000000,
84
+ maxTokens: 64000,
85
+ },
60
86
  {
61
87
  id: "claude-opus-4-5-20251101",
62
88
  name: "Claude Opus 4.5",
63
89
  backend: "anthropic",
64
90
  baseUrl: ANTHROPIC_PROXY_URL,
65
91
  reasoning: true,
92
+ thinkingLevelMap: { xhigh: "max" },
66
93
  input: ["text", "image"],
67
94
  cost: { input: 15, output: 75, cacheRead: 1.5, cacheWrite: 18.75 },
68
95
  contextWindow: 200000,
@@ -74,6 +101,7 @@ export const MODELS: GitLabModel[] = [
74
101
  backend: "anthropic",
75
102
  baseUrl: ANTHROPIC_PROXY_URL,
76
103
  reasoning: true,
104
+ thinkingLevelMap: { xhigh: "max" },
77
105
  input: ["text", "image"],
78
106
  cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
79
107
  contextWindow: 200000,
@@ -85,12 +113,24 @@ export const MODELS: GitLabModel[] = [
85
113
  backend: "anthropic",
86
114
  baseUrl: ANTHROPIC_PROXY_URL,
87
115
  reasoning: true,
116
+ thinkingLevelMap: { xhigh: "max" },
88
117
  input: ["text", "image"],
89
118
  cost: { input: 1, output: 5, cacheRead: 0.1, cacheWrite: 1.25 },
90
119
  contextWindow: 200000,
91
120
  maxTokens: 8192,
92
121
  },
93
122
  // OpenAI (all use Responses API)
123
+ {
124
+ id: "gpt-5.5-2026-04-23",
125
+ name: "GPT-5.5",
126
+ backend: "openai",
127
+ baseUrl: OPENAI_PROXY_URL,
128
+ reasoning: true,
129
+ input: ["text", "image"],
130
+ cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
131
+ contextWindow: 272000,
132
+ maxTokens: 128000,
133
+ },
94
134
  {
95
135
  id: "gpt-5.1-2025-11-13",
96
136
  name: "GPT-5.1",
@@ -285,7 +325,17 @@ export function streamGitLabDuo(
285
325
 
286
326
  const innerStream =
287
327
  cfg.backend === "anthropic"
288
- ? streamSimpleAnthropic(modelWithBaseUrl as Model<"anthropic-messages">, context, streamOptions)
328
+ ? streamSimpleAnthropic(
329
+ {
330
+ ...(modelWithBaseUrl as Model<"anthropic-messages">),
331
+ compat: {
332
+ ...(modelWithBaseUrl as Model<"anthropic-messages">).compat,
333
+ forceAdaptiveThinking: true,
334
+ },
335
+ },
336
+ context,
337
+ streamOptions,
338
+ )
289
339
  : streamSimpleOpenAIResponses(modelWithBaseUrl as Model<"openai-responses">, context, streamOptions);
290
340
 
291
341
  for await (const event of innerStream) stream.push(event);
@@ -329,10 +379,11 @@ export default function (pi: ExtensionAPI) {
329
379
  baseUrl: AI_GATEWAY_URL,
330
380
  apiKey: "$GITLAB_TOKEN",
331
381
  api: "gitlab-duo-api",
332
- models: MODELS.map(({ id, name, reasoning, input, cost, contextWindow, maxTokens }) => ({
382
+ models: MODELS.map(({ id, name, reasoning, thinkingLevelMap, input, cost, contextWindow, maxTokens }) => ({
333
383
  id,
334
384
  name,
335
385
  reasoning,
386
+ thinkingLevelMap,
336
387
  input,
337
388
  cost,
338
389
  contextWindow,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.77.0",
4
+ "version": "0.78.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "1.7.0",
9
+ "version": "1.8.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "1.7.0",
4
+ "version": "1.8.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.77.0",
9
+ "version": "0.78.0",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.77.0",
4
+ "version": "0.78.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@earendil-works/pi-coding-agent",
9
- "version": "0.77.0",
9
+ "version": "0.78.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@earendil-works/pi-agent-core": "^0.77.0",
13
- "@earendil-works/pi-ai": "^0.77.0",
14
- "@earendil-works/pi-tui": "^0.77.0",
12
+ "@earendil-works/pi-agent-core": "^0.78.0",
13
+ "@earendil-works/pi-ai": "^0.78.0",
14
+ "@earendil-works/pi-tui": "^0.78.0",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
17
17
  "cross-spawn": "7.0.6",
@@ -473,11 +473,11 @@
473
473
  }
474
474
  },
475
475
  "node_modules/@earendil-works/pi-agent-core": {
476
- "version": "0.77.0",
477
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.77.0.tgz",
476
+ "version": "0.78.0",
477
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.78.0.tgz",
478
478
  "license": "MIT",
479
479
  "dependencies": {
480
- "@earendil-works/pi-ai": "^0.77.0",
480
+ "@earendil-works/pi-ai": "^0.78.0",
481
481
  "ignore": "7.0.5",
482
482
  "typebox": "1.1.38",
483
483
  "yaml": "2.9.0"
@@ -487,8 +487,8 @@
487
487
  }
488
488
  },
489
489
  "node_modules/@earendil-works/pi-ai": {
490
- "version": "0.77.0",
491
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.77.0.tgz",
490
+ "version": "0.78.0",
491
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.78.0.tgz",
492
492
  "license": "MIT",
493
493
  "dependencies": {
494
494
  "@anthropic-ai/sdk": "0.91.1",
@@ -510,8 +510,8 @@
510
510
  }
511
511
  },
512
512
  "node_modules/@earendil-works/pi-tui": {
513
- "version": "0.77.0",
514
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.77.0.tgz",
513
+ "version": "0.78.0",
514
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.78.0.tgz",
515
515
  "license": "MIT",
516
516
  "dependencies": {
517
517
  "get-east-asian-width": "1.6.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -39,9 +39,9 @@
39
39
  "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
40
40
  },
41
41
  "dependencies": {
42
- "@earendil-works/pi-agent-core": "^0.77.0",
43
- "@earendil-works/pi-ai": "^0.77.0",
44
- "@earendil-works/pi-tui": "^0.77.0",
42
+ "@earendil-works/pi-agent-core": "^0.78.0",
43
+ "@earendil-works/pi-ai": "^0.78.0",
44
+ "@earendil-works/pi-tui": "^0.78.0",
45
45
  "@silvia-odwyer/photon-node": "0.3.4",
46
46
  "chalk": "5.6.2",
47
47
  "cross-spawn": "7.0.6",