Documentation
¶
Index ¶
- Constants
- Variables
- func AgentsCmd() *cobra.Command
- func Execute()
- func GetCompactionMaxTokens() int
- func GetCompactionPreserveTurns() int
- func GetCompactionThreshold() int
- func GetConfig() (*config.Config, error)
- func GetQueryIntent() string
- func GetTokenBudget() int
- func IsCompactionAutoDetect() bool
- func IsCompactionEnabled() bool
- func IsCompactionSnapshotEnabled() bool
- func IsDryRun() bool
- func IsLLMEnabled() bool
- func IsSkipEnv() bool
- func IsUltraCompact() bool
- func IsVerbose() bool
- func TeeOnFailure(raw string, commandSlug string, err error) string
- func TeeOnFailureWithCode(raw string, commandSlug string, exitCode int) string
- func VerbosityLevel() int
- type AuditEntry
- type CcusagePeriod
- type CodeSummary
- type CommandBreakdown
- type Correction
- type DayBreakdown
- type DiscoverResult
- type DiscoveredCommand
- type EslintMessage
- type EslintResult
- type ExtractedCommand
- type FallbackHandler
- type GainSummary
- type GhCheckRun
- type GhIssue
- type GhPR
- type GhPRFile
- type GhPRView
- type GhRelease
- type GhRun
- type GitFile
- type GitStatus
- type GoTestEvent
- type K8sContainerStatus
- type K8sMetadata
- type K8sPod
- type K8sPodList
- type K8sPodStatus
- type K8sService
- type K8sServiceList
- type K8sServicePort
- type K8sServiceSpec
- type LearnResult
- type MypyError
- type OutputType
- type ParseState
- type PatchMode
- type PatchResult
- type PylintDiagnostic
- type RuffDiagnostic
- type RuffFix
- type RuffLocation
- type SessionSummary
- type TestSuite
- type TsError
- type WcMode
Constants ¶
const ( GitStaged = "staged" GitModified = "modified" GitUntracked = "untracked" GitDeleted = "deleted" GitConflicted = "conflicted" )
Git status codes
Variables ¶
var Version = "dev"
Version is set via ldflags during build
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. Unknown commands are handled by the TOML filter fallback system.
func GetCompactionMaxTokens ¶ added in v1.2.0
func GetCompactionMaxTokens() int
GetCompactionMaxTokens returns the max summary tokens
func GetCompactionPreserveTurns ¶ added in v1.2.0
func GetCompactionPreserveTurns() int
GetCompactionPreserveTurns returns the number of turns to preserve
func GetCompactionThreshold ¶ added in v1.2.0
func GetCompactionThreshold() int
GetCompactionThreshold returns the compaction threshold
func GetQueryIntent ¶ added in v1.2.0
func GetQueryIntent() string
GetQueryIntent returns the query intent for query-aware compression Can be set via --query flag or TOKMAN_QUERY environment variable
func GetTokenBudget ¶ added in v1.2.0
func GetTokenBudget() int
GetTokenBudget returns the token budget for compression Can be set via --budget flag or TOKMAN_BUDGET environment variable
func IsCompactionAutoDetect ¶ added in v1.2.0
func IsCompactionAutoDetect() bool
IsCompactionAutoDetect returns whether auto-detect is enabled
func IsCompactionEnabled ¶ added in v1.2.0
func IsCompactionEnabled() bool
IsCompactionEnabled returns whether compaction is enabled
func IsCompactionSnapshotEnabled ¶ added in v1.2.0
func IsCompactionSnapshotEnabled() bool
IsCompactionSnapshotEnabled returns whether state snapshot format is enabled
func IsDryRun ¶ added in v1.2.0
func IsDryRun() bool
IsDryRun returns whether dry-run mode is enabled.
func IsLLMEnabled ¶ added in v1.2.0
func IsLLMEnabled() bool
IsLLMEnabled returns whether LLM-based compression is enabled
func IsSkipEnv ¶ added in v1.2.0
func IsSkipEnv() bool
IsSkipEnv returns whether SKIP_ENV_VALIDATION should be set.
func IsUltraCompact ¶ added in v1.2.0
func IsUltraCompact() bool
IsUltraCompact returns whether ultra-compact mode is enabled.
func IsVerbose ¶ added in v1.2.0
func IsVerbose() bool
IsVerbose returns whether verbose mode is enabled.
func TeeOnFailure ¶ added in v1.2.0
TeeOnFailure writes raw output to a file when a command fails. Returns a hint string to append to filtered output if tee was written.
func TeeOnFailureWithCode ¶ added in v1.2.0
TeeOnFailureWithCode writes raw output to a file when exit code is non-zero.
func VerbosityLevel ¶ added in v1.2.0
func VerbosityLevel() int
VerbosityLevel returns the verbosity level (0-3).
Types ¶
type AuditEntry ¶ added in v1.2.0
AuditEntry represents a single audit log entry
type CcusagePeriod ¶ added in v1.2.0
type CcusagePeriod struct {
Key string `json:"key"`
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 CodeSummary ¶ added in v1.2.0
type CodeSummary struct {
// contains filtered or unexported fields
}
CodeSummary holds the 2-line summary.
type CommandBreakdown ¶ added in v1.2.0
CommandBreakdown represents stats for a single command
type Correction ¶ added in v1.2.0
type Correction struct {
FailedCommand string `json:"failed_command"`
CorrectedCommand string `json:"corrected_command"`
Count int `json:"count"`
Confidence float64 `json:"confidence"`
Example string `json:"example,omitempty"`
Category string `json:"category"`
}
Correction represents a learned correction pattern
type DayBreakdown ¶ added in v1.2.0
DayBreakdown represents stats for a single day
type DiscoverResult ¶ added in v1.2.0
type DiscoverResult struct {
Project string `json:"project,omitempty"`
TotalCommands int `json:"total_commands"`
MissedSavings int `json:"missed_savings"`
Opportunities []DiscoveredCommand `json:"opportunities"`
UnsupportedCmds []DiscoveredCommand `json:"unsupported_commands,omitempty"`
}
DiscoverResult represents the discovery results
type DiscoveredCommand ¶ added in v1.2.0
type DiscoveredCommand struct {
Command string `json:"command"`
Count int `json:"count"`
Category string `json:"category"`
CouldSave bool `json:"could_save"`
Example string `json:"example,omitempty"`
}
DiscoveredCommand represents a discovered command pattern
type EslintMessage ¶ added in v1.2.0
type EslintMessage struct {
RuleId string `json:"ruleId"`
Severity int `json:"severity"`
Message string `json:"message"`
Line int `json:"line"`
Column int `json:"column"`
}
ESLint JSON structures
type EslintResult ¶ added in v1.2.0
type EslintResult struct {
FilePath string `json:"filePath"`
Messages []EslintMessage `json:"messages"`
ErrorCount int `json:"errorCount"`
WarningCount int `json:"warningCount"`
}
type ExtractedCommand ¶ added in v1.2.0
ExtractedCommand represents a command extracted from a session file
type FallbackHandler ¶ added in v1.2.0
type FallbackHandler struct {
// contains filtered or unexported fields
}
FallbackHandler handles unknown commands by attempting TOML filter matching
func GetFallback ¶ added in v1.2.0
func GetFallback() *FallbackHandler
GetFallback returns the global fallback handler
func NewFallbackHandler ¶ added in v1.2.0
func NewFallbackHandler() *FallbackHandler
NewFallbackHandler creates a new fallback handler
type GainSummary ¶ added in v1.2.0
type GainSummary struct {
TotalCommands int
TotalInput int
TotalOutput int
TotalSaved int
AvgSavingsPct float64
TotalTimeMs int64
AvgTimeMs int64
ByCommand []CommandBreakdown
ByDay []DayBreakdown
}
GainSummary represents the summary statistics
type GhCheckRun ¶ added in v1.2.0
type GhPRView ¶ added in v1.2.0
type GhPRView struct {
Number int `json:"number"`
Title string `json:"title"`
Author string `json:"author"`
State string `json:"state"`
HeadRefName string `json:"headRefName"`
BaseRefName string `json:"baseRefName"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changedFiles"`
Mergeable string `json:"mergeable"`
MergeStateStatus string `json:"mergeStateStatus"`
Commits int `json:"commits"`
Files []GhPRFile `json:"files"`
StatusCheckRollup []GhCheckRun `json:"statusCheckRollup"`
}
type GitStatus ¶ added in v1.2.0
type GitStatus struct {
Branch string
TrackingBranch string // e.g., "origin/main"
Ahead int
Behind int
Staged []GitFile
Modified []GitFile
Untracked []GitFile
Conflicted []GitFile
}
GitStatus represents parsed git status output
type GoTestEvent ¶ added in v1.2.0
type K8sContainerStatus ¶ added in v1.2.0
type K8sMetadata ¶ added in v1.2.0
type K8sPod ¶ added in v1.2.0
type K8sPod struct {
Metadata K8sMetadata `json:"metadata"`
Status K8sPodStatus `json:"status"`
}
type K8sPodList ¶ added in v1.2.0
type K8sPodList struct {
Items []K8sPod `json:"items"`
}
JSON structures for kubectl/aws
type K8sPodStatus ¶ added in v1.2.0
type K8sPodStatus struct {
Phase string `json:"phase"`
ContainerStatuses []K8sContainerStatus `json:"containerStatuses"`
}
type K8sService ¶ added in v1.2.0
type K8sService struct {
Metadata K8sMetadata `json:"metadata"`
Spec K8sServiceSpec `json:"spec"`
}
type K8sServiceList ¶ added in v1.2.0
type K8sServiceList struct {
Items []K8sService `json:"items"`
}
type K8sServicePort ¶ added in v1.2.0
type K8sServiceSpec ¶ added in v1.2.0
type K8sServiceSpec struct {
Type string `json:"type"`
Ports []K8sServicePort `json:"ports"`
}
type LearnResult ¶ added in v1.2.0
type LearnResult struct {
Project string `json:"project,omitempty"`
TotalErrors int `json:"total_errors"`
Corrections []Correction `json:"corrections"`
RulesWritten bool `json:"rules_written,omitempty"`
}
LearnResult represents the learning results
type OutputType ¶ added in v1.2.0
type OutputType int
OutputType categorizes command output for specialized summarization.
const ( OutputTypeTest OutputType = iota OutputTypeBuild OutputTypeLog OutputTypeList OutputTypeJSON OutputTypeGeneric )
type ParseState ¶ added in v1.2.0
type ParseState int
const ( StateHeader ParseState = iota StateTestProgress StateFailures StateSummary )
type PatchMode ¶ added in v1.2.0
type PatchMode int
PatchMode controls settings.json patching behavior
type PatchResult ¶ added in v1.2.0
type PatchResult int
PatchResult describes the outcome of settings.json patching
const ( PatchResultPatched PatchResult = iota // Hook was added successfully PatchResultAlreadyPresent // Hook was already in settings.json PatchResultDeclined // User declined when prompted PatchResultSkipped // --no-patch flag used )
type PylintDiagnostic ¶ added in v1.2.0
type PylintDiagnostic struct {
Type string `json:"type"`
Module string `json:"module"`
Obj string `json:"obj"`
Line int `json:"line"`
Column int `json:"column"`
Path string `json:"path"`
Symbol string `json:"symbol"`
Message string `json:"message"`
MessageId string `json:"message-id"`
}
Pylint JSON structures
type RuffDiagnostic ¶ added in v1.2.0
type RuffDiagnostic struct {
Code string `json:"code"`
Message string `json:"message"`
Location RuffLocation `json:"location"`
Filename string `json:"filename"`
Fix *RuffFix `json:"fix"`
}
type RuffLocation ¶ added in v1.2.0
type SessionSummary ¶ added in v1.2.0
SessionSummary represents a summarized session for display
func (*SessionSummary) AdoptionPct ¶ added in v1.2.0
func (s *SessionSummary) AdoptionPct() float64
AdoptionPct returns the adoption percentage
type TestSuite ¶ added in v1.2.0
type TestSuite struct {
Package string
Passed int
Failed int
Skipped int
Duration time.Duration
FailedTests []string
}
TestSuite represents aggregated test results
Source Files
¶
- agents.go
- agents_register.go
- audit.go
- aws.go
- cargo.go
- ccusage.go
- config.go
- count.go
- curl.go
- dashboard_register.go
- deps.go
- diff.go
- discover.go
- docker.go
- dotnet.go
- economics.go
- env.go
- err.go
- fallback.go
- find.go
- format.go
- gain.go
- gh.go
- git.go
- go.go
- golangci.go
- grep.go
- gt.go
- hook_audit.go
- init.go
- jest.go
- json.go
- kubectl.go
- layers.go
- learn.go
- lint.go
- log.go
- ls.go
- mypy.go
- next.go
- npm.go
- npx.go
- pip.go
- playwright.go
- plugin.go
- pnpm.go
- prettier.go
- prisma.go
- proxy.go
- psql.go
- pytest.go
- read.go
- report.go
- rewrite.go
- root.go
- ruff.go
- session.go
- smart.go
- status.go
- summary.go
- tee.go
- test.go
- tree.go
- trust.go
- tsc.go
- verify.go
- vitest.go
- wc.go
- wget.go