render

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comment

func Comment(c engine.CommentOut) string

Comment renders one comment.

func ConfigExplain

func ConfigExplain(o *engine.ConfigExplainOut) string

ConfigExplain renders `ka config explain`.

func Created

func Created(c *engine.CreateOut) string

Created renders ka_create's result.

func Detail

func Detail(d *engine.Detail, o DetailOptions) string

Detail renders a ticket with its context digest.

func Error

func Error(e *engine.Error) string

Error renders an error with its fix.

func EstimateTokens

func EstimateTokens(s string) int

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 Inbox

func Inbox(in *engine.InboxOut) string

Inbox renders an inbox.

func MoveProject

func MoveProject(o *engine.MoveProjectOut) string

MoveProject renders `ka project move`.

func Next

func Next(n *engine.NextOut, o DetailOptions) string

Next renders ka_next's result.

func Schema

func Schema(s *engine.SchemaOut) string

Schema renders the workspace vocabulary.

func Search(out *engine.SearchOut) string

Search renders search results.

func SummaryLine

func SummaryLine(s engine.Summary) string

SummaryLine renders one ticket in a list:

JK-7QK3M P1 bug in_progress @agent/claude [cache] 2/5 Title…

func Sync

func Sync(s *engine.SyncOut) string

Sync renders sync state.

func Write

func Write(verb string, w *engine.WriteOut) string

Write renders a write result in one line.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL