Studio internals
Studio is a Vue 3 + Vite app that reads two things:
- Static manifest —
.nwire/*.jsonproduced by the scanner at build time. - Live telemetry stream —
/_nwire/telemetry/*exposed by the running app.
It does not import any framework runtime. Anything Studio renders, you can also get over plain HTTP.
The scanner
@nwire/scan walks the app's modules and produces:
.nwire/
├── manifest.json — top-level app shape
├── actions.json — every defineAction with persona/journeyStep/slo
├── events.json — every defineEvent with outcome/audience
├── actors.json — every defineActor with schema/states/stuckThresholds
├── projections.json — every defineProjection with sourceEvents
├── queries.json — every defineQuery
├── workflows.json — every defineWorkflow with states/timers
├── routes.json — HTTP transport surface
├── modules.json — module declarations + needs + provides
└── graph.json — derived: cross-module dep graphThe scanner runs:
- On
nwire cache(one-shot). - Automatically through the Vite plugin during
nwire dev. - In Studio's middleware on first request (so a fresh clone produces a manifest without prebuild).
The live endpoints
httpInterface({ inspect: true }) mounts under /_nwire/:
| Path | Purpose |
|---|---|
/_nwire/manifest | Returns the static manifest |
/_nwire/telemetry/recent?limit=100 | Ring buffer of recent records |
/_nwire/telemetry/stream | SSE stream of live records |
/_nwire/dispatch | POST a JSON envelope, the runtime dispatches it (Studio dispatch UI) |
One ring buffer is shared per wire so multi-app dev-all doesn't fork the stream.
The runner
@nwire/runner powers the Studio Run page. The supervisor spawns the chosen topology as a child process, streams stdout/stderr, monitors health, and feeds telemetry into the same SSE channel.
The two-terminal workflow (one for the app, one for Studio) collapses to one Studio window.
Pages
- Overview — counts (actions, events, actors, projections), version, last build.
- Topology — Vue Flow graph of module dependencies.
- Modules — per-module browser.
- Actions / Events / Actors / Projections / Queries / Workflows / Resolvers — typed list + per-item drill-down.
- Routes — HTTP surface.
- Live — telemetry stream with filters.
- EventStorm — three reading levels (events-only / process flow / detailed) with Play Trace replay.
- Run — pick a topology, start, stream stdout.
- Dispatch — form-driven dispatch of any action.
OSS vs Cloud
- OSS (this repo) — static manifest + single-deploy live stream.
- Cloud (future
@nwire/studio-cloud) — history, multi-deploy, AI debug, team accounts.