@earendil-works/pi-coding-agent 0.87.1 → 0.99.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 (721) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/bun/cli.d.ts.map +1 -1
  3. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  4. package/dist/bun/restore-sandbox-env.js.map +1 -1
  5. package/dist/bun/runtime-setup.d.ts.map +1 -1
  6. package/dist/bun/runtime-setup.js +4 -1
  7. package/dist/bun/runtime-setup.js.map +1 -1
  8. package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
  9. package/dist/bundle/chunks/anthropic-messages-A6EXUBG6.js +6 -0
  10. package/dist/bundle/chunks/anthropic.js +2 -2
  11. package/dist/bundle/chunks/azure-openai-responses-EN5WOBET.js +2 -0
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  13. package/dist/bundle/chunks/chunk-4CSSZFEW.js +1435 -0
  14. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  15. package/dist/bundle/chunks/chunk-AXPY26X7.js +146 -0
  16. package/dist/bundle/chunks/chunk-EPDRUIU6.js +2 -0
  17. package/dist/bundle/chunks/chunk-GOPCREV2.js +4 -0
  18. package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
  19. package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-HSPCVFST.js} +1 -1
  20. package/dist/bundle/chunks/chunk-IMTXZUO7.js +82 -0
  21. package/dist/bundle/chunks/chunk-J4CWPC4N.js +2 -0
  22. package/dist/bundle/chunks/chunk-LLMKQWZS.js +21 -0
  23. package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-LRS5S6EK.js} +3 -3
  24. package/dist/bundle/chunks/chunk-PEHWOV5U.js +187 -0
  25. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  26. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  27. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
  28. package/dist/bundle/chunks/cli-AZXNGIZH.js +49 -0
  29. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XJQQYGGU.js +2 -0
  30. package/dist/bundle/chunks/codemode-worker.js +295 -0
  31. package/dist/bundle/chunks/execute-7XXPZAWW.js +308 -0
  32. package/dist/bundle/chunks/github-copilot.js +1 -1
  33. package/dist/bundle/chunks/google-generative-ai-CQAKKJTA.js +2 -0
  34. package/dist/bundle/chunks/google-vertex-AE36YXJU.js +2 -0
  35. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
  36. package/dist/bundle/chunks/llama-cpp-classify-PJJYKPLD.js +22 -0
  37. package/dist/bundle/chunks/mistral-conversations-KEYTXJM7.js +5 -0
  38. package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-JQTCOVEG.js} +2 -2
  39. package/dist/bundle/chunks/openai-codex.js +2 -2
  40. package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-XW2Q5HVC.js} +2 -2
  41. package/dist/bundle/chunks/openai-responses-6AXWFL75.js +3 -0
  42. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
  43. package/dist/bundle/chunks/openrouter.js +2 -2
  44. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  45. package/dist/bundle/chunks/radius.js +2 -2
  46. package/dist/bundle/chunks/runtime-G5WJPRBM.js +2 -0
  47. package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
  48. package/dist/bundle/chunks/virtual-modules-AQ3FLU6H.js +2 -0
  49. package/dist/bundle/cli-runtime.js +1 -1
  50. package/dist/bundle/index.js +1 -1
  51. package/dist/bundle/rpc-entry.js +1 -1
  52. package/dist/cli/args.d.ts.map +1 -1
  53. package/dist/cli/args.js +4 -3
  54. package/dist/cli/args.js.map +1 -1
  55. package/dist/cli/auth-check.d.ts.map +1 -1
  56. package/dist/cli/auth-check.js.map +1 -1
  57. package/dist/cli/auth-command.d.ts.map +1 -1
  58. package/dist/cli/auth-command.js.map +1 -1
  59. package/dist/cli/config-selector.d.ts.map +1 -1
  60. package/dist/cli/config-selector.js.map +1 -1
  61. package/dist/cli/credential-print.d.ts.map +1 -1
  62. package/dist/cli/credential-print.js.map +1 -1
  63. package/dist/cli/file-processor.d.ts.map +1 -1
  64. package/dist/cli/file-processor.js.map +1 -1
  65. package/dist/cli/initial-message.d.ts +1 -1
  66. package/dist/cli/initial-message.d.ts.map +1 -1
  67. package/dist/cli/initial-message.js.map +1 -1
  68. package/dist/cli/list-models.d.ts.map +1 -1
  69. package/dist/cli/list-models.js.map +1 -1
  70. package/dist/cli/project-trust.d.ts.map +1 -1
  71. package/dist/cli/project-trust.js.map +1 -1
  72. package/dist/cli/session-picker.d.ts.map +1 -1
  73. package/dist/cli/session-picker.js.map +1 -1
  74. package/dist/cli/setup.d.ts.map +1 -1
  75. package/dist/cli/setup.js.map +1 -1
  76. package/dist/cli/startup-ui.d.ts.map +1 -1
  77. package/dist/cli/startup-ui.js +38 -30
  78. package/dist/cli/startup-ui.js.map +1 -1
  79. package/dist/cli.d.ts.map +1 -1
  80. package/dist/config.d.ts +18 -4
  81. package/dist/config.d.ts.map +1 -1
  82. package/dist/config.js +30 -4
  83. package/dist/config.js.map +1 -1
  84. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  85. package/dist/core/agent-session-runtime.js +1 -1
  86. package/dist/core/agent-session-runtime.js.map +1 -1
  87. package/dist/core/agent-session-services.d.ts.map +1 -1
  88. package/dist/core/agent-session-services.js +13 -0
  89. package/dist/core/agent-session-services.js.map +1 -1
  90. package/dist/core/agent-session.d.ts +135 -11
  91. package/dist/core/agent-session.d.ts.map +1 -1
  92. package/dist/core/agent-session.js +509 -253
  93. package/dist/core/agent-session.js.map +1 -1
  94. package/dist/core/auth-guidance.d.ts.map +1 -1
  95. package/dist/core/auth-guidance.js.map +1 -1
  96. package/dist/core/auth-storage.d.ts.map +1 -1
  97. package/dist/core/auth-storage.js.map +1 -1
  98. package/dist/core/bash-executor.d.ts.map +1 -1
  99. package/dist/core/bash-executor.js.map +1 -1
  100. package/dist/core/bug-report-upload.d.ts.map +1 -1
  101. package/dist/core/bug-report-upload.js.map +1 -1
  102. package/dist/core/bug-report.d.ts +1 -1
  103. package/dist/core/bug-report.d.ts.map +1 -1
  104. package/dist/core/bug-report.js +1 -1
  105. package/dist/core/bug-report.js.map +1 -1
  106. package/dist/core/cache-stats.d.ts.map +1 -1
  107. package/dist/core/cache-stats.js.map +1 -1
  108. package/dist/core/cache-warmer.d.ts.map +1 -1
  109. package/dist/core/cache-warmer.js.map +1 -1
  110. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  111. package/dist/core/compaction/branch-summarization.js.map +1 -1
  112. package/dist/core/compaction/compaction.d.ts.map +1 -1
  113. package/dist/core/compaction/compaction.js +1 -22
  114. package/dist/core/compaction/compaction.js.map +1 -1
  115. package/dist/core/compaction/index.d.ts.map +1 -1
  116. package/dist/core/compaction/utils.d.ts +2 -1
  117. package/dist/core/compaction/utils.d.ts.map +1 -1
  118. package/dist/core/compaction/utils.js +25 -18
  119. package/dist/core/compaction/utils.js.map +1 -1
  120. package/dist/core/crash-log.d.ts.map +1 -1
  121. package/dist/core/crash-log.js +2 -1
  122. package/dist/core/crash-log.js.map +1 -1
  123. package/dist/core/defaults.d.ts.map +1 -1
  124. package/dist/core/diagnostics.d.ts.map +1 -1
  125. package/dist/core/event-bus.d.ts.map +1 -1
  126. package/dist/core/event-bus.js.map +1 -1
  127. package/dist/core/exec.d.ts.map +1 -1
  128. package/dist/core/exec.js.map +1 -1
  129. package/dist/core/experimental.d.ts.map +1 -1
  130. package/dist/core/experimental.js.map +1 -1
  131. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  132. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  133. package/dist/core/export-html/index.d.ts.map +1 -1
  134. package/dist/core/export-html/index.js.map +1 -1
  135. package/dist/core/export-html/template.css +10 -0
  136. package/dist/core/export-html/template.js +66 -17
  137. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  138. package/dist/core/export-html/tool-renderer.js.map +1 -1
  139. package/dist/core/extensions/index.d.ts +1 -1
  140. package/dist/core/extensions/index.d.ts.map +1 -1
  141. package/dist/core/extensions/index.js.map +1 -1
  142. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  143. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  144. package/dist/core/extensions/loader.d.ts.map +1 -1
  145. package/dist/core/extensions/loader.js +55 -5
  146. package/dist/core/extensions/loader.js.map +1 -1
  147. package/dist/core/extensions/runner.d.ts +18 -1
  148. package/dist/core/extensions/runner.d.ts.map +1 -1
  149. package/dist/core/extensions/runner.js +99 -0
  150. package/dist/core/extensions/runner.js.map +1 -1
  151. package/dist/core/extensions/types.d.ts +296 -22
  152. package/dist/core/extensions/types.d.ts.map +1 -1
  153. package/dist/core/extensions/types.js.map +1 -1
  154. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  155. package/dist/core/extensions/wrapper.d.ts +2 -2
  156. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  157. package/dist/core/extensions/wrapper.js +3 -3
  158. package/dist/core/extensions/wrapper.js.map +1 -1
  159. package/dist/core/footer-data-provider.d.ts.map +1 -1
  160. package/dist/core/footer-data-provider.js.map +1 -1
  161. package/dist/core/http-dispatcher.d.ts.map +1 -1
  162. package/dist/core/http-dispatcher.js.map +1 -1
  163. package/dist/core/index.d.ts.map +1 -1
  164. package/dist/core/keybindings.d.ts +1 -1
  165. package/dist/core/keybindings.d.ts.map +1 -1
  166. package/dist/core/keybindings.js +1 -1
  167. package/dist/core/keybindings.js.map +1 -1
  168. package/dist/core/mcp-servers.d.ts +98 -0
  169. package/dist/core/mcp-servers.d.ts.map +1 -0
  170. package/dist/core/mcp-servers.js +157 -0
  171. package/dist/core/mcp-servers.js.map +1 -0
  172. package/dist/core/messages.d.ts.map +1 -1
  173. package/dist/core/messages.js.map +1 -1
  174. package/dist/core/model-config.d.ts.map +1 -1
  175. package/dist/core/model-config.js.map +1 -1
  176. package/dist/core/model-registry.d.ts +13 -1
  177. package/dist/core/model-registry.d.ts.map +1 -1
  178. package/dist/core/model-registry.js +25 -0
  179. package/dist/core/model-registry.js.map +1 -1
  180. package/dist/core/model-resolver.d.ts +2 -2
  181. package/dist/core/model-resolver.d.ts.map +1 -1
  182. package/dist/core/model-resolver.js +4 -4
  183. package/dist/core/model-resolver.js.map +1 -1
  184. package/dist/core/model-runtime.d.ts +41 -3
  185. package/dist/core/model-runtime.d.ts.map +1 -1
  186. package/dist/core/model-runtime.js +167 -17
  187. package/dist/core/model-runtime.js.map +1 -1
  188. package/dist/core/models-store.d.ts.map +1 -1
  189. package/dist/core/models-store.js.map +1 -1
  190. package/dist/core/nested-tool-calls.d.ts +102 -0
  191. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  192. package/dist/core/nested-tool-calls.js +178 -0
  193. package/dist/core/nested-tool-calls.js.map +1 -0
  194. package/dist/core/output-guard.d.ts.map +1 -1
  195. package/dist/core/output-guard.js.map +1 -1
  196. package/dist/core/package-manager.d.ts +4 -0
  197. package/dist/core/package-manager.d.ts.map +1 -1
  198. package/dist/core/package-manager.js +59 -12
  199. package/dist/core/package-manager.js.map +1 -1
  200. package/dist/core/pi-manifest.d.ts.map +1 -1
  201. package/dist/core/pi-manifest.js.map +1 -1
  202. package/dist/core/project-trust.d.ts.map +1 -1
  203. package/dist/core/project-trust.js.map +1 -1
  204. package/dist/core/prompt-templates.d.ts.map +1 -1
  205. package/dist/core/prompt-templates.js.map +1 -1
  206. package/dist/core/provider-attribution.d.ts.map +1 -1
  207. package/dist/core/provider-attribution.js.map +1 -1
  208. package/dist/core/provider-composer.d.ts +40 -21
  209. package/dist/core/provider-composer.d.ts.map +1 -1
  210. package/dist/core/provider-composer.js +92 -40
  211. package/dist/core/provider-composer.js.map +1 -1
  212. package/dist/core/radius.d.ts.map +1 -1
  213. package/dist/core/radius.js.map +1 -1
  214. package/dist/core/remote-catalog-provider.d.ts +8 -1
  215. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  216. package/dist/core/remote-catalog-provider.js +18 -3
  217. package/dist/core/remote-catalog-provider.js.map +1 -1
  218. package/dist/core/resolve-config-value.d.ts.map +1 -1
  219. package/dist/core/resolve-config-value.js.map +1 -1
  220. package/dist/core/resource-loader.d.ts +7 -1
  221. package/dist/core/resource-loader.d.ts.map +1 -1
  222. package/dist/core/resource-loader.js +161 -35
  223. package/dist/core/resource-loader.js.map +1 -1
  224. package/dist/core/runtime-credentials.d.ts.map +1 -1
  225. package/dist/core/runtime-credentials.js.map +1 -1
  226. package/dist/core/sdk.d.ts +1 -1
  227. package/dist/core/sdk.d.ts.map +1 -1
  228. package/dist/core/sdk.js +24 -6
  229. package/dist/core/sdk.js.map +1 -1
  230. package/dist/core/session-cwd.d.ts.map +1 -1
  231. package/dist/core/session-cwd.js.map +1 -1
  232. package/dist/core/session-export.d.ts.map +1 -1
  233. package/dist/core/session-export.js.map +1 -1
  234. package/dist/core/session-manager.d.ts +9 -0
  235. package/dist/core/session-manager.d.ts.map +1 -1
  236. package/dist/core/session-manager.js +22 -22
  237. package/dist/core/session-manager.js.map +1 -1
  238. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  239. package/dist/core/settings-diagnostics.js.map +1 -1
  240. package/dist/core/settings-manager.d.ts +31 -1
  241. package/dist/core/settings-manager.d.ts.map +1 -1
  242. package/dist/core/settings-manager.js +72 -2
  243. package/dist/core/settings-manager.js.map +1 -1
  244. package/dist/core/skills.d.ts.map +1 -1
  245. package/dist/core/skills.js.map +1 -1
  246. package/dist/core/slash-commands.d.ts.map +1 -1
  247. package/dist/core/source-info.d.ts +8 -0
  248. package/dist/core/source-info.d.ts.map +1 -1
  249. package/dist/core/source-info.js +16 -0
  250. package/dist/core/source-info.js.map +1 -1
  251. package/dist/core/system-prompt.d.ts.map +1 -1
  252. package/dist/core/system-prompt.js +1 -1
  253. package/dist/core/system-prompt.js.map +1 -1
  254. package/dist/core/telemetry.d.ts.map +1 -1
  255. package/dist/core/telemetry.js.map +1 -1
  256. package/dist/core/timings.d.ts.map +1 -1
  257. package/dist/core/timings.js.map +1 -1
  258. package/dist/core/tools/bash.d.ts +12 -0
  259. package/dist/core/tools/bash.d.ts.map +1 -1
  260. package/dist/core/tools/bash.js +35 -2
  261. package/dist/core/tools/bash.js.map +1 -1
  262. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  263. package/dist/core/tools/edit-diff.js.map +1 -1
  264. package/dist/core/tools/edit.d.ts.map +1 -1
  265. package/dist/core/tools/edit.js.map +1 -1
  266. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  267. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  268. package/dist/core/tools/find.d.ts.map +1 -1
  269. package/dist/core/tools/find.js.map +1 -1
  270. package/dist/core/tools/grep.d.ts.map +1 -1
  271. package/dist/core/tools/grep.js.map +1 -1
  272. package/dist/core/tools/index.d.ts.map +1 -1
  273. package/dist/core/tools/index.js.map +1 -1
  274. package/dist/core/tools/ls.d.ts.map +1 -1
  275. package/dist/core/tools/ls.js.map +1 -1
  276. package/dist/core/tools/output-accumulator.d.ts +11 -0
  277. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  278. package/dist/core/tools/output-accumulator.js +36 -0
  279. package/dist/core/tools/output-accumulator.js.map +1 -1
  280. package/dist/core/tools/path-utils.d.ts.map +1 -1
  281. package/dist/core/tools/path-utils.js.map +1 -1
  282. package/dist/core/tools/powershell.d.ts.map +1 -1
  283. package/dist/core/tools/powershell.js.map +1 -1
  284. package/dist/core/tools/read.d.ts.map +1 -1
  285. package/dist/core/tools/read.js.map +1 -1
  286. package/dist/core/tools/render-utils.d.ts +6 -0
  287. package/dist/core/tools/render-utils.d.ts.map +1 -1
  288. package/dist/core/tools/render-utils.js +26 -0
  289. package/dist/core/tools/render-utils.js.map +1 -1
  290. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  291. package/dist/core/tools/renderers/bash.js +9 -10
  292. package/dist/core/tools/renderers/bash.js.map +1 -1
  293. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  294. package/dist/core/tools/renderers/edit.js.map +1 -1
  295. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  296. package/dist/core/tools/renderers/find.js.map +1 -1
  297. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  298. package/dist/core/tools/renderers/grep.js.map +1 -1
  299. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  300. package/dist/core/tools/renderers/index.js.map +1 -1
  301. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  302. package/dist/core/tools/renderers/ls.js.map +1 -1
  303. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  304. package/dist/core/tools/renderers/read.js +3 -2
  305. package/dist/core/tools/renderers/read.js.map +1 -1
  306. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  307. package/dist/core/tools/renderers/write.js.map +1 -1
  308. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  309. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  310. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  311. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  312. package/dist/core/tools/truncate.d.ts +14 -0
  313. package/dist/core/tools/truncate.d.ts.map +1 -1
  314. package/dist/core/tools/truncate.js +29 -0
  315. package/dist/core/tools/truncate.js.map +1 -1
  316. package/dist/core/tools/write.d.ts.map +1 -1
  317. package/dist/core/tools/write.js.map +1 -1
  318. package/dist/core/trust-manager.d.ts.map +1 -1
  319. package/dist/core/trust-manager.js +1 -0
  320. package/dist/core/trust-manager.js.map +1 -1
  321. package/dist/core/usage-totals.d.ts +2 -0
  322. package/dist/core/usage-totals.d.ts.map +1 -1
  323. package/dist/core/usage-totals.js +23 -0
  324. package/dist/core/usage-totals.js.map +1 -1
  325. package/dist/core/virtual-models.d.ts +115 -0
  326. package/dist/core/virtual-models.d.ts.map +1 -0
  327. package/dist/core/virtual-models.js +117 -0
  328. package/dist/core/virtual-models.js.map +1 -0
  329. package/dist/extensions/codemode/execute.d.ts +16 -0
  330. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  331. package/dist/extensions/codemode/execute.js +390 -0
  332. package/dist/extensions/codemode/execute.js.map +1 -0
  333. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  334. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  335. package/dist/extensions/codemode/execute.lazy.js +3 -0
  336. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  337. package/dist/extensions/codemode/index.d.ts +21 -0
  338. package/dist/extensions/codemode/index.d.ts.map +1 -0
  339. package/dist/extensions/codemode/index.js +31 -0
  340. package/dist/extensions/codemode/index.js.map +1 -0
  341. package/dist/extensions/codemode/renderer.d.ts +12 -0
  342. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  343. package/dist/extensions/codemode/renderer.js +119 -0
  344. package/dist/extensions/codemode/renderer.js.map +1 -0
  345. package/dist/extensions/codemode/tool.d.ts +122 -0
  346. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  347. package/dist/extensions/codemode/tool.js +324 -0
  348. package/dist/extensions/codemode/tool.js.map +1 -0
  349. package/dist/extensions/codemode/worker.d.ts +7 -0
  350. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  351. package/dist/extensions/codemode/worker.js +7 -0
  352. package/dist/extensions/codemode/worker.js.map +1 -0
  353. package/dist/extensions/index.d.ts.map +1 -1
  354. package/dist/extensions/index.js +11 -1
  355. package/dist/extensions/index.js.map +1 -1
  356. package/dist/extensions/llama/client.d.ts.map +1 -1
  357. package/dist/extensions/llama/client.js.map +1 -1
  358. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  359. package/dist/extensions/llama/huggingface.js.map +1 -1
  360. package/dist/extensions/llama/index.d.ts.map +1 -1
  361. package/dist/extensions/llama/index.js.map +1 -1
  362. package/dist/extensions/llama/provider.d.ts +1 -1
  363. package/dist/extensions/llama/provider.d.ts.map +1 -1
  364. package/dist/extensions/llama/provider.js +65 -13
  365. package/dist/extensions/llama/provider.js.map +1 -1
  366. package/dist/extensions/llama/ui.d.ts.map +1 -1
  367. package/dist/extensions/llama/ui.js.map +1 -1
  368. package/dist/extensions/mcp/cli.d.ts +21 -0
  369. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  370. package/dist/extensions/mcp/cli.js +485 -0
  371. package/dist/extensions/mcp/cli.js.map +1 -0
  372. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  373. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  374. package/dist/extensions/mcp/cli.lazy.js +3 -0
  375. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  376. package/dist/extensions/mcp/config.d.ts +70 -0
  377. package/dist/extensions/mcp/config.d.ts.map +1 -0
  378. package/dist/extensions/mcp/config.js +146 -0
  379. package/dist/extensions/mcp/config.js.map +1 -0
  380. package/dist/extensions/mcp/index.d.ts +52 -0
  381. package/dist/extensions/mcp/index.d.ts.map +1 -0
  382. package/dist/extensions/mcp/index.js +902 -0
  383. package/dist/extensions/mcp/index.js.map +1 -0
  384. package/dist/extensions/mcp/log.d.ts +16 -0
  385. package/dist/extensions/mcp/log.d.ts.map +1 -0
  386. package/dist/extensions/mcp/log.js +66 -0
  387. package/dist/extensions/mcp/log.js.map +1 -0
  388. package/dist/extensions/mcp/oauth.d.ts +94 -0
  389. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  390. package/dist/extensions/mcp/oauth.js +333 -0
  391. package/dist/extensions/mcp/oauth.js.map +1 -0
  392. package/dist/extensions/mcp/resources.d.ts +43 -0
  393. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  394. package/dist/extensions/mcp/resources.js +262 -0
  395. package/dist/extensions/mcp/resources.js.map +1 -0
  396. package/dist/extensions/mcp/runtime.d.ts +96 -0
  397. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  398. package/dist/extensions/mcp/runtime.js +388 -0
  399. package/dist/extensions/mcp/runtime.js.map +1 -0
  400. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  401. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  402. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  403. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  404. package/dist/extensions/mcp/tools.d.ts +83 -0
  405. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  406. package/dist/extensions/mcp/tools.js +233 -0
  407. package/dist/extensions/mcp/tools.js.map +1 -0
  408. package/dist/extensions/mcp/ui.d.ts +60 -0
  409. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  410. package/dist/extensions/mcp/ui.js +172 -0
  411. package/dist/extensions/mcp/ui.js.map +1 -0
  412. package/dist/extensions/tool-search/index.d.ts +12 -0
  413. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  414. package/dist/extensions/tool-search/index.js +15 -0
  415. package/dist/extensions/tool-search/index.js.map +1 -0
  416. package/dist/extensions/tool-search/tool.d.ts +72 -0
  417. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  418. package/dist/extensions/tool-search/tool.js +210 -0
  419. package/dist/extensions/tool-search/tool.js.map +1 -0
  420. package/dist/index.d.ts +9 -2
  421. package/dist/index.d.ts.map +1 -1
  422. package/dist/index.js +5 -0
  423. package/dist/index.js.map +1 -1
  424. package/dist/main.d.ts.map +1 -1
  425. package/dist/main.js +10 -0
  426. package/dist/main.js.map +1 -1
  427. package/dist/migrations.d.ts.map +1 -1
  428. package/dist/migrations.js.map +1 -1
  429. package/dist/modes/index.d.ts.map +1 -1
  430. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  431. package/dist/modes/interactive/bug-report.js.map +1 -1
  432. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  433. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  434. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  435. package/dist/modes/interactive/components/armin.js.map +1 -1
  436. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  437. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  438. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  440. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  441. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  442. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  443. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  444. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  445. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  446. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  447. package/dist/modes/interactive/components/config-selector.js +13 -3
  448. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  449. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  450. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  451. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  452. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  453. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  454. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  455. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  456. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  457. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  458. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  459. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  460. package/dist/modes/interactive/components/diff.js.map +1 -1
  461. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  462. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  463. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  464. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  465. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  466. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  467. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  468. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  469. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  470. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  471. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  472. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  473. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  474. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  475. package/dist/modes/interactive/components/footer.d.ts +7 -0
  476. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/footer.js +43 -3
  478. package/dist/modes/interactive/components/footer.js.map +1 -1
  479. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  480. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  482. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  483. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  484. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  485. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  486. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  487. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  488. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  489. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  490. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  492. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  493. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  494. package/dist/modes/interactive/components/pi-logo.js +25 -0
  495. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  496. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  497. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  498. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  499. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  500. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  501. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  502. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  503. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  504. package/dist/modes/interactive/components/settings-selector.js +28 -6
  505. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  506. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  508. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  509. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  510. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  512. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  513. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  514. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  516. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  517. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  518. package/dist/modes/interactive/components/themed-text.js +29 -0
  519. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  520. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  521. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  522. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/tool-execution.js +2 -2
  524. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  525. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  527. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  528. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  529. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  531. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  532. package/dist/modes/interactive/components/user-message.js.map +1 -1
  533. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  535. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  536. package/dist/modes/interactive/external-editor.js.map +1 -1
  537. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  538. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  539. package/dist/modes/interactive/interactive-mode.js +199 -161
  540. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  541. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  542. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  543. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  544. package/dist/modes/interactive/model-search.js.map +1 -1
  545. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  546. package/dist/modes/interactive/session-share.js.map +1 -1
  547. package/dist/modes/interactive/theme/dark.json +59 -72
  548. package/dist/modes/interactive/theme/light.json +57 -69
  549. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  550. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  551. package/dist/modes/interactive/theme/system-theme.js +535 -0
  552. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  553. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  554. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  555. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  556. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  557. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  558. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  559. package/dist/modes/interactive/theme/theme-json.js +3 -1
  560. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  561. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  562. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  563. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  564. package/dist/modes/interactive/theme/theme.js +238 -317
  565. package/dist/modes/interactive/theme/theme.js.map +1 -1
  566. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  567. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  568. package/dist/modes/interactive/tui-renderer.js +1 -0
  569. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  570. package/dist/modes/json-event.d.ts.map +1 -1
  571. package/dist/modes/json-event.js.map +1 -1
  572. package/dist/modes/print-mode.d.ts.map +1 -1
  573. package/dist/modes/print-mode.js.map +1 -1
  574. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  575. package/dist/modes/rpc/jsonl.js.map +1 -1
  576. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  577. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  578. package/dist/modes/rpc/rpc-client.js +12 -8
  579. package/dist/modes/rpc/rpc-client.js.map +1 -1
  580. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  581. package/dist/modes/rpc/rpc-mode.js +7 -9
  582. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  583. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  584. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  585. package/dist/modes/rpc/rpc-types.js.map +1 -1
  586. package/dist/package-manager-cli.d.ts.map +1 -1
  587. package/dist/package-manager-cli.js +6 -2
  588. package/dist/package-manager-cli.js.map +1 -1
  589. package/dist/rpc-entry.d.ts.map +1 -1
  590. package/dist/rpc-entry.js.map +1 -1
  591. package/dist/utils/abort.d.ts.map +1 -1
  592. package/dist/utils/abort.js.map +1 -1
  593. package/dist/utils/ansi.d.ts.map +1 -1
  594. package/dist/utils/ansi.js.map +1 -1
  595. package/dist/utils/changelog.d.ts.map +1 -1
  596. package/dist/utils/changelog.js.map +1 -1
  597. package/dist/utils/child-process.d.ts.map +1 -1
  598. package/dist/utils/child-process.js.map +1 -1
  599. package/dist/utils/clipboard-command.d.ts.map +1 -1
  600. package/dist/utils/clipboard-command.js.map +1 -1
  601. package/dist/utils/clipboard-image.d.ts.map +1 -1
  602. package/dist/utils/clipboard-image.js +14 -17
  603. package/dist/utils/clipboard-image.js.map +1 -1
  604. package/dist/utils/clipboard.d.ts +2 -0
  605. package/dist/utils/clipboard.d.ts.map +1 -1
  606. package/dist/utils/clipboard.js +5 -0
  607. package/dist/utils/clipboard.js.map +1 -1
  608. package/dist/utils/deprecation.d.ts.map +1 -1
  609. package/dist/utils/deprecation.js.map +1 -1
  610. package/dist/utils/exif-orientation.d.ts.map +1 -1
  611. package/dist/utils/exif-orientation.js.map +1 -1
  612. package/dist/utils/frontmatter.d.ts.map +1 -1
  613. package/dist/utils/frontmatter.js.map +1 -1
  614. package/dist/utils/fs-watch.d.ts.map +1 -1
  615. package/dist/utils/fs-watch.js.map +1 -1
  616. package/dist/utils/git.d.ts.map +1 -1
  617. package/dist/utils/git.js.map +1 -1
  618. package/dist/utils/html.d.ts.map +1 -1
  619. package/dist/utils/html.js.map +1 -1
  620. package/dist/utils/image-convert.d.ts.map +1 -1
  621. package/dist/utils/image-convert.js.map +1 -1
  622. package/dist/utils/image-process.d.ts.map +1 -1
  623. package/dist/utils/image-process.js.map +1 -1
  624. package/dist/utils/image-resize-core.d.ts.map +1 -1
  625. package/dist/utils/image-resize-core.js.map +1 -1
  626. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  627. package/dist/utils/image-resize-worker.js.map +1 -1
  628. package/dist/utils/image-resize.d.ts.map +1 -1
  629. package/dist/utils/image-resize.js.map +1 -1
  630. package/dist/utils/json.d.ts.map +1 -1
  631. package/dist/utils/json.js.map +1 -1
  632. package/dist/utils/management-http.d.ts.map +1 -1
  633. package/dist/utils/management-http.js.map +1 -1
  634. package/dist/utils/mime.d.ts.map +1 -1
  635. package/dist/utils/mime.js.map +1 -1
  636. package/dist/utils/open-browser.d.ts.map +1 -1
  637. package/dist/utils/open-browser.js.map +1 -1
  638. package/dist/utils/paths.d.ts +3 -3
  639. package/dist/utils/paths.d.ts.map +1 -1
  640. package/dist/utils/paths.js +5 -4
  641. package/dist/utils/paths.js.map +1 -1
  642. package/dist/utils/photon.d.ts.map +1 -1
  643. package/dist/utils/photon.js.map +1 -1
  644. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  645. package/dist/utils/pi-user-agent.js.map +1 -1
  646. package/dist/utils/shell.d.ts +1 -3
  647. package/dist/utils/shell.d.ts.map +1 -1
  648. package/dist/utils/shell.js +3 -30
  649. package/dist/utils/shell.js.map +1 -1
  650. package/dist/utils/sleep.d.ts.map +1 -1
  651. package/dist/utils/sleep.js.map +1 -1
  652. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  653. package/dist/utils/syntax-highlight.js +2 -0
  654. package/dist/utils/syntax-highlight.js.map +1 -1
  655. package/dist/utils/text.d.ts.map +1 -1
  656. package/dist/utils/text.js.map +1 -1
  657. package/dist/utils/tool-result-images.d.ts.map +1 -1
  658. package/dist/utils/tool-result-images.js.map +1 -1
  659. package/dist/utils/tools-manager.d.ts.map +1 -1
  660. package/dist/utils/tools-manager.js.map +1 -1
  661. package/dist/utils/version-check.d.ts.map +1 -1
  662. package/dist/utils/version-check.js.map +1 -1
  663. package/dist/utils/windows-self-update.d.ts.map +1 -1
  664. package/dist/utils/windows-self-update.js.map +1 -1
  665. package/dist/utils/wsl.d.ts.map +1 -1
  666. package/dist/utils/wsl.js.map +1 -1
  667. package/dist/utils/zip.d.ts.map +1 -1
  668. package/dist/utils/zip.js.map +1 -1
  669. package/docs/cli.md +64 -3
  670. package/docs/configuration.md +2 -0
  671. package/docs/custom-provider.md +43 -4
  672. package/docs/docs.json +8 -0
  673. package/docs/extensions.md +55 -0
  674. package/docs/keybindings.md +1 -1
  675. package/docs/llama-cpp.md +13 -0
  676. package/docs/mcp.md +188 -0
  677. package/docs/models.md +35 -0
  678. package/docs/packages.md +4 -2
  679. package/docs/providers.md +1 -0
  680. package/docs/rpc-commands.md +9 -3
  681. package/docs/rpc.md +3 -1
  682. package/docs/sdk.md +7 -2
  683. package/docs/security.md +2 -0
  684. package/docs/session-format.md +5 -1
  685. package/docs/settings.md +20 -3
  686. package/docs/themes.md +33 -7
  687. package/docs/tui.md +18 -0
  688. package/docs/virtual-models.md +114 -0
  689. package/docs/windows.md +2 -0
  690. package/examples/README.md +1 -1
  691. package/examples/extensions/README.md +2 -0
  692. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  693. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  694. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  695. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  696. package/examples/extensions/debug-provider.ts +90 -0
  697. package/examples/extensions/gondolin/package-lock.json +2 -2
  698. package/examples/extensions/gondolin/package.json +1 -1
  699. package/examples/extensions/jev-router.ts +113 -0
  700. package/examples/extensions/sandbox/package-lock.json +2 -2
  701. package/examples/extensions/sandbox/package.json +1 -1
  702. package/examples/extensions/with-deps/package-lock.json +2 -2
  703. package/examples/extensions/with-deps/package.json +1 -1
  704. package/examples/rpc-client.ts +1 -1
  705. package/examples/rpc-extension-ui.ts +1 -1
  706. package/examples/sdk/14-codemode-mcp.ts +61 -0
  707. package/examples/sdk/README.md +2 -1
  708. package/npm-shrinkwrap.json +89 -39
  709. package/package.json +14 -12
  710. package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
  711. package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
  712. package/dist/bundle/chunks/chunk-65HAU2C5.js +0 -2
  713. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  714. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  715. package/dist/bundle/chunks/chunk-OJP47DM6.js +0 -1568
  716. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  717. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  718. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  719. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  720. package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +0 -2
  721. package/dist/bundle/chunks/virtual-modules-VHMJYYWQ.js +0 -2
