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

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 (410) 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 +38 -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/authority/web-authority.d.ts +13 -0
  20. package/dist/authority/web-authority.js +12 -0
  21. package/dist/authority/web-authority.js.map +1 -1
  22. package/dist/backend/claude-code.js +47 -9
  23. package/dist/backend/claude-code.js.map +1 -1
  24. package/dist/backend/codex.js +1 -0
  25. package/dist/backend/codex.js.map +1 -1
  26. package/dist/backend/kiro.js +1 -1
  27. package/dist/backend/kiro.js.map +1 -1
  28. package/dist/backend/types.d.ts +2 -0
  29. package/dist/backend/types.js.map +1 -1
  30. package/dist/build-provenance.json +1 -1
  31. package/dist/bundled-tmux-guard.d.ts +19 -0
  32. package/dist/bundled-tmux-guard.js +83 -0
  33. package/dist/bundled-tmux-guard.js.map +1 -0
  34. package/dist/channel/access-manager.d.ts +1 -6
  35. package/dist/channel/access-manager.js +4 -94
  36. package/dist/channel/access-manager.js.map +1 -1
  37. package/dist/channel/adapters/discord.d.ts +0 -2
  38. package/dist/channel/adapters/discord.js +0 -8
  39. package/dist/channel/adapters/discord.js.map +1 -1
  40. package/dist/channel/adapters/telegram.d.ts +0 -3
  41. package/dist/channel/adapters/telegram.js +1 -30
  42. package/dist/channel/adapters/telegram.js.map +1 -1
  43. package/dist/channel/types.d.ts +0 -2
  44. package/dist/classic-bindings.d.ts +13 -0
  45. package/dist/classic-bindings.js +28 -2
  46. package/dist/classic-bindings.js.map +1 -1
  47. package/dist/classic-channel-manager.d.ts +2 -0
  48. package/dist/classic-channel-manager.js +5 -1
  49. package/dist/classic-channel-manager.js.map +1 -1
  50. package/dist/cli.js +117 -30
  51. package/dist/cli.js.map +1 -1
  52. package/dist/config-validator.js +11 -0
  53. package/dist/config-validator.js.map +1 -1
  54. package/dist/config.js +3 -1
  55. package/dist/config.js.map +1 -1
  56. package/dist/daemon.d.ts +27 -2
  57. package/dist/daemon.js +107 -6
  58. package/dist/daemon.js.map +1 -1
  59. package/dist/doctor.js +3 -4
  60. package/dist/doctor.js.map +1 -1
  61. package/dist/e2e-isolation.js +5 -2
  62. package/dist/e2e-isolation.js.map +1 -1
  63. package/dist/fleet-control-audit.d.ts +1 -1
  64. package/dist/fleet-manager.d.ts +188 -1
  65. package/dist/fleet-manager.js +1059 -79
  66. package/dist/fleet-manager.js.map +1 -1
  67. package/dist/general-knowledge/skills/concepts/SKILL.md +22 -7
  68. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
  69. package/dist/general-knowledge/steering/core-rules.md +6 -4
  70. package/dist/hub/buttons.js +4 -2
  71. package/dist/hub/buttons.js.map +1 -1
  72. package/dist/hub/catalog.d.ts +1 -1
  73. package/dist/hub/catalog.js +82 -15
  74. package/dist/hub/catalog.js.map +1 -1
  75. package/dist/hub/compose/server.d.ts +4 -1
  76. package/dist/hub/compose/server.js +30 -3
  77. package/dist/hub/compose/server.js.map +1 -1
  78. package/dist/hub/directory/directory.d.ts +1 -1
  79. package/dist/hub/directory/directory.js +142 -21
  80. package/dist/hub/directory/directory.js.map +1 -1
  81. package/dist/hub/directory/groups.d.ts +29 -0
  82. package/dist/hub/directory/groups.js +29 -0
  83. package/dist/hub/directory/groups.js.map +1 -0
  84. package/dist/hub/directory/index.d.ts +2 -1
  85. package/dist/hub/directory/types.d.ts +12 -2
  86. package/dist/hub/directory/types.js.map +1 -1
  87. package/dist/hub/group-policy/admin-context.d.ts +23 -0
  88. package/dist/hub/group-policy/admin-context.js +52 -0
  89. package/dist/hub/group-policy/admin-context.js.map +1 -0
  90. package/dist/hub/group-policy/admin-dto.d.ts +235 -0
  91. package/dist/hub/group-policy/admin-dto.js +55 -0
  92. package/dist/hub/group-policy/admin-dto.js.map +1 -0
  93. package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
  94. package/dist/hub/group-policy/admin-inventory.js +72 -0
  95. package/dist/hub/group-policy/admin-inventory.js.map +1 -0
  96. package/dist/hub/group-policy/admin-read.d.ts +21 -0
  97. package/dist/hub/group-policy/admin-read.js +90 -0
  98. package/dist/hub/group-policy/admin-read.js.map +1 -0
  99. package/dist/hub/group-policy/authorization.d.ts +43 -0
  100. package/dist/hub/group-policy/authorization.js +170 -0
  101. package/dist/hub/group-policy/authorization.js.map +1 -0
  102. package/dist/hub/group-policy/model.d.ts +56 -0
  103. package/dist/hub/group-policy/model.js +46 -0
  104. package/dist/hub/group-policy/model.js.map +1 -0
  105. package/dist/hub/group-policy/resources.d.ts +60 -0
  106. package/dist/hub/group-policy/resources.js +191 -0
  107. package/dist/hub/group-policy/resources.js.map +1 -0
  108. package/dist/hub/group-policy/store.d.ts +58 -0
  109. package/dist/hub/group-policy/store.js +155 -0
  110. package/dist/hub/group-policy/store.js.map +1 -0
  111. package/dist/hub/http/compose.js +9 -9
  112. package/dist/hub/http/compose.js.map +1 -1
  113. package/dist/hub/http/core.d.ts +23 -3
  114. package/dist/hub/http/core.js +138 -5
  115. package/dist/hub/http/core.js.map +1 -1
  116. package/dist/hub/http/deps.d.ts +3 -0
  117. package/dist/hub/pairing.d.ts +3 -1
  118. package/dist/hub/pairing.js +6 -3
  119. package/dist/hub/pairing.js.map +1 -1
  120. package/dist/hub/policy.d.ts +3 -1
  121. package/dist/hub/policy.js +13 -6
  122. package/dist/hub/policy.js.map +1 -1
  123. package/dist/hub/rooms.d.ts +1 -0
  124. package/dist/hub/rooms.js +76 -26
  125. package/dist/hub/rooms.js.map +1 -1
  126. package/dist/hub/server.d.ts +2 -0
  127. package/dist/hub/server.js +12 -2
  128. package/dist/hub/server.js.map +1 -1
  129. package/dist/hub/sessions.js +2 -1
  130. package/dist/hub/sessions.js.map +1 -1
  131. package/dist/hub/types.d.ts +2 -0
  132. package/dist/instance-config-impact.js +4 -3
  133. package/dist/instance-config-impact.js.map +1 -1
  134. package/dist/instance-lifecycle.d.ts +17 -0
  135. package/dist/instance-lifecycle.js +38 -1
  136. package/dist/instance-lifecycle.js.map +1 -1
  137. package/dist/locale.js +45 -18
  138. package/dist/locale.js.map +1 -1
  139. package/dist/login-controller.d.ts +5 -0
  140. package/dist/login-controller.js +11 -0
  141. package/dist/login-controller.js.map +1 -1
  142. package/dist/login-window-lock.d.ts +2 -1
  143. package/dist/login-window-lock.js.map +1 -1
  144. package/dist/ls-rows.d.ts +1 -1
  145. package/dist/ls-rows.js +1 -1
  146. package/dist/ls-rows.js.map +1 -1
  147. package/dist/machine-accounts.d.ts +110 -0
  148. package/dist/machine-accounts.js +229 -0
  149. package/dist/machine-accounts.js.map +1 -0
  150. package/dist/machine-signins.d.ts +89 -0
  151. package/dist/machine-signins.js +182 -0
  152. package/dist/machine-signins.js.map +1 -0
  153. package/dist/muse-usage-relay.d.ts +2 -0
  154. package/dist/muse-usage-relay.js +5 -3
  155. package/dist/muse-usage-relay.js.map +1 -1
  156. package/dist/needs-you-hub.d.ts +3 -0
  157. package/dist/needs-you-hub.js +13 -3
  158. package/dist/needs-you-hub.js.map +1 -1
  159. package/dist/needs-you.d.ts +35 -2
  160. package/dist/needs-you.js +19 -0
  161. package/dist/needs-you.js.map +1 -1
  162. package/dist/quickstart.js +7 -18
  163. package/dist/quickstart.js.map +1 -1
  164. package/dist/quiet-run.d.ts +31 -0
  165. package/dist/quiet-run.js +50 -0
  166. package/dist/quiet-run.js.map +1 -0
  167. package/dist/quota-notice-config.d.ts +22 -0
  168. package/dist/quota-notice-config.js +41 -0
  169. package/dist/quota-notice-config.js.map +1 -0
  170. package/dist/runtime-api.d.ts +13 -0
  171. package/dist/runtime-api.js +134 -2
  172. package/dist/runtime-api.js.map +1 -1
  173. package/dist/runtime-build-info.d.ts +2 -1
  174. package/dist/runtime-build-info.js +7 -3
  175. package/dist/runtime-build-info.js.map +1 -1
  176. package/dist/runtime-cli-install.d.ts +153 -0
  177. package/dist/runtime-cli-install.js +675 -0
  178. package/dist/runtime-cli-install.js.map +1 -0
  179. package/dist/runtime-cli.js +157 -12
  180. package/dist/runtime-cli.js.map +1 -1
  181. package/dist/runtime-client.d.ts +64 -2
  182. package/dist/runtime-client.js +277 -20
  183. package/dist/runtime-client.js.map +1 -1
  184. package/dist/runtime-coordinator.d.ts +10 -1
  185. package/dist/runtime-coordinator.js +93 -2
  186. package/dist/runtime-coordinator.js.map +1 -1
  187. package/dist/runtime-credential-profiles.d.ts +11 -2
  188. package/dist/runtime-credential-profiles.js +28 -4
  189. package/dist/runtime-credential-profiles.js.map +1 -1
  190. package/dist/runtime-install.js +9 -6
  191. package/dist/runtime-install.js.map +1 -1
  192. package/dist/runtime-pane-link.js +2 -1
  193. package/dist/runtime-pane-link.js.map +1 -1
  194. package/dist/runtime-pane-service.js +2 -2
  195. package/dist/runtime-pane-service.js.map +1 -1
  196. package/dist/runtime-pane-store.d.ts +10 -0
  197. package/dist/runtime-pane-store.js +13 -1
  198. package/dist/runtime-pane-store.js.map +1 -1
  199. package/dist/runtime-profile-ownership.d.ts +66 -0
  200. package/dist/runtime-profile-ownership.js +391 -0
  201. package/dist/runtime-profile-ownership.js.map +1 -0
  202. package/dist/runtime-protocol.d.ts +88 -2
  203. package/dist/runtime-protocol.js +40 -0
  204. package/dist/runtime-protocol.js.map +1 -1
  205. package/dist/runtime-remote-accounts.d.ts +197 -0
  206. package/dist/runtime-remote-accounts.js +663 -0
  207. package/dist/runtime-remote-accounts.js.map +1 -0
  208. package/dist/runtime-remote-setup.d.ts +105 -0
  209. package/dist/runtime-remote-setup.js +529 -0
  210. package/dist/runtime-remote-setup.js.map +1 -0
  211. package/dist/runtime-signin-transport.d.ts +39 -0
  212. package/dist/runtime-signin-transport.js +110 -0
  213. package/dist/runtime-signin-transport.js.map +1 -0
  214. package/dist/runtime-signin.d.ts +132 -0
  215. package/dist/runtime-signin.js +289 -0
  216. package/dist/runtime-signin.js.map +1 -0
  217. package/dist/runtime-update-attention.d.ts +4 -0
  218. package/dist/runtime-update-attention.js +11 -0
  219. package/dist/runtime-update-attention.js.map +1 -0
  220. package/dist/runtime-update-controller.d.ts +75 -0
  221. package/dist/runtime-update-controller.js +691 -0
  222. package/dist/runtime-update-controller.js.map +1 -0
  223. package/dist/runtime-update-ipc.d.ts +42 -0
  224. package/dist/runtime-update-ipc.js +144 -0
  225. package/dist/runtime-update-ipc.js.map +1 -0
  226. package/dist/runtime-update-journal.d.ts +5 -0
  227. package/dist/runtime-update-journal.js +7 -0
  228. package/dist/runtime-update-journal.js.map +1 -1
  229. package/dist/runtime-update-lock.js +17 -2
  230. package/dist/runtime-update-lock.js.map +1 -1
  231. package/dist/runtime-update-status.d.ts +30 -0
  232. package/dist/runtime-update-status.js +31 -0
  233. package/dist/runtime-update-status.js.map +1 -0
  234. package/dist/settings-api.js +6 -2
  235. package/dist/settings-api.js.map +1 -1
  236. package/dist/settings-change.d.ts +10 -0
  237. package/dist/settings-change.js +25 -1
  238. package/dist/settings-change.js.map +1 -1
  239. package/dist/settings-confirmation.d.ts +25 -1
  240. package/dist/settings-confirmation.js +11 -3
  241. package/dist/settings-confirmation.js.map +1 -1
  242. package/dist/settings-effect.js +18 -6
  243. package/dist/settings-effect.js.map +1 -1
  244. package/dist/settings-http-confirmation.d.ts +21 -0
  245. package/dist/settings-http-confirmation.js +74 -3
  246. package/dist/settings-http-confirmation.js.map +1 -1
  247. package/dist/settings-instance-patch.js +1 -1
  248. package/dist/settings-instance-patch.js.map +1 -1
  249. package/dist/setup-wizard.js +3 -5
  250. package/dist/setup-wizard.js.map +1 -1
  251. package/dist/signin-keepalive.d.ts +203 -0
  252. package/dist/signin-keepalive.js +652 -0
  253. package/dist/signin-keepalive.js.map +1 -0
  254. package/dist/structured-signin-transport.js +4 -0
  255. package/dist/structured-signin-transport.js.map +1 -1
  256. package/dist/structured-signin.d.ts +7 -0
  257. package/dist/structured-signin.js +4 -2
  258. package/dist/structured-signin.js.map +1 -1
  259. package/dist/tips.js +4 -4
  260. package/dist/tips.js.map +1 -1
  261. package/dist/tmux-binary.d.ts +23 -23
  262. package/dist/tmux-binary.js +35 -46
  263. package/dist/tmux-binary.js.map +1 -1
  264. package/dist/tmux-exec-helper.js +3 -3
  265. package/dist/tmux-exec-helper.js.map +1 -1
  266. package/dist/tmux-legacy.d.ts +94 -0
  267. package/dist/tmux-legacy.js +309 -0
  268. package/dist/tmux-legacy.js.map +1 -0
  269. package/dist/tmux-manager.d.ts +7 -1
  270. package/dist/tmux-manager.js +21 -11
  271. package/dist/tmux-manager.js.map +1 -1
  272. package/dist/tmux-rollback.d.ts +31 -0
  273. package/dist/tmux-rollback.js +72 -0
  274. package/dist/tmux-rollback.js.map +1 -0
  275. package/dist/tmux-server.d.ts +102 -0
  276. package/dist/tmux-server.js +248 -0
  277. package/dist/tmux-server.js.map +1 -0
  278. package/dist/transcript-monitor.js +43 -5
  279. package/dist/transcript-monitor.js.map +1 -1
  280. package/dist/transcript-records.d.ts +2 -1
  281. package/dist/transcript-records.js +3 -0
  282. package/dist/transcript-records.js.map +1 -1
  283. package/dist/transcript-sources.js +3 -0
  284. package/dist/transcript-sources.js.map +1 -1
  285. package/dist/types.d.ts +5 -0
  286. package/dist/types.js.map +1 -1
  287. package/dist/ui/accounts-keepalive.js +113 -0
  288. package/dist/ui/accounts-manage.js +237 -0
  289. package/dist/ui/accounts-view.js +191 -36
  290. package/dist/ui/agent-runtime-settings.js +2 -1
  291. package/dist/ui/app.html +8 -1
  292. package/dist/ui/backend-signin.js +12 -3
  293. package/dist/ui/general-location.js +28 -14
  294. package/dist/ui/hub-attachments.js +90 -0
  295. package/dist/ui/hub-chat-store.js +11 -5
  296. package/dist/ui/hub-client.js +20 -1
  297. package/dist/ui/hub-grant-strings.js +13 -0
  298. package/dist/ui/hub-owner-strings.js +6 -2
  299. package/dist/ui/hub-preview.js +101 -0
  300. package/dist/ui/hub-strings.js +4 -2
  301. package/dist/ui/machine-signin.js +56 -0
  302. package/dist/ui/panel-fleet.js +1 -1
  303. package/dist/ui/panel-hub.js +194 -54
  304. package/dist/ui/panel-log.js +2 -2
  305. package/dist/ui/panel-needs.js +14 -8
  306. package/dist/ui/panel-notices.js +4 -3
  307. package/dist/ui/panel-runtimes.js +32 -11
  308. package/dist/ui/panel-settings.js +18 -24
  309. package/dist/ui/panel-windows-agent.js +2 -1
  310. package/dist/ui/preview-pages.js +3 -41
  311. package/dist/ui/preview-panel-actions.js +3 -161
  312. package/dist/ui/preview-panel.js +10 -557
  313. package/dist/ui/preview-versions.js +3 -155
  314. package/dist/ui/runtime-cli-install.js +134 -0
  315. package/dist/ui/runtime-update-commands.d.ts +2 -0
  316. package/dist/ui/runtime-update-commands.js +11 -0
  317. package/dist/ui/runtime-update-status.js +53 -0
  318. package/dist/ui/search-dialog.js +3 -2
  319. package/dist/ui/settings-confirm.js +28 -0
  320. package/dist/ui/settings-devices.js +6 -10
  321. package/dist/ui/settings-guests.js +3 -2
  322. package/dist/ui/settings-hub-browser-certificate.js +2 -0
  323. package/dist/ui/settings-hub-membership.js +17 -11
  324. package/dist/ui/settings-hub-retention.js +2 -0
  325. package/dist/ui/settings-hub-section.js +35 -0
  326. package/dist/ui/settings-hub.js +17 -5
  327. package/dist/ui/settings-layout.js +6 -2
  328. package/dist/ui/settings-named-test.js +2 -2
  329. package/dist/ui/settings-outside.js +1 -1
  330. package/dist/ui/settings-quota-notice.js +102 -0
  331. package/dist/ui/settings-registry.js +4 -0
  332. package/dist/ui/settings-strings.js +6 -6
  333. package/dist/ui/settings-web-authority.js +2 -1
  334. package/dist/ui/shared/accounts-keepalive.css +7 -0
  335. package/dist/ui/shared/accounts.css +13 -0
  336. package/dist/ui/shared/app-i18n.js +4 -2
  337. package/dist/ui/shared/app-route.js +1 -1
  338. package/dist/ui/shared/app-shell.js +111 -8
  339. package/dist/ui/shared/app-store.js +2 -2
  340. package/dist/ui/shared/app.css +29 -0
  341. package/dist/ui/shared/app.js +2 -1
  342. package/dist/ui/shared/chat-strings.js +8 -8
  343. package/dist/ui/shared/hub-chat.css +1 -0
  344. package/dist/ui/shared/hub-owner.css +3 -3
  345. package/dist/ui/shared/hub-signin.css +24 -0
  346. package/dist/ui/shared/loading.css +37 -0
  347. package/dist/ui/shared/preview-pages.js +41 -0
  348. package/dist/ui/shared/preview-panel-actions.js +168 -0
  349. package/dist/ui/shared/preview-panel.js +565 -0
  350. package/dist/ui/shared/preview-versions.js +155 -0
  351. package/dist/ui/shared/runtime-install.css +4 -0
  352. package/dist/ui/shared/signin.js +68 -6
  353. package/dist/ui/shared/ui-states.js +14 -3
  354. package/dist/ui/shared/view-strings.js +4 -4
  355. package/dist/ui/shared/workspace-follow.css +19 -0
  356. package/dist/ui/signin.html +7 -3
  357. package/dist/ui/structured-signin.js +43 -11
  358. package/dist/ui/workspace-follow-strings.js +28 -0
  359. package/dist/ui/workspace-panel.js +225 -36
  360. package/dist/update-install.d.ts +7 -0
  361. package/dist/update-install.js +23 -0
  362. package/dist/update-install.js.map +1 -1
  363. package/dist/usage/providers.d.ts +6 -0
  364. package/dist/usage/providers.js +18 -9
  365. package/dist/usage/providers.js.map +1 -1
  366. package/dist/usage/quota-notices.d.ts +38 -0
  367. package/dist/usage/quota-notices.js +160 -0
  368. package/dist/usage/quota-notices.js.map +1 -0
  369. package/dist/usage/usage-api.d.ts +1 -0
  370. package/dist/usage/usage-api.js +16 -0
  371. package/dist/usage/usage-api.js.map +1 -1
  372. package/dist/web-api.d.ts +38 -0
  373. package/dist/web-api.js +357 -14
  374. package/dist/web-api.js.map +1 -1
  375. package/dist/web-login.d.ts +35 -1
  376. package/dist/web-login.js +51 -5
  377. package/dist/web-login.js.map +1 -1
  378. package/dist/web-remote-access.d.ts +6 -0
  379. package/dist/web-remote-access.js +10 -1
  380. package/dist/web-remote-access.js.map +1 -1
  381. package/dist/web-session.d.ts +11 -0
  382. package/dist/web-session.js +38 -1
  383. package/dist/web-session.js.map +1 -1
  384. package/dist/web-shell-routes.d.ts +1 -1
  385. package/dist/web-shell-routes.js +1 -1
  386. package/dist/web-shell-routes.js.map +1 -1
  387. package/dist/web-signin-link.d.ts +42 -0
  388. package/dist/web-signin-link.js +110 -0
  389. package/dist/web-signin-link.js.map +1 -0
  390. package/dist/windows-cli-api.d.ts +14 -0
  391. package/dist/windows-cli-api.js +21 -0
  392. package/dist/windows-cli-api.js.map +1 -1
  393. package/dist/windows-cli-worker.d.ts +3 -1
  394. package/dist/windows-cli-worker.js +18 -3
  395. package/dist/windows-cli-worker.js.map +1 -1
  396. package/dist/workspace-follow-parse.d.ts +36 -0
  397. package/dist/workspace-follow-parse.js +208 -0
  398. package/dist/workspace-follow-parse.js.map +1 -0
  399. package/dist/workspace-follow-records.d.ts +17 -0
  400. package/dist/workspace-follow-records.js +88 -0
  401. package/dist/workspace-follow-records.js.map +1 -0
  402. package/dist/workspace-follow.d.ts +41 -0
  403. package/dist/workspace-follow.js +143 -0
  404. package/dist/workspace-follow.js.map +1 -0
  405. package/dist/wsl-detect.d.ts +1 -0
  406. package/dist/wsl-detect.js +20 -0
  407. package/dist/wsl-detect.js.map +1 -0
  408. package/launcher/tmux-bundle.cjs +26 -10
  409. package/package.json +7 -2
  410. package/templates/runtime-install/install.ps1 +154 -13
