nexus-agents 8.22.3 → 8.23.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
@@ -157,7 +157,7 @@ import {
157
157
  validateNexusEnv,
158
158
  validateWorkflow,
159
159
  wrapInMarkdownFence
160
- } from "./chunk-NDWIQFXW.js";
160
+ } from "./chunk-ZBONAFV2.js";
161
161
  import "./chunk-22EEMQUS.js";
162
162
  import "./chunk-DGWT7DXX.js";
163
163
  import "./chunk-64GMIUM5.js";
@@ -177,7 +177,7 @@ import {
177
177
  doctorCommand,
178
178
  initDataDirectories,
179
179
  runDoctor
180
- } from "./chunk-MGG466HO.js";
180
+ } from "./chunk-UGE27CC2.js";
181
181
  import {
182
182
  buildOpenAICompatAdapters,
183
183
  readOpenAICompatEnv
@@ -196,7 +196,7 @@ import {
196
196
  recordAuthenticVote,
197
197
  registerConsensusVoteTool,
198
198
  toRecordDecision
199
- } from "./chunk-TB2USTOO.js";
199
+ } from "./chunk-JVUO6DKS.js";
200
200
  import {
201
201
  loadUsageEvents,
202
202
  rollupByModel
@@ -236,17 +236,17 @@ import {
236
236
  registerImprovementReviewTool,
237
237
  runImprovementReview,
238
238
  scanForSecrets
239
- } from "./chunk-7LFNF4PD.js";
239
+ } from "./chunk-F6HVGT3O.js";
240
240
  import {
241
241
  createDefaultPolicyFirewall,
242
242
  setGlobalPolicyFirewall,
243
243
  stagePolicyFirewallForRollout
244
- } from "./chunk-M4DC2HYF.js";
244
+ } from "./chunk-3EMSXOSB.js";
245
245
  import {
246
246
  NODE_ENGINE_RANGE,
247
247
  VERSION,
248
248
  isNodeVersionSupported
249
- } from "./chunk-Z7ORWDXO.js";
249
+ } from "./chunk-SDSJVC5J.js";
250
250
  import "./chunk-YOT4GWJV.js";
251
251
  import {
252
252
  createUnifiedRegistry,
@@ -10089,12 +10089,13 @@ async function handleStatusCommand(args, options) {
10089
10089
  format
10090
10090
  };
10091
10091
  const result = await getResearchStatus(statusOptions);
10092
- return formatStatusResult(result, format);
10092
+ const text = formatStatusResult(result, format);
10093
+ return result.success ? text : failure(text);
10093
10094
  }
