Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromUpdatesJSONL ¶
func FromUpdatesJSONL(lines []string) []types.AgentEvent
FromUpdatesJSONL walks wire lines through a converter, flushes at end, and returns all canonical events.
func TextContent ¶
func TextContent(raw json.RawMessage) string
TextContent extracts user-visible text from a session update content field.
func ToWireLines ¶
func ToWireLines(updates []SessionUpdate, opts ToOptions) []string
ToWireLines marshals session updates to JSONL strings.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter converts grok session updates to AgentEvents with chunk coalescing.
func NewConverter ¶
func NewConverter() *Converter
NewConverter creates a converter for one grok session stream.
func (*Converter) Flush ¶
func (c *Converter) Flush() []types.AgentEvent
Flush emits any buffered chunk coalescence at end of stream.
func (*Converter) ProcessLine ¶
func (c *Converter) ProcessLine(line string) []types.AgentEvent
ProcessLine parses one updates.jsonl line and returns AgentEvents to emit.
func (*Converter) SetTurnIndex ¶ added in v0.0.51
SetTurnIndex restores the converter turn counter from a grok-sync checkpoint.
type SessionUpdate ¶
type SessionUpdate struct {
SessionUpdate string `json:"sessionUpdate"`
Content json.RawMessage `json:"content,omitempty"`
ToolCallID string `json:"toolCallId,omitempty"`
Kind string `json:"kind,omitempty"`
Title string `json:"title,omitempty"`
Status string `json:"status,omitempty"`
}
SessionUpdate is one ACP session update record from updates.jsonl.
func ParseLine ¶
func ParseLine(line string) (SessionUpdate, bool)
ParseLine parses one updates.jsonl line in flat or grok wire envelope form.
func ToSession ¶
func ToSession(events []types.AgentEvent, opts ToOptions) []SessionUpdate
ToSession converts canonical AgentEvents to grok session updates.