@averyyy/pi-coding-agent 0.87.1-piclient.2 → 0.99.1-piclient.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (733) hide show
  1. package/CHANGELOG.md +97 -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-YZ3Q2WVP.js +2 -0
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  13. package/dist/bundle/chunks/chunk-3YXHSP6S.js +21 -0
  14. package/dist/bundle/chunks/chunk-7BINYQ2V.js +1548 -0
  15. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  16. package/dist/bundle/chunks/chunk-F6ORSP6L.js +187 -0
  17. package/dist/bundle/chunks/chunk-FJTXMIZI.js +150 -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-J4CWPC4N.js +2 -0
  21. package/dist/bundle/chunks/chunk-KYJKN5BJ.js +2 -0
  22. package/dist/bundle/chunks/chunk-RO6I2QFQ.js +4 -0
  23. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  24. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  25. package/dist/bundle/chunks/{chunk-UZNGGY6N.js → chunk-V7V43FNB.js} +3 -3
  26. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
  27. package/dist/bundle/chunks/chunk-WVKBMRQX.js +82 -0
  28. package/dist/bundle/chunks/cli-WF6HDHBO.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-AVGAUHMT.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-chatgpt.js +75 -0
  39. package/dist/bundle/chunks/{openai-codex-responses-SG7PGUUZ.js → openai-codex-responses-FUE7WESF.js} +2 -2
  40. package/dist/bundle/chunks/openai-codex.js +2 -2
  41. package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-XW2Q5HVC.js} +2 -2
  42. package/dist/bundle/chunks/openai-responses-ZUXFVYPI.js +3 -0
  43. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
  44. package/dist/bundle/chunks/openrouter.js +2 -2
  45. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  46. package/dist/bundle/chunks/radius.js +2 -2
  47. package/dist/bundle/chunks/runtime-6ZC4MGWD.js +2 -0
  48. package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
  49. package/dist/bundle/chunks/virtual-modules-H7OCXN6W.js +2 -0
  50. package/dist/bundle/cli-runtime.js +1 -1
  51. package/dist/bundle/index.js +1 -1
  52. package/dist/bundle/rpc-entry.js +1 -1
  53. package/dist/cli/args.d.ts.map +1 -1
  54. package/dist/cli/args.js +4 -3
  55. package/dist/cli/args.js.map +1 -1
  56. package/dist/cli/auth-check.d.ts.map +1 -1
  57. package/dist/cli/auth-check.js.map +1 -1
  58. package/dist/cli/auth-command.d.ts.map +1 -1
  59. package/dist/cli/auth-command.js.map +1 -1
  60. package/dist/cli/config-selector.d.ts.map +1 -1
  61. package/dist/cli/config-selector.js.map +1 -1
  62. package/dist/cli/credential-print.d.ts.map +1 -1
  63. package/dist/cli/credential-print.js.map +1 -1
  64. package/dist/cli/file-processor.d.ts.map +1 -1
  65. package/dist/cli/file-processor.js.map +1 -1
  66. package/dist/cli/initial-message.d.ts +1 -1
  67. package/dist/cli/initial-message.d.ts.map +1 -1
  68. package/dist/cli/initial-message.js.map +1 -1
  69. package/dist/cli/list-models.d.ts.map +1 -1
  70. package/dist/cli/list-models.js.map +1 -1
  71. package/dist/cli/project-trust.d.ts.map +1 -1
  72. package/dist/cli/project-trust.js.map +1 -1
  73. package/dist/cli/session-picker.d.ts.map +1 -1
  74. package/dist/cli/session-picker.js.map +1 -1
  75. package/dist/cli/setup.d.ts.map +1 -1
  76. package/dist/cli/setup.js.map +1 -1
  77. package/dist/cli/startup-ui.d.ts.map +1 -1
  78. package/dist/cli/startup-ui.js +38 -30
  79. package/dist/cli/startup-ui.js.map +1 -1
  80. package/dist/cli.d.ts.map +1 -1
  81. package/dist/config.d.ts +18 -4
  82. package/dist/config.d.ts.map +1 -1
  83. package/dist/config.js +30 -4
  84. package/dist/config.js.map +1 -1
  85. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  86. package/dist/core/agent-session-runtime.js +1 -1
  87. package/dist/core/agent-session-runtime.js.map +1 -1
  88. package/dist/core/agent-session-services.d.ts.map +1 -1
  89. package/dist/core/agent-session-services.js +13 -0
  90. package/dist/core/agent-session-services.js.map +1 -1
  91. package/dist/core/agent-session.d.ts +118 -11
  92. package/dist/core/agent-session.d.ts.map +1 -1
  93. package/dist/core/agent-session.js +548 -288
  94. package/dist/core/agent-session.js.map +1 -1
  95. package/dist/core/auth-guidance.d.ts.map +1 -1
  96. package/dist/core/auth-guidance.js.map +1 -1
  97. package/dist/core/auth-storage.d.ts.map +1 -1
  98. package/dist/core/auth-storage.js.map +1 -1
  99. package/dist/core/bash-executor.d.ts.map +1 -1
  100. package/dist/core/bash-executor.js.map +1 -1
  101. package/dist/core/bug-report-upload.d.ts.map +1 -1
  102. package/dist/core/bug-report-upload.js.map +1 -1
  103. package/dist/core/bug-report.d.ts +1 -1
  104. package/dist/core/bug-report.d.ts.map +1 -1
  105. package/dist/core/bug-report.js +1 -1
  106. package/dist/core/bug-report.js.map +1 -1
  107. package/dist/core/cache-stats.d.ts.map +1 -1
  108. package/dist/core/cache-stats.js.map +1 -1
  109. package/dist/core/cache-warmer.d.ts.map +1 -1
  110. package/dist/core/cache-warmer.js.map +1 -1
  111. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  112. package/dist/core/compaction/branch-summarization.js.map +1 -1
  113. package/dist/core/compaction/compaction.d.ts.map +1 -1
  114. package/dist/core/compaction/compaction.js +1 -22
  115. package/dist/core/compaction/compaction.js.map +1 -1
  116. package/dist/core/compaction/index.d.ts.map +1 -1
  117. package/dist/core/compaction/utils.d.ts +2 -1
  118. package/dist/core/compaction/utils.d.ts.map +1 -1
  119. package/dist/core/compaction/utils.js +25 -18
  120. package/dist/core/compaction/utils.js.map +1 -1
  121. package/dist/core/crash-log.d.ts.map +1 -1
  122. package/dist/core/crash-log.js +2 -1
  123. package/dist/core/crash-log.js.map +1 -1
  124. package/dist/core/defaults.d.ts.map +1 -1
  125. package/dist/core/diagnostics.d.ts.map +1 -1
  126. package/dist/core/event-bus.d.ts.map +1 -1
  127. package/dist/core/event-bus.js.map +1 -1
  128. package/dist/core/exec.d.ts.map +1 -1
  129. package/dist/core/exec.js.map +1 -1
  130. package/dist/core/experimental.d.ts.map +1 -1
  131. package/dist/core/experimental.js.map +1 -1
  132. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  133. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  134. package/dist/core/export-html/index.d.ts.map +1 -1
  135. package/dist/core/export-html/index.js.map +1 -1
  136. package/dist/core/export-html/template.css +10 -0
  137. package/dist/core/export-html/template.js +66 -17
  138. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  139. package/dist/core/export-html/tool-renderer.js.map +1 -1
  140. package/dist/core/extensions/index.d.ts +1 -1
  141. package/dist/core/extensions/index.d.ts.map +1 -1
  142. package/dist/core/extensions/index.js.map +1 -1
  143. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  144. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  145. package/dist/core/extensions/loader.d.ts.map +1 -1
  146. package/dist/core/extensions/loader.js +55 -5
  147. package/dist/core/extensions/loader.js.map +1 -1
  148. package/dist/core/extensions/runner.d.ts +18 -1
  149. package/dist/core/extensions/runner.d.ts.map +1 -1
  150. package/dist/core/extensions/runner.js +99 -0
  151. package/dist/core/extensions/runner.js.map +1 -1
  152. package/dist/core/extensions/types.d.ts +296 -22
  153. package/dist/core/extensions/types.d.ts.map +1 -1
  154. package/dist/core/extensions/types.js.map +1 -1
  155. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  156. package/dist/core/extensions/wrapper.d.ts +2 -2
  157. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  158. package/dist/core/extensions/wrapper.js +3 -3
  159. package/dist/core/extensions/wrapper.js.map +1 -1
  160. package/dist/core/footer-data-provider.d.ts.map +1 -1
  161. package/dist/core/footer-data-provider.js.map +1 -1
  162. package/dist/core/http-dispatcher.d.ts.map +1 -1
  163. package/dist/core/http-dispatcher.js.map +1 -1
  164. package/dist/core/index.d.ts.map +1 -1
  165. package/dist/core/keybindings.d.ts +1 -1
  166. package/dist/core/keybindings.d.ts.map +1 -1
  167. package/dist/core/keybindings.js +1 -1
  168. package/dist/core/keybindings.js.map +1 -1
  169. package/dist/core/mcp-servers.d.ts +98 -0
  170. package/dist/core/mcp-servers.d.ts.map +1 -0
  171. package/dist/core/mcp-servers.js +157 -0
  172. package/dist/core/mcp-servers.js.map +1 -0
  173. package/dist/core/messages.d.ts.map +1 -1
  174. package/dist/core/messages.js.map +1 -1
  175. package/dist/core/model-config.d.ts.map +1 -1
  176. package/dist/core/model-config.js.map +1 -1
  177. package/dist/core/model-registry.d.ts +13 -1
  178. package/dist/core/model-registry.d.ts.map +1 -1
  179. package/dist/core/model-registry.js +25 -0
  180. package/dist/core/model-registry.js.map +1 -1
  181. package/dist/core/model-resolver.d.ts +2 -2
  182. package/dist/core/model-resolver.d.ts.map +1 -1
  183. package/dist/core/model-resolver.js +5 -5
  184. package/dist/core/model-resolver.js.map +1 -1
  185. package/dist/core/model-runtime.d.ts +41 -3
  186. package/dist/core/model-runtime.d.ts.map +1 -1
  187. package/dist/core/model-runtime.js +167 -17
  188. package/dist/core/model-runtime.js.map +1 -1
  189. package/dist/core/models-store.d.ts.map +1 -1
  190. package/dist/core/models-store.js.map +1 -1
  191. package/dist/core/nested-tool-calls.d.ts +102 -0
  192. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  193. package/dist/core/nested-tool-calls.js +178 -0
  194. package/dist/core/nested-tool-calls.js.map +1 -0
  195. package/dist/core/output-guard.d.ts.map +1 -1
  196. package/dist/core/output-guard.js.map +1 -1
  197. package/dist/core/package-manager.d.ts +4 -0
  198. package/dist/core/package-manager.d.ts.map +1 -1
  199. package/dist/core/package-manager.js +59 -12
  200. package/dist/core/package-manager.js.map +1 -1
  201. package/dist/core/pi-client-cli-adapter.d.ts.map +1 -1
  202. package/dist/core/pi-client-cli-adapter.js.map +1 -1
  203. package/dist/core/pi-client-runtime-update.d.ts.map +1 -1
  204. package/dist/core/pi-client-runtime-update.js.map +1 -1
  205. package/dist/core/pi-manifest.d.ts.map +1 -1
  206. package/dist/core/pi-manifest.js.map +1 -1
  207. package/dist/core/pi-server-client.d.ts.map +1 -1
  208. package/dist/core/pi-server-client.js.map +1 -1
  209. package/dist/core/pi-server-protocol.d.ts.map +1 -1
  210. package/dist/core/pi-server-protocol.js.map +1 -1
  211. package/dist/core/pi-server-request.d.ts.map +1 -1
  212. package/dist/core/pi-server-request.js.map +1 -1
  213. package/dist/core/project-trust.d.ts.map +1 -1
  214. package/dist/core/project-trust.js.map +1 -1
  215. package/dist/core/prompt-templates.d.ts.map +1 -1
  216. package/dist/core/prompt-templates.js.map +1 -1
  217. package/dist/core/provider-attribution.d.ts.map +1 -1
  218. package/dist/core/provider-attribution.js.map +1 -1
  219. package/dist/core/provider-composer.d.ts +40 -21
  220. package/dist/core/provider-composer.d.ts.map +1 -1
  221. package/dist/core/provider-composer.js +92 -40
  222. package/dist/core/provider-composer.js.map +1 -1
  223. package/dist/core/radius.d.ts.map +1 -1
  224. package/dist/core/radius.js.map +1 -1
  225. package/dist/core/remote-catalog-provider.d.ts +8 -1
  226. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  227. package/dist/core/remote-catalog-provider.js +18 -3
  228. package/dist/core/remote-catalog-provider.js.map +1 -1
  229. package/dist/core/resolve-config-value.d.ts.map +1 -1
  230. package/dist/core/resolve-config-value.js.map +1 -1
  231. package/dist/core/resource-loader.d.ts +7 -1
  232. package/dist/core/resource-loader.d.ts.map +1 -1
  233. package/dist/core/resource-loader.js +161 -35
  234. package/dist/core/resource-loader.js.map +1 -1
  235. package/dist/core/runtime-credentials.d.ts.map +1 -1
  236. package/dist/core/runtime-credentials.js.map +1 -1
  237. package/dist/core/sdk.d.ts +1 -1
  238. package/dist/core/sdk.d.ts.map +1 -1
  239. package/dist/core/sdk.js +24 -6
  240. package/dist/core/sdk.js.map +1 -1
  241. package/dist/core/session-cwd.d.ts.map +1 -1
  242. package/dist/core/session-cwd.js.map +1 -1
  243. package/dist/core/session-export.d.ts.map +1 -1
  244. package/dist/core/session-export.js.map +1 -1
  245. package/dist/core/session-manager.d.ts +9 -0
  246. package/dist/core/session-manager.d.ts.map +1 -1
  247. package/dist/core/session-manager.js +22 -22
  248. package/dist/core/session-manager.js.map +1 -1
  249. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  250. package/dist/core/settings-diagnostics.js.map +1 -1
  251. package/dist/core/settings-manager.d.ts +31 -1
  252. package/dist/core/settings-manager.d.ts.map +1 -1
  253. package/dist/core/settings-manager.js +72 -2
  254. package/dist/core/settings-manager.js.map +1 -1
  255. package/dist/core/skills.d.ts.map +1 -1
  256. package/dist/core/skills.js.map +1 -1
  257. package/dist/core/slash-commands.d.ts.map +1 -1
  258. package/dist/core/source-info.d.ts +8 -0
  259. package/dist/core/source-info.d.ts.map +1 -1
  260. package/dist/core/source-info.js +16 -0
  261. package/dist/core/source-info.js.map +1 -1
  262. package/dist/core/system-prompt.d.ts.map +1 -1
  263. package/dist/core/system-prompt.js +1 -1
  264. package/dist/core/system-prompt.js.map +1 -1
  265. package/dist/core/telemetry.d.ts.map +1 -1
  266. package/dist/core/telemetry.js.map +1 -1
  267. package/dist/core/timings.d.ts.map +1 -1
  268. package/dist/core/timings.js.map +1 -1
  269. package/dist/core/tools/bash.d.ts +12 -0
  270. package/dist/core/tools/bash.d.ts.map +1 -1
  271. package/dist/core/tools/bash.js +35 -2
  272. package/dist/core/tools/bash.js.map +1 -1
  273. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  274. package/dist/core/tools/edit-diff.js.map +1 -1
  275. package/dist/core/tools/edit.d.ts.map +1 -1
  276. package/dist/core/tools/edit.js.map +1 -1
  277. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  278. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  279. package/dist/core/tools/find.d.ts.map +1 -1
  280. package/dist/core/tools/find.js.map +1 -1
  281. package/dist/core/tools/grep.d.ts.map +1 -1
  282. package/dist/core/tools/grep.js.map +1 -1
  283. package/dist/core/tools/index.d.ts.map +1 -1
  284. package/dist/core/tools/index.js.map +1 -1
  285. package/dist/core/tools/ls.d.ts.map +1 -1
  286. package/dist/core/tools/ls.js.map +1 -1
  287. package/dist/core/tools/output-accumulator.d.ts +11 -0
  288. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  289. package/dist/core/tools/output-accumulator.js +36 -0
  290. package/dist/core/tools/output-accumulator.js.map +1 -1
  291. package/dist/core/tools/path-utils.d.ts.map +1 -1
  292. package/dist/core/tools/path-utils.js.map +1 -1
  293. package/dist/core/tools/powershell.d.ts.map +1 -1
  294. package/dist/core/tools/powershell.js.map +1 -1
  295. package/dist/core/tools/read.d.ts.map +1 -1
  296. package/dist/core/tools/read.js.map +1 -1
  297. package/dist/core/tools/render-utils.d.ts +6 -0
  298. package/dist/core/tools/render-utils.d.ts.map +1 -1
  299. package/dist/core/tools/render-utils.js +26 -0
  300. package/dist/core/tools/render-utils.js.map +1 -1
  301. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  302. package/dist/core/tools/renderers/bash.js +9 -10
  303. package/dist/core/tools/renderers/bash.js.map +1 -1
  304. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  305. package/dist/core/tools/renderers/edit.js.map +1 -1
  306. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  307. package/dist/core/tools/renderers/find.js.map +1 -1
  308. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  309. package/dist/core/tools/renderers/grep.js.map +1 -1
  310. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  311. package/dist/core/tools/renderers/index.js.map +1 -1
  312. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  313. package/dist/core/tools/renderers/ls.js.map +1 -1
  314. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  315. package/dist/core/tools/renderers/read.js +3 -2
  316. package/dist/core/tools/renderers/read.js.map +1 -1
  317. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  318. package/dist/core/tools/renderers/write.js.map +1 -1
  319. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  320. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  321. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  322. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  323. package/dist/core/tools/truncate.d.ts +14 -0
  324. package/dist/core/tools/truncate.d.ts.map +1 -1
  325. package/dist/core/tools/truncate.js +29 -0
  326. package/dist/core/tools/truncate.js.map +1 -1
  327. package/dist/core/tools/write.d.ts.map +1 -1
  328. package/dist/core/tools/write.js.map +1 -1
  329. package/dist/core/trust-manager.d.ts.map +1 -1
  330. package/dist/core/trust-manager.js +1 -0
  331. package/dist/core/trust-manager.js.map +1 -1
  332. package/dist/core/usage-totals.d.ts +2 -0
  333. package/dist/core/usage-totals.d.ts.map +1 -1
  334. package/dist/core/usage-totals.js +23 -0
  335. package/dist/core/usage-totals.js.map +1 -1
  336. package/dist/core/virtual-models.d.ts +115 -0
  337. package/dist/core/virtual-models.d.ts.map +1 -0
  338. package/dist/core/virtual-models.js +117 -0
  339. package/dist/core/virtual-models.js.map +1 -0
  340. package/dist/extensions/codemode/execute.d.ts +16 -0
  341. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  342. package/dist/extensions/codemode/execute.js +390 -0
  343. package/dist/extensions/codemode/execute.js.map +1 -0
  344. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  345. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  346. package/dist/extensions/codemode/execute.lazy.js +3 -0
  347. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  348. package/dist/extensions/codemode/index.d.ts +21 -0
  349. package/dist/extensions/codemode/index.d.ts.map +1 -0
  350. package/dist/extensions/codemode/index.js +31 -0
  351. package/dist/extensions/codemode/index.js.map +1 -0
  352. package/dist/extensions/codemode/renderer.d.ts +12 -0
  353. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  354. package/dist/extensions/codemode/renderer.js +119 -0
  355. package/dist/extensions/codemode/renderer.js.map +1 -0
  356. package/dist/extensions/codemode/tool.d.ts +122 -0
  357. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  358. package/dist/extensions/codemode/tool.js +324 -0
  359. package/dist/extensions/codemode/tool.js.map +1 -0
  360. package/dist/extensions/codemode/worker.d.ts +7 -0
  361. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  362. package/dist/extensions/codemode/worker.js +7 -0
  363. package/dist/extensions/codemode/worker.js.map +1 -0
  364. package/dist/extensions/index.d.ts.map +1 -1
  365. package/dist/extensions/index.js +11 -1
  366. package/dist/extensions/index.js.map +1 -1
  367. package/dist/extensions/llama/client.d.ts.map +1 -1
  368. package/dist/extensions/llama/client.js.map +1 -1
  369. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  370. package/dist/extensions/llama/huggingface.js.map +1 -1
  371. package/dist/extensions/llama/index.d.ts.map +1 -1
  372. package/dist/extensions/llama/index.js.map +1 -1
  373. package/dist/extensions/llama/provider.d.ts +1 -1
  374. package/dist/extensions/llama/provider.d.ts.map +1 -1
  375. package/dist/extensions/llama/provider.js +65 -13
  376. package/dist/extensions/llama/provider.js.map +1 -1
  377. package/dist/extensions/llama/ui.d.ts.map +1 -1
  378. package/dist/extensions/llama/ui.js.map +1 -1
  379. package/dist/extensions/mcp/cli.d.ts +21 -0
  380. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  381. package/dist/extensions/mcp/cli.js +485 -0
  382. package/dist/extensions/mcp/cli.js.map +1 -0
  383. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  384. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  385. package/dist/extensions/mcp/cli.lazy.js +3 -0
  386. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  387. package/dist/extensions/mcp/config.d.ts +70 -0
  388. package/dist/extensions/mcp/config.d.ts.map +1 -0
  389. package/dist/extensions/mcp/config.js +146 -0
  390. package/dist/extensions/mcp/config.js.map +1 -0
  391. package/dist/extensions/mcp/index.d.ts +52 -0
  392. package/dist/extensions/mcp/index.d.ts.map +1 -0
  393. package/dist/extensions/mcp/index.js +902 -0
  394. package/dist/extensions/mcp/index.js.map +1 -0
  395. package/dist/extensions/mcp/log.d.ts +16 -0
  396. package/dist/extensions/mcp/log.d.ts.map +1 -0
  397. package/dist/extensions/mcp/log.js +66 -0
  398. package/dist/extensions/mcp/log.js.map +1 -0
  399. package/dist/extensions/mcp/oauth.d.ts +94 -0
  400. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  401. package/dist/extensions/mcp/oauth.js +333 -0
  402. package/dist/extensions/mcp/oauth.js.map +1 -0
  403. package/dist/extensions/mcp/resources.d.ts +43 -0
  404. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  405. package/dist/extensions/mcp/resources.js +262 -0
  406. package/dist/extensions/mcp/resources.js.map +1 -0
  407. package/dist/extensions/mcp/runtime.d.ts +96 -0
  408. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  409. package/dist/extensions/mcp/runtime.js +388 -0
  410. package/dist/extensions/mcp/runtime.js.map +1 -0
  411. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  412. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  413. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  414. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  415. package/dist/extensions/mcp/tools.d.ts +83 -0
  416. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  417. package/dist/extensions/mcp/tools.js +233 -0
  418. package/dist/extensions/mcp/tools.js.map +1 -0
  419. package/dist/extensions/mcp/ui.d.ts +60 -0
  420. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  421. package/dist/extensions/mcp/ui.js +172 -0
  422. package/dist/extensions/mcp/ui.js.map +1 -0
  423. package/dist/extensions/tool-search/index.d.ts +12 -0
  424. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  425. package/dist/extensions/tool-search/index.js +15 -0
  426. package/dist/extensions/tool-search/index.js.map +1 -0
  427. package/dist/extensions/tool-search/tool.d.ts +72 -0
  428. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  429. package/dist/extensions/tool-search/tool.js +210 -0
  430. package/dist/extensions/tool-search/tool.js.map +1 -0
  431. package/dist/index.d.ts +9 -2
  432. package/dist/index.d.ts.map +1 -1
  433. package/dist/index.js +5 -0
  434. package/dist/index.js.map +1 -1
  435. package/dist/main.d.ts.map +1 -1
  436. package/dist/main.js +10 -0
  437. package/dist/main.js.map +1 -1
  438. package/dist/migrations.d.ts.map +1 -1
  439. package/dist/migrations.js.map +1 -1
  440. package/dist/modes/index.d.ts.map +1 -1
  441. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  442. package/dist/modes/interactive/bug-report.js.map +1 -1
  443. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  444. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  445. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  446. package/dist/modes/interactive/components/armin.js.map +1 -1
  447. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  448. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  449. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  450. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  451. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  452. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  453. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  454. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  455. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  456. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  457. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  458. package/dist/modes/interactive/components/config-selector.js +13 -3
  459. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  460. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  461. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  462. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  464. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  465. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  466. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  467. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  468. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  469. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  470. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  471. package/dist/modes/interactive/components/diff.js.map +1 -1
  472. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  473. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  474. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  475. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  476. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  478. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  479. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  480. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  482. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  483. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  484. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  485. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  486. package/dist/modes/interactive/components/footer.d.ts +7 -0
  487. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/footer.js +43 -3
  489. package/dist/modes/interactive/components/footer.js.map +1 -1
  490. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  492. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  493. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  494. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  495. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  496. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  497. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  499. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  501. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  502. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  503. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  504. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  505. package/dist/modes/interactive/components/pi-logo.js +25 -0
  506. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  507. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  508. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  509. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  510. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  511. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  512. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  513. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  514. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/settings-selector.js +28 -6
  516. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  517. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  518. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  519. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  521. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  522. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  523. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  524. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  525. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  527. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  528. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  529. package/dist/modes/interactive/components/themed-text.js +29 -0
  530. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  531. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  532. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  533. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/tool-execution.js +2 -2
  535. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  536. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  537. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  538. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  539. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  540. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  542. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  543. package/dist/modes/interactive/components/user-message.js.map +1 -1
  544. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  546. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  547. package/dist/modes/interactive/external-editor.js.map +1 -1
  548. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  549. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  550. package/dist/modes/interactive/interactive-mode.js +199 -161
  551. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  552. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  553. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  554. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  555. package/dist/modes/interactive/model-search.js.map +1 -1
  556. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  557. package/dist/modes/interactive/session-share.js.map +1 -1
  558. package/dist/modes/interactive/theme/dark.json +59 -72
  559. package/dist/modes/interactive/theme/light.json +57 -69
  560. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  561. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  562. package/dist/modes/interactive/theme/system-theme.js +535 -0
  563. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  564. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  565. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  566. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  567. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  568. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  569. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  570. package/dist/modes/interactive/theme/theme-json.js +3 -1
  571. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  572. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  573. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  574. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  575. package/dist/modes/interactive/theme/theme.js +238 -317
  576. package/dist/modes/interactive/theme/theme.js.map +1 -1
  577. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  578. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  579. package/dist/modes/interactive/tui-renderer.js +1 -0
  580. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  581. package/dist/modes/json-event.d.ts.map +1 -1
  582. package/dist/modes/json-event.js.map +1 -1
  583. package/dist/modes/print-mode.d.ts.map +1 -1
  584. package/dist/modes/print-mode.js.map +1 -1
  585. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  586. package/dist/modes/rpc/jsonl.js.map +1 -1
  587. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  588. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  589. package/dist/modes/rpc/rpc-client.js +12 -8
  590. package/dist/modes/rpc/rpc-client.js.map +1 -1
  591. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  592. package/dist/modes/rpc/rpc-mode.js +7 -9
  593. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  594. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  595. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  596. package/dist/modes/rpc/rpc-types.js.map +1 -1
  597. package/dist/package-manager-cli.d.ts.map +1 -1
  598. package/dist/package-manager-cli.js +6 -2
  599. package/dist/package-manager-cli.js.map +1 -1
  600. package/dist/pi-client-cli.d.ts.map +1 -1
  601. package/dist/pi-client-cli.js.map +1 -1
  602. package/dist/rpc-entry.d.ts.map +1 -1
  603. package/dist/rpc-entry.js.map +1 -1
  604. package/dist/utils/abort.d.ts.map +1 -1
  605. package/dist/utils/abort.js.map +1 -1
  606. package/dist/utils/ansi.d.ts.map +1 -1
  607. package/dist/utils/ansi.js.map +1 -1
  608. package/dist/utils/changelog.d.ts.map +1 -1
  609. package/dist/utils/changelog.js.map +1 -1
  610. package/dist/utils/child-process.d.ts.map +1 -1
  611. package/dist/utils/child-process.js.map +1 -1
  612. package/dist/utils/clipboard-command.d.ts.map +1 -1
  613. package/dist/utils/clipboard-command.js.map +1 -1
  614. package/dist/utils/clipboard-image.d.ts.map +1 -1
  615. package/dist/utils/clipboard-image.js +14 -17
  616. package/dist/utils/clipboard-image.js.map +1 -1
  617. package/dist/utils/clipboard.d.ts +2 -0
  618. package/dist/utils/clipboard.d.ts.map +1 -1
  619. package/dist/utils/clipboard.js +5 -0
  620. package/dist/utils/clipboard.js.map +1 -1
  621. package/dist/utils/deprecation.d.ts.map +1 -1
  622. package/dist/utils/deprecation.js.map +1 -1
  623. package/dist/utils/exif-orientation.d.ts.map +1 -1
  624. package/dist/utils/exif-orientation.js.map +1 -1
  625. package/dist/utils/frontmatter.d.ts.map +1 -1
  626. package/dist/utils/frontmatter.js.map +1 -1
  627. package/dist/utils/fs-watch.d.ts.map +1 -1
  628. package/dist/utils/fs-watch.js.map +1 -1
  629. package/dist/utils/git.d.ts.map +1 -1
  630. package/dist/utils/git.js.map +1 -1
  631. package/dist/utils/html.d.ts.map +1 -1
  632. package/dist/utils/html.js.map +1 -1
  633. package/dist/utils/image-convert.d.ts.map +1 -1
  634. package/dist/utils/image-convert.js.map +1 -1
  635. package/dist/utils/image-process.d.ts.map +1 -1
  636. package/dist/utils/image-process.js.map +1 -1
  637. package/dist/utils/image-resize-core.d.ts.map +1 -1
  638. package/dist/utils/image-resize-core.js.map +1 -1
  639. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  640. package/dist/utils/image-resize-worker.js.map +1 -1
  641. package/dist/utils/image-resize.d.ts.map +1 -1
  642. package/dist/utils/image-resize.js.map +1 -1
  643. package/dist/utils/json.d.ts.map +1 -1
  644. package/dist/utils/json.js.map +1 -1
  645. package/dist/utils/management-http.d.ts.map +1 -1
  646. package/dist/utils/management-http.js.map +1 -1
  647. package/dist/utils/mime.d.ts.map +1 -1
  648. package/dist/utils/mime.js.map +1 -1
  649. package/dist/utils/open-browser.d.ts.map +1 -1
  650. package/dist/utils/open-browser.js.map +1 -1
  651. package/dist/utils/paths.d.ts +3 -3
  652. package/dist/utils/paths.d.ts.map +1 -1
  653. package/dist/utils/paths.js +5 -4
  654. package/dist/utils/paths.js.map +1 -1
  655. package/dist/utils/photon.d.ts.map +1 -1
  656. package/dist/utils/photon.js.map +1 -1
  657. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  658. package/dist/utils/pi-user-agent.js.map +1 -1
  659. package/dist/utils/shell.d.ts +1 -3
  660. package/dist/utils/shell.d.ts.map +1 -1
  661. package/dist/utils/shell.js +3 -30
  662. package/dist/utils/shell.js.map +1 -1
  663. package/dist/utils/sleep.d.ts.map +1 -1
  664. package/dist/utils/sleep.js.map +1 -1
  665. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  666. package/dist/utils/syntax-highlight.js +2 -0
  667. package/dist/utils/syntax-highlight.js.map +1 -1
  668. package/dist/utils/text.d.ts.map +1 -1
  669. package/dist/utils/text.js.map +1 -1
  670. package/dist/utils/tool-result-images.d.ts.map +1 -1
  671. package/dist/utils/tool-result-images.js.map +1 -1
  672. package/dist/utils/tools-manager.d.ts.map +1 -1
  673. package/dist/utils/tools-manager.js.map +1 -1
  674. package/dist/utils/version-check.d.ts.map +1 -1
  675. package/dist/utils/version-check.js.map +1 -1
  676. package/dist/utils/windows-self-update.d.ts.map +1 -1
  677. package/dist/utils/windows-self-update.js.map +1 -1
  678. package/dist/utils/wsl.d.ts.map +1 -1
  679. package/dist/utils/wsl.js.map +1 -1
  680. package/dist/utils/zip.d.ts.map +1 -1
  681. package/dist/utils/zip.js.map +1 -1
  682. package/docs/cli.md +64 -3
  683. package/docs/configuration.md +2 -0
  684. package/docs/custom-provider.md +43 -4
  685. package/docs/docs.json +8 -0
  686. package/docs/extensions.md +55 -0
  687. package/docs/keybindings.md +1 -1
  688. package/docs/llama-cpp.md +13 -0
  689. package/docs/mcp.md +188 -0
  690. package/docs/models.md +35 -0
  691. package/docs/packages.md +4 -2
  692. package/docs/providers.md +1 -0
  693. package/docs/rpc-commands.md +9 -3
  694. package/docs/rpc.md +3 -1
  695. package/docs/sdk.md +7 -2
  696. package/docs/security.md +2 -0
  697. package/docs/session-format.md +5 -1
  698. package/docs/settings.md +20 -3
  699. package/docs/themes.md +33 -7
  700. package/docs/tui.md +18 -0
  701. package/docs/virtual-models.md +114 -0
  702. package/docs/windows.md +2 -0
  703. package/examples/README.md +1 -1
  704. package/examples/extensions/README.md +2 -0
  705. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  706. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  707. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  708. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  709. package/examples/extensions/debug-provider.ts +90 -0
  710. package/examples/extensions/gondolin/package-lock.json +2 -2
  711. package/examples/extensions/gondolin/package.json +1 -1
  712. package/examples/extensions/jev-router.ts +113 -0
  713. package/examples/extensions/sandbox/package-lock.json +2 -2
  714. package/examples/extensions/sandbox/package.json +1 -1
  715. package/examples/extensions/with-deps/package-lock.json +2 -2
  716. package/examples/extensions/with-deps/package.json +1 -1
  717. package/examples/rpc-client.ts +1 -1
  718. package/examples/rpc-extension-ui.ts +1 -1
  719. package/examples/sdk/14-codemode-mcp.ts +61 -0
  720. package/examples/sdk/README.md +2 -1
  721. package/package.json +14 -12
  722. package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
  723. package/dist/bundle/chunks/azure-openai-responses-QJ7SPP5M.js +0 -2
  724. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  725. package/dist/bundle/chunks/chunk-BZKWNWMI.js +0 -2
  726. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  727. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  728. package/dist/bundle/chunks/chunk-X2F52Z34.js +0 -1685
  729. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  730. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  731. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  732. package/dist/bundle/chunks/openai-responses-AH7QTG23.js +0 -2
  733. package/dist/bundle/chunks/virtual-modules-WWGGM27U.js +0 -2
