@songsid/agend 2.4.0-beta.25 → 2.4.0-beta.27

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 (523) hide show
  1. package/dist/agent-endpoint.d.ts +1 -0
  2. package/dist/agent-endpoint.js +5 -0
  3. package/dist/agent-endpoint.js.map +1 -1
  4. package/dist/agent-file-read.js +1 -1
  5. package/dist/agent-file-read.js.map +1 -1
  6. package/dist/agent-whats-new.js +4 -0
  7. package/dist/agent-whats-new.js.map +1 -1
  8. package/dist/auth-api.js +3 -1
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/kiro-auth-store.d.ts +15 -2
  11. package/dist/backend/kiro-auth-store.js +64 -0
  12. package/dist/backend/kiro-auth-store.js.map +1 -1
  13. package/dist/build-provenance.json +1 -1
  14. package/dist/channel/adapters/discord.js +4 -4
  15. package/dist/channel/adapters/discord.js.map +1 -1
  16. package/dist/channel/adapters/telegram.js +3 -3
  17. package/dist/channel/adapters/telegram.js.map +1 -1
  18. package/dist/channel/ipc-bridge.d.ts +7 -0
  19. package/dist/channel/ipc-bridge.js +45 -11
  20. package/dist/channel/ipc-bridge.js.map +1 -1
  21. package/dist/channel/mcp-server.js +3 -1
  22. package/dist/channel/mcp-server.js.map +1 -1
  23. package/dist/channel/mcp-tools.js +6 -4
  24. package/dist/channel/mcp-tools.js.map +1 -1
  25. package/dist/cli.js +35 -2
  26. package/dist/cli.js.map +1 -1
  27. package/dist/daemon.d.ts +64 -3
  28. package/dist/daemon.js +497 -102
  29. package/dist/daemon.js.map +1 -1
  30. package/dist/delivery-outbox.d.ts +107 -7
  31. package/dist/delivery-outbox.js +297 -9
  32. package/dist/delivery-outbox.js.map +1 -1
  33. package/dist/detached-fleet-stop.d.ts +40 -0
  34. package/dist/detached-fleet-stop.js +126 -0
  35. package/dist/detached-fleet-stop.js.map +1 -0
  36. package/dist/fleet-lock.d.ts +21 -0
  37. package/dist/fleet-lock.js +61 -2
  38. package/dist/fleet-lock.js.map +1 -1
  39. package/dist/fleet-manager.d.ts +502 -5
  40. package/dist/fleet-manager.js +2845 -228
  41. package/dist/fleet-manager.js.map +1 -1
  42. package/dist/fleet-windows-runtime.d.ts +39 -3
  43. package/dist/fleet-windows-runtime.js +208 -30
  44. package/dist/fleet-windows-runtime.js.map +1 -1
  45. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -1
  46. package/dist/general-knowledge/skills/hub/SKILL.md +17 -2
  47. package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
  48. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +102 -25
  49. package/dist/hub/admin-dashboard.js +1 -1
  50. package/dist/hub/admin-dashboard.js.map +1 -1
  51. package/dist/hub/agent-catalog.d.ts +1 -1
  52. package/dist/hub/agent-catalog.js +4 -3
  53. package/dist/hub/agent-catalog.js.map +1 -1
  54. package/dist/hub/agent-intro.d.ts +1 -1
  55. package/dist/hub/agent-intro.js +1 -1
  56. package/dist/hub/agent-intro.js.map +1 -1
  57. package/dist/hub/agent-pictures.d.ts +1 -1
  58. package/dist/hub/agent-pictures.js +4 -3
  59. package/dist/hub/agent-pictures.js.map +1 -1
  60. package/dist/hub/catalog.d.ts +2 -2
  61. package/dist/hub/catalog.js +16 -13
  62. package/dist/hub/catalog.js.map +1 -1
  63. package/dist/hub/client.js +16 -2
  64. package/dist/hub/client.js.map +1 -1
  65. package/dist/hub/compose/member.js +14 -2
  66. package/dist/hub/compose/member.js.map +1 -1
  67. package/dist/hub/compose/server.d.ts +1 -0
  68. package/dist/hub/compose/server.js +6 -3
  69. package/dist/hub/compose/server.js.map +1 -1
  70. package/dist/hub/fleet-updates.d.ts +2 -2
  71. package/dist/hub/fleet-updates.js +7 -5
  72. package/dist/hub/fleet-updates.js.map +1 -1
  73. package/dist/hub/fleet-versions.d.ts +1 -1
  74. package/dist/hub/fleet-versions.js +3 -2
  75. package/dist/hub/fleet-versions.js.map +1 -1
  76. package/dist/hub/group-policy/resources.d.ts +1 -1
  77. package/dist/hub/http/compose.js +59 -31
  78. package/dist/hub/http/compose.js.map +1 -1
  79. package/dist/hub/http/deps.d.ts +1 -0
  80. package/dist/hub/http/schema.js +4 -1
  81. package/dist/hub/http/schema.js.map +1 -1
  82. package/dist/hub/join/service.d.ts +6 -0
  83. package/dist/hub/join/service.js +10 -0
  84. package/dist/hub/join/service.js.map +1 -1
  85. package/dist/hub/member/room-ask.d.ts +7 -8
  86. package/dist/hub/member/room-ask.js +54 -13
  87. package/dist/hub/member/room-ask.js.map +1 -1
  88. package/dist/hub/member/room-post.d.ts +4 -0
  89. package/dist/hub/member/room-post.js +26 -1
  90. package/dist/hub/member/room-post.js.map +1 -1
  91. package/dist/hub/member/room-reaction-acks.d.ts +12 -0
  92. package/dist/hub/member/room-reaction-acks.js +44 -0
  93. package/dist/hub/member/room-reaction-acks.js.map +1 -0
  94. package/dist/hub/protocol.d.ts +62 -0
  95. package/dist/hub/protocol.js +5 -4
  96. package/dist/hub/protocol.js.map +1 -1
  97. package/dist/hub/quota.d.ts +2 -2
  98. package/dist/hub/quota.js +6 -4
  99. package/dist/hub/quota.js.map +1 -1
  100. package/dist/hub/read-statement.d.ts +6 -0
  101. package/dist/hub/read-statement.js +33 -0
  102. package/dist/hub/read-statement.js.map +1 -0
  103. package/dist/hub/recommendations.d.ts +1 -1
  104. package/dist/hub/recommendations.js +3 -2
  105. package/dist/hub/recommendations.js.map +1 -1
  106. package/dist/hub/representative.d.ts +2 -0
  107. package/dist/hub/representative.js +8 -4
  108. package/dist/hub/representative.js.map +1 -1
  109. package/dist/hub/roles/audit-details.d.ts +2 -0
  110. package/dist/hub/roles/audit-details.js +1 -1
  111. package/dist/hub/roles/audit-details.js.map +1 -1
  112. package/dist/hub/roles/authority.d.ts +8 -3
  113. package/dist/hub/roles/authority.js +144 -102
  114. package/dist/hub/roles/authority.js.map +1 -1
  115. package/dist/hub/roles/clock.js +6 -5
  116. package/dist/hub/roles/clock.js.map +1 -1
  117. package/dist/hub/roles/delegation.js +2 -2
  118. package/dist/hub/roles/delegation.js.map +1 -1
  119. package/dist/hub/roles/model.d.ts +5 -2
  120. package/dist/hub/roles/model.js +5 -4
  121. package/dist/hub/roles/model.js.map +1 -1
  122. package/dist/hub/roles/read.d.ts +2 -0
  123. package/dist/hub/roles/read.js +27 -6
  124. package/dist/hub/roles/read.js.map +1 -1
  125. package/dist/hub/roles/review.js +2 -2
  126. package/dist/hub/roles/review.js.map +1 -1
  127. package/dist/hub/room-history-model.d.ts +87 -0
  128. package/dist/hub/room-history-model.js +14 -0
  129. package/dist/hub/room-history-model.js.map +1 -0
  130. package/dist/hub/room-react-ack-model.d.ts +2 -0
  131. package/dist/hub/room-react-ack-model.js +3 -0
  132. package/dist/hub/room-react-ack-model.js.map +1 -0
  133. package/dist/hub/rooms/admin.d.ts +6 -0
  134. package/dist/hub/rooms/admin.js +33 -0
  135. package/dist/hub/rooms/admin.js.map +1 -1
  136. package/dist/hub/rooms/agents.d.ts +3 -1
  137. package/dist/hub/rooms/agents.js +47 -5
  138. package/dist/hub/rooms/agents.js.map +1 -1
  139. package/dist/hub/rooms/history.d.ts +8 -0
  140. package/dist/hub/rooms/history.js +31 -0
  141. package/dist/hub/rooms/history.js.map +1 -0
  142. package/dist/hub/rooms/schema.d.ts +2 -0
  143. package/dist/hub/rooms/schema.js +4 -0
  144. package/dist/hub/rooms/schema.js.map +1 -1
  145. package/dist/hub/rooms/service.d.ts +40 -20
  146. package/dist/hub/rooms/service.js +181 -50
  147. package/dist/hub/rooms/service.js.map +1 -1
  148. package/dist/hub/rooms/types.d.ts +2 -0
  149. package/dist/hub/server.js +15 -3
  150. package/dist/hub/server.js.map +1 -1
  151. package/dist/hub/session-epoch.js +2 -1
  152. package/dist/hub/session-epoch.js.map +1 -1
  153. package/dist/hub/settings-directory-decision.js +3 -2
  154. package/dist/hub/settings-directory-decision.js.map +1 -1
  155. package/dist/hub/settings-member-address-decision.js +2 -1
  156. package/dist/hub/settings-member-address-decision.js.map +1 -1
  157. package/dist/hub/settings-web-address-decision.js +2 -1
  158. package/dist/hub/settings-web-address-decision.js.map +1 -1
  159. package/dist/hub/store.d.ts +1 -0
  160. package/dist/hub/store.js +12 -4
  161. package/dist/hub/store.js.map +1 -1
  162. package/dist/hub/types.d.ts +4 -2
  163. package/dist/hub-agent-incarnation-record.d.ts +24 -0
  164. package/dist/hub-agent-incarnation-record.js +46 -0
  165. package/dist/hub-agent-incarnation-record.js.map +1 -0
  166. package/dist/human-delivery-receipts.d.ts +16 -4
  167. package/dist/human-delivery-receipts.js +26 -5
  168. package/dist/human-delivery-receipts.js.map +1 -1
  169. package/dist/instance-lifecycle.d.ts +9 -3
  170. package/dist/instance-lifecycle.js +27 -10
  171. package/dist/instance-lifecycle.js.map +1 -1
  172. package/dist/instructions.d.ts +1 -1
  173. package/dist/local-pane-endpoint.d.ts +14 -0
  174. package/dist/local-pane-endpoint.js +32 -0
  175. package/dist/local-pane-endpoint.js.map +1 -1
  176. package/dist/locale.js +54 -6
  177. package/dist/locale.js.map +1 -1
  178. package/dist/native-agent-admission.js +9 -0
  179. package/dist/native-agent-admission.js.map +1 -1
  180. package/dist/native-exec-context.d.ts +11 -0
  181. package/dist/native-exec-context.js +18 -0
  182. package/dist/native-exec-context.js.map +1 -0
  183. package/dist/native-exec-input.d.ts +56 -0
  184. package/dist/native-exec-input.js +89 -0
  185. package/dist/native-exec-input.js.map +1 -0
  186. package/dist/native-mcp.d.ts +9 -1
  187. package/dist/native-mcp.js +29 -7
  188. package/dist/native-mcp.js.map +1 -1
  189. package/dist/native-pane-lifecycle.d.ts +3 -0
  190. package/dist/native-pane-lifecycle.js +2 -0
  191. package/dist/native-pane-lifecycle.js.map +1 -1
  192. package/dist/native-pane-manager.d.ts +18 -0
  193. package/dist/native-pane-manager.js +85 -8
  194. package/dist/native-pane-manager.js.map +1 -1
  195. package/dist/needs-you.d.ts +2 -1
  196. package/dist/needs-you.js.map +1 -1
  197. package/dist/outbound-handlers.d.ts +1 -0
  198. package/dist/outbound-handlers.js +9 -3
  199. package/dist/outbound-handlers.js.map +1 -1
  200. package/dist/outbound-schemas.d.ts +5 -0
  201. package/dist/outbound-schemas.js +2 -0
  202. package/dist/outbound-schemas.js.map +1 -1
  203. package/dist/public-web-gateway.js +5 -1
  204. package/dist/public-web-gateway.js.map +1 -1
  205. package/dist/recover.cjs +213 -26
  206. package/dist/reply-buttons-controller.d.ts +1 -0
  207. package/dist/reply-buttons-controller.js +1 -1
  208. package/dist/reply-buttons-controller.js.map +1 -1
  209. package/dist/request-contact-gate.d.ts +2 -0
  210. package/dist/request-contact-gate.js +8 -3
  211. package/dist/request-contact-gate.js.map +1 -1
  212. package/dist/request-contact-native.js +4 -0
  213. package/dist/request-contact-native.js.map +1 -1
  214. package/dist/request-context-activation.d.ts +29 -0
  215. package/dist/request-context-activation.js +74 -0
  216. package/dist/request-context-activation.js.map +1 -0
  217. package/dist/request-context-admission.d.ts +22 -0
  218. package/dist/request-context-admission.js +12 -0
  219. package/dist/request-context-admission.js.map +1 -0
  220. package/dist/request-context-boot.d.ts +35 -0
  221. package/dist/request-context-boot.js +97 -0
  222. package/dist/request-context-boot.js.map +1 -0
  223. package/dist/request-context-call.d.ts +2 -0
  224. package/dist/request-context-call.js.map +1 -1
  225. package/dist/request-context-continuation.d.ts +6 -0
  226. package/dist/request-context-continuation.js +24 -0
  227. package/dist/request-context-continuation.js.map +1 -0
  228. package/dist/request-context-control-api.d.ts +101 -0
  229. package/dist/request-context-control-api.js +177 -0
  230. package/dist/request-context-control-api.js.map +1 -0
  231. package/dist/request-context-control-copy.d.ts +3 -0
  232. package/dist/request-context-control-copy.js +7 -0
  233. package/dist/request-context-control-copy.js.map +1 -0
  234. package/dist/request-context-controller.d.ts +44 -0
  235. package/dist/request-context-controller.js +129 -0
  236. package/dist/request-context-controller.js.map +1 -0
  237. package/dist/request-context-delivery-resolver.d.ts +13 -0
  238. package/dist/request-context-delivery-resolver.js +30 -0
  239. package/dist/request-context-delivery-resolver.js.map +1 -0
  240. package/dist/request-context-drain.d.ts +13 -0
  241. package/dist/request-context-drain.js +79 -6
  242. package/dist/request-context-drain.js.map +1 -1
  243. package/dist/request-context-enable-offer.d.ts +13 -0
  244. package/dist/request-context-enable-offer.js +31 -0
  245. package/dist/request-context-enable-offer.js.map +1 -0
  246. package/dist/request-context-exec-owner.d.ts +39 -0
  247. package/dist/request-context-exec-owner.js +128 -0
  248. package/dist/request-context-exec-owner.js.map +1 -0
  249. package/dist/request-context-go-back-view.d.ts +1 -0
  250. package/dist/request-context-go-back-view.js +17 -0
  251. package/dist/request-context-go-back-view.js.map +1 -0
  252. package/dist/request-context-helper-readiness.d.ts +14 -0
  253. package/dist/request-context-helper-readiness.js +23 -0
  254. package/dist/request-context-helper-readiness.js.map +1 -0
  255. package/dist/request-context-helper.d.ts +20 -0
  256. package/dist/request-context-helper.js +41 -0
  257. package/dist/request-context-helper.js.map +1 -0
  258. package/dist/request-context-hub-resolver.d.ts +29 -0
  259. package/dist/request-context-hub-resolver.js +90 -0
  260. package/dist/request-context-hub-resolver.js.map +1 -0
  261. package/dist/request-context-human-resolver.d.ts +20 -0
  262. package/dist/request-context-human-resolver.js +77 -0
  263. package/dist/request-context-human-resolver.js.map +1 -0
  264. package/dist/request-context-human.d.ts +106 -0
  265. package/dist/request-context-human.js +153 -0
  266. package/dist/request-context-human.js.map +1 -0
  267. package/dist/request-context-inputs.d.ts +21 -0
  268. package/dist/request-context-inputs.js +63 -0
  269. package/dist/request-context-inputs.js.map +1 -0
  270. package/dist/request-context-installation.d.ts +117 -0
  271. package/dist/request-context-installation.js +328 -0
  272. package/dist/request-context-installation.js.map +1 -0
  273. package/dist/request-context-knowledge.d.ts +5 -0
  274. package/dist/request-context-knowledge.js +32 -0
  275. package/dist/request-context-knowledge.js.map +1 -0
  276. package/dist/request-context-native-human.d.ts +20 -0
  277. package/dist/request-context-native-human.js +91 -0
  278. package/dist/request-context-native-human.js.map +1 -0
  279. package/dist/request-context-native-output.d.ts +15 -0
  280. package/dist/request-context-native-output.js +46 -0
  281. package/dist/request-context-native-output.js.map +1 -0
  282. package/dist/request-context-native-result.d.ts +15 -0
  283. package/dist/request-context-native-result.js +46 -0
  284. package/dist/request-context-native-result.js.map +1 -0
  285. package/dist/request-context-off.d.ts +22 -0
  286. package/dist/request-context-off.js +77 -0
  287. package/dist/request-context-off.js.map +1 -0
  288. package/dist/request-context-outside-label.d.ts +5 -0
  289. package/dist/request-context-outside-label.js +28 -0
  290. package/dist/request-context-outside-label.js.map +1 -0
  291. package/dist/request-context-pane.d.ts +8 -0
  292. package/dist/request-context-pane.js +19 -0
  293. package/dist/request-context-pane.js.map +1 -1
  294. package/dist/request-context-pending-work.d.ts +11 -0
  295. package/dist/request-context-pending-work.js +43 -0
  296. package/dist/request-context-pending-work.js.map +1 -0
  297. package/dist/request-context-policy.d.ts +17 -1
  298. package/dist/request-context-policy.js +84 -6
  299. package/dist/request-context-policy.js.map +1 -1
  300. package/dist/request-context-readiness.d.ts +49 -0
  301. package/dist/request-context-readiness.js +64 -0
  302. package/dist/request-context-readiness.js.map +1 -0
  303. package/dist/request-context-recovery.d.ts +6 -2
  304. package/dist/request-context-recovery.js +25 -0
  305. package/dist/request-context-recovery.js.map +1 -1
  306. package/dist/request-context-relay.d.ts +2 -2
  307. package/dist/request-context-relay.js +10 -10
  308. package/dist/request-context-relay.js.map +1 -1
  309. package/dist/request-context-retirement.d.ts +19 -0
  310. package/dist/request-context-retirement.js +16 -0
  311. package/dist/request-context-retirement.js.map +1 -0
  312. package/dist/request-context-start.d.ts +15 -0
  313. package/dist/request-context-start.js +2 -0
  314. package/dist/request-context-start.js.map +1 -0
  315. package/dist/request-context-turns.d.ts +1 -1
  316. package/dist/request-context-turns.js +3 -2
  317. package/dist/request-context-turns.js.map +1 -1
  318. package/dist/request-context-unproved-label.d.ts +4 -0
  319. package/dist/request-context-unproved-label.js +25 -0
  320. package/dist/request-context-unproved-label.js.map +1 -0
  321. package/dist/request-context-update-guard.d.ts +15 -0
  322. package/dist/request-context-update-guard.js +54 -0
  323. package/dist/request-context-update-guard.js.map +1 -0
  324. package/dist/request-context-work.d.ts +50 -0
  325. package/dist/request-context-work.js +178 -0
  326. package/dist/request-context-work.js.map +1 -0
  327. package/dist/request-hub-context.d.ts +1 -0
  328. package/dist/request-hub-output.d.ts +2 -0
  329. package/dist/request-hub-output.js +12 -0
  330. package/dist/request-hub-output.js.map +1 -1
  331. package/dist/retained-human-control.d.ts +11 -0
  332. package/dist/retained-human-control.js +11 -0
  333. package/dist/retained-human-control.js.map +1 -0
  334. package/dist/runtime-build-info.js +1 -1
  335. package/dist/runtime-build-info.js.map +1 -1
  336. package/dist/runtime-cli.js +1 -1
  337. package/dist/runtime-cli.js.map +1 -1
  338. package/dist/runtime-client-store.js +7 -1
  339. package/dist/runtime-client-store.js.map +1 -1
  340. package/dist/runtime-client.js +15 -3
  341. package/dist/runtime-client.js.map +1 -1
  342. package/dist/runtime-coordinator.d.ts +23 -0
  343. package/dist/runtime-coordinator.js +103 -4
  344. package/dist/runtime-coordinator.js.map +1 -1
  345. package/dist/runtime-pane-mcp.d.ts +9 -0
  346. package/dist/runtime-pane-mcp.js +22 -2
  347. package/dist/runtime-pane-mcp.js.map +1 -1
  348. package/dist/runtime-protocol.d.ts +2 -0
  349. package/dist/runtime-protocol.js.map +1 -1
  350. package/dist/runtime-update-controller.js +1 -1
  351. package/dist/runtime-update-controller.js.map +1 -1
  352. package/dist/runtime-windows-bridge.d.ts +8 -0
  353. package/dist/runtime-windows-bridge.js +50 -3
  354. package/dist/runtime-windows-bridge.js.map +1 -1
  355. package/dist/scheduler/scheduler.d.ts +9 -0
  356. package/dist/scheduler/scheduler.js +26 -0
  357. package/dist/scheduler/scheduler.js.map +1 -1
  358. package/dist/scheduler/scheduler.test.js +17 -0
  359. package/dist/scheduler/scheduler.test.js.map +1 -1
  360. package/dist/service-install-handover.d.ts +52 -0
  361. package/dist/service-install-handover.js +50 -0
  362. package/dist/service-install-handover.js.map +1 -0
  363. package/dist/service-installer.d.ts +12 -0
  364. package/dist/service-installer.js +24 -10
  365. package/dist/service-installer.js.map +1 -1
  366. package/dist/settings-api.d.ts +2 -0
  367. package/dist/settings-api.js +76 -0
  368. package/dist/settings-api.js.map +1 -1
  369. package/dist/settings-baseline.d.ts +1 -0
  370. package/dist/settings-baseline.js +5 -4
  371. package/dist/settings-baseline.js.map +1 -1
  372. package/dist/settings-change.js +13 -0
  373. package/dist/settings-change.js.map +1 -1
  374. package/dist/settings-confirmation.d.ts +2 -0
  375. package/dist/settings-confirmation.js +6 -0
  376. package/dist/settings-confirmation.js.map +1 -1
  377. package/dist/settings-effect.d.ts +2 -0
  378. package/dist/settings-effect.js +55 -2
  379. package/dist/settings-effect.js.map +1 -1
  380. package/dist/settings-http-confirmation.d.ts +3 -0
  381. package/dist/settings-http-confirmation.js +29 -0
  382. package/dist/settings-http-confirmation.js.map +1 -1
  383. package/dist/settings-route-lifetime.d.ts +3 -1
  384. package/dist/settings-route-lifetime.js +15 -5
  385. package/dist/settings-route-lifetime.js.map +1 -1
  386. package/dist/settings-transaction.d.ts +3 -2
  387. package/dist/settings-transaction.js.map +1 -1
  388. package/dist/tips.js +1 -1
  389. package/dist/tips.js.map +1 -1
  390. package/dist/tool-permissions.js +3 -3
  391. package/dist/tool-permissions.js.map +1 -1
  392. package/dist/tool-receipt-output.d.ts +6 -6
  393. package/dist/turn-reply-guard.d.ts +16 -1
  394. package/dist/turn-reply-guard.js +20 -2
  395. package/dist/turn-reply-guard.js.map +1 -1
  396. package/dist/ui/app.html +2 -2
  397. package/dist/ui/contact-auth-strings.js +13 -8
  398. package/dist/ui/contact-authorizations.js +19 -1
  399. package/dist/ui/contact-grant-editor.js +71 -11
  400. package/dist/ui/contact-needs.js +27 -8
  401. package/dist/ui/contact-permissions.js +34 -9
  402. package/dist/ui/contact-tool-groups.js +1 -1
  403. package/dist/ui/fleet-office-pack.d.ts +2 -2
  404. package/dist/ui/fleet-office-pack.js +25 -8
  405. package/dist/ui/fleet-office-vehicles.js +28 -11
  406. package/dist/ui/fleet-office-zones.js +2 -2
  407. package/dist/ui/fleet-office.js +25 -5
  408. package/dist/ui/hub-admin-rooms-strings.js +6 -2
  409. package/dist/ui/hub-admin-rooms.js +3 -1
  410. package/dist/ui/hub-client.js +3 -0
  411. package/dist/ui/hub-group-search.js +2 -2
  412. package/dist/ui/hub-notify-keep.js +49 -0
  413. package/dist/ui/hub-role-view.js +1 -1
  414. package/dist/ui/hub-roles-strings.js +14 -10
  415. package/dist/ui/hub-roles.js +1 -1
  416. package/dist/ui/hub-room-members.js +4 -2
  417. package/dist/ui/hub-room-notify.js +2 -1
  418. package/dist/ui/hub-room-settings-strings.js +8 -0
  419. package/dist/ui/hub-room-settings.js +32 -0
  420. package/dist/ui/hub-room-strings.js +3 -3
  421. package/dist/ui/hub-room-thread.js +16 -5
  422. package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
  423. package/dist/ui/icons/hub-favicon.ico +0 -0
  424. package/dist/ui/icons/hub-favicon.svg +10 -0
  425. package/dist/ui/icons/hub-icon-192.png +0 -0
  426. package/dist/ui/icons/hub-icon-512.png +0 -0
  427. package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
  428. package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
  429. package/dist/ui/icons/hub-maskable.svg +12 -0
  430. package/dist/ui/panel-hub.js +17 -5
  431. package/dist/ui/panel-needs.js +15 -6
  432. package/dist/ui/panel-settings.js +2 -1
  433. package/dist/ui/request-contact-card.js +287 -0
  434. package/dist/ui/request-contact-client.js +83 -0
  435. package/dist/ui/request-contact-page.js +78 -0
  436. package/dist/ui/request-context-control.js +171 -0
  437. package/dist/ui/settings-registry.js +2 -0
  438. package/dist/ui/settings-update.js +15 -1
  439. package/dist/ui/shared/app-install.js +123 -0
  440. package/dist/ui/shared/app-shell.js +17 -5
  441. package/dist/ui/shared/app-stream.js +1 -0
  442. package/dist/ui/shared/app-update.js +17 -2
  443. package/dist/ui/shared/app.css +136 -8
  444. package/dist/ui/shared/app.js +19 -2
  445. package/dist/ui/shared/hub-chat.css +6 -0
  446. package/dist/ui/shared/ui-confirm.js +4 -3
  447. package/dist/ui/shared/ui-icons.js +2 -0
  448. package/dist/ui/shared/ui-states.js +6 -0
  449. package/dist/ui/shared/update-card-ui.js +586 -0
  450. package/dist/ui/shared/view-strings.js +18 -0
  451. package/dist/ui/shared/web-authorize.js +1 -1
  452. package/dist/update-abandon.d.ts +26 -0
  453. package/dist/update-abandon.js +111 -0
  454. package/dist/update-abandon.js.map +1 -0
  455. package/dist/update-card.d.ts +1 -1
  456. package/dist/update-card.js +7 -7
  457. package/dist/update-card.js.map +1 -1
  458. package/dist/update-fix.d.ts +66 -0
  459. package/dist/update-fix.js +67 -0
  460. package/dist/update-fix.js.map +1 -0
  461. package/dist/update-forward.d.ts +5 -19
  462. package/dist/update-forward.js +19 -75
  463. package/dist/update-forward.js.map +1 -1
  464. package/dist/update-goback.d.ts +90 -0
  465. package/dist/update-goback.js +270 -0
  466. package/dist/update-goback.js.map +1 -0
  467. package/dist/update-journal.d.ts +8 -0
  468. package/dist/update-journal.js +8 -2
  469. package/dist/update-journal.js.map +1 -1
  470. package/dist/update-package-restore.d.ts +11 -2
  471. package/dist/update-package-restore.js +16 -5
  472. package/dist/update-package-restore.js.map +1 -1
  473. package/dist/update-quiescence.d.ts +38 -9
  474. package/dist/update-quiescence.js +50 -10
  475. package/dist/update-quiescence.js.map +1 -1
  476. package/dist/update-readiness.d.ts +2 -0
  477. package/dist/update-readiness.js +5 -1
  478. package/dist/update-readiness.js.map +1 -1
  479. package/dist/update-recovery/recover.js +10 -0
  480. package/dist/update-recovery/recover.js.map +1 -1
  481. package/dist/update-recovery/runner.d.ts +4 -0
  482. package/dist/update-recovery/runner.js +38 -5
  483. package/dist/update-recovery/runner.js.map +1 -1
  484. package/dist/update-restore.d.ts +7 -1
  485. package/dist/update-restore.js +10 -5
  486. package/dist/update-restore.js.map +1 -1
  487. package/dist/update-retained.d.ts +28 -1
  488. package/dist/update-retained.js +28 -3
  489. package/dist/update-retained.js.map +1 -1
  490. package/dist/update-settings.d.ts +27 -0
  491. package/dist/update-settings.js +40 -0
  492. package/dist/update-settings.js.map +1 -1
  493. package/dist/update-snapshot-scope.js +2 -0
  494. package/dist/update-snapshot-scope.js.map +1 -1
  495. package/dist/usage/i18n-keys.d.ts +1 -1
  496. package/dist/usage/i18n-keys.js +9 -0
  497. package/dist/usage/i18n-keys.js.map +1 -1
  498. package/dist/usage/providers.d.ts +3 -11
  499. package/dist/usage/providers.js +93 -131
  500. package/dist/usage/providers.js.map +1 -1
  501. package/dist/web-api.d.ts +4 -0
  502. package/dist/web-api.js +50 -7
  503. package/dist/web-api.js.map +1 -1
  504. package/dist/web-chat-history.d.ts +2 -0
  505. package/dist/web-chat-history.js.map +1 -1
  506. package/dist/web-icons.d.ts +20 -3
  507. package/dist/web-icons.js +76 -7
  508. package/dist/web-icons.js.map +1 -1
  509. package/dist/web-mentions.d.ts +27 -8
  510. package/dist/web-mentions.js +108 -1
  511. package/dist/web-mentions.js.map +1 -1
  512. package/dist/web-office-acts.js +3 -0
  513. package/dist/web-office-acts.js.map +1 -1
  514. package/dist/web-update.d.ts +9 -0
  515. package/dist/windows-agents.d.ts +24 -2
  516. package/dist/windows-agents.js +110 -4
  517. package/dist/windows-agents.js.map +1 -1
  518. package/dist/windows-cli-worker.js +9 -1
  519. package/dist/windows-cli-worker.js.map +1 -1
  520. package/dist/windows-cli.d.ts +15 -0
  521. package/dist/windows-cli.js +54 -6
  522. package/dist/windows-cli.js.map +1 -1
  523. package/package.json +2 -2
