@deinossrl/dgp-agent 1.2.6 → 1.2.7
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/index.mjs +15 -17
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -287,32 +287,29 @@ async function getPendingCommands() {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/**
|
|
290
|
-
* Actualiza el estado de un comando
|
|
290
|
+
* Actualiza el estado de un comando via Edge Function
|
|
291
291
|
*/
|
|
292
292
|
async function updateCommandStatus(commandId, status, result = {}, errorMessage = null) {
|
|
293
|
-
const
|
|
294
|
-
status,
|
|
295
|
-
result,
|
|
296
|
-
error_message: errorMessage,
|
|
297
|
-
...(status === 'running' ? { picked_up_at: new Date().toISOString() } : {}),
|
|
298
|
-
...(status === 'success' || status === 'failed' ? { completed_at: new Date().toISOString() } : {}),
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
const url = `${CONFIG.commandsUrl}?id=eq.${commandId}`;
|
|
293
|
+
const url = 'https://asivayhbrqennwiwttds.supabase.co/functions/v1/dgp-agent-command-update';
|
|
302
294
|
|
|
303
295
|
const response = await fetch(url, {
|
|
304
|
-
method: '
|
|
296
|
+
method: 'POST',
|
|
305
297
|
headers: {
|
|
306
298
|
'apikey': CONFIG.supabaseKey,
|
|
307
299
|
'Authorization': `Bearer ${CONFIG.supabaseKey}`,
|
|
308
300
|
'Content-Type': 'application/json',
|
|
309
|
-
'Prefer': 'return=minimal',
|
|
310
301
|
},
|
|
311
|
-
body: JSON.stringify(
|
|
302
|
+
body: JSON.stringify({
|
|
303
|
+
commandId,
|
|
304
|
+
status,
|
|
305
|
+
result,
|
|
306
|
+
error_message: errorMessage,
|
|
307
|
+
}),
|
|
312
308
|
});
|
|
313
309
|
|
|
314
310
|
if (!response.ok) {
|
|
315
|
-
|
|
311
|
+
const text = await response.text();
|
|
312
|
+
throw new Error(`Failed to update command: HTTP ${response.status} - ${text}`);
|
|
316
313
|
}
|
|
317
314
|
}
|
|
318
315
|
|
|
@@ -538,7 +535,7 @@ async function runAgent(deployMode = false) {
|
|
|
538
535
|
console.log('');
|
|
539
536
|
console.log(`${colors.green}╔═══════════════════════════════════════════════════════╗${colors.reset}`);
|
|
540
537
|
console.log(`${colors.green}║ DGP Agent - Despliegue-GPT Local Agent ║${colors.reset}`);
|
|
541
|
-
console.log(`${colors.green}║ @deinossrl/dgp-agent v1.2.
|
|
538
|
+
console.log(`${colors.green}║ @deinossrl/dgp-agent v1.2.7 ║${colors.reset}`);
|
|
542
539
|
console.log(`${colors.green}╚═══════════════════════════════════════════════════════╝${colors.reset}`);
|
|
543
540
|
console.log('');
|
|
544
541
|
|
|
@@ -654,7 +651,7 @@ async function showStatus() {
|
|
|
654
651
|
function showHelp() {
|
|
655
652
|
console.log(`
|
|
656
653
|
${colors.bold}${colors.cyan}DGP Agent - Despliegue-GPT Local Agent${colors.reset}
|
|
657
|
-
${colors.gray}@deinossrl/dgp-agent v1.2.
|
|
654
|
+
${colors.gray}@deinossrl/dgp-agent v1.2.7${colors.reset}
|
|
658
655
|
|
|
659
656
|
${colors.bold}DESCRIPCIÓN${colors.reset}
|
|
660
657
|
Agente local que reporta el estado de tu repositorio Git
|
|
@@ -702,6 +699,7 @@ ${colors.bold}REQUISITOS PARA DEPLOY${colors.reset}
|
|
|
702
699
|
- Permisos sudo para reload nginx (vía sudoers sin password)
|
|
703
700
|
|
|
704
701
|
${colors.bold}CHANGELOG${colors.reset}
|
|
702
|
+
${colors.cyan}v1.2.7${colors.reset} - Fix: update via Edge Function (401 fix)
|
|
705
703
|
${colors.cyan}v1.2.6${colors.reset} - Comando git_commit_push desde la UI
|
|
706
704
|
${colors.cyan}v1.2.5${colors.reset} - Sincronización de versiones y changelog
|
|
707
705
|
${colors.cyan}v1.2.4${colors.reset} - Mejoras en ejecución async de comandos shell
|
|
@@ -737,7 +735,7 @@ switch (command) {
|
|
|
737
735
|
case 'version':
|
|
738
736
|
case '-v':
|
|
739
737
|
case '--version':
|
|
740
|
-
console.log('@deinossrl/dgp-agent v1.2.
|
|
738
|
+
console.log('@deinossrl/dgp-agent v1.2.7');
|
|
741
739
|
break;
|
|
742
740
|
default:
|
|
743
741
|
runAgent(false); // Status-only mode
|