@gravity-rail/cli 0.32.0 → 0.33.1

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/gr.js CHANGED
@@ -3230,7 +3230,7 @@ var init_libphonenumber_js = __esm({
3230
3230
  }
3231
3231
  });
3232
3232
 
3233
- // ../sdk/dist/chunk-N446FGCT.js
3233
+ // ../sdk/dist/chunk-ZGXE5SVN.js
3234
3234
  function sanitizePhoneForBackend(phoneNumber) {
3235
3235
  try {
3236
3236
  let parsed = parsePhoneNumber4(phoneNumber);
@@ -3550,7 +3550,6 @@ function bindChatsMethods(target, chats) {
3550
3550
  target.getChatModelOverride = chats.getChatModelOverride.bind(chats);
3551
3551
  target.updateChatModelOverride = chats.updateChatModelOverride.bind(chats);
3552
3552
  target.updateChatMute = chats.updateChatMute.bind(chats);
3553
- target.updateChatNeedsResponse = chats.updateChatNeedsResponse.bind(chats);
3554
3553
  target.summarizeChat = chats.summarizeChat.bind(chats);
3555
3554
  target.getChatMessages = chats.getChatMessages.bind(chats);
3556
3555
  target.getChildThreadMessages = chats.getChildThreadMessages.bind(chats);
@@ -3605,19 +3604,24 @@ function bindActivityMethods(target, activity) {
3605
3604
  target.queryActivityLatestSubjects = activity.queryActivityLatestSubjects.bind(activity);
3606
3605
  target.queryActivityOpenItems = activity.queryActivityOpenItems.bind(activity);
3607
3606
  target.queryActivityOneView = activity.queryActivityOneView.bind(activity);
3607
+ target.queryActivityDigest = activity.queryActivityDigest.bind(activity);
3608
3608
  target.getActivityCounts = activity.getActivityCounts.bind(activity);
3609
3609
  target.getActivityCapabilities = activity.getActivityCapabilities.bind(activity);
3610
3610
  target.queryOrgActivity = activity.queryOrgActivity.bind(activity);
3611
3611
  target.queryOrgActivityLatestSubjects = activity.queryOrgActivityLatestSubjects.bind(activity);
3612
3612
  target.queryOrgActivityOpenItems = activity.queryOrgActivityOpenItems.bind(activity);
3613
3613
  target.queryOrgActivityOneView = activity.queryOrgActivityOneView.bind(activity);
3614
+ target.queryOrgActivityDigest = activity.queryOrgActivityDigest.bind(activity);
3614
3615
  target.getOrgActivityCounts = activity.getOrgActivityCounts.bind(activity);
3615
3616
  target.queryWorkspaceActivity = activity.queryWorkspaceActivity.bind(activity);
3616
3617
  target.queryWorkspaceActivityLatestSubjects = activity.queryWorkspaceActivityLatestSubjects.bind(activity);
3617
3618
  target.queryWorkspaceActivityOpenItems = activity.queryWorkspaceActivityOpenItems.bind(activity);
3618
3619
  target.queryWorkspaceActivityOneView = activity.queryWorkspaceActivityOneView.bind(activity);
3620
+ target.queryWorkspaceActivityDigest = activity.queryWorkspaceActivityDigest.bind(activity);
3619
3621
  target.getWorkspaceActivityCounts = activity.getWorkspaceActivityCounts.bind(activity);
3620
3622
  target.resolveEntityRefs = activity.resolveEntityRefs.bind(activity);
3623
+ target.resolveOrgEntityRefs = activity.resolveOrgEntityRefs.bind(activity);
3624
+ target.resolveAccountEntityRefs = activity.resolveAccountEntityRefs.bind(activity);
3621
3625
  }
3622
3626
  function bindMotdMethods(target, motd) {
3623
3627
  target.getMotd = motd.getMotd.bind(motd);
@@ -3689,6 +3693,7 @@ function bindMembersMethods(target, members) {
3689
3693
  target.updateCurrentMember = members.updateCurrentMember.bind(members);
3690
3694
  target.getWorkspaceMembers = members.getWorkspaceMembers.bind(members);
3691
3695
  target.getWorkspaceMember = members.getWorkspaceMember.bind(members);
3696
+ target.getOrgWorkspaceMember = members.getOrgWorkspaceMember.bind(members);
3692
3697
  target.createWorkspaceMember = members.createWorkspaceMember.bind(members);
3693
3698
  target.updateMember = members.updateMember.bind(members);
3694
3699
  target.deleteMember = members.deleteMember.bind(members);
@@ -4602,8 +4607,8 @@ function getRevisionState(workflow, revision) {
4602
4607
  };
4603
4608
  }
4604
4609
  var AbilitiesApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES, ActivityGrain, ActivityGroupBy, ActivityOpenItemOrder, ActivityWindowBasis;
4605
- var init_chunk_N446FGCT = __esm({
4606
- "../sdk/dist/chunk-N446FGCT.js"() {
4610
+ var init_chunk_ZGXE5SVN = __esm({
4611
+ "../sdk/dist/chunk-ZGXE5SVN.js"() {
4607
4612
  init_chunk_P2E6LU7I();
4608
4613
  init_libphonenumber_js();
4609
4614
  AbilitiesApi = class extends BaseApiClient {
@@ -6120,22 +6125,12 @@ var init_chunk_N446FGCT = __esm({
6120
6125
  });
6121
6126
  }
6122
6127
  /** Update the mute status of a chat. */
6123
- async updateChatMute(wid, id, muted) {
6128
+ async updateChatMute(wid, id, muted, muteReason, muteExpiresOnInbound) {
6124
6129
  return this.fetch(`w/${wid}/chats/${id}/mute`, {
6125
6130
  method: "PUT",
6126
- body: JSON.stringify({ muted })
6131
+ body: JSON.stringify({ muted, muteReason, muteExpiresOnInbound })
6127
6132
  });
6128
6133
  }
6129
- /** Update the needs-response flag on a chat. */
6130
- async updateChatNeedsResponse(wid, id, needsResponse) {
6131
- return this.fetch(
6132
- `w/${wid}/chats/${id}/needs-response`,
6133
- {
6134
- method: "PUT",
6135
- body: JSON.stringify({ needsResponse })
6136
- }
6137
- );
6138
- }
6139
6134
  /** Generate an AI summary for a chat, optionally updating its labels. */
6140
6135
  async summarizeChat(wid, id, updateLabels) {
6141
6136
  const params = new URLSearchParams();
@@ -8465,6 +8460,19 @@ var init_chunk_N446FGCT = __esm({
8465
8460
  async getWorkspaceMember(wid, memberId) {
8466
8461
  return this.fetch(`w/${wid}/members/${memberId}`);
8467
8462
  }
8463
+ /**
8464
+ * Get one member of an org's workspace, under `org:read`.
8465
+ *
8466
+ * The same record and the same shape as `getWorkspaceMember`, for a reader
8467
+ * whose authority is the org rather than a member row in that workspace —
8468
+ * an org Activity pane opening a member it just listed. A workspace outside
8469
+ * the org is a 404, indistinguishable from a member id that does not exist.
8470
+ */
8471
+ async getOrgWorkspaceMember(orgUuid, workspaceUuid, memberId) {
8472
+ return this.fetch(
8473
+ `o/${orgUuid}/activity/workspaces/${workspaceUuid}/members/${memberId}`
8474
+ );
8475
+ }
8468
8476
  /** Create a new workspace member. */
8469
8477
  async createWorkspaceMember(wid, data) {
8470
8478
  return this.fetch(`w/${wid}/members`, {
@@ -9984,6 +9992,34 @@ var init_chunk_N446FGCT = __esm({
9984
9992
  `o/${orgIdOrUuid}/webhooks/${endpointUuid}/deliveries?limit=${limit}`
9985
9993
  );
9986
9994
  }
9995
+ /**
9996
+ * A representative delivery body for one event type — what the test-send
9997
+ * editor is prefilled with, and the same builder the public event catalog
9998
+ * is generated from. Pass `endpointUuid` to have the sample name that
9999
+ * endpoint and sit in a workspace it actually covers.
10000
+ */
10001
+ async getOrgWebhookEventSample(orgIdOrUuid, eventType, endpointUuid) {
10002
+ const query = endpointUuid ? `?endpointUuid=${encodeURIComponent(endpointUuid)}` : "";
10003
+ return this.fetch(
10004
+ `o/${orgIdOrUuid}/webhooks/event-types/${encodeURIComponent(eventType)}/sample${query}`
10005
+ );
10006
+ }
10007
+ /**
10008
+ * Send one payload to the endpoint now and report what came back.
10009
+ *
10010
+ * Outside the delivery queue: no delivery row, no retry, no effect on the
10011
+ * endpoint's status — but the same signing, egress vetting and outcome
10012
+ * classification a real delivery goes through.
10013
+ */
10014
+ async testOrgWebhookEndpoint(orgIdOrUuid, endpointUuid, data) {
10015
+ return this.fetch(
10016
+ `o/${orgIdOrUuid}/webhooks/${endpointUuid}/test`,
10017
+ {
10018
+ method: "POST",
10019
+ body: JSON.stringify(data)
10020
+ }
10021
+ );
10022
+ }
9987
10023
  };
9988
10024
  OAuthConnectionsApi = class extends BaseApiClient {
9989
10025
  async getConnectionStatus(providerSlug) {
@@ -13609,6 +13645,39 @@ var init_chunk_N446FGCT = __esm({
13609
13645
  body: JSON.stringify(request)
13610
13646
  });
13611
13647
  }
13648
+ /**
13649
+ * The specifics behind a page of aggregate lines, in one round trip.
13650
+ *
13651
+ * Each entry of `request.lines` is an aggregate line's **own server-issued
13652
+ * drill**, POSTed back verbatim, and the response is positional with it — so
13653
+ * a caller maps groups back to rows without inventing a key and without a
13654
+ * second expression of the slice that could drift from the count above it.
13655
+ *
13656
+ * Aggregate-shaped, never row-level: counts per PHI-silent key. A digest the
13657
+ * server could not finish comes back with `complete: false` and no groups,
13658
+ * which a client renders as the plain count phrase rather than as a slice
13659
+ * presented as the whole.
13660
+ */
13661
+ async queryActivityDigest(request) {
13662
+ return this.fetch("activity/digest", {
13663
+ method: "POST",
13664
+ body: JSON.stringify(request)
13665
+ });
13666
+ }
13667
+ /** The org mount's digest. */
13668
+ async queryOrgActivityDigest(orgUuid, request) {
13669
+ return this.fetch(`o/${orgUuid}/activity/digest`, {
13670
+ method: "POST",
13671
+ body: JSON.stringify(request)
13672
+ });
13673
+ }
13674
+ /** The workspace mount's digest. */
13675
+ async queryWorkspaceActivityDigest(workspaceUuid, request) {
13676
+ return this.fetch(`w/${workspaceUuid}/activity/digest`, {
13677
+ method: "POST",
13678
+ body: JSON.stringify(request)
13679
+ });
13680
+ }
13612
13681
  /** The workspace mount. The request's own member session carries its scopes. */
13613
13682
  async queryWorkspaceActivity(workspaceUuid, request) {
13614
13683
  return this.fetch(`w/${workspaceUuid}/activity/query`, {
@@ -13670,6 +13739,49 @@ var init_chunk_N446FGCT = __esm({
13670
13739
  body: JSON.stringify(request)
13671
13740
  });
13672
13741
  }
13742
+ /**
13743
+ * Hydrate a page of typed refs spanning an org's workspaces, in one round
13744
+ * trip. `org:info` is the gate; what it buys differs per workspace, and the
13745
+ * server decides — an `org:read` holder reads every workspace in the org,
13746
+ * an `org:info` holder the ones they belong to.
13747
+ *
13748
+ * The request groups refs by workspace because the same UUID under two
13749
+ * workspaces is two entities. A group naming a workspace this caller cannot
13750
+ * reach comes back entirely `unresolved` — the same answer a denied ref
13751
+ * gets, never an error.
13752
+ *
13753
+ * Caps: at most 500 refs and 25 workspaces across the whole request, and a
13754
+ * workspace may be named at most once in it. Each answered group carries the
13755
+ * same per-entry contract as the workspace mount: every requested ref comes
13756
+ * back, with a marker status rather than an omission.
13757
+ *
13758
+ * PHI: resolved labels are member-identifying data. They belong in the UI
13759
+ * and nowhere else — never a log line, never an error message.
13760
+ */
13761
+ async resolveOrgEntityRefs(orgUuid, request) {
13762
+ return this.fetch(`o/${orgUuid}/activity/entity-refs/resolve`, {
13763
+ method: "POST",
13764
+ body: JSON.stringify(request)
13765
+ });
13766
+ }
13767
+ /**
13768
+ * Hydrate a page of typed refs spanning the caller's whole estate.
13769
+ *
13770
+ * The same grouped body as the org mount, and the same rule that the server
13771
+ * chooses each group's authority: a workspace the caller belongs to resolves
13772
+ * under their own member row, and a workspace they reach by holding
13773
+ * `org:read` on its org resolves under that. A client never states which,
13774
+ * because stating it would mean carrying a copy of the policy.
13775
+ *
13776
+ * PHI: resolved labels are member-identifying data. They belong in the UI
13777
+ * and nowhere else — never a log line, never an error message.
13778
+ */
13779
+ async resolveAccountEntityRefs(request) {
13780
+ return this.fetch(`activity/entity-refs/resolve`, {
13781
+ method: "POST",
13782
+ body: JSON.stringify(request)
13783
+ });
13784
+ }
13673
13785
  };
13674
13786
  MotdApi = class extends BaseApiClient {
13675
13787
  /**
@@ -14314,6 +14426,7 @@ var init_chunk_N446FGCT = __esm({
14314
14426
  "queryWorkspaceActivityLatestSubjects",
14315
14427
  "queryWorkspaceActivityOpenItems",
14316
14428
  "queryWorkspaceActivityOneView",
14429
+ "queryWorkspaceActivityDigest",
14317
14430
  "registerDiscordSlashCommands",
14318
14431
  "reopenWorkspaceSupportRequest",
14319
14432
  "resolveEntityRefs",
@@ -14684,7 +14797,6 @@ var init_chunk_N446FGCT = __esm({
14684
14797
  "updateChatLabel",
14685
14798
  "updateChatModelOverride",
14686
14799
  "updateChatMute",
14687
- "updateChatNeedsResponse",
14688
14800
  "updateClientWorkspace",
14689
14801
  "updateConnection",
14690
14802
  "updateConnectionSyncConfig",
@@ -14813,7 +14925,6 @@ var init_chunk_N446FGCT = __esm({
14813
14925
  getChatModelOverride;
14814
14926
  updateChatModelOverride;
14815
14927
  updateChatMute;
14816
- updateChatNeedsResponse;
14817
14928
  summarizeChat;
14818
14929
  getChatMessages;
14819
14930
  getChildThreadMessages;
@@ -14899,6 +15010,9 @@ var init_chunk_N446FGCT = __esm({
14899
15010
  updateCurrentMember;
14900
15011
  getWorkspaceMembers;
14901
15012
  getWorkspaceMember;
15013
+ // Org-scoped, so deliberately absent from WORKSPACE_METHOD_NAMES: that proxy
15014
+ // passes a workspace uuid as the first argument.
15015
+ getOrgWorkspaceMember;
14902
15016
  createWorkspaceMember;
14903
15017
  updateMember;
14904
15018
  deleteMember;
@@ -15020,20 +15134,26 @@ var init_chunk_N446FGCT = __esm({
15020
15134
  queryActivityLatestSubjects;
15021
15135
  queryActivityOpenItems;
15022
15136
  queryActivityOneView;
15137
+ queryActivityDigest;
15023
15138
  getActivityCounts;
15024
15139
  getActivityCapabilities;
15025
15140
  queryOrgActivity;
15026
15141
  queryOrgActivityLatestSubjects;
15027
15142
  queryOrgActivityOpenItems;
15028
15143
  queryOrgActivityOneView;
15144
+ queryOrgActivityDigest;
15029
15145
  getOrgActivityCounts;
15030
15146
  queryWorkspaceActivity;
15031
15147
  queryWorkspaceActivityLatestSubjects;
15032
15148
  queryWorkspaceActivityOpenItems;
15033
15149
  queryWorkspaceActivityOneView;
15150
+ queryWorkspaceActivityDigest;
15034
15151
  getWorkspaceActivityCounts;
15035
- // Hydration: typed refs in, display summaries out, one round trip.
15152
+ // Hydration: typed refs in, display summaries out, one round trip. The org
15153
+ // variant carries several workspaces' groups in that one trip.
15036
15154
  resolveEntityRefs;
15155
+ resolveOrgEntityRefs;
15156
+ resolveAccountEntityRefs;
15037
15157
  // MOTD API
15038
15158
  getMotd;
15039
15159
  // Tracked Links analytics (#10934)
@@ -16092,7 +16212,7 @@ var init_chunk_HRUMZ46V = __esm({
16092
16212
  var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
16093
16213
  var init_dist = __esm({
16094
16214
  "../sdk/dist/index.js"() {
16095
- init_chunk_N446FGCT();
16215
+ init_chunk_ZGXE5SVN();
16096
16216
  init_chunk_HRUMZ46V();
16097
16217
  init_chunk_P2E6LU7I();
16098
16218
  SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
@@ -16125,6 +16245,7 @@ var init_dist = __esm({
16125
16245
  chatstarted: "chat.started",
16126
16246
  chatawaiting_human: "chat.awaiting_human",
16127
16247
  chathuman_replied: "chat.human_replied",
16248
+ chatcall_ended: "chat.call_ended",
16128
16249
  escalationopened: "escalation.opened",
16129
16250
  escalationresolved: "escalation.resolved",
16130
16251
  callstarted: "call.started",
@@ -29211,6 +29332,12 @@ var qualificationsDomain = {
29211
29332
  required: false
29212
29333
  },
29213
29334
  { name: "goal", description: "Goal for the user simulator", required: false },
29335
+ { name: "channel", description: "Run channel: web-chat | web-voice", required: false },
29336
+ {
29337
+ name: "anonymous",
29338
+ description: "Use an anonymous caller: true | false; otherwise inherit scenario",
29339
+ required: false
29340
+ },
29214
29341
  { name: "driver", description: "Driver mode: auto | human", required: false },
29215
29342
  {
29216
29343
  name: "workflow-revision-id",
@@ -29243,7 +29370,17 @@ var qualificationsDomain = {
29243
29370
  required: false
29244
29371
  }
29245
29372
  ],
29246
- handler: async ({ ctx, workspace, args }) => {
29373
+ handler: async ({ ctx, workspace, args, data }) => {
29374
+ if (data !== void 0 || args["data"] !== void 0) {
29375
+ throw new CLIError(
29376
+ "runs start does not accept --data; use --channel, --anonymous and the named run flags"
29377
+ );
29378
+ }
29379
+ const channel = args["channel"];
29380
+ if (channel !== void 0 && channel !== "web-chat" && channel !== "web-voice") {
29381
+ throw new CLIError("--channel must be web-chat or web-voice");
29382
+ }
29383
+ const anonymous = optionalBool(args, "anonymous");
29247
29384
  const driver = args["driver"] === "human" ? DriverMode.HUMAN : DriverMode.AUTO;
29248
29385
  const scenarioId = args["scenario-id"] ? requireNumber(args, "scenario-id") : void 0;
29249
29386
  const personaId = args["persona-id"] ? requireNumber(args, "persona-id") : void 0;
@@ -29267,6 +29404,8 @@ var qualificationsDomain = {
29267
29404
  ...args["workflow-revision-id"] ? { workflowRevisionId: requireNumber(args, "workflow-revision-id") } : {},
29268
29405
  ...args["workflow-revision-uuid"] ? { workflowRevisionUuid: String(args["workflow-revision-uuid"]) } : {},
29269
29406
  ...args["goal"] ? { goal: String(args["goal"]) } : {},
29407
+ ...channel !== void 0 ? { channel } : {},
29408
+ ...anonymous !== void 0 ? { anonymous } : {},
29270
29409
  ...args["assistant-chat-model-id"] ? { assistantChatModelId: String(args["assistant-chat-model-id"]) } : {},
29271
29410
  ...args["assistant-realtime-model-id"] ? {
29272
29411
  assistantRealtimeModelId: String(args["assistant-realtime-model-id"])
@@ -30938,12 +31077,81 @@ var ActivityRefResolver = class {
30938
31077
  forWorkspace.set(`${ref.kind}|${ref.uuid}`, ref);
30939
31078
  byWorkspace.set(ref.workspaceUuid, forWorkspace);
30940
31079
  }
31080
+ const groups = [...byWorkspace].map(
31081
+ ([workspaceUuid, wanted]) => [workspaceUuid, [...wanted.values()]]
31082
+ );
31083
+ if (this.options.orgUuid) {
31084
+ await this.primeOrg(this.options.orgUuid, groups);
31085
+ return;
31086
+ }
30941
31087
  await Promise.all(
30942
- [...byWorkspace].map(
30943
- ([workspaceUuid, wanted]) => this.primeWorkspace(workspaceUuid, [...wanted.values()])
30944
- )
31088
+ groups.map(([workspaceUuid, wanted]) => this.primeWorkspace(workspaceUuid, wanted))
30945
31089
  );
30946
31090
  }
31091
+ /**
31092
+ * One org call per chunk, each carrying whole workspace groups.
31093
+ *
31094
+ * The server's cap is over the whole request rather than per workspace, and
31095
+ * it accepts each workspace at most once per request — so a group larger
31096
+ * than the cap is split across requests, and smaller groups ride together
31097
+ * until the next one would not fit.
31098
+ */
31099
+ async primeOrg(orgUuid, groups) {
31100
+ const chunks = [];
31101
+ let current = [];
31102
+ let size = 0;
31103
+ for (const [workspaceUuid, refs] of groups) {
31104
+ for (let start = 0; start < refs.length; start += MAX_REFS_PER_BATCH) {
31105
+ const slice = refs.slice(start, start + MAX_REFS_PER_BATCH);
31106
+ if (size + slice.length > MAX_REFS_PER_BATCH && current.length > 0) {
31107
+ chunks.push(current);
31108
+ current = [];
31109
+ size = 0;
31110
+ }
31111
+ current.push([workspaceUuid, slice]);
31112
+ size += slice.length;
31113
+ }
31114
+ }
31115
+ if (current.length > 0) chunks.push(current);
31116
+ for (const chunk of chunks) {
31117
+ const key = `org:${orgUuid}|${chunk.map(
31118
+ ([workspaceUuid, refs]) => `${workspaceUuid}:${refs.map((ref) => `${ref.kind}|${ref.uuid}`).sort().join(",")}`
31119
+ ).sort().join(";")}`;
31120
+ const pending = this.inFlight.get(key) ?? this.fetchOrgChunk(orgUuid, chunk, key);
31121
+ this.inFlight.set(key, pending);
31122
+ await pending;
31123
+ }
31124
+ }
31125
+ /** One org batch call, seeded into the same per-ref cache. */
31126
+ async fetchOrgChunk(orgUuid, chunk, key) {
31127
+ try {
31128
+ this.fetches += 1;
31129
+ const response = await this.client.resolveOrgEntityRefs(orgUuid, {
31130
+ workspaces: chunk.map(([workspaceUuid, refs]) => ({
31131
+ workspaceUuid,
31132
+ refs: refs.map((ref) => ({ kind: ref.kind, uuid: ref.uuid }))
31133
+ }))
31134
+ });
31135
+ const answered = new Map(
31136
+ response.workspaces.map((group) => [
31137
+ group.workspaceUuid,
31138
+ new Map(group.refs.map((entry) => [`${entry.kind}|${entry.uuid}`, entry]))
31139
+ ])
31140
+ );
31141
+ for (const [workspaceUuid, refs] of chunk) {
31142
+ const byKey = answered.get(workspaceUuid);
31143
+ if (!byKey) continue;
31144
+ for (const ref of refs) {
31145
+ const entry = byKey.get(`${ref.kind}|${ref.uuid}`);
31146
+ if (!entry) continue;
31147
+ const resolution = batchResolution(ref, entry);
31148
+ if (resolution) this.cache.set(this.cacheKey(ref), Promise.resolve(resolution));
31149
+ }
31150
+ }
31151
+ } catch {
31152
+ this.inFlight.delete(key);
31153
+ }
31154
+ }
30947
31155
  async primeWorkspace(workspaceUuid, refs) {
30948
31156
  for (let start = 0; start < refs.length; start += MAX_REFS_PER_BATCH) {
30949
31157
  const chunk = refs.slice(start, start + MAX_REFS_PER_BATCH);
@@ -31198,8 +31406,10 @@ function globalFlags(ctx) {
31198
31406
  return flags;
31199
31407
  }
31200
31408
  function resolverFor(hctx) {
31409
+ const mount = resolveActivityMount(hctx.args);
31201
31410
  return new ActivityRefResolver(requireAuth(hctx.ctx).apiClient, {
31202
- bare: hctx.args.ids === true
31411
+ bare: hctx.args.ids === true,
31412
+ orgUuid: mount.kind === "org" ? mount.uuid : void 0
31203
31413
  });
31204
31414
  }
31205
31415
  function isAggregate(response) {
@@ -42866,7 +43076,7 @@ init_concierge_api();
42866
43076
 
42867
43077
  // package.json
42868
43078
  var package_default = {
42869
- version: "0.32.0"};
43079
+ version: "0.33.1"};
42870
43080
 
42871
43081
  // src/gr.ts
42872
43082
  var VERSION = package_default.version;