@@ -1,13 +1,70 @@
1
1
  // Shared, explicit contact-only scope editor. Identity/room/target are frozen from the ticket or existing row.
2
2
  import { html, useState } from "/assets/app-html.js";
3
3
  import { Dialog } from "/assets/ui-dialog.js";
4
- import { ca, contactPlatformLabel, contactPersonLabel, contactWhen } from "./contact-auth-strings.js";
4
+ import { ca, contactPlatformLabel, contactPersonLabel } from "./contact-auth-strings.js";
5
+ import { lang, register, t } from "/assets/app-i18n.js";
6
+ import { dateTimeText } from "/assets/clock-text.js";
5
7
  import { personKey } from "./contact-auth-client.js";
6
8
  export const CONTACT_VERBS = ["send_to_instance", "delegate_task", "request_information", "broadcast", "report_result"];
9
+
10
+ // M-3783: this editor's own words, in its own namespace (#4581 review): a tab that still holds an older
11
+ // contact-auth-strings.js reads them all the same, and an older editor keeps the shared, unchanged grantBoundary.
12
+ register("cgrant", {
13
+ en: {
14
+ boundary: "Until it expires, these people's requests of this type are forwarded to this agent without asking.",
15
+ moreTitle: "What this allows",
16
+ boundaryMore: "Only from this source to this agent, for this request type. It only decides whether a message is forwarded; what the receiving agent does with it still follows that agent's own permissions. To undo it, remove the rule in the agent's Permissions.",
17
+ allOrigins: "Several people's words are in this conversation: tick each person the rule is for.",
18
+ allOriginsMore: "A later request skips approval only when every person whose words it carries has a matching rule.",
19
+ },
20
+ "zh-TW": {
21
+ boundary: "到期前,這些人的這類請求會直接轉交給這個 Agent,不再詢問。",
22
+ moreTitle: "這會允許什麼",
23
+ boundaryMore: "只限從這個來源發給這個 Agent、這個請求類型。這只決定訊息能不能轉交;接收的 Agent 收到後要做什麼,仍照它自己的權限。要撤銷,到這個 Agent 的「權限」移除規則。",
24
+ allOrigins: "這個對話裡有多人的話:請勾選這條規則適用的每個人。",
25
+ allOriginsMore: "之後的請求,只有在它帶有的每個人都有符合的規則時,才會直接轉交。",
26
+ },
27
+ });
28
+ const cg = (key) => t(`cgrant.${key}`);
29
+ /**
30
+ * The expiry the selects describe, as one line: the long date and a 24-hour time in both languages, as the hour select
31
+ * (00–23) shows it, never "上午8:18" (#4581 follow-up). The editor's own format: it doesn't depend on the page's lang
32
+ * attribute, which the shared clock helpers read.
33
+ */
34
+ const untilText = (v) => {
35
+ const d = new Date(v);
36
+ return Number.isFinite(d.getTime()) ? d.toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en", { year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }) : "";
37
+ };
7
38
  const localTime = date => new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, 16);
8
39
  const afterDays = days => localTime(new Date(Date.now() + days * 86400000));
9
- export function ContactGrantEditor({ people, source, target, verb, grant = null, onSave, onClose }) {
10
- const [selected, setSelected] = useState(() => grant ? [personKey(grant.person)] : people.length === 1 ? [personKey(people[0])] : []);
40
+ const pad2 = n => String(n).padStart(2, "0");
41
+ const ymd = d => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
42
+ /**
43
+ * The expiry as a day and a 24-hour time from selects (#4497 capture check; M-3730: no native date/time input, whose
44
+ * format follows the browser, not the page — 12/03/2026, 07:40 AM on a zh-TW page). `value` is local "YYYY-MM-DDTHH:MM".
45
+ */
46
+ function UntilPicker({ value, disabled, onChange }) {
47
+ const [day = "", hm = ""] = String(value || "").split("T");
48
+ const [hh = "00", mm = "00"] = hm.split(":");
49
+ const start = new Date(); start.setHours(0, 0, 0, 0);
50
+ const days = Array.from({ length: 91 }, (_, i) => { const d = new Date(start); d.setDate(start.getDate() + i); return ymd(d); });
51
+ if (day && !days.includes(day)) days.push(day);
52
+ days.sort();
53
+ const zh = lang() === "zh-TW";
54
+ const dayLabel = v => { const [y, m, d] = v.split("-").map(Number); return dateTimeText(new Date(y, m - 1, d), { weekday: "short", year: "numeric", month: "short", day: "numeric" }, zh ? "zh-TW" : "en"); };
55
+ const minutes = ["00", "15", "30", "45"]; if (!minutes.includes(mm)) minutes.push(mm); minutes.sort();
56
+ const set = (d, h, m) => onChange(`${d}T${h}:${m}`);
57
+ return html`<span class="contact-until">
58
+ <select class="input" aria-label=${ca("untilDay")} value=${day} disabled=${disabled} onChange=${e => set(e.currentTarget.value, hh, mm)}>${days.map(v => html`<option value=${v}>${dayLabel(v)}</option>`)}</select>
59
+ <span class="contact-until-time"><select class="input" aria-label=${ca("untilHour")} value=${hh} disabled=${disabled} onChange=${e => set(day, e.currentTarget.value, mm)}>${Array.from({ length: 24 }, (_, i) => pad2(i)).map(v => html`<option value=${v}>${v}</option>`)}</select>
60
+ <span aria-hidden="true">:</span>
61
+ <select class="input" aria-label=${ca("untilMinute")} value=${mm} disabled=${disabled} onChange=${e => set(day, hh, e.currentTarget.value)}>${minutes.map(v => html`<option value=${v}>${v}</option>`)}</select></span>
62
+ </span>`;
63
+ }
64
+ // `keyOf` (M-3736 J): how a person is selected — the same-card contract's server-owned candidate key; by default the
65
+ // person's own [platform, userId] key, as before.
66
+ export function ContactGrantEditor({ people, source, target, verb, grant = null, onSave, onClose, keyOf = personKey, title = "" }) {
67
+ const [selected, setSelected] = useState(() => grant ? [personKey(grant.person)] : people.length === 1 ? [keyOf(people[0])] : []);
11
68
  const [preset, setPreset] = useState(grant ? "custom" : "7");
12
69
  const [until, setUntil] = useState(() => grant ? localTime(new Date(grant.expiresAt)) : afterDays(7));
13
70
  const [uses, setUses] = useState(grant?.remainingUses == null ? "" : String(grant.remainingUses));
@@ -26,24 +83,27 @@ export function ContactGrantEditor({ people, source, target, verb, grant = null,
26
83
  finally { setBusy(false); }
27
84
  };
28
85
  const toggle = (values, value, checked) => checked ? [...values, value] : values.filter(v => v !== value);
29
- return html`<${Dialog} title=${ca(grant ? "grantEdit" : people.length === 1 ? "allowPersonTitle" : "allowPeopleTitle")} busy=${busy} cls="contact-grant-dialog" onClose=${onClose}
86
+ return html`<${Dialog} title=${title || ca(grant ? "grantEdit" : people.length === 1 ? "allowPersonTitle" : "allowPeopleTitle")} busy=${busy} cls="contact-grant-dialog" onClose=${onClose}
30
87
  actions=${html`<button type="button" class="btn" disabled=${busy} onClick=${onClose}>${ca("cancel")}</button><button type="button" class="btn btn-primary" disabled=${busy || !valid} onClick=${save}>${ca(busy ? "saving" : grant ? "grantSave" : "allowAndApprove")}</button>`}>
31
88
  <p>${ca("grantRoute", source, target)}</p>
89
+ <p class="note contact-grant-boundary">${cg("boundary")}</p>
90
+ <details class="contact-grant-more"><summary>${cg("moreTitle")}</summary><p class="note">${cg("boundaryMore")}</p>
91
+ ${!grant && people.length > 1 ? html`<p class="note">${cg("allOriginsMore")}</p>` : null}</details>
32
92
  <section class="s-group" aria-label=${ca("grantPeople")}><h3>${ca("grantPeople")}</h3><div class="s-checks">
33
- ${people.map(person => html`<label class="check"><input type="checkbox" checked=${selected.includes(personKey(person))} disabled=${busy || !!grant}
34
- onChange=${e => setSelected(toggle(selected, personKey(person), e.currentTarget.checked))} /><span>${contactPersonLabel(person)} · ${contactPlatformLabel(person.platform)}</span></label>`)}
93
+ ${people.map(person => html`<label class="check"><input type="checkbox" checked=${selected.includes(keyOf(person))} disabled=${busy || !!grant}
94
+ onChange=${e => setSelected(toggle(selected, keyOf(person), e.currentTarget.checked))} /><span>${contactPersonLabel(person)} · ${contactPlatformLabel(person.platform)}</span></label>`)}
35
95
  </div></section>
36
- ${!grant && people.length > 1 ? html`<p class="note">${ca("grantAllOrigins")}</p>` : null}
96
+ ${!grant && !selected.length ? html`<p class="note contact-grant-pick">${ca("grantPickSomeone")}</p>` : null}
97
+ ${!grant && people.length > 1 ? html`<p class="note">${cg("allOrigins")}</p>` : null}
37
98
  ${grant ? html`<section class="s-group" aria-label=${ca("grantTypes")}><h3>${ca("grantTypes")}</h3><div class="s-checks">${CONTACT_VERBS.map(v => html`<label class="check"><input type="checkbox" checked=${verbs.includes(v)} disabled=${busy}
38
99
  onChange=${e => setVerbs(toggle(verbs, v, e.currentTarget.checked))} /><span>${ca(`verb_${v}`)}</span></label>`)}</div></section>` : html`<p>${ca("grantType", ca(`verb_${verb}`))}</p>`}
39
- <div class="grid2"><label class="field"><span>${ca("grantDuration")}</span><select class="input" value=${preset} disabled=${busy} onChange=${e => { const value = e.currentTarget.value; setPreset(value); if (value !== "custom") setUntil(afterDays(Number(value))); }}>
100
+ <div class="contact-grant-when"><label class="field"><span>${ca("grantDuration")}</span><select class="input" value=${preset} disabled=${busy} onChange=${e => { const value = e.currentTarget.value; setPreset(value); if (value !== "custom") setUntil(afterDays(Number(value))); }}>
40
101
  ${[1, 7, 30].map(n => html`<option value=${String(n)}>${n === 1 ? ca("grantOneDay") : ca("grantDays", n)}</option>`)}<option value="custom">${ca("grantCustom")}</option></select></label>
41
- <label class="field"><span>${ca("alsoAllowUntil")}</span><input class="input" type="datetime-local" value=${until} disabled=${busy} onInput=${e => { setPreset("custom"); setUntil(e.currentTarget.value); }} /></label></div>
42
- ${validUntil ? html`<p class="note contact-grant-expiry">${ca("grantExpires", contactWhen(until))}</p>` : null}
102
+ <div class="field"><span>${ca("alsoAllowUntil")}</span><${UntilPicker} value=${until} disabled=${busy} onChange=${v => { setPreset("custom"); setUntil(v); }} /></div></div>
103
+ ${validUntil ? html`<p class="note contact-grant-expiry">${ca("grantExpires", untilText(until))}</p>` : null}
43
104
  <p class="note">${ca("grantZone", Intl.DateTimeFormat().resolvedOptions().timeZone)}</p>
44
105
  <details open=${grant?.remainingUses === 0}><summary>${ca("grantAdvanced")}</summary><label class="field"><span>${ca("alsoAllowUses")}</span><input class="input" type="number" min="1" max="10000" inputmode="numeric" value=${uses} disabled=${busy} onInput=${e => setUses(e.currentTarget.value)} /></label></details>
45
106
  ${!validUntil ? html`<p class="err">${ca("grantFutureExpiry")}</p>` : !validUses ? html`<p class="err">${ca("grantValidUses")}</p>` : null}
46
- <p class="note">${ca("grantBoundary")}</p>
47
107
  ${grant ? html`<p class="note">${ca("grantEditScope")}</p>` : null}
48
108
  ${error ? html`<p class="err" role="alert">${error}</p>` : null}
49
109
  </${Dialog}>`;
@@ -18,23 +18,43 @@ import { ca } from "./contact-auth-strings.js";
18
18
  import { getPermissions, getTicket, putPermissions, dismissSuggestion } from "./contact-auth-client.js";
19
19
  import { TicketCard } from "./contact-authorizations.js";
20
20
  import { notCovered, wouldDisableMore, wouldDisableText } from "./contact-permissions.js";
21
+ // M-3736 J (S-228): where the same-card host is installed, a request's item is its one card (Sentinel, #4492: the item is
22
+ // an ordinary contact_request for every recognized managing admin, verified or not; no count-only line).
23
+ import { getCard, RC_ID, sameCardState } from "./request-contact-client.js";
24
+ import { RequestContactCard } from "./request-contact-card.js";
21
25
 
22
26
  const ID = /^[A-Za-z0-9_-]{1,64}$/;
23
27
 
24
28
  function RequestNeed({ item }) {
25
29
  const ref = item.contactTicket || {};
26
30
  const [tk, setTk] = useState(null);
31
+ const [host, setHost] = useState(null), [rc, setRc] = useState(null);
27
32
  // M-3680: the agents by the names the page shows them (the request card below does the same).
28
33
  const { instances } = useStore(appStore);
29
34
  const agent = (name) => (name ? labelOf((instances || []).find((i) => i.name === name) || { name }) : "");
30
35
  useEffect(() => {
31
36
  let live = true;
32
- if (ID.test(String(ref.id || ""))) void getTicket(ref.id).then((r) => { if (live && r.ok) setTk(r.data); });
37
+ // Today's scoped ticket read only where the host is known to be off; installed → the one card; not known → neither.
38
+ void sameCardState().then((s) => {
39
+ if (!live) return;
40
+ setHost(s);
41
+ if (s === "on" && RC_ID.test(String(ref.id || ""))) void getCard(ref.id).then((r) => { if (live && r.ok) setRc(r.data); });
42
+ else if (s === "off" && ID.test(String(ref.id || ""))) void getTicket(ref.id).then((r) => { if (live && r.ok) setTk(r.data); });
43
+ });
33
44
  return () => { live = false; };
34
45
  }, [ref.id]);
35
- return html`<div class="n-title"><strong>${ca("needsTitle", agent(ref.source), agent(ref.target))}</strong></div>
36
- ${tk ? html`<${TicketCard} ticket=${tk} onChange=${setTk} />` : null}
37
- <div class="n-actions">${ID.test(String(ref.id || "")) ? html`<a class="btn btn-sm btn-ghost" href=${`/ui/fleet/authorizations?ticket=${encodeURIComponent(ref.id)}`}>${ca("needsOpen")}</a>` : null}</div>`;
46
+ const open = ID.test(String(ref.id || "")) ? `/ui/fleet/authorizations?ticket=${encodeURIComponent(ref.id)}` : null;
47
+ // The same-card host: the item IS the one card (its own standard Needs-you layout, with Open in Authorizations).
48
+ if (host === "on" && rc) return html`<${RequestContactCard} card=${rc} onChange=${setRc} openHref=${open} />`;
49
+ return html`<${NeedShell} reason=${item.reason}><div class="n-title"><strong>${ca("needsTitle", agent(ref.source), agent(ref.target))}</strong></div>
50
+ ${host === "off" && tk ? html`<${TicketCard} ticket=${tk} onChange=${setTk} />` : null}
51
+ <div class="n-actions">${open ? html`<a class="btn btn-sm btn-ghost" href=${open}>${ca("needsOpen")}</a>` : null}</div></${NeedShell}>`;
52
+ }
53
+
54
+ /** A contact item's standard Needs-you frame (the key icon, then its body). */
55
+ function NeedShell({ reason, children }) {
56
+ return html`<article data-trust="permission" class="n-item contact-need" data-reason=${reason}>
57
+ <span class="n-icon"><${Icon} name="key" size=${18} /></span><div class="n-body">${children}</div></article>`;
38
58
  }
39
59
 
40
60
  function SuggestionNeed({ item }) {
@@ -98,8 +118,7 @@ export function ContactSuggestionsGroup({ items }) {
98
118
 
99
119
  /** One contact item of Needs you (item.type "contact"); null for a reason this page doesn't know. */
100
120
  export function ContactNeedsItem({ item }) {
101
- const body = item.reason === "contact_request" ? html`<${RequestNeed} item=${item} />` : item.reason === "contact_restricted_suggestion" ? html`<${SuggestionNeed} item=${item} />` : null;
102
- if (!body) return null;
103
- return html`<article data-trust="permission" class="n-item contact-need" data-reason=${item.reason}>
104
- <span class="n-icon"><${Icon} name="key" size=${18} /></span><div class="n-body">${body}</div></article>`;
121
+ if (item.reason === "contact_request") return html`<${RequestNeed} item=${item} />`; // its own frame (or the one card)
122
+ if (item.reason !== "contact_restricted_suggestion") return null;
123
+ return html`<${NeedShell} reason=${item.reason}><${SuggestionNeed} item=${item} /></${NeedShell}>`;
105
124
  }
@@ -20,6 +20,17 @@ import { ContactGrantEditor } from "./contact-grant-editor.js";
20
20
  import { REASONS } from "./contact-authorizations.js";
21
21
  import { groupWouldDisable } from "./contact-tool-groups.js";
22
22
  import { dateTimeText } from "/assets/clock-text.js";
23
+ import { register, t } from "/assets/app-i18n.js";
24
+ import { AuthorizeChip } from "/assets/web-authorize.js";
25
+ // M-3736 J (S-228, design #4456 §6): once the same-card host is installed, Clear retained origin is no longer a way out —
26
+ // each request is judged on its own card — so its button and the notes that point to it go; what it did stays as history.
27
+ import { sameCardState } from "./request-contact-client.js";
28
+
29
+ register("rcperm", {
30
+ en: { originHistory: "Retained origin (history)", originHistoryNote: "Contact requests are now judged one request at a time, on their own card. What this agent retained, and any earlier clearing, stays here as history." },
31
+ "zh-TW": { originHistory: "保留的來源(歷史)", originHistoryNote: "聯絡申請現在逐筆在各自的卡片上判斷。這個 Agent 先前保留的來源,以及之前的清除紀錄,會留在這裡作為歷史。" },
32
+ });
33
+ const tq = (k) => t(`rcperm.${k}`);
23
34
 
24
35
  const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, []) : ""; };
25
36
  /** A3's guard reason codes (ContactGuardStatus.reason), each said in words (contact-auth-strings.js guardReason_<code>). */
@@ -36,6 +47,13 @@ const GUARD_TONE = { ready: "ok", "restart-required": "warn", "not-covered": "wa
36
47
  /** The guard's state as said — anything the contract doesn't name is never shown as ready. */
37
48
  const guardState = (g) => (g && ["ready", "restart-required", "not-covered", "failed"].includes(g.state) ? g.state : "failed");
38
49
  const personLabel = (p) => (p && (p.label || p.userId)) || "";
50
+ /** M-3818: who may clear a retained origin, said when this viewer can't — the agent's managing admins (its eligible
51
+ * approvers, the server's list) and the verified host operator, who manages every local agent. */
52
+ const isOperator = (x) => x?.platform === "host" && x.adapterId === "host" && x.userId === "operator";
53
+ const clearWho = (people) => {
54
+ const names = (people || []).filter((x) => !isOperator(x)).map(personLabel).filter(Boolean);
55
+ return names.length ? ca("originClearWho", names.join(ca("originNameSep"))) : ca("originClearWhoHost");
56
+ };
39
57
 
40
58
  /** Keep `name`'s permissions read: once, on its contact-auth frame (a newer revision), and when the page is shown again. */
41
59
  export function usePermissions(name) {
@@ -103,10 +121,16 @@ export function ContactPermissionsPanel({ name }) {
103
121
  const [mcpDraft, setMcpDraft] = useState("");
104
122
  const [pick, setPick] = useState("");
105
123
  const [editing, setEditing] = useState(null), [grantFilter, setGrantFilter] = useState("");
124
+ // Clear retained origin is offered only where the host is known to be off (404); installed or not known, it isn't.
125
+ const [host, setHost] = useState(null);
126
+ useEffect(() => { let live = true; void sameCardState().then((s) => { if (live) setHost(s); }); return () => { live = false; }; }, []);
127
+ const sameCard = host === "on", clearOffered = host === "off";
106
128
  const p = perm.data;
107
129
  useEffect(() => { setEditing(null); }, [name, p?.revision]);
108
130
  if (!p && perm.loading !== false && !perm.error) return html`<${Skeleton} lines=${5} label=${ca("loading")} />`;
109
- if (!p) return perm.error === "verification-required" ? html`<p class="note contact-verify">${ca("verifyFirst")}</p>`
131
+ // M-3864 R6: the way to authorize, or why this browser can't be and where to fix that (a code sign-in: /web from the chat).
132
+ if (!p) return perm.error === "verification-required" ? html`<div class="contact-verify"><p class="note">${ca("verifyFirst")}</p><${AuthorizeChip} />
133
+ <button type="button" class="btn btn-sm" onClick=${() => void perm.read()}>${ca("retry")}</button></div>`
110
134
  : perm.error === "forbidden" ? html`<p class="note contact-forbidden">${ca("forbidden")}</p>`
111
135
  : html`<${ErrorState} message=${ca(perm.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void perm.read()} />`;
112
136
  // Who may change what (the server says; Sentinel's seam): the source room's admins its mode and tools (canSetMode); the
@@ -133,9 +157,9 @@ export function ContactPermissionsPanel({ name }) {
133
157
  if (ok) await write({ mode });
134
158
  };
135
159
  const clearRetainedOrigin = async () => {
136
- if (busy || !p.originState?.canClear) return;
160
+ if (busy || !p.originState?.canClear || !clearOffered) return;
137
161
  setBusy(true);
138
- const confirmed = await confirmDialog({ title: ca("originClear"), message: ca("originClearConfirm"),
162
+ const confirmed = await confirmDialog({ title: ca("originClear"), message: ca(p.classicRoom ? "originClearConfirm" : "originClearConfirmAgent"),
139
163
  confirmLabel: ca("originClear"), danger: true });
140
164
  if (!confirmed) { setBusy(false); return; }
141
165
  const r = await clearOrigin(name, { revision: p.revision, originRevision: p.originState.revision, generation: p.originState.generation });
@@ -157,7 +181,7 @@ export function ContactPermissionsPanel({ name }) {
157
181
  const shownGrants = p.grants.filter(gr => (gr.person.label || gr.person.userId).toLocaleLowerCase().includes(grantFilter.toLocaleLowerCase()));
158
182
  return html`<div class="contact-perm" aria-busy=${busy ? "true" : undefined}>
159
183
  ${p.originRestriction?.active && REASONS.has(p.originRestriction.reason) ? html`<p class="feedback warning contact-origin-restriction" role="status" data-reason=${p.originRestriction.reason}>
160
- ${ca(`reason_${p.originRestriction.reason}`)} ${ca("resetNote")}</p>` : null}
184
+ ${ca(`reason_${p.originRestriction.reason}`)}${clearOffered ? html` ${ca("resetNote")}` : ""}</p>` : null}
161
185
  ${!canManage && !canMode ? html`<p class="s-info contact-readonly"><span aria-hidden="true">ⓘ</span><span>${ca("readOnly")}</span></p>` : null}
162
186
  ${p.classicRoom ? html`<section class="card contact-mode" data-mode=${p.mode}>
163
187
  <h3>${ca("modeTitle")}</h3>
@@ -230,17 +254,18 @@ export function ContactPermissionsPanel({ name }) {
230
254
  </section>
231
255
  ${editing && editing.revision === p.revision && canManage ? html`<${ContactGrantEditor} key=${`${name}:${p.revision}:${editing.grant.id}`} grant=${editing.grant} people=${[editing.grant.person]} source=${agentLabel(editing.grant.source)} target=${agentLabel(editing.grant.target)}
232
256
  onClose=${() => setEditing(null)} onSave=${choice => grantsWrite(p.grants.map(row => row.id === editing.grant.id ? { ...row, expiresAt: choice.expiresAt, remainingUses: choice.remainingUses, verbs: choice.verbs } : row))} />` : null}
233
- ${p.originState ? html`<section class="card contact-origin">
234
- <h3>${ca("originTitle")}</h3>
257
+ ${p.originState ? html`<section class=${`card contact-origin${sameCard ? " contact-origin-history" : ""}`}>
258
+ <h3>${sameCard ? tq("originHistory") : ca("originTitle")}</h3>
235
259
  <p class="contact-origin-state"><strong>${ca(`originKind_${p.originState.kind}`)}</strong></p>
236
- <p class="note">${ca("originRetainedNote")}</p>
260
+ <p class="note">${sameCard ? tq("originHistoryNote") : ca("originRetainedNote")}</p>
237
261
  <p>${ca("originPeople")}</p>
238
262
  ${p.originState.people.length ? html`<ul class="contact-list contact-origin-people">${p.originState.people.map((person) => html`<li key=${`${person.platform}:${person.adapterId}:${person.userId}`}>
239
263
  <strong>${personLabel(person)}</strong> <span class="muted">${person.platform} · ${person.adapterId} · ${person.userId}</span></li>`)}</ul>` : html`<p class="note">${ca("originPeopleNone")}</p>`}
240
264
  <p class="contact-origin-chain">${ca("originChain")}: ${p.originState.chain.length ? p.originState.chain.join(" → ") : ca("originChainNone")}</p>
241
- <p class="note">${ca("originReceipts", p.originState.receiptCount)}</p>
265
+ <p class="note">${ca(p.originState.receiptCount === 1 ? "originReceipt" : "originReceipts", p.originState.receiptCount)}</p>
242
266
  ${p.originState.lastCleared ? html`<p class="contact-origin-last">${ca("originLastCleared", personLabel(p.originState.lastCleared.actor), when(p.originState.lastCleared.at))}</p>` : null}
243
- ${p.originState.canClear ? html`<button type="button" class="btn btn-sm btn-danger contact-origin-clear" disabled=${busy} onClick=${() => void clearRetainedOrigin()}>${ca("originClear")}</button>` : null}
267
+ ${p.originState.canClear && clearOffered ? html`<button type="button" class="btn btn-sm btn-danger contact-origin-clear" disabled=${busy} onClick=${() => void clearRetainedOrigin()}>${ca("originClear")}</button>` : null}
268
+ ${clearOffered && !p.originState.canClear && p.originState.kind !== "none" ? html`<p class="note contact-origin-who">${clearWho(p.eligibleApprovers)}</p>` : null}
244
269
  </section>` : null}
245
270
  <section class="card contact-history">
246
271
  <h3>${ca("historyTitle")}</h3>
@@ -22,7 +22,7 @@ export const TOOL_GROUPS = Object.freeze([
22
22
  "preview_web_appearance", "set_web_widget", "remove_web_widget", "set_web_ambient", "clear_web_ambient", "office_view", "office_set",
23
23
  "office_set_style", "office_pack_check", "office_pack_list", "office_pack_upload", "office_pack_delete", "office_pack_restore"] },
24
24
  { id: "repos", tools: ["checkout_repo", "release_repo", "deploy_template", "teardown_deployment", "list_deployments"] },
25
- { id: "hub", tools: ["hub_room_list", "hub_room_post", "hub_room_members", "hub_people_search", "hub_set_intro"] },
25
+ { id: "hub", tools: ["hub_room_list", "hub_room_post", "hub_room_members", "hub_room_history", "hub_people_search", "hub_set_intro"] },
26
26
  ].map((g) => Object.freeze({ id: g.id, tools: Object.freeze(g.tools) })));
27
27
 
28
28
  const GROUP_OF = new Map(TOOL_GROUPS.flatMap((g) => g.tools.map((tool) => [tool, g.id])));
@@ -19,7 +19,7 @@ export interface PackStrip {
19
19
  }
20
20
  export interface PackPoint { x: number; y: number }
21
21
  /** #2691: a seat reserved for `for` (lent while they are all elsewhere when `lend`); a plain seat has neither. */
22
- export interface PackSeat extends PackPoint { for?: string[]; lend?: boolean }
22
+ export interface PackSeat extends PackPoint { for?: string[]; lend?: boolean; standFacing?: "up" | "down" | "left" | "right" }
23
23
  export interface PackArea { name: string; rect: { x: number; y: number; w: number; h: number }; seats: PackSeat[] }
24
24
  /** `label` (#2574): its name tag, or null. `activeOn`/`hides` (#2698): when it turns active, and whether it hides its people then. */
25
25
  export interface PackFurniture { id: string; sprite: PackStrip; x: number; y: number; depth: number | "y"; activeWhen: string[] | null; activeSprite: PackStrip | null;
@@ -156,6 +156,6 @@ export function stripBox(st: PackStrip, x: number, y: number, mirror?: boolean):
156
156
  export interface PackVehicle {
157
157
  id: string; label?: string; sprite: PackStrip | null; sprites?: Partial<Record<"right" | "left" | "up" | "down", PackStrip>>;
158
158
  fronts?: Partial<Record<"right" | "left" | "up" | "down", PackStrip>>;
159
- path: PackPoint[]; speed: number; stops: Array<{ at: number; seconds: number; platform: PackPoint }>; seats: Array<{ dx: number; dy: number }>;
159
+ path: PackPoint[]; speed: number; stops: Array<{ at: number; seconds: number; platform: PackPoint; queue?: PackPoint[] }>; seats: Array<{ dx: number; dy: number; worker?: string }>;
160
160
  }
161
161
  export const VEHICLE_LIMITS: { vehicles: number; path: number; stops: number; seats: number; minSpeed: number; maxSpeed: number; defaultSpeed: number; maxSeconds: number; defaultSeconds: number; offset: number };
@@ -31,7 +31,9 @@
31
31
  // of them comes to the area takes it first, and nobody else does
32
32
  // unless "lend" (default false) lends it while they are all
33
33
  // elsewhere (a borrower moves off when one comes). A checked
34
- // seat is { x, y } — plus, reserved, `for` and `lend`
34
+ // seat is { x, y } — plus, reserved, `for` and `lend`; (#4503)
35
+ // "standFacing": "up" | "down" | "left" | "right" makes it a
36
+ // standing desk: whoever works there stands facing that way
35
37
  // "stateZones": { "working": "desks", "idle": "lounge", "needs": "alert", "default": "lounge" },
36
38
  // the org chart's states (fleet-org.js ORG_STATES) → an area; a
37
39
  // state it does not name goes to "default", else the first area
@@ -405,15 +407,20 @@ function owners(v, at, empty = false) {
405
407
  /**
406
408
  * A seat (#2691): [x, y], or { x, y, for, lend } — reserved for `for` (lent to anyone while they are all elsewhere when
407
409
  * `lend`). Checked: { x, y }, with `for` and `lend` only when reserved, so a plain seat is what it always was.
410
+ * `standFacing` (#4503): a standing desk — whoever works there stands facing that way (their walk strip's first frame).
408
411
  */
409
412
  function seatOf(v, at, rect) {
410
413
  let p = null, extra = {};
411
414
  if (isObj(v)) {
412
- keys(v, ["x", "y", "for", "lend"], at);
415
+ keys(v, ["x", "y", "for", "lend", "standFacing"], at);
413
416
  p = { x: num(v.x, 0, C.w, `${at}.x`), y: num(v.y, 0, C.h, `${at}.y`) };
414
417
  if (v.lend !== undefined && typeof v.lend !== "boolean") throw new Refused(`${at}.lend`, "true or false");
415
418
  if (v.lend !== undefined && v.for === undefined) throw new Refused(`${at}.lend`, "only with for");
416
419
  if (v.for !== undefined) extra = { for: owners(v.for, `${at}.for`), lend: v.lend === true };
420
+ if (v.standFacing !== undefined) {
421
+ if (!HEADINGS.includes(v.standFacing)) throw new Refused(`${at}.standFacing`, "up, down, left or right");
422
+ extra.standFacing = v.standFacing;
423
+ }
417
424
  } else p = point(v, at);
418
425
  if (p.x < rect.x || p.x > rect.x + rect.w || p.y < rect.y || p.y > rect.y + rect.h) throw new Refused(at, "outside its area's rect");
419
426
  return { ...p, ...extra };
@@ -700,13 +707,16 @@ function snackLabelOf(v, at) {
700
707
  * heading right (`dx` along the car, `dy` across it; fleet-office-vehicles.js seatAt places them for each heading).
701
708
  * `sprite` (its picture heading right; mirrored going left), or `sprites` by heading (`right`, `left`, `up`, `down`),
702
709
  * each a strip; `fronts` the same by heading, drawn over the riders (the car's front edge hiding their lower half). Who
703
- * rides is the agents' own choice (office_set `ride`), not the pack's.
710
+ * rides is the agents' own choice (office_set `ride`), with one exception (#4503): a seat's `worker` (an instance's
711
+ * name, on one vehicle seat of the pack at most) is where that instance works — it rides there while working, and
712
+ * nobody else takes the seat. A stop's `queue` (at most a point a seat): where seat i's worker waits off the platform;
713
+ * they step onto it once the train is in.
704
714
  */
705
715
  export const VEHICLE_LIMITS = { vehicles: 4, path: 64, stops: 8, seats: 16, minSpeed: 5, maxSpeed: 600, defaultSpeed: 80, maxSeconds: 600, defaultSeconds: 8, offset: 2000 };
706
716
  const HEADINGS = ["right", "left", "up", "down"];
707
717
  function vehiclesOf(v, scale) {
708
718
  if (v === undefined) return [];
709
- const seen = new Set();
719
+ const seen = new Set(), workers = new Set(); // a worker has one seat in the whole pack
710
720
  return list(v, VEHICLE_LIMITS.vehicles, "vehicles").map((x, i) => {
711
721
  const at = `vehicles[${i}]`;
712
722
  obj(x, at); keys(x, ["id", "label", "sprite", "sprites", "fronts", "path", "speed", "stops", "seats"], at);
@@ -733,18 +743,25 @@ function vehiclesOf(v, scale) {
733
743
  const taken = new Set();
734
744
  const stops = list(x.stops ?? [], VEHICLE_LIMITS.stops, `${at}.stops`).map((s, j) => {
735
745
  const here = `${at}.stops[${j}]`;
736
- obj(s, here); keys(s, ["at", "seconds", "platform"], here);
746
+ obj(s, here); keys(s, ["at", "seconds", "platform", "queue"], here);
737
747
  const k = int(s.at, 0, path.length - 1, `${here}.at`);
738
748
  if (taken.has(k)) throw new Refused(`${here}.at`, "a path point no other stop has");
739
749
  taken.add(k);
740
- return { at: k, seconds: s.seconds === undefined ? VEHICLE_LIMITS.defaultSeconds : num(s.seconds, 1, VEHICLE_LIMITS.maxSeconds, `${here}.seconds`), platform: point(s.platform, `${here}.platform`) };
750
+ const queue = s.queue === undefined ? null : list(s.queue, VEHICLE_LIMITS.seats, `${here}.queue`).map((p, q) => point(p, `${here}.queue[${q}]`));
751
+ return { at: k, seconds: s.seconds === undefined ? VEHICLE_LIMITS.defaultSeconds : num(s.seconds, 1, VEHICLE_LIMITS.maxSeconds, `${here}.seconds`), platform: point(s.platform, `${here}.platform`),
752
+ ...(queue && queue.length ? { queue } : {}) };
741
753
  });
742
754
  const seats = list(x.seats ?? [], VEHICLE_LIMITS.seats, `${at}.seats`).map((s, j) => {
743
755
  const here = `${at}.seats[${j}]`;
744
- obj(s, here); keys(s, ["dx", "dy"], here);
745
- return { dx: num(s.dx ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dx`), dy: num(s.dy ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dy`) };
756
+ obj(s, here); keys(s, ["dx", "dy", "worker"], here);
757
+ const worker = s.worker === undefined ? null : names(s.worker, `${here}.worker`, 1)[0];
758
+ if (worker !== null && (Array.isArray(s.worker) || workers.has(worker))) throw new Refused(`${here}.worker`, "an instance's name no other vehicle seat has");
759
+ if (worker !== null) workers.add(worker);
760
+ return { dx: num(s.dx ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dx`), dy: num(s.dy ?? 0, -VEHICLE_LIMITS.offset, VEHICLE_LIMITS.offset, `${here}.dy`),
761
+ ...(worker !== null ? { worker } : {}) };
746
762
  });
747
763
  if (seats.length && !stops.length) throw new Refused(`${at}.stops`, "at least one stop, for its seats to be boarded");
764
+ stops.forEach((s, j) => { if (s.queue && s.queue.length > seats.length) throw new Refused(`${at}.stops[${j}].queue`, `at most one point a seat (${seats.length})`); });
748
765
  return { id: x.id, ...(x.label !== undefined ? { label: x.label.trim() } : {}), sprite: x.sprite === undefined ? null : checkStrip(x.sprite, `${at}.sprite`, scale),
749
766
  ...(sprites ? { sprites } : {}), ...(fronts && Object.keys(fronts).length ? { fronts } : {}), path, speed, stops, seats };
750
767
  });