@@ -34,7 +34,7 @@ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
34
34
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
35
35
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
36
36
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
37
- import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
37
+ import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
38
38
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
39
39
  import { parseGitUrl } from "../../utils/git.js";
40
40
  import { getCwdRelativePath } from "../../utils/paths.js";
@@ -65,11 +65,13 @@ import { LoginDialogComponent } from "./components/login-dialog.js";
65
65
  import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
66
66
  import { ModelSelectorComponent } from "./components/model-selector.js";
67
67
  import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
68
+ import { piLogoLines } from "./components/pi-logo.js";
68
69
  import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
69
70
  import { SessionSelectorComponent } from "./components/session-selector.js";
70
71
  import { SettingsSelectorComponent } from "./components/settings-selector.js";
71
72
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
72
73
  import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
74
+ import { ThemedText } from "./components/themed-text.js";
73
75
  import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
74
76
  import { ToolExecutionComponent } from "./components/tool-execution.js";
75
77
  import { TreeSelectorComponent } from "./components/tree-selector.js";
@@ -80,7 +82,7 @@ import { editInExternalEditor } from "./external-editor.js";
80
82
  import { refreshModelCatalogs } from "./model-catalog-refresh.js";
81
83
  import { getModelSearchText } from "./model-search.js";
82
84
  import { shareSession } from "./session-share.js";
