@songsid/agend 2.4.0-beta.3 → 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 (274) hide show
  1. package/dist/agent-endpoint.d.ts +1 -1
  2. package/dist/agent-endpoint.js +8 -2
  3. package/dist/agent-endpoint.js.map +1 -1
  4. package/dist/auth-api.d.ts +3 -0
  5. package/dist/auth-api.js +15 -1
  6. package/dist/auth-api.js.map +1 -1
  7. package/dist/backend/agy-model-switch.d.ts +22 -0
  8. package/dist/backend/agy-model-switch.js +62 -0
  9. package/dist/backend/agy-model-switch.js.map +1 -0
  10. package/dist/backend/antigravity.js +50 -1
  11. package/dist/backend/antigravity.js.map +1 -1
  12. package/dist/backend/cli-runtime-switch.d.ts +71 -0
  13. package/dist/backend/cli-runtime-switch.js +176 -0
  14. package/dist/backend/cli-runtime-switch.js.map +1 -0
  15. package/dist/backend/codex-model-switch.d.ts +41 -0
  16. package/dist/backend/codex-model-switch.js +170 -0
  17. package/dist/backend/codex-model-switch.js.map +1 -0
  18. package/dist/backend/grok-model-switch.d.ts +16 -0
  19. package/dist/backend/grok-model-switch.js +45 -0
  20. package/dist/backend/grok-model-switch.js.map +1 -0
  21. package/dist/backend/grok.js +1 -1
  22. package/dist/backend/grok.js.map +1 -1
  23. package/dist/backend/muse.d.ts +2 -0
  24. package/dist/backend/muse.js +7 -3
  25. package/dist/backend/muse.js.map +1 -1
  26. package/dist/build-provenance.json +1 -1
  27. package/dist/channel/mcp-server.js +10 -1
  28. package/dist/channel/mcp-server.js.map +1 -1
  29. package/dist/channel/mcp-tools.js +8 -0
  30. package/dist/channel/mcp-tools.js.map +1 -1
  31. package/dist/cli-audited.js +12 -12
  32. package/dist/cli-audited.js.map +1 -1
  33. package/dist/daemon.d.ts +47 -1
  34. package/dist/daemon.js +301 -20
  35. package/dist/daemon.js.map +1 -1
  36. package/dist/delivery-consumed-watch.js +3 -0
  37. package/dist/delivery-consumed-watch.js.map +1 -1
  38. package/dist/fleet-manager.d.ts +102 -0
  39. package/dist/fleet-manager.js +663 -25
  40. package/dist/fleet-manager.js.map +1 -1
  41. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
  42. package/dist/general-knowledge/skills/fleet-health/SKILL.md +9 -1
  43. package/dist/general-knowledge/skills/hub/SKILL.md +154 -0
  44. package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -0
  45. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -3
  46. package/dist/hub/admin-dashboard.d.ts +85 -0
  47. package/dist/hub/admin-dashboard.js +161 -0
  48. package/dist/hub/admin-dashboard.js.map +1 -0
  49. package/dist/hub/attachments/store.d.ts +2 -0
  50. package/dist/hub/attachments/store.js +6 -0
  51. package/dist/hub/attachments/store.js.map +1 -1
  52. package/dist/hub/client.d.ts +10 -0
  53. package/dist/hub/client.js +72 -10
  54. package/dist/hub/client.js.map +1 -1
  55. package/dist/hub/compose/member.d.ts +20 -0
  56. package/dist/hub/compose/member.js +212 -17
  57. package/dist/hub/compose/member.js.map +1 -1
  58. package/dist/hub/compose/server.d.ts +8 -0
  59. package/dist/hub/compose/server.js +13 -2
  60. package/dist/hub/compose/server.js.map +1 -1
  61. package/dist/hub/display-name.d.ts +10 -0
  62. package/dist/hub/display-name.js +35 -0
  63. package/dist/hub/display-name.js.map +1 -0
  64. package/dist/hub/execution/service.d.ts +1 -0
  65. package/dist/hub/execution/service.js +1 -1
  66. package/dist/hub/execution/service.js.map +1 -1
  67. package/dist/hub/fleet-info.d.ts +12 -0
  68. package/dist/hub/fleet-info.js +14 -0
  69. package/dist/hub/fleet-info.js.map +1 -0
  70. package/dist/hub/fleet-update-model.d.ts +100 -0
  71. package/dist/hub/fleet-update-model.js +15 -0
  72. package/dist/hub/fleet-update-model.js.map +1 -0
  73. package/dist/hub/fleet-updates.d.ts +46 -0
  74. package/dist/hub/fleet-updates.js +282 -0
  75. package/dist/hub/fleet-updates.js.map +1 -0
  76. package/dist/hub/fleet-versions.d.ts +28 -0
  77. package/dist/hub/fleet-versions.js +80 -0
  78. package/dist/hub/fleet-versions.js.map +1 -0
  79. package/dist/hub/http/compose.d.ts +2 -0
  80. package/dist/hub/http/compose.js +192 -16
  81. package/dist/hub/http/compose.js.map +1 -1
  82. package/dist/hub/http/deps.d.ts +1 -0
  83. package/dist/hub/http/schema.js +13 -1
  84. package/dist/hub/http/schema.js.map +1 -1
  85. package/dist/hub/member/display-name.d.ts +9 -0
  86. package/dist/hub/member/display-name.js +71 -0
  87. package/dist/hub/member/display-name.js.map +1 -0
  88. package/dist/hub/member/exposure-api.d.ts +4 -0
  89. package/dist/hub/member/exposure-api.js +8 -3
  90. package/dist/hub/member/exposure-api.js.map +1 -1
  91. package/dist/hub/member/exposures.d.ts +4 -0
  92. package/dist/hub/member/exposures.js +20 -0
  93. package/dist/hub/member/exposures.js.map +1 -1
  94. package/dist/hub/member/pairing-api.js +3 -2
  95. package/dist/hub/member/pairing-api.js.map +1 -1
  96. package/dist/hub/member/recommendations.d.ts +37 -0
  97. package/dist/hub/member/recommendations.js +129 -0
  98. package/dist/hub/member/recommendations.js.map +1 -0
  99. package/dist/hub/member/room-ask.d.ts +60 -1
  100. package/dist/hub/member/room-ask.js +250 -22
  101. package/dist/hub/member/room-ask.js.map +1 -1
  102. package/dist/hub/member/room-post-answers.d.ts +52 -0
  103. package/dist/hub/member/room-post-answers.js +152 -0
  104. package/dist/hub/member/room-post-answers.js.map +1 -0
  105. package/dist/hub/member/room-post-receipt.d.ts +21 -0
  106. package/dist/hub/member/room-post-receipt.js +49 -0
  107. package/dist/hub/member/room-post-receipt.js.map +1 -0
  108. package/dist/hub/member/room-post.d.ts +100 -0
  109. package/dist/hub/member/room-post.js +223 -0
  110. package/dist/hub/member/room-post.js.map +1 -0
  111. package/dist/hub/member/updates.d.ts +92 -0
  112. package/dist/hub/member/updates.js +316 -0
  113. package/dist/hub/member/updates.js.map +1 -0
  114. package/dist/hub/protocol.d.ts +658 -1
  115. package/dist/hub/protocol.js +90 -13
  116. package/dist/hub/protocol.js.map +1 -1
  117. package/dist/hub/published-version.d.ts +3 -0
  118. package/dist/hub/published-version.js +35 -0
  119. package/dist/hub/published-version.js.map +1 -0
  120. package/dist/hub/recommendation-model.d.ts +36 -0
  121. package/dist/hub/recommendation-model.js +9 -0
  122. package/dist/hub/recommendation-model.js.map +1 -0
  123. package/dist/hub/recommendations.d.ts +58 -0
  124. package/dist/hub/recommendations.js +211 -0
  125. package/dist/hub/recommendations.js.map +1 -0
  126. package/dist/hub/representative.d.ts +3 -0
  127. package/dist/hub/representative.js +1 -0
  128. package/dist/hub/representative.js.map +1 -1
  129. package/dist/hub/room-context-model.d.ts +43 -0
  130. package/dist/hub/room-context-model.js +12 -0
  131. package/dist/hub/room-context-model.js.map +1 -0
  132. package/dist/hub/rooms/agents.d.ts +41 -9
  133. package/dist/hub/rooms/agents.js +183 -21
  134. package/dist/hub/rooms/agents.js.map +1 -1
  135. package/dist/hub/rooms/assistant.d.ts +1 -6
  136. package/dist/hub/rooms/assistant.js +7 -2
  137. package/dist/hub/rooms/assistant.js.map +1 -1
  138. package/dist/hub/rooms/automation.d.ts +24 -0
  139. package/dist/hub/rooms/automation.js +66 -0
  140. package/dist/hub/rooms/automation.js.map +1 -0
  141. package/dist/hub/rooms/buttons.d.ts +85 -0
  142. package/dist/hub/rooms/buttons.js +62 -0
  143. package/dist/hub/rooms/buttons.js.map +1 -0
  144. package/dist/hub/rooms/context-cursor.d.ts +18 -0
  145. package/dist/hub/rooms/context-cursor.js +61 -0
  146. package/dist/hub/rooms/context-cursor.js.map +1 -0
  147. package/dist/hub/rooms/context.d.ts +1 -1
  148. package/dist/hub/rooms/context.js +4 -4
  149. package/dist/hub/rooms/context.js.map +1 -1
  150. package/dist/hub/rooms/mentions.d.ts +15 -0
  151. package/dist/hub/rooms/mentions.js +43 -0
  152. package/dist/hub/rooms/mentions.js.map +1 -0
  153. package/dist/hub/rooms/post-replies.d.ts +23 -0
  154. package/dist/hub/rooms/post-replies.js +114 -0
  155. package/dist/hub/rooms/post-replies.js.map +1 -0
  156. package/dist/hub/rooms/schema.d.ts +9 -0
  157. package/dist/hub/rooms/schema.js +43 -0
  158. package/dist/hub/rooms/schema.js.map +1 -1
  159. package/dist/hub/rooms/service.d.ts +136 -1
  160. package/dist/hub/rooms/service.js +727 -18
  161. package/dist/hub/rooms/service.js.map +1 -1
  162. package/dist/hub/rooms/types.d.ts +27 -3
  163. package/dist/hub/rooms.js +1 -1
  164. package/dist/hub/rooms.js.map +1 -1
  165. package/dist/hub/runtime.d.ts +1 -1
  166. package/dist/hub/runtime.js +12 -0
  167. package/dist/hub/runtime.js.map +1 -1
  168. package/dist/hub/server.d.ts +6 -1
  169. package/dist/hub/server.js +75 -5
  170. package/dist/hub/server.js.map +1 -1
  171. package/dist/hub/settings-directory-proof.js +22 -1
  172. package/dist/hub/settings-directory-proof.js.map +1 -1
  173. package/dist/hub/types.d.ts +133 -2
  174. package/dist/hub-contact-windows.d.ts +11 -0
  175. package/dist/hub-contact-windows.js +56 -0
  176. package/dist/hub-contact-windows.js.map +1 -0
  177. package/dist/hub-pairing-summary.d.ts +1 -1
  178. package/dist/hub-room-conversation.d.ts +14 -0
  179. package/dist/hub-room-conversation.js +60 -0
  180. package/dist/hub-room-conversation.js.map +1 -0
  181. package/dist/hub-update-notice.d.ts +12 -0
  182. package/dist/hub-update-notice.js +35 -0
  183. package/dist/hub-update-notice.js.map +1 -0
  184. package/dist/locale.js +56 -2
  185. package/dist/locale.js.map +1 -1
  186. package/dist/native-mcp.js +9 -6
  187. package/dist/native-mcp.js.map +1 -1
  188. package/dist/outbound-handlers.d.ts +14 -4
  189. package/dist/outbound-handlers.js +54 -1
  190. package/dist/outbound-handlers.js.map +1 -1
  191. package/dist/outbound-schemas.d.ts +12 -0
  192. package/dist/outbound-schemas.js +12 -0
  193. package/dist/outbound-schemas.js.map +1 -1
  194. package/dist/pane-port.d.ts +2 -0
  195. package/dist/queued-handoffs.d.ts +16 -4
  196. package/dist/queued-handoffs.js +18 -1
  197. package/dist/queued-handoffs.js.map +1 -1
  198. package/dist/runtime-cli-install.js +13 -10
  199. package/dist/runtime-cli-install.js.map +1 -1
  200. package/dist/settings-api.d.ts +1 -0
  201. package/dist/settings-api.js +87 -0
  202. package/dist/settings-api.js.map +1 -1
  203. package/dist/tmux-manager.d.ts +2 -0
  204. package/dist/tmux-manager.js +2 -0
  205. package/dist/tmux-manager.js.map +1 -1
  206. package/dist/tool-permissions.js +3 -0
  207. package/dist/tool-permissions.js.map +1 -1
  208. package/dist/ui/chat-msg-actions.js +3 -222
  209. package/dist/ui/hub-admin-overview.js +189 -0
  210. package/dist/ui/hub-client.js +36 -4
  211. package/dist/ui/hub-fleet-versions.js +393 -0
  212. package/dist/ui/hub-room-agent-strings.js +28 -0
  213. package/dist/ui/hub-room-composer.js +5 -3
  214. package/dist/ui/hub-room-members-strings.js +2 -2
  215. package/dist/ui/hub-room-members.js +3 -2
  216. package/dist/ui/hub-room-notify.js +161 -0
  217. package/dist/ui/hub-room-search.js +126 -0
  218. package/dist/ui/hub-room-strings.js +46 -0
  219. package/dist/ui/hub-room-thread.js +239 -34
  220. package/dist/ui/hub-room-unread.js +2 -1
  221. package/dist/ui/hub-strings.js +8 -0
  222. package/dist/ui/image-annotate.js +2 -283
  223. package/dist/ui/image-lightbox.js +2 -176
  224. package/dist/ui/image-zoom.js +2 -242
  225. package/dist/ui/notice-hub-update.js +94 -0
  226. package/dist/ui/panel-chat.js +35 -6
  227. package/dist/ui/panel-hub.js +133 -19
  228. package/dist/ui/panel-notices.js +3 -1
  229. package/dist/ui/panel-settings.js +1 -1
  230. package/dist/ui/settings-hub-updates.js +67 -0
  231. package/dist/ui/settings-hub.js +28 -3
  232. package/dist/ui/settings-registry.js +1 -0
  233. package/dist/ui/settings-update.js +11 -5
  234. package/dist/ui/settings-web-authority.js +1 -1
  235. package/dist/ui/shared/app-i18n.js +2 -0
  236. package/dist/ui/shared/app-nav.js +6 -2
  237. package/dist/ui/shared/app-prefs.js +2 -1
  238. package/dist/ui/shared/app-shell.js +11 -1
  239. package/dist/ui/shared/app-update.js +90 -8
  240. package/dist/ui/shared/app.css +20 -0
  241. package/dist/ui/shared/chat-msg-actions.js +225 -0
  242. package/dist/ui/shared/chat-thread.js +70 -5
  243. package/dist/ui/shared/chat-work-bar.css +25 -13
  244. package/dist/ui/shared/hub-chat.css +6 -1
  245. package/dist/ui/shared/hub-owner.css +104 -0
  246. package/dist/ui/shared/hub-rooms-u2.css +16 -0
  247. package/dist/ui/shared/hub.css +5 -0
  248. package/dist/ui/shared/image-annotate.js +306 -0
  249. package/dist/ui/shared/image-lightbox.js +183 -0
  250. package/dist/ui/shared/image-zoom.js +242 -0
  251. package/dist/ui/shared/instance-nav.js +36 -7
  252. package/dist/ui/shared/view-strings.js +6 -0
  253. package/dist/ui/shared/web-authorize.js +2 -2
  254. package/dist/update-dispatch.d.ts +8 -1
  255. package/dist/update-dispatch.js +16 -1
  256. package/dist/update-dispatch.js.map +1 -1
  257. package/dist/update-idle.d.ts +65 -0
  258. package/dist/update-idle.js +190 -0
  259. package/dist/update-idle.js.map +1 -0
  260. package/dist/update-launch.d.ts +1 -1
  261. package/dist/update-launch.js +9 -2
  262. package/dist/update-launch.js.map +1 -1
  263. package/dist/usage/profile-timeline.d.ts +2 -0
  264. package/dist/usage/profile-timeline.js +4 -0
  265. package/dist/usage/profile-timeline.js.map +1 -1
  266. package/dist/web-api.js +19 -2
  267. package/dist/web-api.js.map +1 -1
  268. package/dist/web-notices.d.ts +3 -0
  269. package/dist/web-notices.js +17 -2
  270. package/dist/web-notices.js.map +1 -1
  271. package/dist/web-prefs.js +1 -0
  272. package/dist/web-prefs.js.map +1 -1
  273. package/dist/web-update.d.ts +15 -1
  274. package/package.json +1 -1
@@ -70,4 +70,47 @@ export const HUB_ROOM_DIRECTORY_MIGRATION = Object.freeze({ component: "s3-room-
70
70
  export const HUB_ROOM_RETRY_MIGRATION = Object.freeze({ component: "s3-room-retry", version: 1, up(db) {
71
71
  db.exec("ALTER TABLE hub_room_deliveries ADD COLUMN last_sent_at INTEGER NOT NULL DEFAULT 0");
72
72
  } });
73
+ /** Agent sources and automation admission are retained separately from human/grant delivery history. */
74
+ export const HUB_ROOM_AGENT_POSTS_MIGRATION = Object.freeze({ component: "s3-room-agent-posts", version: 1, up(db) {
75
+ db.exec(`ALTER TABLE hub_room_deliveries ADD COLUMN source_exposure_id TEXT;
76
+ ALTER TABLE hub_room_deliveries ADD COLUMN source_exposure_revision INTEGER;
77
+ ALTER TABLE hub_room_deliveries ADD COLUMN source_fleet_id TEXT;
78
+ ALTER TABLE hub_room_deliveries ADD COLUMN on_behalf INTEGER NOT NULL DEFAULT 0;
79
+ CREATE TABLE hub_room_automation(room_id TEXT PRIMARY KEY REFERENCES hub_group_rooms(id),root_id TEXT NOT NULL,last_agent_ask INTEGER NOT NULL);
80
+ CREATE TABLE hub_room_post_lineage(post_id TEXT PRIMARY KEY REFERENCES hub_room_posts(id),root_id TEXT NOT NULL,depth INTEGER NOT NULL,audience_sequence INTEGER NOT NULL,return_post_id TEXT);
81
+ CREATE TABLE hub_room_agent_depths(root_id TEXT NOT NULL,exposure_id TEXT NOT NULL,depth INTEGER NOT NULL,PRIMARY KEY(root_id,exposure_id));
82
+ CREATE TABLE hub_room_agent_actions(id INTEGER PRIMARY KEY,room_id TEXT NOT NULL,exposure_id TEXT NOT NULL,at INTEGER NOT NULL);
83
+ CREATE INDEX hub_room_agent_actions_window ON hub_room_agent_actions(at);
84
+ CREATE INDEX hub_room_agent_actions_source ON hub_room_agent_actions(exposure_id,at);
85
+ CREATE TABLE hub_room_agent_operations(exposure_id TEXT NOT NULL,idempotency_key TEXT NOT NULL,digest TEXT NOT NULL,selector TEXT NOT NULL,
86
+ room_id TEXT NOT NULL,post_id TEXT NOT NULL REFERENCES hub_room_posts(id),owner TEXT NOT NULL,fleet_id TEXT NOT NULL,at INTEGER NOT NULL,member_id TEXT NOT NULL,receipt_id TEXT,person_name TEXT,via_name TEXT,
87
+ PRIMARY KEY(exposure_id,idempotency_key));
88
+ CREATE TABLE hub_room_human_receipts(room_id TEXT NOT NULL,owner TEXT NOT NULL,receipt_id TEXT NOT NULL,root_id TEXT NOT NULL,PRIMARY KEY(room_id,owner,receipt_id));
89
+ CREATE TABLE hub_room_post_returns(id TEXT PRIMARY KEY,post_id TEXT NOT NULL,answer_id TEXT NOT NULL,exposure_id TEXT NOT NULL,owner TEXT NOT NULL,fleet_id TEXT NOT NULL,
90
+ payload_ref TEXT NOT NULL,payload_digest TEXT NOT NULL,created_at INTEGER NOT NULL,expires_at INTEGER NOT NULL,sent_epoch INTEGER NOT NULL DEFAULT 0,last_sent_at INTEGER NOT NULL DEFAULT 0,acked INTEGER NOT NULL DEFAULT 0,
91
+ UNIQUE(post_id,answer_id));
92
+ CREATE INDEX hub_room_post_returns_pending ON hub_room_post_returns(fleet_id,expires_at) WHERE acked=0;
93
+ CREATE TABLE hub_room_agent_stops(post_id TEXT PRIMARY KEY REFERENCES hub_room_posts(id),source_id TEXT NOT NULL,reason TEXT NOT NULL,name TEXT NOT NULL,retry_at INTEGER,coalesce_key TEXT NOT NULL UNIQUE);
94
+ CREATE INDEX hub_room_agent_stops_source ON hub_room_agent_stops(source_id);`);
95
+ } });
96
+ /** M-3127: people's (and agents') emoji reactions on room posts — set semantics, one row per member and emoji. */
97
+ export const HUB_ROOM_REACTIONS_MIGRATION = Object.freeze({ component: "s3-room-reactions", version: 1, up(db) {
98
+ db.exec(`CREATE TABLE hub_room_reactions(room_id TEXT NOT NULL REFERENCES hub_group_rooms(id),post_id TEXT NOT NULL REFERENCES hub_room_posts(id),
99
+ member_id TEXT NOT NULL,emoji TEXT NOT NULL,created_at INTEGER NOT NULL,PRIMARY KEY(post_id,member_id,emoji));
100
+ CREATE INDEX hub_room_reactions_room ON hub_room_reactions(room_id,post_id);`);
101
+ } });
102
+ /**
103
+ * M-3127: an agent answer's buttons or poll in a group room. Choices live in the content store (content_ref); a plain
104
+ * set answers only its asker (asker_member, possibly an agent membership); a poll takes one ballot per person member.
105
+ */
106
+ export const HUB_ROOM_BUTTONS_MIGRATION = Object.freeze({ component: "s3-room-buttons", version: 1, up(db) {
107
+ db.exec(`CREATE TABLE hub_room_buttons(id TEXT PRIMARY KEY,post_id TEXT NOT NULL UNIQUE REFERENCES hub_room_posts(id),room_id TEXT NOT NULL REFERENCES hub_group_rooms(id),
108
+ delivery_id TEXT NOT NULL,asker_member TEXT NOT NULL,content_ref TEXT NOT NULL,created_at INTEGER NOT NULL,expires_at INTEGER NOT NULL,
109
+ state TEXT NOT NULL CHECK(state IN ('open','chosen','closed','expired')),revision INTEGER NOT NULL DEFAULT 1,
110
+ chosen_index INTEGER,chosen_member TEXT,closed_at INTEGER,result_post TEXT);
111
+ CREATE INDEX hub_room_buttons_due ON hub_room_buttons(state,expires_at);
112
+ CREATE TABLE hub_room_votes(set_id TEXT NOT NULL REFERENCES hub_room_buttons(id),member_id TEXT NOT NULL,options TEXT NOT NULL,at INTEGER NOT NULL,PRIMARY KEY(set_id,member_id));
113
+ CREATE TABLE hub_room_button_operations(room_id TEXT NOT NULL,member_id TEXT NOT NULL,idempotency_key TEXT NOT NULL,set_id TEXT NOT NULL,digest TEXT NOT NULL,
114
+ PRIMARY KEY(room_id,member_id,idempotency_key));`);
115
+ } });
73
116
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/hub/rooms/schema.ts"],"names":[],"mappings":"AAGA,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QAC9H,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BT,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,CAAC;AAEL,wGAAwG;AACxG,M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C,MAAM,wBAAwB,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QACxI,EAAE,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC;AAEL,wGAAwG;AACxG,MAAM,CAAC,MAAM,8BAA8B,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QACpJ,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;6EAmBmE,CAAC,CAAC;IAC/E,CAAC,EAAE,CAAC,CAAC;AAEL,kHAAkH;AAClH,MAAM,CAAC,MAAM,4BAA4B,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QAChJ,EAAE,CAAC,IAAI,CAAC;;6EAEmE,CAAC,CAAC;IAC/E,CAAC,EAAE,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QAC5I,EAAE,CAAC,IAAI,CAAC;;;;;;;mDAOyC,CAAC,CAAC;IACrD,CAAC,EAAE,CAAC,CAAC"}
@@ -1,11 +1,34 @@
1
1
  import type Database from "better-sqlite3";
2
+ import { RoomPostReplies } from "./post-replies.js";
2
3
  import { HubRoomAssistant } from "./assistant.js";
3
4
  import { HubRoomAgents } from "./agents.js";
4
5
  import { HubCore } from "../http/core.js";
5
- import type { HubRequestContext, HubTx } from "../types.js";
6
+ import type { HubLinkContext } from "../server.js";
7
+ import type { HubRoomListResult, HubRoomPostResult, HubRoomMembersResult, HubPeopleSearchResult, HubRequestContext, HubTx } from "../types.js";
6
8
  import type { RoomEvent, RoomMessage, RoomSystemEvent } from "./types.js";
7
9
  import type { RoomInvitationHost } from "../invitations.js";
8
10
  type DB = Database.Database;
11
+ export interface GroupRoomFileView {
12
+ id: string;
13
+ name: string;
14
+ size: number;
15
+ mime: string;
16
+ url: string;
17
+ }
18
+ /** M-3127 C: how many posts one search reads at most, and the most hits it returns. */
19
+ export declare const ROOM_SEARCH_SCAN = 2000, ROOM_SEARCH_LIMIT = 50, ROOM_SEARCH_PER_MINUTE = 30;
20
+ /**
21
+ * M-3127 C: a hit's words — up to `width` characters around its first term, on whole characters, with every term's places
22
+ * in that snippet (`marks`: [start, end) ranges, merged). The page marks them; it never parses HTML.
23
+ */
24
+ export declare function searchSnippet(text: string, terms: string[], width?: number): {
25
+ snippet: string;
26
+ marks: [number, number][];
27
+ };
28
+ /** M-3127: the most distinct emoji one post carries. */
29
+ export declare const ROOM_REACTION_LIMIT = 12;
30
+ /** One emoji as a person picks it: one grapheme, a pictograph (ZWJ sequences, FE0F and skin tones kept), no controls. */
31
+ export declare function validRoomEmoji(s: unknown): s is string;
9
32
  export declare class HubRoomRefusal extends Error {
10
33
  readonly status: number;
11
34
  readonly code: string;
@@ -18,7 +41,17 @@ export declare class HubGroupRooms {
18
41
  private listeners;
19
42
  readonly agents: HubRoomAgents;
20
43
  readonly assistant: HubRoomAssistant;
44
+ readonly postReplies: RoomPostReplies;
21
45
  private readonly directory;
46
+ private readonly automation;
47
+ /** M-3127 B: answers' buttons and polls; one timer for the next deadline (cleared by close()). */
48
+ private readonly buttons;
49
+ private buttonsTimer;
50
+ private buttonsClosed;
51
+ /** M-3127 C (Fable P3b): each person's recent searches (their times), for ROOM_SEARCH_PER_MINUTE. */
52
+ private readonly searches;
53
+ private readonly agentSearch;
54
+ private readonly agentReadBuckets;
22
55
  constructor(core: HubCore);
23
56
  has(id: string): boolean;
24
57
  subscribe(listener: (event: RoomEvent) => void): () => void;
@@ -38,6 +71,25 @@ export declare class HubGroupRooms {
38
71
  private name;
39
72
  private maximum;
40
73
  private projection;
74
+ /** M-3127: a post's reactions, each emoji in the order it first appeared, its members in the order they reacted. */
75
+ private reactions;
76
+ private filesStore;
77
+ private store;
78
+ /** M-3125: a post's files, in order (none when the Hub has no attachment store). */
79
+ private filesOf;
80
+ private viaAuthor;
81
+ private agentMetadata;
82
+ private stop;
83
+ /** Both answers and proactive posts use this transaction, once, before any external delivery. */
84
+ private agentMentions;
85
+ private agentEffects;
86
+ private agentSource;
87
+ agentRooms(input: unknown, link: HubLinkContext): Promise<HubRoomListResult>;
88
+ private agentRead;
89
+ agentMembers(input: unknown, link: HubLinkContext): Promise<HubRoomMembersResult>;
90
+ agentPeople(input: unknown, link: HubLinkContext): Promise<HubPeopleSearchResult>;
91
+ private agentRoomChoices;
92
+ agentPost(input: unknown, link: HubLinkContext): Promise<HubRoomPostResult>;
41
93
  private insert;
42
94
  private summary;
43
95
  private addAssistant;
@@ -158,6 +210,7 @@ export declare class HubGroupRooms {
158
210
  lastAuthor: string;
159
211
  mentioned: boolean;
160
212
  archived: boolean;
213
+ features?: string[] | undefined;
161
214
  } | {
162
215
  id: string;
163
216
  name: string;
@@ -174,6 +227,7 @@ export declare class HubGroupRooms {
174
227
  kind: "direct";
175
228
  assistant: boolean;
176
229
  presence: "idle" | "paused" | "working";
230
+ features?: string[] | undefined;
177
231
  };
178
232
  me: {
179
233
  id: string;
@@ -253,6 +307,7 @@ export declare class HubGroupRooms {
253
307
  lastAuthor: string;
254
308
  mentioned: boolean;
255
309
  archived: boolean;
310
+ features?: string[] | undefined;
256
311
  } | {
257
312
  id: string;
258
313
  name: string;
@@ -269,6 +324,7 @@ export declare class HubGroupRooms {
269
324
  kind: "direct";
270
325
  assistant: boolean;
271
326
  presence: "idle" | "paused" | "working";
327
+ features?: string[] | undefined;
272
328
  };
273
329
  me: {
274
330
  id: string;
@@ -348,6 +404,7 @@ export declare class HubGroupRooms {
348
404
  lastAuthor: string;
349
405
  mentioned: boolean;
350
406
  archived: boolean;
407
+ features?: string[] | undefined;
351
408
  } | {
352
409
  id: string;
353
410
  name: string;
@@ -364,6 +421,7 @@ export declare class HubGroupRooms {
364
421
  kind: "direct";
365
422
  assistant: boolean;
366
423
  presence: "idle" | "paused" | "working";
424
+ features?: string[] | undefined;
367
425
  };
368
426
  me: {
369
427
  id: string;
@@ -440,6 +498,83 @@ export declare class HubGroupRooms {
440
498
  more: boolean;
441
499
  }>;
442
500
  post(ctx: HubRequestContext, id: string, input: unknown): Promise<RoomMessage>;
501
+ /**
502
+ * M-3127: add or take back my reaction on a post I can see (since my joined_sequence; not a room line, not an answer
503
+ * still to come). Set semantics: adding twice or removing what is not there changes nothing and emits nothing.
504
+ */
505
+ react(ctx: HubRequestContext, id: string, postId: unknown, input: unknown): Promise<{
506
+ reactions: NonNullable<RoomMessage["reactions"]>;
507
+ }>;
508
+ /**
509
+ * M-3127: a post exactly as messages() shows it to `member` — since their joined_sequence, its lineage's audience floor
510
+ * too (Ridge, M-3118: the descendants of a question older than them stay hidden), and an answer only when its question
511
+ * is theirs to see. 404 otherwise.
512
+ */
513
+ private visiblePost;
514
+ /** M-3127: a member's name as the room shows it (a person's display name, an agent's exposure name, the assistant). */
515
+ private memberName;
516
+ /**
517
+ * M-3127 B: press an answer's button, or vote in its poll (the direct chat's body: { setId, index | options,
518
+ * idempotencyKey }). Plain buttons: the question's asker only (403 not-asker), the first press wins, and it becomes the
519
+ * asker's own room message — the button's label, replying to the answer, to that agent — delivered by the ordinary room
520
+ * ask (the agent gets the click line). Polls: every person who can see it; a later vote replaces mine until it closes.
521
+ */
522
+ click(ctx: HubRequestContext, id: string, input: unknown): Promise<{
523
+ ok: true;
524
+ }>;
525
+ /** M-3127 B: the next open set's deadline, once; closes what is due and arms again (30 s after a failure). */
526
+ private armButtons;
527
+ /**
528
+ * M-3127 B: sets past their deadline. Buttons expire. A poll closes: one room line (「投票結束」, in the poll's lineage —
529
+ * Ridge: a system consequence, never a fresh human root) and the results delivered to the agent that asked it, on behalf
530
+ * of that question's asker (the Fleet chat's [poll results]).
531
+ */
532
+ private closeDueButtons;
533
+ /**
534
+ * M-3127 (agent reactions, on room-answer-buttons-v1): an agent's reaction (its `react`) to the room question it was asked — only on that delivery's
535
+ * own question, from the Fleet and owner it went to, while the agent is still in the room. One reaction per agent and
536
+ * post (a later one replaces it; "" takes it back), stored under the agent's membership; the post as it now is goes out
537
+ * on the room stream (message.updated).
538
+ */
539
+ agentReact(input: import("../types.js").HubRoomReact, link: import("../server.js").HubLinkContext): Promise<import("../types.js").HubRoomReactResult>;
540
+ /** A read or a press first closes what is already due (a suspended host's timer may be late): never a stale open poll. */
541
+ private settleButtons;
542
+ /**
543
+ * M-3127 C: messages with these words in the group rooms I am in, newest first — exactly what messages() would show me
544
+ * (since my joined_sequence, the lineage floor, answered rows only, no room lines). The text is encrypted at rest and
545
+ * retention deletes it, so there is no plaintext index: a bounded scan (ROOM_SEARCH_SCAN posts a request), and `cursor`
546
+ * when more remain ("search older messages"). Every word must appear (NFKC, case-folded). ROOM_SEARCH_PER_MINUTE each.
547
+ */
548
+ search(ctx: HubRequestContext, q: unknown, limit?: unknown, cursor?: unknown): Promise<{
549
+ hits: {
550
+ roomId: string;
551
+ roomName: string;
552
+ messageId: string;
553
+ sequence: number;
554
+ at: number;
555
+ author: {
556
+ kind: string;
557
+ name: string;
558
+ };
559
+ snippet: string;
560
+ marks: [number, number][];
561
+ }[];
562
+ cursor?: string | undefined;
563
+ }>;
564
+ /** M-3125: before any upload body is read — a member of a room that is not archived, and room in their pending budget. */
565
+ uploadAdmit(ctx: HubRequestContext, id: string, declaredBytes: number): Promise<void>;
566
+ /** M-3125: a member's file for a later post in this room, pending one hour (as in a 1:1 chat). */
567
+ upload(ctx: HubRequestContext, id: string, name: string, bytes: Buffer): Promise<GroupRoomFileView>;
568
+ /**
569
+ * M-3125: one of this room's files, for a current member: a file on a post they can see (at or after their join floor, the
570
+ * room's history rule) or their own pending upload. Every read is audited.
571
+ */
572
+ download(ctx: HubRequestContext, id: string, fileId: string): Promise<{
573
+ name: string;
574
+ mime: string;
575
+ image: boolean;
576
+ bytes: Buffer;
577
+ }>;
443
578
  markRead(ctx: HubRequestContext, id: string, upTo: unknown): Promise<{
444
579
  ok: boolean;
445
580
  }>;