@songsid/agend 2.4.0-alpha.2 → 2.4.0-alpha.4

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 (654) hide show
  1. package/dist/account-isolation.d.ts +6 -0
  2. package/dist/account-isolation.js +40 -0
  3. package/dist/account-isolation.js.map +1 -0
  4. package/dist/accounts-signout.d.ts +15 -2
  5. package/dist/accounts-signout.js +52 -4
  6. package/dist/accounts-signout.js.map +1 -1
  7. package/dist/accounts-view.d.ts +114 -27
  8. package/dist/accounts-view.js +123 -60
  9. package/dist/accounts-view.js.map +1 -1
  10. package/dist/agent-cli-instructions.md +15 -9
  11. package/dist/agent-cli.js +47 -20
  12. package/dist/agent-cli.js.map +1 -1
  13. package/dist/agent-endpoint.js +23 -8
  14. package/dist/agent-endpoint.js.map +1 -1
  15. package/dist/agent-list-output.d.ts +23 -0
  16. package/dist/agent-list-output.js +53 -0
  17. package/dist/agent-list-output.js.map +1 -0
  18. package/dist/agent-runtime-change.js +4 -4
  19. package/dist/agent-runtime-change.js.map +1 -1
  20. package/dist/agent-whats-new.js +9 -7
  21. package/dist/agent-whats-new.js.map +1 -1
  22. package/dist/antigravity-first-run.d.ts +4 -0
  23. package/dist/antigravity-first-run.js +57 -0
  24. package/dist/antigravity-first-run.js.map +1 -0
  25. package/dist/antigravity-identity.d.ts +6 -0
  26. package/dist/antigravity-identity.js +27 -0
  27. package/dist/antigravity-identity.js.map +1 -0
  28. package/dist/antigravity-store.d.ts +22 -0
  29. package/dist/antigravity-store.js +79 -0
  30. package/dist/antigravity-store.js.map +1 -0
  31. package/dist/auth-api.js +11 -1
  32. package/dist/auth-api.js.map +1 -1
  33. package/dist/backend/agy-onboarding.d.ts +14 -0
  34. package/dist/backend/agy-onboarding.js +114 -0
  35. package/dist/backend/agy-onboarding.js.map +1 -0
  36. package/dist/backend/antigravity.d.ts +15 -0
  37. package/dist/backend/antigravity.js +44 -4
  38. package/dist/backend/antigravity.js.map +1 -1
  39. package/dist/backend/claude-code.d.ts +8 -0
  40. package/dist/backend/claude-code.js +11 -4
  41. package/dist/backend/claude-code.js.map +1 -1
  42. package/dist/backend/codex.js +7 -3
  43. package/dist/backend/codex.js.map +1 -1
  44. package/dist/backend/credential-profile.d.ts +22 -3
  45. package/dist/backend/credential-profile.js +61 -9
  46. package/dist/backend/credential-profile.js.map +1 -1
  47. package/dist/backend/grok.d.ts +19 -0
  48. package/dist/backend/grok.js +112 -1
  49. package/dist/backend/grok.js.map +1 -1
  50. package/dist/backend/types.d.ts +10 -0
  51. package/dist/backend/types.js.map +1 -1
  52. package/dist/backend-availability.d.ts +6 -0
  53. package/dist/backend-availability.js +11 -0
  54. package/dist/backend-availability.js.map +1 -1
  55. package/dist/browser-backend-signins.d.ts +9 -1
  56. package/dist/browser-backend-signins.js +9 -5
  57. package/dist/browser-backend-signins.js.map +1 -1
  58. package/dist/build-provenance.json +1 -1
  59. package/dist/channel/mcp-tools.js +10 -10
  60. package/dist/channel/mcp-tools.js.map +1 -1
  61. package/dist/child-process.d.ts +1 -0
  62. package/dist/child-process.js.map +1 -1
  63. package/dist/claude-auth-status.d.ts +1 -0
  64. package/dist/claude-auth-status.js +25 -0
  65. package/dist/claude-auth-status.js.map +1 -1
  66. package/dist/claude-model-observation.d.ts +71 -0
  67. package/dist/claude-model-observation.js +169 -0
  68. package/dist/claude-model-observation.js.map +1 -0
  69. package/dist/cli-capability.d.ts +104 -19
  70. package/dist/cli-capability.js +3 -1
  71. package/dist/cli-capability.js.map +1 -1
  72. package/dist/cli-caps-module.d.ts +14 -0
  73. package/dist/cli-caps-module.js +8 -1
  74. package/dist/cli-caps-module.js.map +1 -1
  75. package/dist/cli-registry-check.js +114 -18
  76. package/dist/cli-registry-check.js.map +1 -1
  77. package/dist/cli-registry.d.ts +116 -12
  78. package/dist/cli-registry.js +16 -1
  79. package/dist/cli-registry.js.map +1 -1
  80. package/dist/cli-spec-antigravity.d.ts +53 -11
  81. package/dist/cli-spec-antigravity.js +44 -13
  82. package/dist/cli-spec-antigravity.js.map +1 -1
  83. package/dist/cli-spec-claude-code.d.ts +14 -1
  84. package/dist/cli-spec-claude-code.js +5 -4
  85. package/dist/cli-spec-claude-code.js.map +1 -1
  86. package/dist/cli-spec-codex.d.ts +8 -0
  87. package/dist/cli-spec-codex.js +4 -3
  88. package/dist/cli-spec-codex.js.map +1 -1
  89. package/dist/cli-spec-grok.d.ts +4 -0
  90. package/dist/cli-spec-grok.js +2 -1
  91. package/dist/cli-spec-grok.js.map +1 -1
  92. package/dist/cli-spec-kiro-cli.d.ts +7 -0
  93. package/dist/cli-spec-kiro-cli.js +3 -2
  94. package/dist/cli-spec-kiro-cli.js.map +1 -1
  95. package/dist/cli-spec-muse.d.ts +4 -0
  96. package/dist/cli-spec-muse.js +2 -1
  97. package/dist/cli-spec-muse.js.map +1 -1
  98. package/dist/cli-spec-opencode.d.ts +1 -0
  99. package/dist/cli-spec-opencode.js +1 -0
  100. package/dist/cli-spec-opencode.js.map +1 -1
  101. package/dist/credential-store-proof.d.ts +6 -0
  102. package/dist/credential-store-proof.js +30 -0
  103. package/dist/credential-store-proof.js.map +1 -0
  104. package/dist/cross-instance-envelope.d.ts +4 -1
  105. package/dist/cross-instance-envelope.js +12 -7
  106. package/dist/cross-instance-envelope.js.map +1 -1
  107. package/dist/daemon.d.ts +24 -2
  108. package/dist/daemon.js +265 -37
  109. package/dist/daemon.js.map +1 -1
  110. package/dist/decision-list.d.ts +5 -4
  111. package/dist/decision-list.js +22 -8
  112. package/dist/decision-list.js.map +1 -1
  113. package/dist/delivery-consumed-watch.d.ts +24 -0
  114. package/dist/delivery-consumed-watch.js +21 -10
  115. package/dist/delivery-consumed-watch.js.map +1 -1
  116. package/dist/delivery-outbox.d.ts +5 -1
  117. package/dist/delivery-outbox.js +5 -0
  118. package/dist/delivery-outbox.js.map +1 -1
  119. package/dist/fleet-manager.d.ts +31 -2
  120. package/dist/fleet-manager.js +238 -56
  121. package/dist/fleet-manager.js.map +1 -1
  122. package/dist/fleet-windows-runtime.js +6 -6
  123. package/dist/fleet-windows-runtime.js.map +1 -1
  124. package/dist/general-knowledge/skills/concepts/SKILL.md +48 -7
  125. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -6
  126. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +18 -8
  127. package/dist/general-knowledge/skills/fleet-health/SKILL.md +16 -0
  128. package/dist/general-knowledge/skills/hub/SKILL.md +518 -0
  129. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
  130. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  131. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +199 -40
  132. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  133. package/dist/general-role.d.ts +1 -1
  134. package/dist/general-role.js +1 -0
  135. package/dist/general-role.js.map +1 -1
  136. package/dist/grok-delivery-proof.d.ts +24 -0
  137. package/dist/grok-delivery-proof.js +124 -0
  138. package/dist/grok-delivery-proof.js.map +1 -0
  139. package/dist/hub/assistant/admin-types.d.ts +43 -0
  140. package/dist/hub/assistant/admin-types.js +2 -0
  141. package/dist/hub/assistant/admin-types.js.map +1 -0
  142. package/dist/hub/assistant/claude-host.d.ts +17 -0
  143. package/dist/hub/assistant/claude-host.js +300 -0
  144. package/dist/hub/assistant/claude-host.js.map +1 -0
  145. package/dist/hub/assistant/context.d.ts +3 -0
  146. package/dist/hub/assistant/context.js +7 -0
  147. package/dist/hub/assistant/context.js.map +1 -0
  148. package/dist/hub/assistant/fleet-host.d.ts +19 -0
  149. package/dist/hub/assistant/fleet-host.js +28 -0
  150. package/dist/hub/assistant/fleet-host.js.map +1 -0
  151. package/dist/hub/assistant/runner.d.ts +64 -0
  152. package/dist/hub/assistant/runner.js +239 -0
  153. package/dist/hub/assistant/runner.js.map +1 -0
  154. package/dist/hub/assistant/service.d.ts +51 -0
  155. package/dist/hub/assistant/service.js +143 -0
  156. package/dist/hub/assistant/service.js.map +1 -0
  157. package/dist/hub/assistant/store.d.ts +3 -0
  158. package/dist/hub/assistant/store.js +65 -0
  159. package/dist/hub/assistant/store.js.map +1 -0
  160. package/dist/hub/assistant/types.d.ts +60 -0
  161. package/dist/hub/assistant/types.js +2 -0
  162. package/dist/hub/assistant/types.js.map +1 -0
  163. package/dist/hub/buttons.d.ts +3 -0
  164. package/dist/hub/buttons.js +11 -11
  165. package/dist/hub/buttons.js.map +1 -1
  166. package/dist/hub/catalog.d.ts +13 -6
  167. package/dist/hub/catalog.js +127 -35
  168. package/dist/hub/catalog.js.map +1 -1
  169. package/dist/hub/client.d.ts +16 -0
  170. package/dist/hub/client.js +52 -9
  171. package/dist/hub/client.js.map +1 -1
  172. package/dist/hub/compose/member.d.ts +8 -1
  173. package/dist/hub/compose/member.js +238 -57
  174. package/dist/hub/compose/member.js.map +1 -1
  175. package/dist/hub/compose/server.d.ts +17 -1
  176. package/dist/hub/compose/server.js +76 -13
  177. package/dist/hub/compose/server.js.map +1 -1
  178. package/dist/hub/directory/admission.d.ts +15 -0
  179. package/dist/hub/directory/admission.js +56 -0
  180. package/dist/hub/directory/admission.js.map +1 -0
  181. package/dist/hub/directory/directory.d.ts +1 -1
  182. package/dist/hub/directory/directory.js +114 -0
  183. package/dist/hub/directory/directory.js.map +1 -1
  184. package/dist/hub/directory/types.d.ts +27 -0
  185. package/dist/hub/directory/types.js.map +1 -1
  186. package/dist/hub/enrolment-code.d.ts +1 -1
  187. package/dist/hub/enrolment-code.js +4 -4
  188. package/dist/hub/enrolment-code.js.map +1 -1
  189. package/dist/hub/grant-access.d.ts +11 -0
  190. package/dist/hub/grant-access.js +113 -0
  191. package/dist/hub/grant-access.js.map +1 -0
  192. package/dist/hub/grant-search.d.ts +9 -0
  193. package/dist/hub/grant-search.js +92 -0
  194. package/dist/hub/grant-search.js.map +1 -0
  195. package/dist/hub/group-policy/admin-control.d.ts +1 -0
  196. package/dist/hub/group-policy/admin-control.js +4 -2
  197. package/dist/hub/group-policy/admin-control.js.map +1 -1
  198. package/dist/hub/group-policy/admin-facts.d.ts +1 -0
  199. package/dist/hub/group-policy/admin-facts.js +2 -1
  200. package/dist/hub/group-policy/admin-facts.js.map +1 -1
  201. package/dist/hub/group-policy/admin-impact.d.ts +2 -0
  202. package/dist/hub/group-policy/admin-impact.js +10 -2
  203. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  204. package/dist/hub/group-policy/admin-inventory.js +1 -1
  205. package/dist/hub/group-policy/admin-inventory.js.map +1 -1
  206. package/dist/hub/group-policy/admin-read.d.ts +1 -0
  207. package/dist/hub/group-policy/admin-read.js +3 -2
  208. package/dist/hub/group-policy/admin-read.js.map +1 -1
  209. package/dist/hub/group-policy/authorization.d.ts +5 -2
  210. package/dist/hub/group-policy/authorization.js +73 -32
  211. package/dist/hub/group-policy/authorization.js.map +1 -1
  212. package/dist/hub/group-policy/errors.d.ts +9 -0
  213. package/dist/hub/group-policy/errors.js +13 -0
  214. package/dist/hub/group-policy/errors.js.map +1 -0
  215. package/dist/hub/group-policy/impact-inventory.js +20 -4
  216. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  217. package/dist/hub/group-policy/resources.d.ts +4 -5
  218. package/dist/hub/group-policy/resources.js +26 -19
  219. package/dist/hub/group-policy/resources.js.map +1 -1
  220. package/dist/hub/group-policy/store.d.ts +21 -12
  221. package/dist/hub/group-policy/store.js +99 -109
  222. package/dist/hub/group-policy/store.js.map +1 -1
  223. package/dist/hub/group-policy/welcome.js.map +1 -1
  224. package/dist/hub/http/compose.d.ts +1 -0
  225. package/dist/hub/http/compose.js +463 -20
  226. package/dist/hub/http/compose.js.map +1 -1
  227. package/dist/hub/http/core.d.ts +24 -5
  228. package/dist/hub/http/core.js +181 -54
  229. package/dist/hub/http/core.js.map +1 -1
  230. package/dist/hub/http/deps.d.ts +26 -0
  231. package/dist/hub/http/schema.js +19 -0
  232. package/dist/hub/http/schema.js.map +1 -1
  233. package/dist/hub/init/member-certificate.d.ts +1 -0
  234. package/dist/hub/init/member-certificate.js +39 -0
  235. package/dist/hub/init/member-certificate.js.map +1 -0
  236. package/dist/hub/init/plan-digest.js +1 -0
  237. package/dist/hub/init/plan-digest.js.map +1 -1
  238. package/dist/hub/invitations.d.ts +96 -0
  239. package/dist/hub/invitations.js +292 -0
  240. package/dist/hub/invitations.js.map +1 -0
  241. package/dist/hub/join/certificate-trust.d.ts +13 -0
  242. package/dist/hub/join/certificate-trust.js +41 -0
  243. package/dist/hub/join/certificate-trust.js.map +1 -0
  244. package/dist/hub/join/certificate.d.ts +11 -0
  245. package/dist/hub/join/certificate.js +67 -0
  246. package/dist/hub/join/certificate.js.map +1 -0
  247. package/dist/hub/join/client.d.ts +5 -0
  248. package/dist/hub/join/client.js +30 -3
  249. package/dist/hub/join/client.js.map +1 -1
  250. package/dist/hub/join/http.js +5 -3
  251. package/dist/hub/join/http.js.map +1 -1
  252. package/dist/hub/join/local.d.ts +37 -1
  253. package/dist/hub/join/local.js +142 -14
  254. package/dist/hub/join/local.js.map +1 -1
  255. package/dist/hub/join/service.d.ts +19 -0
  256. package/dist/hub/join/service.js +46 -35
  257. package/dist/hub/join/service.js.map +1 -1
  258. package/dist/hub/join/trust.d.ts +9 -0
  259. package/dist/hub/join/trust.js +35 -0
  260. package/dist/hub/join/trust.js.map +1 -1
  261. package/dist/hub/member/pairing-api.js +12 -1
  262. package/dist/hub/member/pairing-api.js.map +1 -1
  263. package/dist/hub/member/room-ask.d.ts +137 -0
  264. package/dist/hub/member/room-ask.js +358 -0
  265. package/dist/hub/member/room-ask.js.map +1 -0
  266. package/dist/hub/member-journal.d.ts +18 -1
  267. package/dist/hub/member-journal.js +76 -3
  268. package/dist/hub/member-journal.js.map +1 -1
  269. package/dist/hub/member-origin.d.ts +177 -0
  270. package/dist/hub/member-origin.js +314 -0
  271. package/dist/hub/member-origin.js.map +1 -0
  272. package/dist/hub/pairing-notices.d.ts +1 -0
  273. package/dist/hub/pairing-notices.js +2 -1
  274. package/dist/hub/pairing-notices.js.map +1 -1
  275. package/dist/hub/pairing.d.ts +11 -0
  276. package/dist/hub/pairing.js +69 -21
  277. package/dist/hub/pairing.js.map +1 -1
  278. package/dist/hub/policy.d.ts +1 -1
  279. package/dist/hub/policy.js +19 -6
  280. package/dist/hub/policy.js.map +1 -1
  281. package/dist/hub/protocol.d.ts +172 -0
  282. package/dist/hub/protocol.js +25 -2
  283. package/dist/hub/protocol.js.map +1 -1
  284. package/dist/hub/quota.d.ts +2 -1
  285. package/dist/hub/quota.js +2 -2
  286. package/dist/hub/quota.js.map +1 -1
  287. package/dist/hub/roles/authority.d.ts +45 -0
  288. package/dist/hub/roles/authority.js +199 -0
  289. package/dist/hub/roles/authority.js.map +1 -0
  290. package/dist/hub/roles/change.d.ts +18 -0
  291. package/dist/hub/roles/change.js +76 -0
  292. package/dist/hub/roles/change.js.map +1 -0
  293. package/dist/hub/roles/clock.d.ts +18 -0
  294. package/dist/hub/roles/clock.js +58 -0
  295. package/dist/hub/roles/clock.js.map +1 -0
  296. package/dist/hub/roles/convert.d.ts +11 -0
  297. package/dist/hub/roles/convert.js +27 -0
  298. package/dist/hub/roles/convert.js.map +1 -0
  299. package/dist/hub/roles/cutover-inventory.d.ts +14 -0
  300. package/dist/hub/roles/cutover-inventory.js +42 -0
  301. package/dist/hub/roles/cutover-inventory.js.map +1 -0
  302. package/dist/hub/roles/cutover-marker.d.ts +57 -0
  303. package/dist/hub/roles/cutover-marker.js +26 -0
  304. package/dist/hub/roles/cutover-marker.js.map +1 -0
  305. package/dist/hub/roles/cutover.d.ts +32 -0
  306. package/dist/hub/roles/cutover.js +170 -0
  307. package/dist/hub/roles/cutover.js.map +1 -0
  308. package/dist/hub/roles/delegation.d.ts +24 -0
  309. package/dist/hub/roles/delegation.js +111 -0
  310. package/dist/hub/roles/delegation.js.map +1 -0
  311. package/dist/hub/roles/evaluate.d.ts +50 -0
  312. package/dist/hub/roles/evaluate.js +96 -0
  313. package/dist/hub/roles/evaluate.js.map +1 -0
  314. package/dist/hub/roles/expiry.d.ts +46 -0
  315. package/dist/hub/roles/expiry.js +180 -0
  316. package/dist/hub/roles/expiry.js.map +1 -0
  317. package/dist/hub/roles/mode-effects.d.ts +5 -0
  318. package/dist/hub/roles/mode-effects.js +21 -0
  319. package/dist/hub/roles/mode-effects.js.map +1 -0
  320. package/dist/hub/roles/model.d.ts +171 -0
  321. package/dist/hub/roles/model.js +79 -0
  322. package/dist/hub/roles/model.js.map +1 -0
  323. package/dist/hub/roles/read.d.ts +33 -0
  324. package/dist/hub/roles/read.js +55 -0
  325. package/dist/hub/roles/read.js.map +1 -0
  326. package/dist/hub/roles/writer.d.ts +80 -0
  327. package/dist/hub/roles/writer.js +427 -0
  328. package/dist/hub/roles/writer.js.map +1 -0
  329. package/dist/hub/rooms/admin.d.ts +45 -0
  330. package/dist/hub/rooms/admin.js +105 -0
  331. package/dist/hub/rooms/admin.js.map +1 -0
  332. package/dist/hub/rooms/agents.d.ts +74 -0
  333. package/dist/hub/rooms/agents.js +333 -0
  334. package/dist/hub/rooms/agents.js.map +1 -0
  335. package/dist/hub/rooms/assistant.d.ts +44 -0
  336. package/dist/hub/rooms/assistant.js +179 -0
  337. package/dist/hub/rooms/assistant.js.map +1 -0
  338. package/dist/hub/rooms/context.d.ts +10 -0
  339. package/dist/hub/rooms/context.js +24 -0
  340. package/dist/hub/rooms/context.js.map +1 -0
  341. package/dist/hub/rooms/direct-view.d.ts +39 -0
  342. package/dist/hub/rooms/direct-view.js +38 -0
  343. package/dist/hub/rooms/direct-view.js.map +1 -0
  344. package/dist/hub/rooms/directory.d.ts +35 -0
  345. package/dist/hub/rooms/directory.js +98 -0
  346. package/dist/hub/rooms/directory.js.map +1 -0
  347. package/dist/hub/rooms/schema.d.ts +11 -0
  348. package/dist/hub/rooms/schema.js +73 -0
  349. package/dist/hub/rooms/schema.js.map +1 -0
  350. package/dist/hub/rooms/service.d.ts +449 -0
  351. package/dist/hub/rooms/service.js +581 -0
  352. package/dist/hub/rooms/service.js.map +1 -0
  353. package/dist/hub/rooms/types.d.ts +79 -0
  354. package/dist/hub/rooms/types.js +2 -0
  355. package/dist/hub/rooms/types.js.map +1 -0
  356. package/dist/hub/rooms.d.ts +15 -1
  357. package/dist/hub/rooms.js +76 -31
  358. package/dist/hub/rooms.js.map +1 -1
  359. package/dist/hub/runtime.d.ts +8 -0
  360. package/dist/hub/runtime.js +57 -3
  361. package/dist/hub/runtime.js.map +1 -1
  362. package/dist/hub/server.d.ts +28 -0
  363. package/dist/hub/server.js +66 -6
  364. package/dist/hub/server.js.map +1 -1
  365. package/dist/hub/sessions.js +6 -2
  366. package/dist/hub/sessions.js.map +1 -1
  367. package/dist/hub/settings-commit.d.ts +6 -1
  368. package/dist/hub/settings-commit.js +15 -0
  369. package/dist/hub/settings-commit.js.map +1 -1
  370. package/dist/hub/settings-directory-decision.d.ts +2 -2
  371. package/dist/hub/settings-directory-decision.js +7 -5
  372. package/dist/hub/settings-directory-decision.js.map +1 -1
  373. package/dist/hub/settings-directory-proof.js +3 -1
  374. package/dist/hub/settings-directory-proof.js.map +1 -1
  375. package/dist/hub/settings-directory-recovery.d.ts +5 -0
  376. package/dist/hub/settings-directory-recovery.js +14 -4
  377. package/dist/hub/settings-directory-recovery.js.map +1 -1
  378. package/dist/hub/settings-member-address-control.d.ts +84 -0
  379. package/dist/hub/settings-member-address-control.js +150 -0
  380. package/dist/hub/settings-member-address-control.js.map +1 -0
  381. package/dist/hub/settings-member-address-decision.d.ts +229 -0
  382. package/dist/hub/settings-member-address-decision.js +318 -0
  383. package/dist/hub/settings-member-address-decision.js.map +1 -0
  384. package/dist/hub/settings-member-address-http.d.ts +9 -0
  385. package/dist/hub/settings-member-address-http.js +78 -0
  386. package/dist/hub/settings-member-address-http.js.map +1 -0
  387. package/dist/hub/settings-member-address-network.d.ts +2 -0
  388. package/dist/hub/settings-member-address-network.js +22 -0
  389. package/dist/hub/settings-member-address-network.js.map +1 -0
  390. package/dist/hub/settings-member-address-notices.d.ts +22 -0
  391. package/dist/hub/settings-member-address-notices.js +21 -0
  392. package/dist/hub/settings-member-address-notices.js.map +1 -0
  393. package/dist/hub/settings-member-address-policy.d.ts +21 -0
  394. package/dist/hub/settings-member-address-policy.js +34 -0
  395. package/dist/hub/settings-member-address-policy.js.map +1 -0
  396. package/dist/hub/settings-member-address.d.ts +64 -0
  397. package/dist/hub/settings-member-address.js +239 -0
  398. package/dist/hub/settings-member-address.js.map +1 -0
  399. package/dist/hub/sharing.d.ts +10 -0
  400. package/dist/hub/sharing.js +74 -0
  401. package/dist/hub/sharing.js.map +1 -0
  402. package/dist/hub/socket.d.ts +2 -0
  403. package/dist/hub/socket.js +2 -0
  404. package/dist/hub/socket.js.map +1 -1
  405. package/dist/hub/store.js +6 -2
  406. package/dist/hub/store.js.map +1 -1
  407. package/dist/hub/teams/types.d.ts +41 -0
  408. package/dist/hub/teams/types.js +2 -0
  409. package/dist/hub/teams/types.js.map +1 -0
  410. package/dist/hub/tls.d.ts +47 -0
  411. package/dist/hub/tls.js +23 -6
  412. package/dist/hub/tls.js.map +1 -1
  413. package/dist/hub/types.d.ts +68 -4
  414. package/dist/hub/validation.d.ts +1 -1
  415. package/dist/hub/validation.js +2 -2
  416. package/dist/hub/validation.js.map +1 -1
  417. package/dist/hub/web-origin.d.ts +93 -0
  418. package/dist/hub/web-origin.js +174 -0
  419. package/dist/hub/web-origin.js.map +1 -0
  420. package/dist/hub-pilot-trust-settings.d.ts +4 -0
  421. package/dist/hub-pilot-trust-settings.js +13 -0
  422. package/dist/hub-pilot-trust-settings.js.map +1 -0
  423. package/dist/human-delivery-receipts.d.ts +4 -2
  424. package/dist/human-delivery-receipts.js +20 -13
  425. package/dist/human-delivery-receipts.js.map +1 -1
  426. package/dist/inbound-presentation.d.ts +28 -0
  427. package/dist/inbound-presentation.js +48 -0
  428. package/dist/inbound-presentation.js.map +1 -0
  429. package/dist/instance-lifecycle.d.ts +13 -1
  430. package/dist/instance-lifecycle.js +33 -10
  431. package/dist/instance-lifecycle.js.map +1 -1
  432. package/dist/instructions.d.ts +10 -2
  433. package/dist/instructions.js +32 -7
  434. package/dist/instructions.js.map +1 -1
  435. package/dist/locale.js +20 -6
  436. package/dist/locale.js.map +1 -1
  437. package/dist/log-service.d.ts +3 -0
  438. package/dist/log-service.js +39 -22
  439. package/dist/log-service.js.map +1 -1
  440. package/dist/log-steps.d.ts +56 -1
  441. package/dist/log-steps.js +318 -56
  442. package/dist/log-steps.js.map +1 -1
  443. package/dist/login-flows.d.ts +24 -2
  444. package/dist/login-flows.js +53 -22
  445. package/dist/login-flows.js.map +1 -1
  446. package/dist/login-url.js +3 -0
  447. package/dist/login-url.js.map +1 -1
  448. package/dist/machine-accounts.d.ts +42 -12
  449. package/dist/machine-accounts.js +144 -46
  450. package/dist/machine-accounts.js.map +1 -1
  451. package/dist/machine-signins.d.ts +35 -13
  452. package/dist/machine-signins.js +57 -27
  453. package/dist/machine-signins.js.map +1 -1
  454. package/dist/native-instance-input.js +4 -4
  455. package/dist/native-instance-input.js.map +1 -1
  456. package/dist/native-instance-registry.d.ts +3 -3
  457. package/dist/native-instance-registry.js +11 -10
  458. package/dist/native-instance-registry.js.map +1 -1
  459. package/dist/needs-you-hub.js +6 -2
  460. package/dist/needs-you-hub.js.map +1 -1
  461. package/dist/needs-you.d.ts +5 -1
  462. package/dist/needs-you.js +4 -8
  463. package/dist/needs-you.js.map +1 -1
  464. package/dist/office-share-page.js +1 -1
  465. package/dist/office-share-page.js.map +1 -1
  466. package/dist/outbound-handlers.d.ts +1 -0
  467. package/dist/outbound-handlers.js +25 -19
  468. package/dist/outbound-handlers.js.map +1 -1
  469. package/dist/outbound-schemas.d.ts +19 -0
  470. package/dist/outbound-schemas.js +23 -4
  471. package/dist/outbound-schemas.js.map +1 -1
  472. package/dist/profile-signins.d.ts +5 -0
  473. package/dist/profile-signins.js +1 -0
  474. package/dist/profile-signins.js.map +1 -1
  475. package/dist/queued-handoffs.d.ts +3 -1
  476. package/dist/queued-handoffs.js +1 -1
  477. package/dist/queued-handoffs.js.map +1 -1
  478. package/dist/runtime-build-info.js +6 -2
  479. package/dist/runtime-build-info.js.map +1 -1
  480. package/dist/runtime-cli.js +33 -11
  481. package/dist/runtime-cli.js.map +1 -1
  482. package/dist/runtime-client.d.ts +18 -2
  483. package/dist/runtime-client.js +84 -21
  484. package/dist/runtime-client.js.map +1 -1
  485. package/dist/runtime-credential-profiles.d.ts +36 -4
  486. package/dist/runtime-credential-profiles.js +82 -16
  487. package/dist/runtime-credential-profiles.js.map +1 -1
  488. package/dist/runtime-profile-ownership.d.ts +2 -2
  489. package/dist/runtime-profile-ownership.js +3 -3
  490. package/dist/runtime-profile-ownership.js.map +1 -1
  491. package/dist/runtime-protocol.d.ts +5 -3
  492. package/dist/runtime-protocol.js +4 -0
  493. package/dist/runtime-protocol.js.map +1 -1
  494. package/dist/runtime-remote-accounts.d.ts +72 -5
  495. package/dist/runtime-remote-accounts.js +293 -52
  496. package/dist/runtime-remote-accounts.js.map +1 -1
  497. package/dist/runtime-remote-setup.d.ts +2 -2
  498. package/dist/runtime-remote-setup.js +2 -2
  499. package/dist/runtime-remote-setup.js.map +1 -1
  500. package/dist/runtime-signin-transport.d.ts +22 -4
  501. package/dist/runtime-signin-transport.js +50 -12
  502. package/dist/runtime-signin-transport.js.map +1 -1
  503. package/dist/runtime-signin.d.ts +42 -0
  504. package/dist/runtime-signin.js +105 -9
  505. package/dist/runtime-signin.js.map +1 -1
  506. package/dist/runtime-transcript-source.d.ts +2 -0
  507. package/dist/runtime-transcript-source.js +23 -1
  508. package/dist/runtime-transcript-source.js.map +1 -1
  509. package/dist/runtime-windows-bridge.js +6 -1
  510. package/dist/runtime-windows-bridge.js.map +1 -1
  511. package/dist/scheduler/task-board.d.ts +1 -0
  512. package/dist/scheduler/task-board.js +10 -1
  513. package/dist/scheduler/task-board.js.map +1 -1
  514. package/dist/settings-api.d.ts +1 -0
  515. package/dist/settings-api.js +15 -8
  516. package/dist/settings-api.js.map +1 -1
  517. package/dist/settings-baseline.d.ts +3 -0
  518. package/dist/settings-baseline.js +2 -2
  519. package/dist/settings-baseline.js.map +1 -1
  520. package/dist/settings-effect.d.ts +3 -0
  521. package/dist/settings-effect.js +12 -2
  522. package/dist/settings-effect.js.map +1 -1
  523. package/dist/signin-keepalive.d.ts +31 -2
  524. package/dist/signin-keepalive.js +123 -12
  525. package/dist/signin-keepalive.js.map +1 -1
  526. package/dist/structured-signin-transport.d.ts +2 -2
  527. package/dist/structured-signin-transport.js +27 -6
  528. package/dist/structured-signin-transport.js.map +1 -1
  529. package/dist/structured-signin.d.ts +16 -2
  530. package/dist/structured-signin.js +59 -4
  531. package/dist/structured-signin.js.map +1 -1
  532. package/dist/task-board-tool.d.ts +0 -13
  533. package/dist/task-board-tool.js +42 -6
  534. package/dist/task-board-tool.js.map +1 -1
  535. package/dist/tool-receipt-output.d.ts +151 -0
  536. package/dist/tool-receipt-output.js +50 -0
  537. package/dist/tool-receipt-output.js.map +1 -0
  538. package/dist/topic-commands.js +2 -1
  539. package/dist/topic-commands.js.map +1 -1
  540. package/dist/transcript-jsonl.d.ts +24 -0
  541. package/dist/transcript-jsonl.js +72 -22
  542. package/dist/transcript-jsonl.js.map +1 -1
  543. package/dist/transcript-monitor.d.ts +5 -1
  544. package/dist/transcript-monitor.js +65 -3
  545. package/dist/transcript-monitor.js.map +1 -1
  546. package/dist/transcript-needles.d.ts +1 -1
  547. package/dist/transcript-needles.js +1 -1
  548. package/dist/transcript-records.d.ts +2 -1
  549. package/dist/transcript-records.js.map +1 -1
  550. package/dist/transcript-sources.d.ts +4 -0
  551. package/dist/transcript-sources.js +2 -0
  552. package/dist/transcript-sources.js.map +1 -1
  553. package/dist/ui/accounts-keepalive.js +15 -6
  554. package/dist/ui/accounts-manage.js +25 -5
  555. package/dist/ui/accounts-view.js +28 -24
  556. package/dist/ui/agent-details-settings.js +10 -1
  557. package/dist/ui/agent-proposals.js +22 -2
  558. package/dist/ui/agent-runtime-settings.js +3 -3
  559. package/dist/ui/backend-signin.js +4 -4
  560. package/dist/ui/chat-activity.js +2 -2
  561. package/dist/ui/cli-caps.js +7 -7
  562. package/dist/ui/credential-profile-select.js +32 -19
  563. package/dist/ui/fleet-canvas.js +5 -2
  564. package/dist/ui/fleet-office-card.js +4 -2
  565. package/dist/ui/fleet-org.js +2 -0
  566. package/dist/ui/hub-admin-rooms-strings.js +28 -0
  567. package/dist/ui/hub-admin-rooms.js +77 -0
  568. package/dist/ui/hub-assistant-admin-strings.js +26 -0
  569. package/dist/ui/hub-assistant-admin.js +85 -0
  570. package/dist/ui/hub-chat-store.js +8 -4
  571. package/dist/ui/hub-client.js +224 -33
  572. package/dist/ui/hub-enrolment-code.js +1 -1
  573. package/dist/ui/hub-grant-picker.js +100 -0
  574. package/dist/ui/hub-group-search.js +2 -2
  575. package/dist/ui/hub-invitations-strings.js +30 -0
  576. package/dist/ui/hub-invitations.js +108 -0
  577. package/dist/ui/hub-join-one-strings.js +4 -2
  578. package/dist/ui/hub-join-steps.js +5 -2
  579. package/dist/ui/hub-pairing-form-strings.js +48 -0
  580. package/dist/ui/hub-pilot-trust-strings.js +27 -0
  581. package/dist/ui/hub-pilot-trust.js +41 -0
  582. package/dist/ui/hub-room-composer.js +113 -0
  583. package/dist/ui/hub-room-favorites.js +90 -0
  584. package/dist/ui/hub-room-list.js +152 -0
  585. package/dist/ui/hub-room-members-strings.js +12 -0
  586. package/dist/ui/hub-room-members.js +104 -0
  587. package/dist/ui/hub-room-new-strings.js +46 -0
  588. package/dist/ui/hub-room-new.js +135 -0
  589. package/dist/ui/hub-room-presence.js +123 -0
  590. package/dist/ui/hub-room-settings-strings.js +26 -0
  591. package/dist/ui/hub-room-settings.js +134 -0
  592. package/dist/ui/hub-room-strings.js +222 -0
  593. package/dist/ui/hub-room-thread.js +262 -0
  594. package/dist/ui/hub-room-unread.js +51 -0
  595. package/dist/ui/hub-room-working.js +29 -0
  596. package/dist/ui/log-row.js +14 -5
  597. package/dist/ui/machine-signin.js +47 -14
  598. package/dist/ui/panel-details.js +6 -1
  599. package/dist/ui/panel-fleet.js +2 -2
  600. package/dist/ui/panel-hub.js +145 -59
  601. package/dist/ui/panel-needs.js +2 -0
  602. package/dist/ui/panel-settings.js +2 -2
  603. package/dist/ui/settings-hub-company-join.js +32 -11
  604. package/dist/ui/settings-hub-connection.js +9 -3
  605. package/dist/ui/settings-hub-member-address.js +205 -0
  606. package/dist/ui/settings-hub-section.js +4 -0
  607. package/dist/ui/settings-hub-web-address.js +233 -0
  608. package/dist/ui/settings-hub.js +16 -4
  609. package/dist/ui/shared/accounts-keepalive.css +8 -0
  610. package/dist/ui/shared/accounts-usage-pool.css +10 -0
  611. package/dist/ui/shared/accounts.css +9 -0
  612. package/dist/ui/shared/app-i18n.js +2 -2
  613. package/dist/ui/shared/app-needs.js +3 -0
  614. package/dist/ui/shared/app-shell.js +4 -1
  615. package/dist/ui/shared/app.css +43 -5
  616. package/dist/ui/shared/chat-render.js +10 -0
  617. package/dist/ui/shared/chat-thread.js +14 -5
  618. package/dist/ui/shared/hub-chat.css +17 -0
  619. package/dist/ui/shared/hub-grant-picker.css +4 -0
  620. package/dist/ui/shared/hub-rooms-u2.css +42 -0
  621. package/dist/ui/shared/hub-sharing.css +4 -0
  622. package/dist/ui/shared/model-observation.js +16 -0
  623. package/dist/ui/shared/stale-tab.css +6 -0
  624. package/dist/ui/shared/stale-tab.js +50 -0
  625. package/dist/ui/shared/view-strings.js +2 -2
  626. package/dist/ui/structured-signin.js +19 -6
  627. package/dist/ui/usage-pool.js +76 -0
  628. package/dist/usage/agent-output.d.ts +144 -0
  629. package/dist/usage/agent-output.js +75 -0
  630. package/dist/usage/agent-output.js.map +1 -0
  631. package/dist/usage/provider-alerts.d.ts +6 -0
  632. package/dist/usage/provider-alerts.js +6 -0
  633. package/dist/usage/provider-alerts.js.map +1 -1
  634. package/dist/usage/providers.d.ts +2 -2
  635. package/dist/usage/providers.js +60 -18
  636. package/dist/usage/providers.js.map +1 -1
  637. package/dist/usage/usage-api.d.ts +12 -0
  638. package/dist/usage/usage-api.js +39 -0
  639. package/dist/usage/usage-api.js.map +1 -1
  640. package/dist/web-api.d.ts +4 -0
  641. package/dist/web-api.js +32 -13
  642. package/dist/web-api.js.map +1 -1
  643. package/dist/web-backend-login.d.ts +4 -1
  644. package/dist/web-backend-login.js.map +1 -1
  645. package/dist/windows-cli-providers.js +5 -1
  646. package/dist/windows-cli-providers.js.map +1 -1
  647. package/dist/windows-cli-worker.d.ts +33 -1
  648. package/dist/windows-cli-worker.js +150 -10
  649. package/dist/windows-cli-worker.js.map +1 -1
  650. package/dist/windows-cli.d.ts +7 -1
  651. package/dist/windows-cli.js +19 -2
  652. package/dist/windows-cli.js.map +1 -1
  653. package/dist/workflow-templates/default.md +2 -2
  654. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ import { PilotTrustPrompt, pilotTrustCandidate } from "./hub-pilot-trust.js";
