@grafema/core 0.2.3-beta → 0.2.5-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 (560) hide show
  1. package/dist/Orchestrator.d.ts +37 -0
  2. package/dist/Orchestrator.d.ts.map +1 -1
  3. package/dist/Orchestrator.js +322 -35
  4. package/dist/Orchestrator.js.map +1 -0
  5. package/dist/api/GraphAPI.d.ts +1 -1
  6. package/dist/api/GraphAPI.d.ts.map +1 -1
  7. package/dist/api/GraphAPI.js +3 -1
  8. package/dist/api/GraphAPI.js.map +1 -0
  9. package/dist/api/GuaranteeAPI.d.ts.map +1 -1
  10. package/dist/api/GuaranteeAPI.js +4 -2
  11. package/dist/api/GuaranteeAPI.js.map +1 -0
  12. package/dist/config/ConfigLoader.d.ts +66 -0
  13. package/dist/config/ConfigLoader.d.ts.map +1 -1
  14. package/dist/config/ConfigLoader.js +77 -3
  15. package/dist/config/ConfigLoader.js.map +1 -0
  16. package/dist/config/index.d.ts +1 -1
  17. package/dist/config/index.d.ts.map +1 -1
  18. package/dist/config/index.js +2 -1
  19. package/dist/config/index.js.map +1 -0
  20. package/dist/core/ASTWorker.d.ts.map +1 -1
  21. package/dist/core/ASTWorker.js +6 -4
  22. package/dist/core/ASTWorker.js.map +1 -0
  23. package/dist/core/ASTWorkerPool.js +2 -1
  24. package/dist/core/ASTWorkerPool.js.map +1 -0
  25. package/dist/core/AnalysisQueue.js +1 -0
  26. package/dist/core/AnalysisQueue.js.map +1 -0
  27. package/dist/core/CoverageAnalyzer.d.ts.map +1 -1
  28. package/dist/core/CoverageAnalyzer.js +1 -0
  29. package/dist/core/CoverageAnalyzer.js.map +1 -0
  30. package/dist/core/FileExplainer.js +1 -0
  31. package/dist/core/FileExplainer.js.map +1 -0
  32. package/dist/core/FileNodeManager.d.ts.map +1 -1
  33. package/dist/core/FileNodeManager.js +4 -2
  34. package/dist/core/FileNodeManager.js.map +1 -0
  35. package/dist/core/GraphBackend.js +1 -0
  36. package/dist/core/GraphBackend.js.map +1 -0
  37. package/dist/core/GraphFreshnessChecker.js +1 -0
  38. package/dist/core/GraphFreshnessChecker.js.map +1 -0
  39. package/dist/core/GuaranteeManager.js +2 -1
  40. package/dist/core/GuaranteeManager.js.map +1 -0
  41. package/dist/core/HashUtils.js +1 -0
  42. package/dist/core/HashUtils.js.map +1 -0
  43. package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
  44. package/dist/core/IncrementalReanalyzer.js +7 -3
  45. package/dist/core/IncrementalReanalyzer.js.map +1 -0
  46. package/dist/core/ManifestStore.js +1 -0
  47. package/dist/core/ManifestStore.js.map +1 -0
  48. package/dist/core/NodeFactory.d.ts +54 -34
  49. package/dist/core/NodeFactory.d.ts.map +1 -1
  50. package/dist/core/NodeFactory.js +20 -1
  51. package/dist/core/NodeFactory.js.map +1 -0
  52. package/dist/core/NodeId.js +1 -0
  53. package/dist/core/NodeId.js.map +1 -0
  54. package/dist/core/PriorityQueue.js +1 -0
  55. package/dist/core/PriorityQueue.js.map +1 -0
  56. package/dist/core/Profiler.js +1 -0
  57. package/dist/core/Profiler.js.map +1 -0
  58. package/dist/core/ScopeTracker.js +1 -0
  59. package/dist/core/ScopeTracker.js.map +1 -0
  60. package/dist/core/SemanticId.js +1 -0
  61. package/dist/core/SemanticId.js.map +1 -0
  62. package/dist/core/Task.js +1 -0
  63. package/dist/core/Task.js.map +1 -0
  64. package/dist/core/TaskTypes.js +1 -0
  65. package/dist/core/TaskTypes.js.map +1 -0
  66. package/dist/core/VersionManager.js +1 -0
  67. package/dist/core/VersionManager.js.map +1 -0
  68. package/dist/core/WorkerPool.d.ts.map +1 -1
  69. package/dist/core/WorkerPool.js +3 -1
  70. package/dist/core/WorkerPool.js.map +1 -0
  71. package/dist/core/nodes/ArgumentExpressionNode.js +1 -0
  72. package/dist/core/nodes/ArgumentExpressionNode.js.map +1 -0
  73. package/dist/core/nodes/ArrayLiteralNode.js +1 -0
  74. package/dist/core/nodes/ArrayLiteralNode.js.map +1 -0
  75. package/dist/core/nodes/BranchNode.js +1 -0
  76. package/dist/core/nodes/BranchNode.js.map +1 -0
  77. package/dist/core/nodes/CallSiteNode.js +1 -0
  78. package/dist/core/nodes/CallSiteNode.js.map +1 -0
  79. package/dist/core/nodes/CaseNode.js +1 -0
  80. package/dist/core/nodes/CaseNode.js.map +1 -0
  81. package/dist/core/nodes/ClassNode.js +1 -0
  82. package/dist/core/nodes/ClassNode.js.map +1 -0
  83. package/dist/core/nodes/ConstantNode.js +1 -0
  84. package/dist/core/nodes/ConstantNode.js.map +1 -0
  85. package/dist/core/nodes/ConstructorCallNode.js +1 -0
  86. package/dist/core/nodes/ConstructorCallNode.js.map +1 -0
  87. package/dist/core/nodes/DatabaseQueryNode.js +1 -0
  88. package/dist/core/nodes/DatabaseQueryNode.js.map +1 -0
  89. package/dist/core/nodes/DecoratorNode.js +1 -0
  90. package/dist/core/nodes/DecoratorNode.js.map +1 -0
  91. package/dist/core/nodes/EntrypointNode.js +1 -0
  92. package/dist/core/nodes/EntrypointNode.js.map +1 -0
  93. package/dist/core/nodes/EnumNode.js +1 -0
  94. package/dist/core/nodes/EnumNode.js.map +1 -0
  95. package/dist/core/nodes/EventListenerNode.js +1 -0
  96. package/dist/core/nodes/EventListenerNode.js.map +1 -0
  97. package/dist/core/nodes/ExportNode.js +1 -0
  98. package/dist/core/nodes/ExportNode.js.map +1 -0
  99. package/dist/core/nodes/ExpressionNode.js +1 -0
  100. package/dist/core/nodes/ExpressionNode.js.map +1 -0
  101. package/dist/core/nodes/ExternalModuleNode.js +1 -0
  102. package/dist/core/nodes/ExternalModuleNode.js.map +1 -0
  103. package/dist/core/nodes/ExternalStdioNode.js +1 -0
  104. package/dist/core/nodes/ExternalStdioNode.js.map +1 -0
  105. package/dist/core/nodes/FunctionNode.js +1 -0
  106. package/dist/core/nodes/FunctionNode.js.map +1 -0
  107. package/dist/core/nodes/GuaranteeNode.js +1 -0
  108. package/dist/core/nodes/GuaranteeNode.js.map +1 -0
  109. package/dist/core/nodes/HttpRequestNode.js +1 -0
  110. package/dist/core/nodes/HttpRequestNode.js.map +1 -0
  111. package/dist/core/nodes/ImportNode.js +1 -0
  112. package/dist/core/nodes/ImportNode.js.map +1 -0
  113. package/dist/core/nodes/InterfaceNode.js +1 -0
  114. package/dist/core/nodes/InterfaceNode.js.map +1 -0
  115. package/dist/core/nodes/IssueNode.js +1 -0
  116. package/dist/core/nodes/IssueNode.js.map +1 -0
  117. package/dist/core/nodes/LiteralNode.js +1 -0
  118. package/dist/core/nodes/LiteralNode.js.map +1 -0
  119. package/dist/core/nodes/MethodCallNode.js +1 -0
  120. package/dist/core/nodes/MethodCallNode.js.map +1 -0
  121. package/dist/core/nodes/MethodNode.js +1 -0
  122. package/dist/core/nodes/MethodNode.js.map +1 -0
  123. package/dist/core/nodes/ModuleNode.js +1 -0
  124. package/dist/core/nodes/ModuleNode.js.map +1 -0
  125. package/dist/core/nodes/NetworkRequestNode.js +1 -0
  126. package/dist/core/nodes/NetworkRequestNode.js.map +1 -0
  127. package/dist/core/nodes/NodeKind.d.ts +5 -0
  128. package/dist/core/nodes/NodeKind.d.ts.map +1 -1
  129. package/dist/core/nodes/NodeKind.js +11 -0
  130. package/dist/core/nodes/NodeKind.js.map +1 -0
  131. package/dist/core/nodes/ObjectLiteralNode.js +1 -0
  132. package/dist/core/nodes/ObjectLiteralNode.js.map +1 -0
  133. package/dist/core/nodes/ParameterNode.js +1 -0
  134. package/dist/core/nodes/ParameterNode.js.map +1 -0
  135. package/dist/core/nodes/PluginNode.d.ts +69 -0
  136. package/dist/core/nodes/PluginNode.d.ts.map +1 -0
  137. package/dist/core/nodes/PluginNode.js +106 -0
  138. package/dist/core/nodes/PluginNode.js.map +1 -0
  139. package/dist/core/nodes/ScopeNode.js +1 -0
  140. package/dist/core/nodes/ScopeNode.js.map +1 -0
  141. package/dist/core/nodes/ServiceNode.js +1 -0
  142. package/dist/core/nodes/ServiceNode.js.map +1 -0
  143. package/dist/core/nodes/TypeNode.js +2 -1
  144. package/dist/core/nodes/TypeNode.js.map +1 -0
  145. package/dist/core/nodes/VariableDeclarationNode.js +1 -0
  146. package/dist/core/nodes/VariableDeclarationNode.js.map +1 -0
  147. package/dist/core/nodes/index.d.ts +2 -1
  148. package/dist/core/nodes/index.d.ts.map +1 -1
  149. package/dist/core/nodes/index.js +4 -1
  150. package/dist/core/nodes/index.js.map +1 -0
  151. package/dist/core/toposort.d.ts +38 -0
  152. package/dist/core/toposort.d.ts.map +1 -0
  153. package/dist/core/toposort.js +129 -0
  154. package/dist/core/toposort.js.map +1 -0
  155. package/dist/data/builtins/BuiltinRegistry.js +1 -0
  156. package/dist/data/builtins/BuiltinRegistry.js.map +1 -0
  157. package/dist/data/builtins/definitions.js +1 -0
  158. package/dist/data/builtins/definitions.js.map +1 -0
  159. package/dist/data/builtins/index.js +1 -0
  160. package/dist/data/builtins/index.js.map +1 -0
  161. package/dist/data/builtins/jsGlobals.js +1 -0
  162. package/dist/data/builtins/jsGlobals.js.map +1 -0
  163. package/dist/data/builtins/types.js +1 -0
  164. package/dist/data/builtins/types.js.map +1 -0
  165. package/dist/data/globals/definitions.js +1 -0
  166. package/dist/data/globals/definitions.js.map +1 -0
  167. package/dist/data/globals/index.js +1 -0
  168. package/dist/data/globals/index.js.map +1 -0
  169. package/dist/diagnostics/DiagnosticCollector.d.ts +5 -0
  170. package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -1
  171. package/dist/diagnostics/DiagnosticCollector.js +4 -0
  172. package/dist/diagnostics/DiagnosticCollector.js.map +1 -0
  173. package/dist/diagnostics/DiagnosticReporter.d.ts +23 -1
  174. package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
  175. package/dist/diagnostics/DiagnosticReporter.js +68 -15
  176. package/dist/diagnostics/DiagnosticReporter.js.map +1 -0
  177. package/dist/diagnostics/DiagnosticWriter.js +1 -0
  178. package/dist/diagnostics/DiagnosticWriter.js.map +1 -0
  179. package/dist/diagnostics/categories.d.ts +57 -0
  180. package/dist/diagnostics/categories.d.ts.map +1 -0
  181. package/dist/diagnostics/categories.js +71 -0
  182. package/dist/diagnostics/categories.js.map +1 -0
  183. package/dist/diagnostics/index.d.ts +3 -0
  184. package/dist/diagnostics/index.d.ts.map +1 -1
  185. package/dist/diagnostics/index.js +4 -0
  186. package/dist/diagnostics/index.js.map +1 -0
  187. package/dist/errors/GrafemaError.d.ts +39 -0
  188. package/dist/errors/GrafemaError.d.ts.map +1 -1
  189. package/dist/errors/GrafemaError.js +28 -0
  190. package/dist/errors/GrafemaError.js.map +1 -0
  191. package/dist/index.d.ts +21 -8
  192. package/dist/index.d.ts.map +1 -1
  193. package/dist/index.js +19 -6
  194. package/dist/index.js.map +1 -0
  195. package/dist/instructions/index.d.ts +8 -0
  196. package/dist/instructions/index.d.ts.map +1 -0
  197. package/dist/instructions/index.js +20 -0
  198. package/dist/instructions/index.js.map +1 -0
  199. package/dist/instructions/onboarding.md +121 -0
  200. package/dist/logging/Logger.d.ts +53 -3
  201. package/dist/logging/Logger.d.ts.map +1 -1
  202. package/dist/logging/Logger.js +144 -4
  203. package/dist/logging/Logger.js.map +1 -0
  204. package/dist/plugins/Plugin.js +1 -0
  205. package/dist/plugins/Plugin.js.map +1 -0
  206. package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
  207. package/dist/plugins/analysis/DatabaseAnalyzer.js +20 -14
  208. package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -0
  209. package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
  210. package/dist/plugins/analysis/ExpressAnalyzer.js +23 -16
  211. package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -0
  212. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +2 -1
  213. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
  214. package/dist/plugins/analysis/ExpressResponseAnalyzer.js +53 -76
  215. package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -0
  216. package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
  217. package/dist/plugins/analysis/ExpressRouteAnalyzer.js +47 -37
  218. package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -0
  219. package/dist/plugins/analysis/FetchAnalyzer.d.ts +8 -14
  220. package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
  221. package/dist/plugins/analysis/FetchAnalyzer.js +144 -97
  222. package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -0
  223. package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
  224. package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -5
  225. package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -0
  226. package/dist/plugins/analysis/JSASTAnalyzer.d.ts +59 -2
  227. package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
  228. package/dist/plugins/analysis/JSASTAnalyzer.js +926 -422
  229. package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -0
  230. package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
  231. package/dist/plugins/analysis/ReactAnalyzer.js +24 -19
  232. package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -0
  233. package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
  234. package/dist/plugins/analysis/RustAnalyzer.js +39 -26
  235. package/dist/plugins/analysis/RustAnalyzer.js.map +1 -0
  236. package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
  237. package/dist/plugins/analysis/SQLiteAnalyzer.js +14 -7
  238. package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -0
  239. package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
  240. package/dist/plugins/analysis/ServiceLayerAnalyzer.js +33 -28
  241. package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -0
  242. package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
  243. package/dist/plugins/analysis/SocketIOAnalyzer.js +24 -14
  244. package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -0
  245. package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
  246. package/dist/plugins/analysis/SystemDbAnalyzer.js +19 -11
  247. package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -0
  248. package/dist/plugins/analysis/ast/ConditionParser.js +1 -0
  249. package/dist/plugins/analysis/ast/ConditionParser.js.map +1 -0
  250. package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -1
  251. package/dist/plugins/analysis/ast/ExpressionEvaluator.js +1 -0
  252. package/dist/plugins/analysis/ast/ExpressionEvaluator.js.map +1 -0
  253. package/dist/plugins/analysis/ast/GraphBuilder.d.ts +58 -6
  254. package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
  255. package/dist/plugins/analysis/ast/GraphBuilder.js +440 -56
  256. package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -0
  257. package/dist/plugins/analysis/ast/IdGenerator.js +1 -0
  258. package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -0
  259. package/dist/plugins/analysis/ast/OxcAdapter.js +1 -0
  260. package/dist/plugins/analysis/ast/OxcAdapter.js.map +1 -0
  261. package/dist/plugins/analysis/ast/types.d.ts +152 -1
  262. package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
  263. package/dist/plugins/analysis/ast/types.js +1 -0
  264. package/dist/plugins/analysis/ast/types.js.map +1 -0
  265. package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts +27 -0
  266. package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts.map +1 -0
  267. package/dist/plugins/analysis/ast/utils/babelTraverse.js +45 -0
  268. package/dist/plugins/analysis/ast/utils/babelTraverse.js.map +1 -0
  269. package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +1 -1
  270. package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
  271. package/dist/plugins/analysis/ast/utils/createParameterNodes.js +1 -0
  272. package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -0
  273. package/dist/plugins/analysis/ast/utils/index.js +1 -0
  274. package/dist/plugins/analysis/ast/utils/index.js.map +1 -0
  275. package/dist/plugins/analysis/ast/utils/location.js +1 -0
  276. package/dist/plugins/analysis/ast/utils/location.js.map +1 -0
  277. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +3 -1
  278. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
  279. package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +1 -0
  280. package/dist/plugins/analysis/ast/visitors/ASTVisitor.js.map +1 -0
  281. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +9 -2
  282. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
  283. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +145 -14
  284. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -0
  285. package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +1 -1
  286. package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
  287. package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +198 -0
  288. package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -0
  289. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +4 -3
  290. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
  291. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +5 -2
  292. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -0
  293. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +1 -0
  294. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js.map +1 -0
  295. package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +83 -0
  296. package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -0
  297. package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +258 -0
  298. package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -0
  299. package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +1 -1
  300. package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
  301. package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +1 -0
  302. package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -0
  303. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +1 -1
  304. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
  305. package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +1 -0
  306. package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -0
  307. package/dist/plugins/analysis/ast/visitors/index.d.ts +1 -0
  308. package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -1
  309. package/dist/plugins/analysis/ast/visitors/index.js +2 -0
  310. package/dist/plugins/analysis/ast/visitors/index.js.map +1 -0
  311. package/dist/plugins/discovery/DiscoveryPlugin.d.ts +42 -10
  312. package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -1
  313. package/dist/plugins/discovery/DiscoveryPlugin.js +17 -1
  314. package/dist/plugins/discovery/DiscoveryPlugin.js.map +1 -0
  315. package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
  316. package/dist/plugins/discovery/MonorepoServiceDiscovery.js +3 -2
  317. package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -0
  318. package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
  319. package/dist/plugins/discovery/SimpleProjectDiscovery.js +3 -2
  320. package/dist/plugins/discovery/SimpleProjectDiscovery.js.map +1 -0
  321. package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
  322. package/dist/plugins/discovery/WorkspaceDiscovery.js +3 -2
  323. package/dist/plugins/discovery/WorkspaceDiscovery.js.map +1 -0
  324. package/dist/plugins/discovery/resolveSourceEntrypoint.js +1 -0
  325. package/dist/plugins/discovery/resolveSourceEntrypoint.js.map +1 -0
  326. package/dist/plugins/discovery/workspaces/detector.js +1 -0
  327. package/dist/plugins/discovery/workspaces/detector.js.map +1 -0
  328. package/dist/plugins/discovery/workspaces/globResolver.js +1 -0
  329. package/dist/plugins/discovery/workspaces/globResolver.js.map +1 -0
  330. package/dist/plugins/discovery/workspaces/index.js +1 -0
  331. package/dist/plugins/discovery/workspaces/index.js.map +1 -0
  332. package/dist/plugins/discovery/workspaces/parsers.js +1 -0
  333. package/dist/plugins/discovery/workspaces/parsers.js.map +1 -0
  334. package/dist/plugins/enrichment/AliasTracker.js +3 -2
  335. package/dist/plugins/enrichment/AliasTracker.js.map +1 -0
  336. package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
  337. package/dist/plugins/enrichment/ArgumentParameterLinker.js +1 -1
  338. package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -0
  339. package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
  340. package/dist/plugins/enrichment/ClosureCaptureEnricher.js +1 -1
  341. package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -0
  342. package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts +21 -0
  343. package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -0
  344. package/dist/plugins/enrichment/ExpressHandlerLinker.js +137 -0
  345. package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -0
  346. package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
  347. package/dist/plugins/enrichment/ExternalCallResolver.js +1 -1
  348. package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -0
  349. package/dist/plugins/enrichment/FunctionCallResolver.d.ts +5 -0
  350. package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
  351. package/dist/plugins/enrichment/FunctionCallResolver.js +11 -9
  352. package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -0
  353. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +2 -0
  354. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
  355. package/dist/plugins/enrichment/HTTPConnectionEnricher.js +51 -13
  356. package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -0
  357. package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
  358. package/dist/plugins/enrichment/ImportExportLinker.js +1 -1
  359. package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -0
  360. package/dist/plugins/enrichment/InstanceOfResolver.js +3 -2
  361. package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -0
  362. package/dist/plugins/enrichment/MethodCallResolver.d.ts +39 -1
  363. package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
  364. package/dist/plugins/enrichment/MethodCallResolver.js +422 -11
  365. package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -0
  366. package/dist/plugins/enrichment/MountPointResolver.d.ts +1 -1
  367. package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
  368. package/dist/plugins/enrichment/MountPointResolver.js +7 -23
  369. package/dist/plugins/enrichment/MountPointResolver.js.map +1 -0
  370. package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
  371. package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +2 -2
  372. package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -0
  373. package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
  374. package/dist/plugins/enrichment/PrefixEvaluator.js +5 -4
  375. package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -0
  376. package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts +30 -0
  377. package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -0
  378. package/dist/plugins/enrichment/RejectionPropagationEnricher.js +190 -0
  379. package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -0
  380. package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
  381. package/dist/plugins/enrichment/RustFFIEnricher.js +1 -1
  382. package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -0
  383. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +1 -1
  384. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
  385. package/dist/plugins/enrichment/ValueDomainAnalyzer.js +4 -3
  386. package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -0
  387. package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts +3 -1
  388. package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
  389. package/dist/plugins/indexing/IncrementalModuleIndexer.js +22 -29
  390. package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -0
  391. package/dist/plugins/indexing/JSModuleIndexer.d.ts +3 -1
  392. package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
  393. package/dist/plugins/indexing/JSModuleIndexer.js +22 -31
  394. package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -0
  395. package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
  396. package/dist/plugins/indexing/RustModuleIndexer.js +11 -5
  397. package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -0
  398. package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -1
  399. package/dist/plugins/validation/BrokenImportValidator.js +3 -3
  400. package/dist/plugins/validation/BrokenImportValidator.js.map +1 -0
  401. package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
  402. package/dist/plugins/validation/CallResolverValidator.js +3 -3
  403. package/dist/plugins/validation/CallResolverValidator.js.map +1 -0
  404. package/dist/plugins/validation/DataFlowValidator.js +2 -1
  405. package/dist/plugins/validation/DataFlowValidator.js.map +1 -0
  406. package/dist/plugins/validation/EvalBanValidator.js +2 -1
  407. package/dist/plugins/validation/EvalBanValidator.js.map +1 -0
  408. package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
  409. package/dist/plugins/validation/GraphConnectivityValidator.js +2 -1
  410. package/dist/plugins/validation/GraphConnectivityValidator.js.map +1 -0
  411. package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
  412. package/dist/plugins/validation/SQLInjectionValidator.js +4 -2
  413. package/dist/plugins/validation/SQLInjectionValidator.js.map +1 -0
  414. package/dist/plugins/validation/ShadowingDetector.js +2 -1
  415. package/dist/plugins/validation/ShadowingDetector.js.map +1 -0
  416. package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
  417. package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +3 -3
  418. package/dist/plugins/validation/TypeScriptDeadCodeValidator.js.map +1 -0
  419. package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -1
  420. package/dist/plugins/vcs/GitPlugin.js +13 -6
  421. package/dist/plugins/vcs/GitPlugin.js.map +1 -0
  422. package/dist/plugins/vcs/VCSPlugin.js +1 -0
  423. package/dist/plugins/vcs/VCSPlugin.js.map +1 -0
  424. package/dist/plugins/vcs/index.js +1 -0
  425. package/dist/plugins/vcs/index.js.map +1 -0
  426. package/dist/queries/findCallsInFunction.d.ts +1 -1
  427. package/dist/queries/findCallsInFunction.d.ts.map +1 -1
  428. package/dist/queries/findCallsInFunction.js +3 -2
  429. package/dist/queries/findCallsInFunction.js.map +1 -0
  430. package/dist/queries/findContainingFunction.d.ts +1 -1
  431. package/dist/queries/findContainingFunction.d.ts.map +1 -1
  432. package/dist/queries/findContainingFunction.js +1 -0
  433. package/dist/queries/findContainingFunction.js.map +1 -0
  434. package/dist/queries/index.js +1 -0
  435. package/dist/queries/index.js.map +1 -0
  436. package/dist/queries/traceValues.d.ts.map +1 -1
  437. package/dist/queries/traceValues.js +1 -0
  438. package/dist/queries/traceValues.js.map +1 -0
  439. package/dist/queries/types.js +1 -0
  440. package/dist/queries/types.js.map +1 -0
  441. package/dist/schema/GraphSchemaExtractor.js +1 -0
  442. package/dist/schema/GraphSchemaExtractor.js.map +1 -0
  443. package/dist/schema/InterfaceSchemaExtractor.js +1 -0
  444. package/dist/schema/InterfaceSchemaExtractor.js.map +1 -0
  445. package/dist/schema/index.js +1 -0
  446. package/dist/schema/index.js.map +1 -0
  447. package/dist/storage/backends/RFDBServerBackend.d.ts +20 -0
  448. package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
  449. package/dist/storage/backends/RFDBServerBackend.js +47 -19
  450. package/dist/storage/backends/RFDBServerBackend.js.map +1 -0
  451. package/dist/storage/backends/typeValidation.d.ts.map +1 -1
  452. package/dist/storage/backends/typeValidation.js +3 -0
  453. package/dist/storage/backends/typeValidation.js.map +1 -0
  454. package/dist/utils/findRfdbBinary.d.ts +39 -0
  455. package/dist/utils/findRfdbBinary.d.ts.map +1 -0
  456. package/dist/utils/findRfdbBinary.js +141 -0
  457. package/dist/utils/findRfdbBinary.js.map +1 -0
  458. package/dist/utils/moduleResolution.d.ts +134 -0
  459. package/dist/utils/moduleResolution.d.ts.map +1 -0
  460. package/dist/utils/moduleResolution.js +164 -0
  461. package/dist/utils/moduleResolution.js.map +1 -0
  462. package/dist/validation/PathValidator.d.ts.map +1 -1
  463. package/dist/validation/PathValidator.js +1 -0
  464. package/dist/validation/PathValidator.js.map +1 -0
  465. package/package.json +4 -3
  466. package/src/Orchestrator.ts +371 -41
  467. package/src/api/GraphAPI.ts +4 -2
  468. package/src/api/GuaranteeAPI.ts +3 -2
  469. package/src/config/ConfigLoader.ts +121 -3
  470. package/src/config/index.ts +7 -1
  471. package/src/core/ASTWorker.ts +8 -20
  472. package/src/core/ASTWorkerPool.ts +1 -1
  473. package/src/core/CoverageAnalyzer.ts +2 -2
  474. package/src/core/FileNodeManager.ts +3 -2
  475. package/src/core/GuaranteeManager.ts +1 -1
  476. package/src/core/IncrementalReanalyzer.ts +6 -3
  477. package/src/core/NodeFactory.ts +34 -1
  478. package/src/core/WorkerPool.ts +2 -1
  479. package/src/core/nodes/NodeKind.ts +11 -0
  480. package/src/core/nodes/PluginNode.ts +144 -0
  481. package/src/core/nodes/TypeNode.ts +1 -1
  482. package/src/core/nodes/index.ts +4 -0
  483. package/src/core/toposort.ts +160 -0
  484. package/src/diagnostics/DiagnosticCollector.ts +8 -1
  485. package/src/diagnostics/DiagnosticReporter.ts +87 -16
  486. package/src/diagnostics/categories.ts +104 -0
  487. package/src/diagnostics/index.ts +14 -0
  488. package/src/errors/GrafemaError.ts +58 -0
  489. package/src/index.ts +53 -7
  490. package/src/instructions/index.ts +21 -0
  491. package/src/instructions/onboarding.md +121 -0
  492. package/src/logging/Logger.ts +155 -4
  493. package/src/plugins/analysis/DatabaseAnalyzer.ts +22 -15
  494. package/src/plugins/analysis/ExpressAnalyzer.ts +30 -18
  495. package/src/plugins/analysis/ExpressResponseAnalyzer.ts +72 -88
  496. package/src/plugins/analysis/ExpressRouteAnalyzer.ts +54 -39
  497. package/src/plugins/analysis/FetchAnalyzer.ts +165 -113
  498. package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +6 -7
  499. package/src/plugins/analysis/JSASTAnalyzer.ts +1122 -487
  500. package/src/plugins/analysis/ReactAnalyzer.ts +27 -20
  501. package/src/plugins/analysis/RustAnalyzer.ts +41 -27
  502. package/src/plugins/analysis/SQLiteAnalyzer.ts +18 -8
  503. package/src/plugins/analysis/ServiceLayerAnalyzer.ts +38 -34
  504. package/src/plugins/analysis/SocketIOAnalyzer.ts +30 -15
  505. package/src/plugins/analysis/SystemDbAnalyzer.ts +24 -13
  506. package/src/plugins/analysis/ast/ExpressionEvaluator.ts +1 -3
  507. package/src/plugins/analysis/ast/GraphBuilder.ts +532 -66
  508. package/src/plugins/analysis/ast/types.ts +200 -2
  509. package/src/plugins/analysis/ast/utils/babelTraverse.ts +74 -0
  510. package/src/plugins/analysis/ast/utils/createParameterNodes.ts +1 -1
  511. package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +7 -2
  512. package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +163 -15
  513. package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +249 -3
  514. package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +9 -4
  515. package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +342 -0
  516. package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +2 -3
  517. package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +1 -27
  518. package/src/plugins/analysis/ast/visitors/index.ts +2 -0
  519. package/src/plugins/discovery/DiscoveryPlugin.ts +42 -11
  520. package/src/plugins/discovery/MonorepoServiceDiscovery.ts +2 -2
  521. package/src/plugins/discovery/SimpleProjectDiscovery.ts +2 -2
  522. package/src/plugins/discovery/WorkspaceDiscovery.ts +2 -2
  523. package/src/plugins/discovery/workspaces/globResolver.ts +1 -1
  524. package/src/plugins/enrichment/AliasTracker.ts +2 -2
  525. package/src/plugins/enrichment/ArgumentParameterLinker.ts +0 -1
  526. package/src/plugins/enrichment/ClosureCaptureEnricher.ts +0 -1
  527. package/src/plugins/enrichment/ExpressHandlerLinker.ts +178 -0
  528. package/src/plugins/enrichment/ExternalCallResolver.ts +0 -1
  529. package/src/plugins/enrichment/FunctionCallResolver.ts +10 -15
  530. package/src/plugins/enrichment/HTTPConnectionEnricher.ts +65 -14
  531. package/src/plugins/enrichment/ImportExportLinker.ts +0 -1
  532. package/src/plugins/enrichment/InstanceOfResolver.ts +2 -2
  533. package/src/plugins/enrichment/MethodCallResolver.ts +526 -12
  534. package/src/plugins/enrichment/MountPointResolver.ts +6 -24
  535. package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +1 -2
  536. package/src/plugins/enrichment/PrefixEvaluator.ts +4 -4
  537. package/src/plugins/enrichment/RejectionPropagationEnricher.ts +253 -0
  538. package/src/plugins/enrichment/RustFFIEnricher.ts +0 -1
  539. package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -3
  540. package/src/plugins/indexing/IncrementalModuleIndexer.ts +24 -30
  541. package/src/plugins/indexing/JSModuleIndexer.ts +21 -22
  542. package/src/plugins/indexing/RustModuleIndexer.ts +10 -5
  543. package/src/plugins/validation/BrokenImportValidator.ts +2 -3
  544. package/src/plugins/validation/CallResolverValidator.ts +2 -3
  545. package/src/plugins/validation/DataFlowValidator.ts +1 -1
  546. package/src/plugins/validation/EvalBanValidator.ts +1 -1
  547. package/src/plugins/validation/GraphConnectivityValidator.ts +1 -9
  548. package/src/plugins/validation/SQLInjectionValidator.ts +3 -2
  549. package/src/plugins/validation/ShadowingDetector.ts +1 -1
  550. package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +2 -3
  551. package/src/plugins/vcs/GitPlugin.ts +12 -6
  552. package/src/queries/findCallsInFunction.ts +4 -4
  553. package/src/queries/findContainingFunction.ts +1 -1
  554. package/src/queries/traceValues.ts +0 -1
  555. package/src/storage/backends/RFDBServerBackend.ts +56 -22
  556. package/src/storage/backends/typeValidation.ts +2 -0
  557. package/src/utils/findRfdbBinary.ts +160 -0
  558. package/src/utils/moduleResolution.ts +244 -0
  559. package/src/validation/PathValidator.ts +0 -8
  560. package/src/plugins/validation/NodeCreationValidator.ts +0 -554
@@ -56,6 +56,11 @@ export interface OrchestratorOptions {
56
56
  * When true, enrichers report unresolved references as fatal errors.
57
57
  */
58
58
  strictMode?: boolean;
59
+ /**
60
+ * Multi-root workspace configuration (REG-76).
61
+ * If provided, each root is indexed with rootPrefix in context.
62
+ */
63
+ workspaceRoots?: string[];
59
64
  }
60
65
  /**
61
66
  * Service info from discovery
@@ -123,11 +128,43 @@ export declare class Orchestrator {
123
128
  private configServices;
124
129
  /** Strict mode flag (REG-330) */
125
130
  private strictMode;
131
+ /** Multi-root workspace roots (REG-76) */
132
+ private workspaceRoots;
133
+ /** REG-357: Accumulated suppressedByIgnore from enrichment plugins */
134
+ private suppressedByIgnoreCount;
126
135
  constructor(options?: OrchestratorOptions);
136
+ /**
137
+ * Register all loaded plugins as grafema:plugin nodes in the graph.
138
+ *
139
+ * Creates a node for each plugin with its metadata (phase, priority,
140
+ * creates, dependencies). Also creates DEPENDS_ON edges between
141
+ * plugins that declare dependencies.
142
+ *
143
+ * Called once at the start of run(), before any analysis phase.
144
+ * Complexity: O(p) where p = number of plugins (typically 20-35).
145
+ */
146
+ private registerPluginNodes;
147
+ /**
148
+ * Collect field declarations from all plugins and send to RFDB for indexing.
149
+ * Deduplicates by field name (last declaration wins if nodeTypes differ).
150
+ * Called once before analysis to enable server-side metadata indexing.
151
+ */
152
+ private declarePluginFields;
127
153
  /**
128
154
  * Запустить анализ проекта
129
155
  */
130
156
  run(projectPath: string): Promise<DiscoveryManifest>;
157
+ /**
158
+ * REG-76: Run analysis for multi-root workspace.
159
+ * Each root is analyzed separately with rootPrefix in context.
160
+ * All results go to the same unified graph.
161
+ */
162
+ private runMultiRoot;
163
+ /**
164
+ * Discover services in a specific root directory.
165
+ * Uses the same discovery logic but scoped to the root.
166
+ */
167
+ private discoverInRoot;
131
168
  /**
132
169
  * Build unified list of indexing units from services and entrypoints
133
170
  * Each unit has: id, name, path, type, and original data
@@ -1 +1 @@
1
- {"version":3,"file":"Orchestrator.d.ts","sourceRoot":"","sources":["../src/Orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,EAAE,QAAQ,EAAa,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAKhH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH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CActC"}
@@ -3,7 +3,7 @@
3
3
  * Полностью абстрактный - специфичная логика в плагинах
4
4
  */
5
5
  import { readFileSync, existsSync, unlinkSync } from 'fs';
6
- import { join, dirname, resolve } from 'path';
6
+ import { join, dirname, resolve, basename } from 'path';
7
7
  import { fileURLToPath } from 'url';
8
8
  import { spawn, execSync } from 'child_process';
9
9
  import { setTimeout as sleep } from 'timers/promises';
@@ -12,8 +12,10 @@ import { resolveSourceEntrypoint } from './plugins/discovery/resolveSourceEntryp
12
12
  import { Profiler } from './core/Profiler.js';
13
13
  import { AnalysisQueue } from './core/AnalysisQueue.js';
14
14
  import { DiagnosticCollector } from './diagnostics/DiagnosticCollector.js';
15
+ import { StrictModeFailure } from './errors/GrafemaError.js';
15
16
  import { createLogger } from './logging/Logger.js';
16
17
  import { NodeFactory } from './core/NodeFactory.js';
18
+ import { toposort } from './core/toposort.js';
17
19
  export class Orchestrator {
18
20
  graph;
19
21
  config;
@@ -35,6 +37,10 @@ export class Orchestrator {
35
37
  configServices;
36
38
  /** Strict mode flag (REG-330) */
37
39
  strictMode;
40
+ /** Multi-root workspace roots (REG-76) */
41
+ workspaceRoots;
42
+ /** REG-357: Accumulated suppressedByIgnore from enrichment plugins */
43
+ suppressedByIgnoreCount = 0;
38
44
  constructor(options = {}) {
39
45
  this.graph = options.graph;
40
46
  this.config = options;
@@ -59,6 +65,8 @@ export class Orchestrator {
59
65
  this.configServices = options.services;
60
66
  // Strict mode configuration (REG-330)
61
67
  this.strictMode = options.strictMode ?? false;
68
+ // Multi-root workspace configuration (REG-76)
69
+ this.workspaceRoots = options.workspaceRoots;
62
70
  // Modified auto-add logic: SKIP auto-add if config services provided (REG-174)
63
71
  const hasDiscovery = this.plugins.some(p => p.metadata?.phase === 'DISCOVERY');
64
72
  const hasConfigServices = this.configServices && this.configServices.length > 0;
@@ -67,19 +75,107 @@ export class Orchestrator {
67
75
  this.plugins.unshift(new SimpleProjectDiscovery());
68
76
  }
69
77
  }
78
+ /**
79
+ * Register all loaded plugins as grafema:plugin nodes in the graph.
80
+ *
81
+ * Creates a node for each plugin with its metadata (phase, priority,
82
+ * creates, dependencies). Also creates DEPENDS_ON edges between
83
+ * plugins that declare dependencies.
84
+ *
85
+ * Called once at the start of run(), before any analysis phase.
86
+ * Complexity: O(p) where p = number of plugins (typically 20-35).
87
+ */
88
+ async registerPluginNodes() {
89
+ const pluginNodes = [];
90
+ for (const plugin of this.plugins) {
91
+ const meta = plugin.metadata;
92
+ if (!meta?.name)
93
+ continue;
94
+ const sourceFile = plugin.config?.sourceFile || '';
95
+ const isBuiltin = !sourceFile;
96
+ const node = NodeFactory.createPlugin(meta.name, meta.phase, {
97
+ file: sourceFile,
98
+ builtin: isBuiltin,
99
+ createsNodes: meta.creates?.nodes ?? [],
100
+ createsEdges: meta.creates?.edges ?? [],
101
+ dependencies: meta.dependencies ?? [],
102
+ });
103
+ await this.graph.addNode(node);
104
+ pluginNodes.push({
105
+ id: node.id,
106
+ name: meta.name,
107
+ dependencies: meta.dependencies ?? [],
108
+ });
109
+ }
110
+ // Create DEPENDS_ON edges between plugins
111
+ const nameToId = new Map();
112
+ for (const pn of pluginNodes) {
113
+ nameToId.set(pn.name, pn.id);
114
+ }
115
+ for (const pn of pluginNodes) {
116
+ for (const dep of pn.dependencies) {
117
+ const depId = nameToId.get(dep);
118
+ if (depId) {
119
+ await this.graph.addEdge({
120
+ src: pn.id,
121
+ dst: depId,
122
+ type: 'DEPENDS_ON',
123
+ });
124
+ }
125
+ }
126
+ }
127
+ this.logger.debug('Registered plugin nodes', {
128
+ count: pluginNodes.length,
129
+ edges: pluginNodes.reduce((sum, pn) => sum + pn.dependencies.filter(d => nameToId.has(d)).length, 0),
130
+ });
131
+ }
132
+ /**
133
+ * Collect field declarations from all plugins and send to RFDB for indexing.
134
+ * Deduplicates by field name (last declaration wins if nodeTypes differ).
135
+ * Called once before analysis to enable server-side metadata indexing.
136
+ */
137
+ async declarePluginFields() {
138
+ if (!this.graph.declareFields)
139
+ return;
140
+ const fieldMap = new Map();
141
+ for (const plugin of this.plugins) {
142
+ const fields = plugin.metadata?.fields;
143
+ if (!fields)
144
+ continue;
145
+ for (const field of fields) {
146
+ fieldMap.set(field.name, field);
147
+ }
148
+ }
149
+ if (fieldMap.size === 0)
150
+ return;
151
+ const fields = [...fieldMap.values()];
152
+ const count = await this.graph.declareFields(fields);
153
+ this.logger.debug('Declared metadata fields for indexing', { fields: count });
154
+ }
70
155
  /**
71
156
  * Запустить анализ проекта
72
157
  */
73
158
  async run(projectPath) {
74
159
  const totalStartTime = Date.now();
160
+ // REG-357: Reset suppressed count for each run
161
+ this.suppressedByIgnoreCount = 0;
75
162
  // Resolve to absolute path
76
163
  const absoluteProjectPath = projectPath.startsWith('/') ? projectPath : resolve(projectPath);
164
+ // REG-76: Multi-root workspace support
165
+ // If workspaceRoots is provided, run analysis for each root with rootPrefix
166
+ if (this.workspaceRoots && this.workspaceRoots.length > 0) {
167
+ return this.runMultiRoot(absoluteProjectPath);
168
+ }
77
169
  // RADICAL SIMPLIFICATION: Clear entire graph once at the start if forceAnalysis
78
170
  if (this.forceAnalysis && this.graph.clear) {
79
171
  this.logger.info('Clearing entire graph (forceAnalysis=true)');
80
172
  await this.graph.clear();
81
173
  this.logger.info('Graph cleared successfully');
82
174
  }
175
+ // Register plugin pipeline as grafema:plugin nodes (REG-386)
176
+ await this.registerPluginNodes();
177
+ // Declare metadata fields for RFDB server-side indexing (REG-398)
178
+ await this.declarePluginFields();
83
179
  this.onProgress({ phase: 'discovery', currentPlugin: 'Starting discovery...', message: 'Discovering services...', totalFiles: 0, processedFiles: 0 });
84
180
  // PHASE 0: DISCOVERY - запуск плагинов фазы DISCOVERY (or use entrypoint override)
85
181
  this.profiler.start('DISCOVERY');
@@ -259,21 +355,14 @@ export class Orchestrator {
259
355
  await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
260
356
  this.profiler.end('ENRICHMENT');
261
357
  this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
262
- // STRICT MODE BARRIER: Check for fatal errors after ENRICHMENT (REG-330)
358
+ // STRICT MODE BARRIER: Check for fatal errors after ENRICHMENT (REG-330, REG-332)
263
359
  if (this.strictMode) {
264
360
  const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
265
361
  const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
266
362
  if (strictErrors.length > 0) {
267
363
  this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
268
- for (const err of strictErrors) {
269
- this.logger.error(` [${err.code}] ${err.message}`, {
270
- file: err.file,
271
- line: err.line,
272
- plugin: err.plugin,
273
- });
274
- }
275
- throw new Error(`Strict mode: ${strictErrors.length} unresolved reference(s) found during ENRICHMENT. ` +
276
- `Run without --strict for graceful degradation, or fix the underlying issues.`);
364
+ // REG-357: Pass suppressedByIgnore count from enrichment plugin results
365
+ throw new StrictModeFailure(strictErrors, this.suppressedByIgnoreCount);
277
366
  }
278
367
  }
279
368
  // PHASE 4: VALIDATION - проверка корректности графа (глобально)
@@ -293,6 +382,148 @@ export class Orchestrator {
293
382
  this.profiler.printSummary();
294
383
  return manifest;
295
384
  }
385
+ /**
386
+ * REG-76: Run analysis for multi-root workspace.
387
+ * Each root is analyzed separately with rootPrefix in context.
388
+ * All results go to the same unified graph.
389
+ */
390
+ async runMultiRoot(workspacePath) {
391
+ const totalStartTime = Date.now();
392
+ const roots = this.workspaceRoots;
393
+ this.logger.info('Multi-root workspace mode', { roots: roots.length });
394
+ // Clear graph once at the start if forceAnalysis
395
+ if (this.forceAnalysis && this.graph.clear) {
396
+ this.logger.info('Clearing entire graph (forceAnalysis=true)');
397
+ await this.graph.clear();
398
+ this.logger.info('Graph cleared successfully');
399
+ }
400
+ // Register plugin pipeline as grafema:plugin nodes (REG-386)
401
+ await this.registerPluginNodes();
402
+ // Declare metadata fields for RFDB server-side indexing (REG-398)
403
+ await this.declarePluginFields();
404
+ // Collect all services from all roots
405
+ const allServices = [];
406
+ const allEntrypoints = [];
407
+ // Process each root
408
+ for (let rootIdx = 0; rootIdx < roots.length; rootIdx++) {
409
+ const rootRelativePath = roots[rootIdx];
410
+ const rootName = basename(rootRelativePath);
411
+ const rootAbsolutePath = join(workspacePath, rootRelativePath);
412
+ this.logger.info(`Processing root ${rootIdx + 1}/${roots.length}`, {
413
+ root: rootName,
414
+ path: rootAbsolutePath
415
+ });
416
+ // Discover services in this root
417
+ const rootManifest = await this.discoverInRoot(rootAbsolutePath, rootName);
418
+ // Build indexing units for this root
419
+ const units = this.buildIndexingUnits(rootManifest);
420
+ // INDEXING phase for this root
421
+ for (const unit of units) {
422
+ const unitManifest = {
423
+ projectPath: rootAbsolutePath,
424
+ service: {
425
+ ...unit,
426
+ id: unit.id,
427
+ name: unit.name,
428
+ path: unit.path
429
+ },
430
+ modules: [],
431
+ rootPrefix: rootName, // REG-76: Pass root prefix
432
+ };
433
+ await this.runPhase('INDEXING', {
434
+ manifest: unitManifest,
435
+ graph: this.graph,
436
+ workerCount: 1,
437
+ rootPrefix: rootName, // Pass to context
438
+ });
439
+ }
440
+ // ANALYSIS phase for this root
441
+ if (!this.indexOnly) {
442
+ for (const unit of units) {
443
+ const unitManifest = {
444
+ projectPath: rootAbsolutePath,
445
+ service: {
446
+ ...unit,
447
+ id: unit.id,
448
+ name: unit.name,
449
+ path: unit.path
450
+ },
451
+ modules: [],
452
+ rootPrefix: rootName,
453
+ };
454
+ await this.runPhase('ANALYSIS', {
455
+ manifest: unitManifest,
456
+ graph: this.graph,
457
+ workerCount: 1,
458
+ rootPrefix: rootName,
459
+ });
460
+ }
461
+ }
462
+ // Collect services with root prefix in path for unified manifest
463
+ for (const svc of rootManifest.services) {
464
+ allServices.push({
465
+ ...svc,
466
+ // Prefix path with root name for unified manifest
467
+ path: svc.path ? `${rootName}/${svc.path.replace(rootAbsolutePath + '/', '')}` : undefined,
468
+ });
469
+ }
470
+ for (const ep of rootManifest.entrypoints) {
471
+ allEntrypoints.push({
472
+ ...ep,
473
+ file: `${rootName}/${ep.file.replace(rootAbsolutePath + '/', '')}`,
474
+ });
475
+ }
476
+ }
477
+ // Create unified manifest
478
+ const unifiedManifest = {
479
+ services: allServices,
480
+ entrypoints: allEntrypoints,
481
+ projectPath: workspacePath,
482
+ };
483
+ // Skip remaining phases if indexOnly
484
+ if (this.indexOnly) {
485
+ const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
486
+ this.logger.info('indexOnly mode - skipping remaining phases', { duration: totalTime });
487
+ return unifiedManifest;
488
+ }
489
+ // ENRICHMENT phase (global - operates on unified graph)
490
+ this.profiler.start('ENRICHMENT');
491
+ await this.runPhase('ENRICHMENT', {
492
+ manifest: unifiedManifest,
493
+ graph: this.graph,
494
+ workerCount: this.workerCount
495
+ });
496
+ this.profiler.end('ENRICHMENT');
497
+ // VALIDATION phase (global)
498
+ this.profiler.start('VALIDATION');
499
+ await this.runPhase('VALIDATION', {
500
+ manifest: unifiedManifest,
501
+ graph: this.graph,
502
+ workerCount: this.workerCount
503
+ });
504
+ this.profiler.end('VALIDATION');
505
+ // Flush graph
506
+ if (this.graph.flush) {
507
+ await this.graph.flush();
508
+ }
509
+ const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
510
+ this.logger.info('Multi-root analysis complete', {
511
+ duration: totalTime,
512
+ roots: roots.length,
513
+ services: allServices.length
514
+ });
515
+ this.profiler.printSummary();
516
+ return unifiedManifest;
517
+ }
518
+ /**
519
+ * Discover services in a specific root directory.
520
+ * Uses the same discovery logic but scoped to the root.
521
+ */
522
+ async discoverInRoot(rootPath, _rootName) {
523
+ // For now, use the same discovery mechanism
524
+ // rootName is available for future use if needed
525
+ return this.discover(rootPath);
526
+ }
296
527
  /**
297
528
  * Build unified list of indexing units from services and entrypoints
298
529
  * Each unit has: id, name, path, type, and original data
@@ -330,7 +561,11 @@ export class Orchestrator {
330
561
  });
331
562
  }
332
563
  }
333
- console.log(`[Orchestrator] Built ${units.length} indexing units (${units.filter(u => u.type === 'service').length} services, ${units.filter(u => u.type === 'entrypoint').length} standalone entrypoints)`);
564
+ this.logger.debug('Built indexing units', {
565
+ total: units.length,
566
+ services: units.filter(u => u.type === 'service').length,
567
+ entrypoints: units.filter(u => u.type === 'entrypoint').length
568
+ });
334
569
  return units;
335
570
  }
336
571
  /**
@@ -365,10 +600,11 @@ export class Orchestrator {
365
600
  entrypoint = resolveSourceEntrypoint(servicePath, pkg) ?? pkg.main ?? 'index.js';
366
601
  }
367
602
  catch (e) {
603
+ const message = e instanceof Error ? e.message : String(e);
368
604
  this.logger.warn('Failed to read package.json for auto-detection', {
369
605
  service: configSvc.name,
370
606
  path: packageJsonPath,
371
- error: e.message
607
+ error: message
372
608
  });
373
609
  entrypoint = 'index.js';
374
610
  }
@@ -413,8 +649,18 @@ export class Orchestrator {
413
649
  };
414
650
  // Фильтруем плагины для фазы DISCOVERY
415
651
  const discoveryPlugins = this.plugins.filter(p => p.metadata.phase === 'DISCOVERY');
416
- // Сортируем по приоритету
417
- discoveryPlugins.sort((a, b) => (b.metadata.priority || 0) - (a.metadata.priority || 0));
652
+ // Topological sort by dependencies (REG-367)
653
+ const discoveryPluginMap = new Map(discoveryPlugins.map(p => [p.metadata.name, p]));
654
+ const sortedDiscoveryIds = toposort(discoveryPlugins.map(p => ({
655
+ id: p.metadata.name,
656
+ dependencies: p.metadata.dependencies ?? [],
657
+ })));
658
+ discoveryPlugins.length = 0;
659
+ for (const id of sortedDiscoveryIds) {
660
+ const plugin = discoveryPluginMap.get(id);
661
+ if (plugin)
662
+ discoveryPlugins.push(plugin);
663
+ }
418
664
  const allServices = [];
419
665
  const allEntrypoints = [];
420
666
  // Выполняем каждый плагин
@@ -433,6 +679,16 @@ export class Orchestrator {
433
679
  if (result.success && result.metadata?.entrypoints) {
434
680
  allEntrypoints.push(...result.metadata.entrypoints);
435
681
  }
682
+ // Warn if plugin created nodes but didn't return services/entrypoints in metadata
683
+ // This catches common mistake of not returning services via result.metadata.services
684
+ if (result.success && result.created.nodes > 0 &&
685
+ !result.metadata?.services && !result.metadata?.entrypoints) {
686
+ this.logger.warn('Discovery plugin created nodes but returned no services/entrypoints in metadata', {
687
+ plugin: plugin.metadata.name,
688
+ nodesCreated: result.created.nodes,
689
+ hint: 'Services must be returned via result.metadata.services for Orchestrator to index them'
690
+ });
691
+ }
436
692
  this.onProgress({
437
693
  phase: 'discovery',
438
694
  currentPlugin: plugin.metadata.name,
@@ -451,8 +707,18 @@ export class Orchestrator {
451
707
  async runPhase(phaseName, context) {
452
708
  // Фильтруем плагины для данной фазы
453
709
  const phasePlugins = this.plugins.filter(plugin => plugin.metadata.phase === phaseName);
454
- // Сортируем по priority (больше = раньше)
455
- phasePlugins.sort((a, b) => (b.metadata.priority || 0) - (a.metadata.priority || 0));
710
+ // Topological sort by dependencies (REG-367)
711
+ const pluginMap = new Map(phasePlugins.map(p => [p.metadata.name, p]));
712
+ const sortedIds = toposort(phasePlugins.map(p => ({
713
+ id: p.metadata.name,
714
+ dependencies: p.metadata.dependencies ?? [],
715
+ })));
716
+ phasePlugins.length = 0;
717
+ for (const id of sortedIds) {
718
+ const plugin = pluginMap.get(id);
719
+ if (plugin)
720
+ phasePlugins.push(plugin);
721
+ }
456
722
  // Выполняем плагины последовательно
457
723
  for (let i = 0; i < phasePlugins.length; i++) {
458
724
  const plugin = phasePlugins[i];
@@ -468,6 +734,8 @@ export class Orchestrator {
468
734
  forceAnalysis: this.forceAnalysis,
469
735
  logger: this.logger,
470
736
  strictMode: this.strictMode, // REG-330: Pass strict mode flag
737
+ // REG-76: Pass rootPrefix for multi-root workspace support
738
+ rootPrefix: context.rootPrefix,
471
739
  };
472
740
  // Add reportIssue for VALIDATION phase
473
741
  if (phaseName === 'VALIDATION') {
@@ -488,6 +756,13 @@ export class Orchestrator {
488
756
  const result = await plugin.execute(pluginContext);
489
757
  // Collect errors into diagnostics
490
758
  this.diagnosticCollector.addFromPluginResult(phaseName, plugin.metadata.name, result);
759
+ // REG-357: Collect suppressedByIgnore from ENRICHMENT plugin results
760
+ if (phaseName === 'ENRICHMENT' && result.metadata) {
761
+ const suppressed = result.metadata.suppressedByIgnore;
762
+ if (typeof suppressed === 'number') {
763
+ this.suppressedByIgnoreCount += suppressed;
764
+ }
765
+ }
491
766
  // Log plugin completion with warning if errors occurred
492
767
  if (!result.success) {
493
768
  console.warn(`[Orchestrator] Plugin ${plugin.metadata.name} reported failure`, {
@@ -496,10 +771,18 @@ export class Orchestrator {
496
771
  });
497
772
  }
498
773
  // Check for fatal errors - STOP immediately
774
+ // REG-357: In strict mode ENRICHMENT, don't halt on strict mode errors.
775
+ // The strict mode barrier after ENRICHMENT handles them collectively.
499
776
  if (this.diagnosticCollector.hasFatal()) {
500
777
  const allDiagnostics = this.diagnosticCollector.getAll();
501
- const fatal = allDiagnostics.find(d => d.severity === 'fatal');
502
- throw new Error(`Fatal error in ${plugin.metadata.name}: ${fatal?.message || 'Unknown fatal error'}`);
778
+ const fatals = allDiagnostics.filter(d => d.severity === 'fatal');
779
+ // Skip halt only if ALL fatals are strict mode errors during ENRICHMENT.
780
+ // If any non-strict fatal exists, halt immediately.
781
+ const allStrictErrors = fatals.every(d => d.code.startsWith('STRICT_'));
782
+ if (!(this.strictMode && phaseName === 'ENRICHMENT' && allStrictErrors)) {
783
+ const fatal = fatals[0];
784
+ throw new Error(`Fatal error in ${plugin.metadata.name}: ${fatal?.message || 'Unknown fatal error'}`);
785
+ }
503
786
  }
504
787
  }
505
788
  catch (e) {
@@ -544,15 +827,14 @@ export class Orchestrator {
544
827
  const maxWorkers = this.parallelConfig.maxWorkers || null;
545
828
  // Get the database path from the main graph backend
546
829
  const mainDbPath = this.graph.dbPath || join(manifest.projectPath, '.grafema', 'graph.rfdb');
547
- console.log(`[Orchestrator] Starting queue-based parallel analysis...`);
548
- console.log(`[Orchestrator] Using database: ${mainDbPath}`);
830
+ this.logger.debug('Starting queue-based parallel analysis', { database: mainDbPath });
549
831
  // Start RFDB server using the SAME database as main graph
550
832
  await this.startRfdbServer(socketPath, mainDbPath);
551
833
  // Get ANALYSIS plugins that should run in workers
552
834
  const analysisPlugins = this.plugins
553
835
  .filter(p => p.metadata?.phase === 'ANALYSIS')
554
836
  .map(p => p.metadata.name);
555
- console.log(`[Orchestrator] Analysis plugins: ${analysisPlugins.join(', ')}`);
837
+ this.logger.debug('Analysis plugins', { plugins: analysisPlugins });
556
838
  // Create analysis queue
557
839
  this.analysisQueue = new AnalysisQueue({
558
840
  socketPath,
@@ -575,7 +857,7 @@ export class Orchestrator {
575
857
  });
576
858
  moduleCount++;
577
859
  }
578
- console.log(`[Orchestrator] Queued ${moduleCount} modules for analysis...`);
860
+ this.logger.debug('Queued modules for analysis', { count: moduleCount });
579
861
  // Subscribe to progress events
580
862
  this.analysisQueue.on('taskCompleted', ({ file, stats, duration }) => {
581
863
  this.onProgress({
@@ -585,12 +867,16 @@ export class Orchestrator {
585
867
  });
586
868
  });
587
869
  this.analysisQueue.on('taskFailed', ({ file, error }) => {
588
- console.error(`[Orchestrator] Analysis failed for ${file}: ${error}`);
870
+ this.logger.error('Analysis failed', { file, error });
589
871
  });
590
872
  // Wait for all tasks to complete (barrier)
591
873
  const stats = await this.analysisQueue.waitForCompletion();
592
- console.log(`[Orchestrator] Queue complete: ${stats.nodesCreated} nodes, ${stats.edgesCreated} edges`);
593
- console.log(`[Orchestrator] ${stats.tasksCompleted} succeeded, ${stats.tasksFailed} failed`);
874
+ this.logger.debug('Queue complete', {
875
+ nodesCreated: stats.nodesCreated,
876
+ edgesCreated: stats.edgesCreated,
877
+ succeeded: stats.tasksCompleted,
878
+ failed: stats.tasksFailed
879
+ });
594
880
  // Stop workers and server
595
881
  await this.analysisQueue.stop();
596
882
  this.analysisQueue = null;
@@ -611,14 +897,14 @@ export class Orchestrator {
611
897
  await testClient.connect();
612
898
  await testClient.ping();
613
899
  await testClient.close();
614
- console.log(`[Orchestrator] Using existing RFDB server at ${socketPath}`);
900
+ this.logger.debug('Using existing RFDB server', { socketPath });
615
901
  this.rfdbServerProcess = null; // Mark that we didn't start the server
616
902
  this._serverWasExternal = true;
617
903
  return;
618
904
  }
619
- catch (e) {
905
+ catch {
620
906
  // Socket exists but server not responding, remove stale socket
621
- console.log(`[Orchestrator] Stale socket found, removing...`);
907
+ this.logger.debug('Stale socket found, removing');
622
908
  unlinkSync(socketPath);
623
909
  }
624
910
  }
@@ -628,14 +914,14 @@ export class Orchestrator {
628
914
  const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
629
915
  let binaryPath = existsSync(serverBinary) ? serverBinary : debugBinary;
630
916
  if (!existsSync(binaryPath)) {
631
- console.log(`[Orchestrator] RFDB server binary not found at ${binaryPath}, building...`);
917
+ this.logger.debug('RFDB server binary not found, building', { path: binaryPath });
632
918
  execSync('cargo build --bin rfdb-server', {
633
919
  cwd: join(projectRoot, 'packages/rfdb-server'),
634
920
  stdio: 'inherit',
635
921
  });
636
922
  binaryPath = debugBinary;
637
923
  }
638
- console.log(`[Orchestrator] Starting RFDB server: ${binaryPath} with db: ${dbPath}`);
924
+ this.logger.debug('Starting RFDB server', { binary: binaryPath, database: dbPath });
639
925
  this.rfdbServerProcess = spawn(binaryPath, [dbPath, '--socket', socketPath], {
640
926
  stdio: ['ignore', 'pipe', 'pipe'],
641
927
  });
@@ -643,7 +929,7 @@ export class Orchestrator {
643
929
  this.rfdbServerProcess.stderr?.on('data', (data) => {
644
930
  const msg = data.toString().trim();
645
931
  if (!msg.includes('FLUSH') && !msg.includes('WRITER')) {
646
- console.log(`[rfdb-server] ${msg}`);
932
+ this.logger.debug('rfdb-server', { message: msg });
647
933
  }
648
934
  });
649
935
  // Wait for server to start
@@ -655,7 +941,7 @@ export class Orchestrator {
655
941
  if (!existsSync(socketPath)) {
656
942
  throw new Error('RFDB server failed to start');
657
943
  }
658
- console.log(`[Orchestrator] RFDB server started on ${socketPath}`);
944
+ this.logger.debug('RFDB server started', { socketPath });
659
945
  }
660
946
  /**
661
947
  * Stop RFDB server process (only if we started it)
@@ -663,14 +949,15 @@ export class Orchestrator {
663
949
  async stopRfdbServer() {
664
950
  // Don't stop external server (started by MCP or another process)
665
951
  if (this._serverWasExternal) {
666
- console.log(`[Orchestrator] Leaving external RFDB server running`);
952
+ this.logger.debug('Leaving external RFDB server running');
667
953
  return;
668
954
  }
669
955
  if (this.rfdbServerProcess) {
670
956
  this.rfdbServerProcess.kill('SIGTERM');
671
957
  await sleep(200);
672
958
  this.rfdbServerProcess = null;
673
- console.log(`[Orchestrator] RFDB server stopped`);
959
+ this.logger.debug('RFDB server stopped');
674
960
  }
675
961
  }
676
962
  }
963
+ //# sourceMappingURL=Orchestrator.js.map