@bastani/atomic 0.9.89 → 0.9.90-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (868) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +13 -0
  3. package/dist/builtin/intercom/README.md +3 -1
  4. package/dist/builtin/intercom/broker/broker.ts +35 -10
  5. package/dist/builtin/intercom/broker/client.ts +42 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +400 -67
  7. package/dist/builtin/intercom/package.json +1 -1
  8. package/dist/builtin/intercom/skills/intercom/SKILL.md +24 -5
  9. package/dist/builtin/intercom/types.ts +5 -0
  10. package/dist/builtin/mcp/package.json +1 -1
  11. package/dist/builtin/subagents/CHANGELOG.md +27 -0
  12. package/dist/builtin/subagents/README.md +18 -20
  13. package/dist/builtin/subagents/agents/worker.md +1 -1
  14. package/dist/builtin/subagents/package.json +1 -1
  15. package/dist/builtin/subagents/skills/feedback/SKILL.md +2 -2
  16. package/dist/builtin/subagents/skills/qlty/SKILL.md +2 -2
  17. package/dist/builtin/subagents/skills/qlty/references/commands.md +45 -12
  18. package/dist/builtin/subagents/skills/qlty/references/quickstart.md +102 -21
  19. package/dist/builtin/subagents/skills/subagent/SKILL.md +18 -17
  20. package/dist/builtin/subagents/skills/tdd/LICENSE.txt +50 -0
  21. package/dist/builtin/subagents/skills/tdd/SKILL.md +10 -0
  22. package/dist/builtin/subagents/skills/tdd/tests.md +16 -0
  23. package/dist/builtin/subagents/skills/tmux/LICENSE.txt +24 -0
  24. package/dist/builtin/subagents/skills/tmux/SKILL.md +20 -1
  25. package/dist/builtin/subagents/skills/tmux/scripts/find-sessions.sh +19 -10
  26. package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +231 -19
  27. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1911 -845
  28. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  29. package/dist/builtin/web-access/index.bundle.mjs +158 -34
  30. package/dist/builtin/web-access/package.json +1 -1
  31. package/dist/builtin/workflows/CHANGELOG.md +36 -0
  32. package/dist/builtin/workflows/builtin/{chunk-tjk7jp9a.js → chunk-akmcsx14.js} +1 -1
  33. package/dist/builtin/workflows/builtin/{chunk-913nwrzq.js → chunk-erpybg3c.js} +109 -30
  34. package/dist/builtin/workflows/builtin/{chunk-e07n7en6.js → chunk-wpgpr31s.js} +1 -1
  35. package/dist/builtin/workflows/builtin/goal.js +2 -2
  36. package/dist/builtin/workflows/builtin/index.js +3 -3
  37. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  38. package/dist/builtin/workflows/package.json +1 -1
  39. package/dist/builtin/workflows/skills/bro/SKILL.md +1 -1
  40. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +19 -19
  41. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +2 -2
  42. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +3 -3
  43. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +2 -2
  44. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +2 -2
  45. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +3 -3
  46. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_2.md +3 -2
  47. package/dist/builtin/workflows/skills/show-me/SKILL.md +2 -2
  48. package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +29 -24
  49. package/dist/builtin/workflows/skills/teach/SKILL.md +8 -8
  50. package/dist/builtin/workflows/skills/unslop/SKILL.md +29 -51
  51. package/dist/builtin/workflows/src/durable/journal/internal.d.ts +10 -5
  52. package/dist/builtin/workflows/src/durable/journal/sharded-run-journal.d.ts +6 -3
  53. package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +25 -3
  54. package/dist/builtin/workflows/src/extension/index.bundle.mjs +4444 -1356
  55. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +2544 -568
  56. package/dist/builtin/workflows/src/index.js +2467 -549
  57. package/dist/builtin/workflows/src/local-worker-entry.mjs +2544 -568
  58. package/dist/cli/storage-command.d.ts +6 -0
  59. package/dist/cli/storage-command.d.ts.map +1 -1
  60. package/dist/cli/storage-command.js +11 -0
  61. package/dist/cli/storage-command.js.map +1 -1
  62. package/dist/cli/storage-search-database.d.ts +18 -0
  63. package/dist/cli/storage-search-database.d.ts.map +1 -0
  64. package/dist/cli/storage-search-database.js +90 -0
  65. package/dist/cli/storage-search-database.js.map +1 -0
  66. package/dist/cli/storage-search-session.d.ts +5 -0
  67. package/dist/cli/storage-search-session.d.ts.map +1 -0
  68. package/dist/cli/storage-search-session.js +133 -0
  69. package/dist/cli/storage-search-session.js.map +1 -0
  70. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  71. package/dist/core/agent-session-accessors.js +107 -1
  72. package/dist/core/agent-session-accessors.js.map +1 -1
  73. package/dist/core/agent-session-bash.d.ts.map +1 -1
  74. package/dist/core/agent-session-bash.js +2 -0
  75. package/dist/core/agent-session-bash.js.map +1 -1
  76. package/dist/core/agent-session-boundaries.d.ts +2 -0
  77. package/dist/core/agent-session-boundaries.d.ts.map +1 -1
  78. package/dist/core/agent-session-boundaries.js +9 -4
  79. package/dist/core/agent-session-boundaries.js.map +1 -1
  80. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  81. package/dist/core/agent-session-custom-message-commit.js +2 -1
  82. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  83. package/dist/core/agent-session-detached-tools.d.ts +3 -2
  84. package/dist/core/agent-session-detached-tools.d.ts.map +1 -1
  85. package/dist/core/agent-session-detached-tools.js +156 -41
  86. package/dist/core/agent-session-detached-tools.js.map +1 -1
  87. package/dist/core/agent-session-events.d.ts +2 -1
  88. package/dist/core/agent-session-events.d.ts.map +1 -1
  89. package/dist/core/agent-session-events.js +59 -23
  90. package/dist/core/agent-session-events.js.map +1 -1
  91. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  92. package/dist/core/agent-session-extension-bindings.js +53 -4
  93. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  94. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  95. package/dist/core/agent-session-message-queue.js +2 -1
  96. package/dist/core/agent-session-message-queue.js.map +1 -1
  97. package/dist/core/agent-session-methods.d.ts +23 -3
  98. package/dist/core/agent-session-methods.d.ts.map +1 -1
  99. package/dist/core/agent-session-methods.js.map +1 -1
  100. package/dist/core/agent-session-models.d.ts.map +1 -1
  101. package/dist/core/agent-session-models.js +2 -0
  102. package/dist/core/agent-session-models.js.map +1 -1
  103. package/dist/core/agent-session-prompt.d.ts +1 -1
  104. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  105. package/dist/core/agent-session-prompt.js +14 -3
  106. package/dist/core/agent-session-prompt.js.map +1 -1
  107. package/dist/core/agent-session-queue-pause.d.ts +2 -1
  108. package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
  109. package/dist/core/agent-session-queue-pause.js +8 -4
  110. package/dist/core/agent-session-queue-pause.js.map +1 -1
  111. package/dist/core/agent-session-retry.d.ts +7 -3
  112. package/dist/core/agent-session-retry.d.ts.map +1 -1
  113. package/dist/core/agent-session-retry.js +113 -112
  114. package/dist/core/agent-session-retry.js.map +1 -1
  115. package/dist/core/agent-session-runtime.d.ts +15 -0
  116. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  117. package/dist/core/agent-session-runtime.js +26 -0
  118. package/dist/core/agent-session-runtime.js.map +1 -1
  119. package/dist/core/agent-session-services.d.ts +5 -2
  120. package/dist/core/agent-session-services.d.ts.map +1 -1
  121. package/dist/core/agent-session-services.js +6 -6
  122. package/dist/core/agent-session-services.js.map +1 -1
  123. package/dist/core/agent-session-tasks.js.map +1 -1
  124. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  125. package/dist/core/agent-session-tool-registry.js +4 -2
  126. package/dist/core/agent-session-tool-registry.js.map +1 -1
  127. package/dist/core/agent-session-types.d.ts +19 -1
  128. package/dist/core/agent-session-types.d.ts.map +1 -1
  129. package/dist/core/agent-session-types.js.map +1 -1
  130. package/dist/core/agent-session.d.ts +11 -0
  131. package/dist/core/agent-session.d.ts.map +1 -1
  132. package/dist/core/agent-session.js +8 -0
  133. package/dist/core/agent-session.js.map +1 -1
  134. package/dist/core/anthropic-thinking-guard.d.ts +16 -1
  135. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  136. package/dist/core/anthropic-thinking-guard.js +124 -7
  137. package/dist/core/anthropic-thinking-guard.js.map +1 -1
  138. package/dist/core/auth-storage.d.ts +3 -0
  139. package/dist/core/auth-storage.d.ts.map +1 -1
  140. package/dist/core/auth-storage.js +10 -0
  141. package/dist/core/auth-storage.js.map +1 -1
  142. package/dist/core/detached-tool-output.d.ts +4 -0
  143. package/dist/core/detached-tool-output.d.ts.map +1 -0
  144. package/dist/core/detached-tool-output.js +48 -0
  145. package/dist/core/detached-tool-output.js.map +1 -0
  146. package/dist/core/event-loop-monitor.d.ts +4 -1
  147. package/dist/core/event-loop-monitor.d.ts.map +1 -1
  148. package/dist/core/event-loop-monitor.js +84 -159
  149. package/dist/core/event-loop-monitor.js.map +1 -1
  150. package/dist/core/export-html/index.d.ts.map +1 -1
  151. package/dist/core/export-html/index.js +26 -4
  152. package/dist/core/export-html/index.js.map +1 -1
  153. package/dist/core/export-html/saved-agent-cards.d.ts +15 -0
  154. package/dist/core/export-html/saved-agent-cards.d.ts.map +1 -0
  155. package/dist/core/export-html/saved-agent-cards.js +255 -0
  156. package/dist/core/export-html/saved-agent-cards.js.map +1 -0
  157. package/dist/core/export-html/saved-agent-viewer.js +101 -0
  158. package/dist/core/extensions/builtin-subagent-record-writer.d.ts +11 -0
  159. package/dist/core/extensions/builtin-subagent-record-writer.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin-subagent-record-writer.js +33 -0
  161. package/dist/core/extensions/builtin-subagent-record-writer.js.map +1 -0
  162. package/dist/core/extensions/loader-api.d.ts +1 -1
  163. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  164. package/dist/core/extensions/loader-api.js +9 -2
  165. package/dist/core/extensions/loader-api.js.map +1 -1
  166. package/dist/core/extensions/loader-bindings.d.ts +7 -0
  167. package/dist/core/extensions/loader-bindings.d.ts.map +1 -1
  168. package/dist/core/extensions/loader-bindings.js +42 -1
  169. package/dist/core/extensions/loader-bindings.js.map +1 -1
  170. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  171. package/dist/core/extensions/loader-core.js +33 -12
  172. package/dist/core/extensions/loader-core.js.map +1 -1
  173. package/dist/core/extensions/runner-events.d.ts +2 -0
  174. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  175. package/dist/core/extensions/runner-events.js +17 -7
  176. package/dist/core/extensions/runner-events.js.map +1 -1
  177. package/dist/core/extensions/runner.d.ts +6 -2
  178. package/dist/core/extensions/runner.d.ts.map +1 -1
  179. package/dist/core/extensions/runner.js +5 -2
  180. package/dist/core/extensions/runner.js.map +1 -1
  181. package/dist/core/extensions/ui-types.d.ts +4 -0
  182. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  183. package/dist/core/extensions/ui-types.js.map +1 -1
  184. package/dist/core/extensions/workflow-run-control-hub.d.ts +2 -2
  185. package/dist/core/extensions/workflow-run-control-hub.d.ts.map +1 -1
  186. package/dist/core/extensions/workflow-run-control-hub.js +2 -2
  187. package/dist/core/extensions/workflow-run-control-hub.js.map +1 -1
  188. package/dist/core/extensions/workflow-run-control.d.ts +10 -3
  189. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  190. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  191. package/dist/core/first-prompt-model.d.ts +22 -0
  192. package/dist/core/first-prompt-model.d.ts.map +1 -0
  193. package/dist/core/first-prompt-model.js +84 -0
  194. package/dist/core/first-prompt-model.js.map +1 -0
  195. package/dist/core/footer-data-provider.d.ts.map +1 -1
  196. package/dist/core/footer-data-provider.js +11 -7
  197. package/dist/core/footer-data-provider.js.map +1 -1
  198. package/dist/core/fork-replay-pair.d.ts +22 -0
  199. package/dist/core/fork-replay-pair.d.ts.map +1 -0
  200. package/dist/core/fork-replay-pair.js +174 -0
  201. package/dist/core/fork-replay-pair.js.map +1 -0
  202. package/dist/core/fork-replay-wire.d.ts +11 -0
  203. package/dist/core/fork-replay-wire.d.ts.map +1 -0
  204. package/dist/core/fork-replay-wire.js +116 -0
  205. package/dist/core/fork-replay-wire.js.map +1 -0
  206. package/dist/core/messages.d.ts +2 -0
  207. package/dist/core/messages.d.ts.map +1 -1
  208. package/dist/core/messages.js +8 -4
  209. package/dist/core/messages.js.map +1 -1
  210. package/dist/core/model-runtime.d.ts +10 -1
  211. package/dist/core/model-runtime.d.ts.map +1 -1
  212. package/dist/core/model-runtime.js +76 -11
  213. package/dist/core/model-runtime.js.map +1 -1
  214. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  215. package/dist/core/package-manager-auto-resources.js +3 -2
  216. package/dist/core/package-manager-auto-resources.js.map +1 -1
  217. package/dist/core/package-manager-resource-files.js +7 -8
  218. package/dist/core/package-manager-resource-files.js.map +1 -1
  219. package/dist/core/project-trust-state.d.ts +90 -0
  220. package/dist/core/project-trust-state.d.ts.map +1 -0
  221. package/dist/core/project-trust-state.js +65 -0
  222. package/dist/core/project-trust-state.js.map +1 -0
  223. package/dist/core/provider-rate-limits.d.ts +6 -0
  224. package/dist/core/provider-rate-limits.d.ts.map +1 -1
  225. package/dist/core/provider-rate-limits.js +43 -0
  226. package/dist/core/provider-rate-limits.js.map +1 -1
  227. package/dist/core/provider-request-admission.d.ts.map +1 -1
  228. package/dist/core/provider-request-admission.js +10 -1
  229. package/dist/core/provider-request-admission.js.map +1 -1
  230. package/dist/core/remote-catalog-provider.d.ts +6 -1
  231. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  232. package/dist/core/remote-catalog-provider.js +22 -1
  233. package/dist/core/remote-catalog-provider.js.map +1 -1
  234. package/dist/core/resolve-config-value.d.ts.map +1 -1
  235. package/dist/core/resolve-config-value.js +5 -2
  236. package/dist/core/resolve-config-value.js.map +1 -1
  237. package/dist/core/resource-loader-core.d.ts.map +1 -1
  238. package/dist/core/resource-loader-core.js +3 -0
  239. package/dist/core/resource-loader-core.js.map +1 -1
  240. package/dist/core/resource-loader-extensions.d.ts +2 -2
  241. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  242. package/dist/core/resource-loader-extensions.js +6 -4
  243. package/dist/core/resource-loader-extensions.js.map +1 -1
  244. package/dist/core/resource-loader-package-resources.d.ts +1 -0
  245. package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
  246. package/dist/core/resource-loader-package-resources.js +2 -1
  247. package/dist/core/resource-loader-package-resources.js.map +1 -1
  248. package/dist/core/resource-loader-reload.d.ts +1 -1
  249. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  250. package/dist/core/resource-loader-reload.js +3 -2
  251. package/dist/core/resource-loader-reload.js.map +1 -1
  252. package/dist/core/resource-loader-types.d.ts +2 -0
  253. package/dist/core/resource-loader-types.d.ts.map +1 -1
  254. package/dist/core/resource-loader-types.js.map +1 -1
  255. package/dist/core/resume/blueprint/actions.d.ts.map +1 -1
  256. package/dist/core/resume/blueprint/actions.js +15 -15
  257. package/dist/core/resume/blueprint/actions.js.map +1 -1
  258. package/dist/core/resume/blueprint/process.d.ts +6 -1
  259. package/dist/core/resume/blueprint/process.d.ts.map +1 -1
  260. package/dist/core/resume/blueprint/process.js +132 -21
  261. package/dist/core/resume/blueprint/process.js.map +1 -1
  262. package/dist/core/runtime-credentials.d.ts +5 -0
  263. package/dist/core/runtime-credentials.d.ts.map +1 -1
  264. package/dist/core/runtime-credentials.js +34 -0
  265. package/dist/core/runtime-credentials.js.map +1 -1
  266. package/dist/core/sdk-types.d.ts +2 -0
  267. package/dist/core/sdk-types.d.ts.map +1 -1
  268. package/dist/core/sdk-types.js.map +1 -1
  269. package/dist/core/sdk.d.ts +1 -1
  270. package/dist/core/sdk.d.ts.map +1 -1
  271. package/dist/core/sdk.js +187 -32
  272. package/dist/core/sdk.js.map +1 -1
  273. package/dist/core/session-account-model.d.ts +15 -0
  274. package/dist/core/session-account-model.d.ts.map +1 -0
  275. package/dist/core/session-account-model.js +105 -0
  276. package/dist/core/session-account-model.js.map +1 -0
  277. package/dist/core/session-lifecycle-scope.d.ts +5 -0
  278. package/dist/core/session-lifecycle-scope.d.ts.map +1 -1
  279. package/dist/core/session-lifecycle-scope.js.map +1 -1
  280. package/dist/core/session-manager-core.d.ts +21 -2
  281. package/dist/core/session-manager-core.d.ts.map +1 -1
  282. package/dist/core/session-manager-core.js +64 -8
  283. package/dist/core/session-manager-core.js.map +1 -1
  284. package/dist/core/session-manager-history.d.ts +3 -1
  285. package/dist/core/session-manager-history.d.ts.map +1 -1
  286. package/dist/core/session-manager-history.js +19 -5
  287. package/dist/core/session-manager-history.js.map +1 -1
  288. package/dist/core/session-manager-types.d.ts +2 -0
  289. package/dist/core/session-manager-types.d.ts.map +1 -1
  290. package/dist/core/session-manager-types.js.map +1 -1
  291. package/dist/core/session-retry-status.d.ts +22 -0
  292. package/dist/core/session-retry-status.d.ts.map +1 -0
  293. package/dist/core/session-retry-status.js +25 -0
  294. package/dist/core/session-retry-status.js.map +1 -0
  295. package/dist/core/session-worktree-snapshots.d.ts +4 -2
  296. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  297. package/dist/core/session-worktree-snapshots.js +8 -4
  298. package/dist/core/session-worktree-snapshots.js.map +1 -1
  299. package/dist/core/settings-manager-core.d.ts +4 -0
  300. package/dist/core/settings-manager-core.d.ts.map +1 -1
  301. package/dist/core/settings-manager-core.js +73 -1
  302. package/dist/core/settings-manager-core.js.map +1 -1
  303. package/dist/core/settings-schema.js +1 -1
  304. package/dist/core/settings-schema.js.map +1 -1
  305. package/dist/core/slash-commands.d.ts +2 -2
  306. package/dist/core/slash-commands.d.ts.map +1 -1
  307. package/dist/core/slash-commands.js +15 -4
  308. package/dist/core/slash-commands.js.map +1 -1
  309. package/dist/core/storage/database.d.ts +14 -2
  310. package/dist/core/storage/database.d.ts.map +1 -1
  311. package/dist/core/storage/database.js.map +1 -1
  312. package/dist/core/storage/dialect.d.ts +13 -0
  313. package/dist/core/storage/dialect.d.ts.map +1 -1
  314. package/dist/core/storage/dialect.js +9 -1
  315. package/dist/core/storage/dialect.js.map +1 -1
  316. package/dist/core/storage/errors.d.ts +23 -1
  317. package/dist/core/storage/errors.d.ts.map +1 -1
  318. package/dist/core/storage/errors.js +28 -5
  319. package/dist/core/storage/errors.js.map +1 -1
  320. package/dist/core/storage/journal-transfer.d.ts.map +1 -1
  321. package/dist/core/storage/journal-transfer.js +90 -5
  322. package/dist/core/storage/journal-transfer.js.map +1 -1
  323. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  324. package/dist/core/storage/node-sqlite.js +61 -1
  325. package/dist/core/storage/node-sqlite.js.map +1 -1
  326. package/dist/core/storage/session/chunked-resume-projection.d.ts +4 -0
  327. package/dist/core/storage/session/chunked-resume-projection.d.ts.map +1 -0
  328. package/dist/core/storage/session/chunked-resume-projection.js +369 -0
  329. package/dist/core/storage/session/chunked-resume-projection.js.map +1 -0
  330. package/dist/core/storage/session/legacy-session-store.d.ts +5 -0
  331. package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
  332. package/dist/core/storage/session/legacy-session-store.js +10 -2
  333. package/dist/core/storage/session/legacy-session-store.js.map +1 -1
  334. package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
  335. package/dist/core/storage/session/memory-session-store.js +6 -1
  336. package/dist/core/storage/session/memory-session-store.js.map +1 -1
  337. package/dist/core/storage/session/snapshot-generation.d.ts +8 -0
  338. package/dist/core/storage/session/snapshot-generation.d.ts.map +1 -0
  339. package/dist/core/storage/session/snapshot-generation.js +17 -0
  340. package/dist/core/storage/session/snapshot-generation.js.map +1 -0
  341. package/dist/core/storage/session/sql-session-store.d.ts +12 -0
  342. package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
  343. package/dist/core/storage/session/sql-session-store.js +243 -46
  344. package/dist/core/storage/session/sql-session-store.js.map +1 -1
  345. package/dist/core/storage/sqlite-facade.d.ts +17 -2
  346. package/dist/core/storage/sqlite-facade.d.ts.map +1 -1
  347. package/dist/core/storage/sqlite-facade.js +17 -1
  348. package/dist/core/storage/sqlite-facade.js.map +1 -1
  349. package/dist/core/tasks/agent-adapter.d.ts +13 -2
  350. package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
  351. package/dist/core/tasks/agent-adapter.js +25 -8
  352. package/dist/core/tasks/agent-adapter.js.map +1 -1
  353. package/dist/core/tasks/agent-panel-rules.d.ts +77 -0
  354. package/dist/core/tasks/agent-panel-rules.d.ts.map +1 -0
  355. package/dist/core/tasks/agent-panel-rules.js +88 -0
  356. package/dist/core/tasks/agent-panel-rules.js.map +1 -0
  357. package/dist/core/tasks/agent-panel-source.d.ts +19 -0
  358. package/dist/core/tasks/agent-panel-source.d.ts.map +1 -1
  359. package/dist/core/tasks/agent-panel-source.js +50 -9
  360. package/dist/core/tasks/agent-panel-source.js.map +1 -1
  361. package/dist/core/tasks/command-output.d.ts +17 -2
  362. package/dist/core/tasks/command-output.d.ts.map +1 -1
  363. package/dist/core/tasks/command-output.js +59 -3
  364. package/dist/core/tasks/command-output.js.map +1 -1
  365. package/dist/core/tasks/completion-message.d.ts +8 -3
  366. package/dist/core/tasks/completion-message.d.ts.map +1 -1
  367. package/dist/core/tasks/completion-message.js +14 -10
  368. package/dist/core/tasks/completion-message.js.map +1 -1
  369. package/dist/core/tasks/completion.d.ts +14 -4
  370. package/dist/core/tasks/completion.d.ts.map +1 -1
  371. package/dist/core/tasks/completion.js +58 -17
  372. package/dist/core/tasks/completion.js.map +1 -1
  373. package/dist/core/tasks/contracts.d.ts +10 -1
  374. package/dist/core/tasks/contracts.d.ts.map +1 -1
  375. package/dist/core/tasks/contracts.js +3 -1
  376. package/dist/core/tasks/contracts.js.map +1 -1
  377. package/dist/core/tasks/heartbeat.js +2 -1
  378. package/dist/core/tasks/heartbeat.js.map +1 -1
  379. package/dist/core/tasks/live-elapsed.d.ts +16 -1
  380. package/dist/core/tasks/live-elapsed.d.ts.map +1 -1
  381. package/dist/core/tasks/live-elapsed.js +43 -4
  382. package/dist/core/tasks/live-elapsed.js.map +1 -1
  383. package/dist/core/tasks/owner-store.d.ts +8 -0
  384. package/dist/core/tasks/owner-store.d.ts.map +1 -1
  385. package/dist/core/tasks/owner-store.js +34 -4
  386. package/dist/core/tasks/owner-store.js.map +1 -1
  387. package/dist/core/tasks/session-scope.d.ts +7 -0
  388. package/dist/core/tasks/session-scope.d.ts.map +1 -1
  389. package/dist/core/tasks/session-scope.js +15 -9
  390. package/dist/core/tasks/session-scope.js.map +1 -1
  391. package/dist/core/tasks/supervisor.d.ts +7 -3
  392. package/dist/core/tasks/supervisor.d.ts.map +1 -1
  393. package/dist/core/tasks/supervisor.js +92 -17
  394. package/dist/core/tasks/supervisor.js.map +1 -1
  395. package/dist/core/tasks/task-archive-snapshot.d.ts +7 -0
  396. package/dist/core/tasks/task-archive-snapshot.d.ts.map +1 -0
  397. package/dist/core/tasks/task-archive-snapshot.js +33 -0
  398. package/dist/core/tasks/task-archive-snapshot.js.map +1 -0
  399. package/dist/core/tasks/task-resumer.d.ts +5 -3
  400. package/dist/core/tasks/task-resumer.d.ts.map +1 -1
  401. package/dist/core/tasks/task-resumer.js +37 -13
  402. package/dist/core/tasks/task-resumer.js.map +1 -1
  403. package/dist/core/tasks/task-view-source.d.ts +25 -3
  404. package/dist/core/tasks/task-view-source.d.ts.map +1 -1
  405. package/dist/core/tasks/task-view-source.js +144 -44
  406. package/dist/core/tasks/task-view-source.js.map +1 -1
  407. package/dist/core/tasks/transcript.d.ts +3 -1
  408. package/dist/core/tasks/transcript.d.ts.map +1 -1
  409. package/dist/core/tasks/transcript.js +27 -0
  410. package/dist/core/tasks/transcript.js.map +1 -1
  411. package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts.map +1 -1
  412. package/dist/core/tools/ask-user-question/view/dialog-builder.js +2 -1
  413. package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
  414. package/dist/core/tools/bash.d.ts.map +1 -1
  415. package/dist/core/tools/bash.js +2 -1
  416. package/dist/core/tools/bash.js.map +1 -1
  417. package/dist/core/tools/history-protocol.d.ts.map +1 -1
  418. package/dist/core/tools/history-protocol.js +130 -29
  419. package/dist/core/tools/history-protocol.js.map +1 -1
  420. package/dist/core/tools/history-search-position.d.ts +30 -0
  421. package/dist/core/tools/history-search-position.d.ts.map +1 -0
  422. package/dist/core/tools/history-search-position.js +161 -0
  423. package/dist/core/tools/history-search-position.js.map +1 -0
  424. package/dist/core/tools/history-search-wire.d.ts +25 -0
  425. package/dist/core/tools/history-search-wire.d.ts.map +1 -0
  426. package/dist/core/tools/history-search-wire.js +210 -0
  427. package/dist/core/tools/history-search-wire.js.map +1 -0
  428. package/dist/core/tools/resource-selectors.d.ts +7 -1
  429. package/dist/core/tools/resource-selectors.d.ts.map +1 -1
  430. package/dist/core/tools/resource-selectors.js +18 -11
  431. package/dist/core/tools/resource-selectors.js.map +1 -1
  432. package/dist/core/tools/search.d.ts.map +1 -1
  433. package/dist/core/tools/search.js +24 -3
  434. package/dist/core/tools/search.js.map +1 -1
  435. package/dist/core/tools/sqlite-selector-connection.d.ts +3 -0
  436. package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
  437. package/dist/core/tools/sqlite-selector-connection.js +4 -0
  438. package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
  439. package/dist/core/tools/tool-abort-grace.d.ts +13 -0
  440. package/dist/core/tools/tool-abort-grace.d.ts.map +1 -0
  441. package/dist/core/tools/tool-abort-grace.js +72 -0
  442. package/dist/core/tools/tool-abort-grace.js.map +1 -0
  443. package/dist/core/tools/tool-concurrency.d.ts +5 -1
  444. package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
  445. package/dist/core/tools/tool-concurrency.js +36 -6
  446. package/dist/core/tools/tool-concurrency.js.map +1 -1
  447. package/dist/core/workflow-resume.d.ts +1 -1
  448. package/dist/core/workflow-resume.d.ts.map +1 -1
  449. package/dist/core/workflow-resume.js +13 -3
  450. package/dist/core/workflow-resume.js.map +1 -1
  451. package/dist/core/workflow-summary-lifecycle.d.ts.map +1 -1
  452. package/dist/core/workflow-summary-lifecycle.js +8 -2
  453. package/dist/core/workflow-summary-lifecycle.js.map +1 -1
  454. package/dist/core/workspace/errors.d.ts +5 -2
  455. package/dist/core/workspace/errors.d.ts.map +1 -1
  456. package/dist/core/workspace/errors.js +59 -5
  457. package/dist/core/workspace/errors.js.map +1 -1
  458. package/dist/core/worktree-snapshot/blob-store.d.ts +138 -17
  459. package/dist/core/worktree-snapshot/blob-store.d.ts.map +1 -1
  460. package/dist/core/worktree-snapshot/blob-store.js +788 -82
  461. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  462. package/dist/core/worktree-snapshot/garbage.d.ts +17 -2
  463. package/dist/core/worktree-snapshot/garbage.d.ts.map +1 -1
  464. package/dist/core/worktree-snapshot/garbage.js +20 -4
  465. package/dist/core/worktree-snapshot/garbage.js.map +1 -1
  466. package/dist/core/worktree-snapshot/index.d.ts +1 -1
  467. package/dist/core/worktree-snapshot/index.d.ts.map +1 -1
  468. package/dist/core/worktree-snapshot/index.js +1 -1
  469. package/dist/core/worktree-snapshot/index.js.map +1 -1
  470. package/dist/core/worktree-snapshot/pool.d.ts.map +1 -1
  471. package/dist/core/worktree-snapshot/pool.js +38 -6
  472. package/dist/core/worktree-snapshot/pool.js.map +1 -1
  473. package/dist/core/worktree-snapshot/shared-clock.d.ts +3 -1
  474. package/dist/core/worktree-snapshot/shared-clock.d.ts.map +1 -1
  475. package/dist/core/worktree-snapshot/shared-clock.js +116 -26
  476. package/dist/core/worktree-snapshot/shared-clock.js.map +1 -1
  477. package/dist/core/worktree-snapshot/types.d.ts +4 -1
  478. package/dist/core/worktree-snapshot/types.d.ts.map +1 -1
  479. package/dist/core/worktree-snapshot/types.js.map +1 -1
  480. package/dist/extensions/llama/huggingface-ui.d.ts.map +1 -1
  481. package/dist/extensions/llama/huggingface-ui.js +2 -2
  482. package/dist/extensions/llama/huggingface-ui.js.map +1 -1
  483. package/dist/extensions/llama/index.d.ts +2 -0
  484. package/dist/extensions/llama/index.d.ts.map +1 -1
  485. package/dist/extensions/llama/index.js +19 -2
  486. package/dist/extensions/llama/index.js.map +1 -1
  487. package/dist/index.d.ts +9 -6
  488. package/dist/index.d.ts.map +1 -1
  489. package/dist/index.js +8 -4
  490. package/dist/index.js.map +1 -1
  491. package/dist/main.d.ts.map +1 -1
  492. package/dist/main.js +74 -15
  493. package/dist/main.js.map +1 -1
  494. package/dist/modes/interactive/components/agent-panel.d.ts +22 -6
  495. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  496. package/dist/modes/interactive/components/agent-panel.js +80 -23
  497. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  498. package/dist/modes/interactive/components/assistant-message.d.ts +2 -0
  499. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/assistant-message.js +11 -0
  501. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  502. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/atomic-working-status.js +10 -3
  504. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
  505. package/dist/modes/interactive/components/bash-execution.d.ts +3 -2
  506. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/bash-execution.js +7 -7
  508. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  509. package/dist/modes/interactive/components/branch-summary-message.d.ts +6 -0
  510. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/branch-summary-message.js +12 -7
  512. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  513. package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -0
  514. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/chat-message-renderer.js +24 -3
  516. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  517. package/dist/modes/interactive/components/chat-session-host-actions.d.ts +1 -1
  518. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  519. package/dist/modes/interactive/components/chat-session-host-actions.js +16 -10
  520. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  521. package/dist/modes/interactive/components/chat-session-host-events.d.ts +10 -0
  522. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/chat-session-host-events.js +76 -31
  524. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  525. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts +17 -5
  526. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  527. package/dist/modes/interactive/components/chat-session-host-rendering.js +79 -24
  528. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  529. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/chat-session-host-runtime.js +5 -4
  531. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  532. package/dist/modes/interactive/components/chat-session-host-state.d.ts +16 -1
  533. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/chat-session-host-state.js +22 -0
  535. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  536. package/dist/modes/interactive/components/chat-session-host-types.d.ts +8 -2
  537. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  538. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  539. package/dist/modes/interactive/components/chat-session-host-utils.d.ts +1 -0
  540. package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/chat-session-host-utils.js +2 -1
  542. package/dist/modes/interactive/components/chat-session-host-utils.js.map +1 -1
  543. package/dist/modes/interactive/components/chat-session-host.d.ts +35 -9
  544. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/chat-session-host.js +129 -35
  546. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  547. package/dist/modes/interactive/components/chat-transcript.d.ts +13 -2
  548. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  549. package/dist/modes/interactive/components/chat-transcript.js +24 -4
  550. package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
  551. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +6 -0
  552. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/compaction-boundary-message.js +12 -7
  554. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  555. package/dist/modes/interactive/components/composer-rule.d.ts +0 -2
  556. package/dist/modes/interactive/components/composer-rule.d.ts.map +1 -1
  557. package/dist/modes/interactive/components/composer-rule.js +4 -6
  558. package/dist/modes/interactive/components/composer-rule.js.map +1 -1
  559. package/dist/modes/interactive/components/countdown-timer.d.ts +5 -9
  560. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  561. package/dist/modes/interactive/components/countdown-timer.js +32 -23
  562. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  563. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  564. package/dist/modes/interactive/components/custom-editor.js +4 -3
  565. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  566. package/dist/modes/interactive/components/custom-entry.d.ts +6 -0
  567. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/custom-entry.js +15 -0
  569. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  570. package/dist/modes/interactive/components/custom-message.d.ts +7 -3
  571. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  572. package/dist/modes/interactive/components/custom-message.js +17 -15
  573. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  574. package/dist/modes/interactive/components/footer.d.ts +10 -3
  575. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  576. package/dist/modes/interactive/components/footer.js +37 -45
  577. package/dist/modes/interactive/components/footer.js.map +1 -1
  578. package/dist/modes/interactive/components/heartbeat-block.d.ts.map +1 -1
  579. package/dist/modes/interactive/components/heartbeat-block.js +3 -1
  580. package/dist/modes/interactive/components/heartbeat-block.js.map +1 -1
  581. package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -1
  582. package/dist/modes/interactive/components/host-input-form.js +3 -3
  583. package/dist/modes/interactive/components/host-input-form.js.map +1 -1
  584. package/dist/modes/interactive/components/index.d.ts +1 -1
  585. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  586. package/dist/modes/interactive/components/index.js.map +1 -1
  587. package/dist/modes/interactive/components/input-label.d.ts.map +1 -1
  588. package/dist/modes/interactive/components/input-label.js +4 -5
  589. package/dist/modes/interactive/components/input-label.js.map +1 -1
  590. package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
  591. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  592. package/dist/modes/interactive/components/keybinding-hints.js +27 -6
  593. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  594. package/dist/modes/interactive/components/main-composer-keys.d.ts +17 -2
  595. package/dist/modes/interactive/components/main-composer-keys.d.ts.map +1 -1
  596. package/dist/modes/interactive/components/main-composer-keys.js +44 -27
  597. package/dist/modes/interactive/components/main-composer-keys.js.map +1 -1
  598. package/dist/modes/interactive/components/model-selector.d.ts +6 -1
  599. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  600. package/dist/modes/interactive/components/model-selector.js +13 -7
  601. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  602. package/dist/modes/interactive/components/nav-keys.d.ts +7 -2
  603. package/dist/modes/interactive/components/nav-keys.d.ts.map +1 -1
  604. package/dist/modes/interactive/components/nav-keys.js +51 -17
  605. package/dist/modes/interactive/components/nav-keys.js.map +1 -1
  606. package/dist/modes/interactive/components/notice-line.d.ts +8 -0
  607. package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
  608. package/dist/modes/interactive/components/notice-line.js +6 -1
  609. package/dist/modes/interactive/components/notice-line.js.map +1 -1
  610. package/dist/modes/interactive/components/selector.d.ts +3 -0
  611. package/dist/modes/interactive/components/selector.d.ts.map +1 -1
  612. package/dist/modes/interactive/components/selector.js +30 -7
  613. package/dist/modes/interactive/components/selector.js.map +1 -1
  614. package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
  615. package/dist/modes/interactive/components/session-selector-list.js +11 -11
  616. package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
  617. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  618. package/dist/modes/interactive/components/session-selector.js +2 -2
  619. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  620. package/dist/modes/interactive/components/settings-picker.d.ts +5 -0
  621. package/dist/modes/interactive/components/settings-picker.d.ts.map +1 -1
  622. package/dist/modes/interactive/components/settings-picker.js +36 -2
  623. package/dist/modes/interactive/components/settings-picker.js.map +1 -1
  624. package/dist/modes/interactive/components/settings-selector-submenus.d.ts +10 -0
  625. package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
  626. package/dist/modes/interactive/components/settings-selector-submenus.js +89 -19
  627. package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
  628. package/dist/modes/interactive/components/settings-selector-types.d.ts +6 -0
  629. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  630. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  631. package/dist/modes/interactive/components/settings-selector.d.ts +7 -0
  632. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  633. package/dist/modes/interactive/components/settings-selector.js +12 -0
  634. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  635. package/dist/modes/interactive/components/skill-invocation-message.d.ts +6 -0
  636. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  637. package/dist/modes/interactive/components/skill-invocation-message.js +12 -7
  638. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  639. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  640. package/dist/modes/interactive/components/task-board.js +9 -2
  641. package/dist/modes/interactive/components/task-board.js.map +1 -1
  642. package/dist/modes/interactive/components/task-completion-message.d.ts +10 -3
  643. package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -1
  644. package/dist/modes/interactive/components/task-completion-message.js +173 -19
  645. package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
  646. package/dist/modes/interactive/components/task-inspector.d.ts +1 -1
  647. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  648. package/dist/modes/interactive/components/task-inspector.js +28 -19
  649. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  650. package/dist/modes/interactive/components/task-list.d.ts +7 -3
  651. package/dist/modes/interactive/components/task-list.d.ts.map +1 -1
  652. package/dist/modes/interactive/components/task-list.js +60 -33
  653. package/dist/modes/interactive/components/task-list.js.map +1 -1
  654. package/dist/modes/interactive/components/task-row.d.ts +7 -0
  655. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  656. package/dist/modes/interactive/components/task-row.js +25 -11
  657. package/dist/modes/interactive/components/task-row.js.map +1 -1
  658. package/dist/modes/interactive/components/task-transcript-notices.d.ts +16 -0
  659. package/dist/modes/interactive/components/task-transcript-notices.d.ts.map +1 -0
  660. package/dist/modes/interactive/components/task-transcript-notices.js +74 -0
  661. package/dist/modes/interactive/components/task-transcript-notices.js.map +1 -0
  662. package/dist/modes/interactive/components/task-transcript-page.d.ts +11 -6
  663. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  664. package/dist/modes/interactive/components/task-transcript-page.js +48 -21
  665. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  666. package/dist/modes/interactive/components/tool-block-families.d.ts.map +1 -1
  667. package/dist/modes/interactive/components/tool-block-families.js +2 -1
  668. package/dist/modes/interactive/components/tool-block-families.js.map +1 -1
  669. package/dist/modes/interactive/components/tool-execution.d.ts +3 -2
  670. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  671. package/dist/modes/interactive/components/tool-execution.js +23 -9
  672. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  673. package/dist/modes/interactive/components/transcript-block-clicks.d.ts +54 -14
  674. package/dist/modes/interactive/components/transcript-block-clicks.d.ts.map +1 -1
  675. package/dist/modes/interactive/components/transcript-block-clicks.js +151 -16
  676. package/dist/modes/interactive/components/transcript-block-clicks.js.map +1 -1
  677. package/dist/modes/interactive/components/tree-selector-help.d.ts.map +1 -1
  678. package/dist/modes/interactive/components/tree-selector-help.js +25 -30
  679. package/dist/modes/interactive/components/tree-selector-help.js.map +1 -1
  680. package/dist/modes/interactive/components/tree-selector-list.d.ts +4 -0
  681. package/dist/modes/interactive/components/tree-selector-list.d.ts.map +1 -1
  682. package/dist/modes/interactive/components/tree-selector-list.js +21 -21
  683. package/dist/modes/interactive/components/tree-selector-list.js.map +1 -1
  684. package/dist/modes/interactive/components/working-run-meter.d.ts +31 -2
  685. package/dist/modes/interactive/components/working-run-meter.d.ts.map +1 -1
  686. package/dist/modes/interactive/components/working-run-meter.js +81 -10
  687. package/dist/modes/interactive/components/working-run-meter.js.map +1 -1
  688. package/dist/modes/interactive/interactive-agent-events.js +67 -14
  689. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  690. package/dist/modes/interactive/interactive-autocomplete.js +2 -2
  691. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  692. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  693. package/dist/modes/interactive/interactive-deferred-startup.js +10 -4
  694. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  695. package/dist/modes/interactive/interactive-editor-actions.js +4 -1
  696. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  697. package/dist/modes/interactive/interactive-extension-custom-ui.js +13 -3
  698. package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
  699. package/dist/modes/interactive/interactive-extension-runtime.js +4 -2
  700. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  701. package/dist/modes/interactive/interactive-extension-widgets.js +6 -8
  702. package/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
  703. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  704. package/dist/modes/interactive/interactive-input-handling.js +43 -3
  705. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  706. package/dist/modes/interactive/interactive-mode-base.d.ts +7 -0
  707. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  708. package/dist/modes/interactive/interactive-mode-base.js +9 -2
  709. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  710. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  711. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  712. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  713. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  714. package/dist/modes/interactive/interactive-mode-helpers.d.ts +5 -0
  715. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  716. package/dist/modes/interactive/interactive-mode-helpers.js +9 -0
  717. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  718. package/dist/modes/interactive/interactive-mode-surface.d.ts +10 -2
  719. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  720. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  721. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  722. package/dist/modes/interactive/interactive-model-routing.js +63 -21
  723. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  724. package/dist/modes/interactive/interactive-prompt-turn.js +1 -1
  725. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
  726. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  727. package/dist/modes/interactive/interactive-render-chat.js +71 -10
  728. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  729. package/dist/modes/interactive/interactive-resource-rendering.js +9 -18
  730. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  731. package/dist/modes/interactive/interactive-selectors.js +106 -57
  732. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  733. package/dist/modes/interactive/interactive-session-routing.js +10 -5
  734. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  735. package/dist/modes/interactive/interactive-session-runtime.d.ts +3 -0
  736. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  737. package/dist/modes/interactive/interactive-session-runtime.js +11 -0
  738. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  739. package/dist/modes/interactive/interactive-slash-commands.js +3 -0
  740. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  741. package/dist/modes/interactive/interactive-startup-chat-container.d.ts +5 -1
  742. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -1
  743. package/dist/modes/interactive/interactive-startup-chat-container.js +8 -3
  744. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
  745. package/dist/modes/interactive/interactive-startup-trust.d.ts +2 -0
  746. package/dist/modes/interactive/interactive-startup-trust.d.ts.map +1 -1
  747. package/dist/modes/interactive/interactive-startup-trust.js +21 -0
  748. package/dist/modes/interactive/interactive-startup-trust.js.map +1 -1
  749. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  750. package/dist/modes/interactive/interactive-startup.js +39 -17
  751. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  752. package/dist/modes/interactive/interactive-task-projection.d.ts.map +1 -1
  753. package/dist/modes/interactive/interactive-task-projection.js +11 -1
  754. package/dist/modes/interactive/interactive-task-projection.js.map +1 -1
  755. package/dist/modes/interactive/resume-catalog.d.ts.map +1 -1
  756. package/dist/modes/interactive/resume-catalog.js +1 -0
  757. package/dist/modes/interactive/resume-catalog.js.map +1 -1
  758. package/dist/modes/interactive/theme/theme-controller.d.ts +6 -1
  759. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  760. package/dist/modes/interactive/theme/theme-controller.js +19 -1
  761. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  762. package/dist/modes/interactive-engine/engine-child-liveness.d.ts +2 -0
  763. package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
  764. package/dist/modes/interactive-engine/engine-child-liveness.js +2 -0
  765. package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
  766. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  767. package/dist/modes/interactive-engine/engine-custom-ui.js +54 -4
  768. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  769. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  770. package/dist/modes/interactive-engine/engine-render-service.js +21 -2
  771. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  772. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +4 -2
  773. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  774. package/dist/modes/interactive-engine/extension-ui-bridge.js +4 -0
  775. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  776. package/dist/modes/interactive-engine/isolated-runtime.d.ts +39 -3
  777. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  778. package/dist/modes/interactive-engine/isolated-runtime.js +219 -29
  779. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  780. package/dist/modes/interactive-engine/protocol.d.ts +33 -1
  781. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  782. package/dist/modes/interactive-engine/protocol.js +40 -2
  783. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  784. package/dist/modes/interactive-engine/remote-command-catalog.d.ts +2 -2
  785. package/dist/modes/interactive-engine/remote-command-catalog.d.ts.map +1 -1
  786. package/dist/modes/interactive-engine/remote-command-catalog.js +7 -3
  787. package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -1
  788. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  789. package/dist/modes/interactive-engine/remote-component.js +31 -5
  790. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  791. package/dist/modes/interactive-engine/remote-renderer.d.ts +20 -12
  792. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  793. package/dist/modes/interactive-engine/remote-renderer.js +100 -34
  794. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  795. package/dist/modes/print-mode.d.ts.map +1 -1
  796. package/dist/modes/print-mode.js +4 -1
  797. package/dist/modes/print-mode.js.map +1 -1
  798. package/dist/modes/rpc/agent-panel-bridge.d.ts +7 -0
  799. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  800. package/dist/modes/rpc/agent-panel-bridge.js +119 -114
  801. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  802. package/dist/modes/rpc/rpc-client-process.d.ts +2 -1
  803. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  804. package/dist/modes/rpc/rpc-client-process.js +2 -1
  805. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  806. package/dist/modes/rpc/rpc-client.d.ts +8 -0
  807. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  808. package/dist/modes/rpc/rpc-client.js +5 -1
  809. package/dist/modes/rpc/rpc-client.js.map +1 -1
  810. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  811. package/dist/modes/rpc/rpc-command-handler.js +19 -2
  812. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  813. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  814. package/dist/modes/rpc/rpc-mode.js +4 -2
  815. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  816. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  817. package/dist/modes/rpc/rpc-session-binding.js +7 -0
  818. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  819. package/dist/modes/rpc/rpc-types.d.ts +13 -1
  820. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  821. package/dist/modes/rpc/rpc-types.js.map +1 -1
  822. package/dist/utils/interactive-engine-bootstrap.d.ts +3 -0
  823. package/dist/utils/interactive-engine-bootstrap.d.ts.map +1 -1
  824. package/dist/utils/interactive-engine-bootstrap.js +25 -0
  825. package/dist/utils/interactive-engine-bootstrap.js.map +1 -1
  826. package/dist/utils/interactive-engine-env.d.ts +3 -0
  827. package/dist/utils/interactive-engine-env.d.ts.map +1 -1
  828. package/dist/utils/interactive-engine-env.js +1 -0
  829. package/dist/utils/interactive-engine-env.js.map +1 -1
  830. package/dist/utils/shell.d.ts +2 -0
  831. package/dist/utils/shell.d.ts.map +1 -1
  832. package/dist/utils/shell.js +3 -3
  833. package/dist/utils/shell.js.map +1 -1
  834. package/docs/background-tasks.md +32 -37
  835. package/docs/compaction.md +2 -2
  836. package/docs/computer-use.md +2 -0
  837. package/docs/development.md +11 -1
  838. package/docs/environment-variables.md +2 -0
  839. package/docs/extensions/api-reference.md +7 -3
  840. package/docs/extensions/authoring.md +3 -1
  841. package/docs/extensions/events.md +3 -1
  842. package/docs/extensions/ui.md +2 -0
  843. package/docs/guides/resume-on-any-machine.md +3 -1
  844. package/docs/intercom/reference.md +1 -1
  845. package/docs/intercom.md +3 -3
  846. package/docs/keybindings.md +6 -2
  847. package/docs/libraries/tui.md +4 -0
  848. package/docs/providers.md +1 -1
  849. package/docs/rpc/protocol.md +6 -4
  850. package/docs/sdk/reference.md +10 -4
  851. package/docs/sdk.md +5 -2
  852. package/docs/security.md +5 -1
  853. package/docs/session-format.md +1 -1
  854. package/docs/sessions.md +16 -0
  855. package/docs/settings.md +2 -2
  856. package/docs/skills.md +3 -3
  857. package/docs/storage.md +25 -4
  858. package/docs/subagents.md +42 -45
  859. package/docs/tui.md +1 -1
  860. package/docs/usage.md +3 -1
  861. package/docs/workflows/api-reference.md +3 -1
  862. package/docs/workflows/authoring.md +1 -1
  863. package/docs/workflows/operations.md +21 -14
  864. package/docs/workflows.md +1 -1
  865. package/docs/worktree-snapshots.md +10 -8
  866. package/npm-shrinkwrap.json +71 -49
  867. package/package.json +9 -8
  868. package/schemas/settings.schema.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-routing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACN,QAAQ,EAGR,wBAAwB,EACxB,sCAAsC,EACtC,OAAO,EACP,MAAM,EACN,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,MAAM,EACN,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,GACL,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,mBAAmB,CAAC,SAAS,CAAC,kBA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C,aAAa,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IACf,CAAC;IACD,sBAAsB,CAAC,IAAI,EAAE,2BAA2B,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { dirname } from \"node:path\";\nimport type { Focusable } from \"@bastani/atomic-tui\";\nimport { isResumeFailure } from \"../../core/resume/failure.ts\";\nimport type { SessionInfo, SessionListProgress } from \"../../core/session-manager.ts\";\nimport { worktreeRestoreNotices } from \"../../core/session-worktree-snapshots.ts\";\nimport {\n\tdeleteWorkflowFromPicker,\n\tlistWorkflowResumeEntries,\n\tresumeWorkflowFromPicker,\n} from \"../../core/workflow-resume.ts\";\nimport { canonicalizePathAsync } from \"../../utils/paths.ts\";\nimport { withHostProjectTrustPrompt } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { mountIdleStatus } from \"./components/idle-status.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\tAPP_NAME,\n\ttype Component,\n\ttype ExtensionCommandContext,\n\tgetProjectTrustPathAsync,\n\thasTrustRequiringProjectResourcesAsync,\n\tkeyText,\n\tLoader,\n\tMissingSessionCwdError,\n\tProjectTrustStore,\n\tSessionManager,\n\tSessionSelectorComponent,\n\tSpacer,\n\tTreeSelectorComponent,\n\tTrustSelectorComponent,\n\ttheme,\n} from \"./interactive-mode-deps.ts\";\nimport type { MissingCwdForkSource } from \"./interactive-mode-surface.ts\";\nimport { showQueueRestoreFailure } from \"./interactive-queueing.ts\";\nimport { clearChatForRerender } from \"./interactive-render-chat.ts\";\nimport { resolveResumeTarget, workflowResumeSession } from \"./resume-catalog.ts\";\nimport { showSessionNotices } from \"./session-notices.ts\";\n\nInteractiveModeBase.prototype.handleCloneCommand = async function (this: InteractiveModeBase): Promise<void> {\n\tawait this.ensureDeferredStartupComplete();\n\tconst leafId = this.sessionManager.getLeafId();\n\tif (!leafId) {\n\t\tthis.showStatus(\"Nothing to clone yet\");\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst result = await this.runtimeHost.fork(leafId, { position: \"at\" });\n\t\tif (result.cancelled) {\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderCurrentSessionState();\n\t\tthis.editor.setText(\"\");\n\t\tthis.showStatus(\"Cloned to new session\");\n\t} catch (error: unknown) {\n\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t}\n};\n\nInteractiveModeBase.prototype.maybeSaveImplicitProjectTrustAfterReload = async function (\n\tthis: InteractiveModeBase,\n): Promise<boolean> {\n\tconst cwd = this.sessionManager.getCwd();\n\tif (this.autoTrustOnReloadCwd !== cwd) {\n\t\treturn false;\n\t}\n\tif (!this.settingsManager.isProjectTrusted() || !(await hasTrustRequiringProjectResourcesAsync(cwd))) {\n\t\treturn false;\n\t}\n\n\tconst trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);\n\ttry {\n\t\tif ((await trustStore.getAsync(cwd)) !== null) {\n\t\t\tthis.autoTrustOnReloadCwd = undefined;\n\t\t\treturn false;\n\t\t}\n\t\tawait trustStore.setAsync(cwd, true);\n\t\tthis.autoTrustOnReloadCwd = undefined;\n\t\treturn true;\n\t} catch (error) {\n\t\tthis.showWarning(\n\t\t\t`Could not save project trust after reload: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t\treturn false;\n\t}\n};\n\nInteractiveModeBase.prototype.showTrustSelector = async function (this: InteractiveModeBase): Promise<void> {\n\tconst cwd = this.sessionManager.getCwd();\n\tconst trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);\n\tconst trustData = Promise.all([trustStore.getEntryAsync(cwd), getProjectTrustPathAsync(cwd)]);\n\tawait withHostProjectTrustPrompt(\n\t\tthis.runtimeHost,\n\t\t\"select\",\n\t\t\"Project trust\",\n\t\t() =>\n\t\t\tnew Promise<void>((resolve, reject) => {\n\t\t\t\tthis.showSelector((done) => {\n\t\t\t\t\tconst heldInput: string[] = [];\n\t\t\t\t\tlet selector: TrustSelectorComponent | undefined;\n\t\t\t\t\tlet focused = false;\n\t\t\t\t\tlet closed = false;\n\t\t\t\t\tconst view: Component & Focusable = {\n\t\t\t\t\t\tcapturesViewportInput: true,\n\t\t\t\t\t\tget focused() {\n\t\t\t\t\t\t\treturn focused;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tset focused(value: boolean) {\n\t\t\t\t\t\t\tfocused = value;\n\t\t\t\t\t\t\tif (selector) selector.focused = value;\n\t\t\t\t\t\t},\n\t\t\t\t\t\trender: (width) => selector?.render(width) ?? [],\n\t\t\t\t\t\tinvalidate: () => selector?.invalidate(),\n\t\t\t\t\t\thandleInput: (data) => {\n\t\t\t\t\t\t\tif (selector) selector.handleInput(data);\n\t\t\t\t\t\t\telse heldInput.push(data);\n\t\t\t\t\t\t},\n\t\t\t\t\t\thandleMouse: (event) => selector?.handleMouse(event),\n\t\t\t\t\t};\n\t\t\t\t\ttrustData.then(\n\t\t\t\t\t\t([savedDecision, trustPath]) => {\n\t\t\t\t\t\t\tif (closed) return;\n\t\t\t\t\t\t\tconst shown = new TrustSelectorComponent({\n\t\t\t\t\t\t\t\tcwd,\n\t\t\t\t\t\t\t\ttrustPath,\n\t\t\t\t\t\t\t\tsavedDecision,\n\t\t\t\t\t\t\t\tprojectTrusted: this.settingsManager.isProjectTrusted(),\n\t\t\t\t\t\t\t\tonSelect: (selection) => {\n\t\t\t\t\t\t\t\t\ttrustStore.setManyAsync(selection.updates).then(\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t\t\t\t\tthis.showStatus(\n\t\t\t\t\t\t\t\t\t\t\t\t`Saved trust decision: ${selection.trusted ? \"trusted\" : \"untrusted\"}. Restart ${APP_NAME} for this to take effect.`,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t(error: unknown) => {\n\t\t\t\t\t\t\t\t\t\t\tshown.selector.retrySelection();\n\t\t\t\t\t\t\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tshown.focused = focused;\n\t\t\t\t\t\t\tselector = shown;\n\t\t\t\t\t\t\tfor (const data of heldInput.splice(0)) {\n\t\t\t\t\t\t\t\tif (closed) break;\n\t\t\t\t\t\t\t\tshown.handleInput(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(error: unknown) => {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcomponent: view,\n\t\t\t\t\t\tfocus: view,\n\t\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}),\n\t).catch((error: Error) => this.showError(error.message));\n};\n\nInteractiveModeBase.prototype.showTreeSelector = async function (\n\tthis: InteractiveModeBase,\n\tinitialSelectedId?: string,\n): Promise<void> {\n\tawait this.ensureDeferredStartupComplete();\n\tawait this.sessionManager.loadFullHistory?.();\n\tconst tree = this.sessionManager.getTree();\n\tconst realLeafId = this.sessionManager.getLeafId();\n\tconst initialFilterMode = this.settingsManager.getTreeFilterMode();\n\n\tif (tree.length === 0) {\n\t\tthis.showStatus(\"No entries in session\");\n\t\treturn;\n\t}\n\n\tthis.showSelector((done) => {\n\t\tconst selector = new TreeSelectorComponent(\n\t\t\ttree,\n\t\t\trealLeafId,\n\t\t\tthis.ui.terminal.rows,\n\t\t\tasync (entryId) => {\n\t\t\t\t// Compare against the live leaf: a response that was streaming while the\n\t\t\t\t// selector was open may have advanced it past the captured value.\n\t\t\t\tif (entryId === this.sessionManager.getLeafId()) {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.showStatus(\"Already at this point\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ask about summarization\n\t\t\t\tdone(); // Close selector first\n\n\t\t\t\t// Loop until user makes a complete choice or cancels to tree\n\t\t\t\tlet wantsSummary = false;\n\t\t\t\tlet customInstructions: string | undefined;\n\n\t\t\t\t// Check if we should skip the prompt (user preference to always default to no summary)\n\t\t\t\tif (!this.settingsManager.getBranchSummarySkipPrompt()) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst summaryChoice = await this.showExtensionSelector(\"Summarize branch?\", [\n\t\t\t\t\t\t\t\"No summary\",\n\t\t\t\t\t\t\t\"Summarize\",\n\t\t\t\t\t\t\t\"Summarize with custom prompt\",\n\t\t\t\t\t\t]);\n\n\t\t\t\t\t\tif (summaryChoice === undefined) {\n\t\t\t\t\t\t\t// User pressed escape - re-show tree selector with same selection\n\t\t\t\t\t\t\tthis.showTreeSelector(entryId);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twantsSummary = summaryChoice !== \"No summary\";\n\n\t\t\t\t\t\tif (summaryChoice === \"Summarize with custom prompt\") {\n\t\t\t\t\t\t\tcustomInstructions = await this.showExtensionEditor(\"Custom summarization instructions\");\n\t\t\t\t\t\t\tif (customInstructions === undefined) {\n\t\t\t\t\t\t\t\t// User cancelled - loop back to summary selector\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// User made a complete choice\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.session.isStreaming) {\n\t\t\t\t\t// The clear goes out before the abort. The editor fills when the session answers, so a clear that\n\t\t\t\t\t// stalls or fails cannot hold up the abort.\n\t\t\t\t\tvoid this.restoreQueuedMessagesToEditor().catch((error: unknown) =>\n\t\t\t\t\t\tshowQueueRestoreFailure(this, error),\n\t\t\t\t\t);\n\t\t\t\t\tawait this.session.abort();\n\t\t\t\t}\n\t\t\t\tif (this.session.isCompacting) {\n\t\t\t\t\tthis.showError(\n\t\t\t\t\t\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\",\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set up escape handler and loader if summarizing\n\t\t\t\tlet summaryLoader: Loader | undefined;\n\t\t\t\tconst originalOnEscape = this.defaultEditor.onEscape;\n\n\t\t\t\tif (wantsSummary) {\n\t\t\t\t\tthis.defaultEditor.onEscape = () => {\n\t\t\t\t\t\tthis.session.abortBranchSummary();\n\t\t\t\t\t};\n\t\t\t\t\tthis.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\tsummaryLoader = new Loader(\n\t\t\t\t\t\tthis.ui,\n\t\t\t\t\t\t(spinner) => theme.fg(\"accent\", spinner),\n\t\t\t\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\t\t\t\t`Summarizing branch... (${keyText(\"app.interrupt\")} Cancel)`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.statusContainer.addChild(summaryLoader);\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\t\tconst result = await this.session.navigateTree(entryId, {\n\t\t\t\t\t\tsummarize: wantsSummary,\n\t\t\t\t\t\tcustomInstructions,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (result.aborted) {\n\t\t\t\t\t\t// Summarization aborted - re-show tree selector with same selection\n\t\t\t\t\t\tthis.showStatus(\"Branch summarization cancelled\");\n\t\t\t\t\t\tthis.showTreeSelector(entryId);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result.cancelled) {\n\t\t\t\t\t\tthis.showStatus(\"Navigation cancelled\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tclearChatForRerender(this);\n\t\t\t\t\tthis.renderInitialMessages();\n\t\t\t\t\tif (result.editorText && !this.editor.getText().trim()) {\n\t\t\t\t\t\tthis.editor.setText(result.editorText);\n\t\t\t\t\t}\n\t\t\t\t\tthis.showStatus(\"Navigated to selected point\");\n\t\t\t\t\tvoid this.flushCompactionQueue({ willRetry: false });\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t} finally {\n\t\t\t\t\tif (summaryLoader) {\n\t\t\t\t\t\tsummaryLoader.stop();\n\t\t\t\t\t\tthis.statusContainer.clear();\n\t\t\t\t\t\tmountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n\t\t\t\t\t}\n\t\t\t\t\tthis.defaultEditor.onEscape = originalOnEscape;\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tasync (entryId, label) => {\n\t\t\t\tawait this.sessionManager.appendLabelChange(entryId, label);\n\t\t\t},\n\t\t\tinitialSelectedId,\n\t\t\tinitialFilterMode,\n\t\t);\n\t\tselector.onLabelError = (error) => this.showError(error.message);\n\t\tselector.onLabelUpdate = () => this.ui.requestRender();\n\t\treturn { component: selector, focus: selector };\n\t});\n};\n\nInteractiveModeBase.prototype.showSessionSelector = function (this: InteractiveModeBase): void {\n\tthis.showSelector((done) => {\n\t\tlet closed = false;\n\t\tlet refreshTimer: ReturnType<typeof setInterval> | undefined;\n\t\tlet workflowCatalog: Promise<SessionInfo[]> | undefined;\n\t\tlet lastWorkflowRows: SessionInfo[] = [];\n\t\tlet workflowEpoch = 0;\n\t\tconst invalidateWorkflowCatalog = () => {\n\t\t\tworkflowEpoch += 1;\n\t\t\tworkflowCatalog = undefined;\n\t\t};\n\t\tconst close = () => {\n\t\t\tclosed = true;\n\t\t\tinvalidateWorkflowCatalog();\n\t\t\tclearInterval(refreshTimer);\n\t\t\tselector.dispose();\n\t\t\tdone();\n\t\t};\n\t\tconst workflows = () => {\n\t\t\tif (!workflowCatalog) {\n\t\t\t\tconst requestEpoch = ++workflowEpoch;\n\t\t\t\tworkflowCatalog = getResumeWorkflows(this).then(\n\t\t\t\t\t(rows) => {\n\t\t\t\t\t\tif (!closed && requestEpoch === workflowEpoch) {\n\t\t\t\t\t\t\tlastWorkflowRows = rows;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn lastWorkflowRows;\n\t\t\t\t\t},\n\t\t\t\t\t(error) => {\n\t\t\t\t\t\tif (!closed && requestEpoch === workflowEpoch) {\n\t\t\t\t\t\t\tworkflowCatalog = undefined;\n\t\t\t\t\t\t\tselector.getSessionList().onError?.(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn lastWorkflowRows;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn workflowCatalog;\n\t\t};\n\t\tconst load = async (all: boolean, onProgress?: SessionListProgress): Promise<SessionInfo[]> => {\n\t\t\tlet partial: readonly SessionInfo[] = [];\n\t\t\tconst report = (loaded: number, total: number, sessions?: readonly SessionInfo[]) => {\n\t\t\t\tif (sessions) partial = sessions;\n\t\t\t\tonProgress?.(loaded + lastWorkflowRows.length, total + lastWorkflowRows.length, [\n\t\t\t\t\t...partial,\n\t\t\t\t\t...lastWorkflowRows,\n\t\t\t\t]);\n\t\t\t};\n\t\t\tconst runs = workflows().then(() => {\n\t\t\t\treport(partial.length, partial.length);\n\t\t\t});\n\t\t\tconst progress = this.runtimeHost ? report : onProgress;\n\t\t\tconst sessions = all\n\t\t\t\t? SessionManager.listAll(this.sessionManager.getSessionStore(), progress)\n\t\t\t\t: SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionStore(), progress);\n\t\t\tconst [sessionRows] = await Promise.all([sessions, runs]);\n\t\t\treturn [...sessionRows, ...lastWorkflowRows];\n\t\t};\n\t\tconst selector = new SessionSelectorComponent(\n\t\t\t(onProgress) => load(false, onProgress),\n\t\t\t(onProgress) => load(true, onProgress),\n\t\t\tasync (selected) => {\n\t\t\t\tclose();\n\t\t\t\tawait resumeCatalogSelection(this, selected);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tclose();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tclose();\n\t\t\t\tvoid this.shutdown();\n\t\t\t},\n\t\t\t() => this.ui.requestRender(),\n\t\t\t{\n\t\t\t\tvariant: \"mixed\",\n\t\t\t\ttitle: \"Resume\",\n\t\t\t\tdeleteWorkflow: async (runId) => {\n\t\t\t\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime)\n\t\t\t\t\t\tawait this.runtimeHost.deleteWorkflowFromPicker(runId);\n\t\t\t\t\telse await deleteWorkflowFromPicker(this.session, runId);\n\t\t\t\t\tif (closed) return;\n\t\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\t\tlastWorkflowRows = lastWorkflowRows.filter((row) => row.id !== runId);\n\t\t\t\t\tvoid workflows().then((rows) => {\n\t\t\t\t\t\tif (!closed) selector.updateWorkflowSessions(rows);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tdeleteSession:\n\t\t\t\t\tthis.sessionManager.getSessionStore().descriptor.adapter === \"jsonl\"\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: (id) => this.sessionManager.deleteSession(id),\n\t\t\t\trenameSession: async (selected, nextName) => {\n\t\t\t\t\tconst next = (nextName ?? \"\").trim();\n\t\t\t\t\tif (!next) return;\n\t\t\t\t\tconst store = this.sessionManager.getSessionStore();\n\t\t\t\t\tconst directory = store.descriptor.adapter === \"jsonl\" ? dirname(selected.path) : undefined;\n\t\t\t\t\tif (\n\t\t\t\t\t\tselected.id === this.sessionManager.getSessionId() &&\n\t\t\t\t\t\t(directory === undefined ||\n\t\t\t\t\t\t\t(await canonicalizePathAsync(directory)) ===\n\t\t\t\t\t\t\t\t(await canonicalizePathAsync(this.sessionManager.getSessionDir())))\n\t\t\t\t\t) {\n\t\t\t\t\t\tawait this.session.setSessionName(next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst mgr = await this.sessionManager.openSessionById(selected.id, undefined, directory, {\n\t\t\t\t\t\t\thistory: \"tail\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait mgr.appendSessionInfo(next);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (mgr.getSessionStore() !== store) await mgr.getSessionStore().close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tshowRenameHint: true,\n\t\t\t\tkeybindings: this.keybindings,\n\t\t\t},\n\n\t\t\t{ id: this.sessionManager.getSessionId(), directory: this.sessionManager.getSessionDir() },\n\t\t);\n\t\tif (this.runtimeHost) {\n\t\t\tlet refreshing = false;\n\t\t\trefreshTimer = setInterval(() => {\n\t\t\t\tif (closed || refreshing) return;\n\t\t\t\trefreshing = true;\n\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\tvoid workflows()\n\t\t\t\t\t.then((rows) => {\n\t\t\t\t\t\tif (!closed) selector.updateWorkflowSessions(rows);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!closed)\n\t\t\t\t\t\t\tselector.getSessionList().onError?.(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\trefreshing = false;\n\t\t\t\t\t});\n\t\t\t}, 5_000);\n\t\t\trefreshTimer.unref?.();\n\t\t}\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tclosed = true;\n\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\tclearInterval(refreshTimer);\n\t\t\t\tselector.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nasync function getResumeWorkflows(mode: InteractiveModeBase, target?: string): Promise<SessionInfo[]> {\n\tif (!mode.runtimeHost) return [];\n\tawait mode.ensureDeferredStartupComplete();\n\tconst rows =\n\t\tmode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t? await mode.runtimeHost.getWorkflowResumeEntries(target)\n\t\t\t: await listWorkflowResumeEntries(mode.session, target);\n\treturn rows.map(workflowResumeSession);\n}\n\nasync function resumeCatalogSelection(mode: InteractiveModeBase, selected: SessionInfo): Promise<void> {\n\tif (selected.resumeKind === \"workflow\") {\n\t\ttry {\n\t\t\tconst handled =\n\t\t\t\tmode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t\t? await mode.runtimeHost.resumeWorkflowFromPicker(selected.id)\n\t\t\t\t\t: await resumeWorkflowFromPicker(mode.session, selected.id);\n\t\t\tif (!handled) mode.showError(\"Workflow resume is unavailable. Reload Atomic and try again.\");\n\t\t} catch (error) {\n\t\t\tmode.showError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t\treturn;\n\t}\n\tconst directory =\n\t\tmode.sessionManager.getSessionStore().descriptor.adapter === \"jsonl\" ? dirname(selected.path) : undefined;\n\tawait mode.handleResumeSession(selected.id, undefined, directory);\n}\n\nInteractiveModeBase.prototype.handleResumeTarget = async function (\n\tthis: InteractiveModeBase,\n\ttarget: string,\n): Promise<void> {\n\tif (/\\s/.test(target) || target.startsWith(\"-\")) {\n\t\tthis.showError(\"Usage: /resume [session-or-run-id].\");\n\t\treturn;\n\t}\n\ttry {\n\t\tconst [sessions, runs] = await Promise.allSettled([\n\t\t\tSessionManager.listAll(this.sessionManager.getSessionStore()),\n\t\t\tgetResumeWorkflows(this, target),\n\t\t]);\n\t\tif (sessions.status === \"rejected\") throw sessions.reason;\n\t\tconst resolution = resolveResumeTarget(target, [\n\t\t\t...sessions.value,\n\t\t\t...(runs.status === \"fulfilled\" ? runs.value : []),\n\t\t]);\n\t\tif (\n\t\t\truns.status === \"rejected\" &&\n\t\t\tresolution.kind !== \"ambiguous\" &&\n\t\t\tresolution.kind !== \"invalid\" &&\n\t\t\t!(resolution.kind === \"session\" && resolution.session.id === target)\n\t\t)\n\t\t\tthrow runs.reason;\n\t\tif (resolution.kind === \"session\" || resolution.kind === \"workflow\") {\n\t\t\tawait resumeCatalogSelection(this, resolution.session);\n\t\t} else if (resolution.kind === \"ambiguous\") {\n\t\t\tthis.showError(\n\t\t\t\t`Resume id \"${target}\" is ambiguous: ${resolution.matches.map((entry) => `${entry.resumeKind === \"workflow\" ? \"workflow\" : \"session\"} ${entry.id}`).join(\", \")}. Use /resume to choose an entry, or provide a unique full id.`,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.showError(\n\t\t\t\t`No session or resumable workflow matches \"${target}\". Use /resume to choose an entry, or provide a full id or unique 8-character hexadecimal prefix.`,\n\t\t\t);\n\t\t}\n\t} catch (error) {\n\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t}\n};\n\nInteractiveModeBase.prototype.handleResumeSession = async function (\n\tthis: InteractiveModeBase,\n\tsessionId: string,\n\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\tsessionDirectory?: string,\n): Promise<{ cancelled: boolean }> {\n\tawait this.ensureDeferredStartupComplete();\n\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\tmountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n\tconst resumeStartedAt = new Date().toISOString();\n\ttry {\n\t\tconst result = await this.runtimeHost.switchSession(sessionId, {\n\t\t\twithSession: options?.withSession,\n\t\t\tsessionDirectory,\n\t\t\tprojectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),\n\t\t\thistory: \"tail\",\n\t\t});\n\t\tif (result.cancelled) {\n\t\t\treturn result;\n\t\t}\n\t\tthis.renderCurrentSessionState();\n\t\tif (this.firstRunNoticeVisible) {\n\t\t\tthis.clearFirstRunOnboardingUi();\n\t\t}\n\t\tthis.showStatus(\"Resumed session\");\n\t\tshowSessionNotices(this, [\n\t\t\t...worktreeRestoreNotices(this.sessionManager, resumeStartedAt),\n\t\t\t...this.runtimeHost.takeResumeNotices(),\n\t\t]);\n\t\tthis.startSessionRecovery(\"resume\");\n\t\treturn result;\n\t} catch (error: unknown) {\n\t\tif (isResumeFailure(error)) {\n\t\t\tthis.showError(error.message);\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tif (error instanceof MissingSessionCwdError) {\n\t\t\tswitch (await this.promptForMissingSessionCwd(error)) {\n\t\t\t\tcase \"continue\": {\n\t\t\t\t\tconst result = await this.runtimeHost.switchSession(sessionId, {\n\t\t\t\t\t\tcwdOverride: error.issue.fallbackCwd,\n\t\t\t\t\t\tsessionDirectory,\n\t\t\t\t\t\twithSession: options?.withSession,\n\t\t\t\t\t\tprojectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),\n\t\t\t\t\t\thistory: \"tail\",\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.cancelled) finishMissingCwdResume(this, `Resumed session in ${error.issue.fallbackCwd}`);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tcase \"fork\":\n\t\t\t\t\treturn this.switchToForkedSession({ sessionId, sessionDirectory }, error.issue.fallbackCwd, options);\n\t\t\t\tcase undefined:\n\t\t\t\t\tthis.showStatus(\"Resume cancelled\");\n\t\t\t\t\treturn { cancelled: true };\n\t\t\t}\n\t\t}\n\t\treturn this.handleFatalRuntimeError(\"Failed to resume session\", error);\n\t}\n};\n\nfunction finishMissingCwdResume(mode: InteractiveModeBase, status: string): void {\n\tmode.renderCurrentSessionState();\n\tif (mode.firstRunNoticeVisible) {\n\t\tmode.clearFirstRunOnboardingUi();\n\t}\n\tmode.showStatus(status);\n\tmode.startSessionRecovery(\"resume\");\n}\n\nasync function forkIntoActiveStore(\n\tmode: InteractiveModeBase,\n\tsource: MissingCwdForkSource,\n\tcwd: string,\n): Promise<SessionManager> {\n\tconst store = mode.sessionManager.getSessionStore();\n\tif (\"exportPath\" in source) return SessionManager.forkFrom(source.exportPath, cwd, store);\n\tconst stored = await mode.sessionManager.openSessionById(source.sessionId, undefined, source.sessionDirectory);\n\ttry {\n\t\treturn await stored.forkTo(cwd, store);\n\t} finally {\n\t\tif (stored.getSessionStore() !== store) await stored.getSessionStore().close();\n\t}\n}\n\n/**\n * Fork a session whose stored cwd is gone into `cwd`, in the store the current session lives in, and switch to the\n * fork. An extension that cancels the switch leaves no copy behind.\n */\nInteractiveModeBase.prototype.switchToForkedSession = async function (\n\tthis: InteractiveModeBase,\n\tsource: MissingCwdForkSource,\n\tcwd: string,\n\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n): Promise<{ cancelled: boolean }> {\n\tconst forkId = (await forkIntoActiveStore(this, source, cwd)).getSessionId();\n\tconst result = await this.runtimeHost.switchSession(forkId, {\n\t\twithSession: options?.withSession,\n\t\tprojectTrustContextFactory: (forkCwd) => this.createProjectTrustContext(forkCwd),\n\t\thistory: \"tail\",\n\t});\n\tif (result.cancelled) {\n\t\tawait this.sessionManager.deleteSession(forkId);\n\t\treturn result;\n\t}\n\tfinishMissingCwdResume(this, `Forked into new session ${forkId} in ${cwd}`);\n\treturn result;\n};\n"]}
