@caupulican/pi-adaptative 0.81.39 → 0.81.41

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 (884) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +2 -0
  3. package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts +2 -0
  4. package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts.map +1 -1
  5. package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js +3 -0
  6. package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js.map +1 -1
  7. package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.ts +4 -0
  8. package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts +9 -0
  9. package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
  10. package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +290 -107
  11. package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
  12. package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +357 -122
  13. package/dist/bundled-resources/skills/tool-call-repair/references/repair-catalogue.md +2 -2
  14. package/dist/cli/args.d.ts +4 -0
  15. package/dist/cli/args.d.ts.map +1 -1
  16. package/dist/cli/args.js +31 -1
  17. package/dist/cli/args.js.map +1 -1
  18. package/dist/core/agent-directory-layout.d.ts +15 -0
  19. package/dist/core/agent-directory-layout.d.ts.map +1 -0
  20. package/dist/core/agent-directory-layout.js +72 -0
  21. package/dist/core/agent-directory-layout.js.map +1 -0
  22. package/dist/core/agent-paths.d.ts +25 -2
  23. package/dist/core/agent-paths.d.ts.map +1 -1
  24. package/dist/core/agent-paths.js +79 -4
  25. package/dist/core/agent-paths.js.map +1 -1
  26. package/dist/core/agent-session-contracts.d.ts +293 -0
  27. package/dist/core/agent-session-contracts.d.ts.map +1 -0
  28. package/dist/core/agent-session-contracts.js +26 -0
  29. package/dist/core/agent-session-contracts.js.map +1 -0
  30. package/dist/core/agent-session-runtime.d.ts +52 -8
  31. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  32. package/dist/core/agent-session-runtime.js +400 -79
  33. package/dist/core/agent-session-runtime.js.map +1 -1
  34. package/dist/core/agent-session-services.d.ts +1 -0
  35. package/dist/core/agent-session-services.d.ts.map +1 -1
  36. package/dist/core/agent-session-services.js +1 -0
  37. package/dist/core/agent-session-services.js.map +1 -1
  38. package/dist/core/agent-session.d.ts +74 -518
  39. package/dist/core/agent-session.d.ts.map +1 -1
  40. package/dist/core/agent-session.js +370 -1432
  41. package/dist/core/agent-session.js.map +1 -1
  42. package/dist/core/auth-storage.d.ts.map +1 -1
  43. package/dist/core/auth-storage.js +3 -1
  44. package/dist/core/auth-storage.js.map +1 -1
  45. package/dist/core/autonomy/approval-gate.d.ts +3 -2
  46. package/dist/core/autonomy/approval-gate.d.ts.map +1 -1
  47. package/dist/core/autonomy/approval-gate.js +6 -28
  48. package/dist/core/autonomy/approval-gate.js.map +1 -1
  49. package/dist/core/autonomy/bounded-completion.d.ts +1 -1
  50. package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
  51. package/dist/core/autonomy/bounded-completion.js +1 -1
  52. package/dist/core/autonomy/bounded-completion.js.map +1 -1
  53. package/dist/core/autonomy/contracts.d.ts +20 -12
  54. package/dist/core/autonomy/contracts.d.ts.map +1 -1
  55. package/dist/core/autonomy/contracts.js.map +1 -1
  56. package/dist/core/autonomy/foreground-envelope.d.ts +8 -2
  57. package/dist/core/autonomy/foreground-envelope.d.ts.map +1 -1
  58. package/dist/core/autonomy/foreground-envelope.js +8 -25
  59. package/dist/core/autonomy/foreground-envelope.js.map +1 -1
  60. package/dist/core/autonomy/gates.d.ts.map +1 -1
  61. package/dist/core/autonomy/gates.js +8 -10
  62. package/dist/core/autonomy/gates.js.map +1 -1
  63. package/dist/core/autonomy/lane-private-paths.d.ts +2 -0
  64. package/dist/core/autonomy/lane-private-paths.d.ts.map +1 -0
  65. package/dist/core/autonomy/lane-private-paths.js +16 -0
  66. package/dist/core/autonomy/lane-private-paths.js.map +1 -0
  67. package/dist/core/autonomy/lane-tool-surface.d.ts +10 -0
  68. package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
  69. package/dist/core/autonomy/lane-tool-surface.js +48 -9
  70. package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
  71. package/dist/core/autonomy/lane-tracker.d.ts +14 -0
  72. package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
  73. package/dist/core/autonomy/lane-tracker.js +38 -0
  74. package/dist/core/autonomy/lane-tracker.js.map +1 -1
  75. package/dist/core/autonomy/risk-assessment.d.ts +1 -2
  76. package/dist/core/autonomy/risk-assessment.d.ts.map +1 -1
  77. package/dist/core/autonomy/risk-assessment.js +1 -123
  78. package/dist/core/autonomy/risk-assessment.js.map +1 -1
  79. package/dist/core/autonomy/session-lane-record.d.ts +4 -4
  80. package/dist/core/autonomy/session-lane-record.d.ts.map +1 -1
  81. package/dist/core/autonomy/session-lane-record.js +16 -29
  82. package/dist/core/autonomy/session-lane-record.js.map +1 -1
  83. package/dist/core/autonomy/telemetry-events.d.ts +1 -1
  84. package/dist/core/autonomy/telemetry-events.d.ts.map +1 -1
  85. package/dist/core/autonomy/telemetry-events.js +1 -1
  86. package/dist/core/autonomy/telemetry-events.js.map +1 -1
  87. package/dist/core/autonomy-telemetry.d.ts +7 -7
  88. package/dist/core/autonomy-telemetry.d.ts.map +1 -1
  89. package/dist/core/autonomy-telemetry.js +9 -9
  90. package/dist/core/autonomy-telemetry.js.map +1 -1
  91. package/dist/core/background-lane-controller.d.ts +56 -236
  92. package/dist/core/background-lane-controller.d.ts.map +1 -1
  93. package/dist/core/background-lane-controller.js +141 -1273
  94. package/dist/core/background-lane-controller.js.map +1 -1
  95. package/dist/core/bedrock-sso-login.d.ts +16 -0
  96. package/dist/core/bedrock-sso-login.d.ts.map +1 -0
  97. package/dist/core/bedrock-sso-login.js +98 -0
  98. package/dist/core/bedrock-sso-login.js.map +1 -0
  99. package/dist/core/capability-contract.d.ts +4 -0
  100. package/dist/core/capability-contract.d.ts.map +1 -0
  101. package/dist/core/capability-contract.js +28 -0
  102. package/dist/core/capability-contract.js.map +1 -0
  103. package/dist/core/compaction-controller.d.ts +90 -0
  104. package/dist/core/compaction-controller.d.ts.map +1 -0
  105. package/dist/core/compaction-controller.js +452 -0
  106. package/dist/core/compaction-controller.js.map +1 -0
  107. package/dist/core/compaction-support.d.ts +13 -17
  108. package/dist/core/compaction-support.d.ts.map +1 -1
  109. package/dist/core/compaction-support.js +3 -3
  110. package/dist/core/compaction-support.js.map +1 -1
  111. package/dist/core/context/context-artifacts.d.ts +6 -2
  112. package/dist/core/context/context-artifacts.d.ts.map +1 -1
  113. package/dist/core/context/context-artifacts.js +34 -2
  114. package/dist/core/context/context-artifacts.js.map +1 -1
  115. package/dist/core/context/context-store-retention.d.ts +8 -2
  116. package/dist/core/context/context-store-retention.d.ts.map +1 -1
  117. package/dist/core/context/context-store-retention.js +158 -35
  118. package/dist/core/context/context-store-retention.js.map +1 -1
  119. package/dist/core/context/okf-memory.d.ts.map +1 -1
  120. package/dist/core/context/okf-memory.js +9 -11
  121. package/dist/core/context/okf-memory.js.map +1 -1
  122. package/dist/core/context/sqlite-runtime-index.d.ts.map +1 -1
  123. package/dist/core/context/sqlite-runtime-index.js +6 -8
  124. package/dist/core/context/sqlite-runtime-index.js.map +1 -1
  125. package/dist/core/context-gc.d.ts +3 -0
  126. package/dist/core/context-gc.d.ts.map +1 -1
  127. package/dist/core/context-gc.js +10 -5
  128. package/dist/core/context-gc.js.map +1 -1
  129. package/dist/core/context-pipeline.d.ts +1 -1
  130. package/dist/core/context-pipeline.d.ts.map +1 -1
  131. package/dist/core/context-pipeline.js +16 -37
  132. package/dist/core/context-pipeline.js.map +1 -1
  133. package/dist/core/cost/cost-summary.d.ts.map +1 -1
  134. package/dist/core/cost/cost-summary.js +5 -3
  135. package/dist/core/cost/cost-summary.js.map +1 -1
  136. package/dist/core/cost/daily-usage.d.ts.map +1 -1
  137. package/dist/core/cost/daily-usage.js +4 -5
  138. package/dist/core/cost/daily-usage.js.map +1 -1
  139. package/dist/core/default-tool-surface.d.ts.map +1 -1
  140. package/dist/core/default-tool-surface.js +2 -0
  141. package/dist/core/default-tool-surface.js.map +1 -1
  142. package/dist/core/delegation/managed-lane-controller.d.ts +34 -0
  143. package/dist/core/delegation/managed-lane-controller.d.ts.map +1 -0
  144. package/dist/core/delegation/managed-lane-controller.js +217 -0
  145. package/dist/core/delegation/managed-lane-controller.js.map +1 -0
  146. package/dist/core/delegation/session-worker-claim.d.ts +44 -0
  147. package/dist/core/delegation/session-worker-claim.d.ts.map +1 -0
  148. package/dist/core/delegation/session-worker-claim.js +98 -0
  149. package/dist/core/delegation/session-worker-claim.js.map +1 -0
  150. package/dist/core/delegation/worker-actions.d.ts +7 -5
  151. package/dist/core/delegation/worker-actions.d.ts.map +1 -1
  152. package/dist/core/delegation/worker-actions.js +20 -4
  153. package/dist/core/delegation/worker-actions.js.map +1 -1
  154. package/dist/core/delegation/{worker-result.d.ts → worker-claim.d.ts} +13 -13
  155. package/dist/core/delegation/worker-claim.d.ts.map +1 -0
  156. package/dist/core/delegation/{worker-result.js → worker-claim.js} +61 -51
  157. package/dist/core/delegation/worker-claim.js.map +1 -0
  158. package/dist/core/delegation/worker-delegation-controller.d.ts +110 -0
  159. package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -0
  160. package/dist/core/delegation/worker-delegation-controller.js +861 -0
  161. package/dist/core/delegation/worker-delegation-controller.js.map +1 -0
  162. package/dist/core/delegation/worker-delegation-request.d.ts +11 -0
  163. package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -0
  164. package/dist/core/delegation/worker-delegation-request.js +2 -0
  165. package/dist/core/delegation/worker-delegation-request.js.map +1 -0
  166. package/dist/core/delegation/worker-dispatch-scheduler.d.ts +40 -0
  167. package/dist/core/delegation/worker-dispatch-scheduler.d.ts.map +1 -0
  168. package/dist/core/delegation/worker-dispatch-scheduler.js +93 -0
  169. package/dist/core/delegation/worker-dispatch-scheduler.js.map +1 -0
  170. package/dist/core/delegation/worker-execution-policy.d.ts +62 -0
  171. package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -0
  172. package/dist/core/delegation/worker-execution-policy.js +160 -0
  173. package/dist/core/delegation/worker-execution-policy.js.map +1 -0
  174. package/dist/core/delegation/worker-lane-projection.d.ts +14 -0
  175. package/dist/core/delegation/worker-lane-projection.d.ts.map +1 -0
  176. package/dist/core/delegation/worker-lane-projection.js +100 -0
  177. package/dist/core/delegation/worker-lane-projection.js.map +1 -0
  178. package/dist/core/delegation/worker-lifecycle.d.ts +97 -0
  179. package/dist/core/delegation/worker-lifecycle.d.ts.map +1 -0
  180. package/dist/core/delegation/worker-lifecycle.js +339 -0
  181. package/dist/core/delegation/worker-lifecycle.js.map +1 -0
  182. package/dist/core/delegation/worker-notification-coordinator.d.ts +36 -0
  183. package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -0
  184. package/dist/core/delegation/worker-notification-coordinator.js +90 -0
  185. package/dist/core/delegation/worker-notification-coordinator.js.map +1 -0
  186. package/dist/core/delegation/worker-profile-resolver.d.ts +55 -0
  187. package/dist/core/delegation/worker-profile-resolver.d.ts.map +1 -0
  188. package/dist/core/delegation/worker-profile-resolver.js +113 -0
  189. package/dist/core/delegation/worker-profile-resolver.js.map +1 -0
  190. package/dist/core/delegation/worker-runner.d.ts +25 -14
  191. package/dist/core/delegation/worker-runner.d.ts.map +1 -1
  192. package/dist/core/delegation/worker-runner.js +122 -53
  193. package/dist/core/delegation/worker-runner.js.map +1 -1
  194. package/dist/core/delegation/worker-task-label.d.ts +3 -0
  195. package/dist/core/delegation/worker-task-label.d.ts.map +1 -0
  196. package/dist/core/delegation/worker-task-label.js +11 -0
  197. package/dist/core/delegation/worker-task-label.js.map +1 -0
  198. package/dist/core/doctor.d.ts +8 -0
  199. package/dist/core/doctor.d.ts.map +1 -1
  200. package/dist/core/doctor.js +32 -1
  201. package/dist/core/doctor.js.map +1 -1
  202. package/dist/core/extension-import-authority.d.ts +6 -0
  203. package/dist/core/extension-import-authority.d.ts.map +1 -0
  204. package/dist/core/extension-import-authority.js +10 -0
  205. package/dist/core/extension-import-authority.js.map +1 -0
  206. package/dist/core/extensions/index.d.ts +1 -1
  207. package/dist/core/extensions/index.d.ts.map +1 -1
  208. package/dist/core/extensions/index.js.map +1 -1
  209. package/dist/core/extensions/loader.d.ts +5 -1
  210. package/dist/core/extensions/loader.d.ts.map +1 -1
  211. package/dist/core/extensions/loader.js +52 -18
  212. package/dist/core/extensions/loader.js.map +1 -1
  213. package/dist/core/extensions/runner.d.ts +3 -0
  214. package/dist/core/extensions/runner.d.ts.map +1 -1
  215. package/dist/core/extensions/runner.js +20 -5
  216. package/dist/core/extensions/runner.js.map +1 -1
  217. package/dist/core/extensions/stale-context.d.ts +2 -0
  218. package/dist/core/extensions/stale-context.d.ts.map +1 -0
  219. package/dist/core/extensions/stale-context.js +2 -0
  220. package/dist/core/extensions/stale-context.js.map +1 -0
  221. package/dist/core/extensions/storage.d.ts +8 -0
  222. package/dist/core/extensions/storage.d.ts.map +1 -0
  223. package/dist/core/extensions/storage.js +28 -0
  224. package/dist/core/extensions/storage.js.map +1 -0
  225. package/dist/core/extensions/types.d.ts +78 -21
  226. package/dist/core/extensions/types.d.ts.map +1 -1
  227. package/dist/core/extensions/types.js.map +1 -1
  228. package/dist/core/failure-corpus.d.ts +1 -15
  229. package/dist/core/failure-corpus.d.ts.map +1 -1
  230. package/dist/core/failure-corpus.js +9 -37
  231. package/dist/core/failure-corpus.js.map +1 -1
  232. package/dist/core/foreground-recovery-controller.d.ts +53 -0
  233. package/dist/core/foreground-recovery-controller.d.ts.map +1 -0
  234. package/dist/core/foreground-recovery-controller.js +111 -0
  235. package/dist/core/foreground-recovery-controller.js.map +1 -0
  236. package/dist/core/gateways/channel-provider.d.ts +3 -0
  237. package/dist/core/gateways/channel-provider.d.ts.map +1 -1
  238. package/dist/core/gateways/channel-provider.js +31 -6
  239. package/dist/core/gateways/channel-provider.js.map +1 -1
  240. package/dist/core/goal-loop-controller.d.ts +14 -9
  241. package/dist/core/goal-loop-controller.d.ts.map +1 -1
  242. package/dist/core/goal-loop-controller.js +47 -75
  243. package/dist/core/goal-loop-controller.js.map +1 -1
  244. package/dist/core/goals/compact-goal-context.d.ts +11 -0
  245. package/dist/core/goals/compact-goal-context.d.ts.map +1 -0
  246. package/dist/core/goals/compact-goal-context.js +59 -0
  247. package/dist/core/goals/compact-goal-context.js.map +1 -0
  248. package/dist/core/goals/goal-acceptance.d.ts +11 -0
  249. package/dist/core/goals/goal-acceptance.d.ts.map +1 -0
  250. package/dist/core/goals/goal-acceptance.js +27 -0
  251. package/dist/core/goals/goal-acceptance.js.map +1 -0
  252. package/dist/core/goals/goal-auto-continue-controller.d.ts +28 -0
  253. package/dist/core/goals/goal-auto-continue-controller.d.ts.map +1 -0
  254. package/dist/core/goals/goal-auto-continue-controller.js +90 -0
  255. package/dist/core/goals/goal-auto-continue-controller.js.map +1 -0
  256. package/dist/core/goals/goal-continuation-controller.d.ts +2 -2
  257. package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
  258. package/dist/core/goals/goal-continuation-controller.js +52 -11
  259. package/dist/core/goals/goal-continuation-controller.js.map +1 -1
  260. package/dist/core/goals/goal-continuation-defaults.d.ts +4 -29
  261. package/dist/core/goals/goal-continuation-defaults.d.ts.map +1 -1
  262. package/dist/core/goals/goal-continuation-defaults.js +4 -32
  263. package/dist/core/goals/goal-continuation-defaults.js.map +1 -1
  264. package/dist/core/goals/goal-continuation-prompt.d.ts +8 -18
  265. package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
  266. package/dist/core/goals/goal-continuation-prompt.js +9 -179
  267. package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
  268. package/dist/core/goals/goal-lifecycle.d.ts +43 -0
  269. package/dist/core/goals/goal-lifecycle.d.ts.map +1 -0
  270. package/dist/core/goals/goal-lifecycle.js +102 -0
  271. package/dist/core/goals/goal-lifecycle.js.map +1 -0
  272. package/dist/core/goals/goal-record.d.ts +17 -0
  273. package/dist/core/goals/goal-record.d.ts.map +1 -0
  274. package/dist/core/goals/goal-record.js +31 -0
  275. package/dist/core/goals/goal-record.js.map +1 -0
  276. package/dist/core/goals/goal-runtime-snapshot.d.ts +11 -9
  277. package/dist/core/goals/goal-runtime-snapshot.d.ts.map +1 -1
  278. package/dist/core/goals/goal-runtime-snapshot.js +10 -8
  279. package/dist/core/goals/goal-runtime-snapshot.js.map +1 -1
  280. package/dist/core/goals/goal-session-controller.d.ts +42 -0
  281. package/dist/core/goals/goal-session-controller.d.ts.map +1 -0
  282. package/dist/core/goals/goal-session-controller.js +128 -0
  283. package/dist/core/goals/goal-session-controller.js.map +1 -0
  284. package/dist/core/goals/goal-state.d.ts +46 -25
  285. package/dist/core/goals/goal-state.d.ts.map +1 -1
  286. package/dist/core/goals/goal-state.js +91 -24
  287. package/dist/core/goals/goal-state.js.map +1 -1
  288. package/dist/core/goals/goal-tool-core.d.ts +9 -10
  289. package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
  290. package/dist/core/goals/goal-tool-core.js +60 -75
  291. package/dist/core/goals/goal-tool-core.js.map +1 -1
  292. package/dist/core/goals/session-goal-state.d.ts +20 -12
  293. package/dist/core/goals/session-goal-state.d.ts.map +1 -1
  294. package/dist/core/goals/session-goal-state.js +133 -33
  295. package/dist/core/goals/session-goal-state.js.map +1 -1
  296. package/dist/core/human-input-controller.d.ts +47 -0
  297. package/dist/core/human-input-controller.d.ts.map +1 -0
  298. package/dist/core/human-input-controller.js +181 -0
  299. package/dist/core/human-input-controller.js.map +1 -0
  300. package/dist/core/human-input.d.ts +100 -0
  301. package/dist/core/human-input.d.ts.map +1 -0
  302. package/dist/core/human-input.js +362 -0
  303. package/dist/core/human-input.js.map +1 -0
  304. package/dist/core/index.d.ts +9 -1
  305. package/dist/core/index.d.ts.map +1 -1
  306. package/dist/core/index.js +9 -1
  307. package/dist/core/index.js.map +1 -1
  308. package/dist/core/{telemetry.d.ts → install-telemetry.d.ts} +1 -1
  309. package/dist/core/install-telemetry.d.ts.map +1 -0
  310. package/dist/core/{telemetry.js → install-telemetry.js} +1 -1
  311. package/dist/core/install-telemetry.js.map +1 -0
  312. package/dist/core/keybindings.d.ts +17 -1
  313. package/dist/core/keybindings.d.ts.map +1 -1
  314. package/dist/core/keybindings.js +24 -6
  315. package/dist/core/keybindings.js.map +1 -1
  316. package/dist/core/learning/learning-audit.d.ts +2 -4
  317. package/dist/core/learning/learning-audit.d.ts.map +1 -1
  318. package/dist/core/learning/learning-audit.js +9 -29
  319. package/dist/core/learning/learning-audit.js.map +1 -1
  320. package/dist/core/learning/learning-gate.d.ts.map +1 -1
  321. package/dist/core/learning/learning-gate.js +1 -6
  322. package/dist/core/learning/learning-gate.js.map +1 -1
  323. package/dist/core/learning/session-learning-decision.d.ts +2 -4
  324. package/dist/core/learning/session-learning-decision.d.ts.map +1 -1
  325. package/dist/core/learning/session-learning-decision.js +9 -29
  326. package/dist/core/learning/session-learning-decision.js.map +1 -1
  327. package/dist/core/local-runtime-controller.d.ts +1 -1
  328. package/dist/core/local-runtime-controller.d.ts.map +1 -1
  329. package/dist/core/local-runtime-controller.js.map +1 -1
  330. package/dist/core/memory-controller.d.ts.map +1 -1
  331. package/dist/core/memory-controller.js +4 -4
  332. package/dist/core/memory-controller.js.map +1 -1
  333. package/dist/core/model-capability.d.ts +0 -19
  334. package/dist/core/model-capability.d.ts.map +1 -1
  335. package/dist/core/model-capability.js +1 -19
  336. package/dist/core/model-capability.js.map +1 -1
  337. package/dist/core/model-registry.d.ts +6 -1
  338. package/dist/core/model-registry.d.ts.map +1 -1
  339. package/dist/core/model-registry.js +13 -5
  340. package/dist/core/model-registry.js.map +1 -1
  341. package/dist/core/model-resolver.d.ts +17 -2
  342. package/dist/core/model-resolver.d.ts.map +1 -1
  343. package/dist/core/model-resolver.js +38 -25
  344. package/dist/core/model-resolver.js.map +1 -1
  345. package/dist/core/model-router/intent-classifier.d.ts +1 -4
  346. package/dist/core/model-router/intent-classifier.d.ts.map +1 -1
  347. package/dist/core/model-router/intent-classifier.js +1 -156
  348. package/dist/core/model-router/intent-classifier.js.map +1 -1
  349. package/dist/core/model-router-controller.d.ts +1 -1
  350. package/dist/core/model-router-controller.d.ts.map +1 -1
  351. package/dist/core/model-router-controller.js +2 -2
  352. package/dist/core/model-router-controller.js.map +1 -1
  353. package/dist/core/model-selection-controller.d.ts +5 -5
  354. package/dist/core/model-selection-controller.d.ts.map +1 -1
  355. package/dist/core/model-selection-controller.js.map +1 -1
  356. package/dist/core/model-tool-protocol.d.ts +23 -0
  357. package/dist/core/model-tool-protocol.d.ts.map +1 -0
  358. package/dist/core/model-tool-protocol.js +43 -0
  359. package/dist/core/model-tool-protocol.js.map +1 -0
  360. package/dist/core/models/adaptation-store.d.ts +4 -6
  361. package/dist/core/models/adaptation-store.d.ts.map +1 -1
  362. package/dist/core/models/adaptation-store.js +95 -83
  363. package/dist/core/models/adaptation-store.js.map +1 -1
  364. package/dist/core/models/fitness-store.d.ts +2 -12
  365. package/dist/core/models/fitness-store.d.ts.map +1 -1
  366. package/dist/core/models/fitness-store.js +84 -57
  367. package/dist/core/models/fitness-store.js.map +1 -1
  368. package/dist/core/models/host-state-store.d.ts +34 -0
  369. package/dist/core/models/host-state-store.d.ts.map +1 -0
  370. package/dist/core/models/host-state-store.js +86 -0
  371. package/dist/core/models/host-state-store.js.map +1 -0
  372. package/dist/core/orchestration/agent-resume.d.ts +24 -0
  373. package/dist/core/orchestration/agent-resume.d.ts.map +1 -0
  374. package/dist/core/orchestration/agent-resume.js +90 -0
  375. package/dist/core/orchestration/agent-resume.js.map +1 -0
  376. package/dist/core/orchestration/capability-gateway.d.ts +61 -0
  377. package/dist/core/orchestration/capability-gateway.d.ts.map +1 -0
  378. package/dist/core/orchestration/capability-gateway.js +152 -0
  379. package/dist/core/orchestration/capability-gateway.js.map +1 -0
  380. package/dist/core/orchestration/contracts.d.ts +343 -0
  381. package/dist/core/orchestration/contracts.d.ts.map +1 -0
  382. package/dist/core/orchestration/contracts.js +135 -0
  383. package/dist/core/orchestration/contracts.js.map +1 -0
  384. package/dist/core/orchestration/delegation-ledger.d.ts +56 -0
  385. package/dist/core/orchestration/delegation-ledger.d.ts.map +1 -0
  386. package/dist/core/orchestration/delegation-ledger.js +200 -0
  387. package/dist/core/orchestration/delegation-ledger.js.map +1 -0
  388. package/dist/core/orchestration/event-store.d.ts +83 -0
  389. package/dist/core/orchestration/event-store.d.ts.map +1 -0
  390. package/dist/core/orchestration/event-store.js +560 -0
  391. package/dist/core/orchestration/event-store.js.map +1 -0
  392. package/dist/core/orchestration/lane-tool-manifests.d.ts +9 -0
  393. package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -0
  394. package/dist/core/orchestration/lane-tool-manifests.js +37 -0
  395. package/dist/core/orchestration/lane-tool-manifests.js.map +1 -0
  396. package/dist/core/orchestration/model-binding.d.ts +15 -0
  397. package/dist/core/orchestration/model-binding.d.ts.map +1 -0
  398. package/dist/core/orchestration/model-binding.js +29 -0
  399. package/dist/core/orchestration/model-binding.js.map +1 -0
  400. package/dist/core/orchestration/policy-compiler.d.ts +49 -0
  401. package/dist/core/orchestration/policy-compiler.d.ts.map +1 -0
  402. package/dist/core/orchestration/policy-compiler.js +191 -0
  403. package/dist/core/orchestration/policy-compiler.js.map +1 -0
  404. package/dist/core/orchestration/policy-gate.d.ts +18 -0
  405. package/dist/core/orchestration/policy-gate.d.ts.map +1 -0
  406. package/dist/core/orchestration/policy-gate.js +24 -0
  407. package/dist/core/orchestration/policy-gate.js.map +1 -0
  408. package/dist/core/orchestration/profile-registry.d.ts +51 -0
  409. package/dist/core/orchestration/profile-registry.d.ts.map +1 -0
  410. package/dist/core/orchestration/profile-registry.js +393 -0
  411. package/dist/core/orchestration/profile-registry.js.map +1 -0
  412. package/dist/core/orchestration/profile-store.d.ts +31 -0
  413. package/dist/core/orchestration/profile-store.d.ts.map +1 -0
  414. package/dist/core/orchestration/profile-store.js +136 -0
  415. package/dist/core/orchestration/profile-store.js.map +1 -0
  416. package/dist/core/orchestration/risk-budget.d.ts +9 -0
  417. package/dist/core/orchestration/risk-budget.d.ts.map +1 -0
  418. package/dist/core/orchestration/risk-budget.js +48 -0
  419. package/dist/core/orchestration/risk-budget.js.map +1 -0
  420. package/dist/core/orchestration/task-runtime.d.ts +168 -0
  421. package/dist/core/orchestration/task-runtime.d.ts.map +1 -0
  422. package/dist/core/orchestration/task-runtime.js +1600 -0
  423. package/dist/core/orchestration/task-runtime.js.map +1 -0
  424. package/dist/core/orchestration/work-state-projection.d.ts +32 -0
  425. package/dist/core/orchestration/work-state-projection.d.ts.map +1 -0
  426. package/dist/core/orchestration/work-state-projection.js +116 -0
  427. package/dist/core/orchestration/work-state-projection.js.map +1 -0
  428. package/dist/core/orchestration/worker-execution-contract.d.ts +21 -0
  429. package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -0
  430. package/dist/core/orchestration/worker-execution-contract.js +179 -0
  431. package/dist/core/orchestration/worker-execution-contract.js.map +1 -0
  432. package/dist/core/orchestration/worker-result-adapter.d.ts +21 -0
  433. package/dist/core/orchestration/worker-result-adapter.d.ts.map +1 -0
  434. package/dist/core/orchestration/worker-result-adapter.js +109 -0
  435. package/dist/core/orchestration/worker-result-adapter.js.map +1 -0
  436. package/dist/core/package-manager.d.ts.map +1 -1
  437. package/dist/core/package-manager.js +20 -3
  438. package/dist/core/package-manager.js.map +1 -1
  439. package/dist/core/process-identity.d.ts +11 -0
  440. package/dist/core/process-identity.d.ts.map +1 -0
  441. package/dist/core/process-identity.js +26 -0
  442. package/dist/core/process-identity.js.map +1 -0
  443. package/dist/core/process-matrix/codes.d.ts +14 -3
  444. package/dist/core/process-matrix/codes.d.ts.map +1 -1
  445. package/dist/core/process-matrix/codes.js.map +1 -1
  446. package/dist/core/process-matrix/resume-launcher.d.ts +26 -0
  447. package/dist/core/process-matrix/resume-launcher.d.ts.map +1 -0
  448. package/dist/core/process-matrix/resume-launcher.js +62 -0
  449. package/dist/core/process-matrix/resume-launcher.js.map +1 -0
  450. package/dist/core/process-matrix/runtime.d.ts +37 -22
  451. package/dist/core/process-matrix/runtime.d.ts.map +1 -1
  452. package/dist/core/process-matrix/runtime.js +399 -76
  453. package/dist/core/process-matrix/runtime.js.map +1 -1
  454. package/dist/core/process-matrix/store.d.ts +5 -2
  455. package/dist/core/process-matrix/store.d.ts.map +1 -1
  456. package/dist/core/process-matrix/store.js +123 -14
  457. package/dist/core/process-matrix/store.js.map +1 -1
  458. package/dist/core/process-matrix/supervisor.d.ts +10 -7
  459. package/dist/core/process-matrix/supervisor.d.ts.map +1 -1
  460. package/dist/core/process-matrix/supervisor.js +45 -14
  461. package/dist/core/process-matrix/supervisor.js.map +1 -1
  462. package/dist/core/profile-filter-controller.d.ts +8 -1
  463. package/dist/core/profile-filter-controller.d.ts.map +1 -1
  464. package/dist/core/profile-filter-controller.js +23 -5
  465. package/dist/core/profile-filter-controller.js.map +1 -1
  466. package/dist/core/profile-registry.d.ts.map +1 -1
  467. package/dist/core/profile-registry.js +6 -8
  468. package/dist/core/profile-registry.js.map +1 -1
  469. package/dist/core/prompt-templates.d.ts +1 -0
  470. package/dist/core/prompt-templates.d.ts.map +1 -1
  471. package/dist/core/prompt-templates.js +18 -29
  472. package/dist/core/prompt-templates.js.map +1 -1
  473. package/dist/core/reflection-controller.d.ts +5 -5
  474. package/dist/core/reflection-controller.d.ts.map +1 -1
  475. package/dist/core/reflection-controller.js +5 -2
  476. package/dist/core/reflection-controller.js.map +1 -1
  477. package/dist/core/reload-blockers.d.ts.map +1 -1
  478. package/dist/core/reload-blockers.js +6 -8
  479. package/dist/core/reload-blockers.js.map +1 -1
  480. package/dist/core/request-auth.d.ts +7 -0
  481. package/dist/core/request-auth.d.ts.map +1 -0
  482. package/dist/core/request-auth.js +8 -0
  483. package/dist/core/request-auth.js.map +1 -0
  484. package/dist/core/research/evidence-bundle.d.ts.map +1 -1
  485. package/dist/core/research/evidence-bundle.js +1 -6
  486. package/dist/core/research/evidence-bundle.js.map +1 -1
  487. package/dist/core/research/lane-model-resolver.d.ts +33 -0
  488. package/dist/core/research/lane-model-resolver.d.ts.map +1 -0
  489. package/dist/core/research/lane-model-resolver.js +65 -0
  490. package/dist/core/research/lane-model-resolver.js.map +1 -0
  491. package/dist/core/research/model-fitness-controller.d.ts +38 -0
  492. package/dist/core/research/model-fitness-controller.d.ts.map +1 -0
  493. package/dist/core/research/model-fitness-controller.js +106 -0
  494. package/dist/core/research/model-fitness-controller.js.map +1 -0
  495. package/dist/core/research/model-fitness.d.ts +1 -1
  496. package/dist/core/research/model-fitness.d.ts.map +1 -1
  497. package/dist/core/research/model-fitness.js +4 -4
  498. package/dist/core/research/model-fitness.js.map +1 -1
  499. package/dist/core/research/research-gate.d.ts.map +1 -1
  500. package/dist/core/research/research-gate.js +7 -7
  501. package/dist/core/research/research-gate.js.map +1 -1
  502. package/dist/core/research/research-lane-controller.d.ts +62 -0
  503. package/dist/core/research/research-lane-controller.d.ts.map +1 -0
  504. package/dist/core/research/research-lane-controller.js +292 -0
  505. package/dist/core/research/research-lane-controller.js.map +1 -0
  506. package/dist/core/research/session-evidence-bundle.d.ts +2 -4
  507. package/dist/core/research/session-evidence-bundle.d.ts.map +1 -1
  508. package/dist/core/research/session-evidence-bundle.js +10 -46
  509. package/dist/core/research/session-evidence-bundle.js.map +1 -1
  510. package/dist/core/resource-loader.d.ts.map +1 -1
  511. package/dist/core/resource-loader.js +23 -8
  512. package/dist/core/resource-loader.js.map +1 -1
  513. package/dist/core/risk-classifier.d.ts +6 -0
  514. package/dist/core/risk-classifier.d.ts.map +1 -0
  515. package/dist/core/risk-classifier.js +233 -0
  516. package/dist/core/risk-classifier.js.map +1 -0
  517. package/dist/core/runtime-builder.d.ts +41 -23
  518. package/dist/core/runtime-builder.d.ts.map +1 -1
  519. package/dist/core/runtime-builder.js +365 -253
  520. package/dist/core/runtime-builder.js.map +1 -1
  521. package/dist/core/sdk.d.ts +6 -3
  522. package/dist/core/sdk.d.ts.map +1 -1
  523. package/dist/core/sdk.js +68 -25
  524. package/dist/core/sdk.js.map +1 -1
  525. package/dist/core/secrets/credential-exposure-guard.d.ts +9 -0
  526. package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -0
  527. package/dist/core/secrets/credential-exposure-guard.js +241 -0
  528. package/dist/core/secrets/credential-exposure-guard.js.map +1 -0
  529. package/dist/core/secrets/secret-dotenv.d.ts +27 -0
  530. package/dist/core/secrets/secret-dotenv.d.ts.map +1 -0
  531. package/dist/core/secrets/secret-dotenv.js +183 -0
  532. package/dist/core/secrets/secret-dotenv.js.map +1 -0
  533. package/dist/core/secrets/secret-vault-format.d.ts +112 -0
  534. package/dist/core/secrets/secret-vault-format.d.ts.map +1 -0
  535. package/dist/core/secrets/secret-vault-format.js +397 -0
  536. package/dist/core/secrets/secret-vault-format.js.map +1 -0
  537. package/dist/core/secrets/secret-vault.d.ts +72 -0
  538. package/dist/core/secrets/secret-vault.d.ts.map +1 -0
  539. package/dist/core/secrets/secret-vault.js +671 -0
  540. package/dist/core/secrets/secret-vault.js.map +1 -0
  541. package/dist/core/session-analytics.d.ts +4 -23
  542. package/dist/core/session-analytics.d.ts.map +1 -1
  543. package/dist/core/session-analytics.js +67 -70
  544. package/dist/core/session-analytics.js.map +1 -1
  545. package/dist/core/session-image-store.d.ts +33 -0
  546. package/dist/core/session-image-store.d.ts.map +1 -0
  547. package/dist/core/session-image-store.js +283 -0
  548. package/dist/core/session-image-store.js.map +1 -0
  549. package/dist/core/session-role.d.ts +11 -4
  550. package/dist/core/session-role.d.ts.map +1 -1
  551. package/dist/core/session-role.js +24 -5
  552. package/dist/core/session-role.js.map +1 -1
  553. package/dist/core/session-snapshot.d.ts +34 -0
  554. package/dist/core/session-snapshot.d.ts.map +1 -0
  555. package/dist/core/session-snapshot.js +68 -0
  556. package/dist/core/session-snapshot.js.map +1 -0
  557. package/dist/core/session-supervision-runtime.d.ts +31 -0
  558. package/dist/core/session-supervision-runtime.d.ts.map +1 -0
  559. package/dist/core/session-supervision-runtime.js +97 -0
  560. package/dist/core/session-supervision-runtime.js.map +1 -0
  561. package/dist/core/session-tree-navigator.d.ts +4 -6
  562. package/dist/core/session-tree-navigator.d.ts.map +1 -1
  563. package/dist/core/session-tree-navigator.js +4 -1
  564. package/dist/core/session-tree-navigator.js.map +1 -1
  565. package/dist/core/settings-manager.d.ts +10 -5
  566. package/dist/core/settings-manager.d.ts.map +1 -1
  567. package/dist/core/settings-manager.js +81 -29
  568. package/dist/core/settings-manager.js.map +1 -1
  569. package/dist/core/slash-commands.d.ts.map +1 -1
  570. package/dist/core/slash-commands.js +2 -2
  571. package/dist/core/slash-commands.js.map +1 -1
  572. package/dist/core/tasks/session-task-state.d.ts +2 -4
  573. package/dist/core/tasks/session-task-state.d.ts.map +1 -1
  574. package/dist/core/tasks/session-task-state.js +10 -28
  575. package/dist/core/tasks/session-task-state.js.map +1 -1
  576. package/dist/core/tasks/task-projection.d.ts +20 -0
  577. package/dist/core/tasks/task-projection.d.ts.map +1 -0
  578. package/dist/core/tasks/task-projection.js +47 -0
  579. package/dist/core/tasks/task-projection.js.map +1 -0
  580. package/dist/core/tasks/task-state.d.ts +4 -0
  581. package/dist/core/tasks/task-state.d.ts.map +1 -1
  582. package/dist/core/tasks/task-state.js +28 -11
  583. package/dist/core/tasks/task-state.js.map +1 -1
  584. package/dist/core/tool-capability-policy.d.ts +13 -0
  585. package/dist/core/tool-capability-policy.d.ts.map +1 -0
  586. package/dist/core/tool-capability-policy.js +86 -0
  587. package/dist/core/tool-capability-policy.js.map +1 -0
  588. package/dist/core/tool-gate-controller.d.ts.map +1 -1
  589. package/dist/core/tool-gate-controller.js +8 -2
  590. package/dist/core/tool-gate-controller.js.map +1 -1
  591. package/dist/core/tool-protocol-controller.d.ts +89 -0
  592. package/dist/core/tool-protocol-controller.d.ts.map +1 -0
  593. package/dist/core/tool-protocol-controller.js +512 -0
  594. package/dist/core/tool-protocol-controller.js.map +1 -0
  595. package/dist/core/tool-recovery-log-records.d.ts +2 -3
  596. package/dist/core/tool-recovery-log-records.d.ts.map +1 -1
  597. package/dist/core/tool-recovery-log-records.js +9 -35
  598. package/dist/core/tool-recovery-log-records.js.map +1 -1
  599. package/dist/core/tool-recovery-stats.d.ts +21 -1
  600. package/dist/core/tool-recovery-stats.d.ts.map +1 -1
  601. package/dist/core/tool-recovery-stats.js.map +1 -1
  602. package/dist/core/tool-selection/tool-performance-store.d.ts +3 -7
  603. package/dist/core/tool-selection/tool-performance-store.d.ts.map +1 -1
  604. package/dist/core/tool-selection/tool-performance-store.js +97 -138
  605. package/dist/core/tool-selection/tool-performance-store.js.map +1 -1
  606. package/dist/core/tools/ask-question.d.ts +124 -0
  607. package/dist/core/tools/ask-question.d.ts.map +1 -0
  608. package/dist/core/tools/ask-question.js +693 -0
  609. package/dist/core/tools/ask-question.js.map +1 -0
  610. package/dist/core/tools/bash.d.ts +5 -0
  611. package/dist/core/tools/bash.d.ts.map +1 -1
  612. package/dist/core/tools/bash.js +59 -5
  613. package/dist/core/tools/bash.js.map +1 -1
  614. package/dist/core/tools/delegate-status.d.ts +31 -3
  615. package/dist/core/tools/delegate-status.d.ts.map +1 -1
  616. package/dist/core/tools/delegate-status.js +148 -29
  617. package/dist/core/tools/delegate-status.js.map +1 -1
  618. package/dist/core/tools/delegate.d.ts +15 -13
  619. package/dist/core/tools/delegate.d.ts.map +1 -1
  620. package/dist/core/tools/delegate.js +106 -23
  621. package/dist/core/tools/delegate.js.map +1 -1
  622. package/dist/core/tools/extensionify.d.ts.map +1 -1
  623. package/dist/core/tools/extensionify.js +1 -0
  624. package/dist/core/tools/extensionify.js.map +1 -1
  625. package/dist/core/tools/git-filter.d.ts +1 -8
  626. package/dist/core/tools/git-filter.d.ts.map +1 -1
  627. package/dist/core/tools/git-filter.js +2 -63
  628. package/dist/core/tools/git-filter.js.map +1 -1
  629. package/dist/core/tools/goal.d.ts +10 -8
  630. package/dist/core/tools/goal.d.ts.map +1 -1
  631. package/dist/core/tools/goal.js +106 -28
  632. package/dist/core/tools/goal.js.map +1 -1
  633. package/dist/core/tools/index.d.ts +1 -0
  634. package/dist/core/tools/index.d.ts.map +1 -1
  635. package/dist/core/tools/index.js +1 -0
  636. package/dist/core/tools/index.js.map +1 -1
  637. package/dist/core/tools/model-fitness.d.ts.map +1 -1
  638. package/dist/core/tools/model-fitness.js +2 -2
  639. package/dist/core/tools/model-fitness.js.map +1 -1
  640. package/dist/core/tools/orchestration-panel.d.ts +40 -0
  641. package/dist/core/tools/orchestration-panel.d.ts.map +1 -0
  642. package/dist/core/tools/orchestration-panel.js +124 -0
  643. package/dist/core/tools/orchestration-panel.js.map +1 -0
  644. package/dist/core/tools/output-accumulator.d.ts +11 -0
  645. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  646. package/dist/core/tools/output-accumulator.js +36 -3
  647. package/dist/core/tools/output-accumulator.js.map +1 -1
  648. package/dist/core/tools/python.d.ts +2 -0
  649. package/dist/core/tools/python.d.ts.map +1 -1
  650. package/dist/core/tools/python.js +3 -1
  651. package/dist/core/tools/python.js.map +1 -1
  652. package/dist/core/tools/read.d.ts.map +1 -1
  653. package/dist/core/tools/read.js +1 -1
  654. package/dist/core/tools/read.js.map +1 -1
  655. package/dist/core/tools/run-process.d.ts +26 -0
  656. package/dist/core/tools/run-process.d.ts.map +1 -0
  657. package/dist/core/tools/run-process.js +138 -0
  658. package/dist/core/tools/run-process.js.map +1 -0
  659. package/dist/core/tools/search-command-guard.d.ts +14 -0
  660. package/dist/core/tools/search-command-guard.d.ts.map +1 -0
  661. package/dist/core/tools/search-command-guard.js +333 -0
  662. package/dist/core/tools/search-command-guard.js.map +1 -0
  663. package/dist/core/tools/secret-store.d.ts +38 -0
  664. package/dist/core/tools/secret-store.d.ts.map +1 -0
  665. package/dist/core/tools/secret-store.js +412 -0
  666. package/dist/core/tools/secret-store.js.map +1 -0
  667. package/dist/core/tools/shell-command-parser.d.ts +16 -0
  668. package/dist/core/tools/shell-command-parser.d.ts.map +1 -0
  669. package/dist/core/tools/shell-command-parser.js +113 -0
  670. package/dist/core/tools/shell-command-parser.js.map +1 -0
  671. package/dist/core/tools/task-steps.d.ts +2 -0
  672. package/dist/core/tools/task-steps.d.ts.map +1 -1
  673. package/dist/core/tools/task-steps.js +99 -0
  674. package/dist/core/tools/task-steps.js.map +1 -1
  675. package/dist/core/tools/tmux-dispatch.d.ts +3 -5
  676. package/dist/core/tools/tmux-dispatch.d.ts.map +1 -1
  677. package/dist/core/tools/tmux-dispatch.js +4 -4
  678. package/dist/core/tools/tmux-dispatch.js.map +1 -1
  679. package/dist/core/tools/windows-shell-engine.d.ts.map +1 -1
  680. package/dist/core/tools/windows-shell-engine.js +4 -6
  681. package/dist/core/tools/windows-shell-engine.js.map +1 -1
  682. package/dist/core/util/atomic-file.d.ts +6 -2
  683. package/dist/core/util/atomic-file.d.ts.map +1 -1
  684. package/dist/core/util/atomic-file.js +4 -4
  685. package/dist/core/util/atomic-file.js.map +1 -1
  686. package/dist/core/util/bounded-jsonl.d.ts +10 -0
  687. package/dist/core/util/bounded-jsonl.d.ts.map +1 -0
  688. package/dist/core/util/bounded-jsonl.js +75 -0
  689. package/dist/core/util/bounded-jsonl.js.map +1 -0
  690. package/dist/core/util/value-guards.d.ts +5 -0
  691. package/dist/core/util/value-guards.d.ts.map +1 -0
  692. package/dist/core/util/value-guards.js +12 -0
  693. package/dist/core/util/value-guards.js.map +1 -0
  694. package/dist/core/worktree-sync/store.d.ts +3 -3
  695. package/dist/core/worktree-sync/store.d.ts.map +1 -1
  696. package/dist/core/worktree-sync/store.js +10 -5
  697. package/dist/core/worktree-sync/store.js.map +1 -1
  698. package/dist/index.d.ts +15 -4
  699. package/dist/index.d.ts.map +1 -1
  700. package/dist/index.js +14 -3
  701. package/dist/index.js.map +1 -1
  702. package/dist/main.d.ts.map +1 -1
  703. package/dist/main.js +149 -51
  704. package/dist/main.js.map +1 -1
  705. package/dist/migrations.d.ts +4 -6
  706. package/dist/migrations.d.ts.map +1 -1
  707. package/dist/migrations.js +186 -28
  708. package/dist/migrations.js.map +1 -1
  709. package/dist/modes/interactive/auth-dialogs-controller.d.ts +4 -0
  710. package/dist/modes/interactive/auth-dialogs-controller.d.ts.map +1 -1
  711. package/dist/modes/interactive/auth-dialogs-controller.js +60 -1
  712. package/dist/modes/interactive/auth-dialogs-controller.js.map +1 -1
  713. package/dist/modes/interactive/clipboard-input.d.ts +7 -1
  714. package/dist/modes/interactive/clipboard-input.d.ts.map +1 -1
  715. package/dist/modes/interactive/clipboard-input.js +44 -6
  716. package/dist/modes/interactive/clipboard-input.js.map +1 -1
  717. package/dist/modes/interactive/components/activity-lane.d.ts +55 -0
  718. package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -0
  719. package/dist/modes/interactive/components/activity-lane.js +304 -0
  720. package/dist/modes/interactive/components/activity-lane.js.map +1 -0
  721. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  722. package/dist/modes/interactive/components/assistant-message.js +19 -10
  723. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  724. package/dist/modes/interactive/components/expandable-text.d.ts +12 -0
  725. package/dist/modes/interactive/components/expandable-text.d.ts.map +1 -0
  726. package/dist/modes/interactive/components/expandable-text.js +17 -0
  727. package/dist/modes/interactive/components/expandable-text.js.map +1 -0
  728. package/dist/modes/interactive/components/extension-editor.d.ts +15 -1
  729. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  730. package/dist/modes/interactive/components/extension-editor.js +30 -21
  731. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  732. package/dist/modes/interactive/components/extension-input.d.ts +1 -0
  733. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  734. package/dist/modes/interactive/components/extension-input.js +6 -1
  735. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  736. package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
  737. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  738. package/dist/modes/interactive/components/scoped-models-selector.js +23 -14
  739. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  740. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  741. package/dist/modes/interactive/components/settings-selector.js +6 -6
  742. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  743. package/dist/modes/interactive/components/tool-execution.d.ts +19 -11
  744. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  745. package/dist/modes/interactive/components/tool-execution.js +53 -20
  746. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  747. package/dist/modes/interactive/components/tool-group.d.ts.map +1 -1
  748. package/dist/modes/interactive/components/tool-group.js +3 -0
  749. package/dist/modes/interactive/components/tool-group.js.map +1 -1
  750. package/dist/modes/interactive/components/usage-action-selector.d.ts +16 -0
  751. package/dist/modes/interactive/components/usage-action-selector.d.ts.map +1 -0
  752. package/dist/modes/interactive/components/usage-action-selector.js +46 -0
  753. package/dist/modes/interactive/components/usage-action-selector.js.map +1 -0
  754. package/dist/modes/interactive/config-backup.d.ts.map +1 -1
  755. package/dist/modes/interactive/config-backup.js +5 -4
  756. package/dist/modes/interactive/config-backup.js.map +1 -1
  757. package/dist/modes/interactive/extension-ui-host.d.ts +14 -0
  758. package/dist/modes/interactive/extension-ui-host.d.ts.map +1 -1
  759. package/dist/modes/interactive/extension-ui-host.js +77 -15
  760. package/dist/modes/interactive/extension-ui-host.js.map +1 -1
  761. package/dist/modes/interactive/external-editor.d.ts +15 -0
  762. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  763. package/dist/modes/interactive/external-editor.js +27 -19
  764. package/dist/modes/interactive/external-editor.js.map +1 -1
  765. package/dist/modes/interactive/history-reload-math.d.ts +6 -2
  766. package/dist/modes/interactive/history-reload-math.d.ts.map +1 -1
  767. package/dist/modes/interactive/history-reload-math.js +10 -5
  768. package/dist/modes/interactive/history-reload-math.js.map +1 -1
  769. package/dist/modes/interactive/interactive-event-controller.d.ts +74 -0
  770. package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -0
  771. package/dist/modes/interactive/interactive-event-controller.js +328 -0
  772. package/dist/modes/interactive/interactive-event-controller.js.map +1 -0
  773. package/dist/modes/interactive/interactive-mode.d.ts +22 -24
  774. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  775. package/dist/modes/interactive/interactive-mode.js +245 -595
  776. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  777. package/dist/modes/interactive/key-handlers.d.ts.map +1 -1
  778. package/dist/modes/interactive/key-handlers.js +1 -1
  779. package/dist/modes/interactive/key-handlers.js.map +1 -1
  780. package/dist/modes/interactive/loaded-resources-view.d.ts +20 -0
  781. package/dist/modes/interactive/loaded-resources-view.d.ts.map +1 -0
  782. package/dist/modes/interactive/loaded-resources-view.js +147 -0
  783. package/dist/modes/interactive/loaded-resources-view.js.map +1 -0
  784. package/dist/modes/interactive/profile-menu-controller.d.ts.map +1 -1
  785. package/dist/modes/interactive/profile-menu-controller.js +7 -7
  786. package/dist/modes/interactive/profile-menu-controller.js.map +1 -1
  787. package/dist/modes/interactive/report-commands.d.ts.map +1 -1
  788. package/dist/modes/interactive/report-commands.js +21 -0
  789. package/dist/modes/interactive/report-commands.js.map +1 -1
  790. package/dist/modes/interactive/resource-display.d.ts.map +1 -1
  791. package/dist/modes/interactive/resource-display.js +8 -2
  792. package/dist/modes/interactive/resource-display.js.map +1 -1
  793. package/dist/modes/interactive/resource-shell-commands.d.ts +1 -5
  794. package/dist/modes/interactive/resource-shell-commands.d.ts.map +1 -1
  795. package/dist/modes/interactive/resource-shell-commands.js +0 -5
  796. package/dist/modes/interactive/resource-shell-commands.js.map +1 -1
  797. package/dist/modes/interactive/session-flow-commands.d.ts +27 -8
  798. package/dist/modes/interactive/session-flow-commands.d.ts.map +1 -1
  799. package/dist/modes/interactive/session-flow-commands.js +150 -64
  800. package/dist/modes/interactive/session-flow-commands.js.map +1 -1
  801. package/dist/modes/interactive/session-io-commands.d.ts.map +1 -1
  802. package/dist/modes/interactive/session-io-commands.js +16 -6
  803. package/dist/modes/interactive/session-io-commands.js.map +1 -1
  804. package/dist/modes/interactive/session-replacement-errors.d.ts +7 -0
  805. package/dist/modes/interactive/session-replacement-errors.d.ts.map +1 -0
  806. package/dist/modes/interactive/session-replacement-errors.js +15 -0
  807. package/dist/modes/interactive/session-replacement-errors.js.map +1 -0
  808. package/dist/modes/interactive/startup-checks.d.ts.map +1 -1
  809. package/dist/modes/interactive/startup-checks.js +1 -1
  810. package/dist/modes/interactive/startup-checks.js.map +1 -1
  811. package/dist/modes/interactive/usage-commands.d.ts +34 -0
  812. package/dist/modes/interactive/usage-commands.d.ts.map +1 -0
  813. package/dist/modes/interactive/usage-commands.js +225 -0
  814. package/dist/modes/interactive/usage-commands.js.map +1 -0
  815. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  816. package/dist/modes/rpc/rpc-mode.js +82 -23
  817. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  818. package/dist/modes/rpc/rpc-types.d.ts +15 -0
  819. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  820. package/dist/modes/rpc/rpc-types.js +138 -1
  821. package/dist/modes/rpc/rpc-types.js.map +1 -1
  822. package/dist/utils/clipboard-image.d.ts.map +1 -1
  823. package/dist/utils/clipboard-image.js +2 -13
  824. package/dist/utils/clipboard-image.js.map +1 -1
  825. package/dist/utils/clipboard-native.d.ts +1 -0
  826. package/dist/utils/clipboard-native.d.ts.map +1 -1
  827. package/dist/utils/clipboard-native.js.map +1 -1
  828. package/dist/utils/clipboard.d.ts +1 -0
  829. package/dist/utils/clipboard.d.ts.map +1 -1
  830. package/dist/utils/clipboard.js +52 -1
  831. package/dist/utils/clipboard.js.map +1 -1
  832. package/dist/utils/platform.d.ts +3 -0
  833. package/dist/utils/platform.d.ts.map +1 -0
  834. package/dist/utils/platform.js +8 -0
  835. package/dist/utils/platform.js.map +1 -0
  836. package/dist/utils/shell.d.ts.map +1 -1
  837. package/dist/utils/shell.js +5 -3
  838. package/dist/utils/shell.js.map +1 -1
  839. package/dist/utils/version-check.d.ts.map +1 -1
  840. package/dist/utils/version-check.js +3 -1
  841. package/dist/utils/version-check.js.map +1 -1
  842. package/dist/utils/work-directory.d.ts +11 -0
  843. package/dist/utils/work-directory.d.ts.map +1 -1
  844. package/dist/utils/work-directory.js +30 -9
  845. package/dist/utils/work-directory.js.map +1 -1
  846. package/docs/UI_POLISH_ORCHESTRATION.md +38 -0
  847. package/docs/UI_QUALITY_ORCHESTRATION.md +28 -0
  848. package/docs/docs.json +4 -0
  849. package/docs/extensions.md +62 -2
  850. package/docs/harness-architecture.md +156 -0
  851. package/docs/keybindings.md +11 -1
  852. package/docs/process-matrix.md +59 -26
  853. package/docs/providers.md +9 -1
  854. package/docs/rpc.md +45 -2
  855. package/docs/sessions.md +15 -0
  856. package/docs/settings.md +125 -11
  857. package/docs/task-steps.md +8 -0
  858. package/docs/telemetry.md +19 -0
  859. package/docs/tmux-agent-manager.md +10 -3
  860. package/docs/ui-reference/README.md +9 -0
  861. package/docs/ui-reference/orchestration-after.txt +14 -0
  862. package/docs/ui-reference/orchestration-before.txt +13 -0
  863. package/docs/ui-reference/orchestration-reference.txt +16 -0
  864. package/docs/usage.md +22 -2
  865. package/docs/work-directory.md +19 -8
  866. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  867. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  868. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  869. package/examples/extensions/question.ts +34 -245
  870. package/examples/extensions/questionnaire.ts +41 -407
  871. package/examples/extensions/sandbox/package-lock.json +2 -2
  872. package/examples/extensions/sandbox/package.json +1 -1
  873. package/examples/extensions/with-deps/package-lock.json +2 -2
  874. package/examples/extensions/with-deps/package.json +1 -1
  875. package/npm-shrinkwrap.json +13 -13
  876. package/package.json +4 -4
  877. package/dist/core/delegation/session-worker-result.d.ts +0 -46
  878. package/dist/core/delegation/session-worker-result.d.ts.map +0 -1
  879. package/dist/core/delegation/session-worker-result.js +0 -113
  880. package/dist/core/delegation/session-worker-result.js.map +0 -1
  881. package/dist/core/delegation/worker-result.d.ts.map +0 -1
  882. package/dist/core/delegation/worker-result.js.map +0 -1
  883. package/dist/core/telemetry.d.ts.map +0 -1
  884. package/dist/core/telemetry.js.map +0 -1
