gitnexus 1.4.8 → 1.4.10

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 (211) hide show
  1. package/README.md +7 -0
  2. package/dist/cli/index-repo.d.ts +15 -0
  3. package/dist/cli/index-repo.js +115 -0
  4. package/dist/cli/index.js +11 -2
  5. package/dist/cli/setup.js +12 -9
  6. package/dist/cli/wiki.d.ts +4 -0
  7. package/dist/cli/wiki.js +174 -53
  8. package/dist/config/supported-languages.d.ts +7 -5
  9. package/dist/config/supported-languages.js +6 -4
  10. package/dist/core/graph/graph.js +9 -1
  11. package/dist/core/graph/types.d.ts +10 -2
  12. package/dist/core/ingestion/call-processor.d.ts +18 -1
  13. package/dist/core/ingestion/call-processor.js +297 -38
  14. package/dist/core/ingestion/call-routing.d.ts +3 -18
  15. package/dist/core/ingestion/call-routing.js +0 -19
  16. package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
  17. package/dist/core/ingestion/cobol/cobol-copy-expander.js +385 -0
  18. package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +210 -0
  19. package/dist/core/ingestion/cobol/cobol-preprocessor.js +1509 -0
  20. package/dist/core/ingestion/cobol/jcl-parser.d.ts +68 -0
  21. package/dist/core/ingestion/cobol/jcl-parser.js +217 -0
  22. package/dist/core/ingestion/cobol/jcl-processor.d.ts +33 -0
  23. package/dist/core/ingestion/cobol/jcl-processor.js +229 -0
  24. package/dist/core/ingestion/cobol-processor.d.ts +54 -0
  25. package/dist/core/ingestion/cobol-processor.js +1186 -0
  26. package/dist/core/ingestion/entry-point-scoring.d.ts +17 -0
  27. package/dist/core/ingestion/entry-point-scoring.js +18 -4
  28. package/dist/core/ingestion/export-detection.d.ts +47 -8
  29. package/dist/core/ingestion/export-detection.js +29 -50
  30. package/dist/core/ingestion/field-extractor.d.ts +29 -0
  31. package/dist/core/ingestion/field-extractor.js +25 -0
  32. package/dist/core/ingestion/field-extractors/configs/c-cpp.d.ts +3 -0
  33. package/dist/core/ingestion/field-extractors/configs/c-cpp.js +108 -0
  34. package/dist/core/ingestion/field-extractors/configs/csharp.d.ts +8 -0
  35. package/dist/core/ingestion/field-extractors/configs/csharp.js +73 -0
  36. package/dist/core/ingestion/field-extractors/configs/dart.d.ts +8 -0
  37. package/dist/core/ingestion/field-extractors/configs/dart.js +76 -0
  38. package/dist/core/ingestion/field-extractors/configs/go.d.ts +11 -0
  39. package/dist/core/ingestion/field-extractors/configs/go.js +64 -0
  40. package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +44 -0
  41. package/dist/core/ingestion/field-extractors/configs/helpers.js +134 -0
  42. package/dist/core/ingestion/field-extractors/configs/jvm.d.ts +3 -0
  43. package/dist/core/ingestion/field-extractors/configs/jvm.js +118 -0
  44. package/dist/core/ingestion/field-extractors/configs/php.d.ts +8 -0
  45. package/dist/core/ingestion/field-extractors/configs/php.js +67 -0
  46. package/dist/core/ingestion/field-extractors/configs/python.d.ts +12 -0
  47. package/dist/core/ingestion/field-extractors/configs/python.js +91 -0
  48. package/dist/core/ingestion/field-extractors/configs/ruby.d.ts +16 -0
  49. package/dist/core/ingestion/field-extractors/configs/ruby.js +75 -0
  50. package/dist/core/ingestion/field-extractors/configs/rust.d.ts +9 -0
  51. package/dist/core/ingestion/field-extractors/configs/rust.js +55 -0
  52. package/dist/core/ingestion/field-extractors/configs/swift.d.ts +8 -0
  53. package/dist/core/ingestion/field-extractors/configs/swift.js +63 -0
  54. package/dist/core/ingestion/field-extractors/configs/typescript-javascript.d.ts +3 -0
  55. package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +60 -0
  56. package/dist/core/ingestion/field-extractors/generic.d.ts +46 -0
  57. package/dist/core/ingestion/field-extractors/generic.js +111 -0
  58. package/dist/core/ingestion/field-extractors/typescript.d.ts +77 -0
  59. package/dist/core/ingestion/field-extractors/typescript.js +291 -0
  60. package/dist/core/ingestion/field-types.d.ts +59 -0
  61. package/dist/core/ingestion/field-types.js +2 -0
  62. package/dist/core/ingestion/framework-detection.d.ts +87 -0
  63. package/dist/core/ingestion/framework-detection.js +65 -2
  64. package/dist/core/ingestion/heritage-processor.js +15 -17
  65. package/dist/core/ingestion/import-processor.d.ts +9 -10
  66. package/dist/core/ingestion/import-processor.js +59 -14
  67. package/dist/core/ingestion/{resolvers → import-resolvers}/csharp.d.ts +6 -9
  68. package/dist/core/ingestion/{resolvers → import-resolvers}/csharp.js +20 -2
  69. package/dist/core/ingestion/import-resolvers/dart.d.ts +7 -0
  70. package/dist/core/ingestion/import-resolvers/dart.js +44 -0
  71. package/dist/core/ingestion/{resolvers → import-resolvers}/go.d.ts +4 -5
  72. package/dist/core/ingestion/{resolvers → import-resolvers}/go.js +17 -0
  73. package/dist/core/ingestion/{resolvers → import-resolvers}/jvm.d.ts +9 -1
  74. package/dist/core/ingestion/{resolvers → import-resolvers}/jvm.js +56 -0
  75. package/dist/core/ingestion/{resolvers → import-resolvers}/php.d.ts +6 -10
  76. package/dist/core/ingestion/{resolvers → import-resolvers}/php.js +7 -2
  77. package/dist/core/ingestion/{resolvers → import-resolvers}/python.d.ts +9 -3
  78. package/dist/core/ingestion/{resolvers → import-resolvers}/python.js +35 -3
  79. package/dist/core/ingestion/{resolvers → import-resolvers}/ruby.d.ts +5 -2
  80. package/dist/core/ingestion/{resolvers → import-resolvers}/ruby.js +7 -2
  81. package/dist/core/ingestion/{resolvers → import-resolvers}/rust.d.ts +5 -2
  82. package/dist/core/ingestion/{resolvers → import-resolvers}/rust.js +41 -2
  83. package/dist/core/ingestion/{resolvers → import-resolvers}/standard.d.ts +15 -7
  84. package/dist/core/ingestion/{resolvers → import-resolvers}/standard.js +22 -3
  85. package/dist/core/ingestion/import-resolvers/swift.d.ts +7 -0
  86. package/dist/core/ingestion/import-resolvers/swift.js +23 -0
  87. package/dist/core/ingestion/import-resolvers/types.d.ts +44 -0
  88. package/dist/core/ingestion/import-resolvers/types.js +6 -0
  89. package/dist/core/ingestion/{resolvers → import-resolvers}/utils.d.ts +0 -3
  90. package/dist/core/ingestion/{resolvers → import-resolvers}/utils.js +0 -9
  91. package/dist/core/ingestion/language-config.d.ts +4 -1
  92. package/dist/core/ingestion/language-provider.d.ts +121 -0
  93. package/dist/core/ingestion/language-provider.js +24 -0
  94. package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
  95. package/dist/core/ingestion/languages/c-cpp.js +71 -0
  96. package/dist/core/ingestion/languages/cobol.d.ts +1 -0
  97. package/dist/core/ingestion/languages/cobol.js +26 -0
  98. package/dist/core/ingestion/languages/csharp.d.ts +8 -0
  99. package/dist/core/ingestion/languages/csharp.js +49 -0
  100. package/dist/core/ingestion/languages/dart.d.ts +12 -0
  101. package/dist/core/ingestion/languages/dart.js +58 -0
  102. package/dist/core/ingestion/languages/go.d.ts +11 -0
  103. package/dist/core/ingestion/languages/go.js +28 -0
  104. package/dist/core/ingestion/languages/index.d.ts +38 -0
  105. package/dist/core/ingestion/languages/index.js +63 -0
  106. package/dist/core/ingestion/languages/java.d.ts +9 -0
  107. package/dist/core/ingestion/languages/java.js +29 -0
  108. package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
  109. package/dist/core/ingestion/languages/kotlin.js +53 -0
  110. package/dist/core/ingestion/languages/php.d.ts +8 -0
  111. package/dist/core/ingestion/languages/php.js +145 -0
  112. package/dist/core/ingestion/languages/python.d.ts +12 -0
  113. package/dist/core/ingestion/languages/python.js +39 -0
  114. package/dist/core/ingestion/languages/ruby.d.ts +9 -0
  115. package/dist/core/ingestion/languages/ruby.js +44 -0
  116. package/dist/core/ingestion/languages/rust.d.ts +12 -0
  117. package/dist/core/ingestion/languages/rust.js +44 -0
  118. package/dist/core/ingestion/languages/swift.d.ts +12 -0
  119. package/dist/core/ingestion/languages/swift.js +133 -0
  120. package/dist/core/ingestion/languages/typescript.d.ts +10 -0
  121. package/dist/core/ingestion/languages/typescript.js +60 -0
  122. package/dist/core/ingestion/mro-processor.js +14 -15
  123. package/dist/core/ingestion/{named-binding-extraction.d.ts → named-binding-processor.d.ts} +0 -9
  124. package/dist/core/ingestion/named-binding-processor.js +42 -0
  125. package/dist/core/ingestion/named-bindings/csharp.d.ts +3 -0
  126. package/dist/core/ingestion/named-bindings/csharp.js +37 -0
  127. package/dist/core/ingestion/named-bindings/java.d.ts +3 -0
  128. package/dist/core/ingestion/named-bindings/java.js +29 -0
  129. package/dist/core/ingestion/named-bindings/kotlin.d.ts +3 -0
  130. package/dist/core/ingestion/named-bindings/kotlin.js +36 -0
  131. package/dist/core/ingestion/named-bindings/php.d.ts +3 -0
  132. package/dist/core/ingestion/named-bindings/php.js +61 -0
  133. package/dist/core/ingestion/named-bindings/python.d.ts +3 -0
  134. package/dist/core/ingestion/named-bindings/python.js +49 -0
  135. package/dist/core/ingestion/named-bindings/rust.d.ts +3 -0
  136. package/dist/core/ingestion/named-bindings/rust.js +64 -0
  137. package/dist/core/ingestion/named-bindings/types.d.ts +16 -0
  138. package/dist/core/ingestion/named-bindings/types.js +6 -0
  139. package/dist/core/ingestion/named-bindings/typescript.d.ts +3 -0
  140. package/dist/core/ingestion/named-bindings/typescript.js +58 -0
  141. package/dist/core/ingestion/parsing-processor.d.ts +5 -1
  142. package/dist/core/ingestion/parsing-processor.js +115 -16
  143. package/dist/core/ingestion/pipeline.js +925 -424
  144. package/dist/core/ingestion/resolution-context.js +1 -1
  145. package/dist/core/ingestion/route-extractors/expo.d.ts +1 -0
  146. package/dist/core/ingestion/route-extractors/expo.js +36 -0
  147. package/dist/core/ingestion/route-extractors/middleware.d.ts +47 -0
  148. package/dist/core/ingestion/route-extractors/middleware.js +143 -0
  149. package/dist/core/ingestion/route-extractors/nextjs.d.ts +3 -0
  150. package/dist/core/ingestion/route-extractors/nextjs.js +76 -0
  151. package/dist/core/ingestion/route-extractors/php.d.ts +7 -0
  152. package/dist/core/ingestion/route-extractors/php.js +21 -0
  153. package/dist/core/ingestion/route-extractors/response-shapes.d.ts +20 -0
  154. package/dist/core/ingestion/route-extractors/response-shapes.js +290 -0
  155. package/dist/core/ingestion/tree-sitter-queries.d.ts +8 -7
  156. package/dist/core/ingestion/tree-sitter-queries.js +231 -9
  157. package/dist/core/ingestion/type-env.d.ts +14 -17
  158. package/dist/core/ingestion/type-env.js +66 -14
  159. package/dist/core/ingestion/type-extractors/c-cpp.d.ts +1 -1
  160. package/dist/core/ingestion/type-extractors/csharp.js +1 -1
  161. package/dist/core/ingestion/type-extractors/dart.d.ts +15 -0
  162. package/dist/core/ingestion/type-extractors/dart.js +371 -0
  163. package/dist/core/ingestion/type-extractors/jvm.js +1 -1
  164. package/dist/core/ingestion/type-extractors/shared.d.ts +1 -13
  165. package/dist/core/ingestion/type-extractors/shared.js +9 -102
  166. package/dist/core/ingestion/type-extractors/swift.js +334 -4
  167. package/dist/core/ingestion/type-extractors/types.d.ts +3 -1
  168. package/dist/core/ingestion/{ast-helpers.d.ts → utils/ast-helpers.d.ts} +16 -13
  169. package/dist/core/ingestion/{ast-helpers.js → utils/ast-helpers.js} +111 -32
  170. package/dist/core/ingestion/{call-analysis.js → utils/call-analysis.js} +37 -0
  171. package/dist/core/ingestion/utils/event-loop.d.ts +5 -0
  172. package/dist/core/ingestion/utils/event-loop.js +5 -0
  173. package/dist/core/ingestion/utils/language-detection.d.ts +9 -0
  174. package/dist/core/ingestion/utils/language-detection.js +70 -0
  175. package/dist/core/ingestion/utils/verbose.d.ts +1 -0
  176. package/dist/core/ingestion/utils/verbose.js +7 -0
  177. package/dist/core/ingestion/workers/parse-worker.d.ts +43 -2
  178. package/dist/core/ingestion/workers/parse-worker.js +361 -150
  179. package/dist/core/lbug/csv-generator.js +34 -1
  180. package/dist/core/lbug/lbug-adapter.js +6 -0
  181. package/dist/core/lbug/schema.d.ts +5 -3
  182. package/dist/core/lbug/schema.js +39 -2
  183. package/dist/core/tree-sitter/parser-loader.js +7 -1
  184. package/dist/core/wiki/cursor-client.d.ts +31 -0
  185. package/dist/core/wiki/cursor-client.js +127 -0
  186. package/dist/core/wiki/generator.d.ts +28 -9
  187. package/dist/core/wiki/generator.js +115 -18
  188. package/dist/core/wiki/graph-queries.d.ts +4 -0
  189. package/dist/core/wiki/graph-queries.js +7 -1
  190. package/dist/core/wiki/llm-client.d.ts +2 -0
  191. package/dist/core/wiki/llm-client.js +8 -4
  192. package/dist/core/wiki/prompts.d.ts +3 -3
  193. package/dist/core/wiki/prompts.js +6 -0
  194. package/dist/mcp/core/lbug-adapter.d.ts +5 -0
  195. package/dist/mcp/core/lbug-adapter.js +11 -1
  196. package/dist/mcp/local/local-backend.d.ts +16 -5
  197. package/dist/mcp/local/local-backend.js +711 -74
  198. package/dist/mcp/tools.js +71 -2
  199. package/dist/storage/repo-manager.d.ts +3 -0
  200. package/package.json +14 -14
  201. package/dist/core/ingestion/import-resolution.d.ts +0 -101
  202. package/dist/core/ingestion/import-resolution.js +0 -251
  203. package/dist/core/ingestion/named-binding-extraction.js +0 -373
  204. package/dist/core/ingestion/resolvers/index.d.ts +0 -18
  205. package/dist/core/ingestion/resolvers/index.js +0 -13
  206. package/dist/core/ingestion/type-extractors/index.d.ts +0 -22
  207. package/dist/core/ingestion/type-extractors/index.js +0 -31
  208. package/dist/core/ingestion/utils.d.ts +0 -20
  209. package/dist/core/ingestion/utils.js +0 -242
  210. package/scripts/patch-tree-sitter-swift.cjs +0 -74
  211. /package/dist/core/ingestion/{call-analysis.d.ts → utils/call-analysis.d.ts} +0 -0
