audit

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentSummary

type AgentSummary struct {
	ClawID             string         `json:"claw_id"`
	Requests           int            `json:"requests"`
	Responses          int            `json:"responses"`
	Errors             int            `json:"errors"`
	Interventions      int            `json:"interventions"`
	TokensIn           int            `json:"tokens_in"`
	TokensOut          int            `json:"tokens_out"`
	CostUSD            float64        `json:"cost_usd"`
	ModelUsage         map[string]int `json:"model_usage,omitempty"`
	FeedFetches        int            `json:"feed_fetches"`
	FeedErrors         int            `json:"feed_errors"`
	ToolCalls          int            `json:"tool_calls,omitempty"`
	ToolErrors         int            `json:"tool_errors,omitempty"`
	ProviderPoolEvents int            `json:"provider_pool_events,omitempty"`
	FirstTimestamp     time.Time      `json:"first_timestamp,omitempty"`
	LastTimestamp      time.Time      `json:"last_timestamp,omitempty"`
}

type Event

type Event struct {
	Timestamp          time.Time `json:"timestamp"`
	ClawID             string    `json:"claw_id,omitempty"`
	Type               string    `json:"type"`
	Model              string    `json:"model,omitempty"`
	LatencyMS          *int64    `json:"latency_ms,omitempty"`
	StatusCode         *int      `json:"status_code,omitempty"`
	TokensIn           *int      `json:"tokens_in,omitempty"`
	TokensOut          *int      `json:"tokens_out,omitempty"`
	CostUSD            *float64  `json:"cost_usd,omitempty"`
	InterventionReason string    `json:"intervention_reason,omitempty"`
	Error              string    `json:"error,omitempty"`
	FeedName           string    `json:"feed_name,omitempty"`
	FeedURL            string    `json:"feed_url,omitempty"`
	SourceService      string    `json:"source_service,omitempty"`
	SessionEntryID     string    `json:"session_entry_id,omitempty"`
	FinalStatus        string    `json:"final_status,omitempty"`
	FinalStatusCode    *int      `json:"final_status_code,omitempty"`
	TotalRounds        *int      `json:"total_rounds,omitempty"`
	ToolName           string    `json:"tool_name,omitempty"`
	ToolService        string    `json:"tool_service,omitempty"`
	ToolRound          *int      `json:"tool_round,omitempty"`
	// provider_pool event fields
	Provider      string `json:"provider,omitempty"`
	KeyID         string `json:"key_id,omitempty"`
	Action        string `json:"action,omitempty"`
	Reason        string `json:"reason,omitempty"`
	CooldownUntil string `json:"cooldown_until,omitempty"`
}

func CollectPodEvents

func CollectPodEvents(ctx context.Context, cli *client.Client, podName string, since time.Time) ([]Event, int, error)

func CollectSessionHistoryEvents added in v0.5.0

func CollectSessionHistoryEvents(baseDir string, since time.Time) ([]Event, int, error)

func FilterEvents

func FilterEvents(events []Event, filter Filter) []Event

func NormalizeLine

func NormalizeLine(line []byte) (*Event, error)

func NormalizeSessionHistoryLine added in v0.5.0

func NormalizeSessionHistoryLine(line []byte) ([]Event, error)

func ParseReader

func ParseReader(r io.Reader) ([]Event, int, error)

func ParseSessionHistoryReader added in v0.5.0

func ParseSessionHistoryReader(r io.Reader) ([]Event, int, error)

type Filter

type Filter struct {
	ClawID string
	Type   string
	Since  time.Time
}

type Summary

type Summary struct {
	Agents             []AgentSummary `json:"agents"`
	Requests           int            `json:"requests"`
	Responses          int            `json:"responses"`
	Errors             int            `json:"errors"`
	Interventions      int            `json:"interventions"`
	TokensIn           int            `json:"tokens_in"`
	TokensOut          int            `json:"tokens_out"`
	CostUSD            float64        `json:"cost_usd"`
	ToolCalls          int            `json:"tool_calls,omitempty"`
	ToolErrors         int            `json:"tool_errors,omitempty"`
	ProviderPoolEvents int            `json:"provider_pool_events,omitempty"`
}

func Summarize

func Summarize(events []Event) Summary

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL