@oh-my-pi/pi-coding-agent 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/CHANGELOG.md +1629 -0
  2. package/README.md +1041 -0
  3. package/docs/compaction.md +403 -0
  4. package/docs/config-usage.md +113 -0
  5. package/docs/custom-tools.md +541 -0
  6. package/docs/extension-loading.md +1004 -0
  7. package/docs/hooks.md +867 -0
  8. package/docs/rpc.md +1040 -0
  9. package/docs/sdk.md +994 -0
  10. package/docs/session-tree-plan.md +441 -0
  11. package/docs/session.md +240 -0
  12. package/docs/skills.md +290 -0
  13. package/docs/theme.md +670 -0
  14. package/docs/tree.md +197 -0
  15. package/docs/tui.md +341 -0
  16. package/examples/README.md +21 -0
  17. package/examples/custom-tools/README.md +124 -0
  18. package/examples/custom-tools/hello/index.ts +20 -0
  19. package/examples/custom-tools/question/index.ts +84 -0
  20. package/examples/custom-tools/subagent/README.md +172 -0
  21. package/examples/custom-tools/subagent/agents/planner.md +37 -0
  22. package/examples/custom-tools/subagent/agents/scout.md +50 -0
  23. package/examples/custom-tools/subagent/agents/worker.md +24 -0
  24. package/examples/custom-tools/subagent/agents.ts +156 -0
  25. package/examples/custom-tools/subagent/commands/implement-and-review.md +10 -0
  26. package/examples/custom-tools/subagent/commands/implement.md +10 -0
  27. package/examples/custom-tools/subagent/commands/scout-and-plan.md +9 -0
  28. package/examples/custom-tools/subagent/index.ts +1002 -0
  29. package/examples/custom-tools/todo/index.ts +212 -0
  30. package/examples/hooks/README.md +56 -0
  31. package/examples/hooks/auto-commit-on-exit.ts +49 -0
  32. package/examples/hooks/confirm-destructive.ts +59 -0
  33. package/examples/hooks/custom-compaction.ts +116 -0
  34. package/examples/hooks/dirty-repo-guard.ts +52 -0
  35. package/examples/hooks/file-trigger.ts +41 -0
  36. package/examples/hooks/git-checkpoint.ts +53 -0
  37. package/examples/hooks/handoff.ts +150 -0
  38. package/examples/hooks/permission-gate.ts +34 -0
  39. package/examples/hooks/protected-paths.ts +30 -0
  40. package/examples/hooks/qna.ts +119 -0
  41. package/examples/hooks/snake.ts +343 -0
  42. package/examples/hooks/status-line.ts +40 -0
  43. package/examples/sdk/01-minimal.ts +22 -0
  44. package/examples/sdk/02-custom-model.ts +49 -0
  45. package/examples/sdk/03-custom-prompt.ts +44 -0
  46. package/examples/sdk/04-skills.ts +44 -0
  47. package/examples/sdk/05-tools.ts +90 -0
  48. package/examples/sdk/06-hooks.ts +61 -0
  49. package/examples/sdk/07-context-files.ts +36 -0
  50. package/examples/sdk/08-slash-commands.ts +42 -0
  51. package/examples/sdk/09-api-keys-and-oauth.ts +55 -0
  52. package/examples/sdk/10-settings.ts +38 -0
  53. package/examples/sdk/11-sessions.ts +48 -0
  54. package/examples/sdk/12-full-control.ts +95 -0
  55. package/examples/sdk/README.md +154 -0
  56. package/package.json +89 -0
  57. package/src/bun-imports.d.ts +16 -0
  58. package/src/capability/context-file.ts +40 -0
  59. package/src/capability/extension.ts +48 -0
  60. package/src/capability/hook.ts +40 -0
  61. package/src/capability/index.ts +616 -0
  62. package/src/capability/instruction.ts +37 -0
  63. package/src/capability/mcp.ts +52 -0
  64. package/src/capability/prompt.ts +35 -0
  65. package/src/capability/rule.ts +56 -0
  66. package/src/capability/settings.ts +35 -0
  67. package/src/capability/skill.ts +49 -0
  68. package/src/capability/slash-command.ts +40 -0
  69. package/src/capability/system-prompt.ts +35 -0
  70. package/src/capability/tool.ts +38 -0
  71. package/src/capability/types.ts +166 -0
  72. package/src/cli/args.ts +259 -0
  73. package/src/cli/file-processor.ts +121 -0
  74. package/src/cli/list-models.ts +104 -0
  75. package/src/cli/plugin-cli.ts +661 -0
  76. package/src/cli/session-picker.ts +41 -0
  77. package/src/cli/update-cli.ts +274 -0
  78. package/src/cli.ts +10 -0
  79. package/src/config.ts +391 -0
  80. package/src/core/agent-session.ts +2178 -0
  81. package/src/core/auth-storage.ts +258 -0
  82. package/src/core/bash-executor.ts +197 -0
  83. package/src/core/compaction/branch-summarization.ts +315 -0
  84. package/src/core/compaction/compaction.ts +664 -0
  85. package/src/core/compaction/index.ts +7 -0
  86. package/src/core/compaction/utils.ts +153 -0
  87. package/src/core/custom-commands/bundled/review/index.ts +156 -0
  88. package/src/core/custom-commands/index.ts +15 -0
  89. package/src/core/custom-commands/loader.ts +226 -0
  90. package/src/core/custom-commands/types.ts +112 -0
  91. package/src/core/custom-tools/index.ts +22 -0
  92. package/src/core/custom-tools/loader.ts +248 -0
  93. package/src/core/custom-tools/types.ts +185 -0
  94. package/src/core/custom-tools/wrapper.ts +29 -0
  95. package/src/core/exec.ts +139 -0
  96. package/src/core/export-html/index.ts +159 -0
  97. package/src/core/export-html/template.css +774 -0
  98. package/src/core/export-html/template.generated.ts +2 -0
  99. package/src/core/export-html/template.html +45 -0
  100. package/src/core/export-html/template.js +1185 -0
  101. package/src/core/export-html/template.macro.ts +24 -0
  102. package/src/core/file-mentions.ts +54 -0
  103. package/src/core/hooks/index.ts +16 -0
  104. package/src/core/hooks/loader.ts +288 -0
  105. package/src/core/hooks/runner.ts +434 -0
  106. package/src/core/hooks/tool-wrapper.ts +98 -0
  107. package/src/core/hooks/types.ts +770 -0
  108. package/src/core/index.ts +53 -0
  109. package/src/core/logger.ts +112 -0
  110. package/src/core/mcp/client.ts +185 -0
  111. package/src/core/mcp/config.ts +248 -0
  112. package/src/core/mcp/index.ts +45 -0
  113. package/src/core/mcp/loader.ts +99 -0
  114. package/src/core/mcp/manager.ts +235 -0
  115. package/src/core/mcp/tool-bridge.ts +156 -0
  116. package/src/core/mcp/transports/http.ts +316 -0
  117. package/src/core/mcp/transports/index.ts +6 -0
  118. package/src/core/mcp/transports/stdio.ts +252 -0
  119. package/src/core/mcp/types.ts +228 -0
  120. package/src/core/messages.ts +211 -0
  121. package/src/core/model-registry.ts +334 -0
  122. package/src/core/model-resolver.ts +494 -0
  123. package/src/core/plugins/doctor.ts +67 -0
  124. package/src/core/plugins/index.ts +38 -0
  125. package/src/core/plugins/installer.ts +189 -0
  126. package/src/core/plugins/loader.ts +339 -0
  127. package/src/core/plugins/manager.ts +672 -0
  128. package/src/core/plugins/parser.ts +105 -0
  129. package/src/core/plugins/paths.ts +37 -0
  130. package/src/core/plugins/types.ts +190 -0
  131. package/src/core/sdk.ts +900 -0
  132. package/src/core/session-manager.ts +1837 -0
  133. package/src/core/settings-manager.ts +860 -0
  134. package/src/core/skills.ts +352 -0
  135. package/src/core/slash-commands.ts +132 -0
  136. package/src/core/system-prompt.ts +442 -0
  137. package/src/core/timings.ts +25 -0
  138. package/src/core/title-generator.ts +110 -0
  139. package/src/core/tools/ask.ts +193 -0
  140. package/src/core/tools/bash-interceptor.ts +120 -0
  141. package/src/core/tools/bash.ts +91 -0
  142. package/src/core/tools/context.ts +32 -0
  143. package/src/core/tools/edit-diff.ts +487 -0
  144. package/src/core/tools/edit.ts +140 -0
  145. package/src/core/tools/exa/company.ts +59 -0
  146. package/src/core/tools/exa/index.ts +63 -0
  147. package/src/core/tools/exa/linkedin.ts +59 -0
  148. package/src/core/tools/exa/mcp-client.ts +368 -0
  149. package/src/core/tools/exa/render.ts +200 -0
  150. package/src/core/tools/exa/researcher.ts +90 -0
  151. package/src/core/tools/exa/search.ts +338 -0
  152. package/src/core/tools/exa/types.ts +167 -0
  153. package/src/core/tools/exa/websets.ts +248 -0
  154. package/src/core/tools/find.ts +244 -0
  155. package/src/core/tools/grep.ts +584 -0
  156. package/src/core/tools/index.ts +283 -0
  157. package/src/core/tools/ls.ts +142 -0
  158. package/src/core/tools/lsp/client.ts +767 -0
  159. package/src/core/tools/lsp/clients/biome-client.ts +207 -0
  160. package/src/core/tools/lsp/clients/index.ts +49 -0
  161. package/src/core/tools/lsp/clients/lsp-linter-client.ts +98 -0
  162. package/src/core/tools/lsp/config.ts +845 -0
  163. package/src/core/tools/lsp/edits.ts +110 -0
  164. package/src/core/tools/lsp/index.ts +1364 -0
  165. package/src/core/tools/lsp/render.ts +560 -0
  166. package/src/core/tools/lsp/rust-analyzer.ts +145 -0
  167. package/src/core/tools/lsp/types.ts +495 -0
  168. package/src/core/tools/lsp/utils.ts +526 -0
  169. package/src/core/tools/notebook.ts +182 -0
  170. package/src/core/tools/output.ts +198 -0
  171. package/src/core/tools/path-utils.ts +61 -0
  172. package/src/core/tools/read.ts +507 -0
  173. package/src/core/tools/renderers.ts +820 -0
  174. package/src/core/tools/review.ts +275 -0
  175. package/src/core/tools/rulebook.ts +124 -0
  176. package/src/core/tools/task/agents.ts +158 -0
  177. package/src/core/tools/task/artifacts.ts +114 -0
  178. package/src/core/tools/task/commands.ts +157 -0
  179. package/src/core/tools/task/discovery.ts +217 -0
  180. package/src/core/tools/task/executor.ts +531 -0
  181. package/src/core/tools/task/index.ts +548 -0
  182. package/src/core/tools/task/model-resolver.ts +176 -0
  183. package/src/core/tools/task/parallel.ts +38 -0
  184. package/src/core/tools/task/render.ts +502 -0
  185. package/src/core/tools/task/subprocess-tool-registry.ts +89 -0
  186. package/src/core/tools/task/types.ts +142 -0
  187. package/src/core/tools/truncate.ts +265 -0
  188. package/src/core/tools/web-fetch.ts +2511 -0
  189. package/src/core/tools/web-search/auth.ts +199 -0
  190. package/src/core/tools/web-search/index.ts +583 -0
  191. package/src/core/tools/web-search/providers/anthropic.ts +198 -0
  192. package/src/core/tools/web-search/providers/exa.ts +196 -0
  193. package/src/core/tools/web-search/providers/perplexity.ts +195 -0
  194. package/src/core/tools/web-search/render.ts +372 -0
  195. package/src/core/tools/web-search/types.ts +180 -0
  196. package/src/core/tools/write.ts +63 -0
  197. package/src/core/ttsr.ts +211 -0
  198. package/src/core/utils.ts +187 -0
  199. package/src/discovery/agents-md.ts +75 -0
  200. package/src/discovery/builtin.ts +647 -0
  201. package/src/discovery/claude.ts +623 -0
  202. package/src/discovery/cline.ts +104 -0
  203. package/src/discovery/codex.ts +571 -0
  204. package/src/discovery/cursor.ts +266 -0
  205. package/src/discovery/gemini.ts +368 -0
  206. package/src/discovery/github.ts +120 -0
  207. package/src/discovery/helpers.test.ts +127 -0
  208. package/src/discovery/helpers.ts +249 -0
  209. package/src/discovery/index.ts +84 -0
  210. package/src/discovery/mcp-json.ts +127 -0
  211. package/src/discovery/vscode.ts +99 -0
  212. package/src/discovery/windsurf.ts +219 -0
  213. package/src/index.ts +192 -0
  214. package/src/main.ts +507 -0
  215. package/src/migrations.ts +156 -0
  216. package/src/modes/cleanup.ts +23 -0
  217. package/src/modes/index.ts +48 -0
  218. package/src/modes/interactive/components/armin.ts +382 -0
  219. package/src/modes/interactive/components/assistant-message.ts +86 -0
  220. package/src/modes/interactive/components/bash-execution.ts +199 -0
  221. package/src/modes/interactive/components/bordered-loader.ts +41 -0
  222. package/src/modes/interactive/components/branch-summary-message.ts +42 -0
  223. package/src/modes/interactive/components/compaction-summary-message.ts +45 -0
  224. package/src/modes/interactive/components/custom-editor.ts +122 -0
  225. package/src/modes/interactive/components/diff.ts +147 -0
  226. package/src/modes/interactive/components/dynamic-border.ts +25 -0
  227. package/src/modes/interactive/components/extensions/extension-dashboard.ts +296 -0
  228. package/src/modes/interactive/components/extensions/extension-list.ts +479 -0
  229. package/src/modes/interactive/components/extensions/index.ts +9 -0
  230. package/src/modes/interactive/components/extensions/inspector-panel.ts +313 -0
  231. package/src/modes/interactive/components/extensions/state-manager.ts +558 -0
  232. package/src/modes/interactive/components/extensions/types.ts +191 -0
  233. package/src/modes/interactive/components/hook-editor.ts +117 -0
  234. package/src/modes/interactive/components/hook-input.ts +64 -0
  235. package/src/modes/interactive/components/hook-message.ts +96 -0
  236. package/src/modes/interactive/components/hook-selector.ts +91 -0
  237. package/src/modes/interactive/components/model-selector.ts +560 -0
  238. package/src/modes/interactive/components/oauth-selector.ts +136 -0
  239. package/src/modes/interactive/components/plugin-settings.ts +481 -0
  240. package/src/modes/interactive/components/queue-mode-selector.ts +56 -0
  241. package/src/modes/interactive/components/session-selector.ts +220 -0
  242. package/src/modes/interactive/components/settings-defs.ts +597 -0
  243. package/src/modes/interactive/components/settings-selector.ts +545 -0
  244. package/src/modes/interactive/components/show-images-selector.ts +45 -0
  245. package/src/modes/interactive/components/status-line/index.ts +4 -0
  246. package/src/modes/interactive/components/status-line/presets.ts +94 -0
  247. package/src/modes/interactive/components/status-line/segments.ts +350 -0
  248. package/src/modes/interactive/components/status-line/separators.ts +55 -0
  249. package/src/modes/interactive/components/status-line/types.ts +81 -0
  250. package/src/modes/interactive/components/status-line-segment-editor.ts +357 -0
  251. package/src/modes/interactive/components/status-line.ts +384 -0
  252. package/src/modes/interactive/components/theme-selector.ts +62 -0
  253. package/src/modes/interactive/components/thinking-selector.ts +64 -0
  254. package/src/modes/interactive/components/tool-execution.ts +946 -0
  255. package/src/modes/interactive/components/tree-selector.ts +877 -0
  256. package/src/modes/interactive/components/ttsr-notification.ts +82 -0
  257. package/src/modes/interactive/components/user-message-selector.ts +159 -0
  258. package/src/modes/interactive/components/user-message.ts +18 -0
  259. package/src/modes/interactive/components/visual-truncate.ts +50 -0
  260. package/src/modes/interactive/components/welcome.ts +228 -0
  261. package/src/modes/interactive/interactive-mode.ts +2669 -0
  262. package/src/modes/interactive/theme/dark.json +102 -0
  263. package/src/modes/interactive/theme/defaults/dark-arctic.json +111 -0
  264. package/src/modes/interactive/theme/defaults/dark-catppuccin.json +106 -0
  265. package/src/modes/interactive/theme/defaults/dark-cyberpunk.json +109 -0
  266. package/src/modes/interactive/theme/defaults/dark-dracula.json +105 -0
  267. package/src/modes/interactive/theme/defaults/dark-forest.json +103 -0
  268. package/src/modes/interactive/theme/defaults/dark-github.json +112 -0
  269. package/src/modes/interactive/theme/defaults/dark-gruvbox.json +119 -0
  270. package/src/modes/interactive/theme/defaults/dark-monochrome.json +101 -0
  271. package/src/modes/interactive/theme/defaults/dark-monokai.json +105 -0
  272. package/src/modes/interactive/theme/defaults/dark-nord.json +104 -0
  273. package/src/modes/interactive/theme/defaults/dark-ocean.json +108 -0
  274. package/src/modes/interactive/theme/defaults/dark-one.json +107 -0
  275. package/src/modes/interactive/theme/defaults/dark-retro.json +99 -0
  276. package/src/modes/interactive/theme/defaults/dark-rose-pine.json +95 -0
  277. package/src/modes/interactive/theme/defaults/dark-solarized.json +96 -0
  278. package/src/modes/interactive/theme/defaults/dark-sunset.json +106 -0
  279. package/src/modes/interactive/theme/defaults/dark-synthwave.json +102 -0
  280. package/src/modes/interactive/theme/defaults/dark-tokyo-night.json +108 -0
  281. package/src/modes/interactive/theme/defaults/index.ts +67 -0
  282. package/src/modes/interactive/theme/defaults/light-arctic.json +106 -0
  283. package/src/modes/interactive/theme/defaults/light-catppuccin.json +105 -0
  284. package/src/modes/interactive/theme/defaults/light-cyberpunk.json +103 -0
  285. package/src/modes/interactive/theme/defaults/light-forest.json +107 -0
  286. package/src/modes/interactive/theme/defaults/light-github.json +114 -0
  287. package/src/modes/interactive/theme/defaults/light-gruvbox.json +115 -0
  288. package/src/modes/interactive/theme/defaults/light-monochrome.json +100 -0
  289. package/src/modes/interactive/theme/defaults/light-ocean.json +106 -0
  290. package/src/modes/interactive/theme/defaults/light-one.json +105 -0
  291. package/src/modes/interactive/theme/defaults/light-retro.json +105 -0
  292. package/src/modes/interactive/theme/defaults/light-solarized.json +101 -0
  293. package/src/modes/interactive/theme/defaults/light-sunset.json +106 -0
  294. package/src/modes/interactive/theme/defaults/light-synthwave.json +105 -0
  295. package/src/modes/interactive/theme/defaults/light-tokyo-night.json +118 -0
  296. package/src/modes/interactive/theme/light.json +99 -0
  297. package/src/modes/interactive/theme/theme-schema.json +424 -0
  298. package/src/modes/interactive/theme/theme.ts +2211 -0
  299. package/src/modes/print-mode.ts +163 -0
  300. package/src/modes/rpc/rpc-client.ts +527 -0
  301. package/src/modes/rpc/rpc-mode.ts +494 -0
  302. package/src/modes/rpc/rpc-types.ts +203 -0
  303. package/src/prompts/architect-plan.md +10 -0
  304. package/src/prompts/branch-summary-preamble.md +3 -0
  305. package/src/prompts/branch-summary.md +28 -0
  306. package/src/prompts/browser.md +71 -0
  307. package/src/prompts/compaction-summary.md +34 -0
  308. package/src/prompts/compaction-turn-prefix.md +16 -0
  309. package/src/prompts/compaction-update-summary.md +41 -0
  310. package/src/prompts/explore.md +82 -0
  311. package/src/prompts/implement-with-critic.md +11 -0
  312. package/src/prompts/implement.md +11 -0
  313. package/src/prompts/init.md +30 -0
  314. package/src/prompts/plan.md +54 -0
  315. package/src/prompts/reviewer.md +81 -0
  316. package/src/prompts/summarization-system.md +3 -0
  317. package/src/prompts/system-prompt.md +27 -0
  318. package/src/prompts/task.md +56 -0
  319. package/src/prompts/title-system.md +8 -0
  320. package/src/prompts/tools/ask.md +24 -0
  321. package/src/prompts/tools/bash.md +23 -0
  322. package/src/prompts/tools/edit.md +9 -0
  323. package/src/prompts/tools/find.md +6 -0
  324. package/src/prompts/tools/grep.md +12 -0
  325. package/src/prompts/tools/lsp.md +14 -0
  326. package/src/prompts/tools/output.md +23 -0
  327. package/src/prompts/tools/read.md +25 -0
  328. package/src/prompts/tools/web-fetch.md +8 -0
  329. package/src/prompts/tools/web-search.md +10 -0
  330. package/src/prompts/tools/write.md +10 -0
  331. package/src/utils/changelog.ts +99 -0
  332. package/src/utils/clipboard.ts +265 -0
  333. package/src/utils/fuzzy.ts +108 -0
  334. package/src/utils/mime.ts +30 -0
  335. package/src/utils/shell-snapshot.ts +218 -0
  336. package/src/utils/shell.ts +364 -0
  337. package/src/utils/tools-manager.ts +265 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1629 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.1.0] - 2026-01-05
