@bastani/atomic 0.10.2 → 0.10.3

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 (499) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +22 -0
  3. package/dist/builtin/intercom/broker/broker-instance.ts +2 -13
  4. package/dist/builtin/intercom/broker/broker.ts +158 -73
  5. package/dist/builtin/intercom/broker/durable-ended-queue.ts +14 -2
  6. package/dist/builtin/intercom/broker/host-command-environment.ts +13 -0
  7. package/dist/builtin/intercom/broker/hosted-session-errors.ts +1 -0
  8. package/dist/builtin/intercom/broker/multinode-router.ts +111 -16
  9. package/dist/builtin/intercom/broker/multinode-state-store.ts +50 -4
  10. package/dist/builtin/intercom/broker/open-broker-state.ts +5 -4
  11. package/dist/builtin/intercom/broker/spawn.ts +144 -25
  12. package/dist/builtin/intercom/broker/sql-add-column.ts +33 -0
  13. package/dist/builtin/intercom/broker/sql-known-session-store.ts +120 -36
  14. package/dist/builtin/intercom/broker/sql-outbox-store.ts +75 -13
  15. package/dist/builtin/intercom/broker/start-announcement.ts +55 -10
  16. package/dist/builtin/intercom/broker/watchdog.ts +10 -7
  17. package/dist/builtin/intercom/index.bundle.mjs +111 -27
  18. package/dist/builtin/intercom/package.json +1 -1
  19. package/dist/builtin/mcp/package.json +1 -1
  20. package/dist/builtin/subagents/CHANGELOG.md +26 -0
  21. package/dist/builtin/subagents/package.json +1 -1
  22. package/dist/builtin/subagents/skills/skill-creator/SKILL.md +30 -52
  23. package/dist/builtin/subagents/skills/skill-creator/eval-viewer/generate_review.py +34 -40
  24. package/dist/builtin/subagents/skills/skill-creator/eval-viewer/viewer.html +2 -2
  25. package/dist/builtin/subagents/skills/skill-creator/scripts/atomic_cli.py +731 -0
  26. package/dist/builtin/subagents/skills/skill-creator/scripts/generate_report.py +3 -3
  27. package/dist/builtin/subagents/skills/skill-creator/scripts/improve_description.py +41 -38
  28. package/dist/builtin/subagents/skills/skill-creator/scripts/run_eval.py +276 -176
  29. package/dist/builtin/subagents/skills/skill-creator/scripts/run_loop.py +20 -11
  30. package/dist/builtin/subagents/skills/skill-creator/scripts/utils.py +1 -1
  31. package/dist/builtin/subagents/src/extension/index.bundle.mjs +163 -97
  32. package/dist/builtin/web-access/CHANGELOG.md +14 -0
  33. package/dist/builtin/web-access/index.bundle.mjs +5 -4
  34. package/dist/builtin/web-access/package.json +1 -1
  35. package/dist/core/agent-session-auto-compaction.d.ts +10 -1
  36. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  37. package/dist/core/agent-session-auto-compaction.js +54 -2
  38. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  39. package/dist/core/agent-session-compaction.d.ts +4 -0
  40. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  41. package/dist/core/agent-session-compaction.js +17 -2
  42. package/dist/core/agent-session-compaction.js.map +1 -1
  43. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  44. package/dist/core/agent-session-custom-message-commit.js +3 -1
  45. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  46. package/dist/core/agent-session-events.d.ts +2 -0
  47. package/dist/core/agent-session-events.d.ts.map +1 -1
  48. package/dist/core/agent-session-events.js +34 -13
  49. package/dist/core/agent-session-events.js.map +1 -1
  50. package/dist/core/agent-session-export.d.ts.map +1 -1
  51. package/dist/core/agent-session-export.js +3 -0
  52. package/dist/core/agent-session-export.js.map +1 -1
  53. package/dist/core/agent-session-message-queue.d.ts +27 -0
  54. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  55. package/dist/core/agent-session-message-queue.js +213 -30
  56. package/dist/core/agent-session-message-queue.js.map +1 -1
  57. package/dist/core/agent-session-methods.d.ts +6 -1
  58. package/dist/core/agent-session-methods.d.ts.map +1 -1
  59. package/dist/core/agent-session-methods.js.map +1 -1
  60. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  61. package/dist/core/agent-session-prompt.js +35 -3
  62. package/dist/core/agent-session-prompt.js.map +1 -1
  63. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  64. package/dist/core/agent-session-runtime.js +2 -2
  65. package/dist/core/agent-session-runtime.js.map +1 -1
  66. package/dist/core/agent-session-state.d.ts.map +1 -1
  67. package/dist/core/agent-session-state.js +6 -1
  68. package/dist/core/agent-session-state.js.map +1 -1
  69. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  70. package/dist/core/agent-session-tool-hooks.js +15 -2
  71. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  72. package/dist/core/agent-session-typed-queue.d.ts +14 -1
  73. package/dist/core/agent-session-typed-queue.d.ts.map +1 -1
  74. package/dist/core/agent-session-typed-queue.js +26 -1
  75. package/dist/core/agent-session-typed-queue.js.map +1 -1
  76. package/dist/core/agent-session-types.d.ts +5 -0
  77. package/dist/core/agent-session-types.d.ts.map +1 -1
  78. package/dist/core/agent-session-types.js.map +1 -1
  79. package/dist/core/agent-session.d.ts.map +1 -1
  80. package/dist/core/agent-session.js +2 -1
  81. package/dist/core/agent-session.js.map +1 -1
  82. package/dist/core/async-scope.d.ts +9 -4
  83. package/dist/core/async-scope.d.ts.map +1 -1
  84. package/dist/core/async-scope.js +13 -5
  85. package/dist/core/async-scope.js.map +1 -1
  86. package/dist/core/builtin-diagnostics.js +2 -2
  87. package/dist/core/builtin-diagnostics.js.map +1 -1
  88. package/dist/core/chat-admission-order.d.ts.map +1 -1
  89. package/dist/core/chat-admission-order.js +2 -1
  90. package/dist/core/chat-admission-order.js.map +1 -1
  91. package/dist/core/chat-record-saves.d.ts +4 -0
  92. package/dist/core/chat-record-saves.d.ts.map +1 -0
  93. package/dist/core/chat-record-saves.js +25 -0
  94. package/dist/core/chat-record-saves.js.map +1 -0
  95. package/dist/core/command-deliveries.d.ts +62 -0
  96. package/dist/core/command-deliveries.d.ts.map +1 -0
  97. package/dist/core/command-deliveries.js +139 -0
  98. package/dist/core/command-deliveries.js.map +1 -0
  99. package/dist/core/diagnostic-writer.d.ts.map +1 -1
  100. package/dist/core/diagnostic-writer.js +5 -4
  101. package/dist/core/diagnostic-writer.js.map +1 -1
  102. package/dist/core/extension-startup-close.d.ts +1 -2
  103. package/dist/core/extension-startup-close.d.ts.map +1 -1
  104. package/dist/core/extension-startup-close.js +2 -2
  105. package/dist/core/extension-startup-close.js.map +1 -1
  106. package/dist/core/extensions/jiti-aliases.d.ts +11 -0
  107. package/dist/core/extensions/jiti-aliases.d.ts.map +1 -0
  108. package/dist/core/extensions/jiti-aliases.js +28 -0
  109. package/dist/core/extensions/jiti-aliases.js.map +1 -0
  110. package/dist/core/extensions/loader-api.js +3 -3
  111. package/dist/core/extensions/loader-api.js.map +1 -1
  112. package/dist/core/extensions/loader-bindings.js +2 -2
  113. package/dist/core/extensions/loader-bindings.js.map +1 -1
  114. package/dist/core/extensions/loader-rollback.d.ts +1 -2
  115. package/dist/core/extensions/loader-rollback.d.ts.map +1 -1
  116. package/dist/core/extensions/loader-rollback.js +2 -2
  117. package/dist/core/extensions/loader-rollback.js.map +1 -1
  118. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  119. package/dist/core/extensions/loader-virtual-modules.js +53 -9
  120. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  121. package/dist/core/extensions/native-builtin-entries.d.ts +5 -0
  122. package/dist/core/extensions/native-builtin-entries.d.ts.map +1 -1
  123. package/dist/core/extensions/native-builtin-entries.js +8 -1
  124. package/dist/core/extensions/native-builtin-entries.js.map +1 -1
  125. package/dist/core/extensions/reloadable-scripts.d.ts +21 -2
  126. package/dist/core/extensions/reloadable-scripts.d.ts.map +1 -1
  127. package/dist/core/extensions/reloadable-scripts.js +11 -3
  128. package/dist/core/extensions/reloadable-scripts.js.map +1 -1
  129. package/dist/core/extensions/source-builtin-imports.d.ts +40 -0
  130. package/dist/core/extensions/source-builtin-imports.d.ts.map +1 -0
  131. package/dist/core/extensions/source-builtin-imports.js +142 -0
  132. package/dist/core/extensions/source-builtin-imports.js.map +1 -0
  133. package/dist/core/extensions/transform-graph.d.ts +15 -0
  134. package/dist/core/extensions/transform-graph.d.ts.map +1 -0
  135. package/dist/core/extensions/transform-graph.js +85 -0
  136. package/dist/core/extensions/transform-graph.js.map +1 -0
  137. package/dist/core/extensions/ts-source-specifiers.d.ts +2 -0
  138. package/dist/core/extensions/ts-source-specifiers.d.ts.map +1 -1
  139. package/dist/core/extensions/ts-source-specifiers.js +7 -0
  140. package/dist/core/extensions/ts-source-specifiers.js.map +1 -1
  141. package/dist/core/extensions/ts-transform-worker.d.ts +2 -0
  142. package/dist/core/extensions/ts-transform-worker.d.ts.map +1 -0
  143. package/dist/core/extensions/ts-transform-worker.js +43 -0
  144. package/dist/core/extensions/ts-transform-worker.js.map +1 -0
  145. package/dist/core/message-admission.d.ts.map +1 -1
  146. package/dist/core/message-admission.js +4 -4
  147. package/dist/core/message-admission.js.map +1 -1
  148. package/dist/core/messages.d.ts +5 -0
  149. package/dist/core/messages.d.ts.map +1 -1
  150. package/dist/core/messages.js +35 -0
  151. package/dist/core/messages.js.map +1 -1
  152. package/dist/core/model-fallback-failures.d.ts +1 -1
  153. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  154. package/dist/core/model-fallback-failures.js +18 -1
  155. package/dist/core/model-fallback-failures.js.map +1 -1
  156. package/dist/core/process-start-token.d.ts +7 -0
  157. package/dist/core/process-start-token.d.ts.map +1 -1
  158. package/dist/core/process-start-token.js +14 -0
  159. package/dist/core/process-start-token.js.map +1 -1
  160. package/dist/core/project-trust-electorate.d.ts +24 -0
  161. package/dist/core/project-trust-electorate.d.ts.map +1 -0
  162. package/dist/core/project-trust-electorate.js +52 -0
  163. package/dist/core/project-trust-electorate.js.map +1 -0
  164. package/dist/core/project-trust-state.d.ts +15 -0
  165. package/dist/core/project-trust-state.d.ts.map +1 -1
  166. package/dist/core/project-trust-state.js +15 -0
  167. package/dist/core/project-trust-state.js.map +1 -1
  168. package/dist/core/provider-request-admission.d.ts.map +1 -1
  169. package/dist/core/provider-request-admission.js +2 -2
  170. package/dist/core/provider-request-admission.js.map +1 -1
  171. package/dist/core/queued-input-admission.js +2 -2
  172. package/dist/core/queued-input-admission.js.map +1 -1
  173. package/dist/core/queued-message-delivery.d.ts +2 -2
  174. package/dist/core/queued-message-delivery.d.ts.map +1 -1
  175. package/dist/core/queued-message-delivery.js +6 -3
  176. package/dist/core/queued-message-delivery.js.map +1 -1
  177. package/dist/core/resource-admission-scope.js +2 -2
  178. package/dist/core/resource-admission-scope.js.map +1 -1
  179. package/dist/core/resume/blueprint/process.d.ts +3 -4
  180. package/dist/core/resume/blueprint/process.d.ts.map +1 -1
  181. package/dist/core/resume/blueprint/process.js +33 -17
  182. package/dist/core/resume/blueprint/process.js.map +1 -1
  183. package/dist/core/resume/path-mapping.js +4 -4
  184. package/dist/core/resume/path-mapping.js.map +1 -1
  185. package/dist/core/resume/session-resume.d.ts +9 -0
  186. package/dist/core/resume/session-resume.d.ts.map +1 -1
  187. package/dist/core/resume/session-resume.js +27 -2
  188. package/dist/core/resume/session-resume.js.map +1 -1
  189. package/dist/core/resume-cache-checkpoint.d.ts +27 -1
  190. package/dist/core/resume-cache-checkpoint.d.ts.map +1 -1
  191. package/dist/core/resume-cache-checkpoint.js +45 -0
  192. package/dist/core/resume-cache-checkpoint.js.map +1 -1
  193. package/dist/core/sdk.d.ts.map +1 -1
  194. package/dist/core/sdk.js +7 -31
  195. package/dist/core/sdk.js.map +1 -1
  196. package/dist/core/session-lifecycle-scope.d.ts +1 -2
  197. package/dist/core/session-lifecycle-scope.d.ts.map +1 -1
  198. package/dist/core/session-lifecycle-scope.js +2 -2
  199. package/dist/core/session-lifecycle-scope.js.map +1 -1
  200. package/dist/core/session-lifecycle-work.js +2 -2
  201. package/dist/core/session-lifecycle-work.js.map +1 -1
  202. package/dist/core/session-manager-core.d.ts.map +1 -1
  203. package/dist/core/session-manager-core.js +3 -0
  204. package/dist/core/session-manager-core.js.map +1 -1
  205. package/dist/core/session-storage.d.ts +12 -0
  206. package/dist/core/session-storage.d.ts.map +1 -1
  207. package/dist/core/session-storage.js +68 -1
  208. package/dist/core/session-storage.js.map +1 -1
  209. package/dist/core/settings-lock-directory.d.ts.map +1 -1
  210. package/dist/core/settings-lock-directory.js +4 -3
  211. package/dist/core/settings-lock-directory.js.map +1 -1
  212. package/dist/core/settings-write-ownership.d.ts +1 -2
  213. package/dist/core/settings-write-ownership.d.ts.map +1 -1
  214. package/dist/core/settings-write-ownership.js +2 -2
  215. package/dist/core/settings-write-ownership.js.map +1 -1
  216. package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -1
  217. package/dist/core/storage/node-sqlite-thread.js +6 -4
  218. package/dist/core/storage/node-sqlite-thread.js.map +1 -1
  219. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  220. package/dist/core/storage/node-sqlite.js +22 -8
  221. package/dist/core/storage/node-sqlite.js.map +1 -1
  222. package/dist/core/system-prompt.d.ts +16 -2
  223. package/dist/core/system-prompt.d.ts.map +1 -1
  224. package/dist/core/system-prompt.js +33 -6
  225. package/dist/core/system-prompt.js.map +1 -1
  226. package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
  227. package/dist/core/tasks/agent-adapter.js +2 -1
  228. package/dist/core/tasks/agent-adapter.js.map +1 -1
  229. package/dist/core/tasks/completion.d.ts +3 -2
  230. package/dist/core/tasks/completion.d.ts.map +1 -1
  231. package/dist/core/tasks/completion.js.map +1 -1
  232. package/dist/core/tasks/execution-scope.js +2 -2
  233. package/dist/core/tasks/execution-scope.js.map +1 -1
  234. package/dist/core/tools/bash.d.ts.map +1 -1
  235. package/dist/core/tools/bash.js +2 -1
  236. package/dist/core/tools/bash.js.map +1 -1
  237. package/dist/core/tools/history-regex-worker.d.ts.map +1 -1
  238. package/dist/core/tools/history-regex-worker.js +3 -2
  239. package/dist/core/tools/history-regex-worker.js.map +1 -1
  240. package/dist/core/tools/shell-task-render.d.ts +3 -2
  241. package/dist/core/tools/shell-task-render.d.ts.map +1 -1
  242. package/dist/core/tools/shell-task-render.js +7 -5
  243. package/dist/core/tools/shell-task-render.js.map +1 -1
  244. package/dist/core/tools/shell-task-status.d.ts +6 -2
  245. package/dist/core/tools/shell-task-status.d.ts.map +1 -1
  246. package/dist/core/tools/shell-task-status.js +13 -8
  247. package/dist/core/tools/shell-task-status.js.map +1 -1
  248. package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
  249. package/dist/core/tools/sqlite-selector-connection.js +4 -3
  250. package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
  251. package/dist/core/tools/windows-directory-security.d.ts.map +1 -1
  252. package/dist/core/tools/windows-directory-security.js +2 -1
  253. package/dist/core/tools/windows-directory-security.js.map +1 -1
  254. package/dist/core/worktree-snapshot/git.js +2 -2
  255. package/dist/core/worktree-snapshot/git.js.map +1 -1
  256. package/dist/extensions/mcp/index.d.ts +6 -1
  257. package/dist/extensions/mcp/index.d.ts.map +1 -1
  258. package/dist/extensions/mcp/index.js +150 -18
  259. package/dist/extensions/mcp/index.js.map +1 -1
  260. package/dist/extensions/mcp/tool-records.d.ts +44 -9
  261. package/dist/extensions/mcp/tool-records.d.ts.map +1 -1
  262. package/dist/extensions/mcp/tool-records.js +58 -16
  263. package/dist/extensions/mcp/tool-records.js.map +1 -1
  264. package/dist/index.d.ts +2 -0
  265. package/dist/index.d.ts.map +1 -1
  266. package/dist/index.js +4 -0
  267. package/dist/index.js.map +1 -1
  268. package/dist/main-session.d.ts +3 -1
  269. package/dist/main-session.d.ts.map +1 -1
  270. package/dist/main-session.js +1 -0
  271. package/dist/main-session.js.map +1 -1
  272. package/dist/main.d.ts.map +1 -1
  273. package/dist/main.js +230 -96
  274. package/dist/main.js.map +1 -1
  275. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +5 -0
  276. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts.map +1 -1
  277. package/dist/modes/interactive/agent-view/agent-view-bridge.js.map +1 -1
  278. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +5 -2
  279. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
  280. package/dist/modes/interactive/agent-view/agent-view-switcher.js +3 -3
  281. package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
  282. package/dist/modes/interactive/agent-view/contracts.d.ts +6 -0
  283. package/dist/modes/interactive/agent-view/contracts.d.ts.map +1 -1
  284. package/dist/modes/interactive/agent-view/contracts.js.map +1 -1
  285. package/dist/modes/interactive/agent-view/install.d.ts.map +1 -1
  286. package/dist/modes/interactive/agent-view/install.js +2 -1
  287. package/dist/modes/interactive/agent-view/install.js.map +1 -1
  288. package/dist/modes/interactive/agent-view/open-port.d.ts +4 -2
  289. package/dist/modes/interactive/agent-view/open-port.d.ts.map +1 -1
  290. package/dist/modes/interactive/agent-view/open-port.js +4 -3
  291. package/dist/modes/interactive/agent-view/open-port.js.map +1 -1
  292. package/dist/modes/interactive/agent-view/prompt-retarget.d.ts.map +1 -1
  293. package/dist/modes/interactive/agent-view/prompt-retarget.js +18 -5
  294. package/dist/modes/interactive/agent-view/prompt-retarget.js.map +1 -1
  295. package/dist/modes/interactive/agent-view/remote-port.d.ts +10 -1
  296. package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
  297. package/dist/modes/interactive/agent-view/remote-port.js +36 -4
  298. package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
  299. package/dist/modes/interactive/agent-view/viewed-keys.d.ts +56 -0
  300. package/dist/modes/interactive/agent-view/viewed-keys.d.ts.map +1 -0
  301. package/dist/modes/interactive/agent-view/viewed-keys.js +63 -0
  302. package/dist/modes/interactive/agent-view/viewed-keys.js.map +1 -0
  303. package/dist/modes/interactive/agent-view/viewed-submit.d.ts +14 -4
  304. package/dist/modes/interactive/agent-view/viewed-submit.d.ts.map +1 -1
  305. package/dist/modes/interactive/agent-view/viewed-submit.js +51 -17
  306. package/dist/modes/interactive/agent-view/viewed-submit.js.map +1 -1
  307. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  308. package/dist/modes/interactive/components/agent-panel.js +8 -21
  309. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  310. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  311. package/dist/modes/interactive/components/chat-session-host-actions.js +18 -5
  312. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  313. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  314. package/dist/modes/interactive/components/chat-session-host-rendering.js +6 -0
  315. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  316. package/dist/modes/interactive/components/chat-session-host-state.d.ts +1 -0
  317. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  318. package/dist/modes/interactive/components/chat-session-host-state.js +2 -0
  319. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  320. package/dist/modes/interactive/components/chat-session-host-types.d.ts +5 -0
  321. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  322. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  323. package/dist/modes/interactive/components/custom-editor.d.ts +33 -2
  324. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  325. package/dist/modes/interactive/components/custom-editor.js +58 -2
  326. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  327. package/dist/modes/interactive/components/host-session-picker.js +2 -2
  328. package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
  329. package/dist/modes/interactive/components/main-composer-keys.d.ts +16 -5
  330. package/dist/modes/interactive/components/main-composer-keys.d.ts.map +1 -1
  331. package/dist/modes/interactive/components/main-composer-keys.js +27 -8
  332. package/dist/modes/interactive/components/main-composer-keys.js.map +1 -1
  333. package/dist/modes/interactive/components/notice-line.d.ts +8 -25
  334. package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
  335. package/dist/modes/interactive/components/notice-line.js +18 -17
  336. package/dist/modes/interactive/components/notice-line.js.map +1 -1
  337. package/dist/modes/interactive/components/prompt-slot.d.ts +20 -3
  338. package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -1
  339. package/dist/modes/interactive/components/prompt-slot.js +82 -32
  340. package/dist/modes/interactive/components/prompt-slot.js.map +1 -1
  341. package/dist/modes/interactive/components/queued-messages-view.d.ts +5 -2
  342. package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
  343. package/dist/modes/interactive/components/queued-messages-view.js +12 -5
  344. package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
  345. package/dist/modes/interactive/components/task-board.d.ts +5 -8
  346. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  347. package/dist/modes/interactive/components/task-board.js +5 -49
  348. package/dist/modes/interactive/components/task-board.js.map +1 -1
  349. package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -1
  350. package/dist/modes/interactive/components/task-completion-message.js +9 -2
  351. package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
  352. package/dist/modes/interactive/components/task-marks.d.ts +19 -0
  353. package/dist/modes/interactive/components/task-marks.d.ts.map +1 -0
  354. package/dist/modes/interactive/components/task-marks.js +25 -0
  355. package/dist/modes/interactive/components/task-marks.js.map +1 -0
  356. package/dist/modes/interactive/components/task-row.d.ts +10 -2
  357. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  358. package/dist/modes/interactive/components/task-row.js +39 -32
  359. package/dist/modes/interactive/components/task-row.js.map +1 -1
  360. package/dist/modes/interactive/components/task-transcript-page.d.ts +7 -0
  361. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  362. package/dist/modes/interactive/components/task-transcript-page.js +106 -10
  363. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  364. package/dist/modes/interactive/components/tool-block-families.d.ts.map +1 -1
  365. package/dist/modes/interactive/components/tool-block-families.js +8 -9
  366. package/dist/modes/interactive/components/tool-block-families.js.map +1 -1
  367. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  368. package/dist/modes/interactive/components/tool-execution.js +5 -1
  369. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  370. package/dist/modes/interactive/extension-command-hold.d.ts.map +1 -1
  371. package/dist/modes/interactive/extension-command-hold.js +5 -7
  372. package/dist/modes/interactive/extension-command-hold.js.map +1 -1
  373. package/dist/modes/interactive/interactive-extension-dialogs.js +6 -1
  374. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  375. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  376. package/dist/modes/interactive/interactive-extension-runtime.js +21 -7
  377. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  378. package/dist/modes/interactive/interactive-initial-session-binding.d.ts +1 -2
  379. package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -1
  380. package/dist/modes/interactive/interactive-initial-session-binding.js +2 -2
  381. package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -1
  382. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  383. package/dist/modes/interactive/interactive-input-handling.js +13 -4
  384. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  385. package/dist/modes/interactive/interactive-mode-base.d.ts +2 -1
  386. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  387. package/dist/modes/interactive/interactive-mode-base.js +6 -1
  388. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  389. package/dist/modes/interactive/interactive-mode-helpers.d.ts +4 -2
  390. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  391. package/dist/modes/interactive/interactive-mode-helpers.js +6 -0
  392. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  393. package/dist/modes/interactive/interactive-mode-surface.d.ts +5 -0
  394. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  395. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  396. package/dist/modes/interactive/interactive-process-lifecycle.js +96 -17
  397. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  398. package/dist/modes/interactive/interactive-queueing.d.ts +5 -0
  399. package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
  400. package/dist/modes/interactive/interactive-queueing.js +37 -5
  401. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  402. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  403. package/dist/modes/interactive/interactive-render-chat.js +45 -4
  404. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  405. package/dist/modes/interactive/interactive-resource-disclosure.d.ts +4 -1
  406. package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
  407. package/dist/modes/interactive/interactive-resource-disclosure.js +20 -1
  408. package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
  409. package/dist/modes/interactive/interactive-resource-rendering.js +3 -0
  410. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  411. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  412. package/dist/modes/interactive/interactive-startup.js +43 -5
  413. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  414. package/dist/modes/interactive-engine/activity-watchdog.d.ts +6 -3
  415. package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
  416. package/dist/modes/interactive-engine/activity-watchdog.js +3 -2
  417. package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
  418. package/dist/modes/interactive-engine/engine-health.d.ts +2 -0
  419. package/dist/modes/interactive-engine/engine-health.d.ts.map +1 -1
  420. package/dist/modes/interactive-engine/engine-health.js.map +1 -1
  421. package/dist/modes/interactive-engine/engine-quit-intent.d.ts +10 -0
  422. package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
  423. package/dist/modes/interactive-engine/engine-quit-intent.js +33 -0
  424. package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
  425. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +7 -1
  426. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  427. package/dist/modes/interactive-engine/extension-ui-bridge.js +15 -2
  428. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  429. package/dist/modes/interactive-engine/host-listener-failures.d.ts +24 -0
  430. package/dist/modes/interactive-engine/host-listener-failures.d.ts.map +1 -0
  431. package/dist/modes/interactive-engine/host-listener-failures.js +98 -0
  432. package/dist/modes/interactive-engine/host-listener-failures.js.map +1 -0
  433. package/dist/modes/interactive-engine/isolated-runtime.d.ts +16 -0
  434. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  435. package/dist/modes/interactive-engine/isolated-runtime.js +74 -7
  436. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  437. package/dist/modes/interactive-engine/protocol.d.ts +5 -0
  438. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  439. package/dist/modes/interactive-engine/protocol.js +8 -2
  440. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  441. package/dist/modes/interactive-engine/remote-component.d.ts +13 -0
  442. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  443. package/dist/modes/interactive-engine/remote-component.js +69 -4
  444. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  445. package/dist/modes/print-mode.d.ts.map +1 -1
  446. package/dist/modes/print-mode.js +34 -6
  447. package/dist/modes/print-mode.js.map +1 -1
  448. package/dist/modes/rpc/agent-panel-bridge.d.ts +7 -0
  449. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  450. package/dist/modes/rpc/agent-panel-bridge.js +11 -1
  451. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  452. package/dist/modes/rpc/agent-view-rpc-panel.d.ts.map +1 -1
  453. package/dist/modes/rpc/agent-view-rpc-panel.js +11 -5
  454. package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
  455. package/dist/modes/rpc/rpc-client-process.d.ts +8 -1
  456. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  457. package/dist/modes/rpc/rpc-client-process.js +89 -65
  458. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  459. package/dist/modes/rpc/rpc-client.d.ts +21 -0
  460. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  461. package/dist/modes/rpc/rpc-client.js +77 -33
  462. package/dist/modes/rpc/rpc-client.js.map +1 -1
  463. package/dist/modes/rpc/rpc-event-buffer.d.ts +5 -0
  464. package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -1
  465. package/dist/modes/rpc/rpc-event-buffer.js +8 -2
  466. package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
  467. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  468. package/dist/modes/rpc/rpc-mode.js +9 -2
  469. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  470. package/dist/utils/shell.d.ts +5 -1
  471. package/dist/utils/shell.d.ts.map +1 -1
  472. package/dist/utils/shell.js +14 -7
  473. package/dist/utils/shell.js.map +1 -1
  474. package/dist/utils/worker-threads.d.ts +10 -4
  475. package/dist/utils/worker-threads.d.ts.map +1 -1
  476. package/dist/utils/worker-threads.js +10 -4
  477. package/dist/utils/worker-threads.js.map +1 -1
  478. package/docs/background-tasks.md +10 -10
  479. package/docs/compaction.md +1 -0
  480. package/docs/development.md +1 -1
  481. package/docs/environment-variables.md +4 -0
  482. package/docs/extensions/api-reference.md +2 -0
  483. package/docs/extensions/events.md +1 -1
  484. package/docs/getting-started/installation.md +1 -0
  485. package/docs/guides/non-interactive.md +2 -0
  486. package/docs/guides/resume-on-any-machine.md +3 -1
  487. package/docs/intercom/reference.md +1 -1
  488. package/docs/keybindings.md +6 -5
  489. package/docs/libraries/ai.md +2 -1
  490. package/docs/mcp-servers.md +1 -1
  491. package/docs/sdk/reference.md +1 -1
  492. package/docs/sdk.md +6 -0
  493. package/docs/security.md +4 -2
  494. package/docs/settings.md +2 -1
  495. package/docs/storage.md +2 -0
  496. package/docs/subagents.md +2 -2
  497. package/docs/tui/reference.md +3 -1
  498. package/npm-shrinkwrap.json +49 -49
  499. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"agent-panel-bridge.js","sourceRoot":"","sources":["../../../src/modes/rpc/agent-panel-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhH,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,GACd,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAIN,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,GACjB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,GACzB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAuB,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AACnG,OAAO,EAAwB,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EACN,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,eAAe,EAGf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO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;QAClC,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;;YACvD,KAAK,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAClC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAmC;IACpE,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { matchesKey, type TuiMouseEvent, type TuiMouseEventResult, truncateToWidth } from \"@bastani/atomic-tui\";\nimport type { ExtensionUIContext } from \"../../core/extensions/index.js\";\nimport {\n\tcountPanelRow,\n\tisRestingPanelRow,\n\tNO_PANEL_ROWS,\n\tnestedShellListed,\n\tpanelRowListed,\n} from \"../../core/tasks/agent-panel-rules.ts\";\nimport {\n\ttype AgentPanelItem,\n\ttype AgentPanelSession,\n\ttype AgentPanelSourceHub,\n\tagentPanelExtensionItems,\n\tagentPanelSourceHubOf,\n\tagentPanelSourcesGeneration,\n\tdismissedAgentPanelItems,\n\tlazyTaskPanelItem,\n\tmaterializePanelItem,\n\tnotifyAgentPanelChanged,\n\topenAgentPanelItem,\n\tsampleAgentPanelSources,\n\tsourceError,\n\tstopAgentPanelItem,\n\tsubscribeAgentPanel,\n\ttaskPanelItem,\n\ttaskPanelRole,\n\ttaskPanelState,\n\ttaskRunGeneration,\n} from \"../../core/tasks/agent-panel-source.ts\";\nimport {\n\tlatestSubagentAttempt,\n\tlatestSubagentAttempts,\n\tsupersededSettledAttempts,\n} from \"../../core/tasks/completion.js\";\nimport type { TaskId, TaskRecord } from \"../../core/tasks/contracts.js\";\nimport { taskClockOf, taskClockRunning } from \"../../core/tasks/live-elapsed.js\";\nimport { getOwnerTaskStore, type OwnerTaskStore } from \"../../core/tasks/owner-store.js\";\nimport { launchedTaskViewSource, ownerTaskViewSource } from \"../../core/tasks/task-view-source.js\";\nimport { type AgentViewBridge, agentViewBridge } from \"../interactive/agent-view/agent-view-bridge.ts\";\nimport {\n\tAGENT_PANEL_FOCUSED_ROWS,\n\tAGENT_PANEL_IDLE_ROWS,\n\tAGENT_PANEL_MAIN_ID,\n\tAgentPanelFocus,\n\tAgentPanelModel,\n\ttype AgentPanelRow,\n\ttype AgentPanelStyle,\n\tagentPanelKeys,\n\tagentPanelRowIdAtLine,\n\tisActivePanelRow,\n\tisFinishedPanelRow,\n\tpanelTaskId,\n\trenderAgentPanelHint,\n\trenderAgentPanelRows,\n} from \"../interactive/components/agent-panel.ts\";\nimport { ModelColumn } from \"../interactive/components/model-column.ts\";\nimport { renderNavKeyOverlay } from \"../interactive/components/nav-keys.ts\";\nimport { isSingleLeftClick } from \"../interactive/components/single-click.ts\";\nimport { dismissedTasks } from \"../interactive/components/task-dismissal.ts\";\nimport { taskDisplayText } from \"../interactive/components/task-row.js\";\nimport { isPhysicalCtrlC } from \"../interactive/interactive-key-identity.ts\";\nimport { getGlobalTheme } from \"../interactive/theme/global-theme.ts\";\nimport { theme } from \"../interactive/theme/theme.js\";\nimport { showTaskInspector, type TaskInspectorUi } from \"./task-ui-bridge.js\";\n\nexport interface AgentPanelCounts {\n\t/** Every row the panel lists: ↓ focuses the panel while it is not 0. */\n\treadonly total: number;\n\t/** The subagent rows among them, folded rows included; the hint counts only these as agents. */\n\treadonly agents?: number;\n\treadonly needsInput: number;\n\t/** Running background shells: counted in the hint line, listed in /tasks rather than the panel. */\n\treadonly shells?: number;\n\t/** The chat's subagents in /tasks, listed in the panel or not: the hint points there once the panel lists none. */\n\treadonly subagents?: number;\n}\n\nconst EMPTY_PANEL_COUNTS: AgentPanelCounts = { ...NO_PANEL_ROWS, shells: 0, subagents: 0 };\n\ntype PanelRankCache = PanelRanking & {\n\treadonly store: OwnerTaskStore | undefined;\n\treadonly revision: number;\n\treadonly finishedRevision: number;\n\treadonly hub: AgentPanelSourceHub | undefined;\n\treadonly generation: number;\n\treadonly dismissed: ReadonlySet<string>;\n\treadonly bridge: AgentViewBridge | undefined;\n\t/** What the bridge said the screen shows when this was ranked. */\n\treadonly requested: TaskId | undefined;\n};\n\ninterface PanelRanking {\n\treadonly rows: AgentPanelRow[];\n\treadonly counts: AgentPanelCounts;\n\treadonly main: boolean;\n\t/** The row of the subagent the screen shows; undefined while it shows main. */\n\treadonly viewed?: string;\n}\n\nfunction rankingOf(cache: PanelRankCache, rows: AgentPanelRow[] = cache.rows): PanelRanking {\n\treturn {\n\t\trows,\n\t\tcounts: cache.counts,\n\t\tmain: cache.main,\n\t\t...(cache.viewed === undefined ? {} : { viewed: cache.viewed }),\n\t};\n}\n\n/**\n * The row id of the subagent the screen shows, as the panel lists it: a resumed subagent is its latest attempt, so the\n * mark follows it. Undefined while the screen shows main, or shows nothing this session lists.\n */\nfunction viewedRowId(requested: TaskId | undefined, tasks: readonly TaskRecord[]): string | undefined {\n\tif (requested === undefined) return undefined;\n\tconst latest = latestSubagentAttempt(tasks, requested);\n\treturn latest?.kind === \"agent\" ? `task:${latest.ref.taskId}` : undefined;\n}\n\n/**\n * The shells each subagent in `tasks` launched that still run, by the row id of the subagent's listed attempt, oldest\n * first: they are listed under it. A shell names the attempt that launched it, so a resumed subagent keeps the shells\n * its earlier attempts started.\n */\nfunction nestedShells(\n\ttasks: readonly TaskRecord[],\n\townerTasks: readonly TaskRecord[],\n): ReadonlyMap<string, readonly TaskRecord[]> {\n\tconst nested = new Map<string, TaskRecord[]>();\n\t// Grouped once, on the first shell listed: every lookup after it is a map read.\n\tlet latestOf: ((taskId: TaskId) => TaskRecord | undefined) | undefined;\n\tfor (const task of ownerTasks) {\n\t\tif (task.parentTaskId === undefined || taskPanelRole(task) !== \"shell\") continue;\n\t\tif (!nestedShellListed(taskPanelState(task))) continue;\n\t\tlatestOf ??= latestSubagentAttempts(tasks);\n\t\tconst parent = latestOf(task.parentTaskId);\n\t\tif (parent?.kind !== \"agent\") continue;\n\t\tconst rowId = `task:${parent.ref.taskId}`;\n\t\tconst shells = nested.get(rowId);\n\t\tif (shells === undefined) nested.set(rowId, [task]);\n\t\telse shells.push(task);\n\t}\n\tfor (const shells of nested.values()) shells.sort((a, b) => a.launchOrdinal - b.launchOrdinal);\n\treturn nested;\n}\n\ninterface PanelState {\n\treadonly model: AgentPanelModel;\n\treadonly reported: Set<string>;\n\trankCaches?: Map<number, PanelRankCache>;\n\thideCount: number;\n\topen?: boolean;\n\tonSourceError?: (error: Error) => void;\n\treportOnce?: (error: unknown) => void;\n\tsetVisible?: (visible: boolean) => void;\n}\n\nconst states = new WeakMap<object, PanelState>();\nconst boundSessions = new Set<AgentPanelSession & object>();\n\nfunction panelState(target: object): PanelState {\n\tlet state = states.get(target);\n\tif (state === undefined) {\n\t\tconst store = getOwnerTaskStore(target);\n\t\tif (store !== undefined) state = states.get(store);\n\t}\n\tif (state === undefined) {\n\t\tfor (const session of boundSessions) {\n\t\t\tif (getOwnerTaskStore(session) === target) {\n\t\t\t\tstate = states.get(session);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tstate ??= { model: new AgentPanelModel(), reported: new Set(), hideCount: 0 };\n\tstates.set(target, state);\n\tconst store = getOwnerTaskStore(target);\n\tif (store !== undefined) states.set(store, state);\n\treturn state;\n}\n\nfunction sameIds(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n\tif (a.size !== b.size) return false;\n\tfor (const id of a) if (!b.has(id)) return false;\n\treturn true;\n}\n\nfunction safeLabel(value: unknown): string {\n\tconst raw = typeof value === \"string\" ? value : sourceError(value).message;\n\treturn taskDisplayText(raw.replace(/\\x1b\\][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)/g, \"\"))\n\t\t.toWellFormed()\n\t\t.replace(/\\p{Default_Ignorable_Code_Point}/gu, \"\");\n}\n\nfunction notifyPanelWarning(\n\tnotify: ((message: string, type?: \"info\" | \"warning\" | \"error\") => void) | undefined,\n\tmessage: string,\n): void {\n\ttry {\n\t\tnotify?.(`Agent panel: a source failed: ${safeLabel(message)}`, \"warning\");\n\t} catch {}\n}\n\nfunction reportOnceWith(\n\tstate: PanelState,\n\tnotify: ((message: string, type?: \"info\" | \"warning\" | \"error\") => void) | undefined,\n\terror: unknown,\n): void {\n\tconst message = sourceError(error).message;\n\tif (state.reported.has(message)) return;\n\tstate.reported.add(message);\n\tnotifyPanelWarning(notify, message);\n}\n\nfunction panelTheme(): typeof theme {\n\treturn getGlobalTheme() ?? theme;\n}\n\nconst THEMED_STYLE: AgentPanelStyle = {\n\tdim: (text) => panelTheme().fg(\"dim\", text),\n\ttext: (text) => panelTheme().fg(\"text\", text),\n\tmuted: (text) => panelTheme().fg(\"muted\", text),\n\tborder: (text) => panelTheme().fg(\"borderMuted\", text),\n\tbold: (text) => panelTheme().bold(text),\n\taccent: (text) => panelTheme().fg(\"accent\", text),\n\tsuccess: (text) => panelTheme().fg(\"success\", text),\n\terror: (text) => panelTheme().fg(\"error\", text),\n\twarning: (text) => panelTheme().fg(\"warning\", text),\n};\n\nexport function themedAgentPanelStyle(): AgentPanelStyle {\n\treturn THEMED_STYLE;\n}\n\nfunction currentPanelItem(store: OwnerTaskStore | undefined, row: AgentPanelRow): AgentPanelRow {\n\tconst taskId = panelTaskId(row);\n\tconst task = taskId === undefined ? undefined : store?.taskRecord(taskId);\n\tif (task === undefined || store === undefined) return materializePanelItem(row);\n\treturn taskPanelItem(task, taskClockOf(ownerTaskViewSource(store)));\n}\n\nfunction rankPanelSession(\n\tsession: AgentPanelSession & object,\n\toptions: { readonly start?: number; readonly limit?: number; readonly cap?: number } = {},\n): PanelRanking {\n\tconst state = panelState(session);\n\tconst dismissed = dismissedAgentPanelItems(session);\n\tconst store = getOwnerTaskStore(session);\n\tconst cap = options.cap ?? Number.POSITIVE_INFINITY;\n\tconst revision = store?.panelRevision ?? 0;\n\tconst hub = agentPanelSourceHubOf(session);\n\tconst generation = agentPanelSourcesGeneration();\n\tconst start = Math.max(0, options.start ?? 0);\n\tconst limit = Math.max(0, options.limit ?? Number.POSITIVE_INFINITY);\n\tconst materialize = (row: AgentPanelRow): AgentPanelRow => currentPanelItem(store, row);\n\tconst bridge = agentViewBridge(session);\n\tconst requested = bridge?.viewedTaskId();\n\tconst cached =\n\t\tstate.rankCaches?.get(cap) ??\n\t\t(limit === 0\n\t\t\t? (state.rankCaches?.get(AGENT_PANEL_IDLE_ROWS) ?? state.rankCaches?.get(Number.POSITIVE_INFINITY))\n\t\t\t: undefined);\n\tif (\n\t\tcached !== undefined &&\n\t\tcached.store === store &&\n\t\tcached.revision === revision &&\n\t\tcached.finishedRevision === state.model.finishedRevision &&\n\t\tcached.hub === hub &&\n\t\tcached.generation === generation &&\n\t\tcached.bridge === bridge &&\n\t\tcached.requested === requested &&\n\t\tsameIds(cached.dismissed, dismissed)\n\t) {\n\t\tconst end = Math.min(cached.rows.length, start + limit);\n\t\tif (end <= start) return rankingOf(cached);\n\t\tlet rows: AgentPanelRow[] | undefined;\n\t\tfor (let index = start; index < end; index++) {\n\t\t\tconst current = cached.rows[index]!;\n\t\t\tconst base = materialize(state.model.baseOf(current));\n\t\t\tconst next = state.model.withElapsed(base);\n\t\t\tif (\n\t\t\t\tnext === current ||\n\t\t\t\t(base === state.model.baseOf(current) && elapsedSecond(next.elapsedMs) === elapsedSecond(current.elapsedMs))\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\trows ??= cached.rows.slice();\n\t\t\trows[index] = next;\n\t\t}\n\t\tif (rows === undefined) return rankingOf(cached);\n\t\tstate.rankCaches?.set(cap, { ...cached, rows });\n\t\treturn rankingOf(cached, rows);\n\t}\n\tconst extItems = agentPanelExtensionItems(session, state.onSourceError);\n\tconst source = store === undefined ? undefined : ownerTaskViewSource(store);\n\tconst tasks = source?.backgroundTasks ?? [];\n\t// A resumed or woken subagent is listed as its latest attempt only.\n\tconst superseded = tasks.length === 0 ? new Set<TaskId>() : supersededSettledAttempts(tasks);\n\t// The subagent the screen shows stays listed while it is shown, finished or not; its own shells are listed under it.\n\tconst viewed = viewedRowId(requested, tasks);\n\tlet viewedRow: (() => AgentPanelRow) | undefined;\n\t// Only a subagent's running shell is listed under it: with none running, the owner's tasks are not read again.\n\tconst shellsOf =\n\t\tbridge === undefined || store === undefined || !store.hasRunningChildTasks\n\t\t\t? undefined\n\t\t\t: nestedShells(tasks, store.ownerBackgroundTasks);\n\t// Resting rows, such as a stopped subagent, stay listed only while something is active: a\n\t// row, or a running shell, which is not one.\n\tlet active = false;\n\tfor (const item of extItems) {\n\t\tif ((item.kind === \"agent\" || item.kind === \"shell\") && isActivePanelRow(item)) {\n\t\t\tactive = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!active) {\n\t\tfor (const task of tasks) {\n\t\t\tif (task.parentTaskId !== undefined || (superseded.size > 0 && superseded.has(task.ref.taskId))) continue;\n\t\t\t// Background work that is not a row (a shell) is active while it runs.\n\t\t\tif (\n\t\t\t\ttaskPanelRole(task) === \"agent\"\n\t\t\t\t\t? isActivePanelRow({ state: taskPanelState(task) })\n\t\t\t\t\t: task.execution.kind !== \"settled\"\n\t\t\t) {\n\t\t\t\tactive = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst { now, pass } = state.model.beginPass();\n\tconst inputRows: AgentPanelRow[] = [];\n\tconst runningRows: AgentPanelRow[] = [];\n\tconst otherRows: AgentPanelRow[] = [];\n\tconst finishedRows: AgentPanelRow[] = [];\n\tlet counts = NO_PANEL_ROWS;\n\tlet shells = 0;\n\tlet subagents = 0;\n\tconst room = () => inputRows.length + runningRows.length + otherRows.length + finishedRows.length < cap;\n\t/** Whether the panel lists a row, by the shared rules; a finished row it lists starts fading. */\n\tconst listed = (\n\t\trowId: string,\n\t\tkind: AgentPanelItem[\"kind\"],\n\t\trowState: AgentPanelItem[\"state\"],\n\t\tfinished: boolean,\n\t\tkept: boolean,\n\t\tfadeKey: string,\n\t\tnative: boolean,\n\t\trun: string | undefined,\n\t): boolean => {\n\t\tconst retired = isRestingPanelRow(kind, rowState) && state.model.retireResting(rowId, active, pass, run);\n\t\tif (!panelRowListed(kind, rowState, finished, { active, retired, kept })) return false;\n\t\t// A shown subagent that finished is kept, not faded: it leaves once the screen shows something else.\n\t\tif (finished && !kept) state.model.keepFinished(fadeKey, true, now, pass, native);\n\t\tcounts = countPanelRow(counts, kind, rowState);\n\t\treturn true;\n\t};\n\tconst place = (rowState: AgentPanelItem[\"state\"], finished: boolean, row: () => AgentPanelRow) => {\n\t\tif (finished) {\n\t\t\tif (room()) finishedRows.push(row());\n\t\t} else if (rowState === \"input\") {\n\t\t\tif (inputRows.length < cap) inputRows.push(row());\n\t\t} else if (rowState === \"running\") {\n\t\t\tif (inputRows.length + runningRows.length < cap) runningRows.push(row());\n\t\t} else if (inputRows.length + runningRows.length + otherRows.length < cap) otherRows.push(row());\n\t};\n\tconst pushItem = (item: AgentPanelItem) => {\n\t\t// Shells are counted on the hint line and listed in /tasks, not here.\n\t\tif (item.kind === \"shell\") {\n\t\t\tif (!isFinishedPanelRow(item)) shells++;\n\t\t\treturn;\n\t\t}\n\t\tconst finished = isFinishedPanelRow(item);\n\t\tif (!listed(item.id, item.kind, item.state, finished, false, item.id, false, item.runGeneration)) return;\n\t\tplace(item.state, finished, () => item);\n\t};\n\n\tif (store !== undefined && source !== undefined) {\n\t\tconst taskDismissed = dismissedTasks(source);\n\t\tconst storeDismissed = dismissedTasks(store);\n\t\tconst sourceClocks = taskClockOf(source);\n\t\tfor (let i = tasks.length - 1; i >= 0; i--) {\n\t\t\tconst task = tasks[i]!;\n\t\t\tif (superseded.size > 0 && superseded.has(task.ref.taskId)) continue;\n\t\t\tif (task.parentTaskId !== undefined) continue;\n\t\t\t// Only subagents are rows. A shell is counted on the hint line and listed in /tasks.\n\t\t\tconst role = taskPanelRole(task);\n\t\t\tif (role !== \"agent\") {\n\t\t\t\tif (role === \"shell\" && task.execution.kind !== \"settled\") shells++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsubagents++;\n\t\t\tconst id = task.ref.taskId;\n\t\t\tconst rowState = taskPanelState(task);\n\t\t\tconst finishedState =\n\t\t\t\ttask.execution.kind === \"settled\" &&\n\t\t\t\t(rowState === \"done\" || rowState === \"failed\" || rowState === \"stopped\");\n\t\t\tif (!finishedState) {\n\t\t\t\tif (dismissed.size > 0) dismissed.delete(`task:${id}`);\n\t\t\t\tif (taskDismissed.size > 0) taskDismissed.delete(id);\n\t\t\t\tif (storeDismissed.size > 0) storeDismissed.delete(id);\n\t\t\t} else if (dismissed.size > 0 && dismissed.has(`task:${id}`)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Every native task here is a subagent row: a stopped or interrupted one rests, a finished one leaves.\n\t\t\tconst shown = viewed === `task:${id}`;\n\t\t\tif (!listed(`task:${id}`, \"agent\", rowState, finishedState, shown, id, true, taskRunGeneration(task)))\n\t\t\t\tcontinue;\n\t\t\tconst row = () => lazyTaskPanelItem(task, sourceClocks);\n\t\t\tif (shown) viewedRow = row;\n\t\t\tplace(rowState, finishedState, row);\n\t\t\tfor (const shell of shellsOf?.get(`task:${id}`) ?? [])\n\t\t\t\tcounts = countPanelRow(counts, \"shell\", taskPanelState(shell));\n\t\t}\n\t}\n\n\tfor (let i = extItems.length - 1; i >= 0; i--) {\n\t\tconst item = extItems[i]!;\n\t\tif (item.kind === \"agent\" || item.kind === \"shell\") pushItem(item);\n\t}\n\n\tconst panelCounts = { ...counts, shells, subagents };\n\t// The main row leads the panel whenever it lists a subagent.\n\tconst main = counts.agents > 0;\n\tstate.model.endPass(pass);\n\tconst ranked = inputRows.concat(runningRows, otherRows, finishedRows);\n\tconst ordered = shellsOf === undefined || shellsOf.size === 0 ? ranked : withNestedShells(ranked, shellsOf, store);\n\tlet rows = Number.isFinite(cap) ? ordered.slice(0, cap) : ordered;\n\t// The panel below the prompt always draws the shown subagent's row and its shells: they take the last places when\n\t// they are further down.\n\tif (viewedRow !== undefined && viewed !== undefined && Number.isFinite(cap) && cap > 0) {\n\t\tconst shells = shellsOf?.get(viewed) ?? [];\n\t\tconst at = ordered.findIndex((row) => row.id === viewed);\n\t\t// Ranked past the cap, the shown row was never placed: it and its shells are made here.\n\t\tconst group = (\n\t\t\tat < 0\n\t\t\t\t? [viewedRow(), ...shells.map((shell) => taskPanelItem(shell, source && taskClockOf(source)))]\n\t\t\t\t: ordered.slice(at, at + 1 + shells.length)\n\t\t).slice(0, cap);\n\t\tif (at < 0 || at + group.length > cap)\n\t\t\trows = ordered\n\t\t\t\t.filter((row) => !group.includes(row))\n\t\t\t\t.slice(0, cap - group.length)\n\t\t\t\t.concat(group);\n\t}\n\tconst end = Math.min(rows.length, start + limit);\n\tfor (let index = start; index < end; index++) rows[index] = state.model.withElapsed(materialize(rows[index]!), now);\n\tstate.rankCaches ??= new Map();\n\tstate.rankCaches.set(cap, {\n\t\tstore,\n\t\trevision,\n\t\tfinishedRevision: state.model.finishedRevision,\n\t\thub,\n\t\tgeneration,\n\t\tdismissed: new Set(dismissed),\n\t\tbridge,\n\t\trequested,\n\t\trows,\n\t\tcounts: panelCounts,\n\t\tmain,\n\t\t...(viewed === undefined ? {} : { viewed }),\n\t});\n\treturn { rows, counts: panelCounts, main, ...(viewed === undefined ? {} : { viewed }) };\n}\n\n/** `ranked` with each subagent's own running shells right after its row. */\nfunction withNestedShells(\n\tranked: readonly AgentPanelRow[],\n\tshellsOf: ReadonlyMap<string, readonly TaskRecord[]>,\n\tstore: OwnerTaskStore | undefined,\n): AgentPanelRow[] {\n\tconst clocks = store === undefined ? undefined : taskClockOf(ownerTaskViewSource(store));\n\tconst rows: AgentPanelRow[] = [];\n\tfor (const row of ranked) {\n\t\trows.push(row);\n\t\tfor (const shell of shellsOf.get(row.id) ?? []) rows.push(taskPanelItem(shell, clocks));\n\t}\n\treturn rows;\n}\n\nexport function agentPanelRows(\n\tsession: AgentPanelSession & object,\n\twindow?: { readonly start?: number; readonly limit?: number },\n): AgentPanelRow[] {\n\treturn rankPanelSession(session, window).rows;\n}\n\nconst WIDGET_KEY = \"atomic.agent-panel\";\nconst TICK_MS = 1000;\nexport const AGENT_PANEL_REFRESH_WINDOW_MS = 50;\nexport const AGENT_PANEL_REFRESH_BUDGET_MS = 8;\nconst REFRESH_BURST = 4;\n\nfunction withinRefreshBudget(refreshes: number, spent: number): boolean {\n\tif (spent < AGENT_PANEL_REFRESH_BUDGET_MS) return true;\n\treturn refreshes < REFRESH_BURST && spent <= (refreshes + 1) * (AGENT_PANEL_REFRESH_BUDGET_MS / REFRESH_BURST);\n}\n\nfunction elapsedSecond(ms: number | undefined): number {\n\treturn ms === undefined ? -1 : Math.max(0, Math.floor(ms / 1000));\n}\n\nfunction sliceFadedMask(rows: readonly AgentPanelRow[], start: number, count: number, model: AgentPanelModel): number {\n\tconst end = Math.min(rows.length, start + count);\n\tlet mask = 0;\n\tfor (let i = start; i < end; i++) {\n\t\tif (model.faded(rows[i]!)) mask |= 1 << (i - start);\n\t}\n\treturn mask;\n}\n\nfunction sameUnfocusedRows(\n\tprev: readonly AgentPanelRow[],\n\tnext: readonly AgentPanelRow[],\n\tmodel: AgentPanelModel,\n): boolean {\n\tif (prev === next) return true;\n\tif (prev.length !== next.length || prev.length === 0) return false;\n\tconst limit = Math.min(prev.length, AGENT_PANEL_IDLE_ROWS);\n\tfor (let i = 0; i < limit; i++) {\n\t\tconst a = prev[i]!;\n\t\tconst b = next[i]!;\n\t\tif (\n\t\t\ta.id !== b.id ||\n\t\t\ta.kind !== b.kind ||\n\t\t\ta.state !== b.state ||\n\t\t\ta.name !== b.name ||\n\t\t\ta.task !== b.task ||\n\t\t\ta.tokens !== b.tokens ||\n\t\t\ta.model !== b.model ||\n\t\t\ta.thinking !== b.thinking ||\n\t\t\ta.queued !== b.queued ||\n\t\t\telapsedSecond(a.elapsedMs) !== elapsedSecond(b.elapsedMs) ||\n\t\t\tmodel.faded(a) !== model.faded(b)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/** Whether the rows change with time alone: a running clock, or a finished row that has not faded yet. */\nfunction panelRowsNeedClock(rows: readonly AgentPanelRow[], state: PanelState): boolean {\n\tfor (const row of rows) {\n\t\tif (taskClockRunning(row.state)) return true;\n\t\tif (isFinishedPanelRow(row) && !state.model.faded(row)) return true;\n\t}\n\treturn false;\n}\n\nexport function bindAgentPanel(\n\tsession: AgentPanelSession & object,\n\tui: Pick<ExtensionUIContext, \"setWidget\" | \"requestRender\"> &\n\t\tPartial<Pick<ExtensionUIContext, \"onWidgetRelease\" | \"notify\">>,\n\tonCounts?: (counts: AgentPanelCounts) => void,\n\t/** Where a click on a row opens that row's view; without it the rows take no clicks. */\n\tinspector?: TaskInspectorUi,\n): () => void {\n\tboundSessions.add(session);\n\tconst state = panelState(session);\n\tconst reportSource = (error: Error) => {\n\t\tconst message = sourceError(error).message;\n\t\tstate.reported.add(message);\n\t\tnotifyPanelWarning(ui.notify, message);\n\t};\n\tconst report = (error: unknown) => reportOnceWith(state, ui.notify, error);\n\tstate.onSourceError = reportSource;\n\tstate.reportOnce = report;\n\tconst faded = (row: AgentPanelRow) => state.model.faded(row);\n\tlet mounted = false;\n\tlet visible = state.hideCount === 0;\n\tlet disposed = false;\n\tlet dirty = false;\n\tlet currentHiddenBelow = 0;\n\tlet currentMain = false;\n\tlet currentViewed: string | undefined;\n\tlet lastCounts: AgentPanelCounts | undefined;\n\tlet scheduled = false;\n\tlet windowStart = Number.NEGATIVE_INFINITY;\n\tlet spent = 0;\n\tlet refreshes = 0;\n\tlet deferred: ReturnType<typeof setTimeout> | undefined;\n\tlet currentRows: AgentPanelRow[] = [];\n\tlet cachedRows: AgentPanelRow[] | undefined;\n\tlet cachedWidth = -1;\n\tlet cachedFaded = -1;\n\tlet cachedHiddenBelow = -1;\n\tlet cachedMain = false;\n\tlet cachedViewed: string | undefined;\n\t/** The rows the widget last drew, which a click is resolved against. */\n\tlet painted: { rows: readonly AgentPanelRow[]; hiddenBelow: number; main: boolean } | undefined;\n\tlet cachedLines: string[] = [];\n\tlet timer: ReturnType<typeof setInterval> | undefined;\n\t/** The panel's model column, measured afresh each time the panel is mounted. */\n\tconst modelColumn = new ModelColumn(() => {\n\t\tcachedRows = undefined;\n\t\tui.requestRender();\n\t});\n\n\tconst publishCounts = (counts: AgentPanelCounts) => {\n\t\tif (\n\t\t\tlastCounts !== undefined &&\n\t\t\tcounts.total === lastCounts.total &&\n\t\t\tcounts.needsInput === lastCounts.needsInput &&\n\t\t\tcounts.shells === lastCounts.shells &&\n\t\t\tcounts.subagents === lastCounts.subagents &&\n\t\t\tcounts.agents === lastCounts.agents\n\t\t)\n\t\t\treturn false;\n\t\tlastCounts = counts;\n\t\ttry {\n\t\t\tonCounts?.({ ...counts });\n\t\t} catch {}\n\t\treturn true;\n\t};\n\tconst stopTimer = () => {\n\t\tif (timer !== undefined) clearInterval(timer);\n\t\ttimer = undefined;\n\t};\n\tconst clearDeferred = () => {\n\t\tif (deferred !== undefined) clearTimeout(deferred);\n\t\tdeferred = undefined;\n\t};\n\tconst unmount = (resetCounts = true) => {\n\t\tcurrentRows = [];\n\t\tcurrentHiddenBelow = 0;\n\t\tcurrentMain = false;\n\t\tcurrentViewed = undefined;\n\t\tcachedRows = undefined;\n\t\tcachedHiddenBelow = -1;\n\t\tcachedLines = [];\n\t\tconst wasMounted = mounted;\n\t\tmounted = false;\n\t\tmodelColumn.reset();\n\t\tstopTimer();\n\t\tif (resetCounts) publishCounts(EMPTY_PANEL_COUNTS);\n\t\tif (wasMounted) {\n\t\t\ttry {\n\t\t\t\tui.setWidget(WIDGET_KEY, undefined);\n\t\t\t} catch {}\n\t\t}\n\t};\n\tconst update = () => {\n\t\tdirty = false;\n\t\tconst began = performance.now();\n\t\tif (began - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\twindowStart = began;\n\t\t\tspent = 0;\n\t\t\trefreshes = 0;\n\t\t}\n\t\ttry {\n\t\t\trefresh();\n\t\t} catch (error) {\n\t\t\treport(error);\n\t\t\tunmount(true);\n\t\t} finally {\n\t\t\tspent += Math.max(0, performance.now() - began);\n\t\t}\n\t};\n\tconst idleRows = () =>\n\t\trankPanelSession(session, { start: 0, limit: AGENT_PANEL_IDLE_ROWS, cap: AGENT_PANEL_IDLE_ROWS });\n\tconst refresh = () => {\n\t\tif (disposed) return;\n\t\tif (!visible) {\n\t\t\tsampleAgentPanelSources(session, state.onSourceError);\n\t\t\tunmount(false);\n\t\t\treturn;\n\t\t}\n\t\tsyncBridge();\n\t\tconst { rows, counts, main, viewed } = idleRows();\n\t\t// The prompt's hints still update when there are no rows to mount.\n\t\tconst changed = publishCounts(counts);\n\t\tif (rows.length === 0) {\n\t\t\tunmount(false);\n\t\t\tif (changed) ui.requestRender();\n\t\t\treturn;\n\t\t}\n\t\tcurrentHiddenBelow = Math.max(0, counts.total - rows.length);\n\t\tcurrentMain = main;\n\t\tcurrentViewed = viewed;\n\t\tif (!mounted || !sameUnfocusedRows(currentRows, rows, state.model)) {\n\t\t\tcurrentRows = rows;\n\t\t}\n\t\tif (!mounted) {\n\t\t\tmounted = true;\n\t\t\tui.setWidget(\n\t\t\t\tWIDGET_KEY,\n\t\t\t\t() => ({\n\t\t\t\t\tinvalidate() {\n\t\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\t\tcachedHiddenBelow = -1;\n\t\t\t\t\t\tcachedLines = [];\n\t\t\t\t\t},\n\t\t\t\t\t/** The id of the row last drawn on `row`, so a click on a row whose item changed is not taken. */\n\t\t\t\t\tpaintedRowKey(row: number): string | undefined {\n\t\t\t\t\t\tif (!visible || painted === undefined) return undefined;\n\t\t\t\t\t\treturn agentPanelRowIdAtLine(\n\t\t\t\t\t\t\tpainted.rows,\n\t\t\t\t\t\t\t{ hiddenBelow: painted.hiddenBelow, showMain: painted.main },\n\t\t\t\t\t\t\trow,\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\t\t\t\t\tif (!visible || inspector === undefined || painted === undefined || !isSingleLeftClick(event))\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t// The rows the reader saw: the panel's rows can change before it paints them again.\n\t\t\t\t\t\tconst id = agentPanelRowIdAtLine(\n\t\t\t\t\t\t\tpainted.rows,\n\t\t\t\t\t\t\t{ hiddenBelow: painted.hiddenBelow, showMain: painted.main },\n\t\t\t\t\t\t\tevent.y,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (id === undefined) return undefined;\n\t\t\t\t\t\tif (id === AGENT_PANEL_MAIN_ID) {\n\t\t\t\t\t\t\t// The main row is the chat the reader is in, unless the screen shows a subagent: then it shows main.\n\t\t\t\t\t\t\tconst bridge = agentViewBridge(session);\n\t\t\t\t\t\t\tif (bridge?.viewedTaskId() !== undefined) bridge.requestView(undefined);\n\t\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst row = painted.rows.find((candidate) => candidate.id === id);\n\t\t\t\t\t\tif (row === undefined) return undefined;\n\t\t\t\t\t\topenPanelRow(session, inspector, materializePanelItem(row), report).catch(report);\n\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t},\n\t\t\t\t\trender(width: number) {\n\t\t\t\t\t\tif (!visible) return [];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst w = +width;\n\t\t\t\t\t\t\tif (dirty && deferred === undefined) {\n\t\t\t\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\t\t\t\tif (now - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\t\t\t\t\t\twindowStart = now;\n\t\t\t\t\t\t\t\t\tspent = 0;\n\t\t\t\t\t\t\t\t\trefreshes = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (withinRefreshBudget(refreshes, spent)) {\n\t\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\t\trefreshes++;\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tconst { rows, counts, main, viewed } = idleRows();\n\t\t\t\t\t\t\t\t\t\tpublishCounts(counts);\n\t\t\t\t\t\t\t\t\t\tcurrentHiddenBelow = Math.max(0, counts.total - rows.length);\n\t\t\t\t\t\t\t\t\t\tcurrentMain = main;\n\t\t\t\t\t\t\t\t\t\tcurrentViewed = viewed;\n\t\t\t\t\t\t\t\t\t\tif (!sameUnfocusedRows(currentRows, rows, state.model)) {\n\t\t\t\t\t\t\t\t\t\t\tcurrentRows = rows;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (rowsChangeWithTime(currentRows)) {\n\t\t\t\t\t\t\t\t\t\t\ttimer ??= setInterval(update, TICK_MS);\n\t\t\t\t\t\t\t\t\t\t\ttimer.unref?.();\n\t\t\t\t\t\t\t\t\t\t} else stopTimer();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tspent += Math.max(0, performance.now() - now);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpainted = { rows: currentRows, hiddenBelow: currentHiddenBelow, main: currentMain };\n\t\t\t\t\t\t\tif (!Number.isFinite(w)) {\n\t\t\t\t\t\t\t\treturn renderAgentPanelRows(currentRows, w, THEMED_STYLE, {\n\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\thiddenBelow: currentHiddenBelow,\n\t\t\t\t\t\t\t\t\tshowMain: currentMain,\n\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t...idleMarks(),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst fadedMask = sliceFadedMask(currentRows, 0, AGENT_PANEL_IDLE_ROWS, state.model);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tcachedRows === currentRows &&\n\t\t\t\t\t\t\t\tcachedWidth === w &&\n\t\t\t\t\t\t\t\tcachedFaded === fadedMask &&\n\t\t\t\t\t\t\t\tcachedHiddenBelow === currentHiddenBelow &&\n\t\t\t\t\t\t\t\tcachedMain === currentMain &&\n\t\t\t\t\t\t\t\tcachedViewed === currentViewed\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn cachedLines;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst renderStart = performance.now();\n\t\t\t\t\t\t\tconst lines = renderAgentPanelRows(currentRows, w, THEMED_STYLE, {\n\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\thiddenBelow: currentHiddenBelow,\n\t\t\t\t\t\t\t\tshowMain: currentMain,\n\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t...idleMarks(),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tspent += Math.max(0, performance.now() - renderStart);\n\t\t\t\t\t\t\tcachedRows = currentRows;\n\t\t\t\t\t\t\tcachedWidth = w;\n\t\t\t\t\t\t\tcachedFaded = fadedMask;\n\t\t\t\t\t\t\tcachedHiddenBelow = currentHiddenBelow;\n\t\t\t\t\t\t\tcachedMain = currentMain;\n\t\t\t\t\t\t\tcachedViewed = currentViewed;\n\t\t\t\t\t\t\tcachedLines = lines;\n\t\t\t\t\t\t\treturn lines;\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\t{ placement: \"belowEditor\" },\n\t\t\t);\n\t\t}\n\t\tif (rowsChangeWithTime(currentRows)) {\n\t\t\ttimer ??= setInterval(update, TICK_MS);\n\t\t\ttimer.unref?.();\n\t\t} else stopTimer();\n\t\tui.requestRender();\n\t};\n\tconst rowsChangeWithTime = (rows: readonly AgentPanelRow[]): boolean => panelRowsNeedClock(rows, state);\n\t/** The viewed mark and nesting, only while the screen can show a subagent: without a bridge, today's rows. */\n\tconst idleMarks = () =>\n\t\twatchedBridge === undefined\n\t\t\t? {}\n\t\t\t: { nestShells: true, ...(currentViewed === undefined ? {} : { viewedId: currentViewed }) };\n\t/** What the screen shows changes the mark and keeps its row: the panel follows the session's bridge. */\n\tlet watchedBridge: AgentViewBridge | undefined;\n\tlet unwatchBridge = () => {};\n\tconst syncBridge = () => {\n\t\tconst bridge = agentViewBridge(session);\n\t\tif (bridge === watchedBridge) return;\n\t\tunwatchBridge();\n\t\twatchedBridge = bridge;\n\t\tunwatchBridge = bridge?.subscribe(scheduleUpdate) ?? (() => {});\n\t};\n\tconst scheduleUpdate = () => {\n\t\tif (disposed) return;\n\t\tdirty = true;\n\t\tif (scheduled || deferred !== undefined) return;\n\t\tscheduled = true;\n\t\tqueueMicrotask(() => {\n\t\t\tscheduled = false;\n\t\t\tif (disposed || !dirty || deferred !== undefined) return;\n\t\t\tconst now = performance.now();\n\t\t\tif (now - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\twindowStart = now;\n\t\t\t\tspent = 0;\n\t\t\t\trefreshes = 0;\n\t\t\t}\n\t\t\tif (withinRefreshBudget(refreshes, spent)) {\n\t\t\t\trefreshes++;\n\t\t\t\tupdate();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeferred = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tdeferred = undefined;\n\t\t\t\t\tif (disposed || !dirty) return;\n\t\t\t\t\tconst began = performance.now();\n\t\t\t\t\tif (began - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\t\t\twindowStart = began;\n\t\t\t\t\t\tspent = 0;\n\t\t\t\t\t\trefreshes = 0;\n\t\t\t\t\t}\n\t\t\t\t\trefreshes++;\n\t\t\t\t\tupdate();\n\t\t\t\t},\n\t\t\t\tMath.max(0, windowStart + AGENT_PANEL_REFRESH_WINDOW_MS - now),\n\t\t\t);\n\t\t\tdeferred.unref?.();\n\t\t});\n\t};\n\tconst unsubscribe = subscribeAgentPanel(session, scheduleUpdate);\n\tconst unwatchRelease = ui.onWidgetRelease?.(WIDGET_KEY, () => {\n\t\tmounted = false;\n\t});\n\tstate.setVisible = (value) => {\n\t\tif (visible === value) return;\n\t\tvisible = value;\n\t\tupdate();\n\t};\n\tupdate();\n\treturn () => {\n\t\tdisposed = true;\n\t\tboundSessions.delete(session);\n\t\tunwatchBridge();\n\t\tclearDeferred();\n\t\tstate.setVisible = undefined;\n\t\tif (state.onSourceError === reportSource) state.onSourceError = undefined;\n\t\tif (state.reportOnce === report) state.reportOnce = undefined;\n\t\tunsubscribe();\n\t\tunwatchRelease?.();\n\t\tunmount();\n\t};\n}\n\n/**\n * Open a panel row: a subagent is shown on the screen; a subagent's shell opens its output, and an extension's row its\n * own view, and leaving either returns to the focused panel with the row selected.\n */\nasync function openPanelRow(\n\tsession: AgentPanelSession & object,\n\tui: TaskInspectorUi,\n\titem: AgentPanelItem,\n\treport: (error: unknown) => void,\n): Promise<void> {\n\tconst store = getOwnerTaskStore(session);\n\tconst taskId = panelTaskId(item);\n\tconst bridge = agentViewBridge(session);\n\tif (taskId !== undefined && item.kind === \"agent\") {\n\t\t// The screen shows the subagent where the main chat was; the prompt below now writes to it. Every interactive\n\t\t// session has a bridge: without one there is no screen to show it on.\n\t\tif (bridge !== undefined) bridge.requestView(taskId);\n\t\telse ui.notify?.(`Could not open ${safeLabel(item.name)}.`, \"warning\");\n\t\treturn;\n\t}\n\tconst shell = bridge === undefined || taskId === undefined ? undefined : store?.taskRecord(taskId);\n\tif (store !== undefined && shell?.kind === \"command\" && shell.parentTaskId !== undefined) {\n\t\t// A subagent's own shell opens its output in that subagent's task list; back returns to its row.\n\t\tconst source = launchedTaskViewSource(ownerTaskViewSource(store), shell.parentTaskId);\n\t\tif (\n\t\t\t(await showTaskInspector(ui, store, shell.ref.taskId, { chat: true, backLabel: \"agents\", source })) === \"back\"\n\t\t)\n\t\t\tawait showAgentPanel(session, ui, item.id);\n\t\treturn;\n\t}\n\t// An extension's row opens its own view; leaving it returns to the panel with the row selected.\n\tconst opened = openAgentPanelItem(session, item.id, {\n\t\tonReturn: () => {\n\t\t\tshowAgentPanel(session, ui, item.id).catch(report);\n\t\t},\n\t});\n\tif (!opened) ui.notify?.(`Could not open ${safeLabel(item.name)}.`, \"warning\");\n}\n\nexport async function showAgentPanel(\n\tsession: AgentPanelSession & object,\n\tui: TaskInspectorUi,\n\tselectId?: string,\n): Promise<void> {\n\tconst state = panelState(session);\n\tif (state.open) return;\n\tconst report = (error: unknown) => {\n\t\tif (state.reportOnce !== undefined) {\n\t\t\tstate.reportOnce(error);\n\t\t\treturn;\n\t\t}\n\t\treportOnceWith(state, ui.notify, error);\n\t};\n\tstate.onSourceError ??= (error: Error) => {\n\t\tconst message = sourceError(error).message;\n\t\tstate.reported.add(message);\n\t\tnotifyPanelWarning(ui.notify, message);\n\t};\n\tconst store = getOwnerTaskStore(session);\n\tconst style = THEMED_STYLE;\n\tconst faded = (row: AgentPanelRow) => state.model.faded(row);\n\tlet currentRows: AgentPanelRow[] = [];\n\tlet next: (() => Promise<void>) | undefined;\n\tlet hidden = false;\n\tconst bridge = agentViewBridge(session);\n\t/** The shown subagent's row, as the last ranking found it. */\n\tlet focusViewed: string | undefined;\n\tconst focusedRows = (scroll: number) => {\n\t\tconst ranking = rankPanelSession(session, { start: Math.max(0, scroll), limit: AGENT_PANEL_FOCUSED_ROWS });\n\t\tfocusViewed = ranking.viewed;\n\t\treturn ranking.rows;\n\t};\n\t/** The viewed mark and nesting, only while the screen can show a subagent: without a bridge, today's rows. */\n\tconst focusMarks = () =>\n\t\tbridge === undefined ? {} : { nestShells: true, ...(focusViewed === undefined ? {} : { viewedId: focusViewed }) };\n\tstate.open = true;\n\ttry {\n\t\tcurrentRows = focusedRows(0);\n\t\tif (currentRows.length === 0) return;\n\t\tsetAgentPanelVisible(session, false);\n\t\thidden = true;\n\t\tawait ui.custom<void>(\n\t\t\t(tui, _theme, keybindings, done) => {\n\t\t\t\tconst keys = keybindings as Parameters<typeof renderAgentPanelHint>[3] & {\n\t\t\t\t\tmatches(data: string, action: string): boolean;\n\t\t\t\t};\n\t\t\t\tlet disposed = false;\n\t\t\t\tlet finished = false;\n\t\t\t\tlet dirty = false;\n\t\t\t\tlet scheduled = false;\n\t\t\t\tlet cachedRows: AgentPanelRow[] | undefined;\n\t\t\t\tlet cachedWidth = -1;\n\t\t\t\tlet cachedSelectedId: string | undefined;\n\t\t\t\tlet cachedScroll = -1;\n\t\t\t\tlet cachedMain = false;\n\t\t\t\tlet cachedViewed: string | undefined;\n\t\t\t\t/** The rows and view the focused panel last drew, which a click is resolved against. */\n\t\t\t\tlet paintedFocus:\n\t\t\t\t\t| { rows: readonly AgentPanelRow[]; selectedId: string; scroll: number; showMain: boolean }\n\t\t\t\t\t| undefined;\n\t\t\t\tlet cachedFaded = -1;\n\t\t\t\tlet cachedRowLines: string[] = [];\n\t\t\t\tlet materializedScroll = 0;\n\t\t\t\tlet tick: ReturnType<typeof setInterval> | undefined;\n\t\t\t\tconst modelColumn = new ModelColumn(() => {\n\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\ttui.requestRender();\n\t\t\t\t});\n\t\t\t\tconst finish = () => {\n\t\t\t\t\tif (finished) return;\n\t\t\t\t\tfinished = true;\n\t\t\t\t\tdone();\n\t\t\t\t};\n\t\t\t\tconst focus = new AgentPanelFocus(keys, {\n\t\t\t\t\topen(row) {\n\t\t\t\t\t\tconst item = materializePanelItem(row);\n\t\t\t\t\t\tnext = () => openPanelRow(session, ui, item, report);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t},\n\t\t\t\t\topenMain() {\n\t\t\t\t\t\t// While a subagent is shown, the main row shows main again; otherwise it returns to the prompt.\n\t\t\t\t\t\tconst bridge = agentViewBridge(session);\n\t\t\t\t\t\tif (bridge?.viewedTaskId() !== undefined)\n\t\t\t\t\t\t\tnext = async () => {\n\t\t\t\t\t\t\t\tbridge.requestView(undefined);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t},\n\t\t\t\t\tstop(row) {\n\t\t\t\t\t\tconst item = materializePanelItem(row);\n\t\t\t\t\t\tvoid stopAgentPanelItem(session, item.id)\n\t\t\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\t\t\tif (!result.ok)\n\t\t\t\t\t\t\t\t\tui.notify?.(\n\t\t\t\t\t\t\t\t\t\t`Could not stop ${safeLabel(item.name)}: ${safeLabel(result.reason)}`,\n\t\t\t\t\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\t\t\t\tui.notify?.(`Could not stop ${safeLabel(item.name)}: ${safeLabel(error)}`, \"warning\");\n\t\t\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(() => {});\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t},\n\t\t\t\t\tdismiss(row) {\n\t\t\t\t\t\tif (!isFinishedPanelRow(row)) return;\n\t\t\t\t\t\tdismissedAgentPanelItems(session).add(row.id);\n\t\t\t\t\t\tconst taskId = panelTaskId(row);\n\t\t\t\t\t\tif (taskId !== undefined && store !== undefined)\n\t\t\t\t\t\t\tdismissedTasks(ownerTaskViewSource(store)).add(taskId);\n\t\t\t\t\t\t// The screen shows it: its watchers learn it is gone, and the screen shows main.\n\t\t\t\t\t\tif (row.id === focusViewed) notifyAgentPanelChanged(session);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\tcurrentRows = focusedRows(focus.scroll);\n\t\t\t\t\t\t\tfocus.update(currentRows);\n\t\t\t\t\t\t\tif (currentRows.length === 0) finish();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t},\n\t\t\t\t\tclose: finish,\n\t\t\t\t});\n\t\t\t\tfocus.update(currentRows);\n\t\t\t\tfocus.enter(selectId);\n\t\t\t\tconst refreshRows = () => {\n\t\t\t\t\tmaterializedScroll = focus.scroll;\n\t\t\t\t\tcurrentRows = focusedRows(materializedScroll);\n\t\t\t\t\tif (currentRows.length === 0 && materializedScroll > 0) {\n\t\t\t\t\t\tmaterializedScroll = 0;\n\t\t\t\t\t\tcurrentRows = focusedRows(0);\n\t\t\t\t\t}\n\t\t\t\t\tfocus.update(currentRows);\n\t\t\t\t\t// The last row left by itself (it finished, or nothing is active any more): the focus goes back\n\t\t\t\t\t// to the prompt, as when the last row is cleared. Never from inside a paint.\n\t\t\t\t\tif (currentRows.length === 0) queueMicrotask(finish);\n\t\t\t\t};\n\t\t\t\tconst syncTick = () => {\n\t\t\t\t\tconst needed = focus.pendingStop() !== undefined || panelRowsNeedClock(currentRows, state);\n\t\t\t\t\tif (needed) {\n\t\t\t\t\t\ttick ??= setInterval(refreshFocus, TICK_MS);\n\t\t\t\t\t\ttick.unref?.();\n\t\t\t\t\t} else if (tick !== undefined) {\n\t\t\t\t\t\tclearInterval(tick);\n\t\t\t\t\t\ttick = undefined;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst refreshFocus = () => {\n\t\t\t\t\tif (disposed) return;\n\t\t\t\t\tdirty = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treport(error);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst scheduleRefresh = () => {\n\t\t\t\t\tif (disposed) return;\n\t\t\t\t\tdirty = true;\n\t\t\t\t\tif (scheduled) return;\n\t\t\t\t\tscheduled = true;\n\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\tscheduled = false;\n\t\t\t\t\t\tif (dirty) refreshFocus();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tconst unsubscribePanel = subscribeAgentPanel(session, scheduleRefresh);\n\t\t\t\tconst unwatchBridge = bridge?.subscribe(scheduleRefresh);\n\t\t\t\tconst unsubscribe = () => {\n\t\t\t\t\tunsubscribePanel();\n\t\t\t\t\tunwatchBridge?.();\n\t\t\t\t};\n\t\t\t\tsyncTick();\n\t\t\t\treturn {\n\t\t\t\t\tinvalidate() {\n\t\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\t\tcachedRowLines = [];\n\t\t\t\t\t},\n\t\t\t\t\t/** The id of the row last drawn on `row`, so a click on a row whose item changed is not taken. */\n\t\t\t\t\tpaintedRowKey(row: number): string | undefined {\n\t\t\t\t\t\tif (paintedFocus === undefined) return undefined;\n\t\t\t\t\t\tconst { rows, ...view } = paintedFocus;\n\t\t\t\t\t\treturn agentPanelRowIdAtLine(rows, view, row);\n\t\t\t\t\t},\n\t\t\t\t\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\t\t\t\t\tif (focus.helpOpen || paintedFocus === undefined || !isSingleLeftClick(event)) return undefined;\n\t\t\t\t\t\t// The rows the reader saw: the panel's rows can change before it paints them again.\n\t\t\t\t\t\tconst { rows, ...view } = paintedFocus;\n\t\t\t\t\t\tconst id = agentPanelRowIdAtLine(rows, view, event.y);\n\t\t\t\t\t\tif (id === undefined) return undefined;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfocus.click(id);\n\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t},\n\t\t\t\t\trender(width: number) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst w = +width;\n\t\t\t\t\t\t\tif (dirty || materializedScroll !== focus.scroll) {\n\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpaintedFocus = undefined;\n\t\t\t\t\t\t\tif (focus.helpOpen)\n\t\t\t\t\t\t\t\treturn renderNavKeyOverlay(\n\t\t\t\t\t\t\t\t\t\"keys · agents\",\n\t\t\t\t\t\t\t\t\tagentPanelKeys(focus.selected(), keys).concat([\n\t\t\t\t\t\t\t\t\t\t{ keys: focus.showMain ? \"↑ on main\" : \"↑ on the first row\", label: \"back to prompt\" },\n\t\t\t\t\t\t\t\t\t\t{ action: \"app.agents.chord\", label: \"then the stop-all key: stop all background work\" },\n\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\t\tw,\n\t\t\t\t\t\t\t\t\tstyle,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tlet rowLines: string[];\n\t\t\t\t\t\t\tif (!Number.isFinite(w)) {\n\t\t\t\t\t\t\t\trowLines = renderAgentPanelRows(currentRows, w, style, {\n\t\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t...focusMarks(),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst fadedMask = sliceFadedMask(\n\t\t\t\t\t\t\t\t\tcurrentRows,\n\t\t\t\t\t\t\t\t\tfocus.scroll,\n\t\t\t\t\t\t\t\t\tAGENT_PANEL_FOCUSED_ROWS,\n\t\t\t\t\t\t\t\t\tstate.model,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tcachedRows === currentRows &&\n\t\t\t\t\t\t\t\t\tcachedWidth === w &&\n\t\t\t\t\t\t\t\t\tcachedSelectedId === focus.selectedId &&\n\t\t\t\t\t\t\t\t\tcachedScroll === focus.scroll &&\n\t\t\t\t\t\t\t\t\tcachedMain === focus.showMain &&\n\t\t\t\t\t\t\t\t\tcachedViewed === focusViewed &&\n\t\t\t\t\t\t\t\t\tcachedFaded === fadedMask\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\trowLines = cachedRowLines;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trowLines = renderAgentPanelRows(currentRows, w, style, {\n\t\t\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t\t...focusMarks(),\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tcachedRows = currentRows;\n\t\t\t\t\t\t\t\t\tcachedWidth = w;\n\t\t\t\t\t\t\t\t\tcachedSelectedId = focus.selectedId;\n\t\t\t\t\t\t\t\t\tcachedScroll = focus.scroll;\n\t\t\t\t\t\t\t\t\tcachedMain = focus.showMain;\n\t\t\t\t\t\t\t\t\tcachedViewed = focusViewed;\n\t\t\t\t\t\t\t\t\tcachedFaded = fadedMask;\n\t\t\t\t\t\t\t\t\tcachedRowLines = rowLines;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfocus.notePainted(currentRows.slice(focus.scroll, focus.scroll + AGENT_PANEL_FOCUSED_ROWS));\n\t\t\t\t\t\t\tpaintedFocus = {\n\t\t\t\t\t\t\t\trows: currentRows,\n\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn [...rowLines, truncateToWidth(renderAgentPanelHint(focus, w, style, keys), w)];\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleInput(data: string) {\n\t\t\t\t\t\tif (isPhysicalCtrlC(data)) {\n\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (dirty) {\n\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (currentRows.length === 0) {\n\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfocus.handleInput(data, (input, key) =>\n\t\t\t\t\t\t\t\tmatchesKey(input, key as Parameters<typeof matchesKey>[1]),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t\tdispose() {\n\t\t\t\t\t\tif (disposed) return;\n\t\t\t\t\t\tdisposed = true;\n\t\t\t\t\t\tif (tick !== undefined) clearInterval(tick);\n\t\t\t\t\t\tmodelColumn.dispose();\n\t\t\t\t\t\tunsubscribe();\n\t\t\t\t\t\tif (!finished) queueMicrotask(finish);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t\t{ overlay: false, purpose: \"navigation\", handlesCtrlC: true, deferInlineCustomUiFocus: true },\n\t\t);\n\t} finally {\n\t\ttry {\n\t\t\tif (hidden) setAgentPanelVisible(session, true);\n\t\t} catch (error) {\n\t\t\treport(error);\n\t\t} finally {\n\t\t\tstate.open = false;\n\t\t}\n\t}\n\tawait next?.();\n}\n\nexport function setAgentPanelVisible(session: object, visible: boolean): void {\n\tconst state = panelState(session);\n\tstate.hideCount = visible ? Math.max(0, state.hideCount - 1) : state.hideCount + 1;\n\tstate.setVisible?.(state.hideCount === 0);\n}\n\nexport function agentPanelCounts(session: AgentPanelSession & object): AgentPanelCounts {\n\ttry {\n\t\treturn { ...rankPanelSession(session, { start: 0, limit: 0, cap: 1 }).counts };\n\t} catch (error) {\n\t\tconst state = panelState(session);\n\t\tif (state.reportOnce !== undefined) state.reportOnce(error);\n\t\telse state.onSourceError?.(sourceError(error));\n\t\treturn { ...EMPTY_PANEL_COUNTS };\n\t}\n}\n\nexport function agentPanelHasRows(session: AgentPanelSession & object): boolean {\n\treturn agentPanelCounts(session).total > 0;\n}\n"]}
