nexus-agents 4.27.0 → 4.29.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.
Files changed (27) hide show
  1. package/dist/{chunk-SZDSV6B3.js → chunk-5DWZM7IZ.js} +29 -5
  2. package/dist/chunk-5DWZM7IZ.js.map +1 -0
  3. package/dist/{chunk-5ONULRCG.js → chunk-B47QMLB7.js} +3 -3
  4. package/dist/{chunk-ONK6CIA6.js → chunk-F46BXFGJ.js} +18 -17
  5. package/dist/chunk-F46BXFGJ.js.map +1 -0
  6. package/dist/{chunk-JR6YCGDH.js → chunk-GS4XDYMP.js} +2 -2
  7. package/dist/{chunk-EXQUUAOP.js → chunk-ICEPRA5C.js} +58 -16
  8. package/dist/chunk-ICEPRA5C.js.map +1 -0
  9. package/dist/chunk-NTCW4HQT.js +7 -0
  10. package/dist/cli.js +24 -10
  11. package/dist/cli.js.map +1 -1
  12. package/dist/{consensus-vote-GR7YKMQ2.js → consensus-vote-4AQ2M3BH.js} +4 -4
  13. package/dist/{improvement-review-ONMDPXAY.js → improvement-review-5OH3FFGI.js} +4 -4
  14. package/dist/index.d.ts +31 -0
  15. package/dist/index.js +7 -7
  16. package/dist/{setup-data-dir-5624L2CE.js → setup-data-dir-EFQW6HDJ.js} +3 -3
  17. package/package.json +1 -1
  18. package/dist/chunk-EXQUUAOP.js.map +0 -1
  19. package/dist/chunk-ONK6CIA6.js.map +0 -1
  20. package/dist/chunk-PYJRRTUE.js +0 -7
  21. package/dist/chunk-SZDSV6B3.js.map +0 -1
  22. /package/dist/{chunk-5ONULRCG.js.map → chunk-B47QMLB7.js.map} +0 -0
  23. /package/dist/{chunk-JR6YCGDH.js.map → chunk-GS4XDYMP.js.map} +0 -0
  24. /package/dist/{chunk-PYJRRTUE.js.map → chunk-NTCW4HQT.js.map} +0 -0
  25. /package/dist/{consensus-vote-GR7YKMQ2.js.map → consensus-vote-4AQ2M3BH.js.map} +0 -0
  26. /package/dist/{improvement-review-ONMDPXAY.js.map → improvement-review-5OH3FFGI.js.map} +0 -0
  27. /package/dist/{setup-data-dir-5624L2CE.js.map → setup-data-dir-EFQW6HDJ.js.map} +0 -0
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-5ONULRCG.js";
24
+ } from "./chunk-B47QMLB7.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-XEGZYUPX.js";
@@ -46,7 +46,7 @@ import {
46
46
  simulationDeniedResult,
47
47
  toJobSummary,
48
48
  writeJobCancelled
49
- } from "./chunk-SZDSV6B3.js";
49
+ } from "./chunk-5DWZM7IZ.js";
50
50
  import {
51
51
  allOf
52
52
  } from "./chunk-OQB3XC5O.js";
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-UBWHBW7S.js";
64
64
  import {
65
65
  withPrerequisite
66
- } from "./chunk-ONK6CIA6.js";
66
+ } from "./chunk-F46BXFGJ.js";
67
67
  import {
68
68
  NOOP_NOTIFIER,
69
69
  RateLimiter,
@@ -87,7 +87,7 @@ import {
87
87
  withAuditTrail,
88
88
  withProgressHeartbeat,
89
89
  wrapToolWithTimeout
90
- } from "./chunk-JR6YCGDH.js";
90
+ } from "./chunk-GS4XDYMP.js";
91
91
  import {
92
92
  createAuditTrail,
93
93
  createGraphAuditBridge,
@@ -941,9 +941,21 @@ var NexusEnvSchema = z10.object({
941
941
  // NEXUS_EVENTBUS_MAX_HISTORY removed in #2977 — silent no-op (no production reader).
942
942
  NEXUS_BILLING_MODE: z10.enum(["plan", "api"]).optional(),
943
943
  NEXUS_CONFIG_PATH: z10.string().optional(),
944
+ // Explicit runtime data root; overrides the per-repo/cross-repo split. In
945
+ // CLAUDE.md's most-used table since it shipped, and absent from this schema
946
+ // until #4722 — so setting the documented variable made `validateNexusEnv`
947
+ // report it as an UNKNOWN NEXUS_* var, typo suggestion and all.
948
+ NEXUS_DATA_DIR: z10.string().optional(),
949
+ // `0` opts out of the per-repo data dir (epic #2872; default ON).
950
+ NEXUS_REPO_PREFERRED: z10.enum(["0", "1"]).optional(),
944
951
  // Scratch root for short-lived working files (#4412, getNexusTmpDir). Unset
945
952
  // resolves to `<dataDir>/tmp`; set it to relocate scratch off the repo.
946
953
  NEXUS_TMPDIR: z10.string().optional(),
954
+ // ClawGuard access-policy mode.
955
+ NEXUS_ACCESS_POLICY_MODE: z10.enum(["off", "audit", "confirm_risky", "enforce"]).optional(),
956
+ // Sandbox mode (epic #2500).
957
+ NEXUS_SANDBOX: boolStr.optional(),
958
+ NEXUS_SANDBOX_ROOT: z10.string().optional(),
947
959
  NEXUS_ALLOW_MOCK_ORCHESTRATION: boolStr.optional(),
948
960
  // Explicit opt-in for simulateVotes outside test runners (#4170) — read by
949
961
  // checkSimulationAllowed (mcp/tools/simulation-guard.ts). Unset = fail closed.
@@ -24440,12 +24452,15 @@ function createSimpleStepResult(step, startTime) {
24440
24452
  output: {
24441
24453
  action: step.action,
24442
24454
  agent: step.agent,
24443
- message: `Executed step ${step.id} with action ${step.action}`,
24455
+ message: `Step ${step.id} was NOT executed (mock executor)`,
24444
24456
  mock: true
24445
- // Indicates this was mock execution, not real
24446
24457
  },
24447
24458
  durationMs: getTimeProvider().now() - startTime,
24448
- status: "success"
24459
+ // 'skipped', not 'success' (#5116). A step that did not run did not
24460
+ // succeed, and `status` is the field a caller branches on — the `mock: true`
24461
+ // marker sits a level down in `output`, where nobody checking status looks.
24462
+ // This was the whole shape of the bug: unexecuted work reported as done.
24463
+ status: "skipped"
24449
24464
  };
24450
24465
  }
24451
24466
  function bridgeToWorkflowContext(parallelCtx, workflowId) {
@@ -24577,9 +24592,7 @@ function createMockStepExecutor(logger59) {
24577
24592
  function resolveStepExecutor(options) {
24578
24593
  const { logger: logger59, expertFactory, workflowId, useMockExecutor } = options;
24579
24594
  if (useMockExecutor === true) {
24580
- logger59.warn(
24581
- "useMockExecutor enabled; workflow steps will return mock results (NOT RECOMMENDED)"
24582
- );
24595
+ logger59.debug("Mock step executor installed; steps will report skipped, not executed");
24583
24596
  return createMockStepExecutor(logger59);
24584
24597
  }
24585
24598
  if (expertFactory !== void 0 && workflowId !== void 0) {
@@ -28792,7 +28805,9 @@ function getAllowedWorkflowDirs(deps) {
28792
28805
  }
28793
28806
  function deriveWorkflowStatus(steps) {
28794
28807
  if (steps.length === 0) return "failed";
28795
- return steps.some((s) => s.status === "failed") ? "failed" : "completed";
28808
+ if (steps.some((s) => s.status === "failed")) return "failed";
28809
+ if (!steps.some((s) => s.status === "success")) return "failed";
28810
+ return "completed";
28796
28811
  }
28797
28812
  function toStepResultSummary(result) {
28798
28813
  const summary = {
@@ -28950,15 +28965,35 @@ function formatValidationErrors(validation) {
28950
28965
 
28951
28966
  // src/mcp/tools/run-workflow.ts
28952
28967
  import { randomUUID as randomUUID8 } from "crypto";
28968
+ function resolveExecutionEngineOrError(deps, workflowName) {
28969
+ try {
28970
+ const resolve22 = deps.resolveExecutionEngine ?? (() => deps.workflowEngine);
28971
+ return { ok: true, value: resolve22() };
28972
+ } catch (error) {
28973
+ const message = error instanceof Error ? error.message : String(error);
28974
+ deps.logger?.error(
28975
+ "Workflow execution unavailable",
28976
+ error instanceof Error ? error : void 0,
28977
+ { workflowName }
28978
+ );
28979
+ return {
28980
+ ok: false,
28981
+ error: new WorkflowError(`Cannot execute workflow "${workflowName}": ${message}`)
28982
+ };
28983
+ }
28984
+ }
28953
28985
  async function executeWorkflow(deps, workflow, inputs, options) {
28954
- const { workflowEngine, logger: logger59 } = deps;
28986
+ const { logger: logger59 } = deps;
28987
+ const engineOrError = resolveExecutionEngineOrError(deps, workflow.name);
28988
+ if (!engineOrError.ok) return engineOrError;
28989
+ const executionEngine = engineOrError.value;
28955
28990
  logger59?.info("Executing workflow", {
28956
28991
  workflowName: workflow.name,
28957
28992
  inputCount: Object.keys(inputs).length,
28958
28993
  ...options?.phaseTimeoutMs !== void 0 ? { phaseTimeoutMs: options.phaseTimeoutMs } : {}
28959
28994
  });
28960
28995
  const startTime = getTimeProvider().now();
28961
- const result = options?.phaseTimeoutMs !== void 0 ? await workflowEngine.execute(workflow, inputs, { phaseTimeoutMs: options.phaseTimeoutMs }) : await workflowEngine.execute(workflow, inputs);
28996
+ const result = options?.phaseTimeoutMs !== void 0 ? await executionEngine.execute(workflow, inputs, { phaseTimeoutMs: options.phaseTimeoutMs }) : await executionEngine.execute(workflow, inputs);
28962
28997
  if (!result.ok) {
28963
28998
  logger59?.error("Workflow execution failed", result.error, {
28964
28999
  workflowName: workflow.name
@@ -44500,6 +44535,10 @@ function verifyEvent(event, index, priorHash) {
44500
44535
  }
44501
44536
  return null;
44502
44537
  }
44538
+ function withCoverage(verification, coverage) {
44539
+ if (!verification.ok) return verification;
44540
+ return { ...verification, coverage };
44541
+ }
44503
44542
  function verifyChain(events) {
44504
44543
  if (events.length === 0) return { ok: true, eventCount: 0, notVerified: "empty" };
44505
44544
  if (events[0]?.hash === void 0) {
@@ -47399,7 +47438,7 @@ ${contextBlock}`;
47399
47438
  const strategy = config.votingStrategy ?? "higher_order";
47400
47439
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47401
47440
  try {
47402
- const { executeVoting } = await import("./consensus-vote-GR7YKMQ2.js");
47441
+ const { executeVoting } = await import("./consensus-vote-4AQ2M3BH.js");
47403
47442
  const votingResult = await executeVoting(
47404
47443
  {
47405
47444
  proposal: buildVoteProposal(plan, research),
@@ -49984,7 +50023,10 @@ async function handler2(args, ctx) {
49984
50023
  resolvedDir,
49985
50024
  ctx.logger
49986
50025
  );
49987
- const verification = verifyChain(events);
50026
+ const verification = withCoverage(verifyChain(events), {
50027
+ skipped: skippedLines,
50028
+ unreadableFiles
50029
+ });
49988
50030
  const response = {
49989
50031
  logDir: resolvedDir,
49990
50032
  fileCount,
@@ -56021,4 +56063,4 @@ export {
56021
56063
  shutdownFeedbackSubscriber,
56022
56064
  createEventBusBridge
56023
56065
  };
56024
- //# sourceMappingURL=chunk-EXQUUAOP.js.map
56066
+ //# sourceMappingURL=chunk-ICEPRA5C.js.map