crush_types

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCrush

func FromCrush(events []Event, _ string) []types.AgentEvent

Types

type AgentEventPayload

type AgentEventPayload struct {
	Type  string `json:"type"`
	Error string `json:"error,omitempty"`
	RunID string `json:"run_id,omitempty"`
}

type Event

type Event struct {
	Type    EventType       `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

func ToCrush

func ToCrush(events []types.AgentEvent, sessionID string) []Event

type EventType

type EventType string
const (
	EventMessage     EventType = "message"
	EventAgentEvent  EventType = "agent_event"
	EventRunComplete EventType = "run_complete"
)

type FinishData

type FinishData struct {
	Reason  FinishReason `json:"reason"`
	Time    int64        `json:"time"`
	Message string       `json:"message,omitempty"`
}

type FinishReason

type FinishReason string
const (
	FinishReasonEndTurn FinishReason = "end_turn"
	FinishReasonError   FinishReason = "error"
)

type MessagePayload

type MessagePayload struct {
	ID        string `json:"id"`
	Role      string `json:"role"`
	SessionID string `json:"session_id"`
	Parts     []Part `json:"parts"`
	Model     string `json:"model,omitempty"`
	Provider  string `json:"provider,omitempty"`
}

type Part

type Part struct {
	Type PartType        `json:"type"`
	Data json.RawMessage `json:"data"`
}

type PartType

type PartType string
const (
	PartReasoning  PartType = "reasoning"
	PartText       PartType = "text"
	PartToolCall   PartType = "tool_call"
	PartToolResult PartType = "tool_result"
	PartFinish     PartType = "finish"
)

type ReasoningData

type ReasoningData struct {
	Thinking  string `json:"thinking"`
	StartedAt int64  `json:"started_at,omitempty"`
}

type RunCompletePayload

type RunCompletePayload struct {
	SessionID string `json:"session_id,omitempty"`
	RunID     string `json:"run_id,omitempty"`
	MessageID string `json:"message_id,omitempty"`
	Text      string `json:"text,omitempty"`
	Error     string `json:"error,omitempty"`
	Cancelled bool   `json:"cancelled,omitempty"`
}

type TextData

type TextData struct {
	Text string `json:"text"`
}

type ToolCallData

type ToolCallData struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Input    string `json:"input"`
	Finished bool   `json:"finished,omitempty"`
}

type ToolResultData

type ToolResultData struct {
	ToolCallID string `json:"tool_call_id"`
	Name       string `json:"name"`
	Content    string `json:"content"`
}

Jump to

Keyboard shortcuts

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