Documentation
¶
Overview ¶
Package render produces the compact text forms of ka results. The same renderings serve the CLI and MCP text content, and are written to spend as few tokens as possible (PRD §11.3).
Index ¶
- func Comment(c engine.CommentOut) string
- func ConfigExplain(o *engine.ConfigExplainOut) string
- func Created(c *engine.CreateOut) string
- func Detail(d *engine.Detail, o DetailOptions) string
- func Error(e *engine.Error) string
- func EstimateTokens(s string) int
- func Inbox(in *engine.InboxOut) string
- func MoveProject(o *engine.MoveProjectOut) string
- func Next(n *engine.NextOut, o DetailOptions) string
- func Schema(s *engine.SchemaOut) string
- func Search(out *engine.SearchOut) string
- func SummaryLine(s engine.Summary) string
- func Sync(s *engine.SyncOut) string
- func Write(verb string, w *engine.WriteOut) string
- type DetailOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigExplain ¶
func ConfigExplain(o *engine.ConfigExplainOut) string
ConfigExplain renders `ka config explain`.
func Detail ¶
func Detail(d *engine.Detail, o DetailOptions) string
Detail renders a ticket with its context digest.
func EstimateTokens ¶
EstimateTokens approximates a BPE tokenizer conservatively: letter runs cost one token per four characters (at least one), digit runs one per three, every punctuation or symbol character one, and each newline one. Real tokenizers merge more, so budgets measured this way hold with margin.
func MoveProject ¶
func MoveProject(o *engine.MoveProjectOut) string
MoveProject renders `ka project move`.
func SummaryLine ¶
SummaryLine renders one ticket in a list:
JK-7QK3M P1 bug in_progress @agent/claude [cache] 2/5 Title…
Types ¶
type DetailOptions ¶
type DetailOptions struct {
BodyLimit int // 0 = no limit
Untrusted bool // mark ticket-authored text as data (MCP)
// MaxTokens caps the whole rendering (by EstimateTokens): the
// description gets whatever room the rest leaves (at least MinBody
// bytes), and comment bodies shrink.
MaxTokens int
MinBody int
// contains filtered or unexported fields
}
DetailOptions tunes Detail.