nexus-agents 2.122.0 → 2.123.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.
- package/dist/{chunk-CB5R4TVH.js → chunk-4LYJQQZZ.js} +2 -2
- package/dist/{chunk-K7P2ETJZ.js → chunk-AQJ3UWBM.js} +3 -3
- package/dist/{chunk-4REXP756.js → chunk-ARL5T2ES.js} +102 -3
- package/dist/chunk-ARL5T2ES.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{setup-command-4QAWJYW3.js → setup-command-IWO6XQCP.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4REXP756.js.map +0 -1
- /package/dist/{chunk-CB5R4TVH.js.map → chunk-4LYJQQZZ.js.map} +0 -0
- /package/dist/{chunk-K7P2ETJZ.js.map → chunk-AQJ3UWBM.js.map} +0 -0
- /package/dist/{setup-command-4QAWJYW3.js.map → setup-command-IWO6XQCP.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
checkSqlite,
|
|
9
9
|
defaultConfig,
|
|
10
10
|
initDataDirectories
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AQJ3UWBM.js";
|
|
12
12
|
import {
|
|
13
13
|
probeAllClis
|
|
14
14
|
} from "./chunk-3WNRZSHF.js";
|
|
@@ -2000,4 +2000,4 @@ export {
|
|
|
2000
2000
|
setupCommand,
|
|
2001
2001
|
setupCommandAsync
|
|
2002
2002
|
};
|
|
2003
|
-
//# sourceMappingURL=chunk-
|
|
2003
|
+
//# sourceMappingURL=chunk-4LYJQQZZ.js.map
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from "./chunk-CH7QIDHQ.js";
|
|
41
41
|
|
|
42
42
|
// src/version.ts
|
|
43
|
-
var VERSION = true ? "2.
|
|
43
|
+
var VERSION = true ? "2.123.0" : "dev";
|
|
44
44
|
|
|
45
45
|
// src/config/schemas-core.ts
|
|
46
46
|
import { z } from "zod";
|
|
@@ -2099,7 +2099,7 @@ async function runDoctorFix(result) {
|
|
|
2099
2099
|
writeLine2("\u2500".repeat(40));
|
|
2100
2100
|
let fixCount = 0;
|
|
2101
2101
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
2102
|
-
const { runSetup } = await import("./setup-command-
|
|
2102
|
+
const { runSetup } = await import("./setup-command-IWO6XQCP.js");
|
|
2103
2103
|
const setupResult = runSetup({
|
|
2104
2104
|
skipMcp: true,
|
|
2105
2105
|
skipRules: true,
|
|
@@ -2211,4 +2211,4 @@ export {
|
|
|
2211
2211
|
startStdioServer,
|
|
2212
2212
|
closeServer
|
|
2213
2213
|
};
|
|
2214
|
-
//# sourceMappingURL=chunk-
|
|
2214
|
+
//# sourceMappingURL=chunk-AQJ3UWBM.js.map
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
DEFAULT_TASK_TTL_MS,
|
|
124
124
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
125
125
|
clampTaskTtl
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-AQJ3UWBM.js";
|
|
127
127
|
import {
|
|
128
128
|
resolveInsideRoot
|
|
129
129
|
} from "./chunk-NUBSJGQZ.js";
|
|
@@ -176,6 +176,7 @@ import {
|
|
|
176
176
|
GRAPH_TIMEOUTS,
|
|
177
177
|
HEARTBEAT_TIMEOUTS,
|
|
178
178
|
INTERNAL_TIMEOUTS,
|
|
179
|
+
LinUCBBandit,
|
|
179
180
|
MCP_TIMEOUTS,
|
|
180
181
|
NexusError,
|
|
181
182
|
OrchestratorError,
|
|
@@ -44903,11 +44904,29 @@ function toRecord(decision, goal, forced, timestamp) {
|
|
|
44903
44904
|
forced
|
|
44904
44905
|
};
|
|
44905
44906
|
}
|
|
44907
|
+
function recordShadow(shadowSelector, shadowSink, decision, timestamp, logger56) {
|
|
44908
|
+
try {
|
|
44909
|
+
const learned = shadowSelector.predict(decision);
|
|
44910
|
+
shadowSink.record({
|
|
44911
|
+
decisionId: decision.decisionId,
|
|
44912
|
+
timestamp,
|
|
44913
|
+
ruleStrategy: decision.strategy,
|
|
44914
|
+
learnedStrategy: learned.strategy,
|
|
44915
|
+
agree: learned.strategy === decision.strategy,
|
|
44916
|
+
taskClass: decision.analysis.taskType,
|
|
44917
|
+
learnedScore: learned.score
|
|
44918
|
+
});
|
|
44919
|
+
} catch (err2) {
|
|
44920
|
+
logger56.warn("Shadow selection failed (non-fatal)", { error: getErrorMessage(err2) });
|
|
44921
|
+
}
|
|
44922
|
+
}
|
|
44906
44923
|
function createMetaOrchestrator(options) {
|
|
44907
44924
|
const logger56 = options?.logger ?? createLogger({ component: "MetaOrchestrator" });
|
|
44908
44925
|
const router = options?.router ?? createWorkflowRouter({ logger: logger56 });
|
|
44909
44926
|
const sink = options?.sink ?? createAuditLogSink(logger56);
|
|
44910
44927
|
const gapLedger = options?.gapLedger;
|
|
44928
|
+
const shadowSelector = options?.shadowSelector;
|
|
44929
|
+
const shadowSink = options?.shadowSink;
|
|
44911
44930
|
return {
|
|
44912
44931
|
select(input) {
|
|
44913
44932
|
const signals = { description: input.goal, ...input.signals };
|
|
@@ -44918,6 +44937,9 @@ function createMetaOrchestrator(options) {
|
|
|
44918
44937
|
const decision = { ...base, decisionId: randomUUID11() };
|
|
44919
44938
|
const timestamp = new Date(getTimeProvider().now()).toISOString();
|
|
44920
44939
|
sink.record(toRecord(decision, input.goal, forced, timestamp));
|
|
44940
|
+
if (shadowSelector !== void 0 && shadowSink !== void 0) {
|
|
44941
|
+
recordShadow(shadowSelector, shadowSink, decision, timestamp, logger56);
|
|
44942
|
+
}
|
|
44921
44943
|
if (gapLedger !== void 0 && decision.capabilityGaps !== void 0) {
|
|
44922
44944
|
gapLedger.record(decision.capabilityGaps, {
|
|
44923
44945
|
goal: input.goal,
|
|
@@ -44938,6 +44960,79 @@ function createMetaOrchestrator(options) {
|
|
|
44938
44960
|
};
|
|
44939
44961
|
}
|
|
44940
44962
|
|
|
44963
|
+
// src/orchestration/meta-shadow-selector.ts
|
|
44964
|
+
var SHADOW_STRATEGY_ARMS = [
|
|
44965
|
+
"single-shot",
|
|
44966
|
+
"dev-pipeline",
|
|
44967
|
+
"pipeline",
|
|
44968
|
+
"graph-workflow",
|
|
44969
|
+
"orchestrate",
|
|
44970
|
+
"consensus",
|
|
44971
|
+
"spec",
|
|
44972
|
+
"research"
|
|
44973
|
+
];
|
|
44974
|
+
var SUCCESS_REWARD = 0.7;
|
|
44975
|
+
var FAILURE_REWARD = 0.1;
|
|
44976
|
+
var CONTEXT_TOKEN_NORMALIZER = 1e5;
|
|
44977
|
+
var FALLBACK_STRATEGY = "pipeline";
|
|
44978
|
+
var DEFAULT_MAX_RECORDS = 200;
|
|
44979
|
+
function createRecordingShadowSink(maxRecords = DEFAULT_MAX_RECORDS) {
|
|
44980
|
+
const records = [];
|
|
44981
|
+
return {
|
|
44982
|
+
record(record) {
|
|
44983
|
+
records.push(record);
|
|
44984
|
+
if (records.length > maxRecords) {
|
|
44985
|
+
records.splice(0, records.length - maxRecords);
|
|
44986
|
+
}
|
|
44987
|
+
},
|
|
44988
|
+
getRecords() {
|
|
44989
|
+
return records;
|
|
44990
|
+
}
|
|
44991
|
+
};
|
|
44992
|
+
}
|
|
44993
|
+
function clamp012(n) {
|
|
44994
|
+
if (Number.isNaN(n)) return 0;
|
|
44995
|
+
return Math.max(0, Math.min(1, n));
|
|
44996
|
+
}
|
|
44997
|
+
function toBanditContext(decision) {
|
|
44998
|
+
const a = decision.analysis;
|
|
44999
|
+
const isCode = a.taskType === "code_implementation" || a.taskType === "code_review" || a.taskType === "test_generation" || a.taskType === "security_review";
|
|
45000
|
+
return {
|
|
45001
|
+
taskComplexity: clamp012(a.complexityScore),
|
|
45002
|
+
contextLengthNormalized: clamp012(a.estimatedTokens / CONTEXT_TOKEN_NORMALIZER),
|
|
45003
|
+
isCodeTask: isCode ? 1 : 0,
|
|
45004
|
+
isReasoningTask: a.reasoningType === "reasoning" ? clamp012(a.reasoningConfidence) : 0,
|
|
45005
|
+
// No budget/urgency signal is available at selection time; left neutral.
|
|
45006
|
+
budgetUtilization: 0,
|
|
45007
|
+
timePressure: 0
|
|
45008
|
+
};
|
|
45009
|
+
}
|
|
45010
|
+
function createLearnedStrategySelector() {
|
|
45011
|
+
const bandit = new LinUCBBandit(SHADOW_STRATEGY_ARMS);
|
|
45012
|
+
return {
|
|
45013
|
+
predict(decision) {
|
|
45014
|
+
const { armName, ucbScore } = bandit.select(toBanditContext(decision));
|
|
45015
|
+
const strategy = SHADOW_STRATEGY_ARMS.includes(armName) ? armName : FALLBACK_STRATEGY;
|
|
45016
|
+
return { strategy, score: ucbScore };
|
|
45017
|
+
},
|
|
45018
|
+
recordOutcome(strategy, decision, success) {
|
|
45019
|
+
const idx = SHADOW_STRATEGY_ARMS.indexOf(strategy);
|
|
45020
|
+
if (idx < 0) return;
|
|
45021
|
+
bandit.update(idx, toBanditContext(decision), success ? SUCCESS_REWARD : FAILURE_REWARD);
|
|
45022
|
+
}
|
|
45023
|
+
};
|
|
45024
|
+
}
|
|
45025
|
+
var singletonSelector;
|
|
45026
|
+
var singletonSink;
|
|
45027
|
+
function getShadowSelector() {
|
|
45028
|
+
singletonSelector ??= createLearnedStrategySelector();
|
|
45029
|
+
return singletonSelector;
|
|
45030
|
+
}
|
|
45031
|
+
function getShadowSink() {
|
|
45032
|
+
singletonSink ??= createRecordingShadowSink();
|
|
45033
|
+
return singletonSink;
|
|
45034
|
+
}
|
|
45035
|
+
|
|
44941
45036
|
// src/orchestration/meta-dispatcher.ts
|
|
44942
45037
|
var MetaDispatchError = class extends Error {
|
|
44943
45038
|
code;
|
|
@@ -45541,7 +45636,11 @@ function toMetaInput(input) {
|
|
|
45541
45636
|
};
|
|
45542
45637
|
}
|
|
45543
45638
|
function selectDecision(input, logger56) {
|
|
45544
|
-
const meta = createMetaOrchestrator(
|
|
45639
|
+
const meta = createMetaOrchestrator({
|
|
45640
|
+
...logger56 !== void 0 ? { logger: logger56 } : {},
|
|
45641
|
+
shadowSelector: getShadowSelector(),
|
|
45642
|
+
shadowSink: getShadowSink()
|
|
45643
|
+
});
|
|
45545
45644
|
return meta.select(toMetaInput(input));
|
|
45546
45645
|
}
|
|
45547
45646
|
function routeGoal(input, logger56) {
|
|
@@ -49714,4 +49813,4 @@ export {
|
|
|
49714
49813
|
shutdownFeedbackSubscriber,
|
|
49715
49814
|
createEventBusBridge
|
|
49716
49815
|
};
|
|
49717
|
-
//# sourceMappingURL=chunk-
|
|
49816
|
+
//# sourceMappingURL=chunk-ARL5T2ES.js.map
|