@songsid/agend 2.3.5-alpha.5 → 2.3.5-alpha.6

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 (326) hide show
  1. package/THIRD_PARTY_NOTICES.md +0 -1
  2. package/dist/accounts-profiles.d.ts +96 -0
  3. package/dist/accounts-profiles.js +178 -0
  4. package/dist/accounts-profiles.js.map +1 -0
  5. package/dist/accounts-signout.d.ts +59 -0
  6. package/dist/accounts-signout.js +184 -0
  7. package/dist/accounts-signout.js.map +1 -0
  8. package/dist/accounts-view.d.ts +54 -0
  9. package/dist/accounts-view.js +55 -11
  10. package/dist/accounts-view.js.map +1 -1
  11. package/dist/agent-workspace.d.ts +11 -0
  12. package/dist/agent-workspace.js +28 -0
  13. package/dist/agent-workspace.js.map +1 -1
  14. package/dist/auth-api.js +27 -5
  15. package/dist/auth-api.js.map +1 -1
  16. package/dist/authority/session-authorizations.d.ts +2 -0
  17. package/dist/authority/session-authorizations.js +7 -1
  18. package/dist/authority/session-authorizations.js.map +1 -1
  19. package/dist/backend/codex.js +1 -0
  20. package/dist/backend/codex.js.map +1 -1
  21. package/dist/backend/types.d.ts +2 -0
  22. package/dist/backend/types.js.map +1 -1
  23. package/dist/build-provenance.json +1 -1
  24. package/dist/bundled-tmux-guard.d.ts +19 -0
  25. package/dist/bundled-tmux-guard.js +83 -0
  26. package/dist/bundled-tmux-guard.js.map +1 -0
  27. package/dist/classic-bindings.d.ts +13 -0
  28. package/dist/classic-bindings.js +28 -2
  29. package/dist/classic-bindings.js.map +1 -1
  30. package/dist/classic-channel-manager.d.ts +2 -0
  31. package/dist/classic-channel-manager.js +5 -1
  32. package/dist/classic-channel-manager.js.map +1 -1
  33. package/dist/cli.js +116 -11
  34. package/dist/cli.js.map +1 -1
  35. package/dist/config-validator.js +11 -0
  36. package/dist/config-validator.js.map +1 -1
  37. package/dist/config.js +3 -1
  38. package/dist/config.js.map +1 -1
  39. package/dist/daemon.d.ts +27 -2
  40. package/dist/daemon.js +107 -6
  41. package/dist/daemon.js.map +1 -1
  42. package/dist/doctor.js +3 -4
  43. package/dist/doctor.js.map +1 -1
  44. package/dist/e2e-isolation.js +5 -2
  45. package/dist/e2e-isolation.js.map +1 -1
  46. package/dist/fleet-control-audit.d.ts +1 -1
  47. package/dist/fleet-manager.d.ts +129 -0
  48. package/dist/fleet-manager.js +725 -53
  49. package/dist/fleet-manager.js.map +1 -1
  50. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
  51. package/dist/hub/compose/server.js +1 -0
  52. package/dist/hub/compose/server.js.map +1 -1
  53. package/dist/hub/directory/directory.d.ts +1 -1
  54. package/dist/hub/directory/directory.js +115 -3
  55. package/dist/hub/directory/directory.js.map +1 -1
  56. package/dist/hub/directory/groups.d.ts +29 -0
  57. package/dist/hub/directory/groups.js +29 -0
  58. package/dist/hub/directory/groups.js.map +1 -0
  59. package/dist/hub/directory/index.d.ts +1 -0
  60. package/dist/hub/directory/types.d.ts +4 -0
  61. package/dist/hub/directory/types.js.map +1 -1
  62. package/dist/hub/group-policy/model.d.ts +56 -0
  63. package/dist/hub/group-policy/model.js +46 -0
  64. package/dist/hub/group-policy/model.js.map +1 -0
  65. package/dist/hub/group-policy/resources.d.ts +52 -0
  66. package/dist/hub/group-policy/resources.js +166 -0
  67. package/dist/hub/group-policy/resources.js.map +1 -0
  68. package/dist/hub/group-policy/store.d.ts +52 -0
  69. package/dist/hub/group-policy/store.js +149 -0
  70. package/dist/hub/group-policy/store.js.map +1 -0
  71. package/dist/hub/http/compose.js +4 -3
  72. package/dist/hub/http/compose.js.map +1 -1
  73. package/dist/hub/pairing.d.ts +3 -1
  74. package/dist/hub/pairing.js +6 -3
  75. package/dist/hub/pairing.js.map +1 -1
  76. package/dist/hub/server.d.ts +2 -0
  77. package/dist/hub/server.js +12 -2
  78. package/dist/hub/server.js.map +1 -1
  79. package/dist/instance-config-impact.js +4 -3
  80. package/dist/instance-config-impact.js.map +1 -1
  81. package/dist/instance-lifecycle.d.ts +17 -0
  82. package/dist/instance-lifecycle.js +38 -1
  83. package/dist/instance-lifecycle.js.map +1 -1
  84. package/dist/locale.js +21 -0
  85. package/dist/locale.js.map +1 -1
  86. package/dist/login-controller.d.ts +5 -0
  87. package/dist/login-controller.js +11 -0
  88. package/dist/login-controller.js.map +1 -1
  89. package/dist/login-window-lock.d.ts +2 -1
  90. package/dist/login-window-lock.js.map +1 -1
  91. package/dist/ls-rows.d.ts +1 -1
  92. package/dist/ls-rows.js +1 -1
  93. package/dist/ls-rows.js.map +1 -1
  94. package/dist/machine-accounts.d.ts +110 -0
  95. package/dist/machine-accounts.js +229 -0
  96. package/dist/machine-accounts.js.map +1 -0
  97. package/dist/machine-signins.d.ts +89 -0
  98. package/dist/machine-signins.js +182 -0
  99. package/dist/machine-signins.js.map +1 -0
  100. package/dist/muse-usage-relay.d.ts +2 -0
  101. package/dist/muse-usage-relay.js +5 -3
  102. package/dist/muse-usage-relay.js.map +1 -1
  103. package/dist/needs-you-hub.d.ts +3 -0
  104. package/dist/needs-you-hub.js +13 -3
  105. package/dist/needs-you-hub.js.map +1 -1
  106. package/dist/needs-you.d.ts +35 -2
  107. package/dist/needs-you.js +19 -0
  108. package/dist/needs-you.js.map +1 -1
  109. package/dist/quickstart.js +7 -18
  110. package/dist/quickstart.js.map +1 -1
  111. package/dist/quiet-run.d.ts +31 -0
  112. package/dist/quiet-run.js +50 -0
  113. package/dist/quiet-run.js.map +1 -0
  114. package/dist/quota-notice-config.d.ts +22 -0
  115. package/dist/quota-notice-config.js +41 -0
  116. package/dist/quota-notice-config.js.map +1 -0
  117. package/dist/runtime-api.d.ts +13 -0
  118. package/dist/runtime-api.js +125 -1
  119. package/dist/runtime-api.js.map +1 -1
  120. package/dist/runtime-build-info.d.ts +2 -1
  121. package/dist/runtime-build-info.js +7 -3
  122. package/dist/runtime-build-info.js.map +1 -1
  123. package/dist/runtime-cli-install.d.ts +153 -0
  124. package/dist/runtime-cli-install.js +675 -0
  125. package/dist/runtime-cli-install.js.map +1 -0
  126. package/dist/runtime-cli.js +157 -12
  127. package/dist/runtime-cli.js.map +1 -1
  128. package/dist/runtime-client.d.ts +64 -2
  129. package/dist/runtime-client.js +277 -20
  130. package/dist/runtime-client.js.map +1 -1
  131. package/dist/runtime-coordinator.d.ts +10 -1
  132. package/dist/runtime-coordinator.js +93 -2
  133. package/dist/runtime-coordinator.js.map +1 -1
  134. package/dist/runtime-credential-profiles.d.ts +11 -2
  135. package/dist/runtime-credential-profiles.js +28 -4
  136. package/dist/runtime-credential-profiles.js.map +1 -1
  137. package/dist/runtime-install.js +9 -6
  138. package/dist/runtime-install.js.map +1 -1
  139. package/dist/runtime-pane-link.js +2 -1
  140. package/dist/runtime-pane-link.js.map +1 -1
  141. package/dist/runtime-pane-service.js +2 -2
  142. package/dist/runtime-pane-service.js.map +1 -1
  143. package/dist/runtime-pane-store.d.ts +10 -0
  144. package/dist/runtime-pane-store.js +13 -1
  145. package/dist/runtime-pane-store.js.map +1 -1
  146. package/dist/runtime-profile-ownership.d.ts +66 -0
  147. package/dist/runtime-profile-ownership.js +391 -0
  148. package/dist/runtime-profile-ownership.js.map +1 -0
  149. package/dist/runtime-protocol.d.ts +88 -2
  150. package/dist/runtime-protocol.js +40 -0
  151. package/dist/runtime-protocol.js.map +1 -1
  152. package/dist/runtime-remote-accounts.d.ts +197 -0
  153. package/dist/runtime-remote-accounts.js +663 -0
  154. package/dist/runtime-remote-accounts.js.map +1 -0
  155. package/dist/runtime-remote-setup.d.ts +105 -0
  156. package/dist/runtime-remote-setup.js +529 -0
  157. package/dist/runtime-remote-setup.js.map +1 -0
  158. package/dist/runtime-signin-transport.d.ts +39 -0
  159. package/dist/runtime-signin-transport.js +110 -0
  160. package/dist/runtime-signin-transport.js.map +1 -0
  161. package/dist/runtime-signin.d.ts +132 -0
  162. package/dist/runtime-signin.js +289 -0
  163. package/dist/runtime-signin.js.map +1 -0
  164. package/dist/runtime-update-attention.d.ts +4 -0
  165. package/dist/runtime-update-attention.js +11 -0
  166. package/dist/runtime-update-attention.js.map +1 -0
  167. package/dist/runtime-update-controller.d.ts +75 -0
  168. package/dist/runtime-update-controller.js +691 -0
  169. package/dist/runtime-update-controller.js.map +1 -0
  170. package/dist/runtime-update-ipc.d.ts +42 -0
  171. package/dist/runtime-update-ipc.js +144 -0
  172. package/dist/runtime-update-ipc.js.map +1 -0
  173. package/dist/runtime-update-journal.d.ts +5 -0
  174. package/dist/runtime-update-journal.js +7 -0
  175. package/dist/runtime-update-journal.js.map +1 -1
  176. package/dist/runtime-update-lock.js +17 -2
  177. package/dist/runtime-update-lock.js.map +1 -1
  178. package/dist/runtime-update-status.d.ts +30 -0
  179. package/dist/runtime-update-status.js +31 -0
  180. package/dist/runtime-update-status.js.map +1 -0
  181. package/dist/settings-api.js +3 -0
  182. package/dist/settings-api.js.map +1 -1
  183. package/dist/settings-change.js +8 -0
  184. package/dist/settings-change.js.map +1 -1
  185. package/dist/settings-instance-patch.js +1 -1
  186. package/dist/settings-instance-patch.js.map +1 -1
  187. package/dist/setup-wizard.js +3 -5
  188. package/dist/setup-wizard.js.map +1 -1
  189. package/dist/signin-keepalive.d.ts +203 -0
  190. package/dist/signin-keepalive.js +652 -0
  191. package/dist/signin-keepalive.js.map +1 -0
  192. package/dist/structured-signin-transport.js +4 -0
  193. package/dist/structured-signin-transport.js.map +1 -1
  194. package/dist/structured-signin.d.ts +7 -0
  195. package/dist/structured-signin.js +1 -1
  196. package/dist/structured-signin.js.map +1 -1
  197. package/dist/tmux-binary.d.ts +23 -23
  198. package/dist/tmux-binary.js +35 -46
  199. package/dist/tmux-binary.js.map +1 -1
  200. package/dist/tmux-exec-helper.js +3 -3
  201. package/dist/tmux-exec-helper.js.map +1 -1
  202. package/dist/tmux-legacy.d.ts +94 -0
  203. package/dist/tmux-legacy.js +309 -0
  204. package/dist/tmux-legacy.js.map +1 -0
  205. package/dist/tmux-manager.d.ts +7 -1
  206. package/dist/tmux-manager.js +21 -11
  207. package/dist/tmux-manager.js.map +1 -1
  208. package/dist/tmux-rollback.d.ts +31 -0
  209. package/dist/tmux-rollback.js +72 -0
  210. package/dist/tmux-rollback.js.map +1 -0
  211. package/dist/tmux-server.d.ts +102 -0
  212. package/dist/tmux-server.js +248 -0
  213. package/dist/tmux-server.js.map +1 -0
  214. package/dist/transcript-monitor.js +43 -5
  215. package/dist/transcript-monitor.js.map +1 -1
  216. package/dist/transcript-records.d.ts +2 -1
  217. package/dist/transcript-records.js +3 -0
  218. package/dist/transcript-records.js.map +1 -1
  219. package/dist/transcript-sources.js +3 -0
  220. package/dist/transcript-sources.js.map +1 -1
  221. package/dist/types.d.ts +3 -0
  222. package/dist/ui/accounts-keepalive.js +112 -0
  223. package/dist/ui/accounts-manage.js +237 -0
  224. package/dist/ui/accounts-view.js +175 -31
  225. package/dist/ui/agent-runtime-settings.js +2 -1
  226. package/dist/ui/app.html +8 -1
  227. package/dist/ui/hub-attachments.js +90 -0
  228. package/dist/ui/hub-chat-store.js +9 -4
  229. package/dist/ui/hub-client.js +20 -1
  230. package/dist/ui/hub-preview.js +101 -0
  231. package/dist/ui/machine-signin.js +56 -0
  232. package/dist/ui/panel-fleet.js +1 -1
  233. package/dist/ui/panel-hub.js +126 -31
  234. package/dist/ui/panel-needs.js +14 -8
  235. package/dist/ui/panel-notices.js +4 -3
  236. package/dist/ui/panel-runtimes.js +19 -6
  237. package/dist/ui/panel-settings.js +12 -6
  238. package/dist/ui/panel-windows-agent.js +2 -1
  239. package/dist/ui/preview-pages.js +3 -41
  240. package/dist/ui/preview-panel-actions.js +3 -161
  241. package/dist/ui/preview-panel.js +10 -557
  242. package/dist/ui/preview-versions.js +3 -155
  243. package/dist/ui/runtime-cli-install.js +114 -0
  244. package/dist/ui/runtime-update-commands.d.ts +2 -0
  245. package/dist/ui/runtime-update-commands.js +11 -0
  246. package/dist/ui/runtime-update-status.js +53 -0
  247. package/dist/ui/search-dialog.js +3 -2
  248. package/dist/ui/settings-guests.js +3 -2
  249. package/dist/ui/settings-hub-browser-certificate.js +2 -0
  250. package/dist/ui/settings-hub-membership.js +12 -6
  251. package/dist/ui/settings-hub-retention.js +2 -0
  252. package/dist/ui/settings-hub.js +11 -3
  253. package/dist/ui/settings-quota-notice.js +100 -0
  254. package/dist/ui/settings-registry.js +1 -0
  255. package/dist/ui/settings-strings.js +2 -2
  256. package/dist/ui/settings-web-authority.js +2 -1
  257. package/dist/ui/shared/accounts-keepalive.css +7 -0
  258. package/dist/ui/shared/accounts.css +13 -0
  259. package/dist/ui/shared/app-route.js +1 -1
  260. package/dist/ui/shared/app-shell.js +9 -3
  261. package/dist/ui/shared/app-store.js +2 -2
  262. package/dist/ui/shared/app.css +13 -0
  263. package/dist/ui/shared/app.js +2 -1
  264. package/dist/ui/shared/hub-chat.css +1 -0
  265. package/dist/ui/shared/hub-owner.css +1 -1
  266. package/dist/ui/shared/loading.css +37 -0
  267. package/dist/ui/shared/preview-pages.js +41 -0
  268. package/dist/ui/shared/preview-panel-actions.js +168 -0
  269. package/dist/ui/shared/preview-panel.js +565 -0
  270. package/dist/ui/shared/preview-versions.js +155 -0
  271. package/dist/ui/shared/runtime-install.css +4 -0
  272. package/dist/ui/shared/signin.js +68 -6
  273. package/dist/ui/shared/ui-states.js +14 -3
  274. package/dist/ui/shared/workspace-follow.css +19 -0
  275. package/dist/ui/signin.html +7 -3
  276. package/dist/ui/structured-signin.js +31 -7
  277. package/dist/ui/workspace-follow-strings.js +28 -0
  278. package/dist/ui/workspace-panel.js +225 -36
  279. package/dist/update-install.d.ts +7 -0
  280. package/dist/update-install.js +23 -0
  281. package/dist/update-install.js.map +1 -1
  282. package/dist/usage/providers.d.ts +5 -0
  283. package/dist/usage/providers.js +5 -0
  284. package/dist/usage/providers.js.map +1 -1
  285. package/dist/usage/quota-notices.d.ts +38 -0
  286. package/dist/usage/quota-notices.js +160 -0
  287. package/dist/usage/quota-notices.js.map +1 -0
  288. package/dist/usage/usage-api.d.ts +1 -0
  289. package/dist/usage/usage-api.js +16 -0
  290. package/dist/usage/usage-api.js.map +1 -1
  291. package/dist/web-api.d.ts +33 -0
  292. package/dist/web-api.js +342 -8
  293. package/dist/web-api.js.map +1 -1
  294. package/dist/web-login.d.ts +35 -1
  295. package/dist/web-login.js +51 -5
  296. package/dist/web-login.js.map +1 -1
  297. package/dist/web-session.d.ts +11 -0
  298. package/dist/web-session.js +38 -1
  299. package/dist/web-session.js.map +1 -1
  300. package/dist/web-shell-routes.d.ts +1 -1
  301. package/dist/web-shell-routes.js +1 -1
  302. package/dist/web-shell-routes.js.map +1 -1
  303. package/dist/web-signin-link.d.ts +42 -0
  304. package/dist/web-signin-link.js +110 -0
  305. package/dist/web-signin-link.js.map +1 -0
  306. package/dist/windows-cli-api.d.ts +6 -0
  307. package/dist/windows-cli-api.js +11 -0
  308. package/dist/windows-cli-api.js.map +1 -1
  309. package/dist/windows-cli-worker.d.ts +3 -1
  310. package/dist/windows-cli-worker.js +18 -3
  311. package/dist/windows-cli-worker.js.map +1 -1
  312. package/dist/workspace-follow-parse.d.ts +36 -0
  313. package/dist/workspace-follow-parse.js +208 -0
  314. package/dist/workspace-follow-parse.js.map +1 -0
  315. package/dist/workspace-follow-records.d.ts +17 -0
  316. package/dist/workspace-follow-records.js +88 -0
  317. package/dist/workspace-follow-records.js.map +1 -0
  318. package/dist/workspace-follow.d.ts +41 -0
  319. package/dist/workspace-follow.js +143 -0
  320. package/dist/workspace-follow.js.map +1 -0
  321. package/dist/wsl-detect.d.ts +1 -0
  322. package/dist/wsl-detect.js +20 -0
  323. package/dist/wsl-detect.js.map +1 -0
  324. package/launcher/tmux-bundle.cjs +26 -10
  325. package/package.json +6 -2
  326. package/templates/runtime-install/install.ps1 +154 -13
@@ -10,14 +10,15 @@ import { PanelHeader, setTitle } from "/assets/app-shell.js";
10
10
  import { lang, t } from "/assets/app-i18n.js";
11
11
  import { createStore, useStore } from "/assets/app-store.js";
12
12
  import { navigate, navStore } from "/assets/app-nav.js";
13
- import { Empty } from "/assets/ui-states.js";
13
+ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
14
14
  import { Icon } from "/assets/ui-icons.js";
15
15
  import { confirmDialog } from "/assets/ui-confirm.js";
16
16
  import { Dialog } from "/assets/ui-dialog.js";
17
17
  import { Menu } from "/assets/ui-menu.js";
18
18
  import { toast } from "/assets/ui-toast.js";
19
19
  // #3226 B: the chat is the fleet chat's own drawing (PR A's shared modules), in the fleet chat's words.
20
- import { createThread } from "/assets/chat-thread.js";
20
+ import { createThread, msgKey } from "/assets/chat-thread.js";
21
+ import { PreviewPanel, closePanel, panelStore } from "/assets/preview-panel.js";
21
22
  import { ComposerInput, WorkBarView, touchScreen } from "/assets/chat-composer.js";
22
23
  import { RailFrame } from "/assets/side-rail.js";
23
24
  import "/assets/chat-strings.js";
