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

Function loadActionsFromMeta

apps/webuiapps/src/lib/appRegistry.ts:388–415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386 * Should be called once before ChatPanel first uses tool definitions.
387 */
388export async function loadActionsFromMeta(): Promise<void> {
389 if (_loaded) return;
390
391 const loaded: AppDef[] = [];
392
393 for (const app of APP_STATIC_REGISTRY) {
394 if (app.appName === 'os') {
395 loaded.push({ ...app, actions: OS_ACTIONS });
396 continue;
397 }
398
399 const metaPath = `apps/${app.appName}/meta.yaml`;
400 try {
401 const content = await idb.getFile(metaPath);
402 if (content && typeof content === 'string') {
403 const actions = parseMetaYamlActions(content);
404 loaded.push({ ...app, actions });
405 } else {
406 loaded.push({ ...app, actions: [] });
407 }
408 } catch {
409 loaded.push({ ...app, actions: [] });
410 }
411 }
412
413 APP_REGISTRY = loaded;
414 _loaded = true;
415}
416
417/**
418 * Reset loading state, forcing a reload on next call to loadActionsFromMeta

Callers 1

runConversationFunction · 0.90

Calls 2

parseMetaYamlActionsFunction · 0.85
getFileMethod · 0.80

Tested by

no test coverage detected