types

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompactTraceOutput

func CompactTraceOutput(output string) string

func RegisterAgentTraceAdapter

func RegisterAgentTraceAdapter(priority int, adapter AgentTraceAdapter)

func TitleFromIdentifier

func TitleFromIdentifier(id string) string

func TraceIsAssistantItem

func TraceIsAssistantItem(itemType string) bool

func TraceItemText

func TraceItemText(item *TraceItem) string

func TraceMessageText

func TraceMessageText(message *TraceMessage) string

Types

type ActivityStatus

type ActivityStatus string
const (
	StatusCompleted  ActivityStatus = "completed"
	StatusFailed     ActivityStatus = "failed"
	StatusInProgress ActivityStatus = "in_progress"
	StatusWarning    ActivityStatus = "warning"
	StatusPending    ActivityStatus = "pending"
)

type ActivitySubtype

type ActivitySubtype string
const (
	SubtypeStarted   ActivitySubtype = "started"
	SubtypeUpdated   ActivitySubtype = "updated"
	SubtypeCompleted ActivitySubtype = "completed"
)

type AgentTraceActivity

type AgentTraceActivity struct {
	Subtype        ActivitySubtype        `json:"subtype"`
	CallID         string                 `json:"call_id,omitempty"`
	ToolName       string                 `json:"tool_name"`
	Summary        string                 `json:"summary"`
	Kind           string                 `json:"kind,omitempty"`
	Status         ActivityStatus         `json:"status,omitempty"`
	FileChanges    []AgentTraceFileChange `json:"file_changes,omitempty"`
	ReplaceSummary bool                   `json:"replace_summary,omitempty"`
}

type AgentTraceAdapter

type AgentTraceAdapter interface {
	Name() string
	Parse(raw json.RawMessage) (AgentTraceParsedEvent, bool)
}

type AgentTraceDetail

type AgentTraceDetail struct {
	Metadata AgentTraceMetadata  `json:"metadata"`
	Prompt   string              `json:"prompt"`
	Messages []AgentTraceMessage `json:"messages"`
	RawLines []json.RawMessage   `json:"raw_lines"`
}

type AgentTraceFileChange

type AgentTraceFileChange struct {
	Path string `json:"path"`
	Kind string `json:"kind,omitempty"`
}

type AgentTraceMessage

type AgentTraceMessage struct {
	Role       MessageRole         `json:"role"`
	Content    string              `json:"content"`
	Sources    []string            `json:"sources,omitempty"`
	ToolCall   *AgentTraceActivity `json:"tool_call,omitempty"`
	StartedAt  *int64              `json:"started_at,omitempty"`
	FinishedAt *int64              `json:"finished_at,omitempty"`
}

type AgentTraceMetadata

type AgentTraceMetadata struct {
	ID            string   `json:"id"`
	Command       string   `json:"command"`
	CommandArgs   []string `json:"command_args,omitempty"`
	CommandLine   string   `json:"command_line,omitempty"`
	TopicPath     string   `json:"topic_path,omitempty"`
	Workspace     string   `json:"workspace,omitempty"`
	OutputPath    string   `json:"output_path,omitempty"`
	ResumeCommand string   `json:"resume_command,omitempty"`
	ProviderID    string   `json:"provider_id,omitempty"`
	Model         string   `json:"model,omitempty"`
	Status        string   `json:"status"`
	Tags          []string `json:"tags,omitempty"`
	Error         string   `json:"error,omitempty"`
	CreatedAt     string   `json:"created_at"`
	UpdatedAt     string   `json:"updated_at"`
	PromptPath    string   `json:"prompt_path"`
	LogPath       string   `json:"log_path"`
}

type AgentTraceParsedEvent

type AgentTraceParsedEvent struct {
	Message  *AgentTraceMessage
	Activity *AgentTraceActivity
}

func ParseAgentTraceLine

func ParseAgentTraceLine(raw json.RawMessage) (AgentTraceParsedEvent, bool)

type AgentTraceSummary

type AgentTraceSummary struct {
	AgentTraceMetadata
	LogLineCount int `json:"log_line_count"`
}

type AgentTraceUpdate

type AgentTraceUpdate struct {
	Metadata     AgentTraceMetadata  `json:"metadata"`
	Messages     []AgentTraceMessage `json:"messages"`
	RawLineCount int                 `json:"raw_line_count"`
}

type FileChange

type FileChange = AgentTraceFileChange

type Message

type Message = AgentTraceMessage

type MessageRole

type MessageRole string
const (
	RoleAssistant MessageRole = "assistant"
	RoleToolCall  MessageRole = "tool_call"
)

type ToolCallEvent

type ToolCallEvent = AgentTraceActivity

type TraceContent

type TraceContent struct {
	Type string `json:"type,omitempty"`
	Text string `json:"text,omitempty"`
}

type TraceEvent

type TraceEvent struct {
	Type     string                     `json:"type"`
	Subtype  string                     `json:"subtype,omitempty"`
	CallID   string                     `json:"call_id,omitempty"`
	Message  *TraceMessage              `json:"message,omitempty"`
	Result   string                     `json:"result,omitempty"`
	Item     *TraceItem                 `json:"item,omitempty"`
	ToolCall map[string]json.RawMessage `json:"tool_call,omitempty"`
	Delta    string                     `json:"delta,omitempty"`
	Text     string                     `json:"text,omitempty"`
}

type TraceItem

type TraceItem struct {
	ID               string          `json:"id,omitempty"`
	Type             string          `json:"type,omitempty"`
	Text             string          `json:"text,omitempty"`
	Message          string          `json:"message,omitempty"`
	Content          []TraceContent  `json:"content,omitempty"`
	Command          string          `json:"command,omitempty"`
	AggregatedOutput string          `json:"aggregated_output,omitempty"`
	ExitCode         *int            `json:"exit_code,omitempty"`
	Status           string          `json:"status,omitempty"`
	Items            []TraceTodoItem `json:"items,omitempty"`
	Plan             []TracePlanItem `json:"plan,omitempty"`
	Explanation      string          `json:"explanation,omitempty"`
	Changes          []FileChange    `json:"changes,omitempty"`
	Raw              json.RawMessage `json:"-"`
}

func (*TraceItem) UnmarshalJSON

func (i *TraceItem) UnmarshalJSON(data []byte) error

type TraceMessage

type TraceMessage struct {
	Content []TraceContent `json:"content"`
}

type TracePlanItem

type TracePlanItem struct {
	Step   string `json:"step,omitempty"`
	Status string `json:"status,omitempty"`
}

type TraceTodoItem

type TraceTodoItem struct {
	Text      string `json:"text,omitempty"`
	Completed bool   `json:"completed,omitempty"`
	Status    string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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