2
+ import { pt } from "./hub-pilot-trust-strings.js";
1
3
  /** Fleet-only company handoff; all fields live in the actual Settings section and use its shared confirmation card. */
2
4
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
5
  import { register, t } from "/assets/app-i18n.js";
@@ -47,7 +49,7 @@ const jw = (key, ...args) => t(`companyJoinWait.${key}`, ...args);
47
49
  const root = "/api/hub/member/company-join";
48
50
  const LOCAL_WAIT_MS = 5 * 60_000; // matches the Settings confirmation ceiling; never renew on a status read
49
51
  export const companyJoinEmbedV1 = true;
50
- export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded = false, onPairingCode } = {}) {
52
+ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded = false, onPairingCode, onOffer, pilotRevision = 0 } = {}) {
51
53
  const notified = useRef(null), submittedTarget = useRef(""), submittedHandoff = useRef(null);
52
54
  const shellState = useStore(appStore);
53
55
  const { hubJoinChanges = [] } = shellState;
@@ -88,13 +90,22 @@ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded =
88
90
  setProbe(p => p && p.address === kind.address ? p : null);
89
91
  const timer = setTimeout(() => runProbe(kind.address), 600);
90
92
  return () => clearTimeout(timer);
91
- }, [kind.kind, kind.address]);
93
+ }, [kind.kind, kind.address, pilotRevision]);
92
94
  useEffect(() => {
93
95
  if (view?.state !== "awaiting-sign-in" || !Number.isFinite(view.expiresAt)) return;
94
96
  const timer = setInterval(() => setNow(Date.now()), 1000);
95
97
  return () => clearInterval(timer);
96
98
  }, [view?.state, view?.expiresAt]);
