raggrep 0.2.2 → 0.2.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/cli/main.js +22 -17
- package/dist/cli/main.js.map +9 -9
- package/dist/index.js +14 -12
- package/dist/index.js.map +8 -8
- package/dist/modules/language/typescript/index.d.ts +1 -1
- package/dist/modules/registry.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -24,7 +24,7 @@ class TransformersEmbeddingProvider {
|
|
|
24
24
|
constructor(config) {
|
|
25
25
|
this.config = {
|
|
26
26
|
model: config?.model ?? "all-MiniLM-L6-v2",
|
|
27
|
-
showProgress: config?.showProgress ??
|
|
27
|
+
showProgress: config?.showProgress ?? false
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async initialize(config) {
|
|
@@ -160,7 +160,7 @@ var init_transformersEmbedding = __esm(() => {
|
|
|
160
160
|
};
|
|
161
161
|
globalConfig = {
|
|
162
162
|
model: "all-MiniLM-L6-v2",
|
|
163
|
-
showProgress:
|
|
163
|
+
showProgress: false
|
|
164
164
|
};
|
|
165
165
|
});
|
|
166
166
|
|
|
@@ -306,7 +306,7 @@ function getEmbeddingConfigFromModule(moduleConfig) {
|
|
|
306
306
|
}
|
|
307
307
|
return {
|
|
308
308
|
model: modelName,
|
|
309
|
-
showProgress: options.showProgress
|
|
309
|
+
showProgress: options.showProgress === true
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
312
|
var DEFAULT_CONFIG, RAGGREP_TEMP_BASE, EMBEDDING_MODELS2;
|
|
@@ -2006,7 +2006,6 @@ class CoreModule {
|
|
|
2006
2006
|
bm25Data: this.bm25Index.serialize()
|
|
2007
2007
|
};
|
|
2008
2008
|
await fs2.writeFile(path6.join(coreDir, "symbols.json"), JSON.stringify(symbolIndexData, null, 2));
|
|
2009
|
-
console.log(` [Core] Symbol index built with ${this.symbolIndex.size} files`);
|
|
2010
2009
|
}
|
|
2011
2010
|
async search(query, ctx, options) {
|
|
2012
2011
|
const config = ctx.config;
|
|
@@ -2736,7 +2735,9 @@ class TypeScriptModule {
|
|
|
2736
2735
|
embeddings,
|
|
2737
2736
|
embeddingModel: currentConfig.model
|
|
2738
2737
|
};
|
|
2739
|
-
const chunkTypes = [
|
|
2738
|
+
const chunkTypes = [
|
|
2739
|
+
...new Set(parsedChunks.map((pc) => pc.type))
|
|
2740
|
+
];
|
|
2740
2741
|
const exports = parsedChunks.filter((pc) => pc.isExported && pc.name).map((pc) => pc.name);
|
|
2741
2742
|
const allKeywords = new Set;
|
|
2742
2743
|
for (const pc of parsedChunks) {
|
|
@@ -2776,11 +2777,14 @@ class TypeScriptModule {
|
|
|
2776
2777
|
}
|
|
2777
2778
|
this.symbolicIndex.buildBM25Index();
|
|
2778
2779
|
await this.symbolicIndex.save();
|
|
2779
|
-
console.log(` Symbolic index built with ${this.pendingSummaries.size} file summaries`);
|
|
2780
2780
|
this.pendingSummaries.clear();
|
|
2781
2781
|
}
|
|
2782
2782
|
async search(query, ctx, options = {}) {
|
|
2783
|
-
const {
|
|
2783
|
+
const {
|
|
2784
|
+
topK = DEFAULT_TOP_K2,
|
|
2785
|
+
minScore = DEFAULT_MIN_SCORE2,
|
|
2786
|
+
filePatterns
|
|
2787
|
+
} = options;
|
|
2784
2788
|
const indexDir = getRaggrepDir(ctx.rootDir, ctx.config);
|
|
2785
2789
|
const symbolicIndex = new SymbolicIndex(indexDir, this.id);
|
|
2786
2790
|
let allFiles;
|
|
@@ -2911,10 +2915,9 @@ var init_typescript = __esm(() => {
|
|
|
2911
2915
|
class ModuleRegistryImpl {
|
|
2912
2916
|
modules = new Map;
|
|
2913
2917
|
register(module) {
|
|
2914
|
-
if (this.modules.has(module.id)) {
|
|
2915
|
-
|
|
2918
|
+
if (!this.modules.has(module.id)) {
|
|
2919
|
+
this.modules.set(module.id, module);
|
|
2916
2920
|
}
|
|
2917
|
-
this.modules.set(module.id, module);
|
|
2918
2921
|
}
|
|
2919
2922
|
get(id) {
|
|
2920
2923
|
return this.modules.get(id);
|
|
@@ -3154,7 +3157,6 @@ class IntrospectionIndex {
|
|
|
3154
3157
|
await fs5.mkdir(path10.dirname(introFilePath), { recursive: true });
|
|
3155
3158
|
await fs5.writeFile(introFilePath, JSON.stringify(intro, null, 2));
|
|
3156
3159
|
}
|
|
3157
|
-
console.log(` [Introspection] Saved metadata for ${this.files.size} files`);
|
|
3158
3160
|
}
|
|
3159
3161
|
async load(config) {
|
|
3160
3162
|
const introDir = path10.join(getRaggrepDir(this.rootDir, config), "introspection");
|
|
@@ -4022,7 +4024,7 @@ init_embeddings();
|
|
|
4022
4024
|
// package.json
|
|
4023
4025
|
var package_default = {
|
|
4024
4026
|
name: "raggrep",
|
|
4025
|
-
version: "0.2.
|
|
4027
|
+
version: "0.2.3",
|
|
4026
4028
|
description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
|
|
4027
4029
|
type: "module",
|
|
4028
4030
|
main: "./dist/index.js",
|
|
@@ -4291,6 +4293,9 @@ Examples:
|
|
|
4291
4293
|
model: flags.model,
|
|
4292
4294
|
quiet: true
|
|
4293
4295
|
});
|
|
4296
|
+
console.log("RAGgrep Search");
|
|
4297
|
+
console.log(`==============
|
|
4298
|
+
`);
|
|
4294
4299
|
if (freshStats.indexed > 0 || freshStats.removed > 0) {
|
|
4295
4300
|
const parts = [];
|
|
4296
4301
|
if (freshStats.indexed > 0) {
|
|
@@ -4299,12 +4304,12 @@ Examples:
|
|
|
4299
4304
|
if (freshStats.removed > 0) {
|
|
4300
4305
|
parts.push(`${freshStats.removed} removed`);
|
|
4301
4306
|
}
|
|
4302
|
-
console.log(`
|
|
4307
|
+
console.log(`Using updated index: ${parts.join(", ")}
|
|
4303
4308
|
`);
|
|
4304
|
-
}
|
|
4305
|
-
|
|
4306
|
-
console.log(`==============
|
|
4309
|
+
} else {
|
|
4310
|
+
console.log(`Using cached index (no changes detected).
|
|
4307
4311
|
`);
|
|
4312
|
+
}
|
|
4308
4313
|
const filePatterns = flags.fileType ? [`*.${flags.fileType}`] : undefined;
|
|
4309
4314
|
const results = await search2(process.cwd(), query, {
|
|
4310
4315
|
topK: flags.topK ?? 10,
|
|
@@ -4456,4 +4461,4 @@ Run 'raggrep <command> --help' for more information.
|
|
|
4456
4461
|
}
|
|
4457
4462
|
main();
|
|
4458
4463
|
|
|
4459
|
-
//# debugId=
|
|
4464
|
+
//# debugId=DB928D21A583DAC064756E2164756E21
|