nexus-agents 8.20.1 → 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.
- package/dist/{chunk-UIML3UMD.js → chunk-6MZAL6NV.js} +58 -27
- package/dist/{chunk-UIML3UMD.js.map → chunk-6MZAL6NV.js.map} +1 -1
- package/dist/chunk-CAWA5U3J.js +7 -0
- package/dist/{chunk-4EJYBLQ3.js → chunk-CNGNUYKN.js} +3 -3
- package/dist/{chunk-RHKJBVSU.js → chunk-GUIE7L3X.js} +3 -3
- package/dist/{chunk-WYVDJAL5.js → chunk-JTB5U4GT.js} +2 -2
- package/dist/{chunk-DXE2DPT5.js → chunk-LIITF5SR.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-O2MXPQRL.js → consensus-vote-QV4X3BGX.js} +4 -4
- package/dist/{improvement-review-NJS2HJPQ.js → improvement-review-DY7DEU2W.js} +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-524NSTT3.js → setup-data-dir-2QND4HOR.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3ZPDWKYB.js +0 -7
- /package/dist/{chunk-3ZPDWKYB.js.map → chunk-CAWA5U3J.js.map} +0 -0
- /package/dist/{chunk-4EJYBLQ3.js.map → chunk-CNGNUYKN.js.map} +0 -0
- /package/dist/{chunk-RHKJBVSU.js.map → chunk-GUIE7L3X.js.map} +0 -0
- /package/dist/{chunk-WYVDJAL5.js.map → chunk-JTB5U4GT.js.map} +0 -0
- /package/dist/{chunk-DXE2DPT5.js.map → chunk-LIITF5SR.js.map} +0 -0
- /package/dist/{consensus-vote-O2MXPQRL.js.map → consensus-vote-QV4X3BGX.js.map} +0 -0
- /package/dist/{improvement-review-NJS2HJPQ.js.map → improvement-review-DY7DEU2W.js.map} +0 -0
- /package/dist/{setup-data-dir-524NSTT3.js.map → setup-data-dir-2QND4HOR.js.map} +0 -0
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
clampTaskTtl
|
|
24
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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;
|
|
@@ -29894,15 +29909,31 @@ function checkInterrupt(startTime, timeout, signal) {
|
|
|
29894
29909
|
return void 0;
|
|
29895
29910
|
}
|
|
29896
29911
|
async function runSuperStepLoop(graph, ctx, startTime, options) {
|
|
29897
|
-
const maxSteps = options
|
|
29898
|
-
const timeout = options?.timeout ?? DEFAULT_TIMEOUT_MS3;
|
|
29912
|
+
const { maxSteps, timeout, signal } = resolveLoopLimits(options);
|
|
29899
29913
|
while (ctx.runnableIds.length > 0 && ctx.stepsExecuted < maxSteps) {
|
|
29900
|
-
const aborted = checkInterrupt(startTime, timeout,
|
|
29914
|
+
const aborted = checkInterrupt(startTime, timeout, signal);
|
|
29901
29915
|
if (aborted !== void 0) return aborted;
|
|
29916
|
+
if (ctx.runnableIds.length > maxSteps - ctx.stepsExecuted) break;
|
|
29902
29917
|
await executeSuperStep(graph, ctx, options);
|
|
29903
29918
|
if (ctx.pendingInterrupt !== void 0) return void 0;
|
|
29904
29919
|
}
|
|
29905
|
-
return
|
|
29920
|
+
return maxStepsExhausted(ctx);
|
|
29921
|
+
}
|
|
29922
|
+
function resolveLoopLimits(options) {
|
|
29923
|
+
return {
|
|
29924
|
+
maxSteps: options?.maxSteps ?? DEFAULT_MAX_STEPS,
|
|
29925
|
+
timeout: options?.timeout ?? DEFAULT_TIMEOUT_MS3,
|
|
29926
|
+
signal: options?.signal
|
|
29927
|
+
};
|
|
29928
|
+
}
|
|
29929
|
+
function maxStepsExhausted(ctx) {
|
|
29930
|
+
if (ctx.runnableIds.length === 0) return void 0;
|
|
29931
|
+
const pendingIds = ctx.runnableIds.join(", ");
|
|
29932
|
+
return err(
|
|
29933
|
+
new Error(
|
|
29934
|
+
`maxSteps exhausted with ${String(ctx.runnableIds.length)} runnable node(s) pending: ${pendingIds}`
|
|
29935
|
+
)
|
|
29936
|
+
);
|
|
29906
29937
|
}
|
|
29907
29938
|
async function executeSuperStep(graph, ctx, options) {
|
|
29908
29939
|
emitNodeStarted(ctx, options);
|
|
@@ -45930,7 +45961,7 @@ function buildVotingInput(plan, config) {
|
|
|
45930
45961
|
}
|
|
45931
45962
|
async function executeSingleVote(plan, config, log) {
|
|
45932
45963
|
try {
|
|
45933
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
45964
|
+
const { executeVoting } = await import("./consensus-vote-QV4X3BGX.js");
|
|
45934
45965
|
const input = buildVotingInput(plan, config);
|
|
45935
45966
|
const result = await executeVoting(input, log);
|
|
45936
45967
|
return parseVotingResult(result);
|
|
@@ -47702,7 +47733,7 @@ ${contextBlock}`;
|
|
|
47702
47733
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47703
47734
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47704
47735
|
try {
|
|
47705
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47736
|
+
const { executeVoting } = await import("./consensus-vote-QV4X3BGX.js");
|
|
47706
47737
|
const votingResult = await executeVoting(
|
|
47707
47738
|
{
|
|
47708
47739
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -56387,4 +56418,4 @@ export {
|
|
|
56387
56418
|
shutdownFeedbackSubscriber,
|
|
56388
56419
|
createEventBusBridge
|
|
56389
56420
|
};
|
|
56390
|
-
//# sourceMappingURL=chunk-
|
|
56421
|
+
//# sourceMappingURL=chunk-6MZAL6NV.js.map
|