nexus-agents 8.28.9 → 8.30.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-J42YVGO6.js → chunk-3CB3LVMG.js} +62 -48
- package/dist/chunk-3CB3LVMG.js.map +1 -0
- package/dist/{chunk-F2OVYZWF.js → chunk-4YUD3EJO.js} +72 -13
- package/dist/{chunk-F2OVYZWF.js.map → chunk-4YUD3EJO.js.map} +1 -1
- package/dist/{chunk-OQCVMQVW.js → chunk-GG6OKZY4.js} +2 -2
- package/dist/{chunk-LFQPDMW4.js → chunk-GHXHT4XL.js} +3 -3
- package/dist/{chunk-MU374IAT.js → chunk-ILBCNOV6.js} +132 -53
- package/dist/chunk-ILBCNOV6.js.map +1 -0
- package/dist/{chunk-QIWQU3CB.js → chunk-ZON73IQM.js} +2 -2
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +39 -19
- package/dist/cli.js.map +1 -1
- package/dist/{consensus-vote-WRR62CRC.js → consensus-vote-VQ6ZOJBP.js} +4 -4
- package/dist/{consensus-vote-types-BlEp-vlK.d.ts → consensus-vote-types-BKoR41Kx.d.ts} +12 -0
- package/dist/{improvement-review-FOYPT3PV.js → improvement-review-OZ6O3ACP.js} +4 -4
- package/dist/index.d.ts +75 -11
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-AED6VSRL.js → setup-data-dir-ZADPA4FW.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-J42YVGO6.js.map +0 -1
- package/dist/chunk-MU374IAT.js.map +0 -1
- /package/dist/{chunk-OQCVMQVW.js.map → chunk-GG6OKZY4.js.map} +0 -0
- /package/dist/{chunk-LFQPDMW4.js.map → chunk-GHXHT4XL.js.map} +0 -0
- /package/dist/{chunk-QIWQU3CB.js.map → chunk-ZON73IQM.js.map} +0 -0
- /package/dist/{consensus-vote-WRR62CRC.js.map → consensus-vote-VQ6ZOJBP.js.map} +0 -0
- /package/dist/{improvement-review-FOYPT3PV.js.map → improvement-review-OZ6O3ACP.js.map} +0 -0
- /package/dist/{setup-data-dir-AED6VSRL.js.map → setup-data-dir-ZADPA4FW.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toolStructuredError,
|
|
8
8
|
toolSuccessStructured,
|
|
9
9
|
wrapToolWithTimeout
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GG6OKZY4.js";
|
|
11
11
|
import {
|
|
12
12
|
JsonlStore,
|
|
13
13
|
SECURITY_KEYWORDS,
|
|
@@ -112,30 +112,31 @@ function withPrerequisite(toolName, handler) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// src/governance/fitness-score.ts
|
|
115
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
116
|
+
import { join as join2 } from "node:path";
|
|
117
|
+
|
|
118
|
+
// src/governance/source-scan.ts
|
|
115
119
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
116
120
|
import { join } from "node:path";
|
|
117
|
-
function findPkgRoot() {
|
|
118
|
-
let dir = import.meta.dirname;
|
|
119
|
-
for (let i = 0; i < 10; i++) {
|
|
120
|
-
const pkgPath = join(dir, "package.json");
|
|
121
|
-
if (existsSync(pkgPath)) {
|
|
122
|
-
const content = readFileSync(pkgPath, "utf-8");
|
|
123
|
-
if (content.includes('"nexus-agents"')) return dir;
|
|
124
|
-
}
|
|
125
|
-
dir = join(dir, "..");
|
|
126
|
-
}
|
|
127
|
-
return join(import.meta.dirname, "../..");
|
|
128
|
-
}
|
|
129
|
-
var PKG_ROOT = findPkgRoot();
|
|
130
|
-
var SRC_ROOT = join(PKG_ROOT, "src");
|
|
131
|
-
var REPO_ROOT = join(PKG_ROOT, "../..");
|
|
132
|
-
var DOCS_ROOT = join(REPO_ROOT, "docs");
|
|
133
121
|
var DETERMINISM_EXCLUDES = [
|
|
134
122
|
/\.test\.ts$/,
|
|
135
123
|
/\.spec\.ts$/,
|
|
136
124
|
/random-provider\.ts$/,
|
|
137
125
|
/time-provider\.ts$/
|
|
138
126
|
];
|
|
127
|
+
var MOCK_GUARD_EXCLUDES = [
|
|
128
|
+
...DETERMINISM_EXCLUDES,
|
|
129
|
+
/^fitness-score\.ts$/,
|
|
130
|
+
/^env-schema\.ts$/
|
|
131
|
+
];
|
|
132
|
+
function countMockGuardSites(srcRoot) {
|
|
133
|
+
return countPatternInDir(
|
|
134
|
+
srcRoot,
|
|
135
|
+
/\.ts$/,
|
|
136
|
+
/NEXUS_ALLOW_MOCK_ORCHESTRATION/g,
|
|
137
|
+
MOCK_GUARD_EXCLUDES
|
|
138
|
+
);
|
|
139
|
+
}
|
|
139
140
|
function countFiles(dir, pattern) {
|
|
140
141
|
if (!existsSync(dir)) return 0;
|
|
141
142
|
let count = 0;
|
|
@@ -175,6 +176,24 @@ function countPatternInDir(dir, filePattern, contentPattern, excludePatterns) {
|
|
|
175
176
|
}
|
|
176
177
|
return count;
|
|
177
178
|
}
|
|
179
|
+
|
|
180
|
+
// src/governance/fitness-score.ts
|
|
181
|
+
function findPkgRoot() {
|
|
182
|
+
let dir = import.meta.dirname;
|
|
183
|
+
for (let i = 0; i < 10; i++) {
|
|
184
|
+
const pkgPath = join2(dir, "package.json");
|
|
185
|
+
if (existsSync2(pkgPath)) {
|
|
186
|
+
const content = readFileSync2(pkgPath, "utf-8");
|
|
187
|
+
if (content.includes('"nexus-agents"')) return dir;
|
|
188
|
+
}
|
|
189
|
+
dir = join2(dir, "..");
|
|
190
|
+
}
|
|
191
|
+
return join2(import.meta.dirname, "../..");
|
|
192
|
+
}
|
|
193
|
+
var PKG_ROOT = findPkgRoot();
|
|
194
|
+
var SRC_ROOT = join2(PKG_ROOT, "src");
|
|
195
|
+
var REPO_ROOT = join2(PKG_ROOT, "../..");
|
|
196
|
+
var DOCS_ROOT = join2(REPO_ROOT, "docs");
|
|
178
197
|
var FITNESS_DIMENSION_MAX = {
|
|
179
198
|
canonicalPaths: 20,
|
|
180
199
|
explicitBehavior: 15,
|
|
@@ -216,8 +235,8 @@ var FitnessScoreCalculator = class {
|
|
|
216
235
|
audit(version) {
|
|
217
236
|
const findings = [];
|
|
218
237
|
const dimensions = {};
|
|
219
|
-
const cliAdaptersDir =
|
|
220
|
-
if (!
|
|
238
|
+
const cliAdaptersDir = join2(SRC_ROOT, "cli-adapters");
|
|
239
|
+
if (!existsSync2(cliAdaptersDir)) {
|
|
221
240
|
return this.notSourceRepoResult(version);
|
|
222
241
|
}
|
|
223
242
|
for (const check of this.checks) {
|
|
@@ -298,7 +317,7 @@ var FitnessScoreCalculator = class {
|
|
|
298
317
|
checkCanonicalPaths() {
|
|
299
318
|
const findings = [];
|
|
300
319
|
let score = 20;
|
|
301
|
-
const routerCount = countFiles(
|
|
320
|
+
const routerCount = countFiles(join2(SRC_ROOT, "cli-adapters"), /router\.ts$/);
|
|
302
321
|
const ROUTER_COUNT_THRESHOLD = 6;
|
|
303
322
|
if (routerCount > ROUTER_COUNT_THRESHOLD) {
|
|
304
323
|
const excess = routerCount - ROUTER_COUNT_THRESHOLD;
|
|
@@ -314,7 +333,7 @@ var FitnessScoreCalculator = class {
|
|
|
314
333
|
)
|
|
315
334
|
);
|
|
316
335
|
}
|
|
317
|
-
if (
|
|
336
|
+
if (existsSync2(join2(SRC_ROOT, "cli-adapters/composite-router.ts"))) {
|
|
318
337
|
score += 2;
|
|
319
338
|
} else {
|
|
320
339
|
score -= 3;
|
|
@@ -332,8 +351,8 @@ var FitnessScoreCalculator = class {
|
|
|
332
351
|
}
|
|
333
352
|
/** Sub-check for IOrchestrator interface and adapter wiring. */
|
|
334
353
|
checkOrchestratorInterface(score, findings) {
|
|
335
|
-
const orchPath =
|
|
336
|
-
if (
|
|
354
|
+
const orchPath = join2(SRC_ROOT, "core/types/orchestrator.ts");
|
|
355
|
+
if (existsSync2(orchPath) && fileContains(orchPath, /interface IOrchestrator/)) {
|
|
337
356
|
score += 3;
|
|
338
357
|
} else {
|
|
339
358
|
score -= 2;
|
|
@@ -341,8 +360,8 @@ var FitnessScoreCalculator = class {
|
|
|
341
360
|
this.finding("canonicalPaths", "warning", "No IOrchestrator interface in core/types", 2)
|
|
342
361
|
);
|
|
343
362
|
}
|
|
344
|
-
const adapterPath =
|
|
345
|
-
if (
|
|
363
|
+
const adapterPath = join2(SRC_ROOT, "orchestration/orchestrator-adapters.ts");
|
|
364
|
+
if (existsSync2(adapterPath) && fileContains(adapterPath, /TechLeadAdapter|PuppeteerAdapter/)) {
|
|
346
365
|
score += 2;
|
|
347
366
|
}
|
|
348
367
|
return score;
|
|
@@ -362,12 +381,7 @@ var FitnessScoreCalculator = class {
|
|
|
362
381
|
checkExplicitBehavior() {
|
|
363
382
|
const findings = [];
|
|
364
383
|
let score = 15;
|
|
365
|
-
const mockGuardCount =
|
|
366
|
-
SRC_ROOT,
|
|
367
|
-
/\.ts$/,
|
|
368
|
-
/NEXUS_ALLOW_MOCK_ORCHESTRATION/g,
|
|
369
|
-
DETERMINISM_EXCLUDES
|
|
370
|
-
);
|
|
384
|
+
const mockGuardCount = countMockGuardSites(SRC_ROOT);
|
|
371
385
|
if (mockGuardCount === 0) {
|
|
372
386
|
score -= 3;
|
|
373
387
|
findings.push(
|
|
@@ -431,7 +445,7 @@ var FitnessScoreCalculator = class {
|
|
|
431
445
|
} else if (randomCount === 0) {
|
|
432
446
|
score += 2;
|
|
433
447
|
}
|
|
434
|
-
if (
|
|
448
|
+
if (existsSync2(join2(SRC_ROOT, "core/random-provider.ts"))) {
|
|
435
449
|
score += 1;
|
|
436
450
|
}
|
|
437
451
|
const randomUsage = countPatternInDir(
|
|
@@ -465,7 +479,7 @@ var FitnessScoreCalculator = class {
|
|
|
465
479
|
)
|
|
466
480
|
);
|
|
467
481
|
}
|
|
468
|
-
if (
|
|
482
|
+
if (existsSync2(join2(SRC_ROOT, "core/time-provider.ts"))) {
|
|
469
483
|
score += 1;
|
|
470
484
|
}
|
|
471
485
|
const timeUsage = countPatternInDir(
|
|
@@ -483,7 +497,7 @@ var FitnessScoreCalculator = class {
|
|
|
483
497
|
checkObservability() {
|
|
484
498
|
const findings = [];
|
|
485
499
|
let score = 15;
|
|
486
|
-
if (
|
|
500
|
+
if (existsSync2(join2(SRC_ROOT, "observability/swarm-observer.ts"))) {
|
|
487
501
|
score += 3;
|
|
488
502
|
} else {
|
|
489
503
|
score -= 3;
|
|
@@ -497,7 +511,7 @@ var FitnessScoreCalculator = class {
|
|
|
497
511
|
)
|
|
498
512
|
);
|
|
499
513
|
}
|
|
500
|
-
if (
|
|
514
|
+
if (existsSync2(join2(SRC_ROOT, "core/trace.ts"))) {
|
|
501
515
|
score += 2;
|
|
502
516
|
}
|
|
503
517
|
const loggerCount = countPatternInDir(SRC_ROOT, /\.ts$/, /createLogger\(/g);
|
|
@@ -513,7 +527,7 @@ var FitnessScoreCalculator = class {
|
|
|
513
527
|
)
|
|
514
528
|
);
|
|
515
529
|
}
|
|
516
|
-
if (
|
|
530
|
+
if (existsSync2(join2(SRC_ROOT, "audit"))) {
|
|
517
531
|
score += 2;
|
|
518
532
|
}
|
|
519
533
|
return { score: clamp(score, 15), findings };
|
|
@@ -522,7 +536,7 @@ var FitnessScoreCalculator = class {
|
|
|
522
536
|
checkConfigSimplicity() {
|
|
523
537
|
const findings = [];
|
|
524
538
|
let score = 10;
|
|
525
|
-
const schemaCount = countFiles(
|
|
539
|
+
const schemaCount = countFiles(join2(SRC_ROOT, "config"), /schema.*\.ts$/);
|
|
526
540
|
if (schemaCount > 10) {
|
|
527
541
|
score -= 2;
|
|
528
542
|
findings.push(
|
|
@@ -537,10 +551,10 @@ var FitnessScoreCalculator = class {
|
|
|
537
551
|
} else {
|
|
538
552
|
score += 1;
|
|
539
553
|
}
|
|
540
|
-
if (
|
|
554
|
+
if (existsSync2(join2(SRC_ROOT, "config/config-loader.ts"))) {
|
|
541
555
|
score += 2;
|
|
542
556
|
}
|
|
543
|
-
if (
|
|
557
|
+
if (existsSync2(join2(SRC_ROOT, "config/config-manager.ts"))) {
|
|
544
558
|
score += 1;
|
|
545
559
|
}
|
|
546
560
|
return { score: clamp(score, 10), findings };
|
|
@@ -550,7 +564,7 @@ var FitnessScoreCalculator = class {
|
|
|
550
564
|
const findings = [];
|
|
551
565
|
let score = 10;
|
|
552
566
|
const adapterAgentImports = countPatternInDir(
|
|
553
|
-
|
|
567
|
+
join2(SRC_ROOT, "adapters"),
|
|
554
568
|
/\.ts$/,
|
|
555
569
|
/from ['"]\.\.\/agents\//g
|
|
556
570
|
);
|
|
@@ -570,7 +584,7 @@ var FitnessScoreCalculator = class {
|
|
|
570
584
|
score += 2;
|
|
571
585
|
}
|
|
572
586
|
const coreMcpImports = countPatternInDir(
|
|
573
|
-
|
|
587
|
+
join2(SRC_ROOT, "core"),
|
|
574
588
|
/\.ts$/,
|
|
575
589
|
/from ['"]\.\.\/mcp\//g
|
|
576
590
|
);
|
|
@@ -595,7 +609,7 @@ var FitnessScoreCalculator = class {
|
|
|
595
609
|
checkOperatorErgonomics() {
|
|
596
610
|
const findings = [];
|
|
597
611
|
let score = 10;
|
|
598
|
-
const commandCount = countFiles(
|
|
612
|
+
const commandCount = countFiles(join2(SRC_ROOT, "cli"), /\.ts$/);
|
|
599
613
|
if (commandCount >= 20) {
|
|
600
614
|
score += 3;
|
|
601
615
|
} else {
|
|
@@ -620,7 +634,7 @@ var FitnessScoreCalculator = class {
|
|
|
620
634
|
["cli/config-command.ts", "Config command", 1]
|
|
621
635
|
];
|
|
622
636
|
for (const [path, name, bonus] of commands) {
|
|
623
|
-
if (
|
|
637
|
+
if (existsSync2(join2(SRC_ROOT, path))) {
|
|
624
638
|
score += bonus;
|
|
625
639
|
} else {
|
|
626
640
|
findings.push(this.finding("operatorErgonomics", "info", `Missing ${name} (${path})`, 0));
|
|
@@ -638,7 +652,7 @@ var FitnessScoreCalculator = class {
|
|
|
638
652
|
}
|
|
639
653
|
/** Sub-check for governance documentation artifacts. */
|
|
640
654
|
checkGovernanceDocs(score, findings) {
|
|
641
|
-
if (!
|
|
655
|
+
if (!existsSync2(join2(REPO_ROOT, "CLAUDE.md"))) {
|
|
642
656
|
score -= 3;
|
|
643
657
|
findings.push(
|
|
644
658
|
this.finding("governanceIntegration", "critical", "No CLAUDE.md governance document", 3)
|
|
@@ -646,10 +660,10 @@ var FitnessScoreCalculator = class {
|
|
|
646
660
|
} else {
|
|
647
661
|
score += 1;
|
|
648
662
|
}
|
|
649
|
-
if (
|
|
663
|
+
if (existsSync2(join2(DOCS_ROOT, "architecture/wiring-graph.json"))) {
|
|
650
664
|
score += 1;
|
|
651
665
|
}
|
|
652
|
-
if (
|
|
666
|
+
if (existsSync2(join2(DOCS_ROOT, "adr"))) {
|
|
653
667
|
score += 1;
|
|
654
668
|
} else {
|
|
655
669
|
findings.push(this.finding("governanceIntegration", "info", "No ADR directory", 0));
|
|
@@ -658,7 +672,7 @@ var FitnessScoreCalculator = class {
|
|
|
658
672
|
}
|
|
659
673
|
/** Sub-check for governance runtime infrastructure. */
|
|
660
674
|
checkGovernanceInfra(score, findings) {
|
|
661
|
-
const hasPolicyFirewall = countPatternInDir(
|
|
675
|
+
const hasPolicyFirewall = countPatternInDir(join2(SRC_ROOT, "security"), /\.ts$/, /PolicyGate|policyFirewall/g) > 0;
|
|
662
676
|
if (hasPolicyFirewall) {
|
|
663
677
|
score += 1;
|
|
664
678
|
} else {
|
|
@@ -2159,4 +2173,4 @@ export {
|
|
|
2159
2173
|
runImprovementReview,
|
|
2160
2174
|
registerImprovementReviewTool
|
|
2161
2175
|
};
|
|
2162
|
-
//# sourceMappingURL=chunk-
|
|
2176
|
+
//# sourceMappingURL=chunk-3CB3LVMG.js.map
|