@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.
- package/dist/Orchestrator.d.ts +37 -0
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +322 -35
- package/dist/Orchestrator.js.map +1 -0
- package/dist/api/GraphAPI.d.ts +1 -1
- package/dist/api/GraphAPI.d.ts.map +1 -1
- package/dist/api/GraphAPI.js +3 -1
- package/dist/api/GraphAPI.js.map +1 -0
- package/dist/api/GuaranteeAPI.d.ts.map +1 -1
- package/dist/api/GuaranteeAPI.js +4 -2
- package/dist/api/GuaranteeAPI.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +66 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +77 -3
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -4
- package/dist/core/ASTWorker.js.map +1 -0
- package/dist/core/ASTWorkerPool.js +2 -1
- package/dist/core/ASTWorkerPool.js.map +1 -0
- package/dist/core/AnalysisQueue.js +1 -0
- package/dist/core/AnalysisQueue.js.map +1 -0
- package/dist/core/CoverageAnalyzer.d.ts.map +1 -1
- package/dist/core/CoverageAnalyzer.js +1 -0
- package/dist/core/CoverageAnalyzer.js.map +1 -0
- package/dist/core/FileExplainer.js +1 -0
- package/dist/core/FileExplainer.js.map +1 -0
- package/dist/core/FileNodeManager.d.ts.map +1 -1
- package/dist/core/FileNodeManager.js +4 -2
- package/dist/core/FileNodeManager.js.map +1 -0
- package/dist/core/GraphBackend.js +1 -0
- package/dist/core/GraphBackend.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.js +1 -0
- package/dist/core/GraphFreshnessChecker.js.map +1 -0
- package/dist/core/GuaranteeManager.js +2 -1
- package/dist/core/GuaranteeManager.js.map +1 -0
- package/dist/core/HashUtils.js +1 -0
- package/dist/core/HashUtils.js.map +1 -0
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +7 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -0
- package/dist/core/ManifestStore.js +1 -0
- package/dist/core/ManifestStore.js.map +1 -0
- package/dist/core/NodeFactory.d.ts +54 -34
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +20 -1
- package/dist/core/NodeFactory.js.map +1 -0
- package/dist/core/NodeId.js +1 -0
- package/dist/core/NodeId.js.map +1 -0
- package/dist/core/PriorityQueue.js +1 -0
- package/dist/core/PriorityQueue.js.map +1 -0
- package/dist/core/Profiler.js +1 -0
- package/dist/core/Profiler.js.map +1 -0
- package/dist/core/ScopeTracker.js +1 -0
- package/dist/core/ScopeTracker.js.map +1 -0
- package/dist/core/SemanticId.js +1 -0
- package/dist/core/SemanticId.js.map +1 -0
- package/dist/core/Task.js +1 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/TaskTypes.js +1 -0
- package/dist/core/TaskTypes.js.map +1 -0
- package/dist/core/VersionManager.js +1 -0
- package/dist/core/VersionManager.js.map +1 -0
- package/dist/core/WorkerPool.d.ts.map +1 -1
- package/dist/core/WorkerPool.js +3 -1
- package/dist/core/WorkerPool.js.map +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js.map +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js.map +1 -0
- package/dist/core/nodes/BranchNode.js +1 -0
- package/dist/core/nodes/BranchNode.js.map +1 -0
- package/dist/core/nodes/CallSiteNode.js +1 -0
- package/dist/core/nodes/CallSiteNode.js.map +1 -0
- package/dist/core/nodes/CaseNode.js +1 -0
- package/dist/core/nodes/CaseNode.js.map +1 -0
- package/dist/core/nodes/ClassNode.js +1 -0
- package/dist/core/nodes/ClassNode.js.map +1 -0
- package/dist/core/nodes/ConstantNode.js +1 -0
- package/dist/core/nodes/ConstantNode.js.map +1 -0
- package/dist/core/nodes/ConstructorCallNode.js +1 -0
- package/dist/core/nodes/ConstructorCallNode.js.map +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js.map +1 -0
- package/dist/core/nodes/DecoratorNode.js +1 -0
- package/dist/core/nodes/DecoratorNode.js.map +1 -0
- package/dist/core/nodes/EntrypointNode.js +1 -0
- package/dist/core/nodes/EntrypointNode.js.map +1 -0
- package/dist/core/nodes/EnumNode.js +1 -0
- package/dist/core/nodes/EnumNode.js.map +1 -0
- package/dist/core/nodes/EventListenerNode.js +1 -0
- package/dist/core/nodes/EventListenerNode.js.map +1 -0
- package/dist/core/nodes/ExportNode.js +1 -0
- package/dist/core/nodes/ExportNode.js.map +1 -0
- package/dist/core/nodes/ExpressionNode.js +1 -0
- package/dist/core/nodes/ExpressionNode.js.map +1 -0
- package/dist/core/nodes/ExternalModuleNode.js +1 -0
- package/dist/core/nodes/ExternalModuleNode.js.map +1 -0
- package/dist/core/nodes/ExternalStdioNode.js +1 -0
- package/dist/core/nodes/ExternalStdioNode.js.map +1 -0
- package/dist/core/nodes/FunctionNode.js +1 -0
- package/dist/core/nodes/FunctionNode.js.map +1 -0
- package/dist/core/nodes/GuaranteeNode.js +1 -0
- package/dist/core/nodes/GuaranteeNode.js.map +1 -0
- package/dist/core/nodes/HttpRequestNode.js +1 -0
- package/dist/core/nodes/HttpRequestNode.js.map +1 -0
- package/dist/core/nodes/ImportNode.js +1 -0
- package/dist/core/nodes/ImportNode.js.map +1 -0
- package/dist/core/nodes/InterfaceNode.js +1 -0
- package/dist/core/nodes/InterfaceNode.js.map +1 -0
- package/dist/core/nodes/IssueNode.js +1 -0
- package/dist/core/nodes/IssueNode.js.map +1 -0
- package/dist/core/nodes/LiteralNode.js +1 -0
- package/dist/core/nodes/LiteralNode.js.map +1 -0
- package/dist/core/nodes/MethodCallNode.js +1 -0
- package/dist/core/nodes/MethodCallNode.js.map +1 -0
- package/dist/core/nodes/MethodNode.js +1 -0
- package/dist/core/nodes/MethodNode.js.map +1 -0
- package/dist/core/nodes/ModuleNode.js +1 -0
- package/dist/core/nodes/ModuleNode.js.map +1 -0
- package/dist/core/nodes/NetworkRequestNode.js +1 -0
- package/dist/core/nodes/NetworkRequestNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +5 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +11 -0
- package/dist/core/nodes/NodeKind.js.map +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js.map +1 -0
- package/dist/core/nodes/ParameterNode.js +1 -0
- package/dist/core/nodes/ParameterNode.js.map +1 -0
- package/dist/core/nodes/PluginNode.d.ts +69 -0
- package/dist/core/nodes/PluginNode.d.ts.map +1 -0
- package/dist/core/nodes/PluginNode.js +106 -0
- package/dist/core/nodes/PluginNode.js.map +1 -0
- package/dist/core/nodes/ScopeNode.js +1 -0
- package/dist/core/nodes/ScopeNode.js.map +1 -0
- package/dist/core/nodes/ServiceNode.js +1 -0
- package/dist/core/nodes/ServiceNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.js +2 -1
- package/dist/core/nodes/TypeNode.js.map +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +2 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +4 -1
- package/dist/core/nodes/index.js.map +1 -0
- package/dist/core/toposort.d.ts +38 -0
- package/dist/core/toposort.d.ts.map +1 -0
- package/dist/core/toposort.js +129 -0
- package/dist/core/toposort.js.map +1 -0
- package/dist/data/builtins/BuiltinRegistry.js +1 -0
- package/dist/data/builtins/BuiltinRegistry.js.map +1 -0
- package/dist/data/builtins/definitions.js +1 -0
- package/dist/data/builtins/definitions.js.map +1 -0
- package/dist/data/builtins/index.js +1 -0
- package/dist/data/builtins/index.js.map +1 -0
- package/dist/data/builtins/jsGlobals.js +1 -0
- package/dist/data/builtins/jsGlobals.js.map +1 -0
- package/dist/data/builtins/types.js +1 -0
- package/dist/data/builtins/types.js.map +1 -0
- package/dist/data/globals/definitions.js +1 -0
- package/dist/data/globals/definitions.js.map +1 -0
- package/dist/data/globals/index.js +1 -0
- package/dist/data/globals/index.js.map +1 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts +5 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticCollector.js +4 -0
- package/dist/diagnostics/DiagnosticCollector.js.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts +23 -1
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticReporter.js +68 -15
- package/dist/diagnostics/DiagnosticReporter.js.map +1 -0
- package/dist/diagnostics/DiagnosticWriter.js +1 -0
- package/dist/diagnostics/DiagnosticWriter.js.map +1 -0
- package/dist/diagnostics/categories.d.ts +57 -0
- package/dist/diagnostics/categories.d.ts.map +1 -0
- package/dist/diagnostics/categories.js +71 -0
- package/dist/diagnostics/categories.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -1
- package/dist/diagnostics/index.js +4 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/errors/GrafemaError.d.ts +39 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -1
- package/dist/errors/GrafemaError.js +28 -0
- package/dist/errors/GrafemaError.js.map +1 -0
- package/dist/index.d.ts +21 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -0
- package/dist/instructions/index.d.ts +8 -0
- package/dist/instructions/index.d.ts.map +1 -0
- package/dist/instructions/index.js +20 -0
- package/dist/instructions/index.js.map +1 -0
- package/dist/instructions/onboarding.md +121 -0
- package/dist/logging/Logger.d.ts +53 -3
- package/dist/logging/Logger.d.ts.map +1 -1
- package/dist/logging/Logger.js +144 -4
- package/dist/logging/Logger.js.map +1 -0
- package/dist/plugins/Plugin.js +1 -0
- package/dist/plugins/Plugin.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +20 -14
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +23 -16
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +2 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +53 -76
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +47 -37
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +8 -14
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +144 -97
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -5
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +59 -2
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +926 -422
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -19
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +39 -26
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +14 -7
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +33 -28
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +24 -14
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +19 -11
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js.map +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +58 -6
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +440 -56
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +152 -1
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/types.js +1 -0
- package/dist/plugins/analysis/ast/types.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts +27 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js +45 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.js +1 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/location.js +1 -0
- package/dist/plugins/analysis/ast/utils/location.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +3 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +9 -2
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +145 -14
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +198 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +4 -3
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +5 -2
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +83 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +258 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/index.js +2 -0
- package/dist/plugins/analysis/ast/visitors/index.js.map +1 -0
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts +42 -10
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js +17 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +3 -2
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +3 -2
- package/dist/plugins/discovery/SimpleProjectDiscovery.js.map +1 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/WorkspaceDiscovery.js +3 -2
- package/dist/plugins/discovery/WorkspaceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js.map +1 -0
- package/dist/plugins/discovery/workspaces/detector.js +1 -0
- package/dist/plugins/discovery/workspaces/detector.js.map +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js.map +1 -0
- package/dist/plugins/discovery/workspaces/index.js +1 -0
- package/dist/plugins/discovery/workspaces/index.js.map +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js.map +1 -0
- package/dist/plugins/enrichment/AliasTracker.js +3 -2
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts +21 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +137 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts +5 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +11 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +2 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +51 -13
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -0
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -2
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +39 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +422 -11
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +7 -23
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +2 -2
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +5 -4
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts +30 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +190 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +4 -3
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +22 -29
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +22 -31
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +11 -5
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -0
- package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -1
- package/dist/plugins/validation/BrokenImportValidator.js +3 -3
- package/dist/plugins/validation/BrokenImportValidator.js.map +1 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +3 -3
- package/dist/plugins/validation/CallResolverValidator.js.map +1 -0
- package/dist/plugins/validation/DataFlowValidator.js +2 -1
- package/dist/plugins/validation/DataFlowValidator.js.map +1 -0
- package/dist/plugins/validation/EvalBanValidator.js +2 -1
- package/dist/plugins/validation/EvalBanValidator.js.map +1 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js +2 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js.map +1 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
- package/dist/plugins/validation/SQLInjectionValidator.js +4 -2
- package/dist/plugins/validation/SQLInjectionValidator.js.map +1 -0
- package/dist/plugins/validation/ShadowingDetector.js +2 -1
- package/dist/plugins/validation/ShadowingDetector.js.map +1 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +3 -3
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js.map +1 -0
- package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/GitPlugin.js +13 -6
- package/dist/plugins/vcs/GitPlugin.js.map +1 -0
- package/dist/plugins/vcs/VCSPlugin.js +1 -0
- package/dist/plugins/vcs/VCSPlugin.js.map +1 -0
- package/dist/plugins/vcs/index.js +1 -0
- package/dist/plugins/vcs/index.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts +1 -1
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +3 -2
- package/dist/queries/findCallsInFunction.js.map +1 -0
- package/dist/queries/findContainingFunction.d.ts +1 -1
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +1 -0
- package/dist/queries/findContainingFunction.js.map +1 -0
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/traceValues.d.ts.map +1 -1
- package/dist/queries/traceValues.js +1 -0
- package/dist/queries/traceValues.js.map +1 -0
- package/dist/queries/types.js +1 -0
- package/dist/queries/types.js.map +1 -0
- package/dist/schema/GraphSchemaExtractor.js +1 -0
- package/dist/schema/GraphSchemaExtractor.js.map +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js.map +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +20 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +47 -19
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -0
- package/dist/storage/backends/typeValidation.d.ts.map +1 -1
- package/dist/storage/backends/typeValidation.js +3 -0
- package/dist/storage/backends/typeValidation.js.map +1 -0
- package/dist/utils/findRfdbBinary.d.ts +39 -0
- package/dist/utils/findRfdbBinary.d.ts.map +1 -0
- package/dist/utils/findRfdbBinary.js +141 -0
- package/dist/utils/findRfdbBinary.js.map +1 -0
- package/dist/utils/moduleResolution.d.ts +134 -0
- package/dist/utils/moduleResolution.d.ts.map +1 -0
- package/dist/utils/moduleResolution.js +164 -0
- package/dist/utils/moduleResolution.js.map +1 -0
- package/dist/validation/PathValidator.d.ts.map +1 -1
- package/dist/validation/PathValidator.js +1 -0
- package/dist/validation/PathValidator.js.map +1 -0
- package/package.json +4 -3
- package/src/Orchestrator.ts +371 -41
- package/src/api/GraphAPI.ts +4 -2
- package/src/api/GuaranteeAPI.ts +3 -2
- package/src/config/ConfigLoader.ts +121 -3
- package/src/config/index.ts +7 -1
- package/src/core/ASTWorker.ts +8 -20
- package/src/core/ASTWorkerPool.ts +1 -1
- package/src/core/CoverageAnalyzer.ts +2 -2
- package/src/core/FileNodeManager.ts +3 -2
- package/src/core/GuaranteeManager.ts +1 -1
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +34 -1
- package/src/core/WorkerPool.ts +2 -1
- package/src/core/nodes/NodeKind.ts +11 -0
- package/src/core/nodes/PluginNode.ts +144 -0
- package/src/core/nodes/TypeNode.ts +1 -1
- package/src/core/nodes/index.ts +4 -0
- package/src/core/toposort.ts +160 -0
- package/src/diagnostics/DiagnosticCollector.ts +8 -1
- package/src/diagnostics/DiagnosticReporter.ts +87 -16
- package/src/diagnostics/categories.ts +104 -0
- package/src/diagnostics/index.ts +14 -0
- package/src/errors/GrafemaError.ts +58 -0
- package/src/index.ts +53 -7
- package/src/instructions/index.ts +21 -0
- package/src/instructions/onboarding.md +121 -0
- package/src/logging/Logger.ts +155 -4
- package/src/plugins/analysis/DatabaseAnalyzer.ts +22 -15
- package/src/plugins/analysis/ExpressAnalyzer.ts +30 -18
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +72 -88
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +54 -39
- package/src/plugins/analysis/FetchAnalyzer.ts +165 -113
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +6 -7
- package/src/plugins/analysis/JSASTAnalyzer.ts +1122 -487
- package/src/plugins/analysis/ReactAnalyzer.ts +27 -20
- package/src/plugins/analysis/RustAnalyzer.ts +41 -27
- package/src/plugins/analysis/SQLiteAnalyzer.ts +18 -8
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +38 -34
- package/src/plugins/analysis/SocketIOAnalyzer.ts +30 -15
- package/src/plugins/analysis/SystemDbAnalyzer.ts +24 -13
- package/src/plugins/analysis/ast/ExpressionEvaluator.ts +1 -3
- package/src/plugins/analysis/ast/GraphBuilder.ts +532 -66
- package/src/plugins/analysis/ast/types.ts +200 -2
- package/src/plugins/analysis/ast/utils/babelTraverse.ts +74 -0
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +1 -1
- package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +7 -2
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +163 -15
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +249 -3
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +9 -4
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +342 -0
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +2 -3
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +1 -27
- package/src/plugins/analysis/ast/visitors/index.ts +2 -0
- package/src/plugins/discovery/DiscoveryPlugin.ts +42 -11
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +2 -2
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +2 -2
- package/src/plugins/discovery/WorkspaceDiscovery.ts +2 -2
- package/src/plugins/discovery/workspaces/globResolver.ts +1 -1
- package/src/plugins/enrichment/AliasTracker.ts +2 -2
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +0 -1
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +0 -1
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +178 -0
- package/src/plugins/enrichment/ExternalCallResolver.ts +0 -1
- package/src/plugins/enrichment/FunctionCallResolver.ts +10 -15
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +65 -14
- package/src/plugins/enrichment/ImportExportLinker.ts +0 -1
- package/src/plugins/enrichment/InstanceOfResolver.ts +2 -2
- package/src/plugins/enrichment/MethodCallResolver.ts +526 -12
- package/src/plugins/enrichment/MountPointResolver.ts +6 -24
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +1 -2
- package/src/plugins/enrichment/PrefixEvaluator.ts +4 -4
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +253 -0
- package/src/plugins/enrichment/RustFFIEnricher.ts +0 -1
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -3
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +24 -30
- package/src/plugins/indexing/JSModuleIndexer.ts +21 -22
- package/src/plugins/indexing/RustModuleIndexer.ts +10 -5
- package/src/plugins/validation/BrokenImportValidator.ts +2 -3
- package/src/plugins/validation/CallResolverValidator.ts +2 -3
- package/src/plugins/validation/DataFlowValidator.ts +1 -1
- package/src/plugins/validation/EvalBanValidator.ts +1 -1
- package/src/plugins/validation/GraphConnectivityValidator.ts +1 -9
- package/src/plugins/validation/SQLInjectionValidator.ts +3 -2
- package/src/plugins/validation/ShadowingDetector.ts +1 -1
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +2 -3
- package/src/plugins/vcs/GitPlugin.ts +12 -6
- package/src/queries/findCallsInFunction.ts +4 -4
- package/src/queries/findContainingFunction.ts +1 -1
- package/src/queries/traceValues.ts +0 -1
- package/src/storage/backends/RFDBServerBackend.ts +56 -22
- package/src/storage/backends/typeValidation.ts +2 -0
- package/src/utils/findRfdbBinary.ts +160 -0
- package/src/utils/moduleResolution.ts +244 -0
- package/src/validation/PathValidator.ts +0 -8
- package/src/plugins/validation/NodeCreationValidator.ts +0 -554
|
@@ -8,14 +8,6 @@ import type { PluginContext, PluginMetadata, PluginResult } from '../Plugin.js';
|
|
|
8
8
|
import type { NodeRecord } from '@grafema/types';
|
|
9
9
|
import { ValidationError } from '../../errors/GrafemaError.js';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* Edge structure
|
|
13
|
-
*/
|
|
14
|
-
interface EdgeRecord {
|
|
15
|
-
src: string;
|
|
16
|
-
dst: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
11
|
|
|
20
12
|
/**
|
|
21
13
|
* Unreachable node info for manifest
|
|
@@ -51,7 +43,7 @@ export class GraphConnectivityValidator extends Plugin {
|
|
|
51
43
|
return {
|
|
52
44
|
name: 'GraphConnectivityValidator',
|
|
53
45
|
phase: 'VALIDATION',
|
|
54
|
-
|
|
46
|
+
dependencies: [],
|
|
55
47
|
creates: {
|
|
56
48
|
nodes: [],
|
|
57
49
|
edges: []
|
|
@@ -102,7 +102,7 @@ export class SQLInjectionValidator extends Plugin {
|
|
|
102
102
|
return {
|
|
103
103
|
name: 'SQLInjectionValidator',
|
|
104
104
|
phase: 'VALIDATION',
|
|
105
|
-
|
|
105
|
+
dependencies: ['ValueDomainAnalyzer'],
|
|
106
106
|
creates: {
|
|
107
107
|
nodes: ['issue:security'],
|
|
108
108
|
edges: ['AFFECTS']
|
|
@@ -396,7 +396,8 @@ export class SQLInjectionValidator extends Plugin {
|
|
|
396
396
|
}
|
|
397
397
|
} catch (err) {
|
|
398
398
|
// Datalog query might fail if backend doesn't support it
|
|
399
|
-
|
|
399
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
400
|
+
logger.debug('Datalog check skipped', { error: message });
|
|
400
401
|
}
|
|
401
402
|
|
|
402
403
|
return issues;
|
|
@@ -47,12 +47,11 @@ export class TypeScriptDeadCodeValidator extends Plugin {
|
|
|
47
47
|
return {
|
|
48
48
|
name: 'TypeScriptDeadCodeValidator',
|
|
49
49
|
phase: 'VALIDATION',
|
|
50
|
-
|
|
50
|
+
dependencies: ['JSASTAnalyzer'],
|
|
51
51
|
creates: {
|
|
52
52
|
nodes: [],
|
|
53
53
|
edges: []
|
|
54
|
-
}
|
|
55
|
-
dependencies: ['JSASTAnalyzer'] // Requires TypeScript nodes to be created
|
|
54
|
+
}
|
|
56
55
|
};
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -114,8 +114,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
114
114
|
|
|
115
115
|
return files;
|
|
116
116
|
} catch (error) {
|
|
117
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117
118
|
throw new FileAccessError(
|
|
118
|
-
`Failed to get changed files: ${
|
|
119
|
+
`Failed to get changed files: ${message}`,
|
|
119
120
|
'ERR_GIT_ACCESS_DENIED',
|
|
120
121
|
{ plugin: 'GitPlugin' },
|
|
121
122
|
'Check that git is installed and this is a valid git repository'
|
|
@@ -157,8 +158,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
157
158
|
// Парсим unified diff
|
|
158
159
|
return this._parseUnifiedDiff(filePath, stdout);
|
|
159
160
|
} catch (error) {
|
|
161
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
160
162
|
throw new FileAccessError(
|
|
161
|
-
`Failed to get diff for ${filePath}: ${
|
|
163
|
+
`Failed to get diff for ${filePath}: ${message}`,
|
|
162
164
|
'ERR_GIT_ACCESS_DENIED',
|
|
163
165
|
{ plugin: 'GitPlugin', filePath },
|
|
164
166
|
'Ensure the file is tracked by git and the working directory is accessible'
|
|
@@ -174,8 +176,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
174
176
|
const { stdout } = await this._exec('git rev-parse --abbrev-ref HEAD');
|
|
175
177
|
return stdout.trim();
|
|
176
178
|
} catch (error) {
|
|
179
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
177
180
|
throw new FileAccessError(
|
|
178
|
-
`Failed to get current branch: ${
|
|
181
|
+
`Failed to get current branch: ${message}`,
|
|
179
182
|
'ERR_GIT_ACCESS_DENIED',
|
|
180
183
|
{ plugin: 'GitPlugin' },
|
|
181
184
|
'Ensure this is a valid git repository with at least one commit'
|
|
@@ -191,8 +194,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
191
194
|
const { stdout } = await this._exec('git rev-parse HEAD');
|
|
192
195
|
return stdout.trim();
|
|
193
196
|
} catch (error) {
|
|
197
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
194
198
|
throw new FileAccessError(
|
|
195
|
-
`Failed to get last commit hash: ${
|
|
199
|
+
`Failed to get last commit hash: ${message}`,
|
|
196
200
|
'ERR_GIT_NOT_FOUND',
|
|
197
201
|
{ plugin: 'GitPlugin' },
|
|
198
202
|
'Ensure this is a valid git repository with at least one commit'
|
|
@@ -328,8 +332,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
328
332
|
const { stdout } = await this._exec('git ls-files');
|
|
329
333
|
return stdout.trim().split('\n').filter(line => line.length > 0);
|
|
330
334
|
} catch (error) {
|
|
335
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
331
336
|
throw new FileAccessError(
|
|
332
|
-
`Failed to get tracked files: ${
|
|
337
|
+
`Failed to get tracked files: ${message}`,
|
|
333
338
|
'ERR_GIT_ACCESS_DENIED',
|
|
334
339
|
{ plugin: 'GitPlugin' },
|
|
335
340
|
'Check that git is installed and this is a valid git repository'
|
|
@@ -353,8 +358,9 @@ export class GitPlugin extends VCSPlugin {
|
|
|
353
358
|
message: lines[4]
|
|
354
359
|
};
|
|
355
360
|
} catch (error) {
|
|
361
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
356
362
|
throw new FileAccessError(
|
|
357
|
-
`Failed to get last commit info: ${
|
|
363
|
+
`Failed to get last commit info: ${message}`,
|
|
358
364
|
'ERR_GIT_NOT_FOUND',
|
|
359
365
|
{ plugin: 'GitPlugin' },
|
|
360
366
|
'Ensure this is a valid git repository with at least one commit'
|
|
@@ -30,7 +30,7 @@ interface GraphBackend {
|
|
|
30
30
|
getNode(id: string): Promise<{
|
|
31
31
|
id: string;
|
|
32
32
|
type: string;
|
|
33
|
-
name
|
|
33
|
+
name?: string;
|
|
34
34
|
file?: string;
|
|
35
35
|
line?: number;
|
|
36
36
|
object?: string;
|
|
@@ -126,7 +126,7 @@ export async function findCallsInFunction(
|
|
|
126
126
|
*/
|
|
127
127
|
async function buildCallInfo(
|
|
128
128
|
backend: GraphBackend,
|
|
129
|
-
callNode: { id: string; type: string; name
|
|
129
|
+
callNode: { id: string; type: string; name?: string; file?: string; line?: number; object?: string },
|
|
130
130
|
depth: number
|
|
131
131
|
): Promise<CallInfo> {
|
|
132
132
|
// Check for CALLS edge (resolved target)
|
|
@@ -139,7 +139,7 @@ async function buildCallInfo(
|
|
|
139
139
|
if (targetNode) {
|
|
140
140
|
target = {
|
|
141
141
|
id: targetNode.id,
|
|
142
|
-
name: targetNode.name,
|
|
142
|
+
name: targetNode.name ?? '<anonymous>',
|
|
143
143
|
file: targetNode.file,
|
|
144
144
|
line: targetNode.line,
|
|
145
145
|
};
|
|
@@ -148,7 +148,7 @@ async function buildCallInfo(
|
|
|
148
148
|
|
|
149
149
|
return {
|
|
150
150
|
id: callNode.id,
|
|
151
|
-
name: callNode.name,
|
|
151
|
+
name: callNode.name ?? '<unknown>',
|
|
152
152
|
type: callNode.type as 'CALL' | 'METHOD_CALL',
|
|
153
153
|
object: callNode.object,
|
|
154
154
|
resolved: isResolved,
|
|
@@ -26,7 +26,7 @@ import { fileURLToPath } from 'url';
|
|
|
26
26
|
import { createRequire } from 'module';
|
|
27
27
|
import { setTimeout as sleep } from 'timers/promises';
|
|
28
28
|
|
|
29
|
-
import type { WireNode, WireEdge } from '@grafema/types';
|
|
29
|
+
import type { WireNode, WireEdge, FieldDeclaration, AttrQuery as RFDBAttrQuery } from '@grafema/types';
|
|
30
30
|
import type { NodeType, EdgeType } from '@grafema/types';
|
|
31
31
|
import type { BaseNodeRecord, EdgeRecord } from '@grafema/types';
|
|
32
32
|
import type { AttrQuery, GraphStats, GraphExport } from '../../core/GraphBackend.js';
|
|
@@ -46,6 +46,11 @@ export interface RFDBServerBackendOptions {
|
|
|
46
46
|
* Default: true (for backwards compatibility)
|
|
47
47
|
*/
|
|
48
48
|
autoStart?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If true, suppress all console output (for clean CLI progress).
|
|
51
|
+
* Default: false
|
|
52
|
+
*/
|
|
53
|
+
silent?: boolean;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
|
@@ -96,6 +101,7 @@ export class RFDBServerBackend {
|
|
|
96
101
|
readonly socketPath: string;
|
|
97
102
|
readonly dbPath: string | undefined;
|
|
98
103
|
private readonly autoStart: boolean;
|
|
104
|
+
private readonly silent: boolean;
|
|
99
105
|
private client: RFDBClient | null;
|
|
100
106
|
private serverProcess: ChildProcess | null;
|
|
101
107
|
connected: boolean; // Public for compatibility
|
|
@@ -106,6 +112,7 @@ export class RFDBServerBackend {
|
|
|
106
112
|
constructor(options: RFDBServerBackendOptions = {}) {
|
|
107
113
|
this.dbPath = options.dbPath;
|
|
108
114
|
this.autoStart = options.autoStart ?? true; // Default true for backwards compat
|
|
115
|
+
this.silent = options.silent ?? false;
|
|
109
116
|
// Default socket path: next to the database in .grafema folder
|
|
110
117
|
// This ensures each project has its own socket, avoiding conflicts
|
|
111
118
|
if (options.socketPath) {
|
|
@@ -121,6 +128,22 @@ export class RFDBServerBackend {
|
|
|
121
128
|
this.edgeTypes = new Set();
|
|
122
129
|
}
|
|
123
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Log message if not in silent mode.
|
|
133
|
+
*/
|
|
134
|
+
private log(message: string): void {
|
|
135
|
+
if (!this.silent) {
|
|
136
|
+
console.log(message);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Log error (always shown, even in silent mode).
|
|
142
|
+
*/
|
|
143
|
+
private logError(message: string, error?: unknown): void {
|
|
144
|
+
console.error(message, error ?? '');
|
|
145
|
+
}
|
|
146
|
+
|
|
124
147
|
/**
|
|
125
148
|
* Connect to RFDB server.
|
|
126
149
|
* If autoStart is true (default), starts the server if not running.
|
|
@@ -132,33 +155,42 @@ export class RFDBServerBackend {
|
|
|
132
155
|
// Try to connect first
|
|
133
156
|
this.client = new RFDBClient(this.socketPath);
|
|
134
157
|
|
|
158
|
+
// Attach error handler to prevent unhandled 'error' events
|
|
159
|
+
// This is important for stale sockets (socket file exists but server is dead)
|
|
160
|
+
this.client.on('error', (err: Error) => {
|
|
161
|
+
this.logError('[RFDBServerBackend] Client error:', err.message);
|
|
162
|
+
});
|
|
163
|
+
|
|
135
164
|
try {
|
|
136
165
|
await this.client.connect();
|
|
137
166
|
// Verify server is responsive
|
|
138
167
|
await this.client.ping();
|
|
139
168
|
this.connected = true;
|
|
140
|
-
|
|
169
|
+
this.log(`[RFDBServerBackend] Connected to RFDB server at ${this.socketPath}`);
|
|
141
170
|
return;
|
|
142
171
|
} catch {
|
|
143
|
-
// Server not running
|
|
172
|
+
// Server not running or stale socket
|
|
144
173
|
if (!this.autoStart) {
|
|
145
174
|
throw new Error(
|
|
146
175
|
`RFDB server not running at ${this.socketPath}\n` +
|
|
147
176
|
`Start the server first: grafema server start`
|
|
148
177
|
);
|
|
149
178
|
}
|
|
150
|
-
|
|
179
|
+
this.log(`[RFDBServerBackend] RFDB server not running, starting...`);
|
|
151
180
|
}
|
|
152
181
|
|
|
153
182
|
// Start the server (only if autoStart is true)
|
|
154
183
|
await this._startServer();
|
|
155
184
|
|
|
156
|
-
// Connect again
|
|
185
|
+
// Connect again with fresh client
|
|
157
186
|
this.client = new RFDBClient(this.socketPath);
|
|
187
|
+
this.client.on('error', (err: Error) => {
|
|
188
|
+
this.logError('[RFDBServerBackend] Client error:', err.message);
|
|
189
|
+
});
|
|
158
190
|
await this.client.connect();
|
|
159
191
|
await this.client.ping();
|
|
160
192
|
this.connected = true;
|
|
161
|
-
|
|
193
|
+
this.log(`[RFDBServerBackend] Connected to RFDB server at ${this.socketPath}`);
|
|
162
194
|
}
|
|
163
195
|
|
|
164
196
|
/**
|
|
@@ -180,14 +212,14 @@ export class RFDBServerBackend {
|
|
|
180
212
|
const projectRoot = join(__dirname, '../../../../..');
|
|
181
213
|
const releaseBinary = join(projectRoot, 'packages/rfdb-server/target/release/rfdb-server');
|
|
182
214
|
if (existsSync(releaseBinary)) {
|
|
183
|
-
|
|
215
|
+
this.log(`[RFDBServerBackend] Found release binary: ${releaseBinary}`);
|
|
184
216
|
return releaseBinary;
|
|
185
217
|
}
|
|
186
218
|
|
|
187
219
|
// 2. Check debug build
|
|
188
220
|
const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
|
|
189
221
|
if (existsSync(debugBinary)) {
|
|
190
|
-
|
|
222
|
+
this.log(`[RFDBServerBackend] Found debug binary: ${debugBinary}`);
|
|
191
223
|
return debugBinary;
|
|
192
224
|
}
|
|
193
225
|
|
|
@@ -210,7 +242,7 @@ export class RFDBServerBackend {
|
|
|
210
242
|
|
|
211
243
|
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
212
244
|
if (existsSync(npmBinary)) {
|
|
213
|
-
|
|
245
|
+
this.log(`[RFDBServerBackend] Found binary in @grafema/rfdb: ${npmBinary}`);
|
|
214
246
|
return npmBinary;
|
|
215
247
|
}
|
|
216
248
|
} catch {
|
|
@@ -220,7 +252,7 @@ export class RFDBServerBackend {
|
|
|
220
252
|
// 4. Check ~/.local/bin (user-installed binary for unsupported platforms)
|
|
221
253
|
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
222
254
|
if (existsSync(homeBinary)) {
|
|
223
|
-
|
|
255
|
+
this.log(`[RFDBServerBackend] Found user binary: ${homeBinary}`);
|
|
224
256
|
return homeBinary;
|
|
225
257
|
}
|
|
226
258
|
|
|
@@ -250,25 +282,18 @@ export class RFDBServerBackend {
|
|
|
250
282
|
unlinkSync(this.socketPath);
|
|
251
283
|
}
|
|
252
284
|
|
|
253
|
-
|
|
285
|
+
this.log(`[RFDBServerBackend] Starting: ${binaryPath} ${this.dbPath} --socket ${this.socketPath}`);
|
|
254
286
|
|
|
255
287
|
this.serverProcess = spawn(binaryPath, [this.dbPath, '--socket', this.socketPath], {
|
|
256
|
-
stdio: ['ignore', '
|
|
288
|
+
stdio: ['ignore', 'ignore', 'inherit'], // stdin/stdout ignored, stderr inherited
|
|
257
289
|
detached: true, // Allow server to outlive this process
|
|
258
290
|
});
|
|
259
291
|
|
|
260
292
|
// Don't let server process prevent parent from exiting
|
|
261
293
|
this.serverProcess.unref();
|
|
262
294
|
|
|
263
|
-
this.serverProcess.stderr?.on('data', (data: Buffer) => {
|
|
264
|
-
const msg = data.toString().trim();
|
|
265
|
-
if (!msg.includes('FLUSH') && !msg.includes('WRITER')) {
|
|
266
|
-
console.log(`[rfdb-server] ${msg}`);
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
|
|
270
295
|
this.serverProcess.on('error', (err: Error) => {
|
|
271
|
-
|
|
296
|
+
this.logError(`[RFDBServerBackend] Server process error:`, err);
|
|
272
297
|
});
|
|
273
298
|
|
|
274
299
|
// Wait for socket to appear
|
|
@@ -282,7 +307,7 @@ export class RFDBServerBackend {
|
|
|
282
307
|
throw new Error(`RFDB server failed to start (socket not created after ${attempts * 100}ms)`);
|
|
283
308
|
}
|
|
284
309
|
|
|
285
|
-
|
|
310
|
+
this.log(`[RFDBServerBackend] Server started on ${this.socketPath}`);
|
|
286
311
|
}
|
|
287
312
|
|
|
288
313
|
/**
|
|
@@ -324,6 +349,15 @@ export class RFDBServerBackend {
|
|
|
324
349
|
await this.client.flush();
|
|
325
350
|
}
|
|
326
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Declare metadata fields for server-side indexing.
|
|
354
|
+
* Persisted in metadata.json — survives database reopen.
|
|
355
|
+
*/
|
|
356
|
+
async declareFields(fields: FieldDeclaration[]): Promise<number> {
|
|
357
|
+
if (!this.client) throw new Error('Not connected');
|
|
358
|
+
return this.client.declareFields(fields);
|
|
359
|
+
}
|
|
360
|
+
|
|
327
361
|
// ===========================================================================
|
|
328
362
|
// Node Operations
|
|
329
363
|
// ===========================================================================
|
|
@@ -518,7 +552,7 @@ export class RFDBServerBackend {
|
|
|
518
552
|
}
|
|
519
553
|
|
|
520
554
|
// Otherwise use client's queryNodes
|
|
521
|
-
for await (const wireNode of this.client.queryNodes(serverQuery)) {
|
|
555
|
+
for await (const wireNode of this.client.queryNodes(serverQuery as unknown as RFDBAttrQuery)) {
|
|
522
556
|
yield this._parseNode(wireNode);
|
|
523
557
|
}
|
|
524
558
|
}
|
|
@@ -46,6 +46,8 @@ const KNOWN_EDGE_TYPES = new Set<string>([
|
|
|
46
46
|
'RETURNS', 'RECEIVES_ARGUMENT', 'READS_FROM', 'THROWS', 'REGISTERS_VIEW',
|
|
47
47
|
'GOVERNS', 'VIOLATES', 'HAS_PARAMETER', 'DERIVES_FROM',
|
|
48
48
|
'RESOLVES_TO', // Promise resolve() data flow
|
|
49
|
+
'YIELDS', // Generator yield data flow (REG-270)
|
|
50
|
+
'DELEGATES_TO', // Generator yield* delegation (REG-270)
|
|
49
51
|
]);
|
|
50
52
|
|
|
51
53
|
// Store initial edge types for reset
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for finding rfdb-server binary
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - RFDBServerBackend (core)
|
|
6
|
+
* - CLI server command
|
|
7
|
+
* - VS Code extension
|
|
8
|
+
* - rfdb-server bin wrapper
|
|
9
|
+
*
|
|
10
|
+
* Search order:
|
|
11
|
+
* 1. Explicit path (from config or flag)
|
|
12
|
+
* 2. GRAFEMA_RFDB_SERVER environment variable
|
|
13
|
+
* 3. Monorepo target/release (development)
|
|
14
|
+
* 4. Monorepo target/debug (development)
|
|
15
|
+
* 5. @grafema/rfdb npm package (prebuilt)
|
|
16
|
+
* 6. ~/.local/bin/rfdb-server (user-installed)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { existsSync } from 'fs';
|
|
20
|
+
import { join, dirname, resolve } from 'path';
|
|
21
|
+
import { createRequire } from 'module';
|
|
22
|
+
import { fileURLToPath } from 'url';
|
|
23
|
+
|
|
24
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
25
|
+
const __dirname = dirname(__filename);
|
|
26
|
+
|
|
27
|
+
export interface FindBinaryOptions {
|
|
28
|
+
/** Explicit path to binary (highest priority) */
|
|
29
|
+
explicitPath?: string;
|
|
30
|
+
/** Base directory for monorepo search (defaults to auto-detect) */
|
|
31
|
+
monorepoRoot?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get platform directory name for prebuilt binaries
|
|
36
|
+
*/
|
|
37
|
+
export function getPlatformDir(): string {
|
|
38
|
+
const platform = process.platform;
|
|
39
|
+
const arch = process.arch;
|
|
40
|
+
|
|
41
|
+
if (platform === 'darwin') {
|
|
42
|
+
return arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
43
|
+
} else if (platform === 'linux') {
|
|
44
|
+
return arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
45
|
+
}
|
|
46
|
+
return `${platform}-${arch}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Find rfdb-server binary using standard search order
|
|
51
|
+
*
|
|
52
|
+
* @param options - Search options
|
|
53
|
+
* @returns Path to binary or null if not found
|
|
54
|
+
*/
|
|
55
|
+
export function findRfdbBinary(options: FindBinaryOptions = {}): string | null {
|
|
56
|
+
// 1. Explicit path (from config or --binary flag)
|
|
57
|
+
if (options.explicitPath) {
|
|
58
|
+
const resolved = resolve(options.explicitPath);
|
|
59
|
+
if (existsSync(resolved)) {
|
|
60
|
+
return resolved;
|
|
61
|
+
}
|
|
62
|
+
// Explicit path was given but not found - don't fallback
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 2. Environment variable
|
|
67
|
+
const envBinary = process.env.GRAFEMA_RFDB_SERVER;
|
|
68
|
+
if (envBinary && existsSync(envBinary)) {
|
|
69
|
+
return envBinary;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 3-4. Monorepo development builds
|
|
73
|
+
const monorepoRoot = options.monorepoRoot || findMonorepoRoot();
|
|
74
|
+
if (monorepoRoot) {
|
|
75
|
+
const releaseBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'release', 'rfdb-server');
|
|
76
|
+
if (existsSync(releaseBinary)) {
|
|
77
|
+
return releaseBinary;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const debugBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'debug', 'rfdb-server');
|
|
81
|
+
if (existsSync(debugBinary)) {
|
|
82
|
+
return debugBinary;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 5. @grafema/rfdb npm package
|
|
87
|
+
try {
|
|
88
|
+
const require = createRequire(import.meta.url);
|
|
89
|
+
const rfdbPkg = require.resolve('@grafema/rfdb');
|
|
90
|
+
const rfdbDir = dirname(rfdbPkg);
|
|
91
|
+
const platformDir = getPlatformDir();
|
|
92
|
+
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
93
|
+
if (existsSync(npmBinary)) {
|
|
94
|
+
return npmBinary;
|
|
95
|
+
}
|
|
96
|
+
} catch {
|
|
97
|
+
// @grafema/rfdb not installed
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 6. User-installed binary in ~/.local/bin
|
|
101
|
+
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
102
|
+
if (existsSync(homeBinary)) {
|
|
103
|
+
return homeBinary;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Find monorepo root by looking for characteristic files
|
|
111
|
+
*/
|
|
112
|
+
function findMonorepoRoot(): string | null {
|
|
113
|
+
// Start from this file's location and walk up
|
|
114
|
+
const searchPaths = [
|
|
115
|
+
// From packages/core/src/utils -> packages/core -> packages -> root
|
|
116
|
+
join(__dirname, '..', '..', '..', '..'),
|
|
117
|
+
// Common development locations
|
|
118
|
+
process.env.GRAFEMA_ROOT,
|
|
119
|
+
].filter(Boolean) as string[];
|
|
120
|
+
|
|
121
|
+
for (const candidate of searchPaths) {
|
|
122
|
+
// Check for grafema monorepo markers
|
|
123
|
+
const hasPackagesDir = existsSync(join(candidate, 'packages', 'core'));
|
|
124
|
+
const hasRfdbServer = existsSync(join(candidate, 'packages', 'rfdb-server', 'Cargo.toml'));
|
|
125
|
+
if (hasPackagesDir && hasRfdbServer) {
|
|
126
|
+
return candidate;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get human-readable error message when binary not found
|
|
135
|
+
*/
|
|
136
|
+
export function getBinaryNotFoundMessage(): string {
|
|
137
|
+
const platformDir = getPlatformDir();
|
|
138
|
+
return `RFDB server binary not found for ${platformDir}
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
1. Specify path: grafema server start --binary /path/to/rfdb-server
|
|
142
|
+
|
|
143
|
+
2. Add to config.yaml:
|
|
144
|
+
server:
|
|
145
|
+
binaryPath: /path/to/rfdb-server
|
|
146
|
+
|
|
147
|
+
3. Set environment variable:
|
|
148
|
+
export GRAFEMA_RFDB_SERVER=/path/to/rfdb-server
|
|
149
|
+
|
|
150
|
+
4. Build from source and install:
|
|
151
|
+
git clone https://github.com/Disentinel/grafema.git
|
|
152
|
+
cd grafema/packages/rfdb-server
|
|
153
|
+
cargo build --release
|
|
154
|
+
mkdir -p ~/.local/bin
|
|
155
|
+
cp target/release/rfdb-server ~/.local/bin/
|
|
156
|
+
|
|
157
|
+
5. Install prebuilt (if available for your platform):
|
|
158
|
+
npm install @grafema/rfdb
|
|
159
|
+
`;
|
|
160
|
+
}
|