@gravity-rail/sdk 0.7.4 → 0.10.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.
Files changed (43) hide show
  1. package/README.md +38 -0
  2. package/dist/{chunk-ANY7WLOD.js → chunk-2BJG4GYM.js} +778 -545
  3. package/dist/chunk-2BJG4GYM.js.map +1 -0
  4. package/dist/chunk-FSSXKQR5.js +471 -0
  5. package/dist/chunk-FSSXKQR5.js.map +1 -0
  6. package/dist/{chunk-QS6ZRQUZ.js → chunk-TJT7A4CO.js} +8 -1
  7. package/dist/{chunk-QS6ZRQUZ.js.map → chunk-TJT7A4CO.js.map} +1 -1
  8. package/dist/{client-B_cweJhP.d.cts → client-BffM3KcA.d.cts} +1367 -344
  9. package/dist/{client-C-on7whi.d.ts → client-DfjAYbt8.d.ts} +1367 -344
  10. package/dist/helpers.cjs +178 -2
  11. package/dist/helpers.cjs.map +1 -1
  12. package/dist/helpers.d.cts +82 -3
  13. package/dist/helpers.d.ts +82 -3
  14. package/dist/helpers.js +156 -1
  15. package/dist/helpers.js.map +1 -1
  16. package/dist/index.cjs +992 -174
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +14 -8
  19. package/dist/index.d.ts +14 -8
  20. package/dist/index.js +144 -20
  21. package/dist/index.js.map +1 -1
  22. package/dist/{inquiries-BX3PuU-7.d.cts → inquiries-UcWNYo-Q.d.cts} +567 -79
  23. package/dist/{inquiries-BX3PuU-7.d.ts → inquiries-UcWNYo-Q.d.ts} +567 -79
  24. package/dist/internal.cjs +925 -161
  25. package/dist/internal.cjs.map +1 -1
  26. package/dist/internal.d.cts +241 -5
  27. package/dist/internal.d.ts +241 -5
  28. package/dist/internal.js +71 -7
  29. package/dist/internal.js.map +1 -1
  30. package/dist/realtime.cjs +1 -0
  31. package/dist/realtime.cjs.map +1 -1
  32. package/dist/realtime.js +1 -0
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/schemas.cjs +40 -7
  35. package/dist/schemas.cjs.map +1 -1
  36. package/dist/schemas.d.cts +134 -51
  37. package/dist/schemas.d.ts +134 -51
  38. package/dist/schemas.js +40 -8
  39. package/dist/schemas.js.map +1 -1
  40. package/dist/{scopes-ColqadkM.d.ts → scopes-CjSvITpL.d.cts} +53 -8
  41. package/dist/{scopes-CNbQi30F.d.cts → scopes-CmNKWrzb.d.ts} +53 -8
  42. package/package.json +6 -6
  43. package/dist/chunk-ANY7WLOD.js.map +0 -1
