Documentation
¶
Index ¶
- func HighlightNode(c *Canvas, ln *LayoutNode)
- func NodeLabel(n *trace.Node) string
- func RenderViewport(c *Canvas, vpX, vpY, width, height int) string
- func Run(paths []AnnotatedPath, graph *trace.TraceGraph) error
- func RunGraph(graph *trace.TraceGraph) error
- func SortedNodeIDs(layout *LayoutResult) []uint64
- func UnhighlightNode(c *Canvas, ln *LayoutNode)
- type AnnotatedPath
- type Canvas
- type DataFlowAnnotation
- type GraphModel
- type LayoutNode
- type LayoutResult
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HighlightNode ¶ added in v0.2.0
func HighlightNode(c *Canvas, ln *LayoutNode)
HighlightNode temporarily re-renders a node with selection style on the canvas.
func NodeLabel ¶ added in v0.2.0
NodeLabel returns the display label for a node (exported for use in rendering).
func RenderViewport ¶ added in v0.2.0
RenderViewport extracts a visible rectangle from the canvas as a styled string.
func Run ¶
func Run(paths []AnnotatedPath, graph *trace.TraceGraph) error
Run starts the TUI program.
func RunGraph ¶ added in v0.2.0
func RunGraph(graph *trace.TraceGraph) error
RunGraph starts the 2D graph TUI.
func SortedNodeIDs ¶ added in v0.2.0
func SortedNodeIDs(layout *LayoutResult) []uint64
SortedNodeIDs returns node IDs sorted by layer then order for consistent Tab cycling.
func UnhighlightNode ¶ added in v0.2.0
func UnhighlightNode(c *Canvas, ln *LayoutNode)
UnhighlightNode restores a node to its default style on the canvas.
Types ¶
type AnnotatedPath ¶
type AnnotatedPath struct {
Path trace.HotPath
Pattern *trace.Pattern // parameterized version (nil if not yet parameterized)
Labels []string // human-readable step labels
Confidence float64
Savings int // estimated tokens saved per invocation
CompilationValue int
DataFlowEdges []DataFlowAnnotation
}
AnnotatedPath is a HotPath enriched with display metadata.
type Canvas ¶ added in v0.2.0
Canvas is a 2D character buffer with per-cell styling.
func RenderCanvas ¶ added in v0.2.0
func RenderCanvas(layout *LayoutResult, g *trace.TraceGraph) *Canvas
RenderCanvas creates a fully rendered Canvas from the layout and graph.
type DataFlowAnnotation ¶ added in v0.2.1
DataFlowAnnotation describes a data-flow relationship between two steps.
type GraphModel ¶ added in v0.2.0
type GraphModel struct {
// contains filtered or unexported fields
}
GraphModel is the bubbletea model for the 2D graph view.
func NewGraphModel ¶ added in v0.2.0
func NewGraphModel(graph *trace.TraceGraph, layout *LayoutResult, canvas *Canvas) GraphModel
NewGraphModel creates a new graph model.
func (GraphModel) Init ¶ added in v0.2.0
func (m GraphModel) Init() tea.Cmd
func (GraphModel) View ¶ added in v0.2.0
func (m GraphModel) View() string
type LayoutNode ¶ added in v0.2.0
LayoutNode holds a positioned node for rendering.
type LayoutResult ¶ added in v0.2.0
type LayoutResult struct {
Nodes map[uint64]*LayoutNode
TotalWidth int
TotalHeight int
}
LayoutResult holds the complete graph layout.
func ComputeLayout ¶ added in v0.2.0
func ComputeLayout(g *trace.TraceGraph) *LayoutResult
ComputeLayout runs a simplified Sugiyama-style layered layout on the trace graph.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the bubbletea model for the aj trace TUI.
func NewModel ¶
func NewModel(paths []AnnotatedPath, graph *trace.TraceGraph) Model
NewModel creates a new TUI model.