@deinossrl/dgp-agent 1.4.41 → 1.4.43
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 +17 -0
- package/index.mjs +15 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.4.43] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Mejorados logs de debug en command polling
|
|
7
|
+
- Ahora muestra errores detallados si no puede leer comandos
|
|
8
|
+
- Log cuando no hay comandos pendientes para facilitar troubleshooting
|
|
9
|
+
|
|
10
|
+
## [1.4.42] - 2026-01-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- El agente ahora muestra su versión al iniciar
|
|
14
|
+
- Versión leída automáticamente desde package.json (no hardcoded)
|
|
15
|
+
- Versión visible en comando `dgp-agent status`
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Mejorado display de información de versión en startup y status
|
|
19
|
+
|
|
3
20
|
## [1.4.41] - 2026-01-12
|
|
4
21
|
|
|
5
22
|
### Added
|
package/index.mjs
CHANGED
|
@@ -27,9 +27,16 @@ import { execSync, spawn, spawnSync } from 'child_process';
|
|
|
27
27
|
import { hostname, homedir } from 'os';
|
|
28
28
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, createWriteStream, statSync, unlinkSync } from 'fs';
|
|
29
29
|
import { join, dirname } from 'path';
|
|
30
|
+
import { fileURLToPath } from 'url';
|
|
30
31
|
import https from 'https';
|
|
31
32
|
import { createClient } from '@supabase/supabase-js';
|
|
32
33
|
|
|
34
|
+
// Get version from package.json
|
|
35
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
36
|
+
const __dirname = dirname(__filename);
|
|
37
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8'));
|
|
38
|
+
const AGENT_VERSION = packageJson.version;
|
|
39
|
+
|
|
33
40
|
// ============================================
|
|
34
41
|
// CONFIG FILE MANAGEMENT
|
|
35
42
|
// ============================================
|
|
@@ -352,8 +359,6 @@ function getPlinkPath() {
|
|
|
352
359
|
}
|
|
353
360
|
}
|
|
354
361
|
|
|
355
|
-
// Versión del agente
|
|
356
|
-
const AGENT_VERSION = '1.4.41';
|
|
357
362
|
let AGENT_MODE = 'smart'; // Siempre inteligente
|
|
358
363
|
|
|
359
364
|
// Configuración (prioridad: env vars > archivo config > platform config > defaults)
|
|
@@ -2124,7 +2129,7 @@ async function executeGitCommitPush(command, useAI = false) {
|
|
|
2124
2129
|
function printStatus(status) {
|
|
2125
2130
|
console.log('');
|
|
2126
2131
|
console.log(`${colors.blue}═══════════════════════════════════════════════════════${colors.reset}`);
|
|
2127
|
-
console.log(`${colors.blue} DGP Agent Status${colors.reset}`);
|
|
2132
|
+
console.log(`${colors.blue} DGP Agent Status v${AGENT_VERSION}${colors.reset}`);
|
|
2128
2133
|
console.log(`${colors.blue}═══════════════════════════════════════════════════════${colors.reset}`);
|
|
2129
2134
|
console.log(` Machine: ${colors.yellow}${CONFIG.machineId}${colors.reset}`);
|
|
2130
2135
|
console.log(` Branch: ${colors.green}${status.branch}${colors.reset}`);
|
|
@@ -2177,6 +2182,7 @@ async function runAgent() {
|
|
|
2177
2182
|
}
|
|
2178
2183
|
}
|
|
2179
2184
|
|
|
2185
|
+
logInfo(`DGP Agent v${AGENT_VERSION}`);
|
|
2180
2186
|
logInfo(`Machine ID: ${CONFIG.machineId}`);
|
|
2181
2187
|
logInfo(`IA: ${CONFIG.anthropicApiKey ? '✓ Habilitada' : '✗ No configurada'}`);
|
|
2182
2188
|
logInfo(`Reporta cada ${CONFIG.interval}s | Escucha cada ${CONFIG.commandPollInterval}s`);
|
|
@@ -2218,12 +2224,16 @@ async function runAgent() {
|
|
|
2218
2224
|
});
|
|
2219
2225
|
|
|
2220
2226
|
if (!response.ok) {
|
|
2221
|
-
|
|
2227
|
+
const errorText = await response.text();
|
|
2228
|
+
logError(`[Poll] Error ${response.status}: ${errorText}`);
|
|
2222
2229
|
return;
|
|
2223
2230
|
}
|
|
2224
2231
|
|
|
2225
2232
|
const commands = await response.json();
|
|
2226
|
-
if (commands.length === 0)
|
|
2233
|
+
if (commands.length === 0) {
|
|
2234
|
+
log(`[Poll] No hay comandos pendientes`, 'gray');
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2227
2237
|
|
|
2228
2238
|
const command = commands[0];
|
|
2229
2239
|
isProcessingCommand = true;
|