plazbot-cli 0.2.10 → 0.2.11

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.
@@ -30,7 +30,8 @@ exports.aiConfigCommand = new commander_1.Command('ai-config')
30
30
  });
31
31
  const spinner = (0, ui_1.createSpinner)('Cargando agente...');
32
32
  spinner.start();
33
- const agentData = await agent.getAgentById({ id: agentId });
33
+ const _res = await agent.getAgentById({ id: agentId });
34
+ const agentData = _res.agent || _res.data || _res;
34
35
  spinner.stop();
35
36
  console.log((0, ui_1.section)('Configuracion de IA - ' + (agentData.name || agentId)));
36
37
  const currentProviders = agentData.aiProviders || [];
@@ -41,7 +41,8 @@ exports.chatCommand = new commander_1.Command('chat')
41
41
  let agentInfo = null;
42
42
  try {
43
43
  process.stdout.write(chalk_1.default.gray(' Conectando con agente...'));
44
- agentInfo = await agent.getAgentById({ id: options.agentId });
44
+ const _res = await agent.getAgentById({ id: options.agentId });
45
+ agentInfo = _res.agent || _res.data || _res;
45
46
  process.stdout.write('\r' + ' '.repeat(40) + '\r');
46
47
  }
47
48
  catch {
@@ -24,12 +24,13 @@ exports.deleteCommand = new commander_1.Command('delete')
24
24
  ...(options.dev && { customUrl: "http://localhost:5090" })
25
25
  });
26
26
  // Obtener detalles del agente para mostrar información
27
- const agentDetails = await agent.getAgentById({ id: agentId });
27
+ const response = await agent.getAgentById({ id: agentId });
28
+ const agentDetails = response.agent || response.data || response;
28
29
  logger_1.logger.warning('\nVas a eliminar el siguiente agente:');
29
30
  logger_1.logger.divider();
30
- logger_1.logger.info(`ID: ${agentDetails.id}`);
31
- logger_1.logger.info(`Nombre: ${agentDetails.name}`);
32
- logger_1.logger.info(`Descripción: ${agentDetails.description}`);
31
+ logger_1.logger.info(`ID: ${agentDetails.id || agentId}`);
32
+ logger_1.logger.info(`Nombre: ${agentDetails.name || '—'}`);
33
+ logger_1.logger.info(`Descripcion: ${agentDetails.description || '—'}`);
33
34
  logger_1.logger.divider();
34
35
  // Crear interfaz para confirmación
35
36
  const rl = readline_1.default.createInterface({
@@ -21,7 +21,8 @@ exports.enableCommand = new commander_1.Command('enable-widget')
21
21
  ...(options.dev && { customUrl: "http://localhost:5090" })
22
22
  });
23
23
  // Obtener estado actual del agente
24
- const agentDetails = await agent.getAgentById({ id: agentId });
24
+ const _res = await agent.getAgentById({ id: agentId });
25
+ const agentDetails = _res.agent || _res.data || _res;
25
26
  logger_1.logger.title('Estado actual del widget');
26
27
  logger_1.logger.label('Agente', agentDetails.name);
27
28
  // Cambiar estado
@@ -24,7 +24,8 @@ filesGroup.command('list')
24
24
  });
25
25
  const spinner = (0, ui_1.createSpinner)('Cargando archivos...');
26
26
  spinner.start();
27
- const agentData = await agent.getAgentById({ id: agentId });
27
+ const _res = await agent.getAgentById({ id: agentId });
28
+ const agentData = _res.agent || _res.data || _res;
28
29
  spinner.stop();
29
30
  const files = agentData.files || [];
30
31
  console.log((0, ui_1.section)('Archivos - ' + (agentData.name || agentId)));
@@ -145,7 +145,8 @@ exports.monitorCommand = new commander_1.Command('monitor')
145
145
  zone: effectiveZone,
