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/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# CTO — Stop sending your entire codebase to AI
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
|
-
[](#)
|
|
5
|
+
[](#)
|
|
5
6
|
[](https://www.npmjs.com/package/cto-ai-cli)
|
|
6
7
|
|
|
7
8
|
CTO analyzes your project and selects the **minimum set of files** your AI needs — saving tokens, reducing cost, and producing code that actually compiles.
|
package/dist/action/index.js
CHANGED
|
@@ -24179,8 +24179,8 @@ async function analyzeProject(projectPath, config) {
|
|
|
24179
24179
|
maxDepth: mergedConfig.analysis.maxDepth
|
|
24180
24180
|
});
|
|
24181
24181
|
const tokenMethod = mergedConfig.tokens.method;
|
|
24182
|
-
const
|
|
24183
|
-
|
|
24182
|
+
const BATCH_SIZE = 50;
|
|
24183
|
+
async function estimateFileTokens(entry) {
|
|
24184
24184
|
let tokens;
|
|
24185
24185
|
if (tokenMethod === "tiktoken") {
|
|
24186
24186
|
try {
|
|
@@ -24192,7 +24192,7 @@ async function analyzeProject(projectPath, config) {
|
|
|
24192
24192
|
} else {
|
|
24193
24193
|
tokens = countTokensChars4(entry.size);
|
|
24194
24194
|
}
|
|
24195
|
-
|
|
24195
|
+
return {
|
|
24196
24196
|
path: entry.path,
|
|
24197
24197
|
relativePath: entry.relativePath,
|
|
24198
24198
|
extension: entry.extension,
|
|
@@ -24201,16 +24201,20 @@ async function analyzeProject(projectPath, config) {
|
|
|
24201
24201
|
lines: entry.lines,
|
|
24202
24202
|
lastModified: entry.lastModified,
|
|
24203
24203
|
kind: classifyFileKind(entry.relativePath),
|
|
24204
|
-
// Graph data — populated by graph analysis
|
|
24205
24204
|
imports: [],
|
|
24206
24205
|
importedBy: [],
|
|
24207
24206
|
isHub: false,
|
|
24208
24207
|
complexity: 0,
|
|
24209
|
-
// Risk data — populated by risk analysis
|
|
24210
24208
|
riskScore: 0,
|
|
24211
24209
|
riskFactors: [],
|
|
24212
24210
|
exclusionImpact: "none"
|
|
24213
|
-
}
|
|
24211
|
+
};
|
|
24212
|
+
}
|
|
24213
|
+
const files = [];
|
|
24214
|
+
for (let i = 0; i < walkEntries.length; i += BATCH_SIZE) {
|
|
24215
|
+
const batch = walkEntries.slice(i, i + BATCH_SIZE);
|
|
24216
|
+
const results = await Promise.all(batch.map(estimateFileTokens));
|
|
24217
|
+
files.push(...results);
|
|
24214
24218
|
}
|
|
24215
24219
|
const graph = buildProjectGraph(absPath, files);
|
|
24216
24220
|
for (const file of files) {
|
package/dist/api/dashboard.js
CHANGED
|
@@ -592,8 +592,8 @@ async function analyzeProject(projectPath, config) {
|
|
|
592
592
|
maxDepth: mergedConfig.analysis.maxDepth
|
|
593
593
|
});
|
|
594
594
|
const tokenMethod = mergedConfig.tokens.method;
|
|
595
|
-
const
|
|
596
|
-
|
|
595
|
+
const BATCH_SIZE = 50;
|
|
596
|
+
async function estimateFileTokens(entry) {
|
|
597
597
|
let tokens;
|
|
598
598
|
if (tokenMethod === "tiktoken") {
|
|
599
599
|
try {
|
|
@@ -605,7 +605,7 @@ async function analyzeProject(projectPath, config) {
|
|
|
605
605
|
} else {
|
|
606
606
|
tokens = countTokensChars4(entry.size);
|
|
607
607
|
}
|
|
608
|
-
|
|
608
|
+
return {
|
|
609
609
|
path: entry.path,
|
|
610
610
|
relativePath: entry.relativePath,
|
|
611
611
|
extension: entry.extension,
|
|
@@ -614,16 +614,20 @@ async function analyzeProject(projectPath, config) {
|
|
|
614
614
|
lines: entry.lines,
|
|
615
615
|
lastModified: entry.lastModified,
|
|
616
616
|
kind: classifyFileKind(entry.relativePath),
|
|
617
|
-
// Graph data — populated by graph analysis
|
|
618
617
|
imports: [],
|
|
619
618
|
importedBy: [],
|
|
620
619
|
isHub: false,
|
|
621
620
|
complexity: 0,
|
|
622
|
-
// Risk data — populated by risk analysis
|
|
623
621
|
riskScore: 0,
|
|
624
622
|
riskFactors: [],
|
|
625
623
|
exclusionImpact: "none"
|
|
626
|
-
}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
const files = [];
|
|
627
|
+
for (let i = 0; i < walkEntries.length; i += BATCH_SIZE) {
|
|
628
|
+
const batch = walkEntries.slice(i, i + BATCH_SIZE);
|
|
629
|
+
const results = await Promise.all(batch.map(estimateFileTokens));
|
|
630
|
+
files.push(...results);
|
|
627
631
|
}
|
|
628
632
|
const graph = buildProjectGraph(absPath, files);
|
|
629
633
|
for (const file of files) {
|