webui

package
v0.0.0-...-ea7b840 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactView

type ArtifactView struct {
	ID        string                 `json:"id"`
	Type      string                 `json:"type"`
	Phase     string                 `json:"phase"`
	Domain    string                 `json:"domain"`
	CreatedAt time.Time              `json:"created_at"`
	Data      map[string]interface{} `json:"data"`
}

ArtifactView represents an artifact for API

func SerializeArtifacts

func SerializeArtifacts(artifacts []blackboard.ArtifactEnvelope) []ArtifactView

SerializeArtifacts converts artifacts to API response

type Client

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

Client represents a WebSocket connection

type ContractView

type ContractView struct {
	Satisfied         bool     `json:"satisfied"`
	RequiredTools     []string `json:"required_tools"`
	RequiredProfiles  []string `json:"required_profiles,omitempty"`
	RequiredArtifacts []string `json:"required_artifacts"`
	Progress          float64  `json:"progress"`
	MinIterations     int      `json:"min_iterations"`
	MaxIterations     int      `json:"max_iterations"`
}

ContractView represents contract status for API

type DAGStateView

type DAGStateView struct {
	PhaseName string         `json:"phase_name"`
	Tools     []ToolCallView `json:"tools"`
	Progress  float64        `json:"progress"`
}

DAGStateView represents the DAG state for API

type EdgeView

type EdgeView struct {
	ID         string                 `json:"id"`
	Source     string                 `json:"source"`
	Target     string                 `json:"target"`
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties"`
}

EdgeView represents a graph edge for API

type Event

type Event struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
	Time    time.Time   `json:"time"`
}

Event represents a WebSocket event

type EventEmitter

type EventEmitter interface {
	EmitPhaseStart(phaseName string, objective string, iteration int)
	EmitPhaseComplete(phaseName string, status string, iteration int, duration string)
	EmitToolExecution(tool string, status string, summary string)
	EmitArtifact(artifactType string, phase string, count int)
	EmitGraphUpdate(mutation *graph.GraphMutation)
	EmitLog(level string, component string, message string, fields map[string]any)
}

EventEmitter interface for sending events to the web UI

type GraphExport

type GraphExport struct {
	Nodes []NodeView `json:"nodes"`
	Edges []EdgeView `json:"edges"`
}

GraphExport represents graph data for visualization

func SerializeGraphExport

func SerializeGraphExport(g *graph.Graph, frontier *graph.Frontier) *GraphExport

SerializeGraphExport converts graph to API response

type Hub

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

Hub maintains active WebSocket connections and broadcasts events

func NewHub

func NewHub() *Hub

NewHub creates a new WebSocket hub

func (*Hub) Broadcast

func (h *Hub) Broadcast(eventType string, payload interface{})

Broadcast sends an event to all connected clients

func (*Hub) Run

func (h *Hub) Run()

Run starts the hub's main loop

type HubEmitter

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

HubEmitter sends events to WebSocket hub

func NewHubEmitter

func NewHubEmitter(hub *Hub) *HubEmitter

NewHubEmitter creates a new hub emitter

func (*HubEmitter) EmitArtifact

func (e *HubEmitter) EmitArtifact(artifactType string, phase string, count int)

EmitArtifact emits artifact creation event

func (*HubEmitter) EmitGraphUpdate

func (e *HubEmitter) EmitGraphUpdate(mutation *graph.GraphMutation)

EmitGraphUpdate emits graph mutation event

func (*HubEmitter) EmitLog

func (e *HubEmitter) EmitLog(level string, component string, message string, fields map[string]any)

EmitLog emits log event

func (*HubEmitter) EmitPhaseComplete

func (e *HubEmitter) EmitPhaseComplete(phaseName string, status string, iteration int, duration string)

EmitPhaseComplete emits phase completion event

func (*HubEmitter) EmitPhaseStart

func (e *HubEmitter) EmitPhaseStart(phaseName string, objective string, iteration int)

EmitPhaseStart emits phase start event

func (*HubEmitter) EmitToolExecution

func (e *HubEmitter) EmitToolExecution(tool string, status string, summary string)

EmitToolExecution emits tool execution event

type NodeView

type NodeView struct {
	ID         string                 `json:"id"`
	Type       string                 `json:"type"`
	Label      string                 `json:"label"`
	Properties map[string]interface{} `json:"properties"`
	IsFrontier bool                   `json:"is_frontier"`
}

