@gravity-rail/sdk 0.16.0 → 0.18.0

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 (36) hide show
  1. package/dist/{chunk-4B7T6MBH.js → chunk-MP5ENP4Q.js} +493 -77
  2. package/dist/chunk-MP5ENP4Q.js.map +1 -0
  3. package/dist/{chunk-GP6ICMWF.js → chunk-PJFEGUHM.js} +8 -1
  4. package/dist/chunk-PJFEGUHM.js.map +1 -0
  5. package/dist/{client-3xYGmF3t.d.ts → client-B51HZ6zY.d.cts} +2229 -217
  6. package/dist/{client-BhO_UFFz.d.cts → client-G5i59XtT.d.ts} +2229 -217
  7. package/dist/helpers.cjs +7 -0
  8. package/dist/helpers.cjs.map +1 -1
  9. package/dist/helpers.d.cts +2 -2
  10. package/dist/helpers.d.ts +2 -2
  11. package/dist/helpers.js +1 -1
  12. package/dist/index.cjs +449 -70
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +23 -5
  15. package/dist/index.d.ts +23 -5
  16. package/dist/index.js +77 -4
  17. package/dist/index.js.map +1 -1
  18. package/dist/internal.cjs +564 -72
  19. package/dist/internal.cjs.map +1 -1
  20. package/dist/internal.d.cts +95 -7
  21. package/dist/internal.d.ts +95 -7
  22. package/dist/internal.js +93 -6
  23. package/dist/internal.js.map +1 -1
  24. package/dist/{revision-state-Dma10N9s.d.ts → revision-state-Cc7RAf8A.d.ts} +30 -5
  25. package/dist/{revision-state-Dx8gCQIj.d.cts → revision-state-DudSCwea.d.cts} +30 -5
  26. package/dist/schemas.cjs +170 -216
  27. package/dist/schemas.cjs.map +1 -1
  28. package/dist/schemas.d.cts +11 -11
  29. package/dist/schemas.d.ts +11 -11
  30. package/dist/schemas.js +170 -209
  31. package/dist/schemas.js.map +1 -1
  32. package/dist/{tasks-vupYoJgG.d.cts → tasks-1JXJJuG8.d.cts} +256 -73
  33. package/dist/{tasks-vupYoJgG.d.ts → tasks-1JXJJuG8.d.ts} +256 -73
  34. package/package.json +3 -3
  35. package/dist/chunk-4B7T6MBH.js.map +0 -1
  36. package/dist/chunk-GP6ICMWF.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -88,6 +88,7 @@ __export(src_exports, {
88
88
  MemberType: () => MemberType,
89
89
  MenuItemResponseItemType: () => MenuItemResponseItemType,
90
90
  MenuItemType: () => MenuItemResponseItemType,
91
+ MergeMemberRolesRequestAccessStrategy: () => MergeMemberRolesRequestAccessStrategy,
91
92
  ModelProvider: () => ModelProvider,
92
93
  ModelType: () => ModelType,
93
94
  NO_ASSISTANT_PARTICIPANT_CHAT_TYPES: () => NO_ASSISTANT_PARTICIPANT_CHAT_TYPES,
@@ -130,7 +131,8 @@ __export(src_exports, {
130
131
  SMS_DELIVERY_FAILURE_STATUSES: () => SMS_DELIVERY_FAILURE_STATUSES,
131
132
  STT_MODEL_DEEPGRAM_FLUX: () => STT_MODEL_DEEPGRAM_FLUX,
132
133
  STT_MODEL_DEEPGRAM_FLUX_MULTI: () => STT_MODEL_DEEPGRAM_FLUX_MULTI,
133
- STT_MODEL_ELEVENLABS_SCRIBE: () => STT_MODEL_ELEVENLABS_SCRIBE,
134
+ STT_MODEL_DEEPGRAM_FLUX_MULTI_SELFHOST: () => STT_MODEL_DEEPGRAM_FLUX_MULTI_SELFHOST,
135
+ STT_MODEL_DEEPGRAM_FLUX_SELFHOST: () => STT_MODEL_DEEPGRAM_FLUX_SELFHOST,
134
136
  Scope: () => Scope,
135
137
  ScopeCategory: () => ScopeCategory,
136
138
  ScopeManager: () => ScopeManager,
@@ -151,11 +153,14 @@ __export(src_exports, {
151
153
  WorkflowAccessWarningResourceType: () => WorkflowAccessWarningResourceType,
152
154
  WorkflowBuilder: () => WorkflowBuilder,
153
155
  WorkflowResourceType: () => WorkflowAccessWarningResourceType,
156
+ WorkflowRoutingMode: () => WorkflowRoutingMode,
154
157
  WorkspaceBuilder: () => WorkspaceBuilder,
155
158
  WorkspaceBuilderResource: () => WorkspaceBuilderResource,
156
159
  WorkspaceFeature: () => WorkspaceFeature,
157
160
  WorkspaceProvisionStatus: () => WorkspaceProvisionStatus,
161
+ archivedMemberConflictId: () => archivedMemberConflictId,
158
162
  areDependenciesSatisfied: () => areDependenciesSatisfied,
163
+ asIdentifiedMemberContactConflict: () => asIdentifiedMemberContactConflict,
159
164
  canPreviewVoice: () => canPreviewVoice,
160
165
  clearRegistry: () => clearRegistry,
161
166
  createWorkspaceClient: () => createWorkspaceClient,
@@ -179,9 +184,12 @@ __export(src_exports, {
179
184
  getTTSProvider: () => getTTSProvider,
180
185
  getVoiceModelId: () => getVoiceModelId,
181
186
  initializeFeatures: () => initializeFeatures,
187
+ isAccountContactConflict: () => isAccountContactConflict,
182
188
  isAgentNoteOrigin: () => isAgentNoteOrigin,
183
189
  isChatType: () => isChatType,
184
190
  isFeatureAvailable: () => isFeatureAvailable,
191
+ isIdentifiedMemberContactConflict: () => isIdentifiedMemberContactConflict,
192
+ isMemberContactConflict: () => isMemberContactConflict,
185
193
  isPositiveRating: () => isPositiveRating,
186
194
  isRegistryInitialized: () => isRegistryInitialized,
187
195
  isSMSDeliveryFailureStatus: () => isSMSDeliveryFailureStatus,
@@ -226,6 +234,13 @@ var ApiError = class extends Error {
226
234
  * Populated when the backend returns a WorkflowValidationErrorResponse.
227
235
  */
228
236
  validationErrors;
237
+ /**
238
+ * The raw structured `detail` object when the backend returned one (a body
239
+ * with `error: true` or a `code`). Declared here rather than bolted on with
240
+ * `as any` at the throw site so consumers can narrow it with a type guard —
241
+ * see `isMemberContactConflict` in `types/member-types`.
242
+ */
243
+ errorData;
229
244
  constructor(message, statusCode, errors, validationErrors) {
230
245
  super(message);
231
246
  this.statusCode = statusCode;
@@ -2063,11 +2078,9 @@ var ChatsApi = class extends BaseApiClient {
2063
2078
  }
2064
2079
  /** Get loaded and revealed skills for a chat. */
2065
2080
  async getChatSkills(wid, chatId) {
2066
- return this.fetch(
2067
- `w/${wid}/chats/${chatId}/skills`
2068
- );
2081
+ return this.fetch(`w/${wid}/chats/${chatId}/skills`);
2069
2082
  }
2070
- /** List built-in skills that can be selected before starting a Manager Chat. */
2083
+ /** List built-in skills selectable before a Manager Chat (and on Routine manager tasks). */
2071
2084
  async getManagerSkills(wid) {
2072
2085
  return this.fetch(`w/${wid}/chats/manager/skills`);
2073
2086
  }
@@ -2580,6 +2593,32 @@ var DashboardsApi = class extends BaseApiClient {
2580
2593
  `w/${wid}/dashboards/stats/workflow-assignments`
2581
2594
  );
2582
2595
  }
2596
+ /**
2597
+ * Current saved-configuration health across every family (Workflow
2598
+ * configuration, Journey authoring, Workflow access, Routine → Workflow
2599
+ * access, and the workspace lint).
2600
+ *
2601
+ * Requires ALL of `workflows:read`, `journeys:read`, `automations:read`,
2602
+ * `datatypes:read`, `members:read`, and `member_roles:read` — a pruned
2603
+ * subset would render as "all configuration is healthy".
2604
+ *
2605
+ * `page`/`pageSize` bound the response only; every family is evaluated in
2606
+ * full before the issue list is sliced. `check`/`severity` narrow the issue
2607
+ * list server-side, before pagination — filtering a single page in the
2608
+ * client cannot find a match that lives on a later one. `summary` and
2609
+ * `checks` are always workspace-global.
2610
+ */
2611
+ async getConfigurationHealth(wid, options) {
2612
+ const params = new URLSearchParams();
2613
+ if (options?.page !== void 0) params.append("page", options.page.toString());
2614
+ if (options?.pageSize !== void 0) params.append("pageSize", options.pageSize.toString());
2615
+ if (options?.check !== void 0) params.append("check", options.check);
2616
+ if (options?.severity !== void 0) params.append("severity", options.severity);
2617
+ const query = params.toString();
2618
+ return this.fetch(
2619
+ `w/${wid}/configuration-health${query ? `?${query}` : ""}`
2620
+ );
2621
+ }
2583
2622
  };
2584
2623
 
2585
2624
  // src/api/data-types.ts
@@ -2652,6 +2691,7 @@ var DataTypesApi = class extends BaseApiClient {
2652
2691
  const params = new URLSearchParams();
2653
2692
  if (options?.memberId !== void 0) params.append("member_id", options.memberId.toString());
2654
2693
  if (options?.memberIds?.length) params.append("member_ids", options.memberIds.join(","));
2694
+ if (options?.recordId !== void 0) params.append("record_id", options.recordId.toString());
2655
2695
  if (options?.search) params.append("search", options.search);
2656
2696
  if (options?.searchField) params.append("search_field", options.searchField);
2657
2697
  if (options?.dataRecordFilterId != null) {
@@ -2672,9 +2712,7 @@ var DataTypesApi = class extends BaseApiClient {
2672
2712
  params.append("dataTypeId", options.dataTypeId.toString());
2673
2713
  }
2674
2714
  const qs = params.toString();
2675
- return this.fetch(
2676
- `w/${wid}/data-record-filters${qs ? `?${qs}` : ""}`
2677
- );
2715
+ return this.fetch(`w/${wid}/data-record-filters${qs ? `?${qs}` : ""}`);
2678
2716
  }
2679
2717
  /** Get a single data-record filter by ID. */
2680
2718
  async getDataRecordFilter(wid, filterId) {
@@ -2702,9 +2740,7 @@ var DataTypesApi = class extends BaseApiClient {
2702
2740
  }
2703
2741
  /** Get the count of records matching a saved filter. */
2704
2742
  async getDataRecordFilterCount(wid, filterId) {
2705
- return this.fetch(
2706
- `w/${wid}/data-record-filters/${filterId}/count`
2707
- );
2743
+ return this.fetch(`w/${wid}/data-record-filters/${filterId}/count`);
2708
2744
  }
2709
2745
  /** Get a single data record by ID. */
2710
2746
  async getDataRecord(wid, recordId) {
@@ -3249,6 +3285,27 @@ var EventsApi = class extends BaseApiClient {
3249
3285
  method: "POST"
3250
3286
  });
3251
3287
  }
3288
+ /**
3289
+ * Configuration change history for one routine, newest first.
3290
+ *
3291
+ * Answers "who turned this off, when, and why" — including the
3292
+ * platform-initiated pauses (finite-repeat exhaustion, outbound-safety
3293
+ * runaway auto-pause) that no other surface exposes.
3294
+ *
3295
+ * `transitionsOnly` filters to rows that record a real trigger-gate
3296
+ * transition. Prefer it for a toggle-focused view: a full-form save always
3297
+ * re-sends every field, so unfiltered history includes saves that changed
3298
+ * nothing.
3299
+ */
3300
+ async getRoutineConfigEvents(wid, id, options = {}) {
3301
+ const params = new URLSearchParams();
3302
+ if (options.limit) params.append("limit", options.limit.toString());
3303
+ if (options.beforeId) params.append("before_id", options.beforeId.toString());
3304
+ if (options.transitionsOnly) params.append("transitions_only", "true");
3305
+ return this.fetch(
3306
+ `w/${wid}/routines/${id}/history${params.toString() ? `?${params.toString()}` : ""}`
3307
+ );
3308
+ }
3252
3309
  /** List routine run history with optional filtering by routine and status. */
3253
3310
  async getRoutineRuns(wid, options = {}) {
3254
3311
  const params = new URLSearchParams();
@@ -4774,12 +4831,34 @@ var MembersApi = class extends BaseApiClient {
4774
4831
  body: JSON.stringify(memberRole)
4775
4832
  });
4776
4833
  }
4777
- /** Delete a member role. */
4834
+ /** Delete a member role. Default roles (``systemKey`` set) return 403. */
4778
4835
  async deleteMemberRole(wid, id) {
4779
4836
  return this.fetch(`w/${wid}/member-roles/${id}`, {
4780
4837
  method: "DELETE"
4781
4838
  });
4782
4839
  }
4840
+ /**
4841
+ * Describe legacy duplicate default roles in this workspace. Read-only.
4842
+ *
4843
+ * Workspaces seeded by older versions of the product can carry the same
4844
+ * default role under several spellings ("manager" next to "Manager"). This
4845
+ * reports which ones should be merged and exactly how many members and
4846
+ * references each merge would move.
4847
+ */
4848
+ async getMemberRoleCleanupPlan(wid) {
4849
+ return this.fetch(`w/${wid}/member-roles/cleanup-plan`);
4850
+ }
4851
+ /**
4852
+ * Move every member and reference from one role to another, then delete the
4853
+ * source role. Requires `member_roles:admin`. The source cannot be a default
4854
+ * role.
4855
+ */
4856
+ async mergeMemberRoles(wid, request) {
4857
+ return this.fetch(`w/${wid}/member-roles/cleanup/merge`, {
4858
+ method: "POST",
4859
+ body: JSON.stringify(request)
4860
+ });
4861
+ }
4783
4862
  // Import/Export Members API
4784
4863
  /**
4785
4864
  * Read-only preview classifying each CSV row before any write (GRA-5545).
@@ -5082,42 +5161,13 @@ var MembersApi = class extends BaseApiClient {
5082
5161
  }
5083
5162
  };
5084
5163
 
5085
- // src/api/milestones.ts
5086
- var MilestonesApi = class extends BaseApiClient {
5087
- /** List milestones in a workspace with optional pagination and sorting. */
5088
- async getMilestones(wid, options = {}) {
5089
- const params = new URLSearchParams();
5090
- if (options.page) params.append("page", options.page.toString());
5091
- if (options.pageSize) params.append("pageSize", options.pageSize.toString());
5092
- if (options.sortBy) params.append("sortBy", options.sortBy);
5093
- if (options.sortOrder) params.append("sortOrder", options.sortOrder);
5094
- if (options.search) params.append("search", options.search);
5095
- return this.fetch(
5096
- `w/${wid}/milestones${params.toString() ? `?${params.toString()}` : ""}`
5097
- );
5098
- }
5099
- /** Get a single milestone by ID. */
5100
- async getMilestone(wid, id) {
5101
- return this.fetch(`w/${wid}/milestones/${id}`);
5102
- }
5103
- /** Create a new milestone in a workspace. */
5104
- async createMilestone(wid, milestone) {
5105
- return this.fetch(`w/${wid}/milestones`, {
5164
+ // src/api/activity-timeline.ts
5165
+ var ActivityTimelineApi = class extends BaseApiClient {
5166
+ /** One page of activity. Omit `cursor` for a fresh snapshot. */
5167
+ async queryActivityTimeline(wid, request = {}) {
5168
+ return this.fetch(`w/${wid}/activity-timeline/query`, {
5106
5169
  method: "POST",
5107
- body: JSON.stringify(milestone)
5108
- });
5109
- }
5110
- /** Update an existing milestone with partial data. */
5111
- async updateMilestone(wid, id, milestone) {
5112
- return this.fetch(`w/${wid}/milestones/${id}`, {
5113
- method: "PUT",
5114
- body: JSON.stringify(milestone)
5115
- });
5116
- }
5117
- /** Delete a milestone by ID. */
5118
- async deleteMilestone(wid, id) {
5119
- return this.fetch(`w/${wid}/milestones/${id}`, {
5120
- method: "DELETE"
5170
+ body: JSON.stringify(request)
5121
5171
  });
5122
5172
  }
5123
5173
  };
@@ -5307,6 +5357,23 @@ var MondayIntegrationApi = class extends BaseApiClient {
5307
5357
  }
5308
5358
  };
5309
5359
 
5360
+ // src/api/intervention-requests.ts
5361
+ var InterventionRequestsApi = class extends BaseApiClient {
5362
+ /** List intervention requests in a workspace, newest first. */
5363
+ async getInterventionRequests(wid, params = {}) {
5364
+ const query = new URLSearchParams();
5365
+ if (params.kind) query.set("kind", params.kind);
5366
+ if (params.openOnly) query.set("openOnly", "true");
5367
+ if (params.chatId !== void 0) query.set("chatId", String(params.chatId));
5368
+ if (params.unroutedOnly) query.set("unroutedOnly", "true");
5369
+ if (params.limit !== void 0) query.set("limit", String(params.limit));
5370
+ const qs = query.toString();
5371
+ return this.fetch(
5372
+ `w/${wid}/intervention-requests${qs ? `?${qs}` : ""}`
5373
+ );
5374
+ }
5375
+ };
5376
+
5310
5377
  // src/api/notification-rules.ts
5311
5378
  var NotificationRulesApi = class extends BaseApiClient {
5312
5379
  /** List all notification rules in a workspace. */
@@ -5430,6 +5497,41 @@ var OrgApi = class extends BaseApiClient {
5430
5497
  async getCurrentOrgMember(orgIdOrUuid) {
5431
5498
  return this.fetch(`o/${orgIdOrUuid}/me`);
5432
5499
  }
5500
+ /**
5501
+ * Update the settings an org admin owns: name, slug and contact details.
5502
+ *
5503
+ * Deliberately NOT the admin organization update — `primary` and
5504
+ * `enforceCreditLimit` are superuser-only and are not fields on this
5505
+ * endpoint's request model at all.
5506
+ */
5507
+ async updateOrganizationSettings(orgIdOrUuid, data) {
5508
+ return this.fetch(`o/${orgIdOrUuid}`, {
5509
+ method: "PATCH",
5510
+ body: JSON.stringify(data)
5511
+ });
5512
+ }
5513
+ /**
5514
+ * Read this organization's SSO configuration.
5515
+ *
5516
+ * Org-scoped (`org:admin`), unlike the SSO fields on the superuser admin
5517
+ * organization update — an org admin owns their own identity provider.
5518
+ */
5519
+ async getOrgSsoConfig(orgIdOrUuid) {
5520
+ return this.fetch(`o/${orgIdOrUuid}/sso`);
5521
+ }
5522
+ /** Configure this organization's SSO. Requires `org:admin`. */
5523
+ async updateOrgSsoConfig(orgIdOrUuid, data) {
5524
+ return this.fetch(`o/${orgIdOrUuid}/sso`, {
5525
+ method: "PUT",
5526
+ body: JSON.stringify(data)
5527
+ });
5528
+ }
5529
+ /** Remove this organization's SSO configuration. Requires `org:admin`. */
5530
+ async deleteOrgSsoConfig(orgIdOrUuid) {
5531
+ return this.fetch(`o/${orgIdOrUuid}/sso`, {
5532
+ method: "DELETE"
5533
+ });
5534
+ }
5433
5535
  /**
5434
5536
  * Get the billing customer UUID for an organization.
5435
5537
  */
@@ -5550,6 +5652,22 @@ var OrgApi = class extends BaseApiClient {
5550
5652
  async getOrganizationWorkspace(orgIdOrUuid, workspaceUuid) {
5551
5653
  return this.fetch(`o/${orgIdOrUuid}/workspaces/${workspaceUuid}`);
5552
5654
  }
5655
+ /**
5656
+ * Workspace cards for the organization page: identity plus the GLB-side
5657
+ * counts. Any org member may call it — members get the workspaces they
5658
+ * belong to, org:read holders get all of them.
5659
+ */
5660
+ async getOrganizationWorkspaceSummaries(orgIdOrUuid) {
5661
+ return this.fetch(`o/${orgIdOrUuid}/workspaces/summary`);
5662
+ }
5663
+ /**
5664
+ * Workspace-schema aggregates for one card, plus the caller's own member
5665
+ * role. Separate from the list because it opens a session against the
5666
+ * workspace's own schema — each card fetches its own.
5667
+ */
5668
+ async getOrganizationWorkspaceStats(orgIdOrUuid, workspaceUuid) {
5669
+ return this.fetch(`o/${orgIdOrUuid}/workspaces/${workspaceUuid}/stats`);
5670
+ }
5553
5671
  /**
5554
5672
  * Create a workspace in an organization.
5555
5673
  */
@@ -6191,6 +6309,7 @@ var PhoneNumbersApi = class extends BaseApiClient {
6191
6309
  if (filters?.inbound !== void 0) params.set("inbound", String(filters.inbound));
6192
6310
  if (filters?.dateFrom) params.set("dateFrom", filters.dateFrom);
6193
6311
  if (filters?.dateTo) params.set("dateTo", filters.dateTo);
6312
+ if (filters?.callId !== void 0) params.set("callId", String(filters.callId));
6194
6313
  return this.fetch(`w/${wid}/calls?${params}`);
6195
6314
  }
6196
6315
  /** List paginated voicemails for a phone number. */
@@ -6480,6 +6599,67 @@ var PersonasApi = class extends BaseApiClient {
6480
6599
  }
6481
6600
  };
6482
6601
 
6602
+ // src/api/metrics.ts
6603
+ var MetricsApi = class extends BaseApiClient {
6604
+ /** List metric definitions in the workspace, paginated. */
6605
+ async listMetrics(wid, params) {
6606
+ const q = new URLSearchParams();
6607
+ if (params?.page !== void 0) q.set("page", String(params.page));
6608
+ if (params?.pageSize !== void 0) q.set("pageSize", String(params.pageSize));
6609
+ if (params?.includeArchived !== void 0)
6610
+ q.set("includeArchived", String(params.includeArchived));
6611
+ if (params?.source) q.set("source", params.source);
6612
+ const qs = q.toString() ? `?${q.toString()}` : "";
6613
+ return this.fetch(`w/${wid}/metrics${qs}`);
6614
+ }
6615
+ async getMetric(wid, id) {
6616
+ return this.fetch(`w/${wid}/metrics/${id}`);
6617
+ }
6618
+ async createMetric(wid, data) {
6619
+ return this.fetch(`w/${wid}/metrics`, {
6620
+ method: "POST",
6621
+ body: JSON.stringify(data)
6622
+ });
6623
+ }
6624
+ async updateMetric(wid, id, data) {
6625
+ return this.fetch(`w/${wid}/metrics/${id}`, {
6626
+ method: "PUT",
6627
+ body: JSON.stringify(data)
6628
+ });
6629
+ }
6630
+ /** Soft-archive a metric (observations retained). */
6631
+ async deleteMetric(wid, id) {
6632
+ return this.fetch(`w/${wid}/metrics/${id}`, { method: "DELETE" });
6633
+ }
6634
+ async listMetricObservations(wid, metricId, params) {
6635
+ const q = new URLSearchParams();
6636
+ q.set("start", params.start);
6637
+ q.set("end", params.end);
6638
+ if (params.page !== void 0) q.set("page", String(params.page));
6639
+ if (params.pageSize !== void 0) q.set("pageSize", String(params.pageSize));
6640
+ return this.fetch(
6641
+ `w/${wid}/metrics/${metricId}/observations?${q.toString()}`
6642
+ );
6643
+ }
6644
+ async getMetricSeries(wid, metricId, params) {
6645
+ const q = new URLSearchParams();
6646
+ q.set("start", params.start);
6647
+ q.set("end", params.end);
6648
+ if (params.bucket) q.set("bucket", params.bucket);
6649
+ if (params.aggregation) q.set("aggregation", params.aggregation);
6650
+ return this.fetch(
6651
+ `w/${wid}/metrics/${metricId}/series?${q.toString()}`
6652
+ );
6653
+ }
6654
+ /** On-demand compute of enabled chat-source metrics for one chat. */
6655
+ async computeChatMetrics(wid, data) {
6656
+ return this.fetch(`w/${wid}/metrics/compute-for-chat`, {
6657
+ method: "POST",
6658
+ body: JSON.stringify(data)
6659
+ });
6660
+ }
6661
+ };
6662
+
6483
6663
  // src/api/queries.ts
6484
6664
  var QueriesApi = class extends BaseApiClient {
6485
6665
  /** Queryable namespace: native fields, operators per type, DataType record fields. */
@@ -8086,6 +8266,8 @@ var JourneysApi = class extends BaseApiClient {
8086
8266
  qs.set("currentTaskId", String(params.currentTaskId));
8087
8267
  if (params?.runtimeFailureEdgeId !== void 0)
8088
8268
  qs.set("runtimeFailureEdgeId", String(params.runtimeFailureEdgeId));
8269
+ if (params?.memberJourneyId !== void 0)
8270
+ qs.set("memberJourneyId", String(params.memberJourneyId));
8089
8271
  const query = qs.toString();
8090
8272
  return this.fetch(
8091
8273
  `w/${wid}/journeys/${journeyId}/members${query ? `?${query}` : ""}`
@@ -8122,6 +8304,36 @@ var JourneysApi = class extends BaseApiClient {
8122
8304
  async getMemberJourneys(wid, memberId) {
8123
8305
  return this.fetch(`w/${wid}/journeys/by-member/${memberId}`);
8124
8306
  }
8307
+ /**
8308
+ * Status history for one enrollment — the per-member journey timeline.
8309
+ *
8310
+ * This is where a step that completed having emitted nothing shows up as
8311
+ * `zeroEmission: true` with its reason, instead of being indistinguishable
8312
+ * from a step that sent (GRA-7341). Newest first.
8313
+ *
8314
+ * PHI-safe: identifiers, closed status codes, operator-authored step names,
8315
+ * counts, and timestamps. `entry.reason` is populated only for rows the
8316
+ * server allowlists; every other row reports `reasonRedacted: true`.
8317
+ *
8318
+ * `zeroEmissionOnly` narrows the page to the dropped-send rows. Use it when
8319
+ * that is all you need: without it a busy enrollment can push every
8320
+ * zero-emission row off the first page, and a caller that renders only what
8321
+ * it loaded would report "nothing was dropped" — the exact failure this
8322
+ * endpoint exists to eliminate. `zeroEmissionCount` is unaffected by the
8323
+ * filter and always counts the whole enrollment.
8324
+ */
8325
+ async getEnrollmentStatusLog(wid, journeyId, memberJourneyId, params = {}) {
8326
+ const qs = new URLSearchParams();
8327
+ if (params.page !== void 0) qs.set("page", String(params.page));
8328
+ if (params.pageSize !== void 0) qs.set("pageSize", String(params.pageSize));
8329
+ if (params.zeroEmissionOnly !== void 0) {
8330
+ qs.set("zeroEmissionOnly", String(params.zeroEmissionOnly));
8331
+ }
8332
+ const query = qs.toString();
8333
+ return this.fetch(
8334
+ `w/${wid}/journeys/${journeyId}/enrollments/${memberJourneyId}/status-log` + (query ? `?${query}` : "")
8335
+ );
8336
+ }
8125
8337
  /** List members currently or historically associated with one journey step. */
8126
8338
  async getStepMembers(wid, journeyId, stepUuid, params = {}) {
8127
8339
  const qs = new URLSearchParams();
@@ -8706,6 +8918,12 @@ var MemberImportPreviewRowAction = {
8706
8918
  error: "error"
8707
8919
  };
8708
8920
 
8921
+ // src/types/generated/member_role.ts
8922
+ var MergeMemberRolesRequestAccessStrategy = {
8923
+ union: "union",
8924
+ target_only: "target_only"
8925
+ };
8926
+
8709
8927
  // src/types/member-types.ts
8710
8928
  var MemberType = /* @__PURE__ */ ((MemberType2) => {
8711
8929
  MemberType2["ANONYMOUS"] = "anonymous";
@@ -8714,6 +8932,37 @@ var MemberType = /* @__PURE__ */ ((MemberType2) => {
8714
8932
  MemberType2["AGENT"] = "agent";
8715
8933
  return MemberType2;
8716
8934
  })(MemberType || {});
8935
+ function structuredErrorDetail(error) {
8936
+ if (!error || typeof error !== "object") return null;
8937
+ const detail = error.errorData;
8938
+ if (!detail || typeof detail !== "object") return null;
8939
+ return detail;
8940
+ }
8941
+ function isMemberContactConflict(error) {
8942
+ const d = structuredErrorDetail(error);
8943
+ if (!d || d.code !== "MEMBER_CONTACT_CONFLICT") return null;
8944
+ if (d.conflictingMemberId !== null && typeof d.conflictingMemberId !== "number") {
8945
+ return null;
8946
+ }
8947
+ return d;
8948
+ }
8949
+ function isAccountContactConflict(error) {
8950
+ const d = structuredErrorDetail(error);
8951
+ if (!d || d.code !== "ACCOUNT_CONTACT_CONFLICT") return null;
8952
+ return d;
8953
+ }
8954
+ function archivedMemberConflictId(error) {
8955
+ const d = structuredErrorDetail(error);
8956
+ if (!d || d.code !== "ARCHIVED_MEMBER_CONFLICT") return null;
8957
+ return typeof d.archivedMemberId === "number" ? d.archivedMemberId : null;
8958
+ }
8959
+ function isIdentifiedMemberContactConflict(conflict) {
8960
+ return !!conflict && conflict.conflictingMemberId !== null;
8961
+ }
8962
+ function asIdentifiedMemberContactConflict(error) {
8963
+ const conflict = isMemberContactConflict(error);
8964
+ return isIdentifiedMemberContactConflict(conflict) ? conflict : null;
8965
+ }
8717
8966
 
8718
8967
  // src/types/mcp-server-types.ts
8719
8968
  var McpServerState = /* @__PURE__ */ ((McpServerState2) => {
@@ -8823,18 +9072,20 @@ var MASKED_SECRET_SENTINEL = "__SECRET_SET__";
8823
9072
  // src/types/billing-types.ts
8824
9073
  var WorkspaceFeature = /* @__PURE__ */ ((WorkspaceFeature2) => {
8825
9074
  WorkspaceFeature2["PHONE"] = "phone";
9075
+ WorkspaceFeature2["A2P_REGISTRATION"] = "a2p_registration";
8826
9076
  WorkspaceFeature2["EMAIL"] = "email";
8827
9077
  WorkspaceFeature2["WHATSAPP"] = "whatsapp";
8828
9078
  WorkspaceFeature2["DISCORD"] = "discord";
8829
9079
  WorkspaceFeature2["SLACK"] = "slack";
8830
9080
  WorkspaceFeature2["TEAMS"] = "teams";
8831
9081
  WorkspaceFeature2["SITES"] = "sites";
8832
- WorkspaceFeature2["FORMS"] = "forms";
8833
9082
  WorkspaceFeature2["MAPS"] = "maps";
8834
9083
  WorkspaceFeature2["BROWSER"] = "browser";
8835
9084
  WorkspaceFeature2["WEB_SEARCH"] = "web_search";
8836
9085
  WorkspaceFeature2["CALENDAR"] = "calendar";
8837
9086
  WorkspaceFeature2["EXPERIMENTS"] = "experiments";
9087
+ WorkspaceFeature2["MAILBOX_USER_INPUT"] = "mailbox_user_input";
9088
+ WorkspaceFeature2["FORKED_TRAJECTORIES"] = "forked_trajectories";
8838
9089
  WorkspaceFeature2["GMAIL"] = "gmail";
8839
9090
  WorkspaceFeature2["GCALENDAR"] = "gcalendar";
8840
9091
  WorkspaceFeature2["GDRIVE"] = "gdrive";
@@ -8851,6 +9102,9 @@ var WorkspaceFeature = /* @__PURE__ */ ((WorkspaceFeature2) => {
8851
9102
  WorkspaceFeature2["CONFLUENCE"] = "confluence";
8852
9103
  WorkspaceFeature2["AGENT_MEMORY"] = "agent_memory";
8853
9104
  WorkspaceFeature2["IMAGE_GENERATION"] = "image_generation";
9105
+ WorkspaceFeature2["STRICT_NATIVE_VOICE"] = "strict_native_voice";
9106
+ WorkspaceFeature2["CHARLESTON_NEPHROLOGY_PMD_PAGING"] = "charleston_nephrology_pmd_paging";
9107
+ WorkspaceFeature2["PATIENTSYNC_TRANSFER"] = "patientsync_transfer";
8854
9108
  return WorkspaceFeature2;
8855
9109
  })(WorkspaceFeature || {});
8856
9110
  var MemberFeature = /* @__PURE__ */ ((MemberFeature2) => {
@@ -9011,8 +9265,9 @@ var REALTIME_MODEL_GEMINI_VERTEX = "google:vertex:gemini-3.1-flash-live";
9011
9265
  var REALTIME_MODEL_NOVA_SONIC = "aws:bedrock:nova-sonic-1";
9012
9266
  var REALTIME_MODEL_CUSTOM = "custom:realtime:composable";
9013
9267
  var STT_MODEL_DEEPGRAM_FLUX = "deepgram:stt:flux-general-en";
9268
+ var STT_MODEL_DEEPGRAM_FLUX_SELFHOST = "deepgram:stt:flux-general-en:selfhost";
9014
9269
  var STT_MODEL_DEEPGRAM_FLUX_MULTI = "deepgram:stt:flux-general-multi";
9015
- var STT_MODEL_ELEVENLABS_SCRIBE = "elevenlabs:stt:scribe_v2_realtime";
9270
+ var STT_MODEL_DEEPGRAM_FLUX_MULTI_SELFHOST = "deepgram:stt:flux-general-multi:selfhost";
9016
9271
  var TTS_MODEL_ELEVENLABS_FLASH = "elevenlabs:tts:eleven_flash_v2_5";
9017
9272
  var TTS_MODEL_ELEVENLABS_TURBO = "elevenlabs:tts:eleven_turbo_v2_5";
9018
9273
  var TTS_MODEL_ELEVENLABS_MULTILINGUAL = "elevenlabs:tts:eleven_multilingual_v2";
@@ -9756,11 +10011,12 @@ function createApiModules(apiKey, baseUrl, customFetch) {
9756
10011
  connectionSync: new ConnectionSyncApi(apiKey, baseUrl, customFetch),
9757
10012
  mcpServers: new McpServersApi(apiKey, baseUrl, customFetch),
9758
10013
  members: new MembersApi(apiKey, baseUrl, customFetch),
9759
- milestones: new MilestonesApi(apiKey, baseUrl, customFetch),
10014
+ activityTimeline: new ActivityTimelineApi(apiKey, baseUrl, customFetch),
9760
10015
  motd: new MotdApi(apiKey, baseUrl, customFetch),
9761
10016
  trackedLinks: new TrackedLinksApi(apiKey, baseUrl, customFetch),
9762
10017
  confluence: new ConfluenceApi(apiKey, baseUrl, customFetch),
9763
10018
  mondayIntegration: new MondayIntegrationApi(apiKey, baseUrl, customFetch),
10019
+ interventionRequests: new InterventionRequestsApi(apiKey, baseUrl, customFetch),
9764
10020
  notificationRules: new NotificationRulesApi(apiKey, baseUrl, customFetch),
9765
10021
  oauth: new OAuthApi(apiKey, baseUrl, customFetch),
9766
10022
  operatorGroups: new OperatorApi(apiKey, baseUrl, customFetch),
@@ -9770,6 +10026,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
9770
10026
  pronunciations: new PronunciationsApi(apiKey, baseUrl, customFetch),
9771
10027
  qualifications: new QualificationsApi(apiKey, baseUrl, customFetch),
9772
10028
  personas: new PersonasApi(apiKey, baseUrl, customFetch),
10029
+ metrics: new MetricsApi(apiKey, baseUrl, customFetch),
9773
10030
  queries: new QueriesApi(apiKey, baseUrl, customFetch),
9774
10031
  reports: new ReportsApi(apiKey, baseUrl, customFetch),
9775
10032
  salesforce: new SalesforceApi(apiKey, baseUrl, customFetch),
@@ -9883,7 +10140,6 @@ var WORKSPACE_METHOD_NAMES = [
9883
10140
  "createMemberMemory",
9884
10141
  "createMemberRole",
9885
10142
  "createMenuItem",
9886
- "createMilestone",
9887
10143
  "createNotificationRule",
9888
10144
  "createOperatorGroup",
9889
10145
  "createPage",
@@ -9950,7 +10206,6 @@ var WORKSPACE_METHOD_NAMES = [
9950
10206
  "deleteMemberMemory",
9951
10207
  "deleteMemberRole",
9952
10208
  "deleteMenuItem",
9953
- "deleteMilestone",
9954
10209
  "deleteMondayConnection",
9955
10210
  "deleteNotificationRule",
9956
10211
  "deleteOperatorGroup",
@@ -10101,6 +10356,7 @@ var WORKSPACE_METHOD_NAMES = [
10101
10356
  "getChatsNeedsResponse",
10102
10357
  "getChildThreadMessages",
10103
10358
  "getClientWorkspace",
10359
+ "getConfigurationHealth",
10104
10360
  "getConfluenceStatus",
10105
10361
  "getConnectionSyncCapabilities",
10106
10362
  "getConnectionSyncCheckpoint",
@@ -10133,6 +10389,7 @@ var WORKSPACE_METHOD_NAMES = [
10133
10389
  "getDocumoFaxSetup",
10134
10390
  "listDocumoFaxes",
10135
10391
  "getDocumoFaxStatus",
10392
+ "getEnrollmentStatusLog",
10136
10393
  "getEventRule",
10137
10394
  "getEventRules",
10138
10395
  "getExperiment",
@@ -10160,6 +10417,7 @@ var WORKSPACE_METHOD_NAMES = [
10160
10417
  "listChatRecordings",
10161
10418
  "previewQuery",
10162
10419
  "publishSiteSource",
10420
+ "queryActivityTimeline",
10163
10421
  "registerDiscordSlashCommands",
10164
10422
  "reopenWorkspaceSupportRequest",
10165
10423
  "resetSiteSource",
@@ -10227,6 +10485,7 @@ var WORKSPACE_METHOD_NAMES = [
10227
10485
  "getMemberMemory",
10228
10486
  "getMemberRecordCounts",
10229
10487
  "getMemberRole",
10488
+ "getMemberRoleCleanupPlan",
10230
10489
  "getMemberRoleByUuid",
10231
10490
  "getMemberRoles",
10232
10491
  "getMemberSyncLinks",
@@ -10235,8 +10494,6 @@ var WORKSPACE_METHOD_NAMES = [
10235
10494
  "getMembersMessageActivity",
10236
10495
  "getMenuItems",
10237
10496
  "getMessageTiming",
10238
- "getMilestone",
10239
- "getMilestones",
10240
10497
  "getMondayConnectionBoardColumns",
10241
10498
  "getMondayConnectionBoardGroups",
10242
10499
  "getMondayConnectionBoards",
@@ -10278,6 +10535,7 @@ var WORKSPACE_METHOD_NAMES = [
10278
10535
  "getRecordingInfo",
10279
10536
  "getResellerWorkspaces",
10280
10537
  "getRoutine",
10538
+ "getRoutineConfigEvents",
10281
10539
  "getRoutineRuns",
10282
10540
  "getRoutines",
10283
10541
  "getRuleExecutions",
@@ -10399,6 +10657,14 @@ var WORKSPACE_METHOD_NAMES = [
10399
10657
  "listHealthiePatients",
10400
10658
  "listHealthieProviders",
10401
10659
  "listPersonas",
10660
+ "listMetrics",
10661
+ "getMetric",
10662
+ "createMetric",
10663
+ "updateMetric",
10664
+ "deleteMetric",
10665
+ "listMetricObservations",
10666
+ "getMetricSeries",
10667
+ "computeChatMetrics",
10402
10668
  "listPushSubscriptions",
10403
10669
  "listSalesforceObjects",
10404
10670
  "listScenarios",
@@ -10409,6 +10675,7 @@ var WORKSPACE_METHOD_NAMES = [
10409
10675
  "markEmailAsRead",
10410
10676
  "markEmailAsUnread",
10411
10677
  "markNotificationAsRead",
10678
+ "mergeMemberRoles",
10412
10679
  "previewImportMembers",
10413
10680
  "previewImportWorkspace",
10414
10681
  "previewRoutineWorkflowAccess",
@@ -10537,7 +10804,6 @@ var WORKSPACE_METHOD_NAMES = [
10537
10804
  "updateMemberLabel",
10538
10805
  "updateMemberRole",
10539
10806
  "updateMenuItem",
10540
- "updateMilestone",
10541
10807
  "updateMondaySyncConfig",
10542
10808
  "updateNotificationRule",
10543
10809
  "updateOperatorGroup",
@@ -10722,6 +10988,12 @@ function bindDashboardsMethods(target, dashboards) {
10722
10988
  target.deleteDashboard = dashboards.deleteDashboard.bind(dashboards);
10723
10989
  target.getDashboardChannelStats = dashboards.getDashboardChannelStats.bind(dashboards);
10724
10990
  target.getDashboardWorkflowAssignmentStats = dashboards.getDashboardWorkflowAssignmentStats.bind(dashboards);
10991
+ target.getConfigurationHealth = dashboards.getConfigurationHealth.bind(dashboards);
10992
+ }
10993
+
10994
+ // src/client/bindings/activity-timeline.ts
10995
+ function bindActivityTimelineMethods(target, activityTimeline) {
10996
+ target.queryActivityTimeline = activityTimeline.queryActivityTimeline.bind(activityTimeline);
10725
10997
  }
10726
10998
 
10727
10999
  // src/client/bindings/motd.ts
@@ -11142,7 +11414,7 @@ function bindWorkflowsMethods(target, workflows, workflowNotes, voice, superviso
11142
11414
  }
11143
11415
 
11144
11416
  // src/client/bindings/calendars.ts
11145
- function bindCalendarsMethods(target, calendars, milestones) {
11417
+ function bindCalendarsMethods(target, calendars) {
11146
11418
  target.getCalendars = calendars.getCalendars.bind(calendars);
11147
11419
  target.getCalendar = calendars.getCalendar.bind(calendars);
11148
11420
  target.createCalendar = calendars.createCalendar.bind(calendars);
@@ -11174,11 +11446,6 @@ function bindCalendarsMethods(target, calendars, milestones) {
11174
11446
  target.linkCalendarToGoogle = calendars.linkCalendarToGoogle.bind(calendars);
11175
11447
  target.unlinkCalendarFromGoogle = calendars.unlinkCalendarFromGoogle.bind(calendars);
11176
11448
  target.syncCalendarWithGoogle = calendars.syncCalendarWithGoogle.bind(calendars);
11177
- target.getMilestones = milestones.getMilestones.bind(milestones);
11178
- target.getMilestone = milestones.getMilestone.bind(milestones);
11179
- target.createMilestone = milestones.createMilestone.bind(milestones);
11180
- target.updateMilestone = milestones.updateMilestone.bind(milestones);
11181
- target.deleteMilestone = milestones.deleteMilestone.bind(milestones);
11182
11449
  }
11183
11450
 
11184
11451
  // src/client/bindings/communications.ts
@@ -11535,6 +11802,11 @@ function bindOrgMethods(target, org) {
11535
11802
  target.updateBusinessProfile = org.updateBusinessProfile.bind(org);
11536
11803
  target.submitBusinessProfile = org.submitBusinessProfile.bind(org);
11537
11804
  target.cancelBusinessProfile = org.cancelBusinessProfile.bind(org);
11805
+ target.listLegalEntities = org.listLegalEntities.bind(org);
11806
+ target.getLegalEntity = org.getLegalEntity.bind(org);
11807
+ target.createLegalEntity = org.createLegalEntity.bind(org);
11808
+ target.getVoiceTrustProducts = org.getVoiceTrustProducts.bind(org);
11809
+ target.syncVoiceTrustProducts = org.syncVoiceTrustProducts.bind(org);
11538
11810
  target.createOrganizationWorkspace = org.createOrganizationWorkspace.bind(org);
11539
11811
  target.getOrgBillingCustomer = org.getOrgBillingCustomer.bind(org);
11540
11812
  }
@@ -11581,6 +11853,7 @@ function bindJourneysMethods(target, journeys) {
11581
11853
  target.reenrollMember = journeys.reenrollMember.bind(journeys);
11582
11854
  target.deleteEnrollment = journeys.deleteEnrollment.bind(journeys);
11583
11855
  target.getMemberJourneys = journeys.getMemberJourneys.bind(journeys);
11856
+ target.getEnrollmentStatusLog = journeys.getEnrollmentStatusLog.bind(journeys);
11584
11857
  target.getStepMembers = journeys.getStepMembers.bind(journeys);
11585
11858
  target.getStepMemberCounts = journeys.getStepMemberCounts.bind(journeys);
11586
11859
  target.advanceStep = journeys.advanceStep.bind(journeys);
@@ -11618,6 +11891,18 @@ function bindPersonasMethods(target, personas) {
11618
11891
  target.deletePersona = personas.deletePersona.bind(personas);
11619
11892
  }
11620
11893
 
11894
+ // src/client/bindings/metrics.ts
11895
+ function bindMetricsMethods(target, metrics) {
11896
+ target.listMetrics = metrics.listMetrics.bind(metrics);
11897
+ target.getMetric = metrics.getMetric.bind(metrics);
11898
+ target.createMetric = metrics.createMetric.bind(metrics);
11899
+ target.updateMetric = metrics.updateMetric.bind(metrics);
11900
+ target.deleteMetric = metrics.deleteMetric.bind(metrics);
11901
+ target.listMetricObservations = metrics.listMetricObservations.bind(metrics);
11902
+ target.getMetricSeries = metrics.getMetricSeries.bind(metrics);
11903
+ target.computeChatMetrics = metrics.computeChatMetrics.bind(metrics);
11904
+ }
11905
+
11621
11906
  // src/client/bindings/queries.ts
11622
11907
  function bindQueriesMethods(target, queries) {
11623
11908
  target.getQueryFields = queries.getQueryFields.bind(queries);
@@ -11826,6 +12111,8 @@ var GravityRailClient = class {
11826
12111
  createMemberRole;
11827
12112
  updateMemberRole;
11828
12113
  deleteMemberRole;
12114
+ getMemberRoleCleanupPlan;
12115
+ mergeMemberRoles;
11829
12116
  // Member Fields
11830
12117
  getMemberFields;
11831
12118
  getMemberFieldDefinitions;
@@ -11886,6 +12173,15 @@ var GravityRailClient = class {
11886
12173
  createPersona;
11887
12174
  updatePersona;
11888
12175
  deletePersona;
12176
+ // Metrics API (customer-defined outcome metrics)
12177
+ listMetrics;
12178
+ getMetric;
12179
+ createMetric;
12180
+ updateMetric;
12181
+ deleteMetric;
12182
+ listMetricObservations;
12183
+ getMetricSeries;
12184
+ computeChatMetrics;
11889
12185
  // Dashboards API
11890
12186
  getDashboards;
11891
12187
  getDashboard;
@@ -11894,6 +12190,9 @@ var GravityRailClient = class {
11894
12190
  deleteDashboard;
11895
12191
  getDashboardChannelStats;
11896
12192
  getDashboardWorkflowAssignmentStats;
12193
+ getConfigurationHealth;
12194
+ // Activity Timeline API
12195
+ queryActivityTimeline;
11897
12196
  // MOTD API
11898
12197
  getMotd;
11899
12198
  // Tracked Links analytics (#10934)
@@ -11929,6 +12228,7 @@ var GravityRailClient = class {
11929
12228
  reenrollMember;
11930
12229
  deleteEnrollment;
11931
12230
  getMemberJourneys;
12231
+ getEnrollmentStatusLog;
11932
12232
  getStepMembers;
11933
12233
  getStepMemberCounts;
11934
12234
  advanceStep;
@@ -12047,6 +12347,11 @@ var GravityRailClient = class {
12047
12347
  updateBusinessProfile;
12048
12348
  submitBusinessProfile;
12049
12349
  cancelBusinessProfile;
12350
+ listLegalEntities;
12351
+ getLegalEntity;
12352
+ createLegalEntity;
12353
+ getVoiceTrustProducts;
12354
+ syncVoiceTrustProducts;
12050
12355
  createOrganizationWorkspace;
12051
12356
  getOrgBillingCustomer;
12052
12357
  getVapidPublicKey;
@@ -12225,6 +12530,7 @@ var GravityRailClient = class {
12225
12530
  updateRoutine;
12226
12531
  deleteRoutine;
12227
12532
  runRoutine;
12533
+ getRoutineConfigEvents;
12228
12534
  getRoutineRuns;
12229
12535
  resetRoutineRuns;
12230
12536
  previewSchedule;
@@ -12308,11 +12614,6 @@ var GravityRailClient = class {
12308
12614
  linkCalendarToGoogle;
12309
12615
  unlinkCalendarFromGoogle;
12310
12616
  syncCalendarWithGoogle;
12311
- getMilestones;
12312
- getMilestone;
12313
- createMilestone;
12314
- updateMilestone;
12315
- deleteMilestone;
12316
12617
  // Communications API
12317
12618
  getPhoneNumbers;
12318
12619
  getAvailablePhoneNumbers;
@@ -12692,8 +12993,10 @@ var GravityRailClient = class {
12692
12993
  bindAgentsMethods(this, apis.agents);
12693
12994
  bindQualificationsMethods(this, apis.qualifications);
12694
12995
  bindPersonasMethods(this, apis.personas);
12996
+ bindMetricsMethods(this, apis.metrics);
12695
12997
  bindQueriesMethods(this, apis.queries);
12696
12998
  bindDashboardsMethods(this, apis.dashboards);
12999
+ bindActivityTimelineMethods(this, apis.activityTimeline);
12697
13000
  bindMotdMethods(this, apis.motd);
12698
13001
  bindTrackedLinksMethods(this, apis.trackedLinks);
12699
13002
  bindJourneysMethods(this, apis.journeys);
@@ -12708,7 +13011,7 @@ var GravityRailClient = class {
12708
13011
  bindFilesMethods(this, apis.files);
12709
13012
  bindEventsMethods(this, apis.events);
12710
13013
  bindWorkflowsMethods(this, apis.workflows, apis.workflowNotes, apis.voice, apis.supervisors);
12711
- bindCalendarsMethods(this, apis.calendars, apis.milestones);
13014
+ bindCalendarsMethods(this, apis.calendars);
12712
13015
  bindCommunicationsMethods(this, apis.phoneNumbers, apis.inboxes, apis.notificationRules);
12713
13016
  bindToolkitsMethods(
12714
13017
  this,
@@ -13663,6 +13966,16 @@ var TaskBuilder = class extends WorkspaceBuilderResource {
13663
13966
  description;
13664
13967
  transitions = [];
13665
13968
  eventRules = [];
13969
+ /** Child task ids the server already has, recorded when this task is adopted. */
13970
+ existingChildIds = /* @__PURE__ */ new Set();
13971
+ /** Record the edges an adopted task already carries, so a re-run adds only what is missing. */
13972
+ adopt(existing) {
13973
+ super.adopt(existing);
13974
+ for (const child of existing.childTasks ?? []) {
13975
+ const id = child.taskId ?? child.id;
13976
+ if (typeof id === "number") this.existingChildIds.add(id);
13977
+ }
13978
+ }
13666
13979
  transitionsTo(child, when, autoNext = false, required = false, celCondition) {
13667
13980
  if (child === this) {
13668
13981
  throw new Error(`Task '${this.name}' cannot transition to itself`);
@@ -13973,7 +14286,53 @@ ${"=".repeat(50)}`);
13973
14286
  writeLine("\n Journey warnings:");
13974
14287
  for (const problem of problems) writeLine(` ! ${problem}`);
13975
14288
  }
14289
+ /**
14290
+ * Problems that make the plan unwritable, found before the first write.
14291
+ *
14292
+ * The API validates each CEL when you save it, and its diagnosis is right —
14293
+ * but it fires per-write, so a plan whose edges reference a non-collection
14294
+ * form gets four labels, two forms, a workflow and six tasks created before
14295
+ * the seventh call rejects it. The operator is left with a half-built
14296
+ * program to hand-repair. Checking here costs nothing and writes nothing.
14297
+ *
14298
+ * Deliberately narrow: only cross-resource facts the builder can see with
14299
+ * certainty. Per-field CEL schema checking stays server-side, where the
14300
+ * real validator lives — duplicating it here would drift.
14301
+ */
14302
+ preflight() {
14303
+ const problems = [];
14304
+ const forms = this.resources.filter(
14305
+ (resource) => resource instanceof FormBuilder
14306
+ );
14307
+ const collectionBySlug = new Map(forms.map((form) => [form.slug, form.collection]));
14308
+ const reference = /assignment\.collections\.([A-Za-z0-9_]+)/g;
14309
+ for (const resource of this.sortedResources()) {
14310
+ if (!(resource instanceof TaskBuilder)) continue;
14311
+ for (const transition of resource.transitions) {
14312
+ const cel = transition.celCondition;
14313
+ if (!cel) continue;
14314
+ for (const [, slug] of cel.matchAll(reference)) {
14315
+ if (!collectionBySlug.has(slug)) continue;
14316
+ if (!collectionBySlug.get(slug)) {
14317
+ problems.push(
14318
+ `task '${transition.parent.name}' \u2192 '${transition.child.name}': CEL reads assignment.collections.${slug}, but this plan creates '${slug}' as a non-collection form. Declare it with { collection: true }.`
14319
+ );
14320
+ }
14321
+ }
14322
+ }
14323
+ }
14324
+ return [...new Set(problems)];
14325
+ }
13976
14326
  async apply() {
14327
+ const problems = this.preflight();
14328
+ if (problems.length) {
14329
+ writeLine("\nPlan rejected \u2014 nothing was created:");
14330
+ for (const problem of problems) writeLine(` ! ${problem}`);
14331
+ throw new Error(
14332
+ `Plan has ${problems.length} problem(s) and was not applied:
14333
+ ` + problems.map((problem) => ` - ${problem}`).join("\n")
14334
+ );
14335
+ }
13977
14336
  const resources = this.sortedResources();
13978
14337
  await this.resolveExisting(resources);
13979
14338
  const summary = {};
@@ -14160,6 +14519,7 @@ Done! Created ${count} resources.`);
14160
14519
  const childTasks = transitions.flatMap((transition) => {
14161
14520
  const taskId = transition.child._id;
14162
14521
  if (taskId === void 0 || taskId === parent._id) return [];
14522
+ if (parent.existingChildIds.has(taskId)) return [];
14163
14523
  return [
14164
14524
  {
14165
14525
  taskId,
@@ -14682,7 +15042,9 @@ var AbilityConfigIssueCode = {
14682
15042
  invalid_state: "invalid_state",
14683
15043
  feature_disabled: "feature_disabled",
14684
15044
  missing_connection: "missing_connection",
14685
- external_drift: "external_drift"
15045
+ external_drift: "external_drift",
15046
+ missing_task_instructions: "missing_task_instructions",
15047
+ no_qualification_scenarios: "no_qualification_scenarios"
14686
15048
  };
14687
15049
  var AbilityConfigIssueSeverity = {
14688
15050
  warning: "warning",
@@ -14695,6 +15057,12 @@ var WorkflowAccessWarningResourceType = {
14695
15057
  calendar: "calendar"
14696
15058
  };
14697
15059
 
15060
+ // src/types/generated/workflow.ts
15061
+ var WorkflowRoutingMode = {
15062
+ open_world: "open_world",
15063
+ strict: "strict"
15064
+ };
15065
+
14698
15066
  // src/types/widget-domain-types.ts
14699
15067
  var WIDGET_SLUGS = ["chat", "operator", "operator-tools", "chat-app"];
14700
15068
 
@@ -15117,7 +15485,10 @@ var SCOPES = {
15117
15485
  "workflows:read": {
15118
15486
  name: "workflows:read",
15119
15487
  category: "workflows" /* WORKFLOWS */,
15120
- description: "View workflow definitions"
15488
+ // Object access is separate: listing and opening a specific workflow
15489
+ // additionally require ownership, workflows:admin, a workflow role
15490
+ // association, or an access grant (WorkflowAction.USE).
15491
+ description: "Access the Workflows area and view workflows shared with you"
15121
15492
  },
15122
15493
  "workflows:write": {
15123
15494
  name: "workflows:write",
@@ -15697,6 +16068,7 @@ function getRevisionState(workflow, revision) {
15697
16068
  MemberType,
15698
16069
  MenuItemResponseItemType,
15699
16070
  MenuItemType,
16071
+ MergeMemberRolesRequestAccessStrategy,
15700
16072
  ModelProvider,
15701
16073
  ModelType,
15702
16074
  NO_ASSISTANT_PARTICIPANT_CHAT_TYPES,
@@ -15739,7 +16111,8 @@ function getRevisionState(workflow, revision) {
15739
16111
  SMS_DELIVERY_FAILURE_STATUSES,
15740
16112
  STT_MODEL_DEEPGRAM_FLUX,
15741
16113
  STT_MODEL_DEEPGRAM_FLUX_MULTI,
15742
- STT_MODEL_ELEVENLABS_SCRIBE,
16114
+ STT_MODEL_DEEPGRAM_FLUX_MULTI_SELFHOST,
16115
+ STT_MODEL_DEEPGRAM_FLUX_SELFHOST,
15743
16116
  Scope,
15744
16117
  ScopeCategory,
15745
16118
  ScopeManager,
@@ -15760,11 +16133,14 @@ function getRevisionState(workflow, revision) {
15760
16133
  WorkflowAccessWarningResourceType,
15761
16134
  WorkflowBuilder,
15762
16135
  WorkflowResourceType,
16136
+ WorkflowRoutingMode,
15763
16137
  WorkspaceBuilder,
15764
16138
  WorkspaceBuilderResource,
15765
16139
  WorkspaceFeature,
15766
16140
  WorkspaceProvisionStatus,
16141
+ archivedMemberConflictId,
15767
16142
  areDependenciesSatisfied,
16143
+ asIdentifiedMemberContactConflict,
15768
16144
  canPreviewVoice,
15769
16145
  clearRegistry,
15770
16146
  createWorkspaceClient,
@@ -15788,9 +16164,12 @@ function getRevisionState(workflow, revision) {
15788
16164
  getTTSProvider,
15789
16165
  getVoiceModelId,
15790
16166
  initializeFeatures,
16167
+ isAccountContactConflict,
15791
16168
  isAgentNoteOrigin,
15792
16169
  isChatType,
15793
16170
  isFeatureAvailable,
16171
+ isIdentifiedMemberContactConflict,
16172
+ isMemberContactConflict,
15794
16173
  isPositiveRating,
15795
16174
  isRegistryInitialized,
15796
16175
  isSMSDeliveryFailureStatus,