graph-indexer 1.0.1 → 1.0.2
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/PROMPT.md +218 -35
- package/README.md +212 -855
- package/core-engine.mjs +363 -159
- package/indexer.mjs +8 -8
- package/mcp-server.mjs +397 -150
- package/package.json +1 -1
- package/parser-utils.mjs +42 -2
- package/watch-daemon.mjs +2 -2
package/indexer.mjs
CHANGED
|
@@ -61,7 +61,7 @@ async function main() {
|
|
|
61
61
|
for (const absolutePath of files) {
|
|
62
62
|
totalCheckedFiles++;
|
|
63
63
|
const relPath = path.relative(PROJECT_ROOT, absolutePath).replace(/\\/g, '/');
|
|
64
|
-
process.stdout.write(`\r⚡ Parsing AST: [${totalCheckedFiles}/${files.length}]
|
|
64
|
+
process.stdout.write(`\r⚡ Parsing AST: [${totalCheckedFiles}/${files.length}] Processing: ${relPath.slice(-40)} `);
|
|
65
65
|
|
|
66
66
|
if (relPath.includes('.bundle.') || relPath.includes('.min.')) continue;
|
|
67
67
|
|
|
@@ -92,14 +92,14 @@ async function main() {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
} catch (err) {
|
|
95
|
-
console.error(`\n💥 Error
|
|
95
|
+
console.error(`\n💥 Error in ${relPath}: ${err.message}`);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
const pendingChunks = indexData.chunksToEmbed || [];
|
|
100
100
|
console.log(`\n\n🧠 Embedding Generation (Ollama)`);
|
|
101
|
-
console.log(`Chunks
|
|
102
|
-
console.log(`
|
|
101
|
+
console.log(`Chunks reused from cache: ${indexData.chunks.length}`);
|
|
102
|
+
console.log(`New chunks to process: ${pendingChunks.length}`);
|
|
103
103
|
|
|
104
104
|
if (pendingChunks.length > 0) {
|
|
105
105
|
const BATCH_SIZE = 64;
|
|
@@ -124,11 +124,11 @@ async function main() {
|
|
|
124
124
|
? `This code architectural neighborhood connects with: ${cleanDeps.join(', ')}.`
|
|
125
125
|
: '';
|
|
126
126
|
|
|
127
|
-
// 🥇 BLEED PROTECTION: Flattened linear payload for Ollama without hidden indentation
|
|
128
127
|
return [
|
|
129
128
|
`File Location: ${c.file_path}`,
|
|
130
129
|
`Symbol Name: ${c.node_type} -> ${c.name}`,
|
|
131
130
|
c.docstring ? `Developer Documentation: ${c.docstring}` : '',
|
|
131
|
+
c.type_refs?.length ? `Type References: ${c.type_refs.join(', ')}` : '',
|
|
132
132
|
topologicalContext,
|
|
133
133
|
`--- Source Code ---`,
|
|
134
134
|
c.code_snippet
|
|
@@ -146,12 +146,12 @@ async function main() {
|
|
|
146
146
|
for (const chunk of batch) indexData.chunks.push(chunk);
|
|
147
147
|
}
|
|
148
148
|
completedChunksCount += batch.length;
|
|
149
|
-
process.stdout.write(`\r🤖 Embedding Progress: [${completedChunksCount}/${pendingChunks.length}] Chunks
|
|
149
|
+
process.stdout.write(`\r🤖 Embedding Progress: [${completedChunksCount}/${pendingChunks.length}] Chunks processed...`);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
for (let i = 0; i < batches.length; i += CONCURRENCY) {
|
|
153
|
-
const
|
|
154
|
-
await Promise.all(
|
|
153
|
+
const batchGroup = batches.slice(i, i + CONCURRENCY);
|
|
154
|
+
await Promise.all(batchGroup.map(batch => worker(batch)));
|
|
155
155
|
}
|
|
156
156
|
console.timeEnd("Embedding Generation Duration");
|
|
157
157
|
}
|