@getsupervisor/agents-studio-sdk 1.13.0 → 1.15.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,25 @@
1
+ ## v1.14.0
2
+
3
+ ## [1.14.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.13.0...v1.14.0) (2025-10-21)
4
+
5
+ ### Features
6
+
7
+ * add Agent Versions controller and related DTOs, enhance publish functionality with notes ([9227708](https://github.com/julio-supervisor/agents-studio-be/commit/92277085c8441fefba4fb52d6859441269132de1))
8
+ * agregar funcionalidades para clonar, publicar y actualizar notas de versiones de agentes, y ajustar esquemas y rutas en la API ([7a01fa0](https://github.com/julio-supervisor/agents-studio-be/commit/7a01fa03ff30e9fd6a9b4358a2df2f709a61c189))
9
+ * agregar mapeo de módulos para la ruta de versiones de agentes en jest.config.js ([11c4e34](https://github.com/julio-supervisor/agents-studio-be/commit/11c4e340608de1b91f2461912b23e3c484e92f59))
10
+ * agregar mapeo de módulos para la ruta de versiones de agentes en package.json ([a63586e](https://github.com/julio-supervisor/agents-studio-be/commit/a63586eb845c21c276776e0d023719a37f4896e5))
11
+ * implement Agent Version Management with TypeORM ([736ed04](https://github.com/julio-supervisor/agents-studio-be/commit/736ed045a4e395674a4ee1c623d44d265421b386))
12
+
13
+
14
+ ## v1.13.0
15
+
16
+ ## [1.13.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.12.0...v1.13.0) (2025-10-20)
17
+
18
+ ### Features
19
+
20
+ * agregar scopes de autorización a los controladores y actualizar la documentación de la API ([c8165cb](https://github.com/julio-supervisor/agents-studio-be/commit/c8165cb2713aa4194e3006c30296872e44de2d5e))
21
+
22
+
1
23
  ## v1.12.0
2
24
 
3
25
  ## [1.12.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.11.0...v1.12.0) (2025-10-20)
package/dist/index.cjs CHANGED
@@ -26,6 +26,7 @@ __export(index_exports, {
26
26
  bindAgentInstructions: () => bindAgentInstructions,
27
27
  bindAgentPhones: () => bindAgentPhones,
28
28
  bindAgentSchedule: () => bindAgentSchedule,
29
+ bindAgentScheduleExceptions: () => bindAgentScheduleExceptions,
29
30
  bindAgentTags: () => bindAgentTags,
30
31
  bindAgentVersions: () => bindAgentVersions,
31
32
  createAgentBlueprintsApi: () => createAgentBlueprintsApi,
@@ -33,6 +34,7 @@ __export(index_exports, {
33
34
  createAgentInstructionsApi: () => createAgentInstructionsApi,
34
35
  createAgentPhonesApi: () => createAgentPhonesApi,
35
36
  createAgentScheduleApi: () => createAgentScheduleApi,
37
+ createAgentScheduleExceptionsApi: () => createAgentScheduleExceptionsApi,
36
38
  createAgentTagsApi: () => createAgentTagsApi,
37
39
  createAgentVersionsApi: () => createAgentVersionsApi,
38
40
  createAgentsApi: () => createAgentsApi,
@@ -570,6 +572,14 @@ function createAgentScheduleApi(cfg) {
570
572
  });
571
573
  return res.json();
572
574
  },
575
+ async create(agentId, payload) {
576
+ const res = await doFetch(`${base}/v1/agents/${agentId}/schedule`, {
577
+ method: "POST",
578
+ headers: jsonHeaders,
579
+ body: JSON.stringify(payload)
580
+ });
581
+ return res.json();
582
+ },
573
583
  async update(agentId, payload) {
574
584
  const res = await doFetch(`${base}/v1/agents/${agentId}/schedule`, {
575
585
  method: "PUT",
@@ -581,6 +591,72 @@ function createAgentScheduleApi(cfg) {
581
591
  };
582
592
  }
583
593
 
594
+ // src/api/agent-schedule-exceptions.ts
595
+ function createAgentScheduleExceptionsApi(cfg) {
596
+ const { base, doFetch } = createHttp(cfg);
597
+ const jsonHeaders = { "content-type": "application/json" };
598
+ const fetchExceptionsPage = async (agentId, options = {}) => {
599
+ const query = serializeListOptions(options ?? {});
600
+ const res = await doFetch(
601
+ `${base}/v1/agents/${agentId}/schedule/exceptions`,
602
+ {
603
+ method: "GET",
604
+ query
605
+ }
606
+ );
607
+ return res.json();
608
+ };
609
+ return {
610
+ async list(agentId, options = {}) {
611
+ const normalizedOptions = {
612
+ ...options ?? {}
613
+ };
614
+ const fetchPage = (pageOptions) => fetchExceptionsPage(agentId, pageOptions);
615
+ const response = await fetchPage(normalizedOptions);
616
+ return attachPaginator(response, fetchPage, normalizedOptions);
617
+ },
618
+ async get(agentId, exceptionId) {
619
+ const res = await doFetch(
620
+ `${base}/v1/agents/${agentId}/schedule/exceptions/${exceptionId}`,
621
+ {
622
+ method: "GET"
623
+ }
624
+ );
625
+ return res.json();
626
+ },
627
+ async create(agentId, payload) {
628
+ const res = await doFetch(
629
+ `${base}/v1/agents/${agentId}/schedule/exceptions`,
630
+ {
631
+ method: "POST",
632
+ headers: jsonHeaders,
633
+ body: JSON.stringify(payload)
634
+ }
635
+ );
636
+ return res.json();
637
+ },
638
+ async update(agentId, exceptionId, payload) {
639
+ const res = await doFetch(
640
+ `${base}/v1/agents/${agentId}/schedule/exceptions/${exceptionId}`,
641
+ {
642
+ method: "PATCH",
643
+ headers: jsonHeaders,
644
+ body: JSON.stringify(payload)
645
+ }
646
+ );
647
+ return res.json();
648
+ },
649
+ async delete(agentId, exceptionId) {
650
+ await doFetch(
651
+ `${base}/v1/agents/${agentId}/schedule/exceptions/${exceptionId}`,
652
+ {
653
+ method: "DELETE"
654
+ }
655
+ );
656
+ }
657
+ };
658
+ }
659
+
584
660
  // src/api/agent-tags.ts
585
661
  function createAgentTagsApi(cfg) {
586
662
  const { base, doFetch } = createHttp(cfg);
@@ -607,8 +683,12 @@ function createAgentVersionsApi(cfg) {
607
683
  const { base, doFetch } = createHttp(cfg);
608
684
  const jsonHeaders = { "content-type": "application/json" };
609
685
  const fetchVersionsPage = async (agentId, opts = {}) => {
610
- const { status, ...queryOptions } = opts ?? {};
611
- const query = serializeListOptions(queryOptions, { status });
686
+ const queryOptions = {
687
+ page: opts.page,
688
+ limit: opts.limit,
689
+ filter: opts.filter
690
+ };
691
+ const query = serializeListOptions(queryOptions);
612
692
  const res = await doFetch(`${base}/v1/agents/${agentId}/versions`, {
613
693
  method: "GET",
614
694
  query
@@ -635,13 +715,33 @@ function createAgentVersionsApi(cfg) {
635
715
  const res = await doFetch(`${base}/v1/agents/${agentId}/versions`, {
636
716
  method: "POST",
637
717
  headers: jsonHeaders,
638
- body: JSON.stringify(payload)
718
+ body: JSON.stringify(payload ?? {})
639
719
  });
640
720
  return res.json();
641
721
  },
642
- async update(agentId, versionId, payload) {
722
+ async clone(agentId, versionId) {
643
723
  const res = await doFetch(
644
- `${base}/v1/agents/${agentId}/versions/${versionId}`,
724
+ `${base}/v1/agents/${agentId}/versions/${versionId}/clone`,
725
+ {
726
+ method: "POST"
727
+ }
728
+ );
729
+ return res.json();
730
+ },
731
+ async publish(agentId, versionId, payload) {
732
+ const res = await doFetch(
733
+ `${base}/v1/agents/${agentId}/versions/${versionId}/publish`,
734
+ {
735
+ method: "POST",
736
+ headers: jsonHeaders,
737
+ body: JSON.stringify(payload ?? {})
738
+ }
739
+ );
740
+ return res.json();
741
+ },
742
+ async updateNotes(agentId, versionId, payload) {
743
+ const res = await doFetch(
744
+ `${base}/v1/agents/${agentId}/versions/${versionId}/notes`,
645
745
  {
646
746
  method: "PATCH",
647
747
  headers: jsonHeaders,
@@ -650,11 +750,6 @@ function createAgentVersionsApi(cfg) {
650
750
  );
651
751
  return res.json();
652
752
  },
653
- async delete(agentId, versionId) {
654
- await doFetch(`${base}/v1/agents/${agentId}/versions/${versionId}`, {
655
- method: "DELETE"
656
- });
657
- },
658
753
  async listInstructions(agentId, versionId, opts = {}) {
659
754
  const query = serializeListOptions(opts);
660
755
  const res = await doFetch(
@@ -730,13 +825,34 @@ var bindAgentPhones = (api, agentId) => ({
730
825
  return api.disconnect(agentId, phoneId);
731
826
  }
732
827
  });
733
- var bindAgentSchedule = (api, agentId) => ({
828
+ var bindAgentScheduleExceptions = (api, agentId) => ({
829
+ list(opts) {
830
+ return api.list(agentId, opts);
831
+ },
832
+ get(exceptionId) {
833
+ return api.get(agentId, exceptionId);
834
+ },
835
+ create(payload) {
836
+ return api.create(agentId, payload);
837
+ },
838
+ update(exceptionId, payload) {
839
+ return api.update(agentId, exceptionId, payload);
840
+ },
841
+ delete(exceptionId) {
842
+ return api.delete(agentId, exceptionId);
843
+ }
844
+ });
845
+ var bindAgentSchedule = (scheduleApi, exceptionsApi, agentId) => ({
734
846
  get() {
735
- return api.get(agentId);
847
+ return scheduleApi.get(agentId);
848
+ },
849
+ create(payload) {
850
+ return scheduleApi.create(agentId, payload);
736
851
  },
737
852
  update(payload) {
738
- return api.update(agentId, payload);
739
- }
853
+ return scheduleApi.update(agentId, payload);
854
+ },
855
+ exceptions: bindAgentScheduleExceptions(exceptionsApi, agentId)
740
856
  });
741
857
  var bindAgentVersions = (api, agentId) => ({
742
858
  list(opts) {
@@ -748,11 +864,14 @@ var bindAgentVersions = (api, agentId) => ({
748
864
  create(payload) {
749
865
  return api.create(agentId, payload);
750
866
  },
751
- update(versionId, payload) {
752
- return api.update(agentId, versionId, payload);
867
+ clone(versionId) {
868
+ return api.clone(agentId, versionId);
753
869
  },
754
- delete(versionId) {
755
- return api.delete(agentId, versionId);
870
+ publish(versionId, payload) {
871
+ return api.publish(agentId, versionId, payload);
872
+ },
873
+ updateNotes(versionId, payload) {
874
+ return api.updateNotes(agentId, versionId, payload);
756
875
  },
757
876
  instructions(versionId) {
758
877
  return {
@@ -800,6 +919,7 @@ var createAgentEntity = (dto, options) => {
800
919
  tagsApi,
801
920
  phonesApi,
802
921
  scheduleApi,
922
+ scheduleExceptionsApi,
803
923
  versionsApi,
804
924
  blueprintsApi,
805
925
  reload,
@@ -811,7 +931,11 @@ var createAgentEntity = (dto, options) => {
811
931
  instructions: bindAgentInstructions(instructionsApi, dto.agentId),
812
932
  tagAssignments: bindAgentTags(tagsApi, dto.agentId),
813
933
  phones: bindAgentPhones(phonesApi, dto.agentId),
814
- schedule: bindAgentSchedule(scheduleApi, dto.agentId),
934
+ schedule: bindAgentSchedule(
935
+ scheduleApi,
936
+ scheduleExceptionsApi,
937
+ dto.agentId
938
+ ),
815
939
  versions: bindAgentVersions(versionsApi, dto.agentId),
816
940
  blueprints: bindAgentBlueprints(blueprintsApi, dto.agentId),
817
941
  async save(patch) {
@@ -895,6 +1019,7 @@ function createAgentsApi(cfg, relatedApis) {
895
1019
  tagsApi: relatedApis.tagsApi,
896
1020
  phonesApi: relatedApis.phonesApi,
897
1021
  scheduleApi: relatedApis.scheduleApi,
1022
+ scheduleExceptionsApi: relatedApis.scheduleExceptionsApi,
898
1023
  versionsApi: relatedApis.versionsApi,
899
1024
  blueprintsApi: relatedApis.blueprintsApi,
900
1025
  reload: async (agentId) => {
@@ -1185,6 +1310,7 @@ function createClient(initialCfg) {
1185
1310
  const tagsApi = createAgentTagsApi(runtimeCfg);
1186
1311
  const phonesApi = createAgentPhonesApi(runtimeCfg);
1187
1312
  const scheduleApi = createAgentScheduleApi(runtimeCfg);
1313
+ const scheduleExceptionsApi = createAgentScheduleExceptionsApi(runtimeCfg);
1188
1314
  const versionsApi = createAgentVersionsApi(runtimeCfg);
1189
1315
  const blueprintsApi = createAgentBlueprintsApi(runtimeCfg);
1190
1316
  const voicesApi = createVoicesApi(runtimeCfg);
@@ -1194,6 +1320,7 @@ function createClient(initialCfg) {
1194
1320
  tagsApi,
1195
1321
  phonesApi,
1196
1322
  scheduleApi,
1323
+ scheduleExceptionsApi,
1197
1324
  versionsApi,
1198
1325
  blueprintsApi
1199
1326
  });
@@ -1209,9 +1336,16 @@ function createClient(initialCfg) {
1209
1336
  (agentId) => bindAgentPhones(phonesApi, agentId),
1210
1337
  phonesApi
1211
1338
  );
1339
+ const scheduleExceptionsNamespace = Object.assign(
1340
+ (agentId) => bindAgentScheduleExceptions(scheduleExceptionsApi, agentId),
1341
+ scheduleExceptionsApi
1342
+ );
1212
1343
  const scheduleNamespace = Object.assign(
1213
- (agentId) => bindAgentSchedule(scheduleApi, agentId),
1214
- scheduleApi
1344
+ (agentId) => bindAgentSchedule(scheduleApi, scheduleExceptionsApi, agentId),
1345
+ {
1346
+ ...scheduleApi,
1347
+ exceptions: scheduleExceptionsNamespace
1348
+ }
1215
1349
  );
1216
1350
  const versionsNamespace = Object.assign(
1217
1351
  (agentId) => bindAgentVersions(versionsApi, agentId),
@@ -1300,6 +1434,7 @@ function createClient(initialCfg) {
1300
1434
  bindAgentInstructions,
1301
1435
  bindAgentPhones,
1302
1436
  bindAgentSchedule,
1437
+ bindAgentScheduleExceptions,
1303
1438
  bindAgentTags,
1304
1439
  bindAgentVersions,
1305
1440
  createAgentBlueprintsApi,
@@ -1307,6 +1442,7 @@ function createClient(initialCfg) {
1307
1442
  createAgentInstructionsApi,
1308
1443
  createAgentPhonesApi,
1309
1444
  createAgentScheduleApi,
1445
+ createAgentScheduleExceptionsApi,
1310
1446
  createAgentTagsApi,
1311
1447
  createAgentVersionsApi,
1312
1448
  createAgentsApi,