@maxmo74/pi-coding-agent 1.5.2-max.15 → 1.7.0-max.17

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 (419) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/bundle/chunks/anthropic-messages-VOAE66ME.js +3 -0
  5. package/dist/bundle/chunks/azure-openai-responses-FWQRNMCY.js +2 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +6 -6
  7. package/dist/bundle/chunks/chunk-2BKJ4UF2.js +6 -0
  8. package/dist/bundle/chunks/{chunk-RKNK4Y6L.js → chunk-2HV66XRA.js} +1 -1
  9. package/dist/bundle/chunks/chunk-7TLS4DNZ.js +30 -0
  10. package/dist/bundle/chunks/{chunk-FMPAMX2W.js → chunk-AIIDHDL2.js} +1 -1
  11. package/dist/bundle/chunks/chunk-ARDROFM7.js +20 -0
  12. package/dist/bundle/chunks/{chunk-36QC74V4.js → chunk-D5E4JUBX.js} +1 -1
  13. package/dist/bundle/chunks/chunk-D5U74ZAG.js +2 -0
  14. package/dist/bundle/chunks/{chunk-BAC3QPNW.js → chunk-E3GEPN3H.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-4UNPP53I.js → chunk-G5K7SYL7.js} +2 -2
  16. package/dist/bundle/chunks/chunk-GBB3EUD7.js +16 -0
  17. package/dist/bundle/chunks/chunk-GMDZZCKH.js +2 -0
  18. package/dist/bundle/chunks/{chunk-AUUCDC7R.js → chunk-HFTJRRFR.js} +2 -2
  19. package/dist/bundle/chunks/chunk-INODY4DR.js +2 -0
  20. package/dist/bundle/chunks/{chunk-WL4TUXY7.js → chunk-IOF7AZCL.js} +1 -1
  21. package/dist/bundle/chunks/chunk-J35HXFD7.js +2 -0
  22. package/dist/bundle/chunks/{chunk-COKMCNCW.js → chunk-KPWXWGGJ.js} +1 -1
  23. package/dist/bundle/chunks/chunk-LWG2CUTI.js +31 -0
  24. package/dist/bundle/chunks/chunk-MDJ5LWZA.js +44 -0
  25. package/dist/bundle/chunks/{chunk-VKJQ6CME.js → chunk-O5MXS5TI.js} +1 -1
  26. package/dist/bundle/chunks/chunk-OVXT2WQH.js +2 -0
  27. package/dist/bundle/chunks/{chunk-M6TSYZBS.js → chunk-PADKDPJN.js} +128 -130
  28. package/dist/bundle/chunks/chunk-PST3NXKM.js +2 -0
  29. package/dist/bundle/chunks/chunk-S2GRKWHT.js +14 -0
  30. package/dist/bundle/chunks/{chunk-FF6XOTWB.js → chunk-V7D5E4XS.js} +17 -15
  31. package/dist/bundle/chunks/chunk-Z2XZSUHM.js +2 -0
  32. package/dist/bundle/chunks/{cli-2MK3TR7P.js → cli-OH5BEVHD.js} +1 -1
  33. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-Z73UPEZ7.js +2 -0
  34. package/dist/bundle/chunks/{easter-egg-3d-GEVPKQF6.js → easter-egg-3d-BOWYTYMI.js} +1 -1
  35. package/dist/bundle/chunks/{execute-L2EEDV3L.js → execute-UXTJZEKY.js} +3 -3
  36. package/dist/bundle/chunks/github-copilot.js +1 -1
  37. package/dist/bundle/chunks/google-generative-ai-VI7CGXA2.js +2 -0
  38. package/dist/bundle/chunks/google-vertex-UGCMSJWH.js +2 -0
  39. package/dist/bundle/chunks/{llama-cpp-classify-EJXCQRUQ.js → llama-cpp-classify-SKDW7RUG.js} +2 -2
  40. package/dist/bundle/chunks/mistral-conversations-F2GKIAZI.js +4 -0
  41. package/dist/bundle/chunks/openai-codex-responses-B54DADY4.js +2 -0
  42. package/dist/bundle/chunks/openai-completions-5UNXROMA.js +7 -0
  43. package/dist/bundle/chunks/{openai-decisions-F66BDLOM.js → openai-decisions-IN2F5D4R.js} +1 -1
  44. package/dist/bundle/chunks/openai-responses-2567WJBU.js +4 -0
  45. package/dist/bundle/chunks/openrouter-images-MPCL4RTO.js +2 -0
  46. package/dist/bundle/chunks/pi-decision-GZ2BG2JB.js +2 -0
  47. package/dist/bundle/chunks/pi-image-CXEQM6AW.js +2 -0
  48. package/dist/bundle/chunks/pi-messages-PDCTBGXV.js +2 -0
  49. package/dist/bundle/chunks/{runtime-J5ZSBGTX.js → runtime-JESTW74H.js} +1 -1
  50. package/dist/bundle/chunks/typesafe-system-one-6M47QHZX.js +2 -0
  51. package/dist/bundle/chunks/virtual-modules-QBVXFHBM.js +2 -0
  52. package/dist/bundle/cli-runtime.js +1 -1
  53. package/dist/bundle/index.js +1 -1
  54. package/dist/bundle/rpc-entry.js +1 -1
  55. package/dist/cli/agent-dir-arg.d.ts +20 -0
  56. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  57. package/dist/cli/agent-dir-arg.js +38 -0
  58. package/dist/cli/agent-dir-arg.js.map +1 -0
  59. package/dist/cli/args.d.ts +6 -0
  60. package/dist/cli/args.d.ts.map +1 -1
  61. package/dist/cli/args.js +49 -5
  62. package/dist/cli/args.js.map +1 -1
  63. package/dist/cli/config-selector.d.ts.map +1 -1
  64. package/dist/cli/config-selector.js +9 -6
  65. package/dist/cli/config-selector.js.map +1 -1
  66. package/dist/cli/list-models.d.ts.map +1 -1
  67. package/dist/cli/list-models.js +0 -5
  68. package/dist/cli/list-models.js.map +1 -1
  69. package/dist/cli/project-trust.d.ts.map +1 -1
  70. package/dist/cli/project-trust.js +6 -6
  71. package/dist/cli/project-trust.js.map +1 -1
  72. package/dist/cli/session-picker.d.ts.map +1 -1
  73. package/dist/cli/session-picker.js +9 -6
  74. package/dist/cli/session-picker.js.map +1 -1
  75. package/dist/cli/startup-ui.d.ts +3 -2
  76. package/dist/cli/startup-ui.d.ts.map +1 -1
  77. package/dist/cli/startup-ui.js +21 -23
  78. package/dist/cli/startup-ui.js.map +1 -1
  79. package/dist/config.d.ts +6 -1
  80. package/dist/config.d.ts.map +1 -1
  81. package/dist/config.js +16 -2
  82. package/dist/config.js.map +1 -1
  83. package/dist/core/agent-session-runtime.d.ts +11 -0
  84. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  85. package/dist/core/agent-session-runtime.js +19 -0
  86. package/dist/core/agent-session-runtime.js.map +1 -1
  87. package/dist/core/agent-session-services.d.ts.map +1 -1
  88. package/dist/core/agent-session-services.js +6 -0
  89. package/dist/core/agent-session-services.js.map +1 -1
  90. package/dist/core/agent-session.d.ts +6 -3
  91. package/dist/core/agent-session.d.ts.map +1 -1
  92. package/dist/core/agent-session.js +22 -13
  93. package/dist/core/agent-session.js.map +1 -1
  94. package/dist/core/auth-storage.d.ts.map +1 -1
  95. package/dist/core/auth-storage.js +7 -1
  96. package/dist/core/auth-storage.js.map +1 -1
  97. package/dist/core/bash-executor.d.ts +3 -1
  98. package/dist/core/bash-executor.d.ts.map +1 -1
  99. package/dist/core/bash-executor.js +24 -13
  100. package/dist/core/bash-executor.js.map +1 -1
  101. package/dist/core/client-identity.d.ts +2 -3
  102. package/dist/core/client-identity.d.ts.map +1 -1
  103. package/dist/core/client-identity.js +3 -4
  104. package/dist/core/client-identity.js.map +1 -1
  105. package/dist/core/compaction/compaction.d.ts.map +1 -1
  106. package/dist/core/compaction/compaction.js +3 -0
  107. package/dist/core/compaction/compaction.js.map +1 -1
  108. package/dist/core/exec.d.ts +1 -0
  109. package/dist/core/exec.d.ts.map +1 -1
  110. package/dist/core/exec.js +4 -1
  111. package/dist/core/exec.js.map +1 -1
  112. package/dist/core/export-html/ansi-to-html.d.ts +6 -1
  113. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  114. package/dist/core/export-html/ansi-to-html.js +57 -20
  115. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  116. package/dist/core/export-html/template.js +1 -1
  117. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  118. package/dist/core/export-html/tool-renderer.js +2 -3
  119. package/dist/core/export-html/tool-renderer.js.map +1 -1
  120. package/dist/core/extensions/loader.d.ts.map +1 -1
  121. package/dist/core/extensions/loader.js +18 -1
  122. package/dist/core/extensions/loader.js.map +1 -1
  123. package/dist/core/extensions/runner.d.ts.map +1 -1
  124. package/dist/core/extensions/runner.js +7 -1
  125. package/dist/core/extensions/runner.js.map +1 -1
  126. package/dist/core/extensions/types.d.ts +14 -1
  127. package/dist/core/extensions/types.d.ts.map +1 -1
  128. package/dist/core/extensions/types.js.map +1 -1
  129. package/dist/core/messages.d.ts +4 -0
  130. package/dist/core/messages.d.ts.map +1 -1
  131. package/dist/core/messages.js +10 -2
  132. package/dist/core/messages.js.map +1 -1
  133. package/dist/core/model-config.d.ts +36 -0
  134. package/dist/core/model-config.d.ts.map +1 -1
  135. package/dist/core/model-resolver.d.ts +0 -8
  136. package/dist/core/model-resolver.d.ts.map +1 -1
  137. package/dist/core/model-resolver.js +7 -71
  138. package/dist/core/model-resolver.js.map +1 -1
  139. package/dist/core/model-runtime.d.ts.map +1 -1
  140. package/dist/core/model-runtime.js +6 -2
  141. package/dist/core/model-runtime.js.map +1 -1
  142. package/dist/core/package-manager.d.ts +16 -0
  143. package/dist/core/package-manager.d.ts.map +1 -1
  144. package/dist/core/package-manager.js +45 -2
  145. package/dist/core/package-manager.js.map +1 -1
  146. package/dist/core/pi-ai-schemas.d.ts +4 -0
  147. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  148. package/dist/core/project-trust.d.ts.map +1 -1
  149. package/dist/core/project-trust.js +1 -1
  150. package/dist/core/project-trust.js.map +1 -1
  151. package/dist/core/provider-composer.d.ts +1 -0
  152. package/dist/core/provider-composer.d.ts.map +1 -1
  153. package/dist/core/provider-composer.js +1 -0
  154. package/dist/core/provider-composer.js.map +1 -1
  155. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  156. package/dist/core/remote-catalog-provider.js +7 -0
  157. package/dist/core/remote-catalog-provider.js.map +1 -1
  158. package/dist/core/resolve-config-value.d.ts +2 -0
  159. package/dist/core/resolve-config-value.d.ts.map +1 -1
  160. package/dist/core/resolve-config-value.js +4 -0
  161. package/dist/core/resolve-config-value.js.map +1 -1
  162. package/dist/core/resource-loader.d.ts +5 -1
  163. package/dist/core/resource-loader.d.ts.map +1 -1
  164. package/dist/core/resource-loader.js +2 -0
  165. package/dist/core/resource-loader.js.map +1 -1
  166. package/dist/core/sdk.js +2 -2
  167. package/dist/core/sdk.js.map +1 -1
  168. package/dist/core/session-manager.d.ts.map +1 -1
  169. package/dist/core/session-manager.js +55 -42
  170. package/dist/core/session-manager.js.map +1 -1
  171. package/dist/core/session-ownership.js +15 -1
  172. package/dist/core/session-ownership.js.map +1 -1
  173. package/dist/core/settings-defaults.d.ts +6 -2
  174. package/dist/core/settings-defaults.d.ts.map +1 -1
  175. package/dist/core/settings-defaults.js +6 -2
  176. package/dist/core/settings-defaults.js.map +1 -1
  177. package/dist/core/settings-manager.d.ts +6 -6
  178. package/dist/core/settings-manager.d.ts.map +1 -1
  179. package/dist/core/settings-manager.js +23 -16
  180. package/dist/core/settings-manager.js.map +1 -1
  181. package/dist/core/settings-schema.d.ts +16 -3
  182. package/dist/core/settings-schema.d.ts.map +1 -1
  183. package/dist/core/settings-schema.js +23 -8
  184. package/dist/core/settings-schema.js.map +1 -1
  185. package/dist/core/tools/bash.d.ts +3 -0
  186. package/dist/core/tools/bash.d.ts.map +1 -1
  187. package/dist/core/tools/bash.js +24 -9
  188. package/dist/core/tools/bash.js.map +1 -1
  189. package/dist/core/tools/find.d.ts.map +1 -1
  190. package/dist/core/tools/find.js +27 -16
  191. package/dist/core/tools/find.js.map +1 -1
  192. package/dist/core/tools/grep.js +1 -1
  193. package/dist/core/tools/grep.js.map +1 -1
  194. package/dist/core/tools/output-accumulator.d.ts +16 -4
  195. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  196. package/dist/core/tools/output-accumulator.js +47 -38
  197. package/dist/core/tools/output-accumulator.js.map +1 -1
  198. package/dist/core/tools/read.d.ts +5 -0
  199. package/dist/core/tools/read.d.ts.map +1 -1
  200. package/dist/core/tools/read.js +10 -15
  201. package/dist/core/tools/read.js.map +1 -1
  202. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  203. package/dist/core/tools/renderers/bash.js +9 -3
  204. package/dist/core/tools/renderers/bash.js.map +1 -1
  205. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  206. package/dist/core/tools/renderers/read.js +6 -2
  207. package/dist/core/tools/renderers/read.js.map +1 -1
  208. package/dist/core/tools/truncate.d.ts +1 -1
  209. package/dist/core/tools/truncate.d.ts.map +1 -1
  210. package/dist/core/tools/truncate.js +11 -5
  211. package/dist/core/tools/truncate.js.map +1 -1
  212. package/dist/core/usage-totals.d.ts.map +1 -1
  213. package/dist/core/usage-totals.js +3 -0
  214. package/dist/core/usage-totals.js.map +1 -1
  215. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  216. package/dist/extensions/codemode/execute.js +36 -5
  217. package/dist/extensions/codemode/execute.js.map +1 -1
  218. package/dist/extensions/llama/client.d.ts.map +1 -1
  219. package/dist/extensions/llama/client.js +3 -13
  220. package/dist/extensions/llama/client.js.map +1 -1
  221. package/dist/extensions/llama/provider.d.ts +1 -1
  222. package/dist/extensions/llama/provider.d.ts.map +1 -1
  223. package/dist/extensions/llama/provider.js +6 -4
  224. package/dist/extensions/llama/provider.js.map +1 -1
  225. package/dist/extensions/llama/ui.d.ts.map +1 -1
  226. package/dist/extensions/llama/ui.js +2 -1
  227. package/dist/extensions/llama/ui.js.map +1 -1
  228. package/dist/extensions/mcp/index.d.ts.map +1 -1
  229. package/dist/extensions/mcp/index.js +4 -7
  230. package/dist/extensions/mcp/index.js.map +1 -1
  231. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  232. package/dist/extensions/mcp/resources.js +3 -3
  233. package/dist/extensions/mcp/resources.js.map +1 -1
  234. package/dist/extensions/mcp/tools.d.ts +1 -9
  235. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  236. package/dist/extensions/mcp/tools.js +8 -124
  237. package/dist/extensions/mcp/tools.js.map +1 -1
  238. package/dist/main.d.ts +1 -1
  239. package/dist/main.d.ts.map +1 -1
  240. package/dist/main.js +57 -19
  241. package/dist/main.js.map +1 -1
  242. package/dist/modes/diagnostics-stderr.d.ts +4 -0
  243. package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
  244. package/dist/modes/diagnostics-stderr.js +11 -0
  245. package/dist/modes/diagnostics-stderr.js.map +1 -0
  246. package/dist/modes/interactive/components/assistant-message.d.ts +2 -1
  247. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  248. package/dist/modes/interactive/components/assistant-message.js +9 -3
  249. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  250. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  251. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  252. package/dist/modes/interactive/components/bash-execution.js +7 -4
  253. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  254. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  255. package/dist/modes/interactive/components/config-selector.js +6 -3
  256. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  257. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  258. package/dist/modes/interactive/components/custom-editor.js +13 -1
  259. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  260. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  261. package/dist/modes/interactive/components/extension-editor.js +2 -2
  262. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  263. package/dist/modes/interactive/components/first-time-setup.d.ts +3 -5
  264. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  265. package/dist/modes/interactive/components/first-time-setup.js +15 -45
  266. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  267. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  268. package/dist/modes/interactive/components/mermaid.js +13 -4
  269. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  270. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  271. package/dist/modes/interactive/components/model-selector.js +5 -2
  272. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  273. package/dist/modes/interactive/components/oauth-selector.d.ts +14 -2
  274. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  275. package/dist/modes/interactive/components/oauth-selector.js +17 -12
  276. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  277. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  278. package/dist/modes/interactive/components/radius-login-selector.js +2 -1
  279. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  280. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  281. package/dist/modes/interactive/components/scoped-models-selector.js +9 -1
  282. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  283. package/dist/modes/interactive/components/session-selector.d.ts +8 -1
  284. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  285. package/dist/modes/interactive/components/session-selector.js +44 -12
  286. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  287. package/dist/modes/interactive/components/settings-selector.d.ts +3 -5
  288. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  289. package/dist/modes/interactive/components/settings-selector.js +57 -46
  290. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  291. package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
  292. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  293. package/dist/modes/interactive/components/settings-submenu.js +8 -4
  294. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  295. package/dist/modes/interactive/components/themed-text.d.ts +1 -1
  296. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
  297. package/dist/modes/interactive/components/themed-text.js.map +1 -1
  298. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/thinking-selector.js +5 -1
  300. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  301. package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
  302. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  303. package/dist/modes/interactive/components/tool-execution.js +3 -1
  304. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  305. package/dist/modes/interactive/components/user-message.d.ts +2 -1
  306. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  307. package/dist/modes/interactive/components/user-message.js +9 -3
  308. package/dist/modes/interactive/components/user-message.js.map +1 -1
  309. package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
  310. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  311. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  312. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  313. package/dist/modes/interactive/external-editor.js +13 -3
  314. package/dist/modes/interactive/external-editor.js.map +1 -1
  315. package/dist/modes/interactive/interactive-mode.d.ts +19 -2
  316. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  317. package/dist/modes/interactive/interactive-mode.js +176 -111
  318. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  319. package/dist/modes/interactive/program-resume-reporter.d.ts +32 -0
  320. package/dist/modes/interactive/program-resume-reporter.d.ts.map +1 -0
  321. package/dist/modes/interactive/program-resume-reporter.js +56 -0
  322. package/dist/modes/interactive/program-resume-reporter.js.map +1 -0
  323. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  324. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  325. package/dist/modes/interactive/program-status-reporter.js +4 -0
  326. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  327. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  328. package/dist/modes/interactive/session-share.js +11 -1
  329. package/dist/modes/interactive/session-share.js.map +1 -1
  330. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  331. package/dist/modes/interactive/theme/theme.js +1 -0
  332. package/dist/modes/interactive/theme/theme.js.map +1 -1
  333. package/dist/modes/print-mode.d.ts.map +1 -1
  334. package/dist/modes/print-mode.js +17 -17
  335. package/dist/modes/print-mode.js.map +1 -1
  336. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  337. package/dist/modes/rpc/jsonl.js +13 -13
  338. package/dist/modes/rpc/jsonl.js.map +1 -1
  339. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  340. package/dist/modes/rpc/rpc-mode.js +19 -27
  341. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  342. package/dist/package-manager-cli.d.ts.map +1 -1
  343. package/dist/package-manager-cli.js +24 -2
  344. package/dist/package-manager-cli.js.map +1 -1
  345. package/dist/utils/changelog.d.ts.map +1 -1
  346. package/dist/utils/changelog.js +3 -2
  347. package/dist/utils/changelog.js.map +1 -1
  348. package/dist/utils/clipboard.js +1 -1
  349. package/dist/utils/clipboard.js.map +1 -1
  350. package/dist/utils/flush-stdout.d.ts +8 -0
  351. package/dist/utils/flush-stdout.d.ts.map +1 -0
  352. package/dist/utils/flush-stdout.js +23 -0
  353. package/dist/utils/flush-stdout.js.map +1 -0
  354. package/dist/utils/output-files.d.ts +20 -4
  355. package/dist/utils/output-files.d.ts.map +1 -1
  356. package/dist/utils/output-files.js +37 -2
  357. package/dist/utils/output-files.js.map +1 -1
  358. package/dist/utils/shell.d.ts +2 -1
  359. package/dist/utils/shell.d.ts.map +1 -1
  360. package/dist/utils/shell.js +56 -7
  361. package/dist/utils/shell.js.map +1 -1
  362. package/dist/utils/tools-manager.d.ts +1 -0
  363. package/dist/utils/tools-manager.d.ts.map +1 -1
  364. package/dist/utils/tools-manager.js +9 -8
  365. package/dist/utils/tools-manager.js.map +1 -1
  366. package/docs/cli.md +3 -1
  367. package/docs/codemode.md +16 -5
  368. package/docs/environment-variables.md +4 -4
  369. package/docs/extensions.md +18 -8
  370. package/docs/llama-cpp.md +3 -3
  371. package/docs/message-types.md +1 -0
  372. package/docs/models-configuration.md +18 -6
  373. package/docs/models.md +34 -14
  374. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  375. package/docs/providers.md +7 -5
  376. package/docs/rpc-commands.md +2 -2
  377. package/docs/settings.md +5 -3
  378. package/docs/shell-aliases.md +1 -1
  379. package/docs/terminal-setup.md +53 -0
  380. package/docs/tui.md +2 -0
  381. package/docs/windows.md +2 -1
  382. package/examples/extensions/gondolin/index.ts +4 -7
  383. package/examples/extensions/subagent/index.ts +3 -2
  384. package/examples/rpc-extension-ui.ts +8 -7
  385. package/package.json +10 -10
  386. package/schemas/models.schema.json +22 -9
  387. package/schemas/settings.schema.json +30 -10
  388. package/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +0 -6
  389. package/dist/bundle/chunks/azure-openai-responses-76TWS6DT.js +0 -2
  390. package/dist/bundle/chunks/chunk-4KSTFUIK.js +0 -19
  391. package/dist/bundle/chunks/chunk-CF5GWZHW.js +0 -31
  392. package/dist/bundle/chunks/chunk-GFUN2N5K.js +0 -2
  393. package/dist/bundle/chunks/chunk-IQUU5XIT.js +0 -2
  394. package/dist/bundle/chunks/chunk-PMRZO46Y.js +0 -2
  395. package/dist/bundle/chunks/chunk-QN4TOIZN.js +0 -16
  396. package/dist/bundle/chunks/chunk-V7SLUK6A.js +0 -44
  397. package/dist/bundle/chunks/chunk-Y55SJART.js +0 -13
  398. package/dist/bundle/chunks/chunk-YTPJCXUB.js +0 -30
  399. package/dist/bundle/chunks/chunk-ZBIZYD6W.js +0 -2
  400. package/dist/bundle/chunks/chunk-ZGYS4UTC.js +0 -2
  401. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-U4J7D646.js +0 -2
  402. package/dist/bundle/chunks/google-generative-ai-D5B6W47J.js +0 -2
  403. package/dist/bundle/chunks/google-vertex-U4H5YDEW.js +0 -2
  404. package/dist/bundle/chunks/mistral-conversations-S277EKLB.js +0 -5
  405. package/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +0 -10
  406. package/dist/bundle/chunks/openai-completions-HRZOSLBO.js +0 -7
  407. package/dist/bundle/chunks/openai-responses-BAKFWTGE.js +0 -4
  408. package/dist/bundle/chunks/openrouter-images-VXF5TVIK.js +0 -2
  409. package/dist/bundle/chunks/pi-messages-UBJKNDRN.js +0 -8
  410. package/dist/bundle/chunks/typesafe-system-one-56TEMIHL.js +0 -2
  411. package/dist/bundle/chunks/virtual-modules-MRQHQVIQ.js +0 -2
  412. package/dist/core/telemetry.d.ts +0 -3
  413. package/dist/core/telemetry.d.ts.map +0 -1
  414. package/dist/core/telemetry.js +0 -9
  415. package/dist/core/telemetry.js.map +0 -1
  416. package/dist/utils/deprecation.d.ts +0 -4
  417. package/dist/utils/deprecation.d.ts.map +0 -1
  418. package/dist/utils/deprecation.js +0 -13
  419. package/dist/utils/deprecation.js.map +0 -1
