@songsid/agend 2.4.0-alpha.1 → 2.4.0-alpha.3

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 (529) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/dist/account-isolation.d.ts +6 -0
  4. package/dist/account-isolation.js +40 -0
  5. package/dist/account-isolation.js.map +1 -0
  6. package/dist/accounts-signout.d.ts +15 -2
  7. package/dist/accounts-signout.js +52 -4
  8. package/dist/accounts-signout.js.map +1 -1
  9. package/dist/accounts-view.d.ts +114 -27
  10. package/dist/accounts-view.js +123 -60
  11. package/dist/accounts-view.js.map +1 -1
  12. package/dist/agent-cli-instructions.md +9 -7
  13. package/dist/agent-cli.js +47 -20
  14. package/dist/agent-cli.js.map +1 -1
  15. package/dist/agent-endpoint.js +23 -8
  16. package/dist/agent-endpoint.js.map +1 -1
  17. package/dist/agent-list-output.d.ts +23 -0
  18. package/dist/agent-list-output.js +53 -0
  19. package/dist/agent-list-output.js.map +1 -0
  20. package/dist/agent-runtime-change.js +4 -4
  21. package/dist/agent-runtime-change.js.map +1 -1
  22. package/dist/agent-whats-new.js +4 -0
  23. package/dist/agent-whats-new.js.map +1 -1
  24. package/dist/antigravity-first-run.d.ts +4 -0
  25. package/dist/antigravity-first-run.js +57 -0
  26. package/dist/antigravity-first-run.js.map +1 -0
  27. package/dist/antigravity-identity.d.ts +6 -0
  28. package/dist/antigravity-identity.js +27 -0
  29. package/dist/antigravity-identity.js.map +1 -0
  30. package/dist/antigravity-store.d.ts +22 -0
  31. package/dist/antigravity-store.js +79 -0
  32. package/dist/antigravity-store.js.map +1 -0
  33. package/dist/auth-api.js +7 -1
  34. package/dist/auth-api.js.map +1 -1
  35. package/dist/backend/agy-onboarding.d.ts +14 -0
  36. package/dist/backend/agy-onboarding.js +114 -0
  37. package/dist/backend/agy-onboarding.js.map +1 -0
  38. package/dist/backend/antigravity.d.ts +15 -0
  39. package/dist/backend/antigravity.js +44 -4
  40. package/dist/backend/antigravity.js.map +1 -1
  41. package/dist/backend/claude-code.js +4 -0
  42. package/dist/backend/claude-code.js.map +1 -1
  43. package/dist/backend/credential-profile.d.ts +22 -3
  44. package/dist/backend/credential-profile.js +61 -9
  45. package/dist/backend/credential-profile.js.map +1 -1
  46. package/dist/backend/types.d.ts +6 -0
  47. package/dist/backend/types.js.map +1 -1
  48. package/dist/backend-availability.d.ts +7 -1
  49. package/dist/backend-availability.js +39 -1
  50. package/dist/backend-availability.js.map +1 -1
  51. package/dist/browser-backend-signins.d.ts +16 -2
  52. package/dist/browser-backend-signins.js +17 -9
  53. package/dist/browser-backend-signins.js.map +1 -1
  54. package/dist/build-provenance.json +1 -1
  55. package/dist/channel/mcp-tools.js +10 -10
  56. package/dist/channel/mcp-tools.js.map +1 -1
  57. package/dist/claude-auth-status.d.ts +1 -0
  58. package/dist/claude-auth-status.js +25 -0
  59. package/dist/claude-auth-status.js.map +1 -1
  60. package/dist/cli-capability.d.ts +104 -19
  61. package/dist/cli-capability.js +3 -1
  62. package/dist/cli-capability.js.map +1 -1
  63. package/dist/cli-caps-module.d.ts +14 -0
  64. package/dist/cli-caps-module.js +8 -1
  65. package/dist/cli-caps-module.js.map +1 -1
  66. package/dist/cli-registry-check.js +114 -18
  67. package/dist/cli-registry-check.js.map +1 -1
  68. package/dist/cli-registry.d.ts +116 -12
  69. package/dist/cli-registry.js +16 -1
  70. package/dist/cli-registry.js.map +1 -1
  71. package/dist/cli-spec-antigravity.d.ts +53 -11
  72. package/dist/cli-spec-antigravity.js +44 -13
  73. package/dist/cli-spec-antigravity.js.map +1 -1
  74. package/dist/cli-spec-claude-code.d.ts +14 -1
  75. package/dist/cli-spec-claude-code.js +5 -4
  76. package/dist/cli-spec-claude-code.js.map +1 -1
  77. package/dist/cli-spec-codex.d.ts +8 -0
  78. package/dist/cli-spec-codex.js +4 -3
  79. package/dist/cli-spec-codex.js.map +1 -1
  80. package/dist/cli-spec-grok.d.ts +4 -0
  81. package/dist/cli-spec-grok.js +2 -1
  82. package/dist/cli-spec-grok.js.map +1 -1
  83. package/dist/cli-spec-kiro-cli.d.ts +7 -0
  84. package/dist/cli-spec-kiro-cli.js +3 -2
  85. package/dist/cli-spec-kiro-cli.js.map +1 -1
  86. package/dist/cli-spec-muse.d.ts +4 -0
  87. package/dist/cli-spec-muse.js +2 -1
  88. package/dist/cli-spec-muse.js.map +1 -1
  89. package/dist/cli-spec-opencode.d.ts +1 -0
  90. package/dist/cli-spec-opencode.js +1 -0
  91. package/dist/cli-spec-opencode.js.map +1 -1
  92. package/dist/config-validator.js +47 -7
  93. package/dist/config-validator.js.map +1 -1
  94. package/dist/credential-store-proof.d.ts +6 -0
  95. package/dist/credential-store-proof.js +30 -0
  96. package/dist/credential-store-proof.js.map +1 -0
  97. package/dist/daemon.d.ts +3 -0
  98. package/dist/daemon.js +6 -2
  99. package/dist/daemon.js.map +1 -1
  100. package/dist/decision-list.d.ts +5 -4
  101. package/dist/decision-list.js +22 -8
  102. package/dist/decision-list.js.map +1 -1
  103. package/dist/fleet-manager.d.ts +53 -5
  104. package/dist/fleet-manager.js +301 -115
  105. package/dist/fleet-manager.js.map +1 -1
  106. package/dist/fleet-windows-runtime.js +6 -6
  107. package/dist/fleet-windows-runtime.js.map +1 -1
  108. package/dist/general-knowledge/skills/concepts/SKILL.md +32 -4
  109. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +42 -6
  110. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +14 -6
  111. package/dist/general-knowledge/skills/fleet-health/SKILL.md +16 -0
  112. package/dist/general-knowledge/skills/hub/SKILL.md +361 -0
  113. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  114. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +184 -36
  115. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  116. package/dist/general-role.d.ts +1 -1
  117. package/dist/general-role.js +1 -0
  118. package/dist/general-role.js.map +1 -1
  119. package/dist/hub/audit/index.js +12 -5
  120. package/dist/hub/audit/index.js.map +1 -1
  121. package/dist/hub/buttons.d.ts +3 -0
  122. package/dist/hub/buttons.js +11 -11
  123. package/dist/hub/buttons.js.map +1 -1
  124. package/dist/hub/catalog.d.ts +18 -5
  125. package/dist/hub/catalog.js +119 -36
  126. package/dist/hub/catalog.js.map +1 -1
  127. package/dist/hub/client.d.ts +6 -0
  128. package/dist/hub/client.js +6 -1
  129. package/dist/hub/client.js.map +1 -1
  130. package/dist/hub/compose/member.d.ts +2 -0
  131. package/dist/hub/compose/member.js +26 -2
  132. package/dist/hub/compose/member.js.map +1 -1
  133. package/dist/hub/compose/server.d.ts +6 -0
  134. package/dist/hub/compose/server.js +11 -4
  135. package/dist/hub/compose/server.js.map +1 -1
  136. package/dist/hub/directory/directory.d.ts +1 -1
  137. package/dist/hub/directory/directory.js +51 -0
  138. package/dist/hub/directory/directory.js.map +1 -1
  139. package/dist/hub/directory/types.d.ts +14 -0
  140. package/dist/hub/directory/types.js.map +1 -1
  141. package/dist/hub/enrolment-code.d.ts +126 -0
  142. package/dist/hub/enrolment-code.js +266 -0
  143. package/dist/hub/enrolment-code.js.map +1 -0
  144. package/dist/hub/grant-access.d.ts +11 -0
  145. package/dist/hub/grant-access.js +113 -0
  146. package/dist/hub/grant-access.js.map +1 -0
  147. package/dist/hub/grant-search.d.ts +9 -0
  148. package/dist/hub/grant-search.js +92 -0
  149. package/dist/hub/grant-search.js.map +1 -0
  150. package/dist/hub/group-policy/admin-impact.d.ts +2 -0
  151. package/dist/hub/group-policy/admin-impact.js +14 -4
  152. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  153. package/dist/hub/group-policy/admin-inventory.js +7 -7
  154. package/dist/hub/group-policy/admin-inventory.js.map +1 -1
  155. package/dist/hub/group-policy/authorization.d.ts +20 -3
  156. package/dist/hub/group-policy/authorization.js +132 -27
  157. package/dist/hub/group-policy/authorization.js.map +1 -1
  158. package/dist/hub/group-policy/impact-inventory.js +23 -7
  159. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  160. package/dist/hub/group-policy/resources.d.ts +44 -6
  161. package/dist/hub/group-policy/resources.js +75 -30
  162. package/dist/hub/group-policy/resources.js.map +1 -1
  163. package/dist/hub/group-policy/store.d.ts +24 -3
  164. package/dist/hub/group-policy/store.js +136 -77
  165. package/dist/hub/group-policy/store.js.map +1 -1
  166. package/dist/hub/group-policy/welcome.js.map +1 -1
  167. package/dist/hub/http/compose.js +68 -16
  168. package/dist/hub/http/compose.js.map +1 -1
  169. package/dist/hub/http/core.d.ts +18 -0
  170. package/dist/hub/http/core.js +108 -7
  171. package/dist/hub/http/core.js.map +1 -1
  172. package/dist/hub/http/deps.d.ts +8 -0
  173. package/dist/hub/http/schema.js +11 -0
  174. package/dist/hub/http/schema.js.map +1 -1
  175. package/dist/hub/init/text.js +2 -2
  176. package/dist/hub/init/text.js.map +1 -1
  177. package/dist/hub/init/web.d.ts +7 -0
  178. package/dist/hub/init/web.js +6 -1
  179. package/dist/hub/init/web.js.map +1 -1
  180. package/dist/hub/join/local.d.ts +32 -0
  181. package/dist/hub/join/local.js +98 -10
  182. package/dist/hub/join/local.js.map +1 -1
  183. package/dist/hub/join/receipt.d.ts +1 -0
  184. package/dist/hub/join/receipt.js +1 -1
  185. package/dist/hub/join/receipt.js.map +1 -1
  186. package/dist/hub/join/service.d.ts +94 -6
  187. package/dist/hub/join/service.js +214 -44
  188. package/dist/hub/join/service.js.map +1 -1
  189. package/dist/hub/join/store.d.ts +2 -1
  190. package/dist/hub/join/store.js +7 -7
  191. package/dist/hub/join/store.js.map +1 -1
  192. package/dist/hub/member/exposure-api.d.ts +2 -0
  193. package/dist/hub/member/exposure-api.js +3 -2
  194. package/dist/hub/member/exposure-api.js.map +1 -1
  195. package/dist/hub/member/exposures.d.ts +4 -0
  196. package/dist/hub/member/exposures.js +12 -2
  197. package/dist/hub/member/exposures.js.map +1 -1
  198. package/dist/hub/member/pairing-api.js +4 -1
  199. package/dist/hub/member/pairing-api.js.map +1 -1
  200. package/dist/hub/member/pairing-notices.js +8 -6
  201. package/dist/hub/member/pairing-notices.js.map +1 -1
  202. package/dist/hub/pairing-notices.d.ts +5 -2
  203. package/dist/hub/pairing-notices.js +38 -13
  204. package/dist/hub/pairing-notices.js.map +1 -1
  205. package/dist/hub/pairing.d.ts +10 -2
  206. package/dist/hub/pairing.js +37 -16
  207. package/dist/hub/pairing.js.map +1 -1
  208. package/dist/hub/policy.d.ts +1 -1
  209. package/dist/hub/policy.js +19 -6
  210. package/dist/hub/policy.js.map +1 -1
  211. package/dist/hub/protocol.d.ts +60 -0
  212. package/dist/hub/protocol.js +9 -2
  213. package/dist/hub/protocol.js.map +1 -1
  214. package/dist/hub/quota.d.ts +2 -1
  215. package/dist/hub/quota.js +2 -2
  216. package/dist/hub/quota.js.map +1 -1
  217. package/dist/hub/roles/authority.d.ts +45 -0
  218. package/dist/hub/roles/authority.js +199 -0
  219. package/dist/hub/roles/authority.js.map +1 -0
  220. package/dist/hub/roles/change.d.ts +18 -0
  221. package/dist/hub/roles/change.js +76 -0
  222. package/dist/hub/roles/change.js.map +1 -0
  223. package/dist/hub/roles/convert.d.ts +11 -0
  224. package/dist/hub/roles/convert.js +27 -0
  225. package/dist/hub/roles/convert.js.map +1 -0
  226. package/dist/hub/roles/cutover-inventory.d.ts +14 -0
  227. package/dist/hub/roles/cutover-inventory.js +42 -0
  228. package/dist/hub/roles/cutover-inventory.js.map +1 -0
  229. package/dist/hub/roles/cutover.d.ts +32 -0
  230. package/dist/hub/roles/cutover.js +184 -0
  231. package/dist/hub/roles/cutover.js.map +1 -0
  232. package/dist/hub/roles/delegation.d.ts +24 -0
  233. package/dist/hub/roles/delegation.js +111 -0
  234. package/dist/hub/roles/delegation.js.map +1 -0
  235. package/dist/hub/roles/evaluate.d.ts +50 -0
  236. package/dist/hub/roles/evaluate.js +96 -0
  237. package/dist/hub/roles/evaluate.js.map +1 -0
  238. package/dist/hub/roles/expiry.d.ts +46 -0
  239. package/dist/hub/roles/expiry.js +180 -0
  240. package/dist/hub/roles/expiry.js.map +1 -0
  241. package/dist/hub/roles/mode-effects.d.ts +5 -0
  242. package/dist/hub/roles/mode-effects.js +21 -0
  243. package/dist/hub/roles/mode-effects.js.map +1 -0
  244. package/dist/hub/roles/model.d.ts +171 -0
  245. package/dist/hub/roles/model.js +79 -0
  246. package/dist/hub/roles/model.js.map +1 -0
  247. package/dist/hub/roles/read.d.ts +29 -0
  248. package/dist/hub/roles/read.js +47 -0
  249. package/dist/hub/roles/read.js.map +1 -0
  250. package/dist/hub/roles/writer.d.ts +80 -0
  251. package/dist/hub/roles/writer.js +427 -0
  252. package/dist/hub/roles/writer.js.map +1 -0
  253. package/dist/hub/rooms.d.ts +8 -0
  254. package/dist/hub/rooms.js +47 -27
  255. package/dist/hub/rooms.js.map +1 -1
  256. package/dist/hub/server.d.ts +3 -0
  257. package/dist/hub/server.js +18 -2
  258. package/dist/hub/server.js.map +1 -1
  259. package/dist/hub/sessions.js +5 -1
  260. package/dist/hub/sessions.js.map +1 -1
  261. package/dist/hub/settings-directory-decision.d.ts +2 -2
  262. package/dist/hub/settings-directory-decision.js +7 -5
  263. package/dist/hub/settings-directory-decision.js.map +1 -1
  264. package/dist/hub/settings-directory-proof.js +3 -1
  265. package/dist/hub/settings-directory-proof.js.map +1 -1
  266. package/dist/hub/settings-directory-recovery.js +3 -3
  267. package/dist/hub/settings-directory-recovery.js.map +1 -1
  268. package/dist/hub/sharing.d.ts +10 -0
  269. package/dist/hub/sharing.js +74 -0
  270. package/dist/hub/sharing.js.map +1 -0
  271. package/dist/hub/store.js +6 -2
  272. package/dist/hub/store.js.map +1 -1
  273. package/dist/hub/types.d.ts +29 -5
  274. package/dist/hub/web-origin.d.ts +80 -0
  275. package/dist/hub/web-origin.js +163 -0
  276. package/dist/hub/web-origin.js.map +1 -0
  277. package/dist/hub-pairing-summary.js +1 -1
  278. package/dist/hub-pairing-summary.js.map +1 -1
  279. package/dist/human-delivery-receipts.js +2 -2
  280. package/dist/human-delivery-receipts.js.map +1 -1
  281. package/dist/instance-config-impact.js +4 -0
  282. package/dist/instance-config-impact.js.map +1 -1
  283. package/dist/instance-lifecycle.d.ts +13 -1
  284. package/dist/instance-lifecycle.js +36 -10
  285. package/dist/instance-lifecycle.js.map +1 -1
  286. package/dist/instructions.d.ts +8 -2
  287. package/dist/instructions.js +28 -6
  288. package/dist/instructions.js.map +1 -1
  289. package/dist/locale.js +12 -8
  290. package/dist/locale.js.map +1 -1
  291. package/dist/log-service.d.ts +62 -6
  292. package/dist/log-service.js +135 -28
  293. package/dist/log-service.js.map +1 -1
  294. package/dist/log-steps-agy-grok.d.ts +74 -0
  295. package/dist/log-steps-agy-grok.js +440 -0
  296. package/dist/log-steps-agy-grok.js.map +1 -0
  297. package/dist/log-steps.d.ts +62 -3
  298. package/dist/log-steps.js +188 -22
  299. package/dist/log-steps.js.map +1 -1
  300. package/dist/log-transcript-paths.d.ts +29 -0
  301. package/dist/log-transcript-paths.js +109 -0
  302. package/dist/log-transcript-paths.js.map +1 -0
  303. package/dist/login-controller.d.ts +17 -3
  304. package/dist/login-controller.js +57 -5
  305. package/dist/login-controller.js.map +1 -1
  306. package/dist/login-flows.d.ts +24 -2
  307. package/dist/login-flows.js +53 -22
  308. package/dist/login-flows.js.map +1 -1
  309. package/dist/login-url.js +3 -0
  310. package/dist/login-url.js.map +1 -1
  311. package/dist/login-window-lock.d.ts +20 -8
  312. package/dist/login-window-lock.js +35 -16
  313. package/dist/login-window-lock.js.map +1 -1
  314. package/dist/machine-accounts.d.ts +42 -12
  315. package/dist/machine-accounts.js +144 -46
  316. package/dist/machine-accounts.js.map +1 -1
  317. package/dist/machine-signins.d.ts +35 -13
  318. package/dist/machine-signins.js +57 -27
  319. package/dist/machine-signins.js.map +1 -1
  320. package/dist/native-instance-input.js +4 -4
  321. package/dist/native-instance-input.js.map +1 -1
  322. package/dist/native-instance-registry.d.ts +3 -3
  323. package/dist/native-instance-registry.js +11 -10
  324. package/dist/native-instance-registry.js.map +1 -1
  325. package/dist/outbound-handlers.d.ts +14 -0
  326. package/dist/outbound-handlers.js +68 -20
  327. package/dist/outbound-handlers.js.map +1 -1
  328. package/dist/outbound-schemas.d.ts +18 -0
  329. package/dist/outbound-schemas.js +22 -4
  330. package/dist/outbound-schemas.js.map +1 -1
  331. package/dist/profile-signins.d.ts +7 -0
  332. package/dist/profile-signins.js +2 -1
  333. package/dist/profile-signins.js.map +1 -1
  334. package/dist/runtime-build-info.js +6 -2
  335. package/dist/runtime-build-info.js.map +1 -1
  336. package/dist/runtime-cli.js +33 -11
  337. package/dist/runtime-cli.js.map +1 -1
  338. package/dist/runtime-client.d.ts +18 -2
  339. package/dist/runtime-client.js +84 -21
  340. package/dist/runtime-client.js.map +1 -1
  341. package/dist/runtime-credential-profiles.d.ts +36 -4
  342. package/dist/runtime-credential-profiles.js +82 -16
  343. package/dist/runtime-credential-profiles.js.map +1 -1
  344. package/dist/runtime-profile-ownership.d.ts +2 -2
  345. package/dist/runtime-profile-ownership.js +3 -3
  346. package/dist/runtime-profile-ownership.js.map +1 -1
  347. package/dist/runtime-protocol.d.ts +5 -3
  348. package/dist/runtime-protocol.js +4 -0
  349. package/dist/runtime-protocol.js.map +1 -1
  350. package/dist/runtime-remote-accounts.d.ts +72 -5
  351. package/dist/runtime-remote-accounts.js +293 -52
  352. package/dist/runtime-remote-accounts.js.map +1 -1
  353. package/dist/runtime-remote-setup.d.ts +2 -2
  354. package/dist/runtime-remote-setup.js +2 -2
  355. package/dist/runtime-remote-setup.js.map +1 -1
  356. package/dist/runtime-signin-transport.d.ts +22 -4
  357. package/dist/runtime-signin-transport.js +50 -12
  358. package/dist/runtime-signin-transport.js.map +1 -1
  359. package/dist/runtime-signin.d.ts +42 -0
  360. package/dist/runtime-signin.js +105 -9
  361. package/dist/runtime-signin.js.map +1 -1
  362. package/dist/runtime-windows-bridge.js +6 -1
  363. package/dist/runtime-windows-bridge.js.map +1 -1
  364. package/dist/scheduler/task-board.d.ts +1 -0
  365. package/dist/scheduler/task-board.js +10 -1
  366. package/dist/scheduler/task-board.js.map +1 -1
  367. package/dist/settings-api.d.ts +34 -0
  368. package/dist/settings-api.js +184 -6
  369. package/dist/settings-api.js.map +1 -1
  370. package/dist/settings-change.js +38 -1
  371. package/dist/settings-change.js.map +1 -1
  372. package/dist/settings-effect.js +14 -0
  373. package/dist/settings-effect.js.map +1 -1
  374. package/dist/signin-keepalive.d.ts +31 -2
  375. package/dist/signin-keepalive.js +123 -12
  376. package/dist/signin-keepalive.js.map +1 -1
  377. package/dist/structured-signin-transport.d.ts +2 -2
  378. package/dist/structured-signin-transport.js +27 -6
  379. package/dist/structured-signin-transport.js.map +1 -1
  380. package/dist/structured-signin.d.ts +16 -2
  381. package/dist/structured-signin.js +59 -4
  382. package/dist/structured-signin.js.map +1 -1
  383. package/dist/task-board-tool.d.ts +0 -13
  384. package/dist/task-board-tool.js +42 -6
  385. package/dist/task-board-tool.js.map +1 -1
  386. package/dist/tool-progress.d.ts +7 -0
  387. package/dist/tool-progress.js +21 -9
  388. package/dist/tool-progress.js.map +1 -1
  389. package/dist/tool-receipt-output.d.ts +151 -0
  390. package/dist/tool-receipt-output.js +50 -0
  391. package/dist/tool-receipt-output.js.map +1 -0
  392. package/dist/types.d.ts +13 -0
  393. package/dist/ui/accounts-keepalive.js +15 -6
  394. package/dist/ui/accounts-manage.js +25 -5
  395. package/dist/ui/accounts-view.js +40 -26
  396. package/dist/ui/agent-details-settings.js +2 -2
  397. package/dist/ui/agent-page-strings.js +2 -2
  398. package/dist/ui/agent-proposals.js +22 -2
  399. package/dist/ui/agent-runtime-settings.js +3 -3
  400. package/dist/ui/backend-signin.js +49 -16
  401. package/dist/ui/chat-activity-groups.js +225 -0
  402. package/dist/ui/chat-activity.js +355 -0
  403. package/dist/ui/chat-popout-header.js +35 -0
  404. package/dist/ui/chat-popout-transport.js +80 -0
  405. package/dist/ui/chat-popout.js +63 -0
  406. package/dist/ui/chat-quote.js +3 -1
  407. package/dist/ui/chat-store.js +45 -4
  408. package/dist/ui/chat-workspace-gestures.js +177 -0
  409. package/dist/ui/chat-workspace-navigation.js +34 -10
  410. package/dist/ui/chat-workspace.js +96 -32
  411. package/dist/ui/cli-caps.js +7 -7
  412. package/dist/ui/credential-profile-select.js +32 -19
  413. package/dist/ui/host-install.js +2 -2
  414. package/dist/ui/hub-agent-copy.js +7 -7
  415. package/dist/ui/hub-chat-store.js +8 -4
  416. package/dist/ui/hub-chat-strings.js +3 -3
  417. package/dist/ui/hub-client.js +113 -18
  418. package/dist/ui/hub-company-join-strings.js +12 -10
  419. package/dist/ui/hub-company-join.js +52 -39
  420. package/dist/ui/hub-confirm-place.js +44 -0
  421. package/dist/ui/hub-directory-editor-strings.js +3 -3
  422. package/dist/ui/hub-directory-notice-strings.js +1 -1
  423. package/dist/ui/hub-enrolment-code-strings.js +44 -0
  424. package/dist/ui/hub-enrolment-code.js +159 -0
  425. package/dist/ui/hub-grant-picker.js +100 -0
  426. package/dist/ui/hub-group-search.js +82 -0
  427. package/dist/ui/hub-group-strings.js +8 -8
  428. package/dist/ui/hub-join-approval.js +31 -0
  429. package/dist/ui/hub-join-code-input.js +66 -0
  430. package/dist/ui/hub-join-one-strings.js +2 -2
  431. package/dist/ui/hub-join-queue.js +62 -0
  432. package/dist/ui/hub-join-steps.js +234 -0
  433. package/dist/ui/hub-joincode-flow-strings.js +22 -0
  434. package/dist/ui/hub-owner-strings.js +9 -9
  435. package/dist/ui/hub-pairing-progress-strings.js +1 -1
  436. package/dist/ui/hub-quick-pairing.js +8 -4
  437. package/dist/ui/hub-quick-strings.js +11 -11
  438. package/dist/ui/hub-share-refused.js +17 -0
  439. package/dist/ui/hub-strings.js +61 -61
  440. package/dist/ui/hub-this-hub.js +2 -2
  441. package/dist/ui/hub-welcome.js +26 -5
  442. package/dist/ui/image-annotate.js +283 -0
  443. package/dist/ui/image-lightbox.js +26 -6
  444. package/dist/ui/log-row.js +327 -0
  445. package/dist/ui/machine-signin.js +47 -14
  446. package/dist/ui/panel-chat.js +151 -12
  447. package/dist/ui/panel-details.js +14 -6
  448. package/dist/ui/panel-fleet.js +2 -2
  449. package/dist/ui/panel-hub.js +94 -21
  450. package/dist/ui/panel-log.js +9 -154
  451. package/dist/ui/panel-settings.js +50 -13
  452. package/dist/ui/search-dialog.js +1 -0
  453. package/dist/ui/settings-access-overview.js +1 -1
  454. package/dist/ui/settings-hub-browser-certificate.js +3 -3
  455. package/dist/ui/settings-hub-company-join.js +42 -30
  456. package/dist/ui/settings-hub-connection.js +8 -5
  457. package/dist/ui/settings-hub-membership.js +3 -3
  458. package/dist/ui/settings-hub-section.js +3 -1
  459. package/dist/ui/settings-hub-setup-strings.js +6 -6
  460. package/dist/ui/settings-hub-setup.js +44 -6
  461. package/dist/ui/settings-hub-web-address.js +233 -0
  462. package/dist/ui/settings-hub.js +41 -10
  463. package/dist/ui/settings-layout.js +6 -4
  464. package/dist/ui/settings-public-session-strings.js +37 -0
  465. package/dist/ui/settings-registry.js +4 -0
  466. package/dist/ui/settings-strings.js +2 -2
  467. package/dist/ui/shared/accounts-keepalive.css +8 -0
  468. package/dist/ui/shared/accounts-usage-pool.css +10 -0
  469. package/dist/ui/shared/accounts.css +9 -0
  470. package/dist/ui/shared/app-shell.js +16 -10
  471. package/dist/ui/shared/app.css +233 -35
  472. package/dist/ui/shared/app.js +8 -1
  473. package/dist/ui/shared/chat-render.js +11 -2
  474. package/dist/ui/shared/chat-thread.js +20 -3
  475. package/dist/ui/shared/chat-work-bar.css +7 -0
  476. package/dist/ui/shared/chat-workspace-model.js +39 -9
  477. package/dist/ui/shared/hub-grant-picker.css +4 -0
  478. package/dist/ui/shared/hub-owner.css +8 -0
  479. package/dist/ui/shared/hub-sharing.css +4 -0
  480. package/dist/ui/shared/identity-color.js +9 -3
  481. package/dist/ui/shared/image-annotate.css +45 -0
  482. package/dist/ui/shared/instance-nav.js +59 -22
  483. package/dist/ui/shared/pane-geometry.js +29 -0
  484. package/dist/ui/shared/signin.js +2 -2
  485. package/dist/ui/shared/tokens.css +14 -0
  486. package/dist/ui/shared/ui-menu.js +22 -7
  487. package/dist/ui/shared/view-strings.js +2 -2
  488. package/dist/ui/signin.html +1 -1
  489. package/dist/ui/structured-signin.js +29 -9
  490. package/dist/ui/usage-pool.js +76 -0
  491. package/dist/usage/agent-output.d.ts +144 -0
  492. package/dist/usage/agent-output.js +75 -0
  493. package/dist/usage/agent-output.js.map +1 -0
  494. package/dist/usage/provider-alerts.d.ts +6 -0
  495. package/dist/usage/provider-alerts.js +6 -0
  496. package/dist/usage/provider-alerts.js.map +1 -1
  497. package/dist/usage/providers.d.ts +2 -2
  498. package/dist/usage/providers.js +60 -18
  499. package/dist/usage/providers.js.map +1 -1
  500. package/dist/usage/usage-api.d.ts +12 -0
  501. package/dist/usage/usage-api.js +39 -0
  502. package/dist/usage/usage-api.js.map +1 -1
  503. package/dist/web-api.d.ts +3 -0
  504. package/dist/web-api.js +61 -16
  505. package/dist/web-api.js.map +1 -1
  506. package/dist/web-backend-login.d.ts +13 -4
  507. package/dist/web-backend-login.js +7 -4
  508. package/dist/web-backend-login.js.map +1 -1
  509. package/dist/web-chat-history.d.ts +11 -0
  510. package/dist/web-chat-history.js +9 -1
  511. package/dist/web-chat-history.js.map +1 -1
  512. package/dist/web-guest-access.js +2 -2
  513. package/dist/web-guest-access.js.map +1 -1
  514. package/dist/web-session.d.ts +31 -3
  515. package/dist/web-session.js +25 -4
  516. package/dist/web-session.js.map +1 -1
  517. package/dist/web-settings-patch.d.ts +8 -2
  518. package/dist/web-settings-patch.js +22 -10
  519. package/dist/web-settings-patch.js.map +1 -1
  520. package/dist/windows-cli-providers.js +5 -1
  521. package/dist/windows-cli-providers.js.map +1 -1
  522. package/dist/windows-cli-worker.d.ts +33 -1
  523. package/dist/windows-cli-worker.js +150 -10
  524. package/dist/windows-cli-worker.js.map +1 -1
  525. package/dist/windows-cli.d.ts +7 -1
  526. package/dist/windows-cli.js +19 -2
  527. package/dist/windows-cli.js.map +1 -1
  528. package/dist/workflow-templates/default.md +2 -2
  529. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ /** Same company-join request only: one initial approval plus at most eight 2–6s jittered retries.
2
+ * The caller owns current(): invalidate it on session/request/navigation changes. This is presentation orchestration,
3
+ * never an enrollment permit. Each approval still asks the Hub. The immutable outer deadline is never extended.
4
+ */
5
+ export function createJoinApprovalQueue(options) {
6
+ const { requestId, csrf, deadline } = options;
7
+ const approve = options.approve.bind(options), current = options.current?.bind(options) || (() => true);
8
+ const changed = options.onChange?.bind(options) || (() => {}), now = options.now?.bind(options) || (() => Date.now());
9
+ const random = options.random?.bind(options) || (() => Math.random());
10
+ let stopped = false, flight = null;
11
+ const retired = () => ({ ok: false, code: "retired" });
12
+ // A local timer cannot prove nothing was issued. The caller must read the authoritative join projection.
13
+ const timedOut = () => ({ ok: false, code: "unavailable", deadline: true });
14
+ const live = () => { try { return !stopped && current() === true; } catch { return false; } };
15
+ const emit = (event) => { if (live()) { try { changed(event); } catch { /* a renderer's own failure */ } } };
16
+ const finish = (mine, result, phase) => {
17
+ if (flight !== mine) return;
18
+ clearTimeout(mine.retryTimer); clearTimeout(mine.deadlineTimer); mine.abort?.abort(); flight = null;
19
+ if (live()) emit({ phase, attempts: mine.attempts });
20
+ // A synchronous observer may itself retire the page/session.
21
+ mine.resolve(live() ? result : retired());
22
+ };
23
+ const step = async (mine) => {
24
+ if (flight !== mine) return;
25
+ if (!live()) { finish(mine, retired(), "retired"); return; }
26
+ if (now() >= deadline) { finish(mine, timedOut(), "uncertain"); return; }
27
+ mine.attempts++;
28
+ if (mine.attempts === 1) emit({ phase: "approving", attempts: mine.attempts });
29
+ if (!live()) { finish(mine, retired(), "retired"); return; }
30
+ let answer;
31
+ try { answer = await approve(requestId, csrf, mine.abort?.signal); }
32
+ catch { answer = { ok: false, code: "unavailable" }; }
33
+ if (flight !== mine) return;
34
+ if (!live()) { finish(mine, retired(), "retired"); return; }
35
+ if (now() >= deadline) { finish(mine, timedOut(), "uncertain"); return; }
36
+ if (answer?.ok === true) { finish(mine, answer, "done"); return; }
37
+ const busy = answer?.code === "backpressure" && (answer.reason === undefined || answer.reason === "backpressure");
38
+ if (!busy || mine.attempts >= 9) { finish(mine, answer || { ok: false, code: "unavailable" }, "failed"); return; }
39
+ const sample = random(), delay = 2000 + Math.floor((Number.isFinite(sample) ? Math.max(0, Math.min(1, sample)) : 0) * 4000);
40
+ emit({ phase: "queued", attempts: mine.attempts, retryInMs: delay });
41
+ if (!live()) { finish(mine, retired(), "retired"); return; }
42
+ mine.retryTimer = setTimeout(() => { mine.retryTimer = null; void step(mine); }, Math.min(delay, deadline - now()));
43
+ };
44
+ return {
45
+ run() {
46
+ if (!live()) return Promise.resolve(retired());
47
+ if (flight) return flight.promise;
48
+ if (!Number.isFinite(deadline) || typeof requestId !== "string" || !requestId || typeof csrf !== "string" || !csrf)
49
+ return Promise.resolve({ ok: false, code: "unavailable" });
50
+ const mine = { attempts: 0, retryTimer: null, deadlineTimer: null,
51
+ abort: typeof AbortController === "function" ? new AbortController() : null, promise: null, resolve: null };
52
+ mine.promise = new Promise(resolve => { mine.resolve = resolve; }); flight = mine;
53
+ if (now() >= deadline) finish(mine, timedOut(), "uncertain");
54
+ else {
55
+ mine.deadlineTimer = setTimeout(() => finish(mine, timedOut(), "uncertain"), deadline - now());
56
+ void step(mine);
57
+ }
58
+ return mine.promise;
59
+ },
60
+ cancel() { stopped = true; if (flight) finish(flight, retired(), "retired"); },
61
+ };
62
+ }
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Hub UX U2 (spec 1.2 / 2.6): the administrator's 「讓同仁加入」 card — three steps, each done from server state.
3
+ * This module so far holds step 3 and the join-code slot that B2 (Ridge) mounts into; steps 1–2 follow in this PR.
4
+ *
5
+ * Slot contract (agreed with Ridge, hub-b2-mount-contract / hub-b2-create-gate):
6
+ * <div id="hubEnrolmentCodeSlot"> mounts `HubEnrolmentCode` from ./hub-enrolment-code.js, lazily, only when the session
7
+ * advertises "enrolment-code-v1" (an implementation capability, independent of the on/off switch) and the module exports
8
+ * `enrolmentCodeV1 === true`. A missing module, a failed import or a missing flag leaves the slot empty (upgrade skew).
9
+ * Props: { client, enabled, host, onChanged } — `enabled` = step 1 done (code creation needs only company join on; a live
10
+ * code then satisfies step 2), `host` = the display host of step 3's sentence, `onChanged()` after create/revoke so this
11
+ * card reads its steps again. Revoking stays the component's own (it lists retained codes even with creation off).
12
+ */
13
+ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
14
+ import { GroupSearch } from "./hub-group-search.js";
15
+ import { register, t } from "/assets/app-i18n.js";
16
+ import { hubClient } from "./hub-client.js";
17
+ import { navigate } from "/assets/app-nav.js";
18
+ export const joinStepsV1 = true;
19
+ register("hubJoinSteps", {
20
+ en: {
21
+ step3: "Tell colleagues how to join", sentence: "In AgEnD, open Settings → Hub, enter {0}, then sign in with the company account.",
22
+ copy: "Copy these instructions", copied: "Copied", copyFailed: "Copy failed. Select the sentence and copy it.",
23
+ step3Off: "Finish steps 1 and 2 first.", reading: "Checking the saved Hub settings…", readFailed: "Could not refresh the Hub settings. Try again.", retry: "Try again",
24
+ title: "Let colleagues join", lead: "Three steps. Each one is checked against what the Hub has saved.", done: "Done",
25
+ step1: "Let colleagues connect Fleets with their company account", step1Switch: "Allow company-account Fleet connections",
26
+ step2: "Who can join", step2Hint: "Add the AD groups whose members may connect a Fleet, then save.",
27
+ step2Code: "A live join code counts too.", byDn: "Add by distinguished name", dnLabel: "Distinguished name", dnAdd: "Add",
28
+ perPerson: "Each person up to", fleetsUnit: "Fleets", capAsk: "Chat with agents", capPublish: "Share agents", remove: "Remove",
29
+ noGroups: "No group yet.", previewing: "Checking what this changes…", noImpact: "Nobody loses anything.",
30
+ losing: "These people lose an action", suspended: "These are paused when you save", adminLosesChat: "You would no longer be able to chat with agents.",
31
+ save: "Save", saving: "Saving…", saved: "Saved.", conflict: "Someone else changed this. The page now shows the saved version.",
32
+ stale: "The check is out of date. It has been run again; look at it and save again.", failed: "Could not save. Try again.",
33
+ unsupported: "This directory can't list groups for permissions: that needs Active Directory over LDAPS. Check it with “Edit AD connection” on the Administration page, or send individual invitations instead.", repair: "The saved permissions need repair on the Group permissions page.",
34
+ duplicate: "That group is already on the list.", notFound: "No such group.", notSecurity: "That is not a security group.", invalidDn: "That is not a distinguished name.", unknownGroup: "The group could not be checked. Try again.",
35
+ groupsPage: "All group permissions", advanced: "Link with key fingerprint (Advanced)", advancedHint: "Only for a colleague who must check the key fingerprint by hand.",
36
+ exceptions: "Individual invitations", otherWays: "Other ways",
37
+ },
38
+ "zh-TW": {
39
+ step3: "告訴同仁怎麼加入", sentence: "在 AgEnD 的「設定 → Hub」輸入 {0},再用公司帳號登入。",
40
+ copy: "複製這段說明", copied: "已複製", copyFailed: "複製失敗。請選取這段說明再複製。",
41
+ step3Off: "請先完成步驟 1 和 2。", reading: "正在確認 Hub 已儲存的設定…", readFailed: "目前無法更新 Hub 設定,請再試一次。", retry: "再試一次",
42
+ title: "讓同仁加入", lead: "三個步驟,每一步都依 Hub 已儲存的設定判斷是否完成。", done: "已完成",
43
+ step1: "允許同仁用公司帳號連接 Fleet", step1Switch: "允許以公司帳號連接 Fleet",
44
+ step2: "誰可以加入", step2Hint: "加入可以連接 Fleet 的 AD 群組,然後儲存。",
45
+ step2Code: "有效的加入碼也算完成。", byDn: "用辨別名稱新增", dnLabel: "辨別名稱", dnAdd: "新增",
46
+ perPerson: "每人最多", fleetsUnit: "台", capAsk: "和 Agent 對話", capPublish: "分享 Agent", remove: "移除",
47
+ noGroups: "還沒有群組。", previewing: "正在檢查這次變更的影響…", noImpact: "沒有人會失去任何權限。",
48
+ losing: "這些人會失去權限", suspended: "儲存後會暫停這些項目", adminLosesChat: "你將無法再和 Agent 對話。",
49
+ save: "儲存", saving: "儲存中…", saved: "已儲存。", conflict: "有人剛改過這裡。頁面已顯示目前儲存的版本。",
50
+ stale: "檢查結果已過期,已重新檢查。請看過後再儲存一次。", failed: "無法儲存,請再試一次。",
51
+ unsupported: "這個目錄無法列出群組來設定權限:需要 Active Directory 並使用 LDAPS。請在「管理」按「編輯 AD 連線」檢查,或改用個別邀請。", repair: "已儲存的權限需要在「群組權限」頁修復。",
52
+ duplicate: "這個群組已經在清單裡。", notFound: "找不到這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。", unknownGroup: "目前無法確認這個群組,請再試一次。",
53
+ groupsPage: "所有群組權限", advanced: "含金鑰指紋的連結(進階)", advancedHint: "只給需要自己核對金鑰指紋的同仁。",
54
+ exceptions: "個別邀請", otherWays: "其他方式",
55
+ },
56
+ });
57
+ const sw = (key, ...args) => t(`hubJoinSteps.${key}`, ...args);
58
+ /** The web origin as people see it (spec 1.2): no https://, no :443. */
59
+ export function displayHost(webOrigin) {
60
+ try { const u = new URL(String(webOrigin || "")); return u.protocol === "https:" ? u.host.replace(/:443$/, "") : ""; } catch { return ""; }
61
+ }
62
+ /** The one sentence colleagues need (step 3's), for this Hub. */
63
+ export const joinSentence = (webOrigin) => { const host = displayHost(webOrigin); return host ? sw("sentence", host) : ""; };
64
+ export const otherWaysLabel = () => sw("otherWays");
65
+ /** B2's join-code component in its slot, or nothing (see the contract above). */
66
+ // B2 ships the module; until then (and on a Hub that does not serve it) the import fails and the slot stays empty.
67
+ const CODE_MODULE = "./hub-enrolment-code.js";
68
+ const loadCode = () => import(/* @vite-ignore */ CODE_MODULE);
69
+ export function EnrolmentCodeSlot({ features = [], client = hubClient(), enabled = false, host = "", onChanged, load = loadCode } = {}) {
70
+ const offered = Array.isArray(features) && features.includes("enrolment-code-v1");
71
+ const [Code, setCode] = useState(null);
72
+ useEffect(() => {
73
+ let live = true;
74
+ if (offered) Promise.resolve().then(load).then(m => { if (live && m && m.enrolmentCodeV1 === true && typeof m.HubEnrolmentCode === "function") setCode(() => m.HubEnrolmentCode); }, () => {});
75
+ return () => { live = false; };
76
+ }, [offered]);
77
+ return html`<div id="hubEnrolmentCodeSlot">${offered && Code ? html`<${Code} client=${client} enabled=${enabled} host=${host} onChanged=${onChanged} />` : null}</div>`;
78
+ }
79
+ /** Step 3: the one sentence colleagues need, its copy button (only once steps 1 and 2 are done), and the join-code slot. */
80
+ export function JoinStep3({ webOrigin, step1 = false, step2 = false, features = [], client = hubClient(), onChanged, load, pending = false } = {}) {
81
+ const host = displayHost(webOrigin), ready = step1 && step2 && !!host, [copied, setCopied] = useState(null);
82
+ const copy = async () => { try { await navigator.clipboard.writeText(sw("sentence", host)); setCopied("copied"); } catch { setCopied("copyFailed"); } };
83
+ return html`<li class=${ready ? "now" : ""} data-step="3"><div class="hub-step-body"><span><b>${sw("step3")}</b>
84
+ ${ready ? html`<small class="note hub-join-sentence">${sw("sentence", host)}</small>` : html`<small class="note" id="hubJoinStep3Off">${sw(pending ? "reading" : "step3Off")}</small>`}</span>
85
+ <button type="button" class="btn btn-sm" disabled=${!ready} aria-describedby=${ready ? undefined : "hubJoinStep3Off"} onClick=${copy}>${copied === "copied" ? sw("copied") : sw("copy")}</button>
86
+ ${copied === "copyFailed" ? html`<p class="note" role="alert">${sw("copyFailed")}</p>` : null}
87
+ <${EnrolmentCodeSlot} features=${features} client=${client} enabled=${step1} host=${host} onChanged=${onChanged} ...${load ? { load } : {}} />
88
+ </div></li>`;
89
+ }
90
+
91
+ const RESOLVE = { "not-found": "notFound", "not-security-group": "notSecurity", invalid: "invalidDn", unsupported: "unsupported", unknown: "unknownGroup" };
92
+ const CAP_ORDER = ["ask_agents", "publish_agents", "pair_fleet"];
93
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
94
+ /** A group lets its members join: connect is allowed with at least one Fleet each. */
95
+ export const groupLetsJoin = (g) => !!g && Array.isArray(g.allow) && g.allow.includes("pair_fleet") && g.maxFleets >= 1;
96
+ /** Step 2 is done from saved state: the policy is on and a group lets members join — or a join code is live (B2). */
97
+ export function step2Done(policy, codes) {
98
+ return !!policy && policy.state === "enabled" && policy.groups.some(groupLetsJoin) || Array.isArray(codes) && codes.some((c) => c && c.state === "live");
99
+ }
100
+ /** The proposed policy: saved fields, these groups, switched on once it has a group (one 儲存, spec 1.2). */
101
+ export function proposedPolicy(saved, groups) {
102
+ return { ...saved, state: groups.length ? "enabled" : saved.state,
103
+ groups: groups.map((g) => ({ group: { realm: g.group.realm, objectId: g.group.objectId }, dn: g.dn, allow: CAP_ORDER.filter((c) => g.allow.includes(c)), maxFleets: g.maxFleets })) };
104
+ }
105
+
106
+ /** Step 2: who can join — search, chips, each person's Fleet limit and the two other permissions; the server's check; one 儲存. */
107
+ export function JoinStep2({ client = hubClient(), onSaved } = {}) {
108
+ const [view, setView] = useState(null), [groups, setGroups] = useState([]), [preview, setPreview] = useState(null);
109
+ const [msg, setMsg] = useState(null), [saving, setSaving] = useState(false), [dn, setDn] = useState(""), [dnOpen, setDnOpen] = useState(false), [again, setAgain] = useState(0);
110
+ const live = useRef(true), seq = useRef(0);
111
+ useEffect(() => { live.current = true; return () => { live.current = false; }; }, []);
112
+ const load = async () => {
113
+ if (typeof client.groupPolicy !== "function") { setView({ supported: false, binding: "ready", policy: null }); return; } // an older client
114
+ let r; try { r = await client.groupPolicy(); } catch { r = { ok: false }; }
115
+ if (!live.current) return;
116
+ if (!r.ok) { setView(old => ({ ...old, failed: true })); return; }
117
+ setView(r); setGroups(r.policy ? r.policy.groups.map((g) => ({ ...g, allow: [...g.allow] })) : []); setPreview(null);
118
+ };
119
+ useEffect(() => { void load(); }, []);
120
+ const policy = view && view.policy, editable = !!policy && view.supported === true && view.binding === "ready";
121
+ const draft = policy ? proposedPolicy(policy, groups) : null, changed = !!draft && !same(draft, proposedPolicy(policy, policy.groups)) || !!policy && !!groups.length && policy.state !== "enabled";
122
+ useEffect(() => {
123
+ if (!editable || !changed) { setPreview(null); return undefined; }
124
+ const mine = ++seq.current; setPreview({ loading: true });
125
+ const timer = setTimeout(async () => {
126
+ const r = await client.previewGroupPolicy(draft);
127
+ if (live.current && mine === seq.current) setPreview(r.ok ? { ok: true, ...r } : { ok: false, code: r.code });
128
+ }, 400);
129
+ return () => clearTimeout(timer);
130
+ }, [editable, JSON.stringify(draft), changed, again]);
131
+ const addResolved = async (text) => {
132
+ setMsg(null);
133
+ const r = await client.resolveGroup(text);
134
+ if (!live.current) return false;
135
+ if (!r.ok || r.reason) { setMsg({ err: true, text: sw(r.ok ? RESOLVE[r.reason] || "unknownGroup" : r.code === "unsupported" ? "unsupported" : "unknownGroup") }); return false; }
136
+ if (groups.some((g) => g.group.objectId === r.objectId)) { setMsg({ err: true, text: sw("duplicate") }); return false; }
137
+ // In this card a group is added to let its members join: chat and connect, one Fleet each (the admin can change both).
138
+ setGroups((gs) => [...gs, { group: { realm: r.realm, objectId: r.objectId }, dn: r.dn, allow: ["ask_agents", "pair_fleet"], maxFleets: 1 }]);
139
+ return true;
140
+ };
141
+ const setCap = (i, cap, on) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, allow: on ? [...new Set([...g.allow, cap])] : g.allow.filter((x) => x !== cap) }));
142
+ const setFleets = (i, n) => setGroups(groups.map((g, j) => { if (j !== i) return g; const m = Math.max(0, Math.min(8, Math.floor(Number(n)) || 0));
143
+ return { ...g, maxFleets: m, allow: m > 0 ? [...new Set([...g.allow, "pair_fleet"])] : g.allow.filter((x) => x !== "pair_fleet") }; }));
144
+ const save = async () => {
145
+ if (!preview || !preview.ok || saving) return;
146
+ setSaving(true); setMsg(null);
147
+ const r = await client.saveGroupPolicy(draft, preview.previewDigest);
148
+ if (!live.current) return;
149
+ setSaving(false);
150
+ if (r.ok) { setMsg({ text: sw("saved") }); await load(); onSaved?.(); return; }
151
+ setMsg({ err: true, text: sw(r.code === "conflict" ? "conflict" : r.code === "stale-preview" || r.code === "expired" ? "stale" : "failed") });
152
+ if (r.code === "conflict") await load(); else if (r.code === "stale-preview" || r.code === "expired") setAgain((n) => n + 1);
153
+ };
154
+ if (!view) return html`<p class="note" aria-busy="true">${sw("previewing")}</p>`;
155
+ if (view.failed) return html`<div class="hub-join-read-status"><p class="note" role="status">${sw("readFailed")}</p><button type="button" class="btn" onClick=${load}>${sw("retry")}</button></div>`;
156
+ const pv = preview && preview.ok ? preview.impact || {} : null;
157
+ return html`<div class="hub-join-step2">
158
+ ${view.supported !== true ? html`<p class="note" role="status">${sw("unsupported")}</p>` : null}
159
+ ${view.binding === "repair-required" ? html`<p class="err" role="alert">${sw("repair")}</p>` : null}
160
+ ${editable ? html`<${GroupSearch} client=${client} exclude=${groups.map((g) => g.group.objectId)} onPick=${(hit) => addResolved(hit.dn)} onUnsupported=${() => setDnOpen(true)} />` : null}
161
+ ${groups.length ? html`<ul class="hub-join-groups" role="list">${groups.map((g, i) => html`<li key=${g.group.objectId} class="s-row hub-row" data-group=${g.group.objectId}>
162
+ <span class="hub-row-text"><strong>${(/^CN=([^,]+)/i.exec(g.dn) || [0, g.dn])[1]}</strong><small class="note"><code>${g.dn}</code></small></span>
163
+ <label class="field hub-join-fleets"><span>${sw("perPerson")}</span><input type="number" min="0" max="8" value=${String(g.maxFleets)} disabled=${!editable} onInput=${(e) => setFleets(i, e.target.value)} /><span>${sw("fleetsUnit")}</span></label>
164
+ <label class="check"><input type="checkbox" checked=${g.allow.includes("ask_agents")} disabled=${!editable} onChange=${(e) => setCap(i, "ask_agents", e.target.checked)} /> ${sw("capAsk")}</label>
165
+ <label class="check"><input type="checkbox" checked=${g.allow.includes("publish_agents")} disabled=${!editable} onChange=${(e) => setCap(i, "publish_agents", e.target.checked)} /> ${sw("capPublish")}</label>
166
+ ${editable ? html`<button type="button" class="btn btn-sm btn-ghost" onClick=${() => setGroups(groups.filter((_, j) => j !== i))}>${sw("remove")}</button>` : null}</li>`)}</ul>`
167
+ : html`<p class="note">${sw("noGroups")}</p>`}
168
+ ${editable ? html`<details class="s-ui-disclosure hub-join-bydn" open=${dnOpen} onToggle=${(e) => setDnOpen(e.target.open)}><summary>${sw("byDn")}</summary>
169
+ <form class="hub-step-form" onSubmit=${async (e) => { e.preventDefault(); if (dn.trim() && await addResolved(dn.trim())) setDn(""); }}>
170
+ <label class="field"><span>${sw("dnLabel")}</span><input value=${dn} autocomplete="off" spellcheck=${false} onInput=${(e) => setDn(e.target.value)} /></label>
171
+ <button type="submit" class="btn btn-sm" disabled=${!dn.trim()}>${sw("dnAdd")}</button></form></details>` : null}
172
+ ${msg ? html`<p class=${msg.err ? "err" : "note"} role=${msg.err ? "alert" : "status"}>${msg.text}</p>` : null}
173
+ ${changed && editable ? html`<div class="hub-join-preview" aria-live="polite">${!preview || preview.loading ? html`<p class="note" aria-busy="true">${sw("previewing")}</p>`
174
+ : !preview.ok ? html`<p class="note" role="status">${sw(preview.code === "conflict" ? "conflict" : "failed")}</p>`
175
+ : html`${pv.adminLosesChat ? html`<p class="err" role="alert">${sw("adminLosesChat")}</p>` : null}
176
+ ${(pv.losingActions || []).length ? html`<p class="note"><b>${sw("losing")}</b>: ${pv.losingActions.map((r) => r.name || r.login || r.personId).join(", ")}</p>` : null}
177
+ ${(pv.suspendedOnSave || []).length ? html`<p class="note"><b>${sw("suspended")}</b>: ${pv.suspendedOnSave.map((r) => r.label || r.id).join(", ")}</p>` : null}
178
+ ${!(pv.losingActions || []).length && !(pv.suspendedOnSave || []).length && !pv.adminLosesChat ? html`<p class="note">${sw("noImpact")}</p>` : null}
179
+ <div class="field-row"><button type="button" class="btn btn-primary" disabled=${saving} onClick=${save}>${saving ? sw("saving") : sw("save")}</button></div>`}</div>` : null}
180
+ </div>`;
181
+ }
182
+
183
+ /**
184
+ * The card (spec 1.2): first on Administration. Step 1 is the existing switch (its state and writes stay the caller's);
185
+ * step 2 is done from the saved policy or a live join code, read here again whenever step 2 or B2's slot changes something;
186
+ * step 3 waits for both. `groups`: the session offers group permissions (else step 2 cannot be edited here).
187
+ */
188
+ export function HubJoinCard({ view, busy = false, error = null, onToggle, onRetry, groups = false, features = [], client = hubClient(), webOrigin, children } = {}) {
189
+ const [policy, setPolicy] = useState(null), [codes, setCodes] = useState(null), [tick, setTick] = useState(0);
190
+ const [reading, setReading] = useState(true), [readError, setReadError] = useState(false);
191
+ useEffect(() => {
192
+ let live = true;
193
+ const off = client.onSignedOut?.(() => { live = false; setPolicy(null); setCodes(null); setReading(false); setReadError(true); });
194
+ setReading(true); setReadError(false);
195
+ const read = async () => {
196
+ let failed = false;
197
+ // These also work with a retained client that has no shared read queue.
198
+ for (const [enabled, method, save] of [[groups, "groupPolicy", setPolicy], [true, "enrolmentCodes", setCodes]]) {
199
+ if (!live) return;
200
+ if (!enabled || typeof client[method] !== "function") continue;
201
+ let r; try { r = await client[method](); } catch { r = { ok: false }; }
202
+ if (!live) return;
203
+ if (r?.ok) save(method === "groupPolicy" ? r.policy : Array.isArray(r.codes) ? r.codes : null);
204
+ else { failed = true; if (r?.code !== "backpressure" && r?.timedOut !== true) save(null); }
205
+ }
206
+ if (live) { setReadError(failed); setReading(false); }
207
+ };
208
+ void read();
209
+ return () => { live = false; off?.(); };
210
+ }, [client, groups, tick]);
211
+ const changed = () => setTick((n) => n + 1);
212
+ const s1 = !!view && view.enabled === true, s2 = step2Done(policy, codes);
213
+ const origin = webOrigin || (typeof location !== "undefined" ? location.origin : "");
214
+ const mark = (done) => done ? html` <span class="tag ok">${sw("done")}</span>` : null;
215
+ return html`<section class="card hub-company-join hub-join-card" data-entry="let-colleagues-join"><h3>${sw("title")}</h3>
216
+ <p class="note">${sw("lead")}</p>
217
+ ${error ? html`<p class="err" role="alert">${error}${onRetry ? html` <button type="button" class="btn btn-sm btn-ghost" onClick=${onRetry}>${sw("retry")}</button>` : null}</p>` : null}
218
+ ${reading || readError ? html`<div class="hub-join-read-status"><p class="note" role="status" aria-busy=${reading}>${sw(reading ? "reading" : "readFailed")}</p>
219
+ ${readError ? html`<button type="button" class="btn" onClick=${changed}>${sw("retry")}</button>` : null}</div>` : null}
220
+ <ol class="hub-steps hub-join-steps">
221
+ <li class=${s1 ? "done" : "now"} data-step="1"><div class="hub-step-body"><span><b>${sw("step1")}${mark(s1)}</b></span>
222
+ ${view ? html`<label class="check"><input type="checkbox" role="switch" class="s-ui-toggle" checked=${view.enabled} disabled=${busy || !!error} onChange=${(e) => onToggle?.(e.target.checked)} /><span>${sw("step1Switch")}</span></label>` : null}</div></li>
223
+ <li class=${s2 ? "done" : s1 ? "now" : ""} data-step="2"><div class="hub-step-body"><span><b>${sw("step2")}${mark(s2)}</b><small class="note">${sw("step2Hint")} ${features.includes("enrolment-code-v1") ? sw("step2Code") : ""}</small></span>
224
+ ${groups ? html`<${JoinStep2} client=${client} onSaved=${changed} />
225
+ <div class="field-row hub-join-groups-link"><a class="btn btn-sm" href="/ui/hub/admin?view=groups"
226
+ onClick=${(e) => { e.preventDefault(); navigate("/ui/hub/admin?view=groups"); }}>${sw("groupsPage")}</a></div>` : html`<p class="note" role="status">${sw("unsupported")}</p>`}</div></li>
227
+ <${JoinStep3} webOrigin=${origin} step1=${s1} step2=${s2} features=${features} client=${client} onChanged=${changed} pending=${!view || reading || readError} />
228
+ </ol>
229
+ ${view && view.enabled && view.companyLink ? html`<details class="s-ui-disclosure hub-join-advanced"><summary>${sw("advanced")}</summary><div class="s-disclosure-body"><p class="note">${sw("advancedHint")}</p>
230
+ <label class="field"><span>${sw("advanced")}</span><textarea rows="4" readonly value=${view.companyLink} /></label></div></details>` : null}
231
+ ${children}
232
+ </section>`;
233
+ }
234
+
@@ -0,0 +1,22 @@
1
+ /** New flow copy stays with the fresh modules even when a tab holds the older B2 dictionary. */
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ import { he } from "./hub-enrolment-code-strings.js";
4
+ register("joinCodeFlow", {
5
+ en: {
6
+ liveLimit: "At most 8 join codes can be live. End one before creating another.",
7
+ hourlyLimit: "At most 10 join codes can be created in one hour. Try again later.",
8
+ endTitle: "End this join code?", endConfirm: "This code cannot be used again.",
9
+ endPending: "{0} Fleet connections in progress will stop.", endNames: "Including these Fleets:", endOthers: "And {0} others.",
10
+ endUnchanged: "Fleets already connected are unchanged.", queuedProgress: "Waiting in the queue… Retry {0} of 8.",
11
+ },
12
+ "zh-TW": {
13
+ liveLimit: "最多 8 組有效的加入碼,請先停用一組,再建立新的加入碼。",
14
+ hourlyLimit: "一小時內最多建立 10 組加入碼,請晚點再試。",
15
+ endTitle: "停用這組加入碼?", endConfirm: "這組加入碼將無法再使用。",
16
+ endPending: "正在連接的 {0} 台 Fleet 將中斷。", endNames: "包含以下 Fleet:", endOthers: "以及另外 {0} 台。",
17
+ endUnchanged: "已連接的 Fleet 不受影響。", queuedProgress: "正在排隊…第 {0} 次重試,共 8 次。",
18
+ },
19
+ });
20
+ export const jf = (key, ...args) => t(`joinCodeFlow.${key}`, ...args);
21
+ /** An older hook has no attempt counter: retain the truthful generic queue message. */
22
+ export const queueMessage = attempt => Number.isInteger(attempt) && attempt >= 1 && attempt <= 8 ? jf("queuedProgress", attempt) : he("queued");
@@ -14,30 +14,30 @@ register("hubOwner", {
14
14
  approvedTag: "Approved", backToMine: "My shared agents", codeFor: "Pairing code for {0}", codeUnusedYet: "Not used yet", fleetOf: "{0}'s fleet",
15
15
  makeCode: "Create pairing code", mayAsk: "{0} may ask", mayAskNone: "No one may ask yet", mayAskOne: "1 may ask",
16
16
  mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Hub.", mineLeadShort: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately.",
17
- noFleets: "No fleet is paired yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
18
- pairedFleets: "Paired fleets · {0}", pauseGo: "Pause…", pauseLead: "No one can ask it until it is shared again. What was asked stays readable.",
19
- pauseTitle: "Pause questions", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
17
+ noFleets: "No fleet is connected yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
18
+ pairedFleets: "Connected fleets · {0}", pauseGo: "Stop sharing…", pauseLead: "No one can ask it any more. To share it again, it has to be shared again from its fleet, and everyone has to be allowed to ask again. What was asked stays readable.",
19
+ pauseTitle: "Stop sharing", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
20
20
  pendingPairings: "Pairings waiting for you", recent: "Recent questions",
21
21
  recentLead: "Who asked and when, and whether it was answered. What they asked stays in your fleet's chat.", recentNone: "No one has asked yet.",
22
22
  refresh: "Refresh", revokeItem: "Revoke…", revokedTag: "Revoked", rowMenu: "More for {0}", scopeHub: "This Hub", scopeYou: "Yours",
23
- sharedCount: "Shared · {0}", stageAnswered: "Answered", stageNot: "Not answered", stageWaiting: "Waiting", statePaused: "Paused",
23
+ sharedCount: "Shared · {0}", stageAnswered: "Answered", stageNot: "Not answered", stageWaiting: "Waiting", statePaused: "Sharing stopped on the Hub",
24
24
  stateShared: "Shared", stateWithdrawn: "Withdrawn", stepApprove: "You approve", stepApproveHint: "Check the same fingerprint, then approve.",
25
25
  stepCode: "Make a pairing code", stepCodeHint: "For the fleet's owner: they type it in their fleet within 10 minutes; it works once.",
26
26
  stepOwner: "The owner checks the fingerprint", stepOwnerHint: "In their fleet, then on this Hub under My shared agents.",
27
27
  untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
28
28
  },
29
29
  "zh-TW": {
30
- memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub → 連線到 Hub」的「Hub 位址」欄位貼上這個位址,並輸入配對碼。這與 Hub 的瀏覽器位址不同。",
30
+ memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub → 其他方式」的「Hub 位址」欄位貼上這個位址,並輸入配對碼。這與 Hub 的瀏覽器位址不同。",
31
31
  memberAddressMissing: "請向管理員索取要填入「Hub 位址」欄位的位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
32
32
  active: "使用中", adminLead: "管理允許連接的人員與已連接的 Fleet。這裡看不到任何人的對話。", manualAdvanced: "進階:使用配對碼連接", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
33
33
  allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
34
34
  codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 Fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
35
- mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 Fleet 的「設定 → Hub」。", mineLeadShort: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。", noFleets: "還沒有配對的 Fleet。",
36
- ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 Fleet", pairedFleets: "已配對的 Fleet · {0}", pauseGo: "暫停…",
37
- pauseLead: "重新分享之前,沒有人能再提問。已經問過的內容仍然看得到。", pauseTitle: "暫停提問", pendingLead: "確認這個指紋和你 Fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
35
+ mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 Fleet 的「設定 → Hub」。", mineLeadShort: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。", noFleets: "還沒有已連接的 Fleet。",
36
+ ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 Fleet", pairedFleets: "已連接的 Fleet · {0}", pauseGo: "停止分享…",
37
+ pauseLead: "之後沒有人能再向它提問。要再分享,必須回到它的 Fleet 重新分享,而且每個人都要重新允許提問。已經問過的內容仍然看得到。", pauseTitle: "停止分享", pendingLead: "確認這個指紋和你 Fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
38
38
  recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 Fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
39
39
  rowMenu: "{0} 的更多動作", scopeHub: "這個 Hub", scopeYou: "你的", sharedCount: "分享中 · {0}", stageAnswered: "已回答", stageNot: "未回答", stageWaiting: "等待中",
40
- statePaused: "已暫停", stateShared: "分享中", stateWithdrawn: "已停止分享", stepApprove: "你核准", stepApproveHint: "核對同一個指紋後核准。", stepCode: "產生配對碼",
40
+ statePaused: "已在 Hub 停止分享", stateShared: "分享中", stateWithdrawn: "已停止分享", stepApprove: "你核准", stepApproveHint: "核對同一個指紋後核准。", stepCode: "產生配對碼",
41
41
  stepCodeHint: "給 Fleet 的擁有者:10 分鐘內在他的 Fleet 輸入,只能用一次。", stepOwner: "擁有者核對指紋", stepOwnerHint: "在他的 Fleet 上,然後在這個 Hub 的「我分享的 Agent」確認。",
42
42
  untilLeft: "到 {0}({1})", waitingOwner: "等待擁有者", whoMayAsk: "可以提問的人",
43
43
  },
@@ -7,7 +7,7 @@ register("hubPairingProgress", {
7
7
  unknown: "The result cannot be checked right now. Review the pairing status and the confirmation card before trying again.",
8
8
  },
9
9
  "zh-TW": {
10
- connectFailed: "配對未完成。請在 Hub 重新開始配對,再將新的手動配對碼填在這裡。",
10
+ connectFailed: "配對未完成。請在 Hub 重新開始配對,再將新的配對碼填在這裡。",
11
11
  notApplied: "這次要求未套用。請先查看上方的配對狀態,再決定是否重試。",
12
12
  unknown: "目前無法確認結果。請先查看配對狀態與確認卡片,再決定是否重試。",
13
13
  },
@@ -1,4 +1,5 @@
1
1
  import { hj } from "./hub-company-join-strings.js";
2
+ import { he } from "./hub-enrolment-code-strings.js";
2
3
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
4
  import { ErrorState, Skeleton } from "/assets/ui-states.js";
4
5
  import { confirmDialog } from "/assets/ui-confirm.js";
@@ -7,6 +8,8 @@ import { compareGroups, hubClient, safeWebOrigin } from "./hub-client.js";
7
8
  import { hq } from "./hub-quick-strings.js";
8
9
  import { hr } from "./hub-read-strings.js";
9
10
  import { linkHubOwnerCss } from "./hub-owner-strings.js";
11
+ /** A member Settings reader opts into code rows only alongside this renderer. */
12
+ export const pairingNoticesV3 = true;
10
13
 
11
14
  const reason = (r) => hq(r.code === "expired" ? "expired" : r.code === "conflict" ? "conflict" : r.code === "backpressure" ? "limit"
12
15
  : r.code === "denied" || r.code === "revoked" ? "denied" : r.code === "unavailable" || r.code === "unreachable" ? "unavailable" : "failed");
@@ -102,7 +105,7 @@ function Notice({ notice, admin = false, memberOrigin = null, after = () => {} }
102
105
  };
103
106
  let href = null;
104
107
  if (memberOrigin) { try { const origin = new URL(memberOrigin); if (origin.protocol === "https:") href = `${origin.origin}/ui/hub?securityNotice=${encodeURIComponent(notice.id)}`; } catch { /* no link */ } }
105
- return html`<div data-pairing-notice=${notice.id}><p><b>${hq("notice", notice.label)}</b></p><p class="note">${notice.source === "manual" ? hj("manualApproved") : hq("approved")} ${time(notice.at)}</p>
108
+ return html`<div data-pairing-notice=${notice.id}><p><b>${hq("notice", notice.label)}</b></p><p class="note">${notice.source === "code" ? he("byCode") : notice.source === "manual" ? hj("manualApproved") : hq("approved")} ${time(notice.at)}</p>
106
109
  <p class="note">${hq("fleetId")} <code class="hub-fp-full">${notice.fleetId}</code></p>
107
110
  <p class="note">${hq("revokeHint")}</p>
108
111
  ${notice.revoked ? html`<span class="tag">${hq("revoked")}</span>` : href ? html`<a class="btn" target="_blank" rel="noopener noreferrer" href=${href}>${hq("review")}</a>`
@@ -133,7 +136,7 @@ export function PairingNotices({ admin = false, memberNotices = null, memberOrig
133
136
  const [historyOpen, setHistoryOpen] = useState(false), [historyCount, setHistoryCount] = useState(99);
134
137
  const load = async () => {
135
138
  const mine = epoch.current;
136
- let r; try { r = await c.pairingNotices(); } catch { r = { ok: false, code: "unreachable" }; }
139
+ let r; try { r = await (c.pairingNoticesV3 === true ? c.pairingNotices(3) : c.pairingNotices()); } catch { r = { ok: false, code: "unreachable" }; }
137
140
  if (live.current && mine === epoch.current) {
138
141
  if (r.ok) { setNotices(r.notices || []); setNoticeError(null); }
139
142
  else { setNotices([]); setNoticeError(r.code === "backpressure" ? "busy" : "noticesUnavailable"); }
@@ -160,8 +163,9 @@ export function PairingNotices({ admin = false, memberNotices = null, memberOrig
160
163
  };
161
164
  const subscribe = () => {
162
165
  if (!current()) return;
163
- off(); off = c.subscribePairingNotices(rows => { if (current()) { setNotices(rows); setNoticeError(null); } },
164
- () => { if (current()) { setNoticeError("noticesRetry"); void recover(); } });
166
+ const receive = rows => { if (current()) { setNotices(rows); setNoticeError(null); } },
167
+ closed = () => { if (current()) { setNoticeError("noticesRetry"); void recover(); } };
168
+ off(); off = c.pairingNoticesV3 === true ? c.subscribePairingNotices(receive, closed, 3) : c.subscribePairingNotices(receive, closed);
165
169
  };
166
170
  if (c.pairingNoticeSnapshotV1 === true) subscribe();
167
171
  else void load().then(r => { if (current()) { if (r.ok) subscribe(); else later(recover, r); } });
@@ -2,19 +2,19 @@
2
2
  import { register, t } from "/assets/app-i18n.js";
3
3
  register("hubQuick", {
4
4
  en: {
5
- start: "Connect my fleet", label: "Fleet name", labelHint: "A name you and your Hub admin will recognise.",
6
- labelExample: "For example, my laptop", privacy: "Connect only a fleet you control. Your other Hub sessions, connected fleets and Hub admin will be notified.",
5
+ start: "Connect my fleet", label: "Fleet name", labelHint: "A name you and your Hub administrator will recognize.",
6
+ labelExample: "For example, my laptop", privacy: "Connect only a fleet you control. Your other Hub sessions, connected fleets and Hub administrator will be notified.",
7
7
  localTitle: "Confirm on your fleet", local: "On your fleet's web page, open Settings → Hub. Turn on Allow this fleet to connect to a Hub, then paste this address into the Hub address field and enter the one-time code. Confirm the local prompt there.",
8
8
  remoteSteps: "Finish the fingerprint check on the Hub too.", ownerStep: "On the Hub, compare this fingerprint and confirm your pairing.", policyStep: "The Hub checks its group policy, or waits for its administrator's approval.",
9
9
  address: "Hub address", code: "One-time code", copy: "Copy", copied: "Copied", expires: "Expires {0}",
10
10
  compareTitle: "Compare the fingerprints", compare: "On your fleet, open Settings → Hub → Waiting for approval. Compare its fingerprint with this one. Confirm locally on your fleet too.",
11
11
  match: "They match", mismatch: "They differ", mismatchStop: "The fingerprints differ. Pairing is stopped; no connection was approved. Start again only after checking the address.",
12
- stop: "Stop pairing", stopped: "Pairing stopped", again: "Start again", waiting: "Waiting for your fleet's code and local confirmation…",
12
+ stop: "Stop pairing", stopped: "Pairing stopped", again: "Start again", waiting: "Waiting for your fleet's code and your confirmation…",
13
13
  another: "Connect another fleet",
14
14
  claim: "Waiting for your fleet's pinned connection…", connected: "Connected", publish: "Share agents on your fleet", publishHint: "On your fleet, open Settings → Hub → Shared agents. Choose only the agents you want to share and confirm there. Nothing is shared automatically.",
15
- publishNo: "Your fleet is connected. Sharing new agents is not included in your current permissions; contact your Hub admin.",
15
+ publishNo: "Your fleet is connected. Sharing new agents is not included in your current permissions; contact your Hub administrator.",
16
16
  expired: "This attempt expired or was replaced. It cannot connect a fleet. Start again.", unavailable: "Permissions or the connection can't be checked right now. Retry; this page can't confirm whether pairing finished.",
17
- denied: "Connecting a fleet is not available to you. Contact your Hub admin.", conflict: "An administrator's pairing code is already waiting for you. Use that code, or ask the admin for help.",
17
+ denied: "Connecting a fleet is not available to you. Contact your Hub administrator.", conflict: "An administrator's pairing code is already waiting for you. Use that code, or ask the admin for help.",
18
18
  limit: "Your fleet or pairing limit is reached. Stop an unused attempt or revoke a fleet you no longer use, then try again.", retry: "Retry", failed: "This action could not finish. Retry.",
19
19
  notices: "Fleet security notices", notice: "A new fleet was connected: {0}", approved: "Approved by your Hub's group policy.",
20
20
  revoke: "Revoke this fleet", revokeAsk: "Revoke {0}? It loses its Hub access at once. Your other fleets and local agent work stay in place.", revoked: "Revoked", revokeHint: "Stops this fleet's Hub access. Your other fleets and local agent work stay in place.",
@@ -23,17 +23,17 @@ register("hubQuick", {
23
23
  "zh-TW": {
24
24
  start: "連接我的 Fleet", label: "Fleet 名稱", labelHint: "取一個你和 Hub 管理員都認得的名字。", labelExample: "例如:我的筆電",
25
25
  privacy: "只連接你能控制的 Fleet。你的其他 Hub 登入工作階段、已連接的 Fleet 和 Hub 管理員都會收到通知。",
26
- localTitle: "在你的 Fleet 確認", local: "在你的 Fleet 網頁開啟「設定 → Hub」,開啟「允許這個 Fleet 連線至 Hub」,將以下位址貼到「Hub 位址」欄位,再輸入手動配對碼,並在當地確認提示。",
26
+ localTitle: "在你的 Fleet 確認", local: "在你的 Fleet 網頁開啟「設定 → Hub」,開啟「允許這個 Fleet 連接 Hub」,將以下位址貼到「Hub 位址」欄位,再輸入配對碼,並在當地確認提示。",
27
27
  remoteSteps: "也要在 Hub 完成指紋比對。", ownerStep: "在 Hub 比對這個指紋,並確認你的配對。", policyStep: "Hub 會檢查群組規則,或等待管理員核准。",
28
- address: "Hub 位址", code: "手動配對碼", copy: "複製", copied: "已複製", expires: "有效至 {0}",
28
+ address: "Hub 位址", code: "配對碼", copy: "複製", copied: "已複製", expires: "有效至 {0}",
29
29
  compareTitle: "比對指紋", compare: "在你的 Fleet 開啟「設定 → Hub → 等待核准」,將當地指紋與下方逐一比對,也要在你的 Fleet 確認。",
30
- match: "指紋相符", mismatch: "指紋不同", mismatchStop: "指紋不同,已停止配對,沒有核准連線。請先檢查位址,再重新開始。",
31
- stop: "停止配對", stopped: "已停止配對", again: "重新開始", waiting: "等待你的 Fleet 使用手動配對碼並在當地確認…", claim: "等待你的 Fleet 建立已固定憑證的連線…",
30
+ match: "指紋相符", mismatch: "指紋不同", mismatchStop: "指紋不同,已停止配對,沒有核准連接。請先檢查位址,再重新開始。",
31
+ stop: "停止配對", stopped: "已停止配對", again: "重新開始", waiting: "等待你的 Fleet 使用配對碼並完成確認…", claim: "等待你的 Fleet 建立已固定憑證的連接…",
32
32
  another: "連接另一個 Fleet",
33
33
  connected: "已連接", publish: "在你的 Fleet 分享 Agent", publishHint: "在你的 Fleet 開啟「設定 → Hub → 已分享的 Agent」,選擇你要分享的 Agent 並在當地確認。不會自動分享任何 Agent。",
34
34
  publishNo: "Fleet 已連接,但你目前的權限不包含分享新的 Agent。請聯絡 Hub 管理員。",
35
- expired: "這次配對已過期或被取代,無法再連接 Fleet。請重新開始。", unavailable: "目前無法確認權限或連線。請重試;此頁無法確認配對是否已完成。",
36
- denied: "你目前無法連接 Fleet。請聯絡 Hub 管理員。", conflict: "管理員已為你建立手動配對碼。請使用它,或請管理員協助。",
35
+ expired: "這次配對已過期或被取代,無法再連接 Fleet。請重新開始。", unavailable: "目前無法確認權限或連接。請重試;此頁無法確認配對是否已完成。",
36
+ denied: "你目前無法連接 Fleet。請聯絡 Hub 管理員。", conflict: "管理員已為你建立配對碼。請使用它,或請管理員協助。",
37
37
  limit: "已達 Fleet 或配對數量上限。請停止未使用的配對,或撤銷不再使用的 Fleet,再重試。", retry: "重試", failed: "這次操作未能完成,請重試。",
38
38
  notices: "Fleet 安全通知", notice: "已連接新的 Fleet:{0}", approved: "由 Hub 群組規則核准。", revoke: "撤銷此 Fleet", revokeAsk: "要撤銷「{0}」嗎?它會立即失去 Hub 存取。你的其他 Fleet 和本機 Agent 工作不受影響。", revoked: "已撤銷",
39
39
  revokeHint: "停止這個 Fleet 的 Hub 存取。你的其他 Fleet 和本機 Agent 工作不受影響。", review: "在 Hub 查看並撤銷", previous: "較早的通知", more: "顯示更早的通知", fleetId: "Fleet ID",
@@ -0,0 +1,17 @@
1
+ // M-3007 (alpha.2 re-run): an agent the owner switched on, which the Hub refused to list because the administrator has not
2
+ // allowed this person to share agents (#3759 keeps the link up and sends the refusal back). The row says so instead of
3
+ // "Shared", its switch is off, and the owner can withdraw the request. Once the administrator allows sharing, the next
4
+ // snapshot is accepted and the row is "Shared" again. Its own module, so an older cached hub-strings never shows a raw key.
5
+ import { register, t } from "/assets/app-i18n.js";
6
+
7
+ register("hubShareRefused", {
8
+ en: {
9
+ note: "Not shared: your Hub administrator hasn't allowed you to share agents. It will be shared once they do.",
10
+ withdraw: "Don't share it",
11
+ },
12
+ "zh-TW": {
13
+ note: "未分享:Hub 管理員還沒有允許你分享 Agent。管理員允許後就會自動分享。",
14
+ withdraw: "不要分享",
15
+ },
16
+ });
17
+ export const hr = (key, ...args) => t(`hubShareRefused.${key}`, ...args);