NodeView represents a graph node for API

type NullEmitter

type NullEmitter struct{}

NullEmitter is a no-op emitter for CLI mode

func NewNullEmitter

func NewNullEmitter() *NullEmitter

NewNullEmitter creates a null emitter

func (*NullEmitter) EmitArtifact

func (e *NullEmitter) EmitArtifact(artifactType string, phase string, count int)

func (*NullEmitter) EmitGraphUpdate

func (e *NullEmitter) EmitGraphUpdate(mutation *graph.GraphMutation)

func (*NullEmitter) EmitLog

func (e *NullEmitter) EmitLog(level string, component string, message string, fields map[string]any)

func (*NullEmitter) EmitPhaseComplete

func (e *NullEmitter) EmitPhaseComplete(phaseName string, status string, iteration int, duration string)

func (*NullEmitter) EmitPhaseStart

func (e *NullEmitter) EmitPhaseStart(phaseName string, objective string, iteration int)

func (*NullEmitter) EmitToolExecution

func (e *NullEmitter) EmitToolExecution(tool string, status string, summary string)

type PhaseDetail

type PhaseDetail struct {
	Name          string          `json:"name"`
	Status        string          `json:"status"`
	Iteration     int             `json:"iteration"`
	MaxIterations int             `json:"max_iterations"`
	DAGState      *DAGStateView   `json:"dag_state"`
	Contract      *ContractView   `json:"contract"`
	Tools         []ToolExecution `json:"tools"`
}

PhaseDetail represents detailed phase execution state

func SerializePhaseDetail

func SerializePhaseDetail(phaseExec *orchestrator.PhaseExecution) *PhaseDetail

SerializePhaseDetail converts phase execution to API response

type PipelineInfo

type PipelineInfo struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Phases      []string `json:"phases"`
}

PipelineInfo represents pipeline metadata

type PipelineList

type PipelineList struct {
	Pipelines []PipelineInfo `json:"pipelines"`
}

PipelineList represents available pipelines

type PipelineStatus

type PipelineStatus struct {
	Name            string    `json:"name"`
	Status          string    `json:"status"`
	CurrentPhase    string    `json:"current_phase"`
	CompletedPhases []string  `json:"completed_phases"`
	Progress        float64   `json:"progress"`
	StartTime       time.Time `json:"start_time"`
	ArtifactCount   int       `json:"artifact_count"`
	GraphNodes      int       `json:"graph_nodes"`
}

PipelineStatus represents the current state of a pipeline execution

func SerializePipelineStatus

func SerializePipelineStatus(orch *orchestrator.Orchestrator, startTime time.Time) *PipelineStatus

SerializePipelineStatus converts orchestrator state to API response

type Server

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

Server manages the web UI HTTP server and WebSocket connections

func NewServer

func NewServer(
	orch *orchestrator.Orchestrator,
	bb *blackboard.Blackboard,
	g *graph.Graph,
	toolRegistry *registry.ToolRegistry,
) *Server

NewServer creates a new web UI server

func (*Server) GetEventEmitter

func (s *Server) GetEventEmitter() EventEmitter

GetEventEmitter returns an event emitter for this server

func (*Server) Start

func (s *Server) Start(addr string) error

Start starts the web UI server

func (*Server) StartBackground

func (s *Server) StartBackground(addr string) (string, error)

StartBackground starts the web UI in a goroutine and returns the resolved local URL.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the web UI server

type SystemStatus

type SystemStatus struct {
	Status        string    `json:"status"`
	Version       string    `json:"version"`
	Uptime        string    `json:"uptime"`
	ActiveClients int       `json:"active_clients"`
	Timestamp     time.Time `json:"timestamp"`
}

SystemStatus represents system health

type ToolCallView

type ToolCallView struct {
	ID      string    `json:"id"`
	Name    string    `json:"name"`
	Status  string    `json:"status"`
	Summary string    `json:"summary,omitempty"`
	Started time.Time `json:"started"`
	Ended   time.Time `json:"ended,omitempty"`
}

ToolCallView represents a tool call for API

type ToolExecution

type ToolExecution struct {
	Tool       string    `json:"tool"`
	Status     string    `json:"status"`
	Summary    string    `json:"summary"`
	OutputSize int       `json:"output_size"`
	Timestamp  time.Time `json:"timestamp"`
}

ToolExecution represents a completed tool execution

Jump to

Keyboard shortcuts

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