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.
Files changed (169) hide show
  1. package/README.md +215 -194
  2. package/dist/cli/ai-context.d.ts +2 -1
  3. package/dist/cli/ai-context.js +117 -90
  4. package/dist/cli/analyze.d.ts +2 -0
  5. package/dist/cli/analyze.js +57 -30
  6. package/dist/cli/augment.js +1 -1
  7. package/dist/cli/eval-server.d.ts +1 -1
  8. package/dist/cli/eval-server.js +14 -6
  9. package/dist/cli/index.js +18 -25
  10. package/dist/cli/lazy-action.d.ts +6 -0
  11. package/dist/cli/lazy-action.js +18 -0
  12. package/dist/cli/mcp.js +1 -1
  13. package/dist/cli/setup.js +42 -32
  14. package/dist/cli/skill-gen.d.ts +26 -0
  15. package/dist/cli/skill-gen.js +549 -0
  16. package/dist/cli/status.js +13 -4
  17. package/dist/cli/tool.d.ts +3 -2
  18. package/dist/cli/tool.js +48 -13
  19. package/dist/cli/wiki.js +2 -2
  20. package/dist/config/ignore-service.d.ts +25 -0
  21. package/dist/config/ignore-service.js +76 -0
  22. package/dist/config/supported-languages.d.ts +1 -0
  23. package/dist/config/supported-languages.js +1 -1
  24. package/dist/core/augmentation/engine.js +99 -72
  25. package/dist/core/embeddings/embedder.d.ts +1 -1
  26. package/dist/core/embeddings/embedder.js +1 -1
  27. package/dist/core/embeddings/embedding-pipeline.d.ts +3 -3
  28. package/dist/core/embeddings/embedding-pipeline.js +74 -47
  29. package/dist/core/embeddings/types.d.ts +1 -1
  30. package/dist/core/graph/types.d.ts +5 -2
  31. package/dist/core/ingestion/ast-cache.js +3 -2
  32. package/dist/core/ingestion/call-processor.d.ts +5 -7
  33. package/dist/core/ingestion/call-processor.js +430 -283
  34. package/dist/core/ingestion/call-routing.d.ts +53 -0
  35. package/dist/core/ingestion/call-routing.js +108 -0
  36. package/dist/core/ingestion/cluster-enricher.js +16 -16
  37. package/dist/core/ingestion/constants.d.ts +16 -0
  38. package/dist/core/ingestion/constants.js +16 -0
  39. package/dist/core/ingestion/entry-point-scoring.d.ts +2 -1
  40. package/dist/core/ingestion/entry-point-scoring.js +94 -24
  41. package/dist/core/ingestion/export-detection.d.ts +18 -0
  42. package/dist/core/ingestion/export-detection.js +231 -0
  43. package/dist/core/ingestion/filesystem-walker.js +4 -3
  44. package/dist/core/ingestion/framework-detection.d.ts +5 -1
  45. package/dist/core/ingestion/framework-detection.js +48 -8
  46. package/dist/core/ingestion/heritage-processor.d.ts +13 -5
  47. package/dist/core/ingestion/heritage-processor.js +109 -55
  48. package/dist/core/ingestion/import-processor.d.ts +16 -20
  49. package/dist/core/ingestion/import-processor.js +202 -696
  50. package/dist/core/ingestion/language-config.d.ts +46 -0
  51. package/dist/core/ingestion/language-config.js +167 -0
  52. package/dist/core/ingestion/mro-processor.d.ts +45 -0
  53. package/dist/core/ingestion/mro-processor.js +369 -0
  54. package/dist/core/ingestion/named-binding-extraction.d.ts +61 -0
  55. package/dist/core/ingestion/named-binding-extraction.js +363 -0
  56. package/dist/core/ingestion/parsing-processor.d.ts +3 -11
  57. package/dist/core/ingestion/parsing-processor.js +85 -181
  58. package/dist/core/ingestion/pipeline.d.ts +5 -1
  59. package/dist/core/ingestion/pipeline.js +192 -116
  60. package/dist/core/ingestion/process-processor.js +2 -1
  61. package/dist/core/ingestion/resolution-context.d.ts +53 -0
  62. package/dist/core/ingestion/resolution-context.js +132 -0
  63. package/dist/core/ingestion/resolvers/csharp.d.ts +22 -0
  64. package/dist/core/ingestion/resolvers/csharp.js +109 -0
  65. package/dist/core/ingestion/resolvers/go.d.ts +19 -0
  66. package/dist/core/ingestion/resolvers/go.js +42 -0
  67. package/dist/core/ingestion/resolvers/index.d.ts +18 -0
  68. package/dist/core/ingestion/resolvers/index.js +13 -0
  69. package/dist/core/ingestion/resolvers/jvm.d.ts +23 -0
  70. package/dist/core/ingestion/resolvers/jvm.js +87 -0
  71. package/dist/core/ingestion/resolvers/php.d.ts +15 -0
  72. package/dist/core/ingestion/resolvers/php.js +35 -0
  73. package/dist/core/ingestion/resolvers/python.d.ts +19 -0
  74. package/dist/core/ingestion/resolvers/python.js +52 -0
  75. package/dist/core/ingestion/resolvers/ruby.d.ts +12 -0
  76. package/dist/core/ingestion/resolvers/ruby.js +15 -0
  77. package/dist/core/ingestion/resolvers/rust.d.ts +15 -0
  78. package/dist/core/ingestion/resolvers/rust.js +73 -0
  79. package/dist/core/ingestion/resolvers/standard.d.ts +28 -0
  80. package/dist/core/ingestion/resolvers/standard.js +123 -0
  81. package/dist/core/ingestion/resolvers/utils.d.ts +33 -0
  82. package/dist/core/ingestion/resolvers/utils.js +122 -0
  83. package/dist/core/ingestion/symbol-table.d.ts +21 -1
  84. package/dist/core/ingestion/symbol-table.js +40 -12
  85. package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -11
  86. package/dist/core/ingestion/tree-sitter-queries.js +642 -485
  87. package/dist/core/ingestion/type-env.d.ts +49 -0
  88. package/dist/core/ingestion/type-env.js +611 -0
  89. package/dist/core/ingestion/type-extractors/c-cpp.d.ts +2 -0
  90. package/dist/core/ingestion/type-extractors/c-cpp.js +385 -0
  91. package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
  92. package/dist/core/ingestion/type-extractors/csharp.js +383 -0
  93. package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
  94. package/dist/core/ingestion/type-extractors/go.js +467 -0
  95. package/dist/core/ingestion/type-extractors/index.d.ts +22 -0
  96. package/dist/core/ingestion/type-extractors/index.js +31 -0
  97. package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
  98. package/dist/core/ingestion/type-extractors/jvm.js +681 -0
  99. package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
  100. package/dist/core/ingestion/type-extractors/php.js +549 -0
  101. package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
  102. package/dist/core/ingestion/type-extractors/python.js +406 -0
  103. package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
  104. package/dist/core/ingestion/type-extractors/ruby.js +389 -0
  105. package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
  106. package/dist/core/ingestion/type-extractors/rust.js +449 -0
  107. package/dist/core/ingestion/type-extractors/shared.d.ts +133 -0
  108. package/dist/core/ingestion/type-extractors/shared.js +703 -0
  109. package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
  110. package/dist/core/ingestion/type-extractors/swift.js +137 -0
  111. package/dist/core/ingestion/type-extractors/types.d.ts +127 -0
  112. package/dist/core/ingestion/type-extractors/types.js +1 -0
  113. package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
  114. package/dist/core/ingestion/type-extractors/typescript.js +494 -0
  115. package/dist/core/ingestion/utils.d.ts +98 -0
  116. package/dist/core/ingestion/utils.js +1064 -9
  117. package/dist/core/ingestion/workers/parse-worker.d.ts +38 -4
  118. package/dist/core/ingestion/workers/parse-worker.js +251 -359
  119. package/dist/core/ingestion/workers/worker-pool.js +8 -0
  120. package/dist/core/{kuzu → lbug}/csv-generator.d.ts +1 -1
  121. package/dist/core/{kuzu → lbug}/csv-generator.js +20 -4
  122. package/dist/core/{kuzu/kuzu-adapter.d.ts → lbug/lbug-adapter.d.ts} +19 -19
  123. package/dist/core/{kuzu/kuzu-adapter.js → lbug/lbug-adapter.js} +82 -82
  124. package/dist/core/{kuzu → lbug}/schema.d.ts +4 -4
  125. package/dist/core/{kuzu → lbug}/schema.js +304 -289
  126. package/dist/core/search/bm25-index.d.ts +4 -4
  127. package/dist/core/search/bm25-index.js +17 -16
  128. package/dist/core/search/hybrid-search.d.ts +2 -2
  129. package/dist/core/search/hybrid-search.js +9 -9
  130. package/dist/core/tree-sitter/parser-loader.js +9 -2
  131. package/dist/core/wiki/generator.d.ts +4 -52
  132. package/dist/core/wiki/generator.js +53 -552
  133. package/dist/core/wiki/graph-queries.d.ts +4 -46
  134. package/dist/core/wiki/graph-queries.js +103 -282
  135. package/dist/core/wiki/html-viewer.js +192 -192
  136. package/dist/core/wiki/llm-client.js +11 -73
  137. package/dist/core/wiki/prompts.d.ts +8 -52
  138. package/dist/core/wiki/prompts.js +86 -200
  139. package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
  140. package/dist/mcp/compatible-stdio-transport.js +200 -0
  141. package/dist/mcp/core/{kuzu-adapter.d.ts → lbug-adapter.d.ts} +7 -9
  142. package/dist/mcp/core/{kuzu-adapter.js → lbug-adapter.js} +77 -79
  143. package/dist/mcp/local/local-backend.d.ts +7 -6
  144. package/dist/mcp/local/local-backend.js +176 -147
  145. package/dist/mcp/resources.js +42 -42
  146. package/dist/mcp/server.js +18 -19
  147. package/dist/mcp/tools.js +103 -104
  148. package/dist/server/api.js +12 -12
  149. package/dist/server/mcp-http.d.ts +1 -1
  150. package/dist/server/mcp-http.js +1 -1
  151. package/dist/storage/repo-manager.d.ts +20 -2
  152. package/dist/storage/repo-manager.js +55 -1
  153. package/dist/types/pipeline.d.ts +1 -1
  154. package/hooks/claude/gitnexus-hook.cjs +238 -155
  155. package/hooks/claude/pre-tool-use.sh +79 -79
  156. package/hooks/claude/session-start.sh +42 -42
  157. package/package.json +99 -96
  158. package/scripts/patch-tree-sitter-swift.cjs +74 -74
  159. package/skills/gitnexus-cli.md +82 -82
  160. package/skills/gitnexus-debugging.md +89 -89
  161. package/skills/gitnexus-exploring.md +78 -78
  162. package/skills/gitnexus-guide.md +64 -64
  163. package/skills/gitnexus-impact-analysis.md +97 -97
  164. package/skills/gitnexus-pr-review.md +163 -163
  165. package/skills/gitnexus-refactoring.md +121 -121
  166. package/vendor/leiden/index.cjs +355 -355
  167. package/vendor/leiden/utils.cjs +392 -392
  168. package/dist/core/wiki/diagrams.d.ts +0 -27
  169. package/dist/core/wiki/diagrams.js +0 -163
