Documentation
¶
Index ¶
- type App
- type ConversationMessage
- type LogEntry
- type LogStreamResponse
- type NotificationHandler
- type PauseResponse
- type RPCClient
- func (c *RPCClient) GetLogs(maxLines int) (*LogStreamResponse, error)
- func (c *RPCClient) GetStatus() (*StatusResponse, error)
- func (c *RPCClient) InterruptTurn(turnID, reason string) (*TurnInterruptResponse, error)
- func (c *RPCClient) Pause() (*PauseResponse, error)
- func (c *RPCClient) Resume() (*ResumeResponse, error)
- func (c *RPCClient) SetRPCTimeout(timeout time.Duration)
- func (c *RPCClient) StartThread() (*ThreadStartResponse, error)
- func (c *RPCClient) StartTurn(threadID string, message string) (*TurnStartResponse, error)
- func (c *RPCClient) StreamNotifications(ctx context.Context, handler NotificationHandler) error
- func (c *RPCClient) TestConnection() error
- type ResumeResponse
- type StatusResponse
- type StreamNotification
- type ThreadStartResponse
- type TurnConversation
- type TurnInputContentPart
- type TurnInputMessage
- type TurnInterruptRequest
- type TurnInterruptResponse
- type TurnStartRequest
- type TurnStartResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the TUI application state.
type ConversationMessage ¶
type ConversationMessage struct {
ID string `json:"id"`
Type string `json:"type"` // user, assistant, system, turn_lifecycle
Timestamp time.Time `json:"timestamp"`
Content string `json:"content"`
State string `json:"state,omitempty"`
}
ConversationMessage represents a timeline/event message.
type LogEntry ¶
type LogEntry struct {
Level string `json:"level"`
Time time.Time `json:"time"`
Message string `json:"message"`
}
LogEntry represents a single log line
type LogStreamResponse ¶
LogStreamResponse is the response for holon/logStream
type NotificationHandler ¶
type NotificationHandler func(StreamNotification)
NotificationHandler is called for each decoded stream notification.
type PauseResponse ¶
PauseResponse is the response for holon/pause
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is a JSON-RPC client for the TUI
func NewRPCClient ¶
NewRPCClient creates a new RPC client
func (*RPCClient) GetLogs ¶
func (c *RPCClient) GetLogs(maxLines int) (*LogStreamResponse, error)
GetLogs retrieves logs from the server
func (*RPCClient) GetStatus ¶
func (c *RPCClient) GetStatus() (*StatusResponse, error)
GetStatus retrieves the current runtime status
func (*RPCClient) InterruptTurn ¶
func (c *RPCClient) InterruptTurn(turnID, reason string) (*TurnInterruptResponse, error)
InterruptTurn requests interruption for a specific turn.
func (*RPCClient) Pause ¶
func (c *RPCClient) Pause() (*PauseResponse, error)
Pause pauses the runtime
func (*RPCClient) Resume ¶
func (c *RPCClient) Resume() (*ResumeResponse, error)
Resume resumes the runtime
func (*RPCClient) SetRPCTimeout ¶
SetRPCTimeout updates JSON-RPC request timeout for non-stream calls.
func (*RPCClient) StartThread ¶
func (c *RPCClient) StartThread() (*ThreadStartResponse, error)
StartThread starts a new thread
func (*RPCClient) StartTurn ¶
func (c *RPCClient) StartTurn(threadID string, message string) (*TurnStartResponse, error)
StartTurn starts a new turn with a user message
func (*RPCClient) StreamNotifications ¶
func (c *RPCClient) StreamNotifications(ctx context.Context, handler NotificationHandler) error
StreamNotifications consumes JSON-RPC notifications from the server stream endpoint.
func (*RPCClient) TestConnection ¶
TestConnection tests if the RPC endpoint is reachable
type ResumeResponse ¶
ResumeResponse is the response for holon/resume
type StatusResponse ¶
type StatusResponse struct {
State string `json:"state"`
EventsProcessed int64 `json:"events_processed"`
LastEventAt time.Time `json:"last_event_at"`
SessionID string `json:"session_id"`
PausedAt time.Time `json:"paused_at,omitempty"`
ResumedAt time.Time `json:"resumed_at,omitempty"`
}
StatusResponse is the response for holon/status
type StreamNotification ¶
type StreamNotification struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
}
StreamNotification represents one JSON-RPC notification from /rpc/stream.
type ThreadStartResponse ¶
type ThreadStartResponse struct {
ThreadID string `json:"thread_id"`
SessionID string `json:"session_id"`
StartedAt string `json:"started_at"`
}
ThreadStartResponse is the response for thread/start
type TurnConversation ¶
type TurnConversation struct {
TurnID string
ThreadID string
StartedAt time.Time
UpdatedAt time.Time
State string
ProgressText string
ProgressState string
ElapsedMS int64
UserText string
AssistantText string
}
TurnConversation groups one user turn and the assistant response.
type TurnInputContentPart ¶
type TurnInputContentPart struct {
Type string `json:"type,omitempty"`
Text string `json:"text,omitempty"`
}
TurnInputContentPart represents content in a message
type TurnInputMessage ¶
type TurnInputMessage struct {
Type string `json:"type,omitempty"`
Role string `json:"role,omitempty"`
Content []TurnInputContentPart `json:"content,omitempty"`
}
TurnInputMessage represents a user message
type TurnInterruptRequest ¶
type TurnInterruptRequest struct {
TurnID string `json:"turn_id,omitempty"`
Reason string `json:"reason,omitempty"`
}
TurnInterruptRequest represents a targeted turn interruption request.
type TurnInterruptResponse ¶
type TurnInterruptResponse struct {
TurnID string `json:"turn_id"`
State string `json:"state"`
InterruptedAt string `json:"interrupted_at"`
Message string `json:"message,omitempty"`
}
TurnInterruptResponse is the response for turn/interrupt.
type TurnStartRequest ¶
type TurnStartRequest struct {
ThreadID string `json:"thread_id,omitempty"`
Input []TurnInputMessage `json:"input,omitempty"`
}
TurnStartRequest represents a request to start a new turn
type TurnStartResponse ¶
type TurnStartResponse struct {
TurnID string `json:"turn_id"`
State string `json:"state"`
StartedAt string `json:"started_at"`
}
TurnStartResponse is the response for turn/start