@grafema/core 0.1.1-alpha → 0.2.0-beta

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 (319) hide show
  1. package/dist/Orchestrator.d.ts +7 -0
  2. package/dist/Orchestrator.d.ts.map +1 -1
  3. package/dist/Orchestrator.js +25 -3
  4. package/dist/config/ConfigLoader.d.ts +18 -0
  5. package/dist/config/ConfigLoader.d.ts.map +1 -1
  6. package/dist/config/ConfigLoader.js +65 -3
  7. package/dist/core/FileExplainer.d.ts +101 -0
  8. package/dist/core/FileExplainer.d.ts.map +1 -0
  9. package/dist/core/FileExplainer.js +139 -0
  10. package/dist/core/NodeFactory.d.ts +44 -5
  11. package/dist/core/NodeFactory.d.ts.map +1 -1
  12. package/dist/core/NodeFactory.js +52 -7
  13. package/dist/core/nodes/ArrayLiteralNode.d.ts.map +1 -1
  14. package/dist/core/nodes/ArrayLiteralNode.js +4 -2
  15. package/dist/core/nodes/BranchNode.d.ts +41 -0
  16. package/dist/core/nodes/BranchNode.d.ts.map +1 -0
  17. package/dist/core/nodes/BranchNode.js +82 -0
  18. package/dist/core/nodes/CallSiteNode.d.ts +2 -2
  19. package/dist/core/nodes/CallSiteNode.d.ts.map +1 -1
  20. package/dist/core/nodes/CallSiteNode.js +9 -5
  21. package/dist/core/nodes/CaseNode.d.ts +43 -0
  22. package/dist/core/nodes/CaseNode.d.ts.map +1 -0
  23. package/dist/core/nodes/CaseNode.js +81 -0
  24. package/dist/core/nodes/ClassNode.d.ts +2 -2
  25. package/dist/core/nodes/ClassNode.d.ts.map +1 -1
  26. package/dist/core/nodes/ClassNode.js +8 -4
  27. package/dist/core/nodes/ConstantNode.d.ts +2 -2
  28. package/dist/core/nodes/ConstantNode.d.ts.map +1 -1
  29. package/dist/core/nodes/ConstantNode.js +6 -4
  30. package/dist/core/nodes/ConstructorCallNode.d.ts +51 -0
  31. package/dist/core/nodes/ConstructorCallNode.d.ts.map +1 -0
  32. package/dist/core/nodes/ConstructorCallNode.js +171 -0
  33. package/dist/core/nodes/DatabaseQueryNode.d.ts +3 -2
  34. package/dist/core/nodes/DatabaseQueryNode.d.ts.map +1 -1
  35. package/dist/core/nodes/DatabaseQueryNode.js +5 -2
  36. package/dist/core/nodes/DecoratorNode.d.ts +2 -2
  37. package/dist/core/nodes/DecoratorNode.d.ts.map +1 -1
  38. package/dist/core/nodes/DecoratorNode.js +5 -3
  39. package/dist/core/nodes/EnumNode.d.ts +2 -2
  40. package/dist/core/nodes/EnumNode.d.ts.map +1 -1
  41. package/dist/core/nodes/EnumNode.js +5 -3
  42. package/dist/core/nodes/EventListenerNode.d.ts +4 -4
  43. package/dist/core/nodes/EventListenerNode.d.ts.map +1 -1
  44. package/dist/core/nodes/EventListenerNode.js +7 -4
  45. package/dist/core/nodes/ExportNode.d.ts +2 -2
  46. package/dist/core/nodes/ExportNode.d.ts.map +1 -1
  47. package/dist/core/nodes/ExportNode.js +8 -4
  48. package/dist/core/nodes/ExpressionNode.d.ts +2 -2
  49. package/dist/core/nodes/ExpressionNode.d.ts.map +1 -1
  50. package/dist/core/nodes/ExpressionNode.js +6 -4
  51. package/dist/core/nodes/ExternalModuleNode.d.ts +4 -0
  52. package/dist/core/nodes/ExternalModuleNode.d.ts.map +1 -1
  53. package/dist/core/nodes/ExternalModuleNode.js +10 -2
  54. package/dist/core/nodes/HttpRequestNode.d.ts +4 -4
  55. package/dist/core/nodes/HttpRequestNode.d.ts.map +1 -1
  56. package/dist/core/nodes/HttpRequestNode.js +7 -4
  57. package/dist/core/nodes/ImportNode.d.ts +10 -2
  58. package/dist/core/nodes/ImportNode.d.ts.map +1 -1
  59. package/dist/core/nodes/ImportNode.js +21 -4
  60. package/dist/core/nodes/InterfaceNode.d.ts +2 -2
  61. package/dist/core/nodes/InterfaceNode.d.ts.map +1 -1
  62. package/dist/core/nodes/InterfaceNode.js +5 -3
  63. package/dist/core/nodes/LiteralNode.d.ts +2 -2
  64. package/dist/core/nodes/LiteralNode.d.ts.map +1 -1
  65. package/dist/core/nodes/LiteralNode.js +6 -4
  66. package/dist/core/nodes/MethodCallNode.d.ts +2 -2
  67. package/dist/core/nodes/MethodCallNode.d.ts.map +1 -1
  68. package/dist/core/nodes/MethodCallNode.js +9 -5
  69. package/dist/core/nodes/MethodNode.d.ts +2 -2
  70. package/dist/core/nodes/MethodNode.d.ts.map +1 -1
  71. package/dist/core/nodes/MethodNode.js +8 -4
  72. package/dist/core/nodes/ObjectLiteralNode.d.ts.map +1 -1
  73. package/dist/core/nodes/ObjectLiteralNode.js +4 -2
  74. package/dist/core/nodes/ParameterNode.d.ts +2 -2
  75. package/dist/core/nodes/ParameterNode.d.ts.map +1 -1
  76. package/dist/core/nodes/ParameterNode.js +5 -3
  77. package/dist/core/nodes/TypeNode.d.ts +2 -2
  78. package/dist/core/nodes/TypeNode.d.ts.map +1 -1
  79. package/dist/core/nodes/TypeNode.js +5 -3
  80. package/dist/core/nodes/VariableDeclarationNode.d.ts +2 -2
  81. package/dist/core/nodes/VariableDeclarationNode.d.ts.map +1 -1
  82. package/dist/core/nodes/VariableDeclarationNode.js +9 -5
  83. package/dist/core/nodes/index.d.ts +3 -0
  84. package/dist/core/nodes/index.d.ts.map +1 -1
  85. package/dist/core/nodes/index.js +3 -0
  86. package/dist/data/builtins/BuiltinRegistry.d.ts +78 -0
  87. package/dist/data/builtins/BuiltinRegistry.d.ts.map +1 -0
  88. package/dist/data/builtins/BuiltinRegistry.js +110 -0
  89. package/dist/data/builtins/definitions.d.ts +28 -0
  90. package/dist/data/builtins/definitions.d.ts.map +1 -0
  91. package/dist/data/builtins/definitions.js +250 -0
  92. package/dist/data/builtins/index.d.ts +10 -0
  93. package/dist/data/builtins/index.d.ts.map +1 -0
  94. package/dist/data/builtins/index.js +8 -0
  95. package/dist/data/builtins/jsGlobals.d.ts +18 -0
  96. package/dist/data/builtins/jsGlobals.d.ts.map +1 -0
  97. package/dist/data/builtins/jsGlobals.js +26 -0
  98. package/dist/data/builtins/types.d.ts +34 -0
  99. package/dist/data/builtins/types.d.ts.map +1 -0
  100. package/dist/data/builtins/types.js +7 -0
  101. package/dist/data/globals/definitions.d.ts +27 -0
  102. package/dist/data/globals/definitions.d.ts.map +1 -0
  103. package/dist/data/globals/definitions.js +117 -0
  104. package/dist/data/globals/index.d.ts +36 -0
  105. package/dist/data/globals/index.d.ts.map +1 -0
  106. package/dist/data/globals/index.js +52 -0
  107. package/dist/diagnostics/DiagnosticReporter.d.ts +23 -0
  108. package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
  109. package/dist/diagnostics/DiagnosticReporter.js +88 -0
  110. package/dist/diagnostics/index.d.ts +1 -1
  111. package/dist/diagnostics/index.d.ts.map +1 -1
  112. package/dist/errors/GrafemaError.d.ts +43 -0
  113. package/dist/errors/GrafemaError.d.ts.map +1 -1
  114. package/dist/errors/GrafemaError.js +50 -0
  115. package/dist/index.d.ts +17 -1
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +17 -1
  118. package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
  119. package/dist/plugins/analysis/DatabaseAnalyzer.js +3 -2
  120. package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
  121. package/dist/plugins/analysis/ExpressAnalyzer.js +3 -1
  122. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +148 -0
  123. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -0
  124. package/dist/plugins/analysis/ExpressResponseAnalyzer.js +495 -0
  125. package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
  126. package/dist/plugins/analysis/ExpressRouteAnalyzer.js +53 -18
  127. package/dist/plugins/analysis/FetchAnalyzer.d.ts +40 -0
  128. package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
  129. package/dist/plugins/analysis/FetchAnalyzer.js +163 -15
  130. package/dist/plugins/analysis/JSASTAnalyzer.d.ts +157 -26
  131. package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
  132. package/dist/plugins/analysis/JSASTAnalyzer.js +2418 -191
  133. package/dist/plugins/analysis/RustAnalyzer.js +4 -4
  134. package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
  135. package/dist/plugins/analysis/SQLiteAnalyzer.js +4 -2
  136. package/dist/plugins/analysis/SocketIOAnalyzer.d.ts +9 -0
  137. package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
  138. package/dist/plugins/analysis/SocketIOAnalyzer.js +91 -7
  139. package/dist/plugins/analysis/ast/GraphBuilder.d.ts +173 -0
  140. package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
  141. package/dist/plugins/analysis/ast/GraphBuilder.js +1256 -65
  142. package/dist/plugins/analysis/ast/types.d.ts +294 -0
  143. package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
  144. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +5 -1
  145. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
  146. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +1 -0
  147. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
  148. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +12 -1
  149. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +10 -0
  150. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
  151. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +62 -0
  152. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts +4 -0
  153. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts.map +1 -1
  154. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +101 -0
  155. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +16 -1
  156. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
  157. package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +233 -39
  158. package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
  159. package/dist/plugins/discovery/WorkspaceDiscovery.js +9 -4
  160. package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
  161. package/dist/plugins/enrichment/AliasTracker.js +16 -1
  162. package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts +32 -0
  163. package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -0
  164. package/dist/plugins/enrichment/ArgumentParameterLinker.js +175 -0
  165. package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts +51 -0
  166. package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -0
  167. package/dist/plugins/enrichment/ClosureCaptureEnricher.js +205 -0
  168. package/dist/plugins/enrichment/ExternalCallResolver.d.ts +42 -0
  169. package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -0
  170. package/dist/plugins/enrichment/ExternalCallResolver.js +213 -0
  171. package/dist/plugins/enrichment/FunctionCallResolver.d.ts +58 -0
  172. package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -0
  173. package/dist/plugins/enrichment/FunctionCallResolver.js +340 -0
  174. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +16 -3
  175. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
  176. package/dist/plugins/enrichment/HTTPConnectionEnricher.js +64 -20
  177. package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
  178. package/dist/plugins/enrichment/MethodCallResolver.js +15 -1
  179. package/dist/plugins/enrichment/MountPointResolver.d.ts +14 -12
  180. package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
  181. package/dist/plugins/enrichment/MountPointResolver.js +172 -151
  182. package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts +44 -0
  183. package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -0
  184. package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +271 -0
  185. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +5 -27
  186. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
  187. package/dist/plugins/enrichment/ValueDomainAnalyzer.js +62 -139
  188. package/dist/plugins/indexing/JSModuleIndexer.d.ts +15 -0
  189. package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
  190. package/dist/plugins/indexing/JSModuleIndexer.js +58 -0
  191. package/dist/plugins/indexing/RustModuleIndexer.d.ts +1 -1
  192. package/dist/plugins/indexing/RustModuleIndexer.js +4 -4
  193. package/dist/plugins/validation/BrokenImportValidator.d.ts +31 -0
  194. package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -0
  195. package/dist/plugins/validation/BrokenImportValidator.js +249 -0
  196. package/dist/plugins/validation/CallResolverValidator.d.ts +21 -10
  197. package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
  198. package/dist/plugins/validation/CallResolverValidator.js +101 -76
  199. package/dist/plugins/validation/DataFlowValidator.d.ts.map +1 -1
  200. package/dist/plugins/validation/DataFlowValidator.js +49 -41
  201. package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
  202. package/dist/plugins/validation/GraphConnectivityValidator.js +25 -1
  203. package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
  204. package/dist/plugins/validation/SQLInjectionValidator.js +2 -3
  205. package/dist/queries/findCallsInFunction.d.ts +52 -0
  206. package/dist/queries/findCallsInFunction.d.ts.map +1 -0
  207. package/dist/queries/findCallsInFunction.js +135 -0
  208. package/dist/queries/findContainingFunction.d.ts +45 -0
  209. package/dist/queries/findContainingFunction.d.ts.map +1 -0
  210. package/dist/queries/findContainingFunction.js +54 -0
  211. package/dist/queries/index.d.ts +14 -0
  212. package/dist/queries/index.d.ts.map +1 -0
  213. package/dist/queries/index.js +11 -0
  214. package/dist/queries/traceValues.d.ts +70 -0
  215. package/dist/queries/traceValues.d.ts.map +1 -0
  216. package/dist/queries/traceValues.js +299 -0
  217. package/dist/queries/types.d.ts +163 -0
  218. package/dist/queries/types.d.ts.map +1 -0
  219. package/dist/queries/types.js +9 -0
  220. package/dist/schema/GraphSchemaExtractor.d.ts +53 -0
  221. package/dist/schema/GraphSchemaExtractor.d.ts.map +1 -0
  222. package/dist/schema/GraphSchemaExtractor.js +124 -0
  223. package/dist/schema/InterfaceSchemaExtractor.d.ts +73 -0
  224. package/dist/schema/InterfaceSchemaExtractor.d.ts.map +1 -0
  225. package/dist/schema/InterfaceSchemaExtractor.js +112 -0
  226. package/dist/schema/index.d.ts +5 -0
  227. package/dist/schema/index.d.ts.map +1 -0
  228. package/dist/schema/index.js +2 -0
  229. package/dist/storage/backends/RFDBServerBackend.d.ts +12 -18
  230. package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
  231. package/dist/storage/backends/RFDBServerBackend.js +41 -52
  232. package/dist/storage/backends/typeValidation.d.ts.map +1 -1
  233. package/dist/storage/backends/typeValidation.js +1 -0
  234. package/package.json +3 -3
  235. package/src/Orchestrator.ts +35 -3
  236. package/src/config/ConfigLoader.ts +94 -3
  237. package/src/core/FileExplainer.ts +179 -0
  238. package/src/core/NodeFactory.ts +72 -8
  239. package/src/core/nodes/ArrayLiteralNode.ts +3 -2
  240. package/src/core/nodes/BranchNode.ts +113 -0
  241. package/src/core/nodes/CallSiteNode.ts +7 -5
  242. package/src/core/nodes/CaseNode.ts +123 -0
  243. package/src/core/nodes/ClassNode.ts +6 -4
  244. package/src/core/nodes/ConstantNode.ts +5 -4
  245. package/src/core/nodes/ConstructorCallNode.ts +217 -0
  246. package/src/core/nodes/DatabaseQueryNode.ts +5 -1
  247. package/src/core/nodes/DecoratorNode.ts +4 -3
  248. package/src/core/nodes/EnumNode.ts +4 -3
  249. package/src/core/nodes/EventListenerNode.ts +7 -4
  250. package/src/core/nodes/ExportNode.ts +6 -4
  251. package/src/core/nodes/ExpressionNode.ts +5 -4
  252. package/src/core/nodes/ExternalModuleNode.ts +11 -2
  253. package/src/core/nodes/HttpRequestNode.ts +7 -4
  254. package/src/core/nodes/ImportNode.ts +31 -4
  255. package/src/core/nodes/InterfaceNode.ts +4 -3
  256. package/src/core/nodes/LiteralNode.ts +5 -4
  257. package/src/core/nodes/MethodCallNode.ts +7 -5
  258. package/src/core/nodes/MethodNode.ts +6 -4
  259. package/src/core/nodes/ObjectLiteralNode.ts +3 -2
  260. package/src/core/nodes/ParameterNode.ts +4 -3
  261. package/src/core/nodes/TypeNode.ts +4 -3
  262. package/src/core/nodes/VariableDeclarationNode.ts +7 -5
  263. package/src/core/nodes/index.ts +3 -0
  264. package/src/data/builtins/BuiltinRegistry.ts +124 -0
  265. package/src/data/builtins/definitions.ts +267 -0
  266. package/src/data/builtins/index.ts +10 -0
  267. package/src/data/builtins/jsGlobals.ts +28 -0
  268. package/src/data/builtins/types.ts +36 -0
  269. package/src/data/globals/definitions.ts +156 -0
  270. package/src/data/globals/index.ts +66 -0
  271. package/src/diagnostics/DiagnosticReporter.ts +120 -0
  272. package/src/diagnostics/index.ts +1 -1
  273. package/src/errors/GrafemaError.ts +65 -0
  274. package/src/index.ts +45 -0
  275. package/src/plugins/analysis/DatabaseAnalyzer.ts +4 -2
  276. package/src/plugins/analysis/ExpressAnalyzer.ts +5 -1
  277. package/src/plugins/analysis/ExpressResponseAnalyzer.ts +636 -0
  278. package/src/plugins/analysis/ExpressRouteAnalyzer.ts +57 -18
  279. package/src/plugins/analysis/FetchAnalyzer.ts +204 -16
  280. package/src/plugins/analysis/JSASTAnalyzer.ts +2958 -260
  281. package/src/plugins/analysis/RustAnalyzer.ts +4 -4
  282. package/src/plugins/analysis/SQLiteAnalyzer.ts +5 -2
  283. package/src/plugins/analysis/SocketIOAnalyzer.ts +121 -7
  284. package/src/plugins/analysis/ast/GraphBuilder.ts +1578 -70
  285. package/src/plugins/analysis/ast/types.ts +387 -0
  286. package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +8 -0
  287. package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +16 -1
  288. package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +77 -2
  289. package/src/plugins/analysis/ast/visitors/ImportExportVisitor.ts +112 -1
  290. package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +272 -47
  291. package/src/plugins/discovery/WorkspaceDiscovery.ts +11 -4
  292. package/src/plugins/enrichment/AliasTracker.ts +22 -1
  293. package/src/plugins/enrichment/ArgumentParameterLinker.ts +240 -0
  294. package/src/plugins/enrichment/ClosureCaptureEnricher.ts +267 -0
  295. package/src/plugins/enrichment/ExternalCallResolver.ts +262 -0
  296. package/src/plugins/enrichment/FunctionCallResolver.ts +456 -0
  297. package/src/plugins/enrichment/HTTPConnectionEnricher.ts +70 -20
  298. package/src/plugins/enrichment/MethodCallResolver.ts +21 -1
  299. package/src/plugins/enrichment/MountPointResolver.ts +206 -198
  300. package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +365 -0
  301. package/src/plugins/enrichment/ValueDomainAnalyzer.ts +67 -184
  302. package/src/plugins/indexing/JSModuleIndexer.ts +66 -0
  303. package/src/plugins/indexing/RustModuleIndexer.ts +4 -4
  304. package/src/plugins/validation/BrokenImportValidator.ts +325 -0
  305. package/src/plugins/validation/CallResolverValidator.ts +129 -109
  306. package/src/plugins/validation/DataFlowValidator.ts +75 -58
  307. package/src/plugins/validation/GraphConnectivityValidator.ts +39 -1
  308. package/src/plugins/validation/SQLInjectionValidator.ts +2 -5
  309. package/src/queries/README.md +46 -0
  310. package/src/queries/findCallsInFunction.ts +206 -0
  311. package/src/queries/findContainingFunction.ts +83 -0
  312. package/src/queries/index.ts +23 -0
  313. package/src/queries/traceValues.ts +398 -0
  314. package/src/queries/types.ts +187 -0
  315. package/src/schema/GraphSchemaExtractor.ts +177 -0
  316. package/src/schema/InterfaceSchemaExtractor.ts +173 -0
  317. package/src/schema/index.ts +5 -0
  318. package/src/storage/backends/RFDBServerBackend.ts +58 -70
  319. package/src/storage/backends/typeValidation.ts +1 -0
