@mndrk/agx 1.4.25 → 1.4.26
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.js +21 -4
- package/lib/cli/runCli.js +22 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6378,18 +6378,21 @@ async function checkOnboarding() {
|
|
|
6378
6378
|
process.exit(0);
|
|
6379
6379
|
}
|
|
6380
6380
|
|
|
6381
|
-
// agx retry <taskId> [--task <id>] [--swarm]
|
|
6381
|
+
// agx retry <taskId> [--task <id>] [--swarm] [--async]
|
|
6382
6382
|
if (cmd === 'retry' || (cmd === 'task' && args[1] === 'retry')) {
|
|
6383
6383
|
const runArgs = cmd === 'task' ? args.slice(1) : args;
|
|
6384
6384
|
retryFlowActive = true;
|
|
6385
6385
|
logExecutionFlow('retry command', 'input', `cmd=${cmd}, args=${runArgs.slice(1).join(' ')}`);
|
|
6386
6386
|
let taskId = null;
|
|
6387
6387
|
let forceSwarm = false;
|
|
6388
|
+
let asyncMode = false;
|
|
6388
6389
|
for (let i = 1; i < runArgs.length; i++) {
|
|
6389
6390
|
if (runArgs[i] === '--task' || runArgs[i] === '-t') {
|
|
6390
6391
|
taskId = runArgs[++i];
|
|
6391
6392
|
} else if (runArgs[i] === '--swarm') {
|
|
6392
6393
|
forceSwarm = true;
|
|
6394
|
+
} else if (runArgs[i] === '--async' || runArgs[i] === '-a') {
|
|
6395
|
+
asyncMode = true;
|
|
6393
6396
|
}
|
|
6394
6397
|
}
|
|
6395
6398
|
if (!taskId) {
|
|
@@ -6397,12 +6400,26 @@ async function checkOnboarding() {
|
|
|
6397
6400
|
}
|
|
6398
6401
|
if (!taskId) {
|
|
6399
6402
|
logExecutionFlow('retry command', 'output', 'missing task id');
|
|
6400
|
-
console.log(`${c.yellow}Usage:${c.reset} agx retry <taskId> [--task <id>] [--swarm]`);
|
|
6401
|
-
console.log(`${c.dim} or:${c.reset} agx task retry <taskId> [--task <id>] [--swarm]`);
|
|
6403
|
+
console.log(`${c.yellow}Usage:${c.reset} agx retry <taskId> [--task <id>] [--swarm] [--async]`);
|
|
6404
|
+
console.log(`${c.dim} or:${c.reset} agx task retry <taskId> [--task <id>] [--swarm] [--async]`);
|
|
6405
|
+
console.log(`${c.dim}--async: Reset status and let daemon handle (non-blocking)${c.reset}`);
|
|
6402
6406
|
process.exit(1);
|
|
6403
6407
|
}
|
|
6404
6408
|
|
|
6405
6409
|
try {
|
|
6410
|
+
// Async mode: just reset task status, daemon will pick it up
|
|
6411
|
+
if (asyncMode) {
|
|
6412
|
+
const resolvedId = await resolveTaskId(taskId);
|
|
6413
|
+
await cloudRequest('PATCH', `/api/tasks/${resolvedId}`, {
|
|
6414
|
+
status: 'queued',
|
|
6415
|
+
started_at: null,
|
|
6416
|
+
completed_at: null,
|
|
6417
|
+
});
|
|
6418
|
+
console.log(`${c.green}✓${c.reset} Task ${resolvedId.slice(0, 8)} queued for retry`);
|
|
6419
|
+
console.log(`${c.dim}Daemon will pick it up shortly${c.reset}`);
|
|
6420
|
+
process.exit(0);
|
|
6421
|
+
}
|
|
6422
|
+
|
|
6406
6423
|
const exitCode = await runTaskInline(taskId, { resetFirst: true, forceSwarm });
|
|
6407
6424
|
process.exit(exitCode);
|
|
6408
6425
|
} catch (err) {
|
|
@@ -7421,7 +7438,7 @@ PROVIDERS:
|
|
|
7421
7438
|
CLOUD:
|
|
7422
7439
|
agx new "<task>" Create task in cloud
|
|
7423
7440
|
agx run <id|slug|#> Claim and run a task
|
|
7424
|
-
agx retry <id|slug|#> Reset + retry a task
|
|
7441
|
+
agx retry <id|slug|#> Reset + retry a task (--async for non-blocking)
|
|
7425
7442
|
agx status Show cloud status
|
|
7426
7443
|
agx complete <taskId> Mark task stage complete
|
|
7427
7444
|
agx project assign <project> --task <task> Assign task to project
|
package/lib/cli/runCli.js
CHANGED
|
@@ -1485,18 +1485,21 @@ async function checkOnboarding() {
|
|
|
1485
1485
|
process.exit(0);
|
|
1486
1486
|
}
|
|
1487
1487
|
|
|
1488
|
-
// agx retry <taskId> [--task <id>] [--swarm]
|
|
1488
|
+
// agx retry <taskId> [--task <id>] [--swarm] [--async]
|
|
1489
1489
|
if (cmd === 'retry' || (cmd === 'task' && args[1] === 'retry')) {
|
|
1490
1490
|
const runArgs = cmd === 'task' ? args.slice(1) : args;
|
|
1491
1491
|
retryFlowActive = true;
|
|
1492
1492
|
logExecutionFlow('retry command', 'input', `cmd=${cmd}, args=${runArgs.slice(1).join(' ')}`);
|
|
1493
1493
|
let taskId = null;
|
|
1494
1494
|
let forceSwarm = false;
|
|
1495
|
+
let asyncMode = false;
|
|
1495
1496
|
for (let i = 1; i < runArgs.length; i++) {
|
|
1496
1497
|
if (runArgs[i] === '--task' || runArgs[i] === '-t') {
|
|
1497
1498
|
taskId = runArgs[++i];
|
|
1498
1499
|
} else if (runArgs[i] === '--swarm') {
|
|
1499
1500
|
forceSwarm = true;
|
|
1501
|
+
} else if (runArgs[i] === '--async' || runArgs[i] === '-a') {
|
|
1502
|
+
asyncMode = true;
|
|
1500
1503
|
}
|
|
1501
1504
|
}
|
|
1502
1505
|
if (!taskId) {
|
|
@@ -1504,12 +1507,27 @@ async function checkOnboarding() {
|
|
|
1504
1507
|
}
|
|
1505
1508
|
if (!taskId) {
|
|
1506
1509
|
logExecutionFlow('retry command', 'output', 'missing task id');
|
|
1507
|
-
console.log(`${c.yellow}Usage:${c.reset} agx retry <taskId> [--task <id>] [--swarm]`);
|
|
1508
|
-
console.log(`${c.dim} or:${c.reset} agx task retry <taskId> [--task <id>] [--swarm]`);
|
|
1510
|
+
console.log(`${c.yellow}Usage:${c.reset} agx retry <taskId> [--task <id>] [--swarm] [--async]`);
|
|
1511
|
+
console.log(`${c.dim} or:${c.reset} agx task retry <taskId> [--task <id>] [--swarm] [--async]`);
|
|
1512
|
+
console.log(`${c.dim}--async: Reset status and let daemon handle (non-blocking)${c.reset}`);
|
|
1509
1513
|
process.exit(1);
|
|
1510
1514
|
}
|
|
1511
1515
|
|
|
1512
1516
|
try {
|
|
1517
|
+
// Async mode: just reset task status, daemon will pick it up
|
|
1518
|
+
logExecutionFlow('retry command', 'processing', `asyncMode=${asyncMode}, taskId=${taskId}`);
|
|
1519
|
+
if (asyncMode) {
|
|
1520
|
+
const resolvedId = await resolveTaskId(taskId);
|
|
1521
|
+
await cloudRequest('PATCH', `/api/tasks/${resolvedId}`, {
|
|
1522
|
+
status: 'queued',
|
|
1523
|
+
started_at: null,
|
|
1524
|
+
completed_at: null,
|
|
1525
|
+
});
|
|
1526
|
+
console.log(`${c.green}✓${c.reset} Task ${resolvedId.slice(0, 8)} queued for retry`);
|
|
1527
|
+
console.log(`${c.dim}Daemon will pick it up shortly${c.reset}`);
|
|
1528
|
+
process.exit(0);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1513
1531
|
const exitCode = await runTaskInline(taskId, { resetFirst: true, forceSwarm });
|
|
1514
1532
|
process.exit(exitCode);
|
|
1515
1533
|
} catch (err) {
|
|
@@ -2500,7 +2518,7 @@ PROVIDERS:
|
|
|
2500
2518
|
CLOUD:
|
|
2501
2519
|
agx new "<task>" Create task in cloud
|
|
2502
2520
|
agx run <id|slug|#> Claim and run a task
|
|
2503
|
-
agx retry <id|slug|#> Reset + retry a task
|
|
2521
|
+
agx retry <id|slug|#> Reset + retry a task (--async for non-blocking)
|
|
2504
2522
|
agx status Show cloud status
|
|
2505
2523
|
agx complete <taskId> Mark task stage complete
|
|
2506
2524
|
agx project assign <project> --task <task> Assign task to project
|