@@ -1,4 +1,5 @@
1
1
  import {html,useEffect,useRef,useState} from "/assets/app-html.js";
2
+ import { Skeleton } from "/assets/ui-states.js";
2
3
  import {useLease} from "/assets/app-ctx.js";
3
4
  import {appStore,useStore} from "/assets/app-store.js";
4
5
  import {register,t} from "/assets/app-i18n.js";
@@ -58,7 +59,7 @@ export function AgentRuntimeChangeDialog({name,inst,onClose,onChanged}){
58
59
  };
59
60
  const close=()=>{if(!claim.current)onClose();};
60
61
  return html`<${Dialog} title=${text("title")} cls="agent-runtime-change-dialog" busy=${busy} onClose=${close} wide=${true} actions=${html`<button type="button" class="btn" disabled=${busy} onClick=${close}>${text("cancel")}</button>${step===2?html`<button type="button" class="btn" disabled=${busy||uncertain} onClick=${()=>setStep(1)}>${text("back")}</button>`:null}<button type="button" class="btn btn-primary" disabled=${busy||uncertain||!source||!targetReady||(step===2&&(!f.fresh||!allowedRead&&f.access==="read-only"))} onClick=${step===1?()=>setStep(2):submit}>${text(step===1?"next":"apply")}</button>`}>
61
- <div class="form agent-runtime-change" aria-busy=${busy}><p>${text("lead")}</p>${!source?html`<p role="status">${text("loading")}</p>`:null}
62
+ <div class="form agent-runtime-change" aria-busy=${busy}><p>${text("lead")}</p>${!source&&!error?html`<${Skeleton} variant="rows" lines=${3} label=${text("loading")} />`:null}
62
63
  ${source&&step===1?html`<${RuntimePicker} value=${f.runtime} onChange=${runtime=>choose(runtime)} windowsEnabled=${windowsCli===true} machineId=${f.machineId} machines=${machines} onMachineChange=${id=>choose("windows",id)} onRefresh=${machinesState.refresh} loaded=${!!machinesState.data && !machinesState.error}/><div class="field"><label>${tr("backend")}</label><${CliPicker} value=${f.backend} choices=${choices} label=${tr("backend")} onChange=${backend=>setForm(old=>({...old,backend,model:"",credentialProfile:backend==="claude-code"?old.credentialProfile:"",fresh:false}))}/></div>${removedBackendReplacement(f.backend)?html`<p class="note" role="status">${text("removed",f.backend,removedBackendReplacement(f.backend))}</p>`:null}${!choices.length?html`<p class="note">${text("noCli")}</p>`:null}`:null}
63
64
  ${source&&step===2?html`<h3>${text("configure")}</h3><p><strong>${machine?.name||(windows?tr("windows"):tr("wsl"))}</strong> · ${cliLabel(f.backend)}</p><label class="field"><span>${tr("directory")}</span><input value=${f.directory} disabled=${busy||uncertain} onInput=${event=>set("directory",event.target.value)}/></label><p class="note">${text("directoryHint")}</p><div class="field"><label for="runtime-change-model">${t("settings.model")}</label><${ModelSelect} id="runtime-change-model" disabled=${busy||uncertain} value=${f.model} onChange=${value=>set("model",value)} backend=${f.backend} instance=${!windows&&source.runtime==="wsl"&&source.backend===f.backend?name:undefined} runtime=${f.runtime} machineId=${f.machineId} inherit=${t("settings.modelCliDefault")}/></div>
