Documentation
¶
Overview ¶
Package focus implements the `supermodel focus` command.
Given a file or function, it extracts a compact, token-efficient representation of the relevant graph slice: direct imports, functions defined in the file, callers, and callees. The output is formatted as structured markdown for direct injection into LLM context windows.
This addresses two issues:
- #11 Token Efficiency Feature — minimal graph slice instead of full dump
- #13 Slicing and Typing — type-aware slice extraction
This is a vertical slice. It must not import any other slice package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Function ¶
type Function struct {
Name string `json:"name"`
Callees []string `json:"calls,omitempty"` // functions this fn calls
}
Function is a function defined in the focused file.
type Options ¶
type Options struct {
Force bool // bypass cache
Output string // "markdown" | "json"
Depth int // import traversal depth (default 1)
IncludeTypes bool // include type/class nodes
}
Options configures the focus command.
type Slice ¶
type Slice struct {
File string `json:"file"`
Imports []string `json:"imports"`
Functions []Function `json:"functions"`
CalledBy []Call `json:"called_by"`
Types []Type `json:"types,omitempty"`
TokenHint int `json:"approx_tokens"` // rough estimate
}
Slice is the token-efficient graph slice for a single file.
Click to show internal directories.
Click to hide internal directories.