@getsupervisor/agents-studio-sdk 1.31.0 → 1.33.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,56 @@
1
+ ## v1.32.0
2
+
3
+ ## [1.32.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.31.0...v1.32.0) (2025-11-14)
4
+
5
+ ### Features
6
+
7
+ * add AgentVersionsApi and related functionality ([c797b12](https://github.com/julio-supervisor/agents-studio-be/commit/c797b12e41d717cb7e0b29cc387a0fd4ff929d2e))
8
+ * add API reference documentation for agent templates and update navigation structure ([103c67d](https://github.com/julio-supervisor/agents-studio-be/commit/103c67dee465cea19819a10967ea62a4aa9f9493))
9
+ * add endpoint to create agent from template with request schema and response examples ([0f4b9a3](https://github.com/julio-supervisor/agents-studio-be/commit/0f4b9a327f388edb2bf6eb1d724aa4585f530359))
10
+ * create migration for agent_instructions table with foreign key constraints ([f5cadbd](https://github.com/julio-supervisor/agents-studio-be/commit/f5cadbdad5601a8ffd761781284a408650f7f097))
11
+ * implement reorder blueprint stages functionality with command and handler ([8d2f6c9](https://github.com/julio-supervisor/agents-studio-be/commit/8d2f6c901e03851d3960abde340ca96191ecdf89))
12
+
13
+ ### Bug Fixes
14
+
15
+ * correct description formatting for UpdateAgentBlueprintRequest in API documentation ([8e0ebce](https://github.com/julio-supervisor/agents-studio-be/commit/8e0ebced952516965e3cfc8778bbdb20297810ab))
16
+ * remove unused CatalogItemsCreateTool and CatalogItemsDeleteTool imports from mcp.module.ts ([d787d4e](https://github.com/julio-supervisor/agents-studio-be/commit/d787d4e707fdbab229f988de375183d3707bde12))
17
+
18
+ ## v1.31.0
19
+
20
+ ## [1.31.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.30.0...v1.31.0) (2025-11-10)
21
+
22
+ ### Features
23
+
24
+ * add migration for Prospecting Agent Template with initial agent configuration and stages ([0560563](https://github.com/julio-supervisor/agents-studio-be/commit/05605631e051c7cd4705e34bc3c76c90f8373702))
25
+
26
+ ### Bug Fixes
27
+
28
+ * update endpoint path for forking agents from template to use correct URL format ([9d00f93](https://github.com/julio-supervisor/agents-studio-be/commit/9d00f9350b33847a6fd582417654336769c645c3))
29
+
30
+ ## v1.30.0
31
+
32
+ ## [1.30.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.29.0...v1.30.0) (2025-11-10)
33
+
34
+ ### Features
35
+
36
+ * implement catalog templates API and tools, including listing and filtering functionality ([9467fb2](https://github.com/julio-supervisor/agents-studio-be/commit/9467fb21c19a35f45e8ec8dcb2bfc26254558371))
37
+ * use forwardRef for AgentBlueprintsModule import in blueprint-stages.module.ts ([63420a1](https://github.com/julio-supervisor/agents-studio-be/commit/63420a1710305fee8e22f0826665b0eedb866107))
38
+ *
39
+ ## v1.29.0
40
+
41
+ ## [1.29.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.28.0...v1.29.0) (2025-11-10)
42
+
43
+ ### Features
44
+
45
+ * add comprehensive tests for catalog templates, including handlers, controller, and DTOs; implement in-memory repository specifications ([1a2d81e](https://github.com/julio-supervisor/agents-studio-be/commit/1a2d81e1b25d4495c240d8af021894e30c6a814c))
46
+ * add ForkAgentFromTemplateRequest schema and endpoint ([394c9d7](https://github.com/julio-supervisor/agents-studio-be/commit/394c9d7ed327f0a7cccedf0e8b18218357976c15))
47
+ * add unit tests for CatalogTemplateTypeormSpecificationFactory, covering various filtering and ordering scenarios ([827825b](https://github.com/julio-supervisor/agents-studio-be/commit/827825b55cf97ab21de8698025ad611abe377771))
48
+
49
+ ### Bug Fixes
50
+
51
+ * update workspaceId parameter to be required in createAgent and forkAgentFromTemplate methods; improve error messages for UUID validation ([b272a8f](https://github.com/julio-supervisor/agents-studio-be/commit/b272a8fbc1b56a9d511bb2ecc904d8aed59c07b6))
52
+
53
+
1
54
  ## v1.27.0
2
55
 
3
56
  ## [1.27.0](https://github.com/julio-supervisor/agents-studio-be/compare/v1.26.1...v1.27.0) (2025-11-08)
package/README.md CHANGED
@@ -22,15 +22,29 @@ const client = createClient({
22
22
  const { data: agents } = await client.agents.list({ limit: 10 });
23
23
  const agent = await client.agents.get('agent-123');
24
24
 
25
+ const { data: versions } = await client.agents
26
+ .versions(agent.agentId)
27
+ .list({ limit: 1 });
28
+ const versionId = versions[0]?.id;
29
+ if (!versionId) {
30
+ throw new Error('Agent has no versions yet');
31
+ }
32
+
25
33
  // helpers de agente sin repetir IDs
26
- const instructions = client.agents.instructions(agent.agentId);
27
- await instructions.create({ order: 1, content: 'Responde en español neutro' });
34
+ const instructions = client.agents
35
+ .versions(agent.agentId)
36
+ .instructions(versionId);
37
+ await instructions.create({
38
+ order: 1,
39
+ content: 'Responde en español neutro',
40
+ status: 'inactive',
41
+ });
28
42
 
29
43
  // administrar versiones e instrucciones
30
44
  await client.agents
31
45
  .versions(agent.agentId)
32
46
  .instructions('version-1')
33
- .create({ order: 1, content: 'Saluda con empatía' });
47
+ .create({ order: 1, content: 'Saluda con empatía', status: 'active' });
34
48
 
35
49
  // administrar blueprints por versión
36
50
  const blueprints = client.agents.blueprints(agent.agentId);
package/dist/index.cjs CHANGED
@@ -23,7 +23,6 @@ __export(index_exports, {
23
23
  NetworkError: () => NetworkError,
24
24
  TimeoutError: () => TimeoutError,
25
25
  bindAgentBlueprints: () => bindAgentBlueprints,
26
- bindAgentInstructions: () => bindAgentInstructions,
27
26
  bindAgentPhones: () => bindAgentPhones,
28
27
  bindAgentSchedule: () => bindAgentSchedule,
29
28
  bindAgentScheduleExceptions: () => bindAgentScheduleExceptions,
@@ -33,7 +32,6 @@ __export(index_exports, {
33
32
  bindAgentVersions: () => bindAgentVersions,
34
33
  createAgentBlueprintsApi: () => createAgentBlueprintsApi,
35
34
  createAgentEntity: () => createAgentEntity,
36
- createAgentInstructionsApi: () => createAgentInstructionsApi,
37
35
  createAgentPhonesApi: () => createAgentPhonesApi,
38
36
  createAgentScheduleApi: () => createAgentScheduleApi,
39
37
  createAgentScheduleExceptionsApi: () => createAgentScheduleExceptionsApi,
@@ -403,6 +401,27 @@ function createAgentBlueprintsApi(cfg) {
403
401
  };
404
402
  }
405
403
 
404
+ // src/api/agent-phones.ts
405
+ function createAgentPhonesApi(cfg) {
406
+ const { base, doFetch } = createHttp(cfg);
407
+ const jsonHeaders = { "content-type": "application/json" };
408
+ return {
409
+ async connect(agentId, payload) {
410
+ const res = await doFetch(`${base}/agents/${agentId}/phones`, {
411
+ method: "POST",
412
+ headers: jsonHeaders,
413
+ body: JSON.stringify(payload)
414
+ });
415
+ return res.json();
416
+ },
417
+ async disconnect(agentId, phoneId) {
418
+ await doFetch(`${base}/agents/${agentId}/phones/${phoneId}`, {
419
+ method: "DELETE"
420
+ });
421
+ }
422
+ };
423
+ }
424
+
406
425
  // src/utils/pagination.ts
407
426
  var toNumber = (value) => {
408
427
  return typeof value === "number" ? value : void 0;
@@ -495,76 +514,6 @@ function attachPaginator(response, fetchPage, options) {
495
514
  });
496
515
  }
497
516
 
498
- // src/api/agent-instructions.ts
499
- function createAgentInstructionsApi(cfg) {
500
- const { base, doFetch } = createHttp(cfg);
501
- const jsonHeaders = { "content-type": "application/json" };
502
- const fetchInstructionPage = async (agentId, opts = {}) => {
503
- const { versionId, ...queryOptions } = opts ?? {};
504
- const query = serializeListOptions(queryOptions, { versionId });
505
- const res = await doFetch(`${base}/agents/${agentId}/instructions`, {
506
- method: "GET",
507
- query
508
- });
509
- return res.json();
510
- };
511
- return {
512
- async list(agentId, opts = {}) {
513
- const normalizedOptions = {
514
- ...opts ?? {}
515
- };
516
- const fetchPage = (options) => fetchInstructionPage(agentId, options);
517
- const response = await fetchPage(normalizedOptions);
518
- return attachPaginator(response, fetchPage, normalizedOptions);
519
- },
520
- async create(agentId, payload) {
521
- const res = await doFetch(`${base}/agents/${agentId}/instructions`, {
522
- method: "POST",
523
- headers: jsonHeaders,
524
- body: JSON.stringify(payload)
525
- });
526
- return res.json();
527
- },
528
- async update(agentId, instructionId, payload) {
529
- const res = await doFetch(
530
- `${base}/agents/${agentId}/instructions/${instructionId}`,
531
- {
532
- method: "PATCH",
533
- headers: jsonHeaders,
534
- body: JSON.stringify(payload)
535
- }
536
- );
537
- return res.json();
538
- },
539
- async delete(agentId, instructionId) {
540
- await doFetch(`${base}/agents/${agentId}/instructions/${instructionId}`, {
541
- method: "DELETE"
542
- });
543
- }
544
- };
545
- }
546
-
547
- // src/api/agent-phones.ts
548
- function createAgentPhonesApi(cfg) {
549
- const { base, doFetch } = createHttp(cfg);
550
- const jsonHeaders = { "content-type": "application/json" };
551
- return {
552
- async connect(agentId, payload) {
553
- const res = await doFetch(`${base}/agents/${agentId}/phones`, {
554
- method: "POST",
555
- headers: jsonHeaders,
556
- body: JSON.stringify(payload)
557
- });
558
- return res.json();
559
- },
560
- async disconnect(agentId, phoneId) {
561
- await doFetch(`${base}/agents/${agentId}/phones/${phoneId}`, {
562
- method: "DELETE"
563
- });
564
- }
565
- };
566
- }
567
-
568
517
  // src/api/agent-schedule-exceptions.ts
569
518
  function createAgentScheduleExceptionsApi(cfg) {
570
519
  const { base, doFetch } = createHttp(cfg);
@@ -954,20 +903,6 @@ function createAgentVersionsApi(cfg) {
954
903
  }
955
904
 
956
905
  // src/entities/agent.ts
957
- var bindAgentInstructions = (api, agentId) => ({
958
- list(opts) {
959
- return api.list(agentId, opts);
960
- },
961
- create(payload) {
962
- return api.create(agentId, payload);
963
- },
964
- update(instructionId, payload) {
965
- return api.update(agentId, instructionId, payload);
966
- },
967
- delete(instructionId) {
968
- return api.delete(agentId, instructionId);
969
- }
970
- });
971
906
  var bindAgentStageTriggers = (api, agentId, blueprintId, stageId) => ({
972
907
  list(opts) {
973
908
  return api.list(agentId, blueprintId, stageId, opts);
@@ -1139,7 +1074,6 @@ var bindAgentBlueprints = (api, agentId) => ({
1139
1074
  });
1140
1075
  var createAgentEntity = (dto, options) => {
1141
1076
  const {
1142
- instructionsApi,
1143
1077
  tagsApi,
1144
1078
  phonesApi,
1145
1079
  scheduleApi,
@@ -1154,7 +1088,6 @@ var createAgentEntity = (dto, options) => {
1154
1088
  } = options;
1155
1089
  const entity = {
1156
1090
  ...dto,
1157
- instructions: bindAgentInstructions(instructionsApi, dto.agentId),
1158
1091
  tagAssignments: bindAgentTags(tagsApi, dto.agentId),
1159
1092
  phones: bindAgentPhones(phonesApi, dto.agentId),
1160
1093
  schedule: bindAgentSchedule(
@@ -1251,7 +1184,6 @@ function createAgentsApi(cfg, relatedApis) {
1251
1184
  return baseApi;
1252
1185
  }
1253
1186
  const wrapAgent = (detail) => createAgentEntity(detail, {
1254
- instructionsApi: relatedApis.instructionsApi,
1255
1187
  tagsApi: relatedApis.tagsApi,
1256
1188
  phonesApi: relatedApis.phonesApi,
1257
1189
  scheduleApi: relatedApis.scheduleApi,
@@ -1915,7 +1847,6 @@ function createClient(initialCfg) {
1915
1847
  const setAccessTokenGetter = (getter) => {
1916
1848
  runtimeCfg.getAccessToken = getter;
1917
1849
  };
1918
- const instructionsApi = createAgentInstructionsApi(runtimeCfg);
1919
1850
  const tagsApi = createAgentTagsApi(runtimeCfg);
1920
1851
  const phonesApi = createAgentPhonesApi(runtimeCfg);
1921
1852
  const scheduleApi = createAgentScheduleApi(runtimeCfg);
@@ -1930,7 +1861,6 @@ function createClient(initialCfg) {
1930
1861
  const catalogTemplatesApi = createCatalogTemplatesApi(runtimeCfg);
1931
1862
  const webhooksApi = createWebhooksApi(runtimeCfg);
1932
1863
  const agentsApi = createAgentsApi(runtimeCfg, {
1933
- instructionsApi,
1934
1864
  tagsApi,
1935
1865
  phonesApi,
1936
1866
  scheduleApi,
@@ -1940,10 +1870,6 @@ function createClient(initialCfg) {
1940
1870
  stagesApi,
1941
1871
  stageTriggersApi
1942
1872
  });
1943
- const instructionsNamespace = Object.assign(
1944
- (agentId) => bindAgentInstructions(instructionsApi, agentId),
1945
- instructionsApi
1946
- );
1947
1873
  const tagsNamespace = Object.assign(
1948
1874
  (agentId) => bindAgentTags(tagsApi, agentId),
1949
1875
  tagsApi
@@ -1985,7 +1911,6 @@ function createClient(initialCfg) {
1985
1911
  const apis = {
1986
1912
  agents: {
1987
1913
  ...agentsApi,
1988
- instructions: instructionsNamespace,
1989
1914
  tags: tagsNamespace,
1990
1915
  phones: phonesNamespace,
1991
1916
  schedule: scheduleNamespace,
@@ -2064,7 +1989,6 @@ function createClient(initialCfg) {
2064
1989
  NetworkError,
2065
1990
  TimeoutError,
2066
1991
  bindAgentBlueprints,
2067
- bindAgentInstructions,
2068
1992
  bindAgentPhones,
2069
1993
  bindAgentSchedule,
2070
1994
  bindAgentScheduleExceptions,
@@ -2074,7 +1998,6 @@ function createClient(initialCfg) {
2074
1998
  bindAgentVersions,
2075
1999
  createAgentBlueprintsApi,
2076
2000
  createAgentEntity,
2077
- createAgentInstructionsApi,
2078
2001
  createAgentPhonesApi,
2079
2002
  createAgentScheduleApi,
2080
2003
  createAgentScheduleExceptionsApi,