@deinossrl/dgp-agent 1.4.26 → 1.4.27

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.
Files changed (2) hide show
  1. package/index.mjs +18 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -254,7 +254,7 @@ function hasLocalSshKey() {
254
254
  }
255
255
 
256
256
  // Versión del agente
257
- const AGENT_VERSION = '1.4.26';
257
+ const AGENT_VERSION = '1.4.27';
258
258
  let AGENT_MODE = 'smart'; // Siempre inteligente
259
259
 
260
260
  // Configuración (prioridad: env vars > archivo config > platform config > defaults)
@@ -1401,9 +1401,16 @@ async function executeTestConnection(command) {
1401
1401
  await addCommandLog('info', 'Usando autenticación por password');
1402
1402
  const isWindows = process.platform === 'win32';
1403
1403
  if (isWindows) {
1404
- // En Windows usar plink (PuTTY)
1405
- await addCommandLog('info', 'Usando plink (Windows)');
1406
- sshCmd = `echo y | plink -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami"`;
1404
+ // En Windows verificar si plink está disponible
1405
+ try {
1406
+ shellSync('where plink');
1407
+ await addCommandLog('info', 'Usando plink (PuTTY)');
1408
+ sshCmd = `echo y | plink -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami"`;
1409
+ } catch (e) {
1410
+ await addCommandLog('error', 'plink no encontrado. Instalá PuTTY desde https://www.putty.org/');
1411
+ await addCommandLog('info', 'Alternativa: usá SSH Key en lugar de password en Windows');
1412
+ throw new Error('Password auth en Windows requiere PuTTY/plink. Instalalo o usá SSH Key.');
1413
+ }
1407
1414
  } else {
1408
1415
  // En Linux/Mac usar sshpass
1409
1416
  await addCommandLog('info', 'Usando sshpass (Linux/Mac)');
@@ -1420,7 +1427,13 @@ async function executeTestConnection(command) {
1420
1427
  await addCommandLog('info', 'Usando password como alternativa (no hay SSH key guardada)');
1421
1428
  const isWindows = process.platform === 'win32';
1422
1429
  if (isWindows) {
1423
- sshCmd = `echo y | plink -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami"`;
1430
+ try {
1431
+ shellSync('where plink');
1432
+ sshCmd = `echo y | plink -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami"`;
1433
+ } catch (e) {
1434
+ await addCommandLog('error', 'plink no encontrado. Instalá PuTTY desde https://www.putty.org/');
1435
+ throw new Error('Password auth en Windows requiere PuTTY/plink. Instalalo o usá SSH Key.');
1436
+ }
1424
1437
  } else {
1425
1438
  sshCmd = `sshpass -p "${sshPassword}" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${user}@${server_host} "echo 'SSH_OK' && hostname && whoami"`;
1426
1439
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deinossrl/dgp-agent",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "Agente local para Despliegue-GPT - Reporta el estado del repositorio Git a la plataforma TenMinute IA",
5
5
  "main": "index.mjs",
6
6
  "bin": {