Documentation
¶
Index ¶
- type AgentState
- type ChatMessageStore
- type MCPStatus
- type MCPTool
- type Message
- type MessageSource
- type MessageType
- type ServerConnectionInfo
- type Session
- type SessionInfo
- type SessionPickerRequest
- type SessionPickerResponse
- type UserChoiceOption
- type UserChoiceRequest
- type UserChoiceResponse
- type UserInputResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentState ¶
type AgentState string
const ( AgentStateIdle AgentState = "idle" AgentStateWaitingForInput AgentState = "waiting-for-input" AgentStateRunning AgentState = "running" AgentStateInitializing AgentState = "initializing" AgentStateDone AgentState = "done" AgentStateExited AgentState = "exited" )
type ChatMessageStore ¶ added in v0.0.21
type ChatMessageStore interface {
AddChatMessage(record *Message) error
SetChatMessages(newHistory []*Message) error
ChatMessages() []*Message
ClearChatMessages() error
}
ChatMessageStore defines the interface for managing storage of chat messages of a session.
type MCPStatus ¶
type MCPStatus struct {
ServerInfoList []ServerConnectionInfo `json:"serverInfoList,omitempty"`
TotalServers int `json:"totalServers,omitempty"`
ConnectedCount int `json:"connectedCount,omitempty"`
FailedCount int `json:"failedCount,omitempty"`
TotalTools int `json:"totalTools,omitempty"`
ClientEnabled bool `json:"clientEnabled,omitempty"`
}
MCPStatus represents the overall status of MCP servers and tools
type MCPTool ¶
type MCPTool struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Server string `json:"server,omitempty"`
}
MCPTool represents an MCP tool with basic information
type Message ¶
type Message struct {
ID string
Source MessageSource
Type MessageType
Payload any
Timestamp time.Time
}
type MessageSource ¶
type MessageSource string
const ( MessageSourceUser MessageSource = "user" MessageSourceAgent MessageSource = "agent" MessageSourceModel MessageSource = "model" )
type MessageType ¶
type MessageType string
const ( MessageTypeText MessageType = "text" MessageTypeError MessageType = "error" MessageTypeToolCallRequest MessageType = "tool-call-request" MessageTypeToolCallResponse MessageType = "tool-call-response" MessageTypeUserInputRequest MessageType = "user-input-request" MessageTypeUserInputResponse MessageType = "user-input-response" MessageTypeUserChoiceRequest MessageType = "user-choice-request" MessageTypeUserChoiceResponse MessageType = "user-choice-response" MessageTypeSessionPickerRequest MessageType = "session-picker-request" MessageTypeSessionPickerResponse MessageType = "session-picker-response" )
type ServerConnectionInfo ¶
type ServerConnectionInfo struct {
Name string `json:"name,omitempty"`
Command string `json:"command,omitempty"`
IsLegacy bool `json:"isLegacy,omitempty"`
IsConnected bool `json:"isConnected,omitempty"`
AvailableTools []MCPTool `json:"availableTools,omitempty"`
}
ServerConnectionInfo holds connection status for a single MCP server
type Session ¶
type Session struct {
ID string
Name string
ProviderID string
ModelID string
Messages []*Message
AgentState AgentState
CreatedAt time.Time
LastModified time.Time
ChatMessageStore ChatMessageStore
// MCP status information
MCPStatus *MCPStatus
}
func (*Session) AllMessages ¶
type SessionInfo ¶ added in v0.0.30
type SessionInfo struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
ModelID string `json:"modelId,omitempty"`
ProviderID string `json:"providerId,omitempty"`
CreatedAt time.Time `json:"createdAt"`
LastModified time.Time `json:"lastModified"`
MessageCount int `json:"messageCount"`
}
SessionInfo contains display information for a session
type SessionPickerRequest ¶ added in v0.0.30
type SessionPickerRequest struct {
Sessions []SessionInfo `json:"sessions"`
}
SessionPickerRequest is sent to show an interactive session picker
type SessionPickerResponse ¶ added in v0.0.30
type SessionPickerResponse struct {
SessionID string `json:"sessionId"`
Cancelled bool `json:"cancelled"`
}
SessionPickerResponse is sent when user selects a session
type UserChoiceOption ¶
type UserChoiceRequest ¶
type UserChoiceRequest struct {
Prompt string
Options []UserChoiceOption
}
type UserChoiceResponse ¶
type UserChoiceResponse struct {
Choice int `json:"choice"`
}
type UserInputResponse ¶
type UserInputResponse struct {
Query string `json:"query"`
}
Click to show internal directories.
Click to hide internal directories.