97
99
  useEffect(() => { if (kind.kind === "pairing") onPairingCode?.({ address: kind.address || "", code: kind.code }); }, [kind.kind, kind.code, kind.address]);
100
+ // User decision 2aeecd58 (P6, "one way in"): the Hub typed here answered that it takes company sign-in, so the other
101
+ // join paths (the pairing-code form under Other ways) are not offered. Unknown (no answer yet, an untrusted
102
+ // certificate, an unreachable Hub) is not an offer: the pairing path stays (#3839's workaround).
103
+ // Lumen (alpha.4 leg P): pressing 「信任這個 Hub 並繼續」 goes straight on to company sign-in, so from that press a trusted
104
+ // self-signed Hub counts as one that takes company sign-in. A start that fails (no company sign-in, or any other refusal)
105
+ // puts it back to unknown, and the pairing path returns; the press counts only for the address it was made for.
106
+ const [trustedStart, setTrustedStart] = useState(null);
107
+ const offered = kind.kind === "address" && (!!probe?.ok && probe.address === kind.address && probe.companyJoin === true || trustedStart === kind.address);
108
+ useEffect(() => { onOffer?.(offered); }, [offered]);
98
109
  const read = () => {
99
110
  if (reading.current) return reading.current; // one physical status read, including Retry and slow networks
100
111
  const gen = token.current;
@@ -165,24 +176,25 @@ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded =
165
176
  if (control) control.focus(); else { card.tabIndex = -1; card.focus(); }
166
177
  };
