promptgraph-mcp 2.8.7 → 2.8.8
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 +1 -25
- package/package.json +1 -1
package/indexer.js
CHANGED
|
@@ -305,29 +305,5 @@ export async function indexSource(dir, sourceName) {
|
|
|
305
305
|
progressDone();
|
|
306
306
|
const elapsed1 = ((Date.now() - start) / 1000).toFixed(1);
|
|
307
307
|
success(`Indexed ${chalk.white.bold(count)} skills from ${sourceName} ${chalk.gray(`(${skipped} skipped, ${elapsed1}s)`)}`);
|
|
308
|
-
info(chalk.gray('
|
|
309
|
-
|
|
310
|
-
// Pass 2: embed in background (non-blocking)
|
|
311
|
-
setImmediate(async () => {
|
|
312
|
-
try {
|
|
313
|
-
const toEmbed = [];
|
|
314
|
-
for (const file of files) {
|
|
315
|
-
try {
|
|
316
|
-
const norm = sanitizePath(file);
|
|
317
|
-
const stat = fs.statSync(norm);
|
|
318
|
-
if (stat.size > MAX_FILE_SIZE) continue;
|
|
319
|
-
const raw = fs.readFileSync(norm, 'utf8');
|
|
320
|
-
if (!isSkillFile(file, raw)) continue;
|
|
321
|
-
const hash = createHash('md5').update(raw).digest('hex');
|
|
322
|
-
const parsed = parseSkillFile(file, sourceName, { raw });
|
|
323
|
-
toEmbed.push({ ...parsed, hash });
|
|
324
|
-
} catch {}
|
|
325
|
-
}
|
|
326
|
-
if (toEmbed.length === 0) return;
|
|
327
|
-
for (let i = 0; i < toEmbed.length; i += BATCH_SIZE) {
|
|
328
|
-
await indexBatch(db, toEmbed.slice(i, i + BATCH_SIZE), { fast: false });
|
|
329
|
-
}
|
|
330
|
-
await buildAnnIndex();
|
|
331
|
-
} catch {}
|
|
332
|
-
});
|
|
308
|
+
info(chalk.gray(' Run `pg reindex` anytime to enable semantic search.'));
|
|
333
309
|
}
|