@wrongstack/core 0.270.0 → 0.272.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/{agent-bridge-PcHQl_UQ.d.ts → agent-bridge-jVSZiygR.d.ts} +1 -1
- package/dist/{agent-subagent-runner-SHJW7t8q.d.ts → agent-subagent-runner-DOLIwBRo.d.ts} +7 -7
- package/dist/{brain-BYcK__Ym.d.ts → brain-CdbbJWi3.d.ts} +71 -1
- package/dist/{compactor-C2RKEBtC.d.ts → compactor-72ug-ZRB.d.ts} +1 -1
- package/dist/{config-C_ae2k86.d.ts → config-D2DGoGSQ.d.ts} +29 -2
- package/dist/{context-Dp87Bcaq.d.ts → context-Dw55zZ_Q.d.ts} +110 -1
- package/dist/coordination/index.d.ts +121 -17
- package/dist/coordination/index.js +738 -74
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +25 -25
- package/dist/defaults/index.js +599 -86
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +23 -18
- package/dist/execution/index.js +136 -41
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +36 -6
- package/dist/execution/prompt-enhancer.js +35 -9
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{global-mailbox-Bvrz1P3f.d.ts → global-mailbox-CQj_C9Dp.d.ts} +139 -3
- package/dist/{goal-preamble-CA_4yiGQ.d.ts → goal-preamble-ZXDjjR1y.d.ts} +9 -9
- package/dist/{goal-store-DhuJoUNG.d.ts → goal-store-CcJBd-g1.d.ts} +1 -1
- package/dist/hq/index.d.ts +93 -6
- package/dist/hq/index.js +616 -46
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-whDfTANu.d.ts → index-2Lhk5v0o.d.ts} +2 -2
- package/dist/{index-CZQ6Pwbs.d.ts → index-BL7BAx0p.d.ts} +8 -8
- package/dist/{index-W4VJCzHa.d.ts → index-Qo4kTzgw.d.ts} +5 -5
- package/dist/index.d.ts +96 -56
- package/dist/index.js +1938 -349
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +5 -3
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-DJdZiRcv.d.ts → mcp-servers-DS-YUXvF.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +28 -5
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-C3a-2-Yd.d.ts → models-registry-DP6pGHet.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-CJSpTe5O.d.ts → multi-agent-coordinator-BvbdNQ14.d.ts} +1 -1
- package/dist/{null-fleet-bus-QVshIsDx.d.ts → null-fleet-bus-BxTfXBKo.d.ts} +6 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/{parallel-eternal-engine-D9y5Pkcc.d.ts → parallel-eternal-engine-Cf-GTegR.d.ts} +9 -9
- package/dist/{path-resolver-CnQ8SIfh.d.ts → path-resolver-DztfnFcv.d.ts} +3 -3
- package/dist/{permission-CvYQNUqZ.d.ts → permission-CC7XFYWG.d.ts} +1 -1
- package/dist/{permission-policy-D5Ss8j4B.d.ts → permission-policy-cYR4RJmw.d.ts} +2 -2
- package/dist/{pipeline-l_zzFRh3.d.ts → pipeline-sNIkhXeB.d.ts} +2 -2
- package/dist/{plan-templates-NtPgyeJA.d.ts → plan-templates-DYiKFmEb.d.ts} +11 -5
- package/dist/{provider-model-resolve-d5poT5y0.d.ts → provider-model-resolve-dYAbTs_i.d.ts} +3 -3
- package/dist/{provider-runner-gkctlQV_.d.ts → provider-runner-Dw8x0F7u.d.ts} +3 -3
- package/dist/{retry-policy-CtFhfwa8.d.ts → retry-policy-BV7nzeAd.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +2 -0
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-BLsVmTIK.d.ts → secret-vault-eMBKfheR.d.ts} +9 -1
- package/dist/security/index.d.ts +5 -5
- package/dist/security/index.js +137 -10
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-CXl2_y9W.d.ts → selector-C4ORTOid.d.ts} +1 -1
- package/dist/{session-event-bridge-Ccud20CC.d.ts → session-event-bridge-CeNpUL9w.d.ts} +1 -1
- package/dist/{session-reader-ZeXQmsmE.d.ts → session-reader-BepLSnGL.d.ts} +1 -1
- package/dist/storage/index.d.ts +45 -13
- package/dist/storage/index.js +374 -113
- package/dist/storage/index.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +9 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.js +202 -41
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +17 -4
- package/dist/utils/index.js +48 -9
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-
|
|
2
|
-
export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, l as ContextWindowBudgetSnapshot, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from '../goal-preamble-
|
|
3
|
-
import { P as Provider,
|
|
4
|
-
import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../brain-
|
|
5
|
-
import { G as ModelRuntimeConfig } from '../config-
|
|
6
|
-
import '../retry-policy-
|
|
7
|
-
import '../compactor-
|
|
8
|
-
import '../index-
|
|
1
|
+
export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-Cf-GTegR.js';
|
|
2
|
+
export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, l as ContextWindowBudgetSnapshot, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from '../goal-preamble-ZXDjjR1y.js';
|
|
3
|
+
import { P as Provider, a as ReasoningConfig, n as Capabilities, c as Request } from '../context-Dw55zZ_Q.js';
|
|
4
|
+
import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../brain-CdbbJWi3.js';
|
|
5
|
+
import { G as ModelRuntimeConfig } from '../config-D2DGoGSQ.js';
|
|
6
|
+
import '../retry-policy-BV7nzeAd.js';
|
|
7
|
+
import '../compactor-72ug-ZRB.js';
|
|
8
|
+
import '../index-Qo4kTzgw.js';
|
|
9
9
|
import '../logger-B63L5bTg.js';
|
|
10
|
-
import '../pipeline-
|
|
10
|
+
import '../pipeline-sNIkhXeB.js';
|
|
11
11
|
import '../mailbox-types-Ct2hJq0P.js';
|
|
12
12
|
import '../observability-D-HZN_mF.js';
|
|
13
|
-
import '../permission-
|
|
14
|
-
import '../agent-subagent-runner-
|
|
15
|
-
import '../goal-store-
|
|
16
|
-
import '../multi-agent-coordinator-
|
|
13
|
+
import '../permission-CC7XFYWG.js';
|
|
14
|
+
import '../agent-subagent-runner-DOLIwBRo.js';
|
|
15
|
+
import '../goal-store-CcJBd-g1.js';
|
|
16
|
+
import '../multi-agent-coordinator-BvbdNQ14.js';
|
|
17
17
|
import 'node:events';
|
|
18
18
|
import '../skill-DGIXCtdv.js';
|
|
19
19
|
import '../wstack-paths-hOpNLmvf.js';
|
|
20
|
-
import '../selector-
|
|
21
|
-
import '../session-event-bridge-
|
|
20
|
+
import '../selector-C4ORTOid.js';
|
|
21
|
+
import '../session-event-bridge-CeNpUL9w.js';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* AutonomyBrain — a self-driving decision layer for autonomous workflows.
|
|
@@ -126,6 +126,8 @@ declare function formatDecisionSummary(decision: BrainDecision, request: BrainDe
|
|
|
126
126
|
interface ResolvedModelRuntime {
|
|
127
127
|
reasoning: Request['reasoning'];
|
|
128
128
|
cache: Request['cache'];
|
|
129
|
+
/** Resolved generation parameters (topK, frequencyPenalty, etc.). */
|
|
130
|
+
parameters: Partial<Request> | undefined;
|
|
129
131
|
/** Human-readable warnings for settings that were ignored for this model. */
|
|
130
132
|
warnings: string[];
|
|
131
133
|
}
|
|
@@ -141,7 +143,7 @@ interface ResolvedModelRuntime {
|
|
|
141
143
|
* dropped, because we cannot tell whether the model will
|
|
142
144
|
* accept the fields.
|
|
143
145
|
*/
|
|
144
|
-
declare function resolveModelRuntime(settings: ModelRuntimeConfig | undefined, reasoning: ReasoningConfig | undefined): ResolvedModelRuntime;
|
|
146
|
+
declare function resolveModelRuntime(settings: ModelRuntimeConfig | undefined, reasoning: ReasoningConfig | undefined, capabilities?: Capabilities | undefined): ResolvedModelRuntime;
|
|
145
147
|
declare function resolveReasoningForRequest(settings: ModelRuntimeConfig, rc: ReasoningConfig | undefined, warnings: string[]): Request['reasoning'];
|
|
146
148
|
declare function resolveCacheForRequest(settings: ModelRuntimeConfig, _warnings: string[]): Request['cache'];
|
|
147
149
|
interface ModelRuntimeMiddlewareOptions {
|
|
@@ -153,14 +155,17 @@ interface ModelRuntimeMiddlewareOptions {
|
|
|
153
155
|
getSettings(): ModelRuntimeConfig | undefined;
|
|
154
156
|
/** Current model capability profile. Called per-request. */
|
|
155
157
|
getReasoningConfig(): ReasoningConfig | undefined;
|
|
158
|
+
/** Current model capabilities for parameter gating. Called per-request. */
|
|
159
|
+
getCapabilities?(): Capabilities | undefined;
|
|
156
160
|
/** Optional sink for suppressed-setting warnings (e.g. emit to event bus). */
|
|
157
161
|
onWarning?: ((message: string) => void) | undefined;
|
|
158
162
|
}
|
|
159
163
|
/**
|
|
160
164
|
* Build a `request`-pipeline middleware that applies runtime settings. The
|
|
161
165
|
* returned function mutates the outgoing request by overlaying resolved
|
|
162
|
-
* `reasoning` / `cache` fields. Existing fields on
|
|
163
|
-
* only when the resolver produces nothing for
|
|
166
|
+
* `reasoning` / `cache` fields and generic parameters. Existing fields on
|
|
167
|
+
* the request are preserved only when the resolver produces nothing for
|
|
168
|
+
* that field.
|
|
164
169
|
*/
|
|
165
170
|
declare function applyModelRuntime(req: Request, opts: ModelRuntimeMiddlewareOptions): Request;
|
|
166
171
|
|
package/dist/execution/index.js
CHANGED
|
@@ -101,18 +101,20 @@ var MODEL_FAMILY_RATIO = {
|
|
|
101
101
|
deepseek: 3.5
|
|
102
102
|
};
|
|
103
103
|
var ESTIMATE_CACHE = /* @__PURE__ */ new Map();
|
|
104
|
+
var _estimateCacheOrder = [];
|
|
104
105
|
var ESTIMATE_CACHE_MAX_SIZE = 5e4;
|
|
105
106
|
function getCachedEstimate(key, compute) {
|
|
106
107
|
const existing = ESTIMATE_CACHE.get(key);
|
|
107
108
|
if (existing !== void 0) return existing;
|
|
108
109
|
if (ESTIMATE_CACHE.size >= ESTIMATE_CACHE_MAX_SIZE) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
ESTIMATE_CACHE.delete(
|
|
110
|
+
while (ESTIMATE_CACHE.size > Math.floor(ESTIMATE_CACHE_MAX_SIZE / 2)) {
|
|
111
|
+
const oldest = _estimateCacheOrder.shift();
|
|
112
|
+
if (oldest !== void 0) ESTIMATE_CACHE.delete(oldest);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
const estimate = compute(key);
|
|
115
116
|
ESTIMATE_CACHE.set(key, estimate);
|
|
117
|
+
_estimateCacheOrder.push(key);
|
|
116
118
|
return estimate;
|
|
117
119
|
}
|
|
118
120
|
function estimateToolInputTokens(input) {
|
|
@@ -476,17 +478,9 @@ function findPreserveStart(messages, preserveK) {
|
|
|
476
478
|
const prev = messages[preserveStart - 1];
|
|
477
479
|
if (!first || !prev || first.role !== "user" || prev.role !== "assistant") break;
|
|
478
480
|
if (typeof first.content === "string" || typeof prev.content === "string") break;
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
if (block.type === "tool_result") resultIds.add(block.tool_use_id);
|
|
483
|
-
}
|
|
484
|
-
if (resultIds.size === 0) break;
|
|
485
|
-
const hasMatchingUse = prev.content.some((block) => {
|
|
486
|
-
pairRepairInnerIterations++;
|
|
487
|
-
return block.type === "tool_use" && resultIds.has(block.id);
|
|
488
|
-
});
|
|
489
|
-
if (!hasMatchingUse) break;
|
|
481
|
+
const pairCheck = hasMatchingToolPair(first.content, prev.content);
|
|
482
|
+
pairRepairInnerIterations += pairCheck.iterations;
|
|
483
|
+
if (!pairCheck.matched) break;
|
|
490
484
|
preserveStart--;
|
|
491
485
|
}
|
|
492
486
|
if (compactionDebugEnabled()) {
|
|
@@ -505,9 +499,34 @@ function findPreserveStart(messages, preserveK) {
|
|
|
505
499
|
}
|
|
506
500
|
return preserveStart;
|
|
507
501
|
}
|
|
502
|
+
function hasMatchingToolPair(resultContent, useContent) {
|
|
503
|
+
let iterations = 0;
|
|
504
|
+
let firstResultId;
|
|
505
|
+
let resultIds;
|
|
506
|
+
for (const block of resultContent) {
|
|
507
|
+
iterations++;
|
|
508
|
+
if (block.type !== "tool_result") continue;
|
|
509
|
+
if (firstResultId === void 0) {
|
|
510
|
+
firstResultId = block.tool_use_id;
|
|
511
|
+
} else {
|
|
512
|
+
resultIds ??= /* @__PURE__ */ new Set([firstResultId]);
|
|
513
|
+
resultIds.add(block.tool_use_id);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
if (firstResultId === void 0) return { matched: false, iterations };
|
|
517
|
+
for (const block of useContent) {
|
|
518
|
+
iterations++;
|
|
519
|
+
if (block.type !== "tool_use") continue;
|
|
520
|
+
if (resultIds ? resultIds.has(block.id) : block.id === firstResultId) {
|
|
521
|
+
return { matched: true, iterations };
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return { matched: false, iterations };
|
|
525
|
+
}
|
|
508
526
|
function eliseOldToolResults(messages, opts) {
|
|
509
527
|
const preserveStart = findPreserveStart(messages, opts.preserveK);
|
|
510
528
|
let hasOversized = false;
|
|
529
|
+
let firstOversizedIndex = -1;
|
|
511
530
|
let fastPathIterations = 0;
|
|
512
531
|
let fastPathInnerIterations = 0;
|
|
513
532
|
for (let i = 0; i < preserveStart && !hasOversized; i++) {
|
|
@@ -519,6 +538,7 @@ function eliseOldToolResults(messages, opts) {
|
|
|
519
538
|
const oversized = b.type === "tool_result" && estimateToolResultTokens(b.content) >= opts.eliseThreshold || b.type === "tool_use" && estimateToolInputTokens(b.input) >= opts.eliseThreshold;
|
|
520
539
|
if (oversized) {
|
|
521
540
|
hasOversized = true;
|
|
541
|
+
firstOversizedIndex = i;
|
|
522
542
|
break;
|
|
523
543
|
}
|
|
524
544
|
}
|
|
@@ -541,26 +561,29 @@ function eliseOldToolResults(messages, opts) {
|
|
|
541
561
|
let changed = false;
|
|
542
562
|
let fullPassIterations = 0;
|
|
543
563
|
let fullPassInnerIterations = 0;
|
|
544
|
-
|
|
545
|
-
for (let i =
|
|
564
|
+
let next;
|
|
565
|
+
for (let i = firstOversizedIndex; i < preserveStart; i++) {
|
|
546
566
|
fullPassIterations++;
|
|
547
567
|
const msg = messages[i];
|
|
548
|
-
if (
|
|
549
|
-
next[i] = msg;
|
|
550
|
-
continue;
|
|
551
|
-
}
|
|
568
|
+
if (!msg || !Array.isArray(msg.content)) continue;
|
|
552
569
|
const original = msg.content;
|
|
553
|
-
|
|
570
|
+
let newContent;
|
|
571
|
+
for (let idx = 0; idx < original.length; idx++) {
|
|
572
|
+
fullPassInnerIterations++;
|
|
573
|
+
const b = original[idx];
|
|
574
|
+
if (!b) continue;
|
|
554
575
|
if (b.type === "tool_use") {
|
|
555
576
|
const tokens2 = estimateToolInputTokens(b.input);
|
|
556
|
-
if (tokens2 < opts.eliseThreshold)
|
|
577
|
+
if (tokens2 < opts.eliseThreshold) continue;
|
|
557
578
|
const elidedInput = summarizeToolUseInputElision(b, tokens2);
|
|
558
579
|
saved += Math.max(0, tokens2 - estimateToolInputTokens(elidedInput));
|
|
559
|
-
|
|
580
|
+
newContent ??= original.slice();
|
|
581
|
+
newContent[idx] = { ...b, input: elidedInput };
|
|
582
|
+
continue;
|
|
560
583
|
}
|
|
561
|
-
if (b.type !== "tool_result")
|
|
584
|
+
if (b.type !== "tool_result") continue;
|
|
562
585
|
const tokens = estimateToolResultTokens(b.content);
|
|
563
|
-
if (tokens < opts.eliseThreshold)
|
|
586
|
+
if (tokens < opts.eliseThreshold) continue;
|
|
564
587
|
saved += tokens;
|
|
565
588
|
const elided = {
|
|
566
589
|
type: "tool_result",
|
|
@@ -568,15 +591,14 @@ function eliseOldToolResults(messages, opts) {
|
|
|
568
591
|
content: summarizeToolResultElision(b, tokens),
|
|
569
592
|
is_error: b.is_error
|
|
570
593
|
};
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
594
|
+
newContent ??= original.slice();
|
|
595
|
+
newContent[idx] = elided;
|
|
596
|
+
}
|
|
597
|
+
if (newContent) {
|
|
598
|
+
next ??= messages.slice();
|
|
576
599
|
next[i] = { ...msg, content: newContent };
|
|
577
600
|
changed = true;
|
|
578
601
|
}
|
|
579
|
-
fullPassInnerIterations += original.length;
|
|
580
602
|
if (compactionDebugEnabled()) {
|
|
581
603
|
const ratio = fullPassInnerIterations / fullPassIterations;
|
|
582
604
|
if (ratio > 10) {
|
|
@@ -603,7 +625,7 @@ function eliseOldToolResults(messages, opts) {
|
|
|
603
625
|
tokensSaved: saved,
|
|
604
626
|
changed
|
|
605
627
|
});
|
|
606
|
-
return { messages: changed ? next : messages, saved, changed };
|
|
628
|
+
return { messages: changed && next ? next : messages, saved, changed };
|
|
607
629
|
}
|
|
608
630
|
function summarizeToolUseInputElision(block, tokens) {
|
|
609
631
|
const fields = {};
|
|
@@ -4186,7 +4208,14 @@ var EternalAutonomyEngine = class {
|
|
|
4186
4208
|
try {
|
|
4187
4209
|
const reloaded = await loadGoal(this.goalPath, this.opts.events);
|
|
4188
4210
|
iterationIndex = reloaded?.iterations ?? 0;
|
|
4189
|
-
} catch {
|
|
4211
|
+
} catch (err) {
|
|
4212
|
+
console.error(JSON.stringify({
|
|
4213
|
+
level: "warn",
|
|
4214
|
+
event: "autonomy.goal_reload_failed",
|
|
4215
|
+
message: toErrorMessage(err),
|
|
4216
|
+
context: { goalPath: this.goalPath },
|
|
4217
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
4218
|
+
}));
|
|
4190
4219
|
}
|
|
4191
4220
|
this.opts.onIteration?.({
|
|
4192
4221
|
at: (this.opts.now?.() ?? /* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4421,7 +4450,14 @@ ${lastFew}` : "No prior iterations yet.",
|
|
|
4421
4450
|
} finally {
|
|
4422
4451
|
clearTimeout(timer);
|
|
4423
4452
|
}
|
|
4424
|
-
} catch {
|
|
4453
|
+
} catch (err) {
|
|
4454
|
+
console.error(JSON.stringify({
|
|
4455
|
+
level: "warn",
|
|
4456
|
+
event: "autonomy.brainstorm_failed",
|
|
4457
|
+
message: toErrorMessage(err),
|
|
4458
|
+
context: { goal: goal.goal.slice(0, 100) },
|
|
4459
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
4460
|
+
}));
|
|
4425
4461
|
return null;
|
|
4426
4462
|
}
|
|
4427
4463
|
}
|
|
@@ -8172,6 +8208,8 @@ var FLEET_ROSTER_BUDGETS = {
|
|
|
8172
8208
|
"refactor-planner": { timeoutMs: 7.5 * 60 * 60 * 1e3, maxIterations: 6e3, maxToolCalls: 18e3 },
|
|
8173
8209
|
"security-scanner": { timeoutMs: 10 * 60 * 60 * 1e3, maxIterations: 8e3, maxToolCalls: 2e4 },
|
|
8174
8210
|
"critic": { timeoutMs: 5 * 60 * 60 * 1e3, maxIterations: 4e3, maxToolCalls: 12e3 },
|
|
8211
|
+
"shadow-agent": { timeoutMs: 24 * 60 * 60 * 1e3, maxIterations: 1e4, maxToolCalls: 5e3 },
|
|
8212
|
+
// Long-running background monitor
|
|
8175
8213
|
...Object.fromEntries(
|
|
8176
8214
|
ALL_AGENT_DEFINITIONS.map((d) => [d.config.role, d.budget])
|
|
8177
8215
|
)
|
|
@@ -9370,7 +9408,14 @@ ${personaLine}Task: ${task}
|
|
|
9370
9408
|
subagentIds.push(subagentId);
|
|
9371
9409
|
taskIds.push(taskId);
|
|
9372
9410
|
await coordinator.assign(spec);
|
|
9373
|
-
} catch {
|
|
9411
|
+
} catch (err) {
|
|
9412
|
+
console.error(JSON.stringify({
|
|
9413
|
+
level: "warn",
|
|
9414
|
+
event: "parallel_engine.spawn_failed",
|
|
9415
|
+
message: toErrorMessage(err),
|
|
9416
|
+
context: { slot: i, task, subagentId },
|
|
9417
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
9418
|
+
}));
|
|
9374
9419
|
}
|
|
9375
9420
|
})()
|
|
9376
9421
|
);
|
|
@@ -9395,7 +9440,14 @@ ${personaLine}Task: ${task}
|
|
|
9395
9440
|
} finally {
|
|
9396
9441
|
clearTimeout(timer);
|
|
9397
9442
|
}
|
|
9398
|
-
} catch {
|
|
9443
|
+
} catch (err) {
|
|
9444
|
+
console.error(JSON.stringify({
|
|
9445
|
+
level: "warn",
|
|
9446
|
+
event: "parallel_engine.brainstorm_results_failed",
|
|
9447
|
+
message: toErrorMessage(err),
|
|
9448
|
+
context: { slotCount, taskIds },
|
|
9449
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
9450
|
+
}));
|
|
9399
9451
|
results = coordinator.results().slice(-taskIds.length);
|
|
9400
9452
|
}
|
|
9401
9453
|
await Promise.allSettled(subagentIds.map((id) => coordinator.remove(id)));
|
|
@@ -9429,7 +9481,14 @@ ${personaLine}Task: ${task}
|
|
|
9429
9481
|
if (file) tasks.push(`[git] inspect and fix: ${file}`);
|
|
9430
9482
|
}
|
|
9431
9483
|
}
|
|
9432
|
-
} catch {
|
|
9484
|
+
} catch (err) {
|
|
9485
|
+
console.error(JSON.stringify({
|
|
9486
|
+
level: "warn",
|
|
9487
|
+
event: "parallel_engine.git_status_failed",
|
|
9488
|
+
message: toErrorMessage(err),
|
|
9489
|
+
context: { projectRoot: this.opts.projectRoot },
|
|
9490
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
9491
|
+
}));
|
|
9433
9492
|
}
|
|
9434
9493
|
}
|
|
9435
9494
|
if (tasks.length < this.slots) {
|
|
@@ -9999,14 +10058,20 @@ function parseDescriptionFromText(desc) {
|
|
|
9999
10058
|
}
|
|
10000
10059
|
|
|
10001
10060
|
// src/execution/model-runtime.ts
|
|
10002
|
-
function resolveModelRuntime(settings, reasoning) {
|
|
10061
|
+
function resolveModelRuntime(settings, reasoning, capabilities) {
|
|
10003
10062
|
const warnings = [];
|
|
10004
10063
|
if (!settings) {
|
|
10005
|
-
return { reasoning: void 0, cache: void 0, warnings };
|
|
10064
|
+
return { reasoning: void 0, cache: void 0, parameters: void 0, warnings };
|
|
10006
10065
|
}
|
|
10007
10066
|
const reasoningField = resolveReasoningForRequest(settings, reasoning, warnings);
|
|
10008
10067
|
const cacheField = resolveCacheForRequest(settings);
|
|
10009
|
-
|
|
10068
|
+
const paramsField = resolveParametersForRequest(settings.parameters, capabilities);
|
|
10069
|
+
return {
|
|
10070
|
+
reasoning: reasoningField,
|
|
10071
|
+
cache: cacheField,
|
|
10072
|
+
parameters: paramsField,
|
|
10073
|
+
warnings
|
|
10074
|
+
};
|
|
10010
10075
|
}
|
|
10011
10076
|
function resolveReasoningForRequest(settings, rc, warnings) {
|
|
10012
10077
|
const cfg = settings.reasoning;
|
|
@@ -10064,11 +10129,38 @@ function resolveCacheForRequest(settings, _warnings) {
|
|
|
10064
10129
|
const out = { ttl };
|
|
10065
10130
|
return out;
|
|
10066
10131
|
}
|
|
10132
|
+
function resolveParametersForRequest(params, caps, _warnings) {
|
|
10133
|
+
if (!params) return void 0;
|
|
10134
|
+
const out = {};
|
|
10135
|
+
if (params.topK !== void 0 && caps?.topK !== false) {
|
|
10136
|
+
out.topK = params.topK;
|
|
10137
|
+
}
|
|
10138
|
+
if (params.frequencyPenalty !== void 0 && caps?.frequencyPenalty !== false) {
|
|
10139
|
+
out.frequencyPenalty = params.frequencyPenalty;
|
|
10140
|
+
}
|
|
10141
|
+
if (params.presencePenalty !== void 0 && caps?.presencePenalty !== false) {
|
|
10142
|
+
out.presencePenalty = params.presencePenalty;
|
|
10143
|
+
}
|
|
10144
|
+
if (params.seed !== void 0 && caps?.seed !== false) {
|
|
10145
|
+
out.seed = params.seed;
|
|
10146
|
+
}
|
|
10147
|
+
if (params.user !== void 0) {
|
|
10148
|
+
out.user = params.user;
|
|
10149
|
+
}
|
|
10150
|
+
if (params.logprobs !== void 0 && caps?.logprobs !== false) {
|
|
10151
|
+
out.logprobs = params.logprobs;
|
|
10152
|
+
if (params.topLogprobs !== void 0) {
|
|
10153
|
+
out.topLogprobs = params.topLogprobs;
|
|
10154
|
+
}
|
|
10155
|
+
}
|
|
10156
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
10157
|
+
}
|
|
10067
10158
|
function applyModelRuntime(req, opts) {
|
|
10068
10159
|
const settings = opts.getSettings();
|
|
10069
10160
|
if (!settings) return req;
|
|
10070
10161
|
const rc = opts.getReasoningConfig();
|
|
10071
|
-
const
|
|
10162
|
+
const caps = opts.getCapabilities?.();
|
|
10163
|
+
const resolved = resolveModelRuntime(settings, rc, caps);
|
|
10072
10164
|
for (const w of resolved.warnings) opts.onWarning?.(w);
|
|
10073
10165
|
const next = { ...req };
|
|
10074
10166
|
if (resolved.reasoning !== void 0) {
|
|
@@ -10077,6 +10169,9 @@ function applyModelRuntime(req, opts) {
|
|
|
10077
10169
|
if (resolved.cache !== void 0) {
|
|
10078
10170
|
next.cache = resolved.cache;
|
|
10079
10171
|
}
|
|
10172
|
+
if (resolved.parameters !== void 0) {
|
|
10173
|
+
Object.assign(next, resolved.parameters);
|
|
10174
|
+
}
|
|
10080
10175
|
return next;
|
|
10081
10176
|
}
|
|
10082
10177
|
|