64
65
  ${windows?html`<label class="field"><span>${tr("access")}</span><select value=${f.access} disabled=${busy||uncertain} onChange=${event=>set("access",event.target.value)}><option value="read-only" disabled=${!allowedRead}>${tr("read")}</option><option value="workspace-write">${tr("write")}</option></select></label>${!allowedRead?html`<p class="note" role="status">${tr("noReadOnly")}</p>`:null}<label class="field"><span>${tr("adapter")}</span><select value=${f.adapter} disabled=${busy||uncertain} onChange=${event=>set("adapter",event.target.value)}><option value="exec">${tr("adapterExec")}</option><option value="pane" disabled=${!["codex","claude-code"].includes(f.backend)}>${tr("adapterPane")}</option></select></label>${f.machineId?html`<${ClaudeAccountSelect} id="runtime-change-claude-account" machine=${machine} backend=${f.backend} value=${f.credentialProfile} onChange=${value=>set("credentialProfile",value)} disabled=${busy||uncertain||machine?.status!=="online"} changeNote=${true}/>`:null}`:null}
package/dist/ui/app.html CHANGED
@@ -13,11 +13,18 @@
13
13
  <script src="/assets/theme.js"></script>
14
14
  <link rel="stylesheet" href="/assets/tokens.css">
15
15
  <link rel="stylesheet" href="/assets/app.css">
