MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / parseMetaYamlActions

Function parseMetaYamlActions

apps/webuiapps/src/lib/appRegistry.ts:249–266  ·  view source on GitHub ↗

* Parse action definitions from meta.yaml * Standard array format: actions: [{ type, name, description, params: [{ name, type, ... }] }]

(yamlContent: string)

Source from the content-addressed store, hash-verified

247 * Standard array format: actions: [{ type, name, description, params: [{ name, type, ... }] }]
248 */
249function parseMetaYamlActions(yamlContent: string): AppActionDef[] {
250 const actions: AppActionDef[] = [];
251
252 // Check for actions: [] (inline empty)
253 if (/^actions:\s*\[\]\s*$/m.test(yamlContent)) return actions;
254
255 // Find the actions: section
256 const actionsMatch = yamlContent.match(/^actions:\s*$/m);
257 if (!actionsMatch) return actions;
258
259 const actionsStart = actionsMatch.index! + actionsMatch[0].length;
260 const restContent = yamlContent.slice(actionsStart);
261
262 const lines = restContent.split('\n');
263 parseStandardActions(lines, actions);
264
265 return actions;
266}
267
268function parseStandardActions(lines: string[], actions: AppActionDef[]): void {
269 let i = 0;

Callers 1

loadActionsFromMetaFunction · 0.85

Calls 1

parseStandardActionsFunction · 0.85

Tested by

no test coverage detected