@songsid/agend 2.4.0-beta.2 → 2.4.0-beta.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 (294) hide show
  1. package/dist/agent-cli.js +1 -1
  2. package/dist/agent-endpoint.d.ts +1 -1
  3. package/dist/agent-endpoint.js +8 -2
  4. package/dist/agent-endpoint.js.map +1 -1
  5. package/dist/agent-token-header.d.ts +1 -1
  6. package/dist/agent-token-header.js +1 -1
  7. package/dist/auth-api.d.ts +3 -0
  8. package/dist/auth-api.js +15 -1
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/agy-model-switch.d.ts +22 -0
  11. package/dist/backend/agy-model-switch.js +62 -0
  12. package/dist/backend/agy-model-switch.js.map +1 -0
  13. package/dist/backend/antigravity.js +60 -3
  14. package/dist/backend/antigravity.js.map +1 -1
  15. package/dist/backend/cli-runtime-switch.d.ts +71 -0
  16. package/dist/backend/cli-runtime-switch.js +176 -0
  17. package/dist/backend/cli-runtime-switch.js.map +1 -0
  18. package/dist/backend/codex-model-switch.d.ts +41 -0
  19. package/dist/backend/codex-model-switch.js +170 -0
  20. package/dist/backend/codex-model-switch.js.map +1 -0
  21. package/dist/backend/credential-profile.js +1 -1
  22. package/dist/backend/credential-profile.js.map +1 -1
  23. package/dist/backend/grok-model-switch.d.ts +16 -0
  24. package/dist/backend/grok-model-switch.js +45 -0
  25. package/dist/backend/grok-model-switch.js.map +1 -0
  26. package/dist/backend/grok.js +1 -1
  27. package/dist/backend/grok.js.map +1 -1
  28. package/dist/backend/muse.d.ts +2 -0
  29. package/dist/backend/muse.js +7 -3
  30. package/dist/backend/muse.js.map +1 -1
  31. package/dist/build-provenance.json +1 -1
  32. package/dist/channel/mcp-server.js +10 -1
  33. package/dist/channel/mcp-server.js.map +1 -1
  34. package/dist/channel/mcp-tools.js +8 -0
  35. package/dist/channel/mcp-tools.js.map +1 -1
  36. package/dist/classic-channel-manager.d.ts +1 -1
  37. package/dist/classic-channel-manager.js +1 -1
  38. package/dist/cli-audited.js +12 -12
  39. package/dist/cli-audited.js.map +1 -1
  40. package/dist/daemon.d.ts +48 -2
  41. package/dist/daemon.js +302 -21
  42. package/dist/daemon.js.map +1 -1
  43. package/dist/delivery-consumed-watch.js +3 -0
  44. package/dist/delivery-consumed-watch.js.map +1 -1
  45. package/dist/event-log.d.ts +1 -1
  46. package/dist/event-log.js +1 -1
  47. package/dist/fleet-manager.d.ts +104 -2
  48. package/dist/fleet-manager.js +665 -27
  49. package/dist/fleet-manager.js.map +1 -1
  50. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
  51. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
  52. package/dist/general-knowledge/skills/fleet-health/SKILL.md +18 -0
  53. package/dist/general-knowledge/skills/hub/SKILL.md +154 -0
  54. package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -0
  55. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +17 -3
  56. package/dist/hub/admin-dashboard.d.ts +85 -0
  57. package/dist/hub/admin-dashboard.js +161 -0
  58. package/dist/hub/admin-dashboard.js.map +1 -0
  59. package/dist/hub/attachments/store.d.ts +2 -0
  60. package/dist/hub/attachments/store.js +6 -0
  61. package/dist/hub/attachments/store.js.map +1 -1
  62. package/dist/hub/client.d.ts +10 -0
  63. package/dist/hub/client.js +72 -10
  64. package/dist/hub/client.js.map +1 -1
  65. package/dist/hub/compose/member.d.ts +20 -0
  66. package/dist/hub/compose/member.js +212 -17
  67. package/dist/hub/compose/member.js.map +1 -1
  68. package/dist/hub/compose/server.d.ts +8 -0
  69. package/dist/hub/compose/server.js +13 -2
  70. package/dist/hub/compose/server.js.map +1 -1
  71. package/dist/hub/display-name.d.ts +10 -0
  72. package/dist/hub/display-name.js +35 -0
  73. package/dist/hub/display-name.js.map +1 -0
  74. package/dist/hub/execution/service.d.ts +1 -0
  75. package/dist/hub/execution/service.js +1 -1
  76. package/dist/hub/execution/service.js.map +1 -1
  77. package/dist/hub/fleet-info.d.ts +12 -0
  78. package/dist/hub/fleet-info.js +14 -0
  79. package/dist/hub/fleet-info.js.map +1 -0
  80. package/dist/hub/fleet-update-model.d.ts +100 -0
  81. package/dist/hub/fleet-update-model.js +15 -0
  82. package/dist/hub/fleet-update-model.js.map +1 -0
  83. package/dist/hub/fleet-updates.d.ts +46 -0
  84. package/dist/hub/fleet-updates.js +282 -0
  85. package/dist/hub/fleet-updates.js.map +1 -0
  86. package/dist/hub/fleet-versions.d.ts +28 -0
  87. package/dist/hub/fleet-versions.js +80 -0
  88. package/dist/hub/fleet-versions.js.map +1 -0
  89. package/dist/hub/http/compose.d.ts +2 -0
  90. package/dist/hub/http/compose.js +192 -16
  91. package/dist/hub/http/compose.js.map +1 -1
  92. package/dist/hub/http/deps.d.ts +1 -0
  93. package/dist/hub/http/schema.js +13 -1
  94. package/dist/hub/http/schema.js.map +1 -1
  95. package/dist/hub/member/display-name.d.ts +9 -0
  96. package/dist/hub/member/display-name.js +71 -0
  97. package/dist/hub/member/display-name.js.map +1 -0
  98. package/dist/hub/member/exposure-api.d.ts +4 -0
  99. package/dist/hub/member/exposure-api.js +8 -3
  100. package/dist/hub/member/exposure-api.js.map +1 -1
  101. package/dist/hub/member/exposures.d.ts +4 -0
  102. package/dist/hub/member/exposures.js +20 -0
  103. package/dist/hub/member/exposures.js.map +1 -1
  104. package/dist/hub/member/pairing-api.js +3 -2
  105. package/dist/hub/member/pairing-api.js.map +1 -1
  106. package/dist/hub/member/recommendations.d.ts +37 -0
  107. package/dist/hub/member/recommendations.js +129 -0
  108. package/dist/hub/member/recommendations.js.map +1 -0
  109. package/dist/hub/member/room-ask.d.ts +60 -1
  110. package/dist/hub/member/room-ask.js +254 -24
  111. package/dist/hub/member/room-ask.js.map +1 -1
  112. package/dist/hub/member/room-post-answers.d.ts +52 -0
  113. package/dist/hub/member/room-post-answers.js +152 -0
  114. package/dist/hub/member/room-post-answers.js.map +1 -0
  115. package/dist/hub/member/room-post-receipt.d.ts +21 -0
  116. package/dist/hub/member/room-post-receipt.js +49 -0
  117. package/dist/hub/member/room-post-receipt.js.map +1 -0
  118. package/dist/hub/member/room-post.d.ts +100 -0
  119. package/dist/hub/member/room-post.js +223 -0
  120. package/dist/hub/member/room-post.js.map +1 -0
  121. package/dist/hub/member/updates.d.ts +92 -0
  122. package/dist/hub/member/updates.js +316 -0
  123. package/dist/hub/member/updates.js.map +1 -0
  124. package/dist/hub/protocol.d.ts +658 -1
  125. package/dist/hub/protocol.js +90 -13
  126. package/dist/hub/protocol.js.map +1 -1
  127. package/dist/hub/published-version.d.ts +3 -0
  128. package/dist/hub/published-version.js +35 -0
  129. package/dist/hub/published-version.js.map +1 -0
  130. package/dist/hub/recommendation-model.d.ts +36 -0
  131. package/dist/hub/recommendation-model.js +9 -0
  132. package/dist/hub/recommendation-model.js.map +1 -0
  133. package/dist/hub/recommendations.d.ts +58 -0
  134. package/dist/hub/recommendations.js +211 -0
  135. package/dist/hub/recommendations.js.map +1 -0
  136. package/dist/hub/representative.d.ts +3 -0
  137. package/dist/hub/representative.js +2 -1
  138. package/dist/hub/representative.js.map +1 -1
  139. package/dist/hub/room-context-model.d.ts +43 -0
  140. package/dist/hub/room-context-model.js +12 -0
  141. package/dist/hub/room-context-model.js.map +1 -0
  142. package/dist/hub/rooms/agents.d.ts +41 -9
  143. package/dist/hub/rooms/agents.js +183 -21
  144. package/dist/hub/rooms/agents.js.map +1 -1
  145. package/dist/hub/rooms/assistant.d.ts +1 -6
  146. package/dist/hub/rooms/assistant.js +7 -2
  147. package/dist/hub/rooms/assistant.js.map +1 -1
  148. package/dist/hub/rooms/automation.d.ts +24 -0
  149. package/dist/hub/rooms/automation.js +66 -0
  150. package/dist/hub/rooms/automation.js.map +1 -0
  151. package/dist/hub/rooms/buttons.d.ts +85 -0
  152. package/dist/hub/rooms/buttons.js +62 -0
  153. package/dist/hub/rooms/buttons.js.map +1 -0
  154. package/dist/hub/rooms/context-cursor.d.ts +18 -0
  155. package/dist/hub/rooms/context-cursor.js +61 -0
  156. package/dist/hub/rooms/context-cursor.js.map +1 -0
  157. package/dist/hub/rooms/context.d.ts +1 -1
  158. package/dist/hub/rooms/context.js +4 -4
  159. package/dist/hub/rooms/context.js.map +1 -1
  160. package/dist/hub/rooms/mentions.d.ts +15 -0
  161. package/dist/hub/rooms/mentions.js +43 -0
  162. package/dist/hub/rooms/mentions.js.map +1 -0
  163. package/dist/hub/rooms/post-replies.d.ts +23 -0
  164. package/dist/hub/rooms/post-replies.js +114 -0
  165. package/dist/hub/rooms/post-replies.js.map +1 -0
  166. package/dist/hub/rooms/schema.d.ts +9 -0
  167. package/dist/hub/rooms/schema.js +43 -0
  168. package/dist/hub/rooms/schema.js.map +1 -1
  169. package/dist/hub/rooms/service.d.ts +136 -1
  170. package/dist/hub/rooms/service.js +727 -18
  171. package/dist/hub/rooms/service.js.map +1 -1
  172. package/dist/hub/rooms/types.d.ts +27 -3
  173. package/dist/hub/rooms.js +1 -1
  174. package/dist/hub/rooms.js.map +1 -1
  175. package/dist/hub/runtime.d.ts +1 -1
  176. package/dist/hub/runtime.js +12 -0
  177. package/dist/hub/runtime.js.map +1 -1
  178. package/dist/hub/server.d.ts +6 -1
  179. package/dist/hub/server.js +75 -5
  180. package/dist/hub/server.js.map +1 -1
  181. package/dist/hub/settings-directory-proof.js +22 -1
  182. package/dist/hub/settings-directory-proof.js.map +1 -1
  183. package/dist/hub/types.d.ts +133 -2
  184. package/dist/hub-contact-windows.d.ts +11 -0
  185. package/dist/hub-contact-windows.js +56 -0
  186. package/dist/hub-contact-windows.js.map +1 -0
  187. package/dist/hub-pairing-summary.d.ts +1 -1
  188. package/dist/hub-room-conversation.d.ts +14 -0
  189. package/dist/hub-room-conversation.js +60 -0
  190. package/dist/hub-room-conversation.js.map +1 -0
  191. package/dist/hub-update-notice.d.ts +12 -0
  192. package/dist/hub-update-notice.js +35 -0
  193. package/dist/hub-update-notice.js.map +1 -0
  194. package/dist/locale.js +58 -2
  195. package/dist/locale.js.map +1 -1
  196. package/dist/native-mcp.js +9 -6
  197. package/dist/native-mcp.js.map +1 -1
  198. package/dist/outbound-handlers.d.ts +14 -4
  199. package/dist/outbound-handlers.js +54 -1
  200. package/dist/outbound-handlers.js.map +1 -1
  201. package/dist/outbound-schemas.d.ts +12 -0
  202. package/dist/outbound-schemas.js +12 -0
  203. package/dist/outbound-schemas.js.map +1 -1
  204. package/dist/pane-port.d.ts +2 -0
  205. package/dist/queued-handoffs.d.ts +16 -4
  206. package/dist/queued-handoffs.js +18 -1
  207. package/dist/queued-handoffs.js.map +1 -1
  208. package/dist/runtime-cli-install.js +13 -10
  209. package/dist/runtime-cli-install.js.map +1 -1
  210. package/dist/settings-api.d.ts +1 -0
  211. package/dist/settings-api.js +87 -0
  212. package/dist/settings-api.js.map +1 -1
  213. package/dist/tmux-manager.d.ts +2 -0
  214. package/dist/tmux-manager.js +2 -0
  215. package/dist/tmux-manager.js.map +1 -1
  216. package/dist/tool-permissions.js +3 -0
  217. package/dist/tool-permissions.js.map +1 -1
  218. package/dist/ui/chat-msg-actions.js +3 -222
  219. package/dist/ui/hub-admin-overview.js +189 -0
  220. package/dist/ui/hub-client.js +36 -4
  221. package/dist/ui/hub-fleet-versions.js +393 -0
  222. package/dist/ui/hub-room-agent-strings.js +28 -0
  223. package/dist/ui/hub-room-composer.js +16 -8
  224. package/dist/ui/hub-room-members-strings.js +2 -2
  225. package/dist/ui/hub-room-members.js +3 -2
  226. package/dist/ui/hub-room-notify.js +161 -0
  227. package/dist/ui/hub-room-search.js +126 -0
  228. package/dist/ui/hub-room-strings.js +47 -1
  229. package/dist/ui/hub-room-thread.js +243 -35
  230. package/dist/ui/hub-room-unread.js +2 -1
  231. package/dist/ui/hub-strings.js +8 -0
  232. package/dist/ui/image-annotate.js +2 -283
  233. package/dist/ui/image-lightbox.js +2 -176
  234. package/dist/ui/image-zoom.js +2 -242
  235. package/dist/ui/notice-hub-update.js +94 -0
  236. package/dist/ui/panel-chat.js +121 -12
  237. package/dist/ui/panel-hub.js +133 -19
  238. package/dist/ui/panel-notices.js +3 -1
  239. package/dist/ui/panel-settings.js +1 -1
  240. package/dist/ui/settings-hub-updates.js +67 -0
  241. package/dist/ui/settings-hub.js +28 -3
  242. package/dist/ui/settings-registry.js +1 -0
  243. package/dist/ui/settings-update.js +11 -5
  244. package/dist/ui/settings-web-authority.js +1 -1
  245. package/dist/ui/shared/app-i18n.js +2 -0
  246. package/dist/ui/shared/app-nav.js +6 -2
  247. package/dist/ui/shared/app-prefs.js +2 -1
  248. package/dist/ui/shared/app-shell.js +29 -4
  249. package/dist/ui/shared/app-update.js +90 -8
  250. package/dist/ui/shared/app.css +33 -0
  251. package/dist/ui/shared/chat-composer.js +6 -3
  252. package/dist/ui/shared/chat-msg-actions.js +225 -0
  253. package/dist/ui/shared/chat-thread.js +70 -5
  254. package/dist/ui/shared/chat-work-bar.css +48 -0
  255. package/dist/ui/shared/hub-chat.css +16 -2
  256. package/dist/ui/shared/hub-owner.css +104 -0
  257. package/dist/ui/shared/hub-rooms-u2.css +16 -0
  258. package/dist/ui/shared/hub.css +5 -0
  259. package/dist/ui/shared/image-annotate.js +306 -0
  260. package/dist/ui/shared/image-lightbox.js +183 -0
  261. package/dist/ui/shared/image-zoom.js +242 -0
  262. package/dist/ui/shared/instance-nav.js +36 -7
  263. package/dist/ui/shared/model-picker.css +4 -3
  264. package/dist/ui/shared/view-strings.js +8 -0
  265. package/dist/ui/shared/web-authorize.js +2 -2
  266. package/dist/update-dispatch.d.ts +8 -1
  267. package/dist/update-dispatch.js +16 -1
  268. package/dist/update-dispatch.js.map +1 -1
  269. package/dist/update-idle.d.ts +65 -0
  270. package/dist/update-idle.js +190 -0
  271. package/dist/update-idle.js.map +1 -0
  272. package/dist/update-launch.d.ts +1 -1
  273. package/dist/update-launch.js +9 -2
  274. package/dist/update-launch.js.map +1 -1
  275. package/dist/usage/i18n-keys.d.ts +1 -1
  276. package/dist/usage/i18n-keys.js +1 -1
  277. package/dist/usage/i18n-keys.js.map +1 -1
  278. package/dist/usage/profile-timeline.d.ts +2 -0
  279. package/dist/usage/profile-timeline.js +4 -0
  280. package/dist/usage/profile-timeline.js.map +1 -1
  281. package/dist/usage/providers.js +4 -4
  282. package/dist/usage/providers.js.map +1 -1
  283. package/dist/usage/quota-history.d.ts +1 -1
  284. package/dist/view-api.js +1 -1
  285. package/dist/view-api.js.map +1 -1
  286. package/dist/web-api.js +19 -2
  287. package/dist/web-api.js.map +1 -1
  288. package/dist/web-notices.d.ts +3 -0
  289. package/dist/web-notices.js +17 -2
  290. package/dist/web-notices.js.map +1 -1
  291. package/dist/web-prefs.js +1 -0
  292. package/dist/web-prefs.js.map +1 -1
  293. package/dist/web-update.d.ts +15 -1
  294. package/package.json +1 -1
@@ -0,0 +1,161 @@
1
+ // Hub rooms desktop notifications (hub-rooms-ux.md §12: 和 Fleet 聊天相同的桌面通知(要先允許)).
2
+ // Pure gate: shouldNotify in hub-room-unread.js (imported, never copied); the opt-in rule: notifyOn in app-needs.js.
3
+ import { notifyOn, notifySupport, notifyStore, refreshNotify, setNotify } from "/assets/app-needs.js";
4
+ import { html, useEffect } from "/assets/app-html.js";
5
+ import { useStore } from "/assets/app-store.js";
6
+ import { Icon } from "/assets/ui-icons.js";
7
+ import { counts, shouldNotify } from "./hub-room-unread.js";
8
+ import { hroom } from "./hub-room-strings.js";
9
+
10
+ /**
11
+ * Which live events earn a desktop ping (web-claude M-3117: only what is about me): an @ to me, an answer to
12
+ * a question I asked (`answerTo` mine, matched by the server-set `askedBy`; a missing `askedBy` is not mine),
13
+ * a new invitation, and any new message in a direct (1:1) room (`opts.direct`). A group room's chatter and
14
+ * answers to other people's questions only count toward unread (the list and the tab title show them).
15
+ */
16
+ export function notifyKind(event, me, opts = {}) {
17
+ const c = counts(event, me);
18
+ if (!c || c.unread <= 0) return null;
19
+ if (c.invitation) return "invitation";
20
+ if (c.mentioned) return "mention";
21
+ const m = event && event.message;
22
+ if (m && m.stage === "answered" && m.answerTo && m.askedBy && me && m.askedBy === me.id) return "answer";
23
+ if (opts.direct && event.type === "message.added") return "direct";
24
+ return null;
25
+ }
26
+
27
+ const excerpt = (text) => {
28
+ const s = String(text || "").replace(/\s+/g, " ").trim();
29
+ return s.length > 80 ? `${s.slice(0, 80)}…` : s;
30
+ };
31
+
32
+ function pingBody(kind, event, room) {
33
+ if (kind === "invitation") {
34
+ const inv = (event && event.invitation) || {};
35
+ const name = (inv.room && inv.room.name) || inv.id || "";
36
+ return hroom("notifyInvite", String(name));
37
+ }
38
+ const m = (event && event.message) || {};
39
+ const who = (m.author && m.author.name) || "";
40
+ if (kind === "direct") return hroom("notifyDirect", String(who), excerpt(m.text));
41
+ return hroom(kind === "mention" ? "notifyMention" : "notifyAnswer", String(who), String(room), excerpt(m.text));
42
+ }
43
+
44
+ /**
45
+ * This person's member id per room for the page-level watcher (counts() matches message authors and @mentions
46
+ * by id, and every room mints its own member ids — one room's me.id never identifies this person in another).
47
+ * The Hub session carries only login and display name. Set per room from a room detail the page reads, or lazily
48
+ * on live events — and cleared wholesale when the signed-in login changes, so a sign-out and sign-in as someone
49
+ * else on the same tab never matches the next person with the previous one's ids.
50
+ */
51
+ const meByRoom = new Map();
52
+ /** Keeps the id for one room, from its detail or the lazy resolve; ignores empty values. */
53
+ export function noteHubMeId(roomId, id) { if (typeof roomId === "string" && roomId && typeof id === "string" && id) meByRoom.set(roomId, id); }
54
+ /** Forgets every room's id: the signed-in login changed (signed out, or in as someone else). */
55
+ export function clearHubMeId() { meByRoom.clear(); }
56
+ /** The remembered id for one room, or null while unknown. */
57
+ export function rememberedMeId(roomId) { return meByRoom.get(roomId) || null; }
58
+
59
+ let stopPrev = null;
60
+ /** The live starter's generation: a lazy resolve from a replaced or stopped watcher never writes. */
61
+ let liveGen = 0;
62
+
63
+ /**
64
+ * Ping while a Hub tab is open but hidden (a visible page shows the rows; what it showed is seen).
65
+ * `me(roomId)`: { id } for that room, or an accessor returning it (null until the page learns it:
66
+ * message rows cannot be matched before that, while an invitation — which carries no author — still pings).
67
+ * `setMe(roomId, { id })`: keeps what `resolveMe(roomId)` learns; `resolveMe`: one async attempt per room id,
68
+ * retried on the next event while still unknown (only while opted in, so an opted-out page never reads for it).
69
+ * `roomName(roomId)`: the ping's title; `roomKind(roomId)`: the list's kind for it (`"direct"` rooms ping
70
+ * on any new message); `open(roomId)`: where a click goes. Returns the stop function;
71
+ * a second start replaces the first.
72
+ */
73
+ export function startHubRoomNotifier({ client, me, setMe, resolveMe, roomName, roomKind, open, env = globalThis, doc = typeof document !== "undefined" ? document : null } = {}) {
74
+ if (stopPrev) stopPrev();
75
+ const gen = ++liveGen;
76
+ const seen = new Set();
77
+ const resolving = new Map();
78
+ const meOf = (roomId) => (typeof me === "function" ? me(roomId) : me);
79
+ // Starts (or joins) the lazy resolve for a room; returns its promise, or null when no resolve applies.
80
+ const ensureMe = (roomId) => {
81
+ if (!roomId) return null;
82
+ const m = meOf(roomId);
83
+ if (m && m.id) return null;
84
+ if (typeof resolveMe !== "function" || typeof setMe !== "function" || !notifyOn(env)) return null;
85
+ if (!resolving.has(roomId)) {
86
+ resolving.set(roomId, Promise.resolve()
87
+ .then(() => resolveMe(roomId))
88
+ // A resolve that lands after a restart (sign-in change) or stop belongs to the old watcher: drop it,
89
+ // or B would inherit A's id right after the clear.
90
+ .then((got) => { if (gen === liveGen && got && got.id) setMe(roomId, got); }, () => {})
91
+ .finally(() => { resolving.delete(roomId); }));
92
+ }
93
+ return resolving.get(roomId) ?? null;
94
+ };
95
+ const onEvent = (type) => (data, replayed) => {
96
+ const event = { type, ...(data && typeof data === "object" ? data : {}) };
97
+ const focus = !(doc && doc.hidden);
98
+ // Member ids are per room: match each event against that room's own remembered id, so an @mention or
99
+ // answer in any other room still pings, while my own rows (including from another device) never do.
100
+ const self = meOf(event.roomId);
101
+ let kind = null;
102
+ if (self) {
103
+ if (!shouldNotify(event, self, focus, env)) return;
104
+ const direct = typeof roomKind === "function" && roomKind(event.roomId) === "direct";
105
+ kind = notifyKind(event, self, { direct });
106
+ } else {
107
+ // The page has not learned this person's id for this room yet: message rows cannot be matched now.
108
+ // A new invitation (no author) still pings at once under the hidden-tab rule; any other first event
109
+ // in the room is replayed through the normal path once the resolve lands (seen-key dedupe stops a
110
+ // double ping), so the first @mention is never the one that stays silent.
111
+ if (!replayed) {
112
+ const pending = ensureMe(event.roomId);
113
+ if (pending) pending.then(() => {
114
+ if (gen === liveGen && doc && doc.hidden && notifyOn(env)) onEvent(type)(data, true);
115
+ });
116
+ }
117
+ if (focus || !notifyOn(env)) return;
118
+ const inv = event.invitation;
119
+ if (event.type !== "invitation.changed" || !inv || typeof inv !== "object" || !(inv.id || inv.room)) return;
120
+ kind = "invitation";
121
+ }
122
+ if (!kind) return;
123
+ const id = self ? (counts(event, self).id || `${type}:${event.roomId || ""}`)
124
+ : String((event.invitation && event.invitation.id) || `${type}:invitation`);
125
+ // One ping per row per kind: an @mention and the row's later answer are two moments; the tab's
126
+ // tag stays the row id, so the answer replaces the mention ping instead of stacking (Fleet: tag = item id).
127
+ const seenKey = `${kind}:${id}`;
128
+ if (seen.has(seenKey)) return;
129
+ seen.add(seenKey);
130
+ try {
131
+ const room = typeof roomName === "function" ? roomName(event.roomId) || "" : "";
132
+ const n = new env.Notification(room || "AgEnD Hub", { body: pingBody(kind, event, room), tag: String(id) });
133
+ n.onclick = () => {
134
+ try { if (env.focus) env.focus(); } catch { /* the tab is already there */ }
135
+ if (event.roomId && typeof open === "function") open(event.roomId);
136
+ try { n.close(); } catch { /* already gone */ }
137
+ };
138
+ } catch { /* a browser that refuses at the last moment: the unread count still shows it */ }
139
+ };
140
+ const off = client && typeof client.subscribeRooms === "function"
141
+ ? client.subscribeRooms({ "message.added": onEvent("message.added"), "message.updated": onEvent("message.updated"), "invitation.changed": onEvent("invitation.changed") })
142
+ : () => {};
143
+ stopPrev = () => { stopPrev = null; liveGen++; try { off(); } catch { /* already stopped */ } };
144
+ return stopPrev;
145
+ }
146
+
147
+ /** The Hub header's compact Notify-me button: this device's choice (notifyStore), asking on click. */
148
+ export function HubNotifyToggle() {
149
+ const support = notifySupport();
150
+ const { state, asking } = useStore(notifyStore);
151
+ useEffect(() => { refreshNotify(); }, []);
152
+ const on = state === "on";
153
+ const label = hroom("notifyTitle");
154
+ const note = support !== "ok" ? hroom("notifyUnavailable") : state === "denied" ? hroom("notifyDenied") : on ? hroom("notifyOn") : hroom("notifyOff");
155
+ const title = `${label} — ${note}`;
156
+ if (support !== "ok") {
157
+ return html`<span class="icon-btn hub-notify" aria-disabled="true" title=${title} aria-label=${title}><${Icon} name="bell" size=${16} /></span>`;
158
+ }
159
+ return html`<button type="button" class="icon-btn hub-notify" aria-pressed=${on ? "true" : "false"} aria-label=${label} title=${title}
160
+ disabled=${asking} onClick=${() => { void setNotify(!on); }}><${Icon} name="bell" size=${16} /></button>`;
161
+ }
@@ -0,0 +1,126 @@
1
+ // M-3127 C: the Hub's Ctrl K (⌘K) — the Fleet's search dialog (search-dialog.js: one box on top, results under it, ↑↓ Enter,
2
+ // Esc or a click outside to close), on the Hub: the rooms and chats whose names match (what Ctrl K did before), then the
3
+ // messages with those words in the group rooms I am in (GET /hub/v1/rooms/search), grouped by room, newest first. A hit
4
+ // opens its room at the message (`?room=…&m=…`: the room page loads back to it and flashes it). The Fleet dialog's look
5
+ // (app.css .search-*), not its module: a Hub page imports no Fleet module. Text only: no innerHTML.
6
+ import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
7
+ import { Icon } from "/assets/ui-icons.js";
8
+ import { Skeleton } from "/assets/ui-states.js";
9
+ import { hroom } from "./hub-room-strings.js";
10
+
11
+ export const SEARCH_DEBOUNCE_MS = 250;
12
+
13
+ /** A snippet as text segments, the matched ranges (from the Hub, clipped to the text) marked. */
14
+ export function segments(text, marks) {
15
+ const s = String(text || ""), out = [];
16
+ let at = 0;
17
+ for (const m of Array.isArray(marks) ? marks : []) {
18
+ const a = Math.max(at, Math.min(s.length, Number(m && m[0]) || 0)), b = Math.max(a, Math.min(s.length, Number(m && m[1]) || 0));
19
+ if (a > at) out.push({ text: s.slice(at, a) });
20
+ if (b > a) out.push({ text: s.slice(a, b), mark: true });
21
+ at = b;
22
+ }
23
+ if (at < s.length) out.push({ text: s.slice(at) });
24
+ return out;
25
+ }
26
+ /** Hits grouped by room in the order each room's newest hit comes; `index` is each hit's place in the flat order. */
27
+ export function byRoom(hits, offset = 0) {
28
+ const groups = new Map();
29
+ for (const h of hits || []) { if (!groups.has(h.roomId)) groups.set(h.roomId, { roomId: h.roomId, name: h.roomName, hits: [] }); groups.get(h.roomId).hits.push(h); }
30
+ let i = offset;
31
+ return [...groups.values()].map((g) => ({ ...g, hits: g.hits.map((hit) => ({ hit, index: i++ })) }));
32
+ }
33
+ /** "14:05" today, "10/19 14:05" this year, "2025/10/19" before (the Fleet search's). */
34
+ export function when(ms, now = Date.now()) {
35
+ const d = new Date(ms), n = new Date(now);
36
+ if (Number.isNaN(d.getTime())) return "";
37
+ const hm = `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
38
+ if (d.toDateString() === n.toDateString()) return hm;
39
+ return d.getFullYear() === n.getFullYear() ? `${d.getMonth() + 1}/${d.getDate()} ${hm}` : `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()}`;
40
+ }
41
+ /** The address that opens a hit: its room, at its message. */
42
+ export const hitPath = (hit) => `/ui/hub?room=${encodeURIComponent(hit.roomId)}&m=${encodeURIComponent(hit.messageId)}`;
43
+ const roomLabel = (r) => String(r.assistant ? hroom("hubAssistant") : r.kind === "direct" ? (r.agent?.name || r.exposureName || r.name || "") : (r.name || ""));
44
+
45
+ /**
46
+ * `client`: the Hub client (searchRoomMessages); `rooms`: the list's rows (name matches); `openRoom(room)`,
47
+ * `openHit(hit)`: where a pick goes; `onClose()`.
48
+ */
49
+ export function RoomSearch({ client, rooms = [], openRoom, openHit, onClose }) {
50
+ const ref = useRef(null), input = useRef(null);
51
+ const [q, setQ] = useState("");
52
+ const [res, setRes] = useState({ status: "idle", hits: [] });
53
+ const [active, setActive] = useState(0);
54
+ const seq = useRef(0);
55
+ // The native modal, as the Fleet's: focus trapped, Esc → cancel (closed through the parent), a click on the backdrop.
56
+ useLayoutEffect(() => {
57
+ const d = ref.current, opener = typeof document !== "undefined" ? document.activeElement : null;
58
+ if (d && typeof d.showModal === "function" && !d.open) d.showModal();
59
+ input.current && input.current.focus();
60
+ return () => { if (d && d.open && typeof d.close === "function") d.close(); if (opener && typeof opener.focus === "function" && document.contains?.(opener)) opener.focus(); };
61
+ }, []);
62
+ useEffect(() => {
63
+ const d = ref.current; if (!d) return undefined;
64
+ const onCancel = (e) => { e.preventDefault(); onClose(); }, onClick = (e) => { if (e.target === d) onClose(); };
65
+ d.addEventListener("cancel", onCancel); d.addEventListener("click", onClick);
66
+ return () => { d.removeEventListener("cancel", onCancel); d.removeEventListener("click", onClick); };
67
+ }, [onClose]);
68
+ const query = q.trim();
69
+ // A room or chat by its name, or an agent chat by its owner's (what the list's filter matched before).
70
+ const names = useMemo(() => (query ? rooms.filter((r) => [roomLabel(r), r.agent?.owner?.name].some((v) => String(v || "").toLowerCase().includes(query.toLowerCase()))).slice(0, 8) : []), [rooms, query]);
71
+ // The messages: debounced; an older answer never replaces a newer query's; "Search older messages" appends.
72
+ const run = async (text, cursor = null) => {
73
+ const mine = ++seq.current;
74
+ if (!text || typeof client?.searchRoomMessages !== "function") { setRes({ status: "idle", hits: [] }); return; }
75
+ setRes((r) => ({ ...r, status: "loading", ...(cursor ? {} : { hits: [], cursor: null }) }));
76
+ const a = await client.searchRoomMessages(text, { limit: 30, ...(cursor ? { cursor } : {}) });
77
+ if (mine !== seq.current) return;
78
+ if (a?.ok) setRes((r) => ({ status: "ok", hits: [...(cursor ? r.hits : []), ...(a.hits || [])], cursor: a.cursor || null }));
79
+ else setRes((r) => ({ status: "error", hits: cursor ? r.hits : [], code: a?.code || "failed" }));
80
+ };
81
+ useEffect(() => { setActive(0); const h = setTimeout(() => void run(query), SEARCH_DEBOUNCE_MS); return () => clearTimeout(h); }, [query]);
82
+ const groups = byRoom(res.hits, names.length);
83
+ const flat = [...names.map((room) => ({ room })), ...groups.flatMap((g) => g.hits.map((x) => ({ hit: x.hit })))];
84
+ const pick = (item) => { if (!item) return; onClose(); if (item.room) openRoom(item.room); else openHit(item.hit); };
85
+ const onKey = (e) => {
86
+ if (e.isComposing) return;
87
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); if (flat.length) setActive((i) => (i + (e.key === "ArrowDown" ? 1 : flat.length - 1)) % flat.length); }
88
+ else if (e.key === "Enter" && flat.length) { e.preventDefault(); pick(flat[Math.min(active, flat.length - 1)]); }
89
+ };
90
+ useEffect(() => { ref.current?.querySelector?.(`#hub-search-opt-${active}`)?.scrollIntoView?.({ block: "nearest" }); }, [active]);
91
+ const activeId = flat.length ? `hub-search-opt-${Math.min(active, flat.length - 1)}` : undefined;
92
+ const failed = res.status === "error";
93
+ return html`<dialog data-trust="dialog" ref=${ref} class="dlg search-dlg hub-search-dlg" aria-label=${hroom("searchLabel")} onKeyDown=${onKey}>
94
+ <div class="search-box">
95
+ <div class="search-head"><${Icon} name="search" />
96
+ <input ref=${input} class="search-input" type="search" value=${q} placeholder=${hroom("searchPlaceholder")} aria-label=${hroom("searchLabel")}
97
+ role="combobox" aria-expanded=${flat.length ? "true" : "false"} aria-controls="hub-search-results" aria-autocomplete="list" aria-activedescendant=${activeId}
98
+ autocomplete="off" spellcheck=${false} enterkeyhint="search" onInput=${(e) => setQ(e.target.value)} />
99
+ <button type="button" class="icon-btn" aria-label=${hroom("searchClose")} title=${hroom("searchClose")} onClick=${onClose}><${Icon} name="close" /></button>
100
+ </div>
101
+ <div class="search-body">
102
+ ${!query ? html`<div class="search-empty"><p class="search-hint">${hroom("searchHint")}</p></div>` : html`
103
+ ${res.status === "loading" && !res.hits.length && !names.length ? html`<${Skeleton} variant="rows" lines=${4} label=${hroom("searchSearching")} />` : null}
104
+ ${failed ? html`<p class="search-status bad" role="alert">${res.code === "busy" ? hroom("searchBusy") : hroom("searchFailed")}</p>` : null}
105
+ ${res.status === "ok" && !res.hits.length && !names.length ? html`<p class="search-status" role="status">${res.cursor ? hroom("searchNoneYet") : hroom("searchNone")}</p>` : null}
106
+ <div id="hub-search-results" role="listbox" aria-label=${hroom("searchResults")} class=${`search-results${res.status === "loading" ? " stale" : ""}`}>
107
+ ${names.length ? html`<div role="group" class="search-group" aria-label=${hroom("searchRooms")}>
108
+ <div class="search-group-head" aria-hidden="true"><span>${hroom("searchRooms")}</span></div>
109
+ ${names.map((room, i) => html`<div id=${`hub-search-opt-${i}`} role="option" aria-selected=${i === active ? "true" : "false"} class=${`search-row${i === active ? " on" : ""}`}
110
+ onMouseMove=${i === active ? undefined : () => setActive(i)} onClick=${() => pick({ room })}>
111
+ <div class="search-row-top"><span class="search-badge chat">${room.kind === "group" ? hroom("searchBadgeRoom") : hroom("searchBadgeChat")}</span><span class="search-who">${roomLabel(room)}</span></div></div>`)}
112
+ </div>` : null}
113
+ ${groups.map((g) => html`<div role="group" class="search-group" aria-label=${g.name}>
114
+ <div class="search-group-head" aria-hidden="true"><span>${g.name}</span><span class="search-count">${hroom("searchCount", String(g.hits.length))}</span></div>
115
+ ${g.hits.map(({ hit, index }) => html`<div id=${`hub-search-opt-${index}`} role="option" aria-selected=${index === active ? "true" : "false"} class=${`search-row${index === active ? " on" : ""}`}
116
+ onMouseMove=${index === active ? undefined : () => setActive(index)} onClick=${() => pick({ hit })}>
117
+ <div class="search-row-top"><span class="search-who">${hit.author?.name || ""}</span>
118
+ <time class="search-time" datetime=${Number.isFinite(hit.at) ? new Date(hit.at).toISOString() : undefined}>${when(hit.at)}</time></div>
119
+ <div class="search-snippet">${segments(hit.snippet, hit.marks).map((s) => (s.mark ? html`<mark>${s.text}</mark>` : s.text))}</div></div>`)}
120
+ </div>`)}
121
+ </div>
122
+ ${res.cursor && res.status !== "loading" ? html`<p class="search-hint"><button type="button" class="chip-btn hub-search-more" onClick=${() => void run(query, res.cursor)}>${hroom("searchOlder")}</button></p>` : null}`}
123
+ </div>
124
+ <div class="search-foot" aria-hidden="true">${hroom("searchKeys")}</div>
125
+ </div></dialog>`;
126
+ }
@@ -24,6 +24,20 @@ register("hubRoom", {
24
24
  authorAgent: "{0} · {1}'s agent", authorAssistant: "Room assistant · Provided by the Hub",
25
25
  askProgress: "Answered {0} · working {1} · reply later {2}",
26
26
  allAnswered: "All {0} answered", expandRest: "Show {0} more",
27
+ // M-3127 reactions: who reacted ("Alex, Bob and 3 others reacted with 👍"), the add button, the picker
28
+ reactAdd: "Add reaction", reactPick: "Reactions", reactedWith: "{0} reacted with {1}", reactMore: "{0} and {1} others",
29
+ reactYou: "You", listSep: ", ", reactFailed: "Couldn't add the reaction. Try again.",
30
+ // M-3127 B: an agent's buttons (its asker's) and polls (everyone's)
31
+ onlyAsker: "Only {0} can answer", sysPollClosed: "{0}'s poll closed", buttonFailed: "That didn't go through. Try again.",
32
+ buttonNotAsker: "Only the person who asked can answer these buttons.", buttonExpired: "These buttons are no longer open.",
33
+ // M-3127 C: Ctrl K
34
+ searchLabel: "Search", searchPlaceholder: "Search rooms, chats and messages…", searchClose: "Close",
35
+ searchHint: "Find a room or chat by name, or a message by a word or two from it — in the rooms you're in.",
36
+ searchSearching: "Searching…", searchNone: "Nothing found", searchNoneYet: "Nothing in the newest messages yet.",
37
+ searchBusy: "Search is busy — try again in a moment.", searchFailed: "Search failed — try again.",
38
+ searchResults: "Results", searchRooms: "Rooms and chats", searchBadgeRoom: "Room", searchBadgeChat: "Chat", searchCount: "{0} results",
39
+ searchOlder: "Search older messages", searchKeys: "↑↓ move · Enter open · Esc close", jumpMissing: "That message is no longer in this room.",
40
+ filterPh: "Filter: name or owner", filterClear: "Clear the filter",
27
41
  laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer",
28
42
  workingOne: "{0} is working on it", workingMany: "{0} agents are working",
29
43
  // §4 composer
@@ -110,6 +124,14 @@ register("hubRoom", {
110
124
  joinAsManager: "Join as a room manager",
111
125
  // §12 unread: unreadN is the list-row count tooltip; mentionedYou is the row's @ mark.
112
126
  unreadPrefix: "({0})", unreadN: "{0} unread", mentionMark: "@", mentionedYou: "Mentioned you",
127
+ // §12 desktop notification (opt-in, like the Fleet's Notify me): the header toggle and one ping per kind.
128
+ notifyTitle: "Notify me on this device", notifyOn: "Notifications are on while a Hub tab is open.",
129
+ notifyOff: "Get a desktop notification when someone @mentions you, an agent answers, or a new invitation arrives.",
130
+ notifyDenied: "This browser blocked notifications. Allow them in the site settings to turn this on.",
131
+ notifyUnavailable: "This browser cannot show notifications here.",
132
+ turnOn: "Turn on", turnOff: "Turn off",
133
+ notifyMention: "{0} mentioned you in {1}: {2}", notifyAnswer: "{0} answered in {1}: {2}",
134
+ notifyInvite: "New invitation: {0}", notifyDirect: "{0}: {1}",
113
135
  // M-3092: a room's own line when an administrator joins; the prompts of a one-to-one chat (an agent's, the Hub assistant's).
114
136
  sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
115
137
  // M-3092 (Lumen's consent walk): an agent its owner shares, in rooms but asked by no one one-to-one; the Invitations page and row.
@@ -118,6 +140,9 @@ register("hubRoom", {
118
140
  peopleOne: "1 person", peopleMany: "{0} people", agentsOne: "1 agent", agentsMany: "{0} agents",
119
141
  // The @ progress line in parts, a part with 0 left out (Lumen): "Answered 1 · Working 1".
120
142
  progAnswered: "Answered {0}", progWorking: "Working {0}", progLater: "Reply later {0}",
143
+ progFailed: "Failed {0}", progBlocked: "Blocked {0}",
144
+ reasonExpired: "The question expired before an answer", reasonUnavailable: "The room assistant could not answer",
145
+ reasonInterrupted: "The answer was interrupted", reasonRetired: "This agent could not answer", reasonUnknown: "No reason given",
121
146
  roomsCanAskIt: "People in its rooms can @ it there. See In these rooms.", invitationsTitle: "Invitations",
122
147
  },
123
148
  "zh-TW": {
@@ -135,6 +160,17 @@ register("hubRoom", {
135
160
  authorAgent: "{0} · {1}的 Agent", authorAssistant: "房間助理 · Hub 提供",
136
161
  askProgress: "已回答 {0} · 處理中 {1} · 稍後回覆 {2}",
137
162
  allAnswered: "{0} 個都回答了", expandRest: "展開其餘 {0} 則",
163
+ reactAdd: "加上表情", reactPick: "表情回應", reactedWith: "{0} 回應了 {1}", reactMore: "{0} 和其他 {1} 人",
164
+ reactYou: "你", listSep: "、", reactFailed: "表情沒加上,請再試一次。",
165
+ onlyAsker: "只有 {0} 能回答", sysPollClosed: "{0} 的投票已結束", buttonFailed: "沒有送出,請再試一次。",
166
+ buttonNotAsker: "只有提問的人能按這些按鈕。", buttonExpired: "這些按鈕已經關閉。",
167
+ searchLabel: "搜尋", searchPlaceholder: "搜尋房間、聊天與訊息…", searchClose: "關閉",
168
+ searchHint: "用名稱找房間或聊天,或輸入訊息裡的一兩個詞找訊息(你所在的房間)。",
169
+ searchSearching: "搜尋中…", searchNone: "找不到結果", searchNoneYet: "最近的訊息裡還沒找到。",
170
+ searchBusy: "搜尋忙碌中,請稍後再試。", searchFailed: "搜尋失敗,請再試一次。",
171
+ searchResults: "結果", searchRooms: "房間與聊天", searchBadgeRoom: "房間", searchBadgeChat: "聊天", searchCount: "{0} 筆結果",
172
+ searchOlder: "搜尋更早的訊息", searchKeys: "↑↓ 移動 · Enter 開啟 · Esc 關閉", jumpMissing: "這則訊息已不在這個房間裡。",
173
+ filterPh: "篩選:名稱或擁有者", filterClear: "清除篩選",
138
174
  laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答",
139
175
  workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
140
176
  composer: "在「{0}」說話;@ 一個 Agent 請它回答",
@@ -159,7 +195,7 @@ register("hubRoom", {
159
195
  stAssistantDown: "暫時無法回答",
160
196
  stStopped: "已停止",
161
197
  mentionHere: "在這裡 @ 它", chatOneToOne: "和它一對一對話", removeFromRoom: "從房間移除",
162
- newRoomTitle: "新房間", name: "名稱", namePlaceholder: "例如:研一主管週會",
198
+ newRoomTitle: "新房間", name: "名稱", namePlaceholder: "例如:每週主管會議",
163
199
  addPeople: "加入人、團隊或 AD 群組:輸入名稱搜尋",
164
200
  addAgents: "加入自己的 Agent,或邀請別人的",
165
201
  invitePending: "邀請 · 等擁有者同意",
@@ -212,10 +248,20 @@ register("hubRoom", {
212
248
  noContent: "這裡看不到任何房間的內容。",
213
249
  joinAsManager: "加入自己成為房間管理",
214
250
  unreadPrefix: "({0})", unreadN: "{0} 則未讀", mentionMark: "@", mentionedYou: "有人 @ 你",
251
+ notifyTitle: "在這個裝置上通知我", notifyOn: "Hub 分頁開著時會收到通知。",
252
+ notifyOff: "有人 @ 你、Agent 回答或有新邀請時,收到桌面通知。",
253
+ notifyDenied: "這個瀏覽器封鎖了通知。請在網站設定中允許,才能開啟。",
254
+ notifyUnavailable: "這個瀏覽器在這裡無法顯示通知。",
255
+ turnOn: "開啟", turnOff: "關閉",
256
+ notifyMention: "{0} 在「{1}」@ 了你:{2}", notifyAnswer: "{0} 在「{1}」回答了:{2}",
257
+ notifyInvite: "新邀請:{0}", notifyDirect: "{0}:{1}",
215
258
  sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
216
259
  agentNoOneToOne: "還沒有人可以一對一提問", inRoomsOne: "在 1 個房間裡", inRoomsMany: "在 {0} 個房間裡",
217
260
  peopleOne: "1 人", peopleMany: "{0} 人", agentsOne: "1 個 Agent", agentsMany: "{0} 個 Agent",
218
261
  progAnswered: "已回答 {0}", progWorking: "處理中 {0}", progLater: "稍後回覆 {0}",
262
+ progFailed: "未回答 {0}", progBlocked: "無法回答 {0}",
263
+ reasonExpired: "問題在回答前就過期了", reasonUnavailable: "房間助理暫時無法回答",
264
+ reasonInterrupted: "回答被中斷", reasonRetired: "這個 Agent 無法回答", reasonUnknown: "沒有說明原因",
219
265
  roomsCanAskIt: "房間裡的人可以在房間裡 @ 它,見「在這些房間裡」。", invitationsTitle: "邀請",
220
266
  },
221
267
  });