@earendil-works/pi-coding-agent 0.84.3 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (533) hide show
  1. package/CHANGELOG.md +98 -2
  2. package/README.md +8 -5
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +10 -7
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/bun/runtime-setup.d.ts +2 -0
  7. package/dist/bun/runtime-setup.d.ts.map +1 -0
  8. package/dist/bun/runtime-setup.js +9 -0
  9. package/dist/bun/runtime-setup.js.map +1 -0
  10. package/dist/bundle/chunks/anthropic-messages-QAQLEQIY.js +6 -0
  11. package/dist/bundle/chunks/{azure-openai-responses-5ENVCQ7U.js → azure-openai-responses-Q7MJBRE6.js} +1 -1
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
  13. package/dist/bundle/chunks/{chunk-GPPBJGBU.js → chunk-2KVJKXS2.js} +1 -1
  14. package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  15. package/dist/bundle/chunks/chunk-EQ6DR6XK.js +5 -0
  16. package/dist/bundle/chunks/{chunk-MNAIPA3J.js → chunk-IDDQWTHI.js} +1 -1
  17. package/dist/bundle/chunks/chunk-LZKJTKCT.js +2 -0
  18. package/dist/bundle/chunks/{chunk-NBBFIJUL.js → chunk-OUXLLA64.js} +2 -2
  19. package/dist/bundle/chunks/chunk-R7UUJ4C2.js +42 -0
  20. package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
  21. package/dist/bundle/chunks/chunk-WBE4J4AU.js +9 -0
  22. package/dist/bundle/chunks/chunk-WZB2R5YO.js +1558 -0
  23. package/dist/bundle/chunks/github-copilot.js +1 -1
  24. package/dist/bundle/chunks/{google-generative-ai-XDKMGBCJ.js → google-generative-ai-BSMTYDAM.js} +1 -1
  25. package/dist/bundle/chunks/{google-vertex-D5FGEO3Y.js → google-vertex-5C3HASOJ.js} +1 -1
  26. package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
  27. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  28. package/dist/bundle/chunks/{mistral-conversations-YK73UAOZ.js → mistral-conversations-4M6BZBX6.js} +2 -2
  29. package/dist/bundle/chunks/node-EM5FIVUN.js +16 -0
  30. package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
  31. package/dist/bundle/chunks/openai-codex-responses-YJOO52RW.js +10 -0
  32. package/dist/bundle/chunks/openai-completions-QOT3QX7D.js +7 -0
  33. package/dist/bundle/chunks/openai-responses-U7LNPQN4.js +2 -0
  34. package/dist/bundle/chunks/{pi-messages-TPFH44NP.js → pi-messages-EGZIFQGG.js} +1 -1
  35. package/dist/bundle/cli.js +1 -1
  36. package/dist/bundle/client.js +1 -1
  37. package/dist/bundle/coordinator.js +3 -0
  38. package/dist/bundle/index.js +1 -1
  39. package/dist/bundle/rpc-entry.js +1 -1
  40. package/dist/cli/args.d.ts.map +1 -1
  41. package/dist/cli/args.js +2 -0
  42. package/dist/cli/args.js.map +1 -1
  43. package/dist/cli/config-selector.d.ts.map +1 -1
  44. package/dist/cli/config-selector.js +2 -1
  45. package/dist/cli/config-selector.js.map +1 -1
  46. package/dist/cli/experimental/cli.d.ts +7 -3
  47. package/dist/cli/experimental/cli.d.ts.map +1 -1
  48. package/dist/cli/experimental/cli.js +6 -2
  49. package/dist/cli/experimental/cli.js.map +1 -1
  50. package/dist/cli/experimental/command-options.d.ts +23 -12
  51. package/dist/cli/experimental/command-options.d.ts.map +1 -1
  52. package/dist/cli/experimental/command-options.js +69 -20
  53. package/dist/cli/experimental/command-options.js.map +1 -1
  54. package/dist/cli/experimental/command.d.ts +10 -3
  55. package/dist/cli/experimental/command.d.ts.map +1 -1
  56. package/dist/cli/experimental/command.js +28 -14
  57. package/dist/cli/experimental/command.js.map +1 -1
  58. package/dist/cli/experimental/commands/client.d.ts +8 -2
  59. package/dist/cli/experimental/commands/client.d.ts.map +1 -1
  60. package/dist/cli/experimental/commands/client.js +43 -5
  61. package/dist/cli/experimental/commands/client.js.map +1 -1
  62. package/dist/cli/experimental/commands/server.d.ts +7 -3
  63. package/dist/cli/experimental/commands/server.d.ts.map +1 -1
  64. package/dist/cli/experimental/commands/server.js +27 -8
  65. package/dist/cli/experimental/commands/server.js.map +1 -1
  66. package/dist/cli/startup-ui.d.ts.map +1 -1
  67. package/dist/cli/startup-ui.js +2 -1
  68. package/dist/cli/startup-ui.js.map +1 -1
  69. package/dist/cli.d.ts.map +1 -1
  70. package/dist/cli.js +23 -14
  71. package/dist/cli.js.map +1 -1
  72. package/dist/client/index.d.ts +1 -2
  73. package/dist/client/index.d.ts.map +1 -1
  74. package/dist/client/index.js +1 -2
  75. package/dist/client/index.js.map +1 -1
  76. package/dist/config.d.ts +1 -0
  77. package/dist/config.d.ts.map +1 -1
  78. package/dist/config.js +1 -0
  79. package/dist/config.js.map +1 -1
  80. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  81. package/dist/core/agent-session-runtime.js +15 -7
  82. package/dist/core/agent-session-runtime.js.map +1 -1
  83. package/dist/core/agent-session.d.ts +14 -7
  84. package/dist/core/agent-session.d.ts.map +1 -1
  85. package/dist/core/agent-session.js +91 -15
  86. package/dist/core/agent-session.js.map +1 -1
  87. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  88. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  89. package/dist/core/compaction/branch-summarization.js +6 -4
  90. package/dist/core/compaction/branch-summarization.js.map +1 -1
  91. package/dist/core/compaction/compaction.d.ts +5 -0
  92. package/dist/core/compaction/compaction.d.ts.map +1 -1
  93. package/dist/core/compaction/compaction.js +19 -5
  94. package/dist/core/compaction/compaction.js.map +1 -1
  95. package/dist/core/extensions/index.d.ts +1 -1
  96. package/dist/core/extensions/index.d.ts.map +1 -1
  97. package/dist/core/extensions/index.js.map +1 -1
  98. package/dist/core/extensions/loader.d.ts.map +1 -1
  99. package/dist/core/extensions/loader.js +1 -2
  100. package/dist/core/extensions/loader.js.map +1 -1
  101. package/dist/core/extensions/runner.d.ts +5 -0
  102. package/dist/core/extensions/runner.d.ts.map +1 -1
  103. package/dist/core/extensions/runner.js +45 -1
  104. package/dist/core/extensions/runner.js.map +1 -1
  105. package/dist/core/extensions/types.d.ts +26 -3
  106. package/dist/core/extensions/types.d.ts.map +1 -1
  107. package/dist/core/extensions/types.js.map +1 -1
  108. package/dist/core/http-dispatcher.d.ts.map +1 -1
  109. package/dist/core/http-dispatcher.js +2 -0
  110. package/dist/core/http-dispatcher.js.map +1 -1
  111. package/dist/core/messages.d.ts +1 -1
  112. package/dist/core/messages.d.ts.map +1 -1
  113. package/dist/core/messages.js.map +1 -1
  114. package/dist/core/model-config.d.ts +15 -0
  115. package/dist/core/model-config.d.ts.map +1 -1
  116. package/dist/core/model-config.js +3 -0
  117. package/dist/core/model-config.js.map +1 -1
  118. package/dist/core/model-runtime.d.ts +1 -0
  119. package/dist/core/model-runtime.d.ts.map +1 -1
  120. package/dist/core/model-runtime.js +5 -2
  121. package/dist/core/model-runtime.js.map +1 -1
  122. package/dist/core/provider-composer.d.ts.map +1 -1
  123. package/dist/core/provider-composer.js +8 -2
  124. package/dist/core/provider-composer.js.map +1 -1
  125. package/dist/core/session-manager.d.ts +3 -2
  126. package/dist/core/session-manager.d.ts.map +1 -1
  127. package/dist/core/session-manager.js +44 -15
  128. package/dist/core/session-manager.js.map +1 -1
  129. package/dist/core/settings-manager.d.ts +8 -1
  130. package/dist/core/settings-manager.d.ts.map +1 -1
  131. package/dist/core/settings-manager.js +17 -0
  132. package/dist/core/settings-manager.js.map +1 -1
  133. package/dist/core/skills.d.ts +1 -1
  134. package/dist/core/skills.d.ts.map +1 -1
  135. package/dist/core/skills.js +4 -2
  136. package/dist/core/skills.js.map +1 -1
  137. package/dist/core/system-prompt.d.ts.map +1 -1
  138. package/dist/core/system-prompt.js +8 -9
  139. package/dist/core/system-prompt.js.map +1 -1
  140. package/dist/core/tools/bash.d.ts.map +1 -1
  141. package/dist/core/tools/bash.js +3 -117
  142. package/dist/core/tools/bash.js.map +1 -1
  143. package/dist/core/tools/edit.d.ts +1 -12
  144. package/dist/core/tools/edit.d.ts.map +1 -1
  145. package/dist/core/tools/edit.js +5 -163
  146. package/dist/core/tools/edit.js.map +1 -1
  147. package/dist/core/tools/find.d.ts.map +1 -1
  148. package/dist/core/tools/find.js +4 -55
  149. package/dist/core/tools/find.js.map +1 -1
  150. package/dist/core/tools/grep.d.ts.map +1 -1
  151. package/dist/core/tools/grep.js +4 -60
  152. package/dist/core/tools/grep.js.map +1 -1
  153. package/dist/core/tools/ls.d.ts.map +1 -1
  154. package/dist/core/tools/ls.js +4 -49
  155. package/dist/core/tools/ls.js.map +1 -1
  156. package/dist/core/tools/read.d.ts.map +1 -1
  157. package/dist/core/tools/read.js +4 -120
  158. package/dist/core/tools/read.js.map +1 -1
  159. package/dist/core/tools/renderers/bash.d.ts +12 -0
  160. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  161. package/dist/core/tools/renderers/bash.js +130 -0
  162. package/dist/core/tools/renderers/bash.js.map +1 -0
  163. package/dist/core/tools/renderers/edit.d.ts +23 -0
  164. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  165. package/dist/core/tools/renderers/edit.js +167 -0
  166. package/dist/core/tools/renderers/edit.js.map +1 -0
  167. package/dist/core/tools/renderers/find.d.ts +10 -0
  168. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  169. package/dist/core/tools/renderers/find.js +64 -0
  170. package/dist/core/tools/renderers/find.js.map +1 -0
  171. package/dist/core/tools/renderers/grep.d.ts +10 -0
  172. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  173. package/dist/core/tools/renderers/grep.js +69 -0
  174. package/dist/core/tools/renderers/grep.js.map +1 -0
  175. package/dist/core/tools/renderers/index.d.ts +28 -0
  176. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  177. package/dist/core/tools/renderers/index.js +47 -0
  178. package/dist/core/tools/renderers/index.js.map +1 -0
  179. package/dist/core/tools/renderers/ls.d.ts +10 -0
  180. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  181. package/dist/core/tools/renderers/ls.js +58 -0
  182. package/dist/core/tools/renderers/ls.js.map +1 -0
  183. package/dist/core/tools/renderers/read.d.ts +11 -0
  184. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  185. package/dist/core/tools/renderers/read.js +129 -0
  186. package/dist/core/tools/renderers/read.js.map +1 -0
  187. package/dist/core/tools/renderers/write.d.ts +10 -0
  188. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  189. package/dist/core/tools/renderers/write.js +153 -0
  190. package/dist/core/tools/renderers/write.js.map +1 -0
  191. package/dist/core/tools/write.d.ts.map +1 -1
  192. package/dist/core/tools/write.js +5 -146
  193. package/dist/core/tools/write.js.map +1 -1
  194. package/dist/experimental/client-runtime.d.ts +43 -0
  195. package/dist/experimental/client-runtime.d.ts.map +1 -0
  196. package/dist/experimental/client-runtime.js +183 -0
  197. package/dist/experimental/client-runtime.js.map +1 -0
  198. package/dist/experimental/client-tui-chat.d.ts +14 -0
  199. package/dist/experimental/client-tui-chat.d.ts.map +1 -0
  200. package/dist/experimental/client-tui-chat.js +171 -0
  201. package/dist/experimental/client-tui-chat.js.map +1 -0
  202. package/dist/experimental/client-tui.d.ts +37 -0
  203. package/dist/experimental/client-tui.d.ts.map +1 -0
  204. package/dist/experimental/client-tui.js +702 -0
  205. package/dist/experimental/client-tui.js.map +1 -0
  206. package/dist/experimental/client.d.ts +25 -0
  207. package/dist/experimental/client.d.ts.map +1 -0
  208. package/dist/experimental/client.js +99 -0
  209. package/dist/experimental/client.js.map +1 -0
  210. package/dist/experimental/coordinator-entry.d.ts +3 -0
  211. package/dist/experimental/coordinator-entry.d.ts.map +1 -0
  212. package/dist/experimental/coordinator-entry.js +11 -0
  213. package/dist/experimental/coordinator-entry.js.map +1 -0
  214. package/dist/experimental/coordinator.d.ts +38 -0
  215. package/dist/experimental/coordinator.d.ts.map +1 -0
  216. package/dist/experimental/coordinator.js +570 -0
  217. package/dist/experimental/coordinator.js.map +1 -0
  218. package/dist/experimental/mini/main.d.ts +7 -0
  219. package/dist/experimental/mini/main.d.ts.map +1 -0
  220. package/dist/experimental/mini/main.js +21 -0
  221. package/dist/experimental/mini/main.js.map +1 -0
  222. package/dist/experimental/mini/server/entry.d.ts +3 -0
  223. package/dist/experimental/mini/server/entry.d.ts.map +1 -0
  224. package/dist/experimental/mini/server/entry.js +11 -0
  225. package/dist/experimental/mini/server/entry.js.map +1 -0
  226. package/dist/experimental/mini/server/run.d.ts +13 -0
  227. package/dist/experimental/mini/server/run.d.ts.map +1 -0
  228. package/dist/experimental/mini/server/run.js +150 -0
  229. package/dist/experimental/mini/server/run.js.map +1 -0
  230. package/dist/experimental/mini/shared/protocol.d.ts +127 -0
  231. package/dist/experimental/mini/shared/protocol.d.ts.map +1 -0
  232. package/dist/experimental/mini/shared/protocol.js +13 -0
  233. package/dist/experimental/mini/shared/protocol.js.map +1 -0
  234. package/dist/experimental/mini/shared/rpc.d.ts +49 -0
  235. package/dist/experimental/mini/shared/rpc.d.ts.map +1 -0
  236. package/dist/experimental/mini/shared/rpc.js +171 -0
  237. package/dist/experimental/mini/shared/rpc.js.map +1 -0
  238. package/dist/experimental/mini/shared/transport.d.ts +35 -0
  239. package/dist/experimental/mini/shared/transport.d.ts.map +1 -0
  240. package/dist/experimental/mini/shared/transport.js +94 -0
  241. package/dist/experimental/mini/shared/transport.js.map +1 -0
  242. package/dist/experimental/mini/tui/run.d.ts +9 -0
  243. package/dist/experimental/mini/tui/run.d.ts.map +1 -0
  244. package/dist/experimental/mini/tui/run.js +62 -0
  245. package/dist/experimental/mini/tui/run.js.map +1 -0
  246. package/dist/experimental/mini/tui/session.d.ts +26 -0
  247. package/dist/experimental/mini/tui/session.d.ts.map +1 -0
  248. package/dist/experimental/mini/tui/session.js +94 -0
  249. package/dist/experimental/mini/tui/session.js.map +1 -0
  250. package/dist/experimental/mini/tui/view.d.ts +10 -0
  251. package/dist/experimental/mini/tui/view.d.ts.map +1 -0
  252. package/dist/experimental/mini/tui/view.js +459 -0
  253. package/dist/experimental/mini/tui/view.js.map +1 -0
  254. package/dist/experimental/mini/worker/entry.d.ts +3 -0
  255. package/dist/experimental/mini/worker/entry.d.ts.map +1 -0
  256. package/dist/experimental/mini/worker/entry.js +10 -0
  257. package/dist/experimental/mini/worker/entry.js.map +1 -0
  258. package/dist/experimental/mini/worker/lane-service.d.ts +44 -0
  259. package/dist/experimental/mini/worker/lane-service.d.ts.map +1 -0
  260. package/dist/experimental/mini/worker/lane-service.js +97 -0
  261. package/dist/experimental/mini/worker/lane-service.js.map +1 -0
  262. package/dist/experimental/mini/worker/models-service.d.ts +19 -0
  263. package/dist/experimental/mini/worker/models-service.d.ts.map +1 -0
  264. package/dist/experimental/mini/worker/models-service.js +136 -0
  265. package/dist/experimental/mini/worker/models-service.js.map +1 -0
  266. package/dist/experimental/mini/worker/run.d.ts +14 -0
  267. package/dist/experimental/mini/worker/run.d.ts.map +1 -0
  268. package/dist/experimental/mini/worker/run.js +88 -0
  269. package/dist/experimental/mini/worker/run.js.map +1 -0
  270. package/dist/experimental/plugin.d.ts +4 -0
  271. package/dist/experimental/plugin.d.ts.map +1 -0
  272. package/dist/experimental/plugin.js +4 -0
  273. package/dist/experimental/plugin.js.map +1 -0
  274. package/dist/experimental/plugins/bundled.d.ts +7 -0
  275. package/dist/experimental/plugins/bundled.d.ts.map +1 -0
  276. package/dist/experimental/plugins/bundled.js +48 -0
  277. package/dist/experimental/plugins/bundled.js.map +1 -0
  278. package/dist/experimental/plugins/package.d.ts +18 -0
  279. package/dist/experimental/plugins/package.d.ts.map +1 -0
  280. package/dist/experimental/plugins/package.js +113 -0
  281. package/dist/experimental/plugins/package.js.map +1 -0
  282. package/dist/experimental/process.d.ts +20 -0
  283. package/dist/experimental/process.d.ts.map +1 -0
  284. package/dist/experimental/process.js +85 -0
  285. package/dist/experimental/process.js.map +1 -0
  286. package/dist/experimental/radius-auth.d.ts +17 -0
  287. package/dist/experimental/radius-auth.d.ts.map +1 -0
  288. package/dist/experimental/radius-auth.js +52 -0
  289. package/dist/experimental/radius-auth.js.map +1 -0
  290. package/dist/experimental/radius-relay.d.ts +90 -0
  291. package/dist/experimental/radius-relay.d.ts.map +1 -0
  292. package/dist/experimental/radius-relay.js +582 -0
  293. package/dist/experimental/radius-relay.js.map +1 -0
  294. package/dist/experimental/server.d.ts +75 -0
  295. package/dist/experimental/server.d.ts.map +1 -0
  296. package/dist/experimental/server.js +682 -0
  297. package/dist/experimental/server.js.map +1 -0
  298. package/dist/experimental/services/agent-controller-provider.d.ts +4 -0
  299. package/dist/experimental/services/agent-controller-provider.d.ts.map +1 -0
  300. package/dist/experimental/services/agent-controller-provider.js +84 -0
  301. package/dist/experimental/services/agent-controller-provider.js.map +1 -0
  302. package/dist/experimental/services/agent-controller.d.ts +57 -0
  303. package/dist/experimental/services/agent-controller.d.ts.map +1 -0
  304. package/dist/experimental/services/agent-controller.js +3 -0
  305. package/dist/experimental/services/agent-controller.js.map +1 -0
  306. package/dist/experimental/services/connection.d.ts +40 -0
  307. package/dist/experimental/services/connection.d.ts.map +1 -0
  308. package/dist/experimental/services/connection.js +300 -0
  309. package/dist/experimental/services/connection.js.map +1 -0
  310. package/dist/experimental/services/models-provider.d.ts +16 -0
  311. package/dist/experimental/services/models-provider.d.ts.map +1 -0
  312. package/dist/experimental/services/models-provider.js +116 -0
  313. package/dist/experimental/services/models-provider.js.map +1 -0
  314. package/dist/experimental/services/models.d.ts +36 -0
  315. package/dist/experimental/services/models.d.ts.map +1 -0
  316. package/dist/experimental/services/models.js +3 -0
  317. package/dist/experimental/services/models.js.map +1 -0
  318. package/dist/experimental/services/plugins.d.ts +16 -0
  319. package/dist/experimental/services/plugins.d.ts.map +1 -0
  320. package/dist/experimental/services/plugins.js +4 -0
  321. package/dist/experimental/services/plugins.js.map +1 -0
  322. package/dist/experimental/services/presentation-ui.d.ts +13 -0
  323. package/dist/experimental/services/presentation-ui.d.ts.map +1 -0
  324. package/dist/experimental/services/presentation-ui.js +3 -0
  325. package/dist/experimental/services/presentation-ui.js.map +1 -0
  326. package/dist/experimental/services/server.d.ts +19 -0
  327. package/dist/experimental/services/server.d.ts.map +1 -0
  328. package/dist/experimental/services/server.js +104 -0
  329. package/dist/experimental/services/server.js.map +1 -0
  330. package/dist/experimental/services/sessions.d.ts +28 -0
  331. package/dist/experimental/services/sessions.d.ts.map +1 -0
  332. package/dist/experimental/services/sessions.js +4 -0
  333. package/dist/experimental/services/sessions.js.map +1 -0
  334. package/dist/experimental/services/slash-commands-provider.d.ts +14 -0
  335. package/dist/experimental/services/slash-commands-provider.d.ts.map +1 -0
  336. package/dist/experimental/services/slash-commands-provider.js +200 -0
  337. package/dist/experimental/services/slash-commands-provider.js.map +1 -0
  338. package/dist/experimental/services/slash-commands.d.ts +24 -0
  339. package/dist/experimental/services/slash-commands.d.ts.map +1 -0
  340. package/dist/experimental/services/slash-commands.js +3 -0
  341. package/dist/experimental/services/slash-commands.js.map +1 -0
  342. package/dist/experimental/services/transcript-provider.d.ts +12 -0
  343. package/dist/experimental/services/transcript-provider.d.ts.map +1 -0
  344. package/dist/experimental/services/transcript-provider.js +109 -0
  345. package/dist/experimental/services/transcript-provider.js.map +1 -0
  346. package/dist/experimental/services/transcript.d.ts +13 -0
  347. package/dist/experimental/services/transcript.d.ts.map +1 -0
  348. package/dist/experimental/services/transcript.js +3 -0
  349. package/dist/experimental/services/transcript.js.map +1 -0
  350. package/dist/experimental/services/worker.d.ts +28 -0
  351. package/dist/experimental/services/worker.d.ts.map +1 -0
  352. package/dist/experimental/services/worker.js +107 -0
  353. package/dist/experimental/services/worker.js.map +1 -0
  354. package/dist/experimental/session-worker-manager.d.ts +24 -0
  355. package/dist/experimental/session-worker-manager.d.ts.map +1 -0
  356. package/dist/experimental/session-worker-manager.js +691 -0
  357. package/dist/experimental/session-worker-manager.js.map +1 -0
  358. package/dist/experimental/session-worker.d.ts +188 -0
  359. package/dist/experimental/session-worker.d.ts.map +1 -0
  360. package/dist/experimental/session-worker.js +785 -0
  361. package/dist/experimental/session-worker.js.map +1 -0
  362. package/dist/experimental/source-resolver.d.ts +2 -0
  363. package/dist/experimental/source-resolver.d.ts.map +1 -0
  364. package/dist/experimental/source-resolver.js +71 -0
  365. package/dist/experimental/source-resolver.js.map +1 -0
  366. package/dist/extensions/llama/client.d.ts +6 -0
  367. package/dist/extensions/llama/client.d.ts.map +1 -1
  368. package/dist/extensions/llama/client.js +7 -0
  369. package/dist/extensions/llama/client.js.map +1 -1
  370. package/dist/extensions/llama/provider.d.ts +3 -1
  371. package/dist/extensions/llama/provider.d.ts.map +1 -1
  372. package/dist/extensions/llama/provider.js +27 -6
  373. package/dist/extensions/llama/provider.js.map +1 -1
  374. package/dist/index.d.ts +3 -2
  375. package/dist/index.d.ts.map +1 -1
  376. package/dist/index.js +1 -0
  377. package/dist/index.js.map +1 -1
  378. package/dist/main.d.ts.map +1 -1
  379. package/dist/main.js +128 -1
  380. package/dist/main.js.map +1 -1
  381. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  382. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  383. package/dist/modes/interactive/chat-viewport.js +28 -0
  384. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  385. package/dist/modes/interactive/components/assistant-message.d.ts +1 -0
  386. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  387. package/dist/modes/interactive/components/assistant-message.js +18 -10
  388. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  389. package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
  390. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  391. package/dist/modes/interactive/components/custom-editor.js +39 -1
  392. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  393. package/dist/modes/interactive/components/index.d.ts +1 -1
  394. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  395. package/dist/modes/interactive/components/index.js.map +1 -1
  396. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  397. package/dist/modes/interactive/components/model-selector.js +5 -14
  398. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  399. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  400. package/dist/modes/interactive/components/scoped-models-selector.js +13 -15
  401. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  402. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  403. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  404. package/dist/modes/interactive/components/settings-selector.js +24 -10
  405. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  406. package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
  407. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  408. package/dist/modes/interactive/components/status-indicator.js +10 -3
  409. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  410. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  411. package/dist/modes/interactive/components/thinking-selector.js +2 -2
  412. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  413. package/dist/modes/interactive/components/tool-execution.d.ts +21 -4
  414. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  415. package/dist/modes/interactive/components/tool-execution.js +35 -33
  416. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  417. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  418. package/dist/modes/interactive/components/trust-selector.js +2 -2
  419. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  420. package/dist/modes/interactive/interactive-mode.d.ts +11 -14
  421. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  422. package/dist/modes/interactive/interactive-mode.js +140 -101
  423. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  424. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  425. package/dist/modes/interactive/session-share.js +8 -12
  426. package/dist/modes/interactive/session-share.js.map +1 -1
  427. package/dist/modes/interactive/theme/dark.json +2 -1
  428. package/dist/modes/interactive/theme/light.json +2 -1
  429. package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
  430. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  431. package/dist/modes/interactive/theme/theme-controller.js +5 -0
  432. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  433. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  434. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  435. package/dist/modes/interactive/theme/theme-json.js +130 -0
  436. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  437. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  438. package/dist/modes/interactive/theme/theme.d.ts +14 -5
  439. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  440. package/dist/modes/interactive/theme/theme.js +18 -119
  441. package/dist/modes/interactive/theme/theme.js.map +1 -1
  442. package/dist/modes/interactive/tui-renderer.d.ts +21 -0
  443. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  444. package/dist/modes/interactive/tui-renderer.js +66 -0
  445. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  446. package/dist/modes/rpc/rpc-client.d.ts +7 -0
  447. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  448. package/dist/modes/rpc/rpc-client.js +7 -0
  449. package/dist/modes/rpc/rpc-client.js.map +1 -1
  450. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  451. package/dist/modes/rpc/rpc-mode.js +3 -0
  452. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  453. package/dist/modes/rpc/rpc-types.d.ts +12 -0
  454. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  455. package/dist/modes/rpc/rpc-types.js.map +1 -1
  456. package/dist/utils/exif-orientation.d.ts.map +1 -1
  457. package/dist/utils/exif-orientation.js +2 -3
  458. package/dist/utils/exif-orientation.js.map +1 -1
  459. package/dist/utils/shell.d.ts.map +1 -1
  460. package/dist/utils/shell.js +6 -4
  461. package/dist/utils/shell.js.map +1 -1
  462. package/dist/utils/tools-manager.d.ts +1 -0
  463. package/dist/utils/tools-manager.d.ts.map +1 -1
  464. package/dist/utils/tools-manager.js +41 -19
  465. package/dist/utils/tools-manager.js.map +1 -1
  466. package/docs/compaction.md +2 -0
  467. package/docs/custom-provider.md +7 -7
  468. package/docs/environment-variables.md +5 -0
  469. package/docs/extensions.md +23 -2
  470. package/docs/keybindings.md +4 -2
  471. package/docs/models.md +3 -0
  472. package/docs/quickstart.md +1 -1
  473. package/docs/rpc.md +24 -1
  474. package/docs/sdk.md +5 -0
  475. package/docs/settings.md +17 -9
  476. package/docs/skills.md +1 -1
  477. package/docs/terminal-setup.md +27 -0
  478. package/docs/themes.md +8 -6
  479. package/docs/tui.md +20 -1
  480. package/docs/usage.md +4 -3
  481. package/examples/README.md +3 -0
  482. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  483. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  484. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  485. package/examples/extensions/dynamic-resources/dynamic.json +2 -0
  486. package/examples/extensions/gondolin/package-lock.json +2 -2
  487. package/examples/extensions/gondolin/package.json +1 -1
  488. package/examples/extensions/sandbox/package-lock.json +2 -2
  489. package/examples/extensions/sandbox/package.json +1 -1
  490. package/examples/extensions/with-deps/package-lock.json +2 -2
  491. package/examples/extensions/with-deps/package.json +1 -1
  492. package/examples/plugins/pi-example-plugin/README.md +38 -0
  493. package/examples/plugins/pi-example-plugin/package.json +10 -0
  494. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  495. package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  496. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  497. package/npm-shrinkwrap.json +523 -28
  498. package/package.json +12 -6
  499. package/dist/bun/register-bedrock.d.ts +0 -2
  500. package/dist/bun/register-bedrock.d.ts.map +0 -1
  501. package/dist/bun/register-bedrock.js +0 -4
  502. package/dist/bun/register-bedrock.js.map +0 -1
  503. package/dist/bundle/chunks/anthropic-messages-JWX2WP65.js +0 -45
  504. package/dist/bundle/chunks/chunk-E5KXRMZK.js +0 -1547
  505. package/dist/bundle/chunks/chunk-JUUC5AZY.js +0 -2
  506. package/dist/bundle/chunks/dist-RDWOYWHR.js +0 -13
  507. package/dist/bundle/chunks/openai-codex-responses-GJVBJXLB.js +0 -8
  508. package/dist/bundle/chunks/openai-completions-JD4WAC3R.js +0 -7
  509. package/dist/bundle/chunks/openai-responses-BSOJMSEV.js +0 -2
  510. package/dist/cli/experimental/auth.d.ts +0 -16
  511. package/dist/cli/experimental/auth.d.ts.map +0 -1
  512. package/dist/cli/experimental/auth.js +0 -13
  513. package/dist/cli/experimental/auth.js.map +0 -1
  514. package/dist/cli/experimental/commands/pi.d.ts +0 -15
  515. package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
  516. package/dist/cli/experimental/commands/pi.js +0 -28
  517. package/dist/cli/experimental/commands/pi.js.map +0 -1
  518. package/dist/cli/experimental/transport-address.d.ts +0 -10
  519. package/dist/cli/experimental/transport-address.d.ts.map +0 -1
  520. package/dist/cli/experimental/transport-address.js +0 -38
  521. package/dist/cli/experimental/transport-address.js.map +0 -1
  522. package/dist/client/remote-session.d.ts +0 -53
  523. package/dist/client/remote-session.d.ts.map +0 -1
  524. package/dist/client/remote-session.js +0 -340
  525. package/dist/client/remote-session.js.map +0 -1
  526. package/dist/client/transcript.d.ts +0 -12
  527. package/dist/client/transcript.d.ts.map +0 -1
  528. package/dist/client/transcript.js +0 -98
  529. package/dist/client/transcript.js.map +0 -1
  530. package/dist/server/create-harness.d.ts +0 -26
  531. package/dist/server/create-harness.d.ts.map +0 -1
  532. package/dist/server/create-harness.js +0 -106
  533. package/dist/server/create-harness.js.map +0 -1
