promptgraph-mcp 2.9.25 → 2.9.27
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/commands/update.js +2 -1
- package/indexer.js +10 -4
- package/package.json +1 -1
package/commands/update.js
CHANGED
|
@@ -36,8 +36,9 @@ export default async function handler(args, bin) {
|
|
|
36
36
|
info(`Current: ${chalk.gray('v' + currentVersion)} → Latest: ${chalk.white.bold('v' + latest)}`);
|
|
37
37
|
|
|
38
38
|
// Kill other node processes that may lock native .node files (e.g. pg reindex still running)
|
|
39
|
+
// Exclude current PID to avoid killing ourselves
|
|
39
40
|
if (process.platform === 'win32') {
|
|
40
|
-
spawnSync('
|
|
41
|
+
spawnSync('wmic', ['process', 'where', `name='node.exe' and ProcessId!=${process.pid}`, 'delete'], { stdio: 'ignore', shell: true });
|
|
41
42
|
} else {
|
|
42
43
|
spawnSync('pkill', ['-f', 'promptgraph-mcp'], { stdio: 'ignore' });
|
|
43
44
|
}
|
package/indexer.js
CHANGED
|
@@ -19,7 +19,7 @@ function sanitizePath(filePath) {
|
|
|
19
19
|
return path.resolve(filePath);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export async function indexBatch(db, skills, { fast = false, silent = false } = {}) {
|
|
22
|
+
export async function indexBatch(db, skills, { fast = false, silent = false, onEmbed = null } = {}) {
|
|
23
23
|
const upsertSkill = db.prepare(`
|
|
24
24
|
INSERT INTO skills (id, name, description, path, source, content, hash, version, author, license, updated_at, downloads, verified)
|
|
25
25
|
VALUES (@id, @name, @description, @path, @source, @content, @hash, @version, @author, @license, @updated_at, @downloads, @verified)
|
|
@@ -72,7 +72,9 @@ export async function indexBatch(db, skills, { fast = false, silent = false } =
|
|
|
72
72
|
const total = texts.length;
|
|
73
73
|
if (!silent) process.stdout.write('\n ⠋ Preparing model...\n');
|
|
74
74
|
let embedStart = null;
|
|
75
|
-
const embeddings = await embedBatch(texts,
|
|
75
|
+
const embeddings = await embedBatch(texts, (done, tot) => {
|
|
76
|
+
if (onEmbed) { onEmbed(done, tot); return; }
|
|
77
|
+
if (silent) return;
|
|
76
78
|
if (!embedStart) {
|
|
77
79
|
process.stdout.write('\x1b[1A\x1b[2K');
|
|
78
80
|
embedStart = Date.now();
|
|
@@ -215,7 +217,9 @@ export async function indexAll({ fast = false } = {}) {
|
|
|
215
217
|
if (batch.length >= BATCH_SIZE) {
|
|
216
218
|
const filtered = await filterWithClassifier(batch);
|
|
217
219
|
classifierRemoved += batch.length - filtered.length;
|
|
218
|
-
await indexBatch(db, filtered, { fast, silent: true
|
|
220
|
+
await indexBatch(db, filtered, { fast, silent: true, onEmbed: (done, tot) => {
|
|
221
|
+
process.stdout.write(`\r ⠋ Embedding ${done}/${tot} chunks... `);
|
|
222
|
+
}});
|
|
219
223
|
count += filtered.length;
|
|
220
224
|
processedCount += filtered.length;
|
|
221
225
|
batch = [];
|
|
@@ -241,7 +245,9 @@ export async function indexAll({ fast = false } = {}) {
|
|
|
241
245
|
if (batch.length > 0) {
|
|
242
246
|
const filtered = await filterWithClassifier(batch);
|
|
243
247
|
classifierRemoved += batch.length - filtered.length;
|
|
244
|
-
await indexBatch(db, filtered, { fast, silent: true
|
|
248
|
+
await indexBatch(db, filtered, { fast, silent: true, onEmbed: (done, tot) => {
|
|
249
|
+
process.stdout.write(`\r ⠋ Embedding ${done}/${tot} chunks... `);
|
|
250
|
+
}});
|
|
245
251
|
count += filtered.length;
|
|
246
252
|
}
|
|
247
253
|
|