@songsid/agend 2.4.0-beta.35 → 2.4.0-beta.37

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 (113) hide show
  1. package/dist/agent-whats-new.js +10 -0
  2. package/dist/agent-whats-new.js.map +1 -1
  3. package/dist/build-provenance.json +1 -1
  4. package/dist/cli-audited.js +8 -2
  5. package/dist/cli-audited.js.map +1 -1
  6. package/dist/fleet-manager.js +1 -1
  7. package/dist/fleet-manager.js.map +1 -1
  8. package/dist/general-knowledge/skills/hub/SKILL.md +32 -6
  9. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +2 -1
  10. package/dist/hub/client.js +22 -4
  11. package/dist/hub/client.js.map +1 -1
  12. package/dist/hub/compose/server.d.ts +2 -0
  13. package/dist/hub/compose/server.js +36 -2
  14. package/dist/hub/compose/server.js.map +1 -1
  15. package/dist/hub/directory/directory.d.ts +19 -1
  16. package/dist/hub/directory/directory.js +199 -10
  17. package/dist/hub/directory/directory.js.map +1 -1
  18. package/dist/hub/directory/people-index.d.ts +72 -0
  19. package/dist/hub/directory/people-index.js +265 -0
  20. package/dist/hub/directory/people-index.js.map +1 -0
  21. package/dist/hub/directory/types.d.ts +49 -0
  22. package/dist/hub/directory/types.js +1 -0
  23. package/dist/hub/directory/types.js.map +1 -1
  24. package/dist/hub/grant-search.js +38 -23
  25. package/dist/hub/grant-search.js.map +1 -1
  26. package/dist/hub/group-policy/admin-api.js +10 -1
  27. package/dist/hub/group-policy/admin-api.js.map +1 -1
  28. package/dist/hub/group-policy/admin-control.d.ts +1 -0
  29. package/dist/hub/group-policy/admin-control.js +1 -1
  30. package/dist/hub/group-policy/admin-control.js.map +1 -1
  31. package/dist/hub/group-policy/admin-dto.d.ts +16 -14
  32. package/dist/hub/group-policy/admin-dto.js +5 -1
  33. package/dist/hub/group-policy/admin-dto.js.map +1 -1
  34. package/dist/hub/group-policy/admin-search.d.ts +2 -1
  35. package/dist/hub/group-policy/admin-search.js +45 -5
  36. package/dist/hub/group-policy/admin-search.js.map +1 -1
  37. package/dist/hub/group-policy/resources.d.ts +1 -1
  38. package/dist/hub/http/compose.js +68 -2
  39. package/dist/hub/http/compose.js.map +1 -1
  40. package/dist/hub/http/deps.d.ts +2 -0
  41. package/dist/hub/mcp/catalog.d.ts +0 -1
  42. package/dist/hub/mcp/catalog.js +2 -1
  43. package/dist/hub/mcp/catalog.js.map +1 -1
  44. package/dist/hub/mcp/http.js +6 -1
  45. package/dist/hub/mcp/http.js.map +1 -1
  46. package/dist/hub/mcp/policy.d.ts +9 -2
  47. package/dist/hub/mcp/policy.js +23 -1
  48. package/dist/hub/mcp/policy.js.map +1 -1
  49. package/dist/hub/people-query.d.ts +1 -0
  50. package/dist/hub/people-query.js +13 -0
  51. package/dist/hub/people-query.js.map +1 -0
  52. package/dist/hub/people-resolve.d.ts +34 -0
  53. package/dist/hub/people-resolve.js +38 -0
  54. package/dist/hub/people-resolve.js.map +1 -0
  55. package/dist/hub/protocol.d.ts +2 -0
  56. package/dist/hub/protocol.js +5 -2
  57. package/dist/hub/protocol.js.map +1 -1
  58. package/dist/hub/roles/admin-control.d.ts +0 -1
  59. package/dist/hub/roles/admin-control.js +29 -1
  60. package/dist/hub/roles/admin-control.js.map +1 -1
  61. package/dist/hub/roles/admin-types.d.ts +2 -0
  62. package/dist/hub/roles/allowed-list-control.d.ts +2 -0
  63. package/dist/hub/roles/allowed-list-control.js +17 -0
  64. package/dist/hub/roles/allowed-list-control.js.map +1 -1
  65. package/dist/hub/rooms/direct-view.js +2 -1
  66. package/dist/hub/rooms/direct-view.js.map +1 -1
  67. package/dist/hub/rooms/directory.d.ts +3 -0
  68. package/dist/hub/rooms/directory.js +38 -0
  69. package/dist/hub/rooms/directory.js.map +1 -1
  70. package/dist/hub/rooms/service.d.ts +7 -0
  71. package/dist/hub/rooms/service.js +17 -1
  72. package/dist/hub/rooms/service.js.map +1 -1
  73. package/dist/hub/runtime.js +15 -2
  74. package/dist/hub/runtime.js.map +1 -1
  75. package/dist/hub/server.d.ts +7 -0
  76. package/dist/hub/server.js +26 -4
  77. package/dist/hub/server.js.map +1 -1
  78. package/dist/hub/socket.d.ts +14 -0
  79. package/dist/hub/socket.js +19 -2
  80. package/dist/hub/socket.js.map +1 -1
  81. package/dist/hub/teams/index.js +35 -20
  82. package/dist/hub/teams/index.js.map +1 -1
  83. package/dist/hub/teams/types.d.ts +7 -1
  84. package/dist/locale.js +6 -4
  85. package/dist/locale.js.map +1 -1
  86. package/dist/runtime-cli-install.js +7 -3
  87. package/dist/runtime-cli-install.js.map +1 -1
  88. package/dist/ui/hub-admin-rooms.js +6 -4
  89. package/dist/ui/hub-ai-apps.js +2 -1
  90. package/dist/ui/hub-client.js +12 -0
  91. package/dist/ui/hub-grant-picker.js +42 -5
  92. package/dist/ui/hub-group-policy.js +3 -1
  93. package/dist/ui/hub-join-steps.js +3 -1
  94. package/dist/ui/hub-people-index.js +96 -0
  95. package/dist/ui/hub-people-paste.js +161 -0
  96. package/dist/ui/hub-people-query.js +8 -0
  97. package/dist/ui/hub-personal-agent.js +7 -2
  98. package/dist/ui/hub-role-forms.js +12 -3
  99. package/dist/ui/hub-room-new.js +12 -2
  100. package/dist/ui/hub-room-owner-requests.js +1 -1
  101. package/dist/ui/hub-room-settings.js +11 -4
  102. package/dist/ui/hub-room-thread.js +3 -3
  103. package/dist/ui/hub-subject-picker.js +16 -7
  104. package/dist/ui/hub-teams-strings.js +2 -2
  105. package/dist/ui/hub-teams.js +21 -5
  106. package/dist/ui/panel-hub.js +2 -0
  107. package/dist/ui/shared/app-update.js +19 -0
  108. package/dist/ui/shared/app.css +37 -0
  109. package/dist/ui/shared/update-card-ui.js +3 -3
  110. package/dist/update-card.d.ts +5 -1
  111. package/dist/update-card.js +8 -1
  112. package/dist/update-card.js.map +1 -1
  113. package/package.json +1 -1
