Documentation
¶
Overview ¶
Package townlog provides centralized logging for Gas Town agent lifecycle events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Timestamp time.Time `json:"timestamp"`
Type EventType `json:"type"`
Agent string `json:"agent"` // e.g., "gastown/crew/max" or "gastown/polecats/Toast"
Context string `json:"context,omitempty"` // Additional context (issue ID, error message, etc.)
}
Event represents a single agent lifecycle event.
func FilterEvents ¶
FilterEvents applies a filter to events.
func ParseLogLines ¶
ParseLogLines parses log lines back into Events. This is the inverse of formatLogLine for filtering.
func ReadEvents ¶
ReadEvents reads all events from the log file. Useful for filtering and analysis.
type EventType ¶
type EventType string
EventType represents the type of agent lifecycle event.
const ( // EventSpawn indicates a new agent was created. EventSpawn EventType = "spawn" // EventWake indicates an agent was resumed. EventWake EventType = "wake" // EventNudge indicates a message was injected into an agent. EventNudge EventType = "nudge" // EventHandoff indicates an agent handed off to a fresh session. EventHandoff EventType = "handoff" // EventDone indicates an agent finished its work. EventDone EventType = "done" // EventCrash indicates an agent exited unexpectedly. EventCrash EventType = "crash" // EventKill indicates an agent was killed intentionally. EventKill EventType = "kill" // EventCallback indicates a callback was processed during patrol. EventCallback EventType = "callback" // Witness patrol events EventPatrolStarted EventType = "patrol_started" EventPolecatChecked EventType = "polecat_checked" EventPolecatNudged EventType = "polecat_nudged" EventEscalationSent EventType = "escalation_sent" EventPatrolComplete EventType = "patrol_complete" )
type Filter ¶
type Filter struct {
Type EventType // Filter by event type (empty for all)
Agent string // Filter by agent prefix (empty for all)
Since time.Time // Filter by time (zero for all)
}
FilterEvents returns events matching the filter criteria.
Click to show internal directories.
Click to hide internal directories.