open-pi-coding-agent 0.57.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 (604) hide show
  1. package/CHANGELOG.md +3045 -0
  2. package/README.md +571 -0
  3. package/dist/cli/args.d.ts +48 -0
  4. package/dist/cli/args.d.ts.map +1 -0
  5. package/dist/cli/args.js +299 -0
  6. package/dist/cli/args.js.map +1 -0
  7. package/dist/cli/config-selector.d.ts +14 -0
  8. package/dist/cli/config-selector.d.ts.map +1 -0
  9. package/dist/cli/config-selector.js +31 -0
  10. package/dist/cli/config-selector.js.map +1 -0
  11. package/dist/cli/file-processor.d.ts +15 -0
  12. package/dist/cli/file-processor.d.ts.map +1 -0
  13. package/dist/cli/file-processor.js +79 -0
  14. package/dist/cli/file-processor.js.map +1 -0
  15. package/dist/cli/list-models.d.ts +9 -0
  16. package/dist/cli/list-models.d.ts.map +1 -0
  17. package/dist/cli/list-models.js +92 -0
  18. package/dist/cli/list-models.js.map +1 -0
  19. package/dist/cli/session-picker.d.ts +9 -0
  20. package/dist/cli/session-picker.d.ts.map +1 -0
  21. package/dist/cli/session-picker.js +34 -0
  22. package/dist/cli/session-picker.js.map +1 -0
  23. package/dist/cli.d.ts +3 -0
  24. package/dist/cli.d.ts.map +1 -0
  25. package/dist/cli.js +16 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/config.d.ts +68 -0
  28. package/dist/config.d.ts.map +1 -0
  29. package/dist/config.js +203 -0
  30. package/dist/config.js.map +1 -0
  31. package/dist/core/agent-session.d.ts +582 -0
  32. package/dist/core/agent-session.d.ts.map +1 -0
  33. package/dist/core/agent-session.js +2494 -0
  34. package/dist/core/agent-session.js.map +1 -0
  35. package/dist/core/auth-storage.d.ts +130 -0
  36. package/dist/core/auth-storage.d.ts.map +1 -0
  37. package/dist/core/auth-storage.js +419 -0
  38. package/dist/core/auth-storage.js.map +1 -0
  39. package/dist/core/bash-executor.d.ts +47 -0
  40. package/dist/core/bash-executor.d.ts.map +1 -0
  41. package/dist/core/bash-executor.js +212 -0
  42. package/dist/core/bash-executor.js.map +1 -0
  43. package/dist/core/compaction/branch-summarization.d.ts +86 -0
  44. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  45. package/dist/core/compaction/branch-summarization.js +242 -0
  46. package/dist/core/compaction/branch-summarization.js.map +1 -0
  47. package/dist/core/compaction/compaction.d.ts +121 -0
  48. package/dist/core/compaction/compaction.d.ts.map +1 -0
  49. package/dist/core/compaction/compaction.js +610 -0
  50. package/dist/core/compaction/compaction.js.map +1 -0
  51. package/dist/core/compaction/index.d.ts +7 -0
  52. package/dist/core/compaction/index.d.ts.map +1 -0
  53. package/dist/core/compaction/index.js +7 -0
  54. package/dist/core/compaction/index.js.map +1 -0
  55. package/dist/core/compaction/utils.d.ts +38 -0
  56. package/dist/core/compaction/utils.d.ts.map +1 -0
  57. package/dist/core/compaction/utils.js +153 -0
  58. package/dist/core/compaction/utils.js.map +1 -0
  59. package/dist/core/defaults.d.ts +3 -0
  60. package/dist/core/defaults.d.ts.map +1 -0
  61. package/dist/core/defaults.js +2 -0
  62. package/dist/core/defaults.js.map +1 -0
  63. package/dist/core/diagnostics.d.ts +15 -0
  64. package/dist/core/diagnostics.d.ts.map +1 -0
  65. package/dist/core/diagnostics.js +2 -0
  66. package/dist/core/diagnostics.js.map +1 -0
  67. package/dist/core/event-bus.d.ts +9 -0
  68. package/dist/core/event-bus.d.ts.map +1 -0
  69. package/dist/core/event-bus.js +25 -0
  70. package/dist/core/event-bus.js.map +1 -0
  71. package/dist/core/exec.d.ts +29 -0
  72. package/dist/core/exec.d.ts.map +1 -0
  73. package/dist/core/exec.js +71 -0
  74. package/dist/core/exec.js.map +1 -0
  75. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  76. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  77. package/dist/core/export-html/ansi-to-html.js +249 -0
  78. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  79. package/dist/core/export-html/index.d.ts +37 -0
  80. package/dist/core/export-html/index.d.ts.map +1 -0
  81. package/dist/core/export-html/index.js +223 -0
  82. package/dist/core/export-html/index.js.map +1 -0
  83. package/dist/core/export-html/template.css +971 -0
  84. package/dist/core/export-html/template.html +54 -0
  85. package/dist/core/export-html/template.js +1583 -0
  86. package/dist/core/export-html/tool-renderer.d.ts +38 -0
  87. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  88. package/dist/core/export-html/tool-renderer.js +70 -0
  89. package/dist/core/export-html/tool-renderer.js.map +1 -0
  90. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  91. package/dist/core/export-html/vendor/marked.min.js +6 -0
  92. package/dist/core/extensions/index.d.ts +11 -0
  93. package/dist/core/extensions/index.d.ts.map +1 -0
  94. package/dist/core/extensions/index.js +9 -0
  95. package/dist/core/extensions/index.js.map +1 -0
  96. package/dist/core/extensions/loader.d.ts +25 -0
  97. package/dist/core/extensions/loader.d.ts.map +1 -0
  98. package/dist/core/extensions/loader.js +426 -0
  99. package/dist/core/extensions/loader.js.map +1 -0
  100. package/dist/core/extensions/runner.d.ts +147 -0
  101. package/dist/core/extensions/runner.d.ts.map +1 -0
  102. package/dist/core/extensions/runner.js +678 -0
  103. package/dist/core/extensions/runner.js.map +1 -0
  104. package/dist/core/extensions/types.d.ts +1036 -0
  105. package/dist/core/extensions/types.d.ts.map +1 -0
  106. package/dist/core/extensions/types.js +35 -0
  107. package/dist/core/extensions/types.js.map +1 -0
  108. package/dist/core/extensions/wrapper.d.ts +27 -0
  109. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  110. package/dist/core/extensions/wrapper.js +102 -0
  111. package/dist/core/extensions/wrapper.js.map +1 -0
  112. package/dist/core/footer-data-provider.d.ts +32 -0
  113. package/dist/core/footer-data-provider.d.ts.map +1 -0
  114. package/dist/core/footer-data-provider.js +134 -0
  115. package/dist/core/footer-data-provider.js.map +1 -0
  116. package/dist/core/index.d.ts +9 -0
  117. package/dist/core/index.d.ts.map +1 -0
  118. package/dist/core/index.js +9 -0
  119. package/dist/core/index.js.map +1 -0
  120. package/dist/core/keybindings.d.ts +55 -0
  121. package/dist/core/keybindings.d.ts.map +1 -0
  122. package/dist/core/keybindings.js +153 -0
  123. package/dist/core/keybindings.js.map +1 -0
  124. package/dist/core/messages.d.ts +77 -0
  125. package/dist/core/messages.d.ts.map +1 -0
  126. package/dist/core/messages.js +123 -0
  127. package/dist/core/messages.js.map +1 -0
  128. package/dist/core/model-registry.d.ts +113 -0
  129. package/dist/core/model-registry.d.ts.map +1 -0
  130. package/dist/core/model-registry.js +537 -0
  131. package/dist/core/model-registry.js.map +1 -0
  132. package/dist/core/model-resolver.d.ts +104 -0
  133. package/dist/core/model-resolver.d.ts.map +1 -0
  134. package/dist/core/model-resolver.js +462 -0
  135. package/dist/core/model-resolver.js.map +1 -0
  136. package/dist/core/package-manager.d.ts +151 -0
  137. package/dist/core/package-manager.d.ts.map +1 -0
  138. package/dist/core/package-manager.js +1447 -0
  139. package/dist/core/package-manager.js.map +1 -0
  140. package/dist/core/prompt-templates.d.ts +50 -0
  141. package/dist/core/prompt-templates.d.ts.map +1 -0
  142. package/dist/core/prompt-templates.js +251 -0
  143. package/dist/core/prompt-templates.js.map +1 -0
  144. package/dist/core/resolve-config-value.d.ts +17 -0
  145. package/dist/core/resolve-config-value.d.ts.map +1 -0
  146. package/dist/core/resolve-config-value.js +59 -0
  147. package/dist/core/resolve-config-value.js.map +1 -0
  148. package/dist/core/resource-loader.d.ts +184 -0
  149. package/dist/core/resource-loader.d.ts.map +1 -0
  150. package/dist/core/resource-loader.js +670 -0
  151. package/dist/core/resource-loader.js.map +1 -0
  152. package/dist/core/sdk.d.ts +90 -0
  153. package/dist/core/sdk.d.ts.map +1 -0
  154. package/dist/core/sdk.js +242 -0
  155. package/dist/core/sdk.js.map +1 -0
  156. package/dist/core/session-manager.d.ts +323 -0
  157. package/dist/core/session-manager.d.ts.map +1 -0
  158. package/dist/core/session-manager.js +1098 -0
  159. package/dist/core/session-manager.js.map +1 -0
  160. package/dist/core/settings-manager.d.ts +232 -0
  161. package/dist/core/settings-manager.d.ts.map +1 -0
  162. package/dist/core/settings-manager.js +691 -0
  163. package/dist/core/settings-manager.js.map +1 -0
  164. package/dist/core/skills.d.ts +58 -0
  165. package/dist/core/skills.d.ts.map +1 -0
  166. package/dist/core/skills.js +364 -0
  167. package/dist/core/skills.js.map +1 -0
  168. package/dist/core/slash-commands.d.ts +15 -0
  169. package/dist/core/slash-commands.d.ts.map +1 -0
  170. package/dist/core/slash-commands.js +22 -0
  171. package/dist/core/slash-commands.js.map +1 -0
  172. package/dist/core/system-prompt.d.ts +28 -0
  173. package/dist/core/system-prompt.d.ts.map +1 -0
  174. package/dist/core/system-prompt.js +159 -0
  175. package/dist/core/system-prompt.js.map +1 -0
  176. package/dist/core/timings.d.ts +7 -0
  177. package/dist/core/timings.d.ts.map +1 -0
  178. package/dist/core/timings.js +25 -0
  179. package/dist/core/timings.js.map +1 -0
  180. package/dist/core/tools/bash.d.ts +55 -0
  181. package/dist/core/tools/bash.d.ts.map +1 -0
  182. package/dist/core/tools/bash.js +242 -0
  183. package/dist/core/tools/bash.js.map +1 -0
  184. package/dist/core/tools/edit-diff.d.ts +63 -0
  185. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  186. package/dist/core/tools/edit-diff.js +243 -0
  187. package/dist/core/tools/edit-diff.js.map +1 -0
  188. package/dist/core/tools/edit.d.ts +39 -0
  189. package/dist/core/tools/edit.d.ts.map +1 -0
  190. package/dist/core/tools/edit.js +146 -0
  191. package/dist/core/tools/edit.js.map +1 -0
  192. package/dist/core/tools/find.d.ts +39 -0
  193. package/dist/core/tools/find.d.ts.map +1 -0
  194. package/dist/core/tools/find.js +206 -0
  195. package/dist/core/tools/find.js.map +1 -0
  196. package/dist/core/tools/grep.d.ts +45 -0
  197. package/dist/core/tools/grep.d.ts.map +1 -0
  198. package/dist/core/tools/grep.js +239 -0
  199. package/dist/core/tools/grep.js.map +1 -0
  200. package/dist/core/tools/index.d.ts +73 -0
  201. package/dist/core/tools/index.d.ts.map +1 -0
  202. package/dist/core/tools/index.js +61 -0
  203. package/dist/core/tools/index.js.map +1 -0
  204. package/dist/core/tools/ls.d.ts +40 -0
  205. package/dist/core/tools/ls.d.ts.map +1 -0
  206. package/dist/core/tools/ls.js +118 -0
  207. package/dist/core/tools/ls.js.map +1 -0
  208. package/dist/core/tools/path-utils.d.ts +8 -0
  209. package/dist/core/tools/path-utils.d.ts.map +1 -0
  210. package/dist/core/tools/path-utils.js +81 -0
  211. package/dist/core/tools/path-utils.js.map +1 -0
  212. package/dist/core/tools/read.d.ts +39 -0
  213. package/dist/core/tools/read.d.ts.map +1 -0
  214. package/dist/core/tools/read.js +166 -0
  215. package/dist/core/tools/read.js.map +1 -0
  216. package/dist/core/tools/truncate.d.ts +70 -0
  217. package/dist/core/tools/truncate.d.ts.map +1 -0
  218. package/dist/core/tools/truncate.js +205 -0
  219. package/dist/core/tools/truncate.js.map +1 -0
  220. package/dist/core/tools/write.d.ts +29 -0
  221. package/dist/core/tools/write.d.ts.map +1 -0
  222. package/dist/core/tools/write.js +78 -0
  223. package/dist/core/tools/write.js.map +1 -0
  224. package/dist/index.d.ts +27 -0
  225. package/dist/index.d.ts.map +1 -0
  226. package/dist/index.js +42 -0
  227. package/dist/index.js.map +1 -0
  228. package/dist/main.d.ts +8 -0
  229. package/dist/main.d.ts.map +1 -0
  230. package/dist/main.js +691 -0
  231. package/dist/main.js.map +1 -0
  232. package/dist/migrations.d.ts +33 -0
  233. package/dist/migrations.d.ts.map +1 -0
  234. package/dist/migrations.js +261 -0
  235. package/dist/migrations.js.map +1 -0
  236. package/dist/modes/index.d.ts +9 -0
  237. package/dist/modes/index.d.ts.map +1 -0
  238. package/dist/modes/index.js +8 -0
  239. package/dist/modes/index.js.map +1 -0
  240. package/dist/modes/interactive/components/armin.d.ts +34 -0
  241. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  242. package/dist/modes/interactive/components/armin.js +333 -0
  243. package/dist/modes/interactive/components/armin.js.map +1 -0
  244. package/dist/modes/interactive/components/assistant-message.d.ts +16 -0
  245. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  246. package/dist/modes/interactive/components/assistant-message.js +96 -0
  247. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  248. package/dist/modes/interactive/components/bash-execution.d.ts +35 -0
  249. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  250. package/dist/modes/interactive/components/bash-execution.js +162 -0
  251. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  252. package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  253. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  254. package/dist/modes/interactive/components/bordered-loader.js +51 -0
  255. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  256. package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  257. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  258. package/dist/modes/interactive/components/branch-summary-message.js +44 -0
  259. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  260. package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  261. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  262. package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  263. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  264. package/dist/modes/interactive/components/config-selector.d.ts +71 -0
  265. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  266. package/dist/modes/interactive/components/config-selector.js +479 -0
  267. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  268. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  269. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  270. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  271. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  272. package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  273. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  274. package/dist/modes/interactive/components/custom-editor.js +70 -0
  275. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  276. package/dist/modes/interactive/components/custom-message.d.ts +20 -0
  277. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  278. package/dist/modes/interactive/components/custom-message.js +79 -0
  279. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  280. package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  281. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  282. package/dist/modes/interactive/components/daxnuts.js +140 -0
  283. package/dist/modes/interactive/components/daxnuts.js.map +1 -0
  284. package/dist/modes/interactive/components/diff.d.ts +12 -0
  285. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  286. package/dist/modes/interactive/components/diff.js +133 -0
  287. package/dist/modes/interactive/components/diff.js.map +1 -0
  288. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  289. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  290. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  291. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  292. package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  293. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  294. package/dist/modes/interactive/components/extension-editor.js +111 -0
  295. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  296. package/dist/modes/interactive/components/extension-input.d.ts +23 -0
  297. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  298. package/dist/modes/interactive/components/extension-input.js +61 -0
  299. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  300. package/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  301. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  302. package/dist/modes/interactive/components/extension-selector.js +78 -0
  303. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  304. package/dist/modes/interactive/components/footer.d.ts +26 -0
  305. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  306. package/dist/modes/interactive/components/footer.js +198 -0
  307. package/dist/modes/interactive/components/footer.js.map +1 -0
  308. package/dist/modes/interactive/components/index.d.ts +32 -0
  309. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  310. package/dist/modes/interactive/components/index.js +33 -0
  311. package/dist/modes/interactive/components/index.js.map +1 -0
  312. package/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
  313. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  314. package/dist/modes/interactive/components/keybinding-hints.js +61 -0
  315. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  316. package/dist/modes/interactive/components/login-dialog.d.ts +42 -0
  317. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  318. package/dist/modes/interactive/components/login-dialog.js +145 -0
  319. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  320. package/dist/modes/interactive/components/model-selector.d.ts +47 -0
  321. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  322. package/dist/modes/interactive/components/model-selector.js +271 -0
  323. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  324. package/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  325. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  326. package/dist/modes/interactive/components/oauth-selector.js +97 -0
  327. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  328. package/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  329. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  330. package/dist/modes/interactive/components/scoped-models-selector.js +275 -0
  331. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  332. package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  333. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  334. package/dist/modes/interactive/components/session-selector-search.js +155 -0
  335. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  336. package/dist/modes/interactive/components/session-selector.d.ts +95 -0
  337. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  338. package/dist/modes/interactive/components/session-selector.js +851 -0
  339. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  340. package/dist/modes/interactive/components/settings-selector.d.ts +58 -0
  341. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  342. package/dist/modes/interactive/components/settings-selector.js +297 -0
  343. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  344. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  345. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  346. package/dist/modes/interactive/components/show-images-selector.js +35 -0
  347. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  348. package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  349. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  350. package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  351. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  352. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  353. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  354. package/dist/modes/interactive/components/theme-selector.js +46 -0
  355. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  356. package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  357. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  358. package/dist/modes/interactive/components/thinking-selector.js +47 -0
  359. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  360. package/dist/modes/interactive/components/tool-execution.d.ts +77 -0
  361. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  362. package/dist/modes/interactive/components/tool-execution.js +787 -0
  363. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  364. package/dist/modes/interactive/components/tree-selector.d.ts +87 -0
  365. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  366. package/dist/modes/interactive/components/tree-selector.js +1040 -0
  367. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  368. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  369. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  370. package/dist/modes/interactive/components/user-message-selector.js +113 -0
  371. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  372. package/dist/modes/interactive/components/user-message.d.ts +9 -0
  373. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  374. package/dist/modes/interactive/components/user-message.js +27 -0
  375. package/dist/modes/interactive/components/user-message.js.map +1 -0
  376. package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  377. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  378. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  379. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  380. package/dist/modes/interactive/interactive-mode.d.ts +316 -0
  381. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  382. package/dist/modes/interactive/interactive-mode.js +3779 -0
  383. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  384. package/dist/modes/interactive/theme/dark.json +85 -0
  385. package/dist/modes/interactive/theme/light.json +84 -0
  386. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  387. package/dist/modes/interactive/theme/theme.d.ts +78 -0
  388. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  389. package/dist/modes/interactive/theme/theme.js +949 -0
  390. package/dist/modes/interactive/theme/theme.js.map +1 -0
  391. package/dist/modes/print-mode.d.ts +28 -0
  392. package/dist/modes/print-mode.d.ts.map +1 -0
  393. package/dist/modes/print-mode.js +101 -0
  394. package/dist/modes/print-mode.js.map +1 -0
  395. package/dist/modes/rpc/jsonl.d.ts +17 -0
  396. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  397. package/dist/modes/rpc/jsonl.js +49 -0
  398. package/dist/modes/rpc/jsonl.js.map +1 -0
  399. package/dist/modes/rpc/rpc-client.d.ts +217 -0
  400. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  401. package/dist/modes/rpc/rpc-client.js +401 -0
  402. package/dist/modes/rpc/rpc-client.js.map +1 -0
  403. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  404. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  405. package/dist/modes/rpc/rpc-mode.js +509 -0
  406. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  407. package/dist/modes/rpc/rpc-types.d.ts +409 -0
  408. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  409. package/dist/modes/rpc/rpc-types.js +8 -0
  410. package/dist/modes/rpc/rpc-types.js.map +1 -0
  411. package/dist/utils/changelog.d.ts +21 -0
  412. package/dist/utils/changelog.d.ts.map +1 -0
  413. package/dist/utils/changelog.js +87 -0
  414. package/dist/utils/changelog.js.map +1 -0
  415. package/dist/utils/clipboard-image.d.ts +11 -0
  416. package/dist/utils/clipboard-image.d.ts.map +1 -0
  417. package/dist/utils/clipboard-image.js +162 -0
  418. package/dist/utils/clipboard-image.js.map +1 -0
  419. package/dist/utils/clipboard-native.d.ts +7 -0
  420. package/dist/utils/clipboard-native.d.ts.map +1 -0
  421. package/dist/utils/clipboard-native.js +14 -0
  422. package/dist/utils/clipboard-native.js.map +1 -0
  423. package/dist/utils/clipboard.d.ts +2 -0
  424. package/dist/utils/clipboard.d.ts.map +1 -0
  425. package/dist/utils/clipboard.js +67 -0
  426. package/dist/utils/clipboard.js.map +1 -0
  427. package/dist/utils/frontmatter.d.ts +8 -0
  428. package/dist/utils/frontmatter.d.ts.map +1 -0
  429. package/dist/utils/frontmatter.js +26 -0
  430. package/dist/utils/frontmatter.js.map +1 -0
  431. package/dist/utils/git.d.ts +26 -0
  432. package/dist/utils/git.d.ts.map +1 -0
  433. package/dist/utils/git.js +163 -0
  434. package/dist/utils/git.js.map +1 -0
  435. package/dist/utils/image-convert.d.ts +9 -0
  436. package/dist/utils/image-convert.d.ts.map +1 -0
  437. package/dist/utils/image-convert.js +35 -0
  438. package/dist/utils/image-convert.js.map +1 -0
  439. package/dist/utils/image-resize.d.ts +36 -0
  440. package/dist/utils/image-resize.d.ts.map +1 -0
  441. package/dist/utils/image-resize.js +181 -0
  442. package/dist/utils/image-resize.js.map +1 -0
  443. package/dist/utils/mime.d.ts +2 -0
  444. package/dist/utils/mime.d.ts.map +1 -0
  445. package/dist/utils/mime.js +26 -0
  446. package/dist/utils/mime.js.map +1 -0
  447. package/dist/utils/photon.d.ts +21 -0
  448. package/dist/utils/photon.d.ts.map +1 -0
  449. package/dist/utils/photon.js +121 -0
  450. package/dist/utils/photon.js.map +1 -0
  451. package/dist/utils/shell.d.ts +26 -0
  452. package/dist/utils/shell.d.ts.map +1 -0
  453. package/dist/utils/shell.js +186 -0
  454. package/dist/utils/shell.js.map +1 -0
  455. package/dist/utils/sleep.d.ts +5 -0
  456. package/dist/utils/sleep.d.ts.map +1 -0
  457. package/dist/utils/sleep.js +17 -0
  458. package/dist/utils/sleep.js.map +1 -0
  459. package/dist/utils/tools-manager.d.ts +3 -0
  460. package/dist/utils/tools-manager.d.ts.map +1 -0
  461. package/dist/utils/tools-manager.js +251 -0
  462. package/dist/utils/tools-manager.js.map +1 -0
  463. package/docs/compaction.md +392 -0
  464. package/docs/custom-provider.md +592 -0
  465. package/docs/development.md +69 -0
  466. package/docs/extensions.md +2023 -0
  467. package/docs/images/doom-extension.png +0 -0
  468. package/docs/images/exy.png +0 -0
  469. package/docs/images/interactive-mode.png +0 -0
  470. package/docs/images/tree-view.png +0 -0
  471. package/docs/json.md +79 -0
  472. package/docs/keybindings.md +182 -0
  473. package/docs/models.md +297 -0
  474. package/docs/packages.md +209 -0
  475. package/docs/prompt-templates.md +67 -0
  476. package/docs/providers.md +188 -0
  477. package/docs/rpc.md +1354 -0
  478. package/docs/sdk.md +968 -0
  479. package/docs/session.md +412 -0
  480. package/docs/settings.md +225 -0
  481. package/docs/shell-aliases.md +13 -0
  482. package/docs/skills.md +231 -0
  483. package/docs/terminal-setup.md +95 -0
  484. package/docs/termux.md +127 -0
  485. package/docs/themes.md +295 -0
  486. package/docs/tmux.md +61 -0
  487. package/docs/tree.md +228 -0
  488. package/docs/tui.md +887 -0
  489. package/docs/windows.md +17 -0
  490. package/examples/README.md +25 -0
  491. package/examples/extensions/README.md +205 -0
  492. package/examples/extensions/antigravity-image-gen.ts +415 -0
  493. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  494. package/examples/extensions/bash-spawn-hook.ts +30 -0
  495. package/examples/extensions/bookmark.ts +50 -0
  496. package/examples/extensions/built-in-tool-renderer.ts +246 -0
  497. package/examples/extensions/claude-rules.ts +86 -0
  498. package/examples/extensions/commands.ts +72 -0
  499. package/examples/extensions/confirm-destructive.ts +59 -0
  500. package/examples/extensions/custom-compaction.ts +114 -0
  501. package/examples/extensions/custom-footer.ts +64 -0
  502. package/examples/extensions/custom-header.ts +73 -0
  503. package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
  504. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  505. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  506. package/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
  507. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  508. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  509. package/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
  510. package/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
  511. package/examples/extensions/dirty-repo-guard.ts +56 -0
  512. package/examples/extensions/doom-overlay/README.md +46 -0
  513. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  514. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  515. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  516. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  517. package/examples/extensions/doom-overlay/doom-component.ts +132 -0
  518. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  519. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  520. package/examples/extensions/doom-overlay/index.ts +74 -0
  521. package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  522. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  523. package/examples/extensions/dynamic-resources/dynamic.json +79 -0
  524. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  525. package/examples/extensions/dynamic-resources/index.ts +15 -0
  526. package/examples/extensions/dynamic-tools.ts +74 -0
  527. package/examples/extensions/event-bus.ts +43 -0
  528. package/examples/extensions/file-trigger.ts +41 -0
  529. package/examples/extensions/git-checkpoint.ts +53 -0
  530. package/examples/extensions/handoff.ts +150 -0
  531. package/examples/extensions/hello.ts +25 -0
  532. package/examples/extensions/inline-bash.ts +94 -0
  533. package/examples/extensions/input-transform.ts +43 -0
  534. package/examples/extensions/interactive-shell.ts +196 -0
  535. package/examples/extensions/mac-system-theme.ts +47 -0
  536. package/examples/extensions/message-renderer.ts +59 -0
  537. package/examples/extensions/minimal-mode.ts +426 -0
  538. package/examples/extensions/modal-editor.ts +85 -0
  539. package/examples/extensions/model-status.ts +31 -0
  540. package/examples/extensions/notify.ts +55 -0
  541. package/examples/extensions/overlay-qa-tests.ts +1348 -0
  542. package/examples/extensions/overlay-test.ts +150 -0
  543. package/examples/extensions/permission-gate.ts +34 -0
  544. package/examples/extensions/pirate.ts +47 -0
  545. package/examples/extensions/plan-mode/README.md +65 -0
  546. package/examples/extensions/plan-mode/index.ts +340 -0
  547. package/examples/extensions/plan-mode/utils.ts +168 -0
  548. package/examples/extensions/preset.ts +398 -0
  549. package/examples/extensions/protected-paths.ts +30 -0
  550. package/examples/extensions/provider-payload.ts +14 -0
  551. package/examples/extensions/qna.ts +119 -0
  552. package/examples/extensions/question.ts +264 -0
  553. package/examples/extensions/questionnaire.ts +427 -0
  554. package/examples/extensions/rainbow-editor.ts +88 -0
  555. package/examples/extensions/reload-runtime.ts +37 -0
  556. package/examples/extensions/rpc-demo.ts +124 -0
  557. package/examples/extensions/sandbox/index.ts +318 -0
  558. package/examples/extensions/sandbox/package-lock.json +92 -0
  559. package/examples/extensions/sandbox/package.json +19 -0
  560. package/examples/extensions/send-user-message.ts +97 -0
  561. package/examples/extensions/session-name.ts +27 -0
  562. package/examples/extensions/shutdown-command.ts +63 -0
  563. package/examples/extensions/snake.ts +343 -0
  564. package/examples/extensions/space-invaders.ts +560 -0
  565. package/examples/extensions/ssh.ts +220 -0
  566. package/examples/extensions/status-line.ts +40 -0
  567. package/examples/extensions/subagent/README.md +172 -0
  568. package/examples/extensions/subagent/agents/planner.md +37 -0
  569. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  570. package/examples/extensions/subagent/agents/scout.md +50 -0
  571. package/examples/extensions/subagent/agents/worker.md +24 -0
  572. package/examples/extensions/subagent/agents.ts +126 -0
  573. package/examples/extensions/subagent/index.ts +964 -0
  574. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  575. package/examples/extensions/subagent/prompts/implement.md +10 -0
  576. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  577. package/examples/extensions/summarize.ts +195 -0
  578. package/examples/extensions/system-prompt-header.ts +17 -0
  579. package/examples/extensions/timed-confirm.ts +70 -0
  580. package/examples/extensions/titlebar-spinner.ts +58 -0
  581. package/examples/extensions/todo.ts +299 -0
  582. package/examples/extensions/tool-override.ts +143 -0
  583. package/examples/extensions/tools.ts +146 -0
  584. package/examples/extensions/trigger-compact.ts +40 -0
  585. package/examples/extensions/truncated-tool.ts +192 -0
  586. package/examples/extensions/widget-placement.ts +17 -0
  587. package/examples/extensions/with-deps/index.ts +32 -0
  588. package/examples/extensions/with-deps/package-lock.json +31 -0
  589. package/examples/extensions/with-deps/package.json +22 -0
  590. package/examples/rpc-extension-ui.ts +632 -0
  591. package/examples/sdk/01-minimal.ts +22 -0
  592. package/examples/sdk/02-custom-model.ts +49 -0
  593. package/examples/sdk/03-custom-prompt.ts +55 -0
  594. package/examples/sdk/04-skills.ts +46 -0
  595. package/examples/sdk/05-tools.ts +56 -0
  596. package/examples/sdk/06-extensions.ts +88 -0
  597. package/examples/sdk/07-context-files.ts +40 -0
  598. package/examples/sdk/08-prompt-templates.ts +47 -0
  599. package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
  600. package/examples/sdk/10-settings.ts +51 -0
  601. package/examples/sdk/11-sessions.ts +48 -0
  602. package/examples/sdk/12-full-control.ts +82 -0
  603. package/examples/sdk/README.md +144 -0
  604. package/package.json +99 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,3045 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Fixed
6
+
7
+ - Fixed interactive input fields backed by the TUI `Input` component to scroll by visual column width for wide Unicode text (CJK, fullwidth characters), preventing rendered line overflow and TUI crashes in places like search and filter inputs ([#1982](https://github.com/badlogic/pi-mono/issues/1982))
8
+
9
+ ## [0.57.1] - 2026-03-07
10
+
11
+ ### New Features
12
+ - Tree branch folding and segment-jump navigation in `/tree`, with `Ctrl+←`/`Ctrl+→` and `Alt+←`/`Alt+→` shortcuts while `←`/`→` and `Page Up`/`Page Down` remain available for paging. See [docs/tree.md](docs/tree.md) and [docs/keybindings.md](docs/keybindings.md).
13
+ - `session_directory` extension event for customizing session directory paths before session manager creation. See [docs/extensions.md](docs/extensions.md).
14
+ - Digit keybindings (`0-9`) in the TUI keybinding system, including modified combos like `ctrl+1`. See [docs/keybindings.md](docs/keybindings.md).
15
+
16
+ ### Added
17
+ - Added `/tree` branch folding and segment-jump navigation with `Ctrl+←`/`Ctrl+→` and `Alt+←`/`Alt+→`, while keeping `←`/`→` and `Page Up`/`Page Down` for paging ([#1724](https://github.com/badlogic/pi-mono/pull/1724) by [@Perlence](https://github.com/Perlence))
18
+ - Added `session_directory` extension event that fires before session manager creation, allowing extensions to customize the session directory path based on cwd and other factors. CLI `--session-dir` flag takes precedence over extension-provided paths ([#1730](https://github.com/badlogic/pi-mono/pull/1730) by [@hjanuschka](https://github.com/hjanuschka)).
19
+ - Added digit keys (`0-9`) to the keybinding system, including Kitty CSI-u and xterm `modifyOtherKeys` support for bindings like `ctrl+1` ([#1905](https://github.com/badlogic/pi-mono/issues/1905))
20
+
21
+ ### Fixed
22
+ - Fixed custom tool collapsed/expanded rendering in HTML exports. Custom tools that define different collapsed vs expanded displays now render correctly in exported HTML, with expandable sections when both states differ and direct display when only expanded exists ([#1934](https://github.com/badlogic/pi-mono/pull/1934) by [@aliou](https://github.com/aliou))
23
+ - Fixed tmux startup guidance and keyboard setup warnings for modified key handling, including Ghostty `shift+enter=text:\n` remap guidance and tmux `extended-keys-format` detection ([#1872](https://github.com/badlogic/pi-mono/issues/1872))
24
+ - Fixed z.ai context overflow recovery so `model_context_window_exceeded` errors trigger auto-compaction instead of surfacing as unhandled stop reason failures ([#1937](https://github.com/badlogic/pi-mono/issues/1937))
25
+ - Fixed autocomplete selection ignoring typed text: highlight now follows the first prefix match as the user types, and exact matches are always selected on Enter ([#1931](https://github.com/badlogic/pi-mono/pull/1931) by [@aliou](https://github.com/aliou))
26
+ - Fixed slash-command Tab completion to immediately open argument completions when available ([#1481](https://github.com/badlogic/pi-mono/pull/1481) by [@barapa](https://github.com/barapa))
27
+ - Fixed explicit `pi -e <path>` extensions losing command and tool conflicts to discovered extensions by giving CLI-loaded extensions higher precedence ([#1896](https://github.com/badlogic/pi-mono/issues/1896))
28
+ - Fixed Windows external editor launch for `Ctrl+G` and `ctx.ui.editor()` so shell-based commands like `EDITOR="code --wait"` work correctly ([#1925](https://github.com/badlogic/pi-mono/issues/1925))
29
+
30
+ ## [0.57.0] - 2026-03-07
31
+
32
+ ### New Features
33
+
34
+ - Extensions can intercept and modify provider request payloads via `before_provider_request`. See [docs/extensions.md#before_provider_request](docs/extensions.md#before_provider_request).
35
+ - Extension UIs can use non-capturing overlays with explicit focus control via `OverlayOptions.nonCapturing` and `OverlayHandle.focus()` / `unfocus()` / `isFocused()`. See [docs/extensions.md](docs/extensions.md) and [../tui/README.md](../tui/README.md).
36
+ - RPC mode now uses strict LF-only JSONL framing for robust payload handling. See [docs/rpc.md](docs/rpc.md).
37
+
38
+ ### Breaking Changes
39
+
40
+ - RPC mode now uses strict LF-delimited JSONL framing. Clients must split records on `\n` only instead of using generic line readers such as Node `readline`, which also split on Unicode separators inside JSON payloads ([#1911](https://github.com/badlogic/pi-mono/issues/1911))
41
+
42
+ ### Added
43
+
44
+ - Added `before_provider_request` extension hook so extensions can inspect or replace provider payloads before requests are sent, with an example in `examples/extensions/provider-payload.ts`
45
+ - Added non-capturing overlay focus control for extension UIs via `OverlayOptions.nonCapturing` and `OverlayHandle.focus()` / `unfocus()` / `isFocused()` ([#1916](https://github.com/badlogic/pi-mono/pull/1916) by [@nicobailon](https://github.com/nicobailon))
46
+
47
+ ### Changed
48
+
49
+ - Overlay compositing in extension UIs now uses focus order so focused overlays render on top while preserving stack semantics for show/hide behavior ([#1916](https://github.com/badlogic/pi-mono/pull/1916) by [@nicobailon](https://github.com/nicobailon))
50
+
51
+ ### Fixed
52
+
53
+ - Fixed RPC mode stdin/stdout framing to use strict LF-delimited JSONL instead of `readline`, so payloads containing `U+2028` or `U+2029` no longer corrupt command or event streams ([#1911](https://github.com/badlogic/pi-mono/issues/1911))
54
+ - Fixed automatic overlay focus restoration in extension UIs to skip non-capturing overlays, and fixed overlay hide behavior to only reassign focus when the hidden overlay had focus ([#1916](https://github.com/badlogic/pi-mono/pull/1916) by [@nicobailon](https://github.com/nicobailon))
55
+ - Fixed `pi config` misclassifying `~/.agents/skills` as project-scoped in non-git directories under `$HOME`, so toggling those skills no longer writes project overrides to `.pi/settings.json` ([#1915](https://github.com/badlogic/pi-mono/issues/1915))
56
+
57
+ ## [0.56.3] - 2026-03-06
58
+
59
+ ### New Features
60
+
61
+ - `claude-sonnet-4-6` model available via the `google-antigravity` provider ([#1859](https://github.com/badlogic/pi-mono/issues/1859))
62
+ - Custom editors can now define their own `onEscape`/`onCtrlD` handlers without being overwritten by app defaults, enabling vim-mode extensions ([#1838](https://github.com/badlogic/pi-mono/issues/1838))
63
+ - Shift+Enter and Ctrl+Enter now work inside tmux via xterm modifyOtherKeys fallback ([docs/tmux.md](docs/tmux.md), [#1872](https://github.com/badlogic/pi-mono/issues/1872))
64
+ - Auto-compaction is now resilient to persistent API errors (e.g. 529 overloaded) and no longer retriggers spuriously after compaction ([#1834](https://github.com/badlogic/pi-mono/issues/1834), [#1860](https://github.com/badlogic/pi-mono/issues/1860))
65
+
66
+ ### Added
67
+
68
+ - Added `claude-sonnet-4-6` model for the `google-antigravity` provider ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
69
+ - Added [tmux setup documentation](docs/tmux.md) for modified enter key support ([#1872](https://github.com/badlogic/pi-mono/issues/1872))
70
+
71
+ ### Fixed
72
+
73
+ - Fixed custom editors having their `onEscape`/`onCtrlD` handlers unconditionally overwritten by app-level defaults, making vim-style escape handling impossible ([#1838](https://github.com/badlogic/pi-mono/issues/1838))
74
+ - Fixed auto-compaction retriggering on the first prompt after compaction due to stale pre-compaction assistant usage ([#1860](https://github.com/badlogic/pi-mono/issues/1860) by [@joelhooks](https://github.com/joelhooks))
75
+ - Fixed sessions never auto-compacting when hitting persistent API errors (e.g. 529 overloaded) by estimating context size from the last successful response ([#1834](https://github.com/badlogic/pi-mono/issues/1834))
76
+ - Fixed compaction summarization requests exceeding context limits by truncating tool results to 2k chars ([#1796](https://github.com/badlogic/pi-mono/issues/1796))
77
+ - Fixed `/new` leaving startup header content, including the changelog, visible after starting a fresh session ([#1880](https://github.com/badlogic/pi-mono/issues/1880))
78
+ - Fixed misleading docs and example implying that returning `{ isError: true }` from a tool's `execute` function marks the execution as failed; errors must be signaled by throwing ([#1881](https://github.com/badlogic/pi-mono/issues/1881))
79
+ - Fixed model switches through non-reasoning models to preserve the saved default thinking level instead of persisting a capability-forced `off` clamp ([#1864](https://github.com/badlogic/pi-mono/issues/1864))
80
+ - Fixed parallel pi processes failing with false "No API key found" errors due to immediate lockfile contention on `auth.json` and `settings.json` ([#1871](https://github.com/badlogic/pi-mono/issues/1871))
81
+ - Fixed OpenAI Responses reasoning replay regression that broke multi-turn reasoning continuity ([#1878](https://github.com/badlogic/pi-mono/issues/1878))
82
+
83
+ ## [0.56.2] - 2026-03-05
84
+
85
+ ### New Features
86
+
87
+ - GPT-5.4 support across `openai`, `openai-codex`, `azure-openai-responses`, and `opencode`, with `gpt-5.4` now the default for `openai` and `openai-codex` ([README.md](README.md), [docs/providers.md](docs/providers.md)).
88
+ - `treeFilterMode` setting to choose the default `/tree` filter mode (`default`, `no-tools`, `user-only`, `labeled-only`, `all`) ([docs/settings.md](docs/settings.md), [#1852](https://github.com/badlogic/pi-mono/pull/1852) by [@lajarre](https://github.com/lajarre)).
89
+ - Mistral native conversations integration with SDK-backed provider behavior, preserving Mistral-specific thinking and replay semantics ([README.md](README.md), [docs/providers.md](docs/providers.md), [#1716](https://github.com/badlogic/pi-mono/issues/1716)).
90
+
91
+ ### Added
92
+
93
+ - Added `gpt-5.4` model availability for `openai`, `openai-codex`, `azure-openai-responses`, and `opencode` providers.
94
+ - Added `gpt-5.3-codex` fallback model availability for `github-copilot` until upstream model catalogs include it ([#1853](https://github.com/badlogic/pi-mono/issues/1853)).
95
+ - Added `treeFilterMode` setting to choose the default `/tree` filter mode (`default`, `no-tools`, `user-only`, `labeled-only`, `all`) ([#1852](https://github.com/badlogic/pi-mono/pull/1852) by [@lajarre](https://github.com/lajarre)).
96
+
97
+ ### Changed
98
+
99
+ - Updated the default models for the `openai` and `openai-codex` providers to `gpt-5.4`.
100
+
101
+ ### Fixed
102
+
103
+ - Fixed GPT-5.3 Codex follow-up turns dropping OpenAI Responses assistant `phase` metadata by preserving replayable signatures in session history and forwarding `phase` back to the Responses API ([#1819](https://github.com/badlogic/pi-mono/issues/1819)).
104
+ - Fixed OpenAI Responses replay to omit empty thinking blocks, avoiding invalid no-op reasoning items in follow-up turns.
105
+ - Updated Mistral integration to use the native SDK-backed provider and conversations API, including coding-agent model/provider wiring and Mistral setup documentation ([#1716](https://github.com/badlogic/pi-mono/issues/1716)).
106
+ - Fixed Antigravity reliability: endpoint cascade on 403/404, added autopush sandbox fallback, removed extra fingerprint headers ([#1830](https://github.com/badlogic/pi-mono/issues/1830)).
107
+ - Fixed `@mariozechner/pi-ai/oauth` extension imports in published installs by resolving the subpath directly from built `dist` files instead of package-root wrapper shims ([#1856](https://github.com/badlogic/pi-mono/issues/1856)).
108
+ - Fixed Gemini 3 multi-turn tool use losing structured context by using `skip_thought_signature_validator` sentinel for unsigned function calls instead of text fallback ([#1829](https://github.com/badlogic/pi-mono/issues/1829)).
109
+ - Fixed model selector filter not accepting typed characters in VS Code 1.110+ due to missing Kitty CSI-u printable decoding in the `Input` component ([#1857](https://github.com/badlogic/pi-mono/issues/1857))
110
+ - Fixed editor/footer visibility drift during terminal resize by forcing full redraws when terminal width or height changes ([#1844](https://github.com/badlogic/pi-mono/pull/1844) by [@ghoulr](https://github.com/ghoulr)).
111
+ - Fixed footer width truncation for wide Unicode text (session name, model, provider) to prevent TUI crashes from rendered lines exceeding terminal width ([#1833](https://github.com/badlogic/pi-mono/issues/1833)).
112
+ - Fixed Windows write preview background artifacts by normalizing CRLF content (`\r\n`) to LF for display rendering in tool output previews ([#1854](https://github.com/badlogic/pi-mono/issues/1854)).
113
+
114
+ ## [0.56.1] - 2026-03-05
115
+
116
+ ### Fixed
117
+
118
+ - Fixed extension alias fallback resolution to use ESM-aware resolution for `jiti` aliases in global installs ([#1821](https://github.com/badlogic/pi-mono/pull/1821) by [@Perlence](https://github.com/Perlence))
119
+ - Fixed markdown blockquote rendering to isolate blockquote styling from default text style, preventing style leakage.
120
+
121
+ ## [0.56.0] - 2026-03-04
122
+
123
+ ### New Features
124
+
125
+ - Added OpenCode Go provider support with `opencode-go` model defaults and `OPENCODE_API_KEY` environment variable support ([docs/providers.md](docs/providers.md), [#1757](https://github.com/badlogic/pi-mono/issues/1757)).
126
+ - Added `branchSummary.skipPrompt` setting to skip branch summarization prompts during tree navigation ([docs/settings.md](docs/settings.md), [#1792](https://github.com/badlogic/pi-mono/issues/1792)).
127
+ - Added `gemini-3.1-flash-lite-preview` fallback model availability for Google provider catalogs when upstream model metadata lags ([README.md](README.md), [#1785](https://github.com/badlogic/pi-mono/issues/1785)).
128
+
129
+ ### Breaking Changes
130
+
131
+ - Changed scoped model thinking semantics. Scoped entries without an explicit `:<thinking>` suffix now inherit the current session thinking level when selected, instead of applying a startup-captured default.
132
+ - Moved Node OAuth runtime exports off the top-level `@mariozechner/pi-ai` entry. OAuth login and refresh must be imported from `@mariozechner/pi-ai/oauth` ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
133
+
134
+ ### Added
135
+
136
+ - Added `branchSummary.skipPrompt` setting to skip the summary prompt when navigating branches ([#1792](https://github.com/badlogic/pi-mono/issues/1792)).
137
+ - Added OpenCode Go provider support with `opencode-go` model defaults and `OPENCODE_API_KEY` environment variable support ([#1757](https://github.com/badlogic/pi-mono/issues/1757)).
138
+ - Added `gemini-3.1-flash-lite-preview` fallback model availability in provider catalogs when upstream catalogs lag ([#1785](https://github.com/badlogic/pi-mono/issues/1785)).
139
+
140
+ ### Changed
141
+
142
+ - Updated Antigravity Gemini 3.1 model metadata and request headers to match upstream behavior.
143
+
144
+ ### Fixed
145
+
146
+ - Fixed IME hardware cursor positioning in the custom extension editor (`ctx.ui.editor()` / extension editor dialog) by propagating focus to the internal `Editor`, preventing the terminal cursor from getting stuck at the bottom-right during composition.
147
+ - Added OSC 133 semantic zone markers around rendered user messages to support terminal navigation between prompts in iTerm2, WezTerm, Kitty, Ghostty, and other compatible terminals ([#1805](https://github.com/badlogic/pi-mono/issues/1805)).
148
+ - Fixed markdown blockquotes dropping nested list content in the TUI renderer ([#1787](https://github.com/badlogic/pi-mono/issues/1787)).
149
+ - Fixed TUI width handling for regional indicator symbols to prevent wrap drift and stale characters during streaming ([#1783](https://github.com/badlogic/pi-mono/issues/1783)).
150
+ - Fixed Kitty CSI-u handling to ignore unsupported modifiers so modifier-only events do not insert printable characters ([#1807](https://github.com/badlogic/pi-mono/issues/1807)).
151
+ - Fixed single-line paste handling to insert text atomically and avoid repeated `@` autocomplete scans on large pastes ([#1812](https://github.com/badlogic/pi-mono/issues/1812)).
152
+ - Fixed extension loading with the new `@mariozechner/pi-ai/oauth` export path by aliasing the oauth subpath in the extension loader and development path mapping ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
153
+ - Fixed browser-safe provider loading regressions by preloading the Bedrock provider module in compiled Bun binaries and rebuilding binaries against fresh workspace dependencies ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
154
+ - Fixed GNU screen terminal detection by downgrading theme output to 256-color mode for `screen*` TERM values ([#1809](https://github.com/badlogic/pi-mono/issues/1809)).
155
+ - Fixed branch summarization queue handling so messages typed while summaries are generated are processed correctly ([#1803](https://github.com/badlogic/pi-mono/issues/1803)).
156
+ - Fixed compaction summary requests to avoid reasoning output for non-reasoning models ([#1793](https://github.com/badlogic/pi-mono/issues/1793)).
157
+ - Fixed overflow auto-compaction cascades so a single overflow does not trigger repeated compaction loops.
158
+ - Fixed `models.json` to allow provider-scoped custom model ids and model-level `baseUrl` overrides ([#1759](https://github.com/badlogic/pi-mono/issues/1759), [#1777](https://github.com/badlogic/pi-mono/issues/1777)).
159
+ - Fixed session selector display sanitization by stripping control characters from session display text ([#1747](https://github.com/badlogic/pi-mono/issues/1747)).
160
+ - Fixed Groq Qwen3 reasoning effort mapping for OpenAI-compatible models ([#1745](https://github.com/badlogic/pi-mono/issues/1745)).
161
+ - Fixed Bedrock `AWS_PROFILE` region resolution by honoring profile `region` values ([#1800](https://github.com/badlogic/pi-mono/issues/1800)).
162
+ - Fixed Gemini 3.1 thinking-level detection for `google` and `google-vertex` providers ([#1785](https://github.com/badlogic/pi-mono/issues/1785)).
163
+ - Fixed browser bundling compatibility for `@mariozechner/pi-ai` by removing Node-only side effects from default browser import paths ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
164
+ ## [0.55.4] - 2026-03-02
165
+
166
+ ### New Features
167
+
168
+ - Runtime tool registration now applies immediately in active sessions. Tools registered via `pi.registerTool()` after startup are available to `pi.getAllTools()` and the LLM without `/reload` ([docs/extensions.md](docs/extensions.md), [examples/extensions/dynamic-tools.ts](examples/extensions/dynamic-tools.ts), [#1720](https://github.com/badlogic/pi-mono/issues/1720)).
169
+ - Tool definitions can customize the default system prompt with `promptSnippet` (`Available tools`) and `promptGuidelines` (`Guidelines`) while the tool is active ([docs/extensions.md](docs/extensions.md), [#1720](https://github.com/badlogic/pi-mono/issues/1720)).
170
+ - Custom tool renderers can suppress transcript output without leaving extra spacing or empty transcript footprint in interactive rendering ([docs/extensions.md](docs/extensions.md), [#1719](https://github.com/badlogic/pi-mono/pull/1719)).
171
+
172
+ ### Added
173
+
174
+ - Added optional `promptSnippet` to `ToolDefinition` for one-line entries in the default system prompt's `Available tools` section. Active extension tools appear there when registered and active ([#1237](https://github.com/badlogic/pi-mono/pull/1237) by [@semtexzv](https://github.com/semtexzv)).
175
+ - Added optional `promptGuidelines` to `ToolDefinition` so active tools can append tool-specific bullets to the default system prompt `Guidelines` section ([#1720](https://github.com/badlogic/pi-mono/issues/1720)).
176
+
177
+ ### Fixed
178
+
179
+ - Fixed `pi.registerTool()` dynamic registration after session initialization. Tools registered in `session_start` and later handlers now refresh immediately, become active, and are visible to the LLM without `/reload` ([#1720](https://github.com/badlogic/pi-mono/issues/1720))
180
+ - Fixed session message persistence ordering by serializing `AgentSession` event processing, preventing `toolResult` entries from being written before their corresponding assistant tool-call messages when extension handlers are asynchronous ([#1717](https://github.com/badlogic/pi-mono/issues/1717))
181
+ - Fixed spacing artifacts when custom tool renderers intentionally suppress per-call transcript output, including extra blank rows in interactive streaming and non-zero transcript footprint for empty custom renders ([#1719](https://github.com/badlogic/pi-mono/pull/1719) by [@alasano](https://github.com/alasano))
182
+ - Fixed `session.prompt()` returning before retry completion by creating the retry promise synchronously at `agent_end` dispatch, which closes a race when earlier queued event handlers are async ([#1726](https://github.com/badlogic/pi-mono/pull/1726) by [@pasky](https://github.com/pasky))
183
+
184
+ ## [0.55.3] - 2026-02-27
185
+
186
+ ### Fixed
187
+
188
+ - Changed the default image paste keybinding on Windows to `alt+v` to avoid `ctrl+v` conflicts with terminal paste behavior ([#1682](https://github.com/badlogic/pi-mono/pull/1682) by [@mrexodia](https://github.com/mrexodia)).
189
+
190
+ ## [0.55.2] - 2026-02-27
191
+
192
+ ### New Features
193
+
194
+ - Extensions can dynamically remove custom providers via `pi.unregisterProvider(name)`, restoring any built-in models that were overridden, without requiring `/reload` ([docs](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/custom-provider.md)).
195
+ - `pi.registerProvider()` now takes effect immediately when called outside the initial extension load phase (e.g. from a command handler), removing the need for `/reload` after late registrations.
196
+
197
+ ### Added
198
+
199
+ - `pi.unregisterProvider(name)` removes a dynamically registered provider and its models from the registry without requiring `/reload`. Built-in models that were overridden by the provider are restored ([#1669](https://github.com/badlogic/pi-mono/pull/1669) by [@aliou](https://github.com/aliou)).
200
+
201
+ ### Fixed
202
+
203
+ - `pi.registerProvider()` now takes effect immediately when called after the initial extension load phase (e.g. from a command handler). Previously the registration sat in a pending queue that was never flushed until the next `/reload` ([#1669](https://github.com/badlogic/pi-mono/pull/1669) by [@aliou](https://github.com/aliou)).
204
+ - Fixed duplicate session headers when forking from a point before any assistant message. `createBranchedSession` now defers file creation to `_persist()` when the branched path has no assistant message, matching the `newSession()` contract ([#1672](https://github.com/badlogic/pi-mono/pull/1672) by [@w-winter](https://github.com/w-winter)).
205
+ - Fixed SIGINT being delivered to pi while the process is suspended (e.g. via `ctrl+z`), which could corrupt terminal state on resume ([#1668](https://github.com/badlogic/pi-mono/pull/1668) by [@aliou](https://github.com/aliou)).
206
+ - Fixed Z.ai thinking control using wrong parameter name, causing thinking to always be enabled and wasting tokens/latency ([#1674](https://github.com/badlogic/pi-mono/pull/1674) by [@okuyam2y](https://github.com/okuyam2y))
207
+ - Fixed `redacted_thinking` blocks being silently dropped during Anthropic streaming, and related issues with interleaved-thinking beta headers and temperature being sent alongside extended thinking ([#1665](https://github.com/badlogic/pi-mono/pull/1665) by [@tctev](https://github.com/tctev))
208
+ - Fixed `(external, cli)` user-agent flag causing 401 errors on Anthropic setup-token endpoint ([#1677](https://github.com/badlogic/pi-mono/pull/1677) by [@LazerLance777](https://github.com/LazerLance777))
209
+ - Fixed crash when OpenAI-compatible provider returns a chunk with no `choices` array ([#1671](https://github.com/badlogic/pi-mono/issues/1671))
210
+
211
+ ## [0.55.1] - 2026-02-26
212
+
213
+ ### New Features
214
+
215
+ - Added offline startup mode via `--offline` (or `PI_OFFLINE`) to disable startup network operations, with startup network timeouts to avoid hangs in restricted or offline environments.
216
+ - Added `gemini-3.1-pro-preview` model support to the `google-gemini-cli` provider ([#1599](https://github.com/badlogic/pi-mono/pull/1599) by [@audichuang](https://github.com/audichuang)).
217
+
218
+ ### Fixed
219
+
220
+ - Fixed offline startup hangs by adding offline startup behavior and network timeouts during managed tool setup ([#1631](https://github.com/badlogic/pi-mono/pull/1631) by [@mcollina](https://github.com/mcollina))
221
+ - Fixed Windows VT input initialization in ESM by loading koffi via createRequire, avoiding runtime and bundling issues in end-user environments ([#1627](https://github.com/badlogic/pi-mono/pull/1627) by [@kaste](https://github.com/kaste))
222
+ - Fixed managed `fd`/`rg` bootstrap on Windows in Git Bash by using `extract-zip` for `.zip` archives, searching extracted layouts more robustly, and isolating extraction temp directories to avoid concurrent download races ([#1348](https://github.com/badlogic/pi-mono/issues/1348))
223
+ - Fixed extension loading on Windows when resolving `@sinclair/typebox` aliases so subpath imports like `@sinclair/typebox/compiler` resolve correctly.
224
+ - Fixed adaptive thinking for Claude Sonnet 4.6 in Anthropic and Bedrock providers, and clamped unsupported `xhigh` effort values to supported levels ([#1548](https://github.com/badlogic/pi-mono/pull/1548) by [@tctev](https://github.com/tctev))
225
+ - Fixed Vertex ADC credential detection race by avoiding caching a false negative during async import initialization ([#1550](https://github.com/badlogic/pi-mono/pull/1550) by [@jeremiahgaylord-web](https://github.com/jeremiahgaylord-web))
226
+ - Fixed subagent extension example to resolve user agents from the configured agent directory instead of hardcoded paths ([#1559](https://github.com/badlogic/pi-mono/pull/1559) by [@tianshuwang](https://github.com/tianshuwang))
227
+
228
+ ## [0.55.0] - 2026-02-24
229
+
230
+ ### Breaking Changes
231
+
232
+ - Resource precedence for extensions, skills, prompts, themes, and slash-command name collisions is now project-first (`cwd/.pi`) before user-global (`~/.pi/agent`). If you relied on global resources overriding project resources with the same names, rename or reorder your resources.
233
+ - Extension registration conflicts no longer unload the entire later extension. All extensions stay loaded, and conflicting command/tool/flag names are resolved by first registration in load order.
234
+
235
+ ## [0.54.2] - 2026-02-23
236
+
237
+ ### Fixed
238
+
239
+ - Fixed `.pi` folder being created unnecessarily when only reading settings. The folder is now only created when writing project-specific settings.
240
+ - Fixed extension-driven runtime theme changes to persist in settings so `/settings` reflects the active `currentTheme` after `ctx.ui.setTheme(...)` ([#1483](https://github.com/badlogic/pi-mono/pull/1483) by [@ferologics](https://github.com/ferologics))
241
+ - Fixed interactive mode freezes during large streaming `write` tool calls by using incremental syntax highlighting while partial arguments stream, with a final full re-highlight after tool-call arguments complete.
242
+
243
+ ## [0.54.1] - 2026-02-22
244
+
245
+ ### Fixed
246
+
247
+ - Externalized koffi from bun binary builds, reducing archive sizes by ~15MB per platform (e.g. darwin-arm64: 43MB -> 28MB). Koffi's Windows-only `.node` file is now shipped alongside the Windows binary only.
248
+
249
+ ## [0.54.0] - 2026-02-19
250
+
251
+ ### Added
252
+
253
+ - Added default skill auto-discovery for `.agents/skills` locations. Pi now discovers project skills from `.agents/skills` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo), and global skills from `~/.agents/skills`, in addition to existing `.pi` skill paths.
254
+
255
+ ## [0.53.1] - 2026-02-19
256
+
257
+ ### Changed
258
+
259
+ - Added Gemini 3.1 model catalog entries for all built-in providers that currently expose it: `google`, `google-vertex`, `opencode`, `openrouter`, and `vercel-ai-gateway`.
260
+ - Added Claude Opus 4.6 Thinking to the `google-antigravity` model catalog.
261
+
262
+ ## [0.53.0] - 2026-02-17
263
+
264
+ ### Breaking Changes
265
+
266
+ - `SettingsManager` persistence semantics changed for SDK consumers. Setters now update in-memory state immediately and queue disk writes. Code that requires durable on-disk settings must call `await settingsManager.flush()`.
267
+ - `AuthStorage` constructor is no longer public. Use static factories (`AuthStorage.create(...)`, `AuthStorage.fromStorage(...)`, `AuthStorage.inMemory(...)`). This breaks code that used `new AuthStorage(...)` directly.
268
+
269
+ ### Added
270
+
271
+ - Added `SettingsManager.drainErrors()` for caller-controlled settings I/O error handling without manager-side console output.
272
+ - Added auth storage backends (`FileAuthStorageBackend`, `InMemoryAuthStorageBackend`) and `AuthStorage.fromStorage(...)` for storage-first auth persistence wiring.
273
+ - Added Anthropic `claude-sonnet-4-6` model fallback entry to generated model definitions.
274
+
275
+ ### Changed
276
+
277
+ - `SettingsManager` now uses scoped storage abstraction with per-scope locked read/merge/write persistence for global and project settings.
278
+
279
+ ### Fixed
280
+
281
+ - Fixed project settings persistence to preserve unrelated external edits via merge-on-write, while still applying in-memory changes for modified keys.
282
+ - Fixed auth credential persistence to preserve unrelated external edits to `auth.json` via locked read/merge/write updates.
283
+ - Fixed auth load/persist error surfacing by buffering errors and exposing them via `AuthStorage.drainErrors()`.
284
+
285
+ ## [0.52.12] - 2026-02-13
286
+
287
+ ### Added
288
+
289
+ - Added `transport` setting (`"sse"`, `"websocket"`, `"auto"`) to `/settings` and `settings.json` for providers that support multiple transports (currently `openai-codex` via OpenAI Codex Responses).
290
+
291
+ ### Changed
292
+
293
+ - Interactive mode now applies transport changes immediately to the active agent session.
294
+ - Settings migration now maps legacy `websockets: boolean` to the new `transport` setting.
295
+
296
+ ## [0.52.11] - 2026-02-13
297
+
298
+ ### Added
299
+
300
+ - Added MiniMax M2.5 model entries for `minimax`, `minimax-cn`, `openrouter`, and `vercel-ai-gateway` providers, plus `minimax-m2.5-free` for `opencode`.
301
+
302
+ ## [0.52.10] - 2026-02-12
303
+
304
+ ### New Features
305
+
306
+ - Extension terminal input interception via `terminal_input`, allowing extensions to consume or transform raw input before normal TUI handling. See [docs/extensions.md](docs/extensions.md).
307
+ - Expanded CLI model selection: `--model` now supports `provider/id`, fuzzy matching, and `:<thinking>` suffixes. See [README.md](README.md) and [docs/models.md](docs/models.md).
308
+ - Safer package source handling with stricter git source parsing and improved local path normalization. See [docs/packages.md](docs/packages.md).
309
+ - New built-in model definition `gpt-5.3-codex-spark` for OpenAI and OpenAI Codex providers.
310
+ - Improved OpenAI stream robustness for malformed trailing tool-call JSON in partial chunks.
311
+ - Added built-in GLM-5 model support via z.ai and OpenRouter provider catalogs.
312
+
313
+ ### Breaking Changes
314
+
315
+ - `ContextUsage.tokens` and `ContextUsage.percent` are now `number | null`. After compaction, context token count is unknown until the next LLM response, so these fields return `null`. Extensions that read `ContextUsage` must handle the `null` case. Removed `usageTokens`, `trailingTokens`, and `lastUsageIndex` fields from `ContextUsage` (implementation details that should not have been public) ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
316
+ - Git source parsing is now strict without `git:` prefix: only protocol URLs are treated as git (`https://`, `http://`, `ssh://`, `git://`). Shorthand sources like `github.com/org/repo` and `git@github.com:org/repo` now require the `git:` prefix. ([#1426](https://github.com/badlogic/pi-mono/issues/1426))
317
+
318
+ ### Added
319
+
320
+ - Added extension event forwarding for message and tool execution lifecycles (`message_start`, `message_update`, `message_end`, `tool_execution_start`, `tool_execution_update`, `tool_execution_end`) ([#1375](https://github.com/badlogic/pi-mono/pull/1375) by [@sumeet](https://github.com/sumeet))
321
+ - Added `terminal_input` extension event to intercept, consume, or transform raw terminal input before normal TUI handling.
322
+ - Added `gpt-5.3-codex-spark` model definition for OpenAI and OpenAI Codex providers (research preview).
323
+
324
+ ### Changed
325
+
326
+ - Routed GitHub Copilot Claude 4.x models through Anthropic Messages API, with updated Copilot header handling for Claude model requests.
327
+
328
+ ### Fixed
329
+
330
+ - Fixed context usage percentage in footer showing stale pre-compaction values. After compaction the footer now shows `?/200k` until the next LLM response provides accurate usage ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
331
+ - Fixed `_checkCompaction()` using the first compaction entry instead of the latest, which could cause incorrect overflow detection with multiple compactions ([#1382](https://github.com/badlogic/pi-mono/pull/1382) by [@ferologics](https://github.com/ferologics))
332
+ - `--model` now works without `--provider`, supports `provider/id` syntax, fuzzy matching, and `:<thinking>` suffix (e.g., `--model sonnet:high`, `--model openai/gpt-4o`) ([#1350](https://github.com/badlogic/pi-mono/pull/1350) by [@mitsuhiko](https://github.com/mitsuhiko))
333
+ - Fixed local package path normalization for extension sources while tightening git source parsing rules ([#1426](https://github.com/badlogic/pi-mono/issues/1426))
334
+ - Fixed extension terminal input listeners not being cleared during session resets, which could leave stale handlers active.
335
+ - Fixed Termux bootstrap package name for `fd` installation ([#1433](https://github.com/badlogic/pi-mono/pull/1433))
336
+ - Fixed `@` file autocomplete fuzzy matching to prioritize path-prefix and segment matches for nested paths ([#1423](https://github.com/badlogic/pi-mono/issues/1423))
337
+ - Fixed OpenAI streaming tool-call parsing to tolerate malformed trailing JSON in partial chunks ([#1424](https://github.com/badlogic/pi-mono/issues/1424))
338
+
339
+ ## [0.52.9] - 2026-02-08
340
+
341
+ ### New Features
342
+
343
+ - Extensions can trigger a full runtime reload via `ctx.reload()`, useful for hot-reloading configuration or restarting the agent. See [docs/extensions.md](docs/extensions.md) and the [`reload-runtime` example](examples/extensions/reload-runtime.ts) ([#1371](https://github.com/badlogic/pi-mono/issues/1371))
344
+ - Short CLI disable aliases: `-ne` (`--no-extensions`), `-ns` (`--no-skills`), and `-np` (`--no-prompt-templates`) for faster interactive usage and scripting.
345
+ - `/export` HTML now includes collapsible tool input schemas (parameter names, types, and descriptions), improving session review and sharing workflows ([#1416](https://github.com/badlogic/pi-mono/pull/1416) by [@marchellodev](https://github.com/marchellodev)).
346
+ - `pi.getAllTools()` now exposes tool parameters in addition to name and description, enabling richer extension integrations ([#1416](https://github.com/badlogic/pi-mono/pull/1416) by [@marchellodev](https://github.com/marchellodev)).
347
+
348
+ ### Added
349
+
350
+ - Added `ctx.reload()` to the extension API for programmatic runtime reload ([#1371](https://github.com/badlogic/pi-mono/issues/1371))
351
+ - Added short aliases for disable flags: `-ne` for `--no-extensions`, `-ns` for `--no-skills`, `-np` for `--no-prompt-templates`
352
+ - `/export` HTML now includes tool input schema (parameter names, types, descriptions) in a collapsible section under each tool ([#1416](https://github.com/badlogic/pi-mono/pull/1416) by [@marchellodev](https://github.com/marchellodev))
353
+ - `pi.getAllTools()` now returns tool parameters in addition to name and description ([#1416](https://github.com/badlogic/pi-mono/pull/1416) by [@marchellodev](https://github.com/marchellodev))
354
+
355
+ ### Fixed
356
+
357
+ - Fixed extension source parsing so dot-prefixed local paths (for example `.pi/extensions/foo.ts`) are treated as local paths instead of git URLs
358
+ - Fixed fd/rg download failing on Windows due to `unzip` not being available; now uses `tar` for both `.tar.gz` and `.zip` extraction, with proper error reporting ([#1348](https://github.com/badlogic/pi-mono/issues/1348))
359
+ - Fixed RPC mode documentation incorrectly stating `ctx.hasUI` is `false`; it is `true` because dialog and fire-and-forget UI methods work via the RPC sub-protocol. Also documented missing unsupported/degraded methods (`pasteToEditor`, `getAllThemes`, `getTheme`, `setTheme`) ([#1411](https://github.com/badlogic/pi-mono/pull/1411) by [@aliou](https://github.com/aliou))
360
+ - Fixed `rg` not available in bash tool by downloading it at startup alongside `fd` ([#1348](https://github.com/badlogic/pi-mono/issues/1348))
361
+ - Fixed `custom-compaction` example to use `ModelRegistry` ([#1387](https://github.com/badlogic/pi-mono/issues/1387))
362
+ - Google providers now support full JSON Schema in tool declarations (anyOf, oneOf, const, etc.) ([#1398](https://github.com/badlogic/pi-mono/issues/1398) by [@jarib](https://github.com/jarib))
363
+ - Reverted incorrect Antigravity model change: `claude-opus-4-6-thinking` back to `claude-opus-4-5-thinking` (model does not exist on Antigravity endpoint)
364
+ - Updated the Antigravity system instruction to a more compact version for Google Gemini CLI compatibility
365
+ - Corrected opencode context windows for Claude Sonnet 4 and 4.5 ([#1383](https://github.com/badlogic/pi-mono/issues/1383))
366
+ - Fixed subagent example unknown-agent errors to include available agent names ([#1414](https://github.com/badlogic/pi-mono/pull/1414) by [@dnouri](https://github.com/dnouri))
367
+
368
+ ## [0.52.8] - 2026-02-07
369
+
370
+ ### New Features
371
+
372
+ - Emacs-style kill ring (`ctrl+k`/`ctrl+y`/`alt+y`) and undo (`ctrl+z`) in the editor input ([#1373](https://github.com/badlogic/pi-mono/pull/1373) by [@Perlence](https://github.com/Perlence))
373
+ - OpenRouter `auto` model alias (`openrouter:auto`) for automatic model routing ([#1361](https://github.com/badlogic/pi-mono/pull/1361) by [@yogasanas](https://github.com/yogasanas))
374
+ - Extensions can programmatically paste content into the editor via `pasteToEditor` in the extension UI context. See [docs/extensions.md](docs/extensions.md) ([#1351](https://github.com/badlogic/pi-mono/pull/1351) by [@kaofelix](https://github.com/kaofelix))
375
+ - `pi <package> --help` and invalid subcommands now show helpful output instead of failing silently ([#1347](https://github.com/badlogic/pi-mono/pull/1347) by [@ferologics](https://github.com/ferologics))
376
+
377
+ ### Added
378
+
379
+ - Added `pasteToEditor` to extension UI context for programmatic editor paste ([#1351](https://github.com/badlogic/pi-mono/pull/1351) by [@kaofelix](https://github.com/kaofelix))
380
+ - Added package subcommand help and friendly error messages for invalid commands ([#1347](https://github.com/badlogic/pi-mono/pull/1347) by [@ferologics](https://github.com/ferologics))
381
+ - Added OpenRouter `auto` model alias for automatic model routing ([#1361](https://github.com/badlogic/pi-mono/pull/1361) by [@yogasanas](https://github.com/yogasanas))
382
+ - Added kill ring (ctrl+k/ctrl+y/alt+y) and undo (ctrl+z) support to the editor input ([#1373](https://github.com/badlogic/pi-mono/pull/1373) by [@Perlence](https://github.com/Perlence))
383
+
384
+ ### Changed
385
+
386
+ - Replaced Claude Opus 4.5 with Opus 4.6 as default model ([#1345](https://github.com/badlogic/pi-mono/pull/1345) by [@calvin-hpnet](https://github.com/calvin-hpnet))
387
+
388
+ ### Fixed
389
+
390
+ - Fixed temporary git package caches (`-e <git-url>`) to refresh on cache hits for unpinned sources, including detached/no-upstream checkouts
391
+ - Fixed aborting retries when an extension customizes the editor ([#1364](https://github.com/badlogic/pi-mono/pull/1364) by [@Perlence](https://github.com/Perlence))
392
+ - Fixed autocomplete not propagating to custom editors created by extensions ([#1372](https://github.com/badlogic/pi-mono/pull/1372) by [@Perlence](https://github.com/Perlence))
393
+ - Fixed extension shutdown to use clean TUI shutdown path, preventing orphaned processes
394
+
395
+ ## [0.52.7] - 2026-02-06
396
+
397
+ ### New Features
398
+
399
+ - Per-model overrides in `models.json` via `modelOverrides`, allowing customization of built-in provider models without replacing provider model lists. See [docs/models.md#per-model-overrides](docs/models.md#per-model-overrides).
400
+ - `models.json` provider `models` now merge with built-in models by `id`, so custom models can be added or replace matching built-ins without full provider replacement. See [docs/models.md#overriding-built-in-providers](docs/models.md#overriding-built-in-providers).
401
+ - Bedrock proxy support for unauthenticated endpoints via `AWS_BEDROCK_SKIP_AUTH` and `AWS_BEDROCK_FORCE_HTTP1`. See [docs/providers.md](docs/providers.md).
402
+
403
+ ### Breaking Changes
404
+
405
+ - Changed `models.json` provider `models` behavior from full replacement to merge-by-id with built-in models. Built-in models are now kept by default, and custom models upsert by `id`.
406
+
407
+ ### Added
408
+
409
+ - Added `modelOverrides` in `models.json` to customize individual built-in models per provider without full provider replacement ([#1332](https://github.com/badlogic/pi-mono/pull/1332) by [@charles-cooper](https://github.com/charles-cooper))
410
+ - Added `AWS_BEDROCK_SKIP_AUTH` and `AWS_BEDROCK_FORCE_HTTP1` environment variables for connecting to unauthenticated Bedrock proxies ([#1320](https://github.com/badlogic/pi-mono/pull/1320) by [@virtuald](https://github.com/virtuald))
411
+
412
+ ### Fixed
413
+
414
+ - Fixed extra spacing between thinking-only assistant content and subsequent tool execution blocks when assistant messages contain no text
415
+ - Fixed queued steering/follow-up/custom messages remaining stuck after threshold auto-compaction by resuming the agent loop when Agent-level queues still contain pending messages ([#1312](https://github.com/badlogic/pi-mono/pull/1312) by [@ferologics](https://github.com/ferologics))
416
+ - Fixed `tool_result` extension handlers to chain result patches across handlers instead of last-handler-wins behavior ([#1280](https://github.com/badlogic/pi-mono/issues/1280))
417
+ - Fixed compromised auth lock files being handled gracefully instead of crashing auth storage initialization ([#1322](https://github.com/badlogic/pi-mono/issues/1322))
418
+ - Fixed Bedrock adaptive thinking handling for Claude Opus 4.6 with interleaved thinking beta responses ([#1323](https://github.com/badlogic/pi-mono/pull/1323) by [@markusylisiurunen](https://github.com/markusylisiurunen))
419
+ - Fixed OpenAI Responses API requests to use `store: false` by default to avoid server-side history logging ([#1308](https://github.com/badlogic/pi-mono/issues/1308))
420
+ - Fixed interactive mode startup by initializing autocomplete after resources are loaded ([#1328](https://github.com/badlogic/pi-mono/issues/1328))
421
+ - Fixed `modelOverrides` merge behavior for nested objects and documented usage details ([#1062](https://github.com/badlogic/pi-mono/issues/1062))
422
+
423
+ ## [0.52.6] - 2026-02-05
424
+
425
+ ### Breaking Changes
426
+
427
+ - Removed `/exit` command handling. Use `/quit` to exit ([#1303](https://github.com/badlogic/pi-mono/issues/1303))
428
+
429
+ ### Fixed
430
+
431
+ - Fixed `/quit` being shadowed by fuzzy slash command autocomplete matches from skills by adding `/quit` to built-in command autocomplete ([#1303](https://github.com/badlogic/pi-mono/issues/1303))
432
+ - Fixed local package source parsing and settings normalization regression that misclassified relative paths as git URLs and prevented globally installed local packages from loading after restart ([#1304](https://github.com/badlogic/pi-mono/issues/1304))
433
+
434
+ ## [0.52.5] - 2026-02-05
435
+
436
+ ### Fixed
437
+
438
+ - Fixed thinking level capability detection so Anthropic Opus 4.6 models expose `xhigh` in selectors and cycling
439
+
440
+ ## [0.52.4] - 2026-02-05
441
+
442
+ ### Fixed
443
+
444
+ - Fixed extensions setting not respecting `package.json` `pi.extensions` manifest when directory is specified directly ([#1302](https://github.com/badlogic/pi-mono/pull/1302) by [@hjanuschka](https://github.com/hjanuschka))
445
+
446
+ ## [0.52.3] - 2026-02-05
447
+
448
+ ### Fixed
449
+
450
+ - Fixed git package parsing fallback for unknown hosts so enterprise git sources like `git:github.tools.sap/org/repo` are treated as git packages instead of local paths
451
+ - Fixed git package `@ref` parsing for shorthand, HTTPS, and SSH source formats, including branch refs with slashes
452
+ - Fixed Bedrock default model ID from `us.anthropic.claude-opus-4-6-v1:0` to `us.anthropic.claude-opus-4-6-v1`
453
+ - Fixed Bedrock Opus 4.6 model metadata (IDs, cache pricing) and added missing EU profile
454
+ - Fixed Claude Opus 4.6 context window metadata to 200000 for Anthropic and OpenCode providers
455
+
456
+ ## [0.52.2] - 2026-02-05
457
+
458
+ ### Changed
459
+
460
+ - Updated default model for `anthropic` provider to `claude-opus-4-6`
461
+ - Updated default model for `openai-codex` provider to `gpt-5.3-codex`
462
+ - Updated default model for `amazon-bedrock` provider to `us.anthropic.claude-opus-4-6-v1:0`
463
+ - Updated default model for `vercel-ai-gateway` provider to `anthropic/claude-opus-4-6`
464
+ - Updated default model for `opencode` provider to `claude-opus-4-6`
465
+
466
+ ## [0.52.1] - 2026-02-05
467
+
468
+ ## [0.52.0] - 2026-02-05
469
+
470
+ ### New Features
471
+
472
+ - Claude Opus 4.6 model support.
473
+ - GPT-5.3 Codex model support (OpenAI Codex provider only).
474
+ - SSH URL support for git packages. See [docs/packages.md](docs/packages.md).
475
+ - `auth.json` API keys now support shell command resolution (`!command`) and environment variable lookup. See [docs/providers.md](docs/providers.md).
476
+ - Model selectors now display the selected model name.
477
+
478
+ ### Added
479
+
480
+ - API keys in `auth.json` now support shell command resolution (`!command`) and environment variable lookup, matching the behavior in `models.json`
481
+ - Added `minimal-mode.ts` example extension demonstrating how to override built-in tool rendering for a minimal display mode
482
+ - Added Claude Opus 4.6 model to the model catalog
483
+ - Added GPT-5.3 Codex model to the model catalog (OpenAI Codex provider only)
484
+ - Added SSH URL support for git packages ([#1287](https://github.com/badlogic/pi-mono/pull/1287) by [@markusn](https://github.com/markusn))
485
+ - Model selectors now display the selected model name ([#1275](https://github.com/badlogic/pi-mono/pull/1275) by [@haoqixu](https://github.com/haoqixu))
486
+
487
+ ### Fixed
488
+
489
+ - Fixed HTML export losing indentation in ANSI-rendered tool output (e.g. JSON code blocks in custom tool results) ([#1269](https://github.com/badlogic/pi-mono/pull/1269) by [@aliou](https://github.com/aliou))
490
+ - Fixed images being silently dropped when `prompt()` is called with both `images` and `streamingBehavior` during streaming. `steer()`, `followUp()`, and the corresponding RPC commands now accept optional images. ([#1271](https://github.com/badlogic/pi-mono/pull/1271) by [@aliou](https://github.com/aliou))
491
+ - CLI `--help`, `--version`, `--list-models`, and `--export` now exit even if extensions keep the event loop alive ([#1285](https://github.com/badlogic/pi-mono/pull/1285) by [@ferologics](https://github.com/ferologics))
492
+ - Fixed crash when models send malformed tool arguments (objects instead of strings) ([#1259](https://github.com/badlogic/pi-mono/issues/1259))
493
+ - Fixed custom message expand state not being respected ([#1258](https://github.com/badlogic/pi-mono/pull/1258) by [@Gurpartap](https://github.com/Gurpartap))
494
+ - Fixed skill loader to respect .gitignore, .ignore, and .fdignore when scanning directories
495
+
496
+ ## [0.51.6] - 2026-02-04
497
+
498
+ ### New Features
499
+
500
+ - Configurable resume keybinding action for opening the session resume selector. See [docs/keybindings.md](docs/keybindings.md). ([#1249](https://github.com/badlogic/pi-mono/pull/1249) by [@juanibiapina](https://github.com/juanibiapina))
501
+
502
+ ### Added
503
+
504
+ - Added `resume` as a configurable keybinding action, allowing users to bind a key to open the session resume selector (like `newSession`, `tree`, and `fork`) ([#1249](https://github.com/badlogic/pi-mono/pull/1249) by [@juanibiapina](https://github.com/juanibiapina))
505
+
506
+ ### Changed
507
+
508
+ - Slash command menu now triggers on the first line even when other lines have content, allowing commands to be prepended to existing text ([#1227](https://github.com/badlogic/pi-mono/pull/1227) by [@aliou](https://github.com/aliou))
509
+
510
+ ### Fixed
511
+
512
+ - Ignored unknown skill frontmatter fields when loading skills
513
+ - Fixed `/reload` not picking up changes in global settings.json ([#1241](https://github.com/badlogic/pi-mono/issues/1241))
514
+ - Fixed forked sessions to persist the user message after forking
515
+ - Fixed forked sessions to write to new session files instead of the parent ([#1242](https://github.com/badlogic/pi-mono/issues/1242))
516
+ - Fixed local package removal to normalize paths before comparison ([#1243](https://github.com/badlogic/pi-mono/issues/1243))
517
+ - Fixed OpenAI Codex Responses provider to respect configured baseUrl ([#1244](https://github.com/badlogic/pi-mono/issues/1244))
518
+ - Fixed `/settings` crashing in narrow terminals by handling small widths in the settings list ([#1246](https://github.com/badlogic/pi-mono/pull/1246) by [@haoqixu](https://github.com/haoqixu))
519
+ - Fixed Unix bash detection to fall back to PATH lookup when `/bin/bash` is unavailable, including Termux setups ([#1230](https://github.com/badlogic/pi-mono/pull/1230) by [@VaclavSynacek](https://github.com/VaclavSynacek))
520
+
521
+ ## [0.51.5] - 2026-02-04
522
+
523
+ ### Changed
524
+
525
+ - Changed Bedrock model generation to drop legacy workarounds now handled upstream ([#1239](https://github.com/badlogic/pi-mono/pull/1239) by [@unexge](https://github.com/unexge))
526
+
527
+ ### Fixed
528
+
529
+ - Fixed Windows package installs regression by using shell execution instead of `.cmd` resolution ([#1220](https://github.com/badlogic/pi-mono/issues/1220))
530
+
531
+ ## [0.51.4] - 2026-02-03
532
+
533
+ ### New Features
534
+
535
+ - Share URLs now default to pi.dev, graciously donated by exe.dev.
536
+
537
+ ### Changed
538
+
539
+ - Share URLs now use pi.dev by default while shittycodingagent.ai and buildwithpi.ai continue to work.
540
+
541
+ ### Fixed
542
+
543
+ - Fixed input scrolling to avoid splitting emoji sequences ([#1228](https://github.com/badlogic/pi-mono/pull/1228) by [@haoqixu](https://github.com/haoqixu))
544
+
545
+ ## [0.51.3] - 2026-02-03
546
+
547
+ ### New Features
548
+
549
+ - Command discovery for extensions via `ExtensionAPI.getCommands()`, with `commands.ts` example for invocation patterns. See [docs/extensions.md#pigetcommands](docs/extensions.md#pigetcommands) and [examples/extensions/commands.ts](examples/extensions/commands.ts).
550
+ - Local path support for `pi install` and `pi remove`, with relative path resolution against the settings file. See [docs/packages.md#local-paths](docs/packages.md#local-paths).
551
+
552
+ ### Breaking Changes
553
+
554
+ - RPC `get_commands` response and `SlashCommandSource` type: renamed `"template"` to `"prompt"` for consistency with the rest of the codebase
555
+
556
+ ### Added
557
+
558
+ - Added `ExtensionAPI.getCommands()` to let extensions list available slash commands (extensions, prompt templates, skills) for invocation via `prompt` ([#1210](https://github.com/badlogic/pi-mono/pull/1210) by [@w-winter](https://github.com/w-winter))
559
+ - Added `commands.ts` example extension and exported `SlashCommandInfo` types for command discovery integrations ([#1210](https://github.com/badlogic/pi-mono/pull/1210) by [@w-winter](https://github.com/w-winter))
560
+ - Added local path support for `pi install` and `pi remove` with relative paths stored against the target settings file ([#1216](https://github.com/badlogic/pi-mono/issues/1216))
561
+
562
+ ### Fixed
563
+
564
+ - Fixed default thinking level persistence so settings-derived defaults are saved and restored correctly
565
+ - Fixed Windows package installs by resolving `npm.cmd` when `npm` is not directly executable ([#1220](https://github.com/badlogic/pi-mono/issues/1220))
566
+ - Fixed xhigh thinking level support check to accept gpt-5.2 model IDs ([#1209](https://github.com/badlogic/pi-mono/issues/1209))
567
+
568
+ ## [0.51.2] - 2026-02-03
569
+
570
+ ### New Features
571
+
572
+ - Extension tool output expansion controls via ExtensionUIContext getToolsExpanded and setToolsExpanded. See [docs/extensions.md](docs/extensions.md) and [docs/rpc.md](docs/rpc.md).
573
+
574
+ ### Added
575
+
576
+ - Added ExtensionUIContext getToolsExpanded and setToolsExpanded for controlling tool output expansion ([#1199](https://github.com/badlogic/pi-mono/pull/1199) by [@academo](https://github.com/academo))
577
+ - Added install method detection to show package manager specific update instructions ([#1203](https://github.com/badlogic/pi-mono/pull/1203) by [@Itsnotaka](https://github.com/Itsnotaka))
578
+
579
+ ### Fixed
580
+
581
+ - Fixed Kitty key release events leaking to parent shell over slow SSH connections by draining stdin for up to 1s on exit ([#1204](https://github.com/badlogic/pi-mono/issues/1204))
582
+ - Fixed legacy newline handling in the editor to preserve previous newline behavior
583
+ - Fixed @ autocomplete to include hidden paths
584
+ - Fixed submit fallback to honor configured keybindings
585
+ - Fixed extension commands conflicting with built-in commands by skipping them ([#1196](https://github.com/badlogic/pi-mono/pull/1196) by [@haoqixu](https://github.com/haoqixu))
586
+ - Fixed @-prefixed tool paths failing to resolve by stripping the prefix ([#1206](https://github.com/badlogic/pi-mono/issues/1206))
587
+ - Fixed install method detection to avoid stale cached results
588
+
589
+ ## [0.51.1] - 2026-02-02
590
+
591
+ ### New Features
592
+
593
+ - **Extension API switchSession**: Extensions can now programmatically switch sessions via `ctx.switchSession(sessionPath)`. See [docs/extensions.md](docs/extensions.md). ([#1187](https://github.com/badlogic/pi-mono/issues/1187))
594
+ - **Clear on shrink setting**: New `terminal.clearOnShrink` setting keeps the editor and footer pinned to the bottom of the terminal when content shrinks. May cause some flicker due to redraws. Disabled by default. Enable via `/settings` or `PI_CLEAR_ON_SHRINK=1` env var.
595
+
596
+ ### Fixed
597
+
598
+ - Fixed scoped models not finding valid credentials after logout ([#1194](https://github.com/badlogic/pi-mono/pull/1194) by [@terrorobe](https://github.com/terrorobe))
599
+ - Fixed Ctrl+D exit closing the parent SSH session due to stdin buffer race condition ([#1185](https://github.com/badlogic/pi-mono/issues/1185))
600
+ - Fixed emoji cursor positioning in editor input ([#1183](https://github.com/badlogic/pi-mono/pull/1183) by [@haoqixu](https://github.com/haoqixu))
601
+
602
+ ## [0.51.0] - 2026-02-01
603
+
604
+ ### Breaking Changes
605
+
606
+ - **Extension tool signature change**: `ToolDefinition.execute` now uses `(toolCallId, params, signal, onUpdate, ctx)` parameter order to match `AgentTool.execute`. Previously it was `(toolCallId, params, onUpdate, ctx, signal)`. This makes wrapping built-in tools trivial since the first four parameters now align. Update your extensions by swapping the `signal` and `onUpdate` parameters:
607
+ ```ts
608
+ // Before
609
+ async execute(toolCallId, params, onUpdate, ctx, signal) { ... }
610
+
611
+ // After
612
+ async execute(toolCallId, params, signal, onUpdate, ctx) { ... }
613
+ ```
614
+
615
+ ### New Features
616
+
617
+ - **Android/Termux support**: Pi now runs on Android via Termux. Install with:
618
+ ```bash
619
+ pkg install nodejs termux-api git
620
+ npm install -g @mariozechner/pi-coding-agent
621
+ mkdir -p ~/.pi/agent
622
+ echo "You are running on Android in Termux." > ~/.pi/agent/AGENTS.md
623
+ ```
624
+ Clipboard operations fall back gracefully when `termux-api` is unavailable. ([#1164](https://github.com/badlogic/pi-mono/issues/1164))
625
+ - **Bash spawn hook**: Extensions can now intercept and modify bash commands before execution via `pi.setBashSpawnHook()`. Adjust the command string, working directory, or environment variables. See [docs/extensions.md](docs/extensions.md). ([#1160](https://github.com/badlogic/pi-mono/pull/1160) by [@mitsuhiko](https://github.com/mitsuhiko))
626
+ - **Linux ARM64 musl support**: Pi now runs on Alpine Linux ARM64 (linux-arm64-musl) via updated clipboard dependency.
627
+ - **Nix/Guix support**: `PI_PACKAGE_DIR` environment variable overrides the package path for content-addressed package managers where store paths tokenize poorly. See [README.md#environment-variables](README.md#environment-variables). ([#1153](https://github.com/badlogic/pi-mono/pull/1153) by [@odysseus0](https://github.com/odysseus0))
628
+ - **Named session filter**: `/resume` picker now supports filtering to show only named sessions via Ctrl+N. Configurable via `toggleSessionNamedFilter` keybinding. See [docs/keybindings.md](docs/keybindings.md). ([#1128](https://github.com/badlogic/pi-mono/pull/1128) by [@w-winter](https://github.com/w-winter))
629
+ - **Typed tool call events**: Extension developers can narrow `ToolCallEvent` types using `isToolCallEventType()` for better TypeScript support. See [docs/extensions.md#tool-call-events](docs/extensions.md#tool-call-events). ([#1147](https://github.com/badlogic/pi-mono/pull/1147) by [@giuseppeg](https://github.com/giuseppeg))
630
+ - **Extension UI Protocol**: Full RPC documentation and examples for extension dialogs and notifications, enabling headless clients to support interactive extensions. See [docs/rpc.md#extension-ui-protocol](docs/rpc.md#extension-ui-protocol). ([#1144](https://github.com/badlogic/pi-mono/pull/1144) by [@aliou](https://github.com/aliou))
631
+
632
+ ### Added
633
+
634
+ - Added Linux ARM64 musl (Alpine Linux) support via clipboard dependency update
635
+ - Added Android/Termux support with graceful clipboard fallback ([#1164](https://github.com/badlogic/pi-mono/issues/1164))
636
+ - Added bash tool spawn hook support for adjusting command, cwd, and env before execution ([#1160](https://github.com/badlogic/pi-mono/pull/1160) by [@mitsuhiko](https://github.com/mitsuhiko))
637
+ - Added typed `ToolCallEvent.input` per tool with `isToolCallEventType()` type guard for narrowing built-in tool events ([#1147](https://github.com/badlogic/pi-mono/pull/1147) by [@giuseppeg](https://github.com/giuseppeg))
638
+ - Exported `discoverAndLoadExtensions` from package to enable extension testing without a local repo clone ([#1148](https://github.com/badlogic/pi-mono/issues/1148))
639
+ - Added Extension UI Protocol documentation to RPC docs covering all request/response types for extension dialogs and notifications ([#1144](https://github.com/badlogic/pi-mono/pull/1144) by [@aliou](https://github.com/aliou))
640
+ - Added `rpc-demo.ts` example extension exercising all RPC-supported extension UI methods ([#1144](https://github.com/badlogic/pi-mono/pull/1144) by [@aliou](https://github.com/aliou))
641
+ - Added `rpc-extension-ui.ts` TUI example client demonstrating the extension UI protocol with interactive dialogs ([#1144](https://github.com/badlogic/pi-mono/pull/1144) by [@aliou](https://github.com/aliou))
642
+ - Added `PI_PACKAGE_DIR` environment variable to override package path for content-addressed package managers (Nix, Guix) where store paths tokenize poorly ([#1153](https://github.com/badlogic/pi-mono/pull/1153) by [@odysseus0](https://github.com/odysseus0))
643
+ - `/resume` session picker now supports named-only filter toggle (default Ctrl+N, configurable via `toggleSessionNamedFilter`) to show only named sessions ([#1128](https://github.com/badlogic/pi-mono/pull/1128) by [@w-winter](https://github.com/w-winter))
644
+
645
+ ### Fixed
646
+
647
+ - Fixed `pi update` not updating npm/git packages when called without arguments ([#1151](https://github.com/badlogic/pi-mono/issues/1151))
648
+ - Fixed `models.json` validation requiring fields documented as optional. Model definitions now only require `id`; all other fields (`name`, `reasoning`, `input`, `cost`, `contextWindow`, `maxTokens`) have sensible defaults. ([#1146](https://github.com/badlogic/pi-mono/issues/1146))
649
+ - Fixed models resolving relative paths in skill files from cwd instead of skill directory by adding explicit guidance to skills preamble ([#1136](https://github.com/badlogic/pi-mono/issues/1136))
650
+ - Fixed tree selector losing focus state when navigating entries ([#1142](https://github.com/badlogic/pi-mono/pull/1142) by [@Perlence](https://github.com/Perlence))
651
+ - Fixed `cacheRetention` option not being passed through in `buildBaseOptions` ([#1154](https://github.com/badlogic/pi-mono/issues/1154))
652
+ - Fixed OAuth login/refresh not using HTTP proxy settings (`HTTP_PROXY`, `HTTPS_PROXY` env vars) ([#1132](https://github.com/badlogic/pi-mono/issues/1132))
653
+ - Fixed `pi update <source>` installing packages locally when the source is only registered globally ([#1163](https://github.com/badlogic/pi-mono/pull/1163) by [@aliou](https://github.com/aliou))
654
+ - Fixed tree navigation with summarization overwriting editor content typed during the summarization wait ([#1169](https://github.com/badlogic/pi-mono/pull/1169) by [@aliou](https://github.com/aliou))
655
+
656
+ ## [0.50.9] - 2026-02-01
657
+
658
+ ### Added
659
+
660
+ - Added `titlebar-spinner.ts` example extension that shows a braille spinner animation in the terminal title while the agent is working.
661
+ - Added `PI_AI_ANTIGRAVITY_VERSION` environment variable documentation to help text ([#1129](https://github.com/badlogic/pi-mono/issues/1129))
662
+ - Added `cacheRetention` stream option with provider-specific mappings for prompt cache controls, defaulting to short retention ([#1134](https://github.com/badlogic/pi-mono/issues/1134))
663
+
664
+ ## [0.50.8] - 2026-02-01
665
+
666
+ ### Added
667
+
668
+ - Added `newSession`, `tree`, and `fork` keybinding actions for `/new`, `/tree`, and `/fork` commands. All unbound by default. ([#1114](https://github.com/badlogic/pi-mono/pull/1114) by [@juanibiapina](https://github.com/juanibiapina))
669
+ - Added `retry.maxDelayMs` setting to cap maximum server-requested retry delay. When a provider requests a longer delay (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Default: 60000ms (60 seconds). ([#1123](https://github.com/badlogic/pi-mono/issues/1123))
670
+ - `/resume` session picker: new "Threaded" sort mode (now default) displays sessions in a tree structure based on fork relationships. Compact one-line format with message count and age on the right. ([#1124](https://github.com/badlogic/pi-mono/pull/1124) by [@pasky](https://github.com/pasky))
671
+ - Added Qwen CLI OAuth provider extension example. ([#940](https://github.com/badlogic/pi-mono/pull/940) by [@4h9fbZ](https://github.com/4h9fbZ))
672
+ - Added OAuth `modifyModels` hook support for extension-registered providers at registration time. ([#940](https://github.com/badlogic/pi-mono/pull/940) by [@4h9fbZ](https://github.com/4h9fbZ))
673
+ - Added Qwen thinking format support for OpenAI-compatible completions via `enable_thinking`. ([#940](https://github.com/badlogic/pi-mono/pull/940) by [@4h9fbZ](https://github.com/4h9fbZ))
674
+ - Added sticky column tracking for vertical cursor navigation so the editor restores the preferred column when moving across short lines. ([#1120](https://github.com/badlogic/pi-mono/pull/1120) by [@Perlence](https://github.com/Perlence))
675
+ - Added `resources_discover` extension hook to supply additional skills, prompts, and themes on startup and reload.
676
+
677
+ ### Fixed
678
+
679
+ - Fixed `switchSession()` appending spurious `thinking_level_change` entry to session log on resume. `setThinkingLevel()` is now idempotent. ([#1118](https://github.com/badlogic/pi-mono/issues/1118))
680
+ - Fixed clipboard image paste on WSL2/WSLg writing invalid PNG files when clipboard provides `image/bmp` format. BMP images are now converted to PNG before saving. ([#1112](https://github.com/badlogic/pi-mono/pull/1112) by [@lightningRalf](https://github.com/lightningRalf))
681
+ - Fixed Kitty keyboard protocol base layout fallback so non-QWERTY layouts do not trigger wrong shortcuts ([#1096](https://github.com/badlogic/pi-mono/pull/1096) by [@rytswd](https://github.com/rytswd))
682
+
683
+ ## [0.50.7] - 2026-01-31
684
+
685
+ ### Fixed
686
+
687
+ - Multi-file extensions in packages now work correctly. Package resolution now uses the same discovery logic as local extensions: only `index.ts` (or manifest-declared entries) are loaded from subdirectories, not helper modules. ([#1102](https://github.com/badlogic/pi-mono/issues/1102))
688
+
689
+ ## [0.50.6] - 2026-01-30
690
+
691
+ ### Added
692
+
693
+ - Added `ctx.getSystemPrompt()` to extension context for accessing the current effective system prompt ([#1098](https://github.com/badlogic/pi-mono/pull/1098) by [@kaofelix](https://github.com/kaofelix))
694
+
695
+ ### Fixed
696
+
697
+ - Fixed empty rows appearing below footer when content shrinks (e.g., closing `/tree`, clearing multi-line editor) ([#1095](https://github.com/badlogic/pi-mono/pull/1095) by [@marckrenn](https://github.com/marckrenn))
698
+ - Fixed terminal cursor remaining hidden after exiting TUI via `stop()` when a render was pending ([#1099](https://github.com/badlogic/pi-mono/pull/1099) by [@haoqixu](https://github.com/haoqixu))
699
+
700
+ ## [0.50.5] - 2026-01-30
701
+
702
+ ## [0.50.4] - 2026-01-30
703
+
704
+ ### New Features
705
+
706
+ - **OSC 52 clipboard support for SSH/mosh** - The `/copy` command now works over remote connections using the OSC 52 terminal escape sequence. No more clipboard frustration when using pi over SSH. ([#1069](https://github.com/badlogic/pi-mono/issues/1069) by [@gturkoglu](https://github.com/gturkoglu))
707
+ - **Vercel AI Gateway routing** - Route requests through Vercel's AI Gateway with provider failover and load balancing. Configure via `vercelGatewayRouting` in models.json. ([#1051](https://github.com/badlogic/pi-mono/pull/1051) by [@ben-vargas](https://github.com/ben-vargas))
708
+ - **Character jump navigation** - Bash/Readline-style character search: Ctrl+] jumps forward to the next occurrence of a character, Ctrl+Alt+] jumps backward. ([#1074](https://github.com/badlogic/pi-mono/pull/1074) by [@Perlence](https://github.com/Perlence))
709
+ - **Emacs-style Ctrl+B/Ctrl+F navigation** - Alternative keybindings for word navigation (cursor word left/right) in the editor. ([#1053](https://github.com/badlogic/pi-mono/pull/1053) by [@ninlds](https://github.com/ninlds))
710
+ - **Line boundary navigation** - Editor jumps to line start when pressing Up at first visual line, and line end when pressing Down at last visual line. ([#1050](https://github.com/badlogic/pi-mono/pull/1050) by [@4h9fbZ](https://github.com/4h9fbZ))
711
+ - **Performance improvements** - Optimized image line detection and box rendering cache in the TUI for better rendering performance. ([#1084](https://github.com/badlogic/pi-mono/pull/1084) by [@can1357](https://github.com/can1357))
712
+ - **`set_session_name` RPC command** - Headless clients can now set the session display name programmatically. ([#1075](https://github.com/badlogic/pi-mono/pull/1075) by [@dnouri](https://github.com/dnouri))
713
+ - **Disable double-escape behavior** - New `"none"` option for `doubleEscapeAction` setting completely disables the double-escape shortcut. ([#973](https://github.com/badlogic/pi-mono/issues/973) by [@juanibiapina](https://github.com/juanibiapina))
714
+
715
+ ### Added
716
+
717
+ - Added "none" option to `doubleEscapeAction` setting to disable double-escape behavior entirely ([#973](https://github.com/badlogic/pi-mono/issues/973) by [@juanibiapina](https://github.com/juanibiapina))
718
+ - Added OSC 52 clipboard support for SSH/mosh sessions. `/copy` now works over remote connections. ([#1069](https://github.com/badlogic/pi-mono/issues/1069) by [@gturkoglu](https://github.com/gturkoglu))
719
+ - Added Vercel AI Gateway routing support via `vercelGatewayRouting` in models.json ([#1051](https://github.com/badlogic/pi-mono/pull/1051) by [@ben-vargas](https://github.com/ben-vargas))
720
+ - Added Ctrl+B and Ctrl+F keybindings for cursor word left/right navigation in the editor ([#1053](https://github.com/badlogic/pi-mono/pull/1053) by [@ninlds](https://github.com/ninlds))
721
+ - Added character jump navigation: Ctrl+] jumps forward to next character, Ctrl+Alt+] jumps backward ([#1074](https://github.com/badlogic/pi-mono/pull/1074) by [@Perlence](https://github.com/Perlence))
722
+ - Editor now jumps to line start when pressing Up at first visual line, and line end when pressing Down at last visual line ([#1050](https://github.com/badlogic/pi-mono/pull/1050) by [@4h9fbZ](https://github.com/4h9fbZ))
723
+ - Optimized image line detection and box rendering cache for better TUI performance ([#1084](https://github.com/badlogic/pi-mono/pull/1084) by [@can1357](https://github.com/can1357))
724
+ - Added `set_session_name` RPC command for headless clients to set session display name ([#1075](https://github.com/badlogic/pi-mono/pull/1075) by [@dnouri](https://github.com/dnouri))
725
+
726
+ ### Fixed
727
+
728
+ - Read tool now handles macOS filenames with curly quotes (U+2019) and NFD Unicode normalization ([#1078](https://github.com/badlogic/pi-mono/issues/1078))
729
+ - Respect .gitignore, .ignore, and .fdignore files when scanning package resources for skills, prompts, themes, and extensions ([#1072](https://github.com/badlogic/pi-mono/issues/1072))
730
+ - Fixed tool call argument defaults when providers omit inputs ([#1065](https://github.com/badlogic/pi-mono/issues/1065))
731
+ - Invalid JSON in settings.json no longer causes the file to be overwritten with empty settings ([#1054](https://github.com/badlogic/pi-mono/issues/1054))
732
+ - Config selector now shows folder name for extensions with duplicate display names ([#1064](https://github.com/badlogic/pi-mono/pull/1064) by [@Graffioh](https://github.com/Graffioh))
733
+
734
+ ## [0.50.3] - 2026-01-29
735
+
736
+ ### New Features
737
+
738
+ - **Kimi For Coding provider**: Access Moonshot AI's Anthropic-compatible coding API. Set `KIMI_API_KEY` environment variable. See [README.md#kimi-for-coding](README.md#kimi-for-coding).
739
+
740
+ ### Added
741
+
742
+ - Added Kimi For Coding provider support (Moonshot AI's Anthropic-compatible coding API). Set `KIMI_API_KEY` environment variable. See [README.md#kimi-for-coding](README.md#kimi-for-coding).
743
+
744
+ ### Fixed
745
+
746
+ - Resources now appear before messages when resuming a session, preventing loaded context from appearing at the bottom of the chat.
747
+
748
+ ## [0.50.2] - 2026-01-29
749
+
750
+ ### New Features
751
+
752
+ - **Hugging Face provider**: Access Hugging Face models via OpenAI-compatible Inference Router. Set `HF_TOKEN` environment variable. See [README.md#hugging-face](README.md#hugging-face).
753
+ - **Extended prompt caching**: `PI_CACHE_RETENTION=long` enables 1-hour caching for Anthropic (vs 5min default) and 24-hour for OpenAI (vs in-memory default). Only applies to direct API calls. See [README.md#prompt-caching](README.md#prompt-caching).
754
+ - **Configurable autocomplete height**: `autocompleteMaxVisible` setting (3-20 items, default 5) controls dropdown size. Adjust via `/settings` or `settings.json`.
755
+ - **Shell-style keybindings**: `alt+b`/`alt+f` for word navigation, `ctrl+d` for delete character forward. See [docs/keybindings.md](docs/keybindings.md).
756
+ - **RPC `get_commands`**: Headless clients can now list available commands programmatically. See [docs/rpc.md](docs/rpc.md).
757
+
758
+ ### Added
759
+
760
+ - Added Hugging Face provider support via OpenAI-compatible Inference Router ([#994](https://github.com/badlogic/pi-mono/issues/994))
761
+ - Added `PI_CACHE_RETENTION` environment variable to control cache TTL for Anthropic (5m vs 1h) and OpenAI (in-memory vs 24h). Set to `long` for extended retention. ([#967](https://github.com/badlogic/pi-mono/issues/967))
762
+ - Added `autocompleteMaxVisible` setting for configurable autocomplete dropdown height (3-20 items, default 5) ([#972](https://github.com/badlogic/pi-mono/pull/972) by [@masonc15](https://github.com/masonc15))
763
+ - Added `/files` command to list all file operations (read, write, edit) in the current session
764
+ - Added shell-style keybindings: `alt+b`/`alt+f` for word navigation, `ctrl+d` for delete character forward (when editor has text) ([#1043](https://github.com/badlogic/pi-mono/issues/1043) by [@jasonish](https://github.com/jasonish))
765
+ - Added `get_commands` RPC method for headless clients to list available commands ([#995](https://github.com/badlogic/pi-mono/pull/995) by [@dnouri](https://github.com/dnouri))
766
+
767
+ ### Changed
768
+
769
+ - Improved `extractCursorPosition` performance in TUI: scans lines in reverse order, early-outs when cursor is above viewport ([#1004](https://github.com/badlogic/pi-mono/pull/1004) by [@can1357](https://github.com/can1357))
770
+ - Autocomplete improvements: better handling of partial matches and edge cases ([#1024](https://github.com/badlogic/pi-mono/pull/1024) by [@Perlence](https://github.com/Perlence))
771
+
772
+ ### Fixed
773
+
774
+ - External edits to `settings.json` are now preserved when pi reloads or saves unrelated settings. Previously, editing settings.json directly (e.g., removing a package from `packages` array) would be silently reverted on next pi startup when automatic setters like `setLastChangelogVersion()` triggered a save.
775
+ - Fixed custom header not displaying correctly with `quietStartup` enabled ([#1039](https://github.com/badlogic/pi-mono/pull/1039) by [@tudoroancea](https://github.com/tudoroancea))
776
+ - Empty array in package filter now disables all resources instead of falling back to manifest defaults ([#1044](https://github.com/badlogic/pi-mono/issues/1044))
777
+ - Auto-retry counter now resets after each successful LLM response instead of accumulating across tool-use turns ([#1019](https://github.com/badlogic/pi-mono/issues/1019))
778
+ - Fixed incorrect `.md` file names in warning messages ([#1041](https://github.com/badlogic/pi-mono/issues/1041) by [@llimllib](https://github.com/llimllib))
779
+ - Fixed provider name hidden in footer when terminal is narrow ([#981](https://github.com/badlogic/pi-mono/pull/981) by [@Perlence](https://github.com/Perlence))
780
+ - Fixed backslash input buffering causing delayed character display in editor ([#1037](https://github.com/badlogic/pi-mono/pull/1037) by [@Perlence](https://github.com/Perlence))
781
+ - Fixed markdown table rendering with proper row dividers and minimum column width ([#997](https://github.com/badlogic/pi-mono/pull/997) by [@tmustier](https://github.com/tmustier))
782
+ - Fixed OpenAI completions `toolChoice` handling ([#998](https://github.com/badlogic/pi-mono/pull/998) by [@williamtwomey](https://github.com/williamtwomey))
783
+ - Fixed cross-provider handoff failing when switching from OpenAI Responses API providers due to pipe-separated tool call IDs ([#1022](https://github.com/badlogic/pi-mono/issues/1022))
784
+ - Fixed 429 rate limit errors incorrectly triggering auto-compaction instead of retry with backoff ([#1038](https://github.com/badlogic/pi-mono/issues/1038))
785
+ - Fixed Anthropic provider to handle `sensitive` stop_reason returned by API ([#978](https://github.com/badlogic/pi-mono/issues/978))
786
+ - Fixed DeepSeek API compatibility by detecting `deepseek.com` URLs and disabling unsupported `developer` role ([#1048](https://github.com/badlogic/pi-mono/issues/1048))
787
+ - Fixed Anthropic provider to preserve input token counts when proxies omit them in `message_delta` events ([#1045](https://github.com/badlogic/pi-mono/issues/1045))
788
+ - Fixed `autocompleteMaxVisible` setting not persisting to `settings.json`
789
+
790
+ ## [0.50.1] - 2026-01-26
791
+
792
+ ### Fixed
793
+
794
+ - Git extension updates now handle force-pushed remotes gracefully instead of failing ([#961](https://github.com/badlogic/pi-mono/pull/961) by [@aliou](https://github.com/aliou))
795
+ - Extension `ctx.newSession({ setup })` now properly syncs agent state and renders messages after setup callback runs ([#968](https://github.com/badlogic/pi-mono/issues/968))
796
+ - Fixed extension UI bindings not initializing when starting with no extensions, which broke UI methods after `/reload`
797
+ - Fixed `/hotkeys` output to title-case extension hotkeys ([#969](https://github.com/badlogic/pi-mono/pull/969) by [@Perlence](https://github.com/Perlence))
798
+ - Fixed model catalog generation to exclude deprecated OpenCode Zen models ([#970](https://github.com/badlogic/pi-mono/pull/970) by [@DanielTatarkin](https://github.com/DanielTatarkin))
799
+ - Fixed git extension removal to prune empty directories
800
+
801
+ ## [0.50.0] - 2026-01-26
802
+
803
+ ### New Features
804
+
805
+ - Pi packages for bundling and installing extensions, skills, prompts, and themes. See [docs/packages.md](docs/packages.md).
806
+ - Hot reload (`/reload`) of resources including AGENTS.md, SYSTEM.md, APPEND_SYSTEM.md, prompt templates, skills, themes, and extensions. See [README.md#commands](README.md#commands) and [README.md#context-files](README.md#context-files).
807
+ - Custom providers via `pi.registerProvider()` for proxies, custom endpoints, OAuth or SSO flows, and non-standard streaming APIs. See [docs/custom-provider.md](docs/custom-provider.md).
808
+ - Azure OpenAI Responses provider support with deployment-aware model mapping. See [docs/providers.md#azure-openai](docs/providers.md#azure-openai).
809
+ - OpenRouter routing support for custom models via `openRouterRouting`. See [docs/providers.md#api-keys](docs/providers.md#api-keys) and [docs/models.md](docs/models.md).
810
+ - Skill invocation messages are now collapsible and skills can opt out of model invocation via `disable-model-invocation`. See [docs/skills.md#frontmatter](docs/skills.md#frontmatter).
811
+ - Session selector renaming and configurable keybindings. See [README.md#commands](README.md#commands) and [docs/keybindings.md](docs/keybindings.md).
812
+ - `models.json` headers can resolve environment variables and shell commands. See [docs/models.md#value-resolution](docs/models.md#value-resolution).
813
+ - `--verbose` CLI flag to override quiet startup. See [README.md#cli-reference](README.md#cli-reference).
814
+
815
+ Read the fully revamped docs in `README.md`, or have your clanker read them for you.
816
+
817
+ ### SDK Migration Guide
818
+
819
+ There are multiple SDK breaking changes since v0.49.3. For the quickest migration, point your agent at `packages/coding-agent/docs/sdk.md`, the SDK examples in `packages/coding-agent/examples/sdk`, and the SDK source in `packages/coding-agent/src/core/sdk.ts` and related modules.
820
+
821
+ ### Breaking Changes
822
+
823
+ - Header values in `models.json` now resolve environment variables (if a header value matches an env var name, the env var value is used). This may change behavior if a literal header value accidentally matches an env var name. ([#909](https://github.com/badlogic/pi-mono/issues/909))
824
+ - External packages (npm/git) are now configured via `packages` array in settings.json instead of `extensions`. Existing npm:/git: entries in `extensions` are auto-migrated. ([#645](https://github.com/badlogic/pi-mono/issues/645))
825
+ - Resource loading now uses `ResourceLoader` only and settings.json uses arrays for extensions, skills, prompts, and themes ([#645](https://github.com/badlogic/pi-mono/issues/645))
826
+ - Removed `discoverAuthStorage` and `discoverModels` from the SDK. `AuthStorage` and `ModelRegistry` now default to `~/.pi/agent` paths unless you pass an `agentDir` ([#645](https://github.com/badlogic/pi-mono/issues/645))
827
+
828
+ ### Added
829
+
830
+ - Session renaming in `/resume` picker via `Ctrl+R` without opening the session ([#863](https://github.com/badlogic/pi-mono/pull/863) by [@svkozak](https://github.com/svkozak))
831
+ - Session selector keybindings are now configurable ([#948](https://github.com/badlogic/pi-mono/pull/948) by [@aos](https://github.com/aos))
832
+ - `disable-model-invocation` frontmatter field for skills to prevent agentic invocation while still allowing explicit `/skill:name` commands ([#927](https://github.com/badlogic/pi-mono/issues/927))
833
+ - Exposed `copyToClipboard` utility for extensions ([#926](https://github.com/badlogic/pi-mono/issues/926) by [@mitsuhiko](https://github.com/mitsuhiko))
834
+ - Skill invocation messages are now collapsible in chat output, showing collapsed by default with skill name and expand hint ([#894](https://github.com/badlogic/pi-mono/issues/894))
835
+ - Header values in `models.json` now support environment variables and shell commands, matching `apiKey` resolution ([#909](https://github.com/badlogic/pi-mono/issues/909))
836
+ - Added HTTP proxy environment variable support for API requests ([#942](https://github.com/badlogic/pi-mono/pull/942) by [@haoqixu](https://github.com/haoqixu))
837
+ - Added OpenRouter provider routing support for custom models via `openRouterRouting` compat field ([#859](https://github.com/badlogic/pi-mono/pull/859) by [@v01dpr1mr0s3](https://github.com/v01dpr1mr0s3))
838
+ - Added `azure-openai-responses` provider support for Azure OpenAI Responses API. ([#890](https://github.com/badlogic/pi-mono/pull/890) by [@markusylisiurunen](https://github.com/markusylisiurunen))
839
+ - Added changelog link to update notifications ([#925](https://github.com/badlogic/pi-mono/pull/925) by [@dannote](https://github.com/dannote))
840
+ - Added `--verbose` CLI flag to override quietStartup setting ([#906](https://github.com/badlogic/pi-mono/pull/906) by [@Perlence](https://github.com/Perlence))
841
+ - `markdown.codeBlockIndent` setting to customize code block indentation in rendered output
842
+ - Extension package management with `pi install`, `pi remove`, `pi update`, and `pi list` commands ([#645](https://github.com/badlogic/pi-mono/issues/645))
843
+ - Package filtering: selectively load resources from packages using object form in `packages` array ([#645](https://github.com/badlogic/pi-mono/issues/645))
844
+ - Glob pattern support with minimatch in package filters, top-level settings arrays, and pi manifest (e.g., `"!funky.json"`, `"*.ts"`) ([#645](https://github.com/badlogic/pi-mono/issues/645))
845
+ - `/reload` command to reload extensions, skills, prompts, and themes ([#645](https://github.com/badlogic/pi-mono/issues/645))
846
+ - `pi config` command with TUI to enable/disable package and top-level resources via patterns ([#938](https://github.com/badlogic/pi-mono/issues/938))
847
+ - CLI flags for `--skill`, `--prompt-template`, `--theme`, `--no-prompt-templates`, and `--no-themes` ([#645](https://github.com/badlogic/pi-mono/issues/645))
848
+ - Package deduplication: if same package appears in global and project settings, project wins ([#645](https://github.com/badlogic/pi-mono/issues/645))
849
+ - Unified collision reporting with `ResourceDiagnostic` type for all resource types ([#645](https://github.com/badlogic/pi-mono/issues/645))
850
+ - Show provider alongside the model in the footer if multiple providers are available
851
+ - Custom provider support via `pi.registerProvider()` with `streamSimple` for custom API implementations
852
+ - Added `custom-provider.ts` example extension demonstrating custom Anthropic provider with OAuth
853
+
854
+ ### Changed
855
+
856
+ - `/resume` picker sort toggle moved to `Ctrl+S` to free `Ctrl+R` for rename ([#863](https://github.com/badlogic/pi-mono/pull/863) by [@svkozak](https://github.com/svkozak))
857
+ - HTML export: clicking a sidebar message now navigates to its newest leaf and scrolls to it, instead of truncating the branch ([#853](https://github.com/badlogic/pi-mono/pull/853) by [@mitsuhiko](https://github.com/mitsuhiko))
858
+ - HTML export: active path is now visually highlighted with dimmed off-path nodes ([#929](https://github.com/badlogic/pi-mono/pull/929) by [@hewliyang](https://github.com/hewliyang))
859
+ - Azure OpenAI Responses provider now uses base URL configuration with deployment-aware model mapping and no longer includes service tier handling
860
+ - `/reload` now re-renders the entire scrollback so updated extension components are visible immediately ([#928](https://github.com/badlogic/pi-mono/pull/928) by [@ferologics](https://github.com/ferologics))
861
+ - Skill, prompt template, and theme discovery now use settings and CLI path arrays instead of legacy filters ([#645](https://github.com/badlogic/pi-mono/issues/645))
862
+
863
+ ### Fixed
864
+
865
+ - Extension `setWorkingMessage()` calls in `agent_start` handlers now work correctly; previously the message was silently ignored because the loading animation didn't exist yet ([#935](https://github.com/badlogic/pi-mono/issues/935))
866
+ - Fixed package auto-discovery to respect loader rules, config overrides, and force-exclude patterns
867
+ - Fixed /reload restoring the correct editor after reload ([#949](https://github.com/badlogic/pi-mono/pull/949) by [@Perlence](https://github.com/Perlence))
868
+ - Fixed distributed themes breaking `/export` ([#946](https://github.com/badlogic/pi-mono/pull/946) by [@mitsuhiko](https://github.com/mitsuhiko))
869
+ - Fixed startup hints to clarify thinking level selection and expanded thinking guidance
870
+ - Fixed SDK initial model resolution to use `findInitialModel` and default to Claude Opus 4.5 for Anthropic models
871
+ - Fixed no-models warning to include the `/model` instruction
872
+ - Fixed authentication error messages to point to the authentication documentation
873
+ - Fixed bash output hint lines to truncate to terminal width
874
+ - Fixed custom editors to honor the `paddingX` setting ([#936](https://github.com/badlogic/pi-mono/pull/936) by [@Perlence](https://github.com/Perlence))
875
+ - Fixed system prompt tool list to show only built-in tools
876
+ - Fixed package manager to check npm package versions before using cached copies
877
+ - Fixed package manager to run `npm install` after cloning git repositories with a package.json
878
+ - Fixed extension provider registrations to apply before model resolution
879
+ - Fixed editor multi-line insertion handling and lastAction tracking ([#945](https://github.com/badlogic/pi-mono/pull/945) by [@Perlence](https://github.com/Perlence))
880
+ - Fixed editor word wrapping to reserve a cursor column ([#934](https://github.com/badlogic/pi-mono/pull/934) by [@Perlence](https://github.com/Perlence))
881
+ - Fixed editor word wrapping to use single-pass backtracking for whitespace handling ([#924](https://github.com/badlogic/pi-mono/pull/924) by [@Perlence](https://github.com/Perlence))
882
+ - Fixed Kitty image ID allocation and cleanup to prevent image ID collisions
883
+ - Fixed overlays staying centered after terminal resizes ([#950](https://github.com/badlogic/pi-mono/pull/950) by [@nicobailon](https://github.com/nicobailon))
884
+ - Fixed streaming dispatch to use the model api type instead of hardcoded API defaults
885
+ - Fixed Google providers to default tool call arguments to an empty object when omitted
886
+ - Fixed OpenAI Responses streaming to handle `arguments.done` events on OpenAI-compatible endpoints ([#917](https://github.com/badlogic/pi-mono/pull/917) by [@williballenthin](https://github.com/williballenthin))
887
+ - Fixed OpenAI Codex Responses tool strictness handling after the shared responses refactor
888
+ - Fixed Azure OpenAI Responses streaming to guard deltas before content parts and correct metadata and handoff gating
889
+ - Fixed OpenAI completions tool-result image batching after consecutive tool results ([#902](https://github.com/badlogic/pi-mono/pull/902) by [@terrorobe](https://github.com/terrorobe))
890
+ - Off-by-one error in bash output "earlier lines" count caused by counting spacing newline as hidden content ([#921](https://github.com/badlogic/pi-mono/issues/921))
891
+ - User package filters now layer on top of manifest filters instead of replacing them ([#645](https://github.com/badlogic/pi-mono/issues/645))
892
+ - Auto-retry now handles "terminated" errors from Codex API mid-stream failures
893
+ - Follow-up queue (Alt+Enter) now sends full paste content instead of `[paste #N ...]` markers ([#912](https://github.com/badlogic/pi-mono/issues/912))
894
+ - Fixed Alt-Up not restoring messages queued during compaction ([#923](https://github.com/badlogic/pi-mono/pull/923) by [@aliou](https://github.com/aliou))
895
+ - Fixed session corruption when loading empty or invalid session files via `--session` flag ([#932](https://github.com/badlogic/pi-mono/issues/932) by [@armanddp](https://github.com/armanddp))
896
+ - Fixed extension shortcuts not firing when extension also uses `setEditorComponent()` ([#947](https://github.com/badlogic/pi-mono/pull/947) by [@Perlence](https://github.com/Perlence))
897
+ - Session "modified" time now uses last message timestamp instead of file mtime, so renaming doesn't reorder the recent list ([#863](https://github.com/badlogic/pi-mono/pull/863) by [@svkozak](https://github.com/svkozak))
898
+
899
+ ## [0.49.3] - 2026-01-22
900
+
901
+ ### Added
902
+
903
+ - `markdown.codeBlockIndent` setting to customize code block indentation in rendered output ([#855](https://github.com/badlogic/pi-mono/pull/855) by [@terrorobe](https://github.com/terrorobe))
904
+ - Added `inline-bash.ts` example extension for expanding `!{command}` patterns in prompts ([#881](https://github.com/badlogic/pi-mono/pull/881) by [@scutifer](https://github.com/scutifer))
905
+ - Added `antigravity-image-gen.ts` example extension for AI image generation via Google Antigravity ([#893](https://github.com/badlogic/pi-mono/pull/893) by [@ben-vargas](https://github.com/ben-vargas))
906
+ - Added `PI_SHARE_VIEWER_URL` environment variable for custom share viewer URLs ([#889](https://github.com/badlogic/pi-mono/pull/889) by [@andresaraujo](https://github.com/andresaraujo))
907
+ - Added Alt+Delete as hotkey for delete word forwards ([#878](https://github.com/badlogic/pi-mono/pull/878) by [@Perlence](https://github.com/Perlence))
908
+
909
+ ### Changed
910
+
911
+ - Tree selector: changed label filter shortcut from `l` to `Shift+L` so users can search for entries containing "l" ([#861](https://github.com/badlogic/pi-mono/pull/861) by [@mitsuhiko](https://github.com/mitsuhiko))
912
+ - Fuzzy matching now scores consecutive matches higher for better search relevance ([#860](https://github.com/badlogic/pi-mono/pull/860) by [@mitsuhiko](https://github.com/mitsuhiko))
913
+
914
+ ### Fixed
915
+
916
+ - Fixed error messages showing hardcoded `~/.pi/agent/` paths instead of respecting `PI_CODING_AGENT_DIR` ([#887](https://github.com/badlogic/pi-mono/pull/887) by [@aliou](https://github.com/aliou))
917
+ - Fixed `write` tool not displaying errors in the UI when execution fails ([#856](https://github.com/badlogic/pi-mono/issues/856))
918
+ - Fixed HTML export using default theme instead of user's active theme ([#870](https://github.com/badlogic/pi-mono/pull/870) by [@scutifer](https://github.com/scutifer))
919
+ - Show session name in the footer and terminal / tab title ([#876](https://github.com/badlogic/pi-mono/pull/876) by [@scutifer](https://github.com/scutifer))
920
+ - Fixed 256color fallback in Terminal.app to prevent color rendering issues ([#869](https://github.com/badlogic/pi-mono/pull/869) by [@Perlence](https://github.com/Perlence))
921
+ - Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
922
+ - Fixed autocomplete to allow searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
923
+ - Fixed autolinked emails displaying redundant `(mailto:...)` suffix ([#888](https://github.com/badlogic/pi-mono/pull/888) by [@terrorobe](https://github.com/terrorobe))
924
+ - Fixed `@` file autocomplete adding space after directories, breaking continued autocomplete into subdirectories
925
+
926
+ ## [0.49.2] - 2026-01-19
927
+
928
+ ### Added
929
+
930
+ - Added widget placement option for extension widgets via `widgetPlacement` in `pi.addWidget()` ([#850](https://github.com/badlogic/pi-mono/pull/850) by [@marckrenn](https://github.com/marckrenn))
931
+ - Added AWS credential detection for ECS/Kubernetes environments: `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`, `AWS_CONTAINER_CREDENTIALS_FULL_URI`, `AWS_WEB_IDENTITY_TOKEN_FILE` ([#848](https://github.com/badlogic/pi-mono/issues/848))
932
+ - Add "quiet startup" setting to `/settings` ([#847](https://github.com/badlogic/pi-mono/pull/847) by [@unexge](https://github.com/unexge))
933
+
934
+ ### Changed
935
+
936
+ - HTML export now includes JSONL download button, jump-to-last-message on click, and fixed missing labels ([#853](https://github.com/badlogic/pi-mono/pull/853) by [@mitsuhiko](https://github.com/mitsuhiko))
937
+ - Improved error message for OAuth authentication failures (expired credentials, offline) instead of generic 'No API key found' ([#849](https://github.com/badlogic/pi-mono/pull/849) by [@zedrdave](https://github.com/zedrdave))
938
+
939
+ ### Fixed
940
+ - Fixed `/model` selector scope toggle so you can switch between all and scoped models when scoped models are saved ([#844](https://github.com/badlogic/pi-mono/issues/844))
941
+ - Fixed OpenAI Responses 400 error "reasoning without following item" when replaying aborted turns ([#838](https://github.com/badlogic/pi-mono/pull/838))
942
+ - Fixed pi exiting with code 0 when cancelling resume session selection
943
+
944
+ ### Removed
945
+
946
+ - Removed `strictResponsesPairing` compat option from models.json schema (no longer needed)
947
+
948
+ ## [0.49.1] - 2026-01-18
949
+
950
+ ### Added
951
+
952
+ - Added `strictResponsesPairing` compat option for custom OpenAI Responses models on Azure ([#768](https://github.com/badlogic/pi-mono/pull/768) by [@prateekmedia](https://github.com/prateekmedia))
953
+ - Session selector (`/resume`) now supports path display toggle (`Ctrl+P`) and session deletion (`Ctrl+D`) with inline confirmation ([#816](https://github.com/badlogic/pi-mono/pull/816) by [@w-winter](https://github.com/w-winter))
954
+ - Added undo support in interactive mode with Ctrl+- hotkey. ([#831](https://github.com/badlogic/pi-mono/pull/831) by [@Perlence](https://github.com/Perlence))
955
+
956
+ ### Changed
957
+
958
+ - Share URLs now use hash fragments (`#`) instead of query strings (`?`) to prevent session IDs from being sent to buildwithpi.ai ([#829](https://github.com/badlogic/pi-mono/pull/829) by [@terrorobe](https://github.com/terrorobe))
959
+ - API keys in `models.json` can now be retrieved via shell command using `!` prefix (e.g., `"apiKey": "!security find-generic-password -ws 'anthropic'"` for macOS Keychain) ([#762](https://github.com/badlogic/pi-mono/pull/762) by [@cv](https://github.com/cv))
960
+
961
+ ### Fixed
962
+
963
+ - Fixed IME candidate window appearing in wrong position when filtering menus with Input Method Editor (e.g., Chinese IME). Components with search inputs now properly propagate focus state for cursor positioning. ([#827](https://github.com/badlogic/pi-mono/issues/827))
964
+ - Fixed extension shortcut conflicts to respect user keybindings when built-in actions are remapped. ([#826](https://github.com/badlogic/pi-mono/pull/826) by [@richardgill](https://github.com/richardgill))
965
+ - Fixed photon WASM loading in standalone compiled binaries.
966
+ - Fixed tool call ID normalization for cross-provider handoffs (e.g., Codex to Antigravity Claude) ([#821](https://github.com/badlogic/pi-mono/issues/821))
967
+
968
+ ## [0.49.0] - 2026-01-17
969
+
970
+ ### Added
971
+
972
+ - `pi.setLabel(entryId, label)` in ExtensionAPI for setting per-entry labels from extensions ([#806](https://github.com/badlogic/pi-mono/issues/806))
973
+ - Export `keyHint`, `appKeyHint`, `editorKey`, `appKey`, `rawKeyHint` for extensions to format keybinding hints consistently ([#802](https://github.com/badlogic/pi-mono/pull/802) by [@dannote](https://github.com/dannote))
974
+ - Exported `VERSION` from the package index and updated the custom-header example. ([#798](https://github.com/badlogic/pi-mono/pull/798) by [@tallshort](https://github.com/tallshort))
975
+ - Added `showHardwareCursor` setting to control cursor visibility while still positioning it for IME support. ([#800](https://github.com/badlogic/pi-mono/pull/800) by [@ghoulr](https://github.com/ghoulr))
976
+ - Added Emacs-style kill ring editing with yank and yank-pop keybindings, plus legacy Alt+letter handling and Alt+D delete word forward support in the interactive editor. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
977
+ - Added `ctx.compact()` and `ctx.getContextUsage()` to extension contexts for programmatic compaction and context usage checks.
978
+ - Added documentation for delete word forward and kill ring keybindings in interactive mode. ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence))
979
+
980
+ ### Changed
981
+
982
+ - Updated the default system prompt wording to clarify the pi harness and documentation scope.
983
+ - Simplified Codex system prompt handling to use the default system prompt directly for Codex instructions.
984
+
985
+ ### Fixed
986
+
987
+ - Fixed photon module failing to load in ESM context with "require is not defined" error ([#795](https://github.com/badlogic/pi-mono/pull/795) by [@dannote](https://github.com/dannote))
988
+ - Fixed compaction UI not showing when extensions trigger compaction.
989
+ - Fixed orphaned tool results after errored assistant messages causing Codex API errors. When an assistant message has `stopReason: "error"`, its tool calls are now excluded from pending tool tracking, preventing synthetic tool results from being generated for calls that will be dropped by provider-specific converters. ([#812](https://github.com/badlogic/pi-mono/issues/812))
990
+ - Fixed Bedrock Claude max_tokens handling to always exceed thinking budget tokens, preventing compaction failures. ([#797](https://github.com/badlogic/pi-mono/pull/797) by [@pjtf93](https://github.com/pjtf93))
991
+ - Fixed Claude Code tool name normalization to match the Claude Code tool list case-insensitively and remove invalid mappings.
992
+
993
+ ### Removed
994
+
995
+ - Removed `pi-internal://` path resolution from the read tool.
996
+
997
+ ## [0.48.0] - 2026-01-16
998
+
999
+ ### Added
1000
+
1001
+ - Added `quietStartup` setting to silence startup output (version header, loaded context info, model scope line). Changelog notifications are still shown. ([#777](https://github.com/badlogic/pi-mono/pull/777) by [@ribelo](https://github.com/ribelo))
1002
+ - Added `editorPaddingX` setting for horizontal padding in input editor (0-3, default: 0)
1003
+ - Added `shellCommandPrefix` setting to prepend commands to every bash execution, enabling alias expansion in non-interactive shells (e.g., `"shellCommandPrefix": "shopt -s expand_aliases"`) ([#790](https://github.com/badlogic/pi-mono/pull/790) by [@richardgill](https://github.com/richardgill))
1004
+ - Added bash-style argument slicing for prompt templates ([#770](https://github.com/badlogic/pi-mono/pull/770) by [@airtonix](https://github.com/airtonix))
1005
+ - Extension commands can provide argument auto-completions via `getArgumentCompletions` in `pi.registerCommand()` ([#775](https://github.com/badlogic/pi-mono/pull/775) by [@ribelo](https://github.com/ribelo))
1006
+ - Bash tool now displays the timeout value in the UI when a timeout is set ([#780](https://github.com/badlogic/pi-mono/pull/780) by [@dannote](https://github.com/dannote))
1007
+ - Export `getShellConfig` for extensions to detect user's shell environment ([#766](https://github.com/badlogic/pi-mono/pull/766) by [@dannote](https://github.com/dannote))
1008
+ - Added `thinkingText` and `selectedBg` to theme schema ([#763](https://github.com/badlogic/pi-mono/pull/763) by [@scutifer](https://github.com/scutifer))
1009
+ - `navigateTree()` now supports `replaceInstructions` option to replace the default summarization prompt entirely, and `label` option to attach a label to the branch summary entry ([#787](https://github.com/badlogic/pi-mono/pull/787) by [@mitsuhiko](https://github.com/mitsuhiko))
1010
+
1011
+ ### Fixed
1012
+
1013
+ - Fixed crash during auto-compaction when summarization fails (e.g., quota exceeded). Now displays error message instead of crashing ([#792](https://github.com/badlogic/pi-mono/issues/792))
1014
+ - Fixed `--session <UUID>` to search globally across projects if not found locally, with option to fork sessions from other projects ([#785](https://github.com/badlogic/pi-mono/pull/785) by [@ribelo](https://github.com/ribelo))
1015
+ - Fixed standalone binary WASM loading on Linux ([#784](https://github.com/badlogic/pi-mono/issues/784))
1016
+ - Fixed string numbers in tool arguments not being coerced to numbers during validation ([#786](https://github.com/badlogic/pi-mono/pull/786) by [@dannote](https://github.com/dannote))
1017
+ - Fixed `--no-extensions` flag not preventing extension discovery ([#776](https://github.com/badlogic/pi-mono/issues/776))
1018
+ - Fixed extension messages rendering twice on startup when `pi.sendMessage({ display: true })` is called during `session_start` ([#765](https://github.com/badlogic/pi-mono/pull/765) by [@dannote](https://github.com/dannote))
1019
+ - Fixed `PI_CODING_AGENT_DIR` env var not expanding tilde (`~`) to home directory ([#778](https://github.com/badlogic/pi-mono/pull/778) by [@aliou](https://github.com/aliou))
1020
+ - Fixed session picker hint text overflow ([#764](https://github.com/badlogic/pi-mono/issues/764))
1021
+ - Fixed Kitty keyboard protocol shifted symbol keys (e.g., `@`, `?`) not working in editor ([#779](https://github.com/badlogic/pi-mono/pull/779) by [@iamd3vil](https://github.com/iamd3vil))
1022
+ - Fixed Bedrock tool call IDs causing API errors from invalid characters ([#781](https://github.com/badlogic/pi-mono/pull/781) by [@pjtf93](https://github.com/pjtf93))
1023
+
1024
+ ### Changed
1025
+
1026
+ - Hardware cursor is now disabled by default for better terminal compatibility. Set `PI_HARDWARE_CURSOR=1` to enable (replaces `PI_NO_HARDWARE_CURSOR=1` which disabled it).
1027
+
1028
+ ## [0.47.0] - 2026-01-16
1029
+
1030
+ ### Breaking Changes
1031
+
1032
+ - Extensions using `Editor` directly must now pass `TUI` as the first constructor argument: `new Editor(tui, theme)`. The `tui` parameter is available in extension factory functions. ([#732](https://github.com/badlogic/pi-mono/issues/732))
1033
+
1034
+ ### Added
1035
+
1036
+ - **OpenAI Codex official support**: Full compatibility with OpenAI's Codex CLI models (`gpt-5.1`, `gpt-5.2`, `gpt-5.1-codex-mini`, `gpt-5.2-codex`). Features include static system prompt for OpenAI allowlisting, prompt caching via session ID, and reasoning signature retention across turns. Set `OPENAI_API_KEY` and use `--provider openai-codex` or select a Codex model. ([#737](https://github.com/badlogic/pi-mono/pull/737))
1037
+ - `pi-internal://` URL scheme in read tool for accessing internal documentation. The model can read files from the coding-agent package (README, docs, examples) to learn about extending pi.
1038
+ - New `input` event in extension system for intercepting, transforming, or handling user input before the agent processes it. Supports three result types: `continue` (pass through), `transform` (modify text/images), `handled` (respond without LLM). Handlers chain transforms and short-circuit on handled. ([#761](https://github.com/badlogic/pi-mono/pull/761) by [@nicobailon](https://github.com/nicobailon))
1039
+ - Extension example: `input-transform.ts` demonstrating input interception patterns (quick mode, instant commands, source routing) ([#761](https://github.com/badlogic/pi-mono/pull/761) by [@nicobailon](https://github.com/nicobailon))
1040
+ - Custom tool HTML export: extensions with `renderCall`/`renderResult` now render in `/share` and `/export` output with ANSI-to-HTML color conversion ([#702](https://github.com/badlogic/pi-mono/pull/702) by [@aliou](https://github.com/aliou))
1041
+ - Direct filter shortcuts in Tree mode: Ctrl+D (default), Ctrl+T (no-tools), Ctrl+U (user-only), Ctrl+L (labeled-only), Ctrl+A (all) ([#747](https://github.com/badlogic/pi-mono/pull/747) by [@kaofelix](https://github.com/kaofelix))
1042
+
1043
+ ### Changed
1044
+
1045
+ - Skill commands (`/skill:name`) are now expanded in AgentSession instead of interactive mode. This enables skill commands in RPC and print modes, and allows the `input` event to intercept `/skill:name` before expansion.
1046
+
1047
+ ### Fixed
1048
+
1049
+ - Editor no longer corrupts terminal display when loading large prompts via `setEditorText`. Content now scrolls vertically with indicators showing lines above/below the viewport. ([#732](https://github.com/badlogic/pi-mono/issues/732))
1050
+ - Piped stdin now works correctly: `echo foo | pi` is equivalent to `pi -p foo`. When stdin is piped, print mode is automatically enabled since interactive mode requires a TTY ([#708](https://github.com/badlogic/pi-mono/issues/708))
1051
+ - Session tree now preserves branch connectors and indentation when filters hide intermediate entries so descendants attach to the nearest visible ancestor and sibling branches align. Fixed in both TUI and HTML export ([#739](https://github.com/badlogic/pi-mono/pull/739) by [@w-winter](https://github.com/w-winter))
1052
+ - Added `upstream connect`, `connection refused`, and `reset before headers` patterns to auto-retry error detection ([#733](https://github.com/badlogic/pi-mono/issues/733))
1053
+ - Multi-line YAML frontmatter in skills and prompt templates now parses correctly. Centralized frontmatter parsing using the `yaml` library. ([#728](https://github.com/badlogic/pi-mono/pull/728) by [@richardgill](https://github.com/richardgill))
1054
+ - `ctx.shutdown()` now waits for pending UI renders to complete before exiting, ensuring notifications and final output are visible ([#756](https://github.com/badlogic/pi-mono/issues/756))
1055
+ - OpenAI Codex provider now retries on transient errors (429, 5xx, connection failures) with exponential backoff ([#733](https://github.com/badlogic/pi-mono/issues/733))
1056
+
1057
+ ## [0.46.0] - 2026-01-15
1058
+
1059
+ ### Fixed
1060
+
1061
+ - Scoped models (`--models` or `enabledModels`) now remember the last selected model across sessions instead of always starting with the first model in the scope ([#736](https://github.com/badlogic/pi-mono/pull/736) by [@ogulcancelik](https://github.com/ogulcancelik))
1062
+ - Show `bun install` instead of `npm install` in update notification when running under Bun ([#714](https://github.com/badlogic/pi-mono/pull/714) by [@dannote](https://github.com/dannote))
1063
+ - `/skill` prompts now include the skill path ([#711](https://github.com/badlogic/pi-mono/pull/711) by [@jblwilliams](https://github.com/jblwilliams))
1064
+ - Use configurable `expandTools` keybinding instead of hardcoded Ctrl+O ([#717](https://github.com/badlogic/pi-mono/pull/717) by [@dannote](https://github.com/dannote))
1065
+ - Compaction turn prefix summaries now merge correctly ([#738](https://github.com/badlogic/pi-mono/pull/738) by [@vsabavat](https://github.com/vsabavat))
1066
+ - Avoid unsigned Gemini 3 tool calls ([#741](https://github.com/badlogic/pi-mono/pull/741) by [@roshanasingh4](https://github.com/roshanasingh4))
1067
+ - Fixed signature support for non-Anthropic models in Amazon Bedrock provider ([#727](https://github.com/badlogic/pi-mono/pull/727) by [@unexge](https://github.com/unexge))
1068
+ - Keyboard shortcuts (Ctrl+C, Ctrl+D, etc.) now work on non-Latin keyboard layouts (Russian, Ukrainian, Bulgarian, etc.) in terminals supporting Kitty keyboard protocol with alternate key reporting ([#718](https://github.com/badlogic/pi-mono/pull/718) by [@dannote](https://github.com/dannote))
1069
+
1070
+ ### Added
1071
+
1072
+ - Edit tool now uses fuzzy matching as fallback when exact match fails, tolerating trailing whitespace, smart quotes, Unicode dashes, and special spaces ([#713](https://github.com/badlogic/pi-mono/pull/713) by [@dannote](https://github.com/dannote))
1073
+ - Support `APPEND_SYSTEM.md` to append instructions to the system prompt ([#716](https://github.com/badlogic/pi-mono/pull/716) by [@tallshort](https://github.com/tallshort))
1074
+ - Session picker search: Ctrl+R toggles sorting between fuzzy match (default) and most recent; supports quoted phrase matching and `re:` regex mode ([#731](https://github.com/badlogic/pi-mono/pull/731) by [@ogulcancelik](https://github.com/ogulcancelik))
1075
+ - Export `getAgentDir` for extensions ([#749](https://github.com/badlogic/pi-mono/pull/749) by [@dannote](https://github.com/dannote))
1076
+ - Show loaded prompt templates on startup ([#743](https://github.com/badlogic/pi-mono/pull/743) by [@tallshort](https://github.com/tallshort))
1077
+ - MiniMax China (`minimax-cn`) provider support ([#725](https://github.com/badlogic/pi-mono/pull/725) by [@tallshort](https://github.com/tallshort))
1078
+ - `gpt-5.2-codex` models for GitHub Copilot and OpenCode Zen providers ([#734](https://github.com/badlogic/pi-mono/pull/734) by [@aadishv](https://github.com/aadishv))
1079
+
1080
+ ### Changed
1081
+
1082
+ - Replaced `wasm-vips` with `@silvia-odwyer/photon-node` for image processing ([#710](https://github.com/badlogic/pi-mono/pull/710) by [@can1357](https://github.com/can1357))
1083
+ - Extension example: `plan-mode/` shortcut changed from Shift+P to Ctrl+Alt+P to avoid conflict with typing capital P ([#746](https://github.com/badlogic/pi-mono/pull/746) by [@ferologics](https://github.com/ferologics))
1084
+ - UI keybinding hints now respect configured keybindings across components ([#724](https://github.com/badlogic/pi-mono/pull/724) by [@dannote](https://github.com/dannote))
1085
+ - CLI process title is now set to `pi` for easier process identification ([#742](https://github.com/badlogic/pi-mono/pull/742) by [@richardgill](https://github.com/richardgill))
1086
+
1087
+ ## [0.45.7] - 2026-01-13
1088
+
1089
+ ### Added
1090
+
1091
+ - Exported `highlightCode` and `getLanguageFromPath` for extensions ([#703](https://github.com/badlogic/pi-mono/pull/703) by [@dannote](https://github.com/dannote))
1092
+
1093
+ ## [0.45.6] - 2026-01-13
1094
+
1095
+ ### Added
1096
+
1097
+ - `ctx.ui.custom()` now accepts `overlayOptions` for overlay positioning and sizing (anchor, margins, offsets, percentages, absolute positioning) ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
1098
+ - `ctx.ui.custom()` now accepts `onHandle` callback to receive the `OverlayHandle` for controlling overlay visibility ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
1099
+ - Extension example: `overlay-qa-tests.ts` with 10 commands for testing overlay positioning, animation, and toggle scenarios ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
1100
+ - Extension example: `doom-overlay/` - DOOM game running as an overlay at 35 FPS (auto-downloads WAD on first run) ([#667](https://github.com/badlogic/pi-mono/pull/667) by [@nicobailon](https://github.com/nicobailon))
1101
+
1102
+ ## [0.45.5] - 2026-01-13
1103
+
1104
+ ### Fixed
1105
+
1106
+ - Skip changelog display on fresh install (only show on upgrades)
1107
+
1108
+ ## [0.45.4] - 2026-01-13
1109
+
1110
+ ### Changed
1111
+
1112
+ - Light theme colors adjusted for WCAG AA compliance (4.5:1 contrast ratio against white backgrounds)
1113
+ - Replaced `sharp` with `wasm-vips` for image processing (resize, PNG conversion). Eliminates native build requirements that caused installation failures on some systems. ([#696](https://github.com/badlogic/pi-mono/issues/696))
1114
+
1115
+ ### Added
1116
+
1117
+ - Extension example: `summarize.ts` for summarizing conversations using custom UI and an external model ([#684](https://github.com/badlogic/pi-mono/pull/684) by [@scutifer](https://github.com/scutifer))
1118
+ - Extension example: `question.ts` enhanced with custom UI for asking user questions ([#693](https://github.com/badlogic/pi-mono/pull/693) by [@ferologics](https://github.com/ferologics))
1119
+ - Extension example: `plan-mode/` enhanced with explicit step tracking and progress widget ([#694](https://github.com/badlogic/pi-mono/pull/694) by [@ferologics](https://github.com/ferologics))
1120
+ - Extension example: `questionnaire.ts` for multi-question input with tab bar navigation ([#695](https://github.com/badlogic/pi-mono/pull/695) by [@ferologics](https://github.com/ferologics))
1121
+ - Experimental Vercel AI Gateway provider support: set `AI_GATEWAY_API_KEY` and use `--provider vercel-ai-gateway`. Token usage is currently reported incorrectly by Anthropic Messages compatible endpoint. ([#689](https://github.com/badlogic/pi-mono/pull/689) by [@timolins](https://github.com/timolins))
1122
+
1123
+ ### Fixed
1124
+
1125
+ - Fix API key resolution after model switches by using provider argument ([#691](https://github.com/badlogic/pi-mono/pull/691) by [@joshp123](https://github.com/joshp123))
1126
+ - Fixed z.ai thinking/reasoning: thinking toggle now correctly enables/disables thinking for z.ai models ([#688](https://github.com/badlogic/pi-mono/issues/688))
1127
+ - Fixed extension loading in compiled Bun binary: extensions with local file imports now work correctly. Updated `@mariozechner/jiti` to v2.6.5 which bundles babel for Bun binary compatibility. ([#681](https://github.com/badlogic/pi-mono/issues/681))
1128
+ - Fixed theme loading when installed via mise: use wrapper directory in release tarballs for compatibility with mise's `strip_components=1` extraction. ([#681](https://github.com/badlogic/pi-mono/issues/681))
1129
+
1130
+ ## [0.45.3] - 2026-01-13
1131
+
1132
+ ## [0.45.2] - 2026-01-13
1133
+
1134
+ ### Fixed
1135
+
1136
+ - Extensions now load correctly in compiled Bun binary using `@mariozechner/jiti` fork with `virtualModules` support. Bundled packages (`@sinclair/typebox`, `@mariozechner/pi-tui`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`) are accessible to extensions without filesystem node_modules.
1137
+
1138
+ ## [0.45.1] - 2026-01-13
1139
+
1140
+ ### Changed
1141
+
1142
+ - `/share` now outputs `buildwithpi.ai` session preview URLs instead of `shittycodingagent.ai`
1143
+
1144
+ ## [0.45.0] - 2026-01-13
1145
+
1146
+ ### Added
1147
+
1148
+ - MiniMax provider support: set `MINIMAX_API_KEY` and use `minimax/MiniMax-M2.1` ([#656](https://github.com/badlogic/pi-mono/pull/656) by [@dannote](https://github.com/dannote))
1149
+ - `/scoped-models`: Alt+Up/Down to reorder enabled models. Order is preserved when saving with Ctrl+S and determines Ctrl+P cycling order. ([#676](https://github.com/badlogic/pi-mono/pull/676) by [@thomasmhr](https://github.com/thomasmhr))
1150
+ - Amazon Bedrock provider support (experimental, tested with Anthropic Claude models only) ([#494](https://github.com/badlogic/pi-mono/pull/494) by [@unexge](https://github.com/unexge))
1151
+ - Extension example: `sandbox/` for OS-level bash sandboxing using `@anthropic-ai/sandbox-runtime` with per-project config ([#673](https://github.com/badlogic/pi-mono/pull/673) by [@dannote](https://github.com/dannote))
1152
+ - Print mode JSON output now emits the session header as the first line.
1153
+
1154
+ ## [0.44.0] - 2026-01-12
1155
+
1156
+ ### Breaking Changes
1157
+
1158
+ - `pi.getAllTools()` now returns `ToolInfo[]` (with `name` and `description`) instead of `string[]`. Extensions that only need names can use `.map(t => t.name)`. ([#648](https://github.com/badlogic/pi-mono/pull/648) by [@carsonfarmer](https://github.com/carsonfarmer))
1159
+
1160
+ ### Added
1161
+
1162
+ - Session naming: `/name <name>` command sets a display name shown in the session selector instead of the first message. Useful for distinguishing forked sessions. Extensions can use `pi.setSessionName()` and `pi.getSessionName()`. ([#650](https://github.com/badlogic/pi-mono/pull/650) by [@scutifer](https://github.com/scutifer))
1163
+ - Extension example: `notify.ts` for desktop notifications via OSC 777 escape sequence ([#658](https://github.com/badlogic/pi-mono/pull/658) by [@ferologics](https://github.com/ferologics))
1164
+ - Inline hint for queued messages showing the `Alt+Up` restore shortcut ([#657](https://github.com/badlogic/pi-mono/pull/657) by [@tmustier](https://github.com/tmustier))
1165
+ - Page-up/down navigation in `/resume` session selector to jump by 5 items ([#662](https://github.com/badlogic/pi-mono/pull/662) by [@aliou](https://github.com/aliou))
1166
+ - Fuzzy search in `/settings` menu: type to filter settings by label ([#643](https://github.com/badlogic/pi-mono/pull/643) by [@ninlds](https://github.com/ninlds))
1167
+
1168
+ ### Fixed
1169
+
1170
+ - Session selector now stays open when current folder has no sessions, allowing Tab to switch to "all" scope ([#661](https://github.com/badlogic/pi-mono/pull/661) by [@aliou](https://github.com/aliou))
1171
+ - Extensions using theme utilities like `getSettingsListTheme()` now work in dev mode with tsx
1172
+
1173
+ ## [0.43.0] - 2026-01-11
1174
+
1175
+ ### Breaking Changes
1176
+
1177
+ - Extension editor (`ctx.ui.editor()`) now uses Enter to submit and Shift+Enter for newlines, matching the main editor. Previously used Ctrl+Enter to submit. Extensions with hardcoded "ctrl+enter" hints need updating. ([#642](https://github.com/badlogic/pi-mono/pull/642) by [@mitsuhiko](https://github.com/mitsuhiko))
1178
+ - Renamed `/branch` command to `/fork` ([#641](https://github.com/badlogic/pi-mono/issues/641))
1179
+ - RPC: `branch` → `fork`, `get_branch_messages` → `get_fork_messages`
1180
+ - SDK: `branch()` → `fork()`, `getBranchMessages()` → `getForkMessages()`
1181
+ - AgentSession: `branch()` → `fork()`, `getUserMessagesForBranching()` → `getUserMessagesForForking()`
1182
+ - Extension events: `session_before_branch` → `session_before_fork`, `session_branch` → `session_fork`
1183
+ - Settings: `doubleEscapeAction: "branch" | "tree"` → `"fork" | "tree"`
1184
+ - `SessionManager.list()` and `SessionManager.listAll()` are now async, returning `Promise<SessionInfo[]>`. Callers must await them. ([#620](https://github.com/badlogic/pi-mono/pull/620) by [@tmustier](https://github.com/tmustier))
1185
+
1186
+ ### Added
1187
+ - `/resume` selector now toggles between current-folder and all sessions with Tab, showing the session cwd in the All view and loading progress. ([#620](https://github.com/badlogic/pi-mono/pull/620) by [@tmustier](https://github.com/tmustier))
1188
+ - `SessionManager.list()` and `SessionManager.listAll()` accept optional `onProgress` callback for progress updates
1189
+ - `SessionInfo.cwd` field containing the session's working directory (empty string for old sessions)
1190
+ - `SessionListProgress` type export for progress callbacks
1191
+ - `/scoped-models` command to enable/disable models for Ctrl+P cycling. Changes are session-only by default; press Ctrl+S to persist to settings.json. ([#626](https://github.com/badlogic/pi-mono/pull/626) by [@CarlosGtrz](https://github.com/CarlosGtrz))
1192
+ - `model_select` extension hook fires when model changes via `/model`, model cycling, or session restore with `source` field and `previousModel` ([#628](https://github.com/badlogic/pi-mono/pull/628) by [@marckrenn](https://github.com/marckrenn))
1193
+ - `ctx.ui.setWorkingMessage()` extension API to customize the "Working..." message during streaming ([#625](https://github.com/badlogic/pi-mono/pull/625) by [@nicobailon](https://github.com/nicobailon))
1194
+ - Skill slash commands: loaded skills are registered as `/skill:name` commands for quick access. Toggle via `/settings` or `skills.enableSkillCommands` in settings.json. ([#630](https://github.com/badlogic/pi-mono/pull/630) by [@Dwsy](https://github.com/Dwsy))
1195
+ - Slash command autocomplete now uses fuzzy matching (type `/skbra` to match `/skill:brave-search`)
1196
+ - `/tree` branch summarization now offers three options: "No summary", "Summarize", and "Summarize with custom prompt". Custom prompts are appended as additional focus to the default summarization instructions. ([#642](https://github.com/badlogic/pi-mono/pull/642) by [@mitsuhiko](https://github.com/mitsuhiko))
1197
+
1198
+ ### Fixed
1199
+
1200
+ - Missing spacer between assistant message and text editor ([#655](https://github.com/badlogic/pi-mono/issues/655))
1201
+ - Session picker respects custom keybindings when using `--resume` ([#633](https://github.com/badlogic/pi-mono/pull/633) by [@aos](https://github.com/aos))
1202
+ - Custom footer extensions now see model changes: `ctx.model` is now a getter that returns the current model instead of a snapshot from when the context was created ([#634](https://github.com/badlogic/pi-mono/pull/634) by [@ogulcancelik](https://github.com/ogulcancelik))
1203
+ - Footer git branch not updating after external branch switches. Git uses atomic writes (temp file + rename), which changes the inode and breaks `fs.watch` on the file. Now watches the directory instead.
1204
+ - Extension loading errors are now displayed to the user instead of being silently ignored ([#639](https://github.com/badlogic/pi-mono/pull/639) by [@aliou](https://github.com/aliou))
1205
+
1206
+ ## [0.42.5] - 2026-01-11
1207
+
1208
+ ### Fixed
1209
+
1210
+ - Reduced flicker by only re-rendering changed lines ([#617](https://github.com/badlogic/pi-mono/pull/617) by [@ogulcancelik](https://github.com/ogulcancelik)). No worries tho, there's still a little flicker in the VS Code Terminal. Praise the flicker.
1211
+ - Cursor position tracking when content shrinks with unchanged remaining lines
1212
+ - TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended ([#599](https://github.com/badlogic/pi-mono/issues/599))
1213
+ - Pasted content containing Kitty key release patterns (e.g., `:3F` in MAC addresses) was incorrectly filtered out ([#623](https://github.com/badlogic/pi-mono/pull/623) by [@ogulcancelik](https://github.com/ogulcancelik))
1214
+
1215
+ ## [0.42.4] - 2026-01-10
1216
+
1217
+ ### Fixed
1218
+
1219
+ - Bash output expanded hint now says "(ctrl+o to collapse)" ([#610](https://github.com/badlogic/pi-mono/pull/610) by [@tallshort](https://github.com/tallshort))
1220
+ - Fixed UTF-8 text corruption in remote bash execution (SSH, containers) by using streaming TextDecoder ([#608](https://github.com/badlogic/pi-mono/issues/608))
1221
+
1222
+ ## [0.42.3] - 2026-01-10
1223
+
1224
+ ### Changed
1225
+
1226
+ - OpenAI Codex: updated to use bundled system prompt from upstream
1227
+
1228
+ ## [0.42.2] - 2026-01-10
1229
+
1230
+ ### Added
1231
+
1232
+ - `/model <search>` now pre-filters the model selector or auto-selects on exact match. Use `provider/model` syntax to disambiguate (e.g., `/model openai/gpt-4`). ([#587](https://github.com/badlogic/pi-mono/pull/587) by [@zedrdave](https://github.com/zedrdave))
1233
+ - `FooterDataProvider` for custom footers: `ctx.ui.setFooter()` now receives a third `footerData` parameter providing `getGitBranch()`, `getExtensionStatuses()`, and `onBranchChange()` for reactive updates ([#600](https://github.com/badlogic/pi-mono/pull/600) by [@nicobailon](https://github.com/nicobailon))
1234
+ - `Alt+Up` hotkey to restore queued steering/follow-up messages back into the editor without aborting the current run ([#604](https://github.com/badlogic/pi-mono/pull/604) by [@tmustier](https://github.com/tmustier))
1235
+
1236
+ ### Fixed
1237
+
1238
+ - Fixed LM Studio compatibility for OpenAI Responses tool strict mapping in the ai provider ([#598](https://github.com/badlogic/pi-mono/pull/598) by [@gnattu](https://github.com/gnattu))
1239
+
1240
+ ## [0.42.1] - 2026-01-09
1241
+
1242
+ ### Fixed
1243
+
1244
+ - Symlinked directories in `prompts/` folders are now followed when loading prompt templates ([#601](https://github.com/badlogic/pi-mono/pull/601) by [@aliou](https://github.com/aliou))
1245
+
1246
+ ## [0.42.0] - 2026-01-09
1247
+
1248
+ ### Added
1249
+
1250
+ - Added OpenCode Zen provider support. Set `OPENCODE_API_KEY` env var and use `opencode/<model-id>` (e.g., `opencode/claude-opus-4-5`).
1251
+
1252
+ ## [0.41.0] - 2026-01-09
1253
+
1254
+ ### Added
1255
+
1256
+ - Anthropic OAuth support is back! Use `/login` to authenticate with your Claude Pro/Max subscription.
1257
+
1258
+ ## [0.40.1] - 2026-01-09
1259
+
1260
+ ### Removed
1261
+
1262
+ - Anthropic OAuth support (`/login`). Use API keys instead.
1263
+
1264
+ ## [0.40.0] - 2026-01-08
1265
+
1266
+ ### Added
1267
+
1268
+ - Documentation on component invalidation and theme changes in `docs/tui.md`
1269
+
1270
+ ### Fixed
1271
+
1272
+ - Components now properly rebuild their content on theme change (tool executions, assistant messages, bash executions, custom messages, branch/compaction summaries)
1273
+
1274
+ ## [0.39.1] - 2026-01-08
1275
+
1276
+ ### Fixed
1277
+
1278
+ - `setTheme()` now triggers a full rerender so previously rendered components update with the new theme colors
1279
+ - `mac-system-theme.ts` example now polls every 2 seconds and uses `osascript` for real-time macOS appearance detection
1280
+
1281
+ ## [0.39.0] - 2026-01-08
1282
+
1283
+ ### Breaking Changes
1284
+
1285
+ - `before_agent_start` event now receives `systemPrompt` in the event object and returns `systemPrompt` (full replacement) instead of `systemPromptAppend`. Extensions that were appending must now use `event.systemPrompt + extra` pattern. ([#575](https://github.com/badlogic/pi-mono/issues/575))
1286
+ - `discoverSkills()` now returns `{ skills: Skill[], warnings: SkillWarning[] }` instead of `Skill[]`. This allows callers to handle skill loading warnings. ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv))
1287
+
1288
+ ### Added
1289
+
1290
+ - `ctx.ui.getAllThemes()`, `ctx.ui.getTheme(name)`, and `ctx.ui.setTheme(name | Theme)` methods for extensions to list, load, and switch themes at runtime ([#576](https://github.com/badlogic/pi-mono/pull/576))
1291
+ - `--no-tools` flag to disable all built-in tools, allowing extension-only tool setups ([#557](https://github.com/badlogic/pi-mono/pull/557) by [@cv](https://github.com/cv))
1292
+ - Pluggable operations for built-in tools enabling remote execution via SSH or other transports ([#564](https://github.com/badlogic/pi-mono/issues/564)). Interfaces: `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
1293
+ - `user_bash` event for intercepting user `!`/`!!` commands, allowing extensions to redirect to remote systems ([#528](https://github.com/badlogic/pi-mono/issues/528))
1294
+ - `setActiveTools()` in ExtensionAPI for dynamic tool management
1295
+ - Built-in renderers used automatically for tool overrides without custom `renderCall`/`renderResult`
1296
+ - `ssh.ts` example: remote tool execution via `--ssh user@host:/path`
1297
+ - `interactive-shell.ts` example: run interactive commands (vim, git rebase, htop) with full terminal access via `!i` prefix or auto-detection
1298
+ - Wayland clipboard support for `/copy` command using wl-copy with xclip/xsel fallback ([#570](https://github.com/badlogic/pi-mono/pull/570) by [@OgulcanCelik](https://github.com/OgulcanCelik))
1299
+ - **Experimental:** `ctx.ui.custom()` now accepts `{ overlay: true }` option for floating modal components that composite over existing content without clearing the screen ([#558](https://github.com/badlogic/pi-mono/pull/558) by [@nicobailon](https://github.com/nicobailon))
1300
+ - `AgentSession.skills` and `AgentSession.skillWarnings` properties to access loaded skills without rediscovery ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv))
1301
+
1302
+ ### Fixed
1303
+
1304
+ - String `systemPrompt` in `createAgentSession()` now works as a full replacement instead of having context files and skills appended, matching documented behavior ([#543](https://github.com/badlogic/pi-mono/issues/543))
1305
+ - Update notification for bun binary installs now shows release download URL instead of npm command ([#567](https://github.com/badlogic/pi-mono/pull/567) by [@ferologics](https://github.com/ferologics))
1306
+ - ESC key now works during "Working..." state after auto-retry ([#568](https://github.com/badlogic/pi-mono/pull/568) by [@tmustier](https://github.com/tmustier))
1307
+ - Abort messages now show correct retry attempt count (e.g., "Aborted after 2 retry attempts") ([#568](https://github.com/badlogic/pi-mono/pull/568) by [@tmustier](https://github.com/tmustier))
1308
+ - Fixed Antigravity provider returning 429 errors despite available quota ([#571](https://github.com/badlogic/pi-mono/pull/571) by [@ben-vargas](https://github.com/ben-vargas))
1309
+ - Fixed malformed thinking text in Gemini/Antigravity responses where thinking content appeared as regular text or vice versa. Cross-model conversations now properly convert thinking blocks to plain text. ([#561](https://github.com/badlogic/pi-mono/issues/561))
1310
+ - `--no-skills` flag now correctly prevents skills from loading in interactive mode ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv))
1311
+
1312
+ ## [0.38.0] - 2026-01-08
1313
+
1314
+ ### Breaking Changes
1315
+
1316
+ - `ctx.ui.custom()` factory signature changed from `(tui, theme, done)` to `(tui, theme, keybindings, done)` for keybinding access in custom components
1317
+ - `LoadedExtension` type renamed to `Extension`
1318
+ - `LoadExtensionsResult.setUIContext()` removed, replaced with `runtime: ExtensionRuntime`
1319
+ - `ExtensionRunner` constructor now requires `runtime: ExtensionRuntime` as second parameter
1320
+ - `ExtensionRunner.initialize()` signature changed from options object to positional params `(actions, contextActions, commandContextActions?, uiContext?)`
1321
+ - `ExtensionRunner.getHasUI()` renamed to `hasUI()`
1322
+ - OpenAI Codex model aliases removed (`gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `codex-mini-latest`). Use canonical IDs: `gpt-5.1`, `gpt-5.1-codex-mini`, `gpt-5.2`, `gpt-5.2-codex`. ([#536](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr))
1323
+
1324
+ ### Added
1325
+
1326
+ - `--no-extensions` flag to disable extension discovery while still allowing explicit `-e` paths ([#524](https://github.com/badlogic/pi-mono/pull/524) by [@cv](https://github.com/cv))
1327
+ - SDK: `InteractiveMode`, `runPrintMode()`, `runRpcMode()` exported for building custom run modes. See `docs/sdk.md`.
1328
+ - `PI_SKIP_VERSION_CHECK` environment variable to disable new version notifications at startup ([#549](https://github.com/badlogic/pi-mono/pull/549) by [@aos](https://github.com/aos))
1329
+ - `thinkingBudgets` setting to customize token budgets per thinking level for token-based providers ([#529](https://github.com/badlogic/pi-mono/pull/529) by [@melihmucuk](https://github.com/melihmucuk))
1330
+ - Extension UI dialogs (`ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`) now support a `timeout` option with live countdown display ([#522](https://github.com/badlogic/pi-mono/pull/522) by [@nicobailon](https://github.com/nicobailon))
1331
+ - Extensions can now provide custom editor components via `ctx.ui.setEditorComponent()`. See `examples/extensions/modal-editor.ts` and `docs/tui.md` Pattern 7.
1332
+ - Extension factories can now be async, enabling dynamic imports and lazy-loaded dependencies ([#513](https://github.com/badlogic/pi-mono/pull/513) by [@austinm911](https://github.com/austinm911))
1333
+ - `ctx.shutdown()` is now available in extension contexts for requesting a graceful shutdown. In interactive mode, shutdown is deferred until the agent becomes idle (after processing all queued steering and follow-up messages). In RPC mode, shutdown is deferred until after completing the current command response. In print mode, shutdown is a no-op as the process exits automatically when prompts complete. ([#542](https://github.com/badlogic/pi-mono/pull/542) by [@kaofelix](https://github.com/kaofelix))
1334
+
1335
+ ### Fixed
1336
+
1337
+ - Default thinking level from settings now applies correctly when `enabledModels` is configured ([#540](https://github.com/badlogic/pi-mono/pull/540) by [@ferologics](https://github.com/ferologics))
1338
+ - External edits to `settings.json` while pi is running are now preserved when pi saves settings ([#527](https://github.com/badlogic/pi-mono/pull/527) by [@ferologics](https://github.com/ferologics))
1339
+ - Overflow-based compaction now skips if error came from a different model or was already handled by a previous compaction ([#535](https://github.com/badlogic/pi-mono/pull/535) by [@mitsuhiko](https://github.com/mitsuhiko))
1340
+ - OpenAI Codex context window reduced from 400k to 272k tokens to match Codex CLI defaults and prevent 400 errors ([#536](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr))
1341
+ - Context overflow detection now recognizes `context_length_exceeded` errors.
1342
+ - Key presses no longer dropped when input is batched over SSH ([#538](https://github.com/badlogic/pi-mono/issues/538))
1343
+ - Clipboard image support now works on Alpine Linux and other musl-based distros ([#533](https://github.com/badlogic/pi-mono/issues/533))
1344
+
1345
+ ## [0.37.8] - 2026-01-07
1346
+
1347
+ ## [0.37.7] - 2026-01-07
1348
+
1349
+ ## [0.37.6] - 2026-01-06
1350
+
1351
+ ### Added
1352
+
1353
+ - Extension UI dialogs (`ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`) now accept an optional `AbortSignal` to programmatically dismiss dialogs. Useful for implementing timeouts. See `examples/extensions/timed-confirm.ts`. ([#474](https://github.com/badlogic/pi-mono/issues/474))
1354
+ - HTML export now shows bridge prompts in model change messages for Codex sessions ([#510](https://github.com/badlogic/pi-mono/pull/510) by [@mitsuhiko](https://github.com/mitsuhiko))
1355
+
1356
+ ## [0.37.5] - 2026-01-06
1357
+
1358
+ ### Added
1359
+
1360
+ - ExtensionAPI: `setModel()`, `getThinkingLevel()`, `setThinkingLevel()` methods for extensions to change model and thinking level at runtime ([#509](https://github.com/badlogic/pi-mono/issues/509))
1361
+ - Exported truncation utilities for custom tools: `truncateHead`, `truncateTail`, `truncateLine`, `formatSize`, `DEFAULT_MAX_BYTES`, `DEFAULT_MAX_LINES`, `TruncationOptions`, `TruncationResult`
1362
+ - New example `truncated-tool.ts` demonstrating proper output truncation with custom rendering for extensions
1363
+ - New example `preset.ts` demonstrating preset configurations with model/thinking/tools switching ([#347](https://github.com/badlogic/pi-mono/issues/347))
1364
+ - Documentation for output truncation best practices in `docs/extensions.md`
1365
+ - Exported all UI components for extensions: `ArminComponent`, `AssistantMessageComponent`, `BashExecutionComponent`, `BorderedLoader`, `BranchSummaryMessageComponent`, `CompactionSummaryMessageComponent`, `CustomEditor`, `CustomMessageComponent`, `DynamicBorder`, `ExtensionEditorComponent`, `ExtensionInputComponent`, `ExtensionSelectorComponent`, `FooterComponent`, `LoginDialogComponent`, `ModelSelectorComponent`, `OAuthSelectorComponent`, `SessionSelectorComponent`, `SettingsSelectorComponent`, `ShowImagesSelectorComponent`, `ThemeSelectorComponent`, `ThinkingSelectorComponent`, `ToolExecutionComponent`, `TreeSelectorComponent`, `UserMessageComponent`, `UserMessageSelectorComponent`, plus utilities `renderDiff`, `truncateToVisualLines`
1366
+ - `docs/tui.md`: Common Patterns section with copy-paste code for SelectList, BorderedLoader, SettingsList, setStatus, setWidget, setFooter
1367
+ - `docs/tui.md`: Key Rules section documenting critical patterns for extension UI development
1368
+ - `docs/extensions.md`: Exhaustive example links for all ExtensionAPI methods and events
1369
+ - System prompt now references `docs/tui.md` for TUI component development
1370
+
1371
+ ## [0.37.4] - 2026-01-06
1372
+
1373
+ ### Added
1374
+
1375
+ - Session picker (`pi -r`) and `--session` flag now support searching/resuming by session ID (UUID prefix) ([#495](https://github.com/badlogic/pi-mono/issues/495) by [@arunsathiya](https://github.com/arunsathiya))
1376
+ - Extensions can now replace the startup header with `ctx.ui.setHeader()`, see `examples/extensions/custom-header.ts` ([#500](https://github.com/badlogic/pi-mono/pull/500) by [@tudoroancea](https://github.com/tudoroancea))
1377
+
1378
+ ### Changed
1379
+
1380
+ - Startup help text: fixed misleading "ctrl+k to delete line" to "ctrl+k to delete to end"
1381
+ - Startup help text and `/hotkeys`: added `!!` shortcut for running bash without adding output to context
1382
+
1383
+ ### Fixed
1384
+
1385
+ - Queued steering/follow-up messages no longer wipe unsent editor input ([#503](https://github.com/badlogic/pi-mono/pull/503) by [@tmustier](https://github.com/tmustier))
1386
+ - OAuth token refresh failure no longer crashes app at startup, allowing user to `/login` to re-authenticate ([#498](https://github.com/badlogic/pi-mono/issues/498))
1387
+
1388
+ ## [0.37.3] - 2026-01-06
1389
+
1390
+ ### Added
1391
+
1392
+ - Extensions can now replace the footer with `ctx.ui.setFooter()`, see `examples/extensions/custom-footer.ts` ([#481](https://github.com/badlogic/pi-mono/issues/481))
1393
+ - Session ID is now forwarded to LLM providers for session-based caching (used by OpenAI Codex for prompt caching).
1394
+ - Added `blockImages` setting to prevent images from being sent to LLM providers ([#492](https://github.com/badlogic/pi-mono/pull/492) by [@jsinge97](https://github.com/jsinge97))
1395
+ - Extensions can now send user messages via `pi.sendUserMessage()` ([#483](https://github.com/badlogic/pi-mono/issues/483))
1396
+
1397
+ ### Fixed
1398
+
1399
+ - Add `minimatch` as a direct dependency for explicit imports.
1400
+ - Status bar now shows correct git branch when running in a git worktree ([#490](https://github.com/badlogic/pi-mono/pull/490) by [@kcosr](https://github.com/kcosr))
1401
+ - Interactive mode: Ctrl+V clipboard image paste now works on Wayland sessions by using `wl-paste` with `xclip` fallback ([#488](https://github.com/badlogic/pi-mono/pull/488) by [@ghoulr](https://github.com/ghoulr))
1402
+
1403
+ ## [0.37.2] - 2026-01-05
1404
+
1405
+ ### Fixed
1406
+
1407
+ - Extension directories in `settings.json` now respect `package.json` manifests, matching global extension behavior ([#480](https://github.com/badlogic/pi-mono/pull/480) by [@prateekmedia](https://github.com/prateekmedia))
1408
+ - Share viewer: deep links now scroll to the target message when opened via `/share`
1409
+ - Bash tool now handles spawn errors gracefully instead of crashing the agent (missing cwd, invalid shell path) ([#479](https://github.com/badlogic/pi-mono/pull/479) by [@robinwander](https://github.com/robinwander))
1410
+
1411
+ ## [0.37.1] - 2026-01-05
1412
+
1413
+ ### Fixed
1414
+
1415
+ - Share viewer: copy-link buttons now generate correct URLs when session is viewed via `/share` (iframe context)
1416
+
1417
+ ## [0.37.0] - 2026-01-05
1418
+
1419
+ ### Added
1420
+
1421
+ - Share viewer: copy-link button on messages to share URLs that navigate directly to a specific message ([#477](https://github.com/badlogic/pi-mono/pull/477) by [@lockmeister](https://github.com/lockmeister))
1422
+ - Extension example: add `claude-rules` to load `.claude/rules/` entries into the system prompt ([#461](https://github.com/badlogic/pi-mono/pull/461) by [@vaayne](https://github.com/vaayne))
1423
+ - Headless OAuth login: all providers now show paste input for manual URL/code entry, works over SSH without DISPLAY ([#428](https://github.com/badlogic/pi-mono/pull/428) by [@ben-vargas](https://github.com/ben-vargas), [#468](https://github.com/badlogic/pi-mono/pull/468) by [@crcatala](https://github.com/crcatala))
1424
+
1425
+ ### Changed
1426
+
1427
+ - OAuth login UI now uses dedicated dialog component with consistent borders
1428
+ - Assume truecolor support for all terminals except `dumb`, empty, or `linux` (fixes colors over SSH)
1429
+ - OpenAI Codex clean-up: removed per-thinking-level model variants, thinking level is now set separately and the provider clamps to what each model supports internally (initial implementation in [#472](https://github.com/badlogic/pi-mono/pull/472) by [@ben-vargas](https://github.com/ben-vargas))
1430
+
1431
+ ### Fixed
1432
+
1433
+ - Messages submitted during compaction are queued and delivered after compaction completes, preserving steering and follow-up behavior. Extension commands execute immediately during compaction. ([#476](https://github.com/badlogic/pi-mono/pull/476) by [@tmustier](https://github.com/tmustier))
1434
+ - Managed binaries (`fd`, `rg`) now stored in `~/.pi/agent/bin/` instead of `tools/`, eliminating false deprecation warnings ([#470](https://github.com/badlogic/pi-mono/pull/470) by [@mcinteerj](https://github.com/mcinteerj))
1435
+ - Extensions defined in `settings.json` were not loaded ([#463](https://github.com/badlogic/pi-mono/pull/463) by [@melihmucuk](https://github.com/melihmucuk))
1436
+ - OAuth refresh no longer logs users out when multiple pi instances are running ([#466](https://github.com/badlogic/pi-mono/pull/466) by [@Cursivez](https://github.com/Cursivez))
1437
+ - Migration warnings now ignore `fd.exe` and `rg.exe` in `tools/` on Windows ([#458](https://github.com/badlogic/pi-mono/pull/458) by [@carlosgtrz](https://github.com/carlosgtrz))
1438
+ - CI: add `examples/extensions/with-deps` to workspaces to fix typecheck ([#467](https://github.com/badlogic/pi-mono/pull/467) by [@aliou](https://github.com/aliou))
1439
+ - SDK: passing `extensions: []` now disables extension discovery as documented ([#465](https://github.com/badlogic/pi-mono/pull/465) by [@aliou](https://github.com/aliou))
1440
+
1441
+ ## [0.36.0] - 2026-01-05
1442
+
1443
+ ### Added
1444
+
1445
+ - Experimental: OpenAI Codex OAuth provider support: access Codex models via ChatGPT Plus/Pro subscription using `/login openai-codex` ([#451](https://github.com/badlogic/pi-mono/pull/451) by [@kim0](https://github.com/kim0))
1446
+
1447
+ ## [0.35.0] - 2026-01-05
1448
+
1449
+ This release unifies hooks and custom tools into a single "extensions" system and renames "slash commands" to "prompt templates". ([#454](https://github.com/badlogic/pi-mono/issues/454))
1450
+
1451
+ **Before migrating, read:**
1452
+
1453
+ - [docs/extensions.md](docs/extensions.md) - Full API reference
1454
+ - [README.md](README.md) - Extensions section with examples
1455
+ - [examples/extensions/](examples/extensions/) - Working examples
1456
+
1457
+ ### Extensions Migration
1458
+
1459
+ Hooks and custom tools are now unified as **extensions**. Both were TypeScript modules exporting a factory function that receives an API object. Now there's one concept, one discovery location, one CLI flag, one settings.json entry.
1460
+
1461
+ **Automatic migration:**
1462
+
1463
+ - `commands/` directories are automatically renamed to `prompts/` on startup (both `~/.pi/agent/commands/` and `.pi/commands/`)
1464
+
1465
+ **Manual migration required:**
1466
+
1467
+ 1. Move files from `hooks/` and `tools/` directories to `extensions/` (deprecation warnings shown on startup)
1468
+ 2. Update imports and type names in your extension code
1469
+ 3. Update `settings.json` if you have explicit hook and custom tool paths configured
1470
+
1471
+ **Directory changes:**
1472
+
1473
+ ```
1474
+ # Before
1475
+ ~/.pi/agent/hooks/*.ts → ~/.pi/agent/extensions/*.ts
1476
+ ~/.pi/agent/tools/*.ts → ~/.pi/agent/extensions/*.ts
1477
+ .pi/hooks/*.ts → .pi/extensions/*.ts
1478
+ .pi/tools/*.ts → .pi/extensions/*.ts
1479
+ ```
1480
+
1481
+ **Extension discovery rules** (in `extensions/` directories):
1482
+
1483
+ 1. **Direct files:** `extensions/*.ts` or `*.js` → loaded directly
1484
+ 2. **Subdirectory with index:** `extensions/myext/index.ts` → loaded as single extension
1485
+ 3. **Subdirectory with package.json:** `extensions/myext/package.json` with `"pi"` field → loads declared paths
1486
+
1487
+ ```json
1488
+ // extensions/my-package/package.json
1489
+ {
1490
+ "name": "my-extension-package",
1491
+ "dependencies": { "zod": "^3.0.0" },
1492
+ "pi": {
1493
+ "extensions": ["./src/main.ts", "./src/tools.ts"]
1494
+ }
1495
+ }
1496
+ ```
1497
+
1498
+ No recursion beyond one level. Complex packages must use the `package.json` manifest. Dependencies are resolved via jiti, and extensions can be published to and installed from npm.
1499
+
1500
+ **Type renames:**
1501
+
1502
+ - `HookAPI` → `ExtensionAPI`
1503
+ - `HookContext` → `ExtensionContext`
1504
+ - `HookCommandContext` → `ExtensionCommandContext`
1505
+ - `HookUIContext` → `ExtensionUIContext`
1506
+ - `CustomToolAPI` → `ExtensionAPI` (merged)
1507
+ - `CustomToolContext` → `ExtensionContext` (merged)
1508
+ - `CustomToolUIContext` → `ExtensionUIContext`
1509
+ - `CustomTool` → `ToolDefinition`
1510
+ - `CustomToolFactory` → `ExtensionFactory`
1511
+ - `HookMessage` → `CustomMessage`
1512
+
1513
+ **Import changes:**
1514
+
1515
+ ```typescript
1516
+ // Before (hook)
1517
+ import type { HookAPI, HookContext } from "@mariozechner/pi-coding-agent";
1518
+ export default function (pi: HookAPI) { ... }
1519
+
1520
+ // Before (custom tool)
1521
+ import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
1522
+ const factory: CustomToolFactory = (pi) => ({ name: "my_tool", ... });
1523
+ export default factory;
1524
+
1525
+ // After (both are now extensions)
1526
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
1527
+ export default function (pi: ExtensionAPI) {
1528
+ pi.on("tool_call", async (event, ctx) => { ... });
1529
+ pi.registerTool({ name: "my_tool", ... });
1530
+ }
1531
+ ```
1532
+
1533
+ **Custom tools now have full context access.** Tools registered via `pi.registerTool()` now receive the same `ctx` object that event handlers receive. Previously, custom tools had limited context. Now all extension code shares the same capabilities:
1534
+
1535
+ - `pi.registerTool()` - Register tools the LLM can call
1536
+ - `pi.registerCommand()` - Register commands like `/mycommand`
1537
+ - `pi.registerShortcut()` - Register keyboard shortcuts (shown in `/hotkeys`)
1538
+ - `pi.registerFlag()` - Register CLI flags (shown in `--help`)
1539
+ - `pi.registerMessageRenderer()` - Custom TUI rendering for message types
1540
+ - `pi.on()` - Subscribe to lifecycle events (tool_call, session_start, etc.)
1541
+ - `pi.sendMessage()` - Inject messages into the conversation
1542
+ - `pi.appendEntry()` - Persist custom data in session (survives restart/branch)
1543
+ - `pi.exec()` - Run shell commands
1544
+ - `pi.getActiveTools()` / `pi.setActiveTools()` - Dynamic tool enable/disable
1545
+ - `pi.getAllTools()` - List all available tools
1546
+ - `pi.events` - Event bus for cross-extension communication
1547
+ - `ctx.ui.confirm()` / `select()` / `input()` - User prompts
1548
+ - `ctx.ui.notify()` - Toast notifications
1549
+ - `ctx.ui.setStatus()` - Persistent status in footer (multiple extensions can set their own)
1550
+ - `ctx.ui.setWidget()` - Widget display above editor
1551
+ - `ctx.ui.setTitle()` - Set terminal window title
1552
+ - `ctx.ui.custom()` - Full TUI component with keyboard handling
1553
+ - `ctx.ui.editor()` - Multi-line text editor with external editor support
1554
+ - `ctx.sessionManager` - Read session entries, get branch history
1555
+
1556
+ **Settings changes:**
1557
+
1558
+ ```json
1559
+ // Before
1560
+ {
1561
+ "hooks": ["./my-hook.ts"],
1562
+ "customTools": ["./my-tool.ts"]
1563
+ }
1564
+
1565
+ // After
1566
+ {
1567
+ "extensions": ["./my-extension.ts"]
1568
+ }
1569
+ ```
1570
+
1571
+ **CLI changes:**
1572
+
1573
+ ```bash
1574
+ # Before
1575
+ pi --hook ./safety.ts --tool ./todo.ts
1576
+
1577
+ # After
1578
+ pi --extension ./safety.ts -e ./todo.ts
1579
+ ```
1580
+
1581
+ ### Prompt Templates Migration
1582
+
1583
+ "Slash commands" (markdown files defining reusable prompts invoked via `/name`) are renamed to "prompt templates" to avoid confusion with extension-registered commands.
1584
+
1585
+ **Automatic migration:** The `commands/` directory is automatically renamed to `prompts/` on startup (if `prompts/` doesn't exist). Works for both regular directories and symlinks.
1586
+
1587
+ **Directory changes:**
1588
+
1589
+ ```
1590
+ ~/.pi/agent/commands/*.md → ~/.pi/agent/prompts/*.md
1591
+ .pi/commands/*.md → .pi/prompts/*.md
1592
+ ```
1593
+
1594
+ **SDK type renames:**
1595
+
1596
+ - `FileSlashCommand` → `PromptTemplate`
1597
+ - `LoadSlashCommandsOptions` → `LoadPromptTemplatesOptions`
1598
+
1599
+ **SDK function renames:**
1600
+
1601
+ - `discoverSlashCommands()` → `discoverPromptTemplates()`
1602
+ - `loadSlashCommands()` → `loadPromptTemplates()`
1603
+ - `expandSlashCommand()` → `expandPromptTemplate()`
1604
+ - `getCommandsDir()` → `getPromptsDir()`
1605
+
1606
+ **SDK option renames:**
1607
+
1608
+ - `CreateAgentSessionOptions.slashCommands` → `.promptTemplates`
1609
+ - `AgentSession.fileCommands` → `.promptTemplates`
1610
+ - `PromptOptions.expandSlashCommands` → `.expandPromptTemplates`
1611
+
1612
+ ### SDK Migration
1613
+
1614
+ **Discovery functions:**
1615
+
1616
+ - `discoverAndLoadHooks()` → `discoverAndLoadExtensions()`
1617
+ - `discoverAndLoadCustomTools()` → merged into `discoverAndLoadExtensions()`
1618
+ - `loadHooks()` → `loadExtensions()`
1619
+ - `loadCustomTools()` → merged into `loadExtensions()`
1620
+
1621
+ **Runner and wrapper:**
1622
+
1623
+ - `HookRunner` → `ExtensionRunner`
1624
+ - `wrapToolsWithHooks()` → `wrapToolsWithExtensions()`
1625
+ - `wrapToolWithHooks()` → `wrapToolWithExtensions()`
1626
+
1627
+ **CreateAgentSessionOptions:**
1628
+
1629
+ - `.hooks` → removed (use `.additionalExtensionPaths` for paths)
1630
+ - `.additionalHookPaths` → `.additionalExtensionPaths`
1631
+ - `.preloadedHooks` → `.preloadedExtensions`
1632
+ - `.customTools` type changed: `Array<{ path?; tool: CustomTool }>` → `ToolDefinition[]`
1633
+ - `.additionalCustomToolPaths` → merged into `.additionalExtensionPaths`
1634
+ - `.slashCommands` → `.promptTemplates`
1635
+
1636
+ **AgentSession:**
1637
+
1638
+ - `.hookRunner` → `.extensionRunner`
1639
+ - `.fileCommands` → `.promptTemplates`
1640
+ - `.sendHookMessage()` → `.sendCustomMessage()`
1641
+
1642
+ ### Session Migration
1643
+
1644
+ **Automatic.** Session version bumped from 2 to 3. Existing sessions are migrated on first load:
1645
+
1646
+ - Message role `"hookMessage"` → `"custom"`
1647
+
1648
+ ### Breaking Changes
1649
+
1650
+ - **Settings:** `hooks` and `customTools` arrays replaced with single `extensions` array
1651
+ - **CLI:** `--hook` and `--tool` flags replaced with `--extension` / `-e`
1652
+ - **Directories:** `hooks/`, `tools/` → `extensions/`; `commands/` → `prompts/`
1653
+ - **Types:** See type renames above
1654
+ - **SDK:** See SDK migration above
1655
+
1656
+ ### Changed
1657
+
1658
+ - Extensions can have their own `package.json` with dependencies (resolved via jiti)
1659
+ - Documentation: `docs/hooks.md` and `docs/custom-tools.md` merged into `docs/extensions.md`
1660
+ - Examples: `examples/hooks/` and `examples/custom-tools/` merged into `examples/extensions/`
1661
+ - README: Extensions section expanded with custom tools, commands, events, state persistence, shortcuts, flags, and UI examples
1662
+ - SDK: `customTools` option now accepts `ToolDefinition[]` directly (simplified from `Array<{ path?, tool }>`)
1663
+ - SDK: `extensions` option accepts `ExtensionFactory[]` for inline extensions
1664
+ - SDK: `additionalExtensionPaths` replaces both `additionalHookPaths` and `additionalCustomToolPaths`
1665
+
1666
+ ## [0.34.2] - 2026-01-04
1667
+
1668
+ ## [0.34.1] - 2026-01-04
1669
+
1670
+ ### Added
1671
+
1672
+ - Hook API: `ctx.ui.setTitle(title)` allows hooks to set the terminal window/tab title ([#446](https://github.com/badlogic/pi-mono/pull/446) by [@aliou](https://github.com/aliou))
1673
+
1674
+ ### Changed
1675
+
1676
+ - Expanded keybinding documentation to list all 32 supported symbol keys with notes on ctrl+symbol behavior ([#450](https://github.com/badlogic/pi-mono/pull/450) by [@kaofelix](https://github.com/kaofelix))
1677
+
1678
+ ## [0.34.0] - 2026-01-04
1679
+
1680
+ ### Added
1681
+
1682
+ - Hook API: `pi.getActiveTools()` and `pi.setActiveTools(toolNames)` for dynamically enabling/disabling tools from hooks
1683
+ - Hook API: `pi.getAllTools()` to enumerate all configured tools (built-in via --tools or default, plus custom tools)
1684
+ - Hook API: `pi.registerFlag(name, options)` and `pi.getFlag(name)` for hooks to register custom CLI flags (parsed automatically)
1685
+ - Hook API: `pi.registerShortcut(shortcut, options)` for hooks to register custom keyboard shortcuts using `KeyId` (e.g., `Key.shift("p")`). Conflicts with built-in shortcuts are skipped, conflicts between hooks logged as warnings.
1686
+ - Hook API: `ctx.ui.setWidget(key, content)` for status displays above the editor. Accepts either a string array or a component factory function.
1687
+ - Hook API: `theme.strikethrough(text)` for strikethrough text styling
1688
+ - Hook API: `before_agent_start` handlers can now return `systemPromptAppend` to dynamically append text to the system prompt for that turn. Multiple hooks' appends are concatenated.
1689
+ - Hook API: `before_agent_start` handlers can now return multiple messages (all are injected, not just the first)
1690
+ - `/hotkeys` command now shows hook-registered shortcuts in a separate "Hooks" section
1691
+ - New example hook: `plan-mode.ts` - Claude Code-style read-only exploration mode:
1692
+ - Toggle via `/plan` command, `Shift+P` shortcut, or `--plan` CLI flag
1693
+ - Read-only tools: `read`, `bash`, `grep`, `find`, `ls` (no `edit`/`write`)
1694
+ - Bash commands restricted to non-destructive operations (blocks `rm`, `mv`, `git commit`, `npm install`, etc.)
1695
+ - Interactive prompt after each response: execute plan, stay in plan mode, or refine
1696
+ - Todo list widget showing progress with checkboxes and strikethrough for completed items
1697
+ - Each todo has a unique ID; agent marks items done by outputting `[DONE:id]`
1698
+ - Progress updates via `agent_end` hook (parses completed items from final message)
1699
+ - `/todos` command to view current plan progress
1700
+ - Shows `⏸ plan` indicator in footer when in plan mode, `📋 2/5` when executing
1701
+ - State persists across sessions (including todo progress)
1702
+ - New example hook: `tools.ts` - Interactive `/tools` command to enable/disable tools with session persistence
1703
+ - New example hook: `pirate.ts` - Demonstrates `systemPromptAppend` to make the agent speak like a pirate
1704
+ - Tool registry now contains all built-in tools (read, bash, edit, write, grep, find, ls) even when `--tools` limits the initially active set. Hooks can enable any tool from the registry via `pi.setActiveTools()`.
1705
+ - System prompt now automatically rebuilds when tools change via `setActiveTools()`, updating tool descriptions and guidelines to match the new tool set
1706
+ - Hook errors now display full stack traces for easier debugging
1707
+ - Event bus (`pi.events`) for tool/hook communication: shared pub/sub between custom tools and hooks
1708
+ - Custom tools now have `pi.sendMessage()` to send messages directly to the agent session without needing the event bus
1709
+ - `sendMessage()` supports `deliverAs: "nextTurn"` to queue messages for the next user prompt
1710
+
1711
+ ### Changed
1712
+
1713
+ - Removed image placeholders after copy & paste, replaced with inserting image file paths directly. ([#442](https://github.com/badlogic/pi-mono/pull/442) by [@mitsuhiko](https://github.com/mitsuhiko))
1714
+
1715
+ ### Fixed
1716
+
1717
+ - Fixed potential text decoding issues in bash executor by using streaming TextDecoder instead of Buffer.toString()
1718
+ - External editor (Ctrl-G) now shows full pasted content instead of `[paste #N ...]` placeholders ([#444](https://github.com/badlogic/pi-mono/pull/444) by [@aliou](https://github.com/aliou))
1719
+
1720
+ ## [0.33.0] - 2026-01-04
1721
+
1722
+ ### Breaking Changes
1723
+
1724
+ - **Key detection functions removed from `@mariozechner/pi-tui`**: All `isXxx()` key detection functions (`isEnter()`, `isEscape()`, `isCtrlC()`, etc.) have been removed. Use `matchesKey(data, keyId)` instead (e.g., `matchesKey(data, "enter")`, `matchesKey(data, "ctrl+c")`). This affects hooks and custom tools that use `ctx.ui.custom()` with keyboard input handling. ([#405](https://github.com/badlogic/pi-mono/pull/405))
1725
+
1726
+ ### Added
1727
+
1728
+ - Clipboard image paste support via `Ctrl+V`. Images are saved to a temp file and attached to the message. Works on macOS, Windows, and Linux (X11). ([#419](https://github.com/badlogic/pi-mono/issues/419))
1729
+ - Configurable keybindings via `~/.pi/agent/keybindings.json`. All keyboard shortcuts (editor navigation, deletion, app actions like model cycling, etc.) can now be customized. Supports multiple bindings per action. ([#405](https://github.com/badlogic/pi-mono/pull/405) by [@hjanuschka](https://github.com/hjanuschka))
1730
+ - `/quit` and `/exit` slash commands to gracefully exit the application. Unlike double Ctrl+C, these properly await hook and custom tool cleanup handlers before exiting. ([#426](https://github.com/badlogic/pi-mono/pull/426) by [@ben-vargas](https://github.com/ben-vargas))
1731
+
1732
+ ### Fixed
1733
+
1734
+ - Subagent example README referenced incorrect filename `subagent.ts` instead of `index.ts` ([#427](https://github.com/badlogic/pi-mono/pull/427) by [@Whamp](https://github.com/Whamp))
1735
+
1736
+ ## [0.32.3] - 2026-01-03
1737
+
1738
+ ### Fixed
1739
+
1740
+ - `--list-models` no longer shows Google Vertex AI models without explicit authentication configured
1741
+ - JPEG/GIF/WebP images not displaying in terminals using Kitty graphics protocol (Kitty, Ghostty, WezTerm). The protocol requires PNG format, so non-PNG images are now converted before display.
1742
+ - Version check URL typo preventing update notifications from working ([#423](https://github.com/badlogic/pi-mono/pull/423) by [@skuridin](https://github.com/skuridin))
1743
+ - Large images exceeding Anthropic's 5MB limit now retry with progressive quality/size reduction ([#424](https://github.com/badlogic/pi-mono/pull/424) by [@mitsuhiko](https://github.com/mitsuhiko))
1744
+
1745
+ ## [0.32.2] - 2026-01-03
1746
+
1747
+ ### Added
1748
+
1749
+ - `$ARGUMENTS` syntax for custom slash commands as alternative to `$@` for all arguments joined. Aligns with patterns used by Claude, Codex, and OpenCode. Both syntaxes remain fully supported. ([#418](https://github.com/badlogic/pi-mono/pull/418) by [@skuridin](https://github.com/skuridin))
1750
+
1751
+ ### Changed
1752
+
1753
+ - **Slash commands and hook commands now work during streaming**: Previously, using a slash command or hook command while the agent was streaming would crash with "Agent is already processing". Now:
1754
+ - Hook commands execute immediately (they manage their own LLM interaction via `pi.sendMessage()`)
1755
+ - File-based slash commands are expanded and queued via steer/followUp
1756
+ - `steer()` and `followUp()` now expand file-based slash commands and error on hook commands (hook commands cannot be queued)
1757
+ - `prompt()` accepts new `streamingBehavior` option (`"steer"` or `"followUp"`) to specify queueing behavior during streaming
1758
+ - RPC `prompt` command now accepts optional `streamingBehavior` field
1759
+ ([#420](https://github.com/badlogic/pi-mono/issues/420))
1760
+
1761
+ ### Fixed
1762
+
1763
+ - Slash command argument substitution now processes positional arguments (`$1`, `$2`, etc.) before all-arguments (`$@`, `$ARGUMENTS`) to prevent recursive substitution when argument values contain dollar-digit patterns like `$100`. ([#418](https://github.com/badlogic/pi-mono/pull/418) by [@skuridin](https://github.com/skuridin))
1764
+
1765
+ ## [0.32.1] - 2026-01-03
1766
+
1767
+ ### Added
1768
+
1769
+ - Shell commands without context contribution: use `!!command` to execute a bash command that is shown in the TUI and saved to session history but excluded from LLM context. Useful for running commands you don't want the AI to see. ([#414](https://github.com/badlogic/pi-mono/issues/414))
1770
+
1771
+ ### Fixed
1772
+
1773
+ - Edit tool diff not displaying in TUI due to race condition between async preview computation and tool execution
1774
+
1775
+ ## [0.32.0] - 2026-01-03
1776
+
1777
+ ### Breaking Changes
1778
+
1779
+ - **Queue API replaced with steer/followUp**: The `queueMessage()` method has been split into two methods with different delivery semantics ([#403](https://github.com/badlogic/pi-mono/issues/403)):
1780
+ - `steer(text)`: Interrupts the agent mid-run (Enter while streaming). Delivered after current tool execution.
1781
+ - `followUp(text)`: Waits until the agent finishes (Alt+Enter while streaming). Delivered only when agent stops.
1782
+ - **Settings renamed**: `queueMode` setting renamed to `steeringMode`. Added new `followUpMode` setting. Old settings.json files are migrated automatically.
1783
+ - **AgentSession methods renamed**:
1784
+ - `queueMessage()` → `steer()` and `followUp()`
1785
+ - `queueMode` getter → `steeringMode` and `followUpMode` getters
1786
+ - `setQueueMode()` → `setSteeringMode()` and `setFollowUpMode()`
1787
+ - `queuedMessageCount` → `pendingMessageCount`
1788
+ - `getQueuedMessages()` → `getSteeringMessages()` and `getFollowUpMessages()`
1789
+ - `clearQueue()` now returns `{ steering: string[], followUp: string[] }`
1790
+ - `hasQueuedMessages()` → `hasPendingMessages()`
1791
+ - **Hook API signature changed**: `pi.sendMessage()` second parameter changed from `triggerTurn?: boolean` to `options?: { triggerTurn?, deliverAs? }`. Use `deliverAs: "followUp"` for follow-up delivery. Affects both hooks and internal `sendHookMessage()` method.
1792
+ - **RPC API changes**:
1793
+ - `queue_message` command → `steer` and `follow_up` commands
1794
+ - `set_queue_mode` command → `set_steering_mode` and `set_follow_up_mode` commands
1795
+ - `RpcSessionState.queueMode` → `steeringMode` and `followUpMode`
1796
+ - **Settings UI**: "Queue mode" setting split into "Steering mode" and "Follow-up mode"
1797
+
1798
+ ### Added
1799
+
1800
+ - Configurable double-escape action: choose whether double-escape with empty editor opens `/tree` (default) or `/branch`. Configure via `/settings` or `doubleEscapeAction` in settings.json ([#404](https://github.com/badlogic/pi-mono/issues/404))
1801
+ - Vertex AI provider (`google-vertex`): access Gemini models via Google Cloud Vertex AI using Application Default Credentials ([#300](https://github.com/badlogic/pi-mono/pull/300) by [@default-anton](https://github.com/default-anton))
1802
+ - Built-in provider overrides in `models.json`: override just `baseUrl` to route a built-in provider through a proxy while keeping all its models, or define `models` to fully replace the provider ([#406](https://github.com/badlogic/pi-mono/pull/406) by [@yevhen](https://github.com/yevhen))
1803
+ - Automatic image resizing: images larger than 2000x2000 are resized for better model compatibility. Original dimensions are injected into the prompt. Controlled via `/settings` or `images.autoResize` in settings.json. ([#402](https://github.com/badlogic/pi-mono/pull/402) by [@mitsuhiko](https://github.com/mitsuhiko))
1804
+ - Alt+Enter keybind to queue follow-up messages while agent is streaming
1805
+ - `Theme` and `ThemeColor` types now exported for hooks using `ctx.ui.custom()`
1806
+ - Terminal window title now displays "pi - dirname" to identify which project session you're in ([#407](https://github.com/badlogic/pi-mono/pull/407) by [@kaofelix](https://github.com/kaofelix))
1807
+
1808
+ ### Changed
1809
+
1810
+ - Editor component now uses word wrapping instead of character-level wrapping for better readability ([#382](https://github.com/badlogic/pi-mono/pull/382) by [@nickseelert](https://github.com/nickseelert))
1811
+
1812
+ ### Fixed
1813
+
1814
+ - `/model` selector now opens instantly instead of waiting for OAuth token refresh. Token refresh is deferred until a model is actually used.
1815
+ - Shift+Space, Shift+Backspace, and Shift+Delete now work correctly in Kitty-protocol terminals (Kitty, WezTerm, etc.) instead of being silently ignored ([#411](https://github.com/badlogic/pi-mono/pull/411) by [@nathyong](https://github.com/nathyong))
1816
+ - `AgentSession.prompt()` now throws if called while the agent is already streaming, preventing race conditions. Use `steer()` or `followUp()` to queue messages during streaming.
1817
+ - Ctrl+C now works like Escape in selector components, so mashing Ctrl+C will eventually close the program ([#400](https://github.com/badlogic/pi-mono/pull/400) by [@mitsuhiko](https://github.com/mitsuhiko))
1818
+
1819
+ ## [0.31.1] - 2026-01-02
1820
+
1821
+ ### Fixed
1822
+
1823
+ - Model selector no longer allows negative index when pressing arrow keys before models finish loading ([#398](https://github.com/badlogic/pi-mono/pull/398) by [@mitsuhiko](https://github.com/mitsuhiko))
1824
+ - Type guard functions (`isBashToolResult`, etc.) now exported at runtime, not just in type declarations ([#397](https://github.com/badlogic/pi-mono/issues/397))
1825
+
1826
+ ## [0.31.0] - 2026-01-02
1827
+
1828
+ This release introduces session trees for in-place branching, major API changes to hooks and custom tools, and structured compaction with file tracking.
1829
+
1830
+ ### Session Tree
1831
+
1832
+ Sessions now use a tree structure with `id`/`parentId` fields. This enables in-place branching: navigate to any previous point with `/tree`, continue from there, and switch between branches while preserving all history in a single file.
1833
+
1834
+ **Existing sessions are automatically migrated** (v1 → v2) on first load. No manual action required.
1835
+
1836
+ New entry types: `BranchSummaryEntry` (context from abandoned branches), `CustomEntry` (hook state), `CustomMessageEntry` (hook-injected messages), `LabelEntry` (bookmarks).
1837
+
1838
+ See [docs/session.md](docs/session.md) for the file format and `SessionManager` API.
1839
+
1840
+ ### Hooks Migration
1841
+
1842
+ The hooks API has been restructured with more granular events and better session access.
1843
+
1844
+ **Type renames:**
1845
+
1846
+ - `HookEventContext` → `HookContext`
1847
+ - `HookCommandContext` is now a new interface extending `HookContext` with session control methods
1848
+
1849
+ **Event changes:**
1850
+
1851
+ - The monolithic `session` event is now split into granular events: `session_start`, `session_before_switch`, `session_switch`, `session_before_branch`, `session_branch`, `session_before_compact`, `session_compact`, `session_shutdown`
1852
+ - `session_before_switch` and `session_switch` events now include `reason: "new" | "resume"` to distinguish between `/new` and `/resume`
1853
+ - New `session_before_tree` and `session_tree` events for `/tree` navigation (hook can provide custom branch summary)
1854
+ - New `before_agent_start` event: inject messages before the agent loop starts
1855
+ - New `context` event: modify messages non-destructively before each LLM call
1856
+ - Session entries are no longer passed in events. Use `ctx.sessionManager.getEntries()` or `ctx.sessionManager.getBranch()` instead
1857
+
1858
+ **API changes:**
1859
+
1860
+ - `pi.send(text, attachments?)` → `pi.sendMessage(message, triggerTurn?)` (creates `CustomMessageEntry`)
1861
+ - New `pi.appendEntry(customType, data?)` for hook state persistence (not in LLM context)
1862
+ - New `pi.registerCommand(name, options)` for custom slash commands (handler receives `HookCommandContext`)
1863
+ - New `pi.registerMessageRenderer(customType, renderer)` for custom TUI rendering
1864
+ - New `ctx.isIdle()`, `ctx.abort()`, `ctx.hasQueuedMessages()` for agent state (available in all events)
1865
+ - New `ctx.ui.editor(title, prefill?)` for multi-line text editing with Ctrl+G external editor support
1866
+ - New `ctx.ui.custom(component)` for full TUI component rendering with keyboard focus
1867
+ - New `ctx.ui.setStatus(key, text)` for persistent status text in footer (multiple hooks can set their own)
1868
+ - New `ctx.ui.theme` getter for styling text with theme colors
1869
+ - `ctx.exec()` moved to `pi.exec()`
1870
+ - `ctx.sessionFile` → `ctx.sessionManager.getSessionFile()`
1871
+ - New `ctx.modelRegistry` and `ctx.model` for API key resolution
1872
+
1873
+ **HookCommandContext (slash commands only):**
1874
+
1875
+ - `ctx.waitForIdle()` - wait for agent to finish streaming
1876
+ - `ctx.newSession(options?)` - create new sessions with optional setup callback
1877
+ - `ctx.fork(entryId) - fork from a specific entry, creating a new session file
1878
+ - `ctx.navigateTree(targetId, options?)` - navigate the session tree
1879
+
1880
+ These methods are only on `HookCommandContext` (not `HookContext`) because they can deadlock if called from event handlers that run inside the agent loop.
1881
+
1882
+ **Removed:**
1883
+
1884
+ - `hookTimeout` setting (hooks no longer have timeouts; use Ctrl+C to abort)
1885
+ - `resolveApiKey` parameter (use `ctx.modelRegistry.getApiKey(model)`)
1886
+
1887
+ See [docs/hooks.md](docs/hooks.md) and [examples/hooks/](examples/hooks/) for the current API.
1888
+
1889
+ ### Custom Tools Migration
1890
+
1891
+ The custom tools API has been restructured to mirror the hooks pattern with a context object.
1892
+
1893
+ **Type renames:**
1894
+
1895
+ - `CustomAgentTool` → `CustomTool`
1896
+ - `ToolAPI` → `CustomToolAPI`
1897
+ - `ToolContext` → `CustomToolContext`
1898
+ - `ToolSessionEvent` → `CustomToolSessionEvent`
1899
+
1900
+ **Execute signature changed:**
1901
+
1902
+ ```typescript
1903
+ // Before (v0.30.2)
1904
+ execute(toolCallId, params, signal, onUpdate)
1905
+
1906
+ // After
1907
+ execute(toolCallId, params, onUpdate, ctx, signal?)
1908
+ ```
1909
+
1910
+ The new `ctx: CustomToolContext` provides `sessionManager`, `modelRegistry`, `model`, and agent state methods:
1911
+
1912
+ - `ctx.isIdle()` - check if agent is streaming
1913
+ - `ctx.hasQueuedMessages()` - check if user has queued messages (skip interactive prompts)
1914
+ - `ctx.abort()` - abort current operation (fire-and-forget)
1915
+
1916
+ **Session event changes:**
1917
+
1918
+ - `CustomToolSessionEvent` now only has `reason` and `previousSessionFile`
1919
+ - Session entries are no longer in the event. Use `ctx.sessionManager.getBranch()` or `ctx.sessionManager.getEntries()` to reconstruct state
1920
+ - Reasons: `"start" | "switch" | "branch" | "tree" | "shutdown"` (no separate `"new"` reason; `/new` triggers `"switch"`)
1921
+ - `dispose()` method removed. Use `onSession` with `reason: "shutdown"` for cleanup
1922
+
1923
+ See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](examples/custom-tools/) for the current API.
1924
+
1925
+ ### SDK Migration
1926
+
1927
+ **Type changes:**
1928
+
1929
+ - `CustomAgentTool` → `CustomTool`
1930
+ - `AppMessage` → `AgentMessage`
1931
+ - `sessionFile` returns `string | undefined` (was `string | null`)
1932
+ - `model` returns `Model | undefined` (was `Model | null`)
1933
+ - `Attachment` type removed. Use `ImageContent` from `@mariozechner/pi-ai` instead. Add images directly to message content arrays.
1934
+
1935
+ **AgentSession API:**
1936
+
1937
+ - `branch(entryIndex: number)` → `branch(entryId: string)`
1938
+ - `getUserMessagesForBranching()` returns `{ entryId, text }` instead of `{ entryIndex, text }`
1939
+ - `reset()` → `newSession(options?)` where options has optional `parentSession` for lineage tracking
1940
+ - `newSession()` and `switchSession()` now return `Promise<boolean>` (false if cancelled by hook)
1941
+ - New `navigateTree(targetId, options?)` for in-place tree navigation
1942
+
1943
+ **Hook integration:**
1944
+
1945
+ - New `sendHookMessage(message, triggerTurn?)` for hook message injection
1946
+
1947
+ **SessionManager API:**
1948
+
1949
+ - Method renames: `saveXXX()` → `appendXXX()` (e.g., `appendMessage`, `appendCompaction`)
1950
+ - `branchInPlace()` → `branch()`
1951
+ - `reset()` → `newSession(options?)` with optional `parentSession` for lineage tracking
1952
+ - `createBranchedSessionFromEntries(entries, index)` → `createBranchedSession(leafId)`
1953
+ - `SessionHeader.branchedFrom` → `SessionHeader.parentSession`
1954
+ - `saveCompaction(entry)` → `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?)`
1955
+ - `getEntries()` now excludes the session header (use `getHeader()` separately)
1956
+ - `getSessionFile()` returns `string | undefined` (undefined for in-memory sessions)
1957
+ - New tree methods: `getTree()`, `getBranch()`, `getLeafId()`, `getLeafEntry()`, `getEntry()`, `getChildren()`, `getLabel()`
1958
+ - New append methods: `appendCustomEntry()`, `appendCustomMessageEntry()`, `appendLabelChange()`
1959
+ - New branch methods: `branch(entryId)`, `branchWithSummary()`
1960
+
1961
+ **ModelRegistry (new):**
1962
+
1963
+ `ModelRegistry` is a new class that manages model discovery and API key resolution. It combines built-in models with custom models from `models.json` and resolves API keys via `AuthStorage`.
1964
+
1965
+ ```typescript
1966
+ import {
1967
+ discoverAuthStorage,
1968
+ discoverModels,
1969
+ } from "@mariozechner/pi-coding-agent";
1970
+
1971
+ const authStorage = discoverAuthStorage(); // ~/.pi/agent/auth.json
1972
+ const modelRegistry = discoverModels(authStorage); // + ~/.pi/agent/models.json
1973
+
1974
+ // Get all models (built-in + custom)
1975
+ const allModels = modelRegistry.getAll();
1976
+
1977
+ // Get only models with valid API keys
1978
+ const available = await modelRegistry.getAvailable();
1979
+
1980
+ // Find specific model
1981
+ const model = modelRegistry.find("anthropic", "claude-sonnet-4-20250514");
1982
+
1983
+ // Get API key for a model
1984
+ const apiKey = await modelRegistry.getApiKey(model);
1985
+ ```
1986
+
1987
+ This replaces the old `resolveApiKey` callback pattern. Hooks and custom tools access it via `ctx.modelRegistry`.
1988
+
1989
+ **Renamed exports:**
1990
+
1991
+ - `messageTransformer` → `convertToLlm`
1992
+ - `SessionContext` alias `LoadedSession` removed
1993
+
1994
+ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/) for the current API.
1995
+
1996
+ ### RPC Migration
1997
+
1998
+ **Session commands:**
1999
+
2000
+ - `reset` command → `new_session` command with optional `parentSession` field
2001
+
2002
+ **Branching commands:**
2003
+
2004
+ - `branch` command: `entryIndex` → `entryId`
2005
+ - `get_branch_messages` response: `entryIndex` → `entryId`
2006
+
2007
+ **Type changes:**
2008
+
2009
+ - Messages are now `AgentMessage` (was `AppMessage`)
2010
+ - `prompt` command: `attachments` field replaced with `images` field using `ImageContent` format
2011
+
2012
+ **Compaction events:**
2013
+
2014
+ - `auto_compaction_start` now includes `reason` field (`"threshold"` or `"overflow"`)
2015
+ - `auto_compaction_end` now includes `willRetry` field
2016
+ - `compact` response includes full `CompactionResult` (`summary`, `firstKeptEntryId`, `tokensBefore`, `details`)
2017
+
2018
+ See [docs/rpc.md](docs/rpc.md) for the current protocol.
2019
+
2020
+ ### Structured Compaction
2021
+
2022
+ Compaction and branch summarization now use a structured output format:
2023
+
2024
+ - Clear sections: Goal, Progress, Key Information, File Operations
2025
+ - File tracking: `readFiles` and `modifiedFiles` arrays in `details`, accumulated across compactions
2026
+ - Conversations are serialized to text before summarization to prevent the model from "continuing" them
2027
+
2028
+ The `before_compact` and `before_tree` hook events allow custom compaction implementations. See [docs/compaction.md](docs/compaction.md).
2029
+
2030
+ ### Interactive Mode
2031
+
2032
+ **`/tree` command:**
2033
+
2034
+ - Navigate the full session tree in-place
2035
+ - Search by typing, page with ←/→
2036
+ - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
2037
+ - Press `l` to label entries as bookmarks
2038
+ - Selecting a branch switches context and optionally injects a summary of the abandoned branch
2039
+
2040
+ **Entry labels:**
2041
+
2042
+ - Bookmark any entry via `/tree` → select → `l`
2043
+ - Labels appear in tree view and persist as `LabelEntry`
2044
+
2045
+ **Theme changes (breaking for custom themes):**
2046
+
2047
+ Custom themes must add these new color tokens or they will fail to load:
2048
+
2049
+ - `selectedBg`: background for selected/highlighted items in tree selector and other components
2050
+ - `customMessageBg`: background for hook-injected messages (`CustomMessageEntry`)
2051
+ - `customMessageText`: text color for hook messages
2052
+ - `customMessageLabel`: label color for hook messages (the `[customType]` prefix)
2053
+
2054
+ Total color count increased from 46 to 50. See [docs/themes.md](docs/themes.md) for the full color list and copy values from the built-in dark/light themes.
2055
+
2056
+ **Settings:**
2057
+
2058
+ - `enabledModels`: allowlist models in `settings.json` (same format as `--models` CLI)
2059
+
2060
+ ### Added
2061
+
2062
+ - `ctx.ui.setStatus(key, text)` for hooks to display persistent status text in the footer ([#385](https://github.com/badlogic/pi-mono/pull/385) by [@prateekmedia](https://github.com/prateekmedia))
2063
+ - `ctx.ui.theme` getter for styling status text and other output with theme colors
2064
+ - `/share` command to upload session as a secret GitHub gist and get a shareable URL via shittycodingagent.ai ([#380](https://github.com/badlogic/pi-mono/issues/380))
2065
+ - HTML export now includes a tree visualization sidebar for navigating session branches ([#375](https://github.com/badlogic/pi-mono/issues/375))
2066
+ - HTML export supports keyboard shortcuts: Ctrl+T to toggle thinking blocks, Ctrl+O to toggle tool outputs
2067
+ - HTML export supports theme-configurable background colors via optional `export` section in theme JSON ([#387](https://github.com/badlogic/pi-mono/pull/387) by [@mitsuhiko](https://github.com/mitsuhiko))
2068
+ - HTML export syntax highlighting now uses theme colors and matches TUI rendering
2069
+ - **Snake game example hook**: Demonstrates `ui.custom()`, `registerCommand()`, and session persistence. See [examples/hooks/snake.ts](examples/hooks/snake.ts).
2070
+ - **`thinkingText` theme token**: Configurable color for thinking block text. ([#366](https://github.com/badlogic/pi-mono/pull/366) by [@paulbettner](https://github.com/paulbettner))
2071
+
2072
+ ### Changed
2073
+
2074
+ - **Entry IDs**: Session entries now use short 8-character hex IDs instead of full UUIDs
2075
+ - **API key priority**: `ANTHROPIC_OAUTH_TOKEN` now takes precedence over `ANTHROPIC_API_KEY`
2076
+ - HTML export template split into separate files (template.html, template.css, template.js) for easier maintenance
2077
+
2078
+ ### Fixed
2079
+
2080
+ - HTML export now properly sanitizes user messages containing HTML tags like `<style>` that could break DOM rendering
2081
+ - Crash when displaying bash output containing Unicode format characters like U+0600-U+0604 ([#372](https://github.com/badlogic/pi-mono/pull/372) by [@HACKE-RC](https://github.com/HACKE-RC))
2082
+ - **Footer shows full session stats**: Token usage and cost now include all messages, not just those after compaction. ([#322](https://github.com/badlogic/pi-mono/issues/322))
2083
+ - **Status messages spam chat log**: Rapidly changing settings (e.g., thinking level via Shift+Tab) would add multiple status lines. Sequential status updates now coalesce into a single line. ([#365](https://github.com/badlogic/pi-mono/pull/365) by [@paulbettner](https://github.com/paulbettner))
2084
+ - **Toggling thinking blocks during streaming shows nothing**: Pressing Ctrl+T while streaming would hide the current message until streaming completed.
2085
+ - **Resuming session resets thinking level to off**: Initial model and thinking level were not saved to session file, causing `--resume`/`--continue` to default to `off`. ([#342](https://github.com/badlogic/pi-mono/issues/342) by [@aliou](https://github.com/aliou))
2086
+ - **Hook `tool_result` event ignores errors from custom tools**: The `tool_result` hook event was never emitted when tools threw errors, and always had `isError: false` for successful executions. Now emits the event with correct `isError` value in both success and error cases. ([#374](https://github.com/badlogic/pi-mono/issues/374) by [@nicobailon](https://github.com/nicobailon))
2087
+ - **Edit tool fails on Windows due to CRLF line endings**: Files with CRLF line endings now match correctly when LLMs send LF-only text. Line endings are normalized before matching and restored to original style on write. ([#355](https://github.com/badlogic/pi-mono/issues/355) by [@Pratham-Dubey](https://github.com/Pratham-Dubey))
2088
+ - **Edit tool fails on files with UTF-8 BOM**: Files with UTF-8 BOM marker could cause "text not found" errors since the LLM doesn't include the invisible BOM character. BOM is now stripped before matching and restored on write. ([#394](https://github.com/badlogic/pi-mono/pull/394) by [@prathamdby](https://github.com/prathamdby))
2089
+ - **Use bash instead of sh on Unix**: Fixed shell commands using `/bin/sh` instead of `/bin/bash` on Unix systems. ([#328](https://github.com/badlogic/pi-mono/pull/328) by [@dnouri](https://github.com/dnouri))
2090
+ - **OAuth login URL clickable**: Made OAuth login URLs clickable in terminal. ([#349](https://github.com/badlogic/pi-mono/pull/349) by [@Cursivez](https://github.com/Cursivez))
2091
+ - **Improved error messages**: Better error messages when `apiKey` or `model` are missing. ([#346](https://github.com/badlogic/pi-mono/pull/346) by [@ronyrus](https://github.com/ronyrus))
2092
+ - **Session file validation**: `findMostRecentSession()` now validates session headers before returning, preventing non-session JSONL files from being loaded
2093
+ - **Compaction error handling**: `generateSummary()` and `generateTurnPrefixSummary()` now throw on LLM errors instead of returning empty strings
2094
+ - **Compaction with branched sessions**: Fixed compaction incorrectly including entries from abandoned branches, causing token overflow errors. Compaction now uses `sessionManager.getPath()` to work only on the current branch path, eliminating 80+ lines of duplicate entry collection logic between `prepareCompaction()` and `compact()`
2095
+ - **enabledModels glob patterns**: `--models` and `enabledModels` now support glob patterns like `github-copilot/*` or `*sonnet*`. Previously, patterns were only matched literally or via substring search. ([#337](https://github.com/badlogic/pi-mono/issues/337))
2096
+
2097
+ ## [0.30.2] - 2025-12-26
2098
+
2099
+ ### Changed
2100
+
2101
+ - **Consolidated migrations**: Moved auth migration from `AuthStorage.migrateLegacy()` to new `migrations.ts` module.
2102
+
2103
+ ## [0.30.1] - 2025-12-26
2104
+
2105
+ ### Fixed
2106
+
2107
+ - **Sessions saved to wrong directory**: In v0.30.0, sessions were being saved to `~/.pi/agent/` instead of `~/.pi/agent/sessions/<encoded-cwd>/`, breaking `--resume` and `/resume`. Misplaced sessions are automatically migrated on startup. ([#320](https://github.com/badlogic/pi-mono/issues/320) by [@aliou](https://github.com/aliou))
2108
+ - **Custom system prompts missing context**: When using a custom system prompt string, project context files (AGENTS.md), skills, date/time, and working directory were not appended. ([#321](https://github.com/badlogic/pi-mono/issues/321))
2109
+
2110
+ ## [0.30.0] - 2025-12-25
2111
+
2112
+ ### Breaking Changes
2113
+
2114
+ - **SessionManager API**: The second parameter of `create()`, `continueRecent()`, and `list()` changed from `agentDir` to `sessionDir`. When provided, it specifies the session directory directly (no cwd encoding). When omitted, uses default (`~/.pi/agent/sessions/<encoded-cwd>/`). `open()` no longer takes `agentDir`. ([#313](https://github.com/badlogic/pi-mono/pull/313))
2115
+
2116
+ ### Added
2117
+
2118
+ - **`--session-dir` flag**: Use a custom directory for sessions instead of the default `~/.pi/agent/sessions/<encoded-cwd>/`. Works with `-c` (continue) and `-r` (resume) flags. ([#313](https://github.com/badlogic/pi-mono/pull/313) by [@scutifer](https://github.com/scutifer))
2119
+ - **Reverse model cycling and model selector**: Shift+Ctrl+P cycles models backward, Ctrl+L opens model selector (retaining text in editor). ([#315](https://github.com/badlogic/pi-mono/pull/315) by [@mitsuhiko](https://github.com/mitsuhiko))
2120
+
2121
+ ## [0.29.1] - 2025-12-25
2122
+
2123
+ ### Added
2124
+
2125
+ - **Automatic custom system prompt loading**: Pi now auto-loads `SYSTEM.md` files to replace the default system prompt. Project-local `.pi/SYSTEM.md` takes precedence over global `~/.pi/agent/SYSTEM.md`. CLI `--system-prompt` flag overrides both. ([#309](https://github.com/badlogic/pi-mono/issues/309))
2126
+ - **Unified `/settings` command**: New settings menu consolidating thinking level, theme, queue mode, auto-compact, show images, hide thinking, and collapse changelog. Replaces individual `/thinking`, `/queue`, `/theme`, `/autocompact`, and `/show-images` commands. ([#310](https://github.com/badlogic/pi-mono/issues/310))
2127
+
2128
+ ### Fixed
2129
+
2130
+ - **Custom tools/hooks with typebox subpath imports**: Fixed jiti alias for `@sinclair/typebox` to point to package root instead of entry file, allowing imports like `@sinclair/typebox/compiler` to resolve correctly. ([#311](https://github.com/badlogic/pi-mono/issues/311) by [@kim0](https://github.com/kim0))
2131
+
2132
+ ## [0.29.0] - 2025-12-25
2133
+
2134
+ ### Breaking Changes
2135
+
2136
+ - **Renamed `/clear` to `/new`**: The command to start a fresh session is now `/new`. Hook event reasons `before_clear`/`clear` are now `before_new`/`new`. Merry Christmas [@mitsuhiko](https://github.com/mitsuhiko)! ([#305](https://github.com/badlogic/pi-mono/pull/305))
2137
+
2138
+ ### Added
2139
+
2140
+ - **Auto-space before pasted file paths**: When pasting a file path (starting with `/`, `~`, or `.`) after a word character, a space is automatically prepended. ([#307](https://github.com/badlogic/pi-mono/pull/307) by [@mitsuhiko](https://github.com/mitsuhiko))
2141
+ - **Word navigation in input fields**: Added Ctrl+Left/Right and Alt+Left/Right for word-by-word cursor movement. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
2142
+ - **Full Unicode input**: Input fields now accept Unicode characters beyond ASCII. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
2143
+
2144
+ ### Fixed
2145
+
2146
+ - **Readline-style Ctrl+W**: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
2147
+
2148
+ ## [0.28.0] - 2025-12-25
2149
+
2150
+ ### Changed
2151
+
2152
+ - **Credential storage refactored**: API keys and OAuth tokens are now stored in `~/.pi/agent/auth.json` instead of `oauth.json` and `settings.json`. Existing credentials are automatically migrated on first run. ([#296](https://github.com/badlogic/pi-mono/issues/296))
2153
+
2154
+ - **SDK API changes** ([#296](https://github.com/badlogic/pi-mono/issues/296)):
2155
+
2156
+ - Added `AuthStorage` class for credential management (API keys and OAuth tokens)
2157
+ - Added `ModelRegistry` class for model discovery and API key resolution
2158
+ - Added `discoverAuthStorage()` and `discoverModels()` discovery functions
2159
+ - `createAgentSession()` now accepts `authStorage` and `modelRegistry` options
2160
+ - Removed `configureOAuthStorage()`, `defaultGetApiKey()`, `findModel()`, `discoverAvailableModels()`
2161
+ - Removed `getApiKey` callback option (use `AuthStorage.setRuntimeApiKey()` for runtime overrides)
2162
+ - Use `getModel()` from `@mariozechner/pi-ai` for built-in models, `modelRegistry.find()` for custom models + built-in models
2163
+ - See updated [SDK documentation](docs/sdk.md) and [README](README.md)
2164
+
2165
+ - **Settings changes**: Removed `apiKeys` from `settings.json`. Use `auth.json` instead. ([#296](https://github.com/badlogic/pi-mono/issues/296))
2166
+
2167
+ ### Fixed
2168
+
2169
+ - **Duplicate skill warnings for symlinks**: Skills loaded via symlinks pointing to the same file are now silently deduplicated instead of showing name collision warnings. ([#304](https://github.com/badlogic/pi-mono/pull/304) by [@mitsuhiko](https://github.com/mitsuhiko))
2170
+
2171
+ ## [0.27.9] - 2025-12-24
2172
+
2173
+ ### Fixed
2174
+
2175
+ - **Model selector and --list-models with settings.json API keys**: Models with API keys configured in settings.json (but not in environment variables) now properly appear in the /model selector and `--list-models` output. ([#295](https://github.com/badlogic/pi-mono/issues/295))
2176
+
2177
+ ## [0.27.8] - 2025-12-24
2178
+
2179
+ ### Fixed
2180
+
2181
+ - **API key priority**: OAuth tokens now take priority over settings.json API keys. Previously, an API key in settings.json would trump OAuth, causing users logged in with a plan (unlimited tokens) to be billed via PAYG instead.
2182
+
2183
+ ## [0.27.7] - 2025-12-24
2184
+
2185
+ ### Fixed
2186
+
2187
+ - **Thinking tag leakage**: Fixed Claude mimicking literal `</thinking>` tags in responses. Unsigned thinking blocks (from aborted streams) are now converted to plain text without `<thinking>` tags. The TUI still displays them as thinking blocks. ([#302](https://github.com/badlogic/pi-mono/pull/302) by [@nicobailon](https://github.com/nicobailon))
2188
+
2189
+ ## [0.27.6] - 2025-12-24
2190
+
2191
+ ### Added
2192
+
2193
+ - **Compaction hook improvements**: The `before_compact` session event now includes:
2194
+
2195
+ - `previousSummary`: Summary from the last compaction (if any), so hooks can preserve accumulated context
2196
+ - `messagesToKeep`: Messages that will be kept after the summary (recent turns), in addition to `messagesToSummarize`
2197
+ - `resolveApiKey`: Function to resolve API keys for any model (checks settings, OAuth, env vars)
2198
+ - Removed `apiKey` string in favor of `resolveApiKey` for more flexibility
2199
+
2200
+ - **SessionManager API cleanup**:
2201
+ - Renamed `loadSessionFromEntries()` to `buildSessionContext()` (builds LLM context from entries, handling compaction)
2202
+ - Renamed `loadEntries()` to `getEntries()` (returns defensive copy of all session entries)
2203
+ - Added `buildSessionContext()` method to SessionManager
2204
+
2205
+ ## [0.27.5] - 2025-12-24
2206
+
2207
+ ### Added
2208
+
2209
+ - **HTML export syntax highlighting**: Code blocks in markdown and tool outputs (read, write) now have syntax highlighting using highlight.js with theme-aware colors matching the TUI.
2210
+ - **HTML export improvements**: Render markdown server-side using marked (tables, headings, code blocks, etc.), honor user's chosen theme (light/dark), add image rendering for user messages, and style code blocks with TUI-like language markers. ([@scutifer](https://github.com/scutifer))
2211
+
2212
+ ### Fixed
2213
+
2214
+ - **Ghostty inline images in tmux**: Fixed terminal detection for Ghostty when running inside tmux by checking `GHOSTTY_RESOURCES_DIR` env var. ([#299](https://github.com/badlogic/pi-mono/pull/299) by [@nicobailon](https://github.com/nicobailon))
2215
+
2216
+ ## [0.27.4] - 2025-12-24
2217
+
2218
+ ### Fixed
2219
+
2220
+ - **Symlinked skill directories**: Skills in symlinked directories (e.g., `~/.pi/agent/skills/my-skills -> /path/to/skills`) are now correctly discovered and loaded.
2221
+
2222
+ ## [0.27.3] - 2025-12-24
2223
+
2224
+ ### Added
2225
+
2226
+ - **API keys in settings.json**: Store API keys in `~/.pi/agent/settings.json` under the `apiKeys` field (e.g., `{ "apiKeys": { "anthropic": "sk-..." } }`). Settings keys take priority over environment variables. ([#295](https://github.com/badlogic/pi-mono/issues/295))
2227
+
2228
+ ### Fixed
2229
+
2230
+ - **Allow startup without API keys**: Interactive mode no longer throws when no API keys are configured. Users can now start the agent and use `/login` to authenticate. ([#288](https://github.com/badlogic/pi-mono/issues/288))
2231
+ - **`--system-prompt` file path support**: The `--system-prompt` argument now correctly resolves file paths (like `--append-system-prompt` already did). ([#287](https://github.com/badlogic/pi-mono/pull/287) by [@scutifer](https://github.com/scutifer))
2232
+
2233
+ ## [0.27.2] - 2025-12-23
2234
+
2235
+ ### Added
2236
+
2237
+ - **Skip conversation restore on branch**: Hooks can return `{ skipConversationRestore: true }` from `before_branch` to create the branched session file without restoring conversation messages. Useful for checkpoint hooks that restore files separately. ([#286](https://github.com/badlogic/pi-mono/pull/286) by [@nicobarray](https://github.com/nicobarray))
2238
+
2239
+ ## [0.27.1] - 2025-12-22
2240
+
2241
+ ### Fixed
2242
+
2243
+ - **Skill discovery performance**: Skip `node_modules` directories when recursively scanning for skills. Fixes ~60ms startup delay when skill directories contain npm dependencies.
2244
+
2245
+ ### Added
2246
+
2247
+ - **Startup timing instrumentation**: Set `PI_TIMING=1` to see startup performance breakdown (interactive mode only).
2248
+
2249
+ ## [0.27.0] - 2025-12-22
2250
+
2251
+ ### Breaking
2252
+
2253
+ - **Session hooks API redesign**: Merged `branch` event into `session` event. `BranchEvent`, `BranchEventResult` types and `pi.on("branch", ...)` removed. Use `pi.on("session", ...)` with `reason: "before_branch" | "branch"` instead. `AgentSession.branch()` returns `{ cancelled }` instead of `{ skipped }`. `AgentSession.reset()` and `switchSession()` now return `boolean` (false if cancelled by hook). RPC commands `reset`, `switch_session`, and `branch` now include `cancelled` in response data. ([#278](https://github.com/badlogic/pi-mono/issues/278))
2254
+
2255
+ ### Added
2256
+
2257
+ - **Session lifecycle hooks**: Added `before_*` variants (`before_switch`, `before_clear`, `before_branch`) that fire before actions and can be cancelled with `{ cancel: true }`. Added `shutdown` reason for graceful exit handling. ([#278](https://github.com/badlogic/pi-mono/issues/278))
2258
+
2259
+ ### Fixed
2260
+
2261
+ - **File tab completion display**: File paths no longer get cut off early. Folders now show trailing `/` and removed redundant "directory"/"file" labels to maximize horizontal space. ([#280](https://github.com/badlogic/pi-mono/issues/280))
2262
+
2263
+ - **Bash tool visual line truncation**: Fixed bash tool output in collapsed mode to use visual line counting (accounting for line wrapping) instead of logical line counting. Now consistent with bash-execution.ts behavior. Extracted shared `truncateToVisualLines` utility. ([#275](https://github.com/badlogic/pi-mono/issues/275))
2264
+
2265
+ ## [0.26.1] - 2025-12-22
2266
+
2267
+ ### Fixed
2268
+
2269
+ - **SDK tools respect cwd**: Core tools (bash, read, edit, write, grep, find, ls) now properly use the `cwd` option from `createAgentSession()`. Added tool factory functions (`createBashTool`, `createReadTool`, etc.) for SDK users who specify custom `cwd` with explicit tools. ([#279](https://github.com/badlogic/pi-mono/issues/279))
2270
+
2271
+ ## [0.26.0] - 2025-12-22
2272
+
2273
+ ### Added
2274
+
2275
+ - **SDK for programmatic usage**: New `createAgentSession()` factory with full control over model, tools, hooks, skills, session persistence, and settings. Philosophy: "omit to discover, provide to override". Includes 12 examples and comprehensive documentation. ([#272](https://github.com/badlogic/pi-mono/issues/272))
2276
+
2277
+ - **Project-specific settings**: Settings now load from both `~/.pi/agent/settings.json` (global) and `<cwd>/.pi/settings.json` (project). Project settings override global with deep merge for nested objects. Project settings are read-only (for version control). ([#276](https://github.com/badlogic/pi-mono/pull/276))
2278
+
2279
+ - **SettingsManager static factories**: `SettingsManager.create(cwd?, agentDir?)` for file-based settings, `SettingsManager.inMemory(settings?)` for testing. Added `applyOverrides()` for programmatic overrides.
2280
+
2281
+ - **SessionManager static factories**: `SessionManager.create()`, `SessionManager.open()`, `SessionManager.continueRecent()`, `SessionManager.inMemory()`, `SessionManager.list()` for flexible session management.
2282
+
2283
+ ## [0.25.4] - 2025-12-22
2284
+
2285
+ ### Fixed
2286
+
2287
+ - **Syntax highlighting stderr spam**: Fixed cli-highlight logging errors to stderr when markdown contains malformed code fences (e.g., missing newlines around closing backticks). Now validates language identifiers before highlighting and falls back silently to plain text. ([#274](https://github.com/badlogic/pi-mono/issues/274))
2288
+
2289
+ ## [0.25.3] - 2025-12-21
2290
+
2291
+ ### Added
2292
+
2293
+ - **Gemini 3 preview models**: Added `gemini-3-pro-preview` and `gemini-3-flash-preview` to the google-gemini-cli provider. ([#264](https://github.com/badlogic/pi-mono/pull/264) by [@LukeFost](https://github.com/LukeFost))
2294
+
2295
+ - **External editor support**: Press `Ctrl+G` to edit your message in an external editor. Uses `$VISUAL` or `$EDITOR` environment variable. On successful save, the message is replaced; on cancel, the original is kept. ([#266](https://github.com/badlogic/pi-mono/pull/266) by [@aliou](https://github.com/aliou))
2296
+
2297
+ - **Process suspension**: Press `Ctrl+Z` to suspend pi and return to the shell. Resume with `fg` as usual. ([#267](https://github.com/badlogic/pi-mono/pull/267) by [@aliou](https://github.com/aliou))
2298
+
2299
+ - **Configurable skills directories**: Added granular control over skill sources with `enableCodexUser`, `enableClaudeUser`, `enableClaudeProject`, `enablePiUser`, `enablePiProject` toggles, plus `customDirectories` and `ignoredSkills` settings. ([#269](https://github.com/badlogic/pi-mono/pull/269) by [@nicobailon](https://github.com/nicobailon))
2300
+
2301
+ - **Skills CLI filtering**: Added `--skills <patterns>` flag for filtering skills with glob patterns. Also added `includeSkills` setting and glob pattern support for `ignoredSkills`. ([#268](https://github.com/badlogic/pi-mono/issues/268))
2302
+
2303
+ ## [0.25.2] - 2025-12-21
2304
+
2305
+ ### Fixed
2306
+
2307
+ - **Image shifting in tool output**: Fixed an issue where images in tool output would shift down (due to accumulating spacers) each time the tool output was expanded or collapsed via Ctrl+O.
2308
+
2309
+ ## [0.25.1] - 2025-12-21
2310
+
2311
+ ### Fixed
2312
+
2313
+ - **Gemini image reading broken**: Fixed the `read` tool returning images causing flaky/broken responses with Gemini models. Images in tool results are now properly formatted per the Gemini API spec.
2314
+
2315
+ - **Tab completion for absolute paths**: Fixed tab completion producing `//tmp` instead of `/tmp/`. Also fixed symlinks to directories (like `/tmp`) not getting a trailing slash, which prevented continuing to tab through subdirectories.
2316
+
2317
+ ## [0.25.0] - 2025-12-20
2318
+
2319
+ ### Added
2320
+
2321
+ - **Interruptible tool execution**: Queuing a message while tools are executing now interrupts the current tool batch. Remaining tools are skipped with an error result, and your queued message is processed immediately. Useful for redirecting the agent mid-task. ([#259](https://github.com/badlogic/pi-mono/pull/259) by [@steipete](https://github.com/steipete))
2322
+
2323
+ - **Google Gemini CLI OAuth provider**: Access Gemini 2.0/2.5 models for free via Google Cloud Code Assist. Login with `/login` and select "Google Gemini CLI". Uses your Google account with rate limits.
2324
+
2325
+ - **Google Antigravity OAuth provider**: Access Gemini 3, Claude (sonnet/opus thinking models), and GPT-OSS models for free via Google's Antigravity sandbox. Login with `/login` and select "Antigravity". Uses your Google account with rate limits.
2326
+
2327
+ ### Changed
2328
+
2329
+ - **Model selector respects --models scope**: The `/model` command now only shows models specified via `--models` flag when that flag is used, instead of showing all available models. This prevents accidentally selecting models from unintended providers. ([#255](https://github.com/badlogic/pi-mono/issues/255))
2330
+
2331
+ ### Fixed
2332
+
2333
+ - **Connection errors not retried**: Added "connection error" to the list of retryable errors so Anthropic connection drops trigger auto-retry instead of silently failing. ([#252](https://github.com/badlogic/pi-mono/issues/252))
2334
+
2335
+ - **Thinking level not clamped on model switch**: Fixed TUI showing xhigh thinking level after switching to a model that doesn't support it. Thinking level is now automatically clamped to model capabilities. ([#253](https://github.com/badlogic/pi-mono/issues/253))
2336
+
2337
+ - **Cross-model thinking handoff**: Fixed error when switching between models with different thinking signature formats (e.g., GPT-OSS to Claude thinking models via Antigravity). Thinking blocks without signatures are now converted to text with `<thinking>` delimiters.
2338
+
2339
+ ## [0.24.5] - 2025-12-20
2340
+
2341
+ ### Fixed
2342
+
2343
+ - **Input buffering in iTerm2**: Fixed Ctrl+C, Ctrl+D, and other keys requiring multiple presses in iTerm2. The cell size query response parser was incorrectly holding back keyboard input.
2344
+
2345
+ ## [0.24.4] - 2025-12-20
2346
+
2347
+ ### Fixed
2348
+
2349
+ - **Arrow keys and Enter in selector components**: Fixed arrow keys and Enter not working in model selector, session selector, OAuth selector, and other selector components when Caps Lock or Num Lock is enabled. ([#243](https://github.com/badlogic/pi-mono/issues/243))
2350
+
2351
+ ## [0.24.3] - 2025-12-19
2352
+
2353
+ ### Fixed
2354
+
2355
+ - **Footer overflow on narrow terminals**: Fixed footer path display exceeding terminal width when resizing to very narrow widths, causing rendering crashes. /arminsayshi
2356
+
2357
+ ## [0.24.2] - 2025-12-20
2358
+
2359
+ ### Fixed
2360
+
2361
+ - **More Kitty keyboard protocol fixes**: Fixed Backspace, Enter, Home, End, and Delete keys not working with Caps Lock enabled. The initial fix in 0.24.1 missed several key handlers that were still using raw byte detection. Now all key handlers use the helper functions that properly mask out lock key bits. ([#243](https://github.com/badlogic/pi-mono/issues/243))
2362
+
2363
+ ## [0.24.1] - 2025-12-19
2364
+
2365
+ ### Added
2366
+
2367
+ - **OAuth and model config exports**: Scripts using `AgentSession` directly can now import `getAvailableModels`, `getApiKeyForModel`, `findModel`, `login`, `logout`, and `getOAuthProviders` from `@mariozechner/pi-coding-agent` to reuse OAuth token storage and model resolution. ([#245](https://github.com/badlogic/pi-mono/issues/245))
2368
+
2369
+ - **xhigh thinking level for gpt-5.2 models**: The thinking level selector and shift+tab cycling now show xhigh option for gpt-5.2 and gpt-5.2-codex models (in addition to gpt-5.1-codex-max). ([#236](https://github.com/badlogic/pi-mono/pull/236) by [@theBucky](https://github.com/theBucky))
2370
+
2371
+ ### Fixed
2372
+
2373
+ - **Hooks wrap custom tools**: Custom tools are now executed through the hook wrapper, so `tool_call`/`tool_result` hooks can observe, block, and modify custom tool executions (consistent with hook type docs). ([#248](https://github.com/badlogic/pi-mono/pull/248) by [@nicobailon](https://github.com/nicobailon))
2374
+
2375
+ - **Hook onUpdate callback forwarding**: The `onUpdate` callback is now correctly forwarded through the hook wrapper, fixing custom tool progress updates. ([#238](https://github.com/badlogic/pi-mono/pull/238) by [@nicobailon](https://github.com/nicobailon))
2376
+
2377
+ - **Terminal cleanup on Ctrl+C in session selector**: Fixed terminal not being properly restored when pressing Ctrl+C in the session selector. ([#247](https://github.com/badlogic/pi-mono/pull/247) by [@aliou](https://github.com/aliou))
2378
+
2379
+ - **OpenRouter models with colons in IDs**: Fixed parsing of OpenRouter model IDs that contain colons (e.g., `openrouter:meta-llama/llama-4-scout:free`). ([#242](https://github.com/badlogic/pi-mono/pull/242) by [@aliou](https://github.com/aliou))
2380
+
2381
+ - **Global AGENTS.md loaded twice**: Fixed global AGENTS.md being loaded twice when present in both `~/.pi/agent/` and the current directory. ([#239](https://github.com/badlogic/pi-mono/pull/239) by [@aliou](https://github.com/aliou))
2382
+
2383
+ - **Kitty keyboard protocol on Linux**: Fixed keyboard input not working in Ghostty on Linux when Num Lock is enabled. The Kitty protocol includes Caps Lock and Num Lock state in modifier values, which broke key detection. Now correctly masks out lock key bits when matching keyboard shortcuts. ([#243](https://github.com/badlogic/pi-mono/issues/243))
2384
+
2385
+ - **Emoji deletion and cursor movement**: Backspace, Delete, and arrow keys now correctly handle multi-codepoint characters like emojis. Previously, deleting an emoji would leave partial bytes, corrupting the editor state. ([#240](https://github.com/badlogic/pi-mono/issues/240))
2386
+
2387
+ ## [0.24.0] - 2025-12-19
2388
+
2389
+ ### Added
2390
+
2391
+ - **Subagent orchestration example**: Added comprehensive custom tool example for spawning and orchestrating sub-agents with isolated context windows. Includes scout/planner/reviewer/worker agents and workflow commands for multi-agent pipelines. ([#215](https://github.com/badlogic/pi-mono/pull/215) by [@nicobailon](https://github.com/nicobailon))
2392
+
2393
+ - **`getMarkdownTheme()` export**: Custom tools can now import `getMarkdownTheme()` from `@mariozechner/pi-coding-agent` to use the same markdown styling as the main UI.
2394
+
2395
+ - **`pi.exec()` signal and timeout support**: Custom tools and hooks can now pass `{ signal, timeout }` options to `pi.exec()` for cancellation and timeout handling. The result includes a `killed` flag when the process was terminated.
2396
+
2397
+ - **Kitty keyboard protocol support**: Shift+Enter, Alt+Enter, Shift+Tab, Ctrl+D, and all Ctrl+key combinations now work in Ghostty, Kitty, WezTerm, and other modern terminals. ([#225](https://github.com/badlogic/pi-mono/pull/225) by [@kim0](https://github.com/kim0))
2398
+
2399
+ - **Dynamic API key refresh**: OAuth tokens (GitHub Copilot, Anthropic OAuth) are now refreshed before each LLM call, preventing failures in long-running agent loops where tokens expire mid-session. ([#223](https://github.com/badlogic/pi-mono/pull/223) by [@kim0](https://github.com/kim0))
2400
+
2401
+ - **`/hotkeys` command**: Shows all keyboard shortcuts in a formatted table.
2402
+
2403
+ - **Markdown table borders**: Tables now render with proper top and bottom borders.
2404
+
2405
+ ### Changed
2406
+
2407
+ - **Subagent example improvements**: Parallel mode now streams updates from all tasks. Chain mode shows all completed steps during streaming. Expanded view uses proper markdown rendering with syntax highlighting. Usage footer shows turn count.
2408
+
2409
+ - **Skills standard compliance**: Skills now adhere to the [Agent Skills standard](https://agentskills.io/specification). Validates name (must match parent directory, lowercase, max 64 chars), description (required, max 1024 chars), and frontmatter fields. Warns on violations but remains lenient. Prompt format changed to XML structure. Removed `{baseDir}` placeholder in favor of relative paths. ([#231](https://github.com/badlogic/pi-mono/issues/231))
2410
+
2411
+ ### Fixed
2412
+
2413
+ - **JSON mode stdout flush**: Fixed race condition where `pi --mode json` could exit before all output was written to stdout, causing consumers to miss final events.
2414
+
2415
+ - **Symlinked tools, hooks, and slash commands**: Discovery now correctly follows symlinks when scanning for custom tools, hooks, and slash commands. ([#219](https://github.com/badlogic/pi-mono/pull/219), [#232](https://github.com/badlogic/pi-mono/pull/232) by [@aliou](https://github.com/aliou))
2416
+
2417
+ ### Breaking Changes
2418
+
2419
+ - **Custom tools now require `index.ts` entry point**: Auto-discovered custom tools must be in a subdirectory with an `index.ts` file. The old pattern `~/.pi/agent/tools/mytool.ts` must become `~/.pi/agent/tools/mytool/index.ts`. This allows multi-file tools to import helper modules. Explicit paths via `--tool` or `settings.json` still work with any `.ts` file.
2420
+
2421
+ - **Hook `tool_result` event restructured**: The `ToolResultEvent` now exposes full tool result data instead of just text. ([#233](https://github.com/badlogic/pi-mono/pull/233))
2422
+ - Removed: `result: string` field
2423
+ - Added: `content: (TextContent | ImageContent)[]` - full content array
2424
+ - Added: `details: unknown` - tool-specific details (typed per tool via discriminated union on `toolName`)
2425
+ - `ToolResultEventResult.result` renamed to `ToolResultEventResult.text` (removed), use `content` instead
2426
+ - Hook handlers returning `{ result: "..." }` must change to `{ content: [{ type: "text", text: "..." }] }`
2427
+ - Built-in tool details types exported: `BashToolDetails`, `ReadToolDetails`, `GrepToolDetails`, `FindToolDetails`, `LsToolDetails`, `TruncationResult`
2428
+ - Type guards exported for narrowing: `isBashToolResult`, `isReadToolResult`, `isEditToolResult`, `isWriteToolResult`, `isGrepToolResult`, `isFindToolResult`, `isLsToolResult`
2429
+
2430
+ ## [0.23.4] - 2025-12-18
2431
+
2432
+ ### Added
2433
+
2434
+ - **Syntax highlighting**: Added syntax highlighting for markdown code blocks, read tool output, and write tool content. Uses cli-highlight with theme-aware color mapping and VS Code-style syntax colors. ([#214](https://github.com/badlogic/pi-mono/pull/214) by [@svkozak](https://github.com/svkozak))
2435
+
2436
+ - **Intra-line diff highlighting**: Edit tool now shows word-level changes with inverse highlighting when a single line is modified. Multi-line changes show all removed lines first, then all added lines.
2437
+
2438
+ ### Fixed
2439
+
2440
+ - **Gemini tool result format**: Fixed tool result format for Gemini 3 Flash Preview which strictly requires `{ output: value }` for success and `{ error: value }` for errors. Previous format using `{ result, isError }` was rejected by newer Gemini models. ([#213](https://github.com/badlogic/pi-mono/issues/213), [#220](https://github.com/badlogic/pi-mono/pull/220))
2441
+
2442
+ - **Google baseUrl configuration**: Google provider now respects `baseUrl` configuration for custom endpoints or API proxies. ([#216](https://github.com/badlogic/pi-mono/issues/216), [#221](https://github.com/badlogic/pi-mono/pull/221) by [@theBucky](https://github.com/theBucky))
2443
+
2444
+ - **Google provider FinishReason**: Added handling for new `IMAGE_RECITATION` and `IMAGE_OTHER` finish reasons. Upgraded @google/genai to 1.34.0.
2445
+
2446
+ ## [0.23.3] - 2025-12-17
2447
+
2448
+ ### Fixed
2449
+
2450
+ - Check for compaction before submitting user prompt, not just after agent turn ends. This catches cases where user aborts mid-response and context is already near the limit.
2451
+
2452
+ ### Changed
2453
+
2454
+ - Improved system prompt documentation section with clearer pointers to specific doc files for custom models, themes, skills, hooks, custom tools, and RPC.
2455
+
2456
+ - Cleaned up documentation:
2457
+
2458
+ - `theme.md`: Added missing color tokens (`thinkingXhigh`, `bashMode`)
2459
+ - `skills.md`: Rewrote with better framing and examples
2460
+ - `hooks.md`: Fixed timeout/error handling docs, added import aliases section
2461
+ - `custom-tools.md`: Added intro with use cases and comparison table
2462
+ - `rpc.md`: Added missing `hook_error` event documentation
2463
+ - `README.md`: Complete settings table, condensed philosophy section, standardized OAuth docs
2464
+
2465
+ - Hooks loader now supports same import aliases as custom tools (`@sinclair/typebox`, `@mariozechner/pi-ai`, `@mariozechner/pi-tui`, `@mariozechner/pi-coding-agent`).
2466
+
2467
+ ### Breaking Changes
2468
+
2469
+ - **Hooks**: `turn_end` event's `toolResults` type changed from `AppMessage[]` to `ToolResultMessage[]`. If you have hooks that handle `turn_end` events and explicitly type the results, update your type annotations.
2470
+
2471
+ ## [0.23.2] - 2025-12-17
2472
+
2473
+ ### Fixed
2474
+
2475
+ - Fixed Claude models via GitHub Copilot re-answering all previous prompts in multi-turn conversations. The issue was that assistant message content was sent as an array instead of a string, which Copilot's Claude adapter misinterpreted. Also added missing `Openai-Intent: conversation-edits` header and fixed `X-Initiator` logic to check for any assistant/tool message in history. ([#209](https://github.com/badlogic/pi-mono/issues/209))
2476
+
2477
+ - Detect image MIME type via file magic (read tool and `@file` attachments), not filename extension.
2478
+
2479
+ - Fixed markdown tables overflowing terminal width. Tables now wrap cell contents to fit available width instead of breaking borders mid-row. ([#206](https://github.com/badlogic/pi-mono/pull/206) by [@kim0](https://github.com/kim0))
2480
+
2481
+ ## [0.23.1] - 2025-12-17
2482
+
2483
+ ### Fixed
2484
+
2485
+ - Fixed TUI performance regression caused by Box component lacking render caching. Built-in tools now use Text directly (like v0.22.5), and Box has proper caching for custom tool rendering.
2486
+
2487
+ - Fixed custom tools failing to load from `~/.pi/agent/tools/` when pi is installed globally. Module imports (`@sinclair/typebox`, `@mariozechner/pi-tui`, `@mariozechner/pi-ai`) are now resolved via aliases.
2488
+
2489
+ ## [0.23.0] - 2025-12-17
2490
+
2491
+ ### Added
2492
+
2493
+ - **Custom tools**: Extend pi with custom tools written in TypeScript. Tools can provide custom TUI rendering, interact with users via `pi.ui` (select, confirm, input, notify), and maintain state across sessions via `onSession` callback. See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](examples/custom-tools/). ([#190](https://github.com/badlogic/pi-mono/issues/190))
2494
+
2495
+ - **Hook and tool examples**: Added `examples/hooks/` and `examples/custom-tools/` with working examples. Examples are now bundled in npm and binary releases.
2496
+
2497
+ ### Breaking Changes
2498
+
2499
+ - **Hooks**: Replaced `session_start` and `session_switch` events with unified `session` event. Use `event.reason` (`"start" | "switch" | "clear"`) to distinguish. Event now includes `entries` array for state reconstruction.
2500
+
2501
+ ## [0.22.5] - 2025-12-17
2502
+
2503
+ ### Fixed
2504
+
2505
+ - Fixed `--session` flag not saving sessions in print mode (`-p`). The session manager was never receiving events because no subscriber was attached.
2506
+
2507
+ ## [0.22.4] - 2025-12-17
2508
+
2509
+ ### Added
2510
+
2511
+ - `--list-models [search]` CLI flag to list available models with optional fuzzy search. Shows provider, model ID, context window, max output, thinking support, and image support. Only lists models with configured API keys. ([#203](https://github.com/badlogic/pi-mono/issues/203))
2512
+
2513
+ ### Fixed
2514
+
2515
+ - Fixed tool execution showing green (success) background while still running. Now correctly shows gray (pending) background until the tool completes.
2516
+
2517
+ ## [0.22.3] - 2025-12-16
2518
+
2519
+ ### Added
2520
+
2521
+ - **Streaming bash output**: Bash tool now streams output in real-time during execution. The TUI displays live progress with the last 5 lines visible (expandable with ctrl+o). ([#44](https://github.com/badlogic/pi-mono/issues/44))
2522
+
2523
+ ### Changed
2524
+
2525
+ - **Tool output display**: When collapsed, tool output now shows the last N lines instead of the first N lines, making streaming output more useful.
2526
+
2527
+ - Updated `@mariozechner/pi-ai` with X-Initiator header support for GitHub Copilot, ensuring agent calls are not deducted from quota. ([#200](https://github.com/badlogic/pi-mono/pull/200) by [@kim0](https://github.com/kim0))
2528
+
2529
+ ### Fixed
2530
+
2531
+ - Fixed editor text being cleared during compaction. Text typed while compaction is running is now preserved. ([#179](https://github.com/badlogic/pi-mono/issues/179))
2532
+ - Improved RGB to 256-color mapping for terminals without truecolor support. Now correctly uses grayscale ramp for neutral colors and preserves semantic tints (green for success, red for error, blue for pending) instead of mapping everything to wrong cube colors.
2533
+ - `/think off` now actually disables thinking for all providers. Previously, providers like Gemini with "dynamic thinking" enabled by default would still use thinking even when turned off. ([#180](https://github.com/badlogic/pi-mono/pull/180) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2534
+
2535
+ ## [0.22.2] - 2025-12-15
2536
+
2537
+ ### Changed
2538
+
2539
+ - Updated `@mariozechner/pi-ai` with interleaved thinking enabled by default for Anthropic Claude 4 models.
2540
+
2541
+ ## [0.22.1] - 2025-12-15
2542
+
2543
+ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
2544
+
2545
+ ### Changed
2546
+
2547
+ - Updated `@mariozechner/pi-ai` with interleaved thinking support for Anthropic models.
2548
+
2549
+ ## [0.22.0] - 2025-12-15
2550
+
2551
+ ### Added
2552
+
2553
+ - **GitHub Copilot support**: Use GitHub Copilot models via OAuth login (`/login` -> "GitHub Copilot"). Supports both github.com and GitHub Enterprise. Models are sourced from models.dev and include Claude, GPT, Gemini, Grok, and more. All models are automatically enabled after login. ([#191](https://github.com/badlogic/pi-mono/pull/191) by [@cau1k](https://github.com/cau1k))
2554
+
2555
+ ### Fixed
2556
+
2557
+ - Model selector fuzzy search now matches against provider name (not just model ID) and supports space-separated tokens where all tokens must match
2558
+
2559
+ ## [0.21.0] - 2025-12-14
2560
+
2561
+ ### Added
2562
+
2563
+ - **Inline image rendering**: Terminals supporting Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images now render images inline in tool output. Aspect ratio is preserved by querying terminal cell dimensions on startup. Toggle with `/show-images` command or `terminal.showImages` setting. Falls back to text placeholder on unsupported terminals or when disabled. ([#177](https://github.com/badlogic/pi-mono/pull/177) by [@nicobailon](https://github.com/nicobailon))
2564
+
2565
+ - **Gemini 3 Pro thinking levels**: Thinking level selector now works with Gemini 3 Pro models. Minimal/low map to Google's LOW, medium/high map to Google's HIGH. ([#176](https://github.com/badlogic/pi-mono/pull/176) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2566
+
2567
+ ### Fixed
2568
+
2569
+ - Fixed read tool failing on macOS screenshot filenames due to Unicode Narrow No-Break Space (U+202F) in timestamp. Added fallback to try macOS variant paths and consolidated duplicate expandPath functions into shared path-utils.ts. ([#181](https://github.com/badlogic/pi-mono/pull/181) by [@nicobailon](https://github.com/nicobailon))
2570
+
2571
+ - Fixed double blank lines rendering after markdown code blocks ([#173](https://github.com/badlogic/pi-mono/pull/173) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2572
+
2573
+ ## [0.20.1] - 2025-12-13
2574
+
2575
+ ### Added
2576
+
2577
+ - **Exported skills API**: `loadSkillsFromDir`, `formatSkillsForPrompt`, and related types are now exported for use by other packages (e.g., mom).
2578
+
2579
+ ## [0.20.0] - 2025-12-13
2580
+
2581
+ ### Breaking Changes
2582
+
2583
+ - **Pi skills now use `SKILL.md` convention**: Pi skills must now be named `SKILL.md` inside a directory, matching Codex CLI format. Previously any `*.md` file was treated as a skill. Migrate by renaming `~/.pi/agent/skills/foo.md` to `~/.pi/agent/skills/foo/SKILL.md`.
2584
+
2585
+ ### Added
2586
+
2587
+ - Display loaded skills on startup in interactive mode
2588
+
2589
+ ## [0.19.1] - 2025-12-12
2590
+
2591
+ ### Fixed
2592
+
2593
+ - Documentation: Added skills system documentation to README (setup, usage, CLI flags, settings)
2594
+
2595
+ ## [0.19.0] - 2025-12-12
2596
+
2597
+ ### Added
2598
+
2599
+ - **Skills system**: Auto-discover and load instruction files on-demand. Supports Claude Code (`~/.claude/skills/*/SKILL.md`), Codex CLI (`~/.codex/skills/`), and Pi-native formats (`~/.pi/agent/skills/`, `.pi/skills/`). Skills are listed in system prompt with descriptions, agent loads them via read tool when needed. Supports `{baseDir}` placeholder. Disable with `--no-skills` or `skills.enabled: false` in settings. ([#169](https://github.com/badlogic/pi-mono/issues/169))
2600
+
2601
+ - **Version flag**: Added `--version` / `-v` flag to display the current version and exit. ([#170](https://github.com/badlogic/pi-mono/pull/170))
2602
+
2603
+ ## [0.18.2] - 2025-12-11
2604
+
2605
+ ### Added
2606
+
2607
+ - **Auto-retry on transient errors**: Automatically retries requests when providers return overloaded, rate limit, or server errors (429, 500, 502, 503, 504). Uses exponential backoff (2s, 4s, 8s). Shows retry status in TUI with option to cancel via Escape. Configurable in `settings.json` via `retry.enabled`, `retry.maxRetries`, `retry.baseDelayMs`. RPC mode emits `auto_retry_start` and `auto_retry_end` events. ([#157](https://github.com/badlogic/pi-mono/issues/157))
2608
+
2609
+ - **HTML export line numbers**: Read tool calls in HTML exports now display line number ranges (e.g., `file.txt:10-20`) when offset/limit parameters are used, matching the TUI display format. Line numbers appear in yellow color for better visibility. ([#166](https://github.com/badlogic/pi-mono/issues/166))
2610
+
2611
+ ### Fixed
2612
+
2613
+ - **Branch selector now works with single message**: Previously the branch selector would not open when there was only one user message. Now it correctly allows branching from any message, including the first one. This is needed for checkpoint hooks to restore state from before the first message. ([#163](https://github.com/badlogic/pi-mono/issues/163))
2614
+
2615
+ - **In-memory branching for `--no-session` mode**: Branching now works correctly in `--no-session` mode without creating any session files. The conversation is truncated in memory.
2616
+
2617
+ - **Git branch indicator now works in subdirectories**: The footer's git branch detection now walks up the directory hierarchy to find the git root, so it works when running pi from a subdirectory of a repository. ([#156](https://github.com/badlogic/pi-mono/issues/156))
2618
+
2619
+ ## [0.18.1] - 2025-12-10
2620
+
2621
+ ### Added
2622
+
2623
+ - **Mistral provider**: Added support for Mistral AI models. Set `MISTRAL_API_KEY` environment variable to use.
2624
+
2625
+ ### Fixed
2626
+
2627
+ - Fixed print mode (`-p`) not exiting after output when custom themes are present (theme watcher now properly stops in print mode) ([#161](https://github.com/badlogic/pi-mono/issues/161))
2628
+
2629
+ ## [0.18.0] - 2025-12-10
2630
+
2631
+ ### Added
2632
+
2633
+ - **Hooks system**: TypeScript modules that extend agent behavior by subscribing to lifecycle events. Hooks can intercept tool calls, prompt for confirmation, modify results, and inject messages from external sources. Auto-discovered from `~/.pi/agent/hooks/*.ts` and `.pi/hooks/*.ts`. Thanks to [@nicobailon](https://github.com/nicobailon) for the collaboration on the design and implementation. ([#145](https://github.com/badlogic/pi-mono/issues/145), supersedes [#158](https://github.com/badlogic/pi-mono/pull/158))
2634
+
2635
+ - **`pi.send()` API**: Hooks can inject messages into the agent session from external sources (file watchers, webhooks, CI systems). If streaming, messages are queued; otherwise a new agent loop starts immediately.
2636
+
2637
+ - **`--hook <path>` CLI flag**: Load hook files directly for testing without modifying settings.
2638
+
2639
+ - **Hook events**: `session_start`, `session_switch`, `agent_start`, `agent_end`, `turn_start`, `turn_end`, `tool_call` (can block), `tool_result` (can modify), `branch`.
2640
+
2641
+ - **Hook UI primitives**: `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.notify()` for interactive prompts from hooks.
2642
+
2643
+ - **Hooks documentation**: Full API reference at `docs/hooks.md`, shipped with npm package.
2644
+
2645
+ ## [0.17.0] - 2025-12-09
2646
+
2647
+ ### Changed
2648
+
2649
+ - **Simplified compaction flow**: Removed proactive compaction (aborting mid-turn when threshold approached). Compaction now triggers in two cases only: (1) overflow error from LLM, which compacts and auto-retries, or (2) threshold crossed after a successful turn, which compacts without retry.
2650
+
2651
+ - **Compaction retry uses `Agent.continue()`**: Auto-retry after overflow now uses the new `continue()` API instead of re-sending the user message, preserving exact context state.
2652
+
2653
+ - **Merged turn prefix summary**: When a turn is split during compaction, the turn prefix summary is now merged into the main history summary instead of being stored separately.
2654
+
2655
+ ### Added
2656
+
2657
+ - **`isCompacting` property on AgentSession**: Check if auto-compaction is currently running.
2658
+
2659
+ - **Session compaction indicator**: When resuming a compacted session, displays "Session compacted N times" status message.
2660
+
2661
+ ### Fixed
2662
+
2663
+ - **Block input during compaction**: User input is now blocked while auto-compaction is running to prevent race conditions.
2664
+
2665
+ - **Skip error messages in usage calculation**: Context size estimation now skips both aborted and error messages, as neither have valid usage data.
2666
+
2667
+ ## [0.16.0] - 2025-12-09
2668
+
2669
+ ### Breaking Changes
2670
+
2671
+ - **New RPC protocol**: The RPC mode (`--mode rpc`) has been completely redesigned with a new JSON protocol. The old protocol is no longer supported. See [`docs/rpc.md`](docs/rpc.md) for the new protocol documentation and [`test/rpc-example.ts`](test/rpc-example.ts) for a working example. Includes `RpcClient` TypeScript class for easy integration. ([#91](https://github.com/badlogic/pi-mono/issues/91))
2672
+
2673
+ ### Changed
2674
+
2675
+ - **README restructured**: Reorganized documentation from 30+ flat sections into 10 logical groups. Converted verbose subsections to scannable tables. Consolidated philosophy sections. Reduced size by ~60% while preserving all information.
2676
+
2677
+ ## [0.15.0] - 2025-12-09
2678
+
2679
+ ### Changed
2680
+
2681
+ - **Major code refactoring**: Restructured codebase for better maintainability and separation of concerns. Moved files into organized directories (`core/`, `modes/`, `utils/`, `cli/`). Extracted `AgentSession` class as central session management abstraction. Split `main.ts` and `tui-renderer.ts` into focused modules. See `DEVELOPMENT.md` for the new code map. ([#153](https://github.com/badlogic/pi-mono/issues/153))
2682
+
2683
+ ## [0.14.2] - 2025-12-08
2684
+
2685
+ ### Added
2686
+
2687
+ - `/debug` command now includes agent messages as JSONL in the output
2688
+
2689
+ ### Fixed
2690
+
2691
+ - Fix crash when bash command outputs binary data (e.g., `curl` downloading a video file)
2692
+
2693
+ ## [0.14.1] - 2025-12-08
2694
+
2695
+ ### Fixed
2696
+
2697
+ - Fix build errors with tsgo 7.0.0-dev.20251208.1 by properly importing `ReasoningEffort` type
2698
+
2699
+ ## [0.14.0] - 2025-12-08
2700
+
2701
+ ### Breaking Changes
2702
+
2703
+ - **Custom themes require new color tokens**: Themes must now include `thinkingXhigh` and `bashMode` color tokens. The theme loader provides helpful error messages listing missing tokens. See built-in themes (dark.json, light.json) for reference values.
2704
+
2705
+ ### Added
2706
+
2707
+ - **OpenAI compatibility overrides in models.json**: Custom models using `openai-completions` API can now specify a `compat` object to override provider quirks (`supportsStore`, `supportsDeveloperRole`, `supportsReasoningEffort`, `maxTokensField`). Useful for LiteLLM, custom proxies, and other non-standard endpoints. ([#133](https://github.com/badlogic/pi-mono/issues/133), thanks @fink-andreas for the initial idea and PR)
2708
+
2709
+ - **xhigh thinking level**: Added `xhigh` thinking level for OpenAI codex-max models. Cycle through thinking levels with Shift+Tab; `xhigh` appears only when using a codex-max model. ([#143](https://github.com/badlogic/pi-mono/issues/143))
2710
+
2711
+ - **Collapse changelog setting**: Add `"collapseChangelog": true` to `~/.pi/agent/settings.json` to show a condensed "Updated to vX.Y.Z" message instead of the full changelog after updates. Use `/changelog` to view the full changelog. ([#148](https://github.com/badlogic/pi-mono/issues/148))
2712
+
2713
+ - **Bash mode**: Execute shell commands directly from the editor by prefixing with `!` (e.g., `!ls -la`). Output streams in real-time, is added to the LLM context, and persists in session history. Supports multiline commands, cancellation (Escape), truncation for large outputs, and preview/expand toggle (Ctrl+O). Also available in RPC mode via `{"type":"bash","command":"..."}`. ([#112](https://github.com/badlogic/pi-mono/pull/112), original implementation by [@markusylisiurunen](https://github.com/markusylisiurunen))
2714
+
2715
+ ## [0.13.2] - 2025-12-07
2716
+
2717
+ ### Changed
2718
+
2719
+ - **Tool output truncation**: All tools now enforce consistent truncation limits with actionable notices for the LLM. ([#134](https://github.com/badlogic/pi-mono/issues/134))
2720
+ - **Limits**: 2000 lines OR 50KB (whichever hits first), never partial lines
2721
+ - **read**: Shows `[Showing lines X-Y of Z. Use offset=N to continue]`. If first line exceeds 50KB, suggests bash command
2722
+ - **bash**: Tail truncation with temp file. Shows `[Showing lines X-Y of Z. Full output: /tmp/...]`
2723
+ - **grep**: Pre-truncates match lines to 500 chars. Shows match limit and line truncation notices
2724
+ - **find/ls**: Shows result/entry limit notices
2725
+ - TUI displays truncation warnings in yellow at bottom of tool output (visible even when collapsed)
2726
+
2727
+ ## [0.13.1] - 2025-12-06
2728
+
2729
+ ### Added
2730
+
2731
+ - **Flexible Windows shell configuration**: The bash tool now supports multiple shell sources beyond Git Bash. Resolution order: (1) custom `shellPath` in settings.json, (2) Git Bash in standard locations, (3) any bash.exe on PATH. This enables Cygwin, MSYS2, and other bash environments. Configure with `~/.pi/agent/settings.json`: `{"shellPath": "C:\\cygwin64\\bin\\bash.exe"}`.
2732
+
2733
+ ### Fixed
2734
+
2735
+ - **Windows binary detection**: Fixed Bun compiled binary detection on Windows by checking for URL-encoded `%7EBUN` in addition to `$bunfs` and `~BUN` in `import.meta.url`. This ensures the binary correctly locates supporting files (package.json, themes, etc.) next to the executable.
2736
+
2737
+ ## [0.12.15] - 2025-12-06
2738
+
2739
+ ### Fixed
2740
+
2741
+ - **Editor crash with emojis/CJK characters**: Fixed crash when pasting or typing text containing wide characters (emojis like ✅, CJK characters) that caused line width to exceed terminal width. The editor now uses grapheme-aware text wrapping with proper visible width calculation.
2742
+
2743
+ ## [0.12.14] - 2025-12-06
2744
+
2745
+ ### Added
2746
+
2747
+ - **Double-Escape Branch Shortcut**: Press Escape twice with an empty editor to quickly open the `/branch` selector for conversation branching.
2748
+
2749
+ ## [0.12.13] - 2025-12-05
2750
+
2751
+ ### Changed
2752
+
2753
+ - **Faster startup**: Version check now runs in parallel with TUI initialization instead of blocking startup for up to 1 second. Update notifications appear in chat when the check completes.
2754
+
2755
+ ## [0.12.12] - 2025-12-05
2756
+
2757
+ ### Changed
2758
+
2759
+ - **Footer display**: Token counts now use M suffix for millions (e.g., `10.2M` instead of `10184k`). Context display shortened from `61.3% of 200k` to `61.3%/200k`.
2760
+
2761
+ ### Fixed
2762
+
2763
+ - **Multi-key sequences in inputs**: Inputs like model search now handle multi-key sequences identically to the main prompt editor. ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2764
+ - **Line wrapping escape codes**: Fixed underline style bleeding into padding when wrapping long URLs. ANSI codes now attach to the correct content, and line-end resets only turn off underline (preserving background colors). ([#109](https://github.com/badlogic/pi-mono/issues/109))
2765
+
2766
+ ### Added
2767
+
2768
+ - **Fuzzy search models and sessions**: Implemented a simple fuzzy search for models and sessions (e.g., `codexmax` now finds `gpt-5.1-codex-max`). ([#122](https://github.com/badlogic/pi-mono/pull/122) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2769
+ - **Prompt History Navigation**: Browse previously submitted prompts using Up/Down arrow keys when the editor is empty. Press Up to cycle through older prompts, Down to return to newer ones or clear the editor. Similar to shell history and Claude Code's prompt history feature. History is session-scoped and stores up to 100 entries. ([#121](https://github.com/badlogic/pi-mono/pull/121) by [@nicobailon](https://github.com/nicobailon))
2770
+ - **`/resume` Command**: Switch to a different session mid-conversation. Opens an interactive selector showing all available sessions. Equivalent to the `--resume` CLI flag but can be used without restarting the agent. ([#117](https://github.com/badlogic/pi-mono/pull/117) by [@hewliyang](https://github.com/hewliyang))
2771
+
2772
+ ## [0.12.11] - 2025-12-05
2773
+
2774
+ ### Changed
2775
+
2776
+ - **Compaction UI**: Simplified collapsed compaction indicator to show warning-colored text with token count instead of styled banner. Removed redundant success message after compaction. ([#108](https://github.com/badlogic/pi-mono/issues/108))
2777
+
2778
+ ### Fixed
2779
+
2780
+ - **Print mode error handling**: `-p` flag now outputs error messages and exits with code 1 when requests fail, instead of silently producing no output.
2781
+ - **Branch selector crash**: Fixed TUI crash when user messages contained Unicode characters (like `✔` or `›`) that caused line width to exceed terminal width. Now uses proper `truncateToWidth` instead of `substring`.
2782
+ - **Bash output escape sequences**: Fixed incomplete stripping of terminal escape sequences in bash tool output. `stripAnsi` misses some sequences like standalone String Terminator (`ESC \`), which could cause rendering issues when displaying captured TUI output.
2783
+ - **Footer overflow crash**: Fixed TUI crash when terminal width is too narrow for the footer stats line. The footer now truncates gracefully instead of overflowing.
2784
+
2785
+ ### Added
2786
+
2787
+ - **`authHeader` option in models.json**: Custom providers can set `"authHeader": true` to automatically add `Authorization: Bearer <apiKey>` header. Useful for providers that require explicit auth headers. ([#81](https://github.com/badlogic/pi-mono/issues/81))
2788
+ - **`--append-system-prompt` Flag**: Append additional text or file contents to the system prompt. Supports both inline text and file paths. Complements `--system-prompt` for layering custom instructions without replacing the base system prompt. ([#114](https://github.com/badlogic/pi-mono/pull/114) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2789
+ - **Thinking Block Toggle**: Added `Ctrl+T` shortcut to toggle visibility of LLM thinking blocks. When toggled off, shows a static "Thinking..." label instead of full content. Useful for reducing visual clutter during long conversations. ([#113](https://github.com/badlogic/pi-mono/pull/113) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2790
+
2791
+ ## [0.12.10] - 2025-12-04
2792
+
2793
+ ### Added
2794
+
2795
+ - Added `gpt-5.1-codex-max` model support
2796
+
2797
+ ## [0.12.9] - 2025-12-04
2798
+
2799
+ ### Added
2800
+
2801
+ - **`/copy` Command**: Copy the last agent message to clipboard. Works cross-platform (macOS, Windows, Linux). Useful for extracting text from rendered Markdown output. ([#105](https://github.com/badlogic/pi-mono/pull/105) by [@markusylisiurunen](https://github.com/markusylisiurunen))
2802
+
2803
+ ## [0.12.8] - 2025-12-04
2804
+
2805
+ - Fix: Use CTRL+O consistently for compaction expand shortcut (not CMD+O on Mac)
2806
+
2807
+ ## [0.12.7] - 2025-12-04
2808
+
2809
+ ### Added
2810
+
2811
+ - **Context Compaction**: Long sessions can now be compacted to reduce context usage while preserving recent conversation history. ([#92](https://github.com/badlogic/pi-mono/issues/92), [docs](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/README.md#context-compaction))
2812
+ - `/compact [instructions]`: Manually compact context with optional custom instructions for the summary
2813
+ - `/autocompact`: Toggle automatic compaction when context exceeds threshold
2814
+ - Compaction summarizes older messages while keeping recent messages (default 20k tokens) verbatim
2815
+ - Auto-compaction triggers when context reaches `contextWindow - reserveTokens` (default 16k reserve)
2816
+ - Compacted sessions show a collapsible summary in the TUI (toggle with `o` key)
2817
+ - HTML exports include compaction summaries as collapsible sections
2818
+ - RPC mode supports `{"type":"compact"}` command and auto-compaction (emits compaction events)
2819
+ - **Branch Source Tracking**: Branched sessions now store `branchedFrom` in the session header, containing the path to the original session file. Useful for tracing session lineage.
2820
+
2821
+ ## [0.12.5] - 2025-12-03
2822
+
2823
+ ### Added
2824
+
2825
+ - **Forking/Rebranding Support**: All branding (app name, config directory, environment variable names) is now configurable via `piConfig` in `package.json`. Forks can change `piConfig.name` and `piConfig.configDir` to rebrand the CLI without code changes. Affects CLI banner, help text, config paths, and error messages. ([#95](https://github.com/badlogic/pi-mono/pull/95))
2826
+
2827
+ ### Fixed
2828
+
2829
+ - **Bun Binary Detection**: Fixed Bun compiled binary failing to start after Bun updated its virtual filesystem path format from `%7EBUN` to `$bunfs`. ([#95](https://github.com/badlogic/pi-mono/pull/95))
2830
+
2831
+ ## [0.12.4] - 2025-12-02
2832
+
2833
+ ### Added
2834
+
2835
+ - **RPC Termination Safeguard**: When running as an RPC worker (stdin pipe detected), the CLI now exits immediately if the parent process terminates unexpectedly. Prevents orphaned RPC workers from persisting indefinitely and consuming system resources.
2836
+
2837
+ ## [0.12.3] - 2025-12-02
2838
+
2839
+ ### Fixed
2840
+
2841
+ - **Rate limit handling**: Anthropic rate limit errors now trigger automatic retry with exponential backoff (base 10s, max 5 retries). Previously these errors would abort the request immediately.
2842
+ - **Usage tracking during retries**: Retried requests now correctly accumulate token usage from all attempts, not just the final successful one. Fixes artificially low token counts when requests were retried.
2843
+
2844
+ ## [0.12.2] - 2025-12-02
2845
+
2846
+ ### Changed
2847
+
2848
+ - Removed support for gpt-4.5-preview and o3 models (not yet available)
2849
+
2850
+ ## [0.12.1] - 2025-12-02
2851
+
2852
+ ### Added
2853
+
2854
+ - **Models**: Added support for OpenAI's new models:
2855
+ - `gpt-4.1` (128K context)
2856
+ - `gpt-4.1-mini` (128K context)
2857
+ - `gpt-4.1-nano` (128K context)
2858
+ - `o3` (200K context, reasoning model)
2859
+ - `o4-mini` (200K context, reasoning model)
2860
+
2861
+ ## [0.12.0] - 2025-12-02
2862
+
2863
+ ### Added
2864
+
2865
+ - **`-p, --print` Flag**: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.
2866
+ - **`-P, --print-streaming` Flag**: Like `-p`, but streams response tokens as they arrive. Use `--print-streaming --no-markdown` for raw unformatted output.
2867
+ - **`--print-turn` Flag**: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with `-p` for complete multi-turn conversations.
2868
+ - **`--no-markdown` Flag**: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
2869
+ - **Streaming Print Mode**: Added internal `printStreaming` option for streaming output in non-TUI mode.
2870
+ - **RPC Mode `print` Command**: Send `{"type":"print","content":"text"}` to get formatted print output via `print_output` events.
2871
+ - **Auto-Save in Print Mode**: Print mode conversations are automatically saved to the session directory, allowing later resumption with `--continue`.
2872
+ - **Thinking level options**: Added `--thinking-off`, `--thinking-minimal`, `--thinking-low`, `--thinking-medium`, `--thinking-high` flags for directly specifying thinking level without the selector UI.
2873
+
2874
+ ### Changed
2875
+
2876
+ - **Simplified RPC Protocol**: Replaced the `prompt` wrapper command with direct message objects. Send `{"role":"user","content":"text"}` instead of `{"type":"prompt","message":"text"}`. Better aligns with message format throughout the codebase.
2877
+ - **RPC Message Handling**: Agent now processes raw message objects directly, with `timestamp` auto-populated if missing.
2878
+
2879
+ ## [0.11.9] - 2025-12-02
2880
+
2881
+ ### Changed
2882
+
2883
+ - Change Ctrl+I to Ctrl+P for model cycling shortcut to avoid collision with Tab key in some terminals
2884
+
2885
+ ## [0.11.8] - 2025-12-01
2886
+
2887
+ ### Fixed
2888
+
2889
+ - Absolute glob patterns (e.g., `/Users/foo/**/*.ts`) are now handled correctly. Previously the leading `/` was being stripped, causing the pattern to be interpreted relative to the current directory.
2890
+
2891
+ ## [0.11.7] - 2025-12-01
2892
+
2893
+ ### Fixed
2894
+
2895
+ - Fix read path traversal vulnerability. Paths are now validated to prevent reading outside the working directory or its parents. The `read` tool can read from `cwd`, its ancestors (for config files), and all descendants. Symlinks are resolved before validation.
2896
+
2897
+ ## [0.11.6] - 2025-12-01
2898
+
2899
+ ### Fixed
2900
+
2901
+ - Fix `--system-prompt <path>` allowing the path argument to be captured by the message collection, causing "file not found" errors.
2902
+
2903
+ ## [0.11.5] - 2025-11-30
2904
+
2905
+ ### Fixed
2906
+
2907
+ - Fixed fatal error "Cannot set properties of undefined (setting '0')" when editing empty files in the `edit` tool.
2908
+ - Simplified `edit` tool output: Shows only "Edited file.txt" for successful edits instead of verbose search/replace details.
2909
+ - Fixed fatal error in footer rendering when token counts contain NaN values due to missing usage data.
2910
+
2911
+ ## [0.11.4] - 2025-11-30
2912
+
2913
+ ### Fixed
2914
+
2915
+ - Fixed chat rendering crash when messages contain preformatted/styled text (e.g., thinking traces with gray italic styling). The markdown renderer now preserves existing ANSI escape codes when they appear before inline elements.
2916
+
2917
+ ## [0.11.3] - 2025-11-29
2918
+
2919
+ ### Fixed
2920
+
2921
+ - Fix file drop functionality for absolute paths
2922
+
2923
+ ## [0.11.2] - 2025-11-29
2924
+
2925
+ ### Fixed
2926
+
2927
+ - Fixed TUI crash when pasting content containing tab characters. Tabs are now converted to 4 spaces before insertion.
2928
+ - Fixed terminal corruption after exit when shell integration sequences (OSC 133) appeared in bash output. These sequences are now stripped along with other ANSI codes.
2929
+
2930
+ ## [0.11.1] - 2025-11-29
2931
+
2932
+ ### Added
2933
+
2934
+ - Added `fd` integration for file path autocompletion. Now uses `fd` for faster fuzzy file search
2935
+
2936
+ ### Fixed
2937
+
2938
+ - Fixed keyboard shortcuts Ctrl+A, Ctrl+E, Ctrl+K, Ctrl+U, Ctrl+W, and word navigation (Option+Arrow) not working in VS Code integrated terminal and some other terminal emulators
2939
+
2940
+ ## [0.11.0] - 2025-11-29
2941
+
2942
+ ### Added
2943
+
2944
+ - **File-based Slash Commands**: Create custom reusable prompts as `.txt` files in `~/.pi/slash-commands/`. Files become `/filename` commands with first-line descriptions. Supports `{{selection}}` placeholder for referencing selected/attached content.
2945
+ - **`/branch` Command**: Create conversation branches from any previous user message. Opens a selector to pick a message, then creates a new session file starting from that point. Original message text is placed in the editor for modification.
2946
+ - **Unified Content References**: Both `@path` in messages and `--file path` CLI arguments now use the same attachment system with consistent MIME type detection.
2947
+ - **Drag & Drop Files**: Drop files onto the terminal to attach them to your message. Supports multiple files and both text and image content.
2948
+
2949
+ ### Changed
2950
+
2951
+ - **Model Selector with Search**: The `/model` command now opens a searchable list. Type to filter models by name, use arrows to navigate, Enter to select.
2952
+ - **Improved File Autocomplete**: File path completion after `@` now supports fuzzy matching and shows file/directory indicators.
2953
+ - **Session Selector with Search**: The `--resume` and `--session` flags now open a searchable session list with fuzzy filtering.
2954
+ - **Attachment Display**: Files added via `@path` are now shown as "Attached: filename" in the user message, separate from the prompt text.
2955
+ - **Tab Completion**: Tab key now triggers file path autocompletion anywhere in the editor, not just after `@` symbol.
2956
+
2957
+ ### Fixed
2958
+
2959
+ - Fixed autocomplete z-order issue where dropdown could appear behind chat messages
2960
+ - Fixed cursor position when navigating through wrapped lines in the editor
2961
+ - Fixed attachment handling for continued sessions to preserve file references
2962
+
2963
+ ## [0.10.6] - 2025-11-28
2964
+
2965
+ ### Changed
2966
+
2967
+ - Show base64-truncated indicator for large images in tool output
2968
+
2969
+ ### Fixed
2970
+
2971
+ - Fixed image dimensions not being read correctly from PNG/JPEG/GIF files
2972
+ - Fixed PDF images being incorrectly base64-truncated in display
2973
+ - Allow reading files from ancestor directories (needed for monorepo configs)
2974
+
2975
+ ## [0.10.5] - 2025-11-28
2976
+
2977
+ ### Added
2978
+
2979
+ - Full multimodal support: attach images (PNG, JPEG, GIF, WebP) and PDFs to prompts using `@path` syntax or `--file` flag
2980
+
2981
+ ### Fixed
2982
+
2983
+ - `@`-references now handle special characters in file names (spaces, quotes, unicode)
2984
+ - Fixed cursor positioning issues with multi-byte unicode characters in editor
2985
+
2986
+ ## [0.10.4] - 2025-11-28
2987
+
2988
+ ### Fixed
2989
+
2990
+ - Removed padding on first user message in TUI to improve visual consistency.
2991
+
2992
+ ## [0.10.3] - 2025-11-28
2993
+
2994
+ ### Added
2995
+
2996
+ - Added RPC mode (`--rpc`) for programmatic integration. Accepts JSON commands on stdin, emits JSON events on stdout. See [RPC mode documentation](https://github.com/nicobailon/pi-mono/blob/main/packages/coding-agent/README.md#rpc-mode) for protocol details.
2997
+
2998
+ ### Changed
2999
+
3000
+ - Refactored internal architecture to support multiple frontends (TUI, RPC) with shared agent logic.
3001
+
3002
+ ## [0.10.2] - 2025-11-26
3003
+
3004
+ ### Added
3005
+
3006
+ - Added thinking level persistence. Default level stored in `~/.pi/settings.json`, restored on startup. Per-session overrides saved in session files.
3007
+ - Added model cycling shortcut: `Ctrl+I` cycles through available models (or scoped models with `-m` flag).
3008
+ - Added automatic retry with exponential backoff for transient API errors (network issues, 500s, overload).
3009
+ - Cumulative token usage now shown in footer (total tokens used across all messages in session).
3010
+ - Added `--system-prompt` flag to override default system prompt with custom text or file contents.
3011
+ - Footer now shows estimated total cost in USD based on model pricing.
3012
+
3013
+ ### Changed
3014
+
3015
+ - Replaced `--models` flag with `-m/--model` supporting multiple values. Specify models as `provider/model@thinking` (e.g., `anthropic/claude-sonnet-4-20250514@high`). Multiple `-m` flags scope available models for the session.
3016
+ - Thinking level border now persists visually after selector closes.
3017
+ - Improved tool result display with collapsible output (default collapsed, expand with `Ctrl+O`).
3018
+
3019
+ ## [0.10.1] - 2025-11-25
3020
+
3021
+ ### Added
3022
+
3023
+ - Add custom model configuration via `~/.pi/models.json`
3024
+
3025
+ ## [0.10.0] - 2025-11-25
3026
+
3027
+ Initial public release.
3028
+
3029
+ ### Added
3030
+
3031
+ - Interactive TUI with streaming responses
3032
+ - Conversation session management with `--continue`, `--resume`, and `--session` flags
3033
+ - Multi-line input support (Shift+Enter or Option+Enter for new lines)
3034
+ - Tool execution: `read`, `write`, `edit`, `bash`, `glob`, `grep`, `think`
3035
+ - Thinking mode support for Claude with visual indicator and `/thinking` selector
3036
+ - File path autocompletion with `@` prefix
3037
+ - Slash command autocompletion
3038
+ - `/export` command for HTML session export
3039
+ - `/model` command for runtime model switching
3040
+ - `/session` command for session statistics
3041
+ - Model provider support: Anthropic (Claude), OpenAI, Google (Gemini)
3042
+ - Git branch display in footer
3043
+ - Message queueing during streaming responses
3044
+ - OAuth integration for Gmail and Google Calendar access
3045
+ - HTML export with syntax highlighting and collapsible sections