nexus-agents 2.92.3 → 2.92.4

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.
@@ -42,7 +42,7 @@ import {
42
42
  writeJobComplete,
43
43
  writeJobFailed,
44
44
  writeJobPending
45
- } from "./chunk-UYOHV3EG.js";
45
+ } from "./chunk-JCYCITBK.js";
46
46
  import {
47
47
  REGISTRY_PATH,
48
48
  getProjectRoot,
@@ -53,8 +53,10 @@ import {
53
53
  synthesizeResearch
54
54
  } from "./chunk-CGSVTROC.js";
55
55
  import {
56
- IssueTriage
57
- } from "./chunk-C6PEYEPU.js";
56
+ IssueTriage,
57
+ createAuditTrail,
58
+ createGraphAuditBridge
59
+ } from "./chunk-IHPYT6WU.js";
58
60
  import {
59
61
  resolveEnvMode,
60
62
  sanitizeInput
@@ -85,7 +87,7 @@ import {
85
87
  DEFAULT_TASK_TTL_MS,
86
88
  DEFAULT_TOOL_RATE_LIMITS,
87
89
  clampTaskTtl
88
- } from "./chunk-BFYOPX2E.js";
90
+ } from "./chunk-MZFWRU6E.js";
89
91
  import {
90
92
  getAvailabilityCache,
91
93
  resolveFallback
@@ -39234,149 +39236,6 @@ function recordTriageOutcome(success, durationMs, errorMsg) {
39234
39236
  }
39235
39237
  }
39236
39238
 
39237
- // src/security/audit-trail.ts
39238
- var MAX_EVENTS = 1e4;
39239
- var MAX_STRIPPED_ELEMENTS_PER_EVENT = 20;
39240
- var AuditTrail = class {
39241
- events = [];
39242
- nextId = 1;
39243
- /** Appends an event to the trail. Returns the assigned event ID. */
39244
- append(event) {
39245
- const id = `audit-${String(this.nextId++)}`;
39246
- const fullEvent = {
39247
- ...event,
39248
- id,
39249
- timestamp: getTimeProvider().nowIso()
39250
- };
39251
- this.events.push(fullEvent);
39252
- this.enforceLimit();
39253
- return id;
39254
- }
39255
- /** Queries events matching the given filter. */
39256
- query(filter = {}) {
39257
- let results = this.events;
39258
- if (filter.type !== void 0) {
39259
- results = results.filter((e) => e.type === filter.type);
39260
- }
39261
- if (filter.since !== void 0) {
39262
- results = filterSince(results, filter.since);
39263
- }
39264
- if (filter.until !== void 0) {
39265
- results = filterUntil(results, filter.until);
39266
- }
39267
- if (filter.trustTier !== void 0) {
39268
- results = filterByTrustTier(results, filter.trustTier);
39269
- }
39270
- const limit = filter.limit ?? results.length;
39271
- return results.slice(-limit);
39272
- }
39273
- /** Returns the total number of events. */
39274
- get size() {
39275
- return this.events.length;
39276
- }
39277
- /** Clears all events. */
39278
- clear() {
39279
- this.events = [];
39280
- }
39281
- /** Enforces MAX_EVENTS bound. */
39282
- enforceLimit() {
39283
- if (this.events.length > MAX_EVENTS) {
39284
- this.events = this.events.slice(-MAX_EVENTS);
39285
- }
39286
- }
39287
- };
39288
- function filterSince(events, since) {
39289
- const sinceTime = new Date(since).getTime();
39290
- return events.filter((e) => new Date(e.timestamp).getTime() >= sinceTime);
39291
- }
39292
- function filterUntil(events, until) {
39293
- const untilTime = new Date(until).getTime();
39294
- return events.filter((e) => new Date(e.timestamp).getTime() <= untilTime);
39295
- }
39296
- function filterByTrustTier(events, tier) {
39297
- return events.filter((e) => {
39298
- if (e.type === "trust_classification") return e.assignedTier === tier;
39299
- if (e.type === "policy_gate") return e.inputTrustTier === tier;
39300
- if (e.type === "reputation") return e.effectiveTier === tier;
39301
- return true;
39302
- });
39303
- }
39304
- function emitTrustEvent(trail, data) {
39305
- return trail.append({
39306
- type: "trust_classification",
39307
- component: "trust-classifier",
39308
- ...data
39309
- });
39310
- }
39311
- function emitPolicyEvent(trail, data) {
39312
- return trail.append({
39313
- type: "policy_gate",
39314
- component: "policy-gate",
39315
- ...data
39316
- });
39317
- }
39318
- function emitCorroborationEvent(trail, data) {
39319
- return trail.append({
39320
- type: "corroboration",
39321
- component: "corroboration-validator",
39322
- ...data
39323
- });
39324
- }
39325
- function emitReputationEvent(trail, data) {
39326
- return trail.append({
39327
- type: "reputation",
39328
- component: "reputation-model",
39329
- ...data
39330
- });
39331
- }
39332
- function emitSanitizationEvent(trail, data) {
39333
- return trail.append({
39334
- type: "sanitization",
39335
- component: "input-sanitizer",
39336
- ...data
39337
- });
39338
- }
39339
- function emitGraphExecutionEvent(trail, data) {
39340
- return trail.append({
39341
- type: "graph_execution",
39342
- component: "graph-executor",
39343
- ...data
39344
- });
39345
- }
39346
- function createGraphAuditBridge(trail) {
39347
- return (event) => {
39348
- const nodeId = typeof event["nodeId"] === "string" ? event["nodeId"] : void 0;
39349
- const stepNumber = typeof event["stepNumber"] === "number" ? event["stepNumber"] : 0;
39350
- emitGraphExecutionEvent(trail, {
39351
- graphEvent: event.type,
39352
- ...nodeId !== void 0 ? { nodeId } : {},
39353
- stepNumber,
39354
- detail: formatGraphEventDetail(event)
39355
- });
39356
- };
39357
- }
39358
- function formatGraphEventDetail(event) {
39359
- switch (event.type) {
39360
- case "node_started":
39361
- return `Node ${String(event["nodeId"])} starting`;
39362
- case "node_completed":
39363
- return `Node ${String(event["nodeId"])} completed in ${String(event["durationMs"])}ms`;
39364
- case "node_error":
39365
- return `Node ${String(event["nodeId"])} failed: ${String(event["error"])}`;
39366
- case "state_updated":
39367
- return `State updated: ${String(event["updatedKeys"])}`;
39368
- case "step_completed":
39369
- return `Step ${String(event["stepNumber"])}: ${String(event["nodesExecuted"])} nodes`;
39370
- case "execution_complete":
39371
- return `Complete: ${String(event["totalSteps"])} steps, ${String(event["durationMs"])}ms`;
39372
- default:
39373
- return event.type;
39374
- }
39375
- }
39376
- function createAuditTrail() {
39377
- return new AuditTrail();
39378
- }
39379
-
39380
39239
  // src/mcp/tools/run-graph-workflow.ts
