feat(inspect): add Instances tab listing running devframe dev servers - #159
Merged
Conversation
Surface the other devframe instances running on the machine as a read-only directory inside the inspector, mirroring what the `devframe connect` bin discovers. A new node-side query RPC `devframes:plugin:inspect:list-instances` wraps the shared instance registry (`listLiveDevframeInstances`, now public from `devframe/node`); the SPA renders each instance with its SPA URL, port, pid, root and uptime, marks the current process, and pins it first. The RPC is live (not baked into the static dump) and not agent-exposed, so the tab appears only against a live backend and doesn't duplicate the connect bin's MCP discovery.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Give the Instances tab a self-describing empty state — what it lists, where discovery comes from (`~/.devframe/instances/`), and how to make instances appear (start another dev server, or a host that calls `registerDevframeInstance`; note the disable env var) — plus a one-line toolbar hint. Register the in-process example hub hosts in the instance registry so they show up in the tab like any standalone devframe: the vite-devframe-hub (which the tab previously left empty) and the a11y-messages-playground, mirroring the next-devframe-hub that already self-registers. Registration waits for the dev server to listen, reuses its own origin, and is folded into teardown so restarts don't leave ghost records. READMEs updated to keep the hub examples at parity.
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.
What
Adds an Instances tab to
@devframes/plugin-inspect— a read-only directory of the other devframe dev servers currently running on the machine, mirroring the discovery that powers the framework'sdevframe connectbin.The inspector stays current-process-focused: this tab visualizes the neighbouring instances without changing what the rest of the inspector points at, so it keeps devframe's single-integration scope intact.
How
listLiveDevframeInstancesfromdevframe/node(registration was already public; live discovery now is too) so surfaces beyond the connector can enumerate instances.devframes:plugin:inspect:list-instanceswraps that discovery (shared registry at~/.devframe/instances/+__connection.jsonliveness probe) and projects each record to a JSON-safe shape with a ready-to-open SPA URL and anisCurrentflag matched by pid.InstancesSmart/InstancesView+ Storybook stories), wired into the shared segmented tab selector after History with a broadcast icon. Each row shows the display name, a link to the instance's SPA (origin+basePath, opened in a new tab), port, pid, root dir, uptime, and an MCP-available badge. The current instance is badged and pinned first, then the rest by newest.Scope notes
build/spamode via the existingisStatic()check) and doesn't duplicate thedevframe connectbin's MCP instance-discovery tool.Verification
pnpm lint,pnpm knip,pnpm typecheck,pnpm build, and the inspect + exports (tsnapi API snapshot) test suites all pass. API snapshots updated for the two new public symbols.This PR was created with the help of an agent.