nexus-agents 2.46.0 → 2.47.0
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/dist/{chunk-5Y7QBD2H.js → chunk-3YYS74BL.js} +3 -3
- package/dist/{chunk-KCOGC24K.js → chunk-HCFJ7NMT.js} +2 -2
- package/dist/{chunk-GVK2Z7PV.js → chunk-ZGKZIEUM.js} +119 -3
- package/dist/chunk-ZGKZIEUM.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{setup-command-OF4QXTBF.js → setup-command-CRBMRREJ.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-GVK2Z7PV.js.map +0 -1
- /package/dist/{chunk-5Y7QBD2H.js.map → chunk-3YYS74BL.js.map} +0 -0
- /package/dist/{chunk-KCOGC24K.js.map → chunk-HCFJ7NMT.js.map} +0 -0
- /package/dist/{setup-command-OF4QXTBF.js.map → setup-command-CRBMRREJ.js.map} +0 -0
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-CLYZ7FWP.js";
|
|
25
25
|
|
|
26
26
|
// src/version.ts
|
|
27
|
-
var VERSION = true ? "2.
|
|
27
|
+
var VERSION = true ? "2.47.0" : "dev";
|
|
28
28
|
|
|
29
29
|
// src/cli/setup-data-dir.ts
|
|
30
30
|
import { mkdirSync, existsSync as existsSync2 } from "fs";
|
|
@@ -758,7 +758,7 @@ async function runDoctorFix(result) {
|
|
|
758
758
|
writeLine2("\u2500".repeat(40));
|
|
759
759
|
let fixCount = 0;
|
|
760
760
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
761
|
-
const { runSetup } = await import("./setup-command-
|
|
761
|
+
const { runSetup } = await import("./setup-command-CRBMRREJ.js");
|
|
762
762
|
const setupResult = runSetup({
|
|
763
763
|
skipMcp: true,
|
|
764
764
|
skipRules: true,
|
|
@@ -836,4 +836,4 @@ export {
|
|
|
836
836
|
startStdioServer,
|
|
837
837
|
closeServer
|
|
838
838
|
};
|
|
839
|
-
//# sourceMappingURL=chunk-
|
|
839
|
+
//# sourceMappingURL=chunk-3YYS74BL.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
VERSION,
|
|
6
6
|
initDataDirectories
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3YYS74BL.js";
|
|
8
8
|
import {
|
|
9
9
|
CLI_SUBPROCESS_TIMEOUTS,
|
|
10
10
|
createLogger,
|
|
@@ -1580,4 +1580,4 @@ export {
|
|
|
1580
1580
|
setupCommand,
|
|
1581
1581
|
setupCommandAsync
|
|
1582
1582
|
};
|
|
1583
|
-
//# sourceMappingURL=chunk-
|
|
1583
|
+
//# sourceMappingURL=chunk-HCFJ7NMT.js.map
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_TASK_TTL_MS,
|
|
68
68
|
clampTaskTtl
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-3YYS74BL.js";
|
|
70
70
|
import {
|
|
71
71
|
createSessionMemory
|
|
72
72
|
} from "./chunk-ULDKSIS7.js";
|
|
@@ -31387,6 +31387,109 @@ function planAgentTeam(analysis, taskDescription, options) {
|
|
|
31387
31387
|
};
|
|
31388
31388
|
}
|
|
31389
31389
|
|
|
31390
|
+
// src/orchestration/aorchestra/topological-wave.ts
|
|
31391
|
+
var CycleError = class extends Error {
|
|
31392
|
+
constructor(message, cycleRoles) {
|
|
31393
|
+
super(message);
|
|
31394
|
+
this.cycleRoles = cycleRoles;
|
|
31395
|
+
}
|
|
31396
|
+
name = "CycleError";
|
|
31397
|
+
};
|
|
31398
|
+
var MissingDependencyError = class extends Error {
|
|
31399
|
+
constructor(message, sourceRole, missingRole) {
|
|
31400
|
+
super(message);
|
|
31401
|
+
this.sourceRole = sourceRole;
|
|
31402
|
+
this.missingRole = missingRole;
|
|
31403
|
+
}
|
|
31404
|
+
name = "MissingDependencyError";
|
|
31405
|
+
};
|
|
31406
|
+
function topologicalWaveAssign(entries) {
|
|
31407
|
+
if (entries.length === 0) return ok([]);
|
|
31408
|
+
const byRole = buildRoleIndex(entries);
|
|
31409
|
+
const missing = findMissingDependency(entries, byRole);
|
|
31410
|
+
if (missing !== null) return err(missing);
|
|
31411
|
+
const cycle = detectCycle(entries, byRole);
|
|
31412
|
+
if (cycle !== null) return err(cycle);
|
|
31413
|
+
const waveByRole = computeWaves(entries, byRole);
|
|
31414
|
+
return ok(entries.map((e) => ({ ...e, wave: waveByRole.get(e.role) ?? e.wave })));
|
|
31415
|
+
}
|
|
31416
|
+
function buildRoleIndex(entries) {
|
|
31417
|
+
const byRole = /* @__PURE__ */ new Map();
|
|
31418
|
+
for (const e of entries) byRole.set(e.role, e);
|
|
31419
|
+
return byRole;
|
|
31420
|
+
}
|
|
31421
|
+
function findMissingDependency(entries, byRole) {
|
|
31422
|
+
for (const e of entries) {
|
|
31423
|
+
if (e.dependsOn === void 0) continue;
|
|
31424
|
+
for (const dep of e.dependsOn) {
|
|
31425
|
+
if (!byRole.has(dep)) {
|
|
31426
|
+
return new MissingDependencyError(
|
|
31427
|
+
`Entry for role "${e.role}" depends on unknown role "${dep}"`,
|
|
31428
|
+
e.role,
|
|
31429
|
+
dep
|
|
31430
|
+
);
|
|
31431
|
+
}
|
|
31432
|
+
}
|
|
31433
|
+
}
|
|
31434
|
+
return null;
|
|
31435
|
+
}
|
|
31436
|
+
function detectCycle(entries, byRole) {
|
|
31437
|
+
const WHITE = 0;
|
|
31438
|
+
const GRAY = 1;
|
|
31439
|
+
const BLACK = 2;
|
|
31440
|
+
const color = /* @__PURE__ */ new Map();
|
|
31441
|
+
for (const e of entries) color.set(e.role, WHITE);
|
|
31442
|
+
function visit(role, stack) {
|
|
31443
|
+
const c = color.get(role);
|
|
31444
|
+
if (c === BLACK) return null;
|
|
31445
|
+
if (c === GRAY) {
|
|
31446
|
+
const cycleStart = stack.indexOf(role);
|
|
31447
|
+
return cycleStart >= 0 ? stack.slice(cycleStart).concat(role) : [role];
|
|
31448
|
+
}
|
|
31449
|
+
color.set(role, GRAY);
|
|
31450
|
+
stack.push(role);
|
|
31451
|
+
const entry = byRole.get(role);
|
|
31452
|
+
if (entry?.dependsOn !== void 0) {
|
|
31453
|
+
for (const dep of entry.dependsOn) {
|
|
31454
|
+
const found = visit(dep, stack);
|
|
31455
|
+
if (found !== null) return found;
|
|
31456
|
+
}
|
|
31457
|
+
}
|
|
31458
|
+
stack.pop();
|
|
31459
|
+
color.set(role, BLACK);
|
|
31460
|
+
return null;
|
|
31461
|
+
}
|
|
31462
|
+
for (const e of entries) {
|
|
31463
|
+
const found = visit(e.role, []);
|
|
31464
|
+
if (found !== null) {
|
|
31465
|
+
return new CycleError(`Dependency cycle detected: ${found.join(" \u2192 ")}`, found);
|
|
31466
|
+
}
|
|
31467
|
+
}
|
|
31468
|
+
return null;
|
|
31469
|
+
}
|
|
31470
|
+
function computeWaves(entries, byRole) {
|
|
31471
|
+
const computed = /* @__PURE__ */ new Map();
|
|
31472
|
+
function waveOf(role) {
|
|
31473
|
+
const cached = computed.get(role);
|
|
31474
|
+
if (cached !== void 0) return cached;
|
|
31475
|
+
const entry = byRole.get(role);
|
|
31476
|
+
if (entry === void 0) return 1;
|
|
31477
|
+
if (entry.dependsOn === void 0 || entry.dependsOn.length === 0) {
|
|
31478
|
+
computed.set(role, entry.wave);
|
|
31479
|
+
return entry.wave;
|
|
31480
|
+
}
|
|
31481
|
+
let maxDepWave = 0;
|
|
31482
|
+
for (const dep of entry.dependsOn) {
|
|
31483
|
+
maxDepWave = Math.max(maxDepWave, waveOf(dep));
|
|
31484
|
+
}
|
|
31485
|
+
const newWave = maxDepWave + 1;
|
|
31486
|
+
computed.set(role, newWave);
|
|
31487
|
+
return newWave;
|
|
31488
|
+
}
|
|
31489
|
+
for (const e of entries) waveOf(e.role);
|
|
31490
|
+
return computed;
|
|
31491
|
+
}
|
|
31492
|
+
|
|
31390
31493
|
// src/orchestration/aorchestra/watchdog.ts
|
|
31391
31494
|
var logger22 = createLogger({ component: "worker-watchdog" });
|
|
31392
31495
|
var WATCHDOG_THRESHOLDS = {
|
|
@@ -31629,6 +31732,18 @@ var CONSECUTIVE_FAILURE_THRESHOLD = 3;
|
|
|
31629
31732
|
var RECOVERY_COOLDOWN_MS = 3e4;
|
|
31630
31733
|
var MAX_COOLDOWN_MS = 3e5;
|
|
31631
31734
|
var RATE_LIMIT_SPACING_MS = 2e3;
|
|
31735
|
+
function applyDependencyWaves(entries) {
|
|
31736
|
+
const hasDeps = entries.some((e) => e.dependsOn !== void 0 && e.dependsOn.length > 0);
|
|
31737
|
+
if (!hasDeps) return entries;
|
|
31738
|
+
const result = topologicalWaveAssign(entries);
|
|
31739
|
+
if (!result.ok) {
|
|
31740
|
+
logger24.warn("Topological wave assignment failed, falling back to priority-only", {
|
|
31741
|
+
error: result.error.message
|
|
31742
|
+
});
|
|
31743
|
+
return entries;
|
|
31744
|
+
}
|
|
31745
|
+
return result.value;
|
|
31746
|
+
}
|
|
31632
31747
|
function groupByWave(entries) {
|
|
31633
31748
|
if (entries.length === 0) return [];
|
|
31634
31749
|
const waveMap = /* @__PURE__ */ new Map();
|
|
@@ -31765,7 +31880,8 @@ async function executeWithConcurrencyLimit(tasks, limit) {
|
|
|
31765
31880
|
async function dispatchWorkers(entries, options) {
|
|
31766
31881
|
if (entries.length === 0) return [];
|
|
31767
31882
|
const maxConcurrency = options.maxConcurrency ?? MAX_WORKERS_PER_WAVE;
|
|
31768
|
-
const
|
|
31883
|
+
const effectiveEntries = applyDependencyWaves(entries);
|
|
31884
|
+
const waves = groupByWave(effectiveEntries);
|
|
31769
31885
|
const allResults = [];
|
|
31770
31886
|
const failureTracker = new RoleFailureTracker(
|
|
31771
31887
|
options.consecutiveFailureThreshold ?? CONSECUTIVE_FAILURE_THRESHOLD
|
|
@@ -54144,4 +54260,4 @@ export {
|
|
|
54144
54260
|
detectBackend,
|
|
54145
54261
|
createTaskTracker
|
|
54146
54262
|
};
|
|
54147
|
-
//# sourceMappingURL=chunk-
|
|
54263
|
+
//# sourceMappingURL=chunk-ZGKZIEUM.js.map
|