@@ -4,17 +4,17 @@
4
4
  */
5
5
  import * as fs from "node:fs";
6
6
  import * as path from "node:path";
7
- import { createCompactionSummaryMessage } from "@caupulican/pi-agent-core";
8
- import { Container, Loader, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, } from "@caupulican/pi-tui";
9
- import { APP_NAME, APP_TITLE, VERSION } from "../../config.js";
7
+ import { Container, Loader, ProcessTerminal, Spacer, setKeybindings, Text, TUI, } from "@caupulican/pi-tui";
8
+ import { APP_NAME, APP_TITLE, getAgentDir, VERSION } from "../../config.js";
10
9
  import { parseSkillBlock } from "../../core/agent-session.js";
11
10
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
12
11
  import { DEFAULT_GOAL_CONTINUE_MAX_STALL_TURNS, DEFAULT_GOAL_CONTINUE_MAX_TURNS, DEFAULT_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, MAX_GOAL_CONTINUE_MAX_STALL_TURNS, MAX_GOAL_CONTINUE_MAX_TURNS, MAX_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, } from "../../core/goals/goal-continuation-defaults.js";
13
12
  import { configureHttpDispatcher } from "../../core/http-dispatcher.js";
14
13
  import { KeybindingsManager } from "../../core/keybindings.js";
