gitnexus 1.3.11 → 1.4.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/README.md +194 -194
- package/dist/cli/ai-context.js +87 -105
- package/dist/cli/analyze.js +0 -8
- package/dist/cli/index.js +25 -15
- package/dist/cli/setup.js +19 -17
- package/dist/core/augmentation/engine.js +20 -20
- package/dist/core/embeddings/embedding-pipeline.js +26 -26
- package/dist/core/ingestion/ast-cache.js +2 -3
- package/dist/core/ingestion/call-processor.js +5 -7
- package/dist/core/ingestion/cluster-enricher.js +16 -16
- package/dist/core/ingestion/pipeline.js +2 -23
- package/dist/core/ingestion/tree-sitter-queries.js +484 -484
- package/dist/core/ingestion/utils.js +5 -1
- package/dist/core/ingestion/workers/worker-pool.js +0 -8
- package/dist/core/kuzu/kuzu-adapter.js +19 -11
- package/dist/core/kuzu/schema.js +287 -287
- package/dist/core/search/bm25-index.js +6 -7
- package/dist/core/search/hybrid-search.js +3 -3
- package/dist/core/wiki/diagrams.d.ts +27 -0
- package/dist/core/wiki/diagrams.js +163 -0
- package/dist/core/wiki/generator.d.ts +50 -2
- package/dist/core/wiki/generator.js +548 -49
- package/dist/core/wiki/graph-queries.d.ts +42 -0
- package/dist/core/wiki/graph-queries.js +276 -97
- package/dist/core/wiki/html-viewer.js +192 -192
- package/dist/core/wiki/llm-client.js +73 -11
- package/dist/core/wiki/prompts.d.ts +52 -8
- package/dist/core/wiki/prompts.js +200 -86
- package/dist/mcp/core/kuzu-adapter.d.ts +3 -1
- package/dist/mcp/core/kuzu-adapter.js +44 -13
- package/dist/mcp/local/local-backend.js +128 -128
- package/dist/mcp/resources.js +42 -42
- package/dist/mcp/server.js +19 -18
- package/dist/mcp/tools.js +103 -93
- package/hooks/claude/gitnexus-hook.cjs +155 -238
- package/hooks/claude/pre-tool-use.sh +79 -79
- package/hooks/claude/session-start.sh +42 -42
- package/package.json +96 -96
- package/scripts/patch-tree-sitter-swift.cjs +74 -74
- package/skills/gitnexus-cli.md +82 -82
- package/skills/gitnexus-debugging.md +89 -89
- package/skills/gitnexus-exploring.md +78 -78
- package/skills/gitnexus-guide.md +64 -64
- package/skills/gitnexus-impact-analysis.md +97 -97
- package/skills/gitnexus-pr-review.md +163 -163
- package/skills/gitnexus-refactoring.md +121 -121
- package/vendor/leiden/index.cjs +355 -355
- package/vendor/leiden/utils.cjs +392 -392
- package/dist/cli/lazy-action.d.ts +0 -6
- package/dist/cli/lazy-action.js +0 -18
- package/dist/mcp/compatible-stdio-transport.d.ts +0 -25
- package/dist/mcp/compatible-stdio-transport.js +0 -200
|
@@ -30,11 +30,15 @@ export const getLanguageFromFilename = (filename) => {
|
|
|
30
30
|
return SupportedLanguages.TypeScript;
|
|
31
31
|
if (filename.endsWith('.ts'))
|
|
32
32
|
return SupportedLanguages.TypeScript;
|
|
33
|
-
// JavaScript (including JSX)
|
|
33
|
+
// JavaScript (including JSX, CJS, MJS)
|
|
34
34
|
if (filename.endsWith('.jsx'))
|
|
35
35
|
return SupportedLanguages.JavaScript;
|
|
36
36
|
if (filename.endsWith('.js'))
|
|
37
37
|
return SupportedLanguages.JavaScript;
|
|
38
|
+
if (filename.endsWith('.cjs'))
|
|
39
|
+
return SupportedLanguages.JavaScript;
|
|
40
|
+
if (filename.endsWith('.mjs'))
|
|
41
|
+
return SupportedLanguages.JavaScript;
|
|
38
42
|
// Python
|
|
39
43
|
if (filename.endsWith('.py'))
|
|
40
44
|
return SupportedLanguages.Python;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Worker } from 'node:worker_threads';
|
|
2
2
|
import os from 'node:os';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
3
|
/**
|
|
6
4
|
* Max files to send to a worker in a single postMessage.
|
|
7
5
|
* Keeps structured-clone memory bounded per sub-batch.
|
|
@@ -14,12 +12,6 @@ const SUB_BATCH_TIMEOUT_MS = 30_000;
|
|
|
14
12
|
* Create a pool of worker threads.
|
|
15
13
|
*/
|
|
16
14
|
export const createWorkerPool = (workerUrl, poolSize) => {
|
|
17
|
-
// Validate worker script exists before spawning to prevent uncaught
|
|
18
|
-
// MODULE_NOT_FOUND crashes in worker threads (e.g. when running from src/ via vitest)
|
|
19
|
-
const workerPath = fileURLToPath(workerUrl);
|
|
20
|
-
if (!fs.existsSync(workerPath)) {
|
|
21
|
-
throw new Error(`Worker script not found: ${workerPath}`);
|
|
22
|
-
}
|
|
23
15
|
const size = poolSize ?? Math.min(8, Math.max(1, os.cpus().length - 1));
|
|
24
16
|
const workers = [];
|
|
25
17
|
for (let i = 0; i < size; i++) {
|
|
@@ -104,6 +104,12 @@ const doInitKuzu = async (dbPath) => {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
currentDbPath = dbPath;
|
|
107
|
+
// Pre-load FTS extension so QUERY_FTS_INDEX works immediately
|
|
108
|
+
// (without this, queryFTS and raw cypher queries using FTS would fail)
|
|
109
|
+
try {
|
|
110
|
+
await loadFTSExtension();
|
|
111
|
+
}
|
|
112
|
+
catch { /* non-fatal */ }
|
|
107
113
|
return { db, conn };
|
|
108
114
|
};
|
|
109
115
|
export const loadGraphToKuzu = async (graph, repoPath, storagePath, onProgress) => {
|
|
@@ -289,10 +295,10 @@ const fallbackRelationshipInserts = async (validRelLines, validTables, getNodeLa
|
|
|
289
295
|
continue;
|
|
290
296
|
const confidence = parseFloat(confidenceStr) || 1.0;
|
|
291
297
|
const step = parseInt(stepStr) || 0;
|
|
292
|
-
await conn.query(`
|
|
293
|
-
MATCH (a:${escapeLabel(fromLabel)} {id: '${fromId.replace(/'/g, "''")}' }),
|
|
294
|
-
(b:${escapeLabel(toLabel)} {id: '${toId.replace(/'/g, "''")}' })
|
|
295
|
-
CREATE (a)-[:${REL_TABLE_NAME} {type: '${relType}', confidence: ${confidence}, reason: '${reason.replace(/'/g, "''")}', step: ${step}}]->(b)
|
|
298
|
+
await conn.query(`
|
|
299
|
+
MATCH (a:${escapeLabel(fromLabel)} {id: '${fromId.replace(/'/g, "''")}' }),
|
|
300
|
+
(b:${escapeLabel(toLabel)} {id: '${toId.replace(/'/g, "''")}' })
|
|
301
|
+
CREATE (a)-[:${REL_TABLE_NAME} {type: '${relType}', confidence: ${confidence}, reason: '${reason.replace(/'/g, "''")}', step: ${step}}]->(b)
|
|
296
302
|
`);
|
|
297
303
|
}
|
|
298
304
|
catch {
|
|
@@ -711,13 +717,15 @@ export const queryFTS = async (tableName, indexName, query, limit = 20, conjunct
|
|
|
711
717
|
if (!conn) {
|
|
712
718
|
throw new Error('KuzuDB not initialized. Call initKuzu first.');
|
|
713
719
|
}
|
|
714
|
-
//
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
720
|
+
// Ensure FTS extension is loaded (safe to call multiple times)
|
|
721
|
+
await loadFTSExtension();
|
|
722
|
+
// Escape single quotes in query
|
|
723
|
+
const escapedQuery = query.replace(/'/g, "''");
|
|
724
|
+
const cypher = `
|
|
725
|
+
CALL QUERY_FTS_INDEX('${tableName}', '${indexName}', '${escapedQuery}', conjunctive := ${conjunctive})
|
|
726
|
+
RETURN node, score
|
|
727
|
+
ORDER BY score DESC
|
|
728
|
+
LIMIT ${limit}
|
|
721
729
|
`;
|
|
722
730
|
try {
|
|
723
731
|
const queryResult = await conn.query(cypher);
|