cto-ai-cli 5.0.0 → 5.1.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/README.md +2 -1
- package/dist/action/index.js +10 -6
- package/dist/api/dashboard.js +10 -6
- package/dist/api/dashboard.js.map +1 -1
- package/dist/api/server.js +86 -29
- package/dist/api/server.js.map +1 -1
- package/dist/cli/gateway.js +60 -46
- package/dist/cli/score.js +2338 -2292
- package/dist/engine/index.d.ts +30 -1
- package/dist/engine/index.js +96 -8
- package/dist/engine/index.js.map +1 -1
- package/dist/gateway/index.d.ts +2 -2
- package/dist/gateway/index.js +60 -46
- package/dist/gateway/index.js.map +1 -1
- package/dist/mcp/v2.js +10 -6
- package/dist/mcp/v2.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/index.d.ts +0 -717
- package/dist/core/index.js +0 -4446
- package/dist/core/index.js.map +0 -1
package/dist/mcp/v2.js
CHANGED
|
@@ -14369,8 +14369,8 @@ async function analyzeProject(projectPath, config2) {
|
|
|
14369
14369
|
maxDepth: mergedConfig.analysis.maxDepth
|
|
14370
14370
|
});
|
|
14371
14371
|
const tokenMethod = mergedConfig.tokens.method;
|
|
14372
|
-
const
|
|
14373
|
-
|
|
14372
|
+
const BATCH_SIZE = 50;
|
|
14373
|
+
async function estimateFileTokens(entry) {
|
|
14374
14374
|
let tokens;
|
|
14375
14375
|
if (tokenMethod === "tiktoken") {
|
|
14376
14376
|
try {
|
|
@@ -14382,7 +14382,7 @@ async function analyzeProject(projectPath, config2) {
|
|
|
14382
14382
|
} else {
|
|
14383
14383
|
tokens = countTokensChars4(entry.size);
|
|
14384
14384
|
}
|
|
14385
|
-
|
|
14385
|
+
return {
|
|
14386
14386
|
path: entry.path,
|
|
14387
14387
|
relativePath: entry.relativePath,
|
|
14388
14388
|
extension: entry.extension,
|
|
@@ -14391,16 +14391,20 @@ async function analyzeProject(projectPath, config2) {
|
|
|
14391
14391
|
lines: entry.lines,
|
|
14392
14392
|
lastModified: entry.lastModified,
|
|
14393
14393
|
kind: classifyFileKind(entry.relativePath),
|
|
14394
|
-
// Graph data — populated by graph analysis
|
|
14395
14394
|
imports: [],
|
|
14396
14395
|
importedBy: [],
|
|
14397
14396
|
isHub: false,
|
|
14398
14397
|
complexity: 0,
|
|
14399
|
-
// Risk data — populated by risk analysis
|
|
14400
14398
|
riskScore: 0,
|
|
14401
14399
|
riskFactors: [],
|
|
14402
14400
|
exclusionImpact: "none"
|
|
14403
|
-
}
|
|
14401
|
+
};
|
|
14402
|
+
}
|
|
14403
|
+
const files = [];
|
|
14404
|
+
for (let i = 0; i < walkEntries.length; i += BATCH_SIZE) {
|
|
14405
|
+
const batch = walkEntries.slice(i, i + BATCH_SIZE);
|
|
14406
|
+
const results = await Promise.all(batch.map(estimateFileTokens));
|
|
14407
|
+
files.push(...results);
|
|
14404
14408
|
}
|
|
14405
14409
|
const graph = buildProjectGraph(absPath, files);
|
|
14406
14410
|
for (const file2 of files) {
|