@songsid/agend 2.4.0-beta.18 → 2.4.0-beta.19

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 (377) hide show
  1. package/dist/agent-cli-instructions.md +13 -7
  2. package/dist/agent-cli.js +149 -49
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-export.d.ts +3 -1
  5. package/dist/agent-export.js +18 -1
  6. package/dist/agent-export.js.map +1 -1
  7. package/dist/agent-whats-new.js +9 -0
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/apply-job.d.ts +2 -2
  10. package/dist/auth-api.js +1 -1
  11. package/dist/auth-api.js.map +1 -1
  12. package/dist/backend/claude-code.d.ts +0 -6
  13. package/dist/backend/claude-code.js +23 -3
  14. package/dist/backend/claude-code.js.map +1 -1
  15. package/dist/backend/codex-precaution.js +3 -2
  16. package/dist/backend/codex-precaution.js.map +1 -1
  17. package/dist/backend/codex.js +1 -1
  18. package/dist/backend/codex.js.map +1 -1
  19. package/dist/backend/types.d.ts +6 -0
  20. package/dist/backend/types.js.map +1 -1
  21. package/dist/build-provenance.json +1 -1
  22. package/dist/channel/mcp-server.js +8 -2
  23. package/dist/channel/mcp-server.js.map +1 -1
  24. package/dist/channel/mcp-tools.d.ts +27 -1
  25. package/dist/channel/mcp-tools.js +77 -7
  26. package/dist/channel/mcp-tools.js.map +1 -1
  27. package/dist/chat-task-refs.d.ts +61 -0
  28. package/dist/chat-task-refs.js +112 -0
  29. package/dist/chat-task-refs.js.map +1 -0
  30. package/dist/classic-channel-manager.d.ts +1 -1
  31. package/dist/classic-channel-manager.js +6 -2
  32. package/dist/classic-channel-manager.js.map +1 -1
  33. package/dist/claude-credential-launch.d.ts +6 -0
  34. package/dist/claude-credential-launch.js +16 -3
  35. package/dist/claude-credential-launch.js.map +1 -1
  36. package/dist/claude-credential-runner.js +3 -1
  37. package/dist/claude-credential-runner.js.map +1 -1
  38. package/dist/claude-setup-token-transport.js +25 -3
  39. package/dist/claude-setup-token-transport.js.map +1 -1
  40. package/dist/cli-audited.js +5 -5
  41. package/dist/cli-audited.js.map +1 -1
  42. package/dist/composite-tools.d.ts +11 -0
  43. package/dist/composite-tools.js +29 -0
  44. package/dist/composite-tools.js.map +1 -0
  45. package/dist/config-validator.js +22 -1
  46. package/dist/config-validator.js.map +1 -1
  47. package/dist/config.js +11 -0
  48. package/dist/config.js.map +1 -1
  49. package/dist/contact-auth-policy.d.ts +1 -0
  50. package/dist/contact-auth-policy.js +2 -1
  51. package/dist/contact-auth-policy.js.map +1 -1
  52. package/dist/contact-auth-service.js +2 -0
  53. package/dist/contact-auth-service.js.map +1 -1
  54. package/dist/contact-auth-store.js +21 -6
  55. package/dist/contact-auth-store.js.map +1 -1
  56. package/dist/contact-auth-types.d.ts +2 -0
  57. package/dist/contact-auth-types.js.map +1 -1
  58. package/dist/daemon.js +4 -0
  59. package/dist/daemon.js.map +1 -1
  60. package/dist/darwin-memory.js +2 -1
  61. package/dist/darwin-memory.js.map +1 -1
  62. package/dist/dashboard-permissions.d.ts +1 -8
  63. package/dist/dashboard-permissions.js +8 -9
  64. package/dist/dashboard-permissions.js.map +1 -1
  65. package/dist/delivery-outbox.d.ts +0 -6
  66. package/dist/delivery-outbox.js +0 -25
  67. package/dist/delivery-outbox.js.map +1 -1
  68. package/dist/delivery-outbox.test.js +132 -96
  69. package/dist/delivery-outbox.test.js.map +1 -1
  70. package/dist/fleet-manager.d.ts +45 -7
  71. package/dist/fleet-manager.js +309 -99
  72. package/dist/fleet-manager.js.map +1 -1
  73. package/dist/fleet-windows-runtime.d.ts +1 -1
  74. package/dist/fleet-windows-runtime.js +8 -1
  75. package/dist/fleet-windows-runtime.js.map +1 -1
  76. package/dist/fleet-yaml-stringify.d.ts +1 -1
  77. package/dist/fleet-yaml-stringify.js +64 -11
  78. package/dist/fleet-yaml-stringify.js.map +1 -1
  79. package/dist/general-knowledge/skills/concepts/SKILL.md +53 -4
  80. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +4 -0
  81. package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
  82. package/dist/general-knowledge/skills/hub/SKILL.md +2 -0
  83. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
  84. package/dist/general-knowledge/skills/model-discovery/SKILL.md +3 -2
  85. package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
  86. package/dist/general-knowledge/skills/task-board/SKILL.md +63 -0
  87. package/dist/general-knowledge/skills/web-appearance/SKILL.md +25 -2
  88. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +38 -9
  89. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +4 -0
  90. package/dist/general-knowledge/steering/core-rules.md +15 -78
  91. package/dist/general-role-block.d.ts +19 -0
  92. package/dist/general-role-block.js +56 -0
  93. package/dist/general-role-block.js.map +1 -0
  94. package/dist/general-role.d.ts +1 -1
  95. package/dist/general-role.js +1 -0
  96. package/dist/general-role.js.map +1 -1
  97. package/dist/host-memory.d.ts +3 -0
  98. package/dist/host-memory.js.map +1 -1
  99. package/dist/host-monitoring/darwin/collector.d.ts +18 -0
  100. package/dist/host-monitoring/darwin/collector.js +65 -0
  101. package/dist/host-monitoring/darwin/collector.js.map +1 -0
  102. package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
  103. package/dist/host-monitoring/darwin/defaults.js +9 -0
  104. package/dist/host-monitoring/darwin/defaults.js.map +1 -0
  105. package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
  106. package/dist/host-monitoring/darwin/interpretation.js +73 -0
  107. package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
  108. package/dist/host-monitoring/linux/collector.d.ts +17 -0
  109. package/dist/host-monitoring/linux/collector.js +55 -0
  110. package/dist/host-monitoring/linux/collector.js.map +1 -0
  111. package/dist/host-monitoring/linux/defaults.d.ts +2 -0
  112. package/dist/host-monitoring/linux/defaults.js +9 -0
  113. package/dist/host-monitoring/linux/defaults.js.map +1 -0
  114. package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
  115. package/dist/host-monitoring/linux/interpretation.js +76 -0
  116. package/dist/host-monitoring/linux/interpretation.js.map +1 -0
  117. package/dist/host-monitoring/transport.d.ts +42 -0
  118. package/dist/host-monitoring/transport.js +101 -0
  119. package/dist/host-monitoring/transport.js.map +1 -0
  120. package/dist/host-monitoring/wsl/collector.d.ts +19 -0
  121. package/dist/host-monitoring/wsl/collector.js +72 -0
  122. package/dist/host-monitoring/wsl/collector.js.map +1 -0
  123. package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
  124. package/dist/host-monitoring/wsl/defaults.js +9 -0
  125. package/dist/host-monitoring/wsl/defaults.js.map +1 -0
  126. package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
  127. package/dist/host-monitoring/wsl/interpretation.js +77 -0
  128. package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
  129. package/dist/host-monitoring-alert-policy.d.ts +2 -0
  130. package/dist/host-monitoring-alert-policy.js +4 -2
  131. package/dist/host-monitoring-alert-policy.js.map +1 -1
  132. package/dist/host-monitoring-alert-settings.d.ts +3 -1
  133. package/dist/host-monitoring-alert-settings.js +7 -2
  134. package/dist/host-monitoring-alert-settings.js.map +1 -1
  135. package/dist/host-monitoring-alerts.d.ts +3 -0
  136. package/dist/host-monitoring-alerts.js +18 -3
  137. package/dist/host-monitoring-alerts.js.map +1 -1
  138. package/dist/host-monitoring-defaults.d.ts +19 -0
  139. package/dist/host-monitoring-defaults.js +10 -0
  140. package/dist/host-monitoring-defaults.js.map +1 -0
  141. package/dist/host-monitoring-platform.d.ts +18 -70
  142. package/dist/host-monitoring-platform.js +14 -269
  143. package/dist/host-monitoring-platform.js.map +1 -1
  144. package/dist/host-monitoring.d.ts +13 -0
  145. package/dist/host-monitoring.js.map +1 -1
  146. package/dist/hub/agent-catalog-model.d.ts +21 -0
  147. package/dist/hub/agent-catalog-model.js +9 -1
  148. package/dist/hub/agent-catalog-model.js.map +1 -1
  149. package/dist/hub/agent-catalog.d.ts +4 -1
  150. package/dist/hub/agent-catalog.js +11 -0
  151. package/dist/hub/agent-catalog.js.map +1 -1
  152. package/dist/hub/catalog.js +12 -0
  153. package/dist/hub/catalog.js.map +1 -1
  154. package/dist/hub/client.js +4 -1
  155. package/dist/hub/client.js.map +1 -1
  156. package/dist/hub/compose/member.d.ts +5 -0
  157. package/dist/hub/compose/member.js +25 -5
  158. package/dist/hub/compose/member.js.map +1 -1
  159. package/dist/hub/compose/server.d.ts +2 -0
  160. package/dist/hub/compose/server.js +4 -2
  161. package/dist/hub/compose/server.js.map +1 -1
  162. package/dist/hub/http/compose.d.ts +5 -0
  163. package/dist/hub/http/compose.js +25 -2
  164. package/dist/hub/http/compose.js.map +1 -1
  165. package/dist/hub/http/deps.d.ts +2 -0
  166. package/dist/hub/http/schema.js +4 -0
  167. package/dist/hub/http/schema.js.map +1 -1
  168. package/dist/hub/lapse-carry.d.ts +45 -0
  169. package/dist/hub/lapse-carry.js +62 -0
  170. package/dist/hub/lapse-carry.js.map +1 -0
  171. package/dist/hub/member/agent-catalog.d.ts +4 -1
  172. package/dist/hub/member/agent-catalog.js +15 -4
  173. package/dist/hub/member/agent-catalog.js.map +1 -1
  174. package/dist/hub/member/agent-intro.d.ts +4 -3
  175. package/dist/hub/member/agent-intro.js +7 -0
  176. package/dist/hub/member/agent-intro.js.map +1 -1
  177. package/dist/hub/member/exposure-api.d.ts +2 -0
  178. package/dist/hub/member/exposure-api.js +8 -1
  179. package/dist/hub/member/exposure-api.js.map +1 -1
  180. package/dist/hub/member/room-post.d.ts +34 -6
  181. package/dist/hub/member/room-post.js +30 -0
  182. package/dist/hub/member/room-post.js.map +1 -1
  183. package/dist/hub/member/sharing.d.ts +2 -0
  184. package/dist/hub/member/sharing.js +9 -2
  185. package/dist/hub/member/sharing.js.map +1 -1
  186. package/dist/hub/protocol.d.ts +2 -0
  187. package/dist/hub/room-brief-model.js +2 -1
  188. package/dist/hub/room-brief-model.js.map +1 -1
  189. package/dist/hub/rooms/agents.d.ts +2 -0
  190. package/dist/hub/rooms/agents.js +16 -2
  191. package/dist/hub/rooms/agents.js.map +1 -1
  192. package/dist/hub/rooms/office.d.ts +82 -0
  193. package/dist/hub/rooms/office.js +46 -0
  194. package/dist/hub/rooms/office.js.map +1 -0
  195. package/dist/hub/rooms/service.d.ts +66 -1
  196. package/dist/hub/rooms/service.js +67 -11
  197. package/dist/hub/rooms/service.js.map +1 -1
  198. package/dist/hub/rooms/types.d.ts +4 -0
  199. package/dist/hub/runtime.d.ts +1 -1
  200. package/dist/hub/server.js +9 -2
  201. package/dist/hub/server.js.map +1 -1
  202. package/dist/hub/sharing-requests.d.ts +5 -2
  203. package/dist/hub/sharing-requests.js +19 -4
  204. package/dist/hub/sharing-requests.js.map +1 -1
  205. package/dist/instance-config-impact.js +1 -1
  206. package/dist/instance-config-impact.js.map +1 -1
  207. package/dist/instance-lifecycle.js +6 -7
  208. package/dist/instance-lifecycle.js.map +1 -1
  209. package/dist/instruction-file-sizes.d.ts +46 -0
  210. package/dist/instruction-file-sizes.js +115 -0
  211. package/dist/instruction-file-sizes.js.map +1 -0
  212. package/dist/instructions.d.ts +35 -1
  213. package/dist/instructions.js +59 -33
  214. package/dist/instructions.js.map +1 -1
  215. package/dist/locale.js +16 -4
  216. package/dist/locale.js.map +1 -1
  217. package/dist/log-steps.d.ts +5 -0
  218. package/dist/log-steps.js +6 -2
  219. package/dist/log-steps.js.map +1 -1
  220. package/dist/memory-guidance.d.ts +5 -0
  221. package/dist/memory-guidance.js +14 -0
  222. package/dist/memory-guidance.js.map +1 -0
  223. package/dist/model-defaults.d.ts +5 -0
  224. package/dist/model-defaults.js +6 -0
  225. package/dist/model-defaults.js.map +1 -0
  226. package/dist/native-mcp.d.ts +2 -0
  227. package/dist/native-mcp.js +16 -6
  228. package/dist/native-mcp.js.map +1 -1
  229. package/dist/needs-you-hub.d.ts +2 -0
  230. package/dist/needs-you-hub.js +6 -1
  231. package/dist/needs-you-hub.js.map +1 -1
  232. package/dist/needs-you.d.ts +13 -1
  233. package/dist/needs-you.js +5 -0
  234. package/dist/needs-you.js.map +1 -1
  235. package/dist/outbound-handlers.d.ts +3 -3
  236. package/dist/outbound-schemas.d.ts +3 -0
  237. package/dist/outbound-schemas.js +27 -26
  238. package/dist/outbound-schemas.js.map +1 -1
  239. package/dist/quickstart.d.ts +1 -1
  240. package/dist/quickstart.js +2 -3
  241. package/dist/quickstart.js.map +1 -1
  242. package/dist/remote-card-prompt.d.ts +1 -0
  243. package/dist/remote-card-prompt.js +1 -1
  244. package/dist/remote-card-prompt.js.map +1 -1
  245. package/dist/runtime-build-info.js +1 -1
  246. package/dist/runtime-build-info.js.map +1 -1
  247. package/dist/runtime-cli-install.js +5 -5
  248. package/dist/runtime-cli-install.js.map +1 -1
  249. package/dist/runtime-pane-mcp.js +7 -3
  250. package/dist/runtime-pane-mcp.js.map +1 -1
  251. package/dist/runtime-pane-native.js +2 -1
  252. package/dist/runtime-pane-native.js.map +1 -1
  253. package/dist/scheduler/db.js +2 -0
  254. package/dist/scheduler/db.js.map +1 -1
  255. package/dist/scheduler/task-board-mentions.d.ts +32 -0
  256. package/dist/scheduler/task-board-mentions.js +97 -0
  257. package/dist/scheduler/task-board-mentions.js.map +1 -0
  258. package/dist/scheduler/task-board-text.js +3 -0
  259. package/dist/scheduler/task-board-text.js.map +1 -1
  260. package/dist/scheduler/task-board.d.ts +199 -3
  261. package/dist/scheduler/task-board.js +492 -7
  262. package/dist/scheduler/task-board.js.map +1 -1
  263. package/dist/settings-api.d.ts +3 -1
  264. package/dist/settings-api.js +23 -4
  265. package/dist/settings-api.js.map +1 -1
  266. package/dist/settings-change.js +4 -2
  267. package/dist/settings-change.js.map +1 -1
  268. package/dist/settings-effect.js +1 -1
  269. package/dist/settings-effect.js.map +1 -1
  270. package/dist/settings-instance-patch.js +3 -1
  271. package/dist/settings-instance-patch.js.map +1 -1
  272. package/dist/setup-host.d.ts +2 -3
  273. package/dist/setup-host.js +3 -5
  274. package/dist/setup-host.js.map +1 -1
  275. package/dist/setup-wizard.js +0 -2
  276. package/dist/setup-wizard.js.map +1 -1
  277. package/dist/shared-default-adoption.d.ts +24 -0
  278. package/dist/shared-default-adoption.js +73 -0
  279. package/dist/shared-default-adoption.js.map +1 -0
  280. package/dist/subagent-records.d.ts +2 -0
  281. package/dist/subagent-records.js +11 -1
  282. package/dist/subagent-records.js.map +1 -1
  283. package/dist/subagent-service.d.ts +3 -0
  284. package/dist/subagent-service.js +24 -4
  285. package/dist/subagent-service.js.map +1 -1
  286. package/dist/task-board-tool.d.ts +31 -0
  287. package/dist/task-board-tool.js +31 -0
  288. package/dist/task-board-tool.js.map +1 -1
  289. package/dist/task-board-waker.d.ts +23 -30
  290. package/dist/task-board-waker.js +136 -97
  291. package/dist/task-board-waker.js.map +1 -1
  292. package/dist/types.d.ts +23 -0
  293. package/dist/ui/agent-details-settings.js +2 -2
  294. package/dist/ui/agent-export-dialog.js +4 -3
  295. package/dist/ui/agent-export-strings.js +4 -4
  296. package/dist/ui/agent-page-strings.js +18 -0
  297. package/dist/ui/chat-activity-groups.js +1 -1
  298. package/dist/ui/chat-activity.js +17 -0
  299. package/dist/ui/chat-store.js +13 -4
  300. package/dist/ui/chat-task-ref-strings.js +24 -0
  301. package/dist/ui/chat-task-refs.js +129 -0
  302. package/dist/ui/claude-setup-token.js +3 -3
  303. package/dist/ui/contact-auth-strings.js +33 -3
  304. package/dist/ui/contact-authorizations.js +17 -24
  305. package/dist/ui/contact-grant-editor.js +50 -0
  306. package/dist/ui/contact-permissions.js +21 -8
  307. package/dist/ui/fleet-office-card.js +18 -14
  308. package/dist/ui/fleet-office.js +29 -17
  309. package/dist/ui/fleet-task-activity.js +362 -0
  310. package/dist/ui/fleet-task-card.js +317 -314
  311. package/dist/ui/fleet-task-common.js +99 -9
  312. package/dist/ui/fleet-task-create.js +67 -0
  313. package/dist/ui/fleet-task-edit.js +204 -0
  314. package/dist/ui/fleet-task-follow.js +123 -0
  315. package/dist/ui/fleet-task-menu.js +1 -1
  316. package/dist/ui/fleet-task-owner.js +252 -0
  317. package/dist/ui/fleet-task-run.js +257 -0
  318. package/dist/ui/fleet-task-view.js +178 -39
  319. package/dist/ui/fleet-task-work.js +2 -2
  320. package/dist/ui/fleet-tasks.js +258 -130
  321. package/dist/ui/host-health.js +9 -6
  322. package/dist/ui/host-monitoring-darwin.js +6 -0
  323. package/dist/ui/host-monitoring-help.js +7 -0
  324. package/dist/ui/host-monitoring-linux.js +6 -0
  325. package/dist/ui/host-monitoring-wsl.js +6 -0
  326. package/dist/ui/hub-agent-copy.js +2 -0
  327. package/dist/ui/hub-client.js +4 -0
  328. package/dist/ui/hub-my-agents-strings.js +2 -0
  329. package/dist/ui/hub-my-agents.js +17 -1
  330. package/dist/ui/hub-room-composer.js +108 -5
  331. package/dist/ui/hub-room-members-strings.js +9 -2
  332. package/dist/ui/hub-room-members.js +72 -15
  333. package/dist/ui/hub-room-office.js +191 -0
  334. package/dist/ui/hub-room-purpose.js +18 -2
  335. package/dist/ui/hub-room-settings.js +8 -1
  336. package/dist/ui/hub-room-strings.js +15 -0
  337. package/dist/ui/hub-room-thread.js +51 -15
  338. package/dist/ui/hub-strings.js +1 -1
  339. package/dist/ui/log-row.js +7 -5
  340. package/dist/ui/native-instance-settings.js +4 -2
  341. package/dist/ui/panel-chat.js +96 -17
  342. package/dist/ui/panel-details.js +17 -0
  343. package/dist/ui/panel-fleet.js +1 -1
  344. package/dist/ui/panel-hub.js +4 -1
  345. package/dist/ui/panel-needs.js +11 -2
  346. package/dist/ui/panel-settings.js +57 -13
  347. package/dist/ui/settings-apply.js +8 -3
  348. package/dist/ui/settings-default-model-scope.js +40 -0
  349. package/dist/ui/settings-default-model-strings.js +43 -0
  350. package/dist/ui/settings-dialogs.js +9 -5
  351. package/dist/ui/settings-host-alerts.js +4 -3
  352. package/dist/ui/settings-host-monitoring.js +2 -1
  353. package/dist/ui/settings-hub.js +1 -1
  354. package/dist/ui/settings-layout.js +7 -2
  355. package/dist/ui/settings-model.js +9 -5
  356. package/dist/ui/settings-quota-notice.js +3 -3
  357. package/dist/ui/settings-registry.js +3 -0
  358. package/dist/ui/settings-shared-strings.js +22 -0
  359. package/dist/ui/settings-shared.js +59 -12
  360. package/dist/ui/settings-strings.js +2 -4
  361. package/dist/ui/shared/app-i18n.js +2 -2
  362. package/dist/ui/shared/app.css +124 -46
  363. package/dist/ui/shared/chat-composer.js +7 -6
  364. package/dist/ui/shared/chat-render.js +39 -1
  365. package/dist/ui/shared/chat-thread.js +8 -3
  366. package/dist/ui/shared/composer-focus.js +21 -0
  367. package/dist/ui/shared/hub-chat.css +30 -2
  368. package/dist/ui/shared/hub-rooms-u2.css +17 -0
  369. package/dist/ui/shared/task-board.css +406 -8
  370. package/dist/ui/trigger-complete.js +71 -0
  371. package/dist/web-api.d.ts +9 -0
  372. package/dist/web-api.js +128 -13
  373. package/dist/web-api.js.map +1 -1
  374. package/dist/windows-native-mcp.js +5 -2
  375. package/dist/windows-native-mcp.js.map +1 -1
  376. package/dist/workflow-templates/default.md +4 -6
  377. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { focusComposerStrip } from "/assets/composer-focus.js";
