gitnexus 1.5.0 → 1.5.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/dist/_shared/graph/types.d.ts +65 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +7 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +6 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +137 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +25 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +26 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +64 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/package.json +4 -4
- package/scripts/build.js +69 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph type definitions — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both gitnexus (CLI) and gitnexus-web import from this package.
|
|
5
|
+
* Do NOT add Node.js-specific or browser-specific imports here.
|
|
6
|
+
*/
|
|
7
|
+
import { SupportedLanguages } from '../languages.js';
|
|
8
|
+
export type NodeLabel = 'Project' | 'Package' | 'Module' | 'Folder' | 'File' | 'Class' | 'Function' | 'Method' | 'Variable' | 'Interface' | 'Enum' | 'Decorator' | 'Import' | 'Type' | 'CodeElement' | 'Community' | 'Process' | 'Struct' | 'Macro' | 'Typedef' | 'Union' | 'Namespace' | 'Trait' | 'Impl' | 'TypeAlias' | 'Const' | 'Static' | 'Property' | 'Record' | 'Delegate' | 'Annotation' | 'Constructor' | 'Template' | 'Section' | 'Route' | 'Tool';
|
|
9
|
+
export type NodeProperties = {
|
|
10
|
+
name: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
startLine?: number;
|
|
13
|
+
endLine?: number;
|
|
14
|
+
language?: SupportedLanguages | string;
|
|
15
|
+
isExported?: boolean;
|
|
16
|
+
astFrameworkMultiplier?: number;
|
|
17
|
+
astFrameworkReason?: string;
|
|
18
|
+
heuristicLabel?: string;
|
|
19
|
+
cohesion?: number;
|
|
20
|
+
symbolCount?: number;
|
|
21
|
+
keywords?: string[];
|
|
22
|
+
description?: string;
|
|
23
|
+
enrichedBy?: 'heuristic' | 'llm';
|
|
24
|
+
processType?: 'intra_community' | 'cross_community';
|
|
25
|
+
stepCount?: number;
|
|
26
|
+
communities?: string[];
|
|
27
|
+
entryPointId?: string;
|
|
28
|
+
terminalId?: string;
|
|
29
|
+
entryPointScore?: number;
|
|
30
|
+
entryPointReason?: string;
|
|
31
|
+
parameterCount?: number;
|
|
32
|
+
level?: number;
|
|
33
|
+
returnType?: string;
|
|
34
|
+
declaredType?: string;
|
|
35
|
+
visibility?: string;
|
|
36
|
+
isStatic?: boolean;
|
|
37
|
+
isReadonly?: boolean;
|
|
38
|
+
isAbstract?: boolean;
|
|
39
|
+
isFinal?: boolean;
|
|
40
|
+
isVirtual?: boolean;
|
|
41
|
+
isOverride?: boolean;
|
|
42
|
+
isAsync?: boolean;
|
|
43
|
+
isPartial?: boolean;
|
|
44
|
+
annotations?: string[];
|
|
45
|
+
responseKeys?: string[];
|
|
46
|
+
errorKeys?: string[];
|
|
47
|
+
middleware?: string[];
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
};
|
|
50
|
+
export type RelationshipType = 'CONTAINS' | 'CALLS' | 'INHERITS' | 'OVERRIDES' | 'IMPORTS' | 'USES' | 'DEFINES' | 'DECORATES' | 'IMPLEMENTS' | 'EXTENDS' | 'HAS_METHOD' | 'HAS_PROPERTY' | 'ACCESSES' | 'MEMBER_OF' | 'STEP_IN_PROCESS' | 'HANDLES_ROUTE' | 'FETCHES' | 'HANDLES_TOOL' | 'ENTRY_POINT_OF' | 'WRAPS' | 'QUERIES';
|
|
51
|
+
export interface GraphNode {
|
|
52
|
+
id: string;
|
|
53
|
+
label: NodeLabel;
|
|
54
|
+
properties: NodeProperties;
|
|
55
|
+
}
|
|
56
|
+
export interface GraphRelationship {
|
|
57
|
+
id: string;
|
|
58
|
+
sourceId: string;
|
|
59
|
+
targetId: string;
|
|
60
|
+
type: RelationshipType;
|
|
61
|
+
confidence: number;
|
|
62
|
+
reason: string;
|
|
63
|
+
step?: number;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GACN,WAAW,GACX,QAAQ,GACR,MAAM,GACN,aAAa,GACb,WAAW,GACX,SAAS,GAET,QAAQ,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,WAAW,GACX,OAAO,GACP,MAAM,GACN,WAAW,GACX,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,aAAa,GACb,UAAU,GACV,SAAS,GACT,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAA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,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,WAAW,GACX,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,cAAc,GACd,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { NodeLabel, NodeProperties, RelationshipType, GraphNode, GraphRelationship, } from './graph/types.js';
|
|
2
|
+
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME, } from './lbug/schema-constants.js';
|
|
3
|
+
export type { NodeTableName, RelType } from './lbug/schema-constants.js';
|
|
4
|
+
export { SupportedLanguages } from './languages.js';
|
|
5
|
+
export { getLanguageFromFilename, getSyntaxLanguageFromFilename } from './language-detection.js';
|
|
6
|
+
export type { PipelinePhase, PipelineProgress } from './pipeline.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGjG,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Schema constants
|
|
2
|
+
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME, } from './lbug/schema-constants.js';
|
|
3
|
+
// Language support
|
|
4
|
+
export { SupportedLanguages } from './languages.js';
|
|
5
|
+
export { getLanguageFromFilename, getSyntaxLanguageFromFilename } from './language-detection.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Detection — maps file paths to SupportedLanguages enum values.
|
|
3
|
+
*
|
|
4
|
+
* Shared between CLI (ingestion pipeline) and web (syntax highlighting).
|
|
5
|
+
*
|
|
6
|
+
* ADDING A NEW LANGUAGE:
|
|
7
|
+
* 1. Add enum member to SupportedLanguages in languages.ts
|
|
8
|
+
* 2. Add file extensions to EXTENSION_MAP below
|
|
9
|
+
* 3. TypeScript will error if you miss either step (exhaustive Record)
|
|
10
|
+
*/
|
|
11
|
+
import { SupportedLanguages } from './languages.js';
|
|
12
|
+
/**
|
|
13
|
+
* Map file extension to SupportedLanguage enum.
|
|
14
|
+
* Returns null if the file extension is not recognized.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getLanguageFromFilename: (filename: string) => SupportedLanguages | null;
|
|
17
|
+
/**
|
|
18
|
+
* Map file path to a Prism-compatible syntax highlight language string.
|
|
19
|
+
* Covers all SupportedLanguages (code files) plus common non-code formats.
|
|
20
|
+
* Returns 'text' for unrecognised files.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getSyntaxLanguageFromFilename: (filePath: string) => string;
|
|
23
|
+
//# sourceMappingURL=language-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-detection.d.ts","sourceRoot":"","sources":["../src/language-detection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AA8CpD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,KAAG,kBAAkB,GAAG,IAgB/E,CAAC;AAuDF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,MAAM,KAAG,MAQhE,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Detection — maps file paths to SupportedLanguages enum values.
|
|
3
|
+
*
|
|
4
|
+
* Shared between CLI (ingestion pipeline) and web (syntax highlighting).
|
|
5
|
+
*
|
|
6
|
+
* ADDING A NEW LANGUAGE:
|
|
7
|
+
* 1. Add enum member to SupportedLanguages in languages.ts
|
|
8
|
+
* 2. Add file extensions to EXTENSION_MAP below
|
|
9
|
+
* 3. TypeScript will error if you miss either step (exhaustive Record)
|
|
10
|
+
*/
|
|
11
|
+
import { SupportedLanguages } from './languages.js';
|
|
12
|
+
/** Ruby extensionless filenames recognised as Ruby source */
|
|
13
|
+
const RUBY_EXTENSIONLESS_FILES = new Set([
|
|
14
|
+
'Rakefile',
|
|
15
|
+
'Gemfile',
|
|
16
|
+
'Guardfile',
|
|
17
|
+
'Vagrantfile',
|
|
18
|
+
'Brewfile',
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Exhaustive map: every SupportedLanguages member → its file extensions.
|
|
22
|
+
*
|
|
23
|
+
* If a new language is added to the enum without adding an entry here,
|
|
24
|
+
* TypeScript emits a compile error: "Property 'NewLang' is missing in type..."
|
|
25
|
+
*/
|
|
26
|
+
const EXTENSION_MAP = {
|
|
27
|
+
[SupportedLanguages.JavaScript]: ['.js', '.jsx', '.mjs', '.cjs'],
|
|
28
|
+
[SupportedLanguages.TypeScript]: ['.ts', '.tsx', '.mts', '.cts'],
|
|
29
|
+
[SupportedLanguages.Python]: ['.py'],
|
|
30
|
+
[SupportedLanguages.Java]: ['.java'],
|
|
31
|
+
[SupportedLanguages.C]: ['.c'],
|
|
32
|
+
[SupportedLanguages.CPlusPlus]: ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx', '.hh'],
|
|
33
|
+
[SupportedLanguages.CSharp]: ['.cs'],
|
|
34
|
+
[SupportedLanguages.Go]: ['.go'],
|
|
35
|
+
[SupportedLanguages.Ruby]: ['.rb', '.rake', '.gemspec'],
|
|
36
|
+
[SupportedLanguages.Rust]: ['.rs'],
|
|
37
|
+
[SupportedLanguages.PHP]: ['.php', '.phtml', '.php3', '.php4', '.php5', '.php8'],
|
|
38
|
+
[SupportedLanguages.Kotlin]: ['.kt', '.kts'],
|
|
39
|
+
[SupportedLanguages.Swift]: ['.swift'],
|
|
40
|
+
[SupportedLanguages.Dart]: ['.dart'],
|
|
41
|
+
[SupportedLanguages.Cobol]: ['.cbl', '.cob', '.cpy', '.cobol'],
|
|
42
|
+
}; // Ensure exhaustiveness
|
|
43
|
+
/** Pre-built reverse lookup: extension → language (built once at module load). */
|
|
44
|
+
const extToLang = new Map();
|
|
45
|
+
for (const [lang, exts] of Object.entries(EXTENSION_MAP)) {
|
|
46
|
+
for (const ext of exts) {
|
|
47
|
+
extToLang.set(ext, lang);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Map file extension to SupportedLanguage enum.
|
|
52
|
+
* Returns null if the file extension is not recognized.
|
|
53
|
+
*/
|
|
54
|
+
export const getLanguageFromFilename = (filename) => {
|
|
55
|
+
// Fast path: check the extension map
|
|
56
|
+
const lastDot = filename.lastIndexOf('.');
|
|
57
|
+
if (lastDot >= 0) {
|
|
58
|
+
const ext = filename.slice(lastDot).toLowerCase();
|
|
59
|
+
const lang = extToLang.get(ext);
|
|
60
|
+
if (lang !== undefined)
|
|
61
|
+
return lang;
|
|
62
|
+
}
|
|
63
|
+
// Ruby extensionless files (Rakefile, Gemfile, etc.)
|
|
64
|
+
const basename = filename.split('/').pop() || filename;
|
|
65
|
+
if (RUBY_EXTENSIONLESS_FILES.has(basename)) {
|
|
66
|
+
return SupportedLanguages.Ruby;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Exhaustive map: every SupportedLanguages member → Prism syntax identifier.
|
|
72
|
+
*
|
|
73
|
+
* If a new language is added to the enum without adding an entry here,
|
|
74
|
+
* TypeScript emits a compile error.
|
|
75
|
+
*/
|
|
76
|
+
const SYNTAX_MAP = {
|
|
77
|
+
[SupportedLanguages.JavaScript]: 'javascript',
|
|
78
|
+
[SupportedLanguages.TypeScript]: 'typescript',
|
|
79
|
+
[SupportedLanguages.Python]: 'python',
|
|
80
|
+
[SupportedLanguages.Java]: 'java',
|
|
81
|
+
[SupportedLanguages.C]: 'c',
|
|
82
|
+
[SupportedLanguages.CPlusPlus]: 'cpp',
|
|
83
|
+
[SupportedLanguages.CSharp]: 'csharp',
|
|
84
|
+
[SupportedLanguages.Go]: 'go',
|
|
85
|
+
[SupportedLanguages.Ruby]: 'ruby',
|
|
86
|
+
[SupportedLanguages.Rust]: 'rust',
|
|
87
|
+
[SupportedLanguages.PHP]: 'php',
|
|
88
|
+
[SupportedLanguages.Kotlin]: 'kotlin',
|
|
89
|
+
[SupportedLanguages.Swift]: 'swift',
|
|
90
|
+
[SupportedLanguages.Dart]: 'dart',
|
|
91
|
+
[SupportedLanguages.Cobol]: 'cobol',
|
|
92
|
+
}; // Ensure exhaustiveness
|
|
93
|
+
/** Non-code file extensions → Prism-compatible syntax identifiers */
|
|
94
|
+
const AUXILIARY_SYNTAX_MAP = {
|
|
95
|
+
json: 'json',
|
|
96
|
+
yaml: 'yaml',
|
|
97
|
+
yml: 'yaml',
|
|
98
|
+
md: 'markdown',
|
|
99
|
+
mdx: 'markdown',
|
|
100
|
+
html: 'markup',
|
|
101
|
+
htm: 'markup',
|
|
102
|
+
erb: 'markup',
|
|
103
|
+
xml: 'markup',
|
|
104
|
+
css: 'css',
|
|
105
|
+
scss: 'css',
|
|
106
|
+
sass: 'css',
|
|
107
|
+
sh: 'bash',
|
|
108
|
+
bash: 'bash',
|
|
109
|
+
zsh: 'bash',
|
|
110
|
+
sql: 'sql',
|
|
111
|
+
toml: 'toml',
|
|
112
|
+
ini: 'ini',
|
|
113
|
+
dockerfile: 'docker',
|
|
114
|
+
};
|
|
115
|
+
/** Extensionless filenames → Prism-compatible syntax identifiers */
|
|
116
|
+
const AUXILIARY_BASENAME_MAP = {
|
|
117
|
+
Makefile: 'makefile',
|
|
118
|
+
Dockerfile: 'docker',
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Map file path to a Prism-compatible syntax highlight language string.
|
|
122
|
+
* Covers all SupportedLanguages (code files) plus common non-code formats.
|
|
123
|
+
* Returns 'text' for unrecognised files.
|
|
124
|
+
*/
|
|
125
|
+
export const getSyntaxLanguageFromFilename = (filePath) => {
|
|
126
|
+
const lang = getLanguageFromFilename(filePath);
|
|
127
|
+
if (lang)
|
|
128
|
+
return SYNTAX_MAP[lang];
|
|
129
|
+
const ext = filePath.split('.').pop()?.toLowerCase();
|
|
130
|
+
if (ext && ext in AUXILIARY_SYNTAX_MAP)
|
|
131
|
+
return AUXILIARY_SYNTAX_MAP[ext];
|
|
132
|
+
const basename = filePath.split('/').pop() || '';
|
|
133
|
+
if (basename in AUXILIARY_BASENAME_MAP)
|
|
134
|
+
return AUXILIARY_BASENAME_MAP[basename];
|
|
135
|
+
return 'text';
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=language-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-detection.js","sourceRoot":"","sources":["../src/language-detection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,6DAA6D;AAC7D,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACvC,UAAU;IACV,SAAS;IACT,WAAW;IACX,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,aAAa,GAAkD;IACnE,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAChE,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAChE,CAAC,kBAA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AAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;IACrD,IAAI,GAAG,IAAI,GAAG,IAAI,oBAAoB;QAAE,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACjD,IAAI,QAAQ,IAAI,sBAAsB;QAAE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAChF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported language enum — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both CLI and web use this to identify which language a file/node belongs to.
|
|
5
|
+
* The CLI uses it throughout the ingestion pipeline; the web uses it for display.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SupportedLanguages {
|
|
8
|
+
JavaScript = "javascript",
|
|
9
|
+
TypeScript = "typescript",
|
|
10
|
+
Python = "python",
|
|
11
|
+
Java = "java",
|
|
12
|
+
C = "c",
|
|
13
|
+
CPlusPlus = "cpp",
|
|
14
|
+
CSharp = "csharp",
|
|
15
|
+
Go = "go",
|
|
16
|
+
Ruby = "ruby",
|
|
17
|
+
Rust = "rust",
|
|
18
|
+
PHP = "php",
|
|
19
|
+
Kotlin = "kotlin",
|
|
20
|
+
Swift = "swift",
|
|
21
|
+
Dart = "dart",
|
|
22
|
+
/** Standalone regex processor — no tree-sitter, no LanguageProvider. */
|
|
23
|
+
Cobol = "cobol"
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,kBAAkB;IAC5B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,CAAC,MAAM;IACP,SAAS,QAAQ;IACjB,MAAM,WAAW;IACjB,EAAE,OAAO;IACT,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,wEAAwE;IACxE,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported language enum — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* Both CLI and web use this to identify which language a file/node belongs to.
|
|
5
|
+
* The CLI uses it throughout the ingestion pipeline; the web uses it for display.
|
|
6
|
+
*/
|
|
7
|
+
export var SupportedLanguages;
|
|
8
|
+
(function (SupportedLanguages) {
|
|
9
|
+
SupportedLanguages["JavaScript"] = "javascript";
|
|
10
|
+
SupportedLanguages["TypeScript"] = "typescript";
|
|
11
|
+
SupportedLanguages["Python"] = "python";
|
|
12
|
+
SupportedLanguages["Java"] = "java";
|
|
13
|
+
SupportedLanguages["C"] = "c";
|
|
14
|
+
SupportedLanguages["CPlusPlus"] = "cpp";
|
|
15
|
+
SupportedLanguages["CSharp"] = "csharp";
|
|
16
|
+
SupportedLanguages["Go"] = "go";
|
|
17
|
+
SupportedLanguages["Ruby"] = "ruby";
|
|
18
|
+
SupportedLanguages["Rust"] = "rust";
|
|
19
|
+
SupportedLanguages["PHP"] = "php";
|
|
20
|
+
SupportedLanguages["Kotlin"] = "kotlin";
|
|
21
|
+
SupportedLanguages["Swift"] = "swift";
|
|
22
|
+
SupportedLanguages["Dart"] = "dart";
|
|
23
|
+
/** Standalone regex processor — no tree-sitter, no LanguageProvider. */
|
|
24
|
+
SupportedLanguages["Cobol"] = "cobol";
|
|
25
|
+
})(SupportedLanguages || (SupportedLanguages = {}));
|
|
26
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,uCAAiB,CAAA;IACjB,mCAAa,CAAA;IACb,6BAAO,CAAA;IACP,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,+BAAS,CAAA;IACT,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,wEAAwE;IACxE,qCAAe,CAAA;AACjB,CAAC,EAjBW,kBAAkB,KAAlB,kBAAkB,QAiB7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LadybugDB schema constants — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* NODE_TABLES and REL_TYPES define what the knowledge graph can contain.
|
|
5
|
+
* Both CLI and web must agree on these for data compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Full DDL schemas remain in each package's own schema.ts because
|
|
8
|
+
* the CLI uses native LadybugDB and the web uses WASM.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NODE_TABLES: readonly ["File", "Folder", "Function", "Class", "Interface", "Method", "CodeElement", "Community", "Process", "Section", "Struct", "Enum", "Macro", "Typedef", "Union", "Namespace", "Trait", "Impl", "TypeAlias", "Const", "Static", "Property", "Record", "Delegate", "Annotation", "Constructor", "Template", "Module", "Route", "Tool"];
|
|
11
|
+
export type NodeTableName = (typeof NODE_TABLES)[number];
|
|
12
|
+
export declare const REL_TABLE_NAME = "CodeRelation";
|
|
13
|
+
export declare const REL_TYPES: readonly ["CONTAINS", "DEFINES", "IMPORTS", "CALLS", "EXTENDS", "IMPLEMENTS", "HAS_METHOD", "HAS_PROPERTY", "ACCESSES", "OVERRIDES", "MEMBER_OF", "STEP_IN_PROCESS", "HANDLES_ROUTE", "FETCHES", "HANDLES_TOOL", "ENTRY_POINT_OF", "WRAPS", "QUERIES"];
|
|
14
|
+
export type RelType = (typeof REL_TYPES)[number];
|
|
15
|
+
export declare const EMBEDDING_TABLE_NAME = "CodeEmbedding";
|
|
16
|
+
//# sourceMappingURL=schema-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,8UA+Bd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,wPAmBZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LadybugDB schema constants — single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* NODE_TABLES and REL_TYPES define what the knowledge graph can contain.
|
|
5
|
+
* Both CLI and web must agree on these for data compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Full DDL schemas remain in each package's own schema.ts because
|
|
8
|
+
* the CLI uses native LadybugDB and the web uses WASM.
|
|
9
|
+
*/
|
|
10
|
+
export const NODE_TABLES = [
|
|
11
|
+
'File',
|
|
12
|
+
'Folder',
|
|
13
|
+
'Function',
|
|
14
|
+
'Class',
|
|
15
|
+
'Interface',
|
|
16
|
+
'Method',
|
|
17
|
+
'CodeElement',
|
|
18
|
+
'Community',
|
|
19
|
+
'Process',
|
|
20
|
+
'Section',
|
|
21
|
+
'Struct',
|
|
22
|
+
'Enum',
|
|
23
|
+
'Macro',
|
|
24
|
+
'Typedef',
|
|
25
|
+
'Union',
|
|
26
|
+
'Namespace',
|
|
27
|
+
'Trait',
|
|
28
|
+
'Impl',
|
|
29
|
+
'TypeAlias',
|
|
30
|
+
'Const',
|
|
31
|
+
'Static',
|
|
32
|
+
'Property',
|
|
33
|
+
'Record',
|
|
34
|
+
'Delegate',
|
|
35
|
+
'Annotation',
|
|
36
|
+
'Constructor',
|
|
37
|
+
'Template',
|
|
38
|
+
'Module',
|
|
39
|
+
'Route',
|
|
40
|
+
'Tool',
|
|
41
|
+
];
|
|
42
|
+
export const REL_TABLE_NAME = 'CodeRelation';
|
|
43
|
+
export const REL_TYPES = [
|
|
44
|
+
'CONTAINS',
|
|
45
|
+
'DEFINES',
|
|
46
|
+
'IMPORTS',
|
|
47
|
+
'CALLS',
|
|
48
|
+
'EXTENDS',
|
|
49
|
+
'IMPLEMENTS',
|
|
50
|
+
'HAS_METHOD',
|
|
51
|
+
'HAS_PROPERTY',
|
|
52
|
+
'ACCESSES',
|
|
53
|
+
'OVERRIDES',
|
|
54
|
+
'MEMBER_OF',
|
|
55
|
+
'STEP_IN_PROCESS',
|
|
56
|
+
'HANDLES_ROUTE',
|
|
57
|
+
'FETCHES',
|
|
58
|
+
'HANDLES_TOOL',
|
|
59
|
+
'ENTRY_POINT_OF',
|
|
60
|
+
'WRAPS',
|
|
61
|
+
'QUERIES',
|
|
62
|
+
];
|
|
63
|
+
export const EMBEDDING_TABLE_NAME = 'CodeEmbedding';
|
|
64
|
+
//# sourceMappingURL=schema-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;CACE,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;CACD,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline progress types — shared between CLI and web.
|
|
3
|
+
*/
|
|
4
|
+
export type PipelinePhase = 'idle' | 'extracting' | 'structure' | 'parsing' | 'imports' | 'calls' | 'heritage' | 'communities' | 'processes' | 'enriching' | 'complete' | 'error';
|
|
5
|
+
export interface PipelineProgress {
|
|
6
|
+
phase: PipelinePhase;
|
|
7
|
+
percent: number;
|
|
8
|
+
message: string;
|
|
9
|
+
detail?: string;
|
|
10
|
+
stats?: {
|
|
11
|
+
filesProcessed: number;
|
|
12
|
+
totalFiles: number;
|
|
13
|
+
nodesCreated: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,OAAO,GACP,UAAU,GACV,aAAa,GACb,WAAW,GACX,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitnexus",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
|
|
5
5
|
"author": "Abhigyan Patwari",
|
|
6
6
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"vendor"
|
|
39
39
|
],
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "
|
|
41
|
+
"build": "node scripts/build.js",
|
|
42
42
|
"serve": "tsx src/cli/index.ts serve",
|
|
43
43
|
"dev": "tsx watch src/cli/index.ts",
|
|
44
44
|
"test": "vitest run",
|
|
@@ -46,11 +46,10 @@
|
|
|
46
46
|
"test:integration": "vitest run test/integration",
|
|
47
47
|
"test:watch": "vitest",
|
|
48
48
|
"test:coverage": "vitest run --coverage",
|
|
49
|
-
"prepare": "
|
|
49
|
+
"prepare": "tsc",
|
|
50
50
|
"prepack": "npm run build && chmod +x dist/cli/index.js"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"gitnexus-shared": "file:../gitnexus-shared",
|
|
54
53
|
"@huggingface/transformers": "^3.0.0",
|
|
55
54
|
"@ladybugdb/core": "^0.15.2",
|
|
56
55
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
@@ -87,6 +86,7 @@
|
|
|
87
86
|
"tree-sitter-swift": "^0.6.0"
|
|
88
87
|
},
|
|
89
88
|
"devDependencies": {
|
|
89
|
+
"gitnexus-shared": "file:../gitnexus-shared",
|
|
90
90
|
"@types/cli-progress": "^3.11.6",
|
|
91
91
|
"@types/cors": "^2.8.17",
|
|
92
92
|
"@types/express": "^4.17.21",
|
package/scripts/build.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Build script that compiles gitnexus and inlines gitnexus-shared into the dist.
|
|
4
|
+
*
|
|
5
|
+
* Steps:
|
|
6
|
+
* 1. Build gitnexus-shared (tsc)
|
|
7
|
+
* 2. Build gitnexus (tsc)
|
|
8
|
+
* 3. Copy gitnexus-shared/dist → dist/_shared
|
|
9
|
+
* 4. Rewrite bare 'gitnexus-shared' specifiers → relative paths
|
|
10
|
+
*/
|
|
11
|
+
import { execSync } from 'node:child_process';
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
18
|
+
const SHARED_ROOT = path.resolve(ROOT, '..', 'gitnexus-shared');
|
|
19
|
+
const DIST = path.join(ROOT, 'dist');
|
|
20
|
+
const SHARED_DEST = path.join(DIST, '_shared');
|
|
21
|
+
|
|
22
|
+
// ── 1. Build gitnexus-shared ───────────────────────────────────────
|
|
23
|
+
console.log('[build] compiling gitnexus-shared…');
|
|
24
|
+
execSync('npx tsc', { cwd: SHARED_ROOT, stdio: 'inherit' });
|
|
25
|
+
|
|
26
|
+
// ── 2. Build gitnexus ──────────────────────────────────────────────
|
|
27
|
+
console.log('[build] compiling gitnexus…');
|
|
28
|
+
execSync('npx tsc', { cwd: ROOT, stdio: 'inherit' });
|
|
29
|
+
|
|
30
|
+
// ── 3. Copy shared dist ────────────────────────────────────────────
|
|
31
|
+
console.log('[build] copying shared module into dist/_shared…');
|
|
32
|
+
fs.cpSync(path.join(SHARED_ROOT, 'dist'), SHARED_DEST, { recursive: true });
|
|
33
|
+
|
|
34
|
+
// ── 4. Rewrite imports ─────────────────────────────────────────────
|
|
35
|
+
console.log('[build] rewriting gitnexus-shared imports…');
|
|
36
|
+
let rewritten = 0;
|
|
37
|
+
|
|
38
|
+
function rewriteFile(filePath) {
|
|
39
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
40
|
+
if (!content.includes('gitnexus-shared')) return;
|
|
41
|
+
|
|
42
|
+
const relDir = path.relative(path.dirname(filePath), SHARED_DEST);
|
|
43
|
+
// Always use posix separators and point to the package index
|
|
44
|
+
const relImport = relDir.split(path.sep).join('/') + '/index.js';
|
|
45
|
+
|
|
46
|
+
const updated = content
|
|
47
|
+
.replace(/from\s+['"]gitnexus-shared['"]/g, `from '${relImport}'`)
|
|
48
|
+
.replace(/import\(\s*['"]gitnexus-shared['"]\s*\)/g, `import('${relImport}')`);
|
|
49
|
+
|
|
50
|
+
if (updated !== content) {
|
|
51
|
+
fs.writeFileSync(filePath, updated);
|
|
52
|
+
rewritten++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function walk(dir, extensions, cb) {
|
|
57
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
58
|
+
const full = path.join(dir, entry.name);
|
|
59
|
+
if (entry.isDirectory()) {
|
|
60
|
+
walk(full, extensions, cb);
|
|
61
|
+
} else if (extensions.some((ext) => entry.name.endsWith(ext))) {
|
|
62
|
+
cb(full);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
walk(DIST, ['.js', '.d.ts'], rewriteFile);
|
|
68
|
+
|
|
69
|
+
console.log(`[build] done — rewrote ${rewritten} files.`);
|