@@ -28,6 +29,8 @@ import { ho, linkHubOwnerCss } from "./hub-owner-strings.js";
28
29
  import { createHubChatStore } from "./hub-chat-store.js";
29
30
  import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quota.js";
30
31
  import { PageHead } from "/assets/page-head.js";
32
+ import { bindRoomFeedback, bootHubPreview, downloadHtml, draftWithLine, panelOpenFor, roomPanelKey, roomPanelOpts, setHubPreviewOptIn } from "./hub-preview.js";
33
+ import { PendingFiles, hf, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
31
34
 
32
35
  const TITLES = { ask: "askTitle", exposures: "exposuresTitle", admin: "adminTitle" };
33
36
  /** P1 room polling: at most once per ten seconds, one request at a time, paused while the page is hidden (hub.md §5). */
@@ -74,13 +77,15 @@ const errText = (r) => hw(r.code === "conflict" || r.code === "stale" ? "errConf
74
77
  export function HubPanel({ route }) {
75
78
  const tab = TITLES[route && route.tab] ? route.tab : "ask";
76
79
  const s = useSession();
77
- useEffect(() => { linkHubCss(); }, []);
80
+ useEffect(() => { linkHubCss(); if (tab === "ask") linkHubChatCss(); }, [tab]);
78
81
  useEffect(() => { setTitle(hw(TITLES[tab])); }, [tab]);
79
- let body = null;
82
+ let body = tab === "ask" ? roomParam() ? html`<${HubRoomLoading} />`
83
+ : html`<${PanelHeader} title=${hc("chats")} /><div class="hub-home"><${Skeleton} variant="rows" lines=${4} /></div>`
84
+ : html`<${Skeleton} variant="rows" lines=${4} />`;
80
85
  if (s === null) body = html`<${HubSignIn} />`;
81
86
  else if (s) body = tab === "ask" ? html`<${HubChats} />` : tab === "exposures" ? html`<${HubMine} />` : html`<${HubAdmin} admin=${!!s.admin} />`;
82
87
  // The chats draw their own header (the room's); the other pages keep the panel's.
83
- if (s && tab === "ask") return html`<div data-effect-panel="hub" class="panel p-hub p-hub-ask"><div data-trust="panel-content" class="panel-body hub-chat-body">${body}</div></div>`;
88
+ if (s !== null && tab === "ask") return html`<div data-effect-panel="hub" class="panel p-hub p-hub-ask"><div data-trust="panel-content" class="panel-body hub-chat-body">${body}</div></div>`;
84
89
  // #3226 C: My shared agents and Administration are Settings-like pages (their own PageHead under the panel's header).
85
90
  const pageTitle = tab === "exposures" ? hc("mine") : tab === "admin" ? hc("admin") : hw(TITLES[tab]);
86
91
  return html`<div data-effect-panel="hub" class=${`panel p-hub p-hub-${tab}`}>
@@ -93,6 +98,7 @@ export function HubPanel({ route }) {
93
98
  export function HubSessionMenu() {
94
99
  const s = useSession();
95
100
  const [busy, setBusy] = useState(false);
101
+ if (s === undefined) return html`<div class="session hub-session"><${Skeleton} variant="inline" lines=${1} /></div>`;
96
102
  if (!s) return html`<div class="session hub-session"><span class="side-row"><span class="dot" aria-hidden="true"></span><span class="grow">${hw("signedOutHub")}</span></span></div>`;
97
103
  const out = async () => { setBusy(true); await hubClient().signOut(); setBusy(false); setSession(null); };
98
104
  // #3226 B: My shared agents and Administration are secondary — in this menu, not the main surface.
@@ -139,7 +145,8 @@ function HubSignIn() {
139
145
  function useRead(read) {
140
146
  const [data, setData] = useState(null);
141
147
  const live = useRef(true);
142
- const reload = () => read().then((r) => { if (live.current) setData(r.ok ? r : { error: errText(r) }); }, () => { if (live.current) setData({ error: hw("errFailed") }); });
148
+ const failed = (error) => { if (live.current) setData((old) => ({ ...old, error })); };
149
+ const reload = () => read().then((r) => { if (live.current) { if (r.ok) setData(r); else failed(errText(r)); } }, () => failed(hw("errFailed")));
143
150
  useEffect(() => { live.current = true; reload(); return () => { live.current = false; }; }, []);
144
151
  return [data, reload];
145
152
  }
@@ -199,8 +206,9 @@ export function HubNav({ onPick } = {}) {
199
206
  <label class="hub-search"><${Icon} name="search" size=${14} /><input type="search" placeholder=${hc("search")} aria-label=${hc("search")} value=${q}
200
207
  onInput=${(e) => setQ(e.target.value)} /></label>
201
208
  <div class="hub-sec">${hc("chats")}</div>
202
- ${rs.error ? html`<p class="err hub-list-err" role="alert">${rs.error}</p>` : null}
203
- ${rs.loaded && !rs.rooms.length ? html`<p class="note hub-list-empty">${hc("noChatsHint")}</p>` : null}
209
+ ${rs.error ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : null}
210
+ ${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
211
+ ${rs.loaded && !rs.error && !rs.rooms.length ? html`<p class="note hub-list-empty">${hc("noChatsHint")}</p>` : null}
204
212
  ${rs.rooms.length && !shown.length ? html`<p class="note hub-list-empty">${hc("noMatch")}</p>` : null}
205
213
  <ul class="hub-rooms" role="list">${shown.map((r) => html`<li key=${r.id}>
206
214
  <a class=${`hub-room-row${current === r.id ? " active" : ""}${r.state === "closed" ? " closed" : ""}`} href=${roomPath(r.id)} aria-current=${current === r.id ? "page" : undefined} onClick=${(e) => pick(e, r)}>
@@ -214,7 +222,7 @@ export function HubNav({ onPick } = {}) {
214
222
 
215
223
  /** New chat: the agents someone allowed this person to ask; Ask opens (or reopens) its room. */
216
224
  function NewChatDialog({ onClose }) {
217
- const [cat] = useRead(() => hubClient().catalog());
225
+ const [cat, reload] = useRead(() => hubClient().catalog());
218
226
  const rs = useStore(roomsStore);
219
227
  const [q, setQ] = useState("");
220
228
  const [msg, setMsg] = useState(null);
@@ -233,7 +241,7 @@ function NewChatDialog({ onClose }) {
233
241
  return html`<${Dialog} title=${hc("pickTitle")} onClose=${onClose}>
234
242
  <div class="hub-pick">
235
243
  <label class="field"><span class="sr-only">${hc("pickSearch")}</span><input type="search" placeholder=${hc("pickSearch")} value=${q} onInput=${(e) => setQ(e.target.value)} /></label>
236
- ${cat && cat.error ? html`<p class="err" role="alert">${cat.error}</p>` : null}
244
+ ${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
237
245
  ${cat && !cat.error && !all.length ? html`<${Empty} icon="chat" title=${hc("pickEmpty")} hint=${hw("askHint")} />` : null}
238
246
  ${all.length && !shown.length ? html`<p class="note">${hc("pickNone")}</p>` : null}
239
247
  <ul class="hub-pick-list" role="list">${shown.map((it) => html`<li key=${it.grant.id} class="hub-pick-row">
@@ -255,11 +263,11 @@ function HubChats() {
255
263
  const id = roomParam();
256
264
  const room = id ? rs.rooms.find((r) => r.id === id) || (rs.loaded ? { id, exposureName: "", ownerName: "", features: [] } : null) : null;
257
265
  if (id && room) return html`<${HubRoomView} key=${id} room=${room} />`;
258
- if (id) return null;
266
+ if (id) return html`<${HubRoomLoading} error=${rs.error} />`;
259
267
  return html`<${PanelHeader} title=${hc("chats")} />
260
268
  <div class="hub-home">
261
269
  <div class="hub-home-list"><${HubNav} /></div>
262
- <div class="hub-home-pick center">${rs.loaded && !rs.rooms.length
270
+ <div class="hub-home-pick center">${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : rs.error && !rs.rooms.length ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : !rs.rooms.length
263
271
  ? html`<${Empty} icon="chat" title=${hc("noChats")} hint=${hc("noChatsHint")} />`
264
272
  : html`<${Empty} icon="chat" title=${hc("choose")} hint=${hc("chooseHint")} />`}</div>
265
273
  </div>`;
@@ -274,6 +282,18 @@ function useWide() {
274
282
  useEffect(() => { const q = wideQuery(); if (!q) return undefined; const on = () => setWide(!!q.matches); q.addEventListener?.("change", on); return () => q.removeEventListener?.("change", on); }, []);
275
283
  return wide;
276
284
  }
285
+ /** The same room frame while its metadata is unknown: reserve the saved context rail and header width. */
286
+ function HubRoomLoading({ error } = {}) {
287
+ const wide = useWide(), [rail, setRail] = useState(railOpen);
288
+ const showRail = wide && rail;
289
+ return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`}>
290
+ <section class="hub-chat-main"><header class="hub-chat-head"><${Skeleton} variant="inline" lines=${1} /></header>
291
+ <div class="scroller hub-scroller hub-room-loading">${error ? html`<${ErrorState} message=${error} onRetry=${refreshRooms} />` : html`<${Skeleton} variant="rows" lines=${6} />`}</div>
292
+ </section>
293
+ ${showRail ? html`<${RailFrame} trust="hub-context" label=${hc("infoLabel")} title=${hc("info")} closeLabel=${hc("hideInfo")}
294
+ onClose=${() => { setRail(false); setRailPref(false); }}><${Skeleton} variant="rows" lines=${4} /></${RailFrame}>` : null}
295
+ </div>`;
296
+ }
277
297
  /** The thread's words are the fleet chat's; its delivery marks say the Hub's stages. */
278
298
  const threadT = (key, ...a) => (key.startsWith("chat.tick_") ? hc(key.slice(5), ...a) : t(key, ...a));
279
299
  const REASONS = { expired: "reason_expired", revoked: "reason_revoked", frozen: "reason_frozen", withdrawn: "reason_withdrawn" };
@@ -290,7 +310,7 @@ function HubRoomView({ room: given }) {
290
310
  useEffect(() => {
291
311
  // The list's "waiting" follows this room: read again when a question starts or stops waiting here.
292
312
  let was = null;
293
- return store.subscribe(() => {
313
+ const update = () => {
294
314
  tick((n) => n + 1);
295
315
  const waiting = store.entries().some((e) => ["queued", "delivered", "consumed"].includes(e.receipt && e.receipt.stage));
296
316
  if (was !== null && waiting !== was) {
@@ -299,7 +319,9 @@ function HubRoomView({ room: given }) {
299
319
  void refreshRooms();
300
320
  }
301
321
  was = waiting;
302
- });
322
+ };
323
+ const off = store.subscribe(update); update();
324
+ return off;
303
325
  }, [store]);
304
326
  // The store's room starts as the list's and is the server's latest after each read (its quota included or withdrawn).
305
327
  const room = store.room();
@@ -308,49 +330,104 @@ function HubRoomView({ room: given }) {
308
330
  const [draft, setDraft] = useState("");
309
331
  const [sending, setSending] = useState(false);
310
332
  const [msg, setMsg] = useState(null);
333
+ // #3226 D: files chosen for the next question (uploaded at once; Send names the uploaded ids).
334
+ const [files, setFilesState] = useState([]);
335
+ const filesRef = useRef([]);
336
+ const setFiles = (next) => { filesRef.current = next; setFilesState(next); };
337
+ // Uploads still queued when the room is left are not started.
338
+ const alive = useRef(true);
339
+ useEffect(() => () => { alive.current = false; }, []);
311
340
  const input = useRef(null);
312
341
  useEffect(() => { setTitle(room.exposureName || hw("askTitle")); }, [room.exposureName]);
342
+ // #3226 E: the side panel for this room's HTML pages (the fleet's panel). Its "Reply about this page" / Point at it
343
+ // lines go into this composer; leaving the room closes it.
344
+ const split = useRef(null), threadRef = useRef(null);
345
+ const panelKey = roomPanelKey(given.id);
346
+ const [panelOpen, setPanelOpen] = useState(() => panelOpenFor(panelKey));
347
+ useEffect(() => { bootHubPreview(); }, []);
348
+ useEffect(() => {
349
+ setPanelOpen(panelOpenFor(panelKey));
350
+ const off = panelStore.subscribe(() => setPanelOpen(panelOpenFor(panelKey)));
351
+ const release = bindRoomFeedback({
352
+ findMsg: (key) => store.messages().find((x) => msgKey(x) === key) || null,
353
+ addLine: (line) => setDraft((d) => draftWithLine(d, line)),
354
+ focus: () => {
355
+ const el = input.current; if (!el) return;
356
+ el.focus();
357
+ setTimeout(() => { try { const n = el.value.length; el.setSelectionRange(n, n); } catch { /* not a text field */ } }, 0);
358
+ },
359
+ });
360
+ return () => { off(); release(); };
361
+ }, [store]);
313
362
  const closed = store.closed() || room.state === "closed";
314
363
  const frozen = !closed && room.exposureState === "frozen";
315
364
  const working = store.working();
316
365
  const name = room.exposureName || "";
366
+ const client = hubClient();
367
+ const pageFiles = pageCarriesFiles(client, store);
368
+ const takesFiles = pageFiles && roomTakesFiles(room) && !closed && !frozen;
369
+ const uploading = files.some((f) => f.state === "uploading");
317
370
  const send = async () => {
318
371
  const q = draft.trim();
319
372
  if (!q || sending || closed || frozen) return;
373
+ if (uploading) { setMsg(hf("waitUpload")); return; }
374
+ // Chosen files are never dropped quietly: while the room can't take them, the question waits (or they are removed).
375
+ const chosen = filesRef.current.filter((f) => f.state === "ready");
376
+ if (chosen.length && !takesFiles) { setMsg(hf("held")); return; }
320
377
  setSending(true); setMsg(null);
321
- const r = await store.send(q);
378
+ const r = await store.send(q, chosen.length ? { files: chosen.map((f) => f.id) } : {});
322
379
  setSending(false);
323
380
  if (!r.ok) { setMsg(errText(r)); return; }
324
- setDraft(""); refreshRooms();
381
+ // Only the files this question carried; ones chosen while it was on its way stay for the next.
382
+ const sent = new Set(chosen.map((f) => f.key));
383
+ setDraft(""); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); refreshRooms();
325
384
  };
385
+ const attach = takesFiles ? { title: hf("attach"), onFiles: async (list) => {
386
+ setMsg(null);
387
+ const refused = await uploadChosen(client, room.id, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
388
+ if (!alive.current) return;
389
+ if (refused.length) setMsg(refused.join(" "));
390
+ } } : null;
326
391
  const onKeyDown = (e) => { if (globalThis.AgendChatRender?.composerKey(e, { touch: touchScreen() }) === "send") { e.preventDefault(); send(); } };
327
- const toggleInfo = () => { if (!wide) { setSheet(true); return; } setRail((v) => { setRailPref(!v); return !v; }); };
392
+ const toggleInfo = () => {
393
+ if (!wide) { setSheet(true); return; }
394
+ // The panel is where the rail was: the info button puts the rail back (and closes the page).
395
+ if (panelOpen) { closePanel(); setRail(true); setRailPref(true); return; }
396
+ setRail((v) => { setRailPref(!v); return !v; });
397
+ };
328
398
  const tag = closed ? html`<span class="tag danger">${hc("tagClosed")}</span>` : frozen ? html`<span class="tag warn">${hc("tagFrozen")}</span>`
329
399
  : html`<${QuotaChip} room=${room} fallback=${html`<span class="tag ok">${hc("tagCanAsk")}</span>`} />`;
330
400
  const back = !wide ? html`<a class="icon-btn hub-back" href="/ui/hub" aria-label=${hc("back")} title=${hc("back")}><${Icon} name="back" /></a>` : null;
331
401
  const info = html`<${HubRoomInfo} room=${room} closed=${closed} />`;
332
- return html`<div class=${`hub-chat${wide && rail ? " with-rail" : ""}`}>
402
+ // The panel takes the info rail's place while it shows a page (the rail's button brings the rail back).
403
+ const showRail = wide && rail && !panelOpen;
404
+ return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`} ref=${split}>
333
405
  <section class="hub-chat-main" aria-label=${name}>
334
406
  <header class="hub-chat-head" data-trust="panel-content">${back}<${Avatar} name=${name} size="sm" />
335
407
  <span class="hub-chat-title"><strong>${name}</strong><span class="s">${room.ownerName ? hc("answersFor", room.ownerName) : ""}</span></span>
336
408
  ${tag}
337
- <button type="button" class="icon-btn" aria-pressed=${wide ? String(rail) : undefined} aria-label=${hc("showInfo")} title=${hc("showInfo")} onClick=${toggleInfo}><${Icon} name="info" /></button>
409
+ <button type="button" class="icon-btn" aria-pressed=${wide ? String(showRail) : undefined} aria-label=${hc("showInfo")} title=${hc("showInfo")} onClick=${toggleInfo}><${Icon} name="info" /></button>
338
410
  </header>
339
- <${HubThread} store=${store} name=${name} />
411
+ <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
340
412
  <div class="dock hub-dock" data-trust="composer"><div class="dock-col">
341
413
  ${closed ? html`<p class="hub-banner danger" role="status">${hc("closed")}</p>` : null}
342
414
  ${frozen ? html`<p class="hub-banner warn" role="status">${hc("frozen", name)}</p>` : null}
343
415
  ${!closed ? html`<${QuotaBanner} room=${room} />` : null}
344
416
  ${working ? html`<${HubWorkBar} name=${name} since=${working.since} />` : null}
417
+ ${!closed && !frozen && !takesFiles ? html`<p class="note hub-files-off" role="status">${hf(pageFiles ? "off" : "reload")}</p>` : null}
345
418
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
346
- ${closed ? null : html`<div class="composer-box"><${ComposerInput} inputRef=${input} value=${draft} placeholder=${hc("composer", name)} onValue=${setDraft}
347
- onKeyDown=${onKeyDown} onPaste=${() => {}} attach=${null}
419
+ ${closed ? null : html`<div class="composer-box"><${PendingFiles} files=${files} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
420
+ formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />
421
+ <${ComposerInput} inputRef=${input} value=${draft} placeholder=${hc("composer", name)} onValue=${setDraft}
422
+ onKeyDown=${onKeyDown} onPaste=${() => {}} attach=${attach}
348
423
  stop=${{ hidden: true, disabled: true, title: hc("stop"), label: hc("stop"), onClick: () => {} }}
349
- send=${{ hidden: false, disabled: !draft.trim() || sending || frozen, label: hc("send"), onClick: send }} /></div>`}
424
+ send=${{ hidden: false, disabled: !draft.trim() || sending || frozen || uploading, label: hc("send"), onClick: send }} /></div>`}
350
425
  ${closed ? null : html`<div class="composer-row"><span class="hint hub-identity">${hw("roomNote")}</span></div>`}
351
426
  </div></div>
352
427
  </section>
353
- ${wide && rail ? html`<${RailFrame} trust="hub-context" label=${hc("infoLabel")} title=${hc("info")} closeLabel=${hc("hideInfo")}
428
+ <${PreviewPanel} name=${panelKey} split=${split} msgs=${() => store.messages()} subscribe=${(fn) => store.subscribe(() => fn(panelKey, "msgs"))}
429
+ keyOf=${msgKey} reveal=${(k) => threadRef.current && threadRef.current.reveal(k)} download=${downloadHtml} allow=${(commit) => setHubPreviewOptIn(true, commit)} />
430
+ ${showRail ? html`<${RailFrame} trust="hub-context" label=${hc("infoLabel")} title=${hc("info")} closeLabel=${hc("hideInfo")}
354
431
  onClose=${() => { setRail(false); setRailPref(false); }}>${info}</${RailFrame}>` : null}
355
432
  ${!wide && sheet ? html`<${Dialog} title=${hc("info")} label=${hc("infoLabel")} onClose=${() => setSheet(false)}><div class="hub-rail-sheet">${info}</div></${Dialog}>` : null}
356
433
  </div>`;
@@ -364,18 +441,21 @@ function HubWorkBar({ name, since }) {
364
441
  }
365
442
 
366
443
  /** The thread: the fleet chat's own (createThread), fed by the room's store. */
367
- function HubThread({ store, name }) {
444
+ function HubThread({ store, name, panelKey, threadRef }) {
368
445
  const scroller = useRef(null), host = useRef(null);
369
446
  const [jump, setJump] = useState({ show: false, unseen: 0 });
370
447
  const [empty, setEmpty] = useState(false);
371
448
  const th = useRef(null);
449
+ const loaded = typeof store.loaded === "function" ? store.loaded() : true;
372
450
  useLayoutEffect(() => {
373
451
  const doc = host.current.ownerDocument;
374
452
  const list = doc.createElement("div");
375
453
  list.className = "thread"; list.setAttribute("role", "log"); list.setAttribute("aria-live", "off"); list.setAttribute("aria-label", name);
376
454
  const thread = createThread(list, doc.createElement("div"), {
377
455
  t: threadT, tf: threadT, isUser: (x) => x.role === "user", onJump: setJump, onEmpty: setEmpty, canReply: () => false,
378
- setPreviewOptIn: () => {}, copyText, download: () => {}, toggleWrap: () => {}, notice: (text) => toast(text, false),
456
+ // #3226 E: an HTML page opens in the room's side panel, at the Hub's own preview address (hub-preview.js).
457
+ setPreviewOptIn: setHubPreviewOptIn, copyText, download: downloadHtml, toggleWrap: () => {}, notice: (text) => toast(text, false),
458
+ panel: roomPanelOpts(panelKey),
379
459
  clickReplyButton: (id, index) => { void store.clickButton(id, index).then((r) => {
380
460
  if (!r.ok && r.code !== "busy" && r.code !== "stopped") { toast(errText(r), false); store.refresh(); }
381
461
  }); },
@@ -384,20 +464,30 @@ function HubThread({ store, name }) {
384
464
  emojis: () => false, mentions: () => null,
385
465
  });
386
466
  th.current = thread;
467
+ if (threadRef) threadRef.current = thread;
387
468
  host.current.append(list);
388
469
  thread.attach(scroller.current);
389
470
  thread.render(store.messages());
390
471
  const off = store.subscribe(() => thread.render(store.messages()));
472
+ // A card shows whether this browser allows previews and whether the panel has its page.
473
+ const P = globalThis.AgendPreview;
474
+ const offOpt = P && typeof P.onChange === "function" ? P.onChange(() => thread.refreshCards()) : () => {};
475
+ const offPanel = panelStore.subscribe(() => thread.refreshCards());
391
476
  const sc = scroller.current;
392
477
  const onScroll = () => thread.onScroll();
393
478
  sc.addEventListener("scroll", onScroll, { passive: true });
394
479
  list.addEventListener("click", thread.onClick);
395
- return () => { off(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick); thread.dispose(true); list.remove(); th.current = null; };
480
+ return () => {
481
+ off(); offOpt(); offPanel(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick);
482
+ thread.dispose(true); list.remove(); th.current = null; if (threadRef && threadRef.current === thread) threadRef.current = null;
483
+ };
396
484
  }, [store]);
397
485
  return html`<div class="scroller hub-scroller" ref=${scroller}>
398
486
  <div class="thread-host" ref=${host}></div>
399
487
  ${/* #3145: that every asker shares the agent's one conversation is said before anyone types. */ ""}
400
- ${empty ? html`<div class="center hub-room-empty"><${Empty} icon="chat" title=${hc("emptyRoom", name)} hint=${`${hc("emptyRoomHint", store.room().ownerName || name)}${lang() === "zh-TW" ? "" : " "}${hw("roomShared")}`} /></div>` : null}
488
+ ${!loaded && !store.error() && !store.closed() ? html`<${Skeleton} variant="rows" lines=${5} />` : null}
489
+ ${!loaded && store.error() ? html`<${ErrorState} message=${errText({ code: store.error() })} onRetry=${() => store.refresh()} />` : null}
490
+ ${empty && loaded && !store.closed() ? html`<div class="center hub-room-empty"><${Empty} icon="chat" title=${hc("emptyRoom", name)} hint=${`${hc("emptyRoomHint", store.room().ownerName || name)}${lang() === "zh-TW" ? "" : " "}${hw("roomShared")}`} /></div>` : null}
401
491
  <div class="jump-dock">${jump.show ? html`<button data-trust="thread-control" type="button" class="jump-latest" onClick=${() => th.current && th.current.jumpLatest()}>
402
492
  <${Icon} name="down" size=${16} />${jump.unseen > 0 ? t("chat.newBelow", jump.unseen) : t("chat.jumpLatest")}</button>` : null}</div>
403
493
  </div>`;
@@ -469,12 +559,13 @@ function HubMine() {
469
559
  return html`<div class="col hub-owner"><${PageHead} title=${hc("mine")} scope=${ho("scopeYou")} lead=${ho("mineLead")} />
470
560
  <div class="s-section-layout">
471
561
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
562
+ ${!pairings ? html`<${Skeleton} lines=${2} />` : pairings.error ? html`<${ErrorState} message=${pairings.error} onRetry=${reloadPairings} />` : null}
472
563
  ${pend.length ? html`<section class="card hub-pairings"><h3>${ho("pendingPairings")}</h3><p class="note">${ho("pendingLead")}</p>
473
564
  <div class="hub-rows">${pend.map((p) => html`<div key=${p.id} class="s-row hub-row">
474
565
  <span class="hub-row-text"><code class="hub-fp-groups">${compareGroups(p.fingerprint)}</code><small class="note">${hw("expires", when(p.expiresAt))}</small></span>
475
566
  ${p.ownerConfirmed ? html`<span class="tag ok">${hw("confirmed")}</span>` : html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => confirmPairing(p)}>${hw("confirmPairing")}</button>`}
476
567
  </div>`)}</div></section>` : null}
477
- ${cat && cat.error ? html`<p class="err" role="alert">${cat.error}</p>` : null}
568
+ ${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
478
569
  ${cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
479
570
  ${mine.length ? html`<section class="card hub-shared"><h3>${ho("sharedCount", mine.length)}</h3>
480
571
  <div class="hub-rows">${mine.map((e) => html`<a key=${e.id} class="s-row hub-row hub-row-link" href=${`/ui/hub/exposures?agent=${encodeURIComponent(e.id)}`}>
@@ -513,7 +604,7 @@ function HubAgentPage({ x, act, msg }) {
513
604
  </section>
514
605
  <${QuotaVisibilityRow} exposure=${x} onSaved=${() => act(async () => ({ ok: true }))} />
515
606
  <section class="card"><h3>${ho("recent")}</h3><p class="note">${ho("recentLead")}</p>
516
- ${activity && activity.error ? html`<p class="err" role="alert">${activity.error}</p>` : null}
607
+ ${!activity ? html`<${Skeleton} variant="rows" lines=${3} />` : activity.error ? html`<${ErrorState} message=${activity.error} onRetry=${reloadActivity} />` : null}
517
608
  ${activity && !activity.error && !acts.length ? html`<p class="note">${ho("recentNone")}</p>` : null}
518
609
  ${acts.length ? html`<div class="hub-rows">${acts.map((a, i) => html`<div key=${i} class="s-row hub-row">
519
610
  <${Avatar} name=${a.askerName || "?"} size="sm" /><span class="hub-row-text"><strong>${a.askerName || "—"}</strong><small class="note">${when(a.askedAt)}</small></span>${stageWord(a.stage)}
@@ -582,9 +673,13 @@ function HubAdminPage() {
582
673
  if (!r.ok) setMsg(errText(r));
583
674
  reload();
584
675
  };
585
- const fleets = view && view.fleets ? view.fleets : [], pairings = view && view.pairings ? view.pairings : [];
676
+ if (!view || (view.error && !view.fleets)) return html`<div class="col hub-owner hub-admin"><${PageHead} title=${hc("admin")} scope=${ho("scopeHub")} lead=${ho("adminLead")} />
677
+ <div class="s-section-layout">${view?.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />`
678
+ : html`<section class="card"><h3>${ho("pairSteps")}</h3><${Skeleton} variant="rows" lines=${3} /></section><section class="card"><${Skeleton} variant="rows" lines=${3} /></section>`}</div></div>`;
679
+ const fleets = view.fleets || [], pairings = view.pairings || [];
586
680
  return html`<div class="col hub-owner hub-admin"><${PageHead} title=${hc("admin")} scope=${ho("scopeHub")} lead=${ho("adminLead")} />
587
681
  <div class="s-section-layout">
682
+ ${view.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />` : null}
588
683
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
589
684
  <section class="card"><h3>${ho("pairSteps")}</h3>
590
685
  <ol class="hub-steps">
@@ -19,18 +19,19 @@ import { useLease } from "/assets/app-ctx.js";
19
19
  import { PanelHeader, setTitle } from "/assets/app-shell.js";
20
20
  import { chatPath } from "/assets/app-route.js";
21
21
  import { namesOf, namesStore } from "/assets/instance-nav.js";
22
- import { Empty } from "/assets/ui-states.js";
22
+ import { Empty, Skeleton } from "/assets/ui-states.js";
23
23
  import { Icon } from "/assets/ui-icons.js";
24
24
  import { toast } from "/assets/ui-toast.js";
25
25
  import { notifyStore, notifySupport, configDetail, reasonText, refreshNotify, setNotify } from "/assets/app-needs.js";
26
26
  import { openSignIn, signInOffered } from "./backend-signin.js";
27
27
  import { decideProposal, installProposals } from "./agent-proposals.js";
28
28
  import { GeneralLocation } from "./general-location.js";
29
+ import { runtimeUpdateText } from "./runtime-update-status.js";
29
30
 
30
31
  // A pre-upgrade tab retains app-i18n.js. Register these reasons when the updated panel is loaded, too.
31
32
  register("app", {
32
- en: { needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running" },
33
- "zh-TW": { needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行" },
33
+ en: { needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_tmux_hold: "Held: an old tmux server or window" },
34
+ "zh-TW": { needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_tmux_hold: "已暫停:舊的 tmux 伺服器或視窗" },
34
35
  });
35
36
 
36
37
  register("needs", {
@@ -88,6 +89,7 @@ register("needs", {
88
89
  const tn = (k, ...v) => t(`needs.${k}`, ...v);
89
90
  /** Stale shells keep the old app-i18n.js; a missing key would otherwise show as app.needs_reason_*. */
90
91
  function itemReason(item) {
92
+ if (item.runtimeUpdate) return runtimeUpdateText("attention");
91
93
  const text = reasonText(item);
92
94
  if (typeof text === "string" && text.startsWith("app.needs_reason_") && (item.type === "missed" || item.reason === "missed_offline")) {
93
95
  return tn("typeMissed");
@@ -174,7 +176,7 @@ export const decisions = createStore({});
174
176
 
175
177
  export function NeedsPanel({ navKey }) {
176
178
  const lease = useLease(navKey);
177
- const { needs, chatOwner: owner, instances, connections, proposals } = useStore(appStore);
179
+ const { ready, needsLoaded, needs, chatOwner: owner, instances, connections, proposals } = useStore(appStore);
178
180
  // A tab opened before an upgrade has this panel but not the app.js that installs the list (it never set `proposals`):
179
181
  // install it here then. On a current page app.js already did, and this panel reads nothing itself (#1374).
180
182
  useEffect(() => { if (appStore.get().proposals === undefined) installProposals(); }, []);
@@ -193,7 +195,9 @@ export function NeedsPanel({ navKey }) {
193
195
  useEffect(() => { lease.interval(() => tick((n) => n + 1), 30_000); }, [lease]);
194
196
  // The chat store owns a prompt's busy/answered state; redraw when it changes (and when it arrives).
195
197
  useEffect(() => { if (owner) return owner.subscribe(() => tick((n) => n + 1)); return undefined; }, [owner, lease]);
196
- const groups = groupNeeds(items);
198
+ const updates = items.filter(item => item.runtimeUpdate);
199
+ const groups = groupNeeds(items.filter(item => !item.runtimeUpdate));
200
+ if (updates.length) groups.push({ instance: "", items: updates });
197
201
  const nowMs = Date.now();
198
202
  return html`<div data-effect-panel="needs" class="panel p-needs">
199
203
  <${PanelHeader} title=${tn("title")} sub=${items.length + asks.length ? t("app.needsCount", items.length + asks.length) : null} />
@@ -203,9 +207,10 @@ export function NeedsPanel({ navKey }) {
203
207
  ${asks.map((p) => html`<${ProposalItem} key=${p.id} proposal=${p} nowMs=${nowMs} />`)}
204
208
  ${decidedHere.map(([id, d]) => html`<${ProposalResult} key=${id} result=${d} />`)}
205
209
  </section>` : null}
206
- ${!items.length && !asks.length && !decidedHere.length ? html`<${Empty} icon="check" title=${tn("empty")} hint=${tn(chatApp ? "emptyHint" : "emptyHintWeb")} />`
207
- : groups.map((g) => html`<section key=${JSON.stringify([g.instance, g.items[0]?.type === "config"])} class="n-group" aria-label=${g.instance}>
208
- <h2 class="n-group-head">${g.instance ? html`<a href=${chatPath(g.instance)} title=${g.instance}>${nameFor(g.instance)}</a>` : g.items[0]?.type === "config" ? t("app.settings") : tn(g.items.some(i => i.type === "backend") ? "fleetSignIns" : "noAssignee")}</h2>
210
+ ${(!ready || needsLoaded === false) && !items.length && !asks.length ? html`<${Skeleton} variant="rows" lines=${3} />`
211
+ : !items.length && !asks.length && !decidedHere.length ? html`<${Empty} icon="check" title=${tn("empty")} hint=${tn(chatApp ? "emptyHint" : "emptyHintWeb")} />`
212
+ : groups.map((g) => html`<section key=${JSON.stringify([g.instance, g.items[0]?.type === "config", !!g.items[0]?.runtimeUpdate])} class="n-group" aria-label=${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance}>
213
+ <h2 class="n-group-head">${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance ? html`<a href=${chatPath(g.instance)} title=${g.instance}>${nameFor(g.instance)}</a>` : g.items[0]?.type === "config" ? t("app.settings") : tn(g.items.some(i => i.type === "backend") ? "fleetSignIns" : "noAssignee")}</h2>
209
214
  ${g.items.map((item) => html`<${NeedsItem} key=${item.id} item=${item} nowMs=${nowMs} owner=${owner} />`)}
210
215
  </section>`)}
211
216
  <${NotifyToggle} />
@@ -266,6 +271,7 @@ function NeedsItem({ item, nowMs, owner }) {
266
271
  <${Icon} name="check" size=${14} />${ack === "busy" ? tn("acknowledging") : tn("acknowledge")}</button>` : null}
267
272
  ${(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}
268
273
  ${item.type === "task" && item.card ? html`<a class="btn btn-sm" href=${`/ui/fleet?card=${encodeURIComponent(item.card.code)}`}>${tn("openCard")}</a>` : null}
274
+ ${item.runtimeUpdate ? html`<a class="btn btn-sm" href="/settings/runtimes">${runtimeUpdateText("open")}</a>` : null}
269
275
  ${item.kiroChoice === true ? html`<a class="btn btn-sm" href="https://github.com/songsid/AgEnD/blob/main/src/general-knowledge/skills/kiro-engine-migration/SKILL.md" target="_blank" rel="noopener noreferrer">${tn("kiroMigration")}</a>` : null}
270
276
  ${item.instance ? html`<a class="btn btn-sm btn-ghost" href=${chatPath(item.instance)}>${tn(item.kiroChoice === true ? "kiroOpen" : "open")}</a>` : null}
271
277
  </div>
@@ -8,7 +8,7 @@ import { appStore, applyNoticesSeen, useStore } from "/assets/app-store.js";
8
8
  import { useLease } from "/assets/app-ctx.js";
9
9
  import { PanelHeader, setTitle } from "/assets/app-shell.js";
10
10
  import { chatPath } from "/assets/app-route.js";
11
- import { Empty } from "/assets/ui-states.js";
11
+ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
12
12
  import { Icon } from "/assets/ui-icons.js";
13
13
 
14
14
  register("notices", {
@@ -64,7 +64,7 @@ function markShown() {
64
64
 
65
65
  export function NoticesPanel({ navKey }) {
66
66
  const lease = useLease(navKey);
67
- const { notices, instances } = useStore(appStore);
67
+ const { notices, noticesError, instances, connections } = useStore(appStore);
68
68
  const items = notices && Array.isArray(notices.items) ? notices.items : [];
69
69
  // What was unread when the page opened stays marked "New" while it is open (it is marked read on the server at once).
70
70
  const [seenAtOpen] = useState(() => (notices ? notices.seen | 0 : 0));
@@ -82,7 +82,8 @@ export function NoticesPanel({ navKey }) {
82
82
  <${PanelHeader} title=${tn("title")} />
83
83
  <div data-trust="panel-content" class="panel-body"><div class="col">
84
84
  ${items.length ? html`<p class="note notice-sub">${tn("sub")}</p>` : null}
85
- ${!items.length ? html`<${Empty} icon="bell" title=${tn("empty")} hint=${tn("emptyHint")} />`
85
+ ${!notices && noticesError ? html`<${ErrorState} onRetry=${() => appStore.get().readNotices?.()} />`
86
+ : !notices && (connections == null || connections === 0) ? html`<${Skeleton} variant="rows" lines=${3} />` : !items.length ? html`<${Empty} icon="bell" title=${tn("empty")} hint=${tn("emptyHint")} />`
86
87
  : items.map((n) => html`<article key=${n.id} class=${`n-item notice${n.id > seenAtOpen ? " unread" : ""}${n.kind === "fleet" ? " bad" : ""}`}>
87
88
  <span class="n-icon"><${Icon} name=${ICON[n.kind] || "info"} size=${18} /></span>
88
89
  <div class="n-body">
@@ -2,6 +2,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
2
  import { register, t } from "/assets/app-i18n.js";
3
3
  import { useLease } from "/assets/app-ctx.js";
4
4
  import { Icon } from "/assets/ui-icons.js";
5
+ import { Skeleton } from "/assets/ui-states.js";
5
6
  import { Dialog } from "/assets/ui-dialog.js";
6
7
  import { Menu } from "/assets/ui-menu.js";
7
8
  import { appStore, useStore } from "/assets/app-store.js";
@@ -11,8 +12,10 @@ import { CliProductMark, cliLabel } from "./cli-picker.js";
11
12
  import { WindowsCliPanel } from "./panel-windows-cli.js";
12
13
  import { useRuntimeCatalog } from "./runtime-catalog.js";
13
14
  import { runtimeConnectCommand, runtimeInstallCommand, runtimeWindowsConnectCommand } from "./runtime-commands.js";
15
+ import { RuntimeUpdateNotice, runtimeUpdateText, runtimeFreshInstallCommand } from "./runtime-update-status.js";
14
16
  import { credentialProfileView, credentialProfileState } from "./credential-profile-select.js";
15
17
  import { identityText } from "./account-identity.js";
18
+ import { CliInstall, offersCliInstall } from "./runtime-cli-install.js";
16
19
  import { useWindowsCliCatalog, refreshWindowsCliCatalog, useWindowsCliCatalogSnapshot } from "./windows-cli-catalog.js";
17
20
 
18
21
  /** The install tabs', command cards' and account list's stylesheet, linked once by this lazy page (a tab opened before an upgrade has an app.css without these rules). */
@@ -156,7 +159,7 @@ function paneVerificationTag(cli, text) {
156
159
  return key ? html`<span class="tag" title=${text(`${key}Hint`)}>${text(key)}</span>` : null;
157
160
  }
158
161
  export function machineTime(value) { const date=new Date(value); return value && Number.isFinite(date.getTime()) ? date.toLocaleString() : machineText("unknown"); }
159
- function MachineCard({ machine, busy, action, openDiagnostics, probe }) {
162
+ function MachineCard({ machine, busy, action, openDiagnostics, probe, repairUpdate, lease, onChanged }) {
160
163
  const [editing,setEditing] = useState(false), [name,setName] = useState(machine.name), [info,setInfo] = useState(false);
161
164
  const detection = useWindowsCliCatalogSnapshot(machine.isLocal ? "" : machine.id);
162
165
  const probing = machine.probing || detection.loading;
@@ -169,10 +172,12 @@ function MachineCard({ machine, busy, action, openDiagnostics, probe }) {
169
172
  return html`<article class=${`runtime-machine${local ? " runtime-native-local" : ""}${revoked ? " is-revoked" : ""}`} data-machine-id=${local ? "local" : machine.id}>
170
173
  <header><span class="runtime-machine-icon"><${Icon} name="fleet" size=${22} /></span><div><h3>${machine.name}${revoked ? null : html`<span class="runtime-kind">${machineText(local ? "localBadge" : "pairedBadge")}</span>`}</h3><p>${machine.platform === "win32" ? "Windows" : machine.platform || machineText("unknown")}${machine.hostname && machine.hostname !== machine.name ? ` · ${machine.hostname}` : ""} · ${machineText("cliCount",clis.length)}</p></div><span class=${`runtime-status is-${status}`}><span class="windows-cli-dot"></span>${machineText(["available","online","offline","pending","revoked"].includes(status) ? status : "unknown")}</span></header>
171
174
  ${!local && !revoked && machine.runtimeCompatibility === "incompatible" ? html`<p class="runtime-reinstall" role="alert">${machineText("needsReinstall")}</p>` : null}
175
+ ${!local && !revoked && status !== "pending" ? html`<${RuntimeUpdateNotice} machine=${machine} onRepair=${() => repairUpdate(machine)} />` : null}
172
176
  ${revoked ? null : html`<p class="runtime-inventory-time note">${machine.inventoryUpdatedAt ? machineText("inventoryAt",machineTime(machine.inventoryUpdatedAt)) : machineText("neverDetected")}</p>`}
173
177
  ${status === "pending" ? html`<div class="runtime-approval"><p>${machineText("fingerprintLabel")}<code class="runtime-pairing-fingerprint">${machine.pairingFingerprint || machineText("unknown")}</code></p><p class="note">${machineText("approvalHint")}</p></div>` : null}
174
178
  ${revoked ? html`<p class="note runtime-revoked-note" role="status">${machineText("revokedNote")}</p>` : clis.length ? html`<table class="runtime-cli-table" aria-label=${machineText("cli")}><thead><tr><th>${machineText("cli")}</th><th>${machineText("versionColumn")}</th><th>${machineText("signInColumn")}</th></tr></thead><tbody>${clis.map(cli=>html`<tr key=${cli.id}><td><span class="runtime-cli-product"><${CliProductMark} id=${cli.id} size=${21} /><strong>${cliLabel(cli.id)}</strong></span>${cli.supports?.execution === false ? html`<small>${machineText("detectionOnly")}</small>` : null}</td><td><span class="runtime-cli-version" title=${cli.version || ""}>${cli.version || "—"}</span>${paneVerificationTag(cli,machineText)}</td><td><span class=${`runtime-cli-auth ${cli.authenticated === true ? "is-signed-in" : ""}`}><span class="windows-cli-dot"></span>${machineText(cli.authenticated === true ? "signedIn" : cli.authenticated === false ? "signedOut" : "authShort")}</span>${cli.authenticated === true && identityText(cli.identity) ? html`<small class="runtime-account" data-account="default">${identityText(cli.identity)}</small>` : null}</td></tr>`)}</tbody></table>` : html`<p class="note runtime-no-clis">${machineText(local ? "noLocalClis" : "noClis")}</p>`}
175
179
  ${!local && !revoked && status !== "pending" ? html`<${CredentialProfiles} machine=${machine} />` : null}
180
+ ${offersCliInstall(machine) && lease ? html`<${CliInstall} machine=${machine} lease=${lease} onChanged=${onChanged} />` : null}
176
181
  <div class="runtime-machine-actions">${ready ? html`<button type="button" class="btn btn-sm runtime-inspect" onClick=${() => openDiagnostics(local ? "" : machine.id)}>${machineText("diagnosticTitle")}</button><button type="button" class="btn btn-sm runtime-probe" disabled=${busy || probing || !local && status !== "online"} onClick=${() => probe(local ? "" : machine.id)}><${Icon} name="restart" size=${14} cls=${probing ? "out-spin" : ""} />${machineText(probing ? "probeBusy" : "probeAgain")}</button>` : null}
177
182
  ${status === "pending" ? html`<button type="button" class="btn btn-primary btn-sm" disabled=${busy || !machine.pairingFingerprint} onClick=${() => action(machine,"approve",{fingerprint:machine.pairingFingerprint})}>${machineText("approve")}</button>` : null}
178
183
  <${Menu} cls="runtime-machine-menu" label=${machineText("machineActions",machine.name)} disabled=${busy} items=${menuItems} />
@@ -255,6 +260,8 @@ function RuntimeSwitches({ lease, onChanged, computers }) {
255
260
  <p>${machineText("guidePair")}</p><p>${machineText("guideApprove")}</p>
256
261
  <a class="runtime-guide-link" href=${RUNTIME_DOCS} target="_blank" rel="noopener noreferrer">${machineText("remoteRuntimeDocs")}<${Icon} name="external" size=${14} /></a>
257
262
  </details><p class="note">${machineText("connectionNote")}</p></details>`;
263
+ if (!view && !unavailable) return html`<div class="runtime-layout"><div class="runtime-main">${computers}<section class="runtime-switches" aria-label=${machineText("switches")}><h3>${machineText("switches")}</h3>
264
+ ${error ? html`<p role="alert">${error}</p><button type="button" class="btn btn-sm" onClick=${() => { setError(""); load().catch(e => { if (lease.current()) setError(machineText("switchFailed", e.message)); }); }}>${machineText("retry")}</button>` : html`<${Skeleton} variant="rows" lines=${3} />`}</section></div></div>`;
258
265
  if (unavailable) return html`<div class="runtime-layout"><div class="runtime-main">${computers}<section class="runtime-switches" aria-label=${machineText("switches")}><div class="runtime-switches-main"><h3>${machineText("switches")}</h3><p class="note">${machineText("switchesUnavailable")}</p></div></section></div></div>`;
259
266
  return html`<div class="runtime-layout"><div class="runtime-main">${computers}<section class="runtime-switches" aria-label=${machineText("switches")}>
260
267
  <details class="runtime-policy s-ui-disclosure"><summary><${Icon} name="settings" size=${22} /><span><strong>${machineText("policies")}</strong><small>${machineText("policySummary")}</small></span></summary>
@@ -295,6 +302,7 @@ export function RuntimesPanel({navKey}) {
295
302
  const [tab,setTab]=useState("windows"), [copiedCommand,setCopiedCommand]=useState(""), [installCopied,setInstallCopied]=useState(false);
296
303
  // The administrator-only report of install.ps1's SHA-256 (what the server sends); the install command pins it.
297
304
  const [installer,setInstaller]=useState({status:"idle",sha:"",version:""});
305
+ const [repairMachine,setRepairMachine]=useState(null);
298
306
  const [diagnosticMachineId,setDiagnosticMachineId]=useState(null);
299
307
  // Computers revoked on this page stay on screen as revoked until the page is left or reloaded; the server keeps the record.
300
308
  const [revokedHere,setRevokedHere]=useState(() => new Map());
@@ -316,7 +324,7 @@ export function RuntimesPanel({navKey}) {
316
324
  else setInstaller({status:"error",sha:"",version:""});
317
325
  } catch { if(lease.current())setInstaller({status:"error",sha:"",version:""}); }
318
326
  };
319
- useEffect(() => { if (pairing && installer.status === "idle") void loadInstaller(); },[pairing,installer.status]);
327
+ useEffect(() => { if ((pairing || repairMachine) && installer.status === "idle") void loadInstaller(); },[pairing,repairMachine,installer.status]);
320
328
  const post=async(path,body={}) => {
321
329
  const response=await lease.fetch(path,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)});
322
330
  const value=await response.json();
@@ -395,7 +403,7 @@ export function RuntimesPanel({navKey}) {
395
403
  const approveStep=step(4,machineText("stepApprove"),html`<p class="note">${machineText("stepApproveHint")}</p>`);
396
404
  const windowsSteps=html`${addressStep}
397
405
  ${step(2,machineText("stepInstall"),html`<p class="note">${machineText("stepInstallHint")}</p>
398
- ${installer.status === "loading" || installer.status === "idle" ? html`<p class="note" role="status" aria-busy="true"><span class="out-spin" aria-hidden="true"></span> ${machineText("installerLoading")}</p>` : null}
406
+ ${installer.status === "loading" || installer.status === "idle" ? html`<${Skeleton} lines=${3} label=${machineText("installerLoading")} />` : null}
399
407
  ${installer.status === "error" ? html`<p class="runtime-installer-error" role="alert">${machineText("installerUnavailable")} <button type="button" class="btn btn-ghost btn-sm" onClick=${() => void loadInstaller()}>${machineText("installerRetry")}</button></p>` : null}
400
408
  ${installCommand ? html`${commandCard("install",machineText("installCommand"),installCommand)}<p class="note runtime-installer-hash">${machineText("installerHash")} <code>${installer.sha}</code></p><p class="note">${machineText("tlsHelp")}</p><p class="note">${machineText("restrictedHelp")}</p>` : null}`)}
401
409
  ${step(3,machineText("stepConnect"),html`<p class="note">${machineText("stepConnectHint")}</p>${windowsConnectCommand ? commandCard("connect",machineText("connectCommand"),windowsConnectCommand) : null}`)}
@@ -405,15 +413,20 @@ export function RuntimesPanel({navKey}) {
405
413
  ${step(3,machineText("stepLaunch"),html`<p class="note">${machineText("stepLaunchHint")}</p>${command ? html`<details class="runtime-manual-command"><summary>${machineText("manualCommand")}</summary><label><span>${machineText("command")}</span><input class="runtime-command" value=${command} readOnly=${true} spellcheck=${false} /></label><p class="note">${machineText("manualMultiHint")}</p></details>` : null}`)}
406
414
  ${approveStep}`;
407
415
 
408
- const computers = html`<section class="runtime-computers"><div class="runtime-computers-heading"><h3>${machineText("computersTitle")}</h3><span class="note">${machineText("machineCount",allMachines.length)}</span></div>
409
- <section class="runtime-machines" aria-label=${machineText("machines")}>${allMachines.map(machine=>html`<${MachineCard} key=${machine.isLocal ? "local" : machine.id} machine=${machine} busy=${!!busy || !!machine.probing} action=${action} openDiagnostics=${openDiagnostics} probe=${probeTarget} />`)}</section>
416
+ const computers = html`<section class="runtime-computers"><div class="runtime-computers-heading"><h3>${machineText("computersTitle")}</h3><div class="note">${state.data ? machineText("machineCount",allMachines.length) : !state.error ? html`<${Skeleton} variant="inline" lines=${1} />` : "—"}</div></div>
417
+ <section class="runtime-machines" aria-label=${machineText("machines")}>${!state.data && !state.error ? html`<${Skeleton} variant="cards" lines=${2} label=${machineText("loading")} />` : allMachines.map(machine=>html`<${MachineCard} key=${machine.isLocal ? "local" : machine.id} lease=${lease} onChanged=${state.refresh} machine=${machine} busy=${!!busy || !!machine.probing} action=${action} openDiagnostics=${openDiagnostics} probe=${probeTarget} repairUpdate=${setRepairMachine} />`)}</section>
418
+ ${repairMachine ? html`<${Dialog} title=${runtimeUpdateText("repairTitle")} onClose=${() => setRepairMachine(null)}>
419
+ <p>${runtimeUpdateText("repairHint")}</p>
420
+ ${installer.status === "idle" || installer.status === "loading" ? html`<${Skeleton} lines=${3} label=${machineText("installerLoading")} />` : null}
421
+ ${installer.status === "error" ? html`<p role="alert">${machineText("installerUnavailable")} <button class="btn btn-sm" onClick=${() => void loadInstaller()}>${machineText("installerRetry")}</button></p>` : null}
422
+ ${installer.status === "ready" ? commandCard("update-repair",machineText("installCommand"),runtimeFreshInstallCommand(typeof location === "undefined" ? "" : location.origin,installer.sha)) : null}
423
+ </${Dialog}>` : null}
410
424
  ${state.data && !allMachines.some(machine=>!machine.isLocal) ? html`<p class="note runtime-empty-remotes">${machineText("empty")}</p>` : null}
411
425
  <article class="runtime-host-note"><${Icon} name="info" size=${18} /><span>${machineText("hostLocationNote")}</span></article></section>`;
412
426
 
413
427
  return html`<section class="runtime-settings">
414
428
  <header class="runtime-heading s-page-head"><div><h2>${machineText("title")}<span class="s-scope">${machineText("fleetScope")}</span></h2><p class="s-page-lead">${machineText("lead")}</p></div><div><button type="button" class="btn btn-primary btn-sm" disabled=${!!busy || state.data?.enabled !== true} onClick=${connect}><${Icon} name="plus" size=${15} />${machineText("connect")}</button>${state.data?.enabled === true && !pairing ? download(true) : null}<button type="button" class="btn btn-sm" disabled=${state.loading} onClick=${state.refresh}><${Icon} name="restart" size=${15} />${machineText("refresh")}</button></div></header>
415
429
  ${state.data?.enabled === false ? html`<p class="note">${machineText("disabled")}</p>` : null}
416
- ${state.loading && !state.data ? html`<p role="status" aria-busy="true"><span class="out-spin" aria-hidden="true"></span> ${machineText("loading")}</p>` : null}
417
430
  ${error || state.error ? html`<div class="runtime-error" role="alert"><p>${error || state.error}</p>${state.data && state.error ? html`<p>${machineText("seenCached")}</p>` : null}<button type="button" class="btn btn-sm" onClick=${state.refresh}>${machineText("retry")}</button></div>` : null}
418
431
  ${pairing ? html`<section class="runtime-pairing" aria-label=${machineText("pairing")}><header><h3>${machineText("pairing")}</h3><p class="note">${machineText("pairingHint")}</p></header><div class="runtime-pairing-body"><div class="runtime-install">${installTabs}<div id="runtime-install-panel" class="runtime-install-panel" role="tabpanel" aria-labelledby=${`runtime-install-tab-${tab}`} data-install-method=${tab}><ol class="runtime-steps">
419
432
  ${tab === "windows" ? windowsSteps : zipSteps}