promptgraph-mcp 2.1.0 → 2.1.1
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/chunker.js +3 -1
- package/indexer.js +2 -0
- package/package.json +1 -1
package/chunker.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const CHUNK_SIZE = 800;
|
|
2
2
|
const CHUNK_OVERLAP = 100;
|
|
3
|
+
const MAX_CHUNKS = 3;
|
|
3
4
|
|
|
4
5
|
export function chunkText(text) {
|
|
5
6
|
// Split on markdown h1/h2/h3 headers to preserve semantic boundaries
|
|
@@ -22,5 +23,6 @@ export function chunkText(text) {
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
const result = chunks.length > 0 ? chunks : [text];
|
|
27
|
+
return result.slice(0, MAX_CHUNKS);
|
|
26
28
|
}
|
package/indexer.js
CHANGED
|
@@ -37,7 +37,9 @@ async function indexBatch(db, skills) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const texts = allChunks.map(c => c.text);
|
|
40
|
+
process.stdout.write(` Embedding ${texts.length} chunks...`);
|
|
40
41
|
const embeddings = await embedBatch(texts);
|
|
42
|
+
process.stdout.write('\r' + ' '.repeat(40) + '\r');
|
|
41
43
|
|
|
42
44
|
// pass 1: upsert all skills + chunks (no edges yet)
|
|
43
45
|
db.transaction(() => {
|