[PoC] Studio Web: run the Agentic UI in a browser (local + SecEx backends)#3721
Draft
lezama wants to merge 13 commits into
Draft
[PoC] Studio Web: run the Agentic UI in a browser (local + SecEx backends)#3721lezama wants to merge 13 commits into
lezama wants to merge 13 commits into
Conversation
…or and CLI web-server Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…layer) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Run the agentic UI against the wpcom studio-code SecEx endpoint straight from the browser; preview the generated site client-side via WordPress Playground. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 task
Replace the build-time token env var with the implicit OAuth flow (client 95109): log in with WordPress.com, capture the token from the redirect, keep it in localStorage. The env var stays as a fallback for scripted runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f221373 to
48ec056
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Stacked on top of
interface-improvements(the AI-focused Agentic UI). Supersedes #3693 — same idea, now branched fromAutomattic/studiodirectly (no fork remote needed) and extended to run against hosted sites via a sandbox. Directional Proof of Concept; no companion issue yet.How AI was used in this PR
Built by an AI agent (Claude Code) — including this description — then reviewed by me. The agent wrote the web connector, the CLI
web-server, the per-session git workspace + publish layer, and the SecEx connector, and verified the end-to-end flow in a real browser.Proposed Changes
A Proof of Concept that runs Studio's Agentic UI (
apps/ui) in a plain web browser as the foundation for Studio Web.apps/uialready talks to the backend only through itsConnectorinterface, so this swaps the connector and adds a small headless backend — without changing the UI itself.Two backends are wired behind the same UI:
web-server(HTTP + SSE) that runs the same Studio Code agent the desktop app does; only the transport differs from Electron IPC. Each session is bound to its own git-backed workspace, and there's a draft → publish flow (working-tree changes become a reviewable commit, pushed to a deploy remote when one is configured).studio-codeendpoint, so the full agent runs in an isolated cloud sandbox against the user's site. This needs a companion change to that endpoint (CORS on the streamed response, egress, and token handling), tracked internally.It also previews the generated site client-side via WordPress Playground, so the in-app preview needs no server-side preview proxy.
This is directional, not production-ready. The hosted path's rough edges — preview performance (Playground boot is slow), long-stream robustness (the connection can drop on long turns), durable sessions, and a real shared preview URL — are the natural follow-ups.
Testing Instructions
Local web backend (fully reproducible):
npm run cli:buildnode apps/cli/dist/cli/main.mjs web-server→ serveshttp://localhost:8088cd apps/ui && npm run dev:web→ serveshttp://localhost:5300http://localhost:5300, pick a site → New chat → send a prompt; the agent's reply streams in.Quick backend checks without the UI:
SecEx backend (needs the hosted endpoint + sandbox infra):
cd apps/ui && VITE_STUDIO_BACKEND=secex VITE_STUDIO_WPCOM_TOKEN=<wpcom oauth token> npm run dev:web→ openhttp://localhost:5300; the browser talks directly to the hostedstudio-codeendpoint and the agent runs in the sandbox.Pre-merge Checklist
tsc(apps/cli + apps/ui) and ESLint clean on the changed files.