@@ -33,7 +33,7 @@ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
33
33
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
34
34
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
35
35
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
36
- import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
36
+ import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
37
37
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
38
38
  import { parseGitUrl } from "../../utils/git.js";
39
39
  import { getCwdRelativePath } from "../../utils/paths.js";
@@ -64,11 +64,13 @@ import { LoginDialogComponent } from "./components/login-dialog.js";
64
64
  import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
65
65
  import { ModelSelectorComponent } from "./components/model-selector.js";
66
66
  import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
67
+ import { piLogoLines } from "./components/pi-logo.js";
67
68
  import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
68
69
  import { SessionSelectorComponent } from "./components/session-selector.js";
69
70
  import { SettingsSelectorComponent } from "./components/settings-selector.js";
70
71
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
71
72
  import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
73
+ import { ThemedText } from "./components/themed-text.js";
72
74
  import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
73
75
  import { ToolExecutionComponent } from "./components/tool-execution.js";
74
76
  import { TreeSelectorComponent } from "./components/tree-selector.js";
@@ -79,7 +81,7 @@ import { editInExternalEditor } from "./external-editor.js";
79
81
  import { refreshModelCatalogs } from "./model-catalog-refresh.js";
80
82
  import { getModelSearchText } from "./model-search.js";
81
83
  import { shareSession } from "./session-share.js";
