@deinossrl/dgp-agent 1.5.11 → 1.5.12
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 +15 -0
- package/index.mjs +68 -66
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.5.12] - 2026-01-13
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Progreso en consola local**: Ahora `pg_dump` y `pg_restore` muestran el progreso detallado también en la terminal local del agente, además de enviarlo a la web.
|
|
7
|
+
- Feedback visual inmediato en la terminal para operaciones de backup y restore.
|
|
8
|
+
|
|
9
|
+
## [1.5.11] - 2026-01-12
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- CHANGELOG actualizado con historial completo de versiones 1.5.7 a 1.5.10
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
- Tooltips mejorados en la UI de backup/restore con información detallada
|
|
16
|
+
- Mejor documentación para entender qué hace cada opción
|
|
17
|
+
|
|
3
18
|
## [1.5.10] - 2026-01-12
|
|
4
19
|
|
|
5
20
|
### Changed
|
package/index.mjs
CHANGED
|
@@ -261,7 +261,7 @@ function saveSshKeyLocally(sshPrivateKey) {
|
|
|
261
261
|
if (process.platform === 'win32') {
|
|
262
262
|
try {
|
|
263
263
|
shellSync(`icacls "${keyPath}" /inheritance:r /grant:r "%USERNAME%:RW"`);
|
|
264
|
-
} catch {}
|
|
264
|
+
} catch { }
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -513,7 +513,7 @@ function getRepoContext() {
|
|
|
513
513
|
context.project.scripts = Object.keys(pkg.scripts || {});
|
|
514
514
|
context.project.dependencies = Object.keys(pkg.dependencies || {});
|
|
515
515
|
context.project.devDependencies = Object.keys(pkg.devDependencies || {});
|
|
516
|
-
} catch (e) {}
|
|
516
|
+
} catch (e) { }
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
if (context.files.includes('requirements.txt') || context.files.includes('setup.py')) {
|
|
@@ -1531,11 +1531,66 @@ async function findOrInstallPgDump() {
|
|
|
1531
1531
|
const extractCmd = `powershell -command "Expand-Archive -Path '${zipPath}' -DestinationPath '${BIN_DIR}' -Force"`;
|
|
1532
1532
|
execSync(extractCmd);
|
|
1533
1533
|
|
|
1534
|
-
|
|
1534
|
+
// Los binarios estarán en BIN_DIR/pgsql/bin/
|
|
1535
|
+
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
1536
|
+
|
|
1537
|
+
if (existsSync(extractedPgDump)) {
|
|
1538
|
+
// Copiar pg_dump.exe, pg_restore.exe y TODAS las DLLs al BIN_DIR raíz
|
|
1539
|
+
const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
|
|
1540
|
+
|
|
1541
|
+
// Copiar pg_dump.exe, pg_restore.exe y psql.exe
|
|
1542
|
+
execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
|
|
1543
|
+
|
|
1544
|
+
const extractedPgRestore = join(BIN_DIR, 'pgsql', 'bin', 'pg_restore.exe');
|
|
1545
|
+
const localPgRestore = join(BIN_DIR, 'pg_restore.exe');
|
|
1546
|
+
if (existsSync(extractedPgRestore)) {
|
|
1547
|
+
execSync(`copy "${extractedPgRestore}" "${localPgRestore}"`, { shell: 'cmd.exe' });
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
const extractedPsql = join(BIN_DIR, 'pgsql', 'bin', 'psql.exe');
|
|
1551
|
+
const localPsql = join(BIN_DIR, 'psql.exe');
|
|
1552
|
+
if (existsSync(extractedPsql)) {
|
|
1553
|
+
execSync(`copy "${extractedPsql}" "${localPsql}"`, { shell: 'cmd.exe' });
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// Copiar TODAS las DLLs (no solo algunas específicas)
|
|
1557
|
+
execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
|
|
1558
|
+
|
|
1559
|
+
// Limpiar archivos temporales
|
|
1560
|
+
unlinkSync(zipPath);
|
|
1561
|
+
// Eliminar carpeta pgsql para ahorrar espacio
|
|
1562
|
+
try {
|
|
1563
|
+
execSync(`rmdir /s /q "${join(BIN_DIR, 'pgsql')}"`, { shell: 'cmd.exe' });
|
|
1564
|
+
} catch (e) {
|
|
1565
|
+
// Ignorar si falla el borrado
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
logSuccess('pg_dump instalado correctamente con todas las dependencias');
|
|
1569
|
+
resolve(localPgDump);
|
|
1570
|
+
} else {
|
|
1571
|
+
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
1572
|
+
}
|
|
1573
|
+
} catch (extractError) {
|
|
1574
|
+
reject(new Error(`Error al extraer: ${extractError.message}`));
|
|
1575
|
+
}
|
|
1576
|
+
}, 3000); // Esperar 3 segundos para que Windows libere el archivo
|
|
1577
|
+
});
|
|
1578
|
+
}).on('error', reject);
|
|
1579
|
+
} else {
|
|
1580
|
+
response.pipe(file);
|
|
1581
|
+
file.on('finish', () => {
|
|
1582
|
+
file.close();
|
|
1583
|
+
logInfo('Descarga completada. Extrayendo...');
|
|
1584
|
+
|
|
1585
|
+
// Dar tiempo a Windows para liberar el handle del archivo
|
|
1586
|
+
setTimeout(() => {
|
|
1587
|
+
try {
|
|
1588
|
+
const extractCmd = `powershell -command "Expand-Archive -Path '${zipPath}' -DestinationPath '${BIN_DIR}' -Force"`;
|
|
1589
|
+
execSync(extractCmd);
|
|
1590
|
+
|
|
1535
1591
|
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
1536
1592
|
|
|
1537
1593
|
if (existsSync(extractedPgDump)) {
|
|
1538
|
-
// Copiar pg_dump.exe, pg_restore.exe y TODAS las DLLs al BIN_DIR raíz
|
|
1539
1594
|
const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
|
|
1540
1595
|
|
|
1541
1596
|
// Copiar pg_dump.exe, pg_restore.exe y psql.exe
|
|
@@ -1553,16 +1608,16 @@ async function findOrInstallPgDump() {
|
|
|
1553
1608
|
execSync(`copy "${extractedPsql}" "${localPsql}"`, { shell: 'cmd.exe' });
|
|
1554
1609
|
}
|
|
1555
1610
|
|
|
1556
|
-
// Copiar TODAS las DLLs
|
|
1611
|
+
// Copiar TODAS las DLLs
|
|
1557
1612
|
execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
|
|
1558
1613
|
|
|
1559
|
-
// Limpiar archivos temporales
|
|
1560
1614
|
unlinkSync(zipPath);
|
|
1561
|
-
|
|
1615
|
+
|
|
1616
|
+
// Eliminar carpeta pgsql
|
|
1562
1617
|
try {
|
|
1563
1618
|
execSync(`rmdir /s /q "${join(BIN_DIR, 'pgsql')}"`, { shell: 'cmd.exe' });
|
|
1564
1619
|
} catch (e) {
|
|
1565
|
-
// Ignorar
|
|
1620
|
+
// Ignorar
|
|
1566
1621
|
}
|
|
1567
1622
|
|
|
1568
1623
|
logSuccess('pg_dump instalado correctamente con todas las dependencias');
|
|
@@ -1570,61 +1625,6 @@ async function findOrInstallPgDump() {
|
|
|
1570
1625
|
} else {
|
|
1571
1626
|
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
1572
1627
|
}
|
|
1573
|
-
} catch (extractError) {
|
|
1574
|
-
reject(new Error(`Error al extraer: ${extractError.message}`));
|
|
1575
|
-
}
|
|
1576
|
-
}, 3000); // Esperar 3 segundos para que Windows libere el archivo
|
|
1577
|
-
});
|
|
1578
|
-
}).on('error', reject);
|
|
1579
|
-
} else {
|
|
1580
|
-
response.pipe(file);
|
|
1581
|
-
file.on('finish', () => {
|
|
1582
|
-
file.close();
|
|
1583
|
-
logInfo('Descarga completada. Extrayendo...');
|
|
1584
|
-
|
|
1585
|
-
// Dar tiempo a Windows para liberar el handle del archivo
|
|
1586
|
-
setTimeout(() => {
|
|
1587
|
-
try {
|
|
1588
|
-
const extractCmd = `powershell -command "Expand-Archive -Path '${zipPath}' -DestinationPath '${BIN_DIR}' -Force"`;
|
|
1589
|
-
execSync(extractCmd);
|
|
1590
|
-
|
|
1591
|
-
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
1592
|
-
|
|
1593
|
-
if (existsSync(extractedPgDump)) {
|
|
1594
|
-
const binSrcDir = join(BIN_DIR, 'pgsql', 'bin');
|
|
1595
|
-
|
|
1596
|
-
// Copiar pg_dump.exe, pg_restore.exe y psql.exe
|
|
1597
|
-
execSync(`copy "${extractedPgDump}" "${localPgDump}"`, { shell: 'cmd.exe' });
|
|
1598
|
-
|
|
1599
|
-
const extractedPgRestore = join(BIN_DIR, 'pgsql', 'bin', 'pg_restore.exe');
|
|
1600
|
-
const localPgRestore = join(BIN_DIR, 'pg_restore.exe');
|
|
1601
|
-
if (existsSync(extractedPgRestore)) {
|
|
1602
|
-
execSync(`copy "${extractedPgRestore}" "${localPgRestore}"`, { shell: 'cmd.exe' });
|
|
1603
|
-
}
|
|
1604
|
-
|
|
1605
|
-
const extractedPsql = join(BIN_DIR, 'pgsql', 'bin', 'psql.exe');
|
|
1606
|
-
const localPsql = join(BIN_DIR, 'psql.exe');
|
|
1607
|
-
if (existsSync(extractedPsql)) {
|
|
1608
|
-
execSync(`copy "${extractedPsql}" "${localPsql}"`, { shell: 'cmd.exe' });
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
// Copiar TODAS las DLLs
|
|
1612
|
-
execSync(`copy "${binSrcDir}\\*.dll" "${BIN_DIR}\\"`, { shell: 'cmd.exe' });
|
|
1613
|
-
|
|
1614
|
-
unlinkSync(zipPath);
|
|
1615
|
-
|
|
1616
|
-
// Eliminar carpeta pgsql
|
|
1617
|
-
try {
|
|
1618
|
-
execSync(`rmdir /s /q "${join(BIN_DIR, 'pgsql')}"`, { shell: 'cmd.exe' });
|
|
1619
|
-
} catch (e) {
|
|
1620
|
-
// Ignorar
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
logSuccess('pg_dump instalado correctamente con todas las dependencias');
|
|
1624
|
-
resolve(localPgDump);
|
|
1625
|
-
} else {
|
|
1626
|
-
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
1627
|
-
}
|
|
1628
1628
|
} catch (extractError) {
|
|
1629
1629
|
reject(new Error(`Error al extraer: ${extractError.message}`));
|
|
1630
1630
|
}
|
|
@@ -1850,7 +1850,8 @@ async function executePgDump(command) {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
|
|
1852
1852
|
progressMsg += relevantLine.substring(0, 80);
|
|
1853
|
-
|
|
1853
|
+
logInfo(progressMsg); // Muestra en consola local
|
|
1854
|
+
addCommandLog('info', progressMsg).catch(() => { });
|
|
1854
1855
|
lastLogTime = now;
|
|
1855
1856
|
}
|
|
1856
1857
|
}
|
|
@@ -1874,7 +1875,7 @@ async function executePgDump(command) {
|
|
|
1874
1875
|
} else {
|
|
1875
1876
|
// Log final con total de objetos procesados
|
|
1876
1877
|
if (objectCount > 0) {
|
|
1877
|
-
addCommandLog('success', `Backup completado: ${objectCount} objetos exportados`).catch(() => {});
|
|
1878
|
+
addCommandLog('success', `Backup completado: ${objectCount} objetos exportados`).catch(() => { });
|
|
1878
1879
|
}
|
|
1879
1880
|
resolve();
|
|
1880
1881
|
}
|
|
@@ -2348,7 +2349,8 @@ async function executePgRestore(command) {
|
|
|
2348
2349
|
progressMsg += ` - ${relevantLine}`;
|
|
2349
2350
|
}
|
|
2350
2351
|
|
|
2351
|
-
|
|
2352
|
+
logInfo(progressMsg); // Muestra en consola local
|
|
2353
|
+
addCommandLog('info', progressMsg).catch(() => { });
|
|
2352
2354
|
lastLogTime = now;
|
|
2353
2355
|
}
|
|
2354
2356
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deinossrl/dgp-agent",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
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": {
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@supabase/supabase-js": "^2.39.0"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|