Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectProvider ¶
DetectProvider picks the best adapter from a line's top-level "type".
Types ¶
type ActionSummary ¶ added in v0.1.4
ActionSummary is the structured interpretation of a canonical action message.
func ParseActionMessage ¶ added in v0.1.4
func ParseActionMessage(message string) ActionSummary
ParseActionMessage extracts a tool/summary pair from a canonical action message. Conventions:
- "$ cmd" => Bash
- "text:..." => Think
- "user:..." => Prompt
- "Tool detail" => Tool + detail
type CanonicalEvent ¶
type CanonicalEvent struct {
Provider string `json:"provider,omitempty"`
Type EventType `json:"type"`
Message string `json:"message"`
Timestamp time.Time `json:"timestamp"`
CostUSD float64 `json:"cost_usd,omitempty"`
TokensIn int `json:"tokens_in,omitempty"`
TokensOut int `json:"tokens_out,omitempty"`
}
CanonicalEvent is the provider-agnostic event schema.
type ClaudeAdapter ¶
type ClaudeAdapter struct{}
func (ClaudeAdapter) Parse ¶
func (ClaudeAdapter) Parse(line []byte) ([]CanonicalEvent, error)
type CodexAdapter ¶
type CodexAdapter struct{}
func (CodexAdapter) Parse ¶
func (CodexAdapter) Parse(line []byte) ([]CanonicalEvent, error)
type EventType ¶
type EventType string
EventType is the normalized event kind emitted across providers.
type LogAdapter ¶
type LogAdapter interface {
Parse(line []byte) ([]CanonicalEvent, error)
}
LogAdapter parses one NDJSON line into canonical events.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry resolves provider adapters by name.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) AdapterForProvider ¶
func (r *Registry) AdapterForProvider(provider string) (LogAdapter, bool)
func (*Registry) ParseLine ¶
func (r *Registry) ParseLine(line []byte) (string, []CanonicalEvent, error)
ParseLine detects the provider and parses one line with that adapter.
func (*Registry) Register ¶
func (r *Registry) Register(provider string, adapter LogAdapter)