Files
copilotkit__copilotkit/scripts
yannj-fr 7972bfadfd fix(mcp-apps-renderer): make the UMD and CJS entry points valid (Codex review)
Address two build-config findings from the Codex review of #6884.

UMD (P2-1): react-core's UMD build externalized @copilotkit/mcp-apps-renderer/activity
with no matching global, so it referenced an undefined global
(_copilotkit_mcp_apps_renderer_activity) and every script-tag consumer broke at
provider init - even without rendering an MCP app. Ship a UMD build of the
bridge-free /activity entry (dist/activity.umd.js, es2018, global
CopilotKitMcpAppsRendererActivity) and map it in react-core's two UMD builds.
Script-tag consumers load activity.umd.js before react-core's UMD; documented in
the package README and the react-core tsdown config.

CJS (P2-2): the package advertised a CommonJS root whose dist/session.cjs emitted
a synchronous require() of @modelcontextprotocol/ext-apps/app-bridge, which is
ESM-only, failing with ERR_REQUIRE_ESM. Make the root ESM-only (bindMcpApp is
loaded via dynamic import(), which resolves ESM from any context) and keep the
bridge-free ./activity entry dual ESM+CJS (what react-core's CJS build requires).
attw ignores no-resolution for the intentional ESM-only root; publint clean.

Also: es2018 UMD covered by compat-check; public API manifest regenerated.
2026-09-09 17:41:20 +02:00
..