@vibecheck-ai/cli 7.5.1 → 18.5.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/cli.js +390 -190
- package/dist/cli.js.map +1 -1
- package/dist/guardrail/index.js +4 -3
- package/dist/guardrail/index.js.map +1 -1
- package/dist/v2/index.js +390 -190
- package/dist/v2/index.js.map +1 -1
- package/package.json +8 -4
package/dist/guardrail/index.js
CHANGED
|
@@ -157,7 +157,7 @@ var TruthpackScanner = class {
|
|
|
157
157
|
const relativePath = path.relative(this.projectRoot, file);
|
|
158
158
|
const apiMatch = relativePath.match(/(?:pages|app)\/api\/(.+)\.(ts|js|tsx|jsx)/i);
|
|
159
159
|
if (apiMatch) {
|
|
160
|
-
|
|
160
|
+
const route = "/" + apiMatch[1].replace(/\[\.\.\.(\w+)\]/g, "*").replace(/\[(\w+)\]/g, ":$1").replace(/\/index$/, "").replace(/\\/g, "/");
|
|
161
161
|
return "/api" + route;
|
|
162
162
|
}
|
|
163
163
|
return "/api/unknown";
|
|
@@ -767,7 +767,7 @@ var LargeCodebaseScanner = class {
|
|
|
767
767
|
const relativePath = path2.relative(this.projectRoot, file);
|
|
768
768
|
const apiMatch = relativePath.match(/(?:pages|app)\/api\/(.+)\.(ts|js|tsx|jsx)/i);
|
|
769
769
|
if (apiMatch) {
|
|
770
|
-
|
|
770
|
+
const route = "/" + apiMatch[1].replace(/\[\.\.\.(\w+)\]/g, "*").replace(/\[(\w+)\]/g, ":$1").replace(/\/index$/, "").replace(/\\/g, "/");
|
|
771
771
|
return "/api" + route;
|
|
772
772
|
}
|
|
773
773
|
return "/api/unknown";
|
|
@@ -6074,10 +6074,11 @@ var ContextOptimizer = class {
|
|
|
6074
6074
|
const targetAnalysis = await this.analyzeFile(request.targetFile);
|
|
6075
6075
|
const candidates = await this.buildCandidates(request, targetAnalysis);
|
|
6076
6076
|
const selectedChunks = this.greedySelect(candidates, tokenBudget, request.preferredTypes);
|
|
6077
|
+
totalTokens = selectedChunks.reduce((sum, c) => sum + c.tokens, 0);
|
|
6077
6078
|
const coverage = this.calculateCoverage(selectedChunks, targetAnalysis);
|
|
6078
6079
|
return {
|
|
6079
6080
|
chunks: selectedChunks,
|
|
6080
|
-
totalTokens
|
|
6081
|
+
totalTokens,
|
|
6081
6082
|
coverage,
|
|
6082
6083
|
strategy: this.describeStrategy(request, selectedChunks)
|
|
6083
6084
|
};
|