@getsupervisor/agents-studio-sdk 1.41.2-patch.15 → 1.41.2-patch.16

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.cts CHANGED
@@ -14,7 +14,7 @@ type components = {
14
14
  agentType: 'chat' | 'voice';
15
15
  workspaceId: string;
16
16
  versionId?: string;
17
- status: 'inactive' | 'training' | 'active' | 'archived';
17
+ status: 'inactive' | 'training' | 'active' | 'archived' | 'building';
18
18
  description?: string | null;
19
19
  avatarUrl?: string | null;
20
20
  debounceDelayMs?: number | null;
@@ -56,7 +56,7 @@ type components = {
56
56
  name: string;
57
57
  description?: string | null;
58
58
  agentType: 'chat' | 'voice';
59
- status: 'inactive' | 'training' | 'active' | 'archived';
59
+ status: 'inactive' | 'training' | 'active' | 'archived' | 'building';
60
60
  workspaceId: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
@@ -1994,12 +1994,11 @@ type SseCallbacks = {
1994
1994
  };
1995
1995
  type AgentsApi = {
1996
1996
  list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponse, ListAgentsOptions>>;
1997
- get(agentId: string): Promise<AgentDetail>;
1997
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentDetail>;
1998
1998
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentDetail>;
1999
1999
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentDetail>;
2000
2000
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentDetail>;
2001
2001
  update(agentId: string, payload: UpdateAgentRequest): Promise<AgentDetail>;
2002
- presignDocuments(files: PresignDocumentItem[]): Promise<PresignDocumentsResponse>;
2003
2002
  delete(agent: string | AgentEntity): Promise<void>;
2004
2003
  };
2005
2004
  type AgentListResponseWithEntities = {
@@ -2008,7 +2007,7 @@ type AgentListResponseWithEntities = {
2008
2007
  };
2009
2008
  type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'clone' | 'update' | 'list' | 'forkFromTemplate'> & {
2010
2009
  list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponseWithEntities, ListAgentsOptions>>;
2011
- get(agentId: string): Promise<AgentEntity>;
2010
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2012
2011
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2013
2012
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2014
2013
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2099,6 +2098,13 @@ declare function createCatalogsApi(cfg: ClientConfig & {
2099
2098
  remove(itemId: string): Promise<void>;
2100
2099
  };
2101
2100
 
2101
+ type DocumentsApi = {
2102
+ create(files: PresignDocumentItem[]): Promise<PresignDocumentsResponse>;
2103
+ };
2104
+ declare function createDocumentsApi(cfg: ClientConfig & {
2105
+ retry?: RetryPolicy;
2106
+ }): DocumentsApi;
2107
+
2102
2108
  declare function createSipTrunksApi(cfg: ClientConfig & {
2103
2109
  retry?: RetryPolicy;
2104
2110
  }): {
@@ -2282,12 +2288,11 @@ declare function createClient(initialCfg: ClientConfig & {
2282
2288
  triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
2283
2289
  };
2284
2290
  delete: (agent: string | AgentEntity) => Promise<void>;
2285
- presignDocuments: (files: PresignDocumentItem[]) => Promise<PresignDocumentsResponse>;
2286
2291
  list(options?: ListAgentsOptions): Promise<PaginatedResult<{
2287
2292
  data: AgentEntity[];
2288
2293
  meta: AgentListResponse["meta"];
2289
2294
  }, ListAgentsOptions>>;
2290
- get(agentId: string): Promise<AgentEntity>;
2295
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2291
2296
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2292
2297
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2293
2298
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2355,6 +2360,7 @@ declare function createClient(initialCfg: ClientConfig & {
2355
2360
  create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
2356
2361
  remove(itemId: string): Promise<void>;
2357
2362
  };
2363
+ documents: DocumentsApi;
2358
2364
  campaigns: {
2359
2365
  list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
2360
2366
  get(campaignId: string): Promise<Campaign>;
@@ -2443,12 +2449,11 @@ declare function createClient(initialCfg: ClientConfig & {
2443
2449
  triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
2444
2450
  };
2445
2451
  delete: (agent: string | AgentEntity) => Promise<void>;
2446
- presignDocuments: (files: PresignDocumentItem[]) => Promise<PresignDocumentsResponse>;
2447
2452
  list(options?: ListAgentsOptions): Promise<PaginatedResult<{
2448
2453
  data: AgentEntity[];
2449
2454
  meta: AgentListResponse["meta"];
2450
2455
  }, ListAgentsOptions>>;
2451
- get(agentId: string): Promise<AgentEntity>;
2456
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2452
2457
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2453
2458
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2454
2459
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2516,6 +2521,7 @@ declare function createClient(initialCfg: ClientConfig & {
2516
2521
  create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
2517
2522
  remove(itemId: string): Promise<void>;
2518
2523
  };
2524
+ documents: DocumentsApi;
2519
2525
  campaigns: {
2520
2526
  list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
2521
2527
  get(campaignId: string): Promise<Campaign>;
@@ -2583,4 +2589,4 @@ declare function createHttp(cfg: ClientConfig & {
2583
2589
  resolveAccessToken: () => string;
2584
2590
  };
2585
2591
 
2586
- 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 CreateSipTrunkRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type DocumentRef, 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 PresignDocumentItem, type PresignDocumentsRequest, type PresignDocumentsResponse, type PresignedDocument, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type ResourceBalance, type ResourceProjection, type RetryPolicy, type RuntimeCompleteEvent, type RuntimeErrorEvent, type RuntimeProgressEvent, type RuntimeSseEvent, type RuntimeUsage, type SipTrunk, type SipTrunkWithPassword, type SseCallbacks, 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 UpdateSipTrunkRequest, type UpdateWebhookRequest, type UsageAgentRow, type UsageAgentsAggregations, 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, createSipTrunksApi, createToolsApi, createUsageApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
2592
+ 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 CreateSipTrunkRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type DocumentRef, type DocumentsApi, 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 PresignDocumentItem, type PresignDocumentsRequest, type PresignDocumentsResponse, type PresignedDocument, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type ResourceBalance, type ResourceProjection, type RetryPolicy, type RuntimeCompleteEvent, type RuntimeErrorEvent, type RuntimeProgressEvent, type RuntimeSseEvent, type RuntimeUsage, type SipTrunk, type SipTrunkWithPassword, type SseCallbacks, 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 UpdateSipTrunkRequest, type UpdateWebhookRequest, type UsageAgentRow, type UsageAgentsAggregations, 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, createDocumentsApi, createHttp, createSipTrunksApi, createToolsApi, createUsageApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ type components = {
14
14
  agentType: 'chat' | 'voice';
15
15
  workspaceId: string;
16
16
  versionId?: string;
17
- status: 'inactive' | 'training' | 'active' | 'archived';
17
+ status: 'inactive' | 'training' | 'active' | 'archived' | 'building';
18
18
  description?: string | null;
19
19
  avatarUrl?: string | null;
20
20
  debounceDelayMs?: number | null;
@@ -56,7 +56,7 @@ type components = {
56
56
  name: string;
57
57
  description?: string | null;
58
58
  agentType: 'chat' | 'voice';
59
- status: 'inactive' | 'training' | 'active' | 'archived';
59
+ status: 'inactive' | 'training' | 'active' | 'archived' | 'building';
60
60
  workspaceId: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
@@ -1994,12 +1994,11 @@ type SseCallbacks = {
1994
1994
  };
1995
1995
  type AgentsApi = {
1996
1996
  list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponse, ListAgentsOptions>>;
1997
- get(agentId: string): Promise<AgentDetail>;
1997
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentDetail>;
1998
1998
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentDetail>;
1999
1999
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentDetail>;
2000
2000
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentDetail>;
2001
2001
  update(agentId: string, payload: UpdateAgentRequest): Promise<AgentDetail>;
2002
- presignDocuments(files: PresignDocumentItem[]): Promise<PresignDocumentsResponse>;
2003
2002
  delete(agent: string | AgentEntity): Promise<void>;
2004
2003
  };
2005
2004
  type AgentListResponseWithEntities = {
@@ -2008,7 +2007,7 @@ type AgentListResponseWithEntities = {
2008
2007
  };
2009
2008
  type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'clone' | 'update' | 'list' | 'forkFromTemplate'> & {
2010
2009
  list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponseWithEntities, ListAgentsOptions>>;
2011
- get(agentId: string): Promise<AgentEntity>;
2010
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2012
2011
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2013
2012
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2014
2013
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2099,6 +2098,13 @@ declare function createCatalogsApi(cfg: ClientConfig & {
2099
2098
  remove(itemId: string): Promise<void>;
2100
2099
  };
2101
2100
 
2101
+ type DocumentsApi = {
2102
+ create(files: PresignDocumentItem[]): Promise<PresignDocumentsResponse>;
2103
+ };
2104
+ declare function createDocumentsApi(cfg: ClientConfig & {
2105
+ retry?: RetryPolicy;
2106
+ }): DocumentsApi;
2107
+
2102
2108
  declare function createSipTrunksApi(cfg: ClientConfig & {
2103
2109
  retry?: RetryPolicy;
2104
2110
  }): {
@@ -2282,12 +2288,11 @@ declare function createClient(initialCfg: ClientConfig & {
2282
2288
  triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
2283
2289
  };
2284
2290
  delete: (agent: string | AgentEntity) => Promise<void>;
2285
- presignDocuments: (files: PresignDocumentItem[]) => Promise<PresignDocumentsResponse>;
2286
2291
  list(options?: ListAgentsOptions): Promise<PaginatedResult<{
2287
2292
  data: AgentEntity[];
2288
2293
  meta: AgentListResponse["meta"];
2289
2294
  }, ListAgentsOptions>>;
2290
- get(agentId: string): Promise<AgentEntity>;
2295
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2291
2296
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2292
2297
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2293
2298
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2355,6 +2360,7 @@ declare function createClient(initialCfg: ClientConfig & {
2355
2360
  create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
2356
2361
  remove(itemId: string): Promise<void>;
2357
2362
  };
2363
+ documents: DocumentsApi;
2358
2364
  campaigns: {
2359
2365
  list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
2360
2366
  get(campaignId: string): Promise<Campaign>;
@@ -2443,12 +2449,11 @@ declare function createClient(initialCfg: ClientConfig & {
2443
2449
  triggers: AgentStageTriggersApi$1 & ((agentId: string, blueprintId: string, stageId: string) => ReturnType<typeof bindAgentStageTriggers>);
2444
2450
  };
2445
2451
  delete: (agent: string | AgentEntity) => Promise<void>;
2446
- presignDocuments: (files: PresignDocumentItem[]) => Promise<PresignDocumentsResponse>;
2447
2452
  list(options?: ListAgentsOptions): Promise<PaginatedResult<{
2448
2453
  data: AgentEntity[];
2449
2454
  meta: AgentListResponse["meta"];
2450
2455
  }, ListAgentsOptions>>;
2451
- get(agentId: string): Promise<AgentEntity>;
2456
+ get(agentId: string, callbacks?: SseCallbacks): Promise<AgentEntity>;
2452
2457
  create(payload: CreateAgentRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
2453
2458
  clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
2454
2459
  forkFromTemplate(payload: ForkAgentFromTemplateRequest, callbacks?: SseCallbacks): Promise<AgentEntity>;
@@ -2516,6 +2521,7 @@ declare function createClient(initialCfg: ClientConfig & {
2516
2521
  create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
2517
2522
  remove(itemId: string): Promise<void>;
2518
2523
  };
2524
+ documents: DocumentsApi;
2519
2525
  campaigns: {
2520
2526
  list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
2521
2527
  get(campaignId: string): Promise<Campaign>;
@@ -2583,4 +2589,4 @@ declare function createHttp(cfg: ClientConfig & {
2583
2589
  resolveAccessToken: () => string;
2584
2590
  };
2585
2591
 
2586
- 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 CreateSipTrunkRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type DocumentRef, 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 PresignDocumentItem, type PresignDocumentsRequest, type PresignDocumentsResponse, type PresignedDocument, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type ResourceBalance, type ResourceProjection, type RetryPolicy, type RuntimeCompleteEvent, type RuntimeErrorEvent, type RuntimeProgressEvent, type RuntimeSseEvent, type RuntimeUsage, type SipTrunk, type SipTrunkWithPassword, type SseCallbacks, 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 UpdateSipTrunkRequest, type UpdateWebhookRequest, type UsageAgentRow, type UsageAgentsAggregations, 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, createSipTrunksApi, createToolsApi, createUsageApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
2592
+ 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 CreateSipTrunkRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type DocumentRef, type DocumentsApi, 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 PresignDocumentItem, type PresignDocumentsRequest, type PresignDocumentsResponse, type PresignedDocument, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type ResourceBalance, type ResourceProjection, type RetryPolicy, type RuntimeCompleteEvent, type RuntimeErrorEvent, type RuntimeProgressEvent, type RuntimeSseEvent, type RuntimeUsage, type SipTrunk, type SipTrunkWithPassword, type SseCallbacks, 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 UpdateSipTrunkRequest, type UpdateWebhookRequest, type UsageAgentRow, type UsageAgentsAggregations, 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, createDocumentsApi, createHttp, createSipTrunksApi, createToolsApi, createUsageApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
package/dist/index.js CHANGED
@@ -1265,6 +1265,31 @@ function createAgentsApi(cfg, relatedApis) {
1265
1265
  body: JSON.stringify(payload),
1266
1266
  headers
1267
1267
  });
1268
+ if (!res.ok) {
1269
+ const body = await res.text();
1270
+ throw new Error(`POST ${url} failed with status ${res.status}: ${body}`);
1271
+ }
1272
+ const contentType = res.headers.get("content-type") ?? "";
1273
+ if (contentType.includes("application/json")) {
1274
+ const agent = await res.json();
1275
+ callbacks.onAgentCreated?.(agent);
1276
+ return agent;
1277
+ }
1278
+ return consumeSseStream(
1279
+ res,
1280
+ buildSseHandlers(callbacks),
1281
+ "agent-created"
1282
+ );
1283
+ };
1284
+ const getWithSse = async (url, callbacks) => {
1285
+ requireWorkspace();
1286
+ const headers = buildHeaders({});
1287
+ const fx = cfg.fetchImpl ?? fetch;
1288
+ const res = await fx(url, { method: "GET", headers });
1289
+ if (!res.ok) {
1290
+ const body = await res.text();
1291
+ throw new Error(`GET ${url} failed with status ${res.status}: ${body}`);
1292
+ }
1268
1293
  const contentType = res.headers.get("content-type") ?? "";
1269
1294
  if (contentType.includes("application/json")) {
1270
1295
  const agent = await res.json();
@@ -1293,7 +1318,10 @@ function createAgentsApi(cfg, relatedApis) {
1293
1318
  const response = await fetchPage(opts);
1294
1319
  return attachPaginator(response, fetchPage, opts);
1295
1320
  },
1296
- async get(agentId) {
1321
+ async get(agentId, callbacks) {
1322
+ if (callbacks) {
1323
+ return getWithSse(`${base}/agents/${agentId}`, callbacks);
1324
+ }
1297
1325
  requireWorkspace();
1298
1326
  const res = await doFetch(`${base}/agents/${agentId}`, { method: "GET" });
1299
1327
  return res.json();
@@ -1325,9 +1353,6 @@ function createAgentsApi(cfg, relatedApis) {
1325
1353
  });
1326
1354
  return res.json();
1327
1355
  },
1328
- async presignDocuments(files) {
1329
- return postJson(`${base}/documents`, { files });
1330
- },
1331
1356
  async delete(agent) {
1332
1357
  requireWorkspace();
1333
1358
  await doFetch(`${base}/agents/${resolveAgentId(agent)}`, {
@@ -1371,8 +1396,8 @@ function withEntityWrapping(api, fetchPage, deps) {
1371
1396
  const initial = await wrapList(opts);
1372
1397
  return attachPaginator(initial, wrapList, opts);
1373
1398
  },
1374
- async get(agentId) {
1375
- return wrapAgent(await api.get(agentId));
1399
+ async get(agentId, callbacks) {
1400
+ return wrapAgent(await api.get(agentId, callbacks));
1376
1401
  },
1377
1402
  async create(payload, callbacks) {
1378
1403
  return wrapAgent(await api.create(payload, callbacks));
@@ -1648,6 +1673,34 @@ function createCatalogsApi(cfg) {
1648
1673
  };
1649
1674
  }
1650
1675
 
1676
+ // src/api/documents.ts
1677
+ function createDocumentsApi(cfg) {
1678
+ const { base, doFetch, resolveWorkspaceId, resolveApiKey } = createHttp(cfg);
1679
+ const jsonHeaders = { "content-type": "application/json" };
1680
+ const requireWorkspace = () => {
1681
+ const workspaceId = resolveWorkspaceId();
1682
+ if (typeof workspaceId === "string" && workspaceId.trim().length > 0) {
1683
+ return;
1684
+ }
1685
+ const apiKey = resolveApiKey();
1686
+ if (typeof apiKey === "string" && apiKey.trim().length > 0) {
1687
+ return;
1688
+ }
1689
+ throw new WorkspaceNotSelectedError();
1690
+ };
1691
+ return {
1692
+ async create(files) {
1693
+ requireWorkspace();
1694
+ const res = await doFetch(`${base}/documents`, {
1695
+ method: "POST",
1696
+ body: JSON.stringify({ files }),
1697
+ headers: jsonHeaders
1698
+ });
1699
+ return res.json();
1700
+ }
1701
+ };
1702
+ }
1703
+
1651
1704
  // src/api/sip-trunks.ts
1652
1705
  function createSipTrunksApi(cfg) {
1653
1706
  const { base, doFetch } = createHttp(cfg);
@@ -2445,6 +2498,7 @@ function createClient(initialCfg) {
2445
2498
  ...catalogsApi,
2446
2499
  templates: catalogTemplatesApi
2447
2500
  },
2501
+ documents: createDocumentsApi(runtimeCfg),
2448
2502
  campaigns: createCampaignsApi(runtimeCfg),
2449
2503
  voices: voicesApi,
2450
2504
  apiKeys: apiKeysApi,
@@ -2540,6 +2594,7 @@ export {
2540
2594
  createCatalogTemplatesApi,
2541
2595
  createCatalogsApi,
2542
2596
  createClient,
2597
+ createDocumentsApi,
2543
2598
  createHttp,
2544
2599
  createSipTrunksApi,
2545
2600
  createToolsApi,