Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentUsage ¶
type AgentUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
Estimated bool `json:"estimated"` // true = heuristic count
}
AgentUsage is the payload for MsgUsage events. It carries token counts for one agent's LLM completion(s). Runner and Model are not stored here — the TUI derives them from agentConfigs.
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
func (*Bus) Publish ¶
Publish adds msg to the ring buffer, fans out to subscribers, and optionally persists.
func (*Bus) ServeUnix ¶
ServeUnix starts a Unix domain socket server at path. Each connecting client may:
- publish messages to this bus (sends JSON-encoded Message objects)
- receive all bus messages (the server fans out to every connection)
The server runs until the provided stop channel is closed or ctx is cancelled. Call os.Remove(path) after to clean up.
func (*Bus) SetLogPath ¶
SetLogPath opens a file scoped to dir for append-writing each published message as JSON.
func (*Bus) Unsubscribe ¶
Unsubscribe removes a channel returned by Subscribe so it no longer receives messages. The channel is not closed: Publish fans out from a snapshot taken outside the lock, and sending on a closed channel would panic.
type BusClient ¶
type BusClient struct {
// contains filtered or unexported fields
}
BusClient is a client connected to a remote bus via Unix socket.
type ConversationPayload ¶
type ConversationPayload struct {
From string `json:"from"` // "pm" or "human"
Content string `json:"content"`
}
ConversationPayload carries a single turn of PM↔human dialog.
type Message ¶
type Message struct {
ID string `json:"id"`
From AgentRole `json:"from"`
To AgentRole `json:"to"`
Type MessageType `json:"type"`
Payload any `json:"payload"`
Timestamp time.Time `json:"timestamp"`
}
func NewMessage ¶
func NewMessage(from, to AgentRole, typ MessageType, payload any) Message
type MessageType ¶
type MessageType string
const ( MsgRequest MessageType = "request" MsgResponse MessageType = "response" MsgEvent MessageType = "event" MsgHumanGate MessageType = "human_gate" MsgUsage MessageType = "usage" MsgConversation MessageType = "conversation" // PM↔human dialog turn MsgTaskSpec MessageType = "task_spec" // PM emits formalized task )
type TokenPayload ¶
TokenPayload is the payload for streaming token events.