83
- import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
85
+ import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
84
86
  import { InteractiveThemeController } from "./theme/theme-controller.js";
85
87
  import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
86
88
  export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
@@ -93,16 +95,16 @@ function isWorkingStatusEditor(editor) {
93
95
  function isExpandable(obj) {
94
96
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
95
97
  }
96
- class ExpandableText extends Text {
97
- getCollapsedText;
98
- getExpandedText;
98
+ class ExpandableText extends ThemedText {
99
+ state;
99
100
  constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
100
- super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
101
- this.getCollapsedText = getCollapsedText;
102
- this.getExpandedText = getExpandedText;
101
+ const state = { expanded };
102
+ super(() => (state.expanded ? getExpandedText() : getCollapsedText()), paddingX, paddingY);
103
+ this.state = state;
103
104
  }
104
105
  setExpanded(expanded) {
105
- this.setText(expanded ? this.getExpandedText() : this.getCollapsedText());
106
+ this.state.expanded = expanded;
107
+ this.invalidate();
106
108
  }
107
109
  }
108
110
  function isCustomSessionEntry(item) {
@@ -257,6 +259,7 @@ export class InteractiveMode {
257
259
  // Status line tracking (for mutating immediately-sequential status updates)
258
260
  lastStatusSpacer = undefined;
259
261
  lastStatusText = undefined;
262
+ lastStatusMessage = "";
260
263
  managedToolStatusStarted = false;
261
264
  // Streaming message tracking
262
265
  streamingComponent = undefined;
@@ -347,7 +350,7 @@ export class InteractiveMode {
347
350
  });
348
351
  this.runtimeHost.setRebindSession(async () => {
349
352
  await this.rebindCurrentSession({ renderBeforeBind: true });
350
- await this.themeController.applyFromSettings();
353
+ this.themeController.applyFromSettings();
351
354
  });
352
355
  this.version = VERSION;
353
356
  this.renderer = createInteractiveTui({
@@ -357,6 +360,7 @@ export class InteractiveMode {
357
360
  terminal: options.terminal,
358
361
  onRightClickPaste: this.onRightClickPaste,
359
362
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
363
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
360
364
  });
361
365
  this.ui = createInteractiveTuiReference(() => this.renderer);
362
366
  this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
@@ -401,7 +405,8 @@ export class InteractiveMode {
401
405
  });
402
406
  }
403
407
  getAutocompleteSourceTag(sourceInfo) {
404
- if (!sourceInfo) {
408
+ // Built-in extension commands are untagged, like built-in commands.
409
+ if (!sourceInfo || sourceInfo.source === "builtin") {
405
410
  return undefined;
406
411
  }
407
412
  const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
@@ -554,7 +559,7 @@ export class InteractiveMode {
554
559
  this.chatContainer.addChild(new Text(condensedText, 1, 0));
555
560
  }
556
561
  else {
557
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
562
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
558
563
  this.chatContainer.addChild(new Spacer(1));
559
564
  this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
560
565
  this.chatContainer.addChild(new Spacer(1));
@@ -606,6 +611,7 @@ export class InteractiveMode {
606
611
  terminal,
607
612
  onRightClickPaste: this.onRightClickPaste,
608
613
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
614
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
609
615
  });
610
616
  nextUi.setClearOnShrink(clearOnShrink);
611
617
  nextUi.onDebug = onDebug;
@@ -683,13 +689,21 @@ export class InteractiveMode {
683
689
  this.ui.start();
684
690
  this.bindAbortInputListener();
685
691
  this.isInitialized = true;
686
- await this.themeController.applyFromSettings();
692
+ this.themeController.applyFromSettings();
693
+ // The header and startup notices bake theme colors into their text, so build them once the terminal
694
+ // reported its colors. This ends at the terminal's DA1 reply, or after 100 ms if it answers nothing.
695
+ await this.themeController.waitForTerminalColors();
687
696
  // Add header with keybindings from config (unless silenced)
688
697
  if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
689
- const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
698
+ // Built on demand so the header follows theme changes. The logo's first line carries the version,
699
+ // its second line the first line of key hints.
700
+ const withLogo = (hints) => {
701
+ const [top, bottom] = piLogoLines();
702
+ return `${top} ${theme.fg("dim", `v${this.version}`)}\n${bottom} ${hints}`;
703
+ };
690
704
  // Build startup instructions using keybinding hint helpers
691
705
  const hint = (keybinding, description) => keyHint(keybinding, description);
692
- const expandedInstructions = [
706
+ const expandedInstructions = () => [
693
707
  hint("app.interrupt", "to interrupt"),
694
708
  hint("app.clear", "to clear"),
695
709
  rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
@@ -707,19 +721,19 @@ export class InteractiveMode {
707
721
  rawKeyHint("!!", "to run bash (no context)"),
708
722
  hint("app.message.followUp", "to queue follow-up"),
709
723
  hint("app.message.dequeue", "to edit all queued messages"),
710
- hint("app.clipboard.pasteImage", "to paste image (with text fallback)"),
724
+ hint("app.clipboard.pasteImage", "to paste files on macOS, images, or text"),
711
725
  rawKeyHint("drop files", "to attach"),
712
726
  ].join("\n");
713
- const compactInstructions = [
727
+ const compactInstructions = () => [
714
728
  hint("app.interrupt", "interrupt"),
715
729
  rawKeyHint(`${keyText("app.clear")}/${keyText("app.exit")}`, "clear/exit"),
716
730
  rawKeyHint("/", "commands"),
717
731
  rawKeyHint("!", "bash"),
718
732
  hint("app.tools.expand", "more"),
719
733
  ].join(theme.fg("muted", " · "));
720
- const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
721
- const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
722
- this.builtInHeader = new ExpandableText(() => `${logo}\n${compactInstructions}\n${compactOnboarding}\n\n${onboarding}`, () => `${logo}\n${expandedInstructions}\n\n${onboarding}`, this.getStartupExpansionState(), 1, 0);
734
+ const compactOnboarding = () => theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
735
+ const onboarding = () => theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
736
+ this.builtInHeader = new ExpandableText(() => `${withLogo(compactInstructions())}\n${compactOnboarding()}\n\n${onboarding()}`, () => `${withLogo(expandedInstructions())}\n\n${onboarding()}`, this.getStartupExpansionState(), 1, 0);
723
737
  // Setup UI layout
724
738
  this.headerContainer.addChild(new Spacer(1));
725
739
  this.headerContainer.addChild(this.builtInHeader);
@@ -1306,8 +1320,9 @@ export class InteractiveMode {
1306
1320
  }
1307
1321
  return theme.fg("dim", ` ${labels.join(", ")}`);
1308
1322
  };
1323
+ // Bodies are built on demand so the listing follows theme changes.
1309
1324
  const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
1310
- const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
1325
+ const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody()}`, () => `${sectionHeader(name, color)}\n${expandedBody()}`, this.getStartupExpansionState(), 0, 0);
1311
1326
  this.loadedResourcesContainer.addChild(section);
1312
1327
  this.loadedResourcesContainer.addChild(new Spacer(1));
1313
1328
  };
@@ -1352,27 +1367,25 @@ export class InteractiveMode {
1352
1367
  ];
1353
1368
  if (contextFiles.length > 0) {
1354
1369
  this.loadedResourcesContainer.addChild(new Spacer(1));
1355
- const contextList = contextFiles
1356
- .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
1357
- .join("\n");
1358
- const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1370
+ const contextList = () => contextFiles.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`)).join("\n");
1371
+ const contextCompactList = () => formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1359
1372
  addLoadedSection("Context", contextCompactList, contextList);
1360
1373
  }
1361
1374
  const skills = skillsResult.skills;
1362
1375
  if (skills.length > 0) {
1363
1376
  const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
1364
- const skillList = this.formatScopeGroups(groups, {
1377
+ const skillList = () => this.formatScopeGroups(groups, {
1365
1378
  formatPath: (item) => this.formatDisplayPath(item.path),
1366
1379
  formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1367
1380
  });
1368
- const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
1381
+ const skillCompactList = () => formatCompactList(skills.map((skill) => skill.name));
1369
1382
  addLoadedSection("Skills", skillCompactList, skillList);
1370
1383
  }
1371
1384
  const templates = this.session.promptTemplates;
1372
1385
  if (templates.length > 0) {
1373
1386
  const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
1374
1387
  const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
1375
- const templateList = this.formatScopeGroups(groups, {
1388
+ const templateList = () => this.formatScopeGroups(groups, {
1376
1389
  formatPath: (item) => {
1377
1390
  const template = templateByPath.get(item.path);
1378
1391
  return template ? `/${template.name}` : this.formatDisplayPath(item.path);
@@ -1382,53 +1395,40 @@ export class InteractiveMode {
1382
1395
  return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1383
1396
  },
1384
1397
  });
1385
- const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1398
+ const promptCompactList = () => formatCompactList(templates.map((template) => `/${template.name}`));
1386
1399
  addLoadedSection("Prompts", promptCompactList, templateList);
1387
1400
  }
1388
1401
  if (extensions.length > 0) {
1389
1402
  const groups = this.buildScopeGroups(extensions);
1390
- const extList = this.formatScopeGroups(groups, {
1403
+ const extList = () => this.formatScopeGroups(groups, {
1391
1404
  formatPath: (item) => this.formatExtensionDisplayPath(item.path),
1392
1405
  formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
1393
1406
  });
1394
- const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
1407
+ const extensionLabels = this.getCompactExtensionLabels(extensions);
1408
+ const extensionCompactList = () => formatCompactList(extensionLabels);
1395
1409
  addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
1396
1410
  }
1397
- // Show loaded themes (excluding built-in)
1398
- const loadedThemes = themesResult.themes;
1399
- const customThemes = loadedThemes.filter((t) => t.sourcePath);
1400
- if (customThemes.length > 0) {
1401
- const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1402
- path: loadedTheme.sourcePath,
1403
- sourceInfo: loadedTheme.sourceInfo,
1404
- })));
1405
- const themeList = this.formatScopeGroups(groups, {
1406
- formatPath: (item) => this.formatDisplayPath(item.path),
1407
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1408
- });
1409
- const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1410
- addLoadedSection("Themes", themeCompactList, themeList);
1411
- }
1412
1411
  }
1413
1412
  if (showDiagnostics) {
1414
1413
  const skillDiagnostics = skillsResult.diagnostics;
1415
1414
  if (skillDiagnostics.length > 0) {
1416
- const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
1417
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
1415
+ const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
1416
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill conflicts]")}\n${warningLines()}`, 0, 0));
1418
1417
  this.loadedResourcesContainer.addChild(new Spacer(1));
1419
1418
  }
1420
1419
  const promptDiagnostics = promptsResult.diagnostics;
1421
1420
  if (promptDiagnostics.length > 0) {
1422
- const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
1423
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
1421
+ const warningLines = () => this.formatDiagnostics(promptDiagnostics, sourceInfos);
1422
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines()}`, 0, 0));
1424
1423
  this.loadedResourcesContainer.addChild(new Spacer(1));
1425
1424
  }
1426
1425
  const extensionDiagnostics = [];
1427
- const extensionErrors = this.session.resourceLoader.getExtensions().errors;
1428
- if (extensionErrors.length > 0) {
1429
- for (const error of extensionErrors) {
1430
- extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
1431
- }
1426
+ const extensionsResult = this.session.resourceLoader.getExtensions();
1427
+ for (const error of extensionsResult.errors) {
1428
+ extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
1429
+ }
1430
+ for (const warning of extensionsResult.warnings ?? []) {
1431
+ extensionDiagnostics.push({ type: "warning", message: warning.warning, path: warning.path });
1432
1432
  }
1433
1433
  const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
1434
1434
  extensionDiagnostics.push(...commandDiagnostics);
@@ -1436,14 +1436,14 @@ export class InteractiveMode {
1436
1436
  const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
1437
1437
  extensionDiagnostics.push(...shortcutDiagnostics);
1438
1438
  if (extensionDiagnostics.length > 0) {
1439
- const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
1440
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
1439
+ const warningLines = () => this.formatDiagnostics(extensionDiagnostics, sourceInfos);
1440
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Extension issues]")}\n${warningLines()}`, 0, 0));
1441
1441
  this.loadedResourcesContainer.addChild(new Spacer(1));
1442
1442
  }
1443
1443
  const themeDiagnostics = themesResult.diagnostics;
1444
1444
  if (themeDiagnostics.length > 0) {
1445
- const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
1446
- this.loadedResourcesContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
1445
+ const warningLines = () => this.formatDiagnostics(themeDiagnostics, sourceInfos);
1446
+ this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Theme conflicts]")}\n${warningLines()}`, 0, 0));
1447
1447
  this.loadedResourcesContainer.addChild(new Spacer(1));
1448
1448
  }
