@comfanion/workflow 4.31.0 → 4.32.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/package.json
CHANGED
package/src/build-info.json
CHANGED
|
@@ -138,7 +138,8 @@ async function processPendingFiles(projectRoot: string, config: VectorizerConfig
|
|
|
138
138
|
try {
|
|
139
139
|
const wasIndexed = await indexer.indexSingleFile(filePath)
|
|
140
140
|
if (wasIndexed) {
|
|
141
|
-
|
|
141
|
+
// Only log in debug mode, successful reindex is silent
|
|
142
|
+
debug(`Reindexed: ${path.relative(projectRoot, filePath)} -> ${indexName}`)
|
|
142
143
|
} else {
|
|
143
144
|
debug(`Skipped (unchanged): ${path.relative(projectRoot, filePath)}`)
|
|
144
145
|
}
|
package/src/vectorizer/index.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
// OpenCode Vectorizer - Semantic Code Search with Multi-Index Support
|
|
2
2
|
// Part of @comfanion/workflow
|
|
3
3
|
|
|
4
|
-
import { pipeline } from '@xenova/transformers';
|
|
4
|
+
import { pipeline, env } from '@xenova/transformers';
|
|
5
5
|
import * as lancedb from 'vectordb';
|
|
6
6
|
import fs from 'fs/promises';
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import crypto from 'crypto';
|
|
9
9
|
|
|
10
|
+
// Suppress transformers.js logs unless DEBUG is set
|
|
11
|
+
const DEBUG = process.env.DEBUG?.includes('vectorizer') || process.env.DEBUG === '*';
|
|
12
|
+
if (!DEBUG) {
|
|
13
|
+
env.allowLocalModels = true;
|
|
14
|
+
env.useBrowserCache = false;
|
|
15
|
+
// Disable progress callbacks and logs
|
|
16
|
+
env.logLevel = 'error';
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
/**
|
|
11
20
|
* Index presets for different content types
|
|
12
21
|
*/
|
|
@@ -53,8 +62,11 @@ class CodebaseIndexer {
|
|
|
53
62
|
|
|
54
63
|
async loadModel() {
|
|
55
64
|
if (!this.model) {
|
|
56
|
-
console.log('Loading embedding model
|
|
57
|
-
this.model = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2'
|
|
65
|
+
if (DEBUG) console.log('[vectorizer] Loading embedding model...');
|
|
66
|
+
this.model = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', {
|
|
67
|
+
progress_callback: DEBUG ? undefined : null // Suppress progress bar unless DEBUG
|
|
68
|
+
});
|
|
69
|
+
if (DEBUG) console.log('[vectorizer] Model loaded');
|
|
58
70
|
}
|
|
59
71
|
return this.model;
|
|
60
72
|
}
|