@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.
- package/dist/agent-endpoint.d.ts +1 -1
- package/dist/agent-endpoint.js +8 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +3 -0
- package/dist/auth-api.js +15 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/agy-model-switch.d.ts +22 -0
- package/dist/backend/agy-model-switch.js +62 -0
- package/dist/backend/agy-model-switch.js.map +1 -0
- package/dist/backend/antigravity.js +50 -1
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/cli-runtime-switch.d.ts +71 -0
- package/dist/backend/cli-runtime-switch.js +176 -0
- package/dist/backend/cli-runtime-switch.js.map +1 -0
- package/dist/backend/codex-model-switch.d.ts +41 -0
- package/dist/backend/codex-model-switch.js +170 -0
- package/dist/backend/codex-model-switch.js.map +1 -0
- package/dist/backend/grok-model-switch.d.ts +16 -0
- package/dist/backend/grok-model-switch.js +45 -0
- package/dist/backend/grok-model-switch.js.map +1 -0
- package/dist/backend/grok.js +1 -1
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/muse.d.ts +2 -0
- package/dist/backend/muse.js +7 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +10 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +8 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli-audited.js +12 -12
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.d.ts +47 -1
- package/dist/daemon.js +301 -20
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.js +3 -0
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/fleet-manager.d.ts +102 -0
- package/dist/fleet-manager.js +663 -25
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +9 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +154 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -3
- package/dist/hub/admin-dashboard.d.ts +85 -0
- package/dist/hub/admin-dashboard.js +161 -0
- package/dist/hub/admin-dashboard.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +2 -0
- package/dist/hub/attachments/store.js +6 -0
- package/dist/hub/attachments/store.js.map +1 -1
- package/dist/hub/client.d.ts +10 -0
- package/dist/hub/client.js +72 -10
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +20 -0
- package/dist/hub/compose/member.js +212 -17
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +8 -0
- package/dist/hub/compose/server.js +13 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/display-name.d.ts +10 -0
- package/dist/hub/display-name.js +35 -0
- package/dist/hub/display-name.js.map +1 -0
- package/dist/hub/execution/service.d.ts +1 -0
- package/dist/hub/execution/service.js +1 -1
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/fleet-info.d.ts +12 -0
- package/dist/hub/fleet-info.js +14 -0
- package/dist/hub/fleet-info.js.map +1 -0
- package/dist/hub/fleet-update-model.d.ts +100 -0
- package/dist/hub/fleet-update-model.js +15 -0
- package/dist/hub/fleet-update-model.js.map +1 -0
- package/dist/hub/fleet-updates.d.ts +46 -0
- package/dist/hub/fleet-updates.js +282 -0
- package/dist/hub/fleet-updates.js.map +1 -0
- package/dist/hub/fleet-versions.d.ts +28 -0
- package/dist/hub/fleet-versions.js +80 -0
- package/dist/hub/fleet-versions.js.map +1 -0
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +192 -16
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/http/schema.js +13 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/member/display-name.d.ts +9 -0
- package/dist/hub/member/display-name.js +71 -0
- package/dist/hub/member/display-name.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +4 -0
- package/dist/hub/member/exposure-api.js +8 -3
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +4 -0
- package/dist/hub/member/exposures.js +20 -0
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/pairing-api.js +3 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/recommendations.d.ts +37 -0
- package/dist/hub/member/recommendations.js +129 -0
- package/dist/hub/member/recommendations.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +60 -1
- package/dist/hub/member/room-ask.js +250 -22
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-post-answers.d.ts +52 -0
- package/dist/hub/member/room-post-answers.js +152 -0
- package/dist/hub/member/room-post-answers.js.map +1 -0
- package/dist/hub/member/room-post-receipt.d.ts +21 -0
- package/dist/hub/member/room-post-receipt.js +49 -0
- package/dist/hub/member/room-post-receipt.js.map +1 -0
- package/dist/hub/member/room-post.d.ts +100 -0
- package/dist/hub/member/room-post.js +223 -0
- package/dist/hub/member/room-post.js.map +1 -0
- package/dist/hub/member/updates.d.ts +92 -0
- package/dist/hub/member/updates.js +316 -0
- package/dist/hub/member/updates.js.map +1 -0
- package/dist/hub/protocol.d.ts +658 -1
- package/dist/hub/protocol.js +90 -13
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/published-version.d.ts +3 -0
- package/dist/hub/published-version.js +35 -0
- package/dist/hub/published-version.js.map +1 -0
- package/dist/hub/recommendation-model.d.ts +36 -0
- package/dist/hub/recommendation-model.js +9 -0
- package/dist/hub/recommendation-model.js.map +1 -0
- package/dist/hub/recommendations.d.ts +58 -0
- package/dist/hub/recommendations.js +211 -0
- package/dist/hub/recommendations.js.map +1 -0
- package/dist/hub/representative.d.ts +3 -0
- package/dist/hub/representative.js +1 -0
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/room-context-model.d.ts +43 -0
- package/dist/hub/room-context-model.js +12 -0
- package/dist/hub/room-context-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +41 -9
- package/dist/hub/rooms/agents.js +183 -21
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/assistant.d.ts +1 -6
- package/dist/hub/rooms/assistant.js +7 -2
- package/dist/hub/rooms/assistant.js.map +1 -1
- package/dist/hub/rooms/automation.d.ts +24 -0
- package/dist/hub/rooms/automation.js +66 -0
- package/dist/hub/rooms/automation.js.map +1 -0
- package/dist/hub/rooms/buttons.d.ts +85 -0
- package/dist/hub/rooms/buttons.js +62 -0
- package/dist/hub/rooms/buttons.js.map +1 -0
- package/dist/hub/rooms/context-cursor.d.ts +18 -0
- package/dist/hub/rooms/context-cursor.js +61 -0
- package/dist/hub/rooms/context-cursor.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +1 -1
- package/dist/hub/rooms/context.js +4 -4
- package/dist/hub/rooms/context.js.map +1 -1
- package/dist/hub/rooms/mentions.d.ts +15 -0
- package/dist/hub/rooms/mentions.js +43 -0
- package/dist/hub/rooms/mentions.js.map +1 -0
- package/dist/hub/rooms/post-replies.d.ts +23 -0
- package/dist/hub/rooms/post-replies.js +114 -0
- package/dist/hub/rooms/post-replies.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +9 -0
- package/dist/hub/rooms/schema.js +43 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +136 -1
- package/dist/hub/rooms/service.js +727 -18
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +27 -3
- package/dist/hub/rooms.js +1 -1
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/runtime.js +12 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +6 -1
- package/dist/hub/server.js +75 -5
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/settings-directory-proof.js +22 -1
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/types.d.ts +133 -2
- package/dist/hub-contact-windows.d.ts +11 -0
- package/dist/hub-contact-windows.js +56 -0
- package/dist/hub-contact-windows.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +1 -1
- package/dist/hub-room-conversation.d.ts +14 -0
- package/dist/hub-room-conversation.js +60 -0
- package/dist/hub-room-conversation.js.map +1 -0
- package/dist/hub-update-notice.d.ts +12 -0
- package/dist/hub-update-notice.js +35 -0
- package/dist/hub-update-notice.js.map +1 -0
- package/dist/locale.js +56 -2
- package/dist/locale.js.map +1 -1
- package/dist/native-mcp.js +9 -6
- package/dist/native-mcp.js.map +1 -1
- package/dist/outbound-handlers.d.ts +14 -4
- package/dist/outbound-handlers.js +54 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +12 -0
- package/dist/outbound-schemas.js +12 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +2 -0
- package/dist/queued-handoffs.d.ts +16 -4
- package/dist/queued-handoffs.js +18 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/runtime-cli-install.js +13 -10
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +87 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/tmux-manager.d.ts +2 -0
- package/dist/tmux-manager.js +2 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions.js +3 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/chat-msg-actions.js +3 -222
- package/dist/ui/hub-admin-overview.js +189 -0
- package/dist/ui/hub-client.js +36 -4
- package/dist/ui/hub-fleet-versions.js +393 -0
- package/dist/ui/hub-room-agent-strings.js +28 -0
- package/dist/ui/hub-room-composer.js +5 -3
- package/dist/ui/hub-room-members-strings.js +2 -2
- package/dist/ui/hub-room-members.js +3 -2
- package/dist/ui/hub-room-notify.js +161 -0
- package/dist/ui/hub-room-search.js +126 -0
- package/dist/ui/hub-room-strings.js +46 -0
- package/dist/ui/hub-room-thread.js +239 -34
- package/dist/ui/hub-room-unread.js +2 -1
- package/dist/ui/hub-strings.js +8 -0
- package/dist/ui/image-annotate.js +2 -283
- package/dist/ui/image-lightbox.js +2 -176
- package/dist/ui/image-zoom.js +2 -242
- package/dist/ui/notice-hub-update.js +94 -0
- package/dist/ui/panel-chat.js +35 -6
- package/dist/ui/panel-hub.js +133 -19
- package/dist/ui/panel-notices.js +3 -1
- package/dist/ui/panel-settings.js +1 -1
- package/dist/ui/settings-hub-updates.js +67 -0
- package/dist/ui/settings-hub.js +28 -3
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/settings-update.js +11 -5
- package/dist/ui/settings-web-authority.js +1 -1
- package/dist/ui/shared/app-i18n.js +2 -0
- package/dist/ui/shared/app-nav.js +6 -2
- package/dist/ui/shared/app-prefs.js +2 -1
- package/dist/ui/shared/app-shell.js +11 -1
- package/dist/ui/shared/app-update.js +90 -8
- package/dist/ui/shared/app.css +20 -0
- package/dist/ui/shared/chat-msg-actions.js +225 -0
- package/dist/ui/shared/chat-thread.js +70 -5
- package/dist/ui/shared/chat-work-bar.css +25 -13
- package/dist/ui/shared/hub-chat.css +6 -1
- package/dist/ui/shared/hub-owner.css +104 -0
- package/dist/ui/shared/hub-rooms-u2.css +16 -0
- package/dist/ui/shared/hub.css +5 -0
- package/dist/ui/shared/image-annotate.js +306 -0
- package/dist/ui/shared/image-lightbox.js +183 -0
- package/dist/ui/shared/image-zoom.js +242 -0
- package/dist/ui/shared/instance-nav.js +36 -7
- package/dist/ui/shared/view-strings.js +6 -0
- package/dist/ui/shared/web-authorize.js +2 -2
- package/dist/update-dispatch.d.ts +8 -1
- package/dist/update-dispatch.js +16 -1
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-idle.d.ts +65 -0
- package/dist/update-idle.js +190 -0
- package/dist/update-idle.js.map +1 -0
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +9 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +2 -0
- package/dist/usage/profile-timeline.js +4 -0
- package/dist/usage/profile-timeline.js.map +1 -1
- package/dist/web-api.js +19 -2
- package/dist/web-api.js.map +1 -1
- package/dist/web-notices.d.ts +3 -0
- package/dist/web-notices.js +17 -2
- package/dist/web-notices.js.map +1 -1
- package/dist/web-prefs.js +1 -0
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-update.d.ts +15 -1
- package/package.json +1 -1
package/dist/hub/rooms/schema.js
CHANGED
|
@@ -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,MAAM,CAAC,MAAM,yBAAyB,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAqB;QAC1I,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;CAkBT,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,2BAA2B,GAAqB,MAAM,CAAC,MAAM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AAE,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 {
|
|
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
|
}>;
|