Documentation
¶
Overview ¶
Package stream writes run events as versioned JSONL, one object per line. It is the contract for programs that drive uagent, such as rs-uagent-tui.
Index ¶
- Constants
- func EventToDTO(event core.Event) (dto any, ok bool)
- func SummaryFromDTO(d SummaryDTO) core.Result
- type AssistantMessageDTO
- type ControlInputDTO
- type DeveloperMessageDTO
- type ModelRespondedDTO
- type PreflightWarningDTO
- type ReasoningDTO
- type RunFinishedDTO
- type RunStartedDTO
- type RunnerErrorDTO
- type Sink
- type StatsDTO
- type SummaryDTO
- type TokensDTO
- type ToolCalledDTO
- type ToolFinishedDTO
- type ToolStartedDTO
- type TurnStartedDTO
- type UserMessageDTO
Constants ¶
View Source
const SchemaVersion = 1
SchemaVersion is bumped on any breaking change to the event or summary shape.
Variables ¶
This section is empty.
Functions ¶
func EventToDTO ¶
EventToDTO maps a domain event to its wire form. ok is false for unknown events.
func SummaryFromDTO ¶
func SummaryFromDTO(d SummaryDTO) core.Result
SummaryFromDTO restores run metadata from a saved summary. Stats are not restored: callers recompute them from events.jsonl.
Types ¶
type AssistantMessageDTO ¶
type ControlInputDTO ¶
type DeveloperMessageDTO ¶ added in v0.7.0
type ModelRespondedDTO ¶
type PreflightWarningDTO ¶
type ReasoningDTO ¶
type RunFinishedDTO ¶
type RunFinishedDTO struct {
Summary SummaryDTO `json:"summary"`
// contains filtered or unexported fields
}
type RunStartedDTO ¶
type RunnerErrorDTO ¶
type RunnerErrorDTO struct {
Message string `json:"message"`
// contains filtered or unexported fields
}
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink writes each event as one JSON line.
type StatsDTO ¶
type StatsDTO struct {
EventSpanMS int64 `json:"event_span_ms"`
ModelMS int64 `json:"model_ms"`
ToolBusyMS int64 `json:"tool_busy_ms"`
ToolModelOverlapMS int64 `json:"tool_model_overlap_ms"`
Turns int `json:"turns"`
UserMessages int `json:"user_messages"`
ModelResponses int `json:"model_responses"`
ToolCalls int `json:"tool_calls"`
FailedToolCalls int `json:"failed_tool_calls"`
MaxParallelTools int `json:"max_parallel_tools"`
ToolsByName map[string]int `json:"tools_by_name"`
Tokens TokensDTO `json:"tokens"`
StopReasons map[string]int `json:"stop_reasons,omitempty"`
Failures []string `json:"failures,omitempty"`
Errors []string `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
FinalAnswer bool `json:"final_answer"`
}
type SummaryDTO ¶
type SummaryDTO struct {
V int `json:"v"`
Status string `json:"status"`
RunnerExitCode int `json:"runner_exit_code"`
RunID string `json:"run_id"`
SessionID string `json:"session_id"`
Provider string `json:"provider"`
Model string `json:"model"`
Effort string `json:"effort"`
Workspace string `json:"workspace"`
StartedAt time.Time `json:"started_at"`
WallMS int64 `json:"wall_ms"`
Stats StatsDTO `json:"stats"`
Answer string `json:"answer"`
}
SummaryDTO is a finished run. It is the run_finished payload and the content of summary.json.
func SummaryToDTO ¶
func SummaryToDTO(r core.Result) SummaryDTO
type ToolCalledDTO ¶
type ToolFinishedDTO ¶
type ToolFinishedDTO struct {
CallID string `json:"call_id"`
OpID string `json:"op_id,omitempty"`
Name string `json:"name"`
Label string `json:"label"`
OK bool `json:"ok"`
Detail string `json:"detail"`
DurationMS int64 `json:"duration_ms"`
OpType string `json:"op_type,omitempty"`
OutPath string `json:"out_path,omitempty"`
ErrPath string `json:"err_path,omitempty"`
// contains filtered or unexported fields
}
type ToolStartedDTO ¶
type ToolStartedDTO struct {
CallID string `json:"call_id"`
OpID string `json:"op_id"`
Name string `json:"name"`
Label string `json:"label"`
OpType string `json:"op_type,omitempty"`
OutPath string `json:"out_path,omitempty"`
ErrPath string `json:"err_path,omitempty"`
// contains filtered or unexported fields
}
type TurnStartedDTO ¶
type UserMessageDTO ¶
Click to show internal directories.
Click to hide internal directories.