@songsid/agend 2.4.0-beta.24 → 2.4.0-beta.26

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 (488) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/dist/agend-home.js +5 -5
  4. package/dist/agend-home.js.map +1 -1
  5. package/dist/agent-endpoint.js +10 -0
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/agent-file-read.js +1 -1
  8. package/dist/agent-file-read.js.map +1 -1
  9. package/dist/agent-workspace.d.ts +18 -2
  10. package/dist/agent-workspace.js +15 -4
  11. package/dist/agent-workspace.js.map +1 -1
  12. package/dist/auth-api.js +3 -1
  13. package/dist/auth-api.js.map +1 -1
  14. package/dist/backend/antigravity.js +8 -6
  15. package/dist/backend/antigravity.js.map +1 -1
  16. package/dist/backend/claude-code.js +17 -0
  17. package/dist/backend/claude-code.js.map +1 -1
  18. package/dist/backend/claude-usage-credits.d.ts +8 -0
  19. package/dist/backend/claude-usage-credits.js +121 -0
  20. package/dist/backend/claude-usage-credits.js.map +1 -0
  21. package/dist/backend/types.d.ts +30 -0
  22. package/dist/backend/types.js.map +1 -1
  23. package/dist/build-provenance.json +1 -1
  24. package/dist/channel/adapters/discord.js +7 -1
  25. package/dist/channel/adapters/discord.js.map +1 -1
  26. package/dist/channel/mcp-tools.js +1 -1
  27. package/dist/channel/mcp-tools.js.map +1 -1
  28. package/dist/channel/tool-router.js +1 -0
  29. package/dist/channel/tool-router.js.map +1 -1
  30. package/dist/cli-audited.js +9 -4
  31. package/dist/cli-audited.js.map +1 -1
  32. package/dist/cli.js +184 -21
  33. package/dist/cli.js.map +1 -1
  34. package/dist/config-validator.js +11 -1
  35. package/dist/config-validator.js.map +1 -1
  36. package/dist/config.js +2 -0
  37. package/dist/config.js.map +1 -1
  38. package/dist/contact-auth-store.d.ts +18 -0
  39. package/dist/contact-auth-store.js +55 -8
  40. package/dist/contact-auth-store.js.map +1 -1
  41. package/dist/contact-auth-types.d.ts +3 -0
  42. package/dist/contact-auth-types.js.map +1 -1
  43. package/dist/contact-change-proposals.d.ts +34 -0
  44. package/dist/contact-change-proposals.js +1 -1
  45. package/dist/contact-change-proposals.js.map +1 -1
  46. package/dist/cross-instance-notice.d.ts +1 -0
  47. package/dist/cross-instance-notice.js +9 -8
  48. package/dist/cross-instance-notice.js.map +1 -1
  49. package/dist/daemon.d.ts +35 -0
  50. package/dist/daemon.js +234 -19
  51. package/dist/daemon.js.map +1 -1
  52. package/dist/delivery-outbox.d.ts +42 -1
  53. package/dist/delivery-outbox.js +198 -21
  54. package/dist/delivery-outbox.js.map +1 -1
  55. package/dist/fleet-context.d.ts +8 -0
  56. package/dist/fleet-lock.d.ts +83 -2
  57. package/dist/fleet-lock.js +276 -2
  58. package/dist/fleet-lock.js.map +1 -1
  59. package/dist/fleet-manager.d.ts +183 -7
  60. package/dist/fleet-manager.js +1279 -78
  61. package/dist/fleet-manager.js.map +1 -1
  62. package/dist/fleet-windows-runtime.d.ts +20 -1
  63. package/dist/fleet-windows-runtime.js +98 -18
  64. package/dist/fleet-windows-runtime.js.map +1 -1
  65. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +13 -1
  66. package/dist/general-knowledge/skills/hub/SKILL.md +12 -1
  67. package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
  68. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +21 -4
  69. package/dist/home-update-lock.d.ts +35 -0
  70. package/dist/home-update-lock.js +81 -0
  71. package/dist/home-update-lock.js.map +1 -0
  72. package/dist/hub/client.js +7 -0
  73. package/dist/hub/client.js.map +1 -1
  74. package/dist/hub/compose/member.d.ts +5 -1
  75. package/dist/hub/compose/member.js +15 -6
  76. package/dist/hub/compose/member.js.map +1 -1
  77. package/dist/hub/compose/server.d.ts +1 -0
  78. package/dist/hub/compose/server.js +3 -2
  79. package/dist/hub/compose/server.js.map +1 -1
  80. package/dist/hub/http/compose.js +3 -2
  81. package/dist/hub/http/compose.js.map +1 -1
  82. package/dist/hub/http/deps.d.ts +1 -0
  83. package/dist/hub/member/room-ask.d.ts +12 -8
  84. package/dist/hub/member/room-ask.js +95 -29
  85. package/dist/hub/member/room-ask.js.map +1 -1
  86. package/dist/hub/member/room-mention-feedback.d.ts +2 -0
  87. package/dist/hub/member/room-mention-feedback.js +1 -1
  88. package/dist/hub/member/room-mention-feedback.js.map +1 -1
  89. package/dist/hub/member/room-post-answers.d.ts +2 -0
  90. package/dist/hub/member/room-post-answers.js +1 -1
  91. package/dist/hub/member/room-post-answers.js.map +1 -1
  92. package/dist/hub/member/room-post.d.ts +5 -0
  93. package/dist/hub/member/room-post.js +4 -1
  94. package/dist/hub/member/room-post.js.map +1 -1
  95. package/dist/hub/member/room-reaction-acks.d.ts +12 -0
  96. package/dist/hub/member/room-reaction-acks.js +44 -0
  97. package/dist/hub/member/room-reaction-acks.js.map +1 -0
  98. package/dist/hub/member/updates.d.ts +7 -1
  99. package/dist/hub/member/updates.js +7 -1
  100. package/dist/hub/member/updates.js.map +1 -1
  101. package/dist/hub/protocol.d.ts +4 -0
  102. package/dist/hub/protocol.js +2 -2
  103. package/dist/hub/protocol.js.map +1 -1
  104. package/dist/hub/representative.d.ts +7 -0
  105. package/dist/hub/representative.js +38 -5
  106. package/dist/hub/representative.js.map +1 -1
  107. package/dist/hub/roles/audit-details.d.ts +2 -0
  108. package/dist/hub/roles/audit-details.js +1 -1
  109. package/dist/hub/roles/audit-details.js.map +1 -1
  110. package/dist/hub/roles/authority.d.ts +8 -3
  111. package/dist/hub/roles/authority.js +144 -102
  112. package/dist/hub/roles/authority.js.map +1 -1
  113. package/dist/hub/roles/delegation.js +2 -2
  114. package/dist/hub/roles/delegation.js.map +1 -1
  115. package/dist/hub/roles/model.d.ts +5 -2
  116. package/dist/hub/roles/model.js +5 -4
  117. package/dist/hub/roles/model.js.map +1 -1
  118. package/dist/hub/roles/review.js +2 -2
  119. package/dist/hub/roles/review.js.map +1 -1
  120. package/dist/hub/room-react-ack-model.d.ts +2 -0
  121. package/dist/hub/room-react-ack-model.js +3 -0
  122. package/dist/hub/room-react-ack-model.js.map +1 -0
  123. package/dist/hub/rooms/admin.d.ts +6 -0
  124. package/dist/hub/rooms/admin.js +33 -0
  125. package/dist/hub/rooms/admin.js.map +1 -1
  126. package/dist/hub/rooms/agents.d.ts +2 -0
  127. package/dist/hub/rooms/agents.js +44 -3
  128. package/dist/hub/rooms/agents.js.map +1 -1
  129. package/dist/hub/rooms/service.d.ts +5 -1
  130. package/dist/hub/rooms/service.js +76 -24
  131. package/dist/hub/rooms/service.js.map +1 -1
  132. package/dist/hub/rooms/types.d.ts +2 -0
  133. package/dist/hub/server.js +6 -1
  134. package/dist/hub/server.js.map +1 -1
  135. package/dist/hub/types.d.ts +2 -0
  136. package/dist/install-lock.d.ts +15 -1
  137. package/dist/install-lock.js +16 -8
  138. package/dist/install-lock.js.map +1 -1
  139. package/dist/install-ownership.d.ts +165 -0
  140. package/dist/install-ownership.js +404 -0
  141. package/dist/install-ownership.js.map +1 -0
  142. package/dist/instance-config-impact.js +2 -0
  143. package/dist/instance-config-impact.js.map +1 -1
  144. package/dist/instructions.d.ts +4 -0
  145. package/dist/instructions.js +4 -0
  146. package/dist/instructions.js.map +1 -1
  147. package/dist/local-pane-endpoint.d.ts +4 -1
  148. package/dist/local-pane-endpoint.js +12 -2
  149. package/dist/local-pane-endpoint.js.map +1 -1
  150. package/dist/locale.js +162 -6
  151. package/dist/locale.js.map +1 -1
  152. package/dist/native-agent-admission.d.ts +7 -0
  153. package/dist/native-agent-admission.js +46 -3
  154. package/dist/native-agent-admission.js.map +1 -1
  155. package/dist/native-mcp.d.ts +16 -1
  156. package/dist/native-mcp.js +38 -5
  157. package/dist/native-mcp.js.map +1 -1
  158. package/dist/native-pane-lifecycle.d.ts +9 -0
  159. package/dist/native-pane-lifecycle.js +23 -0
  160. package/dist/native-pane-lifecycle.js.map +1 -1
  161. package/dist/native-pane-manager.d.ts +19 -6
  162. package/dist/native-pane-manager.js +79 -4
  163. package/dist/native-pane-manager.js.map +1 -1
  164. package/dist/needs-you.d.ts +8 -0
  165. package/dist/needs-you.js +1 -0
  166. package/dist/needs-you.js.map +1 -1
  167. package/dist/outbound-handlers.d.ts +12 -0
  168. package/dist/outbound-handlers.js +30 -2
  169. package/dist/outbound-handlers.js.map +1 -1
  170. package/dist/package-preimage.js +4 -0
  171. package/dist/package-preimage.js.map +1 -1
  172. package/dist/pane-port.d.ts +1 -0
  173. package/dist/plist-args.d.ts +9 -0
  174. package/dist/plist-args.js +22 -0
  175. package/dist/plist-args.js.map +1 -0
  176. package/dist/public-preview.d.ts +4 -6
  177. package/dist/public-preview.js +5 -2
  178. package/dist/public-preview.js.map +1 -1
  179. package/dist/public-web-gateway.js +10 -3
  180. package/dist/public-web-gateway.js.map +1 -1
  181. package/dist/public-web-link.d.ts +13 -1
  182. package/dist/public-web-link.js +28 -1
  183. package/dist/public-web-link.js.map +1 -1
  184. package/dist/recover.cjs +2638 -0
  185. package/dist/remote-card-prompt.d.ts +6 -2
  186. package/dist/remote-card-prompt.js +12 -3
  187. package/dist/remote-card-prompt.js.map +1 -1
  188. package/dist/reply-draft.d.ts +12 -0
  189. package/dist/reply-draft.js +81 -0
  190. package/dist/reply-draft.js.map +1 -0
  191. package/dist/request-contact-api.d.ts +15 -0
  192. package/dist/request-contact-api.js +120 -0
  193. package/dist/request-contact-api.js.map +1 -0
  194. package/dist/request-contact-card.d.ts +36 -0
  195. package/dist/request-contact-card.js +206 -0
  196. package/dist/request-contact-card.js.map +1 -0
  197. package/dist/request-contact-gate.d.ts +79 -0
  198. package/dist/request-contact-gate.js +262 -0
  199. package/dist/request-contact-gate.js.map +1 -0
  200. package/dist/request-contact-native.d.ts +52 -0
  201. package/dist/request-contact-native.js +87 -0
  202. package/dist/request-contact-native.js.map +1 -0
  203. package/dist/request-contact-types.d.ts +86 -0
  204. package/dist/request-contact-types.js +7 -0
  205. package/dist/request-contact-types.js.map +1 -0
  206. package/dist/request-context-call-protocol.d.ts +12 -0
  207. package/dist/request-context-call-protocol.js +14 -0
  208. package/dist/request-context-call-protocol.js.map +1 -0
  209. package/dist/request-context-call.d.ts +22 -0
  210. package/dist/request-context-call.js +35 -0
  211. package/dist/request-context-call.js.map +1 -0
  212. package/dist/request-context-drain.d.ts +39 -0
  213. package/dist/request-context-drain.js +159 -0
  214. package/dist/request-context-drain.js.map +1 -0
  215. package/dist/request-context-fence.d.ts +28 -0
  216. package/dist/request-context-fence.js +58 -0
  217. package/dist/request-context-fence.js.map +1 -0
  218. package/dist/request-context-migration.d.ts +64 -0
  219. package/dist/request-context-migration.js +158 -0
  220. package/dist/request-context-migration.js.map +1 -0
  221. package/dist/request-context-pane.d.ts +25 -0
  222. package/dist/request-context-pane.js +48 -0
  223. package/dist/request-context-pane.js.map +1 -0
  224. package/dist/request-context-policy.d.ts +74 -0
  225. package/dist/request-context-policy.js +116 -0
  226. package/dist/request-context-policy.js.map +1 -0
  227. package/dist/request-context-recovery.d.ts +14 -0
  228. package/dist/request-context-recovery.js +56 -0
  229. package/dist/request-context-recovery.js.map +1 -0
  230. package/dist/request-context-relay.d.ts +19 -0
  231. package/dist/request-context-relay.js +63 -0
  232. package/dist/request-context-relay.js.map +1 -0
  233. package/dist/request-context-returns.d.ts +67 -0
  234. package/dist/request-context-returns.js +211 -0
  235. package/dist/request-context-returns.js.map +1 -0
  236. package/dist/request-context-store.d.ts +2 -1
  237. package/dist/request-context-store.js +8 -1
  238. package/dist/request-context-store.js.map +1 -1
  239. package/dist/request-context-turns.d.ts +99 -0
  240. package/dist/request-context-turns.js +215 -0
  241. package/dist/request-context-turns.js.map +1 -0
  242. package/dist/request-context-view.d.ts +33 -0
  243. package/dist/request-context-view.js +36 -0
  244. package/dist/request-context-view.js.map +1 -0
  245. package/dist/request-hub-context.d.ts +130 -0
  246. package/dist/request-hub-context.js +89 -0
  247. package/dist/request-hub-context.js.map +1 -0
  248. package/dist/request-hub-output.d.ts +11 -0
  249. package/dist/request-hub-output.js +21 -0
  250. package/dist/request-hub-output.js.map +1 -0
  251. package/dist/runtime-cli-install.js +13 -11
  252. package/dist/runtime-cli-install.js.map +1 -1
  253. package/dist/runtime-client.d.ts +2 -0
  254. package/dist/runtime-client.js +17 -4
  255. package/dist/runtime-client.js.map +1 -1
  256. package/dist/runtime-coordinator.d.ts +4 -1
  257. package/dist/runtime-coordinator.js +10 -3
  258. package/dist/runtime-coordinator.js.map +1 -1
  259. package/dist/runtime-pane-assets.d.ts +1 -1
  260. package/dist/runtime-pane-assets.js +1 -1
  261. package/dist/runtime-pane-assets.js.map +1 -1
  262. package/dist/runtime-pane-host.d.ts +3 -0
  263. package/dist/runtime-pane-host.js +39 -21
  264. package/dist/runtime-pane-host.js.map +1 -1
  265. package/dist/runtime-pane-link.d.ts +6 -2
  266. package/dist/runtime-pane-link.js +17 -4
  267. package/dist/runtime-pane-link.js.map +1 -1
  268. package/dist/runtime-pane-mcp-relay.d.ts +11 -1
  269. package/dist/runtime-pane-mcp-relay.js +69 -3
  270. package/dist/runtime-pane-mcp-relay.js.map +1 -1
  271. package/dist/runtime-pane-mcp.d.ts +28 -1
  272. package/dist/runtime-pane-mcp.js +92 -15
  273. package/dist/runtime-pane-mcp.js.map +1 -1
  274. package/dist/runtime-pane-port.d.ts +6 -0
  275. package/dist/runtime-pane-port.js +23 -4
  276. package/dist/runtime-pane-port.js.map +1 -1
  277. package/dist/runtime-pane-protocol.d.ts +4 -0
  278. package/dist/runtime-pane-protocol.js +11 -4
  279. package/dist/runtime-pane-protocol.js.map +1 -1
  280. package/dist/runtime-pane-service.d.ts +1 -0
  281. package/dist/runtime-pane-service.js +25 -9
  282. package/dist/runtime-pane-service.js.map +1 -1
  283. package/dist/runtime-pane-stdio-protocol.d.ts +4 -0
  284. package/dist/runtime-pane-stdio-protocol.js +12 -5
  285. package/dist/runtime-pane-stdio-protocol.js.map +1 -1
  286. package/dist/runtime-pane-stdio.js +5 -5
  287. package/dist/runtime-pane-stdio.js.map +1 -1
  288. package/dist/runtime-protocol.d.ts +3 -0
  289. package/dist/runtime-protocol.js.map +1 -1
  290. package/dist/scheduler/scheduler.d.ts +15 -0
  291. package/dist/scheduler/scheduler.js +45 -1
  292. package/dist/scheduler/scheduler.js.map +1 -1
  293. package/dist/scheduler/scheduler.test.js +17 -0
  294. package/dist/scheduler/scheduler.test.js.map +1 -1
  295. package/dist/scheduler/task-board.d.ts +4 -0
  296. package/dist/scheduler/task-board.js +6 -0
  297. package/dist/scheduler/task-board.js.map +1 -1
  298. package/dist/scheduler/types.d.ts +1 -1
  299. package/dist/service-activation.js +3 -13
  300. package/dist/service-activation.js.map +1 -1
  301. package/dist/service-lock.d.ts +28 -0
  302. package/dist/service-lock.js +85 -0
  303. package/dist/service-lock.js.map +1 -0
  304. package/dist/settings-api.d.ts +6 -0
  305. package/dist/settings-api.js +107 -0
  306. package/dist/settings-api.js.map +1 -1
  307. package/dist/settings-change.js +14 -1
  308. package/dist/settings-change.js.map +1 -1
  309. package/dist/settings-effect.js +11 -1
  310. package/dist/settings-effect.js.map +1 -1
  311. package/dist/state-lease.d.ts +24 -0
  312. package/dist/state-lease.js +103 -0
  313. package/dist/state-lease.js.map +1 -0
  314. package/dist/tmux-binary.js +1 -1
  315. package/dist/tmux-binary.js.map +1 -1
  316. package/dist/tool-receipt-output.d.ts +2 -0
  317. package/dist/topic-commands.js +21 -1
  318. package/dist/topic-commands.js.map +1 -1
  319. package/dist/transcript-monitor.js +3 -0
  320. package/dist/transcript-monitor.js.map +1 -1
  321. package/dist/tunnel/named-link-test.d.ts +27 -0
  322. package/dist/tunnel/named-link-test.js +41 -0
  323. package/dist/tunnel/named-link-test.js.map +1 -1
  324. package/dist/types.d.ts +7 -0
  325. package/dist/ui/chat-store.js +5 -4
  326. package/dist/ui/contact-auth-strings.js +7 -2
  327. package/dist/ui/contact-permissions.js +10 -2
  328. package/dist/ui/fleet-office-card.js +15 -2
  329. package/dist/ui/fleet-office-pack.d.ts +2 -2
  330. package/dist/ui/fleet-office-pack.js +25 -8
  331. package/dist/ui/fleet-office-skin.js +33 -9
  332. package/dist/ui/fleet-office-vehicles.js +28 -11
  333. package/dist/ui/fleet-office-zones.js +10 -5
  334. package/dist/ui/fleet-office.js +158 -20
  335. package/dist/ui/fleet-task-files.js +1 -1
  336. package/dist/ui/hub-admin-rooms-strings.js +6 -2
  337. package/dist/ui/hub-admin-rooms.js +3 -1
  338. package/dist/ui/hub-group-search.js +2 -2
  339. package/dist/ui/hub-notify-keep.js +49 -0
  340. package/dist/ui/hub-role-view.js +1 -1
  341. package/dist/ui/hub-roles-strings.js +14 -10
  342. package/dist/ui/hub-roles.js +1 -1
  343. package/dist/ui/hub-room-notify.js +2 -1
  344. package/dist/ui/hub-room-strings.js +3 -3
  345. package/dist/ui/hub-room-thread.js +9 -4
  346. package/dist/ui/panel-chat.js +15 -2
  347. package/dist/ui/panel-hub.js +3 -2
  348. package/dist/ui/panel-needs.js +35 -7
  349. package/dist/ui/panel-settings.js +22 -8
  350. package/dist/ui/settings-preview-address.js +156 -0
  351. package/dist/ui/settings-registry.js +2 -0
  352. package/dist/ui/settings-strings.js +6 -6
  353. package/dist/ui/settings-update.js +13 -0
  354. package/dist/ui/shared/app-install.js +123 -0
  355. package/dist/ui/shared/app-shell.js +4 -2
  356. package/dist/ui/shared/app-update.js +16 -2
  357. package/dist/ui/shared/app.css +119 -2
  358. package/dist/ui/shared/app.js +3 -0
  359. package/dist/ui/shared/chat-strings.js +6 -2
  360. package/dist/ui/shared/chat-thread.js +7 -1
  361. package/dist/ui/shared/hub-chat.css +6 -0
  362. package/dist/ui/shared/preview-panel.js +1 -1
  363. package/dist/ui/shared/preview.js +11 -2
  364. package/dist/ui/shared/tokens.css +18 -3
  365. package/dist/ui/shared/ui-confirm.js +7 -5
  366. package/dist/ui/shared/ui-icons.js +2 -0
  367. package/dist/ui/shared/update-card-ui.js +419 -0
  368. package/dist/ui/shared/workspace.css +7 -0
  369. package/dist/ui/usage-credits-card.js +84 -0
  370. package/dist/ui/workspace-ignored-strings.js +16 -0
  371. package/dist/ui/workspace-panel.js +15 -6
  372. package/dist/update-abandon.d.ts +26 -0
  373. package/dist/update-abandon.js +111 -0
  374. package/dist/update-abandon.js.map +1 -0
  375. package/dist/update-card.d.ts +193 -0
  376. package/dist/update-card.js +620 -0
  377. package/dist/update-card.js.map +1 -0
  378. package/dist/update-dispatch.d.ts +16 -1
  379. package/dist/update-dispatch.js +12 -4
  380. package/dist/update-dispatch.js.map +1 -1
  381. package/dist/update-forward.d.ts +59 -0
  382. package/dist/update-forward.js +227 -0
  383. package/dist/update-forward.js.map +1 -0
  384. package/dist/update-goback.d.ts +90 -0
  385. package/dist/update-goback.js +260 -0
  386. package/dist/update-goback.js.map +1 -0
  387. package/dist/update-idle.d.ts +1 -0
  388. package/dist/update-idle.js +12 -3
  389. package/dist/update-idle.js.map +1 -1
  390. package/dist/update-install.d.ts +2 -1
  391. package/dist/update-install.js +18 -10
  392. package/dist/update-install.js.map +1 -1
  393. package/dist/update-journal.d.ts +359 -0
  394. package/dist/update-journal.js +723 -0
  395. package/dist/update-journal.js.map +1 -0
  396. package/dist/update-launch.js +1 -1
  397. package/dist/update-launch.js.map +1 -1
  398. package/dist/update-npm-env.d.ts +45 -12
  399. package/dist/update-npm-env.js +48 -0
  400. package/dist/update-npm-env.js.map +1 -1
  401. package/dist/update-package-restore.d.ts +84 -0
  402. package/dist/update-package-restore.js +329 -0
  403. package/dist/update-package-restore.js.map +1 -0
  404. package/dist/update-quiescence.d.ts +221 -0
  405. package/dist/update-quiescence.js +370 -0
  406. package/dist/update-quiescence.js.map +1 -0
  407. package/dist/update-readiness-host.d.ts +61 -0
  408. package/dist/update-readiness-host.js +297 -0
  409. package/dist/update-readiness-host.js.map +1 -0
  410. package/dist/update-readiness.d.ts +83 -0
  411. package/dist/update-readiness.js +459 -0
  412. package/dist/update-readiness.js.map +1 -0
  413. package/dist/update-recovery/kit.d.ts +35 -0
  414. package/dist/update-recovery/kit.js +99 -0
  415. package/dist/update-recovery/kit.js.map +1 -0
  416. package/dist/update-recovery/pre-start.d.ts +34 -0
  417. package/dist/update-recovery/pre-start.js +103 -0
  418. package/dist/update-recovery/pre-start.js.map +1 -0
  419. package/dist/update-recovery/recover-main.d.ts +1 -0
  420. package/dist/update-recovery/recover-main.js +4 -0
  421. package/dist/update-recovery/recover-main.js.map +1 -0
  422. package/dist/update-recovery/recover.d.ts +22 -0
  423. package/dist/update-recovery/recover.js +134 -0
  424. package/dist/update-recovery/recover.js.map +1 -0
  425. package/dist/update-recovery/route.d.ts +53 -0
  426. package/dist/update-recovery/route.js +262 -0
  427. package/dist/update-recovery/route.js.map +1 -0
  428. package/dist/update-recovery/runner.d.ts +62 -0
  429. package/dist/update-recovery/runner.js +229 -0
  430. package/dist/update-recovery/runner.js.map +1 -0
  431. package/dist/update-recovery/service-manager.d.ts +39 -0
  432. package/dist/update-recovery/service-manager.js +57 -0
  433. package/dist/update-recovery/service-manager.js.map +1 -0
  434. package/dist/update-restore.d.ts +50 -0
  435. package/dist/update-restore.js +360 -0
  436. package/dist/update-restore.js.map +1 -0
  437. package/dist/update-retained.d.ts +65 -0
  438. package/dist/update-retained.js +116 -0
  439. package/dist/update-retained.js.map +1 -0
  440. package/dist/update-rollback.d.ts +74 -0
  441. package/dist/update-rollback.js +221 -0
  442. package/dist/update-rollback.js.map +1 -0
  443. package/dist/update-settings.d.ts +63 -0
  444. package/dist/update-settings.js +162 -0
  445. package/dist/update-settings.js.map +1 -0
  446. package/dist/update-snapshot-manifest.d.ts +32 -0
  447. package/dist/update-snapshot-manifest.js +65 -0
  448. package/dist/update-snapshot-manifest.js.map +1 -0
  449. package/dist/update-snapshot-scope.d.ts +67 -0
  450. package/dist/update-snapshot-scope.js +173 -0
  451. package/dist/update-snapshot-scope.js.map +1 -0
  452. package/dist/update-snapshot.d.ts +34 -0
  453. package/dist/update-snapshot.js +246 -0
  454. package/dist/update-snapshot.js.map +1 -0
  455. package/dist/update-writers.d.ts +71 -0
  456. package/dist/update-writers.js +235 -0
  457. package/dist/update-writers.js.map +1 -0
  458. package/dist/web-api.d.ts +3 -0
  459. package/dist/web-api.js +43 -8
  460. package/dist/web-api.js.map +1 -1
  461. package/dist/web-chat-history.d.ts +7 -0
  462. package/dist/web-chat-history.js +15 -0
  463. package/dist/web-chat-history.js.map +1 -1
  464. package/dist/web-icons.d.ts +11 -0
  465. package/dist/web-icons.js +14 -2
  466. package/dist/web-icons.js.map +1 -1
  467. package/dist/web-mentions.d.ts +27 -8
  468. package/dist/web-mentions.js +108 -1
  469. package/dist/web-mentions.js.map +1 -1
  470. package/dist/web-office-acts.js +3 -0
  471. package/dist/web-office-acts.js.map +1 -1
  472. package/dist/web-preview.d.ts +5 -0
  473. package/dist/web-preview.js +1 -1
  474. package/dist/web-preview.js.map +1 -1
  475. package/dist/web-update.d.ts +6 -0
  476. package/dist/windows-agents.d.ts +12 -0
  477. package/dist/windows-agents.js +5 -0
  478. package/dist/windows-agents.js.map +1 -1
  479. package/launcher/agend +4 -1
  480. package/launcher/agend-agent +4 -1
  481. package/launcher/agend-install.cjs +16 -8
  482. package/launcher/install-admission.d.cts +8 -0
  483. package/launcher/npm-allow-scripts.cjs +72 -0
  484. package/launcher/npm-global-prefix.cjs +81 -0
  485. package/launcher/postinstall.cjs +9 -8
  486. package/launcher/runtime-select.cjs +8 -2
  487. package/package.json +4 -3
  488. package/scripts/preinstall-guard.cjs +1 -1
