Documentation
¶
Overview ¶
Package studio is the Inspector: a read-only UI over a run store, served by Go alone.
T1 (TODO §12, plan docs/phase2b-studio-plan.md) shows the runs list and the run page — steps with their tool calls and results, subagents inline, truncation badged, event replay at 1×/4×, raw JSON — plus agent and tool cards from the manifest. The UI is a TanStack Start SPA (ADR 0018), prebuilt into the committed dist/ and embedded here; users of this module never run Bun.
Handler is the whole mount surface:
mux.Handle("/studio/", http.StripPrefix("/studio", studio.Handler(s)))
It serves the embedded UI with a history fallback (deep links survive reload) and a read-only JSON API under api/: meta, runs, runs/{id}, runs/{id}/events, manifest. The API is the contract boundary (ADR 0018 Consequences): its types are written by hand in api.go and mirrored in web/src/lib/api.ts, pinned on the Go side by golden tests and on the TS side by type-checking against the same golden files.
Two rules keep one bundle able to serve local, self-hosted and hosted Studio without hosting code in T1 (ADR 0018 §8):
- api/meta reports capabilities — the open Handler reports none. The UI gates every deployment-specific screen on a named capability; a hosted server declares them with Capabilities(…).
- a run's events are paged through api/runs/{id}/events, never inline in the run document, so neither response size nor client memory grows with run length and a live tail is the same endpoint read from the last position.
Index ¶
Constants ¶
const Version = "v0.1.0"
Version is the studio module's tag, reported by api/meta. It moves when the module is released, nothing else.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler serves Studio: the embedded UI and its read-only JSON API over s. Mount it under a prefix with http.StripPrefix, or at the root of its own mux:
mux.Handle("/studio/", http.StripPrefix("/studio", studio.Handler(s)))
T1 calls only List and Get on s (plan §0 D5). The handler does not bind a port — the caller chooses the address; bind loopback until token auth exists (features doc L4).
Types ¶
type Option ¶
type Option func(*config)
Option configures Handler.
func Base ¶
Base is the URL path Studio is mounted at, with leading and trailing slash. Default "/studio/". It is written into the shell's <base href> per request and becomes the router's basepath, so the same bundle mounts anywhere (ADR 0018 §6).
func Capabilities ¶
Capabilities declares named API capabilities the backing server provides beyond the open Handler (ADR 0018 §8). The open handler reports none: the UI gates every deployment-specific screen on a capability, so a hosted server wraps Handler, adds its auth and routes, and declares what it carries — there is no hosted-only UI build, and no hostname checks or build flags anywhere.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
module
|
|
|
examples
|
|
|
basic
command
Command basic records demo runs — a tool call, a subagent, a failure — into a SQLite store and serves Studio on 127.0.0.1:7331:
|
Command basic records demo runs — a tool call, a subagent, a failure — into a SQLite store and serves Studio on 127.0.0.1:7331: |







