promptgraph-mcp 2.9.20 → 2.9.22
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/cli.js +1 -1
- package/indexer.js +7 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -66,7 +66,7 @@ export function progress(current, total, { skipped = 0, eta = '?', errors = 0 }
|
|
|
66
66
|
colors.muted(current + '/' + total),
|
|
67
67
|
skipped > 0 ? colors.muted('skip ' + skipped) : '',
|
|
68
68
|
errors > 0 ? colors.error('err ' + errors) : '',
|
|
69
|
-
eta !== '?' ? colors.muted('eta ' + formatTime(eta)) : '',
|
|
69
|
+
eta !== '?' && eta > 0 ? colors.muted('eta ' + formatTime(eta)) : eta === '?' ? colors.muted('scanning...') : '',
|
|
70
70
|
].filter(Boolean).join(' ');
|
|
71
71
|
|
|
72
72
|
process.stdout.write('\r ' + bar + ' ' + stats + ' ');
|
package/indexer.js
CHANGED
|
@@ -70,16 +70,17 @@ export async function indexBatch(db, skills, { fast = false } = {}) {
|
|
|
70
70
|
if (!fast && allChunks.length) {
|
|
71
71
|
const texts = allChunks.map(c => c.text);
|
|
72
72
|
const total = texts.length;
|
|
73
|
-
|
|
74
|
-
spin.start();
|
|
73
|
+
process.stdout.write('\n ⠋ Preparing model...\n');
|
|
75
74
|
let embedStart = null;
|
|
76
75
|
const embeddings = await embedBatch(texts, (done, tot) => {
|
|
77
|
-
if (!embedStart) {
|
|
76
|
+
if (!embedStart) {
|
|
77
|
+
process.stdout.write('\x1b[1A\x1b[2K');
|
|
78
|
+
embedStart = Date.now();
|
|
79
|
+
}
|
|
78
80
|
const elapsed = (Date.now() - embedStart) / 1000;
|
|
79
81
|
const eta = done > 0 ? Math.round((tot - done) * elapsed / done) : '?';
|
|
80
82
|
progress(done, tot, { eta });
|
|
81
83
|
});
|
|
82
|
-
if (!embedStart) spin.stop();
|
|
83
84
|
progressDone();
|
|
84
85
|
db.transaction(() => {
|
|
85
86
|
for (let i = 0; i < allChunks.length; i++) {
|
|
@@ -195,9 +196,10 @@ export async function indexAll({ fast = false } = {}) {
|
|
|
195
196
|
if (dbRow?.hash === hash) {
|
|
196
197
|
skipped++; count++;
|
|
197
198
|
if (count % 200 === 0) {
|
|
199
|
+
const elapsed = Date.now() - start;
|
|
198
200
|
const eta = processedCount > 0 && processedStart
|
|
199
201
|
? Math.round((total - count) * (Date.now() - processedStart) / processedCount / 1000)
|
|
200
|
-
: Math.round((total - count) *
|
|
202
|
+
: elapsed > 500 ? Math.round((total - count) * elapsed / count / 1000) : '?';
|
|
201
203
|
progress(count, total, { skipped, eta, errors });
|
|
202
204
|
}
|
|
203
205
|
continue;
|