82
- import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
84
+ import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
83
85
  import { InteractiveThemeController } from "./theme/theme-controller.js";
84
86
  import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
85
87
  export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
@@ -92,16 +94,16 @@ function isWorkingStatusEditor(editor) {
92
94
  function isExpandable(obj) {
93
95
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
94
96
  }
95
- class ExpandableText extends Text {
96
- getCollapsedText;
97
- getExpandedText;
97
+ class ExpandableText extends ThemedText {
98
+ state;
98
99
  constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
99
- super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
100
- this.getCollapsedText = getCollapsedText;
101
- this.getExpandedText = getExpandedText;
100
+ const state = { expanded };
101
+ super(() => (state.expanded ? getExpandedText() : getCollapsedText()), paddingX, paddingY);
102
+ this.state = state;
102
103
  }
103
104
  setExpanded(expanded) {
104
- this.setText(expanded ? this.getExpandedText() : this.getCollapsedText());
105
+ this.state.expanded = expanded;
106
+ this.invalidate();
105
107
  }
106
108
  }
107
109
  function isCustomSessionEntry(item) {
@@ -256,6 +258,7 @@ export class InteractiveMode {
256
258
  // Status line tracking (for mutating immediately-sequential status updates)
257
259
  lastStatusSpacer = undefined;
258
260
  lastStatusText = undefined;
261
+ lastStatusMessage = "";
259
262
  managedToolStatusStarted = false;
260
263
  // Streaming message tracking
261
264
  streamingComponent = undefined;
@@ -341,7 +344,7 @@ export class InteractiveMode {
341
344
  });
342
345
  this.runtimeHost.setRebindSession(async () => {
343
346
  await this.rebindCurrentSession({ renderBeforeBind: true });
344
- await this.themeController.applyFromSettings();
347
+ this.themeController.applyFromSettings();
345
348
  });
346
349
  this.version = VERSION;
347
350
  this.renderer = createInteractiveTui({
@@ -351,6 +354,7 @@ export class InteractiveMode {
351
354
  terminal: options.terminal,
352
355
  onRightClickPaste: this.onRightClickPaste,
353
356
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
357
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
354
358
  });
355
359
  this.ui = createInteractiveTuiReference(() => this.renderer);
356
360
  this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
@@ -395,7 +399,8 @@ export class InteractiveMode {
395
399
  });
396
400
  }
397
401
  getAutocompleteSourceTag(sourceInfo) {
398
- if (!sourceInfo) {
402
+ // Built-in extension commands are untagged, like built-in commands.
403
+ if (!sourceInfo || sourceInfo.source === "builtin") {
399
404
  return undefined;
400
405
  }
401
406
  const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
@@ -548,7 +553,7 @@ export class InteractiveMode {
548
553
  this.chatContainer.addChild(new Text(condensedText, 1, 0));
549
554
  }
550
555
  else {
551
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
556
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
552
557
  this.chatContainer.addChild(new Spacer(1));
553
558
  this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
554
559
  this.chatContainer.addChild(new Spacer(1));
@@ -600,6 +605,7 @@ export class InteractiveMode {
600
605
  terminal,
601
606
  onRightClickPaste: this.onRightClickPaste,
602
607
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
608
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
603
609
  });
604
610
  nextUi.setClearOnShrink(clearOnShrink);
605
611
  nextUi.onDebug = onDebug;
@@ -675,13 +681,21 @@ export class InteractiveMode {
675
681
  // Start the UI before initializing extensions so session_start handlers can use interactive dialogs
676
682
  this.ui.start();
677
683
  this.isInitialized = true;
678
- await this.themeController.applyFromSettings();
684
+ this.themeController.applyFromSettings();
685
+ // The header and startup notices bake theme colors into their text, so build them once the terminal
686
+ // reported its colors. This ends at the terminal's DA1 reply, or after 100 ms if it answers nothing.
687
+ await this.themeController.waitForTerminalColors();
679
688
  // Add header with keybindings from config (unless silenced)
680
689
  if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
681
- const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
690
+ // Built on demand so the header follows theme changes. The logo's first line carries the version,
691
+ // its second line the first line of key hints.
692
+ const withLogo = (hints) => {
693
+ const [top, bottom] = piLogoLines();
694
+ return `${top} ${theme.fg("dim", `v${this.version}`)}\n${bottom} ${hints}`;
695
+ };
682
696
  // Build startup instructions using keybinding hint helpers
683
697
  const hint = (keybinding, description) => keyHint(keybinding, description);
684
- const expandedInstructions = [
698
+ const expandedInstructions = () => [
685
699
  hint("app.interrupt", "to interrupt"),
686
700
  hint("app.clear", "to clear"),
687
701
  rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
@@ -699,19 +713,19 @@ export class InteractiveMode {
699
713
  rawKeyHint("!!", "to run bash (no context)"),
700
714
  hint("app.message.followUp", "to queue follow-up"),
701
715
  hint("app.message.dequeue", "to edit all queued messages"),
702
- hint("app.clipboard.pasteImage", "to paste image (with text fallback)"),
716
+ hint("app.clipboard.pasteImage", "to paste files on macOS, images, or text"),
703
717
  rawKeyHint("drop files", "to attach"),
704
718
  ].join("\n");
705
- const compactInstructions = [
719
+ const compactInstructions = () => [
706
720
  hint("app.interrupt", "interrupt"),
707
721
  rawKeyHint(`${keyText("app.clear")}/${keyText("app.exit")}`, "clear/exit"),
708
722
  rawKeyHint("/", "commands"),
709
723
  rawKeyHint("!", "bash"),
710
724
  hint("app.tools.expand", "more"),
711
725
  ].join(theme.fg("muted", " · "));
712
- const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
713
- const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
714
- this.builtInHeader = new ExpandableText(() => `${logo}\n${compactInstructions}\n${compactOnboarding}\n\n${onboarding}`, () => `${logo}\n${expandedInstructions}\n\n${onboarding}`, this.getStartupExpansionState(), 1, 0);
726
+ const compactOnboarding = () => theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
727
+ const onboarding = () => theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
728
+ this.builtInHeader = new ExpandableText(() => `${withLogo(compactInstructions())}\n${compactOnboarding()}\n\n${onboarding()}`, () => `${withLogo(expandedInstructions())}\n\n${onboarding()}`, this.getStartupExpansionState(), 1, 0);
715
729
  // Setup UI layout
716
730
  this.headerContainer.addChild(new Spacer(1));
717
731
  this.headerContainer.addChild(this.builtInHeader);
@@ -1284,8 +1298,9 @@ export class InteractiveMode {
1284
1298
  }
1285
1299
  return theme.fg("dim", ` ${labels.join(", ")}`);
1286
1300
  };
1301
+ // Bodies are built on demand so the listing follows theme changes.
1287
1302
  const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
1288
- const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
1303
+ const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody()}`, () => `${sectionHeader(name, color)}\n${expandedBody()}`, this.getStartupExpansionState(), 0, 0);
1289
1304
  this.loadedResourcesContainer.addChild(section);
1290
1305
  this.loadedResourcesContainer.addChild(new Spacer(1));
1291
1306
  };
@@ -1330,27 +1345,25 @@ export class InteractiveMode {
1330
1345
  ];
1331
1346
  if (contextFiles.length > 0) {
1332
1347
  this.loadedResourcesContainer.addChild(new Spacer(1));
1333
- const contextList = contextFiles
1334
- .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
1335
- .join("\n");
1336
- const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1348
+ const contextList = () => contextFiles.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`)).join("\n");
1349
+ const contextCompactList = () => formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1337
1350
  addLoadedSection("Context", contextCompactList, contextList);
1338
1351
  }
1339
1352
  const skills = skillsResult.skills;
1340
1353
  if (skills.length > 0) {
1341
1354
  const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
1342
- const skillList = this.formatScopeGroups(groups, {
1355
+ const skillList = () => this.formatScopeGroups(groups, {
1343
1356
  formatPath: (item) => this.formatDisplayPath(item.path),
1344
1357
  formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1345
1358
  });
1346
- const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
1359
+ const skillCompactList = () => formatCompactList(skills.map((skill) => skill.name));
1347
1360
  addLoadedSection("Skills", skillCompactList, skillList);
1348
1361
  }
1349
1362
  const templates = this.session.promptTemplates;
1350
1363
  if (templates.length > 0) {
1351
1364
  const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
1352
1365
  const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
1353
- const templateList = this.formatScopeGroups(groups, {
1366
+ const templateList = () => this.formatScopeGroups(groups, {
1354
1367
  formatPath: (item) => {
1355
1368
  const template = templateByPath.get(item.path);
1356
1369
  return template ? `/${template.name}` : this.formatDisplayPath(item.path);
@@ -1360,53 +1373,40 @@ export class InteractiveMode {
1360
1373
  return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1361
1374
  },
1362
1375
  });
1363
- const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1376
+ const promptCompactList = () => formatCompactList(templates.map((template) => `/${template.name}`));
1364
1377
  addLoadedSection("Prompts", promptCompactList, templateList);
1365
1378
  }
1366
1379
  if (extensions.length > 0) {
1367
1380
  const groups = this.buildScopeGroups(extensions);
1368
- const extList = this.formatScopeGroups(groups, {
1381
+ const extList = () => this.formatScopeGroups(groups, {
1369
1382
  formatPath: (item) => this.formatExtensionDisplayPath(item.path),
1370
1383
  formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
1371
1384
  });
1372
- const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
1385
+ const extensionLabels = this.getCompactExtensionLabels(extensions);
1386
+ const extensionCompactList = () => formatCompactList(extensionLabels);
1373
1387
  addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
1374
1388
  }
1375
- // Show loaded themes (excluding built-in)
1376
- const loadedThemes = themesResult.themes;
1377
- const customThemes = loadedThemes.filter((t) => t.sourcePath);
1378
- if (customThemes.length > 0) {
1379
- const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1380
- path: loadedTheme.sourcePath,
1381
- sourceInfo: loadedTheme.sourceInfo,
1382
- })));
1383
- const themeList = this.formatScopeGroups(groups, {
1384
- formatPath: (item) => this.formatDisplayPath(item.path),
1385
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1386
- });
1387
- const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1388
- addLoadedSection("Themes", themeCompactList, themeList);
1389
- }
1390
1389
  }
1391
1390
  if (showDiagnostics) {
1392
1391
  const skillDiagnostics = skillsResult.diagnostics;
1393
1392
  if (skillDiagnostics.length > 0) {
1394
- const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
1395
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
1393
+ const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
1394
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill conflicts]")}\n${warningLines()}`, 0, 0));
1396
1395
  this.loadedResourcesContainer.addChild(new Spacer(1));
1397
1396
  }
1398
1397
  const promptDiagnostics = promptsResult.diagnostics;
1399
1398
  if (promptDiagnostics.length > 0) {
1400
- const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
1401
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
1399
+ const warningLines = () => this.formatDiagnostics(promptDiagnostics, sourceInfos);
1400
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines()}`, 0, 0));
1402
1401
  this.loadedResourcesContainer.addChild(new Spacer(1));
1403
1402
  }
1404
1403
  const extensionDiagnostics = [];
1405
- const extensionErrors = this.session.resourceLoader.getExtensions().errors;
1406
- if (extensionErrors.length > 0) {
1407
- for (const error of extensionErrors) {
1408
- extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
1409
- }
1404
+ const extensionsResult = this.session.resourceLoader.getExtensions();
1405
+ for (const error of extensionsResult.errors) {
1406
+ extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
1407
+ }
1408
+ for (const warning of extensionsResult.warnings ?? []) {
1409
+ extensionDiagnostics.push({ type: "warning", message: warning.warning, path: warning.path });
1410
1410
  }
1411
1411
  const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
1412
1412
  extensionDiagnostics.push(...commandDiagnostics);
@@ -1414,14 +1414,14 @@ export class InteractiveMode {
1414
1414
  const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
1415
1415
  extensionDiagnostics.push(...shortcutDiagnostics);
1416
1416
  if (extensionDiagnostics.length > 0) {
1417
- const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
1418
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
1417
+ const warningLines = () => this.formatDiagnostics(extensionDiagnostics, sourceInfos);
1418
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Extension issues]")}\n${warningLines()}`, 0, 0));
1419
1419
  this.loadedResourcesContainer.addChild(new Spacer(1));
1420
1420
  }
1421
1421
  const themeDiagnostics = themesResult.diagnostics;
1422
1422
  if (themeDiagnostics.length > 0) {
1423
- const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
1424
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
1423
+ const warningLines = () => this.formatDiagnostics(themeDiagnostics, sourceInfos);
1424
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Theme conflicts]")}\n${warningLines()}`, 0, 0));
1425
1425
  this.loadedResourcesContainer.addChild(new Spacer(1));
1426
1426
  }