@@ -11,7 +11,7 @@ import * as TuiLayouts from "@earendil-works/pi-tui";
11
11
  import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
12
12
  import chalk from "chalk";
13
13
  import { spawn } from "child_process";
14
- import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
14
+ import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, usesDefaultAgentDir, VERSION, } from "../../config.js";
15
15
  import { parseSkillBlock } from "../../core/agent-session.js";
16
16
  import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
17
17
  import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, } from "../../core/cache-stats.js";
@@ -34,7 +34,6 @@ import { SessionManager, sessionEntryToContextMessages, } from "../../core/sessi
34
34
  import { getSessionOpenRefusal } from "../../core/session-ownership.js";
35
35
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
36
36
  import { getSourcePackageKey } from "../../core/source-info.js";
37
- import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
38
37
  import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
39
38
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
40
39
  import { getUsageCostBreakdown } from "../../core/usage-totals.js";
@@ -42,10 +41,10 @@ import { addMcpServerConfig } from "../../extensions/mcp/config.js";
42
41
  import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
43
42
  import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
44
43
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
44
+ import { flushStdout } from "../../utils/flush-stdout.js";
45
45
  import { parseGitUrl } from "../../utils/git.js";
46
46
  import { ensurePngTranscoder } from "../../utils/image-convert.js";
