@songsid/agend 2.4.0-beta.13 → 2.4.0-beta.14
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.js +28 -6
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/backend/claude-code.d.ts +9 -0
- package/dist/backend/claude-code.js +60 -4
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/grok.js +11 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +3 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +1 -16
- package/dist/backend-availability.js +2 -91
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-version-static.d.ts +15 -0
- package/dist/backend-version-static.js +95 -0
- package/dist/backend-version-static.js.map +1 -0
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/telegram.js +3 -1
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +18 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/tool-router.d.ts +4 -0
- package/dist/channel/tool-router.js +43 -19
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +3 -0
- package/dist/classic-channel-manager.js +18 -0
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/classic-cli-guard.d.ts +66 -0
- package/dist/classic-cli-guard.js +209 -0
- package/dist/classic-cli-guard.js.map +1 -0
- package/dist/cli-audited.js +7 -5
- package/dist/cli-audited.js.map +1 -1
- package/dist/config-validator.js +3 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/contact-auth-api.d.ts +16 -0
- package/dist/contact-auth-api.js +78 -0
- package/dist/contact-auth-api.js.map +1 -0
- package/dist/contact-auth-files.d.ts +6 -0
- package/dist/contact-auth-files.js +29 -0
- package/dist/contact-auth-files.js.map +1 -0
- package/dist/contact-auth-policy.d.ts +75 -0
- package/dist/contact-auth-policy.js +23 -0
- package/dist/contact-auth-policy.js.map +1 -0
- package/dist/contact-auth-service.d.ts +32 -0
- package/dist/contact-auth-service.js +99 -0
- package/dist/contact-auth-service.js.map +1 -0
- package/dist/contact-auth-store.d.ts +75 -0
- package/dist/contact-auth-store.js +295 -0
- package/dist/contact-auth-store.js.map +1 -0
- package/dist/contact-auth-types.d.ts +170 -0
- package/dist/contact-auth-types.js +7 -0
- package/dist/contact-auth-types.js.map +1 -0
- package/dist/daemon.d.ts +8 -0
- package/dist/daemon.js +93 -4
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +6 -0
- package/dist/delivery-outbox.js +19 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +40 -0
- package/dist/fleet-manager.js +429 -22
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +18 -0
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +28 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -0
- package/dist/hub/audit/index.d.ts +3 -1
- package/dist/hub/audit/index.js +35 -3
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/catalog.d.ts +8 -0
- package/dist/hub/catalog.js +39 -4
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/compose/server.d.ts +2 -0
- package/dist/hub/compose/server.js +11 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.js +5 -2
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +5 -1
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +123 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +2 -0
- package/dist/hub/http/schema.js +6 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/invitations.js +15 -7
- package/dist/hub/invitations.js.map +1 -1
- package/dist/hub/roles/cutover-inventory.d.ts +3 -0
- package/dist/hub/roles/cutover-inventory.js +20 -4
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover-marker.d.ts +18 -2
- package/dist/hub/roles/cutover-marker.js +6 -2
- package/dist/hub/roles/cutover-marker.js.map +1 -1
- package/dist/hub/room-agent-discovery-model.d.ts +29 -0
- package/dist/hub/room-agent-discovery-model.js +33 -0
- package/dist/hub/room-agent-discovery-model.js.map +1 -0
- package/dist/hub/room-agent-discovery.d.ts +14 -0
- package/dist/hub/room-agent-discovery.js +65 -0
- package/dist/hub/room-agent-discovery.js.map +1 -0
- package/dist/hub/room-agent-requests.d.ts +71 -0
- package/dist/hub/room-agent-requests.js +377 -0
- package/dist/hub/room-agent-requests.js.map +1 -0
- package/dist/hub/rooms/directory.d.ts +13 -0
- package/dist/hub/rooms/directory.js +12 -3
- package/dist/hub/rooms/directory.js.map +1 -1
- package/dist/hub/rooms/schema.d.ts +5 -0
- package/dist/hub/rooms/schema.js +9 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +43 -19
- package/dist/hub/rooms/service.js +67 -11
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +1 -1
- package/dist/instance-lifecycle.d.ts +3 -1
- package/dist/instance-lifecycle.js +4 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +28 -4
- package/dist/locale.js.map +1 -1
- package/dist/needs-you-hub.d.ts +1 -0
- package/dist/needs-you-hub.js +6 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +10 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +9 -0
- package/dist/outbound-handlers.js +46 -10
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/runtime-cli-install.js +7 -7
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/topic-commands.d.ts +1 -1
- package/dist/topic-commands.js +4 -6
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/contact-auth-client.js +48 -0
- package/dist/ui/contact-auth-strings.js +164 -0
- package/dist/ui/contact-authorizations.js +125 -0
- package/dist/ui/contact-needs.js +84 -0
- package/dist/ui/contact-permissions.js +193 -0
- package/dist/ui/contact-ticket-badge.js +54 -0
- package/dist/ui/hub-client.js +30 -7
- package/dist/ui/hub-invitations.js +5 -1
- package/dist/ui/hub-room-new.js +10 -3
- package/dist/ui/hub-room-owner-requests-strings.js +114 -0
- package/dist/ui/hub-room-owner-requests.js +264 -0
- package/dist/ui/hub-room-pins.js +43 -0
- package/dist/ui/hub-room-settings.js +11 -2
- package/dist/ui/hub-room-strings.js +3 -0
- package/dist/ui/hub-room-thread.js +47 -5
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/panel-details.js +2 -0
- package/dist/ui/panel-fleet.js +3 -2
- package/dist/ui/panel-hub.js +7 -1
- package/dist/ui/panel-needs.js +5 -1
- package/dist/ui/panel-settings.js +3 -0
- package/dist/ui/shared/app-route.js +1 -1
- package/dist/ui/shared/app-shell.js +2 -0
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +31 -0
- package/dist/ui/shared/chat-quote.js +26 -2
- package/dist/ui/shared/chat-thread.js +6 -2
- package/dist/ui/shared/hub-rooms-u2.css +22 -0
- package/dist/ui/shared/text-undo.js +17 -3
- package/dist/web-api.d.ts +9 -0
- package/dist/web-api.js +55 -3
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +5 -0
- package/dist/web-chat-history.js +26 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-reply-files.d.ts +1 -0
- package/dist/web-reply-files.js +2 -0
- package/dist/web-reply-files.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +2 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/package.json +1 -1
package/dist/hub/http/compose.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { HubRoomAgentDiscovery } from "../room-agent-discovery.js";
|
|
2
|
+
import { roomDiscoverySupported } from "../room-agent-discovery-model.js";
|
|
1
3
|
import { HUB_ROOM_ANSWER_STATUS_CAPABILITY } from "../room-answer-status-model.js";
|
|
2
4
|
import { HUB_ROOM_MEMBERS_CAPABILITY } from "../room-members-model.js";
|
|
3
5
|
import { HUB_ROOM_BRIEF_CAPABILITY } from "../room-brief-model.js";
|
|
@@ -77,11 +79,13 @@ export const HUB_UI_MODULES = Object.freeze(["panel-hub.js", "hub-personal-agent
|
|
|
77
79
|
"hub-room-unread.js", "hub-room-notify.js",
|
|
78
80
|
// Hub rooms, track U2 (dev-claude2; hub-rooms-split.md section 3): new room, room settings, members rail, invitations,
|
|
79
81
|
// 管理 → 房間.
|
|
80
|
-
"hub-room-new.js", "hub-room-purpose.js", "hub-room-new-strings.js", "hub-room-settings.js", "hub-room-settings-strings.js", "hub-room-members.js", "hub-room-members-strings.js", "hub-invitations.js", "hub-invitations-strings.js", "hub-admin-rooms.js", "hub-admin-rooms-strings.js",
|
|
82
|
+
"hub-room-new.js", "hub-room-purpose.js", "hub-room-new-strings.js", "hub-room-settings.js", "hub-room-owner-requests.js", "hub-room-owner-requests-strings.js", "hub-room-settings-strings.js", "hub-room-members.js", "hub-room-members-strings.js", "hub-invitations.js", "hub-invitations-strings.js", "hub-admin-rooms.js", "hub-admin-rooms-strings.js",
|
|
81
83
|
// M-3092 (Hub rooms, track U): the conversation list, a room on the shared thread, its composer.
|
|
82
84
|
"hub-room-list.js", "hub-room-thread.js", "hub-room-agent-strings.js", "hub-room-composer.js", "hub-assistant-admin.js", "hub-assistant-admin-strings.js",
|
|
83
85
|
// M-3092 S-145: the list's favourites (the Fleet sidebar's #1664 rules; synced per person by the Hub).
|
|
84
86
|
"hub-room-favorites.js",
|
|
87
|
+
// M-3340: personal pins in a room (its list and 📌; the store keeps them in hub-room-thread.js).
|
|
88
|
+
"hub-room-pins.js",
|
|
85
89
|
// S-148: the working bar's words (#3857), shared by the room thread.
|
|
86
90
|
"hub-room-working.js", "hub-teams.js", "hub-teams-strings.js", "hub-roles.js", "hub-roles-strings.js", "hub-role-view.js", "hub-role-forms.js", "hub-role-audit.js", "hub-role-notices.js", "hub-room-search.js",
|
|
87
91
|
// M-3137: Fleet versions (Connected fleets' columns and summary, the older-Fleet banner) with its own words.
|
|
@@ -206,6 +210,8 @@ export function createHubHttp(deps, sql) {
|
|
|
206
210
|
const groupRooms = new HubGroupRooms(core);
|
|
207
211
|
const mcp = new HubMcpDoor(core, sessions, { groups: groupRooms, direct: rooms, catalog });
|
|
208
212
|
const invitations = deps.roomInvitations?.(core, groupRooms.invitationHost());
|
|
213
|
+
const roomAgentRequests = deps.roomAgentRequests?.(core, groupRooms.invitationHost());
|
|
214
|
+
const roomDiscovery = core.atomic(roomDiscoverySupported) ? new HubRoomAgentDiscovery(core) : null;
|
|
209
215
|
const roomAdmin = new HubRoomAdmin(core, event => groupRooms.publish(event), id => { groupRooms.assistant.forget(id); groupRooms.agents.sweep(id); });
|
|
210
216
|
const quota = new HubQuotaService(core);
|
|
211
217
|
const fleetVersions = new HubFleetVersions(core);
|
|
@@ -368,7 +374,7 @@ export function createHubHttp(deps, sql) {
|
|
|
368
374
|
return send(res, 200, await guard(() => agentCatalogs.view(ctx)));
|
|
369
375
|
}
|
|
370
376
|
// Composed routes, not enrollment authority or the administrator's on/off switch. Older Hubs omit unsupported cards.
|
|
371
|
-
const offered = ["agent-intro-defaults-v1", "agent-sharing-v1", "agent-intros-v1", "admin-dashboard-v1", "rooms-v1", "room-purpose-v1", "person-prefs-v1", ...(personal ? ["personal-agents-v1"] : []), ...(teams ? ["teams-v1"] : []), ...(deps.roleAdmin ? ["role-settings-v1"] : []), ...(deps.roomAssistant && deps.assistantAdmin ? ["room-assistant-v1"] : []), ...(deps.refreshAuthorization ? ["sharing-pause-v1"] : []), ...(deps.groupHttp ? [GROUP_POLICY_FEATURE, ...(deps.pairingNotices ? ["quick-pairing-v1"] : [])] : []), ...(grantSubjectsOffered() ? ["grant-subjects-v1"] : []),
|
|
377
|
+
const offered = ["agent-intro-defaults-v1", "agent-sharing-v1", "agent-intros-v1", "admin-dashboard-v1", "rooms-v1", "room-purpose-v1", "room-pins-v1", "person-prefs-v1", ...(roomAgentRequests ? ["room-owner-requests-v1"] : []), ...(roomDiscovery ? ["room-agent-discovery-v1"] : []), ...(personal ? ["personal-agents-v1"] : []), ...(teams ? ["teams-v1"] : []), ...(deps.roleAdmin ? ["role-settings-v1"] : []), ...(deps.roomAssistant && deps.assistantAdmin ? ["room-assistant-v1"] : []), ...(deps.refreshAuthorization ? ["sharing-pause-v1"] : []), ...(deps.groupHttp ? [GROUP_POLICY_FEATURE, ...(deps.pairingNotices ? ["quick-pairing-v1"] : [])] : []), ...(grantSubjectsOffered() ? ["grant-subjects-v1"] : []),
|
|
372
378
|
...(deps.companyJoin ? ["company-join-v1", "enrolment-code-v1"] : []), ...(deps.directoryNotices ? ["directory-security-notices-v1"] : []), ...(deps.memberAddressNotices ? ["member-address-notices-v1"] : []),
|
|
373
379
|
...(deps.directorySettings ? [HUB_DIRECTORY_SETTINGS_FEATURE, HUB_DIRECTORY_CA_FEATURE, HUB_DIRECTORY_EDITOR_FEATURE] : [])];
|
|
374
380
|
offered.push("mcp-apps-v1");
|
|
@@ -703,6 +709,21 @@ export function createHubHttp(deps, sql) {
|
|
|
703
709
|
await guard(() => catalog.freeze(ctx, uuid(r[1]), int(b.revision), false));
|
|
704
710
|
return send(res, 200, { ok: true });
|
|
705
711
|
}
|
|
712
|
+
if ((r = m(/^\/hub\/v1\/exposures\/([^/]+)\/room-discovery$/))) {
|
|
713
|
+
if (!roomDiscovery)
|
|
714
|
+
throw new HttpError(404, "not-found");
|
|
715
|
+
if (query.size)
|
|
716
|
+
throw new HubProtocolError("invalid");
|
|
717
|
+
if (method === "GET") {
|
|
718
|
+
signedIn();
|
|
719
|
+
return send(res, 200, await guard(() => roomDiscovery.setting(ctx, uuid(r[1]))));
|
|
720
|
+
}
|
|
721
|
+
if (method !== "PUT")
|
|
722
|
+
throw new HttpError(405, "method");
|
|
723
|
+
csrf();
|
|
724
|
+
const input = await body();
|
|
725
|
+
return send(res, 200, await guard(() => roomDiscovery.setting(ctx, uuid(r[1]), input)));
|
|
726
|
+
}
|
|
706
727
|
if ((r = m(/^\/hub\/v1\/exposures\/([^/]+)\/intro$/))) {
|
|
707
728
|
if (method !== "PUT")
|
|
708
729
|
throw new HttpError(405, "method");
|
|
@@ -922,7 +943,7 @@ export function createHubHttp(deps, sql) {
|
|
|
922
943
|
if (method !== "GET")
|
|
923
944
|
throw new HttpError(405, "method");
|
|
924
945
|
signedIn();
|
|
925
|
-
return send(res, 200, { candidates: await guard(() => groupRooms.candidates(ctx, query.get("q") ?? "", query.get("kind") ?? "person")) });
|
|
946
|
+
return send(res, 200, { candidates: await guard(() => groupRooms.candidates(ctx, query.get("q") ?? "", query.get("kind") ?? "person", !!roomDiscovery && query.get("discovery") === "1")) });
|
|
926
947
|
}
|
|
927
948
|
if ((r = m(/^\/hub\/v1\/rooms\/candidates\/group\/([^/]+)$/))) {
|
|
928
949
|
if (method !== "GET")
|
|
@@ -930,6 +951,71 @@ export function createHubHttp(deps, sql) {
|
|
|
930
951
|
signedIn();
|
|
931
952
|
return send(res, 200, await guard(() => groupRooms.groupCandidate(ctx, uuid(r[1]))));
|
|
932
953
|
}
|
|
954
|
+
if (path === "/hub/v1/me/agent-request-settings") {
|
|
955
|
+
if (!roomAgentRequests)
|
|
956
|
+
throw new HttpError(404, "not-found");
|
|
957
|
+
if (query.size)
|
|
958
|
+
throw new HubProtocolError("invalid");
|
|
959
|
+
if (method === "GET") {
|
|
960
|
+
signedIn();
|
|
961
|
+
return send(res, 200, await guard(() => roomAgentRequests.settings(ctx)));
|
|
962
|
+
}
|
|
963
|
+
if (method === "PUT") {
|
|
964
|
+
csrf();
|
|
965
|
+
const input = await body();
|
|
966
|
+
return send(res, 200, await guard(() => roomAgentRequests.settings(ctx, input)));
|
|
967
|
+
}
|
|
968
|
+
throw new HttpError(405, "method");
|
|
969
|
+
}
|
|
970
|
+
if (path === "/hub/v1/agent-requests") {
|
|
971
|
+
if (!roomAgentRequests)
|
|
972
|
+
throw new HttpError(404, "not-found");
|
|
973
|
+
if (method !== "GET")
|
|
974
|
+
throw new HttpError(405, "method");
|
|
975
|
+
if ([...query.keys()].some(key => key !== "after"))
|
|
976
|
+
throw new HubProtocolError("invalid");
|
|
977
|
+
signedIn();
|
|
978
|
+
return send(res, 200, await guard(() => roomAgentRequests.pending(ctx, query.get("after") ?? undefined)));
|
|
979
|
+
}
|
|
980
|
+
if ((r = m(/^\/hub\/v1\/agent-requests\/([^/]+)(?:\/(accept|decline))?$/))) {
|
|
981
|
+
if (!roomAgentRequests)
|
|
982
|
+
throw new HttpError(404, "not-found");
|
|
983
|
+
if (query.size)
|
|
984
|
+
throw new HubProtocolError("invalid");
|
|
985
|
+
const id = uuid(r[1]), action = r[2];
|
|
986
|
+
if (method === "GET" && !action) {
|
|
987
|
+
signedIn();
|
|
988
|
+
return send(res, 200, await guard(() => roomAgentRequests.choices(ctx, id, () => agentCatalogs.view(ctx))));
|
|
989
|
+
}
|
|
990
|
+
if (method !== "POST" || !action)
|
|
991
|
+
throw new HttpError(405, "method");
|
|
992
|
+
csrf();
|
|
993
|
+
const input = await body();
|
|
994
|
+
if (action === "decline" && Object.keys(input).length)
|
|
995
|
+
throw new HubProtocolError("invalid");
|
|
996
|
+
return send(res, 200, await guard(() => action === "accept" ? roomAgentRequests.accept(ctx, id, input) : roomAgentRequests.decline(ctx, id)));
|
|
997
|
+
}
|
|
998
|
+
if ((r = m(/^\/hub\/v1\/rooms\/([^/]+)\/agent-requests(?:\/([^/]+))?$/))) {
|
|
999
|
+
if (!roomAgentRequests)
|
|
1000
|
+
throw new HttpError(404, "not-found");
|
|
1001
|
+
const roomId = uuid(r[1]);
|
|
1002
|
+
if (method === "GET" && !r[2]) {
|
|
1003
|
+
if ([...query.keys()].some(key => key !== "after"))
|
|
1004
|
+
throw new HubProtocolError("invalid");
|
|
1005
|
+
signedIn();
|
|
1006
|
+
return send(res, 200, await guard(() => roomAgentRequests.forRoom(ctx, roomId, query.get("after") ?? undefined)));
|
|
1007
|
+
}
|
|
1008
|
+
if (query.size)
|
|
1009
|
+
throw new HubProtocolError("invalid");
|
|
1010
|
+
csrf();
|
|
1011
|
+
if (method === "POST" && !r[2]) {
|
|
1012
|
+
const input = await body();
|
|
1013
|
+
return send(res, 200, await guard(() => roomAgentRequests.request(ctx, roomId, input)));
|
|
1014
|
+
}
|
|
1015
|
+
if (method === "DELETE" && r[2])
|
|
1016
|
+
return send(res, 200, await guard(() => roomAgentRequests.cancel(ctx, roomId, uuid(r[2]))));
|
|
1017
|
+
throw new HttpError(405, "method");
|
|
1018
|
+
}
|
|
933
1019
|
if (path === "/hub/v1/invitations") {
|
|
934
1020
|
if (!invitations)
|
|
935
1021
|
throw new HttpError(404, "not-found");
|
|
@@ -1002,6 +1088,10 @@ export function createHubHttp(deps, sql) {
|
|
|
1002
1088
|
if (event.type === "invitation.changed") {
|
|
1003
1089
|
data = personKeyString(await ctx.requirePerson()) === event.audiencePerson ? {} : null;
|
|
1004
1090
|
}
|
|
1091
|
+
else if (event.type === "pins.changed") {
|
|
1092
|
+
// M-3340: the person's own pins changed (another tab or device): which room only; the page reads them again.
|
|
1093
|
+
data = personKeyString(await ctx.requirePerson()) === event.audiencePerson ? { roomId: event.roomId } : null;
|
|
1094
|
+
}
|
|
1005
1095
|
else {
|
|
1006
1096
|
const view = await rooms.view(ctx, event.roomId);
|
|
1007
1097
|
if (event.type === "unread.changed")
|
|
@@ -1087,7 +1177,8 @@ export function createHubHttp(deps, sql) {
|
|
|
1087
1177
|
return send(res, 200, { rooms: view.rooms.map(room => ({ ...room, ...intros.projection(room.exposureId), ...quota.roomProjection(room, view.grantProof) })) });
|
|
1088
1178
|
const groups = await guard(() => groupRooms.list(ctx));
|
|
1089
1179
|
const pending = invitations ? await guard(() => invitations.pending(ctx)) : null;
|
|
1090
|
-
|
|
1180
|
+
const ownerRequests = roomAgentRequests && query.get("ownerRequests") === "1" ? await guard(() => roomAgentRequests.pendingCount(ctx)) : 0;
|
|
1181
|
+
return send(res, 200, { ...groups, invitations: (pending?.invitations.length ?? 0) + ownerRequests, rooms: [...groups.rooms, ...view.rooms.map(room => ({ ...directRoomView(room, rooms.presence(room.exposureId), directUnread(core, room), intros.projection(room.exposureId)), ...quota.roomProjection(room, view.grantProof) }))] });
|
|
1091
1182
|
}
|
|
1092
1183
|
if (method === "POST") {
|
|
1093
1184
|
csrf();
|
|
@@ -1106,7 +1197,11 @@ export function createHubHttp(deps, sql) {
|
|
|
1106
1197
|
if (method === "GET") {
|
|
1107
1198
|
const view = await guard(() => groupRooms.detail(ctx, roomId));
|
|
1108
1199
|
const invited = invitations && view.me.role === "manager" && !view.room.archived ? await guard(() => invitations.forRoom(ctx, roomId)) : [];
|
|
1109
|
-
|
|
1200
|
+
const ownerRequests = roomAgentRequests && view.me.role === "manager" && !view.room.archived
|
|
1201
|
+
? await guard(() => roomAgentRequests.forRoom(ctx, roomId)) : null;
|
|
1202
|
+
return send(res, 200, { ...view, invited, ...(ownerRequests ? {
|
|
1203
|
+
settings: { ...view.settings, ownerAgentRequests: true }, agentRequests: ownerRequests,
|
|
1204
|
+
} : {}) });
|
|
1110
1205
|
}
|
|
1111
1206
|
if (method === "PATCH") {
|
|
1112
1207
|
csrf();
|
|
@@ -1153,6 +1248,27 @@ export function createHubHttp(deps, sql) {
|
|
|
1153
1248
|
groupRooms.publish({ type: "unread.changed", roomId, data: { roomId }, audiencePerson: personKeyString(room.asker) });
|
|
1154
1249
|
return send(res, 200, { ok: true });
|
|
1155
1250
|
}
|
|
1251
|
+
// M-3340: personal pins in a group room — the signed-in person's own (GET), pin (PUT) or unpin (DELETE) one message.
|
|
1252
|
+
if ((r = m(/^\/hub\/v1\/rooms\/([^/]+)\/pins$/))) {
|
|
1253
|
+
if (method !== "GET")
|
|
1254
|
+
throw new HttpError(405, "method");
|
|
1255
|
+
if ([...query.keys()].length)
|
|
1256
|
+
throw new HubProtocolError("invalid");
|
|
1257
|
+
signedIn();
|
|
1258
|
+
const roomId = uuid(r[1]);
|
|
1259
|
+
if (!groupRooms.has(roomId))
|
|
1260
|
+
throw new HttpError(404, "not-found");
|
|
1261
|
+
return send(res, 200, await guard(() => groupRooms.pins(ctx, roomId)));
|
|
1262
|
+
}
|
|
1263
|
+
if ((r = m(/^\/hub\/v1\/rooms\/([^/]+)\/pins\/([^/]+)$/))) {
|
|
1264
|
+
if (method !== "PUT" && method !== "DELETE")
|
|
1265
|
+
throw new HttpError(405, "method");
|
|
1266
|
+
csrf();
|
|
1267
|
+
const roomId = uuid(r[1]);
|
|
1268
|
+
if (!groupRooms.has(roomId))
|
|
1269
|
+
throw new HttpError(404, "not-found");
|
|
1270
|
+
return send(res, 200, await guard(() => groupRooms.pin(ctx, roomId, r[2], method === "PUT")));
|
|
1271
|
+
}
|
|
1156
1272
|
if ((r = m(/^\/hub\/v1\/rooms\/([^/]+)\/messages\/([^/]+)\/reactions$/))) {
|
|
1157
1273
|
if (method !== "POST")
|
|
1158
1274
|
throw new HttpError(405, "method");
|
|
@@ -1706,13 +1822,14 @@ export function createHubHttp(deps, sql) {
|
|
|
1706
1822
|
groupRooms.agents.wake();
|
|
1707
1823
|
groupRooms.assistant.start();
|
|
1708
1824
|
return {
|
|
1825
|
+
...(roomAgentRequests ? { retainedContentRefs: () => roomAgentRequests.retainedNoteRefs() } : {}),
|
|
1709
1826
|
directorySessions: Object.freeze({
|
|
1710
1827
|
recentAuthentication: (actor, permit) => sessions.recentAuthentication(actor, permit),
|
|
1711
1828
|
prepareDirectoryRotation: (token, actor) => sessions.prepareDirectoryRotation(token, actor),
|
|
1712
1829
|
completeDirectoryRotation: (rotation, operationId) => sessions.completeDirectoryRotation(rotation, operationId),
|
|
1713
1830
|
}),
|
|
1714
1831
|
handle, receive, memberReady: link => { recommendations.ready(link); fleetUpdates.ready(link); }, memberConnected: link => { fleetVersions.connected(link); agentCatalogs.connected(link); }, memberClosed: fleetId => { if (live())
|
|
1715
|
-
groupRooms.agents.disconnected(fleetId); }, agentIntroV1: true, agentCatalogV1: true, exposureRequestsV1: true, features: Object.freeze(["agent-intro-defaults-v1", "agent-sharing-v1", "agent-intros-v1", "admin-dashboard-v1", "fleet-update-v1", "rooms-v1", "room-purpose-v1", "room-ask-v1", "room-post-v1", HUB_ROOM_CONTEXT_CAPABILITY, HUB_ROOM_BRIEF_CAPABILITY, HUB_ROOM_MEMBERS_CAPABILITY, HUB_ROOM_ANSWER_STATUS_CAPABILITY, "person-prefs-v1", ...(personal ? ["personal-agents-v1"] : []), ...(teams ? ["teams-v1"] : []), ...(deps.roleAdmin ? ["role-settings-v1"] : []), ...(deps.roomAssistant && deps.assistantAdmin ? ["room-assistant-v1"] : []), ...(deps.refreshAuthorization ? ["sharing-pause-v1"] : []), ...(deps.groupHttp ? [GROUP_POLICY_FEATURE, ...(deps.pairingNotices ? ["quick-pairing-v1"] : [])] : []), ...(grantSubjectsOffered() ? ["grant-subjects-v1"] : []),
|
|
1832
|
+
groupRooms.agents.disconnected(fleetId); }, agentIntroV1: true, agentCatalogV1: true, exposureRequestsV1: true, features: Object.freeze(["agent-intro-defaults-v1", "agent-sharing-v1", "agent-intros-v1", "admin-dashboard-v1", "fleet-update-v1", "rooms-v1", "room-purpose-v1", "room-ask-v1", "room-post-v1", HUB_ROOM_CONTEXT_CAPABILITY, HUB_ROOM_BRIEF_CAPABILITY, HUB_ROOM_MEMBERS_CAPABILITY, HUB_ROOM_ANSWER_STATUS_CAPABILITY, "person-prefs-v1", ...(roomAgentRequests ? ["room-owner-requests-v1"] : []), ...(roomDiscovery ? ["room-agent-discovery-v1"] : []), ...(personal ? ["personal-agents-v1"] : []), ...(teams ? ["teams-v1"] : []), ...(deps.roleAdmin ? ["role-settings-v1"] : []), ...(deps.roomAssistant && deps.assistantAdmin ? ["room-assistant-v1"] : []), ...(deps.refreshAuthorization ? ["sharing-pause-v1"] : []), ...(deps.groupHttp ? [GROUP_POLICY_FEATURE, ...(deps.pairingNotices ? ["quick-pairing-v1"] : [])] : []), ...(grantSubjectsOffered() ? ["grant-subjects-v1"] : []),
|
|
1716
1833
|
...(deps.directoryNotices ? ["directory-security-notices-v1"] : []), ...(deps.memberAddressNotices ? ["member-address-notices-v1"] : []), ...(deps.directorySettings ? [HUB_DIRECTORY_SETTINGS_FEATURE, HUB_DIRECTORY_CA_FEATURE, HUB_DIRECTORY_EDITOR_FEATURE] : [])]),
|
|
1717
1834
|
async close() { closed = true; sharingRequests.close(); agentCatalogs.close(); personal?.owner.close(); await personal?.turns.close(); fleetUpdates.close(); recommendations.close(); fleetVersions.close(); grantSearch.close(); for (const end of streams)
|
|
1718
1835
|
end(); await mcp.close(); await groupRooms.close(); await rooms.buttons.close(); rooms.forget(); quota.close(); },
|