1449
1449
  }
@@ -1535,6 +1535,7 @@ export class InteractiveMode {
1535
1535
  this.applyFullscreenScrollbarSetting();
1536
1536
  if (this.renderer instanceof TuiAltScreen) {
1537
1537
  this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
1538
+ this.renderer.setWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());
1538
1539
  }
1539
1540
  this.footer.setSession(this.session);
1540
1541
  this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
@@ -1581,10 +1582,11 @@ export class InteractiveMode {
1581
1582
  this.showError(`${prefix}: ${message}`);
1582
1583
  const extensionHint = this.getCrashExtensionHint(error);
1583
1584
  if (extensionHint) {
1584
- this.chatContainer.addChild(new Text(theme.fg("warning", extensionHint), this.outputPad, 0));
1585
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", extensionHint), this.outputPad, 0));
1585
1586
  }
1586
1587
  if (this.recordCrash("fatal_error", error)) {
1587
- this.chatContainer.addChild(new Text(theme.fg("muted", this.crashReportInstructions()), this.outputPad, 0));
1588
+ const instructions = this.crashReportInstructions();
1589
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", instructions), this.outputPad, 0));
1588
1590
  }
1589
1591
  stopThemeWatcher();
1590
1592
  this.stop("transcript");
@@ -1620,7 +1622,7 @@ export class InteractiveMode {
1620
1622
  if (this.bugReportHintShown)
1621
1623
  return;
1622
1624
  this.bugReportHintShown = true;
1623
- 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));
1625
+ 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));
1624
1626
  this.ui.requestRender();
