promptgraph-mcp 2.9.28 → 2.9.29
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/indexer.js +5 -8
- package/package.json +1 -1
package/indexer.js
CHANGED
|
@@ -212,27 +212,24 @@ export async function indexAll({ fast = false } = {}) {
|
|
|
212
212
|
|
|
213
213
|
if (!processedStart) processedStart = Date.now();
|
|
214
214
|
count++;
|
|
215
|
-
if (count % 50 === 0) {
|
|
216
|
-
const elapsed = Date.now() - start;
|
|
217
|
-
const eta = processedCount > 0 && processedStart
|
|
218
|
-
? Math.round((total - count) * (Date.now() - processedStart) / processedCount / 1000)
|
|
219
|
-
: elapsed > 500 ? Math.round((total - count) * elapsed / count / 1000) : '?';
|
|
220
|
-
progress(count, total, { skipped, eta, errors });
|
|
221
|
-
}
|
|
222
215
|
const parsed = parseSkillFile(file, source, { raw });
|
|
223
216
|
batch.push({ ...parsed, hash });
|
|
224
217
|
|
|
225
218
|
if (batch.length >= BATCH_SIZE) {
|
|
226
219
|
const filtered = await filterWithClassifier(batch);
|
|
227
220
|
classifierRemoved += batch.length - filtered.length;
|
|
221
|
+
let embedMsg = '';
|
|
228
222
|
await indexBatch(db, filtered, { fast, silent: true, onEmbed: (done, tot) => {
|
|
229
|
-
|
|
223
|
+
embedMsg = `embedding ${done}/${tot}`;
|
|
224
|
+
process.stdout.write(`\r ⠋ ${embedMsg} chunks... `);
|
|
230
225
|
}});
|
|
231
226
|
processedCount += filtered.length;
|
|
232
227
|
batch = [];
|
|
233
228
|
const eta = processedCount > 0 ? Math.round((total - count) * (Date.now() - processedStart) / processedCount / 1000) : '?';
|
|
234
229
|
progress(count, total, { skipped, eta, errors });
|
|
235
230
|
await new Promise(r => setImmediate ? setImmediate(r) : setTimeout(r, 0));
|
|
231
|
+
} else {
|
|
232
|
+
progress(count, total, { skipped, eta: '?', errors });
|
|
236
233
|
}
|
|
237
234
|
} catch (e) {
|
|
238
235
|
errors++;
|