Skip to content

feat(mcp-apps): bundle pinned chart, icon, motion and 3D libraries - #6463

Merged
reachjalil merged 1 commit into
devfrom
feat/mcp-app-libraries
Oct 24, 2026
Merged

reachjalil merged 1 commit into
devfrom
feat/mcp-app-libraries

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

Apps built in OpenWork can use a small set of libraries for icons, charts, animation and 3D, plus SVG drawing, behind one feature flag.

What problem does it solve?

Agents could only write plain React, so dashboards lacked real charts and icons, and 3D or animated views were impossible.

What was the situation before?

Any import failed with "cannot use module imports or reexports", and <svg> was refused.

How is this implemented?

  • ee/apps/den-api/src/generated-app-libraries.ts lists the libraries: lucide-react, recharts, motion/react, three and its OrbitControls. All are pinned in den-api's package.json.
  • The compiler resolves only those imports, from den-api's own dependencies, into the App's script. Library code imports React through checked modules, so library-rendered elements pass the same checks as authored JSX. The CSP is unchanged.
  • mcpAppLibraries (default off) is read for the editor on every create and update. When it is on, prepare_app lists the imports and how to use each one.
  • Builds that use libraries may reach 1536 KiB. apps/server reads resources up to that bound. Builds without libraries are byte-identical to before.

What else changed?

  • Pinned the four packages in den-api. The lockfile only adds them.
  • Added a CI step for the desktop resource-limit test.

Release note

Apps built in OpenWork can show charts, icons, animation and 3D views when built-in libraries are turned on for you.

Evidence

No E2E. ee/apps/den-api/test/generated-app-libraries.test.ts: before, each library import is refused; after, each builds into a self-contained App, and off builds are unchanged.

Apps built in OpenWork could only use injected React, so charts, icons,
animation and 3D had to be hand-drawn or were impossible. With the
mcpAppLibraries feature on for the editor, an App may import lucide-react,
recharts, motion/react, and three with OrbitControls. Den bundles its own
pinned copy into the App's hash-authorized script; authors never install a
package or load a CDN, and an App carries only what it imports.

One catalogue (generated-app-libraries.ts) drives the compiler's import
policy, prepare_app's nextSteps and the build errors, which name the import
to change. Library code reaches React through checked modules, so elements a
library renders pass the same element and attribute checks as authored JSX.
With libraries on, Apps may also draw inline SVG (minus elements that load or
rewrite content) and use requestAnimationFrame. The App CSP is unchanged: no
network, data: images only.

Apps with libraries may compile to 1536 KiB and store 2 MiB; the desktop
host now reads resources up to the same bound. Apps without libraries build
the same bytes as before and keep the 768 KiB and 1 MiB limits.

Signed-off-by: Jalil <reachjalil@gmail.com>
@mintlify

mintlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
differentai 🟢 Ready View Preview Oct 24, 2026, 1:15 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Oct 24, 2026 1:16am UTC
openwork-den Ready Ready Preview Oct 24, 2026 1:16am UTC
openwork-diagnostics Ready Ready Preview Oct 24, 2026 1:16am UTC
openwork-landing Ready Ready Preview, v0 Oct 24, 2026 1:16am UTC

Request Review

@reachjalil
reachjalil deployed to pr-internal-specs October 24, 2026 01:15 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟡 Updating evidence 0c9a2f2 View run 2026-10-24 01:16:01 UTC

A preview for this commit is being prepared.

@diff-warden

diff-warden Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warden: approved

No high or medium security findings and no confidentiality findings.

Reviewed 0c9a2f2e3427 · Warden run · Updates after every Warden run.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden clearance. Complete security and confidentiality review of 0c9a2f2e342777d9dac0109d3c522c95d631dd05 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@reachjalil
reachjalil merged commit b412f04 into dev Oct 24, 2026
43 of 45 checks passed

This branch was successfully deployed

6 active deployments
Preview – openwork-app — 0c9a2f2e Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-landing — 0c9a2f2e Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-den — 0c9a2f2e Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-diagnostics — 0c9a2f2e Deployed Oct 24, 2026 by vercel[bot]
staging - packages/docs — 0c9a2f2e Deployed Oct 24, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant