@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
package/dist/web-api.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { hubModeOf, hubNameOf } from "./hub-mode.js";
2
+ import { validCredentialProfileName } from "./runtime-credential-profiles.js";
2
3
  import { CANVAS_WORKER_EXPERIMENTAL_MESSAGE } from "./web-experimental.js";
3
4
  import { MachineSlotLimitError } from "./windows-agents.js";
4
5
  import { daemonTopicMode } from "./web-only-fleet.js";
@@ -47,7 +48,8 @@ import { WEB_CHAT_CARDS_OVERFLOW, catchUpWindow, newWebMessageId, parseLastEvent
47
48
  import { PAGE_SHARE_LIMITS, htmlFences, htmlTitle } from "./page-share.js";
48
49
  import { attachmentDelivery, createPartFile, displayName, fileTooLargeText, INLINE_MIME, isFileId, MEDIA_RANGE_MAX, publicAttachment, UPLOAD_LIMITS, UPLOAD_MAX_MS, UPLOAD_STALL_MS, UploadSniffer, uploadLimits, wellFormed } from "./web-upload.js";
49
50
  import { getAgendHome } from "./paths.js";
50
- import { workspaceChanges, workspaceFile, workspaceImage, workspaceList, workspaceRoot, WorkspaceError } from "./agent-workspace.js";
51
+ import { workspaceChanges, workspaceFile, workspaceFileDiff, workspaceImage, workspaceList, workspaceRoot, WorkspaceError } from "./agent-workspace.js";
52
+ import { resolveFollowSteps } from "./workspace-follow.js";
51
53
  import { isGeneralInstance } from "./general-instance.js";
52
54
  import { resolveToolSet } from "./tool-permissions.js";
53
55
  import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
@@ -249,6 +251,8 @@ function visibleNeeds(ctx, gateway, items) {
249
251
  const item = i;
250
252
  if (item.type === "config" || item.type === "hub")
251
253
  return false; // member-local diagnostics/proposals never cross a public link
254
+ if (item.type === "runtime")
255
+ return false;
252
256
  if (item.type !== "task")
253
257
  return true;
254
258
  const code = item.card?.code;
@@ -1111,18 +1115,85 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
1111
1115
  json(res, 403, { error: "sign_in_needs_a_local_admin" });
1112
1116
  return true;
1113
1117
  }
1114
- if (!["GET", "POST"].includes(req.method ?? "") || [...url.searchParams.keys()].length) {
1118
+ if (!["GET", "POST"].includes(req.method ?? "")) {
1115
1119
  json(res, 404, { error: "not_found" });
1116
1120
  return true;
1117
1121
  }
1118
- const service = ctx.browserBackendSignIns;
1119
- if (!service) {
1122
+ // #3190 Part 3c: `?machine=<id>&profile=<name>` addresses the same sign-in controls for a credential profile on a paired computer (machine-signins.ts). Nothing else
1123
+ // is accepted in the query, and both are checked in full before anything else happens.
1124
+ const keys = [...url.searchParams.keys()];
1125
+ let target = null;
1126
+ if (keys.length) {
1127
+ const machine = url.searchParams.get("machine"), profile = url.searchParams.get("profile");
1128
+ if (keys.length !== 2 || !machine || !profile || !/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(machine) || !validCredentialProfileName(profile)) {
1129
+ json(res, 404, { error: "not_found" });
1130
+ return true;
1131
+ }
1132
+ target = { machine, profile };
1133
+ }
1134
+ // Only the one that is asked for is looked up: the host's creates its checklist state, a computer's does not need it.
1135
+ const service = target ? undefined : ctx.browserBackendSignIns, machines = target ? ctx.machineSignIns : undefined;
1136
+ if (target ? !machines : !service) {
1120
1137
  json(res, 404, { error: "sign_in_unavailable" });
1121
1138
  return true;
1122
1139
  }
1123
1140
  void (async () => {
1124
1141
  let result;
1125
- if (reading)
1142
+ if (target && machines) {
1143
+ if (reading)
1144
+ result = machines.snapshot(owner, target);
1145
+ else {
1146
+ let bytes;
1147
+ try {
1148
+ bytes = await readBoundedWebBody(req, 8192);
1149
+ }
1150
+ catch {
1151
+ json(res, 413, { error: "sign_in_body_bound" });
1152
+ return;
1153
+ }
1154
+ if (!permitWebContinuation(req, res, ctx))
1155
+ return;
1156
+ if (who() !== owner) {
1157
+ json(res, 409, { error: "signin_session_expired" });
1158
+ return;
1159
+ }
1160
+ let body;
1161
+ try {
1162
+ body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
1163
+ }
1164
+ catch {
1165
+ json(res, 400, { error: "sign_in_json" });
1166
+ return;
1167
+ }
1168
+ // Only what a computer's sign-in can do: start (Claude Code, subscription: the Runtime builds the command), answer a prompt, cancel, read again.
1169
+ const parsed = z.discriminatedUnion("operation", [
1170
+ z.strictObject({ operation: z.literal("start"), backend: z.literal("claude-code"), relogin: z.boolean().optional() }),
1171
+ z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
1172
+ z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
1173
+ z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
1174
+ ]) }),
1175
+ z.strictObject({ operation: z.literal("cancel") }), z.strictObject({ operation: z.literal("refresh") }),
1176
+ ]).safeParse(body);
1177
+ if (!parsed.success) {
1178
+ json(res, 400, { error: "invalid_signin_action" });
1179
+ return;
1180
+ }
1181
+ const action = parsed.data;
1182
+ if (action.operation === "start")
1183
+ result = await machines.begin(owner, target, action.relogin === true);
1184
+ else if (action.operation === "input")
1185
+ result = await machines.input(owner, target, action.id, action.revision, action.action);
1186
+ else if (action.operation === "cancel")
1187
+ result = await machines.cancel(owner, target);
1188
+ else
1189
+ result = machines.snapshot(owner, target);
1190
+ }
1191
+ }
1192
+ else if (!service) {
1193
+ json(res, 404, { error: "sign_in_unavailable" });
1194
+ return;
1195
+ }
1196
+ else if (reading)
1126
1197
  result = await service.refresh(owner);
1127
1198
  else {
1128
1199
  let bytes;
@@ -1184,7 +1255,7 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
1184
1255
  json(res, 200, result);
1185
1256
  })().catch(error => {
1186
1257
  const code = error instanceof Error ? error.message : "";
1187
- const safe = /^(?:signin_(?:session_expired|console_only|cleanup_failed|action_(?:stale|invalid|ended|busy))|invalid_signin_(?:action|checklist))$/.test(code) ? code : "signin_failed";
1258
+ const safe = /^(?:signin_(?:session_expired|console_only|cleanup_failed|action_(?:stale|invalid|ended|busy))|invalid_signin_(?:action|checklist)|machine_(?:unknown|offline|unsupported|accounts_off|unreachable|profile_not_owned|busy)|invalid_machine_target)$/.test(code) ? code : "signin_failed";
1188
1259
  if (!res.destroyed && !res.writableEnded)
1189
1260
  json(res, safe === "signin_cleanup_failed" || safe === "signin_failed" ? 503 : 409, { error: safe });
1190
1261
  });
@@ -1299,6 +1370,233 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
1299
1370
  catch { /* response ended */ } });
1300
1371
  return true;
1301
1372
  }
1373
+ /**
1374
+ * #3212 PR 2: Settings → Accounts — `POST /ui/accounts/<backend>` `{ name }` adds a named account (a credential profile's
1375
+ * folder); `DELETE /ui/accounts/<backend>/<name>` `{ confirm: <name> }` removes one (accounts-profiles.ts: every refusal
1376
+ * deletes nothing). PR 3: `POST /ui/accounts/<backend>/signout` `{ profile: <name> | null, confirm: true }` signs an
1377
+ * account out with the CLI's own logout (accounts-signout.ts). The fleet's local admin session only, as the sign-in routes: never the CLI's header token, a guest,
1378
+ * a read session, the public link or the gateway — refused before the body is read, and again after it.
1379
+ */
1380
+ const ACCOUNT_STATUS = {
1381
+ backend: 400, name: 400, confirm: 400, exists: 409, case_clash: 409, unsafe_root: 409, in_use: 409, users_unknown: 409, signing_in: 409, missing: 404,
1382
+ unsafe: 409, default_home: 409, failed: 500, unsupported: 400,
1383
+ // #3190 Part 3c: a paired computer (the Runtime there decides; these are what the server can say before it asks, or what the computer answered).
1384
+ machine_unknown: 404, machine_offline: 409, machine_unsupported: 409, machine_accounts_off: 409, machine_unreachable: 502, machine_profile_not_owned: 409,
1385
+ machine_refused: 409, machine_default_login: 409,
1386
+ };
1387
+ function handleAccountWrite(req, res, url, ctx, path, method) {
1388
+ res.setHeader("Cache-Control", "private, no-store");
1389
+ res.setHeader("X-Content-Type-Options", "nosniff");
1390
+ if (gatewayRequestContext(req)) {
1391
+ json(res, 403, { error: "accounts_not_over_public_link" });
1392
+ return true;
1393
+ }
1394
+ const who = () => {
1395
+ const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
1396
+ if (v.kind !== "allow")
1397
+ return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
1398
+ if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
1399
+ return { error: "accounts_need_a_local_admin", status: 403 };
1400
+ return { handle: v.session.handle, label: v.session.label };
1401
+ };
1402
+ const first = who();
1403
+ if ("error" in first) {
1404
+ json(res, first.status, { error: first.error });
1405
+ return true;
1406
+ }
1407
+ const add = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})$/.exec(path) : null;
1408
+ const remove = method === "DELETE" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/([^/]{1,200})$/.exec(path) : null;
1409
+ const signout = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/signout$/.exec(path) : null;
1410
+ if (!add && !remove && !signout) {
1411
+ json(res, 404, { error: "not_found" });
1412
+ return true;
1413
+ }
1414
+ const handler = add ? ctx.addAccountProfile : remove ? ctx.removeAccountProfile : ctx.signOutAccount;
1415
+ if (typeof handler !== "function") {
1416
+ json(res, 404, { error: "not_found" });
1417
+ return true;
1418
+ }
1419
+ let target = "";
1420
+ if (remove) {
1421
+ try {
1422
+ target = decodeURIComponent(remove[2]);
1423
+ }
1424
+ catch {
1425
+ json(res, 400, { error: "name" });
1426
+ return true;
1427
+ }
1428
+ }
1429
+ (async () => {
1430
+ let bytes;
1431
+ try {
1432
+ bytes = await readBoundedWebBody(req, 1024);
1433
+ }
1434
+ catch {
1435
+ json(res, 413, { error: "accounts_body_bound" });
1436
+ return;
1437
+ }
1438
+ if (!permitWebContinuation(req, res, ctx))
1439
+ return;
1440
+ const now = who();
1441
+ if ("error" in now) {
1442
+ json(res, now.status, { error: now.error });
1443
+ return;
1444
+ }
1445
+ if (now.handle !== first.handle) {
1446
+ json(res, 409, { error: "accounts_session_changed" });
1447
+ return;
1448
+ }
1449
+ let body;
1450
+ try {
1451
+ body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
1452
+ }
1453
+ catch {
1454
+ json(res, 400, { error: "accounts_json" });
1455
+ return;
1456
+ }
1457
+ // #3190 Part 3c: `machine` (a paired computer's id) turns the same route into that computer's account; the person's audit name is the session's opaque handle.
1458
+ const machineId = z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/).optional();
1459
+ const onMachine = (id) => {
1460
+ if (id === undefined)
1461
+ return undefined;
1462
+ return /^[a-f0-9]{16}$/.test(now.handle) ? { id, actor: `admin:${now.handle}` } : "refused";
1463
+ };
1464
+ const fail = (r) => json(res, ACCOUNT_STATUS[r.error] ?? 409, { error: r.error, ...(r.clash ? { clash: r.clash } : {}), ...(r.users ? { users: r.users } : {}), ...(r.message ? { message: r.message } : {}) });
1465
+ if (add) {
1466
+ const parsed = z.strictObject({ name: z.string().max(200), machine: machineId }).safeParse(body);
1467
+ if (!parsed.success) {
1468
+ json(res, 400, { error: "accounts_args" });
1469
+ return;
1470
+ }
1471
+ const machine = onMachine(parsed.data.machine);
1472
+ if (machine === "refused") {
1473
+ json(res, 403, { error: "accounts_need_a_local_admin" });
1474
+ return;
1475
+ }
1476
+ const r = await (machine ? ctx.addAccountProfile(add[1], parsed.data.name, now.label, machine) : ctx.addAccountProfile(add[1], parsed.data.name, now.label));
1477
+ if (r.ok)
1478
+ json(res, 200, { added: parsed.data.name, ...(machine ? { machine: machine.id } : {}) });
1479
+ else
1480
+ fail(r);
1481
+ }
1482
+ else if (remove) {
1483
+ const parsed = z.strictObject({ confirm: z.string().max(200), machine: machineId }).safeParse(body);
1484
+ if (!parsed.success) {
1485
+ json(res, 400, { error: "accounts_args" });
1486
+ return;
1487
+ }
1488
+ const machine = onMachine(parsed.data.machine);
1489
+ if (machine === "refused") {
1490
+ json(res, 403, { error: "accounts_need_a_local_admin" });
1491
+ return;
1492
+ }
1493
+ const r = await (machine ? ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label, machine) : ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label));
1494
+ if (r.ok)
1495
+ json(res, 200, { removed: target, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
1496
+ else
1497
+ fail(r);
1498
+ }
1499
+ else {
1500
+ const parsed = z.strictObject({ profile: z.string().max(200).nullable(), confirm: z.literal(true), machine: machineId }).safeParse(body);
1501
+ if (!parsed.success) {
1502
+ json(res, 400, { error: "accounts_args" });
1503
+ return;
1504
+ }
1505
+ const machine = onMachine(parsed.data.machine);
1506
+ if (machine === "refused") {
1507
+ json(res, 403, { error: "accounts_need_a_local_admin" });
1508
+ return;
1509
+ }
1510
+ const r = await (machine ? ctx.signOutAccount(signout[1], parsed.data.profile, parsed.data.confirm, now.label, machine) : ctx.signOutAccount(signout[1], parsed.data.profile, parsed.data.confirm, now.label));
1511
+ if (r.ok)
1512
+ json(res, 200, { signedOut: parsed.data.profile, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
1513
+ else
1514
+ fail(r);
1515
+ }
1516
+ })().catch(() => { try {
1517
+ json(res, 500, { error: "accounts_request_failed" });
1518
+ }
1519
+ catch { /* response ended */ } });
1520
+ return true;
1521
+ }
1522
+ /**
1523
+ * #3292: Settings → Accounts → Keep sign-in alive — `POST /ui/accounts/keep-alive` `{ backend, profile: <name> | null,
1524
+ * enabled, fallback? }`. The same gate as the other account writes: the fleet's local admin session only, refused before
1525
+ * the body is read and again after it; never the gateway, a guest, a read session or the CLI's header token.
1526
+ */
1527
+ const KEEPALIVE_STATUS = { backend: 400, profile: 400, fallback: 400, write: 500 };
1528
+ function handleAccountKeepAlive(req, res, url, ctx, method) {
1529
+ res.setHeader("Cache-Control", "private, no-store");
1530
+ res.setHeader("X-Content-Type-Options", "nosniff");
1531
+ if (gatewayRequestContext(req)) {
1532
+ json(res, 403, { error: "accounts_not_over_public_link" });
1533
+ return true;
1534
+ }
1535
+ if (method !== "POST") {
1536
+ json(res, 405, { error: "method_not_allowed" });
1537
+ return true;
1538
+ }
1539
+ const who = () => {
1540
+ const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
1541
+ if (v.kind !== "allow")
1542
+ return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
1543
+ if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
1544
+ return { error: "accounts_need_a_local_admin", status: 403 };
1545
+ return { handle: v.session.handle, label: v.session.label };
1546
+ };
1547
+ const first = who();
1548
+ if ("error" in first) {
1549
+ json(res, first.status, { error: first.error });
1550
+ return true;
1551
+ }
1552
+ if (typeof ctx.setAccountKeepAlive !== "function") {
1553
+ json(res, 404, { error: "not_found" });
1554
+ return true;
1555
+ }
1556
+ (async () => {
1557
+ let bytes;
1558
+ try {
1559
+ bytes = await readBoundedWebBody(req, 1024);
1560
+ }
1561
+ catch {
1562
+ json(res, 413, { error: "accounts_body_bound" });
1563
+ return;
1564
+ }
1565
+ if (!permitWebContinuation(req, res, ctx))
1566
+ return;
1567
+ const now = who();
1568
+ if ("error" in now) {
1569
+ json(res, now.status, { error: now.error });
1570
+ return;
1571
+ }
1572
+ if (now.handle !== first.handle) {
1573
+ json(res, 409, { error: "accounts_session_changed" });
1574
+ return;
1575
+ }
1576
+ let body;
1577
+ try {
1578
+ body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
1579
+ }
1580
+ catch {
1581
+ json(res, 400, { error: "accounts_json" });
1582
+ return;
1583
+ }
1584
+ const parsed = z.strictObject({ backend: z.string().max(32), profile: z.string().max(200).nullable(), enabled: z.boolean(), fallback: z.boolean().optional() }).safeParse(body);
1585
+ if (!parsed.success) {
1586
+ json(res, 400, { error: "accounts_args" });
1587
+ return;
1588
+ }
1589
+ const r = ctx.setAccountKeepAlive(parsed.data.backend, parsed.data.profile, parsed.data.enabled, parsed.data.fallback, now.label);
1590
+ if (r.ok)
1591
+ json(res, 200, { backend: parsed.data.backend, profile: parsed.data.profile, enabled: parsed.data.enabled });
1592
+ else
1593
+ json(res, KEEPALIVE_STATUS[r.error] ?? 409, { error: r.error });
1594
+ })().catch(() => { try {
1595
+ json(res, 500, { error: "accounts_request_failed" });
1596
+ }
1597
+ catch { /* response ended */ } });
1598
+ return true;
1599
+ }
1302
1600
  /**
1303
1601
  * #1629 r4 §4 (r4-5): mods — a person's import (stage, then commit), uninstall and export. Every route is a signed-in
1304
1602
  * session's, writes an admin's: never the CLI's header token (the way an agent could reach it) and never the public link
@@ -2289,11 +2587,13 @@ export function handleWebRequest(req, res, url, ctx) {
2289
2587
  json(res, 404, { error: "workspace_not_offered" });
2290
2588
  return true;
2291
2589
  }
2292
- if (!["changes", "list", "file", "image"].includes(op)) {
2293
- json(res, 400, { error: "op: changes | list | file | image" });
2590
+ if (!["changes", "list", "file", "image", "diff", "follow"].includes(op)) {
2591
+ json(res, 400, { error: "op: changes | list | file | image | diff | follow" });
2294
2592
  return true;
2295
2593
  }
2296
2594
  const workDir = String(cfg.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~");
2595
+ const backend = String(cfg.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code");
2596
+ const daemon = ctx.daemons.get(instance);
2297
2597
  void (async () => {
2298
2598
  try {
2299
2599
  const ws = await workspaceRoot(workDir, getAgendHome());
@@ -2305,6 +2605,19 @@ export function handleWebRequest(req, res, url, ctx) {
2305
2605
  return { kind: "json", body: await workspaceList(ws, p.get("path") ?? "") };
2306
2606
  if (op === "file")
2307
2607
  return { kind: "json", body: await workspaceFile(ws, p.get("path")) };
2608
+ if (op === "diff")
2609
+ return { kind: "json", body: await workspaceFileDiff(ws, p.get("path")) };
2610
+ if (op === "follow") {
2611
+ // #3160: this turn's file steps, from the CLI's own record, confined to this folder (outside paths dropped,
2612
+ // secret-looking ones marked hidden). Polled by an open panel with Follow on; nothing is pushed.
2613
+ const supported = backend === "claude-code" || backend === "codex";
2614
+ const d = daemon;
2615
+ const after = Number(p.get("after") ?? 0), turnQ = p.get("turn");
2616
+ const snap = supported && d && typeof d.workspaceFollow === "function"
2617
+ ? d.workspaceFollow(Number.isSafeInteger(after) && after >= 0 ? after : 0, turnQ !== null && /^\d{1,9}$/.test(turnQ) ? Number(turnQ) : undefined, p.get("scope") ?? undefined)
2618
+ : { scope: "", turn: 0, steps: [], last: 0 };
2619
+ return { kind: "json", body: { supported, running: !!d, scope: snap.scope, turn: snap.turn, last: snap.last, steps: await resolveFollowSteps(ws, snap.steps) } };
2620
+ }
2308
2621
  return { kind: "image", body: await workspaceImage(ws, p.get("path")) };
2309
2622
  };
2310
2623
  const out = await answer();
@@ -2312,6 +2625,22 @@ export function handleWebRequest(req, res, url, ctx) {
2312
2625
  json(res, 403, { error: "workspace_needs_a_local_admin" });
2313
2626
  return;
2314
2627
  }
2628
+ const current = ctx.fleetConfig?.instances[instance];
2629
+ if (current !== cfg || String(current.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~") !== workDir
2630
+ || String(current.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code") !== backend
2631
+ || current.runtime === "windows" || current.machine_id || isGeneralInstance(ctx.fleetConfig, instance)
2632
+ || resolveToolSet(current, instance) === "coordinator" || (op === "follow" && ctx.daemons.get(instance) !== daemon)) {
2633
+ json(res, 403, { error: "workspace_changed" });
2634
+ return;
2635
+ }
2636
+ if (op === "follow" && out.kind === "json") {
2637
+ const frame = out.body;
2638
+ const live = daemon;
2639
+ if (frame.supported && frame.running && frame.scope && live?.workspaceFollow?.(0).scope !== frame.scope) {
2640
+ json(res, 403, { error: "workspace_changed" });
2641
+ return;
2642
+ }
2643
+ }
2315
2644
  if (out.kind === "image") {
2316
2645
  res.writeHead(200, { "Content-Type": out.body.mime, "Content-Length": String(out.body.bytes.length), "Content-Security-Policy": "default-src 'none'; sandbox" });
2317
2646
  res.end(out.body.bytes);
@@ -3080,6 +3409,11 @@ export function handleWebRequest(req, res, url, ctx) {
3080
3409
  return handleBrowserBackendSignIns(req, res, url, ctx);
3081
3410
  if (path === "/ui/backend-login" || path.startsWith("/ui/backend-login/"))
3082
3411
  return handleBackendLogin(req, res, url, ctx, path, method);
3412
+ // #3292: before the accounts prefix — its Add pattern (`POST /ui/accounts/<backend>`) would read "keep-alive" as a backend.
3413
+ if (path === "/ui/accounts/keep-alive")
3414
+ return handleAccountKeepAlive(req, res, url, ctx, method);
3415
+ if (path.startsWith("/ui/accounts/"))
3416
+ return handleAccountWrite(req, res, url, ctx, path, method);
3083
3417
  // #1386: Acknowledge a "Needs you" delivery item — a session write (CSRF, checked by the gate) or the CLI's header
3084
3418
  // token. Who did it is recorded by principal: the session's public handle, never the session id or a credential.
3085
3419
  // #2910 D2: a web-only fleet's Notices — what General would have said. Admins only (never a guest: not in
@@ -4501,12 +4835,12 @@ function webDeliveryFailure(err) {
4501
4835
  if (/No warm slot is free/.test(message))
4502
4836
  return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
4503
4837
  if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
4504
- return { reason: "wake_credentials", error: "The instance could not sign in. Check its account on the host, then retry." };
4838
+ return { reason: "wake_credentials", error: "The instance could not sign in. Sign it in from Settings → Agents → AI sign-ins and API keys → Accounts, or send /login in chat, then retry." };
4505
4839
  if (/timed? out|timeout/i.test(message))
4506
- return { reason: "wake_timeout", error: "The instance did not become ready in time. Retry, or check its status on the host." };
4840
+ return { reason: "wake_timeout", error: "The instance did not become ready in time. Retry, or check its status in Fleet." };
4507
4841
  if (/Cannot wake stopped|no longer configured/.test(message))
4508
- return { reason: "instance_stopped", error: "This instance was stopped or removed. Start it on the host before retrying." };
4509
- return { reason: "delivery_unavailable", error: "The instance could not receive this message. Check its status on the host, then retry." };
4842
+ return { reason: "instance_stopped", error: "This instance was stopped or removed. Start it from the agent's chat menu → Start instance, then retry." };
4843
+ return { reason: "delivery_unavailable", error: "The instance could not receive this message. Check its status in Fleet, then retry." };
4510
4844
  }
4511
4845
  /** Handle POST /ui/send — extracted for readability. */
4512
4846
  /** Each web server's own memory of the sends it accepted by clientId (web-send-dedupe.ts). */
@@ -5125,7 +5459,16 @@ function shellOwnerCss(ctx, mode, viewer) {
5125
5459
  * `hub_member.enabled`, never over the public link. `hub` is only the Hub listener's own workspace page
5126
5460
  * (serveHubWorkspaceShell). Nothing otherwise: no Hub UI is drawn and no Hub module loads.
5127
5461
  */
5128
- function hubBodyAttrs(req, config) {
5462
+ function hubBodyAttrs(req, ctx) {
5463
+ // alpha.6 user report: the mark read the parsed FleetConfig, which never has `hub_member` — a saved switch (or one in the
5464
+ // file at start) never marked the page, so Connect to a Hub never loaded. It reads what the runtime reads: the raw file.
5465
+ let config = null;
5466
+ try {
5467
+ config = (ctx.getRawFleetConfig?.() ?? null);
5468
+ }
5469
+ catch {
5470
+ config = null;
5471
+ }
5129
5472
  // hub.md §1: member handlers are local-owner-only and unavailable through the public gateway — no member mark there.
5130
5473
  return hubModeOf(config).member && !gatewayRequestContext(req) ? ' data-hub="member"' : "";
5131
5474
  }
@@ -5166,7 +5509,7 @@ function shellBodyTag(req, ctx, mode, viewer) {
5166
5509
  // #2478: search is offered over the public link unless web.search.public_link is false (the page then shows no entry).
5167
5510
  + `${gatewayRequestContext(req) && ctx.fleetConfig?.web?.search?.public_link === false ? ' data-search-link="0"' : ""}`
5168
5511
  // AgEnD Hub P1 (docs/design/hub-ui-client.md): the Hub's marks — only when a switch is on, never on a guest's page.
5169
- + `${mode === "full" && !viewer?.guest ? hubBodyAttrs(req, ctx.fleetConfig) : ""}`
5512
+ + `${mode === "full" && !viewer?.guest ? hubBodyAttrs(req, ctx) : ""}`
5170
5513
  // #1920 phase 3: a guest's page — the shell shows only what a guest may use, and who it is signed in as.
5171
5514
  + `${mode === "full" && viewer?.guest && viewer.owner ? guestBodyAttrs(ctx, viewer.owner, attr) : ""}>`;
5172
5515
  }