@getsupervisor/agents-studio-sdk 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -49,6 +49,7 @@ type components = {
49
49
  ToolResourceReloadResponse: external['components/schemas.yaml']['ToolResourceReloadResponse'];
50
50
  ToolConnectionRequest: external['components/schemas.yaml']['ToolConnectionRequest'];
51
51
  ToolConnectionResponse: external['components/schemas.yaml']['ToolConnectionResponse'];
52
+ ToolConnectionAuth: external['components/schemas.yaml']['ToolConnectionAuth'];
52
53
  ExecuteToolRequest: external['components/schemas.yaml']['ExecuteToolRequest'];
53
54
  ExecuteToolResponse: external['components/schemas.yaml']['ExecuteToolResponse'];
54
55
  CatalogItemLinks: external['components/schemas.yaml']['CatalogItemLinks'];
@@ -413,6 +414,7 @@ type ToolResourceListResponse = components['schemas']['ToolResourceListResponse'
413
414
  type ToolResourceUploadRequest = components['schemas']['ToolResourceUploadRequest'];
414
415
  type ToolResourceUploadResponse = components['schemas']['ToolResourceUploadResponse'];
415
416
  type ToolResourceReloadResponse = components['schemas']['ToolResourceReloadResponse'];
417
+ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
416
418
  type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
417
419
  type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
418
420
  type ErrorResponse = components['schemas']['ErrorResponse'];
@@ -670,6 +672,9 @@ declare function createCatalogsApi(cfg: ClientConfig & {
670
672
  remove(itemId: string): Promise<void>;
671
673
  };
672
674
 
675
+ type IdempotentRequestOptions = {
676
+ idempotencyKey?: string;
677
+ };
673
678
  type ListToolsOptions = ListQueryOptions & {
674
679
  agentType?: 'chat' | 'voice';
675
680
  };
@@ -687,8 +692,8 @@ declare function createToolsApi(cfg: ClientConfig & {
687
692
  uploadResource(toolId: string, payload: UploadToolResourcePayload): Promise<ToolResourceUploadResponse>;
688
693
  deleteResource(toolId: string, resourceId: string): Promise<void>;
689
694
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
690
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
691
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
695
+ execute(toolId: string, payload: ExecuteToolRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
696
+ connect(toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
692
697
  };
693
698
 
694
699
  type ListVoicesOptions = ListQueryOptions & {
@@ -829,8 +834,12 @@ declare function createClient(initialCfg: ClientConfig & {
829
834
  })): Promise<ToolResourceUploadResponse>;
830
835
  deleteResource(toolId: string, resourceId: string): Promise<void>;
831
836
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
832
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
833
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
837
+ execute(toolId: string, payload: ExecuteToolRequest, options?: {
838
+ idempotencyKey?: string;
839
+ }): Promise<ExecuteToolResponse>;
840
+ connect(toolId: string, payload: ToolConnectionRequest, options?: {
841
+ idempotencyKey?: string;
842
+ }): Promise<ToolConnectionResponse>;
834
843
  };
835
844
  catalogs: {
836
845
  list(options?: ListCatalogItemsOptions): Promise<PaginatedResult<CatalogItemListResponse, ListCatalogItemsOptions>>;
@@ -918,8 +927,12 @@ declare function createClient(initialCfg: ClientConfig & {
918
927
  })): Promise<ToolResourceUploadResponse>;
919
928
  deleteResource(toolId: string, resourceId: string): Promise<void>;
920
929
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
921
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
922
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
930
+ execute(toolId: string, payload: ExecuteToolRequest, options?: {
931
+ idempotencyKey?: string;
932
+ }): Promise<ExecuteToolResponse>;
933
+ connect(toolId: string, payload: ToolConnectionRequest, options?: {
934
+ idempotencyKey?: string;
935
+ }): Promise<ToolConnectionResponse>;
923
936
  };
924
937
  catalogs: {
925
938
  list(options?: ListCatalogItemsOptions): Promise<PaginatedResult<CatalogItemListResponse, ListCatalogItemsOptions>>;
@@ -968,4 +981,4 @@ declare function createHttp(cfg: ClientConfig & {
968
981
  resolveAccessToken: () => string;
969
982
  };
970
983
 
971
- export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentInstructionsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, 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 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 UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentInstructions, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentInstructionsApi, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
984
+ export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentInstructionsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, 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 UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentInstructions, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentInstructionsApi, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
package/dist/index.d.ts CHANGED
@@ -49,6 +49,7 @@ type components = {
49
49
  ToolResourceReloadResponse: external['components/schemas.yaml']['ToolResourceReloadResponse'];
50
50
  ToolConnectionRequest: external['components/schemas.yaml']['ToolConnectionRequest'];
51
51
  ToolConnectionResponse: external['components/schemas.yaml']['ToolConnectionResponse'];
52
+ ToolConnectionAuth: external['components/schemas.yaml']['ToolConnectionAuth'];
52
53
  ExecuteToolRequest: external['components/schemas.yaml']['ExecuteToolRequest'];
53
54
  ExecuteToolResponse: external['components/schemas.yaml']['ExecuteToolResponse'];
54
55
  CatalogItemLinks: external['components/schemas.yaml']['CatalogItemLinks'];
@@ -413,6 +414,7 @@ type ToolResourceListResponse = components['schemas']['ToolResourceListResponse'
413
414
  type ToolResourceUploadRequest = components['schemas']['ToolResourceUploadRequest'];
414
415
  type ToolResourceUploadResponse = components['schemas']['ToolResourceUploadResponse'];
415
416
  type ToolResourceReloadResponse = components['schemas']['ToolResourceReloadResponse'];
417
+ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
416
418
  type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
417
419
  type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
418
420
  type ErrorResponse = components['schemas']['ErrorResponse'];
@@ -670,6 +672,9 @@ declare function createCatalogsApi(cfg: ClientConfig & {
670
672
  remove(itemId: string): Promise<void>;
671
673
  };
672
674
 
675
+ type IdempotentRequestOptions = {
676
+ idempotencyKey?: string;
677
+ };
673
678
  type ListToolsOptions = ListQueryOptions & {
674
679
  agentType?: 'chat' | 'voice';
675
680
  };
@@ -687,8 +692,8 @@ declare function createToolsApi(cfg: ClientConfig & {
687
692
  uploadResource(toolId: string, payload: UploadToolResourcePayload): Promise<ToolResourceUploadResponse>;
688
693
  deleteResource(toolId: string, resourceId: string): Promise<void>;
689
694
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
690
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
691
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
695
+ execute(toolId: string, payload: ExecuteToolRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
696
+ connect(toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
692
697
  };
693
698
 
694
699
  type ListVoicesOptions = ListQueryOptions & {
@@ -829,8 +834,12 @@ declare function createClient(initialCfg: ClientConfig & {
829
834
  })): Promise<ToolResourceUploadResponse>;
830
835
  deleteResource(toolId: string, resourceId: string): Promise<void>;
831
836
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
832
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
833
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
837
+ execute(toolId: string, payload: ExecuteToolRequest, options?: {
838
+ idempotencyKey?: string;
839
+ }): Promise<ExecuteToolResponse>;
840
+ connect(toolId: string, payload: ToolConnectionRequest, options?: {
841
+ idempotencyKey?: string;
842
+ }): Promise<ToolConnectionResponse>;
834
843
  };
835
844
  catalogs: {
836
845
  list(options?: ListCatalogItemsOptions): Promise<PaginatedResult<CatalogItemListResponse, ListCatalogItemsOptions>>;
@@ -918,8 +927,12 @@ declare function createClient(initialCfg: ClientConfig & {
918
927
  })): Promise<ToolResourceUploadResponse>;
919
928
  deleteResource(toolId: string, resourceId: string): Promise<void>;
920
929
  reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
921
- execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
922
- connect(toolId: string, payload: ToolConnectionRequest): Promise<ToolConnectionResponse>;
930
+ execute(toolId: string, payload: ExecuteToolRequest, options?: {
931
+ idempotencyKey?: string;
932
+ }): Promise<ExecuteToolResponse>;
933
+ connect(toolId: string, payload: ToolConnectionRequest, options?: {
934
+ idempotencyKey?: string;
935
+ }): Promise<ToolConnectionResponse>;
923
936
  };
924
937
  catalogs: {
925
938
  list(options?: ListCatalogItemsOptions): Promise<PaginatedResult<CatalogItemListResponse, ListCatalogItemsOptions>>;
@@ -968,4 +981,4 @@ declare function createHttp(cfg: ClientConfig & {
968
981
  resolveAccessToken: () => string;
969
982
  };
970
983
 
971
- export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentInstructionsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, 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 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 UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentInstructions, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentInstructionsApi, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
984
+ export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentInstructionsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, 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 UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentInstructions, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentInstructionsApi, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
package/dist/index.js CHANGED
@@ -1093,6 +1093,27 @@ function createCatalogsApi(cfg) {
1093
1093
  }
1094
1094
 
1095
1095
  // src/api/tools.ts
1096
+ var IDEMPOTENCY_HEADER = "Idempotency-Key";
1097
+ var generateIdempotencyKey = (explicit) => {
1098
+ if (explicit && explicit.length > 0) {
1099
+ return explicit;
1100
+ }
1101
+ const globalRef = globalThis;
1102
+ const cryptoRef = globalRef?.crypto;
1103
+ if (cryptoRef?.randomUUID) {
1104
+ return cryptoRef.randomUUID();
1105
+ }
1106
+ if (cryptoRef?.getRandomValues) {
1107
+ const buffer = new Uint8Array(16);
1108
+ cryptoRef.getRandomValues(buffer);
1109
+ return Array.from(
1110
+ buffer,
1111
+ (byte) => byte.toString(16).padStart(2, "0")
1112
+ ).join("");
1113
+ }
1114
+ const randomChunk = () => Math.random().toString(36).slice(2, 10);
1115
+ return `idemp_${Date.now().toString(36)}_${randomChunk()}${randomChunk()}`;
1116
+ };
1096
1117
  var isFormData = (value) => {
1097
1118
  return typeof FormData !== "undefined" && value instanceof FormData;
1098
1119
  };
@@ -1175,18 +1196,26 @@ function createToolsApi(cfg) {
1175
1196
  );
1176
1197
  return res.json();
1177
1198
  },
1178
- async execute(toolId, payload) {
1199
+ async execute(toolId, payload, options = {}) {
1200
+ const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
1179
1201
  const res = await doFetch(`${base}/v1/tools/${toolId}/execute`, {
1180
1202
  method: "POST",
1181
- headers: jsonHeaders,
1203
+ headers: {
1204
+ ...jsonHeaders,
1205
+ [IDEMPOTENCY_HEADER]: idempotencyKey
1206
+ },
1182
1207
  body: JSON.stringify(payload)
1183
1208
  });
1184
1209
  return res.json();
1185
1210
  },
1186
- async connect(toolId, payload) {
1187
- const res = await doFetch(`${base}/v1/tools/${toolId}/connect`, {
1211
+ async connect(toolId, payload, options = {}) {
1212
+ const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
1213
+ const res = await doFetch(`${base}/v1/tools/${toolId}/connections`, {
1188
1214
  method: "POST",
1189
- headers: jsonHeaders,
1215
+ headers: {
1216
+ ...jsonHeaders,
1217
+ [IDEMPOTENCY_HEADER]: idempotencyKey
1218
+ },
1190
1219
  body: JSON.stringify(payload)
1191
1220
  });
1192
1221
  return res.json();