Documentation
¶
Overview ¶
Package sqlite persists QUANTUM_LOG data locally using a CGo-free driver.
Index ¶
- func ValidateAllocations(allocations []AllocationInput) error
- type Allocation
- type AllocationInput
- type ExportRecord
- type ModelCallInput
- type PricingRecalculateQuery
- type PricingRuleRecord
- type ProjectSummary
- type ProjectTag
- type RawEventInput
- type Store
- func (s *Store) AddPricingRule(ctx context.Context, rule pricing.Rule) (PricingRuleRecord, error)
- func (s *Store) AddProjectTag(ctx context.Context, projectID, key, value string) error
- func (s *Store) AppendRawEvent(ctx context.Context, input RawEventInput) (string, error)
- func (s *Store) Close() error
- func (s *Store) CreateWorkContext(ctx context.Context, input WorkContextInput) (domain.WorkContext, error)
- func (s *Store) Doctor(ctx context.Context) error
- func (s *Store) EnsureSession(ctx context.Context, id, agentName string, startedAt time.Time) error
- func (s *Store) ExportModelCalls(ctx context.Context, query PricingRecalculateQuery) ([]ExportRecord, error)
- func (s *Store) FinishTask(ctx context.Context, id, result string) error
- func (s *Store) ListPricingRules(ctx context.Context) ([]PricingRuleRecord, error)
- func (s *Store) ListProjects(ctx context.Context) ([]ProjectSummary, error)
- func (s *Store) ListTasks(ctx context.Context, projectSlug string) ([]TaskRecord, error)
- func (s *Store) ModelCallAllocations(ctx context.Context, modelCallID string) ([]Allocation, error)
- func (s *Store) ProjectBySlug(ctx context.Context, slug string) (domain.Project, domain.ProjectLocation, bool, error)
- func (s *Store) ProjectTags(ctx context.Context, projectID string) ([]ProjectTag, error)
- func (s *Store) RecalculateCosts(ctx context.Context, query PricingRecalculateQuery) (int, error)
- func (s *Store) RecordModelCall(ctx context.Context, input ModelCallInput) (string, error)
- func (s *Store) RegisterProject(ctx context.Context, name, slug, path string) (domain.Project, domain.ProjectLocation, error)
- func (s *Store) RegisteredPaths(ctx context.Context) (map[string]string, error)
- func (s *Store) RepairModelCallAllocation(ctx context.Context, modelCallID, projectID string) error
- func (s *Store) ReplaceAllocations(ctx context.Context, subjectType, subjectID string, ...) error
- func (s *Store) StartTask(ctx context.Context, input TaskInput) (string, error)
- func (s *Store) Usage(ctx context.Context, query UsageQuery) (UsageReport, error)
- func (s *Store) VerifyLedger(ctx context.Context, sessionID string) error
- type TaskInput
- type TaskRecord
- type UsageQuery
- type UsageReport
- type UsageRow
- type WorkContextInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateAllocations ¶
func ValidateAllocations(allocations []AllocationInput) error
Types ¶
type Allocation ¶
type AllocationInput ¶
type ExportRecord ¶
type ExportRecord struct {
ID string `json:"id"`
OccurredAt time.Time `json:"occurred_at"`
ProjectSlug string `json:"project_slug"`
ProjectLocationPath string `json:"project_location_path,omitempty"`
Provider string `json:"provider"`
Model string `json:"model"`
Agent string `json:"agent"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
ReasoningTokens int64 `json:"reasoning_tokens"`
CachedInputTokens int64 `json:"cached_input_tokens"`
CacheWriteTokens int64 `json:"cache_write_tokens"`
TotalTokens int64 `json:"total_tokens"`
EstimatedCostUSDMicros int64 `json:"estimated_cost_usd_micros"`
CaptureQuality string `json:"capture_quality"`
Allocations []Allocation `json:"allocations"`
}
type ModelCallInput ¶
type ModelCallInput struct {
ProjectID string
ProjectLocationID string
WorkContextID string
TaskID string
SessionID string
TurnID string
Provider string
ModelID string
AgentName string
InputTokens int64
OutputTokens int64
ReasoningTokens int64
CachedInputTokens int64
CacheWriteTokens int64
EstimatedCostUSDMicros int64
EstimatedCostEURMicros int64
OccurredAt time.Time
CaptureQuality string
}
type PricingRuleRecord ¶
type ProjectSummary ¶
type ProjectTag ¶
type RawEventInput ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddPricingRule ¶
func (*Store) AddProjectTag ¶
func (*Store) AppendRawEvent ¶
func (*Store) CreateWorkContext ¶
func (s *Store) CreateWorkContext(ctx context.Context, input WorkContextInput) (domain.WorkContext, error)
func (*Store) EnsureSession ¶
func (*Store) ExportModelCalls ¶
func (s *Store) ExportModelCalls(ctx context.Context, query PricingRecalculateQuery) ([]ExportRecord, error)
func (*Store) ListPricingRules ¶
func (s *Store) ListPricingRules(ctx context.Context) ([]PricingRuleRecord, error)
func (*Store) ListProjects ¶
func (s *Store) ListProjects(ctx context.Context) ([]ProjectSummary, error)
func (*Store) ModelCallAllocations ¶
func (*Store) ProjectBySlug ¶
func (*Store) ProjectTags ¶
func (*Store) RecalculateCosts ¶
func (*Store) RecordModelCall ¶
func (*Store) RegisterProject ¶
func (*Store) RegisteredPaths ¶
func (*Store) RepairModelCallAllocation ¶
func (*Store) ReplaceAllocations ¶
func (*Store) Usage ¶
func (s *Store) Usage(ctx context.Context, query UsageQuery) (UsageReport, error)
type TaskRecord ¶
type TaskRecord struct {
ID string `json:"id"`
ProjectSlug string `json:"project_slug"`
Title string `json:"title"`
TaskType string `json:"task_type"`
Status string `json:"status"`
Result string `json:"result"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type UsageReport ¶
type UsageRow ¶
type UsageRow struct {
ProjectSlug string `json:"project_slug"`
Provider string `json:"provider"`
Model string `json:"model"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
TotalTokens int64 `json:"total_tokens"`
AllocatedCostUSDMicros int64 `json:"allocated_cost_usd_micros"`
}
Click to show internal directories.
Click to hide internal directories.