@getsupervisor/agents-studio-sdk 1.41.0-patch.1 → 1.41.0-patch.2
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/README.md +2 -0
- package/dist/index.cjs +53 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -3
- package/dist/index.d.ts +40 -3
- package/dist/index.js +52 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -452,6 +452,7 @@ type components = {
|
|
|
452
452
|
message?: string;
|
|
453
453
|
};
|
|
454
454
|
ToolConnectionRequest: {
|
|
455
|
+
connectionKey?: string;
|
|
455
456
|
agentId: string;
|
|
456
457
|
metadata?: {
|
|
457
458
|
[key: string]: unknown;
|
|
@@ -459,7 +460,7 @@ type components = {
|
|
|
459
460
|
auth?: components['schemas']['ToolConnectionAuth'];
|
|
460
461
|
};
|
|
461
462
|
ToolConnectionResponse: {
|
|
462
|
-
status: 'connected' | 'pending' | 'error';
|
|
463
|
+
status: 'connected' | 'pending' | 'error' | 'revoked';
|
|
463
464
|
toolAgentConnectionId?: string | null;
|
|
464
465
|
toolId: string;
|
|
465
466
|
workspaceId: string;
|
|
@@ -472,7 +473,7 @@ type components = {
|
|
|
472
473
|
};
|
|
473
474
|
};
|
|
474
475
|
ToolConnectionAuth: {
|
|
475
|
-
type: 'none' | 'oauth2' | 'api_key';
|
|
476
|
+
type: 'none' | 'oauth2' | 'api_key' | 'custom';
|
|
476
477
|
data?: {
|
|
477
478
|
[key: string]: unknown;
|
|
478
479
|
};
|
|
@@ -495,6 +496,7 @@ type components = {
|
|
|
495
496
|
toolId: string;
|
|
496
497
|
toolAgentConnectionId?: string | null;
|
|
497
498
|
providerRef?: string | null;
|
|
499
|
+
toolExecutionId: string;
|
|
498
500
|
message?: string | null;
|
|
499
501
|
};
|
|
500
502
|
CatalogItemLinks: {
|
|
@@ -723,6 +725,21 @@ type components = {
|
|
|
723
725
|
[key: string]: components['schemas']['ToolConfigSchemaAction'];
|
|
724
726
|
};
|
|
725
727
|
};
|
|
728
|
+
CreateToolConnectionRequest: {
|
|
729
|
+
toolId: string;
|
|
730
|
+
agentId: string;
|
|
731
|
+
connectionKey?: string;
|
|
732
|
+
metadata?: {
|
|
733
|
+
[key: string]: unknown;
|
|
734
|
+
};
|
|
735
|
+
auth?: components['schemas']['ToolConnectionAuth'];
|
|
736
|
+
};
|
|
737
|
+
ExecuteToolConnectionRequest: {
|
|
738
|
+
action: string;
|
|
739
|
+
args?: {
|
|
740
|
+
[key: string]: unknown;
|
|
741
|
+
};
|
|
742
|
+
};
|
|
726
743
|
CatalogItemLanguageMetadata: {
|
|
727
744
|
code: string;
|
|
728
745
|
locale?: string | null;
|
|
@@ -780,6 +797,7 @@ type components = {
|
|
|
780
797
|
ApiKeyId: string;
|
|
781
798
|
XCacheRefresh?: boolean;
|
|
782
799
|
IdempotencyKey: string;
|
|
800
|
+
XApiKey?: string;
|
|
783
801
|
};
|
|
784
802
|
requestBodies: never;
|
|
785
803
|
headers: never;
|
|
@@ -1034,8 +1052,10 @@ type ToolResourceUploadRequest = components['schemas']['ToolResourceUploadReques
|
|
|
1034
1052
|
type ToolResourceUploadResponse = components['schemas']['ToolResourceUploadResponse'];
|
|
1035
1053
|
type ToolResourceReloadResponse = components['schemas']['ToolResourceReloadResponse'];
|
|
1036
1054
|
type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
1055
|
+
type CreateToolConnectionRequest = components['schemas']['CreateToolConnectionRequest'];
|
|
1037
1056
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
1038
1057
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
1058
|
+
type ExecuteToolConnectionRequest = components['schemas']['ExecuteToolConnectionRequest'];
|
|
1039
1059
|
type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
1040
1060
|
type CampaignStatus = components['schemas']['CampaignStatus'];
|
|
1041
1061
|
type Campaign = components['schemas']['Campaign'];
|
|
@@ -1070,6 +1090,9 @@ declare class NetworkError extends Error {
|
|
|
1070
1090
|
url?: string;
|
|
1071
1091
|
constructor(cause?: unknown, url?: string);
|
|
1072
1092
|
}
|
|
1093
|
+
declare class WorkspaceNotSelectedError extends Error {
|
|
1094
|
+
constructor();
|
|
1095
|
+
}
|
|
1073
1096
|
type RetryPolicy = {
|
|
1074
1097
|
maxRetries?: number;
|
|
1075
1098
|
baseDelayMs?: number;
|
|
@@ -1675,6 +1698,8 @@ declare function createToolsApi(cfg: ClientConfig & {
|
|
|
1675
1698
|
reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
|
|
1676
1699
|
execute(toolId: string, payload: ExecuteToolRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
|
|
1677
1700
|
connect(toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
|
|
1701
|
+
createConnection(payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
|
|
1702
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
|
|
1678
1703
|
};
|
|
1679
1704
|
|
|
1680
1705
|
type ListVoicesOptions = ListQueryOptions & {
|
|
@@ -1836,6 +1861,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1836
1861
|
connect(toolId: string, payload: ToolConnectionRequest, options?: {
|
|
1837
1862
|
idempotencyKey?: string;
|
|
1838
1863
|
}): Promise<ToolConnectionResponse>;
|
|
1864
|
+
createConnection(payload: CreateToolConnectionRequest, options?: {
|
|
1865
|
+
idempotencyKey?: string;
|
|
1866
|
+
}): Promise<ToolConnectionResponse>;
|
|
1867
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
|
|
1868
|
+
idempotencyKey?: string;
|
|
1869
|
+
}): Promise<ExecuteToolResponse>;
|
|
1839
1870
|
};
|
|
1840
1871
|
catalogs: {
|
|
1841
1872
|
templates: {
|
|
@@ -1950,6 +1981,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1950
1981
|
connect(toolId: string, payload: ToolConnectionRequest, options?: {
|
|
1951
1982
|
idempotencyKey?: string;
|
|
1952
1983
|
}): Promise<ToolConnectionResponse>;
|
|
1984
|
+
createConnection(payload: CreateToolConnectionRequest, options?: {
|
|
1985
|
+
idempotencyKey?: string;
|
|
1986
|
+
}): Promise<ToolConnectionResponse>;
|
|
1987
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
|
|
1988
|
+
idempotencyKey?: string;
|
|
1989
|
+
}): Promise<ExecuteToolResponse>;
|
|
1953
1990
|
};
|
|
1954
1991
|
catalogs: {
|
|
1955
1992
|
templates: {
|
|
@@ -2008,4 +2045,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
2008
2045
|
resolveAccessToken: () => string;
|
|
2009
2046
|
};
|
|
2010
2047
|
|
|
2011
|
-
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 CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, 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, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -452,6 +452,7 @@ type components = {
|
|
|
452
452
|
message?: string;
|
|
453
453
|
};
|
|
454
454
|
ToolConnectionRequest: {
|
|
455
|
+
connectionKey?: string;
|
|
455
456
|
agentId: string;
|
|
456
457
|
metadata?: {
|
|
457
458
|
[key: string]: unknown;
|
|
@@ -459,7 +460,7 @@ type components = {
|
|
|
459
460
|
auth?: components['schemas']['ToolConnectionAuth'];
|
|
460
461
|
};
|
|
461
462
|
ToolConnectionResponse: {
|
|
462
|
-
status: 'connected' | 'pending' | 'error';
|
|
463
|
+
status: 'connected' | 'pending' | 'error' | 'revoked';
|
|
463
464
|
toolAgentConnectionId?: string | null;
|
|
464
465
|
toolId: string;
|
|
465
466
|
workspaceId: string;
|
|
@@ -472,7 +473,7 @@ type components = {
|
|
|
472
473
|
};
|
|
473
474
|
};
|
|
474
475
|
ToolConnectionAuth: {
|
|
475
|
-
type: 'none' | 'oauth2' | 'api_key';
|
|
476
|
+
type: 'none' | 'oauth2' | 'api_key' | 'custom';
|
|
476
477
|
data?: {
|
|
477
478
|
[key: string]: unknown;
|
|
478
479
|
};
|
|
@@ -495,6 +496,7 @@ type components = {
|
|
|
495
496
|
toolId: string;
|
|
496
497
|
toolAgentConnectionId?: string | null;
|
|
497
498
|
providerRef?: string | null;
|
|
499
|
+
toolExecutionId: string;
|
|
498
500
|
message?: string | null;
|
|
499
501
|
};
|
|
500
502
|
CatalogItemLinks: {
|
|
@@ -723,6 +725,21 @@ type components = {
|
|
|
723
725
|
[key: string]: components['schemas']['ToolConfigSchemaAction'];
|
|
724
726
|
};
|
|
725
727
|
};
|
|
728
|
+
CreateToolConnectionRequest: {
|
|
729
|
+
toolId: string;
|
|
730
|
+
agentId: string;
|
|
731
|
+
connectionKey?: string;
|
|
732
|
+
metadata?: {
|
|
733
|
+
[key: string]: unknown;
|
|
734
|
+
};
|
|
735
|
+
auth?: components['schemas']['ToolConnectionAuth'];
|
|
736
|
+
};
|
|
737
|
+
ExecuteToolConnectionRequest: {
|
|
738
|
+
action: string;
|
|
739
|
+
args?: {
|
|
740
|
+
[key: string]: unknown;
|
|
741
|
+
};
|
|
742
|
+
};
|
|
726
743
|
CatalogItemLanguageMetadata: {
|
|
727
744
|
code: string;
|
|
728
745
|
locale?: string | null;
|
|
@@ -780,6 +797,7 @@ type components = {
|
|
|
780
797
|
ApiKeyId: string;
|
|
781
798
|
XCacheRefresh?: boolean;
|
|
782
799
|
IdempotencyKey: string;
|
|
800
|
+
XApiKey?: string;
|
|
783
801
|
};
|
|
784
802
|
requestBodies: never;
|
|
785
803
|
headers: never;
|
|
@@ -1034,8 +1052,10 @@ type ToolResourceUploadRequest = components['schemas']['ToolResourceUploadReques
|
|
|
1034
1052
|
type ToolResourceUploadResponse = components['schemas']['ToolResourceUploadResponse'];
|
|
1035
1053
|
type ToolResourceReloadResponse = components['schemas']['ToolResourceReloadResponse'];
|
|
1036
1054
|
type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
1055
|
+
type CreateToolConnectionRequest = components['schemas']['CreateToolConnectionRequest'];
|
|
1037
1056
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
1038
1057
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
1058
|
+
type ExecuteToolConnectionRequest = components['schemas']['ExecuteToolConnectionRequest'];
|
|
1039
1059
|
type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
1040
1060
|
type CampaignStatus = components['schemas']['CampaignStatus'];
|
|
1041
1061
|
type Campaign = components['schemas']['Campaign'];
|
|
@@ -1070,6 +1090,9 @@ declare class NetworkError extends Error {
|
|
|
1070
1090
|
url?: string;
|
|
1071
1091
|
constructor(cause?: unknown, url?: string);
|
|
1072
1092
|
}
|
|
1093
|
+
declare class WorkspaceNotSelectedError extends Error {
|
|
1094
|
+
constructor();
|
|
1095
|
+
}
|
|
1073
1096
|
type RetryPolicy = {
|
|
1074
1097
|
maxRetries?: number;
|
|
1075
1098
|
baseDelayMs?: number;
|
|
@@ -1675,6 +1698,8 @@ declare function createToolsApi(cfg: ClientConfig & {
|
|
|
1675
1698
|
reloadResource(toolId: string, resourceId: string): Promise<ToolResourceReloadResponse>;
|
|
1676
1699
|
execute(toolId: string, payload: ExecuteToolRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
|
|
1677
1700
|
connect(toolId: string, payload: ToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
|
|
1701
|
+
createConnection(payload: CreateToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ToolConnectionResponse>;
|
|
1702
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: IdempotentRequestOptions): Promise<ExecuteToolResponse>;
|
|
1678
1703
|
};
|
|
1679
1704
|
|
|
1680
1705
|
type ListVoicesOptions = ListQueryOptions & {
|
|
@@ -1836,6 +1861,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1836
1861
|
connect(toolId: string, payload: ToolConnectionRequest, options?: {
|
|
1837
1862
|
idempotencyKey?: string;
|
|
1838
1863
|
}): Promise<ToolConnectionResponse>;
|
|
1864
|
+
createConnection(payload: CreateToolConnectionRequest, options?: {
|
|
1865
|
+
idempotencyKey?: string;
|
|
1866
|
+
}): Promise<ToolConnectionResponse>;
|
|
1867
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
|
|
1868
|
+
idempotencyKey?: string;
|
|
1869
|
+
}): Promise<ExecuteToolResponse>;
|
|
1839
1870
|
};
|
|
1840
1871
|
catalogs: {
|
|
1841
1872
|
templates: {
|
|
@@ -1950,6 +1981,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1950
1981
|
connect(toolId: string, payload: ToolConnectionRequest, options?: {
|
|
1951
1982
|
idempotencyKey?: string;
|
|
1952
1983
|
}): Promise<ToolConnectionResponse>;
|
|
1984
|
+
createConnection(payload: CreateToolConnectionRequest, options?: {
|
|
1985
|
+
idempotencyKey?: string;
|
|
1986
|
+
}): Promise<ToolConnectionResponse>;
|
|
1987
|
+
executeConnection(toolAgentConnectionId: string, payload: ExecuteToolConnectionRequest, options?: {
|
|
1988
|
+
idempotencyKey?: string;
|
|
1989
|
+
}): Promise<ExecuteToolResponse>;
|
|
1953
1990
|
};
|
|
1954
1991
|
catalogs: {
|
|
1955
1992
|
templates: {
|
|
@@ -2008,4 +2045,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
2008
2045
|
resolveAccessToken: () => string;
|
|
2009
2046
|
};
|
|
2010
2047
|
|
|
2011
|
-
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 CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, 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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,12 @@ var NetworkError = class extends Error {
|
|
|
25
25
|
this.name = "NetworkError";
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
var WorkspaceNotSelectedError = class extends Error {
|
|
29
|
+
constructor() {
|
|
30
|
+
super("Workspace is not selected");
|
|
31
|
+
this.name = "WorkspaceNotSelectedError";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
28
34
|
|
|
29
35
|
// src/http.ts
|
|
30
36
|
function toQueryString(query) {
|
|
@@ -1088,9 +1094,21 @@ var createAgentEntity = (dto, options) => {
|
|
|
1088
1094
|
|
|
1089
1095
|
// src/api/agents.ts
|
|
1090
1096
|
function createAgentsApi(cfg, relatedApis) {
|
|
1091
|
-
const { base, doFetch } = createHttp(cfg);
|
|
1097
|
+
const { base, doFetch, resolveWorkspaceId, resolveApiKey } = createHttp(cfg);
|
|
1098
|
+
const requireWorkspace = () => {
|
|
1099
|
+
const workspaceId = resolveWorkspaceId();
|
|
1100
|
+
if (typeof workspaceId === "string" && workspaceId.trim().length > 0) {
|
|
1101
|
+
return;
|
|
1102
|
+
}
|
|
1103
|
+
const apiKey = resolveApiKey();
|
|
1104
|
+
if (typeof apiKey === "string" && apiKey.trim().length > 0) {
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
throw new WorkspaceNotSelectedError();
|
|
1108
|
+
};
|
|
1092
1109
|
const jsonHeaders = { "content-type": "application/json" };
|
|
1093
1110
|
const fetchAgentsPage = async (options = {}) => {
|
|
1111
|
+
requireWorkspace();
|
|
1094
1112
|
const sanitizedOptions = {
|
|
1095
1113
|
page: options.page,
|
|
1096
1114
|
limit: options.limit,
|
|
@@ -1109,12 +1127,14 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1109
1127
|
return attachPaginator(response, fetchAgentsPage, normalizedOptions);
|
|
1110
1128
|
};
|
|
1111
1129
|
const getAgentDetail = async (agentId) => {
|
|
1130
|
+
requireWorkspace();
|
|
1112
1131
|
const res = await doFetch(`${base}/agents/${agentId}`, {
|
|
1113
1132
|
method: "GET"
|
|
1114
1133
|
});
|
|
1115
1134
|
return res.json();
|
|
1116
1135
|
};
|
|
1117
1136
|
const createAgent = async (payload) => {
|
|
1137
|
+
requireWorkspace();
|
|
1118
1138
|
const res = await doFetch(`${base}/agents`, {
|
|
1119
1139
|
method: "POST",
|
|
1120
1140
|
body: JSON.stringify(payload),
|
|
@@ -1123,6 +1143,7 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1123
1143
|
return res.json();
|
|
1124
1144
|
};
|
|
1125
1145
|
const forkAgentFromTemplate = async (payload) => {
|
|
1146
|
+
requireWorkspace();
|
|
1126
1147
|
const res = await doFetch(`${base}/agents/from-template`, {
|
|
1127
1148
|
method: "POST",
|
|
1128
1149
|
body: JSON.stringify(payload),
|
|
@@ -1131,6 +1152,7 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1131
1152
|
return res.json();
|
|
1132
1153
|
};
|
|
1133
1154
|
const updateAgent = async (agentId, payload) => {
|
|
1155
|
+
requireWorkspace();
|
|
1134
1156
|
const res = await doFetch(`${base}/agents/${agentId}`, {
|
|
1135
1157
|
method: "PATCH",
|
|
1136
1158
|
body: JSON.stringify(payload),
|
|
@@ -1142,6 +1164,7 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1142
1164
|
return typeof agent === "string" ? agent : agent.agentId;
|
|
1143
1165
|
};
|
|
1144
1166
|
const deleteAgent = async (agent) => {
|
|
1167
|
+
requireWorkspace();
|
|
1145
1168
|
const agentId = resolveAgentId(agent);
|
|
1146
1169
|
await doFetch(`${base}/agents/${agentId}`, {
|
|
1147
1170
|
method: "DELETE"
|
|
@@ -1523,6 +1546,33 @@ function createToolsApi(cfg) {
|
|
|
1523
1546
|
body: JSON.stringify(payload)
|
|
1524
1547
|
});
|
|
1525
1548
|
return res.json();
|
|
1549
|
+
},
|
|
1550
|
+
async createConnection(payload, options = {}) {
|
|
1551
|
+
const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
|
|
1552
|
+
const res = await doFetch(`${base}/tools/connections`, {
|
|
1553
|
+
method: "POST",
|
|
1554
|
+
headers: {
|
|
1555
|
+
...jsonHeaders,
|
|
1556
|
+
[IDEMPOTENCY_HEADER]: idempotencyKey
|
|
1557
|
+
},
|
|
1558
|
+
body: JSON.stringify(payload)
|
|
1559
|
+
});
|
|
1560
|
+
return res.json();
|
|
1561
|
+
},
|
|
1562
|
+
async executeConnection(toolAgentConnectionId, payload, options = {}) {
|
|
1563
|
+
const idempotencyKey = generateIdempotencyKey(options.idempotencyKey);
|
|
1564
|
+
const res = await doFetch(
|
|
1565
|
+
`${base}/tools/connections/${toolAgentConnectionId}/execute`,
|
|
1566
|
+
{
|
|
1567
|
+
method: "POST",
|
|
1568
|
+
headers: {
|
|
1569
|
+
...jsonHeaders,
|
|
1570
|
+
[IDEMPOTENCY_HEADER]: idempotencyKey
|
|
1571
|
+
},
|
|
1572
|
+
body: JSON.stringify(payload)
|
|
1573
|
+
}
|
|
1574
|
+
);
|
|
1575
|
+
return res.json();
|
|
1526
1576
|
}
|
|
1527
1577
|
};
|
|
1528
1578
|
}
|
|
@@ -2065,6 +2115,7 @@ export {
|
|
|
2065
2115
|
HttpError,
|
|
2066
2116
|
NetworkError,
|
|
2067
2117
|
TimeoutError,
|
|
2118
|
+
WorkspaceNotSelectedError,
|
|
2068
2119
|
bindAgentBlueprints,
|
|
2069
2120
|
bindAgentPhones,
|
|
2070
2121
|
bindAgentSchedule,
|