@@ -2,7 +2,11 @@
2
2
  // wall clock alone, so every page shows it in the same place: it runs round its path at its speed and waits at each
3
3
  // stop. People ride by their own choice (an agent's office_set `ride`): they walk to the platform, wait for the train
4
4
  // to stop there, board, and ride in a seat (working there, moving with it); they get off only when it stops at a
5
- // platform, then walk on. Pure — fleet-office.js draws the vehicles and moves the riders (the walkers' `ride`).
5
+ // platform, then walk on. A pack may give an agent a seat as its workplace (#4503: a seat's `worker`): it rides there
6
+ // while working, and waits for the train at its seat's `queue` point. Pure — fleet-office.js draws the vehicles and
7
+ // moves the riders (the walkers' `ride`).
8
+
9
+ import { WALK, WANDER } from "./fleet-office-zones.js";
6
10
 
7
11
  const LEGS = new WeakMap();
8
12
  /** A vehicle's timetable: each leg (a path segment, then its stop's wait), in ms, and the whole lap. */
@@ -68,7 +72,7 @@ export const lapMs = (v) => legsOf(v).lap;
68
72
  * `homeOf(name)`: their seat (to pick the nearest platform); `sinceOf(name)`: when their ride began (wall clock), so
69
73
  * a page opened long after shows them on board, not walking to a train they took long ago; `urgent(name)`: they
