sqlite

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecisionRecord

type DecisionRecord struct {
	ID            string         `json:"id"`
	SessionID     string         `json:"session_id"`
	ToolUseID     string         `json:"tool_use_id,omitempty"`
	HookEventName string         `json:"hook_event_name"`
	ToolName      string         `json:"tool_name,omitempty"`
	Decision      risk.Decision  `json:"decision"`
	ReasonCode    string         `json:"reason_code"`
	Reason        string         `json:"reason"`
	RiskScore     *float64       `json:"risk_score,omitempty"`
	Threshold     *float64       `json:"threshold,omitempty"`
	ModelVersion  string         `json:"model_version,omitempty"`
	RiskEvent     risk.RiskEvent `json:"risk_event"`
	CreatedAt     time.Time      `json:"created_at"`
}

type SessionSummary

type SessionSummary struct {
	SessionID string    `json:"session_id"`
	Critical  int       `json:"critical"`
	Warnings  int       `json:"warnings"`
	Actions   int       `json:"actions"`
	LatestAt  time.Time `json:"latest_at"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func OpenStore

func OpenStore(path string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Events

func (s *Store) Events(ctx context.Context, sessionID string) ([]DecisionRecord, error)

func (*Store) SaveDecision

func (s *Store) SaveDecision(ctx context.Context, event risk.HookEvent, decision risk.RiskDecision) (DecisionRecord, error)

func (*Store) SessionSummary

func (s *Store) SessionSummary(ctx context.Context, sessionID string) (SessionSummary, error)

func (*Store) Sessions

func (s *Store) Sessions(ctx context.Context) ([]SessionSummary, error)

func (*Store) Summary

func (s *Store) Summary(ctx context.Context) (Summary, error)

type Summary

type Summary struct {
	Critical int `json:"critical"`
	Warnings int `json:"warnings"`
	Actions  int `json:"actions"`
	Sessions int `json:"sessions"`
}

Jump to

Keyboard shortcuts

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