@deinossrl/dgp-agent 1.4.54 → 1.4.56

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 (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/index.mjs +27 -3
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog - DGP Agent
2
2
 
3
+ ## [1.4.56] - 2026-01-12
4
+
5
+ ### Fixed
6
+ - Ahora verifica que AMBOS ejecutables (`pg_dump.exe` y `pg_restore.exe`) existan
7
+ - Si falta alguno de los dos, reinstala PostgreSQL automáticamente
8
+ - Garantiza que ambas herramientas estén siempre disponibles
9
+
10
+ ## [1.4.55] - 2026-01-12
11
+
12
+ ### Fixed
13
+ - Ahora se copia `pg_restore.exe` junto con `pg_dump.exe` al instalar PostgreSQL
14
+ - Resuelve error ENOENT al ejecutar comando de restore
15
+
3
16
  ## [1.4.54] - 2026-01-12
4
17
 
5
18
  ### Added
package/index.mjs CHANGED
@@ -1429,13 +1429,23 @@ async function executeDeploy(command) {
1429
1429
  async function findOrInstallPgDump() {
1430
1430
  const isWindows = process.platform === 'win32';
1431
1431
  const executableName = isWindows ? 'pg_dump.exe' : 'pg_dump';
1432
+ const restoreExecutableName = isWindows ? 'pg_restore.exe' : 'pg_restore';
1432
1433
 
1433
- // 1. Verificar si ya está en nuestro BIN_DIR
1434
+ // 1. Verificar si ya están AMBOS en nuestro BIN_DIR
1434
1435
  const localPgDump = join(BIN_DIR, executableName);
1435
- if (existsSync(localPgDump)) {
1436
+ const localPgRestore = join(BIN_DIR, restoreExecutableName);
1437
+
1438
+ if (existsSync(localPgDump) && existsSync(localPgRestore)) {
1436
1439
  return localPgDump;
1437
1440
  }
1438
1441
 
1442
+ // Si falta alguno, avisar y continuar con la instalación
1443
+ if (existsSync(localPgDump) && !existsSync(localPgRestore)) {
1444
+ logInfo('pg_dump existe pero falta pg_restore, reinstalando...');
1445
+ } else if (!existsSync(localPgDump) && existsSync(localPgRestore)) {
1446
+ logInfo('pg_restore existe pero falta pg_dump, reinstalando...');
1447
+ }
1448
+
1439
1449
  // 2. Buscar en PATH
1440
1450
  try {
1441
1451
  const checkCmd = isWindows ? 'where pg_dump' : 'which pg_dump';
@@ -1519,12 +1529,19 @@ async function findOrInstallPgDump() {
1519
1529
  const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
1520
1530
 
1521
1531
  if (existsSync(extractedPgDump)) {
1522
- // Copiar pg_dump.exe y TODAS las DLLs al BIN_DIR raíz
1532
+ // Copiar pg_dump.exe, pg_restore.exe y TODAS las DLLs al BIN_DIR raíz
1523
1533
  const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
1524
1534
 
1525
1535
  // Copiar pg_dump.exe
1526
1536
  execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
1527
1537
 
1538
+ // Copiar pg_restore.exe
1539
+ const extractedPgRestore = join(BIN_DIR, 'pgsql', 'bin', 'pg_restore.exe');
1540
+ const localPgRestore = join(BIN_DIR, 'pg_restore.exe');
1541
+ if (existsSync(extractedPgRestore)) {
1542
+ execSync(`copy "${extractedPgRestore}" "${localPgRestore}"`, { shell: 'cmd.exe' });
1543
+ }
1544
+
1528
1545
  // Copiar TODAS las DLLs (no solo algunas específicas)
1529
1546
  execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
1530
1547
 
@@ -1568,6 +1585,13 @@ async function findOrInstallPgDump() {
1568
1585
  // Copiar pg_dump.exe
1569
1586
  execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
1570
1587
 
1588
+ // Copiar pg_restore.exe
1589
+ const extractedPgRestore = join(BIN_DIR, 'pgsql', 'bin', 'pg_restore.exe');
1590
+ const localPgRestore = join(BIN_DIR, 'pg_restore.exe');
1591
+ if (existsSync(extractedPgRestore)) {
1592
+ execSync(`copy "${extractedPgRestore}" "${localPgRestore}"`, { shell: 'cmd.exe' });
1593
+ }
1594
+
1571
1595
  // Copiar TODAS las DLLs
1572
1596
  execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
1573
1597
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deinossrl/dgp-agent",
3
- "version": "1.4.54",
3
+ "version": "1.4.56",
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": {