gitnexus 1.4.1 → 1.4.6
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 +215 -194
- package/dist/cli/ai-context.d.ts +2 -1
- package/dist/cli/ai-context.js +117 -90
- package/dist/cli/analyze.d.ts +2 -0
- package/dist/cli/analyze.js +57 -30
- package/dist/cli/augment.js +1 -1
- package/dist/cli/eval-server.d.ts +1 -1
- package/dist/cli/eval-server.js +14 -6
- package/dist/cli/index.js +18 -25
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/mcp.js +1 -1
- package/dist/cli/setup.js +42 -32
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +549 -0
- package/dist/cli/status.js +13 -4
- package/dist/cli/tool.d.ts +3 -2
- package/dist/cli/tool.js +48 -13
- package/dist/cli/wiki.js +2 -2
- package/dist/config/ignore-service.d.ts +25 -0
- package/dist/config/ignore-service.js +76 -0
- package/dist/config/supported-languages.d.ts +1 -0
- package/dist/config/supported-languages.js +1 -1
- package/dist/core/augmentation/engine.js +99 -72
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +1 -1
- package/dist/core/embeddings/embedding-pipeline.d.ts +3 -3
- package/dist/core/embeddings/embedding-pipeline.js +74 -47
- package/dist/core/embeddings/types.d.ts +1 -1
- package/dist/core/graph/types.d.ts +5 -2
- package/dist/core/ingestion/ast-cache.js +3 -2
- package/dist/core/ingestion/call-processor.d.ts +5 -7
- package/dist/core/ingestion/call-processor.js +430 -283
- package/dist/core/ingestion/call-routing.d.ts +53 -0
- package/dist/core/ingestion/call-routing.js +108 -0
- package/dist/core/ingestion/cluster-enricher.js +16 -16
- package/dist/core/ingestion/constants.d.ts +16 -0
- package/dist/core/ingestion/constants.js +16 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +2 -1
- package/dist/core/ingestion/entry-point-scoring.js +94 -24
- package/dist/core/ingestion/export-detection.d.ts +18 -0
- package/dist/core/ingestion/export-detection.js +231 -0
- package/dist/core/ingestion/filesystem-walker.js +4 -3
- package/dist/core/ingestion/framework-detection.d.ts +5 -1
- package/dist/core/ingestion/framework-detection.js +48 -8
- package/dist/core/ingestion/heritage-processor.d.ts +13 -5
- package/dist/core/ingestion/heritage-processor.js +109 -55
- package/dist/core/ingestion/import-processor.d.ts +16 -20
- package/dist/core/ingestion/import-processor.js +202 -696
- package/dist/core/ingestion/language-config.d.ts +46 -0
- package/dist/core/ingestion/language-config.js +167 -0
- package/dist/core/ingestion/mro-processor.d.ts +45 -0
- package/dist/core/ingestion/mro-processor.js +369 -0
- package/dist/core/ingestion/named-binding-extraction.d.ts +61 -0
- package/dist/core/ingestion/named-binding-extraction.js +363 -0
- package/dist/core/ingestion/parsing-processor.d.ts +3 -11
- package/dist/core/ingestion/parsing-processor.js +85 -181
- package/dist/core/ingestion/pipeline.d.ts +5 -1
- package/dist/core/ingestion/pipeline.js +192 -116
- package/dist/core/ingestion/process-processor.js +2 -1
- package/dist/core/ingestion/resolution-context.d.ts +53 -0
- package/dist/core/ingestion/resolution-context.js +132 -0
- package/dist/core/ingestion/resolvers/csharp.d.ts +22 -0
- package/dist/core/ingestion/resolvers/csharp.js +109 -0
- package/dist/core/ingestion/resolvers/go.d.ts +19 -0
- package/dist/core/ingestion/resolvers/go.js +42 -0
- package/dist/core/ingestion/resolvers/index.d.ts +18 -0
- package/dist/core/ingestion/resolvers/index.js +13 -0
- package/dist/core/ingestion/resolvers/jvm.d.ts +23 -0
- package/dist/core/ingestion/resolvers/jvm.js +87 -0
- package/dist/core/ingestion/resolvers/php.d.ts +15 -0
- package/dist/core/ingestion/resolvers/php.js +35 -0
- package/dist/core/ingestion/resolvers/python.d.ts +19 -0
- package/dist/core/ingestion/resolvers/python.js +52 -0
- package/dist/core/ingestion/resolvers/ruby.d.ts +12 -0
- package/dist/core/ingestion/resolvers/ruby.js +15 -0
- package/dist/core/ingestion/resolvers/rust.d.ts +15 -0
- package/dist/core/ingestion/resolvers/rust.js +73 -0
- package/dist/core/ingestion/resolvers/standard.d.ts +28 -0
- package/dist/core/ingestion/resolvers/standard.js +123 -0
- package/dist/core/ingestion/resolvers/utils.d.ts +33 -0
- package/dist/core/ingestion/resolvers/utils.js +122 -0
- package/dist/core/ingestion/symbol-table.d.ts +21 -1
- package/dist/core/ingestion/symbol-table.js +40 -12
- package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -11
- package/dist/core/ingestion/tree-sitter-queries.js +642 -485
- package/dist/core/ingestion/type-env.d.ts +49 -0
- package/dist/core/ingestion/type-env.js +611 -0
- package/dist/core/ingestion/type-extractors/c-cpp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +385 -0
- package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/csharp.js +383 -0
- package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/go.js +467 -0
- package/dist/core/ingestion/type-extractors/index.d.ts +22 -0
- package/dist/core/ingestion/type-extractors/index.js +31 -0
- package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
- package/dist/core/ingestion/type-extractors/jvm.js +681 -0
- package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/php.js +549 -0
- package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/python.js +406 -0
- package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/ruby.js +389 -0
- package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/rust.js +449 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +133 -0
- package/dist/core/ingestion/type-extractors/shared.js +703 -0
- package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/swift.js +137 -0
- package/dist/core/ingestion/type-extractors/types.d.ts +127 -0
- package/dist/core/ingestion/type-extractors/types.js +1 -0
- package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/typescript.js +494 -0
- package/dist/core/ingestion/utils.d.ts +98 -0
- package/dist/core/ingestion/utils.js +1064 -9
- package/dist/core/ingestion/workers/parse-worker.d.ts +38 -4
- package/dist/core/ingestion/workers/parse-worker.js +251 -359
- package/dist/core/ingestion/workers/worker-pool.js +8 -0
- package/dist/core/{kuzu → lbug}/csv-generator.d.ts +1 -1
- package/dist/core/{kuzu → lbug}/csv-generator.js +20 -4
- package/dist/core/{kuzu/kuzu-adapter.d.ts → lbug/lbug-adapter.d.ts} +19 -19
- package/dist/core/{kuzu/kuzu-adapter.js → lbug/lbug-adapter.js} +82 -82
- package/dist/core/{kuzu → lbug}/schema.d.ts +4 -4
- package/dist/core/{kuzu → lbug}/schema.js +304 -289
- package/dist/core/search/bm25-index.d.ts +4 -4
- package/dist/core/search/bm25-index.js +17 -16
- package/dist/core/search/hybrid-search.d.ts +2 -2
- package/dist/core/search/hybrid-search.js +9 -9
- package/dist/core/tree-sitter/parser-loader.js +9 -2
- package/dist/core/wiki/generator.d.ts +4 -52
- package/dist/core/wiki/generator.js +53 -552
- package/dist/core/wiki/graph-queries.d.ts +4 -46
- package/dist/core/wiki/graph-queries.js +103 -282
- package/dist/core/wiki/html-viewer.js +192 -192
- package/dist/core/wiki/llm-client.js +11 -73
- package/dist/core/wiki/prompts.d.ts +8 -52
- package/dist/core/wiki/prompts.js +86 -200
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +200 -0
- package/dist/mcp/core/{kuzu-adapter.d.ts → lbug-adapter.d.ts} +7 -9
- package/dist/mcp/core/{kuzu-adapter.js → lbug-adapter.js} +77 -79
- package/dist/mcp/local/local-backend.d.ts +7 -6
- package/dist/mcp/local/local-backend.js +176 -147
- package/dist/mcp/resources.js +42 -42
- package/dist/mcp/server.js +18 -19
- package/dist/mcp/tools.js +103 -104
- package/dist/server/api.js +12 -12
- package/dist/server/mcp-http.d.ts +1 -1
- package/dist/server/mcp-http.js +1 -1
- package/dist/storage/repo-manager.d.ts +20 -2
- package/dist/storage/repo-manager.js +55 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/hooks/claude/gitnexus-hook.cjs +238 -155
- package/hooks/claude/pre-tool-use.sh +79 -79
- package/hooks/claude/session-start.sh +42 -42
- package/package.json +99 -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/core/wiki/diagrams.d.ts +0 -27
- package/dist/core/wiki/diagrams.js +0 -163
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# GitNexus SessionStart hook for Claude Code
|
|
3
|
-
# Fires on session startup. Stdout is injected into Claude's context.
|
|
4
|
-
# Checks if the current directory has a GitNexus index.
|
|
5
|
-
|
|
6
|
-
dir="$PWD"
|
|
7
|
-
found=false
|
|
8
|
-
for i in 1 2 3 4 5; do
|
|
9
|
-
if [ -d "$dir/.gitnexus" ]; then
|
|
10
|
-
found=true
|
|
11
|
-
break
|
|
12
|
-
fi
|
|
13
|
-
parent="$(dirname "$dir")"
|
|
14
|
-
[ "$parent" = "$dir" ] && break
|
|
15
|
-
dir="$parent"
|
|
16
|
-
done
|
|
17
|
-
|
|
18
|
-
if [ "$found" = false ]; then
|
|
19
|
-
exit 0
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
# Inject GitNexus context — this stdout goes directly into Claude's context
|
|
23
|
-
cat << 'EOF'
|
|
24
|
-
## GitNexus Code Intelligence
|
|
25
|
-
|
|
26
|
-
This codebase is indexed by GitNexus, providing a knowledge graph with execution flows, relationships, and semantic search.
|
|
27
|
-
|
|
28
|
-
**Available MCP Tools:**
|
|
29
|
-
- `query` — Process-grouped code intelligence (execution flows related to a concept)
|
|
30
|
-
- `context` — 360-degree symbol view (categorized refs, process participation)
|
|
31
|
-
- `impact` — Blast radius analysis (what breaks if you change a symbol)
|
|
32
|
-
- `detect_changes` — Git-diff impact analysis (what do your changes affect)
|
|
33
|
-
- `rename` — Multi-file coordinated rename with confidence tags
|
|
34
|
-
- `cypher` — Raw graph queries
|
|
35
|
-
- `list_repos` — Discover indexed repos
|
|
36
|
-
|
|
37
|
-
**Quick Start:** READ `gitnexus://repo/{name}/context` for codebase overview, then use `query` to find execution flows.
|
|
38
|
-
|
|
39
|
-
**Resources:** `gitnexus://repo/{name}/context` (overview), `/processes` (execution flows), `/schema` (for Cypher)
|
|
40
|
-
EOF
|
|
41
|
-
|
|
42
|
-
exit 0
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# GitNexus SessionStart hook for Claude Code
|
|
3
|
+
# Fires on session startup. Stdout is injected into Claude's context.
|
|
4
|
+
# Checks if the current directory has a GitNexus index.
|
|
5
|
+
|
|
6
|
+
dir="$PWD"
|
|
7
|
+
found=false
|
|
8
|
+
for i in 1 2 3 4 5; do
|
|
9
|
+
if [ -d "$dir/.gitnexus" ]; then
|
|
10
|
+
found=true
|
|
11
|
+
break
|
|
12
|
+
fi
|
|
13
|
+
parent="$(dirname "$dir")"
|
|
14
|
+
[ "$parent" = "$dir" ] && break
|
|
15
|
+
dir="$parent"
|
|
16
|
+
done
|
|
17
|
+
|
|
18
|
+
if [ "$found" = false ]; then
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Inject GitNexus context — this stdout goes directly into Claude's context
|
|
23
|
+
cat << 'EOF'
|
|
24
|
+
## GitNexus Code Intelligence
|
|
25
|
+
|
|
26
|
+
This codebase is indexed by GitNexus, providing a knowledge graph with execution flows, relationships, and semantic search.
|
|
27
|
+
|
|
28
|
+
**Available MCP Tools:**
|
|
29
|
+
- `query` — Process-grouped code intelligence (execution flows related to a concept)
|
|
30
|
+
- `context` — 360-degree symbol view (categorized refs, process participation)
|
|
31
|
+
- `impact` — Blast radius analysis (what breaks if you change a symbol)
|
|
32
|
+
- `detect_changes` — Git-diff impact analysis (what do your changes affect)
|
|
33
|
+
- `rename` — Multi-file coordinated rename with confidence tags
|
|
34
|
+
- `cypher` — Raw graph queries
|
|
35
|
+
- `list_repos` — Discover indexed repos
|
|
36
|
+
|
|
37
|
+
**Quick Start:** READ `gitnexus://repo/{name}/context` for codebase overview, then use `query` to find execution flows.
|
|
38
|
+
|
|
39
|
+
**Resources:** `gitnexus://repo/{name}/context` (overview), `/processes` (execution flows), `/schema` (for Cypher)
|
|
40
|
+
EOF
|
|
41
|
+
|
|
42
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,96 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gitnexus",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
|
|
5
|
-
"author": "Abhigyan Patwari",
|
|
6
|
-
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
-
"homepage": "https://github.com/abhigyanpatwari/GitNexus#readme",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/abhigyanpatwari/GitNexus.git",
|
|
11
|
-
"directory": "gitnexus"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/abhigyanpatwari/GitNexus/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"mcp",
|
|
18
|
-
"model-context-protocol",
|
|
19
|
-
"code-intelligence",
|
|
20
|
-
"knowledge-graph",
|
|
21
|
-
"cursor",
|
|
22
|
-
"claude",
|
|
23
|
-
"ai-agent",
|
|
24
|
-
"gitnexus",
|
|
25
|
-
"static-analysis",
|
|
26
|
-
"codebase-indexing"
|
|
27
|
-
],
|
|
28
|
-
"type": "module",
|
|
29
|
-
"bin": {
|
|
30
|
-
"gitnexus": "dist/cli/index.js"
|
|
31
|
-
},
|
|
32
|
-
"files": [
|
|
33
|
-
"dist",
|
|
34
|
-
"hooks",
|
|
35
|
-
"scripts",
|
|
36
|
-
"skills",
|
|
37
|
-
"vendor"
|
|
38
|
-
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "tsc",
|
|
41
|
-
"dev": "tsx watch src/cli/index.ts",
|
|
42
|
-
"test": "vitest run test/unit",
|
|
43
|
-
"test:integration": "vitest run test/integration",
|
|
44
|
-
"test:all": "vitest run",
|
|
45
|
-
"test:watch": "vitest",
|
|
46
|
-
"test:coverage": "vitest run --coverage",
|
|
47
|
-
"prepare": "npm run build",
|
|
48
|
-
"postinstall": "node scripts/patch-tree-sitter-swift.cjs"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"graphology
|
|
60
|
-
"graphology-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"tree-sitter
|
|
68
|
-
"tree-sitter-
|
|
69
|
-
"tree-sitter-
|
|
70
|
-
"tree-sitter-
|
|
71
|
-
"tree-sitter-
|
|
72
|
-
"tree-sitter-
|
|
73
|
-
"tree-sitter-
|
|
74
|
-
"tree-sitter-
|
|
75
|
-
"tree-sitter-
|
|
76
|
-
"tree-sitter-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"@types/
|
|
87
|
-
"@types/
|
|
88
|
-
"@
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"vitest": "^4.0.18"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
}
|
|
96
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "gitnexus",
|
|
3
|
+
"version": "1.4.6",
|
|
4
|
+
"description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
|
|
5
|
+
"author": "Abhigyan Patwari",
|
|
6
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
+
"homepage": "https://github.com/abhigyanpatwari/GitNexus#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/abhigyanpatwari/GitNexus.git",
|
|
11
|
+
"directory": "gitnexus"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/abhigyanpatwari/GitNexus/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"code-intelligence",
|
|
20
|
+
"knowledge-graph",
|
|
21
|
+
"cursor",
|
|
22
|
+
"claude",
|
|
23
|
+
"ai-agent",
|
|
24
|
+
"gitnexus",
|
|
25
|
+
"static-analysis",
|
|
26
|
+
"codebase-indexing"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"bin": {
|
|
30
|
+
"gitnexus": "dist/cli/index.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"hooks",
|
|
35
|
+
"scripts",
|
|
36
|
+
"skills",
|
|
37
|
+
"vendor"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"dev": "tsx watch src/cli/index.ts",
|
|
42
|
+
"test": "vitest run test/unit",
|
|
43
|
+
"test:integration": "vitest run test/integration",
|
|
44
|
+
"test:all": "vitest run",
|
|
45
|
+
"test:watch": "vitest",
|
|
46
|
+
"test:coverage": "vitest run --coverage",
|
|
47
|
+
"prepare": "npm run build",
|
|
48
|
+
"postinstall": "node scripts/patch-tree-sitter-swift.cjs",
|
|
49
|
+
"prepack": "npm run build && chmod +x dist/cli/index.js"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@huggingface/transformers": "^3.0.0",
|
|
53
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
54
|
+
"cli-progress": "^3.12.0",
|
|
55
|
+
"commander": "^12.0.0",
|
|
56
|
+
"cors": "^2.8.5",
|
|
57
|
+
"express": "^4.19.2",
|
|
58
|
+
"glob": "^11.0.0",
|
|
59
|
+
"graphology": "^0.25.4",
|
|
60
|
+
"graphology-indices": "^0.17.0",
|
|
61
|
+
"graphology-utils": "^2.3.0",
|
|
62
|
+
"@ladybugdb/core": "^0.15.1",
|
|
63
|
+
"ignore": "^7.0.5",
|
|
64
|
+
"lru-cache": "^11.0.0",
|
|
65
|
+
"mnemonist": "^0.39.0",
|
|
66
|
+
"pandemonium": "^2.4.0",
|
|
67
|
+
"tree-sitter": "^0.21.0",
|
|
68
|
+
"tree-sitter-c": "^0.21.0",
|
|
69
|
+
"tree-sitter-c-sharp": "^0.21.0",
|
|
70
|
+
"tree-sitter-cpp": "^0.22.0",
|
|
71
|
+
"tree-sitter-go": "^0.21.0",
|
|
72
|
+
"tree-sitter-java": "^0.21.0",
|
|
73
|
+
"tree-sitter-javascript": "^0.21.0",
|
|
74
|
+
"tree-sitter-php": "^0.23.12",
|
|
75
|
+
"tree-sitter-python": "^0.21.0",
|
|
76
|
+
"tree-sitter-ruby": "^0.23.1",
|
|
77
|
+
"tree-sitter-rust": "^0.21.0",
|
|
78
|
+
"tree-sitter-typescript": "^0.21.0",
|
|
79
|
+
"uuid": "^13.0.0"
|
|
80
|
+
},
|
|
81
|
+
"optionalDependencies": {
|
|
82
|
+
"tree-sitter-kotlin": "^0.3.8",
|
|
83
|
+
"tree-sitter-swift": "^0.6.0"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@types/cli-progress": "^3.11.6",
|
|
87
|
+
"@types/cors": "^2.8.17",
|
|
88
|
+
"@types/express": "^4.17.21",
|
|
89
|
+
"@types/node": "^20.0.0",
|
|
90
|
+
"@types/uuid": "^10.0.0",
|
|
91
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
92
|
+
"tsx": "^4.0.0",
|
|
93
|
+
"typescript": "^5.4.5",
|
|
94
|
+
"vitest": "^4.0.18"
|
|
95
|
+
},
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=18.0.0"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* WORKAROUND: tree-sitter-swift@0.6.0 binding.gyp build failure
|
|
4
|
-
*
|
|
5
|
-
* Background:
|
|
6
|
-
* tree-sitter-swift@0.6.0's binding.gyp contains an "actions" array that
|
|
7
|
-
* invokes `tree-sitter generate` to regenerate parser.c from grammar.js.
|
|
8
|
-
* This is intended for grammar developers, but the published npm package
|
|
9
|
-
* already ships pre-generated parser files (parser.c, scanner.c), so the
|
|
10
|
-
* actions are unnecessary for consumers. Since consumers don't have
|
|
11
|
-
* tree-sitter-cli installed, the actions always fail during `npm install`.
|
|
12
|
-
*
|
|
13
|
-
* Why we can't just upgrade:
|
|
14
|
-
* tree-sitter-swift@0.7.1 fixes this (removes postinstall, ships prebuilds),
|
|
15
|
-
* but it requires tree-sitter@^0.22.1. The upstream project pins tree-sitter
|
|
16
|
-
* to ^0.21.0 and all other grammar packages depend on that version.
|
|
17
|
-
* Upgrading tree-sitter would be a separate breaking change.
|
|
18
|
-
*
|
|
19
|
-
* How this workaround works:
|
|
20
|
-
* 1. tree-sitter-swift's own postinstall fails (npm warns but continues)
|
|
21
|
-
* 2. This script runs as gitnexus's postinstall
|
|
22
|
-
* 3. It removes the "actions" array from binding.gyp
|
|
23
|
-
* 4. It rebuilds the native binding with the cleaned binding.gyp
|
|
24
|
-
*
|
|
25
|
-
* TODO: Remove this script when tree-sitter is upgraded to ^0.22.x,
|
|
26
|
-
* which allows using tree-sitter-swift@0.7.1+ directly.
|
|
27
|
-
*/
|
|
28
|
-
const fs = require('fs');
|
|
29
|
-
const path = require('path');
|
|
30
|
-
const { execSync } = require('child_process');
|
|
31
|
-
|
|
32
|
-
const swiftDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-swift');
|
|
33
|
-
const bindingPath = path.join(swiftDir, 'binding.gyp');
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
if (!fs.existsSync(bindingPath)) {
|
|
37
|
-
process.exit(0);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const content = fs.readFileSync(bindingPath, 'utf8');
|
|
41
|
-
let needsRebuild = false;
|
|
42
|
-
|
|
43
|
-
if (content.includes('"actions"')) {
|
|
44
|
-
// Strip Python-style comments (#) before JSON parsing
|
|
45
|
-
const cleaned = content.replace(/#[^\n]*/g, '');
|
|
46
|
-
const gyp = JSON.parse(cleaned);
|
|
47
|
-
|
|
48
|
-
if (gyp.targets && gyp.targets[0] && gyp.targets[0].actions) {
|
|
49
|
-
delete gyp.targets[0].actions;
|
|
50
|
-
fs.writeFileSync(bindingPath, JSON.stringify(gyp, null, 2) + '\n');
|
|
51
|
-
console.log('[tree-sitter-swift] Patched binding.gyp (removed actions array)');
|
|
52
|
-
needsRebuild = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Check if native binding exists
|
|
57
|
-
const bindingNode = path.join(swiftDir, 'build', 'Release', 'tree_sitter_swift_binding.node');
|
|
58
|
-
if (!fs.existsSync(bindingNode)) {
|
|
59
|
-
needsRebuild = true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (needsRebuild) {
|
|
63
|
-
console.log('[tree-sitter-swift] Rebuilding native binding...');
|
|
64
|
-
execSync('npx node-gyp rebuild', {
|
|
65
|
-
cwd: swiftDir,
|
|
66
|
-
stdio: 'pipe',
|
|
67
|
-
timeout: 120000,
|
|
68
|
-
});
|
|
69
|
-
console.log('[tree-sitter-swift] Native binding built successfully');
|
|
70
|
-
}
|
|
71
|
-
} catch (err) {
|
|
72
|
-
console.warn('[tree-sitter-swift] Could not build native binding:', err.message);
|
|
73
|
-
console.warn('[tree-sitter-swift] You may need to manually run: cd node_modules/tree-sitter-swift && npx node-gyp rebuild');
|
|
74
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* WORKAROUND: tree-sitter-swift@0.6.0 binding.gyp build failure
|
|
4
|
+
*
|
|
5
|
+
* Background:
|
|
6
|
+
* tree-sitter-swift@0.6.0's binding.gyp contains an "actions" array that
|
|
7
|
+
* invokes `tree-sitter generate` to regenerate parser.c from grammar.js.
|
|
8
|
+
* This is intended for grammar developers, but the published npm package
|
|
9
|
+
* already ships pre-generated parser files (parser.c, scanner.c), so the
|
|
10
|
+
* actions are unnecessary for consumers. Since consumers don't have
|
|
11
|
+
* tree-sitter-cli installed, the actions always fail during `npm install`.
|
|
12
|
+
*
|
|
13
|
+
* Why we can't just upgrade:
|
|
14
|
+
* tree-sitter-swift@0.7.1 fixes this (removes postinstall, ships prebuilds),
|
|
15
|
+
* but it requires tree-sitter@^0.22.1. The upstream project pins tree-sitter
|
|
16
|
+
* to ^0.21.0 and all other grammar packages depend on that version.
|
|
17
|
+
* Upgrading tree-sitter would be a separate breaking change.
|
|
18
|
+
*
|
|
19
|
+
* How this workaround works:
|
|
20
|
+
* 1. tree-sitter-swift's own postinstall fails (npm warns but continues)
|
|
21
|
+
* 2. This script runs as gitnexus's postinstall
|
|
22
|
+
* 3. It removes the "actions" array from binding.gyp
|
|
23
|
+
* 4. It rebuilds the native binding with the cleaned binding.gyp
|
|
24
|
+
*
|
|
25
|
+
* TODO: Remove this script when tree-sitter is upgraded to ^0.22.x,
|
|
26
|
+
* which allows using tree-sitter-swift@0.7.1+ directly.
|
|
27
|
+
*/
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const path = require('path');
|
|
30
|
+
const { execSync } = require('child_process');
|
|
31
|
+
|
|
32
|
+
const swiftDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-swift');
|
|
33
|
+
const bindingPath = path.join(swiftDir, 'binding.gyp');
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
if (!fs.existsSync(bindingPath)) {
|
|
37
|
+
process.exit(0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const content = fs.readFileSync(bindingPath, 'utf8');
|
|
41
|
+
let needsRebuild = false;
|
|
42
|
+
|
|
43
|
+
if (content.includes('"actions"')) {
|
|
44
|
+
// Strip Python-style comments (#) before JSON parsing
|
|
45
|
+
const cleaned = content.replace(/#[^\n]*/g, '');
|
|
46
|
+
const gyp = JSON.parse(cleaned);
|
|
47
|
+
|
|
48
|
+
if (gyp.targets && gyp.targets[0] && gyp.targets[0].actions) {
|
|
49
|
+
delete gyp.targets[0].actions;
|
|
50
|
+
fs.writeFileSync(bindingPath, JSON.stringify(gyp, null, 2) + '\n');
|
|
51
|
+
console.log('[tree-sitter-swift] Patched binding.gyp (removed actions array)');
|
|
52
|
+
needsRebuild = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Check if native binding exists
|
|
57
|
+
const bindingNode = path.join(swiftDir, 'build', 'Release', 'tree_sitter_swift_binding.node');
|
|
58
|
+
if (!fs.existsSync(bindingNode)) {
|
|
59
|
+
needsRebuild = true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (needsRebuild) {
|
|
63
|
+
console.log('[tree-sitter-swift] Rebuilding native binding...');
|
|
64
|
+
execSync('npx node-gyp rebuild', {
|
|
65
|
+
cwd: swiftDir,
|
|
66
|
+
stdio: 'pipe',
|
|
67
|
+
timeout: 120000,
|
|
68
|
+
});
|
|
69
|
+
console.log('[tree-sitter-swift] Native binding built successfully');
|
|
70
|
+
}
|
|
71
|
+
} catch (err) {
|
|
72
|
+
console.warn('[tree-sitter-swift] Could not build native binding:', err.message);
|
|
73
|
+
console.warn('[tree-sitter-swift] You may need to manually run: cd node_modules/tree-sitter-swift && npx node-gyp rebuild');
|
|
74
|
+
}
|
package/skills/gitnexus-cli.md
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gitnexus-cli
|
|
3
|
-
description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# GitNexus CLI Commands
|
|
7
|
-
|
|
8
|
-
All commands work via `npx` — no global install required.
|
|
9
|
-
|
|
10
|
-
## Commands
|
|
11
|
-
|
|
12
|
-
### analyze — Build or refresh the index
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx gitnexus analyze
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files.
|
|
19
|
-
|
|
20
|
-
| Flag | Effect |
|
|
21
|
-
| -------------- | ---------------------------------------------------------------- |
|
|
22
|
-
| `--force` | Force full re-index even if up to date |
|
|
23
|
-
| `--embeddings` | Enable embedding generation for semantic search (off by default) |
|
|
24
|
-
|
|
25
|
-
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale.
|
|
26
|
-
|
|
27
|
-
### status — Check index freshness
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx gitnexus status
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
|
|
34
|
-
|
|
35
|
-
### clean — Delete the index
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx gitnexus clean
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
|
|
42
|
-
|
|
43
|
-
| Flag | Effect |
|
|
44
|
-
| --------- | ------------------------------------------------- |
|
|
45
|
-
| `--force` | Skip confirmation prompt |
|
|
46
|
-
| `--all` | Clean all indexed repos, not just the current one |
|
|
47
|
-
|
|
48
|
-
### wiki — Generate documentation from the graph
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
npx gitnexus wiki
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
|
|
55
|
-
|
|
56
|
-
| Flag | Effect |
|
|
57
|
-
| ------------------- | ----------------------------------------- |
|
|
58
|
-
| `--force` | Force full regeneration |
|
|
59
|
-
| `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
|
|
60
|
-
| `--base-url <url>` | LLM API base URL |
|
|
61
|
-
| `--api-key <key>` | LLM API key |
|
|
62
|
-
| `--concurrency <n>` | Parallel LLM calls (default: 3) |
|
|
63
|
-
| `--gist` | Publish wiki as a public GitHub Gist |
|
|
64
|
-
|
|
65
|
-
### list — Show all indexed repos
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npx gitnexus list
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
|
|
72
|
-
|
|
73
|
-
## After Indexing
|
|
74
|
-
|
|
75
|
-
1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
|
|
76
|
-
2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
|
|
77
|
-
|
|
78
|
-
## Troubleshooting
|
|
79
|
-
|
|
80
|
-
- **"Not inside a git repository"**: Run from a directory inside a git repo
|
|
81
|
-
- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
|
|
82
|
-
- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-cli
|
|
3
|
+
description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitNexus CLI Commands
|
|
7
|
+
|
|
8
|
+
All commands work via `npx` — no global install required.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
### analyze — Build or refresh the index
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx gitnexus analyze
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files.
|
|
19
|
+
|
|
20
|
+
| Flag | Effect |
|
|
21
|
+
| -------------- | ---------------------------------------------------------------- |
|
|
22
|
+
| `--force` | Force full re-index even if up to date |
|
|
23
|
+
| `--embeddings` | Enable embedding generation for semantic search (off by default) |
|
|
24
|
+
|
|
25
|
+
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook runs `analyze` automatically after `git commit` and `git merge`, preserving embeddings if previously generated.
|
|
26
|
+
|
|
27
|
+
### status — Check index freshness
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx gitnexus status
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
|
|
34
|
+
|
|
35
|
+
### clean — Delete the index
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx gitnexus clean
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
|
|
42
|
+
|
|
43
|
+
| Flag | Effect |
|
|
44
|
+
| --------- | ------------------------------------------------- |
|
|
45
|
+
| `--force` | Skip confirmation prompt |
|
|
46
|
+
| `--all` | Clean all indexed repos, not just the current one |
|
|
47
|
+
|
|
48
|
+
### wiki — Generate documentation from the graph
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx gitnexus wiki
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
|
|
55
|
+
|
|
56
|
+
| Flag | Effect |
|
|
57
|
+
| ------------------- | ----------------------------------------- |
|
|
58
|
+
| `--force` | Force full regeneration |
|
|
59
|
+
| `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
|
|
60
|
+
| `--base-url <url>` | LLM API base URL |
|
|
61
|
+
| `--api-key <key>` | LLM API key |
|
|
62
|
+
| `--concurrency <n>` | Parallel LLM calls (default: 3) |
|
|
63
|
+
| `--gist` | Publish wiki as a public GitHub Gist |
|
|
64
|
+
|
|
65
|
+
### list — Show all indexed repos
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx gitnexus list
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
|
|
72
|
+
|
|
73
|
+
## After Indexing
|
|
74
|
+
|
|
75
|
+
1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
|
|
76
|
+
2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
|
|
77
|
+
|
|
78
|
+
## Troubleshooting
|
|
79
|
+
|
|
80
|
+
- **"Not inside a git repository"**: Run from a directory inside a git repo
|
|
81
|
+
- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
|
|
82
|
+
- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
|