1625
1627
  }
1626
1628
  maybeSuggestBugReport(message) {
@@ -1874,7 +1876,7 @@ export class InteractiveMode {
1874
1876
  container.addChild(new Text(line, 1, 0));
1875
1877
  }
1876
1878
  if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
1877
- container.addChild(new Text(theme.fg("muted", "... (widget truncated)"), 1, 0));
1879
+ container.addChild(new ThemedText(() => theme.fg("muted", "... (widget truncated)"), 1, 0));
1878
1880
  }
1879
1881
  component = container;
1880
1882
  }
@@ -2404,17 +2406,14 @@ export class InteractiveMode {
2404
2406
  */
2405
2407
  showExtensionError(extensionPath, error, stack) {
2406
2408
  const errorMsg = `Extension "${extensionPath}" error: ${error}`;
2407
- const errorText = new Text(theme.fg("error", errorMsg), 1, 0);
2409
+ const errorText = new ThemedText(() => theme.fg("error", errorMsg), 1, 0);
2408
2410
  this.chatContainer.addChild(errorText);
2409
2411
  if (stack) {
2410
2412
  // Show stack trace in dim color, indented
2411
- const stackLines = stack
2412
- .split("\n")
2413
- .slice(1) // Skip first line (duplicates error message)
2414
- .map((line) => theme.fg("dim", ` ${line.trim()}`))
2415
- .join("\n");
2416
- if (stackLines) {
2417
- this.chatContainer.addChild(new Text(stackLines, 1, 0));
2413
+ const stackLines = stack.split("\n").slice(1); // Skip first line (duplicates error message)
2414
+ if (stackLines.length > 0) {
2415
+ const renderStack = () => stackLines.map((line) => theme.fg("dim", ` ${line.trim()}`)).join("\n");
2416
+ this.chatContainer.addChild(new ThemedText(renderStack, 1, 0));
2418
2417
  }
2419
2418
  }
2420
2419
  this.ui.requestRender();
@@ -2517,8 +2516,8 @@ export class InteractiveMode {
2517
2516
  this.updateEditorBorderColor();
2518
2517
  }
2519
2518
  };
2520
- // Handle clipboard paste (triggered on Ctrl+V). Images are attached by path;
2521
- // otherwise, paste plain text from the system clipboard.
2519
+ // Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,
2520
+ // images are attached via temporary files, and plain text is the final fallback.
2522
2521
  this.defaultEditor.onPasteImage = () => {
2523
2522
  void this.handleClipboardPaste();
2524
2523
  };
@@ -2541,6 +2540,22 @@ export class InteractiveMode {
2541
2540
  }
2542
2541
  async handleClipboardPaste() {
2543
2542
  try {
2543
+ const filePaths = await readClipboardFilePaths();
2544
+ if (filePaths) {
2545
+ if (filePaths.some((filePath) => /\p{Cc}/u.test(filePath))) {
2546
+ throw new Error("Clipboard file path contains control characters");
2547
+ }
2548
+ const paths = this.isBashMode ? filePaths.map(quoteIfNeeded).join(" ") : filePaths.join("\n");
2549
+ const cursor = this.editor.getCursor?.();
2550
+ const currentLine = cursor ? (this.editor.getText().split("\n")[cursor.line] ?? "") : "";
2551
+ const characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : "";
2552
+ const characterAfterCursor = cursor ? currentLine[cursor.col] : "";
2553
+ const leadingSpace = characterBeforeCursor && !/\s/.test(characterBeforeCursor) ? " " : "";
2554
+ const trailingSpace = characterAfterCursor && !/\s/.test(characterAfterCursor) ? " " : "";
2555
+ this.editor.insertTextAtCursor?.(`${leadingSpace}${paths}${trailingSpace}`);
2556
+ this.ui.requestRender();
2557
+ return;
2558
+ }
2544
2559
  const image = await readClipboardImage();
2545
2560
  if (image) {
2546
2561
  const tmpDir = os.tmpdir();
@@ -2558,8 +2573,8 @@ export class InteractiveMode {
2558
2573
  this.ui.requestRender();
2559
2574
  }
2560
2575
  }
2561
- catch {
2562
- // Silently ignore clipboard errors (may not have permission, etc.)
2576
+ catch (error) {
2577
+ this.showError(`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`);
2563
2578
  }
2564
2579
  }
2565
2580
  handleStartupSubmit(text) {
@@ -2988,6 +3003,9 @@ export class InteractiveMode {
2988
3003
  // The bash execution callback handles TUI output rendering.
2989
3004
  break;
2990
3005
  case "tool_execution_start": {
3006
+ // Nested calls (from codemode scripts) are shown inside their parent's row.
3007
+ if (event.parentToolCallId)
3008
+ break;
2991
3009
  let component = this.pendingTools.get(event.toolCallId);
2992
3010
  if (!component) {
2993
3011
  component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
@@ -3097,7 +3115,8 @@ export class InteractiveMode {
3097
3115
  }
3098
3116
  else {
3099
3117
  this.chatContainer.addChild(new Spacer(1));
3100
- this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
3118
+ const errorMessage = event.errorMessage;
3119
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("error", errorMessage), 1, 0));
3101
3120
  }
3102
3121
  }
3103
3122
  if (this.session.isAborting) {
@@ -3186,7 +3205,7 @@ export class InteractiveMode {
3186
3205
  }
3187
3206
  const message = status.type === "warning" ? `Warning: ${status.message}` : status.message;
3188
3207
  const color = status.type === "warning" ? "warning" : "dim";
3189
- this.chatContainer.addChild(new Text(theme.fg(color, message), 1, 0));
3208
+ this.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));
3190
3209
  this.lastStatusSpacer = undefined;
3191
3210
  this.lastStatusText = undefined;
3192
3211
  this.ui.requestRender();
@@ -3202,12 +3221,14 @@ export class InteractiveMode {
3202
3221
  const last = children.length > 0 ? children[children.length - 1] : undefined;
3203
3222
  const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
3204
3223
  if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
3205
- this.lastStatusText.setText(theme.fg("dim", message));
3224
+ this.lastStatusMessage = message;
3225
+ this.lastStatusText.invalidate();
3206
3226
  this.ui.requestRender();
3207
3227
  return;
3208
3228
  }
3209
3229
  const spacer = new Spacer(1);
3210
- const text = new Text(theme.fg("dim", message), 1, 0);
3230
+ this.lastStatusMessage = message;
3231
+ const text = new ThemedText(() => theme.fg("dim", this.lastStatusMessage), 1, 0);
3211
3232
  this.chatContainer.addChild(spacer);
3212
3233
  this.chatContainer.addChild(text);
3213
3234
  this.lastStatusSpacer = spacer;
@@ -3416,7 +3437,8 @@ export class InteractiveMode {
3416
3437
  if (!this.settingsManager.getShowCacheMissNotices())
3417
3438
  return;
3418
3439
  this.chatContainer.addChild(new Spacer(1));
3419
- this.chatContainer.addChild(new Text(theme.fg("dim", formatCacheWarmingUsage(entry)), 1, 0));
3440
+ const usage = formatCacheWarmingUsage(entry);
3441
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
3420
3442
  }
3421
3443
  /**
3422
3444
  * Render billing usage for a compaction or branch summary. The notice is derived
@@ -3430,7 +3452,7 @@ export class InteractiveMode {
3430
3452
  const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
3431
3453
  const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
3432
3454
  this.chatContainer.addChild(new Spacer(1));
3433
- this.chatContainer.addChild(new Text(theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3455
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3434
3456
  }
3435
3457
  static countDroppedThinkingBlocks(message) {
3436
3458
  let count = 0;
@@ -3467,7 +3489,7 @@ export class InteractiveMode {
3467
3489
  return;
3468
3490
  const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
3469
3491
  this.chatContainer.addChild(new Spacer(1));
3470
- this.chatContainer.addChild(new Text(theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
3492
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
3471
3493
  }
3472
3494
  /**
3473
3495
  * Show a transcript notice when a completed assistant message paid for a
@@ -3494,9 +3516,8 @@ export class InteractiveMode {
3494
3516
  else if (miss.idleMs >= CACHE_TTL_MS) {
3495
3517
  label = `Cache miss after ${Math.round(miss.idleMs / 60_000)}m idle`;
3496
3518
  }
3497
- const text = theme.fg("warning", `${label}: ${reBilled}`);
3498
3519
  this.chatContainer.addChild(new Spacer(1));
3499
- this.chatContainer.addChild(new Text(text, 1, 0));
3520
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${reBilled}`), 1, 0));
3500
3521
  }
3501
3522
  renderInitialMessages() {
3502
3523
  const entries = this.sessionManager.buildContextEntries();
@@ -3520,7 +3541,7 @@ export class InteractiveMode {
3520
3541
  if (this.chatContainer.children.length > 0) {
3521
3542
  this.chatContainer.addChild(new Spacer(1));
3522
3543
  }
3523
- 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));
3544
+ 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));
3524
3545
  }
3525
3546
  async getUserInput() {
3526
3547
  const queuedInput = this.pendingUserInputs.shift();
@@ -3871,26 +3892,28 @@ export class InteractiveMode {
3871
3892
  }
3872
3893
  showError(errorMessage) {
3873
3894
  this.chatContainer.addChild(new Spacer(1));
3874
- this.chatContainer.addChild(new Text(theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
3895
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
3875
3896
  this.ui.requestRender();
3876
3897
  }
3877
3898
  showWarning(warningMessage) {
3878
3899
  this.chatContainer.addChild(new Spacer(1));
3879
- this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
3900
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
3880
3901
  this.ui.requestRender();
3881
3902
  }
3882
3903
  showNewVersionNotification(release) {
3883
- const action = theme.fg("accent", `${APP_NAME} update`);
3884
- const updateInstruction = theme.fg("muted", `New version ${release.version} is available. Run `) + action;
3904
+ const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
3905
+ theme.fg("accent", `${APP_NAME} update`);
3885
3906
  const changelogUrl = "https://pi.dev/changelog";
3886
- const changelogLink = getCapabilities().hyperlinks
3887
- ? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
3888
- : theme.fg("accent", changelogUrl);
3889
- const changelogLine = theme.fg("muted", "Changelog: ") + changelogLink;
3907
+ const changelogLine = () => {
3908
+ const changelogLink = getCapabilities().hyperlinks
3909
+ ? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
3910
+ : theme.fg("accent", changelogUrl);
3911
+ return theme.fg("muted", "Changelog: ") + changelogLink;
3912
+ };
3890
3913
  const note = release.note?.trim();
3891
3914
  this.chatContainer.addChild(new Spacer(1));
3892
3915
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3893
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction}`, 1, 0));
3916
+ this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
3894
3917
  if (note) {
3895
3918
  this.chatContainer.addChild(new Spacer(1));
3896
3919
  this.chatContainer.addChild(new Markdown(note, 1, 0, this.getMarkdownThemeWithSettings(), {
@@ -3898,17 +3921,17 @@ export class InteractiveMode {
3898
3921
  }));
3899
3922
  this.chatContainer.addChild(new Spacer(1));
3900
3923
  }
3901
- this.chatContainer.addChild(new Text(changelogLine, 1, 0));
3924
+ this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
3902
3925
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3903
3926
  this.ui.requestRender();
3904
3927
  }
3905
3928
  showPackageUpdateNotification(packages) {
3906
- const action = theme.fg("accent", `${APP_NAME} update --extensions`);
3907
- const updateInstruction = theme.fg("muted", "Package updates are available. Run ") + action;
3929
+ const updateInstruction = () => theme.fg("muted", "Package updates are available. Run ") +
3930
+ theme.fg("accent", `${APP_NAME} update --extensions`);
3908
3931
  const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
3909
3932
  this.chatContainer.addChild(new Spacer(1));
3910
3933
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3911
- this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
3934
+ this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction()}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
3912
3935
  this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
3913
3936
  this.ui.requestRender();
3914
3937
  }
@@ -4156,7 +4179,7 @@ export class InteractiveMode {
4156
4179
  thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
4157
4180
  availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
4158
4181
  modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
4159
- currentTheme: this.themeController.getThemeSelection() || "dark",
4182
+ currentTheme: this.themeController.getThemeSelection() || SYSTEM_THEME_NAME,
4160
4183
  terminalTheme: this.themeController.getTerminalTheme(),
4161
4184
  availableThemes: getAvailableThemes(),
4162
4185
  hideThinkingBlock: this.hideThinkingBlock,
@@ -4178,6 +4201,7 @@ export class InteractiveMode {
4178
4201
  fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
4179
4202
  fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
4180
4203
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
4204
+ fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
4181
4205
  warnings: this.settingsManager.getWarnings(),
4182
4206
  }, {
4183
4207
  onAutoCompactChange: (enabled) => {
@@ -4252,7 +4276,7 @@ export class InteractiveMode {
4252
4276
  },
4253
4277
  onThemeChange: (themeSetting) => {
4254
4278
  this.settingsManager.setTheme(themeSetting);
4255
- void this.themeController.setThemeSetting(themeSetting);
4279
+ this.themeController.setThemeSetting(themeSetting);
4256
4280
  },
4257
4281
  onThemePreview: (themeName) => this.themeController.preview(themeName),
4258
4282
  onHideThinkingBlockChange: (hidden) => {
@@ -4357,6 +4381,11 @@ export class InteractiveMode {
4357
4381
  if (this.renderer instanceof TuiAltScreen)
4358
4382
  this.renderer.setCopyOnSelect(enabled);
4359
4383
  },
4384
+ onFullscreenWheelScrollLinesChange: (lines) => {
4385
+ this.settingsManager.setFullscreenWheelScrollLines(lines);
4386
+ if (this.renderer instanceof TuiAltScreen)
4387
+ this.renderer.setWheelScrollLines(lines);
4388
+ },
4360
4389
  onWarningsChange: (warnings) => {
4361
4390
  this.settingsManager.setWarnings(warnings);
4362
4391
  },
@@ -5339,7 +5368,7 @@ export class InteractiveMode {
5339
5368
  signal: dialog.signal,
5340
5369
  prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
5341
5370
  notify: (event) => this.notifyAuthDialog(dialog, event),
5342
- });
5371
+ }, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
5343
5372
  }
5344
5373
  async showLoginDialog(providerId, providerName) {
5345
5374
  const previousModel = this.session.model;
@@ -5387,7 +5416,7 @@ export class InteractiveMode {
5387
5416
  const borderColor = (s) => theme.fg("border", s);
5388
5417
  reloadBox.addChild(new DynamicBorder(borderColor));
5389
5418
  reloadBox.addChild(new Spacer(1));
5390
- reloadBox.addChild(new Text(theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
5419
+ reloadBox.addChild(new ThemedText(() => theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
5391
5420
  reloadBox.addChild(new Spacer(1));
5392
5421
  reloadBox.addChild(new DynamicBorder(borderColor));
5393
5422
  const previousEditor = this.editor;
@@ -5423,7 +5452,7 @@ export class InteractiveMode {
5423
5452
  }
5424
5453
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
5425
5454
  this.applyRuntimeSettings();
5426
- await this.themeController.applyFromSettings();
5455
+ this.themeController.applyFromSettings();
5427
5456
  this.setupAutocompleteProvider();
5428
5457
  const runner = this.session.extensionRunner;
5429
5458
  this.setupExtensionShortcuts(runner);
@@ -5587,7 +5616,7 @@ export class InteractiveMode {
5587
5616
  const currentName = this.sessionManager.getSessionName();
5588
5617
  if (currentName) {
5589
5618
  this.chatContainer.addChild(new Spacer(1));
5590
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name: ${currentName}`), 1, 0));
5619
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name: ${currentName}`), 1, 0));
5591
5620
  }
5592
5621
  else {
5593
5622
  this.showWarning("Usage: /name <name>");
@@ -5601,7 +5630,8 @@ export class InteractiveMode {
5601
5630
  this.showWarning(`Session name was normalized from ${JSON.stringify(name)} to ${JSON.stringify(sessionName)}`);
5602
5631
  }
5603
5632
  this.chatContainer.addChild(new Spacer(1));
5604
- this.chatContainer.addChild(new Text(theme.fg("dim", `Session name set: ${sessionName ?? name}`), 1, 0));
5633
+ const displayName = sessionName ?? name;
5634
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name set: ${displayName}`), 1, 0));
5605
5635
  this.ui.requestRender();
5606
5636
  }
5607
5637
  handleSessionCommand() {
@@ -5613,61 +5643,69 @@ export class InteractiveMode {
5613
5643
  // resolves to a concrete responseModel). Usage without model attribution is
5614
5644
  // grouped separately so the breakdown reconciles with the session total.
5615
5645
  const usageBreakdown = getUsageCostBreakdown(entries);
5616
- let info = `${theme.bold("Session Info")}\n\n`;
5617
- if (sessionName) {
5618
- info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
5619
- }
5620
- info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
5621
- info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
5622
- info += `${theme.bold("Messages")}\n`;
5623
- info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
5624
- info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
5625
- info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
5626
- info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
5627
- info += `${theme.bold("Tokens")}\n`;
5628
- // "Input" is the full prompt volume. With cache activity, split it into
5629
- // cached (served from cache) vs uncached (everything else) - the only
5630
- // provider-independent split. Cache writes, where reported, are a detail
5631
- // of the uncached portion.
5632
- const { input, cacheRead, cacheWrite } = stats.tokens;
5633
- const promptTokens = input + cacheRead + cacheWrite;
5634
- info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
5635
- if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
5636
- const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
5637
- info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
5638
- const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
5639
- info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
5640
- }
5641
- info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
5642
- info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
5646
+ // Snapshot the stats; the text is built on demand so it follows theme changes.
5643
5647
  const cacheWarmingStatus = this.session.cacheWarmingStatus;
5644
- info += `\n${theme.bold("Cache Warming")}\n`;
5645
- info += `${theme.fg("dim", "Mode:")} ${this.settingsManager.getCacheWarmingMode()}\n`;
5646
- info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
5647
- const decision = cacheWarmingStatus?.decision;
5648
- if (decision?.economicsAvailable) {
5649
- info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
5650
- info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
5651
- }
5652
- if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
5653
- info += `\n${theme.bold("Cost")}\n`;
5654
- info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
5655
- if (usageBreakdown.length > 1) {
5656
- for (const entry of usageBreakdown) {
5657
- info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
5648
+ const cacheWarmingMode = this.settingsManager.getCacheWarmingMode();
5649
+ const model = this.session.model;
5650
+ const selectedModelKey = `${model?.provider}/${model?.id}`;
5651
+ const renderInfo = () => {
5652
+ let info = `${theme.bold("Session Info")}\n\n`;
5653
+ if (sessionName) {
5654
+ info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
5655
+ }
5656
+ info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
5657
+ info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
5658
+ info += `${theme.bold("Messages")}\n`;
5659
+ info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
5660
+ info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
5661
+ info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
5662
+ info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
5663
+ info += `${theme.bold("Tokens")}\n`;
5664
+ // "Input" is the full prompt volume. With cache activity, split it into
5665
+ // cached (served from cache) vs uncached (everything else) - the only
5666
+ // provider-independent split. Cache writes, where reported, are a detail
5667
+ // of the uncached portion.
5668
+ const { input, cacheRead, cacheWrite } = stats.tokens;
5669
+ const promptTokens = input + cacheRead + cacheWrite;
5670
+ info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
5671
+ if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
5672
+ const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
5673
+ info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
5674
+ const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
5675
+ info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
5676
+ }
5677
+ info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
5678
+ info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
5679
+ info += `\n${theme.bold("Cache Warming")}\n`;
5680
+ info += `${theme.fg("dim", "Mode:")} ${cacheWarmingMode}\n`;
5681
+ info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
5682
+ const decision = cacheWarmingStatus?.decision;
5683
+ if (decision?.economicsAvailable) {
5684
+ info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
5685
+ info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
5686
+ }
5687
+ if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
5688
+ info += `\n${theme.bold("Cost")}\n`;
5689
+ info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
5690
+ // A single entry repeats the total, unless it names a model other than the selected one.
5691
+ if (usageBreakdown.length > 1 || usageBreakdown[0]?.key !== selectedModelKey) {
5692
+ for (const entry of usageBreakdown) {
5693
+ info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
5694
+ }
5695
+ }
5696
+ if (cacheWaste.missedTokens > 0) {
5697
+ const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
5698
+ const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
5699
+ info +=
5700
+ cacheWaste.missedCost >= 0.0001
5701
+ ? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
5702
+ : `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
5658
5703
  }
5659
5704
  }
5660
- if (cacheWaste.missedTokens > 0) {
5661
- const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
5662
- const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
5663
- info +=
5664
- cacheWaste.missedCost >= 0.0001
5665
- ? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
5666
- : `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
5667
- }
5668
- }
5705
+ return info;
5706
+ };
5669
5707
  this.chatContainer.addChild(new Spacer(1));
5670
- this.chatContainer.addChild(new Text(info, 1, 0));
5708
+ this.chatContainer.addChild(new ThemedText(renderInfo, 1, 0));
5671
5709
  this.ui.requestRender();
5672
5710
  }
5673
5711
  handleChangelogCommand() {
@@ -5681,7 +5719,7 @@ export class InteractiveMode {
5681
5719
  : "No changelog entries found.";
5682
5720
  this.chatContainer.addChild(new Spacer(1));
5683
5721
  this.chatContainer.addChild(new DynamicBorder());
5684
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
5722
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
5685
5723
  this.chatContainer.addChild(new Spacer(1));
5686
5724
  this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
5687
5725
  this.chatContainer.addChild(new DynamicBorder());
@@ -5782,7 +5820,7 @@ export class InteractiveMode {
5782
5820
  | \`${copyMessage}\` | Copy selection or last assistant message |
5783
5821
  | \`${followUp}\` | Queue follow-up message |
5784
5822
  | \`${dequeue}\` | Restore queued messages |
5785
- | \`${pasteImage}\` | Paste image or text from clipboard |
5823
+ | \`${pasteImage}\` | Paste files on macOS, images, or text from clipboard |
5786
5824
  | \`/\` | Slash commands |
5787
5825
  | \`!\` | Run bash command |
5788
5826
  | \`!!\` | Run bash command (excluded from context) |
@@ -5804,7 +5842,7 @@ export class InteractiveMode {
5804
5842
  }
5805
5843
  this.chatContainer.addChild(new Spacer(1));
5806
5844
  this.chatContainer.addChild(new DynamicBorder());
5807
- this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
5845
+ this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
5808
5846
  this.chatContainer.addChild(new Spacer(1));
5809
5847
  this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
5810
5848
  this.chatContainer.addChild(new DynamicBorder());
@@ -5818,7 +5856,7 @@ export class InteractiveMode {
5818
5856
  return;
5819
5857
  }
5820
5858
  this.chatContainer.addChild(new Spacer(1));
5821
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ New session started")}`, 1, 1));
5859
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("accent", "✓ New session started"), 1, 1));
5822
5860
  this.ui.requestRender();
5823
5861
  }
5824
5862
  catch (error) {
@@ -5849,7 +5887,7 @@ export class InteractiveMode {
5849
5887
  fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
5850
5888
  fs.writeFileSync(debugLogPath, debugData);
5851
5889
  this.chatContainer.addChild(new Spacer(1));
5852
- this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
5890
+ this.chatContainer.addChild(new ThemedText(() => `${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
5853
5891
  this.ui.requestRender();
5854
5892
  }
5855
5893
  handleArminSaysHi() {