@gravity-rail/sdk 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/agui.cjs +78 -0
  2. package/dist/agui.cjs.map +1 -0
  3. package/dist/agui.d.cts +13 -0
  4. package/dist/agui.d.ts +13 -0
  5. package/dist/agui.js +48 -0
  6. package/dist/agui.js.map +1 -0
  7. package/dist/audio.cjs +223 -0
  8. package/dist/audio.cjs.map +1 -0
  9. package/dist/audio.d.cts +25 -0
  10. package/dist/audio.d.ts +25 -0
  11. package/dist/audio.js +147 -0
  12. package/dist/audio.js.map +1 -0
  13. package/dist/chunk-BSOOMHW6.js +62 -0
  14. package/dist/chunk-BSOOMHW6.js.map +1 -0
  15. package/dist/{chunk-XRKRVY46.js → chunk-PEWFZXNK.js} +194 -31
  16. package/dist/chunk-PEWFZXNK.js.map +1 -0
  17. package/dist/{index-BhUZfOAG.d.cts → client-CLxHFOeB.d.cts} +310 -1632
  18. package/dist/{index-fPswHAIF.d.ts → client-Dft3Kmkn.d.ts} +310 -1632
  19. package/dist/helpers.cjs +123 -0
  20. package/dist/helpers.cjs.map +1 -0
  21. package/dist/helpers.d.cts +28 -0
  22. package/dist/helpers.d.ts +28 -0
  23. package/dist/helpers.js +92 -0
  24. package/dist/helpers.js.map +1 -0
  25. package/dist/index-CeVDRf6l.d.cts +1607 -0
  26. package/dist/index-D1G8EKz2.d.ts +1607 -0
  27. package/dist/index.cjs +186 -30
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +3 -2
  30. package/dist/index.d.ts +3 -2
  31. package/dist/index.js +1 -1
  32. package/dist/{inquiries-DiTDrTG2.d.cts → inquiries-BIlL6Obb.d.cts} +28 -3
  33. package/dist/{inquiries-DiTDrTG2.d.ts → inquiries-BIlL6Obb.d.ts} +28 -3
  34. package/dist/internal.cjs +195 -30
  35. package/dist/internal.cjs.map +1 -1
  36. package/dist/internal.d.cts +4 -3
  37. package/dist/internal.d.ts +4 -3
  38. package/dist/internal.js +5 -1
  39. package/dist/oauth-client.cjs +78 -0
  40. package/dist/oauth-client.cjs.map +1 -0
  41. package/dist/oauth-client.d.cts +15 -0
  42. package/dist/oauth-client.d.ts +15 -0
  43. package/dist/oauth-client.js +48 -0
  44. package/dist/oauth-client.js.map +1 -0
  45. package/dist/realtime.cjs +637 -0
  46. package/dist/realtime.cjs.map +1 -0
  47. package/dist/realtime.d.cts +94 -0
  48. package/dist/realtime.d.ts +94 -0
  49. package/dist/realtime.js +580 -0
  50. package/dist/realtime.js.map +1 -0
  51. package/dist/schemas.cjs +7 -3
  52. package/dist/schemas.cjs.map +1 -1
  53. package/dist/schemas.d.cts +28 -6
  54. package/dist/schemas.d.ts +28 -6
  55. package/dist/schemas.js +6 -3
  56. package/dist/schemas.js.map +1 -1
  57. package/dist/types-DkYyrvoC.d.cts +19 -0
  58. package/dist/types-DkYyrvoC.d.ts +19 -0
  59. package/package.json +26 -1
  60. package/dist/chunk-XRKRVY46.js.map +0 -1