1
+ {"version":3,"file":"interactive-session-routing.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,wBAA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A2B,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { dirname } from \"node:path\";\nimport type { Focusable } from \"@bastani/atomic-tui\";\nimport { isResumeFailure } from \"../../core/resume/failure.ts\";\nimport type { SessionInfo, SessionListProgress } from \"../../core/session-manager.ts\";\nimport { worktreeRestoreNotices } from \"../../core/session-worktree-snapshots.ts\";\nimport {\n\tdeleteWorkflowFromPicker,\n\tlistWorkflowResumeEntries,\n\tresumeWorkflowFromPicker,\n} from \"../../core/workflow-resume.ts\";\nimport { canonicalizePathAsync } from \"../../utils/paths.ts\";\nimport { withHostProjectTrustPrompt } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { mountIdleStatus } from \"./components/idle-status.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\tAPP_NAME,\n\ttype Component,\n\ttype ExtensionCommandContext,\n\tgetProjectTrustPathAsync,\n\thasTrustRequiringProjectResourcesAsync,\n\tkeyTextHint,\n\tLoader,\n\tMissingSessionCwdError,\n\tProjectTrustStore,\n\tSessionManager,\n\tSessionSelectorComponent,\n\tSpacer,\n\tTreeSelectorComponent,\n\tTrustSelectorComponent,\n\ttheme,\n} from \"./interactive-mode-deps.ts\";\nimport type { MissingCwdForkSource } from \"./interactive-mode-surface.ts\";\nimport { showQueueRestoreFailure } from \"./interactive-queueing.ts\";\nimport { clearChatForRerender } from \"./interactive-render-chat.ts\";\nimport { onPreliminaryCatalogWithdrawn } from \"./interactive-startup-trust.ts\";\nimport { resolveResumeTarget, workflowResumeSession } from \"./resume-catalog.ts\";\nimport { showSessionNotices } from \"./session-notices.ts\";\n\nInteractiveModeBase.prototype.handleCloneCommand = async function (this: InteractiveModeBase): Promise<void> {\n\tawait this.ensureDeferredStartupComplete();\n\tconst leafId = this.sessionManager.getLeafId();\n\tif (!leafId) {\n\t\tthis.showStatus(\"Nothing to clone yet\");\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst result = await this.runtimeHost.fork(leafId, { position: \"at\" });\n\t\tif (result.cancelled) {\n\t\t\tthis.ui.requestRender();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderCurrentSessionState();\n\t\tthis.editor.setText(\"\");\n\t\tthis.showStatus(\"Cloned to new session\");\n\t} catch (error: unknown) {\n\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t}\n};\n\nInteractiveModeBase.prototype.maybeSaveImplicitProjectTrustAfterReload = async function (\n\tthis: InteractiveModeBase,\n): Promise<boolean> {\n\tconst cwd = this.sessionManager.getCwd();\n\tif (this.autoTrustOnReloadCwd !== cwd) {\n\t\treturn false;\n\t}\n\tif (!this.settingsManager.isProjectTrusted() || !(await hasTrustRequiringProjectResourcesAsync(cwd))) {\n\t\treturn false;\n\t}\n\n\tconst trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);\n\ttry {\n\t\tif ((await trustStore.getAsync(cwd)) !== null) {\n\t\t\tthis.autoTrustOnReloadCwd = undefined;\n\t\t\treturn false;\n\t\t}\n\t\tawait trustStore.setAsync(cwd, true);\n\t\tthis.autoTrustOnReloadCwd = undefined;\n\t\treturn true;\n\t} catch (error) {\n\t\tthis.showWarning(\n\t\t\t`Could not save project trust after reload: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t\treturn false;\n\t}\n};\n\nInteractiveModeBase.prototype.showTrustSelector = async function (this: InteractiveModeBase): Promise<void> {\n\tconst cwd = this.sessionManager.getCwd();\n\tconst trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);\n\tconst trustData = Promise.all([trustStore.getEntryAsync(cwd), getProjectTrustPathAsync(cwd)]);\n\tawait withHostProjectTrustPrompt(\n\t\tthis.runtimeHost,\n\t\t\"select\",\n\t\t\"Project trust\",\n\t\t() =>\n\t\t\tnew Promise<void>((resolve, reject) => {\n\t\t\t\tthis.showSelector((done) => {\n\t\t\t\t\tconst heldInput: string[] = [];\n\t\t\t\t\tlet selector: TrustSelectorComponent | undefined;\n\t\t\t\t\tlet focused = false;\n\t\t\t\t\tlet closed = false;\n\t\t\t\t\tconst view: Component & Focusable = {\n\t\t\t\t\t\tcapturesViewportInput: true,\n\t\t\t\t\t\tget focused() {\n\t\t\t\t\t\t\treturn focused;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tset focused(value: boolean) {\n\t\t\t\t\t\t\tfocused = value;\n\t\t\t\t\t\t\tif (selector) selector.focused = value;\n\t\t\t\t\t\t},\n\t\t\t\t\t\trender: (width) => selector?.render(width) ?? [],\n\t\t\t\t\t\tinvalidate: () => selector?.invalidate(),\n\t\t\t\t\t\thandleInput: (data) => {\n\t\t\t\t\t\t\tif (selector) selector.handleInput(data);\n\t\t\t\t\t\t\telse heldInput.push(data);\n\t\t\t\t\t\t},\n\t\t\t\t\t\thandleMouse: (event) => selector?.handleMouse(event),\n\t\t\t\t\t};\n\t\t\t\t\ttrustData.then(\n\t\t\t\t\t\t([savedDecision, trustPath]) => {\n\t\t\t\t\t\t\tif (closed) return;\n\t\t\t\t\t\t\tconst shown = new TrustSelectorComponent({\n\t\t\t\t\t\t\t\tcwd,\n\t\t\t\t\t\t\t\ttrustPath,\n\t\t\t\t\t\t\t\tsavedDecision,\n\t\t\t\t\t\t\t\tprojectTrusted: this.settingsManager.isProjectTrusted(),\n\t\t\t\t\t\t\t\tonSelect: (selection) => {\n\t\t\t\t\t\t\t\t\ttrustStore.setManyAsync(selection.updates).then(\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t\t\t\t\tthis.showStatus(\n\t\t\t\t\t\t\t\t\t\t\t\t`Saved trust decision: ${selection.trusted ? \"trusted\" : \"untrusted\"}. Restart ${APP_NAME} for this to take effect.`,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t(error: unknown) => {\n\t\t\t\t\t\t\t\t\t\t\tshown.selector.retrySelection();\n\t\t\t\t\t\t\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonCancel: () => {\n\t\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tshown.focused = focused;\n\t\t\t\t\t\t\tselector = shown;\n\t\t\t\t\t\t\tfor (const data of heldInput.splice(0)) {\n\t\t\t\t\t\t\t\tif (closed) break;\n\t\t\t\t\t\t\t\tshown.handleInput(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(error: unknown) => {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcomponent: view,\n\t\t\t\t\t\tfocus: view,\n\t\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}),\n\t).catch((error: Error) => this.showError(error.message));\n};\n\nInteractiveModeBase.prototype.showTreeSelector = async function (\n\tthis: InteractiveModeBase,\n\tinitialSelectedId?: string,\n): Promise<void> {\n\tawait this.ensureDeferredStartupComplete();\n\tawait this.sessionManager.loadFullHistory?.();\n\tconst tree = this.sessionManager.getTree();\n\tconst realLeafId = this.sessionManager.getLeafId();\n\tconst initialFilterMode = this.settingsManager.getTreeFilterMode();\n\n\tif (tree.length === 0) {\n\t\tthis.showStatus(\"No entries in session\");\n\t\treturn;\n\t}\n\n\tthis.showSelector((done) => {\n\t\tconst selector = new TreeSelectorComponent(\n\t\t\ttree,\n\t\t\trealLeafId,\n\t\t\tthis.ui.terminal.rows,\n\t\t\tasync (entryId) => {\n\t\t\t\t// Compare against the live leaf: a response that was streaming while the\n\t\t\t\t// selector was open may have advanced it past the captured value.\n\t\t\t\tif (entryId === this.sessionManager.getLeafId()) {\n\t\t\t\t\tdone();\n\t\t\t\t\tthis.showStatus(\"Already at this point\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ask about summarization\n\t\t\t\tdone(); // Close selector first\n\n\t\t\t\t// Loop until user makes a complete choice or cancels to tree\n\t\t\t\tlet wantsSummary = false;\n\t\t\t\tlet customInstructions: string | undefined;\n\n\t\t\t\t// Check if we should skip the prompt (user preference to always default to no summary)\n\t\t\t\tif (!this.settingsManager.getBranchSummarySkipPrompt()) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst summaryChoice = await this.showExtensionSelector(\"Summarize branch?\", [\n\t\t\t\t\t\t\t\"No summary\",\n\t\t\t\t\t\t\t\"Summarize\",\n\t\t\t\t\t\t\t\"Summarize with custom prompt\",\n\t\t\t\t\t\t]);\n\n\t\t\t\t\t\tif (summaryChoice === undefined) {\n\t\t\t\t\t\t\t// User pressed escape - re-show tree selector with same selection\n\t\t\t\t\t\t\tthis.showTreeSelector(entryId);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twantsSummary = summaryChoice !== \"No summary\";\n\n\t\t\t\t\t\tif (summaryChoice === \"Summarize with custom prompt\") {\n\t\t\t\t\t\t\tcustomInstructions = await this.showExtensionEditor(\"Custom summarization instructions\");\n\t\t\t\t\t\t\tif (customInstructions === undefined) {\n\t\t\t\t\t\t\t\t// User cancelled - loop back to summary selector\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// User made a complete choice\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.session.isStreaming) {\n\t\t\t\t\t// The clear goes out before the abort. The editor fills when the session answers, so a clear that\n\t\t\t\t\t// stalls or fails cannot hold up the abort.\n\t\t\t\t\tvoid this.restoreQueuedMessagesToEditor().catch((error: unknown) =>\n\t\t\t\t\t\tshowQueueRestoreFailure(this, error),\n\t\t\t\t\t);\n\t\t\t\t\tawait this.session.abort();\n\t\t\t\t}\n\t\t\t\tif (this.session.isCompacting) {\n\t\t\t\t\tthis.showError(\n\t\t\t\t\t\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\",\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set up escape handler and loader if summarizing\n\t\t\t\tlet summaryLoader: Loader | undefined;\n\t\t\t\tconst originalOnEscape = this.defaultEditor.onEscape;\n\n\t\t\t\tif (wantsSummary) {\n\t\t\t\t\tthis.defaultEditor.onEscape = () => {\n\t\t\t\t\t\tthis.session.abortBranchSummary();\n\t\t\t\t\t};\n\t\t\t\t\tthis.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\tsummaryLoader = new Loader(\n\t\t\t\t\t\tthis.ui,\n\t\t\t\t\t\t(spinner) => theme.fg(\"accent\", spinner),\n\t\t\t\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\t\t\t\t`Summarizing branch... (${keyTextHint(\"app.interrupt\", \"Cancel\")})`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.statusContainer.addChild(summaryLoader);\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tawait this.ensureDeferredStartupComplete();\n\t\t\t\t\tconst result = await this.session.navigateTree(entryId, {\n\t\t\t\t\t\tsummarize: wantsSummary,\n\t\t\t\t\t\tcustomInstructions,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (result.aborted) {\n\t\t\t\t\t\t// Summarization aborted - re-show tree selector with same selection\n\t\t\t\t\t\tthis.showStatus(\"Branch summarization cancelled\");\n\t\t\t\t\t\tthis.showTreeSelector(entryId);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result.cancelled) {\n\t\t\t\t\t\tthis.showStatus(\"Navigation cancelled\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update UI\n\t\t\t\t\tclearChatForRerender(this);\n\t\t\t\t\tthis.renderInitialMessages();\n\t\t\t\t\tif (result.editorText && !this.editor.getText().trim()) {\n\t\t\t\t\t\tthis.editor.setText(result.editorText);\n\t\t\t\t\t}\n\t\t\t\t\tthis.showStatus(\"Navigated to selected point\");\n\t\t\t\t\tvoid this.flushCompactionQueue({ willRetry: false });\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t\t\t\t} finally {\n\t\t\t\t\tif (summaryLoader) {\n\t\t\t\t\t\tsummaryLoader.stop();\n\t\t\t\t\t\tthis.statusContainer.clear();\n\t\t\t\t\t\tmountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n\t\t\t\t\t}\n\t\t\t\t\tthis.defaultEditor.onEscape = originalOnEscape;\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdone();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tasync (entryId, label) => {\n\t\t\t\tawait this.sessionManager.appendLabelChange(entryId, label);\n\t\t\t},\n\t\t\tinitialSelectedId,\n\t\t\tinitialFilterMode,\n\t\t);\n\t\tselector.onLabelError = (error) => this.showError(error.message);\n\t\tselector.onLabelUpdate = () => this.ui.requestRender();\n\t\tconst dispose = onPreliminaryCatalogWithdrawn(this, () => {\n\t\t\tselector.getTreeList().updateInitialFilter(this.settingsManager.getTreeFilterMode());\n\t\t\tthis.ui.requestRender();\n\t\t});\n\t\treturn { component: selector, focus: selector, dispose };\n\t});\n};\n\nInteractiveModeBase.prototype.showSessionSelector = function (this: InteractiveModeBase): void {\n\tthis.showSelector((done) => {\n\t\tlet closed = false;\n\t\tlet refreshTimer: ReturnType<typeof setInterval> | undefined;\n\t\tlet workflowCatalog: Promise<SessionInfo[]> | undefined;\n\t\tlet lastWorkflowRows: SessionInfo[] = [];\n\t\tlet workflowEpoch = 0;\n\t\tconst invalidateWorkflowCatalog = () => {\n\t\t\tworkflowEpoch += 1;\n\t\t\tworkflowCatalog = undefined;\n\t\t};\n\t\tconst close = () => {\n\t\t\tclosed = true;\n\t\t\tinvalidateWorkflowCatalog();\n\t\t\tclearInterval(refreshTimer);\n\t\t\tselector.dispose();\n\t\t\tdone();\n\t\t};\n\t\tconst workflows = () => {\n\t\t\tif (!workflowCatalog) {\n\t\t\t\tconst requestEpoch = ++workflowEpoch;\n\t\t\t\tworkflowCatalog = getResumeWorkflows(this).then(\n\t\t\t\t\t(rows) => {\n\t\t\t\t\t\tif (!closed && requestEpoch === workflowEpoch) {\n\t\t\t\t\t\t\tlastWorkflowRows = rows;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn lastWorkflowRows;\n\t\t\t\t\t},\n\t\t\t\t\t(error) => {\n\t\t\t\t\t\tif (!closed && requestEpoch === workflowEpoch) {\n\t\t\t\t\t\t\tworkflowCatalog = undefined;\n\t\t\t\t\t\t\tselector.getSessionList().onError?.(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn lastWorkflowRows;\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn workflowCatalog;\n\t\t};\n\t\tconst load = async (all: boolean, onProgress?: SessionListProgress): Promise<SessionInfo[]> => {\n\t\t\tlet partial: readonly SessionInfo[] = [];\n\t\t\tconst report = (loaded: number, total: number, sessions?: readonly SessionInfo[]) => {\n\t\t\t\tif (sessions) partial = sessions;\n\t\t\t\tonProgress?.(loaded + lastWorkflowRows.length, total + lastWorkflowRows.length, [\n\t\t\t\t\t...partial,\n\t\t\t\t\t...lastWorkflowRows,\n\t\t\t\t]);\n\t\t\t};\n\t\t\tconst runs = workflows().then(() => {\n\t\t\t\treport(partial.length, partial.length);\n\t\t\t});\n\t\t\tconst progress = this.runtimeHost ? report : onProgress;\n\t\t\tconst sessions = all\n\t\t\t\t? SessionManager.listAll(this.sessionManager.getSessionStore(), progress)\n\t\t\t\t: SessionManager.list(this.sessionManager.getCwd(), this.sessionManager.getSessionStore(), progress);\n\t\t\tconst [sessionRows] = await Promise.all([sessions, runs]);\n\t\t\treturn [...sessionRows, ...lastWorkflowRows];\n\t\t};\n\t\tconst selector = new SessionSelectorComponent(\n\t\t\t(onProgress) => load(false, onProgress),\n\t\t\t(onProgress) => load(true, onProgress),\n\t\t\tasync (selected) => {\n\t\t\t\tclose();\n\t\t\t\tawait resumeCatalogSelection(this, selected);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tclose();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tclose();\n\t\t\t\tvoid this.shutdown();\n\t\t\t},\n\t\t\t() => this.ui.requestRender(),\n\t\t\t{\n\t\t\t\tvariant: \"mixed\",\n\t\t\t\ttitle: \"Resume\",\n\t\t\t\tdeleteWorkflow: async (runId) => {\n\t\t\t\t\tif (this.runtimeHost instanceof IsolatedInteractiveRuntime)\n\t\t\t\t\t\tawait this.runtimeHost.deleteWorkflowFromPicker(runId);\n\t\t\t\t\telse await deleteWorkflowFromPicker(this.session, runId);\n\t\t\t\t\tif (closed) return;\n\t\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\t\tlastWorkflowRows = lastWorkflowRows.filter((row) => row.id !== runId);\n\t\t\t\t\tvoid workflows().then((rows) => {\n\t\t\t\t\t\tif (!closed) selector.updateWorkflowSessions(rows);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tdeleteSession:\n\t\t\t\t\tthis.sessionManager.getSessionStore().descriptor.adapter === \"jsonl\"\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: (id) => this.sessionManager.deleteSession(id),\n\t\t\t\trenameSession: async (selected, nextName) => {\n\t\t\t\t\tconst next = (nextName ?? \"\").trim();\n\t\t\t\t\tif (!next) return;\n\t\t\t\t\tconst store = this.sessionManager.getSessionStore();\n\t\t\t\t\tconst directory = store.descriptor.adapter === \"jsonl\" ? dirname(selected.path) : undefined;\n\t\t\t\t\tif (\n\t\t\t\t\t\tselected.id === this.sessionManager.getSessionId() &&\n\t\t\t\t\t\t(directory === undefined ||\n\t\t\t\t\t\t\t(await canonicalizePathAsync(directory)) ===\n\t\t\t\t\t\t\t\t(await canonicalizePathAsync(this.sessionManager.getSessionDir())))\n\t\t\t\t\t) {\n\t\t\t\t\t\tawait this.session.setSessionName(next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst mgr = await this.sessionManager.openSessionById(selected.id, undefined, directory, {\n\t\t\t\t\t\t\thistory: \"tail\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait mgr.appendSessionInfo(next);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (mgr.getSessionStore() !== store) await mgr.getSessionStore().close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tshowRenameHint: true,\n\t\t\t\tkeybindings: this.keybindings,\n\t\t\t},\n\n\t\t\t{ id: this.sessionManager.getSessionId(), directory: this.sessionManager.getSessionDir() },\n\t\t);\n\t\tif (this.runtimeHost) {\n\t\t\tlet refreshing = false;\n\t\t\trefreshTimer = setInterval(() => {\n\t\t\t\tif (closed || refreshing) return;\n\t\t\t\trefreshing = true;\n\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\tvoid workflows()\n\t\t\t\t\t.then((rows) => {\n\t\t\t\t\t\tif (!closed) selector.updateWorkflowSessions(rows);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!closed)\n\t\t\t\t\t\t\tselector.getSessionList().onError?.(error instanceof Error ? error.message : String(error));\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\trefreshing = false;\n\t\t\t\t\t});\n\t\t\t}, 5_000);\n\t\t\trefreshTimer.unref?.();\n\t\t}\n\t\treturn {\n\t\t\tcomponent: selector,\n\t\t\tfocus: selector,\n\t\t\tdispose: () => {\n\t\t\t\tclosed = true;\n\t\t\t\tinvalidateWorkflowCatalog();\n\t\t\t\tclearInterval(refreshTimer);\n\t\t\t\tselector.dispose();\n\t\t\t},\n\t\t};\n\t});\n};\n\nasync function getResumeWorkflows(mode: InteractiveModeBase, target?: string): Promise<SessionInfo[]> {\n\tif (!mode.runtimeHost) return [];\n\tawait mode.ensureDeferredStartupComplete();\n\tconst rows =\n\t\tmode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t? await mode.runtimeHost.getWorkflowResumeEntries(target)\n\t\t\t: await listWorkflowResumeEntries(mode.session, target);\n\treturn rows.map(workflowResumeSession);\n}\n\nasync function resumeCatalogSelection(mode: InteractiveModeBase, selected: SessionInfo): Promise<void> {\n\tif (selected.resumeKind === \"workflow\") {\n\t\ttry {\n\t\t\tconst handled =\n\t\t\t\tmode.runtimeHost instanceof IsolatedInteractiveRuntime\n\t\t\t\t\t? await mode.runtimeHost.resumeWorkflowFromPicker(selected.id, selected.resumeSelection)\n\t\t\t\t\t: await resumeWorkflowFromPicker(mode.session, selected.id, selected.resumeSelection);\n\t\t\tif (!handled) mode.showError(\"Workflow resume is unavailable. Reload Atomic and try again.\");\n\t\t} catch (error) {\n\t\t\tmode.showError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t\treturn;\n\t}\n\tconst directory =\n\t\tmode.sessionManager.getSessionStore().descriptor.adapter === \"jsonl\" ? dirname(selected.path) : undefined;\n\tawait mode.handleResumeSession(selected.id, undefined, directory);\n}\n\nInteractiveModeBase.prototype.handleResumeTarget = async function (\n\tthis: InteractiveModeBase,\n\ttarget: string,\n): Promise<void> {\n\tif (/\\s/.test(target) || target.startsWith(\"-\")) {\n\t\tthis.showError(\"Usage: /resume [session-or-run-id].\");\n\t\treturn;\n\t}\n\ttry {\n\t\tconst [sessions, runs] = await Promise.allSettled([\n\t\t\tSessionManager.listAll(this.sessionManager.getSessionStore()),\n\t\t\tgetResumeWorkflows(this, target),\n\t\t]);\n\t\tif (sessions.status === \"rejected\") throw sessions.reason;\n\t\tconst resolution = resolveResumeTarget(target, [\n\t\t\t...sessions.value,\n\t\t\t...(runs.status === \"fulfilled\" ? runs.value : []),\n\t\t]);\n\t\tif (\n\t\t\truns.status === \"rejected\" &&\n\t\t\tresolution.kind !== \"ambiguous\" &&\n\t\t\tresolution.kind !== \"invalid\" &&\n\t\t\t!(resolution.kind === \"session\" && resolution.session.id === target)\n\t\t)\n\t\t\tthrow runs.reason;\n\t\tif (resolution.kind === \"session\" || resolution.kind === \"workflow\") {\n\t\t\tawait resumeCatalogSelection(this, resolution.session);\n\t\t} else if (resolution.kind === \"ambiguous\") {\n\t\t\tthis.showError(\n\t\t\t\t`Resume id \"${target}\" is ambiguous: ${resolution.matches.map((entry) => `${entry.resumeKind === \"workflow\" ? \"workflow\" : \"session\"} ${entry.id}`).join(\", \")}. Use /resume to choose an entry, or provide a unique full id.`,\n\t\t\t);\n\t\t} else {\n\t\t\tthis.showError(\n\t\t\t\t`No session or resumable workflow matches \"${target}\". Use /resume to choose an entry, or provide a full id or unique 8-character hexadecimal prefix.`,\n\t\t\t);\n\t\t}\n\t} catch (error) {\n\t\tthis.showError(error instanceof Error ? error.message : String(error));\n\t}\n};\n\nInteractiveModeBase.prototype.handleResumeSession = async function (\n\tthis: InteractiveModeBase,\n\tsessionId: string,\n\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\tsessionDirectory?: string,\n): Promise<{ cancelled: boolean }> {\n\tawait this.ensureDeferredStartupComplete();\n\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\tmountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n\tconst resumeStartedAt = new Date().toISOString();\n\ttry {\n\t\tconst result = await this.runtimeHost.switchSession(sessionId, {\n\t\t\twithSession: options?.withSession,\n\t\t\tsessionDirectory,\n\t\t\tprojectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),\n\t\t\thistory: \"tail\",\n\t\t});\n\t\tif (result.cancelled) {\n\t\t\treturn result;\n\t\t}\n\t\tthis.renderCurrentSessionState();\n\t\tif (this.firstRunNoticeVisible) {\n\t\t\tthis.clearFirstRunOnboardingUi();\n\t\t}\n\t\tthis.showStatus(\"Resumed session\");\n\t\tshowSessionNotices(this, [\n\t\t\t...worktreeRestoreNotices(this.sessionManager, resumeStartedAt),\n\t\t\t...this.runtimeHost.takeResumeNotices(),\n\t\t]);\n\t\tthis.startSessionRecovery(\"resume\");\n\t\treturn result;\n\t} catch (error: unknown) {\n\t\tif (isResumeFailure(error)) {\n\t\t\tthis.showError(error.message);\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tif (error instanceof MissingSessionCwdError) {\n\t\t\tswitch (await this.promptForMissingSessionCwd(error)) {\n\t\t\t\tcase \"continue\": {\n\t\t\t\t\tconst result = await this.runtimeHost.switchSession(sessionId, {\n\t\t\t\t\t\tcwdOverride: error.issue.fallbackCwd,\n\t\t\t\t\t\tsessionDirectory,\n\t\t\t\t\t\twithSession: options?.withSession,\n\t\t\t\t\t\tprojectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),\n\t\t\t\t\t\thistory: \"tail\",\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.cancelled) finishMissingCwdResume(this, `Resumed session in ${error.issue.fallbackCwd}`);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tcase \"fork\":\n\t\t\t\t\treturn this.switchToForkedSession({ sessionId, sessionDirectory }, error.issue.fallbackCwd, options);\n\t\t\t\tcase undefined:\n\t\t\t\t\tthis.showStatus(\"Resume cancelled\");\n\t\t\t\t\treturn { cancelled: true };\n\t\t\t}\n\t\t}\n\t\treturn this.handleFatalRuntimeError(\"Failed to resume session\", error);\n\t}\n};\n\nfunction finishMissingCwdResume(mode: InteractiveModeBase, status: string): void {\n\tmode.renderCurrentSessionState();\n\tif (mode.firstRunNoticeVisible) {\n\t\tmode.clearFirstRunOnboardingUi();\n\t}\n\tmode.showStatus(status);\n\tmode.startSessionRecovery(\"resume\");\n}\n\nasync function forkIntoActiveStore(\n\tmode: InteractiveModeBase,\n\tsource: MissingCwdForkSource,\n\tcwd: string,\n): Promise<SessionManager> {\n\tconst store = mode.sessionManager.getSessionStore();\n\tif (\"exportPath\" in source) return SessionManager.forkFrom(source.exportPath, cwd, store);\n\tconst stored = await mode.sessionManager.openSessionById(source.sessionId, undefined, source.sessionDirectory);\n\ttry {\n\t\treturn await stored.forkTo(cwd, store);\n\t} finally {\n\t\tif (stored.getSessionStore() !== store) await stored.getSessionStore().close();\n\t}\n}\n\n/**\n * Fork a session whose stored cwd is gone into `cwd`, in the store the current session lives in, and switch to the\n * fork. An extension that cancels the switch leaves no copy behind.\n */\nInteractiveModeBase.prototype.switchToForkedSession = async function (\n\tthis: InteractiveModeBase,\n\tsource: MissingCwdForkSource,\n\tcwd: string,\n\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n): Promise<{ cancelled: boolean }> {\n\tconst forkId = (await forkIntoActiveStore(this, source, cwd)).getSessionId();\n\tconst result = await this.runtimeHost.switchSession(forkId, {\n\t\twithSession: options?.withSession,\n\t\tprojectTrustContextFactory: (forkCwd) => this.createProjectTrustContext(forkCwd),\n\t\thistory: \"tail\",\n\t});\n\tif (result.cancelled) {\n\t\tawait this.sessionManager.deleteSession(forkId);\n\t\treturn result;\n\t}\n\tfinishMissingCwdResume(this, `Forked into new session ${forkId} in ${cwd}`);\n\treturn result;\n};\n"]}
@@ -1,3 +1,6 @@
1
1
  import type { SessionRecoveryReport } from "../../core/agent-session-types.js";
