@astralyn/pi 0.81.1-2 → 0.82.1

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 (191) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +14 -1
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +1 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/config-selector.d.ts.map +1 -1
  7. package/dist/cli/config-selector.js +1 -1
  8. package/dist/cli/config-selector.js.map +1 -1
  9. package/dist/cli/startup-ui.d.ts.map +1 -1
  10. package/dist/cli/startup-ui.js +1 -1
  11. package/dist/cli/startup-ui.js.map +1 -1
  12. package/dist/core/agent-session.d.ts +11 -0
  13. package/dist/core/agent-session.d.ts.map +1 -1
  14. package/dist/core/agent-session.js +7 -8
  15. package/dist/core/agent-session.js.map +1 -1
  16. package/dist/core/bash-executor.d.ts.map +1 -1
  17. package/dist/core/bash-executor.js +22 -4
  18. package/dist/core/bash-executor.js.map +1 -1
  19. package/dist/core/compaction/compaction.d.ts.map +1 -1
  20. package/dist/core/compaction/compaction.js +11 -3
  21. package/dist/core/compaction/compaction.js.map +1 -1
  22. package/dist/core/extensions/runner.d.ts.map +1 -1
  23. package/dist/core/extensions/runner.js +4 -0
  24. package/dist/core/extensions/runner.js.map +1 -1
  25. package/dist/core/extensions/types.d.ts +9 -1
  26. package/dist/core/extensions/types.d.ts.map +1 -1
  27. package/dist/core/extensions/types.js.map +1 -1
  28. package/dist/core/model-config.d.ts +30 -0
  29. package/dist/core/model-config.d.ts.map +1 -1
  30. package/dist/core/model-config.js +6 -0
  31. package/dist/core/model-config.js.map +1 -1
  32. package/dist/core/model-registry.d.ts.map +1 -1
  33. package/dist/core/model-registry.js +2 -2
  34. package/dist/core/model-registry.js.map +1 -1
  35. package/dist/core/model-resolver.d.ts.map +1 -1
  36. package/dist/core/model-resolver.js +7 -0
  37. package/dist/core/model-resolver.js.map +1 -1
  38. package/dist/core/model-runtime.d.ts +0 -1
  39. package/dist/core/model-runtime.d.ts.map +1 -1
  40. package/dist/core/model-runtime.js +3 -5
  41. package/dist/core/model-runtime.js.map +1 -1
  42. package/dist/core/remote-catalog-provider.d.ts +1 -1
  43. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  44. package/dist/core/remote-catalog-provider.js +5 -10
  45. package/dist/core/remote-catalog-provider.js.map +1 -1
  46. package/dist/core/settings-manager.d.ts +1 -1
  47. package/dist/core/settings-manager.d.ts.map +1 -1
  48. package/dist/core/settings-manager.js.map +1 -1
  49. package/dist/core/system-prompt.d.ts.map +1 -1
  50. package/dist/core/system-prompt.js +1 -1
  51. package/dist/core/system-prompt.js.map +1 -1
  52. package/dist/core/tools/bash.d.ts +2 -1
  53. package/dist/core/tools/bash.d.ts.map +1 -1
  54. package/dist/core/tools/bash.js +49 -48
  55. package/dist/core/tools/bash.js.map +1 -1
  56. package/dist/core/tools/find.d.ts.map +1 -1
  57. package/dist/core/tools/find.js +1 -0
  58. package/dist/core/tools/find.js.map +1 -1
  59. package/dist/core/tools/output-accumulator.d.ts +13 -3
  60. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  61. package/dist/core/tools/output-accumulator.js +36 -6
  62. package/dist/core/tools/output-accumulator.js.map +1 -1
  63. package/dist/core/tools/read.d.ts.map +1 -1
  64. package/dist/core/tools/read.js +4 -3
  65. package/dist/core/tools/read.js.map +1 -1
  66. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  67. package/dist/core/tools/tool-definition-wrapper.js +5 -1
  68. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  69. package/dist/extensions/index.d.ts.map +1 -1
  70. package/dist/extensions/index.js +2 -0
  71. package/dist/extensions/index.js.map +1 -1
  72. package/dist/extensions/llama/provider.d.ts.map +1 -1
  73. package/dist/extensions/llama/provider.js +1 -2
  74. package/dist/extensions/llama/provider.js.map +1 -1
  75. package/dist/extensions/subagent/activity.d.ts +16 -0
  76. package/dist/extensions/subagent/activity.d.ts.map +1 -0
  77. package/dist/extensions/subagent/activity.js +150 -0
  78. package/dist/extensions/subagent/activity.js.map +1 -0
  79. package/dist/extensions/subagent/agents.d.ts +7 -0
  80. package/dist/extensions/subagent/agents.d.ts.map +1 -0
  81. package/dist/extensions/subagent/agents.js +218 -0
  82. package/dist/extensions/subagent/agents.js.map +1 -0
  83. package/dist/extensions/subagent/constants.d.ts +22 -0
  84. package/dist/extensions/subagent/constants.d.ts.map +1 -0
  85. package/dist/extensions/subagent/constants.js +32 -0
  86. package/dist/extensions/subagent/constants.js.map +1 -0
  87. package/dist/extensions/subagent/index.d.ts +3 -0
  88. package/dist/extensions/subagent/index.d.ts.map +1 -0
  89. package/dist/extensions/subagent/index.js +249 -0
  90. package/dist/extensions/subagent/index.js.map +1 -0
  91. package/dist/extensions/subagent/picker.d.ts +31 -0
  92. package/dist/extensions/subagent/picker.d.ts.map +1 -0
  93. package/dist/extensions/subagent/picker.js +116 -0
  94. package/dist/extensions/subagent/picker.js.map +1 -0
  95. package/dist/extensions/subagent/render.d.ts +8 -0
  96. package/dist/extensions/subagent/render.d.ts.map +1 -0
  97. package/dist/extensions/subagent/render.js +322 -0
  98. package/dist/extensions/subagent/render.js.map +1 -0
  99. package/dist/extensions/subagent/resolve.d.ts +16 -0
  100. package/dist/extensions/subagent/resolve.d.ts.map +1 -0
  101. package/dist/extensions/subagent/resolve.js +103 -0
  102. package/dist/extensions/subagent/resolve.js.map +1 -0
  103. package/dist/extensions/subagent/runner.d.ts +30 -0
  104. package/dist/extensions/subagent/runner.d.ts.map +1 -0
  105. package/dist/extensions/subagent/runner.js +355 -0
  106. package/dist/extensions/subagent/runner.js.map +1 -0
  107. package/dist/extensions/subagent/schema.d.ts +28 -0
  108. package/dist/extensions/subagent/schema.d.ts.map +1 -0
  109. package/dist/extensions/subagent/schema.js +33 -0
  110. package/dist/extensions/subagent/schema.js.map +1 -0
  111. package/dist/extensions/subagent/sdk-runner.d.ts +14 -0
  112. package/dist/extensions/subagent/sdk-runner.d.ts.map +1 -0
  113. package/dist/extensions/subagent/sdk-runner.js +210 -0
  114. package/dist/extensions/subagent/sdk-runner.js.map +1 -0
  115. package/dist/extensions/subagent/settings.d.ts +9 -0
  116. package/dist/extensions/subagent/settings.d.ts.map +1 -0
  117. package/dist/extensions/subagent/settings.js +131 -0
  118. package/dist/extensions/subagent/settings.js.map +1 -0
  119. package/dist/extensions/subagent/types.d.ts +99 -0
  120. package/dist/extensions/subagent/types.d.ts.map +1 -0
  121. package/dist/extensions/subagent/types.js +2 -0
  122. package/dist/extensions/subagent/types.js.map +1 -0
  123. package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
  124. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  125. package/dist/modes/interactive/components/extension-editor.js +16 -46
  126. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  127. package/dist/modes/interactive/components/index.d.ts +1 -0
  128. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  129. package/dist/modes/interactive/components/index.js +1 -0
  130. package/dist/modes/interactive/components/index.js.map +1 -1
  131. package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
  132. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  133. package/dist/modes/interactive/components/tool-execution.js +25 -4
  134. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  135. package/dist/modes/interactive/components/tool-group.d.ts +16 -0
  136. package/dist/modes/interactive/components/tool-group.d.ts.map +1 -0
  137. package/dist/modes/interactive/components/tool-group.js +64 -0
  138. package/dist/modes/interactive/components/tool-group.js.map +1 -0
  139. package/dist/modes/interactive/external-editor.d.ts +12 -0
  140. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  141. package/dist/modes/interactive/external-editor.js +37 -0
  142. package/dist/modes/interactive/external-editor.js.map +1 -0
  143. package/dist/modes/interactive/interactive-mode.d.ts +3 -1
  144. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  145. package/dist/modes/interactive/interactive-mode.js +61 -62
  146. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  147. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  148. package/dist/modes/rpc/rpc-mode.js +1 -0
  149. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  150. package/dist/utils/clipboard.d.ts.map +1 -1
  151. package/dist/utils/clipboard.js +19 -8
  152. package/dist/utils/clipboard.js.map +1 -1
  153. package/dist/utils/output-decoder.d.ts +52 -0
  154. package/dist/utils/output-decoder.d.ts.map +1 -0
  155. package/dist/utils/output-decoder.js +134 -0
  156. package/dist/utils/output-decoder.js.map +1 -0
  157. package/dist/utils/shell.d.ts +1 -0
  158. package/dist/utils/shell.d.ts.map +1 -1
  159. package/dist/utils/shell.js +21 -0
  160. package/dist/utils/shell.js.map +1 -1
  161. package/dist/utils/version-check.d.ts.map +1 -1
  162. package/dist/utils/version-check.js +3 -1
  163. package/dist/utils/version-check.js.map +1 -1
  164. package/docs/compaction.md +1 -1
  165. package/docs/custom-provider.md +5 -2
  166. package/docs/environment-variables.md +88 -0
  167. package/docs/extensions.md +11 -3
  168. package/docs/index.md +4 -1
  169. package/docs/models.md +6 -2
  170. package/docs/providers.md +8 -1
  171. package/docs/rpc.md +23 -6
  172. package/docs/settings.md +1 -1
  173. package/docs/usage.md +0 -13
  174. package/examples/extensions/custom-compaction.ts +3 -0
  175. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  176. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  177. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  178. package/examples/extensions/gondolin/package-lock.json +2 -2
  179. package/examples/extensions/gondolin/package.json +1 -1
  180. package/examples/extensions/handoff.ts +9 -1
  181. package/examples/extensions/sandbox/package-lock.json +2 -2
  182. package/examples/extensions/sandbox/package.json +1 -1
  183. package/examples/extensions/summarize.ts +3 -0
  184. package/examples/extensions/with-deps/package-lock.json +2 -2
  185. package/examples/extensions/with-deps/package.json +1 -1
  186. package/npm-shrinkwrap.json +16 -15
  187. package/package.json +5 -4
  188. package/dist/core/tools/bash-command-summary.d.ts +0 -7
  189. package/dist/core/tools/bash-command-summary.d.ts.map +0 -1
  190. package/dist/core/tools/bash-command-summary.js +0 -261
  191. package/dist/core/tools/bash-command-summary.js.map +0 -1