@@ -1,242 +0,0 @@
1
- import { SupportedLanguages } from '../../config/supported-languages.js';
2
- /**
3
- * Built-in function/method names that should not be tracked as call targets.
4
- * Covers JS/TS, Python, Kotlin, C/C++, PHP, Swift standard library functions.
5
- */
6
- export const BUILT_IN_NAMES = new Set([
7
- // JavaScript/TypeScript
8
- 'console', 'log', 'warn', 'error', 'info', 'debug',
9
- 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
10
- 'parseInt', 'parseFloat', 'isNaN', 'isFinite',
11
- 'encodeURI', 'decodeURI', 'encodeURIComponent', 'decodeURIComponent',
12
- 'JSON', 'parse', 'stringify',
13
- 'Object', 'Array', 'String', 'Number', 'Boolean', 'Symbol', 'BigInt',
14
- 'Map', 'Set', 'WeakMap', 'WeakSet',
15
- 'Promise', 'resolve', 'reject', 'then', 'catch', 'finally',
16
- 'Math', 'Date', 'RegExp', 'Error',
17
- 'require', 'import', 'export', 'fetch', 'Response', 'Request',
18
- 'useState', 'useEffect', 'useCallback', 'useMemo', 'useRef', 'useContext',
19
- 'useReducer', 'useLayoutEffect', 'useImperativeHandle', 'useDebugValue',
20
- 'createElement', 'createContext', 'createRef', 'forwardRef', 'memo', 'lazy',
21
- 'map', 'filter', 'reduce', 'forEach', 'find', 'findIndex', 'some', 'every',
22
- 'includes', 'indexOf', 'slice', 'splice', 'concat', 'join', 'split',
23
- 'push', 'pop', 'shift', 'unshift', 'sort', 'reverse',
24
- 'keys', 'values', 'entries', 'assign', 'freeze', 'seal',
25
- 'hasOwnProperty', 'toString', 'valueOf',
26
- // Python
27
- 'print', 'len', 'range', 'str', 'int', 'float', 'list', 'dict', 'set', 'tuple',
28
- 'append', 'extend', 'update',
29
- // NOTE: 'open', 'read', 'write', 'close' removed — these are real C POSIX syscalls
30
- 'type', 'isinstance', 'issubclass', 'getattr', 'setattr', 'hasattr',
31
- 'enumerate', 'zip', 'sorted', 'reversed', 'min', 'max', 'sum', 'abs',
32
- // Kotlin stdlib
33
- 'println', 'print', 'readLine', 'require', 'requireNotNull', 'check', 'assert', 'lazy', 'error',
34
- 'listOf', 'mapOf', 'setOf', 'mutableListOf', 'mutableMapOf', 'mutableSetOf',
35
- 'arrayOf', 'sequenceOf', 'also', 'apply', 'run', 'with', 'takeIf', 'takeUnless',
36
- 'TODO', 'buildString', 'buildList', 'buildMap', 'buildSet',
37
- 'repeat', 'synchronized',
38
- // Kotlin coroutine builders & scope functions
39
- 'launch', 'async', 'runBlocking', 'withContext', 'coroutineScope',
40
- 'supervisorScope', 'delay',
41
- // Kotlin Flow operators
42
- 'flow', 'flowOf', 'collect', 'emit', 'onEach', 'catch',
43
- 'buffer', 'conflate', 'distinctUntilChanged',
44
- 'flatMapLatest', 'flatMapMerge', 'combine',
45
- 'stateIn', 'shareIn', 'launchIn',
46
- // Kotlin infix stdlib functions
47
- 'to', 'until', 'downTo', 'step',
48
- // C/C++ standard library
49
- 'printf', 'fprintf', 'sprintf', 'snprintf', 'vprintf', 'vfprintf', 'vsprintf', 'vsnprintf',
50
- 'scanf', 'fscanf', 'sscanf',
51
- 'malloc', 'calloc', 'realloc', 'free', 'memcpy', 'memmove', 'memset', 'memcmp',
52
- 'strlen', 'strcpy', 'strncpy', 'strcat', 'strncat', 'strcmp', 'strncmp', 'strstr', 'strchr', 'strrchr',
53
- 'atoi', 'atol', 'atof', 'strtol', 'strtoul', 'strtoll', 'strtoull', 'strtod',
54
- 'sizeof', 'offsetof', 'typeof',
55
- 'assert', 'abort', 'exit', '_exit',
56
- 'fopen', 'fclose', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind', 'fflush', 'fgets', 'fputs',
57
- // Linux kernel common macros/helpers (not real call targets)
58
- 'likely', 'unlikely', 'BUG', 'BUG_ON', 'WARN', 'WARN_ON', 'WARN_ONCE',
59
- 'IS_ERR', 'PTR_ERR', 'ERR_PTR', 'IS_ERR_OR_NULL',
60
- 'ARRAY_SIZE', 'container_of', 'list_for_each_entry', 'list_for_each_entry_safe',
61
- 'min', 'max', 'clamp', 'abs', 'swap',
62
- 'pr_info', 'pr_warn', 'pr_err', 'pr_debug', 'pr_notice', 'pr_crit', 'pr_emerg',
63
- 'printk', 'dev_info', 'dev_warn', 'dev_err', 'dev_dbg',
64
- 'GFP_KERNEL', 'GFP_ATOMIC',
65
- 'spin_lock', 'spin_unlock', 'spin_lock_irqsave', 'spin_unlock_irqrestore',
66
- 'mutex_lock', 'mutex_unlock', 'mutex_init',
67
- 'kfree', 'kmalloc', 'kzalloc', 'kcalloc', 'krealloc', 'kvmalloc', 'kvfree',
68
- 'get', 'put',
69
- // C# / .NET built-ins
70
- 'Console', 'WriteLine', 'ReadLine', 'Write',
71
- 'Task', 'Run', 'Wait', 'WhenAll', 'WhenAny', 'FromResult', 'Delay', 'ContinueWith',
72
- 'ConfigureAwait', 'GetAwaiter', 'GetResult',
73
- 'ToString', 'GetType', 'Equals', 'GetHashCode', 'ReferenceEquals',
74
- 'Add', 'Remove', 'Contains', 'Clear', 'Count', 'Any', 'All',
75
- 'Where', 'Select', 'SelectMany', 'OrderBy', 'OrderByDescending', 'GroupBy',
76
- 'First', 'FirstOrDefault', 'Single', 'SingleOrDefault', 'Last', 'LastOrDefault',
77
- 'ToList', 'ToArray', 'ToDictionary', 'AsEnumerable', 'AsQueryable',
78
- 'Aggregate', 'Sum', 'Average', 'Min', 'Max', 'Distinct', 'Skip', 'Take',
79
- 'String', 'Format', 'IsNullOrEmpty', 'IsNullOrWhiteSpace', 'Concat', 'Join',
80
- 'Trim', 'TrimStart', 'TrimEnd', 'Split', 'Replace', 'StartsWith', 'EndsWith',
81
- 'Convert', 'ToInt32', 'ToDouble', 'ToBoolean', 'ToByte',
82
- 'Math', 'Abs', 'Ceiling', 'Floor', 'Round', 'Pow', 'Sqrt',
83
- 'Dispose', 'Close',
84
- 'TryParse', 'Parse',
85
- 'AddRange', 'RemoveAt', 'RemoveAll', 'FindAll', 'Exists', 'TrueForAll',
86
- 'ContainsKey', 'TryGetValue', 'AddOrUpdate',
87
- 'Throw', 'ThrowIfNull',
88
- // PHP built-ins
89
- 'echo', 'isset', 'empty', 'unset', 'list', 'array', 'compact', 'extract',
90
- 'count', 'strlen', 'strpos', 'strrpos', 'substr', 'strtolower', 'strtoupper', 'trim',
91
- 'ltrim', 'rtrim', 'str_replace', 'str_contains', 'str_starts_with', 'str_ends_with',
92
- 'sprintf', 'vsprintf', 'printf', 'number_format',
93
- 'array_map', 'array_filter', 'array_reduce', 'array_push', 'array_pop', 'array_shift',
94
- 'array_unshift', 'array_slice', 'array_splice', 'array_merge', 'array_keys', 'array_values',
95
- 'array_key_exists', 'in_array', 'array_search', 'array_unique', 'usort', 'rsort',
96
- 'json_encode', 'json_decode', 'serialize', 'unserialize',
97
- 'intval', 'floatval', 'strval', 'boolval', 'is_null', 'is_string', 'is_int', 'is_array',
98
- 'is_object', 'is_numeric', 'is_bool', 'is_float',
99
- 'var_dump', 'print_r', 'var_export',
100
- 'date', 'time', 'strtotime', 'mktime', 'microtime',
101
- 'file_exists', 'file_get_contents', 'file_put_contents', 'is_file', 'is_dir',
102
- 'preg_match', 'preg_match_all', 'preg_replace', 'preg_split',
103
- 'header', 'session_start', 'session_destroy', 'ob_start', 'ob_end_clean', 'ob_get_clean',
104
- 'dd', 'dump',
105
- // Swift/iOS built-ins and standard library
106
- 'print', 'debugPrint', 'dump', 'fatalError', 'precondition', 'preconditionFailure',
107
- 'assert', 'assertionFailure', 'NSLog',
108
- 'abs', 'min', 'max', 'zip', 'stride', 'sequence', 'repeatElement',
109
- 'swap', 'withUnsafePointer', 'withUnsafeMutablePointer', 'withUnsafeBytes',
110
- 'autoreleasepool', 'unsafeBitCast', 'unsafeDowncast', 'numericCast',
111
- 'type', 'MemoryLayout',
112
- // Swift collection/string methods (common noise)
113
- 'map', 'flatMap', 'compactMap', 'filter', 'reduce', 'forEach', 'contains',
114
- 'first', 'last', 'prefix', 'suffix', 'dropFirst', 'dropLast',
115
- 'sorted', 'reversed', 'enumerated', 'joined', 'split',
116
- 'append', 'insert', 'remove', 'removeAll', 'removeFirst', 'removeLast',
117
- 'isEmpty', 'count', 'index', 'startIndex', 'endIndex',
118
- // UIKit/Foundation common methods (noise in call graph)
119
- 'addSubview', 'removeFromSuperview', 'layoutSubviews', 'setNeedsLayout',
120
- 'layoutIfNeeded', 'setNeedsDisplay', 'invalidateIntrinsicContentSize',
121
- 'addTarget', 'removeTarget', 'addGestureRecognizer',
122
- 'addConstraint', 'addConstraints', 'removeConstraint', 'removeConstraints',
123
- 'NSLocalizedString', 'Bundle',
124
- 'reloadData', 'reloadSections', 'reloadRows', 'performBatchUpdates',
125
- 'register', 'dequeueReusableCell', 'dequeueReusableSupplementaryView',
126
- 'beginUpdates', 'endUpdates', 'insertRows', 'deleteRows', 'insertSections', 'deleteSections',
127
- 'present', 'dismiss', 'pushViewController', 'popViewController', 'popToRootViewController',
128
- 'performSegue', 'prepare',
129
- // GCD / async
130
- 'DispatchQueue', 'async', 'sync', 'asyncAfter',
131
- 'Task', 'withCheckedContinuation', 'withCheckedThrowingContinuation',
132
- // Combine
133
- 'sink', 'store', 'assign', 'receive', 'subscribe',
134
- // Notification / KVO
135
- 'addObserver', 'removeObserver', 'post', 'NotificationCenter',
136
- // Rust standard library (common noise in call graphs)
137
- 'unwrap', 'expect', 'unwrap_or', 'unwrap_or_else', 'unwrap_or_default',
138
- 'ok', 'err', 'is_ok', 'is_err', 'map', 'map_err', 'and_then', 'or_else',
139
- 'clone', 'to_string', 'to_owned', 'into', 'from', 'as_ref', 'as_mut',
140
- 'iter', 'into_iter', 'collect', 'map', 'filter', 'fold', 'for_each',
141
- 'len', 'is_empty', 'push', 'pop', 'insert', 'remove', 'contains',
142
- 'format', 'write', 'writeln', 'panic', 'unreachable', 'todo', 'unimplemented',
143
- 'vec', 'println', 'eprintln', 'dbg',
144
- 'lock', 'read', 'write', 'try_lock',
145
- 'spawn', 'join', 'sleep',
146
- 'Some', 'None', 'Ok', 'Err',
147
- // Ruby built-ins and Kernel methods
148
- 'puts', 'p', 'pp', 'raise', 'fail',
149
- 'require', 'require_relative', 'load', 'autoload',
150
- 'include', 'extend', 'prepend',
151
- 'attr_accessor', 'attr_reader', 'attr_writer',
152
- 'public', 'private', 'protected', 'module_function',
153
- 'lambda', 'proc', 'block_given?',
154
- 'nil?', 'is_a?', 'kind_of?', 'instance_of?', 'respond_to?',
155
- 'freeze', 'frozen?', 'dup', 'tap', 'yield_self',
156
- // Ruby enumerables
157
- 'each', 'select', 'reject', 'detect', 'collect',
158
- 'inject', 'flat_map', 'each_with_object', 'each_with_index',
159
- 'any?', 'all?', 'none?', 'count', 'first', 'last',
160
- 'sort_by', 'min_by', 'max_by',
161
- 'group_by', 'partition', 'compact', 'flatten', 'uniq',
162
- ]);
163
- /** Check if a name is a built-in function or common noise that should be filtered out */
164
- export const isBuiltInOrNoise = (name) => BUILT_IN_NAMES.has(name);
165
- /**
166
- * Yield control to the event loop so spinners/progress can render.
167
- * Call periodically in hot loops to prevent UI freezes.
168
- */
169
- export const yieldToEventLoop = () => new Promise(resolve => setImmediate(resolve));
170
- /** Ruby extensionless filenames recognised as Ruby source */
171
- const RUBY_EXTENSIONLESS_FILES = new Set(['Rakefile', 'Gemfile', 'Guardfile', 'Vagrantfile', 'Brewfile']);
172
- /**
173
- * Map file extension to SupportedLanguage enum
174
- */
175
- export const getLanguageFromFilename = (filename) => {
176
- // TypeScript (including TSX)
177
- if (filename.endsWith('.tsx'))
178
- return SupportedLanguages.TypeScript;
179
- if (filename.endsWith('.ts'))
180
- return SupportedLanguages.TypeScript;
181
- // JavaScript (including JSX)
182
- if (filename.endsWith('.jsx'))
183
- return SupportedLanguages.JavaScript;
184
- if (filename.endsWith('.js'))
185
- return SupportedLanguages.JavaScript;
186
- // Python
187
- if (filename.endsWith('.py'))
188
- return SupportedLanguages.Python;
189
- // Java
190
- if (filename.endsWith('.java'))
191
- return SupportedLanguages.Java;
192
- // C source files
193
- if (filename.endsWith('.c'))
194
- return SupportedLanguages.C;
195
- // C++ (all common extensions, including .h)
196
- // .h is parsed as C++ because tree-sitter-cpp is a strict superset of C, so pure-C
197
- // headers parse correctly, and C++ headers (classes, templates) are handled properly.
198
- if (filename.endsWith('.cpp') || filename.endsWith('.cc') || filename.endsWith('.cxx') ||
199
- filename.endsWith('.h') || filename.endsWith('.hpp') || filename.endsWith('.hxx') || filename.endsWith('.hh'))
200
- return SupportedLanguages.CPlusPlus;
201
- // C#
202
- if (filename.endsWith('.cs'))
203
- return SupportedLanguages.CSharp;
204
- // Go
205
- if (filename.endsWith('.go'))
206
- return SupportedLanguages.Go;
207
- // Rust
208
- if (filename.endsWith('.rs'))
209
- return SupportedLanguages.Rust;
210
- // Kotlin
211
- if (filename.endsWith('.kt') || filename.endsWith('.kts'))
212
- return SupportedLanguages.Kotlin;
213
- // PHP (all common extensions)
214
- if (filename.endsWith('.php') || filename.endsWith('.phtml') ||
215
- filename.endsWith('.php3') || filename.endsWith('.php4') ||
216
- filename.endsWith('.php5') || filename.endsWith('.php8')) {
217
- return SupportedLanguages.PHP;
218
- }
219
- // Ruby (extensions)
220
- if (filename.endsWith('.rb') || filename.endsWith('.rake') || filename.endsWith('.gemspec')) {
221
- return SupportedLanguages.Ruby;
222
- }
223
- // Ruby (extensionless files)
224
- const basename = filename.split('/').pop() || filename;
225
- if (RUBY_EXTENSIONLESS_FILES.has(basename)) {
226
- return SupportedLanguages.Ruby;
227
- }
228
- // Swift (extensions)
229
- if (filename.endsWith('.swift'))
230
- return SupportedLanguages.Swift;
231
- return null;
232
- };
233
- export const isVerboseIngestionEnabled = () => {
234
- const raw = process.env.GITNEXUS_VERBOSE;
235
- if (!raw)
236
- return false;
237
- const value = raw.toLowerCase();
238
- return value === '1' || value === 'true' || value === 'yes';
239
- };
240
- // Re-exports for backward compatibility
241
- export * from './ast-helpers.js';
242
- export * from './call-analysis.js';
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * WORKAROUND: tree-sitter-swift@0.6.0 binding.gyp build failure
4
- *
5
- * Background:
6
- * tree-sitter-swift@0.6.0's binding.gyp contains an "actions" array that
7
- * invokes `tree-sitter generate` to regenerate parser.c from grammar.js.
8
- * This is intended for grammar developers, but the published npm package
9
- * already ships pre-generated parser files (parser.c, scanner.c), so the
10
- * actions are unnecessary for consumers. Since consumers don't have
11
- * tree-sitter-cli installed, the actions always fail during `npm install`.
12
- *
13
- * Why we can't just upgrade:
14
- * tree-sitter-swift@0.7.1 fixes this (removes postinstall, ships prebuilds),
15
- * but it requires tree-sitter@^0.22.1. The upstream project pins tree-sitter
16
- * to ^0.21.0 and all other grammar packages depend on that version.
17
- * Upgrading tree-sitter would be a separate breaking change.
18
- *
19
- * How this workaround works:
20
- * 1. tree-sitter-swift's own postinstall fails (npm warns but continues)
21
- * 2. This script runs as gitnexus's postinstall
22
- * 3. It removes the "actions" array from binding.gyp
23
- * 4. It rebuilds the native binding with the cleaned binding.gyp
24
- *
25
- * TODO: Remove this script when tree-sitter is upgraded to ^0.22.x,
26
- * which allows using tree-sitter-swift@0.7.1+ directly.
27
- */
28
- const fs = require('fs');
29
- const path = require('path');
30
- const { execSync } = require('child_process');
31
-
32
- const swiftDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-swift');
33
- const bindingPath = path.join(swiftDir, 'binding.gyp');
34
-
35
- try {
36
- if (!fs.existsSync(bindingPath)) {
37
- process.exit(0);
38
- }
39
-
40
- const content = fs.readFileSync(bindingPath, 'utf8');
41
- let needsRebuild = false;
42
-
43
- if (content.includes('"actions"')) {
44
- // Strip Python-style comments (#) before JSON parsing
45
- const cleaned = content.replace(/#[^\n]*/g, '');
46
- const gyp = JSON.parse(cleaned);
47
-
48
- if (gyp.targets && gyp.targets[0] && gyp.targets[0].actions) {
49
- delete gyp.targets[0].actions;
50
- fs.writeFileSync(bindingPath, JSON.stringify(gyp, null, 2) + '\n');
51
- console.log('[tree-sitter-swift] Patched binding.gyp (removed actions array)');
52
- needsRebuild = true;
53
- }
54
- }
55
-
56
- // Check if native binding exists
57
- const bindingNode = path.join(swiftDir, 'build', 'Release', 'tree_sitter_swift_binding.node');
58
- if (!fs.existsSync(bindingNode)) {
59
- needsRebuild = true;
60
- }
61
-
62
- if (needsRebuild) {
63
- console.log('[tree-sitter-swift] Rebuilding native binding...');
64
- execSync('npx node-gyp rebuild', {
65
- cwd: swiftDir,
66
- stdio: 'pipe',
67
- timeout: 120000,
68
- });
69
- console.log('[tree-sitter-swift] Native binding built successfully');
70
- }
71
- } catch (err) {
72
- console.warn('[tree-sitter-swift] Could not build native binding:', err.message);
73
- console.warn('[tree-sitter-swift] You may need to manually run: cd node_modules/tree-sitter-swift && npx node-gyp rebuild');
74
- }