@@ -1,5 +1,5 @@
1
1
  /**
2
- * KuzuDB Schema Definitions
2
+ * LadybugDB Schema Definitions
3
3
  *
4
4
  * Hybrid Schema:
5
5
  * - Separate node tables for each code element type (File, Function, Class, etc.)
@@ -22,7 +22,7 @@ export const NODE_TABLES = [
22
22
  // ============================================================================
23
23
  export const REL_TABLE_NAME = 'CodeRelation';
24
24
  // Valid relation types
25
- export const REL_TYPES = ['CONTAINS', 'DEFINES', 'IMPORTS', 'CALLS', 'EXTENDS', 'IMPLEMENTS', 'MEMBER_OF', 'STEP_IN_PROCESS'];
25
+ export const REL_TYPES = ['CONTAINS', 'DEFINES', 'IMPORTS', 'CALLS', 'EXTENDS', 'IMPLEMENTS', 'HAS_METHOD', 'OVERRIDES', 'MEMBER_OF', 'STEP_IN_PROCESS'];
26
26
  // ============================================================================
27
27
  // EMBEDDING TABLE
28
28
  // ============================================================================
@@ -30,126 +30,128 @@ export const EMBEDDING_TABLE_NAME = 'CodeEmbedding';
30
30
  // ============================================================================
31
31
  // NODE TABLE SCHEMAS
32
32
  // ============================================================================
33
- export const FILE_SCHEMA = `
34
- CREATE NODE TABLE File (
35
- id STRING,
36
- name STRING,
37
- filePath STRING,
38
- content STRING,
39
- PRIMARY KEY (id)
33
+ export const FILE_SCHEMA = `
34
+ CREATE NODE TABLE File (
35
+ id STRING,
36
+ name STRING,
37
+ filePath STRING,
38
+ content STRING,
39
+ PRIMARY KEY (id)
40
40
  )`;
41
- export const FOLDER_SCHEMA = `
42
- CREATE NODE TABLE Folder (
43
- id STRING,
44
- name STRING,
45
- filePath STRING,
46
- PRIMARY KEY (id)
41
+ export const FOLDER_SCHEMA = `
42
+ CREATE NODE TABLE Folder (
43
+ id STRING,
44
+ name STRING,
45
+ filePath STRING,
46
+ PRIMARY KEY (id)
47
47
  )`;
48
- export const FUNCTION_SCHEMA = `
49
- CREATE NODE TABLE Function (
50
- id STRING,
51
- name STRING,
52
- filePath STRING,
53
- startLine INT64,
54
- endLine INT64,
55
- isExported BOOLEAN,
56
- content STRING,
57
- description STRING,
58
- PRIMARY KEY (id)
48
+ export const FUNCTION_SCHEMA = `
49
+ CREATE NODE TABLE Function (
50
+ id STRING,
51
+ name STRING,
52
+ filePath STRING,
53
+ startLine INT64,
54
+ endLine INT64,
55
+ isExported BOOLEAN,
56
+ content STRING,
57
+ description STRING,
58
+ PRIMARY KEY (id)
59
59
  )`;
60
- export const CLASS_SCHEMA = `
61
- CREATE NODE TABLE Class (
62
- id STRING,
63
- name STRING,
64
- filePath STRING,
65
- startLine INT64,
66
- endLine INT64,
67
- isExported BOOLEAN,
68
- content STRING,
69
- description STRING,
70
- PRIMARY KEY (id)
60
+ export const CLASS_SCHEMA = `
61
+ CREATE NODE TABLE Class (
62
+ id STRING,
63
+ name STRING,
64
+ filePath STRING,
65
+ startLine INT64,
66
+ endLine INT64,
67
+ isExported BOOLEAN,
68
+ content STRING,
69
+ description STRING,
70
+ PRIMARY KEY (id)
71
71
  )`;
72
- export const INTERFACE_SCHEMA = `
73
- CREATE NODE TABLE Interface (
74
- id STRING,
75
- name STRING,
76
- filePath STRING,
77
- startLine INT64,
78
- endLine INT64,
79
- isExported BOOLEAN,
80
- content STRING,
81
- description STRING,
82
- PRIMARY KEY (id)
72
+ export const INTERFACE_SCHEMA = `
73
+ CREATE NODE TABLE Interface (
74
+ id STRING,
75
+ name STRING,
76
+ filePath STRING,
77
+ startLine INT64,
78
+ endLine INT64,
79
+ isExported BOOLEAN,
80
+ content STRING,
81
+ description STRING,
82
+ PRIMARY KEY (id)
83
83
  )`;
84
- export const METHOD_SCHEMA = `
85
- CREATE NODE TABLE Method (
86
- id STRING,
87
- name STRING,
88
- filePath STRING,
89
- startLine INT64,
90
- endLine INT64,
91
- isExported BOOLEAN,
92
- content STRING,
93
- description STRING,
94
- PRIMARY KEY (id)
84
+ export const METHOD_SCHEMA = `
85
+ CREATE NODE TABLE Method (
86
+ id STRING,
87
+ name STRING,
88
+ filePath STRING,
89
+ startLine INT64,
90
+ endLine INT64,
91
+ isExported BOOLEAN,
92
+ content STRING,
93
+ description STRING,
94
+ parameterCount INT32,
95
+ returnType STRING,
96
+ PRIMARY KEY (id)
95
97
  )`;
96
- export const CODE_ELEMENT_SCHEMA = `
97
- CREATE NODE TABLE CodeElement (
98
- id STRING,
99
- name STRING,
100
- filePath STRING,
101
- startLine INT64,
102
- endLine INT64,
103
- isExported BOOLEAN,
104
- content STRING,
105
- description STRING,
106
- PRIMARY KEY (id)
98
+ export const CODE_ELEMENT_SCHEMA = `
99
+ CREATE NODE TABLE CodeElement (
100
+ id STRING,
101
+ name STRING,
102
+ filePath STRING,
103
+ startLine INT64,
104
+ endLine INT64,
105
+ isExported BOOLEAN,
106
+ content STRING,
107
+ description STRING,
108
+ PRIMARY KEY (id)
107
109
  )`;
108
110
  // ============================================================================
109
111
  // COMMUNITY NODE TABLE (for Leiden algorithm clusters)
110
112
  // ============================================================================
111
- export const COMMUNITY_SCHEMA = `
112
- CREATE NODE TABLE Community (
113
- id STRING,
114
- label STRING,
115
- heuristicLabel STRING,
116
- keywords STRING[],
117
- description STRING,
118
- enrichedBy STRING,
119
- cohesion DOUBLE,
120
- symbolCount INT32,
121
- PRIMARY KEY (id)
113
+ export const COMMUNITY_SCHEMA = `
114
+ CREATE NODE TABLE Community (
115
+ id STRING,
116
+ label STRING,
117
+ heuristicLabel STRING,
118
+ keywords STRING[],
119
+ description STRING,
120
+ enrichedBy STRING,
121
+ cohesion DOUBLE,
122
+ symbolCount INT32,
123
+ PRIMARY KEY (id)
122
124
  )`;
123
125
  // ============================================================================
124
126
  // PROCESS NODE TABLE (for execution flow detection)
125
127
  // ============================================================================
126
- export const PROCESS_SCHEMA = `
127
- CREATE NODE TABLE Process (
128
- id STRING,
129
- label STRING,
130
- heuristicLabel STRING,
131
- processType STRING,
132
- stepCount INT32,
133
- communities STRING[],
134
- entryPointId STRING,
135
- terminalId STRING,
136
- PRIMARY KEY (id)
128
+ export const PROCESS_SCHEMA = `
129
+ CREATE NODE TABLE Process (
130
+ id STRING,
131
+ label STRING,
132
+ heuristicLabel STRING,
133
+ processType STRING,
134
+ stepCount INT32,
135
+ communities STRING[],
136
+ entryPointId STRING,
137
+ terminalId STRING,
138
+ PRIMARY KEY (id)
137
139
  )`;
138
140
  // ============================================================================
139
141
  // MULTI-LANGUAGE NODE TABLE SCHEMAS
140
142
  // ============================================================================
141
143
  // Generic code element with startLine/endLine for C, C++, Rust, Go, Java, C#
142
144
  // description: optional metadata (e.g. Eloquent $fillable fields, relationship targets)
143
- const CODE_ELEMENT_BASE = (name) => `
144
- CREATE NODE TABLE \`${name}\` (
145
- id STRING,
146
- name STRING,
147
- filePath STRING,
148
- startLine INT64,
149
- endLine INT64,
150
- content STRING,
151
- description STRING,
152
- PRIMARY KEY (id)
145
+ const CODE_ELEMENT_BASE = (name) => `
146
+ CREATE NODE TABLE \`${name}\` (
147
+ id STRING,
148
+ name STRING,
149
+ filePath STRING,
150
+ startLine INT64,
151
+ endLine INT64,
152
+ content STRING,
153
+ description STRING,
154
+ PRIMARY KEY (id)
153
155
  )`;
154
156
  export const STRUCT_SCHEMA = CODE_ELEMENT_BASE('Struct');
155
157
  export const ENUM_SCHEMA = CODE_ELEMENT_BASE('Enum');
@@ -173,203 +175,216 @@ export const MODULE_SCHEMA = CODE_ELEMENT_BASE('Module');
173
175
  // RELATION TABLE SCHEMA
174
176
  // Single table with 'type' property - connects all node tables
175
177
  // ============================================================================
176
- export const RELATION_SCHEMA = `
177
- CREATE REL TABLE ${REL_TABLE_NAME} (
178
- FROM File TO File,
179
- FROM File TO Folder,
180
- FROM File TO Function,
181
- FROM File TO Class,
182
- FROM File TO Interface,
183
- FROM File TO Method,
184
- FROM File TO CodeElement,
185
- FROM File TO \`Struct\`,
186
- FROM File TO \`Enum\`,
187
- FROM File TO \`Macro\`,
188
- FROM File TO \`Typedef\`,
189
- FROM File TO \`Union\`,
190
- FROM File TO \`Namespace\`,
191
- FROM File TO \`Trait\`,
192
- FROM File TO \`Impl\`,
193
- FROM File TO \`TypeAlias\`,
194
- FROM File TO \`Const\`,
195
- FROM File TO \`Static\`,
196
- FROM File TO \`Property\`,
197
- FROM File TO \`Record\`,
198
- FROM File TO \`Delegate\`,
199
- FROM File TO \`Annotation\`,
200
- FROM File TO \`Constructor\`,
201
- FROM File TO \`Template\`,
202
- FROM File TO \`Module\`,
203
- FROM Folder TO Folder,
204
- FROM Folder TO File,
205
- FROM Function TO Function,
206
- FROM Function TO Method,
207
- FROM Function TO Class,
208
- FROM Function TO Community,
209
- FROM Function TO \`Macro\`,
210
- FROM Function TO \`Struct\`,
211
- FROM Function TO \`Template\`,
212
- FROM Function TO \`Enum\`,
213
- FROM Function TO \`Namespace\`,
214
- FROM Function TO \`TypeAlias\`,
215
- FROM Function TO \`Module\`,
216
- FROM Function TO \`Impl\`,
217
- FROM Function TO Interface,
218
- FROM Function TO \`Constructor\`,
219
- FROM Function TO \`Const\`,
220
- FROM Function TO \`Typedef\`,
221
- FROM Function TO \`Union\`,
222
- FROM Function TO \`Property\`,
223
- FROM Class TO Method,
224
- FROM Class TO Function,
225
- FROM Class TO Class,
226
- FROM Class TO Interface,
227
- FROM Class TO Community,
228
- FROM Class TO \`Template\`,
229
- FROM Class TO \`TypeAlias\`,
230
- FROM Class TO \`Struct\`,
231
- FROM Class TO \`Enum\`,
232
- FROM Class TO \`Annotation\`,
233
- FROM Class TO \`Constructor\`,
234
- FROM Class TO \`Trait\`,
235
- FROM Class TO \`Macro\`,
236
- FROM Class TO \`Impl\`,
237
- FROM Class TO \`Union\`,
238
- FROM Class TO \`Namespace\`,
239
- FROM Class TO \`Typedef\`,
240
- FROM Method TO Function,
241
- FROM Method TO Method,
242
- FROM Method TO Class,
243
- FROM Method TO Community,
244
- FROM Method TO \`Template\`,
245
- FROM Method TO \`Struct\`,
246
- FROM Method TO \`TypeAlias\`,
247
- FROM Method TO \`Enum\`,
248
- FROM Method TO \`Macro\`,
249
- FROM Method TO \`Namespace\`,
250
- FROM Method TO \`Module\`,
251
- FROM Method TO \`Impl\`,
252
- FROM Method TO Interface,
253
- FROM Method TO \`Constructor\`,
254
- FROM Method TO \`Property\`,
255
- FROM \`Template\` TO \`Template\`,
256
- FROM \`Template\` TO Function,
257
- FROM \`Template\` TO Method,
258
- FROM \`Template\` TO Class,
259
- FROM \`Template\` TO \`Struct\`,
260
- FROM \`Template\` TO \`TypeAlias\`,
261
- FROM \`Template\` TO \`Enum\`,
262
- FROM \`Template\` TO \`Macro\`,
263
- FROM \`Template\` TO Interface,
264
- FROM \`Template\` TO \`Constructor\`,
265
- FROM \`Module\` TO \`Module\`,
266
- FROM CodeElement TO Community,
267
- FROM Interface TO Community,
268
- FROM Interface TO Function,
269
- FROM Interface TO Method,
270
- FROM Interface TO Class,
271
- FROM Interface TO Interface,
272
- FROM Interface TO \`TypeAlias\`,
273
- FROM Interface TO \`Struct\`,
274
- FROM Interface TO \`Constructor\`,
275
- FROM \`Struct\` TO Community,
276
- FROM \`Struct\` TO \`Trait\`,
277
- FROM \`Struct\` TO \`Struct\`,
278
- FROM \`Struct\` TO Class,
279
- FROM \`Struct\` TO \`Enum\`,
280
- FROM \`Struct\` TO Function,
281
- FROM \`Struct\` TO Method,
282
- FROM \`Struct\` TO Interface,
283
- FROM \`Enum\` TO \`Enum\`,
284
- FROM \`Enum\` TO Community,
285
- FROM \`Enum\` TO Class,
286
- FROM \`Enum\` TO Interface,
287
- FROM \`Macro\` TO Community,
288
- FROM \`Macro\` TO Function,
289
- FROM \`Macro\` TO Method,
290
- FROM \`Module\` TO Function,
291
- FROM \`Module\` TO Method,
292
- FROM \`Typedef\` TO Community,
293
- FROM \`Union\` TO Community,
294
- FROM \`Namespace\` TO Community,
295
- FROM \`Namespace\` TO \`Struct\`,
296
- FROM \`Trait\` TO Community,
297
- FROM \`Impl\` TO Community,
298
- FROM \`Impl\` TO \`Trait\`,
299
- FROM \`Impl\` TO \`Struct\`,
300
- FROM \`Impl\` TO \`Impl\`,
301
- FROM \`TypeAlias\` TO Community,
302
- FROM \`TypeAlias\` TO \`Trait\`,
303
- FROM \`TypeAlias\` TO Class,
304
- FROM \`Const\` TO Community,
305
- FROM \`Static\` TO Community,
306
- FROM \`Property\` TO Community,
307
- FROM \`Record\` TO Community,
308
- FROM \`Delegate\` TO Community,
309
- FROM \`Annotation\` TO Community,
310
- FROM \`Constructor\` TO Community,
311
- FROM \`Constructor\` TO Interface,
312
- FROM \`Constructor\` TO Class,
313
- FROM \`Constructor\` TO Method,
314
- FROM \`Constructor\` TO Function,
315
- FROM \`Constructor\` TO \`Constructor\`,
316
- FROM \`Constructor\` TO \`Struct\`,
317
- FROM \`Constructor\` TO \`Macro\`,
318
- FROM \`Constructor\` TO \`Template\`,
319
- FROM \`Constructor\` TO \`TypeAlias\`,
320
- FROM \`Constructor\` TO \`Enum\`,
321
- FROM \`Constructor\` TO \`Annotation\`,
322
- FROM \`Constructor\` TO \`Impl\`,
323
- FROM \`Constructor\` TO \`Namespace\`,
324
- FROM \`Constructor\` TO \`Module\`,
325
- FROM \`Constructor\` TO \`Property\`,
326
- FROM \`Constructor\` TO \`Typedef\`,
327
- FROM \`Template\` TO Community,
328
- FROM \`Module\` TO Community,
329
- FROM Function TO Process,
330
- FROM Method TO Process,
331
- FROM Class TO Process,
332
- FROM Interface TO Process,
333
- FROM \`Struct\` TO Process,
334
- FROM \`Constructor\` TO Process,
335
- FROM \`Module\` TO Process,
336
- FROM \`Macro\` TO Process,
337
- FROM \`Impl\` TO Process,
338
- FROM \`Typedef\` TO Process,
339
- FROM \`TypeAlias\` TO Process,
340
- FROM \`Enum\` TO Process,
341
- FROM \`Union\` TO Process,
342
- FROM \`Namespace\` TO Process,
343
- FROM \`Trait\` TO Process,
344
- FROM \`Const\` TO Process,
345
- FROM \`Static\` TO Process,
346
- FROM \`Property\` TO Process,
347
- FROM \`Record\` TO Process,
348
- FROM \`Delegate\` TO Process,
349
- FROM \`Annotation\` TO Process,
350
- FROM \`Template\` TO Process,
351
- FROM CodeElement TO Process,
352
- type STRING,
353
- confidence DOUBLE,
354
- reason STRING,
355
- step INT32
178
+ export const RELATION_SCHEMA = `
179
+ CREATE REL TABLE ${REL_TABLE_NAME} (
180
+ FROM File TO File,
181
+ FROM File TO Folder,
182
+ FROM File TO Function,
183
+ FROM File TO Class,
184
+ FROM File TO Interface,
185
+ FROM File TO Method,
186
+ FROM File TO CodeElement,
187
+ FROM File TO \`Struct\`,
188
+ FROM File TO \`Enum\`,
189
+ FROM File TO \`Macro\`,
190
+ FROM File TO \`Typedef\`,
191
+ FROM File TO \`Union\`,
192
+ FROM File TO \`Namespace\`,
193
+ FROM File TO \`Trait\`,
194
+ FROM File TO \`Impl\`,
195
+ FROM File TO \`TypeAlias\`,
196
+ FROM File TO \`Const\`,
197
+ FROM File TO \`Static\`,
198
+ FROM File TO \`Property\`,
199
+ FROM File TO \`Record\`,
200
+ FROM File TO \`Delegate\`,
201
+ FROM File TO \`Annotation\`,
202
+ FROM File TO \`Constructor\`,
203
+ FROM File TO \`Template\`,
204
+ FROM File TO \`Module\`,
205
+ FROM Folder TO Folder,
206
+ FROM Folder TO File,
207
+ FROM Function TO Function,
208
+ FROM Function TO Method,
209
+ FROM Function TO Class,
210
+ FROM Function TO Community,
211
+ FROM Function TO \`Macro\`,
212
+ FROM Function TO \`Struct\`,
213
+ FROM Function TO \`Template\`,
214
+ FROM Function TO \`Enum\`,
215
+ FROM Function TO \`Namespace\`,
216
+ FROM Function TO \`TypeAlias\`,
217
+ FROM Function TO \`Module\`,
218
+ FROM Function TO \`Impl\`,
219
+ FROM Function TO Interface,
220
+ FROM Function TO \`Constructor\`,
221
+ FROM Function TO \`Const\`,
222
+ FROM Function TO \`Typedef\`,
223
+ FROM Function TO \`Union\`,
224
+ FROM Function TO \`Property\`,
225
+ FROM Class TO Method,
226
+ FROM Class TO Function,
227
+ FROM Class TO Class,
228
+ FROM Class TO Interface,
229
+ FROM Class TO Community,
230
+ FROM Class TO \`Template\`,
231
+ FROM Class TO \`TypeAlias\`,
232
+ FROM Class TO \`Struct\`,
233
+ FROM Class TO \`Enum\`,
234
+ FROM Class TO \`Annotation\`,
235
+ FROM Class TO \`Constructor\`,
236
+ FROM Class TO \`Trait\`,
237
+ FROM Class TO \`Macro\`,
238
+ FROM Class TO \`Impl\`,
239
+ FROM Class TO \`Union\`,
240
+ FROM Class TO \`Namespace\`,
241
+ FROM Class TO \`Typedef\`,
242
+ FROM Class TO \`Property\`,
243
+ FROM Method TO Function,
244
+ FROM Method TO Method,
245
+ FROM Method TO Class,
246
+ FROM Method TO Community,
247
+ FROM Method TO \`Template\`,
248
+ FROM Method TO \`Struct\`,
249
+ FROM Method TO \`TypeAlias\`,
250
+ FROM Method TO \`Enum\`,
251
+ FROM Method TO \`Macro\`,
252
+ FROM Method TO \`Namespace\`,
253
+ FROM Method TO \`Module\`,
254
+ FROM Method TO \`Impl\`,
255
+ FROM Method TO Interface,
256
+ FROM Method TO \`Constructor\`,
257
+ FROM Method TO \`Property\`,
258
+ FROM \`Template\` TO \`Template\`,
259
+ FROM \`Template\` TO Function,
260
+ FROM \`Template\` TO Method,
261
+ FROM \`Template\` TO Class,
262
+ FROM \`Template\` TO \`Struct\`,
263
+ FROM \`Template\` TO \`TypeAlias\`,
264
+ FROM \`Template\` TO \`Enum\`,
265
+ FROM \`Template\` TO \`Macro\`,
266
+ FROM \`Template\` TO Interface,
267
+ FROM \`Template\` TO \`Constructor\`,
268
+ FROM \`Module\` TO \`Module\`,
269
+ FROM CodeElement TO Community,
270
+ FROM Interface TO Community,
271
+ FROM Interface TO Function,
272
+ FROM Interface TO Method,
273
+ FROM Interface TO Class,
274
+ FROM Interface TO Interface,
275
+ FROM Interface TO \`TypeAlias\`,
276
+ FROM Interface TO \`Struct\`,
277
+ FROM Interface TO \`Constructor\`,
278
+ FROM Interface TO \`Property\`,
279
+ FROM \`Struct\` TO Community,
280
+ FROM \`Struct\` TO \`Trait\`,
281
+ FROM \`Struct\` TO \`Struct\`,
282
+ FROM \`Struct\` TO Class,
283
+ FROM \`Struct\` TO \`Enum\`,
284
+ FROM \`Struct\` TO Function,
285
+ FROM \`Struct\` TO Method,
286
+ FROM \`Struct\` TO Interface,
287
+ FROM \`Struct\` TO \`Constructor\`,
288
+ FROM \`Struct\` TO \`Property\`,
289
+ FROM \`Enum\` TO \`Enum\`,
290
+ FROM \`Enum\` TO Community,
291
+ FROM \`Enum\` TO Class,
292
+ FROM \`Enum\` TO Interface,
293
+ FROM \`Macro\` TO Community,
294
+ FROM \`Macro\` TO Function,
295
+ FROM \`Macro\` TO Method,
296
+ FROM \`Module\` TO Function,
297
+ FROM \`Module\` TO Method,
298
+ FROM \`Typedef\` TO Community,
299
+ FROM \`Union\` TO Community,
300
+ FROM \`Namespace\` TO Community,
301
+ FROM \`Namespace\` TO \`Struct\`,
302
+ FROM \`Trait\` TO Method,
303
+ FROM \`Trait\` TO \`Constructor\`,
304
+ FROM \`Trait\` TO \`Property\`,
305
+ FROM \`Trait\` TO Community,
306
+ FROM \`Impl\` TO Method,
307
+ FROM \`Impl\` TO \`Constructor\`,
308
+ FROM \`Impl\` TO \`Property\`,
309
+ FROM \`Impl\` TO Community,
310
+ FROM \`Impl\` TO \`Trait\`,
311
+ FROM \`Impl\` TO \`Struct\`,
312
+ FROM \`Impl\` TO \`Impl\`,
313
+ FROM \`TypeAlias\` TO Community,
314
+ FROM \`TypeAlias\` TO \`Trait\`,
315
+ FROM \`TypeAlias\` TO Class,
316
+ FROM \`Const\` TO Community,
317
+ FROM \`Static\` TO Community,
318
+ FROM \`Property\` TO Community,
319
+ FROM \`Record\` TO Method,
320
+ FROM \`Record\` TO \`Constructor\`,
321
+ FROM \`Record\` TO \`Property\`,
322
+ FROM \`Record\` TO Community,
323
+ FROM \`Delegate\` TO Community,
324
+ FROM \`Annotation\` TO Community,
325
+ FROM \`Constructor\` TO Community,
326
+ FROM \`Constructor\` TO Interface,
327
+ FROM \`Constructor\` TO Class,
328
+ FROM \`Constructor\` TO Method,
329
+ FROM \`Constructor\` TO Function,
330
+ FROM \`Constructor\` TO \`Constructor\`,
331
+ FROM \`Constructor\` TO \`Struct\`,
332
+ FROM \`Constructor\` TO \`Macro\`,
333
+ FROM \`Constructor\` TO \`Template\`,
334
+ FROM \`Constructor\` TO \`TypeAlias\`,
335
+ FROM \`Constructor\` TO \`Enum\`,
336
+ FROM \`Constructor\` TO \`Annotation\`,
337
+ FROM \`Constructor\` TO \`Impl\`,
338
+ FROM \`Constructor\` TO \`Namespace\`,
339
+ FROM \`Constructor\` TO \`Module\`,
340
+ FROM \`Constructor\` TO \`Property\`,
341
+ FROM \`Constructor\` TO \`Typedef\`,
342
+ FROM \`Template\` TO Community,
343
+ FROM \`Module\` TO Community,
344
+ FROM Function TO Process,
345
+ FROM Method TO Process,
346
+ FROM Class TO Process,
347
+ FROM Interface TO Process,
348
+ FROM \`Struct\` TO Process,
349
+ FROM \`Constructor\` TO Process,
350
+ FROM \`Module\` TO Process,
351
+ FROM \`Macro\` TO Process,
352
+ FROM \`Impl\` TO Process,
353
+ FROM \`Typedef\` TO Process,
354
+ FROM \`TypeAlias\` TO Process,
355
+ FROM \`Enum\` TO Process,
356
+ FROM \`Union\` TO Process,
357
+ FROM \`Namespace\` TO Process,
358
+ FROM \`Trait\` TO Process,
359
+ FROM \`Const\` TO Process,
360
+ FROM \`Static\` TO Process,
361
+ FROM \`Property\` TO Process,
362
+ FROM \`Record\` TO Process,
363
+ FROM \`Delegate\` TO Process,
364
+ FROM \`Annotation\` TO Process,
365
+ FROM \`Template\` TO Process,
366
+ FROM CodeElement TO Process,
367
+ type STRING,
368
+ confidence DOUBLE,
369
+ reason STRING,
370
+ step INT32
356
371
  )`;
357
372
  // ============================================================================
358
373
  // EMBEDDING TABLE SCHEMA
359
374
  // Separate table for vector storage to avoid copy-on-write overhead
360
375
  // ============================================================================
361
- export const EMBEDDING_SCHEMA = `
362
- CREATE NODE TABLE ${EMBEDDING_TABLE_NAME} (
363
- nodeId STRING,
364
- embedding FLOAT[384],
365
- PRIMARY KEY (nodeId)
376
+ export const EMBEDDING_SCHEMA = `
377
+ CREATE NODE TABLE ${EMBEDDING_TABLE_NAME} (
378
+ nodeId STRING,
379
+ embedding FLOAT[384],
380
+ PRIMARY KEY (nodeId)
366
381
  )`;
367
382
  /**
368
383
  * Create vector index for semantic search
369
384
  * Uses HNSW (Hierarchical Navigable Small World) algorithm with cosine similarity
370
385
  */
371
- export const CREATE_VECTOR_INDEX_QUERY = `
372
- CALL CREATE_VECTOR_INDEX('${EMBEDDING_TABLE_NAME}', 'code_embedding_idx', 'embedding', metric := 'cosine')
386
+ export const CREATE_VECTOR_INDEX_QUERY = `
387
+ CALL CREATE_VECTOR_INDEX('${EMBEDDING_TABLE_NAME}', 'code_embedding_idx', 'embedding', metric := 'cosine')
373
388
  `;
374
389
  // ============================================================================
375
390
  // ALL SCHEMA QUERIES IN ORDER
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Full-Text Search via KuzuDB FTS
2
+ * Full-Text Search via LadybugDB FTS
3
3
  *
4
- * Uses KuzuDB's built-in full-text search indexes for keyword-based search.
4
+ * Uses LadybugDB's built-in full-text search indexes for keyword-based search.
5
5
  * Always reads from the database (no cached state to drift).
6
6
  */
7
7
  export interface BM25SearchResult {
@@ -10,7 +10,7 @@ export interface BM25SearchResult {
10
10
  rank: number;
11
11
  }
12
12
  /**
13
- * Search using KuzuDB's built-in FTS (always fresh, reads from disk)
13
+ * Search using LadybugDB's built-in FTS (always fresh, reads from disk)
14
14
  *
15
15
  * Queries multiple node tables (File, Function, Class, Method) in parallel
16
16
  * and merges results by filePath, summing scores for the same file.
@@ -20,4 +20,4 @@ export interface BM25SearchResult {
20
20
  * @param repoId - If provided, queries will be routed via the MCP connection pool
21
21
  * @returns Ranked search results from FTS indexes
22
22
  */
23
- export declare const searchFTSFromKuzu: (query: string, limit?: number, repoId?: string) => Promise<BM25SearchResult[]>;
23
+ export declare const searchFTSFromLbug: (query: string, limit?: number, repoId?: string) => Promise<BM25SearchResult[]>;