@songsid/agend 2.3.5-alpha.10 → 2.3.5-alpha.12

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 (319) hide show
  1. package/dist/accounts-view.d.ts +17 -0
  2. package/dist/accounts-view.js +24 -8
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/agent-cli-instructions.md +2 -2
  5. package/dist/auth-api.d.ts +48 -16
  6. package/dist/auth-api.js +83 -32
  7. package/dist/auth-api.js.map +1 -1
  8. package/dist/authority/settings-role.d.ts +56 -0
  9. package/dist/authority/settings-role.js +48 -0
  10. package/dist/authority/settings-role.js.map +1 -0
  11. package/dist/backend/claude-code.d.ts +2 -0
  12. package/dist/backend/claude-code.js +32 -6
  13. package/dist/backend/claude-code.js.map +1 -1
  14. package/dist/backend/cli-env-probe.js +6 -2
  15. package/dist/backend/cli-env-probe.js.map +1 -1
  16. package/dist/backend/codex.d.ts +5 -3
  17. package/dist/backend/codex.js +31 -13
  18. package/dist/backend/codex.js.map +1 -1
  19. package/dist/backend/credential-profile.d.ts +18 -0
  20. package/dist/backend/credential-profile.js +46 -0
  21. package/dist/backend/credential-profile.js.map +1 -1
  22. package/dist/backend/kiro.js +1 -1
  23. package/dist/backend/kiro.js.map +1 -1
  24. package/dist/backend/muse.d.ts +3 -1
  25. package/dist/backend/muse.js +31 -1
  26. package/dist/backend/muse.js.map +1 -1
  27. package/dist/backend/types.d.ts +17 -1
  28. package/dist/backend/types.js.map +1 -1
  29. package/dist/backend-availability.d.ts +15 -0
  30. package/dist/backend-availability.js +37 -1
  31. package/dist/backend-availability.js.map +1 -1
  32. package/dist/build-provenance.json +1 -1
  33. package/dist/bundled-tmux-guard.d.ts +4 -0
  34. package/dist/bundled-tmux-guard.js +7 -0
  35. package/dist/bundled-tmux-guard.js.map +1 -1
  36. package/dist/claude-auth-status.d.ts +20 -8
  37. package/dist/claude-auth-status.js +38 -22
  38. package/dist/claude-auth-status.js.map +1 -1
  39. package/dist/cli-audited.d.ts +60 -0
  40. package/dist/cli-audited.js +84 -0
  41. package/dist/cli-audited.js.map +1 -0
  42. package/dist/cli-capability.d.ts +36 -5
  43. package/dist/cli-capability.js +2 -2
  44. package/dist/cli-capability.js.map +1 -1
  45. package/dist/cli-caps-module.d.ts +5 -1
  46. package/dist/cli-caps-module.js +4 -2
  47. package/dist/cli-caps-module.js.map +1 -1
  48. package/dist/cli-registry-check.js +16 -2
  49. package/dist/cli-registry-check.js.map +1 -1
  50. package/dist/cli-registry.d.ts +56 -4
  51. package/dist/cli-registry.js +1 -1
  52. package/dist/cli-registry.js.map +1 -1
  53. package/dist/cli-spec-antigravity.d.ts +12 -1
  54. package/dist/cli-spec-antigravity.js +13 -1
  55. package/dist/cli-spec-antigravity.js.map +1 -1
  56. package/dist/cli-spec-claude-code.d.ts +9 -0
  57. package/dist/cli-spec-claude-code.js +4 -2
  58. package/dist/cli-spec-claude-code.js.map +1 -1
  59. package/dist/cli-spec-codex.d.ts +10 -1
  60. package/dist/cli-spec-codex.js +5 -3
  61. package/dist/cli-spec-codex.js.map +1 -1
  62. package/dist/cli-spec-grok.d.ts +5 -0
  63. package/dist/cli-spec-grok.js +6 -1
  64. package/dist/cli-spec-grok.js.map +1 -1
  65. package/dist/cli-spec-kiro-cli.d.ts +7 -1
  66. package/dist/cli-spec-kiro-cli.js +7 -3
  67. package/dist/cli-spec-kiro-cli.js.map +1 -1
  68. package/dist/cli-spec-muse.d.ts +2 -0
  69. package/dist/cli-spec-muse.js +3 -1
  70. package/dist/cli-spec-muse.js.map +1 -1
  71. package/dist/cli-spec-opencode.d.ts +11 -1
  72. package/dist/cli-spec-opencode.js +7 -2
  73. package/dist/cli-spec-opencode.js.map +1 -1
  74. package/dist/cli.js +28 -1
  75. package/dist/cli.js.map +1 -1
  76. package/dist/create-host-account.d.ts +17 -0
  77. package/dist/create-host-account.js +47 -0
  78. package/dist/create-host-account.js.map +1 -0
  79. package/dist/daemon.d.ts +26 -0
  80. package/dist/daemon.js +131 -10
  81. package/dist/daemon.js.map +1 -1
  82. package/dist/delivery-outbox.js +7 -0
  83. package/dist/delivery-outbox.js.map +1 -1
  84. package/dist/fleet-context.d.ts +5 -1
  85. package/dist/fleet-manager.d.ts +363 -71
  86. package/dist/fleet-manager.js +1374 -367
  87. package/dist/fleet-manager.js.map +1 -1
  88. package/dist/fleet-process-handlers.d.ts +1 -1
  89. package/dist/fleet-process-handlers.js +3 -2
  90. package/dist/fleet-process-handlers.js.map +1 -1
  91. package/dist/general-knowledge/skills/concepts/SKILL.md +21 -14
  92. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +9 -8
  93. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +9 -1
  94. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
  95. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +27 -20
  96. package/dist/instance-lifecycle.js +33 -3
  97. package/dist/instance-lifecycle.js.map +1 -1
  98. package/dist/instructions.js +29 -6
  99. package/dist/instructions.js.map +1 -1
  100. package/dist/locale.js +125 -81
  101. package/dist/locale.js.map +1 -1
  102. package/dist/login-manager.d.ts +2 -2
  103. package/dist/login-manager.js +3 -2
  104. package/dist/login-manager.js.map +1 -1
  105. package/dist/native-model-catalog.d.ts +20 -0
  106. package/dist/native-model-catalog.js +107 -2
  107. package/dist/native-model-catalog.js.map +1 -1
  108. package/dist/public-web-gateway.js +1 -1
  109. package/dist/public-web-gateway.js.map +1 -1
  110. package/dist/public-web-link.d.ts +5 -0
  111. package/dist/public-web-link.js +8 -0
  112. package/dist/public-web-link.js.map +1 -1
  113. package/dist/runtime-api.d.ts +1 -1
  114. package/dist/runtime-api.js +104 -12
  115. package/dist/runtime-api.js.map +1 -1
  116. package/dist/runtime-autostart.d.ts +61 -0
  117. package/dist/runtime-autostart.js +161 -0
  118. package/dist/runtime-autostart.js.map +1 -0
  119. package/dist/runtime-background.d.ts +200 -0
  120. package/dist/runtime-background.js +480 -0
  121. package/dist/runtime-background.js.map +1 -0
  122. package/dist/runtime-build-info.js +5 -5
  123. package/dist/runtime-build-info.js.map +1 -1
  124. package/dist/runtime-cli-background.d.ts +92 -0
  125. package/dist/runtime-cli-background.js +336 -0
  126. package/dist/runtime-cli-background.js.map +1 -0
  127. package/dist/runtime-cli-install.d.ts +148 -8
  128. package/dist/runtime-cli-install.js +253 -59
  129. package/dist/runtime-cli-install.js.map +1 -1
  130. package/dist/runtime-cli.d.ts +8 -1
  131. package/dist/runtime-cli.js +206 -44
  132. package/dist/runtime-cli.js.map +1 -1
  133. package/dist/runtime-client-store.d.ts +11 -0
  134. package/dist/runtime-client-store.js +20 -5
  135. package/dist/runtime-client-store.js.map +1 -1
  136. package/dist/runtime-client.d.ts +23 -1
  137. package/dist/runtime-client.js +92 -6
  138. package/dist/runtime-client.js.map +1 -1
  139. package/dist/runtime-connection.d.ts +1 -1
  140. package/dist/runtime-connection.js +1 -1
  141. package/dist/runtime-connection.js.map +1 -1
  142. package/dist/runtime-coordinator.d.ts +95 -1
  143. package/dist/runtime-coordinator.js +344 -10
  144. package/dist/runtime-coordinator.js.map +1 -1
  145. package/dist/runtime-enroll-notice.d.ts +4 -0
  146. package/dist/runtime-enroll-notice.js +21 -0
  147. package/dist/runtime-enroll-notice.js.map +1 -0
  148. package/dist/runtime-enrollment.d.ts +21 -0
  149. package/dist/runtime-enrollment.js +52 -0
  150. package/dist/runtime-enrollment.js.map +1 -0
  151. package/dist/runtime-pane-native.js +4 -4
  152. package/dist/runtime-pane-native.js.map +1 -1
  153. package/dist/runtime-protocol.d.ts +78 -1
  154. package/dist/runtime-protocol.js +95 -5
  155. package/dist/runtime-protocol.js.map +1 -1
  156. package/dist/runtime-remote-accounts.d.ts +12 -0
  157. package/dist/runtime-remote-accounts.js +56 -5
  158. package/dist/runtime-remote-accounts.js.map +1 -1
  159. package/dist/runtime-remote-setup.d.ts +4 -1
  160. package/dist/runtime-remote-setup.js +4 -1
  161. package/dist/runtime-remote-setup.js.map +1 -1
  162. package/dist/runtime-update-controller.d.ts +11 -0
  163. package/dist/runtime-update-controller.js +56 -4
  164. package/dist/runtime-update-controller.js.map +1 -1
  165. package/dist/settings-api.d.ts +13 -1
  166. package/dist/settings-api.js +44 -20
  167. package/dist/settings-api.js.map +1 -1
  168. package/dist/settings-change.d.ts +5 -13
  169. package/dist/settings-change.js.map +1 -1
  170. package/dist/settings-confirmation.d.ts +11 -13
  171. package/dist/settings-confirmation.js +2 -6
  172. package/dist/settings-confirmation.js.map +1 -1
  173. package/dist/settings-effect.d.ts +5 -0
  174. package/dist/settings-effect.js +76 -10
  175. package/dist/settings-effect.js.map +1 -1
  176. package/dist/settings-http-confirmation.d.ts +8 -1
  177. package/dist/settings-http-confirmation.js +39 -13
  178. package/dist/settings-http-confirmation.js.map +1 -1
  179. package/dist/settings-request-capability.d.ts +7 -0
  180. package/dist/settings-request-capability.js +3 -1
  181. package/dist/settings-request-capability.js.map +1 -1
  182. package/dist/setup-i18n.js +4 -4
  183. package/dist/setup-i18n.js.map +1 -1
  184. package/dist/signin-keepalive.d.ts +25 -1
  185. package/dist/signin-keepalive.js +44 -1
  186. package/dist/signin-keepalive.js.map +1 -1
  187. package/dist/subagent-records.d.ts +45 -0
  188. package/dist/subagent-records.js +214 -0
  189. package/dist/subagent-records.js.map +1 -0
  190. package/dist/subagent-service.d.ts +27 -0
  191. package/dist/subagent-service.js +199 -0
  192. package/dist/subagent-service.js.map +1 -0
  193. package/dist/tmux-manager.d.ts +2 -2
  194. package/dist/tmux-manager.js +5 -3
  195. package/dist/tmux-manager.js.map +1 -1
  196. package/dist/ui/account-identity.js +7 -5
  197. package/dist/ui/accounts-keepalive.js +17 -17
  198. package/dist/ui/accounts-manage.js +34 -34
  199. package/dist/ui/accounts-view.js +68 -24
  200. package/dist/ui/agent-runtime-settings.js +1 -1
  201. package/dist/ui/backend-signin.js +67 -67
  202. package/dist/ui/chat-msg-actions.js +50 -4
  203. package/dist/ui/chat-quote.js +256 -0
  204. package/dist/ui/chat-store.js +9 -4
  205. package/dist/ui/cli-caps.js +7 -7
  206. package/dist/ui/credential-profile-select.js +4 -4
  207. package/dist/ui/general-location.js +1 -1
  208. package/dist/ui/host-install.js +290 -0
  209. package/dist/ui/hub-company-join-strings.js +3 -0
  210. package/dist/ui/hub-company-join.js +20 -2
  211. package/dist/ui/hub-owner-strings.js +5 -4
  212. package/dist/ui/hub-pairing-progress-strings.js +1 -1
  213. package/dist/ui/hub-quick-strings.js +4 -4
  214. package/dist/ui/hub-strings.js +6 -6
  215. package/dist/ui/machine-signin.js +4 -4
  216. package/dist/ui/model-picker.js +68 -0
  217. package/dist/ui/panel-chat.js +74 -13
  218. package/dist/ui/panel-fleet.js +8 -2
  219. package/dist/ui/panel-hub.js +8 -4
  220. package/dist/ui/panel-needs.js +2 -2
  221. package/dist/ui/panel-runtimes.js +232 -33
  222. package/dist/ui/panel-settings.js +7 -1
  223. package/dist/ui/panel-windows-cli.js +1 -1
  224. package/dist/ui/runtime-cli-install.js +99 -20
  225. package/dist/ui/runtime-commands.d.ts +2 -0
  226. package/dist/ui/runtime-commands.js +34 -1
  227. package/dist/ui/runtime-update-status.js +2 -2
  228. package/dist/ui/search-dialog.js +1 -0
  229. package/dist/ui/settings-access-overview.js +167 -0
  230. package/dist/ui/settings-access-strings.js +1 -1
  231. package/dist/ui/settings-catalog.js +19 -3
  232. package/dist/ui/settings-confirm.js +2 -2
  233. package/dist/ui/settings-devices.js +59 -25
  234. package/dist/ui/settings-dialogs.js +12 -13
  235. package/dist/ui/settings-guests.js +1 -1
  236. package/dist/ui/settings-hub-company-join.js +10 -7
  237. package/dist/ui/settings-hub-connection.js +121 -0
  238. package/dist/ui/settings-hub-membership.js +1 -1
  239. package/dist/ui/settings-hub-run.js +5 -6
  240. package/dist/ui/settings-hub-section.js +3 -6
  241. package/dist/ui/settings-hub.js +12 -7
  242. package/dist/ui/settings-layout.js +9 -7
  243. package/dist/ui/settings-outside.js +87 -19
  244. package/dist/ui/settings-registry.js +2 -1
  245. package/dist/ui/settings-revoke-strings.js +28 -0
  246. package/dist/ui/settings-strings.js +25 -25
  247. package/dist/ui/settings-web-authority.js +11 -4
  248. package/dist/ui/shared/accounts.css +11 -1
  249. package/dist/ui/shared/agend-auth.js +8 -1
  250. package/dist/ui/shared/app-i18n.js +10 -12
  251. package/dist/ui/shared/app-session.js +13 -16
  252. package/dist/ui/shared/app-shell.js +37 -37
  253. package/dist/ui/shared/app-store.js +2 -0
  254. package/dist/ui/shared/app.css +85 -14
  255. package/dist/ui/shared/chat-render.js +17 -5
  256. package/dist/ui/shared/chat-strings.js +4 -4
  257. package/dist/ui/shared/device-roles.js +27 -0
  258. package/dist/ui/shared/host-install.css +10 -0
  259. package/dist/ui/shared/hub-owner.css +6 -0
  260. package/dist/ui/shared/model-picker.css +21 -0
  261. package/dist/ui/shared/runtime-install.css +26 -1
  262. package/dist/ui/shared/setup-host-text.js +4 -4
  263. package/dist/ui/shared/signin.js +171 -64
  264. package/dist/ui/shared/subagent-row.css +15 -0
  265. package/dist/ui/shared/usage-dialog.js +28 -16
  266. package/dist/ui/shared/view-strings.js +7 -7
  267. package/dist/ui/shared/web-authorize.js +54 -4
  268. package/dist/ui/signin.html +19 -8
  269. package/dist/ui/structured-signin.js +30 -30
  270. package/dist/ui/subagent-row.js +72 -0
  271. package/dist/ui/web-terminal/terminal.js +9 -9
  272. package/dist/update-launch.js +4 -1
  273. package/dist/update-launch.js.map +1 -1
  274. package/dist/update-npm-env.d.ts +70 -0
  275. package/dist/update-npm-env.js +128 -0
  276. package/dist/update-npm-env.js.map +1 -0
  277. package/dist/usage/format-rich.js +1 -1
  278. package/dist/usage/format-rich.js.map +1 -1
  279. package/dist/usage/providers.js +2 -2
  280. package/dist/usage/providers.js.map +1 -1
  281. package/dist/usage/usage-api.d.ts +8 -2
  282. package/dist/usage/usage-api.js +12 -5
  283. package/dist/usage/usage-api.js.map +1 -1
  284. package/dist/web-api.d.ts +38 -4
  285. package/dist/web-api.js +370 -18
  286. package/dist/web-api.js.map +1 -1
  287. package/dist/web-auth.js +1 -1
  288. package/dist/web-auth.js.map +1 -1
  289. package/dist/web-backend-login.d.ts +2 -0
  290. package/dist/web-backend-login.js.map +1 -1
  291. package/dist/web-channel-echo.js +3 -1
  292. package/dist/web-channel-echo.js.map +1 -1
  293. package/dist/web-commands.d.ts +9 -1
  294. package/dist/web-commands.js +7 -1
  295. package/dist/web-commands.js.map +1 -1
  296. package/dist/web-host-install.d.ts +127 -0
  297. package/dist/web-host-install.js +165 -0
  298. package/dist/web-host-install.js.map +1 -0
  299. package/dist/web-remote-access.d.ts +194 -11
  300. package/dist/web-remote-access.js +458 -34
  301. package/dist/web-remote-access.js.map +1 -1
  302. package/dist/web-session.d.ts +11 -3
  303. package/dist/web-session.js.map +1 -1
  304. package/dist/web-signin-device.d.ts +16 -0
  305. package/dist/web-signin-device.js +81 -0
  306. package/dist/web-signin-device.js.map +1 -0
  307. package/dist/web-update.js +3 -1
  308. package/dist/web-update.js.map +1 -1
  309. package/dist/windows-cli-api.js +2 -1
  310. package/dist/windows-cli-api.js.map +1 -1
  311. package/dist/windows-cli-worker.d.ts +14 -0
  312. package/dist/windows-cli-worker.js +145 -1
  313. package/dist/windows-cli-worker.js.map +1 -1
  314. package/dist/windows-cli.d.ts +4 -0
  315. package/dist/windows-cli.js +9 -1
  316. package/dist/windows-cli.js.map +1 -1
  317. package/launcher/agend-install.cjs +16 -3
  318. package/package.json +1 -1
  319. package/templates/runtime-install/install.ps1 +219 -12
@@ -11,7 +11,7 @@ import { confirmedWrite } from "./settings-confirm.js";
11
11
  import { CliProductMark, cliLabel } from "./cli-picker.js";
12
12
  import { WindowsCliPanel } from "./panel-windows-cli.js";
13
13
  import { useRuntimeCatalog } from "./runtime-catalog.js";
14
- import { runtimeConnectCommand, runtimeInstallCommand, runtimeWindowsConnectCommand } from "./runtime-commands.js";
14
+ import { runtimeConnectCommand, runtimeEnrollCommand, runtimeInstallCommand, runtimeInstallOnlyCommand, runtimeWindowsConnectCommand } from "./runtime-commands.js";
15
15
  import { RuntimeUpdateNotice, runtimeUpdateText, runtimeFreshInstallCommand } from "./runtime-update-status.js";
16
16
  import { credentialProfileView, credentialProfileState } from "./credential-profile-select.js";
17
17
  import { identityText } from "./account-identity.js";
@@ -37,7 +37,7 @@ register("machines", {
37
37
  en: {
38
38
  title:"Runtime", lead:"Connect computers to run agents with each computer's own CLIs, sign-ins and files.",
39
39
  connect:"Connect a computer", download:"Download Windows Runtime (ZIP)", downloadHint:"Download here, then transfer the ZIP to the Windows computer and extract it. Windows Node.js is required.", refresh:"Refresh machines", loading:"Loading machines…", empty:"No remote computers connected yet.",
40
- disabled:"Other Windows PCs can connect once “Allow other Windows PCs to pair” is on.", local:"This computer", localHint:"WSL / Linux agents run on the AgEnD host. Native Windows diagnostics are below when enabled.",
40
+ disabled:"Other Windows PCs can connect once “Allow other Windows PCs to pair” is on. Turn it on under Runtime policies below.", openPolicy:"Open Runtime policies", local:"This computer", localHint:"WSL / Linux agents run on the AgEnD host. Native Windows diagnostics are below when enabled.",
41
41
  localWindows:"Local Windows CLI diagnostics", online:"Online", offline:"Offline", pending:"Awaiting approval", revoked:"Revoked", unknown:"Not reported",
42
42
  lastSeen:"Last seen: {0}", inventoryAt:"CLI inventory: {0}", noInventory:"CLI inventory has not been reported yet.", noClis:"No installed CLIs reported.",
43
43
  approve:"Approve computer", revoke:"Revoke connection", rename:"Rename", save:"Save name", cancel:"Cancel", name:"Computer name", probe:"Refresh CLI inventory",
@@ -58,13 +58,13 @@ register("machines", {
58
58
  guide:"How another PC connects", guideAddress:"1. Give this fleet an HTTPS address the other PC can reach. Recommended: Tailscale Serve, run on this computer (on Windows, if AgEnD runs in WSL). Then use the https://….ts.net address it prints:",
59
59
  guideSsh:"Or: an SSH tunnel, opened on the other PC (replace user@this-computer with your SSH sign-in for this computer). Then use http://localhost:{0}:", guideFunnel:"Never use Tailscale Funnel: it puts this fleet on the internet.",
60
60
  guideLan:"A plain http:// address on your network (such as http://192.168.1.20) is refused: it would send the pairing code unencrypted.",
61
- guidePair:"2. Click Connect a computer, install the Runtime on the other PC with the PowerShell command it shows (or download the ZIP instead), then run the connect command there.", guideApprove:"3. When that PC asks to join, approve it here.",
61
+ guidePair:"2. Click Connect a computer, copy the one-time PowerShell command it shows and paste it on the other PC, or give it to an AI agent running there: it installs the Runtime and connects, with no pairing code and no approval. A pairing code (under Manual options) or the ZIP is the alternative.", guideApprove:"3. That PC then appears under Connected computers, with a notice and a Revoke button. Pairing-code and ZIP connections ask you to approve here.",
62
62
  turnOff:"Turn off",
63
63
  },
64
64
  "zh-TW": {
65
65
  title:"Runtime", lead:"連接電腦,讓 Agent 使用各台電腦上的 CLI、登入與檔案。",
66
66
  connect:"連接電腦", download:"下載 Windows Runtime(ZIP)", downloadHint:"下載後,將 ZIP 傳到要執行 CLI 的 Windows 電腦並解壓縮。需要 Windows Node.js。", refresh:"更新機器清單", loading:"正在載入機器…", empty:"尚未連接其他電腦。",
67
- disabled:"開啟「允許其他 Windows 電腦配對」後,其他 Windows 電腦才能連接。", local:"這台電腦", localHint:"WSL / Linux Agent 在 AgEnD 主機上執行。啟用後可在下方查看本機 Windows 診斷。",
67
+ disabled:"開啟下方「Runtime 政策」中的「允許其他 Windows 電腦配對」後,其他 Windows 電腦才能連接。", openPolicy:"前往開啟", local:"這台電腦", localHint:"WSL / Linux Agent 在 AgEnD 主機上執行。啟用後可在下方查看本機 Windows 診斷。",
68
68
  localWindows:"本機 Windows CLI 診斷", online:"在線", offline:"離線", pending:"等待核准", revoked:"已撤銷", unknown:"尚未回報",
69
69
  lastSeen:"最近連線:{0}", inventoryAt:"CLI 清單更新:{0}", noInventory:"尚未回報 CLI 清單。", noClis:"尚未回報已安裝的 CLI。",
70
70
  approve:"核准電腦", revoke:"撤銷連線", rename:"重新命名", save:"儲存名稱", cancel:"取消", name:"電腦名稱", probe:"更新 CLI 清單",
@@ -85,11 +85,11 @@ register("machines", {
85
85
  guide:"另一台電腦如何連線", guideAddress:"1. 讓另一台電腦能用 HTTPS 位址連到這個 Fleet。建議在這台電腦上執行 Tailscale Serve(若 AgEnD 在 WSL 中執行,請在 Windows 上執行),再使用它顯示的 https://….ts.net 位址:",
86
86
  guideSsh:"或:在另一台電腦上開啟 SSH 通道(把 user@this-computer 換成你登入這台電腦的 SSH 帳號),再使用 http://localhost:{0}:", guideFunnel:"請勿使用 Tailscale Funnel:它會把這個 Fleet 公開到網際網路。",
87
87
  guideLan:"網路上的一般 http:// 位址(例如 http://192.168.1.20)會被拒絕:配對碼會以未加密的方式傳送。",
88
- guidePair:"2. 按「連接電腦」,在另一台電腦用頁面顯示的 PowerShell 指令安裝 Runtime(或改為下載 ZIP),再在那裡執行連線指令。", guideApprove:"3. 那台電腦要求加入時,在這裡核准它。",
88
+ guidePair:"2. 按「連接電腦」,複製頁面顯示的一次性 PowerShell 指令,貼到另一台電腦,或交給在那台電腦上執行的 AI agent:它會安裝 Runtime 並直接連線,不用配對碼,也不用核准。配對碼(在手動選項裡)或 ZIP 是另外的做法。", guideApprove:"3. 那台電腦會出現在「已連接的電腦」,並有通知和撤銷按鈕。用配對碼或 ZIP 連線時,要在這裡核准。",
89
89
  turnOff:"關閉此功能",
90
90
  },
91
91
  });
92
- export { runtimeConnectCommand, runtimeInstallCommand, runtimeWindowsConnectCommand };
92
+ export { runtimeConnectCommand, runtimeEnrollCommand, runtimeInstallCommand, runtimeInstallOnlyCommand, runtimeWindowsConnectCommand };
93
93
  export const machineText = (key,...values) => t(`machines.${key}`,...values);
94
94
  register("machines", {
95
95
  en: { computersTitle:"Computers and CLIs", firstConnection:"Connecting for the first time?", stepDownload:"Download the Runtime", stepRun:"Run it on another computer", stepApprove:"Return here to approve", connectionNote:"Each computer keeps its own CLI sign-ins.", fleetScope:"Entire fleet", nativeWindows:"Native Windows", nativeHint:"CLIs and existing sign-ins on this computer's Windows installation.", inventoryHint:"Open diagnostics to inspect CLI availability and sign-ins." },
@@ -116,13 +116,15 @@ register("machines", {
116
116
  "zh-TW": { versionNotReported:"此 Runtime 未提供版本資訊", versionUnreadable:"無法讀取 Runtime 版本資訊", buildId:"程式碼 Build ID", buildUnavailable:"無法取得 Build ID", protocols:"支援的協定", compatibility:"協定相容狀態", compatible:"相容", legacy:"已使用協定 v1 連線,未提供版本資訊。可重新執行安裝指令來更新", incompatible:"與這台 AgEnD 不相容:請在那台電腦重新執行安裝指令", protocolUnknown:"尚未回報協定資訊", capabilities:"回報功能", capability_exec:"單次任務", capability_mcp:"AgEnD 工具(MCP)", capability_panes:"持續終端" },
117
117
  });
118
118
  register("machines", {
119
- en: { downloadBuilding:"Preparing ZIP…", stepZipHint:"Includes the address above. Extract it on the other computer.", stepLaunch:"Double-click connect-agend.bat there", stepLaunchHint:"Enter the pairing code when asked. A saved profile reconnects without it. If that computer is already paired to another AgEnD, this one gets its own profile and the existing pairing is kept. The window stays open and explains what to do if AgEnD disconnects it, including when jobs.json from another pairing must be deleted.",manualMultiHint:"Without agend-server.json, a profile paired to another AgEnD is never reused. Add --profile \"%USERPROFILE%\\.agend-runtime\\profiles\\<host>-<port>\" (any folder) to keep both, and pass the same --profile to run, status, rotate and disconnect.", stepApproveHint:"Keep the Runtime window open.", pairingApprove:"A computer is waiting for your approval", copyCode:"Copy", codeCopied:"Copied", newCode:"New code", manualCommand:"Manual connection command", downloadedFor:"Downloaded for: {0}", downloadFailed:"Could not download the Runtime", pairingHint:"Follow the four steps. This page updates automatically." },
120
- "zh-TW": { downloadBuilding:"正在準備 ZIP…", stepZipHint:"已內含上方位址,請在另一台電腦解壓縮。", stepLaunch:"在那台電腦雙擊 connect-agend.bat", stepLaunchHint:"提示時輸入配對碼;已有配對資料時會直接重連。若那台電腦已配對到另一個 AgEnD,這次會自動使用獨立的資料夾,原本的配對不受影響。若 AgEnD 中斷連線,視窗會保持開啟並說明下一步,包括何時需要刪除另一個配對留下的 jobs.json。",manualMultiHint:"沒有 agend-server.json 時,已配對到其他 AgEnD 的資料夾不會被重複使用。請加上 --profile \"%USERPROFILE%\\.agend-runtime\\profiles\\<host>-<port>\"(任何資料夾皆可)讓兩個都保留,之後 run、status、rotate、disconnect 也要帶相同的 --profile。", stepApproveHint:"請保持 Runtime 視窗開啟。", pairingApprove:"有電腦正在等待你核准", copyCode:"複製", codeCopied:"已複製", newCode:"重新產生", manualCommand:"手動連線指令", downloadedFor:"已下載,連線位址:{0}", downloadFailed:"無法下載 Runtime", pairingHint:"依下列四步操作,此頁會自動更新。" },
119
+ en: { downloadBuilding:"Preparing ZIP…", stepZipHint:"Includes the address above. Extract it on the other computer.", stepLaunch:"Double-click connect-agend.bat there", stepLaunchHint:"Enter the pairing code when asked and approve the computer here. Once it is connected the Runtime moves to the background: it keeps running with no window, so closing this one does not disconnect it, and it starts again when you sign in to Windows (no administrator rights). A saved profile reconnects without a code. If that computer is already paired to another AgEnD, this one gets its own profile and the existing pairing is kept. Manage it with agend-runtime status, stop and logs; if AgEnD disconnects it, logs says why and the next step, including when jobs.json from another pairing must be deleted.",manualMultiHint:"Without agend-server.json, a profile paired to another AgEnD is never reused. Add --profile \"%USERPROFILE%\\.agend-runtime\\profiles\\<host>-<port>\" (any folder) to keep both, and pass the same --profile to run, status, rotate and disconnect.", stepApproveHint:"Keep the window open until it says the Runtime is running in the background; after that you can close it.", pairingApprove:"A computer is waiting for your approval", copyCode:"Copy", codeCopied:"Copied", newCode:"New code", manualCommand:"Manual connection command", downloadedFor:"Downloaded for: {0}", downloadFailed:"Could not download the Runtime", pairingHint:"Generate a one-time install command, paste it on the other computer, and this page shows that computer joining." },
120
+ "zh-TW": { downloadBuilding:"正在準備 ZIP…", stepZipHint:"已內含上方位址,請在另一台電腦解壓縮。", stepLaunch:"在那台電腦雙擊 connect-agend.bat", stepLaunchHint:"提示時輸入配對碼,並在這裡核准那台電腦。連上之後 Runtime 會轉到背景執行:沒有視窗,關掉這個視窗不會斷線,登入 Windows 時也會自動重新連線(不需要系統管理員權限)。已有配對資料時會直接重連、不用再輸入配對碼。若那台電腦已配對到另一個 AgEnD,這次會自動使用獨立的資料夾,原本的配對不受影響。可以用 agend-runtime status、stop、logs 管理;若 AgEnD 中斷連線,logs 會說明原因與下一步,包括何時需要刪除另一個配對留下的 jobs.json。",manualMultiHint:"沒有 agend-server.json 時,已配對到其他 AgEnD 的資料夾不會被重複使用。請加上 --profile \"%USERPROFILE%\\.agend-runtime\\profiles\\<host>-<port>\"(任何資料夾皆可)讓兩個都保留,之後 run、status、rotate、disconnect 也要帶相同的 --profile。", stepApproveHint:"請保持視窗開啟,直到它顯示 Runtime 已在背景執行,之後就可以關閉。", pairingApprove:"有電腦正在等待你核准", copyCode:"複製", codeCopied:"已複製", newCode:"重新產生", manualCommand:"手動連線指令", downloadedFor:"已下載,連線位址:{0}", downloadFailed:"無法下載 Runtime", pairingHint:"產生一次性安裝指令,貼到另一台電腦執行,這一頁會顯示那台電腦加入。" },
121
121
  });
122
122
  register("machines", {
123
123
  en: { installMethod:"Install method", tabWindows:"Windows (PowerShell)", tabZip:"Other install methods (ZIP)",
124
- stepInstall:"Install the Runtime", stepInstallHint:"Paste this into PowerShell on the other Windows computer. It downloads install.ps1 from this AgEnD, checks it against the SHA-256 below and only then runs it. The installer verifies the Runtime's own checksum and installs it for your Windows user only, next to any version already there (nothing already installed is deleted). It does not connect, pair or need administrator rights. Windows Node.js 22.14 or newer is required; if it is missing, the command only tells you how to get it.",
125
- stepConnect:"Connect that computer", stepConnectHint:"Run this in the same PowerShell window (or open a new one). It asks for the one-time pairing code on the right, shows a pairing fingerprint, then waits for your approval here. The code is typed there, never put in the command.",
124
+ stepInstall:"Copy the one-time install command", stepInstallHint:"Paste this into PowerShell on any Windows computer, or hand it to an AI agent running there: it installs the Runtime and connects the computer straight away: no pairing code and no approval step. The Runtime keeps running in the background (closing the window does not disconnect it; requires Node.js 22.14+).",
125
+ stepConnect:"Paste it on the other computer", stepConnectHint:"It can be any computer that can reach this AgEnD's address. Once connected, the Runtime keeps running in the background and reconnects when you sign in (manage with agend-runtime status, stop and logs, or connect-agend.bat).",
126
+ verifyAndHelp:"Verification hashes & troubleshooting",
127
+ manualCommands:"Manual options (pairing code, install only)", manualCommandsHint:"For a person at an interactive PowerShell window who prefers a pairing code: the first command only installs; the second asks for the one-time pairing code below, shows a pairing fingerprint and waits for your approval here.", installOnlyCommand:"Install only (does not connect)", manualCodeNote:"A pairing code cannot be put in a command or a variable: it is typed at an interactive terminal. For an AI agent or CI, use the one-time install command above instead.",
126
128
  installCommand:"Install command", connectCommand:"Connect command", copyCommand:"Copy command", commandCopied:"Copied",
127
129
  installerHash:"The command checks install.ps1 against this SHA-256 before it runs anything:", installerLoading:"Preparing the installer hash…",
128
130
  installerUnavailable:"This AgEnD cannot offer the installer (for example its Runtime files were not built), so there is no install command. Use Other install methods (ZIP).", installerRetry:"Try again",
@@ -131,8 +133,10 @@ register("machines", {
131
133
  needsReinstall:"This computer's Runtime is not compatible with this AgEnD, so it cannot connect or run work. Run the install command from Connect a computer on that computer again: it installs the matching Runtime next to the old one, and the pairing is kept.",
132
134
  zipTabHint:"Prefer not to run a command? Download the ZIP here, move it to the other computer and extract it." },
133
135
  "zh-TW": { installMethod:"安裝方式", tabWindows:"Windows(PowerShell)", tabZip:"其他安裝方式(ZIP)",
134
- stepInstall:"安裝 Runtime", stepInstallHint:"在另一台 Windows 電腦的 PowerShell 貼上這行指令。它會從這台 AgEnD 下載 install.ps1,先用下方的 SHA-256 檢查,相符才執行。安裝程式會再驗證 Runtime 自己的校驗碼,並只為你的 Windows 使用者安裝,放在既有版本旁邊(不會刪除任何已安裝的東西);不會連線、不會配對,也不需要系統管理員權限。需要 Windows Node.js 22.14 以上;若沒有,指令只會告訴你怎麼取得。",
135
- stepConnect:"連接那台電腦", stepConnectHint:"在同一個 PowerShell 視窗(或新開一個)執行。它會要求輸入右側的一次性配對碼、顯示配對指紋,然後等待你在這裡核准。配對碼是在那裡輸入的,不會寫進指令。",
136
+ stepInstall:"複製一次性安裝指令", stepInstallHint:"在 Windows 電腦的 PowerShell 貼上這行指令(或交給 AI agent),就會自動安裝,然後立刻連線那台電腦:不用配對碼,也不用另外核准。連上後會在背景持續執行(關掉視窗不會斷線;需 Node.js 22.14+)。",
137
+ stepConnect:"在另一台電腦貼上並執行", stepConnectHint:"不限這台電腦,只要能連到這台 AgEnD 的位址都可以。連上後會在背景持續執行,登入 Windows 時自動重連(可用 agend-runtime status、stop、logs 或 connect-agend.bat 管理)。",
138
+ verifyAndHelp:"校驗碼與疑難排解",
139
+ manualCommands:"手動選項(配對碼、只安裝)", manualCommandsHint:"適合在互動式 PowerShell 視窗前、想用配對碼的人:第一行只安裝;第二行會要求輸入下方的一次性配對碼,顯示配對指紋,並等待你在這裡核准。", installOnlyCommand:"只安裝(不連線)", manualCodeNote:"配對碼不能放進指令或變數,只能在互動式終端機輸入。AI agent 或 CI 請改用上方的一次性安裝指令。",
136
140
  installCommand:"安裝指令", connectCommand:"連線指令", copyCommand:"複製指令", commandCopied:"已複製",
137
141
  installerHash:"指令會先用這個 SHA-256 檢查 install.ps1,相符才會執行任何東西:", installerLoading:"正在準備安裝程式雜湊…",
138
142
  installerUnavailable:"這台 AgEnD 無法提供安裝程式(例如缺少 Runtime 檔案),所以沒有安裝指令。請改用「其他安裝方式(ZIP)」。", installerRetry:"重試",
@@ -141,6 +145,53 @@ register("machines", {
141
145
  needsReinstall:"這台電腦的 Runtime 與這台 AgEnD 不相容,無法連線或執行工作。請在那台電腦再執行一次「連接電腦」頁面上的安裝指令:它會把相符的 Runtime 安裝在舊版旁邊,配對會保留。",
142
146
  zipTabHint:"不想執行指令?在這裡下載 ZIP,傳到另一台電腦並解壓縮。" },
143
147
  });
148
+ // the one-time install command (a token made by this page), its card, and the notice that a computer joined with it.
149
+ register("machines", {
150
+ en: {
151
+ "enrollCardTitle": "One-time install command",
152
+ "enrollExpiresIn": "Expires in {0}",
153
+ "enrollExpired": "This install command has expired. Generate a new one.",
154
+ "enrollUsed": "A computer joined with this command; the token is spent.",
155
+ "enrollRevoked": "This install command was revoked. Generate a new one.",
156
+ "enrollWait": "Waiting for a computer to run the command",
157
+ "enrollNew": "New command",
158
+ "enrollRevoke": "Revoke and close",
159
+ "enrollSecurity": "Treat this command like a password (valid once for 15 minutes). Anyone with it can connect a computer to this AgEnD—do not share it in chats or screenshots.",
160
+ "enrollJoinedStep": "{0} joined with this command.",
161
+ "enrollFingerprint": "AgEnD server fingerprint (the Runtime checks it before it sends the token):",
162
+ "showPairingCode": "Show a pairing code",
163
+ "hideEnroll": "Hide this command",
164
+ "joinedTitle": "A new computer joined with an install command",
165
+ "joinedBody": "{0} was added {1} with a one-time token from this page: no pairing code and no approval step. If you did not expect it, revoke it now.",
166
+ "joinedRevoke": "Revoke",
167
+ "joinedDismiss": "Dismiss",
168
+ "enrolledBadge": "Joined by install command",
169
+ "enrollNoInstaller": "The install command appears once the installer information has loaded.",
170
+ "enrollGenerate": "Generate the install command"
171
+ },
172
+ "zh-TW": {
173
+ "enrollCardTitle": "一次性安裝指令",
174
+ "enrollExpiresIn": "{0} 後到期",
175
+ "enrollExpired": "這個安裝指令已經到期,請重新產生。",
176
+ "enrollUsed": "已有電腦用這個指令加入;token 已用掉。",
177
+ "enrollRevoked": "這個安裝指令已被撤銷,請重新產生。",
178
+ "enrollWait": "等待電腦執行這個指令",
179
+ "enrollNew": "重新產生",
180
+ "enrollRevoke": "撤銷並關閉",
181
+ "enrollSecurity": "請把這行指令當成密碼(15 分鐘內有效、限用一次)。拿到的人都能把電腦連到這台 AgEnD,請勿貼到聊天或截圖。",
182
+ "enrollJoinedStep": "{0} 已用這個指令加入。",
183
+ "enrollFingerprint": "AgEnD 伺服器指紋(Runtime 會先比對它,才送出 token):",
184
+ "showPairingCode": "顯示配對碼",
185
+ "hideEnroll": "隱藏這個指令",
186
+ "joinedTitle": "有新電腦透過安裝指令加入",
187
+ "joinedBody": "{0} 在{1}以這一頁的一次性 token 加入:沒有配對碼,也沒有核准步驟。如果不是你預期的,請立刻撤銷。",
188
+ "joinedRevoke": "撤銷",
189
+ "joinedDismiss": "關閉通知",
190
+ "enrolledBadge": "以安裝指令加入",
191
+ "enrollNoInstaller": "安裝程式資訊載入完成後,才會顯示安裝指令。",
192
+ "enrollGenerate": "產生安裝指令"
193
+ },
194
+ });
144
195
  register("machines", {
145
196
  en: { profilesTitle:"Claude accounts", profileDefault:"Default", profilesNone:"No Claude accounts reported yet.", profilesHow:"To add one, run agend-runtime login claude-code NAME on that computer, then choose Detect again in CLI diagnostics.", profilesOld:"Update the Runtime on that computer to choose a Claude account for an agent.", profilesList:"Claude accounts on {0}", profileSignedIn:"Signed in", profileSignedOut:"Not signed in", profileUnchecked:"Not checked", capability_credentialProfiles:"Claude accounts (credential profiles)" },
146
197
  "zh-TW": { profilesTitle:"Claude 帳號", profileDefault:"預設", profilesNone:"尚未回報任何 Claude 帳號。", profilesHow:"要新增,請在那台電腦執行 agend-runtime login claude-code 名稱,再在「CLI 診斷」按「重新偵測」。", profilesOld:"請更新那台電腦上的 Runtime,才能為 Agent 選擇 Claude 帳號。", profilesList:"{0} 上的 Claude 帳號", profileSignedIn:"已登入", profileSignedOut:"尚未登入", profileUnchecked:"未確認", capability_credentialProfiles:"Claude 帳號(credential profile)" },
@@ -159,7 +210,7 @@ function paneVerificationTag(cli, text) {
159
210
  return key ? html`<span class="tag" title=${text(`${key}Hint`)}>${text(key)}</span>` : null;
160
211
  }
161
212
  export function machineTime(value) { const date=new Date(value); return value && Number.isFinite(date.getTime()) ? date.toLocaleString() : machineText("unknown"); }
162
- function MachineCard({ machine, busy, action, openDiagnostics, probe, repairUpdate, lease, onChanged }) {
213
+ function MachineCard({ machine, sameName, busy, action, openDiagnostics, probe, repairUpdate, lease, onChanged }) {
163
214
  const [editing,setEditing] = useState(false), [name,setName] = useState(machine.name), [info,setInfo] = useState(false);
164
215
  const detection = useWindowsCliCatalogSnapshot(machine.isLocal ? "" : machine.id);
165
216
  const probing = machine.probing || detection.loading;
@@ -170,16 +221,18 @@ function MachineCard({ machine, busy, action, openDiagnostics, probe, repairUpda
170
221
  !local && status !== "revoked" && {key:"rename",label:machineText("rename"),icon:"edit",onSelect:()=>setEditing(true)},
171
222
  !local && status !== "revoked" && {key:"revoke",label:machineText("revoke"),icon:"close",danger:true,onSelect:()=>action(machine,"revoke")}];
172
223
  return html`<article class=${`runtime-machine${local ? " runtime-native-local" : ""}${revoked ? " is-revoked" : ""}`} data-machine-id=${local ? "local" : machine.id}>
173
- <header><span class="runtime-machine-icon"><${Icon} name="fleet" size=${22} /></span><div><h3>${machine.name}${revoked ? null : html`<span class="runtime-kind">${machineText(local ? "localBadge" : "pairedBadge")}</span>`}</h3><p>${machine.platform === "win32" ? "Windows" : machine.platform || machineText("unknown")}${machine.hostname && machine.hostname !== machine.name ? ` · ${machine.hostname}` : ""} · ${machineText((clis.length) === 1 ? "cliCountOne" : "cliCount",clis.length)}</p></div><span class=${`runtime-status is-${status}`}><span class="windows-cli-dot"></span>${machineText(["available","online","offline","pending","revoked"].includes(status) ? status : "unknown")}</span></header>
224
+ <header><span class="runtime-machine-icon"><${Icon} name="fleet" size=${22} /></span><div><h3>${machine.name}${revoked ? null : html`<span class="runtime-kind">${machineText(local ? "localBadge" : machine.enrolledVia ? "enrolledBadge" : "pairedBadge")}</span>`}${sameName ? html`<span class="tag runtime-same-name-tag">#${sameName.n}</span>` : null}</h3><p>${machine.platform === "win32" ? "Windows" : machine.platform || machineText("unknown")}${machine.hostname && machine.hostname !== machine.name ? ` · ${machine.hostname}` : ""} · ${machineText((clis.length) === 1 ? "cliCountOne" : "cliCount",clis.length)}</p>${sameName ? html`<p class="runtime-same-name-when">${machineText(status === "pending" ? "requestedAt" : "pairedAt",machineTime(status === "pending" ? machine.createdAt : machine.approvedAt || machine.createdAt),String(machine.id).slice(0,8))}</p>` : null}</div><span class=${`runtime-status is-${status}`}><span class="windows-cli-dot"></span>${machineText(["available","online","offline","pending","revoked"].includes(status) ? status : "unknown")}</span></header>
225
+ ${sameName ? html`<p class="note lbar runtime-same-name">${machineText("sameName",machine.name)}</p>` : null}
174
226
  ${!local && !revoked && machine.runtimeCompatibility === "incompatible" ? html`<p class="runtime-reinstall" role="alert">${machineText("needsReinstall")}</p>` : null}
175
227
  ${!local && !revoked && status !== "pending" ? html`<${RuntimeUpdateNotice} machine=${machine} onRepair=${() => repairUpdate(machine)} />` : null}
176
228
  ${revoked ? null : html`<p class="runtime-inventory-time note">${machine.inventoryUpdatedAt ? machineText("inventoryAt",machineTime(machine.inventoryUpdatedAt)) : machineText("neverDetected")}</p>`}
177
- ${status === "pending" ? html`<div class="runtime-approval"><p>${machineText("fingerprintLabel")}<code class="runtime-pairing-fingerprint">${machine.pairingFingerprint || machineText("unknown")}</code></p><p class="note">${machineText("approvalHint")}</p></div>` : null}
229
+ ${status === "pending" ? html`<div class="runtime-approval"><p>${machineText("fingerprintLabel")}<code class="runtime-pairing-fingerprint">${machine.pairingFingerprint || machineText("unknown")}</code></p><p class="note" role=${machine.pairingExpired ? "status" : undefined}>${machineText(machine.pairingExpired ? "pairingExpired" : "approvalHint")}</p></div>` : null}
178
230
  ${revoked ? html`<p class="note runtime-revoked-note" role="status">${machineText("revokedNote")}</p>` : clis.length ? html`<table class="runtime-cli-table" aria-label=${machineText("cli")}><thead><tr><th>${machineText("cli")}</th><th>${machineText("versionColumn")}</th><th>${machineText("signInColumn")}</th></tr></thead><tbody>${clis.map(cli=>html`<tr key=${cli.id}><td><span class="runtime-cli-product"><${CliProductMark} id=${cli.id} size=${21} /><strong>${cliLabel(cli.id)}</strong></span>${cli.supports?.execution === false ? html`<small>${machineText("detectionOnly")}</small>` : null}</td><td><span class="runtime-cli-version" title=${cli.version || ""}>${cli.version || "—"}</span>${paneVerificationTag(cli,machineText)}</td><td><span class=${`runtime-cli-auth ${cli.authenticated === true ? "is-signed-in" : ""}`}><span class="windows-cli-dot"></span>${machineText(cli.authenticated === true ? "signedIn" : cli.authenticated === false ? "signedOut" : "authShort")}</span>${cli.authenticated === true && identityText(cli.identity) ? html`<small class="runtime-account" data-account="default">${identityText(cli.identity)}</small>` : null}</td></tr>`)}</tbody></table>` : html`<p class="note runtime-no-clis">${machineText(local ? "noLocalClis" : "noClis")}</p>`}
179
231
  ${!local && !revoked && status !== "pending" ? html`<${CredentialProfiles} machine=${machine} />` : null}
180
232
  ${offersCliInstall(machine) && lease ? html`<${CliInstall} machine=${machine} lease=${lease} onChanged=${onChanged} />` : null}
181
233
  <div class="runtime-machine-actions">${ready ? html`<button type="button" class="btn btn-sm runtime-inspect" onClick=${() => openDiagnostics(local ? "" : machine.id)}>${machineText("diagnosticTitle")}</button><button type="button" class="btn btn-sm runtime-probe" disabled=${busy || probing || !local && status !== "online"} onClick=${() => probe(local ? "" : machine.id)}><${Icon} name="restart" size=${14} cls=${probing ? "out-spin" : ""} />${machineText(probing ? "probeBusy" : "probeAgain")}</button>` : null}
182
- ${status === "pending" ? html`<button type="button" class="btn btn-primary btn-sm" disabled=${busy || !machine.pairingFingerprint} onClick=${() => action(machine,"approve",{fingerprint:machine.pairingFingerprint})}>${machineText("approve")}</button>` : null}
234
+ ${status === "pending" && !machine.pairingExpired ? html`<button type="button" class="btn btn-primary btn-sm" disabled=${busy || !machine.pairingFingerprint} onClick=${() => action(machine,"approve",{fingerprint:machine.pairingFingerprint})}>${machineText("approve")}</button>` : null}
235
+ ${status === "pending" && machine.pairingExpired ? html`<button type="button" class="btn btn-sm runtime-expired-reject" disabled=${busy} onClick=${() => action(machine,"reject")}>${machineText("askReject")}</button>` : null}
183
236
  <${Menu} cls="runtime-machine-menu" label=${machineText("machineActions",machine.name)} disabled=${busy} items=${menuItems} />
184
237
  </div>
185
238
  ${info ? html`<${Dialog} title=${`${machineText("machineInfo")} · ${machine.name}`} onClose=${()=>setInfo(false)}><dl class="runtime-machine-facts"><dt>${machineText("machineName")}</dt><dd>${machine.name}</dd><dt>${machineText("hostName")}</dt><dd>${machine.hostname || machine.inventory?.hostname || machineText("unknown")}</dd><dt>${machineText("platform")}</dt><dd>${machine.platform === "win32" ? "Windows" : machine.platform}</dd>${local ? html`<dt>${machineText("home")}</dt><dd>${machine.inventory?.home || machineText("unknown")}</dd>` : html`<dt>${machineText("version")}</dt><dd class="runtime-reported-version">${machine.runtimeInfo?.version || machineText(machine.runtimeInfo ? "versionUnreadable" : "versionNotReported")}</dd>${machine.runtimeInfo ? html`<dt>${machineText("buildId")}</dt><dd class="runtime-reported-build"><code>${machine.runtimeInfo?.buildId || machineText("buildUnavailable")}</code></dd><dt>${machineText("protocols")}</dt><dd>${machine.runtimeInfo?.protocolVersions?.map(v=>`v${v}`).join(", ") || machineText("protocolUnknown")}</dd>` : null}<dt>${machineText("compatibility")}</dt><dd class="runtime-compatibility">${machineText(["compatible","legacy","incompatible"].includes(machine.runtimeCompatibility) ? machine.runtimeCompatibility : "protocolUnknown")}</dd>${machine.runtimeInfo ? html`<dt>${machineText("capabilities")}</dt><dd>${machine.runtimeInfo?.capabilities?.map(capability=>["exec","mcp","panes"].includes(capability) ? machineText(`capability_${capability}`) : capability === "credential-profiles" ? machineText("capability_credentialProfiles") : capability).join(" · ") || machineText("unknown")}</dd>` : null}<dt>${machineText("lastSeenLabel")}</dt><dd>${machineTime(machine.lastSeenAt)}</dd><dt>${machineText("identity")}</dt><dd><code>${machine.id}</code></dd>`}</dl></${Dialog}>` : null}
@@ -294,10 +347,28 @@ function RuntimeSwitches({ lease, onChanged, computers }) {
294
347
  ${guide}
295
348
  </div>`;
296
349
  }
350
+ /** The countdown is its own component: it ticks every second without re-rendering the whole Runtime page. */
351
+ function EnrollClock({ lease, expiresAt }) {
352
+ const [now,setNow]=useState(() => Date.now());
353
+ useEffect(() => { const timer=lease.interval(() => setNow(Date.now()),1000);return () => lease.clear(timer); },[lease]);
354
+ const seconds=Math.max(0,Math.ceil((expiresAt-now)/1000));
355
+ return html`<p class="note runtime-enroll-clock">${machineText("enrollExpiresIn",`${Math.floor(seconds/60)}:${String(seconds%60).padStart(2,"0")}`)}</p>`;
356
+ }
357
+ /** Computers that joined with an install command stay announced on this page until the administrator dismisses the notice (kept in this browser only). */
358
+ const JOINED_SEEN_KEY = "agend.runtime.joined.dismissed";
359
+ function readSeenJoined() {
360
+ try { const value = JSON.parse(localStorage.getItem(JOINED_SEEN_KEY) || "[]"); return new Set(Array.isArray(value) ? value.filter(id => typeof id === "string").slice(-100) : []); }
361
+ catch { return new Set(); }
362
+ }
363
+ function writeSeenJoined(set) { try { localStorage.setItem(JOINED_SEEN_KEY, JSON.stringify([...set].slice(-100))); } catch { /* the notice comes back after a reload */ } }
364
+ const JOINED_NOTICE_MS = 7 * 24 * 3_600_000;
297
365
  export function RuntimesPanel({navKey}) {
298
366
  const lease=useLease(`runtimes:${navKey}`), state=useRuntimeCatalog(), {windowsCli}=useStore(appStore);
299
367
  const localInventory=useWindowsCliCatalog(windowsCli);
300
368
  const [pairing,setPairing]=useState(null), [busy,setBusy]=useState(""), [error,setError]=useState("");
369
+ // The one-time install-command token lives here, in memory, and nowhere else (the server keeps only its hash); `open` shows the connect panel.
370
+ const [open,setOpen]=useState(false), [enroll,setEnroll]=useState(null), [,setTick]=useState(0), [seenJoined,setSeenJoined]=useState(readSeenJoined);
371
+ const zipAsked=useRef(false);
301
372
  const [server,setServer]=useState(() => typeof location === "undefined" ? "" : location.origin);
302
373
  const drafts=useRef(new Map()), taskSessions=useRef(new Map()), downloadClaim=useRef(false);
303
374
  const [downloadedFor,setDownloadedFor]=useState(""), [copied,setCopied]=useState(false);
@@ -316,6 +387,15 @@ export function RuntimesPanel({navKey}) {
316
387
  const timer=lease.timeout(() => setPairing(null),remaining);
317
388
  return () => lease.clear(timer);
318
389
  },[lease,pairing]);
390
+ // One re-render at the moment the token ends (the countdown itself is EnrollClock's). Expiry is measured on THIS browser's clock from when the answer arrived,
391
+ // by the token's length of life, never by comparing the server's clock with this one.
392
+ useEffect(() => {
393
+ if (!enroll) return;
394
+ const remaining=enroll.localExpiresAt-Date.now()+100;
395
+ if (remaining <= 0) return;
396
+ const timer=lease.timeout(() => setTick(count => count+1),remaining);
397
+ return () => lease.clear(timer);
398
+ },[lease,enroll]);
319
399
  const loadInstaller=async() => {
320
400
  setInstaller({status:"loading",sha:"",version:""});
321
401
  try {
@@ -326,35 +406,83 @@ export function RuntimesPanel({navKey}) {
326
406
  else setInstaller({status:"error",sha:"",version:""});
327
407
  } catch { if(lease.current())setInstaller({status:"error",sha:"",version:""}); }
328
408
  };
329
- useEffect(() => { if ((pairing || repairMachine) && installer.status === "idle") void loadInstaller(); },[pairing,repairMachine,installer.status]);
409
+ useEffect(() => { if ((open || repairMachine) && installer.status === "idle") void loadInstaller(); },[open,repairMachine,installer.status]);
410
+ // The ZIP route uses a pairing code, made only when that route is shown (or asked for under Manual options), never for the install command.
411
+ // Once per opening of the panel: an expired code is not replaced behind the administrator's back (the card offers a new one).
412
+ useEffect(() => { if (open && tab === "zip" && !pairing && !busy && !zipAsked.current) { zipAsked.current=true;void newPairingCode(); } },[open,tab,pairing]);
330
413
  const post=async(path,body={}) => {
331
414
  const response=await lease.fetch(path,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)});
332
415
  const value=await response.json();
333
- if (!response.ok) throw new Error(value.error || `HTTP ${response.status}`);
416
+ if (!response.ok) throw Object.assign(new Error(value.error || `HTTP ${response.status}`),{status:response.status,code:value.code});
334
417
  return value;
335
418
  };
419
+ // Makes a one-time install-command token (and ends any earlier unused one). Same authorization as a pairing code.
336
420
  const connect=async() => {
421
+ setBusy("pairing");setError("");
422
+ try {const value=await post("/ui/runtimes/enrollment");if(lease.current()){setEnroll({...value,localExpiresAt:Date.now()+Math.max(0,value.expiresAt-value.createdAt)});setInstallCopied(false);setTab("windows");setOpen(true);}}catch(e){if(lease.current())setError(e.message);}finally{if(lease.current())setBusy("");}
423
+ };
424
+ const newPairingCode=async() => {
337
425
  setBusy("pairing");setError("");
338
426
  try {const value=await post("/ui/runtimes/pairing");if(lease.current())setPairing(value);}catch(e){if(lease.current())setError(e.message);}finally{if(lease.current())setBusy("");}
339
427
  };
428
+ const openZip=() => { setTab("zip");setOpen(true); };
429
+ // Closing from the card ends an unused token: nothing on screen can show it again, so it should not stay valid. (Leaving the page without closing does not revoke it:
430
+ // the command may already be copied, and it ends by itself after 15 minutes.)
431
+ const closePanel=async() => {
432
+ if(enroll && enrollStatus === "unused") {
433
+ setBusy("pairing");setError("");
434
+ try {await post(`/ui/runtimes/enrollment/${encodeURIComponent(enroll.id)}/revoke`);}catch(e){if(lease.current())setError(e.message);}finally{if(lease.current())setBusy("");}
435
+ }
436
+ if(!lease.current())return;
437
+ setEnroll(null);setPairing(null);setOpen(false);zipAsked.current=false;
438
+ await state.refresh();
439
+ };
440
+ const dismissJoined=id => setSeenJoined(seen => { const next=new Set(seen).add(id); writeSeenJoined(next); return next; });
340
441
  const action=async(machine,operation,body={}) => {
442
+ // "reject" drops a request that is still waiting: the button is the decision (no second question) and no "revoked" card stays. The server refuses it (409) for a computer that
443
+ // is no longer waiting, so it can never revoke one that was approved meanwhile (another tab, another administrator): the page says so and reads the list again.
444
+ const route=operation;
341
445
  if(operation === "revoke" && !await confirmDialog({message:machineText("revokeAsk"),confirmLabel:machineText("revoke"),danger:true}))return false;
342
446
  if(!lease.current())return false;
343
447
  setBusy(machine.id);setError("");
344
448
  try {
345
- await post(`/ui/runtimes/machines/${encodeURIComponent(machine.id)}/${operation}`,body);if(!lease.current())return false;
449
+ await post(`/ui/runtimes/machines/${encodeURIComponent(machine.id)}/${route}`,body);if(!lease.current())return false;
346
450
  // Kept before the refresh, so the card is never dropped between the answer and the new list.
347
451
  if(operation === "revoke")setRevokedHere(seen=>new Map(seen).set(machine.id,{...machine,status:"revoked"}));
348
452
  await state.refresh();return lease.current();
349
453
  }
350
- catch(e){if(lease.current())setError(operation === "refresh" ? `${machineText("cliFailed")} ${e.message}` : e.message);return false;}
454
+ catch(e){
455
+ if(!lease.current())return false;
456
+ if(operation === "reject" && e.status === 409){setError(machineText("alreadyHandled"));await state.refresh();return false;}
457
+ setError(operation === "refresh" ? `${machineText("cliFailed")} ${e.message}` : e.message);return false;
458
+ }
351
459
  finally{if(lease.current())setBusy("");}
352
460
  };
353
461
  const machines=state.data?.machines || [];
354
462
  const localMachine={id:"",isLocal:true,name:localInventory.data?.hostname || machineText("nativeWindows"),platform:"win32",status:windowsCli ? "online" : "offline",inventory:localInventory.data,inventoryUpdatedAt:localInventory.data?.probedAt,probing:localInventory.loading};
355
463
  const listed=machines.filter(machine=>machine.status !== "revoked" || revokedHere.has(machine.id));
356
464
  const gone=[...revokedHere.values()].filter(machine=>!machines.some(row=>row.id === machine.id));
357
- const allMachines=[...(windowsCli ? [localMachine] : []),...[...listed,...gone].map(machine=>({...machine,...(revokedHere.has(machine.id) ? {status:"revoked"} : {}),probing:busy===machine.id}))];
465
+ const shown=[...listed,...gone].map(machine=>({...machine,...(revokedHere.has(machine.id) ? {status:"revoked"} : {}),probing:busy===machine.id}));
466
+ // Computers waiting for approval come first, in the order they asked, so a long card never pushes Approve out of sight. A request that has run out is not waiting: it stays where it is, says so, and can be dropped.
467
+ const waiting=pendingMachines(shown), allMachines=[...waiting,...(windowsCli ? [localMachine] : []),...shown.filter(machine=>!waiting.includes(machine))];
468
+ const waitingIds=waiting.map(machine=>machine.id).join(",");
469
+ const [ask,setAsk]=useState(null), announced=useRef(new Set()), machinesRef=useRef(null);
470
+ // A computer waiting that this page has not asked about yet opens the dialog, and only that one: a computer the person has already put off with Later does not come back by itself, not
471
+ // even when another one arrives (it stays on the bar and on its card). A new one while the dialog is open joins its list ("1 of 2"). Never over another dialog: it waits until that closes.
472
+ useEffect(() => {
473
+ const fresh=waiting.filter(machine=>!announced.current.has(machine.id));
474
+ if(!fresh.length || otherDialogOpen())return;
475
+ fresh.forEach(machine=>announced.current.add(machine.id));
476
+ setAsk(open=>({ids:[...(open ? open.ids : []),...fresh.map(machine=>machine.id).filter(id=>!open?.ids.includes(id))]}));
477
+ },[waitingIds,state.checkedAt]);
478
+ const asking=ask ? ask.ids.map(id=>waiting.find(machine=>machine.id === id)).filter(Boolean) : [];
479
+ useEffect(() => { if(ask && !asking.length)setAsk(null); },[ask,asking.length]);
480
+ const review=() => {
481
+ if(!waiting.length)return;
482
+ setAsk({ids:waiting.map(machine=>machine.id)});
483
+ const card=[...(machinesRef.current?.querySelectorAll?.("[data-machine-id]") || [])].find(item=>item.getAttribute("data-machine-id") === waiting[0].id);
484
+ card?.scrollIntoView?.({block:"start"});
485
+ };
358
486
  const target=diagnosticMachineId === "" ? localMachine : machines.find(machine=>machine.id===diagnosticMachineId);
359
487
  if(diagnosticMachineId !== null && !taskSessions.current.has(diagnosticMachineId)) taskSessions.current.set(diagnosticMachineId,{requestId:null,pending:false,error:""});
360
488
  const probeTarget=async(id="")=>{
@@ -366,11 +494,15 @@ export function RuntimesPanel({navKey}) {
366
494
  const copyCode=async() => {
367
495
  try {await navigator.clipboard.writeText(pairing.code);if(!lease.current())return;setCopied(true);lease.timeout(() => setCopied(false),2000);}catch { /* the code is on screen to copy by hand */ }
368
496
  };
369
- const command=runtimeConnectCommand(server), installCommand=runtimeInstallCommand(server,installer.sha), windowsConnectCommand=runtimeWindowsConnectCommand(server);
497
+ const enrollRow=enroll ? (state.data?.enrollments || []).find(row => row.id === enroll.id) : null;
498
+ const enrollStatus=!enroll ? "none" : enrollRow?.status === "used" ? "used" : enrollRow?.status === "revoked" ? "revoked" : enrollRow?.status === "expired" || enroll.localExpiresAt <= Date.now() ? "expired" : "unused";
499
+ const enrollCommand=enrollStatus === "unused" ? runtimeEnrollCommand(server,installer.sha,enroll.token,enroll.fingerprint) : "";
500
+ const joinedMachine=enrollStatus === "used" ? machines.find(machine => machine.id === enrollRow?.machineId) : null;
501
+ const command=runtimeConnectCommand(server), installCommand=runtimeInstallCommand(server,installer.sha), installOnlyCommand=runtimeInstallOnlyCommand(server,installer.sha), windowsConnectCommand=runtimeWindowsConnectCommand(server);
370
502
  const copyCommand=async(key,text) => {
371
- try {await navigator.clipboard.writeText(text);if(!lease.current())return;setCopiedCommand(key);if(key === "install")setInstallCopied(true);lease.timeout(() => setCopiedCommand(""),2000);}catch { /* the command is on screen to copy by hand */ }
503
+ try {await navigator.clipboard.writeText(text);if(!lease.current())return;setCopiedCommand(key);if(key === "install" || key === "enroll")setInstallCopied(true);lease.timeout(() => setCopiedCommand(""),2000);}catch { /* the command is on screen to copy by hand */ }
372
504
  };
373
- const awaitingApproval=machines.some(machine => machine.status === "pending"), installed=tab === "windows" ? installCopied : !!downloadedFor, currentStep=awaitingApproval ? 4 : installed ? 3 : 2;
505
+ const awaitingApproval=machines.some(machine => machine.status === "pending" && !machine.pairingExpired), installed=tab === "windows" ? installCopied : !!downloadedFor, currentStep=tab === "windows" ? (enrollStatus === "used" ? 4 : installed || awaitingApproval ? 3 : 2) : awaitingApproval ? 4 : installed ? 3 : 2;
374
506
  const step=(n,title,body) => html`<li class=${`runtime-step${n < currentStep ? " is-done" : ""}`} aria-current=${n === currentStep ? "step" : undefined}><span class="runtime-step-n" aria-hidden="true">${n}</span><div><h4>${title}</h4>${body}</div></li>`;
375
507
  const downloadRuntime=async()=>{
376
508
  if(downloadClaim.current || !command)return;
@@ -386,7 +518,7 @@ export function RuntimesPanel({navKey}) {
386
518
  }catch(error){if(lease.current())setError(error.message || machineText("downloadFailed"));}
387
519
  finally{downloadClaim.current=false;if(lease.current())setBusy("");}
388
520
  };
389
- const download=(setup=false)=>html`<button type="button" class="btn btn-sm runtime-bundle-download" disabled=${!!busy || !setup && !command} onClick=${setup ? connect : downloadRuntime}><${Icon} name="download" size=${15} />${machineText(busy === "download" ? "downloadBuilding" : "download")}</button>`;
521
+ const download=(setup=false)=>html`<button type="button" class="btn btn-sm runtime-bundle-download" disabled=${!!busy || !setup && !command} onClick=${setup ? openZip : downloadRuntime}><${Icon} name="download" size=${15} />${machineText(busy === "download" ? "downloadBuilding" : "download")}</button>`;
390
522
 
391
523
  const commandCard=(key,label,text) => html`<div class="runtime-command-card"><span class="runtime-command-label">${label}</span><div class="runtime-command-row"><pre class="runtime-command-text" tabindex="0" aria-label=${label}><code>${text}</code></pre><button type="button" class="btn btn-sm" onClick=${() => copyCommand(key,text)}><${Icon} name="copy" size=${15} />${machineText(copiedCommand === key ? "commandCopied" : "copyCommand")}</button></div></div>`;
392
524
  const tabItems=[{id:"windows",label:machineText("tabWindows")},{id:"zip",label:machineText("tabZip")}];
@@ -403,20 +535,32 @@ export function RuntimesPanel({navKey}) {
403
535
  const installTabs=html`<div class="s-page-tabs runtime-install-tabs" role="tablist" aria-label=${machineText("installMethod")}>${tabItems.map((item,index) => html`<button key=${item.id} id=${`runtime-install-tab-${item.id}`} type="button" role="tab" class=${tab === item.id ? "on" : ""} aria-selected=${tab === item.id ? "true" : "false"} aria-controls="runtime-install-panel" tabindex=${tab === item.id ? 0 : -1} onClick=${() => setTab(item.id)} onKeyDown=${event => tabKeys(event,index)}>${item.label}</button>`)}</div>`;
404
536
  const addressStep=step(1,machineText("server"),html`<div class="field"><input type="url" aria-label=${machineText("server")} value=${server} disabled=${busy === "download"} spellcheck=${false} onInput=${event => setServer(event.target.value)} /></div><p class="note">${machineText("serverHint")}</p>${command ? null : html`<p role="alert">${machineText("serverInvalid")}</p>`}`);
405
537
  const approveStep=step(4,machineText("stepApprove"),html`<p class="note">${machineText("stepApproveHint")}</p>`);
538
+ const enrollNote=enrollStatus === "used" ? "enrollUsed" : enrollStatus === "revoked" ? "enrollRevoked" : "enrollExpired";
539
+ const pairCodeBlock=() => pairing ? html`<label class="field"><span>${machineText("pairingCode")}</span><div class="runtime-pair-code-row"><input class="runtime-pair-code" value=${pairing.code} readOnly=${true} spellcheck=${false} autocomplete="off" /><button type="button" class="btn btn-sm" onClick=${copyCode}><${Icon} name="copy" size=${15} />${machineText(copied ? "codeCopied" : "copyCode")}</button></div></label><p class="note">${machineText("expires",machineTime(pairing.expiresAt))}</p><p class="runtime-pair-status" role="status"><span class="windows-cli-dot"></span>${machineText(awaitingApproval ? "pairingApprove" : "pairingWait")}</p><button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${newPairingCode}>${machineText("newCode")}</button>` : null;
406
540
  const windowsSteps=html`${addressStep}
407
541
  ${step(2,machineText("stepInstall"),html`<p class="note">${machineText("stepInstallHint")}</p>
408
542
  ${installer.status === "loading" || installer.status === "idle" ? html`<${Skeleton} lines=${3} label=${machineText("installerLoading")} />` : null}
409
543
  ${installer.status === "error" ? html`<p class="runtime-installer-error" role="alert">${machineText("installerUnavailable")} <button type="button" class="btn btn-ghost btn-sm" onClick=${() => void loadInstaller()}>${machineText("installerRetry")}</button></p>` : null}
410
- ${installCommand ? html`${commandCard("install",machineText("installCommand"),installCommand)}<p class="note runtime-installer-hash">${machineText("installerHash")} <code>${installer.sha}</code></p><p class="note">${machineText("tlsHelp")}</p><p class="note">${machineText("restrictedHelp")}</p>` : null}`)}
411
- ${step(3,machineText("stepConnect"),html`<p class="note">${machineText("stepConnectHint")}</p>${windowsConnectCommand ? commandCard("connect",machineText("connectCommand"),windowsConnectCommand) : null}`)}
412
- ${approveStep}`;
544
+ ${!enroll ? html`<button type="button" class="btn btn-primary btn-sm runtime-enroll-generate" disabled=${!!busy} onClick=${connect}>${machineText("enrollGenerate")}</button>` : null}
545
+ ${enrollCommand ? html`${commandCard("enroll",machineText("installCommand"),enrollCommand)}<details class="runtime-more-details"><summary>${machineText("verifyAndHelp")}</summary><p class="note runtime-installer-hash">${machineText("installerHash")} <code>${installer.sha}</code></p><p class="note runtime-installer-hash">${machineText("enrollFingerprint")} <code>${enroll.fingerprint}</code></p><p class="note">${machineText("tlsHelp")}</p><p class="note">${machineText("restrictedHelp")}</p></details>`
546
+ : enroll && enrollStatus !== "unused" ? html`<p class="note runtime-enroll-ended" role="status">${machineText(enrollNote)}</p>` : null}
547
+ ${windowsConnectCommand ? html`<details class="runtime-manual-command"><summary>${machineText("manualCommands")}</summary><p class="note">${machineText("manualCommandsHint")}</p>${installOnlyCommand ? commandCard("install-only",machineText("installOnlyCommand"),installOnlyCommand) : null}${commandCard("connect",machineText("connectCommand"),windowsConnectCommand)}${pairing ? pairCodeBlock() : html`<button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${newPairingCode}>${machineText("showPairingCode")}</button>`}<p class="note">${machineText("manualCodeNote")}</p></details>` : null}`)}
548
+ ${step(3,machineText("stepConnect"),html`<p class="note">${machineText("stepConnectHint")}</p>${joinedMachine ? html`<p class="note" role="status">${machineText("enrollJoinedStep",joinedMachine.name)}</p>` : null}`)}`;
413
549
  const zipSteps=html`${addressStep}
414
550
  ${step(2,machineText("stepDownload"),html`<p class="note">${machineText("stepZipHint")}</p>${download()}${downloadedFor ? html`<p class="note" role="status">${machineText("downloadedFor",downloadedFor)}</p>` : null}`)}
415
551
  ${step(3,machineText("stepLaunch"),html`<p class="note">${machineText("stepLaunchHint")}</p>${command ? html`<details class="runtime-manual-command"><summary>${machineText("manualCommand")}</summary><label class="field"><span>${machineText("command")}</span><input class="runtime-command" value=${command} readOnly=${true} spellcheck=${false} /></label><p class="note">${machineText("manualMultiHint")}</p></details>` : null}`)}
416
552
  ${approveStep}`;
417
553
 
554
+ const enrollAside=html`<aside class=${`runtime-pair-card runtime-enroll-card is-${enrollStatus}${awaitingApproval ? " is-pending" : ""}`}><h4>${machineText("enrollCardTitle")}</h4><p class="runtime-pair-status" role="status"><span class="windows-cli-dot"></span>${machineText(awaitingApproval ? "pairingApprove" : enrollStatus === "unused" || enrollStatus === "none" ? "enrollWait" : enrollNote)}</p>${enrollStatus === "unused" ? html`<${EnrollClock} lease=${lease} expiresAt=${enroll.localExpiresAt} />` : null}<p class="note lbar runtime-enroll-warning">${machineText("enrollSecurity")}</p><div class="runtime-pair-actions"><button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${connect}>${machineText("enrollNew")}</button><button type="button" class="btn btn-ghost btn-sm" disabled=${!!busy} onClick=${closePanel}>${machineText(enrollStatus === "unused" ? "enrollRevoke" : "closeCode")}</button></div></aside>`;
555
+ const zipAside=html`<aside class=${`runtime-pair-card${awaitingApproval ? " is-pending" : ""}`}>${pairing ? pairCodeBlock() : html`<button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${newPairingCode}>${machineText("newCode")}</button>`}<div class="runtime-pair-actions"><button type="button" class="btn btn-ghost btn-sm" onClick=${closePanel}>${machineText("closeCode")}</button></div></aside>`;
556
+ const joinedNotices=machines.filter(machine => machine.enrolledVia === "install-command" && machine.status !== "revoked" && !revokedHere.has(machine.id) && !seenJoined.has(machine.id) && Date.now()-(machine.approvedAt || 0) < JOINED_NOTICE_MS)
557
+ .map(machine => html`<section key=${machine.id} class="runtime-joined" role="status" data-machine-id=${machine.id}><${Icon} name="info" size=${18} /><div class="runtime-joined-text"><h4>${machineText("joinedTitle")}</h4><p class="note">${machineText("joinedBody",machine.name,machineTime(machine.approvedAt))}</p></div><div class="runtime-joined-actions"><button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${() => action(machine,"revoke")}>${machineText("joinedRevoke")}</button><button type="button" class="btn btn-ghost btn-sm" onClick=${() => dismissJoined(machine.id)}>${machineText("joinedDismiss")}</button></div></section>`);
418
558
  const computers = html`<section class="runtime-computers"><div class="runtime-computers-heading"><h3>${machineText("computersTitle")}</h3><div class="note">${state.data ? machineText((allMachines.length) === 1 ? "machineCountOne" : "machineCount",allMachines.length) : !state.error ? html`<${Skeleton} variant="inline" lines=${1} />` : "—"}</div></div>
419
- <section class="runtime-machines" aria-label=${machineText("machines")}>${!state.data && !state.error ? html`<${Skeleton} variant="cards" lines=${2} label=${machineText("loading")} />` : allMachines.map(machine=>html`<${MachineCard} key=${machine.isLocal ? "local" : machine.id} lease=${lease} onChanged=${state.refresh} machine=${machine} busy=${!!busy || !!machine.probing} action=${action} openDiagnostics=${openDiagnostics} probe=${probeTarget} repairUpdate=${setRepairMachine} />`)}</section>
559
+ ${waiting.length ? html`<div class="note lbar runtime-pending-banner" role="status"><span>${waiting.length === 1 ? machineText("awaitingOne") : machineText("awaitingMany",waiting.length)}</span><button type="button" class="btn btn-primary btn-sm runtime-pending-review" onClick=${review}>${machineText("awaitingReview")}</button></div>` : null}
560
+ ${joinedNotices}
561
+ <section class="runtime-machines" ref=${machinesRef} aria-label=${machineText("machines")}>${!state.data && !state.error ? html`<${Skeleton} variant="cards" lines=${2} label=${machineText("loading")} />` : allMachines.map(machine=>html`<${MachineCard} key=${machine.isLocal ? "local" : machine.id} sameName=${sameNameInfo(allMachines,machine)} lease=${lease} onChanged=${state.refresh} machine=${machine} busy=${!!busy || !!machine.probing} action=${action} openDiagnostics=${openDiagnostics} probe=${probeTarget} repairUpdate=${setRepairMachine} />`)}</section>
562
+ ${asking.length ? html`<${ApproveDialog} key=${asking[0].id} machine=${asking[0]} position=${ask.ids.indexOf(asking[0].id)+1} total=${ask.ids.length} sameName=${sameNameInfo(allMachines,asking[0])?.others.find(other=>other.status !== "pending")} busy=${!!busy} error=${error}
563
+ onApprove=${()=>action(asking[0],"approve",{fingerprint:asking[0].pairingFingerprint})} onReject=${()=>action(asking[0],"reject")} onLater=${()=>setAsk(null)} />` : null}
420
564
  ${repairMachine ? html`<${Dialog} title=${runtimeUpdateText("repairTitle")} onClose=${() => setRepairMachine(null)}>
421
565
  <p>${runtimeUpdateText("repairHint")}</p>
422
566
  ${installer.status === "idle" || installer.status === "loading" ? html`<${Skeleton} lines=${3} label=${machineText("installerLoading")} />` : null}
@@ -427,12 +571,12 @@ export function RuntimesPanel({navKey}) {
427
571
  <article class="runtime-host-note"><${Icon} name="info" size=${18} /><span>${machineText("hostLocationNote")}</span></article></section>`;
428
572
 
429
573
  return html`<section class="runtime-settings">
430
- <header class="runtime-heading s-page-head"><div><h2>${machineText("title")}<span class="s-scope">${machineText("fleetScope")}</span></h2><p class="s-page-lead">${machineText("lead")}</p></div><div><button type="button" class="btn btn-primary btn-sm" disabled=${!!busy || state.data?.enabled !== true} onClick=${connect}><${Icon} name="plus" size=${15} />${machineText("connect")}</button>${state.data?.enabled === true && !pairing ? download(true) : null}<button type="button" class="btn btn-sm" disabled=${state.loading} onClick=${state.refresh}><${Icon} name="restart" size=${15} />${machineText("refresh")}</button></div></header>
431
- ${state.data?.enabled === false ? html`<p class="note">${machineText("disabled")}</p>` : null}
574
+ <header class="runtime-heading s-page-head"><div><h2>${machineText("title")}<span class="s-scope">${machineText("fleetScope")}</span></h2><p class="s-page-lead">${machineText("lead")}</p></div><div><button type="button" class="btn btn-primary btn-sm" disabled=${!!busy || state.data?.enabled !== true} onClick=${connect}><${Icon} name="plus" size=${15} />${machineText("connect")}</button>${state.data?.enabled === true && !open ? download(true) : null}<button type="button" class="btn btn-sm" disabled=${state.loading} onClick=${state.refresh}><${Icon} name="restart" size=${15} />${machineText("refresh")}</button></div></header>
575
+ ${state.data?.enabled === false ? html`<p class="note">${machineText("disabled")} <button type="button" class="btn runtime-open-policy" onClick=${() => { if (typeof document === "undefined") return; const d = document.querySelector("details.runtime-policy"); if (d) d.open = true; const el = document.getElementById("runtimeRemoteRuntime") || d; el?.scrollIntoView?.({ block: "center", behavior: "smooth" }); el?.focus?.(); }}>${machineText("openPolicy")}</button></p>` : null}
432
576
  ${error || state.error ? html`<div class="runtime-error" role="alert"><p>${error || state.error}</p>${state.data && state.error ? html`<p>${machineText("seenCached")}</p>` : null}<button type="button" class="btn btn-sm" onClick=${state.refresh}>${machineText("retry")}</button></div>` : null}
433
- ${pairing ? html`<section class="runtime-pairing" aria-label=${machineText("pairing")}><header><h3>${machineText("pairing")}</h3><p class="note">${machineText("pairingHint")}</p></header><div class="runtime-pairing-body"><div class="runtime-install">${installTabs}<div id="runtime-install-panel" class="runtime-install-panel" role="tabpanel" aria-labelledby=${`runtime-install-tab-${tab}`} data-install-method=${tab}><ol class="runtime-steps">
577
+ ${open ? html`<section class="runtime-pairing" aria-label=${machineText("pairing")}><header><h3>${machineText("pairing")}</h3><p class="note">${machineText("pairingHint")}</p></header><div class="runtime-pairing-body"><div class="runtime-install">${installTabs}<div id="runtime-install-panel" class="runtime-install-panel" role="tabpanel" aria-labelledby=${`runtime-install-tab-${tab}`} data-install-method=${tab}><ol class="runtime-steps">
434
578
  ${tab === "windows" ? windowsSteps : zipSteps}
435
- </ol></div></div><aside class=${`runtime-pair-card${awaitingApproval ? " is-pending" : ""}`}><label class="field"><span>${machineText("pairingCode")}</span><div class="runtime-pair-code-row"><input class="runtime-pair-code" value=${pairing.code} readOnly=${true} spellcheck=${false} autocomplete="off" /><button type="button" class="btn btn-sm" onClick=${copyCode}><${Icon} name="copy" size=${15} />${machineText(copied ? "codeCopied" : "copyCode")}</button></div></label><p class="note">${machineText("expires",machineTime(pairing.expiresAt))}</p><p class="runtime-pair-status" role="status"><span class="windows-cli-dot"></span>${machineText(awaitingApproval ? "pairingApprove" : "pairingWait")}</p><div class="runtime-pair-actions"><button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${connect}>${machineText("newCode")}</button><button type="button" class="btn btn-ghost btn-sm" onClick=${() => setPairing(null)}>${machineText("closeCode")}</button></div></aside></div></section>` : null}
579
+ </ol></div></div>${tab === "windows" ? enrollAside : zipAside}</div></section>` : null}
436
580
  <${RuntimeSwitches} lease=${lease} onChanged=${state.refresh} computers=${computers} />
437
581
  ${diagnosticMachineId !== null ? html`<${RuntimeDiagnosticsDialog} key=${diagnosticMachineId || "local"} navKey=${navKey} machineId=${diagnosticMachineId} machine=${target} enabled=${diagnosticMachineId !== "" || windowsCli} drafts=${drafts.current} session=${taskSessions.current.get(diagnosticMachineId)} taskLease=${lease} onChanged=${state.refresh} onClose=${()=>setDiagnosticMachineId(null)} />` : null}
438
582
  <p class="note runtime-operations-note">${machineText("operationsNote")}</p>
@@ -444,3 +588,58 @@ register("machines", {
444
588
  en: { cliCountOne: "{0} CLI", machineCountOne: "{0} computer" },
445
589
  "zh-TW": { cliCountOne: "{0} 個 CLI", machineCountOne: "{0} 台電腦" },
446
590
  });
591
+ // a computer asking to pair opens a dialog (a shortcut to the card's own Approve), waiting computers come first,
592
+ // and computers with the same name can be told apart.
593
+ register("machines", {
594
+ en: { awaitingOne:"1 computer is waiting for approval", awaitingMany:"{0} computers are waiting for approval", awaitingReview:"Review and approve",
595
+ askTitle:"A computer wants to pair", askOf:"{0} of {1}", askRequested:"Requested", askApprove:"Approve", askReject:"Reject", askLater:"Later",
596
+ askSameName:"A computer with this name is already paired (paired {0}). It may be the same computer pairing again: check the fingerprint.",
597
+ sameName:"Another computer is also named “{0}”. Use ⋯ → Rename to tell them apart.", pairedAt:"Paired {0} · ID {1}", requestedAt:"Requested {0} · ID {1}",
598
+ alreadyHandled:"This computer was already approved or removed, probably in another tab. The list is up to date now.",
599
+ pairingExpired:"This request has expired. Run the connect command on that computer again; Reject clears this one." },
600
+ "zh-TW": { awaitingOne:"有 1 台電腦等待核准", awaitingMany:"有 {0} 台電腦等待核准", awaitingReview:"檢視並核准",
601
+ askTitle:"有電腦要求配對", askOf:"第 {0} 台,共 {1} 台", askRequested:"要求時間", askApprove:"核准", askReject:"拒絕", askLater:"稍後",
602
+ askSameName:"已有一台同名電腦(配對於 {0})。可能是同一台重新配對,請看指紋。",
603
+ sameName:"另一台電腦也叫「{0}」。可從 ⋯ 選單 →「重新命名」改成容易分辨的名稱。", pairedAt:"配對於 {0} · 識別碼 {1}", requestedAt:"要求於 {0} · 識別碼 {1}",
604
+ alreadyHandled:"這台電腦已經被核准或移除了,可能是在另一個分頁。清單已經更新。",
605
+ pairingExpired:"這個要求已經過期。請在那台電腦重新執行連線指令;按「拒絕」可以清掉這一筆。" },
606
+ });
607
+
608
+ /** A computer's name as compared for "same name" — trimmed, any case. */
609
+ const nameKey = machine => String(machine?.name || "").trim().toLowerCase();
610
+ /** Paired computers in the order they asked to pair (then by id, so the order never changes between polls). */
611
+ const byPairing = (a,b) => (Number(a.createdAt) || 0)-(Number(b.createdAt) || 0) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
612
+ /** `{ n, others }` for a paired computer whose name another not-revoked paired computer shares (n = its place, from 1, among them); else null. */
613
+ export function sameNameInfo(machines, machine) {
614
+ if (!machine || machine.isLocal || machine.status === "revoked") return null;
615
+ const group = machines.filter(item => !item.isLocal && item.status !== "revoked" && nameKey(item) === nameKey(machine)).sort(byPairing);
616
+ return group.length > 1 ? { n:group.findIndex(item => item.id === machine.id)+1, others:group.filter(item => item.id !== machine.id) } : null;
617
+ }
618
+ /** The computers waiting for approval, in the order they asked. One whose request has run out (the server says so) can no longer be approved and is not among them. */
619
+ export const pendingMachines = machines => machines.filter(machine => !machine.isLocal && machine.status === "pending" && !machine.pairingExpired).sort(byPairing);
620
+ /** An unasked-for dialog must not land on top of one the person is already using (rename, diagnostics, a question). The approval dialog itself does not count: it is the one a new computer joins. */
621
+ const otherDialogOpen = () => typeof document !== "undefined" && !!document.querySelector?.("dialog[open]:not(.runtime-approve-dialog)");
622
+ /** How long the dialog's Approve stays off after it shows: it appears by itself, so a click already on its way must not land on it. */
623
+ export const APPROVE_ARM_MS = 1000;
624
+
625
+ /**
626
+ * The shortcut to approving: one waiting computer at a time, its pairing fingerprint large, to compare with the one in that
627
+ * computer's terminal. Later, Esc, the backdrop and × only close it; the card keeps its own Approve. Reject drops the request.
628
+ */
629
+ function ApproveDialog({ machine, position, total, sameName, busy, error, onApprove, onReject, onLater }) {
630
+ const [armed,setArmed] = useState(false), lease = useLease(`runtime-approve:${machine.id}`);
631
+ useEffect(() => {
632
+ setArmed(false);
633
+ const timer = lease.timeout(() => setArmed(true),APPROVE_ARM_MS);
634
+ return () => lease.clear(timer);
635
+ },[lease,machine.id]);
636
+ const fingerprint = machine.pairingFingerprint;
637
+ return html`<${Dialog} title=${machineText("askTitle")} cls="runtime-approve-dialog" busy=${busy} onClose=${onLater}
638
+ actions=${html`<button type="button" class="btn" disabled=${busy} onClick=${onLater}>${machineText("askLater")}</button><span class="dlg-spacer"></span><button type="button" class="btn btn-danger runtime-ask-reject" disabled=${busy} onClick=${onReject}>${machineText("askReject")}</button><button type="button" class="btn btn-primary runtime-ask-approve" disabled=${busy || !armed || !fingerprint} onClick=${onApprove}>${machineText("askApprove")}</button>`}>
639
+ ${total > 1 ? html`<p class="note">${machineText("askOf",position,total)}</p>` : null}
640
+ <dl class="runtime-machine-facts"><dt>${machineText("machineName")}</dt><dd>${machine.name}</dd><dt>${machineText("hostName")}</dt><dd>${machine.hostname || machineText("unknown")}</dd><dt>${machineText("platform")}</dt><dd>${machine.platform === "win32" ? "Windows" : machine.platform || machineText("unknown")}</dd><dt>${machineText("askRequested")}</dt><dd>${machineTime(machine.createdAt)}</dd></dl>
641
+ <div><p class="note">${machineText("fingerprint")}</p><p class="runtime-approve-fingerprint">${fingerprint || machineText("unknown")}</p><p class="note">${machineText("approvalHint")}</p></div>
642
+ ${sameName ? html`<p class="note lbar runtime-same-name">${machineText("askSameName",machineTime(sameName.approvedAt || sameName.createdAt))}</p>` : null}
643
+ ${error ? html`<p class="err" role="alert">${error}</p>` : null}
644
+ </${Dialog}>`;
645
+ }
@@ -62,6 +62,7 @@ import { syncStage, useDraft } from "./settings-draft.js";
62
62
  import { WebAuthorityCard } from "./settings-web-authority.js";
63
63
  import { OutsideCard } from "./settings-outside.js";
64
64
  import { DevicesCard } from "./settings-devices.js";
65
+ import { AccessOverview } from "./settings-access-overview.js";
65
66
  import { HubSection, hubSectionText } from "./settings-hub-section.js";
66
67
  import { NamedLinkTest, setTypedTunnelToken } from "./settings-named-test.js";
67
68
  import { SignInList } from "./backend-signin.js";
@@ -1234,7 +1235,7 @@ export function uploadMbInEffect(web) {
1234
1235
  }
1235
1236
  function WebSection({ ctx, staged, part = "all" }) {
1236
1237
  const { schema } = ctx;
1237
- const [accessTab, setAccessTab] = useSettingsTabs("access", "login");
1238
+ const [accessTab, setAccessTab] = useSettingsTabs("access", "overview");
1238
1239
  const web = ctx.fleet.web || {}, local = (web.session && web.session.local) || {}, term = ctx.fleet.web_terminal || {};
1239
1240
  // Over the public link the fields read only; the Guests and Web authority cards are not offered (the server never
1240
1241
  // serves their reads there).
@@ -1373,6 +1374,7 @@ function WebSection({ ctx, staged, part = "all" }) {
1373
1374
  const has = (p) => part === "all" || part === p;
1374
1375
  const lock = (body) => html`<fieldset class="s-web-fields" disabled=${overPublicLink}>${body}</fieldset>`;
1375
1376
  const tabs = [
1377
+ { id: "overview", label: layoutText("accessOverview") },
1376
1378
  { id: "login", label: layoutText("accessLogin") },
1377
1379
  { id: "guests", label: layoutText("accessGuests") },
1378
1380
  { id: "sharing", label: layoutText("accessSharing") },
@@ -1389,6 +1391,10 @@ function WebSection({ ctx, staged, part = "all" }) {
1389
1391
  ${overPublicLink && part !== "readonly" ? html`<p class="note s-access-notice" role="status" id="webPublicRefused">${tn("webPublicRefused")}</p>` : null}
1390
1392
  ${has("access") ? html`<${SettingsTabs} id="access" value=${accessTab} onChange=${setAccessTab} items=${tabs} />
1391
1393
  <div class="s-access-banner"><${Icon} name="info" size=${18} /><p>${layoutText("revAccessPolicy")}</p><details class="s-access-policy"><summary>${layoutText("revDetails")}</summary><p class="note">${tn("webLead")}</p></details></div>
1394
+ <${SettingsTabPanel} group="access" id="overview" active=${accessTab === "overview"}>
1395
+ <${AccessOverview} web=${web} hub=${!!ctx.fleet.hub?.hubId} overPublicLink=${overPublicLink} active=${accessTab === "overview"}
1396
+ openTab=${(tab, anchor) => { setAccessTab(tab); if (anchor) setTimeout(() => globalThis.document?.getElementById(anchor)?.scrollIntoView({ block: "start" }), 50); }} />
1397
+ </${SettingsTabPanel}>
1392
1398
  <${SettingsTabPanel} group="access" id="login" active=${accessTab === "login"}>
1393
1399
  <div class="s-access-login-layout"><div class="s-access-stack">
1394
1400
  ${/* #3008: a web-only fleet's connections from outside — changed on this computer only, shown (read-only) elsewhere. */ ""}
@@ -166,7 +166,7 @@ export function WindowsCliPanel({ navKey, embedded = false, machineId = "", mach
166
166
  <section class="windows-cli-card windows-cli-composer" aria-labelledby="windows-task-title"><div class="windows-cli-section-head"><span class="windows-cli-section-icon"><${Icon} name="edit" size=${19} /></span><div><h2 id="windows-task-title">${tn("newTask")}</h2><p>${tn(machineId ? "remoteHint" : "taskHint")}</p></div></div>
167
167
  <form onSubmit=${e => { e.preventDefault(); if (runnable && !submitting && !running && cwd.trim() && prompt.trim()) void run(); }}>
168
168
  <div class="windows-cli-field"><label>CLI</label><${CliPicker} label="CLI" value=${selected} choices=${choices} disabled=${!choices.length || submitting || running} onChange=${value => { setSelected(value); setModel(""); }} /></div>
169
- <div class="windows-cli-field"><label for="windows-model">${tn("model")}</label><${ModelSelect} key=${selected} id="windows-model" value=${model} onChange=${setModel} catalogOverride=${current?.models || []} inherit=${tn("defaultModel")} /></div>
169
+ <div class="windows-cli-field"><label for="windows-model">${tn("model")}</label><${ModelSelect} key=${selected} id="windows-model" value=${model} onChange=${setModel} backend=${selected} runtime="windows" machineId=${machineId || undefined} inherit=${tn("defaultModel")} /></div>
170
170
  <div class="windows-cli-field"><label for="windows-cwd">${tn("folder")}</label><input id="windows-cwd" class="windows-cli-directory" value=${cwd} placeholder="J:\\Project\\Game" aria-describedby="windows-cwd-hint" required spellcheck=${false} onInput=${e => setCwd(e.target.value)} /><p id="windows-cwd-hint">${tn("folderHint")}</p></div>
171
171
  <div class="windows-cli-field"><label for="windows-prompt">${tn("prompt")}</label><textarea id="windows-prompt" rows="5" value=${prompt} placeholder=${tn("promptPlaceholder")} required maxLength=${16384} onInput=${e => setPrompt(e.target.value)} /></div>
172
172
  <fieldset class="windows-cli-access"><legend>${tn("access")}</legend><div class="windows-cli-access-options">