6
+
7
+ ### Added
8
+
9
+ - Added spinner type variants (status and activity) with distinct animation frames per symbol preset
10
+ - Added animated spinner for task tool progress display during subagent execution
11
+ - Added language/file type icons for read tool output with support for 35+ file types
12
+ - Added async cleanup registry for graceful session flush on SIGINT, SIGTERM, and SIGHUP signals
13
+ - Added subagent token usage aggregation to session statistics and task tool results
14
+ - Added streaming NDJSON writer for session persistence with proper backpressure handling
15
+ - Added `flush()` method to SessionManager for explicit control over pending write completion
16
+ - Added `/exit` slash command to exit the application from interactive mode
17
+ - Added fuzzy path matching suggestions when read tool encounters file-not-found errors, showing closest matches using Levenshtein distance
18
+ - Added `status.shadowed` symbol for theme customization to properly indicate shadowed extension state
19
+ - Added Biome CLI-based linter client as alternative to LSP for more reliable diagnostics
20
+ - Added LinterClient interface for pluggable formatter/linter implementations
21
+ - Added status line segment editor for arranging and toggling status line components
22
+ - Added status line presets (default, minimal, compact, developer, balanced) for quick configuration
23
+ - Added status line separator styles (powerline, powerline-thin, arrow, slash, pipe, space)
24
+ - Added configurable status line segments including time, hostname, and subagent count
25
+ - Added symbol customization via theme overrides for icons, separators, and glyphs
26
+ - Added 30+ built-in color themes including Catppuccin, Dracula, Nord, Gruvbox, Tokyo Night, and more
27
+ - Added configurable status line with customizable segments, presets, and separators
28
+ - Added status line segment editor for arranging and toggling status line components
29
+ - Added symbol preset setting to switch between Unicode, Nerd Font, and ASCII glyphs
30
+ - Added file size limit (20MB) for image files to prevent memory issues during serialization
31
+
32
+ ### Changed
33
+
34
+ - Changed `isError` property in tool result events to be optional instead of required
35
+ - Changed `SessionManager.open()` and `SessionManager.continueRecent()` to async methods for proper initialization
36
+ - Changed session file writes to use atomic rename pattern with fsync for crash-safe persistence
37
+ - Changed read tool display to show file type icons and metadata inline with path
38
+ - Changed `AgentSession.dispose()` to async method that flushes pending writes before cleanup
39
+ - Changed read tool result display to hide content by default with expand hint, showing only metadata until expanded
40
+ - Changed diagnostics display to group messages by file with tree structure and severity icons
41
+ - Changed diff stats formatting to use colored +/- indicators with slash separators
42
+ - Changed session persistence to use streaming writes instead of synchronous file appends for better performance
43
+ - Changed read tool to automatically redirect to ls when given a directory path instead of a file
44
+ - Changed tool description prompts to be more concise with clearer usage guidelines and structured formatting
45
+ - Moved tool description prompts from inline strings to external markdown files in `src/prompts/tools/` directory for better maintainability
46
+ - Changed Exa web search provider from MCP protocol to direct REST API for simpler integration
47
+ - Changed web search result rendering to handle malformed response data with fallback text display
48
+ - Changed compaction prompts to preserve tool outputs, command results, and repository state in context summaries
49
+ - Changed init prompt to include runtime/tooling preferences section and improved formatting guidelines
50
+ - Changed reviewer prompt to require evidence-backed findings anchored to diff hunks with stricter suggestion block formatting
51
+ - Changed system prompt to include explicit core behavior guidelines for task completion and progress updates
52
+ - Changed task prompt to emphasize end-to-end task completion and tool verification
53
+ - Moved all prompt templates from inline strings to external markdown files in `src/prompts/` directory for better maintainability
54
+ - Changed tool result renderers to use structured tree layouts with consistent expand hints and truncation indicators
55
+ - Changed grep, find, and ls tools to show scope path and detailed truncation reasons in output
56
+ - Changed web search and web fetch result rendering to display structured metadata sections with bounded content previews
57
+ - Changed task/subagent progress rendering to use badge-style status labels and structured output sections
58
+ - Changed notebook tool to display cell content preview with line counts
59
+ - Changed ask tool result to show checkbox-style selection indicators
60
+ - Changed output tool to include provenance metadata and content previews for retrieved outputs
61
+ - Changed collapsed tool views to show consistent "Ctrl+O to expand" hints with remaining item counts
62
+ - Changed Biome integration to use CLI instead of LSP to avoid stale diagnostics issues
63
+ - Changed hardcoded UI symbols throughout codebase to use theme-configurable glyphs
64
+ - Changed tree drawing characters to use theme-defined box-drawing symbols
65
+ - Changed status line rendering to support left/right segment positioning with separators
66
+ - Changed hardcoded UI symbols to use theme-configurable glyphs throughout the interface
67
+ - Changed tree drawing characters to use theme-defined box-drawing symbols
68
+ - Changed CLI image attachments to resize if larger than 2048px (fit within 1920x1080) and convert >2MB images to JPEG
69
+
70
+ ### Removed
71
+
72
+ - Removed custom renderers for ls, find, and grep tools in favor of generic tool display
73
+
74
+ ### Fixed
75
+
76
+ - Fixed spinner animation crash when spinner frames array is empty by adding length check
77
+ - Fixed session persistence to properly await all queued writes before closing or switching sessions
78
+ - Fixed session persistence to truncate oversized content blocks before writing to prevent memory exhaustion
79
+ - Fixed extension list and inspector panel to use correct symbols for disabled and shadowed states instead of reusing unrelated status icons
80
+ - Fixed token counting for subagent progress to handle different usage object formats (camelCase and snake_case)
81
+ - Fixed image file handling by adding 20MB size limit to prevent memory issues during serialization
82
+ - Fixed session persistence to truncate oversized entries before writing JSONL to prevent out-of-memory errors
83
+
84
+ ## [3.14.0] - 2026-01-04
85
+ ### Added
86
+
87
+ - Added `getUsageStatistics()` method to SessionManager for tracking cumulative token usage and costs across session messages
88
+
89
+ ### Changed
90
+
91
+ - Changed status line to display usage statistics more efficiently by using centralized session statistics instead of recalculating from entries
92
+
93
+ ## [3.13.1337] - 2026-01-04
94
+
95
+ ## [3.9.1337] - 2026-01-04
96
+
97
+ ### Changed
98
+
99
+ - Changed default for `lsp.formatOnWrite` setting from `true` to `false`
100
+ - Updated status line thinking level display to use emoji icons instead of abbreviated text
101
+ - Changed auto-compact indicator from "(auto)" text to icon
102
+
103
+ ### Fixed
104
+
105
+ - Fixed status line not updating token counts and cost after starting a new session
106
+ - Fixed stale diagnostics persisting after file content changes in LSP client
107
+
108
+ ## [3.8.1337] - 2026-01-04
109
+ ### Added
110
+
111
+ - Added automatic browser opening after exporting session to HTML
112
+ - Added automatic browser opening after sharing session as a Gist
113
+
114
+ ### Fixed
115
+
116
+ - Fixed session titles not persisting to file when set before first flush
117
+
118
+ ## [3.7.1337] - 2026-01-04
119
+ ### Added
120
+
121
+ - Added `EditMatchError` class for structured error handling in edit operations
122
+ - Added `utils` module export with `once` and `untilAborted` helper functions
123
+ - Added in-memory LSP content sync via `syncContent` and `notifySaved` client methods
124
+
125
+ ### Changed
126
+
127
+ - Refactored LSP integration to use writethrough callbacks for edit and write tools, improving performance by syncing content in-memory before disk writes
128
+ - Simplified FileDiagnosticsResult interface with renamed fields: `diagnostics` → `messages`, `hasErrors` → `errored`, `serverName` → `server`
129
+ - Session title generation now triggers before sending the first message rather than after agent work begins
130
+
131
+ ### Fixed
132
+
133
+ - Fixed potential text decoding issues in bash executor by using streaming TextDecoder instead of Buffer.toString()
134
+
135
+ ## [3.6.1337] - 2026-01-03
136
+
137
+ ## [3.5.1337] - 2026-01-03
138
+
139
+ ### Added
140
+
141
+ - Added session header and footer output in text mode showing version, model, provider, thinking level, and session ID
142
+ - Added Extension Control Center dashboard accessible via `/extensions` command for unified management of all providers and extensions
143
+ - Added ability to enable/disable individual extensions with persistent settings
144
+ - Added three-column dashboard layout with sidebar tree, extension list, and inspector panel
145
+ - Added fuzzy search filtering for extensions in the dashboard
146
+ - Added keyboard navigation with Tab to cycle panes, j/k for navigation, Space to toggle, Enter to expand/collapse
147
+
148
+ ### Changed
149
+
150
+ - Redesigned Extension Control Center from 3-column layout to tabbed interface with horizontal provider tabs and 2-column grid
151
+ - Replaced sidebar tree navigation with provider tabs using TAB/Shift+TAB cycling
152
+
153
+ ### Fixed
154
+
155
+ - Fixed title generation flag not resetting when starting a new session
156
+
157
+ ## [3.4.1337] - 2026-01-03
158
+
159
+ ### Added
160
+
161
+ - Added Time Traveling Stream Rules (TTSR) feature that monitors agent output for pattern matches and injects rule reminders mid-stream
162
+ - Added `ttsr_trigger` frontmatter field for rules to define regex patterns that trigger mid-stream injection
163
+ - Added TTSR settings for enabled state, context mode (keep/discard partial output), and repeat mode (once/after-gap)
164
+
165
+ ### Fixed
166
+
167
+ - Fixed excessive subprocess spawns by caching git status for 1 second in the footer component
168
+
169
+ ## [3.3.1337] - 2026-01-03
170
+
171
+ ### Changed
172
+
173
+ - Improved `/status` command output formatting to use consistent column alignment across all sections
174
+ - Updated version update notification to suggest `omp update` instead of manual npm install command
175
+
176
+ ## [3.1.1337] - 2026-01-03
177
+ ### Added
178
+
179
+ - Added `spawns` frontmatter field for agent definitions to control which sub-agents can be spawned
180
+ - Added spawn restriction enforcement preventing agents from spawning unauthorized sub-agents
181
+
182
+ ### Fixed
183
+
184
+ - Fixed duplicate skill loading when the same SKILL.md file was discovered through multiple paths
185
+
186
+ ## [3.0.1337] - 2026-01-03
187
+
188
+ ### Added
189
+
190
+ - Added unified capability-based discovery system for loading configuration from multiple AI coding tools (Claude Code, Cursor, Windsurf, Gemini, Codex, Cline, GitHub Copilot, VS Code)
191
+ - Added support for discovering MCP servers, rules, skills, hooks, tools, slash commands, prompts, and context files from tool-specific config directories
192
+ - Added Discovery settings tab in interactive mode to enable/disable individual configuration providers
193
+ - Added provider source attribution showing which tool contributed each configuration item
194
+ - Added support for Cursor MDC rule format with frontmatter (description, globs, alwaysApply)
195
+ - Added support for Windsurf rules from .windsurf/rules/*.md and global_rules.md
196
+ - Added support for Cline rules from .clinerules file or directory
197
+ - Added support for GitHub Copilot instructions with applyTo glob patterns
198
+ - Added support for Gemini extensions and system.md customization files
199
+ - Added support for Codex AGENTS.md and config.toml settings
200
+ - Added automatic migration of `PI_*` environment variables to `OMP_*` equivalents for backwards compatibility
201
+ - Added multi-path config discovery supporting `.omp`, `.pi`, and `.claude` directories with priority ordering
202
+ - Added `getConfigDirPaths()`, `findConfigFile()`, and `readConfigFile()` functions for unified config resolution
203
+ - Added documentation for config module usage patterns
204
+
205
+ ### Changed
206
+
207
+ - Changed MCP tool name parsing to use last underscore separator for better server name handling
208
+ - Changed /config output to show provider attribution for discovered items
209
+ - Renamed CLI binary from `pi` to `omp` and updated all command references
210
+ - Changed config directory from `.pi` to `.omp` with fallback support for legacy paths
211
+ - Renamed environment variables from `PI_*` to `OMP_*` prefix (e.g., `OMP_SMOL_MODEL`, `OMP_SLOW_MODEL`)
212
+ - Changed model role alias prefix from `pi/` to `omp/` (e.g., `omp/slow` instead of `pi/slow`)
213
+
214
+ ## [2.3.1337] - 2026-01-03
215
+
216
+ ## [2.2.1337] - 2026-01-03
217
+
218
+ ## [2.1.1337] - 2026-01-03
219
+
220
+ ### Added
221
+
222
+ - Added `omp update` command to check for and install updates from GitHub releases or via bun
223
+
224
+ ### Changed
225
+
226
+ - Changed HTML export to use compile-time bundled templates via Bun macros for improved performance
227
+ - Changed `exportToHtml` and `exportFromFile` functions to be async
228
+ - Simplified build process by embedding assets (themes, templates, agents, commands) directly into the binary at compile time
229
+ - Removed separate asset copying steps from build scripts
230
+
231
+ ## [2.0.1337] - 2026-01-03
232
+ ### Added
233
+
234
+ - Added shell environment snapshot to preserve user aliases, functions, and shell options when executing bash commands
235
+ - Added support for `OMP_BASH_NO_CI`, `OMP_BASH_NO_LOGIN`, and `OMP_SHELL_PREFIX` environment variables for shell customization
236
+ - Added zsh support alongside bash for shell detection and configuration
237
+
238
+ ### Changed
239
+
240
+ - Changed shell detection to prefer user's `$SHELL` when it's bash or zsh, with improved fallback path resolution
241
+ - Changed Edit tool to reject `.ipynb` files with guidance to use NotebookEdit tool instead
242
+
243
+ ## [1.500.0] - 2026-01-03
244
+ ### Added
245
+
246
+ - Added provider tabs to model selector with Tab/Arrow navigation for filtering models by provider
247
+ - Added context menu to model selector for choosing model role (Default, Smol, Slow) instead of keyboard shortcuts
248
+ - Added LSP diagnostics display in tool execution output showing errors and warnings after file edits
249
+ - Added centralized file logger with daily rotation to `~/.omp/logs/` for debugging production issues
250
+ - Added `logger` property to hook and custom tool APIs for error/warning/debug logging
251
+ - Added `output` tool to read full agent/task outputs by ID when truncated previews are insufficient
252
+ - Added `task` tool to reviewer agent, enabling parallel exploration of large codebases during reviews
253
+ - Added subprocess tool registry for extracting and rendering tool data from subprocess agents in real-time
254
+ - Added combined review result rendering showing verdict and findings in a tree structure
255
+ - Auto-read file mentions: Reference files with `@path/to/file.ext` syntax in prompts to automatically inject their contents, eliminating manual Read tool calls
256
+ - Added `hidden` property for custom tools to exclude them from default tool list unless explicitly requested
257
+ - Added `explicitTools` option to `createAgentSession` for enabling hidden tools by name
258
+ - Added example review tools (`report_finding`, `submit_review`) with structured findings accumulation and verdict rendering
259
+ - Added `/review` example command for interactive code review with branch comparison, uncommitted changes, and commit review modes
260
+ - Custom TypeScript slash commands: Create programmable commands at `~/.omp/agent/commands/[name]/index.ts` or `.omp/commands/[name]/index.ts`. Commands export a factory returning `{ name, description, execute(args, ctx) }`. Return a string to send as LLM prompt, or void for fire-and-forget actions. Full access to `HookCommandContext` for UI dialogs, session control, and shell execution.
261
+ - Claude command directories: Markdown slash commands now also load from `~/.claude/commands/` and `.claude/commands/` (parallel to existing `.omp/commands/` support)
262
+ - `commands.enableClaudeUser` and `commands.enableClaudeProject` settings to disable Claude command directory loading
263
+ - `/export --copy` option to copy entire session as formatted text to clipboard
264
+
265
+ ### Changed
266
+
267
+ - Changed model selector keyboard shortcuts from S/L keys to a context menu opened with Enter
268
+ - Changed model role indicators from symbols (✓ ⚡ 🧠) to labeled badges ([ DEFAULT ] [ SMOL ] [ SLOW ])
269
+ - Changed model list sorting to include secondary sort by model ID within each provider
270
+ - Changed silent error suppression to log warnings and debug info for tool errors, theme loading, and command loading failures
271
+ - Changed Task tool progress display to show agent index (e.g., `reviewer(0)`) for easier Output tool ID derivation
272
+ - Changed Task tool output to only include file paths when Output tool is unavailable, providing Read tool fallback
273
+ - Changed Task tool output references to use simpler ID format (e.g., `reviewer_0`) with line/char counts for Output tool integration
274
+ - Changed subagent recursion prevention from blanket blocking to same-agent blocking. Non-recursive agents can now spawn other agent types (e.g., reviewer can spawn explore agents) but cannot spawn themselves.
275
+ - Changed `/review` command from markdown to interactive TypeScript with mode selection menu (branch comparison, uncommitted changes, commit review, custom)
276
+ - Changed bundled commands to be overridable by user/project commands with same name
277
+ - Changed subprocess termination to wait for message_end event to capture accurate token counts
278
+ - Changed token counting in subprocess to accumulate across messages instead of overwriting
279
+ - Updated bundled `reviewer` agent to use structured review tools with priority-based findings (P0-P3) and formal verdict submission
280
+ - Task tool now streams artifacts in real-time: input written before spawn, session jsonl written by subprocess, output written at completion
281
+
282
+ ### Removed
283
+
284
+ - Removed separate Exa error logger in favor of centralized logging system
285
+ - Removed `findings_count` parameter from `submit_review` tool - findings are now counted automatically
286
+ - Removed artifacts location display from task tool output
287
+
288
+ ### Fixed
289
+
290
+ - Fixed race condition in event listener iteration by copying array before iteration to prevent mutation during callbacks
291
+ - Fixed potential memory leak from orphaned abort controllers by properly aborting existing controllers before replacement
292
+ - Fixed stream reader resource leak by adding proper `releaseLock()` calls in finally blocks
293
+ - Fixed hook API methods throwing clear errors when handlers are not initialized instead of silently failing
294
+ - Fixed LSP client race conditions with concurrent client creation and file operations using proper locking
295
+ - Fixed Task tool progress display showing stale data by cloning progress objects before passing to callbacks
296
+ - Fixed Task tool missing final progress events by waiting for readline to close before resolving
297
+ - Fixed RPC mode race condition with concurrent prompt commands by serializing execution
298
+ - Fixed pre-commit hook race condition causing `index.lock` errors when GitKraken/IDE git integrations detect file changes during formatting
299
+ - Fixed Task tool output artifacts (`out.md`) containing duplicated text from streaming updates
300
+ - Fixed Task tool progress display showing repeated nearly-identical lines during streaming
301
+ - Fixed Task tool subprocess model selection ignoring agent's configured model and falling back to settings default. The `--model` flag now accepts `provider/model` format directly.
302
+ - Fixed Task tool showing "done + succeeded" when aborted; now correctly displays "⊘ aborted" status
303
+
304
+ ## [1.341.0] - 2026-01-03
305
+ ### Added
306
+
307
+ - Added interruptMode setting to control when queued messages are processed during tool execution.
308
+ - Implemented getter and setter methods in SettingsManager for interrupt mode persistence.
309
+ - Exposed interruptMode configuration in interactive settings UI with immediate/wait options.
310
+ - Wired interrupt mode through AgentSession and SDK to enable runtime configuration.
311
+ - Model roles: Configure different models for different purposes (default, smol, slow) via `/model` selector
312
+ - Model selector key bindings: Enter sets default, S sets smol, L sets slow, Escape closes
313
+ - Model selector shows role markers: ✓ for default, ⚡ for smol, 🧠 for slow
314
+ - `pi/<role>` model aliases in Task tool agent definitions (e.g., `model: pi/smol, haiku, flash, mini`)
315
+ - Smol model auto-discovery using priority chain: haiku > flash > mini
316
+ - Slow model auto-discovery using priority chain: gpt-5.2-codex > codex > gpt > opus > pro
317
+ - CLI args for model roles: `--smol <model>` and `--slow <model>` (ephemeral, not persisted)
318
+ - Env var overrides: `OMP_SMOL_MODEL` and `OMP_SLOW_MODEL`
319
+ - Title generation now uses configured smol model from settings
320
+ - LSP diagnostics on edit: Edit tool can now return LSP diagnostics after editing code files. Disabled by default to avoid noise during multi-edit sequences. Enable via `lsp.diagnosticsOnEdit` setting.
321
+ - LSP workspace diagnostics: New `lsp action=workspace_diagnostics` command checks the entire project for errors. Auto-detects project type and uses appropriate checker (rust-analyzer/cargo for Rust, tsc for TypeScript, go build for Go, pyright for Python).
322
+ - LSP local binary resolution: LSP servers installed in project-local directories are now discovered automatically. Checks `node_modules/.bin/` for Node.js projects, `.venv/bin/`/`venv/bin/` for Python projects, and `vendor/bundle/bin/` for Ruby projects before falling back to `$PATH`.
323
+ - LSP format on write: Write tool now automatically formats code files using LSP after writing. Uses the language server's built-in formatter (e.g., rustfmt for Rust, gofmt for Go). Controlled via `lsp.formatOnWrite` setting (enabled by default).
324
+ - LSP diagnostics on write: Write tool now returns LSP diagnostics (errors/warnings) after writing code files. This gives immediate feedback on syntax errors and type issues. Controlled via `lsp.diagnosticsOnWrite` setting (enabled by default).
325
+ - LSP server warmup at startup: LSP servers are now started at launch to avoid cold-start delays when first writing files.
326
+ - LSP server status in welcome banner: Shows which language servers are active and ready.
327
+ - Edit fuzzy match setting: Added `edit.fuzzyMatch` setting (enabled by default) to control whether the edit tool accepts high-confidence fuzzy matches for whitespace/indentation differences. Toggle via `/settings`.
328
+ - Multi-server LSP diagnostics: Diagnostics now query all applicable language servers for a file type. For TypeScript/JavaScript projects with Biome, this means both type errors (from tsserver) and lint errors (from Biome) are reported together.
329
+ - Comprehensive LSP server configurations for 40+ languages including Rust, Go, Python, Java, Kotlin, Scala, Haskell, OCaml, Elixir, Ruby, PHP, C#, Lua, Nix, and many more. Each server includes sensible defaults for args, settings, and init options.
330
+ - Extended LSP config file search paths: Now searches for `lsp.json`, `.lsp.json` in project root and `.omp/` subdirectory, plus user-level configs in `~/.omp/` and home directory.
331
+
332
+ ### Changed
333
+
334
+ - LSP settings moved to dedicated "LSP" tab in `/settings` for better organization
335
+ - Improved grep tool description to document pagination options (`headLimit`, `offset`) and clarify recursive search behavior
336
+ - LSP idle timeout now disabled by default. Configure via `idleTimeoutMs` in lsp.json to auto-shutdown inactive servers.
337
+ - Model settings now use role-based storage (`modelRoles` map) instead of single `defaultProvider`/`defaultModel` fields. Supports multiple model roles (default, small, etc.)
338
+ - Session model persistence now uses `"provider/modelId"` string format with optional role field
339
+
340
+ ### Fixed
341
+
342
+ - Recent sessions now show in welcome banner (was never wired up).
343
+ - Auto-generated session titles: Sessions are now automatically titled based on the first message using a small model (Haiku/GPT-4o-mini/Flash). Titles are shown in the terminal window title, recent sessions list, and --resume picker. The resume picker shows title with dimmed first message preview below.
344
+
345
+ ## [1.340.0] - 2026-01-03
346
+
347
+ ### Changed
348
+
349
+ - Replaced vendored highlight.js and marked.js with CDN-hosted versions for smaller exports
350
+ - Added runtime minification for HTML, CSS, and JS in session exports
351
+ - Session share URL now uses gistpreview.github.io instead of shittycodingagent.ai
352
+
353
+ ## [1.339.0] - 2026-01-03
354
+
355
+ ### Added
356
+
357
+ - MCP project config setting to disable loading `.mcp.json`/`mcp.json` from project root
358
+ - Support for both `mcp.json` and `.mcp.json` filenames (prefers `mcp.json` if both exist)
359
+ - Automatic Exa MCP server filtering with API key extraction for native integration
360
+
361
+ ## [1.338.0] - 2026-01-03
362
+
363
+ ### Added
364
+
365
+ - Bash interceptor setting to block shell commands that have dedicated tools (disabled by default, enable via `/settings`)
366
+
367
+ ### Changed
368
+
369
+ - Refactored settings UI to declarative definitions for easier maintenance
370
+ - Shell detection now respects `$SHELL` environment variable before falling back to bash/sh
371
+ - Tool binary detection now uses `Bun.which()` instead of spawning processes
372
+
373
+ ### Fixed
374
+
375
+ - CLI help text now accurately lists all default tools
376
+
377
+ ## [1.337.1] - 2026-01-02
378
+
379
+ ### Added
380
+
381
+ - MCP support and plugin system for external tool integration
382
+ - Git context to system prompt for repo awareness
383
+ - Bash interception to guide tool selection
384
+ - Fuzzy matching to handle indentation variance in edit tool
385
+ - Specialized Exa tools with granular toggles
386
+ - `/share` command for exporting conversations to HTML
387
+ - Edit diff preview before tool execution
388
+
389
+ ### Changed
390
+
391
+ - Renamed package scope to @oh-my-pi for consistent branding
392
+ - Simplified toolset and enhanced navigation
393
+ - Improved process cleanup with tree kill
394
+ - Updated CI/CD workflows for GitHub Actions with provenance-signed npm publishing
395
+
396
+ ### Fixed
397
+
398
+ - Template string interpolation in image read output
399
+ - Prevented full re-renders during write tool streaming
400
+ - Edit tool failing on files with UTF-8 BOM
401
+
402
+ ## [1.337.0] - 2026-01-02
403
+
404
+ Initial release under @oh-my-pi scope. See previous releases at [badlogic/pi-mono](https://github.com/badlogic/pi-mono).
405
+
406
+ ## [0.31.1] - 2026-01-02
407
+
408
+ ### Fixed
409
+
410
+ - 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))
411
+ - Type guard functions (`isBashToolResult`, etc.) now exported at runtime, not just in type declarations ([#397](https://github.com/badlogic/pi-mono/issues/397))
412
+
413
+ ## [0.31.0] - 2026-01-02
414
+
415
+ This release introduces session trees for in-place branching, major API changes to hooks and custom tools, and structured compaction with file tracking.
416
+
417
+ ### Session Tree
418
+
419
+ 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.
420
+
421
+ **Existing sessions are automatically migrated** (v1 → v2) on first load. No manual action required.
422
+
423
+ New entry types: `BranchSummaryEntry` (context from abandoned branches), `CustomEntry` (hook state), `CustomMessageEntry` (hook-injected messages), `LabelEntry` (bookmarks).
424
+
425
+ See [docs/session.md](docs/session.md) for the file format and `SessionManager` API.
426
+
427
+ ### Hooks Migration
428
+
429
+ The hooks API has been restructured with more granular events and better session access.
430
+
431
+ **Type renames:**
432
+
433
+ - `HookEventContext` → `HookContext`
434
+ - `HookCommandContext` is now a new interface extending `HookContext` with session control methods
435
+
436
+ **Event changes:**
437
+
438
+ - 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`
439
+ - `session_before_switch` and `session_switch` events now include `reason: "new" | "resume"` to distinguish between `/new` and `/resume`
440
+ - New `session_before_tree` and `session_tree` events for `/tree` navigation (hook can provide custom branch summary)
441
+ - New `before_agent_start` event: inject messages before the agent loop starts
442
+ - New `context` event: modify messages non-destructively before each LLM call
443
+ - Session entries are no longer passed in events. Use `ctx.sessionManager.getEntries()` or `ctx.sessionManager.getBranch()` instead
444
+
445
+ **API changes:**
446
+
447
+ - `pi.send(text, attachments?)` → `pi.sendMessage(message, triggerTurn?)` (creates `CustomMessageEntry`)
448
+ - New `pi.appendEntry(customType, data?)` for hook state persistence (not in LLM context)
449
+ - New `pi.registerCommand(name, options)` for custom slash commands (handler receives `HookCommandContext`)
450
+ - New `pi.registerMessageRenderer(customType, renderer)` for custom TUI rendering
451
+ - New `ctx.isIdle()`, `ctx.abort()`, `ctx.hasQueuedMessages()` for agent state (available in all events)
452
+ - New `ctx.ui.editor(title, prefill?)` for multi-line text editing with Ctrl+G external editor support
453
+ - New `ctx.ui.custom(component)` for full TUI component rendering with keyboard focus
454
+ - New `ctx.ui.setStatus(key, text)` for persistent status text in footer (multiple hooks can set their own)
455
+ - New `ctx.ui.theme` getter for styling text with theme colors
456
+ - `ctx.exec()` moved to `pi.exec()`
457
+ - `ctx.sessionFile` → `ctx.sessionManager.getSessionFile()`
458
+ - New `ctx.modelRegistry` and `ctx.model` for API key resolution
459
+
460
+ **HookCommandContext (slash commands only):**
461
+
462
+ - `ctx.waitForIdle()` - wait for agent to finish streaming
463
+ - `ctx.newSession(options?)` - create new sessions with optional setup callback
464
+ - `ctx.branch(entryId)` - branch from a specific entry
465
+ - `ctx.navigateTree(targetId, options?)` - navigate the session tree
466
+
467
+ These methods are only on `HookCommandContext` (not `HookContext`) because they can deadlock if called from event handlers that run inside the agent loop.
468
+
469
+ **Removed:**
470
+
471
+ - `hookTimeout` setting (hooks no longer have timeouts; use Ctrl+C to abort)
472
+ - `resolveApiKey` parameter (use `ctx.modelRegistry.getApiKey(model)`)
473
+
474
+ See [docs/hooks.md](docs/hooks.md) and [examples/hooks/](examples/hooks/) for the current API.
475
+
476
+ ### Custom Tools Migration
477
+
478
+ The custom tools API has been restructured to mirror the hooks pattern with a context object.
479
+
480
+ **Type renames:**
481
+
482
+ - `CustomAgentTool` → `CustomTool`
483
+ - `ToolAPI` → `CustomToolAPI`
484
+ - `ToolContext` → `CustomToolContext`
485
+ - `ToolSessionEvent` → `CustomToolSessionEvent`
486
+
487
+ **Execute signature changed:**
488
+
489
+ ```typescript
490
+ // Before (v0.30.2)
491
+ execute(toolCallId, params, signal, onUpdate)
492
+
493
+ // After
494
+ execute(toolCallId, params, onUpdate, ctx, signal?)
495
+ ```
496
+
497
+ The new `ctx: CustomToolContext` provides `sessionManager`, `modelRegistry`, `model`, and agent state methods:
498
+
499
+ - `ctx.isIdle()` - check if agent is streaming
500
+ - `ctx.hasQueuedMessages()` - check if user has queued messages (skip interactive prompts)
501
+ - `ctx.abort()` - abort current operation (fire-and-forget)
502
+
503
+ **Session event changes:**
504
+
505
+ - `CustomToolSessionEvent` now only has `reason` and `previousSessionFile`
506
+ - Session entries are no longer in the event. Use `ctx.sessionManager.getBranch()` or `ctx.sessionManager.getEntries()` to reconstruct state
507
+ - Reasons: `"start" | "switch" | "branch" | "tree" | "shutdown"` (no separate `"new"` reason; `/new` triggers `"switch"`)
508
+ - `dispose()` method removed. Use `onSession` with `reason: "shutdown"` for cleanup
509
+
510
+ See [docs/custom-tools.md](docs/custom-tools.md) and [examples/custom-tools/](examples/custom-tools/) for the current API.
511
+
512
+ ### SDK Migration
513
+
514
+ **Type changes:**
515
+
516
+ - `CustomAgentTool` → `CustomTool`
517
+ - `AppMessage` → `AgentMessage`
518
+ - `sessionFile` returns `string | undefined` (was `string | null`)
519
+ - `model` returns `Model | undefined` (was `Model | null`)
520
+ - `Attachment` type removed. Use `ImageContent` from `@oh-my-pi/pi-ai` instead. Add images directly to message content arrays.
521
+
522
+ **AgentSession API:**
523
+
524
+ - `branch(entryIndex: number)` → `branch(entryId: string)`
525
+ - `getUserMessagesForBranching()` returns `{ entryId, text }` instead of `{ entryIndex, text }`
526
+ - `reset()` → `newSession(options?)` where options has optional `parentSession` for lineage tracking
527
+ - `newSession()` and `switchSession()` now return `Promise<boolean>` (false if cancelled by hook)
528
+ - New `navigateTree(targetId, options?)` for in-place tree navigation
529
+
530
+ **Hook integration:**
531
+
532
+ - New `sendHookMessage(message, triggerTurn?)` for hook message injection
533
+
534
+ **SessionManager API:**
535
+
536
+ - Method renames: `saveXXX()` → `appendXXX()` (e.g., `appendMessage`, `appendCompaction`)
537
+ - `branchInPlace()` → `branch()`
538
+ - `reset()` → `newSession(options?)` with optional `parentSession` for lineage tracking
539
+ - `createBranchedSessionFromEntries(entries, index)` → `createBranchedSession(leafId)`
540
+ - `SessionHeader.branchedFrom` → `SessionHeader.parentSession`
541
+ - `saveCompaction(entry)` → `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?)`
542
+ - `getEntries()` now excludes the session header (use `getHeader()` separately)
543
+ - `getSessionFile()` returns `string | undefined` (undefined for in-memory sessions)
544
+ - New tree methods: `getTree()`, `getBranch()`, `getLeafId()`, `getLeafEntry()`, `getEntry()`, `getChildren()`, `getLabel()`
545
+ - New append methods: `appendCustomEntry()`, `appendCustomMessageEntry()`, `appendLabelChange()`
546
+ - New branch methods: `branch(entryId)`, `branchWithSummary()`
547
+
548
+ **ModelRegistry (new):**
549
+
550
+ `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`.
551
+
552
+ ```typescript
553
+ import { discoverAuthStorage, discoverModels } from "@oh-my-pi/pi-coding-agent";
554
+
555
+ const authStorage = discoverAuthStorage(); // ~/.omp/agent/auth.json
556
+ const modelRegistry = discoverModels(authStorage); // + ~/.omp/agent/models.json
557
+
558
+ // Get all models (built-in + custom)
559
+ const allModels = modelRegistry.getAll();
560
+
561
+ // Get only models with valid API keys
562
+ const available = await modelRegistry.getAvailable();
563
+
564
+ // Find specific model
565
+ const model = modelRegistry.find("anthropic", "claude-sonnet-4-20250514");
566
+
567
+ // Get API key for a model
568
+ const apiKey = await modelRegistry.getApiKey(model);
569
+ ```
570
+
571
+ This replaces the old `resolveApiKey` callback pattern. Hooks and custom tools access it via `ctx.modelRegistry`.
572
+
573
+ **Renamed exports:**
574
+
575
+ - `messageTransformer` → `convertToLlm`
576
+ - `SessionContext` alias `LoadedSession` removed
577
+
578
+ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/) for the current API.
579
+
580
+ ### RPC Migration
581
+
582
+ **Session commands:**
583
+
584
+ - `reset` command → `new_session` command with optional `parentSession` field
585
+
586
+ **Branching commands:**
587
+
588
+ - `branch` command: `entryIndex` → `entryId`
589
+ - `get_branch_messages` response: `entryIndex` → `entryId`
590
+
591
+ **Type changes:**
592
+
593
+ - Messages are now `AgentMessage` (was `AppMessage`)
594
+ - `prompt` command: `attachments` field replaced with `images` field using `ImageContent` format
595
+
596
+ **Compaction events:**
597
+
598
+ - `auto_compaction_start` now includes `reason` field (`"threshold"` or `"overflow"`)
599
+ - `auto_compaction_end` now includes `willRetry` field
600
+ - `compact` response includes full `CompactionResult` (`summary`, `firstKeptEntryId`, `tokensBefore`, `details`)
601
+
602
+ See [docs/rpc.md](docs/rpc.md) for the current protocol.
603
+
604
+ ### Structured Compaction
605
+
606
+ Compaction and branch summarization now use a structured output format:
607
+
608
+ - Clear sections: Goal, Progress, Key Information, File Operations
609
+ - File tracking: `readFiles` and `modifiedFiles` arrays in `details`, accumulated across compactions
610
+ - Conversations are serialized to text before summarization to prevent the model from "continuing" them
611
+
612
+ The `before_compact` and `before_tree` hook events allow custom compaction implementations. See [docs/compaction.md](docs/compaction.md).
613
+
614
+ ### Interactive Mode
615
+
616
+ **`/tree` command:**
617
+
618
+ - Navigate the full session tree in-place
619
+ - Search by typing, page with ←/→
620
+ - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
621
+ - Press `l` to label entries as bookmarks
622
+ - Selecting a branch switches context and optionally injects a summary of the abandoned branch
623
+
624
+ **Entry labels:**
625
+
626
+ - Bookmark any entry via `/tree` → select → `l`
627
+ - Labels appear in tree view and persist as `LabelEntry`
628
+
629
+ **Theme changes (breaking for custom themes):**
630
+
631
+ Custom themes must add these new color tokens or they will fail to load:
632
+
633
+ - `selectedBg`: background for selected/highlighted items in tree selector and other components
634
+ - `customMessageBg`: background for hook-injected messages (`CustomMessageEntry`)
635
+ - `customMessageText`: text color for hook messages
636
+ - `customMessageLabel`: label color for hook messages (the `[customType]` prefix)
637
+
638
+ Total color count increased from 46 to 50. See [docs/theme.md](docs/theme.md) for the full color list and copy values from the built-in dark/light themes.
639
+
640
+ **Settings:**
641
+
642
+ - `enabledModels`: allowlist models in `settings.json` (same format as `--models` CLI)
643
+
644
+ ### Added
645
+
646
+ - `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))
647
+ - `ctx.ui.theme` getter for styling status text and other output with theme colors
648
+ - `/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))
649
+ - HTML export now includes a tree visualization sidebar for navigating session branches ([#375](https://github.com/badlogic/pi-mono/issues/375))
650
+ - HTML export supports keyboard shortcuts: Ctrl+T to toggle thinking blocks, Ctrl+O to toggle tool outputs
651
+ - 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))
652
+ - HTML export syntax highlighting now uses theme colors and matches TUI rendering
653
+ - **Snake game example hook**: Demonstrates `ui.custom()`, `registerCommand()`, and session persistence. See [examples/hooks/snake.ts](examples/hooks/snake.ts).
654
+ - **`thinkingText` theme token**: Configurable color for thinking block text. ([#366](https://github.com/badlogic/pi-mono/pull/366) by [@paulbettner](https://github.com/paulbettner))
655
+
656
+ ### Changed
657
+
658
+ - **Entry IDs**: Session entries now use short 8-character hex IDs instead of full UUIDs
659
+ - **API key priority**: `ANTHROPIC_OAUTH_TOKEN` now takes precedence over `ANTHROPIC_API_KEY`
660
+ - HTML export template split into separate files (template.html, template.css, template.js) for easier maintenance
661
+
662
+ ### Fixed
663
+
664
+ - HTML export now properly sanitizes user messages containing HTML tags like `<style>` that could break DOM rendering
665
+ - 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))
666
+ - **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))
667
+ - **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))
668
+ - **Toggling thinking blocks during streaming shows nothing**: Pressing Ctrl+T while streaming would hide the current message until streaming completed.
669
+ - **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))
670
+ - **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))
671
+ - **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))
672
+ - **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))
673
+ - **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))
674
+ - **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))
675
+ - **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))
676
+ - **Session file validation**: `findMostRecentSession()` now validates session headers before returning, preventing non-session JSONL files from being loaded
677
+ - **Compaction error handling**: `generateSummary()` and `generateTurnPrefixSummary()` now throw on LLM errors instead of returning empty strings
678
+ - **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()`
679
+ - **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))
680
+
681
+ ## [0.30.2] - 2025-12-26
682
+
683
+ ### Changed
684
+
685
+ - **Consolidated migrations**: Moved auth migration from `AuthStorage.migrateLegacy()` to new `migrations.ts` module.
686
+
687
+ ## [0.30.1] - 2025-12-26
688
+
689
+ ### Fixed
690
+
691
+ - **Sessions saved to wrong directory**: In v0.30.0, sessions were being saved to `~/.omp/agent/` instead of `~/.omp/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))
692
+ - **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))
693
+
694
+ ## [0.30.0] - 2025-12-25
695
+
696
+ ### Breaking Changes
697
+
698
+ - **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 (`~/.omp/agent/sessions/<encoded-cwd>/`). `open()` no longer takes `agentDir`. ([#313](https://github.com/badlogic/pi-mono/pull/313))
699
+
700
+ ### Added
701
+
702
+ - **`--session-dir` flag**: Use a custom directory for sessions instead of the default `~/.omp/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))
703
+ - **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))
704
+
705
+ ## [0.29.1] - 2025-12-25
706
+
707
+ ### Added
708
+
709
+ - **Automatic custom system prompt loading**: OMP now auto-loads `SYSTEM.md` files to replace the default system prompt. Project-local `.omp/SYSTEM.md` takes precedence over global `~/.omp/agent/SYSTEM.md`. CLI `--system-prompt` flag overrides both. ([#309](https://github.com/badlogic/pi-mono/issues/309))
710
+ - **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))
711
+
712
+ ### Fixed
713
+
714
+ - **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))
715
+
716
+ ## [0.29.0] - 2025-12-25
717
+
718
+ ### Breaking Changes
719
+
720
+ - **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))
721
+
722
+ ### Added
723
+
724
+ - **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))
725
+ - **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))
726
+ - **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))
727
+
728
+ ### Fixed
729
+
730
+ - **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))
731
+
732
+ ## [0.28.0] - 2025-12-25
733
+
734
+ ### Changed
735
+
736
+ - **Credential storage refactored**: API keys and OAuth tokens are now stored in `~/.omp/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))
737
+
738
+ - **SDK API changes** ([#296](https://github.com/badlogic/pi-mono/issues/296)):
739
+
740
+ - Added `AuthStorage` class for credential management (API keys and OAuth tokens)
741
+ - Added `ModelRegistry` class for model discovery and API key resolution
742
+ - Added `discoverAuthStorage()` and `discoverModels()` discovery functions
743
+ - `createAgentSession()` now accepts `authStorage` and `modelRegistry` options
744
+ - Removed `configureOAuthStorage()`, `defaultGetApiKey()`, `findModel()`, `discoverAvailableModels()`
745
+ - Removed `getApiKey` callback option (use `AuthStorage.setRuntimeApiKey()` for runtime overrides)
746
+ - Use `getModel()` from `@oh-my-pi/pi-ai` for built-in models, `modelRegistry.find()` for custom models + built-in models
747
+ - See updated [SDK documentation](docs/sdk.md) and [README](README.md)
748
+
749
+ - **Settings changes**: Removed `apiKeys` from `settings.json`. Use `auth.json` instead. ([#296](https://github.com/badlogic/pi-mono/issues/296))
750
+
751
+ ### Fixed
752
+
753
+ - **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))
754
+
755
+ ## [0.27.9] - 2025-12-24
756
+
757
+ ### Fixed
758
+
759
+ - **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))
760
+
761
+ ## [0.27.8] - 2025-12-24
762
+
763
+ ### Fixed
764
+
765
+ - **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.
766
+
767
+ ## [0.27.7] - 2025-12-24
768
+
769
+ ### Fixed
770
+
771
+ - **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))
772
+
773
+ ## [0.27.6] - 2025-12-24
774
+
775
+ ### Added
776
+
777
+ - **Compaction hook improvements**: The `before_compact` session event now includes:
778
+
779
+ - `previousSummary`: Summary from the last compaction (if any), so hooks can preserve accumulated context
780
+ - `messagesToKeep`: Messages that will be kept after the summary (recent turns), in addition to `messagesToSummarize`
781
+ - `resolveApiKey`: Function to resolve API keys for any model (checks settings, OAuth, env vars)
782
+ - Removed `apiKey` string in favor of `resolveApiKey` for more flexibility
783
+
784
+ - **SessionManager API cleanup**:
785
+ - Renamed `loadSessionFromEntries()` to `buildSessionContext()` (builds LLM context from entries, handling compaction)
786
+ - Renamed `loadEntries()` to `getEntries()` (returns defensive copy of all session entries)
787
+ - Added `buildSessionContext()` method to SessionManager
788
+
789
+ ## [0.27.5] - 2025-12-24
790
+
791
+ ### Added
792
+
793
+ - **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.
794
+ - **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))
795
+
796
+ ### Fixed
797
+
798
+ - **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))
799
+
800
+ ## [0.27.4] - 2025-12-24
801
+
802
+ ### Fixed
803
+
804
+ - **Symlinked skill directories**: Skills in symlinked directories (e.g., `~/.omp/agent/skills/my-skills -> /path/to/skills`) are now correctly discovered and loaded.
805
+
806
+ ## [0.27.3] - 2025-12-24
807
+
808
+ ### Added
809
+
810
+ - **API keys in settings.json**: Store API keys in `~/.omp/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))
811
+
812
+ ### Fixed
813
+
814
+ - **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))
815
+ - **`--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))
816
+
817
+ ## [0.27.2] - 2025-12-23
818
+
819
+ ### Added
820
+
821
+ - **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))
822
+
823
+ ## [0.27.1] - 2025-12-22
824
+
825
+ ### Fixed
826
+
827
+ - **Skill discovery performance**: Skip `node_modules` directories when recursively scanning for skills. Fixes ~60ms startup delay when skill directories contain npm dependencies.
828
+
829
+ ### Added
830
+
831
+ - **Startup timing instrumentation**: Set `OMP_TIMING=1` to see startup performance breakdown (interactive mode only).
832
+
833
+ ## [0.27.0] - 2025-12-22
834
+
835
+ ### Breaking
836
+
837
+ - **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))
838
+
839
+ ### Added
840
+
841
+ - **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))
842
+
843
+ ### Fixed
844
+
845
+ - **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))
846
+
847
+ - **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))
848
+
849
+ ## [0.26.1] - 2025-12-22
850
+
851
+ ### Fixed
852
+
853
+ - **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))
854
+
855
+ ## [0.26.0] - 2025-12-22
856
+
857
+ ### Added
858
+
859
+ - **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))
860
+
861
+ - **Project-specific settings**: Settings now load from both `~/.omp/agent/settings.json` (global) and `<cwd>/.omp/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))
862
+
863
+ - **SettingsManager static factories**: `SettingsManager.create(cwd?, agentDir?)` for file-based settings, `SettingsManager.inMemory(settings?)` for testing. Added `applyOverrides()` for programmatic overrides.
864
+
865
+ - **SessionManager static factories**: `SessionManager.create()`, `SessionManager.open()`, `SessionManager.continueRecent()`, `SessionManager.inMemory()`, `SessionManager.list()` for flexible session management.
866
+
867
+ ## [0.25.4] - 2025-12-22
868
+
869
+ ### Fixed
870
+
871
+ - **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))
872
+
873
+ ## [0.25.3] - 2025-12-21
874
+
875
+ ### Added
876
+
877
+ - **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))
878
+
879
+ - **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))
880
+
881
+ - **Process suspension**: Press `Ctrl+Z` to suspend omp 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))
882
+
883
+ - **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))
884
+
885
+ - **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))
886
+
887
+ ## [0.25.2] - 2025-12-21
888
+
889
+ ### Fixed
890
+
891
+ - **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.
892
+
893
+ ## [0.25.1] - 2025-12-21
894
+
895
+ ### Fixed
896
+
897
+ - **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.
898
+
899
+ - **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.
900
+
901
+ ## [0.25.0] - 2025-12-20
902
+
903
+ ### Added
904
+
905
+ - **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))
906
+
907
+ - **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.
908
+
909
+ - **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.
910
+
911
+ ### Changed
912
+
913
+ - **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))
914
+
915
+ ### Fixed
916
+
917
+ - **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))
918
+
919
+ - **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))
920
+
921
+ - **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.
922
+
923
+ ## [0.24.5] - 2025-12-20
924
+
925
+ ### Fixed
926
+
927
+ - **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.
928
+
929
+ ## [0.24.4] - 2025-12-20
930
+
931
+ ### Fixed
932
+
933
+ - **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))
934
+
935
+ ## [0.24.3] - 2025-12-19
936
+
937
+ ### Fixed
938
+
939
+ - **Footer overflow on narrow terminals**: Fixed footer path display exceeding terminal width when resizing to very narrow widths, causing rendering crashes. /arminsayshi
940
+
941
+ ## [0.24.2] - 2025-12-20
942
+
943
+ ### Fixed
944
+
945
+ - **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))
946
+
947
+ ## [0.24.1] - 2025-12-19
948
+
949
+ ### Added
950
+
951
+ - **OAuth and model config exports**: Scripts using `AgentSession` directly can now import `getAvailableModels`, `getApiKeyForModel`, `findModel`, `login`, `logout`, and `getOAuthProviders` from `@oh-my-pi/pi-coding-agent` to reuse OAuth token storage and model resolution. ([#245](https://github.com/badlogic/pi-mono/issues/245))
952
+
953
+ - **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))
954
+
955
+ ### Fixed
956
+
957
+ - **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))
958
+
959
+ - **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))
960
+
961
+ - **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))
962
+
963
+ - **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))
964
+
965
+ - **Global AGENTS.md loaded twice**: Fixed global AGENTS.md being loaded twice when present in both `~/.omp/agent/` and the current directory. ([#239](https://github.com/badlogic/pi-mono/pull/239) by [@aliou](https://github.com/aliou))
966
+
967
+ - **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))
968
+
969
+ - **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))
970
+
971
+ ## [0.24.0] - 2025-12-19
972
+
973
+ ### Added
974
+
975
+ - **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))
976
+
977
+ - **`getMarkdownTheme()` export**: Custom tools can now import `getMarkdownTheme()` from `@oh-my-pi/pi-coding-agent` to use the same markdown styling as the main UI.
978
+
979
+ - **`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.
980
+
981
+ - **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))
982
+
983
+ - **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))
984
+
985
+ - **`/hotkeys` command**: Shows all keyboard shortcuts in a formatted table.
986
+
987
+ - **Markdown table borders**: Tables now render with proper top and bottom borders.
988
+
989
+ ### Changed
990
+
991
+ - **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.
992
+
993
+ - **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))
994
+
995
+ ### Fixed
996
+
997
+ - **JSON mode stdout flush**: Fixed race condition where `omp --mode json` could exit before all output was written to stdout, causing consumers to miss final events.
998
+
999
+ - **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))
1000
+
1001
+ ### Breaking Changes
1002
+
1003
+ - **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 `~/.omp/agent/tools/mytool.ts` must become `~/.omp/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.
1004
+
1005
+ - **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))
1006
+ - Removed: `result: string` field
1007
+ - Added: `content: (TextContent | ImageContent)[]` - full content array
1008
+ - Added: `details: unknown` - tool-specific details (typed per tool via discriminated union on `toolName`)
1009
+ - `ToolResultEventResult.result` renamed to `ToolResultEventResult.text` (removed), use `content` instead
1010
+ - Hook handlers returning `{ result: "..." }` must change to `{ content: [{ type: "text", text: "..." }] }`
1011
+ - Built-in tool details types exported: `BashToolDetails`, `ReadToolDetails`, `GrepToolDetails`, `FindToolDetails`, `LsToolDetails`, `TruncationResult`
1012
+ - Type guards exported for narrowing: `isBashToolResult`, `isReadToolResult`, `isEditToolResult`, `isWriteToolResult`, `isGrepToolResult`, `isFindToolResult`, `isLsToolResult`
1013
+
1014
+ ## [0.23.4] - 2025-12-18
1015
+
1016
+ ### Added
1017
+
1018
+ - **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))
1019
+
1020
+ - **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.
1021
+
1022
+ ### Fixed
1023
+
1024
+ - **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))
1025
+
1026
+ - **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))
1027
+
1028
+ - **Google provider FinishReason**: Added handling for new `IMAGE_RECITATION` and `IMAGE_OTHER` finish reasons. Upgraded @google/genai to 1.34.0.
1029
+
1030
+ ## [0.23.3] - 2025-12-17
1031
+
1032
+ ### Fixed
1033
+
1034
+ - 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.
1035
+
1036
+ ### Changed
1037
+
1038
+ - Improved system prompt documentation section with clearer pointers to specific doc files for custom models, themes, skills, hooks, custom tools, and RPC.
1039
+
1040
+ - Cleaned up documentation:
1041
+
1042
+ - `theme.md`: Added missing color tokens (`thinkingXhigh`, `bashMode`)
1043
+ - `skills.md`: Rewrote with better framing and examples
1044
+ - `hooks.md`: Fixed timeout/error handling docs, added import aliases section
1045
+ - `custom-tools.md`: Added intro with use cases and comparison table
1046
+ - `rpc.md`: Added missing `hook_error` event documentation
1047
+ - `README.md`: Complete settings table, condensed philosophy section, standardized OAuth docs
1048
+
1049
+ - Hooks loader now supports same import aliases as custom tools (`@sinclair/typebox`, `@oh-my-pi/pi-ai`, `@oh-my-pi/pi-tui`, `@oh-my-pi/pi-coding-agent`).
1050
+
1051
+ ### Breaking Changes
1052
+
1053
+ - **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.
1054
+
1055
+ ## [0.23.2] - 2025-12-17
1056
+
1057
+ ### Fixed
1058
+
1059
+ - 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))
1060
+
1061
+ - Detect image MIME type via file magic (read tool and `@file` attachments), not filename extension.
1062
+
1063
+ - 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))
1064
+
1065
+ ## [0.23.1] - 2025-12-17
1066
+
1067
+ ### Fixed
1068
+
1069
+ - 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.
1070
+
1071
+ - Fixed custom tools failing to load from `~/.omp/agent/tools/` when omp is installed globally. Module imports (`@sinclair/typebox`, `@oh-my-pi/pi-tui`, `@oh-my-pi/pi-ai`) are now resolved via aliases.
1072
+
1073
+ ## [0.23.0] - 2025-12-17
1074
+
1075
+ ### Added
1076
+
1077
+ - **Custom tools**: Extend omp with custom tools written in TypeScript. Tools can provide custom TUI rendering, interact with users via `omp.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))
1078
+
1079
+ - **Hook and tool examples**: Added `examples/hooks/` and `examples/custom-tools/` with working examples. Examples are now bundled in npm and binary releases.
1080
+
1081
+ ### Breaking Changes
1082
+
1083
+ - **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.
1084
+
1085
+ ## [0.22.5] - 2025-12-17
1086
+
1087
+ ### Fixed
1088
+
1089
+ - Fixed `--session` flag not saving sessions in print mode (`-p`). The session manager was never receiving events because no subscriber was attached.
1090
+
1091
+ ## [0.22.4] - 2025-12-17
1092
+
1093
+ ### Added
1094
+
1095
+ - `--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))
1096
+
1097
+ ### Fixed
1098
+
1099
+ - Fixed tool execution showing green (success) background while still running. Now correctly shows gray (pending) background until the tool completes.
1100
+
1101
+ ## [0.22.3] - 2025-12-16
1102
+
1103
+ ### Added
1104
+
1105
+ - **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))
1106
+
1107
+ ### Changed
1108
+
1109
+ - **Tool output display**: When collapsed, tool output now shows the last N lines instead of the first N lines, making streaming output more useful.
1110
+
1111
+ - Updated `@oh-my-pi/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))
1112
+
1113
+ ### Fixed
1114
+
1115
+ - 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))
1116
+ - 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.
1117
+ - `/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))
1118
+
1119
+ ## [0.22.2] - 2025-12-15
1120
+
1121
+ ### Changed
1122
+
1123
+ - Updated `@oh-my-pi/pi-ai` with interleaved thinking enabled by default for Anthropic Claude 4 models.
1124
+
1125
+ ## [0.22.1] - 2025-12-15
1126
+
1127
+ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
1128
+
1129
+ ### Changed
1130
+
1131
+ - Updated `@oh-my-pi/pi-ai` with interleaved thinking support for Anthropic models.
1132
+
1133
+ ## [0.22.0] - 2025-12-15
1134
+
1135
+ ### Added
1136
+
1137
+ - **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))
1138
+
1139
+ ### Fixed
1140
+
1141
+ - Model selector fuzzy search now matches against provider name (not just model ID) and supports space-separated tokens where all tokens must match
1142
+
1143
+ ## [0.21.0] - 2025-12-14
1144
+
1145
+ ### Added
1146
+
1147
+ - **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))
1148
+
1149
+ - **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))
1150
+
1151
+ ### Fixed
1152
+
1153
+ - 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))
1154
+
1155
+ - Fixed double blank lines rendering after markdown code blocks ([#173](https://github.com/badlogic/pi-mono/pull/173) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1156
+
1157
+ ## [0.20.1] - 2025-12-13
1158
+
1159
+ ### Added
1160
+
1161
+ - **Exported skills API**: `loadSkillsFromDir`, `formatSkillsForPrompt`, and related types are now exported for use by other packages (e.g., mom).
1162
+
1163
+ ## [0.20.0] - 2025-12-13
1164
+
1165
+ ### Breaking Changes
1166
+
1167
+ - **OMP skills now use `SKILL.md` convention**: OMP 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 `~/.omp/agent/skills/foo.md` to `~/.omp/agent/skills/foo/SKILL.md`.
1168
+
1169
+ ### Added
1170
+
1171
+ - Display loaded skills on startup in interactive mode
1172
+
1173
+ ## [0.19.1] - 2025-12-12
1174
+
1175
+ ### Fixed
1176
+
1177
+ - Documentation: Added skills system documentation to README (setup, usage, CLI flags, settings)
1178
+
1179
+ ## [0.19.0] - 2025-12-12
1180
+
1181
+ ### Added
1182
+
1183
+ - **Skills system**: Auto-discover and load instruction files on-demand. Supports Claude Code (`~/.claude/skills/*/SKILL.md`), Codex CLI (`~/.codex/skills/`), and OMP-native formats (`~/.omp/agent/skills/`, `.omp/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))
1184
+
1185
+ - **Version flag**: Added `--version` / `-v` flag to display the current version and exit. ([#170](https://github.com/badlogic/pi-mono/pull/170))
1186
+
1187
+ ## [0.18.2] - 2025-12-11
1188
+
1189
+ ### Added
1190
+
1191
+ - **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))
1192
+
1193
+ - **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))
1194
+
1195
+ ### Fixed
1196
+
1197
+ - **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))
1198
+
1199
+ - **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.
1200
+
1201
+ - **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 omp from a subdirectory of a repository. ([#156](https://github.com/badlogic/pi-mono/issues/156))
1202
+
1203
+ ## [0.18.1] - 2025-12-10
1204
+
1205
+ ### Added
1206
+
1207
+ - **Mistral provider**: Added support for Mistral AI models. Set `MISTRAL_API_KEY` environment variable to use.
1208
+
1209
+ ### Fixed
1210
+
1211
+ - 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))
1212
+
1213
+ ## [0.18.0] - 2025-12-10
1214
+
1215
+ ### Added
1216
+
1217
+ - **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 `~/.omp/agent/hooks/*.ts` and `.omp/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))
1218
+
1219
+ - **`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.
1220
+
1221
+ - **`--hook <path>` CLI flag**: Load hook files directly for testing without modifying settings.
1222
+
1223
+ - **Hook events**: `session_start`, `session_switch`, `agent_start`, `agent_end`, `turn_start`, `turn_end`, `tool_call` (can block), `tool_result` (can modify), `branch`.
1224
+
1225
+ - **Hook UI primitives**: `ctx.ui.select()`, `ctx.ui.confirm()`, `ctx.ui.input()`, `ctx.ui.notify()` for interactive prompts from hooks.
1226
+
1227
+ - **Hooks documentation**: Full API reference at `docs/hooks.md`, shipped with npm package.
1228
+
1229
+ ## [0.17.0] - 2025-12-09
1230
+
1231
+ ### Changed
1232
+
1233
+ - **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.
1234
+
1235
+ - **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.
1236
+
1237
+ - **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.
1238
+
1239
+ ### Added
1240
+
1241
+ - **`isCompacting` property on AgentSession**: Check if auto-compaction is currently running.
1242
+
1243
+ - **Session compaction indicator**: When resuming a compacted session, displays "Session compacted N times" status message.
1244
+
1245
+ ### Fixed
1246
+
1247
+ - **Block input during compaction**: User input is now blocked while auto-compaction is running to prevent race conditions.
1248
+
1249
+ - **Skip error messages in usage calculation**: Context size estimation now skips both aborted and error messages, as neither have valid usage data.
1250
+
1251
+ ## [0.16.0] - 2025-12-09
1252
+
1253
+ ### Breaking Changes
1254
+
1255
+ - **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))
1256
+
1257
+ ### Changed
1258
+
1259
+ - **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.
1260
+
1261
+ ## [0.15.0] - 2025-12-09
1262
+
1263
+ ### Changed
1264
+
1265
+ - **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))
1266
+
1267
+ ## [0.14.2] - 2025-12-08
1268
+
1269
+ ### Added
1270
+
1271
+ - `/debug` command now includes agent messages as JSONL in the output
1272
+
1273
+ ### Fixed
1274
+
1275
+ - Fix crash when bash command outputs binary data (e.g., `curl` downloading a video file)
1276
+
1277
+ ## [0.14.1] - 2025-12-08
1278
+
1279
+ ### Fixed
1280
+
1281
+ - Fix build errors with tsgo 7.0.0-dev.20251208.1 by properly importing `ReasoningEffort` type
1282
+
1283
+ ## [0.14.0] - 2025-12-08
1284
+
1285
+ ### Breaking Changes
1286
+
1287
+ - **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.
1288
+
1289
+ ### Added
1290
+
1291
+ - **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)
1292
+
1293
+ - **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))
1294
+
1295
+ - **Collapse changelog setting**: Add `"collapseChangelog": true` to `~/.omp/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))
1296
+
1297
+ - **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))
1298
+
1299
+ ## [0.13.2] - 2025-12-07
1300
+
1301
+ ### Changed
1302
+
1303
+ - **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))
1304
+ - **Limits**: 2000 lines OR 50KB (whichever hits first), never partial lines
1305
+ - **read**: Shows `[Showing lines X-Y of Z. Use offset=N to continue]`. If first line exceeds 50KB, suggests bash command
1306
+ - **bash**: Tail truncation with temp file. Shows `[Showing lines X-Y of Z. Full output: /tmp/...]`
1307
+ - **grep**: Pre-truncates match lines to 500 chars. Shows match limit and line truncation notices
1308
+ - **find/ls**: Shows result/entry limit notices
1309
+ - TUI displays truncation warnings in yellow at bottom of tool output (visible even when collapsed)
1310
+
1311
+ ## [0.13.1] - 2025-12-06
1312
+
1313
+ ### Added
1314
+
1315
+ - **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 `~/.omp/agent/settings.json`: `{"shellPath": "C:\\cygwin64\\bin\\bash.exe"}`.
1316
+
1317
+ ### Fixed
1318
+
1319
+ - **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.
1320
+
1321
+ ## [0.12.15] - 2025-12-06
1322
+
1323
+ ### Fixed
1324
+
1325
+ - **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.
1326
+
1327
+ ## [0.12.14] - 2025-12-06
1328
+
1329
+ ### Added
1330
+
1331
+ - **Double-Escape Branch Shortcut**: Press Escape twice with an empty editor to quickly open the `/branch` selector for conversation branching.
1332
+
1333
+ ## [0.12.13] - 2025-12-05
1334
+
1335
+ ### Changed
1336
+
1337
+ - **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.
1338
+
1339
+ ## [0.12.12] - 2025-12-05
1340
+
1341
+ ### Changed
1342
+
1343
+ - **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`.
1344
+
1345
+ ### Fixed
1346
+
1347
+ - **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))
1348
+ - **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))
1349
+
1350
+ ### Added
1351
+
1352
+ - **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))
1353
+ - **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))
1354
+ - **`/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))
1355
+
1356
+ ## [0.12.11] - 2025-12-05
1357
+
1358
+ ### Changed
1359
+
1360
+ - **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))
1361
+
1362
+ ### Fixed
1363
+
1364
+ - **Print mode error handling**: `-p` flag now outputs error messages and exits with code 1 when requests fail, instead of silently producing no output.
1365
+ - **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`.
1366
+ - **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.
1367
+ - **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.
1368
+
1369
+ ### Added
1370
+
1371
+ - **`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))
1372
+ - **`--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))
1373
+ - **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))
1374
+
1375
+ ## [0.12.10] - 2025-12-04
1376
+
1377
+ ### Added
1378
+
1379
+ - Added `gpt-5.1-codex-max` model support
1380
+
1381
+ ## [0.12.9] - 2025-12-04
1382
+
1383
+ ### Added
1384
+
1385
+ - **`/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))
1386
+
1387
+ ## [0.12.8] - 2025-12-04
1388
+
1389
+ - Fix: Use CTRL+O consistently for compaction expand shortcut (not CMD+O on Mac)
1390
+
1391
+ ## [0.12.7] - 2025-12-04
1392
+
1393
+ ### Added
1394
+
1395
+ - **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))
1396
+ - `/compact [instructions]`: Manually compact context with optional custom instructions for the summary
1397
+ - `/autocompact`: Toggle automatic compaction when context exceeds threshold
1398
+ - Compaction summarizes older messages while keeping recent messages (default 20k tokens) verbatim
1399
+ - Auto-compaction triggers when context reaches `contextWindow - reserveTokens` (default 16k reserve)
1400
+ - Compacted sessions show a collapsible summary in the TUI (toggle with `o` key)
1401
+ - HTML exports include compaction summaries as collapsible sections
1402
+ - RPC mode supports `{"type":"compact"}` command and auto-compaction (emits compaction events)
1403
+ - **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.
1404
+
1405
+ ## [0.12.5] - 2025-12-03
1406
+
1407
+ ### Added
1408
+
1409
+ - **Forking/Rebranding Support**: All branding (app name, config directory, environment variable names) is now configurable via `ompConfig` in `package.json`. Forks can change `ompConfig.name` and `ompConfig.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))
1410
+
1411
+ ### Fixed
1412
+
1413
+ - **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))
1414
+
1415
+ ## [0.12.4] - 2025-12-02
1416
+
1417
+ ### Added
1418
+
1419
+ - **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.
1420
+
1421
+ ## [0.12.3] - 2025-12-02
1422
+
1423
+ ### Fixed
1424
+
1425
+ - **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.
1426
+ - **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.
1427
+
1428
+ ## [0.12.2] - 2025-12-02
1429
+
1430
+ ### Changed
1431
+
1432
+ - Removed support for gpt-4.5-preview and o3 models (not yet available)
1433
+
1434
+ ## [0.12.1] - 2025-12-02
1435
+
1436
+ ### Added
1437
+
1438
+ - **Models**: Added support for OpenAI's new models:
1439
+ - `gpt-4.1` (128K context)
1440
+ - `gpt-4.1-mini` (128K context)
1441
+ - `gpt-4.1-nano` (128K context)
1442
+ - `o3` (200K context, reasoning model)
1443
+ - `o4-mini` (200K context, reasoning model)
1444
+
1445
+ ## [0.12.0] - 2025-12-02
1446
+
1447
+ ### Added
1448
+
1449
+ - **`-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.
1450
+ - **`-P, --print-streaming` Flag**: Like `-p`, but streams response tokens as they arrive. Use `--print-streaming --no-markdown` for raw unformatted output.
1451
+ - **`--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.
1452
+ - **`--no-markdown` Flag**: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
1453
+ - **Streaming Print Mode**: Added internal `printStreaming` option for streaming output in non-TUI mode.
1454
+ - **RPC Mode `print` Command**: Send `{"type":"print","content":"text"}` to get formatted print output via `print_output` events.
1455
+ - **Auto-Save in Print Mode**: Print mode conversations are automatically saved to the session directory, allowing later resumption with `--continue`.
1456
+ - **Thinking level options**: Added `--thinking-off`, `--thinking-minimal`, `--thinking-low`, `--thinking-medium`, `--thinking-high` flags for directly specifying thinking level without the selector UI.
1457
+
1458
+ ### Changed
1459
+
1460
+ - **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.
1461
+ - **RPC Message Handling**: Agent now processes raw message objects directly, with `timestamp` auto-populated if missing.
1462
+
1463
+ ## [0.11.9] - 2025-12-02
1464
+
1465
+ ### Changed
1466
+
1467
+ - Change Ctrl+I to Ctrl+P for model cycling shortcut to avoid collision with Tab key in some terminals
1468
+
1469
+ ## [0.11.8] - 2025-12-01
1470
+
1471
+ ### Fixed
1472
+
1473
+ - 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.
1474
+
1475
+ ## [0.11.7] - 2025-12-01
1476
+
1477
+ ### Fixed
1478
+
1479
+ - 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.
1480
+
1481
+ ## [0.11.6] - 2025-12-01
1482
+
1483
+ ### Fixed
1484
+
1485
+ - Fix `--system-prompt <path>` allowing the path argument to be captured by the message collection, causing "file not found" errors.
1486
+
1487
+ ## [0.11.5] - 2025-11-30
1488
+
1489
+ ### Fixed
1490
+
1491
+ - Fixed fatal error "Cannot set properties of undefined (setting '0')" when editing empty files in the `edit` tool.
1492
+ - Simplified `edit` tool output: Shows only "Edited file.txt" for successful edits instead of verbose search/replace details.
1493
+ - Fixed fatal error in footer rendering when token counts contain NaN values due to missing usage data.
1494
+
1495
+ ## [0.11.4] - 2025-11-30
1496
+
1497
+ ### Fixed
1498
+
1499
+ - 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.
1500
+
1501
+ ## [0.11.3] - 2025-11-29
1502
+
1503
+ ### Fixed
1504
+
1505
+ - Fix file drop functionality for absolute paths
1506
+
1507
+ ## [0.11.2] - 2025-11-29
1508
+
1509
+ ### Fixed
1510
+
1511
+ - Fixed TUI crash when pasting content containing tab characters. Tabs are now converted to 4 spaces before insertion.
1512
+ - 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.
1513
+
1514
+ ## [0.11.1] - 2025-11-29
1515
+
1516
+ ### Added
1517
+
1518
+ - Added `fd` integration for file path autocompletion. Now uses `fd` for faster fuzzy file search
1519
+
1520
+ ### Fixed
1521
+
1522
+ - 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
1523
+
1524
+ ## [0.11.0] - 2025-11-29
1525
+
1526
+ ### Added
1527
+
1528
+ - **File-based Slash Commands**: Create custom reusable prompts as `.txt` files in `~/.omp/slash-commands/`. Files become `/filename` commands with first-line descriptions. Supports `{{selection}}` placeholder for referencing selected/attached content.
1529
+ - **`/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.
1530
+ - **Unified Content References**: Both `@path` in messages and `--file path` CLI arguments now use the same attachment system with consistent MIME type detection.
1531
+ - **Drag & Drop Files**: Drop files onto the terminal to attach them to your message. Supports multiple files and both text and image content.
1532
+
1533
+ ### Changed
1534
+
1535
+ - **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.
1536
+ - **Improved File Autocomplete**: File path completion after `@` now supports fuzzy matching and shows file/directory indicators.
1537
+ - **Session Selector with Search**: The `--resume` and `--session` flags now open a searchable session list with fuzzy filtering.
1538
+ - **Attachment Display**: Files added via `@path` are now shown as "Attached: filename" in the user message, separate from the prompt text.
1539
+ - **Tab Completion**: Tab key now triggers file path autocompletion anywhere in the editor, not just after `@` symbol.
1540
+
1541
+ ### Fixed
1542
+
1543
+ - Fixed autocomplete z-order issue where dropdown could appear behind chat messages
1544
+ - Fixed cursor position when navigating through wrapped lines in the editor
1545
+ - Fixed attachment handling for continued sessions to preserve file references
1546
+
1547
+ ## [0.10.6] - 2025-11-28
1548
+
1549
+ ### Changed
1550
+
1551
+ - Show base64-truncated indicator for large images in tool output
1552
+
1553
+ ### Fixed
1554
+
1555
+ - Fixed image dimensions not being read correctly from PNG/JPEG/GIF files
1556
+ - Fixed PDF images being incorrectly base64-truncated in display
1557
+ - Allow reading files from ancestor directories (needed for monorepo configs)
1558
+
1559
+ ## [0.10.5] - 2025-11-28
1560
+
1561
+ ### Added
1562
+
1563
+ - Full multimodal support: attach images (PNG, JPEG, GIF, WebP) and PDFs to prompts using `@path` syntax or `--file` flag
1564
+
1565
+ ### Fixed
1566
+
1567
+ - `@`-references now handle special characters in file names (spaces, quotes, unicode)
1568
+ - Fixed cursor positioning issues with multi-byte unicode characters in editor
1569
+
1570
+ ## [0.10.4] - 2025-11-28
1571
+
1572
+ ### Fixed
1573
+
1574
+ - Removed padding on first user message in TUI to improve visual consistency.
1575
+
1576
+ ## [0.10.3] - 2025-11-28
1577
+
1578
+ ### Added
1579
+
1580
+ - 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.
1581
+
1582
+ ### Changed
1583
+
1584
+ - Refactored internal architecture to support multiple frontends (TUI, RPC) with shared agent logic.
1585
+
1586
+ ## [0.10.2] - 2025-11-26
1587
+
1588
+ ### Added
1589
+
1590
+ - Added thinking level persistence. Default level stored in `~/.omp/settings.json`, restored on startup. Per-session overrides saved in session files.
1591
+ - Added model cycling shortcut: `Ctrl+I` cycles through available models (or scoped models with `-m` flag).
1592
+ - Added automatic retry with exponential backoff for transient API errors (network issues, 500s, overload).
1593
+ - Cumulative token usage now shown in footer (total tokens used across all messages in session).
1594
+ - Added `--system-prompt` flag to override default system prompt with custom text or file contents.
1595
+ - Footer now shows estimated total cost in USD based on model pricing.
1596
+
1597
+ ### Changed
1598
+
1599
+ - 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.
1600
+ - Thinking level border now persists visually after selector closes.
1601
+ - Improved tool result display with collapsible output (default collapsed, expand with `Ctrl+O`).
1602
+
1603
+ ## [0.10.1] - 2025-11-25
1604
+
1605
+ ### Added
1606
+
1607
+ - Add custom model configuration via `~/.omp/models.json`
1608
+
1609
+ ## [0.10.0] - 2025-11-25
1610
+
1611
+ Initial public release.
1612
+
1613
+ ### Added
1614
+
1615
+ - Interactive TUI with streaming responses
1616
+ - Conversation session management with `--continue`, `--resume`, and `--session` flags
1617
+ - Multi-line input support (Shift+Enter or Option+Enter for new lines)
1618
+ - Tool execution: `read`, `write`, `edit`, `bash`, `glob`, `grep`, `think`
1619
+ - Thinking mode support for Claude with visual indicator and `/thinking` selector
1620
+ - File path autocompletion with `@` prefix
1621
+ - Slash command autocompletion
1622
+ - `/export` command for HTML session export
1623
+ - `/model` command for runtime model switching
1624
+ - `/session` command for session statistics
1625
+ - Model provider support: Anthropic (Claude), OpenAI, Google (Gemini)
1626
+ - Git branch display in footer
1627
+ - Message queueing during streaming responses
1628
+ - OAuth integration for Gmail and Google Calendar access
1629
+ - HTML export with syntax highlighting and collapsible sections