@maxmo74/pi-coding-agent 1.6.0-max.16 → 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 (297) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/LICENSE +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-VOAE66ME.js +3 -0
  4. package/dist/bundle/chunks/azure-openai-responses-FWQRNMCY.js +2 -0
  5. package/dist/bundle/chunks/bedrock-converse-stream.js +6 -6
  6. package/dist/bundle/chunks/chunk-2BKJ4UF2.js +6 -0
  7. package/dist/bundle/chunks/{chunk-YOWSKVK7.js → chunk-2HV66XRA.js} +1 -1
  8. package/dist/bundle/chunks/chunk-7TLS4DNZ.js +30 -0
  9. package/dist/bundle/chunks/{chunk-E6LJTZYC.js → chunk-AIIDHDL2.js} +1 -1
  10. package/dist/bundle/chunks/chunk-ARDROFM7.js +20 -0
  11. package/dist/bundle/chunks/{chunk-36QC74V4.js → chunk-D5E4JUBX.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-EVSO24NP.js → chunk-D5U74ZAG.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-ILDLA2JW.js → chunk-E3GEPN3H.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-XGGZYFNG.js → chunk-G5K7SYL7.js} +2 -2
  15. package/dist/bundle/chunks/chunk-GBB3EUD7.js +16 -0
  16. package/dist/bundle/chunks/chunk-GMDZZCKH.js +2 -0
  17. package/dist/bundle/chunks/{chunk-NRY4NBZW.js → chunk-HFTJRRFR.js} +2 -2
  18. package/dist/bundle/chunks/{chunk-NRLRGOCX.js → chunk-IOF7AZCL.js} +1 -1
  19. package/dist/bundle/chunks/chunk-J35HXFD7.js +2 -0
  20. package/dist/bundle/chunks/{chunk-KREOSXD7.js → chunk-KPWXWGGJ.js} +1 -1
  21. package/dist/bundle/chunks/chunk-MDJ5LWZA.js +44 -0
  22. package/dist/bundle/chunks/{chunk-I6HYYNH6.js → chunk-O5MXS5TI.js} +1 -1
  23. package/dist/bundle/chunks/chunk-OVXT2WQH.js +2 -0
  24. package/dist/bundle/chunks/{chunk-EXXWEFU5.js → chunk-PADKDPJN.js} +99 -104
  25. package/dist/bundle/chunks/chunk-PST3NXKM.js +2 -0
  26. package/dist/bundle/chunks/chunk-S2GRKWHT.js +14 -0
  27. package/dist/bundle/chunks/{chunk-X26YOAEH.js → chunk-V7D5E4XS.js} +13 -12
  28. package/dist/bundle/chunks/chunk-Z2XZSUHM.js +2 -0
  29. package/dist/bundle/chunks/{cli-QMJEURSM.js → cli-OH5BEVHD.js} +1 -1
  30. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-Z73UPEZ7.js +2 -0
  31. package/dist/bundle/chunks/{easter-egg-3d-7CBVPJQ3.js → easter-egg-3d-BOWYTYMI.js} +1 -1
  32. package/dist/bundle/chunks/{execute-XDNPBEMU.js → execute-UXTJZEKY.js} +3 -3
  33. package/dist/bundle/chunks/github-copilot.js +1 -1
  34. package/dist/bundle/chunks/google-generative-ai-VI7CGXA2.js +2 -0
  35. package/dist/bundle/chunks/google-vertex-UGCMSJWH.js +2 -0
  36. package/dist/bundle/chunks/{llama-cpp-classify-XXZYF3RR.js → llama-cpp-classify-SKDW7RUG.js} +2 -2
  37. package/dist/bundle/chunks/mistral-conversations-F2GKIAZI.js +4 -0
  38. package/dist/bundle/chunks/openai-codex-responses-B54DADY4.js +2 -0
  39. package/dist/bundle/chunks/openai-completions-5UNXROMA.js +7 -0
  40. package/dist/bundle/chunks/{openai-decisions-LZ2RLVRX.js → openai-decisions-IN2F5D4R.js} +1 -1
  41. package/dist/bundle/chunks/openai-responses-2567WJBU.js +4 -0
  42. package/dist/bundle/chunks/openrouter-images-MPCL4RTO.js +2 -0
  43. package/dist/bundle/chunks/pi-decision-GZ2BG2JB.js +2 -0
  44. package/dist/bundle/chunks/pi-image-CXEQM6AW.js +2 -0
  45. package/dist/bundle/chunks/pi-messages-PDCTBGXV.js +2 -0
  46. package/dist/bundle/chunks/{runtime-F3SXQONS.js → runtime-JESTW74H.js} +1 -1
  47. package/dist/bundle/chunks/typesafe-system-one-6M47QHZX.js +2 -0
  48. package/dist/bundle/chunks/virtual-modules-QBVXFHBM.js +2 -0
  49. package/dist/bundle/cli-runtime.js +1 -1
  50. package/dist/bundle/index.js +1 -1
  51. package/dist/bundle/rpc-entry.js +1 -1
  52. package/dist/cli/agent-dir-arg.d.ts +20 -0
  53. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  54. package/dist/cli/agent-dir-arg.js +38 -0
  55. package/dist/cli/agent-dir-arg.js.map +1 -0
  56. package/dist/cli/args.d.ts +6 -0
  57. package/dist/cli/args.d.ts.map +1 -1
  58. package/dist/cli/args.js +45 -3
  59. package/dist/cli/args.js.map +1 -1
  60. package/dist/cli/list-models.d.ts.map +1 -1
  61. package/dist/cli/list-models.js +0 -5
  62. package/dist/cli/list-models.js.map +1 -1
  63. package/dist/cli/project-trust.d.ts.map +1 -1
  64. package/dist/cli/project-trust.js +6 -6
  65. package/dist/cli/project-trust.js.map +1 -1
  66. package/dist/cli/startup-ui.d.ts +3 -2
  67. package/dist/cli/startup-ui.d.ts.map +1 -1
  68. package/dist/cli/startup-ui.js +17 -23
  69. package/dist/cli/startup-ui.js.map +1 -1
  70. package/dist/config.d.ts +6 -1
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +16 -2
  73. package/dist/config.js.map +1 -1
  74. package/dist/core/agent-session-services.d.ts.map +1 -1
  75. package/dist/core/agent-session-services.js +6 -0
  76. package/dist/core/agent-session-services.js.map +1 -1
  77. package/dist/core/agent-session.d.ts.map +1 -1
  78. package/dist/core/agent-session.js +1 -0
  79. package/dist/core/agent-session.js.map +1 -1
  80. package/dist/core/auth-storage.d.ts.map +1 -1
  81. package/dist/core/auth-storage.js +7 -1
  82. package/dist/core/auth-storage.js.map +1 -1
  83. package/dist/core/bash-executor.d.ts +3 -1
  84. package/dist/core/bash-executor.d.ts.map +1 -1
  85. package/dist/core/bash-executor.js +24 -13
  86. package/dist/core/bash-executor.js.map +1 -1
  87. package/dist/core/client-identity.d.ts +2 -3
  88. package/dist/core/client-identity.d.ts.map +1 -1
  89. package/dist/core/client-identity.js +3 -4
  90. package/dist/core/client-identity.js.map +1 -1
  91. package/dist/core/compaction/compaction.d.ts.map +1 -1
  92. package/dist/core/compaction/compaction.js +3 -0
  93. package/dist/core/compaction/compaction.js.map +1 -1
  94. package/dist/core/extensions/runner.d.ts.map +1 -1
  95. package/dist/core/extensions/runner.js +2 -1
  96. package/dist/core/extensions/runner.js.map +1 -1
  97. package/dist/core/extensions/types.d.ts +9 -1
  98. package/dist/core/extensions/types.d.ts.map +1 -1
  99. package/dist/core/extensions/types.js.map +1 -1
  100. package/dist/core/messages.d.ts +4 -0
  101. package/dist/core/messages.d.ts.map +1 -1
  102. package/dist/core/messages.js +10 -2
  103. package/dist/core/messages.js.map +1 -1
  104. package/dist/core/model-config.d.ts +36 -0
  105. package/dist/core/model-config.d.ts.map +1 -1
  106. package/dist/core/model-resolver.js +4 -4
  107. package/dist/core/model-resolver.js.map +1 -1
  108. package/dist/core/model-runtime.d.ts.map +1 -1
  109. package/dist/core/model-runtime.js +6 -2
  110. package/dist/core/model-runtime.js.map +1 -1
  111. package/dist/core/pi-ai-schemas.d.ts +4 -0
  112. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  113. package/dist/core/project-trust.d.ts.map +1 -1
  114. package/dist/core/project-trust.js +1 -1
  115. package/dist/core/project-trust.js.map +1 -1
  116. package/dist/core/provider-composer.d.ts +1 -0
  117. package/dist/core/provider-composer.d.ts.map +1 -1
  118. package/dist/core/provider-composer.js +1 -0
  119. package/dist/core/provider-composer.js.map +1 -1
  120. package/dist/core/resolve-config-value.d.ts +2 -0
  121. package/dist/core/resolve-config-value.d.ts.map +1 -1
  122. package/dist/core/resolve-config-value.js +4 -0
  123. package/dist/core/resolve-config-value.js.map +1 -1
  124. package/dist/core/sdk.js +2 -2
  125. package/dist/core/sdk.js.map +1 -1
  126. package/dist/core/session-manager.d.ts.map +1 -1
  127. package/dist/core/session-manager.js +10 -6
  128. package/dist/core/session-manager.js.map +1 -1
  129. package/dist/core/settings-defaults.d.ts +6 -2
  130. package/dist/core/settings-defaults.d.ts.map +1 -1
  131. package/dist/core/settings-defaults.js +6 -2
  132. package/dist/core/settings-defaults.js.map +1 -1
  133. package/dist/core/settings-manager.d.ts +6 -6
  134. package/dist/core/settings-manager.d.ts.map +1 -1
  135. package/dist/core/settings-manager.js +23 -16
  136. package/dist/core/settings-manager.js.map +1 -1
  137. package/dist/core/settings-schema.d.ts +16 -3
  138. package/dist/core/settings-schema.d.ts.map +1 -1
  139. package/dist/core/settings-schema.js +23 -8
  140. package/dist/core/settings-schema.js.map +1 -1
  141. package/dist/core/tools/bash.d.ts +3 -0
  142. package/dist/core/tools/bash.d.ts.map +1 -1
  143. package/dist/core/tools/bash.js +24 -9
  144. package/dist/core/tools/bash.js.map +1 -1
  145. package/dist/core/tools/output-accumulator.d.ts +16 -4
  146. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  147. package/dist/core/tools/output-accumulator.js +47 -41
  148. package/dist/core/tools/output-accumulator.js.map +1 -1
  149. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  150. package/dist/core/tools/renderers/bash.js +9 -3
  151. package/dist/core/tools/renderers/bash.js.map +1 -1
  152. package/dist/core/tools/truncate.d.ts +1 -1
  153. package/dist/core/tools/truncate.d.ts.map +1 -1
  154. package/dist/core/tools/truncate.js +11 -5
  155. package/dist/core/tools/truncate.js.map +1 -1
  156. package/dist/core/usage-totals.d.ts.map +1 -1
  157. package/dist/core/usage-totals.js +3 -0
  158. package/dist/core/usage-totals.js.map +1 -1
  159. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  160. package/dist/extensions/codemode/execute.js +36 -5
  161. package/dist/extensions/codemode/execute.js.map +1 -1
  162. package/dist/extensions/llama/client.d.ts.map +1 -1
  163. package/dist/extensions/llama/client.js +3 -13
  164. package/dist/extensions/llama/client.js.map +1 -1
  165. package/dist/extensions/llama/ui.d.ts.map +1 -1
  166. package/dist/extensions/llama/ui.js +2 -1
  167. package/dist/extensions/llama/ui.js.map +1 -1
  168. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  169. package/dist/extensions/mcp/resources.js +3 -3
  170. package/dist/extensions/mcp/resources.js.map +1 -1
  171. package/dist/extensions/mcp/tools.d.ts +1 -9
  172. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  173. package/dist/extensions/mcp/tools.js +8 -124
  174. package/dist/extensions/mcp/tools.js.map +1 -1
  175. package/dist/main.d.ts +1 -1
  176. package/dist/main.d.ts.map +1 -1
  177. package/dist/main.js +18 -3
  178. package/dist/main.js.map +1 -1
  179. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  180. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  181. package/dist/modes/interactive/components/bash-execution.js +7 -4
  182. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  183. package/dist/modes/interactive/components/config-selector.js +1 -1
  184. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  185. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  186. package/dist/modes/interactive/components/custom-editor.js +13 -1
  187. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  188. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  189. package/dist/modes/interactive/components/extension-editor.js +2 -2
  190. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  191. package/dist/modes/interactive/components/first-time-setup.d.ts +3 -5
  192. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  193. package/dist/modes/interactive/components/first-time-setup.js +15 -45
  194. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  195. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  196. package/dist/modes/interactive/components/mermaid.js +13 -4
  197. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  198. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  199. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  200. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  201. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  202. package/dist/modes/interactive/components/session-selector.js +3 -3
  203. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  204. package/dist/modes/interactive/components/settings-selector.d.ts +3 -5
  205. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  206. package/dist/modes/interactive/components/settings-selector.js +57 -46
  207. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  208. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  209. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  210. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  211. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  212. package/dist/modes/interactive/external-editor.js +13 -3
  213. package/dist/modes/interactive/external-editor.js.map +1 -1
  214. package/dist/modes/interactive/interactive-mode.d.ts +18 -1
  215. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  216. package/dist/modes/interactive/interactive-mode.js +105 -75
  217. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  218. package/dist/modes/interactive/program-resume-reporter.d.ts +32 -0
  219. package/dist/modes/interactive/program-resume-reporter.d.ts.map +1 -0
  220. package/dist/modes/interactive/program-resume-reporter.js +56 -0
  221. package/dist/modes/interactive/program-resume-reporter.js.map +1 -0
  222. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  223. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  224. package/dist/modes/interactive/program-status-reporter.js +4 -0
  225. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  226. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  227. package/dist/modes/interactive/session-share.js +9 -1
  228. package/dist/modes/interactive/session-share.js.map +1 -1
  229. package/dist/modes/print-mode.d.ts.map +1 -1
  230. package/dist/modes/print-mode.js +1 -4
  231. package/dist/modes/print-mode.js.map +1 -1
  232. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  233. package/dist/modes/rpc/jsonl.js +13 -13
  234. package/dist/modes/rpc/jsonl.js.map +1 -1
  235. package/dist/modes/rpc/rpc-mode.js +4 -4
  236. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  237. package/dist/package-manager-cli.d.ts.map +1 -1
  238. package/dist/package-manager-cli.js +10 -1
  239. package/dist/package-manager-cli.js.map +1 -1
  240. package/dist/utils/clipboard.js +1 -1
  241. package/dist/utils/clipboard.js.map +1 -1
  242. package/dist/utils/output-files.d.ts +20 -4
  243. package/dist/utils/output-files.d.ts.map +1 -1
  244. package/dist/utils/output-files.js +37 -2
  245. package/dist/utils/output-files.js.map +1 -1
  246. package/dist/utils/shell.d.ts +2 -1
  247. package/dist/utils/shell.d.ts.map +1 -1
  248. package/dist/utils/shell.js +56 -7
  249. package/dist/utils/shell.js.map +1 -1
  250. package/dist/utils/tools-manager.d.ts +1 -0
  251. package/dist/utils/tools-manager.d.ts.map +1 -1
  252. package/dist/utils/tools-manager.js +9 -8
  253. package/dist/utils/tools-manager.js.map +1 -1
  254. package/docs/cli.md +3 -1
  255. package/docs/codemode.md +16 -5
  256. package/docs/environment-variables.md +4 -4
  257. package/docs/extensions.md +14 -4
  258. package/docs/llama-cpp.md +3 -3
  259. package/docs/message-types.md +1 -0
  260. package/docs/models-configuration.md +14 -3
  261. package/docs/models.md +34 -14
  262. package/docs/providers.md +3 -3
  263. package/docs/rpc-commands.md +1 -1
  264. package/docs/settings.md +5 -3
  265. package/docs/shell-aliases.md +1 -1
  266. package/docs/terminal-setup.md +53 -0
  267. package/docs/windows.md +2 -1
  268. package/examples/extensions/subagent/index.ts +3 -2
  269. package/examples/rpc-extension-ui.ts +8 -7
  270. package/package.json +9 -9
  271. package/schemas/models.schema.json +20 -7
  272. package/schemas/settings.schema.json +30 -10
  273. package/dist/bundle/chunks/anthropic-messages-WAFIHSF7.js +0 -6
  274. package/dist/bundle/chunks/azure-openai-responses-EB4MRIM4.js +0 -2
  275. package/dist/bundle/chunks/chunk-EEBRZED2.js +0 -44
  276. package/dist/bundle/chunks/chunk-F7LEMV2T.js +0 -2
  277. package/dist/bundle/chunks/chunk-NV3NPOPF.js +0 -20
  278. package/dist/bundle/chunks/chunk-PMRZO46Y.js +0 -2
  279. package/dist/bundle/chunks/chunk-RCNEHRMW.js +0 -2
  280. package/dist/bundle/chunks/chunk-X6RQRO3L.js +0 -16
  281. package/dist/bundle/chunks/chunk-XJ2YV77J.js +0 -30
  282. package/dist/bundle/chunks/chunk-Y55SJART.js +0 -13
  283. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-AMCR7QEI.js +0 -2
  284. package/dist/bundle/chunks/google-generative-ai-43M4N5LK.js +0 -2
  285. package/dist/bundle/chunks/google-vertex-2B3PASK2.js +0 -2
  286. package/dist/bundle/chunks/mistral-conversations-E3D5ZQKB.js +0 -5
  287. package/dist/bundle/chunks/openai-codex-responses-MSQDSDUR.js +0 -10
  288. package/dist/bundle/chunks/openai-completions-4IC6AGTR.js +0 -7
  289. package/dist/bundle/chunks/openai-responses-MCO3BHCC.js +0 -4
  290. package/dist/bundle/chunks/openrouter-images-SHUJ3VSG.js +0 -2
  291. package/dist/bundle/chunks/pi-messages-NIKOQ4O7.js +0 -8
  292. package/dist/bundle/chunks/typesafe-system-one-R2CDUWNO.js +0 -2
  293. package/dist/bundle/chunks/virtual-modules-2WYTGPJ3.js +0 -2
  294. package/dist/core/telemetry.d.ts +0 -3
  295. package/dist/core/telemetry.d.ts.map +0 -1
  296. package/dist/core/telemetry.js +0 -9
  297. package/dist/core/telemetry.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";
