@getsupervisor/agents-studio-sdk 1.41.0-patch.2 → 1.41.0-patch.4

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
@@ -547,6 +547,8 @@ type components = {
547
547
  code: string;
548
548
  message: string;
549
549
  details?: {
550
+ subcode?: string;
551
+ workspaceId?: string;
550
552
  [key: string]: unknown;
551
553
  };
552
554
  };
@@ -725,6 +727,21 @@ type components = {
725
727
  [key: string]: components['schemas']['ToolConfigSchemaAction'];
726
728
  };
727
729
  };
730
+ ToolConnectionListItem: {
731
+ toolAgentConnectionId: string;
732
+ toolId: string;
733
+ workspaceId: string;
734
+ agentId: string;
735
+ connectionKey: string;
736
+ status: 'connected' | 'pending' | 'error' | 'revoked';
737
+ providerRef?: string | null;
738
+ descriptionUsage?: string | null;
739
+ usageExample?: string | null;
740
+ };
741
+ ToolConnectionListResponse: {
742
+ data: components['schemas']['ToolConnectionListItem'][];
743
+ meta: components['schemas']['PaginationMeta'];
744
+ };
728
745
  CreateToolConnectionRequest: {
729
746
  toolId: string;
730
747
  agentId: string;
@@ -1055,6 +1072,8 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
1055
1072
  type CreateToolConnectionRequest = components['schemas']['CreateToolConnectionRequest'];
1056
1073
  type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
1057
1074
  type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
1075
+ type ToolConnectionListItem = components['schemas']['ToolConnectionListItem'];
1076
+ type ToolConnectionListResponse = components['schemas']['ToolConnectionListResponse'];
1058
1077
  type ExecuteToolConnectionRequest = components['schemas']['ExecuteToolConnectionRequest'];
1059
1078
  type ErrorResponse = components['schemas']['ErrorResponse'];
1060
1079
  type CampaignStatus = components['schemas']['CampaignStatus'];
@@ -1073,13 +1092,17 @@ type EventSubscriptionListResponse = components['schemas']['EventSubscriptionLis
1073
1092
  type CreateEventSubscriptionRequest = components['schemas']['CreateEventSubscriptionRequest'];
1074
1093
  type UpdateEventSubscriptionRequest = components['schemas']['UpdateEventSubscriptionRequest'];
1075
1094
 
1076
- declare class HttpError extends Error {
1095
+ declare class HttpError<TBody = unknown> extends Error {
1077
1096
  status: number;
1078
1097
  statusText: string;
1079
- body?: unknown;
1098
+ body?: TBody;
1080
1099
  url?: string;
1081
- constructor(status: number, statusText: string, body?: unknown, url?: string);
1100
+ constructor(status: number, statusText: string, body?: TBody, url?: string);
1082
1101
  }
1102
+ type ApiErrorBody = ErrorResponse;
1103
+ type ApiHttpError = HttpError<ApiErrorBody>;
1104
+ declare function isApiErrorBody(body: unknown): body is ApiErrorBody;
1105
+ declare function isApiHttpError(err: unknown): err is ApiHttpError;
1083
1106
  declare class TimeoutError extends Error {
1084
1107
  ms: number;
1085
1108
  url?: string;
@@ -1685,14 +1708,24 @@ type ListToolsOptions = ListQueryOptions & {
1685
1708
  type ListToolResourcesOptions = Pick<ListQueryOptions, 'page' | 'limit'> & {
1686
1709
  type?: 'document' | 'media' | 'file';
1687
1710
  };
1711
+ type ListToolConnectionsOptions = ListQueryOptions;
1688
1712
  type UploadToolResourcePayload = FormData | (Omit<ToolResourceUploadRequest, 'file'> & {
1689
1713
  file: unknown;
1690
1714
  });
1691
1715
  declare function createToolsApi(cfg: ClientConfig & {
1692
1716
  retry?: RetryPolicy;
1693
1717
  }): {
1718
+ connections: {
1719
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1720
+ readonly create: (payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1721
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ExecuteToolResponse>;
1722
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1723
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1724
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ExecuteToolResponse>;
1725
+ };
1694
1726
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1695
1727
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
1728
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1696
1729
  uploadResource(toolId: string, payload: UploadToolResourcePayload): Promise<ToolResourceUploadResponse>;
1697
1730
  deleteResource(toolId: string, resourceId: string): Promise<void>;
1698
1731
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
@@ -1841,8 +1874,27 @@ declare function createClient(initialCfg: ClientConfig & {
1841
1874
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1842
1875
  };
1843
1876
  tools: {
1877
+ connections: {
1878
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: {
1879
+ idempotencyKey?: string;
1880
+ }) => Promise<ToolConnectionResponse>;
1881
+ readonly create: (payload: CreateToolConnectionRequest, options?: {
1882
+ idempotencyKey?: string;
1883
+ }) => Promise<ToolConnectionResponse>;
1884
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
1885
+ idempotencyKey?: string;
1886
+ }) => Promise<ExecuteToolResponse>;
1887
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1888
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: {
1889
+ idempotencyKey?: string;
1890
+ }) => Promise<ToolConnectionResponse>;
1891
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
1892
+ idempotencyKey?: string;
1893
+ }) => Promise<ExecuteToolResponse>;
1894
+ };
1844
1895
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1845
1896
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
1897
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1846
1898
  uploadResource(toolId: string, payload: FormData | (Omit<{
1847
1899
  file: string;
1848
1900
  type?: "document" | "media" | "file";
@@ -1961,8 +2013,27 @@ declare function createClient(initialCfg: ClientConfig & {
1961
2013
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1962
2014
  };
1963
2015
  tools: {
2016
+ connections: {
2017
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: {
2018
+ idempotencyKey?: string;
2019
+ }) => Promise<ToolConnectionResponse>;
2020
+ readonly create: (payload: CreateToolConnectionRequest, options?: {
2021
+ idempotencyKey?: string;
2022
+ }) => Promise<ToolConnectionResponse>;
2023
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
2024
+ idempotencyKey?: string;
2025
+ }) => Promise<ExecuteToolResponse>;
2026
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
2027
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: {
2028
+ idempotencyKey?: string;
2029
+ }) => Promise<ToolConnectionResponse>;
2030
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
2031
+ idempotencyKey?: string;
2032
+ }) => Promise<ExecuteToolResponse>;
2033
+ };
1964
2034
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1965
2035
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
2036
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1966
2037
  uploadResource(toolId: string, payload: FormData | (Omit<{
1967
2038
  file: string;
1968
2039
  type?: "document" | "media" | "file";
@@ -2045,4 +2116,4 @@ declare function createHttp(cfg: ClientConfig & {
2045
2116
  resolveAccessToken: () => string;
2046
2117
  };
2047
2118
 
2048
- 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 ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, 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 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 ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, 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, TimeoutError, type ToolConnectionAuth, 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 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, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
2119
+ 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 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 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 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, 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 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, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
package/dist/index.d.ts CHANGED
@@ -547,6 +547,8 @@ type components = {
547
547
  code: string;
548
548
  message: string;
549
549
  details?: {
550
+ subcode?: string;
551
+ workspaceId?: string;
550
552
  [key: string]: unknown;
551
553
  };
552
554
  };
@@ -725,6 +727,21 @@ type components = {
725
727
  [key: string]: components['schemas']['ToolConfigSchemaAction'];
726
728
  };
727
729
  };
730
+ ToolConnectionListItem: {
731
+ toolAgentConnectionId: string;
732
+ toolId: string;
733
+ workspaceId: string;
734
+ agentId: string;
735
+ connectionKey: string;
736
+ status: 'connected' | 'pending' | 'error' | 'revoked';
737
+ providerRef?: string | null;
738
+ descriptionUsage?: string | null;
739
+ usageExample?: string | null;
740
+ };
741
+ ToolConnectionListResponse: {
742
+ data: components['schemas']['ToolConnectionListItem'][];
743
+ meta: components['schemas']['PaginationMeta'];
744
+ };
728
745
  CreateToolConnectionRequest: {
729
746
  toolId: string;
730
747
  agentId: string;
@@ -1055,6 +1072,8 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
1055
1072
  type CreateToolConnectionRequest = components['schemas']['CreateToolConnectionRequest'];
1056
1073
  type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
1057
1074
  type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
1075
+ type ToolConnectionListItem = components['schemas']['ToolConnectionListItem'];
1076
+ type ToolConnectionListResponse = components['schemas']['ToolConnectionListResponse'];
1058
1077
  type ExecuteToolConnectionRequest = components['schemas']['ExecuteToolConnectionRequest'];
1059
1078
  type ErrorResponse = components['schemas']['ErrorResponse'];
1060
1079
  type CampaignStatus = components['schemas']['CampaignStatus'];
@@ -1073,13 +1092,17 @@ type EventSubscriptionListResponse = components['schemas']['EventSubscriptionLis
1073
1092
  type CreateEventSubscriptionRequest = components['schemas']['CreateEventSubscriptionRequest'];
1074
1093
  type UpdateEventSubscriptionRequest = components['schemas']['UpdateEventSubscriptionRequest'];
1075
1094
 
1076
- declare class HttpError extends Error {
1095
+ declare class HttpError<TBody = unknown> extends Error {
1077
1096
  status: number;
1078
1097
  statusText: string;
1079
- body?: unknown;
1098
+ body?: TBody;
1080
1099
  url?: string;
1081
- constructor(status: number, statusText: string, body?: unknown, url?: string);
1100
+ constructor(status: number, statusText: string, body?: TBody, url?: string);
1082
1101
  }
1102
+ type ApiErrorBody = ErrorResponse;
1103
+ type ApiHttpError = HttpError<ApiErrorBody>;
1104
+ declare function isApiErrorBody(body: unknown): body is ApiErrorBody;
1105
+ declare function isApiHttpError(err: unknown): err is ApiHttpError;
1083
1106
  declare class TimeoutError extends Error {
1084
1107
  ms: number;
1085
1108
  url?: string;
@@ -1685,14 +1708,24 @@ type ListToolsOptions = ListQueryOptions & {
1685
1708
  type ListToolResourcesOptions = Pick<ListQueryOptions, 'page' | 'limit'> & {
1686
1709
  type?: 'document' | 'media' | 'file';
1687
1710
  };
1711
+ type ListToolConnectionsOptions = ListQueryOptions;
1688
1712
  type UploadToolResourcePayload = FormData | (Omit<ToolResourceUploadRequest, 'file'> & {
1689
1713
  file: unknown;
1690
1714
  });
1691
1715
  declare function createToolsApi(cfg: ClientConfig & {
1692
1716
  retry?: RetryPolicy;
1693
1717
  }): {
1718
+ connections: {
1719
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1720
+ readonly create: (payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1721
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ExecuteToolResponse>;
1722
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1723
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ToolConnectionResponse>;
1724
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions) => Promise<ExecuteToolResponse>;
1725
+ };
1694
1726
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1695
1727
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
1728
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1696
1729
  uploadResource(toolId: string, payload: UploadToolResourcePayload): Promise<ToolResourceUploadResponse>;
1697
1730
  deleteResource(toolId: string, resourceId: string): Promise<void>;
1698
1731
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
@@ -1841,8 +1874,27 @@ declare function createClient(initialCfg: ClientConfig & {
1841
1874
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1842
1875
  };
1843
1876
  tools: {
1877
+ connections: {
1878
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: {
1879
+ idempotencyKey?: string;
1880
+ }) => Promise<ToolConnectionResponse>;
1881
+ readonly create: (payload: CreateToolConnectionRequest, options?: {
1882
+ idempotencyKey?: string;
1883
+ }) => Promise<ToolConnectionResponse>;
1884
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
1885
+ idempotencyKey?: string;
1886
+ }) => Promise<ExecuteToolResponse>;
1887
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1888
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: {
1889
+ idempotencyKey?: string;
1890
+ }) => Promise<ToolConnectionResponse>;
1891
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
1892
+ idempotencyKey?: string;
1893
+ }) => Promise<ExecuteToolResponse>;
1894
+ };
1844
1895
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1845
1896
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
1897
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1846
1898
  uploadResource(toolId: string, payload: FormData | (Omit<{
1847
1899
  file: string;
1848
1900
  type?: "document" | "media" | "file";
@@ -1961,8 +2013,27 @@ declare function createClient(initialCfg: ClientConfig & {
1961
2013
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1962
2014
  };
1963
2015
  tools: {
2016
+ connections: {
2017
+ readonly connect: (toolId: string, payload: ToolConnectionRequest, options?: {
2018
+ idempotencyKey?: string;
2019
+ }) => Promise<ToolConnectionResponse>;
2020
+ readonly create: (payload: CreateToolConnectionRequest, options?: {
2021
+ idempotencyKey?: string;
2022
+ }) => Promise<ToolConnectionResponse>;
2023
+ readonly execute: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
2024
+ idempotencyKey?: string;
2025
+ }) => Promise<ExecuteToolResponse>;
2026
+ readonly list: (options?: ListToolConnectionsOptions) => Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
2027
+ readonly createConnection: (payload: CreateToolConnectionRequest, options?: {
2028
+ idempotencyKey?: string;
2029
+ }) => Promise<ToolConnectionResponse>;
2030
+ readonly executeConnection: (toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
2031
+ idempotencyKey?: string;
2032
+ }) => Promise<ExecuteToolResponse>;
2033
+ };
1964
2034
  list(options?: ListToolsOptions): Promise<PaginatedResult<ToolListResponse, ListToolsOptions>>;
1965
2035
  listResources(toolId: string, options?: ListToolResourcesOptions): Promise<PaginatedResult<ToolResourceListResponse, ListToolResourcesOptions>>;
2036
+ listConnections(options?: ListToolConnectionsOptions): Promise<PaginatedResult<ToolConnectionListResponse, ListToolConnectionsOptions>>;
1966
2037
  uploadResource(toolId: string, payload: FormData | (Omit<{
1967
2038
  file: string;
1968
2039
  type?: "document" | "media" | "file";
@@ -2045,4 +2116,4 @@ declare function createHttp(cfg: ClientConfig & {
2045
2116
  resolveAccessToken: () => string;
2046
2117
  };
2047
2118
 
2048
- 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 ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, 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 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 ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, 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, TimeoutError, type ToolConnectionAuth, 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 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, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
2119
+ 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 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 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 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, 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 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, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
package/dist/index.js CHANGED
@@ -9,6 +9,14 @@ var HttpError = class extends Error {
9
9
  this.name = "HttpError";
10
10
  }
11
11
  };
12
+ function isApiErrorBody(body) {
13
+ if (!body || typeof body !== "object") return false;
14
+ const candidate = body;
15
+ return typeof candidate.code === "string" && typeof candidate.message === "string";
16
+ }
17
+ function isApiHttpError(err) {
18
+ return err instanceof HttpError && isApiErrorBody(err.body);
19
+ }
12
20
  var TimeoutError = class extends Error {
13
21
  constructor(ms, url) {
14
22
  super(`Timeout after ${ms}ms`);
@@ -1487,7 +1495,15 @@ function createToolsApi(cfg) {
1487
1495
  });
1488
1496
  return res.json();
1489
1497
  };
1490
- return {
1498
+ const fetchToolConnectionsPage = async (options = {}) => {
1499
+ const query = serializeListOptions(options ?? {});
1500
+ const res = await doFetch(`${base}/tools/connections`, {
1501
+ method: "GET",
1502
+ query
1503
+ });
1504
+ return res.json();
1505
+ };
1506
+ const api = {
1491
1507
  async list(options = {}) {
1492
1508
  const normalizedOptions = { ...options ?? {} };
1493
1509
  const response = await fetchToolsPage(normalizedOptions);
@@ -1501,6 +1517,17 @@ function createToolsApi(cfg) {
1501
1517
  const response = await fetchPage(normalizedOptions);
1502
1518
  return attachPaginator(response, fetchPage, normalizedOptions);
1503
1519
  },
1520
+ async listConnections(options = {}) {
1521
+ const normalizedOptions = {
1522
+ ...options ?? {}
1523
+ };
1524
+ const response = await fetchToolConnectionsPage(normalizedOptions);
1525
+ return attachPaginator(
1526
+ response,
1527
+ fetchToolConnectionsPage,
1528
+ normalizedOptions
1529
+ );
1530
+ },
1504
1531
  async uploadResource(toolId, payload) {
1505
1532
  const formData = toFormData(payload);
1506
1533
  const res = await doFetch(`${base}/tools/${toolId}/resources`, {
@@ -1575,6 +1602,18 @@ function createToolsApi(cfg) {
1575
1602
  return res.json();
1576
1603
  }
1577
1604
  };
1605
+ const connections = {
1606
+ connect: api.connect,
1607
+ create: api.createConnection,
1608
+ execute: api.executeConnection,
1609
+ list: api.listConnections,
1610
+ createConnection: api.createConnection,
1611
+ executeConnection: api.executeConnection
1612
+ };
1613
+ return {
1614
+ ...api,
1615
+ connections
1616
+ };
1578
1617
  }
1579
1618
 
1580
1619
  // src/utils/catalog-voices.ts
@@ -2144,6 +2183,8 @@ export {
2144
2183
  createToolsApi,
2145
2184
  createVoicesApi,
2146
2185
  createWebhooksApi,
2147
- createWorkspacesApi
2186
+ createWorkspacesApi,
2187
+ isApiErrorBody,
2188
+ isApiHttpError
2148
2189
  };
2149
2190
  //# sourceMappingURL=index.js.map