MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / normalizeRootString

Function normalizeRootString

packages/extension/mcp/tools/code/index.ts:577–591  ·  view source on GitHub ↗
(
  content: string,
  fallbackTag: string | undefined,
  nodeId: string,
  lang: CodeLanguage
)

Source from the content-addressed store, hash-verified

575
576 const components = await resolvePluginComponents(
577 instances.map(({ node }) => node),
578 config,
579 pluginCode,
580 preferredLang
581 )
582 instances.forEach(({ id }, resultIndex) => {
583 pluginComponents.set(id, components[resultIndex] ?? null)
584 })
585 const pluginSkipped = new Set<string>()
586
587 if (pluginComponents.size) {
588 for (const [id, component] of pluginComponents.entries()) {
589 if (!component) continue
590 const snapshot = tree.nodes.get(id)
591 if (!snapshot) continue
592 snapshot.children.forEach((childId) => skipDescendants(childId, tree, pluginSkipped))
593 }
594 }

Callers 1

stringifyComponentTreeFunction · 0.85

Calls 2

stringifyComponentFunction · 0.90
createStringifyOptionsFunction · 0.85

Tested by

no test coverage detected