Conversation
…per tab Forward agent-flagged in-page channel functions to the node MCP endpoint (ports the bridge from #376 onto 0.10), and make each connected browser tab visible and addressable: a built-in devframe:agent:list-clients tool, a reserved client_id argument on forwarded tools, and focus-aware default routing so an unaddressed call follows the tab the user looked at last. devframe connect nests the tab list under mcp.clients per instance. Closes #394
◈ PR Lens
Architecture 10 components touched across 3 lanes. Play the interactive walkthrough Inside the changed components — 2 viewsComponent view — Browser Agent Bridge In-tab registry and RPC sync bridge forwarding page functions to Devframe Component view — Client Agent Manager Node session manager tracking tabs, focus state, and routing tool calls Data flow
Follow each request, response and payload The other flows — 1 sequence
View
Tip Click the link under each diagram to open it on a canvas you can zoom, pan and step through 🪧 More tips
Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closes #394. MVP of the plan discussed there.
What changes
With several tabs of the same app open, the MCP surface behaved as if there were one client:
devframe connectlists instances per port, and in-page tools (from #376) were silently owned by whichever tab synced last.@devframes/agenticera):agent-flagged in-page channel functions register in a per-document browser-agent registry and sync to the node over the page's RPC connection; the node exposes them as MCP tools and relays calls back. Not yet on main, so it lands here as the foundation.sessionStorage-backed instance id, so it survives reloads), URL, title,visible,focused. Re-synced on connect, tool changes, andfocus/blur/visibilitychange.devframe:agent:list-clients(wiredevframe_agent_list-clients): built-in tool listing the connected tabs and the tool ids each exposes. Appears once a tab is connected, so a devframe with no agent surface of its own doesn't flip MCP auto-mount.tools/liststays deduped (one entry per tool id). Forwarded tools take a reservedclient_idargument; an unknown id fails with the newDF0081listing the live ids. Withoutclient_id, the call goes to the most recently focused visible tab, falling back to the last-synced one — which is what medula's vendored patch approximated with "last sync wins".devframe connect:list-instancesnestsmcp.clientsper instance (fetched in the same MCP session it already opens to list tools);call-toolpassesclient_idthrough.DF0080(the feat: eagerly expose in-page tools to browser agents #376jsonSerializableguard, renumbered sinceDF0078is taken on main) andDF0081pages.Verification
client_idtargeting/stripping, missing id, no re-publish on focus-only re-sync).tools/listdedup + injectedclient_idschema,list-clientsoutput, addressed/unaddressed/missing-id calls, focus follow.pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm buildgreen (knip's remaining items are the pre-existing unbuilt-starter hints).Known limits (MVP)
sessionStorage, so two tabs can briefly share an id; targeting then picks the better-ranked one.Supersedes the in-page-tools part of #376 (ported and extended here).
This PR was created with the help of an agent.