Documentation
¶
Overview ¶
Package output provides formatters for CLI output. TOON format is the default for agent-friendly, token-efficient output.
Index ¶
- func CompactID(id string) string
- func FormatSize(bytes int64) string
- func GenerateSummaryMarkdown(nodes []*graph.Node, edges []*graph.Edge, opts SummaryOptions) string
- func GenerateTOON(nodes []*graph.Node, edges []*graph.Edge, opts TOONOptions) string
- func WriteTOONGzipped(path string, content string) error
- type Edge
- type Format
- type Formatter
- type GraphExport
- type JSONFormatter
- type Node
- type Stats
- type SummaryOptions
- type TOONFormatter
- type TOONOptions
- type YAMLFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
FormatSize formats a byte size as a human-readable string.
func GenerateSummaryMarkdown ¶
GenerateSummaryMarkdown generates a markdown summary of the graph.
func GenerateTOON ¶
GenerateTOON generates TOON format output from nodes and edges.
func WriteTOONGzipped ¶
WriteTOONGzipped writes TOON content to a gzip-compressed file.
Types ¶
type Edge ¶
type Edge struct {
From string `toon:"from"`
To string `toon:"to"`
Confidence string `toon:"confidence,omitempty"`
ConfidenceScore float64 `toon:"confidence_score,omitempty"`
}
Edge represents an edge in TOON export.
type Formatter ¶
Formatter formats data for output.
func NewFormatter ¶
NewFormatter creates a formatter for the specified format.
type GraphExport ¶
type GraphExport struct {
Stats Stats `toon:"stats"`
Nodes map[string][]Node `toon:"nodes"`
Edges map[string][]Edge `toon:"edges"`
}
GraphExport represents the TOON export structure for a graph.
type JSONFormatter ¶
type JSONFormatter struct {
Indent bool
}
JSONFormatter outputs in JSON format.
type Node ¶
type Node struct {
ID string `toon:"id"`
Label string `toon:"label,omitempty"`
Package string `toon:"pkg,omitempty"`
File string `toon:"file,omitempty"`
}
Node represents a node in TOON export.
type SummaryOptions ¶
type SummaryOptions struct {
// TopN is the number of top nodes to show per category.
TopN int
}
SummaryOptions configures summary markdown generation.
type TOONFormatter ¶
type TOONFormatter struct{}
TOONFormatter outputs in TOON format (token-efficient for LLMs).
type TOONOptions ¶
type TOONOptions struct {
// NoExtra excludes source locations and extra metadata.
NoExtra bool
// Compact uses shorter IDs and implies NoExtra.
Compact bool
}
TOONOptions configures TOON output generation.