nexus-agents 3.13.0 → 3.13.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/{child-mcp-config-5SWBEZPD.js → child-mcp-config-7BVXTRAK.js} +2 -2
- package/dist/{chunk-AV3NVATT.js → chunk-272J6LG3.js} +3 -3
- package/dist/{chunk-JJAEGFPS.js → chunk-273B3NXK.js} +2 -2
- package/dist/{chunk-EQDV4YIW.js → chunk-2M32S75Y.js} +6 -6
- package/dist/{chunk-5HGMO3W3.js → chunk-3P6BF4ZZ.js} +5 -5
- package/dist/{chunk-5TE3ORD5.js → chunk-4EADBYQR.js} +2 -2
- package/dist/{chunk-LI5RF3H7.js → chunk-6VNJ5URR.js} +2 -2
- package/dist/{chunk-KTYTESEV.js → chunk-7T5F2DMR.js} +3 -3
- package/dist/chunk-7T5F2DMR.js.map +1 -0
- package/dist/{chunk-6BTRY45Y.js → chunk-AFN5LNPK.js} +99 -49
- package/dist/{chunk-6BTRY45Y.js.map → chunk-AFN5LNPK.js.map} +1 -1
- package/dist/{chunk-JHL7JLRJ.js → chunk-ANX5OL3K.js} +2 -2
- package/dist/{chunk-KHYSK52P.js → chunk-BQD3LH3W.js} +2 -2
- package/dist/{chunk-2ZVGB7AJ.js → chunk-BRUW6PDK.js} +2 -2
- package/dist/{chunk-5XTQIBA3.js → chunk-CTWF6AWK.js} +5 -5
- package/dist/{chunk-3W7ST3AB.js → chunk-EJOQKFG4.js} +2 -2
- package/dist/{chunk-OJPYOK4V.js → chunk-EROFMYLI.js} +3 -3
- package/dist/{chunk-PAJXMEHU.js → chunk-GSHTJLSW.js} +2 -2
- package/dist/{chunk-TPU5DT74.js → chunk-HYF37E3C.js} +7 -7
- package/dist/{chunk-ERHCCLT7.js → chunk-IU2O6F35.js} +8 -8
- package/dist/{chunk-BMLBXCC3.js → chunk-KP6S27ET.js} +2 -2
- package/dist/{chunk-VJ2LZ2ZM.js → chunk-KPLDOIT6.js} +2 -2
- package/dist/{chunk-CDWKQ5FV.js → chunk-MBDXGD5M.js} +2 -2
- package/dist/{chunk-C4BSQH3A.js → chunk-MJJEDOQO.js} +4 -4
- package/dist/{chunk-FWBR5P72.js → chunk-NYLND7NB.js} +2 -2
- package/dist/{chunk-HVFUWGGB.js → chunk-P7UJ4IC5.js} +3 -3
- package/dist/{chunk-J75ZZ3HI.js → chunk-RK5ZXR46.js} +5 -5
- package/dist/{chunk-7WIBQZR6.js → chunk-S6FP56Q5.js} +3 -3
- package/dist/{chunk-D34SUVBO.js → chunk-UKRC2VKZ.js} +4 -4
- package/dist/{chunk-NGQC5KIB.js → chunk-UN343DQX.js} +8 -8
- package/dist/{chunk-XXOE3OHH.js → chunk-UYU5F4AP.js} +2 -2
- package/dist/{chunk-GSRW2H3C.js → chunk-VLHCE5W2.js} +2 -2
- package/dist/{chunk-RGR22IN6.js → chunk-VRZUMXK5.js} +4 -4
- package/dist/{chunk-CODRIZMT.js → chunk-YEDOUAWT.js} +2 -2
- package/dist/{chunk-ABU3SZXU.js → chunk-YP2J6PEB.js} +8 -8
- package/dist/chunk-YP2J6PEB.js.map +1 -0
- package/dist/{chunk-6GKG5U5Y.js → chunk-YTXNIVCI.js} +2 -2
- package/dist/{cli-circuit-breaker-WKUYRX5M.js → cli-circuit-breaker-T3HALZLW.js} +3 -3
- package/dist/cli.js +41 -41
- package/dist/{composite-router-SKXMG4DA.js → composite-router-HCZI2IRJ.js} +2 -2
- package/dist/{consensus-vote-FGB637PZ.js → consensus-vote-4Y5XZ3FE.js} +16 -16
- package/dist/{context-retriever-NK6O77TT.js → context-retriever-4IQTH3QJ.js} +8 -8
- package/dist/{doctor-deep-EJAW6SI5.js → doctor-deep-X4Y5TR3J.js} +3 -3
- package/dist/{doctor-live-26YJA5Z4.js → doctor-live-VO3TS52X.js} +9 -9
- package/dist/{expert-bridge-PNXWIDQV.js → expert-bridge-2GOWBBVP.js} +4 -4
- package/dist/{factory-KVIEFTAC.js → factory-2BTUL2LI.js} +5 -5
- package/dist/{factory-MXWNULXD.js → factory-3OKL3F4G.js} +9 -9
- package/dist/{improvement-review-HKJNXMZM.js → improvement-review-3GY77IOS.js} +5 -5
- package/dist/index.d.ts +9 -3
- package/dist/index.js +30 -30
- package/dist/{init-opencode-7IU4SWTC.js → init-opencode-32HGTO3Z.js} +6 -6
- package/dist/issue-triage-I5XOPQ3Y.js +17 -0
- package/dist/{pr-reviewer-helpers-SUMMYYF7.js → pr-reviewer-helpers-AXTU345T.js} +4 -4
- package/dist/{registry-command-XFH3M634.js → registry-command-GMYKWA6P.js} +2 -2
- package/dist/{repo-security-plan-RCYKT5GS.js → repo-security-plan-OGGXIUYZ.js} +3 -3
- package/dist/{research-helpers-synthesize-BVJB4HW5.js → research-helpers-synthesize-JAECA6EC.js} +4 -4
- package/dist/{routing-memory-AR4YR2RL.js → routing-memory-FBZMNOKG.js} +2 -2
- package/dist/{session-memory-UYJU63EG.js → session-memory-SPBLB72Z.js} +3 -3
- package/dist/{setup-command-GCDDJMCC.js → setup-command-PJ54ZXPD.js} +14 -14
- package/dist/{setup-config-XZMHAOMR.js → setup-config-NPUDZ5FP.js} +3 -3
- package/dist/{setup-custom-api-BWX47BKD.js → setup-custom-api-SU45OZ7V.js} +4 -4
- package/dist/{tool-memory-DB3YDR5W.js → tool-memory-EAAL47XK.js} +5 -5
- package/dist/{unified-registry-XSY5XAIZ.js → unified-registry-42RRNTZS.js} +10 -10
- package/dist/{weather-report-C2P6NHTX.js → weather-report-5LB2V7NS.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-ABU3SZXU.js.map +0 -1
- package/dist/chunk-KTYTESEV.js.map +0 -1
- package/dist/issue-triage-EKFJQZFJ.js +0 -17
- /package/dist/{child-mcp-config-5SWBEZPD.js.map → child-mcp-config-7BVXTRAK.js.map} +0 -0
- /package/dist/{chunk-AV3NVATT.js.map → chunk-272J6LG3.js.map} +0 -0
- /package/dist/{chunk-JJAEGFPS.js.map → chunk-273B3NXK.js.map} +0 -0
- /package/dist/{chunk-EQDV4YIW.js.map → chunk-2M32S75Y.js.map} +0 -0
- /package/dist/{chunk-5HGMO3W3.js.map → chunk-3P6BF4ZZ.js.map} +0 -0
- /package/dist/{chunk-5TE3ORD5.js.map → chunk-4EADBYQR.js.map} +0 -0
- /package/dist/{chunk-LI5RF3H7.js.map → chunk-6VNJ5URR.js.map} +0 -0
- /package/dist/{chunk-JHL7JLRJ.js.map → chunk-ANX5OL3K.js.map} +0 -0
- /package/dist/{chunk-KHYSK52P.js.map → chunk-BQD3LH3W.js.map} +0 -0
- /package/dist/{chunk-2ZVGB7AJ.js.map → chunk-BRUW6PDK.js.map} +0 -0
- /package/dist/{chunk-5XTQIBA3.js.map → chunk-CTWF6AWK.js.map} +0 -0
- /package/dist/{chunk-3W7ST3AB.js.map → chunk-EJOQKFG4.js.map} +0 -0
- /package/dist/{chunk-OJPYOK4V.js.map → chunk-EROFMYLI.js.map} +0 -0
- /package/dist/{chunk-PAJXMEHU.js.map → chunk-GSHTJLSW.js.map} +0 -0
- /package/dist/{chunk-TPU5DT74.js.map → chunk-HYF37E3C.js.map} +0 -0
- /package/dist/{chunk-ERHCCLT7.js.map → chunk-IU2O6F35.js.map} +0 -0
- /package/dist/{chunk-BMLBXCC3.js.map → chunk-KP6S27ET.js.map} +0 -0
- /package/dist/{chunk-VJ2LZ2ZM.js.map → chunk-KPLDOIT6.js.map} +0 -0
- /package/dist/{chunk-CDWKQ5FV.js.map → chunk-MBDXGD5M.js.map} +0 -0
- /package/dist/{chunk-C4BSQH3A.js.map → chunk-MJJEDOQO.js.map} +0 -0
- /package/dist/{chunk-FWBR5P72.js.map → chunk-NYLND7NB.js.map} +0 -0
- /package/dist/{chunk-HVFUWGGB.js.map → chunk-P7UJ4IC5.js.map} +0 -0
- /package/dist/{chunk-J75ZZ3HI.js.map → chunk-RK5ZXR46.js.map} +0 -0
- /package/dist/{chunk-7WIBQZR6.js.map → chunk-S6FP56Q5.js.map} +0 -0
- /package/dist/{chunk-D34SUVBO.js.map → chunk-UKRC2VKZ.js.map} +0 -0
- /package/dist/{chunk-NGQC5KIB.js.map → chunk-UN343DQX.js.map} +0 -0
- /package/dist/{chunk-XXOE3OHH.js.map → chunk-UYU5F4AP.js.map} +0 -0
- /package/dist/{chunk-GSRW2H3C.js.map → chunk-VLHCE5W2.js.map} +0 -0
- /package/dist/{chunk-RGR22IN6.js.map → chunk-VRZUMXK5.js.map} +0 -0
- /package/dist/{chunk-CODRIZMT.js.map → chunk-YEDOUAWT.js.map} +0 -0
- /package/dist/{chunk-6GKG5U5Y.js.map → chunk-YTXNIVCI.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-WKUYRX5M.js.map → cli-circuit-breaker-T3HALZLW.js.map} +0 -0
- /package/dist/{composite-router-SKXMG4DA.js.map → composite-router-HCZI2IRJ.js.map} +0 -0
- /package/dist/{consensus-vote-FGB637PZ.js.map → consensus-vote-4Y5XZ3FE.js.map} +0 -0
- /package/dist/{context-retriever-NK6O77TT.js.map → context-retriever-4IQTH3QJ.js.map} +0 -0
- /package/dist/{doctor-deep-EJAW6SI5.js.map → doctor-deep-X4Y5TR3J.js.map} +0 -0
- /package/dist/{doctor-live-26YJA5Z4.js.map → doctor-live-VO3TS52X.js.map} +0 -0
- /package/dist/{expert-bridge-PNXWIDQV.js.map → expert-bridge-2GOWBBVP.js.map} +0 -0
- /package/dist/{factory-KVIEFTAC.js.map → factory-2BTUL2LI.js.map} +0 -0
- /package/dist/{factory-MXWNULXD.js.map → factory-3OKL3F4G.js.map} +0 -0
- /package/dist/{improvement-review-HKJNXMZM.js.map → improvement-review-3GY77IOS.js.map} +0 -0
- /package/dist/{init-opencode-7IU4SWTC.js.map → init-opencode-32HGTO3Z.js.map} +0 -0
- /package/dist/{issue-triage-EKFJQZFJ.js.map → issue-triage-I5XOPQ3Y.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-SUMMYYF7.js.map → pr-reviewer-helpers-AXTU345T.js.map} +0 -0
- /package/dist/{registry-command-XFH3M634.js.map → registry-command-GMYKWA6P.js.map} +0 -0
- /package/dist/{repo-security-plan-RCYKT5GS.js.map → repo-security-plan-OGGXIUYZ.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-BVJB4HW5.js.map → research-helpers-synthesize-JAECA6EC.js.map} +0 -0
- /package/dist/{routing-memory-AR4YR2RL.js.map → routing-memory-FBZMNOKG.js.map} +0 -0
- /package/dist/{session-memory-UYJU63EG.js.map → session-memory-SPBLB72Z.js.map} +0 -0
- /package/dist/{setup-command-GCDDJMCC.js.map → setup-command-PJ54ZXPD.js.map} +0 -0
- /package/dist/{setup-config-XZMHAOMR.js.map → setup-config-NPUDZ5FP.js.map} +0 -0
- /package/dist/{setup-custom-api-BWX47BKD.js.map → setup-custom-api-SU45OZ7V.js.map} +0 -0
- /package/dist/{tool-memory-DB3YDR5W.js.map → tool-memory-EAAL47XK.js.map} +0 -0
- /package/dist/{unified-registry-XSY5XAIZ.js.map → unified-registry-42RRNTZS.js.map} +0 -0
- /package/dist/{weather-report-C2P6NHTX.js.map → weather-report-5LB2V7NS.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MBDXGD5M.js";
|
|
4
4
|
import {
|
|
5
5
|
analyzeGitHubRepo
|
|
6
6
|
} from "./chunk-HFOQKCD2.js";
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
24
24
|
clampTaskTtl
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IU2O6F35.js";
|
|
26
26
|
import {
|
|
27
27
|
executeExpert
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HYF37E3C.js";
|
|
29
29
|
import {
|
|
30
30
|
JobStatusSchema,
|
|
31
31
|
abortJob,
|
|
@@ -46,24 +46,24 @@ import {
|
|
|
46
46
|
simulationDeniedResult,
|
|
47
47
|
toJobSummary,
|
|
48
48
|
writeJobCancelled
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-YP2J6PEB.js";
|
|
50
50
|
import {
|
|
51
51
|
allOf
|
|
52
52
|
} from "./chunk-OQB3XC5O.js";
|
|
53
53
|
import {
|
|
54
54
|
normalizeTopicToCanonical,
|
|
55
55
|
synthesizeResearch
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-272J6LG3.js";
|
|
57
57
|
import {
|
|
58
58
|
IssueTriage
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-2M32S75Y.js";
|
|
60
60
|
import {
|
|
61
61
|
resolveEnvMode,
|
|
62
62
|
sanitizeInput
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-YEDOUAWT.js";
|
|
64
64
|
import {
|
|
65
65
|
withPrerequisite
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-P7UJ4IC5.js";
|
|
67
67
|
import {
|
|
68
68
|
NOOP_NOTIFIER,
|
|
69
69
|
RateLimiter,
|
|
@@ -86,18 +86,18 @@ import {
|
|
|
86
86
|
withAuditTrail,
|
|
87
87
|
withProgressHeartbeat,
|
|
88
88
|
wrapToolWithTimeout
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-S6FP56Q5.js";
|
|
90
90
|
import {
|
|
91
91
|
createAuditTrail,
|
|
92
92
|
createGraphAuditBridge,
|
|
93
93
|
emitPipelinePolicyEvent
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-KP6S27ET.js";
|
|
95
95
|
import {
|
|
96
96
|
EventTopics,
|
|
97
97
|
createEvent,
|
|
98
98
|
getGlobalEventBus,
|
|
99
99
|
getGlobalRegistry
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-VRZUMXK5.js";
|
|
101
101
|
import {
|
|
102
102
|
IDENTIFIER_RE,
|
|
103
103
|
LANG_VALUES,
|
|
@@ -130,31 +130,31 @@ import {
|
|
|
130
130
|
parseRegistry,
|
|
131
131
|
sourceExistsInRegistry,
|
|
132
132
|
summarizeContextForPrompt
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-CTWF6AWK.js";
|
|
134
134
|
import {
|
|
135
135
|
loadPapersRegistry,
|
|
136
136
|
loadTechniquesRegistry
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-BQD3LH3W.js";
|
|
138
138
|
import {
|
|
139
139
|
resolveInsideRoot
|
|
140
140
|
} from "./chunk-NUBSJGQZ.js";
|
|
141
141
|
import {
|
|
142
142
|
getTokenEnvVars,
|
|
143
143
|
resolveToken
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-6VNJ5URR.js";
|
|
145
145
|
import {
|
|
146
146
|
DEFAULT_RELEVANCE_CONFIG,
|
|
147
147
|
MemoryImportance,
|
|
148
148
|
calculateTextJaccardSimilarity,
|
|
149
149
|
getToolMemory
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-MJJEDOQO.js";
|
|
151
151
|
import {
|
|
152
152
|
STOPWORDS,
|
|
153
153
|
truncateWithInfo
|
|
154
154
|
} from "./chunk-6T3EPABN.js";
|
|
155
155
|
import {
|
|
156
156
|
createSessionMemory
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-ANX5OL3K.js";
|
|
158
158
|
import {
|
|
159
159
|
BUILT_IN_EXPERTS,
|
|
160
160
|
BuiltInExpertTypeSchema,
|
|
@@ -172,25 +172,25 @@ import {
|
|
|
172
172
|
getAvailableClis,
|
|
173
173
|
sleep,
|
|
174
174
|
withTimeout
|
|
175
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-UN343DQX.js";
|
|
176
176
|
import {
|
|
177
177
|
BaseAdapter,
|
|
178
178
|
createStream,
|
|
179
179
|
requireApiKey,
|
|
180
180
|
validateApiKeyPresence
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-4EADBYQR.js";
|
|
182
182
|
import {
|
|
183
183
|
DEFAULTS
|
|
184
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-NYLND7NB.js";
|
|
185
185
|
import {
|
|
186
186
|
getAvailabilityCache,
|
|
187
187
|
getCliForModelId,
|
|
188
188
|
resolveFallback
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-UYU5F4AP.js";
|
|
190
190
|
import {
|
|
191
191
|
generateHyphenId,
|
|
192
192
|
generateUUID
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-YTXNIVCI.js";
|
|
194
194
|
import {
|
|
195
195
|
AGENT_ROUTER_TIMEOUTS,
|
|
196
196
|
API_TIMEOUTS,
|
|
@@ -289,7 +289,7 @@ import {
|
|
|
289
289
|
selectStrategyByManifest,
|
|
290
290
|
toExpertTaskAnalysisResult,
|
|
291
291
|
withStep
|
|
292
|
-
} from "./chunk-
|
|
292
|
+
} from "./chunk-7T5F2DMR.js";
|
|
293
293
|
import {
|
|
294
294
|
ensureLearningDir,
|
|
295
295
|
getMetaOutcomesFile,
|
|
@@ -22474,11 +22474,22 @@ function extractErrorMessage2(error) {
|
|
|
22474
22474
|
}
|
|
22475
22475
|
return error.message;
|
|
22476
22476
|
}
|
|
22477
|
-
|
|
22477
|
+
var NON_RETRYABLE_CODES = /* @__PURE__ */ new Set([
|
|
22478
|
+
ErrorCode.VALIDATION_ERROR,
|
|
22479
|
+
ErrorCode.WORKFLOW_PARSE_ERROR,
|
|
22480
|
+
ErrorCode.INVALID_INPUT
|
|
22481
|
+
]);
|
|
22482
|
+
function isNonRetryableSelf(error) {
|
|
22478
22483
|
if (error.name === "ValidationError") return true;
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22484
|
+
return error instanceof NexusError && NON_RETRYABLE_CODES.has(error.code);
|
|
22485
|
+
}
|
|
22486
|
+
function isNonRetryableError(error) {
|
|
22487
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22488
|
+
let current = error;
|
|
22489
|
+
while (current instanceof Error && !seen.has(current)) {
|
|
22490
|
+
seen.add(current);
|
|
22491
|
+
if (isNonRetryableSelf(current)) return true;
|
|
22492
|
+
current = current.cause;
|
|
22482
22493
|
}
|
|
22483
22494
|
return false;
|
|
22484
22495
|
}
|
|
@@ -22645,11 +22656,13 @@ var StepExecutor = class {
|
|
|
22645
22656
|
})
|
|
22646
22657
|
);
|
|
22647
22658
|
}
|
|
22659
|
+
const tokensUsed = taskResult.value.metadata.tokensUsed;
|
|
22648
22660
|
return ok({
|
|
22649
22661
|
stepId: step.id,
|
|
22650
22662
|
output: taskResult.value.output,
|
|
22651
22663
|
durationMs: getTimeProvider().now() - startTime,
|
|
22652
|
-
status: "success"
|
|
22664
|
+
status: "success",
|
|
22665
|
+
...typeof tokensUsed === "number" ? { tokensUsed } : {}
|
|
22653
22666
|
});
|
|
22654
22667
|
} catch (error) {
|
|
22655
22668
|
return this.handleExecutionError(error, step, timeoutMs);
|
|
@@ -23233,12 +23246,22 @@ function enforceStepBudgets(options) {
|
|
|
23233
23246
|
return ok(void 0);
|
|
23234
23247
|
}
|
|
23235
23248
|
function recordPhaseUsage(results, context) {
|
|
23236
|
-
if (context.budgetCircuitBreaker === void 0)
|
|
23237
|
-
|
|
23249
|
+
if (context.budgetCircuitBreaker === void 0) {
|
|
23250
|
+
return { recordedSteps: 0, unmeasuredSteps: 0, tokensRecorded: 0 };
|
|
23251
|
+
}
|
|
23252
|
+
let unmeasuredSteps = 0;
|
|
23253
|
+
let recordedSteps = 0;
|
|
23254
|
+
let tokensRecorded = 0;
|
|
23238
23255
|
for (const result of results) {
|
|
23239
|
-
|
|
23240
|
-
|
|
23256
|
+
if (typeof result.tokensUsed !== "number") {
|
|
23257
|
+
unmeasuredSteps += 1;
|
|
23258
|
+
continue;
|
|
23259
|
+
}
|
|
23260
|
+
context.budgetCircuitBreaker.recordUsage(result.tokensUsed);
|
|
23261
|
+
recordedSteps += 1;
|
|
23262
|
+
tokensRecorded += result.tokensUsed;
|
|
23241
23263
|
}
|
|
23264
|
+
return { recordedSteps, unmeasuredSteps, tokensRecorded };
|
|
23242
23265
|
}
|
|
23243
23266
|
|
|
23244
23267
|
// src/workflows/workflow-engine.ts
|
|
@@ -23409,6 +23432,23 @@ var WorkflowEngine = class {
|
|
|
23409
23432
|
}
|
|
23410
23433
|
return ok(void 0);
|
|
23411
23434
|
}
|
|
23435
|
+
/**
|
|
23436
|
+
* Surface incomplete budget accounting (#4673).
|
|
23437
|
+
*
|
|
23438
|
+
* `recordPhaseUsage` returns which steps it could actually account for. A
|
|
23439
|
+
* ledger containing unmeasured steps is a LOWER BOUND on spend, and that is
|
|
23440
|
+
* precisely what anyone enabling enforcement needs to know before trusting
|
|
23441
|
+
* the cap — so it is reported rather than dropped.
|
|
23442
|
+
*/
|
|
23443
|
+
reportUsageCoverage(usage, workflowName) {
|
|
23444
|
+
if (usage.unmeasuredSteps === 0) return;
|
|
23445
|
+
this.logger.warn("Budget ledger is incomplete \u2014 recorded spend is a lower bound", {
|
|
23446
|
+
workflow: workflowName,
|
|
23447
|
+
unmeasuredSteps: usage.unmeasuredSteps,
|
|
23448
|
+
recordedSteps: usage.recordedSteps,
|
|
23449
|
+
tokensRecorded: usage.tokensRecorded
|
|
23450
|
+
});
|
|
23451
|
+
}
|
|
23412
23452
|
async executePhases(plan, context, workflow, phaseTimeoutMs) {
|
|
23413
23453
|
const allResults = [];
|
|
23414
23454
|
const totalSteps = plan.phases.reduce((sum, p) => sum + p.steps.length, 0);
|
|
@@ -23441,7 +23481,7 @@ var WorkflowEngine = class {
|
|
|
23441
23481
|
};
|
|
23442
23482
|
const phaseResult = await this.deps.executePhase(phase.steps, context, options);
|
|
23443
23483
|
if (!phaseResult.ok) return phaseResult;
|
|
23444
|
-
recordPhaseUsage(phaseResult.value, context);
|
|
23484
|
+
this.reportUsageCoverage(recordPhaseUsage(phaseResult.value, context), workflow.name);
|
|
23445
23485
|
for (const result of phaseResult.value) {
|
|
23446
23486
|
context.stepResults.set(result.stepId, result);
|
|
23447
23487
|
allResults.push(result);
|
|
@@ -28371,7 +28411,7 @@ function execIdFields(executionId) {
|
|
|
28371
28411
|
async function populateUnifiedContextOnState(state, options) {
|
|
28372
28412
|
const taskCandidate = state["task"];
|
|
28373
28413
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
28374
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
28414
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-4IQTH3QJ.js");
|
|
28375
28415
|
const category = inferTaskCategory2(taskCandidate);
|
|
28376
28416
|
const executionId = options?.executionId;
|
|
28377
28417
|
const execFields = execIdFields(executionId);
|
|
@@ -44029,7 +44069,7 @@ async function tryIssueTriage(task) {
|
|
|
44029
44069
|
try {
|
|
44030
44070
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
44031
44071
|
if (issueMatch === null) return null;
|
|
44032
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
44072
|
+
const { createIssueTriage } = await import("./issue-triage-I5XOPQ3Y.js");
|
|
44033
44073
|
const triage = createIssueTriage();
|
|
44034
44074
|
const owner = issueMatch[1] ?? "";
|
|
44035
44075
|
const num = issueMatch[2] ?? "";
|
|
@@ -44057,7 +44097,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
44057
44097
|
]);
|
|
44058
44098
|
async function classifyWithLLM(task) {
|
|
44059
44099
|
try {
|
|
44060
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
44100
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-2GOWBBVP.js");
|
|
44061
44101
|
const prompt = [
|
|
44062
44102
|
"Classify this task into exactly one pipeline template.",
|
|
44063
44103
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -45784,7 +45824,7 @@ var memoryInitPromise = null;
|
|
|
45784
45824
|
async function initPipelineMemory() {
|
|
45785
45825
|
if (cachedMemory !== null) return cachedMemory;
|
|
45786
45826
|
try {
|
|
45787
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
45827
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-SPBLB72Z.js");
|
|
45788
45828
|
const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
|
|
45789
45829
|
const mem = createSessionMemory2(getLearningDir());
|
|
45790
45830
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
@@ -45846,7 +45886,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
|
|
|
45846
45886
|
callRecord(routingMemoryCache);
|
|
45847
45887
|
return;
|
|
45848
45888
|
}
|
|
45849
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
45889
|
+
routingMemoryInitPromise ??= import("./routing-memory-FBZMNOKG.js").then(({ createRoutingMemory }) => {
|
|
45850
45890
|
routingMemoryCache ??= createRoutingMemory();
|
|
45851
45891
|
return routingMemoryCache;
|
|
45852
45892
|
}).catch((error) => {
|
|
@@ -45880,7 +45920,7 @@ ${text}` : "";
|
|
|
45880
45920
|
}
|
|
45881
45921
|
async function getWeatherContext() {
|
|
45882
45922
|
try {
|
|
45883
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
45923
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-5LB2V7NS.js");
|
|
45884
45924
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
45885
45925
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
45886
45926
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -45898,7 +45938,7 @@ ${lines}
|
|
|
45898
45938
|
}
|
|
45899
45939
|
async function getMemoryContext(task) {
|
|
45900
45940
|
try {
|
|
45901
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
45941
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-SPBLB72Z.js");
|
|
45902
45942
|
const { getLearningDir } = await import("./learning-persistence-EGY4VKKO.js");
|
|
45903
45943
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
45904
45944
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -46017,7 +46057,7 @@ ${contextBlock}`;
|
|
|
46017
46057
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
46018
46058
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
46019
46059
|
try {
|
|
46020
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
46060
|
+
const { executeVoting } = await import("./consensus-vote-4Y5XZ3FE.js");
|
|
46021
46061
|
const votingResult = await executeVoting(
|
|
46022
46062
|
{
|
|
46023
46063
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -46456,7 +46496,7 @@ async function searchCodebaseForTask(task) {
|
|
|
46456
46496
|
}
|
|
46457
46497
|
async function queryResearchRegistry(task) {
|
|
46458
46498
|
try {
|
|
46459
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
46499
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-JAECA6EC.js");
|
|
46460
46500
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
46461
46501
|
if (topic === void 0) return null;
|
|
46462
46502
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -46527,7 +46567,7 @@ function createScanStageWrapper() {
|
|
|
46527
46567
|
try {
|
|
46528
46568
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
46529
46569
|
if (slug !== void 0) {
|
|
46530
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
46570
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-OGGXIUYZ.js");
|
|
46531
46571
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
46532
46572
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
46533
46573
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -49616,7 +49656,7 @@ var GitHubTaskTracker = class {
|
|
|
49616
49656
|
cachedProvider = null;
|
|
49617
49657
|
async getProvider() {
|
|
49618
49658
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
49619
|
-
const { createScmProvider } = await import("./factory-
|
|
49659
|
+
const { createScmProvider } = await import("./factory-2BTUL2LI.js");
|
|
49620
49660
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
49621
49661
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
49622
49662
|
this.cachedProvider = result.value;
|
|
@@ -50466,7 +50506,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
50466
50506
|
}
|
|
50467
50507
|
}
|
|
50468
50508
|
async function defaultSources(includeOpenRouter) {
|
|
50469
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
50509
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-3OKL3F4G.js");
|
|
50470
50510
|
const adapters = createAllAdapters2();
|
|
50471
50511
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
50472
50512
|
}
|
|
@@ -52469,6 +52509,10 @@ function createTaskOutcome(params) {
|
|
|
52469
52509
|
|
|
52470
52510
|
// src/learning/outcome-feedback.ts
|
|
52471
52511
|
var logger53 = createLogger({ component: "OutcomeFeedback" });
|
|
52512
|
+
function ratioBonus(target, actual, weight) {
|
|
52513
|
+
if (!Number.isFinite(actual) || actual <= 0) return 0;
|
|
52514
|
+
return Math.min(1, target / actual) * weight;
|
|
52515
|
+
}
|
|
52472
52516
|
var OutcomeFeedbackCollector = class {
|
|
52473
52517
|
config;
|
|
52474
52518
|
pendingDecisions = /* @__PURE__ */ new Map();
|
|
@@ -52566,10 +52610,16 @@ var OutcomeFeedbackCollector = class {
|
|
|
52566
52610
|
baseReward = signals.completionRatio;
|
|
52567
52611
|
}
|
|
52568
52612
|
const qualityBonus = outcome.qualityScore * this.config.qualityWeight;
|
|
52569
|
-
const
|
|
52570
|
-
|
|
52571
|
-
|
|
52572
|
-
|
|
52613
|
+
const speedBonus = ratioBonus(
|
|
52614
|
+
this.config.targetDurationMs,
|
|
52615
|
+
outcome.durationMs,
|
|
52616
|
+
this.config.speedWeight
|
|
52617
|
+
);
|
|
52618
|
+
const efficiencyBonus = ratioBonus(
|
|
52619
|
+
this.config.targetTokenUsage,
|
|
52620
|
+
outcome.tokenUsage,
|
|
52621
|
+
this.config.efficiencyWeight
|
|
52622
|
+
);
|
|
52573
52623
|
const retryPenalty = signals.retryCount * this.config.retryPenalty;
|
|
52574
52624
|
const rawReward = baseReward + qualityBonus + speedBonus + efficiencyBonus - retryPenalty;
|
|
52575
52625
|
const reward = clamp01(rawReward);
|
|
@@ -54498,4 +54548,4 @@ export {
|
|
|
54498
54548
|
shutdownFeedbackSubscriber,
|
|
54499
54549
|
createEventBusBridge
|
|
54500
54550
|
};
|
|
54501
|
-
//# sourceMappingURL=chunk-
|
|
54551
|
+
//# sourceMappingURL=chunk-AFN5LNPK.js.map
|