nexus-agents 4.1.4 → 4.2.1
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-VOLQTAV4.js → chunk-5DED5UHM.js} +9 -3
- package/dist/chunk-5DED5UHM.js.map +1 -0
- package/dist/{chunk-CKOUOEK2.js → chunk-AY6EN765.js} +239 -198
- package/dist/chunk-AY6EN765.js.map +1 -0
- package/dist/{chunk-WXCRNJNO.js → chunk-CIQJIBGF.js} +2 -2
- package/dist/{chunk-PQPAB7C5.js → chunk-O3AZI3X2.js} +2 -2
- package/dist/{chunk-QJKXF2MY.js → chunk-PAGVGHWL.js} +2 -2
- package/dist/{chunk-GSUC22YA.js → chunk-U53YMCSE.js} +3 -3
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-U3OPVEUE.js → consensus-vote-ULN3XOCN.js} +3 -3
- package/dist/{improvement-review-KTOY6EEF.js → improvement-review-HU7P73SL.js} +3 -3
- package/dist/index.js +6 -6
- package/dist/{setup-command-RQKGR4EX.js → setup-command-RS4NCQIB.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-CKOUOEK2.js.map +0 -1
- package/dist/chunk-VOLQTAV4.js.map +0 -1
- /package/dist/{chunk-WXCRNJNO.js.map → chunk-CIQJIBGF.js.map} +0 -0
- /package/dist/{chunk-PQPAB7C5.js.map → chunk-O3AZI3X2.js.map} +0 -0
- /package/dist/{chunk-QJKXF2MY.js.map → chunk-PAGVGHWL.js.map} +0 -0
- /package/dist/{chunk-GSUC22YA.js.map → chunk-U53YMCSE.js.map} +0 -0
- /package/dist/{consensus-vote-U3OPVEUE.js.map → consensus-vote-ULN3XOCN.js.map} +0 -0
- /package/dist/{improvement-review-KTOY6EEF.js.map → improvement-review-HU7P73SL.js.map} +0 -0
- /package/dist/{setup-command-RQKGR4EX.js.map → setup-command-RS4NCQIB.js.map} +0 -0
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
24
24
|
clampTaskTtl
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-U53YMCSE.js";
|
|
26
26
|
import {
|
|
27
27
|
executeExpert
|
|
28
28
|
} from "./chunk-4Z2Z52C7.js";
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
simulationDeniedResult,
|
|
47
47
|
toJobSummary,
|
|
48
48
|
writeJobCancelled
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-PAGVGHWL.js";
|
|
50
50
|
import {
|
|
51
51
|
allOf
|
|
52
52
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-5HPJB35V.js";
|
|
64
64
|
import {
|
|
65
65
|
withPrerequisite
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-CIQJIBGF.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-
|
|
90
|
+
} from "./chunk-5DED5UHM.js";
|
|
91
91
|
import {
|
|
92
92
|
createAuditTrail,
|
|
93
93
|
createGraphAuditBridge,
|
|
@@ -45931,7 +45931,7 @@ ${contextBlock}`;
|
|
|
45931
45931
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
45932
45932
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
45933
45933
|
try {
|
|
45934
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
45934
|
+
const { executeVoting } = await import("./consensus-vote-ULN3XOCN.js");
|
|
45935
45935
|
const votingResult = await executeVoting(
|
|
45936
45936
|
{
|
|
45937
45937
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -48663,102 +48663,101 @@ function registerSuggestResearchTasksTool(server, deps) {
|
|
|
48663
48663
|
import { z as z107 } from "zod";
|
|
48664
48664
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
48665
48665
|
|
|
48666
|
-
// src/orchestration/meta-
|
|
48667
|
-
|
|
48668
|
-
|
|
48669
|
-
|
|
48670
|
-
|
|
48671
|
-
|
|
48672
|
-
|
|
48673
|
-
|
|
48674
|
-
|
|
48675
|
-
|
|
48676
|
-
|
|
48677
|
-
const { pipelineType } = classification;
|
|
48678
|
-
const selection = selectStrategyByManifest({
|
|
48679
|
-
pattern,
|
|
48680
|
-
pipelineType,
|
|
48681
|
-
complexity: analysis.complexity
|
|
48682
|
-
});
|
|
48683
|
-
if (selection === void 0) {
|
|
48684
|
-
const fallback = "orchestrate";
|
|
48685
|
-
return {
|
|
48686
|
-
strategy: fallback,
|
|
48687
|
-
reasoning: `No manifest rule matched pattern "${pattern}" \u2014 structural fallback to ${fallback}`,
|
|
48688
|
-
confidence: routing.confidence,
|
|
48689
|
-
manifestId: fallback,
|
|
48690
|
-
manifestSchemaVersion: 0
|
|
48691
|
-
};
|
|
48666
|
+
// src/orchestration/meta-dispatcher.ts
|
|
48667
|
+
var MetaDispatchError = class extends Error {
|
|
48668
|
+
code;
|
|
48669
|
+
strategy;
|
|
48670
|
+
decisionId;
|
|
48671
|
+
constructor(code, strategy, decisionId, message, options) {
|
|
48672
|
+
super(message, options);
|
|
48673
|
+
this.name = "MetaDispatchError";
|
|
48674
|
+
this.code = code;
|
|
48675
|
+
this.strategy = strategy;
|
|
48676
|
+
this.decisionId = decisionId;
|
|
48692
48677
|
}
|
|
48693
|
-
|
|
48678
|
+
};
|
|
48679
|
+
function createAuditLogOutcomeSink(logger59) {
|
|
48694
48680
|
return {
|
|
48695
|
-
|
|
48696
|
-
|
|
48697
|
-
|
|
48698
|
-
manifestId: selection.manifest.id,
|
|
48699
|
-
manifestSchemaVersion: selection.manifest.schemaVersion
|
|
48681
|
+
recordOutcome(record) {
|
|
48682
|
+
logger59.info("MetaDispatcher execution outcome", { ...record });
|
|
48683
|
+
}
|
|
48700
48684
|
};
|
|
48701
48685
|
}
|
|
48702
|
-
function
|
|
48703
|
-
|
|
48704
|
-
pattern: routing.pattern,
|
|
48705
|
-
pipelineType: classification.pipelineType,
|
|
48706
|
-
complexity: routing.analysis.complexity
|
|
48707
|
-
});
|
|
48708
|
-
return ranked.filter((s) => s !== chosen);
|
|
48686
|
+
function errorMessage(err2) {
|
|
48687
|
+
return err2 instanceof Error ? err2.message : String(err2);
|
|
48709
48688
|
}
|
|
48710
|
-
|
|
48711
|
-
|
|
48712
|
-
|
|
48713
|
-
|
|
48714
|
-
|
|
48715
|
-
|
|
48716
|
-
|
|
48717
|
-
...
|
|
48689
|
+
function recordOutcome2(deps, decision, start, success, failureReason) {
|
|
48690
|
+
const record = {
|
|
48691
|
+
decisionId: decision.decisionId,
|
|
48692
|
+
timestamp: new Date(getTimeProvider().now()).toISOString(),
|
|
48693
|
+
strategy: decision.strategy,
|
|
48694
|
+
success,
|
|
48695
|
+
durationMs: Math.max(0, getTimeProvider().now() - start),
|
|
48696
|
+
...failureReason !== void 0 ? { failureReason } : {}
|
|
48718
48697
|
};
|
|
48698
|
+
deps.outcomeSink.recordOutcome(record);
|
|
48699
|
+
if (deps.onOutcome !== void 0) {
|
|
48700
|
+
try {
|
|
48701
|
+
deps.onOutcome(record, decision);
|
|
48702
|
+
} catch (err2) {
|
|
48703
|
+
deps.logger.warn("MetaDispatcher onOutcome observer threw (ignored)", {
|
|
48704
|
+
decisionId: decision.decisionId,
|
|
48705
|
+
error: errorMessage(err2)
|
|
48706
|
+
});
|
|
48707
|
+
}
|
|
48708
|
+
}
|
|
48719
48709
|
}
|
|
48720
|
-
function
|
|
48721
|
-
const
|
|
48722
|
-
|
|
48723
|
-
|
|
48724
|
-
|
|
48725
|
-
|
|
48726
|
-
|
|
48727
|
-
|
|
48728
|
-
|
|
48729
|
-
|
|
48730
|
-
|
|
48731
|
-
|
|
48710
|
+
async function dispatchDecision(decision, input, deps) {
|
|
48711
|
+
const { strategy, decisionId } = decision;
|
|
48712
|
+
const start = getTimeProvider().now();
|
|
48713
|
+
const executor = deps.executors[strategy];
|
|
48714
|
+
if (executor === void 0) {
|
|
48715
|
+
const reason = `No executor registered for strategy "${strategy}"`;
|
|
48716
|
+
recordOutcome2(deps, decision, start, false, reason);
|
|
48717
|
+
deps.logger.error("MetaDispatcher dispatch failed", void 0, {
|
|
48718
|
+
decisionId,
|
|
48719
|
+
strategy,
|
|
48720
|
+
reason
|
|
48721
|
+
});
|
|
48722
|
+
throw new MetaDispatchError("no_executor", strategy, decisionId, reason);
|
|
48723
|
+
}
|
|
48724
|
+
try {
|
|
48725
|
+
const result = await executor(decision, input);
|
|
48726
|
+
recordOutcome2(deps, decision, start, true);
|
|
48727
|
+
return {
|
|
48728
|
+
decisionId,
|
|
48729
|
+
strategy,
|
|
48730
|
+
durationMs: Math.max(0, getTimeProvider().now() - start),
|
|
48731
|
+
result
|
|
48732
|
+
};
|
|
48733
|
+
} catch (err2) {
|
|
48734
|
+
const reason = errorMessage(err2);
|
|
48735
|
+
recordOutcome2(deps, decision, start, false, reason);
|
|
48736
|
+
deps.logger.error(
|
|
48737
|
+
"MetaDispatcher strategy executor threw",
|
|
48738
|
+
err2 instanceof Error ? err2 : void 0,
|
|
48739
|
+
{
|
|
48740
|
+
decisionId,
|
|
48741
|
+
strategy,
|
|
48742
|
+
reason
|
|
48743
|
+
}
|
|
48744
|
+
);
|
|
48745
|
+
throw new MetaDispatchError("executor_failed", strategy, decisionId, reason, { cause: err2 });
|
|
48746
|
+
}
|
|
48732
48747
|
}
|
|
48733
|
-
function
|
|
48734
|
-
const
|
|
48735
|
-
const
|
|
48736
|
-
|
|
48737
|
-
|
|
48738
|
-
|
|
48739
|
-
|
|
48740
|
-
|
|
48741
|
-
needsShaping,
|
|
48742
|
-
manifestId: core.manifestId,
|
|
48743
|
-
manifestSchemaVersion: core.manifestSchemaVersion,
|
|
48744
|
-
...needsShaping && routing.suggestedQuestions !== void 0 ? { shapingQuestions: routing.suggestedQuestions } : {},
|
|
48745
|
-
...subSignals(routing, classification)
|
|
48748
|
+
function createMetaDispatcher(options) {
|
|
48749
|
+
const logger59 = options.logger ?? createLogger({ component: "MetaDispatcher" });
|
|
48750
|
+
const outcomeSink = options.outcomeSink ?? createAuditLogOutcomeSink(logger59);
|
|
48751
|
+
const deps = {
|
|
48752
|
+
executors: options.executors,
|
|
48753
|
+
outcomeSink,
|
|
48754
|
+
logger: logger59,
|
|
48755
|
+
onOutcome: options.onOutcome
|
|
48746
48756
|
};
|
|
48747
|
-
}
|
|
48748
|
-
function toRecord(decision, goal, forced, timestamp) {
|
|
48749
48757
|
return {
|
|
48750
|
-
|
|
48751
|
-
|
|
48752
|
-
|
|
48753
|
-
strategy: decision.strategy,
|
|
48754
|
-
confidence: decision.confidence,
|
|
48755
|
-
pattern: decision.pattern,
|
|
48756
|
-
pipelineType: decision.pipelineType,
|
|
48757
|
-
alternatives: decision.alternatives,
|
|
48758
|
-
needsShaping: decision.needsShaping,
|
|
48759
|
-
forced,
|
|
48760
|
-
manifestId: decision.manifestId,
|
|
48761
|
-
manifestSchemaVersion: decision.manifestSchemaVersion
|
|
48758
|
+
dispatch(decision, input) {
|
|
48759
|
+
return dispatchDecision(decision, input, deps);
|
|
48760
|
+
}
|
|
48762
48761
|
};
|
|
48763
48762
|
}
|
|
48764
48763
|
|
|
@@ -48855,6 +48854,129 @@ function guardExecuteEnvelope(strategy) {
|
|
|
48855
48854
|
return decision.envelope;
|
|
48856
48855
|
}
|
|
48857
48856
|
|
|
48857
|
+
// src/mcp/tools/run-tool-dry-run.ts
|
|
48858
|
+
var DRY_RUN_CAPABLE = "dev-pipeline";
|
|
48859
|
+
var DryRunUnsupportedError = class extends Error {
|
|
48860
|
+
constructor(strategy) {
|
|
48861
|
+
super(
|
|
48862
|
+
`dryRun is not supported by the '${strategy}' strategy \u2014 only '${DRY_RUN_CAPABLE}' stops after plan+vote. Refusing rather than running for real. Re-run without dryRun, or force the ${DRY_RUN_CAPABLE} strategy.`
|
|
48863
|
+
);
|
|
48864
|
+
this.strategy = strategy;
|
|
48865
|
+
this.name = "DryRunUnsupportedError";
|
|
48866
|
+
}
|
|
48867
|
+
strategy;
|
|
48868
|
+
};
|
|
48869
|
+
function assertDryRunSupported(dryRun, strategy) {
|
|
48870
|
+
if (dryRun === true && strategy !== DRY_RUN_CAPABLE) {
|
|
48871
|
+
throw new DryRunUnsupportedError(strategy);
|
|
48872
|
+
}
|
|
48873
|
+
}
|
|
48874
|
+
function classifyDispatchError(err2) {
|
|
48875
|
+
const noExecutor = err2 instanceof MetaDispatchError && err2.code === "no_executor";
|
|
48876
|
+
const refused = err2 instanceof AuthorityRefusalError;
|
|
48877
|
+
const dryRunUnsupported = err2 instanceof DryRunUnsupportedError;
|
|
48878
|
+
return noExecutor || refused || dryRunUnsupported ? "business" : "internal";
|
|
48879
|
+
}
|
|
48880
|
+
|
|
48881
|
+
// src/orchestration/meta-orchestrator.ts
|
|
48882
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
48883
|
+
|
|
48884
|
+
// src/orchestration/meta-orchestrator-routing.ts
|
|
48885
|
+
function reasoningFor(selection, routing) {
|
|
48886
|
+
const { manifest, rule } = selection;
|
|
48887
|
+
const cause = rule.pipelineTypes !== void 0 && rule.patterns === void 0 ? `pipeline template "${rule.pipelineTypes.join("/")}"` : rule.pipelineTypes !== void 0 ? `pipeline template "${rule.pipelineTypes.join("/")}" under pattern "${routing.pattern}"` : `pattern "${routing.pattern}"`;
|
|
48888
|
+
return `${cause} \u2192 ${manifest.strategy} (manifest ${manifest.id}; ${routing.reasoning})`;
|
|
48889
|
+
}
|
|
48890
|
+
function decideStrategy(routing, classification) {
|
|
48891
|
+
const { pattern, analysis } = routing;
|
|
48892
|
+
const { pipelineType } = classification;
|
|
48893
|
+
const selection = selectStrategyByManifest({
|
|
48894
|
+
pattern,
|
|
48895
|
+
pipelineType,
|
|
48896
|
+
complexity: analysis.complexity
|
|
48897
|
+
});
|
|
48898
|
+
if (selection === void 0) {
|
|
48899
|
+
const fallback = "orchestrate";
|
|
48900
|
+
return {
|
|
48901
|
+
strategy: fallback,
|
|
48902
|
+
reasoning: `No manifest rule matched pattern "${pattern}" \u2014 structural fallback to ${fallback}`,
|
|
48903
|
+
confidence: routing.confidence,
|
|
48904
|
+
manifestId: fallback,
|
|
48905
|
+
manifestSchemaVersion: 0
|
|
48906
|
+
};
|
|
48907
|
+
}
|
|
48908
|
+
const fromTemplate = selection.rule.pipelineTypes !== void 0;
|
|
48909
|
+
return {
|
|
48910
|
+
strategy: selection.strategy,
|
|
48911
|
+
reasoning: reasoningFor(selection, routing),
|
|
48912
|
+
confidence: fromTemplate ? classification.confidence : routing.confidence,
|
|
48913
|
+
manifestId: selection.manifest.id,
|
|
48914
|
+
manifestSchemaVersion: selection.manifest.schemaVersion
|
|
48915
|
+
};
|
|
48916
|
+
}
|
|
48917
|
+
function buildAlternatives(chosen, routing, classification) {
|
|
48918
|
+
const ranked = rankStrategiesByManifest({
|
|
48919
|
+
pattern: routing.pattern,
|
|
48920
|
+
pipelineType: classification.pipelineType,
|
|
48921
|
+
complexity: routing.analysis.complexity
|
|
48922
|
+
});
|
|
48923
|
+
return ranked.filter((s) => s !== chosen);
|
|
48924
|
+
}
|
|
48925
|
+
|
|
48926
|
+
// src/orchestration/meta-orchestrator-decision.ts
|
|
48927
|
+
function subSignals(routing, classification) {
|
|
48928
|
+
return {
|
|
48929
|
+
pattern: routing.pattern,
|
|
48930
|
+
pipelineType: classification.pipelineType,
|
|
48931
|
+
analysis: routing.analysis,
|
|
48932
|
+
...routing.capabilityGaps !== void 0 ? { capabilityGaps: routing.capabilityGaps } : {}
|
|
48933
|
+
};
|
|
48934
|
+
}
|
|
48935
|
+
function buildForcedDecision(forced, routing, classification) {
|
|
48936
|
+
const manifest = getStrategyManifest(forced);
|
|
48937
|
+
return {
|
|
48938
|
+
strategy: forced,
|
|
48939
|
+
reasoning: `Strategy forced by caller: ${forced} (entrypoint ${entrypointToolFor(forced)})`,
|
|
48940
|
+
confidence: 1,
|
|
48941
|
+
alternatives: buildAlternatives(forced, routing, classification),
|
|
48942
|
+
needsShaping: false,
|
|
48943
|
+
manifestId: manifest?.id ?? forced,
|
|
48944
|
+
manifestSchemaVersion: manifest?.schemaVersion ?? 0,
|
|
48945
|
+
...subSignals(routing, classification)
|
|
48946
|
+
};
|
|
48947
|
+
}
|
|
48948
|
+
function buildSelectedDecision(routing, classification) {
|
|
48949
|
+
const core = decideStrategy(routing, classification);
|
|
48950
|
+
const needsShaping = routing.needsClarification === true;
|
|
48951
|
+
return {
|
|
48952
|
+
strategy: core.strategy,
|
|
48953
|
+
reasoning: core.reasoning,
|
|
48954
|
+
confidence: core.confidence,
|
|
48955
|
+
alternatives: buildAlternatives(core.strategy, routing, classification),
|
|
48956
|
+
needsShaping,
|
|
48957
|
+
manifestId: core.manifestId,
|
|
48958
|
+
manifestSchemaVersion: core.manifestSchemaVersion,
|
|
48959
|
+
...needsShaping && routing.suggestedQuestions !== void 0 ? { shapingQuestions: routing.suggestedQuestions } : {},
|
|
48960
|
+
...subSignals(routing, classification)
|
|
48961
|
+
};
|
|
48962
|
+
}
|
|
48963
|
+
function toRecord(decision, goal, forced, timestamp) {
|
|
48964
|
+
return {
|
|
48965
|
+
decisionId: decision.decisionId,
|
|
48966
|
+
timestamp,
|
|
48967
|
+
goal,
|
|
48968
|
+
strategy: decision.strategy,
|
|
48969
|
+
confidence: decision.confidence,
|
|
48970
|
+
pattern: decision.pattern,
|
|
48971
|
+
pipelineType: decision.pipelineType,
|
|
48972
|
+
alternatives: decision.alternatives,
|
|
48973
|
+
needsShaping: decision.needsShaping,
|
|
48974
|
+
forced,
|
|
48975
|
+
manifestId: decision.manifestId,
|
|
48976
|
+
manifestSchemaVersion: decision.manifestSchemaVersion
|
|
48977
|
+
};
|
|
48978
|
+
}
|
|
48979
|
+
|
|
48858
48980
|
// src/orchestration/meta-orchestrator.ts
|
|
48859
48981
|
function createAuditLogSink(logger59) {
|
|
48860
48982
|
return {
|
|
@@ -49417,104 +49539,6 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
|
|
|
49417
49539
|
return { ready: blockers.length === 0, criteria, blockers };
|
|
49418
49540
|
}
|
|
49419
49541
|
|
|
49420
|
-
// src/orchestration/meta-dispatcher.ts
|
|
49421
|
-
var MetaDispatchError = class extends Error {
|
|
49422
|
-
code;
|
|
49423
|
-
strategy;
|
|
49424
|
-
decisionId;
|
|
49425
|
-
constructor(code, strategy, decisionId, message, options) {
|
|
49426
|
-
super(message, options);
|
|
49427
|
-
this.name = "MetaDispatchError";
|
|
49428
|
-
this.code = code;
|
|
49429
|
-
this.strategy = strategy;
|
|
49430
|
-
this.decisionId = decisionId;
|
|
49431
|
-
}
|
|
49432
|
-
};
|
|
49433
|
-
function createAuditLogOutcomeSink(logger59) {
|
|
49434
|
-
return {
|
|
49435
|
-
recordOutcome(record) {
|
|
49436
|
-
logger59.info("MetaDispatcher execution outcome", { ...record });
|
|
49437
|
-
}
|
|
49438
|
-
};
|
|
49439
|
-
}
|
|
49440
|
-
function errorMessage(err2) {
|
|
49441
|
-
return err2 instanceof Error ? err2.message : String(err2);
|
|
49442
|
-
}
|
|
49443
|
-
function recordOutcome2(deps, decision, start, success, failureReason) {
|
|
49444
|
-
const record = {
|
|
49445
|
-
decisionId: decision.decisionId,
|
|
49446
|
-
timestamp: new Date(getTimeProvider().now()).toISOString(),
|
|
49447
|
-
strategy: decision.strategy,
|
|
49448
|
-
success,
|
|
49449
|
-
durationMs: Math.max(0, getTimeProvider().now() - start),
|
|
49450
|
-
...failureReason !== void 0 ? { failureReason } : {}
|
|
49451
|
-
};
|
|
49452
|
-
deps.outcomeSink.recordOutcome(record);
|
|
49453
|
-
if (deps.onOutcome !== void 0) {
|
|
49454
|
-
try {
|
|
49455
|
-
deps.onOutcome(record, decision);
|
|
49456
|
-
} catch (err2) {
|
|
49457
|
-
deps.logger.warn("MetaDispatcher onOutcome observer threw (ignored)", {
|
|
49458
|
-
decisionId: decision.decisionId,
|
|
49459
|
-
error: errorMessage(err2)
|
|
49460
|
-
});
|
|
49461
|
-
}
|
|
49462
|
-
}
|
|
49463
|
-
}
|
|
49464
|
-
async function dispatchDecision(decision, input, deps) {
|
|
49465
|
-
const { strategy, decisionId } = decision;
|
|
49466
|
-
const start = getTimeProvider().now();
|
|
49467
|
-
const executor = deps.executors[strategy];
|
|
49468
|
-
if (executor === void 0) {
|
|
49469
|
-
const reason = `No executor registered for strategy "${strategy}"`;
|
|
49470
|
-
recordOutcome2(deps, decision, start, false, reason);
|
|
49471
|
-
deps.logger.error("MetaDispatcher dispatch failed", void 0, {
|
|
49472
|
-
decisionId,
|
|
49473
|
-
strategy,
|
|
49474
|
-
reason
|
|
49475
|
-
});
|
|
49476
|
-
throw new MetaDispatchError("no_executor", strategy, decisionId, reason);
|
|
49477
|
-
}
|
|
49478
|
-
try {
|
|
49479
|
-
const result = await executor(decision, input);
|
|
49480
|
-
recordOutcome2(deps, decision, start, true);
|
|
49481
|
-
return {
|
|
49482
|
-
decisionId,
|
|
49483
|
-
strategy,
|
|
49484
|
-
durationMs: Math.max(0, getTimeProvider().now() - start),
|
|
49485
|
-
result
|
|
49486
|
-
};
|
|
49487
|
-
} catch (err2) {
|
|
49488
|
-
const reason = errorMessage(err2);
|
|
49489
|
-
recordOutcome2(deps, decision, start, false, reason);
|
|
49490
|
-
deps.logger.error(
|
|
49491
|
-
"MetaDispatcher strategy executor threw",
|
|
49492
|
-
err2 instanceof Error ? err2 : void 0,
|
|
49493
|
-
{
|
|
49494
|
-
decisionId,
|
|
49495
|
-
strategy,
|
|
49496
|
-
reason
|
|
49497
|
-
}
|
|
49498
|
-
);
|
|
49499
|
-
throw new MetaDispatchError("executor_failed", strategy, decisionId, reason, { cause: err2 });
|
|
49500
|
-
}
|
|
49501
|
-
}
|
|
49502
|
-
function createMetaDispatcher(options) {
|
|
49503
|
-
const logger59 = options.logger ?? createLogger({ component: "MetaDispatcher" });
|
|
49504
|
-
const outcomeSink = options.outcomeSink ?? createAuditLogOutcomeSink(logger59);
|
|
49505
|
-
const deps = {
|
|
49506
|
-
executors: options.executors,
|
|
49507
|
-
outcomeSink,
|
|
49508
|
-
logger: logger59,
|
|
49509
|
-
onOutcome: options.onOutcome
|
|
49510
|
-
};
|
|
49511
|
-
return {
|
|
49512
|
-
dispatch(decision, input) {
|
|
49513
|
-
return dispatchDecision(decision, input, deps);
|
|
49514
|
-
}
|
|
49515
|
-
};
|
|
49516
|
-
}
|
|
49517
|
-
|
|
49518
49542
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
49519
49543
|
import { z as z105 } from "zod";
|
|
49520
49544
|
import * as fs11 from "fs";
|
|
@@ -49770,8 +49794,11 @@ async function createStages(input, trustTier) {
|
|
|
49770
49794
|
}
|
|
49771
49795
|
});
|
|
49772
49796
|
}
|
|
49773
|
-
async function runDevPipelineForGoal(goal, trustTier) {
|
|
49774
|
-
const input = DevPipelineInputSchema.parse({
|
|
49797
|
+
async function runDevPipelineForGoal(goal, trustTier, dryRun) {
|
|
49798
|
+
const input = DevPipelineInputSchema.parse({
|
|
49799
|
+
task: goal,
|
|
49800
|
+
...dryRun !== void 0 ? { dryRun } : {}
|
|
49801
|
+
});
|
|
49775
49802
|
const stages = await createStages(input, trustTier);
|
|
49776
49803
|
return runDevPipeline(goal, stages, trustTier !== void 0 ? { trustTier } : void 0);
|
|
49777
49804
|
}
|
|
@@ -50131,6 +50158,21 @@ var RunInputSchema = z107.object({
|
|
|
50131
50158
|
execute: z107.boolean().optional().describe(
|
|
50132
50159
|
"When true, actually run the selected strategy (if an executor is wired) and return its result; otherwise return the routing decision only (default false, read-only)."
|
|
50133
50160
|
),
|
|
50161
|
+
/**
|
|
50162
|
+
* Plan and vote without implementing (#4806).
|
|
50163
|
+
*
|
|
50164
|
+
* `run` is the documented default entry point, but until now it could not
|
|
50165
|
+
* express the cautious caller's first request — "show me the plan, don't
|
|
50166
|
+
* build it". `execute: false` is not a substitute: that returns the SELECTED
|
|
50167
|
+
* STRATEGY, having done no planning and no voting.
|
|
50168
|
+
*
|
|
50169
|
+
* Only the dev-pipeline strategy can honour it. When the router selects any
|
|
50170
|
+
* other, the call is REFUSED rather than executed: silently ignoring a
|
|
50171
|
+
* do-not-act flag is the one outcome a governance substrate cannot allow.
|
|
50172
|
+
*/
|
|
50173
|
+
dryRun: z107.boolean().optional().describe(
|
|
50174
|
+
"Plan and vote only, no implementation (#4806). Requires the dev-pipeline strategy \u2014 refused (never silently executed) when the router selects another."
|
|
50175
|
+
),
|
|
50134
50176
|
/**
|
|
50135
50177
|
* Dispatch mode (#3732). Only meaningful with `execute: true` — `run`
|
|
50136
50178
|
* dispatches the heaviest engines (dev-pipeline/pipeline), which can exceed
|
|
@@ -50203,9 +50245,9 @@ function routeGoal(input, logger59) {
|
|
|
50203
50245
|
note: NOTE
|
|
50204
50246
|
};
|
|
50205
50247
|
}
|
|
50206
|
-
function buildDefaultExecutors(trustTier, gatewayAdapters) {
|
|
50248
|
+
function buildDefaultExecutors(trustTier, gatewayAdapters, dryRun) {
|
|
50207
50249
|
return {
|
|
50208
|
-
"dev-pipeline": (_decision, metaInput) => runDevPipelineForGoal(metaInput.goal, trustTier),
|
|
50250
|
+
"dev-pipeline": (_decision, metaInput) => runDevPipelineForGoal(metaInput.goal, trustTier, dryRun),
|
|
50209
50251
|
pipeline: (_decision, metaInput) => runPipelineForGoal(metaInput.goal),
|
|
50210
50252
|
// #3988: `research` deliberately ALIASES the `pipeline` engine — it runs the
|
|
50211
50253
|
// SAME generic stage registry (selectStageRegistry only branches greenfield/
|
|
@@ -50238,9 +50280,10 @@ function buildShadowTrainObserver(logger59) {
|
|
|
50238
50280
|
}
|
|
50239
50281
|
async function executeGoal(input, opts = {}) {
|
|
50240
50282
|
const decision = selectDecision(input, "execute", opts.logger);
|
|
50283
|
+
assertDryRunSupported(input.dryRun, decision.strategy);
|
|
50241
50284
|
const onOutcome = opts.onOutcome ?? buildShadowTrainObserver(opts.logger);
|
|
50242
50285
|
const dispatcher = createMetaDispatcher({
|
|
50243
|
-
executors: opts.executors ?? buildDefaultExecutors(opts.trustTier, opts.gatewayAdapters),
|
|
50286
|
+
executors: opts.executors ?? buildDefaultExecutors(opts.trustTier, opts.gatewayAdapters, input.dryRun),
|
|
50244
50287
|
...opts.logger !== void 0 ? { logger: opts.logger } : {},
|
|
50245
50288
|
...opts.outcomeSink !== void 0 ? { outcomeSink: opts.outcomeSink } : {},
|
|
50246
50289
|
...onOutcome !== void 0 ? { onOutcome } : {}
|
|
@@ -50306,10 +50349,8 @@ async function executeRunBody(input, logger59, trustTier, gatewayAdapters) {
|
|
|
50306
50349
|
}
|
|
50307
50350
|
return toolSuccess(JSON.stringify(exec2, null, 2));
|
|
50308
50351
|
} catch (err2) {
|
|
50309
|
-
const noExecutor = err2 instanceof MetaDispatchError && err2.code === "no_executor";
|
|
50310
|
-
const refused = err2 instanceof AuthorityRefusalError;
|
|
50311
50352
|
return toolStructuredError({
|
|
50312
|
-
errorCategory:
|
|
50353
|
+
errorCategory: classifyDispatchError(err2),
|
|
50313
50354
|
message: err2 instanceof Error ? err2.message : String(err2)
|
|
50314
50355
|
});
|
|
50315
50356
|
}
|
|
@@ -54456,4 +54497,4 @@ export {
|
|
|
54456
54497
|
shutdownFeedbackSubscriber,
|
|
54457
54498
|
createEventBusBridge
|
|
54458
54499
|
};
|
|
54459
|
-
//# sourceMappingURL=chunk-
|
|
54500
|
+
//# sourceMappingURL=chunk-AY6EN765.js.map
|