output

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package output renders Pinax command projections for human and machine modes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyProjectionRedaction

func ApplyProjectionRedaction(p *domain.Projection)

ApplyProjectionRedaction 就地递归脱敏 projection 的全部渲染面。 它在 RenderWithOptions 渲染前调用,保证 default/json/agent/events/explain 与 evidence sidecar 都经过同一道门禁。返回的 projection 可安全渲染。

func Render

func Render(w io.Writer, mode Mode, projection domain.Projection) error

func RenderWithOptions

func RenderWithOptions(w io.Writer, mode Mode, projection domain.Projection, opts RenderOptions) error

func RunJournalPager

func RunJournalPager(ctx context.Context, in io.Reader, out io.Writer, projection domain.Projection, loader JournalLoader) error

Types

type JournalLoader

type JournalLoader func(direction int, current domain.Projection) (domain.Projection, error)

type JournalPagerModel

type JournalPagerModel struct {
	// contains filtered or unexported fields
}

func NewJournalPagerModel

func NewJournalPagerModel(projection domain.Projection, loader JournalLoader, width, height int) JournalPagerModel

func (JournalPagerModel) Init

func (m JournalPagerModel) Init() tea.Cmd

func (JournalPagerModel) Update

func (m JournalPagerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (JournalPagerModel) View

func (m JournalPagerModel) View() string

type MarkdownOptions

type MarkdownOptions struct {
	Enabled bool
	Style   string
	Pager   string
}

type Mode

type Mode string
const (
	ModeSummary Mode = "summary"
	ModeAgent   Mode = "agent"
	ModeJSON    Mode = "json"
	ModeEvents  Mode = "events"
	ModeExplain Mode = "explain"
)

type RenderOptions

type RenderOptions struct {
	Style      string
	ColorMode  string
	ThemeName  string
	ThemeRoles map[string]string
	Width      int
	Markdown   MarkdownOptions
	IsTerminal bool
	JSONIndent string
	// SyncPreview and SyncLimit only affect human/agent sync previews. Machine
	// JSON keeps the complete plan and sync_view regardless of these values.
	SyncPreview  string
	SyncLimit    int
	SyncLimitSet bool
	ContentDiff  bool
}

type ThemeRoles

type ThemeRoles struct {
	Accent  string
	Muted   string
	Rule    string
	Success string
	Warning string
	Danger  string
	Key     string
	Value   string
	Path    string
	Link    string
	Code    string
	Heading string
}

Jump to

Keyboard shortcuts

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