web

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package web provides an embedded HTTP server for the OpsDeck web dashboard. It reuses the same discovery and intel logic as the TUI, served via SSE for real-time updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the web dashboard HTTP server.

func NewServer

func NewServer(addr string) *Server

NewServer creates a new web dashboard server.

func (*Server) Start

func (s *Server) Start() error

Start runs the server and the background refresh loop.

type SessionView

type SessionView struct {
	ID        string    `json:"id"`
	PID       int       `json:"pid"`
	CWD       string    `json:"cwd,omitempty"`
	State     string    `json:"state"`
	Project   string    `json:"project"`
	StartedAt time.Time `json:"started_at"`
	WorkingOn string    `json:"working_on"`

	// Activity data (populated on detail request).
	EditCount    int      `json:"edit_count"`
	BashCount    int      `json:"bash_count"`
	ErrorCount   int      `json:"error_count"`
	FilesChanged int      `json:"files_changed"`
	Messages     int      `json:"messages"`
	Activities   []string `json:"activities,omitempty"`
	LastRequest  string   `json:"last_request,omitempty"`

	// Git data.
	GitBranch     string `json:"git_branch,omitempty"`
	GitDirty      bool   `json:"git_dirty,omitempty"`
	GitAhead      int    `json:"git_ahead,omitempty"`
	GitBehind     int    `json:"git_behind,omitempty"`
	GitLastCommit string `json:"git_last_commit,omitempty"`

	// Cost data.
	TotalTokens int64   `json:"total_tokens"`
	EstCostUSD  float64 `json:"est_cost_usd"`
	BurnRate    float64 `json:"burn_rate"`
}

SessionView is the JSON-friendly representation of a session for the web UI.

type Snapshot

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

Snapshot holds the current state of all sessions, refreshed periodically.

Jump to

Keyboard shortcuts

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