plazbot-cli 0.1.4 → 0.2.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.
@@ -76,9 +76,7 @@ export const toolsCommand = new Command('tools')
76
76
  if (action === 'toggle') {
77
77
  const toggleSpinner = createSpinner('Actualizando...');
78
78
  toggleSpinner.start();
79
- const updatedConfig = { ...agentData, useToolCalling: !agentData.useToolCalling };
80
- delete updatedConfig.id;
81
- delete updatedConfig._id;
79
+ const { id: _i1, _id: _o1, ...updatedConfig } = { ...agentData, useToolCalling: !agentData.useToolCalling };
82
80
  await agent.updateAgent(agentId, updatedConfig);
83
81
  toggleSpinner.succeed(`Tool Calling ${!agentData.useToolCalling ? 'activado' : 'desactivado'}`);
84
82
  return;
@@ -108,9 +106,7 @@ export const toolsCommand = new Command('tools')
108
106
  };
109
107
 
110
108
  const updatedServices = [...services, newService];
111
- const updatedConfig = { ...agentData, services: updatedServices, useToolCalling: true };
112
- delete updatedConfig.id;
113
- delete updatedConfig._id;
109
+ const { id: _i2, _id: _o2, ...updatedConfig } = { ...agentData, services: updatedServices, useToolCalling: true };
114
110
  const updateSpinner = createSpinner('Guardando servicio...');
115
111
  updateSpinner.start();
116
112
  await agent.updateAgent(agentId, updatedConfig);
@@ -150,9 +146,7 @@ export const toolsCommand = new Command('tools')
150
146
  };
151
147
 
152
148
  const updatedActions = [...actions, newAction];
153
- const updatedConfig = { ...agentData, actions: updatedActions, useToolCalling: true };
154
- delete updatedConfig.id;
155
- delete updatedConfig._id;
149
+ const { id: _i3, _id: _o3, ...updatedConfig } = { ...agentData, actions: updatedActions, useToolCalling: true };
156
150
  const updateSpinner = createSpinner('Guardando accion...');
157
151
  updateSpinner.start();
158
152
  await agent.updateAgent(agentId, updatedConfig);
@@ -38,11 +38,11 @@ export const addAgentCommand = new Command('add-agent-portal')
38
38
  logger.info('\n📎 Detalles de la operación:');
39
39
  logger.divider();
40
40
  logger.info('Portal:');
41
- logger.info(` ID: ${portalDetails.portal.id}`);
42
- logger.info(` Nombre: ${portalDetails.portal.name}`);
41
+ logger.info(` ID: ${portalDetails.portal?.id || options.portalId}`);
42
+ logger.info(` Nombre: ${portalDetails.portal?.name || 'N/A'}`);
43
43
  logger.info('\nAgente:');
44
- logger.info(` ID: ${agentDetails.agent.id}`);
45
- logger.info(` Nombre: ${agentDetails.agent.name}`);
44
+ logger.info(` ID: ${agentDetails.id}`);
45
+ logger.info(` Nombre: ${agentDetails.name}`);
46
46
  logger.divider();
47
47
 
48
48
  logger.info('\n🔄 Agregando agente al portal...');
@@ -47,16 +47,17 @@ export const listCommand = new Command('list')
47
47
  }
48
48
  }
49
49
 
50
- if (portalDetails.links && portalDetails.links.length > 0) {
50
+ const portalAny = portalDetails as any;
51
+ if (portalAny.links && portalAny.links.length > 0) {
51
52
  logger.info('\n🔗 Enlaces:');
52
- portalDetails.links.forEach((link: { value: string; url: string }) => {
53
+ portalAny.links.forEach((link: { value: string; url: string }) => {
53
54
  logger.info(`- ${link.value}: ${link.url}`);
54
55
  });
55
56
  }
56
57
 
57
- if (portalDetails.agents && portalDetails.agents.length > 0) {
58
+ if (portalAny.agents && portalAny.agents.length > 0) {
58
59
  logger.info('\n🤖 Agentes asociados:');
59
- portalDetails.agents.forEach((agent: { name: string; id: string }) => {
60
+ portalAny.agents.forEach((agent: { name: string; id: string }) => {
60
61
  logger.info(`- ${agent.name} (${agent.id})`);
61
62
  });
62
63
  }