brainbank 0.8.4 → 0.8.6
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/{chunk-IB3X5D5Y.js → chunk-IRKE4KMJ.js} +24 -1
- package/dist/chunk-IRKE4KMJ.js.map +1 -0
- package/dist/cli.js +4 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/context.ts +4 -1
- package/src/cli/utils.ts +16 -0
- package/src/search/bm25-boost.ts +6 -0
- package/src/search/context-builder.ts +4 -2
- package/src/types.ts +2 -0
- package/dist/chunk-IB3X5D5Y.js.map +0 -1
|
@@ -576,6 +576,11 @@ function filterByPath(results, prefix) {
|
|
|
576
576
|
return results.filter((r) => r.filePath?.startsWith(prefix));
|
|
577
577
|
}
|
|
578
578
|
__name(filterByPath, "filterByPath");
|
|
579
|
+
function filterByIgnore(results, ignorePaths) {
|
|
580
|
+
if (!ignorePaths || ignorePaths.length === 0) return results;
|
|
581
|
+
return results.filter((r) => !r.filePath || !ignorePaths.some((p) => r.filePath.startsWith(p)));
|
|
582
|
+
}
|
|
583
|
+
__name(filterByIgnore, "filterByIgnore");
|
|
579
584
|
|
|
580
585
|
// src/lib/logger.ts
|
|
581
586
|
import * as fs2 from "fs";
|
|
@@ -679,6 +684,7 @@ var ContextBuilder = class {
|
|
|
679
684
|
mmrLambda
|
|
680
685
|
}) : [];
|
|
681
686
|
results = filterByPath(results, options.pathPrefix);
|
|
687
|
+
results = filterByIgnore(results, options.ignorePaths);
|
|
682
688
|
const pruner = options.pruner ?? this._pruner;
|
|
683
689
|
const beforePrune = results;
|
|
684
690
|
if (pruner && results.length > 1) {
|
|
@@ -718,6 +724,7 @@ ${expanderNote}
|
|
|
718
724
|
options: {
|
|
719
725
|
sources: src,
|
|
720
726
|
pathPrefix: options.pathPrefix,
|
|
727
|
+
ignorePaths: options.ignorePaths,
|
|
721
728
|
minScore,
|
|
722
729
|
affectedFiles: options.affectedFiles
|
|
723
730
|
},
|
|
@@ -2830,6 +2837,21 @@ function getFlag(name) {
|
|
|
2830
2837
|
return idx >= 0 ? args[idx + 1] : void 0;
|
|
2831
2838
|
}
|
|
2832
2839
|
__name(getFlag, "getFlag");
|
|
2840
|
+
function getFlagAll(name) {
|
|
2841
|
+
const values = [];
|
|
2842
|
+
const flag = `--${name}`;
|
|
2843
|
+
for (let i = 0; i < args.length; i++) {
|
|
2844
|
+
if (args[i] === flag && args[i + 1] && !args[i + 1].startsWith("--")) {
|
|
2845
|
+
for (const v of args[i + 1].split(",")) {
|
|
2846
|
+
const trimmed = v.trim();
|
|
2847
|
+
if (trimmed) values.push(trimmed);
|
|
2848
|
+
}
|
|
2849
|
+
i++;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
return values;
|
|
2853
|
+
}
|
|
2854
|
+
__name(getFlagAll, "getFlagAll");
|
|
2833
2855
|
function hasFlag(name) {
|
|
2834
2856
|
return args.includes(`--${name}`);
|
|
2835
2857
|
}
|
|
@@ -3249,6 +3271,7 @@ export {
|
|
|
3249
3271
|
c,
|
|
3250
3272
|
args,
|
|
3251
3273
|
getFlag,
|
|
3274
|
+
getFlagAll,
|
|
3252
3275
|
hasFlag,
|
|
3253
3276
|
stripFlags,
|
|
3254
3277
|
printResults,
|
|
@@ -3260,4 +3283,4 @@ export {
|
|
|
3260
3283
|
resetFactoryCache,
|
|
3261
3284
|
createBrain
|
|
3262
3285
|
};
|
|
3263
|
-
//# sourceMappingURL=chunk-
|
|
3286
|
+
//# sourceMappingURL=chunk-IRKE4KMJ.js.map
|