@@ -0,0 +1,1607 @@
1
+ import { pA as WorkspaceFeature, kx as Resource$1, jO as ProductType } from './client-Dft3Kmkn.js';
2
+ import { dR as SortOrder } from './inquiries-BIlL6Obb.js';
3
+
4
+ interface MemberNotificationPreferences {
5
+ notifySms?: boolean;
6
+ notifyEmail?: boolean;
7
+ notifyVoice?: boolean;
8
+ notifyWhatsapp?: boolean;
9
+ }
10
+ interface MemberNotifyActionParams {
11
+ memberId?: number | null;
12
+ sendToOwner?: boolean;
13
+ messageTemplate?: string | null;
14
+ }
15
+
16
+ /** Legacy enum kept for callers using UPPER_SNAKE member names (e.g. ToolkitState.ENABLED). */
17
+ declare enum ToolkitState {
18
+ DISABLED = "disabled",
19
+ ENABLED = "enabled",
20
+ AUTH = "auth"
21
+ }
22
+ interface ToolParameter {
23
+ name: string;
24
+ type: string;
25
+ description: string;
26
+ required?: boolean;
27
+ enum?: string[];
28
+ default?: any;
29
+ }
30
+
31
+ /**
32
+ * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
33
+ * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
34
+ * Group: workspace_health
35
+ */
36
+ /**
37
+ * Information about an attached addon product.
38
+ */
39
+ interface AttachedAddonInfo {
40
+ subscriptionId: number;
41
+ productId: number;
42
+ productName: string;
43
+ providesFeatures: string[];
44
+ }
45
+ /**
46
+ * Request body for switching a workspace's product (plan).
47
+ *
48
+ * The caller supplies the target product id only — the server resolves
49
+ * the active workspace SubscriptionItem, updates the matching Stripe
50
+ * workspace line item when one exists (``proration_behavior=none``),
51
+ * and re-syncs workspace features. Provisioning is not re-run.
52
+ */
53
+ interface ChangeWorkspaceProductRequest {
54
+ productId: number;
55
+ }
56
+ /**
57
+ * Response payload for a successful workspace product switch.
58
+ */
59
+ interface ChangeWorkspaceProductResponse {
60
+ workspaceUuid: string;
61
+ subscriptionId: number;
62
+ subscriptionItemId: number;
63
+ previousProductId: number;
64
+ newProductId: number;
65
+ previousProductName: string;
66
+ newProductName: string;
67
+ addedFeatures: string[];
68
+ removedFeatures: string[];
69
+ stripeUpdated?: boolean;
70
+ stripeSkipReason?: string | null;
71
+ }
72
+ /**
73
+ * Information about the workspace's current plan.
74
+ */
75
+ interface CurrentPlanInfo {
76
+ subscriptionId: number;
77
+ productId: number;
78
+ productName: string;
79
+ productType: string;
80
+ planPeriod: string;
81
+ subscriptionStatus: string;
82
+ providesFeatures: string[];
83
+ }
84
+ /**
85
+ * Feature sync status between workspace and subscription.
86
+ */
87
+ interface FeatureSyncStatus {
88
+ inSync: boolean;
89
+ missingFeatures: string[];
90
+ extraFeatures: string[];
91
+ dependencyErrors: string[];
92
+ }
93
+ /**
94
+ * Response model for provision-plan endpoint.
95
+ */
96
+ interface ProvisionPlanResponse {
97
+ success: boolean;
98
+ workspaceUuid: string;
99
+ previousFeatures: string[];
100
+ newFeatures: string[];
101
+ addedFeatures: string[];
102
+ removedFeatures: string[];
103
+ message: string;
104
+ }
105
+ /**
106
+ * Response model for workspace health check.
107
+ */
108
+ interface WorkspaceHealthResponse$1 {
109
+ workspaceUuid: string;
110
+ workspaceName: string;
111
+ dbStatus: string;
112
+ dbStatusCode: number;
113
+ currentPlan?: CurrentPlanInfo | null;
114
+ attachedAddons?: AttachedAddonInfo[];
115
+ featureSync: FeatureSyncStatus;
116
+ expectedFeatures: string[];
117
+ currentFeatures: string[];
118
+ }
119
+
120
+ type WorkspaceHealthResponse = Omit<WorkspaceHealthResponse$1, 'attachedAddons'> & {
121
+ attachedAddons: AttachedAddonInfo[];
122
+ };
123
+ interface ProvisionPlanRequest {
124
+ subscriptionId?: number;
125
+ }
126
+
127
+ interface TaskCountResponse {
128
+ taskCount: number;
129
+ }
130
+ interface EmailCountsResponse {
131
+ emailCount?: number;
132
+ unreadCount?: number;
133
+ }
134
+ interface MetricValue {
135
+ value: number;
136
+ label: string;
137
+ change?: number;
138
+ changeType?: 'increase' | 'decrease' | 'neutral';
139
+ }
140
+ interface TimeSeriesDataPoint {
141
+ timestamp: string;
142
+ value: number;
143
+ label?: string;
144
+ }
145
+ interface TimeSeriesData {
146
+ data: TimeSeriesDataPoint[];
147
+ period: 'hour' | 'day' | 'week' | 'month' | 'year';
148
+ startDate: string;
149
+ endDate: string;
150
+ }
151
+ interface StatisticsSummary {
152
+ total: number;
153
+ active: number;
154
+ inactive: number;
155
+ growth: number;
156
+ growthPercentage: number;
157
+ }
158
+ interface AnalyticsFilter {
159
+ dateRange?: {
160
+ start: string;
161
+ end: string;
162
+ };
163
+ memberIds?: number[];
164
+ taskIds?: number[];
165
+ siteIds?: number[];
166
+ dataTypeIds?: number[];
167
+ }
168
+ interface AnalyticsQuery {
169
+ filters?: AnalyticsFilter;
170
+ groupBy?: 'day' | 'week' | 'month' | 'year' | 'member' | 'task' | 'site';
171
+ sortBy?: string;
172
+ sortOrder?: SortOrder;
173
+ limit?: number;
174
+ offset?: number;
175
+ }
176
+ interface DashboardMetrics {
177
+ totalMembers: number;
178
+ activeMembers: number;
179
+ totalTasks: number;
180
+ completedTasks: number;
181
+ totalChats: number;
182
+ activeChats: number;
183
+ totalSites: number;
184
+ activeSites: number;
185
+ recentActivity: TimeSeriesData;
186
+ memberGrowth: TimeSeriesData;
187
+ taskCompletion: TimeSeriesData;
188
+ }
189
+ interface PerformanceMetrics {
190
+ averageResponseTime: number;
191
+ taskCompletionRate: number;
192
+ memberSatisfactionScore: number;
193
+ systemUptime: number;
194
+ errorRate: number;
195
+ throughput: number;
196
+ }
197
+ interface ExportStatistics {
198
+ totalRecords: number;
199
+ exportedRecords: number;
200
+ failedRecords: number;
201
+ processingTime: number;
202
+ fileSize: number;
203
+ exportFormat: 'csv' | 'json' | 'xlsx';
204
+ }
205
+ interface ImportStatistics {
206
+ totalRecords: number;
207
+ importedRecords: number;
208
+ failedRecords: number;
209
+ duplicateRecords: number;
210
+ processingTime: number;
211
+ validationErrors: string[];
212
+ }
213
+ interface UsageStatistics {
214
+ apiCalls: number;
215
+ storageUsed: number;
216
+ bandwidthUsed: number;
217
+ activeUsers: number;
218
+ peakConcurrentUsers: number;
219
+ averageSessionDuration: number;
220
+ }
221
+ interface BillingStatistics {
222
+ currentPeriodUsage: UsageStatistics;
223
+ previousPeriodUsage: UsageStatistics;
224
+ projectedUsage: UsageStatistics;
225
+ costBreakdown: {
226
+ category: string;
227
+ amount: number;
228
+ unit: string;
229
+ }[];
230
+ }
231
+ interface HealthCheckStatistics {
232
+ serviceStatus: 'healthy' | 'degraded' | 'unhealthy';
233
+ uptime: number;
234
+ responseTime: number;
235
+ errorCount: number;
236
+ warningCount: number;
237
+ lastChecked: string;
238
+ }
239
+ interface SystemStatistics {
240
+ cpu: number;
241
+ memory: number;
242
+ storage: number;
243
+ network: number;
244
+ activeConnections: number;
245
+ queueLength: number;
246
+ healthChecks: HealthCheckStatistics[];
247
+ }
248
+
249
+ /**
250
+ * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
251
+ * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
252
+ * Group: usage
253
+ */
254
+ /**
255
+ * AI model usage breakdown response.
256
+ */
257
+ interface AIModelUsageResponse {
258
+ modelId: string;
259
+ rawTokens: number;
260
+ credits: number;
261
+ multiplier: number;
262
+ inputMultiplier?: number | null;
263
+ outputMultiplier?: number | null;
264
+ cachedMultiplier?: number | null;
265
+ messageCount: number;
266
+ }
267
+ /**
268
+ * AI usage details response.
269
+ */
270
+ interface AIUsageDetailsResponse {
271
+ total: number;
272
+ chat: number;
273
+ realtime: number;
274
+ image: number;
275
+ video: number;
276
+ models: AIModelUsageResponse[];
277
+ }
278
+ /**
279
+ * Communication details including phone numbers and daily breakdowns.
280
+ */
281
+ interface CommunicationDetailsResponse {
282
+ sms: SMSCommunicationDetailsResponse;
283
+ phone: PhoneCommunicationDetailsResponse;
284
+ }
285
+ /**
286
+ * Daily phone call usage row for charts and exports.
287
+ */
288
+ interface DailyPhoneRowResponse {
289
+ date: string;
290
+ phoneNumberId: number;
291
+ phoneNumber: string;
292
+ phoneName: string | null;
293
+ inbound: number;
294
+ outbound: number;
295
+ totalDurationSeconds: number;
296
+ }
297
+ /**
298
+ * Daily SMS usage row for charts and exports.
299
+ */
300
+ interface DailySMSRowResponse {
301
+ date: string;
302
+ phoneNumberId: number;
303
+ phoneNumber: string;
304
+ phoneName: string | null;
305
+ inbound: number;
306
+ outbound: number;
307
+ totalChars: number;
308
+ totalSegments?: number;
309
+ }
310
+ /**
311
+ * Efficiency metrics summary.
312
+ */
313
+ interface EfficiencyMetricsResponse {
314
+ workspacesOverBudget: number;
315
+ averageUtilizationRate: number;
316
+ }
317
+ /**
318
+ * Email usage response.
319
+ */
320
+ interface EmailUsageResponse {
321
+ total: number;
322
+ sent: number;
323
+ received: number;
324
+ }
325
+ /**
326
+ * Phone call usage details for a phone number.
327
+ */
328
+ interface PhoneCallPhoneNumberUsageResponse {
329
+ phoneNumberId: number;
330
+ phoneNumber: string;
331
+ phoneName: string | null;
332
+ inbound: number;
333
+ outbound: number;
334
+ totalDurationSeconds: number;
335
+ }
336
+ /**
337
+ * Phone call usage response.
338
+ */
339
+ interface PhoneCallUsageResponse {
340
+ totalMinutes: number;
341
+ inbound: number;
342
+ outbound: number;
343
+ }
344
+ /**
345
+ * Detailed phone communication data.
346
+ */
347
+ interface PhoneCommunicationDetailsResponse {
348
+ phoneNumbers: PhoneCallPhoneNumberUsageResponse[];
349
+ dailyRows: DailyPhoneRowResponse[];
350
+ }
351
+ /**
352
+ * Product overage configuration response.
353
+ */
354
+ interface ProductOverageConfigResponse {
355
+ id: number | null;
356
+ name: string;
357
+ unitType: string;
358
+ unitCost: number;
359
+ }
360
+ /**
361
+ * Resource types tracked by the billing system.
362
+ *
363
+ * Two categories:
364
+ * - Usage resources: consumed over time, tracked per billing period.
365
+ * Each has a credit cost defined in CREDITS_PER_UNIT. Credits are
366
+ * the unified billing currency; resources are what you actually consume.
367
+ * - State resources: current count, not cumulative (members, sites, etc.)
368
+ */
369
+ type Resource = (typeof Resource)[keyof typeof Resource];
370
+ declare const Resource: {
371
+ readonly credit: "credit";
372
+ readonly stt: "stt";
373
+ readonly tts: "tts";
374
+ readonly sms: "sms";
375
+ readonly email: "email";
376
+ readonly phone_call: "phone_call";
377
+ readonly phone_number: "phone_number";
378
+ readonly inbox: "inbox";
379
+ readonly site: "site";
380
+ readonly member: "member";
381
+ readonly workspace: "workspace";
382
+ readonly org_admin: "org_admin";
383
+ readonly storage_mb: "storage_mb";
384
+ };
385
+ /**
386
+ * Resource overage details response.
387
+ */
388
+ interface ResourceOverageResponse {
389
+ included: number;
390
+ used: number;
391
+ overageAmount: number;
392
+ overageCostCents: number;
393
+ }
394
+ /**
395
+ * Resource usage breakdown response.
396
+ */
397
+ interface ResourceUsageResponse {
398
+ credit: AIUsageDetailsResponse;
399
+ sms: SMSMessageUsageResponse;
400
+ phoneCall: PhoneCallUsageResponse;
401
+ email: EmailUsageResponse;
402
+ storageMb: number;
403
+ member: number;
404
+ phoneNumber: number;
405
+ site: number;
406
+ inbox: number;
407
+ }
408
+ /**
409
+ * Detailed SMS communication data.
410
+ */
411
+ interface SMSCommunicationDetailsResponse {
412
+ totalCharacters: number;
413
+ totalSegments?: number;
414
+ phoneNumbers: SMSPhoneNumberUsageResponse[];
415
+ dailyRows: DailySMSRowResponse[];
416
+ }
417
+ /**
418
+ * SMS message usage response.
419
+ */
420
+ interface SMSMessageUsageResponse {
421
+ total: number;
422
+ inbound: number;
423
+ outbound: number;
424
+ totalSegments?: number;
425
+ }
426
+ /**
427
+ * SMS usage details for a phone number.
428
+ */
429
+ interface SMSPhoneNumberUsageResponse {
430
+ phoneNumberId: number;
431
+ phoneNumber: string;
432
+ phoneName: string | null;
433
+ inbound: number;
434
+ outbound: number;
435
+ totalChars: number;
436
+ totalSegments?: number;
437
+ }
438
+ /**
439
+ * Top resource overage summary.
440
+ */
441
+ interface TopResourceOverageResponse {
442
+ resource: string;
443
+ overageCostCents: number;
444
+ }
445
+ /**
446
+ * Product summary for usage reporting.
447
+ */
448
+ interface UsageProductSummaryResponse {
449
+ id: number;
450
+ name: string;
451
+ inclusions: UsageProductSummaryResponseInclusions;
452
+ overages: UsageProductSummaryResponseOverages;
453
+ }
454
+ type UsageProductSummaryResponseInclusions = {
455
+ [key: string]: number;
456
+ };
457
+ type UsageProductSummaryResponseOverages = {
458
+ [key: string]: ProductOverageConfigResponse;
459
+ };
460
+ /**
461
+ * Usage report response.
462
+ */
463
+ interface UsageReportResponse {
464
+ workspaces: WorkspaceUsageReportResponse[];
465
+ summary: UsageReportSummaryResponse;
466
+ }
467
+ /**
468
+ * Summary metrics for usage report.
469
+ */
470
+ interface UsageReportSummaryResponse {
471
+ totalOverageCostCents: number;
472
+ topResourcesByOverage: TopResourceOverageResponse[];
473
+ efficiencyMetrics: EfficiencyMetricsResponse;
474
+ }
475
+ /**
476
+ * Workspace usage report response.
477
+ */
478
+ interface WorkspaceUsageReportResponse {
479
+ uuid: string;
480
+ name: string;
481
+ slug: string;
482
+ product: UsageProductSummaryResponse;
483
+ usage: ResourceUsageResponse;
484
+ overages: Partial<Record<Resource, ResourceOverageResponse>>;
485
+ totalOverageCostCents: number;
486
+ communicationDetails: CommunicationDetailsResponse;
487
+ }
488
+
489
+ interface PhoneNumberUsage {
490
+ phoneNumberId: number;
491
+ phoneNumber: string;
492
+ phoneName: string | null;
493
+ inbound: number;
494
+ outbound: number;
495
+ }
496
+ interface UsageReportRequest {
497
+ workspaceUuids: string[];
498
+ startDate: string;
499
+ endDate: string;
500
+ }
501
+ interface MemberUsageReport {
502
+ memberId: number;
503
+ periodStart: string;
504
+ periodEnd: string;
505
+ totalChats: number;
506
+ totalMessages: number;
507
+ totalCredits: number;
508
+ }
509
+
510
+ /**
511
+ * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
512
+ * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
513
+ * Group: voice_metrics
514
+ */
515
+ interface CallEndSection$1 {
516
+ statuses: CallEndStatusEntry$1[];
517
+ totalCalls?: number;
518
+ successRate?: number;
519
+ }
520
+ interface CallEndStatusEntry$1 {
521
+ status: string;
522
+ total?: number;
523
+ timeSeries?: MetricDataPoint[];
524
+ }
525
+ interface EngineTimeSeries {
526
+ engine: string;
527
+ timeSeries: MetricDataPoint[];
528
+ }
529
+ interface MetricDataPoint {
530
+ timestamp: string;
531
+ value: number;
532
+ }
533
+ interface MetricSection$1 {
534
+ metricName: string;
535
+ label: string;
536
+ unit: string;
537
+ description?: string;
538
+ timeSeries: MetricDataPoint[];
539
+ summary: MetricSummary$1;
540
+ byEngine?: EngineTimeSeries[] | null;
541
+ }
542
+ interface MetricSummary$1 {
543
+ avg?: number;
544
+ min?: number;
545
+ max?: number;
546
+ count?: number;
547
+ p50?: number;
548
+ p90?: number;
549
+ p99?: number;
550
+ has_distribution?: boolean;
551
+ }
552
+ interface RequestsSection$1 {
553
+ statuses: RequestsStatusEntry$1[];
554
+ totalRequests?: number;
555
+ successRate?: number;
556
+ }
557
+ interface RequestsStatusEntry$1 {
558
+ status: string;
559
+ total?: number;
560
+ timeSeries?: MetricDataPoint[];
561
+ }
562
+ interface TtsReconnectOutcomeEntry$1 {
563
+ outcome: string;
564
+ total?: number;
565
+ timeSeries?: MetricDataPoint[];
566
+ }
567
+ interface TtsReconnectSection$1 {
568
+ outcomes: TtsReconnectOutcomeEntry$1[];
569
+ totalReconnects?: number;
570
+ successRate?: number;
571
+ duration?: MetricSection$1 | null;
572
+ }
573
+ interface VoiceMetricsResponse$1 {
574
+ voice: MetricSection$1[];
575
+ chat: MetricSection$1[];
576
+ callEnd: CallEndSection$1;
577
+ requests: RequestsSection$1;
578
+ ttsReconnect: TtsReconnectSection$1;
579
+ timeRange: VoiceMetricsTimeRange;
580
+ availableEngines?: string[];
581
+ availableChannels?: string[];
582
+ }
583
+ interface VoiceMetricsTimeRange {
584
+ start: string;
585
+ end: string;
586
+ hours: number;
587
+ periodSeconds: number;
588
+ }
589
+
590
+ /** Admin dashboards treat absent aggregates as zero. */
591
+ type MetricSummary = Required<Pick<MetricSummary$1, 'avg' | 'min' | 'max' | 'count' | 'p50' | 'p90' | 'p99'>> & Omit<MetricSummary$1, 'avg' | 'min' | 'max' | 'count' | 'p50' | 'p90' | 'p99'>;
592
+ type MetricSection = Omit<MetricSection$1, 'summary' | 'timeSeries'> & {
593
+ summary: MetricSummary;
594
+ timeSeries: MetricDataPoint[];
595
+ };
596
+ type CallEndStatusEntry = Omit<CallEndStatusEntry$1, 'total' | 'timeSeries'> & {
597
+ total: number;
598
+ timeSeries: MetricDataPoint[];
599
+ };
600
+ type CallEndSection = Omit<CallEndSection$1, 'statuses' | 'totalCalls'> & {
601
+ statuses: CallEndStatusEntry[];
602
+ totalCalls: number;
603
+ };
604
+ type RequestsStatusEntry = Omit<RequestsStatusEntry$1, 'total' | 'timeSeries'> & {
605
+ total: number;
606
+ timeSeries: MetricDataPoint[];
607
+ };
608
+ type RequestsSection = Omit<RequestsSection$1, 'statuses' | 'totalRequests'> & {
609
+ statuses: RequestsStatusEntry[];
610
+ totalRequests: number;
611
+ };
612
+ type TtsReconnectOutcomeEntry = Omit<TtsReconnectOutcomeEntry$1, 'total' | 'timeSeries'> & {
613
+ total: number;
614
+ timeSeries: MetricDataPoint[];
615
+ };
616
+ type TtsReconnectSection = Omit<TtsReconnectSection$1, 'outcomes' | 'totalReconnects' | 'duration'> & {
617
+ outcomes: TtsReconnectOutcomeEntry[];
618
+ totalReconnects: number;
619
+ duration?: MetricSection | null;
620
+ };
621
+ type VoiceMetricsResponse = Omit<VoiceMetricsResponse$1, 'voice' | 'chat' | 'callEnd' | 'requests' | 'ttsReconnect'> & {
622
+ voice: MetricSection[];
623
+ chat: MetricSection[];
624
+ callEnd: CallEndSection;
625
+ requests: RequestsSection;
626
+ ttsReconnect: TtsReconnectSection;
627
+ };
628
+
629
+ /**
630
+ * Generated by Orval (filtered by scripts/types-codegen/allowlist.txt and
631
+ * grouped by scripts/types-codegen/group_generated.ts). Do not edit manually.
632
+ * Group: health_dashboard
633
+ */
634
+ /**
635
+ * Channel delivery failure and volume counts.
636
+ */
637
+ interface ChannelFailures {
638
+ smsFailures?: number;
639
+ smsTotal?: number;
640
+ smsResponded?: number;
641
+ smsOutboundChats?: number;
642
+ voiceFailures?: number;
643
+ voiceTotal?: number;
644
+ emailFailures?: number;
645
+ emailTotal?: number;
646
+ smsTopFailurePhoneNumberId?: number | null;
647
+ voiceTopFailurePhoneNumberId?: number | null;
648
+ }
649
+ /**
650
+ * Event rule execution failure and volume counts.
651
+ */
652
+ interface EventRuleMetrics {
653
+ failures?: number;
654
+ total?: number;
655
+ }
656
+ /**
657
+ * Response for the health metrics endpoint.
658
+ */
659
+ interface HealthMetricsResponse {
660
+ summary: HealthSummary;
661
+ previousSummary?: HealthSummary | null;
662
+ workspaces: WorkspaceHealthRow[];
663
+ skippedWorkspaces?: SkippedWorkspace[];
664
+ hours: number;
665
+ }
666
+ /**
667
+ * Aggregate summary across all queried workspaces.
668
+ */
669
+ interface HealthSummary {
670
+ totalWorkspaces?: number;
671
+ criticalCount?: number;
672
+ warningCount?: number;
673
+ healthyCount?: number;
674
+ totalSmsFailures?: number;
675
+ totalSmsVolume?: number;
676
+ totalVoiceFailures?: number;
677
+ totalVoiceVolume?: number;
678
+ totalEmailFailures?: number;
679
+ totalEmailVolume?: number;
680
+ totalEventRuleFailures?: number;
681
+ totalEventRuleVolume?: number;
682
+ totalWebhookFailures?: number;
683
+ totalWebhookVolume?: number;
684
+ totalSmsResponded?: number;
685
+ totalSmsOutboundChats?: number;
686
+ totalMemberChats?: number;
687
+ totalNeedsResponse?: number;
688
+ totalAccessGapWarnings?: number;
689
+ }
690
+ /**
691
+ * A workspace that was skipped during metrics collection.
692
+ */
693
+ interface SkippedWorkspace {
694
+ uuid: string;
695
+ reason: string;
696
+ }
697
+ /**
698
+ * Webhook delivery failure and volume counts.
699
+ */
700
+ interface WebhookMetrics {
701
+ failures?: number;
702
+ total?: number;
703
+ }
704
+ /**
705
+ * Health metrics for a single workspace.
706
+ */
707
+ interface WorkspaceHealthRow {
708
+ workspaceUuid: string;
709
+ workspaceName: string;
710
+ organizationId: number;
711
+ organizationName?: string | null;
712
+ statusCode: number;
713
+ statusLabel: string;
714
+ healthStatus: string;
715
+ channelFailures: ChannelFailures;
716
+ eventRules: EventRuleMetrics;
717
+ webhooks: WebhookMetrics;
718
+ memberChats?: number;
719
+ needsResponse?: number;
720
+ accessGapWarnings?: number;
721
+ }
722
+
723
+ interface HealthMetricsRequest {
724
+ workspaceUuids?: string[];
725
+ organizationIds?: number[];
726
+ hours?: number;
727
+ }
728
+ interface ErrorCodeBucket {
729
+ code: string;
730
+ count: number;
731
+ label: string | null;
732
+ }
733
+ interface TopOffender {
734
+ id: number;
735
+ name: string | null;
736
+ identifier: string | null;
737
+ failureCount: number;
738
+ }
739
+ interface ChannelErrorBreakdown {
740
+ byCodes: ErrorCodeBucket[];
741
+ topResources: TopOffender[];
742
+ }
743
+ interface WorkspaceHealthDetail {
744
+ workspaceUuid: string;
745
+ hours: number;
746
+ sms: ChannelErrorBreakdown | null;
747
+ voice: ChannelErrorBreakdown | null;
748
+ webhooks: ChannelErrorBreakdown | null;
749
+ eventRules: ChannelErrorBreakdown | null;
750
+ }
751
+ interface HealthDetailRequest {
752
+ hours?: number;
753
+ }
754
+
755
+ /**
756
+ * App context types - shared between client and server
757
+ *
758
+ * These types represent the current state of the user's interaction with the app,
759
+ * providing context to AI assistants about what the user is viewing/editing.
760
+ */
761
+ /**
762
+ * Information about a site in the context
763
+ */
764
+ interface SiteContext {
765
+ id: number;
766
+ name?: string;
767
+ slug?: string;
768
+ }
769
+ /**
770
+ * Information about a page in the context
771
+ */
772
+ interface PageContext {
773
+ id: number;
774
+ name?: string;
775
+ slug?: string;
776
+ }
777
+ /**
778
+ * Information about a workflow in the context
779
+ */
780
+ interface WorkflowContext {
781
+ id: number;
782
+ name?: string;
783
+ selectedTask?: TaskContext;
784
+ }
785
+ /**
786
+ * Information about a task in the context
787
+ */
788
+ interface TaskContext {
789
+ id: number;
790
+ name?: string;
791
+ }
792
+ /**
793
+ * Information about a data record in the context
794
+ */
795
+ interface DataRecordContext {
796
+ id: number;
797
+ type?: string;
798
+ name?: string;
799
+ }
800
+ /**
801
+ * Information about a toolkit in the context
802
+ */
803
+ interface ToolkitContext {
804
+ id: string;
805
+ name?: string;
806
+ }
807
+ /**
808
+ * App context provided to AI assistants
809
+ *
810
+ * This represents the current page/state the user is in,
811
+ * allowing the AI to provide context-aware assistance.
812
+ */
813
+ interface AppContext {
814
+ /** Current page URI (e.g., 'app:page:workflows/123') */
815
+ appUri?: string;
816
+ /** Current browser URL for linking back to this page */
817
+ pageUrl?: string;
818
+ /** Auto-approve all tool calls without HITL interruption */
819
+ autoApprove?: boolean;
820
+ /** Enable deep thinking mode for the current session */
821
+ deepThink?: boolean;
822
+ /** Setup spec IDs linked to the current workspace that are pending execution. */
823
+ pendingSetupSpecIds?: number[];
824
+ /** Additional structured page state */
825
+ pageState?: {
826
+ /** Route parameters from Next.js */
827
+ routeParams?: Record<string, string | string[]>;
828
+ /** Site being viewed/edited */
829
+ site?: SiteContext;
830
+ /** Page being viewed/edited */
831
+ page?: PageContext;
832
+ /** Workflow being viewed/edited */
833
+ workflow?: WorkflowContext;
834
+ /** Data record being viewed/edited */
835
+ dataRecord?: DataRecordContext;
836
+ /** Toolkit being viewed */
837
+ toolkit?: ToolkitContext;
838
+ /** Open drawers/modals */
839
+ openDrawers?: string[];
840
+ /** Selected tabs */
841
+ selectedTabs?: string[];
842
+ /** Any other page-specific state */
843
+ [key: string]: any;
844
+ };
845
+ }
846
+ /**
847
+ * Format app context as markdown for display in bug reports, etc.
848
+ */
849
+ declare function formatAppContextAsMarkdown(context: AppContext | undefined): string;
850
+
851
+ type OpenAITurnDetectionType = 'semantic_vad' | 'server_vad';
852
+ type OpenAISemanticVADEagerness = 'low' | 'medium' | 'high' | 'auto';
853
+ interface OpenAISemanticVADTurnDetection {
854
+ type: 'semantic_vad';
855
+ eagerness?: OpenAISemanticVADEagerness;
856
+ create_response?: boolean;
857
+ interrupt_response?: boolean;
858
+ }
859
+ interface OpenAIServerVADTurnDetection {
860
+ type: 'server_vad';
861
+ threshold?: number;
862
+ prefix_padding_ms?: number;
863
+ silence_duration_ms?: number;
864
+ create_response?: boolean;
865
+ interrupt_response?: boolean;
866
+ }
867
+ type OpenAITurnDetection = OpenAISemanticVADTurnDetection | OpenAIServerVADTurnDetection;
868
+ type ThinkingSound = 'none' | 'typing' | 'strumming' | 'speech';
869
+ type InterruptionSound = 'none' | 'clav' | 'bells' | 'organ' | 'guzheng';
870
+ /** Default filler phrases suggested when the user first enables "speech" mode. */
871
+ declare const DEFAULT_THINKING_SPEECH_PHRASES: readonly string[];
872
+ type TTSModel = 'native' | 'elevenlabs:tts:eleven_turbo_v2' | 'elevenlabs:tts:eleven_turbo_v2_5' | 'elevenlabs:tts:eleven_multilingual_v2' | 'elevenlabs:tts:eleven_flash_v2_5' | 'openai:tts:tts-1' | 'openai:tts:tts-1-hd' | 'openai:tts:gpt-4o-mini-tts' | 'aws:tts:polly-generative' | 'aws:tts:polly-neural' | 'google:tts:chirp';
873
+ /** Extract the provider from a TTSModel ID (e.g. "elevenlabs:tts:eleven_flash_v2_5" -> "elevenlabs"). */
874
+ declare function getTTSProvider(ttsModel: string | null | undefined): string | null;
875
+ /**
876
+ * Base configuration for all realtime models.
877
+ * Contains common fields that apply to all realtime model providers.
878
+ */
879
+ interface BaseRealtimeModelConfig {
880
+ /** Sound to play while the agent is processing tool calls. */
881
+ thinkingSound?: ThinkingSound | null;
882
+ /** Volume level for the thinking sound (0-100). 0 means muted. Missing or null means full volume (100). */
883
+ thinkingSoundVolume?: number | null;
884
+ /** Initial delay in milliseconds before playing thinking sound. Prevents needless interruption on short tool calls. Default: 500ms. */
885
+ thinkingSoundInitialDelay?: number | null;
886
+ /** When `thinkingSound` is 'speech', one of these phrases is spoken while the agent runs a tool. Phrases rotate round-robin per session. */
887
+ thinkingSpeechPhrases?: string[] | null;
888
+ /** Sound to play when user stops speaking after interrupting the assistant. Provides immediate auditory feedback that input was received. Default: none. */
889
+ interruptionSound?: InterruptionSound | null;
890
+ /** Volume level for the interruption sound (0-100). 0 means muted. Missing or null means full volume (100). */
891
+ interruptionSoundVolume?: number | null;
892
+ /** TTS model ID in provider:tts:model format (e.g. 'elevenlabs:tts:eleven_flash_v2_5'), or 'native'. */
893
+ ttsModel?: TTSModel | null;
894
+ /** Canonical voice identifier (e.g., elevenlabs:voice:catt) that selects the specific agent voice. */
895
+ voiceModel?: string | null;
896
+ }
897
+ /**
898
+ * Native realtime providers always use the model's built-in audio. The
899
+ * backend Pydantic schemas now enforce `ttsModel: "native"` and reject
900
+ * external `sttModel`. Mirroring that contract on the client surface
901
+ * keeps the editor in sync — see `useVoiceConfig.buildSubmitConfig`.
902
+ */
903
+ interface OpenAIRealtimeModelConfig extends BaseRealtimeModelConfig {
904
+ ttsModel?: 'native' | null;
905
+ turnDetection?: OpenAITurnDetection | null;
906
+ }
907
+ interface GeminiRealtimeModelConfig extends BaseRealtimeModelConfig {
908
+ ttsModel?: 'native' | null;
909
+ }
910
+ interface CustomRealtimeModelConfig extends BaseRealtimeModelConfig {
911
+ sttModel?: string | null;
912
+ sttConfig?: Record<string, unknown> | null;
913
+ inferenceModel: string;
914
+ inferenceModelConfig?: ChatModelConfig | null;
915
+ }
916
+ interface AWSRealtimeModelConfig extends BaseRealtimeModelConfig {
917
+ ttsModel?: 'native' | null;
918
+ }
919
+ /**
920
+ * xAI Voice Agent realtime config. Only `server_vad` is supported, so
921
+ * the server-side schema rejects `semantic_vad`. Mirrors
922
+ * `lib/constants.py:XAIRealtimeModelConfig`.
923
+ */
924
+ interface XAIRealtimeModelConfig extends BaseRealtimeModelConfig {
925
+ ttsModel?: 'native' | null;
926
+ turnDetection?: OpenAIServerVADTurnDetection | null;
927
+ }
928
+ type RealtimeModelConfig = OpenAIRealtimeModelConfig | GeminiRealtimeModelConfig | CustomRealtimeModelConfig | AWSRealtimeModelConfig | XAIRealtimeModelConfig;
929
+ type GeminiThinkingLevel = 'minimal' | 'low' | 'medium' | 'high';
930
+ type OpenAIReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
931
+ /**
932
+ * xAI (Grok) reasoning levels. Note "none" disables reasoning entirely
933
+ * (used by Grok 4.3 to switch into non-reasoning mode); xAI does NOT
934
+ * accept OpenAI's "minimal".
935
+ * https://docs.x.ai/developers/model-capabilities/text/reasoning#effort-levels
936
+ */
937
+ type XAIReasoningEffort = 'none' | 'low' | 'medium' | 'high';
938
+ /**
939
+ * Base configuration for all chat models.
940
+ * Can be extended for provider-specific options.
941
+ */
942
+ interface BaseChatModelConfig {
943
+ }
944
+ interface GeminiChatModelConfig extends BaseChatModelConfig {
945
+ thinkingLevel?: GeminiThinkingLevel | null;
946
+ includeThoughts?: boolean | null;
947
+ }
948
+ interface ClaudeChatModelConfig extends BaseChatModelConfig {
949
+ thinkingEnabled?: boolean | null;
950
+ thinkingBudgetTokens?: number | null;
951
+ }
952
+ interface OpenAIChatModelConfig extends BaseChatModelConfig {
953
+ provider: 'openai';
954
+ reasoningEffort?: OpenAIReasoningEffort | null;
955
+ }
956
+ interface XAIChatModelConfig extends BaseChatModelConfig {
957
+ provider: 'xai';
958
+ reasoningEffort?: XAIReasoningEffort | null;
959
+ }
960
+ type ChatModelConfig = GeminiChatModelConfig | ClaudeChatModelConfig | OpenAIChatModelConfig | XAIChatModelConfig;
961
+ /**
962
+ * Supported TTS preview providers.
963
+ * These are the voice providers that support TTS preview in the UI.
964
+ */
965
+ declare const TTS_PREVIEW_PROVIDERS: readonly ["openai", "elevenlabs", "google", "aws", "pocket", "deepgram", "xai"];
966
+ type TTSPreviewProvider = (typeof TTS_PREVIEW_PROVIDERS)[number];
967
+ /**
968
+ * Get the canonical voice model ID from a realtime model config.
969
+ *
970
+ * Voice model IDs follow the format: `{provider}:voice:{voiceName}`
971
+ * Examples:
972
+ * - `openai:voice:ash`
973
+ * - `elevenlabs:voice:catt`
974
+ * - `google:voice:puck`
975
+ *
976
+ * @param entity - An object with optional realtimeModelConfig
977
+ * @returns The canonical voice model ID, or null if no voice is configured
978
+ */
979
+ declare function getVoiceModelId(entity: {
980
+ realtimeModelConfig?: RealtimeModelConfig | null;
981
+ }): string | null;
982
+ /**
983
+ * Check if an entity's voice can be previewed.
984
+ *
985
+ * @param entity - An object with optional realtimeModelConfig
986
+ * @returns True if the entity's voice supports TTS preview
987
+ */
988
+ declare function canPreviewVoice(entity: {
989
+ realtimeModelConfig?: RealtimeModelConfig | null;
990
+ }): boolean;
991
+
992
+ /**
993
+ * Default AI model constants shared across the frontend.
994
+ *
995
+ * These are used as fallback defaults when creating new agents, assistants,
996
+ * and other entities that require a model selection.
997
+ */
998
+ /** Default chat/inference model for new agents and assistants. */
999
+ declare const DEFAULT_CHAT_MODEL = "aws:bedrock:claude-4-5-haiku";
1000
+ /** Default inference model for custom voice stack. */
1001
+ declare const DEFAULT_VOICE_INFERENCE_MODEL = "google:vertex:gemini-3-flash";
1002
+ /** Default voice model for custom realtime configurations. */
1003
+ declare const DEFAULT_CUSTOM_VOICE_MODEL = "elevenlabs:voice:river";
1004
+
1005
+ /**
1006
+ * Resource metadata for products
1007
+ *
1008
+ * Defines labels, units, and descriptions for each resource type
1009
+ */
1010
+
1011
+ /** Scope defines where a resource can be configured */
1012
+ type ResourceScope = 'workspace' | 'org' | 'any';
1013
+ interface ResourceMetadata {
1014
+ label: string;
1015
+ unit: string;
1016
+ unitPlural: string;
1017
+ description: string;
1018
+ /** Feature required to use this resource (null means always available) */
1019
+ requiresFeature: WorkspaceFeature | null;
1020
+ /** Where this resource can be configured */
1021
+ scope: ResourceScope;
1022
+ }
1023
+ /**
1024
+ * Get metadata for a specific resource
1025
+ */
1026
+ declare function getResourceMetadata(resource: Resource$1): ResourceMetadata | undefined;
1027
+ /**
1028
+ * Get all available resource slugs
1029
+ */
1030
+ declare function getAllResourceSlugs(): Resource$1[];
1031
+ /**
1032
+ * Get the scope ('workspace' or 'org') for a product type.
1033
+ */
1034
+ declare function getScopeFromProductType(productType: ProductType): ResourceScope;
1035
+ /**
1036
+ * Get resources applicable to a given scope and optional feature set.
1037
+ *
1038
+ * @param scope - 'workspace', 'org', or 'any' to filter by where resources can be configured
1039
+ * @param enabledFeatures - Optional list of enabled features. If provided, resources requiring
1040
+ * features not in this list will be excluded. If null/undefined,
1041
+ * all resources matching the scope are returned.
1042
+ */
1043
+ declare function getApplicableResources(scope: ResourceScope, enabledFeatures?: WorkspaceFeature[] | null): Resource$1[];
1044
+ /**
1045
+ * Get resources applicable to a product type.
1046
+ * This is a convenience wrapper around getApplicableResources that derives scope from product type.
1047
+ * Does not filter by features - use getApplicableResources directly for feature-based filtering.
1048
+ */
1049
+ declare function getApplicableResourceSlugs(productType: ProductType): Resource$1[];
1050
+
1051
+ /**
1052
+ * Centralized OAuth and API scope management for TypeScript/JavaScript clients.
1053
+ *
1054
+ * This module provides all available scopes for Applications and API keys,
1055
+ * serving as a single source of truth for permission management across frontend
1056
+ * and TypeScript-based services (like MCP servers).
1057
+ *
1058
+ * IMPORTANT: Keep in sync with lib/context/scopes.py
1059
+ */
1060
+ /**
1061
+ * Categories of scopes for organization
1062
+ * Must match namespaces used in Python Scope enum
1063
+ */
1064
+ declare enum ScopeCategory {
1065
+ WORKSPACE = "workspace",
1066
+ MEMBERS = "members",
1067
+ MEMBER_ROLES = "member_roles",
1068
+ CHATS = "chats",
1069
+ DM = "dm",
1070
+ WORKFLOWS = "workflows",
1071
+ ASSIGNMENTS = "assignments",
1072
+ AUTOMATIONS = "automations",
1073
+ DATATYPES = "datatypes",
1074
+ RECORDS = "records",
1075
+ FILES = "files",
1076
+ JOURNEYS = "journeys",
1077
+ EXPERIMENTS = "experiments",
1078
+ SITES = "sites",
1079
+ AGENTS = "agents",
1080
+ CALENDARS = "calendars",
1081
+ INBOXES = "inboxes",
1082
+ PHONES = "phones",
1083
+ WEBHOOKS = "webhooks",
1084
+ APPS = "apps",
1085
+ LABELS = "labels",
1086
+ ANALYTICS = "analytics",
1087
+ OPERATOR = "operator",
1088
+ EXPORT = "export",
1089
+ ORG = "org"
1090
+ }
1091
+ /**
1092
+ * Individual scope definition
1093
+ */
1094
+ interface ScopeDefinition {
1095
+ /** The scope identifier (e.g., "workspace:read") */
1096
+ name: string;
1097
+ /** The category this scope belongs to */
1098
+ category: ScopeCategory;
1099
+ /** Human-readable description of what this scope allows */
1100
+ description: string;
1101
+ /** List of other scopes this scope automatically includes */
1102
+ implies?: readonly string[];
1103
+ /** Whether this scope should be highlighted as dangerous */
1104
+ dangerous?: boolean;
1105
+ }
1106
+ /**
1107
+ * All available OAuth scopes
1108
+ * Must match Python Scope enum in lib/context/scopes.py
1109
+ */
1110
+ declare const SCOPES: {
1111
+ readonly 'workspace:read': {
1112
+ readonly name: "workspace:read";
1113
+ readonly category: ScopeCategory.WORKSPACE;
1114
+ readonly description: "View workspace settings";
1115
+ };
1116
+ readonly 'workspace:write': {
1117
+ readonly name: "workspace:write";
1118
+ readonly category: ScopeCategory.WORKSPACE;
1119
+ readonly description: "Modify workspace settings";
1120
+ readonly implies: readonly ["workspace:read"];
1121
+ };
1122
+ readonly 'workspace:admin': {
1123
+ readonly name: "workspace:admin";
1124
+ readonly category: ScopeCategory.WORKSPACE;
1125
+ readonly description: "Full workspace control";
1126
+ readonly implies: readonly ["workspace:write"];
1127
+ readonly dangerous: true;
1128
+ };
1129
+ readonly 'members:read': {
1130
+ readonly name: "members:read";
1131
+ readonly category: ScopeCategory.MEMBERS;
1132
+ readonly description: "View all members";
1133
+ };
1134
+ readonly 'members:write': {
1135
+ readonly name: "members:write";
1136
+ readonly category: ScopeCategory.MEMBERS;
1137
+ readonly description: "Create and update members";
1138
+ readonly implies: readonly ["members:read"];
1139
+ };
1140
+ readonly 'members:admin': {
1141
+ readonly name: "members:admin";
1142
+ readonly category: ScopeCategory.MEMBERS;
1143
+ readonly description: "Delete members, manage permissions";
1144
+ readonly implies: readonly ["members:write"];
1145
+ readonly dangerous: true;
1146
+ };
1147
+ readonly 'member_roles:read': {
1148
+ readonly name: "member_roles:read";
1149
+ readonly category: ScopeCategory.MEMBER_ROLES;
1150
+ readonly description: "View role definitions";
1151
+ };
1152
+ readonly 'member_roles:write': {
1153
+ readonly name: "member_roles:write";
1154
+ readonly category: ScopeCategory.MEMBER_ROLES;
1155
+ readonly description: "Create and edit roles";
1156
+ readonly implies: readonly ["member_roles:read"];
1157
+ };
1158
+ readonly 'member_roles:admin': {
1159
+ readonly name: "member_roles:admin";
1160
+ readonly category: ScopeCategory.MEMBER_ROLES;
1161
+ readonly description: "Delete roles";
1162
+ readonly implies: readonly ["member_roles:write"];
1163
+ readonly dangerous: true;
1164
+ };
1165
+ readonly 'chats:read': {
1166
+ readonly name: "chats:read";
1167
+ readonly category: ScopeCategory.CHATS;
1168
+ readonly description: "View all conversations";
1169
+ };
1170
+ readonly 'chats:write': {
1171
+ readonly name: "chats:write";
1172
+ readonly category: ScopeCategory.CHATS;
1173
+ readonly description: "Send messages in conversations";
1174
+ readonly implies: readonly ["chats:read"];
1175
+ };
1176
+ readonly 'chats:admin': {
1177
+ readonly name: "chats:admin";
1178
+ readonly category: ScopeCategory.CHATS;
1179
+ readonly description: "Delete conversations";
1180
+ readonly implies: readonly ["chats:write"];
1181
+ };
1182
+ readonly 'dm:read': {
1183
+ readonly name: "dm:read";
1184
+ readonly category: ScopeCategory.DM;
1185
+ readonly description: "View direct messages";
1186
+ };
1187
+ readonly 'dm:write': {
1188
+ readonly name: "dm:write";
1189
+ readonly category: ScopeCategory.DM;
1190
+ readonly description: "Send direct messages";
1191
+ readonly implies: readonly ["dm:read"];
1192
+ };
1193
+ readonly 'dm:admin': {
1194
+ readonly name: "dm:admin";
1195
+ readonly category: ScopeCategory.DM;
1196
+ readonly description: "Delete direct messages";
1197
+ readonly implies: readonly ["dm:write"];
1198
+ };
1199
+ readonly 'workflows:read': {
1200
+ readonly name: "workflows:read";
1201
+ readonly category: ScopeCategory.WORKFLOWS;
1202
+ readonly description: "View workflow definitions";
1203
+ };
1204
+ readonly 'workflows:write': {
1205
+ readonly name: "workflows:write";
1206
+ readonly category: ScopeCategory.WORKFLOWS;
1207
+ readonly description: "Create and edit workflows";
1208
+ readonly implies: readonly ["workflows:read"];
1209
+ };
1210
+ readonly 'workflows:admin': {
1211
+ readonly name: "workflows:admin";
1212
+ readonly category: ScopeCategory.WORKFLOWS;
1213
+ readonly description: "Delete workflows";
1214
+ readonly implies: readonly ["workflows:write"];
1215
+ };
1216
+ readonly 'assignments:read': {
1217
+ readonly name: "assignments:read";
1218
+ readonly category: ScopeCategory.ASSIGNMENTS;
1219
+ readonly description: "View all assignments";
1220
+ };
1221
+ readonly 'assignments:write': {
1222
+ readonly name: "assignments:write";
1223
+ readonly category: ScopeCategory.ASSIGNMENTS;
1224
+ readonly description: "Create and modify assignments";
1225
+ readonly implies: readonly ["assignments:read"];
1226
+ };
1227
+ readonly 'assignments:admin': {
1228
+ readonly name: "assignments:admin";
1229
+ readonly category: ScopeCategory.ASSIGNMENTS;
1230
+ readonly description: "Delete assignments";
1231
+ readonly implies: readonly ["assignments:write"];
1232
+ };
1233
+ readonly 'automations:read': {
1234
+ readonly name: "automations:read";
1235
+ readonly category: ScopeCategory.AUTOMATIONS;
1236
+ readonly description: "View scheduled tasks and rules";
1237
+ };
1238
+ readonly 'automations:write': {
1239
+ readonly name: "automations:write";
1240
+ readonly category: ScopeCategory.AUTOMATIONS;
1241
+ readonly description: "Create and edit automations";
1242
+ readonly implies: readonly ["automations:read"];
1243
+ };
1244
+ readonly 'automations:admin': {
1245
+ readonly name: "automations:admin";
1246
+ readonly category: ScopeCategory.AUTOMATIONS;
1247
+ readonly description: "Delete automations";
1248
+ readonly implies: readonly ["automations:write"];
1249
+ };
1250
+ readonly 'datatypes:read': {
1251
+ readonly name: "datatypes:read";
1252
+ readonly category: ScopeCategory.DATATYPES;
1253
+ readonly description: "View data type schemas";
1254
+ };
1255
+ readonly 'datatypes:write': {
1256
+ readonly name: "datatypes:write";
1257
+ readonly category: ScopeCategory.DATATYPES;
1258
+ readonly description: "Create and edit data types";
1259
+ readonly implies: readonly ["datatypes:read"];
1260
+ };
1261
+ readonly 'datatypes:admin': {
1262
+ readonly name: "datatypes:admin";
1263
+ readonly category: ScopeCategory.DATATYPES;
1264
+ readonly description: "Delete data types";
1265
+ readonly implies: readonly ["datatypes:write"];
1266
+ };
1267
+ readonly 'records:read': {
1268
+ readonly name: "records:read";
1269
+ readonly category: ScopeCategory.RECORDS;
1270
+ readonly description: "View all data records";
1271
+ };
1272
+ readonly 'records:write': {
1273
+ readonly name: "records:write";
1274
+ readonly category: ScopeCategory.RECORDS;
1275
+ readonly description: "Create and modify records";
1276
+ readonly implies: readonly ["records:read"];
1277
+ };
1278
+ readonly 'records:admin': {
1279
+ readonly name: "records:admin";
1280
+ readonly category: ScopeCategory.RECORDS;
1281
+ readonly description: "Delete records";
1282
+ readonly implies: readonly ["records:write"];
1283
+ };
1284
+ readonly 'files:read': {
1285
+ readonly name: "files:read";
1286
+ readonly category: ScopeCategory.FILES;
1287
+ readonly description: "View all files";
1288
+ };
1289
+ readonly 'files:write': {
1290
+ readonly name: "files:write";
1291
+ readonly category: ScopeCategory.FILES;
1292
+ readonly description: "Upload and modify files";
1293
+ readonly implies: readonly ["files:read"];
1294
+ };
1295
+ readonly 'files:admin': {
1296
+ readonly name: "files:admin";
1297
+ readonly category: ScopeCategory.FILES;
1298
+ readonly description: "Delete files";
1299
+ readonly implies: readonly ["files:write"];
1300
+ };
1301
+ readonly 'journeys:read': {
1302
+ readonly name: "journeys:read";
1303
+ readonly category: ScopeCategory.JOURNEYS;
1304
+ readonly description: "View journey definitions";
1305
+ };
1306
+ readonly 'journeys:write': {
1307
+ readonly name: "journeys:write";
1308
+ readonly category: ScopeCategory.JOURNEYS;
1309
+ readonly description: "Create and edit journeys";
1310
+ readonly implies: readonly ["journeys:read"];
1311
+ };
1312
+ readonly 'journeys:admin': {
1313
+ readonly name: "journeys:admin";
1314
+ readonly category: ScopeCategory.JOURNEYS;
1315
+ readonly description: "Delete journeys";
1316
+ readonly implies: readonly ["journeys:write"];
1317
+ };
1318
+ readonly 'experiments:read': {
1319
+ readonly name: "experiments:read";
1320
+ readonly category: ScopeCategory.EXPERIMENTS;
1321
+ readonly description: "View experiments and assignments";
1322
+ };
1323
+ readonly 'experiments:write': {
1324
+ readonly name: "experiments:write";
1325
+ readonly category: ScopeCategory.EXPERIMENTS;
1326
+ readonly description: "Create and edit experiments";
1327
+ readonly implies: readonly ["experiments:read"];
1328
+ };
1329
+ readonly 'experiments:admin': {
1330
+ readonly name: "experiments:admin";
1331
+ readonly category: ScopeCategory.EXPERIMENTS;
1332
+ readonly description: "Delete draft experiments and archive experiments";
1333
+ readonly implies: readonly ["experiments:write"];
1334
+ };
1335
+ readonly 'sites:read': {
1336
+ readonly name: "sites:read";
1337
+ readonly category: ScopeCategory.SITES;
1338
+ readonly description: "View site configurations";
1339
+ };
1340
+ readonly 'sites:write': {
1341
+ readonly name: "sites:write";
1342
+ readonly category: ScopeCategory.SITES;
1343
+ readonly description: "Create and edit sites";
1344
+ readonly implies: readonly ["sites:read"];
1345
+ };
1346
+ readonly 'sites:admin': {
1347
+ readonly name: "sites:admin";
1348
+ readonly category: ScopeCategory.SITES;
1349
+ readonly description: "Delete sites";
1350
+ readonly implies: readonly ["sites:write"];
1351
+ };
1352
+ readonly 'agents:read': {
1353
+ readonly name: "agents:read";
1354
+ readonly category: ScopeCategory.AGENTS;
1355
+ readonly description: "View agent members";
1356
+ };
1357
+ readonly 'agents:write': {
1358
+ readonly name: "agents:write";
1359
+ readonly category: ScopeCategory.AGENTS;
1360
+ readonly description: "Create and configure agents";
1361
+ readonly implies: readonly ["agents:read"];
1362
+ };
1363
+ readonly 'agents:admin': {
1364
+ readonly name: "agents:admin";
1365
+ readonly category: ScopeCategory.AGENTS;
1366
+ readonly description: "Delete agents";
1367
+ readonly implies: readonly ["agents:write"];
1368
+ };
1369
+ readonly 'calendars:read': {
1370
+ readonly name: "calendars:read";
1371
+ readonly category: ScopeCategory.CALENDARS;
1372
+ readonly description: "View calendars";
1373
+ };
1374
+ readonly 'calendars:write': {
1375
+ readonly name: "calendars:write";
1376
+ readonly category: ScopeCategory.CALENDARS;
1377
+ readonly description: "Create and edit calendar events";
1378
+ readonly implies: readonly ["calendars:read"];
1379
+ };
1380
+ readonly 'calendars:admin': {
1381
+ readonly name: "calendars:admin";
1382
+ readonly category: ScopeCategory.CALENDARS;
1383
+ readonly description: "Delete calendars";
1384
+ readonly implies: readonly ["calendars:write"];
1385
+ };
1386
+ readonly 'inboxes:read': {
1387
+ readonly name: "inboxes:read";
1388
+ readonly category: ScopeCategory.INBOXES;
1389
+ readonly description: "View inbox configurations";
1390
+ };
1391
+ readonly 'inboxes:write': {
1392
+ readonly name: "inboxes:write";
1393
+ readonly category: ScopeCategory.INBOXES;
1394
+ readonly description: "Configure inboxes";
1395
+ readonly implies: readonly ["inboxes:read"];
1396
+ };
1397
+ readonly 'inboxes:admin': {
1398
+ readonly name: "inboxes:admin";
1399
+ readonly category: ScopeCategory.INBOXES;
1400
+ readonly description: "Delete inboxes";
1401
+ readonly implies: readonly ["inboxes:write"];
1402
+ };
1403
+ readonly 'phones:read': {
1404
+ readonly name: "phones:read";
1405
+ readonly category: ScopeCategory.PHONES;
1406
+ readonly description: "View phone numbers";
1407
+ };
1408
+ readonly 'phones:write': {
1409
+ readonly name: "phones:write";
1410
+ readonly category: ScopeCategory.PHONES;
1411
+ readonly description: "Configure phone numbers";
1412
+ readonly implies: readonly ["phones:read"];
1413
+ };
1414
+ readonly 'phones:admin': {
1415
+ readonly name: "phones:admin";
1416
+ readonly category: ScopeCategory.PHONES;
1417
+ readonly description: "Delete phone numbers";
1418
+ readonly implies: readonly ["phones:write"];
1419
+ };
1420
+ readonly 'webhooks:read': {
1421
+ readonly name: "webhooks:read";
1422
+ readonly category: ScopeCategory.WEBHOOKS;
1423
+ readonly description: "View webhook logs";
1424
+ };
1425
+ readonly 'webhooks:write': {
1426
+ readonly name: "webhooks:write";
1427
+ readonly category: ScopeCategory.WEBHOOKS;
1428
+ readonly description: "Configure webhooks";
1429
+ readonly implies: readonly ["webhooks:read"];
1430
+ };
1431
+ readonly 'webhooks:admin': {
1432
+ readonly name: "webhooks:admin";
1433
+ readonly category: ScopeCategory.WEBHOOKS;
1434
+ readonly description: "Delete webhooks";
1435
+ readonly implies: readonly ["webhooks:write"];
1436
+ };
1437
+ readonly 'webhooks:raw': {
1438
+ readonly name: "webhooks:raw";
1439
+ readonly category: ScopeCategory.WEBHOOKS;
1440
+ readonly description: "Access raw webhook payloads";
1441
+ };
1442
+ readonly 'apps:read': {
1443
+ readonly name: "apps:read";
1444
+ readonly category: ScopeCategory.APPS;
1445
+ readonly description: "View app integrations";
1446
+ };
1447
+ readonly 'apps:write': {
1448
+ readonly name: "apps:write";
1449
+ readonly category: ScopeCategory.APPS;
1450
+ readonly description: "Configure app integrations";
1451
+ readonly implies: readonly ["apps:read"];
1452
+ };
1453
+ readonly 'apps:admin': {
1454
+ readonly name: "apps:admin";
1455
+ readonly category: ScopeCategory.APPS;
1456
+ readonly description: "Delete app integrations";
1457
+ readonly implies: readonly ["apps:write"];
1458
+ };
1459
+ readonly 'labels:read': {
1460
+ readonly name: "labels:read";
1461
+ readonly category: ScopeCategory.LABELS;
1462
+ readonly description: "View labels";
1463
+ };
1464
+ readonly 'labels:write': {
1465
+ readonly name: "labels:write";
1466
+ readonly category: ScopeCategory.LABELS;
1467
+ readonly description: "Deprecated — label mutations now require the parent resource write scope (members:write, chats:write, files:write)";
1468
+ readonly implies: readonly ["labels:read"];
1469
+ };
1470
+ readonly 'analytics:read': {
1471
+ readonly name: "analytics:read";
1472
+ readonly category: ScopeCategory.ANALYTICS;
1473
+ readonly description: "View analytics and reports";
1474
+ };
1475
+ readonly 'export:read': {
1476
+ readonly name: "export:read";
1477
+ readonly category: ScopeCategory.EXPORT;
1478
+ readonly description: "Export workspace data";
1479
+ };
1480
+ readonly 'export:write': {
1481
+ readonly name: "export:write";
1482
+ readonly category: ScopeCategory.EXPORT;
1483
+ readonly description: "Export workspace data";
1484
+ readonly implies: readonly ["export:read"];
1485
+ };
1486
+ readonly 'export:admin': {
1487
+ readonly name: "export:admin";
1488
+ readonly category: ScopeCategory.EXPORT;
1489
+ readonly description: "Export all data including sensitive information";
1490
+ readonly implies: readonly ["export:write"];
1491
+ readonly dangerous: true;
1492
+ };
1493
+ readonly 'org:info': {
1494
+ readonly name: "org:info";
1495
+ readonly category: ScopeCategory.ORG;
1496
+ readonly description: "View basic org info and own workspaces";
1497
+ };
1498
+ readonly 'org:read': {
1499
+ readonly name: "org:read";
1500
+ readonly category: ScopeCategory.ORG;
1501
+ readonly description: "View org info";
1502
+ readonly implies: readonly ["org:info"];
1503
+ };
1504
+ readonly 'org:write': {
1505
+ readonly name: "org:write";
1506
+ readonly category: ScopeCategory.ORG;
1507
+ readonly description: "Update org settings";
1508
+ readonly implies: readonly ["org:read"];
1509
+ };
1510
+ readonly 'org:admin': {
1511
+ readonly name: "org:admin";
1512
+ readonly category: ScopeCategory.ORG;
1513
+ readonly description: "Full org management";
1514
+ readonly implies: readonly ["org:write"];
1515
+ readonly dangerous: true;
1516
+ };
1517
+ readonly 'operator:read': {
1518
+ readonly name: "operator:read";
1519
+ readonly category: ScopeCategory.OPERATOR;
1520
+ readonly description: "View operator dashboard and listen in";
1521
+ };
1522
+ readonly 'operator:write': {
1523
+ readonly name: "operator:write";
1524
+ readonly category: ScopeCategory.OPERATOR;
1525
+ readonly description: "Go Live and handle interactions as an operator";
1526
+ readonly implies: readonly ["operator:read"];
1527
+ };
1528
+ readonly 'org:manage_admins': {
1529
+ readonly name: "org:manage_admins";
1530
+ readonly category: ScopeCategory.ORG;
1531
+ readonly description: "Assign admin and owner roles (owner only)";
1532
+ readonly implies: readonly ["org:admin"];
1533
+ readonly dangerous: true;
1534
+ };
1535
+ readonly 'org:delete': {
1536
+ readonly name: "org:delete";
1537
+ readonly category: ScopeCategory.ORG;
1538
+ readonly description: "Delete organization (owner only)";
1539
+ readonly implies: readonly ["org:admin"];
1540
+ readonly dangerous: true;
1541
+ };
1542
+ };
1543
+ /**
1544
+ * Type-safe scope name. Use this instead of raw strings for scope checks.
1545
+ */
1546
+ type ScopeName = keyof typeof SCOPES;
1547
+ /**
1548
+ * Manager for scope operations and validations
1549
+ */
1550
+ declare class ScopeManager {
1551
+ /**
1552
+ * Get a scope by name
1553
+ */
1554
+ static getScope(name: ScopeName): ScopeDefinition;
1555
+ /**
1556
+ * Get all available scopes
1557
+ */
1558
+ static getAllScopes(): Record<ScopeName, ScopeDefinition>;
1559
+ /**
1560
+ * Get all scopes in a specific category
1561
+ */
1562
+ static getScopesByCategory(category: ScopeCategory): ScopeDefinition[];
1563
+ /**
1564
+ * Expand a list of scope names to include all implied scopes
1565
+ */
1566
+ static expandScopes(scopeNames: string[]): Set<string>;
1567
+ /**
1568
+ * Validate that all scope names are valid
1569
+ * @returns List of invalid scope names, or empty array if all valid
1570
+ * @throws Error if any scope names are invalid
1571
+ */
1572
+ static validateScopes(scopeNames: string[]): string[];
1573
+ /**
1574
+ * Get all dangerous scopes from a list of scope names
1575
+ */
1576
+ static getDangerousScopes(scopeNames: string[]): ScopeDefinition[];
1577
+ /**
1578
+ * Format scope descriptions grouped by category
1579
+ */
1580
+ static formatScopeDescription(scopeNames: string[]): Record<ScopeCategory, Array<{
1581
+ name: string;
1582
+ description: string;
1583
+ dangerous?: boolean;
1584
+ implied: boolean;
1585
+ }>>;
1586
+ /**
1587
+ * Parse a space-separated scope string into an array
1588
+ */
1589
+ static parseScopeString(scopeString: string): string[];
1590
+ /**
1591
+ * Convert scope array to space-separated string
1592
+ */
1593
+ static formatScopeString(scopes: string[]): string;
1594
+ }
1595
+ /**
1596
+ * Common scope combinations for convenience
1597
+ */
1598
+ declare const SCOPE_PRESETS: {
1599
+ /** Data access - members and records management */
1600
+ DATA: ScopeName[];
1601
+ /** Chat access - members and chat management */
1602
+ CHATS: ScopeName[];
1603
+ /** Full access - all available scopes */
1604
+ ALL: ScopeName[];
1605
+ };
1606
+
1607
+ export { type MetricDataPoint as $, type AIModelUsageResponse as A, type BaseChatModelConfig as B, type CallEndSection as C, DEFAULT_CHAT_MODEL as D, type EfficiencyMetricsResponse as E, type EmailUsageResponse as F, type EngineTimeSeries as G, type ErrorCodeBucket as H, type EventRuleMetrics as I, type ExportStatistics as J, type FeatureSyncStatus as K, type GeminiChatModelConfig as L, type GeminiRealtimeModelConfig as M, type GeminiThinkingLevel as N, type MetricSummary$1 as O, type HealthCheckStatistics as P, type HealthDetailRequest as Q, type HealthMetricsRequest as R, type HealthMetricsResponse as S, type HealthSummary as T, type ImportStatistics as U, type VoiceMetricsResponse$1 as V, type WorkspaceHealthResponse$1 as W, type InterruptionSound as X, type MemberNotificationPreferences as Y, type MemberNotifyActionParams as Z, type MemberUsageReport as _, type AIUsageDetailsResponse as a, type WorkspaceHealthDetail as a$, type MetricSection as a0, type MetricSummary as a1, type MetricValue as a2, type OpenAIChatModelConfig as a3, type OpenAIRealtimeModelConfig as a4, type OpenAIReasoningEffort as a5, type OpenAISemanticVADEagerness as a6, type OpenAISemanticVADTurnDetection as a7, type OpenAIServerVADTurnDetection as a8, type OpenAITurnDetection as a9, type SiteContext as aA, type SkippedWorkspace as aB, type StatisticsSummary as aC, type SystemStatistics as aD, type TTSModel as aE, type TTSPreviewProvider as aF, TTS_PREVIEW_PROVIDERS as aG, type TaskContext as aH, type TaskCountResponse as aI, type ThinkingSound as aJ, type TimeSeriesData as aK, type TimeSeriesDataPoint as aL, type ToolParameter as aM, type ToolkitContext as aN, ToolkitState as aO, type TopOffender as aP, type TopResourceOverageResponse as aQ, type TtsReconnectOutcomeEntry as aR, type TtsReconnectSection as aS, type UsageProductSummaryResponse as aT, type UsageReportResponse as aU, type UsageReportRequest as aV, type UsageStatistics as aW, type VoiceMetricsResponse as aX, type VoiceMetricsTimeRange as aY, type WebhookMetrics as aZ, type WorkflowContext as a_, type OpenAITurnDetectionType as aa, type PageContext as ab, type PerformanceMetrics as ac, type PhoneCallPhoneNumberUsageResponse as ad, type PhoneCallUsageResponse as ae, type PhoneCommunicationDetailsResponse as af, type PhoneNumberUsage as ag, type ProductOverageConfigResponse as ah, type ProvisionPlanRequest as ai, type ProvisionPlanResponse as aj, type RealtimeModelConfig as ak, type RequestsSection as al, type RequestsStatusEntry as am, type ResourceMetadata as an, type ResourceOverageResponse as ao, type ResourceScope as ap, type ResourceUsageResponse as aq, SCOPES as ar, SCOPE_PRESETS as as, type SMSCommunicationDetailsResponse as at, type SMSMessageUsageResponse as au, type SMSPhoneNumberUsageResponse as av, ScopeCategory as aw, type ScopeDefinition as ax, ScopeManager as ay, type ScopeName as az, type AWSRealtimeModelConfig as b, type WorkspaceHealthResponse as b0, type WorkspaceHealthRow as b1, type WorkspaceUsageReportResponse as b2, type XAIChatModelConfig as b3, type XAIRealtimeModelConfig as b4, type XAIReasoningEffort as b5, canPreviewVoice as b6, formatAppContextAsMarkdown as b7, getAllResourceSlugs as b8, getApplicableResourceSlugs as b9, getApplicableResources as ba, getResourceMetadata as bb, getScopeFromProductType as bc, getTTSProvider as bd, getVoiceModelId as be, type AnalyticsFilter as c, type AnalyticsQuery as d, type AppContext as e, type AttachedAddonInfo as f, type BaseRealtimeModelConfig as g, type BillingStatistics as h, type CallEndStatusEntry as i, type ChangeWorkspaceProductRequest as j, type ChangeWorkspaceProductResponse as k, type ChannelErrorBreakdown as l, type ChannelFailures as m, type ChatModelConfig as n, type ClaudeChatModelConfig as o, type CommunicationDetailsResponse as p, type CurrentPlanInfo as q, type CustomRealtimeModelConfig as r, DEFAULT_CUSTOM_VOICE_MODEL as s, DEFAULT_THINKING_SPEECH_PHRASES as t, DEFAULT_VOICE_INFERENCE_MODEL as u, type DailyPhoneRowResponse as v, type DailySMSRowResponse as w, type DashboardMetrics as x, type DataRecordContext as y, type EmailCountsResponse as z };