2
+ import { InteractiveModeBase } from "./interactive-mode-base.ts";
3
+ /** Shows again, below the transcript a session switch or reload redrew, the extension errors reported while it ran. */
4
+ export declare function showRestartExtensionErrors(mode: InteractiveModeBase): void;
2
5
  export declare function formatSessionRecoveryStatus(report: SessionRecoveryReport): string | undefined;
3
6
  //# sourceMappingURL=interactive-session-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAyN/E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAW7F"}
1
+ {"version":3,"file":"interactive-session-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAO/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAiNjE,uHAAuH;AACvH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAI1E;AAMD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAW7F"}
@@ -85,6 +85,8 @@ InteractiveModeBase.prototype.bindCurrentSessionExtensions = async function () {
85
85
  onError: (error) => {
86
86
  this.showExtensionError(error.extensionPath, error.error, error.stack);
87
87
  },
88
+ // A user works in this session: a failing startup handler is shown like any other extension error.
89
+ reportStartupErrors: true,
88
90
  });
89
91
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
90
92
  this.setupAutocompleteProvider();
@@ -191,7 +193,16 @@ InteractiveModeBase.prototype.renderCurrentSessionState = function () {
191
193
  }
192
194
  }
193
195
  this.renderInitialMessages();
196
+ showRestartExtensionErrors(this);
194
197
  };
198
+ /** Shows again, below the transcript a session switch or reload redrew, the extension errors reported while it ran. */
199
+ export function showRestartExtensionErrors(mode) {
200
+ const rows = mode.restartExtensionErrors ?? [];
201
+ mode.restartExtensionErrors = undefined;
202
+ for (const row of rows)
203
+ if (!mode.chatContainer.children.includes(row))
204
+ mode.chatContainer.addChild(row);
205
+ }
195
206
  function recoveryCount(count, singular, plural) {
196
207
  return `${count} ${count === 1 ? singular : plural}`;
197
208
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,mBAAmB,CAAC,SAAS,CAAC,4BAA4B,GAAG,KAAK;IACjE,MAAM,SAAS,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,IAAI,CAAC,WAAW,EAAE,6BAA6B,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAChG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QACjC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,YAAY,0BAA0B,CAAC,IAAI,IAAI,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AE3D,QAAgB;IAEhB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpH,CAAC,CAAC","sourcesContent":["import { setCapabilityOverrides } from \"@bastani/atomic-tui\";\nimport type { SessionRecoveryReport } from \"../../core/agent-session-types.js\";\nimport type { SessionRecoveryReason, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport { ensurePngTranscoder } from \"../../utils/image-convert.ts\";\nimport type { ActivityWatchdogDiagnostic } from \"../interactive-engine/activity-watchdog.ts\";\nimport { renderEngineDiagnostic } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { AtomicWorkedStatusComponent } from \"./components/atomic-working-status.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { setRegisteredThemes, stopThemeWatcher, Text, theme } from \"./interactive-mode-deps.ts\";\nimport { clearChatForRerender } from \"./interactive-render-chat.ts\";\nimport { exitOnRefusedDecisionSetting } from \"./refused-decision-setting.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function (this: InteractiveModeBase): Promise<void> {\n\tconst uiContext = this.createExtensionUIContext();\n\tconst session = this.session;\n\tthis.runtimeHost?.setProjectTrustContextFactory?.((cwd) => this.createProjectTrustContext(cwd));\n\tawait this.session.bindExtensions({\n\t\tonUIPrompt: (event) => {\n\t\t\tif (!(this.runtimeHost instanceof IsolatedInteractiveRuntime) && this.session === session) {\n\t\t\t\tthis.programStatus.handleUIPrompt(event);\n\t\t\t}\n\t\t},\n\t\tuiContext,\n\t\tmode: \"tui\",\n\t\tisPresentationOnly: this.runtimeHost instanceof IsolatedInteractiveRuntime,\n\t\tcommandContextActions: {\n\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\tnewSession: async (options) => {\n\t\t\t\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.runtimeHost.newSession(options);\n\t\t\t\t\tif (!result.cancelled) {\n\t\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\treturn this.handleFatalRuntimeError(\"Failed to create session\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfork: async (entryId, options) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, options);\n\t\t\t\t\tif (!result.cancelled) {\n\t\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\t\tthis.editor.setText(result.selectedText ?? \"\");\n\t\t\t\t\t\tthis.showStatus(\"Forked to new session\");\n\t\t\t\t\t}\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\treturn this.handleFatalRuntimeError(\"Failed to fork session\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\tlabel: options?.label,\n\t\t\t\t});\n\t\t\t\tif (result.cancelled) {\n\t\t\t\t\treturn { cancelled: true };\n\t\t\t\t}\n\n\t\t\t\tclearChatForRerender(this);\n\t\t\t\tthis.renderInitialMessages();\n\t\t\t\tif (result.editorText && !this.editor.getText().trim()) {\n\t\t\t\t\tthis.editor.setText(result.editorText);\n\t\t\t\t}\n\t\t\t\tthis.showStatus(\"Navigated to selected point\");\n\t\t\t\tvoid this.flushCompactionQueue({ willRetry: false });\n\t\t\t\treturn { cancelled: false };\n\t\t\t},\n\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\treturn this.handleResumeSession(sessionPath, options);\n\t\t\t},\n\t\t\treload: async () => {\n\t\t\t\tawait this.handleReloadCommand();\n\t\t\t},\n\t\t},\n\t\tshutdownHandler: () => {\n\t\t\tthis.shutdownRequested = true;\n\t\t\tif (!this.session.isStreaming) {\n\t\t\t\tvoid this.shutdown();\n\t\t\t}\n\t\t},\n\t\tonError: (error) => {\n\t\t\tthis.showExtensionError(error.extensionPath, error.error, error.stack);\n\t\t},\n\t});\n\n\tsetRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n\tthis.setupAutocompleteProvider();\n\n\tconst extensionRunner = this.session.extensionRunner;\n\tthis.setupExtensionShortcuts(extensionRunner);\n\tif (!this.deferredStartupPending && !this.initialStartupBinding) {\n\t\tthis.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true });\n\t\tthis.showStartupNoticesIfNeeded();\n\t}\n};\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function (this: InteractiveModeBase): void {\n\tsetCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());\n\tensurePngTranscoder(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.ui.requestRender();\n\t});\n\tthis.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());\n\tthis.setFullscreenWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());\n\tthis.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());\n\tthis.footer.setSession(this.session);\n\tthis.usageMeter.setSession(this.session);\n\tthis.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n\tthis.footerDataProvider.setCwd(this.sessionManager.getCwd());\n\tthis.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n\tthis.outputPad = this.settingsManager.getOutputPad();\n\tthis.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n\tthis.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n\tconst editorPaddingX = this.settingsManager.getEditorPaddingX();\n\tconst autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();\n\tthis.defaultEditor.setPaddingX(editorPaddingX);\n\tthis.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n\tif (this.editor !== this.defaultEditor) {\n\t\tthis.editor.setPaddingX?.(editorPaddingX);\n\t\tthis.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n\t}\n};\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function (this: InteractiveModeBase): Promise<void> {\n\t// The session this rebind was started for. Binding extensions is async, and a\n\t// session replacement (startup switch, /new, resume) can install a different\n\t// session and start its own rebind while this one is still awaiting. Without\n\t// the guard below both rebinds call subscribeToAgent() and every agent event\n\t// is rendered twice.\n\tconst session = this.session;\n\n\tthis.unsubscribe?.();\n\tthis.unsubscribe = undefined;\n\tthis.programStatus.reset();\n\tthis.applyRuntimeSettings();\n\tawait this.bindCurrentSessionExtensions();\n\n\tif (this.session !== session) {\n\t\t// A newer rebind owns the current session; it subscribes and finishes the\n\t\t// remaining runtime updates itself.\n\t\treturn;\n\t}\n\n\tthis.subscribeToAgent();\n\tawait this.updateAvailableProviderCount();\n\tthis.updateEditorBorderColor();\n\tthis.updateTerminalTitle();\n};\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function (\n\tthis: InteractiveModeBase,\n\tprefix: string,\n\terror: unknown,\n): Promise<never> {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tthis.showError(`${prefix}: ${message}`);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) {\n\t\tthis.chatContainer.addChild(new Text(theme.fg(\"warning\", extensionHint), this.outputPad, 0));\n\t}\n\tstopThemeWatcher();\n\t// A fatal exit keeps the transcript visible: the error the user just saw\n\t// must remain on screen after the process dies, whatever the setting says.\n\tthis.stop(\"transcript\");\n\tprocess.exit(1);\n};\n\n/** Shows an interactive-engine diagnostic, and stops Atomic when the engine refused a decision-model setting. */\nInteractiveModeBase.prototype.handleEngineDiagnostic = function (\n\tthis: InteractiveModeBase,\n\tdiagnostic: ActivityWatchdogDiagnostic,\n): void {\n\texitOnRefusedDecisionSetting(this, diagnostic.error);\n\trenderEngineDiagnostic(diagnostic, {\n\t\tstopWorkingLoader: () => {\n\t\t\tthis.workingRunMeter.stop();\n\t\t\tthis.stopWorkingLoader();\n\t\t},\n\t\tshowStatus: (message, persist) => this.showStatus(message, persist),\n\t\tshowError: (message) => this.showError(message),\n\t});\n};\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function (this: InteractiveModeBase): void {\n\tthis.managedToolStatusGeneration++;\n\tthis.managedToolStatusStarted = false;\n\tthis.lastStatusSpacer = undefined;\n\tthis.lastStatusText = undefined;\n\tclearChatForRerender(this);\n\tthis.pendingMessagesContainer.clear();\n\tthis.pendingBashComponents = [];\n\tthis.compactionQueuedMessages = [];\n\tthis.compactionSendFailed = false;\n\tthis.streamingComponent = undefined;\n\tthis.streamingMessage = undefined;\n\tthis.pendingTools.clear();\n\tif (!this.session.isStreaming) {\n\t\tthis.workingRunMeter.stop();\n\t\tthis.workingMessage = undefined;\n\t\tthis.lastWorkingMessage = undefined;\n\t\tfor (const child of [...this.statusContainer.children]) {\n\t\t\tif (child instanceof AtomicWorkedStatusComponent) this.statusContainer.removeChild(child);\n\t\t}\n\t}\n\tthis.renderInitialMessages();\n};\n\nfunction recoveryCount(count: number, singular: string, plural: string): string {\n\treturn `${count} ${count === 1 ? singular : plural}`;\n}\n\nexport function formatSessionRecoveryStatus(report: SessionRecoveryReport): string | undefined {\n\tconst parts = [\n\t\treport.replayed > 0\n\t\t\t? `replayed ${recoveryCount(report.replayed, \"interrupted delivery\", \"interrupted deliveries\")}`\n\t\t\t: \"\",\n\t\treport.dropped > 0 ? `skipped ${recoveryCount(report.dropped, \"stale delivery\", \"stale deliveries\")}` : \"\",\n\t\treport.completions > 0\n\t\t\t? `showed ${recoveryCount(report.completions, \"background result\", \"background results\")}`\n\t\t\t: \"\",\n\t].filter(Boolean);\n\treturn parts.length > 0 ? `Recovered interrupted work: ${parts.join(\", \")}` : undefined;\n}\n\nInteractiveModeBase.prototype.startSessionRecovery = function (\n\tthis: InteractiveModeBase,\n\treason: SessionRecoveryReason,\n): void {\n\tconst session = this.session;\n\tvoid session.startPendingRecovery(reason).then(\n\t\t(report) => {\n\t\t\tif (this.session !== session || this.isShuttingDown) return;\n\t\t\tconst status = formatSessionRecoveryStatus(report);\n\t\t\tif (status) this.showStatus(status);\n\t\t},\n\t\t(error: unknown) => {\n\t\t\tif (this.session !== session || this.isShuttingDown) return;\n\t\t\tthis.showError(`Session recovery failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t},\n\t);\n};\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function (\n\tthis: InteractiveModeBase,\n\ttoolName: string,\n): ToolRenderers | undefined {\n\treturn this.session.extensionRunner.resolveToolRenderers(toolName, () => this.session.getToolDefinition(toolName));\n};\n"]}
1
+ {"version":3,"file":"interactive-session-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,mBAAmB,CAAC,SAAS,CAAC,4BAA4B,GAA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AC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACzF,CAAC;AAED,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,GAAG,UAEpD,MAA6B;IAE7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,KAAK,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC7C,CAAC,MAAM,EAAE,EAAE;QACV,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,cAAc;YAAE,OAAO;QAC5D,MAAM,MAAM,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,MAAM;YAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;QAClB,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,cAAc;YAAE,OAAO;QAC5D,IAAI,CAAC,SAAS,CAAC,4BAA4B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtG,CAAC,CACD,CAAC;AACH,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,2BAA2B,GAAG,UAE3D,QAAgB;IAEhB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpH,CAAC,CAAC","sourcesContent":["import { setCapabilityOverrides } from \"@bastani/atomic-tui\";\nimport type { SessionRecoveryReport } from \"../../core/agent-session-types.js\";\nimport type { SessionRecoveryReason, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport { ensurePngTranscoder } from \"../../utils/image-convert.ts\";\nimport type { ActivityWatchdogDiagnostic } from \"../interactive-engine/activity-watchdog.ts\";\nimport { renderEngineDiagnostic } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport { IsolatedInteractiveRuntime } from \"../interactive-engine/isolated-runtime.js\";\nimport { AtomicWorkedStatusComponent } from \"./components/atomic-working-status.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { setRegisteredThemes, stopThemeWatcher, Text, theme } from \"./interactive-mode-deps.ts\";\nimport { clearChatForRerender } from \"./interactive-render-chat.ts\";\nimport { exitOnRefusedDecisionSetting } from \"./refused-decision-setting.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function (this: InteractiveModeBase): Promise<void> {\n\tconst uiContext = this.createExtensionUIContext();\n\tconst session = this.session;\n\tthis.runtimeHost?.setProjectTrustContextFactory?.((cwd) => this.createProjectTrustContext(cwd));\n\tawait this.session.bindExtensions({\n\t\tonUIPrompt: (event) => {\n\t\t\tif (!(this.runtimeHost instanceof IsolatedInteractiveRuntime) && this.session === session) {\n\t\t\t\tthis.programStatus.handleUIPrompt(event);\n\t\t\t}\n\t\t},\n\t\tuiContext,\n\t\tmode: \"tui\",\n\t\tisPresentationOnly: this.runtimeHost instanceof IsolatedInteractiveRuntime,\n\t\tcommandContextActions: {\n\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\tnewSession: async (options) => {\n\t\t\t\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.runtimeHost.newSession(options);\n\t\t\t\t\tif (!result.cancelled) {\n\t\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\treturn this.handleFatalRuntimeError(\"Failed to create session\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfork: async (entryId, options) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, options);\n\t\t\t\t\tif (!result.cancelled) {\n\t\t\t\t\t\tthis.renderCurrentSessionState();\n\t\t\t\t\t\tthis.editor.setText(result.selectedText ?? \"\");\n\t\t\t\t\t\tthis.showStatus(\"Forked to new session\");\n\t\t\t\t\t}\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\treturn this.handleFatalRuntimeError(\"Failed to fork session\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\tlabel: options?.label,\n\t\t\t\t});\n\t\t\t\tif (result.cancelled) {\n\t\t\t\t\treturn { cancelled: true };\n\t\t\t\t}\n\n\t\t\t\tclearChatForRerender(this);\n\t\t\t\tthis.renderInitialMessages();\n\t\t\t\tif (result.editorText && !this.editor.getText().trim()) {\n\t\t\t\t\tthis.editor.setText(result.editorText);\n\t\t\t\t}\n\t\t\t\tthis.showStatus(\"Navigated to selected point\");\n\t\t\t\tvoid this.flushCompactionQueue({ willRetry: false });\n\t\t\t\treturn { cancelled: false };\n\t\t\t},\n\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\treturn this.handleResumeSession(sessionPath, options);\n\t\t\t},\n\t\t\treload: async () => {\n\t\t\t\tawait this.handleReloadCommand();\n\t\t\t},\n\t\t},\n\t\tshutdownHandler: () => {\n\t\t\tthis.shutdownRequested = true;\n\t\t\tif (!this.session.isStreaming) {\n\t\t\t\tvoid this.shutdown();\n\t\t\t}\n\t\t},\n\t\tonError: (error) => {\n\t\t\tthis.showExtensionError(error.extensionPath, error.error, error.stack);\n\t\t},\n\t\t// A user works in this session: a failing startup handler is shown like any other extension error.\n\t\treportStartupErrors: true,\n\t});\n\n\tsetRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n\tthis.setupAutocompleteProvider();\n\n\tconst extensionRunner = this.session.extensionRunner;\n\tthis.setupExtensionShortcuts(extensionRunner);\n\tif (!this.deferredStartupPending && !this.initialStartupBinding) {\n\t\tthis.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true });\n\t\tthis.showStartupNoticesIfNeeded();\n\t}\n};\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function (this: InteractiveModeBase): void {\n\tsetCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());\n\tensurePngTranscoder(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.ui.requestRender();\n\t});\n\tthis.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());\n\tthis.setFullscreenWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());\n\tthis.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());\n\tthis.footer.setSession(this.session);\n\tthis.usageMeter.setSession(this.session);\n\tthis.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n\tthis.footerDataProvider.setCwd(this.sessionManager.getCwd());\n\tthis.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n\tthis.outputPad = this.settingsManager.getOutputPad();\n\tthis.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n\tthis.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n\tconst editorPaddingX = this.settingsManager.getEditorPaddingX();\n\tconst autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();\n\tthis.defaultEditor.setPaddingX(editorPaddingX);\n\tthis.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n\tif (this.editor !== this.defaultEditor) {\n\t\tthis.editor.setPaddingX?.(editorPaddingX);\n\t\tthis.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n\t}\n};\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function (this: InteractiveModeBase): Promise<void> {\n\t// The session this rebind was started for. Binding extensions is async, and a\n\t// session replacement (startup switch, /new, resume) can install a different\n\t// session and start its own rebind while this one is still awaiting. Without\n\t// the guard below both rebinds call subscribeToAgent() and every agent event\n\t// is rendered twice.\n\tconst session = this.session;\n\n\tthis.unsubscribe?.();\n\tthis.unsubscribe = undefined;\n\tthis.programStatus.reset();\n\tthis.applyRuntimeSettings();\n\tawait this.bindCurrentSessionExtensions();\n\n\tif (this.session !== session) {\n\t\t// A newer rebind owns the current session; it subscribes and finishes the\n\t\t// remaining runtime updates itself.\n\t\treturn;\n\t}\n\n\tthis.subscribeToAgent();\n\tawait this.updateAvailableProviderCount();\n\tthis.updateEditorBorderColor();\n\tthis.updateTerminalTitle();\n};\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function (\n\tthis: InteractiveModeBase,\n\tprefix: string,\n\terror: unknown,\n): Promise<never> {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tthis.showError(`${prefix}: ${message}`);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) {\n\t\tthis.chatContainer.addChild(new Text(theme.fg(\"warning\", extensionHint), this.outputPad, 0));\n\t}\n\tstopThemeWatcher();\n\t// A fatal exit keeps the transcript visible: the error the user just saw\n\t// must remain on screen after the process dies, whatever the setting says.\n\tthis.stop(\"transcript\");\n\tprocess.exit(1);\n};\n\n/** Shows an interactive-engine diagnostic, and stops Atomic when the engine refused a decision-model setting. */\nInteractiveModeBase.prototype.handleEngineDiagnostic = function (\n\tthis: InteractiveModeBase,\n\tdiagnostic: ActivityWatchdogDiagnostic,\n): void {\n\texitOnRefusedDecisionSetting(this, diagnostic.error);\n\trenderEngineDiagnostic(diagnostic, {\n\t\tstopWorkingLoader: () => {\n\t\t\tthis.workingRunMeter.stop();\n\t\t\tthis.stopWorkingLoader();\n\t\t},\n\t\tshowStatus: (message, persist) => this.showStatus(message, persist),\n\t\tshowError: (message) => this.showError(message),\n\t});\n};\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function (this: InteractiveModeBase): void {\n\tthis.managedToolStatusGeneration++;\n\tthis.managedToolStatusStarted = false;\n\tthis.lastStatusSpacer = undefined;\n\tthis.lastStatusText = undefined;\n\tclearChatForRerender(this);\n\tthis.pendingMessagesContainer.clear();\n\tthis.pendingBashComponents = [];\n\tthis.compactionQueuedMessages = [];\n\tthis.compactionSendFailed = false;\n\tthis.streamingComponent = undefined;\n\tthis.streamingMessage = undefined;\n\tthis.pendingTools.clear();\n\tif (!this.session.isStreaming) {\n\t\tthis.workingRunMeter.stop();\n\t\tthis.workingMessage = undefined;\n\t\tthis.lastWorkingMessage = undefined;\n\t\tfor (const child of [...this.statusContainer.children]) {\n\t\t\tif (child instanceof AtomicWorkedStatusComponent) this.statusContainer.removeChild(child);\n\t\t}\n\t}\n\tthis.renderInitialMessages();\n\tshowRestartExtensionErrors(this);\n};\n\n/** Shows again, below the transcript a session switch or reload redrew, the extension errors reported while it ran. */\nexport function showRestartExtensionErrors(mode: InteractiveModeBase): void {\n\tconst rows = mode.restartExtensionErrors ?? [];\n\tmode.restartExtensionErrors = undefined;\n\tfor (const row of rows) if (!mode.chatContainer.children.includes(row)) mode.chatContainer.addChild(row);\n}\n\nfunction recoveryCount(count: number, singular: string, plural: string): string {\n\treturn `${count} ${count === 1 ? singular : plural}`;\n}\n\nexport function formatSessionRecoveryStatus(report: SessionRecoveryReport): string | undefined {\n\tconst parts = [\n\t\treport.replayed > 0\n\t\t\t? `replayed ${recoveryCount(report.replayed, \"interrupted delivery\", \"interrupted deliveries\")}`\n\t\t\t: \"\",\n\t\treport.dropped > 0 ? `skipped ${recoveryCount(report.dropped, \"stale delivery\", \"stale deliveries\")}` : \"\",\n\t\treport.completions > 0\n\t\t\t? `showed ${recoveryCount(report.completions, \"background result\", \"background results\")}`\n\t\t\t: \"\",\n\t].filter(Boolean);\n\treturn parts.length > 0 ? `Recovered interrupted work: ${parts.join(\", \")}` : undefined;\n}\n\nInteractiveModeBase.prototype.startSessionRecovery = function (\n\tthis: InteractiveModeBase,\n\treason: SessionRecoveryReason,\n): void {\n\tconst session = this.session;\n\tvoid session.startPendingRecovery(reason).then(\n\t\t(report) => {\n\t\t\tif (this.session !== session || this.isShuttingDown) return;\n\t\t\tconst status = formatSessionRecoveryStatus(report);\n\t\t\tif (status) this.showStatus(status);\n\t\t},\n\t\t(error: unknown) => {\n\t\t\tif (this.session !== session || this.isShuttingDown) return;\n\t\t\tthis.showError(`Session recovery failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t},\n\t);\n};\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function (\n\tthis: InteractiveModeBase,\n\ttoolName: string,\n): ToolRenderers | undefined {\n\treturn this.session.extensionRunner.resolveToolRenderers(toolName, () => this.session.getToolDefinition(toolName));\n};\n"]}
@@ -11,6 +11,7 @@ import { IsolatedInteractiveRuntime } from "../interactive-engine/isolated-runti
11
11
  import { InteractiveModeBase } from "./interactive-mode-base.js";
12
12
  import { BorderedLoader, Container, copyToClipboard, DynamicBorder, fs, getChangelogPath, getShareViewerUrl, hyperlink, MissingSessionCwdError, normalizeChangelogLinks, os, parseChangelogAsync, path, SessionImportFileNotFoundError, Spacer, setRegisteredThemes, spawn, Text, theme, } from "./interactive-mode-deps.js";
13
13
  import { isExpandable } from "./interactive-mode-helpers.js";
14
+ import { showRestartExtensionErrors } from "./interactive-session-runtime.js";
14
15
  import { showSessionNotices } from "./session-notices.js";
15
16
  InteractiveModeBase.prototype.handleReloadCommand = async function () {
16
17
  if (this.session.isStreaming) {
@@ -63,6 +64,7 @@ InteractiveModeBase.prototype.handleReloadCommand = async function () {
63
64
  force: false,
64
65
  showDiagnosticsWhenQuiet: true,
65
66
  });
67
+ showRestartExtensionErrors(this);
66
68
  if (savedImplicitProjectTrust) {
67
69
  this.showStatus("Saved project trust for future sessions");
68
70
  }
@@ -73,6 +75,7 @@ InteractiveModeBase.prototype.handleReloadCommand = async function () {
73
75
  this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
74
76
  }
75
77
  catch (error) {
78
+ showRestartExtensionErrors(this);
76
79
  dismissReloadBox(previousEditor);
77
80
  this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
78
81
  }