@getsupervisor/agents-studio-sdk 1.41.2-patch.10 → 1.41.2-patch.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ type WithRequired<T, K extends keyof T> = T & {
2
+ [P in K]-?: T[P];
3
+ };
4
+ type Without<T, U> = {
5
+ [P in Exclude<keyof T, keyof U>]?: never;
6
+ };
7
+ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
8
+ type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never;
1
9
  type components = {
2
10
  schemas: {
3
11
  AgentDetail: {
@@ -27,6 +35,9 @@ type components = {
27
35
  } | null;
28
36
  createdAt: string;
29
37
  updatedAt: string;
38
+ totalCalls: number;
39
+ totalOperationalDays: number;
40
+ goalAchievedPercentage: number;
30
41
  metadata?: {
31
42
  [key: string]: unknown;
32
43
  };
@@ -58,7 +69,7 @@ type components = {
58
69
  name: string;
59
70
  description?: string | null;
60
71
  agentType: 'chat' | 'voice';
61
- status?: 'inactive' | 'training' | 'active' | null;
72
+ status?: 'inactive' | 'training' | 'active';
62
73
  avatarUrl?: string | null;
63
74
  debounceDelayMs?: number | null;
64
75
  metadata?: {
@@ -235,9 +246,9 @@ type components = {
235
246
  voiceId?: string | null;
236
247
  startSpeaker: 'user' | 'agent';
237
248
  requiredData: string[];
238
- criticalRules: string[];
239
- topicsAllowed: string[];
240
- topicsForbidden: string[];
249
+ criticalRules?: string[];
250
+ topicsAllowed?: string[];
251
+ topicsForbidden?: string[];
241
252
  contentHash: string | null;
242
253
  contentVariables: string[];
243
254
  variablesCache: string[];
@@ -312,7 +323,7 @@ type components = {
312
323
  name: string;
313
324
  title?: string | null;
314
325
  goalPrompt: string;
315
- promptInstructions: string[];
326
+ promptInstructions?: string[];
316
327
  order?: number | null;
317
328
  triggers?: components['schemas']['BlueprintStageTriggerInput'][] | null;
318
329
  metadata?: {
@@ -323,7 +334,7 @@ type components = {
323
334
  name?: string;
324
335
  title?: string | null;
325
336
  goalPrompt?: string;
326
- promptInstructions: string[];
337
+ promptInstructions?: string[];
327
338
  order?: number | null;
328
339
  metadata?: {
329
340
  [key: string]: unknown;
@@ -359,9 +370,9 @@ type components = {
359
370
  name: string;
360
371
  title?: string | null;
361
372
  goalPrompt: string;
362
- promptInstructions: string[];
373
+ promptInstructions?: string[];
363
374
  order?: number | null;
364
- triggers: components['schemas']['BlueprintStageTriggerInput'][] | null;
375
+ triggers?: components['schemas']['BlueprintStageTriggerInput'][] | null;
365
376
  metadata?: {
366
377
  [key: string]: unknown;
367
378
  } | null;
@@ -370,7 +381,7 @@ type components = {
370
381
  agent_id: string;
371
382
  phone_id: string;
372
383
  test_phones?: string[];
373
- allow_all: boolean;
384
+ allow_all?: boolean;
374
385
  };
375
386
  PhoneAssignmentResponse: {
376
387
  agent_id: string;
@@ -383,7 +394,7 @@ type components = {
383
394
  WorkspacePhone: {
384
395
  id: string;
385
396
  external_id: string;
386
- channel?: 'voice' | null;
397
+ channel?: 'voice';
387
398
  supports_outbound?: boolean | null;
388
399
  assigned_to?: string | null;
389
400
  last_used_at?: string | null;
@@ -502,7 +513,7 @@ type components = {
502
513
  self: string;
503
514
  catalog: string;
504
515
  };
505
- CatalogItemSummary: {
516
+ CatalogItemSummary: WithRequired<{
506
517
  id: string;
507
518
  type: 'language' | 'message_style' | 'tone_style' | 'tag' | 'voice';
508
519
  systemIdentifier: string;
@@ -515,13 +526,13 @@ type components = {
515
526
  createdAt: string;
516
527
  updatedAt: string;
517
528
  links: components['schemas']['CatalogItemLinks'];
518
- } & (unknown & unknown & unknown & unknown & unknown);
529
+ }, 'id' | 'type' | 'systemIdentifier' | 'scope' | 'name' | 'description' | 'isActive' | 'metadata' | 'createdAt' | 'updatedAt' | 'links'>;
519
530
  CatalogItemDetail: components['schemas']['CatalogItemSummary'];
520
531
  CatalogItemListResponse: {
521
532
  data: components['schemas']['CatalogItemSummary'][];
522
533
  meta: components['schemas']['PaginationMeta'];
523
534
  };
524
- CatalogItemCreateRequest: {
535
+ CatalogItemCreateRequest: WithRequired<{
525
536
  type: 'language' | 'message_style' | 'tone_style' | 'tag' | 'voice';
526
537
  scope: 'global' | 'workspace';
527
538
  workspaceId?: string;
@@ -529,8 +540,8 @@ type components = {
529
540
  description: string;
530
541
  systemIdentifier?: string;
531
542
  metadata: Record<string, never>;
532
- isActive: boolean;
533
- } & (unknown & unknown & unknown & unknown & unknown & unknown);
543
+ isActive?: boolean;
544
+ }, 'type' | 'scope' | 'name' | 'description' | 'metadata'>;
534
545
  WorkspaceEnableRequest: {
535
546
  apiKey: string;
536
547
  phone: string;
@@ -547,7 +558,6 @@ type components = {
547
558
  details?: {
548
559
  subcode?: string;
549
560
  workspaceId?: string;
550
- } & {
551
561
  [key: string]: unknown;
552
562
  };
553
563
  };
@@ -556,7 +566,7 @@ type components = {
556
566
  url: string;
557
567
  agentId?: string | null;
558
568
  description?: string | null;
559
- method: 'GET' | 'POST';
569
+ method?: 'GET' | 'POST';
560
570
  isActive: boolean;
561
571
  secretPreview?: string | null;
562
572
  createdAt: string;
@@ -578,12 +588,12 @@ type components = {
578
588
  url: string;
579
589
  agentId?: string | null;
580
590
  description?: string | null;
581
- isActive: boolean;
591
+ isActive?: boolean;
582
592
  headers?: {
583
593
  [key: string]: string;
584
594
  };
585
595
  secret?: string;
586
- method: 'GET' | 'POST';
596
+ method?: 'GET' | 'POST';
587
597
  };
588
598
  UpdateWebhookRequest: {
589
599
  url?: string;
@@ -610,7 +620,7 @@ type components = {
610
620
  };
611
621
  CreateEventSubscriptionRequest: {
612
622
  eventKey: string;
613
- isActive: boolean;
623
+ isActive?: boolean;
614
624
  };
615
625
  UpdateEventSubscriptionRequest: {
616
626
  isActive?: boolean;
@@ -692,18 +702,63 @@ type components = {
692
702
  data: components['schemas']['Call'][];
693
703
  meta: components['schemas']['CallsStreamMeta'];
694
704
  };
705
+ ResourceProjection: {
706
+ estimatedAtClose: number;
707
+ dailyBurnRate: number;
708
+ daysRemaining: number | null;
709
+ willExceed: boolean;
710
+ };
711
+ ResourceBalance: {
712
+ resource: string;
713
+ limit: number;
714
+ used: number;
715
+ remaining: number;
716
+ unit: string;
717
+ projection: components['schemas']['ResourceProjection'];
718
+ };
719
+ SubscriptionInfo: {
720
+ id: string;
721
+ status: 'active' | 'paused';
722
+ billingCycle: 'monthly' | 'yearly';
723
+ currentPeriodStart: string;
724
+ currentPeriodEnd: string;
725
+ };
726
+ BillingBalanceResponse: {
727
+ subscription: components['schemas']['SubscriptionInfo'];
728
+ resources: components['schemas']['ResourceBalance'][];
729
+ };
730
+ UsageAgentRow: {
731
+ agentId: string;
732
+ agentName: string | null;
733
+ status: 'inactive' | 'training' | 'active' | 'archived' | null;
734
+ totalQuantity: number;
735
+ totalEvents: number;
736
+ percentOfTotal: number;
737
+ lastActivity: string;
738
+ };
739
+ UsageAgentsMeta: {
740
+ total: number;
741
+ page: number;
742
+ limit: number;
743
+ hasNext: boolean;
744
+ hasPrevious: boolean;
745
+ };
746
+ UsageAgentsResponse: {
747
+ data: components['schemas']['UsageAgentRow'][];
748
+ meta: components['schemas']['UsageAgentsMeta'];
749
+ };
695
750
  ForkAgentFromTemplateRequest: {
696
751
  templateId: string;
697
752
  templateVersionId?: string;
698
753
  name?: string | null;
699
754
  description?: string | null;
700
- status?: 'inactive' | 'training' | 'active' | null;
755
+ status?: 'inactive' | 'training' | 'active';
701
756
  debounceDelayMs?: number | null;
702
757
  };
703
758
  CloneAgentRequest: {
704
759
  name: string;
705
760
  description?: string | null;
706
- status?: 'inactive' | 'training' | 'active' | null;
761
+ status?: 'inactive' | 'training' | 'active';
707
762
  versionId: string;
708
763
  clone: ('instructions' | 'tools' | 'webhooks' | 'stages' | 'triggers' | 'businessHours' | 'businessHourExceptions')[];
709
764
  };
@@ -761,9 +816,12 @@ type components = {
761
816
  description?: string;
762
817
  notes?: string[];
763
818
  prompts?: components['schemas']['ToolConfigSchemaActionPrompts'];
764
- schema: {
765
- [key: string]: unknown;
766
- } | boolean;
819
+ schema: OneOf<[
820
+ {
821
+ [key: string]: unknown;
822
+ },
823
+ boolean
824
+ ]>;
767
825
  };
768
826
  ToolConfigSchema: {
769
827
  schemaVersion: 'json-schema/2020-12';
@@ -853,13 +911,11 @@ type components = {
853
911
  CatalogItemMessageStyleMetadata: {
854
912
  register?: string | null;
855
913
  sample?: string | null;
856
- } & {
857
914
  [key: string]: unknown;
858
915
  };
859
916
  CatalogItemToneStyleMetadata: {
860
917
  mood?: string | null;
861
918
  intensity?: string | null;
862
- } & {
863
919
  [key: string]: unknown;
864
920
  };
865
921
  CatalogItemTagMetadata: {
@@ -917,34 +973,37 @@ type components = {
917
973
  ToolId: string;
918
974
  ResourceId: string;
919
975
  CatalogItemId: string;
920
- PageParam: number;
921
- LimitParam: number;
922
- Page: number;
923
- Limit: number;
924
- SortParam: string;
925
- FieldsParam: string;
926
- IncludeParam: string;
927
- SearchParam: string;
928
- FilterParam: components['schemas']['QueryFilters'];
976
+ PageParam?: number;
977
+ LimitParam?: number;
978
+ Page?: number;
979
+ Limit?: number;
980
+ SortParam?: string;
981
+ FieldsParam?: string;
982
+ IncludeParam?: string;
983
+ SearchParam?: string;
984
+ FilterParam?: components['schemas']['QueryFilters'];
929
985
  WebhookId: string;
930
986
  SubscriptionId: string;
931
987
  CallId: string;
932
- AgentBatchIdQuery: string;
933
- AgentIdQuery: string;
934
- ExecutionIdQuery: string;
935
- RecordedAfterParam: string;
936
- RecordedBeforeParam: string;
988
+ AgentBatchIdQuery?: string;
989
+ AgentIdQuery?: string;
990
+ ExecutionIdQuery?: string;
991
+ RecordedAfterParam?: string;
992
+ RecordedBeforeParam?: string;
937
993
  CallsAfterParam: string;
938
- CallsStreamLimitParam: number;
939
- OrParam: components['schemas']['QueryOrGroups'];
994
+ CallsStreamLimitParam?: number;
995
+ UsageResourceQuery?: string;
996
+ UsageFromQuery?: string;
997
+ UsageToQuery?: string;
998
+ OrParam?: components['schemas']['QueryOrGroups'];
940
999
  ScheduleId: string;
941
1000
  ApiKeyId: string;
942
- XCacheRefresh: boolean;
1001
+ XCacheRefresh?: boolean;
943
1002
  IdempotencyKey: string;
944
- XApiKey: string;
945
- DurationBucketQuery: 'short' | 'medium' | 'long';
946
- GoalStatusQuery: 'achieved' | 'not_achieved';
947
- SearchQuery: string;
1003
+ XApiKey?: string;
1004
+ DurationBucketQuery?: 'short' | 'medium' | 'long';
1005
+ GoalStatusQuery?: 'achieved' | 'not_achieved';
1006
+ SearchQuery?: string;
948
1007
  DeliveryId: string;
949
1008
  };
950
1009
  requestBodies: never;
@@ -1127,6 +1186,13 @@ type AgentBlueprint = {
1127
1186
  contentHash: string | null;
1128
1187
  contentVariables: string[];
1129
1188
  variablesCache: string[];
1189
+ outputVariables: Array<{
1190
+ type: 'string' | 'enum' | 'boolean' | 'number';
1191
+ name: string;
1192
+ description: string;
1193
+ required: boolean;
1194
+ choices?: string[];
1195
+ }>;
1130
1196
  createdAt: string;
1131
1197
  updatedAt: string;
1132
1198
  };
@@ -1154,6 +1220,13 @@ type CreateAgentBlueprintRequest = {
1154
1220
  criticalRules?: string[];
1155
1221
  topicsAllowed?: string[];
1156
1222
  topicsForbidden?: string[];
1223
+ outputVariables?: Array<{
1224
+ type: 'string' | 'text' | 'enum' | 'boolean' | 'number';
1225
+ name: string;
1226
+ description: string;
1227
+ required?: boolean;
1228
+ choices?: string[];
1229
+ }>;
1157
1230
  };
1158
1231
  type UpdateAgentBlueprintRequest = {
1159
1232
  languageId?: string;
@@ -1169,6 +1242,13 @@ type UpdateAgentBlueprintRequest = {
1169
1242
  criticalRules?: string[];
1170
1243
  topicsAllowed?: string[];
1171
1244
  topicsForbidden?: string[];
1245
+ outputVariables?: Array<{
1246
+ type: 'string' | 'text' | 'enum' | 'boolean' | 'number';
1247
+ name: string;
1248
+ description: string;
1249
+ required?: boolean;
1250
+ choices?: string[];
1251
+ }>;
1172
1252
  };
1173
1253
  type BlueprintStageSchema = components['schemas']['BlueprintStage'];
1174
1254
  type BlueprintStage = Omit<BlueprintStageSchema, 'prompt'> & {
@@ -1213,6 +1293,13 @@ type ToolConnectionListItem = components['schemas']['ToolConnectionListItem'];
1213
1293
  type ToolConnectionListResponse = components['schemas']['ToolConnectionListResponse'];
1214
1294
  type ExecuteToolConnectionRequest = components['schemas']['ExecuteToolConnectionRequest'];
1215
1295
  type ErrorResponse = components['schemas']['ErrorResponse'];
1296
+ type ResourceProjection = components['schemas']['ResourceProjection'];
1297
+ type ResourceBalance = components['schemas']['ResourceBalance'];
1298
+ type SubscriptionInfo = components['schemas']['SubscriptionInfo'];
1299
+ type BillingBalanceResponse = components['schemas']['BillingBalanceResponse'];
1300
+ type UsageAgentRow = components['schemas']['UsageAgentRow'];
1301
+ type UsageAgentsMeta = components['schemas']['UsageAgentsMeta'];
1302
+ type UsageAgentsResponse = components['schemas']['UsageAgentsResponse'];
1216
1303
  type CampaignStatus = components['schemas']['CampaignStatus'];
1217
1304
  type Campaign = components['schemas']['Campaign'];
1218
1305
  type CampaignListResponse = components['schemas']['CampaignListResponse'];
@@ -1811,6 +1898,12 @@ declare function createApiKeysApi(cfg: ClientConfig & {
1811
1898
  retry?: RetryPolicy;
1812
1899
  }): ApiKeysApi;
1813
1900
 
1901
+ declare function createBillingApi(cfg: ClientConfig & {
1902
+ retry?: RetryPolicy;
1903
+ }): {
1904
+ getBalance(): Promise<BillingBalanceResponse>;
1905
+ };
1906
+
1814
1907
  type ListCallsOptions = ListQueryOptions & Partial<{
1815
1908
  agentBatchId: string;
1816
1909
  agentId: string;
@@ -1912,6 +2005,17 @@ declare function createToolsApi(cfg: ClientConfig & {
1912
2005
  executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
1913
2006
  };
1914
2007
 
2008
+ type ListUsageAgentsOptions = ListQueryOptions & Partial<{
2009
+ resource: string;
2010
+ from: string;
2011
+ to: string;
2012
+ }>;
2013
+ declare function createUsageApi(cfg: ClientConfig & {
2014
+ retry?: RetryPolicy;
2015
+ }): {
2016
+ agents(options?: ListUsageAgentsOptions): Promise<PaginatedResult<UsageAgentsResponse, ListUsageAgentsOptions>>;
2017
+ };
2018
+
1915
2019
  type ListVoicesOptions = ListQueryOptions & {
1916
2020
  agentId?: string;
1917
2021
  agentVersionId?: string;
@@ -2120,11 +2224,17 @@ declare function createClient(initialCfg: ClientConfig & {
2120
2224
  list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
2121
2225
  };
2122
2226
  apiKeys: ApiKeysApi;
2227
+ billing: {
2228
+ getBalance(): Promise<BillingBalanceResponse>;
2229
+ };
2123
2230
  calls: {
2124
2231
  list(options?: ListCallsOptions): Promise<PaginatedResult<CallsListResponse, ListCallsOptions>>;
2125
2232
  stream(options: StreamCallsOptions): Promise<CallsStreamResponse>;
2126
2233
  get(callId: string): Promise<Call>;
2127
2234
  };
2235
+ usage: {
2236
+ agents(options?: ListUsageAgentsOptions): Promise<PaginatedResult<UsageAgentsResponse, ListUsageAgentsOptions>>;
2237
+ };
2128
2238
  webhooks: {
2129
2239
  list(options?: ListWebhooksOptions): Promise<PaginatedResult<WebhookListResponse, ListWebhooksOptions>>;
2130
2240
  create(payload: CreateWebhookRequest): Promise<WebhookDetail>;
@@ -2267,11 +2377,17 @@ declare function createClient(initialCfg: ClientConfig & {
2267
2377
  list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
2268
2378
  };
2269
2379
  apiKeys: ApiKeysApi;
2380
+ billing: {
2381
+ getBalance(): Promise<BillingBalanceResponse>;
2382
+ };
2270
2383
  calls: {
2271
2384
  list(options?: ListCallsOptions): Promise<PaginatedResult<CallsListResponse, ListCallsOptions>>;
2272
2385
  stream(options: StreamCallsOptions): Promise<CallsStreamResponse>;
2273
2386
  get(callId: string): Promise<Call>;
2274
2387
  };
2388
+ usage: {
2389
+ agents(options?: ListUsageAgentsOptions): Promise<PaginatedResult<UsageAgentsResponse, ListUsageAgentsOptions>>;
2390
+ };
2275
2391
  webhooks: {
2276
2392
  list(options?: ListWebhooksOptions): Promise<PaginatedResult<WebhookListResponse, ListWebhooksOptions>>;
2277
2393
  create(payload: CreateWebhookRequest): Promise<WebhookDetail>;
@@ -2311,4 +2427,4 @@ declare function createHttp(cfg: ClientConfig & {
2311
2427
  resolveAccessToken: () => string;
2312
2428
  };
2313
2429
 
2314
- export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type CloneAgentComponent, type CloneAgentPayload, type CloneAgentRequest, type CloneAgentSelection, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, type StreamCallsOptions, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDeliveryDetail, type WebhookDeliveryListResponse, type WebhookDeliverySummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
2430
+ export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BillingBalanceResponse, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type CloneAgentComponent, type CloneAgentPayload, type CloneAgentRequest, type CloneAgentSelection, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListUsageAgentsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type ResourceBalance, type ResourceProjection, type RetryPolicy, type StreamCallsOptions, type SubscriptionInfo, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type UsageAgentRow, type UsageAgentsMeta, type UsageAgentsResponse, type VoiceListResponse, type VoiceSummary, type WebhookDeliveryDetail, type WebhookDeliveryListResponse, type WebhookDeliverySummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createBillingApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createUsageApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
package/dist/index.js CHANGED
@@ -1319,6 +1319,19 @@ function createApiKeysApi(cfg) {
1319
1319
  };
1320
1320
  }
1321
1321
 
1322
+ // src/api/billing.ts
1323
+ function createBillingApi(cfg) {
1324
+ const { base, doFetch } = createHttp(cfg);
1325
+ return {
1326
+ async getBalance() {
1327
+ const res = await doFetch(`${base}/billing/balance`, {
1328
+ method: "GET"
1329
+ });
1330
+ return res.json();
1331
+ }
1332
+ };
1333
+ }
1334
+
1322
1335
  // src/api/calls.ts
1323
1336
  function createCallsApi(cfg) {
1324
1337
  const { base, doFetch } = createHttp(cfg);
@@ -1723,6 +1736,33 @@ function createToolsApi(cfg) {
1723
1736
  };
1724
1737
  }
1725
1738
 
1739
+ // src/api/usage.ts
1740
+ function createUsageApi(cfg) {
1741
+ const { base, doFetch } = createHttp(cfg);
1742
+ const fetchUsageAgentsPage = async (options = {}) => {
1743
+ const { resource, from, to, ...listOptions } = options ?? {};
1744
+ const query = serializeListOptions(listOptions, {
1745
+ resource,
1746
+ from,
1747
+ to
1748
+ });
1749
+ const res = await doFetch(`${base}/usage/agents`, {
1750
+ method: "GET",
1751
+ query
1752
+ });
1753
+ return res.json();
1754
+ };
1755
+ return {
1756
+ async agents(options = {}) {
1757
+ const normalizedOptions = {
1758
+ ...options ?? {}
1759
+ };
1760
+ const response = await fetchUsageAgentsPage(normalizedOptions);
1761
+ return attachPaginator(response, fetchUsageAgentsPage, normalizedOptions);
1762
+ }
1763
+ };
1764
+ }
1765
+
1726
1766
  // src/utils/catalog-voices.ts
1727
1767
  var FALLBACK_LOCALE = "und";
1728
1768
  var FALLBACK_PROVIDER = "catalog";
@@ -2230,7 +2270,9 @@ function createClient(initialCfg) {
2230
2270
  campaigns: createCampaignsApi(runtimeCfg),
2231
2271
  voices: voicesApi,
2232
2272
  apiKeys: apiKeysApi,
2273
+ billing: createBillingApi(runtimeCfg),
2233
2274
  calls: callsApi,
2275
+ usage: createUsageApi(runtimeCfg),
2234
2276
  webhooks: webhooksApi
2235
2277
  };
2236
2278
  return {
@@ -2313,6 +2355,7 @@ export {
2313
2355
  createAgentVersionsApi,
2314
2356
  createAgentsApi,
2315
2357
  createApiKeysApi,
2358
+ createBillingApi,
2316
2359
  createCallsApi,
2317
2360
  createCampaignsApi,
2318
2361
  createCatalogTemplatesApi,
@@ -2320,6 +2363,7 @@ export {
2320
2363
  createClient,
2321
2364
  createHttp,
2322
2365
  createToolsApi,
2366
+ createUsageApi,
2323
2367
  createVoicesApi,
2324
2368
  createWebhooksApi,
2325
2369
  createWorkspacesApi,