@@ -107,7 +107,9 @@ export const HUB_UI_MODULES = Object.freeze(["panel-hub.js", "hub-notify-keep.js
107
107
  // M-3162: Administration → Overview (the counts dashboard), its own words.
108
108
  "hub-admin-overview.js", "hub-ai-apps.js", "hub-ai-apps-strings.js", "hub-room-source.js", "hub-room-source-strings.js",
109
109
  // M-3592: Administration → Sign-in.
110
- "hub-session-limits.js"]);
110
+ "hub-session-limits.js",
111
+ // M-3975: Administration → People search, and the people-search rule the pickers share.
112
+ "hub-people-index.js", "hub-people-query.js", "hub-people-paste.js"]);
111
113
  const BODY_LIMIT = 96 * 1024;
112
114
  const UPLOADS_PER_SESSION = 2, UPLOADS_TOTAL = 8;
113
115
  const UUID = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
@@ -467,7 +469,7 @@ export function createHubHttp(deps, sql) {
467
469
  }));
468
470
  }
469
471
  // Composed routes, not enrollment authority or the administrator's on/off switch. Older Hubs omit unsupported cards.
470
- 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"] : []),
472
+ 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", ...(deps.peopleIndex ? ["people-index-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"] : []),
471
473
  ...(deps.companyJoin ? ["company-join-v1", "enrolment-code-v1"] : []), ...(deps.directoryNotices ? ["directory-security-notices-v1"] : []), ...(deps.memberAddressNotices ? ["member-address-notices-v1"] : []),
472
474
  ...(deps.directorySettings ? [HUB_DIRECTORY_SETTINGS_FEATURE, HUB_DIRECTORY_CA_FEATURE, HUB_DIRECTORY_EDITOR_FEATURE] : [])];
473
475
  offered.push("mcp-apps-v1");
