nexus-agents 8.20.2 → 8.20.3

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.
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-GUVJVLGX.js";
24
+ } from "./chunk-CNGNUYKN.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-C7CSLODO.js";
@@ -48,7 +48,7 @@ import {
48
48
  simulationDeniedResult,
49
49
  toJobSummary,
50
50
  writeJobCancelled
51
- } from "./chunk-XP7E6PUR.js";
51
+ } from "./chunk-GUIE7L3X.js";
52
52
  import {
53
53
  allOf
54
54
  } from "./chunk-OQB3XC5O.js";
@@ -67,7 +67,7 @@ import {
67
67
  } from "./chunk-ZUK5BG3Q.js";
68
68
  import {
69
69
  withPrerequisite
70
- } from "./chunk-Q4A3U4KA.js";
70
+ } from "./chunk-JTB5U4GT.js";
71
71
  import {
72
72
  NOOP_NOTIFIER,
73
73
  RateLimiter,
@@ -92,7 +92,7 @@ import {
92
92
  withAuditTrail,
93
93
  withProgressHeartbeat,
94
94
  wrapToolWithTimeout
95
- } from "./chunk-WIOKVM7I.js";
95
+ } from "./chunk-LIITF5SR.js";
96
96
  import {
97
97
  createAuditTrail,
98
98
  createGraphAuditBridge,
@@ -24288,6 +24288,12 @@ function buildFinalOutput(stepResults) {
24288
24288
  const successfulSteps = stepResults.filter((r) => r.status === "success");
24289
24289
  return successfulSteps.length === 0 ? null : successfulSteps[successfulSteps.length - 1]?.output ?? null;
24290
24290
  }
24291
+ function deriveWorkflowStatus(steps) {
24292
+ if (steps.length === 0) return "failed";
24293
+ if (steps.some((step) => step.status === "failed")) return "failed";
24294
+ if (!steps.some((step) => step.status === "success")) return "failed";
24295
+ return "completed";
24296
+ }
24291
24297
 
24292
24298
  // src/workflows/workflow-engine-execution.ts
24293
24299
  function createContextManagerForWorkflow(config, workflow, logger57) {
@@ -24442,9 +24448,18 @@ var WorkflowEngine = class {
24442
24448
  output: buildFinalOutput(stepResults.value),
24443
24449
  totalDurationMs: getTimeProvider().now() - startTime
24444
24450
  };
24445
- this.updateExecutionStatus(executionId, { state: "completed", result });
24451
+ this.storeExecutionResult(executionId, result);
24446
24452
  return ok(result);
24447
24453
  }
24454
+ storeExecutionResult(executionId, result) {
24455
+ const verdict = deriveWorkflowStatus(result.stepResults);
24456
+ if (verdict === "completed") {
24457
+ this.updateExecutionStatus(executionId, { state: verdict, result });
24458
+ return;
24459
+ }
24460
+ const error = result.stepResults.some((step) => step.status === "failed") ? "One or more workflow steps failed" : "No workflow step succeeded";
24461
+ this.updateExecutionStatus(executionId, { state: verdict, error });
24462
+ }
24448
24463
  handleExecutionError(error, executionId, workflowName) {
24449
24464
  const message = getErrorMessage(error);
24450
24465
  this.updateExecutionStatus(executionId, { state: "failed", error: message });
@@ -28961,12 +28976,6 @@ function getAllowedWorkflowDirs(deps) {
28961
28976
  }
28962
28977
  return allowedDirs;
28963
28978
  }
28964
- function deriveWorkflowStatus(steps) {
28965
- if (steps.length === 0) return "failed";
28966
- if (steps.some((s) => s.status === "failed")) return "failed";
28967
- if (!steps.some((s) => s.status === "success")) return "failed";
28968
- return "completed";
28969
- }
28970
28979
  function toStepResultSummary(result) {
28971
28980
  const summary = {
28972
28981
  stepId: result.stepId,
@@ -29162,12 +29171,14 @@ async function executeWorkflow(deps, workflow, inputs, options) {
29162
29171
  };
29163
29172
  }
29164
29173
  const workflowResult = result.value;
29165
- logger57?.info("Workflow completed", {
29174
+ const stepResults = workflowResult.stepResults.map(toStepResultSummary);
29175
+ const status = deriveWorkflowStatus(stepResults);
29176
+ logger57?.info("Workflow execution finished", {
29166
29177
  workflowName: workflow.name,
29167
29178
  durationMs: getTimeProvider().now() - startTime,
29168
- stepCount: workflowResult.stepResults.length
29179
+ stepCount: workflowResult.stepResults.length,
29180
+ status
29169
29181
  });
29170
- const stepResults = workflowResult.stepResults.map(toStepResultSummary);
29171
29182
  return {
29172
29183
  ok: true,
29173
29184
  value: {
@@ -29175,7 +29186,7 @@ async function executeWorkflow(deps, workflow, inputs, options) {
29175
29186
  workflowName: workflowResult.workflowName,
29176
29187
  // #4351: was hardcoded 'completed'. A run whose steps all failed —
29177
29188
  // e.g. every adapter out of capacity — reported success to the caller.
29178
- status: deriveWorkflowStatus(stepResults),
29189
+ status,
29179
29190
  stepResults,
29180
29191
  output: workflowResult.output,
29181
29192
  durationMs: workflowResult.totalDurationMs
@@ -29220,6 +29231,14 @@ function recordWorkflowError(template, errorMessage2) {
29220
29231
  });
29221
29232
  }
29222
29233
  }
29234
+ function recordWorkflowOutcome(template, result) {
29235
+ if (result.status === "completed") {
29236
+ recordWorkflowSuccess(template, result.stepResults.length, result.durationMs);
29237
+ return;
29238
+ }
29239
+ const reason = result.stepResults.some((step) => step.status === "failed") ? "did not complete: one or more steps failed" : "did not complete: no step succeeded";
29240
+ recordWorkflowError(template, reason);
29241
+ }
29223
29242
  function buildFailureEnvelope(workflowName, error) {
29224
29243
  const ctx = error.context;
29225
29244
  const executionId = typeof ctx?.["executionId"] === "string" ? ctx["executionId"] : void 0;
@@ -29259,11 +29278,7 @@ async function handleRunWorkflow(deps, args) {
29259
29278
  recordWorkflowError(template, executeResult.error.message);
29260
29279
  return buildFailureEnvelope(workflow.name, executeResult.error);
29261
29280
  }
29262
- recordWorkflowSuccess(
29263
- template,
29264
- executeResult.value.stepResults.length,
29265
- executeResult.value.durationMs
29266
- );
29281
+ recordWorkflowOutcome(template, executeResult.value);
29267
29282
  return successResponse(executeResult.value);
29268
29283
  }
29269
29284
  var toolInputSchema = RunWorkflowInputSchema.shape;
@@ -45946,7 +45961,7 @@ function buildVotingInput(plan, config) {
45946
45961
  }
45947
45962
  async function executeSingleVote(plan, config, log) {
45948
45963
  try {
45949
- const { executeVoting } = await import("./consensus-vote-NP7MGI54.js");
45964
+ const { executeVoting } = await import("./consensus-vote-QV4X3BGX.js");
45950
45965
  const input = buildVotingInput(plan, config);
45951
45966
  const result = await executeVoting(input, log);
45952
45967
  return parseVotingResult(result);
@@ -47718,7 +47733,7 @@ ${contextBlock}`;
47718
47733
  const strategy = config.votingStrategy ?? "higher_order";
47719
47734
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47720
47735
  try {
47721
- const { executeVoting } = await import("./consensus-vote-NP7MGI54.js");
47736
+ const { executeVoting } = await import("./consensus-vote-QV4X3BGX.js");
47722
47737
  const votingResult = await executeVoting(
47723
47738
  {
47724
47739
  proposal: buildVoteProposal(plan, research),
@@ -56403,4 +56418,4 @@ export {
56403
56418
  shutdownFeedbackSubscriber,
56404
56419
  createEventBusBridge
56405
56420
  };
56406
- //# sourceMappingURL=chunk-NXVN5DZX.js.map
56421
+ //# sourceMappingURL=chunk-6MZAL6NV.js.map