1
2
  import { previewReplyFile, replyPreviewLabel } from "./reply-file-preview.js";
2
3
  import { NativePaneRecovery } from "./native-pane-recovery.js";
3
4
  import { GeneralLocation } from "./general-location.js";
@@ -214,6 +215,8 @@ import { contactBadgeHtml, installBadgeRefresh } from "./contact-ticket-badge.js
214
215
  import { createEmojiIndex } from "./chat-emojis.js";
215
216
  import { pollPublicPreview } from "./preview-status.js";
216
217
  import { createMentionIndex } from "./chat-mentions.js";
218
+ import "./chat-task-ref-strings.js";
219
+ import { createTaskRefIndex, insertTaskRef, taskRefAt } from "./chat-task-refs.js";
217
220
  import { setPanelFeedback } from "./preview-panel-actions.js";
218
221
  import { PreviewPanel, claimPanel, openMarkdown, openPanel, openWorkspace, panelClaims, panelStore, panelVersion, shownKey } from "./preview-panel.js";
219
222
  import { isUpdateLine, needsArgument, paletteFor, parseCommandLine, UPDATE_COMMAND } from "./chat-commands.js";
@@ -240,7 +243,7 @@ export function linkWorkBarCss(doc = typeof document !== "undefined" ? document
240
243
  }
