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

Function extractAppsFromEntries

apps/webuiapps/src/lib/cardExtractor.ts:465–499  ·  view source on GitHub ↗
(entries: Record<string, InternalEntry>)

Source from the content-addressed store, hash-verified

463// ── App extraction ─────────────────────────────────────────────────
464
465function extractAppsFromEntries(entries: Record<string, InternalEntry>): AppEntry[] {
466 const apps: AppEntry[] = [];
467
468 for (const [index, entry] of Object.entries(entries)) {
469 const content = entry.content || '';
470 const comment = entry.comment || '';
471
472 if (!content.includes('<rule S>')) continue;
473
474 const id = commentToId(comment);
475 if (!id) {
476 logger.warn(
477 'extractApps',
478 `Empty app ID from comment "${comment}" at index ${index}, skipping.`,
479 );
480 continue;
481 }
482
483 apps.push({
484 id,
485 name: comment,
486 entryIndex: parseInt(index, 10),
487 keywords: [...entry.key],
488 format: detectFormatType(content),
489 tags: extractTags(content),
490 resources: extractResources(content),
491 example: extractExample(content),
492 scripts: [],
493 imageTagPairs: [],
494 skinVariants: [],
495 });
496 }
497
498 return apps;
499}
500
501function extractLoreEntries(entries: Record<string, InternalEntry>): LoreEntry[] {
502 const lore: LoreEntry[] = [];

Callers 1

extractCardFunction · 0.85

Calls 6

commentToIdFunction · 0.85
detectFormatTypeFunction · 0.85
extractTagsFunction · 0.85
extractResourcesFunction · 0.85
extractExampleFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected