@getsupervisor/agents-studio-sdk 1.40.0 → 1.41.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/CHANGELOG.md CHANGED
@@ -1,3 +1,80 @@
1
+ ## v1.40.0
2
+
3
+ ## [1.40.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.39.0...v1.40.0) (2025-12-04)
4
+
5
+ ### Features
6
+
7
+ * integrate BlueprintVariablesService into agent blueprint and stage handlers, enhancing variable management ([a798152](https://github.com/julio-supervisor/agents-studio-be/commit/a798152b3ee2b99f594ad0f16d79653d7a3abbff))
8
+
9
+ ## v1.39.0
10
+
11
+ ## [1.39.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.38.0...v1.39.0) (2025-12-02)
12
+
13
+ ### Features
14
+
15
+ * add content hash and variable management to blueprints and stages ([632ff03](https://github.com/julio-supervisor/agents-studio-be/commit/632ff031aaf4a63af09985ba336c67f7a69bfdf9))
16
+ * enhance DomainExceptionFilter to handle multiple domain exceptions and improve response structure ([02371e8](https://github.com/julio-supervisor/agents-studio-be/commit/02371e8d2bc197d6e04f169b75ffa1a57591a9f2))
17
+ * update voiceId usage in agent blueprint tests and integration specs ([560373d](https://github.com/julio-supervisor/agents-studio-be/commit/560373da338c0525a27352a59ffe5c97c2b38372))
18
+ * validate workspace identifier as UUID in WorkspaceGuard ([645d7a6](https://github.com/julio-supervisor/agents-studio-be/commit/645d7a668cfc424cacfd4829aa36c622b187d559))
19
+
20
+ ## v1.38.0
21
+
22
+ ## [1.38.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.37.0...v1.38.0) (2025-12-01)
23
+
24
+ ### Features
25
+
26
+ * add ListAgentSchedulesHandler to query handlers ([a29436f](https://github.com/julio-supervisor/agents-studio-be/commit/a29436f0c514a7257742ae1c7920ed7a040cd94e))
27
+ * add normalization for HH:mm:ss time values in AgentScheduleTypeormMapper ([de560f6](https://github.com/julio-supervisor/agents-studio-be/commit/de560f61a2c15f98f5004a062faea8bc4edcde3c))
28
+ * add test for ignoring orphaned slot values when the day is disabled ([65c699c](https://github.com/julio-supervisor/agents-studio-be/commit/65c699cf3405fae26d561563808dc87044ccaf72))
29
+ * add voiceId support to agent blueprints and related services ([00897a8](https://github.com/julio-supervisor/agents-studio-be/commit/00897a8bc5d0728d763b690ee7cc3bc9e27c1645))
30
+ * format listAgentScheduleExceptions method for improved readability ([f72000b](https://github.com/julio-supervisor/agents-studio-be/commit/f72000bdea34a8786035fae8c77650393d50c89f))
31
+ * implement AgentInitialVersionSubscriber to create initial agent versions and update related events ([76d59aa](https://github.com/julio-supervisor/agents-studio-be/commit/76d59aaa20288fe55835c70b9de81f9f55f1a29b))
32
+ * refactor listAgentScheduleExceptions method in AgentSchedulesController ([bf0494f](https://github.com/julio-supervisor/agents-studio-be/commit/bf0494f2159bcca7c7dcd875b6d20741d2c927fb))
33
+
34
+ ## v1.37.0
35
+
36
+ ## [1.37.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.36.1...v1.37.0) (2025-11-28)
37
+
38
+ ### Features
39
+
40
+ * add BlueprintWorkflowClonerService and integrate it into agent version handlers ([f585285](https://github.com/julio-supervisor/agents-studio-be/commit/f585285c827760567622ca6f63b5e5ca8a19ba3f))
41
+ * add tests for SDK APIs and enhance agent schedule tools ([5af2da3](https://github.com/julio-supervisor/agents-studio-be/commit/5af2da3ec0cc8acd2d6a06fb71cb5271a4348042))
42
+ * add unit tests for ListAgentSchedulesHandler with pagination, sorting, and error handling ([eb142f4](https://github.com/julio-supervisor/agents-studio-be/commit/eb142f4c47925eda6e989dd5987f0ae2645e3c74))
43
+ * enhance version publishing logic to prevent publishing active versions and unsupported statuses ([c332dd9](https://github.com/julio-supervisor/agents-studio-be/commit/c332dd912a4cbc5bee15836ff6676d6a48c55cc8))
44
+ * implement cloning of the latest blueprint in CreateAgentVersionHandler ([33eca82](https://github.com/julio-supervisor/agents-studio-be/commit/33eca82553190d48147382b4da3befe5a7506f63))
45
+ * implement listing and querying of agent schedules with pagination and sorting ([35dd513](https://github.com/julio-supervisor/agents-studio-be/commit/35dd513078a3081a4bafbc1094f0927efd44359e))
46
+ * update agent schedule handler tests to include scheduleId and improve specifications ([1e9c228](https://github.com/julio-supervisor/agents-studio-be/commit/1e9c2284b7fe4d220b14d82b5dc44cd332ac7cac))
47
+
48
+ ### Bug Fixes
49
+
50
+ * remove unused workspaceId from ToolConnectionsCreateTool test ([b2702c8](https://github.com/julio-supervisor/agents-studio-be/commit/b2702c8e80cab01c02e2bcb87bc90e6325f368cb))
51
+
52
+ ## v1.36.1
53
+
54
+ ## [1.36.1](https://github.com/julio-supervisor/agents-studio-be/compare/v1.36.0...v1.36.1) (2025-11-27)
55
+
56
+ ### Bug Fixes
57
+
58
+ * reorder imports and exports for consistency across modules ([23cfc68](https://github.com/julio-supervisor/agents-studio-be/commit/23cfc6823789532f6198d9f4362f808f27fc9b3a))
59
+
60
+ ## v1.36.0
61
+
62
+ ## [1.36.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.35.0...v1.36.0) (2025-11-27)
63
+
64
+ ### Features
65
+
66
+ * add BlueprintCatalogValidationService and integrate catalog validation in agent blueprint handlers ([e611fe4](https://github.com/julio-supervisor/agents-studio-be/commit/e611fe41e075811353b4c51aea4e4651f8493d01))
67
+ * add type aliases for agent and webhook requests and responses ([48224ec](https://github.com/julio-supervisor/agents-studio-be/commit/48224ec1a0617b9224ebca0ef41637e44fd8f7d2))
68
+
69
+ ## v1.35.0
70
+
71
+ ## [1.35.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.34.0...v1.35.0) (2025-11-16)
72
+
73
+ ### Features
74
+
75
+ * add default language constant and update RetellBlueprintMapper to use it ([85d2d8c](https://github.com/julio-supervisor/agents-studio-be/commit/85d2d8ccc908254d351855158ecc09f14dbf6c6f))
76
+ * implement delete instruction functionality with command handler and controller ([af983f5](https://github.com/julio-supervisor/agents-studio-be/commit/af983f5254055d35d3972d0bcbdb12a52b48c785))
77
+
1
78
  ## v1.34.0
2
79
 
3
80
  ## [1.34.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.33.0...v1.34.0) (2025-11-16)
package/README.md CHANGED
@@ -73,6 +73,28 @@ await client.tools.uploadResource(tools.data[0].identifier, formData);
73
73
 
74
74
  // eliminar un agente
75
75
  await client.agents.delete(agent.agentId);
76
+
77
+ // campañas masivas desde CSV
78
+ const campaign = await client.campaigns.create(agent.agentId, versionId, {
79
+ name: 'Holiday follow-up',
80
+ objective: 'Re-engage dormant customers',
81
+ file: new File([csvBlob], 'campaign-rows.csv', { type: 'text/csv' }),
82
+ });
83
+
84
+ const recentCampaigns = await client.campaigns.list({ limit: 10 });
85
+ console.log(recentCampaigns.data.map((item) => item.name));
86
+
87
+ // ejecuciones individuales con correlación al toolExecutionId
88
+ const executions = await client.campaigns.listExecutions(campaign.campaignId, {
89
+ limit: 20,
90
+ });
91
+
92
+ executions.data.forEach((row) => {
93
+ console.log(
94
+ `Row ${row.rowNumber} => status=${row.status} agentExecutionId=${row.agentExecutionId}`,
95
+ );
96
+ });
97
+ // agentExecutionId coincide con el toolExecutionId expuesto por client.tools.execute
76
98
  ```
77
99
 
78
100
  ## Catálogos (Catalogs)
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  createAgentVersionsApi: () => createAgentVersionsApi,
43
43
  createAgentsApi: () => createAgentsApi,
44
44
  createApiKeysApi: () => createApiKeysApi,
45
+ createCampaignsApi: () => createCampaignsApi,
45
46
  createCatalogTemplatesApi: () => createCatalogTemplatesApi,
46
47
  createCatalogsApi: () => createCatalogsApi,
47
48
  createClient: () => createClient,
@@ -515,6 +516,56 @@ function attachPaginator(response, fetchPage, options) {
515
516
  });
516
517
  }
517
518
 
519
+ // src/api/agent-schedule.ts
520
+ function createAgentScheduleApi(cfg) {
521
+ const { base, doFetch } = createHttp(cfg);
522
+ const jsonHeaders = { "content-type": "application/json" };
523
+ const fetchSchedulesPage = async (agentId, options = {}) => {
524
+ const query = serializeListOptions({ ...options ?? {} });
525
+ const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
526
+ method: "GET",
527
+ query
528
+ });
529
+ return res.json();
530
+ };
531
+ return {
532
+ async list(agentId, options = {}) {
533
+ const normalized = { ...options ?? {} };
534
+ const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
535
+ const response = await fetchPage(normalized);
536
+ return attachPaginator(response, fetchPage, normalized);
537
+ },
538
+ async get(agentId, scheduleId) {
539
+ const res = await doFetch(
540
+ `${base}/agents/${agentId}/schedules/${scheduleId}`,
541
+ {
542
+ method: "GET"
543
+ }
544
+ );
545
+ return res.json();
546
+ },
547
+ async create(agentId, payload) {
548
+ const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
549
+ method: "POST",
550
+ headers: jsonHeaders,
551
+ body: JSON.stringify(payload)
552
+ });
553
+ return res.json();
554
+ },
555
+ async update(agentId, scheduleId, payload) {
556
+ const res = await doFetch(
557
+ `${base}/agents/${agentId}/schedules/${scheduleId}`,
558
+ {
559
+ method: "PUT",
560
+ headers: jsonHeaders,
561
+ body: JSON.stringify(payload)
562
+ }
563
+ );
564
+ return res.json();
565
+ }
566
+ };
567
+ }
568
+
518
569
  // src/api/agent-schedule-exceptions.ts
519
570
  function createAgentScheduleExceptionsApi(cfg) {
520
571
  const { base, doFetch } = createHttp(cfg);
@@ -581,56 +632,6 @@ function createAgentScheduleExceptionsApi(cfg) {
581
632
  };
582
633
  }
583
634
 
584
- // src/api/agent-schedule.ts
585
- function createAgentScheduleApi(cfg) {
586
- const { base, doFetch } = createHttp(cfg);
587
- const jsonHeaders = { "content-type": "application/json" };
588
- const fetchSchedulesPage = async (agentId, options = {}) => {
589
- const query = serializeListOptions({ ...options ?? {} });
590
- const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
591
- method: "GET",
592
- query
593
- });
594
- return res.json();
595
- };
596
- return {
597
- async list(agentId, options = {}) {
598
- const normalized = { ...options ?? {} };
599
- const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
600
- const response = await fetchPage(normalized);
601
- return attachPaginator(response, fetchPage, normalized);
602
- },
603
- async get(agentId, scheduleId) {
604
- const res = await doFetch(
605
- `${base}/agents/${agentId}/schedules/${scheduleId}`,
606
- {
607
- method: "GET"
608
- }
609
- );
610
- return res.json();
611
- },
612
- async create(agentId, payload) {
613
- const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
614
- method: "POST",
615
- headers: jsonHeaders,
616
- body: JSON.stringify(payload)
617
- });
618
- return res.json();
619
- },
620
- async update(agentId, scheduleId, payload) {
621
- const res = await doFetch(
622
- `${base}/agents/${agentId}/schedules/${scheduleId}`,
623
- {
624
- method: "PUT",
625
- headers: jsonHeaders,
626
- body: JSON.stringify(payload)
627
- }
628
- );
629
- return res.json();
630
- }
631
- };
632
- }
633
-
634
635
  // src/api/agent-stage-triggers.ts
635
636
  function createAgentStageTriggersApi(cfg) {
636
637
  const { base, doFetch } = createHttp(cfg);
@@ -1299,6 +1300,82 @@ function createApiKeysApi(cfg) {
1299
1300
  };
1300
1301
  }
1301
1302
 
1303
+ // src/api/campaigns.ts
1304
+ function createCampaignsApi(cfg) {
1305
+ const { base, doFetch } = createHttp(cfg);
1306
+ const isFormData2 = (value) => {
1307
+ return typeof FormData !== "undefined" && value instanceof FormData;
1308
+ };
1309
+ const fetchCampaignsPage = async (options = {}) => {
1310
+ const query = serializeListOptions(options ?? {});
1311
+ const res = await doFetch(`${base}/campaigns`, {
1312
+ method: "GET",
1313
+ query
1314
+ });
1315
+ return res.json();
1316
+ };
1317
+ const fetchExecutionsPage = async (campaignId, options = {}) => {
1318
+ const query = serializeListOptions({
1319
+ page: options.page,
1320
+ limit: options.limit
1321
+ });
1322
+ const res = await doFetch(`${base}/campaigns/${campaignId}/executions`, {
1323
+ method: "GET",
1324
+ query
1325
+ });
1326
+ return res.json();
1327
+ };
1328
+ const buildMultipart = (payload) => {
1329
+ if (isFormData2(payload)) {
1330
+ return payload;
1331
+ }
1332
+ if (typeof FormData === "undefined") {
1333
+ throw new TypeError(
1334
+ "FormData is not available in this environment. Pass a FormData instance instead."
1335
+ );
1336
+ }
1337
+ const form = new FormData();
1338
+ form.append("name", payload.name);
1339
+ if (payload.objective !== void 0 && payload.objective !== null) {
1340
+ form.append("objective", payload.objective);
1341
+ }
1342
+ form.append("file", payload.file);
1343
+ return form;
1344
+ };
1345
+ return {
1346
+ async list(options = {}) {
1347
+ const normalizedOptions = { ...options ?? {} };
1348
+ const response = await fetchCampaignsPage(normalizedOptions);
1349
+ return attachPaginator(response, fetchCampaignsPage, normalizedOptions);
1350
+ },
1351
+ async get(campaignId) {
1352
+ const res = await doFetch(`${base}/campaigns/${campaignId}`, {
1353
+ method: "GET"
1354
+ });
1355
+ return res.json();
1356
+ },
1357
+ async create(agentId, versionId, payload) {
1358
+ const body = buildMultipart(payload);
1359
+ const res = await doFetch(
1360
+ `${base}/agents/${agentId}/versions/${versionId}/campaigns`,
1361
+ {
1362
+ method: "POST",
1363
+ body
1364
+ }
1365
+ );
1366
+ return res.json();
1367
+ },
1368
+ async listExecutions(campaignId, options = {}) {
1369
+ const normalizedOptions = {
1370
+ ...options ?? {}
1371
+ };
1372
+ const response = await fetchExecutionsPage(campaignId, normalizedOptions);
1373
+ const fetchPage = (opts) => fetchExecutionsPage(campaignId, opts);
1374
+ return attachPaginator(response, fetchPage, normalizedOptions);
1375
+ }
1376
+ };
1377
+ }
1378
+
1302
1379
  // src/api/catalog-templates.ts
1303
1380
  function createCatalogTemplatesApi(cfg) {
1304
1381
  const { base, doFetch } = createHttp(cfg);
@@ -1955,6 +2032,7 @@ function createClient(initialCfg) {
1955
2032
  ...catalogsApi,
1956
2033
  templates: catalogTemplatesApi
1957
2034
  },
2035
+ campaigns: createCampaignsApi(runtimeCfg),
1958
2036
  voices: voicesApi,
1959
2037
  apiKeys: apiKeysApi,
1960
2038
  webhooks: webhooksApi
@@ -2039,6 +2117,7 @@ function createClient(initialCfg) {
2039
2117
  createAgentVersionsApi,
2040
2118
  createAgentsApi,
2041
2119
  createApiKeysApi,
2120
+ createCampaignsApi,
2042
2121
  createCatalogTemplatesApi,
2043
2122
  createCatalogsApi,
2044
2123
  createClient,