39381
39240
  import { z as z70 } from "zod";
39382
39241
  var RunGraphWorkflowInputSchema = z70.object({
@@ -42526,7 +42385,7 @@ async function tryIssueTriage(task) {
42526
42385
  try {
42527
42386
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
42528
42387
  if (issueMatch === null) return null;
42529
- const { createIssueTriage } = await import("./issue-triage-DTCO26WG.js");
42388
+ const { createIssueTriage } = await import("./issue-triage-VB5CVE43.js");
42530
42389
  const triage = createIssueTriage();
42531
42390
  const owner = issueMatch[1] ?? "";
42532
42391
  const num = issueMatch[2] ?? "";
@@ -43551,7 +43410,7 @@ ${contextBlock}`;
43551
43410
  const strategy = config.votingStrategy ?? "higher_order";
43552
43411
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43553
43412
  try {
43554
- const { executeVoting } = await import("./consensus-vote-VSRNSZ5J.js");
43413
+ const { executeVoting } = await import("./consensus-vote-4RIUUEZQ.js");
43555
43414
  const votingResult = await executeVoting(
43556
43415
  {
43557
43416
  proposal: plan.slice(0, 4e3),
@@ -44327,7 +44186,7 @@ ${codeContext}`;
44327
44186
  const result = await stages.research(enrichedTask);
44328
44187
  return output(PIPELINE_STATE_KEYS.RESEARCH, result, getTimeProvider().now() - start, true);
44329
44188
  } catch (e) {
44330
- return failOutput(PIPELINE_STATE_KEYS.RESEARCH, String(e), getTimeProvider().now() - start);
44189
+ return failOutput(PIPELINE_STATE_KEYS.RESEARCH, getErrorMessage(e), getTimeProvider().now() - start);
44331
44190
  }
44332
44191
  }
44333
44192
  };
@@ -44349,7 +44208,7 @@ ${priorArt}` : research;
44349
44208
  const result = await stages.plan(ctx.task, enrichedResearch, feedback);
44350
44209
  return output(PIPELINE_STATE_KEYS.PLAN, result, getTimeProvider().now() - start, true);
44351
44210
  } catch (e) {
44352
- return failOutput(PIPELINE_STATE_KEYS.PLAN, String(e), getTimeProvider().now() - start);
44211
+ return failOutput(PIPELINE_STATE_KEYS.PLAN, getErrorMessage(e), getTimeProvider().now() - start);
44353
44212
  }
44354
44213
  }
44355
44214
  };
@@ -44372,7 +44231,7 @@ function createVoteStageWrapper(stages) {
44372
44231
  success: isApproved(vote)
44373
44232
  };
44374
44233
  } catch (e) {
44375
- return failOutput(PIPELINE_STATE_KEYS.VOTE_RESULT, String(e), getTimeProvider().now() - start);
44234
+ return failOutput(PIPELINE_STATE_KEYS.VOTE_RESULT, getErrorMessage(e), getTimeProvider().now() - start);
44376
44235
  }
44377
44236
  }
44378
44237
  };
@@ -44388,7 +44247,7 @@ function createDecomposeStageWrapper(stages) {
44388
44247
  const tasks = await stages.decompose(plan);
44389
44248
  return output(PIPELINE_STATE_KEYS.TASKS, tasks, getTimeProvider().now() - start, true);
44390
44249
  } catch (e) {
44391
- return failOutput(PIPELINE_STATE_KEYS.TASKS, String(e), getTimeProvider().now() - start);
44250
+ return failOutput(PIPELINE_STATE_KEYS.TASKS, getErrorMessage(e), getTimeProvider().now() - start);
44392
44251
  }
44393
44252
  }
44394
44253
  };
@@ -44404,7 +44263,7 @@ function createImplementStageWrapper(stages) {
44404
44263
  const results = await Promise.all(tasks.map((t) => stages.implement(t)));
44405
44264
  return output(PIPELINE_STATE_KEYS.IMPLEMENTATIONS, results, getTimeProvider().now() - start, true);
44406
44265
  } catch (e) {
44407
- return failOutput(PIPELINE_STATE_KEYS.IMPLEMENTATIONS, String(e), getTimeProvider().now() - start);
44266
+ return failOutput(PIPELINE_STATE_KEYS.IMPLEMENTATIONS, getErrorMessage(e), getTimeProvider().now() - start);
44408
44267
  }
44409
44268
  }
44410
44269
  };
@@ -44422,7 +44281,7 @@ function createQaStageWrapper(stages) {
44422
44281
  const allPass = reviews.every((r) => r.verdict === "pass");
44423
44282
  return output(PIPELINE_STATE_KEYS.QA_ITERATIONS, reviews, getTimeProvider().now() - start, allPass);
44424
44283
  } catch (e) {
44425
- return failOutput(PIPELINE_STATE_KEYS.QA_ITERATIONS, String(e), getTimeProvider().now() - start);
44284
+ return failOutput(PIPELINE_STATE_KEYS.QA_ITERATIONS, getErrorMessage(e), getTimeProvider().now() - start);
44426
44285
  }
44427
44286
  }
44428
44287
  };
@@ -44442,7 +44301,7 @@ function createSecurityStageWrapper(stages) {
44442
44301
  result.passed
44443
44302
  );
44444
44303
  } catch (e) {
44445
- return failOutput(PIPELINE_STATE_KEYS.SECURITY_PASSED, String(e), getTimeProvider().now() - start);
44304
+ return failOutput(PIPELINE_STATE_KEYS.SECURITY_PASSED, getErrorMessage(e), getTimeProvider().now() - start);
44446
44305
  }
44447
44306
  }
44448
44307
  };
@@ -44535,7 +44394,7 @@ function createAnalyzeStageWrapper() {
44535
44394
  const summary = `Language: ${String(analysis.language)}, Framework: ${String(analysis.framework)}, CI: ${String(analysis.ciProvider)}, Security: ${analysis.securityTooling.join(", ") || "none"}`;
44536
44395
  return output(PIPELINE_STATE_KEYS.RESEARCH, summary, getTimeProvider().now() - start, true);
44537
44396
  } catch (e) {
44538
- return failOutput(PIPELINE_STATE_KEYS.RESEARCH, String(e), getTimeProvider().now() - start);
44397
+ return failOutput(PIPELINE_STATE_KEYS.RESEARCH, getErrorMessage(e), getTimeProvider().now() - start);
44539
44398
  }
44540
44399
  }
44541
44400
  };
@@ -44556,7 +44415,7 @@ function createScanStageWrapper() {
44556
44415
  }
44557
44416
  return output(PIPELINE_STATE_KEYS.FINDINGS, "No repository to scan", getTimeProvider().now() - start, true);
44558
44417
  } catch (e) {
44559
- return failOutput(PIPELINE_STATE_KEYS.FINDINGS, String(e), getTimeProvider().now() - start);
44418
+ return failOutput(PIPELINE_STATE_KEYS.FINDINGS, getErrorMessage(e), getTimeProvider().now() - start);
44560
44419
  }
44561
44420
  }
44562
44421
  };
@@ -51746,16 +51605,6 @@ export {
51746
51605
  registerResearchSynthesizeTool,
51747
51606
  IssueTriageInputSchema,
51748
51607
  registerIssueTriageTool,
51749
- MAX_STRIPPED_ELEMENTS_PER_EVENT,
51750
- AuditTrail,
51751
- emitTrustEvent,
51752
- emitPolicyEvent,
51753
- emitCorroborationEvent,
51754
- emitReputationEvent,
51755
- emitSanitizationEvent,
51756
- emitGraphExecutionEvent,
51757
- createGraphAuditBridge,
51758
- createAuditTrail,
51759
51608
  RunGraphWorkflowInputSchema,
51760
51609
  registerRunGraphWorkflowTool,
51761
51610
  parseSpec,
@@ -51879,4 +51728,4 @@ export {
51879
51728
  detectBackend,
51880
51729
  createTaskTracker
51881
51730
  };
51882
- //# sourceMappingURL=chunk-7UPXKDF2.js.map
51731
+ //# sourceMappingURL=chunk-4LEUIAYB.js.map