dashboard

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTaskClaimed   = "task_claimed"
	EventTaskStarted   = "task_started"
	EventTaskCompleted = "task_completed"
	EventTaskFailed    = "task_failed"
	EventTaskBlocked   = "task_blocked"
	EventTaskPaused    = "task_paused"
	EventTaskResumed   = "task_resumed"
	EventTaskGuidance  = "task_guidance"
	EventWorkerStatus  = "worker_status"
	EventStatsUpdate   = "stats_update"
)

Event types for WebSocket broadcasting

Variables

This section is empty.

Functions

func BroadcastStatsUpdate

func BroadcastStatsUpdate()

BroadcastStatsUpdate triggers an immediate stats update

func BroadcastTaskBlocked

func BroadcastTaskBlocked(taskID, title string)

BroadcastTaskBlocked broadcasts when a task is blocked

func BroadcastTaskClaimed

func BroadcastTaskClaimed(taskID, title, worker string)

BroadcastTaskClaimed broadcasts when a worker claims a task

func BroadcastTaskCompleted

func BroadcastTaskCompleted(taskID, title string)

BroadcastTaskCompleted broadcasts when a task finishes successfully

func BroadcastTaskFailed

func BroadcastTaskFailed(taskID, title, errMsg string)

BroadcastTaskFailed broadcasts when a task fails

func BroadcastTaskGuidance

func BroadcastTaskGuidance(taskID, message string)

BroadcastTaskGuidance broadcasts when guidance is added to a task

func BroadcastTaskPaused

func BroadcastTaskPaused(taskID string)

BroadcastTaskPaused broadcasts when a task is paused

func BroadcastTaskResumed

func BroadcastTaskResumed(taskID string)

BroadcastTaskResumed broadcasts when a task is resumed

func BroadcastTaskStarted

func BroadcastTaskStarted(taskID, title, worker string)

BroadcastTaskStarted broadcasts when execution begins

func SetGlobal

func SetGlobal(s *Server)

SetGlobal sets the global dashboard for event broadcasting

Types

type Client

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

Client represents a WebSocket client

type Config

type Config struct {
	Addr        string
	DatabaseURL string
	DB          *sql.DB // Pass existing connection
	Store       *db.Store
}

Config holds server configuration

type EpicWithCount

type EpicWithCount struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Status      string `json:"status"`
	TaskCount   int    `json:"task_count"`
	Completed   int    `json:"completed"`
	Ready       int    `json:"ready"`
	Active      int    `json:"active"`
}

EpicWithCount represents an epic with task counts

type Event

type Event struct {
	Type string `json:"type"`
	Data any    `json:"data"`
}

Event is a WebSocket event

type Graph

type Graph struct {
	Nodes []GraphNode `json:"nodes"`
	Edges []GraphEdge `json:"edges"`
}

Graph represents the full dependency graph

type GraphEdge

type GraphEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
}

GraphEdge represents a dependency edge

type GraphNode

type GraphNode struct {
	ID     string `json:"id"`
	Title  string `json:"title"`
	Status string `json:"status"`
}

GraphNode represents a task in the dependency graph

type Hub

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

Hub manages WebSocket connections

type Server

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

Server is the dashboard HTTP server

func GetGlobal

func GetGlobal() *Server

GetGlobal returns the global dashboard instance

func New

func New(cfg Config) (*Server, error)

New creates a new dashboard server

func (*Server) Broadcast

func (s *Server) Broadcast(eventType string, data any)

Broadcast broadcasts an event to all connected clients

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

type Stats

type Stats struct {
	Total      int `json:"total"`
	Ready      int `json:"ready"`
	Claimed    int `json:"claimed"`
	InProgress int `json:"in_progress"`
	Paused     int `json:"paused"`
	Blocked    int `json:"blocked"`
	Completed  int `json:"completed"`
	Failed     int `json:"failed"`
	Progress   int `json:"progress"` // Percentage
}

Stats represents overall project statistics

type TaskEvent

type TaskEvent struct {
	TaskID string `json:"task_id"`
	Title  string `json:"title"`
	Status string `json:"status"`
	Worker string `json:"worker,omitempty"`
	Error  string `json:"error,omitempty"`
	EpicID string `json:"epic_id,omitempty"`
}

TaskEvent is broadcast when a task state changes

type TaskWithEpic

type TaskWithEpic struct {
	ID             string `json:"id"`
	Title          string `json:"title"`
	Description    string `json:"description"`
	EpicID         string `json:"epic_id"`
	EpicTitle      string `json:"epic_title"`
	ParentID       string `json:"parent_id"`
	SequenceNumber int    `json:"sequence_number"`
	Priority       int    `json:"priority"`
	Status         string `json:"status"`
	Attempts       int    `json:"attempts"`
	MaxAttempts    int    `json:"max_attempts"`
	LastError      string `json:"last_error"`
	ClaimedBy      string `json:"claimed_by"`
	ClaimedAt      int64  `json:"claimed_at"`
	Operator       string `json:"operator"`
	CreatedAt      int64  `json:"created_at"`
	UpdatedAt      int64  `json:"updated_at"`
}

TaskWithEpic represents a task with epic information

type WorkerInfo

type WorkerInfo struct {
	WorkerID string `json:"worker_id"`
	TaskID   string `json:"task_id"`
	Title    string `json:"title"`
	Duration int64  `json:"duration"` // Seconds since claim
}

WorkerInfo represents active worker information

type WorktreeFile

type WorktreeFile struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	Type     string `json:"type"` // "file" or "dir"
	Size     int64  `json:"size"`
	Modified int64  `json:"modified,omitempty"`
}

WorktreeFile represents a file in a worktree

Jump to

Keyboard shortcuts

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