@@ -30,12 +30,15 @@
30
30
  var BANNER_ACK_KEY = "agend_html_preview_banner_ack";
31
31
  var BANNER = "Previews run the agent's HTML in an isolated frame. It cannot use your login, but it may be able to send data out. Only preview content you trust. A preview can slow or freeze this tab.";
32
32
 
33
+ /** M-3814: Settings → Access → Sharing, at the fixed address's fields (its preview address is set up just below them). */
34
+ var FIX_HREF = "/settings/access#publicFixedAddress";
33
35
  var cfg = { dashboardOrigin: "", previewOrigin: "", boot: "", reason: "", reasonCode: "", detail: "" };
34
36
  // Why it failed, in English when the app's dictionary has no word for it (chat-strings.js pvFail_*).
35
37
  var FAIL_EN = { exited: "its address closed unexpectedly", "spawn-failed": "cloudflared could not start for it", "no-address": "no address was given for it",
36
38
  unreachable: "its address could not be reached", "lease-held": "an earlier preview tunnel is still being cleaned up", "gateway-failed": "its local listener could not start",
37
39
  // #1767: what cloudflared's exit before an address really was.
38
- "rate-limited": "Cloudflare is limiting new temporary links from this machine — try again in a while",
40
+ // M-3814: the card's Download (or the file's link) still opens it; the notice also links to the fixed preview address.
41
+ "rate-limited": "Cloudflare is limiting new temporary links from this machine — try again in a while, or download the file to open it",
39
42
  "provisioning-failed": "Cloudflare refused to create its address right now", "process-exited": "cloudflared stopped before it gave an address",
40
43
  "bad-address": "Cloudflare gave an address that could not be used" };
