Skip to content

Add the Artifacts console pages - #1472

Draft
RhysSullivan wants to merge 4 commits into
artifact-render-uifrom
artifact-console
Draft

Add the Artifacts console pages#1472
RhysSullivan wants to merge 4 commits into
artifact-render-uifrom
artifact-console

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Console UI for persisted artifacts, completing the feature.

  • /artifacts list page (sidebar nav on all hosts) with rename/delete
  • /artifacts/$artifactId detail page rendering the stored JSX live in the embedded shell over an HTTP-backed host (executions API), including the trusted elicitation approval flow — this page is the deep-link target non-MCP-Apps clients receive
  • Shell embedding inverted through an ArtifactRendererProvider seam to avoid a react↔shell package cycle
  • artifacts added to reserved org slugs (plus toolkits, a pre-existing gap)
  • Cross-target e2e scenarios green on selfhost: render → fallback URL → page renders in sandbox → list/show tools → rename/delete round-trip

Stack

  1. Add artifact table and core artifacts API #1470
  2. Add first-party render-ui MCP tools and the MCP-Apps shell #1471
  3. Add the Artifacts console pages #1472 👈 current

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
executor-cloud 705fd94 Jul 28 2026, 07:11 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 705fd94 Commit Preview URL

Branch Preview URL
Jul 28 2026, 07:11 PM

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-1472.executor-e2e.workers.dev
MCP https://executor-preview-pr-1472.executor-e2e.workers.dev/mcp
Deployed commit 705fd94

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1472

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1472

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1472

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1472

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1472

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1472

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1472

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1472

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1472

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1472

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1472

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1472

executor

npm i https://pkg.pr.new/executor@1472

commit: 705fd94

The MCP-Apps shell imports @tailwindcss/browser, which touches document at
import scope. Importing the shell statically from the root routes put it in
cloud's SSR graph, so every document request failed with "document is not
defined" while the entry graph loaded.

The renderer seam now carries an async loader instead of a component. The
composition roots register the shell through a dynamic import that only
resolves in the browser, and the artifact page renders a placeholder frame
server-side, hydrating the shell behind ClientOnly and Suspense.
The artifact page mounted McpAppsShell as a React component in the console
document. The shell is written to be its own document: it imports
@tailwindcss/browser and its globals.css at import scope, and themes by
toggling document.documentElement. Inlined, its palette overwrote the
console's grayscale tokens for the rest of the session, and its content-height
notifications reached no host, so tall artifacts clipped.

The page now loads the built shell document — the same bytes served as
ui://executor/shell.html — into a sandboxed iframe and implements the host
half of the protocol with ext-apps' AppBridge over PostMessageTransport. The
stored source arrives as tool-input plus a tool-result carrying
structuredContent.code, exactly as after a render-ui call, so the shell takes
one path in every host. callServerTool routes to the existing HTTP mapping,
size-changed drives the iframe height, and theme travels as host context.

A new mcpAppsShellAsset vite plugin builds the shell and emits it into the
client output (client only; the worker never serves it), exporting just its
hashed URL so the document stays out of the console's JS.

Two shell bugs the host exposed:

- The shell registered its one-shot tool-input/tool-result handlers in a mount
  effect, after connect() had completed the handshake, so a prompt host's
  delivery was dropped. They are captured in onAppCreated and replayed once the
  shell has mounted.
- The shell capped its height at a hardcoded 800px. It now honors the
  protocol's containerDimensions and otherwise reports true content height,
  leaving the frame to the host.

e2e asserts the console's tokens and stylesheet count are unchanged after
rendering while the shell keeps its own palette one document down, and that a
40-row artifact grows the frame past its initial height. Both guards were
mutation-tested.
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