@songsid/agend 2.4.0-beta.7 → 2.4.0-beta.9

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 (385) hide show
  1. package/dist/auth-api.js +4 -0
  2. package/dist/auth-api.js.map +1 -1
  3. package/dist/backend/antigravity.d.ts +9 -2
  4. package/dist/backend/antigravity.js +24 -6
  5. package/dist/backend/antigravity.js.map +1 -1
  6. package/dist/backend/cli-env-probe.js +1 -1
  7. package/dist/backend/cli-env-probe.js.map +1 -1
  8. package/dist/backend/cli-runtime-switch.js +1 -26
  9. package/dist/backend/cli-runtime-switch.js.map +1 -1
  10. package/dist/build-provenance.json +1 -1
  11. package/dist/connect/mcp.d.ts +9 -0
  12. package/dist/connect/mcp.js +10 -0
  13. package/dist/connect/mcp.js.map +1 -0
  14. package/dist/connect/stdio.d.ts +1 -1
  15. package/dist/connect/stdio.js +22 -28
  16. package/dist/connect/stdio.js.map +1 -1
  17. package/dist/daemon.d.ts +13 -0
  18. package/dist/daemon.js +64 -1
  19. package/dist/daemon.js.map +1 -1
  20. package/dist/dispatcher-liveness.d.ts +51 -1
  21. package/dist/dispatcher-liveness.js +92 -2
  22. package/dist/dispatcher-liveness.js.map +1 -1
  23. package/dist/fleet-manager.d.ts +56 -1
  24. package/dist/fleet-manager.js +243 -32
  25. package/dist/fleet-manager.js.map +1 -1
  26. package/dist/general-knowledge/skills/hub/SKILL.md +83 -3
  27. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -2
  28. package/dist/hub/admin-dashboard.js +17 -1
  29. package/dist/hub/admin-dashboard.js.map +1 -1
  30. package/dist/hub/audit/index.d.ts +2 -0
  31. package/dist/hub/audit/index.js +8 -0
  32. package/dist/hub/audit/index.js.map +1 -1
  33. package/dist/hub/buttons.js +3 -1
  34. package/dist/hub/buttons.js.map +1 -1
  35. package/dist/hub/catalog.d.ts +7 -4
  36. package/dist/hub/catalog.js +19 -10
  37. package/dist/hub/catalog.js.map +1 -1
  38. package/dist/hub/client.d.ts +3 -0
  39. package/dist/hub/client.js +14 -2
  40. package/dist/hub/client.js.map +1 -1
  41. package/dist/hub/compose/member.js +28 -11
  42. package/dist/hub/compose/member.js.map +1 -1
  43. package/dist/hub/compose/server.d.ts +5 -0
  44. package/dist/hub/compose/server.js +91 -10
  45. package/dist/hub/compose/server.js.map +1 -1
  46. package/dist/hub/group-policy/admin-api.d.ts +1 -0
  47. package/dist/hub/group-policy/admin-api.js +1 -1
  48. package/dist/hub/group-policy/admin-api.js.map +1 -1
  49. package/dist/hub/group-policy/admin-dto.d.ts +2 -1
  50. package/dist/hub/group-policy/admin-impact.d.ts +32 -3
  51. package/dist/hub/group-policy/admin-impact.js +14 -2
  52. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  53. package/dist/hub/group-policy/admin-inventory.d.ts +2 -0
  54. package/dist/hub/group-policy/admin-inventory.js +13 -4
  55. package/dist/hub/group-policy/admin-inventory.js.map +1 -1
  56. package/dist/hub/group-policy/authorization.d.ts +2 -0
  57. package/dist/hub/group-policy/authorization.js +7 -2
  58. package/dist/hub/group-policy/authorization.js.map +1 -1
  59. package/dist/hub/group-policy/impact-inventory.d.ts +1 -1
  60. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  61. package/dist/hub/group-policy/resources.d.ts +2 -0
  62. package/dist/hub/group-policy/resources.js +12 -1
  63. package/dist/hub/group-policy/resources.js.map +1 -1
  64. package/dist/hub/http/compose.js +164 -23
  65. package/dist/hub/http/compose.js.map +1 -1
  66. package/dist/hub/http/core.js +27 -0
  67. package/dist/hub/http/core.js.map +1 -1
  68. package/dist/hub/http/deps.d.ts +12 -0
  69. package/dist/hub/http/schema.js +6 -0
  70. package/dist/hub/http/schema.js.map +1 -1
  71. package/dist/hub/join/service.d.ts +1 -1
  72. package/dist/hub/join/service.js.map +1 -1
  73. package/dist/hub/mcp/auth-schema.d.ts +7 -0
  74. package/dist/hub/mcp/auth-schema.js +31 -0
  75. package/dist/hub/mcp/auth-schema.js.map +1 -0
  76. package/dist/hub/mcp/auth.d.ts +89 -0
  77. package/dist/hub/mcp/auth.js +374 -0
  78. package/dist/hub/mcp/auth.js.map +1 -0
  79. package/dist/hub/mcp/catalog.d.ts +44 -0
  80. package/dist/hub/mcp/catalog.js +31 -0
  81. package/dist/hub/mcp/catalog.js.map +1 -0
  82. package/dist/hub/mcp/door-schema.d.ts +7 -0
  83. package/dist/hub/mcp/door-schema.js +20 -0
  84. package/dist/hub/mcp/door-schema.js.map +1 -0
  85. package/dist/hub/mcp/http.d.ts +25 -0
  86. package/dist/hub/mcp/http.js +259 -0
  87. package/dist/hub/mcp/http.js.map +1 -0
  88. package/dist/hub/mcp/policy.d.ts +65 -0
  89. package/dist/hub/mcp/policy.js +153 -0
  90. package/dist/hub/mcp/policy.js.map +1 -0
  91. package/dist/hub/mcp/server.d.ts +3 -0
  92. package/dist/hub/mcp/server.js +32 -0
  93. package/dist/hub/mcp/server.js.map +1 -0
  94. package/dist/hub/mcp/tools.d.ts +31 -0
  95. package/dist/hub/mcp/tools.js +176 -0
  96. package/dist/hub/mcp/tools.js.map +1 -0
  97. package/dist/hub/member/room-ask.d.ts +4 -4
  98. package/dist/hub/member/room-ask.js +12 -0
  99. package/dist/hub/member/room-ask.js.map +1 -1
  100. package/dist/hub/member/room-mention-feedback.d.ts +44 -0
  101. package/dist/hub/member/room-mention-feedback.js +121 -0
  102. package/dist/hub/member/room-mention-feedback.js.map +1 -0
  103. package/dist/hub/member/room-notification.d.ts +9 -0
  104. package/dist/hub/member/room-notification.js +2 -0
  105. package/dist/hub/member/room-notification.js.map +1 -0
  106. package/dist/hub/member/room-post-answers.d.ts +1 -7
  107. package/dist/hub/member/room-post-answers.js.map +1 -1
  108. package/dist/hub/member/room-post.d.ts +3 -0
  109. package/dist/hub/member/room-post.js +9 -1
  110. package/dist/hub/member/room-post.js.map +1 -1
  111. package/dist/hub/pairing.d.ts +15 -1
  112. package/dist/hub/pairing.js +33 -2
  113. package/dist/hub/pairing.js.map +1 -1
  114. package/dist/hub/personal/owner-host.d.ts +140 -0
  115. package/dist/hub/personal/owner-host.js +287 -0
  116. package/dist/hub/personal/owner-host.js.map +1 -0
  117. package/dist/hub/personal/refusals.d.ts +11 -0
  118. package/dist/hub/personal/refusals.js +33 -0
  119. package/dist/hub/personal/refusals.js.map +1 -0
  120. package/dist/hub/personal/runtime-host.d.ts +26 -0
  121. package/dist/hub/personal/runtime-host.js +51 -0
  122. package/dist/hub/personal/runtime-host.js.map +1 -0
  123. package/dist/hub/personal/schema.d.ts +4 -0
  124. package/dist/hub/personal/schema.js +54 -0
  125. package/dist/hub/personal/schema.js.map +1 -0
  126. package/dist/hub/personal/turns.d.ts +39 -0
  127. package/dist/hub/personal/turns.js +221 -0
  128. package/dist/hub/personal/turns.js.map +1 -0
  129. package/dist/hub/personal/types.d.ts +42 -0
  130. package/dist/hub/personal/types.js +2 -0
  131. package/dist/hub/personal/types.js.map +1 -0
  132. package/dist/hub/policy.d.ts +1 -1
  133. package/dist/hub/policy.js +2 -0
  134. package/dist/hub/policy.js.map +1 -1
  135. package/dist/hub/protocol.d.ts +43 -0
  136. package/dist/hub/protocol.js +16 -4
  137. package/dist/hub/protocol.js.map +1 -1
  138. package/dist/hub/quota.js +3 -1
  139. package/dist/hub/quota.js.map +1 -1
  140. package/dist/hub/roles/admin-control.d.ts +29 -0
  141. package/dist/hub/roles/admin-control.js +187 -0
  142. package/dist/hub/roles/admin-control.js.map +1 -0
  143. package/dist/hub/roles/admin-types.d.ts +72 -0
  144. package/dist/hub/roles/admin-types.js +2 -0
  145. package/dist/hub/roles/admin-types.js.map +1 -0
  146. package/dist/hub/roles/allowed-list-control.d.ts +34 -0
  147. package/dist/hub/roles/allowed-list-control.js +179 -0
  148. package/dist/hub/roles/allowed-list-control.js.map +1 -0
  149. package/dist/hub/roles/allowed-list.d.ts +8 -0
  150. package/dist/hub/roles/allowed-list.js +49 -0
  151. package/dist/hub/roles/allowed-list.js.map +1 -0
  152. package/dist/hub/roles/audit-details.d.ts +144 -0
  153. package/dist/hub/roles/audit-details.js +26 -0
  154. package/dist/hub/roles/audit-details.js.map +1 -0
  155. package/dist/hub/roles/authority.d.ts +12 -0
  156. package/dist/hub/roles/authority.js +39 -3
  157. package/dist/hub/roles/authority.js.map +1 -1
  158. package/dist/hub/roles/change.d.ts +3 -1
  159. package/dist/hub/roles/change.js +4 -3
  160. package/dist/hub/roles/change.js.map +1 -1
  161. package/dist/hub/roles/clock.d.ts +3 -0
  162. package/dist/hub/roles/clock.js +1 -1
  163. package/dist/hub/roles/clock.js.map +1 -1
  164. package/dist/hub/roles/cutover-inventory.d.ts +2 -0
  165. package/dist/hub/roles/cutover-inventory.js +8 -1
  166. package/dist/hub/roles/cutover-inventory.js.map +1 -1
  167. package/dist/hub/roles/cutover.d.ts +2 -2
  168. package/dist/hub/roles/cutover.js +3 -4
  169. package/dist/hub/roles/cutover.js.map +1 -1
  170. package/dist/hub/roles/delegation.d.ts +4 -1
  171. package/dist/hub/roles/delegation.js +3 -2
  172. package/dist/hub/roles/delegation.js.map +1 -1
  173. package/dist/hub/roles/expiry-effects.d.ts +8 -0
  174. package/dist/hub/roles/expiry-effects.js +50 -0
  175. package/dist/hub/roles/expiry-effects.js.map +1 -0
  176. package/dist/hub/roles/migrations.d.ts +7 -0
  177. package/dist/hub/roles/migrations.js +44 -0
  178. package/dist/hub/roles/migrations.js.map +1 -0
  179. package/dist/hub/roles/model.d.ts +2 -0
  180. package/dist/hub/roles/model.js +2 -1
  181. package/dist/hub/roles/model.js.map +1 -1
  182. package/dist/hub/roles/overview.d.ts +8 -0
  183. package/dist/hub/roles/overview.js +15 -0
  184. package/dist/hub/roles/overview.js.map +1 -0
  185. package/dist/hub/roles/resource-effects.d.ts +17 -0
  186. package/dist/hub/roles/resource-effects.js +62 -0
  187. package/dist/hub/roles/resource-effects.js.map +1 -0
  188. package/dist/hub/roles/review.d.ts +16 -0
  189. package/dist/hub/roles/review.js +42 -0
  190. package/dist/hub/roles/review.js.map +1 -0
  191. package/dist/hub/roles/writer.d.ts +14 -3
  192. package/dist/hub/roles/writer.js +64 -16
  193. package/dist/hub/roles/writer.js.map +1 -1
  194. package/dist/hub/room-mention-feedback-model.d.ts +12 -0
  195. package/dist/hub/room-mention-feedback-model.js +12 -0
  196. package/dist/hub/room-mention-feedback-model.js.map +1 -0
  197. package/dist/hub/rooms/agents.d.ts +3 -1
  198. package/dist/hub/rooms/agents.js +96 -11
  199. package/dist/hub/rooms/agents.js.map +1 -1
  200. package/dist/hub/rooms/direct-view.d.ts +6 -2
  201. package/dist/hub/rooms/direct-view.js +3 -3
  202. package/dist/hub/rooms/direct-view.js.map +1 -1
  203. package/dist/hub/rooms/service.d.ts +27 -3
  204. package/dist/hub/rooms/service.js +74 -13
  205. package/dist/hub/rooms/service.js.map +1 -1
  206. package/dist/hub/rooms/types.d.ts +3 -1
  207. package/dist/hub/rooms.d.ts +12 -2
  208. package/dist/hub/rooms.js +87 -17
  209. package/dist/hub/rooms.js.map +1 -1
  210. package/dist/hub/runtime.js +1 -1
  211. package/dist/hub/runtime.js.map +1 -1
  212. package/dist/hub/server.d.ts +2 -0
  213. package/dist/hub/server.js +19 -3
  214. package/dist/hub/server.js.map +1 -1
  215. package/dist/hub/session-directory-transition.d.ts +2 -1
  216. package/dist/hub/session-directory-transition.js +10 -3
  217. package/dist/hub/session-directory-transition.js.map +1 -1
  218. package/dist/hub/sessions.d.ts +1 -1
  219. package/dist/hub/sessions.js +26 -4
  220. package/dist/hub/sessions.js.map +1 -1
  221. package/dist/hub/settings-commit.d.ts +32 -1
  222. package/dist/hub/settings-commit.js +11 -4
  223. package/dist/hub/settings-commit.js.map +1 -1
  224. package/dist/hub/settings-directory-ca.js +1 -1
  225. package/dist/hub/settings-directory-ca.js.map +1 -1
  226. package/dist/hub/settings-directory-control.js +7 -7
  227. package/dist/hub/settings-directory-control.js.map +1 -1
  228. package/dist/hub/settings-directory-http.d.ts +2 -0
  229. package/dist/hub/settings-directory-http.js +21 -6
  230. package/dist/hub/settings-directory-http.js.map +1 -1
  231. package/dist/hub/settings-directory-proof.d.ts +5 -1
  232. package/dist/hub/settings-directory-proof.js +27 -9
  233. package/dist/hub/settings-directory-proof.js.map +1 -1
  234. package/dist/hub/settings-directory-recovery.js +2 -1
  235. package/dist/hub/settings-directory-recovery.js.map +1 -1
  236. package/dist/hub/settings-directory-save.d.ts +2 -0
  237. package/dist/hub/settings-directory-save.js +9 -6
  238. package/dist/hub/settings-directory-save.js.map +1 -1
  239. package/dist/hub/sharing.js +2 -2
  240. package/dist/hub/sharing.js.map +1 -1
  241. package/dist/hub/types.d.ts +26 -3
  242. package/dist/locale.js +13 -10
  243. package/dist/locale.js.map +1 -1
  244. package/dist/login-controller.d.ts +19 -2
  245. package/dist/login-controller.js +26 -8
  246. package/dist/login-controller.js.map +1 -1
  247. package/dist/native-model-catalog.d.ts +15 -0
  248. package/dist/native-model-catalog.js +43 -3
  249. package/dist/native-model-catalog.js.map +1 -1
  250. package/dist/runtime-build-info.js +1 -0
  251. package/dist/runtime-build-info.js.map +1 -1
  252. package/dist/runtime-cli.js +31 -5
  253. package/dist/runtime-cli.js.map +1 -1
  254. package/dist/runtime-client-store.d.ts +5 -0
  255. package/dist/runtime-client-store.js +28 -0
  256. package/dist/runtime-client-store.js.map +1 -1
  257. package/dist/runtime-client.d.ts +4 -0
  258. package/dist/runtime-client.js +33 -10
  259. package/dist/runtime-client.js.map +1 -1
  260. package/dist/runtime-coordinator.d.ts +4 -2
  261. package/dist/runtime-coordinator.js +33 -6
  262. package/dist/runtime-coordinator.js.map +1 -1
  263. package/dist/runtime-install.d.ts +6 -1
  264. package/dist/runtime-install.js +12 -4
  265. package/dist/runtime-install.js.map +1 -1
  266. package/dist/runtime-personal-answer-only-probe.d.ts +3 -0
  267. package/dist/runtime-personal-answer-only-probe.js +134 -0
  268. package/dist/runtime-personal-answer-only-probe.js.map +1 -0
  269. package/dist/runtime-personal-answer-only.d.ts +16 -0
  270. package/dist/runtime-personal-answer-only.js +54 -0
  271. package/dist/runtime-personal-answer-only.js.map +1 -0
  272. package/dist/runtime-personal-answer.d.ts +7 -2
  273. package/dist/runtime-personal-answer.js +12 -3
  274. package/dist/runtime-personal-answer.js.map +1 -1
  275. package/dist/runtime-personal-preflight.d.ts +8 -0
  276. package/dist/runtime-personal-preflight.js +103 -0
  277. package/dist/runtime-personal-preflight.js.map +1 -0
  278. package/dist/runtime-personal-profile.d.ts +7 -1
  279. package/dist/runtime-personal-profile.js +24 -4
  280. package/dist/runtime-personal-profile.js.map +1 -1
  281. package/dist/runtime-personal-protocol.d.ts +10 -0
  282. package/dist/runtime-personal-protocol.js +15 -0
  283. package/dist/runtime-personal-protocol.js.map +1 -0
  284. package/dist/runtime-personal-stage.d.ts +37 -0
  285. package/dist/runtime-personal-stage.js +167 -0
  286. package/dist/runtime-personal-stage.js.map +1 -0
  287. package/dist/runtime-protocol.d.ts +2 -0
  288. package/dist/setup-form.js +10 -0
  289. package/dist/setup-form.js.map +1 -1
  290. package/dist/tunnel/lease.d.ts +14 -0
  291. package/dist/tunnel/lease.js +23 -0
  292. package/dist/tunnel/lease.js.map +1 -1
  293. package/dist/ui/backend-signin.js +86 -20
  294. package/dist/ui/chat-activity-groups.js +41 -8
  295. package/dist/ui/chat-activity.js +3 -1
  296. package/dist/ui/chat-store.js +39 -2
  297. package/dist/ui/chat-tour.js +1 -1
  298. package/dist/ui/fleet-canvas.js +10 -5
  299. package/dist/ui/fleet-office.js +73 -7
  300. package/dist/ui/hub-ai-apps-strings.js +6 -0
  301. package/dist/ui/hub-ai-apps.js +83 -0
  302. package/dist/ui/hub-client.js +32 -1
  303. package/dist/ui/hub-directory-editor-strings.js +2 -2
  304. package/dist/ui/hub-directory-editor.js +1 -0
  305. package/dist/ui/hub-group-policy.js +4 -3
  306. package/dist/ui/hub-group-strings.js +2 -2
  307. package/dist/ui/hub-personal-agent-strings.js +160 -0
  308. package/dist/ui/hub-personal-agent.js +94 -0
  309. package/dist/ui/hub-role-audit.js +39 -0
  310. package/dist/ui/hub-role-forms.js +99 -0
  311. package/dist/ui/hub-role-notices.js +11 -0
  312. package/dist/ui/hub-role-view.js +86 -0
  313. package/dist/ui/hub-roles-strings.js +439 -0
  314. package/dist/ui/hub-roles.js +83 -0
  315. package/dist/ui/hub-room-composer.js +3 -2
  316. package/dist/ui/hub-room-list.js +4 -3
  317. package/dist/ui/hub-room-members.js +4 -2
  318. package/dist/ui/hub-room-settings.js +6 -0
  319. package/dist/ui/hub-room-source-strings.js +17 -0
  320. package/dist/ui/hub-room-source.js +34 -0
  321. package/dist/ui/hub-room-thread.js +10 -4
  322. package/dist/ui/hub-switcher.js +2 -2
  323. package/dist/ui/hub-this-hub.js +2 -2
  324. package/dist/ui/model-picker.js +4 -1
  325. package/dist/ui/panel-chat.js +4 -4
  326. package/dist/ui/panel-fleet.js +3 -3
  327. package/dist/ui/panel-hub.js +51 -31
  328. package/dist/ui/panel-settings.js +2 -3
  329. package/dist/ui/runtime-commands.d.ts +2 -2
  330. package/dist/ui/runtime-commands.js +7 -4
  331. package/dist/ui/settings-build-version.js +2 -2
  332. package/dist/ui/settings-catalog.js +22 -0
  333. package/dist/ui/settings-hub-setup.js +2 -1
  334. package/dist/ui/settings-strings.js +2 -0
  335. package/dist/ui/shared/access-overview.css +1 -1
  336. package/dist/ui/shared/accounts-keepalive.css +1 -1
  337. package/dist/ui/shared/accounts.css +1 -1
  338. package/dist/ui/shared/agent-sheet.js +2 -2
  339. package/dist/ui/shared/app-prefs.js +5 -2
  340. package/dist/ui/shared/app-shell.js +20 -8
  341. package/dist/ui/shared/app-stream.js +3 -1
  342. package/dist/ui/shared/app-swipe.js +3 -1
  343. package/dist/ui/shared/app.css +142 -48
  344. package/dist/ui/shared/app.js +1 -1
  345. package/dist/ui/shared/chat-thread.js +5 -1
  346. package/dist/ui/shared/chat-work-bar.css +5 -5
  347. package/dist/ui/shared/connector-prompt.d.ts +1 -0
  348. package/dist/ui/shared/connector-prompt.js +10 -0
  349. package/dist/ui/shared/hub-ai-apps.css +12 -0
  350. package/dist/ui/shared/hub-chat.css +9 -2
  351. package/dist/ui/shared/hub-groups.css +1 -1
  352. package/dist/ui/shared/hub-owner.css +5 -5
  353. package/dist/ui/shared/hub-roles.css +99 -0
  354. package/dist/ui/shared/hub-rooms-u2.css +14 -0
  355. package/dist/ui/shared/hub.css +13 -5
  356. package/dist/ui/shared/instance-nav.js +24 -9
  357. package/dist/ui/shared/loading.css +1 -1
  358. package/dist/ui/shared/model-picker.css +2 -2
  359. package/dist/ui/shared/preview-panel-actions.js +1 -1
  360. package/dist/ui/shared/preview-panel.js +2 -2
  361. package/dist/ui/shared/signin.js +27 -12
  362. package/dist/ui/shared/task-board.css +2 -2
  363. package/dist/ui/shared/tokens.css +1 -1
  364. package/dist/ui/shared/ui-toast.js +4 -4
  365. package/dist/ui/shared/usage-dialog.js +110 -16
  366. package/dist/ui/shared/view-strings.js +8 -0
  367. package/dist/ui/signin.html +4 -2
  368. package/dist/ui/structured-signin.js +64 -12
  369. package/dist/ui/web-terminal/terminal.css +1 -1
  370. package/dist/web-api.d.ts +4 -0
  371. package/dist/web-api.js +39 -23
  372. package/dist/web-api.js.map +1 -1
  373. package/dist/web-backend-login.d.ts +5 -1
  374. package/dist/web-backend-login.js +8 -2
  375. package/dist/web-backend-login.js.map +1 -1
  376. package/dist/web-prefs.js +2 -0
  377. package/dist/web-prefs.js.map +1 -1
  378. package/dist/windows-cli-worker.d.ts +10 -0
  379. package/dist/windows-cli-worker.js +109 -14
  380. package/dist/windows-cli-worker.js.map +1 -1
  381. package/dist/windows-cli.d.ts +10 -1
  382. package/dist/windows-cli.js +47 -13
  383. package/dist/windows-cli.js.map +1 -1
  384. package/package.json +1 -1
  385. package/templates/runtime-install/install.ps1 +24 -4