146
146
  ...(options.dev && { customUrl: 'http://localhost:5090' }),
147
147
  });
148
- const info = await agent.getAgentById({ id: options.agentId });
148
+ const _res = await agent.getAgentById({ id: options.agentId });
149
+ const info = _res.agent || _res.data || _res;
149
150
  if (info?.name)
150
151
  agentName = info.name;
151
152
  process.stdout.write('\r' + ' '.repeat(40) + '\r');
@@ -56,7 +56,8 @@ setGroup.command('instructions')
56
56
  // Cargar instrucciones actuales
57
57
  const loadSpinner = (0, ui_1.createSpinner)('Cargando...');
58
58
  loadSpinner.start();
59
- const agentData = await agent.getAgentById({ id: agentId });
59
+ const _res1 = await agent.getAgentById({ id: agentId });
60
+ const agentData = _res1.agent || _res1.data || _res1;
60
61
  loadSpinner.stop();
61
62
  const current = agentData.instructions || {};
62
63
  console.log((0, ui_1.section)('Instrucciones - ' + (agentData.name || agentId)));
@@ -104,7 +105,8 @@ setGroup.command('persona')
104
105
  });
105
106
  const loadSpinner = (0, ui_1.createSpinner)('Cargando...');
106
107
  loadSpinner.start();
107
- const agentData = await agent.getAgentById({ id: agentId });
108
+ const _res2 = await agent.getAgentById({ id: agentId });
109
+ const agentData = _res2.agent || _res2.data || _res2;
108
110
  loadSpinner.stop();
109
111
  const current = agentData.person || {};
110
112
  console.log((0, ui_1.section)('Persona - ' + (agentData.name || agentId)));
@@ -25,7 +25,8 @@ exports.toolsCommand = new commander_1.Command('tools')
25
25
  });
26
26
  const spinner = (0, ui_1.createSpinner)('Cargando agente...');
27
27
  spinner.start();
28
- const agentData = await agent.getAgentById({ id: agentId });
28
+ const _res = await agent.getAgentById({ id: agentId });
29
+ const agentData = _res.agent || _res.data || _res;
29
30
  spinner.stop();
30
31
  console.log((0, ui_1.section)('Tool Calling - ' + (agentData.name || agentId)));
31
32
  console.log((0, ui_1.kvPair)('Estado', agentData.useToolCalling ? ui_1.theme.success('Activado') : ui_1.theme.error('Desactivado')));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plazbot-cli",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "CLI para Plazbot SDK",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -28,7 +28,8 @@ export const aiConfigCommand = new Command('ai-config')
28
28
 
29
29
  const spinner = createSpinner('Cargando agente...');
30
30
  spinner.start();
31
- const agentData = await agent.getAgentById({ id: agentId });
31
+ const _res: any = await agent.getAgentById({ id: agentId });
32
+ const agentData = _res.agent || _res.data || _res;
32
33
  spinner.stop();
33
34
 
34
35
  console.log(section('Configuracion de IA - ' + (agentData.name || agentId)));
@@ -45,7 +45,8 @@ export const chatCommand = new Command('chat')
45
45
  let agentInfo: any = null;
46
46
  try {
47
47
  process.stdout.write(chalk.gray(' Conectando con agente...'));
48
- agentInfo = await agent.getAgentById({ id: options.agentId });
48
+ const _res: any = await agent.getAgentById({ id: options.agentId });
49
+ agentInfo = _res.agent || _res.data || _res;
49
50
  process.stdout.write('\r' + ' '.repeat(40) + '\r');
50
51
  } catch {
51
52
  process.stdout.write('\r' + ' '.repeat(40) + '\r');
@@ -22,13 +22,14 @@ export const deleteCommand = new Command('delete')
22
22
  });
23
23
 
24
24
  // Obtener detalles del agente para mostrar información