241
244
  linkWorkBarCss();
242
245
 
243
- import { activityInfo, activityInfoStore, activityOffered, activityPrefs, composeActivity, mountActivity, observeActivity, setActivityOn, setActivityThinking } from "./chat-activity.js";
246
+ import { activityDrawCtx, activityInfo, activityInfoStore, activityOffered, activityPrefs, composeActivity, mountActivity, observeActivity, setActivityOn, setActivityThinking } from "./chat-activity.js";
244
247
  /** The composer's textarea (#2342: text put back into it is a step Ctrl+Z goes back from). */
245
248
  const composers = new Map(); // agent → current mounted refs, never a retained thread's stale closure
246
249
  const composerField = (name) => composers.get(name)?.input.current || null;
@@ -364,10 +367,7 @@ const agentBusy = (name) => R().isBusy(store.state.exec[name]);
364
367
  const agentSince = (name) => { const t = store.state.workingSince[name]; return t == null ? null : Date.now() - (performance.now() - t); };
365
368
  const rowsOf = (name) => (activityShown() ? composeActivity(name, store.threadRows(name), Date.now(), { busy: agentBusy(name), since: agentSince(name) }) : store.threadRows(name));
366
369
  /** What a chat's activity blocks need to draw: its paths to shorten, and whether thinking is shown. */
367
- const activityCtx = (name) => () => {
368
- const info = activityInfo(name);
369
- return { paths: info ? { cwd: info.cwd, home: info.home } : null, thinking: activityPrefs.get().thinking && !!info && info.thinking === true };
370
- };
370
+ const activityCtx = (name) => () => activityDrawCtx(name);
371
371
 
372
372
  // ── Announcements: one polite, visually hidden line for the coarse events only (a reply arrived, the agent started,
373
373
  // finished, or waits on you). Messages themselves are not read out as they arrive; the list is a log to browse.
@@ -375,6 +375,15 @@ let announceTimer = null;
375
375
  /** #1630: which Discord server emoji this page may draw (created with the store, in boot). */
376
376
  let emojiIndex = null;
377
377
  let mentionIndex = null; // #1682: the names of the mentions shown
378
+ let taskRefIndex = null; // The task cards the person's messages name (chips) and the ones offered while `#` is typed
379
+ /** What a chip draws for a card the page knows — its words, its status in the page's language, and a tip with who has it. */
380
+ function taskChipInfo(code) {
381
+ const v = taskRefIndex ? taskRefIndex.get(code) : null;
382
+ if (!v) return null;
383
+ const status = t(`taskref.s.${v.status}`);
384
+ const tip = [`${v.code} · ${v.title}`, status, v.assignee ? `@${v.assignee}` : null].filter(Boolean).join(" · ");
385
+ return { title: v.title, status: v.status, statusLabel: status, tip };
386
+ }
378
387
  function announce(text) {
379
388
  let el = document.getElementById("announcer");
380
389
  if (!el) { el = document.createElement("div"); el.id = "announcer"; el.className = "sr-only"; el.setAttribute("role", "status"); el.setAttribute("aria-live", "polite"); el.setAttribute("aria-atomic", "true"); document.body.appendChild(el); }
@@ -407,6 +416,8 @@ export function boot({ stream, boot: bootData, deps = {} }) {
407
416
  });
408
417
  emojiIndex = createEmojiIndex((url) => (deps.fetch || fetch)(url, { credentials: "same-origin" }));
409
418
  mentionIndex = createMentionIndex((url) => guestPage() ? null : (deps.fetch || fetch)(url, { credentials: "same-origin" }));
419
+ // A guest has no task board (the server refuses it too); everyone else reads the cards a message names.
420
+ taskRefIndex = guestPage() ? null : createTaskRefIndex((url) => (deps.fetch || fetch)(url, { credentials: "same-origin" }));
410
421
  store.attach(stream);
411
422
  // #1306: what the server said about previews for this load. The page-wide message and storage listeners this adds
412
423
  // belong to the app, once (they are never per mount).
@@ -805,6 +816,7 @@ function threadEntry(name, doc) {
805
816
  openImage: (links, img) => openLightbox(links, img, annotateFor(name, img)), // an image, full size, in the page (#3727: with 標註)
806
817
  emojis: (id) => !!emojiIndex && emojiIndex.known(id), // #1630: the fleet's server emoji
807
818
  mentions: (kind, id) => (mentionIndex ? mentionIndex.name(kind, id) : null), // #1682: mention names
819
+ taskRefs: taskRefIndex ? taskChipInfo : undefined, // A person's task numbers as chips
808
820
  activity: { mount: (node, group) => mountActivity(node, group, activityCtx(name)) }, // AGEND-181: the timeline's blocks
809
821
  });
810
822
  e.thread = thread;
