nexus-agents 2.30.7 → 2.31.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/{adaptive-memory-THOGYVKK.js → adaptive-memory-EDCJHRH3.js} +3 -3
- package/dist/{chunk-2L6A7RUZ.js → chunk-2JPQ2ICM.js} +3 -3
- package/dist/{chunk-23G7NV6B.js → chunk-4VB3PQTO.js} +6 -6
- package/dist/{chunk-ZVUNIQLB.js → chunk-6BOVBYY5.js} +22 -7
- package/dist/chunk-6BOVBYY5.js.map +1 -0
- package/dist/{chunk-ZXIFNJ7Q.js → chunk-6SUCK2NV.js} +2 -2
- package/dist/{chunk-7GW7ZRJ3.js → chunk-7DNUEEGG.js} +112 -46
- package/dist/{chunk-7GW7ZRJ3.js.map → chunk-7DNUEEGG.js.map} +1 -1
- package/dist/{chunk-6V3HZQRC.js → chunk-7PZGCG37.js} +2 -2
- package/dist/{chunk-32ZTPL7Q.js → chunk-DGMLBF4U.js} +2 -2
- package/dist/{chunk-YSBHF2TG.js → chunk-FO6C5AQ6.js} +2 -2
- package/dist/{chunk-UMM5PVLB.js → chunk-FPBRLZXV.js} +2 -2
- package/dist/{chunk-I66ZKP33.js → chunk-GLOJ6EDL.js} +2 -2
- package/dist/{chunk-GNR437CG.js → chunk-K5N4OL66.js} +321 -63
- package/dist/chunk-K5N4OL66.js.map +1 -0
- package/dist/{chunk-42FGTDIW.js → chunk-MNHC65DB.js} +4 -4
- package/dist/{chunk-IFIRZ35E.js → chunk-OREUX6UF.js} +2 -2
- package/dist/{chunk-WGP6G6QU.js → chunk-PR7QRV6S.js} +6 -6
- package/dist/{chunk-V7GL5HZF.js → chunk-PTLZM2LZ.js} +3 -3
- package/dist/{chunk-HIVFP5CS.js → chunk-R4LU2LYM.js} +4 -4
- package/dist/{chunk-2HAZZAU5.js → chunk-SUDYZIVI.js} +2 -2
- package/dist/{chunk-2W7AM3I7.js → chunk-VUJ2PDT7.js} +3 -3
- package/dist/{chunk-GUO4TIIX.js → chunk-WFG3BWWK.js} +2 -2
- package/dist/{chunk-VCYDKMGJ.js → chunk-YLDYHQ4Y.js} +2 -2
- package/dist/{cli-circuit-breaker-MBTG6XC7.js → cli-circuit-breaker-U3XLQNCL.js} +4 -4
- package/dist/cli.js +22 -20
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-IRF52MS7.js → composite-router-QGP6USAP.js} +2 -2
- package/dist/{consensus-vote-MFGKPIAO.js → consensus-vote-GEQK32G7.js} +7 -7
- package/dist/{doctor-deep-RMOKEOCC.js → doctor-deep-3VFOZERZ.js} +3 -3
- package/dist/{expert-bridge-IKR23WRI.js → expert-bridge-RDY47MFM.js} +3 -3
- package/dist/{factory-FYHY577A.js → factory-3DVB6TV6.js} +4 -4
- package/dist/{factory-SUZOQZOE.js → factory-VEXE4RXU.js} +5 -5
- package/dist/index.d.ts +34 -34
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/{issue-triage-KGXVGBZR.js → issue-triage-SCQMQI6A.js} +4 -4
- package/dist/{mcp-config-PS73M32C.js → mcp-config-F6ZJD564.js} +3 -3
- package/dist/{mobimem-ATF4YCSJ.js → mobimem-XYRENZW7.js} +2 -2
- package/dist/{repo-security-plan-VMTRN3PJ.js → repo-security-plan-XPOOUKAV.js} +3 -3
- package/dist/research-helpers-synthesize-MRO44W5J.js +10 -0
- package/dist/{routing-memory-5VJTEGLC.js → routing-memory-YUETBIJU.js} +2 -2
- package/dist/{session-memory-UA3L4Q6K.js → session-memory-7MHDTB6O.js} +3 -3
- package/dist/{setup-command-SP43B2UM.js → setup-command-LZB74W4I.js} +7 -7
- package/dist/{setup-config-IJ6RFRA4.js → setup-config-KPMWBIHD.js} +3 -3
- package/dist/{weather-report-B43EV36T.js → weather-report-3WN4FVQ6.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-GNR437CG.js.map +0 -1
- package/dist/chunk-ZVUNIQLB.js.map +0 -1
- package/dist/research-helpers-synthesize-A6ZTAYLN.js +0 -10
- /package/dist/{adaptive-memory-THOGYVKK.js.map → adaptive-memory-EDCJHRH3.js.map} +0 -0
- /package/dist/{chunk-2L6A7RUZ.js.map → chunk-2JPQ2ICM.js.map} +0 -0
- /package/dist/{chunk-23G7NV6B.js.map → chunk-4VB3PQTO.js.map} +0 -0
- /package/dist/{chunk-ZXIFNJ7Q.js.map → chunk-6SUCK2NV.js.map} +0 -0
- /package/dist/{chunk-6V3HZQRC.js.map → chunk-7PZGCG37.js.map} +0 -0
- /package/dist/{chunk-32ZTPL7Q.js.map → chunk-DGMLBF4U.js.map} +0 -0
- /package/dist/{chunk-YSBHF2TG.js.map → chunk-FO6C5AQ6.js.map} +0 -0
- /package/dist/{chunk-UMM5PVLB.js.map → chunk-FPBRLZXV.js.map} +0 -0
- /package/dist/{chunk-I66ZKP33.js.map → chunk-GLOJ6EDL.js.map} +0 -0
- /package/dist/{chunk-42FGTDIW.js.map → chunk-MNHC65DB.js.map} +0 -0
- /package/dist/{chunk-IFIRZ35E.js.map → chunk-OREUX6UF.js.map} +0 -0
- /package/dist/{chunk-WGP6G6QU.js.map → chunk-PR7QRV6S.js.map} +0 -0
- /package/dist/{chunk-V7GL5HZF.js.map → chunk-PTLZM2LZ.js.map} +0 -0
- /package/dist/{chunk-HIVFP5CS.js.map → chunk-R4LU2LYM.js.map} +0 -0
- /package/dist/{chunk-2HAZZAU5.js.map → chunk-SUDYZIVI.js.map} +0 -0
- /package/dist/{chunk-2W7AM3I7.js.map → chunk-VUJ2PDT7.js.map} +0 -0
- /package/dist/{chunk-GUO4TIIX.js.map → chunk-WFG3BWWK.js.map} +0 -0
- /package/dist/{chunk-VCYDKMGJ.js.map → chunk-YLDYHQ4Y.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-MBTG6XC7.js.map → cli-circuit-breaker-U3XLQNCL.js.map} +0 -0
- /package/dist/{composite-router-IRF52MS7.js.map → composite-router-QGP6USAP.js.map} +0 -0
- /package/dist/{consensus-vote-MFGKPIAO.js.map → consensus-vote-GEQK32G7.js.map} +0 -0
- /package/dist/{doctor-deep-RMOKEOCC.js.map → doctor-deep-3VFOZERZ.js.map} +0 -0
- /package/dist/{expert-bridge-IKR23WRI.js.map → expert-bridge-RDY47MFM.js.map} +0 -0
- /package/dist/{factory-FYHY577A.js.map → factory-3DVB6TV6.js.map} +0 -0
- /package/dist/{factory-SUZOQZOE.js.map → factory-VEXE4RXU.js.map} +0 -0
- /package/dist/{issue-triage-KGXVGBZR.js.map → issue-triage-SCQMQI6A.js.map} +0 -0
- /package/dist/{mcp-config-PS73M32C.js.map → mcp-config-F6ZJD564.js.map} +0 -0
- /package/dist/{mobimem-ATF4YCSJ.js.map → mobimem-XYRENZW7.js.map} +0 -0
- /package/dist/{repo-security-plan-VMTRN3PJ.js.map → repo-security-plan-XPOOUKAV.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-A6ZTAYLN.js.map → research-helpers-synthesize-MRO44W5J.js.map} +0 -0
- /package/dist/{routing-memory-5VJTEGLC.js.map → routing-memory-YUETBIJU.js.map} +0 -0
- /package/dist/{session-memory-UA3L4Q6K.js.map → session-memory-7MHDTB6O.js.map} +0 -0
- /package/dist/{setup-command-SP43B2UM.js.map → setup-command-LZB74W4I.js.map} +0 -0
- /package/dist/{setup-config-IJ6RFRA4.js.map → setup-config-KPMWBIHD.js.map} +0 -0
- /package/dist/{weather-report-B43EV36T.js.map → weather-report-3WN4FVQ6.js.map} +0 -0
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
AdaptiveMemoryBackend,
|
|
3
3
|
DEFAULT_SCORING_CONFIG,
|
|
4
4
|
createAdaptiveMemory
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GLOJ6EDL.js";
|
|
6
6
|
import "./chunk-633WH2ML.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-K5N4OL66.js";
|
|
8
8
|
import "./chunk-CLYZ7FWP.js";
|
|
9
9
|
import "./chunk-UP2VWCW5.js";
|
|
10
10
|
export {
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
DEFAULT_SCORING_CONFIG,
|
|
13
13
|
createAdaptiveMemory
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=adaptive-memory-
|
|
15
|
+
//# sourceMappingURL=adaptive-memory-EDCJHRH3.js.map
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
CircuitBreakerRegistry,
|
|
3
3
|
CircuitError,
|
|
4
4
|
mapCliErrorToCategory
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OREUX6UF.js";
|
|
6
6
|
import {
|
|
7
7
|
createLogger,
|
|
8
8
|
err,
|
|
9
9
|
getTimeProvider,
|
|
10
10
|
ok
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-K5N4OL66.js";
|
|
12
12
|
|
|
13
13
|
// src/cli-adapters/fallback-chains.ts
|
|
14
14
|
import { z } from "zod";
|
|
@@ -192,4 +192,4 @@ export {
|
|
|
192
192
|
CliCircuitBreakerIntegration,
|
|
193
193
|
createCliCircuitBreakerIntegration
|
|
194
194
|
};
|
|
195
|
-
//# sourceMappingURL=chunk-
|
|
195
|
+
//# sourceMappingURL=chunk-2JPQ2ICM.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionMemory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6SUCK2NV.js";
|
|
4
4
|
import {
|
|
5
5
|
AdaptiveMemoryBackend,
|
|
6
6
|
HybridMemoryBackend,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getMemoryEntry,
|
|
10
10
|
memoryExists,
|
|
11
11
|
memoryRowToEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GLOJ6EDL.js";
|
|
13
13
|
import {
|
|
14
14
|
stringifyValue,
|
|
15
15
|
tokenizeFiltered
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getAvailableClis,
|
|
22
22
|
isCliAvailable,
|
|
23
23
|
withTimeout
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VUJ2PDT7.js";
|
|
25
25
|
import {
|
|
26
26
|
AgentError,
|
|
27
27
|
CACHE_TIMEOUTS,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
resolveVoteTimeout,
|
|
67
67
|
toRateLimitError,
|
|
68
68
|
validateTimeout
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-K5N4OL66.js";
|
|
70
70
|
import {
|
|
71
71
|
OUTCOMES_FILE,
|
|
72
72
|
ensureLearningDir
|
|
@@ -12347,7 +12347,7 @@ async function processVotesWithCascade(votes, opts) {
|
|
|
12347
12347
|
var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
|
|
12348
12348
|
async function runContrarianCheck(proposal, log) {
|
|
12349
12349
|
try {
|
|
12350
|
-
const { executeExpert } = await import("./expert-bridge-
|
|
12350
|
+
const { executeExpert } = await import("./expert-bridge-RDY47MFM.js");
|
|
12351
12351
|
const prompt = [
|
|
12352
12352
|
"You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
|
|
12353
12353
|
"Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
|
|
@@ -12717,4 +12717,4 @@ export {
|
|
|
12717
12717
|
CONSENSUS_VOTE_OUTPUT_SCHEMA,
|
|
12718
12718
|
registerConsensusVoteTool
|
|
12719
12719
|
};
|
|
12720
|
-
//# sourceMappingURL=chunk-
|
|
12720
|
+
//# sourceMappingURL=chunk-4VB3PQTO.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createLogger,
|
|
3
3
|
getTimeProvider,
|
|
4
4
|
isRateLimitText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-K5N4OL66.js";
|
|
6
6
|
|
|
7
7
|
// src/pipeline/expert-bridge.ts
|
|
8
8
|
var logger = createLogger({ component: "expert-bridge" });
|
|
@@ -12,7 +12,7 @@ var cachedMcpConfigPath = null;
|
|
|
12
12
|
async function getMcpConfigPath() {
|
|
13
13
|
if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
|
|
14
14
|
try {
|
|
15
|
-
const { generateMcpConfig } = await import("./mcp-config-
|
|
15
|
+
const { generateMcpConfig } = await import("./mcp-config-F6ZJD564.js");
|
|
16
16
|
const config = await generateMcpConfig();
|
|
17
17
|
cachedMcpConfigPath = config.configPath;
|
|
18
18
|
return cachedMcpConfigPath;
|
|
@@ -21,15 +21,30 @@ async function getMcpConfigPath() {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
var cachedCircuitBreaker = null;
|
|
24
|
+
function adaptCompositeRouter(compositeRouter) {
|
|
25
|
+
return {
|
|
26
|
+
async executeTask(task) {
|
|
27
|
+
const cliTask = {
|
|
28
|
+
content: task.content,
|
|
29
|
+
...task.options !== void 0 ? { options: task.options } : {}
|
|
30
|
+
};
|
|
31
|
+
const result = await compositeRouter.executeTask(cliTask);
|
|
32
|
+
if (result.ok) {
|
|
33
|
+
return { ok: true, value: { text: result.value.text }, error: { message: "" } };
|
|
34
|
+
}
|
|
35
|
+
return { ok: false, value: { text: "" }, error: { message: result.error.message } };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
24
39
|
async function getRouter() {
|
|
25
40
|
if (cachedRouter !== null) return cachedRouter;
|
|
26
|
-
const { createAllAdapters } = await import("./factory-
|
|
27
|
-
const { createCompositeRouter } = await import("./composite-router-
|
|
41
|
+
const { createAllAdapters } = await import("./factory-3DVB6TV6.js");
|
|
42
|
+
const { createCompositeRouter } = await import("./composite-router-QGP6USAP.js");
|
|
28
43
|
const adapters = createAllAdapters();
|
|
29
44
|
if (adapters.size === 0) return null;
|
|
30
|
-
cachedRouter = createCompositeRouter(adapters);
|
|
45
|
+
cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
|
|
31
46
|
try {
|
|
32
|
-
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-
|
|
47
|
+
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-U3XLQNCL.js");
|
|
33
48
|
cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
|
|
34
49
|
} catch (error) {
|
|
35
50
|
const msg = error instanceof Error ? error.message : String(error);
|
|
@@ -121,4 +136,4 @@ ${prompt}`;
|
|
|
121
136
|
export {
|
|
122
137
|
executeExpert
|
|
123
138
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-6BOVBYY5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pipeline/expert-bridge.ts"],"sourcesContent":["/**\n * Expert Bridge — Programmatic access to the execute_expert pipeline (#1693)\n *\n * Provides a clean wrapper for calling experts with the full pipeline:\n * timeout, fallback cascade, degradation detection, heartbeat, outcome recording.\n *\n * DRY: reuses createBuiltInExpert + CompositeRouter instead of reimplementing.\n *\n * @module pipeline/expert-bridge\n */\n\nimport { createLogger, getTimeProvider } from '../core/index.js';\nimport type { BuiltInExpertType } from '../agents/experts/expert-config.js';\nimport { isRateLimitText } from '../adapters/rate-limit-detector.js';\n\nconst logger = createLogger({ component: 'expert-bridge' });\n\n/** Base delay for rate limit retry backoff (ms). Scales linearly: 3s, 6s, 9s. */\nconst RATE_LIMIT_BASE_DELAY_MS = 3000;\n\n/** Result of an expert execution. */\nexport interface ExpertBridgeResult {\n readonly success: boolean;\n readonly text: string;\n readonly expertType: BuiltInExpertType;\n readonly durationMs: number;\n readonly error?: string;\n}\n\n/**\n * Execute an expert task with the full nexus-agents expert pipeline.\n *\n * Creates a built-in expert, executes via CompositeRouter (for intelligent\n * CLI routing), and records outcomes. Falls back gracefully on failure.\n *\n * @param expertType - Built-in expert type (code, architecture, security, qa, etc.)\n * @param prompt - Task prompt for the expert\n * @returns Expert result with text output\n */\n/** Minimal router interface for the bridge. */\ninterface RouterLike {\n executeTask(task: {\n content: string;\n options?: Record<string, unknown> | undefined;\n }): Promise<{ ok: boolean; value: { text: string }; error: { message: string } }>;\n}\n\n// Cached router — lazily initialized, reused across calls within a session\nlet cachedRouter: RouterLike | null = null;\n\n// Cached MCP config — generated once, reused across expert calls (#1708)\nlet cachedMcpConfigPath: string | null = null;\n\n/** Get or create cached MCP config path for expert CLI sessions (#1708). */\nasync function getMcpConfigPath(): Promise<string | null> {\n if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;\n try {\n const { generateMcpConfig } = await import('../swe-bench/mcp-config.js');\n const config = await generateMcpConfig();\n cachedMcpConfigPath = config.configPath;\n return cachedMcpConfigPath;\n } catch {\n return null; // MCP config not available — experts run without tools\n }\n}\n\n/** Cached circuit breaker for health monitoring (#1766). */\nlet cachedCircuitBreaker: {\n getHealthStatus(): {\n systemHealthy: boolean;\n healthyCount: number;\n clis: ReadonlyArray<{ name: string; healthy: boolean }>;\n };\n} | null = null;\n\n/**\n * Adapt a CompositeRouter to the narrower RouterLike interface used by this\n * bridge. Previously did `as unknown as RouterLike` which hid any structural\n * mismatch between CompositeRouter's `Result<CliResponse, CliError>` and\n * RouterLike's flat `{ ok, value: { text }, error: { message } }` shape.\n * If CliResponse renames `.text` → `.output` (or similar), this adapter\n * breaks at compile time instead of silently returning wrong data (#1921).\n */\nfunction adaptCompositeRouter(\n compositeRouter: import('../cli-adapters/composite-router.js').ICompositeRouter,\n): RouterLike {\n return {\n async executeTask(task): Promise<{\n ok: boolean;\n value: { text: string };\n error: { message: string };\n }> {\n const cliTask: import('../cli-adapters/types.js').CliTask = {\n content: task.content,\n ...(task.options !== undefined ? { options: task.options } : {}),\n };\n const result = await compositeRouter.executeTask(cliTask);\n if (result.ok) {\n return { ok: true, value: { text: result.value.text }, error: { message: '' } };\n }\n return { ok: false, value: { text: '' }, error: { message: result.error.message } };\n },\n };\n}\n\n/** Get or create a cached CompositeRouter with circuit breaker monitoring. */\nasync function getRouter(): Promise<RouterLike | null> {\n if (cachedRouter !== null) return cachedRouter;\n const { createAllAdapters } = await import('../cli-adapters/factory.js');\n const { createCompositeRouter } = await import('../cli-adapters/composite-router.js');\n const adapters = createAllAdapters();\n if (adapters.size === 0) return null;\n cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));\n\n // Initialize circuit breaker monitoring (#1766)\n try {\n const { createCliCircuitBreakerIntegration } =\n await import('../cli-adapters/cli-circuit-breaker.js');\n cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);\n } catch (error: unknown) {\n // Circuit breaker not available — continue without it. Log so we can\n // notice if initialization silently stops working (#1913 Class B).\n const msg = error instanceof Error ? error.message : String(error);\n logger.debug('Circuit breaker init failed; continuing without it', { error: msg });\n }\n\n return cachedRouter;\n}\n\n/** Check CLI health before dispatch (#1766). */\nfunction checkCircuitHealth(): { healthy: boolean; message: string } {\n if (cachedCircuitBreaker === null) return { healthy: true, message: '' };\n const status = cachedCircuitBreaker.getHealthStatus();\n if (!status.systemHealthy) {\n return {\n healthy: false,\n message: `All CLI circuits open (${String(status.healthyCount)}/${String(status.clis.length)} healthy)`,\n };\n }\n return { healthy: true, message: '' };\n}\n\n/** Dispatch task to router with rate limit retry (#1802). */\nasync function dispatchWithRateLimitRetry(\n router: RouterLike,\n task: { content: string; options?: Record<string, unknown> | undefined },\n expertType: BuiltInExpertType,\n start: number\n): Promise<ExpertBridgeResult> {\n const maxAttempts = 3;\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n const result = await router.executeTask(task);\n const durationMs = getTimeProvider().now() - start;\n\n if (result.ok) {\n logger.info('Expert executed successfully', { expertType, durationMs });\n return { success: true, text: result.value.text, expertType, durationMs };\n }\n\n const isRateLimit = isRateLimitText(result.error.message);\n if (isRateLimit && attempt < maxAttempts - 1) {\n const backoffMs = RATE_LIMIT_BASE_DELAY_MS * (attempt + 1);\n logger.warn('Expert rate limited, retrying', { expertType, attempt: attempt + 1, backoffMs });\n await new Promise((resolve) => setTimeout(resolve, backoffMs));\n continue;\n }\n\n logger.warn('Expert execution failed', { expertType, error: result.error.message });\n return { success: false, text: '', expertType, durationMs, error: result.error.message };\n }\n\n return {\n success: false,\n text: '',\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: 'Max retry attempts exceeded',\n };\n}\n\nexport async function executeExpert(\n expertType: BuiltInExpertType,\n prompt: string\n): Promise<ExpertBridgeResult> {\n const start = getTimeProvider().now();\n try {\n const { BUILT_IN_EXPERTS } = await import('../agents/experts/expert-config.js');\n const config = BUILT_IN_EXPERTS[expertType];\n const fullPrompt = `${config.systemPrompt}\\n\\n${prompt}`;\n\n const router = await getRouter();\n if (router === null) {\n return {\n success: false,\n text: `[No adapters] ${prompt}`,\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: 'No CLI adapters available',\n };\n }\n\n // Check circuit breaker health before dispatch (#1766)\n const health = checkCircuitHealth();\n if (!health.healthy) {\n logger.warn('Circuit breaker: all CLIs unavailable', { expertType, reason: health.message });\n return {\n success: false,\n text: '',\n expertType,\n durationMs: getTimeProvider().now() - start,\n error: health.message,\n };\n }\n\n // Pass MCP config so CLI experts can call nexus-agents tools (#1708)\n const mcpConfigPath = await getMcpConfigPath();\n const task: { content: string; options?: Record<string, unknown> | undefined } = {\n content: fullPrompt,\n };\n if (mcpConfigPath !== null) task.options = { mcpConfigPath };\n\n return await dispatchWithRateLimitRetry(router, task, expertType, start);\n } catch (error) {\n const durationMs = getTimeProvider().now() - start;\n const msg = error instanceof Error ? error.message : String(error);\n logger.warn('Expert bridge error', { expertType, error: msg });\n return { success: false, text: '', expertType, durationMs, error: msg };\n }\n}\n"],"mappings":";;;;;;;AAeA,IAAM,SAAS,aAAa,EAAE,WAAW,gBAAgB,CAAC;AAG1D,IAAM,2BAA2B;AA8BjC,IAAI,eAAkC;AAGtC,IAAI,sBAAqC;AAGzC,eAAe,mBAA2C;AACxD,MAAI,wBAAwB,KAAM,QAAO;AACzC,MAAI;AACF,UAAM,EAAE,k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imeProvider,
|
|
6
6
|
ok
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-K5N4OL66.js";
|
|
8
8
|
|
|
9
9
|
// src/context/session-memory.ts
|
|
10
10
|
import * as fs from "fs";
|
|
@@ -351,4 +351,4 @@ export {
|
|
|
351
351
|
SessionMemory,
|
|
352
352
|
createSessionMemory
|
|
353
353
|
};
|
|
354
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-6SUCK2NV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTokenEnvVars,
|
|
3
3
|
resolveToken
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SUDYZIVI.js";
|
|
5
5
|
import {
|
|
6
6
|
ClaudeAdapter,
|
|
7
7
|
DEFAULT_RELEVANCE_CONFIG,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toolSuccessStructured,
|
|
26
26
|
withProgressHeartbeat,
|
|
27
27
|
wrapToolWithTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4VB3PQTO.js";
|
|
29
29
|
import {
|
|
30
30
|
REGISTRY_PATH,
|
|
31
31
|
getProjectRoot,
|
|
@@ -35,14 +35,14 @@ import {
|
|
|
35
35
|
resolveInsideRoot,
|
|
36
36
|
savePapersRegistry,
|
|
37
37
|
synthesizeResearch
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-7PZGCG37.js";
|
|
39
39
|
import {
|
|
40
40
|
IssueTriage,
|
|
41
41
|
sanitizeInput
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-PTLZM2LZ.js";
|
|
43
43
|
import {
|
|
44
44
|
generateSecurityPlan
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-FO6C5AQ6.js";
|
|
46
46
|
import {
|
|
47
47
|
analyzeGitHubRepo
|
|
48
48
|
} from "./chunk-BC3M4VLP.js";
|
|
@@ -65,14 +65,14 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
DEFAULT_TASK_TTL_MS,
|
|
67
67
|
clampTaskTtl
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-PR7QRV6S.js";
|
|
69
69
|
import {
|
|
70
70
|
createSessionMemory
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-6SUCK2NV.js";
|
|
72
72
|
import {
|
|
73
73
|
MemoryImportance,
|
|
74
74
|
calculateTextJaccardSimilarity
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-GLOJ6EDL.js";
|
|
76
76
|
import {
|
|
77
77
|
STOPWORDS,
|
|
78
78
|
capitalize,
|
|
@@ -81,13 +81,13 @@ import {
|
|
|
81
81
|
} from "./chunk-633WH2ML.js";
|
|
82
82
|
import {
|
|
83
83
|
generateMcpConfig
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-WFG3BWWK.js";
|
|
85
85
|
import {
|
|
86
86
|
getFallbackChainForCategory
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-2JPQ2ICM.js";
|
|
88
88
|
import {
|
|
89
89
|
executeExpert
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-6BOVBYY5.js";
|
|
91
91
|
import {
|
|
92
92
|
ClaudeCliAdapter,
|
|
93
93
|
CliDetectionCache,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
getAvailableClis,
|
|
97
97
|
sleep,
|
|
98
98
|
withTimeout
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-VUJ2PDT7.js";
|
|
100
100
|
import {
|
|
101
101
|
AGENT_ROUTER_TIMEOUTS,
|
|
102
102
|
API_TIMEOUTS,
|
|
@@ -165,8 +165,9 @@ import {
|
|
|
165
165
|
isRateLimitLikeError,
|
|
166
166
|
modelSupportsAll,
|
|
167
167
|
ok,
|
|
168
|
-
toExpertTaskAnalysisResult
|
|
169
|
-
|
|
168
|
+
toExpertTaskAnalysisResult,
|
|
169
|
+
withStep
|
|
170
|
+
} from "./chunk-K5N4OL66.js";
|
|
170
171
|
import {
|
|
171
172
|
isPersistenceEnabled
|
|
172
173
|
} from "./chunk-CLYZ7FWP.js";
|
|
@@ -35794,7 +35795,13 @@ var ExecuteExpertInputSchema = z67.object({
|
|
|
35794
35795
|
)
|
|
35795
35796
|
});
|
|
35796
35797
|
function sanitizeExpertSummary(summary) {
|
|
35797
|
-
|
|
35798
|
+
let cleaned = summary;
|
|
35799
|
+
for (let i = 0; i < 10; i++) {
|
|
35800
|
+
const next = cleaned.replace(/<[^>]*>/g, "");
|
|
35801
|
+
if (next === cleaned) break;
|
|
35802
|
+
cleaned = next;
|
|
35803
|
+
}
|
|
35804
|
+
return cleaned.replace(/\b(ignore|forget|disregard)\s+(previous|above|all)\b/gi, "[REDACTED]").slice(0, 2e3);
|
|
35798
35805
|
}
|
|
35799
35806
|
function buildTask(input) {
|
|
35800
35807
|
const autoTimeout = getExpertTaskTimeout(input.task);
|
|
@@ -40965,7 +40972,7 @@ async function tryIssueTriage(task) {
|
|
|
40965
40972
|
try {
|
|
40966
40973
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
40967
40974
|
if (issueMatch === null) return null;
|
|
40968
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
40975
|
+
const { createIssueTriage } = await import("./issue-triage-SCQMQI6A.js");
|
|
40969
40976
|
const triage = createIssueTriage();
|
|
40970
40977
|
const owner = issueMatch[1] ?? "";
|
|
40971
40978
|
const num = issueMatch[2] ?? "";
|
|
@@ -40993,7 +41000,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
40993
41000
|
]);
|
|
40994
41001
|
async function classifyWithLLM(task) {
|
|
40995
41002
|
try {
|
|
40996
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
41003
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-RDY47MFM.js");
|
|
40997
41004
|
const prompt = [
|
|
40998
41005
|
"Classify this task into exactly one pipeline template.",
|
|
40999
41006
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -41787,7 +41794,7 @@ var memoryInitPromise = null;
|
|
|
41787
41794
|
async function initPipelineMemory() {
|
|
41788
41795
|
if (cachedMemory !== null) return cachedMemory;
|
|
41789
41796
|
try {
|
|
41790
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
41797
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-7MHDTB6O.js");
|
|
41791
41798
|
const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
|
|
41792
41799
|
const mem = createSessionMemory2(LEARNING_DIR);
|
|
41793
41800
|
mem.startSession(`pipeline-${String(Date.now())}`);
|
|
@@ -41840,7 +41847,7 @@ async function persistMobiMemState() {
|
|
|
41840
41847
|
if (!isPersistenceEnabled2()) return;
|
|
41841
41848
|
const os5 = await import("os");
|
|
41842
41849
|
const path19 = await import("path");
|
|
41843
|
-
const { createMobiMem } = await import("./mobimem-
|
|
41850
|
+
const { createMobiMem } = await import("./mobimem-XYRENZW7.js");
|
|
41844
41851
|
const mobimem = createMobiMem();
|
|
41845
41852
|
const savePath = path19.join(os5.homedir(), ".nexus-agents", "memory", "mobimem-state.json");
|
|
41846
41853
|
await mobimem.save(savePath);
|
|
@@ -41857,7 +41864,7 @@ function recordRoutingExperience(category, success, durationMs) {
|
|
|
41857
41864
|
callRecord(routingMemoryCache);
|
|
41858
41865
|
return;
|
|
41859
41866
|
}
|
|
41860
|
-
void import("./routing-memory-
|
|
41867
|
+
void import("./routing-memory-YUETBIJU.js").then(({ createRoutingMemory }) => {
|
|
41861
41868
|
routingMemoryCache = createRoutingMemory();
|
|
41862
41869
|
callRecord(routingMemoryCache);
|
|
41863
41870
|
}).catch((error) => {
|
|
@@ -41886,7 +41893,7 @@ ${text}` : "";
|
|
|
41886
41893
|
}
|
|
41887
41894
|
async function getWeatherContext() {
|
|
41888
41895
|
try {
|
|
41889
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
41896
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-3WN4FVQ6.js");
|
|
41890
41897
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
41891
41898
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
41892
41899
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -41903,7 +41910,7 @@ ${lines}
|
|
|
41903
41910
|
}
|
|
41904
41911
|
async function getMemoryContext(task) {
|
|
41905
41912
|
try {
|
|
41906
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
41913
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-7MHDTB6O.js");
|
|
41907
41914
|
const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
|
|
41908
41915
|
const memory = createSessionMemory2(LEARNING_DIR, { maxLearningsInContext: 10 });
|
|
41909
41916
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -41996,7 +42003,7 @@ ${contextBlock}`;
|
|
|
41996
42003
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
41997
42004
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
41998
42005
|
try {
|
|
41999
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
42006
|
+
const { executeVoting } = await import("./consensus-vote-GEQK32G7.js");
|
|
42000
42007
|
const votingResult = await executeVoting(
|
|
42001
42008
|
{
|
|
42002
42009
|
proposal: plan.slice(0, 4e3),
|
|
@@ -42416,10 +42423,18 @@ function buildDryRunResult(planResult) {
|
|
|
42416
42423
|
};
|
|
42417
42424
|
}
|
|
42418
42425
|
async function runPlanningPhase(task, stages, sid, prior) {
|
|
42419
|
-
const research = await runOrResume(
|
|
42420
|
-
|
|
42421
|
-
|
|
42422
|
-
|
|
42426
|
+
const research = await runOrResume(
|
|
42427
|
+
prior,
|
|
42428
|
+
"research",
|
|
42429
|
+
() => withStep(
|
|
42430
|
+
{ name: "research", kind: "pipeline.stage", attrs: { task: task.slice(0, 100) } },
|
|
42431
|
+
async (ctx) => {
|
|
42432
|
+
const r = await stages.research(task);
|
|
42433
|
+
ctx.setSummary(`${String(r.length)} chars`);
|
|
42434
|
+
return r;
|
|
42435
|
+
}
|
|
42436
|
+
)
|
|
42437
|
+
);
|
|
42423
42438
|
if (sid !== void 0) saveStageCheckpoint(sid, "research", { type: "research", text: research });
|
|
42424
42439
|
const planResult = await runPlanOrResume(prior, task, research, stages);
|
|
42425
42440
|
if (sid !== void 0) {
|
|
@@ -42453,8 +42468,14 @@ async function runImplSecurityPhase(planResult, tasks, stages, sid) {
|
|
|
42453
42468
|
const implResult = await implementQaLoop(tasks, stages);
|
|
42454
42469
|
if (sid !== void 0)
|
|
42455
42470
|
saveStageCheckpoint(sid, "implement", { type: "implement", tasks: implResult.completedTasks });
|
|
42456
|
-
|
|
42457
|
-
|
|
42471
|
+
const security = await withStep(
|
|
42472
|
+
{ name: "security-scan", kind: "pipeline.stage" },
|
|
42473
|
+
async (ctx) => {
|
|
42474
|
+
const r = await stages.securityScan();
|
|
42475
|
+
ctx.setSummary(r.passed ? "passed" : "FAILED");
|
|
42476
|
+
return r;
|
|
42477
|
+
}
|
|
42478
|
+
);
|
|
42458
42479
|
if (sid !== void 0) {
|
|
42459
42480
|
saveStageCheckpoint(sid, "security", { type: "security", passed: security.passed });
|
|
42460
42481
|
if (security.passed) cleanupCheckpoint2(sid);
|
|
@@ -42493,8 +42514,11 @@ async function runOrResumeDecompose(prior, plan, stages, meta) {
|
|
|
42493
42514
|
logger39.info("Resuming from checkpoint", { stage: "decompose" });
|
|
42494
42515
|
return [...prior.tasks];
|
|
42495
42516
|
}
|
|
42496
|
-
|
|
42497
|
-
|
|
42517
|
+
const tasks = await withStep({ name: "decompose", kind: "pipeline.stage" }, async (ctx) => {
|
|
42518
|
+
const r = await stages.decompose(plan);
|
|
42519
|
+
ctx.setSummary(`${String(r.length)} tasks`);
|
|
42520
|
+
return r;
|
|
42521
|
+
});
|
|
42498
42522
|
if (meta.conditional && tasks.length > 0) {
|
|
42499
42523
|
return tasks.map((t) => ({
|
|
42500
42524
|
...t,
|
|
@@ -42514,10 +42538,20 @@ async function planVoteLoop(task, research, stages) {
|
|
|
42514
42538
|
let feedback;
|
|
42515
42539
|
let plan = "";
|
|
42516
42540
|
for (let i = 1; i <= MAX_VOTE_ITERATIONS; i++) {
|
|
42517
|
-
|
|
42518
|
-
|
|
42519
|
-
|
|
42520
|
-
|
|
42541
|
+
plan = await withStep(
|
|
42542
|
+
{ name: `plan (i=${String(i)})`, kind: "pipeline.stage", attrs: { iteration: i } },
|
|
42543
|
+
() => stages.plan(task, research, feedback)
|
|
42544
|
+
);
|
|
42545
|
+
const vote = await withStep(
|
|
42546
|
+
{ name: `vote (i=${String(i)})`, kind: "consensus.vote", attrs: { iteration: i } },
|
|
42547
|
+
async (ctx) => {
|
|
42548
|
+
const r = await stages.vote(plan);
|
|
42549
|
+
ctx.setSummary(
|
|
42550
|
+
`${String(Math.round(r.approvalPercentage))}% ${isApproved(r) ? "approved" : "rejected"}`
|
|
42551
|
+
);
|
|
42552
|
+
return r;
|
|
42553
|
+
}
|
|
42554
|
+
);
|
|
42521
42555
|
if (isApproved(vote)) {
|
|
42522
42556
|
const meta = extractConditionalMeta(vote);
|
|
42523
42557
|
logger39.info("Plan approved", { iteration: i, approval: vote.approvalPercentage, ...meta });
|
|
@@ -42838,7 +42872,7 @@ async function extractSymbolsForTask(task) {
|
|
|
42838
42872
|
}
|
|
42839
42873
|
async function retrieveAdaptiveMemory(task) {
|
|
42840
42874
|
try {
|
|
42841
|
-
const { AdaptiveMemoryBackend } = await import("./adaptive-memory-
|
|
42875
|
+
const { AdaptiveMemoryBackend } = await import("./adaptive-memory-EDCJHRH3.js");
|
|
42842
42876
|
const os5 = await import("os");
|
|
42843
42877
|
const path19 = await import("path");
|
|
42844
42878
|
const baseDir = path19.join(os5.homedir(), ".nexus-agents", "memory");
|
|
@@ -42857,7 +42891,7 @@ async function retrieveAdaptiveMemory(task) {
|
|
|
42857
42891
|
}
|
|
42858
42892
|
async function queryResearchRegistry(task) {
|
|
42859
42893
|
try {
|
|
42860
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
42894
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-MRO44W5J.js");
|
|
42861
42895
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
42862
42896
|
if (topic === void 0) return null;
|
|
42863
42897
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -42942,7 +42976,7 @@ function createScanStageWrapper() {
|
|
|
42942
42976
|
try {
|
|
42943
42977
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
42944
42978
|
if (slug !== void 0) {
|
|
42945
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
42979
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-XPOOUKAV.js");
|
|
42946
42980
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
42947
42981
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
42948
42982
|
ctx.sharedMemory.write("scan", "decision", { recommendations: recs });
|
|
@@ -47993,12 +48027,39 @@ var PATCH_PATTERNS = [
|
|
|
47993
48027
|
// Alternative fences: ```patch, ```text, ``` with diff --git
|
|
47994
48028
|
/```(?:patch|text|)\n(diff --git[\s\S]*?)```/i,
|
|
47995
48029
|
// Unified diff in fenced block: --- a/file
|
|
47996
|
-
/```(?:diff|patch|text|)\n(---\s+a\/[\s\S]*?)```/i
|
|
47997
|
-
// Raw diff --git without fences
|
|
47998
|
-
/(diff --git[\s\S]*?)(?:\n\n[^d]|$)/,
|
|
47999
|
-
// Raw unified diff without fences
|
|
48000
|
-
/\n(--- a\/[\s\S]*?\n\+\+\+ b\/[\s\S]*?)(?:\n\n[^-+@ ]|$)/
|
|
48030
|
+
/```(?:diff|patch|text|)\n(---\s+a\/[\s\S]*?)```/i
|
|
48001
48031
|
];
|
|
48032
|
+
var MAX_RAW_EXTRACT_LEN = 256 * 1024;
|
|
48033
|
+
function extractRawDiffGit(response) {
|
|
48034
|
+
const start = response.indexOf("diff --git");
|
|
48035
|
+
if (start === -1) return null;
|
|
48036
|
+
let i = start;
|
|
48037
|
+
while (i < response.length) {
|
|
48038
|
+
const nl = response.indexOf("\n\n", i);
|
|
48039
|
+
if (nl === -1) return response.slice(start);
|
|
48040
|
+
const after = response.charAt(nl + 2);
|
|
48041
|
+
if (after !== "d" && after !== "") return response.slice(start, nl);
|
|
48042
|
+
i = nl + 2;
|
|
48043
|
+
}
|
|
48044
|
+
return response.slice(start);
|
|
48045
|
+
}
|
|
48046
|
+
function extractRawUnifiedDiff(response) {
|
|
48047
|
+
const start = response.indexOf("\n--- a/");
|
|
48048
|
+
if (start === -1) return null;
|
|
48049
|
+
const plusIdx = response.indexOf("\n+++ b/", start);
|
|
48050
|
+
if (plusIdx === -1) return null;
|
|
48051
|
+
let i = plusIdx;
|
|
48052
|
+
while (i < response.length) {
|
|
48053
|
+
const nl = response.indexOf("\n\n", i);
|
|
48054
|
+
if (nl === -1) return response.slice(start + 1);
|
|
48055
|
+
const after = response.charAt(nl + 2);
|
|
48056
|
+
if (after !== "-" && after !== "+" && after !== "@" && after !== " " && after !== "") {
|
|
48057
|
+
return response.slice(start + 1, nl);
|
|
48058
|
+
}
|
|
48059
|
+
i = nl + 2;
|
|
48060
|
+
}
|
|
48061
|
+
return response.slice(start + 1);
|
|
48062
|
+
}
|
|
48002
48063
|
function extractPatch(response) {
|
|
48003
48064
|
for (const pattern of PATCH_PATTERNS) {
|
|
48004
48065
|
const match = pattern.exec(response);
|
|
@@ -48006,6 +48067,11 @@ function extractPatch(response) {
|
|
|
48006
48067
|
return normalizePatch(match[1]);
|
|
48007
48068
|
}
|
|
48008
48069
|
}
|
|
48070
|
+
const bounded = response.length > MAX_RAW_EXTRACT_LEN ? response.slice(0, MAX_RAW_EXTRACT_LEN) : response;
|
|
48071
|
+
const raw1 = extractRawDiffGit(bounded);
|
|
48072
|
+
if (raw1 !== null) return normalizePatch(raw1);
|
|
48073
|
+
const raw2 = extractRawUnifiedDiff(bounded);
|
|
48074
|
+
if (raw2 !== null) return normalizePatch(raw2);
|
|
48009
48075
|
return null;
|
|
48010
48076
|
}
|
|
48011
48077
|
function normalizePatch(raw) {
|
|
@@ -48146,7 +48212,7 @@ function extractErrorHint(response, maxLen = 200) {
|
|
|
48146
48212
|
response
|
|
48147
48213
|
);
|
|
48148
48214
|
if (errorMatch !== null) return errorMatch[0].slice(0, maxLen);
|
|
48149
|
-
const failMatch = /(?:still fails|test
|
|
48215
|
+
const failMatch = /(?:still fails|test.{0,200}?fail|doesn't work|incorrect)[^\n]{0,100}/i.exec(response);
|
|
48150
48216
|
if (failMatch !== null) return failMatch[0].slice(0, maxLen);
|
|
48151
48217
|
return "";
|
|
48152
48218
|
}
|
|
@@ -52329,7 +52395,7 @@ var GitHubTaskTracker = class {
|
|
|
52329
52395
|
cachedProvider = null;
|
|
52330
52396
|
async getProvider() {
|
|
52331
52397
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
52332
|
-
const { createScmProvider } = await import("./factory-
|
|
52398
|
+
const { createScmProvider } = await import("./factory-VEXE4RXU.js");
|
|
52333
52399
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
52334
52400
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
52335
52401
|
this.cachedProvider = result.value;
|
|
@@ -53168,4 +53234,4 @@ export {
|
|
|
53168
53234
|
detectBackend,
|
|
53169
53235
|
createTaskTracker
|
|
53170
53236
|
};
|
|
53171
|
-
//# sourceMappingURL=chunk-
|
|
53237
|
+
//# sourceMappingURL=chunk-7DNUEEGG.js.map
|