Documentation
¶
Index ¶
- Constants
- Variables
- func CopyToClipboard(text string) error
- func EnsureDir(dir string) error
- func EnvDefault(k, def string) string
- func FindTraceFile(traceID string, filename string) (string, error)
- func GenerateDeterministicHash(value any) string
- func GenerateSchemaAndHash(value any) (schema any, valueHash string, schemaHash string)
- func GetLogsDir() string
- func GetPossibleTraceDirs() []string
- func GetTracesDir() string
- func GetTuskDir() string
- func IsTerminal() bool
- func ParseProtobufSpanFromJSON(jsonData []byte) (*core.Span, error)
- func ParseSpansFromFile(filename string, filter SpanFilter) ([]*core.Span, error)
- func ReduceByMatchImportance(value any, schema *structpb.Struct) any
- func RemoveHeadersFromInputValue(inputValue any) any
- func RenderMarkdown(markdown string) string
- func SetTracesDirOverride(dir string)
- func WrapLine(text string, maxWidth int) []string
- func WrapText(content string, maxWidth int) string
- type SpanFilter
Constants ¶
const ( TuskDirName = ".tusk" TracesSubDir = "traces" LogsSubDir = "logs" ConfigFileName = "config.yaml" )
Variables ¶
var PossibleTraceDirs = []string{
".tusk/traces",
"traces",
"tmp",
".",
}
List of directories to search for trace files
Functions ¶
func CopyToClipboard ¶
CopyToClipboard copies text to the system clipboard. It tries OSC52 first (for remote terminals), then falls back to OS clipboard.
func EnvDefault ¶
func FindTraceFile ¶
FindTraceFile searches for a JSONL trace file containing the given trace ID. If filename is provided, it tries that first before searching
func GenerateDeterministicHash ¶
GenerateDeterministicHash creates a deterministic hash of any JSON-serializable value
func GenerateSchemaAndHash ¶
GenerateSchemaAndHash generates JSON schema and deterministic hash for any value
func GetPossibleTraceDirs ¶
func GetPossibleTraceDirs() []string
GetPossibleTraceDirs returns the list of directories to search for trace files, preferring override first.
func GetTuskDir ¶
func GetTuskDir() string
GetTuskDir returns the .tusk directory path (either local or in home directory)
func IsTerminal ¶
func IsTerminal() bool
func ParseProtobufSpanFromJSON ¶
ParseProtobufSpanFromJSON parses a JSON line into a protobuf Span
func ParseSpansFromFile ¶
func ParseSpansFromFile(filename string, filter SpanFilter) ([]*core.Span, error)
ParseSpansFromFile reads a JSONL trace file and returns spans matching the filter. If the file is malformed, it returns an error.
func ReduceByMatchImportance ¶
ReduceByMatchImportance returns a copy of 'value' keeping only fields with matchImportance != 0. Schema is a structpb.Struct with optional per-field "matchImportance": 0|1 (default 1). Supports nested objects and arrays (uses 'items' schema for arrays if present).
func RemoveHeadersFromInputValue ¶
RemoveHeadersFromInputValue removes non-critical headers for header-agnostic matching but preserves headers that affect response format like Accept and Content-Type
func RenderMarkdown ¶
func SetTracesDirOverride ¶
func SetTracesDirOverride(dir string)
SetTracesDirOverride sets an explicit traces directory to use.
Types ¶
type SpanFilter ¶
SpanFilter is a function type for filtering spans during parsing