@@ -7,7 +7,7 @@ import * as fs from "node:fs";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import * as TuiLayouts from "@earendil-works/pi-tui";
10
- import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
10
+ import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
11
11
  import chalk from "chalk";
12
12
  import { spawn } from "child_process";
13
13
  import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
@@ -26,19 +26,20 @@ import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../cor
26
26
  import { SessionManager, sessionEntryToContextMessages } from "../../core/session-manager.js";
27
27
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
28
28
  import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
29
+ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
29
30
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
30
31
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
31
32
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
32
33
  import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
33
34
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
34
35
  import { parseGitUrl } from "../../utils/git.js";
35
- import { openBrowser } from "../../utils/open-browser.js";
36
36
  import { getCwdRelativePath } from "../../utils/paths.js";
37
37
  import { getPiUserAgent } from "../../utils/pi-user-agent.js";
38
38
  import { killTrackedDetachedChildren } from "../../utils/shell.js";
39
39
  import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
40
40
  import { ensureTool } from "../../utils/tools-manager.js";
41
41
  import { checkForNewPiVersion } from "../../utils/version-check.js";
42
+ import { createChatViewport } from "./chat-viewport.js";
42
43
  import { ArminComponent } from "./components/armin.js";
43
44
  import { AssistantMessageComponent } from "./components/assistant-message.js";
