nexus-agents 4.29.5 → 4.29.7
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-5RIAPSAF.js → chunk-46F3UEKW.js} +31 -17
- package/dist/{chunk-5RIAPSAF.js.map → chunk-46F3UEKW.js.map} +1 -1
- package/dist/{chunk-I4M3ICTG.js → chunk-A4ISLEV6.js} +4 -4
- package/dist/chunk-EE53G5Z4.js +7 -0
- package/dist/{chunk-MLPECOSS.js → chunk-GFNBH2PE.js} +2 -2
- package/dist/{chunk-Q7GOBLAY.js → chunk-WB54CVTG.js} +2 -2
- package/dist/{chunk-HTDLKLLP.js → chunk-WIB7TIDY.js} +29 -4
- package/dist/chunk-WIB7TIDY.js.map +1 -0
- package/dist/{chunk-S6AUSZVL.js → chunk-WRKUNUCA.js} +3 -3
- package/dist/{chunk-ZRBUE6WG.js → chunk-XP5BAFPJ.js} +2 -2
- package/dist/cli.js +11 -11
- package/dist/{consensus-vote-ITFU2C77.js → consensus-vote-RJBBB25Z.js} +5 -5
- package/dist/{improvement-review-QJONDUXH.js → improvement-review-I26ZEHXQ.js} +4 -4
- package/dist/index.js +9 -9
- package/dist/{init-opencode-Y2L2ZW3Q.js → init-opencode-KWKRUK5D.js} +3 -3
- package/dist/{setup-data-dir-IO5SZULH.js → setup-data-dir-A6DPGVXF.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-HTDLKLLP.js.map +0 -1
- package/dist/chunk-PMTH6YFL.js +0 -7
- /package/dist/{chunk-I4M3ICTG.js.map → chunk-A4ISLEV6.js.map} +0 -0
- /package/dist/{chunk-PMTH6YFL.js.map → chunk-EE53G5Z4.js.map} +0 -0
- /package/dist/{chunk-MLPECOSS.js.map → chunk-GFNBH2PE.js.map} +0 -0
- /package/dist/{chunk-Q7GOBLAY.js.map → chunk-WB54CVTG.js.map} +0 -0
- /package/dist/{chunk-S6AUSZVL.js.map → chunk-WRKUNUCA.js.map} +0 -0
- /package/dist/{chunk-ZRBUE6WG.js.map → chunk-XP5BAFPJ.js.map} +0 -0
- /package/dist/{consensus-vote-ITFU2C77.js.map → consensus-vote-RJBBB25Z.js.map} +0 -0
- /package/dist/{improvement-review-QJONDUXH.js.map → improvement-review-I26ZEHXQ.js.map} +0 -0
- /package/dist/{init-opencode-Y2L2ZW3Q.js.map → init-opencode-KWKRUK5D.js.map} +0 -0
- /package/dist/{setup-data-dir-IO5SZULH.js.map → setup-data-dir-A6DPGVXF.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-A4ISLEV6.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
27
|
} from "./chunk-UPKYWLPL.js";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
simulationDeniedResult,
|
|
48
48
|
toJobSummary,
|
|
49
49
|
writeJobCancelled
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-WRKUNUCA.js";
|
|
51
51
|
import {
|
|
52
52
|
allOf
|
|
53
53
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from "./chunk-3IM3OPZH.js";
|
|
65
65
|
import {
|
|
66
66
|
withPrerequisite
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-XP5BAFPJ.js";
|
|
68
68
|
import {
|
|
69
69
|
NOOP_NOTIFIER,
|
|
70
70
|
RateLimiter,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
withAuditTrail,
|
|
89
89
|
withProgressHeartbeat,
|
|
90
90
|
wrapToolWithTimeout
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-WB54CVTG.js";
|
|
92
92
|
import {
|
|
93
93
|
createAuditTrail,
|
|
94
94
|
createGraphAuditBridge,
|
|
@@ -19615,6 +19615,10 @@ var MODEL_CAPABILITIES = {
|
|
|
19615
19615
|
var capabilityRegistry = new Map(Object.entries(MODEL_CAPABILITIES));
|
|
19616
19616
|
|
|
19617
19617
|
// src/agents/orchestration/puppeteer-config-types.ts
|
|
19618
|
+
var DEFAULT_COST_PER_1K_TOKENS = 0.01;
|
|
19619
|
+
function tokensToCostUsd(tokens, costPer1KTokens) {
|
|
19620
|
+
return tokens * costPer1KTokens / 1e3;
|
|
19621
|
+
}
|
|
19618
19622
|
var DEFAULT_PUPPETEER_CONFIG = {
|
|
19619
19623
|
maxSteps: 10,
|
|
19620
19624
|
timeoutMs: 5 * 60 * 1e3,
|
|
@@ -19623,7 +19627,7 @@ var DEFAULT_PUPPETEER_CONFIG = {
|
|
|
19623
19627
|
discountFactor: 0.99,
|
|
19624
19628
|
explorationRate: 0.1,
|
|
19625
19629
|
trackEmergentPatterns: true,
|
|
19626
|
-
costPer1KTokens:
|
|
19630
|
+
costPer1KTokens: DEFAULT_COST_PER_1K_TOKENS,
|
|
19627
19631
|
maxCostBudget: 1
|
|
19628
19632
|
};
|
|
19629
19633
|
|
|
@@ -19748,7 +19752,8 @@ var LearnablePolicyStatsSchema = z43.object({
|
|
|
19748
19752
|
// src/agents/orchestration/state-manager.ts
|
|
19749
19753
|
var DEFAULT_STATE_MANAGER_CONFIG = {
|
|
19750
19754
|
maxContextTokens: 8e3,
|
|
19751
|
-
compressionThreshold: 0.8
|
|
19755
|
+
compressionThreshold: 0.8,
|
|
19756
|
+
costPer1KTokens: DEFAULT_COST_PER_1K_TOKENS
|
|
19752
19757
|
};
|
|
19753
19758
|
var STOPWORDS2 = /* @__PURE__ */ new Set([
|
|
19754
19759
|
"the",
|
|
@@ -19955,11 +19960,10 @@ var StateManager = class {
|
|
|
19955
19960
|
updateMetadata(current, output2) {
|
|
19956
19961
|
const startTime = new Date(current.startedAt).getTime();
|
|
19957
19962
|
const elapsedMs = getTimeProvider().now() - startTime;
|
|
19958
|
-
const costPerToken = 1e-5;
|
|
19959
19963
|
const measured = output2.tokensMeasured !== false;
|
|
19960
19964
|
return {
|
|
19961
19965
|
progress: current.progress,
|
|
19962
|
-
totalCost: current.totalCost + (measured ? output2.tokensUsed
|
|
19966
|
+
totalCost: current.totalCost + (measured ? tokensToCostUsd(output2.tokensUsed, this.config.costPer1KTokens) : 0),
|
|
19963
19967
|
totalTokens: current.totalTokens + (measured ? output2.tokensUsed : 0),
|
|
19964
19968
|
unmeasuredSteps: (current.unmeasuredSteps ?? 0) + (measured ? 0 : 1),
|
|
19965
19969
|
elapsedMs,
|
|
@@ -20885,12 +20889,13 @@ var DEFAULT_REWARD_CONFIG = {
|
|
|
20885
20889
|
efficiencyWeight: 0.1,
|
|
20886
20890
|
progressWeight: 0.5,
|
|
20887
20891
|
maxCost: 1,
|
|
20888
|
-
maxTime: 3e5
|
|
20892
|
+
maxTime: 3e5,
|
|
20893
|
+
costPer1KTokens: DEFAULT_COST_PER_1K_TOKENS
|
|
20889
20894
|
};
|
|
20890
20895
|
function computeStepReward(output2, progressDelta, config = DEFAULT_REWARD_CONFIG) {
|
|
20891
20896
|
if (output2.tokensMeasured === false) return null;
|
|
20892
20897
|
const progressReward = progressDelta * config.progressWeight;
|
|
20893
|
-
const costPenalty = output2.tokensUsed
|
|
20898
|
+
const costPenalty = tokensToCostUsd(output2.tokensUsed, config.costPer1KTokens) / config.maxCost;
|
|
20894
20899
|
const timePenalty = output2.durationMs / config.maxTime;
|
|
20895
20900
|
const efficiencyPenalty = (costPenalty + timePenalty) * config.efficiencyWeight;
|
|
20896
20901
|
return progressReward - efficiencyPenalty;
|
|
@@ -20963,13 +20968,14 @@ function computeMetrics(trajectory, emergentPatterns, success) {
|
|
|
20963
20968
|
cyclicalityScore: emergentPatterns.cyclicalityScore
|
|
20964
20969
|
};
|
|
20965
20970
|
}
|
|
20966
|
-
function buildPuppeteerResult(trajectory, emergentPatterns, terminationReason,
|
|
20971
|
+
function buildPuppeteerResult(trajectory, emergentPatterns, terminationReason, options) {
|
|
20972
|
+
const { sessionId, startTime, costPer1KTokens = DEFAULT_COST_PER_1K_TOKENS } = options;
|
|
20967
20973
|
const success = terminationReason === "task_complete";
|
|
20968
20974
|
const totalDurationMs = getTimeProvider().now() - startTime;
|
|
20969
20975
|
const lastStep = trajectory[trajectory.length - 1];
|
|
20970
20976
|
const output2 = lastStep?.agentOutput.output ?? null;
|
|
20971
20977
|
const totalTokens = trajectory.reduce((sum, s) => sum + s.agentOutput.tokensUsed, 0);
|
|
20972
|
-
const totalCost = totalTokens
|
|
20978
|
+
const totalCost = tokensToCostUsd(totalTokens, costPer1KTokens);
|
|
20973
20979
|
const metrics = computeMetrics(trajectory, emergentPatterns, success);
|
|
20974
20980
|
return {
|
|
20975
20981
|
success,
|
|
@@ -21695,7 +21701,7 @@ var PuppeteerOrchestrator = class {
|
|
|
21695
21701
|
constructor(options = {}) {
|
|
21696
21702
|
this.config = { ...DEFAULT_PUPPETEER_CONFIG, ...options.config };
|
|
21697
21703
|
this.policyEngine = options.policyEngine ?? createPolicyForMode(this.config.policyMode);
|
|
21698
|
-
this.stateManager = options.stateManager ?? createStateManager();
|
|
21704
|
+
this.stateManager = options.stateManager ?? createStateManager({ costPer1KTokens: this.config.costPer1KTokens });
|
|
21699
21705
|
this.patternTracker = options.patternTracker ?? createPatternTracker();
|
|
21700
21706
|
this.eventBus = options.eventBus ?? void 0;
|
|
21701
21707
|
this.agents = /* @__PURE__ */ new Map();
|
|
@@ -21846,7 +21852,11 @@ var PuppeteerOrchestrator = class {
|
|
|
21846
21852
|
const terminationCtx = { config: this.config, cancelled: this.cancelled };
|
|
21847
21853
|
const reason = determineTerminationReason(terminationCtx, state, trajectory, startTime);
|
|
21848
21854
|
const emergentPatterns = this.config.trackEmergentPatterns ? this.patternTracker.analyze(trajectory) : { hubAgents: [], cycles: [], graphDensity: 0, cyclicalityScore: 0 };
|
|
21849
|
-
const result = buildPuppeteerResult(trajectory, emergentPatterns, reason,
|
|
21855
|
+
const result = buildPuppeteerResult(trajectory, emergentPatterns, reason, {
|
|
21856
|
+
sessionId,
|
|
21857
|
+
startTime,
|
|
21858
|
+
costPer1KTokens: this.config.costPer1KTokens
|
|
21859
|
+
});
|
|
21850
21860
|
if (this.experienceBuffer !== null && supportsLearning(this.policyEngine)) {
|
|
21851
21861
|
void processOrchestrationForLearning(result, this.experienceBuffer, this.policyEngine);
|
|
21852
21862
|
}
|
|
@@ -21865,7 +21875,11 @@ var PuppeteerOrchestrator = class {
|
|
|
21865
21875
|
}
|
|
21866
21876
|
buildErrorResult(trajectory, reason, sessionId, startTime) {
|
|
21867
21877
|
const emergentPatterns = this.config.trackEmergentPatterns ? this.patternTracker.analyze(trajectory) : { hubAgents: [], cycles: [], graphDensity: 0, cyclicalityScore: 0 };
|
|
21868
|
-
const result = buildPuppeteerResult(trajectory, emergentPatterns, reason,
|
|
21878
|
+
const result = buildPuppeteerResult(trajectory, emergentPatterns, reason, {
|
|
21879
|
+
sessionId,
|
|
21880
|
+
startTime,
|
|
21881
|
+
costPer1KTokens: this.config.costPer1KTokens
|
|
21882
|
+
});
|
|
21869
21883
|
this.cleanupAbortSignal();
|
|
21870
21884
|
return ok(result);
|
|
21871
21885
|
}
|
|
@@ -47523,7 +47537,7 @@ ${contextBlock}`;
|
|
|
47523
47537
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47524
47538
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47525
47539
|
try {
|
|
47526
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47540
|
+
const { executeVoting } = await import("./consensus-vote-RJBBB25Z.js");
|
|
47527
47541
|
const votingResult = await executeVoting(
|
|
47528
47542
|
{
|
|
47529
47543
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -56151,4 +56165,4 @@ export {
|
|
|
56151
56165
|
shutdownFeedbackSubscriber,
|
|
56152
56166
|
createEventBusBridge
|
|
56153
56167
|
};
|
|
56154
|
-
//# sourceMappingURL=chunk-
|
|
56168
|
+
//# sourceMappingURL=chunk-46F3UEKW.js.map
|