api

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

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

func (s *Session) AllMessages() []*Message

func (*Session) String added in v0.0.29

func (s *Session) String() string

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 UserChoiceOption struct {
	Label string `json:"label,omitempty"`
	Value string `json:"value,omitempty"`
}

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"`
}

Jump to

Keyboard shortcuts

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