Skip to content

feat(hub): launcher command-binding, terminal digest & session-navigation#109

Merged
antfu merged 1 commit into
mainfrom
feat/launcher-command-digest-session-nav
Jul 17, 2026
Merged

feat(hub): launcher command-binding, terminal digest & session-navigation#109
antfu merged 1 commit into
mainfrom
feat/launcher-command-digest-session-nav

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Why

Vite DevTools built a "process-control launcher" downstream (vitejs/devtools#435): a launcher that binds a command, streams a one-line terminal digest, and offers to jump to its terminal session. By devframe's own boundary (docks/terminals/commands are hub concerns) these belong in @devframes/hub's DevframeViewLauncher, not as a kit-side superset — mirroring the #431 → #103 precedent (interim Vite-side shim, then absorbed upstream).

What

  • Launcher fields. DevframeViewLauncher.launcher gains optional command / terminalSessionId / digest, and onLaunch becomes optional.
    • command — bound command id; the launch button, palette entry, and keybinding share one handler. It is the serializable launch path: a viewer running out of process dispatches it over hub:commands:execute, since a function (onLaunch) is dropped when the entry is projected into the devframe:docks shared state.
    • terminalSessionId — the tracked session, powering a first-class "view in terminal" action that calls hub:docks:activate with { sessionId }.
    • digest — latest progress line, author-set via docks.update(), for inline display.
  • Live process status. startChildProcess sessions now keep status in step with the process: runningstopped on a clean exit, error on a non-zero exit or spawn failure, emitting terminal:session:updated on each transition. terminate()/restart() and signal kills read as deliberate stops, not errors. (Previously status was frozen at spawn time — a latent bug.) Consumers map session status + getResult().exitCode onto launcher.status/error.
  • Client-callable RPC surface. Every hub client-callable RPC — hub:docks:activate, hub:commands:execute, hub:messages:*, hub:terminals:* — is now declared on DevframeRpcServerFunctions, so rpc.call(...) type-checks arguments and return values and the as any casts in host.ts / messages.ts drop out.

Notes

  • Per discussion, the optional createLineDigest helper and the node-side observe-output API were scoped out of this PR; digest stays a plain author-set field.
  • API export snapshots are unchanged: only interface members were added (no new exported names), which the name-level tsnapi snapshots don't track.
  • Once landed, Vite DevTools can drop its kit superset (DevToolsLauncherExtras) and its client-side hub:docks:activate declaration.

Created with the help of an agent.

…tion

Promote the downstream "process-control launcher" pattern into the hub's
own DevframeViewLauncher, keeping docks/terminals/commands a hub concern:

- Launcher gains optional command / terminalSessionId / digest fields, and
  onLaunch becomes optional. command is the serializable launch path (a
  viewer dispatches it over hub:commands:execute since a function is dropped
  when the entry is projected into devframe:docks); terminalSessionId powers
  a first-class "view in terminal" affordance via hub:docks:activate; digest
  carries the latest progress line for inline display.
- Child-process sessions now keep status live: running -> stopped on a clean
  exit, error on a non-zero exit or spawn failure, with terminal:session:updated
  emitted on each transition (terminate()/restart() and signal kills read as
  deliberate stops, not errors). Previously status was frozen at spawn time.
- Every hub client-callable RPC (hub:docks:activate, hub:commands:execute,
  hub:messages:*, hub:terminals:*) is declared on DevframeRpcServerFunctions,
  so rpc.call(...) type-checks them and the as-any casts drop out.

Docs and tests updated; API export snapshots unchanged (only interface
members were added).

Created with the help of an agent.
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 6c27c76
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a59bbfd5ea876000844063c
😎 Deploy Preview https://deploy-preview-109--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.

@antfu
antfu merged commit 1cf6f1a into main Jul 17, 2026
11 of 12 checks passed
@antfu
antfu deleted the feat/launcher-command-digest-session-nav branch July 17, 2026 05:31
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