1427
1427
  }
@@ -1513,6 +1513,7 @@ export class InteractiveMode {
1513
1513
  this.applyFullscreenScrollbarSetting();
1514
1514
  if (this.renderer instanceof TuiAltScreen) {
1515
1515
  this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
1516
+ this.renderer.setWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());
1516
1517
  }
1517
1518
  this.footer.setSession(this.session);
1518
1519
  this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
@@ -1559,10 +1560,11 @@ export class InteractiveMode {
1559
1560
  this.showError(`${prefix}: ${message}`);
1560
1561
  const extensionHint = this.getCrashExtensionHint(error);
1561
1562
  if (extensionHint) {
1562
- this.chatContainer.addChild(new Text(theme.fg("warning", extensionHint), this.outputPad, 0));
1563
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", extensionHint), this.outputPad, 0));
1563
1564
  }
1564
1565
  if (this.recordCrash("fatal_error", error)) {
1565
- this.chatContainer.addChild(new Text(theme.fg("muted", this.crashReportInstructions()), this.outputPad, 0));
1566
+ const instructions = this.crashReportInstructions();
1567
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", instructions), this.outputPad, 0));
1566
1568
  }
1567
1569
  stopThemeWatcher();
1568
1570
  this.stop("transcript");
@@ -1598,7 +1600,7 @@ export class InteractiveMode {
1598
1600
  if (this.bugReportHintShown)
1599
1601
  return;
1600
1602
  this.bugReportHintShown = true;
1601
- this.chatContainer.addChild(new Text(theme.fg("muted", `If this looks like a ${APP_NAME} bug, /bug sends a report to the developers.`), this.outputPad, 0));
1603
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", `If this looks like a ${APP_NAME} bug, /bug sends a report to the developers.`), this.outputPad, 0));
1602
1604
  this.ui.requestRender();
1603
1605
  }
1604
1606
  maybeSuggestBugReport(message) {
@@ -1795,7 +1797,7 @@ export class InteractiveMode {
1795
1797
  container.addChild(new Text(line, 1, 0));
1796
1798
  }
1797
1799
  if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
1798
- container.addChild(new Text(theme.fg("muted", "... (widget truncated)"), 1, 0));
1800
+ container.addChild(new ThemedText(() => theme.fg("muted", "... (widget truncated)"), 1, 0));
1799
1801
  }
1800
1802
  component = container;
1801
1803
  }