@@ -6,13 +6,13 @@ import type { BaseNodeRecord } from '@grafema/types';
6
6
 
7
7
  interface EventListenerNodeRecord extends BaseNodeRecord {
8
8
  type: 'EVENT_LISTENER';
9
+ column: number;
9
10
  object?: string;
10
11
  parentScopeId?: string;
11
12
  callbackArg?: string;
12
13
  }
13
14
 
14
15
  interface EventListenerNodeOptions {
15
- column?: number;
16
16
  parentScopeId?: string;
17
17
  callbackArg?: string;
18
18
  counter?: number;
@@ -21,22 +21,24 @@ interface EventListenerNodeOptions {
21
21
  export class EventListenerNode {
22
22
  static readonly TYPE = 'EVENT_LISTENER' as const;
23
23
 
24
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
25
- static readonly OPTIONAL = ['object', 'column', 'parentScopeId', 'callbackArg'] as const;
24
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
25
+ static readonly OPTIONAL = ['object', 'parentScopeId', 'callbackArg'] as const;
26
26
 
27
27
  static create(
28
28
  eventName: string,
29
29
  objectName: string | undefined,
30
30
  file: string,
31
31
  line: number,
32
+ column: number,
32
33
  options: EventListenerNodeOptions = {}
33
34
  ): EventListenerNodeRecord {
34
35
  if (!eventName) throw new Error('EventListenerNode.create: eventName is required');
35
36
  if (!file) throw new Error('EventListenerNode.create: file is required');
36
37
  if (line === undefined) throw new Error('EventListenerNode.create: line is required');
38
+ if (column === undefined) throw new Error('EventListenerNode.create: column is required');
37
39
 
38
40
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
39
- const id = `${file}:EVENT_LISTENER:${eventName}:${line}:${options.column || 0}${counter}`;
41
+ const id = `${file}:EVENT_LISTENER:${eventName}:${line}:${column}${counter}`;
40
42
 
41
43
  return {
42
44
  id,
@@ -45,6 +47,7 @@ export class EventListenerNode {
45
47
  object: objectName,
46
48
  file,
47
49
  line,
50
+ column,
48
51
  parentScopeId: options.parentScopeId,
49
52
  callbackArg: options.callbackArg
50
53
  };
@@ -48,8 +48,8 @@ interface ExportContextOptions {
48
48
  export class ExportNode {
49
49
  static readonly TYPE = 'EXPORT' as const;
50
50
 
51
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
52
- static readonly OPTIONAL = ['column', 'exportKind', 'local', 'default', 'source', 'exportType'] as const;
51
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
52
+ static readonly OPTIONAL = ['exportKind', 'local', 'default', 'source', 'exportType'] as const;
53
53
 
54
54
  static create(
55
55
  name: string,
@@ -61,6 +61,7 @@ export class ExportNode {
61
61
  if (!name) throw new Error('ExportNode.create: name is required');
62
62
  if (!file) throw new Error('ExportNode.create: file is required');
63
63
  if (!line) throw new Error('ExportNode.create: line is required');
64
+ if (column === undefined) throw new Error('ExportNode.create: column is required');
64
65
 
65
66
  return {
66
67
  id: `${file}:EXPORT:${name}:${line}`,
@@ -68,7 +69,7 @@ export class ExportNode {
68
69
  name,
69
70
  file,
70
71
  line,
71
- column: column || 0,
72
+ column,
72
73
  exportKind: options.exportKind || 'value',
73
74
  local: options.local || name,
74
75
  default: options.default || false,
@@ -99,6 +100,7 @@ export class ExportNode {
99
100
  if (!name) throw new Error('ExportNode.createWithContext: name is required');
100
101
  if (!context.file) throw new Error('ExportNode.createWithContext: file is required');
101
102
  if (location.line === undefined) throw new Error('ExportNode.createWithContext: line is required');
103
+ if (location.column === undefined) throw new Error('ExportNode.createWithContext: column is required');
102
104
 
103
105
  // Compute semantic ID
104
106
  const id = computeSemanticId(this.TYPE, name, context);
@@ -109,7 +111,7 @@ export class ExportNode {
109
111
  name,
110
112
  file: context.file,
111
113
  line: location.line,
112
- column: location.column ?? 0,
114
+ column: location.column,
113
115
  exportKind: options.exportKind || 'value',
114
116
  local: options.local || name,
115
117
  default: options.default || false,
@@ -46,9 +46,9 @@ interface ExpressionNodeOptions {
46
46
  export class ExpressionNode {
47
47
  static readonly TYPE = 'EXPRESSION' as const;
48
48
 
49
- static readonly REQUIRED = ['expressionType', 'file', 'line'] as const;
49
+ static readonly REQUIRED = ['expressionType', 'file', 'line', 'column'] as const;
50
50
  static readonly OPTIONAL = [
51
- 'column', 'object', 'property', 'computed', 'computedPropertyVar',
51
+ 'object', 'property', 'computed', 'computedPropertyVar',
52
52
  'operator', 'path', 'baseName', 'propertyPath', 'arrayIndex'
53
53
  ] as const;
54
54
 
@@ -72,6 +72,7 @@ export class ExpressionNode {
72
72
  if (!expressionType) throw new Error('ExpressionNode.create: expressionType is required');
73
73
  if (!file) throw new Error('ExpressionNode.create: file is required');
74
74
  if (!line) throw new Error('ExpressionNode.create: line is required');
75
+ if (column === undefined) throw new Error('ExpressionNode.create: column is required');
75
76
 
76
77
  const node: ExpressionNodeRecord = {
77
78
  id: `${file}:EXPRESSION:${expressionType}:${line}:${column}`,
@@ -79,7 +80,7 @@ export class ExpressionNode {
79
80
  name: this._computeName(expressionType, options),
80
81
  file,
81
82
  line,
82
- column: column || 0,
83
+ column,
83
84
  expressionType
84
85
  };
85
86
 
@@ -191,7 +192,7 @@ export class ExpressionNode {
191
192
  name: this._computeName(expressionType, options),
192
193
  file,
193
194
  line,
194
- column: column || 0,
195
+ column,
195
196
  expressionType
196
197
  };
197
198
 
@@ -23,16 +23,25 @@ export class ExternalModuleNode {
23
23
  /**
24
24
  * Create EXTERNAL_MODULE node
25
25
  *
26
+ * Normalizes node: prefix for Node.js builtins:
27
+ * - 'node:fs' -> 'fs'
28
+ * - 'node:path' -> 'path'
29
+ *
26
30
  * @param source - Module name (e.g., 'lodash', '@tanstack/react-query', 'node:fs')
27
31
  * @returns ExternalModuleNodeRecord
28
32
  */
29
33
  static create(source: string): ExternalModuleNodeRecord {
30
34
  if (!source) throw new Error('ExternalModuleNode.create: source is required');
31
35
 
36
+ // Normalize node: prefix for Node.js builtins
37
+ const normalizedSource = source.startsWith('node:')
38
+ ? source.slice(5)
39
+ : source;
40
+
32
41
  return {
33
- id: `EXTERNAL_MODULE:${source}`,
42
+ id: `EXTERNAL_MODULE:${normalizedSource}`,
34
43
  type: this.TYPE,
35
- name: source,
44
+ name: normalizedSource,
36
45
  file: '',
37
46
  line: 0
38
47
  };
@@ -6,13 +6,13 @@ import type { BaseNodeRecord } from '@grafema/types';
6
6
 
7
7
  interface HttpRequestNodeRecord extends BaseNodeRecord {
8
8
  type: 'HTTP_REQUEST';
9
+ column: number;
9
10
  url?: string;
10
11
  method: string;
11
12
  parentScopeId?: string;
12
13
  }
13
14
 
14
15
  interface HttpRequestNodeOptions {
15
- column?: number;
16
16
  parentScopeId?: string;
17
17
  counter?: number;
18
18
  }
@@ -20,22 +20,24 @@ interface HttpRequestNodeOptions {
20
20
  export class HttpRequestNode {
21
21
  static readonly TYPE = 'HTTP_REQUEST' as const;
22
22
 
23
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
24
- static readonly OPTIONAL = ['url', 'method', 'column', 'parentScopeId'] as const;
23
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
24
+ static readonly OPTIONAL = ['url', 'method', 'parentScopeId'] as const;
25
25
 
26
26
  static create(
27
27
  url: string | undefined,
28
28
  method: string | undefined,
29
29
  file: string,
30
30
  line: number,
31
+ column: number,
31
32
  options: HttpRequestNodeOptions = {}
32
33
  ): HttpRequestNodeRecord {
33
34
  if (!file) throw new Error('HttpRequestNode.create: file is required');
34
35
  if (line === undefined) throw new Error('HttpRequestNode.create: line is required');
36
+ if (column === undefined) throw new Error('HttpRequestNode.create: column is required');
35
37
 
36
38
  const httpMethod = method || 'GET';
37
39
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
38
- const id = `${file}:HTTP_REQUEST:${httpMethod}:${line}:${options.column || 0}${counter}`;
40
+ const id = `${file}:HTTP_REQUEST:${httpMethod}:${line}:${column}${counter}`;
39
41
 
40
42
  return {
41
43
  id,
@@ -45,6 +47,7 @@ export class HttpRequestNode {
45
47
  method: httpMethod,
46
48
  file,
47
49
  line,
50
+ column,
48
51
  parentScopeId: options.parentScopeId
49
52
  };
50
53
  }
@@ -15,6 +15,10 @@ interface ImportNodeRecord extends BaseNodeRecord {
15
15
  importBinding: ImportBinding; // RENAMED: WHAT is imported (semantics)
16
16
  imported: string;
17
17
  local: string;
18
+ isDynamic?: boolean; // true for dynamic import() expressions
19
+ isResolvable?: boolean; // true if path is a string literal (statically analyzable)
20
+ dynamicPath?: string; // original expression for template/variable paths
21
+ sideEffect?: boolean; // REG-273: true for side-effect-only imports
18
22
  }
19
23
 
20
24
  interface ImportNodeOptions {
@@ -22,13 +26,17 @@ interface ImportNodeOptions {
22
26
  importBinding?: ImportBinding;
23
27
  imported?: string; // Used for auto-detection if importType not provided
24
28
  local?: string;
29
+ isDynamic?: boolean; // true for dynamic import() expressions
30
+ isResolvable?: boolean; // true if path is a string literal (statically analyzable)
31
+ dynamicPath?: string; // original expression for template/variable paths
32
+ sideEffect?: boolean; // REG-273: true for side-effect-only imports
25
33
  }
26
34
 
27
35
  export class ImportNode {
28
36
  static readonly TYPE = 'IMPORT' as const;
29
37
 
30
- static readonly REQUIRED = ['name', 'file', 'line', 'source'] as const;
31
- static readonly OPTIONAL = ['column', 'importType', 'importBinding', 'imported', 'local'] as const;
38
+ static readonly REQUIRED = ['name', 'file', 'line', 'column', 'source'] as const;
39
+ static readonly OPTIONAL = ['importType', 'importBinding', 'imported', 'local', 'isDynamic', 'isResolvable', 'dynamicPath', 'sideEffect'] as const;
32
40
 
33
41
  /**
34
42
  * Create IMPORT node
@@ -52,6 +60,7 @@ export class ImportNode {
52
60
  if (!name) throw new Error('ImportNode.create: name is required');
53
61
  if (!file) throw new Error('ImportNode.create: file is required');
54
62
  if (line === undefined) throw new Error('ImportNode.create: line is required');
63
+ if (column === undefined) throw new Error('ImportNode.create: column is required');
55
64
  if (!source) throw new Error('ImportNode.create: source is required');
56
65
 
57
66
  // Auto-detect importType from imported field if not explicitly provided
@@ -61,19 +70,37 @@ export class ImportNode {
61
70
  options.imported === '*' ? 'namespace' : 'named';
62
71
  }
63
72
 
64
- return {
73
+ const record: ImportNodeRecord = {
65
74
  id: `${file}:IMPORT:${source}:${name}`, // SEMANTIC ID: no line number
66
75
  type: this.TYPE,
67
76
  name,
68
77
  file,
69
78
  line, // Stored as field, not in ID
70
- column: column || 0,
79
+ column,
71
80
  source,
72
81
  importType: importType || 'named', // NEW field with auto-detection
73
82
  importBinding: options.importBinding || 'value', // RENAMED field
74
83
  imported: options.imported || name,
75
84
  local: options.local || name
76
85
  };
86
+
87
+ // Add dynamic import fields if provided
88
+ if (options.isDynamic !== undefined) {
89
+ record.isDynamic = options.isDynamic;
90
+ }
91
+ if (options.isResolvable !== undefined) {
92
+ record.isResolvable = options.isResolvable;
93
+ }
94
+ if (options.dynamicPath !== undefined) {
95
+ record.dynamicPath = options.dynamicPath;
96
+ }
97
+
98
+ // REG-273: Add sideEffect field if provided
99
+ if (options.sideEffect !== undefined) {
100
+ record.sideEffect = options.sideEffect;
101
+ }
102
+
103
+ return record;
77
104
  }
78
105
 
79
106
  static validate(node: ImportNodeRecord): string[] {
@@ -33,8 +33,8 @@ interface InterfaceNodeOptions {
33
33
  export class InterfaceNode {
34
34
  static readonly TYPE = 'INTERFACE' as const;
35
35
 
36
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
37
- static readonly OPTIONAL = ['column', 'extends', 'properties', 'isExternal'] as const;
36
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
37
+ static readonly OPTIONAL = ['extends', 'properties', 'isExternal'] as const;
38
38
 
39
39
  /**
40
40
  * Create INTERFACE node
@@ -56,6 +56,7 @@ export class InterfaceNode {
56
56
  if (!name) throw new Error('InterfaceNode.create: name is required');
57
57
  if (!file) throw new Error('InterfaceNode.create: file is required');
58
58
  if (!line) throw new Error('InterfaceNode.create: line is required');
59
+ if (column === undefined) throw new Error('InterfaceNode.create: column is required');
59
60
 
60
61
  return {
61
62
  id: `${file}:INTERFACE:${name}:${line}`,
@@ -63,7 +64,7 @@ export class InterfaceNode {
63
64
  name,
64
65
  file,
65
66
  line,
66
- column: column || 0,
67
+ column,
67
68
  extends: options.extends || [],
68
69
  properties: options.properties || [],
69
70
  ...(options.isExternal !== undefined && { isExternal: options.isExternal })
@@ -22,8 +22,8 @@ interface LiteralNodeOptions {
22
22
  export class LiteralNode {
23
23
  static readonly TYPE = 'LITERAL' as const;
24
24
 
25
- static readonly REQUIRED = ['file', 'line'] as const;
26
- static readonly OPTIONAL = ['value', 'valueType', 'column', 'parentCallId', 'argIndex'] as const;
25
+ static readonly REQUIRED = ['file', 'line', 'column'] as const;
26
+ static readonly OPTIONAL = ['value', 'valueType', 'parentCallId', 'argIndex'] as const;
27
27
 
28
28
  static create(
29
29
  value: unknown,
@@ -34,10 +34,11 @@ export class LiteralNode {
34
34
  ): LiteralNodeRecord {
35
35
  if (!file) throw new Error('LiteralNode.create: file is required');
36
36
  if (line === undefined) throw new Error('LiteralNode.create: line is required');
37
+ if (column === undefined) throw new Error('LiteralNode.create: column is required');
37
38
 
38
39
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
39
40
  const argIndex = options.argIndex !== undefined ? `arg${options.argIndex}` : 'value';
40
- const id = `${file}:LITERAL:${argIndex}:${line}:${column || 0}${counter}`;
41
+ const id = `${file}:LITERAL:${argIndex}:${line}:${column}${counter}`;
41
42
 
42
43
  return {
43
44
  id,
@@ -47,7 +48,7 @@ export class LiteralNode {
47
48
  valueType: typeof value,
48
49
  file,
49
50
  line,
50
- column: column || 0,
51
+ column,
51
52
  parentCallId: options.parentCallId,
52
53
  argIndex: options.argIndex
53
54
  };
@@ -39,8 +39,8 @@ interface MethodCallContextOptions {
39
39
  export class MethodCallNode {
40
40
  static readonly TYPE = 'METHOD_CALL' as const;
41
41
 
42
- static readonly REQUIRED = ['name', 'file', 'line', 'args'] as const;
43
- static readonly OPTIONAL = ['object', 'method', 'column', 'parentScopeId'] as const;
42
+ static readonly REQUIRED = ['name', 'file', 'line', 'column', 'args'] as const;
43
+ static readonly OPTIONAL = ['object', 'method', 'parentScopeId'] as const;
44
44
 
45
45
  /**
46
46
  * Create METHOD_CALL node
@@ -56,10 +56,11 @@ export class MethodCallNode {
56
56
  if (!methodName) throw new Error('MethodCallNode.create: methodName is required');
57
57
  if (!file) throw new Error('MethodCallNode.create: file is required');
58
58
  if (line === undefined) throw new Error('MethodCallNode.create: line is required');
59
+ if (column === undefined) throw new Error('MethodCallNode.create: column is required');
59
60
 
60
61
  const fullName = objectName ? `${objectName}.${methodName}` : methodName;
61
62
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
62
- const id = `${file}:METHOD_CALL:${fullName}:${line}:${column || 0}${counter}`;
63
+ const id = `${file}:METHOD_CALL:${fullName}:${line}:${column}${counter}`;
63
64
 
64
65
  return {
65
66
  id,
@@ -69,7 +70,7 @@ export class MethodCallNode {
69
70
  method: methodName,
70
71
  file,
71
72
  line,
72
- column: column || 0,
73
+ column,
73
74
  parentScopeId: options.parentScopeId,
74
75
  args: options.args || []
75
76
  };
@@ -99,6 +100,7 @@ export class MethodCallNode {
99
100
  if (!methodName) throw new Error('MethodCallNode.createWithContext: methodName is required');
100
101
  if (!context.file) throw new Error('MethodCallNode.createWithContext: file is required');
101
102
  if (location.line === undefined) throw new Error('MethodCallNode.createWithContext: line is required');
103
+ if (location.column === undefined) throw new Error('MethodCallNode.createWithContext: column is required');
102
104
  if (options.discriminator === undefined) throw new Error('MethodCallNode.createWithContext: discriminator is required');
103
105
 
104
106
  const fullName = objectName ? `${objectName}.${methodName}` : methodName;
@@ -116,7 +118,7 @@ export class MethodCallNode {
116
118
  method: methodName,
117
119
  file: context.file,
118
120
  line: location.line,
119
- column: location.column ?? 0,
121
+ column: location.column,
120
122
  parentScopeId: options.parentScopeId,
121
123
  args: options.args || []
122
124
  };
@@ -44,8 +44,8 @@ interface MethodContextOptions {
44
44
  export class MethodNode {
45
45
  static readonly TYPE = 'METHOD' as const;
46
46
 
47
- static readonly REQUIRED = ['name', 'file', 'line', 'className'] as const;
48
- static readonly OPTIONAL = ['column', 'async', 'generator', 'static', 'kind'] as const;
47
+ static readonly REQUIRED = ['name', 'file', 'line', 'column', 'className'] as const;
48
+ static readonly OPTIONAL = ['async', 'generator', 'static', 'kind'] as const;
49
49
 
50
50
  static create(
51
51
  name: string,
@@ -58,6 +58,7 @@ export class MethodNode {
58
58
  if (!name) throw new Error('MethodNode.create: name is required');
59
59
  if (!file) throw new Error('MethodNode.create: file is required');
60
60
  if (!line) throw new Error('MethodNode.create: line is required');
61
+ if (column === undefined) throw new Error('MethodNode.create: column is required');
61
62
  if (!className) throw new Error('MethodNode.create: className is required');
62
63
 
63
64
  return {
@@ -66,7 +67,7 @@ export class MethodNode {
66
67
  name,
67
68
  file,
68
69
  line,
69
- column: column || 0,
70
+ column,
70
71
  className,
71
72
  async: options.async || false,
72
73
  generator: options.generator || false,
@@ -101,6 +102,7 @@ export class MethodNode {
101
102
  if (!className) throw new Error('MethodNode.createWithContext: className is required');
102
103
  if (!context.file) throw new Error('MethodNode.createWithContext: file is required');
103
104
  if (location.line === undefined) throw new Error('MethodNode.createWithContext: line is required');
105
+ if (location.column === undefined) throw new Error('MethodNode.createWithContext: column is required');
104
106
 
105
107
  // Compute semantic ID
106
108
  const id = computeSemanticId(this.TYPE, name, context);
@@ -111,7 +113,7 @@ export class MethodNode {
111
113
  name,
112
114
  file: context.file,
113
115
  line: location.line,
114
- column: location.column ?? 0,
116
+ column: location.column,
115
117
  className,
116
118
  async: options.async || false,
117
119
  generator: options.generator || false,
@@ -34,10 +34,11 @@ export class ObjectLiteralNode {
34
34
  ): ObjectLiteralNodeRecord {
35
35
  if (!file) throw new Error('ObjectLiteralNode.create: file is required');
36
36
  if (line === undefined) throw new Error('ObjectLiteralNode.create: line is required');
37
+ if (column === undefined) throw new Error('ObjectLiteralNode.create: column is required');
37
38
 
38
39
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
39
40
  const argSuffix = options.argIndex !== undefined ? `arg${options.argIndex}` : 'obj';
40
- const id = `OBJECT_LITERAL#${argSuffix}#${file}#${line}:${column || 0}${counter}`;
41
+ const id = `OBJECT_LITERAL#${argSuffix}#${file}#${line}:${column}${counter}`;
41
42
 
42
43
  return {
43
44
  id,
@@ -45,7 +46,7 @@ export class ObjectLiteralNode {
45
46
  name: `<object>`,
46
47
  file,
47
48
  line,
48
- column: column || 0,
49
+ column,
49
50
  parentCallId: options.parentCallId,
50
51
  argIndex: options.argIndex
51
52
  };
@@ -22,8 +22,8 @@ interface ParameterNodeOptions {
22
22
  export class ParameterNode {
23
23
  static readonly TYPE = 'PARAMETER' as const;
24
24
 
25
- static readonly REQUIRED = ['name', 'file', 'line', 'functionId'] as const;
26
- static readonly OPTIONAL = ['column', 'index', 'defaultValue', 'rest'] as const;
25
+ static readonly REQUIRED = ['name', 'file', 'line', 'column', 'functionId'] as const;
26
+ static readonly OPTIONAL = ['index', 'defaultValue', 'rest'] as const;
27
27
 
28
28
  static create(
29
29
  name: string,
@@ -36,6 +36,7 @@ export class ParameterNode {
36
36
  if (!name) throw new Error('ParameterNode.create: name is required');
37
37
  if (!file) throw new Error('ParameterNode.create: file is required');
38
38
  if (!line) throw new Error('ParameterNode.create: line is required');
39
+ if (column === undefined) throw new Error('ParameterNode.create: column is required');
39
40
  if (!functionId) throw new Error('ParameterNode.create: functionId is required');
40
41
 
41
42
  return {
@@ -44,7 +45,7 @@ export class ParameterNode {
44
45
  name,
45
46
  file,
46
47
  line,
47
- column: column || 0,
48
+ column,
48
49
  functionId,
49
50
  index: options.index || 0,
50
51
  defaultValue: options.defaultValue,
@@ -22,8 +22,8 @@ interface TypeNodeOptions {
22
22
  export class TypeNode {
23
23
  static readonly TYPE = 'TYPE' as const;
24
24
 
25
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
26
- static readonly OPTIONAL = ['column', 'aliasOf'] as const;
25
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
26
+ static readonly OPTIONAL = ['aliasOf'] as const;
27
27
 
28
28
  /**
29
29
  * Create TYPE node
@@ -45,6 +45,7 @@ export class TypeNode {
45
45
  if (!name) throw new Error('TypeNode.create: name is required');
46
46
  if (!file) throw new Error('TypeNode.create: file is required');
47
47
  if (!line) throw new Error('TypeNode.create: line is required');
48
+ if (column === undefined) throw new Error('TypeNode.create: column is required');
48
49
 
49
50
  return {
50
51
  id: `${file}:TYPE:${name}:${line}`,
@@ -52,7 +53,7 @@ export class TypeNode {
52
53
  name,
53
54
  file,
54
55
  line,
55
- column: column || 0,
56
+ column,
56
57
  aliasOf: options.aliasOf
57
58
  };
58
59
  }
@@ -33,8 +33,8 @@ interface VariableContextOptions {
33
33
  export class VariableDeclarationNode {
34
34
  static readonly TYPE = 'VARIABLE_DECLARATION' as const;
35
35
 
36
- static readonly REQUIRED = ['name', 'file', 'line'] as const;
37
- static readonly OPTIONAL = ['column', 'parentScopeId'] as const;
36
+ static readonly REQUIRED = ['name', 'file', 'line', 'column'] as const;
37
+ static readonly OPTIONAL = ['parentScopeId'] as const;
38
38
 
39
39
  static create(
40
40
  name: string,
@@ -46,9 +46,10 @@ export class VariableDeclarationNode {
46
46
  if (!name) throw new Error('VariableDeclarationNode.create: name is required');
47
47
  if (!file) throw new Error('VariableDeclarationNode.create: file is required');
48
48
  if (line === undefined) throw new Error('VariableDeclarationNode.create: line is required');
49
+ if (column === undefined) throw new Error('VariableDeclarationNode.create: column is required');
49
50
 
50
51
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
51
- const id = `${file}:VARIABLE_DECLARATION:${name}:${line}:${column || 0}${counter}`;
52
+ const id = `${file}:VARIABLE_DECLARATION:${name}:${line}:${column}${counter}`;
52
53
 
53
54
  return {
54
55
  id,
@@ -56,7 +57,7 @@ export class VariableDeclarationNode {
56
57
  name,
57
58
  file,
58
59
  line,
59
- column: column || 0,
60
+ column,
60
61
  parentScopeId: options.parentScopeId
61
62
  };
62
63
  }
@@ -83,6 +84,7 @@ export class VariableDeclarationNode {
83
84
  if (!name) throw new Error('VariableDeclarationNode.createWithContext: name is required');
84
85
  if (!context.file) throw new Error('VariableDeclarationNode.createWithContext: file is required');
85
86
  if (location.line === undefined) throw new Error('VariableDeclarationNode.createWithContext: line is required');
87
+ if (location.column === undefined) throw new Error('VariableDeclarationNode.createWithContext: column is required');
86
88
 
87
89
  // Compute semantic ID using 'VARIABLE' type for cleaner IDs
88
90
  const id = computeSemanticId('VARIABLE', name, context);
@@ -93,7 +95,7 @@ export class VariableDeclarationNode {
93
95
  name,
94
96
  file: context.file,
95
97
  line: location.line,
96
- column: location.column ?? 0,
98
+ column: location.column,
97
99
  parentScopeId: options.parentScopeId
98
100
  };
99
101
  }
@@ -11,10 +11,13 @@ export { ClassNode, type ClassNodeRecord } from './ClassNode.js';
11
11
  export { MethodNode, type MethodNodeRecord, type MethodKind } from './MethodNode.js';
12
12
  export { ParameterNode, type ParameterNodeRecord } from './ParameterNode.js';
13
13
  export { ScopeNode, type ScopeNodeRecord } from './ScopeNode.js';
14
+ export { BranchNode, type BranchNodeRecord } from './BranchNode.js';
15
+ export { CaseNode, type CaseNodeRecord } from './CaseNode.js';
14
16
 
15
17
  // Call/reference nodes
16
18
  export { CallSiteNode, type CallSiteNodeRecord } from './CallSiteNode.js';
17
19
  export { MethodCallNode, type MethodCallNodeRecord } from './MethodCallNode.js';
20
+ export { ConstructorCallNode, type ConstructorCallNodeRecord } from './ConstructorCallNode.js';
18
21
  export { VariableDeclarationNode, type VariableDeclarationNodeRecord } from './VariableDeclarationNode.js';
19
22
  export { ConstantNode, type ConstantNodeRecord } from './ConstantNode.js';
20
23
  export { LiteralNode, type LiteralNodeRecord } from './LiteralNode.js';