167
178
  useEffect(() => { if ((!embedded || bound) && view?.state === "saved" && view.link === "online" && notified.current !== view.operationId) { notified.current = view.operationId; onSaved?.(); } }, [view, onSaved, embedded, bound]);
168
- const start = async e => {
169
- e.preventDefault(); if (busy || !ready) return;
179
+ const start = async (e, trust) => {
180
+ e.preventDefault(); if (busy || (!trust && !ready) || trust && (trust !== trustCandidate || probing)) return;
170
181
  const gen = ++token.current; setBusy(true); setError(null); setNotice(null); setPending(null); setIdentityChanged(false); setCode(""); setCodeError(null);
182
+ if (trust) setTrustedStart(kind.address);
171
183
  const handoffId = crypto.randomUUID(); submittedHandoff.current = handoffId;
172
184
  // Open the Fleet-owned waiting page during the user gesture, with no opener or cross-origin messaging.
173
185
  let target = ""; try { target = new URL(kind.address).origin; } catch {}
174
186
  submittedTarget.current = target;
175
187
  globalThis.open("/settings/hub?joinWait=" + encodeURIComponent(handoffId) + "&joinConsent=1#target=" + encodeURIComponent(target), "_blank", "noopener");
176
188
  try {
177
- const body = { address: kind.address, label: fleetLabel, handoffId, ...(kind.code ? { code: kind.code } : {}) };
189
+ const body = { address: kind.address, label: fleetLabel, handoffId, ...(kind.code ? { code: kind.code } : {}), ...(trust ? { trust: { fingerprint: trust.fingerprint, previous: trust.previous } } : {}) };
178
190
  const result = await confirmedWrite(root + "/start", { body, label: hj("title"), onPending: (id, change) => { if (live.current && gen === token.current) onPending(id, change); } });
179
191
  if (!live.current || gen !== token.current) return;
180
- if (!result.ok || !result.body?.operation) { await read();
192
+ if (!result.ok || !result.body?.operation) { if (trust) setTrustedStart(null); await read();
181
193
  if (result.confirmed?.state === "rejected" && result.confirmed.outcome?.reason_code === "withdrawn") { setError(null); setNotice(jw("localWithdrawn")); return; }
182
194
  const code = joinResponseCode(result); setError(result.confirmed?.state === "expired" ? jw("localExpired") : code === "conflict" ? jc("blocked") : joinError(code)); setIdentityChanged(code === "identity-changed"); return; }
183
195
  const operation = result.body.operation; setView(operation); setError(null);
184
196
 
185
- } catch { if (live.current && gen === token.current) setError(hj("unknown")); }
197
+ } catch { if (live.current && gen === token.current) { if (trust) setTrustedStart(null); setError(hj("unknown")); } }
186
198
  finally { if (live.current && gen === token.current) { setBusy(false); setPending(null); } }
187
199
  };
188
200
  const repair = async () => {
@@ -221,7 +233,13 @@ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded =
221
233
  const problem = kind.kind === "error" ? kind.error === "codeOnly" ? jc("codeOnly", kind.code) : j1(kind.error) : probe && !probe.none && probe.address === kind.address ? probeMessage(probe, host) : null;
222
234
  // Start once the probe for exactly this address has answered without a problem. A probe that could not answer at all
223
235
  // (no reason: a network error, an older server) does not block Start: Start makes the same checks itself.
236
+ const trustCandidate = probe?.address === kind.address ? pilotTrustCandidate(probe) : null;
224
237
  const ready = kind.kind === "address" && !problem && !probing && probe?.address === kind.address;
238
+ // #3837: an address the probe has already CLEARED (answered ok, nothing to say) is not looked up again on blur. A click on
239
+ // Start blurs the input, and that re-check disabled the button under the click (the click was lost). An address with no
240
+ // answer yet, a failed one (unreachable, certificate, not a Hub, limited) or one naming a problem is still asked again on
241
+ // blur (#3675's retry path); the forced look after a repair is unchanged.
242
+ const cleared = kind.kind === "address" && probe?.address === kind.address && (probe.ok === true && !problem || !!trustCandidate);
225
243
  const target = (() => { try { return pending?.target || (view && (!waiting || view.handoffId === waiting) ? view.hubOrigin : "") || (waiting ? new URLSearchParams(location.hash.slice(1)).get("target") || "" : new URL(kind.address).origin); } catch { return ""; } })();
226
244
  const inlineWait = consentWait || pending?.inline;
227
245
  const retired = embedded && !bound && view?.state === "saved" && view.outcomeKnown;
@@ -254,17 +272,19 @@ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded =
254
272
  ${waiting ? html`<a class="btn btn-sm" href="/settings/hub">${hj("return")}</a>` : null}</div>
255
273
  ${waiting ? html`<p class="note">${jw("leaveWait")}</p>` : null}
256
274
  </div>` : null}
257
- ${canStart ? html`<form class="form hub-join-one" onSubmit=${start}>
275
+ ${canStart ? html`<form class="form hub-join-one" onSubmit=${e => start(e)}>
258
276
  <label class="field" for="hubCompanyAddress"><span>${j1("input")}</span><input id="hubCompanyAddress" type="text" value=${form.address} placeholder=${j1("placeholder")} autocomplete="off" spellcheck=${false} autocapitalize="off"
259
277
  aria-describedby="hubCompanyLine" aria-invalid=${problem ? "true" : undefined} onInput=${e => setForm(f => ({ ...f, address: e.target.value }))}
260
- onPaste=${e => { const n = fromHandoffText(e.clipboardData?.getData("text")); if (n) { e.preventDefault(); setForm(f => ({ ...f, address: n })); } }} onBlur=${() => runProbe()} /></label>
261
- <p class="note hub-join-line" id="hubCompanyLine" role=${problem ? "alert" : "status"}>${problem ? problem
278
+ onPaste=${e => { const n = fromHandoffText(e.clipboardData?.getData("text")); if (n) { e.preventDefault(); setForm(f => ({ ...f, address: n })); } }} onBlur=${() => { if (!cleared) runProbe(); }} /></label>
279
+ <p class="note hub-join-line" id="hubCompanyLine" role=${problem ? "alert" : "status"}>${problem ? probe?.address === kind.address && probe?.selfSigned ? trustCandidate ? null : pt("disabled", host) : problem
262
280
  : kind.kind === "pairing" ? j1("otherPairing")
263
281
  : probing ? j1("probing")
264
282
  : probe?.ok && probe.address === kind.address ? html`${j1("found", probe.hubName || host, fleetLabel)}${kind.code ? ` ${jc("included")}` : ""} ${!renaming ? html`<button type="button" class="btn btn-ghost btn-sm hub-join-rename" onClick=${() => setRenaming(true)}>${j1("rename")}</button>` : null}`
265
283
  : !form.address.trim() ? jc("hint") : null}</p>
284
+ ${probe?.pilotTrusted && probe.address === kind.address ? html`<p class="note">${pt("trusted")}</p>` : null}
285
+ ${trustCandidate ? html`<${PilotTrustPrompt} trust=${trustCandidate} host=${host} busy=${busy || probing} onTrust=${e => start(e, trustCandidate)} onCancel=${() => { probeSeq.current++; setProbe(null); setForm(f => ({ ...f, address: "" })); }} />` : null}
266
286
  ${renaming ? html`<label class="field" for="hubCompanyFleetName"><span>${j1("label")}</span><input id="hubCompanyFleetName" value=${form.label} maxlength="120" placeholder=${probe?.suggestedLabel || hj("defaultFleet")} onInput=${e => setForm(f => ({ ...f, label: e.target.value }))} /></label>` : null}
267
- <div class="field-row"><button class="btn btn-primary" type="submit" disabled=${busy || !ready}>${j1("go")}</button></div>
287
+ ${!trustCandidate ? html`<div class="field-row"><button class="btn btn-primary" type="submit" disabled=${busy || !ready}>${j1("go")}</button></div>` : null}
268
288
  ${identityChanged || probe?.identity === "changed" && probe.address === kind.address ? html`<p class="note">${hj("repairLead")}</p><button class="btn btn-sm" type="button" disabled=${busy || kind.kind !== "address"} onClick=${repair}>${hj("repair")}</button>` : null}
269
289
  </form>` : null}
270
290
  ${view && !retired && (!waiting || view.handoffId === waiting || blocking) ? html`<div role="status" class=${view.foreign ? "hub-join-foreign" : undefined}><strong>${hj(view.state === "saved" ? view.link === "online" ? "saved" : "joining" : view.state === "awaiting-sign-in" ? "awaiting" : view.state === "cancelled" ? "cancelled" : view.state === "held" || view.state === "ended" ? "held" : "joining")}</strong>
@@ -275,6 +295,7 @@ export function CompanyJoinSettings({ onSaved, memberEnabled = false, embedded =
275
295
  ${view.issued && view.state !== "saved" ? html`<p class="note">${hj("issued")}</p>` : null}
276
296
  <div class="field-row">${view.state === "awaiting-sign-in" && !view.foreign ? html`<a class="btn btn-sm" href=${root + "/bridge?operationId=" + encodeURIComponent(view.operationId)} target="_blank" rel="noopener">${j1("reopen")}</a>` : null}${view.state === "held" && !["authority", "expired", "denied", "code-denied"].includes(view.reason) ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => action("resume")}>${hj("resume")}</button>` : null}
277
297
  ${!["saved", "cancelled", "ended"].includes(view.state) && (!view.foreign || view.state === "held") ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => action("cancel")}>${view.state === "awaiting-sign-in" ? j1("cancel") : hj("stop")}</button>` : null}
298
+ ${view.state === "held" && !view.foreign && ["unknown", "uncertain"].includes(view.reason) ? html`<button type="button" class="btn btn-sm hub-join-check" disabled=${busy} onClick=${read}>${hj("retry")}</button>` : null}
278
299
  ${view.hubOrigin ? html`<a class="btn btn-sm" href=${view.hubOrigin + "/ui/hub"} target="_blank" rel="noopener noreferrer">${hj("inspect")}</a>` : null}</div>
279
300
  </div>` : null}
280
301
  </${Frame}>`;
@@ -1,3 +1,4 @@
1
+ import { HubPilotTrustSettings } from "./hub-pilot-trust.js";
1
2
  /** Single connection card. Projections only; existing company, membership and exact pairing routes own every effect. */
2
3
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
4
  import { Skeleton, ErrorState } from "/assets/ui-states.js";
@@ -42,12 +43,15 @@ const validPairing = p => !!p && states.has(p.state) && (p.state === "unpaired"
42
43
  || p.state === "paired" && endpoint(p.hub?.memberOrigin) && endpoint(p.hub?.webOrigin) && /^[a-f0-9]{64}$/i.test(p.hub?.fingerprint?.digest || "") && ["online", "offline"].includes(p.link));
43
44
  const safeOrigin = p => { try { const value = p?.hub?.webOrigin, u = new URL(value); return u.protocol === "https:" && u.origin === value ? u.origin + "/ui/hub" : null; } catch { return null; } };
44
45
  export function HubConnectionSettings({ onMode } = {}) {
46
+ const [pilotRevision, setPilotRevision] = useState(0);
45
47
  const publicPage = globalThis.document?.body?.dataset?.publicLink === "1";
46
48
  const [view, setView] = useState(null), [error, setFailureCode] = useState(""), [busy, setBusy] = useState(false), [fallback, setFallback] = useState(typeof legacy.markMember !== "function");
47
49
  const [Company, setCompany] = useState(null), [Connect, setConnect] = useState(null), [pending, setPending] = useState(null);
48
50
  // M-2921 (spec 1.1 / 1.3): the company-join record of this connection (its address, label, Hub name, owner), the
49
51
  // pairing code handed over from the one input, and the held card's reconnect / remove.
50
52
  const [display, setDisplay] = useState(null), [prefill, setPrefill] = useState(null), [manualOpen, setManualOpen] = useState(false);
53
+ // User decision 2aeecd58 (P6): one way in — while the typed Hub takes company sign-in, Other ways is not shown.
54
+ const [companyOffered, setCompanyOffered] = useState(false);
51
55
  const [asking, setAsking] = useState(false), [cardError, setCardError] = useState(""), [cardNotice, setCardNotice] = useState("");
52
56
  // A reconnect's waiting tab: the join panel follows its handoff even while this pairing still reads held (it is started over in the same request).
53
57
  const joinWait = (() => { try { return !!new URLSearchParams(location.search).get("joinWait"); } catch { return false; } })();
@@ -162,14 +166,16 @@ export function HubConnectionSettings({ onMode } = {}) {
162
166
  <button type="button" class=${`btn ${paused ? "btn-primary" : "btn-ghost"}`} disabled=${busy || !!error} onClick=${() => change(paused)}>${hc(paused ? "resume" : "pause")}</button>${removeLink}</div>${removeAsk}
163
167
  ${paused ? html`<details class="s-ui-disclosure"><summary>${hc("settings")}</summary><p class="note">${hc("pausedSettings")}</p></details>` : connected}`
164
168
  : view ? html`${p.state === "held" && !joinWait ? html`<div class="hub-held"><strong>${hubName}</strong>${owner}
169
+ ${reconnectable && p.hold === "revoked" && j1("revokedHint") !== "joinOne.revokedHint" ? html`<p class="note hub-revoked-hint">${j1("revokedHint")}</p>` : null}
165
170
  ${reconnectable || removable ? html`<div class="field-row">${reconnectable ? display ? html`<button type="button" class="btn btn-primary" disabled=${busy} onClick=${() => card("reconnect")}>${j1("reconnect")}</button>`
166
171
  : html`<button type="button" class="btn btn-primary" onClick=${() => setManualOpen(true)}>${j1("reconnect")}</button>` : null}${removeLink}</div>${removeAsk}` : null}</div>` : null}
167
- ${p.state === "unpaired" || joinWait ? Company ? html`<${Company} embedded=${true} memberEnabled=${view.enabled} onSaved=${read} onPairingCode=${v => { setPrefill(v); setManualOpen(true); }} />` : html`<${Skeleton} variant="form" lines=${3} />`
172
+ ${p.state === "unpaired" || joinWait ? Company ? html`<${Company} embedded=${true} memberEnabled=${view.enabled} onSaved=${read} pilotRevision=${pilotRevision} onPairingCode=${v => { setPrefill(v); setManualOpen(true); }} onOffer=${setCompanyOffered} />` : html`<${Skeleton} variant="form" lines=${3} />`
168
173
  : p.state === "held" && display ? null : view.enabled ? connected : html`<p class="note">${hc("attention")}</p>`}
169
- <details class="s-ui-disclosure hub-connection-manual" open=${manualOpen} onToggle=${e => setManualOpen(e.target.open)}><summary>${p.state === "unpaired" ? j1("other") : hc("advanced")}</summary><div class="s-disclosure-body form"><p class="note">${hc("manualHint")}</p>
174
+ ${p.state === "unpaired" && companyOffered ? null : html`<details class="s-ui-disclosure hub-connection-manual" open=${manualOpen} onToggle=${e => setManualOpen(e.target.open)}><summary>${p.state === "unpaired" ? j1("other") : hc("advanced")}</summary><div class="s-disclosure-body form"><p class="note">${hc("manualHint")}</p>
170
175
  <label class="check"><input id="hubMemberEnabled" class="s-ui-toggle" type="checkbox" role="switch" checked=${view.enabled} disabled=${busy || !!error} onChange=${e => change(e.target.checked)} /><span>${hc("enabled")}</span></label>
171
176
  ${view.enabled && p.state === "unpaired" ? connected : null}
172
- </div></details>` : null}
177
+ </div></details>`}` : null}
178
+ <${HubPilotTrustSettings} onChanged=${() => setPilotRevision(v => v + 1)} />
173
179
  ${pending ? html`<div role="status" class="form"><p class="note">${hc("pending")}</p><button type="button" class="btn" onClick=${review}>${hc("review")}</button></div>` : null}
174
180
  </section>`;
