Documentation
¶
Index ¶
- Variables
- func Abs(x int) int
- func Clamp(x, min, max int) int
- func FormatBytes(bytes int64) string
- func FormatDuration(ms int64) string
- func FormatTokens(n int) string
- func FormatTokens64(n uint64) string
- func GetModelFamily(modelName string) string
- func InitLogger(logPath string, level LogLevel) error
- func Max(a, b int) int
- func Min(a, b int) int
- func ShortenPath(path string, maxLen int) string
- func Warn(msg string, args ...any)
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *slog.Logger
Logger is the global logger instance.
Functions ¶
func FormatBytes ¶
FormatBytes converts a byte count to a human-readable string.
func FormatDuration ¶
FormatDuration converts milliseconds to a human-readable duration string.
func FormatTokens ¶
FormatTokens formats a token count with K/M/B suffixes.
func FormatTokens64 ¶
FormatTokens64 formats a uint64 token count with K/M/B suffixes.
func GetModelFamily ¶
GetModelFamily extracts the model family from a model name. Returns the family identifier (e.g., "claude", "gpt", "gemini") or "other". Used by tracking and command execution for AI agent attribution.
func InitLogger ¶
InitLogger initializes the global logger.
func ShortenPath ¶
ShortenPath truncates a path to fit within maxLen characters. It preserves the end of the path and adds "..." prefix if truncated.
Types ¶
Click to show internal directories.
Click to hide internal directories.