gitnexus 1.5.3 → 1.6.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.
Files changed (201) hide show
  1. package/README.md +10 -0
  2. package/dist/_shared/graph/types.d.ts +1 -1
  3. package/dist/_shared/graph/types.d.ts.map +1 -1
  4. package/dist/_shared/index.d.ts +1 -0
  5. package/dist/_shared/index.d.ts.map +1 -1
  6. package/dist/_shared/language-detection.d.ts.map +1 -1
  7. package/dist/_shared/language-detection.js +2 -0
  8. package/dist/_shared/language-detection.js.map +1 -1
  9. package/dist/_shared/languages.d.ts +1 -0
  10. package/dist/_shared/languages.d.ts.map +1 -1
  11. package/dist/_shared/languages.js +1 -0
  12. package/dist/_shared/languages.js.map +1 -1
  13. package/dist/_shared/lbug/schema-constants.d.ts +1 -1
  14. package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
  15. package/dist/_shared/lbug/schema-constants.js +3 -1
  16. package/dist/_shared/lbug/schema-constants.js.map +1 -1
  17. package/dist/_shared/mro-strategy.d.ts +19 -0
  18. package/dist/_shared/mro-strategy.d.ts.map +1 -0
  19. package/dist/_shared/mro-strategy.js +2 -0
  20. package/dist/_shared/mro-strategy.js.map +1 -0
  21. package/dist/cli/ai-context.d.ts +1 -0
  22. package/dist/cli/ai-context.js +28 -4
  23. package/dist/cli/analyze.d.ts +2 -0
  24. package/dist/cli/analyze.js +2 -1
  25. package/dist/cli/group.d.ts +2 -0
  26. package/dist/cli/group.js +233 -0
  27. package/dist/cli/index.js +3 -0
  28. package/dist/cli/serve.js +4 -1
  29. package/dist/cli/setup.js +34 -3
  30. package/dist/config/ignore-service.js +8 -3
  31. package/dist/core/augmentation/engine.js +1 -1
  32. package/dist/core/git-staleness.d.ts +13 -0
  33. package/dist/core/git-staleness.js +29 -0
  34. package/dist/core/group/bridge-db.d.ts +82 -0
  35. package/dist/core/group/bridge-db.js +460 -0
  36. package/dist/core/group/bridge-schema.d.ts +27 -0
  37. package/dist/core/group/bridge-schema.js +55 -0
  38. package/dist/core/group/config-parser.d.ts +3 -0
  39. package/dist/core/group/config-parser.js +83 -0
  40. package/dist/core/group/contract-extractor.d.ts +7 -0
  41. package/dist/core/group/contract-extractor.js +1 -0
  42. package/dist/core/group/extractors/grpc-extractor.d.ts +16 -0
  43. package/dist/core/group/extractors/grpc-extractor.js +264 -0
  44. package/dist/core/group/extractors/http-route-extractor.d.ts +24 -0
  45. package/dist/core/group/extractors/http-route-extractor.js +428 -0
  46. package/dist/core/group/extractors/topic-extractor.d.ts +9 -0
  47. package/dist/core/group/extractors/topic-extractor.js +234 -0
  48. package/dist/core/group/matching.d.ts +13 -0
  49. package/dist/core/group/matching.js +198 -0
  50. package/dist/core/group/normalization.d.ts +3 -0
  51. package/dist/core/group/normalization.js +115 -0
  52. package/dist/core/group/service-boundary-detector.d.ts +8 -0
  53. package/dist/core/group/service-boundary-detector.js +155 -0
  54. package/dist/core/group/service.d.ts +46 -0
  55. package/dist/core/group/service.js +160 -0
  56. package/dist/core/group/storage.d.ts +9 -0
  57. package/dist/core/group/storage.js +91 -0
  58. package/dist/core/group/sync.d.ts +21 -0
  59. package/dist/core/group/sync.js +148 -0
  60. package/dist/core/group/types.d.ts +130 -0
  61. package/dist/core/group/types.js +1 -0
  62. package/dist/core/ingestion/binding-accumulator.d.ts +207 -0
  63. package/dist/core/ingestion/binding-accumulator.js +332 -0
  64. package/dist/core/ingestion/call-processor.d.ts +155 -24
  65. package/dist/core/ingestion/call-processor.js +1129 -247
  66. package/dist/core/ingestion/class-extractors/generic.d.ts +2 -0
  67. package/dist/core/ingestion/class-extractors/generic.js +135 -0
  68. package/dist/core/ingestion/class-types.d.ts +34 -0
  69. package/dist/core/ingestion/class-types.js +1 -0
  70. package/dist/core/ingestion/entry-point-scoring.d.ts +1 -0
  71. package/dist/core/ingestion/entry-point-scoring.js +1 -0
  72. package/dist/core/ingestion/field-types.d.ts +2 -2
  73. package/dist/core/ingestion/filesystem-walker.js +8 -0
  74. package/dist/core/ingestion/framework-detection.d.ts +1 -0
  75. package/dist/core/ingestion/framework-detection.js +1 -0
  76. package/dist/core/ingestion/heritage-processor.d.ts +8 -15
  77. package/dist/core/ingestion/heritage-processor.js +15 -28
  78. package/dist/core/ingestion/import-processor.d.ts +1 -11
  79. package/dist/core/ingestion/import-processor.js +0 -12
  80. package/dist/core/ingestion/import-resolvers/utils.js +1 -0
  81. package/dist/core/ingestion/import-resolvers/vue.d.ts +8 -0
  82. package/dist/core/ingestion/import-resolvers/vue.js +9 -0
  83. package/dist/core/ingestion/language-provider.d.ts +6 -3
  84. package/dist/core/ingestion/languages/c-cpp.js +168 -1
  85. package/dist/core/ingestion/languages/csharp.js +20 -0
  86. package/dist/core/ingestion/languages/dart.js +26 -4
  87. package/dist/core/ingestion/languages/go.js +22 -0
  88. package/dist/core/ingestion/languages/index.d.ts +1 -0
  89. package/dist/core/ingestion/languages/index.js +2 -0
  90. package/dist/core/ingestion/languages/java.js +17 -0
  91. package/dist/core/ingestion/languages/kotlin.js +24 -1
  92. package/dist/core/ingestion/languages/php.js +23 -11
  93. package/dist/core/ingestion/languages/python.js +9 -0
  94. package/dist/core/ingestion/languages/ruby.js +28 -0
  95. package/dist/core/ingestion/languages/rust.js +38 -0
  96. package/dist/core/ingestion/languages/swift.js +31 -0
  97. package/dist/core/ingestion/languages/typescript.d.ts +1 -0
  98. package/dist/core/ingestion/languages/typescript.js +52 -3
  99. package/dist/core/ingestion/languages/vue.d.ts +13 -0
  100. package/dist/core/ingestion/languages/vue.js +81 -0
  101. package/dist/core/ingestion/method-extractors/configs/c-cpp.d.ts +3 -0
  102. package/dist/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
  103. package/dist/core/ingestion/method-extractors/configs/csharp.js +5 -1
  104. package/dist/core/ingestion/method-extractors/configs/dart.d.ts +2 -0
  105. package/dist/core/ingestion/method-extractors/configs/dart.js +376 -0
  106. package/dist/core/ingestion/method-extractors/configs/go.d.ts +2 -0
  107. package/dist/core/ingestion/method-extractors/configs/go.js +176 -0
  108. package/dist/core/ingestion/method-extractors/configs/jvm.js +13 -4
  109. package/dist/core/ingestion/method-extractors/configs/php.d.ts +2 -0
  110. package/dist/core/ingestion/method-extractors/configs/php.js +304 -0
  111. package/dist/core/ingestion/method-extractors/configs/python.d.ts +2 -0
  112. package/dist/core/ingestion/method-extractors/configs/python.js +309 -0
  113. package/dist/core/ingestion/method-extractors/configs/ruby.d.ts +2 -0
  114. package/dist/core/ingestion/method-extractors/configs/ruby.js +285 -0
  115. package/dist/core/ingestion/method-extractors/configs/rust.d.ts +2 -0
  116. package/dist/core/ingestion/method-extractors/configs/rust.js +195 -0
  117. package/dist/core/ingestion/method-extractors/configs/swift.d.ts +2 -0
  118. package/dist/core/ingestion/method-extractors/configs/swift.js +277 -0
  119. package/dist/core/ingestion/method-extractors/configs/typescript-javascript.js +85 -8
  120. package/dist/core/ingestion/method-extractors/generic.js +38 -15
  121. package/dist/core/ingestion/method-types.d.ts +25 -0
  122. package/dist/core/ingestion/model/field-registry.d.ts +18 -0
  123. package/dist/core/ingestion/model/field-registry.js +22 -0
  124. package/dist/core/ingestion/model/heritage-map.d.ts +70 -0
  125. package/dist/core/ingestion/model/heritage-map.js +159 -0
  126. package/dist/core/ingestion/model/index.d.ts +20 -0
  127. package/dist/core/ingestion/model/index.js +41 -0
  128. package/dist/core/ingestion/model/method-registry.d.ts +62 -0
  129. package/dist/core/ingestion/model/method-registry.js +130 -0
  130. package/dist/core/ingestion/model/registration-table.d.ts +139 -0
  131. package/dist/core/ingestion/model/registration-table.js +224 -0
  132. package/dist/core/ingestion/model/resolution-context.d.ts +93 -0
  133. package/dist/core/ingestion/model/resolution-context.js +337 -0
  134. package/dist/core/ingestion/model/resolve.d.ts +56 -0
  135. package/dist/core/ingestion/model/resolve.js +242 -0
  136. package/dist/core/ingestion/model/semantic-model.d.ts +86 -0
  137. package/dist/core/ingestion/model/semantic-model.js +120 -0
  138. package/dist/core/ingestion/model/symbol-table.d.ts +222 -0
  139. package/dist/core/ingestion/model/symbol-table.js +206 -0
  140. package/dist/core/ingestion/model/type-registry.d.ts +39 -0
  141. package/dist/core/ingestion/model/type-registry.js +62 -0
  142. package/dist/core/ingestion/mro-processor.d.ts +4 -3
  143. package/dist/core/ingestion/mro-processor.js +310 -106
  144. package/dist/core/ingestion/parsing-processor.d.ts +5 -4
  145. package/dist/core/ingestion/parsing-processor.js +210 -85
  146. package/dist/core/ingestion/pipeline.d.ts +2 -0
  147. package/dist/core/ingestion/pipeline.js +192 -68
  148. package/dist/core/ingestion/tree-sitter-queries.d.ts +5 -5
  149. package/dist/core/ingestion/tree-sitter-queries.js +21 -0
  150. package/dist/core/ingestion/type-env.d.ts +15 -2
  151. package/dist/core/ingestion/type-env.js +163 -102
  152. package/dist/core/ingestion/type-extractors/csharp.js +17 -0
  153. package/dist/core/ingestion/type-extractors/jvm.js +11 -0
  154. package/dist/core/ingestion/type-extractors/php.js +0 -55
  155. package/dist/core/ingestion/type-extractors/ruby.js +0 -32
  156. package/dist/core/ingestion/type-extractors/swift.js +13 -0
  157. package/dist/core/ingestion/type-extractors/types.d.ts +8 -8
  158. package/dist/core/ingestion/type-extractors/typescript.js +66 -69
  159. package/dist/core/ingestion/utils/ast-helpers.d.ts +33 -43
  160. package/dist/core/ingestion/utils/ast-helpers.js +129 -572
  161. package/dist/core/ingestion/utils/method-props.d.ts +32 -0
  162. package/dist/core/ingestion/utils/method-props.js +147 -0
  163. package/dist/core/ingestion/vue-sfc-extractor.d.ts +44 -0
  164. package/dist/core/ingestion/vue-sfc-extractor.js +94 -0
  165. package/dist/core/ingestion/workers/parse-worker.d.ts +31 -19
  166. package/dist/core/ingestion/workers/parse-worker.js +463 -198
  167. package/dist/core/lbug/lbug-adapter.d.ts +6 -0
  168. package/dist/core/lbug/lbug-adapter.js +68 -3
  169. package/dist/core/lbug/pool-adapter.d.ts +76 -0
  170. package/dist/core/lbug/pool-adapter.js +522 -0
  171. package/dist/core/run-analyze.d.ts +2 -0
  172. package/dist/core/run-analyze.js +1 -1
  173. package/dist/core/search/bm25-index.js +1 -1
  174. package/dist/core/tree-sitter/parser-loader.js +1 -0
  175. package/dist/core/wiki/graph-queries.js +1 -1
  176. package/dist/mcp/core/embedder.js +6 -5
  177. package/dist/mcp/core/lbug-adapter.d.ts +3 -63
  178. package/dist/mcp/core/lbug-adapter.js +3 -484
  179. package/dist/mcp/local/local-backend.d.ts +31 -2
  180. package/dist/mcp/local/local-backend.js +255 -46
  181. package/dist/mcp/resources.js +5 -4
  182. package/dist/mcp/staleness.d.ts +3 -13
  183. package/dist/mcp/staleness.js +2 -31
  184. package/dist/mcp/tools.js +80 -4
  185. package/dist/server/analyze-job.d.ts +2 -0
  186. package/dist/server/analyze-job.js +4 -0
  187. package/dist/server/api.d.ts +20 -1
  188. package/dist/server/api.js +306 -71
  189. package/dist/server/git-clone.d.ts +2 -1
  190. package/dist/server/git-clone.js +98 -5
  191. package/dist/storage/git.d.ts +13 -0
  192. package/dist/storage/git.js +25 -0
  193. package/dist/storage/repo-manager.js +1 -1
  194. package/package.json +8 -2
  195. package/scripts/patch-tree-sitter-swift.cjs +78 -0
  196. package/dist/core/ingestion/named-binding-processor.d.ts +0 -18
  197. package/dist/core/ingestion/named-binding-processor.js +0 -42
  198. package/dist/core/ingestion/resolution-context.d.ts +0 -58
  199. package/dist/core/ingestion/resolution-context.js +0 -135
  200. package/dist/core/ingestion/symbol-table.d.ts +0 -79
  201. package/dist/core/ingestion/symbol-table.js +0 -115
@@ -10,6 +10,7 @@
10
10
  * - implicitImportWirer: all files in the same SPM target see each other
11
11
  */
12
12
  import { SupportedLanguages } from '../../../_shared/index.js';
13
+ import { createClassExtractor } from '../class-extractors/generic.js';
13
14
  import { defineLanguage } from '../language-provider.js';
14
15
  import { typeConfig as swiftConfig } from '../type-extractors/swift.js';
15
16
  import { swiftExportChecker } from '../export-detection.js';
@@ -17,6 +18,8 @@ import { resolveSwiftImport } from '../import-resolvers/swift.js';
17
18
  import { SWIFT_QUERIES } from '../tree-sitter-queries.js';
18
19
  import { createFieldExtractor } from '../field-extractors/generic.js';
19
20
  import { swiftConfig as swiftFieldConfig } from '../field-extractors/configs/swift.js';
21
+ import { createMethodExtractor } from '../method-extractors/generic.js';
22
+ import { swiftMethodConfig } from '../method-extractors/configs/swift.js';
20
23
  /**
21
24
  * Group Swift files by SPM target for implicit module visibility.
22
25
  * If SwiftPackageConfig is available, use target -> directory mappings.
@@ -94,6 +97,14 @@ function wireSwiftImplicitImports(swiftFiles, importMap, addImportEdge, projectC
94
97
  }
95
98
  }
96
99
  }
100
+ /** Swift init/deinit declarations have special names and Constructor label. */
101
+ const swiftExtractFunctionName = (node) => {
102
+ if (node.type === 'init_declaration')
103
+ return { funcName: 'init', label: 'Constructor' };
104
+ if (node.type === 'deinit_declaration')
105
+ return { funcName: 'deinit', label: 'Constructor' };
106
+ return null; // fall through to generic
107
+ };
97
108
  const BUILT_INS = new Set([
98
109
  'print',
99
110
  'debugPrint',
@@ -213,6 +224,26 @@ export const swiftProvider = defineLanguage({
213
224
  importSemantics: 'wildcard',
214
225
  heritageDefaultEdge: 'IMPLEMENTS',
215
226
  fieldExtractor: createFieldExtractor(swiftFieldConfig),
227
+ methodExtractor: createMethodExtractor({
228
+ ...swiftMethodConfig,
229
+ extractFunctionName: swiftExtractFunctionName,
230
+ }),
231
+ classExtractor: createClassExtractor({
232
+ language: SupportedLanguages.Swift,
233
+ typeDeclarationNodes: ['class_declaration', 'protocol_declaration'],
234
+ ancestorScopeNodeTypes: ['class_declaration', 'protocol_declaration'],
235
+ extractType(node) {
236
+ if (node.type === 'protocol_declaration')
237
+ return 'Interface';
238
+ if (node.type !== 'class_declaration')
239
+ return undefined;
240
+ if (node.children.some((child) => child?.text === 'struct'))
241
+ return 'Struct';
242
+ if (node.children.some((child) => child?.text === 'enum'))
243
+ return 'Enum';
244
+ return 'Class';
245
+ },
246
+ }),
216
247
  implicitImportWirer: wireSwiftImplicitImports,
217
248
  builtInNames: BUILT_INS,
218
249
  });
@@ -6,5 +6,6 @@
6
6
  * (extractTsNamedBindings). They differ in file extensions, tree-sitter
7
7
  * queries (TypeScript grammar has interface/type nodes), and language ID.
8
8
  */
9
+ export declare const BUILT_INS: ReadonlySet<string>;
9
10
  export declare const typescriptProvider: import("../language-provider.js").LanguageProvider;
10
11
  export declare const javascriptProvider: import("../language-provider.js").LanguageProvider;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { SupportedLanguages } from '../../../_shared/index.js';
10
10
  import { defineLanguage } from '../language-provider.js';
11
+ import { createClassExtractor } from '../class-extractors/generic.js';
11
12
  import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js';
12
13
  import { tsExportChecker } from '../export-detection.js';
13
14
  import { resolveTypescriptImport, resolveJavascriptImport } from '../import-resolvers/standard.js';
@@ -18,7 +19,29 @@ import { createFieldExtractor } from '../field-extractors/generic.js';
18
19
  import { javascriptConfig } from '../field-extractors/configs/typescript-javascript.js';
19
20
  import { createMethodExtractor } from '../method-extractors/generic.js';
20
21
  import { typescriptMethodConfig, javascriptMethodConfig, } from '../method-extractors/configs/typescript-javascript.js';
21
- const BUILT_INS = new Set([
22
+ /**
23
+ * TypeScript/JavaScript: arrow_function and function_expression get their name
24
+ * from the parent variable_declarator (e.g. `const foo = () => {}`).
25
+ */
26
+ const tsExtractFunctionName = (node) => {
27
+ if (node.type !== 'arrow_function' && node.type !== 'function_expression')
28
+ return null;
29
+ const parent = node.parent;
30
+ if (parent?.type !== 'variable_declarator')
31
+ return null;
32
+ let nameNode = parent.childForFieldName?.('name');
33
+ if (!nameNode) {
34
+ for (let i = 0; i < parent.childCount; i++) {
35
+ const c = parent.child(i);
36
+ if (c?.type === 'identifier') {
37
+ nameNode = c;
38
+ break;
39
+ }
40
+ }
41
+ }
42
+ return { funcName: nameNode?.text ?? null, label: 'Function' };
43
+ };
44
+ export const BUILT_INS = new Set([
22
45
  'console',
23
46
  'log',
24
47
  'warn',
@@ -114,6 +137,21 @@ const BUILT_INS = new Set([
114
137
  'toString',
115
138
  'valueOf',
116
139
  ]);
140
+ const tsJsClassConfig = {
141
+ language: SupportedLanguages.TypeScript,
142
+ typeDeclarationNodes: [
143
+ 'class_declaration',
144
+ 'abstract_class_declaration',
145
+ 'interface_declaration',
146
+ 'enum_declaration',
147
+ ],
148
+ ancestorScopeNodeTypes: [
149
+ 'class_declaration',
150
+ 'abstract_class_declaration',
151
+ 'interface_declaration',
152
+ 'enum_declaration',
153
+ ],
154
+ };
117
155
  export const typescriptProvider = defineLanguage({
118
156
  id: SupportedLanguages.TypeScript,
119
157
  extensions: ['.ts', '.tsx'],
@@ -123,7 +161,11 @@ export const typescriptProvider = defineLanguage({
123
161
  importResolver: resolveTypescriptImport,
124
162
  namedBindingExtractor: extractTsNamedBindings,
125
163
  fieldExtractor: typescriptFieldExtractor,
126
- methodExtractor: createMethodExtractor(typescriptMethodConfig),
164
+ methodExtractor: createMethodExtractor({
165
+ ...typescriptMethodConfig,
166
+ extractFunctionName: tsExtractFunctionName,
167
+ }),
168
+ classExtractor: createClassExtractor(tsJsClassConfig),
127
169
  builtInNames: BUILT_INS,
128
170
  });
129
171
  export const javascriptProvider = defineLanguage({
@@ -135,6 +177,13 @@ export const javascriptProvider = defineLanguage({
135
177
  importResolver: resolveJavascriptImport,
136
178
  namedBindingExtractor: extractTsNamedBindings,
137
179
  fieldExtractor: createFieldExtractor(javascriptConfig),
138
- methodExtractor: createMethodExtractor(javascriptMethodConfig),
180
+ methodExtractor: createMethodExtractor({
181
+ ...javascriptMethodConfig,
182
+ extractFunctionName: tsExtractFunctionName,
183
+ }),
184
+ classExtractor: createClassExtractor({
185
+ ...tsJsClassConfig,
186
+ language: SupportedLanguages.JavaScript,
187
+ }),
139
188
  builtInNames: BUILT_INS,
140
189
  });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Vue language provider.
3
+ *
4
+ * Vue SFCs are preprocessed by extracting the <script> / <script setup>
5
+ * block content, which is then parsed as TypeScript. This provider reuses
6
+ * nearly all TypeScript infrastructure — queries, type config, field
7
+ * extraction, and named binding extraction.
8
+ *
9
+ * Export detection for <script setup> is handled directly in the parse
10
+ * worker (all top-level bindings are implicitly exported). The export
11
+ * checker here is used as fallback for non-setup <script> blocks.
12
+ */
13
+ export declare const vueProvider: import("../language-provider.js").LanguageProvider;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Vue language provider.
3
+ *
4
+ * Vue SFCs are preprocessed by extracting the <script> / <script setup>
5
+ * block content, which is then parsed as TypeScript. This provider reuses
6
+ * nearly all TypeScript infrastructure — queries, type config, field
7
+ * extraction, and named binding extraction.
8
+ *
9
+ * Export detection for <script setup> is handled directly in the parse
10
+ * worker (all top-level bindings are implicitly exported). The export
11
+ * checker here is used as fallback for non-setup <script> blocks.
12
+ */
13
+ import { SupportedLanguages } from '../../../_shared/index.js';
14
+ import { createClassExtractor } from '../class-extractors/generic.js';
15
+ import { defineLanguage } from '../language-provider.js';
16
+ import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js';
17
+ import { tsExportChecker } from '../export-detection.js';
18
+ import { resolveVueImport } from '../import-resolvers/vue.js';
19
+ import { extractTsNamedBindings } from '../named-bindings/typescript.js';
20
+ import { TYPESCRIPT_QUERIES } from '../tree-sitter-queries.js';
21
+ import { typescriptFieldExtractor } from '../field-extractors/typescript.js';
22
+ import { BUILT_INS as TS_BUILT_INS } from './typescript.js';
23
+ const VUE_SPECIFIC_BUILT_INS = [
24
+ 'ref',
25
+ 'reactive',
26
+ 'computed',
27
+ 'watch',
28
+ 'watchEffect',
29
+ 'onMounted',
30
+ 'onUnmounted',
31
+ 'onBeforeMount',
32
+ 'onBeforeUnmount',
33
+ 'onUpdated',
34
+ 'onBeforeUpdate',
35
+ 'nextTick',
36
+ 'defineProps',
37
+ 'defineEmits',
38
+ 'defineExpose',
39
+ 'defineOptions',
40
+ 'defineSlots',
41
+ 'defineModel',
42
+ 'withDefaults',
43
+ 'toRef',
44
+ 'toRefs',
45
+ 'unref',
46
+ 'isRef',
47
+ 'shallowRef',
48
+ 'triggerRef',
49
+ 'provide',
50
+ 'inject',
51
+ 'useSlots',
52
+ 'useAttrs',
53
+ ];
54
+ const VUE_BUILT_INS = new Set([...TS_BUILT_INS, ...VUE_SPECIFIC_BUILT_INS]);
55
+ const vueClassExtractor = createClassExtractor({
56
+ language: SupportedLanguages.Vue,
57
+ typeDeclarationNodes: [
58
+ 'class_declaration',
59
+ 'abstract_class_declaration',
60
+ 'interface_declaration',
61
+ 'enum_declaration',
62
+ ],
63
+ ancestorScopeNodeTypes: [
64
+ 'class_declaration',
65
+ 'abstract_class_declaration',
66
+ 'interface_declaration',
67
+ 'enum_declaration',
68
+ ],
69
+ });
70
+ export const vueProvider = defineLanguage({
71
+ id: SupportedLanguages.Vue,
72
+ extensions: ['.vue'],
73
+ treeSitterQueries: TYPESCRIPT_QUERIES,
74
+ typeConfig: typescriptConfig,
75
+ exportChecker: tsExportChecker,
76
+ importResolver: resolveVueImport,
77
+ namedBindingExtractor: extractTsNamedBindings,
78
+ fieldExtractor: typescriptFieldExtractor,
79
+ classExtractor: vueClassExtractor,
80
+ builtInNames: VUE_BUILT_INS,
81
+ });
@@ -0,0 +1,3 @@
1
+ import type { MethodExtractionConfig } from '../../method-types.js';
2
+ export declare const cppMethodConfig: MethodExtractionConfig;
3
+ export declare const cMethodConfig: MethodExtractionConfig;
@@ -0,0 +1,387 @@
1
+ // gitnexus/src/core/ingestion/method-extractors/configs/c-cpp.ts
2
+ // Verified against tree-sitter-cpp ^0.23.4
3
+ import { SupportedLanguages } from '../../../../_shared/index.js';
4
+ import { hasKeyword } from '../../field-extractors/configs/helpers.js';
5
+ import { extractSimpleTypeName } from '../../type-extractors/shared.js';
6
+ // ---------------------------------------------------------------------------
7
+ // C/C++ helpers
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * Find the function_declarator inside a method node, handling pointer/reference
11
+ * return types where the function_declarator is nested inside a pointer_declarator
12
+ * or reference_declarator.
13
+ */
14
+ function findFunctionDeclarator(node) {
15
+ const declarator = node.childForFieldName('declarator');
16
+ if (!declarator)
17
+ return null;
18
+ if (declarator.type === 'function_declarator')
19
+ return declarator;
20
+ // Recursively unwrap pointer_declarator / reference_declarator chains
21
+ // (e.g. int** (*pfn)() has pointer_declarator → pointer_declarator → function_declarator)
22
+ let current = declarator;
23
+ while (current) {
24
+ for (let i = 0; i < current.namedChildCount; i++) {
25
+ const child = current.namedChild(i);
26
+ if (child?.type === 'function_declarator')
27
+ return child;
28
+ }
29
+ // Go deeper into nested pointer/reference declarators
30
+ const next = current.namedChildren.find((c) => c.type === 'pointer_declarator' || c.type === 'reference_declarator');
31
+ current = next ?? null;
32
+ }
33
+ return null;
34
+ }
35
+ /**
36
+ * Detect `= delete` and `= default` special member function declarations.
37
+ * These are not callable methods and should be suppressed from extraction.
38
+ * tree-sitter-cpp ^0.23.4 emits `delete_method_clause` / `default_method_clause`
39
+ * as named children of the function_definition node.
40
+ */
41
+ function isDeletedOrDefaulted(node) {
42
+ for (let i = 0; i < node.namedChildCount; i++) {
43
+ const child = node.namedChild(i);
44
+ if (child?.type === 'delete_method_clause' || child?.type === 'default_method_clause') {
45
+ return true;
46
+ }
47
+ }
48
+ return false;
49
+ }
50
+ /**
51
+ * Extract method name from a function_declarator.
52
+ * The name is the `declarator` field of the function_declarator — typically a
53
+ * field_identifier, but can be a destructor_name (~ClassName) or operator name.
54
+ */
55
+ function extractCppMethodName(node) {
56
+ const funcDecl = findFunctionDeclarator(node);
57
+ if (!funcDecl)
58
+ return undefined;
59
+ // Suppress `= delete` and `= default` special members — these are not callable
60
+ // methods and should not appear in HAS_METHOD edges.
61
+ if (isDeletedOrDefaulted(node))
62
+ return undefined;
63
+ const nameNode = funcDecl.childForFieldName('declarator');
64
+ if (!nameNode)
65
+ return undefined;
66
+ // destructor_name: ~ClassName
67
+ if (nameNode.type === 'destructor_name')
68
+ return nameNode.text;
69
+ // operator_name: operator==, operator+, etc.
70
+ if (nameNode.type === 'operator_name')
71
+ return nameNode.text;
72
+ return nameNode.text;
73
+ }
74
+ /**
75
+ * Extract return type from the `type` field of the method node.
76
+ * tree-sitter-cpp puts the return type as the `type` field on field_declaration
77
+ * and function_definition nodes.
78
+ */
79
+ function extractCppReturnType(node) {
80
+ const typeNode = node.childForFieldName('type');
81
+ if (typeNode) {
82
+ const typeText = typeNode.text?.trim();
83
+ // C++11 trailing return type: `auto foo() -> ReturnType`
84
+ // When the declared type is `auto`, check for a trailing_return_type on the
85
+ // function_declarator which holds the actual return type.
86
+ if (typeText === 'auto') {
87
+ const funcDecl = findFunctionDeclarator(node);
88
+ if (funcDecl) {
89
+ for (let i = 0; i < funcDecl.namedChildCount; i++) {
90
+ const child = funcDecl.namedChild(i);
91
+ if (child?.type === 'trailing_return_type') {
92
+ // trailing_return_type contains a type_descriptor with the real type
93
+ const typeDesc = child.firstNamedChild;
94
+ if (typeDesc)
95
+ return typeDesc.text?.trim();
96
+ }
97
+ }
98
+ }
99
+ }
100
+ return typeText;
101
+ }
102
+ // Fallback: first type-like named child (for declarations without type field)
103
+ const first = node.firstNamedChild;
104
+ if (first &&
105
+ (first.type === 'primitive_type' ||
106
+ first.type === 'type_identifier' ||
107
+ first.type === 'sized_type_specifier' ||
108
+ first.type === 'template_type')) {
109
+ return first.text?.trim();
110
+ }
111
+ return undefined;
112
+ }
113
+ /**
114
+ * Extract parameters from the parameter_list inside the function_declarator.
115
+ *
116
+ * C/C++ uses parameter_declaration (required) and optional_parameter_declaration
117
+ * (with default value). Variadic `...` appears as a variadic_parameter_declaration.
118
+ */
119
+ function extractCppParameters(node) {
120
+ const funcDecl = findFunctionDeclarator(node);
121
+ if (!funcDecl)
122
+ return [];
123
+ const paramList = funcDecl.childForFieldName('parameters');
124
+ if (!paramList)
125
+ return [];
126
+ const params = [];
127
+ for (let i = 0; i < paramList.namedChildCount; i++) {
128
+ const param = paramList.namedChild(i);
129
+ if (!param)
130
+ continue;
131
+ switch (param.type) {
132
+ case 'parameter_declaration': {
133
+ const typeNode = param.childForFieldName('type');
134
+ const declNode = param.childForFieldName('declarator');
135
+ // Extract name — may be wrapped in pointer_declarator or reference_declarator
136
+ const name = extractParamName(declNode);
137
+ params.push({
138
+ name: name ?? typeNode?.text?.trim() ?? '?',
139
+ type: typeNode
140
+ ? (extractSimpleTypeName(typeNode) ?? typeNode.text?.trim() ?? null)
141
+ : null,
142
+ rawType: typeNode?.text?.trim() ?? null,
143
+ isOptional: false,
144
+ isVariadic: false,
145
+ });
146
+ break;
147
+ }
148
+ case 'optional_parameter_declaration': {
149
+ const typeNode = param.childForFieldName('type');
150
+ const declNode = param.childForFieldName('declarator');
151
+ const name = extractParamName(declNode);
152
+ params.push({
153
+ name: name ?? typeNode?.text?.trim() ?? '?',
154
+ type: typeNode
155
+ ? (extractSimpleTypeName(typeNode) ?? typeNode.text?.trim() ?? null)
156
+ : null,
157
+ rawType: typeNode?.text?.trim() ?? null,
158
+ isOptional: true,
159
+ isVariadic: false,
160
+ });
161
+ break;
162
+ }
163
+ case 'variadic_parameter_declaration': {
164
+ // C-style `...` or typed variadic `T... args`
165
+ const typeNode = param.childForFieldName('type');
166
+ const declNode = param.childForFieldName('declarator');
167
+ const name = extractParamName(declNode);
168
+ params.push({
169
+ name: name ?? '...',
170
+ type: typeNode
171
+ ? (extractSimpleTypeName(typeNode) ?? typeNode.text?.trim() ?? null)
172
+ : null,
173
+ rawType: typeNode?.text?.trim() ?? null,
174
+ isOptional: false,
175
+ isVariadic: true,
176
+ });
177
+ break;
178
+ }
179
+ case 'variadic_parameter': {
180
+ // Bare `...` (C-style)
181
+ params.push({
182
+ name: '...',
183
+ type: null,
184
+ rawType: null,
185
+ isOptional: false,
186
+ isVariadic: true,
187
+ });
188
+ break;
189
+ }
190
+ }
191
+ }
192
+ // C/C++: bare `...` token in parameter list is an unnamed child (not a named node).
193
+ // Check all children for the unnamed `...` token when no variadic was detected above.
194
+ if (!params.some((p) => p.isVariadic)) {
195
+ for (let i = 0; i < paramList.childCount; i++) {
196
+ const child = paramList.child(i);
197
+ if (child && !child.isNamed && child.text === '...') {
198
+ params.push({
199
+ name: '...',
200
+ type: null,
201
+ rawType: null,
202
+ isOptional: false,
203
+ isVariadic: true,
204
+ });
205
+ break;
206
+ }
207
+ }
208
+ }
209
+ return params;
210
+ }
211
+ /** Extract parameter name, recursively unwrapping pointer/reference declarators. */
212
+ function extractParamName(declNode) {
213
+ if (!declNode)
214
+ return undefined;
215
+ if (declNode.type === 'identifier')
216
+ return declNode.text;
217
+ // Recursively unwrap pointer_declarator / reference_declarator chains (e.g. int** ptr)
218
+ for (let i = 0; i < declNode.namedChildCount; i++) {
219
+ const child = declNode.namedChild(i);
220
+ if (!child)
221
+ continue;
222
+ if (child.type === 'identifier')
223
+ return child.text;
224
+ if (child.type === 'pointer_declarator' || child.type === 'reference_declarator') {
225
+ return extractParamName(child);
226
+ }
227
+ }
228
+ return undefined;
229
+ }
230
+ /**
231
+ * Detect C++ access specifier by walking backwards through siblings.
232
+ * Mirrors the field extractor pattern in c-cpp.ts.
233
+ */
234
+ function extractCppVisibility(node) {
235
+ // If this node was unwrapped from a template_declaration, the access_specifier
236
+ // is a sibling of the template_declaration in field_declaration_list, not of
237
+ // this node — climb up one level before walking backward.
238
+ const startNode = node.parent?.type === 'template_declaration' ? node.parent : node;
239
+ let sibling = startNode.previousNamedSibling;
240
+ while (sibling) {
241
+ if (sibling.type === 'access_specifier') {
242
+ const text = sibling.text.replace(':', '').trim();
243
+ if (text === 'public' || text === 'private' || text === 'protected')
244
+ return text;
245
+ }
246
+ sibling = sibling.previousNamedSibling;
247
+ }
248
+ // Default: struct/union = public, class = private
249
+ const parent = startNode.parent?.parent;
250
+ return parent?.type === 'struct_specifier' || parent?.type === 'union_specifier'
251
+ ? 'public'
252
+ : 'private';
253
+ }
254
+ /**
255
+ * Detect pure virtual methods (`= 0`).
256
+ * tree-sitter-cpp emits `=` (unnamed) followed by `number_literal` with text `0`.
257
+ */
258
+ function isPureVirtual(node) {
259
+ let foundEquals = false;
260
+ for (let i = 0; i < node.childCount; i++) {
261
+ const child = node.child(i);
262
+ if (!child)
263
+ continue;
264
+ if (child.text === '=') {
265
+ foundEquals = true;
266
+ }
267
+ else if (foundEquals && child.type === 'number_literal' && child.text === '0') {
268
+ return true;
269
+ }
270
+ else if (foundEquals) {
271
+ foundEquals = false; // Reset if something else follows `=`
272
+ }
273
+ }
274
+ return false;
275
+ }
276
+ /**
277
+ * Check for a virtual_specifier ('final' or 'override') inside the function_declarator.
278
+ * In tree-sitter-cpp, these are named children of the function_declarator, not the
279
+ * method node itself.
280
+ */
281
+ function hasVirtualSpecifier(node, keyword) {
282
+ const funcDecl = findFunctionDeclarator(node);
283
+ if (!funcDecl)
284
+ return false;
285
+ for (let i = 0; i < funcDecl.namedChildCount; i++) {
286
+ const child = funcDecl.namedChild(i);
287
+ if (child?.type === 'virtual_specifier' && child.text === keyword)
288
+ return true;
289
+ }
290
+ return false;
291
+ }
292
+ // ---------------------------------------------------------------------------
293
+ // C++ config
294
+ // ---------------------------------------------------------------------------
295
+ // C++ methods appear as field_declaration (declarations) or function_definition
296
+ // (inline definitions) inside field_declaration_list. The generic extractor
297
+ // iterates bodyNodeTypes children and matches against methodNodeTypes.
298
+ //
299
+ // Key difference from TS/JVM/C#: C++ has no dedicated method_declaration node.
300
+ // A field_declaration is a method if it contains a function_declarator.
301
+ // The generic extractor calls extractName() on every methodNodeType node — if
302
+ // extractName returns undefined (no function_declarator), the method is skipped.
303
+ //
304
+ // Known gaps:
305
+ // - Out-of-class method definitions (void Foo::bar() {}) are not linked as
306
+ // HAS_METHOD — they appear as top-level function_definition nodes.
307
+ // This includes namespace-wrapped and nested classes.
308
+ // - Friend declarations are not extracted.
309
+ // - Template method declarations with explicit specialization.
310
+ // - const-qualified method overloads (e.g. begin() vs begin() const) are
311
+ // disambiguated via isConst flag and $const ID suffix.
312
+ export const cppMethodConfig = {
313
+ language: SupportedLanguages.CPlusPlus,
314
+ typeDeclarationNodes: ['class_specifier', 'struct_specifier', 'union_specifier'],
315
+ // declaration covers constructors/destructors; field_declaration covers method
316
+ // declarations; function_definition covers inline method definitions.
317
+ // Non-method declarations (variables, typedefs) are filtered by extractName
318
+ // returning undefined when no function_declarator is found.
319
+ methodNodeTypes: ['field_declaration', 'function_definition', 'declaration'],
320
+ bodyNodeTypes: ['field_declaration_list'],
321
+ extractName: extractCppMethodName,
322
+ extractReturnType: extractCppReturnType,
323
+ extractParameters: extractCppParameters,
324
+ extractVisibility: extractCppVisibility,
325
+ isStatic(node) {
326
+ return hasKeyword(node, 'static');
327
+ },
328
+ isAbstract(node) {
329
+ return isPureVirtual(node);
330
+ },
331
+ isFinal(node) {
332
+ return hasVirtualSpecifier(node, 'final');
333
+ },
334
+ isVirtual(node) {
335
+ // In C++, override and method-level final are only legal on virtual functions,
336
+ // so they imply virtual even without the explicit keyword.
337
+ return (hasKeyword(node, 'virtual') ||
338
+ hasVirtualSpecifier(node, 'override') ||
339
+ hasVirtualSpecifier(node, 'final'));
340
+ },
341
+ isOverride(node) {
342
+ return hasVirtualSpecifier(node, 'override');
343
+ },
344
+ isConst(node) {
345
+ // const qualifier appears as a type_qualifier child of function_declarator,
346
+ // after the parameter_list: e.g. `int size() const` → funcDecl has
347
+ // type_qualifier child with text "const". Not to be confused with return-type
348
+ // const (e.g. `const int& begin()`) which is at a different AST level.
349
+ const funcDecl = findFunctionDeclarator(node);
350
+ if (!funcDecl)
351
+ return false;
352
+ for (let i = 0; i < funcDecl.namedChildCount; i++) {
353
+ const child = funcDecl.namedChild(i);
354
+ if (child?.type === 'type_qualifier' && child.text === 'const')
355
+ return true;
356
+ }
357
+ return false;
358
+ },
359
+ };
360
+ // ---------------------------------------------------------------------------
361
+ // C config (minimal — C has no classes/methods, only struct function pointers)
362
+ // Verified against tree-sitter-c 0.23.2
363
+ // ---------------------------------------------------------------------------
364
+ // C does not have methods in the OOP sense. Structs with function pointer fields
365
+ // are handled by the field extractor. This config exists for completeness but
366
+ // will rarely match since C structs don't contain function_definition nodes.
367
+ export const cMethodConfig = {
368
+ language: SupportedLanguages.C,
369
+ typeDeclarationNodes: ['struct_specifier'],
370
+ methodNodeTypes: ['function_definition'],
371
+ bodyNodeTypes: ['field_declaration_list'],
372
+ extractName: extractCppMethodName,
373
+ extractReturnType: extractCppReturnType,
374
+ extractParameters: extractCppParameters,
375
+ extractVisibility() {
376
+ return 'public'; // C has no access control
377
+ },
378
+ isStatic(node) {
379
+ return hasKeyword(node, 'static');
380
+ },
381
+ isAbstract() {
382
+ return false; // C has no virtual/abstract
383
+ },
384
+ isFinal() {
385
+ return false;
386
+ },
387
+ };
@@ -1,4 +1,5 @@
1
1
  // gitnexus/src/core/ingestion/method-extractors/configs/csharp.ts
2
+ // Verified against tree-sitter-c-sharp 0.23.1
2
3
  import { SupportedLanguages } from '../../../../_shared/index.js';
3
4
  import { findVisibility, hasModifier, hasKeyword, collectModifierTexts, } from '../../field-extractors/configs/helpers.js';
4
5
  import { extractSimpleTypeName } from '../../type-extractors/shared.js';
@@ -67,6 +68,7 @@ function extractParametersFromList(paramList) {
67
68
  type: typeNode
68
69
  ? (extractSimpleTypeName(typeNode) ?? typeNode.text?.trim() ?? null)
69
70
  : null,
71
+ rawType: typeNode?.text?.trim() ?? null,
70
72
  isOptional: false,
71
73
  isVariadic: true,
72
74
  });
@@ -105,6 +107,7 @@ function extractParametersFromList(paramList) {
105
107
  params.push({
106
108
  name: nameNode.text,
107
109
  type: typeName,
110
+ rawType: typeNode?.text?.trim() ?? null,
108
111
  isOptional,
109
112
  isVariadic: false,
110
113
  });
@@ -164,6 +167,7 @@ export const csharpMethodConfig = {
164
167
  'destructor_declaration',
165
168
  'operator_declaration',
166
169
  'conversion_operator_declaration',
170
+ 'local_function_statement',
167
171
  ],
168
172
  bodyNodeTypes: ['declaration_list'],
169
173
  extractName(node) {
@@ -198,7 +202,7 @@ export const csharpMethodConfig = {
198
202
  // operator_declaration and conversion_operator_declaration use 'type' field, not 'returns'
199
203
  const returnsNode = node.childForFieldName('returns');
200
204
  if (returnsNode)
201
- return extractSimpleTypeName(returnsNode) ?? returnsNode.text?.trim();
205
+ return returnsNode.text?.trim();
202
206
  // Fallback for operator/conversion declarations that use 'type' as return type field
203
207
  if (node.type === 'operator_declaration' || node.type === 'conversion_operator_declaration') {
204
208
  const typeNode = node.childForFieldName('type');