web

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
	TranscriptPath string    `json:"-"` // internal only, not exposed to clients

	// 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