@@ -120,13 +120,16 @@ export function legacyRoom(item) {
120
120
  if (!item || typeof item !== "object" || typeof item.id !== "string") return null;
121
121
  return { id: item.id, kind: "direct", name: String(item.exposureName || ""), people: 1, agents: 1, online: null, unread: 0,
122
122
  lastAt: Number.isFinite(item.lastAt) ? item.lastAt : 0, lastText: "", lastAuthor: "",
123
- agent: { exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
123
+ agent: { ...(item.answerOnly?{answerOnly:true}:{}), exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
124
124
  }
125
125
  export const ADDRESS_HINT = /^https:\/\/[^\s/?#@]+\/?$/i;
126
126
  export const CODE_HINT = /^[A-Za-z0-9][A-Za-z0-9 -]{4,62}[A-Za-z0-9]$/;
127
127
  /** The part of a fingerprint people compare: its first 32 hex digits (128 bits) in 8 groups of 4. */
128
128
  export function compareGroups(digest) { return String(digest || "").replace(/[^0-9a-f]/gi, "").toLowerCase().slice(0, 32).replace(/(.{4})(?=.)/g, "$1 "); }
129
129
  /** An origin the switcher may open: the approved webOrigin of a paired Hub, https only, nothing after the host. */
130
+ /** M-3235: the most a Hub's name can be, in every editor (Hub setup, This Hub) — what the brand shows (src/hub-mode.ts
131
+ * HUB_NAME_MAX, pinned to it by tests/hub-web-setup-ui), so a name typed is never cut afterwards. */
132
+ export const HUB_NAME_MAX = 60;
130
133
  export function safeWebOrigin(pairing) {
131
134
  if (!pairing || pairing.state !== "paired" || !pairing.hub) return null;
132
135
  try {
@@ -361,6 +364,15 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
361
364
  async session() { const r = await call("GET", "/hub/v1/session"); if (r.ok) { csrf = r.signedIn ? r.csrf || null : null; codeNotices = r.signedIn === true && r.features?.includes("enrolment-code-v1") === true; roomsLive = r.signedIn === true && r.features?.includes(ROOMS_FEATURE) === true; teamsLive = r.signedIn === true && r.features?.includes(TEAMS_FEATURE) === true; } return r; },
362
365
  async signIn(login, password) { retireReads(); teamsLive = false; const r = await call("POST", "/hub/v1/session", { login, password }); if (r.ok) { csrf = r.csrf || null; codeNotices = r.features?.includes("enrolment-code-v1") === true; roomsLive = r.features?.includes(ROOMS_FEATURE) === true; teamsLive = r.features?.includes(TEAMS_FEATURE) === true; } return r; },
363
366
  async signOut() { retireReads(); const r = await call("DELETE", "/hub/v1/session"); csrf = null; codeNotices = false; roomsLive = false; teamsLive = false; return r; },
367
+ aiAppsScope() { return csrf; },
368
+ aiApps(scope) { return scope && scope === csrf ? call("GET", "/hub/v1/me/ai-apps") : Promise.resolve(retired()); },
369
+ disconnectAiApp(scope, appId) { return scope && scope === csrf ? call("DELETE", `/hub/v1/me/ai-apps/${id(appId)}`) : Promise.resolve(retired()); },
370
+ appConsent(scope, request) { return scope && scope === csrf ? call("GET", `/hub/v1/mcp/consent?${new URLSearchParams({request})}`) : Promise.resolve(retired()); },
371
+ saveAppConsent(scope, request, value) { return scope && scope === csrf ? call("POST", "/hub/v1/mcp/consent", {request,...value}) : Promise.resolve(retired()); },
372
+ aiAppsSettings(scope) { return scope && scope === csrf ? call("GET", "/hub/v1/admin/ai-apps") : Promise.resolve(retired()); },
373
+ saveAiAppsSettings(scope, value) { return scope && scope === csrf ? call("PATCH", "/hub/v1/admin/ai-apps", value) : Promise.resolve(retired()); },
374
+ searchAiAppSubjects(scope, kind, q, signal) { return scope && scope === csrf ? call("GET", `/hub/v1/admin/ai-apps/search?${new URLSearchParams({kind,q})}`, undefined, signal) : Promise.resolve(retired()); },
375
+ setRoomAiApps(scope, roomId, enabled) { return scope && scope === csrf ? call("PATCH", `/hub/v1/rooms/${id(roomId)}/ai-apps`, {enabled}) : Promise.resolve(retired()); },
364
376
  // A source captures the session CSRF: a queued write from a previous sign-in cannot use the new person's cookie.
365
377
  personPrefs(sessionCsrf) { return sessionCsrf && sessionCsrf === csrf ? call("GET", "/hub/v1/me/prefs") : Promise.resolve(retired()); },
366
378
  savePersonPrefs(sessionCsrf, favorites, onlyIfUnset = false) {
@@ -470,6 +482,18 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
470
482
  acceptInvitation(invitationId) { return call("POST", `/hub/v1/invitations/${id(invitationId)}/accept`, {}); },
471
483
  declineInvitation(invitationId) { return call("POST", `/hub/v1/invitations/${id(invitationId)}/decline`, {}); },
472
484
  // Seam 5: teams, who may open rooms, and the administrator's list of rooms (names and members, no content).
485
+ // Role settings: calls remain authoritative on the Hub, never in these display flags.
486
+ roleSettingsV1: true,
487
+ roleAuditFiltersV1: true,
488
+ roles() { return call("GET", "/hub/v1/roles"); },
489
+ roleSearch(kind,q) { return call("GET", `/hub/v1/roles/search?${new URLSearchParams({kind,q})}`); },
490
+ rolePreview(policy) { return call("POST", "/hub/v1/roles/preview", {policy}); },
491
+ roleApply(policy,previewDigest) { return call("POST", "/hub/v1/roles/apply", {policy,previewDigest}); },
492
+ roleRootPreview() { return call("POST", "/hub/v1/roles/root-self/preview", {}); },
493
+ roleRootApply(previewDigest) { return call("POST", "/hub/v1/roles/root-self/apply", {previewDigest}); },
494
+ roleAudit(cursor, filters = {}) { const query = new URLSearchParams(); for (const key of ["from", "to", "person", "action"]) if (filters[key] !== undefined && filters[key] !== "") query.set(key, String(filters[key])); if (cursor) query.set("cursor", cursor); return call("GET", `/hub/v1/roles/audit${query.size ? `?${query}` : ""}`); },
495
+ roleNotices() { return call("GET", "/hub/v1/roles/notices"); },
496
+ acknowledgeRoleNotice(noticeId) { return call("POST", `/hub/v1/roles/notices/${id(noticeId)}/ack`, {}); },
473
497
  teamSettings() { return call("GET", "/hub/v1/teams/settings"); },
474
498
  saveTeamSettings(input) { return call("PUT", "/hub/v1/teams/settings", input); },
475
499
  teams() { return call("GET", "/hub/v1/teams"); },
@@ -561,6 +585,13 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
561
585
  },
562
586
  welcome() { return call("GET", "/hub/v1/me/welcome"); },
563
587
  // M-3137 / M-3136 (versions spec §2.3): the signed-in person's own active Fleets with their version state (the banner).
588
+ personalAgent(scope) { return scope && scope === csrf ? call("GET", "/hub/v1/me/personal-agent") : Promise.resolve(retired()); },
589
+ refreshPersonalAgent(scope) { return scope && scope === csrf ? call("POST", "/hub/v1/me/personal-agent/refresh", {}) : Promise.resolve(retired()); },
590
+ savePersonalAgent(scope, input) { return scope && scope === csrf ? call("PUT", "/hub/v1/me/personal-agent", input) : Promise.resolve(retired()); },
591
+ personalEnrollment(scope) { return scope && scope === csrf ? call("POST", "/hub/v1/me/personal-agent/enrollment", {}) : Promise.resolve(retired()); },
592
+ disconnectPersonalAgent(scope) { return scope && scope === csrf ? call("DELETE", "/hub/v1/me/personal-agent", {}) : Promise.resolve(retired()); },
593
+ personalAgentSettings(scope) { return scope && scope === csrf ? call("GET", "/hub/v1/admin/personal-agents") : Promise.resolve(retired()); },
594
+ savePersonalAgentSettings(scope, input) { return scope && scope === csrf ? call("PUT", "/hub/v1/admin/personal-agents", input) : Promise.resolve(retired()); },
564
595
  myFleets() { return call("GET", "/hub/v1/me/fleets"); },
565
596
  // M-3162 / M-3161: Administration → Overview's counts for Today or 7 days, in the viewer's time zone (counts only).
566
597
  adminDashboard({ range = "7d", timeZone = "UTC" } = {}) { return call("GET", `/hub/v1/admin/dashboard?range=${encodeURIComponent(range)}&timeZone=${encodeURIComponent(timeZone)}`); },
@@ -14,7 +14,7 @@ register("hubDirectoryEditor", {
14
14
  trustHint: "Compare these fingerprints with your directory administrator. If they do not match, cancel.",
15
15
  fetchConfirm: "Fingerprint matches — fetch CA", fetchAuth: "Use service account and fetch CA", fetchAuthHint: "Anonymous CA retrieval was refused. Only the service account below will be sent over the confirmed, pinned connection.",
16
16
  confirmSave: "Confirm fingerprints and save", confirmTest: "Confirm fingerprints and test", fetching: "Checking the pinned server…", saving: "Saving and checking the new settings…", testing: "Testing the connection…",
17
- tested: "Connection test passed. Nothing was saved.", saved: "AD connection saved.", restored: "The new connection could not start. The previous settings were restored. Reload to check the current state.",
17
+ tested: "Connection test passed. Nothing was saved.", saved: "AD connection saved.",savedSignIn:"AD connection saved. Sign in again with the new connection.", restored: "The new connection could not start. The previous settings were restored. Reload to check the current state.",
18
18
  uncertain: "Save could not be confirmed. Reload the current settings before trying again; do not repeat Save.",
19
19
  conflict: "There are no new settings to save, or this page is out of date. Reload the current settings.",
20
20
  invalid: "Check the server address, search fields, CA certificates and password.", denied: "This session cannot change the AD connection. Sign in again or use this computer's own Settings page.",
@@ -39,7 +39,7 @@ register("hubDirectoryEditor", {
39
39
  trustHint: "請向目錄管理員核對這些指紋。若不相符,請取消。",
40
40
  fetchConfirm: "指紋相符,擷取 CA", fetchAuth: "使用服務帳號擷取 CA", fetchAuthHint: "目錄拒絕匿名擷取 CA。只會透過已確認並鎖定指紋的網路連線,傳送下方的服務帳號。",
41
41
  confirmSave: "確認指紋並儲存", confirmTest: "確認指紋並測試", fetching: "正在檢查已鎖定的伺服器…", saving: "正在儲存並檢查新設定…", testing: "正在測試連線…",
42
- tested: "測試連線通過,尚未儲存。", saved: "已儲存 AD 連線。", restored: "新的目錄連線無法啟動,已還原先前設定。請重新讀取,確認目前狀態。",
42
+ tested: "測試連線通過,尚未儲存。", saved: "已儲存 AD 連線。",savedSignIn:"已儲存 AD 連線,請使用新的目錄設定重新登入。", restored: "新的目錄連線無法啟動,已還原先前設定。請重新讀取,確認目前狀態。",
43
43
  uncertain: "無法確認是否已儲存。請先重新讀取目前設定,再決定下一步;不要重複儲存。",
44
44
  conflict: "沒有新設定可儲存,或此頁面已過期。請重新讀取目前設定。",
45
45
  invalid: "請檢查伺服器網址、搜尋欄位、CA 憑證與密碼。", denied: "此工作階段無法變更 AD 連線。請重新登入,或使用這部電腦自己的設定頁面。",
@@ -91,6 +91,7 @@ export function HubDirectoryEditor({ client, offered = false, host = false, logi
91
91
  if (!current(n)) return;
92
92
  setAuth(a => ({ ...a, password: "" })); setForm(f => ({ ...f, bindPassword: "" })); setDialog(null);
93
93
  if (result.state !== "ready" || !Number.isSafeInteger(result.directoryEpoch) || result.directoryEpoch <= view.epoch) { setUncertain(true); setFailureCode(result.state === "restored" ? "restored" : "uncertain"); return; }
94
+ if(result.reauthenticationRequired===true){saveSent.current=false;setNotice("savedSignIn");await afterSave();return;}
94
95
  if (await afterSave() !== true || !current(n)) { if (current(n)) { setUncertain(true); setFailureCode("uncertain"); } return; }
95
96
  const fresh = await read(signal); if (!current(n)) return;
96
97
  setView(fresh); setForm(formOf(fresh)); setRequireAuth(fresh.reauthentication === "required"); saveSent.current = false; setNotice("saved");
@@ -39,10 +39,11 @@ export function GroupPermissionsCard() {
39
39
  <div class="hub-groups-actions"><a class="btn btn-primary" href="/ui/hub/admin?view=groups" onClick=${go}>${hg("entryOpen")}</a></div></section>`;
40
40
  }
41
41
 
42
- export function HubGroupPolicyPage() {
42
+ export function HubGroupPolicyPage({roleShortcut=false}={}) {
43
+ const title=hg(roleShortcut?"allowedListTitle":"title");
43
44
  const c = hubClient();
44
45
  const teamSummaries = useAllowedTeams(c);
45
- useEffect(() => { setTitle(hg("title")); }, []); // the tab names this page (Argon #17)
46
+ useEffect(() => { setTitle(title); }, [title]); // the tab names this page (Argon #17)
46
47
  const [view, setView] = useState(null), [error, setError] = useState(""), [msg, setMsg] = useState(null);
47
48
  const [state, setState] = useState("never-enabled"), [groups, setGroups] = useState([]);
48
49
  const [dn, setDn] = useState(""), [adding, setAdding] = useState(false), [addError, setAddError] = useState("");
@@ -135,7 +136,7 @@ export function HubGroupPolicyPage() {
135
136
  // Back to Administration first, as a sub-page's crumb (My shared agents → an agent draws it the same way), then the page's
136
137
  // head (Argon #14: the link sat below the head, a raw "←").
137
138
  const head = html`<a class="hub-crumb" href="/ui/hub/admin" onClick=${(e) => { e.preventDefault(); navigate("/ui/hub/admin"); }}><${Icon} name="back" size=${14} />${hg("back")}</a>
138
- <${PageHead} title=${hg("title")} scope=${hg("experimental")} lead=${hg("lead")} />`;
139
+ <${PageHead} title=${title} scope=${hg("experimental")} lead=${hg("lead")} />`;
139
140
  if (error) return html`<div class="col hub-owner hub-groups">${head}<div class="s-section-layout">${error === READ_BUSY
140
141
  ? html`<p class="note" role="status" data-groups="busy">${hr("busy")}</p>`
141
142
  : html`<${ErrorState} message=${error} onRetry=${load} />`}</div></div>`;
@@ -10,7 +10,7 @@ register("hubGroups", {
10
10
  entryOpen: "Open group permissions", entryOpenHub: "Open on the Hub", settingsRowHint: "Set on the Hub's Administration page, signed in as its administrator.",
11
11
  experimental: "Preview",
12
12
  // Editor
13
- title: "Group permissions", lead: "People get the union of their AD groups, teams and own row. A person exclusion wins. Sign-in stays with AD; chatting with an agent still needs its owner's grant.",
13
+ allowedListTitle:"Allowed list",title: "Group permissions", lead: "People get the union of their AD groups, teams and own row. A person exclusion wins. Sign-in stays with AD; chatting with an agent still needs its owner's grant.",
14
14
  back: "Administration", unsupported: "This Hub's directory can't be used for group permissions. Group permissions need Active Directory over LDAPS (port 636).",
15
15
  repair: "The directory settings changed since group permissions were saved. Group permissions are paused until the Hub is repaired.",
16
16
  stateNever: "Off", stateEnabled: "On", stateSuspended: "Switched off — resources paused",
@@ -61,7 +61,7 @@ register("hubGroups", {
61
61
  entryTitle: "群組權限", entryHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet,不必逐一核准每個人。",
62
62
  entryOpen: "開啟群組權限", entryOpenHub: "在 Hub 上開啟", settingsRowHint: "在 Hub 的「管理」頁設定,需以 Hub 管理員身分登入。",
63
63
  experimental: "預覽版",
64
- title: "群組權限", lead: "權限取自所屬 AD 群組、團隊與個人列的聯集,個人排除優先。登入仍由 AD 決定;與 Agent 對話仍需要擁有者授權。",
64
+ allowedListTitle:"允許清單",title: "群組權限", lead: "權限取自所屬 AD 群組、團隊與個人列的聯集,個人排除優先。登入仍由 AD 決定;與 Agent 對話仍需要擁有者授權。",
65
65
  back: "管理", unsupported: "這個 Hub 的目錄無法用於群組權限。群組權限需要透過 LDAPS(連接埠 636)的 Active Directory。",
66
66
  repair: "目錄設定在群組權限儲存後改變了。在修復 Hub 之前,群組權限暫停。",
67
67
  stateNever: "關閉", stateEnabled: "開啟", stateSuspended: "已關閉——資源已暫停",
@@ -0,0 +1,160 @@
1
+ import {register,t} from "/assets/app-i18n.js";
2
+ register("hubPersonal",{
3
+ "en": {
4
+ "personalQuestion": "It runs on {0}'s computer and answers when that computer is connected. An answer can take a few minutes. Each question is answered on its own: it doesn't remember earlier ones, so include what it needs.",
5
+ "ownerFallback": "the owner",
6
+ "answerOnly": "Answer only",
7
+ "answerOnlyOption": "Use Codex to answer only",
8
+ "answerOnlyExplain": "Codex can't be kept inside one folder on this computer. In this mode it has no access to the computer at all: it answers from the question and what it already knows.",
9
+ "answerOnlyDisclosure": "It cannot read your files, run anything or go online. It also cannot look anything up for the asker.",
10
+ "answerOnlyPays": "Your own AI account pays for answers.",
11
+ "answerOnlyTick": "Turn on Answer only",
12
+ "answerOnlyFailed": "Codex can't be used here: this computer can't keep it inside one folder, and Answer only mode isn't available either. Claude can be used.",
13
+ "answerOnlyAsker": "Answers from general knowledge only. It can't look at any files.",
14
+ "title": "Personal agent",
15
+ "lead": "Answer colleagues with Codex or Claude on your computer. No Fleet is needed. Windows only for now.",
16
+ "guard": "Read-only, and only one folder: the Hub agent folder on your computer. People allowed to ask may receive anything in that folder. Your own AI account pays for answers.",
17
+ "add": "Add a personal agent",
18
+ "replace": "Use a different computer",
19
+ "refresh": "Refresh",
20
+ "off": "Personal agents are not enabled on this Hub.",
21
+ "denied": "Ask the Hub administrator to let you add a personal agent.",
22
+ "install": "Run this command on your Windows computer",
23
+ "installHint": "Node.js and a signed-in Codex or Claude are required. The command expires after 15 minutes; keep it private.",
24
+ "folderHint": "The installer creates an empty Hub agent folder in your user profile. Put only material you want to share there.",
25
+ "copy": "Copy command",
26
+ "copied": "Copied",
27
+ "expired": "This command has expired.",
28
+ "ready": "Ready",
29
+ "working": "Working",
30
+ "later": "Answers when connected",
31
+ "unchecked": "Checking this computer…",
32
+ "unavailable": "Unavailable",
33
+ "codexSandbox": "Codex can't be used here: this version of Windows can't keep it inside one folder. Claude can be used.",
34
+ "signIn": "Sign in on that computer, then refresh.",
35
+ "missing": "Install it on that computer, then refresh.",
36
+ "profile": "The isolated check has not passed. Check the app on that computer, then refresh.",
37
+ "name": "Agent name",
38
+ "description": "One-line description",
39
+ "cli": "Answer with",
40
+ "model": "Model",
41
+ "defaultModel": "Default model",
42
+ "save": "Save personal agent",
43
+ "saved": "Saved.",
44
+ "sharing": "Choose who may ask",
45
+ "changeSharing": "Change who may ask",
46
+ "chooseTeam": "Choose a team",
47
+ "disconnect": "Disconnect computer",
48
+ "disconnectAsk": "Disconnect this computer? The agent stops answering. Nothing on the computer is deleted or uninstalled.",
49
+ "cancel": "Cancel",
50
+ "loadFailed": "Couldn't read personal-agent settings. Try again.",
51
+ "saveFailed": "Couldn't save. Refresh and try again.",
52
+ "adminTitle": "Personal agents",
53
+ "adminLead": "Choose who may add an agent on their own computer. Questions use that person's AI account.",
54
+ "enabled": "Allow personal agents",
55
+ "allowed": "People and teams allowed to add one",
56
+ "adminAlways": "The Hub administrator is included while this is on.",
57
+ "person": "Person",
58
+ "team": "Team",
59
+ "search": "Search everyone by name",
60
+ "find": "Search",
61
+ "choose": "Add",
62
+ "remove": "Remove",
63
+ "saveSettings": "Save",
64
+ "unsaved": "Unsaved changes",
65
+ "savedSettings": "Saved",
66
+ "unknownPerson": "Previously selected person",
67
+ "unknownTeam": "Previously selected team",
68
+ "newCommand": "New command",
69
+ "canUse": "Can be used",
70
+ "notShared": "Not shared yet. Nobody can ask this agent.",
71
+ "disconnectConfirm": "Disconnect",
72
+ "commandFails": "If the command fails",
73
+ "certificateFailure": "An error about a certificate or trust means this computer doesn't trust this Hub yet. Ask your Hub administrator. Don't change security settings to get past it.",
74
+ "nodeFailure": "\"Node.js is required\": install Node.js, then get a new command.",
75
+ "expiredHelp": "The command is only valid for 15 minutes. Get a new one and run it again.",
76
+ "onlyAdmin": "Only the Hub administrator can add one."
77
+ },
78
+ "zh-TW": {
79
+ "personalQuestion": "它在 {0} 的電腦上執行,那台電腦連接時才會回答,可能需要幾分鐘。每個問題都是分開回答的,它不會記得之前的內容,請把需要的資訊一次寫清楚。",
80
+ "ownerFallback": "擁有者",
81
+ "answerOnly": "只回答",
82
+ "answerOnlyOption": "只讓 Codex 回答",
83
+ "answerOnlyExplain": "這台電腦無法把 Codex 限制在單一資料夾內。這個模式下,它完全不能存取這台電腦,只會根據提問和它已經知道的內容回答。",
84
+ "answerOnlyDisclosure": "它不能讀取你的檔案、執行任何東西或上網,也無法替提問的人查資料。",
85
+ "answerOnlyPays": "回答使用你自己的 AI 帳號額度。",
86
+ "answerOnlyTick": "開啟「只回答」",
87
+ "answerOnlyFailed": "這裡不能使用 Codex:這台電腦無法把它限制在單一資料夾內,也無法使用「只回答」模式。可以使用 Claude。",
88
+ "answerOnlyAsker": "只根據一般知識回答,無法查看任何檔案。",
89
+ "title": "個人 Agent",
90
+ "lead": "用自己電腦上的 Codex 或 Claude 回答同仁,不需要 Fleet。目前只支援 Windows。",
91
+ "guard": "只能讀取,而且只讀你電腦上的「Hub agent」資料夾。可以提問的人可能取得資料夾內的任何內容;回答使用你自己的 AI 帳號額度。",
92
+ "add": "新增個人 Agent",
93
+ "replace": "改用另一台電腦",
94
+ "refresh": "重新整理",
95
+ "off": "這個 Hub 尚未啟用個人 Agent。",
96
+ "denied": "請 Hub 管理員允許你新增個人 Agent。",
97
+ "install": "在你的 Windows 電腦執行這個指令",
98
+ "installHint": "電腦需要 Node.js,以及已登入的 Codex 或 Claude。指令在 15 分鐘後失效,請勿分享。",
99
+ "folderHint": "安裝程式會在你的使用者資料夾建立空白的 Hub agent 資料夾,只放入你願意分享的資料。",
100
+ "copy": "複製指令",
101
+ "copied": "已複製",
102
+ "expired": "這個指令已經失效。",
103
+ "ready": "待命",
104
+ "working": "處理中",
105
+ "later": "上線時回答",
106
+ "unchecked": "正在檢查這部電腦…",
107
+ "unavailable": "無法使用",
108
+ "codexSandbox": "這裡不能使用 Codex:這個版本的 Windows 無法把它限制在單一資料夾內。可以使用 Claude。",
109
+ "signIn": "請在那台電腦登入,再重新整理。",
110
+ "missing": "請在那台電腦安裝,再重新整理。",
111
+ "profile": "隔離檢查尚未通過,請在那台電腦確認程式後重新整理。",
112
+ "name": "Agent 名稱",
113
+ "description": "一句話說明",
114
+ "cli": "用哪一個回答",
115
+ "model": "模型",
116
+ "defaultModel": "預設模型",
117
+ "save": "儲存個人 Agent",
118
+ "saved": "已儲存。",
119
+ "sharing": "選擇誰可以問",
120
+ "changeSharing": "變更誰可以問",
121
+ "chooseTeam": "選擇團隊",
122
+ "disconnect": "中斷連接",
123
+ "disconnectAsk": "要中斷這台電腦的連接嗎?這個 Agent 會停止回答。電腦上的檔案和程式都不會被刪除或移除。",
124
+ "cancel": "取消",
125
+ "loadFailed": "目前無法讀取個人 Agent 設定,請再試一次。",
126
+ "saveFailed": "目前無法儲存,請重新整理後再試。",
127
+ "adminTitle": "個人 Agent",
128
+ "adminLead": "選擇誰能在自己的電腦新增 Agent,回答使用那個人的 AI 帳號額度。",
129
+ "enabled": "允許個人 Agent",
130
+ "allowed": "可新增的同仁與團隊",
131
+ "adminAlways": "開啟後,一律包含 Hub 管理員。",
132
+ "person": "同仁",
133
+ "team": "團隊",
134
+ "search": "輸入姓名搜尋所有人",
135
+ "find": "搜尋",
136
+ "choose": "新增",
137
+ "remove": "移除",
138
+ "saveSettings": "儲存",
139
+ "unsaved": "尚未儲存",
140
+ "savedSettings": "已儲存",
141
+ "unknownPerson": "先前選擇的同仁",
142
+ "unknownTeam": "先前選擇的團隊",
143
+ "newCommand": "重新產生指令",
144
+ "canUse": "可以使用",
145
+ "notShared": "還沒有分享,目前沒有人可以問這個 Agent。",
146
+ "disconnectConfirm": "中斷連接",
147
+ "commandFails": "如果指令執行失敗",
148
+ "certificateFailure": "出現憑證或信任相關的錯誤,表示這台電腦還不信任這個 Hub。請洽 Hub 管理員,不要為了通過而更改安全性設定。",
149
+ "nodeFailure": "顯示需要 Node.js:請先安裝 Node.js,再重新產生指令。",
150
+ "expiredHelp": "指令只在 15 分鐘內有效。請重新產生後再執行一次。",
151
+ "onlyAdmin": "目前只有 Hub 管理員可以新增。"
152
+ }
153
+ });
154
+ export const hp=(key,...args)=>t(`hubPersonal.${key}`,...args);
155
+
156
+ /** Personal questions are independent runs in both profiles; never describe a shared Fleet conversation. */
157
+ export function personalAgentQuestionHint(room){
158
+ if((room?.agent?.agentKind??room?.agentKind)!=="personal")return null;
159
+ return hp("personalQuestion",room?.agent?.owner?.name||room?.ownerName||hp("ownerFallback"));
160
+ }
@@ -0,0 +1,94 @@
1
+ import {html,useEffect,useRef,useState} from "/assets/app-html.js";
2
+ import {ErrorState,Skeleton} from "/assets/ui-states.js";
3
+ import {confirmDialog} from "/assets/ui-confirm.js";
4
+ import {runtimeEnrollCommand} from "./runtime-commands.js";
5
+ import {hp} from "./hub-personal-agent-strings.js";
6
+ const refused=()=>({ok:false});
7
+ const fields=agent=>({name:agent?.name??"",description:agent?.description??"",cli:agent?.cli??"",model:agent?.model??"",ifRevision:agent?.revision??0,answerOnly:agent?.answerOnly===true});
8
+ const policy=value=>({enabled:value.enabled===true,people:[...(value.people??[])],teams:[...(value.teams??[])]});
9
+ export function personalCliReason(cli){
10
+ if(cli?.available)return "canUse";
11
+ if(!cli?.path)return "missing";
12
+ if(cli.authenticated!==true)return "signIn";
13
+ if(cli.id==="codex"&&["sandbox-unavailable","profile-unavailable"].includes(cli.personalStatus)&&cli.answerOnlyAvailable===false)return "answerOnlyFailed";
14
+ return cli.id==="codex"&&cli.personalStatus==="sandbox-unavailable"?"codexSandbox":"profile";
15
+ }
16
+ function installCss(){if(typeof document==="undefined"||document.querySelector('link[data-personal-install="1"]'))return;const link=document.createElement("link");link.rel="stylesheet";link.href="/assets/runtime-install.css";link.setAttribute("data-personal-install","1");document.head.appendChild(link);}
17
+ /** The captured sign-in is passed through every client call, including writes after an await. */
18
+ export function HubPersonalAgent({client,scope,onSaved=()=>{}}){
19
+ const [view,setView]=useState(null),[form,setForm]=useState(null),[busy,setBusy]=useState(false),[error,setError]=useState(""),[issued,setIssued]=useState(null),[saved,setSaved]=useState(false),[copied,setCopied]=useState(false),[clock,setClock]=useState(Date.now());
20
+ const generation=useRef(0),dirty=useRef(false),reads=useRef(0),busyRef=useRef(false);
21
+ const markBusy=value=>{busyRef.current=value;if(value)reads.current++;setBusy(value);};
22
+ const load=async(refresh=false,replace=false)=>{const mine=generation.current,read=++reads.current;let value;try{value=await (refresh?client.refreshPersonalAgent(scope):client.personalAgent(scope));}catch{value=refused();}
23
+ if(mine!==generation.current||read!==reads.current)return;if(!value?.ok){setError(hp("loadFailed"));return;}setView(value);setError("");
24
+ setForm(previous=>!previous||replace||!dirty.current?fields(value.agent):previous);
25
+ };
26
+ useEffect(()=>{generation.current++;dirty.current=false;markBusy(false);setView(null);setForm(null);setIssued(null);setSaved(false);setError("");installCss();void load();
27
+ const timer=setInterval(()=>{setClock(Date.now());if(!busyRef.current)void load();},5000);return()=>{generation.current++;clearInterval(timer);};},[client,scope]);
28
+ const edit=patch=>{dirty.current=true;setSaved(false);setForm(value=>({...value,...patch}));};
29
+ const enroll=async()=>{if(busyRef.current)return;markBusy(true);setError("");const mine=generation.current;let result;try{result=await client.personalEnrollment(scope);}catch{result=refused();}
30
+ if(mine!==generation.current)return;markBusy(false);if(!result?.ok){setError(hp("saveFailed"));return;}setIssued(result);setClock(Date.now());setCopied(false);
31
+ };
32
+ const save=async event=>{event.preventDefault();if(busyRef.current||!form?.name.trim())return;markBusy(true);setError("");const mine=generation.current;
33
+ let result;try{const {model,answerOnly,...input}=form;result=await client.savePersonalAgent(scope,{...input,...(model?{model}:{}),...(answerOnly?{answerOnly:true}:{})});}catch{result=refused();}
34
+ if(mine!==generation.current)return;markBusy(false);if(!result?.ok){setError(hp("saveFailed"));return;}dirty.current=false;setIssued(null);setSaved(true);await load(false,true);if(mine===generation.current)onSaved();
35
+ };
36
+ const disconnect=async()=>{if(busyRef.current)return;const mine=generation.current;markBusy(true);const confirmed=await confirmDialog({message:hp("disconnectAsk"),confirmLabel:hp("disconnectConfirm"),danger:true});if(mine!==generation.current)return;if(!confirmed){markBusy(false);return;}
37
+ let result;try{result=await client.disconnectPersonalAgent(scope);}catch{result=refused();}if(mine!==generation.current)return;markBusy(false);
38
+ if(!result?.ok){setError(hp("saveFailed"));return;}dirty.current=false;setIssued(null);await load(false,true);if(mine===generation.current)onSaved();
39
+ };
40
+ const refresh=async()=>{if(busyRef.current)return;const mine=generation.current;markBusy(true);await load(true);if(mine===generation.current)markBusy(false);};
41
+ const computer=view?.computer,selected=computer?.clis.find(row=>row.id===form?.cli),command=issued&&issued.expiresAt>clock?runtimeEnrollCommand(issued.server,issued.installer?.scriptSha256,issued.token,issued.fingerprint,"personal"):"";
42
+ const canUse=cli=>cli?.available && (cli.id!=="codex"||!form?.answerOnly) || cli?.id==="codex" && form?.answerOnly && cli.answerOnlyAvailable===true;
43
+ return html`<section class="card hub-personal-agent" data-personal-agent><h3>${hp("title")}</h3><p class="note">${hp("lead")}</p>${!form?.answerOnly?html`<p class="note">${hp("guard")}</p>`:null}
44
+ ${error?html`<${ErrorState} message=${error} onRetry=${()=>void load()} />`:null}
45
+ ${!view&&!error?html`<${Skeleton} lines=${3} />`:null}
46
+ ${view&&!view.enabled?html`<p class="note">${hp("off")}</p>`:view&&!view.canAdd?html`<p class="note">${hp("denied")}</p>`:view?html`
47
+ <div class="field-row">${!computer||issued?html`<button type="button" class=${`btn btn-sm ${issued?"btn-ghost":"btn-primary"}`} disabled=${busy} onClick=${enroll}>${hp(issued?"newCommand":"add")}</button>`:null}<button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${refresh}>${hp("refresh")}</button></div>
48
+ ${issued?command?html`<div class="runtime-command-card"><strong class="runtime-command-label">${hp("install")}</strong><p class="note">${hp("installHint")}</p><div class="runtime-command-row"><pre class="runtime-command-text"><code>${command}</code></pre><button type="button" class="btn btn-sm btn-primary" onClick=${async()=>{try{const mine=generation.current;await navigator.clipboard.writeText(command);if(mine===generation.current)setCopied(true);}catch{setCopied(false);}}}>${hp(copied?"copied":"copy")}</button></div><p class="note">${hp("folderHint")}</p><details class="s-ui-disclosure"><summary>${hp("commandFails")}</summary><div class="s-disclosure-body form"><p class="note">${hp("certificateFailure")}</p><p class="note">${hp("nodeFailure")}</p><p class="note">${hp("expiredHelp")}</p></div></details></div>`:html`<div class="form"><p class="note">${hp("expired")}</p></div>`:null}
49
+ ${computer?html`<div class="s-row"><span class="hub-row-text"><strong>${computer.name}</strong><small class="note">${form?.answerOnly?hp("answerOnly"):computer.folder||hp("unchecked")}</small></span><span class="tag">${hp(!computer.connected?"later":computer.working?"working":computer.clis.some(canUse)?"ready":"unavailable")}</span></div>
50
+ ${computer.clis.map(cli=>{const compact=view.agent?.answerOnly===true&&form?.answerOnly,reason=personalCliReason(cli);return html`<div key=${cli.id} class="hub-personal-cli">
51
+ <div class="s-row"><span class="hub-row-text"><strong>${cli.id==="codex"?"Codex":"Claude"}</strong><small class="note">${hp(form?.answerOnly&&cli.id==="codex"&&cli.answerOnlyAvailable?"answerOnly":reason)}</small>${cli.reason&&!cli.available&&reason!=="answerOnlyFailed"?html`<small class="note">${cli.reason}</small>`:null}</span></div>
52
+ ${cli.id==="codex"&&(cli.answerOnlyAvailable===true||form?.answerOnly&&cli.available)?html`<div class="form" data-answer-only-option>
53
+ ${!compact?html`<strong>${hp("answerOnlyOption")}</strong><p class="note">${hp("answerOnlyExplain")}</p>`:null}
54
+ <p class="note">${hp("answerOnlyDisclosure")}</p>${!compact?html`<p class="note">${hp("answerOnlyPays")}</p>`:null}
55
+ <label class="check"><input type="checkbox" disabled=${busy} checked=${form?.answerOnly===true} onChange=${e=>edit({answerOnly:e.target.checked,cli:e.target.checked?"codex":form.cli,model:""})} /><span>${hp("answerOnlyTick")}</span></label>
56
+ </div>`:null}</div>`;})}
57
+ ${computer.clis.some(canUse)?html`<form onSubmit=${save} class="form"><label class="field"><span>${hp("name")}</span><input required maxlength="256" disabled=${busy} value=${form?.name||""} onInput=${e=>edit({name:e.target.value})} /></label>
58
+ <label class="field"><span>${hp("description")}</span><input maxlength="512" disabled=${busy} value=${form?.description||""} onInput=${e=>edit({description:e.target.value})} /></label>
59
+ <label class="field"><span>${hp("cli")}</span><select required disabled=${busy} value=${form?.cli||""} onChange=${e=>edit({cli:e.target.value,model:"",answerOnly:e.target.value==="codex"&&form.answerOnly})}><option value=""></option>${computer.clis.filter(canUse).map(c=>html`<option value=${c.id}>${c.id==="codex"?"Codex":"Claude"}</option>`)}</select></label>
60
+ <label class="field"><span>${hp("model")}</span><select disabled=${busy} value=${form?.model||""} onChange=${e=>edit({model:e.target.value})}><option value="">${hp("defaultModel")}</option>${(selected?.models??[]).map(m=>html`<option value=${m.id}>${m.label||m.id}</option>`)}</select></label>
61
+ <div class="field-row"><button class="btn btn-sm btn-primary" disabled=${busy||!canUse(selected)||!computer.connected||!form?.name.trim()||!!view.agent&&!dirty.current}>${hp("save")}</button>${dirty.current?html`<span class="note" role="status">${hp("unsaved")}</span>`:null}</div></form>`:null}
62
+ `:null}
63
+ ${saved?html`<p class="note" role="status">${hp("saved")}</p>`:null}${view.agent?html`<div class="form">${!view.agent.shared?html`<p class="note">${hp("notShared")}</p>`:null}<div class="field-row"><a class=${`btn btn-sm ${!view.agent.shared?"btn-primary":"btn-ghost"}`} href=${`/ui/hub/exposures?agent=${encodeURIComponent(view.agent.exposureId)}`}>${hp(view.agent.shared?"changeSharing":"sharing")}</a></div></div>`:null}
64
+ ${computer?html`<div class="hub-this-actions"><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${enroll}>${hp("replace")}</button><button type="button" class="btn btn-sm btn-danger" disabled=${busy} onClick=${disconnect}>${hp("disconnect")}</button></div>`:null}`:null}
65
+ </section>`;
66
+ }
67
+ export function HubPersonalAgentAdmin({client,scope}){
68
+ const [view,setView]=useState(null),[form,setForm]=useState(null),[busy,setBusy]=useState(false),[error,setError]=useState(""),[errorKind,setErrorKind]=useState("load"),[saved,setSaved]=useState(false),[query,setQuery]=useState(""),[hits,setHits]=useState([]),[teams,setTeams]=useState([]);
69
+ const generation=useRef(0),searchSequence=useRef(0),reads=useRef(0),busyRef=useRef(false);
70
+ const markBusy=value=>{busyRef.current=value;if(value)reads.current++;setBusy(value);};
71
+ const load=async()=>{const mine=generation.current,read=++reads.current;const [settings,teamRows]=await Promise.allSettled([client.personalAgentSettings(scope),client.teams()]);if(mine!==generation.current||read!==reads.current)return;
72
+ const data=settings.status==="fulfilled"?settings.value:refused();if(!data?.ok){setErrorKind("load");setError(hp("loadFailed"));return;}setError("");setView(data);setForm(policy(data));setTeams(teamRows.status==="fulfilled"&&teamRows.value.ok?teamRows.value.teams??[]:[]);
73
+ };
74
+ useEffect(()=>{generation.current++;markBusy(false);setView(null);setForm(null);setError("");setSaved(false);setHits([]);void load();return()=>{generation.current++;};},[client,scope]);
75
+ const edit=patch=>{setSaved(false);setForm(value=>({...value,...patch}));};
76
+ const search=async()=>{if(query.trim().length<2||busy)return;const mine=generation.current,search=++searchSequence.current;let result;try{result=await client.teamSuggestions("person",query.trim());}catch{result=refused();}
77
+ if(mine!==generation.current||search!==searchSequence.current)return;if(!result?.ok){setErrorKind("search");setError(hp("loadFailed"));return;}setError("");setHits(result.candidates??[]);
78
+ };
79
+ const pickPerson=row=>{if(!form.people.includes(row.id))edit({people:[...form.people,row.id]});setView(value=>({...value,peopleInfo:[...(value.peopleInfo??[]).filter(p=>p.id!==row.id),row]}));setHits([]);setQuery("");};
80
+ const save=async event=>{event?.preventDefault();if(busyRef.current)return;markBusy(true);setError("");const mine=generation.current;let result;try{result=await client.savePersonalAgentSettings(scope,policy(form));}catch{result=refused();}
81
+ if(mine!==generation.current)return;markBusy(false);if(!result?.ok){setErrorKind("save");setError(hp("saveFailed"));return;}setView(result);setForm(policy(result));setSaved(true);
82
+ };
83
+ const changed=!!form&&JSON.stringify(policy(view))!==JSON.stringify(form);
84
+ return html`<section class="card" data-personal-admin><h3>${hp("adminTitle")}</h3><p class="note">${hp("adminLead")}</p>${error?html`<${ErrorState} message=${error} onRetry=${()=>void (errorKind==="save"?save():errorKind==="search"?search():load())} />`:null}
85
+ ${!form&&!error?html`<${Skeleton} lines=${3} />`:form?html`<form onSubmit=${save} class="form"><label class="s-row"><span class="hub-row-text">${hp("enabled")}</span><input class="s-ui-toggle" role="switch" aria-label=${hp("enabled")} type="checkbox" disabled=${busy} checked=${form.enabled} onChange=${e=>edit({enabled:e.target.checked})} /></label>
86
+ <p class="note">${hp("adminAlways")}</p><h4>${hp("allowed")}</h4>${!form.people.length&&!form.teams.length?html`<p class="note">${hp("onlyAdmin")}</p>`:null}
87
+ ${form.people.map(id=>{const p=view.peopleInfo?.find(p=>p.id===id);return html`<div key=${id} class="s-row"><span class="hub-row-text"><strong>${p?.name||hp("unknownPerson")}</strong><small class="note">${p?.login||""}</small></span><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${()=>edit({people:form.people.filter(p=>p!==id)})}>${hp("remove")}</button></div>`;})}
88
+ ${form.teams.map(id=>html`<div key=${id} class="s-row"><span class="hub-row-text">${teams.find(t=>t.id===id)?.name||view.teamsInfo?.find(t=>t.id===id)?.name||hp("unknownTeam")}</span><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${()=>edit({teams:form.teams.filter(t=>t!==id)})}>${hp("remove")}</button></div>`)}
89
+ <label class="field"><span>${hp("search")}</span><input type="search" disabled=${busy} minlength="2" maxlength="64" value=${query} onInput=${e=>{searchSequence.current++;setQuery(e.target.value);setHits([]);}} /></label><button type="button" class="btn btn-sm" disabled=${busy||query.trim().length<2} onClick=${search}>${hp("find")}</button>
90
+ ${hits.map(p=>html`<div key=${p.id} class="s-row"><span class="hub-row-text"><strong>${p.name}</strong><small class="note">${p.login||""}</small></span><button type="button" class="btn btn-sm" disabled=${busy} onClick=${()=>pickPerson(p)}>${hp("choose")}</button></div>`)}
91
+ <label class="field"><span>${hp("team")}</span><select disabled=${busy} value="" onChange=${e=>{if(e.target.value&&!form.teams.includes(e.target.value))edit({teams:[...form.teams,e.target.value]});}}><option value="">${hp("chooseTeam")}</option>${teams.filter(t=>!form.teams.includes(t.id)).map(t=>html`<option value=${t.id}>${t.name}</option>`)}</select></label>
92
+ <div class="field-row"><button class="btn btn-sm btn-primary" disabled=${busy||!changed}>${hp("saveSettings")}</button>${changed||saved?html`<span class="note" role="status">${hp(changed?"unsaved":"savedSettings")}</span>`:null}</div></form>`:null}
93
+ </section>`;
94
+ }
@@ -0,0 +1,39 @@
1
+ import {html,useEffect,useRef,useState} from "/assets/app-html.js";
2
+ import {hr} from "./hub-roles-strings.js";
3
+ import {auditActor,auditAction,auditCsv,auditResult,auditSentence,valueLines,roleAuditActions} from "./hub-role-view.js";
4
+ export function RoleAudit({client}){
5
+ const enhanced=client.roleAuditFiltersV1===true;
6
+ const [page,setPage]=useState(null),[error,setError]=useState(null),[busy,setBusy]=useState(false),[exporting,setExporting]=useState(false),[filters,setFilters]=useState({}),[draft,setDraft]=useState({from:"",to:"",person:"",action:""}),[people,setPeople]=useState([]),[actions,setActions]=useState(()=>[...roleAuditActions]);
7
+ const epoch=useRef(0),pending=useRef(false);
8
+ const load=async(cursor=null,query=filters,mine=epoch.current)=>{
9
+ if(pending.current)return;pending.current=true;setBusy(true);setError(null);let out;try{out=await client.roleAudit(cursor,query);}catch{out={ok:false};}
10
+ if(mine!==epoch.current)return;pending.current=false;setBusy(false);
11
+ if(!out.ok){setError(hr("auditFailed"));return;}
12
+ setPage(previous=>({...out,rows:cursor?[...(previous?.rows||[]),...out.rows]:out.rows}));
13
+ setPeople(previous=>[...new Map([...previous,...out.rows.map(row=>({id:row.actor.id,name:auditActor(row)}))].map(row=>[row.id,row])).values()]);setActions(previous=>[...new Set([...previous,...out.rows.map(row=>row.action)])]);
14
+ };
15
+ useEffect(()=>{const mine=++epoch.current;pending.current=false;void load(null,{},mine);return()=>{epoch.current++;pending.current=false;};},[client]);
16
+ const filter=e=>{e.preventDefault();if(busy||exporting)return;const query={};if(draft.from)query.from=new Date(draft.from+"T00:00:00").getTime();if(draft.to)query.to=new Date(draft.to+"T23:59:59.999").getTime();if(draft.person)query.person=draft.person;if(draft.action)query.action=draft.action;setFilters(query);setPage(null);void load(null,query);};
17
+ const download=async()=>{
18
+ if(exporting||busy)return;setExporting(true);setError(null);const mine=epoch.current;let cursor=null,rows=[];const seen=new Set();
19
+ try{do{const out=await client.roleAudit(cursor,filters);if(mine!==epoch.current)return;if(!out.ok)throw Error("exportFailed");rows.push(...out.rows);cursor=out.nextCursor;
20
+ if(rows.length>5000||cursor&&rows.length>=5000)throw Error("exportTooLarge");if(cursor&&seen.has(cursor))throw Error("exportFailed");if(cursor)seen.add(cursor);
21
+ }while(cursor);
22
+ const blob=new Blob([auditCsv(rows)],{type:"text/csv;charset=utf-8"}),url=URL.createObjectURL(blob),link=document.createElement("a");link.href=url;link.download="hub-audit.csv";link.click();URL.revokeObjectURL(url);
23
+ }catch(e){if(mine===epoch.current)setError(hr(e.message==="exportTooLarge"?"exportTooLarge":"exportFailed"));}
24
+ finally{if(mine===epoch.current)setExporting(false);}
25
+ };
26
+ return html`<section class="hub-role-audit-page"><div class="hub-card-head"><h2>${hr("audit")}</h2><button type="button" class="btn" disabled=${!enhanced||busy||exporting||!page} onClick=${download}>${hr("exportCsv")}</button></div>
27
+ ${!enhanced?html`<p class="note" role="status">${hr("refreshAudit")}</p>`:html`<p class="note">${hr("exportLimit")}</p>`}
28
+ ${enhanced?html`<form class="hub-role-audit-filters" onSubmit=${filter}>
29
+ <label class="field"><span>${hr("dateFrom")}</span><input type="date" value=${draft.from} disabled=${busy||exporting} onInput=${e=>setDraft({...draft,from:e.target.value})}/></label>
30
+ <label class="field"><span>${hr("dateTo")}</span><input type="date" value=${draft.to} disabled=${busy||exporting} onInput=${e=>setDraft({...draft,to:e.target.value})}/></label>
31
+ <label class="field"><span>${hr("filterPerson")}</span><select value=${draft.person} disabled=${busy||exporting} onChange=${e=>setDraft({...draft,person:e.target.value})}><option value="">${hr("all")}</option>${people.map(person=>html`<option key=${person.id} value=${person.id}>${person.name}</option>`)}</select></label>
32
+ <label class="field"><span>${hr("filterAction")}</span><select value=${draft.action} disabled=${busy||exporting} onChange=${e=>setDraft({...draft,action:e.target.value})}><option value="">${hr("all")}</option>${actions.map(action=>html`<option key=${action} value=${action}>${auditAction(action)}</option>`)}</select></label><button type="submit" class="btn" disabled=${busy||exporting}>${hr("filter")}</button></form>`:null}
33
+ ${error?html`<p class="err" role="alert">${error}</p><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(null,filters)}>${hr("retry")}</button>`:null}${!page&&!error?html`<p role="status">${hr("loading")}</p>`:null}
34
+ <div class="hub-team-table-wrap"><table class="hub-team-table hub-role-audit"><thead><tr><th>${hr("when")}</th><th>${hr("who")}</th><th>${hr("action")}</th><th>${hr("result")}</th></tr></thead><tbody>
35
+ ${page?.rows?.map(row=>html`<tr key=${row.id}><td class="hub-role-audit-when"><time datetime=${new Date(row.at).toISOString()}>${new Date(row.at).toLocaleString()}</time></td><td class="hub-role-audit-who">${auditActor(row)}</td><td class="hub-role-audit-action">
36
+ ${row.details?html`<details><summary>${auditSentence(row)}</summary><div class="grid2 hub-role-audit-values">${["before","after"].map(side=>html`<div key=${side}><strong>${hr(side)}</strong><ul>${valueLines(row.details[side]).map((line,i)=>html`<li key=${i}>${line}</li>`)}</ul></div>`)}</div></details>`:auditSentence(row)}</td>
37
+ <td class="hub-role-audit-result"><span class=${`tag ${row.result==="denied"?"warn":["completed","allowed"].includes(row.result)?"ok":"danger"}`}>${auditResult(row.result)}</span></td></tr>`)}</tbody></table></div>
38
+ ${page&&!page.rows.length?html`<p class="note">${hr("empty")}</p>`:null}${page?.nextCursor?html`<div class="hub-role-actions"><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(page.nextCursor)}>${hr("more")}</button></div>`:null}</section>`;
39
+ }