44
45
  import { BashExecutionComponent } from "./components/bash-execution.js";
@@ -76,6 +77,14 @@ import { getModelSearchText } from "./model-search.js";
76
77
  import { shareSession } from "./session-share.js";
77
78
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
78
79
  import { InteractiveThemeController } from "./theme/theme-controller.js";
80
+ import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
81
+ export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
82
+ function isWorkingStatusEditor(editor) {
83
+ return ("embedWorkingStatus" in editor &&
84
+ editor.embedWorkingStatus === true &&
85
+ "setWorkingStatusIndicator" in editor &&
86
+ typeof editor.setWorkingStatusIndicator === "function");
87
+ }
79
88
  function isExpandable(obj) {
80
89
  return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
81
90
  }
@@ -177,60 +186,6 @@ function formatLoginProviderCompletionDescription(provider) {
177
186
  const authTypes = provider.authTypes.map(formatAuthSelectorProviderType).join("/");
178
187
  return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
179
188
  }
180
- /** Composition root for selecting the interactive terminal renderer. */
181
- export function createInteractiveTui(options) {
182
- const terminal = options.terminal ?? new ProcessTerminal();
183
- if (options.tuiMode === "fullscreen") {
184
- const styleSearchMatch = (text) => theme.bg("searchMatchBg", theme.fg("searchMatchText", text));
185
- return new TuiAltScreen(terminal, options.showHardwareCursor, options.logDirectory, {
186
- searchMatchStyle: (text) => theme.underline(styleSearchMatch(text)),
187
- searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
188
- openUrl: openBrowser,
189
- onRightClickPaste: options.onRightClickPaste,
190
- copySelection: async (text) => {
191
- try {
192
- await copyToClipboard(text);
193
- return true;
194
- }
195
- catch {
196
- return false;
197
- }
198
- },
199
- });
200
- }
201
- return new TuiMainScreen(terminal, options.showHardwareCursor, options.logDirectory);
202
- }
203
- /** Stable reference for components while InteractiveMode replaces the active renderer. */
204
- export function createInteractiveTuiReference(getTui) {
205
- return new Proxy({}, {
206
- get: (_target, property) => {
207
- const tui = getTui();
208
- const value = Reflect.get(tui, property, tui);
209
- if (typeof value !== "function")
210
- return value;
211
- let methodTui = tui;
212
- let method = value;
213
- return (...args) => {
214
- const currentTui = getTui();
215
- if (currentTui !== methodTui) {
216
- const currentMethod = Reflect.get(currentTui, property, currentTui);
217
- if (typeof currentMethod !== "function") {
218
- throw new TypeError(`TUI property ${String(property)} is not callable`);
219
- }
220
- methodTui = currentTui;
221
- method = currentMethod;
222
- }
223
- return Reflect.apply(method, methodTui, args);
224
- };
225
- },
226
- set: (_target, property, value) => {
227
- const tui = getTui();
228
- return Reflect.set(tui, property, value, tui);
229
- },
230
- has: (_target, property) => Reflect.has(getTui(), property),
231
- getPrototypeOf: () => Reflect.getPrototypeOf(getTui()),
232
- });
233
- }
234
189
  export class InteractiveMode {
235
190
  runtimeHost;
236
191
  renderer;
@@ -262,11 +217,12 @@ export class InteractiveMode {
262
217
  onInputCallback;
263
218
  pendingUserInputs = [];
264
219
  activeStatusIndicator = undefined;
220
+ activeWorkingIndicatorEmbedded = false;
265
221
  idleStatus = new IdleStatus();
266
222
  workingMessage = undefined;
267
223
  workingVisible = true;
268
224
  workingIndicatorOptions = undefined;
269
- defaultWorkingMessage = "Working...";
225
+ defaultWorkingMessage = "Working";
270
226
  defaultHiddenThinkingLabel = "Thinking...";
271
227
  hiddenThinkingLabel = this.defaultHiddenThinkingLabel;
272
228
  lastSigintTime = 0;
@@ -350,6 +306,7 @@ export class InteractiveMode {
350
306
  }
351
307
  constructor(runtimeHost, options = {}) {
352
308
  this.runtimeHost = runtimeHost;
309
+ setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
353
310
  const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
354
311
  this.options = { ...options, tuiMode };
355
312
  this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
@@ -366,6 +323,7 @@ export class InteractiveMode {
366
323
  showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
367
324
  logDirectory: getAgentDir(),
368
325
  onRightClickPaste: this.onRightClickPaste,
326
+ fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
369
327
  });
370
328
  this.ui = createInteractiveTuiReference(() => this.renderer);
371
329
  this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
@@ -387,6 +345,7 @@ export class InteractiveMode {
387
345
  this.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
388
346
  paddingX: editorPaddingX,
389
347
  autocompleteMaxVisible,
348
+ embedWorkingStatus: true,
390
349
  });
391
350
  this.editor = this.defaultEditor;
392
351
  this.editorContainer = new Container();
@@ -613,6 +572,7 @@ export class InteractiveMode {
613
572
  logDirectory: getAgentDir(),
614
573
  terminal,
615
574
  onRightClickPaste: this.onRightClickPaste,
575
+ fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
616
576
  });
