nexus-agents 2.166.0 → 2.166.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-LQ4IKFSN.js → child-mcp-config-AUA4TFBG.js} +2 -2
- package/dist/{chunk-3HVF4BG4.js → chunk-3LVB5OE2.js} +2 -2
- package/dist/{chunk-YPPYRLDF.js → chunk-6LXTT6AK.js} +2 -2
- package/dist/{chunk-YOFRUVPJ.js → chunk-76Q6GTPU.js} +2 -2
- package/dist/{chunk-3ACDP4E6.js → chunk-AO4X3BMP.js} +26 -9
- package/dist/chunk-AO4X3BMP.js.map +1 -0
- package/dist/{chunk-RXI5ONP7.js → chunk-AWPSFL5C.js} +2 -2
- package/dist/{chunk-NBPA4PQD.js → chunk-BFDVV3Q3.js} +2 -2
- package/dist/{chunk-MYNI3CYT.js → chunk-BZFF3YWU.js} +4 -4
- package/dist/{chunk-LQ2ABFLI.js → chunk-DMFMJFRY.js} +2 -2
- package/dist/{chunk-TZNJCTNQ.js → chunk-F2YZ3U6O.js} +2 -2
- package/dist/{chunk-2255SARF.js → chunk-FKHQWC2L.js} +2 -2
- package/dist/{chunk-55NRU7SV.js → chunk-FQNG6ZIW.js} +8 -8
- package/dist/{chunk-2UMMVKUW.js → chunk-FZV4YAYT.js} +3 -3
- package/dist/{chunk-33X5V4PL.js → chunk-GS3UPAUE.js} +2 -2
- package/dist/{chunk-U43BUJSN.js → chunk-HNAFWKJG.js} +7 -7
- package/dist/{chunk-MQUSJVER.js → chunk-I7OZP6FS.js} +4 -4
- package/dist/{chunk-RBN4WXOA.js → chunk-IF46G2LM.js} +2 -2
- package/dist/{chunk-RC5SCDGF.js → chunk-JBH4CU46.js} +180 -86
- package/dist/{chunk-RC5SCDGF.js.map → chunk-JBH4CU46.js.map} +1 -1
- package/dist/{chunk-CVLVWHXG.js → chunk-JYVPM37A.js} +5 -5
- package/dist/{chunk-LUP26FMZ.js → chunk-K2IX6BEK.js} +4 -4
- package/dist/{chunk-ZNY7MM2J.js → chunk-LRBEUBZ3.js} +3 -3
- package/dist/{chunk-FKOWIKR4.js → chunk-NEQJSYJH.js} +3 -3
- package/dist/{chunk-LKSG75LC.js → chunk-OI6H3DL6.js} +4 -4
- package/dist/{chunk-TFYQRAWT.js → chunk-ORRKK563.js} +3 -3
- package/dist/{chunk-6PYVTJZF.js → chunk-P54BDACX.js} +2 -2
- package/dist/{chunk-DUUMMELV.js → chunk-PRSGZQNB.js} +3 -3
- package/dist/{chunk-OUBDTDTC.js → chunk-PXTZ6RPP.js} +7 -7
- package/dist/{chunk-SF2AK3JB.js → chunk-THI3VWHO.js} +2 -2
- package/dist/{chunk-WOQCCQSE.js → chunk-UO6C5J5D.js} +5 -5
- package/dist/{chunk-JV64QX3Y.js → chunk-UWRDWX6L.js} +2 -2
- package/dist/{chunk-3SMFRAX5.js → chunk-V5RPW2ZX.js} +3 -3
- package/dist/{chunk-JBZMUKT4.js → chunk-WL4SGKAW.js} +2 -2
- package/dist/{chunk-3GYRM7D6.js → chunk-WOY6TQCH.js} +33 -9
- package/dist/{chunk-3GYRM7D6.js.map → chunk-WOY6TQCH.js.map} +1 -1
- package/dist/{chunk-NXJJZEUO.js → chunk-YKTVN2TF.js} +2 -2
- package/dist/{chunk-PZ3BB3PO.js → chunk-Z66EEQ4A.js} +3 -3
- package/dist/{chunk-IXZXG2MY.js → chunk-ZI4PO2A3.js} +7 -7
- package/dist/{cli-circuit-breaker-5IGBBD7R.js → cli-circuit-breaker-FSUDU7BV.js} +4 -4
- package/dist/cli.js +135 -108
- package/dist/cli.js.map +1 -1
- package/dist/codebase-search-DKLEA4PR.js +12 -0
- package/dist/{composite-router-62KI56W6.js → composite-router-HC4YLG5W.js} +2 -2
- package/dist/{consensus-vote-M4ZELBV4.js → consensus-vote-KWPS6WNH.js} +15 -15
- package/dist/{context-retriever-5UJC5KDZ.js → context-retriever-YCKTCDGM.js} +10 -8
- package/dist/{doctor-deep-7OR5MYMI.js → doctor-deep-4UARVVSD.js} +3 -3
- package/dist/{expert-bridge-BNMCDENK.js → expert-bridge-EAR6XZJA.js} +4 -4
- package/dist/{factory-QLW773DP.js → factory-7SVW7XMV.js} +5 -5
- package/dist/{factory-77GX5DG4.js → factory-JYAUOFEN.js} +8 -8
- package/dist/{improvement-review-KDM6OL25.js → improvement-review-AHSY5ZXD.js} +5 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.js +31 -31
- package/dist/{init-opencode-FXKABSGS.js → init-opencode-5BKE7UEB.js} +6 -6
- package/dist/{issue-triage-OVX4VSUN.js → issue-triage-TNV4R33I.js} +6 -6
- package/dist/{pr-reviewer-helpers-VGIBNZBX.js → pr-reviewer-helpers-ZC2I5ZYD.js} +4 -4
- package/dist/{registry-command-CGMRLZQ2.js → registry-command-O2GLHG3G.js} +2 -2
- package/dist/{repo-security-plan-TBCMGL5Z.js → repo-security-plan-CFRLHIMY.js} +3 -3
- package/dist/{research-helpers-synthesize-76ZZYWJ5.js → research-helpers-synthesize-ONWBGXHO.js} +4 -4
- package/dist/{routing-memory-PZ4LTLXJ.js → routing-memory-XHZKEPUH.js} +2 -2
- package/dist/{session-memory-C55R7LGY.js → session-memory-5QVKDE4U.js} +3 -3
- package/dist/{setup-command-HMXY5UHN.js → setup-command-G7OB4QQG.js} +11 -11
- package/dist/{setup-config-SMRMMT6Z.js → setup-config-MMBOL5CW.js} +3 -3
- package/dist/{setup-custom-api-42JXTJHU.js → setup-custom-api-RQ3BUMJC.js} +3 -3
- package/dist/{tool-memory-LCDNVPFI.js → tool-memory-VK4IZLPN.js} +5 -5
- package/dist/{unified-registry-XEXWGKV5.js → unified-registry-ZOTGM4EY.js} +9 -9
- package/dist/{weather-report-DPADAXFN.js → weather-report-MPD66LKP.js} +2 -2
- package/package.json +5 -5
- package/dist/chunk-3ACDP4E6.js.map +0 -1
- package/dist/codebase-search-PWMWLU7O.js +0 -8
- /package/dist/{child-mcp-config-LQ4IKFSN.js.map → child-mcp-config-AUA4TFBG.js.map} +0 -0
- /package/dist/{chunk-3HVF4BG4.js.map → chunk-3LVB5OE2.js.map} +0 -0
- /package/dist/{chunk-YPPYRLDF.js.map → chunk-6LXTT6AK.js.map} +0 -0
- /package/dist/{chunk-YOFRUVPJ.js.map → chunk-76Q6GTPU.js.map} +0 -0
- /package/dist/{chunk-RXI5ONP7.js.map → chunk-AWPSFL5C.js.map} +0 -0
- /package/dist/{chunk-NBPA4PQD.js.map → chunk-BFDVV3Q3.js.map} +0 -0
- /package/dist/{chunk-MYNI3CYT.js.map → chunk-BZFF3YWU.js.map} +0 -0
- /package/dist/{chunk-LQ2ABFLI.js.map → chunk-DMFMJFRY.js.map} +0 -0
- /package/dist/{chunk-TZNJCTNQ.js.map → chunk-F2YZ3U6O.js.map} +0 -0
- /package/dist/{chunk-2255SARF.js.map → chunk-FKHQWC2L.js.map} +0 -0
- /package/dist/{chunk-55NRU7SV.js.map → chunk-FQNG6ZIW.js.map} +0 -0
- /package/dist/{chunk-2UMMVKUW.js.map → chunk-FZV4YAYT.js.map} +0 -0
- /package/dist/{chunk-33X5V4PL.js.map → chunk-GS3UPAUE.js.map} +0 -0
- /package/dist/{chunk-U43BUJSN.js.map → chunk-HNAFWKJG.js.map} +0 -0
- /package/dist/{chunk-MQUSJVER.js.map → chunk-I7OZP6FS.js.map} +0 -0
- /package/dist/{chunk-RBN4WXOA.js.map → chunk-IF46G2LM.js.map} +0 -0
- /package/dist/{chunk-CVLVWHXG.js.map → chunk-JYVPM37A.js.map} +0 -0
- /package/dist/{chunk-LUP26FMZ.js.map → chunk-K2IX6BEK.js.map} +0 -0
- /package/dist/{chunk-ZNY7MM2J.js.map → chunk-LRBEUBZ3.js.map} +0 -0
- /package/dist/{chunk-FKOWIKR4.js.map → chunk-NEQJSYJH.js.map} +0 -0
- /package/dist/{chunk-LKSG75LC.js.map → chunk-OI6H3DL6.js.map} +0 -0
- /package/dist/{chunk-TFYQRAWT.js.map → chunk-ORRKK563.js.map} +0 -0
- /package/dist/{chunk-6PYVTJZF.js.map → chunk-P54BDACX.js.map} +0 -0
- /package/dist/{chunk-DUUMMELV.js.map → chunk-PRSGZQNB.js.map} +0 -0
- /package/dist/{chunk-OUBDTDTC.js.map → chunk-PXTZ6RPP.js.map} +0 -0
- /package/dist/{chunk-SF2AK3JB.js.map → chunk-THI3VWHO.js.map} +0 -0
- /package/dist/{chunk-WOQCCQSE.js.map → chunk-UO6C5J5D.js.map} +0 -0
- /package/dist/{chunk-JV64QX3Y.js.map → chunk-UWRDWX6L.js.map} +0 -0
- /package/dist/{chunk-3SMFRAX5.js.map → chunk-V5RPW2ZX.js.map} +0 -0
- /package/dist/{chunk-JBZMUKT4.js.map → chunk-WL4SGKAW.js.map} +0 -0
- /package/dist/{chunk-NXJJZEUO.js.map → chunk-YKTVN2TF.js.map} +0 -0
- /package/dist/{chunk-PZ3BB3PO.js.map → chunk-Z66EEQ4A.js.map} +0 -0
- /package/dist/{chunk-IXZXG2MY.js.map → chunk-ZI4PO2A3.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-5IGBBD7R.js.map → cli-circuit-breaker-FSUDU7BV.js.map} +0 -0
- /package/dist/{codebase-search-PWMWLU7O.js.map → codebase-search-DKLEA4PR.js.map} +0 -0
- /package/dist/{composite-router-62KI56W6.js.map → composite-router-HC4YLG5W.js.map} +0 -0
- /package/dist/{consensus-vote-M4ZELBV4.js.map → consensus-vote-KWPS6WNH.js.map} +0 -0
- /package/dist/{context-retriever-5UJC5KDZ.js.map → context-retriever-YCKTCDGM.js.map} +0 -0
- /package/dist/{doctor-deep-7OR5MYMI.js.map → doctor-deep-4UARVVSD.js.map} +0 -0
- /package/dist/{expert-bridge-BNMCDENK.js.map → expert-bridge-EAR6XZJA.js.map} +0 -0
- /package/dist/{factory-77GX5DG4.js.map → factory-7SVW7XMV.js.map} +0 -0
- /package/dist/{factory-QLW773DP.js.map → factory-JYAUOFEN.js.map} +0 -0
- /package/dist/{improvement-review-KDM6OL25.js.map → improvement-review-AHSY5ZXD.js.map} +0 -0
- /package/dist/{init-opencode-FXKABSGS.js.map → init-opencode-5BKE7UEB.js.map} +0 -0
- /package/dist/{issue-triage-OVX4VSUN.js.map → issue-triage-TNV4R33I.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-VGIBNZBX.js.map → pr-reviewer-helpers-ZC2I5ZYD.js.map} +0 -0
- /package/dist/{registry-command-CGMRLZQ2.js.map → registry-command-O2GLHG3G.js.map} +0 -0
- /package/dist/{repo-security-plan-TBCMGL5Z.js.map → repo-security-plan-CFRLHIMY.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-76ZZYWJ5.js.map → research-helpers-synthesize-ONWBGXHO.js.map} +0 -0
- /package/dist/{routing-memory-PZ4LTLXJ.js.map → routing-memory-XHZKEPUH.js.map} +0 -0
- /package/dist/{session-memory-C55R7LGY.js.map → session-memory-5QVKDE4U.js.map} +0 -0
- /package/dist/{setup-command-HMXY5UHN.js.map → setup-command-G7OB4QQG.js.map} +0 -0
- /package/dist/{setup-config-SMRMMT6Z.js.map → setup-config-MMBOL5CW.js.map} +0 -0
- /package/dist/{setup-custom-api-42JXTJHU.js.map → setup-custom-api-RQ3BUMJC.js.map} +0 -0
- /package/dist/{tool-memory-LCDNVPFI.js.map → tool-memory-VK4IZLPN.js.map} +0 -0
- /package/dist/{unified-registry-XEXWGKV5.js.map → unified-registry-ZOTGM4EY.js.map} +0 -0
- /package/dist/{weather-report-DPADAXFN.js.map → weather-report-MPD66LKP.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
4
4
|
import "./chunk-AXTD4TFK.js";
|
|
5
5
|
import "./chunk-DHVMSIT5.js";
|
|
6
6
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
generateMcpConfig,
|
|
61
61
|
getDefaultAllowedTools
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=child-mcp-config-
|
|
63
|
+
//# sourceMappingURL=child-mcp-config-AUA4TFBG.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
MODEL_IDS,
|
|
4
4
|
getTimeProvider,
|
|
5
5
|
resolveModelIdentitySync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
7
7
|
|
|
8
8
|
// src/config/model-availability.ts
|
|
9
9
|
var DEFAULT_TTL_MS = 6e4;
|
|
@@ -150,4 +150,4 @@ export {
|
|
|
150
150
|
resetAvailabilityCache,
|
|
151
151
|
filterAvailableModels
|
|
152
152
|
};
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-3LVB5OE2.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getErrorMessage,
|
|
9
9
|
ok,
|
|
10
10
|
parseBoolEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
12
12
|
|
|
13
13
|
// src/cli/research-helpers-io.ts
|
|
14
14
|
import * as fs2 from "fs/promises";
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
loadPapersRegistry,
|
|
147
147
|
savePapersRegistry
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-6LXTT6AK.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
getTimeProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
8
8
|
|
|
9
9
|
// src/mcp/tools/scanner-registry-fetcher.ts
|
|
10
10
|
import { z } from "zod";
|
|
@@ -721,4 +721,4 @@ export {
|
|
|
721
721
|
generateSecurityPlan,
|
|
722
722
|
buildPlanFromAnalysis
|
|
723
723
|
};
|
|
724
|
-
//# sourceMappingURL=chunk-
|
|
724
|
+
//# sourceMappingURL=chunk-76Q6GTPU.js.map
|
|
@@ -125,6 +125,8 @@ ${lines.join("\n")}`;
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
// src/indexer/codebase-search.ts
|
|
128
|
+
var DEFAULT_INDEX_MAX_DEPTH = 24;
|
|
129
|
+
var MAX_INDEX_MAX_DEPTH = 64;
|
|
128
130
|
var SCORE_EXACT = 20;
|
|
129
131
|
var SCORE_PREFIX = 10;
|
|
130
132
|
var SCORE_WORD = 5;
|
|
@@ -135,19 +137,22 @@ function isSourceFile(name) {
|
|
|
135
137
|
return [".ts", ".tsx", ".js", ".jsx"].includes(ext) && !name.endsWith(".test.ts") && !name.endsWith(".test.tsx") && !name.endsWith(".d.ts");
|
|
136
138
|
}
|
|
137
139
|
async function findSourceFiles(dir, maxDepth) {
|
|
138
|
-
if (maxDepth <= 0) return [];
|
|
140
|
+
if (maxDepth <= 0) return { files: [], skippedDirs: 1 };
|
|
139
141
|
const files = [];
|
|
142
|
+
let skippedDirs = 0;
|
|
140
143
|
const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
|
|
141
144
|
for (const entry of entries) {
|
|
142
145
|
const fullPath = resolve(dir, entry.name);
|
|
143
146
|
if (entry.isDirectory() && entry.name !== "node_modules" && entry.name !== "dist") {
|
|
144
|
-
|
|
147
|
+
const sub = await findSourceFiles(fullPath, maxDepth - 1);
|
|
148
|
+
files.push(...sub.files);
|
|
149
|
+
skippedDirs += sub.skippedDirs;
|
|
145
150
|
}
|
|
146
151
|
if (entry.isFile() && isSourceFile(entry.name)) {
|
|
147
152
|
files.push(fullPath);
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
|
-
return files;
|
|
155
|
+
return { files, skippedDirs };
|
|
151
156
|
}
|
|
152
157
|
function scoreMatch(symbolName, query) {
|
|
153
158
|
const nameLower = symbolName.toLowerCase();
|
|
@@ -169,12 +174,20 @@ var CodebaseIndex = class {
|
|
|
169
174
|
symbols = [];
|
|
170
175
|
fileResults = /* @__PURE__ */ new Map();
|
|
171
176
|
rootDir;
|
|
177
|
+
skippedDirs = 0;
|
|
172
178
|
constructor(rootDir) {
|
|
173
179
|
this.rootDir = rootDir;
|
|
174
180
|
}
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Index all TS/JS source files in the directory.
|
|
183
|
+
*
|
|
184
|
+
* `maxDepth` is clamped to `[1, MAX_INDEX_MAX_DEPTH]` so a caller-supplied
|
|
185
|
+
* value can't force an unbounded tree-walk (#4243).
|
|
186
|
+
*/
|
|
187
|
+
async index(maxDepth = DEFAULT_INDEX_MAX_DEPTH) {
|
|
188
|
+
const clampedDepth = Math.min(Math.max(maxDepth, 1), MAX_INDEX_MAX_DEPTH);
|
|
189
|
+
const { files, skippedDirs } = await findSourceFiles(this.rootDir, clampedDepth);
|
|
190
|
+
this.skippedDirs = skippedDirs;
|
|
178
191
|
for (const file of files) {
|
|
179
192
|
const result = await extractSymbols(file);
|
|
180
193
|
const relPath = relative(this.rootDir, file);
|
|
@@ -186,7 +199,8 @@ var CodebaseIndex = class {
|
|
|
186
199
|
return {
|
|
187
200
|
totalFiles: files.length,
|
|
188
201
|
totalSymbols: this.symbols.length,
|
|
189
|
-
indexedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
202
|
+
indexedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
203
|
+
skippedDirs
|
|
190
204
|
};
|
|
191
205
|
}
|
|
192
206
|
/** Search symbols by keyword. Returns top N results sorted by relevance. */
|
|
@@ -236,7 +250,8 @@ var CodebaseIndex = class {
|
|
|
236
250
|
get stats() {
|
|
237
251
|
return {
|
|
238
252
|
files: this.fileResults.size,
|
|
239
|
-
symbols: this.symbols.length
|
|
253
|
+
symbols: this.symbols.length,
|
|
254
|
+
skippedDirs: this.skippedDirs
|
|
240
255
|
};
|
|
241
256
|
}
|
|
242
257
|
};
|
|
@@ -244,6 +259,8 @@ var CodebaseIndex = class {
|
|
|
244
259
|
export {
|
|
245
260
|
extractSymbols,
|
|
246
261
|
extractSymbolIndex,
|
|
262
|
+
DEFAULT_INDEX_MAX_DEPTH,
|
|
263
|
+
MAX_INDEX_MAX_DEPTH,
|
|
247
264
|
CodebaseIndex
|
|
248
265
|
};
|
|
249
|
-
//# sourceMappingURL=chunk-
|
|
266
|
+
//# sourceMappingURL=chunk-AO4X3BMP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/indexer/codebase-search.ts","../src/indexer/symbol-extractor.ts"],"sourcesContent":["/**\n * Codebase search — keyword search across symbol indices.\n *\n * Builds an in-memory symbol index for a directory of TS/JS files,\n * then supports keyword search, file summaries, and symbol lookup.\n *\n * Inspired by Augment Code's Context Engine. Uses the existing\n * extractSymbols() function for AST parsing.\n *\n * @module indexer/codebase-search\n */\n\nimport { readdir } from 'node:fs/promises';\nimport { resolve, extname, relative } from 'node:path';\nimport {\n extractSymbols,\n type CodeSymbol,\n type SymbolExtractionResult,\n} from './symbol-extractor.js';\n\n/** A symbol with its source file path. */\nexport interface IndexedSymbol extends CodeSymbol {\n /** Relative file path from the indexed root. */\n filePath: string;\n}\n\n/** Search result with relevance scoring. */\nexport interface SearchResult {\n symbol: IndexedSymbol;\n /** Relevance score (higher = better match). */\n score: number;\n /** How the query matched (exact, prefix, substring, word). */\n matchType: 'exact' | 'prefix' | 'substring' | 'word';\n}\n\n/** File summary — compact overview of a source file. */\nexport interface FileSummary {\n filePath: string;\n totalLines: number;\n exportedSymbols: number;\n privateSymbols: number;\n kinds: Record<string, number>;\n}\n\n/** Index statistics. */\nexport interface IndexStats {\n totalFiles: number;\n totalSymbols: number;\n indexedAt: string;\n /** Directories not descended into because `maxDepth` was exhausted (#4243). */\n skippedDirs: number;\n}\n\n/** Default recursion depth for `CodebaseIndex.index()` (#4243 — was hardcoded 4). */\nexport const DEFAULT_INDEX_MAX_DEPTH = 24;\n/** Upper clamp for caller-supplied `maxDepth` to bound worst-case tree-walk cost. */\nexport const MAX_INDEX_MAX_DEPTH = 64;\n\n// Score weights for different match types\nconst SCORE_EXACT = 20;\nconst SCORE_PREFIX = 10;\nconst SCORE_WORD = 5;\nconst SCORE_SUBSTRING = 2;\nconst SCORE_EXPORTED_BONUS = 3;\n\nfunction isSourceFile(name: string): boolean {\n const ext = extname(name).toLowerCase();\n return (\n ['.ts', '.tsx', '.js', '.jsx'].includes(ext) &&\n !name.endsWith('.test.ts') &&\n !name.endsWith('.test.tsx') &&\n !name.endsWith('.d.ts')\n );\n}\n\n/** Result of a recursive source-file walk: the files found plus a truncation signal. */\ninterface FindSourceFilesResult {\n files: string[];\n /** Count of directories that were NOT descended into because maxDepth hit 0. */\n skippedDirs: number;\n}\n\nasync function findSourceFiles(dir: string, maxDepth: number): Promise<FindSourceFilesResult> {\n if (maxDepth <= 0) return { files: [], skippedDirs: 1 };\n const files: string[] = [];\n let skippedDirs = 0;\n const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);\n for (const entry of entries) {\n const fullPath = resolve(dir, entry.name);\n if (entry.isDirectory() && entry.name !== 'node_modules' && entry.name !== 'dist') {\n const sub = await findSourceFiles(fullPath, maxDepth - 1);\n files.push(...sub.files);\n skippedDirs += sub.skippedDirs;\n }\n if (entry.isFile() && isSourceFile(entry.name)) {\n files.push(fullPath);\n }\n }\n return { files, skippedDirs };\n}\n\nfunction scoreMatch(symbolName: string, query: string): SearchResult['score'] | null {\n const nameLower = symbolName.toLowerCase();\n const queryLower = query.toLowerCase();\n\n if (nameLower === queryLower) return SCORE_EXACT;\n if (nameLower.startsWith(queryLower)) return SCORE_PREFIX;\n\n // Word boundary match (camelCase splitting)\n const words = symbolName\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .toLowerCase()\n .split(/[\\s_-]+/);\n if (words.some((w) => w === queryLower)) return SCORE_WORD;\n\n if (nameLower.includes(queryLower)) return SCORE_SUBSTRING;\n\n return null;\n}\n\nfunction getMatchType(score: number): SearchResult['matchType'] {\n if (score >= SCORE_EXACT) return 'exact';\n if (score >= SCORE_PREFIX) return 'prefix';\n if (score >= SCORE_WORD) return 'word';\n return 'substring';\n}\n\n/** In-memory codebase symbol index. */\nexport class CodebaseIndex {\n private readonly symbols: IndexedSymbol[] = [];\n private readonly fileResults = new Map<string, SymbolExtractionResult>();\n private readonly rootDir: string;\n private skippedDirs = 0;\n\n constructor(rootDir: string) {\n this.rootDir = rootDir;\n }\n\n /**\n * Index all TS/JS source files in the directory.\n *\n * `maxDepth` is clamped to `[1, MAX_INDEX_MAX_DEPTH]` so a caller-supplied\n * value can't force an unbounded tree-walk (#4243).\n */\n async index(maxDepth: number = DEFAULT_INDEX_MAX_DEPTH): Promise<IndexStats> {\n const clampedDepth = Math.min(Math.max(maxDepth, 1), MAX_INDEX_MAX_DEPTH);\n const { files, skippedDirs } = await findSourceFiles(this.rootDir, clampedDepth);\n this.skippedDirs = skippedDirs;\n\n for (const file of files) {\n const result = await extractSymbols(file);\n const relPath = relative(this.rootDir, file);\n this.fileResults.set(relPath, result);\n\n for (const symbol of result.symbols) {\n this.symbols.push({ ...symbol, filePath: relPath });\n }\n }\n\n return {\n totalFiles: files.length,\n totalSymbols: this.symbols.length,\n indexedAt: new Date().toISOString(),\n skippedDirs,\n };\n }\n\n /** Search symbols by keyword. Returns top N results sorted by relevance. */\n search(query: string, limit = 20): SearchResult[] {\n const results: SearchResult[] = [];\n\n for (const symbol of this.symbols) {\n const baseScore = scoreMatch(symbol.name, query);\n if (baseScore === null) continue;\n\n const bonus = symbol.exported ? SCORE_EXPORTED_BONUS : 0;\n results.push({\n symbol,\n score: baseScore + bonus,\n matchType: getMatchType(baseScore),\n });\n }\n\n return results.sort((a, b) => b.score - a.score).slice(0, limit);\n }\n\n /** Get a compact summary of a file's symbols. */\n getFileSummary(filePath: string): FileSummary | undefined {\n const result = this.fileResults.get(filePath);\n if (result === undefined) return undefined;\n\n const kinds: Record<string, number> = {};\n let exported = 0;\n let priv = 0;\n\n for (const s of result.symbols) {\n kinds[s.kind] = (kinds[s.kind] ?? 0) + 1;\n if (s.exported) exported++;\n else priv++;\n }\n\n return {\n filePath,\n totalLines: result.totalLines,\n exportedSymbols: exported,\n privateSymbols: priv,\n kinds,\n };\n }\n\n /** List all indexed files with symbol counts. */\n listFiles(): Array<{ path: string; symbols: number; lines: number }> {\n return [...this.fileResults.entries()].map(([path, result]) => ({\n path,\n symbols: result.symbols.length,\n lines: result.totalLines,\n }));\n }\n\n /** Get index statistics. */\n get stats(): { files: number; symbols: number; skippedDirs: number } {\n return {\n files: this.fileResults.size,\n symbols: this.symbols.length,\n skippedDirs: this.skippedDirs,\n };\n }\n}\n","/**\n * AST symbol extraction for token-efficient code retrieval.\n *\n * Uses TypeScript's compiler API to extract function, class, method,\n * interface, and type definitions from source files.\n *\n * Token savings: ~80-99% vs reading full files.\n * No additional dependencies — uses TypeScript (already a project dep).\n *\n * @module indexer/symbol-extractor\n */\n\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport ts from 'typescript';\n\n/** A symbol extracted from source code. */\nexport interface CodeSymbol {\n /** Symbol name */\n name: string;\n /** Symbol kind */\n kind: 'function' | 'class' | 'method' | 'interface' | 'type' | 'variable' | 'enum';\n /** Start line (1-based) */\n startLine: number;\n /** End line (1-based) */\n endLine: number;\n /** Full source text of the symbol */\n text: string;\n /** Whether the symbol is exported */\n exported: boolean;\n}\n\n/** Result of extracting symbols from a file. */\nexport interface SymbolExtractionResult {\n filePath: string;\n symbols: CodeSymbol[];\n totalLines: number;\n totalChars: number;\n symbolChars: number;\n savingsPercent: number;\n}\n\nfunction getKind(node: ts.Node): CodeSymbol['kind'] | null {\n if (ts.isFunctionDeclaration(node)) return 'function';\n if (ts.isClassDeclaration(node)) return 'class';\n if (ts.isInterfaceDeclaration(node)) return 'interface';\n if (ts.isTypeAliasDeclaration(node)) return 'type';\n if (ts.isEnumDeclaration(node)) return 'enum';\n if (ts.isMethodDeclaration(node)) return 'method';\n if (ts.isVariableStatement(node)) return 'variable';\n return null;\n}\n\nfunction getName(node: ts.Node): string {\n if (\n ts.isFunctionDeclaration(node) ||\n ts.isClassDeclaration(node) ||\n ts.isInterfaceDeclaration(node) ||\n ts.isTypeAliasDeclaration(node) ||\n ts.isEnumDeclaration(node) ||\n ts.isMethodDeclaration(node)\n ) {\n const nameNode = (node as ts.NamedDeclaration).name;\n return nameNode ? nameNode.getText() : '<anonymous>';\n }\n if (ts.isVariableStatement(node)) {\n const decls = node.declarationList.declarations;\n const firstDecl = decls[0];\n if (firstDecl !== undefined) {\n return firstDecl.name.getText();\n }\n }\n return '<anonymous>';\n}\n\nfunction isExported(node: ts.Node): boolean {\n const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;\n if (modifiers) {\n return modifiers.some((m) => m.kind === ts.SyntaxKind.ExportKeyword);\n }\n return false;\n}\n\nfunction visitNode(node: ts.Node, sourceFile: ts.SourceFile, symbols: CodeSymbol[]): void {\n const kind = getKind(node);\n if (kind !== null) {\n const name = getName(node);\n if (name !== '<anonymous>') {\n const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(node.getEnd());\n symbols.push({\n name,\n kind,\n startLine: start.line + 1,\n endLine: end.line + 1,\n text: node.getText(sourceFile),\n exported: isExported(node),\n });\n }\n }\n if (ts.isClassDeclaration(node)) {\n visitClassMembers(node, sourceFile, symbols);\n return;\n }\n ts.forEachChild(node, (child) => {\n visitNode(child, sourceFile, symbols);\n });\n}\n\nfunction visitClassMembers(\n node: ts.ClassDeclaration,\n sourceFile: ts.SourceFile,\n symbols: CodeSymbol[]\n): void {\n for (const member of node.members) {\n if (ts.isMethodDeclaration(member) || ts.isPropertyDeclaration(member)) {\n const memberName = member.name.getText();\n if (memberName !== '<anonymous>') {\n const start = sourceFile.getLineAndCharacterOfPosition(member.getStart());\n const end = sourceFile.getLineAndCharacterOfPosition(member.getEnd());\n symbols.push({\n name: memberName,\n kind: 'method',\n startLine: start.line + 1,\n endLine: end.line + 1,\n text: member.getText(sourceFile),\n exported: false,\n });\n }\n }\n }\n}\n\nfunction computeSavings(totalChars: number, symbolChars: number): number {\n return totalChars > 0 ? Math.round(100 * (1 - symbolChars / totalChars) * 10) / 10 : 0;\n}\n\n/**\n * Extract symbols from a TypeScript/JavaScript file.\n */\nexport async function extractSymbols(filePath: string): Promise<SymbolExtractionResult> {\n const ext = extname(filePath).toLowerCase();\n if (!['.ts', '.tsx', '.js', '.jsx'].includes(ext)) {\n return {\n filePath,\n symbols: [],\n totalLines: 0,\n totalChars: 0,\n symbolChars: 0,\n savingsPercent: 0,\n };\n }\n\n const source = await readFile(filePath, 'utf-8');\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n const symbols: CodeSymbol[] = [];\n\n ts.forEachChild(sourceFile, (node) => {\n visitNode(node, sourceFile, symbols);\n });\n\n const totalChars = source.length;\n const symbolChars = symbols.reduce((sum, s) => sum + s.text.length, 0);\n\n return {\n filePath,\n symbols,\n totalLines: source.split('\\n').length,\n totalChars,\n symbolChars,\n savingsPercent: computeSavings(totalChars, symbolChars),\n };\n}\n\n/**\n * Extract a compact symbol index (names + locations only, no source text).\n * This is the minimal representation for LLM context — ~95%+ token savings.\n */\nexport async function extractSymbolIndex(filePath: string): Promise<string> {\n const result = await extractSymbols(filePath);\n if (result.symbols.length === 0) return '';\n\n const lines = result.symbols.map((s) => {\n const exp = s.exported ? 'export ' : '';\n return `${exp}${s.kind} ${s.name} (L${String(s.startLine)}-${String(s.endLine)})`;\n });\n\n return `// ${filePath} — ${String(result.symbols.length)} symbols\\n${lines.join('\\n')}`;\n}\n"],"mappings":";AAYA,SAAS,eAAe;AACxB,SAAS,SAAS,WAAAA,UAAS,gBAAgB;;;ACD3C,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,OAAO,QAAQ;AA4Bf,SAAS,QAAQ,MAA0C;AACzD,MAAI,GAAG,sBAAsB,IAAI,E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AE,MAAM,GAAG,KAAK;AAAA,EACjE;AAAA;AAAA,EAGA,eAAe,UAA2C;AACxD,UAAM,SAAS,KAAK,YAAY,IAAI,QAAQ;AAC5C,QAAI,WAAW,OAAW,QAAO;AAEjC,UAAM,QAAgC,CAAC;AACvC,QAAI,WAAW;AACf,QAAI,OAAO;AAEX,eAAW,KAAK,OAAO,SAAS;AAC9B,YAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,KAAK;AACvC,UAAI,EAAE,SAAU;AAAA,UACX;AAAA,IACP;AAEA,WAAO;AAAA,MACL;AAAA,MACA,YAAY,OAAO;AAAA,MACnB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,YAAqE;AACnE,WAAO,CAAC,GAAG,KAAK,YAAY,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,OAAO;AAAA,MAC9D;AAAA,MACA,SAAS,OAAO,QAAQ;AAAA,MACxB,OAAO,OAAO;AAAA,IAChB,EAAE;AAAA,EACJ;AAAA;AAAA,EAGA,IAAI,QAAiE;AACnE,WAAO;AAAA,MACL,OAAO,KAAK,YAAY;AAAA,MACxB,SAAS,KAAK,QAAQ;AAAA,MACtB,aAAa,KAAK;AAAA,IACpB;AAAA,EACF;AACF;","names":["extname","extname"]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getErrorMessage,
|
|
6
6
|
getTimeProvider,
|
|
7
7
|
ok
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
9
9
|
|
|
10
10
|
// src/cli-adapters/circuit-breaker-types.ts
|
|
11
11
|
var CircuitErrorCode = {
|
|
@@ -375,4 +375,4 @@ export {
|
|
|
375
375
|
mapCliErrorToCategory,
|
|
376
376
|
mapModelErrorToCategory
|
|
377
377
|
};
|
|
378
|
-
//# sourceMappingURL=chunk-
|
|
378
|
+
//# sourceMappingURL=chunk-AWPSFL5C.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTimeProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
4
4
|
|
|
5
5
|
// src/security/audit-trail.ts
|
|
6
6
|
var MAX_EVENTS = 1e4;
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
createGraphAuditBridge,
|
|
206
206
|
createAuditTrail
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=chunk-
|
|
208
|
+
//# sourceMappingURL=chunk-BFDVV3Q3.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAutoAdapter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZI4PO2A3.js";
|
|
4
4
|
import {
|
|
5
5
|
mapModelErrorToCategory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AWPSFL5C.js";
|
|
7
7
|
import {
|
|
8
8
|
CLI_NAMES,
|
|
9
9
|
CircularBuffer,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ok,
|
|
25
25
|
recordRateLimitEvent,
|
|
26
26
|
toRateLimitError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
28
28
|
|
|
29
29
|
// src/agents/collaboration/event-bus-helpers.ts
|
|
30
30
|
import { randomUUID } from "crypto";
|
|
@@ -1041,4 +1041,4 @@ export {
|
|
|
1041
1041
|
getGlobalRegistry,
|
|
1042
1042
|
resetGlobalRegistry
|
|
1043
1043
|
};
|
|
1044
|
-
//# sourceMappingURL=chunk-
|
|
1044
|
+
//# sourceMappingURL=chunk-BZFF3YWU.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getErrorMessage,
|
|
5
5
|
getTimeProvider,
|
|
6
6
|
ok
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
8
8
|
|
|
9
9
|
// src/context/session-memory.ts
|
|
10
10
|
import * as fs from "fs";
|
|
@@ -352,4 +352,4 @@ export {
|
|
|
352
352
|
SessionMemory,
|
|
353
353
|
createSessionMemory
|
|
354
354
|
};
|
|
355
|
-
//# sourceMappingURL=chunk-
|
|
355
|
+
//# sourceMappingURL=chunk-DMFMJFRY.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CACHE_TIMEOUTS,
|
|
3
3
|
createLogger,
|
|
4
4
|
getTimeProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
6
6
|
|
|
7
7
|
// src/security/trust-types.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -560,4 +560,4 @@ export {
|
|
|
560
560
|
resolveReputationGatingMode,
|
|
561
561
|
gateWithReputation
|
|
562
562
|
};
|
|
563
|
-
//# sourceMappingURL=chunk-
|
|
563
|
+
//# sourceMappingURL=chunk-F2YZ3U6O.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getErrorMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
4
4
|
|
|
5
5
|
// src/cli/setup-config.ts
|
|
6
6
|
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
|
|
@@ -77,4 +77,4 @@ function ensureBackup(outputPath) {
|
|
|
77
77
|
export {
|
|
78
78
|
runConfigInitSync
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-FKHQWC2L.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeCostDetail
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WL4SGKAW.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_CONSENSUS_CONFIG,
|
|
6
6
|
DEFAULT_INCREMENTAL_QUORUM_CONFIG,
|
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
toolSuccess,
|
|
19
19
|
withProgressHeartbeat,
|
|
20
20
|
wrapToolWithTimeout
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-V5RPW2ZX.js";
|
|
22
22
|
import {
|
|
23
23
|
getToolMemory
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I7OZP6FS.js";
|
|
25
25
|
import {
|
|
26
26
|
createEvent,
|
|
27
27
|
getGlobalRegistry
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BZFF3YWU.js";
|
|
29
29
|
import {
|
|
30
30
|
authRemediation,
|
|
31
31
|
delay,
|
|
32
32
|
getAvailableClis,
|
|
33
33
|
withTimeout
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZI4PO2A3.js";
|
|
35
35
|
import {
|
|
36
36
|
AgentError,
|
|
37
37
|
CLI_NAMES,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
registerPersistentOutcomeStoreFactory,
|
|
60
60
|
resolveClassGuardMs,
|
|
61
61
|
resolveVoteTimeout
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
63
63
|
import {
|
|
64
64
|
ensureLearningDir,
|
|
65
65
|
getOutcomesFile
|
|
@@ -5866,7 +5866,7 @@ async function processVotesWithCascade(engineVotes, opts) {
|
|
|
5866
5866
|
var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
|
|
5867
5867
|
async function runContrarianCheck(proposal, log) {
|
|
5868
5868
|
try {
|
|
5869
|
-
const { executeExpert } = await import("./expert-bridge-
|
|
5869
|
+
const { executeExpert } = await import("./expert-bridge-EAR6XZJA.js");
|
|
5870
5870
|
const prompt = [
|
|
5871
5871
|
"You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
|
|
5872
5872
|
"Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
|
|
@@ -6382,4 +6382,4 @@ export {
|
|
|
6382
6382
|
CONSENSUS_VOTE_OUTPUT_SCHEMA,
|
|
6383
6383
|
registerConsensusVoteTool
|
|
6384
6384
|
};
|
|
6385
|
-
//# sourceMappingURL=chunk-
|
|
6385
|
+
//# sourceMappingURL=chunk-FQNG6ZIW.js.map
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
planOptionalParams,
|
|
5
5
|
requireApiKey,
|
|
6
6
|
validateApiKeyPresence
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YKTVN2TF.js";
|
|
8
8
|
import {
|
|
9
9
|
ModelCapability,
|
|
10
10
|
err,
|
|
11
11
|
getCliModelName,
|
|
12
12
|
getTokenEstimator,
|
|
13
13
|
ok
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
15
15
|
|
|
16
16
|
// src/adapters/openai-types.ts
|
|
17
17
|
var OPENAI_MODELS = {
|
|
@@ -609,4 +609,4 @@ export {
|
|
|
609
609
|
OpenAIAdapter,
|
|
610
610
|
createOpenAIAdapter
|
|
611
611
|
};
|
|
612
|
-
//# sourceMappingURL=chunk-
|
|
612
|
+
//# sourceMappingURL=chunk-FZV4YAYT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRandomProvider,
|
|
3
3
|
getTimeProvider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/id-utils.ts
|
|
7
7
|
import { randomUUID } from "crypto";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
generateHyphenId,
|
|
25
25
|
generateUUID
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-GS3UPAUE.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveCliSlot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3LVB5OE2.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
getTimeProvider,
|
|
7
7
|
isRateLimitText
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
9
9
|
|
|
10
10
|
// src/pipeline/expert-bridge.ts
|
|
11
11
|
function resolveCliFromModelString(model) {
|
|
@@ -21,7 +21,7 @@ async function getMcpConfigPath() {
|
|
|
21
21
|
if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
|
|
22
22
|
mcpConfigInitPromise ??= (async () => {
|
|
23
23
|
try {
|
|
24
|
-
const { generateMcpConfig } = await import("./child-mcp-config-
|
|
24
|
+
const { generateMcpConfig } = await import("./child-mcp-config-AUA4TFBG.js");
|
|
25
25
|
const config = await generateMcpConfig();
|
|
26
26
|
cachedMcpConfigPath = config.configPath;
|
|
27
27
|
cachedMcpConfigCleanup = config.cleanup;
|
|
@@ -93,8 +93,8 @@ var routerInitPromise = null;
|
|
|
93
93
|
async function getRouter() {
|
|
94
94
|
if (cachedRouter !== null) return cachedRouter;
|
|
95
95
|
routerInitPromise ??= (async () => {
|
|
96
|
-
const { createAllAdapters } = await import("./factory-
|
|
97
|
-
const { createCompositeRouter } = await import("./composite-router-
|
|
96
|
+
const { createAllAdapters } = await import("./factory-JYAUOFEN.js");
|
|
97
|
+
const { createCompositeRouter } = await import("./composite-router-HC4YLG5W.js");
|
|
98
98
|
const adapters = createAllAdapters();
|
|
99
99
|
if (adapters.size === 0) {
|
|
100
100
|
routerInitPromise = null;
|
|
@@ -102,7 +102,7 @@ async function getRouter() {
|
|
|
102
102
|
}
|
|
103
103
|
cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
|
|
104
104
|
try {
|
|
105
|
-
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-
|
|
105
|
+
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-FSUDU7BV.js");
|
|
106
106
|
cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
|
|
107
107
|
} catch (error) {
|
|
108
108
|
const msg = error instanceof Error ? error.message : String(error);
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
tokenSplitFromUsage,
|
|
214
214
|
executeExpert
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-HNAFWKJG.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-6T3EPABN.js";
|
|
6
6
|
import {
|
|
7
7
|
SessionMemory
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DMFMJFRY.js";
|
|
9
9
|
import {
|
|
10
10
|
StatsOnlyAdapter,
|
|
11
11
|
ensureSharedMemoryRegistry
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-KSQSWEFH.js";
|
|
16
16
|
import {
|
|
17
17
|
generateId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GS3UPAUE.js";
|
|
19
19
|
import {
|
|
20
20
|
ErrorCode,
|
|
21
21
|
NexusError,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getTimeProvider,
|
|
29
29
|
ok,
|
|
30
30
|
setSharedMobiMemDbPathResolver
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
32
32
|
import {
|
|
33
33
|
nexusDataPath
|
|
34
34
|
} from "./chunk-DHVMSIT5.js";
|
|
@@ -5552,4 +5552,4 @@ export {
|
|
|
5552
5552
|
reinitializeMemoryBackends,
|
|
5553
5553
|
ToolMemoryManager
|
|
5554
5554
|
};
|
|
5555
|
-
//# sourceMappingURL=chunk-
|
|
5555
|
+
//# sourceMappingURL=chunk-I7OZP6FS.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
err,
|
|
5
5
|
getErrorMessage,
|
|
6
6
|
ok
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z66EEQ4A.js";
|
|
8
8
|
|
|
9
9
|
// src/scm/types.ts
|
|
10
10
|
var ScmError = class extends Error {
|
|
@@ -263,4 +263,4 @@ export {
|
|
|
263
263
|
ScmError,
|
|
264
264
|
GitHubProvider
|
|
265
265
|
};
|
|
266
|
-
//# sourceMappingURL=chunk-
|
|
266
|
+
//# sourceMappingURL=chunk-IF46G2LM.js.map
|