@getsupervisor/agents-studio-sdk 1.41.2-patch.7 → 1.41.2-patch.8
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.cjs +40 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -697,6 +697,13 @@ type components = {
|
|
|
697
697
|
status?: 'inactive' | 'training' | 'active' | null;
|
|
698
698
|
debounceDelayMs?: number | null;
|
|
699
699
|
};
|
|
700
|
+
CloneAgentRequest: {
|
|
701
|
+
name: string;
|
|
702
|
+
description?: string | null;
|
|
703
|
+
status?: 'inactive' | 'training' | 'active' | null;
|
|
704
|
+
versionId: string;
|
|
705
|
+
clone: ('instructions' | 'tools' | 'webhooks' | 'stages' | 'triggers' | 'businessHours' | 'businessHourExceptions')[];
|
|
706
|
+
};
|
|
700
707
|
AgentScheduleListResponse: {
|
|
701
708
|
data: components['schemas']['AgentSchedule'][];
|
|
702
709
|
meta: components['schemas']['PaginationMeta'];
|
|
@@ -959,6 +966,12 @@ type AgentDetail = components['schemas']['AgentDetail'];
|
|
|
959
966
|
type AgentSummary = components['schemas']['AgentSummary'];
|
|
960
967
|
type AgentListResponse = components['schemas']['AgentListResponse'];
|
|
961
968
|
type CreateAgentRequest = components['schemas']['CreateAgentRequest'];
|
|
969
|
+
type CloneAgentRequest = components['schemas']['CloneAgentRequest'];
|
|
970
|
+
type CloneAgentComponent = CloneAgentRequest['clone'][number];
|
|
971
|
+
type CloneAgentSelection = CloneAgentComponent[] | Partial<Record<CloneAgentComponent, boolean>>;
|
|
972
|
+
type CloneAgentPayload = Omit<CloneAgentRequest, 'clone'> & {
|
|
973
|
+
clone?: CloneAgentSelection;
|
|
974
|
+
};
|
|
962
975
|
type ForkAgentFromTemplateRequest = components['schemas']['ForkAgentFromTemplateRequest'];
|
|
963
976
|
type UpdateAgentRequest = components['schemas']['UpdateAgentRequest'];
|
|
964
977
|
type AgentTagRequest = components['schemas']['AgentTagRequest'];
|
|
@@ -1335,6 +1348,7 @@ interface AgentEntity extends AgentBase {
|
|
|
1335
1348
|
blueprints: AgentBlueprintsHelper;
|
|
1336
1349
|
stages: AgentStagesHelper;
|
|
1337
1350
|
save(patch: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1351
|
+
clone(payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1338
1352
|
delete(): Promise<void>;
|
|
1339
1353
|
refresh(): Promise<AgentEntity>;
|
|
1340
1354
|
}
|
|
@@ -1350,6 +1364,7 @@ type AgentEntityFactoryOptions = {
|
|
|
1350
1364
|
reload(agentId: string): Promise<AgentEntity>;
|
|
1351
1365
|
updateAgent(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1352
1366
|
deleteAgent(agentId: string): Promise<void>;
|
|
1367
|
+
cloneAgent(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1353
1368
|
};
|
|
1354
1369
|
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, blueprintId: string, stageId: string) => {
|
|
1355
1370
|
list(opts?: ListAgentStageTriggersOptions): Promise<PaginatedResult<{
|
|
@@ -1730,6 +1745,7 @@ type AgentsApi = {
|
|
|
1730
1745
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponse, ListAgentsOptions>>;
|
|
1731
1746
|
get(agentId: string): Promise<AgentDetail>;
|
|
1732
1747
|
create(payload: CreateAgentRequest): Promise<AgentDetail>;
|
|
1748
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentDetail>;
|
|
1733
1749
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentDetail>;
|
|
1734
1750
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentDetail>;
|
|
1735
1751
|
delete(agent: string | AgentEntity): Promise<void>;
|
|
@@ -1738,10 +1754,11 @@ type AgentListResponseWithEntities = {
|
|
|
1738
1754
|
data: AgentEntity[];
|
|
1739
1755
|
meta: AgentListResponse['meta'];
|
|
1740
1756
|
};
|
|
1741
|
-
type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'update' | 'list' | 'forkFromTemplate'> & {
|
|
1757
|
+
type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'clone' | 'update' | 'list' | 'forkFromTemplate'> & {
|
|
1742
1758
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponseWithEntities, ListAgentsOptions>>;
|
|
1743
1759
|
get(agentId: string): Promise<AgentEntity>;
|
|
1744
1760
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
1761
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1745
1762
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
1746
1763
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1747
1764
|
};
|
|
@@ -1990,6 +2007,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1990
2007
|
}, ListAgentsOptions>>;
|
|
1991
2008
|
get(agentId: string): Promise<AgentEntity>;
|
|
1992
2009
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
2010
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1993
2011
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
1994
2012
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1995
2013
|
};
|
|
@@ -2134,6 +2152,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
2134
2152
|
}, ListAgentsOptions>>;
|
|
2135
2153
|
get(agentId: string): Promise<AgentEntity>;
|
|
2136
2154
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
2155
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
2137
2156
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
2138
2157
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
2139
2158
|
};
|
|
@@ -2251,4 +2270,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
2251
2270
|
resolveAccessToken: () => string;
|
|
2252
2271
|
};
|
|
2253
2272
|
|
|
2254
|
-
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, type StreamCallsOptions, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
|
|
2273
|
+
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type CloneAgentComponent, type CloneAgentPayload, type CloneAgentRequest, type CloneAgentSelection, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, type StreamCallsOptions, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
|
package/dist/index.d.ts
CHANGED
|
@@ -697,6 +697,13 @@ type components = {
|
|
|
697
697
|
status?: 'inactive' | 'training' | 'active' | null;
|
|
698
698
|
debounceDelayMs?: number | null;
|
|
699
699
|
};
|
|
700
|
+
CloneAgentRequest: {
|
|
701
|
+
name: string;
|
|
702
|
+
description?: string | null;
|
|
703
|
+
status?: 'inactive' | 'training' | 'active' | null;
|
|
704
|
+
versionId: string;
|
|
705
|
+
clone: ('instructions' | 'tools' | 'webhooks' | 'stages' | 'triggers' | 'businessHours' | 'businessHourExceptions')[];
|
|
706
|
+
};
|
|
700
707
|
AgentScheduleListResponse: {
|
|
701
708
|
data: components['schemas']['AgentSchedule'][];
|
|
702
709
|
meta: components['schemas']['PaginationMeta'];
|
|
@@ -959,6 +966,12 @@ type AgentDetail = components['schemas']['AgentDetail'];
|
|
|
959
966
|
type AgentSummary = components['schemas']['AgentSummary'];
|
|
960
967
|
type AgentListResponse = components['schemas']['AgentListResponse'];
|
|
961
968
|
type CreateAgentRequest = components['schemas']['CreateAgentRequest'];
|
|
969
|
+
type CloneAgentRequest = components['schemas']['CloneAgentRequest'];
|
|
970
|
+
type CloneAgentComponent = CloneAgentRequest['clone'][number];
|
|
971
|
+
type CloneAgentSelection = CloneAgentComponent[] | Partial<Record<CloneAgentComponent, boolean>>;
|
|
972
|
+
type CloneAgentPayload = Omit<CloneAgentRequest, 'clone'> & {
|
|
973
|
+
clone?: CloneAgentSelection;
|
|
974
|
+
};
|
|
962
975
|
type ForkAgentFromTemplateRequest = components['schemas']['ForkAgentFromTemplateRequest'];
|
|
963
976
|
type UpdateAgentRequest = components['schemas']['UpdateAgentRequest'];
|
|
964
977
|
type AgentTagRequest = components['schemas']['AgentTagRequest'];
|
|
@@ -1335,6 +1348,7 @@ interface AgentEntity extends AgentBase {
|
|
|
1335
1348
|
blueprints: AgentBlueprintsHelper;
|
|
1336
1349
|
stages: AgentStagesHelper;
|
|
1337
1350
|
save(patch: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1351
|
+
clone(payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1338
1352
|
delete(): Promise<void>;
|
|
1339
1353
|
refresh(): Promise<AgentEntity>;
|
|
1340
1354
|
}
|
|
@@ -1350,6 +1364,7 @@ type AgentEntityFactoryOptions = {
|
|
|
1350
1364
|
reload(agentId: string): Promise<AgentEntity>;
|
|
1351
1365
|
updateAgent(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1352
1366
|
deleteAgent(agentId: string): Promise<void>;
|
|
1367
|
+
cloneAgent(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1353
1368
|
};
|
|
1354
1369
|
declare const bindAgentStageTriggers: (api: AgentStageTriggersApi, agentId: string, blueprintId: string, stageId: string) => {
|
|
1355
1370
|
list(opts?: ListAgentStageTriggersOptions): Promise<PaginatedResult<{
|
|
@@ -1730,6 +1745,7 @@ type AgentsApi = {
|
|
|
1730
1745
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponse, ListAgentsOptions>>;
|
|
1731
1746
|
get(agentId: string): Promise<AgentDetail>;
|
|
1732
1747
|
create(payload: CreateAgentRequest): Promise<AgentDetail>;
|
|
1748
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentDetail>;
|
|
1733
1749
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentDetail>;
|
|
1734
1750
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentDetail>;
|
|
1735
1751
|
delete(agent: string | AgentEntity): Promise<void>;
|
|
@@ -1738,10 +1754,11 @@ type AgentListResponseWithEntities = {
|
|
|
1738
1754
|
data: AgentEntity[];
|
|
1739
1755
|
meta: AgentListResponse['meta'];
|
|
1740
1756
|
};
|
|
1741
|
-
type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'update' | 'list' | 'forkFromTemplate'> & {
|
|
1757
|
+
type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'clone' | 'update' | 'list' | 'forkFromTemplate'> & {
|
|
1742
1758
|
list(options?: ListAgentsOptions): Promise<PaginatedResult<AgentListResponseWithEntities, ListAgentsOptions>>;
|
|
1743
1759
|
get(agentId: string): Promise<AgentEntity>;
|
|
1744
1760
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
1761
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1745
1762
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
1746
1763
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1747
1764
|
};
|
|
@@ -1990,6 +2007,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1990
2007
|
}, ListAgentsOptions>>;
|
|
1991
2008
|
get(agentId: string): Promise<AgentEntity>;
|
|
1992
2009
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
2010
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
1993
2011
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
1994
2012
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
1995
2013
|
};
|
|
@@ -2134,6 +2152,7 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
2134
2152
|
}, ListAgentsOptions>>;
|
|
2135
2153
|
get(agentId: string): Promise<AgentEntity>;
|
|
2136
2154
|
create(payload: CreateAgentRequest): Promise<AgentEntity>;
|
|
2155
|
+
clone(agentId: string, payload: CloneAgentPayload): Promise<AgentEntity>;
|
|
2137
2156
|
forkFromTemplate(payload: ForkAgentFromTemplateRequest): Promise<AgentEntity>;
|
|
2138
2157
|
update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
|
|
2139
2158
|
};
|
|
@@ -2251,4 +2270,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
2251
2270
|
resolveAccessToken: () => string;
|
|
2252
2271
|
};
|
|
2253
2272
|
|
|
2254
|
-
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, type StreamCallsOptions, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
|
|
2273
|
+
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiErrorBody, type ApiHttpError, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Call, type CallsListMeta, type CallsListResponse, type CallsStreamMeta, type CallsStreamResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type CloneAgentComponent, type CloneAgentPayload, type CloneAgentRequest, type CloneAgentSelection, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateToolConnectionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolConnectionRequest, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCallsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolConnectionsOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, type ListWorkspacesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, type StreamCallsOptions, TimeoutError, type ToolConnectionAuth, type ToolConnectionListItem, type ToolConnectionListResponse, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspaceListResponse, WorkspaceNotSelectedError, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, type WorkspaceSummary, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCallsApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi, isApiErrorBody, isApiHttpError };
|
package/dist/index.js
CHANGED
|
@@ -1076,7 +1076,8 @@ var createAgentEntity = (dto, options) => {
|
|
|
1076
1076
|
stageTriggersApi,
|
|
1077
1077
|
reload,
|
|
1078
1078
|
updateAgent,
|
|
1079
|
-
deleteAgent
|
|
1079
|
+
deleteAgent,
|
|
1080
|
+
cloneAgent
|
|
1080
1081
|
} = options;
|
|
1081
1082
|
const schedulesHelper = bindAgentSchedules(
|
|
1082
1083
|
scheduleApi,
|
|
@@ -1095,6 +1096,9 @@ var createAgentEntity = (dto, options) => {
|
|
|
1095
1096
|
async save(patch) {
|
|
1096
1097
|
return updateAgent(dto.agentId, patch);
|
|
1097
1098
|
},
|
|
1099
|
+
async clone(payload) {
|
|
1100
|
+
return cloneAgent(dto.agentId, payload);
|
|
1101
|
+
},
|
|
1098
1102
|
async delete() {
|
|
1099
1103
|
await deleteAgent(dto.agentId);
|
|
1100
1104
|
},
|
|
@@ -1120,6 +1124,22 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1120
1124
|
throw new WorkspaceNotSelectedError();
|
|
1121
1125
|
};
|
|
1122
1126
|
const jsonHeaders = { "content-type": "application/json" };
|
|
1127
|
+
const normalizeCloneSelection = (selection) => {
|
|
1128
|
+
if (!selection) {
|
|
1129
|
+
return [];
|
|
1130
|
+
}
|
|
1131
|
+
if (Array.isArray(selection)) {
|
|
1132
|
+
return selection;
|
|
1133
|
+
}
|
|
1134
|
+
return Object.entries(selection).filter(([, enabled]) => Boolean(enabled)).map(([component]) => component);
|
|
1135
|
+
};
|
|
1136
|
+
const buildCloneAgentRequest = (payload) => {
|
|
1137
|
+
const { clone, ...rest } = payload;
|
|
1138
|
+
return {
|
|
1139
|
+
...rest,
|
|
1140
|
+
clone: normalizeCloneSelection(clone)
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1123
1143
|
const fetchAgentsPage = async (options = {}) => {
|
|
1124
1144
|
requireWorkspace();
|
|
1125
1145
|
const sanitizedOptions = {
|
|
@@ -1164,6 +1184,16 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1164
1184
|
});
|
|
1165
1185
|
return res.json();
|
|
1166
1186
|
};
|
|
1187
|
+
const cloneAgent = async (agentId, payload) => {
|
|
1188
|
+
requireWorkspace();
|
|
1189
|
+
const requestPayload = buildCloneAgentRequest(payload);
|
|
1190
|
+
const res = await doFetch(`${base}/agents/${agentId}/clone`, {
|
|
1191
|
+
method: "POST",
|
|
1192
|
+
body: JSON.stringify(requestPayload),
|
|
1193
|
+
headers: jsonHeaders
|
|
1194
|
+
});
|
|
1195
|
+
return res.json();
|
|
1196
|
+
};
|
|
1167
1197
|
const updateAgent = async (agentId, payload) => {
|
|
1168
1198
|
requireWorkspace();
|
|
1169
1199
|
const res = await doFetch(`${base}/agents/${agentId}`, {
|
|
@@ -1187,6 +1217,7 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1187
1217
|
list: listAgents,
|
|
1188
1218
|
get: getAgentDetail,
|
|
1189
1219
|
create: createAgent,
|
|
1220
|
+
clone: cloneAgent,
|
|
1190
1221
|
forkFromTemplate: forkAgentFromTemplate,
|
|
1191
1222
|
update: updateAgent,
|
|
1192
1223
|
delete: deleteAgent
|
|
@@ -1213,6 +1244,10 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1213
1244
|
},
|
|
1214
1245
|
deleteAgent: async (agentId) => {
|
|
1215
1246
|
await deleteAgent(agentId);
|
|
1247
|
+
},
|
|
1248
|
+
cloneAgent: async (agentId, payload) => {
|
|
1249
|
+
const cloned = await cloneAgent(agentId, payload);
|
|
1250
|
+
return wrapAgent(cloned);
|
|
1216
1251
|
}
|
|
1217
1252
|
});
|
|
1218
1253
|
return {
|
|
@@ -1238,6 +1273,10 @@ function createAgentsApi(cfg, relatedApis) {
|
|
|
1238
1273
|
const detail = await createAgent(payload);
|
|
1239
1274
|
return wrapAgent(detail);
|
|
1240
1275
|
},
|
|
1276
|
+
async clone(agentId, payload) {
|
|
1277
|
+
const detail = await cloneAgent(agentId, payload);
|
|
1278
|
+
return wrapAgent(detail);
|
|
1279
|
+
},
|
|
1241
1280
|
async forkFromTemplate(payload) {
|
|
1242
1281
|
const detail = await forkAgentFromTemplate(payload);
|
|
1243
1282
|
return wrapAgent(detail);
|