Documentation
¶
Index ¶
- func ConfigureLogging()
- func GetStaticHandler() http.Handler
- func RequestLogger(next http.Handler) http.Handler
- type AgeBuckets
- type ArtifactResponse
- type AttentionItem
- type AttentionKind
- type BugAgeBuckets
- type CommentResponse
- type DailyBucket
- type DependencyResponse
- type EpicProgress
- type IssueResponse
- type PendingEventEntry
- type PendingResponse
- type PulseMetrics
- type SSEEvent
- type SSEHub
- type Server
- func (s *Server) AddPendingEvent(evt model.Event)
- func (s *Server) Bind() (net.Listener, error)
- func (s *Server) BroadcastEvent(eventType, issueID string)
- func (s *Server) DiscardPending()
- func (s *Server) GetAllEvents() ([]model.Event, error)
- func (s *Server) GetPendingCount() int
- func (s *Server) GetProjectedIssues() (map[string]*model.Issue, error)
- func (s *Server) SaveAndSync(commitMessage string) error
- func (s *Server) ServeOn(l net.Listener) error
- func (s *Server) SetupRoutes() *http.ServeMux
- func (s *Server) Start() error
- func (s *Server) WatchDB()
- func (s *Server) WatchGitRefs()
- type TrendsBlock
- type VelocityBucket
- type WeeklyTrend
- type WorkloadEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLogging ¶
func ConfigureLogging()
ConfigureLogging sets the log package to use RFC3339 UTC timestamps, matching the format used by RequestLogger.
func GetStaticHandler ¶
GetStaticHandler returns an http.Handler for the embedded static files.
Types ¶
type AgeBuckets ¶ added in v1.2.0
type ArtifactResponse ¶
type AttentionItem ¶ added in v1.2.0
type AttentionItem struct {
IssueID string `json:"issue_id"`
Title string `json:"title"`
Kind AttentionKind `json:"kind"`
AgeDays int `json:"age_days,omitempty"`
Priority int `json:"priority,omitempty"`
}
type AttentionKind ¶ added in v1.2.0
type AttentionKind string
AttentionKind classifies why an issue is surfaced in the Attention card.
const ( AttentionBlocker AttentionKind = "blocker" AttentionStaleWIP AttentionKind = "stale_wip" AttentionHighPriority AttentionKind = "high_priority" )
type BugAgeBuckets ¶ added in v1.2.0
type CommentResponse ¶
type DailyBucket ¶ added in v1.2.0
type DependencyResponse ¶
type EpicProgress ¶ added in v1.2.0
type EpicProgress struct {
IssueID string `json:"issue_id"`
Title string `json:"title"`
ChildrenDone int `json:"children_done"`
ChildrenTotal int `json:"children_total"`
PointsDone int `json:"points_done"`
PointsTotal int `json:"points_total"`
PointsRemaining int `json:"points_remaining"`
Stale bool `json:"stale"`
}
func ComputeEpicProgress ¶ added in v1.2.0
ComputeEpicProgress returns one row per active epic. An "epic" is an issue labeled "epic" (case-insensitive), with at least one child, in an active status (PLANNED / DOING / BLOCKED). BACKLOG epics are queued, not active, and DONE epics are completed — both excluded. Sorted by remaining points desc — biggest active initiative first.
type IssueResponse ¶
type IssueResponse struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
IsInferred bool `json:"is_inferred,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Estimate int `json:"estimate"`
Priority int `json:"priority"`
SortOrder string `json:"sort_order"`
Assignee string `json:"assignee,omitempty"`
CycleID string `json:"cycle_id,omitempty"`
EffectiveCycleID string `json:"effective_cycle_id,omitempty"`
BranchStats *model.BranchStats `json:"branch_stats,omitempty"`
Labels []string `json:"labels,omitempty"`
Dependencies []DependencyResponse `json:"dependencies,omitempty"`
Artifacts []ArtifactResponse `json:"artifacts,omitempty"`
Comments []CommentResponse `json:"comments,omitempty"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
UpdatedAt time.Time `json:"updated_at"`
IsPending bool `json:"is_pending"`
}
type PendingEventEntry ¶
type PendingResponse ¶
type PendingResponse struct {
HasPending bool `json:"has_pending"`
Events []PendingEventEntry `json:"events"`
IssueIDs []string `json:"issue_ids"`
}
type PulseMetrics ¶ added in v1.2.0
type PulseMetrics struct {
Velocity struct {
CurrentWeekPoints int `json:"current_week_points"`
Last7dPoints int `json:"last_7d_points"`
Prior7dPoints int `json:"prior_7d_points"`
Delta int `json:"delta"`
WeeklyBuckets []VelocityBucket `json:"weekly_buckets"`
DailyBuckets []DailyBucket `json:"daily_buckets"`
} `json:"velocity"`
Throughput struct {
Last7d int `json:"last_7d"`
Prior7d int `json:"prior_7d"`
Delta int `json:"delta"` // signed absolute count delta
} `json:"throughput"`
WIP struct {
Total int `json:"total"`
Stale int `json:"stale"`
StaleThresholdDays int `json:"stale_threshold_days"`
} `json:"wip"`
Blockers struct {
Total int `json:"total"`
OldestDays int `json:"oldest_days"`
} `json:"blockers"`
Flow struct {
CycleTimeHrs float64 `json:"cycle_time_hrs"`
CycleTimeP75Hrs float64 `json:"cycle_time_p75_hrs"`
CycleTimeP90Hrs float64 `json:"cycle_time_p90_hrs"`
CycleTimeMinHrs float64 `json:"cycle_time_min_hrs"`
CycleTimeMaxHrs float64 `json:"cycle_time_max_hrs"`
CycleCount int `json:"cycle_count"`
LeadTimeHrs float64 `json:"lead_time_hrs"`
LeadTimeP75Hrs float64 `json:"lead_time_p75_hrs"`
LeadTimeP90Hrs float64 `json:"lead_time_p90_hrs"`
LeadTimeMinHrs float64 `json:"lead_time_min_hrs"`
LeadTimeMaxHrs float64 `json:"lead_time_max_hrs"`
LeadCount int `json:"lead_count"`
Staleness AgeBuckets `json:"staleness"`
StalenessTotal int `json:"staleness_total"`
} `json:"flow"`
Attention []AttentionItem `json:"attention"`
Workload []WorkloadEntry `json:"workload"`
Epics []EpicProgress `json:"epics"`
Trends TrendsBlock `json:"trends"`
}
func ComputePulseMetrics ¶ added in v1.2.0
type SSEHub ¶
type SSEHub struct {
// contains filtered or unexported fields
}
SSEHub manages connected SSE clients and broadcasts events.
func (*SSEHub) ClientCount ¶
ClientCount returns the number of connected clients.
type Server ¶
type Server struct {
Config *config.Config
Port int
DevMode bool
DevPort int
Headless bool
// Auth fields — nil when auth is disabled (local board mode).
NonceStore *auth.NonceStore
AuthorizedKeys *auth.AuthorizedKeys
SigningKey ed25519.PrivateKey
VerifyKey ed25519.PublicKey
// MCP handler — set externally for xpo serve mode.
MCPHandler http.Handler
// Proxy mode — when set, /api/* routes are reverse-proxied to
// the remote server with the bearer token injected.
ProxyURL string
ProxyToken string
// SSE hub for real-time event notifications.
SSEHub *SSEHub
// contains filtered or unexported fields
}
Server holds the state for the xpo web server.
func (*Server) AddPendingEvent ¶
AddPendingEvent adds an event to the pending buffer.
func (*Server) Bind ¶
Bind acquires a TCP listener on s.Port, falling back to the next free port if that one is taken. The actual port bound is written back to s.Port.
func (*Server) BroadcastEvent ¶
BroadcastEvent is the exported form of broadcastEvent for use by external callers (e.g. MCP tool handlers that need to push SSE notifications).
func (*Server) DiscardPending ¶
func (s *Server) DiscardPending()
DiscardPending clears all pending events.
func (*Server) GetAllEvents ¶
GetAllEvents returns all persisted events plus pending events. The persisted events are cached and only re-read when the database file has changed on disk.
func (*Server) GetPendingCount ¶
GetPendingCount returns the number of pending (unsaved) events.
func (*Server) GetProjectedIssues ¶
GetProjectedIssues returns all issues with pending events applied. Results are cached and recomputed only when the on-disk database or the pending-events buffer has changed.
func (*Server) SaveAndSync ¶
SaveAndSync persists pending events to storage and optionally commits to git.
func (*Server) SetupRoutes ¶
setupRoutes configures the HTTP routes for the server.
func (*Server) WatchDB ¶
func (s *Server) WatchDB()
WatchDB watches issues.db for external modifications and broadcasts an SSE event so the GUI refreshes immediately.
func (*Server) WatchGitRefs ¶
func (s *Server) WatchGitRefs()
WatchGitRefs watches .git/refs/heads/ (recursively) and .git/packed-refs for changes. When git refs change (new commit, new/deleted branch, gc), the cached issues are invalidated and an SSE update is broadcast so the GUI refreshes branch stats immediately.
type TrendsBlock ¶ added in v1.2.0
type TrendsBlock struct {
Weekly []WeeklyTrend `json:"weekly"`
MedianTriageMins int `json:"median_triage_mins"`
TriagedCount int `json:"triaged_count"`
BugAge BugAgeBuckets `json:"bug_age"`
}