10094
10095
  async function handleOverlapCommand(args, options) {
10095
10096
  const techniqueId = args[0];
10096
10097
  if (techniqueId === void 0 || techniqueId === "") {
10097
- return "Error: technique-id is required for overlap command";
10098
+ return failure("Error: technique-id is required for overlap command");
10098
10099
  }
10099
10100
  const format = optString(options, "format") ?? "table";
10100
10101
  const overlapOptions = {
@@ -10103,12 +10104,13 @@ async function handleOverlapCommand(args, options) {
10103
10104
  format
10104
10105
  };
10105
10106
  const result = await findOverlaps(overlapOptions);
10106
- return formatOverlapResult(result, format);
10107
+ const text = formatOverlapResult(result, format);
10108
+ return result.success ? text : failure(text);
10107
10109
  }
10108
10110
  async function handleAddCommand(args, options) {
10109
10111
  const arxivId = args[0];
10110
10112
  if (arxivId === void 0 || arxivId === "") {
10111
- return "Error: arxiv-id is required for add command";
10113
+ return failure("Error: arxiv-id is required for add command");
10112
10114
  }
10113
10115
  const topic = optString(options, "topic");
10114
10116
  const priority = optString(options, "priority");
@@ -10172,7 +10174,7 @@ function renderDiscoverResponse(response) {
10172
10174
  async function handleDiscoverCommand(args, options) {
10173
10175
  const topic = args[0] ?? optString(options, "topic");
10174
10176
  if (topic === void 0 || topic === "") {
10175
- return "Error: --topic is required for discover command";
10177
+ return failure("Error: --topic is required for discover command");
10176
10178
  }
10177
10179
  const parsed = ResearchDiscoverInputSchema.safeParse({
10178
10180
  topic,
@@ -10182,7 +10184,7 @@ async function handleDiscoverCommand(args, options) {
10182
10184
  }
10183
10185
  });
10184
10186
  if (!parsed.success) {
10185
- return `Error: ${parsed.error.issues.map((i) => i.message).join("; ")}`;
10187
+ return failure(`Error: ${parsed.error.issues.map((i) => i.message).join("; ")}`);
10186
10188
  }
10187
10189
  const logger22 = createLogger({ component: "cli-research-discover" });
10188
10190
  const response = await executeDiscovery(parsed.data, logger22);
@@ -10191,7 +10193,7 @@ async function handleDiscoverCommand(args, options) {
10191
10193
  async function handleReviewCommand(args, options) {
10192
10194
  const topic = args[0] ?? optString(options, "topic");
10193
10195
  if (topic === void 0 || topic === "") {
10194
- return "Error: --topic is required for review command";
10196
+ return failure("Error: --topic is required for review command");
10195
10197
  }
10196
10198
  const maxResults = optNumber(options, "maxResults") ?? 10;
10197
10199
  const createIssues = optBoolean(options, "createIssues");
@@ -10211,7 +10213,7 @@ async function handleSynthesizeCommand(args, options) {
10211
10213
  const topic = args[0] ?? optString(options, "topic");
10212
10214
  const result = await synthesizeResearch(topic);
10213
10215
  if (!result.ok) {
10214
- return `Error: ${result.error.message}`;
10216
+ return failure(`Error: ${result.error.message}`);
10215
10217
  }
10216
10218
  return formatSynthesisResult(result.value);
10217
10219
  }
@@ -10328,26 +10330,25 @@ var VALID_SUBCOMMANDS = [
10328
10330
  function isValidResearchSubcommand(value) {
10329
10331
  return value !== void 0 && VALID_SUBCOMMANDS.includes(value);
10330
10332
  }
10333
+ function failure(text) {
10334
+ return { text, exitCode: 1 };
10335
+ }
10331
10336
  function ok2(handler) {
10332
- return async (args, options) => ({
10333
- text: await handler(args, options),
10334
- exitCode: 0
10335
- });
10337
+ return async (args, options) => {
10338
+ const result = await handler(args, options);
10339
+ if (typeof result !== "string") return result;
10340
+ return { text: result, exitCode: result.startsWith("Error:") ? 1 : 0 };
10341
+ };
10336
10342
  }
10337
10343
  async function handleIndexCommand(args) {
10338
10344
  const indexOptions = parseResearchIndexArgs(args);
10339
10345
  const result = await researchIndexCommand(indexOptions);
10340
10346
  return { text: result.message, exitCode: result.exitCode };
10341
10347
  }
10342
- async function handleAddCommandWithExit(args, options) {
10343
- const text = await handleAddCommand(args, options);
10344
- const exitCode = text.startsWith("Error:") ? 1 : 0;
10345
- return { text, exitCode };
10346
- }
10347
10348
  var SUBCOMMAND_HANDLERS = {
10348
10349
  status: ok2(handleStatusCommand),
10349
10350
  overlap: ok2(handleOverlapCommand),
10350
- add: handleAddCommandWithExit,
10351
+ add: ok2(handleAddCommand),
10351
10352
  stats: ok2((_args, options) => handleStatsCommand(options)),
10352
10353
  refresh: ok2((_args, options) => handleRefreshCommand(options)),
10353
10354
  check: ok2(() => handleCheckCommand()),
@@ -19721,7 +19722,7 @@ function startImprovementReviewScheduler(options) {
19721
19722
  let running = false;
19722
19723
  const runOnce = async () => {
19723
19724
  try {
19724
- const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-BTH44AEV.js");
19725
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-NSE7H3KE.js");
19725
19726
  const input = ImprovementReviewInputSchema2.parse({ fileIssues });
19726
19727
  const result = await runImprovementReview2(input, { logger: logger22 });
19727
19728
  logger22.info("Scheduled improvement_review complete", {
@@ -22552,7 +22553,8 @@ var RESEARCH_HELP = {
22552
22553
  ],
22553
22554
  flags: [
22554
22555
  { flag: "--format=<fmt>", description: "Output format: table, json", defaultValue: "table" },
22555
- { flag: "-o, --output=<path>", description: "Custom output path for refresh" }
22556
+ { flag: "-o, --output=<path>", description: "Custom output path for refresh" },
22557
+ { flag: "--source=<source>", description: "Discovery source for the discover subcommand" }
22556
22558
  ]
22557
22559
  };
22558
22560
  var FITNESS_AUDIT_HELP = {
@@ -22697,6 +22699,15 @@ function printResearchUsage() {
22697
22699
  process.stdout.write(" discover Discover papers/repos from external sources\n");
22698
22700
  process.stdout.write(" review Discover, score, and rank research findings\n");
22699
22701
  process.stdout.write(" prioritize Rank actionable techniques by priority\n");
22702
+ const flags = getCommandHelp("research")?.flags ?? [];
22703
+ if (flags.length > 0) {
22704
+ process.stdout.write("Options:\n");
22705
+ for (const entry of flags) {
22706
+ const suffix = entry.defaultValue === void 0 ? "" : ` (default: ${entry.defaultValue})`;
22707
+ process.stdout.write(` ${entry.flag} ${entry.description}${suffix}
22708
+ `);
22709
+ }
22710
+ }
22700
22711
  }
22701
22712
 
22702
22713
  // src/cli-command-suggester.ts
@@ -23017,6 +23028,16 @@ async function handleResearchCommand(args) {
23017
23028
  if (args.options.dryRun) {
23018
23029
  options["dryRun"] = true;
23019
23030
  }
23031
+ if (args.options.source !== void 0) {
23032
+ const source = ResearchDiscoverInputSchema.shape.source.safeParse(args.options.source);
23033
+ if (!source.success) {
23034
+ const message = `Invalid research source: ${args.options.source}`;
23035
+ process.stdout.write(`Error: ${message}
23036
+ `);
23037
+ return cliExit(EXIT_CODES.INVALID_ARGS, message);
23038
+ }
23039
+ options["source"] = source.data;
23040
+ }
23020
23041
  try {
23021
23042
  const result = await researchCommand(subcommand, positionalArgs, options);
23022
23043
  process.stdout.write(result.text + "\n");
@@ -24640,8 +24661,8 @@ ${colors.green}${symbols.check} All thresholds passed${colors.reset}`);
24640
24661
  }
24641
24662
  writeLine5(`
24642
24663
  ${colors.red}${symbols.cross} Threshold validation failed:${colors.reset}`);
24643
- for (const failure of failures) {
24644
- writeLine5(` ${colors.red}${symbols.bullet} ${failure}${colors.reset}`);
24664
+ for (const failure2 of failures) {
24665
+ writeLine5(` ${colors.red}${symbols.bullet} ${failure2}${colors.reset}`);
24645
24666
  }
24646
24667
  return false;
24647
24668
  }