@duytransipher/gitnexus 1.4.6-sipher.0
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/LICENSE +73 -0
- package/README.md +261 -0
- package/dist/cli/ai-context.d.ts +23 -0
- package/dist/cli/ai-context.js +265 -0
- package/dist/cli/analyze.d.ts +12 -0
- package/dist/cli/analyze.js +345 -0
- package/dist/cli/augment.d.ts +13 -0
- package/dist/cli/augment.js +33 -0
- package/dist/cli/clean.d.ts +10 -0
- package/dist/cli/clean.js +60 -0
- package/dist/cli/eval-server.d.ts +37 -0
- package/dist/cli/eval-server.js +389 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +137 -0
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +30 -0
- package/dist/cli/mcp.d.ts +8 -0
- package/dist/cli/mcp.js +36 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +6 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +367 -0
- package/dist/cli/sipher-patched.d.ts +2 -0
- package/dist/cli/sipher-patched.js +77 -0
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +549 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.js +36 -0
- package/dist/cli/tool.d.ts +60 -0
- package/dist/cli/tool.js +180 -0
- package/dist/cli/wiki.d.ts +15 -0
- package/dist/cli/wiki.js +365 -0
- package/dist/config/ignore-service.d.ts +26 -0
- package/dist/config/ignore-service.js +284 -0
- package/dist/config/supported-languages.d.ts +15 -0
- package/dist/config/supported-languages.js +16 -0
- package/dist/core/augmentation/engine.d.ts +26 -0
- package/dist/core/augmentation/engine.js +240 -0
- package/dist/core/embeddings/embedder.d.ts +60 -0
- package/dist/core/embeddings/embedder.js +251 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +51 -0
- package/dist/core/embeddings/embedding-pipeline.js +356 -0
- package/dist/core/embeddings/index.d.ts +9 -0
- package/dist/core/embeddings/index.js +9 -0
- package/dist/core/embeddings/text-generator.d.ts +24 -0
- package/dist/core/embeddings/text-generator.js +182 -0
- package/dist/core/embeddings/types.d.ts +87 -0
- package/dist/core/embeddings/types.js +32 -0
- package/dist/core/graph/graph.d.ts +2 -0
- package/dist/core/graph/graph.js +66 -0
- package/dist/core/graph/types.d.ts +66 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/ingestion/ast-cache.d.ts +11 -0
- package/dist/core/ingestion/ast-cache.js +35 -0
- package/dist/core/ingestion/call-processor.d.ts +23 -0
- package/dist/core/ingestion/call-processor.js +793 -0
- package/dist/core/ingestion/call-routing.d.ts +68 -0
- package/dist/core/ingestion/call-routing.js +129 -0
- package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
- package/dist/core/ingestion/cluster-enricher.js +170 -0
- package/dist/core/ingestion/community-processor.d.ts +39 -0
- package/dist/core/ingestion/community-processor.js +312 -0
- 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 +40 -0
- package/dist/core/ingestion/entry-point-scoring.js +353 -0
- 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.d.ts +28 -0
- package/dist/core/ingestion/filesystem-walker.js +81 -0
- package/dist/core/ingestion/framework-detection.d.ts +54 -0
- package/dist/core/ingestion/framework-detection.js +411 -0
- package/dist/core/ingestion/heritage-processor.d.ts +28 -0
- package/dist/core/ingestion/heritage-processor.js +251 -0
- package/dist/core/ingestion/import-processor.d.ts +34 -0
- package/dist/core/ingestion/import-processor.js +398 -0
- 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 +19 -0
- package/dist/core/ingestion/parsing-processor.js +315 -0
- package/dist/core/ingestion/pipeline.d.ts +6 -0
- package/dist/core/ingestion/pipeline.js +401 -0
- package/dist/core/ingestion/process-processor.d.ts +51 -0
- package/dist/core/ingestion/process-processor.js +315 -0
- 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/structure-processor.d.ts +2 -0
- package/dist/core/ingestion/structure-processor.js +36 -0
- package/dist/core/ingestion/symbol-table.d.ts +63 -0
- package/dist/core/ingestion/symbol-table.js +85 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +15 -0
- package/dist/core/ingestion/tree-sitter-queries.js +888 -0
- package/dist/core/ingestion/type-env.d.ts +49 -0
- package/dist/core/ingestion/type-env.js +613 -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 +455 -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 +456 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +145 -0
- package/dist/core/ingestion/type-extractors/shared.js +810 -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 +138 -0
- package/dist/core/ingestion/utils.js +1290 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +122 -0
- package/dist/core/ingestion/workers/parse-worker.js +1126 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +16 -0
- package/dist/core/ingestion/workers/worker-pool.js +128 -0
- package/dist/core/lbug/csv-generator.d.ts +33 -0
- package/dist/core/lbug/csv-generator.js +366 -0
- package/dist/core/lbug/lbug-adapter.d.ts +103 -0
- package/dist/core/lbug/lbug-adapter.js +769 -0
- package/dist/core/lbug/schema.d.ts +53 -0
- package/dist/core/lbug/schema.js +430 -0
- package/dist/core/search/bm25-index.d.ts +23 -0
- package/dist/core/search/bm25-index.js +96 -0
- package/dist/core/search/hybrid-search.d.ts +49 -0
- package/dist/core/search/hybrid-search.js +118 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +5 -0
- package/dist/core/tree-sitter/parser-loader.js +63 -0
- package/dist/core/wiki/generator.d.ts +120 -0
- package/dist/core/wiki/generator.js +939 -0
- package/dist/core/wiki/graph-queries.d.ts +80 -0
- package/dist/core/wiki/graph-queries.js +238 -0
- package/dist/core/wiki/html-viewer.d.ts +10 -0
- package/dist/core/wiki/html-viewer.js +297 -0
- package/dist/core/wiki/llm-client.d.ts +43 -0
- package/dist/core/wiki/llm-client.js +186 -0
- package/dist/core/wiki/prompts.d.ts +53 -0
- package/dist/core/wiki/prompts.js +174 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +200 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +108 -0
- package/dist/mcp/core/lbug-adapter.d.ts +57 -0
- package/dist/mcp/core/lbug-adapter.js +455 -0
- package/dist/mcp/local/local-backend.d.ts +181 -0
- package/dist/mcp/local/local-backend.js +1722 -0
- package/dist/mcp/resources.d.ts +31 -0
- package/dist/mcp/resources.js +411 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +296 -0
- package/dist/mcp/staleness.d.ts +15 -0
- package/dist/mcp/staleness.js +29 -0
- package/dist/mcp/tools.d.ts +24 -0
- package/dist/mcp/tools.js +292 -0
- package/dist/server/api.d.ts +10 -0
- package/dist/server/api.js +344 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +100 -0
- package/dist/storage/git.d.ts +6 -0
- package/dist/storage/git.js +35 -0
- package/dist/storage/repo-manager.d.ts +138 -0
- package/dist/storage/repo-manager.js +299 -0
- package/dist/types/pipeline.d.ts +32 -0
- package/dist/types/pipeline.js +18 -0
- package/dist/unreal/bridge.d.ts +4 -0
- package/dist/unreal/bridge.js +113 -0
- package/dist/unreal/config.d.ts +6 -0
- package/dist/unreal/config.js +55 -0
- package/dist/unreal/types.d.ts +105 -0
- package/dist/unreal/types.js +1 -0
- package/hooks/claude/gitnexus-hook.cjs +238 -0
- package/hooks/claude/pre-tool-use.sh +79 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +100 -0
- package/scripts/ensure-cli-executable.cjs +21 -0
- package/scripts/patch-tree-sitter-swift.cjs +74 -0
- package/scripts/setup-unreal-gitnexus.ps1 +191 -0
- package/skills/gitnexus-cli.md +82 -0
- package/skills/gitnexus-debugging.md +89 -0
- package/skills/gitnexus-exploring.md +78 -0
- package/skills/gitnexus-guide.md +64 -0
- package/skills/gitnexus-impact-analysis.md +97 -0
- package/skills/gitnexus-pr-review.md +163 -0
- package/skills/gitnexus-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local Backend (Multi-Repo)
|
|
3
|
+
*
|
|
4
|
+
* Provides tool implementations using local .gitnexus/ indexes.
|
|
5
|
+
* Supports multiple indexed repositories via a global registry.
|
|
6
|
+
* LadybugDB connections are opened lazily per repo on first query.
|
|
7
|
+
*/
|
|
8
|
+
import { type RegistryEntry } from '../../storage/repo-manager.js';
|
|
9
|
+
/**
|
|
10
|
+
* Quick test-file detection for filtering impact results.
|
|
11
|
+
* Matches common test file patterns across all supported languages.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isTestFilePath(filePath: string): boolean;
|
|
14
|
+
/** Valid LadybugDB node labels for safe Cypher query construction */
|
|
15
|
+
export declare const VALID_NODE_LABELS: Set<string>;
|
|
16
|
+
/** Valid relation types for impact analysis filtering */
|
|
17
|
+
export declare const VALID_RELATION_TYPES: Set<string>;
|
|
18
|
+
/** Regex to detect write operations in user-supplied Cypher queries */
|
|
19
|
+
export declare const CYPHER_WRITE_RE: RegExp;
|
|
20
|
+
/** Check if a Cypher query contains write operations */
|
|
21
|
+
export declare function isWriteQuery(query: string): boolean;
|
|
22
|
+
export interface CodebaseContext {
|
|
23
|
+
projectName: string;
|
|
24
|
+
stats: {
|
|
25
|
+
fileCount: number;
|
|
26
|
+
functionCount: number;
|
|
27
|
+
communityCount: number;
|
|
28
|
+
processCount: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface RepoHandle {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
repoPath: string;
|
|
35
|
+
storagePath: string;
|
|
36
|
+
lbugPath: string;
|
|
37
|
+
indexedAt: string;
|
|
38
|
+
lastCommit: string;
|
|
39
|
+
stats?: RegistryEntry['stats'];
|
|
40
|
+
}
|
|
41
|
+
export declare class LocalBackend {
|
|
42
|
+
private repos;
|
|
43
|
+
private contextCache;
|
|
44
|
+
private initializedRepos;
|
|
45
|
+
/**
|
|
46
|
+
* Initialize from the global registry.
|
|
47
|
+
* Returns true if at least one repo is available.
|
|
48
|
+
*/
|
|
49
|
+
init(): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* Re-read the global registry and update the in-memory repo map.
|
|
52
|
+
* New repos are added, existing repos are updated, removed repos are pruned.
|
|
53
|
+
* LadybugDB connections for removed repos are NOT closed (they idle-timeout naturally).
|
|
54
|
+
*/
|
|
55
|
+
private refreshRepos;
|
|
56
|
+
/**
|
|
57
|
+
* Generate a stable repo ID from name + path.
|
|
58
|
+
* If names collide, append a hash of the path.
|
|
59
|
+
*/
|
|
60
|
+
private repoId;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve which repo to use.
|
|
63
|
+
* - If repoParam is given, match by name or path
|
|
64
|
+
* - If only 1 repo, use it
|
|
65
|
+
* - If 0 or multiple without param, throw with helpful message
|
|
66
|
+
*
|
|
67
|
+
* On a miss, re-reads the registry once in case a new repo was indexed
|
|
68
|
+
* while the MCP server was running.
|
|
69
|
+
*/
|
|
70
|
+
resolveRepo(repoParam?: string): Promise<RepoHandle>;
|
|
71
|
+
/**
|
|
72
|
+
* Try to resolve a repo from the in-memory cache. Returns null on miss.
|
|
73
|
+
*/
|
|
74
|
+
private resolveRepoFromCache;
|
|
75
|
+
private ensureInitialized;
|
|
76
|
+
/**
|
|
77
|
+
* Get context for a specific repo (or the single repo if only one).
|
|
78
|
+
*/
|
|
79
|
+
getContext(repoId?: string): CodebaseContext | null;
|
|
80
|
+
/**
|
|
81
|
+
* List all registered repos with their metadata.
|
|
82
|
+
* Re-reads the global registry so newly indexed repos are discovered
|
|
83
|
+
* without restarting the MCP server.
|
|
84
|
+
*/
|
|
85
|
+
listRepos(): Promise<Array<{
|
|
86
|
+
name: string;
|
|
87
|
+
path: string;
|
|
88
|
+
indexedAt: string;
|
|
89
|
+
lastCommit: string;
|
|
90
|
+
stats?: any;
|
|
91
|
+
}>>;
|
|
92
|
+
callTool(method: string, params: any): Promise<any>;
|
|
93
|
+
private resolveNativeFunctionTarget;
|
|
94
|
+
private shortlistBlueprintCandidates;
|
|
95
|
+
private ensureUnrealReady;
|
|
96
|
+
private syncUnrealAssetManifestTool;
|
|
97
|
+
private findNativeBlueprintReferencesTool;
|
|
98
|
+
private expandBlueprintChainTool;
|
|
99
|
+
private findBlueprintsDerivedFromNativeClassTool;
|
|
100
|
+
/**
|
|
101
|
+
* Query tool — process-grouped search.
|
|
102
|
+
*
|
|
103
|
+
* 1. Hybrid search (BM25 + semantic) to find matching symbols
|
|
104
|
+
* 2. Trace each match to its process(es) via STEP_IN_PROCESS
|
|
105
|
+
* 3. Group by process, rank by aggregate relevance + internal cluster cohesion
|
|
106
|
+
* 4. Return: { processes, process_symbols, definitions }
|
|
107
|
+
*/
|
|
108
|
+
private query;
|
|
109
|
+
/**
|
|
110
|
+
* BM25 keyword search helper - uses LadybugDB FTS for always-fresh results
|
|
111
|
+
*/
|
|
112
|
+
private bm25Search;
|
|
113
|
+
/**
|
|
114
|
+
* Semantic vector search helper
|
|
115
|
+
*/
|
|
116
|
+
private semanticSearch;
|
|
117
|
+
executeCypher(repoName: string, query: string): Promise<any>;
|
|
118
|
+
private cypher;
|
|
119
|
+
/**
|
|
120
|
+
* Format raw Cypher result rows as a markdown table for LLM readability.
|
|
121
|
+
* Falls back to raw result if rows aren't tabular objects.
|
|
122
|
+
*/
|
|
123
|
+
private formatCypherAsMarkdown;
|
|
124
|
+
/**
|
|
125
|
+
* Aggregate same-named clusters: group by heuristicLabel, sum symbols,
|
|
126
|
+
* weighted-average cohesion, filter out tiny clusters (<5 symbols).
|
|
127
|
+
* Raw communities stay intact in LadybugDB for Cypher queries.
|
|
128
|
+
*/
|
|
129
|
+
private aggregateClusters;
|
|
130
|
+
private overview;
|
|
131
|
+
/**
|
|
132
|
+
* Context tool — 360-degree symbol view with categorized refs.
|
|
133
|
+
* Disambiguation when multiple symbols share a name.
|
|
134
|
+
* UID-based direct lookup. No cluster in output.
|
|
135
|
+
*/
|
|
136
|
+
private context;
|
|
137
|
+
/**
|
|
138
|
+
* Legacy explore — kept for backwards compatibility with resources.ts.
|
|
139
|
+
* Routes cluster/process types to direct graph queries.
|
|
140
|
+
*/
|
|
141
|
+
private explore;
|
|
142
|
+
/**
|
|
143
|
+
* Detect changes — git-diff based impact analysis.
|
|
144
|
+
* Maps changed lines to indexed symbols, then finds affected processes.
|
|
145
|
+
*/
|
|
146
|
+
private detectChanges;
|
|
147
|
+
/**
|
|
148
|
+
* Rename tool — multi-file coordinated rename using graph + text search.
|
|
149
|
+
* Graph refs are tagged "graph" (high confidence).
|
|
150
|
+
* Additional refs found via text search are tagged "text_search" (lower confidence).
|
|
151
|
+
*/
|
|
152
|
+
private rename;
|
|
153
|
+
private impact;
|
|
154
|
+
private _impactImpl;
|
|
155
|
+
/**
|
|
156
|
+
* Query clusters (communities) directly from graph.
|
|
157
|
+
* Used by getClustersResource — avoids legacy overview() dispatch.
|
|
158
|
+
*/
|
|
159
|
+
queryClusters(repoName?: string, limit?: number): Promise<{
|
|
160
|
+
clusters: any[];
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Query processes directly from graph.
|
|
164
|
+
* Used by getProcessesResource — avoids legacy overview() dispatch.
|
|
165
|
+
*/
|
|
166
|
+
queryProcesses(repoName?: string, limit?: number): Promise<{
|
|
167
|
+
processes: any[];
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Query cluster detail (members) directly from graph.
|
|
171
|
+
* Used by getClusterDetailResource.
|
|
172
|
+
*/
|
|
173
|
+
queryClusterDetail(name: string, repoName?: string): Promise<any>;
|
|
174
|
+
/**
|
|
175
|
+
* Query process detail (steps) directly from graph.
|
|
176
|
+
* Used by getProcessDetailResource.
|
|
177
|
+
*/
|
|
178
|
+
queryProcessDetail(name: string, repoName?: string): Promise<any>;
|
|
179
|
+
disconnect(): Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
export {};
|