feat(kit): enrich launcher view with command binding, terminal digest, and session navigation#435
Open
antfubot wants to merge 7 commits into
Open
feat(kit): enrich launcher view with command binding, terminal digest, and session navigation#435antfubot wants to merge 7 commits into
antfubot wants to merge 7 commits into
Conversation
…, and session navigation Bump devframe to 0.7.3 and build a small process-control launcher on top of its new cross-iframe dock-activation API (hub:docks:activate + terminal session focus). - kit: superset launcher fields (command / terminalSessionId / digest), a createLineDigest/tailSessionDigest helper, and command binding for createInstallLauncher; DEVTOOLS_TERMINALS_DOCK_ID constant. - core: ViewLauncher renders a live digest line and a 'View in Terminal' action; the shell handles the devframe:docks:activate broadcast to switch the active dock; hub:docks:activate declared on the client surface. - vitest: launcher binds a start command and streams a startup digest with a jump-to-session action. - docs + stories + tests + regenerated API snapshots.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
Compose the launcher primitives (register + command binding + spawn + tailSessionDigest + session navigation) into a single call for the common 'spawn a long-running process and stay a launcher' case. Integrations that swap the launcher for another view (e.g. Vitest's iframe) keep composing the primitives directly.
…e Vitest onto it Add prepare (pre-launch commands), a lazy process resolver, and serve.onReady to createProcessLauncher: run commands, start a server, stream its startup digest, then swap the launcher to an iframe embedding the server once ready. Migrate DevToolsVitestUI onto the factory — it now covers the full install → spawn → wait → embed flow through one primitive, keeping its own readiness probe and diagnostics (VTDT0001/VTDT0002).
…n a Retry When a launcher's process exits before its server is ready (e.g. Vitest's 'No test files found, exiting with code 1'), the launcher now: - fails fast instead of blocking on the readiness probe — createProcessLauncher races serve.onReady against the process exit and raises DTK0052 the moment the process dies; - reflects the failure on the card with the error message; and - turns the launch button into a clickable Retry (ViewLauncher enables the button on 'error' and shows the reason). Also fix the on-launch bridge: it cached the in-flight launch promise and never cleared it, so a Retry click returned the old settled promise and did nothing. The cache now clears on settle, so retries re-run. Adds DTK0052 (+ docs), unit tests for the fail-fast path and the retry behaviour, and an Error story.
…tput tail
Replace the launcher's terminal-tail preview with a short progress/status line.
- kit: drop the launcher `digest` field, the `createLineDigest`/`tailSessionDigest`
helpers, and all output tailing; add a `progress` field. createProcessLauncher
now sets lifecycle phases ("Waiting for the server…", "Running", "Finished")
rather than streaming raw output.
- core: ViewLauncher shows a plain progress line (with a spinner while loading)
instead of the monospace output preview; the "View in Terminal" action still
links to the session's full output.
Updates docs, story, tests, and API snapshots.
devframe/@devframes/hub -> ^0.7.5 (plugins stay ^0.7.4 until published). 0.7.5 promotes the launcher command/terminalSessionId/digest fields and the hub:docks:activate client RPC upstream (devframe#109) and fixes the RpcFunctionsHost export regression, so: - kit: drop the DevToolsLauncherExtras superset shim; DevToolsViewLauncher / DevToolsDockEntry are plain hub re-exports again. Launchers use hub's native digest (author-set progress line) and rely on the bound command (onLaunch is now optional) — createProcessLauncher and createInstallLauncher drop their onLaunch wrappers. - core: docks-on-launch prefers onLaunch, falls back to the bound command; drop the local hub:docks:activate declaration (hub declares it now). - compat: devframe >=0.7.4 declares its RPC name maps in a bundled chunk, so RPC-name augmentation must target devframe/types directly (renamed re-export aliases no longer merge) — retarget core/vite/rolldown/oxc; add devframe as a devDep to vite + rolldown. ws.ts reaches devframe's @internal RPC wiring through a narrow local shape now that the public RpcFunctionsHost type hides it. Regenerated API snapshots; lint/test/typecheck/build all pass.
# Conflicts: # packages/core/src/client/webcomponents/.generated/css.ts
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.
Description
Turns the launcher dock view into a small process-control card and consumes devframe 0.7.3's new cross-iframe dock-activation API.
A launcher can now:
launcher.commandlinks the launch action to a registered command, so the launch button, the command palette, and any keybinding all run one handler.launcher.progressline reflecting what the process is doing (e.g. "Waiting for the server…", "Running"), rather than a raw output preview.hub:docks:activate({ dockId, params: { sessionId } }).createProcessLaunchercomposes these primitives for the two common shapes, in one call:serve): spawn a long-running process and stay a launcher, showing its running/finished status (dev servers, watchers, builds).prepare+serve.onReady): run some commands, start a server, then replace the card with an iframe embedding the server once it's ready. This is the most common shape, and Vitest uses it end-to-end (install@vitest/uion demand → spawnvitest --ui→ wait → embed).Robust failure handling. If the process exits before its server is ready (e.g. Vitest's
No test files found, exiting with code 1), the launcher fails fast — the readiness probe is raced against the process exit (DTK0052) — surfaces the reason on the card, and turns the launch button into a clickable Retry. (The on-launch bridge was also fixed: it cached the in-flight promise and never cleared it, so retries did nothing.)What's included
devframe+@devframes/*catalog): bringshub:docks:activate(cross-iframe dock activation) and terminal-session focus-by-id.command/terminalSessionId/progress) — a deliberate downstream shim (see below); they ride the existingdevframe:docksshared-state sync untouched.createProcessLauncher— register + command binding +prepare+ spawn + progress + session navigation, with an optionalserve.onReadythat swaps the launcher to an iframe once a server is up, and fail-fast on early exit.createInstallLauncherbinds its install action to a command.DEVTOOLS_TERMINALS_DOCK_IDconstant;DTK0052diagnostic.ViewLauncher.vuerenders the progress line + View in Terminal button, and a clickable Retry with the failure reason on error.devframe:docks:activatebroadcast and switches the active dock (our shell runs its own dock machinery rather than hub's client host).hub:docks:activateon the client-callable surface (hub ships the node handler but doesn't augment the client type).docks-on-launchclears its in-flight cache on settle so Retry re-runs.DevToolsVitestUIis now a thincreateProcessLauncherconfig (install-on-demand → spawn → wait → swap to iframe), keeping its own readiness probe and diagnostics (VTDT0001/VTDT0002).createProcessLauncher(terminal + server + fail-fast), the on-launch retry/dedupe behavior, and command-binding assertions, plus regenerated tsnapi export snapshots.Gates:
pnpm lint && pnpm test && pnpm typecheck && pnpm buildall pass.Linked Issues
Additional context
Upstream follow-up (non-blocking). By this repo's dependency-boundary rule, a launcher that binds a command, shows process progress, and navigates to a session is a hub concern. This PR ships it as a downstream shim (the kit superset fields + client rendering) on top of 0.7.3. A natural follow-up promotes these into
@devframes/hub's launcher type as first-class fields — mirroring the #431 → devframe#103 precedent — after which the kit superset can be dropped. A proposal draft for that upstream change is ready to file.Reviewers: worth a look at the
devframe:docks:activatebroadcast handler inpackages/core/src/client/webcomponents/state/context.ts, the launcher superset inpackages/kit/src/types/docks.ts, andcreateProcessLauncher's serve-mode swap + fail-fast inpackages/kit/src/node/create-process-launcher.ts.This PR was created with the help of an agent.