feat(visual-plan): native builder.io visual-plan replica — Phase 1 (all 3 providers)#30
Merged
Conversation
… plans Add a GITS-native visual plan model (block registry, content patches, anchored comments) and wire a thread.visual-plan-upserted event through the orchestration engine end-to-end: decider, projector, SQL projection (migration 031), and the snapshot read-model hydration paths. This is the data plane for the builder.io visual-plan parity feature (Phase 1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a minimal Streamable-HTTP MCP server (JSON-RPC over POST) at /api/gits/visual-plan/mcp exposing get-plan-blocks, create/update/ get-visual-plan, get-plan-feedback and export-visual-plan. Calls are authenticated by a per-session bearer token resolved to a thread via an in-memory registry, then dispatched into the orchestration engine so the plan renders live. Includes patch application + markdown export helpers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… registry Mint a per-session bearer token (process-global registry singleton) and pass it to the Claude Agent SDK via an http mcpServers entry pointing at the loopback visual-plan MCP endpoint, so Claude can author/update the plan that renders live in GITS. Registry is a module singleton shared by the route and adapter (no layer requirement to thread through providers). Cursor/Codex wiring tracked as follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ime state Thread.visualPlans flows: orchestration event -> client-runtime reducer -> EnvironmentState.visualPlanByThreadId -> threadDerivation -> store thread. Adds the reducer case, the normalized state slice, and the selector so the panel can read the live plan document. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… wiring Add VisualPlanPanel (typed block-registry renderer: rich-text, callout, checklist, table, code, annotated-code, file-tree, implementation-map, api-endpoint, data-model, question-form, tabs, columns) and mount it as a right-hand panel (inline + sheet) mutually exclusive with the plan sidebar. A 'Visual Plan' composer toggle appears once a plan exists. Adds --wf-* wireframe token aliases for the Phase 3 canvas. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ed files Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…adapters Cursor: pass an ACP http McpServer descriptor (per-session token) through AcpSessionRuntime mcpServers into session/new + session/load. Codex: register the visual-plan MCP via the per-thread thread/start config override (config.mcp_servers, streamable HTTP + bearer_token) — no shared config.toml mutation needed. All three providers now author the same plan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drive the served /api/gits/visual-plan/mcp route end-to-end with a minted session token: initialize -> tools/list -> tools/call get-plan-blocks (the sequence every provider MCP client runs on connect), plus invalid-token rejection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ecko95
marked this pull request as ready for review
June 20, 2026 19:21
Ecko95
added a commit
that referenced
this pull request
Jun 20, 2026
…it, send-back Builds on Phase 1 (PR #30). Adds the web→server write path that comments and edits both need, plus diagram rendering and send-to-agent. Contracts - Move pure plan model (applyPlanPatches/exportPlanToMarkdown) + new comment helpers (upsertPlanComment/resolvePlanComment) into @t3tools/contracts so the server write paths and the web panel's optimistic updates/export share one impl. - Add gits.visualPlan.mutate RPC: VisualPlanMutateInput/Result + error. Server - visualPlanWrite.ts: shared loadVisualPlanState/upsertVisualPlanState + mutateVisualPlan (patches → comment → resolve → round-trip thread.visual-plan. upsert). Keeps the MCP registry cache coherent so the agent's get-plan-feedback sees web comments. http.ts (MCP) refactored to reuse it; ws.ts wires the RPC. Web - diagram/custom-html render inert agent HTML in a fully sandboxed iframe (sandbox="", opaque origin) with size caps, script/handler/URL stripping, and --wf-* theme injection (lib/visualPlanHtml.ts). - VisualPlanPanel: text-selection + per-block anchored comments with a composer and routing (agent/human); resolve; in-panel editing of rich-text/checklist (@dnd-kit reorder)/callout/table emitting PlanContentPatches; optimistic local apply + persist via the mutate RPC; "send to agent" exporting markdown and dispatching a turn (ChatView wiring, reuses buildPlanImplementationPrompt). Tests: contracts model + sanitizer + comment-anchor unit tests; server HTTP/WS integration (web mutate → plan + get-plan-feedback + export coherence); panel render test asserting the sandboxed iframe strips scripts. All 4 packages typecheck clean; web build green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
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.
Native Visual Plan for GITS (builder.io
visual-planparity) — Phase 1Replicates Builder.io's
visual-planskill natively inside GITS with zero dependency on@agent-native/core, their hosted app, the local bridge, or their MCP. The agent authors a typed, structured plan that renders live in a new interactive side panel; all three providers (Claude / Codex / Cursor) are wired.How it works
The MCP handler runs in-process, resolves the calling thread from a per-session bearer token (a process-global registry singleton), and dispatches a
thread.visual-plan-upsertedevent carrying a typedPlanContentblock document.Included (Phase 1 — all three providers)
packages/contracts/src/visualPlan.ts): typed block registry (rich-text, callout, checklist, table, code, annotated-code, file-tree, implementation-map, api-endpoint, data-model, question-form, tabs, columns),PlanContentPatch, flatPlanCommentAnchor.thread.visual-plan-upsertedthrough decider → projector → SQL projection (migration 031) → snapshot hydration → WS → web store / client-runtime.mcpServershttp), Cursor (ACPMcpServerhttp viaAcpSessionRuntime), Codex (per-threadthread/startconfig.mcp_serversoverride — noconfig.tomlmutation)..claude/skills/visual-plan/SKILL.md.VisualPlanPanelblock renderer + ChatView mount (inline + sheet, lazy-loaded) + composer toggle +--wf-*wireframe theme tokens.Verification
gitsbase (contracts / server / web / client-runtime).Note on history
These commits were authored on a local base and replayed (cherry-picked) onto
origin/gits; conflicts inserver.ts,ChatView.tsx,ChatComposer.tsx, andserver.test.tswere resolved to preserve bothgits's recent work (Delamain sidebar, MCP inventory, lazy panels, review pipeline) and the visual-plan additions.Deferred (follow-up phases)
🤖 Generated with Claude Code