composto-ai 0.8.2 → 0.8.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/index.js +23 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1526,6 +1526,17 @@ function summarize(results) {
|
|
|
1526
1526
|
return { fileCount: results.length, totalRaw, totalIRL0, totalIRL1, totalSavedPercent, astCount, fpCount };
|
|
1527
1527
|
}
|
|
1528
1528
|
|
|
1529
|
+
// src/version.ts
|
|
1530
|
+
import { createRequire } from "module";
|
|
1531
|
+
var VERSION = (() => {
|
|
1532
|
+
try {
|
|
1533
|
+
const req = createRequire(import.meta.url);
|
|
1534
|
+
return req("../package.json").version;
|
|
1535
|
+
} catch {
|
|
1536
|
+
return "0.0.0";
|
|
1537
|
+
}
|
|
1538
|
+
})();
|
|
1539
|
+
|
|
1529
1540
|
// src/benchmark/quality.ts
|
|
1530
1541
|
var BENCHMARK_PROMPTS = [
|
|
1531
1542
|
{
|
|
@@ -2692,7 +2703,8 @@ function statFileSize(path) {
|
|
|
2692
2703
|
function runScan(projectPath) {
|
|
2693
2704
|
const adapter = new CLIAdapter();
|
|
2694
2705
|
const config = loadConfig(projectPath);
|
|
2695
|
-
console.log(
|
|
2706
|
+
console.log(`composto v${VERSION} \u2014 scanning...
|
|
2707
|
+
`);
|
|
2696
2708
|
const files = collectFiles(projectPath, [".ts", ".tsx", ".js", ".jsx"]);
|
|
2697
2709
|
console.log(` Found ${files.length} files
|
|
2698
2710
|
`);
|
|
@@ -2719,7 +2731,8 @@ function runScan(projectPath) {
|
|
|
2719
2731
|
function runTrends(projectPath) {
|
|
2720
2732
|
const adapter = new CLIAdapter();
|
|
2721
2733
|
const config = loadConfig(projectPath);
|
|
2722
|
-
console.log(
|
|
2734
|
+
console.log(`composto v${VERSION} \u2014 trend analysis...
|
|
2735
|
+
`);
|
|
2723
2736
|
const entries = getGitLog(projectPath, 100);
|
|
2724
2737
|
if (entries.length === 0) {
|
|
2725
2738
|
console.log(" No git history found.\n");
|
|
@@ -2761,7 +2774,8 @@ async function runIR(projectPath, filePath, layer) {
|
|
|
2761
2774
|
}
|
|
2762
2775
|
var ALL_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".go", ".rs"];
|
|
2763
2776
|
async function runBenchmark(projectPath) {
|
|
2764
|
-
console.log(
|
|
2777
|
+
console.log(`composto v${VERSION} \u2014 benchmark
|
|
2778
|
+
`);
|
|
2765
2779
|
const files = collectFiles(projectPath, ALL_EXTENSIONS);
|
|
2766
2780
|
console.log(` ${files.length} files
|
|
2767
2781
|
`);
|
|
@@ -2827,7 +2841,8 @@ async function runBenchmarkQuality(projectPath, filePath) {
|
|
|
2827
2841
|
}
|
|
2828
2842
|
const code = readFileSync4(filePath, "utf-8");
|
|
2829
2843
|
const relPath = relative2(projectPath, filePath);
|
|
2830
|
-
console.log(
|
|
2844
|
+
console.log(`composto v${VERSION} \u2014 quality benchmark
|
|
2845
|
+
`);
|
|
2831
2846
|
console.log(` File: ${relPath}
|
|
2832
2847
|
`);
|
|
2833
2848
|
console.log(" Sending to Claude Haiku...\n");
|
|
@@ -2857,8 +2872,8 @@ ${result.ir.response}
|
|
|
2857
2872
|
}
|
|
2858
2873
|
}
|
|
2859
2874
|
async function runContext(projectPath, budget, target) {
|
|
2860
|
-
const header = target ? `composto
|
|
2861
|
-
` : `composto
|
|
2875
|
+
const header = target ? `composto v${VERSION} \u2014 context (target: ${target}, budget: ${budget} tokens)
|
|
2876
|
+
` : `composto v${VERSION} \u2014 context (budget: ${budget} tokens)
|
|
2862
2877
|
`;
|
|
2863
2878
|
console.log(header);
|
|
2864
2879
|
const files = collectFiles(projectPath, ALL_EXTENSIONS);
|
|
@@ -3679,11 +3694,11 @@ function renderSummary(s) {
|
|
|
3679
3694
|
}
|
|
3680
3695
|
|
|
3681
3696
|
// src/index.ts
|
|
3682
|
-
import { createRequire } from "module";
|
|
3697
|
+
import { createRequire as createRequire2 } from "module";
|
|
3683
3698
|
import { join as join13, resolve as resolve2 } from "path";
|
|
3684
3699
|
var PKG_VERSION = (() => {
|
|
3685
3700
|
try {
|
|
3686
|
-
const req =
|
|
3701
|
+
const req = createRequire2(import.meta.url);
|
|
3687
3702
|
return req("../package.json").version;
|
|
3688
3703
|
} catch {
|
|
3689
3704
|
return "0.0.0";
|