Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAgentID ¶
GenerateAgentID generates a hierarchical agent ID based on the parent ID. Returns "root" for empty parent, or "parent.N" for children.
func ResetCounters ¶
func ResetCounters()
ResetCounters resets the child counters (useful for testing)
Types ¶
type Event ¶
type Event struct {
ID string `json:"id"` // UUID
AgentID string `json:"agent_id"` // Hierarchical (root, root.1, root.1.2)
ParentID string `json:"parent_id"` // Parent agent ID
Type EventType `json:"type"` // Event type
Timestamp time.Time `json:"timestamp"` // When the event occurred
Data interface{} `json:"data"` // Event-specific data
}
Event represents a single event in the system
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore manages event storage and retrieval
func NewEventStore ¶
func NewEventStore(filepath string) (*EventStore, error)
NewEventStore creates a new event store that writes to the specified file
func (*EventStore) GetEvents ¶
func (s *EventStore) GetEvents(agentID string) []Event
GetEvents retrieves all events for the specified agent and its descendants
func (*EventStore) LoadExisting ¶
func (s *EventStore) LoadExisting() error
LoadExisting loads existing events from the file into memory
func (*EventStore) Record ¶
func (s *EventStore) Record(event Event) error
Record appends an event to the store and persists it to disk
type EventType ¶
type EventType string
EventType represents the type of event that occurred
const ( EventAgentStarted EventType = "agent_started" EventAgentStopped EventType = "agent_stopped" EventStreamStarted EventType = "stream_started" EventStreamChunk EventType = "stream_chunk" EventToolCallRequested EventType = "tool_call_requested" EventToolCallApproved EventType = "tool_call_approved" EventToolCallDenied EventType = "tool_call_denied" EventToolExecutionStart EventType = "tool_execution_start" EventToolExecutionEnd EventType = "tool_execution_end" EventStateTransition EventType = "state_transition" EventError EventType = "error" )
Click to show internal directories.
Click to hide internal directories.