dashboard

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dashboard serves the Chronos visual studio: a read-only API over sessions, checkpoints, graph topology, and per-session cost, plus start/resume/time-travel actions that build a fresh graph.Runner against an application-supplied GraphRegistry. It is mounted by the ChronosOS control plane (os/server.go) behind the same auth/tenant chain as every other /api/ route; approvals and live streaming reuse the existing /api/approval/* and /api/agui/stream endpoints rather than duplicating them here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UI

func UI() http.Handler

UI returns an http.Handler serving the dashboard's single-page web UI (no external CDN or build step — plain HTML/CSS/JS embedded in the binary). Mount it under a path prefix with http.StripPrefix.

Types

type GraphRegistry

type GraphRegistry map[string]*graph.CompiledGraph

GraphRegistry maps an agent id (storage.Session.AgentID) to the compiled graph that agent runs. The dashboard uses it to render a session's graph topology and to build the Runner for resume/time-travel requests. Without one configured (WithGraphs), those actions return 501.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the dashboard's API. Configure it with the With* methods before mounting; it holds no other mutable state.

func New

func New(store storage.Storage, broker *stream.Broker) *Handler

New creates a dashboard Handler over the given store and broker.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches on the request path (relative to the mount point — callers strip their own prefix, e.g. "/api/dashboard/", before serving).

func (*Handler) WithCostTracker

func (h *Handler) WithCostTracker(ct *hooks.CostTracker) *Handler

WithCostTracker enriches the dashboard with per-session token/cost reporting from an already-wired engine/hooks.CostTracker.

func (*Handler) WithGraphs

func (h *Handler) WithGraphs(g GraphRegistry) *Handler

WithGraphs registers the compiled graphs the dashboard may render and resume, keyed by agent id.

func (*Handler) WithTracer

func (h *Handler) WithTracer(t graph.Tracer) *Handler

WithTracer attaches a tracer so runners built for resume/time-travel record spans the same way the original run did.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL