nexus-agents 2.58.0 → 2.60.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/cli.js CHANGED
@@ -16,7 +16,7 @@ import "./chunk-6QU4DJYW.js";
16
16
  import {
17
17
  setupCommandAsync,
18
18
  verifyCommand
19
- } from "./chunk-GJ5BJU7A.js";
19
+ } from "./chunk-MJ3K4FYS.js";
20
20
  import "./chunk-QGZBCD2A.js";
21
21
  import {
22
22
  AuthHandler,
@@ -142,7 +142,8 @@ import {
142
142
  validateCommand,
143
143
  validateWorkflow,
144
144
  wrapInMarkdownFence
145
- } from "./chunk-JLYJQ7OG.js";
145
+ } from "./chunk-5JSMLCCK.js";
146
+ import "./chunk-ED6VQWNG.js";
146
147
  import {
147
148
  resolveToken
148
149
  } from "./chunk-EZXOJZYE.js";
@@ -150,6 +151,7 @@ import {
150
151
  CATEGORY_DISPLAY_NAMES,
151
152
  DEFAULT_PR_REVIEW_CONFIG
152
153
  } from "./chunk-X2M7OF27.js";
154
+ import "./chunk-JKDHWOQL.js";
153
155
  import {
154
156
  DEFAULT_VOTE_TIMEOUT_MS,
155
157
  THRESHOLD_MAP,
@@ -161,7 +163,7 @@ import {
161
163
  registerConsensusVoteTool,
162
164
  shutdownToolMemory,
163
165
  validateTimeout
164
- } from "./chunk-L3NHOUEX.js";
166
+ } from "./chunk-FEWWXGFE.js";
165
167
  import "./chunk-YU4NABXM.js";