@@ -814,10 +826,20 @@ function threadEntry(name, doc) {
814
826
  function follow(name, thread) {
815
827
  // #1630: the server-emoji list is read once a message shows a tag; when it arrives, those messages are drawn again.
816
828
  // #1682: the same for mention names — asked for the ids the messages carry; when names arrive, drawn again.
817
- const wantEmojis = (msgs) => { if (emojiIndex && emojiIndex.wants(msgs)) emojiIndex.ensure(); if (mentionIndex) mentionIndex.ensure(msgs); };
829
+ const wantEmojis = (msgs) => { if (emojiIndex && emojiIndex.wants(msgs)) emojiIndex.ensure(); if (mentionIndex) mentionIndex.ensure(msgs); if (taskRefIndex) taskRefIndex.ensure(msgs); };
818
830
  const offs = [];
819
831
  if (emojiIndex) offs.push(emojiIndex.subscribe(() => thread.render(rowsOf(name))));
820
832
  if (mentionIndex) offs.push(mentionIndex.subscribe(() => thread.render(rowsOf(name))));
833
+ // The cards the messages name — drawn again when their answer arrives, and read again when the board changed.
834
+ if (taskRefIndex) {
835
+ offs.push(taskRefIndex.subscribe(() => thread.render(rowsOf(name))));
836
+ const sub = appStore.get().streamOn;
837
+ if (typeof sub === "function") {
838
+ let timer = null;
839
+ const off = sub("tasks", () => { if (timer) clearTimeout(timer); timer = setTimeout(() => { timer = null; taskRefIndex.refresh(); }, 400); });
840
+ offs.push(() => { if (timer) clearTimeout(timer); if (typeof off === "function") off(); });
841
+ }
842
+ }
821
843
  wantEmojis(store.state.msgs[name]);
822
844
  // AGEND-181/197: the activity feed — this instance's steps while the chat is shown (the Log's own read, live by steps_tick,
823
845
  // or by a poll when the stream has fallen back to polling); switched by this browser's Show activity / Show thinking.
@@ -1007,15 +1029,16 @@ function Dock({ name, inst, lease, exec, awaiting, workingLabel, bindings, ids,
1007
1029
  return html`<div data-trust="composer" class="dock"><div class="dock-col">
1008
1030
  <${Prompts} name=${name} />
1009
1031
  <${SubagentProgress} name=${name} />
1032
+ <div class="composer-hit" data-composer-focus onPointerDown=${focusComposerStrip} onClick=${focusComposerStrip}>
1010
1033
  ${metaLine ? html`<${ChatMetaLine} ids=${ids} name=${name} inst=${inst} lease=${lease} exec=${exec} awaiting=${awaiting} />`
1011
1034
  : html`<${WorkBar} ids=${ids} name=${name} lease=${lease} exec=${exec} awaiting=${awaiting} workingLabel=${workingLabel} />`}
1012
1035
  <${CommandCard} name=${name} lease=${lease} />
1013
1036
  <${QuickActions} name=${name} inst=${inst} lease=${lease} />
1014
1037
  ${s.waking[name] ? html`<p class="send-waking" role="status">${t("chat.waking", name)}</p>` : null}
1015
1038
  <${Composer} name=${name} inst=${inst} bindings=${bindings} ids=${ids} focused=${focused} label=${composerLabel(inst, name)} lease=${lease} busy=${R().isBusy(exec)} />
1016
- ${metaLine ? null : html`<div class="composer-row">${guestPage() ? html`<span class="guest-note" title=${t("chat.guestNote")}>${t("chat.guestNote")}</span>` : html`<${ComposerAuth} />`}<span
1017
- class="hint" title=${t(guestPage() || !supportsInstanceFeature(inst,"commands") ? "chat.guestMore" : "chat.composerMore")}>${t(supportsInstanceFeature(inst,"commands") ? touchScreen() ? "chat.composerHintTouch" : "chat.composerHint" : touchScreen() ? "chat.nativeComposerHintTouch" : "chat.nativeComposerHint")}</span></div>`}
1018
- </div></div>`;
1039
+ ${metaLine ? null : html`<div class="composer-row" data-composer-focus>${guestPage() ? html`<span class="guest-note" data-composer-focus title=${t("chat.guestNote")}>${t("chat.guestNote")}</span>` : html`<${ComposerAuth} />`}<span
1040
+ class="hint" data-composer-focus title=${t(guestPage() || !supportsInstanceFeature(inst,"commands") ? "chat.guestMore" : "chat.composerMore")}>${t(supportsInstanceFeature(inst,"commands") ? touchScreen() ? "chat.composerHintTouch" : "chat.composerHint" : touchScreen() ? "chat.nativeComposerHintTouch" : "chat.nativeComposerHint")}</span></div>`}
1041
+ </div></div></div>`;
1019
1042
  }
1020
1043
 
1021
1044
  /** #2233: a backend's "not signed in" choice offers Sign in (the module behind the session gate, loaded when asked). */
@@ -1259,7 +1282,7 @@ function Prompts({ name }) {
1259
1282
  return html`<div data-trust="permission" class="prompts" aria-live="polite">${list.map(p => html`<div key=${p.nonce} class=${`prompt${p.resolved ? " done" : ""}`} role="group" aria-label=${p.text}>
1260
1283
  <div class="txt">${p.resolved ? (p.outcome || t("chat.promptGone")) : textLinkSegments(p.text, p.links).map(sg => sg.href ? html`<a data-trust="link" class="st-link" href=${sg.href}>${sg.text}</a>` : sg.text)}</div>
1261
1284
  ${p.resolved ? null : html`<div class="acts">${p.actions.filter(a => !a.input).map(a => html`<button key=${a.id} type="button" class="btn" disabled=${!!p.busy} onClick=${() => store.answerPrompt(p, a.id)}>${a.label}</button>`)}
1262
- ${p.busy ? html`<span class="wait">${t("chat.promptAnswering")}</span>` : null}</div>`}
1285
+ ${p.busy && !p.confirming ? html`<span class="wait">${t("chat.promptAnswering")}</span>` : null}</div>`}
1263
1286
  ${p.resolved ? null : p.actions.filter(a => a.input).map(a => html`<${PromptText} key=${a.id} p=${p} action=${a} />`)}</div>`)}</div>`;
1264
1287
  }
1265
1288
 
@@ -1304,12 +1327,12 @@ function ChatMetaLine({ name, inst, lease, exec, awaiting, ids = {} }) {
1304
1327
  kind !== "awaiting" && since != null ? ` ${R().formatElapsed(performance.now() - since)}` : ""}` : "";
1305
1328
  const run = (command) => store.runCommand(name, command, "", { alive: () => lease.current() });
1306
1329
  const label = `${model}${effort ? ` · ${effort}` : ""}`;
1307
- return html`<div class=${`chat-meta${kind ? ` busy ${kind}` : ""}`} data-trust="status" role="status">
1308
- ${kind ? html`<span class="chat-meta-left"><span class="chat-meta-dot" aria-hidden="true"></span><span>${doing}${tail}</span></span>`
1330
+ return html`<div class=${`chat-meta${kind ? ` busy ${kind}` : ""}`} data-trust="status" role="status" data-composer-focus>
1331
+ ${kind ? html`<span class="chat-meta-left" data-composer-focus><span class="chat-meta-dot" data-composer-focus aria-hidden="true"></span><span data-composer-focus>${doing}${tail}</span></span>`
1309
1332
  : commands ? html`<button type="button" class="chat-meta-left chat-meta-model" title=${t("chat.chipModel", label)} aria-label=${t("chat.chipModel", label)}
1310
1333
  onClick=${() => (inst?.runtime === "windows" ? navigate(sectionPath("agents")) : run("model"))}><span>${label}${tail}</span><span class="chev" aria-hidden="true">⌄</span></button>`
1311
- : html`<span class="chat-meta-left"><span>${label}${tail}</span></span>`}
1312
- <span class="chat-meta-right">${busy ? html`<button type="button" id=${ids.stopBtn || "stopBtn"} class="chat-meta-stop btn-stop" disabled=${!!s.cancelling[name]} title=${t("chat.stopReplyTitle")}
1334
+ : html`<span class="chat-meta-left" data-composer-focus><span data-composer-focus>${label}${tail}</span></span>`}
1335
+ <span class="chat-meta-right" data-composer-focus>${busy ? html`<button type="button" id=${ids.stopBtn || "stopBtn"} class="chat-meta-stop btn-stop" disabled=${!!s.cancelling[name]} title=${t("chat.stopReplyTitle")}
1313
1336
  onClick=${() => store.cancelReply(name)}>${t("chat.stopReply")}</button>` : null}<${ComposerAuth} /></span>
1314
1337
  </div>`;
1315
1338
  }
@@ -1323,7 +1346,7 @@ function WorkBar({ name, lease, exec, awaiting, workingLabel, ids }) {
1323
1346
  const h = lease.interval(() => tick(n => n + 1), 1000); // ticks only while it shows, cleared with the lease
1324
1347
  return () => lease.clear(h);
1325
1348
  }, [kind, lease]);
1326
- if (!kind) return html`<div class="work-bar idle" aria-hidden="true"></div>`;
1349
+ if (!kind) return html`<div class="work-bar idle" data-composer-focus aria-hidden="true"></div>`;
1327
1350
  // #1629: the agent's own working label (its theme), shown as text — only for "working", never for the other states.
1328
1351
  const label = kind === "working" && workingLabel ? workingLabel
1329
1352
  : t(kind === "stuck" ? "chat.stuck" : kind === "stopping" ? "chat.stopping" : kind === "awaiting" ? "chat.awaiting" : "chat.working", name);
@@ -1373,6 +1396,48 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
1373
1396
  useEffect(() => { if (focused && input.current) input.current.focus(); }, [name]);
1374
1397
  useEffect(() => { refreshTourSpot(); });
1375
1398
  const setValue = (v) => { store.setDraft(name, v); setSel(0); tick(n => n + 1); };
1399
+ // A `#` at the caret offers the task cards (what the board has: its number, title, status); Enter or Tab put the
1400
+ // number in, Esc closes the list, the arrow keys choose. The caret is read from the box as the page draws (a key that only
1401
+ // moves it redraws: the box's keyup and click, below). Not for a guest (no board), a command line, or an IME still composing.
1402
+ const [refSel, setRefSel] = useState(0);
1403
+ const [refItems, setRefItems] = useState([]);
1404
+ const [refClosed, setRefClosed] = useState(null); // the draft the list was closed on (Esc); it opens again on change
1405
+ const refCaret = useRef(null); // where the caret goes once a chosen number is in the box
1406
+ const box = input.current;
1407
+ // While a chosen number is on its way into the box the caret is where it will be (the box still has the old text's caret until the page has drawn it).
1408
+ const caret = refCaret.current !== null ? refCaret.current : box && typeof box.selectionStart === "number" ? box.selectionStart : value.length;
1409
+ const refAt = taskRefIndex && !guest && !bindings.composing ? taskRefAt(value, caret) : null;
1410
+ const refKey = refAt ? `${refAt.start}:${refAt.query}` : "";
1411
+ const refOpen = !!refAt && refClosed !== value && refItems.length > 0;
1412
+ const refPick = Math.min(refSel, Math.max(refItems.length - 1, 0));
1413
+ useEffect(() => {
1414
+ if (!refAt) { setRefItems((x) => (x.length ? [] : x)); return undefined; }
1415
+ let live = true;
1416
+ const timer = setTimeout(() => { taskRefIndex.suggest(refAt.query).then((items) => { if (live) { setRefItems(items); setRefSel(0); } }); }, refAt.query ? 120 : 0);
1417
+ return () => { live = false; clearTimeout(timer); };
1418
+ }, [refKey]);
1419
+ useEffect(() => {
1420
+ const el = input.current;
1421
+ if (!el || !taskRefIndex || guest || typeof el.addEventListener !== "function") return undefined;
1422
+ const moved = (e) => { if (e.type === "click" || /^(Arrow(Left|Right)|Home|End)$/.test(String(e.key || ""))) tick((n) => n + 1); };
1423
+ el.addEventListener("keyup", moved); el.addEventListener("click", moved);
1424
+ return () => { el.removeEventListener("keyup", moved); el.removeEventListener("click", moved); };
1425
+ }, [input.current]);
1426
+ useEffect(() => { // after a chosen number is in the box, the caret goes behind it
1427
+ const c = refCaret.current;
1428
+ if (c === null) return;
1429
+ refCaret.current = null;
1430
+ const el = input.current;
1431
+ if (el) try { el.focus(); el.setSelectionRange(c, c); } catch { /* no selection API */ }
1432
+ });
1433
+ // Task rows keep their own interaction; only exact marked background surfaces opt into strip focus.
1434
+ const chooseRef = (v) => {
1435
+ if (!v || !refAt) return;
1436
+ recordEdit(input.current); // #2342: a step Ctrl+Z goes back from
1437
+ const r = insertTaskRef(value, refAt, caret, v.code);
1438
+ refCaret.current = r.caret;
1439
+ setValue(r.text);
1440
+ };
1376
1441
  // #1269: a command line runs the command (POST /ui/command); anything else — "/" included — is sent as before.
1377
1442
  // The draft is consumed only by a command that starts: one still out keeps the new line in the composer (#1476 review).
1378
1443
  const runLine = (cmd) => {
@@ -1404,6 +1469,12 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
1404
1469
  store.send(name);
1405
1470
  };
1406
1471
  const onKeyDown = (e) => {
1472
+ if (refOpen) {
1473
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); setRefSel((n) => (Math.min(n, refItems.length - 1) + (e.key === "ArrowDown" ? 1 : refItems.length - 1)) % refItems.length); return; }
1474
+ // On a touch screen Enter is a new line (the list is tapped); anywhere else it, and Tab, put the highlighted card in.
1475
+ if (((e.key === "Enter" && !touchScreen()) || e.key === "Tab") && !e.shiftKey && !e.ctrlKey && !e.metaKey && !e.isComposing) { e.preventDefault(); chooseRef(refItems[refPick]); return; }
1476
+ if (e.key === "Escape" && !e.isComposing) { e.preventDefault(); setRefClosed(value); return; }
1477
+ }
1407
1478
  if (palette && palette.length && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
1408
1479
  e.preventDefault();
1409
1480
  setSel((n) => (Math.min(n, palette.length - 1) + (e.key === "ArrowDown" ? 1 : palette.length - 1)) % palette.length);
@@ -1423,7 +1494,8 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
1423
1494
  };
1424
1495
  const paletteId = ids.cmdPalette || "cmdPalette";
1425
1496
  const optId = (c) => ids.cmdPalette ? `${ids.cmdPalette}-${c.name}` : `cmd-${c.name}`;
1426
- return html`<div class="composer-box" ref=${bindings.box}>
1497
+ const refListId = `${paletteId}-tasks`, refOptId = (v) => `${refListId}-${v.code}`;
1498
+ return html`<div class="composer-box" data-composer-focus ref=${bindings.box}>
1427
1499
  ${machineUnavailable ? html`<p class="note runtime-machine-unavailable" role="status">${t(inst.machine_status === "revoked" ? "chat.machineRevokedHint" : "chat.machineUnavailable",machineName(inst.machine_id,inst.machine_name))}</p>` : null}
1428
1500
  ${inst?.native_busy && !busy && !inst?.native_blocked ? html`<p class="note" role="status">${t("chat.nativeBusy")}</p>` : null}
1429
1501
  ${palette ? html`<ul data-trust="palette" class="cmd-palette" id=${paletteId} role="listbox" aria-label=${t("chat.cmdCommands")}>
@@ -1432,6 +1504,12 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
1432
1504
  <span class="cmd-name mono">/${c.name}${c.arg ? html` <span class="cmd-arg">${c.arg}</span>` : null}</span><span class="cmd-desc">${t(`chat.cmd_${c.name}`)}</span></li>`)
1433
1505
  : html`<li class="cmd-none" role="option" aria-selected="false">${t(guest ? "chat.cmdNotGuests" : "chat.cmdNotCommand")}</li>`}
1434
1506
  </ul>` : null}
1507
+ ${refOpen ? html`<ul data-trust="palette" class="cmd-palette task-ref-list" id=${refListId} role="listbox" aria-label=${t("taskref.pickHint")}>
1508
+ ${refItems.map((v, i) => html`<li key=${v.code} id=${refOptId(v)} role="option" tabindex="-1" aria-selected=${i === refPick ? "true" : "false"}
1509
+ class=${i === refPick ? "on" : ""} onMouseDown=${(e) => { e.preventDefault(); chooseRef(v); }}>
1510
+ <span class="cmd-name mono">${v.code}</span><span class="cmd-desc">${v.title}</span>
1511
+ <span class=${`tb-pill st-${v.status}`}>${t(`taskref.s.${v.status}`)}</span></li>`)}
1512
+ </ul>` : null}
1435
1513
  ${reply ? html`<div class="reply-bar" data-trust="composer" role="status">
1436
1514
  <span class="reply-mark" aria-hidden="true"><svg class="icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H11"/></svg></span><span class="reply-label">${t("chat.replyingTo", reply.sender)}</span>
1437
1515
  <span class="reply-text">${replySnippet(reply)}</span>
@@ -1439,7 +1517,8 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
1439
1517
  </div>` : null}
1440
1518
  ${files.length ? html`<div class="pending-files">${files.map((f, i) => html`<${FileChip} bindings=${bindings} key=${`${f.name}-${i}`} f=${f} i=${i} name=${name} />`)}</div>` : null}
1441
1519
  <${ComposerInput} inputRef=${input} ids=${ids} value=${value} placeholder=${t("chat.composerPlaceholder", label)} onValue=${setValue}
1442
- onKeyDown=${onKeyDown} onPaste=${onPaste} controls=${palette ? paletteId : undefined} expanded=${!!palette} activeDescendant=${pick ? optId(pick) : undefined}
1520
+ onKeyDown=${onKeyDown} onPaste=${onPaste} controls=${palette ? paletteId : refOpen ? refListId : undefined} expanded=${!!palette || refOpen}
1521
+ activeDescendant=${pick ? optId(pick) : refOpen ? refOptId(refItems[refPick]) : undefined}
1443
1522
  attach=${attachmentsSupported ? { title: t("chat.attachTitle"), onFiles: (list) => store.addFiles(name, list) } : null}
1444
1523
  stop=${HIDDEN_STOP}
1445
1524
  tools=${toolsHere && !narrow && !guestPage() ? html`<${ComposerTools} name=${name} inst=${inst} lease=${lease} short=${true} />` : null}
@@ -144,6 +144,22 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
144
144
  const src = (s) => (s === "instance" ? ` ${t("chat.configured")}` : s === "fleet-default" ? ` ${t("chat.fleetDefault")}` : "");
145
145
  const bar = (pct, level) => html`<span class="progress-bar"><span class=${`progress-fill${level ? ` ${level}` : ""}`} data-pct=${Math.max(0, Math.min(Number(pct) || 0, 100))}></span></span>`;
146
146
  const row = (k, v) => html`<div class="kv"><span class="k">${k}</span><span class="v">${v}</span></div>`;
147
+ // M-3522: what the agent's CLI loads every session, with a warning per file over its limit (50 KB, or Codex's cut-off).
148
+ const kb = (n) => (n < 1024 ? `${n.toLocaleString()} B` : `${(n / 1024).toLocaleString(undefined, { maximumFractionDigits: 1 })} KB`);
149
+ const loaded = (f) => {
150
+ if (!f || !Array.isArray(f.files) || !f.files.length) return null;
151
+ const over = f.files.filter((x) => !x.includedIn && x.bytes > x.limit);
152
+ return html`<section class="card d-loaded" data-instruction-files>
153
+ <h3>${pt("loadedTitle")}</h3>
154
+ ${f.files.map((x) => row(x.kind === "inline" ? html`${x.label}` : html`<span class="mono">${x.label}</span>`,
155
+ // Text the CLI's project file already holds (its fleet instructions block) is shown for reference, not counted again.
156
+ x.includedIn ? html`<span class="muted" data-included-in=${x.includedIn}>${pt("loadedIncluded", x.includedIn, kb(x.bytes))}</span>`
157
+ : html`<span class=${x.bytes > x.limit ? "warn" : ""} data-over=${x.bytes > x.limit ? "1" : undefined}>${kb(x.bytes)}</span>`))}
158
+ <div class="kv d-loaded-total"><span class="k">${pt("loadedTotal")}</span><span class="v">${kb(f.total)}</span></div>
159
+ ${over.length ? html`<p class="note warn" role="status" data-instruction-warning>${over.some((x) => x.truncates) ? pt("loadedTruncates", kb(over.find((x) => x.truncates).limit)) : ""}${over.some((x) => !x.truncates) ? pt("loadedWarn", kb(f.warnBytes)) : ""}</p>`
160
+ : html`<p class="note">${pt("loadedNote")}</p>`}
161
+ </section>`;
162
+ };
147
163
  let content;
148
164
  if (failed) content = html`<${ErrorState} message=${t("chat.loadFailed")} onRetry=${load} />`;
149
165
  else if (!d) content = html`<${Skeleton} lines=${6} />`;
@@ -176,6 +192,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
176
192
  ${row(t("chat.dContext"), html`<span class="pct">${ctx != null ? `${Math.round(ctx)}%` : "--"}</span>${ctx != null ? bar(ctx, ctx > 80 ? "warn" : "") : null}`)}
177
193
  ${row(t("chat.dRate5"), html`<span class="pct">${Math.round(rl5)}%</span>${bar(rl5, rl5 > 90 ? "error" : rl5 > 70 ? "warn" : "")}`)}
178
194
  ${row(t("chat.dRate7"), html`<span class="pct">${Math.round(rl7)}%</span>${bar(rl7, rl7 > 90 ? "error" : rl7 > 70 ? "warn" : "")}`)}</section>
195
+ ${loaded(d.instruction_files)}
179
196
  <${InstanceBoardWork} name=${name} onOpen=${(id) => navigate(`/ui/fleet?card=${encodeURIComponent(id)}`)} />
180
197
  <section class="card"><h3>${t("chat.dActivity")}</h3>${d.recent_activity?.length ? d.recent_activity.map((a, i) => html`<div key=${i} class="activity">
181
198
  <span class="mono muted">${a.timestamp ? new Date(`${a.timestamp.replace(" ", "T")}Z`).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""}</span>
@@ -75,7 +75,7 @@ register("fleet", {
75
75
  hostMemory_elevated: "主機記憶體壓力偏高:新的 agent 一次啟動一個,至少間隔 5 秒",
76
76
  hostMemory_critical: "主機記憶體壓力嚴重:新的 agent 會等記憶體恢復再啟動",
77
77
  hostMemory_top: "最大:{0}", hostMemory_ownerFleet: "fleet 本身", hostMemory_ownerTmux: "tmux", hostMemory_ownerOther: "不屬於任何 Agent",
78
- title: "Fleet", tasks: "Tasks", schedules: "排程", teams: "Teams", org: "組織圖", cache: "快取", usage: "用量", "host-health": "主機狀態",
78
+ title: "Fleet", tasks: "任務", schedules: "排程", teams: "團隊", org: "組織圖", cache: "快取", usage: "用量", "host-health": "主機狀態",
79
79
  docs: "文件", docsNewTab: "文件(在新分頁開啟)",
80
80
  newSchedule: "新增排程", newTeam: "新增 team",
81
81
  noSchedules: "還沒有排程", noSchedulesHint: "用 cron 自動執行例行工作。",
@@ -382,6 +382,8 @@ function useRooms() {
382
382
  // and encoded into each call, never trusted as anything else.
383
383
  const roomParam = () => { try { const v = new URLSearchParams(location.search).get("room"); return v && /^[A-Za-z0-9-]{1,64}$/.test(v) ? v : null; } catch { return null; } };
384
384
  const roomPath = (id) => `/ui/hub?room=${encodeURIComponent(id)}`;
385
+ /** M-3533 R1: a group room's Chat or Office tab (design §2.1). */
386
+ const roomViewPath = (id, view) => (view === "office" ? `${roomPath(id)}&view=office` : roomPath(id));
385
387
  /** cid-hub-shell-parity: the Notices page is /ui/hub?view=notices (the path every Hub listener and router already serves). */
386
388
  const viewParam = () => { try { return new URLSearchParams(location.search).get("view"); } catch { return null; } };
387
389
  export const NOTICES_PATH = "/ui/hub?view=notices";
@@ -591,7 +593,8 @@ function HubChats() {
591
593
  // A room of a Hub with rooms: the shared thread with the room's store, composer and members panel (hub-room-thread.js).
592
594
  if (id && listed && !listed.legacy) return html`<${HubRoomPage} key=${id} roomId=${id} listed=${listed} Thread=${HubThread} client=${hubClient()}
593
595
  rooms=${rs.rooms} openRoom=${(rid) => navigate(roomPath(rid))} goList=${() => navigate("/ui/hub")}
594
- onLeft=${() => { void refreshRooms(); navigate("/ui/hub"); }} onMe=${noteHubMeId} pinsOn=${roomPinsLive()} />`;
596
+ onLeft=${() => { void refreshRooms(); navigate("/ui/hub"); }} onMe=${noteHubMeId} pinsOn=${roomPinsLive()}
597
+ view=${viewParam() === "office" ? "office" : "chat"} officeHref=${(v) => roomViewPath(id, v)} onView=${(v) => navigate(roomViewPath(id, v))} />`;
595
598
  if (id && room) return html`<${HubRoomView} key=${id} room=${room} />`;
596
599
  if (id) return html`<${HubRoomLoading} error=${rs.error} />`;
597
600
  if (opening && (!rs.loaded || recentRoom(rs.rooms))) return html`<${PanelHeader} title=${hc("chats")} /><div class="hub-home"><div class="hub-home-pick center"><${Skeleton} variant="rows" lines=${4} /></div></div>`;
@@ -24,6 +24,7 @@ import { namesOf, namesStore } from "/assets/instance-nav.js";
24
24
  import { Empty, Skeleton } from "/assets/ui-states.js";
25
25
  import { Icon } from "/assets/ui-icons.js";
26
26
  import { toast } from "/assets/ui-toast.js";
27
+ import { confirmDialog } from "/assets/ui-confirm.js";
27
28
  import { notifyStore, notifySupport, configDetail, reasonText, refreshNotify, setNotify } from "/assets/app-needs.js";
28
29
  import { openSignIn, signInOffered } from "./backend-signin.js";
29
30
  import { decideProposal, installProposals } from "./agent-proposals.js";
@@ -119,7 +120,7 @@ appStore.subscribe((st) => {
119
120
  handedTo = st.chatOwner;
120
121
  const items = Array.isArray(st.needs) ? st.needs : [];
121
122
  for (const nonce of Object.keys(claims.get().prompts)) {
122
- handedTo.holdPrompt(items.find((i) => i.nonce === nonce) || { nonce, instance: "" });
123
+ handedTo.holdPrompt(items.find((i) => i.nonce === nonce) || { nonce, instance: "" }, claims.get().prompts[nonce] === "confirming");
123
124
  }
124
125
  }
125
126
  const items = Array.isArray(st.needs) ? st.needs : [];
@@ -243,6 +244,14 @@ function NeedsItem({ item, nowMs, owner }) {
243
244
  // Only before Chat has booted: the page's own claim on this nonce, taken now (synchronously), kept until the
244
245
  // server's list drops the prompt (or the answer fails).
245
246
  if (claims.get().prompts[item.nonce]) return;
247
+ const confirmation = item.actions?.find(a => a.id === action)?.confirmation;
248
+ setClaim("prompts", item.nonce, confirmation ? "confirming" : "busy");
249
+ if (confirmation && !await confirmDialog({ ...confirmation, danger: true })) {
250
+ setClaim("prompts", item.nonce, null);
251
+ // Chat may have adopted this confirmation while its dialog was open. Give its claim back too.
252
+ chatOwner()?.releasePrompt(item.nonce);
253
+ return;
254
+ }
246
255
  setClaim("prompts", item.nonce, "busy");
247
256
  let r = null;
248
257
  try {
@@ -280,7 +289,7 @@ function NeedsItem({ item, nowMs, owner }) {
280
289
  ${item.type==='host'?(item.hostAlert?html`<${HostAlertActions} record=${item.hostAlert}/>`:html`<a class="btn btn-sm" href=${fleetPath('host-health')}>${hostAlertText('open')}</a>`):null}
281
290
  <div class="n-actions">
282
291
  ${item.type === "prompt" && Array.isArray(item.actions) ? item.actions.filter((a) => !a.input).map((a) => html`<button key=${a.id} type="button" class="btn btn-sm"
283
- disabled=${promptBusy} onClick=${() => answer(a.id)}>${(p ? p.busy : fallback === "busy") ? tn("answering") : a.label}</button>`) : null}
292
+ disabled=${promptBusy} onClick=${() => answer(a.id)}>${(p ? p.busy && !p.confirming : fallback === "busy") ? tn("answering") : a.label}</button>`) : null}
284
293
  ${item.type === "delivery" || item.type === "missed" ? html`<button type="button" class="btn btn-sm" disabled=${!!ack} onClick=${acknowledge}>
285
294
  <${Icon} name="check" size=${14} />${ack === "busy" ? tn("acknowledging") : tn("acknowledge")}</button>` : null}
286
295
  ${(item.reason === "auth_paused" || item.reason === "backend_signin") && item.signIn && signInOffered() ? html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => openSignIn(item.signIn)}>${tn("signIn")}</button>` : null}
@@ -25,8 +25,9 @@ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
25
25
  import { Icon } from "/assets/ui-icons.js";
26
26
  import { Menu } from "/assets/ui-menu.js";
27
27
  import { toast } from "/assets/ui-toast.js";
28
- import { GroupMark, groupLabel, groupOf as navGroupOf, modelText } from "/assets/instance-nav.js";
28
+ import { GroupMark, groupLabel, groupOf as navGroupOf, modelText, labelOf } from "/assets/instance-nav.js";
29
29
  import "./settings-strings.js";
30
+ import "./settings-default-model-strings.js";
30
31
  import "./settings-shared-strings.js"; // see settings-shared.js: the words Shared agent settings added, which an older settings-strings.js in an open tab lacks
31
32
  import "./agent-page-strings.js"; // the confirmation text of the MCP proxy reply
32
33
  import "./settings-restart-strings.js"; // S-92: the restart words for a fleet with no chat connection (a file of its own: an open tab may hold an old settings-strings.js)
@@ -46,6 +47,7 @@ import {
46
47
  AgentDialog, BackendSelect, BotDialog, ChipList, ClassicDialog, DefaultMark, Feedback, Impact, InEffect, Inherited, Label,
47
48
  NewBotDialog, Override, Select, ask, impactText, inAgentDefaults, valueText,
48
49
  } from "./settings-dialogs.js";
50
+ import { defaultIdentityRecord, runningDefaultIdentityTargets } from "./settings-default-model-scope.js";
49
51
  import { InfoTip, SharedAgentSettings, sharedNotes } from "./settings-shared.js";
50
52
  import { QuotaNoticeSettings, quotaNoticeText } from "./settings-quota-notice.js";
51
53
  import { SetupWizard } from "./settings-wizard.js";
@@ -140,7 +142,7 @@ async function loadLive(lease) {
140
142
  if (!lease.current()) return null;
141
143
  const live = {}, classicLive = {};
142
144
  if (f.ok && f.body && Array.isArray(f.body.instances)) for (const i of f.body.instances) {
143
- live[i.name] = { status: i.status, state: i.state, backend: i.backend, model: i.model, model_display: modelText(i, i.model_display), effort: i.effort, effort_supported: i.effort_supported, runtime:i.runtime, capabilities:i.capabilities, machine_id:i.machine_id, machine_name:i.machine_name, machine_status:i.machine_status };
145
+ live[i.name] = { display_name: i.display_name || i.classicName, status: i.status, state: i.state, backend: i.backend, model: i.model, model_display: modelText(i, i.model_display), effort: i.effort, effort_supported: i.effort_supported, runtime:i.runtime, capabilities:i.capabilities, machine_id:i.machine_id, machine_name:i.machine_name, machine_status:i.machine_status };
144
146
  if (i.classic) classicLive[i.name] = { status: i.status, state: i.state };
145
147
  }
146
148
  // /api/fleet carries live state for ClassicBot rooms; the profiles are the fallback for one not listed there yet.
@@ -349,7 +351,19 @@ export function SettingsPanel({ route, navKey }) {
349
351
  // Every confirmation before the first write: a cancelled one must not leave earlier changes applied and later
350
352
  // ones pending (a surprising partial apply).
351
353
  applying.current = true;
354
+ let confirmedRestartTargets = [];
355
+ const confirmedDefaultRequests = new Map();
352
356
  try {
357
+ if ([...stagedRef.current.values()].some(c => c.sharedDefaults === "restart")) {
358
+ const shown = new Map([...stagedRef.current.values()].filter(c => c.sharedDefaults === "restart")
359
+ .flatMap(c => c.sharedDefaultsTargets || []).map(target => [target.name, target]));
360
+ confirmedRestartTargets = [...shown.values()];
361
+ for (const c of stagedRef.current.values()) if (c.sharedDefaults === "restart") confirmedDefaultRequests.set(c.stageKey, structuredClone(c.request));
362
+ const names = confirmedRestartTargets.map(({ name, label }) => name === label ? label : tn("defaultIdentityNamedTarget", label, name)).join("\n");
363
+ if (!(await ask(tn(confirmedRestartTargets.length === 1 ? "defaultIdentityRestartConfirmOne" : "defaultIdentityRestartConfirm", confirmedRestartTargets.length, names),
364
+ { title: tn("defaultIdentityWhen"), confirmLabel: tn("defaultIdentityRestartButton"), danger: true }))) return;
365
+ if (!mount.current()) return;
366
+ }
353
367
  // A panel that went while a question was open asks nothing more, and says nothing.
354
368
  for (const c of [...stagedRef.current.values()]) {
355
369
  for (const k of c.confirms || []) {
@@ -372,7 +386,9 @@ export function SettingsPanel({ route, navKey }) {
372
386
  if (failed) toast(tn("youSaveFailed"), false);
373
387
  if (!stagedRef.current.size) { if (!failed) toast(tn("youSaved")); setDraftEpoch((n) => n + 1); return; }
374
388
  }
375
- const list = [...stagedRef.current.values()].map(({ label, impact, request, connectionSecret, stageKey, key }) => ({ label, impact, request, connectionSecret, stageKey, key }));
389
+ const list = [...stagedRef.current.values()].map(({ label, impact, request, connectionSecret, stageKey, key, sharedDefaults, notes }) => ({ label, impact, request, connectionSecret, stageKey, key, sharedDefaults, notes,
390
+ sharedDefaultsTargets: sharedDefaults === "restart" ? confirmedRestartTargets : [],
391
+ ...(sharedDefaults === "restart" && confirmedDefaultRequests.has(stageKey) ? { request: confirmedDefaultRequests.get(stageKey) } : {}) }));
376
392
  const handlers = new Map([...stagedRef.current.values()].filter((c) => typeof c.onResult === "function").map((c) => [c.stageKey, c.onResult]));
377
393
  if (startOperation(list)) {
378
394
  results.current = handlers; submitted.current = new Map(drafts.current); submittedStaged.current = new Map(stagedRef.current);
@@ -537,7 +553,7 @@ export function SettingsPanel({ route, navKey }) {
537
553
  ${section !== "runtimes" ? html`<${SettingsPageHead} section=${section}>${section === "agents" && ctx ? html`<button type="button" id="newAgentBtn" class="btn btn-primary" disabled=${yamlStaged(staged)} onClick=${() => toDialog({ kind: "create" })}><${Icon} name="plus" size=${16} />${tn("newAgent")}</button>` : null}</${SettingsPageHead}>` : null}
538
554
  ${searchable ? html`<div class="s-toolbar"><label class="s-search"><${Icon} name="search" size=${14} /><span class="sr-only">${tn("searchAll")}</span>
539
555
  <input type="search" value=${search} placeholder=${tn("searchAll")} onInput=${(e) => setSearch(e.target.value)} /></label></div>` : null}
540
- ${op ? html`<${OperationCard} op=${op} schema=${data && data.schema} />` : null}
556
+ ${op ? html`<${OperationCard} op=${op} schema=${data && data.schema} fleet=${data && data.fleet} classic=${data && data.classic} live=${data && data.live} />` : null}
541
557
  <${PendingChanges} inline=${true} />
542
558
  ${ctx && (section === "agents" || section === "chat") ? html`<${FirstRunCard} onConnect=${openWizard} />` : null}
543
559
  <div class="s-section-layout" data-section=${section}>${sectionBody}</div>
@@ -1072,8 +1088,25 @@ function livenessForm(d) {
1072
1088
  /** `defaults.task_board` as saved, with the liveness part from the form (the defaults merge replaces `task_board` whole). */
1073
1089
  function taskBoardDefaults(d, f) {
1074
1090
  const n = (v) => Number(v);
1075
- return { ...(d.task_board || {}), liveness: f ? { enabled: f.liveOn, quiet_minutes: n(f.liveQuiet), prompt_minutes: n(f.livePrompt), crash_grace_minutes: n(f.liveCrash) }
1091
+ const tb = d.task_board || {}, saved = wakesForm(d), w = f || saved;
1092
+ const out = { ...tb, liveness: f ? { enabled: f.liveOn, quiet_minutes: n(f.liveQuiet), prompt_minutes: n(f.livePrompt), crash_grace_minutes: n(f.liveCrash) }
1076
1093
  : { enabled: ((d.task_board && d.task_board.liveness) || {}).enabled !== false, ...Object.fromEntries(["quiet_minutes", "prompt_minutes", "crash_grace_minutes"].map((k) => [k, ((d.task_board && d.task_board.liveness) || {})[k] ?? LIVENESS_DEFAULTS[k]])) } };
1094
+ // A wake switch the form leaves as saved stays as saved (absent stays absent: the file is not filled with defaults). One that was
1095
+ // changed is written — off, or on where the file already had the key — and put back to its default on, the key goes.
1096
+ for (const [key, field] of [["comment_wakes", "wakeComment"], ["progress_wakes", "wakeProgress"]]) {
1097
+ if (w[field] === saved[field]) continue;
1098
+ if (w[field] === false || hasOwn(tb, key)) out[key] = w[field]; else delete out[key];
1099
+ }
1100
+ if (w.wakeLeader !== saved.wakeLeader) { if (w.wakeLeader) out.leader = w.wakeLeader; else delete out.leader; }
1101
+ return out;
1102
+ }
1103
+ /**
1104
+ * The task board's wake switches (`defaults.task_board.comment_wakes`, `progress_wakes`, `leader`), as the form holds
1105
+ * them. Nothing written is the default: comments and progress wake, and the board has no leader.
1106
+ */
1107
+ function wakesForm(d) {
1108
+ const tb = d.task_board || {};
1109
+ return { wakeComment: tb.comment_wakes !== false, wakeProgress: tb.progress_wakes !== false, wakeLeader: typeof tb.leader === "string" ? tb.leader.trim() : "" };
1077
1110
  }
1078
1111
  const minutesInRange = (v) => { const n = Number(v); return String(v).trim() !== "" && Number.isFinite(n) && n >= 1 && n <= 1440 ? "" : "livenessRange"; };
1079
1112
 
@@ -1090,6 +1123,8 @@ function generalForm(d, c, fleet = {}, schema = {}) {
1090
1123
  hangOn: hang.enabled !== false, hang: String(hang.timeout_minutes ?? HANG_TIMEOUT_DEFAULT_MINUTES),
1091
1124
  // #3647: telling a card's dispatcher when its assignee stops.
1092
1125
  ...livenessForm(d),
1126
+ // Which task board news wakes an agent.
1127
+ ...wakesForm(d),
1093
1128
  // #2347 §10 review: unset startup concurrency is automatic (deriveSpawnConcurrency: 2–10 by free memory and cores),
1094
1129
  // not 10 — an empty field, and a save that leaves it unset (the defaults merge replaces `startup` whole).
1095
1130
  concurrency: startup.concurrency == null ? "" : String(startup.concurrency), stagger: String(startup.stagger_delay_ms ?? 500),
@@ -1116,6 +1151,9 @@ function General({ ctx, part = "all" }) {
1116
1151
  const original = useMemo(() => ({ c: structuredClone(c) }), []);
1117
1152
  const base = useMemo(() => generalForm(d, c, ctx.fleet, schema), []);
1118
1153
  const [f, setF] = useDraft(ctx, "general", () => base);
1154
+ const restartTargets = runningDefaultIdentityTargets(ctx.fleet, ctx.classic, ctx.live, { ...d, backend: f.backend, model: f.model });
1155
+ const restartTargetSignature = JSON.stringify(restartTargets);
1156
+ const sharedDefaultMode = f.defaultAdoption === "restart" && restartTargets.length ? "restart" : "next-start";
1119
1157
  const set = (k) => (v) => setF((x) => ({ ...x, [k]: v }));
1120
1158
  /** The class of a field's row: `field`, and `s-dirty` while one of its keys differs from what is saved. */
1121
1159
  const fc = (cls, ...keys) => `${cls}${keys.some((k) => !sameValue(f[k], base[k])) ? " s-dirty" : ""}`;
@@ -1142,7 +1180,7 @@ function General({ ctx, part = "all" }) {
1142
1180
  }
1143
1181
  ctx.unstage("defaults:invalid");
1144
1182
  const defaultsPatch = changedFields({
1145
- backend: f.backend, model: f.model || undefined, locale: f.locale || null, auto_pause_after: num(f.auto),
1183
+ backend: f.backend, model: f.model || null, locale: f.locale || null, auto_pause_after: num(f.auto),
1146
1184
  agent_mode: f.agent_mode, tool_set: f.tool_set || null, tool_progress: f.tool_progress, cross_instance_visibility: f.visibility,
1147
1185
  tips: noticeMode(f.tips), reply_triggers: f.replyTriggers, reply_completion_guard: f.reply, log_level: f.log_level,
1148
1186
  // The dashboard features every agent may use unless its own setting says otherwise. All of them go, because the write
@@ -1153,7 +1191,7 @@ function General({ ctx, part = "all" }) {
1153
1191
  task_board: taskBoardDefaults(d, f),
1154
1192
  startup: { ...(f.concurrency.trim() === "" ? {} : { concurrency: num(f.concurrency) }), stagger_delay_ms: num(f.stagger) },
1155
1193
  }, {
1156
- backend: d.backend || "claude-code", model: d.model || undefined, locale: d.locale || null, auto_pause_after: d.auto_pause_after ?? 0,
1194
+ backend: d.backend || "claude-code", model: d.model || null, locale: d.locale || null, auto_pause_after: d.auto_pause_after ?? 0,
1157
1195
  agent_mode: d.agent_mode || "mcp", tool_set: TOOL_SETS.includes(d.tool_set) ? d.tool_set : null, tool_progress: d.tool_progress ?? "off",
1158
1196
  tips: d.tips ?? true, cross_instance_visibility: visibilityDefault(d), reply_triggers: Boolean(d.reply_triggers ?? schema.reply_triggers_default), reply_completion_guard: d.reply_completion_guard ?? true, log_level: d.log_level || "info",
1159
1197
  dashboard: Object.fromEntries(DASHBOARD_FEATURES.filter((k) => !Object.hasOwn(SEPARATE_FEATURE_KEYS, k)).map((k) => [k, dashboardDefault(d, k)])),
@@ -1185,12 +1223,15 @@ function General({ ctx, part = "all" }) {
1185
1223
  const dKeys = Object.keys(defaultsPatch), cKeys = Object.keys(classicPatch);
1186
1224
  // The bar says what this Save costs in the page's own words (how many agents restart), not a bare impact label.
1187
1225
  syncStage(ctx, "defaults:fleet", dKeys.length ? { label: tn("updateDefaults"), count: dKeys.length,
1226
+ sharedDefaults: dKeys.some(k => k === "backend" || k === "model") ? sharedDefaultMode : undefined,
1227
+ sharedDefaultsTargets: restartTargets,
1188
1228
  impact: batchImpact(schema, dKeys, (k) => defaultsImpact(schema, k)), notes: notes.bar.defaults,
1189
- request: { method: "PUT", url: "/api/settings/fleet/defaults", body: defaultsPatch } } : null);
1229
+ request: { method: "PUT", url: "/api/settings/fleet/defaults", body: sharedDefaultMode === "restart" && dKeys.some(k => k === "backend" || k === "model")
1230
+ ? { ...defaultsPatch, backend: f.backend, model: f.model || null } : defaultsPatch } } : null);
1190
1231
  syncStage(ctx, "defaults:classic", cKeys.length ? { label: tn("updateClassicDefaults"), count: cKeys.length,
1191
1232
  impact: cKeys.every((k) => impactOf(schema, `classic_defaults.${k}`) === "now") ? "now" : "fleet",
1192
1233
  request: { method: "PUT", url: "/api/settings/classic/defaults", body: classicPatch } } : null);
1193
- }, [f, ready]);
1234
+ }, [f, ready, restartTargetSignature]);
1194
1235
  // #2347 §10: a default nobody set in fleet.yaml shows the built-in value it holds, marked "default" until it is edited;
1195
1236
  // ClassicBot's inherited ones say what they inherit from Agent defaults.
1196
1237
  const unset = {
@@ -1201,6 +1242,8 @@ function General({ ctx, part = "all" }) {
1201
1242
  // #3647: each threshold nobody set is the built-in default.
1202
1243
  ...(() => { const lv = (d.task_board && d.task_board.liveness) || {};
1203
1244
  return { liveOn: !hasOwn(lv, "enabled"), liveQuiet: !hasOwn(lv, "quiet_minutes"), livePrompt: !hasOwn(lv, "prompt_minutes"), liveCrash: !hasOwn(lv, "crash_grace_minutes") }; })(),
1245
+ // Each wake switch nobody set is the built-in default (on; no leader).
1246
+ wakeComment: !hasOwn(d.task_board || {}, "comment_wakes"), wakeProgress: !hasOwn(d.task_board || {}, "progress_wakes"), wakeLeader: !hasOwn(d.task_board || {}, "leader"),
1204
1247
  };
1205
1248
  const fromDefaults = (k, value, target) => ({ text: valueText(value, k), builtin: !hasOwn(d, k), from: inAgentDefaults(target) });
1206
1249
  const L = (text, field, id) => html`<${Label} text=${text} schema=${schema} field=${field} htmlFor=${id} />`;
@@ -1663,7 +1706,7 @@ export function PendingBar({ staged, busy, onApply, onDiscard, section }) {
1663
1706
  }
1664
1707
 
1665
1708
  /** The Apply in hand (the app's, settings-apply.js): its writes, its job, and a restart when one is needed. */
1666
- export function OperationCard({ op, schema }) {
1709
+ export function OperationCard({ op, schema, fleet, classic, live }) {
1667
1710
  const [restarting, setRestarting] = useState(false);
1668
1711
  const busy = opBusy(op); // nothing to dismiss while it, or its restart, runs
1669
1712
  const phaseBusy = ["writing", "posting", "watching"].includes(op.phase);
@@ -1705,11 +1748,12 @@ export function OperationCard({ op, schema }) {
1705
1748
  ${op.steps.length ? html`<ul class="s-op-steps">${op.steps.map((s, i) => html`<li key=${i} class=${`s-step ${s.status}`}>
1706
1749
  <span class="s-step-icon" aria-hidden="true">${icon(s.status) ? html`<${Icon} name=${icon(s.status)} size=${14} />` : "·"}</span>
1707
1750
  <span class="grow">${s.label}</span>
1708
- <span class="note">${s.status === "waiting" ? tn("stepWaiting") : s.status === "skipped" ? tn("stepSkipped") : s.status === "failed" ? (s.error ? applyErrorText(s.error) : tn("applyFailed")) : s.note || impactText(s.impact)}</span></li>`)}</ul>` : null}
1751
+ <span class="note">${s.status === "waiting" ? tn("stepWaiting") : s.status === "skipped" ? tn("stepSkipped") : s.status === "failed" ? (s.error ? applyErrorText(s.error) : tn("applyFailed")) : s.note || (s.notes?.length ? s.notes.join(" · ") : s.sharedDefaults ? tn(s.sharedDefaults === "restart" ? "defaultIdentityRestart" : "defaultIdentityNext") : impactText(s.impact))}</span></li>`)}</ul>` : null}
1709
1752
  ${rows.length ? html`<ul class="s-op-steps">${rows.map((r) => html`<li key=${r.target} class=${`s-step ${r.status}`}>
1710
1753
  <span class="s-step-icon" aria-hidden="true">${r.status === "done" ? html`<${Icon} name="check" size=${14} />` : r.status === "failed" ? html`<${Icon} name="alert" size=${14} />` : r.status === "restart-required" ? html`<${Icon} name="restart" size=${14} />` : "·"}</span>
1711
- <span class="grow">${r.target === "fleet" ? "AgEnD" : shortName(r.target, {})}</span>
1712
- <span class="note">${r.target === "fleet" && r.status === "running" ? tn(r.kind === "hot" ? "connStartingNow" : "restartFleetTitle") : r.status === "restart-required" ? tn("applyRestartNeeded")
1754
+ <span class="grow"><span class="s-op-name">${r.target === "fleet" ? "AgEnD" : labelOf(defaultIdentityRecord(r.target, fleet, classic, live))}</span>
1755
+ ${r.target !== "fleet" && labelOf(defaultIdentityRecord(r.target, fleet, classic, live)) !== r.target ? html`<small class="note s-op-slug">${r.target}</small>` : null}</span>
1756
+ <span class="note">${r.target === "fleet" && r.status === "running" ? tn(r.kind === "hot" ? "connStartingNow" : "restartFleetTitle") : r.status === "restart-required" ? tn("applyRestartNeeded") : r.status === "next-start" || r.kind === "next-start" ? tn("defaultIdentityPending")
1713
1757
  : r.settled_by === "no-change" ? tn("applyNoChange") : r.settled_by === "fleet-restart" ? tn("viaRestart") : r.kind === "hot" ? tn("impactNow") : tn("impactAgent")}</span>
1714
1758
  ${r.error ? html`<span class="feedback error">${r.error}</span>` : null}</li>`)}</ul>` : null}
1715
1759
  ${job && job.error ? html`<p class="feedback error">${job.error}</p>` : null}
@@ -11,6 +11,7 @@ import { appStore } from "/assets/app-store.js";
11
11
  import { t } from "/assets/app-i18n.js";
12
12
  import { toast } from "/assets/ui-toast.js";
13
13
  import "./settings-strings.js";
14
+ import "./settings-default-model-strings.js";
14
15
  import { api, confirmedWrite, newKey, selfConfirmed } from "./settings-confirm.js";
15
16
 
16
17
  /**
@@ -33,7 +34,7 @@ function view() {
33
34
  return {
34
35
  id: op.id, phase: op.phase, error: op.error, job: op.job, lostJob: op.lostJob, restart: op.restart,
35
36
  // stageKey: which staged change a step is (#2367 review: the panel tells that change's section how it went).
36
- steps: op.steps.map(({ label, impact, status, error, pendingId, note, stageKey }) => ({ label, impact, status, error: error || null, pendingId: pendingId || null, ...(note ? { note } : {}), ...(stageKey ? { stageKey } : {}) })),
37
+ steps: op.steps.map(({ label, impact, status, error, pendingId, note, stageKey, sharedDefaults, notes }) => ({ label, impact, status, error: error || null, pendingId: pendingId || null, ...(note ? { note } : {}), ...(sharedDefaults ? { sharedDefaults } : {}), ...(notes?.length ? { notes } : {}), ...(stageKey ? { stageKey } : {}) })),
37
38
  leftover: op.leftover,
38
39
  };
39
40
  }
@@ -105,6 +106,7 @@ async function run(o) {
105
106
  stop(o, step);
106
107
  return;
107
108
  }
109
+ if (step.sharedDefaults === "restart") step.sharedDefaultsConsent = res.body?.shared_defaults_consent;
108
110
  step.status = "done"; publish();
109
111
  }
110
112
  if (!mine(o)) return;
@@ -162,7 +164,7 @@ function stop(o, failed) {
162
164
  // What did not land can be staged again, except a secret, which has to be entered again. A write whose outcome is
163
165
  // unknown goes back with its key; one the server refused, or that never ran, gets a new key when it is applied.
164
166
  o.leftover = o.steps.filter((s) => (s.status === "failed" || s.status === "skipped") && s.request && !s.request.sensitive)
165
- .map(({ label, impact, request, stageKey, key, ambiguous }) => ({ label, impact, request, stageKey, ...(ambiguous ? { key } : {}) }));
167
+ .map(({ label, impact, request, stageKey, key, ambiguous, sharedDefaults }) => ({ label, impact, request, stageKey, sharedDefaults, ...(ambiguous ? { key } : {}) }));
166
168
  publish();
167
169
  }
168
170
 
@@ -171,7 +173,10 @@ async function postApply(o) {
171
173
  let res;
172
174
  try {
173
175
  res = await api("/api/settings/apply", { method: "POST", headers: { "Idempotency-Key": o.applyKey },
174
- body: JSON.stringify({ idempotency_key: o.applyKey }) });
176
+ body: JSON.stringify({ idempotency_key: o.applyKey,
177
+ ...(o.steps.some(s => s.sharedDefaults) ? { shared_defaults: o.steps.some(s => s.sharedDefaults === "restart") ? "restart" : "next-start",
178
+ shared_defaults_consent: o.steps.find(s => s.sharedDefaults === "restart")?.sharedDefaultsConsent,
179
+ shared_defaults_targets: [...new Set(o.steps.filter(s => s.sharedDefaults === "restart").flatMap(s => s.sharedDefaultsTargets || []).map(t => t.name))] } : {}) }) });
175
180
  } catch {
176
181
  // The answer was lost (a phone between networks): the same key rejoins the same job, never a second one.
177
182
  if (!mine(o)) return null;