package/docs/rpc.md CHANGED
@@ -23,7 +23,7 @@ Common options:
23
23
  - **Responses**: JSON objects with `type: "response"` indicating command success/failure
24
24
  - **Events**: Agent events streamed to stdout as JSON lines
25
25
 
26
- All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`.
26
+ All commands support an optional `id` field for request/response correlation. If provided, the corresponding response will include the same `id`. `bash_execution_update` events also include the `id` of their originating `bash` command.
27
27
 
28
28
  ### Framing
29
29
 
@@ -455,15 +455,18 @@ Response:
455
455
 
456
456
  #### bash
457
457
 
458
- Execute a shell command and add output to conversation context.
458
+ Execute a shell command and add output to conversation context. Output streams as `bash_execution_update` events while the command runs; the response contains the final result.
459
459
 
460
460
  ```json
461
- {"type": "bash", "command": "ls -la"}
461
+ {"id": "req-1", "type": "bash", "command": "ls -la"}
462
462
  ```
463
463
 
464
+ Include an `id` to associate streamed `bash_execution_update` events with this command.
465
+
464
466
  Response:
465
467
  ```json
466
468
  {
469
+ "id": "req-1",
467
470
  "type": "response",
468
471
  "command": "bash",
469
472
  "success": true,
@@ -494,7 +497,7 @@ If output was truncated, includes `fullOutputPath`:
494
497
 
495
498
  **How bash results reach the LLM:**
496
499
 
497
- The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state. This message does NOT emit an event.
500
+ The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
498
501
 
499
502
  When the next `prompt` command is sent, all messages (including `BashExecutionMessage`) are transformed before being sent to the LLM. The `BashExecutionMessage` is converted to a `UserMessage` with this format:
500
503
 
@@ -509,7 +512,6 @@ drwxr-xr-x ...
509
512
  This means:
510
513
  1. Bash output is included in the LLM context on the **next prompt**, not immediately
511
514
  2. Multiple bash commands can be executed before a prompt; all outputs will be included
512
- 3. No event is emitted for the `BashExecutionMessage` itself
513
515
 
514
516
  #### abort_bash
515
517
 
@@ -829,7 +831,7 @@ Each command has:
829
831
 
830
832
  ## Events
831
833
 
832
- Events are streamed to stdout as JSON lines during agent operation. Events do NOT include an `id` field (only responses do).
834
+ Events are streamed to stdout as JSON lines during agent operation. Events do not generally include an `id` field; `bash_execution_update` includes the `id` of its originating `bash` command when one was provided.
833
835
 
834
836
  ### Event Types
835
837
 
@@ -843,6 +845,7 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
843
845
  | `message_start` | Message begins |
844
846
  | `message_update` | Streaming update (text/thinking/toolcall deltas) |
845
847
  | `message_end` | Message completes |
848
+ | `bash_execution_update` | Direct RPC bash command output chunk |
846
849
  | `tool_execution_start` | Tool begins execution |
847
850
  | `tool_execution_update` | Tool execution progress (streaming output) |
848
851
  | `tool_execution_end` | Tool completes |
@@ -951,6 +954,20 @@ Example streaming a text response:
951
954
  {"type":"message_update","message":{...},"assistantMessageEvent":{"type":"text_end","contentIndex":0,"content":"Hello world","partial":{...}}}
952
955
  ```
953
956
 
957
+ ### bash_execution_update
958
+
959
+ Emitted once for each output chunk from a direct `bash` command. `id` matches the command's `id`, allowing clients to associate output with the correct command.
960
+
961
+ Events stream all output while the command runs, even if the final `bash` response's `output` is truncated.
962
+
963
+ ```json
964
+ {
965
+ "type": "bash_execution_update",
966
+ "id": "req-1",
967
+ "delta": "total 48\n"
968
+ }
969
+ ```
970
+
954
971
  ### tool_execution_start / tool_execution_update / tool_execution_end
955
972
 
956
973
  Emitted when a tool begins, streams progress, and completes execution.
package/docs/settings.md CHANGED
@@ -142,7 +142,7 @@ Version checks read the latest `@astralyn/pi` version from npm. Set `PI_SKIP_VER
142
142
  | `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
143
143
  | `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
144
144
 
145
- When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs` (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Set to `0` to disable the cap.
145
+ When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs`, the request fails immediately with an informative error instead of waiting silently. Set it to `0` to disable the limit.
146
146
 
147
147
  Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explicitly needed. Setting it above `0` can make SDK/provider retries handle out-of-usage-limit errors before Pi sees them, which may block the agent until the provider quota resets in some circumstances.
148
148
 
package/docs/usage.md CHANGED
@@ -289,19 +289,6 @@ pi --tools read,grep,find,ls -p "Review the code"
289
289
  pi --exclude-tools ask_question
290
290
  ```
291
291
 
292
- ### Environment Variables
293
-
294
- | Variable | Description |
295
- |----------|-------------|
296
- | `PI_CODING_AGENT_DIR` | Override config directory; default is `~/.pi/agent` |
297
- | `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
298
- | `PI_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
299
- | `PI_OFFLINE` | Disable startup network operations, including npm version checks, package update checks, and model refresh |
300
- | `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the npm registry latest-version request |
301
- | `PI_TELEMETRY` | Override optional provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable version checks |
302
- | `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache where supported |
303
- | `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
304
-
305
292
  ## Design Principles
306
293
 
307
294
  Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
@@ -15,6 +15,7 @@
15
15
 
16
16
  import type { ExtensionAPI } from "@astralyn/pi";
17
17
  import { convertToLlm, serializeConversation } from "@astralyn/pi";
18
+ import { uuidv7 } from "@earendil-works/pi-ai";
18
19
  import { complete } from "@earendil-works/pi-ai/compat";
19
20
 
20
21
  export default function (pi: ExtensionAPI) {
@@ -96,6 +97,8 @@ ${conversationText}
96
97
  env: auth.env,
97
98
  maxTokens: 8192,
98
99
  signal,
100
+ cacheRetention: "none",
101
+ sessionId: uuidv7(),
99
102
  },
100
103
  );
101
104
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.81.1",
3
+ "version": "0.82.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.81.1",
9
+ "version": "0.82.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.81.1",
4
+ "version": "0.82.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.81.1",
4
+ "version": "0.82.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-gondolin",
3
- "version": "0.81.1",
3
+ "version": "0.82.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.81.1",
9
+ "version": "0.82.0",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.81.1",
4
+ "version": "0.82.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -15,6 +15,7 @@
15
15
  import type { ExtensionAPI, SessionEntry } from "@astralyn/pi";
16
16
  import { BorderedLoader, convertToLlm, serializeConversation } from "@astralyn/pi";
17
17
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
18
+ import { uuidv7 } from "@earendil-works/pi-ai";
18
19
  import { complete, type Message } from "@earendil-works/pi-ai/compat";
19
20
 
20
21
  const SYSTEM_PROMPT = `You are a context transfer assistant. Given a conversation history and the user's goal for a new thread, generate a focused prompt that:
@@ -136,7 +137,14 @@ export default function (pi: ExtensionAPI) {
136
137
  const response = await complete(
137
138
  ctx.model!,
138
139
  { systemPrompt: SYSTEM_PROMPT, messages: [userMessage] },
139
- { apiKey: auth.apiKey, headers: auth.headers, env: auth.env, signal: loader.signal },
140
+ {
141
+ apiKey: auth.apiKey,
142
+ headers: auth.headers,
143
+ env: auth.env,
144
+ signal: loader.signal,
145
+ cacheRetention: "none",
146
+ sessionId: uuidv7(),
147
+ },
140
148
  );
141
149
 
142
150
  if (response.stopReason === "aborted") {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "1.11.1",
9
+ "version": "1.12.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.11.1",
4
+ "version": "1.12.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,5 +1,6 @@
1
1
  import type { ExtensionAPI, ExtensionCommandContext } from "@astralyn/pi";
2
2
  import { DynamicBorder, getMarkdownTheme } from "@astralyn/pi";
3
+ import { uuidv7 } from "@earendil-works/pi-ai";
3
4
  import { complete, getModel } from "@earendil-works/pi-ai/compat";
4
5
  import { Container, Markdown, matchesKey, Text } from "@earendil-works/pi-tui";
5
6
 
@@ -193,6 +194,8 @@ export default function (pi: ExtensionAPI) {
193
194
  headers: auth.headers,
194
195
  env: auth.env,
195
196
  reasoningEffort: "high",
197
+ cacheRetention: "none",
198
+ sessionId: uuidv7(),
196
199
  },
197
200
  );
198
201
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.81.1",
3
+ "version": "0.82.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.81.1",
9
+ "version": "0.82.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.81.1",
4
+ "version": "0.82.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@astralyn/pi",
3
- "version": "0.81.1-2",
3
+ "version": "0.82.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@astralyn/pi",
9
- "version": "0.81.1-2",
9
+ "version": "0.82.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@earendil-works/pi-agent-core": "^0.81.1",
13
- "@earendil-works/pi-ai": "^0.81.1",
14
- "@earendil-works/pi-tui": "^0.81.1",
12
+ "@earendil-works/pi-agent-core": "^0.82.0",
13
+ "@earendil-works/pi-ai": "^0.82.0",
14
+ "@earendil-works/pi-tui": "^0.82.0",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
17
17
  "cross-spawn": "7.0.6",
@@ -474,11 +474,12 @@
474
474
  }
475
475
  },
476
476
  "node_modules/@earendil-works/pi-agent-core": {
477
- "version": "0.81.1",
478
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.81.1.tgz",
477
+ "version": "0.82.0",
478
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.82.0.tgz",
479
479
  "license": "MIT",
480
480
  "dependencies": {
481
- "@earendil-works/pi-ai": "^0.81.1",
481
+ "@earendil-works/pi-ai": "^0.82.0",
482
+ "diff": "8.0.4",
482
483
  "ignore": "7.0.5",
483
484
  "typebox": "1.1.38",
484
485
  "yaml": "2.9.0"
@@ -488,8 +489,8 @@
488
489
  }
489
490
  },
490
491
  "node_modules/@earendil-works/pi-ai": {
491
- "version": "0.81.1",
492
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.81.1.tgz",
492
+ "version": "0.82.0",
493
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.82.0.tgz",
493
494
  "license": "MIT",
494
495
  "dependencies": {
495
496
  "@anthropic-ai/sdk": "0.91.1",
@@ -512,8 +513,8 @@
512
513
  }
513
514
  },
514
515
  "node_modules/@earendil-works/pi-tui": {
515
- "version": "0.81.1",
516
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.81.1.tgz",
516
+ "version": "0.82.0",
517
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.82.0.tgz",
517
518
  "license": "MIT",
518
519
  "dependencies": {
519
520
  "get-east-asian-width": "1.6.0",
@@ -1592,9 +1593,9 @@
1592
1593
  }
1593
1594
  },
1594
1595
  "node_modules/protobufjs": {
1595
- "version": "7.6.4",
1596
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.4.tgz",
1597
- "integrity": "sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw==",
1596
+ "version": "7.6.5",
1597
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",
1598
+ "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==",
1598
1599
  "license": "BSD-3-Clause",
1599
1600
  "dependencies": {
1600
1601
  "@protobufjs/aspromise": "^1.1.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralyn/pi",
3
- "version": "0.81.1-2",
3
+ "version": "0.82.1",
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.81.1",
43
- "@earendil-works/pi-ai": "^0.81.1",
44
- "@earendil-works/pi-tui": "^0.81.1",
42
+ "@earendil-works/pi-agent-core": "^0.82.0",
43
+ "@earendil-works/pi-ai": "^0.82.0",
44
+ "@earendil-works/pi-tui": "^0.82.0",
45
45
  "@silvia-odwyer/photon-node": "0.3.4",
46
46
  "chalk": "5.6.2",
47
47
  "cross-spawn": "7.0.6",
@@ -59,6 +59,7 @@
59
59
  "yaml": "2.9.0"
60
60
  },
61
61
  "overrides": {
62
+ "protobufjs": "7.6.5",
62
63
  "rimraf": "6.1.2",
63
64
  "gaxios": {
64
65
  "rimraf": "6.1.2"
@@ -1,7 +0,0 @@
1
- /**
2
- * Return unique, ordered command names when a command is a safe multi-command
3
- * chain suitable for a compact display summary. Returns undefined when the
4
- * command contains unsupported shell syntax or an unrecognized command.
5
- */
6
- export declare function summarizeBashCommand(command: string): string[] | undefined;
7
- //# sourceMappingURL=bash-command-summary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bash-command-summary.d.ts","sourceRoot":"","sources":["../../../src/core/tools/bash-command-summary.ts"],"names":[],"mappings":"AA6PA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAY1E","sourcesContent":["const SUMMARIZABLE_COMMANDS = new Set([\n\t\"cd\",\n\t\"ls\",\n\t\"find\",\n\t\"fd\",\n\t\"rg\",\n\t\"grep\",\n\t\"git\",\n\t\"gh\",\n\t\"npm\",\n\t\"pnpm\",\n\t\"yarn\",\n\t\"bun\",\n\t\"cat\",\n\t\"head\",\n\t\"tail\",\n\t\"sed\",\n\t\"awk\",\n\t\"jq\",\n\t\"sort\",\n\t\"uniq\",\n\t\"wc\",\n\t\"mkdir\",\n\t\"cp\",\n\t\"mv\",\n\t\"rm\",\n\t\"touch\",\n\t\"curl\",\n\t\"wget\",\n\t\"make\",\n\t\"cmake\",\n\t\"cargo\",\n\t\"go\",\n\t\"docker\",\n\t\"kubectl\",\n]);\n\nconst SHELL_KEYWORDS = new Set([\n\t\"case\",\n\t\"do\",\n\t\"done\",\n\t\"elif\",\n\t\"else\",\n\t\"esac\",\n\t\"fi\",\n\t\"for\",\n\t\"function\",\n\t\"if\",\n\t\"in\",\n\t\"select\",\n\t\"then\",\n\t\"until\",\n\t\"while\",\n]);\n\ntype CommandSeparator = \"&&\" | \"||\" | \"|\" | \"|&\" | \";\" | \"\\n\";\n\nfunction splitTopLevelCommands(command: string): string[] | undefined {\n\tconst segments: string[] = [];\n\tlet current = \"\";\n\tlet quote: \"'\" | '\"' | undefined;\n\tlet escaped = false;\n\tlet sawSeparator = false;\n\tlet trailingSeparator: CommandSeparator | undefined;\n\n\tconst pushSegment = (separator: CommandSeparator): boolean => {\n\t\tconst segment = current.trim();\n\t\tif (!segment) return false;\n\t\tsegments.push(segment);\n\t\tcurrent = \"\";\n\t\tsawSeparator = true;\n\t\ttrailingSeparator = separator;\n\t\treturn true;\n\t};\n\n\tfor (let i = 0; i < command.length; i++) {\n\t\tconst char = command[i];\n\t\tconst next = command[i + 1];\n\n\t\tif (escaped) {\n\t\t\tif (char !== \"\\n\") current += char;\n\t\t\tescaped = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tif (next === \"\\n\") {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tescaped = true;\n\t\t\tcurrent += char;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (quote) {\n\t\t\tcurrent += char;\n\t\t\tif (char === quote) quote = undefined;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tquote = char;\n\t\t\tcurrent += char;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"`\" || (char === \"$\" && (next === \"(\" || next === \"{\"))) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Redirections, grouping, comments, and background execution need more\n\t\t// shell grammar than a display-only summary should attempt to model.\n\t\tif (char === \"<\" || char === \">\" || char === \"(\" || char === \")\" || char === \"#\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (char === \"&\") {\n\t\t\tif (next !== \"&\") return undefined;\n\t\t\tif (!pushSegment(\"&&\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"|\") {\n\t\t\tif (next === \"|\") {\n\t\t\t\tif (!pushSegment(\"||\")) return undefined;\n\t\t\t\ti++;\n\t\t\t} else if (next === \"&\") {\n\t\t\t\tif (!pushSegment(\"|&\")) return undefined;\n\t\t\t\ti++;\n\t\t\t} else if (!pushSegment(\"|\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \";\") {\n\t\t\tif (next === \";\" || next === \"&\") return undefined;\n\t\t\tif (!pushSegment(\";\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\n\") {\n\t\t\tif (!current.trim() && trailingSeparator && trailingSeparator !== \";\" && trailingSeparator !== \"\\n\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!pushSegment(\"\\n\")) return undefined;\n\t\t\tcurrent = \"\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent += char;\n\t}\n\n\tif (escaped || quote) return undefined;\n\tif (current.trim()) {\n\t\tsegments.push(current.trim());\n\t} else if (trailingSeparator && trailingSeparator !== \";\" && trailingSeparator !== \"\\n\") {\n\t\treturn undefined;\n\t}\n\n\treturn sawSeparator && segments.length > 1 ? segments : undefined;\n}\n\nfunction tokenizeSimpleCommand(segment: string): string[] | undefined {\n\tconst tokens: string[] = [];\n\tlet current = \"\";\n\tlet quote: \"'\" | '\"' | undefined;\n\tlet escaped = false;\n\tlet tokenStarted = false;\n\n\tconst pushToken = () => {\n\t\tif (!tokenStarted) return;\n\t\ttokens.push(current);\n\t\tcurrent = \"\";\n\t\ttokenStarted = false;\n\t};\n\n\tfor (let i = 0; i < segment.length; i++) {\n\t\tconst char = segment[i];\n\n\t\tif (escaped) {\n\t\t\tif (char !== \"\\n\") current += char;\n\t\t\tescaped = false;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tescaped = true;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (quote) {\n\t\t\tif (char === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t} else {\n\t\t\t\tcurrent += char;\n\t\t\t}\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (char === \"'\" || char === '\"') {\n\t\t\tquote = char;\n\t\t\ttokenStarted = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (/\\s/.test(char)) {\n\t\t\tpushToken();\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent += char;\n\t\ttokenStarted = true;\n\t}\n\n\tif (escaped || quote) return undefined;\n\tpushToken();\n\treturn tokens.length > 0 ? tokens : undefined;\n}\n\nfunction normalizeCommandName(token: string): string | undefined {\n\tif (!token || token.startsWith(\"$\")) return undefined;\n\tconst lastSlash = token.lastIndexOf(\"/\");\n\tif (lastSlash !== -1) {\n\t\tif (token.startsWith(\"./\") || token.startsWith(\"../\")) return undefined;\n\t\ttoken = token.slice(lastSlash + 1);\n\t}\n\n\tconst normalized = token.toLowerCase().replace(/\\.exe$/, \"\");\n\treturn SUMMARIZABLE_COMMANDS.has(normalized) ? normalized : undefined;\n}\n\nfunction extractSimpleCommandName(segment: string): string | undefined {\n\tconst tokens = tokenizeSimpleCommand(segment);\n\tif (!tokens) return undefined;\n\n\tlet index = 0;\n\twhile (index < tokens.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[index])) {\n\t\tindex++;\n\t}\n\tconst command = tokens[index];\n\tif (!command || SHELL_KEYWORDS.has(command)) return undefined;\n\treturn normalizeCommandName(command);\n}\n\n/**\n * Return unique, ordered command names when a command is a safe multi-command\n * chain suitable for a compact display summary. Returns undefined when the\n * command contains unsupported shell syntax or an unrecognized command.\n */\nexport function summarizeBashCommand(command: string): string[] | undefined {\n\tconst segments = splitTopLevelCommands(command);\n\tif (!segments) return undefined;\n\n\tconst names: string[] = [];\n\tfor (const segment of segments) {\n\t\tconst name = extractSimpleCommandName(segment);\n\t\tif (!name) return undefined;\n\t\tif (!names.includes(name)) names.push(name);\n\t}\n\n\treturn names.length > 0 ? names : undefined;\n}\n"]}