1
+ {"version":3,"file":"agent-panel-bridge.js","sourceRoot":"","sources":["../../../src/modes/rpc/agent-panel-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhH,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,GACd,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAIN,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,GACjB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,GACzB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAuB,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,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port type { ExtensionUIContext } from \"../../core/extensions/index.js\";\nimport {\n\tcountPanelRow,\n\tisRestingPanelRow,\n\tNO_PANEL_ROWS,\n\tnestedShellListed,\n\tpanelRowListed,\n} from \"../../core/tasks/agent-panel-rules.ts\";\nimport {\n\ttype AgentPanelItem,\n\ttype AgentPanelSession,\n\ttype AgentPanelSourceHub,\n\tagentPanelExtensionItems,\n\tagentPanelSourceHubOf,\n\tagentPanelSourcesGeneration,\n\tdismissedAgentPanelItems,\n\tlazyTaskPanelItem,\n\tmaterializePanelItem,\n\tnotifyAgentPanelChanged,\n\topenAgentPanelItem,\n\tsampleAgentPanelSources,\n\tsourceError,\n\tstopAgentPanelItem,\n\tsubscribeAgentPanel,\n\ttaskPanelItem,\n\ttaskPanelRole,\n\ttaskPanelState,\n\ttaskRunGeneration,\n} from \"../../core/tasks/agent-panel-source.ts\";\nimport {\n\tlatestSubagentAttempt,\n\tlatestSubagentAttempts,\n\tsupersededSettledAttempts,\n} from \"../../core/tasks/completion.js\";\nimport type { TaskId, TaskRecord } from \"../../core/tasks/contracts.js\";\nimport { taskClockOf, taskClockRunning } from \"../../core/tasks/live-elapsed.js\";\nimport { getOwnerTaskStore, type OwnerTaskStore } from \"../../core/tasks/owner-store.js\";\nimport { launchedTaskViewSource, ownerTaskViewSource } from \"../../core/tasks/task-view-source.js\";\nimport { type AgentViewBridge, agentViewBridge } from \"../interactive/agent-view/agent-view-bridge.ts\";\nimport {\n\tAGENT_PANEL_FOCUSED_ROWS,\n\tAGENT_PANEL_IDLE_ROWS,\n\tAGENT_PANEL_MAIN_ID,\n\tAgentPanelFocus,\n\tAgentPanelModel,\n\ttype AgentPanelRow,\n\ttype AgentPanelStyle,\n\tagentPanelKeys,\n\tagentPanelRowIdAtLine,\n\tisActivePanelRow,\n\tisFinishedPanelRow,\n\tpanelTaskId,\n\trenderAgentPanelHint,\n\trenderAgentPanelRows,\n} from \"../interactive/components/agent-panel.ts\";\nimport { ModelColumn } from \"../interactive/components/model-column.ts\";\nimport { renderNavKeyOverlay } from \"../interactive/components/nav-keys.ts\";\nimport { isSingleLeftClick } from \"../interactive/components/single-click.ts\";\nimport { dismissedTasks } from \"../interactive/components/task-dismissal.ts\";\nimport { taskDisplayText } from \"../interactive/components/task-row.js\";\nimport { isPhysicalCtrlC } from \"../interactive/interactive-key-identity.ts\";\nimport { getGlobalTheme } from \"../interactive/theme/global-theme.ts\";\nimport { theme } from \"../interactive/theme/theme.js\";\nimport { showTaskInspector, type TaskInspectorUi } from \"./task-ui-bridge.js\";\n\nexport interface AgentPanelCounts {\n\t/** Every row the panel lists: ↓ focuses the panel while it is not 0. */\n\treadonly total: number;\n\t/** The subagent rows among them, folded rows included; the hint counts only these as agents. */\n\treadonly agents?: number;\n\treadonly needsInput: number;\n\t/** Running background shells: counted in the hint line, listed in /tasks rather than the panel. */\n\treadonly shells?: number;\n\t/** The chat's subagents in /tasks, listed in the panel or not: the hint points there once the panel lists none. */\n\treadonly subagents?: number;\n}\n\nconst EMPTY_PANEL_COUNTS: AgentPanelCounts = { ...NO_PANEL_ROWS, shells: 0, subagents: 0 };\n\ntype PanelRankCache = PanelRanking & {\n\treadonly store: OwnerTaskStore | undefined;\n\treadonly revision: number;\n\treadonly finishedRevision: number;\n\treadonly hub: AgentPanelSourceHub | undefined;\n\treadonly generation: number;\n\treadonly dismissed: ReadonlySet<string>;\n\treadonly bridge: AgentViewBridge | undefined;\n\t/** What the bridge said the screen shows when this was ranked. */\n\treadonly requested: TaskId | undefined;\n};\n\ninterface PanelRanking {\n\treadonly rows: AgentPanelRow[];\n\treadonly counts: AgentPanelCounts;\n\treadonly main: boolean;\n\t/** The row of the subagent the screen shows; undefined while it shows main. */\n\treadonly viewed?: string;\n}\n\nfunction rankingOf(cache: PanelRankCache, rows: AgentPanelRow[] = cache.rows): PanelRanking {\n\treturn {\n\t\trows,\n\t\tcounts: cache.counts,\n\t\tmain: cache.main,\n\t\t...(cache.viewed === undefined ? {} : { viewed: cache.viewed }),\n\t};\n}\n\n/**\n * The row id of the subagent the screen shows, as the panel lists it: a resumed subagent is its latest attempt, so the\n * mark follows it. Undefined while the screen shows main, or shows nothing this session lists.\n */\nfunction viewedRowId(requested: TaskId | undefined, tasks: readonly TaskRecord[]): string | undefined {\n\tif (requested === undefined) return undefined;\n\tconst latest = latestSubagentAttempt(tasks, requested);\n\treturn latest?.kind === \"agent\" ? `task:${latest.ref.taskId}` : undefined;\n}\n\n/**\n * The shells each subagent in `tasks` launched that still run, by the row id of the subagent's listed attempt, oldest\n * first: they are listed under it. A shell names the attempt that launched it, so a resumed subagent keeps the shells\n * its earlier attempts started.\n */\nfunction nestedShells(\n\ttasks: readonly TaskRecord[],\n\townerTasks: readonly TaskRecord[],\n): ReadonlyMap<string, readonly TaskRecord[]> {\n\tconst nested = new Map<string, TaskRecord[]>();\n\t// Grouped once, on the first shell listed: every lookup after it is a map read.\n\tlet latestOf: ((taskId: TaskId) => TaskRecord | undefined) | undefined;\n\tfor (const task of ownerTasks) {\n\t\tif (task.parentTaskId === undefined || taskPanelRole(task) !== \"shell\") continue;\n\t\tif (!nestedShellListed(taskPanelState(task))) continue;\n\t\tlatestOf ??= latestSubagentAttempts(tasks);\n\t\tconst parent = latestOf(task.parentTaskId);\n\t\tif (parent?.kind !== \"agent\") continue;\n\t\tconst rowId = `task:${parent.ref.taskId}`;\n\t\tconst shells = nested.get(rowId);\n\t\tif (shells === undefined) nested.set(rowId, [task]);\n\t\telse shells.push(task);\n\t}\n\tfor (const shells of nested.values()) shells.sort((a, b) => a.launchOrdinal - b.launchOrdinal);\n\treturn nested;\n}\n\ninterface PanelState {\n\treadonly model: AgentPanelModel;\n\treadonly reported: Set<string>;\n\trankCaches?: Map<number, PanelRankCache>;\n\thideCount: number;\n\topen?: boolean;\n\tonSourceError?: (error: Error) => void;\n\treportOnce?: (error: unknown) => void;\n\tsetVisible?: (visible: boolean) => void;\n}\n\nconst states = new WeakMap<object, PanelState>();\nconst boundSessions = new Set<AgentPanelSession & object>();\n\nfunction panelState(target: object): PanelState {\n\tlet state = states.get(target);\n\tif (state === undefined) {\n\t\tconst store = getOwnerTaskStore(target);\n\t\tif (store !== undefined) state = states.get(store);\n\t}\n\tif (state === undefined) {\n\t\tfor (const session of boundSessions) {\n\t\t\tif (getOwnerTaskStore(session) === target) {\n\t\t\t\tstate = states.get(session);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tstate ??= { model: new AgentPanelModel(), reported: new Set(), hideCount: 0 };\n\tstates.set(target, state);\n\tconst store = getOwnerTaskStore(target);\n\tif (store !== undefined) states.set(store, state);\n\treturn state;\n}\n\nfunction sameIds(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n\tif (a.size !== b.size) return false;\n\tfor (const id of a) if (!b.has(id)) return false;\n\treturn true;\n}\n\nfunction safeLabel(value: unknown): string {\n\tconst raw = typeof value === \"string\" ? value : sourceError(value).message;\n\treturn taskDisplayText(raw.replace(/\\x1b\\][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)/g, \"\"))\n\t\t.toWellFormed()\n\t\t.replace(/\\p{Default_Ignorable_Code_Point}/gu, \"\");\n}\n\nfunction notifyPanelWarning(\n\tnotify: ((message: string, type?: \"info\" | \"warning\" | \"error\") => void) | undefined,\n\tmessage: string,\n): void {\n\ttry {\n\t\tnotify?.(`Agent panel: a source failed: ${safeLabel(message)}`, \"warning\");\n\t} catch {}\n}\n\nfunction reportOnceWith(\n\tstate: PanelState,\n\tnotify: ((message: string, type?: \"info\" | \"warning\" | \"error\") => void) | undefined,\n\terror: unknown,\n): void {\n\tconst message = sourceError(error).message;\n\tif (state.reported.has(message)) return;\n\tstate.reported.add(message);\n\tnotifyPanelWarning(notify, message);\n}\n\nfunction panelTheme(): typeof theme {\n\treturn getGlobalTheme() ?? theme;\n}\n\nconst THEMED_STYLE: AgentPanelStyle = {\n\tdim: (text) => panelTheme().fg(\"dim\", text),\n\ttext: (text) => panelTheme().fg(\"text\", text),\n\tmuted: (text) => panelTheme().fg(\"muted\", text),\n\tborder: (text) => panelTheme().fg(\"borderMuted\", text),\n\tbold: (text) => panelTheme().bold(text),\n\taccent: (text) => panelTheme().fg(\"accent\", text),\n\tsuccess: (text) => panelTheme().fg(\"success\", text),\n\terror: (text) => panelTheme().fg(\"error\", text),\n\twarning: (text) => panelTheme().fg(\"warning\", text),\n};\n\nexport function themedAgentPanelStyle(): AgentPanelStyle {\n\treturn THEMED_STYLE;\n}\n\nfunction currentPanelItem(store: OwnerTaskStore | undefined, row: AgentPanelRow): AgentPanelRow {\n\tconst taskId = panelTaskId(row);\n\tconst task = taskId === undefined ? undefined : store?.taskRecord(taskId);\n\tif (task === undefined || store === undefined) return materializePanelItem(row);\n\treturn taskPanelItem(task, taskClockOf(ownerTaskViewSource(store)));\n}\n\nfunction rankPanelSession(\n\tsession: AgentPanelSession & object,\n\toptions: { readonly start?: number; readonly limit?: number; readonly cap?: number } = {},\n): PanelRanking {\n\tconst state = panelState(session);\n\tconst dismissed = dismissedAgentPanelItems(session);\n\tconst store = getOwnerTaskStore(session);\n\tconst cap = options.cap ?? Number.POSITIVE_INFINITY;\n\tconst revision = store?.panelRevision ?? 0;\n\tconst hub = agentPanelSourceHubOf(session);\n\tconst generation = agentPanelSourcesGeneration();\n\tconst start = Math.max(0, options.start ?? 0);\n\tconst limit = Math.max(0, options.limit ?? Number.POSITIVE_INFINITY);\n\tconst materialize = (row: AgentPanelRow): AgentPanelRow => currentPanelItem(store, row);\n\tconst bridge = agentViewBridge(session);\n\tconst requested = bridge?.viewedTaskId();\n\tconst cached =\n\t\tstate.rankCaches?.get(cap) ??\n\t\t(limit === 0\n\t\t\t? (state.rankCaches?.get(AGENT_PANEL_IDLE_ROWS) ?? state.rankCaches?.get(Number.POSITIVE_INFINITY))\n\t\t\t: undefined);\n\tif (\n\t\tcached !== undefined &&\n\t\tcached.store === store &&\n\t\tcached.revision === revision &&\n\t\tcached.finishedRevision === state.model.finishedRevision &&\n\t\tcached.hub === hub &&\n\t\tcached.generation === generation &&\n\t\tcached.bridge === bridge &&\n\t\tcached.requested === requested &&\n\t\tsameIds(cached.dismissed, dismissed)\n\t) {\n\t\tconst end = Math.min(cached.rows.length, start + limit);\n\t\tif (end <= start) return rankingOf(cached);\n\t\tlet rows: AgentPanelRow[] | undefined;\n\t\tfor (let index = start; index < end; index++) {\n\t\t\tconst current = cached.rows[index]!;\n\t\t\tconst base = materialize(state.model.baseOf(current));\n\t\t\tconst next = state.model.withElapsed(base);\n\t\t\tif (\n\t\t\t\tnext === current ||\n\t\t\t\t(base === state.model.baseOf(current) && elapsedSecond(next.elapsedMs) === elapsedSecond(current.elapsedMs))\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\trows ??= cached.rows.slice();\n\t\t\trows[index] = next;\n\t\t}\n\t\tif (rows === undefined) return rankingOf(cached);\n\t\tstate.rankCaches?.set(cap, { ...cached, rows });\n\t\treturn rankingOf(cached, rows);\n\t}\n\tconst extItems = agentPanelExtensionItems(session, state.onSourceError);\n\tconst source = store === undefined ? undefined : ownerTaskViewSource(store);\n\tconst tasks = source?.backgroundTasks ?? [];\n\t// A resumed or woken subagent is listed as its latest attempt only.\n\tconst superseded = tasks.length === 0 ? new Set<TaskId>() : supersededSettledAttempts(tasks);\n\t// The subagent the screen shows stays listed while it is shown, finished or not; its own shells are listed under it.\n\tconst viewed = viewedRowId(requested, tasks);\n\tlet viewedRow: (() => AgentPanelRow) | undefined;\n\t// Only a subagent's running shell is listed under it: with none running, the owner's tasks are not read again.\n\tconst shellsOf =\n\t\tbridge === undefined || store === undefined || !store.hasRunningChildTasks\n\t\t\t? undefined\n\t\t\t: nestedShells(tasks, store.ownerBackgroundTasks);\n\t// Resting rows, such as a stopped subagent, stay listed only while something is active: a\n\t// row, or a running shell, which is not one.\n\tlet active = false;\n\tfor (const item of extItems) {\n\t\tif ((item.kind === \"agent\" || item.kind === \"shell\") && isActivePanelRow(item)) {\n\t\t\tactive = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!active) {\n\t\tfor (const task of tasks) {\n\t\t\tif (task.parentTaskId !== undefined || (superseded.size > 0 && superseded.has(task.ref.taskId))) continue;\n\t\t\t// Background work that is not a row (a shell) is active while it runs.\n\t\t\tif (\n\t\t\t\ttaskPanelRole(task) === \"agent\"\n\t\t\t\t\t? isActivePanelRow({ state: taskPanelState(task) })\n\t\t\t\t\t: task.execution.kind !== \"settled\"\n\t\t\t) {\n\t\t\t\tactive = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst { now, pass } = state.model.beginPass();\n\tconst inputRows: AgentPanelRow[] = [];\n\tconst runningRows: AgentPanelRow[] = [];\n\tconst otherRows: AgentPanelRow[] = [];\n\tconst finishedRows: AgentPanelRow[] = [];\n\tlet counts = NO_PANEL_ROWS;\n\tlet shells = 0;\n\tlet subagents = 0;\n\tconst room = () => inputRows.length + runningRows.length + otherRows.length + finishedRows.length < cap;\n\t/** Whether the panel lists a row, by the shared rules; a finished row it lists starts fading. */\n\tconst listed = (\n\t\trowId: string,\n\t\tkind: AgentPanelItem[\"kind\"],\n\t\trowState: AgentPanelItem[\"state\"],\n\t\tfinished: boolean,\n\t\tkept: boolean,\n\t\tfadeKey: string,\n\t\tnative: boolean,\n\t\trun: string | undefined,\n\t): boolean => {\n\t\tconst retired = isRestingPanelRow(kind, rowState) && state.model.retireResting(rowId, active, pass, run);\n\t\tif (!panelRowListed(kind, rowState, finished, { active, retired, kept })) return false;\n\t\t// A shown subagent that finished is kept, not faded: it leaves once the screen shows something else.\n\t\tif (finished && !kept) state.model.keepFinished(fadeKey, true, now, pass, native);\n\t\tcounts = countPanelRow(counts, kind, rowState);\n\t\treturn true;\n\t};\n\tconst place = (rowState: AgentPanelItem[\"state\"], finished: boolean, row: () => AgentPanelRow) => {\n\t\tif (finished) {\n\t\t\tif (room()) finishedRows.push(row());\n\t\t} else if (rowState === \"input\") {\n\t\t\tif (inputRows.length < cap) inputRows.push(row());\n\t\t} else if (rowState === \"running\") {\n\t\t\tif (inputRows.length + runningRows.length < cap) runningRows.push(row());\n\t\t} else if (inputRows.length + runningRows.length + otherRows.length < cap) otherRows.push(row());\n\t};\n\tconst pushItem = (item: AgentPanelItem) => {\n\t\t// Shells are counted on the hint line and listed in /tasks, not here.\n\t\tif (item.kind === \"shell\") {\n\t\t\tif (!isFinishedPanelRow(item)) shells++;\n\t\t\treturn;\n\t\t}\n\t\tconst finished = isFinishedPanelRow(item);\n\t\tif (!listed(item.id, item.kind, item.state, finished, false, item.id, false, item.runGeneration)) return;\n\t\tplace(item.state, finished, () => item);\n\t};\n\n\tif (store !== undefined && source !== undefined) {\n\t\tconst taskDismissed = dismissedTasks(source);\n\t\tconst storeDismissed = dismissedTasks(store);\n\t\tconst sourceClocks = taskClockOf(source);\n\t\tfor (let i = tasks.length - 1; i >= 0; i--) {\n\t\t\tconst task = tasks[i]!;\n\t\t\tif (superseded.size > 0 && superseded.has(task.ref.taskId)) continue;\n\t\t\tif (task.parentTaskId !== undefined) continue;\n\t\t\t// Only subagents are rows. A shell is counted on the hint line and listed in /tasks.\n\t\t\tconst role = taskPanelRole(task);\n\t\t\tif (role !== \"agent\") {\n\t\t\t\tif (role === \"shell\" && task.execution.kind !== \"settled\") shells++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsubagents++;\n\t\t\tconst id = task.ref.taskId;\n\t\t\tconst rowState = taskPanelState(task);\n\t\t\tconst finishedState =\n\t\t\t\ttask.execution.kind === \"settled\" &&\n\t\t\t\t(rowState === \"done\" || rowState === \"failed\" || rowState === \"stopped\");\n\t\t\tif (!finishedState) {\n\t\t\t\tif (dismissed.size > 0) dismissed.delete(`task:${id}`);\n\t\t\t\tif (taskDismissed.size > 0) taskDismissed.delete(id);\n\t\t\t\tif (storeDismissed.size > 0) storeDismissed.delete(id);\n\t\t\t} else if (dismissed.size > 0 && dismissed.has(`task:${id}`)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Every native task here is a subagent row: a stopped or interrupted one rests, a finished one leaves.\n\t\t\tconst shown = viewed === `task:${id}`;\n\t\t\tif (!listed(`task:${id}`, \"agent\", rowState, finishedState, shown, id, true, taskRunGeneration(task)))\n\t\t\t\tcontinue;\n\t\t\tconst row = () => lazyTaskPanelItem(task, sourceClocks);\n\t\t\tif (shown) viewedRow = row;\n\t\t\tplace(rowState, finishedState, row);\n\t\t\tfor (const shell of shellsOf?.get(`task:${id}`) ?? [])\n\t\t\t\tcounts = countPanelRow(counts, \"shell\", taskPanelState(shell));\n\t\t}\n\t}\n\n\tfor (let i = extItems.length - 1; i >= 0; i--) {\n\t\tconst item = extItems[i]!;\n\t\tif (item.kind === \"agent\" || item.kind === \"shell\") pushItem(item);\n\t}\n\n\tconst panelCounts = { ...counts, shells, subagents };\n\t// The main row leads the panel whenever it lists a subagent.\n\tconst main = counts.agents > 0;\n\tstate.model.endPass(pass);\n\tconst ranked = inputRows.concat(runningRows, otherRows, finishedRows);\n\tconst ordered = shellsOf === undefined || shellsOf.size === 0 ? ranked : withNestedShells(ranked, shellsOf, store);\n\tlet rows = Number.isFinite(cap) ? ordered.slice(0, cap) : ordered;\n\t// The panel below the prompt always draws the shown subagent's row and its shells: they take the last places when\n\t// they are further down.\n\tif (viewedRow !== undefined && viewed !== undefined && Number.isFinite(cap) && cap > 0) {\n\t\tconst shells = shellsOf?.get(viewed) ?? [];\n\t\tconst at = ordered.findIndex((row) => row.id === viewed);\n\t\t// Ranked past the cap, the shown row was never placed: it and its shells are made here.\n\t\tconst group = (\n\t\t\tat < 0\n\t\t\t\t? [viewedRow(), ...shells.map((shell) => taskPanelItem(shell, source && taskClockOf(source)))]\n\t\t\t\t: ordered.slice(at, at + 1 + shells.length)\n\t\t).slice(0, cap);\n\t\tif (at < 0 || at + group.length > cap)\n\t\t\trows = ordered\n\t\t\t\t.filter((row) => !group.includes(row))\n\t\t\t\t.slice(0, cap - group.length)\n\t\t\t\t.concat(group);\n\t}\n\tconst end = Math.min(rows.length, start + limit);\n\tfor (let index = start; index < end; index++) rows[index] = state.model.withElapsed(materialize(rows[index]!), now);\n\tstate.rankCaches ??= new Map();\n\tstate.rankCaches.set(cap, {\n\t\tstore,\n\t\trevision,\n\t\tfinishedRevision: state.model.finishedRevision,\n\t\thub,\n\t\tgeneration,\n\t\tdismissed: new Set(dismissed),\n\t\tbridge,\n\t\trequested,\n\t\trows,\n\t\tcounts: panelCounts,\n\t\tmain,\n\t\t...(viewed === undefined ? {} : { viewed }),\n\t});\n\treturn { rows, counts: panelCounts, main, ...(viewed === undefined ? {} : { viewed }) };\n}\n\n/** `ranked` with each subagent's own running shells right after its row. */\nfunction withNestedShells(\n\tranked: readonly AgentPanelRow[],\n\tshellsOf: ReadonlyMap<string, readonly TaskRecord[]>,\n\tstore: OwnerTaskStore | undefined,\n): AgentPanelRow[] {\n\tconst clocks = store === undefined ? undefined : taskClockOf(ownerTaskViewSource(store));\n\tconst rows: AgentPanelRow[] = [];\n\tfor (const row of ranked) {\n\t\trows.push(row);\n\t\tfor (const shell of shellsOf.get(row.id) ?? []) rows.push(taskPanelItem(shell, clocks));\n\t}\n\treturn rows;\n}\n\nexport function agentPanelRows(\n\tsession: AgentPanelSession & object,\n\twindow?: { readonly start?: number; readonly limit?: number },\n): AgentPanelRow[] {\n\treturn rankPanelSession(session, window).rows;\n}\n\n/** The widget the idle panel is drawn as. */\nexport const AGENT_PANEL_WIDGET_KEY = \"atomic.agent-panel\";\nconst WIDGET_KEY = AGENT_PANEL_WIDGET_KEY;\nconst TICK_MS = 1000;\nexport const AGENT_PANEL_REFRESH_WINDOW_MS = 50;\nexport const AGENT_PANEL_REFRESH_BUDGET_MS = 8;\nconst REFRESH_BURST = 4;\n\nfunction withinRefreshBudget(refreshes: number, spent: number): boolean {\n\tif (spent < AGENT_PANEL_REFRESH_BUDGET_MS) return true;\n\treturn refreshes < REFRESH_BURST && spent <= (refreshes + 1) * (AGENT_PANEL_REFRESH_BUDGET_MS / REFRESH_BURST);\n}\n\nfunction elapsedSecond(ms: number | undefined): number {\n\treturn ms === undefined ? -1 : Math.max(0, Math.floor(ms / 1000));\n}\n\nfunction sliceFadedMask(rows: readonly AgentPanelRow[], start: number, count: number, model: AgentPanelModel): number {\n\tconst end = Math.min(rows.length, start + count);\n\tlet mask = 0;\n\tfor (let i = start; i < end; i++) {\n\t\tif (model.faded(rows[i]!)) mask |= 1 << (i - start);\n\t}\n\treturn mask;\n}\n\nfunction sameUnfocusedRows(\n\tprev: readonly AgentPanelRow[],\n\tnext: readonly AgentPanelRow[],\n\tmodel: AgentPanelModel,\n): boolean {\n\tif (prev === next) return true;\n\tif (prev.length !== next.length || prev.length === 0) return false;\n\tconst limit = Math.min(prev.length, AGENT_PANEL_IDLE_ROWS);\n\tfor (let i = 0; i < limit; i++) {\n\t\tconst a = prev[i]!;\n\t\tconst b = next[i]!;\n\t\tif (\n\t\t\ta.id !== b.id ||\n\t\t\ta.kind !== b.kind ||\n\t\t\ta.state !== b.state ||\n\t\t\ta.name !== b.name ||\n\t\t\ta.task !== b.task ||\n\t\t\ta.tokens !== b.tokens ||\n\t\t\ta.model !== b.model ||\n\t\t\ta.thinking !== b.thinking ||\n\t\t\ta.queued !== b.queued ||\n\t\t\telapsedSecond(a.elapsedMs) !== elapsedSecond(b.elapsedMs) ||\n\t\t\tmodel.faded(a) !== model.faded(b)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/** Whether the rows change with time alone: a running clock, or a finished row that has not faded yet. */\nfunction panelRowsNeedClock(rows: readonly AgentPanelRow[], state: PanelState): boolean {\n\tfor (const row of rows) {\n\t\tif (taskClockRunning(row.state)) return true;\n\t\tif (isFinishedPanelRow(row) && !state.model.faded(row)) return true;\n\t}\n\treturn false;\n}\n\nexport function bindAgentPanel(\n\tsession: AgentPanelSession & object,\n\tui: Pick<ExtensionUIContext, \"setWidget\" | \"requestRender\"> &\n\t\tPartial<Pick<ExtensionUIContext, \"onWidgetRelease\" | \"notify\">>,\n\tonCounts?: (counts: AgentPanelCounts) => void,\n\t/** Where a click on a row opens that row's view; without it the rows take no clicks. */\n\tinspector?: TaskInspectorUi,\n): () => void {\n\tboundSessions.add(session);\n\tconst state = panelState(session);\n\tconst reportSource = (error: Error) => {\n\t\tconst message = sourceError(error).message;\n\t\tstate.reported.add(message);\n\t\tnotifyPanelWarning(ui.notify, message);\n\t};\n\tconst report = (error: unknown) => reportOnceWith(state, ui.notify, error);\n\tstate.onSourceError = reportSource;\n\tstate.reportOnce = report;\n\tconst faded = (row: AgentPanelRow) => state.model.faded(row);\n\tlet mounted = false;\n\tlet visible = state.hideCount === 0;\n\tlet disposed = false;\n\tlet dirty = false;\n\tlet currentHiddenBelow = 0;\n\tlet currentMain = false;\n\tlet currentViewed: string | undefined;\n\tlet lastCounts: AgentPanelCounts | undefined;\n\tlet scheduled = false;\n\tlet windowStart = Number.NEGATIVE_INFINITY;\n\tlet spent = 0;\n\tlet refreshes = 0;\n\tlet deferred: ReturnType<typeof setTimeout> | undefined;\n\tlet currentRows: AgentPanelRow[] = [];\n\tlet cachedRows: AgentPanelRow[] | undefined;\n\tlet cachedWidth = -1;\n\tlet cachedFaded = -1;\n\tlet cachedHiddenBelow = -1;\n\tlet cachedMain = false;\n\tlet cachedViewed: string | undefined;\n\t/** The rows the widget last drew, which a click is resolved against. */\n\tlet painted: { rows: readonly AgentPanelRow[]; hiddenBelow: number; main: boolean } | undefined;\n\tlet cachedLines: string[] = [];\n\tlet timer: ReturnType<typeof setInterval> | undefined;\n\t/** The panel's model column, measured afresh each time the panel is mounted. */\n\tconst modelColumn = new ModelColumn(() => {\n\t\tcachedRows = undefined;\n\t\tui.requestRender();\n\t});\n\n\tconst publishCounts = (counts: AgentPanelCounts) => {\n\t\tif (\n\t\t\tlastCounts !== undefined &&\n\t\t\tcounts.total === lastCounts.total &&\n\t\t\tcounts.needsInput === lastCounts.needsInput &&\n\t\t\tcounts.shells === lastCounts.shells &&\n\t\t\tcounts.subagents === lastCounts.subagents &&\n\t\t\tcounts.agents === lastCounts.agents\n\t\t)\n\t\t\treturn false;\n\t\tlastCounts = counts;\n\t\ttry {\n\t\t\tonCounts?.({ ...counts });\n\t\t} catch {}\n\t\treturn true;\n\t};\n\tconst stopTimer = () => {\n\t\tif (timer !== undefined) clearInterval(timer);\n\t\ttimer = undefined;\n\t};\n\tconst clearDeferred = () => {\n\t\tif (deferred !== undefined) clearTimeout(deferred);\n\t\tdeferred = undefined;\n\t};\n\tconst unmount = (resetCounts = true) => {\n\t\tcurrentRows = [];\n\t\tcurrentHiddenBelow = 0;\n\t\tcurrentMain = false;\n\t\tcurrentViewed = undefined;\n\t\tcachedRows = undefined;\n\t\tcachedHiddenBelow = -1;\n\t\tcachedLines = [];\n\t\tconst wasMounted = mounted;\n\t\tmounted = false;\n\t\tmodelColumn.reset();\n\t\tstopTimer();\n\t\tif (resetCounts) publishCounts(EMPTY_PANEL_COUNTS);\n\t\tif (wasMounted) {\n\t\t\ttry {\n\t\t\t\tui.setWidget(WIDGET_KEY, undefined);\n\t\t\t} catch {}\n\t\t}\n\t};\n\tconst update = () => {\n\t\tdirty = false;\n\t\tconst began = performance.now();\n\t\tif (began - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\twindowStart = began;\n\t\t\tspent = 0;\n\t\t\trefreshes = 0;\n\t\t}\n\t\ttry {\n\t\t\trefresh();\n\t\t} catch (error) {\n\t\t\treport(error);\n\t\t\tunmount(true);\n\t\t} finally {\n\t\t\tspent += Math.max(0, performance.now() - began);\n\t\t}\n\t};\n\tconst idleRows = () =>\n\t\trankPanelSession(session, { start: 0, limit: AGENT_PANEL_IDLE_ROWS, cap: AGENT_PANEL_IDLE_ROWS });\n\tconst refresh = () => {\n\t\tif (disposed) return;\n\t\tif (!visible) {\n\t\t\tsampleAgentPanelSources(session, state.onSourceError);\n\t\t\tunmount(false);\n\t\t\treturn;\n\t\t}\n\t\tsyncBridge();\n\t\tconst { rows, counts, main, viewed } = idleRows();\n\t\t// The prompt's hints still update when there are no rows to mount.\n\t\tconst changed = publishCounts(counts);\n\t\tif (rows.length === 0) {\n\t\t\tunmount(false);\n\t\t\tif (changed) ui.requestRender();\n\t\t\treturn;\n\t\t}\n\t\tcurrentHiddenBelow = Math.max(0, counts.total - rows.length);\n\t\tcurrentMain = main;\n\t\tcurrentViewed = viewed;\n\t\tif (!mounted || !sameUnfocusedRows(currentRows, rows, state.model)) {\n\t\t\tcurrentRows = rows;\n\t\t}\n\t\tif (!mounted) {\n\t\t\tmounted = true;\n\t\t\tui.setWidget(\n\t\t\t\tWIDGET_KEY,\n\t\t\t\t() => ({\n\t\t\t\t\tinvalidate() {\n\t\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\t\tcachedHiddenBelow = -1;\n\t\t\t\t\t\tcachedLines = [];\n\t\t\t\t\t},\n\t\t\t\t\t/** The id of the row last drawn on `row`, so a click on a row whose item changed is not taken. */\n\t\t\t\t\tpaintedRowKey(row: number): string | undefined {\n\t\t\t\t\t\tif (!visible || painted === undefined) return undefined;\n\t\t\t\t\t\treturn agentPanelRowIdAtLine(\n\t\t\t\t\t\t\tpainted.rows,\n\t\t\t\t\t\t\t{ hiddenBelow: painted.hiddenBelow, showMain: painted.main },\n\t\t\t\t\t\t\trow,\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\t\t\t\t\tif (!visible || inspector === undefined || painted === undefined || !isSingleLeftClick(event))\n\t\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t\t// The rows the reader saw: the panel's rows can change before it paints them again.\n\t\t\t\t\t\tconst id = agentPanelRowIdAtLine(\n\t\t\t\t\t\t\tpainted.rows,\n\t\t\t\t\t\t\t{ hiddenBelow: painted.hiddenBelow, showMain: painted.main },\n\t\t\t\t\t\t\tevent.y,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (id === undefined) return undefined;\n\t\t\t\t\t\tif (id === AGENT_PANEL_MAIN_ID) {\n\t\t\t\t\t\t\t// The main row is the chat the reader is in, unless the screen shows a subagent: then it shows main.\n\t\t\t\t\t\t\tconst bridge = agentViewBridge(session);\n\t\t\t\t\t\t\tif (bridge?.viewedTaskId() !== undefined) bridge.requestView(undefined);\n\t\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst row = painted.rows.find((candidate) => candidate.id === id);\n\t\t\t\t\t\tif (row === undefined) return undefined;\n\t\t\t\t\t\topenPanelRow(session, inspector, materializePanelItem(row), report).catch(report);\n\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t},\n\t\t\t\t\trender(width: number) {\n\t\t\t\t\t\tif (!visible) return [];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst w = +width;\n\t\t\t\t\t\t\tif (dirty && deferred === undefined) {\n\t\t\t\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\t\t\t\tif (now - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\t\t\t\t\t\twindowStart = now;\n\t\t\t\t\t\t\t\t\tspent = 0;\n\t\t\t\t\t\t\t\t\trefreshes = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (withinRefreshBudget(refreshes, spent)) {\n\t\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\t\trefreshes++;\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tconst { rows, counts, main, viewed } = idleRows();\n\t\t\t\t\t\t\t\t\t\tpublishCounts(counts);\n\t\t\t\t\t\t\t\t\t\tcurrentHiddenBelow = Math.max(0, counts.total - rows.length);\n\t\t\t\t\t\t\t\t\t\tcurrentMain = main;\n\t\t\t\t\t\t\t\t\t\tcurrentViewed = viewed;\n\t\t\t\t\t\t\t\t\t\tif (!sameUnfocusedRows(currentRows, rows, state.model)) {\n\t\t\t\t\t\t\t\t\t\t\tcurrentRows = rows;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (rowsChangeWithTime(currentRows)) {\n\t\t\t\t\t\t\t\t\t\t\ttimer ??= setInterval(update, TICK_MS);\n\t\t\t\t\t\t\t\t\t\t\ttimer.unref?.();\n\t\t\t\t\t\t\t\t\t\t} else stopTimer();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tspent += Math.max(0, performance.now() - now);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpainted = { rows: currentRows, hiddenBelow: currentHiddenBelow, main: currentMain };\n\t\t\t\t\t\t\tif (!Number.isFinite(w)) {\n\t\t\t\t\t\t\t\treturn renderAgentPanelRows(currentRows, w, THEMED_STYLE, {\n\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\thiddenBelow: currentHiddenBelow,\n\t\t\t\t\t\t\t\t\tshowMain: currentMain,\n\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t...idleMarks(),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst fadedMask = sliceFadedMask(currentRows, 0, AGENT_PANEL_IDLE_ROWS, state.model);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tcachedRows === currentRows &&\n\t\t\t\t\t\t\t\tcachedWidth === w &&\n\t\t\t\t\t\t\t\tcachedFaded === fadedMask &&\n\t\t\t\t\t\t\t\tcachedHiddenBelow === currentHiddenBelow &&\n\t\t\t\t\t\t\t\tcachedMain === currentMain &&\n\t\t\t\t\t\t\t\tcachedViewed === currentViewed\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn cachedLines;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst renderStart = performance.now();\n\t\t\t\t\t\t\tconst lines = renderAgentPanelRows(currentRows, w, THEMED_STYLE, {\n\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\thiddenBelow: currentHiddenBelow,\n\t\t\t\t\t\t\t\tshowMain: currentMain,\n\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t...idleMarks(),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tspent += Math.max(0, performance.now() - renderStart);\n\t\t\t\t\t\t\tcachedRows = currentRows;\n\t\t\t\t\t\t\tcachedWidth = w;\n\t\t\t\t\t\t\tcachedFaded = fadedMask;\n\t\t\t\t\t\t\tcachedHiddenBelow = currentHiddenBelow;\n\t\t\t\t\t\t\tcachedMain = currentMain;\n\t\t\t\t\t\t\tcachedViewed = currentViewed;\n\t\t\t\t\t\t\tcachedLines = lines;\n\t\t\t\t\t\t\treturn lines;\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\t{ placement: \"belowEditor\" },\n\t\t\t);\n\t\t}\n\t\tif (rowsChangeWithTime(currentRows)) {\n\t\t\ttimer ??= setInterval(update, TICK_MS);\n\t\t\ttimer.unref?.();\n\t\t} else stopTimer();\n\t\tui.requestRender();\n\t};\n\tconst rowsChangeWithTime = (rows: readonly AgentPanelRow[]): boolean => panelRowsNeedClock(rows, state);\n\t/** The viewed mark and nesting, only while the screen can show a subagent: without a bridge, today's rows. */\n\tconst idleMarks = () =>\n\t\twatchedBridge === undefined\n\t\t\t? {}\n\t\t\t: { nestShells: true, ...(currentViewed === undefined ? {} : { viewedId: currentViewed }) };\n\t/** What the screen shows changes the mark and keeps its row: the panel follows the session's bridge. */\n\tlet watchedBridge: AgentViewBridge | undefined;\n\tlet unwatchBridge = () => {};\n\tconst syncBridge = () => {\n\t\tconst bridge = agentViewBridge(session);\n\t\tif (bridge === watchedBridge) return;\n\t\tunwatchBridge();\n\t\twatchedBridge = bridge;\n\t\tunwatchBridge = bridge?.subscribe(scheduleUpdate) ?? (() => {});\n\t};\n\tconst scheduleUpdate = () => {\n\t\tif (disposed) return;\n\t\tdirty = true;\n\t\tif (scheduled || deferred !== undefined) return;\n\t\tscheduled = true;\n\t\tqueueMicrotask(() => {\n\t\t\tscheduled = false;\n\t\t\tif (disposed || !dirty || deferred !== undefined) return;\n\t\t\tconst now = performance.now();\n\t\t\tif (now - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\twindowStart = now;\n\t\t\t\tspent = 0;\n\t\t\t\trefreshes = 0;\n\t\t\t}\n\t\t\tif (withinRefreshBudget(refreshes, spent)) {\n\t\t\t\trefreshes++;\n\t\t\t\tupdate();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeferred = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tdeferred = undefined;\n\t\t\t\t\tif (disposed || !dirty) return;\n\t\t\t\t\tconst began = performance.now();\n\t\t\t\t\tif (began - windowStart >= AGENT_PANEL_REFRESH_WINDOW_MS) {\n\t\t\t\t\t\twindowStart = began;\n\t\t\t\t\t\tspent = 0;\n\t\t\t\t\t\trefreshes = 0;\n\t\t\t\t\t}\n\t\t\t\t\trefreshes++;\n\t\t\t\t\tupdate();\n\t\t\t\t},\n\t\t\t\tMath.max(0, windowStart + AGENT_PANEL_REFRESH_WINDOW_MS - now),\n\t\t\t);\n\t\t\tdeferred.unref?.();\n\t\t});\n\t};\n\tconst unsubscribe = subscribeAgentPanel(session, scheduleUpdate);\n\tconst unwatchRelease = ui.onWidgetRelease?.(WIDGET_KEY, () => {\n\t\tmounted = false;\n\t});\n\tstate.setVisible = (value) => {\n\t\tif (visible === value) return;\n\t\tvisible = value;\n\t\tupdate();\n\t};\n\tupdate();\n\treturn () => {\n\t\tdisposed = true;\n\t\tboundSessions.delete(session);\n\t\tunwatchBridge();\n\t\tclearDeferred();\n\t\tstate.setVisible = undefined;\n\t\tif (state.onSourceError === reportSource) state.onSourceError = undefined;\n\t\tif (state.reportOnce === report) state.reportOnce = undefined;\n\t\tunsubscribe();\n\t\tunwatchRelease?.();\n\t\tunmount();\n\t};\n}\n\n/**\n * Open a panel row: a subagent is shown on the screen; a subagent's shell opens its output, and an extension's row its\n * own view, and leaving either returns to the focused panel with the row selected.\n */\nasync function openPanelRow(\n\tsession: AgentPanelSession & object,\n\tui: TaskInspectorUi,\n\titem: AgentPanelItem,\n\treport: (error: unknown) => void,\n): Promise<void> {\n\tconst store = getOwnerTaskStore(session);\n\tconst taskId = panelTaskId(item);\n\tconst bridge = agentViewBridge(session);\n\tif (taskId !== undefined && item.kind === \"agent\") {\n\t\t// The screen shows the subagent where the main chat was; the prompt below now writes to it. Every interactive\n\t\t// session has a bridge: without one there is no screen to show it on.\n\t\tif (bridge !== undefined) bridge.requestView(taskId);\n\t\telse ui.notify?.(`Could not open ${safeLabel(item.name)}.`, \"warning\");\n\t\treturn;\n\t}\n\tconst shell = bridge === undefined || taskId === undefined ? undefined : store?.taskRecord(taskId);\n\tif (store !== undefined && shell?.kind === \"command\" && shell.parentTaskId !== undefined) {\n\t\t// A subagent's own shell opens its output in that subagent's task list; back returns to its row.\n\t\tconst source = launchedTaskViewSource(ownerTaskViewSource(store), shell.parentTaskId);\n\t\tif (\n\t\t\t(await showTaskInspector(ui, store, shell.ref.taskId, { chat: true, backLabel: \"agents\", source })) === \"back\"\n\t\t)\n\t\t\tawait showAgentPanel(session, ui, item.id);\n\t\treturn;\n\t}\n\t// An extension's row opens its own view; leaving it returns to the panel with the row selected.\n\tconst opened = openAgentPanelItem(session, item.id, {\n\t\tonReturn: () => {\n\t\t\tshowAgentPanel(session, ui, item.id).catch(report);\n\t\t},\n\t});\n\tif (!opened) ui.notify?.(`Could not open ${safeLabel(item.name)}.`, \"warning\");\n}\n\nexport async function showAgentPanel(\n\tsession: AgentPanelSession & object,\n\tui: TaskInspectorUi,\n\tselectId?: string,\n): Promise<void> {\n\tconst state = panelState(session);\n\tif (state.open) return;\n\tconst report = (error: unknown) => {\n\t\tif (state.reportOnce !== undefined) {\n\t\t\tstate.reportOnce(error);\n\t\t\treturn;\n\t\t}\n\t\treportOnceWith(state, ui.notify, error);\n\t};\n\tstate.onSourceError ??= (error: Error) => {\n\t\tconst message = sourceError(error).message;\n\t\tstate.reported.add(message);\n\t\tnotifyPanelWarning(ui.notify, message);\n\t};\n\tconst store = getOwnerTaskStore(session);\n\tconst style = THEMED_STYLE;\n\tconst faded = (row: AgentPanelRow) => state.model.faded(row);\n\tlet currentRows: AgentPanelRow[] = [];\n\tlet next: (() => Promise<void>) | undefined;\n\tlet hidden = false;\n\tconst bridge = agentViewBridge(session);\n\t/** The shown subagent's row, as the last ranking found it. */\n\tlet focusViewed: string | undefined;\n\tconst focusedRows = (scroll: number) => {\n\t\tconst ranking = rankPanelSession(session, { start: Math.max(0, scroll), limit: AGENT_PANEL_FOCUSED_ROWS });\n\t\tfocusViewed = ranking.viewed;\n\t\treturn ranking.rows;\n\t};\n\t/** The viewed mark and nesting, only while the screen can show a subagent: without a bridge, today's rows. */\n\tconst focusMarks = () =>\n\t\tbridge === undefined ? {} : { nestShells: true, ...(focusViewed === undefined ? {} : { viewedId: focusViewed }) };\n\tstate.open = true;\n\ttry {\n\t\tcurrentRows = focusedRows(0);\n\t\tif (currentRows.length === 0) return;\n\t\tsetAgentPanelVisible(session, false);\n\t\thidden = true;\n\t\tawait ui.custom<void>(\n\t\t\t(tui, _theme, keybindings, done) => {\n\t\t\t\tconst keys = keybindings as Parameters<typeof renderAgentPanelHint>[3] & {\n\t\t\t\t\tmatches(data: string, action: string): boolean;\n\t\t\t\t};\n\t\t\t\tlet disposed = false;\n\t\t\t\tlet finished = false;\n\t\t\t\tlet dirty = false;\n\t\t\t\tlet scheduled = false;\n\t\t\t\tlet cachedRows: AgentPanelRow[] | undefined;\n\t\t\t\tlet cachedWidth = -1;\n\t\t\t\tlet cachedSelectedId: string | undefined;\n\t\t\t\tlet cachedScroll = -1;\n\t\t\t\tlet cachedMain = false;\n\t\t\t\tlet cachedViewed: string | undefined;\n\t\t\t\t/** The rows and view the focused panel last drew, which a click is resolved against. */\n\t\t\t\tlet paintedFocus:\n\t\t\t\t\t| { rows: readonly AgentPanelRow[]; selectedId: string; scroll: number; showMain: boolean }\n\t\t\t\t\t| undefined;\n\t\t\t\tlet cachedFaded = -1;\n\t\t\t\tlet cachedRowLines: string[] = [];\n\t\t\t\tlet materializedScroll = 0;\n\t\t\t\tlet tick: ReturnType<typeof setInterval> | undefined;\n\t\t\t\tconst modelColumn = new ModelColumn(() => {\n\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\ttui.requestRender();\n\t\t\t\t});\n\t\t\t\tconst finish = () => {\n\t\t\t\t\tif (finished) return;\n\t\t\t\t\tfinished = true;\n\t\t\t\t\tdone();\n\t\t\t\t};\n\t\t\t\tconst focus = new AgentPanelFocus(keys, {\n\t\t\t\t\topen(row) {\n\t\t\t\t\t\tconst item = materializePanelItem(row);\n\t\t\t\t\t\tnext = () => openPanelRow(session, ui, item, report);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t},\n\t\t\t\t\topenMain() {\n\t\t\t\t\t\t// While a subagent is shown, the main row shows main again; otherwise it returns to the prompt.\n\t\t\t\t\t\tconst bridge = agentViewBridge(session);\n\t\t\t\t\t\tif (bridge?.viewedTaskId() !== undefined)\n\t\t\t\t\t\t\tnext = async () => {\n\t\t\t\t\t\t\t\tbridge.requestView(undefined);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t},\n\t\t\t\t\tstop(row) {\n\t\t\t\t\t\tconst item = materializePanelItem(row);\n\t\t\t\t\t\tvoid stopAgentPanelItem(session, item.id)\n\t\t\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\t\t\tif (!result.ok)\n\t\t\t\t\t\t\t\t\tui.notify?.(\n\t\t\t\t\t\t\t\t\t\t`Could not stop ${safeLabel(item.name)}: ${safeLabel(result.reason)}`,\n\t\t\t\t\t\t\t\t\t\t\"warning\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\t\t\t\tui.notify?.(`Could not stop ${safeLabel(item.name)}: ${safeLabel(error)}`, \"warning\");\n\t\t\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(() => {});\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t},\n\t\t\t\t\tdismiss(row) {\n\t\t\t\t\t\tif (!isFinishedPanelRow(row)) return;\n\t\t\t\t\t\tdismissedAgentPanelItems(session).add(row.id);\n\t\t\t\t\t\tconst taskId = panelTaskId(row);\n\t\t\t\t\t\tif (taskId !== undefined && store !== undefined)\n\t\t\t\t\t\t\tdismissedTasks(ownerTaskViewSource(store)).add(taskId);\n\t\t\t\t\t\t// The screen shows it: its watchers learn it is gone, and the screen shows main.\n\t\t\t\t\t\tif (row.id === focusViewed) notifyAgentPanelChanged(session);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\tcurrentRows = focusedRows(focus.scroll);\n\t\t\t\t\t\t\tfocus.update(currentRows);\n\t\t\t\t\t\t\tif (currentRows.length === 0) finish();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t},\n\t\t\t\t\tclose: finish,\n\t\t\t\t});\n\t\t\t\tfocus.update(currentRows);\n\t\t\t\tfocus.enter(selectId);\n\t\t\t\tconst refreshRows = () => {\n\t\t\t\t\tmaterializedScroll = focus.scroll;\n\t\t\t\t\tcurrentRows = focusedRows(materializedScroll);\n\t\t\t\t\tif (currentRows.length === 0 && materializedScroll > 0) {\n\t\t\t\t\t\tmaterializedScroll = 0;\n\t\t\t\t\t\tcurrentRows = focusedRows(0);\n\t\t\t\t\t}\n\t\t\t\t\tfocus.update(currentRows);\n\t\t\t\t\t// The last row left by itself (it finished, or nothing is active any more): the focus goes back\n\t\t\t\t\t// to the prompt, as when the last row is cleared. Never from inside a paint.\n\t\t\t\t\tif (currentRows.length === 0) queueMicrotask(finish);\n\t\t\t\t};\n\t\t\t\tconst syncTick = () => {\n\t\t\t\t\tconst needed = focus.pendingStop() !== undefined || panelRowsNeedClock(currentRows, state);\n\t\t\t\t\tif (needed) {\n\t\t\t\t\t\ttick ??= setInterval(refreshFocus, TICK_MS);\n\t\t\t\t\t\ttick.unref?.();\n\t\t\t\t\t} else if (tick !== undefined) {\n\t\t\t\t\t\tclearInterval(tick);\n\t\t\t\t\t\ttick = undefined;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst refreshFocus = () => {\n\t\t\t\t\tif (disposed) return;\n\t\t\t\t\tdirty = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treport(error);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst scheduleRefresh = () => {\n\t\t\t\t\tif (disposed) return;\n\t\t\t\t\tdirty = true;\n\t\t\t\t\tif (scheduled) return;\n\t\t\t\t\tscheduled = true;\n\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\tscheduled = false;\n\t\t\t\t\t\tif (dirty) refreshFocus();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tconst unsubscribePanel = subscribeAgentPanel(session, scheduleRefresh);\n\t\t\t\tconst unwatchBridge = bridge?.subscribe(scheduleRefresh);\n\t\t\t\tconst unsubscribe = () => {\n\t\t\t\t\tunsubscribePanel();\n\t\t\t\t\tunwatchBridge?.();\n\t\t\t\t};\n\t\t\t\tsyncTick();\n\t\t\t\treturn {\n\t\t\t\t\tinvalidate() {\n\t\t\t\t\t\tcachedRows = undefined;\n\t\t\t\t\t\tcachedRowLines = [];\n\t\t\t\t\t},\n\t\t\t\t\t/** The id of the row last drawn on `row`, so a click on a row whose item changed is not taken. */\n\t\t\t\t\tpaintedRowKey(row: number): string | undefined {\n\t\t\t\t\t\tif (paintedFocus === undefined) return undefined;\n\t\t\t\t\t\tconst { rows, ...view } = paintedFocus;\n\t\t\t\t\t\treturn agentPanelRowIdAtLine(rows, view, row);\n\t\t\t\t\t},\n\t\t\t\t\thandleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {\n\t\t\t\t\t\tif (focus.helpOpen || paintedFocus === undefined || !isSingleLeftClick(event)) return undefined;\n\t\t\t\t\t\t// The rows the reader saw: the panel's rows can change before it paints them again.\n\t\t\t\t\t\tconst { rows, ...view } = paintedFocus;\n\t\t\t\t\t\tconst id = agentPanelRowIdAtLine(rows, view, event.y);\n\t\t\t\t\t\tif (id === undefined) return undefined;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfocus.click(id);\n\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\treturn { handled: true };\n\t\t\t\t\t},\n\t\t\t\t\trender(width: number) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst w = +width;\n\t\t\t\t\t\t\tif (dirty || materializedScroll !== focus.scroll) {\n\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpaintedFocus = undefined;\n\t\t\t\t\t\t\tif (focus.helpOpen)\n\t\t\t\t\t\t\t\treturn renderNavKeyOverlay(\n\t\t\t\t\t\t\t\t\t\"keys · agents\",\n\t\t\t\t\t\t\t\t\tagentPanelKeys(focus.selected(), keys).concat([\n\t\t\t\t\t\t\t\t\t\t{ keys: focus.showMain ? \"↑ on main\" : \"↑ on the first row\", label: \"back to prompt\" },\n\t\t\t\t\t\t\t\t\t\t{ action: \"app.agents.chord\", label: \"then the stop-all key: stop all background work\" },\n\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\t\tw,\n\t\t\t\t\t\t\t\t\tstyle,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tlet rowLines: string[];\n\t\t\t\t\t\t\tif (!Number.isFinite(w)) {\n\t\t\t\t\t\t\t\trowLines = renderAgentPanelRows(currentRows, w, style, {\n\t\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t...focusMarks(),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst fadedMask = sliceFadedMask(\n\t\t\t\t\t\t\t\t\tcurrentRows,\n\t\t\t\t\t\t\t\t\tfocus.scroll,\n\t\t\t\t\t\t\t\t\tAGENT_PANEL_FOCUSED_ROWS,\n\t\t\t\t\t\t\t\t\tstate.model,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tcachedRows === currentRows &&\n\t\t\t\t\t\t\t\t\tcachedWidth === w &&\n\t\t\t\t\t\t\t\t\tcachedSelectedId === focus.selectedId &&\n\t\t\t\t\t\t\t\t\tcachedScroll === focus.scroll &&\n\t\t\t\t\t\t\t\t\tcachedMain === focus.showMain &&\n\t\t\t\t\t\t\t\t\tcachedViewed === focusViewed &&\n\t\t\t\t\t\t\t\t\tcachedFaded === fadedMask\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\trowLines = cachedRowLines;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trowLines = renderAgentPanelRows(currentRows, w, style, {\n\t\t\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\t\t\tfaded,\n\t\t\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t\t\t\tmodelColumn,\n\t\t\t\t\t\t\t\t\t\t...focusMarks(),\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tcachedRows = currentRows;\n\t\t\t\t\t\t\t\t\tcachedWidth = w;\n\t\t\t\t\t\t\t\t\tcachedSelectedId = focus.selectedId;\n\t\t\t\t\t\t\t\t\tcachedScroll = focus.scroll;\n\t\t\t\t\t\t\t\t\tcachedMain = focus.showMain;\n\t\t\t\t\t\t\t\t\tcachedViewed = focusViewed;\n\t\t\t\t\t\t\t\t\tcachedFaded = fadedMask;\n\t\t\t\t\t\t\t\t\tcachedRowLines = rowLines;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfocus.notePainted(currentRows.slice(focus.scroll, focus.scroll + AGENT_PANEL_FOCUSED_ROWS));\n\t\t\t\t\t\t\tpaintedFocus = {\n\t\t\t\t\t\t\t\trows: currentRows,\n\t\t\t\t\t\t\t\tselectedId: focus.selectedId,\n\t\t\t\t\t\t\t\tscroll: focus.scroll,\n\t\t\t\t\t\t\t\tshowMain: focus.showMain,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn [...rowLines, truncateToWidth(renderAgentPanelHint(focus, w, style, keys), w)];\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleInput(data: string) {\n\t\t\t\t\t\tif (isPhysicalCtrlC(data)) {\n\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (dirty) {\n\t\t\t\t\t\t\t\tdirty = false;\n\t\t\t\t\t\t\t\trefreshRows();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (currentRows.length === 0) {\n\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfocus.handleInput(data, (input, key) =>\n\t\t\t\t\t\t\t\tmatchesKey(input, key as Parameters<typeof matchesKey>[1]),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsyncTick();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treport(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttui.requestRender();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t\tdispose() {\n\t\t\t\t\t\tif (disposed) return;\n\t\t\t\t\t\tdisposed = true;\n\t\t\t\t\t\tif (tick !== undefined) clearInterval(tick);\n\t\t\t\t\t\tmodelColumn.dispose();\n\t\t\t\t\t\tunsubscribe();\n\t\t\t\t\t\tif (!finished) queueMicrotask(finish);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t\t{ overlay: false, purpose: \"navigation\", handlesCtrlC: true, deferInlineCustomUiFocus: true },\n\t\t);\n\t} finally {\n\t\ttry {\n\t\t\tif (hidden) setAgentPanelVisible(session, true);\n\t\t} catch (error) {\n\t\t\treport(error);\n\t\t} finally {\n\t\t\tstate.open = false;\n\t\t}\n\t}\n\tawait next?.();\n}\n\n/**\n * Whether the idle panel of `session` opens again once the one view hiding it now closes: a panel is bound to the\n * session, that view is its only hider, and the panel has rows to show.\n */\nexport function agentPanelReturnsOnShow(session: AgentPanelSession & object): boolean {\n\tconst state = panelState(session);\n\treturn state.hideCount === 1 && state.setVisible !== undefined && agentPanelHasRows(session);\n}\n\nexport function setAgentPanelVisible(session: object, visible: boolean): void {\n\tconst state = panelState(session);\n\tstate.hideCount = visible ? Math.max(0, state.hideCount - 1) : state.hideCount + 1;\n\tstate.setVisible?.(state.hideCount === 0);\n}\n\nexport function agentPanelCounts(session: AgentPanelSession & object): AgentPanelCounts {\n\ttry {\n\t\treturn { ...rankPanelSession(session, { start: 0, limit: 0, cap: 1 }).counts };\n\t} catch (error) {\n\t\tconst state = panelState(session);\n\t\tif (state.reportOnce !== undefined) state.reportOnce(error);\n\t\telse state.onSourceError?.(sourceError(error));\n\t\treturn { ...EMPTY_PANEL_COUNTS };\n\t}\n}\n\nexport function agentPanelHasRows(session: AgentPanelSession & object): boolean {\n\treturn agentPanelCounts(session).total > 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-view-rpc-panel.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/agent-view-rpc-panel.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,KAAK,OAAO,CAAC,CAAC,SAAS,mBAAmB,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAShG;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAqCxF;AAED,oFAAoF;AACpF,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACpC,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAGtB"}
1
+ {"version":3,"file":"agent-view-rpc-panel.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/agent-view-rpc-panel.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,KAAK,OAAO,CAAC,CAAC,SAAS,mBAAmB,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAShG;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAyCxF;AAED,oFAAoF;AACpF,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACpC,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAGtB"}
@@ -1,4 +1,5 @@
1
1
  import { agentViewBridge, setAgentViewBridge, } from "../interactive/agent-view/agent-view-bridge.js";
2
+ import { agentPanelReturnsOnShow } from "./agent-panel-bridge.js";
2
3
  import { createRpcSuccessResponse } from "./rpc-responses.js";
3
4
  const engineBridges = new WeakMap();
4
5
  /**
@@ -11,11 +12,16 @@ export function installEngineAgentViewBridge(context) {
11
12
  const listeners = new Set();
12
13
  const bridge = {
13
14
  viewedTaskId: () => viewed,
14
- requestView: (taskId, options) => context.send({
15
- type: "engine_view_agent",
16
- taskId: taskId ?? null,
17
- ...(options?.keepScreen === true ? { keepScreen: true } : {}),
18
- }),
15
+ requestView: (taskId, options) => {
16
+ const keepScreen = options?.keepScreen === true;
17
+ context.send({
18
+ type: "engine_view_agent",
19
+ taskId: taskId ?? null,
20
+ ...(keepScreen ? { keepScreen: true } : {}),
21
+ // What keeps the screen (`/tasks`) hid the panel; the host waits for it when it opens again as that closes.
22
+ ...(keepScreen && taskId !== undefined && agentPanelReturnsOnShow(session) ? { panel: true } : {}),
23
+ });
24
+ },
19
25
  subscribe(listener) {
20
26
  listeners.add(listener);
21
27
  return () => {
@@ -1 +1 @@
1
- {"version":3,"file":"agent-view-rpc-panel.js","sourceRoot":"","sources":["../../../src/modes/rpc/agent-view-rpc-panel.ts"],"names":[],"mappings":"AACA,OAA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AAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,GAAG,EAAE;QACX,IAAI,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,MAAM;YAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,MAAM;YAAE,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAChF,SAAS,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,OAAoC,EACpC,OAA+B;IAE/B,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,OAAO,CAAC,MAAiB,CAAC,CAAC;IAChH,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { TaskId } from \"../../core/tasks/contracts.js\";\nimport {\n\ttype AgentViewBridge,\n\tagentViewBridge,\n\tsetAgentViewBridge,\n} from \"../interactive/agent-view/agent-view-bridge.ts\";\nimport type { EngineAgentViewContext } from \"./agent-view-rpc.ts\";\nimport type { AgentViewRpcCommand } from \"./agent-view-rpc-types.ts\";\nimport { createRpcSuccessResponse } from \"./rpc-responses.ts\";\nimport type { RpcResponse } from \"./rpc-types.ts\";\n\ntype Command<T extends AgentViewRpcCommand[\"type\"]> = Extract<AgentViewRpcCommand, { type: T }>;\n\n/** The engine's copy of what the host's screen shows, which the host keeps current with `set_viewed_agent`. */\ninterface EngineAgentViewBridge extends AgentViewBridge {\n\tshow(taskId: TaskId | undefined): void;\n}\n\nconst engineBridges = new WeakMap<object, EngineAgentViewBridge>();\n\n/**\n * Attach the engine's `AgentViewBridge` to `context.session`: `set_viewed_agent` feeds `viewedTaskId`, and\n * `requestView` sends `engine_view_agent` to the host, whose screen decides. Answers the detach.\n */\nexport function installEngineAgentViewBridge(context: EngineAgentViewContext): () => void {\n\tconst session = context.session;\n\tlet viewed: TaskId | undefined;\n\tconst listeners = new Set<() => void>();\n\tconst bridge: EngineAgentViewBridge = {\n\t\tviewedTaskId: () => viewed,\n\t\trequestView: (taskId, options) =>\n\t\t\tcontext.send({\n\t\t\t\ttype: \"engine_view_agent\",\n\t\t\t\ttaskId: taskId ?? null,\n\t\t\t\t...(options?.keepScreen === true ? { keepScreen: true as const } : {}),\n\t\t\t}),\n\t\tsubscribe(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tshow(taskId) {\n\t\t\tif (viewed === taskId) return;\n\t\t\tviewed = taskId;\n\t\t\tfor (const listener of [...listeners]) {\n\t\t\t\ttry {\n\t\t\t\t\tlistener();\n\t\t\t\t} catch {\n\t\t\t\t\t// A listener's failure must not keep the others from learning what the screen shows.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\tsetAgentViewBridge(session, bridge);\n\tengineBridges.set(session, bridge);\n\treturn () => {\n\t\tif (engineBridges.get(session) === bridge) engineBridges.delete(session);\n\t\tif (agentViewBridge(session) === bridge) setAgentViewBridge(session, undefined);\n\t\tlisteners.clear();\n\t};\n}\n\n/** The host's screen now shows the subagent `taskId` names, or main without one. */\nexport async function handleSetViewedAgent(\n\tcommand: Command<\"set_viewed_agent\">,\n\tcontext: EngineAgentViewContext,\n): Promise<RpcResponse> {\n\tengineBridges.get(context.session)?.show(command.taskId === undefined ? undefined : (command.taskId as TaskId));\n\treturn createRpcSuccessResponse(command.id, command.type);\n}\n"]}
1
+ {"version":3,"file":"agent-view-rpc-panel.js","sourceRoot":"","sources":["../../../src/modes/rpc/agent-view-rpc-panel.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,eAAe,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CAAC;YAChB,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;gBACvC,IAAI,CAAC;oBACJ,QAAQ,EAAE,CAAC;gBACZ,CAAC;gBAAC,MAAM,CAAC;oBACR,qFAAqF;gBACtF,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC;IACF,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,GAAG,EAAE;QACX,IAAI,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,MAAM;YAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,MAAM;YAAE,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAChF,SAAS,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,OAAoC,EACpC,OAA+B;IAE/B,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,OAAO,CAAC,MAAiB,CAAC,CAAC;IAChH,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { TaskId } from \"../../core/tasks/contracts.js\";\nimport {\n\ttype AgentViewBridge,\n\tagentViewBridge,\n\tsetAgentViewBridge,\n} from \"../interactive/agent-view/agent-view-bridge.ts\";\nimport { agentPanelReturnsOnShow } from \"./agent-panel-bridge.ts\";\nimport type { EngineAgentViewContext } from \"./agent-view-rpc.ts\";\nimport type { AgentViewRpcCommand } from \"./agent-view-rpc-types.ts\";\nimport { createRpcSuccessResponse } from \"./rpc-responses.ts\";\nimport type { RpcResponse } from \"./rpc-types.ts\";\n\ntype Command<T extends AgentViewRpcCommand[\"type\"]> = Extract<AgentViewRpcCommand, { type: T }>;\n\n/** The engine's copy of what the host's screen shows, which the host keeps current with `set_viewed_agent`. */\ninterface EngineAgentViewBridge extends AgentViewBridge {\n\tshow(taskId: TaskId | undefined): void;\n}\n\nconst engineBridges = new WeakMap<object, EngineAgentViewBridge>();\n\n/**\n * Attach the engine's `AgentViewBridge` to `context.session`: `set_viewed_agent` feeds `viewedTaskId`, and\n * `requestView` sends `engine_view_agent` to the host, whose screen decides. Answers the detach.\n */\nexport function installEngineAgentViewBridge(context: EngineAgentViewContext): () => void {\n\tconst session = context.session;\n\tlet viewed: TaskId | undefined;\n\tconst listeners = new Set<() => void>();\n\tconst bridge: EngineAgentViewBridge = {\n\t\tviewedTaskId: () => viewed,\n\t\trequestView: (taskId, options) => {\n\t\t\tconst keepScreen = options?.keepScreen === true;\n\t\t\tcontext.send({\n\t\t\t\ttype: \"engine_view_agent\",\n\t\t\t\ttaskId: taskId ?? null,\n\t\t\t\t...(keepScreen ? { keepScreen: true as const } : {}),\n\t\t\t\t// What keeps the screen (`/tasks`) hid the panel; the host waits for it when it opens again as that closes.\n\t\t\t\t...(keepScreen && taskId !== undefined && agentPanelReturnsOnShow(session) ? { panel: true as const } : {}),\n\t\t\t});\n\t\t},\n\t\tsubscribe(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tshow(taskId) {\n\t\t\tif (viewed === taskId) return;\n\t\t\tviewed = taskId;\n\t\t\tfor (const listener of [...listeners]) {\n\t\t\t\ttry {\n\t\t\t\t\tlistener();\n\t\t\t\t} catch {\n\t\t\t\t\t// A listener's failure must not keep the others from learning what the screen shows.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\tsetAgentViewBridge(session, bridge);\n\tengineBridges.set(session, bridge);\n\treturn () => {\n\t\tif (engineBridges.get(session) === bridge) engineBridges.delete(session);\n\t\tif (agentViewBridge(session) === bridge) setAgentViewBridge(session, undefined);\n\t\tlisteners.clear();\n\t};\n}\n\n/** The host's screen now shows the subagent `taskId` names, or main without one. */\nexport async function handleSetViewedAgent(\n\tcommand: Command<\"set_viewed_agent\">,\n\tcontext: EngineAgentViewContext,\n): Promise<RpcResponse> {\n\tengineBridges.get(context.session)?.show(command.taskId === undefined ? undefined : (command.taskId as TaskId));\n\treturn createRpcSuccessResponse(command.id, command.type);\n}\n"]}
@@ -39,8 +39,15 @@ export declare const ENGINE_SHUTDOWN_GRACE_MS = 5000;
39
39
  * `shutdownComplete` settles when such an engine says its shutdown has run. It is then given
40
40
  * {@link ENGINE_KILL_STEP_MS} to exit and otherwise ended alone, rather than waited for while the runtime does its
41
41
  * own exit work, such as writing a compile cache, which can take seconds on Windows.
42
+ *
43
+ * `hostSignaled` stops an engine because its host was signalled or lost its terminal. On Linux and macOS the ask is
44
+ * then SIGHUP, the hangup of the host it serves: such an engine, in a session of its own with no terminal, runs the
45
+ * same shutdown and then ends its own process group, as a hangup ends a terminal's job.
46
+ *
47
+ * Temporary files never hold the stop up for longer than one step's window, so a stalled or failing temporary
48
+ * directory can neither keep the engine running nor keep the stop from returning.
42
49
  */
43
- export declare function terminateRpcClientProcess(child: ChildProcess, processTree: boolean, graceful?: boolean, shutdownComplete?: Promise<void>): Promise<void>;
50
+ export declare function terminateRpcClientProcess(child: ChildProcess, processTree: boolean, graceful?: boolean, shutdownComplete?: Promise<void>, hostSignaled?: boolean): Promise<void>;
44
51
  export declare function createInteractiveJsonlOptions(enabled: boolean): {
45
52
  maxBytesPerTurn?: number;
46
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-client-process.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;A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