core

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package core provides core CLI commands (doctor, completion, alias, enable, status, plugin, mcp, marketplace, trust).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCorrection added in v0.28.0

func FindCorrection(input string) (string, bool)

FindCorrection looks for a learned correction for the given input This function is called by the command discovery system

func UntrustFilter added in v0.28.0

func UntrustFilter(filterPath string) (bool, error)

UntrustFilter removes trust for a filter file

Types

type AgentInfo added in v0.28.0

type AgentInfo struct {
	Name         string
	Flag         *bool
	ConfigDir    string
	HookDir      string
	Detected     bool
	Instructions string
}

AgentInfo holds information about an AI agent

type CcUsagePeriod added in v0.28.0

type CcUsagePeriod struct {
	Date                string  `json:"date"`
	InputTokens         uint64  `json:"inputTokens"`
	OutputTokens        uint64  `json:"outputTokens"`
	CacheCreationTokens uint64  `json:"cacheCreationTokens"`
	CacheReadTokens     uint64  `json:"cacheReadTokens"`
	TotalTokens         uint64  `json:"totalTokens"`
	TotalCost           float64 `json:"totalCost"`
}

CcUsagePeriod represents usage data for a time period

type ClaudeContent added in v0.28.0

type ClaudeContent struct {
	Type      string                 `json:"type"`
	ID        string                 `json:"id,omitempty"`
	Name      string                 `json:"name,omitempty"`
	Input     map[string]interface{} `json:"input,omitempty"`
	ToolUseID string                 `json:"tool_use_id,omitempty"`
}

type ClaudeJSONLMessage added in v0.28.0

type ClaudeJSONLMessage struct {
	Type    string        `json:"type"`
	Message ClaudeMessage `json:"message"`
}

ClaudeJSONLMessage represents the structure of Claude Code JSONL files

type ClaudeMessage added in v0.28.0

type ClaudeMessage struct {
	Role    string          `json:"role"`
	Content []ClaudeContent `json:"content"`
}

type EconomicsReport added in v0.28.0

type EconomicsReport struct {
	Period         string        `json:"period"`
	CcUsage        CcUsagePeriod `json:"ccUsage"`
	TokManSavings  TokManSavings `json:"tokManSavings"`
	EffectiveCost  float64       `json:"effectiveCost"`
	SavingsPercent float64       `json:"savingsPercent"`
}

EconomicsReport combines ccusage and TokMan data

type SessionSummary added in v0.28.0

type SessionSummary struct {
	ID           string
	Date         string
	TotalCmds    int
	TokManCmds   int
	OutputTokens int
}

SessionSummary represents a summarized session for display

func (*SessionSummary) AdoptionPct added in v0.28.0

func (s *SessionSummary) AdoptionPct() float64

type TokManSavings added in v0.28.0

type TokManSavings struct {
	Date         string `json:"date"`
	Commands     int    `json:"commands"`
	SavedTokens  uint64 `json:"savedTokens"`
	OriginalSize uint64 `json:"originalSize"`
	FilteredSize uint64 `json:"filteredSize"`
}

TokManSavings represents TokMan savings for a period

type TrustEntry added in v0.28.0

type TrustEntry struct {
	SHA256    string `json:"sha256"`
	TrustedAt string `json:"trusted_at"`
}

TrustEntry represents a single trusted filter

type TrustStatus added in v0.28.0

type TrustStatus int

TrustStatus represents the trust state

const (
	TrustStatusUntrusted TrustStatus = iota
	TrustStatusTrusted
	TrustStatusContentChanged
	TrustStatusEnvOverride
)

func CheckTrust added in v0.28.0

func CheckTrust(filterPath string) TrustStatus

CheckTrust checks if a filter file is trusted

type TrustStore added in v0.28.0

type TrustStore struct {
	Version uint32                `json:"version"`
	Trusted map[string]TrustEntry `json:"trusted"`
}

TrustStore represents the stored trust entries

Jump to

Keyboard shortcuts

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