@averyyy/pi-coding-agent 0.84.2-piclient.3 → 0.84.3-piclient.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 (298) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +8 -4
  3. package/dist/bundle/chunks/anthropic-messages-JWX2WP65.js +45 -0
  4. package/dist/bundle/chunks/anthropic.js +75 -0
  5. package/dist/bundle/chunks/azure-openai-responses-B2RCCN5N.js +2 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +74 -0
  7. package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
  8. package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
  9. package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  10. package/dist/bundle/chunks/chunk-AXIIZGTV.js +2 -0
  11. package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
  12. package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
  13. package/dist/bundle/chunks/chunk-GPPBJGBU.js +50 -0
  14. package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
  15. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  16. package/dist/bundle/chunks/chunk-LRBSW3NQ.js +11 -0
  17. package/dist/bundle/chunks/chunk-MNAIPA3J.js +2 -0
  18. package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
  19. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  20. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  21. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  22. package/dist/bundle/chunks/chunk-QI42RBZ4.js +1632 -0
  23. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  24. package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
  25. package/dist/bundle/chunks/chunk-UAQELI3K.js +2 -0
  26. package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
  27. package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  28. package/dist/bundle/chunks/dist-RDWOYWHR.js +13 -0
  29. package/dist/bundle/chunks/github-copilot.js +2 -0
  30. package/dist/bundle/chunks/google-generative-ai-XDKMGBCJ.js +2 -0
  31. package/dist/bundle/chunks/google-vertex-D5FGEO3Y.js +2 -0
  32. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  33. package/dist/bundle/chunks/kimi-coding.js +2 -0
  34. package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
  35. package/dist/bundle/chunks/mistral-conversations-YK73UAOZ.js +5 -0
  36. package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  37. package/dist/bundle/chunks/openai-codex-responses-MJHX7NXI.js +8 -0
  38. package/dist/bundle/chunks/openai-codex.js +75 -0
  39. package/dist/bundle/chunks/openai-completions-JD4WAC3R.js +7 -0
  40. package/dist/bundle/chunks/openai-responses-CP4VKB27.js +2 -0
  41. package/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
  42. package/dist/bundle/chunks/openrouter.js +75 -0
  43. package/dist/bundle/chunks/pi-messages-TPFH44NP.js +8 -0
  44. package/dist/bundle/chunks/radius.js +75 -0
  45. package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
  46. package/dist/bundle/chunks/xai.js +2 -0
  47. package/dist/bundle/cli.js +3 -0
  48. package/dist/bundle/client.js +2 -0
  49. package/dist/bundle/index.js +2 -0
  50. package/dist/bundle/rpc-entry.js +3 -0
  51. package/dist/cli/args.d.ts +1 -0
  52. package/dist/cli/args.d.ts.map +1 -1
  53. package/dist/cli/args.js +29 -9
  54. package/dist/cli/args.js.map +1 -1
  55. package/dist/cli/file-processor.d.ts.map +1 -1
  56. package/dist/cli/file-processor.js +2 -1
  57. package/dist/cli/file-processor.js.map +1 -1
  58. package/dist/config.d.ts +4 -3
  59. package/dist/config.d.ts.map +1 -1
  60. package/dist/config.js +22 -14
  61. package/dist/config.js.map +1 -1
  62. package/dist/core/agent-session.d.ts +15 -8
  63. package/dist/core/agent-session.d.ts.map +1 -1
  64. package/dist/core/agent-session.js +48 -39
  65. package/dist/core/agent-session.js.map +1 -1
  66. package/dist/core/auth-storage.d.ts.map +1 -1
  67. package/dist/core/auth-storage.js +6 -7
  68. package/dist/core/auth-storage.js.map +1 -1
  69. package/dist/core/defaults.d.ts +1 -0
  70. package/dist/core/defaults.d.ts.map +1 -1
  71. package/dist/core/defaults.js +9 -0
  72. package/dist/core/defaults.js.map +1 -1
  73. package/dist/core/exec.d.ts.map +1 -1
  74. package/dist/core/exec.js +3 -1
  75. package/dist/core/exec.js.map +1 -1
  76. package/dist/core/extensions/index.d.ts +2 -2
  77. package/dist/core/extensions/index.d.ts.map +1 -1
  78. package/dist/core/extensions/index.js +1 -1
  79. package/dist/core/extensions/index.js.map +1 -1
  80. package/dist/core/extensions/loader.d.ts.map +1 -1
  81. package/dist/core/extensions/loader.js +115 -48
  82. package/dist/core/extensions/loader.js.map +1 -1
  83. package/dist/core/extensions/types.d.ts +38 -9
  84. package/dist/core/extensions/types.d.ts.map +1 -1
  85. package/dist/core/extensions/types.js +3 -0
  86. package/dist/core/extensions/types.js.map +1 -1
  87. package/dist/core/footer-data-provider.d.ts +1 -1
  88. package/dist/core/footer-data-provider.d.ts.map +1 -1
  89. package/dist/core/footer-data-provider.js +1 -1
  90. package/dist/core/footer-data-provider.js.map +1 -1
  91. package/dist/core/index.d.ts +1 -0
  92. package/dist/core/index.d.ts.map +1 -1
  93. package/dist/core/index.js +1 -0
  94. package/dist/core/index.js.map +1 -1
  95. package/dist/core/keybindings.d.ts +20 -19
  96. package/dist/core/keybindings.d.ts.map +1 -1
  97. package/dist/core/keybindings.js +26 -5
  98. package/dist/core/keybindings.js.map +1 -1
  99. package/dist/core/model-config.d.ts +5 -0
  100. package/dist/core/model-config.d.ts.map +1 -1
  101. package/dist/core/model-config.js +3 -1
  102. package/dist/core/model-config.js.map +1 -1
  103. package/dist/core/model-resolver.d.ts +1 -0
  104. package/dist/core/model-resolver.d.ts.map +1 -1
  105. package/dist/core/model-resolver.js +14 -8
  106. package/dist/core/model-resolver.js.map +1 -1
  107. package/dist/core/models-store.d.ts.map +1 -1
  108. package/dist/core/models-store.js +2 -1
  109. package/dist/core/models-store.js.map +1 -1
  110. package/dist/core/package-manager.d.ts.map +1 -1
  111. package/dist/core/package-manager.js +22 -14
  112. package/dist/core/package-manager.js.map +1 -1
  113. package/dist/core/pi-client-cli-adapter.d.ts +11 -0
  114. package/dist/core/pi-client-cli-adapter.d.ts.map +1 -0
  115. package/dist/core/pi-client-cli-adapter.js +91 -0
  116. package/dist/core/pi-client-cli-adapter.js.map +1 -0
  117. package/dist/core/pi-manifest.d.ts.map +1 -1
  118. package/dist/core/pi-manifest.js +2 -1
  119. package/dist/core/pi-manifest.js.map +1 -1
  120. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  121. package/dist/core/remote-catalog-provider.js +2 -1
  122. package/dist/core/remote-catalog-provider.js.map +1 -1
  123. package/dist/core/resource-loader.d.ts.map +1 -1
  124. package/dist/core/resource-loader.js +3 -2
  125. package/dist/core/resource-loader.js.map +1 -1
  126. package/dist/core/sdk.d.ts +2 -2
  127. package/dist/core/sdk.d.ts.map +1 -1
  128. package/dist/core/sdk.js +10 -3
  129. package/dist/core/sdk.js.map +1 -1
  130. package/dist/core/session-export.d.ts +4 -0
  131. package/dist/core/session-export.d.ts.map +1 -0
  132. package/dist/core/session-export.js +32 -0
  133. package/dist/core/session-export.js.map +1 -0
  134. package/dist/core/session-manager.d.ts.map +1 -1
  135. package/dist/core/session-manager.js +2 -1
  136. package/dist/core/session-manager.js.map +1 -1
  137. package/dist/core/settings-diagnostics.d.ts +9 -0
  138. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  139. package/dist/core/settings-diagnostics.js +21 -0
  140. package/dist/core/settings-diagnostics.js.map +1 -0
  141. package/dist/core/settings-manager.d.ts +9 -0
  142. package/dist/core/settings-manager.d.ts.map +1 -1
  143. package/dist/core/settings-manager.js +52 -10
  144. package/dist/core/settings-manager.js.map +1 -1
  145. package/dist/core/skills.d.ts.map +1 -1
  146. package/dist/core/skills.js +51 -33
  147. package/dist/core/skills.js.map +1 -1
  148. package/dist/core/slash-commands.d.ts.map +1 -1
  149. package/dist/core/slash-commands.js +2 -1
  150. package/dist/core/slash-commands.js.map +1 -1
  151. package/dist/core/system-prompt.d.ts.map +1 -1
  152. package/dist/core/system-prompt.js +11 -2
  153. package/dist/core/system-prompt.js.map +1 -1
  154. package/dist/core/tools/bash.d.ts +13 -1
  155. package/dist/core/tools/bash.d.ts.map +1 -1
  156. package/dist/core/tools/bash.js +30 -14
  157. package/dist/core/tools/bash.js.map +1 -1
  158. package/dist/core/tools/edit-diff.d.ts +0 -5
  159. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  160. package/dist/core/tools/edit-diff.js +2 -5
  161. package/dist/core/tools/edit-diff.js.map +1 -1
  162. package/dist/core/tools/edit.d.ts.map +1 -1
  163. package/dist/core/tools/edit.js +20 -4
  164. package/dist/core/tools/edit.js.map +1 -1
  165. package/dist/core/tools/index.d.ts +4 -1
  166. package/dist/core/tools/index.d.ts.map +1 -1
  167. package/dist/core/tools/index.js +18 -1
  168. package/dist/core/tools/index.js.map +1 -1
  169. package/dist/core/tools/powershell.d.ts +16 -0
  170. package/dist/core/tools/powershell.d.ts.map +1 -0
  171. package/dist/core/tools/powershell.js +39 -0
  172. package/dist/core/tools/powershell.js.map +1 -0
  173. package/dist/core/trust-manager.d.ts.map +1 -1
  174. package/dist/core/trust-manager.js +2 -1
  175. package/dist/core/trust-manager.js.map +1 -1
  176. package/dist/extensions/llama/client.d.ts +6 -0
  177. package/dist/extensions/llama/client.d.ts.map +1 -1
  178. package/dist/extensions/llama/client.js +7 -0
  179. package/dist/extensions/llama/client.js.map +1 -1
  180. package/dist/extensions/llama/index.d.ts.map +1 -1
  181. package/dist/extensions/llama/index.js +2 -0
  182. package/dist/extensions/llama/index.js.map +1 -1
  183. package/dist/extensions/llama/provider.d.ts +3 -1
  184. package/dist/extensions/llama/provider.d.ts.map +1 -1
  185. package/dist/extensions/llama/provider.js +29 -4
  186. package/dist/extensions/llama/provider.js.map +1 -1
  187. package/dist/index.d.ts +2 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +3 -3
  190. package/dist/index.js.map +1 -1
  191. package/dist/main.d.ts +4 -0
  192. package/dist/main.d.ts.map +1 -1
  193. package/dist/main.js +20 -15
  194. package/dist/main.js.map +1 -1
  195. package/dist/migrations.d.ts.map +1 -1
  196. package/dist/migrations.js +4 -3
  197. package/dist/migrations.js.map +1 -1
  198. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  199. package/dist/modes/interactive/components/bash-execution.js +2 -1
  200. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  201. package/dist/modes/interactive/components/model-selector.d.ts +9 -3
  202. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  203. package/dist/modes/interactive/components/model-selector.js +56 -12
  204. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  205. package/dist/modes/interactive/components/settings-selector.d.ts +7 -2
  206. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  207. package/dist/modes/interactive/components/settings-selector.js +118 -56
  208. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  209. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  210. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  211. package/dist/modes/interactive/components/settings-submenu.js +165 -0
  212. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  213. package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  214. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  215. package/dist/modes/interactive/components/thinking-selector.js +74 -17
  216. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  217. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  218. package/dist/modes/interactive/external-editor.js +2 -1
  219. package/dist/modes/interactive/external-editor.js.map +1 -1
  220. package/dist/modes/interactive/interactive-mode.d.ts +13 -12
  221. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  222. package/dist/modes/interactive/interactive-mode.js +196 -226
  223. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  224. package/dist/modes/interactive/session-share.d.ts +16 -0
  225. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  226. package/dist/modes/interactive/session-share.js +188 -0
  227. package/dist/modes/interactive/session-share.js.map +1 -0
  228. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  229. package/dist/modes/interactive/theme/theme.js +4 -3
  230. package/dist/modes/interactive/theme/theme.js.map +1 -1
  231. package/dist/modes/json-event.d.ts +16 -13
  232. package/dist/modes/json-event.d.ts.map +1 -1
  233. package/dist/modes/json-event.js +20 -6
  234. package/dist/modes/json-event.js.map +1 -1
  235. package/dist/package-manager-cli.d.ts +1 -0
  236. package/dist/package-manager-cli.d.ts.map +1 -1
  237. package/dist/package-manager-cli.js +186 -2
  238. package/dist/package-manager-cli.js.map +1 -1
  239. package/dist/utils/child-process.d.ts.map +1 -1
  240. package/dist/utils/child-process.js +8 -3
  241. package/dist/utils/child-process.js.map +1 -1
  242. package/dist/utils/frontmatter.d.ts.map +1 -1
  243. package/dist/utils/frontmatter.js +2 -1
  244. package/dist/utils/frontmatter.js.map +1 -1
  245. package/dist/utils/management-http.d.ts +5 -3
  246. package/dist/utils/management-http.d.ts.map +1 -1
  247. package/dist/utils/management-http.js +14 -10
  248. package/dist/utils/management-http.js.map +1 -1
  249. package/dist/utils/shell.d.ts +3 -0
  250. package/dist/utils/shell.d.ts.map +1 -1
  251. package/dist/utils/shell.js +21 -7
  252. package/dist/utils/shell.js.map +1 -1
  253. package/dist/utils/syntax-highlight.d.ts +1 -0
  254. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  255. package/dist/utils/syntax-highlight.js +60 -1
  256. package/dist/utils/syntax-highlight.js.map +1 -1
  257. package/dist/utils/text.d.ts +8 -0
  258. package/dist/utils/text.d.ts.map +1 -0
  259. package/dist/utils/text.js +9 -0
  260. package/dist/utils/text.js.map +1 -0
  261. package/dist/utils/version-check.d.ts.map +1 -1
  262. package/dist/utils/version-check.js +2 -1
  263. package/dist/utils/version-check.js.map +1 -1
  264. package/docs/compaction.md +15 -0
  265. package/docs/custom-provider.md +5 -2
  266. package/docs/environment-variables.md +8 -8
  267. package/docs/extensions.md +17 -7
  268. package/docs/json.md +7 -2
  269. package/docs/keybindings.md +8 -8
  270. package/docs/llama-cpp.md +2 -0
  271. package/docs/models.md +8 -2
  272. package/docs/packages.md +2 -2
  273. package/docs/rpc.md +9 -3
  274. package/docs/sdk.md +7 -2
  275. package/docs/settings.md +11 -3
  276. package/docs/skills.md +4 -3
  277. package/docs/terminal-setup.md +11 -9
  278. package/docs/usage.md +6 -2
  279. package/docs/windows.md +24 -2
  280. package/examples/extensions/border-status-editor.ts +1 -1
  281. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  282. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  283. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  284. package/examples/extensions/git-checkpoint.ts +2 -2
  285. package/examples/extensions/gondolin/package-lock.json +2 -2
  286. package/examples/extensions/gondolin/package.json +1 -1
  287. package/examples/extensions/notify.ts +3 -1
  288. package/examples/extensions/sandbox/package-lock.json +2 -2
  289. package/examples/extensions/sandbox/package.json +1 -1
  290. package/examples/extensions/subagent/README.md +1 -1
  291. package/examples/extensions/subagent/index.ts +6 -1
  292. package/examples/extensions/titlebar-spinner.ts +1 -1
  293. package/examples/extensions/with-deps/package-lock.json +2 -2
  294. package/examples/extensions/with-deps/package.json +1 -1
  295. package/examples/rpc-extension-ui.ts +1 -1
  296. package/examples/sdk/06-extensions.ts +1 -1
  297. package/examples/sdk/README.md +1 -1
  298. package/package.json +12 -14
@@ -330,7 +330,8 @@ user sends another prompt ◄─────────────────
330
330
 
331
331
  /compact or auto-compaction
332
332
  ├─► session_before_compact (can cancel or customize)
333
- └─► session_compact
333
+ ├─► session_compact (success)
334
+ └─► session_compact_failed (failure or abort)
334
335
 
335
336
  /tree navigation
336
337
  ├─► session_before_tree (can cancel or customize)
@@ -448,7 +449,7 @@ pi.on("session_before_fork", async (event, ctx) => {
448
449
  After a successful fork or clone, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
449
450
  Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
450
451
 
451
- #### session_before_compact / session_compact
452
+ #### session_before_compact / session_compact / session_compact_failed
452
453
 
453
454
  Fired on compaction. See [compaction.md](compaction.md) for details.
454
455
 
@@ -479,6 +480,14 @@ pi.on("session_compact", async (event, ctx) => {
479
480
  // event.reason - "manual" (/compact), "threshold", or "overflow"
480
481
  // event.willRetry - whether the aborted turn is retried after compaction (overflow recovery)
481
482
  });
483
+
484
+ pi.on("session_compact_failed", async (event, ctx) => {
485
+ // event.reason - "manual" (/compact), "threshold", or "overflow"
486
+ // event.errorMessage - present for non-abort failures
487
+ // event.aborted - true for cancelled/aborted compactions
488
+ // event.willRetry - whether the aborted turn would have retried after compaction
489
+ // event.fromExtension - whether extension-provided compaction content was being used
490
+ });
482
491
  ```
483
492
 
484
493
  #### session_before_tree / session_tree
@@ -2050,7 +2059,7 @@ pi.registerTool({
2050
2059
 
2051
2060
  ### Overriding Built-in Tools
2052
2061
 
2053
- Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`) by registering a tool with the same name. Interactive mode displays a warning when this happens.
2062
+ Extensions can override built-in tools (`read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, `ls`) by registering a tool with the same name. Interactive mode displays a warning when this happens.
2054
2063
 
2055
2064
  ```bash
2056
2065
  # Extension's read tool replaces built-in read
@@ -2074,6 +2083,7 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
2074
2083
  Built-in tool implementations:
2075
2084
  - [read.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
2076
2085
  - [bash.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
2086
+ - [powershell.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/powershell.ts) - `PowerShellToolDetails`
2077
2087
  - [edit.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/edit.ts)
2078
2088
  - [write.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/write.ts)
2079
2089
  - [grep.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
@@ -2109,11 +2119,11 @@ pi.registerTool({
2109
2119
  });
2110
2120
  ```
2111
2121
 
2112
- **Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
2122
+ **Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `PowerShellOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
2113
2123
 
2114
2124
  For `user_bash`, extensions can reuse pi's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
2115
2125
 
2116
- The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
2126
+ The `bash` and `powershell` tools also support a spawn hook to adjust the command, cwd, or env before execution:
2117
2127
 
2118
2128
  ```typescript
2119
2129
  import { createBashTool } from "@earendil-works/pi-coding-agent";
@@ -2127,7 +2137,7 @@ const bashTool = createBashTool(cwd, {
2127
2137
  });
2128
2138
  ```
2129
2139
 
2130
- `createBashTool()` exposes the current session to commands through `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, and `PI_REASONING_LEVEL`. Injection happens before `spawnHook`, so hooks receive these values in `env` and preserve them when they spread the existing environment as above. Set `exposeSessionEnvironment: false` to disable them:
2140
+ `createBashTool()` and `createPowerShellTool()` expose the current session to commands through `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, and `PI_REASONING_LEVEL`. Injection happens before `spawnHook`, so hooks receive these values in `env` and preserve them when they spread the existing environment as above. Set `exposeSessionEnvironment: false` to disable them:
2131
2141
 
2132
2142
  ```typescript
2133
2143
  const bashTool = createBashTool(cwd, {
@@ -2135,7 +2145,7 @@ const bashTool = createBashTool(cwd, {
2135
2145
  });
2136
2146
  ```
2137
2147
 
2138
- See [Bash tool session environment](environment-variables.md#bash-tool-session-environment) for variable semantics. See [examples/extensions/ssh.ts](../examples/extensions/ssh.ts) for a complete SSH example with `--ssh` flag.
2148
+ See [Shell tool session environment](environment-variables.md#shell-tool-session-environment) for variable semantics. See [examples/extensions/ssh.ts](../examples/extensions/ssh.ts) for a complete SSH example with `--ssh` flag.
2139
2149
 
2140
2150
  ### Output Truncation
2141
2151
 
package/docs/json.md CHANGED
@@ -15,12 +15,16 @@ except that streaming message updates omit cumulative snapshots:
15
15
  ```typescript
16
16
  type WithoutPartial<T> = T extends { partial: unknown } ? Omit<T, "partial"> : T;
17
17
 
18
+ type JsonAssistantMessageEvent<T> = T extends { type: "toolcall_start"; partial: unknown }
19
+ ? WithoutPartial<T> & { id: string; toolName: string }
20
+ : WithoutPartial<T>;
21
+
18
22
  type JsonAgentSessionEvent =
19
23
  | Exclude<AgentSessionEvent, { type: "message_update" }>
20
24
  | {
21
25
  type: "message_update";
22
26
  usage: Usage;
23
- assistantMessageEvent: WithoutPartial<AssistantMessageEvent>;
27
+ assistantMessageEvent: JsonAssistantMessageEvent<AssistantMessageEvent>;
24
28
  };
25
29
  ```
26
30
 
@@ -84,7 +88,8 @@ Followed by events as they occur:
84
88
  `assistantMessageEvent.partial` to keep stream size linear. The top-level `usage` field contains
85
89
  the latest cumulative provider-reported usage and may remain zero when a provider only reports
86
90
  usage at completion. Use `contentIndex` and `delta` to assemble live text, thinking, or tool-call
87
- arguments if needed. `message_end` contains the final authoritative message.
91
+ arguments if needed. A `toolcall_start` event also includes the constant-sized `id` and `toolName`
92
+ fields. `message_end` contains the final authoritative message.
88
93
 
89
94
  ## Example
90
95
 
@@ -70,7 +70,7 @@ The dedicated history actions always change history entries, regardless of the c
70
70
  |--------|---------|-------------|
71
71
  | `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
72
72
  | `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
73
- | `tui.editor.undo` | `ctrl+-` | Undo last edit |
73
+ | `tui.editor.undo` | `ctrl+-` (`ctrl+z` on Windows; `alt+z` on WSL) | Undo last edit |
74
74
 
75
75
  ### TUI Clipboard and Selection
76
76
 
@@ -107,9 +107,9 @@ This routing remains configurable through the ordinary action bindings. For exam
107
107
  | `tui.altScreen.halfPageDown` | *(none)* | Scroll the transcript down by half a page |
108
108
  | `tui.altScreen.lineUp` | *(none)* | Scroll the transcript up by one line |
109
109
  | `tui.altScreen.lineDown` | *(none)* | Scroll the transcript down by one line |
110
- | `tui.altScreen.previousPrompt` | `ctrl+shift+up` | Jump to the previous marked message |
111
- | `tui.altScreen.nextPrompt` | `ctrl+shift+down` | Jump to the next marked message |
112
- | `tui.altScreen.search` | `ctrl+shift+f` | Search the rendered transcript |
110
+ | `tui.altScreen.previousPrompt` | `ctrl+shift+up`, `ctrl+up` (`ctrl+up` only on Windows and WSL) | Jump to the previous marked message |
111
+ | `tui.altScreen.nextPrompt` | `ctrl+shift+down`, `ctrl+down` (`ctrl+down` only on Windows and WSL) | Jump to the next marked message |
112
+ | `tui.altScreen.search` | `ctrl+shift+f` (`ctrl+f` on Windows and WSL) | Search the rendered transcript |
113
113
  | `tui.altScreen.searchNext` | `enter`, `ctrl+g` | Select the next search match while searching |
114
114
  | `tui.altScreen.searchPrevious` | `shift+enter`, `ctrl+shift+g` | Select the previous search match while searching |
115
115
  | `tui.altScreen.searchClose` | `escape` | Close transcript search |
@@ -125,7 +125,7 @@ This routing remains configurable through the ordinary action bindings. For exam
125
125
  | `app.exit` | `ctrl+d` | Exit (when editor empty) |
126
126
  | `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
127
127
  | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
128
- | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image or text from clipboard |
128
+ | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste image or text from clipboard |
129
129
 
130
130
  ### Sessions
131
131
 
@@ -149,7 +149,7 @@ This routing remains configurable through the ordinary action bindings. For exam
149
149
  |--------|---------|-------------|
150
150
  | `app.model.select` | `ctrl+l` | Open model selector |
151
151
  | `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
152
- | `app.model.cycleBackward` | `shift+ctrl+p` | Cycle to previous model |
152
+ | `app.model.cycleBackward` | `shift+ctrl+p` (`alt+p` on Windows and WSL) | Cycle to previous model |
153
153
  | `app.thinking.cycle` | `shift+tab` | Cycle thinking level |
154
154
  | `app.thinking.toggle` | `ctrl+t` | Collapse or expand thinking blocks |
155
155
 
@@ -159,8 +159,8 @@ This routing remains configurable through the ordinary action bindings. For exam
159
159
  |--------|---------|-------------|
160
160
  | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
161
161
  | `app.message.copy` | `ctrl+x` | Copy the last assistant message, or the selected message in `/tree` |
162
- | `app.message.followUp` | `alt+enter` | Queue follow-up message |
163
- | `app.message.dequeue` | `alt+up` | Restore queued messages to editor |
162
+ | `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
163
+ | `app.message.dequeue` | `alt+up` (`alt+q` on Windows and WSL) | Restore queued messages to editor |
164
164
 
165
165
  ### Tree Navigation
166
166
 
package/docs/llama-cpp.md CHANGED
@@ -53,6 +53,8 @@ Start Pi and configure the provider:
53
53
 
54
54
  Enter the router URL and optional API key. The default URL is `http://127.0.0.1:8080`.
55
55
 
56
+ If you start the router with `--no-models-autoload`, `/login llama.cpp` only stores the connection. Run `/llama` to load a model, then `/model` to select the loaded model for the current session.
57
+
56
58
  Environment variables can configure the same values without `/login`:
57
59
 
58
60
  ```bash
package/docs/models.md CHANGED
@@ -254,6 +254,8 @@ Current behavior:
254
254
 
255
255
  Only OpenAI-compatible APIs apply it (`openai-completions`, `openai-responses`, `azure-openai-responses`); other APIs ignore it. Keys override pi's named request fields (for example a `temperature` key here beats the request-level temperature), so prefer it as the single source of sampling truth for a model. In `modelOverrides`, `samplingParams` merges per key with the base model's value.
256
256
 
257
+ A constant thinking-token cap can go here too, but it will not follow `thinkingBudgets` or leave room for the answer. Prefer `compat.thinkingTokenBudgetField` (or the `supportsThinkingTokenBudget` alias) for that.
258
+
257
259
  ### Thinking Level Map
258
260
 
259
261
  Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Maps may contain holes; for example, a model can expose `high` and `max` without exposing `xhigh`.
@@ -467,8 +469,10 @@ For providers with partial OpenAI compatibility, use the `compat` field.
467
469
  | `requiresThinkingAsText` | Convert thinking blocks to plain text |
468
470
  | `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
469
471
  | `thinkingFormat` | Use `reasoning_effort`, `openrouter`, `deepseek`, `together`, `baseten`, `zai`, `qwen`, `chat-template`, or `qwen-chat-template` thinking parameters |
470
- | `chatTemplateKwargs` | `chat_template_kwargs` values for `thinkingFormat: "chat-template"`; use `{ "$var": "thinking.enabled" }` or `{ "$var": "thinking.effort" }` for pi-controlled thinking values |
471
- | `chatTemplateArgs` | `chat_template_args` values for `thinkingFormat: "baseten"`; use `{ "$var": "thinking.enabled" }` or `{ "$var": "thinking.effort" }` for pi-controlled thinking values |
472
+ | `chatTemplateKwargs` | `chat_template_kwargs` values for `thinkingFormat: "chat-template"`; use `{ "$var": "thinking.enabled" }`, `{ "$var": "thinking.effort" }`, or `{ "$var": "thinking.budget" }` for pi-controlled thinking values |
473
+ | `chatTemplateArgs` | `chat_template_args` values for `thinkingFormat: "baseten"`; use `{ "$var": "thinking.enabled" }`, `{ "$var": "thinking.effort" }`, or `{ "$var": "thinking.budget" }` for pi-controlled thinking values |
474
+ | `thinkingTokenBudgetField` | Top-level request field used to cap reasoning tokens from `thinkingBudgets`, clamped so at least 1024 tokens remain for the answer. `"thinking_token_budget"` (vLLM), `"thinking_budget"` (Qwen/DashScope/SGLang), `"thinking_budget_tokens"` (llama.cpp). Off by default; not set on the generated catalog. |
475
+ | `supportsThinkingTokenBudget` | Alias for `thinkingTokenBudgetField: "thinking_token_budget"` (vLLM). Prefer `thinkingTokenBudgetField`. Default: `false`. |
472
476
  | `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user, assistant, or tool-result text content. Currently only `anthropic` is supported. |
473
477
  | `sendSessionAffinityHeaders` | For `openai-completions`, send session-affinity headers from the session id when caching is enabled. Default: `false`. |
474
478
  | `sessionAffinityFormat` | For `openai-completions` and `openai-responses`, the session-affinity header format: `openai` sends `session_id`/`x-client-request-id` (completions also `x-session-affinity`), `openai-nosession` omits the underscore-containing `session_id` header, `openrouter` sends `x-session-id`. Does not affect the `prompt_cache_key` body param. Default: auto-detected. |
@@ -481,6 +485,8 @@ For providers with partial OpenAI compatibility, use the `compat` field.
481
485
 
482
486
  `openrouter` uses `reasoning: { effort }`. `together` uses `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` uses top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that require `chat_template_kwargs.enable_thinking` and `preserve_thinking`. Use `chat-template` for vLLM/Hugging Face chat templates that need configurable `chat_template_kwargs`, such as `chatTemplateKwargs: { "thinking": { "$var": "thinking.enabled" } }` for DeepSeek V3.x templates. Use `thinkingFormat: "baseten"` with `chatTemplateArgs` for providers that expose toggle controls through `chat_template_args` and optionally support top-level `reasoning_effort`.
483
487
 
488
+ `thinkingTokenBudgetField` is independent of `thinkingFormat`. Do not enable it on the generated Qwen catalog: those models already send `reasoning_effort`, and DashScope rejects `thinking_budget` together with `reasoning_effort`.
489
+
484
490
  `cacheControlFormat: "anthropic"` is for OpenAI-compatible providers that expose Anthropic-style prompt caching through `cache_control` markers on text content and tool definitions.
485
491
 
486
492
  Example:
package/docs/packages.md CHANGED
@@ -38,7 +38,7 @@ pi update npm:@foo/bar # update one package
38
38
  pi update --extension npm:@foo/bar
39
39
  ```
40
40
 
41
- These commands manage pi packages and `pi update` can update the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall).
41
+ These commands manage pi packages and `pi update` can update the pi CLI installation. For experimental installer-managed installations, `pi update` installs the exact checked version into a staged, lockfile-backed release and activates it only after verification, leaving the current release intact if the update fails. Managed installations do not support `--force`; rerun the installer to repair one. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall).
42
42
 
43
43
  By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup after the project is trusted.
44
44
 
@@ -130,7 +130,7 @@ Add a `pi` manifest to `package.json` or use conventional directories. Include t
130
130
  }
131
131
  ```
132
132
 
133
- Paths are relative to the package root. Arrays support glob patterns and `!exclusions`.
133
+ Paths are relative to the package root. Arrays support glob patterns and `!exclusions`. Positive manifest globs discover visible paths in lexical order. List dot-prefixed paths directly. If a glob would need to continue through a symlink, list the symlinked resource root directly.
134
134
 
135
135
  ### Gallery Metadata
136
136
 
package/docs/rpc.md CHANGED
@@ -945,7 +945,7 @@ The `assistantMessageEvent` field contains one of these delta types:
945
945
  | `thinking_start` | Thinking block started |
946
946
  | `thinking_delta` | Thinking content chunk |
947
947
  | `thinking_end` | Thinking block ended |
948
- | `toolcall_start` | Tool call started |
948
+ | `toolcall_start` | Tool call started (includes `id` and `toolName`) |
949
949
  | `toolcall_delta` | Tool call arguments chunk |
950
950
  | `toolcall_end` | Tool call ended (includes full `toolCall` object) |
951
951
 
@@ -960,11 +960,17 @@ Example streaming a text response:
960
960
  The top-level `usage` field contains the latest cumulative provider-reported usage. It may remain
961
961
  zero until completion when a provider does not report usage during streaming.
962
962
 
963
+ Example starting a tool call:
964
+ ```json
965
+ {"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"toolcall_start","contentIndex":1,"id":"call_abc123","toolName":"write"}}
966
+ ```
967
+
963
968
  `message_update` intentionally omits the former cumulative `message` field and
964
969
  `assistantMessageEvent.partial`. Clients that need a live partial message must assemble it
965
970
  from `message_start` and subsequent events using `contentIndex`. Treat `message_end.message`
966
- as authoritative. For tool calls, buffer `toolcall_delta.delta`; `toolcall_end.toolCall`
967
- contains the completed call.
971
+ as authoritative. For tool calls, `toolcall_start` provides the call `id` and `toolName`;
972
+ buffer `toolcall_delta.delta` for arguments. `toolcall_end.toolCall` contains the completed
973
+ call.
968
974
 
969
975
  ### bash_execution_update
970
976
 
package/docs/sdk.md CHANGED
@@ -519,7 +519,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
519
519
 
520
520
  Specify which built-in tools to enable:
521
521
 
522
- - Built-in tool names: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
522
+ - Built-in tool names: `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, `ls`
523
523
  - Default built-ins: `read`, `bash`, `edit`, `write`
524
524
  - `noTools: "all"` disables all tools
525
525
  - `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
@@ -540,6 +540,11 @@ const { session } = await createAgentSession({
540
540
  tools: ["read", "bash", "grep"],
541
541
  });
542
542
 
543
+ // Use PowerShell instead of Bash on Windows
544
+ const { session } = await createAgentSession({
545
+ tools: ["read", "powershell", "edit", "write"],
546
+ });
547
+
543
548
  // Disable one tool while keeping the rest available
544
549
  const { session } = await createAgentSession({
545
550
  excludeTools: ["ask_question"],
@@ -1196,7 +1201,7 @@ SettingsManager
1196
1201
  // Tool factories
1197
1202
  createCodingTools
1198
1203
  createReadOnlyTools
1199
- createReadTool, createBashTool, createEditTool, createWriteTool
1204
+ createReadTool, createBashTool, createPowerShellTool, createEditTool, createWriteTool
1200
1205
  createGrepTool, createFindTool, createLsTool
1201
1206
 
1202
1207
  // Types
package/docs/settings.md CHANGED
@@ -31,8 +31,8 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
31
31
  | `defaultModel` | string | - | Default model ID |
32
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 |
35
- | `thinkingBudgets` | object | - | Custom token budgets per thinking level |
34
+ | `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses and compaction or branch-summary usage |
35
+ | `thinkingBudgets` | object | - | Custom token budgets per thinking level. Anthropic, Google, and Bedrock use these natively. OpenAI-compatible models use them when `compat.thinkingTokenBudgetField` (or `supportsThinkingTokenBudget`) is set. |
36
36
 
37
37
  #### thinkingBudgets
38
38
 
@@ -220,7 +220,7 @@ Windows paths in JSON must use forward slashes or escaped backslashes:
220
220
  |---------|------|---------|-------------|
221
221
  | `defaultTools` | string[] | - | Built-in tools enabled initially. When omitted, Pi uses its standard defaults |
222
222
 
223
- `defaultTools` selects the built-in tools enabled at startup. Extension and SDK custom tools remain enabled:
223
+ `defaultTools` selects the built-in tools enabled at startup. Extension and SDK custom tools remain enabled. Available built-ins are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`:
224
224
 
225
225
  ```json
226
226
  {
@@ -228,6 +228,14 @@ Windows paths in JSON must use forward slashes or escaped backslashes:
228
228
  }
229
229
  ```
230
230
 
231
+ On Windows, select `powershell` instead of `bash`, or include both:
232
+
233
+ ```json
234
+ {
235
+ "defaultTools": ["read", "powershell", "edit", "write"]
236
+ }
237
+ ```
238
+
231
239
  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
240
 
233
241
  ### Sessions
package/docs/skills.md CHANGED
@@ -34,9 +34,10 @@ Pi loads skills from:
34
34
  - CLI: `--skill <path>` (repeatable, additive even with `--no-skills`)
35
35
 
36
36
  Discovery rules:
37
- - In `~/.pi/agent/skills/` and `.pi/skills/`, direct root `.md` files are discovered as individual skills
37
+ - In `~/.pi/agent/skills/` and `.pi/skills/`, direct root `.md` files are discovered as individual skills when they have valid skill frontmatter with a non-empty `description`
38
38
  - In all skill locations, directories containing `SKILL.md` are discovered recursively
39
- - In `~/.agents/skills/` and project `.agents/skills/`, root `.md` files are ignored
39
+ - In `~/.agents/skills/` and project `.agents/skills/`, root `.md` files are ignored, but nested `.md` files in grouping folders are discovered when they declare skill frontmatter
40
+ - Root Markdown files other than `SKILL.md` that do not look like skills are ignored silently
40
41
 
41
42
  Disable discovery with `--no-skills` (explicit `--skill` paths still load).
42
43
 
@@ -183,7 +184,7 @@ Pi validates skills against the Agent Skills standard. Most issues produce warni
183
184
 
184
185
  Unknown frontmatter fields are ignored.
185
186
 
186
- **Exception:** Skills with missing description are not loaded.
187
+ Declared skills with missing descriptions are not loaded. Malformed `SKILL.md` files and `SKILL.md` files without a description produce warnings and are not loaded. Other Markdown files without valid skill frontmatter are ignored.
187
188
 
188
189
  Name collisions (same name from different locations) warn and keep the first skill found.
189
190
 
@@ -120,7 +120,15 @@ Add to `keybindings.json`:
120
120
 
121
121
  ## Windows Terminal
122
122
 
123
- Add to `settings.json` (Ctrl+Shift+, or Settings → Open JSON file) to forward the modified Enter keys pi uses:
123
+ Pi uses Windows-style keybindings when running natively on Windows or in WSL:
124
+
125
+ - `Alt+V` pastes an image or clipboard text.
126
+ - `Ctrl+F` searches the transcript in fullscreen mode, and `Ctrl+Up`/`Ctrl+Down` jump between marked messages.
127
+ - `Alt+P` cycles to the previous model.
128
+ - `Ctrl+Z` undoes editing on native Windows; WSL uses `Alt+Z` so `Ctrl+Z` can suspend pi.
129
+ - `Ctrl+Q` queues a follow-up message and `Alt+Q` restores queued messages.
130
+
131
+ Add to `settings.json` (Ctrl+Shift+, or Settings → Open JSON file) to forward `Shift+Enter` for inserting a new line:
124
132
 
125
133
  ```json
126
134
  {
@@ -128,20 +136,14 @@ Add to `settings.json` (Ctrl+Shift+, or Settings → Open JSON file) to forward
128
136
  {
129
137
  "command": { "action": "sendInput", "input": "\u001b[13;2u" },
130
138
  "keys": "shift+enter"
131
- },
132
- {
133
- "command": { "action": "sendInput", "input": "\u001b[13;3u" },
134
- "keys": "alt+enter"
135
139
  }
136
140
  ]
137
141
  }
138
142
  ```
139
143
 
140
- - `Shift+Enter` inserts a new line.
141
- - Windows Terminal binds `Alt+Enter` to fullscreen by default. That prevents pi from receiving `Alt+Enter` for follow-up queueing.
142
- - Remapping `Alt+Enter` to `sendInput` forwards the real key chord to pi instead.
144
+ Windows Terminal binds `Alt+Enter` to fullscreen by default. To use it instead of pi's `Ctrl+Q` default for follow-up queueing, configure Windows Terminal to send the key and bind `app.message.followUp` to `alt+enter` in pi.
143
145
 
144
- If you already have an `actions` array, add the objects to it. If the old fullscreen behavior persists, fully close and reopen Windows Terminal.
146
+ If you already have an `actions` array, add the object to it. Fully close and reopen Windows Terminal after changing its settings.
145
147
 
146
148
  ## xfce4-terminal, terminator
147
149
 
package/docs/usage.md CHANGED
@@ -142,7 +142,7 @@ If you use pi for open source work and want to publish sessions for model, promp
142
142
  ## CLI Reference
143
143
 
144
144
  ```bash
145
- pi [options] [@files...] [messages...]
145
+ pi [options] [--] [@files...] [messages...]
146
146
  ```
147
147
 
148
148
  ### Package Commands
@@ -213,7 +213,7 @@ cat README.md | pi -p "Summarize this text"
213
213
  | `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
214
214
  | `--no-tools`, `-nt` | Disable all tools |
215
215
 
216
- Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
216
+ Built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`.
217
217
 
218
218
  ### Resource Options
219
219
 
@@ -246,6 +246,7 @@ pi --no-extensions -e ./my-extension.ts
246
246
  | `--verbose` | Force verbose startup |
247
247
  | `-a`, `--approve` | Trust project-local files for this run |
248
248
  | `-na`, `--no-approve` | Ignore project-local files for this run |
249
+ | `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
249
250
  | `-h`, `--help` | Show help |
250
251
  | `-v`, `--version` | Show version |
251
252
 
@@ -272,6 +273,9 @@ pi "List all .ts files in src/"
272
273
  # Non-interactive
273
274
  pi -p "Summarize this codebase"
274
275
 
276
+ # Prompt beginning with a dash
277
+ pi -p -- "- Summarize these points"
278
+
275
279
  # Non-interactive with piped stdin
276
280
  cat README.md | pi -p "Summarize this text"
277
281
 
package/docs/windows.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Windows Setup
2
2
 
3
- Pi requires a bash shell on Windows. Checked locations (in order):
3
+ Pi uses Git Bash by default on Windows. Checked locations (in order):
4
4
 
5
5
  1. Custom path from `~/.pi/agent/settings.json`
6
6
  2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
@@ -8,7 +8,29 @@ Pi requires a bash shell on Windows. Checked locations (in order):
8
8
 
9
9
  For most users, [Git for Windows](https://git-scm.com/download/win) is sufficient.
10
10
 
11
- ## Custom Shell Path
11
+ ## PowerShell Tool
12
+
13
+ The optional `powershell` tool runs commands through `pwsh.exe` when available, otherwise Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
14
+
15
+ Use `defaultTools` to replace the model-facing `bash` tool:
16
+
17
+ ```json
18
+ {
19
+ "defaultTools": ["read", "powershell", "edit", "write"]
20
+ }
21
+ ```
22
+
23
+ Or enable both while comparing behavior:
24
+
25
+ ```json
26
+ {
27
+ "defaultTools": ["read", "bash", "powershell", "edit", "write"]
28
+ }
29
+ ```
30
+
31
+ The `!` and `!!` editor commands still use Bash.
32
+
33
+ ## Custom Bash Path
12
34
 
13
35
  ```json
14
36
  {
@@ -92,7 +92,7 @@ export default function (pi: ExtensionAPI) {
92
92
  activeTui?.requestRender();
93
93
  });
94
94
 
95
- pi.on("agent_end", () => {
95
+ pi.on("agent_settled", () => {
96
96
  isWorking = false;
97
97
  stopSpinner();
98
98
  activeTui?.requestRender();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.84.2",
3
+ "version": "0.84.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.84.2",
9
+ "version": "0.84.3",
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.84.2",
4
+ "version": "0.84.3",
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.84.2",
4
+ "version": "0.84.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -46,8 +46,8 @@ export default function (pi: ExtensionAPI) {
46
46
  }
47
47
  });
48
48
 
49
- pi.on("agent_end", async () => {
50
- // Clear checkpoints after agent completes
49
+ pi.on("agent_settled", async () => {
50
+ // Clear checkpoints after the full agent run completes
51
51
  checkpoints.clear();
52
52
  });
53
53
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.84.2",
3
+ "version": "0.84.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.84.2",
9
+ "version": "0.84.3",
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.84.2",
4
+ "version": "0.84.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -49,7 +49,9 @@ function notify(title: string, body: string): void {
49
49
  }
50
50
 
51
51
  export default function (pi: ExtensionAPI) {
52
- pi.on("agent_end", async () => {
52
+ // `agent_end` fires after each low-level run; Pi may still retry, compact,
53
+ // or continue with queued follow-ups. Notify only after the full run settles.
54
+ pi.on("agent_settled", async () => {
53
55
  notify("Pi", "Ready for input");
54
56
  });
55
57
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "1.14.2",
3
+ "version": "1.14.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "1.14.2",
9
+ "version": "1.14.3",
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.14.2",
4
+ "version": "1.14.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -62,7 +62,7 @@ This tool executes a separate `pi` subprocess with a delegated system prompt and
62
62
 
63
63
  To enable project-local agents, pass `agentScope: "both"` (or `"project"`). Only do this for repositories you trust.
64
64
 
65
- When running interactively, the tool prompts for confirmation before running project-local agents. Set `confirmProjectAgents: false` to disable.
65
+ When running interactively, the tool prompts for confirmation before running project-local agents in untrusted projects. Trusted projects skip the additional prompt. Set `confirmProjectAgents: false` to disable confirmation.
66
66
 
67
67
  ## Usage
68
68
 
@@ -517,7 +517,12 @@ export default function (pi: ExtensionAPI) {
517
517
  };
518
518
  }
519
519
 
520
- if ((agentScope === "project" || agentScope === "both") && confirmProjectAgents && ctx.hasUI) {
520
+ if (
521
+ (agentScope === "project" || agentScope === "both") &&
522
+ confirmProjectAgents &&
523
+ ctx.hasUI &&
524
+ !ctx.isProjectTrusted()
525
+ ) {
521
526
  const requestedAgentNames = new Set<string>();
522
527
  if (params.chain) for (const step of params.chain) requestedAgentNames.add(step.agent);
523
528
  if (params.tasks) for (const t of params.tasks) requestedAgentNames.add(t.agent);
@@ -48,7 +48,7 @@ export default function (pi: ExtensionAPI) {
48
48
  startAnimation(ctx);
49
49
  });
50
50
 
51
- pi.on("agent_end", async (_event, ctx) => {
51
+ pi.on("agent_settled", async (_event, ctx) => {
52
52
  stopAnimation(ctx);
53
53
  });
54
54
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.84.2",
3
+ "version": "0.84.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.84.2",
9
+ "version": "0.84.3",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },