Coverage for src / mcp_server_langgraph / builder / importer / __init__.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2025-12-03 00:43 +0000

1""" 

2Code Import System for Visual Workflow Builder 

3 

4Enables round-trip capability: Python ↔ Visual 

5 

6Features: 

7- Parse Python LangGraph code 

8- Extract workflow structure (nodes, edges, state) 

9- Auto-layout for visual canvas 

10- Type inference for node configurations 

11 

12This completes the round-trip: 

13- Visual → Code (export) ✅ 

14- Code → Visual (import) ✅ 

15 

16Example: 

17 from mcp_server_langgraph.builder.importer import import_from_file 

18 

19 # Import existing Python agent 

20 workflow = import_from_file("src/agents/my_agent.py") 

21 

22 # Now edit visually in builder 

23 # workflow contains nodes, edges, positions for canvas 

24""" 

25 

26from .ast_parser import PythonCodeParser 

27from .graph_extractor import GraphExtractor 

28from .importer import import_from_code, import_from_file, validate_import 

29from .layout_engine import LayoutEngine 

30 

31__all__ = [ 

32 "GraphExtractor", 

33 "LayoutEngine", 

34 "PythonCodeParser", 

35 "import_from_code", 

36 "import_from_file", 

37 "validate_import", 

38]