Skip to content

feat(inspect): add Instances tab listing running devframe dev servers - #159

Merged
antfu merged 2 commits into
mainfrom
feat/inspect-instances-tab
Aug 4, 2026
Merged

feat(inspect): add Instances tab listing running devframe dev servers#159
antfu merged 2 commits into
mainfrom
feat/inspect-instances-tab

Conversation

@antfubot

@antfubot antfubot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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's devframe connect bin.

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

  • Exposes listLiveDevframeInstances from devframe/node (registration was already public; live discovery now is too) so surfaces beyond the connector can enumerate instances.
  • New node-side query RPC devframes:plugin:inspect:list-instances wraps that discovery (shared registry at ~/.devframe/instances/ + __connection.json liveness probe) and projects each record to a JSON-safe shape with a ready-to-open SPA URL and an isCurrent flag matched by pid.
  • New Vue surface following the existing Smart/View split (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

  • The RPC is live, not baked into the static dump, and is not agent-exposed — so the tab appears only against a live backend (hidden in build/spa mode via the existing isStatic() check) and doesn't duplicate the devframe connect bin'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.

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.
@netlify

netlify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit bc583c9
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a717163c1ee6c000805910d
😎 Deploy Preview https://deploy-preview-159--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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.
@antfu
antfu merged commit 69b027d into main Aug 4, 2026
12 checks passed
@antfu
antfu deleted the feat/inspect-instances-tab branch August 4, 2026 05:14
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.

2 participants