175
181
  }
@@ -0,0 +1,205 @@
1
+ // #3429 (M-2901, option B): fleet Settings → Hub → "Fleet connection address", for this computer's host owner (the page
2
+ // mark; the server's D3 proof decides). Where connected Fleets reach this Hub — not the Hub address people use, which stays.
3
+ // Folded under its own disclosure: few ever change it. One field (+ where it listens, under Advanced), Check (prepare:
4
+ // the Fleets that will move are listed), one Confirm: Fleets online then follow on their own (an issuer-signed relocation);
5
+ // the rest must reconnect, and their owners get a notice. The certificate keeps its key (the server reissues its name).
6
+ // Own lazy module with its own words. Shared components: card, field, btn, note, err, s-web-ro, s-ui-disclosure, Skeleton.
7
+ import { html, useEffect, useState } from "/assets/app-html.js";
8
+ import { Skeleton, ErrorState } from "/assets/ui-states.js";
9
+ import { register, t } from "/assets/app-i18n.js";
10
+ import { api } from "./settings-confirm.js";
11
+ import { typedOrigin, shownAddress, defaultListen } from "./settings-hub-web-address.js";
12
+
13
+ register("hubMemberAddress", {
14
+ en: {
15
+ title: "Fleet connection address",
16
+ lead: "Where connected Fleets reach this Hub. Most Hubs never change it; the Hub address colleagues use stays the same.",
17
+ address: "Address", listens: "Listens on", fleets: "Connected Fleets", none: "None yet",
18
+ change: "Change connection address", newAddress: "New connection address", newHint: "https:// is added for you. If the port isn't 443, add a colon and the port number, for example :9443.",
19
+ advanced: "Advanced", listenHost: "Listen on (interface)", listenPort: "Port",
20
+ listenHint: "Where the Hub listens for Fleets on this computer. Usually the address's own port; change it only if a router or reverse proxy forwards another port.",
21
+ check: "Check", checking: "Checking…", cancel: "Cancel", back: "Back",
22
+ confirmTitle: "Change the Fleet connection address?", from: "From", to: "To",
23
+ moving: "Fleets that move ({0}):", noneMoving: "No Fleet is connected now.",
24
+ effect: "Fleets online now follow on their own. Any that are offline lose their connection and must reconnect from their own Settings → Hub; their owners get a notice. The Hub address and sign-ins stay the same.",
25
+ confirm: "Confirm change", saving: "Changing…",
26
+ allFollowed: "Done. All {0} Fleets followed to the new address.", oneFollowed: "Done. The Fleet followed to the new address.", noFleets: "Done. No Fleet was connected.",
27
+ sameKept: "Done. The address Fleets use didn't change; all {0} keep their connection.", sameKeptOne: "Done. The address Fleets use didn't change; the Fleet keeps its connection.",
28
+ connected: "Connected Fleets ({0}):",
29
+ sameEffect: "The address Fleets use doesn't change, only where the Hub listens on this computer. Connected Fleets keep their connection and reconnect on their own.",
30
+ someFollowed: "Done. {0} of {1} Fleets followed. These must reconnect from their own Settings → Hub: {2}.",
31
+ noneFollowed: "Done. No Fleet was online to follow. These must reconnect from their own Settings → Hub: {0}.",
32
+ unnamed: "a Fleet without a name", sep: ", ",
33
+ off: "Saved. The Hub is stopped; it uses the new address when it runs again.",
34
+ saved_unavailable: "Saved, but the Hub doesn't answer at the new address yet. Check that nothing else uses port {0} on this computer, then turn Run this Hub off and on.",
35
+ err_invalid: "That isn't a usable address. Use an https address such as hub.example.com:9443, and a port from 1 to 65535.",
36
+ err_port_conflict: "That is the Hub address or its port. Use a different address or port for Fleets.",
37
+ err_port_in_use: "Another program on this computer is using that port. Choose another port under Advanced.",
38
+ err_certificate: "The Hub's connection certificate can't cover that address. Check the address and try again.",
39
+ err_unchanged: "That is already the Fleet connection address.",
40
+ err_stale: "Something changed meanwhile (a Fleet connected, left or was revoked). Check again.",
41
+ err_expired: "That took too long. Check again.",
42
+ err_busy: "Another change is still finishing, or a device is finishing its sign-in. Try again in a moment.",
43
+ err_denied: "Only this computer's own dashboard can change it. Reload this page and try again.",
44
+ err_unavailable: "It can't be changed right now. Reload this page and try again.",
45
+ err_recovery: "The change didn't finish. Reload this page to see the current address.",
46
+ err_failed: "The address wasn't changed. Try again.",
47
+ },
48
+ "zh-TW": {
49
+ title: "Fleet 連接位址",
50
+ lead: "已連接的 Fleet 連到這個 Hub 的位址。大多數 Hub 不需要變更;同仁使用的 Hub 位址不會改變。",
51
+ address: "位址", listens: "監聽於", fleets: "已連接的 Fleet", none: "目前沒有",
52
+ change: "變更連接位址", newAddress: "新連接位址", newHint: "會自動加上 https://。如果連接埠不是 443,請加上冒號和連接埠號碼,例如 :9443。",
53
+ advanced: "進階", listenHost: "監聽介面", listenPort: "連接埠",
54
+ listenHint: "Hub 在這台電腦上監聽 Fleet 連接的位置。通常就是位址本身的連接埠;只有路由器或反向代理轉送其他連接埠時才需要變更。",
55
+ check: "檢查", checking: "檢查中…", cancel: "取消", back: "返回",
56
+ confirmTitle: "要變更 Fleet 連接位址嗎?", from: "原位址", to: "新位址",
57
+ moving: "會移動的 Fleet({0}):", noneMoving: "目前沒有已連接的 Fleet。",
58
+ effect: "目前在線上的 Fleet 會自動跟著移動。離線的 Fleet 會失去連接,需要在它自己的「設定 → Hub」重新連接,擁有者會收到通知。Hub 位址與登入狀態不變。",
59
+ confirm: "確認變更", saving: "變更中…",
60
+ allFollowed: "完成。全部 {0} 個 Fleet 都已跟著移動到新位址。", oneFollowed: "完成。這個 Fleet 已跟著移動到新位址。", noFleets: "完成。目前沒有已連接的 Fleet。",
61
+ sameKept: "完成。Fleet 使用的位址沒有變更,全部 {0} 個 Fleet 都保留連接。", sameKeptOne: "完成。Fleet 使用的位址沒有變更,這個 Fleet 保留連接。",
62
+ connected: "已連接的 Fleet({0}):",
63
+ sameEffect: "Fleet 使用的位址不變,只變更 Hub 在這台電腦上監聽的位置。已連接的 Fleet 會保留連接,並自動重新連接。",
64
+ someFollowed: "完成。{1} 個 Fleet 中有 {0} 個已跟著移動。以下 Fleet 需要在它自己的「設定 → Hub」重新連接:{2}。",
65
+ noneFollowed: "完成。沒有在線上的 Fleet 可以跟著移動。以下 Fleet 需要在它自己的「設定 → Hub」重新連接:{0}。",
66
+ unnamed: "未命名的 Fleet", sep: "、",
67
+ off: "已儲存。Hub 目前已停止,再次執行時會使用新位址。",
68
+ saved_unavailable: "已儲存,但 Hub 還沒有在新位址回應。請確認這台電腦上沒有其他程式使用 {0} 埠,再將「執行這個 Hub」關閉後重新開啟。",
69
+ err_invalid: "這不是可用的位址。請使用像 hub.example.com:9443 這樣的 https 位址,連接埠為 1 到 65535。",
70
+ err_port_conflict: "這是 Hub 位址或它的連接埠。請為 Fleet 改用其他位址或連接埠。",
71
+ err_port_in_use: "這台電腦上有其他程式正在使用這個連接埠。請在「進階」選擇其他連接埠。",
72
+ err_certificate: "Hub 的憑證無法涵蓋這個位址。請確認位址後再試一次。",
73
+ err_unchanged: "這已經是目前的 Fleet 連接位址。",
74
+ err_stale: "剛剛有變動(有 Fleet 連接、離開或被撤銷)。請再檢查一次。",
75
+ err_expired: "等候太久了,請再檢查一次。",
76
+ err_busy: "另一項變更還在完成中,或有裝置正在完成登入,請稍後再試。",
77
+ err_denied: "只有這台電腦自己的儀表板可以變更。請重新載入這個頁面後再試。",
78
+ err_unavailable: "目前無法變更。請重新載入這個頁面後再試。",
79
+ err_recovery: "變更沒有完成。請重新載入這個頁面查看目前的位址。",
80
+ err_failed: "位址沒有變更,請再試一次。",
81
+ },
82
+ });
83
+ const copy = (key, ...a) => t(`hubMemberAddress.${key}`, ...a);
84
+ const PREFIX = "/api/settings/hub/member-address";
85
+ const ERR = new Set(["invalid", "port_conflict", "port_in_use", "certificate", "unchanged", "stale", "expired", "busy", "denied", "unavailable", "recovery"]);
86
+ const errKey = (code) => `err_${ERR.has(code) ? code : "failed"}`;
87
+ const names = (fleets) => (fleets || []).map((f) => f.label || copy("unnamed")).join(copy("sep"));
88
+
89
+ export function createMemberAddressClient() {
90
+ const call = async (action, body) => {
91
+ try {
92
+ const r = await api(PREFIX + action, { credentials: "same-origin", cache: "no-store", ...(body === undefined ? {} : { method: "POST", body: JSON.stringify(body) }) });
93
+ return r.ok && r.body?.ok ? r.body : { ok: false, code: r.body?.code || "unavailable" };
94
+ } catch { return { ok: false, code: "unavailable" }; }
95
+ };
96
+ return { read: () => call(""), prepare: (candidate) => call("/prepare", candidate), commit: (ref) => call("/commit", { ref }) };
97
+ }
98
+
99
+ /** What a finished change says: who followed, and who must reconnect (by name). */
100
+ export function outcomeText(r, port) {
101
+ if (r.state === "off") return copy("off");
102
+ if (r.state === "saved_unavailable") return copy("saved_unavailable", String(port ?? ""));
103
+ const reconnect = Array.isArray(r.reconnect) ? r.reconnect : [], followed = Number(r.followed) || 0, total = followed + reconnect.length;
104
+ if (!total) return copy("noFleets");
105
+ if (!reconnect.length) return total === 1 ? copy(r.sameOrigin === true ? "sameKeptOne" : "oneFollowed") : copy(r.sameOrigin === true ? "sameKept" : "allFollowed", String(total));
106
+ if (!followed) return copy("noneFollowed", names(reconnect));
107
+ return copy("someFollowed", String(followed), String(total), names(reconnect));
108
+ }
109
+
110
+ export function HubMemberAddressSettings({ client: given = null } = {}) {
111
+ const [client] = useState(() => given || createMemberAddressClient());
112
+ const [view, setView] = useState(undefined); // undefined: reading; null: not offered; else { origin, listen, fleets }
113
+ const [step, setStep] = useState("show"); // show | edit | confirm
114
+ const [typed, setTyped] = useState(""), [host, setHost] = useState(""), [port, setPort] = useState(""), [touched, setTouched] = useState(false);
115
+ const [proposal, setProposal] = useState(null), [outcome, setOutcome] = useState(null), [busy, setBusy] = useState(false), [error, setError] = useState("");
116
+ const [attempt, setAttempt] = useState(0); // a failed first read retries in place (the shared ErrorState), no reload
117
+ useEffect(() => {
118
+ let live = true;
119
+ client.read().then((r) => { if (live) setView(r.ok && typeof r.origin === "string" ? r : r.code === "denied" ? null : { failed: true }); },
120
+ () => { if (live) setView({ failed: true }); });
121
+ return () => { live = false; };
122
+ }, [attempt]);
123
+ if (view === null) return null;
124
+ const head = html`<p class="note">${copy("lead")}</p>`; // the disclosure's summary is the title
125
+ const wrap = (body) => html`<section class="card hub-member-address" data-section="hub-member-address">
126
+ <details class="s-ui-disclosure" open=${step !== "show" || !!outcome || !!error}><summary>${copy("title")}</summary><div class="s-ui-disclosure-body">${body}</div></details></section>`;
127
+ if (view === undefined) return wrap(html`${head}<${Skeleton} variant="rows" lines=${3} />`);
128
+ if (view.failed) return wrap(html`${head}<${ErrorState} message=${copy("err_unavailable")} onRetry=${() => { setView(undefined); setAttempt((n) => n + 1); }} />`);
129
+
130
+ const origin = typedOrigin(typed);
131
+ const listen = touched ? { host: host.trim(), port: Number(port) } : defaultListen(view, origin || view.origin);
132
+ const touch = () => { if (!touched) { setTouched(true); setHost(listen.host); setPort(String(listen.port)); } };
133
+ const edit = () => { setStep("edit"); setTyped(""); setTouched(false); setError(""); setOutcome(null); };
134
+ const check = async (e) => {
135
+ e?.preventDefault?.();
136
+ if (busy) return;
137
+ if (!origin || !Number.isInteger(listen.port) || listen.port < 1 || listen.port > 65535 || !listen.host) { setError(copy("err_invalid")); return; }
138
+ if (origin === view.origin && listen.host === view.listen?.host && listen.port === view.listen?.port) { setError(copy("err_unchanged")); return; }
139
+ setBusy(true); setError("");
140
+ const r = await client.prepare({ origin, listen });
141
+ setBusy(false);
142
+ if (!r.ok) { setError(copy(errKey(r.code))); return; }
143
+ setProposal(r); setStep("confirm");
144
+ };
145
+ const confirm = async () => {
146
+ if (busy || !proposal) return;
147
+ setBusy(true); setError("");
148
+ const r = await client.commit(proposal.ref);
149
+ setBusy(false);
150
+ if (!r.ok) { setError(copy(errKey(r.code))); if (r.code === "expired" || r.code === "stale") { setProposal(null); setStep("edit"); } return; }
151
+ setOutcome(r); setStep("show");
152
+ // Connected now: only the Fleets that followed (the rest were disconnected and must reconnect).
153
+ const gone = new Set((Array.isArray(r.reconnect) ? r.reconnect : []).map((f) => f.id));
154
+ setView((v) => ({ ...v, origin: r.origin || proposal.summary?.to, listen: proposal.summary?.listen || v.listen,
155
+ fleets: (Array.isArray(v.fleets) ? v.fleets : []).filter((f) => !gone.has(f.id)) }));
156
+ setProposal(null);
157
+ };
158
+ const fleetCount = Array.isArray(view.fleets) ? view.fleets.length : 0;
159
+ const current = html`<dl class="s-web-ro hub-addr-now">
160
+ <dt>${copy("address")}</dt><dd><code>${shownAddress(view.origin)}</code></dd>
161
+ ${view.listen ? html`<dt>${copy("listens")}</dt><dd><code>${view.listen.host}:${view.listen.port}</code></dd>` : null}
162
+ <dt>${copy("fleets")}</dt><dd>${fleetCount ? String(fleetCount) : copy("none")}</dd>
163
+ </dl>`;
164
+ const err = error ? html`<p class="err" role="alert">${error}</p>` : null;
165
+
166
+ if (step === "confirm" && proposal) {
167
+ const s = proposal.summary || {}, moving = Array.isArray(s.fleets) ? s.fleets : [], same = s.fleetsRejoin === false;
168
+ return wrap(html`${head}<div class="hub-addr-confirm" role="group" aria-label=${copy("confirmTitle")}><h4>${copy("confirmTitle")}</h4>
169
+ <dl class="s-web-ro">
170
+ <dt>${copy("from")}</dt><dd>${shownAddress(s.from)}</dd>
171
+ <dt>${copy("to")}</dt><dd><strong>${shownAddress(s.to)}</strong></dd>
172
+ ${s.listen ? html`<dt>${copy("listens")}</dt><dd><code>${s.listen.host}:${s.listen.port}</code></dd>` : null}
173
+ </dl>
174
+ ${moving.length ? html`<p class="note hub-member-moving"><strong>${copy(same ? "connected" : "moving", String(moving.length))}</strong> ${moving.map((f, i) => html`<span key=${f.id} class="hub-member-fleet">${i ? copy("sep") : ""}${f.label || copy("unnamed")}</span>`)}</p>`
175
+ : html`<p class="note">${copy("noneMoving")}</p>`}
176
+ <p class="note hub-addr-effect">${copy(same ? "sameEffect" : "effect")}</p>
177
+ <div class="s-row">
178
+ <button type="button" class="btn btn-primary" disabled=${busy} onClick=${confirm}>${busy ? copy("saving") : copy("confirm")}</button>
179
+ <button type="button" class="btn" disabled=${busy} onClick=${() => { setProposal(null); setStep("edit"); setError(""); }}>${copy("back")}</button>
180
+ </div>
181
+ </div>${err}`);
182
+ }
183
+ if (step === "edit") {
184
+ return wrap(html`${head}${current}
185
+ <form class="form hub-addr-form" onSubmit=${check}>
186
+ <label class="field"><span>${copy("newAddress")}</span><input id="hubMemberNew" autocomplete="off" inputmode="url" value=${typed} disabled=${busy}
187
+ onInput=${(e) => { setTyped(e.target.value); setError(""); }} /><small class="note">${copy("newHint")}</small></label>
188
+ <details class="s-ui-disclosure hub-addr-advanced"><summary>${copy("advanced")}</summary><div class="s-ui-disclosure-body">
189
+ <div class="grid2">
190
+ <label class="field"><span>${copy("listenHost")}</span><input id="hubMemberHost" autocomplete="off" value=${listen.host} disabled=${busy} onInput=${(e) => { touch(); setHost(e.target.value); setError(""); }} /></label>
191
+ <label class="field"><span>${copy("listenPort")}</span><input id="hubMemberPort" type="number" inputmode="numeric" min="1" max="65535" step="1" value=${String(listen.port)} disabled=${busy}
192
+ onInput=${(e) => { touch(); setPort(e.target.value); setError(""); }} /></label>
193
+ </div>
194
+ <small class="note">${copy("listenHint")}</small>
195
+ </div></details>
196
+ <div class="s-row">
197
+ <button type="submit" class="btn btn-primary" disabled=${busy || !typed.trim()}>${busy ? copy("checking") : copy("check")}</button>
198
+ <button type="button" class="btn" disabled=${busy} onClick=${() => { setStep("show"); setError(""); }}>${copy("cancel")}</button>
199
+ </div>
200
+ </form>${err}`);
201
+ }
202
+ const done = outcome ? html`<p role="status" class=${outcome.state === "saved_unavailable" ? "err" : "note"}>${outcomeText(outcome, view.listen?.port)}</p>` : null;
203
+ return wrap(html`${head}${current}${done}
204
+ <div class="s-row"><button type="button" class="btn" id="hubMemberChange" onClick=${edit}>${copy("change")}</button></div>${err}`);
205
+ }
@@ -59,6 +59,10 @@ export function HubSection({ overPublicLink, hubHost, hubOrigin }) {
59
59
  ${hubHost && typeof document !== "undefined" && document.body?.dataset.hubDirectorySettings === "1"
60
60
  ? html`<${Lazy} load=${() => import("./settings-hub-directory.js")} pick=${m => m.HubDirectorySettings} />` : null}
61
61
  ${hubHost ? html`<${Lazy} load=${() => import("./settings-hub-run.js")} pick=${(m) => m.HubRunSettings} />
62
+ ${typeof document !== "undefined" && document.body?.dataset.hubWebAddress === "1"
63
+ ? html`<${Lazy} load=${() => import("./settings-hub-web-address.js")} pick=${(m) => m.HubWebAddressSettings} />` : null}
64
+ ${typeof document !== "undefined" && document.body?.dataset.hubMemberAddress === "1"
65
+ ? html`<${Lazy} load=${() => import("./settings-hub-member-address.js")} pick=${(m) => m.HubMemberAddressSettings} />` : null}
62
66
  <${Lazy} load=${() => import("./settings-hub-retention.js")} pick=${(m) => m.HubRetentionSettings} />
63
67
  <${Lazy} load=${() => import("./settings-hub-browser-certificate.js")} pick=${(m) => m.HubBrowserCertificateSettings} />
64
68
  <${Lazy} load=${() => import("./settings-hub-preview.js")} pick=${(m) => m.HubPreviewSettings} />` : null}