@@ -53,6 +53,11 @@ def map_workflow(self, workflow: WDL.Tree.Workflow, imports: List[WDLImport], wd
5353 name = workflow .name
5454 description = self ._extract_description (workflow )
5555 parameter_meta = self ._extract_parameter_meta (workflow )
56+ meta = self ._parse_meta (workflow )
57+
58+ # Extract author and email from meta
59+ author = meta .get ('author' )
60+ email = meta .get ('email' )
5661
5762 # Parse inputs and outputs
5863 inputs = [self ._parse_input (inp .value , parameter_meta ) for inp in workflow .available_inputs ]
@@ -75,16 +80,24 @@ def map_workflow(self, workflow: WDL.Tree.Workflow, imports: List[WDLImport], wd
7580 calls = calls ,
7681 docker_images = docker_images ,
7782 mermaid_graph = mermaid_graph ,
83+ meta = meta ,
84+ author = author ,
85+ email = email ,
7886 )
7987
8088 def map_task (self , task : WDL .Tree .Task ) -> WDLTask :
8189 """Map a miniwdl Task object to domain WDLTask."""
8290 name = task .name
8391 description = self ._extract_description (task )
84- meta = self ._extract_parameter_meta (task )
92+ parameter_meta = self ._extract_parameter_meta (task )
93+ meta = self ._parse_meta (task )
94+
95+ # Extract author and email from meta
96+ author = meta .get ('author' )
97+ email = meta .get ('email' )
8598
8699 # Parse inputs and outputs
87- inputs = [self ._parse_input (inp .value , meta ) for inp in task .available_inputs ]
100+ inputs = [self ._parse_input (inp .value , parameter_meta ) for inp in task .available_inputs ]
88101 outputs = [self ._parse_output (out ) for out in task .outputs ] if task .outputs else []
89102
90103 # Parse command
@@ -100,6 +113,9 @@ def map_task(self, task: WDL.Tree.Task) -> WDLTask:
100113 outputs = outputs ,
101114 command = command ,
102115 runtime = runtime ,
116+ meta = meta ,
117+ author = author ,
118+ email = email ,
103119 )
104120
105121 @staticmethod
@@ -287,6 +303,17 @@ def _extract_description(obj) -> Optional[str]:
287303 if "description" in obj .meta :
288304 return str (obj .meta ["description" ])
289305 return None
306+
307+ @staticmethod
308+ def _parse_meta (obj ) -> Dict [str , str ]:
309+ """Parse meta section and return all metadata as dict."""
310+ meta = {}
311+
312+ if hasattr (obj , "meta" ) and obj .meta :
313+ for key , value in obj .meta .items ():
314+ meta [key ] = str (value )
315+
316+ return meta
290317
291318 @staticmethod
292319 def _extract_parameter_meta (obj ) -> dict [str , str ]:
0 commit comments