Documentation
¶
Overview ¶
Package ui serves the awf visual graph tool: a localhost HTTP server that renders a workflow's graph (via the Slice-1 graph package) and overlays run state. Slice 2a is read-only and request-driven (static graph + snapshot overlay); the live SSE overlay is Slice 2b.
Request flow:
GET / -> embedded SPA (ui/dist) GET /api/runs -> runs for the loaded workflow (digest-filtered) GET /api/graph?run=<id> -> graph.Projection (static, or static + snapshot overlay)
projectionFor is the single place a (workflow, run) becomes a Projection; Slice 2b's SSE watch loop will call it too.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunRow ¶
type RunRow struct {
RunID string `json:"run_id"`
Status string `json:"status"`
Workflow string `json:"workflow"`
// VersionMatch is true when the run's recorded definition digest equals the digest of the
// workflow file the UI was launched against — i.e. the run executed against the current
// version. When false, the run is an earlier (or later) version of the same workflow; the
// SPA badges it. The run still renders faithfully against its own snapshot.
VersionMatch bool `json:"version_match"`
}
RunRow is one entry in GET /api/runs.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the immutable loaded workflow and an overlay cache. The workflow is loaded once at startup (editing the file requires a restart -- documented).
func New ¶
New builds a Server for an already-loaded workflow. digest is the workflow's content digest (used to filter /api/runs); stateDir is the runs/ base.
func NewLoaded ¶
func NewLoaded(ld *ir.LoadedDefinition, digest, stateDir string) *Server
NewLoaded builds a Server for a loaded workflow definition, preserving imported workflow modules for graph projection under call sites.
func (*Server) Handler ¶
Handler returns the HTTP routes. Exposed (not bound) so tests drive it via httptest.
func (*Server) WithStateErrorFormatter ¶ added in v0.6.0
func (s *Server) WithStateErrorFormatter(formatter func(operation, path string, err error) string) *Server
WithStateErrorFormatter lets the CLI apply its state-path ownership and permission diagnostic policy to request-time reads without moving state access policy into the UI package.