Documentation
¶
Overview ¶
Package feed provides a TUI for the Gas Town activity feed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ConvoyPanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorDim). Padding(0, 1) ConvoyTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(colorPrimary) ConvoySectionStyle = lipgloss.NewStyle(). Foreground(colorDim). Bold(true) ConvoyIDStyle = lipgloss.NewStyle(). Foreground(colorHighlight) ConvoyNameStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("15")) ConvoyProgressStyle = lipgloss.NewStyle(). Foreground(colorSuccess) ConvoyLandedStyle = lipgloss.NewStyle(). Foreground(colorSuccess). Bold(true) ConvoyAgeStyle = lipgloss.NewStyle(). Foreground(colorDim) )
Convoy panel styles
var ( // Header styles HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(colorPrimary). Padding(0, 1) TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("15")) FilterStyle = lipgloss.NewStyle(). Foreground(colorDim) // Agent tree styles TreePanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorDim). Padding(0, 1) RigStyle = lipgloss.NewStyle(). Bold(true). Foreground(colorPrimary) RoleStyle = lipgloss.NewStyle(). Foreground(colorAccent) AgentNameStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("15")) AgentActiveStyle = lipgloss.NewStyle(). Foreground(colorSuccess) AgentIdleStyle = lipgloss.NewStyle(). Foreground(colorDim) // Event stream styles StreamPanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorDim). Padding(0, 1) TimestampStyle = lipgloss.NewStyle(). Foreground(colorDim) EventCreateStyle = lipgloss.NewStyle(). Foreground(colorSuccess) EventUpdateStyle = lipgloss.NewStyle(). Foreground(colorPrimary) EventCompleteStyle = lipgloss.NewStyle(). Foreground(colorSuccess). Bold(true) EventFailStyle = lipgloss.NewStyle(). Foreground(colorError). Bold(true) EventDeleteStyle = lipgloss.NewStyle(). Foreground(colorWarning) // Status bar styles StatusBarStyle = lipgloss.NewStyle(). Background(lipgloss.Color("236")). Foreground(colorDim). Padding(0, 1) HelpKeyStyle = lipgloss.NewStyle(). Foreground(colorHighlight). Bold(true) HelpDescStyle = lipgloss.NewStyle(). Foreground(colorDim) // Focus indicator FocusedBorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorPrimary). Padding(0, 1) // Role icons - uses centralized icons from constants package RoleIcons = map[string]string{ constants.RoleMayor: constants.IconMayor, constants.RoleWitness: constants.IconWitness, constants.RoleRefinery: constants.IconRefinery, constants.RoleCrew: constants.IconCrew, constants.RolePolecat: constants.IconPolecat, constants.RoleDeacon: constants.IconDeacon, } // MQ event styles EventMergeStartedStyle = lipgloss.NewStyle(). Foreground(colorPrimary) EventMergedStyle = lipgloss.NewStyle(). Foreground(colorSuccess). Bold(true) EventMergeFailedStyle = lipgloss.NewStyle(). Foreground(colorError). Bold(true) EventMergeSkippedStyle = lipgloss.NewStyle(). Foreground(colorWarning) // Event symbols EventSymbols = map[string]string{ "create": "+", "update": ">", "complete": "*", "fail": "x", "delete": "-", "pin": "^", "patrol_started": constants.IconWitness, "patrol_complete": "*", "polecat_checked": ".", "polecat_nudged": "!", "escalation_sent": "^", "merge_started": "#", "merged": "*", "merge_failed": "x", "merge_skipped": "-", "sling": ">", "hook": "[hook]", "unhook": "[unhook]", "handoff": "[handoff]", "done": "*", "mail": "@", "spawn": "[spawn]", "kill": "[kill]", "nudge": "!", "boot": "[boot]", "halt": "[halt]", } )
Styles for the feed TUI
Functions ¶
func FindBeadsDir ¶
FindBeadsDir finds the beads directory for the given working directory
Types ¶
type Agent ¶
type Agent struct {
ID string
Name string
Role string // mayor, witness, refinery, crew, polecat
Rig string
Status string // running, idle, working, dead
LastEvent *Event
LastUpdate time.Time
Expanded bool
}
Agent represents an agent in the tree
type BdActivitySource ¶
type BdActivitySource struct {
// contains filtered or unexported fields
}
BdActivitySource reads events from bd activity --follow
func NewBdActivitySource ¶
func NewBdActivitySource(workDir string) (*BdActivitySource, error)
NewBdActivitySource creates a new source that tails bd activity
func (*BdActivitySource) Events ¶
func (s *BdActivitySource) Events() <-chan Event
Events returns the event channel
type CombinedSource ¶
type CombinedSource struct {
// contains filtered or unexported fields
}
CombinedSource merges events from multiple sources
func NewCombinedSource ¶
func NewCombinedSource(sources ...EventSource) *CombinedSource
NewCombinedSource creates a source that merges multiple event sources
func (*CombinedSource) Events ¶
func (c *CombinedSource) Events() <-chan Event
Events returns the combined event channel
type Convoy ¶
type Convoy struct {
ID string `json:"id"`
Title string `json:"title"`
Status string `json:"status"`
Completed int `json:"completed"`
Total int `json:"total"`
CreatedAt time.Time `json:"created_at"`
ClosedAt time.Time `json:"closed_at,omitempty"`
}
Convoy represents a convoy's status for the dashboard
type ConvoyState ¶
ConvoyState holds all convoy data for the panel
func FetchConvoys ¶
func FetchConvoys(townRoot string) (*ConvoyState, error)
FetchConvoys retrieves convoy status from town-level beads
type Event ¶
type Event struct {
Time time.Time
Type string // create, update, complete, fail, delete
Actor string // who did it (e.g., "gastown/crew/joe")
Target string // what was affected (e.g., "gt-xyz")
Message string // human-readable description
Rig string // which rig
Role string // actor's role
Raw string // raw line for fallback display
}
Event represents an activity event
type EventSource ¶
EventSource represents a source of events
type GtEvent ¶
type GtEvent struct {
Timestamp string `json:"ts"`
Source string `json:"source"`
Type string `json:"type"`
Actor string `json:"actor"`
Payload map[string]interface{} `json:"payload"`
Visibility string `json:"visibility"`
}
GtEvent is the structure of events in .events.jsonl
type GtEventsSource ¶
type GtEventsSource struct {
// contains filtered or unexported fields
}
GtEventsSource reads events from ~/gt/.events.jsonl (gt activity log)
func NewGtEventsSource ¶
func NewGtEventsSource(townRoot string) (*GtEventsSource, error)
NewGtEventsSource creates a source that tails ~/gt/.events.jsonl
func (*GtEventsSource) Events ¶
func (s *GtEventsSource) Events() <-chan Event
Events returns the event channel
type KeyMap ¶
type KeyMap struct {
// Navigation
Up key.Binding
Down key.Binding
PageUp key.Binding
PageDown key.Binding
Top key.Binding
Bottom key.Binding
// Panel switching
Tab key.Binding
ShiftTab key.Binding
FocusTree key.Binding
FocusConvoy key.Binding
FocusFeed key.Binding
// Actions
Enter key.Binding
Expand key.Binding
Refresh key.Binding
// Search/Filter
Search key.Binding
Filter key.Binding
ClearFilter key.Binding
// General
Help key.Binding
Quit key.Binding
}
KeyMap defines the key bindings for the feed TUI.
type MQEventSource ¶
type MQEventSource struct {
// contains filtered or unexported fields
}
MQEventSource reads MQ lifecycle events from mq_events.jsonl
func NewMQEventSource ¶
func NewMQEventSource(beadsDir string) (*MQEventSource, error)
NewMQEventSource creates a source that tails MQ events from a beads directory.
func NewMQEventSourceFromWorkDir ¶
func NewMQEventSourceFromWorkDir(workDir string) (*MQEventSource, error)
NewMQEventSourceFromWorkDir creates an MQ event source by finding the beads directory.
func (*MQEventSource) Events ¶
func (s *MQEventSource) Events() <-chan Event
Events returns the event channel.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main bubbletea model for the feed TUI
func (*Model) SetEventChannel ¶
SetEventChannel sets the channel to receive events from
func (*Model) SetTownRoot ¶
SetTownRoot sets the town root for convoy fetching
type MultiSource ¶
type MultiSource struct {
// contains filtered or unexported fields
}
MultiSource combines events from multiple EventSources into a single stream.
func NewMultiSource ¶
func NewMultiSource(sources ...EventSource) *MultiSource
NewMultiSource creates a new multi-source that combines events from all given sources.
func (*MultiSource) Events ¶
func (m *MultiSource) Events() <-chan Event
Events returns the combined event channel.