99
1010import yaml
1111
12- from .interfaces import InputParser , OutputGenerator , Pipeline
12+ from sync_ai_rules .core .generator_interface import OutputGenerator
13+ from sync_ai_rules .core .parser_interface import InputParser
14+ from sync_ai_rules .core .pipeline import Pipeline
1315
1416
1517class PluginManager :
@@ -22,46 +24,33 @@ def load_plugins(self, base_path: str):
2224 """Load all pipelines from plugins.yaml configuration file."""
2325 config_path = Path (base_path ) / "plugins.yaml"
2426
25- if not config_path .exists ():
26- print (f"✗ Plugin configuration not found: { config_path } " )
27- return
27+ with open (config_path ) as f :
28+ config = yaml .safe_load (f )
2829
29- try :
30- with open (config_path ) as f :
31- config = yaml .safe_load (f )
32-
33- # Load pipelines
34- for pipeline_config in config .get ("pipelines" , []):
35- pipeline = self ._load_pipeline (base_path , pipeline_config )
36- if pipeline :
37- self .pipelines .append (pipeline )
38- print (f"✓ Loaded pipeline: { pipeline .name } - { pipeline .description } " )
39-
40- except Exception as e :
41- print (f"✗ Failed to load plugin configuration: { e } " )
30+ # Load pipelines
31+ for pipeline_config in config .get ("pipelines" , []):
32+ pipeline = self ._load_pipeline (base_path , pipeline_config )
33+ if pipeline :
34+ self .pipelines .append (pipeline )
35+ print (f"✓ Loaded pipeline: { pipeline .name } - { pipeline .description } " )
4236
4337 def _load_pipeline (self , base_path : str , config : dict ) -> Pipeline :
4438 """Load a single parser-generator pipeline."""
45- try :
46- # Load parser
47- parser_config = config ["parser" ]
48- parser = self ._load_parser (base_path , parser_config )
49-
50- # Load generator
51- generator_config = config ["generator" ]
52- generator = self ._load_generator (base_path , generator_config )
53-
54- # Create pipeline
55- return Pipeline (
56- name = config ["name" ],
57- description = config ["description" ],
58- parser = parser ,
59- generator = generator ,
60- )
61-
62- except Exception as e :
63- print (f"✗ Failed to load pipeline { config .get ('name' , 'unknown' )} : { e } " )
64- return None
39+ # Load parser
40+ parser_config = config ["parser" ]
41+ parser = self ._load_parser (base_path , parser_config )
42+
43+ # Load generator
44+ generator_config = config ["generator" ]
45+ generator = self ._load_generator (base_path , generator_config )
46+
47+ # Create pipeline
48+ return Pipeline (
49+ name = config ["name" ],
50+ description = config ["description" ],
51+ parser = parser ,
52+ generator = generator ,
53+ )
6554
6655 def _load_parser (self , base_path : str , config : dict ) -> InputParser :
6756 """Load a parser from configuration."""
0 commit comments