25
- const agentDetails = await agent.getAgentById({ id: agentId });
26
-
25
+ const response: any = await agent.getAgentById({ id: agentId });
26
+ const agentDetails = response.agent || response.data || response;
27
+
27
28
  logger.warning('\nVas a eliminar el siguiente agente:');
28
29
  logger.divider();
29
- logger.info(`ID: ${agentDetails.id}`);
30
- logger.info(`Nombre: ${agentDetails.name}`);
31
- logger.info(`Descripción: ${agentDetails.description}`);
30
+ logger.info(`ID: ${agentDetails.id || agentId}`);
31
+ logger.info(`Nombre: ${agentDetails.name || '—'}`);
32
+ logger.info(`Descripcion: ${agentDetails.description || '—'}`);
32
33
  logger.divider();
33
34
 
34
35
  // Crear interfaz para confirmación
@@ -22,8 +22,9 @@ export const enableCommand = new Command('enable-widget')
22
22
  });
23
23
 
24
24
  // Obtener estado actual del agente
25
- const agentDetails = await agent.getAgentById({ id: agentId });
26
-
25
+ const _res: any = await agent.getAgentById({ id: agentId });
26
+ const agentDetails = _res.agent || _res.data || _res;
27
+
27
28
  logger.title('Estado actual del widget');
28
29
  logger.label('Agente', agentDetails.name);
29
30
 
@@ -25,7 +25,8 @@ filesGroup.command('list')
25
25
 
26
26
  const spinner = createSpinner('Cargando archivos...');
27
27
  spinner.start();
28
- const agentData = await agent.getAgentById({ id: agentId });
28
+ const _res: any = await agent.getAgentById({ id: agentId });
29
+ const agentData = _res.agent || _res.data || _res;
29
30
  spinner.stop();
30
31
 
31
32
  const files = (agentData as any).files || [];
@@ -193,7 +193,8 @@ export const monitorCommand = new Command('monitor')
193
193
  zone: effectiveZone,
194
194
  ...(options.dev && { customUrl: 'http://localhost:5090' }),
195
195
  });
196
- const info: any = await agent.getAgentById({ id: options.agentId });
196
+ const _res: any = await agent.getAgentById({ id: options.agentId });
197
+ const info = _res.agent || _res.data || _res;
197
198
  if (info?.name) agentName = info.name;
198
199
  process.stdout.write('\r' + ' '.repeat(40) + '\r');
199
200
  } catch {
@@ -56,7 +56,8 @@ setGroup.command('instructions')
56
56
  // Cargar instrucciones actuales
57
57
  const loadSpinner = createSpinner('Cargando...');
58
58
  loadSpinner.start();
59
- const agentData = await agent.getAgentById({ id: agentId });
59
+ const _res1: any = await agent.getAgentById({ id: agentId });
60
+ const agentData = _res1.agent || _res1.data || _res1;
60
61
  loadSpinner.stop();
61
62
 
62
63
  const current = agentData.instructions || {};
@@ -110,7 +111,8 @@ setGroup.command('persona')
110
111
 
111
112
  const loadSpinner = createSpinner('Cargando...');
112
113
  loadSpinner.start();
113
- const agentData = await agent.getAgentById({ id: agentId });
114
+ const _res2: any = await agent.getAgentById({ id: agentId });
115
+ const agentData = _res2.agent || _res2.data || _res2;
114
116
  loadSpinner.stop();
115
117
 
116
118
  const current = agentData.person || {};
@@ -22,7 +22,8 @@ export const toolsCommand = new Command('tools')
22
22
 
23
23
  const spinner = createSpinner('Cargando agente...');
24
24
  spinner.start();
25
- const agentData = await agent.getAgentById({ id: agentId });
25
+ const _res: any = await agent.getAgentById({ id: agentId });
26
+ const agentData = _res.agent || _res.data || _res;
26
27
  spinner.stop();
27
28
 
28
29
  console.log(section('Tool Calling - ' + (agentData.name || agentId)));