Documentation
¶
Overview ¶
Package outputstyle loads and applies named response style settings.
Index ¶
- Constants
- func RenderPrompt(configHome, workspace string) string
- func RenderText(w io.Writer, report Report)
- func SaveState(workspace string, state State) error
- func StatePath(workspace string) string
- type DiscoveryRoot
- type HealthSummary
- type NotFoundError
- type Report
- func Audit(configHome, workspace string) (Report, error)
- func Clear(workspace string) (Report, error)
- func List(configHome, workspace string) (Report, error)
- func Search(configHome, workspace, query string) (Report, error)
- func Set(configHome, workspace, name string) (Report, error)
- func Show(configHome, workspace, name string) (Report, error)
- type State
- type Style
- type StyleSummary
Constants ¶
const StateFileName = "output-style.json"
StateFileName is the workspace-local file that stores the selected output style.
Variables ¶
This section is empty.
Functions ¶
func RenderPrompt ¶
RenderPrompt renders the selected output style as system-prompt context.
func RenderText ¶
RenderText writes a human-readable output style report.
Types ¶
type DiscoveryRoot ¶
type DiscoveryRoot struct {
Source string `json:"source"`
Label string `json:"label"`
Path string `json:"path,omitempty"`
Exists bool `json:"exists"`
}
DiscoveryRoot describes a catalog location that can provide output styles.
func Sources ¶
func Sources(configHome, workspace string) []DiscoveryRoot
Sources reports the output style catalog roots in effective precedence order.
type HealthSummary ¶
type HealthSummary struct {
Total int `json:"total"`
Effective int `json:"effective"`
Shadowed int `json:"shadowed"`
}
HealthSummary summarizes effective and shadowed output style definitions.
type NotFoundError ¶
type NotFoundError struct {
Name string
}
NotFoundError reports that a named output style could not be found.
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Report ¶
type Report struct {
Kind string `json:"kind"`
Action string `json:"action"`
Status string `json:"status"`
Active string `json:"active,omitempty"`
Query string `json:"query,omitempty"`
Styles []StyleSummary `json:"styles,omitempty"`
Style *Style `json:"style,omitempty"`
Sources []DiscoveryRoot `json:"sources,omitempty"`
SourceCount int `json:"source_count,omitempty"`
Summary *HealthSummary `json:"summary,omitempty"`
Message string `json:"message,omitempty"`
}
Report is the JSON and text-rendering payload for output style commands.
type State ¶
type State struct {
Kind string `json:"kind"`
Active string `json:"active,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
State stores the workspace's active output style selection.
type Style ¶
type Style struct {
Name string `json:"name"`
Source string `json:"source"`
Path string `json:"path,omitempty"`
Preview string `json:"preview"`
Body string `json:"body,omitempty"`
}
Style describes one available output style loaded from built-in, user, or workspace catalogs.
type StyleSummary ¶
type StyleSummary struct {
Name string `json:"name"`
Source string `json:"source"`
Path string `json:"path,omitempty"`
Preview string `json:"preview"`
Active bool `json:"active,omitempty"`
Effective bool `json:"effective,omitempty"`
ShadowedBy string `json:"shadowed_by,omitempty"`
ShadowedByPath string `json:"shadowed_by_path,omitempty"`
}
StyleSummary is the list-facing view of a style, including precedence diagnostics.