MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / process

Function process

yaml-flow-editor/src/utils/collectModules.ts:142–164  ·  view source on GitHub ↗
(yamlContent: string)

Source from the content-addressed store, hash-verified

140
141 // Recursively process a YAML string
142 function process(yamlContent: string) {
143 let parsed: unknown;
144 try {
145 parsed = yamlLib.load(yamlContent);
146 } catch {
147 return;
148 }
149 if (!parsed || typeof parsed !== 'object') return;
150 const workflow = (parsed as Record<string, unknown>).workflow;
151 if (!Array.isArray(workflow)) return;
152
153 const paths = extractModulePaths(workflow as WorkflowStep[]);
154 for (const p of paths) {
155 if (visited.has(p)) continue;
156 visited.add(p);
157 const content = resolveContent(p);
158 if (content) {
159 result.set(p, content);
160 // Recurse into this module's YAML
161 process(content);
162 }
163 }
164 }
165
166 // Start with the main YAML
167 process(mainYaml);

Callers 1

collectDependentModulesFunction · 0.85

Calls 2

extractModulePathsFunction · 0.85
resolveContentFunction · 0.85

Tested by

no test coverage detected