617
577
  nextUi.setClearOnShrink(clearOnShrink);
618
578
  nextUi.onDebug = onDebug;
@@ -657,25 +617,20 @@ export class InteractiveMode {
657
617
  }
658
618
  // Keep one component tree and remount it when changing renderers.
659
619
  this.renderWidgets(); // Initialize with default spacer
660
- this.transcriptScrollView = new TuiLayouts.ScrollView(this.documentContainer, {
661
- follow: "end",
662
- primary: true,
663
- overscroll: "chain",
620
+ const viewport = createChatViewport({
621
+ document: this.documentContainer,
622
+ pendingMessages: this.pendingMessagesContainer,
623
+ status: this.statusContainer,
624
+ widgetsAbove: this.widgetContainerAbove,
625
+ editor: this.editorContainer,
626
+ widgetsBelow: this.widgetContainerBelow,
627
+ footer: this.footerContainer,
664
628
  scrollbar: this.settingsManager.getFullscreenScrollbar(),
665
- scrollbarStyle: (text) => theme.bg("scrollbarThumb", text),
629
+ scrollbarTrackStyle: (text) => theme.fg("scrollbarTrack", text),
630
+ scrollbarThumbStyle: (text) => theme.fg("scrollbarThumb", text),
666
631
  });
667
- const dock = new TuiLayouts.VStack([
668
- { component: this.pendingMessagesContainer, shrink: 1, minSize: 0 },
669
- { component: this.statusContainer, shrink: 1, minSize: 0 },
670
- { component: this.widgetContainerAbove, shrink: 1, minSize: 0 },
671
- { component: this.editorContainer, shrink: 1, minSize: 3 },
672
- { component: this.widgetContainerBelow, shrink: 1, minSize: 0 },
673
- { component: this.footerContainer, shrink: 1, minSize: 1 },
674
- ]);
675
- this.fullscreenLayoutRoot = new TuiLayouts.VStack([
676
- { component: this.transcriptScrollView, basis: 0, grow: 1, shrink: 1, minSize: 1 },
677
- { component: dock, basis: "auto", grow: 0, shrink: 1, minSize: 1 },
678
- ]);
632
+ this.transcriptScrollView = viewport.transcript;
633
+ this.fullscreenLayoutRoot = viewport.root;
679
634
  this.mountInteractiveTui(this.renderer, [
680
635
  this.documentContainer,
681
636
  this.pendingMessagesContainer,
@@ -1521,8 +1476,12 @@ export class InteractiveMode {
1521
1476
  this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
1522
1477
  }
1523
1478
  applyRuntimeSettings() {
1479
+ setCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());
1524
1480
  configureHttpDispatcher(this.settingsManager.getHttpIdleTimeoutMs());
1525
1481
  this.applyFullscreenScrollbarSetting();
1482
+ if (this.renderer instanceof TuiAltScreen) {
1483
+ this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
1484
+ }
1526
1485
  this.footer.setSession(this.session);
1527
1486
  this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
1528
1487
  this.footerDataProvider.setCwd(this.sessionManager.getCwd());
@@ -1583,8 +1542,12 @@ export class InteractiveMode {
1583
1542
  /**
1584
1543
  * Get a registered tool definition by name (for custom rendering).
1585
1544
  */
1545
+ /**
1546
+ * Extension-registered definition, falling back to the built-in one. The renderer components take
1547
+ * whatever this returns, so they never reach into the tool registry themselves.
1548
+ */
1586
1549
  getRegisteredToolDefinition(toolName) {
1587
- return this.session.getToolDefinition(toolName);
1550
+ return withBuiltInRenderers(toolName, this.session.getToolDefinition(toolName));
1588
1551
  }
1589
1552
  getMarkdownTransformers() {
1590
1553
  return [this.mermaidMarkdownTransformer, ...this.session.extensionRunner.getMarkdownTransformers()];
@@ -1654,24 +1617,49 @@ export class InteractiveMode {
1654
1617
  this.footerDataProvider.setExtensionStatus(key, text);
1655
1618
  this.ui.requestRender();
1656
1619
  }
1620
+ setEditorWorkingStatusIndicator(indicator) {
1621
+ this.defaultEditor.setWorkingStatusIndicator(undefined);
1622
+ if (!isWorkingStatusEditor(this.editor))
1623
+ return false;
1624
+ this.editor.setWorkingStatusIndicator(indicator);
1625
+ return true;
1626
+ }
1657
1627
  showStatusIndicator(indicator) {
1658
1628
  this.activeStatusIndicator?.dispose();
1659
1629
  this.activeStatusIndicator = indicator;
1630
+ this.activeWorkingIndicatorEmbedded = false;
1660
1631
  this.statusContainer.clear();
1632
+ this.setEditorWorkingStatusIndicator(undefined);
1633
+ if (indicator instanceof WorkingStatusIndicator && this.setEditorWorkingStatusIndicator(indicator)) {
1634
+ this.activeWorkingIndicatorEmbedded = true;
1635
+ return;
1636
+ }
1661
1637
  this.statusContainer.addChild(indicator);
1662
1638
  }
1663
1639
  clearStatusIndicator(kind) {
1664
1640
  if (kind && this.activeStatusIndicator?.kind !== kind) {
1665
1641
  return;
1666
1642
  }
1667
- const hadActiveStatusIndicator = this.activeStatusIndicator !== undefined;
1668
- this.activeStatusIndicator?.dispose();
1643
+ const clearedIndicator = this.activeStatusIndicator;
1644
+ const clearedIndicatorWasEmbedded = clearedIndicator?.kind === "working" && this.activeWorkingIndicatorEmbedded;
1645
+ clearedIndicator?.dispose();
1669
1646
  this.activeStatusIndicator = undefined;
1647
+ this.activeWorkingIndicatorEmbedded = false;
1670
1648
  this.statusContainer.clear();
1671
- if (hadActiveStatusIndicator && this.options.tuiMode === "regular" && this.ui.getClearOnShrink()) {
1649
+ this.setEditorWorkingStatusIndicator(undefined);
1650
+ if (clearedIndicator &&
1651
+ !clearedIndicatorWasEmbedded &&
1652
+ this.options.tuiMode === "regular" &&
1653
+ this.ui.getClearOnShrink()) {
1672
1654
  this.statusContainer.addChild(this.idleStatus);
1673
1655
  }
1674
1656
  }
1657
+ showWorkingStatusIndicator() {
1658
+ const colorFn = isWorkingStatusEditor(this.editor)
1659
+ ? (text) => (this.editor.borderColor ?? theme.getThinkingBorderColor(this.session.thinkingLevel || "off"))(text)
1660
+ : undefined;
1661
+ this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions, colorFn));
1662
+ }
1675
1663
  setWorkingVisible(visible) {
1676
1664
  this.workingVisible = visible;
1677
1665
  if (!visible) {
@@ -1680,7 +1668,7 @@ export class InteractiveMode {
1680
1668
  return;
1681
1669
  }
1682
1670
  if (this.session.isStreaming && this.activeStatusIndicator?.kind !== "working") {
1683
- this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
1671
+ this.showWorkingStatusIndicator();
1684
1672
  }
1685
1673
  this.ui.requestRender();
1686
1674
  }
@@ -2142,6 +2130,13 @@ export class InteractiveMode {
2142
2130
  this.editor = this.defaultEditor;
2143
2131
  }
2144
2132
  this.editorContainer.addChild(this.editor);
2133
+ if (this.activeStatusIndicator instanceof WorkingStatusIndicator) {
2134
+ this.statusContainer.clear();
2135
+ this.activeWorkingIndicatorEmbedded = this.setEditorWorkingStatusIndicator(this.activeStatusIndicator);
2136
+ if (!this.activeWorkingIndicatorEmbedded) {
2137
+ this.statusContainer.addChild(this.activeStatusIndicator);
2138
+ }
2139
+ }
2145
2140
  this.ui.setFocus(this.editor);
2146
2141
  this.ui.requestRender();
2147
2142
  }
@@ -2300,7 +2295,7 @@ export class InteractiveMode {
2300
2295
  this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
2301
2296
  this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
2302
2297
  this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
2303
- this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true }));
2298
+ this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true, preferSelection: true }));
2304
2299
  this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
