@oh-my-pi/pi-coding-agent 8.1.0 → 8.2.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 (402) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/docs/session.md +111 -46
  3. package/examples/custom-tools/hello/index.ts +1 -1
  4. package/examples/custom-tools/todo/index.ts +3 -4
  5. package/examples/extensions/api-demo.ts +0 -1
  6. package/examples/extensions/chalk-logger.ts +2 -3
  7. package/examples/extensions/hello.ts +0 -1
  8. package/examples/extensions/pirate.ts +0 -1
  9. package/examples/extensions/plan-mode.ts +15 -16
  10. package/examples/extensions/todo.ts +3 -4
  11. package/examples/extensions/tools.ts +1 -2
  12. package/examples/extensions/with-deps/index.ts +0 -1
  13. package/examples/hooks/auto-commit-on-exit.ts +1 -2
  14. package/examples/hooks/confirm-destructive.ts +0 -1
  15. package/examples/hooks/custom-compaction.ts +1 -2
  16. package/examples/hooks/dirty-repo-guard.ts +0 -1
  17. package/examples/hooks/file-trigger.ts +3 -4
  18. package/examples/hooks/git-checkpoint.ts +0 -1
  19. package/examples/hooks/handoff.ts +3 -4
  20. package/examples/hooks/permission-gate.ts +1 -2
  21. package/examples/hooks/protected-paths.ts +1 -2
  22. package/examples/hooks/qna.ts +2 -3
  23. package/examples/hooks/snake.ts +4 -5
  24. package/examples/hooks/status-line.ts +0 -1
  25. package/examples/sdk/01-minimal.ts +2 -3
  26. package/examples/sdk/02-custom-model.ts +2 -3
  27. package/examples/sdk/03-custom-prompt.ts +3 -4
  28. package/examples/sdk/04-skills.ts +2 -3
  29. package/examples/sdk/06-extensions.ts +1 -2
  30. package/examples/sdk/06-hooks.ts +6 -7
  31. package/examples/sdk/07-context-files.ts +0 -1
  32. package/examples/sdk/08-prompt-templates.ts +0 -1
  33. package/examples/sdk/08-slash-commands.ts +0 -1
  34. package/examples/sdk/09-api-keys-and-oauth.ts +0 -1
  35. package/examples/sdk/10-settings.ts +0 -1
  36. package/examples/sdk/11-sessions.ts +0 -1
  37. package/package.json +51 -23
  38. package/scripts/format-prompts.ts +0 -1
  39. package/src/capability/context-file.ts +2 -3
  40. package/src/capability/extension-module.ts +2 -3
  41. package/src/capability/extension.ts +2 -3
  42. package/src/capability/fs.ts +20 -21
  43. package/src/capability/hook.ts +2 -3
  44. package/src/capability/index.ts +15 -16
  45. package/src/capability/instruction.ts +2 -3
  46. package/src/capability/mcp.ts +2 -3
  47. package/src/capability/prompt.ts +2 -3
  48. package/src/capability/rule.ts +2 -3
  49. package/src/capability/settings.ts +1 -2
  50. package/src/capability/skill.ts +2 -3
  51. package/src/capability/slash-command.ts +2 -3
  52. package/src/capability/ssh.ts +2 -3
  53. package/src/capability/system-prompt.ts +2 -3
  54. package/src/capability/tool.ts +2 -3
  55. package/src/cli/args.ts +5 -6
  56. package/src/cli/config-cli.ts +6 -7
  57. package/src/cli/file-processor.ts +19 -17
  58. package/src/cli/jupyter-cli.ts +105 -0
  59. package/src/cli/list-models.ts +10 -11
  60. package/src/cli/plugin-cli.ts +20 -21
  61. package/src/cli/session-picker.ts +2 -3
  62. package/src/cli/setup-cli.ts +2 -3
  63. package/src/cli/stats-cli.ts +2 -3
  64. package/src/cli/update-cli.ts +25 -22
  65. package/src/commit/agentic/agent.ts +21 -23
  66. package/src/commit/agentic/fallback.ts +9 -9
  67. package/src/commit/agentic/index.ts +30 -38
  68. package/src/commit/agentic/state.ts +1 -6
  69. package/src/commit/agentic/tools/analyze-file.ts +15 -15
  70. package/src/commit/agentic/tools/git-file-diff.ts +3 -3
  71. package/src/commit/agentic/tools/git-hunk.ts +7 -7
  72. package/src/commit/agentic/tools/git-overview.ts +5 -5
  73. package/src/commit/agentic/tools/index.ts +14 -14
  74. package/src/commit/agentic/tools/propose-changelog.ts +6 -6
  75. package/src/commit/agentic/tools/propose-commit.ts +8 -8
  76. package/src/commit/agentic/tools/recent-commits.ts +2 -2
  77. package/src/commit/agentic/tools/split-commit.ts +19 -23
  78. package/src/commit/agentic/topo-sort.ts +1 -1
  79. package/src/commit/agentic/trivial.ts +3 -3
  80. package/src/commit/agentic/validation.ts +12 -12
  81. package/src/commit/analysis/conventional.ts +7 -11
  82. package/src/commit/analysis/index.ts +4 -4
  83. package/src/commit/analysis/scope.ts +4 -4
  84. package/src/commit/analysis/summary.ts +7 -9
  85. package/src/commit/analysis/validation.ts +1 -1
  86. package/src/commit/changelog/detect.ts +6 -6
  87. package/src/commit/changelog/generate.ts +7 -9
  88. package/src/commit/changelog/index.ts +13 -13
  89. package/src/commit/changelog/parse.ts +2 -2
  90. package/src/commit/cli.ts +1 -1
  91. package/src/commit/git/diff.ts +3 -3
  92. package/src/commit/git/index.ts +19 -24
  93. package/src/commit/index.ts +1 -1
  94. package/src/commit/map-reduce/index.ts +9 -9
  95. package/src/commit/map-reduce/map-phase.ts +19 -34
  96. package/src/commit/map-reduce/reduce-phase.ts +9 -11
  97. package/src/commit/message.ts +2 -2
  98. package/src/commit/model-selection.ts +3 -7
  99. package/src/commit/pipeline.ts +20 -22
  100. package/src/commit/utils/exclusions.ts +3 -3
  101. package/src/config/file-lock.ts +17 -7
  102. package/src/config/keybindings.ts +6 -8
  103. package/src/config/model-registry.ts +55 -37
  104. package/src/config/model-resolver.ts +18 -19
  105. package/src/config/prompt-templates.ts +11 -11
  106. package/src/config/settings-manager.ts +50 -34
  107. package/src/config.ts +60 -62
  108. package/src/cursor.ts +11 -9
  109. package/src/discovery/agents-md.ts +11 -12
  110. package/src/discovery/builtin.ts +68 -73
  111. package/src/discovery/claude.ts +41 -42
  112. package/src/discovery/cline.ts +11 -12
  113. package/src/discovery/codex.ts +52 -53
  114. package/src/discovery/cursor.ts +9 -10
  115. package/src/discovery/gemini.ts +17 -22
  116. package/src/discovery/github.ts +13 -14
  117. package/src/discovery/helpers.ts +35 -34
  118. package/src/discovery/index.ts +16 -18
  119. package/src/discovery/mcp-json.ts +8 -9
  120. package/src/discovery/ssh.ts +8 -9
  121. package/src/discovery/vscode.ts +4 -5
  122. package/src/discovery/windsurf.ts +6 -7
  123. package/src/exa/company.ts +1 -2
  124. package/src/exa/index.ts +2 -3
  125. package/src/exa/linkedin.ts +1 -2
  126. package/src/exa/mcp-client.ts +14 -16
  127. package/src/exa/render.ts +10 -11
  128. package/src/exa/researcher.ts +1 -2
  129. package/src/exa/search.ts +1 -2
  130. package/src/exa/types.ts +0 -1
  131. package/src/exa/websets.ts +1 -2
  132. package/src/exec/bash-executor.ts +3 -4
  133. package/src/exec/exec.ts +0 -1
  134. package/src/export/custom-share.ts +5 -6
  135. package/src/export/html/index.ts +24 -21
  136. package/src/export/ttsr.ts +2 -3
  137. package/src/extensibility/custom-commands/bundled/review/index.ts +7 -8
  138. package/src/extensibility/custom-commands/loader.ts +17 -14
  139. package/src/extensibility/custom-commands/types.ts +1 -2
  140. package/src/extensibility/custom-tools/loader.ts +10 -11
  141. package/src/extensibility/custom-tools/types.ts +6 -7
  142. package/src/extensibility/custom-tools/wrapper.ts +2 -3
  143. package/src/extensibility/extensions/loader.ts +75 -53
  144. package/src/extensibility/extensions/runner.ts +11 -12
  145. package/src/extensibility/extensions/types.ts +19 -26
  146. package/src/extensibility/extensions/wrapper.ts +3 -4
  147. package/src/extensibility/hooks/index.ts +1 -1
  148. package/src/extensibility/hooks/loader.ts +8 -9
  149. package/src/extensibility/hooks/runner.ts +7 -8
  150. package/src/extensibility/hooks/tool-wrapper.ts +0 -1
  151. package/src/extensibility/hooks/types.ts +10 -17
  152. package/src/extensibility/plugins/doctor.ts +3 -3
  153. package/src/extensibility/plugins/installer.ts +27 -27
  154. package/src/extensibility/plugins/loader.ts +59 -56
  155. package/src/extensibility/plugins/manager.ts +211 -171
  156. package/src/extensibility/plugins/parser.ts +1 -1
  157. package/src/extensibility/plugins/paths.ts +8 -8
  158. package/src/extensibility/skills.ts +63 -60
  159. package/src/extensibility/slash-commands.ts +10 -10
  160. package/src/index.ts +46 -46
  161. package/src/internal-urls/agent-protocol.ts +21 -11
  162. package/src/internal-urls/artifact-protocol.ts +17 -13
  163. package/src/internal-urls/router.ts +1 -2
  164. package/src/internal-urls/rule-protocol.ts +3 -4
  165. package/src/internal-urls/skill-protocol.ts +3 -4
  166. package/src/ipy/executor.ts +14 -10
  167. package/src/ipy/gateway-coordinator.ts +79 -90
  168. package/src/ipy/kernel.ts +32 -30
  169. package/src/ipy/modules.ts +13 -13
  170. package/src/lsp/client.ts +21 -10
  171. package/src/lsp/clients/biome-client.ts +1 -2
  172. package/src/lsp/clients/index.ts +3 -3
  173. package/src/lsp/clients/lsp-linter-client.ts +4 -5
  174. package/src/lsp/config.ts +15 -15
  175. package/src/lsp/edits.ts +4 -5
  176. package/src/lsp/index.ts +43 -44
  177. package/src/lsp/lspmux.ts +8 -8
  178. package/src/lsp/render.ts +10 -16
  179. package/src/lsp/utils.ts +3 -3
  180. package/src/main.ts +55 -34
  181. package/src/mcp/client.ts +2 -3
  182. package/src/mcp/config.ts +5 -6
  183. package/src/mcp/json-rpc.ts +0 -1
  184. package/src/mcp/loader.ts +3 -4
  185. package/src/mcp/manager.ts +17 -18
  186. package/src/mcp/tool-bridge.ts +4 -9
  187. package/src/mcp/tool-cache.ts +2 -3
  188. package/src/mcp/transports/http.ts +2 -4
  189. package/src/mcp/transports/stdio.ts +1 -2
  190. package/src/migrations.ts +60 -49
  191. package/src/modes/components/armin.ts +4 -5
  192. package/src/modes/components/assistant-message.ts +6 -6
  193. package/src/modes/components/bash-execution.ts +7 -8
  194. package/src/modes/components/bordered-loader.ts +3 -3
  195. package/src/modes/components/branch-summary-message.ts +3 -3
  196. package/src/modes/components/compaction-summary-message.ts +3 -3
  197. package/src/modes/components/countdown-timer.ts +0 -1
  198. package/src/modes/components/custom-message.ts +5 -5
  199. package/src/modes/components/diff.ts +1 -1
  200. package/src/modes/components/dynamic-border.ts +2 -2
  201. package/src/modes/components/extensions/extension-dashboard.ts +6 -7
  202. package/src/modes/components/extensions/extension-list.ts +2 -3
  203. package/src/modes/components/extensions/inspector-panel.ts +3 -4
  204. package/src/modes/components/extensions/state-manager.ts +25 -26
  205. package/src/modes/components/extensions/types.ts +1 -2
  206. package/src/modes/components/footer.ts +47 -43
  207. package/src/modes/components/history-search.ts +2 -2
  208. package/src/modes/components/hook-editor.ts +3 -4
  209. package/src/modes/components/hook-input.ts +2 -3
  210. package/src/modes/components/hook-message.ts +5 -5
  211. package/src/modes/components/hook-selector.ts +2 -3
  212. package/src/modes/components/keybinding-hints.ts +2 -3
  213. package/src/modes/components/login-dialog.ts +2 -2
  214. package/src/modes/components/model-selector.ts +12 -12
  215. package/src/modes/components/oauth-selector.ts +2 -2
  216. package/src/modes/components/plugin-settings.ts +20 -20
  217. package/src/modes/components/python-execution.ts +7 -8
  218. package/src/modes/components/queue-mode-selector.ts +3 -3
  219. package/src/modes/components/read-tool-group.ts +2 -2
  220. package/src/modes/components/session-selector.ts +4 -4
  221. package/src/modes/components/settings-defs.ts +77 -69
  222. package/src/modes/components/settings-selector.ts +16 -16
  223. package/src/modes/components/show-images-selector.ts +2 -2
  224. package/src/modes/components/status-line/segments.ts +4 -4
  225. package/src/modes/components/status-line/separators.ts +1 -1
  226. package/src/modes/components/status-line/types.ts +2 -2
  227. package/src/modes/components/status-line-segment-editor.ts +7 -8
  228. package/src/modes/components/status-line.ts +12 -12
  229. package/src/modes/components/theme-selector.ts +8 -7
  230. package/src/modes/components/thinking-selector.ts +4 -4
  231. package/src/modes/components/todo-display.ts +2 -2
  232. package/src/modes/components/todo-reminder.ts +4 -4
  233. package/src/modes/components/tool-execution.ts +11 -16
  234. package/src/modes/components/tree-selector.ts +11 -11
  235. package/src/modes/components/ttsr-notification.ts +5 -5
  236. package/src/modes/components/user-message-selector.ts +1 -1
  237. package/src/modes/components/user-message.ts +1 -1
  238. package/src/modes/components/visual-truncate.ts +0 -1
  239. package/src/modes/components/welcome.ts +4 -4
  240. package/src/modes/controllers/command-controller.ts +46 -47
  241. package/src/modes/controllers/event-controller.ts +16 -20
  242. package/src/modes/controllers/extension-ui-controller.ts +40 -46
  243. package/src/modes/controllers/input-controller.ts +17 -18
  244. package/src/modes/controllers/selector-controller.ts +103 -91
  245. package/src/modes/index.ts +3 -3
  246. package/src/modes/interactive-mode.ts +27 -29
  247. package/src/modes/print-mode.ts +12 -13
  248. package/src/modes/rpc/rpc-client.ts +7 -8
  249. package/src/modes/rpc/rpc-mode.ts +24 -25
  250. package/src/modes/rpc/rpc-types.ts +3 -4
  251. package/src/modes/theme/mermaid-cache.ts +2 -2
  252. package/src/modes/theme/theme.ts +128 -53
  253. package/src/modes/types.ts +10 -10
  254. package/src/modes/utils/ui-helpers.ts +17 -17
  255. package/src/patch/applicator.ts +18 -19
  256. package/src/patch/diff.ts +1 -2
  257. package/src/patch/fuzzy.ts +1 -2
  258. package/src/patch/index.ts +10 -11
  259. package/src/patch/normalize.ts +4 -4
  260. package/src/patch/normative.ts +1 -2
  261. package/src/patch/parser.ts +8 -9
  262. package/src/patch/shared.ts +12 -13
  263. package/src/sdk.ts +60 -63
  264. package/src/session/agent-session.ts +83 -84
  265. package/src/session/agent-storage.ts +11 -11
  266. package/src/session/artifacts.ts +8 -9
  267. package/src/session/auth-storage.ts +25 -29
  268. package/src/session/compaction/branch-summarization.ts +7 -10
  269. package/src/session/compaction/compaction.ts +8 -19
  270. package/src/session/compaction/utils.ts +6 -9
  271. package/src/session/history-storage.ts +10 -10
  272. package/src/session/messages.ts +4 -5
  273. package/src/session/session-manager.ts +76 -65
  274. package/src/session/session-storage.ts +57 -69
  275. package/src/session/storage-migration.ts +2 -3
  276. package/src/session/streaming-output.ts +2 -2
  277. package/src/ssh/connection-manager.ts +43 -50
  278. package/src/ssh/ssh-executor.ts +2 -2
  279. package/src/ssh/sshfs-mount.ts +11 -18
  280. package/src/system-prompt.ts +27 -34
  281. package/src/task/agents.ts +45 -30
  282. package/src/task/commands.ts +6 -7
  283. package/src/task/discovery.ts +39 -76
  284. package/src/task/executor.ts +14 -15
  285. package/src/task/index.ts +33 -36
  286. package/src/task/output-manager.ts +3 -4
  287. package/src/task/parallel.ts +0 -1
  288. package/src/task/render.ts +19 -20
  289. package/src/task/subprocess-tool-registry.ts +1 -2
  290. package/src/task/worker-protocol.ts +3 -3
  291. package/src/task/worker.ts +32 -38
  292. package/src/task/worktree.ts +19 -19
  293. package/src/tools/ask.ts +8 -9
  294. package/src/tools/bash-interceptor.ts +1 -5
  295. package/src/tools/bash.ts +19 -18
  296. package/src/tools/calculator.ts +12 -12
  297. package/src/tools/complete.ts +3 -4
  298. package/src/tools/context.ts +2 -2
  299. package/src/tools/fetch.ts +23 -26
  300. package/src/tools/find.ts +15 -16
  301. package/src/tools/gemini-image.ts +14 -14
  302. package/src/tools/grep.ts +27 -27
  303. package/src/tools/index.ts +78 -56
  304. package/src/tools/list-limit.ts +1 -1
  305. package/src/tools/ls.ts +7 -7
  306. package/src/tools/notebook.ts +5 -5
  307. package/src/tools/output-meta.ts +3 -4
  308. package/src/tools/output-utils.ts +1 -1
  309. package/src/tools/path-utils.ts +5 -5
  310. package/src/tools/python.ts +36 -37
  311. package/src/tools/read.ts +23 -23
  312. package/src/tools/render-utils.ts +8 -9
  313. package/src/tools/renderers.ts +6 -7
  314. package/src/tools/review.ts +8 -11
  315. package/src/tools/ssh.ts +31 -30
  316. package/src/tools/todo-write.ts +13 -13
  317. package/src/tools/tool-errors.ts +3 -3
  318. package/src/tools/tool-result.ts +3 -8
  319. package/src/tools/write.ts +11 -16
  320. package/src/tui/code-cell.ts +3 -9
  321. package/src/tui/file-list.ts +3 -4
  322. package/src/tui/output-block.ts +1 -2
  323. package/src/tui/status-line.ts +2 -3
  324. package/src/tui/tree-list.ts +2 -3
  325. package/src/tui/types.ts +1 -2
  326. package/src/tui/utils.ts +2 -3
  327. package/src/utils/changelog.ts +9 -10
  328. package/src/utils/clipboard.ts +11 -11
  329. package/src/utils/file-mentions.ts +4 -10
  330. package/src/utils/frontmatter.ts +6 -3
  331. package/src/utils/fuzzy.ts +2 -2
  332. package/src/utils/image-convert.ts +1 -1
  333. package/src/utils/image-resize.ts +1 -1
  334. package/src/utils/mime.ts +2 -2
  335. package/src/utils/shell-snapshot.ts +11 -13
  336. package/src/utils/shell.ts +4 -5
  337. package/src/utils/title-generator.ts +8 -9
  338. package/src/utils/tools-manager.ts +23 -23
  339. package/src/vendor/photon/index.js +1099 -1059
  340. package/src/vendor/photon/photon_rs_bg.wasm +0 -0
  341. package/src/web/scrapers/artifacthub.ts +1 -1
  342. package/src/web/scrapers/arxiv.ts +2 -2
  343. package/src/web/scrapers/bluesky.ts +2 -2
  344. package/src/web/scrapers/cheatsh.ts +1 -1
  345. package/src/web/scrapers/chocolatey.ts +2 -2
  346. package/src/web/scrapers/choosealicense.ts +5 -5
  347. package/src/web/scrapers/cisa-kev.ts +1 -1
  348. package/src/web/scrapers/crossref.ts +2 -2
  349. package/src/web/scrapers/devto.ts +3 -3
  350. package/src/web/scrapers/discogs.ts +3 -4
  351. package/src/web/scrapers/discourse.ts +1 -1
  352. package/src/web/scrapers/dockerhub.ts +1 -1
  353. package/src/web/scrapers/fdroid.ts +2 -2
  354. package/src/web/scrapers/firefox-addons.ts +3 -3
  355. package/src/web/scrapers/flathub.ts +1 -1
  356. package/src/web/scrapers/github.ts +3 -3
  357. package/src/web/scrapers/gitlab.ts +4 -4
  358. package/src/web/scrapers/hackernews.ts +2 -2
  359. package/src/web/scrapers/huggingface.ts +1 -1
  360. package/src/web/scrapers/iacr.ts +2 -2
  361. package/src/web/scrapers/index.ts +0 -1
  362. package/src/web/scrapers/jetbrains-marketplace.ts +1 -1
  363. package/src/web/scrapers/lemmy.ts +2 -2
  364. package/src/web/scrapers/maven.ts +2 -2
  365. package/src/web/scrapers/mdn.ts +2 -4
  366. package/src/web/scrapers/metacpan.ts +2 -2
  367. package/src/web/scrapers/musicbrainz.ts +1 -2
  368. package/src/web/scrapers/npm.ts +1 -1
  369. package/src/web/scrapers/nuget.ts +2 -2
  370. package/src/web/scrapers/nvd.ts +3 -3
  371. package/src/web/scrapers/ollama.ts +7 -9
  372. package/src/web/scrapers/opencorporates.ts +2 -2
  373. package/src/web/scrapers/openlibrary.ts +6 -6
  374. package/src/web/scrapers/orcid.ts +0 -1
  375. package/src/web/scrapers/osv.ts +2 -2
  376. package/src/web/scrapers/packagist.ts +1 -1
  377. package/src/web/scrapers/pubmed.ts +1 -2
  378. package/src/web/scrapers/rawg.ts +2 -2
  379. package/src/web/scrapers/readthedocs.ts +1 -2
  380. package/src/web/scrapers/repology.ts +2 -2
  381. package/src/web/scrapers/rfc.ts +1 -1
  382. package/src/web/scrapers/searchcode.ts +2 -2
  383. package/src/web/scrapers/semantic-scholar.ts +1 -1
  384. package/src/web/scrapers/snapcraft.ts +2 -2
  385. package/src/web/scrapers/sourcegraph.ts +1 -1
  386. package/src/web/scrapers/spdx.ts +3 -3
  387. package/src/web/scrapers/spotify.ts +0 -1
  388. package/src/web/scrapers/twitter.ts +1 -1
  389. package/src/web/scrapers/types.ts +1 -2
  390. package/src/web/scrapers/utils.ts +5 -5
  391. package/src/web/scrapers/wikidata.ts +3 -3
  392. package/src/web/scrapers/youtube.ts +9 -14
  393. package/src/web/search/auth.ts +4 -9
  394. package/src/web/search/index.ts +11 -21
  395. package/src/web/search/providers/anthropic.ts +3 -9
  396. package/src/web/search/providers/exa.ts +6 -10
  397. package/src/web/search/providers/perplexity.ts +5 -5
  398. package/src/web/search/render.ts +16 -18
  399. package/scripts/generate-wasm-b64.ts +0 -24
  400. package/src/commit/map-reduce/.map-phase.ts.kate-swp +0 -0
  401. package/src/task/.executor.ts.kate-swp +0 -0
  402. package/src/vendor/photon/photon_rs_bg.wasm.b64.js +0 -1
