render

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the integer in the "schema" field of every JSON document we emit. Consumers should refuse to parse if SchemaVersion is higher than what they expect.

Versioning policy (see docs/json-schema.md):

  • v1 (current): top-level shape locked at {schema, content, findings, summary, meta}. `findings` and `summary` are reserved arrays/objects; v1 always emits them empty, and v1.x consumers MUST tolerate non-empty additions of well-known shapes within them.
  • Additive changes (new optional fields in `meta`, new keys in `summary`, new elements in `findings`) are NOT a version bump. Consumers MUST ignore unknown fields.
  • Renaming, removing, or changing the type of any documented field IS a breaking change and requires bumping SchemaVersion to 2.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, p Payload) error

func Markdown

func Markdown(w io.Writer, p Payload) error

func Terminal

func Terminal(w io.Writer, p Payload) error

func VerboseFooter

func VerboseFooter(m Meta) string

VerboseFooter returns the multi-line footer appended after a review when --verbose is in effect. Format is stable: tokens, cost, latency, provider, model — each on its own line, aligned. Cached results get a `(cached)` marker on the tokens line so users see why a fast result was free.

Types

type Format

type Format int
const (
	FormatTerminal Format = iota
	FormatMarkdown
	FormatJSON
)

func (Format) String

func (f Format) String() string

type Meta

type Meta struct {
	Provider  string
	Model     string
	Lang      string
	Usage     provider.Usage
	Cost      float64
	Latency   time.Duration
	Cached    bool
	Timestamp time.Time
}

type Payload

type Payload struct {
	Content string
	Meta    Meta
	Verbose bool
}

type Summary

type Summary struct {
}

Jump to

Keyboard shortcuts

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