16
+ <link rel="stylesheet" href="/assets/loading.css">
16
17
  <script src="/assets/agend-auth.js"></script>
17
18
  <script type="module" src="/assets/app.js"></script>
18
19
  </head>
19
20
  <body>
20
- <div id="app" class="app-root"></div>
21
+ <div id="app" class="app-root"><div class="sk-boot" role="status" aria-busy="true" aria-label="Loading…">
22
+ <div class="sk-boot-side" aria-hidden="true"><div class="skeleton"><div class="sk-line"></div><div class="sk-line"></div><div class="sk-line"></div></div></div>
23
+ <div class="sk-boot-main" aria-hidden="true"><div class="sk-boot-head skeleton"><div class="sk-line"></div></div>
24
+ <div class="skeleton sk-rows"><div class="sk-row"><div class="sk-line sk-thumb"></div><div class="sk-copy"><div class="sk-line"></div><div class="sk-line"></div></div><div class="sk-line sk-pill"></div></div>
25
+ <div class="sk-row"><div class="sk-line sk-thumb"></div><div class="sk-copy"><div class="sk-line"></div><div class="sk-line"></div></div><div class="sk-line sk-pill"></div></div>
26
+ <div class="sk-row"><div class="sk-line sk-thumb"></div><div class="sk-copy"><div class="sk-line"></div><div class="sk-line"></div></div><div class="sk-line sk-pill"></div></div></div>
27
+ </div></div></div>
21
28
  <noscript><p class="noscript">AgEnD's web app needs JavaScript.</p></noscript>
22
29
  </body>
23
30
  </html>
@@ -10,6 +10,7 @@ import { t, register, lang, onLang } from "/assets/app-i18n.js";
10
10
  import { appStore, createStore, useStore } from "/assets/app-store.js";
11
11
  import { closeDialog, shellStore, showDialog } from "/assets/app-shell.js";
12
12
  import { Dialog } from "/assets/ui-dialog.js";
13
+ import { confirmDialog } from "/assets/ui-confirm.js";
13
14
  import { toast } from "/assets/ui-toast.js";
14
15
  import { mountStructuredSignIns } from "./structured-signin.js";
15
16
  import { CliProductMark, cliLabel } from "./cli-picker.js";
@@ -219,7 +220,9 @@ export function BrowserSignInDialog({ backend, backends, onClose }) {
219
220
  const root = useRef(null), close = onClose || closeDialog;
220
221
  useEffect(() => {
221
222
  let cards, last = "";
222
- cards = mountStructuredSignIns(root.current, { endpoint: "/ui/browser-backend-signins", lang, changed: next => {
223
+ // Ridge #3321 S01: "Sign in again" asks in the dashboard's own confirmation (its title names the CLI), not the browser's.
224
+ const ask = (message, cli) => confirmDialog({ title: t("signin.reloginTitle", cli), message, confirmLabel: t("signin.reloginGo") });
225
+ cards = mountStructuredSignIns(root.current, { endpoint: "/ui/browser-backend-signins", lang, ask, dashboard: true, changed: next => {
223
226
  if (backends) { if (backends.some(b => !next.selected.includes(b))) void cards.addBackends(backends); }
224
227
  else if (!next.selected.includes(backend)) void cards.addBackend(backend);
225
228
  const signature = JSON.stringify([next.login, next.pending]);
@@ -337,13 +340,13 @@ register("signin", {
337
340
  hostTitle: "CLI sign-ins", hostHint: "Accounts used by CLIs on the host running AgEnD.",
338
341
  hostBadge: "AgEnD host", hostProfile: "Credential profile: {0}", hostLoading: "Reading CLI sign-ins…", hostEmpty: "No CLI sign-ins were reported on this host.",
339
342
  installHelp: "Installation instructions", updateHelp: "Update instructions", hostHelp: "Sign-in instructions",
340
- commandHint: "Run these instructions in a terminal on the host running AgEnD.",
343
+ commandHint: "Use Sign in on this page, or send /login in chat.",
341
344
  },
342
345
  "zh-TW": {
343
346
  hostTitle: "CLI 登入", hostHint: "執行 AgEnD 的主機上,各個 CLI 使用的帳號。",
344
347
  hostBadge: "AgEnD 主機", hostProfile: "憑證設定檔:{0}", hostLoading: "正在讀取 CLI 登入狀態…", hostEmpty: "這台主機尚未回報 CLI 登入項目。",
345
348
  installHelp: "安裝說明", updateHelp: "更新說明", hostHelp: "登入說明",
346
- commandHint: "請在執行 AgEnD 的主機終端機中操作。",
349
+ commandHint: "請用這一頁的「登入」,或在聊天傳 /login。",
347
350
  },
348
351
  });
349
352
 
@@ -370,3 +373,9 @@ export function SignInList() {
370
373
  })}</div>`}
371
374
  </section>`;
372
375
  }
376
+
377
+ // Ridge #3321 S01: "Sign in again" — the dashboard's confirmation, titled with the CLI it is for.
378
+ register("signin", {
379
+ en: { reloginTitle: "Sign in to {0} again", reloginGo: "Sign in again" },
380
+ "zh-TW": { reloginTitle: "重新登入 {0}", reloginGo: "重新登入" },
381
+ });
@@ -34,10 +34,14 @@ export function GeneralLocation({ name, attentionOnly = false }) {
34
34
  };
35
35
  useEffect(() => { if (!guestPage()) void read(); }, [name, attentionKey]);
36
36
  if (guestPage()) return null;
37
- return html`<section id="general-location" class="card general-location"><h2>${tr("label")}</h2>
37
+ // alpha.6 feedback (#3): the same card as the Shared agent settings below it (card s-group: a title and its note, then
38
+ // labelled fields in the grid, then the actions) — not a heading, a bare inline select and a full-width button. A select
39
+ // is as wide as its longest option unless bounded: a paired PC's long name ran the card off the right edge.
40
+ const rows = (data?.generals || []).filter(row => !name || row.name === name);
41
+ return html`<section id="general-location" class="card s-group general-location"><div><h3>${tr("label")}</h3>${!attentionOnly ? html`<p class="note">${tr("history")}</p>` : null}</div>
38
42
  ${error ? html`<p role="alert">${error}</p>` : null}
39
- ${(data?.generals || []).filter(row => !name || row.name === name).map(row => html`<${LocationRow} key=${row.name + row.revision} row=${row} machines=${data.machines || []} attentionOnly=${attentionOnly} refresh=${read} />`)}
40
- ${!attentionOnly ? html`<button type="button" class="btn btn-sm" onClick=${read}>${t("settings.refresh")}</button>` : null}
43
+ ${rows.map(row => html`<${LocationRow} key=${row.name + row.revision} row=${row} machines=${data.machines || []} attentionOnly=${attentionOnly} refresh=${read} />`)}
44
+ ${!attentionOnly && !rows.length ? html`<div class="general-location-actions"><button type="button" class="btn btn-sm" onClick=${read}>${t("settings.refresh")}</button></div>` : null}
41
45
  </section>`;
42
46
  }
43
47
  function LocationRow({ row, machines, attentionOnly, refresh }) {
@@ -54,18 +58,28 @@ function LocationRow({ row, machines, attentionOnly, refresh }) {
54
58
  finally { flight.current = false; if (lease.current()) setBusy(false); }
55
59
  };
56
60
  if (attentionOnly && !row.offline && !row.hold) return null;
61
+ const id = `gl-${row.name}`;
62
+ const recover = row.canSwitchBack || row.hold === "start";
57
63
  return html`<div class="general-location-row" data-general=${row.name}>
58
- <strong>${row.displayName}</strong><p>${row.location === "host" ? tr("host") : `${machines.find(item => item.id === row.machineId)?.name || tr("windows")} · ${row.cli}`}</p>
64
+ <p class="general-location-now"><strong>${row.displayName}</strong><span>${row.location === "host" ? tr("host") : `${machines.find(item => item.id === row.machineId)?.name || tr("windows")} · ${row.cli}`}</span></p>
59
65
  ${row.offline || row.hold ? html`<p role="alert">${tr(row.hold || "offline")}</p>` : null}
60
- <p class="note">${tr("history")}</p>
61
- ${row.canSwitchBack ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose({ location: "host" })}>${tr("host")}</button>` : null}
62
- ${row.hold === "start" ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose(row.retryTarget || (row.location === "host" ? { location: "host" } : { location: "windows", machineId: row.machineId, cli: row.cli, model: row.model }))}>${t("chat.start")}</button>` : null}
63
- ${!attentionOnly ? html`<label>${tr("label")}<select value=${target} disabled=${busy || row.switching} onChange=${e => { setTarget(e.target.value); setModel(""); }}>
64
- <option value="host">${tr("host")}</option>${machines.map(item => html`<option value=${item.id} disabled=${!item.online}>${item.name}</option>`)}
65
- </select></label>
66
- ${target !== "host" ? html`<label>${t("settings.backend")}<select value=${cli} onChange=${e => { setCli(e.target.value); setModel(""); }}>
67
- ${["claude-code", "codex"].map(id => html`<option value=${id} disabled=${!machine?.clis.some(item => item.id === id)}>${id}</option>`)}
68
- </select></label><${ModelSelect} value=${model} onChange=${setModel} backend=${cli} runtime="windows" machineId=${target} instance=${row.name} />` : null}
69
- <button type="button" class="btn btn-primary" disabled=${busy || row.switching || target === "host" && !row.canSwitchBack || target !== "host" && (!machine?.online || !machine.clis.some(item => item.id === cli))} onClick=${() => propose(target === "host" ? { location: "host" } : { location: "windows", machineId: target, cli, model })}>${t("settings.save")}</button>` : null}
66
+ ${attentionOnly ? html`<p class="note">${tr("history")}</p>` : null}
67
+ ${recover ? html`<div class="general-location-actions">
68
+ ${row.canSwitchBack ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose({ location: "host" })}>${tr("host")}</button>` : null}
69
+ ${row.hold === "start" ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose(row.retryTarget || (row.location === "host" ? { location: "host" } : { location: "windows", machineId: row.machineId, cli: row.cli, model: row.model }))}>${t("chat.start")}</button>` : null}
70
+ </div>` : null}
71
+ ${!attentionOnly ? html`<div class="grid2">
72
+ <div class="field"><label for=${`${id}-target`}>${tr("label")}</label><select id=${`${id}-target`} value=${target} disabled=${busy || row.switching} onChange=${e => { setTarget(e.target.value); setModel(""); }}>
73
+ <option value="host">${tr("host")}</option>${machines.map(item => html`<option value=${item.id} disabled=${!item.online}>${item.name}</option>`)}
74
+ </select></div>
75
+ ${target !== "host" ? html`<div class="field"><label for=${`${id}-cli`}>${t("settings.backend")}</label><select id=${`${id}-cli`} value=${cli} onChange=${e => { setCli(e.target.value); setModel(""); }}>
76
+ ${["claude-code", "codex"].map(id => html`<option value=${id} disabled=${!machine?.clis.some(item => item.id === id)}>${id}</option>`)}
77
+ </select></div>` : null}
78
+ </div>
79
+ ${target !== "host" ? html`<${ModelSelect} value=${model} onChange=${setModel} backend=${cli} runtime="windows" machineId=${target} instance=${row.name} />` : null}
80
+ <div class="general-location-actions">
81
+ <button type="button" class="btn btn-sm" onClick=${refresh}>${t("settings.refresh")}</button>
82
+ <button type="button" class="btn btn-primary btn-sm" disabled=${busy || row.switching || target === "host" && !row.canSwitchBack || target !== "host" && (!machine?.online || !machine.clis.some(item => item.id === cli))} onClick=${() => propose(target === "host" ? { location: "host" } : { location: "windows", machineId: target, cli, model })}>${t("settings.save")}</button>
83
+ </div>` : null}
70
84
  </div>`;
71
85
  }
@@ -0,0 +1,90 @@
1
+ // #3226 D2: files in a Hub question — the composer's Attach, the files waiting under it, and the words for both. A lazy
2
+ // Hub module with its own strings (an older tab's shared strings never lack them) and only class names the shared
3
+ // stylesheet has had since the fleet chat's own attachments (.pending-files, .file-chip, .chip-x).
4
+ // The server decides everything: a room offers Attach only while its fleet link negotiated attachments-v1 (room.features);
5
+ // each file is uploaded on choice (typed by name, images by their bytes, within the limits), and Send names the ids.
6
+ import { html } from "/assets/app-html.js";
7
+ import { register, t } from "/assets/app-i18n.js";
8
+ import { Icon } from "/assets/ui-icons.js";
9
+
10
+ register("hubfiles", {
11
+ en: { attach: "Attach files", off: "This agent can't receive files yet.", uploading: "Uploading…", remove: "Remove {0}",
12
+ failed: "{0} wasn't attached: {1}", tooMany: "At most {0} files per question.", tooLarge: "it is over 20 MB",
13
+ typeNotAllowed: "this type isn't allowed (PNG, JPEG, GIF, WebP, PDF, text, Markdown, CSV, JSON, Word, Excel, PowerPoint, HTML)",
14
+ imageMismatch: "it isn't the image its name says", empty: "it is empty", busy: "too many files are waiting; send or remove some first",
15
+ unavailable: "the agent can't receive files right now", other: "the Hub refused it ({0})", waitUpload: "Wait until the files are uploaded.",
16
+ held: "This agent can't receive files right now. Send again when it can, or remove the files to send only the text.",
17
+ reload: "Reload the page to attach files." },
18
+ "zh-TW": { attach: "附加檔案", off: "這個代理目前還不能接收檔案。", uploading: "上傳中…", remove: "移除 {0}",
19
+ failed: "{0} 沒有附加:{1}", tooMany: "每個問題最多 {0} 個檔案。", tooLarge: "超過 20 MB",
20
+ typeNotAllowed: "不支援這種類型(PNG、JPEG、GIF、WebP、PDF、純文字、Markdown、CSV、JSON、Word、Excel、PowerPoint、HTML)",
21
+ imageMismatch: "內容不是檔名所說的圖片", empty: "檔案是空的", busy: "等待中的檔案太多,請先送出或移除一些",
22
+ unavailable: "代理目前無法接收檔案", other: "Hub 拒絕了這個檔案({0})", waitUpload: "請等檔案上傳完成。",
23
+ held: "這個代理目前無法接收檔案。等它可以接收時再送出,或移除檔案只送出文字。",
24
+ reload: "重新載入頁面後才能附加檔案。" },
25
+ });
26
+ export const hf = (key, ...a) => t(`hubfiles.${key}`, ...a);
27
+ export const FILES_FEATURE = "attachments-v1";
28
+ export const MAX_FILES = 10;
29
+ /** Whether this room's fleet link takes files now. */
30
+ export const roomTakesFiles = (room) => Array.isArray(room && room.features) && room.features.includes(FILES_FEATURE);
31
+ /**
32
+ * Whether this page's Hub client and room store carry files (D2 marks both). A tab that loaded an older hub-client.js or
33
+ * hub-chat-store.js before this module keeps those: its client has no upload and its ask drops the ids, so a question
34
+ * with files would go as text. Without both marks the page offers no Attach and asks for a reload instead.
35
+ */
36
+ export const pageCarriesFiles = (client, store) => !!(client && client.filesV1 === true && typeof client.upload === "function" && store && store.filesV1 === true);
37
+
38
+ /**
39
+ * A Hub file ({ id: uuid, name, size, mime, url }) as the shared thread draws an attachment: its id as the 32 hex digits
40
+ * the renderer accepts, its room URL (same origin, so the thread's link, image and text card read it there), and an
41
+ * image (by its server-checked type) as a photo. Anything else is not drawn.
42
+ */
43
+ export function hubFileAttachment(f) {
44
+ if (!f || typeof f.id !== "string" || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(f.id)
45
+ || typeof f.url !== "string" || !f.url.startsWith("/hub/v1/rooms/") || f.url.startsWith("//")) return null;
46
+ const image = /^image\/(?:png|jpeg|gif|webp)$/.test(f.mime || "");
47
+ return { id: f.id.replace(/-/g, ""), name: String(f.name || "file"), size: Number(f.size) || 0, mime: f.mime, url: image ? `${f.url}/inline` : f.url, ...(image ? { kind: "photo" } : {}) };
48
+ }
49
+
50
+ /** Why the server refused an upload, in words. */
51
+ export function uploadRefusal(r) {
52
+ const by = { "too-large": "tooLarge", "type-not-allowed": "typeNotAllowed", "image-mismatch": "imageMismatch", empty: "empty", backpressure: "busy", incompatible: "unavailable", unavailable: "unavailable" };
53
+ if (r && r.status === 413) return hf("tooLarge");
54
+ const key = r && by[r.code];
55
+ return key ? hf(key) : hf("other", (r && (r.code || r.status)) || "?");
56
+ }
57
+
58
+ /**
59
+ * Upload chosen files one at a time; `files` is the composer's list of { key, name, size, state: "uploading" | "ready",
60
+ * id? }. Every admitted file takes its place in the list at once, before the first upload, so choices that overlap
61
+ * never hold more than MAX_FILES between them (queued ones count). A file whose chip was removed before its turn is not
62
+ * sent, and nothing more starts once `alive()` is false (the room was left). Returns the refusals, one line each (the
63
+ * chips of refused files are removed).
64
+ */
65
+ export async function uploadChosen(client, roomId, fileList, { current, set, alive = () => true }) {
66
+ const chosen = [...(fileList || [])], refusals = [];
67
+ const room = Math.max(0, MAX_FILES - current().length);
68
+ if (chosen.length > room) refusals.push(hf("tooMany", MAX_FILES));
69
+ const admitted = chosen.slice(0, room).map((file) => ({ file, key: `${Date.now()}-${Math.random().toString(36).slice(2)}` }));
70
+ if (admitted.length) set([...current(), ...admitted.map(({ file, key }) => ({ key, name: file.name, size: file.size, state: "uploading" }))]);
71
+ for (const { file, key } of admitted) {
72
+ if (!alive()) break;
73
+ if (!current().some((f) => f.key === key)) continue;
74
+ let r;
75
+ try { r = await client.upload(roomId, file); } catch { r = { ok: false, status: 0, code: "unreachable" }; }
76
+ if (!alive()) break;
77
+ if (r && r.ok && r.file) set(current().map((f) => (f.key === key ? { ...f, state: "ready", id: r.file.id, name: r.file.name, size: r.file.size } : f)));
78
+ else { set(current().filter((f) => f.key !== key)); refusals.push(hf("failed", file.name, uploadRefusal(r))); }
79
+ }
80
+ return refusals;
81
+ }
82
+
83
+ /** The files waiting under the composer. */
84
+ export function PendingFiles({ files, onRemove, formatSize = (n) => `${n} B` }) {
85
+ if (!files.length) return null;
86
+ return html`<div class="pending-files hub-pending-files">${files.map((f) => html`<span key=${f.key} class="file-chip" data-state=${f.state}>
87
+ <span class="ic"><${Icon} name="file" size=${16} /></span><span class="nm">${f.name}</span>
88
+ <span class="sz">${f.state === "uploading" ? hf("uploading") : formatSize(f.size)}</span>
89
+ <button type="button" class="chip-x" title=${hf("remove", f.name)} aria-label=${hf("remove", f.name)} onClick=${() => onRemove(f.key)}><${Icon} name="close" size=${14} /></button></span>`)}</div>`;
90
+ }
@@ -6,6 +6,7 @@
6
6
  // with backpressure), one request at a time, paused while the page is hidden. Unanswered entries are read again (from
7
7
  // just before the oldest open one); answered history is kept. The messages answer carries the room itself (its state,
8
8
  // its grant's end, what its link negotiated: `room.features`), fresh each poll.
9
+ import { hubFileAttachment } from "./hub-attachments.js";
9
10
  import { hubClient } from "./hub-client.js";
10
11
  import { createHubButtonActions } from "./hub-button-actions.js";
11
12
 
@@ -34,8 +35,10 @@ export function hubEntryToMessages(entry, room, { me = "", reason = (code) => co
34
35
  if (!entry || !Number.isSafeInteger(entry.sequence)) return [];
35
36
  const stage = entry.receipt ? entry.receipt.stage : "queued", at = entry.receipt ? entry.receipt.at : undefined;
36
37
  const id = entry.sequence * 2, out = [];
37
- const files = (list) => (Array.isArray(list) && list.length ? { attachments: list } : {});
38
- out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
38
+ // D: a Hub file in the shared thread's shape (hub-attachments.js); one the renderer cannot take is left out.
39
+ const files = (list) => { const a = Array.isArray(list) ? list.map(hubFileAttachment).filter(Boolean) : []; return a.length ? { attachments: a } : {}; };
40
+ // A closed poll's tally is already in its widget. Its automatic agent prompt was not typed by the asker.
41
+ if (entry.pollResult !== true) out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
39
42
  text: entry.expired && entry.question === undefined ? "" : String(entry.question ?? ""), delivery: stageMark(stage),
40
43
  ...files(entry.questionFiles), ...(entry.quote ? { quote: entry.quote } : {}) });
41
44
  if (entry.answer !== undefined) {
@@ -49,12 +52,12 @@ export function hubEntryToMessages(entry, room, { me = "", reason = (code) => co
49
52
 
50
53
  /**
51
54
  * The store of one room: `subscribe(fn)` (fn() on any change) → unsubscribe; `messages()`, `room()`, `working()` (the
52
- * question being worked on, if any: { since }), `closed()`; `refresh()` (a read now); `send(text, extras)`;
55
+ * question being worked on, if any: { since }), `closed()`, `loaded()` (first successful history read); `refresh()` (a read now); `send(text, extras)`;
53
56
  * F's `clickButton(setId, index)`, `vote(setId, options)`, `busy(setId)`, `mine(setId)`; `stop()`.
54
57
  */
55
58
  export function createHubChatStore(room, { client = hubClient(), me = "", reason, timers = globalThis, doc = typeof document !== "undefined" ? document : null } = {}) {
56
59
  const subs = new Set();
57
- const st = { live: true, timer: 0, inflight: false, entries: [], room: { ...room }, closed: false, error: null, pending: [], full: false, reads: 0, farTurn: 0 };
60
+ const st = { live: true, timer: 0, inflight: false, entries: [], room: { ...room }, closed: false, loaded: false, error: null, pending: [], full: false, reads: 0, farTurn: 0 };
58
61
  const emit = () => { for (const fn of subs) { try { fn(); } catch { /* a subscriber's own failure */ } } };
59
62
  const merge = (got) => {
60
63
  const byId = new Map(st.entries.map((e) => [e.messageId, e]));
@@ -99,7 +102,7 @@ export function createHubChatStore(room, { client = hubClient(), me = "", reason
99
102
  // (an older Hub) keeps what is known.
100
103
  if (r.room) { st.room = { ...st.room, ...r.room }; if (!Object.prototype.hasOwnProperty.call(r.room, "quota")) delete st.room.quota; }
101
104
  st.pending = st.pending.filter((p) => !st.entries.some((e) => e.messageId === p.messageId));
102
- st.error = null; emit(); schedule(POLL_MS); return;
105
+ st.loaded = true; st.error = null; emit(); schedule(POLL_MS); return;
103
106
  }
104
107
  if (r.code === "revoked" || r.code === "not-found") { st.closed = true; emit(); return; }
105
108
  st.error = r.code || "failed"; emit();
@@ -121,6 +124,7 @@ export function createHubChatStore(room, { client = hubClient(), me = "", reason
121
124
  subscribe(fn) { subs.add(fn); return () => subs.delete(fn); },
122
125
  room: () => st.room,
123
126
  closed: () => st.closed,
127
+ loaded: () => st.loaded,
124
128
  error: () => st.error,
125
129
  entries: () => st.entries,
126
130
  messages() {
@@ -136,6 +140,8 @@ export function createHubChatStore(room, { client = hubClient(), me = "", reason
136
140
  return w ? { since: w.receipt.at } : null;
137
141
  },
138
142
  refresh() { schedule(0); },
143
+ /** #3226 D2: send passes `extras.files` to the client as given (hub-attachments checks the mark). */
144
+ filesV1: true,
139
145
  async send(text, extras = {}) {
140
146
  const q = String(text || "").trim();
141
147
  if (!q || st.closed) return { ok: false, code: "invalid" };
@@ -236,7 +236,26 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a) } = {}) {
236
236
  quotaVisibility(exposureId, revision, visible) { return call("POST", `/hub/v1/exposures/${id(exposureId)}/quota`, { revision, visible }); },
237
237
  rooms() { return call("GET", "/hub/v1/rooms"); },
238
238
  openRoom(exposureId, grantId) { return call("POST", "/hub/v1/rooms", { exposureId, grantId }); },
239
- ask(roomId, idempotencyKey, text) { return call("POST", `/hub/v1/rooms/${id(roomId)}/messages`, { idempotencyKey, text }); },
239
+ /** #3226 D2: this client carries files (ask sends `extras.files`; upload exists); hub-attachments checks the mark. */
240
+ filesV1: true,
241
+ /** #3226 D: `extras.files` names the asker's own uploads in this room (only on a room whose features take files). */
242
+ ask(roomId, idempotencyKey, text, extras = {}) {
243
+ return call("POST", `/hub/v1/rooms/${id(roomId)}/messages`, { idempotencyKey, text, ...(Array.isArray(extras.files) && extras.files.length ? { files: extras.files } : {}) });
244
+ },
245
+ /** #3226 D: one file for a later question in this room, sent as is (the server types it by its name, images by
246
+ * their bytes). → { ok: true, file: { id, name, size, mime, url } } or { ok: false, status, code }. */
247
+ async upload(roomId, file) {
248
+ const headers = { Accept: "application/json", "Content-Type": "application/octet-stream", "X-File-Name": encodeURIComponent(String(file && file.name || "")) };
249
+ if (csrf) headers["X-AgEnD-Hub-CSRF"] = csrf;
250
+ let r;
251
+ try { r = await fetchImpl(`/hub/v1/rooms/${id(roomId)}/files`, { method: "POST", headers, credentials: "same-origin", cache: "no-store", body: file }); }
252
+ catch { return { ok: false, status: 0, code: "unreachable" }; }
253
+ let json = null;
254
+ try { json = await r.json(); } catch { json = null; }
255
+ if (r.status === 401) { csrf = null; for (const fn of ended) { try { fn(); } catch { /* a listener's own failure */ } } }
256
+ if (!r.ok) return { ok: false, status: r.status, code: (json && typeof json.code === "string" && json.code) || "failed" };
257
+ return { ok: true, ...(json && typeof json === "object" ? json : {}) };
258
+ },
240
259
  read(roomId, after = 0) { return call("GET", `/hub/v1/rooms/${id(roomId)}/messages?after=${id(after)}`); },
241
260
  chooseButtons(roomId, input) { return call("POST", `/hub/v1/rooms/${id(roomId)}/buttons`, input); },
242
261
  pairings() { return call("GET", "/hub/v1/pairings"); },
@@ -0,0 +1,13 @@
1
+ // Grant feedback lives in a fresh module, including in a tab that cached the older owner dictionary.
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ register("hubGrant", {
4
+ en: {
5
+ recipientRefused: "This account can't be allowed here. Check the sign-in name and that the account is active, then try again.",
6
+ directoryUnavailable: "The directory couldn't be checked. Try again later.",
7
+ },
8
+ "zh-TW": {
9
+ recipientRefused: "目前無法允許這個帳號。請確認登入名稱正確、帳號仍可使用,再試一次。",
10
+ directoryUnavailable: "目前無法查核目錄服務,請稍後再試。",
11
+ },
12
+ });
13
+ export const hg = (key, ...values) => t(`hubGrant.${key}`, ...values);
@@ -5,12 +5,14 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hubOwner", {
7
7
  en: {
8
+ memberAddress: "Member address", memberAddressHint: "Enter this address and the code in your fleet's Settings → Hub → Connect to a Hub. This is separate from the Hub's browser address.",
9
+ memberAddressMissing: "Ask the administrator for the member address; it may use a different port from this page.", copyHandoff: "Copy address and code", handoffCopied: "Address and code copied", handoffCopyFailed: "Couldn't copy. Select the address and code above to copy them.",
8
10
  active: "Active", adminLead: "Pair a fleet with this Hub and see the fleets that are paired. You can't read anyone's chats here.",
9
11
  allow: "Allow…", allowDays: "For", allowGo: "Allow", allowLogin: "Their sign-in name",
10
12
  allowLoginHint: "The account they sign in to this Hub with.", allowTitle: "Allow someone to ask {0}", approveGo: "Approve…",
11
13
  approvedTag: "Approved", backToMine: "My shared agents", codeFor: "Code for {0}", codeUnusedYet: "Not used yet", fleetOf: "{0}'s fleet",
12
14
  makeCode: "Make code", mayAsk: "{0} may ask", mayAskNone: "No one may ask yet", mayAskOne: "1 may ask",
13
- mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Access & security.",
15
+ mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Hub.",
14
16
  noFleets: "No fleet is paired yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
15
17
  pairedFleets: "Paired fleets · {0}", pauseGo: "Pause…", pauseLead: "No one can ask it until it is shared again. What was asked stays readable.",
16
18
  pauseTitle: "Pause questions", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
@@ -24,10 +26,12 @@ register("hubOwner", {
24
26
  untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
25
27
  },
26
28
  "zh-TW": {
29
+ memberAddress: "成員連線位址", memberAddressHint: "在你 fleet 的「設定 → Hub → 連線到 Hub」輸入這個位址和配對碼。這與 Hub 的瀏覽器位址不同。",
30
+ memberAddressMissing: "請向管理員索取成員連線位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
27
31
  active: "使用中", adminLead: "把 fleet 配對到這個 Hub,並查看已配對的 fleet。這裡看不到任何人的對話。", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
28
32
  allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
29
33
  codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
30
- mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 → 存取與安全。", noFleets: "還沒有配對的 fleet。",
34
+ mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 → Hub。", noFleets: "還沒有配對的 fleet。",
31
35
  ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 fleet", pairedFleets: "已配對的 fleet · {0}", pauseGo: "暫停…",
32
36
  pauseLead: "重新分享之前,沒有人能再提問。已經問過的內容仍然看得到。", pauseTitle: "暫停提問", pendingLead: "確認這個指紋和你 fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
33
37
  recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
@@ -0,0 +1,101 @@
1
+ // #3226 E: an answer's HTML page in the Hub's side panel — the fleet's own panel (/assets/preview-panel.js: versions,
2
+ // pages, Point at it, errors), run at the Hub's own preview address (hub.web.preview_port; the shell's data-preview-*).
3
+ // A module of its own: a tab that loaded panel-hub.js or the Hub's words before E keeps them, so E's words come only from
4
+ // here. What the fleet's panel has that the Hub has not (Files & changes, Share page) is never loaded here.
5
+ import { register, t } from "/assets/app-i18n.js";
6
+ import { confirmDialog } from "/assets/ui-confirm.js";
7
+ import "/assets/preview.js";
8
+ import { claimPanel, openMarkdown, openPanel, panelClaims, panelStore, panelVersion, shownKey } from "/assets/preview-panel.js";
9
+ import { panelFeedback, setPanelFeedback } from "/assets/preview-panel-actions.js";
10
+
11
+ register("hubPreview", {
12
+ en: {
13
+ confirm: "Allow HTML previews in this browser?\n\nThis applies to this Hub in this browser only. A preview runs the agent's HTML in an isolated frame at the Hub's own preview address. It cannot use your Hub sign-in, but it may be able to send data out, and it can slow or freeze this tab. You still click Preview each time.",
14
+ notOffered: "Previews are not offered on this Hub. You can still download the page.",
15
+ whyOrigin: "Previews are off: this page is at {0}, but the Hub believes it is at {1}.",
16
+ whyOptin: "Previews are off in this browser. Allow them from the card's menu.",
17
+ },
18
+ "zh-TW": {
19
+ confirm: "要在這個瀏覽器允許 HTML 預覽嗎?\n\n只對這個瀏覽器裡的這個 Hub 有效。預覽會在 Hub 自己的預覽位址、一個隔離的框架裡執行 Agent 的 HTML。它用不到你的 Hub 登入,但可能把資料傳出去,也可能讓這個分頁變慢或卡住。每次仍要你按「預覽」才會執行。",
20
+ notOffered: "這個 Hub 不提供預覽。你仍然可以下載這一頁。",
21
+ whyOrigin: "預覽已關閉:這個頁面在 {0},但 Hub 認為自己在 {1}。",
22
+ whyOptin: "這個瀏覽器沒有允許預覽。可以從卡片的選單允許。",
23
+ },
24
+ });
25
+ const hp = (key, ...v) => t(`hubPreview.${key}`, ...v);
26
+
27
+ const P = () => globalThis.AgendPreview;
28
+ /** preview.js's words that name the fleet (its settings, "every device where you are signed in") say the Hub's here. */
29
+ const OWN = { pvServer_notOffered: "notOffered", pvWhyOrigin: "whyOrigin", pvWhyOptin: "whyOptin" };
30
+
31
+ let bootedFor = null; // the document the page's previews were set up for (one per page; a test's pages are several)
32
+ /**
33
+ * Once per page: what this Hub's shell said about previews (data-preview-origin/-boot, or why not). An older shell
34
+ * without them gives none — every card then says previews are not offered. The banner's "I understand" lasts for this
35
+ * tab (the Hub has no fleet session handle).
36
+ */
37
+ export function bootHubPreview(doc = typeof document !== "undefined" ? document : null) {
38
+ const p = P();
39
+ if (!p || !doc || !doc.body || bootedFor === doc) return;
40
+ bootedFor = doc;
41
+ p.init(doc.body.dataset, { text: (key, ...v) => {
42
+ if (Object.hasOwn(OWN, key)) return hp(OWN[key], ...v);
43
+ const k = `chat.${key}`, s = t(k, ...v);
44
+ return s === k ? null : s;
45
+ } });
46
+ if (typeof p.setBannerScope === "function") p.setBannerScope(null);
47
+ }
48
+
49
+ /** This browser's opt-in for this Hub (its own origin's storage): asks once, in the Hub's words. As the fleet's
50
+ * setPreviewOptIn: commit(apply) runs the change (the panel's Allow wraps it). Resolves to the choice in force. */
51
+ export async function setHubPreviewOptIn(on, commit = (apply) => apply()) {
52
+ const p = P();
53
+ if (!p) return false;
54
+ if (on && !p.optedIn() && !(await confirmDialog({ message: hp("confirm"), confirmLabel: t("chat.pvAllowButton") }))) on = false;
55
+ commit(() => p.setOptIn(on));
56
+ return p.optedIn();
57
+ }
58
+
59
+ /** The HTML as a file (application/octet-stream, never opened), as the fleet's chat saves it. */
60
+ export function downloadHtml(code, name) {
61
+ const url = URL.createObjectURL(new Blob([code], { type: "application/octet-stream" }));
62
+ const a = document.createElement("a"); a.href = url; a.download = typeof name === "string" && name.trim() ? name.trim() : "reply.html"; a.className = "offscreen";
63
+ document.body.appendChild(a); a.click(); a.remove();
64
+ setTimeout(() => URL.revokeObjectURL(url), 1000);
65
+ }
66
+
67
+ /** The panel's key for one room: what its cards open the panel under (the fleet uses the instance's name). */
68
+ export const roomPanelKey = (roomId) => `hub-room:${roomId}`;
69
+
70
+ /** The thread's opts.panel for one room: the panel calls, each open put under the room's key. */
71
+ export function roomPanelOpts(key) {
72
+ return {
73
+ shown: shownKey, version: panelVersion, claim: claimPanel, claims: panelClaims,
74
+ open: (spec, o) => openPanel({ ...spec, instance: key }, o),
75
+ openMarkdown: (spec) => openMarkdown({ ...spec, instance: key }),
76
+ };
77
+ }
78
+
79
+ /** Whether the panel shows a page of this room now. */
80
+ export const panelOpenFor = (key) => { const s = panelStore.get(); return !!(s && s.open && s.open.instance === key); };
81
+
82
+ /**
83
+ * The panel's "Reply about this page", "Point at it" and errors put their lines in this room's composer. The Hub has
84
+ * no reply-to (one asker, one conversation), so only the lines are added — each once — for the person to edit and
85
+ * send. deps: { findMsg(key), addLine(line), focus() }. Returns the release (called when the room leaves): it clears
86
+ * only its own deps — a room bound after it keeps its own. The room's page closes with the panel itself (PreviewPanel
87
+ * closes on unmount, as in the fleet: the room view is keyed by the room).
88
+ */
89
+ export function bindRoomFeedback(deps) {
90
+ const mine = {
91
+ findMsg: (_instance, key) => deps.findMsg(key),
92
+ startReply: () => {}, clearReply: () => {},
93
+ addToDraft: (_instance, line) => deps.addLine(line),
94
+ focus: () => deps.focus(),
95
+ };
96
+ setPanelFeedback(mine);
97
+ return () => { if (panelFeedback() === mine) setPanelFeedback(null); };
98
+ }
99
+
100
+ /** A line added to a draft, once: on its own line after what is there. */
101
+ export const draftWithLine = (d, line) => (!line || d.split("\n").includes(line) ? d : d ? `${d.replace(/\n+$/, "")}\n${line}` : line);
@@ -5,13 +5,14 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hub", {
7
7
  en: {
8
+ allowOnHub: "Allow someone to ask…",
8
9
  preview: "Preview: the Hub connection isn't available in this build yet, so nothing here leaves this page.",
9
10
  // The member's switcher
10
11
  myFleet: "My fleet", hub: "Hub", openHubTab: "Open {0} in a new tab", switcher: "Workspace",
11
12
  // The Hub's own pages
12
13
  askTitle: "Ask", askEmpty: "No agents you can ask yet", askHint: "When an owner shares an agent with you, it appears here with who allowed it.",
13
14
  exposuresTitle: "My exposures", exposuresEmpty: "You don't share any agents yet",
14
- exposuresHint: "Share an agent from your own fleet: Settings → Access & security → Connect to a Hub.",
15
+ exposuresHint: "Share an agent from your own fleet: Settings → Hub → Connect to a Hub.",
15
16
  adminTitle: "Administration",
16
17
  // The Hub workspace (S3b): sign-in, Ask, My exposures, Administration
17
18
  signedOutHub: "Not signed in", signOut: "Sign out", signInTitle: "Sign in to the Hub",
@@ -79,11 +80,12 @@ register("hub", {
79
80
  errNotPaired: "Connect to a Hub first.", withdrawPending: "Withdrawn here. The Hub will be told when it can be reached.",
80
81
  },
81
82
  "zh-TW": {
83
+ allowOnHub: "允許他人提問…",
82
84
  preview: "預覽:這個版本還不能真正連線到 Hub,這裡的操作不會離開這個頁面。",
83
85
  myFleet: "我的 Fleet", hub: "Hub", openHubTab: "在新分頁開啟 {0}", switcher: "工作區",
84
86
  askTitle: "提問", askEmpty: "目前還沒有你可以提問的 Agent", askHint: "有人把 Agent 開放給你之後,它會出現在這裡,並註明是誰授權的。",
85
87
  exposuresTitle: "我的公開 Agent", exposuresEmpty: "你還沒有公開任何 Agent",
86
- exposuresHint: "請在自己的 Fleet 公開 Agent:設定 → 存取與安全 → 連線到 Hub。",
88
+ exposuresHint: "請在自己的 Fleet 公開 Agent:設定 → Hub → 連線到 Hub。",
87
89
  adminTitle: "管理",
88
90
  signedOutHub: "尚未登入", signOut: "登出", signInTitle: "登入 Hub",
89
91
  signInLead: "請使用組織帳號登入。密碼只送給目錄服務驗證,不會被保存。",
@@ -0,0 +1,56 @@
1
+ // #3190 Part 3c: signing a credential profile in on a paired computer, from Settings → Accounts. It is the same sign-in controls as the host's
2
+ // (structured-signin.js: the link, the code box, the outcome), pointed at ONE computer and ONE profile — the same /ui/browser-backend-signins with
3
+ // `?machine=&profile=` — so there is no second sign-in screen to learn. Only a Claude subscription account is signed in from here: a Console account is kept
4
+ // outside the profile's folder, so the person runs `agend-runtime login claude-code NAME` on that computer (said in the dialog).
5
+ // A module of its own, its words registered here: a tab that loaded an older accounts-view.js keeps working, and this never meets an older cached strings file.
6
+ import { html, useEffect, useRef } from "/assets/app-html.js";
7
+ import { register, t, lang, onLang } from "/assets/app-i18n.js";
8
+ import { createStore } from "/assets/app-store.js";
9
+ import { closeDialog, showDialog } from "/assets/app-shell.js";
10
+ import { Dialog } from "/assets/ui-dialog.js";
11
+ import { mountStructuredSignIns } from "./structured-signin.js";
12
+ import { cliLabel } from "./cli-picker.js";
13
+
14
+ register("machineSignin", {
15
+ en: {
16
+ title: "Sign in {0} account “{1}” on {2}",
17
+ lead: "AgEnD asks {0}'s Runtime to sign this account in. You get a link here, open it in your browser, and paste back the code it shows. The sign-in is kept on that computer, and anyone who can sign in to that Windows user can use it.",
18
+ console: "Using an Anthropic Console account instead? Run this on that computer: {0}",
19
+ close: "Close",
20
+ },
21
+ "zh-TW": {
22
+ title: "在 {2} 登入 {0} 帳號「{1}」",
23
+ lead: "AgEnD 會請 {0} 的 Runtime 登入這個帳號。這裡會給你一個連結,在瀏覽器開啟後,把它顯示的代碼貼回來。登入資料保存在那台電腦上,能登入該 Windows 使用者的人都能使用它。",
24
+ console: "要改用 Anthropic Console 帳號嗎?請在那台電腦上執行:{0}",
25
+ close: "關閉",
26
+ },
27
+ });
28
+ const tm = (k, ...v) => t(`machineSignin.${k}`, ...v);
29
+
30
+ /** What the Accounts view reads to refresh itself and to keep a second sign-in from starting: the open dialog's current phase for the computer's profile. */
31
+ export const machineSignInStore = createStore({ phase: "", reason: "" });
32
+
33
+ /** The endpoint of one profile's sign-in on one computer. */
34
+ export const machineSignInEndpoint = (machineId, profile) => `/ui/browser-backend-signins?machine=${encodeURIComponent(machineId)}&profile=${encodeURIComponent(profile)}`;
35
+
36
+ /** `machine`: `{ id, name }`; `profile`: the credential profile's name on that computer. */
37
+ export function MachineSignInDialog({ machine, profile, onClose }) {
38
+ const root = useRef(null), close = onClose || closeDialog;
39
+ useEffect(() => {
40
+ const cards = mountStructuredSignIns(root.current, { endpoint: machineSignInEndpoint(machine.id, profile), lang, machine: true, changed: (next) => {
41
+ const login = next && next.login;
42
+ machineSignInStore.set({ phase: login ? login.phase : "", reason: (login && login.reason) || "" });
43
+ } });
44
+ const unlisten = onLang(() => cards.relabel());
45
+ return () => { unlisten(); cards.dispose(); machineSignInStore.set({ phase: "", reason: "" }); };
46
+ }, [machine.id, profile]);
47
+ return html`<${Dialog} title=${tm("title", cliLabel("claude-code"), profile, machine.name)} onClose=${close}
48
+ actions=${html`<button type="button" class="btn" onClick=${close}>${tm("close")}</button>`}>
49
+ <p>${tm("lead", machine.name)}</p>
50
+ <p class="note">${tm("console", `agend-runtime login claude-code ${profile}`)}</p>
51
+ <div class="signin-browser" ref=${root}></div>
52
+ </${Dialog}>`;
53
+ }
54
+
55
+ /** Open the dialog for one profile on one computer. */
56
+ export function openMachineSignIn({ machine, profile }) { showDialog(MachineSignInDialog, { machine: { id: machine.id, name: machine.name }, profile }); }
@@ -595,7 +595,7 @@ export function CreateInstanceDialog({ onClose }) {
595
595
  <ol class="agent-create-steps" aria-label=${tr("progress")}>${["runtimeStep","configureStep","doneStep"].map((label,index) => html`<li key=${label} class=${index+1 === step ? "current" : index+1 < step ? "complete" : ""} aria-current=${index+1 === step ? "step" : undefined}><span class="agent-create-step-number">${index+1 < step ? html`<${Icon} name="check" size=${13} />` : index+1}</span><span>${tr(label)}</span></li>`)}</ol>
596
596
  ${step === 1 ? html`<section class="agent-create-stage"><h3 ref=${heading} tabindex="-1">${tr("where")}</h3><p class="note">${tr("runtimeLead")}</p>
597
597
  <${RuntimePicker} value=${runtime} onChange=${chooseRuntime} windowsEnabled=${windowsCli} legend=${tr("environment")} machineId=${machineId} machines=${machines} onMachineChange=${id => chooseRuntime("windows",id)} onRefresh=${machineCatalog.refresh} loaded=${!!machineCatalog.data && !machineCatalog.error} />
598
- ${machineCatalog.loading && !machineCatalog.data ? html`<p class="note" role="status">${tr("machineLoading")}</p>` : null}
598
+ ${machineCatalog.loading && !machineCatalog.data ? html`<${Skeleton} variant="rows" lines=${2} label=${tr("machineLoading")} />` : null}
599
599
  ${machineCatalog.error ? html`<p class="note" role="alert">${tr("machineFailed")}</p>` : null}
600
600
  <a class="note runtime-manage-link" href="/settings/runtimes">${tr("manage")}</a>
601
601
  ${runtime ? html`<div class="agent-create-cli">${backendField}</div>` : null}