@@ -1,6 +1,4 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { SettingsManager, StatusLineSettings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
3
- import { getSelectListTheme, getSettingsListTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
4
2
  import {
5
3
  Container,
6
4
  matchesKey,
@@ -14,6 +12,8 @@ import {
14
12
  type TabBarTheme,
15
13
  Text,
16
14
  } from "@oh-my-pi/pi-tui";
15
+ import type { SettingsManager, StatusLineSettings } from "../../config/settings-manager";
16
+ import { getSelectListTheme, getSettingsListTheme, theme } from "../../modes/theme/theme";
17
17
  import { DynamicBorder } from "./dynamic-border";
18
18
  import { PluginSettingsComponent } from "./plugin-settings";
19
19
  import { getSettingsForTab, type SettingDef } from "./settings-defs";
@@ -22,10 +22,10 @@ import { StatusLineSegmentEditorComponent } from "./status-line-segment-editor";
22
22
 
23
23
  function getTabBarTheme(): TabBarTheme {
24
24
  return {
25
- label: (text) => theme.bold(theme.fg("accent", text)),
26
- activeTab: (text) => theme.bold(theme.bg("selectedBg", theme.fg("text", text))),
27
- inactiveTab: (text) => theme.fg("muted", text),
28
- hint: (text) => theme.fg("dim", text),
25
+ label: text => theme.bold(theme.fg("accent", text)),
26
+ activeTab: text => theme.bold(theme.bg("selectedBg", theme.fg("text", text))),
27
+ inactiveTab: text => theme.fg("muted", text),
28
+ hint: text => theme.fg("dim", text),
29
29
  };
30
30
  }
31
31
 
@@ -74,19 +74,19 @@ class SelectSubmenu extends Container {
74
74
  this.selectList = new SelectList(options, Math.min(options.length, 10), getSelectListTheme());
75
75
 
76
76
  // Pre-select current value
77
- const currentIndex = options.findIndex((o) => o.value === currentValue);
77
+ const currentIndex = options.findIndex(o => o.value === currentValue);
78
78
  if (currentIndex !== -1) {
79
79
  this.selectList.setSelectedIndex(currentIndex);
80
80
  }
81
81
 
82
- this.selectList.onSelect = (item) => {
82
+ this.selectList.onSelect = item => {
83
83
  onSelect(item.value);
84
84
  };
85
85
 
86
86
  this.selectList.onCancel = onCancel;
87
87
 
88
88
  if (onSelectionChange) {
89
- this.selectList.onSelectionChange = (item) => {
89
+ this.selectList.onSelectionChange = item => {
90
90
  onSelectionChange(item.value);
91
91
  // Update preview after the preview callback has applied changes
92
92
  this.updatePreview();
@@ -307,12 +307,12 @@ export class SettingsSelectorComponent extends Container {
307
307
 
308
308
  // Special case: inject runtime options
309
309
  if (def.id === "thinkingLevel") {
310
- options = this.context.availableThinkingLevels.map((level) => {
311
- const baseOpt = def.getOptions(this.settingsManager).find((o) => o.value === level);
310
+ options = this.context.availableThinkingLevels.map(level => {
311
+ const baseOpt = def.getOptions(this.settingsManager).find(o => o.value === level);
312
312
  return baseOpt || { value: level, label: level };
313
313
  });
314
314
  } else if (def.id === "theme") {
315
- options = this.context.availableThemes.map((t) => ({ value: t, label: t }));
315
+ options = this.context.availableThemes.map(t => ({ value: t, label: t }));
316
316
  }
317
317
 
318
318
  // Preview handlers
@@ -323,7 +323,7 @@ export class SettingsSelectorComponent extends Container {
323
323
  onPreview = this.callbacks.onThemePreview;
324
324
  onPreviewCancel = () => this.callbacks.onThemePreview?.(currentValue);
325
325
  } else if (def.id === "statusLinePreset") {
326
- onPreview = (value) => {
326
+ onPreview = value => {
327
327
  const presetDef = getPreset((value as StatusLineSettings["preset"]) ?? "default");
328
328
  this.callbacks.onStatusLinePreview?.({
329
329
  preset: value as StatusLineSettings["preset"],
@@ -345,7 +345,7 @@ export class SettingsSelectorComponent extends Container {
345
345
  this.updateStatusPreview();
346
346
  };
347
347
  } else if (def.id === "statusLineSeparator") {
348
- onPreview = (value) => {
348
+ onPreview = value => {
349
349
  this.callbacks.onStatusLinePreview?.({
350
350
  separator: value as StatusLineSettings["separator"],
351
351
  });
@@ -370,7 +370,7 @@ export class SettingsSelectorComponent extends Container {
370
370
  def.description,
371
371
  options,
372
372
  currentValue,
373
- (value) => {
373
+ value => {
374
374
  // Persist to SettingsManager
375
375
  def.set(this.settingsManager, value);
376
376
  // Notify for side effects
@@ -454,7 +454,7 @@ export class SettingsSelectorComponent extends Container {
454
454
  10,
455
455
  getSettingsListTheme(),
456
456
  (id, newValue) => {
457
- const def = defs.find((d) => d.id === id);
457
+ const def = defs.find(d => d.id === id);
458
458
  if (!def) return;
459
459
 
460
460
  // Persist to SettingsManager based on type
@@ -1,5 +1,5 @@
1
- import { getSelectListTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
1
  import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui";
2
+ import { getSelectListTheme } from "../../modes/theme/theme";
3
3
  import { DynamicBorder } from "./dynamic-border";
4
4
 
5
5
  /**
@@ -25,7 +25,7 @@ export class ShowImagesSelectorComponent extends Container {
25
25
  // Preselect current value
26
26
  this.selectList.setSelectedIndex(currentValue ? 0 : 1);
27
27
 
28
- this.selectList.onSelect = (item) => {
28
+ this.selectList.onSelect = item => {
29
29
  onSelect(item.value === "yes");
30
30
  };
31
31
 
@@ -1,6 +1,6 @@
1
- import { hostname as osHostname } from "node:os";
2
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
- import { shortenPath } from "@oh-my-pi/pi-coding-agent/tools/render-utils";
1
+ import * as os from "node:os";
2
+ import { theme } from "../../../modes/theme/theme";
3
+ import { shortenPath } from "../../../tools/render-utils";
4
4
  import type { RenderedSegment, SegmentContext, StatusLineSegment, StatusLineSegmentId } from "./types";
5
5
 
6
6
  export type { SegmentContext } from "./types";
@@ -286,7 +286,7 @@ const sessionSegment: StatusLineSegment = {
286
286
  const hostnameSegment: StatusLineSegment = {
287
287
  id: "hostname",
288
288
  render(_ctx) {
289
- const name = osHostname().split(".")[0];
289
+ const name = os.hostname().split(".")[0];
290
290
  return { content: withIcon(theme.icon.host, name), visible: true };
291
291
  },
292
292
  };
@@ -1,4 +1,4 @@
1
- import type { Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
1
+ import type { Theme } from "../../../modes/theme/theme";
2
2
  import type { SeparatorDef, StatusLineSeparatorStyle } from "./types";
3
3
 
4
4
  function trimSep(value: string): string {
@@ -4,8 +4,8 @@ import type {
4
4
  StatusLineSegmentOptions,
5
5
  StatusLineSeparatorStyle,
6
6
  StatusLineSettings,
7
- } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
8
- import type { AgentSession } from "@oh-my-pi/pi-coding-agent/session/agent-session";
7
+ } from "../../../config/settings-manager";
8
+ import type { AgentSession } from "../../../session/agent-session";
9
9
 
10
10
  // Re-export types from settings-manager (single source of truth)
11
11
  export type {
@@ -8,10 +8,9 @@
8
8
  * - Shift+J/K: Reorder segment within column
9
9
  * - Live preview shown in the actual status line above
10
10
  */
11
-
12
- import type { StatusLineSegmentId } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
13
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
14
11
  import { Container, matchesKey } from "@oh-my-pi/pi-tui";
12
+ import type { StatusLineSegmentId } from "../../config/settings-manager";
13
+ import { theme } from "../../modes/theme/theme";
15
14
  import { ALL_SEGMENT_IDS } from "./status-line/segments";
16
15
 
17
16
  // Segment display names and short descriptions
@@ -93,7 +92,7 @@ export class StatusLineSegmentEditorComponent extends Container {
93
92
  }
94
93
 
95
94
  private getSegmentsForColumn(column: Column): SegmentState[] {
96
- return this.segments.filter((s) => s.column === column).sort((a, b) => a.order - b.order);
95
+ return this.segments.filter(s => s.column === column).sort((a, b) => a.order - b.order);
97
96
  }
98
97
 
99
98
  private getCurrentColumnSegments(): SegmentState[] {
@@ -101,8 +100,8 @@ export class StatusLineSegmentEditorComponent extends Container {
101
100
  }
102
101
 
103
102
  private triggerPreview(): void {
104
- const left = this.getSegmentsForColumn("left").map((s) => s.id);
105
- const right = this.getSegmentsForColumn("right").map((s) => s.id);
103
+ const left = this.getSegmentsForColumn("left").map(s => s.id);
104
+ const right = this.getSegmentsForColumn("right").map(s => s.id);
106
105
  this.callbacks.onPreview?.(left, right);
107
106
  }
108
107
 
@@ -236,8 +235,8 @@ export class StatusLineSegmentEditorComponent extends Container {
236
235
  this.triggerPreview();
237
236
  }
238
237
  } else if (matchesKey(data, "enter") || matchesKey(data, "return") || data === "\n") {
239
- const left = this.getSegmentsForColumn("left").map((s) => s.id);
240
- const right = this.getSegmentsForColumn("right").map((s) => s.id);
238
+ const left = this.getSegmentsForColumn("left").map(s => s.id);
239
+ const right = this.getSegmentsForColumn("right").map(s => s.id);
241
240
  this.callbacks.onSave(left, right);
242
241
  } else if (matchesKey(data, "escape") || matchesKey(data, "esc")) {
243
242
  this.callbacks.onCancel();
@@ -1,11 +1,11 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
1
3
  import type { AssistantMessage } from "@oh-my-pi/pi-ai";
2
- import type { StatusLineSegmentOptions, StatusLineSettings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
3
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
4
- import type { AgentSession } from "@oh-my-pi/pi-coding-agent/session/agent-session";
5
4
  import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui";
6
5
  import { $ } from "bun";
7
- import { type FSWatcher, watch } from "fs";
8
- import { dirname, join } from "path";
6
+ import type { StatusLineSegmentOptions, StatusLineSettings } from "../../config/settings-manager";
7
+ import { theme } from "../../modes/theme/theme";
8
+ import type { AgentSession } from "../../session/agent-session";
9
9
  import { getPreset } from "./status-line/presets";
10
10
  import { renderSegment, type SegmentContext } from "./status-line/segments";
11
11
  import { getSeparator } from "./status-line/separators";
@@ -26,11 +26,11 @@ function sanitizeStatusText(text: string): string {
26
26
  async function findGitHeadPath(): Promise<string | null> {
27
27
  let dir = process.cwd();
28
28
  while (true) {
29
- const gitHeadPath = join(dir, ".git", "HEAD");
29
+ const gitHeadPath = path.join(dir, ".git", "HEAD");
30
30
  if (await Bun.file(gitHeadPath).exists()) {
31
31
  return gitHeadPath;
32
32
  }
33
- const parent = dirname(dir);
33
+ const parent = path.dirname(dir);
34
34
  if (parent === dir) {
35
35
  return null;
36
36
  }
@@ -46,7 +46,7 @@ export class StatusLineComponent implements Component {
46
46
  private session: AgentSession;
47
47
  private settings: StatusLineSettings = {};
48
48
  private cachedBranch: string | null | undefined = undefined;
49
- private gitWatcher: FSWatcher | null = null;
49
+ private gitWatcher: fs.FSWatcher | null = null;
50
50
  private onBranchChange: (() => void) | null = null;
51
51
  private autoCompactEnabled: boolean = true;
52
52
  private hookStatuses: Map<string, string> = new Map();
@@ -98,11 +98,11 @@ export class StatusLineComponent implements Component {
98
98
  this.gitWatcher = null;
99
99
  }
100
100
 
101
- findGitHeadPath().then((gitHeadPath) => {
101
+ findGitHeadPath().then(gitHeadPath => {
102
102
  if (!gitHeadPath) return;
103
103
 
104
104
  try {
105
- this.gitWatcher = watch(gitHeadPath, () => {
105
+ this.gitWatcher = fs.watch(gitHeadPath, () => {
106
106
  this.cachedBranch = undefined;
107
107
  if (this.onBranchChange) {
108
108
  this.onBranchChange();
@@ -132,7 +132,7 @@ export class StatusLineComponent implements Component {
132
132
 
133
133
  // Note: synchronous call to async function - will return undefined on first call
134
134
  // This is acceptable since it's a cached value that will update on next render
135
- findGitHeadPath().then(async (gitHeadPath) => {
135
+ findGitHeadPath().then(async gitHeadPath => {
136
136
  if (!gitHeadPath) {
137
137
  this.cachedBranch = null;
138
138
  return;
@@ -222,7 +222,7 @@ export class StatusLineComponent implements Component {
222
222
  const lastAssistantMessage = state.messages
223
223
  .slice()
224
224
  .reverse()
225
- .find((m) => m.role === "assistant" && m.stopReason !== "aborted") as AssistantMessage | undefined;
225
+ .find(m => m.role === "assistant" && m.stopReason !== "aborted") as AssistantMessage | undefined;
226
226
 
227
227
  const contextTokens = lastAssistantMessage
228
228
  ? lastAssistantMessage.usage.input +
@@ -1,9 +1,10 @@
1
- import { getAvailableThemes, getSelectListTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
1
  import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui";
2
+ import { getSelectListTheme } from "../../modes/theme/theme";
3
3
  import { DynamicBorder } from "./dynamic-border";
4
4
 
5
5
  /**
6
- * Component that renders a theme selector
6
+ * Component that renders a theme selector.
7
+ * Themes must be pre-loaded and passed to the constructor.
7
8
  */
8
9
  export class ThemeSelectorComponent extends Container {
9
10
  private selectList: SelectList;
@@ -11,6 +12,7 @@ export class ThemeSelectorComponent extends Container {
11
12
 
12
13
  constructor(
13
14
  currentTheme: string,
15
+ themes: string[],
14
16
  onSelect: (themeName: string) => void,
15
17
  onCancel: () => void,
16
18
  onPreview: (themeName: string) => void,
@@ -18,9 +20,8 @@ export class ThemeSelectorComponent extends Container {
18
20
  super();
19
21
  this.onPreview = onPreview;
20
22
 
21
- // Get available themes and create select items
22
- const themes = getAvailableThemes();
23
- const themeItems: SelectItem[] = themes.map((name) => ({
23
+ // Create select items from provided themes
24
+ const themeItems: SelectItem[] = themes.map(name => ({
24
25
  value: name,
25
26
  label: name,
26
27
  description: name === currentTheme ? "(current)" : undefined,
@@ -38,7 +39,7 @@ export class ThemeSelectorComponent extends Container {
38
39
  this.selectList.setSelectedIndex(currentIndex);
39
40
  }
40
41
 
41
- this.selectList.onSelect = (item) => {
42
+ this.selectList.onSelect = item => {
42
43
  onSelect(item.value);
43
44
  };
44
45
 
@@ -46,7 +47,7 @@ export class ThemeSelectorComponent extends Container {
46
47
  onCancel();
47
48
  };
48
49
 
49
- this.selectList.onSelectionChange = (item) => {
50
+ this.selectList.onSelectionChange = item => {
50
51
  this.onPreview(item.value);
51
52
  };
52
53
 
@@ -1,6 +1,6 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import { getSelectListTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
2
  import { Container, type SelectItem, SelectList } from "@oh-my-pi/pi-tui";
3
+ import { getSelectListTheme } from "../../modes/theme/theme";
4
4
  import { DynamicBorder } from "./dynamic-border";
5
5
 
6
6
  const LEVEL_DESCRIPTIONS: Record<ThinkingLevel, string> = {
@@ -26,7 +26,7 @@ export class ThinkingSelectorComponent extends Container {
26
26
  ) {
27
27
  super();
28
28
 
29
- const thinkingLevels: SelectItem[] = availableLevels.map((level) => ({
29
+ const thinkingLevels: SelectItem[] = availableLevels.map(level => ({
30
30
  value: level,
31
31
  label: level,
32
32
  description: LEVEL_DESCRIPTIONS[level],
@@ -39,12 +39,12 @@ export class ThinkingSelectorComponent extends Container {
39
39
  this.selectList = new SelectList(thinkingLevels, thinkingLevels.length, getSelectListTheme());
40
40
 
41
41
  // Preselect current level
42
- const currentIndex = thinkingLevels.findIndex((item) => item.value === currentLevel);
42
+ const currentIndex = thinkingLevels.findIndex(item => item.value === currentLevel);
43
43
  if (currentIndex !== -1) {
44
44
  this.selectList.setSelectedIndex(currentIndex);
45
45
  }
46
46
 
47
- this.selectList.onSelect = (item) => {
47
+ this.selectList.onSelect = item => {
48
48
  onSelect(item.value as ThinkingLevel);
49
49
  };
50
50
 
@@ -1,8 +1,8 @@
1
1
  import * as path from "node:path";
2
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
- import type { TodoItem } from "@oh-my-pi/pi-coding-agent/modes/types";
4
2
  import { Text } from "@oh-my-pi/pi-tui";
5
3
  import { logger } from "@oh-my-pi/pi-utils";
4
+ import { theme } from "../../modes/theme/theme";
5
+ import type { TodoItem } from "../../modes/types";
6
6
 
7
7
  const TODO_FILE_NAME = "todos.json";
8
8
 
@@ -1,6 +1,6 @@
1
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
- import type { TodoItem } from "@oh-my-pi/pi-coding-agent/tools/todo-write";
3
1
  import { Box, Container, Spacer, Text } from "@oh-my-pi/pi-tui";
2
+ import { theme } from "../../modes/theme/theme";
3
+ import type { TodoItem } from "../../tools/todo-write";
4
4
 
5
5
  /**
6
6
  * Component that renders a todo completion reminder notification.
@@ -20,7 +20,7 @@ export class TodoReminderComponent extends Container {
20
20
 
21
21
  this.addChild(new Spacer(1));
22
22
 
23
- this.box = new Box(1, 1, (t) => theme.inverse(theme.fg("warning", t)));
23
+ this.box = new Box(1, 1, t => theme.inverse(theme.fg("warning", t)));
24
24
  this.addChild(this.box);
25
25
 
26
26
  this.rebuild();
@@ -36,7 +36,7 @@ export class TodoReminderComponent extends Container {
36
36
  this.box.addChild(new Text(header, 0, 0));
37
37
  this.box.addChild(new Spacer(1));
38
38
 
39
- const todoList = this.todos.map((t) => ` ${theme.checkbox.unchecked} ${t.content}`).join("\n");
39
+ const todoList = this.todos.map(t => ` ${theme.checkbox.unchecked} ${t.content}`).join("\n");
40
40
  this.box.addChild(new Text(theme.italic(todoList), 0, 0));
41
41
  }
42
42
  }
@@ -1,15 +1,4 @@
1
1
  import type { AgentTool } from "@oh-my-pi/pi-agent-core";
2
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
- import {
4
- computeEditDiff,
5
- computePatchDiff,
6
- type EditDiffError,
7
- type EditDiffResult,
8
- } from "@oh-my-pi/pi-coding-agent/patch";
9
- import { BASH_DEFAULT_PREVIEW_LINES } from "@oh-my-pi/pi-coding-agent/tools/bash";
10
- import { PYTHON_DEFAULT_PREVIEW_LINES } from "@oh-my-pi/pi-coding-agent/tools/python";
11
- import { toolRenderers } from "@oh-my-pi/pi-coding-agent/tools/renderers";
12
- import { convertToPng } from "@oh-my-pi/pi-coding-agent/utils/image-convert";
13
2
  import {
14
3
  Box,
15
4
  Container,
@@ -22,6 +11,12 @@ import {
22
11
  type TUI,
23
12
  } from "@oh-my-pi/pi-tui";
24
13
  import { sanitizeText } from "@oh-my-pi/pi-utils";
14
+ import { theme } from "../../modes/theme/theme";
15
+ import { computeEditDiff, computePatchDiff, type EditDiffError, type EditDiffResult } from "../../patch";
16
+ import { BASH_DEFAULT_PREVIEW_LINES } from "../../tools/bash";
17
+ import { PYTHON_DEFAULT_PREVIEW_LINES } from "../../tools/python";
18
+ import { toolRenderers } from "../../tools/renderers";
19
+ import { convertToPng } from "../../utils/image-convert";
25
20
  import { renderDiff } from "./diff";
26
21
 
27
22
  // Preview line limit for bash when not expanded
@@ -41,7 +36,7 @@ function formatCompactValue(value: unknown, maxLength: number): string {
41
36
  } else if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
42
37
  rendered = String(value);
43
38
  } else if (Array.isArray(value)) {
44
- const previewItems = value.slice(0, 3).map((item) => formatCompactValue(item, maxLength));
39
+ const previewItems = value.slice(0, 3).map(item => formatCompactValue(item, maxLength));
45
40
  rendered = `[${previewItems.join(", ")}${value.length > 3 ? ", ..." : ""}]`;
46
41
  } else if (typeof value === "object") {
47
42
  try {
@@ -218,7 +213,7 @@ export class ToolExecutionComponent extends Container {
218
213
  computePatchDiff({ path, op, rename, diff }, this.cwd, {
219
214
  fuzzyThreshold: this.editFuzzyThreshold,
220
215
  allowFuzzy: this.editAllowFuzzy,
221
- }).then((result) => {
216
+ }).then(result => {
222
217
  if (this.editDiffArgsKey === argsKey) {
223
218
  this.editDiffPreview = result;
224
219
  this.updateDisplay();
@@ -244,7 +239,7 @@ export class ToolExecutionComponent extends Container {
244
239
  this.editDiffArgsKey = argsKey;
245
240
 
246
241
  // Compute diff async
247
- computeEditDiff(path, oldText, newText, this.cwd, true, all, this.editFuzzyThreshold).then((result) => {
242
+ computeEditDiff(path, oldText, newText, this.cwd, true, all, this.editFuzzyThreshold).then(result => {
248
243
  // Only update if args haven't changed since we started
249
244
  if (this.editDiffArgsKey === argsKey) {
250
245
  this.editDiffPreview = result;
@@ -308,7 +303,7 @@ export class ToolExecutionComponent extends Container {
308
303
  // Convert async - catch errors from WASM processing
309
304
  const index = i;
310
305
  convertToPng(img.data, img.mimeType)
311
- .then((converted) => {
306
+ .then(converted => {
312
307
  if (converted) {
313
308
  this.convertedImages.set(index, converted);
314
309
  this.updateDisplay();
@@ -634,7 +629,7 @@ export class ToolExecutionComponent extends Container {
634
629
  const displayLines = lines.slice(-maxLines);
635
630
  const remaining = lines.length - displayLines.length;
636
631
  text += ` ${theme.fg("dim", `(${lines.length} lines)`)}`;
637
- text += `\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
632
+ text += `\n${displayLines.map(line => theme.fg("toolOutput", line)).join("\n")}`;
638
633
  if (remaining > 0) {
639
634
  text += theme.fg("dim", `\n${theme.format.ellipsis} (${remaining} earlier lines) (ctrl+o to expand)`);
640
635
  }
@@ -1,6 +1,3 @@
1
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
- import type { SessionTreeNode } from "@oh-my-pi/pi-coding-agent/session/session-manager";
3
- import { shortenPath } from "@oh-my-pi/pi-coding-agent/tools/render-utils";
4
1
  import {
5
2
  type Component,
6
3
  Container,
@@ -11,6 +8,9 @@ import {
11
8
  TruncatedText,
12
9
  truncateToWidth,
13
10
  } from "@oh-my-pi/pi-tui";
11
+ import { theme } from "../../modes/theme/theme";
12
+ import type { SessionTreeNode } from "../../session/session-manager";
13
+ import { shortenPath } from "../../tools/render-utils";
14
14
  import { DynamicBorder } from "./dynamic-border";
15
15
 
16
16
  /** Gutter info: position (displayIndent where connector was) and whether to show │ */
@@ -71,7 +71,7 @@ class TreeList implements Component {
71
71
  this.applyFilter();
72
72
 
73
73
  // Start with current leaf selected
74
- const leafIndex = this.filteredNodes.findIndex((n) => n.node.entry.id === currentLeafId);
74
+ const leafIndex = this.filteredNodes.findIndex(n => n.node.entry.id === currentLeafId);
75
75
  if (leafIndex !== -1) {
76
76
  this.selectedIndex = leafIndex;
77
77
  } else {
@@ -236,7 +236,7 @@ class TreeList implements Component {
236
236
 
237
237
  const searchTokens = this.searchQuery.toLowerCase().split(/\s+/).filter(Boolean);
238
238
 
239
- this.filteredNodes = this.flatNodes.filter((flatNode) => {
239
+ this.filteredNodes = this.flatNodes.filter(flatNode => {
240
240
  const entry = flatNode.node.entry;
241
241
  const isCurrentLeaf = entry.id === this.currentLeafId;
242
242
 
@@ -289,7 +289,7 @@ class TreeList implements Component {
289
289
  // Apply search filter
290
290
  if (searchTokens.length > 0) {
291
291
  const nodeText = this.getSearchableText(flatNode.node).toLowerCase();
292
- return searchTokens.every((token) => nodeText.includes(token));
292
+ return searchTokens.every(token => nodeText.includes(token));
293
293
  }
294
294
 
295
295
  return true;
@@ -297,7 +297,7 @@ class TreeList implements Component {
297
297
 
298
298
  // Try to preserve cursor on the same node after filtering
299
299
  if (previouslySelectedId) {
300
- const newIndex = this.filteredNodes.findIndex((n) => n.node.entry.id === previouslySelectedId);
300
+ const newIndex = this.filteredNodes.findIndex(n => n.node.entry.id === previouslySelectedId);
301
301
  if (newIndex !== -1) {
302
302
  this.selectedIndex = newIndex;
303
303
  return;
@@ -442,7 +442,7 @@ class TreeList implements Component {
442
442
  const posInLevel = i % 3;
443
443
 
444
444
  // Check if there's a gutter at this level
445
- const gutter = flatNode.gutters.find((g) => g.position === level);
445
+ const gutter = flatNode.gutters.find(g => g.position === level);
446
446
  if (gutter) {
447
447
  if (posInLevel === 0) {
448
448
  prefixChars.push(gutter.show ? theme.tree.vertical : " ");
@@ -537,7 +537,7 @@ class TreeList implements Component {
537
537
  ? entry.content
538
538
  : entry.content
539
539
  .filter((c): c is { type: "text"; text: string } => c.type === "text")
540
- .map((c) => c.text)
540
+ .map(c => c.text)
541
541
  .join("");
542
542
  result = theme.fg("customMessageLabel", `[${entry.customType}]: `) + normalize(content);
543
543
  break;
@@ -713,7 +713,7 @@ class TreeList implements Component {
713
713
  this.onLabelEdit(selected.node.entry.id, selected.node.label);
714
714
  }
715
715
  } else {
716
- const hasControlChars = [...keyData].some((ch) => {
716
+ const hasControlChars = [...keyData].some(ch => {
717
717
  const code = ch.charCodeAt(0);
718
718
  return code < 32 || code === 0x7f || (code >= 0x80 && code <= 0x9f);
719
719
  });
@@ -764,7 +764,7 @@ class LabelInput implements Component {
764
764
  const indent = " ";
765
765
  const availableWidth = width - indent.length;
766
766
  lines.push(truncateToWidth(`${indent}${theme.fg("muted", "Label (empty to remove):")}`, width));
767
- lines.push(...this.input.render(availableWidth).map((line) => truncateToWidth(`${indent}${line}`, width)));
767
+ lines.push(...this.input.render(availableWidth).map(line => truncateToWidth(`${indent}${line}`, width)));
768
768
  lines.push(truncateToWidth(`${indent}${theme.fg("dim", "enter: save esc: cancel")}`, width));
769
769
  return lines;
770
770
  }
@@ -1,6 +1,6 @@
1
- import type { Rule } from "@oh-my-pi/pi-coding-agent/capability/rule";
2
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
1
  import { Box, Container, Spacer, Text } from "@oh-my-pi/pi-tui";
2
+ import type { Rule } from "../../capability/rule";
3
+ import { theme } from "../../modes/theme/theme";
4
4
 
5
5
  /**
6
6
  * Component that renders a TTSR (Time Traveling Stream Rules) notification.
@@ -18,7 +18,7 @@ export class TtsrNotificationComponent extends Container {
18
18
  this.addChild(new Spacer(1));
19
19
 
20
20
  // Use inverse warning color for yellow background effect
21
- this.box = new Box(1, 1, (t) => theme.inverse(theme.fg("warning", t)));
21
+ this.box = new Box(1, 1, t => theme.inverse(theme.fg("warning", t)));
22
22
  this.addChild(this.box);
23
23
 
24
24
  this.rebuild();
@@ -39,7 +39,7 @@ export class TtsrNotificationComponent extends Container {
39
39
  this.box.clear();
40
40
 
41
41
  // Build header: warning symbol + rule name + rewind icon
42
- const ruleNames = this.rules.map((r) => theme.bold(r.name)).join(", ");
42
+ const ruleNames = this.rules.map(r => theme.bold(r.name)).join(", ");
43
43
  const label = this.rules.length === 1 ? "rule" : "rules";
44
44
  const header = `${theme.icon.warning} Injecting ${label}: ${ruleNames}`;
45
45
 
@@ -70,7 +70,7 @@ export class TtsrNotificationComponent extends Container {
70
70
 
71
71
  // Show expand hint if collapsed and there's more content
72
72
  if (!this._expanded) {
73
- const hasMoreContent = this.rules.some((r) => {
73
+ const hasMoreContent = this.rules.some(r => {
74
74
  const desc = r.description || r.content;
75
75
  return desc && desc.split("\n").length > 2;
76
76
  });
@@ -1,5 +1,5 @@
1
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
1
  import { type Component, Container, matchesKey, Spacer, Text, truncateToWidth } from "@oh-my-pi/pi-tui";
2
+ import { theme } from "../../modes/theme/theme";
3
3
  import { DynamicBorder } from "./dynamic-border";
4
4
 
5
5
  interface UserMessageItem {
@@ -1,5 +1,5 @@
1
- import { getMarkdownTheme, theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
2
1
  import { Container, Markdown, Spacer } from "@oh-my-pi/pi-tui";
2
+ import { getMarkdownTheme, theme } from "../../modes/theme/theme";
3
3
 
4
4
  /**
5
5
  * Component that renders a user message
@@ -2,7 +2,6 @@
2
2
  * Shared utility for truncating text to visual lines (accounting for line wrapping).
3
3
  * Used by both tool-execution.ts and bash-execution.ts for consistent behavior.
4
4
  */
5
-
6
5
  import { Text } from "@oh-my-pi/pi-tui";
7
6
 
8
7
  export interface VisualTruncateResult {
@@ -1,6 +1,6 @@
1
- import { APP_NAME } from "@oh-my-pi/pi-coding-agent/config";
2
- import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
3
1
  import { type Component, truncateToWidth, visibleWidth } from "@oh-my-pi/pi-tui";
2
+ import { APP_NAME } from "../../config";
3
+ import { theme } from "../../modes/theme/theme";
4
4
 
5
5
  export interface RecentSession {
6
6
  name: string;
@@ -65,14 +65,14 @@ export class WelcomeComponent implements Component {
65
65
  const piLogo = ["▀████████████▀", " ╘███ ███ ", " ███ ███ ", " ███ ███ ", " ▄███▄ ▄███▄ "];
66
66
 
67
67
  // Apply gradient to logo
68
- const logoColored = piLogo.map((line) => this.gradientLine(line));
68
+ const logoColored = piLogo.map(line => this.gradientLine(line));
69
69
 
70
70
  // Left column - centered content
71
71
  const leftLines = [
72
72
  "",
73
73
  this.centerText(theme.bold("Welcome back!"), leftCol),
74
74
  "",
75
- ...logoColored.map((l) => this.centerText(l, leftCol)),
75
+ ...logoColored.map(l => this.centerText(l, leftCol)),
76
76
  "",
77
77
  this.centerText(theme.fg("muted", this.modelName), leftCol),
78
78
  this.centerText(theme.fg("borderMuted", this.providerName), leftCol),