@@ -2308,17 +2310,14 @@ export class InteractiveMode {
2308
2310
  */
2309
2311
  showExtensionError(extensionPath, error, stack) {
2310
2312
  const errorMsg = `Extension "${extensionPath}" error: ${error}`;
2311
- const errorText = new Text(theme.fg("error", errorMsg), 1, 0);
2313
+ const errorText = new ThemedText(() => theme.fg("error", errorMsg), 1, 0);
2312
2314
  this.chatContainer.addChild(errorText);
2313
2315
  if (stack) {
2314
2316
  // Show stack trace in dim color, indented
2315
- const stackLines = stack
2316
- .split("\n")
2317
- .slice(1) // Skip first line (duplicates error message)
2318
- .map((line) => theme.fg("dim", ` ${line.trim()}`))
2319
- .join("\n");
2320
- if (stackLines) {
2321
- this.chatContainer.addChild(new Text(stackLines, 1, 0));
2317
+ const stackLines = stack.split("\n").slice(1); // Skip first line (duplicates error message)
2318
+ if (stackLines.length > 0) {
2319
+ const renderStack = () => stackLines.map((line) => theme.fg("dim", ` ${line.trim()}`)).join("\n");
2320
+ this.chatContainer.addChild(new ThemedText(renderStack, 1, 0));
2322
2321
  }
2323
2322
  }
2324
2323
  this.ui.requestRender();
@@ -2388,8 +2387,8 @@ export class InteractiveMode {
2388
2387
  this.updateEditorBorderColor();
2389
2388
  }
2390
2389
  };
2391
- // Handle clipboard paste (triggered on Ctrl+V). Images are attached by path;
2392
- // otherwise, paste plain text from the system clipboard.
2390
+ // Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,
2391
+ // images are attached via temporary files, and plain text is the final fallback.
2393
2392
  this.defaultEditor.onPasteImage = () => {
2394
2393
  void this.handleClipboardPaste();
2395
2394
  };
@@ -2412,6 +2411,22 @@ export class InteractiveMode {
2412
2411
  }
2413
2412
  async handleClipboardPaste() {
2414
2413
  try {
2414
+ const filePaths = await readClipboardFilePaths();
2415
+ if (filePaths) {
2416
+ if (filePaths.some((filePath) => /\p{Cc}/u.test(filePath))) {
2417
+ throw new Error("Clipboard file path contains control characters");
2418
+ }
2419
+ const paths = this.isBashMode ? filePaths.map(quoteIfNeeded).join(" ") : filePaths.join("\n");
2420
+ const cursor = this.editor.getCursor?.();
2421
+ const currentLine = cursor ? (this.editor.getText().split("\n")[cursor.line] ?? "") : "";
2422
+ const characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : "";
2423
+ const characterAfterCursor = cursor ? currentLine[cursor.col] : "";
2424
+ const leadingSpace = characterBeforeCursor && !/\s/.test(characterBeforeCursor) ? " " : "";
2425
+ const trailingSpace = characterAfterCursor && !/\s/.test(characterAfterCursor) ? " " : "";
2426
+ this.editor.insertTextAtCursor?.(`${leadingSpace}${paths}${trailingSpace}`);
2427
+ this.ui.requestRender();
2428
+ return;
2429
+ }
2415
2430
  const image = await readClipboardImage();
2416
2431
  if (image) {
2417
2432
  const tmpDir = os.tmpdir();
@@ -2429,8 +2444,8 @@ export class InteractiveMode {
2429
2444
  this.ui.requestRender();
2430
2445
  }
2431
2446
  }
2432
- catch {
2433
- // Silently ignore clipboard errors (may not have permission, etc.)
2447
+ catch (error) {
2448
+ this.showError(`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`);
2434
2449
  }
2435
2450
  }
2436
2451
  handleStartupSubmit(text) {
@@ -2811,6 +2826,9 @@ export class InteractiveMode {
2811
2826
  // The bash execution callback handles TUI output rendering.
2812
2827
  break;
2813
2828
  case "tool_execution_start": {
2829
+ // Nested calls (from codemode scripts) are shown inside their parent's row.
2830
+ if (event.parentToolCallId)
2831
+ break;
2814
2832
  let component = this.pendingTools.get(event.toolCallId);
2815
2833
  if (!component) {
2816
2834
  component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
@@ -2912,7 +2930,8 @@ export class InteractiveMode {
2912
2930
  }
2913
2931
  else {
2914
2932
  this.chatContainer.addChild(new Spacer(1));
2915
- this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
2933
+ const errorMessage = event.errorMessage;
2934
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("error", errorMessage), 1, 0));
2916
2935
  }
2917
2936
  }
2918
2937
  void this.flushCompactionQueue({ willRetry: event.willRetry });
@@ -2984,7 +3003,7 @@ export class InteractiveMode {
2984
3003
  }
2985
3004
  const message = status.type === "warning" ? `Warning: ${status.message}` : status.message;
2986
3005
  const color = status.type === "warning" ? "warning" : "dim";
2987
- this.chatContainer.addChild(new Text(theme.fg(color, message), 1, 0));
3006
+ this.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));
2988
3007
  this.lastStatusSpacer = undefined;
2989
3008
  this.lastStatusText = undefined;
2990
3009
  this.ui.requestRender();
@@ -3000,12 +3019,14 @@ export class InteractiveMode {
3000
3019
  const last = children.length > 0 ? children[children.length - 1] : undefined;
3001
3020
  const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
3002
3021
  if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
3003
- this.lastStatusText.setText(theme.fg("dim", message));
3022
+ this.lastStatusMessage = message;
3023
+ this.lastStatusText.invalidate();
3004
3024
  this.ui.requestRender();
3005
3025
  return;
3006
3026
  }
3007
3027
  const spacer = new Spacer(1);
3008
- const text = new Text(theme.fg("dim", message), 1, 0);
3028
+ this.lastStatusMessage = message;
3029
+ const text = new ThemedText(() => theme.fg("dim", this.lastStatusMessage), 1, 0);
3009
3030
  this.chatContainer.addChild(spacer);
3010
3031
  this.chatContainer.addChild(text);
3011
3032
  this.lastStatusSpacer = spacer;
@@ -3214,7 +3235,8 @@ export class InteractiveMode {
3214
3235
  if (!this.settingsManager.getShowCacheMissNotices())
3215
3236
  return;
3216
3237
  this.chatContainer.addChild(new Spacer(1));
3217
- this.chatContainer.addChild(new Text(theme.fg("dim", formatCacheWarmingUsage(entry)), 1, 0));
3238
+ const usage = formatCacheWarmingUsage(entry);
3239
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
3218
3240
  }
3219
3241
  /**
3220
3242
  * Render billing usage for a compaction or branch summary. The notice is derived
@@ -3228,7 +3250,7 @@ export class InteractiveMode {
3228
3250
  const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
3229
3251
  const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
3230
3252
  this.chatContainer.addChild(new Spacer(1));
3231
- this.chatContainer.addChild(new Text(theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3253
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3232
3254
  }
3233
3255
  static countDroppedThinkingBlocks(message) {
3234
3256
  let count = 0;
@@ -3265,7 +3287,7 @@ export class InteractiveMode {
3265
3287
  return;
3266
3288
  const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
3267
3289
  this.chatContainer.addChild(new Spacer(1));
3268
- this.chatContainer.addChild(new Text(theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
3290
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
3269
3291
  }
3270
3292
  /**
3271
3293
  * Show a transcript notice when a completed assistant message paid for a
@@ -3292,9 +3314,8 @@ export class InteractiveMode {
3292
3314
  else if (miss.idleMs >= CACHE_TTL_MS) {
3293
3315
  label = `Cache miss after ${Math.round(miss.idleMs / 60_000)}m idle`;
3294
3316
  }
3295
- const text = theme.fg("warning", `${label}: ${reBilled}`);
3296
3317
  this.chatContainer.addChild(new Spacer(1));
3297
- this.chatContainer.addChild(new Text(text, 1, 0));
3318
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${reBilled}`), 1, 0));
3298
3319
  }
3299
3320
  renderInitialMessages() {
3300
3321
  const entries = this.sessionManager.buildContextEntries();
@@ -3318,7 +3339,7 @@ export class InteractiveMode {
3318
3339
  if (this.chatContainer.children.length > 0) {
3319
3340
  this.chatContainer.addChild(new Spacer(1));
3320
3341
  }
3321
- this.chatContainer.addChild(new Text(theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`), 1, 0));
3342
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`), 1, 0));
3322
3343
  }
3323
3344
  async getUserInput() {
3324
3345
  const queuedInput = this.pendingUserInputs.shift();
@@ -3665,26 +3686,28 @@ export class InteractiveMode {
3665
3686
  }
3666
3687
  showError(errorMessage) {
3667
3688
  this.chatContainer.addChild(new Spacer(1));
3668
- this.chatContainer.addChild(new Text(theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
3689
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
3669
3690
  this.ui.requestRender();
3670
3691
  }
3671
3692
  showWarning(warningMessage) {
3672
3693
  this.chatContainer.addChild(new Spacer(1));
3673
- this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
3694
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
3674
3695
  this.ui.requestRender();
3675
3696
  }
3676
3697
  showNewVersionNotification(release) {
3677
- const action = theme.fg("accent", `${APP_NAME} update`);
3678
- const updateInstruction = theme.fg("muted", `New version ${release.version} is available. Run `) + action;
3698
+ const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
3699
+ theme.fg("accent", `${APP_NAME} update`);
3679
3700
  const changelogUrl = "https://pi.dev/changelog";
3680
- const changelogLink = getCapabilities().hyperlinks
3681
- ? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
3682
- : theme.fg("accent", changelogUrl);
3683
- const changelogLine = theme.fg("muted", "Changelog: ") + changelogLink;
3701
+ const changelogLine = () => {
3702
+ const changelogLink = getCapabilities().hyperlinks
3703
+ ? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
3704
+ : theme.fg("accent", changelogUrl);
3705
+ return theme.fg("muted", "Changelog: ") + changelogLink;
3706
+ };
3684
3707
  const note = release.note?.trim();
3685
3708
  this.chatContainer.addChild(new Spacer(1));
3686
3709
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3687
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction}`, 1, 0));
3710
+ this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
3688
3711
  if (note) {
3689
3712
  this.chatContainer.addChild(new Spacer(1));
3690
3713
  this.chatContainer.addChild(new Markdown(note, 1, 0, this.getMarkdownThemeWithSettings(), {
@@ -3692,17 +3715,17 @@ export class InteractiveMode {
3692
3715
  }));
3693
3716
  this.chatContainer.addChild(new Spacer(1));
3694
3717
  }
3695
- this.chatContainer.addChild(new Text(changelogLine, 1, 0));
3718
+ this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
3696
3719
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3697
3720
  this.ui.requestRender();
3698
3721
  }
3699
3722
  showPackageUpdateNotification(packages) {
3700
- const action = theme.fg("accent", `${APP_NAME} update --extensions`);
3701
- const updateInstruction = theme.fg("muted", "Package updates are available. Run ") + action;
3723
+ const updateInstruction = () => theme.fg("muted", "Package updates are available. Run ") +
3724
+ theme.fg("accent", `${APP_NAME} update --extensions`);
3702
3725
  const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
3703
3726
  this.chatContainer.addChild(new Spacer(1));
3704
3727
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3705
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
3728
+ this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction()}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
3706
3729
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3707
3730
  this.ui.requestRender();
3708
3731
  }
@@ -3932,7 +3955,7 @@ export class InteractiveMode {
3932
3955
  thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
3933
3956
  availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
3934
3957
  modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
3935
- currentTheme: this.themeController.getThemeSelection() || "dark",
3958
+ currentTheme: this.themeController.getThemeSelection() || SYSTEM_THEME_NAME,
3936
3959
  terminalTheme: this.themeController.getTerminalTheme(),
3937
3960
  availableThemes: getAvailableThemes(),
3938
3961
  hideThinkingBlock: this.hideThinkingBlock,
@@ -3954,6 +3977,7 @@ export class InteractiveMode {
3954
3977
  fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
3955
3978
  fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
3956
3979
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
3980
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
3957
3981
  warnings: this.settingsManager.getWarnings(),
3958
3982
  }, {
3959
3983
  onAutoCompactChange: (enabled) => {
@@ -4028,7 +4052,7 @@ export class InteractiveMode {
4028
4052
  },
4029
4053
  onThemeChange: (themeSetting) => {
4030
4054
  this.settingsManager.setTheme(themeSetting);
4031
- void this.themeController.setThemeSetting(themeSetting);
4055
+ this.themeController.setThemeSetting(themeSetting);
4032
4056
  },
4033
4057
  onThemePreview: (themeName) => this.themeController.preview(themeName),
4034
4058
  onHideThinkingBlockChange: (hidden) => {
@@ -4133,6 +4157,11 @@ export class InteractiveMode {
4133
4157
  if (this.renderer instanceof TuiAltScreen)
4134
4158
  this.renderer.setCopyOnSelect(enabled);
4135
4159
  },
4160
+ onFullscreenWheelScrollLinesChange: (lines) => {
4161
+ this.settingsManager.setFullscreenWheelScrollLines(lines);
4162
+ if (this.renderer instanceof TuiAltScreen)
4163
+ this.renderer.setWheelScrollLines(lines);
4164
+ },
4136
4165
  onWarningsChange: (warnings) => {
4137
4166
  this.settingsManager.setWarnings(warnings);
4138
4167
  },
@@ -5115,7 +5144,7 @@ export class InteractiveMode {
5115
5144
  signal: dialog.signal,
5116
5145
  prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
5117
5146
  notify: (event) => this.notifyAuthDialog(dialog, event),
5118
- });
5147
+ }, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
5119
5148
  }
5120
5149
  async showLoginDialog(providerId, providerName) {
5121
5150
  const previousModel = this.session.model;
@@ -5163,7 +5192,7 @@ export class InteractiveMode {
5163
5192
  const borderColor = (s) => theme.fg("border", s);
5164
5193
  reloadBox.addChild(new DynamicBorder(borderColor));
5165
5194
  reloadBox.addChild(new Spacer(1));
5166
- reloadBox.addChild(new Text(theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
5195
+ reloadBox.addChild(new ThemedText(() => theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
5167
5196
  reloadBox.addChild(new Spacer(1));
5168
5197
  reloadBox.addChild(new DynamicBorder(borderColor));
5169
5198
  const previousEditor = this.editor;
@@ -5199,7 +5228,7 @@ export class InteractiveMode {
5199
5228
  }
5200
5229
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
5201
5230
  this.applyRuntimeSettings();
5202
- await this.themeController.applyFromSettings();
5231
+ this.themeController.applyFromSettings();
5203
5232
  this.setupAutocompleteProvider();
5204
5233
  const runner = this.session.extensionRunner;
5205
5234
  this.setupExtensionShortcuts(runner);
@@ -5363,7 +5392,7 @@ export class InteractiveMode {
5363
5392
  const currentName = this.sessionManager.getSessionName();
5364
5393
  if (currentName) {
5365
5394
  this.chatContainer.addChild(new Spacer(1));
5366
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name: ${currentName}`), 1, 0));
5395
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name: ${currentName}`), 1, 0));
5367
5396
  }
5368
5397
  else {
5369
5398
  this.showWarning("Usage: /name <name>");
@@ -5377,7 +5406,8 @@ export class InteractiveMode {
5377
5406
  this.showWarning(`Session name was normalized from ${JSON.stringify(name)} to ${JSON.stringify(sessionName)}`);
5378
5407
  }
5379
5408
  this.chatContainer.addChild(new Spacer(1));
5380
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name set: ${sessionName ?? name}`), 1, 0));
5409
+ const displayName = sessionName ?? name;
5410
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name set: ${displayName}`), 1, 0));
5381
5411
  this.ui.requestRender();
5382
5412
  }
5383
5413
  handleSessionCommand() {
@@ -5389,61 +5419,69 @@ export class InteractiveMode {
5389
5419
  // resolves to a concrete responseModel). Usage without model attribution is
5390
5420
  // grouped separately so the breakdown reconciles with the session total.
5391
5421
  const usageBreakdown = getUsageCostBreakdown(entries);
5392
- let info = `${theme.bold("Session Info")}\n\n`;
5393
- if (sessionName) {
5394
- info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
5395
- }
5396
- info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
5397
- info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
5398
- info += `${theme.bold("Messages")}\n`;
5399
- info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
5400
- info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
5401
- info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
5402
- info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
5403
- info += `${theme.bold("Tokens")}\n`;
5404
- // "Input" is the full prompt volume. With cache activity, split it into
5405
- // cached (served from cache) vs uncached (everything else) - the only
5406
- // provider-independent split. Cache writes, where reported, are a detail
5407
- // of the uncached portion.
5408
- const { input, cacheRead, cacheWrite } = stats.tokens;
5409
- const promptTokens = input + cacheRead + cacheWrite;
5410
- info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
5411
- if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
5412
- const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
5413
- info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
5414
- const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
5415
- info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
5416
- }
5417
- info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
5418
- info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
5422
+ // Snapshot the stats; the text is built on demand so it follows theme changes.
5419
5423
  const cacheWarmingStatus = this.session.cacheWarmingStatus;
5420
- info += `\n${theme.bold("Cache Warming")}\n`;
5421
- info += `${theme.fg("dim", "Mode:")} ${this.settingsManager.getCacheWarmingMode()}\n`;
5422
- info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
5423
- const decision = cacheWarmingStatus?.decision;
5424
- if (decision?.economicsAvailable) {
5425
- info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
5426
- info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
5427
- }
5428
- if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
5429
- info += `\n${theme.bold("Cost")}\n`;
5430
- info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
5431
- if (usageBreakdown.length > 1) {
5432
- for (const entry of usageBreakdown) {
5433
- info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
5424
+ const cacheWarmingMode = this.settingsManager.getCacheWarmingMode();
5425
+ const model = this.session.model;
5426
+ const selectedModelKey = `${model?.provider}/${model?.id}`;
5427
+ const renderInfo = () => {
5428
+ let info = `${theme.bold("Session Info")}\n\n`;
5429
+ if (sessionName) {
5430
+ info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
5431
+ }
5432
+ info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
5433
+ info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
5434
+ info += `${theme.bold("Messages")}\n`;
5435
+ info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
5436
+ info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
5437
+ info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
5438
+ info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
5439
+ info += `${theme.bold("Tokens")}\n`;
5440
+ // "Input" is the full prompt volume. With cache activity, split it into
5441
+ // cached (served from cache) vs uncached (everything else) - the only
5442
+ // provider-independent split. Cache writes, where reported, are a detail
5443
+ // of the uncached portion.
5444
+ const { input, cacheRead, cacheWrite } = stats.tokens;
5445
+ const promptTokens = input + cacheRead + cacheWrite;
5446
+ info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
5447
+ if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
5448
+ const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
5449
+ info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
5450
+ const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
5451
+ info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
5452
+ }
5453
+ info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
5454
+ info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
5455
+ info += `\n${theme.bold("Cache Warming")}\n`;
5456
+ info += `${theme.fg("dim", "Mode:")} ${cacheWarmingMode}\n`;
5457
+ info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
5458
+ const decision = cacheWarmingStatus?.decision;
5459
+ if (decision?.economicsAvailable) {
5460
+ info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
5461
+ info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
5462
+ }
5463
+ if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
5464
+ info += `\n${theme.bold("Cost")}\n`;
5465
+ info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
5466
+ // A single entry repeats the total, unless it names a model other than the selected one.
5467
+ if (usageBreakdown.length > 1 || usageBreakdown[0]?.key !== selectedModelKey) {
5468
+ for (const entry of usageBreakdown) {
5469
+ info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
5470
+ }
5471
+ }
5472
+ if (cacheWaste.missedTokens > 0) {
5473
+ const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
5474
+ const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
5475
+ info +=
5476
+ cacheWaste.missedCost >= 0.0001
5477
+ ? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
5478
+ : `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
5434
5479
  }
5435
5480
  }
5436
- if (cacheWaste.missedTokens > 0) {
5437
- const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
5438
- const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
5439
- info +=
5440
- cacheWaste.missedCost >= 0.0001
5441
- ? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
5442
- : `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
5443
- }
5444
- }
5481
+ return info;
5482
+ };
5445
5483
  this.chatContainer.addChild(new Spacer(1));
5446
- this.chatContainer.addChild(new Text(info, 1, 0));
5484
+ this.chatContainer.addChild(new ThemedText(renderInfo, 1, 0));
5447
5485
  this.ui.requestRender();
5448
5486
  }
5449
5487
  handleChangelogCommand() {
@@ -5457,7 +5495,7 @@ export class InteractiveMode {
5457
5495
  : "No changelog entries found.";
5458
5496
  this.chatContainer.addChild(new Spacer(1));
5459
5497
  this.chatContainer.addChild(new DynamicBorder());
5460
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
5498
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
5461
5499
  this.chatContainer.addChild(new Spacer(1));
5462
5500
  this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
5463
5501
  this.chatContainer.addChild(new DynamicBorder());
@@ -5558,7 +5596,7 @@ export class InteractiveMode {
5558
5596
  | \`${copyMessage}\` | Copy selection or last assistant message |
5559
5597
  | \`${followUp}\` | Queue follow-up message |
5560
5598
  | \`${dequeue}\` | Restore queued messages |
5561
- | \`${pasteImage}\` | Paste image or text from clipboard |
5599
+ | \`${pasteImage}\` | Paste files on macOS, images, or text from clipboard |
5562
5600
  | \`/\` | Slash commands |
5563
5601
  | \`!\` | Run bash command |
5564
5602
  | \`!!\` | Run bash command (excluded from context) |
@@ -5580,7 +5618,7 @@ export class InteractiveMode {
5580
5618
  }
5581
5619
  this.chatContainer.addChild(new Spacer(1));
5582
5620
  this.chatContainer.addChild(new DynamicBorder());
5583
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
5621
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
5584
5622
  this.chatContainer.addChild(new Spacer(1));
5585
5623
  this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
5586
5624
  this.chatContainer.addChild(new DynamicBorder());
@@ -5594,7 +5632,7 @@ export class InteractiveMode {
5594
5632
  return;
5595
5633
  }
5596
5634
  this.chatContainer.addChild(new Spacer(1));
5597
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ New session started")}`, 1, 1));
5635
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("accent", "✓ New session started"), 1, 1));
5598
5636
  this.ui.requestRender();
5599
5637
  }
5600
5638
  catch (error) {
@@ -5625,7 +5663,7 @@ export class InteractiveMode {
5625
5663
  fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
5626
5664
  fs.writeFileSync(debugLogPath, debugData);
5627
5665
  this.chatContainer.addChild(new Spacer(1));
5628
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
5666
+ this.chatContainer.addChild(new ThemedText(() => `${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
5629
5667
  this.ui.requestRender();
5630
5668
  }
5631
5669
  handleArminSaysHi() {