@@ -45,8 +44,7 @@ import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipb
45
44
  import { flushStdout } from "../../utils/flush-stdout.js";
46
45
  import { parseGitUrl } from "../../utils/git.js";
47
46
  import { ensurePngTranscoder } from "../../utils/image-convert.js";
48
- import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
49
- import { getPiUserAgent } from "../../utils/pi-user-agent.js";
47
+ import { getCwdRelativePath, pathsEqual, resolvePath, shortenHomePath } from "../../utils/paths.js";
50
48
  import { killTrackedDetachedChildren } from "../../utils/shell.js";
51
49
  import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
52
50
  import { stripBom } from "../../utils/text.js";
@@ -92,7 +90,8 @@ import { UserMessageSelectorComponent } from "./components/user-message-selector
92
90
  import { editInExternalEditor } from "./external-editor.js";
93
91
  import { refreshModelCatalogs } from "./model-catalog-refresh.js";
94
92
  import { getModelSearchText } from "./model-search.js";
95
- import { ProgramStatusReporter } from "./program-status-reporter.js";
93
+ import { ProgramResumeReporter } from "./program-resume-reporter.js";
94
+ import { dialogBlockedStatus, ProgramStatusReporter } from "./program-status-reporter.js";
96
95
  import { shareSession } from "./session-share.js";
97
96
  import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
98
97
  import { InteractiveThemeController } from "./theme/theme-controller.js";
@@ -177,20 +176,44 @@ function quoteIfNeeded(value) {
177
176
  }
178
177
  return `'${value.replace(/'/g, `'\\''`)}'`;
179
178
  }
180
- export function formatResumeCommand(sessionManager) {
181
- if (!process.stdout.isTTY)
182
- 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) {
183
181
  if (!sessionManager.isPersisted())
184
182
  return undefined;
185
183
  const sessionFile = sessionManager.getSessionFile();
186
184
  if (!sessionFile || !fs.existsSync(sessionFile))
187
185
  return undefined;
188
186
  const args = [APP_NAME];
187
+ if (!usesDefaultAgentDir()) {
188
+ args.push("--agent-dir", resolvePath(getAgentDir()));
189
+ }
189
190
  if (!sessionManager.usesDefaultSessionDir()) {
190
- args.push("--session-dir", quoteIfNeeded(sessionManager.getSessionDir()));
191
+ args.push("--session-dir", sessionManager.getSessionDir());
191
192
  }
192
193
  args.push("--session", sessionManager.getSessionId());
193
- 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 };
194
217
  }
195
218
  function hasDefaultModelProvider(providerId) {
196
219
  return providerId in defaultModelPerProvider;
@@ -363,6 +386,8 @@ export class InteractiveMode {
363
386
  shutdownRequested = false;
364
387
  /** Reports working, blocked, done, and error states to terminals that support OSC 7501. */
365
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;
366
391
  /** The `/bug` hint is shown at most once per session so error output stays readable. */
367
392
  bugReportHintShown = false;
368
393
  installChangeWarningShown = false;
@@ -416,6 +441,9 @@ export class InteractiveMode {
416
441
  const tuiMode = options.tuiMode ?? this.settingsManager.getTuiMode();
417
442
  this.options = { ...options, tuiMode };
418
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
+ }
419
447
  this.runtimeHost.setBeforeSessionInvalidate(() => {
420
448
  this.resetExtensionUI();
421
449
  });
@@ -778,6 +806,7 @@ export class InteractiveMode {
778
806
  this.ui.start();
779
807
  this.isInitialized = true;
780
808
  this.programStatus.report();
809
+ this.programResume?.report();
781
810
  this.ensurePngTranscoder();
782
811
  this.themeController.applyFromSettings();
783
812
  // The header and startup notices bake theme colors into their text, so build them once the terminal
@@ -944,10 +973,6 @@ export class InteractiveMode {
944
973
  if (migratedProviders && migratedProviders.length > 0) {
945
974
  this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
946
975
  }
947
- const modelsJsonError = this.session.modelRuntime.getError();
948
- if (modelsJsonError) {
949
- this.showError(`models.json error: ${modelsJsonError}`);
950
- }
951
976
  if (modelFallbackMessage) {
952
977
  this.showWarning(modelFallbackMessage);
953
978
  }
@@ -1061,9 +1086,8 @@ export class InteractiveMode {
1061
1086
  const changelogPath = getChangelogPath();
1062
1087
  const entries = parseChangelog(changelogPath);
1063
1088
  if (!lastVersion) {
1064
- // Fresh install - record the version, send telemetry, don't show changelog
1089
+ // Fresh install - record the version, don't show changelog
1065
1090
  this.settingsManager.setLastChangelogVersion(VERSION);
1066
- this.reportInstallTelemetry(VERSION);
1067
1091
  return undefined;
1068
1092
  }
1069
1093
  const newEntries = getNewEntries(entries, lastVersion);
@@ -1074,7 +1098,6 @@ export class InteractiveMode {
1074
1098
  }
1075
1099
  if (newEntries.length > 0) {
1076
1100
  this.settingsManager.setLastChangelogVersion(VERSION);
1077
- this.reportInstallTelemetry(VERSION);
1078
1101
  return newEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
1079
1102
  }
1080
1103
  return undefined;
@@ -1136,22 +1159,6 @@ export class InteractiveMode {
1136
1159
  return undefined;
1137
1160
  }
1138
1161
  }
1139
- reportInstallTelemetry(version) {
1140
- if (process.env.PI_OFFLINE) {
1141
- return;
1142
- }
1143
- if (!isInstallTelemetryEnabled(this.settingsManager)) {
1144
- return;
1145
- }
1146
- void fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`, {
1147
- headers: {
1148
- "User-Agent": getPiUserAgent(version),
1149
- },
1150
- signal: AbortSignal.timeout(5000),
1151
- })
1152
- .then(() => undefined)
1153
- .catch(() => undefined);
1154
- }
1155
1162
  getMarkdownThemeWithSettings() {
1156
1163
  return {
1157
1164
  ...getMarkdownTheme(),
@@ -1747,6 +1754,7 @@ export class InteractiveMode {
1747
1754
  this.unsubscribe?.();
1748
1755
  this.unsubscribe = undefined;
1749
1756
  this.programStatus.reset();
1757
+ this.programResume?.report();
1750
1758
  this.applyRuntimeSettings();
1751
1759
  if (options.renderBeforeBind) {
1752
1760
  this.renderCurrentSessionState();
@@ -1809,7 +1817,7 @@ export class InteractiveMode {
1809
1817
  if (this.bugReportHintShown)
1810
1818
  return;
1811
1819
  this.bugReportHintShown = true;
1812
- 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));
1813
1821
  this.ui.requestRender();
1814
1822
  }
1815
1823
  maybeSuggestBugReport(message) {
@@ -2238,8 +2246,14 @@ export class InteractiveMode {
2238
2246
  setHeader: (factory) => this.setExtensionHeader(factory),
2239
2247
  setTitle: (title) => this.ui.terminal.setTitle(title),
2240
2248
  custom: (factory, options) => this.showExtensionCustom(factory, options),
2241
- pasteToEditor: (text) => this.editor.handleInput(`\x1b[200~${text}\x1b[201~`),
2242
- 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
+ },
2243
2257
  getEditorText: () => this.editor.getExpandedText?.() ?? this.editor.getText(),
2244
2258
  editor: (title, prefill) => this.showExtensionEditor(title, prefill),
2245
2259
  addAutocompleteProvider: (factory) => {
@@ -2301,7 +2315,7 @@ export class InteractiveMode {
2301
2315
  /**
2302
2316
  * Show a selector for extensions.
2303
2317
  */
2304
- showExtensionSelector(title, options, opts, blocked = { kind: "question", message: title }) {
2318
+ showExtensionSelector(title, options, opts) {
2305
2319
  return new Promise((resolve) => {
2306
2320
  if (opts?.signal?.aborted) {
2307
2321
  resolve(undefined);
@@ -2316,16 +2330,16 @@ export class InteractiveMode {
2316
2330
  const onAbort = () => finish(undefined);
2317
2331
  opts?.signal?.addEventListener("abort", onAbort, { once: true });
2318
2332
  const selector = new ExtensionSelectorComponent(title, options, (option) => finish(option), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
2319
- this.pushExtensionDialog(selector, blocked);
2333
+ this.pushExtensionDialog(selector, dialogBlockedStatus(opts?.blockedKind ?? "question", title));
2320
2334
  });
2321
2335
  }
2322
2336
  /**
2323
2337
  * Show a confirmation dialog for extensions.
2324
2338
  */
2325
2339
  async showExtensionConfirm(title, message, opts) {
2326
- const result = await this.showExtensionSelector(`${title}\n${message}`, ["Yes", "No"], opts, {
2327
- kind: "permission",
2328
- message: title,
2340
+ const result = await this.showExtensionSelector(`${title}\n${message}`, ["Yes", "No"], {
2341
+ ...opts,
2342
+ blockedKind: opts?.blockedKind ?? "permission",
2329
2343
  });
2330
2344
  return result === "Yes";
2331
2345
  }
@@ -2352,7 +2366,7 @@ export class InteractiveMode {
2352
2366
  const onAbort = () => finish(undefined);
2353
2367
  opts?.signal?.addEventListener("abort", onAbort, { once: true });
2354
2368
  const input = new ExtensionInputComponent(title, placeholder, (value) => finish(value), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout });
2355
- this.pushExtensionDialog(input, { kind: "question", message: title });
2369
+ this.pushExtensionDialog(input, dialogBlockedStatus(opts?.blockedKind ?? "question", title));
2356
2370
  });
2357
2371
  }
2358
2372
  /**
@@ -2365,7 +2379,7 @@ export class InteractiveMode {
2365
2379
  resolve(value);
2366
2380
  };
2367
2381
  const editor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => finish(value), () => finish(undefined), undefined, this.settingsManager.getExternalEditorCommand());
2368
- this.pushExtensionDialog(editor, { kind: "question", message: title });
2382
+ this.pushExtensionDialog(editor, dialogBlockedStatus("question", title));
2369
2383
  });
2370
2384
  }
2371
2385
  /**
@@ -2844,7 +2858,7 @@ export class InteractiveMode {
2844
2858
  const command = isExcluded ? text.slice(2).trim() : text.slice(1).trim();
2845
2859
  if (command) {
2846
2860
  if (this.session.isBashRunning) {
2847
- 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.`);
2848
2862
  this.editor.setText(text);
2849
2863
  return;
2850
2864
  }
@@ -2900,6 +2914,10 @@ export class InteractiveMode {
2900
2914
  }
2901
2915
  this.footer.invalidate();
2902
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();
2903
2921
  switch (event.type) {
2904
2922
  case "agent_start":
2905
2923
  this.pendingTools.clear();
@@ -3313,7 +3331,8 @@ export class InteractiveMode {
3313
3331
  if (message.output) {
3314
3332
  component.appendOutput(message.output);
3315
3333
  }
3316
- 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);
3317
3336
  this.chatContainer.addChild(component);
3318
3337
  break;
3319
3338
  }
@@ -3390,7 +3409,7 @@ export class InteractiveMode {
3390
3409
  const renderedPendingTools = new Map();
3391
3410
  // Cache misses are not persisted, unlike successful cache-warming usage.
3392
3411
  // Re-derive them and inject them after the assistant messages that paid for them.
3393
- const cacheMisses = this.settingsManager.getShowCacheMissNotices()
3412
+ const cacheMisses = this.settingsManager.getNotices().cacheMisses
3394
3413
  ? collectCacheMisses(this.sessionManager.getEntries(), this.session.modelRuntime)
3395
3414
  : new Map();
3396
3415
  if (options.updateFooter) {
@@ -3503,7 +3522,7 @@ export class InteractiveMode {
3503
3522
  this.renderSessionItems(items, messageMeta, options);
3504
3523
  }
3505
3524
  addCacheWarmingUsage(entry) {
3506
- if (!this.settingsManager.getShowCacheMissNotices())
3525
+ if (!this.settingsManager.getNotices().cacheWarming)
3507
3526
  return;
3508
3527
  // Back-to-back warms collapse into one line with the cumulative cost.
3509
3528
  const previous = this.cacheWarmingNotice;
@@ -3523,7 +3542,7 @@ export class InteractiveMode {
3523
3542
  * from persisted summary usage and is not stored as a separate session entry.
3524
3543
  */
3525
3544
  addCompactionCostNotice(notice) {
3526
- if (!this.settingsManager.getShowCacheMissNotices())
3545
+ if (!this.settingsManager.getNotices().compactionCosts)
3527
3546
  return;
3528
3547
  const { usage } = notice;
3529
3548
  const tokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;
@@ -3533,7 +3552,7 @@ export class InteractiveMode {
3533
3552
  this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
3534
3553
  }
3535
3554
  maybeShowThinkingDropNotice(message) {
3536
- if (!this.settingsManager.getShowCacheMissNotices())
3555
+ if (!this.settingsManager.getNotices().reasoningDrops)
3537
3556
  return;
3538
3557
  const dropped = getDroppedReasoning(message);
3539
3558
  if (!dropped)
@@ -3563,7 +3582,7 @@ export class InteractiveMode {
3563
3582
  * a model switch, or an idle gap past the cache TTL.
3564
3583
  */
3565
3584
  maybeShowCacheMissNotice(message) {
3566
- if (!this.settingsManager.getShowCacheMissNotices())
3585
+ if (!this.settingsManager.getNotices().cacheMisses)
3567
3586
  return;
3568
3587
  // Entries don't contain `message` yet: message_end fires before persistence.
3569
3588
  const miss = detectCacheMiss(this.sessionManager.getEntries(), message, this.session.modelRuntime);
@@ -3656,7 +3675,7 @@ export class InteractiveMode {
3656
3675
  // `signal-exit` checks the listener list during the same SIGTERM/SIGHUP
3657
3676
  // dispatch and re-sends the signal if only its own listeners remain.
3658
3677
  if (options?.fromSignal) {
3659
- // Signal-triggered shutdown (SIGTERM/SIGHUP). Emit extension cleanup
3678
+ // Signal-triggered shutdown (SIGTERM/SIGHUP, SIGBREAK on Windows). Emit extension cleanup
3660
3679
  // (session_shutdown) BEFORE touching the terminal. Extension teardown
3661
3680
  // such as removing sockets does not write to the tty, so it must not be
3662
3681
  // skipped if a later terminal-restore write fails on a dead or stalled
@@ -3668,6 +3687,7 @@ export class InteractiveMode {
3668
3687
  await this.ui.terminal.drainInput(1000);
3669
3688
  this.stop();
3670
3689
  await flushStdout();
3690
+ killTrackedDetachedChildren();
3671
3691
  process.exit(0);
3672
3692
  }
3673
3693
  // Interactive quit (Ctrl+D, Ctrl+C, /quit, extension shutdown()). Stop the
@@ -3677,6 +3697,8 @@ export class InteractiveMode {
3677
3697
  // This prevents escape sequences from leaking to the parent shell over slow SSH.
3678
3698
  this.themeController.disableAutoSync();
3679
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();
3680
3702
  this.stop();
3681
3703
  await this.runtimeHost.dispose();
3682
3704
  const resumeCommand = formatResumeCommand(this.sessionManager);
@@ -3685,6 +3707,9 @@ export class InteractiveMode {
3685
3707
  process.stdout.write(`${chalk.dim("To resume this session:")}\n${resumeCommand}\n`);
3686
3708
  }
3687
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();
3688
3713
  process.exit(0);
3689
3714
  }
3690
3715
  emergencyTerminalExit() {
@@ -3747,10 +3772,13 @@ export class InteractiveMode {
3747
3772
  }
3748
3773
  registerSignalHandlers() {
3749
3774
  this.unregisterSignalHandlers();
3750
- const signals = ["SIGTERM"];
3751
- if (process.platform !== "win32") {
3752
- signals.push("SIGHUP");
3753
- }
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");
3754
3782
  for (const signal of signals) {
3755
3783
  const handler = () => {
3756
3784
  // SIGHUP no longer hard-exits: graceful shutdown emits session_shutdown
@@ -3807,6 +3835,7 @@ export class InteractiveMode {
3807
3835
  clearInterval(suspendKeepAlive);
3808
3836
  process.removeListener("SIGINT", ignoreSigint);
3809
3837
  this.ui.start();
3838
+ this.programResume?.reportAgain();
3810
3839
  this.ui.requestRender(true);
3811
3840
  });
3812
3841
  try {
@@ -4254,11 +4283,9 @@ export class InteractiveMode {
4254
4283
  hideThinkingBlock: this.hideThinkingBlock,
4255
4284
  mermaidRenderingMode: this.settingsManager.getMermaidRenderingMode(),
4256
4285
  collapseChangelog: this.settingsManager.getCollapseChangelog(),
4257
- enableInstallTelemetry: this.settingsManager.getEnableInstallTelemetry(),
4258
4286
  doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
4259
4287
  treeFilterMode: this.settingsManager.getTreeFilterMode(),
4260
4288
  showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
4261
- showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
4262
4289
  defaultProjectTrust: this.settingsManager.getDefaultProjectTrust(),
4263
4290
  editorPaddingX: this.settingsManager.getEditorPaddingX(),
4264
4291
  outputPad: this.settingsManager.getOutputPad(),
@@ -4272,6 +4299,7 @@ export class InteractiveMode {
4272
4299
  fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
4273
4300
  fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
4274
4301
  warnings: this.settingsManager.getWarnings(),
4302
+ notices: this.settingsManager.getNotices(),
4275
4303
  }, {
4276
4304
  onAutoCompactChange: (enabled) => {
4277
4305
  this.session.setAutoCompactionEnabled(enabled);
@@ -4361,16 +4389,9 @@ export class InteractiveMode {
4361
4389
  this.chatContainer.invalidate();
4362
4390
  this.ui.requestRender();
4363
4391
  },
4364
- onShowCacheMissNoticesChange: (shown) => {
4365
- this.settingsManager.setShowCacheMissNotices(shown);
4366
- this.rebuildChatFromMessages();
4367
- },
4368
4392
  onCollapseChangelogChange: (collapsed) => {
4369
4393
  this.settingsManager.setCollapseChangelog(collapsed);
4370
4394
  },
4371
- onEnableInstallTelemetryChange: (enabled) => {
4372
- this.settingsManager.setEnableInstallTelemetry(enabled);
4373
- },
4374
4395
  onQuietStartupChange: (quiet) => {
4375
4396
  this.settingsManager.setQuietStartup(quiet);
4376
4397
  },
@@ -4454,6 +4475,11 @@ export class InteractiveMode {
4454
4475
  onWarningsChange: (warnings) => {
4455
4476
  this.settingsManager.setWarnings(warnings);
4456
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
+ },
4457
4483
  onCancel: () => {
4458
4484
  done();
4459
4485
  this.ui.requestRender();
@@ -5041,12 +5067,14 @@ export class InteractiveMode {
5041
5067
  const options = [];
5042
5068
  for (const provider of this.session.modelRuntime.getProviders()) {
5043
5069
  const authStatus = this.session.modelRuntime.getProviderAuthStatus(provider.id);
5044
- const status = authStatus.configured
5045
- ? {
5046
- type: this.session.modelRuntime.isUsingOAuth(provider.id) ? "oauth" : "api_key",
5047
- source: authStatus.label ?? authStatus.source,
5048
- }
5049
- : 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
+ }
5050
5078
  const subscription = provider.auth.oauth?.isSubscription === true;
5051
5079
  if ((!authType || authType === "oauth") && provider.auth.oauth) {
5052
5080
  options.push({
@@ -5080,7 +5108,7 @@ export class InteractiveMode {
5080
5108
  id: providerId,
5081
5109
  name: provider?.name ?? providerId,
5082
5110
  authType: type,
5083
- status: { type, source: "stored credential" },
5111
+ status: { kind: "configured", type, source: "stored credential" },
5084
5112
  subscription: provider?.auth.oauth?.isSubscription === true,
5085
5113
  };
5086
5114
  })
@@ -5621,7 +5649,7 @@ export class InteractiveMode {
5621
5649
  const savedImplicitProjectTrust = this.maybeSaveImplicitProjectTrustAfterReload();
5622
5650
  const modelsJsonError = this.session.modelRuntime.getError();
5623
5651
  if (modelsJsonError) {
5624
- this.showError(`models.json error: ${modelsJsonError}`);
5652
+ this.showWarning(`models.json error: ${modelsJsonError}`);
5625
5653
  }
5626
5654
  this.showStatus(savedImplicitProjectTrust
5627
5655
  ? "Reloaded keybindings, extensions, skills, prompts, themes, and context files; saved project trust"
@@ -5924,6 +5952,7 @@ export class InteractiveMode {
5924
5952
  const yankPop = this.getEditorKeyDisplay("tui.editor.yankPop");
5925
5953
  const undo = this.getEditorKeyDisplay("tui.editor.undo");
5926
5954
  const tab = this.getEditorKeyDisplay("tui.input.tab");
5955
+ const cancelAutocomplete = this.getEditorKeyDisplay("tui.select.cancel");
5927
5956
  // App keybindings
5928
5957
  const interrupt = this.getAppKeyDisplay("app.interrupt");
5929
5958
  const clear = this.getAppKeyDisplay("app.clear");
@@ -5969,7 +5998,8 @@ export class InteractiveMode {
5969
5998
  | Key | Action |
5970
5999
  |-----|--------|
5971
6000
  | \`${tab}\` | Path completion / accept autocomplete |
5972
- | \`${interrupt}\` | Cancel autocomplete / abort streaming |
6001
+ | \`${cancelAutocomplete}\` | Cancel autocomplete |
6002
+ | \`${interrupt}\` | Abort streaming or running bash command |
5973
6003
  | \`${clear}\` | Clear editor (first) / exit (second) |
5974
6004
  | \`${exit}\` | Exit (when editor is empty) |
5975
6005
  | \`${suspend}\` | Suspend to background |
@@ -6097,7 +6127,7 @@ export class InteractiveMode {
6097
6127
  if (result.output) {
6098
6128
  this.bashComponent.appendOutput(result.output);
6099
6129
  }
6100
- 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);
6101
6131
  // Record the result in session
6102
6132
  this.session.recordBashResult(command, result, { excludeFromContext });
6103
6133
  this.bashComponent = undefined;
@@ -6126,7 +6156,7 @@ export class InteractiveMode {
6126
6156
  }
6127
6157
  }, { excludeFromContext, operations: eventResult?.operations });
6128
6158
  if (this.bashComponent) {
6129
- 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);
6130
6160
  }
6131
6161
  }
6132
6162
  catch (error) {