@@ -1,464 +1,56 @@
1
- // src/api/base.ts
2
- function getCookieValue(name) {
3
- if (typeof document === "undefined") return void 0;
4
- const cookies = document.cookie.split(";");
5
- for (const cookie of cookies) {
6
- const trimmedCookie = cookie.trim();
7
- const eqIndex = trimmedCookie.indexOf("=");
8
- if (eqIndex === -1) continue;
9
- const cookieName = trimmedCookie.substring(0, eqIndex);
10
- const cookieValue = trimmedCookie.substring(eqIndex + 1);
11
- if (cookieName === name) {
12
- return cookieValue;
13
- }
14
- }
15
- return void 0;
16
- }
17
- function isApiValidationError(value) {
18
- if (!value || typeof value !== "object") return false;
19
- const v = value;
20
- return typeof v.field === "string" && typeof v.kind === "string" && typeof v.message === "string";
21
- }
22
- var ApiError = class extends Error {
23
- statusCode;
24
- /** Legacy string-array errors — kept for non-validation callers. */
25
- errors;
26
- /**
27
- * Structured workflow-expression validation errors (CEL/Jinja).
28
- * Populated when the backend returns a WorkflowValidationErrorResponse.
29
- */
30
- validationErrors;
31
- constructor(message, statusCode, errors, validationErrors) {
32
- super(message);
33
- this.statusCode = statusCode;
34
- this.errors = errors;
35
- this.validationErrors = validationErrors;
36
- }
37
- };
38
- function requiresStepUpAuth(wwwAuthenticate) {
39
- if (!wwwAuthenticate) return false;
40
- return wwwAuthenticate.includes('error="insufficient_user_authentication"');
41
- }
42
- function parseOrgAuthChallenge(wwwAuthenticate) {
43
- if (!wwwAuthenticate) return null;
44
- if (!wwwAuthenticate.includes('realm="org"')) return null;
45
- const orgUuidMatch = wwwAuthenticate.match(/org_uuid="([^"]+)"/);
46
- const cookieNameMatch = wwwAuthenticate.match(/cookie_name="([^"]+)"/);
47
- const authUrlMatch = wwwAuthenticate.match(/auth_url="([^"]+)"/);
48
- if (!orgUuidMatch?.[1] || !cookieNameMatch?.[1] || !authUrlMatch?.[1]) {
49
- console.warn("Invalid org auth challenge header: missing required fields");
50
- return null;
51
- }
52
- return {
53
- orgUuid: orgUuidMatch[1],
54
- cookieName: cookieNameMatch[1],
55
- authUrl: authUrlMatch[1]
56
- };
57
- }
58
- var BaseApiClient = class {
59
- baseUrl;
60
- apiKey;
61
- isCrossDomain;
62
- fetchFunction;
63
- enhancedAuthHandler;
64
- enhancedAuthInProgress = null;
65
- orgAuthHandler;
66
- orgAuthInProgress = null;
67
- actingMemberUuid;
68
- orgToken;
69
- /**
70
- * The org_uuid that issued the current orgToken. Tracked so we can detect
71
- * a 401 challenge from a *different* org and re-fire the handler — the
72
- * orgToken is an opaque JWE we cannot decrypt client-side, so without this
73
- * the original guard `!this.orgToken` would prevent re-auth across orgs and
74
- * surface as a silent 401 in multi-org CLI workflows.
75
- */
76
- orgTokenOrgUuid;
77
- constructor(apiKey, baseUrl, customFetch) {
78
- this.baseUrl = baseUrl;
79
- this.apiKey = apiKey;
80
- this.fetchFunction = customFetch || (typeof window !== "undefined" ? fetch.bind(window) : fetch);
81
- const apiUrlParsed = new URL(baseUrl);
82
- const currentOrigin = typeof window !== "undefined" ? window.location.origin : "";
83
- this.isCrossDomain = currentOrigin !== "" && currentOrigin !== apiUrlParsed.origin;
84
- }
85
- /**
86
- * Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth).
87
- * This handler is called when a 401 response includes WWW-Authenticate header
88
- * with error="insufficient_user_authentication".
89
- */
90
- setEnhancedAuthHandler(handler) {
91
- this.enhancedAuthHandler = handler;
92
- }
93
- /**
94
- * Set the handler for organization authentication requirements.
95
- * This handler is called when a 401 response includes WWW-Authenticate header
96
- * with realm="org". The handler should redirect the user to complete org auth.
97
- */
98
- setOrgAuthHandler(handler) {
99
- this.orgAuthHandler = handler;
100
- }
1
+ import {
2
+ BaseApiClient
3
+ } from "./chunk-FSSXKQR5.js";
4
+
5
+ // src/api/abilities.ts
6
+ var AbilitiesApi = class extends BaseApiClient {
101
7
  /**
102
- * Update the API key (used after successful re-authentication).
8
+ * List available ability types from the registry.
9
+ * Pass includeSystem to also return auto-injected system abilities.
103
10
  */
104
- updateApiKey(newApiKey) {
105
- this.apiKey = newApiKey;
11
+ async getAbilityTypes(wid, options = {}) {
12
+ const params = new URLSearchParams();
13
+ if (options.includeSystem) params.append("includeSystem", "true");
14
+ const qs = params.toString() ? `?${params.toString()}` : "";
15
+ return this.fetch(`w/${wid}/abilities/types${qs}`);
106
16
  }
107
- /**
108
- * Set the acting member UUID for member identity switching.
109
- * When set, all API requests will include the X-Acting-Member header.
110
- * The backend will validate that the authenticated account owns this member
111
- * and use it as the effective identity for the request.
112
- */
113
- setActingMember(memberUuid) {
114
- this.actingMemberUuid = memberUuid;
17
+ /** Get the full spec for a single ability type by slug. */
18
+ async getAbilityType(wid, slug) {
19
+ return this.fetch(
20
+ `w/${wid}/abilities/types/${encodeURIComponent(slug)}`
21
+ );
115
22
  }
116
23
  /**
117
- * Get the current acting member UUID.
24
+ * List configured ability instances for a workflow or task scope.
25
+ * Exactly one of workflowId / taskId must be provided.
118
26
  */
119
- getActingMember() {
120
- return this.actingMemberUuid;
121
- }
122
- /**
123
- * Set the org token for cross-domain requests.
124
- * When set, all API requests will include the X-Org-Token header,
125
- * allowing org-level SSO verification without cookies.
126
- *
127
- * `orgUuid` is the org that issued the token; passing it lets the 401
128
- * handler detect a stale token when a subsequent request targets a
129
- * different org and re-fire the org-auth handler instead of silently
130
- * 401-ing. Callers without that context (legacy / unknown) may omit it.
131
- */
132
- setOrgToken(token, orgUuid) {
133
- this.orgToken = token;
134
- this.orgTokenOrgUuid = token ? orgUuid : void 0;
135
- }
136
- async fetch(endpoint, options) {
137
- try {
138
- const headers = new Headers({
139
- // Don't set Content-Type for FormData — the browser must set it
140
- // with the multipart boundary automatically.
141
- ...options?.body instanceof FormData ? {} : { "Content-Type": "application/json" },
142
- ...options?.headers || {}
143
- });
144
- if (this.apiKey) {
145
- headers.set("Authorization", `Bearer ${this.apiKey}`);
146
- } else if (this.isCrossDomain) {
147
- const requestToken = getCookieValue("requestToken");
148
- if (requestToken) {
149
- headers.set("Authorization", `Bearer ${requestToken}`);
150
- }
151
- }
152
- if (this.actingMemberUuid) {
153
- headers.set("X-Acting-Member", this.actingMemberUuid);
154
- }
155
- if (this.orgToken) {
156
- headers.set("X-Org-Token", this.orgToken);
157
- }
158
- const fullUrl = `${this.baseUrl}/api/v2/${endpoint}`;
159
- const response = await this.fetchFunction(fullUrl, {
160
- ...options,
161
- ...this.apiKey ? {} : { credentials: "include" },
162
- ...this.isCrossDomain ? { mode: "cors" } : {},
163
- headers
164
- });
165
- if (!response.ok) {
166
- if (response.status === 401 && requiresStepUpAuth(response.headers.get("WWW-Authenticate")) && this.enhancedAuthHandler) {
167
- if (this.enhancedAuthInProgress) {
168
- await this.enhancedAuthInProgress;
169
- } else {
170
- this.enhancedAuthInProgress = this.enhancedAuthHandler();
171
- try {
172
- const newToken = await this.enhancedAuthInProgress;
173
- this.apiKey = newToken;
174
- } finally {
175
- this.enhancedAuthInProgress = null;
176
- }
177
- }
178
- try {
179
- return await this.fetch(endpoint, options);
180
- } catch (retryError) {
181
- this.orgToken = void 0;
182
- this.orgTokenOrgUuid = void 0;
183
- throw retryError;
184
- }
185
- }
186
- if (response.status === 401) {
187
- const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
188
- if (orgAuthInfo && this.orgToken && this.orgTokenOrgUuid && this.orgTokenOrgUuid !== orgAuthInfo.orgUuid) {
189
- this.orgToken = void 0;
190
- this.orgTokenOrgUuid = void 0;
191
- }
192
- if (orgAuthInfo && !this.orgToken) {
193
- const requestCookieName = orgAuthInfo.cookieName.replace(
194
- /^orgToken/,
195
- "requestOrgToken"
196
- );
197
- const cachedOrgToken = getCookieValue(requestCookieName);
198
- if (cachedOrgToken) {
199
- this.orgToken = cachedOrgToken;
200
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
201
- try {
202
- return await this.fetch(endpoint, options);
203
- } catch (retryError) {
204
- this.orgToken = void 0;
205
- this.orgTokenOrgUuid = void 0;
206
- throw retryError;
207
- }
208
- }
209
- if (this.orgAuthHandler) {
210
- if (!this.orgAuthInProgress) {
211
- const handler = this.orgAuthHandler;
212
- this.orgAuthInProgress = (async () => {
213
- try {
214
- await handler(orgAuthInfo);
215
- } finally {
216
- this.orgAuthInProgress = null;
217
- }
218
- })();
219
- }
220
- await this.orgAuthInProgress;
221
- const postHandlerToken = getCookieValue(requestCookieName) ?? this.orgToken;
222
- if (!postHandlerToken) {
223
- throw new ApiError(
224
- "Organization authentication did not issue a token",
225
- 401
226
- );
227
- }
228
- this.orgToken = postHandlerToken;
229
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
230
- try {
231
- return await this.fetch(endpoint, options);
232
- } catch (retryError) {
233
- this.orgToken = void 0;
234
- this.orgTokenOrgUuid = void 0;
235
- throw retryError;
236
- }
237
- }
238
- }
239
- }
240
- const errorData = await response.json().catch(() => ({}));
241
- if (response.status === 401 && endpoint === "account") {
242
- throw new Error("unauthorized");
243
- }
244
- if (Array.isArray(errorData.detail)) {
245
- const formattedErrors = errorData.detail.map((error) => {
246
- const location = error.loc.join(" > ");
247
- return `${location}: ${error.msg}`;
248
- }).join("\n");
249
- throw new ApiError(`Validation Error:
250
- ${formattedErrors}`, response.status);
251
- }
252
- if (errorData.errors && Array.isArray(errorData.errors)) {
253
- if (errorData.errors.length > 0 && isApiValidationError(errorData.errors[0])) {
254
- const validationErrors = errorData.errors.filter(isApiValidationError);
255
- const [first] = validationErrors;
256
- if (first) {
257
- const extra = validationErrors.length > 1 ? ` (+${validationErrors.length - 1} more)` : "";
258
- const readable = `${first.field}: ${first.message}${extra}`;
259
- throw new ApiError(
260
- readable,
261
- response.status,
262
- validationErrors.map((e) => `${e.field}: ${e.message}`),
263
- validationErrors
264
- );
265
- }
266
- }
267
- const stringErrors = errorData.errors.filter(
268
- (e) => typeof e === "string"
269
- );
270
- const details = stringErrors.join("; ");
271
- const message = errorData.detail ? `${errorData.detail}: ${details}` : `Validation failed: ${details}`;
272
- throw new ApiError(message, response.status, stringErrors);
273
- }
274
- const structuredError = errorData.detail || errorData;
275
- if (structuredError && typeof structuredError === "object" && (structuredError.error === true || structuredError.code)) {
276
- const message = structuredError.message || structuredError.code || "Unknown error";
277
- const error = new ApiError(message, response.status);
278
- error.errorData = structuredError;
279
- throw error;
280
- }
281
- const errorMessage = typeof errorData.detail === "string" ? errorData.detail : errorData.message || response.statusText;
282
- throw new ApiError(errorMessage, response.status);
283
- }
284
- if (response.status === 204) {
285
- return void 0;
286
- }
287
- return response.json();
288
- } catch (error) {
289
- console.warn(error);
290
- throw error;
291
- }
27
+ async listAbilities(wid, options) {
28
+ const params = new URLSearchParams();
29
+ if (options.workflowId !== void 0)
30
+ params.append("workflowId", options.workflowId.toString());
31
+ if (options.taskId !== void 0)
32
+ params.append("taskId", options.taskId.toString());
33
+ return this.fetch(`w/${wid}/abilities?${params}`);
292
34
  }
293
- async fetchRaw(endpoint, options, allowedErrorStatuses = []) {
294
- try {
295
- const headers = new Headers({
296
- ...options?.headers || {}
297
- });
298
- if (this.apiKey) {
299
- headers.set("Authorization", `Bearer ${this.apiKey}`);
300
- } else if (this.isCrossDomain) {
301
- const requestToken = getCookieValue("requestToken");
302
- if (requestToken) {
303
- headers.set("Authorization", `Bearer ${requestToken}`);
304
- }
305
- }
306
- if (this.actingMemberUuid) {
307
- headers.set("X-Acting-Member", this.actingMemberUuid);
308
- }
309
- if (this.orgToken) {
310
- headers.set("X-Org-Token", this.orgToken);
311
- }
312
- const response = await this.fetchFunction(`${this.baseUrl}/api/v2/${endpoint}`, {
313
- ...options,
314
- ...this.apiKey ? {} : { credentials: "include" },
315
- ...this.isCrossDomain ? { mode: "cors" } : {},
316
- headers
317
- });
318
- if (!response.ok) {
319
- if (response.status === 401 && requiresStepUpAuth(response.headers.get("WWW-Authenticate")) && this.enhancedAuthHandler) {
320
- if (this.enhancedAuthInProgress) {
321
- await this.enhancedAuthInProgress;
322
- } else {
323
- this.enhancedAuthInProgress = this.enhancedAuthHandler();
324
- try {
325
- const newToken = await this.enhancedAuthInProgress;
326
- this.apiKey = newToken;
327
- } finally {
328
- this.enhancedAuthInProgress = null;
329
- }
330
- }
331
- try {
332
- return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
333
- } catch (retryError) {
334
- this.orgToken = void 0;
335
- this.orgTokenOrgUuid = void 0;
336
- throw retryError;
337
- }
338
- }
339
- if (response.status === 401) {
340
- const orgAuthInfo = parseOrgAuthChallenge(response.headers.get("WWW-Authenticate"));
341
- if (orgAuthInfo && this.orgToken && this.orgTokenOrgUuid && this.orgTokenOrgUuid !== orgAuthInfo.orgUuid) {
342
- this.orgToken = void 0;
343
- this.orgTokenOrgUuid = void 0;
344
- }
345
- if (orgAuthInfo && !this.orgToken) {
346
- const requestCookieName = orgAuthInfo.cookieName.replace(
347
- /^orgToken/,
348
- "requestOrgToken"
349
- );
350
- const cachedOrgToken = getCookieValue(requestCookieName);
351
- if (cachedOrgToken) {
352
- this.orgToken = cachedOrgToken;
353
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
354
- try {
355
- return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
356
- } catch (retryError) {
357
- this.orgToken = void 0;
358
- this.orgTokenOrgUuid = void 0;
359
- throw retryError;
360
- }
361
- }
362
- if (this.orgAuthHandler) {
363
- if (!this.orgAuthInProgress) {
364
- const handler = this.orgAuthHandler;
365
- this.orgAuthInProgress = (async () => {
366
- try {
367
- await handler(orgAuthInfo);
368
- } finally {
369
- this.orgAuthInProgress = null;
370
- }
371
- })();
372
- }
373
- await this.orgAuthInProgress;
374
- const postHandlerToken = getCookieValue(requestCookieName) ?? this.orgToken;
375
- if (!postHandlerToken) {
376
- throw new ApiError(
377
- "Organization authentication did not issue a token",
378
- 401
379
- );
380
- }
381
- this.orgToken = postHandlerToken;
382
- this.orgTokenOrgUuid = orgAuthInfo.orgUuid;
383
- try {
384
- return await this.fetchRaw(endpoint, options, allowedErrorStatuses);
385
- } catch (retryError) {
386
- this.orgToken = void 0;
387
- this.orgTokenOrgUuid = void 0;
388
- throw retryError;
389
- }
390
- }
391
- }
392
- }
393
- if (allowedErrorStatuses.includes(response.status)) {
394
- return response;
395
- }
396
- const errorText = await response.text().catch(() => "");
397
- throw new ApiError(errorText || response.statusText, response.status);
398
- }
399
- return response;
400
- } catch (error) {
401
- console.warn(error);
402
- throw error;
403
- }
35
+ /** Create (enable) a configured ability on a workflow or task scope. */
36
+ async createAbility(wid, body) {
37
+ return this.fetch(`w/${wid}/abilities`, {
38
+ method: "POST",
39
+ body: JSON.stringify(body)
40
+ });
404
41
  }
405
- /**
406
- * Fetch from root path (not prefixed with /api/v2/)
407
- * Used for OAuth and other non-API endpoints
408
- */
409
- async fetchRoot(path, options) {
410
- try {
411
- const headers = new Headers({
412
- ...options?.body instanceof FormData ? {} : { "Content-Type": "application/json" },
413
- ...options?.headers || {}
414
- });
415
- if (this.apiKey) {
416
- headers.set("Authorization", `Bearer ${this.apiKey}`);
417
- } else if (this.isCrossDomain) {
418
- const requestToken = getCookieValue("requestToken");
419
- if (requestToken) {
420
- headers.set("Authorization", `Bearer ${requestToken}`);
421
- }
422
- }
423
- if (this.actingMemberUuid) {
424
- headers.set("X-Acting-Member", this.actingMemberUuid);
425
- }
426
- if (this.orgToken) {
427
- headers.set("X-Org-Token", this.orgToken);
428
- }
429
- const fullUrl = `${this.baseUrl}/${path}`;
430
- const response = await this.fetchFunction(fullUrl, {
431
- ...options,
432
- ...this.apiKey ? {} : { credentials: "include" },
433
- ...this.isCrossDomain ? { mode: "cors" } : {},
434
- headers
435
- });
436
- if (!response.ok) {
437
- if (response.status === 404) {
438
- return null;
439
- }
440
- const errorData = await response.json().catch(() => ({}));
441
- const errorMessage = errorData.detail || errorData.message || response.statusText;
442
- throw new ApiError(errorMessage, response.status);
443
- }
444
- if (response.status === 204) {
445
- return void 0;
446
- }
447
- return response.json();
448
- } catch (error) {
449
- console.warn(error);
450
- throw error;
451
- }
42
+ /** Update a configured ability (configure / enable / disable) by UUID. */
43
+ async updateAbility(wid, abilityUuid, body) {
44
+ return this.fetch(`w/${wid}/abilities/${abilityUuid}`, {
45
+ method: "PATCH",
46
+ body: JSON.stringify(body)
47
+ });
452
48
  }
453
- };
454
-
455
- // src/api/abilities.ts
456
- var AbilitiesApi = class extends BaseApiClient {
457
- /**
458
- * List all available ability types from the registry.
459
- */
460
- async getAbilityTypes(wid) {
461
- return this.fetch(`w/${wid}/abilities/types`);
49
+ /** Delete a configured ability instance by UUID. */
50
+ async deleteAbility(wid, abilityUuid) {
51
+ return this.fetch(`w/${wid}/abilities/${abilityUuid}`, {
52
+ method: "DELETE"
53
+ });
462
54
  }
463
55
  };
464
56
 
@@ -621,9 +213,21 @@ var AgentsApi = class extends BaseApiClient {
621
213
  async resolveAgentTools(wid, id, options) {
622
214
  const params = new URLSearchParams();
623
215
  params.append("channel", options.channel);
624
- params.append("taskId", options.taskId.toString());
216
+ if (options.taskId !== void 0) params.append("taskId", options.taskId.toString());
217
+ if (options.taskUuid !== void 0) params.append("taskUuid", options.taskUuid);
625
218
  return this.fetch(`w/${wid}/agents/${id}/resolve-tools?${params}`);
626
219
  }
220
+ /**
221
+ * List the configured abilities effective for an agent via a task's workflow.
222
+ * Requires taskId because abilities are scoped to workflows/tasks, not agents.
223
+ */
224
+ async listAgentAbilities(wid, id, options) {
225
+ const params = new URLSearchParams();
226
+ params.append("taskId", options.taskId.toString());
227
+ return this.fetch(
228
+ `w/${wid}/agents/${id}/abilities?${params}`
229
+ );
230
+ }
627
231
  };
628
232
 
629
233
  // src/api/ai-models.ts
@@ -681,7 +285,11 @@ var AIModelsApi = class extends BaseApiClient {
681
285
  return this.fetch(url);
682
286
  }
683
287
  /**
684
- * Get available speech-to-text models
288
+ * Get available speech-to-text models.
289
+ *
290
+ * Returns the per-shape `STTModelsResponse` so callers see `languages` and
291
+ * `capabilities` on each model (the chat-shape `AIModelsResponse` it used
292
+ * to return doesn't include either).
685
293
  */
686
294
  async getSTTModels(provider) {
687
295
  const searchParams = new URLSearchParams();
@@ -1076,15 +684,11 @@ var AuthApi = class extends BaseApiClient {
1076
684
  body: JSON.stringify({ email, organizationUuid, redirectUrl })
1077
685
  });
1078
686
  }
1079
- /** Validate a magic link token and optional OTP to complete authentication. */
1080
- async validateMagicLink(token, otp) {
1081
- const body = { token };
1082
- if (otp) {
1083
- body.otp = otp;
1084
- }
687
+ /** Validate a magic link token to complete authentication. */
688
+ async validateMagicLink(token) {
1085
689
  return await this.fetch(`auth/validate-magic-link`, {
1086
690
  method: "POST",
1087
- body: JSON.stringify(body)
691
+ body: JSON.stringify({ token })
1088
692
  });
1089
693
  }
1090
694
  // ===== EMAIL VERIFICATION METHODS =====
@@ -1590,6 +1194,26 @@ var CallsApi = class extends BaseApiClient {
1590
1194
  async getMessageTiming(wid, chatId) {
1591
1195
  return this.fetch(`w/${wid}/recordings/chat/${chatId}/message-timing`);
1592
1196
  }
1197
+ /** List the recorded audio chunks for a chat (metadata only). */
1198
+ async listChatRecordings(wid, chatId, options = {}) {
1199
+ const params = new URLSearchParams();
1200
+ if (options.role) params.set("role", options.role);
1201
+ return this.fetch(
1202
+ `w/${wid}/recordings/chat/${chatId}${params.toString() ? `?${params.toString()}` : ""}`
1203
+ );
1204
+ }
1205
+ /**
1206
+ * Get a single short-lived presigned URL to download the complete call
1207
+ * recording as one WAV file. The first request assembles + caches the
1208
+ * full-call WAV; later requests reuse it.
1209
+ */
1210
+ async getCallRecordingDownloadUrl(wid, chatId, options = {}) {
1211
+ const params = new URLSearchParams();
1212
+ if (options.expiresIn !== void 0) params.set("expires_in", String(options.expiresIn));
1213
+ return this.fetch(
1214
+ `w/${wid}/recordings/chat/${chatId}/download-url${params.toString() ? `?${params.toString()}` : ""}`
1215
+ );
1216
+ }
1593
1217
  };
1594
1218
 
1595
1219
  // src/api/cel.ts
@@ -1674,6 +1298,17 @@ var ChatsApi = class extends BaseApiClient {
1674
1298
  async getChatTokenUsage(wid, chatId) {
1675
1299
  return this.fetch(`w/${wid}/chats/${chatId}/token-usage`);
1676
1300
  }
1301
+ /** List scheduled callbacks for a chat (newest first). */
1302
+ async getChatCallbacks(wid, chatId) {
1303
+ return this.fetch(`w/${wid}/chats/${chatId}/callbacks`);
1304
+ }
1305
+ /** Cancel a pending scheduled callback on a chat. */
1306
+ async cancelChatCallback(wid, chatId, callbackId) {
1307
+ return this.fetch(
1308
+ `w/${wid}/chats/${chatId}/callbacks/${callbackId}/cancel`,
1309
+ { method: "POST" }
1310
+ );
1311
+ }
1677
1312
  /** Get todo items extracted from a chat. */
1678
1313
  async getChatTodos(wid, chatId) {
1679
1314
  return this.fetch(`w/${wid}/chats/${chatId}/todos`);
@@ -1712,9 +1347,11 @@ var ChatsApi = class extends BaseApiClient {
1712
1347
  }
1713
1348
  /** Create a new chat. */
1714
1349
  async createChat(wid, chat) {
1350
+ const { agentMemberId, ...rest } = chat;
1351
+ const payload = agentMemberId !== void 0 && rest.assistantMemberId === void 0 ? { ...rest, assistantMemberId: agentMemberId } : rest;
1715
1352
  return this.fetch(`w/${wid}/chats`, {
1716
1353
  method: "POST",
1717
- body: JSON.stringify(chat)
1354
+ body: JSON.stringify(payload)
1718
1355
  });
1719
1356
  }
1720
1357
  /**
@@ -1777,7 +1414,8 @@ var ChatsApi = class extends BaseApiClient {
1777
1414
  }
1778
1415
  );
1779
1416
  }
1780
- /** List messages in a chat with optional pagination. */
1417
+ /** List messages in a chat with optional pagination.
1418
+ * ``id`` is the numeric chat id (documented) or the chat uuid (accepted). */
1781
1419
  async getChatMessages(wid, id, limit, offset) {
1782
1420
  const params = new URLSearchParams();
1783
1421
  if (limit) params.append("limit", limit.toString());
@@ -2157,6 +1795,7 @@ var DataTypesApi = class extends BaseApiClient {
2157
1795
  async getDataRecords(wid, dataTypeId, options) {
2158
1796
  const params = new URLSearchParams();
2159
1797
  if (options?.memberId !== void 0) params.append("member_id", options.memberId.toString());
1798
+ if (options?.memberIds?.length) params.append("member_ids", options.memberIds.join(","));
2160
1799
  if (options?.search) params.append("search", options.search);
2161
1800
  if (options?.searchField) params.append("search_field", options.searchField);
2162
1801
  if (options?.page) params.append("page", options.page.toString());
@@ -2499,6 +2138,13 @@ var EventsApi = class extends BaseApiClient {
2499
2138
  method: "DELETE"
2500
2139
  });
2501
2140
  }
2141
+ /** Send a one-off test webhook for an existing webhook event rule. */
2142
+ async testWebhook(wid, id, request) {
2143
+ return this.fetch(`w/${wid}/event-rules/${id}/test-webhook`, {
2144
+ method: "POST",
2145
+ body: JSON.stringify(request)
2146
+ });
2147
+ }
2502
2148
  /** Reorder event rules by specifying the desired rule ID sequence. */
2503
2149
  async reorderEventRules(wid, ruleIds) {
2504
2150
  return this.fetch(`w/${wid}/event-rules/reorder`, {
@@ -3003,6 +2649,18 @@ var FilesApi = class extends BaseApiClient {
3003
2649
  async getFile(wid, id) {
3004
2650
  return this.fetch(`w/${wid}/files/${id}`);
3005
2651
  }
2652
+ /**
2653
+ * Download the given files + folders (folders recursively) as a single ZIP.
2654
+ * Returns the raw archive bytes for the caller to save.
2655
+ */
2656
+ async downloadFilesZip(wid, fileIds, folderIds) {
2657
+ const response = await this.fetchRaw(`w/${wid}/files/download/zip`, {
2658
+ method: "POST",
2659
+ headers: { "Content-Type": "application/json" },
2660
+ body: JSON.stringify({ file_ids: fileIds, folder_ids: folderIds })
2661
+ });
2662
+ return response.blob();
2663
+ }
3006
2664
  /** Create a new file record in the workspace. */
3007
2665
  async createFile(wid, file) {
3008
2666
  return this.fetch(`w/${wid}/files`, {
@@ -3493,6 +3151,12 @@ var AppConnectionsApi = class extends BaseApiClient {
3493
3151
  * values are intentionally never exposed. Operators can also add a
3494
3152
  * new key via the UI's "Add custom field key" free-text action.
3495
3153
  */
3154
+ async setDefaultGooglePlatformAccount(wid, connectionUuid, credentialUuid) {
3155
+ return this.fetch(
3156
+ `w/${wid}/app-connections/google/platform-apps/${connectionUuid}/accounts/${credentialUuid}/default`,
3157
+ { method: "POST" }
3158
+ );
3159
+ }
3496
3160
  async listConnectionMemberFieldKeys(wid, connectionId) {
3497
3161
  return this.fetch(
3498
3162
  `w/${wid}/app-connections/${connectionId}/member-field-keys`
@@ -3613,6 +3277,31 @@ var McpServersApi = class extends BaseApiClient {
3613
3277
  };
3614
3278
 
3615
3279
  // src/api/members.ts
3280
+ var MemberImportValidationError = class extends Error {
3281
+ validationErrors;
3282
+ constructor(message, validationErrors) {
3283
+ super(message);
3284
+ this.name = "MemberImportValidationError";
3285
+ this.validationErrors = validationErrors;
3286
+ }
3287
+ };
3288
+ function throwMemberImportError(errorBody, fallback) {
3289
+ let detail = errorBody?.detail;
3290
+ if (typeof detail === "string") {
3291
+ try {
3292
+ const parsed = JSON.parse(detail);
3293
+ if (parsed && typeof parsed === "object") detail = parsed;
3294
+ } catch {
3295
+ }
3296
+ }
3297
+ if (detail && typeof detail === "object") {
3298
+ const { message, errors } = detail;
3299
+ if (Array.isArray(errors)) {
3300
+ throw new MemberImportValidationError(message || fallback, errors);
3301
+ }
3302
+ }
3303
+ throw new Error(typeof detail === "string" ? detail : fallback);
3304
+ }
3616
3305
  var MembersApi = class extends BaseApiClient {
3617
3306
  /** Get the currently authenticated member for a workspace. */
3618
3307
  async getCurrentMember(wid) {
@@ -3653,8 +3342,10 @@ var MembersApi = class extends BaseApiClient {
3653
3342
  });
3654
3343
  }
3655
3344
  /** List workspace members with pagination, filtering, and sorting. */
3656
- async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds) {
3345
+ async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds, memberFilterId, query) {
3657
3346
  const params = new URLSearchParams();
3347
+ if (memberFilterId != null) params.append("memberFilterId", memberFilterId.toString());
3348
+ if (query != null) params.append("query", JSON.stringify(query));
3658
3349
  if (page) params.append("page", page.toString());
3659
3350
  if (pageSize) params.append("pageSize", pageSize.toString());
3660
3351
  if (sortBy) params.append("sortBy", sortBy);
@@ -3727,6 +3418,17 @@ var MembersApi = class extends BaseApiClient {
3727
3418
  method: "POST"
3728
3419
  });
3729
3420
  }
3421
+ /**
3422
+ * Send the member an SMS asking them to confirm their phone number. When they
3423
+ * reply, a trusted phone auth binding is created so they can use SMS as
3424
+ * themselves without an account (member-attested alternative to the
3425
+ * members:admin "Trusted" override).
3426
+ */
3427
+ async sendMemberPhoneConfirmation(wid, memberId) {
3428
+ return this.fetch(`w/${wid}/members/${memberId}/phone-confirmation`, {
3429
+ method: "POST"
3430
+ });
3431
+ }
3730
3432
  // Member Filter APIs
3731
3433
  /** List all saved member filters for a workspace. */
3732
3434
  async getMemberFilters(wid) {
@@ -3750,6 +3452,22 @@ var MembersApi = class extends BaseApiClient {
3750
3452
  body: JSON.stringify(data)
3751
3453
  });
3752
3454
  }
3455
+ /**
3456
+ * Convert a legacy rules filter to a query-engine predicate. One-way and
3457
+ * transactional: on success the filter's legacy rules are gone and
3458
+ * `query` holds the equivalent IR predicate. 409 if already query-format;
3459
+ * 422 when rules have no engine equivalent.
3460
+ *
3461
+ * With `dryRun: true` the same validation runs but nothing persists: the
3462
+ * response previews the normalized predicate in `query` while `rules`
3463
+ * stay intact on the filter.
3464
+ */
3465
+ async convertMemberFilterToQuery(wid, filterId, opts) {
3466
+ const suffix = opts?.dryRun ? "?dryRun=true" : "";
3467
+ return this.fetch(`w/${wid}/member-filters/${filterId}/convert${suffix}`, {
3468
+ method: "PUT"
3469
+ });
3470
+ }
3753
3471
  /** Delete a saved member filter. */
3754
3472
  async deleteMemberFilter(wid, filterId) {
3755
3473
  return this.fetch(`w/${wid}/member-filters/${filterId}`, {
@@ -3827,48 +3545,98 @@ var MembersApi = class extends BaseApiClient {
3827
3545
  });
3828
3546
  }
3829
3547
  // Import/Export Members API
3830
- /** Import members from a CSV file, streaming progress updates via callback. */
3831
- async importMembers(wid, file, newMemberRoleId, onProgress) {
3548
+ /**
3549
+ * Read-only preview classifying each CSV row before any write (GRA-5545).
3550
+ *
3551
+ * Returns create/update/unchanged/conflict/error counts. For phone-only
3552
+ * identity conflicts it also returns existing vs incoming identity so the
3553
+ * operator can decide whether to skip or explicitly overwrite before
3554
+ * committing. Requires MEMBERS_ADMIN and is bulk-PHI audited server-side.
3555
+ */
3556
+ async previewImportMembers(wid, file, newMemberRoleId, options) {
3832
3557
  const formData = new FormData();
3833
3558
  formData.append("file", file);
3834
3559
  const params = new URLSearchParams();
3835
3560
  params.append("new_member_role_id", newMemberRoleId.toString());
3836
- const response = await fetch(
3837
- `${this.baseUrl}/api/v2/w/${wid}/members/import?${params.toString()}`,
3561
+ if (options?.trustEmailAddresses) {
3562
+ params.append("trust_email_addresses", "true");
3563
+ }
3564
+ if (options?.trustPhoneNumbers) {
3565
+ params.append("trust_phone_numbers", "true");
3566
+ }
3567
+ const response = await this.fetchRaw(
3568
+ `w/${wid}/members/import/preview?${params.toString()}`,
3838
3569
  {
3839
3570
  method: "POST",
3840
- body: formData,
3841
- credentials: "include"
3842
- }
3571
+ body: formData
3572
+ },
3573
+ [400, 413]
3843
3574
  );
3844
3575
  if (!response.ok) {
3845
- const error = await response.json();
3846
- if (error.detail && typeof error.detail === "object") {
3847
- const { message, errors } = error.detail;
3848
- if (errors && Array.isArray(errors)) {
3849
- const importError = new Error(message || "Import validation failed");
3850
- importError.validationErrors = errors;
3851
- throw importError;
3852
- }
3853
- }
3854
- throw new Error(error.detail || "Import failed");
3576
+ const error = await response.json().catch(() => ({}));
3577
+ throwMemberImportError(error, "Import preview failed");
3578
+ }
3579
+ return response.json();
3580
+ }
3581
+ /**
3582
+ * Import members from a CSV file, streaming progress updates via callback.
3583
+ *
3584
+ * ``identityConflictPolicy`` (default 'skip') controls how a row matching an
3585
+ * existing member ONLY by phone with different identity fields is handled.
3586
+ * Send 'overwrite_identity_fields' only after the operator confirms a preview.
3587
+ */
3588
+ async importMembers(wid, file, newMemberRoleId, onProgress, options) {
3589
+ const formData = new FormData();
3590
+ formData.append("file", file);
3591
+ const params = new URLSearchParams();
3592
+ params.append("new_member_role_id", newMemberRoleId.toString());
3593
+ if (options?.trustEmailAddresses) {
3594
+ params.append("trust_email_addresses", "true");
3595
+ }
3596
+ if (options?.trustPhoneNumbers) {
3597
+ params.append("trust_phone_numbers", "true");
3598
+ }
3599
+ if (options?.identityConflictPolicy) {
3600
+ params.append("identity_conflict_policy", options.identityConflictPolicy);
3601
+ }
3602
+ const response = await this.fetchRaw(
3603
+ `w/${wid}/members/import?${params.toString()}`,
3604
+ {
3605
+ method: "POST",
3606
+ body: formData
3607
+ },
3608
+ [400, 413]
3609
+ );
3610
+ if (!response.ok) {
3611
+ const error = await response.json().catch(() => ({}));
3612
+ throwMemberImportError(error, "Import failed");
3855
3613
  }
3856
3614
  if (onProgress && response.body) {
3857
3615
  const reader = response.body.getReader();
3858
3616
  const decoder = new TextDecoder();
3617
+ let buffer = "";
3859
3618
  while (true) {
3860
3619
  const { done, value } = await reader.read();
3861
3620
  if (done) break;
3862
- const chunk = decoder.decode(value);
3863
- const lines = chunk.split("\n").filter((line) => line.trim());
3621
+ buffer += decoder.decode(value, { stream: true });
3622
+ const lines = buffer.split("\n");
3623
+ buffer = lines.pop() ?? "";
3864
3624
  for (const line of lines) {
3625
+ const trimmed = line.trim();
3626
+ if (!trimmed) continue;
3865
3627
  try {
3866
- const progress = JSON.parse(line);
3867
- onProgress(progress);
3628
+ onProgress(JSON.parse(trimmed));
3868
3629
  } catch {
3869
3630
  }
3870
3631
  }
3871
3632
  }
3633
+ const tail = buffer.trim();
3634
+ if (tail) {
3635
+ try {
3636
+ onProgress(JSON.parse(tail));
3637
+ } catch {
3638
+ }
3639
+ }
3872
3640
  }
3873
3641
  return { success: true };
3874
3642
  }
@@ -4060,6 +3828,17 @@ var MembersApi = class extends BaseApiClient {
4060
3828
  { method: "DELETE" }
4061
3829
  );
4062
3830
  }
3831
+ /** Bulk-create members in a workspace. */
3832
+ async bulkCreateMembers(wid, request) {
3833
+ return this.fetch(`w/${wid}/members/bulk`, {
3834
+ method: "POST",
3835
+ body: JSON.stringify(request)
3836
+ });
3837
+ }
3838
+ /** Get all sync links for a member across app connections. */
3839
+ async getMemberSyncLinks(wid, memberId) {
3840
+ return this.fetch(`w/${wid}/members/${memberId}/sync-links`);
3841
+ }
4063
3842
  };
4064
3843
 
4065
3844
  // src/api/milestones.ts
@@ -4556,6 +4335,7 @@ var OrgApi = class extends BaseApiClient {
4556
4335
  */
4557
4336
  async searchPhoneNumbers(orgUuid, params) {
4558
4337
  const query = new URLSearchParams();
4338
+ if (params?.country) query.set("country", params.country);
4559
4339
  if (params?.numberType) query.set("number_type", params.numberType);
4560
4340
  if (params?.areaCode) query.set("area_code", params.areaCode);
4561
4341
  if (params?.contains) query.set("contains", params.contains);
@@ -4567,11 +4347,20 @@ var OrgApi = class extends BaseApiClient {
4567
4347
  }
4568
4348
  /**
4569
4349
  * Purchase a phone number from Twilio for this org inventory (org admin only).
4350
+ *
4351
+ * Numbers in regulated countries (e.g. Australia) require a Twilio regulatory
4352
+ * bundle and an address — pass `bundleSid` and `addressSid` for those.
4570
4353
  */
4571
- async purchasePhoneNumber(orgUuid, phoneNumber, numberType) {
4354
+ async purchasePhoneNumber(orgUuid, phoneNumber, numberType, opts) {
4572
4355
  return this.fetch(`o/${orgUuid}/phone-numbers/purchase`, {
4573
4356
  method: "POST",
4574
- body: JSON.stringify({ phoneNumber, numberType })
4357
+ body: JSON.stringify({
4358
+ phoneNumber,
4359
+ numberType,
4360
+ country: opts?.country,
4361
+ bundleSid: opts?.bundleSid,
4362
+ addressSid: opts?.addressSid
4363
+ })
4575
4364
  });
4576
4365
  }
4577
4366
  /**
@@ -4779,6 +4568,90 @@ var OrgApi = class extends BaseApiClient {
4779
4568
  method: "POST"
4780
4569
  });
4781
4570
  }
4571
+ /**
4572
+ * List the org's A2P brands (broker resources). The SMS-consent editor uses
4573
+ * this to pick which brand's consent config to edit.
4574
+ */
4575
+ async listA2PBrands(orgUuid) {
4576
+ return this.fetch(`o/${orgUuid}/a2p-brands`);
4577
+ }
4578
+ /**
4579
+ * Fetch a brand's resolved A2P campaign config. The response carries both the
4580
+ * raw `overrides` and the `resolved` payload (defaults + overrides) the editor
4581
+ * previews — including the canonical SMS consent text.
4582
+ */
4583
+ async getA2PCampaignConfig(orgUuid, brandUuid) {
4584
+ return this.fetch(
4585
+ `o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`
4586
+ );
4587
+ }
4588
+ /**
4589
+ * Partial-update a brand's A2P campaign config. Returns the freshly resolved
4590
+ * config so the editor's live preview updates without a second round-trip.
4591
+ */
4592
+ async updateA2PCampaignConfig(orgUuid, brandUuid, data) {
4593
+ return this.fetch(
4594
+ `o/${orgUuid}/a2p-brands/${brandUuid}/campaign-config`,
4595
+ {
4596
+ method: "PUT",
4597
+ body: JSON.stringify(data)
4598
+ }
4599
+ );
4600
+ }
4601
+ /**
4602
+ * Published Sites across the org's workspaces that can be linked as this
4603
+ * brand's enrollment (opt-in) surface. Org-authorized, so it works even when
4604
+ * the admin isn't a member of the workspace holding the Site.
4605
+ */
4606
+ async listA2PEnrollmentSiteCandidates(orgUuid, brandUuid) {
4607
+ return this.fetch(
4608
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/candidates`
4609
+ );
4610
+ }
4611
+ /**
4612
+ * Link the brand to a published enrollment Site (sets `site_uuid`). Returns
4613
+ * the refreshed campaign config so the editor's link state updates inline.
4614
+ */
4615
+ async linkA2PEnrollmentSite(orgUuid, brandUuid, data) {
4616
+ return this.fetch(
4617
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
4618
+ {
4619
+ method: "PUT",
4620
+ body: JSON.stringify(data)
4621
+ }
4622
+ );
4623
+ }
4624
+ /**
4625
+ * Provision (or reuse) a patient-enrollment Site for the brand and link it —
4626
+ * the one-click path behind the SMS Consent tab. `workspaceUuid` is required
4627
+ * only when the org has multiple workspaces. Returns the refreshed campaign
4628
+ * config so the editor's link state updates inline. Idempotent.
4629
+ */
4630
+ async provisionA2PEnrollmentSite(orgUuid, brandUuid, data = {}) {
4631
+ return this.fetch(
4632
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site/provision`,
4633
+ {
4634
+ method: "POST",
4635
+ body: JSON.stringify(data)
4636
+ }
4637
+ );
4638
+ }
4639
+ /** Clear the brand's enrollment-site link. */
4640
+ async unlinkA2PEnrollmentSite(orgUuid, brandUuid) {
4641
+ return this.fetch(
4642
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-site`,
4643
+ { method: "DELETE" }
4644
+ );
4645
+ }
4646
+ /**
4647
+ * The brand-addressable enrollment form URL (carries `?brand=…`). Outreach
4648
+ * appends each patient's `external_id`. `url` is null until a Site is linked.
4649
+ */
4650
+ async getA2PBrandEnrollmentUrl(orgUuid, brandUuid) {
4651
+ return this.fetch(
4652
+ `o/${orgUuid}/a2p-brands/${brandUuid}/enrollment-url`
4653
+ );
4654
+ }
4782
4655
  /**
4783
4656
  * List available member roles for a workspace in the organization.
4784
4657
  */
@@ -4803,58 +4676,53 @@ var OrgApi = class extends BaseApiClient {
4803
4676
  function getOAuthPath(providerSlug, action) {
4804
4677
  if (providerSlug === "google_calendar") {
4805
4678
  return `oauth/google/calendar/${action}`;
4806
- } else if (providerSlug === "gmail") {
4679
+ }
4680
+ if (providerSlug === "gmail") {
4807
4681
  return `oauth/google/gmail/${action}`;
4808
- } else {
4809
- return `oauth/${providerSlug}/${action}`;
4810
4682
  }
4683
+ if (providerSlug === "gdrive") {
4684
+ return `oauth/google/drive/${action}`;
4685
+ }
4686
+ return `oauth/${providerSlug}/${action}`;
4687
+ }
4688
+ function buildAuthorizeQuery(options) {
4689
+ if (!options) return "";
4690
+ const params = new URLSearchParams();
4691
+ if (options.credentialUuid) params.set("credentialUuid", options.credentialUuid);
4692
+ if (options.loginHint) params.set("loginHint", options.loginHint);
4693
+ if (options.redirect) params.set("redirect", options.redirect);
4694
+ const qs = params.toString();
4695
+ return qs ? `?${qs}` : "";
4811
4696
  }
4812
4697
  var OAuthConnectionsApi = class extends BaseApiClient {
4813
- /**
4814
- * Get the connection status for an OAuth provider
4815
- */
4816
4698
  async getConnectionStatus(providerSlug) {
4817
4699
  const path = getOAuthPath(providerSlug, "status");
4818
4700
  return this.fetchRoot(path);
4819
4701
  }
4820
- /**
4821
- * Get the authorization URL to start OAuth flow
4822
- */
4823
- async getAuthorizationUrl(providerSlug) {
4824
- const path = getOAuthPath(providerSlug, "authorize");
4702
+ async listAccounts(providerSlug) {
4703
+ const path = getOAuthPath(providerSlug, "accounts");
4825
4704
  return this.fetchRoot(path);
4826
4705
  }
4827
- /**
4828
- * Disconnect an OAuth provider
4829
- */
4830
- async disconnect(providerSlug) {
4706
+ async getAuthorizationUrl(providerSlug, options) {
4707
+ const path = getOAuthPath(providerSlug, "authorize") + buildAuthorizeQuery(options);
4708
+ return this.fetchRoot(path);
4709
+ }
4710
+ async disconnect(providerSlug, credentialUuid) {
4831
4711
  const path = getOAuthPath(providerSlug, "disconnect");
4832
- return this.fetchRoot(path, { method: "DELETE" });
4712
+ const qs = credentialUuid ? `?credentialUuid=${encodeURIComponent(credentialUuid)}` : "";
4713
+ return this.fetchRoot(`${path}${qs}`, { method: "DELETE" });
4833
4714
  }
4834
4715
  };
4835
4716
  var OAuthApi = class extends BaseApiClient {
4836
- /**
4837
- * Get all available OAuth/API key scopes with metadata.
4838
- *
4839
- * This returns the full scope definitions from the backend,
4840
- * ensuring the UI always shows the correct scopes.
4841
- */
4842
4717
  async getAvailableScopes() {
4843
4718
  return this.fetch("oauth/scopes");
4844
4719
  }
4845
- /**
4846
- * Create an authorization code for OAuth flow
4847
- * This is called after the user approves the authorization request
4848
- */
4849
4720
  async authorize(request) {
4850
4721
  return this.fetch("oauth/authorize", {
4851
4722
  method: "POST",
4852
4723
  body: JSON.stringify(request)
4853
4724
  });
4854
4725
  }
4855
- /**
4856
- * Exchange authorization code for access token
4857
- */
4858
4726
  async exchangeOAuthToken(request) {
4859
4727
  const formData = new URLSearchParams();
4860
4728
  formData.append("grant_type", request.grant_type);
@@ -5148,6 +5016,37 @@ var PersonasApi = class extends BaseApiClient {
5148
5016
  }
5149
5017
  };
5150
5018
 
5019
+ // src/api/queries.ts
5020
+ var QueriesApi = class extends BaseApiClient {
5021
+ /** Queryable namespace: native fields, operators per type, DataType record fields. */
5022
+ async getQueryFields(wid) {
5023
+ return this.fetch(`w/${wid}/queries/fields`, {
5024
+ method: "GET"
5025
+ });
5026
+ }
5027
+ /** Structure / field / access / cost validation without execution. */
5028
+ async validateQuery(wid, query) {
5029
+ return this.fetch(`w/${wid}/queries/validate`, {
5030
+ method: "POST",
5031
+ body: JSON.stringify({ query })
5032
+ });
5033
+ }
5034
+ /** Bounded sample run (limit capped server-side). */
5035
+ async previewQuery(wid, query, mode) {
5036
+ return this.fetch(`w/${wid}/queries/preview`, {
5037
+ method: "POST",
5038
+ body: JSON.stringify({ query, mode })
5039
+ });
5040
+ }
5041
+ /** Execute a query (rows / count / aggregate). */
5042
+ async runQuery(wid, query, mode) {
5043
+ return this.fetch(`w/${wid}/queries/run`, {
5044
+ method: "POST",
5045
+ body: JSON.stringify({ query, mode })
5046
+ });
5047
+ }
5048
+ };
5049
+
5151
5050
  // src/api/qualifications.ts
5152
5051
  var QualificationsApi = class extends BaseApiClient {
5153
5052
  /** List qualifications in a workspace, paginated. */
@@ -5199,6 +5098,9 @@ var QualificationsApi = class extends BaseApiClient {
5199
5098
  async listTestChatRuns(wid, workflowId, params) {
5200
5099
  const query = new URLSearchParams();
5201
5100
  if (params?.scenarioId !== void 0) query.set("scenarioId", String(params.scenarioId));
5101
+ if (params?.assistantChatModelId !== void 0) {
5102
+ query.set("assistantChatModelId", params.assistantChatModelId);
5103
+ }
5202
5104
  if (params?.limit !== void 0) query.set("limit", String(params.limit));
5203
5105
  const qs = query.toString() ? `?${query.toString()}` : "";
5204
5106
  return this.fetch(
@@ -5633,6 +5535,112 @@ var SitesApi = class extends BaseApiClient {
5633
5535
  async getSite(wid, id) {
5634
5536
  return this.fetch(`w/${wid}/sites/${id}`);
5635
5537
  }
5538
+ /** Get a site's sharing settings. */
5539
+ async getSiteSharing(wid, siteId) {
5540
+ return this.fetch(`w/${wid}/sites/${siteId}/sharing`);
5541
+ }
5542
+ /** Update a site's sharing settings. */
5543
+ async updateSiteSharing(wid, siteId, data) {
5544
+ return this.fetch(`w/${wid}/sites/${siteId}/sharing`, {
5545
+ method: "PUT",
5546
+ body: JSON.stringify(data)
5547
+ });
5548
+ }
5549
+ /** Get a site's source tree. */
5550
+ async getSiteSource(wid, siteId) {
5551
+ return this.fetch(`w/${wid}/sites/${siteId}/source`);
5552
+ }
5553
+ /** Starter templates the caller may seed (superuser-only ones filtered server-side). */
5554
+ async getSiteSourceTemplates(wid, siteId) {
5555
+ return this.fetch(`w/${wid}/sites/${siteId}/source/templates`);
5556
+ }
5557
+ /** Create a site's source tree with starter files if it does not exist. */
5558
+ async createSiteSource(wid, siteId) {
5559
+ return this.fetch(`w/${wid}/sites/${siteId}/source`, {
5560
+ method: "POST"
5561
+ });
5562
+ }
5563
+ /** Build a site's source without publishing. */
5564
+ async buildSiteSource(wid, siteId) {
5565
+ return this.fetch(`w/${wid}/sites/${siteId}/source/build`, {
5566
+ method: "POST"
5567
+ });
5568
+ }
5569
+ /**
5570
+ * Build and publish a site's source. Optionally label the published version
5571
+ * with a `name` and `note`; both default to null (the UI then shows
5572
+ * "Version {version}").
5573
+ */
5574
+ async publishSiteSource(wid, siteId, options) {
5575
+ return this.fetch(`w/${wid}/sites/${siteId}/source/publish`, {
5576
+ method: "POST",
5577
+ body: JSON.stringify({
5578
+ name: options?.name ?? null,
5579
+ note: options?.note ?? null
5580
+ })
5581
+ });
5582
+ }
5583
+ /**
5584
+ * Reset a site's source files: load a starter template and/or wipe existing
5585
+ * files. `template` selects which starter to seed when `loadDefaults` is set
5586
+ * (defaults to "hello-world"; "patient-enrollment" is the other built-in).
5587
+ */
5588
+ async resetSiteSource(wid, siteId, options) {
5589
+ return this.fetch(`w/${wid}/sites/${siteId}/source/reset`, {
5590
+ method: "POST",
5591
+ body: JSON.stringify({
5592
+ load_defaults: options.loadDefaults,
5593
+ delete_existing: options.deleteExisting,
5594
+ ...options.template ? { template: options.template } : {}
5595
+ })
5596
+ });
5597
+ }
5598
+ /**
5599
+ * Re-point the published release to a prior version from the history. A pure
5600
+ * pointer move (no rebuild); the other versions stay in the history.
5601
+ */
5602
+ async rollbackSiteSource(wid, siteId, releaseUuid) {
5603
+ return this.fetch(`w/${wid}/sites/${siteId}/source/rollback`, {
5604
+ method: "POST",
5605
+ body: JSON.stringify({ release_uuid: releaseUuid })
5606
+ });
5607
+ }
5608
+ /**
5609
+ * Export the site's source tree as a ZIP archive (editor-gated server-side).
5610
+ * Returns the raw archive bytes for the caller to save.
5611
+ */
5612
+ async downloadSiteSourceZip(wid, siteId) {
5613
+ const response = await this.fetchRaw(`w/${wid}/sites/${siteId}/source/download`);
5614
+ return response.blob();
5615
+ }
5616
+ /**
5617
+ * Replace the site's source tree with the contents of an uploaded ZIP
5618
+ * (clears the existing source first, like a reset that loads a template).
5619
+ */
5620
+ async importSiteSourceZip(wid, siteId, file) {
5621
+ const form = new FormData();
5622
+ form.append("file", file, "source.zip");
5623
+ return this.fetch(`w/${wid}/sites/${siteId}/source/import`, {
5624
+ method: "POST",
5625
+ body: form
5626
+ });
5627
+ }
5628
+ /**
5629
+ * Get a theme's settings schema, the site's saved values, and capabilities.
5630
+ * Pass `theme` to resolve the schema for a theme other than the saved one
5631
+ * (e.g. one the builder has selected but not yet saved).
5632
+ */
5633
+ async getThemeSettings(wid, siteId, theme) {
5634
+ const query = theme ? `?theme=${encodeURIComponent(theme)}` : "";
5635
+ return this.fetch(`w/${wid}/sites/${siteId}/theme-settings${query}`);
5636
+ }
5637
+ /** Save values for the active theme's settings (validated against the schema). */
5638
+ async updateThemeSettings(wid, siteId, values) {
5639
+ return this.fetch(`w/${wid}/sites/${siteId}/theme-settings`, {
5640
+ method: "PUT",
5641
+ body: JSON.stringify({ values })
5642
+ });
5643
+ }
5636
5644
  /** Get a single site by UUID. */
5637
5645
  async getSiteByUuid(wid, uuid) {
5638
5646
  return this.fetch(`s/${wid}/${uuid}`);
@@ -5848,6 +5856,28 @@ var SubscriptionsApi = class extends BaseApiClient {
5848
5856
  async getSubscriptions() {
5849
5857
  return this.fetch("subscriptions");
5850
5858
  }
5859
+ /**
5860
+ * Create a Stripe Checkout session to purchase an organization plan.
5861
+ * Returns the checkout URL to open in a browser. The organization, billing
5862
+ * customer, and subscription are created on payment by the checkout
5863
+ * completion handler.
5864
+ */
5865
+ async createCheckoutSession(productId, planPeriod = "month") {
5866
+ return this.fetch(`subscriptions/checkout-session`, {
5867
+ method: "POST",
5868
+ credentials: "include",
5869
+ body: JSON.stringify({ productId, planPeriod }),
5870
+ headers: { "Content-Type": "application/json" }
5871
+ });
5872
+ }
5873
+ /**
5874
+ * List self-service, purchasable plans (org or workspace). Only plans with a
5875
+ * paid Stripe price are returned. No auth required.
5876
+ */
5877
+ async listSelfServeProducts(productType) {
5878
+ const qs = productType ? `?product_type=${productType}` : "";
5879
+ return this.fetch(`products/self-service${qs}`);
5880
+ }
5851
5881
  /** List all subscriptions associated with a workspace. */
5852
5882
  async getWorkspaceSubscriptions(wid) {
5853
5883
  return this.fetch(`w/${wid}/subscriptions`);
@@ -5888,6 +5918,10 @@ var SubscriptionsApi = class extends BaseApiClient {
5888
5918
  }
5889
5919
  });
5890
5920
  }
5921
+ /** List line items for a subscription. */
5922
+ async getSubscriptionItems(subscriptionId) {
5923
+ return this.fetch(`subscriptions/${subscriptionId}/items`);
5924
+ }
5891
5925
  /** Purchase extra credits on a subscription (org-level). */
5892
5926
  async purchaseCredits(subscriptionId, amountCents) {
5893
5927
  return this.fetch(`subscriptions/${subscriptionId}/purchase-credits`, {
@@ -5989,6 +6023,16 @@ var SupportRequestsApi = class extends BaseApiClient {
5989
6023
  body: JSON.stringify(data)
5990
6024
  });
5991
6025
  }
6026
+ /**
6027
+ * Reopen a resolved support request (e.g. staff resolved it prematurely).
6028
+ * The server rejects requests that are not in the `resolved` state.
6029
+ */
6030
+ async reopenWorkspaceSupportRequest(workspaceUuid, uuid, data = {}) {
6031
+ return this.fetch(`w/${workspaceUuid}/support-requests/${uuid}/reopen`, {
6032
+ method: "POST",
6033
+ body: JSON.stringify(data)
6034
+ });
6035
+ }
5992
6036
  /**
5993
6037
  * Record a click on a pushed resource (Proactive Support). For a
5994
6038
  * manager_prompt, pass the Manager Chat UUID it opened so the
@@ -6143,6 +6187,12 @@ var TasksApi = class extends BaseApiClient {
6143
6187
  if (options.workflowId) {
6144
6188
  params.append("workflow_id", options.workflowId.toString());
6145
6189
  }
6190
+ if (options.sortBy) {
6191
+ params.append("sortBy", options.sortBy);
6192
+ }
6193
+ if (options.sortOrder) {
6194
+ params.append("sortOrder", options.sortOrder);
6195
+ }
6146
6196
  return this.fetch(
6147
6197
  `w/${wid}/tasks${params.toString() ? `?${params.toString()}` : ""}`
6148
6198
  );
@@ -6513,9 +6563,17 @@ var WorkflowsApi = class extends BaseApiClient {
6513
6563
  `w/${wid}/workflows/activity/batch?${params.toString()}`
6514
6564
  );
6515
6565
  }
6516
- /** Get the Mermaid diagram representation of a workflow. */
6517
- async getWorkflowDiagram(wid, id) {
6518
- return this.fetch(`w/${wid}/workflows/${id}/diagram`);
6566
+ /**
6567
+ * Get the Mermaid diagram representation of a workflow.
6568
+ *
6569
+ * By default only active tasks are rendered. Pass `includeArchived: true`
6570
+ * to also render archived tasks (distinctly styled). `taskCount` is always
6571
+ * the total (active + archived); `archivedTaskCount` breaks out the archived
6572
+ * portion so the active count can be derived.
6573
+ */
6574
+ async getWorkflowDiagram(wid, id, options = {}) {
6575
+ const query = options.includeArchived ? "?include_archived=true" : "";
6576
+ return this.fetch(`w/${wid}/workflows/${id}/diagram${query}`);
6519
6577
  }
6520
6578
  /**
6521
6579
  * Get workflow thumbnail URL.
@@ -6909,6 +6967,20 @@ var BulkMemberResultStatus = {
6909
6967
  updated: "updated",
6910
6968
  failed: "failed"
6911
6969
  };
6970
+ var MemberImportMatchInfoMatchType = {
6971
+ external_id: "external_id",
6972
+ email: "email",
6973
+ phone: "phone",
6974
+ account_email: "account_email",
6975
+ account_phone: "account_phone"
6976
+ };
6977
+ var MemberImportPreviewRowAction = {
6978
+ create: "create",
6979
+ update: "update",
6980
+ unchanged: "unchanged",
6981
+ conflict: "conflict",
6982
+ error: "error"
6983
+ };
6912
6984
 
6913
6985
  // src/types/member-types.ts
6914
6986
  var MemberType = /* @__PURE__ */ ((MemberType2) => {
@@ -6952,6 +7024,9 @@ var EventRuleObjectType = /* @__PURE__ */ ((EventRuleObjectType2) => {
6952
7024
  })(EventRuleObjectType || {});
6953
7025
  var EventRuleEventType = /* @__PURE__ */ ((EventRuleEventType2) => {
6954
7026
  EventRuleEventType2["TASK_EXECUTE"] = "task:execute";
7027
+ EventRuleEventType2["TASK_ENTER"] = "task:enter";
7028
+ EventRuleEventType2["TASK_COMMAND"] = "task:command";
7029
+ EventRuleEventType2["TASK_EXIT"] = "task:exit";
6955
7030
  EventRuleEventType2["MEMBER_JOINED"] = "workspace:member_joined";
6956
7031
  EventRuleEventType2["MEMBER_LEFT"] = "workspace:member_left";
6957
7032
  EventRuleEventType2["DATA_RECORD_CREATED"] = "data_record:created";
@@ -6985,6 +7060,7 @@ var EventRuleActionType = /* @__PURE__ */ ((EventRuleActionType2) => {
6985
7060
  EventRuleActionType2["SWITCH_TASK_ACTION"] = "task:switch";
6986
7061
  EventRuleActionType2["ASSISTANT_MESSAGE"] = "assistant:message";
6987
7062
  EventRuleActionType2["FORM_FIELD_UPDATE"] = "form:update_field";
7063
+ EventRuleActionType2["CEL_MUTATE"] = "record:cel_mutate";
6988
7064
  EventRuleActionType2["MESSAGE_VALIDATION"] = "message:validation";
6989
7065
  EventRuleActionType2["CHAT_CREATE"] = "chat:create";
6990
7066
  EventRuleActionType2["CHAT_CONTINUE"] = "chat:continue";
@@ -7135,7 +7211,6 @@ var ModelProvider = {
7135
7211
  aws: "aws",
7136
7212
  elevenlabs: "elevenlabs",
7137
7213
  deepgram: "deepgram",
7138
- pocket: "pocket",
7139
7214
  xai: "xai",
7140
7215
  custom: "custom"
7141
7216
  };
@@ -7165,7 +7240,10 @@ var TTS_MODEL_ELEVENLABS_MULTILINGUAL = "elevenlabs:tts:eleven_multilingual_v2";
7165
7240
  var TTS_MODEL_DEEPGRAM_AURA_2 = "deepgram:tts:aura-2";
7166
7241
  var TTS_MODEL_AWS_POLLY_GENERATIVE = "aws:tts:polly-generative";
7167
7242
  var TTS_MODEL_AWS_POLLY_NEURAL = "aws:tts:polly-neural";
7168
- var TTS_MODEL_POCKET = "pocket:tts:default";
7243
+
7244
+ // src/types/pids-types.ts
7245
+ var PIDS_DISPOSITIONS = ["true_positive", "false_positive", "needs_more_context"];
7246
+ var PIDS_SOURCES = ["scheduled", "backfill", "pre_llm"];
7169
7247
 
7170
7248
  // src/types/fhir-connection-types.ts
7171
7249
  var FhirVendor = /* @__PURE__ */ ((FhirVendor2) => {
@@ -7863,6 +7941,25 @@ var ExperimentsApi = class extends BaseApiClient {
7863
7941
  }
7864
7942
  };
7865
7943
 
7944
+ // src/api/patientsync-connections.ts
7945
+ var PatientSyncConnectionsApi = class extends BaseApiClient {
7946
+ /** Create or update the workspace's PatientSync connection (singleton). */
7947
+ async configurePatientSync(wid, data) {
7948
+ return this.fetch(
7949
+ `w/${wid}/app-connections/patientsync/configure`,
7950
+ { method: "POST", body: JSON.stringify(data) }
7951
+ );
7952
+ }
7953
+ /** Read the PatientSync connection status (never returns the API key). */
7954
+ async getPatientSyncStatus(wid) {
7955
+ return this.fetch(`w/${wid}/app-connections/patientsync/status`);
7956
+ }
7957
+ /** Delete the workspace's PatientSync connection. */
7958
+ async deletePatientSyncConnection(wid) {
7959
+ return this.fetch(`w/${wid}/app-connections/patientsync/`, { method: "DELETE" });
7960
+ }
7961
+ };
7962
+
7866
7963
  // src/app-context.ts
7867
7964
  function formatAppContextAsMarkdown(context) {
7868
7965
  if (!context) {
@@ -7953,6 +8050,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
7953
8050
  events: new EventsApi(apiKey, baseUrl, customFetch),
7954
8051
  experiments: new ExperimentsApi(apiKey, baseUrl, customFetch),
7955
8052
  fhirConnections: new FhirConnectionsApi(apiKey, baseUrl, customFetch),
8053
+ patientSyncConnections: new PatientSyncConnectionsApi(apiKey, baseUrl, customFetch),
7956
8054
  healthie: new HealthieApi(apiKey, baseUrl, customFetch),
7957
8055
  hubspot: new HubspotApi(apiKey, baseUrl, customFetch),
7958
8056
  features: new FeaturesApi(apiKey, baseUrl, customFetch),
@@ -7976,6 +8074,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
7976
8074
  pronunciations: new PronunciationsApi(apiKey, baseUrl, customFetch),
7977
8075
  qualifications: new QualificationsApi(apiKey, baseUrl, customFetch),
7978
8076
  personas: new PersonasApi(apiKey, baseUrl, customFetch),
8077
+ queries: new QueriesApi(apiKey, baseUrl, customFetch),
7979
8078
  reports: new ReportsApi(apiKey, baseUrl, customFetch),
7980
8079
  salesforce: new SalesforceApi(apiKey, baseUrl, customFetch),
7981
8080
  sites: new SitesApi(apiKey, baseUrl, customFetch),
@@ -8020,6 +8119,7 @@ var WORKSPACE_METHOD_NAMES = [
8020
8119
  "cancelAgentTask",
8021
8120
  "cancelAssignment",
8022
8121
  "cancelCalendarEvent",
8122
+ "cancelChatCallback",
8023
8123
  "cancelCredentialUpdateInvite",
8024
8124
  "checkAvailability",
8025
8125
  "checkSiteDomainAvailability",
@@ -8034,12 +8134,14 @@ var WORKSPACE_METHOD_NAMES = [
8034
8134
  "commentOnWorkspaceSupportRequest",
8035
8135
  "configureConfluence",
8036
8136
  "configureHealthie",
8137
+ "configurePatientSync",
8037
8138
  "configureHubspot",
8038
8139
  "configureMondayConnection",
8039
8140
  "configureSalesforce",
8040
8141
  "convertEmail",
8041
8142
  "convertFile",
8042
8143
  "crawlSite",
8144
+ "createAbility",
8043
8145
  "createAccessGrant",
8044
8146
  "createAgent",
8045
8147
  "createApiKey",
@@ -8063,6 +8165,7 @@ var WORKSPACE_METHOD_NAMES = [
8063
8165
  "createExperiment",
8064
8166
  "createExperimentAssignment",
8065
8167
  "createExperimentGroup",
8168
+ "convertMemberFilterToQuery",
8066
8169
  "createFhirConnection",
8067
8170
  "createFile",
8068
8171
  "createFileLabel",
@@ -8103,6 +8206,7 @@ var WORKSPACE_METHOD_NAMES = [
8103
8206
  "createWorkspaceMember",
8104
8207
  "createWorkspaceSupportRequest",
8105
8208
  "deactivateWorkflowVersion",
8209
+ "deleteAbility",
8106
8210
  "deleteAgent",
8107
8211
  "deleteAssignment",
8108
8212
  "deleteCalendar",
@@ -8126,6 +8230,7 @@ var WORKSPACE_METHOD_NAMES = [
8126
8230
  "deleteExperimentAssignment",
8127
8231
  "deleteExperimentGroup",
8128
8232
  "deleteFhirConnection",
8233
+ "deletePatientSyncConnection",
8129
8234
  "deleteFile",
8130
8235
  "deleteFileLabel",
8131
8236
  "deleteFolder",
@@ -8226,6 +8331,7 @@ var WORKSPACE_METHOD_NAMES = [
8226
8331
  "generateICalToken",
8227
8332
  "generateSiteMediaUploadUrl",
8228
8333
  "getAIUsageReport",
8334
+ "getAbilityType",
8229
8335
  "getAbilityTypes",
8230
8336
  "getAccessGrant",
8231
8337
  "getAccessGrants",
@@ -8260,6 +8366,7 @@ var WORKSPACE_METHOD_NAMES = [
8260
8366
  "getCelContext",
8261
8367
  "getChat",
8262
8368
  "getChatAssignmentTasks",
8369
+ "getChatCallbacks",
8263
8370
  "getChatEmails",
8264
8371
  "getChatFilter",
8265
8372
  "getChatFilterByUuid",
@@ -8326,6 +8433,7 @@ var WORKSPACE_METHOD_NAMES = [
8326
8433
  "getHealthieAvailableSlots",
8327
8434
  "getHealthieReconciliationMatches",
8328
8435
  "getHealthieStatus",
8436
+ "getPatientSyncStatus",
8329
8437
  "getHubspotContactProperties",
8330
8438
  "getHubspotManagedRules",
8331
8439
  "getHubspotReconciliationMatches",
@@ -8371,6 +8479,7 @@ var WORKSPACE_METHOD_NAMES = [
8371
8479
  "getMemberRole",
8372
8480
  "getMemberRoleByUuid",
8373
8481
  "getMemberRoles",
8482
+ "getMemberSyncLinks",
8374
8483
  "getMemberSyncSummary",
8375
8484
  "getMemberUsage",
8376
8485
  "getMembersMessageActivity",
@@ -8513,11 +8622,14 @@ var WORKSPACE_METHOD_NAMES = [
8513
8622
  "linkMemberToMonday",
8514
8623
  "linkMemberToSalesforce",
8515
8624
  "linkPhoneNumber",
8625
+ "listAbilities",
8626
+ "listAgentAbilities",
8516
8627
  "listAppConnections",
8517
8628
  "listAvailableAppConnections",
8518
8629
  "listConfluencePages",
8519
8630
  "listConfluenceSpaces",
8520
8631
  "listConnectionMemberFieldKeys",
8632
+ "setDefaultGooglePlatformAccount",
8521
8633
  "listGoogleCalendars",
8522
8634
  "listHealthieAppointmentTypes",
8523
8635
  "listHealthiePatients",
@@ -8532,6 +8644,7 @@ var WORKSPACE_METHOD_NAMES = [
8532
8644
  "markEmailAsRead",
8533
8645
  "markEmailAsUnread",
8534
8646
  "markNotificationAsRead",
8647
+ "previewImportMembers",
8535
8648
  "previewImportWorkspace",
8536
8649
  "previewSchedule",
8537
8650
  "previewTTS",
@@ -8606,6 +8719,7 @@ var WORKSPACE_METHOD_NAMES = [
8606
8719
  "unlinkMemberFromMonday",
8607
8720
  "unlinkMemberFromSalesforce",
8608
8721
  "unregisterPushSubscription",
8722
+ "updateAbility",
8609
8723
  "updateAgent",
8610
8724
  "updateAssignment",
8611
8725
  "updateCalendar",
@@ -8732,6 +8846,7 @@ function bindAgentsMethods(target, agents) {
8732
8846
  target.archiveAgent = agents.archiveAgent.bind(agents);
8733
8847
  target.unarchiveAgent = agents.unarchiveAgent.bind(agents);
8734
8848
  target.resolveAgentTools = agents.resolveAgentTools.bind(agents);
8849
+ target.listAgentAbilities = agents.listAgentAbilities.bind(agents);
8735
8850
  }
8736
8851
 
8737
8852
  // src/client/bindings/tasks.ts
@@ -8745,12 +8860,19 @@ function bindTasksMethods(target, tasks, abilities) {
8745
8860
  target.unarchiveTask = tasks.unarchiveTask.bind(tasks);
8746
8861
  target.cloneTask = tasks.cloneTask.bind(tasks);
8747
8862
  target.getAbilityTypes = abilities.getAbilityTypes.bind(abilities);
8863
+ target.getAbilityType = abilities.getAbilityType.bind(abilities);
8864
+ target.listAbilities = abilities.listAbilities.bind(abilities);
8865
+ target.createAbility = abilities.createAbility.bind(abilities);
8866
+ target.updateAbility = abilities.updateAbility.bind(abilities);
8867
+ target.deleteAbility = abilities.deleteAbility.bind(abilities);
8748
8868
  }
8749
8869
 
8750
8870
  // src/client/bindings/chats.ts
8751
8871
  function bindChatsMethods(target, chats) {
8752
8872
  target.getChats = chats.getChats.bind(chats);
8753
8873
  target.getChat = chats.getChat.bind(chats);
8874
+ target.getChatCallbacks = chats.getChatCallbacks.bind(chats);
8875
+ target.cancelChatCallback = chats.cancelChatCallback.bind(chats);
8754
8876
  target.getChatTokenUsage = chats.getChatTokenUsage.bind(chats);
8755
8877
  target.getChatTodos = chats.getChatTodos.bind(chats);
8756
8878
  target.getChatSkills = chats.getChatSkills.bind(chats);
@@ -8800,6 +8922,8 @@ function bindCallsMethods(target, calls, cel) {
8800
8922
  target.initiateCall = calls.initiateCall.bind(calls);
8801
8923
  target.getVoiceToken = calls.getVoiceToken.bind(calls);
8802
8924
  target.getMessageTiming = calls.getMessageTiming.bind(calls);
8925
+ target.listChatRecordings = calls.listChatRecordings.bind(calls);
8926
+ target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
8803
8927
  target.getCelContext = cel.getCelContext.bind(cel);
8804
8928
  }
8805
8929
 
@@ -8842,6 +8966,9 @@ function bindMembersMethods(target, members) {
8842
8966
  target.deleteMember = members.deleteMember.bind(members);
8843
8967
  target.archiveMember = members.archiveMember.bind(members);
8844
8968
  target.unarchiveMember = members.unarchiveMember.bind(members);
8969
+ target.sendMemberPhoneConfirmation = members.sendMemberPhoneConfirmation.bind(members);
8970
+ target.bulkCreateMembers = members.bulkCreateMembers.bind(members);
8971
+ target.previewImportMembers = members.previewImportMembers.bind(members);
8845
8972
  target.importMembers = members.importMembers.bind(members);
8846
8973
  target.exportMembers = members.exportMembers.bind(members);
8847
8974
  target.getMembersMessageActivity = members.getMembersMessageActivity.bind(members);
@@ -8849,6 +8976,7 @@ function bindMembersMethods(target, members) {
8849
8976
  target.getMemberFilter = members.getMemberFilter.bind(members);
8850
8977
  target.createMemberFilter = members.createMemberFilter.bind(members);
8851
8978
  target.updateMemberFilter = members.updateMemberFilter.bind(members);
8979
+ target.convertMemberFilterToQuery = members.convertMemberFilterToQuery.bind(members);
8852
8980
  target.deleteMemberFilter = members.deleteMemberFilter.bind(members);
8853
8981
  target.getMemberFilterCount = members.getMemberFilterCount.bind(members);
8854
8982
  target.getMemberLabels = members.getMemberLabels.bind(members);
@@ -8878,6 +9006,7 @@ function bindMembersMethods(target, members) {
8878
9006
  target.getMemberMemories = members.getMemberMemories.bind(members);
8879
9007
  target.createMemberMemory = members.createMemberMemory.bind(members);
8880
9008
  target.deleteMemberMemory = members.deleteMemberMemory.bind(members);
9009
+ target.getMemberSyncLinks = members.getMemberSyncLinks.bind(members);
8881
9010
  }
8882
9011
 
8883
9012
  // src/client/bindings/workspaces.ts
@@ -9011,6 +9140,19 @@ function bindSitesMethods(target, sites) {
9011
9140
  target.checkSiteSlugAvailability = sites.checkSiteSlugAvailability.bind(sites);
9012
9141
  target.checkSiteDomainAvailability = sites.checkSiteDomainAvailability.bind(sites);
9013
9142
  target.getSite = sites.getSite.bind(sites);
9143
+ target.getSiteSharing = sites.getSiteSharing.bind(sites);
9144
+ target.updateSiteSharing = sites.updateSiteSharing.bind(sites);
9145
+ target.getSiteSource = sites.getSiteSource.bind(sites);
9146
+ target.getSiteSourceTemplates = sites.getSiteSourceTemplates.bind(sites);
9147
+ target.createSiteSource = sites.createSiteSource.bind(sites);
9148
+ target.buildSiteSource = sites.buildSiteSource.bind(sites);
9149
+ target.publishSiteSource = sites.publishSiteSource.bind(sites);
9150
+ target.resetSiteSource = sites.resetSiteSource.bind(sites);
9151
+ target.rollbackSiteSource = sites.rollbackSiteSource.bind(sites);
9152
+ target.downloadSiteSourceZip = sites.downloadSiteSourceZip.bind(sites);
9153
+ target.importSiteSourceZip = sites.importSiteSourceZip.bind(sites);
9154
+ target.getThemeSettings = sites.getThemeSettings.bind(sites);
9155
+ target.updateThemeSettings = sites.updateThemeSettings.bind(sites);
9014
9156
  target.getSiteByUuid = sites.getSiteByUuid.bind(sites);
9015
9157
  target.getSiteRenderedPage = sites.getSiteRenderedPage.bind(sites);
9016
9158
  target.getSiteRenderedMenu = sites.getSiteRenderedMenu.bind(sites);
@@ -9043,6 +9185,7 @@ function bindSitesMethods(target, sites) {
9043
9185
  function bindFilesMethods(target, files) {
9044
9186
  target.getFiles = files.getFiles.bind(files);
9045
9187
  target.getFile = files.getFile.bind(files);
9188
+ target.downloadFilesZip = files.downloadFilesZip.bind(files);
9046
9189
  target.createFile = files.createFile.bind(files);
9047
9190
  target.uploadFile = files.uploadFile.bind(files);
9048
9191
  target.updateFile = files.updateFile.bind(files);
@@ -9084,6 +9227,7 @@ function bindEventsMethods(target, events) {
9084
9227
  target.createEventRule = events.createEventRule.bind(events);
9085
9228
  target.updateEventRule = events.updateEventRule.bind(events);
9086
9229
  target.deleteEventRule = events.deleteEventRule.bind(events);
9230
+ target.testWebhook = events.testWebhook.bind(events);
9087
9231
  target.reorderEventRules = events.reorderEventRules.bind(events);
9088
9232
  target.getWebhookLogs = events.getWebhookLogs.bind(events);
9089
9233
  target.getRuleExecutions = events.getRuleExecutions.bind(events);
@@ -9299,6 +9443,8 @@ function bindBillingMethods(target, apiKeys, subscriptions, reports) {
9299
9443
  target.updateSubscription = subscriptions.updateSubscription.bind(subscriptions);
9300
9444
  target.addWorkspaceToSubscription = subscriptions.addWorkspaceToSubscription.bind(subscriptions);
9301
9445
  target.purchaseCredits = subscriptions.purchaseCredits.bind(subscriptions);
9446
+ target.createCheckoutSession = subscriptions.createCheckoutSession.bind(subscriptions);
9447
+ target.listSelfServeProducts = subscriptions.listSelfServeProducts.bind(subscriptions);
9302
9448
  target.getAIUsageReport = reports.getAIUsageReport.bind(reports);
9303
9449
  target.getSMSUsageReport = reports.getSMSUsageReport.bind(reports);
9304
9450
  target.getPhoneUsageReport = reports.getPhoneUsageReport.bind(reports);
@@ -9332,12 +9478,13 @@ function bindAppsMethods(target, apps, builders, inquiries, oauth, oauthConnecti
9332
9478
  target.exchangeOAuthToken = oauth.exchangeOAuthToken.bind(oauth);
9333
9479
  target.getAvailableScopes = oauth.getAvailableScopes.bind(oauth);
9334
9480
  target.getOAuthConnectionStatus = oauthConnections.getConnectionStatus.bind(oauthConnections);
9481
+ target.listOAuthAccounts = oauthConnections.listAccounts.bind(oauthConnections);
9335
9482
  target.getOAuthAuthorizationUrl = oauthConnections.getAuthorizationUrl.bind(oauthConnections);
9336
9483
  target.disconnectOAuthProvider = oauthConnections.disconnect.bind(oauthConnections);
9337
9484
  }
9338
9485
 
9339
9486
  // src/client/bindings/integrations.ts
9340
- function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
9487
+ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, salesforce, hubspot, appConnections, connectionSync, confluence) {
9341
9488
  target.getMondayBoards = mondayIntegration.getBoards.bind(mondayIntegration);
9342
9489
  target.getMondayBoardColumns = mondayIntegration.getBoardColumns.bind(mondayIntegration);
9343
9490
  target.getMondayBoardGroups = mondayIntegration.getBoardGroups.bind(mondayIntegration);
@@ -9422,6 +9569,9 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
9422
9569
  target.fhirGetEncounterSyncRuns = fhirConnections.fhirGetEncounterSyncRuns.bind(fhirConnections);
9423
9570
  target.fhirRefreshEncounterPatient = fhirConnections.fhirRefreshEncounterPatient.bind(fhirConnections);
9424
9571
  target.fhirBackfillEncounterSync = fhirConnections.fhirBackfillEncounterSync.bind(fhirConnections);
9572
+ target.configurePatientSync = patientSyncConnections.configurePatientSync.bind(patientSyncConnections);
9573
+ target.getPatientSyncStatus = patientSyncConnections.getPatientSyncStatus.bind(patientSyncConnections);
9574
+ target.deletePatientSyncConnection = patientSyncConnections.deletePatientSyncConnection.bind(patientSyncConnections);
9425
9575
  target.configureHealthie = healthie.configureHealthie.bind(healthie);
9426
9576
  target.getHealthieStatus = healthie.getHealthieStatus.bind(healthie);
9427
9577
  target.listHealthieProviders = healthie.listHealthieProviders.bind(healthie);
@@ -9496,6 +9646,7 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
9496
9646
  target.updatePlatformApp = appConnections.updatePlatformApp.bind(appConnections);
9497
9647
  target.deletePlatformApp = appConnections.deletePlatformApp.bind(appConnections);
9498
9648
  target.listConnectionMemberFieldKeys = appConnections.listConnectionMemberFieldKeys.bind(appConnections);
9649
+ target.setDefaultGooglePlatformAccount = appConnections.setDefaultGooglePlatformAccount.bind(appConnections);
9499
9650
  }
9500
9651
 
9501
9652
  // src/client/bindings/operator-groups.ts
@@ -9533,6 +9684,8 @@ function bindOrgMethods(target, org) {
9533
9684
  target.updateBusinessProfile = org.updateBusinessProfile.bind(org);
9534
9685
  target.submitBusinessProfile = org.submitBusinessProfile.bind(org);
9535
9686
  target.cancelBusinessProfile = org.cancelBusinessProfile.bind(org);
9687
+ target.createOrganizationWorkspace = org.createOrganizationWorkspace.bind(org);
9688
+ target.getOrgBillingCustomer = org.getOrgBillingCustomer.bind(org);
9536
9689
  }
9537
9690
 
9538
9691
  // src/client/bindings/pronunciations.ts
@@ -9612,6 +9765,14 @@ function bindPersonasMethods(target, personas) {
9612
9765
  target.deletePersona = personas.deletePersona.bind(personas);
9613
9766
  }
9614
9767
 
9768
+ // src/client/bindings/queries.ts
9769
+ function bindQueriesMethods(target, queries) {
9770
+ target.getQueryFields = queries.getQueryFields.bind(queries);
9771
+ target.validateQuery = queries.validateQuery.bind(queries);
9772
+ target.previewQuery = queries.previewQuery.bind(queries);
9773
+ target.runQuery = queries.runQuery.bind(queries);
9774
+ }
9775
+
9615
9776
  // src/client/bindings/customers.ts
9616
9777
  function bindCustomersMethods(target, customers) {
9617
9778
  target.getMyCustomers = customers.getMyCustomers.bind(customers);
@@ -9658,6 +9819,7 @@ function bindSupportRequestMethods(target, supportRequests) {
9658
9819
  target.createWorkspaceSupportRequest = supportRequests.createWorkspaceSupportRequest.bind(supportRequests);
9659
9820
  target.commentOnWorkspaceSupportRequest = supportRequests.commentOnWorkspaceSupportRequest.bind(supportRequests);
9660
9821
  target.closeWorkspaceSupportRequest = supportRequests.closeWorkspaceSupportRequest.bind(supportRequests);
9822
+ target.reopenWorkspaceSupportRequest = supportRequests.reopenWorkspaceSupportRequest.bind(supportRequests);
9661
9823
  target.clickWorkspaceSupportRequestResource = supportRequests.clickWorkspaceSupportRequestResource.bind(supportRequests);
9662
9824
  }
9663
9825
 
@@ -9677,9 +9839,16 @@ var GravityRailClient = class {
9677
9839
  unarchiveTask;
9678
9840
  cloneTask;
9679
9841
  getAbilityTypes;
9842
+ getAbilityType;
9843
+ listAbilities;
9844
+ createAbility;
9845
+ updateAbility;
9846
+ deleteAbility;
9680
9847
  // Chats API
9681
9848
  getChats;
9682
9849
  getChat;
9850
+ getChatCallbacks;
9851
+ cancelChatCallback;
9683
9852
  getChatTokenUsage;
9684
9853
  getChatTodos;
9685
9854
  getChatSkills;
@@ -9726,6 +9895,8 @@ var GravityRailClient = class {
9726
9895
  initiateCall;
9727
9896
  getVoiceToken;
9728
9897
  getMessageTiming;
9898
+ listChatRecordings;
9899
+ getCallRecordingDownloadUrl;
9729
9900
  getCelContext;
9730
9901
  // Data Types API
9731
9902
  getDataTypes;
@@ -9762,6 +9933,9 @@ var GravityRailClient = class {
9762
9933
  deleteMember;
9763
9934
  archiveMember;
9764
9935
  unarchiveMember;
9936
+ sendMemberPhoneConfirmation;
9937
+ bulkCreateMembers;
9938
+ previewImportMembers;
9765
9939
  importMembers;
9766
9940
  exportMembers;
9767
9941
  getMembersMessageActivity;
@@ -9769,6 +9943,7 @@ var GravityRailClient = class {
9769
9943
  getMemberFilter;
9770
9944
  createMemberFilter;
9771
9945
  updateMemberFilter;
9946
+ convertMemberFilterToQuery;
9772
9947
  deleteMemberFilter;
9773
9948
  getMemberFilterCount;
9774
9949
  getMemberLabels;
@@ -9802,6 +9977,8 @@ var GravityRailClient = class {
9802
9977
  getMemberMemories;
9803
9978
  createMemberMemory;
9804
9979
  deleteMemberMemory;
9980
+ // Member Sync Links
9981
+ getMemberSyncLinks;
9805
9982
  // Agent Tasks API (operator-facing async sub-agent inspection/cancel)
9806
9983
  getAgentTasks;
9807
9984
  getAgentTask;
@@ -9816,6 +9993,7 @@ var GravityRailClient = class {
9816
9993
  archiveAgent;
9817
9994
  unarchiveAgent;
9818
9995
  resolveAgentTools;
9996
+ listAgentAbilities;
9819
9997
  // Qualifications API
9820
9998
  getQualifications;
9821
9999
  getQualification;
@@ -9831,6 +10009,11 @@ var GravityRailClient = class {
9831
10009
  evaluateTestChatRun;
9832
10010
  endTestChatRun;
9833
10011
  // Personas API (workspace-scoped test-identity templates)
10012
+ // Unified Query Engine
10013
+ getQueryFields;
10014
+ validateQuery;
10015
+ previewQuery;
10016
+ runQuery;
9834
10017
  listPersonas;
9835
10018
  getPersona;
9836
10019
  createPersona;
@@ -9970,6 +10153,8 @@ var GravityRailClient = class {
9970
10153
  updateBusinessProfile;
9971
10154
  submitBusinessProfile;
9972
10155
  cancelBusinessProfile;
10156
+ createOrganizationWorkspace;
10157
+ getOrgBillingCustomer;
9973
10158
  getVapidPublicKey;
9974
10159
  registerPushSubscription;
9975
10160
  unregisterPushSubscription;
@@ -10047,6 +10232,19 @@ var GravityRailClient = class {
10047
10232
  checkSiteSlugAvailability;
10048
10233
  checkSiteDomainAvailability;
10049
10234
  getSite;
10235
+ getSiteSharing;
10236
+ updateSiteSharing;
10237
+ getSiteSource;
10238
+ getSiteSourceTemplates;
10239
+ createSiteSource;
10240
+ buildSiteSource;
10241
+ publishSiteSource;
10242
+ resetSiteSource;
10243
+ rollbackSiteSource;
10244
+ downloadSiteSourceZip;
10245
+ importSiteSourceZip;
10246
+ getThemeSettings;
10247
+ updateThemeSettings;
10050
10248
  getSiteByUuid;
10051
10249
  getSiteRenderedPage;
10052
10250
  getSiteRenderedMenu;
@@ -10076,6 +10274,7 @@ var GravityRailClient = class {
10076
10274
  // Files API
10077
10275
  getFiles;
10078
10276
  getFile;
10277
+ downloadFilesZip;
10079
10278
  createFile;
10080
10279
  uploadFile;
10081
10280
  updateFile;
@@ -10115,6 +10314,7 @@ var GravityRailClient = class {
10115
10314
  createEventRule;
10116
10315
  updateEventRule;
10117
10316
  deleteEventRule;
10317
+ testWebhook;
10118
10318
  reorderEventRules;
10119
10319
  getWebhookLogs;
10120
10320
  getRuleExecutions;
@@ -10298,6 +10498,8 @@ var GravityRailClient = class {
10298
10498
  updateSubscription;
10299
10499
  addWorkspaceToSubscription;
10300
10500
  purchaseCredits;
10501
+ createCheckoutSession;
10502
+ listSelfServeProducts;
10301
10503
  getAIUsageReport;
10302
10504
  getSMSUsageReport;
10303
10505
  getPhoneUsageReport;
@@ -10328,6 +10530,7 @@ var GravityRailClient = class {
10328
10530
  exchangeOAuthToken;
10329
10531
  getAvailableScopes;
10330
10532
  getOAuthConnectionStatus;
10533
+ listOAuthAccounts;
10331
10534
  getOAuthAuthorizationUrl;
10332
10535
  disconnectOAuthProvider;
10333
10536
  // Integrations API
@@ -10421,6 +10624,9 @@ var GravityRailClient = class {
10421
10624
  fhirRefreshEncounterPatient;
10422
10625
  fhirBackfillEncounterSync;
10423
10626
  // Healthie API
10627
+ configurePatientSync;
10628
+ getPatientSyncStatus;
10629
+ deletePatientSyncConnection;
10424
10630
  configureHealthie;
10425
10631
  getHealthieStatus;
10426
10632
  listHealthieProviders;
@@ -10500,6 +10706,7 @@ var GravityRailClient = class {
10500
10706
  updatePlatformApp;
10501
10707
  deletePlatformApp;
10502
10708
  listConnectionMemberFieldKeys;
10709
+ setDefaultGooglePlatformAccount;
10503
10710
  // Pronunciations API
10504
10711
  getPronunciationEntries;
10505
10712
  createPronunciationEntry;
@@ -10548,6 +10755,7 @@ var GravityRailClient = class {
10548
10755
  createWorkspaceSupportRequest;
10549
10756
  commentOnWorkspaceSupportRequest;
10550
10757
  closeWorkspaceSupportRequest;
10758
+ reopenWorkspaceSupportRequest;
10551
10759
  clickWorkspaceSupportRequestResource;
10552
10760
  constructor(apiKey, baseUrl, customFetch) {
10553
10761
  const apis = createApiModules(apiKey, baseUrl, customFetch);
@@ -10562,6 +10770,7 @@ var GravityRailClient = class {
10562
10770
  bindAgentsMethods(this, apis.agents);
10563
10771
  bindQualificationsMethods(this, apis.qualifications);
10564
10772
  bindPersonasMethods(this, apis.personas);
10773
+ bindQueriesMethods(this, apis.queries);
10565
10774
  bindJourneysMethods(this, apis.journeys);
10566
10775
  bindExperimentsMethods(this, apis.experiments);
10567
10776
  bindOperatorMethods(this, apis.operatorGroups);
@@ -10601,6 +10810,7 @@ var GravityRailClient = class {
10601
10810
  apis.slackApps,
10602
10811
  apis.teamsApps,
10603
10812
  apis.fhirConnections,
10813
+ apis.patientSyncConnections,
10604
10814
  apis.healthie,
10605
10815
  apis.salesforce,
10606
10816
  apis.hubspot,
@@ -10654,23 +10864,30 @@ var GravityRailClient = class {
10654
10864
  });
10655
10865
  }
10656
10866
  /**
10657
- * Set the org token for cross-domain / non-browser clients (e.g. CLI).
10658
- * When set, all API requests include the X-Org-Token header so the backend
10659
- * accepts the request without requiring a browser cookie.
10867
+ * Set the org session credential for cross-domain / non-browser clients (e.g. CLI).
10868
+ * Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still
10869
+ * use X-Org-Token during the migration window.
10660
10870
  *
10661
- * `orgUuid` is the org that issued the token. Pass it so the SDK can
10662
- * detect a stale token (e.g. switching orgs mid-session) and re-fire the
10871
+ * `orgUuid` is the org that issued the session. Pass it so the SDK can
10872
+ * detect a stale session (e.g. switching orgs mid-session) and re-fire the
10663
10873
  * org-auth handler instead of silently 401-ing.
10664
10874
  *
10665
10875
  * Propagates to all API modules.
10666
10876
  */
10667
- setOrgToken(token, orgUuid) {
10877
+ setOrgSession(session, orgUuid) {
10668
10878
  Object.values(this.apis).forEach((api) => {
10669
- if (typeof api.setOrgToken === "function") {
10670
- api.setOrgToken(token, orgUuid);
10879
+ if (typeof api.setOrgSession === "function") {
10880
+ api.setOrgSession(session, orgUuid);
10671
10881
  }
10672
10882
  });
10673
10883
  }
10884
+ /**
10885
+ * @deprecated Legacy compatibility for stateless orgToken JWE credentials.
10886
+ * Prefer setOrgSession() for opaque org browser sessions.
10887
+ */
10888
+ setOrgToken(token, orgUuid) {
10889
+ this.setOrgSession(token, orgUuid);
10890
+ }
10674
10891
  /**
10675
10892
  * Update the API key across all modules.
10676
10893
  * Used after successful re-authentication.
@@ -10721,15 +10938,20 @@ var AbilityTypeSlugs = {
10721
10938
  TOOLKITS: "tools:toolkits",
10722
10939
  WEB_SEARCH: "tools:web_search",
10723
10940
  CONVERSATION_HISTORY: "tools:conversation_history",
10941
+ IMAGE_GENERATION: "tools:image_generation",
10942
+ CONVERSATION_CONTROL: "tools:conversation_control",
10724
10943
  // Integration
10725
10944
  CALENDAR_BOOKING: "integration:calendar_booking",
10726
10945
  FILE_ACCESS: "integration:file_access",
10727
10946
  DATA_ACCESS: "integration:data_access",
10728
10947
  GMAIL: "integration:gmail",
10948
+ GOOGLE_CALENDAR: "integration:google_calendar",
10949
+ GOOGLE_DRIVE: "integration:google_drive",
10729
10950
  CHARLESTON_PMD_PAGING: "integration:charleston_pmd_paging",
10730
10951
  // Communication
10731
10952
  PHONE_CALL_TOOLS: "communication:phone_call_tools",
10732
10953
  SEND_SMS: "communication:send_sms",
10954
+ SEND_WHATSAPP: "communication:send_whatsapp",
10733
10955
  MEMBER_ACCESS: "communication:member_access",
10734
10956
  AUDIO_PLAYBACK: "communication:audio_playback",
10735
10957
  // Oversight
@@ -10738,6 +10960,12 @@ var AbilityTypeSlugs = {
10738
10960
  ESCALATION: "oversight:escalation",
10739
10961
  // Identity
10740
10962
  MEMBER_FIELD_VERIFICATION: "identity:member_field_verification",
10963
+ // Delegation
10964
+ CONTRIBUTOR: "delegation:contributor",
10965
+ // Workflow
10966
+ WORKFLOW_RUN: "workflow:run",
10967
+ // Commerce
10968
+ RESELLER: "commerce:reseller",
10741
10969
  // System (auto-injected, hidden from users)
10742
10970
  USER_MESSAGE_RULES: "system:user_message_rules",
10743
10971
  ASSISTANT_MESSAGE_RULES: "chat:assistant_message_rules",
@@ -10759,7 +10987,6 @@ var TTS_PREVIEW_PROVIDERS = [
10759
10987
  "elevenlabs",
10760
10988
  "google",
10761
10989
  "aws",
10762
- "pocket",
10763
10990
  "deepgram",
10764
10991
  "xai"
10765
10992
  ];
@@ -10774,6 +11001,13 @@ function canPreviewVoice(entity) {
10774
11001
  return TTS_PREVIEW_PROVIDERS.includes(provider);
10775
11002
  }
10776
11003
 
11004
+ // src/types/query-engine-types.ts
11005
+ var QUERY_VALUELESS_OPS = /* @__PURE__ */ new Set([
11006
+ "isEmpty",
11007
+ "notEmpty",
11008
+ "exists"
11009
+ ]);
11010
+
10777
11011
  // src/types/chat-types.ts
10778
11012
  var SMS_DELIVERY_FAILURE_STATUSES = /* @__PURE__ */ new Set([
10779
11013
  "failed",
@@ -10999,21 +11233,16 @@ var CHAT_TYPES = {
10999
11233
  ASSIGNMENT: "assignment",
11000
11234
  MANAGER: "manager",
11001
11235
  CONTRIBUTOR: "contributor",
11002
- DEVELOPER: "developer",
11003
- MEMBER: "member",
11004
- /** @deprecated Use MEMBER instead */
11005
- AGENT: "member",
11006
- /** @deprecated Use MEMBER instead */
11007
- DM: "member"
11236
+ DM: "dm"
11008
11237
  };
11009
11238
  var BUILTIN_ASSISTANT_CHAT_TYPES = /* @__PURE__ */ new Set([
11010
11239
  CHAT_TYPES.MANAGER,
11011
- CHAT_TYPES.CONTRIBUTOR,
11012
- CHAT_TYPES.DEVELOPER
11240
+ CHAT_TYPES.CONTRIBUTOR
11013
11241
  ]);
11242
+ var MEMBER_AGENT_CHAT_TYPES = /* @__PURE__ */ new Set([CHAT_TYPES.DM]);
11014
11243
  var NO_ASSISTANT_PARTICIPANT_CHAT_TYPES = /* @__PURE__ */ new Set([
11015
11244
  ...BUILTIN_ASSISTANT_CHAT_TYPES,
11016
- CHAT_TYPES.MEMBER
11245
+ ...MEMBER_AGENT_CHAT_TYPES
11017
11246
  ]);
11018
11247
  function usesBuiltinAssistant(chatType) {
11019
11248
  return BUILTIN_ASSISTANT_CHAT_TYPES.has(chatType);
@@ -11806,9 +12035,6 @@ var SCOPE_PRESETS = {
11806
12035
  };
11807
12036
 
11808
12037
  export {
11809
- getCookieValue,
11810
- ApiError,
11811
- BaseApiClient,
11812
12038
  AbilitiesApi,
11813
12039
  AccessGrantsApi,
11814
12040
  AgentTasksApi,
@@ -11838,6 +12064,7 @@ export {
11838
12064
  InquiriesApi,
11839
12065
  AppConnectionsApi,
11840
12066
  McpServersApi,
12067
+ MemberImportValidationError,
11841
12068
  MembersApi,
11842
12069
  MilestonesApi,
11843
12070
  MondayIntegrationApi,
@@ -11850,6 +12077,7 @@ export {
11850
12077
  PronunciationsApi,
11851
12078
  PromptsApi,
11852
12079
  PersonasApi,
12080
+ QueriesApi,
11853
12081
  QualificationsApi,
11854
12082
  ReportsApi,
11855
12083
  SalesforceApi,
@@ -11883,6 +12111,8 @@ export {
11883
12111
  encodePermissions,
11884
12112
  Scope,
11885
12113
  BulkMemberResultStatus,
12114
+ MemberImportMatchInfoMatchType,
12115
+ MemberImportPreviewRowAction,
11886
12116
  MemberType,
11887
12117
  McpServerState,
11888
12118
  ToolkitState,
@@ -11918,7 +12148,8 @@ export {
11918
12148
  TTS_MODEL_DEEPGRAM_AURA_2,
11919
12149
  TTS_MODEL_AWS_POLLY_GENERATIVE,
11920
12150
  TTS_MODEL_AWS_POLLY_NEURAL,
11921
- TTS_MODEL_POCKET,
12151
+ PIDS_DISPOSITIONS,
12152
+ PIDS_SOURCES,
11922
12153
  FhirVendor,
11923
12154
  FhirConnectionState,
11924
12155
  FhirClientType,
@@ -11962,6 +12193,7 @@ export {
11962
12193
  bindJourneysMethods,
11963
12194
  bindQualificationsMethods,
11964
12195
  bindPersonasMethods,
12196
+ bindQueriesMethods,
11965
12197
  bindCustomersMethods,
11966
12198
  bindResellersMethods,
11967
12199
  bindPromptsMethods,
@@ -11976,6 +12208,7 @@ export {
11976
12208
  TTS_PREVIEW_PROVIDERS,
11977
12209
  getVoiceModelId,
11978
12210
  canPreviewVoice,
12211
+ QUERY_VALUELESS_OPS,
11979
12212
  SMS_DELIVERY_FAILURE_STATUSES,
11980
12213
  isSMSDeliveryFailureStatus,
11981
12214
  BusinessIndustry,
@@ -12020,4 +12253,4 @@ export {
12020
12253
  ScopeManager,
12021
12254
  SCOPE_PRESETS
12022
12255
  };
12023
- //# sourceMappingURL=chunk-ANY7WLOD.js.map
12256
+ //# sourceMappingURL=chunk-2BJG4GYM.js.map