70
74
  * must get off now (a call: #4415, nothing keeps a caller from the Help desk), where their seat is, between stops too.
71
- * Returns { targets: name → where to walk now (the platform), board: [{ name, vehicle, seat }], alight: [{ name, at }] };
75
+ * Returns { targets: name → where to walk now (the platform, or their queue point), board: [{ name, vehicle, seat }], alight: [{ name, at }] };
72
76
  * `riding(name)` → { vehicle, seat } while on board; `clear()` forgets everyone and returns who was on board.
73
77
  */
74
78
  export function createRiders() {
@@ -96,27 +100,38 @@ export function createRiders() {
96
100
  continue; // off only at a stop
97
101
  }
98
102
  if (!v || !v.seats.length || !v.stops.length) { if (r) by.delete(name); continue; }
103
+ // #4503: a seat with a `worker` is theirs alone; they take no other, and everyone else takes only the others.
104
+ const own = v.seats.findIndex((s) => s.worker === name);
105
+ const freeSeat = () => { const taken = used(vid); return own >= 0 ? (taken.has(own) ? -1 : own) : v.seats.findIndex((s, i) => !s.worker && !taken.has(i)); };
99
106
  // A page opened long after the ride began (more than a lap and the walk ago, `since`): they are on board already.
100
107
  const since = sinceOf ? sinceOf(name) : null;
101
108
  if (!r && since !== null && wall - since > lapMs(v) + RIDE.SETTLE_MS) {
102
- const taken = used(vid), seat = v.seats.findIndex((_, i) => !taken.has(i));
109
+ const seat = freeSeat();
103
110
  if (seat >= 0) { by.set(name, { phase: "riding", vehicle: vid, seat }); board.push({ name, vehicle: vid, seat }); continue; }
104
111
  }
105
112
  if (!r || r.vehicle !== vid) {
106
113
  const home = homeOf(name) || posOf(name) || v.stops[0].platform;
107
114
  let best = 0;
108
115
  v.stops.forEach((s, i) => { if (Math.hypot(s.platform.x - home.x, s.platform.y - home.y) < Math.hypot(v.stops[best].platform.x - home.x, v.stops[best].platform.y - home.y)) best = i; });
109
- r = { phase: "going", vehicle: vid, stop: best };
116
+ r = { phase: "going", vehicle: vid, stop: best, track: v.path[v.stops[best].at] };
110
117
  by.set(name, r);
111
118
  }
112
- const platform = v.stops[r.stop].platform, here = posOf(name);
113
- targets.set(name, platform);
114
- if (r.phase === "going" && here && !here.walking && near(here, platform)) r.phase = "waiting";
115
- if (r.phase !== "waiting") continue;
116
- const at = vehicleAt(v, wall);
117
- if (at.stop !== r.stop || at.left < RIDE.BOARD_MS) continue; // the train is not in (or is leaving)
118
- const taken = used(vid), seat = v.seats.findIndex((_, i) => !taken.has(i));
119
+ // A worker waits at their seat's queue point (#4503), and steps onto the platform ("stepping") once the train is in.
120
+ const stop = v.stops[r.stop], platform = stop.platform, wait = (stop.queue && stop.queue[own]) || platform, here = posOf(name);
121
+ const at = vehicleAt(v, wall), open = at.stop === r.stop && at.left >= RIDE.BOARD_MS;
122
+ if (r.phase === "stepping" && !open) r.phase = "going"; // it left before they got there: back in line
123
+ targets.set(name, r.phase === "stepping" ? platform : wait);
124
+ if (r.phase === "going" && here && !here.walking && near(here, wait)) r.phase = "waiting";
125
+ if (r.phase !== "waiting" && r.phase !== "stepping") continue;
126
+ if (!open) continue; // the train is not in (or is leaving)
127
+ const seat = freeSeat();
119
128
  if (seat < 0) continue; // full: wait for the next one
129
+ if (!near(here, platform)) {
130
+ // Off the platform: step on only with the time to get there (the walk, then up to a tick till it is seen), else wait.
131
+ if (r.phase === "waiting" && at.left < Math.hypot(wait.x - platform.x, wait.y - platform.y) / WALK.SPEED + WANDER.TICK + RIDE.BOARD_MS) continue;
132
+ r.phase = "stepping"; targets.set(name, platform);
133
+ continue;
134
+ }
120
135
  r.phase = "riding"; r.seat = seat;
121
136
  targets.delete(name);
122
137
  board.push({ name, vehicle: vid, seat });
@@ -124,6 +139,8 @@ export function createRiders() {
124
139
  return { targets, board, alight };
125
140
  },
126
141
  riding(name) { const r = by.get(name); return r && r.phase === "riding" ? { vehicle: r.vehicle, seat: r.seat } : null; },
142
+ /** #4503: where the train they wait for (or walk to) stops, or null. */
143
+ waitingFor(name) { const r = by.get(name); return r && r.phase !== "riding" ? r.track : null; },
127
144
  phase(name) { const r = by.get(name); return r ? r.phase : null; },
128
145
  clear() { const on = [...by].filter(([, r]) => r.phase === "riding").map(([n]) => n); by.clear(); return on; },
129
146
  };
@@ -83,7 +83,7 @@ export function assignSeats(pack, wants, prev = new Map(), seatPrefs = null) {
83
83
  };
84
84
  const pos = (area, slot) => (slot >= 0 ? areaOf(area).seats[slot] : spotsOf(area)[-slot - 1]);
85
85
  const usedIn = (area) => { if (!taken.has(area)) taken.set(area, new Set()); return taken.get(area); };
86
- const give = (name, area, slot) => { const p = pos(area, slot); usedIn(area).add(slot); seats.set(name, { area, slot, x: p.x, y: p.y }); };
86
+ const give = (name, area, slot) => { const p = pos(area, slot); usedIn(area).add(slot); seats.set(name, { area, slot, x: p.x, y: p.y, ...(p.standFacing ? { standFacing: p.standFacing } : {}) }); };
87
87
  const free = (w) => !seats.has(w.name) && !!areaOf(w.area);
88
88
  // Owners first: their own seat from last time (or saved seat pref), then their first free one.
89
89
  for (const w of wants) {
@@ -152,7 +152,7 @@ export function zonesLayout(pack, nodes, prev = new Map(), { night = false, seat
152
152
  const { seats, crowd, over } = placed;
153
153
  const desks = nodes.filter((n) => seats.has(n.name)).map((n) => {
154
154
  const s = seats.get(n.name);
155
- return { key: `zone/${n.name}`, node: n, x: s.x - 24, y: s.y - 52, w: 48, h: 66, seat: { x: s.x, y: s.y }, wp: null, area: s.area, slot: s.slot, night: sleepers.has(n.name) };
155
+ return { key: `zone/${n.name}`, node: n, x: s.x - 24, y: s.y - 52, w: 48, h: 66, seat: { x: s.x, y: s.y, ...(s.standFacing ? { standFacing: s.standFacing } : {}) }, wp: null, area: s.area, slot: s.slot, night: sleepers.has(n.name) };
156
156
  });
157
157
  const cv = canvasOf(pack);
158
158
  return { mode: "zones", rooms: [{ key: "\u0000zones", name: null, lobby: false, x: 0, y: 0, w: cv.w, h: cv.h, desks }], areas: pack.areas,
@@ -299,6 +299,8 @@ const AIR_FPS = 30;
299
299
  const STYLES = BUILT_IN_SKINS;
300
300
  /** Paused and stopped: left out when "Hide paused and stopped" is on. */
301
301
  const ASLEEP = new Set(["paused", "stopped"]);
302
+ /** A seat's standFacing (#4503) as a walk heading. */
303
+ const STAND_FACING = { up: { dx: 0, dy: -1 }, down: { dx: 0, dy: 1 }, left: { dx: -1, dy: 0 }, right: { dx: 1, dy: 0 } };
302
304
  const BUBBLE_STATES = ["working", "idle", "paused", "stopped", "needs", "crashed", "stuck"];
303
305
  /** The page's own bubble lines, by state, in its language (short, never message content). */
304
306
  export const bubbleDefaults = () => Object.fromEntries(BUBBLE_STATES.map((s) => [s, to(`b_${s}`).split("|")]));
@@ -498,6 +500,13 @@ export function actLive(a, state, at = Date.now(), seen = null) {
498
500
  * (#4415: nothing keeps a caller from the Help desk; the ride resumes when the call is over). Working or a new turn do
499
501
  * not end it (it is where they choose to be); clearing it, a new office_set or its end do.
500
502
  */
503
+ /**
504
+ * #4503: the vehicle whose seat names `name` as its `worker`, while they are working (any other state, a call above
505
+ * all, is null: they go where that state sends them, the Help desk for a call, as anyone does); else null. Here, not in
506
+ * fleet-office-vehicles.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop
507
+ * this one linking (#4505 review). The riders' `waitingFor` is optional for the same reason (`p.waitingFor ?`).
508
+ */
509
+ export const workVehicleOf = (vehicles, name, state) => (state === "working" ? (vehicles.find((v) => v.seats.some((s) => s.worker === name)) || {}).id ?? null : null);
501
510
  /**
502
511
  * #4504: what the card's pose preview offers — every pose a character set may draw, walking by direction. Here, not in
503
512
  * fleet-office-pack.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop this
@@ -715,14 +724,21 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
715
724
  // A pat shows the set's `pat` strip for one full pass of it (pat.until), each pat from frame 0; a set without one keeps its pose.
716
725
  const canPat = !q.at.walking && !canEat && ms > 0 && !!p.reacts && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
717
726
  const patted = canPat ? patLook(posed, p.reacts.get(q.look.name), t) : null;
727
+ // #4503: working but not typing — at a standing desk (its seat's standFacing), or waiting for their train (facing
728
+ // where it stops) — they stand: their walk strip's first frame, that way.
729
+ const track = !q.at.walking && !q.at.riding && posed.pose === "working" && p.waitingFor ? p.waitingFor(q.look.name) : null;
730
+ const stand = q.at.walking || q.at.riding || posed.pose !== "working" ? null
731
+ : track ? (track.x !== q.at.x || track.y !== q.at.y ? { dx: track.x - q.at.x, dy: track.y - q.at.y } : null)
732
+ : q.d.seat && q.d.seat.standFacing && q.at.x === q.d.seat.x && q.at.y === q.d.seat.y ? STAND_FACING[q.d.seat.standFacing] : null;
718
733
  const look0 = q.at.walking ? { ...q.look, pose: "walk", heading: q.at.heading }
719
734
  : canEat ? { ...posed, pose: "eat", basePose: posed.pose }
720
- : patted || posed;
735
+ : patted || (stand ? { ...posed, pose: "walk", heading: stand } : posed);
721
736
  // #4504: the card's pose preview (this viewer's own): the picked pose in place, from its first frame (`clip`:
722
737
  // Replay starts it again). Never over a call: a caller shows that they call, preview or not.
723
738
  const pv = p.preview && p.preview.current;
724
- const look = pv && pv.name === q.look.name && !q.at.walking && !CALLING.has(q.look.state) ? { ...previewLook(posed, pv.pose), clip: `#${pv.t0}` } : look0;
725
- drawPerson(ctx, sk, box, look, ms, env, q.at.x + 20, q.at.y - 34, readScale);
739
+ const previewing = pv && pv.name === q.look.name && !q.at.walking && !CALLING.has(q.look.state);
740
+ const look = previewing ? { ...previewLook(posed, pv.pose), clip: `#${pv.t0}` } : look0;
741
+ drawPerson(ctx, sk, box, look, !previewing && stand && look.pose === "walk" ? 0 : ms, env, q.at.x + 20, q.at.y - 34, readScale);
726
742
  if (canEat && eating.snackId && p.snacksById && sk.drawSnack) {
727
743
  const sdef = p.snacksById.get(eating.snackId);
728
744
  if (sdef && sdef.eat) sk.drawSnack(ctx, sdef.eat, Math.max(0, t - eating.t0), q.at.x, q.at.y, env);
@@ -1631,7 +1647,11 @@ export function Office({ view: given, traffic, q = "", lease, onOpen, assetUrl,
1631
1647
  if (fresh) riders.clear();
1632
1648
  if (vehicles.length) {
1633
1649
  const byId = new Map(vehicles.map((v) => [v.id, v])), wall = Date.now(), here = desksOf(L);
1634
- const wants = new Map(here.map((d) => { const a = actsHere.get(d.node.name); return [d.node.name, !d.night && rideLive(a, d.node.state, wall) ? a.ride : null]; }));
1650
+ // An act's ride first; else (no other act going) a worker's seat on a vehicle while working (#4503).
1651
+ const wants = new Map(here.map((d) => {
1652
+ const { name, state } = d.node, a = actsHere.get(name);
1653
+ return [name, d.night ? null : rideLive(a, state, wall) ? a.ride : actLive(a, state, wall, actSeen.current) ? null : workVehicleOf(vehicles, name, state)];
1654
+ }));
1635
1655
  const r = riders.step({ wants, vehicles: byId, wall, posOf: (n) => walkers.at(n, t), homeOf: (n) => (here.find((d) => d.node.name === n) || {}).seat || null,
1636
1656
  sinceOf: (n) => { const a = actsHere.get(n); return a && a.ride && typeof a.since === "number" ? a.since : null; },
1637
1657
  urgent: (n) => { const d = here.find((x) => x.node.name === n); return !!d && CALLING.has(d.node.state); } });
@@ -1986,7 +2006,7 @@ export function Office({ view: given, traffic, q = "", lease, onOpen, assetUrl,
1986
2006
  const parts = tiles.map((tl, i) => ({ ...partOf(tl.L, tileLooks[i], tl.skin, tl.zones, tl.walkers, tl.flights), night, key: tl.key, prefix: tl.prefix, tile: arranged.tiles[i], ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(tl.skin) }));
1987
2007
  scene.current = { ...base, overview: true, parts, lay: arranged };
1988
2008
  } else {
1989
- scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current, preview, riding: riders.riding,
2009
+ scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current, preview, riding: riders.riding, waitingFor: riders.waitingFor,
1990
2010
  hold: play ? hold : null, seatDrop: seatDropRef,
1991
2011
  snacks: play ? snacks : null, snacksById, ownArea, snackDrop: snackDropRef, onSnackClaim, onSnacksChanged: () => walkNow.current?.() } };
1992
2012
  }
@@ -5,7 +5,9 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hubAdminRooms", {
7
7
  en: {
8
- adminOnly: "Right now only Hub administrators can start rooms.",
8
+ adminOnly: "No one else is on this list yet.",
9
+ roleCreators: "The Hub's first administrator and people with an active Create rooms role permission can also create rooms. Manage role grants in Roles.",
10
+ independentGrants: "Removing someone from this list does not remove their role grant, and removing a role grant does not remove them from this list.",
9
11
  colPeople: "People", colAgents: "Agents", colLast: "Last activity", colState: "Status",
10
12
  none: "No rooms yet.",
11
13
  rowMenu: "More for {0}",
@@ -15,7 +17,9 @@ register("hubAdminRooms", {
15
17
  joined: "You are a room manager of “{0}” now. A line in the room says so.",
16
18
  },
17
19
  "zh-TW": {
18
- adminOnly: "目前只有 Hub 管理員可以開房間。",
20
+ adminOnly: "名單上還沒有其他人。",
21
+ roleCreators: "Hub 的第一位管理員與目前角色授予「開房間」權限的人,也可以開房間。角色權限請至「角色」管理。",
22
+ independentGrants: "從這份名單移除某人,不會移除他的角色授權;移除角色授權,也不會將他從這份名單移除。",
19
23
  colPeople: "人數", colAgents: "Agent 數", colLast: "最後活動", colState: "狀態",
20
24
  none: "還沒有房間。",
21
25
  rowMenu: "{0} 的更多動作",