41
44
  // #1554: the page's words. `say(key, english, …values)` asks the app's dictionary (init's opts.text) and keeps the
@@ -53,6 +56,8 @@
53
56
  var live = new Map(); // cardKey → { key, iframe, ch, holder, state, … } (at most one: one running preview per page)
54
57
  var listening = false;
55
58
 
59
+ /** A guest's page (the server marks <body data-tier="guest">): Settings is not theirs, so no link there. */
60
+ function guestPage() { try { return root.document.body.getAttribute("data-tier") === "guest"; } catch (e) { return false; } }
56
61
  function now() { return root.performance && typeof root.performance.now === "function" ? root.performance.now() : Date.now(); }
57
62
  function store(kind) { try { return root[kind] || null; } catch (e) { return null; } }
58
63
  function utf8Bytes(s) { try { return new root.TextEncoder().encode(s).length; } catch (e) { return String(s).length * 3; } }
@@ -200,7 +205,11 @@
200
205
  var english = cfg.reasonCode === "publicLinkPreviewFailed" ? "Previews are unavailable on this public link: {0}. The link itself keeps working."
201
206
  : cfg.reason || "Previews are not available here.";
202
207
  var server = cfg.reasonCode ? say("pvServer_" + cfg.reasonCode, english, arg) : "";
