tryview

package
v0.0.0-...-a981527 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tryview renders the `forge try` agent's audit stream as inline, human-readable "loop" lines — tool calls, egress checks, guardrail blocks — so the first-run experience shows the agent working, not just its reply.

The renderer implements the coreruntime audit Sink contract, so it attaches alongside (or instead of) the NDJSON sink. It reads existing audit events only; it never derives fields that aren't on the event. Styling degrades to plain text when color is unavailable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

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

Renderer maps audit events to inline loop lines. Zero value is not usable; construct with New.

func New

func New(out io.Writer, quiet, audit, color bool) *Renderer

New builds a Renderer writing to out. quiet hides the loop; audit echoes the full NDJSON stream; color enables the orange/grey styling (pass false for a non-TTY or NO_COLOR).

func (*Renderer) Close

func (r *Renderer) Close(context.Context) error

Close implements the audit Sink interface.

func (*Renderer) FlushSummary

func (r *Renderer) FlushSummary()

FlushSummary prints the one-line compact audit summary for the turn (dim), then resets it. Call it after printing the agent reply. No-op under --quiet / --audit or when the turn touched no tools or egress.

func (*Renderer) Name

func (r *Renderer) Name() string

Name implements the audit Sink interface.

func (*Renderer) Stats

func (r *Renderer) Stats() map[string]int64

Stats implements the audit Sink interface.

func (*Renderer) Write

func (r *Renderer) Write(_ context.Context, eventBytes []byte) error

Write implements the audit Sink interface. eventBytes is one NDJSON line (newline included).

Jump to

Keyboard shortcuts

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