@@ -882,6 +884,8 @@ export function createHubHttp(deps, sql) {
882
884
  if (query.size)
883
885
  throw new HubProtocolError("invalid");
884
886
  const b = await body();
887
+ if (path === "/hub/v1/roles/resolve")
888
+ return answer(await guard(() => roles.resolve(ctx, b)));
885
889
  if (path === "/hub/v1/roles/preview") {
886
890
  if (Object.keys(b).length !== 1 || !Object.hasOwn(b, "policy"))
887
891
  throw new HubProtocolError("invalid");
@@ -922,6 +926,14 @@ export function createHubHttp(deps, sql) {
922
926
  if (path === "/hub/v1/teams/candidates") {
923
927
  if (!teams)
924
928
  throw new HttpError(404, "not-found");
929
+ // M-3975: POST resolves a pasted list (people only) under the same authority and rate bucket.
930
+ if (method === "POST") {
931
+ csrf();
932
+ if ([...query.keys()].length)
933
+ throw new HubProtocolError("invalid");
934
+ const b = await body(), out = await guard(() => teams.suggestions(ctx, b));
935
+ return send(res, 200, Array.isArray(out) ? { candidates: out } : out);
936
+ }
925
937
  if (method !== "GET")
926
938
  throw new HttpError(405, "method");
927
939
  signedIn();
@@ -1002,6 +1014,52 @@ export function createHubHttp(deps, sql) {
1002
1014
  }
1003
1015
  throw new HttpError(405, "method");
1004
1016
  }
1017
+ if (deps.peopleIndex && (path === "/hub/v1/admin/people-index" || path === "/hub/v1/admin/people-index/refresh")) {
1018
+ // M-3975: the people-search index is a Hub administrator's switch. Its snapshot only answers searches.
1019
+ const index = deps.peopleIndex;
1020
+ if ([...query.keys()].length)
1021
+ throw new HubProtocolError("invalid");
1022
+ // Turning it on or off and Refresh now are audited, in the transaction that checks the administrator is current.
1023
+ const audited = (permit, action, reasonCode) => core.atomic((_db, tx) => {
1024
+ core.check();
1025
+ permit.assertCurrent();
1026
+ core.audit(tx, { requestId: ctx.requestId, actor: permit.actor.kind === "directory" ? { kind: "person", person: permit.actor.person } : { kind: "local-host" },
1027
+ action, result: "completed", reasonCode });
1028
+ });
1029
+ if (path.endsWith("/refresh")) {
1030
+ if (method !== "POST")
1031
+ throw new HttpError(405, "method");
1032
+ csrf();
1033
+ const permit = await guard(() => core.management(ctx, "hub.admin"));
1034
+ permit.assertCurrent();
1035
+ if (!index.status().enabled)
1036
+ throw new HubProtocolError("conflict");
1037
+ audited(permit, "people-index.refresh-requested", "manual");
1038
+ void index.refresh();
1039
+ return send(res, 200, index.status());
1040
+ }
1041
+ if (method === "GET") {
1042
+ signedIn();
1043
+ const permit = await guard(() => core.management(ctx, "hub.admin"));
1044
+ permit.assertCurrent();
1045
+ return send(res, 200, index.status());
1046
+ }
1047
+ if (method !== "PUT")
1048
+ throw new HttpError(405, "method");
1049
+ csrf();
1050
+ const input = await body(), permit = await guard(() => core.management(ctx, "hub.admin"));
1051
+ if (!input || typeof input !== "object" || Array.isArray(input) || Object.keys(input).join() !== "enabled" || typeof input.enabled !== "boolean")
1052
+ throw new HubProtocolError("invalid");
1053
+ permit.assertCurrent();
1054
+ const on = input.enabled, changed = on !== index.status().enabled;
1055
+ // Audited once the switch has really changed (Fable, #4650): a refused or failed change records nothing.
1056
+ const status = index.setEnabled(on);
1057
+ if (changed)
1058
+ audited(permit, on ? "people-index.enabled" : "people-index.disabled", on ? "on" : "off");
1059
+ if (on)
1060
+ void index.refresh();
1061
+ return send(res, 200, on ? index.status() : status);
1062
+ }
1005
1063
  if (path === "/hub/v1/admin/rooms/creators") {
1006
1064
  if (method === "GET") {
1007
1065
  signedIn();
@@ -1045,6 +1103,14 @@ export function createHubHttp(deps, sql) {
1045
1103
  return send(res, 200, { candidates: await guard(() => groupRooms.ownAgentCandidates(ctx, uuid(r[1]), query.get("q") ?? "")) });
1046
1104
  }
1047
1105
  if (path === "/hub/v1/rooms/candidates") {
1106
+ // M-3975: POST resolves a pasted list of people (same access, rate bucket and fences as the GET search).
1107
+ if (method === "POST") {
1108
+ csrf();
1109
+ if ([...query.keys()].length)
1110
+ throw new HubProtocolError("invalid");
1111
+ const b = await body();
1112
+ return send(res, 200, await guard(() => groupRooms.resolveCandidates(ctx, b)));
1113
+ }
1048
1114
  if (method !== "GET")
1049
1115
  throw new HttpError(405, "method");
1050
1116
  signedIn();