203
- return { ok: false, why: "server", reason: server || cfg.reason || say("pvWhyServer", "Previews are not available here.") };
208
+ var out = { ok: false, why: "server", reason: server || cfg.reason || say("pvWhyServer", "Previews are not available here.") };
209
+ // M-3814 (the user's decision): Cloudflare's limit on temporary links (429) — a link to Settings → Access, the
210
+ // fixed address's section, where a fixed preview address (no temporary link at all) is set up.
211
+ if (cfg.reasonCode === "publicLinkPreviewFailed" && cfg.detail === "rate-limited" && !guestPage()) out.fix = { href: FIX_HREF, label: say("pvFixAddress", "Set up a fixed preview address") };
212
+ return out;
204
213
  }
205
214
  var at = root.location && root.location.origin;
206
215
  if (!cfg.dashboardOrigin || at !== cfg.dashboardOrigin) {
@@ -16,7 +16,14 @@
16
16
  * Emoji (#1918 follow-up, the user's tofu boxes): every stack ends with the platforms' colour emoji fonts and the
17
17
  * `emoji` generic (--font-emoji), so an emoji the text fonts lack is drawn by Windows' Segoe UI Emoji, macOS's Apple
18
18
  * Color Emoji or Linux's Noto Color Emoji rather than as a box — for the stock stacks and each theme font
19
- * (app.css: .th-font-system, .th-font-mono). A browser tries the families in order for each character. */
19
+ * (app.css: .th-font-system, .th-font-mono). A browser tries the families in order for each character.
20
+ *
21
+ * M-3796 (the user's grey 🆕 on Win11 Edge): a text font earlier in a stack can carry its own black-and-white glyph for an
22
+ * emoji, and the browser takes it — on Windows, Noto Sans TC draws 🆕 🆗 🆓 🈶, and the font named Menlo there draws ☕ ⚡ ♈.
23
+ * So each stack starts with "AgEnD Emoji": the platform's colour emoji font (local(), nothing downloaded), for emoji
24
+ * only (unicode-range: the emoji planes, the emoji-by-default symbols of the BMP, and the joiners that build sequences).
25
+ * Text keeps its fonts — digits, #, *, ©, ™, ★, ♥, arrows and CJK are outside the range — and a text-style request
26
+ * (U+FE0E) still gets the text glyph. A machine without any of the three fonts skips the face. */
20
27
 
21
28
  @font-face {
22
29
  font-family: "Inter";
@@ -27,11 +34,19 @@
27
34
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
28
35
  }
29
36
 
37
+ @font-face {
38
+ font-family: "AgEnD Emoji";
39
+ src: local("Segoe UI Emoji"), local("SegoeUIEmoji"), local("Apple Color Emoji"), local("AppleColorEmoji"), local("Noto Color Emoji"), local("NotoColorEmoji");
40
+ unicode-range: U+1F000-1FAFF, U+200D, U+FE0F, U+20E3, U+231A-231B, U+23E9-23EC, U+23F0, U+23F3, U+25FD-25FE, U+2614-2615, U+2648-2653, U+267F,
41
+ U+2693, U+26A1, U+26AA-26AB, U+26BD-26BE, U+26C4-26C5, U+26CE, U+26D4, U+26EA, U+26F2-26F3, U+26F5, U+26FA, U+26FD, U+2705, U+270A-270B,
42
+ U+2728, U+274C, U+274E, U+2753-2755, U+2757, U+2795-2797, U+27B0, U+27BF, U+2B1B-2B1C, U+2B50, U+2B55;
43
+ }
44
+
30
45
  :root {
31
46
  /* ── Type ── */
32
47
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", emoji;
33
- --font-ui: Inter, "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Noto Sans CJK TC", "Noto Sans CJK SC", "Microsoft JhengHei", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, var(--font-emoji);
34
- --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace, var(--font-emoji);
48
+ --font-ui: "AgEnD Emoji", Inter, "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Noto Sans CJK TC", "Noto Sans CJK SC", "Microsoft JhengHei", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, var(--font-emoji);
49
+ --font-mono: "AgEnD Emoji", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace, var(--font-emoji);
35
50
  /* M-3216: the two small sizes come from a base the phone layout raises one step; the text-size scopes in app.css
36
51
  (the chat, Details, Fleet, Log, the drawer's agents) scale the same base, so they follow it too. */
37
52
  --fs-3xs-base: 10px; /* M-3226: the two smallest steps (chart labels, badges, counts); font size only */
@@ -6,7 +6,7 @@ import { createStore, useStore } from "./app-store.js";
6
6
  import { Dialog } from "./ui-dialog.js";
7
7
  import { t } from "./app-i18n.js";
8
8
 
9
- /** Pending questions, oldest first: { id, title, message, confirmLabel, danger, resolve }. */
9
+ /** Pending questions, oldest first: { id, title, message, confirmLabel, danger, more, even, resolve }. */
10
10
  export const confirmStore = createStore({ queue: [] });
11
11
  let seq = 0;
12
12
 
@@ -14,11 +14,12 @@ let seq = 0;
14
14
  * Ask. Resolves true for the confirm button, false for Cancel, Esc, the backdrop or ×.
15
15
  * `message` may hold blank lines (paragraphs); it is shown as text.
16
16
  */
17
- export function confirmDialog({ title, message, confirmLabel, danger = false, more = null } = {}) {
17
+ /** S-255: `notice` — words to read, not a question: one button, no Cancel (Esc, the backdrop and × still close it). */
18
+ export function confirmDialog({ title, message, confirmLabel, danger = false, more = null, even = false, notice = false } = {}) {
18
19
  return new Promise((resolve) => {
19
20
  // M-3387: `more` { label, lines } — a list closed under the text until opened (e.g. every tool name a switch stops).
20
21
  const extra = more && more.label && Array.isArray(more.lines) && more.lines.length ? { label: String(more.label), lines: more.lines.map(String) } : null;
21
- const item = { id: ++seq, title: title || t("app.confirmTitle"), message: String(message || ""), confirmLabel: confirmLabel || t("app.confirmOk"), danger, more: extra, resolve };
22
+ const item = { id: ++seq, title: title || t("app.confirmTitle"), message: String(message || ""), confirmLabel: confirmLabel || t("app.confirmOk"), danger, more: extra, even: !!even, notice: !!notice, resolve };
22
23
  confirmStore.set((s) => ({ queue: [...s.queue, item] }));
23
24
  });
24
25
  }
@@ -37,8 +38,9 @@ export function ConfirmHost() {
37
38
  const q = queue[0];
38
39
  if (!q) return null;
39
40
  const paragraphs = q.message.split(/\n{2,}/);
40
- return html`<${Dialog} key=${q.id} title=${q.title} onClose=${() => answerConfirm(q.id, false)}
41
- actions=${html`<button type="button" class="btn" onClick=${() => answerConfirm(q.id, false)}>${t("app.cancel")}</button>
41
+ // `even`: the two buttons share the row's width on every screen (as a phone's bottom sheet always does).
42
+ return html`<${Dialog} key=${q.id} title=${q.title} cls=${q.even ? "dlg-even" : ""} onClose=${() => answerConfirm(q.id, false)}
43
+ actions=${html`${q.notice ? null : html`<button type="button" class="btn" onClick=${() => answerConfirm(q.id, false)}>${t("app.cancel")}</button>`}
42
44
  <button type="button" class=${`btn ${q.danger ? "btn-danger" : "btn-primary"}`} data-confirm="yes" onClick=${() => answerConfirm(q.id, true)}>${q.confirmLabel}</button>`}>
43
45
  ${paragraphs.map((p, i) => html`<p key=${i} class="confirm-text">${p}</p>`)}
44
46
  ${q.more ? html`<details class="confirm-more"><summary>${q.more.label}</summary><ul>${q.more.lines.map((l, i) => html`<li key=${i} class="mono">${l}</li>`)}</ul></details>` : null}
@@ -56,6 +56,8 @@ const P = {
56
56
  key: () => html`<circle cx="7.5" cy="15.5" r="4.5"/><path d="M10.7 12.3L21 2M17 6l3 3M14 9l2 2"/>`,
57
57
  pause: () => html`<path d="M8 5v14M16 5v14"/>`,
58
58
  download: () => html`<path d="M12 3v12M7 10l5 5 5-5M5 21h14"/>`,
59
+ // S-255: install as an app — a screen with an arrow down into it (not a plain download).
60
+ install: () => html`<rect x="3" y="3" width="18" height="13" rx="2"/><path d="M12 6.5v6M9 9.5l3 3 3-3M8 21h8M12 16v5"/>`,
59
61
  org: () => html`<rect x="9" y="2" width="6" height="5" rx="1"/><rect x="2" y="17" width="6" height="5" rx="1"/><rect x="16" y="17" width="6" height="5" rx="1"/><path d="M12 7v5M5 17v-5h14v5"/>`,
60
62
  panel: () => html`<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M14 4v16"/>`,
61
63
  back: () => html`<path d="M19 12H5M12 19l-7-7 7-7"/>`,
@@ -0,0 +1,419 @@
1
+ // M-3770 slice 1.4 (design #4480 §3.1, §3.2, §4.1, §6): the one update card on the web — its line on the banner, its
2
+ // answers (Update when idle, Pick a time, Not now, Update now, Cancel), the pre-flight result ("Updates on this
3
+ // machine"), and Settings → Version and update's controls (when not to update; Advanced: pin, longest wait). A module of
4
+ // its own (the module-skew rule): app-update.js and settings-update.js import it; an older cached copy of either simply
5
+ // does not show the card (it never meets a missing export). The server's words: GET /ui/update's `card` and `preflight`
6
+ // (S-234 / S-235 / S-236), POST /ui/update/answer, PUT /api/settings/fleet/updates.
7
+ import { html, useEffect, useState } from "./app-html.js";
8
+ import { register, t } from "./app-i18n.js";
9
+ import { confirmDialog } from "./ui-confirm.js";
10
+ import { Dialog } from "./ui-dialog.js";
11
+ import { toast } from "./ui-toast.js";
12
+ import { dateTimeText } from "./clock-text.js";
13
+
14
+ register("updatecard", {
15
+ en: {
16
+ ready: "AgEnD {0} is ready.",
17
+ continues: "Your work continues.",
18
+ backPhase1: "Your work continues; if the new version won't start, AgEnD tries to roll back to {0}.",
19
+ noWayBack: "Your work continues; this setup can't restart AgEnD by itself, so check on it afterwards.",
20
+ howTo: "How to update", pressOnlyLine: "AgEnD can't update itself on this machine; update it by hand.", sep: ", ", more: " and {0} more",
21
+ whenIdle: "Update when idle", pickTime: "Pick a time", notNow: "Not now", updateNow: "Update now", cancel: "Cancel",
22
+ waiting: "Updating to {0} as soon as your agents are idle.", waitingFor: "Waiting for: {0}", waitingSince: "Waiting since {0}",
23
+ scheduled: "Updating to {0} at {1}, when your agents are idle.", notNowUntil: "You chose Not now. The card comes back on {0}.",
24
+ starting: "Starting the update to {0}…", cantTitle: "AgEnD can't update itself on this machine.",
25
+ nowTitle: "Update now?", nowBody: "{0} agents are working. They stop for a few minutes while AgEnD restarts, then pick up where they were.",
26
+ nowBodyIdle: "AgEnD restarts for a few minutes; your agents pick up where they were.", nowGo: "Update now",
27
+ pickTitle: "When should AgEnD update?", pickTonight: "Tonight", pickMorning: "Tomorrow morning", pickOther: "Another time", pickDay: "Day", pickAt: "Time",
28
+ pickHint: "It still waits until your agents are idle at that time. Within the next 7 days.", pickGo: "Schedule", pickBad: "Pick a time in the next 7 days.",
29
+ changed: "The update changed while you were looking. Here it is again.", running: "An update is already running.",
30
+ failedAnswer: "That didn't work: {0}",
31
+ machine: "Updates on this machine", self: "AgEnD can update itself here.", adminOnly: "Updates here need you:",
32
+ stop: "AgEnD can't update here until this is fixed.", notChecked: "not checked yet", checking: "Not checked yet: it's checked when AgEnD starts and once a day.",
33
+ pauseTitle: "Don't update during", pauseHint: "Days and hours when AgEnD never updates (a waiting update waits for the window to end).",
34
+ pauseAdd: "Add a time", pauseRemove: "Remove", from: "From", to: "To", save: "Save", saved: "Saved.", saveFailed: "Couldn't save: {0}",
35
+ settingsLabel: "When AgEnD updates", pending: "Waiting for confirmation: this lets updates go ahead sooner.", applied: "Confirmed and saved.",
36
+ advanced: "Advanced", pin: "Pin to a version", pinHint: "No update is offered while a version is pinned. Leave empty for none.",
37
+ maxWait: "Longest wait for idle (hours)", maxWaitHint: "After this, AgEnD asks again instead of waiting (1–168, default 24).",
38
+ days: "Sun,Mon,Tue,Wed,Thu,Fri,Sat",
39
+ c_checkout: "AgEnD runs from a source checkout, not from an install npm updates. Update it with git.",
40
+ c_other_copy: "Another copy of AgEnD ({path}) is the one npm would update, not the one running. Run the fleet from the global install.",
41
+ c_path_shadow: "Another agend on the PATH ({path}) would run instead of this one. Remove it or fix the PATH.",
42
+ c_unreadable: "AgEnD can't read where it's installed right now. Try again in a minute.",
43
+ c_shared_home: "Another AgEnD install uses the same home folder. Give each its own home, or remove one.",
44
+ c_unknown_owner: "AgEnD can't prove which install runs this fleet. Restart it as a service and check again.",
45
+ c_other_install: "Another AgEnD install lives under this user. Updating one could affect the other.",
46
+ c_not_service: "AgEnD isn't running as a service, so it can't bring itself back after an update.",
47
+ c_service_unknown: "AgEnD can't confirm that its service will bring it back after an update.",
48
+ notAllChecked: "Some checks haven't run yet; they run when AgEnD starts and once a day.",
49
+ c_linger_off: "AgEnD stops when the user {user} signs out, so it can't restart itself. To fix it, run `sudo loginctl enable-linger {user}`.",
50
+ c_system_unit_not_root: "AgEnD runs as a system service; updating it needs root.",
51
+ c_unit_reload_pending: "The service definition changed and hasn't been reloaded. Run `systemctl --user daemon-reload`.",
52
+ c_no_write: "Updating needs write access to {path}. Run `sudo agend update` in a terminal on that computer, or reinstall with the one-line installer.",
53
+ c_linked: "This AgEnD is linked from a development folder ({path}); an update replaces the link.",
54
+ c_vendored: "This AgEnD sits inside another project ({path}).",
55
+ c_low_disk: "Updating needs about {need} free on {path}; there's {have}.",
56
+ c_npm_unreachable: "The update source can't be reached from this machine (network or proxy).",
57
+ c_rehearsal: "A rehearsal or test is running here; updates wait until it ends.",
58
+ c_update_running: "An update is already running.",
59
+ c_container: "AgEnD runs in a container; update the image.",
60
+ c_windows_runtime: "This computer's AgEnD Runtime updates itself.",
61
+ c_node_too_old: "AgEnD {0} needs Node {needs}; this machine has {node}.",
62
+ c_other: "A check didn't pass ({0}).",
63
+ },
64
+ "zh-TW": {
65
+ ready: "AgEnD {0} 可以更新了。",
66
+ continues: "工作不會中斷。",
67
+ backPhase1: "工作不會中斷;新版起不來時,AgEnD 會嘗試退回 {0}。",
68
+ noWayBack: "工作不會中斷;這台機器無法自行重新啟動 AgEnD,更新後請確認一下。",
69
+ howTo: "如何更新", pressOnlyLine: "這台機器上 AgEnD 無法自行更新,請手動更新。", sep: "、", more: ",另有 {0} 個",
70
+ whenIdle: "閒置時更新", pickTime: "選個時間", notNow: "先不要", updateNow: "立即更新", cancel: "取消",
71
+ waiting: "Agent 一閒置就更新到 {0}。", waitingFor: "正在等:{0}", waitingSince: "從 {0} 開始等",
72
+ scheduled: "排定在 {1},等 Agent 閒置後更新到 {0}。", notNowUntil: "你選了「先不要」,{0} 會再提醒。",
73
+ starting: "正在開始更新到 {0}…", cantTitle: "AgEnD 無法在這台機器上自行更新。",
74
+ nowTitle: "立即更新?", nowBody: "有 {0} 個 Agent 正在工作。AgEnD 重新啟動時會停下幾分鐘,之後從原處繼續。",
75
+ nowBodyIdle: "AgEnD 會重新啟動幾分鐘,Agent 之後從原處繼續。", nowGo: "立即更新",
76
+ pickTitle: "要在什麼時候更新?", pickTonight: "今晚", pickMorning: "明天早上", pickOther: "其他時間", pickDay: "日期", pickAt: "時間",
77
+ pickHint: "到了那個時間,仍會等 Agent 閒置才開始。可排定在未來 7 天內。", pickGo: "排定", pickBad: "請選擇未來 7 天內的時間。",
78
+ changed: "這個更新剛剛有變動,以下是最新狀態。", running: "已經有一個更新在進行中。",
79
+ failedAnswer: "沒有成功:{0}",
80
+ machine: "這台機器的更新", self: "AgEnD 可以在這裡自行更新。", adminOnly: "這裡的更新需要你來進行:",
81
+ stop: "這個問題解決前,AgEnD 無法在這裡更新。", notChecked: "尚未檢查", checking: "尚未檢查:AgEnD 啟動時和每天會檢查一次。",
82
+ pauseTitle: "這些時段不更新", pauseHint: "AgEnD 絕不會在這些日子和時段更新(等待中的更新會等時段結束)。",
83
+ pauseAdd: "新增時段", pauseRemove: "移除", from: "從", to: "到", save: "儲存", saved: "已儲存。", saveFailed: "無法儲存:{0}",
84
+ settingsLabel: "AgEnD 何時更新", pending: "等待確認中:這項變更會讓更新提早進行。", applied: "已確認並儲存。",
85
+ advanced: "進階", pin: "固定在某個版本", pinHint: "固定版本時不會提供任何更新。留空表示不固定。",
86
+ maxWait: "等 Agent 閒下來的上限(小時)", maxWaitHint: "超過之後,AgEnD 會再問你,而不是繼續等(1–168,預設 24)。",
87
+ days: "日,一,二,三,四,五,六",
88
+ c_checkout: "AgEnD 是從原始碼資料夾執行的,不是 npm 會更新的安裝。請用 git 更新。",
89
+ c_other_copy: "npm 會更新的是另一份 AgEnD({path}),不是正在執行的這份。請改用全域安裝執行 Fleet。",
90
+ c_path_shadow: "PATH 上的另一個 agend({path})會被優先執行。請移除它或修正 PATH。",
91
+ c_unreadable: "AgEnD 目前讀不到自己的安裝位置,請稍後再試。",
92
+ c_shared_home: "另一份 AgEnD 使用同一個 home 資料夾。請讓每份各用自己的 home,或移除其中一份。",
93
+ c_unknown_owner: "AgEnD 無法確認是哪一份安裝在執行這個 Fleet。請以服務方式重新啟動後再檢查。",
94
+ c_other_install: "這個使用者底下還有另一份 AgEnD。更新其中一份可能影響另一份。",
95
+ c_not_service: "AgEnD 不是以服務方式執行,更新後無法自己回來。",
96
+ c_service_unknown: "AgEnD 無法確認它的服務在更新後會讓它重新啟動。",
97
+ notAllChecked: "有些檢查還沒跑完;AgEnD 啟動時和每天會檢查一次。",
98
+ c_linger_off: "使用者 {user} 登出後 AgEnD 會停止,所以無法自行重新啟動。修正方式:執行 `sudo loginctl enable-linger {user}`。",
99
+ c_system_unit_not_root: "AgEnD 以系統服務執行,更新需要 root。",
100
+ c_unit_reload_pending: "服務定義已變更但尚未重新載入。請執行 `systemctl --user daemon-reload`。",
101
+ c_no_write: "更新需要 {path} 的寫入權限。請在那台電腦的終端機執行 `sudo agend update`,或用單行安裝指令重新安裝。",
102
+ c_linked: "這份 AgEnD 是從開發資料夾連結的({path}),更新會取代這個連結。",
103
+ c_vendored: "這份 AgEnD 位於另一個專案裡({path})。",
104
+ c_low_disk: "更新需要 {path} 約 {need} 的可用空間,目前只有 {have}。",
105
+ c_npm_unreachable: "這台機器連不到更新來源(網路或 Proxy 設定)。",
106
+ c_rehearsal: "這裡正在進行演練或測試,更新會等它結束。",
107
+ c_update_running: "已經有一個更新在進行中。",
108
+ c_container: "AgEnD 在容器裡執行,請更新映像檔。",
109
+ c_windows_runtime: "這台電腦的 AgEnD Runtime 會自行更新。",
110
+ c_node_too_old: "AgEnD {0} 需要 Node {needs},這台機器是 {node}。",
111
+ c_other: "有一項檢查沒有通過({0})。",
112
+ },
113
+ });
114
+ const tc = (key, ...a) => t(`updatecard.${key}`, ...a);
115
+
116
+ /** A pre-flight check's sentence: its code's words with the detail filled in (never raw error text). */
117
+ export function checkSentence(check, version = "") {
118
+ if (!check || !check.code) return "";
119
+ const key = `c_${String(check.code).replace(/-/g, "_")}`;
120
+ let s = t(`updatecard.${key}`, version);
121
+ if (s === `updatecard.${key}`) return tc("c_other", String(check.code));
122
+ const d = check.detail && typeof check.detail === "object" ? check.detail : {};
123
+ return s.replace(/\{(path|user|need|have|node|needs)\}/g, (_, k) => (d[k] !== undefined ? String(d[k]).replace(/`/g, "'") : "…"));
124
+ }
125
+ /** A check's sentence as plain text (a toast): the command marks dropped. */
126
+ export function checkText(check, version = "") { return checkSentence(check, version).replace(/`/g, ""); }
127
+ /** A check's sentence for the page: a `command` in it is shown as copyable code (#4487 UX look). */
128
+ export function checkRich(check, version = "") {
129
+ return checkSentence(check, version).split("`").map((part, i) => (i % 2 ? html`<code class="uc-cmd">${part}</code>` : part));
130
+ }
131
+ /** The checks that did not pass, in P-order (absent checks are not failures: they were not run). */
132
+ export function failedChecks(preflight) {
133
+ const checks = preflight && Array.isArray(preflight.checks) ? preflight.checks : [];
134
+ return checks.filter((c) => c && c.ok === false).sort((a, b) => Number(String(a.id).slice(1)) - Number(String(b.id).slice(1)));
135
+ }
136
+ /** Whether this machine is a service install (P3 present and passing): the Phase 1 "tries to put it back" sentence is true. */
137
+ export function serviceInstall(preflight) {
138
+ const p3 = preflight && Array.isArray(preflight.checks) ? preflight.checks.find((c) => c && c.id === "P3") : null;
139
+ return !!(p3 && p3.ok);
140
+ }
141
+ /** May the admin press Update here (the server's `pressHere`; no pre-flight yet: as today, yes). */
142
+ export function pressHere(info) { return !info || !info.preflight || info.preflight.pressHere !== false; }
143
+
144
+ /** The card's second sentence (§3.1, Phase 1): only what is true on this machine; none before pre-flight has run. */
145
+ export function backSentence(info) {
146
+ const pf = info && info.preflight;
147
+ if (!pf || !Array.isArray(pf.checks) || !pf.checks.some((c) => c && c.id === "P3")) return tc("continues");
148
+ return serviceInstall(pf) ? tc("backPhase1", info.current) : tc("noWayBack");
149
+ }
150
+ /** The busy agents, capped (the leader's copy pass): "A, B and 3 more" / 「A、B,另有 3 個」 (#4487 UX look). */
151
+ export function namesShown(names, max = 2) {
152
+ const list = Array.isArray(names) ? names.filter(Boolean) : [];
153
+ return list.length <= max ? list.join(tc("sep")) : `${list.slice(0, max).join(tc("sep"))}${tc("more", list.length - max)}`;
154
+ }
155
+
156
+ // M-3730: through the shared clock helper (24-hour in zh-TW); English is 24-hour here too, as the leader asked for this card.
157
+ const fmtTime = (ms) => dateTimeText(ms, { weekday: "short", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
158
+ const fmtDay = (ms) => dateTimeText(ms, { weekday: "short", month: "short", day: "numeric" }).replace(/\s*\d{1,2}:\d{2}(:\d{2})?$/, "");
159
+ /** "HH:MM" every `step` minutes of a day: the 24-hour choices (never the browser's own time input, which shows AM/PM). */
160
+ export function dayTimes(step = 15) { const out = []; for (let m = 0; m < 24 * 60; m += step) out.push(`${String(Math.floor(m / 60)).padStart(2, "0")}:${String(m % 60).padStart(2, "0")}`); return out; }
161
+
162
+ /**
163
+ * POST /ui/update/answer. The answer's card replaces the store's; 412 carries a fresh pre-flight; 409 card_changed reads
164
+ * again. `refresh` is app-update.js's, `setInfo` writes the store (passed in: this module never imports app-update.js).
165
+ */
166
+ export async function answerCard(body, { refresh, setInfo, getInfo }) {
167
+ const key = `answer-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
168
+ let res = null, out = null;
169
+ try {
170
+ res = await fetch("/ui/update/answer", { method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": key }, body: JSON.stringify(body) });
171
+ try { out = await res.json(); } catch { out = null; }
172
+ } catch { res = null; }
173
+ const info = getInfo();
174
+ if (res && res.ok && out && "card" in out) { if (info) setInfo({ ...info, card: out.card }); return { ok: true, card: out.card }; }
175
+ if (res && res.status === 412 && out && out.preflight) {
176
+ if (info) setInfo({ ...info, preflight: out.preflight });
177
+ const first = failedChecks(out.preflight)[0];
178
+ toast(first ? checkText(first, info && info.card ? info.card.version : "") : tc("stop"), false);
179
+ return { ok: false, preflight: out.preflight };
180
+ }
181
+ if (res && res.status === 409) toast(out && out.key === "update_running" ? tc("running") : tc("changed"), false);
182
+ else toast(tc("failedAnswer", (out && (out.key || out.error)) || (res ? String(res.status) : "network")), false);
183
+ await refresh();
184
+ return { ok: false };
185
+ }
186
+
187
+ /** Update now: one question naming how many agents work now (the card's waitingFor), then the answer. */
188
+ export async function updateNow(info, deps) {
189
+ const busy = info && info.card && Array.isArray(info.card.waitingFor) ? info.card.waitingFor.length : 0;
190
+ const yes = await confirmDialog({ title: tc("nowTitle"), confirmLabel: tc("nowGo"), message: busy ? tc("nowBody", busy) : tc("nowBodyIdle") });
191
+ if (!yes) return { ok: false };
192
+ return answerCard({ action: "now", confirm: "update-agend" }, deps);
193
+ }
194
+
195
+ /** The next whole time at hh:00 local, today if it is still ahead (by 30 min), else tomorrow. */
196
+ export function nextAt(hour, now = new Date()) {
197
+ const d = new Date(now); d.setHours(hour, 0, 0, 0);
198
+ if (d.getTime() - now.getTime() < 30 * 60_000) d.setDate(d.getDate() + 1);
199
+ return d.getTime();
200
+ }
201
+ /** hh:00 tomorrow (never a morning that has already begun or passed). */
202
+ export function tomorrowAt(hour, now = new Date()) { const d = new Date(now); d.setDate(d.getDate() + 1); d.setHours(hour, 0, 0, 0); return d.getTime(); }
203
+ const WEEK = 7 * 24 * 60 * 60_000;
204
+ /** Pick a time: tonight, tomorrow morning, or another time in the next 7 days. Resolves to ms epoch or null. */
205
+ let pickResolve = null;
206
+ export function pickTimeDialog() { return new Promise((resolve) => { pickResolve = resolve; pickSignal.forEach((f) => f()); }); }
207
+ const pickSignal = new Set();
208
+ export function PickTimeHost() {
209
+ const [open, setOpen] = useState(false);
210
+ const [choice, setChoice] = useState("tonight");
211
+ const [day, setDay] = useState(0);
212
+ const [time, setTime] = useState("20:00");
213
+ useEffect(() => { const f = () => { setChoice("tonight"); setDay(0); setTime("20:00"); setOpen(true); }; pickSignal.add(f); return () => pickSignal.delete(f); }, []);
214
+ if (!open) return null;
215
+ const close = (v) => { setOpen(false); const r = pickResolve; pickResolve = null; if (r) r(v); };
216
+ const otherAt = () => { const d = new Date(); d.setDate(d.getDate() + day); const [h, m] = time.split(":").map(Number); d.setHours(h, m, 0, 0); return d.getTime(); };
217
+ const at = () => choice === "tonight" ? nextAt(22) : choice === "morning" ? tomorrowAt(8) : otherAt();
218
+ const go = () => { const v = at(); if (!Number.isFinite(v) || v <= Date.now() || v > Date.now() + WEEK) { toast(tc("pickBad"), false); return; } close(v); };
219
+ const radio = (id, label) => html`<label class="check uc-pick-row"><input type="radio" name="uc-pick" checked=${choice === id} onChange=${() => setChoice(id)} /><span>${label}</span></label>`;
220
+ const days = Array.from({ length: 8 }, (_, i) => { const d = new Date(); d.setDate(d.getDate() + i); return { i, label: fmtDay(d.getTime()) }; });
221
+ return html`<${Dialog} title=${tc("pickTitle")} onClose=${() => close(null)}
222
+ actions=${html`<button type="button" class="btn" onClick=${() => close(null)}>${tc("cancel")}</button><button type="button" class="btn btn-primary" onClick=${go}>${tc("pickGo")}</button>`}>
223
+ <div class="uc-pick">
224
+ ${radio("tonight", `${tc("pickTonight")} · ${fmtTime(nextAt(22))}`)}
225
+ ${radio("morning", `${tc("pickMorning")} · ${fmtTime(tomorrowAt(8))}`)}
226
+ ${radio("other", tc("pickOther"))}
227
+ ${choice === "other" ? html`<div class="uc-pick-frame">
228
+ <label class="uc-pick-field"><span>${tc("pickDay")}</span><select class="input uc-pick-day" value=${String(day)} onChange=${(e) => setDay(Number(e.currentTarget.value))}>
229
+ ${days.map((d) => html`<option value=${String(d.i)}>${d.label}</option>`)}</select></label>
230
+ <label class="uc-pick-field"><span>${tc("pickAt")}</span><select class="input uc-pick-time" value=${time} onChange=${(e) => setTime(e.currentTarget.value)}>
231
+ ${dayTimes(15).map((x) => html`<option value=${x}>${x}</option>`)}</select></label>
232
+ </div>` : null}
233
+ <p class="muted uc-pick-hint">${tc("pickHint")}</p>
234
+ </div>
235
+ </${Dialog}>`;
236
+ }
237
+ export async function pickTime(deps) {
238
+ const at = await pickTimeDialog();
239
+ if (!at) return { ok: false };
240
+ return answerCard({ action: "pick-time", at }, deps);
241
+ }
242
+
243
+ /**
244
+ * The banner's line for the card (null: nothing to show — not-now, done, no card). `Line` is app-update.js's line
245
+ * component and `busy` its starting flag (passed in). The progress and the failure lines stay app-update.js's own.
246
+ */
247
+ /** Whether Pick a time is offered: the server takes a schedule only on a machine whose pre-flight says it can update itself
248
+ * (class self; no result yet: as today, yes) — an admin-only machine updates on a press only (#4487 review P2). */
249
+ export function canSchedule(info) {
250
+ const pf = info && info.preflight;
251
+ return pressHere(info) && (!pf || pf.class === "self");
252
+ }
253
+ /** One action policy for the banner and Settings (#4487 review P2): what an admin can do with the card in its state, on
254
+ * this machine. Update now is never the filled button once the admin has chosen to wait (#4487 UX look). */
255
+ export function cardActions(info, deps) {
256
+ const c = info && info.card;
257
+ if (!c || !info.admin) return [];
258
+ const press = pressHere(info), sched = canSchedule(info);
259
+ const act = (key, label, run, primary = false) => ({ key, label, primary, run });
260
+ const whenIdle = act("when-idle", tc("whenIdle"), () => answerCard({ action: "when-idle" }, deps), true);
261
+ const pick = act("pick-time", tc("pickTime"), () => pickTime(deps));
262
+ const later = act("not-now", tc("notNow"), () => answerCard({ action: "not-now" }, deps));
263
+ const cancel = act("cancel", tc("cancel"), () => answerCard({ action: "cancel" }, deps));
264
+ const now = act("now", tc("updateNow"), () => updateNow(info, deps));
265
+ if (c.state === "offered") return [press && whenIdle, sched && pick, later].filter(Boolean);
266
+ if (c.state === "not-now") return [press && whenIdle, sched && pick].filter(Boolean);
267
+ if (c.state === "waiting-idle") return [press && now, sched && pick, cancel].filter(Boolean);
268
+ if (c.state === "scheduled") return [press && now, cancel].filter(Boolean);
269
+ return [];
270
+ }
271
+ export function cardLine(info, { Line, busy, deps }) {
272
+ const c = info && info.card;
273
+ if (!c || !info.admin) return null;
274
+ const press = pressHere(info), fails = failedChecks(info.preflight);
275
+ // "Can't update here" (class stop): one line, in one place — Needs you (the leader's copy pass), not the banner too.
276
+ if (info.preflight && info.preflight.class === "stop" && (c.state === "offered" || c.state === "cant")) return null;
277
+ const buttons = cardActions(info, deps).map((a) => html`<button type="button" key=${a.key} class=${`btn btn-sm${a.primary ? " btn-primary" : ""}`} disabled=${busy} onClick=${() => { void a.run(); }}>${a.label}</button>`);
278
+ const how = fails.length ? html`<details class="uc-how"><summary>${tc("howTo")}</summary>${fails.map((f) => html`<p>${checkRich(f, c.version)}</p>`)}</details>` : null;
279
+ if (c.state === "offered") {
280
+ const sub = press ? [backSentence(info)] : [tc("pressOnlyLine"), how];
281
+ return html`<${Line} title=${tc("ready", c.version)} sub=${sub}>${buttons}</${Line}>`;
282
+ }
283
+ if (c.state === "waiting-idle") {
284
+ const names = Array.isArray(c.waitingFor) && c.waitingFor.length ? tc("waitingFor", namesShown(c.waitingFor)) : null;
285
+ return html`<${Line} spinner title=${tc("waiting", c.version)} sub=${[names]}>${buttons}</${Line}>`;
286
+ }
287
+ if (c.state === "scheduled") return html`<${Line} icon="clock" title=${tc("scheduled", c.version, fmtTime(c.scheduledAt))}>${buttons}</${Line}>`;
288
+ if (c.state === "updating" && !(info.progress && info.progress.stage)) return html`<${Line} spinner title=${tc("starting", c.version)} />`;
289
+ return null;
290
+ }
291
+
292
+ /** Settings → Version and update: the card's state, the pre-flight result, and the controls (two + Advanced). */
293
+ export function UpdateCardSettings({ info, deps }) {
294
+ noteCurrentVersion(info && info.current);
295
+ return html`<div class="uc-settings">
296
+ <${CardStatus} info=${info} deps=${deps} />
297
+ <${MachineLine} info=${info} />
298
+ <${UpdatesControls} />
299
+ </div>`;
300
+ }
301
+ function CardStatus({ info }) {
302
+ const c = info && info.card;
303
+ if (!c) return null;
304
+ const line = c.state === "not-now" && c.notNowUntil ? tc("notNowUntil", fmtTime(c.notNowUntil))
305
+ : c.state === "scheduled" && c.scheduledAt ? tc("scheduled", c.version, fmtTime(c.scheduledAt))
306
+ : c.state === "waiting-idle" ? [tc("waiting", c.version), Array.isArray(c.waitingFor) && c.waitingFor.length ? tc("waitingFor", namesShown(c.waitingFor)) : ""].filter(Boolean).join(" ")
307
+ : null;
308
+ return line ? html`<p class="uc-status" role="status">${line}</p>` : null;
309
+ }
310
+ /** "Updates on this machine": ✓ / ◐ / ✗, then each check that did not pass, worded, and the ones not run yet. */
311
+ export function MachineLine({ info }) {
312
+ const pf = info && info.preflight;
313
+ if (!pf) return html`<div class="uc-machine"><strong>${tc("machine")}</strong> <span class="muted">${tc("checking")}</span></div>`;
314
+ const cls = pf.class === "self" ? "self" : pf.class === "admin-only" ? "admin-only" : "stop";
315
+ const mark = cls === "self" ? "✓" : cls === "admin-only" ? "◐" : "✗";
316
+ const fails = failedChecks(pf);
317
+ return html`<div class=${`uc-machine uc-${cls}`}>
318
+ <div><strong>${tc("machine")}</strong> <span class="uc-mark" aria-hidden="true">${mark}</span> <span>${tc(cls === "self" ? "self" : cls === "admin-only" ? "adminOnly" : "stop")}</span></div>
319
+ ${fails.length ? html`<ul class="uc-checks">${fails.map((f) => html`<li key=${f.id}>${checkRich(f, info.card ? info.card.version : "")}</li>`)}</ul>`
320
+ : cls !== "self" ? html`<p class="muted uc-checks">${tc("notAllChecked")}</p>` : null}
321
+ </div>`;
322
+ }
323
+
324
+ /** The running version (the placeholder of the pin): read from GET /ui/update's answer, kept by app-update.js's store. */
325
+ let currentVersion = "";
326
+ export function noteCurrentVersion(v) { if (typeof v === "string") currentVersion = v; }
327
+ const updateCurrentVersion = () => currentVersion;
328
+
329
+ /** Half-hour choices, plus a saved value that isn't on the half hour (written by hand in fleet.yaml) so it is kept. */
330
+ const timeChoices = (current) => { const all = dayTimes(30); return current && !all.includes(current) ? [...all, current].sort() : all; };
331
+
332
+ /** The controls: when not to update (pause windows) and, under Advanced, the pin and the longest wait. PUT /api/settings/fleet/updates. */
333
+ export function UpdatesControls() {
334
+ const [cfg, setCfg] = useState(null);
335
+ const [pause, setPause] = useState([]);
336
+ const [pin, setPin] = useState("");
337
+ const [wait, setWait] = useState("24");
338
+ const [busy, setBusy] = useState(false);
339
+ useEffect(() => {
340
+ let alive = true;
341
+ (async () => {
342
+ try {
343
+ const r = await fetch("/api/settings/fleet", { cache: "no-store" });
344
+ const body = r.ok ? await r.json() : null;
345
+ const u = body && body.updates && typeof body.updates === "object" ? body.updates : {};
346
+ if (!alive) return;
347
+ setCfg(u); setPause(Array.isArray(u.pause) ? u.pause.map((w) => ({ days: [...(w.days || [])], from: w.from || "09:00", to: w.to || "18:00" })) : []);
348
+ setPin(typeof u.pin === "string" ? u.pin : ""); setWait(String(Number.isInteger(u.maxIdleWait) ? u.maxIdleWait : 24));
349
+ } catch { if (alive) setCfg({}); }
350
+ })();
351
+ return () => { alive = false; };
352
+ }, []);
353
+ if (!cfg) return null;
354
+ const dayNames = tc("days").split(",");
355
+ // #4487 review P1: a held settings change. What only holds updates back applies at once ("Saved."); what lets an update go
356
+ // ahead sooner waits for a confirmation (the pending card), and says so — never "Saved." before it is applied.
357
+ const save = async (patch) => {
358
+ setBusy(true);
359
+ let r = null, waiting = false;
360
+ try {
361
+ // Settings' own module, loaded here only (the banner, on every page, never needs it).
362
+ const { confirmedWrite } = await import("/ui/js/settings-confirm.js");
363
+ r = await confirmedWrite("/api/settings/fleet/updates", { method: "PUT", body: patch, label: tc("settingsLabel"), resendable: true,
364
+ onPending: () => { waiting = true; setBusy(false); toast(tc("pending")); } });
365
+ } catch { r = null; }
366
+ setBusy(false);
367
+ if (r && r.ok) { toast(tc(waiting ? "applied" : "saved")); return true; }
368
+ const out = r && r.body;
369
+ const why = out && Array.isArray(out.problems) && out.problems[0] ? `${out.problems[0].path}: ${out.problems[0].message}` : (out && out.error) || (r ? String(r.status) : "network");
370
+ toast(tc("saveFailed", why), false);
371
+ return false;
372
+ };
373
+ const setRow = (i, next) => setPause((rows) => rows.map((r, j) => (j === i ? { ...r, ...next } : r)));
374
+ const toggleDay = (i, d) => setRow(i, { days: pause[i].days.includes(d) ? pause[i].days.filter((x) => x !== d) : [...pause[i].days, d].sort() });
375
+ return html`<div class="uc-controls">
376
+ <fieldset class="uc-pause"><legend>${tc("pauseTitle")}</legend>
377
+ <p class="muted uc-hint">${tc("pauseHint")}</p>
378
+ ${pause.map((w, i) => html`<div class="uc-pause-row" key=${i}>
379
+ <div class="uc-days" role="group" aria-label=${tc("pauseTitle")}>${dayNames.map((n, d) => html`<label class="check uc-day"><input type="checkbox" checked=${w.days.includes(d)} onChange=${() => toggleDay(i, d)} /><span>${n}</span></label>`)}</div>
380
+ <label class="uc-time">${tc("from")} <select class="input" value=${w.from} onChange=${(e) => setRow(i, { from: e.currentTarget.value })}>${timeChoices(w.from).map((x) => html`<option value=${x}>${x}</option>`)}</select></label>
381
+ <label class="uc-time">${tc("to")} <select class="input" value=${w.to} onChange=${(e) => setRow(i, { to: e.currentTarget.value })}>${timeChoices(w.to).map((x) => html`<option value=${x}>${x}</option>`)}</select></label>
382
+ <button type="button" class="btn btn-sm" onClick=${() => setPause((rows) => rows.filter((_, j) => j !== i))}>${tc("pauseRemove")}</button>
383
+ </div>`)}
384
+ <div class="uc-row-actions">
385
+ <button type="button" class="btn btn-sm" onClick=${() => setPause((rows) => [...rows, { days: [1, 2, 3, 4, 5], from: "09:00", to: "18:00" }])}>${tc("pauseAdd")}</button>
386
+ <button type="button" class="btn btn-sm btn-primary" disabled=${busy} onClick=${() => { void save({ pause }); }}>${tc("save")}</button>
387
+ </div>
388
+ </fieldset>
389
+ <details class="s-ui-disclosure uc-advanced"><summary>${tc("advanced")}</summary><div class="s-disclosure-body">
390
+ <label class="field"><span>${tc("pin")}</span><input class="input" value=${pin} placeholder=${updateCurrentVersion() || ""} onInput=${(e) => setPin(e.currentTarget.value)} /><span class="muted uc-hint">${tc("pinHint")}</span></label>
391
+ <label class="field"><span>${tc("maxWait")}</span><input class="input" type="number" min="1" max="168" step="1" value=${wait} onInput=${(e) => setWait(e.currentTarget.value)} /><span class="muted uc-hint">${tc("maxWaitHint")}</span></label>
392
+ <div class="uc-row-actions"><button type="button" class="btn btn-sm btn-primary" disabled=${busy}
393
+ onClick=${() => { void save({ pin: pin.trim() ? pin.trim() : null, maxIdleWait: Number(wait) }); }}>${tc("save")}</button></div>
394
+ </div></details>
395
+ </div>`;
396
+ }
397
+
398
+ /** Needs you (§3.1: only a failure or "can't update here"): one item from the store, not counted in the server's badge. */
399
+ /** #4487 review P2: the one update item Needs you shows, counts and weighs for its empty state — "failed", "cant" (can't
400
+ * update here: the card says so, or the pre-flight is class stop; never while Not now), or null. */
401
+ export function updateAttention(info) {
402
+ const c = info && info.admin ? info.card : null;
403
+ if (!c) return null;
404
+ if (c.state === "failed") return "failed";
405
+ if ((c.state === "cant" || (info.preflight && info.preflight.class === "stop")) && c.state !== "not-now") return "cant";
406
+ return null;
407
+ }
408
+ export function UpdateNeedsItem({ info, settingsHref }) {
409
+ const kind = updateAttention(info);
410
+ if (!kind) return null;
411
+ const c = info.card, fails = failedChecks(info.preflight);
412
+ if (kind === "failed") return html`<section class="n-group uc-needs"><div class="n-item"><strong>${t("update.failed_" + ((c.failed && c.failed.cause) || "other"))}</strong>
413
+ <p class="muted">${c.failed && c.failed.rolledBack ? t("update.unchanged", info.current) : t("update.afterInstall")}</p>
414
+ <a class="btn btn-sm" href=${settingsHref}>${t("app.settings")}</a></div></section>`;
415
+ // Can't update here: the reason itself is the one line (the leader's copy pass), with the way to Settings.
416
+ const first = fails[0];
417
+ return html`<section class="n-group uc-needs"><div class="n-item"><strong>${first ? checkRich(first, c.version) : tc("cantTitle")}</strong>
418
+ <a class="btn btn-sm" href=${settingsHref}>${t("app.settings")}</a></div></section>`;
419
+ }
@@ -18,3 +18,10 @@
18
18
  .ws-viewer-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
19
19
  .ws-text .ws-ln { color: var(--text-3); user-select: none; padding-right: var(--s-3); }
20
20
  .ws-image { max-width: 100%; height: auto; display: block; border-radius: var(--r-sm); }
21
+ /* M-3765: what git ignores, listed on request (soul.md always): a toggle above the tree, and the entries a little quieter. */
22
+ .ws-ignored-toggle { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
23
+ .ws-entry.is-ignored .ws-name { color: var(--text-2); }
24
+ @media (max-width: 899px), (pointer: coarse) { .ws-ignored-toggle { min-height: var(--tap); } }
25
+ /* M-3765 capture check: a folder in the tree opens as its own listing, never expanded in place, so its chevron points right
26
+ (collapsed); the chevron icon itself points down. */
27
+ .ws-entry.t-dir .ws-entry-btn > .icon { transform: rotate(-90deg); }