166
168
  import {
167
169
  loadPapersRegistry,
@@ -181,7 +183,6 @@ import "./chunk-V5CGWMYL.js";
181
183
  import "./chunk-BC3M4VLP.js";
182
184
  import "./chunk-AP2FD37C.js";
183
185
  import "./chunk-BQ4YXGGQ.js";
184
- import "./chunk-ED6VQWNG.js";
185
186
  import {
186
187
  CustomExpertDefinitionSchema,
187
188
  MAX_SYSTEM_PROMPT_LENGTH,
@@ -199,11 +200,15 @@ import {
199
200
  loadConfig,
200
201
  runDoctor,
201
202
  validateNexusEnv
202
- } from "./chunk-7EYQBG3W.js";
203
+ } from "./chunk-XRXUCE6K.js";
203
204
  import {
204
205
  DEFAULTS
205
206
  } from "./chunk-H43PABG4.js";
206
207
  import "./chunk-NUBSJGQZ.js";
208
+ import {
209
+ getNexusDataDir,
210
+ nexusDataPath
211
+ } from "./chunk-FDNWRZNJ.js";
207
212
  import "./chunk-GJVHRJO2.js";
208
213
  import "./chunk-7Y36JLES.js";
209
214
  import {
@@ -216,7 +221,6 @@ import {
216
221
  } from "./chunk-633WH2ML.js";
217
222
  import "./chunk-EDGG3RQE.js";
218
223
  import "./chunk-PTGBJFSD.js";
219
- import "./chunk-JKDHWOQL.js";
220
224
  import {
221
225
  createAllAdapters,
222
226
  getAvailableClis,
@@ -4384,7 +4388,6 @@ async function orchestrateCommand(options) {
4384
4388
  // src/cli/session-commands.ts
4385
4389
  import * as fs3 from "fs";
4386
4390
  import * as path2 from "path";
4387
- import * as os from "os";
4388
4391
 
4389
4392
  // src/cli/session-storage-types.ts
4390
4393
  import { z } from "zod";
@@ -4827,7 +4830,7 @@ function createSessionStorage(config) {
4827
4830
 
4828
4831
  // src/cli/session-commands.ts
4829
4832
  function getDefaultDbPath() {
4830
- return path2.join(os.homedir(), ".nexus-agents", "sessions.db");
4833
+ return nexusDataPath("sessions.db");
4831
4834
  }
4832
4835
  function ensureDbDirectory(dbPath) {
4833
4836
  const dir = path2.dirname(dbPath);
@@ -10674,7 +10677,7 @@ function parseValidationArgs(positionals, format, verbose) {
10674
10677
  }
10675
10678
 
10676
10679
  // src/cli/swe-bench-command.ts
10677
- import * as os2 from "os";
10680
+ import * as os from "os";
10678
10681
  import * as path18 from "path";
10679
10682
  function runInfo(options) {
10680
10683
  console.log(`
@@ -10896,7 +10899,7 @@ function parseVariant(arg) {
10896
10899
  if (v === "lite" || v === "verified" || v === "full") return v;
10897
10900
  return "lite";
10898
10901
  }
10899
- var MAX_WORKERS_CAP = Math.min(Math.floor(os2.cpus().length * 0.75), 24);
10902
+ var MAX_WORKERS_CAP = Math.min(Math.floor(os.cpus().length * 0.75), 24);
10900
10903
  var VALID_CACHE_LEVELS = /* @__PURE__ */ new Set(["none", "base", "env", "instance"]);
10901
10904
  var BOOLEAN_FLAGS = {
10902
10905
  "--resume": "resume",
@@ -12984,10 +12987,8 @@ function setStringOption(options, key, value) {
12984
12987
  }
12985
12988
 
12986
12989
  // src/cli/hooks/handlers/handler-utils.ts
12987
- import { homedir as homedir2 } from "os";
12988
- import { join as join13 } from "path";
12989
12990
  function getDefaultDbPath2() {
12990
- return join13(homedir2(), ".nexus-agents", "sessions.db");
12991
+ return nexusDataPath("sessions.db");
12991
12992
  }
12992
12993
  var HookEnvVars = {
12993
12994
  /** Override the default database path */
@@ -14171,23 +14172,23 @@ async function demoCommand(subcommand, args, options) {
14171
14172
 
14172
14173
  // src/governance/fitness-score.ts
14173
14174
  import { existsSync as existsSync12, readFileSync as readFileSync6, readdirSync, statSync } from "fs";
14174
- import { join as join14 } from "path";
14175
+ import { join as join12 } from "path";
14175
14176
  function findPkgRoot() {
14176
14177
  let dir = import.meta.dirname;
14177
14178
  for (let i = 0; i < 10; i++) {
14178
- const pkgPath = join14(dir, "package.json");
14179
+ const pkgPath = join12(dir, "package.json");
14179
14180
  if (existsSync12(pkgPath)) {
14180
14181
  const content = readFileSync6(pkgPath, "utf-8");
14181
14182
  if (content.includes('"nexus-agents"')) return dir;
14182
14183
  }
14183
- dir = join14(dir, "..");
14184
+ dir = join12(dir, "..");
14184
14185
  }
14185
- return join14(import.meta.dirname, "../..");
14186
+ return join12(import.meta.dirname, "../..");
14186
14187
  }
14187
14188
  var PKG_ROOT = findPkgRoot();
14188
- var SRC_ROOT = join14(PKG_ROOT, "src");
14189
- var REPO_ROOT = join14(PKG_ROOT, "../..");
14190
- var DOCS_ROOT = join14(REPO_ROOT, "docs");
14189
+ var SRC_ROOT = join12(PKG_ROOT, "src");
14190
+ var REPO_ROOT = join12(PKG_ROOT, "../..");
14191
+ var DOCS_ROOT = join12(REPO_ROOT, "docs");
14191
14192
  var DETERMINISM_EXCLUDES = [
14192
14193
  /\.test\.ts$/,
14193
14194
  /\.spec\.ts$/,
@@ -14198,7 +14199,7 @@ function countFiles(dir, pattern) {
14198
14199
  if (!existsSync12(dir)) return 0;
14199
14200
  let count = 0;
14200
14201
  for (const entry of readdirSync(dir)) {
14201
- const fullPath = join14(dir, entry);
14202
+ const fullPath = join12(dir, entry);
14202
14203
  const stat2 = statSync(fullPath);
14203
14204
  if (stat2.isDirectory() && !entry.startsWith(".")) {
14204
14205
  count += countFiles(fullPath, pattern);
@@ -14223,7 +14224,7 @@ function countPatternInDir(dir, filePattern, contentPattern, excludePatterns) {
14223
14224
  if (!existsSync12(dir)) return 0;
14224
14225
  let count = 0;
14225
14226
  for (const entry of readdirSync(dir)) {
14226
- const fullPath = join14(dir, entry);
14227
+ const fullPath = join12(dir, entry);
14227
14228
  const stat2 = statSync(fullPath);
14228
14229
  if (stat2.isDirectory() && !entry.startsWith(".") && entry !== "node_modules") {
14229
14230
  count += countPatternInDir(fullPath, filePattern, contentPattern, excludePatterns);
@@ -14313,7 +14314,7 @@ var FitnessScoreCalculator = class {
14313
14314
  checkCanonicalPaths() {
14314
14315
  const findings = [];
14315
14316
  let score = 20;
14316
- const routerCount = countFiles(join14(SRC_ROOT, "cli-adapters"), /router\.ts$/);
14317
+ const routerCount = countFiles(join12(SRC_ROOT, "cli-adapters"), /router\.ts$/);
14317
14318
  const ROUTER_COUNT_THRESHOLD = 6;
14318
14319
  if (routerCount > ROUTER_COUNT_THRESHOLD) {
14319
14320
  const excess = routerCount - ROUTER_COUNT_THRESHOLD;
@@ -14329,7 +14330,7 @@ var FitnessScoreCalculator = class {
14329
14330
  )
14330
14331
  );
14331
14332
  }
14332
- if (existsSync12(join14(SRC_ROOT, "cli-adapters/composite-router.ts"))) {
14333
+ if (existsSync12(join12(SRC_ROOT, "cli-adapters/composite-router.ts"))) {
14333
14334
  score += 2;
14334
14335
  } else {
14335
14336
  score -= 3;
@@ -14347,7 +14348,7 @@ var FitnessScoreCalculator = class {
14347
14348
  }
14348
14349
  /** Sub-check for IOrchestrator interface and adapter wiring. */
14349
14350
  checkOrchestratorInterface(score, findings) {
14350
- const orchPath = join14(SRC_ROOT, "core/types/orchestrator.ts");
14351
+ const orchPath = join12(SRC_ROOT, "core/types/orchestrator.ts");
14351
14352
  if (existsSync12(orchPath) && fileContains(orchPath, /interface IOrchestrator/)) {
14352
14353
  score += 3;
14353
14354
  } else {
@@ -14356,7 +14357,7 @@ var FitnessScoreCalculator = class {
14356
14357
  this.finding("canonicalPaths", "warning", "No IOrchestrator interface in core/types", 2)
14357
14358
  );
14358
14359
  }
14359
- const adapterPath = join14(SRC_ROOT, "orchestration/orchestrator-adapters.ts");
14360
+ const adapterPath = join12(SRC_ROOT, "orchestration/orchestrator-adapters.ts");
14360
14361
  if (existsSync12(adapterPath) && fileContains(adapterPath, /TechLeadAdapter|PuppeteerAdapter/)) {
14361
14362
  score += 2;
14362
14363
  }
@@ -14446,7 +14447,7 @@ var FitnessScoreCalculator = class {
14446
14447
  } else if (randomCount === 0) {
14447
14448
  score += 2;
14448
14449
  }
14449
- if (existsSync12(join14(SRC_ROOT, "core/random-provider.ts"))) {
14450
+ if (existsSync12(join12(SRC_ROOT, "core/random-provider.ts"))) {
14450
14451
  score += 1;
14451
14452
  }
14452
14453
  const randomUsage = countPatternInDir(
@@ -14480,7 +14481,7 @@ var FitnessScoreCalculator = class {
14480
14481
  )
14481
14482
  );
14482
14483
  }
14483
- if (existsSync12(join14(SRC_ROOT, "core/time-provider.ts"))) {
14484
+ if (existsSync12(join12(SRC_ROOT, "core/time-provider.ts"))) {
14484
14485
  score += 1;
14485
14486
  }
14486
14487
  const timeUsage = countPatternInDir(
@@ -14498,7 +14499,7 @@ var FitnessScoreCalculator = class {
14498
14499
  checkObservability() {
14499
14500
  const findings = [];
14500
14501
  let score = 15;
14501
- if (existsSync12(join14(SRC_ROOT, "observability/swarm-observer.ts"))) {
14502
+ if (existsSync12(join12(SRC_ROOT, "observability/swarm-observer.ts"))) {
14502
14503
  score += 3;
14503
14504
  } else {
14504
14505
  score -= 3;
@@ -14512,7 +14513,7 @@ var FitnessScoreCalculator = class {
14512
14513
  )
14513
14514
  );
14514
14515
  }
14515
- if (existsSync12(join14(SRC_ROOT, "core/trace.ts"))) {
14516
+ if (existsSync12(join12(SRC_ROOT, "core/trace.ts"))) {
14516
14517
  score += 2;
14517
14518
  }
14518
14519
  const loggerCount = countPatternInDir(SRC_ROOT, /\.ts$/, /createLogger\(/g);
@@ -14528,7 +14529,7 @@ var FitnessScoreCalculator = class {
14528
14529
  )
14529
14530
  );
14530
14531
  }
14531
- if (existsSync12(join14(SRC_ROOT, "audit"))) {
14532
+ if (existsSync12(join12(SRC_ROOT, "audit"))) {
14532
14533
  score += 2;
14533
14534
  }
14534
14535
  return { score: clamp2(score, 15), findings };
@@ -14537,7 +14538,7 @@ var FitnessScoreCalculator = class {
14537
14538
  checkConfigSimplicity() {
14538
14539
  const findings = [];
14539
14540
  let score = 10;
14540
- const schemaCount = countFiles(join14(SRC_ROOT, "config"), /schema.*\.ts$/);
14541
+ const schemaCount = countFiles(join12(SRC_ROOT, "config"), /schema.*\.ts$/);
14541
14542
  if (schemaCount > 10) {
14542
14543
  score -= 2;
14543
14544
  findings.push(
@@ -14552,10 +14553,10 @@ var FitnessScoreCalculator = class {
14552
14553
  } else {
14553
14554
  score += 1;
14554
14555
  }
14555
- if (existsSync12(join14(SRC_ROOT, "config/config-loader.ts"))) {
14556
+ if (existsSync12(join12(SRC_ROOT, "config/config-loader.ts"))) {
14556
14557
  score += 2;
14557
14558
  }
14558
- if (existsSync12(join14(SRC_ROOT, "config/config-manager.ts"))) {
14559
+ if (existsSync12(join12(SRC_ROOT, "config/config-manager.ts"))) {
14559
14560
  score += 1;
14560
14561
  }
14561
14562
  return { score: clamp2(score, 10), findings };
@@ -14565,7 +14566,7 @@ var FitnessScoreCalculator = class {
14565
14566
  const findings = [];
14566
14567
  let score = 10;
14567
14568
  const adapterAgentImports = countPatternInDir(
14568
- join14(SRC_ROOT, "adapters"),
14569
+ join12(SRC_ROOT, "adapters"),
14569
14570
  /\.ts$/,
14570
14571
  /from ['"]\.\.\/agents\//g
14571
14572
  );
@@ -14585,7 +14586,7 @@ var FitnessScoreCalculator = class {
14585
14586
  score += 2;
14586
14587
  }
14587
14588
  const coreMcpImports = countPatternInDir(
14588
- join14(SRC_ROOT, "core"),
14589
+ join12(SRC_ROOT, "core"),
14589
14590
  /\.ts$/,
14590
14591
  /from ['"]\.\.\/mcp\//g
14591
14592
  );
@@ -14610,7 +14611,7 @@ var FitnessScoreCalculator = class {
14610
14611
  checkOperatorErgonomics() {
14611
14612
  const findings = [];
14612
14613
  let score = 10;
14613
- const commandCount = countFiles(join14(SRC_ROOT, "cli"), /\.ts$/);
14614
+ const commandCount = countFiles(join12(SRC_ROOT, "cli"), /\.ts$/);
14614
14615
  if (commandCount >= 20) {
14615
14616
  score += 3;
14616
14617
  } else {
@@ -14635,7 +14636,7 @@ var FitnessScoreCalculator = class {
14635
14636
  ["cli/config-command.ts", "Config command", 1]
14636
14637
  ];
14637
14638
  for (const [path23, name, bonus] of commands) {
14638
- if (existsSync12(join14(SRC_ROOT, path23))) {
14639
+ if (existsSync12(join12(SRC_ROOT, path23))) {
14639
14640
  score += bonus;
14640
14641
  } else {
14641
14642
  findings.push(this.finding("operatorErgonomics", "info", `Missing ${name} (${path23})`, 0));
@@ -14653,7 +14654,7 @@ var FitnessScoreCalculator = class {
14653
14654
  }
14654
14655
  /** Sub-check for governance documentation artifacts. */
14655
14656
  checkGovernanceDocs(score, findings) {
14656
- if (!existsSync12(join14(REPO_ROOT, "CLAUDE.md"))) {
14657
+ if (!existsSync12(join12(REPO_ROOT, "CLAUDE.md"))) {
14657
14658
  score -= 3;
14658
14659
  findings.push(
14659
14660
  this.finding("governanceIntegration", "critical", "No CLAUDE.md governance document", 3)
@@ -14661,10 +14662,10 @@ var FitnessScoreCalculator = class {
14661
14662
  } else {
14662
14663
  score += 1;
14663
14664
  }
14664
- if (existsSync12(join14(DOCS_ROOT, "architecture/wiring-graph.json"))) {
14665
+ if (existsSync12(join12(DOCS_ROOT, "architecture/wiring-graph.json"))) {
14665
14666
  score += 1;
14666
14667
  }
14667
- if (existsSync12(join14(DOCS_ROOT, "adr"))) {
14668
+ if (existsSync12(join12(DOCS_ROOT, "adr"))) {
14668
14669
  score += 1;
14669
14670
  } else {
14670
14671
  findings.push(this.finding("governanceIntegration", "info", "No ADR directory", 0));
@@ -14673,7 +14674,7 @@ var FitnessScoreCalculator = class {
14673
14674
  }
14674
14675
  /** Sub-check for governance runtime infrastructure. */
14675
14676
  checkGovernanceInfra(score, findings) {
14676
- const hasPolicyFirewall = countPatternInDir(join14(SRC_ROOT, "security"), /\.ts$/, /PolicyGate|policyFirewall/g) > 0;
14677
+ const hasPolicyFirewall = countPatternInDir(join12(SRC_ROOT, "security"), /\.ts$/, /PolicyGate|policyFirewall/g) > 0;
14677
14678
  if (hasPolicyFirewall) {
14678
14679
  score += 1;
14679
14680
  } else {
@@ -17710,8 +17711,6 @@ function isValidCommand(value) {
17710
17711
 
17711
17712
  // src/cli-commands-handlers.ts
17712
17713
  import { existsSync as existsSync18 } from "fs";
17713
- import { join as join16 } from "path";
17714
- import { homedir as homedir4 } from "os";
17715
17714
 
17716
17715
  // src/mcp/tools/dev-pipeline-tool.ts
17717
17716
  import { z as z9 } from "zod";
@@ -19894,9 +19893,7 @@ function initializeAuth(config, logger17) {
19894
19893
  }
19895
19894
 
19896
19895
  // src/cli-server-audit.ts
19897
- import { join as join15 } from "path";
19898
- import { homedir as homedir3 } from "os";
19899
- var DEFAULT_AUDIT_DIR = join15(homedir3(), ".nexus-agents", "audit");
19896
+ var DEFAULT_AUDIT_DIR = nexusDataPath("audit");
19900
19897
  function initializeAuditLogger(securityConfig, logger17) {
19901
19898
  if (securityConfig?.audit?.enabled !== true) {
19902
19899
  logger17.debug("Audit logging disabled (set security.audit.enabled: true to enable)");
@@ -20525,7 +20522,7 @@ function buildOrchestratorOptions(args) {
20525
20522
  function printFirstRunHint() {
20526
20523
  const isTTY = process.stderr.isTTY;
20527
20524
  if (!isTTY) return;
20528
- const dataDir = join16(homedir4(), ".nexus-agents");
20525
+ const dataDir = getNexusDataDir();
20529
20526
  const hasConfig = existsSync18("./nexus-agents.yaml") || existsSync18("./nexus-agents.yml");
20530
20527
  if (existsSync18(dataDir) || hasConfig) return;
20531
20528
  process.stderr.write(
@@ -20639,7 +20636,7 @@ async function handleResearchCommand(args) {
20639
20636
  }
20640
20637
  }
20641
20638
  async function handleRegistryCommand(args) {
20642
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-S46JJ2SX.js");
20639
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-TTXAUCOK.js");
20643
20640
  const subcommand = args.subcommand;
20644
20641
  if (!isValidRegistrySubcommand(subcommand)) {
20645
20642
  process.stdout.write(`${formatRegistryUsage()}
@@ -22166,7 +22163,7 @@ function handleStatusCommand2(args) {
22166
22163
 
22167
22164
  // src/cli/scenario-command.ts
22168
22165
  import { readdir as readdir4 } from "fs/promises";
22169
- import { join as join18, resolve as resolve13 } from "path";
22166
+ import { join as join14, resolve as resolve13 } from "path";
22170
22167
 
22171
22168
  // src/testing/e2e/scenario-runner.ts
22172
22169
  import { readFile as readFile7 } from "fs/promises";
@@ -22536,7 +22533,7 @@ async function handleRun(args) {
22536
22533
  process.exit(EXIT_CODES.SERVER_START_FAILED);
22537
22534
  }
22538
22535
  const runner = createScenarioRunner();
22539
- const fixturePath = join18(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
22536
+ const fixturePath = join14(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
22540
22537
  try {
22541
22538
  const fixture = await runner.loadFixture(fixturePath);
22542
22539
  const result = await runner.run(fixture);