15
14
  import { formatMissingSessionCwdPrompt } from "../../core/session-cwd.js";
16
- import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
17
- import { getCwdRelativePath, resolvePath } from "../../utils/paths.js";
15
+ import { SessionImageStore } from "../../core/session-image-store.js";
16
+ import { isRecordObject } from "../../core/util/value-guards.js";
17
+ import { resolvePath } from "../../utils/paths.js";
18
18
  import { ensureTool } from "../../utils/tools-manager.js";
19
19
  import { checkForNewPiVersion } from "../../utils/version-check.js";
20
20
  import { AuthDialogsController } from "./auth-dialogs-controller.js";
@@ -23,57 +23,46 @@ import * as autocompleteProvider from "./autocomplete-provider.js";
23
23
  import * as autonomyCommands from "./autonomy-commands.js";
24
24
  import * as clipboardInput from "./clipboard-input.js";
25
25
  import * as compactionQueue from "./compaction-queue.js";
26
+ import { ActivityLaneComponent } from "./components/activity-lane.js";
26
27
  import { AssistantMessageComponent } from "./components/assistant-message.js";
27
28
  import { BashExecutionComponent } from "./components/bash-execution.js";
28
29
  import { BranchSummaryMessageComponent } from "./components/branch-summary-message.js";
29
30
  import { CompactionSummaryMessageComponent } from "./components/compaction-summary-message.js";
30
- import { CountdownTimer } from "./components/countdown-timer.js";
31
31
  import { CustomEditor } from "./components/custom-editor.js";
32
32
  import { CustomMessageComponent } from "./components/custom-message.js";
33
33
  import { DynamicBorder } from "./components/dynamic-border.js";
34
+ import { ExpandableText, isExpandable } from "./components/expandable-text.js";
34
35
  import { FooterComponent } from "./components/footer.js";
35
36
  import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
36
37
  import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
37
38
  import { ToolExecutionComponent } from "./components/tool-execution.js";
38
39
  import { ToolGroupComponent } from "./components/tool-group.js";
39
- import { getToolPanelActionKey, getToolPanelResultActionKeys, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
40
+ import { getToolPanelActionKey, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
40
41
  import { UserMessageComponent } from "./components/user-message.js";
41
42
  import * as configBackup from "./config-backup.js";
42
43
  import { EditorOverlayHost } from "./editor-overlay-host.js";
43
44
  import { ExtensionUiHost } from "./extension-ui-host.js";
44
45
  import { openEditorForPath, openExternalEditor } from "./external-editor.js";
45
46
  import * as historyReloadMath from "./history-reload-math.js";
47
+ import { handleInteractiveEvent } from "./interactive-event-controller.js";
46
48
  import * as keyHandlers from "./key-handlers.js";
49
+ import { renderLoadedResources } from "./loaded-resources-view.js";
47
50
  import * as localModelCommands from "./local-model-commands.js";
48
51
  import { ProfileMenuController } from "./profile-menu-controller.js";
49
52
  import * as reportCommands from "./report-commands.js";
50
- import * as resourceDisplay from "./resource-display.js";
51
53
  import * as resourceShellCommands from "./resource-shell-commands.js";
52
54
  import * as sessionFlows from "./session-flow-commands.js";
53
55
  import * as sessionIoCommands from "./session-io-commands.js";
56
+ import { handleNonFatalSessionReplacementError } from "./session-replacement-errors.js";
54
57
  import * as settingsSelectorFlow from "./settings-selector-flow.js";
55
58
  import * as signalLifecycle from "./signal-lifecycle.js";
56
59
  import * as startupChecks from "./startup-checks.js";
57
60
  import { getEditorTheme, getMarkdownTheme, initTheme, onThemeChange, setRegisteredThemes, setTheme, stopThemeWatcher, theme, } from "./theme/theme.js";
61
+ import * as usageCommands from "./usage-commands.js";
58
62
  const TUI_HISTORY_RELOAD_CHUNK_SIZE = 20;
59
63
  const TUI_LIVE_HISTORY_MAX_COMPONENTS = 260;
60
64
  const TUI_LIVE_HISTORY_TRIM_TO_COMPONENTS = 220;
61
65
  const STREAMING_UI_UPDATE_INTERVAL_MS = 80;
62
- function isExpandable(obj) {
63
- return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
64
- }
65
- class ExpandableText extends Text {
66
- getCollapsedText;
67
- getExpandedText;
68
- constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
69
- super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
70
- this.getCollapsedText = getCollapsedText;
71
- this.getExpandedText = getExpandedText;
72
- }
73
- setExpanded(expanded) {
74
- this.setText(expanded ? this.getExpandedText() : this.getCollapsedText());
75
- }
76
- }
77
66
  const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage.";
78
67
  function isAnthropicSubscriptionAuthKey(apiKey) {
79
68
  return typeof apiKey === "string" && apiKey.startsWith("sk-ant-oat");
@@ -126,6 +115,7 @@ export class InteractiveMode {
126
115
  pendingUserInputs = [];
127
116
  pendingClipboardImages = [];
128
117
  clipboardImageCounter = 0;
118
+ clipboardImageStore;
129
119
  loadingAnimation = undefined;
130
120
  workingMessage = undefined;
131
121
  workingVisible = true;
@@ -170,10 +160,8 @@ export class InteractiveMode {
170
160
  // Track pending bash components (shown in pending area, moved to chat on submit)
171
161
  pendingBashComponents = [];
172
162
  // Auto-compaction state
173
- autoCompactionLoader = undefined;
174
163
  autoCompactionEscapeHandler;
175
164
  // Auto-retry state
176
- retryLoader = undefined;
177
165
  retryCountdown = undefined;
178
166
  retryEscapeHandler;
179
167
  // Messages queued while compaction is running
@@ -183,6 +171,8 @@ export class InteractiveMode {
183
171
  // Extension widget containers (hold components rendered above/below the editor)
184
172
  widgetContainerAbove;
185
173
  widgetContainerBelow;
174
+ activityLane;
175
+ hasHumanAudience;
186
176
  // Header container that holds the built-in or custom header
187
177
  headerContainer;
188
178
  // Built-in header (logo + keybinding hints + changelog)
@@ -204,6 +194,8 @@ export class InteractiveMode {
204
194
  constructor(runtimeHost, options = {}) {
205
195
  this.runtimeHost = runtimeHost;
206
196
  this.options = options;
197
+ this.hasHumanAudience = options.hasHumanAudience ?? true;
198
+ this.workingVisible = this.hasHumanAudience;
207
199
  this.runtimeHost.setBeforeSessionInvalidate(() => {
208
200
  this.extensionUiHost.resetExtensionUI();
209
201
  });
@@ -219,6 +211,9 @@ export class InteractiveMode {
219
211
  this.statusContainer = new Container();
220
212
  this.widgetContainerAbove = new Container();
221
213
  this.widgetContainerBelow = new Container();
214
+ this.activityLane = this.hasHumanAudience
215
+ ? new ActivityLaneComponent(theme, () => this.ui.requestRender())
216
+ : undefined;
222
217
  this.keybindings = KeybindingsManager.create();
223
218
  setKeybindings(this.keybindings);
224
219
  const editorPaddingX = this.settingsManager.getEditorPaddingX();
@@ -304,6 +299,7 @@ export class InteractiveMode {
304
299
  },
305
300
  getBuiltInHeader: () => this.builtInHeader,
306
301
  getAutocompleteProvider: () => this.autocompleteProvider,
302
+ getClipboardImageStore: () => this.clipboardImageStore,
307
303
  getToolsExpanded: () => this.toolOutputExpanded,
308
304
  pushAutocompleteProviderWrapper: (factory) => {
309
305
  this.autocompleteProviderWrappers.push(factory);
@@ -339,19 +335,6 @@ export class InteractiveMode {
339
335
  setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
340
336
  initTheme(this.settingsManager.getTheme(), true);
341
337
  }
342
- getBuiltInCommandConflictDiagnostics(extensionRunner) {
343
- const builtinNames = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));
344
- return extensionRunner
345
- .getRegisteredCommands()
346
- .filter((command) => builtinNames.has(command.name))
347
- .map((command) => ({
348
- type: "warning",
349
- message: command.invocationName === command.name
350
- ? `Extension command '/${command.name}' conflicts with built-in interactive command. Skipping in autocomplete.`
351
- : `Extension command '/${command.name}' conflicts with built-in interactive command. Available as '/${command.invocationName}'.`,
352
- path: command.sourceInfo.path,
353
- }));
354
- }
355
338
  // Thin delegate retained so setupAutocompleteProvider's base-provider seam
356
339
  // (stubbed via prototype in interactive-mode-status.test.ts) keeps working.
357
340
  createBaseAutocompleteProvider() {
@@ -472,13 +455,19 @@ export class InteractiveMode {
472
455
  this.headerContainer.addChild(this.builtInHeader);
473
456
  }
474
457
  this.ui.addChild(this.chatContainer);
475
- this.ui.addChild(this.pendingMessagesContainer);
476
- this.ui.addChild(this.statusContainer);
477
- this.extensionUiHost.renderWidgets(); // Initialize with default spacer
478
- this.ui.addChild(this.widgetContainerAbove);
458
+ if (this.hasHumanAudience) {
459
+ this.ui.addChild(this.pendingMessagesContainer);
460
+ this.ui.addChild(this.statusContainer);
461
+ this.extensionUiHost.renderWidgets(); // Initialize with default spacer
462
+ this.ui.addChild(this.widgetContainerAbove);
463
+ if (this.activityLane)
464
+ this.ui.addChild(this.activityLane);
465
+ }
479
466
  this.ui.addChild(this.editorContainer);
480
- this.ui.addChild(this.widgetContainerBelow);
481
- this.ui.addChild(this.footer);
467
+ if (this.hasHumanAudience) {
468
+ this.ui.addChild(this.widgetContainerBelow);
469
+ this.ui.addChild(this.footer);
470
+ }
482
471
  this.ui.setFocus(this.editor);
483
472
  this.setupKeyHandlers();
484
473
  this.setupEditorSubmitHandler();
@@ -496,6 +485,7 @@ export class InteractiveMode {
496
485
  onThemeChange(() => {
497
486
  this.ui.invalidate();
498
487
  this.updateEditorBorderColor();
488
+ this.refreshActivityLane();
499
489
  this.ui.requestRender();
500
490
  });
501
491
  // Set up git branch watcher (uses provider instead of footer)
@@ -535,10 +525,17 @@ export class InteractiveMode {
535
525
  }
536
526
  });
537
527
  // Start package update check asynchronously
538
- this.checkForPackageUpdates().then((updates) => {
528
+ this.checkForPackageUpdates()
529
+ .then((updates) => {
539
530
  if (updates.length > 0) {
540
531
  this.showPackageUpdateNotification(updates);
541
532
  }
533
+ })
534
+ .finally(() => {
535
+ // npm can overwrite the shared Windows console title while checking extension versions.
536
+ if (process.platform === "win32" && this.isInitialized) {
537
+ this.updateTerminalTitle();
538
+ }
542
539
  });
543
540
  // Check tmux keyboard setup asynchronously
544
541
  this.checkTmuxKeyboardSetup().then((warning) => {
@@ -617,6 +614,50 @@ export class InteractiveMode {
617
614
  this.footerDataProvider.setAutonomyStatusSnapshot(this.session.getAutonomyStatusSnapshot());
618
615
  this.footer.invalidate();
619
616
  }
617
+ activityLaneSnapshot() {
618
+ return {
619
+ goalState: this.session.getGoalStateSnapshot(),
620
+ taskState: this.session.getTaskStepsStateSnapshot(),
621
+ laneRecords: this.session.getLaneRecords(),
622
+ };
623
+ }
624
+ refreshActivityLane(options = {}) {
625
+ if (!this.activityLane)
626
+ return;
627
+ const sessionKey = this.sessionManager.getSessionId();
628
+ if (options.replace) {
629
+ this.activityLane.replaceCanonical(sessionKey, this.activityLaneSnapshot());
630
+ }
631
+ else {
632
+ this.activityLane.updateCanonical(sessionKey, this.activityLaneSnapshot());
633
+ }
634
+ }
635
+ toolActivityKind(toolName) {
636
+ if (toolName === "task_steps")
637
+ return "task";
638
+ if (toolName === "goal")
639
+ return "goal";
640
+ if (toolName === "delegate" || toolName === "delegate_status")
641
+ return "worker";
642
+ return "tool";
643
+ }
644
+ toolActivityLabel(toolName) {
645
+ const label = this.getRegisteredToolDefinition(toolName)?.label?.trim() || toolName;
646
+ return label.replace(/[_-]+/g, " ").replace(/(^|\s)\S/g, (character) => character.toUpperCase());
647
+ }
648
+ toolActivityTerminalStatus(isError, details) {
649
+ if (isError)
650
+ return "failure";
651
+ if (!isRecordObject(details))
652
+ return "success";
653
+ if (details.applied === false || details.kind === "error")
654
+ return "failure";
655
+ if (details.kind === "review" && details.reviewed === false)
656
+ return "failure";
657
+ if (details.started === false)
658
+ return "neutral";
659
+ return "success";
660
+ }
620
661
  checkForPackageUpdates() {
621
662
  return startupChecks.checkForPackageUpdates(this.startupChecksHost());
622
663
  }
@@ -639,220 +680,25 @@ export class InteractiveMode {
639
680
  // =========================================================================
640
681
  // Extension System
641
682
  // =========================================================================
642
- // The resource-display formatters below are pure and live in ./resource-display.ts.
643
- // These thin `this.`-delegates are retained so showLoadedResources' formatter
644
- // injection seam (exercised via prototype stubs in interactive-mode-status.test.ts)
645
- // keeps working unchanged.
646
- formatDisplayPath(p) {
647
- return resourceDisplay.formatDisplayPath(p);
648
- }
649
- formatExtensionDisplayPath(path) {
650
- return resourceDisplay.formatExtensionDisplayPath(path);
651
- }
652
- formatContextPath(p) {
653
- const cwd = path.resolve(this.sessionManager.getCwd());
654
- const absolutePath = path.isAbsolute(p) ? path.resolve(p) : path.resolve(cwd, p);
655
- const relativePath = getCwdRelativePath(absolutePath, cwd);
656
- if (relativePath !== undefined) {
657
- return relativePath;
658
- }
659
- return this.formatDisplayPath(absolutePath);
660
- }
661
683
  getStartupExpansionState() {
662
684
  return this.options.verbose || this.toolOutputExpanded;
663
685
  }
664
- getShortPath(fullPath, sourceInfo) {
665
- return resourceDisplay.getShortPath(fullPath, sourceInfo);
666
- }
667
- getCompactPathLabel(resourcePath, sourceInfo) {
668
- return resourceDisplay.getCompactPathLabel(resourcePath, sourceInfo);
669
- }
670
- getCompactPackageSourceLabel(sourceInfo) {
671
- return resourceDisplay.getCompactPackageSourceLabel(sourceInfo);
672
- }
673
- getCompactExtensionLabel(resourcePath, sourceInfo) {
674
- return resourceDisplay.getCompactExtensionLabel(resourcePath, sourceInfo);
675
- }
676
- getCompactDisplayPathSegments(resourcePath) {
677
- return resourceDisplay.getCompactDisplayPathSegments(resourcePath);
678
- }
679
- getCompactNonPackageExtensionLabel(resourcePath, index, allPaths) {
680
- return resourceDisplay.getCompactNonPackageExtensionLabel(resourcePath, index, allPaths);
681
- }
682
- getCompactExtensionLabels(extensions) {
683
- return resourceDisplay.getCompactExtensionLabels(extensions);
684
- }
685
- getScopeGroup(sourceInfo) {
686
- return resourceDisplay.getScopeGroup(sourceInfo);
687
- }
688
- isPackageSource(sourceInfo) {
689
- return resourceDisplay.isPackageSource(sourceInfo);
690
- }
691
- buildScopeGroups(items) {
692
- return resourceDisplay.buildScopeGroups(items);
693
- }
694
- formatScopeGroups(groups, options) {
695
- return resourceDisplay.formatScopeGroups(groups, options);
696
- }
697
- formatDiagnostics(diagnostics, sourceInfos) {
698
- return resourceDisplay.formatDiagnostics(diagnostics, sourceInfos);
699
- }
700
686
  showLoadedResources(options) {
701
- const showListing = options?.force || this.options.verbose || !this.settingsManager.getQuietStartup();
702
- const showDiagnostics = showListing || options?.showDiagnosticsWhenQuiet === true;
703
- if (!showListing && !showDiagnostics) {
704
- return;
705
- }
706
- const sectionHeader = (name, color = "mdHeading") => theme.fg(color, `[${name}]`);
707
- const formatCompactList = (items, options) => {
708
- const labels = items.map((item) => item.trim()).filter((item) => item.length > 0);
709
- if (options?.sort !== false) {
710
- labels.sort((a, b) => a.localeCompare(b));
711
- }
712
- return theme.fg("dim", ` ${labels.join(", ")}`);
713
- };
714
- const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
715
- const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
716
- this.chatContainer.addChild(section);
717
- this.chatContainer.addChild(new Spacer(1));
718
- };
719
- const skillsResult = this.session.resourceLoader.getSkills();
720
- const promptsResult = this.session.resourceLoader.getPrompts();
721
- const themesResult = this.session.resourceLoader.getThemes();
722
- const extensions = options?.extensions ??
723
- this.session.resourceLoader.getExtensions().extensions.map((extension) => ({
724
- path: extension.path,
725
- sourceInfo: extension.sourceInfo,
726
- }));
727
- const sourceInfos = new Map();
728
- for (const extension of extensions) {
729
- if (extension.sourceInfo) {
730
- sourceInfos.set(extension.path, extension.sourceInfo);
731
- }
732
- }
733
- for (const skill of skillsResult.skills) {
734
- if (skill.sourceInfo) {
735
- sourceInfos.set(skill.filePath, skill.sourceInfo);
736
- }
737
- }
738
- for (const prompt of promptsResult.prompts) {
739
- if (prompt.sourceInfo) {
740
- sourceInfos.set(prompt.filePath, prompt.sourceInfo);
741
- }
742
- }
743
- for (const loadedTheme of themesResult.themes) {
744
- if (loadedTheme.sourcePath && loadedTheme.sourceInfo) {
745
- sourceInfos.set(loadedTheme.sourcePath, loadedTheme.sourceInfo);
746
- }
747
- }
748
- if (showListing) {
749
- const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
750
- if (contextFiles.length > 0) {
751
- this.chatContainer.addChild(new Spacer(1));
752
- const contextList = contextFiles
753
- .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
754
- .join("\n");
755
- const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
756
- addLoadedSection("Context", contextCompactList, contextList);
757
- }
758
- const skills = this.session.resourceLoader.getActiveSkills();
759
- if (skills.length > 0) {
760
- const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
761
- const skillList = this.formatScopeGroups(groups, {
762
- formatPath: (item) => this.formatDisplayPath(item.path),
763
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
764
- });
765
- const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
766
- addLoadedSection("Skills", skillCompactList, skillList);
767
- }
768
- const templates = this.session.promptTemplates;
769
- if (templates.length > 0) {
770
- const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
771
- const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
772
- const templateList = this.formatScopeGroups(groups, {
773
- formatPath: (item) => {
774
- const template = templateByPath.get(item.path);
775
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
776
- },
777
- formatPackagePath: (item) => {
778
- const template = templateByPath.get(item.path);
779
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
780
- },
781
- });
782
- const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
783
- addLoadedSection("Prompts", promptCompactList, templateList);
784
- }
785
- if (extensions.length > 0) {
786
- const groups = this.buildScopeGroups(extensions);
787
- const extList = this.formatScopeGroups(groups, {
788
- formatPath: (item) => this.formatExtensionDisplayPath(item.path),
789
- formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
790
- });
791
- const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
792
- addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
793
- }
794
- // Show loaded themes (excluding built-in)
795
- const loadedThemes = themesResult.themes;
796
- const customThemes = loadedThemes.filter((t) => t.sourcePath);
797
- if (customThemes.length > 0) {
798
- const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
799
- path: loadedTheme.sourcePath,
800
- sourceInfo: loadedTheme.sourceInfo,
801
- })));
802
- const themeList = this.formatScopeGroups(groups, {
803
- formatPath: (item) => this.formatDisplayPath(item.path),
804
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
805
- });
806
- const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
807
- addLoadedSection("Themes", themeCompactList, themeList);
808
- }
809
- }
810
- if (showDiagnostics) {
811
- const skillDiagnostics = skillsResult.diagnostics;
812
- if (skillDiagnostics.length > 0) {
813
- const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
814
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
815
- this.chatContainer.addChild(new Spacer(1));
816
- }
817
- const promptDiagnostics = promptsResult.diagnostics;
818
- if (promptDiagnostics.length > 0) {
819
- const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
820
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
821
- this.chatContainer.addChild(new Spacer(1));
822
- }
823
- const extensionDiagnostics = [];
824
- const extensionErrors = this.session.resourceLoader.getExtensions().errors;
825
- if (extensionErrors.length > 0) {
826
- for (const error of extensionErrors) {
827
- extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
828
- }
829
- }
830
- const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
831
- extensionDiagnostics.push(...commandDiagnostics);
832
- extensionDiagnostics.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));
833
- const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
834
- extensionDiagnostics.push(...shortcutDiagnostics);
835
- if (extensionDiagnostics.length > 0) {
836
- const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
837
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
838
- this.chatContainer.addChild(new Spacer(1));
839
- }
840
- const themeDiagnostics = themesResult.diagnostics;
841
- if (themeDiagnostics.length > 0) {
842
- const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
843
- this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
844
- this.chatContainer.addChild(new Spacer(1));
845
- }
846
- }
687
+ renderLoadedResources({
688
+ session: this.session,
689
+ chatContainer: this.chatContainer,
690
+ verbose: this.options.verbose ?? false,
691
+ expanded: this.getStartupExpansionState(),
692
+ }, options);
847
693
  }
848
694
  /**
849
695
  * Initialize the extension system with TUI-based UI context.
850
696
  */
851
697
  async bindCurrentSessionExtensions() {
852
- const uiContext = this.extensionUiHost.createExtensionUIContext();
698
+ const uiContext = this.hasHumanAudience ? this.extensionUiHost.createExtensionUIContext() : undefined;
853
699
  await this.session.bindExtensions({
854
700
  uiContext,
855
- mode: "tui",
701
+ mode: this.hasHumanAudience ? "tui" : "print",
856
702
  abortHandler: () => {
857
703
  this.restoreQueuedMessagesToEditor({ abort: true });
858
704
  },
@@ -873,6 +719,9 @@ export class InteractiveMode {
873
719
  return result;
874
720
  }
875
721
  catch (error) {
722
+ const disposition = this.handleNonFatalSessionReplacementError(error);
723
+ if (disposition)
724
+ return { cancelled: disposition === "previous_restored" };
876
725
  return this.handleFatalRuntimeError("Failed to create session", error);
877
726
  }
878
727
  },
@@ -887,6 +736,9 @@ export class InteractiveMode {
887
736
  return { cancelled: result.cancelled };
888
737
  }
889
738
  catch (error) {
739
+ const disposition = this.handleNonFatalSessionReplacementError(error);
740
+ if (disposition)
741
+ return { cancelled: disposition === "previous_restored" };
890
742
  return this.handleFatalRuntimeError("Failed to fork session", error);
891
743
  }
892
744
  },
@@ -952,6 +804,18 @@ export class InteractiveMode {
952
804
  async rebindCurrentSession() {
953
805
  this.unsubscribe?.();
954
806
  this.unsubscribe = undefined;
807
+ this.pendingClipboardImages = [];
808
+ this.clipboardImageCounter = 0;
809
+ const clipboardImageDirectory = this.settingsManager.getClipboardImageDirectory();
810
+ this.clipboardImageStore =
811
+ this.sessionManager.isPersisted() || clipboardImageDirectory
812
+ ? new SessionImageStore({
813
+ agentDir: getAgentDir(),
814
+ cwd: this.sessionManager.getCwd(),
815
+ sessionId: this.sessionManager.getSessionId(),
816
+ directory: clipboardImageDirectory,
817
+ })
818
+ : undefined;
955
819
  this.applyRuntimeSettings();
956
820
  await this.bindCurrentSessionExtensions();
957
821
  this.subscribeToAgent();
@@ -959,6 +823,13 @@ export class InteractiveMode {
959
823
  await this.updateAvailableProviderCount();
960
824
  this.updateEditorBorderColor();
961
825
  this.updateTerminalTitle();
826
+ this.refreshActivityLane({ replace: true });
827
+ try {
828
+ await this.session.resumePendingHumanInput();
829
+ }
830
+ catch (error) {
831
+ this.showError(`Failed to resume pending user input: ${error instanceof Error ? error.message : String(error)}`);
832
+ }
962
833
  }
963
834
  subscribeToExtensionsChanged() {
964
835
  this.unsubscribeExtensionsChanged?.();
@@ -973,6 +844,12 @@ export class InteractiveMode {
973
844
  this.stop();
974
845
  process.exit(1);
975
846
  }
847
+ handleNonFatalSessionReplacementError(error) {
848
+ return handleNonFatalSessionReplacementError({
849
+ renderCurrentSessionState: () => this.renderCurrentSessionState(),
850
+ showError: (message) => this.showError(message),
851
+ }, error);
852
+ }
976
853
  renderCurrentSessionState() {
977
854
  this.pendingMessagesContainer.clear();
978
855
  this.compactionQueuedMessages = [];
@@ -1041,21 +918,21 @@ export class InteractiveMode {
1041
918
  return;
1042
919
  }
1043
920
  }
1044
- attachToolExecutionComponent(toolName, toolCallId, args, repair) {
921
+ attachToolExecutionComponent(toolName, toolCallId, args, repair, deferResultUntilExpanded = false) {
1045
922
  const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
1046
923
  const toolDefinition = this.getRegisteredToolDefinition(toolName);
1047
924
  const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
1048
925
  const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
1049
926
  if (existing) {
1050
927
  if (reuseInPlace && actionKey) {
1051
- existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
928
+ existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
1052
929
  existing.setExpanded(this.toolOutputExpanded);
1053
930
  this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
1054
931
  this.ui.requestRender();
1055
932
  return existing;
1056
933
  }
1057
934
  this.detachToolExecutionComponent(existing);
1058
- existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
935
+ existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
1059
936
  existing.setExpanded(this.toolOutputExpanded);
1060
937
  this.appendToolExecutionComponent(existing, true);
1061
938
  this.toolPanels.register(toolCallId, existing, actionKey);
@@ -1065,6 +942,7 @@ export class InteractiveMode {
1065
942
  showImages: this.settingsManager.getShowImages(),
1066
943
  imageWidthCells: this.settingsManager.getImageWidthCells(),
1067
944
  repair,
945
+ deferResultUntilExpanded,
1068
946
  }, toolDefinition, this.ui, this.sessionManager.getCwd());
1069
947
  component.setExpanded(this.toolOutputExpanded);
1070
948
  this.appendToolExecutionComponent(component, true);
@@ -1089,8 +967,15 @@ export class InteractiveMode {
1089
967
  this.loadingAnimation = undefined;
1090
968
  }
1091
969
  this.statusContainer.clear();
970
+ this.activityLane?.remove("runtime:routing");
971
+ this.activityLane?.remove("runtime:turn");
1092
972
  }
1093
973
  setWorkingVisible(visible) {
974
+ if (!this.hasHumanAudience) {
975
+ this.workingVisible = false;
976
+ this.stopWorkingLoader();
977
+ return;
978
+ }
1094
979
  this.workingVisible = visible;
1095
980
  if (!visible) {
1096
981
  this.stopWorkingLoader();
@@ -1098,15 +983,39 @@ export class InteractiveMode {
1098
983
  return;
1099
984
  }
1100
985
  if (this.session.isStreaming && !this.loadingAnimation) {
1101
- this.statusContainer.clear();
1102
- this.loadingAnimation = this.createWorkingLoader();
1103
- this.statusContainer.addChild(this.loadingAnimation);
986
+ if (this.workingIndicatorOptions) {
987
+ this.statusContainer.clear();
988
+ this.loadingAnimation = this.createWorkingLoader();
989
+ this.statusContainer.addChild(this.loadingAnimation);
990
+ }
991
+ else {
992
+ this.activityLane?.start({ id: "runtime:turn", kind: "runtime", label: this.getWorkingLoaderMessage() });
993
+ }
1104
994
  }
1105
995
  this.ui.requestRender();
1106
996
  }
1107
997
  setWorkingIndicator(options) {
1108
998
  this.workingIndicatorOptions = options;
1109
- this.loadingAnimation?.setIndicator(options);
999
+ if (!this.hasHumanAudience) {
1000
+ this.stopWorkingLoader();
1001
+ return;
1002
+ }
1003
+ if (options) {
1004
+ this.activityLane?.remove("runtime:turn");
1005
+ if (this.session.isStreaming && this.workingVisible) {
1006
+ this.stopWorkingLoader();
1007
+ this.loadingAnimation = this.createWorkingLoader();
1008
+ this.statusContainer.addChild(this.loadingAnimation);
1009
+ }
1010
+ }
1011
+ else {
1012
+ this.loadingAnimation?.stop();
1013
+ this.loadingAnimation = undefined;
1014
+ this.statusContainer.clear();
1015
+ if (this.session.isStreaming && this.workingVisible) {
1016
+ this.activityLane?.start({ id: "runtime:turn", kind: "runtime", label: this.getWorkingLoaderMessage() });
1017
+ }
1018
+ }
1110
1019
  this.ui.requestRender();
1111
1020
  }
1112
1021
  setHiddenThinkingLabel(label) {
@@ -1129,13 +1038,14 @@ export class InteractiveMode {
1129
1038
  if (this.loadingAnimation) {
1130
1039
  this.loadingAnimation.setMessage(message ?? this.defaultWorkingMessage);
1131
1040
  }
1041
+ this.activityLane?.update("runtime:turn", message ?? this.defaultWorkingMessage);
1132
1042
  }
1133
1043
  /**
1134
1044
  * Reset the working indicator and hidden-thinking label to their built-in defaults.
1135
1045
  */
1136
1046
  resetWorkingIndicators() {
1137
1047
  this.workingMessage = undefined;
1138
- this.workingVisible = true;
1048
+ this.workingVisible = this.hasHumanAudience;
1139
1049
  this.setWorkingIndicator();
1140
1050
  if (this.loadingAnimation) {
1141
1051
  this.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText("app.interrupt")} to interrupt)`);
@@ -1201,6 +1111,8 @@ export class InteractiveMode {
1201
1111
  }
1202
1112
  handleClipboardImagePaste() {
1203
1113
  const self = this;
1114
+ const selectedModel = this.session?.model;
1115
+ const modelCannotSeeImages = selectedModel ? !selectedModel.input.includes("image") : false;
1204
1116
  return clipboardInput.handleClipboardImagePaste({
1205
1117
  get pendingClipboardImages() {
1206
1118
  return self.pendingClipboardImages;
@@ -1216,6 +1128,12 @@ export class InteractiveMode {
1216
1128
  },
1217
1129
  editor: this.editor,
1218
1130
  ui: this.ui,
1131
+ autoResizeImages: this.settingsManager.getImageAutoResize(),
1132
+ blockImages: this.settingsManager.getBlockImages() || modelCannotSeeImages,
1133
+ blockImagesReason: modelCannotSeeImages
1134
+ ? "The selected model does not accept image input. Switch to an image-capable model or route this inspection to a vision worker."
1135
+ : undefined,
1136
+ imageStore: this.clipboardImageStore,
1219
1137
  showStatus: (message) => this.showStatus(message),
1220
1138
  showWarning: (message) => this.showWarning(message),
1221
1139
  });
@@ -1235,6 +1153,7 @@ export class InteractiveMode {
1235
1153
  set clipboardImageCounter(value) {
1236
1154
  self.clipboardImageCounter = value;
1237
1155
  },
1156
+ clipboardImageStore: this.clipboardImageStore,
1238
1157
  }, text);
1239
1158
  }
1240
1159
  buildUserInputSubmission(text) {
@@ -1412,7 +1331,12 @@ export class InteractiveMode {
1412
1331
  this.editor.setText("");
1413
1332
  return;
1414
1333
  }
1415
- if (text === "/usage" || text === "/cost") {
1334
+ if (text === "/usage") {
1335
+ this.handleUsageMenuCommand();
1336
+ this.editor.setText("");
1337
+ return;
1338
+ }
1339
+ if (text === "/cost") {
1416
1340
  this.handleUsageCommand();
1417
1341
  this.editor.setText("");
1418
1342
  return;
@@ -1567,317 +1491,8 @@ export class InteractiveMode {
1567
1491
  await this.handleEvent(event);
1568
1492
  });
1569
1493
  }
1570
- async handleEvent(event) {
1571
- if (!this.isInitialized) {
1572
- await this.init();
1573
- }
1574
- this.footer.invalidate();
1575
- switch (event.type) {
1576
- // Part B: general "the system is processing" feedback for the routing/prep gap before a
1577
- // turn starts streaming (the judge is a real bounded LLM call, not instant) — independent
1578
- // of thinking level, since this isn't model-thinking. Reuses the same working loader
1579
- // agent_start below uses, so the hand-off into real streaming is the same
1580
- // stop-then-recreate it already does — no distinct spinner, no double-render.
1581
- case "routing_start":
1582
- if (!this.session.isStreaming && !this.loadingAnimation && this.workingVisible) {
1583
- this.loadingAnimation = this.createWorkingLoader();
1584
- this.statusContainer.addChild(this.loadingAnimation);
1585
- this.ui.requestRender();
1586
- }
1587
- break;
1588
- case "routing_end":
1589
- // Unconditional: covers both a clean hand-off into agent_start (which immediately
1590
- // stops-and-recreates its own loader anyway) and a turn that failed before ever
1591
- // starting, which must not leave the indicator spinning forever.
1592
- this.stopWorkingLoader();
1593
- this.ui.requestRender();
1594
- break;
1595
- case "agent_start":
1596
- this.clearActiveToolCalls();
1597
- if (this.settingsManager.getShowTerminalProgress()) {
1598
- this.ui.terminal.setProgress(true);
1599
- }
1600
- // Restore main escape handler if retry handler is still active
1601
- // (retry success event fires later, but we need main handler now)
1602
- if (this.retryEscapeHandler) {
1603
- this.defaultEditor.onEscape = this.retryEscapeHandler;
1604
- this.retryEscapeHandler = undefined;
1605
- }
1606
- if (this.retryCountdown) {
1607
- this.retryCountdown.dispose();
1608
- this.retryCountdown = undefined;
1609
- }
1610
- if (this.retryLoader) {
1611
- this.retryLoader.stop();
1612
- this.retryLoader = undefined;
1613
- }
1614
- this.stopWorkingLoader();
1615
- if (this.workingVisible) {
1616
- this.loadingAnimation = this.createWorkingLoader();
1617
- this.statusContainer.addChild(this.loadingAnimation);
1618
- }
1619
- this.ui.requestRender();
1620
- break;
1621
- case "queue_update":
1622
- this.updatePendingMessagesDisplay();
1623
- this.ui.requestRender();
1624
- break;
1625
- case "session_info_changed":
1626
- this.updateTerminalTitle();
1627
- this.footer.invalidate();
1628
- this.ui.requestRender();
1629
- break;
1630
- case "thinking_level_changed":
1631
- this.footer.invalidate();
1632
- this.updateEditorBorderColor();
1633
- break;
1634
- case "warning":
1635
- this.showWarning(event.message);
1636
- break;
1637
- case "delegate_workers": {
1638
- const activeParts = [
1639
- event.running > 0 ? `${event.running} running` : undefined,
1640
- event.queued > 0 ? `${event.queued} queued` : undefined,
1641
- ].filter((part) => part !== undefined);
1642
- const latestTerminal = event.terminalSinceFlush.at(-1);
1643
- const terminalStatus = event.terminalSinceFlush.length === 1 && latestTerminal
1644
- ? `${latestTerminal.laneId} ${latestTerminal.status}`
1645
- : event.failedSinceFlush > 0
1646
- ? `${event.failedSinceFlush} failed`
1647
- : event.completedSinceFlush > 0
1648
- ? `${event.completedSinceFlush} completed`
1649
- : undefined;
1650
- const status = activeParts.length > 0 ? activeParts.join(", ") : terminalStatus;
1651
- this.footerDataProvider.setExtensionStatus("delegate", status ? `delegate: ${status}` : undefined);
1652
- this.footer.invalidate();
1653
- break;
1654
- }
1655
- case "message_start":
1656
- if (event.message.role === "custom") {
1657
- this.addMessageToChat(event.message);
1658
- this.ui.requestRender();
1659
- }
1660
- else if (event.message.role === "user") {
1661
- this.addMessageToChat(event.message);
1662
- this.updatePendingMessagesDisplay();
1663
- this.ui.requestRender();
1664
- }
1665
- else if (event.message.role === "assistant") {
1666
- this.clearPendingStreamingUiUpdate();
1667
- this.lastStreamingUiUpdateAt = 0;
1668
- this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel);
1669
- this.streamingMessage = event.message;
1670
- this.chatContainer.addChild(this.streamingComponent);
1671
- this.applyStreamingMessageUpdate(this.streamingMessage, { force: true });
1672
- this.trimLiveTuiHistory();
1673
- }
1674
- break;
1675
- case "message_update":
1676
- if (this.streamingComponent && event.message.role === "assistant") {
1677
- this.applyStreamingMessageUpdate(event.message);
1678
- }
1679
- break;
1680
- case "message_end":
1681
- if (event.message.role === "user")
1682
- break;
1683
- if (this.streamingComponent && event.message.role === "assistant") {
1684
- this.streamingMessage = event.message;
1685
- let errorMessage;
1686
- if (this.streamingMessage.stopReason === "aborted") {
1687
- const retryAttempt = this.session.retryAttempt;
1688
- errorMessage =
1689
- retryAttempt > 0
1690
- ? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? "s" : ""}`
1691
- : "Operation aborted";
1692
- this.streamingMessage.errorMessage = errorMessage;
1693
- }
1694
- this.applyStreamingMessageUpdate(this.streamingMessage, { force: true });
1695
- if (this.streamingMessage.stopReason === "aborted" || this.streamingMessage.stopReason === "error") {
1696
- if (!errorMessage) {
1697
- errorMessage = this.streamingMessage.errorMessage || "Error";
1698
- }
1699
- for (const [, component] of this.toolPanels.activeEntries()) {
1700
- component.updateResult({
1701
- content: [{ type: "text", text: errorMessage }],
1702
- isError: true,
1703
- });
1704
- }
1705
- this.clearActiveToolCalls();
1706
- }
1707
- else {
1708
- // Args are now complete - trigger diff computation for edit tools
1709
- for (const [, component] of this.toolPanels.activeEntries()) {
1710
- component.setArgsComplete();
1711
- }
1712
- }
1713
- this.streamingComponent = undefined;
1714
- this.streamingMessage = undefined;
1715
- this.footer.invalidate();
1716
- }
1717
- this.ui.requestRender();
1718
- break;
1719
- case "tool_execution_start": {
1720
- let component = this.toolPanels.getActive(event.toolCallId);
1721
- if (!component)
1722
- component = this.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);
1723
- else
1724
- component.updateArgs(event.args, event.repair);
1725
- component.markExecutionStarted(event.repair);
1726
- this.ui.requestRender();
1727
- break;
1728
- }
1729
- case "tool_execution_update": {
1730
- const component = this.toolPanels.getActive(event.toolCallId);
1731
- if (component) {
1732
- component.updateArgs(event.args, event.repair);
1733
- component.updateResult({ ...event.partialResult, isError: false }, true);
1734
- this.ui.requestRender();
1735
- }
1736
- break;
1737
- }
1738
- case "tool_execution_end": {
1739
- const component = this.toolPanels.getActive(event.toolCallId);
1740
- if (component) {
1741
- component.updateResult({ ...event.result, isError: event.isError });
1742
- this.toolPanels.registerAliases(component, getToolPanelResultActionKeys(this.getToolPanelScope(), event.toolName, event.result));
1743
- this.toolPanels.finish(event.toolCallId);
1744
- this.ui.requestRender();
1745
- }
1746
- break;
1747
- }
1748
- case "agent_end":
1749
- // Native in-process reflection fully replaces the subprocess learning paths
1750
- // (continuous-learning AND autonomy-review) when enabled; otherwise fall back to legacy.
1751
- if (this.isNativeReflectionEnabled()) {
1752
- this.maybeRunNativeReflection(event.messages);
1753
- }
1754
- else if (!this.maybeStartAutoLearn()) {
1755
- this.maybeStartAutonomyReview(event.messages);
1756
- }
1757
- if (this.settingsManager.getShowTerminalProgress()) {
1758
- this.ui.terminal.setProgress(false);
1759
- }
1760
- if (this.loadingAnimation) {
1761
- this.loadingAnimation.stop();
1762
- this.loadingAnimation = undefined;
1763
- this.statusContainer.clear();
1764
- }
1765
- if (this.streamingComponent) {
1766
- this.chatContainer.removeChild(this.streamingComponent);
1767
- this.streamingComponent = undefined;
1768
- this.streamingMessage = undefined;
1769
- }
1770
- this.clearActiveToolCalls();
1771
- await this.checkShutdownRequested();
1772
- this.ui.requestRender();
1773
- break;
1774
- case "compaction_start": {
1775
- if (this.settingsManager.getShowTerminalProgress()) {
1776
- this.ui.terminal.setProgress(true);
1777
- }
1778
- // Keep editor active; submissions are queued during compaction.
1779
- this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;
1780
- this.defaultEditor.onEscape = () => {
1781
- this.session.abortCompaction();
1782
- };
1783
- this.statusContainer.clear();
1784
- const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
1785
- const label = event.reason === "manual"
1786
- ? `Compacting context... ${cancelHint}`
1787
- : `${event.reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
1788
- this.autoCompactionLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), label);
1789
- this.statusContainer.addChild(this.autoCompactionLoader);
1790
- this.ui.requestRender();
1791
- break;
1792
- }
1793
- case "compaction_end": {
1794
- if (this.settingsManager.getShowTerminalProgress()) {
1795
- this.ui.terminal.setProgress(false);
1796
- }
1797
- if (this.autoCompactionEscapeHandler) {
1798
- this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;
1799
- this.autoCompactionEscapeHandler = undefined;
1800
- }
1801
- if (this.autoCompactionLoader) {
1802
- this.autoCompactionLoader.stop();
1803
- this.autoCompactionLoader = undefined;
1804
- this.statusContainer.clear();
1805
- }
1806
- if (event.aborted) {
1807
- if (event.reason === "manual") {
1808
- this.showError("Compaction cancelled");
1809
- }
1810
- else {
1811
- this.showStatus("Auto-compaction cancelled");
1812
- }
1813
- }
1814
- else if (event.result) {
1815
- await this.rebuildChatFromMessages();
1816
- this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
1817
- this.footer.invalidate();
1818
- }
1819
- else if (event.errorMessage) {
1820
- if (event.reason === "manual") {
1821
- this.showError(event.errorMessage);
1822
- }
1823
- else {
1824
- this.chatContainer.addChild(new Spacer(1));
1825
- this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
1826
- }
1827
- }
1828
- else if (event.skipReason) {
1829
- // Benign auto-compaction no-op: still tell the user WHY nothing changed —
1830
- // an invisible skip is indistinguishable from broken compaction.
1831
- this.showStatus(`Auto-compaction skipped: ${event.skipReason}`);
1832
- }
1833
- void this.flushCompactionQueue({ willRetry: event.willRetry });
1834
- this.ui.requestRender();
1835
- break;
1836
- }
1837
- case "auto_retry_start": {
1838
- // Set up escape to abort retry
1839
- this.retryEscapeHandler = this.defaultEditor.onEscape;
1840
- this.defaultEditor.onEscape = () => {
1841
- this.session.abortRetry();
1842
- };
1843
- // Show retry indicator
1844
- this.statusContainer.clear();
1845
- this.retryCountdown?.dispose();
1846
- const retryMessage = (seconds) => `Retrying (${event.attempt}/${event.maxAttempts}) in ${seconds}s... (${keyText("app.interrupt")} to cancel)`;
1847
- this.retryLoader = new Loader(this.ui, (spinner) => theme.fg("warning", spinner), (text) => theme.fg("muted", text), retryMessage(Math.ceil(event.delayMs / 1000)));
1848
- this.retryCountdown = new CountdownTimer(event.delayMs, this.ui, (seconds) => {
1849
- this.retryLoader?.setMessage(retryMessage(seconds));
1850
- }, () => {
1851
- this.retryCountdown = undefined;
1852
- });
1853
- this.statusContainer.addChild(this.retryLoader);
1854
- this.ui.requestRender();
1855
- break;
1856
- }
1857
- case "auto_retry_end": {
1858
- // Restore escape handler
1859
- if (this.retryEscapeHandler) {
1860
- this.defaultEditor.onEscape = this.retryEscapeHandler;
1861
- this.retryEscapeHandler = undefined;
1862
- }
1863
- if (this.retryCountdown) {
1864
- this.retryCountdown.dispose();
1865
- this.retryCountdown = undefined;
1866
- }
1867
- // Stop loader
1868
- if (this.retryLoader) {
1869
- this.retryLoader.stop();
1870
- this.retryLoader = undefined;
1871
- this.statusContainer.clear();
1872
- }
1873
- // Show error only on final failure (success shows normal response)
1874
- if (!event.success) {
1875
- this.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || "Unknown error"}`);
1876
- }
1877
- this.ui.requestRender();
1878
- break;
1879
- }
1880
- }
1494
+ handleEvent(event) {
1495
+ return handleInteractiveEvent(this, event);
1881
1496
  }
1882
1497
  /** Extract text content from a user message */
1883
1498
  // Thin `this.`-delegate to the pure formatter in ./history-reload-math.ts; kept so
@@ -2070,6 +1685,8 @@ export class InteractiveMode {
2070
1685
  * we update the previous status line instead of appending new ones to avoid log spam.
2071
1686
  */
2072
1687
  showStatus(message) {
1688
+ if (!this.hasHumanAudience)
1689
+ return;
2073
1690
  this.appendStatusToChat(message);
2074
1691
  }
2075
1692
  addMessageToChat(message, options) {
@@ -2152,7 +1769,9 @@ export class InteractiveMode {
2152
1769
  // Thin `this.`-delegate to the pure reload-window math in ./history-reload-math.ts;
2153
1770
  // kept so renderSessionContext and the prototype-based history tests resolve it via `this`.
2154
1771
  messagesForTuiHistoryReload(messages) {
2155
- return historyReloadMath.messagesForTuiHistoryReload(messages);
1772
+ return historyReloadMath.messagesForTuiHistoryReload(messages, {
1773
+ includeToolResultContent: this.toolOutputExpanded,
1774
+ });
2156
1775
  }
2157
1776
  /**
2158
1777
  * Render session context to chat. Used for initial load and rebuild after compaction.
@@ -2203,7 +1822,7 @@ export class InteractiveMode {
2203
1822
  // Render tool call components
2204
1823
  for (const content of message.content) {
2205
1824
  if (content.type === "toolCall") {
2206
- const component = this.attachToolExecutionComponent(content.name, content.id, content.arguments);
1825
+ const component = this.attachToolExecutionComponent(content.name, content.id, content.arguments, undefined, true);
2207
1826
  if (message.stopReason === "aborted" || message.stopReason === "error") {
2208
1827
  let errorMessage;
2209
1828
  if (message.stopReason === "aborted") {
@@ -2580,20 +2199,28 @@ export class InteractiveMode {
2580
2199
  }
2581
2200
  updatePendingMessagesDisplay() {
2582
2201
  this.pendingMessagesContainer.clear();
2202
+ for (const component of this.pendingBashComponents)
2203
+ this.pendingMessagesContainer.addChild(component);
2583
2204
  const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
2584
- if (steeringMessages.length > 0 || followUpMessages.length > 0) {
2585
- this.pendingMessagesContainer.addChild(new Spacer(1));
2586
- for (const message of steeringMessages) {
2587
- const text = theme.fg("dim", `Steering: ${message}`);
2588
- this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
2589
- }
2590
- for (const message of followUpMessages) {
2591
- const text = theme.fg("dim", `Follow-up: ${message}`);
2592
- this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
2593
- }
2205
+ const steeringCount = steeringMessages.length;
2206
+ const followUpCount = followUpMessages.length;
2207
+ const total = steeringCount + followUpCount;
2208
+ if (total > 0) {
2594
2209
  const dequeueHint = this.getAppKeyDisplay("app.message.dequeue");
2595
- const hintText = theme.fg("dim", `↳ ${dequeueHint} to edit all queued messages`);
2596
- this.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));
2210
+ const details = [
2211
+ steeringCount > 0 ? `${steeringCount} steering` : undefined,
2212
+ followUpCount > 0 ? `${followUpCount} follow-up` : undefined,
2213
+ ]
2214
+ .filter((value) => value !== undefined)
2215
+ .join(" · ");
2216
+ this.activityLane?.wait({
2217
+ id: "queue:messages",
2218
+ kind: "queue",
2219
+ label: `Queued ${total} · ${details} · ${dequeueHint} edit`,
2220
+ });
2221
+ }
2222
+ else {
2223
+ this.activityLane?.remove("queue:messages");
2597
2224
  }
2598
2225
  }
2599
2226
  restoreQueuedMessagesToEditor(options) {
@@ -2690,6 +2317,7 @@ export class InteractiveMode {
2690
2317
  showSelector: (create) => this.showSelector(create),
2691
2318
  showStatus: (message) => this.showStatus(message),
2692
2319
  showError: (message) => this.showError(message),
2320
+ refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
2693
2321
  renderCurrentSessionState: () => this.renderCurrentSessionState(),
2694
2322
  renderInitialMessages: (options) => this.renderInitialMessages(options),
2695
2323
  flushCompactionQueue: (options) => this.flushCompactionQueue(options),
@@ -3210,7 +2838,7 @@ export class InteractiveMode {
3210
2838
  }, text);
3211
2839
  }
3212
2840
  parseGoalContinueCommand(text) {
3213
- const usage = "Usage: /goal-continue [maxTurns 1-20] [maxStallTurns 0-100] [maxMinutes 0-1440]";
2841
+ const usage = "Usage: /goal-continue [maxTurns 0=unbounded] [maxStallTurns 0-100] [maxMinutes 0-1440]";
3214
2842
  const parts = text.trim().split(/\s+/).slice(1);
3215
2843
  if (parts.length > 3) {
3216
2844
  return { ok: false, error: usage };
@@ -3225,7 +2853,7 @@ export class InteractiveMode {
3225
2853
  return undefined;
3226
2854
  return parsed;
3227
2855
  };
3228
- const maxTurns = parseBoundedInteger(parts[0], DEFAULT_GOAL_CONTINUE_MAX_TURNS, 1, MAX_GOAL_CONTINUE_MAX_TURNS);
2856
+ const maxTurns = parseBoundedInteger(parts[0], DEFAULT_GOAL_CONTINUE_MAX_TURNS, 0, MAX_GOAL_CONTINUE_MAX_TURNS);
3229
2857
  const maxStallTurns = parseBoundedInteger(parts[1], DEFAULT_GOAL_CONTINUE_MAX_STALL_TURNS, 0, MAX_GOAL_CONTINUE_MAX_STALL_TURNS);
3230
2858
  const maxWallClockMinutes = parseBoundedInteger(parts[2], DEFAULT_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, 0, MAX_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES);
3231
2859
  if (maxTurns === undefined || maxStallTurns === undefined || maxWallClockMinutes === undefined) {
@@ -3234,28 +2862,45 @@ export class InteractiveMode {
3234
2862
  return { ok: true, maxTurns, maxStallTurns, maxWallClockMinutes };
3235
2863
  }
3236
2864
  async handleGoalCommand(text) {
2865
+ let statusMessage;
3237
2866
  await sessionFlows.handleGoalCommand({
3238
2867
  session: this.session,
3239
- showStatus: (message) => this.showStatus(message),
2868
+ promptForGoalEdit: (currentObjective) => this.extensionUiHost.showExtensionEditor("Edit goal objective", currentObjective),
2869
+ getMaxStallTurns: () => this.settingsManager?.getAutonomySettings().maxStallTurns ?? 20,
2870
+ showStatus: (message) => {
2871
+ statusMessage = message;
2872
+ },
3240
2873
  showError: (message) => this.showError(message),
3241
2874
  refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
3242
2875
  }, text);
2876
+ this.refreshActivityLane?.();
2877
+ if (statusMessage)
2878
+ this.activityLane?.announce(statusMessage, "neutral");
3243
2879
  }
3244
2880
  handleTaskCommand(text) {
2881
+ let statusMessage;
3245
2882
  sessionFlows.handleTaskCommand({
3246
2883
  session: this.session,
3247
- showStatus: (message) => this.showStatus(message),
2884
+ showStatus: (message) => {
2885
+ statusMessage = message;
2886
+ },
3248
2887
  showError: (message) => this.showError(message),
3249
2888
  }, text);
2889
+ this.refreshActivityLane?.();
2890
+ const state = this.session.getTaskStepsStateSnapshot();
2891
+ if ((!state || state.steps.length === 0 || statusMessage?.startsWith("/task ")) && statusMessage) {
2892
+ this.activityLane?.announce(statusMessage, "neutral");
2893
+ }
3250
2894
  }
3251
2895
  async handleGoalContinueCommand(text) {
3252
2896
  await sessionFlows.handleGoalContinueCommand({
3253
2897
  session: this.session,
3254
2898
  parseGoalContinueCommand: (t) => this.parseGoalContinueCommand(t),
3255
- showStatus: (message) => this.showStatus(message),
2899
+ showStatus: (message) => this.activityLane?.announce(message),
3256
2900
  showError: (message) => this.showError(message),
3257
2901
  refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
3258
2902
  }, text);
2903
+ this.refreshActivityLane?.();
3259
2904
  }
3260
2905
  handleSessionCommand() {
3261
2906
  sessionFlows.handleSessionCommand({
@@ -3273,6 +2918,15 @@ export class InteractiveMode {
3273
2918
  getCurrentAutoLearnSettings: () => this.getCurrentAutoLearnSettings(),
3274
2919
  });
3275
2920
  }
2921
+ handleUsageMenuCommand() {
2922
+ usageCommands.handleUsageMenuCommand({
2923
+ session: this.session,
2924
+ showSelector: (create) => this.showSelector(create),
2925
+ showStatus: (message) => this.showStatus(message),
2926
+ showError: (message) => this.showError(message),
2927
+ showUsageReport: () => this.handleUsageCommand(),
2928
+ });
2929
+ }
3276
2930
  handleChangelogCommand() {
3277
2931
  reportCommands.handleChangelogCommand({
3278
2932
  chatContainer: this.chatContainer,
@@ -3324,6 +2978,8 @@ export class InteractiveMode {
3324
2978
  this.ui.requestRender();
3325
2979
  }
3326
2980
  catch (error) {
2981
+ if (this.handleNonFatalSessionReplacementError(error))
2982
+ return;
3327
2983
  await this.handleFatalRuntimeError("Failed to create session", error);
3328
2984
  }
3329
2985
  }
@@ -3422,17 +3078,9 @@ export class InteractiveMode {
3422
3078
  }, command, excludeFromContext);
3423
3079
  }
3424
3080
  handleCompactCommand(customInstructions) {
3425
- const self = this;
3426
3081
  return resourceShellCommands.handleCompactCommand({
3427
3082
  sessionManager: this.sessionManager,
3428
3083
  showWarning: (message) => this.showWarning(message),
3429
- get loadingAnimation() {
3430
- return self.loadingAnimation;
3431
- },
3432
- set loadingAnimation(value) {
3433
- self.loadingAnimation = value;
3434
- },
3435
- statusContainer: this.statusContainer,
3436
3084
  session: this.session,
3437
3085
  }, customInstructions);
3438
3086
  }
@@ -3446,8 +3094,10 @@ export class InteractiveMode {
3446
3094
  this.loadingAnimation = undefined;
3447
3095
  }
3448
3096
  this.authDialogs.cancelActiveDialog();
3097
+ this.extensionUiHost.clearHostWidgets();
3449
3098
  this.extensionUiHost.resetExtensionUI();
3450
3099
  this.overlayHost.unmount();
3100
+ this.activityLane?.dispose();
3451
3101
  this.footer.dispose();
3452
3102
  this.footerDataProvider.dispose();
3453
3103
  if (this.unsubscribe) {