2305
2300
  this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
2306
2301
  this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
@@ -2567,17 +2562,21 @@ export class InteractiveMode {
2567
2562
  switch (event.type) {
2568
2563
  case "agent_start":
2569
2564
  this.pendingTools.clear();
2570
- if (this.settingsManager.getShowTerminalProgress()) {
2571
- this.ui.terminal.setProgress(true);
2572
- }
2573
2565
  // Restore main escape handler if retry handler is still active
2574
2566
  // (retry success event fires later, but we need main handler now)
2575
2567
  if (this.retryEscapeHandler) {
2576
2568
  this.defaultEditor.onEscape = this.retryEscapeHandler;
2577
2569
  this.retryEscapeHandler = undefined;
2578
2570
  }
2571
+ break;
2572
+ case "turn_start":
2573
+ if (this.settingsManager.getShowTerminalProgress()) {
2574
+ this.ui.terminal.setProgress(true);
2575
+ }
2579
2576
  if (this.workingVisible) {
2580
- this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions));
2577
+ if (this.activeStatusIndicator?.kind !== "working") {
2578
+ this.showWorkingStatusIndicator();
2579
+ }
2581
2580
  }
2582
2581
  else {
2583
2582
  this.clearStatusIndicator();
@@ -2679,6 +2678,7 @@ export class InteractiveMode {
2679
2678
  for (const [, component] of this.pendingTools.entries()) {
2680
2679
  component.setArgsComplete();
2681
2680
  }
2681
+ this.maybeShowAssistantDiagnostics(this.streamingMessage);
2682
2682
  this.maybeShowCacheMissNotice(this.streamingMessage);
2683
2683
  }
2684
2684
  this.streamingComponent = undefined;
@@ -3042,6 +3042,7 @@ export class InteractiveMode {
3042
3042
  }
3043
3043
  }
3044
3044
  if (message.stopReason !== "aborted" && message.stopReason !== "error") {
3045
+ this.maybeShowAssistantDiagnostics(message);
3045
3046
  const miss = cacheMisses.get(message);
3046
3047
  if (miss)
3047
3048
  this.addCacheMissNotice(miss);
@@ -3098,6 +3099,32 @@ export class InteractiveMode {
3098
3099
  this.chatContainer.addChild(new Spacer(1));
3099
3100
  this.chatContainer.addChild(new Text(theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3100
3101
  }
3102
+ maybeShowAssistantDiagnostics(message) {
3103
+ if (!this.settingsManager.getShowCacheMissNotices())
3104
+ return;
3105
+ for (const diagnostic of message.diagnostics ?? []) {
3106
+ if (diagnostic.type !== "anthropic_input_transformations")
3107
+ continue;
3108
+ const transformations = diagnostic.details?.transformations;
3109
+ if (!Array.isArray(transformations))
3110
+ continue;
3111
+ const dropped = transformations.flatMap((transformation) => {
3112
+ if (typeof transformation !== "object" || transformation === null)
3113
+ return [];
3114
+ const details = transformation;
3115
+ if (details.type !== "thinking_dropped")
3116
+ return [];
3117
+ const reason = typeof details.reason === "string" ? details.reason : "unknown reason";
3118
+ const location = typeof details.path === "string" ? ` at ${details.path}` : "";
3119
+ return [`${reason}${location}`];
3120
+ });
3121
+ if (dropped.length === 0)
3122
+ continue;
3123
+ const noun = dropped.length === 1 ? "thinking block" : `${dropped.length} thinking blocks`;
3124
+ this.chatContainer.addChild(new Spacer(1));
3125
+ this.chatContainer.addChild(new Text(theme.fg("warning", `Anthropic dropped ${noun}: ${dropped.join("; ")}`), 1, 0));
3126
+ }
3127
+ }
3101
3128
  /**
3102
3129
  * Show a transcript notice when a completed assistant message paid for a
3103
3130
  * significant cache miss. Only states observable facts: the miss itself,
@@ -3395,6 +3422,9 @@ export class InteractiveMode {
3395
3422
  const level = this.session.thinkingLevel || "off";
3396
3423
  this.editor.borderColor = theme.getThinkingBorderColor(level);
3397
3424
  }
3425
+ if (this.activeStatusIndicator?.kind === "working") {
3426
+ this.activeStatusIndicator.invalidate();
3427
+ }
3398
3428
  this.ui.requestRender();
3399
3429
  }
3400
3430
  cycleThinkingLevel() {
@@ -3447,18 +3477,19 @@ export class InteractiveMode {
3447
3477
  }
3448
3478
  this.showStatus(`Tool output: ${expanded ? "expanded" : "collapsed"}`);
3449
3479
  }
3480
+ /** Update rendered assistant messages without rebuilding live tool components. */
3481
+ updateThinkingBlockVisibility() {
3482
+ for (const child of this.chatContainer.children) {
3483
+ if (child instanceof AssistantMessageComponent) {
3484
+ child.setHideThinkingBlock(this.hideThinkingBlock);
3485
+ }
3486
+ }
3487
+ this.ui.requestRender();
3488
+ }
3450
3489
  toggleThinkingBlockVisibility() {
3451
3490
  this.hideThinkingBlock = !this.hideThinkingBlock;
3452
3491
  this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
3453
- // Rebuild chat from session messages
3454
- this.chatContainer.clear();
3455
- this.rebuildChatFromMessages();
3456
- // If streaming, re-add the streaming component with updated visibility and re-render
3457
- if (this.streamingComponent && this.streamingMessage) {
3458
- this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock);
3459
- this.streamingComponent.updateContent(this.streamingMessage);
3460
- this.chatContainer.addChild(this.streamingComponent);
3461
- }
3492
+ this.updateThinkingBlockVisibility();
3462
3493
  this.showStatus(`Thinking blocks: ${this.hideThinkingBlock ? "hidden" : "visible"}`);
3463
3494
  }
3464
3495
  async handleOpenExternalEditor() {
@@ -3775,6 +3806,7 @@ export class InteractiveMode {
3775
3806
  tuiMode: this.ui.mode,
3776
3807
  fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
3777
3808
  fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
3809
+ fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
3778
3810
  warnings: this.settingsManager.getWarnings(),
3779
3811
  }, {
3780
3812
  onAutoCompactChange: (enabled) => {
@@ -3851,13 +3883,7 @@ export class InteractiveMode {
3851
3883
  onHideThinkingBlockChange: (hidden) => {
3852
3884
  this.hideThinkingBlock = hidden;
3853
3885
  this.settingsManager.setHideThinkingBlock(hidden);
3854
- for (const child of this.chatContainer.children) {
3855
- if (child instanceof AssistantMessageComponent) {
3856
- child.setHideThinkingBlock(hidden);
3857
- }
3858
- }
3859
- this.chatContainer.clear();
3860
- this.rebuildChatFromMessages();
3886
+ this.updateThinkingBlockVisibility();
3861
3887
  },
3862
3888
  onMermaidRenderingModeChange: (mode) => {
3863
3889
  this.settingsManager.setMermaidRenderingMode(mode);
@@ -3951,6 +3977,11 @@ export class InteractiveMode {
3951
3977
  this.settingsManager.setFullscreenScrollbar(mode);
3952
3978
  this.applyFullscreenScrollbarSetting();
3953
3979
  },
3980
+ onFullscreenCopyOnSelectChange: (enabled) => {
3981
+ this.settingsManager.setFullscreenCopyOnSelect(enabled);
3982
+ if (this.renderer instanceof TuiAltScreen)
3983
+ this.renderer.setCopyOnSelect(enabled);
3984
+ },
3954
3985
  onWarningsChange: (warnings) => {
3955
3986
  this.settingsManager.setWarnings(warnings);
3956
3987
  },
@@ -4140,6 +4171,7 @@ export class InteractiveMode {
4140
4171
  const selectModel = async (model, persist) => {
4141
4172
  try {
4142
4173
  await this.session.setModel(model, { persist });
4174
+ this.updateAvailableProviderCount();
4143
4175
  this.footer.invalidate();
4144
4176
  this.updateEditorBorderColor();
4145
4177
  done();
@@ -4988,8 +5020,8 @@ export class InteractiveMode {
4988
5020
  activeHeader.setExpanded(this.toolOutputExpanded);
4989
5021
  }
4990
5022
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
4991
- await this.themeController.applyFromSettings();
4992
5023
  this.applyRuntimeSettings();
5024
+ await this.themeController.applyFromSettings();
4993
5025
  this.setupAutocompleteProvider();
4994
5026
  const runner = this.session.extensionRunner;
4995
5027
  this.setupExtensionShortcuts(runner);
@@ -5111,6 +5143,13 @@ export class InteractiveMode {
5111
5143
  });
5112
5144
  }
5113
5145
  async handleCopyCommand(options = {}) {
5146
+ if (options.preferSelection &&
5147
+ this.ui instanceof TuiAltScreen &&
5148
+ !this.ui.getCopyOnSelect() &&
5149
+ this.ui.hasActiveSelection()) {
5150
+ await this.ui.copyActiveSelectionToClipboard();
5151
+ return;
5152
+ }
5114
5153
  const text = this.session.getLastAssistantText();
5115
5154
  if (!text) {
5116
5155
  this.showError("No agent messages to copy yet.");