transcript

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLineLimit         = 80
	ExceptionalToolLineLimit = 120
)

Variables

This section is empty.

Functions

func BoundedText

func BoundedText(s string, maxRunes int) string

func CompactIdentity

func CompactIdentity(taskID string, turnIndex int) string

func CompactTaskID

func CompactTaskID(taskID string) string

func ExtractBashCommand

func ExtractBashCommand(payload any) string

func FormatByteCount

func FormatByteCount(n int) string

func IsSensitiveSummaryKey

func IsSensitiveSummaryKey(key string) bool

func NormalizeShellCommand

func NormalizeShellCommand(command string) string

func RedactProgressOutput

func RedactProgressOutput(s string) string

func StatusLine

func StatusLine(in StatusLineInput) string

func SummarizeJSONValue

func SummarizeJSONValue(raw json.RawMessage) string

func TaskID

func TaskID(sessionID string, meta map[string]string) string

func TokenThroughput

func TokenThroughput(outputTokens int, durationMS int64) *float64

Types

type Callback

type Callback func(Event)

type Event

type Event struct {
	Type      ProgressType `json:"type"`
	Source    string       `json:"source,omitempty"`
	TaskID    string       `json:"task_id,omitempty"`
	TurnIndex int          `json:"turn_index,omitempty"`
	Phase     string       `json:"phase,omitempty"`
	Status    string       `json:"status,omitempty"`
	Message   string       `json:"message,omitempty"`
	Action    string       `json:"action,omitempty"`
	Target    string       `json:"target,omitempty"`
	Tool      Tool         `json:"tool,omitempty"`
	LLM       LLM          `json:"llm,omitempty"`
	Timing    Timing       `json:"timing,omitempty"`
	Usage     Usage        `json:"usage,omitempty"`
	Output    Output       `json:"output,omitempty"`
}

type LLM

type LLM struct {
	Provider string `json:"provider,omitempty"`
	Model    string `json:"model,omitempty"`
}

type Output

type Output struct {
	Bytes   int    `json:"bytes,omitempty"`
	Lines   int    `json:"lines,omitempty"`
	Excerpt string `json:"excerpt,omitempty"`
}

type OutputSummary

type OutputSummary struct {
	Summary string
	Bytes   int
	Lines   int
	Excerpt string
}

func SummarizeOutput

func SummarizeOutput(output string) OutputSummary

type ProgressType

type ProgressType string
const (
	ProgressTypeRoute        ProgressType = "route"
	ProgressTypeThinking     ProgressType = "thinking"
	ProgressTypeTool         ProgressType = "tool"
	ProgressTypeResponse     ProgressType = "response"
	ProgressTypeContext      ProgressType = "context"
	ProgressTypeCompaction   ProgressType = "compaction"
	ProgressTypeToolStart    ProgressType = "tool.start"
	ProgressTypeToolComplete ProgressType = "tool.complete"
	ProgressTypeLLMRequest   ProgressType = "llm.request"
	ProgressTypeLLMResponse  ProgressType = "llm.response"
)

type StatusLineInput

type StatusLineInput struct {
	TaskID    string
	TurnIndex int
	Message   string
	Limit     int
}

type Timing

type Timing struct {
	DurationMS int64   `json:"duration_ms,omitempty"`
	TokPerSec  float64 `json:"tok_per_sec,omitempty"`
}

type Tool

type Tool struct {
	Name     string         `json:"name,omitempty"`
	CallID   string         `json:"call_id,omitempty"`
	Input    map[string]any `json:"input,omitempty"`
	ExitCode *int           `json:"exit_code,omitempty"`
	Error    string         `json:"error,omitempty"`
}

type ToolSummary

type ToolSummary struct {
	Action string
	Target string
}

func SummarizeShellCommand

func SummarizeShellCommand(command string) ToolSummary

func SummarizeToolCall

func SummarizeToolCall(toolName string, input json.RawMessage) ToolSummary

type Usage

type Usage struct {
	InputTokens        int `json:"input_tokens,omitempty"`
	OutputTokens       int `json:"output_tokens,omitempty"`
	CachedInputTokens  int `json:"cached_input_tokens,omitempty"`
	RetriedInputTokens int `json:"retried_input_tokens,omitempty"`
	TotalTokens        int `json:"total_tokens,omitempty"`
}

Jump to

Keyboard shortcuts

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