47
- import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
48
- import { getPiUserAgent } from "../../utils/pi-user-agent.js";
47
+ import { getCwdRelativePath, pathsEqual, resolvePath, shortenHomePath } from "../../utils/paths.js";
49
48
  import { killTrackedDetachedChildren } from "../../utils/shell.js";
50
49
  import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
51
50
  import { stripBom } from "../../utils/text.js";
@@ -91,7 +90,8 @@ import { UserMessageSelectorComponent } from "./components/user-message-selector
91
90
  import { editInExternalEditor } from "./external-editor.js";
92
91
  import { refreshModelCatalogs } from "./model-catalog-refresh.js";
93
92
  import { getModelSearchText } from "./model-search.js";
94
- import { ProgramStatusReporter } from "./program-status-reporter.js";
93
+ import { ProgramResumeReporter } from "./program-resume-reporter.js";
94
+ import { dialogBlockedStatus, ProgramStatusReporter } from "./program-status-reporter.js";
95
95
  import { shareSession } from "./session-share.js";
96
96
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
97
97
  import { InteractiveThemeController } from "./theme/theme-controller.js";
@@ -176,20 +176,44 @@ function quoteIfNeeded(value) {
176
176
  }
177
177
  return `'${value.replace(/'/g, `'\\''`)}'`;
178
178
  }
179
- export function formatResumeCommand(sessionManager) {
180
- if (!process.stdout.isTTY)
181
- return undefined;
179
+ /** Arguments that open the session in a new process, or undefined while the session has no file to open. */
180
+ function getResumeArgs(sessionManager) {
182
181
  if (!sessionManager.isPersisted())
183
182
  return undefined;
184
183
  const sessionFile = sessionManager.getSessionFile();
185
184
  if (!sessionFile || !fs.existsSync(sessionFile))
186
185
  return undefined;
187
186
  const args = [APP_NAME];
187
+ if (!usesDefaultAgentDir()) {
188
+ args.push("--agent-dir", resolvePath(getAgentDir()));
189
+ }
188
190
  if (!sessionManager.usesDefaultSessionDir()) {
189
- args.push("--session-dir", quoteIfNeeded(sessionManager.getSessionDir()));
191
+ args.push("--session-dir", sessionManager.getSessionDir());
190
192
  }
191
193
  args.push("--session", sessionManager.getSessionId());
192
- return args.join(" ");
194
+ return args;
195
+ }
196
+ /** The resume command as shell text for the user to copy. */
197
+ export function formatResumeCommand(sessionManager) {
198
+ if (!process.stdout.isTTY)
199
+ return undefined;
200
+ return getResumeArgs(sessionManager)?.map(quoteIfNeeded).join(" ");
201
+ }
202
+ /**
203
+ * The command a terminal runs to bring this session back (OSC 7577): the command printed on exit plus the
204
+ * restriction and resource flags pi was started with, run in the session's directory. Undefined, so the terminal
205
+ * clears it, when there is no session file, or when flags were typed in another directory than the session's:
206
+ * a relative path in them would point elsewhere, and a session without its restrictions must not come back.
207
+ */
208
+ export function getProgramResumeCommand(sessionManager, resumeFlags) {
209
+ const argv = getResumeArgs(sessionManager);
210
+ if (!argv)
211
+ return undefined;
212
+ const cwd = sessionManager.getCwd();
213
+ // pi never changes its working directory, so it is still the one the flags were typed in.
214
+ if (resumeFlags.length > 0 && !pathsEqual(cwd, process.cwd()))
215
+ return undefined;
216
+ return { argv: [...argv, ...resumeFlags], cwd };
193
217
  }
194
218
  function hasDefaultModelProvider(providerId) {
195
219
  return providerId in defaultModelPerProvider;
@@ -239,6 +263,41 @@ function formatLoginProviderCompletionDescription(provider) {
239
263
  .join("/");
240
264
  return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
241
265
  }
266
+ /** Assistant diagnostics that list reasoning a provider withheld from the model, by diagnostic type. */
267
+ const REASONING_DROP_DIAGNOSTICS = new Map([
268
+ [
269
+ "anthropic_input_transformations",
270
+ { provider: "Anthropic", droppedType: "thinking_dropped", noun: ["thinking block", "thinking blocks"] },
271
+ ],
272
+ [
273
+ "openai_input_transformations",
274
+ { provider: "OpenAI", droppedType: "reasoning", noun: ["reasoning item", "reasoning items"] },
275
+ ],
276
+ ]);
277
+ /** Count the reasoning blocks a provider reported as withheld from the request that produced `message`. */
278
+ function getDroppedReasoning(message) {
279
+ for (const diagnostic of message.diagnostics ?? []) {
280
+ const kind = REASONING_DROP_DIAGNOSTICS.get(diagnostic.type);
281
+ if (!kind)
282
+ continue;
283
+ // Session data: diagnostics details are untyped JSON.
284
+ const transformations = diagnostic.details?.transformations;
285
+ if (!Array.isArray(transformations))
286
+ continue;
287
+ const dropped = transformations.filter((transformation) => typeof transformation === "object" &&
288
+ transformation !== null &&
289
+ transformation.type === kind.droppedType);
290
+ if (dropped.length === 0)
291
+ continue;
292
+ const reasons = new Set();
293
+ for (const transformation of dropped) {
294
+ if (typeof transformation.reason === "string")
295
+ reasons.add(transformation.reason);
296
+ }
297
+ return { diagnostic: kind, count: dropped.length, reasons: [...reasons] };
298
+ }
299
+ return undefined;
300
+ }
242
301
  export class InteractiveMode {
243
302
  runtimeHost;
244
303
  renderer;
@@ -327,6 +386,8 @@ export class InteractiveMode {
327
386
  shutdownRequested = false;
328
387
  /** Reports working, blocked, done, and error states to terminals that support OSC 7501. */
329
388
  programStatus = new ProgramStatusReporter(() => this.ui.terminal, () => this.sessionManager.getSessionName());
389
+ /** Reports how to resume the session to terminals that support OSC 7577. Undefined without a token. */
390
+ programResume;
330
391
  /** The `/bug` hint is shown at most once per session so error output stays readable. */
331
392
  bugReportHintShown = false;
332
393
  installChangeWarningShown = false;
@@ -380,12 +441,16 @@ export class InteractiveMode {
380
441
  const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
381
442
  this.options = { ...options, tuiMode };
382
443
  this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;
444
+ if (options.programResumeToken) {
445
+ this.programResume = new ProgramResumeReporter(options.programResumeToken, () => this.ui.terminal, () => getProgramResumeCommand(this.sessionManager, options.programResumeFlags ?? []));
446
+ }
383
447
  this.runtimeHost.setBeforeSessionInvalidate(() => {
384
448
  this.resetExtensionUI();
385
449
  });
386
450
  this.runtimeHost.setRebindSession(async () => {
387
451
  await this.rebindCurrentSession({ renderBeforeBind: true });
388
452
  this.themeController.applyFromSettings();
453
+ this.showRuntimeDiagnostics(this.runtimeHost.takeUnreportedDiagnostics());
389
454
  });
390
455
  this.version = VERSION;
391
456
  this.renderer = createInteractiveTui({
@@ -670,6 +735,7 @@ export class InteractiveMode {
670
735
  });
671
736
  nextUi.setClearOnShrink(clearOnShrink);
672
737
  nextUi.onDebug = onDebug;
738
+ nextUi.setSuspendSignalHandler(() => this.handleCtrlZ());
673
739
  if (nextUi instanceof TuiMainScreen && this.mainScreenRenderState) {
674
740
  nextUi.restoreRenderState(this.mainScreenRenderState);
675
741
  }
@@ -734,10 +800,13 @@ export class InteractiveMode {
734
800
  this.defaultEditor.onCtrlD = () => this.handleCtrlD();
735
801
  this.defaultEditor.onSubmit = (text) => this.handleStartupSubmit(text);
736
802
  this.ui.setFocus(this.editor);
803
+ // An external SIGTSTP (kill -TSTP) restores the terminal like Ctrl+Z (#12272).
804
+ this.ui.setSuspendSignalHandler(() => this.handleCtrlZ());
737
805
  // Start the UI before initializing extensions so session_start handlers can use interactive dialogs
738
806
  this.ui.start();
739
807
  this.isInitialized = true;
740
808
  this.programStatus.report();
809
+ this.programResume?.report();
741
810
  this.ensurePngTranscoder();
742
811
  this.themeController.applyFromSettings();
743
812
  // The header and startup notices bake theme colors into their text, so build them once the terminal
@@ -900,24 +969,10 @@ export class InteractiveMode {
900
969
  });
901
970
  // Show startup warnings
902
971
  const { migratedProviders, startupDiagnostics, modelFallbackMessage, initialMessage, initialImages, initialMessages, } = this.options;
903
- for (const diagnostic of startupDiagnostics ?? []) {
904
- if (diagnostic.type === "error") {
905
- this.showError(diagnostic.message);
906
- }
907
- else if (diagnostic.type === "warning") {
908
- this.showWarning(diagnostic.message);
909
- }
910
- else {
911
- this.showStatus(diagnostic.message);
912
- }
913
- }
972
+ this.showRuntimeDiagnostics(startupDiagnostics ?? []);
914
973
  if (migratedProviders && migratedProviders.length > 0) {
915
974
  this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
916
975
  }
917
- const modelsJsonError = this.session.modelRuntime.getError();
918
- if (modelsJsonError) {
919
- this.showError(`models.json error: ${modelsJsonError}`);
920
- }
921
976
  if (modelFallbackMessage) {
922
977
  this.showWarning(modelFallbackMessage);
923
978
  }
@@ -1031,9 +1086,8 @@ export class InteractiveMode {
1031
1086
  const changelogPath = getChangelogPath();
1032
1087
  const entries = parseChangelog(changelogPath);
1033
1088
  if (!lastVersion) {
1034
- // Fresh install - record the version, send telemetry, don't show changelog
1089
+ // Fresh install - record the version, don't show changelog
1035
1090
  this.settingsManager.setLastChangelogVersion(VERSION);
1036
- this.reportInstallTelemetry(VERSION);
1037
1091
  return undefined;
1038
1092
  }
1039
1093
  const newEntries = getNewEntries(entries, lastVersion);
@@ -1044,7 +1098,6 @@ export class InteractiveMode {
1044
1098
  }
1045
1099
  if (newEntries.length > 0) {
1046
1100
  this.settingsManager.setLastChangelogVersion(VERSION);
1047
- this.reportInstallTelemetry(VERSION);
1048
1101
  return newEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
1049
1102
  }
1050
1103
  return undefined;
@@ -1106,22 +1159,6 @@ export class InteractiveMode {
1106
1159
  return undefined;
1107
1160
  }
1108
1161
  }
1109
- reportInstallTelemetry(version) {
1110
- if (process.env.PI_OFFLINE) {
1111
- return;
1112
- }
1113
- if (!isInstallTelemetryEnabled(this.settingsManager)) {
1114
- return;
1115
- }
1116
- void fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`, {
1117
- headers: {
1118
- "User-Agent": getPiUserAgent(version),
1119
- },
1120
- signal: AbortSignal.timeout(5000),
1121
- })
1122
- .then(() => undefined)
1123
- .catch(() => undefined);
1124
- }
1125
1162
  getMarkdownThemeWithSettings() {
1126
1163
  return {
1127
1164
  ...getMarkdownTheme(),
@@ -1699,11 +1736,25 @@ export class InteractiveMode {
1699
1736
  this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
1700
1737
  }
1701
1738
  }
1739
+ showRuntimeDiagnostics(diagnostics) {
1740
+ for (const diagnostic of diagnostics) {
1741
+ if (diagnostic.type === "error") {
1742
+ this.showError(diagnostic.message);
1743
+ }
1744
+ else if (diagnostic.type === "warning") {
1745
+ this.showWarning(diagnostic.message);
1746
+ }
1747
+ else {
1748
+ this.showStatus(diagnostic.message);
1749
+ }
1750
+ }
1751
+ }
1702
1752
  async rebindCurrentSession(options = {}) {
1703
1753
  const session = this.session;
1704
1754
  this.unsubscribe?.();
1705
1755
  this.unsubscribe = undefined;
1706
1756
  this.programStatus.reset();
1757
+ this.programResume?.report();
1707
1758
  this.applyRuntimeSettings();
1708
1759
  if (options.renderBeforeBind) {
1709
1760
  this.renderCurrentSessionState();
@@ -1733,6 +1784,7 @@ export class InteractiveMode {
1733
1784
  }
1734
1785
  stopThemeWatcher();
1735
1786
  this.stop("transcript");
1787
+ await flushStdout();
1736
1788
  process.exit(1);
1737
1789
  }
1738
1790
  getCrashExtensionHint(error) {
@@ -1765,7 +1817,7 @@ export class InteractiveMode {
1765
1817
  if (this.bugReportHintShown)
1766
1818
  return;
1767
1819
  this.bugReportHintShown = true;
1768
- 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));
1820
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", `If this looks like a ${APP_NAME} bug, use /bug to send a report to the developers.`), this.outputPad, 0));
1769
1821
  this.ui.requestRender();
1770
1822
  }
1771
1823
  maybeSuggestBugReport(message) {
@@ -2194,8 +2246,14 @@ export class InteractiveMode {
2194
2246
  setHeader: (factory) => this.setExtensionHeader(factory),
2195
2247
  setTitle: (title) => this.ui.terminal.setTitle(title),
2196
2248
  custom: (factory, options) => this.showExtensionCustom(factory, options),
2197
- pasteToEditor: (text) => this.editor.handleInput(`\x1b[200~${text}\x1b[201~`),
2198
- setEditorText: (text) => this.editor.setText(text),
2249
+ pasteToEditor: (text) => {
2250
+ this.editor.handleInput(`\x1b[200~${text}\x1b[201~`);
2251
+ this.ui.requestRender();
2252
+ },
2253
+ setEditorText: (text) => {
2254
+ this.editor.setText(text);
2255
+ this.ui.requestRender();
2256
+ },
2199
2257
  getEditorText: () => this.editor.getExpandedText?.() ?? this.editor.getText(),
2200
2258
  editor: (title, prefill) => this.showExtensionEditor(title, prefill),
2201
2259
  addAutocompleteProvider: (factory) => {
@@ -2257,7 +2315,7 @@ export class InteractiveMode {
2257
2315
  /**
2258
2316
  * Show a selector for extensions.
2259
2317
  */
2260
- showExtensionSelector(title, options, opts, blocked = { kind: "question", message: title }) {
2318
+ showExtensionSelector(title, options, opts) {
2261
2319
  return new Promise((resolve) => {
2262
2320
  if (opts?.signal?.aborted) {
2263
2321
  resolve(undefined);
@@ -2272,16 +2330,16 @@ export class InteractiveMode {
2272
2330
  const onAbort = () => finish(undefined);
2273
2331
  opts?.signal?.addEventListener("abort", onAbort, { once: true });
2274
2332
  const selector = new ExtensionSelectorComponent(title, options, (option) => finish(option), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
2275
- this.pushExtensionDialog(selector, blocked);
2333
+ this.pushExtensionDialog(selector, dialogBlockedStatus(opts?.blockedKind ?? "question", title));
2276
2334
  });
2277
2335
  }
2278
2336
  /**
2279
2337
  * Show a confirmation dialog for extensions.
2280
2338
  */
2281
2339
  async showExtensionConfirm(title, message, opts) {
2282
- const result = await this.showExtensionSelector(`${title}\n${message}`, ["Yes", "No"], opts, {
2283
- kind: "permission",
2284
- message: title,
2340
+ const result = await this.showExtensionSelector(`${title}\n${message}`, ["Yes", "No"], {
2341
+ ...opts,
2342
+ blockedKind: opts?.blockedKind ?? "permission",
2285
2343
  });
2286
2344
  return result === "Yes";
2287
2345
  }
@@ -2308,7 +2366,7 @@ export class InteractiveMode {
2308
2366
  const onAbort = () => finish(undefined);
2309
2367
  opts?.signal?.addEventListener("abort", onAbort, { once: true });
2310
2368
  const input = new ExtensionInputComponent(title, placeholder, (value) => finish(value), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout });
2311
- this.pushExtensionDialog(input, { kind: "question", message: title });
2369
+ this.pushExtensionDialog(input, dialogBlockedStatus(opts?.blockedKind ?? "question", title));
2312
2370
  });
2313
2371
  }
2314
2372
  /**
@@ -2321,7 +2379,7 @@ export class InteractiveMode {
2321
2379
  resolve(value);
2322
2380
  };
2323
2381
  const editor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => finish(value), () => finish(undefined), undefined, this.settingsManager.getExternalEditorCommand());
2324
- this.pushExtensionDialog(editor, { kind: "question", message: title });
2382
+ this.pushExtensionDialog(editor, dialogBlockedStatus("question", title));
2325
2383
  });
2326
2384
  }
2327
2385
  /**
@@ -2800,7 +2858,7 @@ export class InteractiveMode {
2800
2858
  const command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();
2801
2859
  if (command) {
2802
2860
  if (this.session.isBashRunning) {
2803
- this.showWarning("A bash command is already running. Press Esc to cancel it first.");
2861
+ this.showWarning(`A bash command is already running. Press ${keyText("app.interrupt")} to cancel it first.`);
2804
2862
  this.editor.setText(text);
2805
2863
  return;
2806
2864
  }
@@ -2856,6 +2914,10 @@ export class InteractiveMode {
2856
2914
  }
2857
2915
  this.footer.invalidate();
2858
2916
  this.programStatus.handleEvent(event);
2917
+ // The session file, and with it the resume command, appears when the first prompt is written, which
2918
+ // happens after its message_end reaches listeners. The reply's message_start or the run's end sees it.
2919
+ if (event.type === "message_start" || event.type === "agent_settled")
2920
+ this.programResume?.reportIfNone();
2859
2921
  switch (event.type) {
2860
2922
  case "agent_start":
2861
2923
  this.pendingTools.clear();
@@ -3269,7 +3331,8 @@ export class InteractiveMode {
3269
3331
  if (message.output) {
3270
3332
  component.appendOutput(message.output);
3271
3333
  }
3272
- component.setComplete(message.exitCode, message.cancelled, message.truncated ? { truncated: true } : undefined, message.fullOutputPath);
3334
+ component.setComplete(message.exitCode, message.cancelled, message.truncated ? { truncated: true } : undefined, message.fullOutputPath, message.fullOutputError);
3335
+ component.setExpanded(this.toolOutputExpanded);
3273
3336
  this.chatContainer.addChild(component);
3274
3337
  break;
3275
3338
  }
@@ -3346,7 +3409,7 @@ export class InteractiveMode {
3346
3409
  const renderedPendingTools = new Map();
3347
3410
  // Cache misses are not persisted, unlike successful cache-warming usage.
3348
3411
  // Re-derive them and inject them after the assistant messages that paid for them.
3349
- const cacheMisses = this.settingsManager.getShowCacheMissNotices()
3412
+ const cacheMisses = this.settingsManager.getNotices().cacheMisses
3350
3413
  ? collectCacheMisses(this.sessionManager.getEntries(), this.session.modelRuntime)
3351
3414
  : new Map();
3352
3415
  if (options.updateFooter) {
@@ -3459,7 +3522,7 @@ export class InteractiveMode {
3459
3522
  this.renderSessionItems(items, messageMeta, options);
3460
3523
  }
3461
3524
  addCacheWarmingUsage(entry) {
3462
- if (!this.settingsManager.getShowCacheMissNotices())
3525
+ if (!this.settingsManager.getNotices().cacheWarming)
3463
3526
  return;
3464
3527
  // Back-to-back warms collapse into one line with the cumulative cost.
3465
3528
  const previous = this.cacheWarmingNotice;
@@ -3479,7 +3542,7 @@ export class InteractiveMode {
3479
3542
  * from persisted summary usage and is not stored as a separate session entry.
3480
3543
  */
3481
3544
  addCompactionCostNotice(notice) {
3482
- if (!this.settingsManager.getShowCacheMissNotices())
3545
+ if (!this.settingsManager.getNotices().compactionCosts)
3483
3546
  return;
3484
3547
  const { usage } = notice;
3485
3548
  const tokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;
@@ -3488,42 +3551,30 @@ export class InteractiveMode {
3488
3551
  this.chatContainer.addChild(new Spacer(1));
3489
3552
  this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3490
3553
  }
3491
- static countDroppedThinkingBlocks(message) {
3492
- let count = 0;
3493
- for (const diagnostic of message.diagnostics ?? []) {
3494
- if (diagnostic.type !== "anthropic_input_transformations")
3495
- continue;
3496
- const transformations = diagnostic.details?.transformations;
3497
- if (!Array.isArray(transformations))
3498
- continue;
3499
- count += transformations.filter((transformation) => typeof transformation === "object" &&
3500
- transformation !== null &&
3501
- transformation.type === "thinking_dropped").length;
3502
- }
3503
- return count;
3504
- }
3505
3554
  maybeShowThinkingDropNotice(message) {
3506
- if (!this.settingsManager.getShowCacheMissNotices())
3555
+ if (!this.settingsManager.getNotices().reasoningDrops)
3507
3556
  return;
3508
- const droppedCount = InteractiveMode.countDroppedThinkingBlocks(message);
3509
- if (droppedCount === 0)
3557
+ const dropped = getDroppedReasoning(message);
3558
+ if (!dropped)
3510
3559
  return;
3511
- let previousDroppedCount = 0;
3512
- // message_end reaches the UI before the current message is persisted,
3513
- // so the branch's last assistant message is the previous response.
3560
+ // Providers report a withheld block again on every later request that replays it, so only
3561
+ // a count above the previous response's means new losses. message_end reaches the UI before
3562
+ // the current message is persisted, so the branch's last assistant message is the previous response.
3514
3563
  const branch = this.sessionManager.getBranch();
3515
3564
  for (let i = branch.length - 1; i >= 0; i--) {
3516
3565
  const entry = branch[i];
3517
3566
  if (entry.type === "message" && entry.message.role === "assistant") {
3518
- previousDroppedCount = InteractiveMode.countDroppedThinkingBlocks(entry.message);
3567
+ const previous = getDroppedReasoning(entry.message);
3568
+ if (previous?.diagnostic === dropped.diagnostic && dropped.count <= previous.count)
3569
+ return;
3519
3570
  break;
3520
3571
  }
3521
3572
  }
3522
- if (droppedCount <= previousDroppedCount)
3523
- return;
3524
- const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
3573
+ const { provider, noun: nouns } = dropped.diagnostic;
3574
+ const noun = nouns[dropped.count === 1 ? 0 : 1];
3575
+ const reasons = dropped.reasons.length > 0 ? `: ${dropped.reasons.join(", ")}` : "";
3525
3576
  this.chatContainer.addChild(new Spacer(1));
3526
- this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
3577
+ this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${provider} dropped ${dropped.count} ${noun}${reasons} (details in session)`), 1, 0));
3527
3578
  }
3528
3579
  /**
3529
3580
  * Show a transcript notice when a completed assistant message paid for a
@@ -3531,7 +3582,7 @@ export class InteractiveMode {
3531
3582
  * a model switch, or an idle gap past the cache TTL.
3532
3583
  */
3533
3584
  maybeShowCacheMissNotice(message) {
3534
- if (!this.settingsManager.getShowCacheMissNotices())
3585
+ if (!this.settingsManager.getNotices().cacheMisses)
3535
3586
  return;
3536
3587
  // Entries don't contain `message` yet: message_end fires before persistence.
3537
3588
  const miss = detectCacheMiss(this.sessionManager.getEntries(), message, this.session.modelRuntime);
@@ -3624,7 +3675,7 @@ export class InteractiveMode {
3624
3675
  // `signal-exit` checks the listener list during the same SIGTERM/SIGHUP
3625
3676
  // dispatch and re-sends the signal if only its own listeners remain.
3626
3677
  if (options?.fromSignal) {
3627
- // Signal-triggered shutdown (SIGTERM/SIGHUP). Emit extension cleanup
3678
+ // Signal-triggered shutdown (SIGTERM/SIGHUP, SIGBREAK on Windows). Emit extension cleanup
3628
3679
  // (session_shutdown) BEFORE touching the terminal. Extension teardown
3629
3680
  // such as removing sockets does not write to the tty, so it must not be
3630
3681
  // skipped if a later terminal-restore write fails on a dead or stalled
@@ -3635,6 +3686,8 @@ export class InteractiveMode {
3635
3686
  this.themeController.disableAutoSync();
3636
3687
  await this.ui.terminal.drainInput(1000);
3637
3688
  this.stop();
3689
+ await flushStdout();
3690
+ killTrackedDetachedChildren();
3638
3691
  process.exit(0);
3639
3692
  }
3640
3693
  // Interactive quit (Ctrl+D, Ctrl+C, /quit, extension shutdown()). Stop the
@@ -3644,12 +3697,19 @@ export class InteractiveMode {
3644
3697
  // This prevents escape sequences from leaking to the parent shell over slow SSH.
3645
3698
  this.themeController.disableAutoSync();
3646
3699
  await this.ui.terminal.drainInput(1000);
3700
+ // The user ended pi, so the terminal must not bring it back. Signal shutdowns above keep the command.
3701
+ this.programResume?.clear();
3647
3702
  this.stop();
3648
3703
  await this.runtimeHost.dispose();
3649
3704
  const resumeCommand = formatResumeCommand(this.sessionManager);
3650
3705
  if (resumeCommand) {
3651
- process.stdout.write(`${chalk.dim("To resume this session:")} ${resumeCommand}\n`);
3706
+ // Own line so the command can be selected with a triple-click (#12237).
3707
+ process.stdout.write(`${chalk.dim("To resume this session:")}\n${resumeCommand}\n`);
3652
3708
  }
3709
+ await flushStdout();
3710
+ // dispose() only starts killing a running `!` command, which on Windows loses the race with
3711
+ // exit. After the last await, so it also catches a shell spawned after the abort.
3712
+ killTrackedDetachedChildren();
3653
3713
  process.exit(0);
3654
3714
  }
3655
3715
  emergencyTerminalExit() {
@@ -3712,10 +3772,13 @@ export class InteractiveMode {
3712
3772
  }
3713
3773
  registerSignalHandlers() {
3714
3774
  this.unregisterSignalHandlers();
3715
- const signals = ["SIGTERM"];
3716
- if (process.platform !== "win32") {
3717
- signals.push("SIGHUP");
3718
- }
3775
+ const signals = ["SIGTERM", "SIGHUP"];
3776
+ // Without a listener, a console Ctrl+Break ends the process without running any JavaScript,
3777
+ // leaving the alternate screen, mouse reporting and keyboard modes on (#12133). Raw mode does
3778
+ // not block it, and a console child calling GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT) on a
3779
+ // process that is not a group leader sends it to every process in the console.
3780
+ if (process.platform === "win32")
3781
+ signals.push("SIGBREAK");
3719
3782
  for (const signal of signals) {
3720
3783
  const handler = () => {
3721
3784
  // SIGHUP no longer hard-exits: graceful shutdown emits session_shutdown
@@ -3772,6 +3835,7 @@ export class InteractiveMode {
3772
3835
  clearInterval(suspendKeepAlive);
3773
3836
  process.removeListener("SIGINT", ignoreSigint);
3774
3837
  this.ui.start();
3838
+ this.programResume?.reportAgain();
3775
3839
  this.ui.requestRender(true);
3776
3840
  });
3777
3841
  try {
@@ -4219,11 +4283,9 @@ export class InteractiveMode {
4219
4283
  hideThinkingBlock: this.hideThinkingBlock,
4220
4284
  mermaidRenderingMode: this.settingsManager.getMermaidRenderingMode(),
4221
4285
  collapseChangelog: this.settingsManager.getCollapseChangelog(),
4222
- enableInstallTelemetry: this.settingsManager.getEnableInstallTelemetry(),
4223
4286
  doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
4224
4287
  treeFilterMode: this.settingsManager.getTreeFilterMode(),
4225
4288
  showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
4226
- showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
4227
4289
  defaultProjectTrust: this.settingsManager.getDefaultProjectTrust(),
4228
4290
  editorPaddingX: this.settingsManager.getEditorPaddingX(),
4229
4291
  outputPad: this.settingsManager.getOutputPad(),
@@ -4237,6 +4299,7 @@ export class InteractiveMode {
4237
4299
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
4238
4300
  fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
4239
4301
  warnings: this.settingsManager.getWarnings(),
4302
+ notices: this.settingsManager.getNotices(),
4240
4303
  }, {
4241
4304
  onAutoCompactChange: (enabled) => {
4242
4305
  this.session.setAutoCompactionEnabled(enabled);
@@ -4326,16 +4389,9 @@ export class InteractiveMode {
4326
4389
  this.chatContainer.invalidate();
4327
4390
  this.ui.requestRender();
4328
4391
  },
4329
- onShowCacheMissNoticesChange: (shown) => {
4330
- this.settingsManager.setShowCacheMissNotices(shown);
4331
- this.rebuildChatFromMessages();
4332
- },
4333
4392
  onCollapseChangelogChange: (collapsed) => {
4334
4393
  this.settingsManager.setCollapseChangelog(collapsed);
4335
4394
  },
4336
- onEnableInstallTelemetryChange: (enabled) => {
4337
- this.settingsManager.setEnableInstallTelemetry(enabled);
4338
- },
4339
4395
  onQuietStartupChange: (quiet) => {
4340
4396
  this.settingsManager.setQuietStartup(quiet);
4341
4397
  },
@@ -4419,6 +4475,11 @@ export class InteractiveMode {
4419
4475
  onWarningsChange: (warnings) => {
4420
4476
  this.settingsManager.setWarnings(warnings);
4421
4477
  },
4478
+ onNoticeChange: (key, shown) => {
4479
+ this.settingsManager.setNotice(key, shown);
4480
+ // Cache miss, cache warming and compaction notices are derived when the transcript renders.
4481
+ this.rebuildChatFromMessages();
4482
+ },
4422
4483
  onCancel: () => {
4423
4484
  done();
4424
4485
  this.ui.requestRender();
@@ -5006,12 +5067,14 @@ export class InteractiveMode {
5006
5067
  const options = [];
5007
5068
  for (const provider of this.session.modelRuntime.getProviders()) {
5008
5069
  const authStatus = this.session.modelRuntime.getProviderAuthStatus(provider.id);
5009
- const status = authStatus.configured
5010
- ? {
5011
- type: this.session.modelRuntime.isUsingOAuth(provider.id) ? "oauth" : "api_key",
5012
- source: authStatus.label ?? authStatus.source,
5013
- }
5014
- : undefined;
5070
+ let status;
5071
+ if (authStatus.configured) {
5072
+ const type = this.session.modelRuntime.isUsingOAuth(provider.id) ? "oauth" : "api_key";
5073
+ status = { kind: "configured", type, source: authStatus.label ?? authStatus.source };
5074
+ }
5075
+ else if (authStatus.source === "stored") {
5076
+ status = { kind: "unresolved" };
5077
+ }
5015
5078
  const subscription = provider.auth.oauth?.isSubscription === true;
5016
5079
  if ((!authType || authType === "oauth") && provider.auth.oauth) {
5017
5080
  options.push({
@@ -5045,7 +5108,7 @@ export class InteractiveMode {
5045
5108
  id: providerId,
5046
5109
  name: provider?.name ?? providerId,
5047
5110
  authType: type,
5048
- status: { type, source: "stored credential" },
5111
+ status: { kind: "configured", type, source: "stored credential" },
5049
5112
  subscription: provider?.auth.oauth?.isSubscription === true,
5050
5113
  };
5051
5114
  })
@@ -5586,7 +5649,7 @@ export class InteractiveMode {
5586
5649
  const savedImplicitProjectTrust = this.maybeSaveImplicitProjectTrustAfterReload();
5587
5650
  const modelsJsonError = this.session.modelRuntime.getError();
5588
5651
  if (modelsJsonError) {
5589
- this.showError(`models.json error: ${modelsJsonError}`);
5652
+ this.showWarning(`models.json error: ${modelsJsonError}`);
5590
5653
  }
5591
5654
  this.showStatus(savedImplicitProjectTrust
5592
5655
  ? "Reloaded keybindings, extensions, skills, prompts, themes, and context files; saved project trust"
@@ -5889,6 +5952,7 @@ export class InteractiveMode {
5889
5952
  const yankPop = this.getEditorKeyDisplay("tui.editor.yankPop");
5890
5953
  const undo = this.getEditorKeyDisplay("tui.editor.undo");
5891
5954
  const tab = this.getEditorKeyDisplay("tui.input.tab");
5955
+ const cancelAutocomplete = this.getEditorKeyDisplay("tui.select.cancel");
5892
5956
  // App keybindings
5893
5957
  const interrupt = this.getAppKeyDisplay("app.interrupt");
5894
5958
  const clear = this.getAppKeyDisplay("app.clear");
@@ -5934,7 +5998,8 @@ export class InteractiveMode {
5934
5998
  | Key | Action |
5935
5999
  |-----|--------|
5936
6000
  | \`${tab}\` | Path completion / accept autocomplete |
5937
- | \`${interrupt}\` | Cancel autocomplete / abort streaming |
6001
+ | \`${cancelAutocomplete}\` | Cancel autocomplete |
6002
+ | \`${interrupt}\` | Abort streaming or running bash command |
5938
6003
  | \`${clear}\` | Clear editor (first) / exit (second) |
5939
6004
  | \`${exit}\` | Exit (when editor is empty) |
5940
6005
  | \`${suspend}\` | Suspend to background |
@@ -6062,7 +6127,7 @@ export class InteractiveMode {
6062
6127
  if (result.output) {
6063
6128
  this.bashComponent.appendOutput(result.output);
6064
6129
  }
6065
- this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath);
6130
+ this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath, result.fullOutputError);
6066
6131
  // Record the result in session
6067
6132
  this.session.recordBashResult(command, result, { excludeFromContext });
6068
6133
  this.bashComponent = undefined;
@@ -6091,7 +6156,7 @@ export class InteractiveMode {
6091
6156
  }
6092
6157
  }, { excludeFromContext, operations: eventResult?.operations });
6093
6158
  if (this.bashComponent) {
6094
- this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath);
6159
+ this.bashComponent.setComplete(result.exitCode, result.cancelled, result.truncated ? { truncated: true, content: result.output } : undefined, result.fullOutputPath, result.fullOutputError);
6095
6160
  }
6096
6161
  }
6097
6162
  catch (error) {