Documentation
¶
Index ¶
- func Run(version string) error
- type AgentInfo
- type App
- func (a *App) CloseSession(sessionID string)
- func (a *App) CreateSession(agentName string) (*SessionInfo, error)
- func (a *App) GetConfig() *userconfig.Config
- func (a *App) GetCost(sessionID string) *CostInfo
- func (a *App) GetMCPStatus() []MCPStatus
- func (a *App) GetSessions() []SessionInfo
- func (a *App) GetThemes() []ThemeInfo
- func (a *App) ListAgents() []AgentInfo
- func (a *App) OpenFile() (*FileResult, error)
- func (a *App) SaveAPIKey(provider, key string) error
- func (a *App) SaveConfig(provider, model, baseURL string) error
- func (a *App) SendMessage(sessionID, message string) error
- func (a *App) Startup(ctx context.Context)
- func (a *App) StopGeneration(sessionID string)
- func (a *App) SwitchAgent(sessionID, agentName string) error
- type CostInfo
- type FileResult
- type MCPStatus
- type Message
- type Session
- type SessionInfo
- type ThemeInfo
- type ToolCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentInfo ¶
type AgentInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Model string `json:"model"`
Path string `json:"path"`
Builtin bool `json:"builtin"`
Category string `json:"category"` // "hub", "spoke", "standalone"
}
AgentInfo describes an available agent.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App manages the desktop application state.
func (*App) CloseSession ¶
func (*App) CreateSession ¶
func (a *App) CreateSession(agentName string) (*SessionInfo, error)
func (*App) GetConfig ¶
func (a *App) GetConfig() *userconfig.Config
func (*App) GetMCPStatus ¶
func (*App) GetSessions ¶
func (a *App) GetSessions() []SessionInfo
func (*App) ListAgents ¶
func (*App) OpenFile ¶
func (a *App) OpenFile() (*FileResult, error)
OpenFile opens a native file picker and returns the file path and content.
func (*App) SaveAPIKey ¶
func (*App) SaveConfig ¶
func (*App) SendMessage ¶
func (*App) StopGeneration ¶
func (*App) SwitchAgent ¶
type CostInfo ¶
type CostInfo struct {
InputTokens int `json:"inputTokens"`
OutputTokens int `json:"outputTokens"`
Cost float64 `json:"cost"`
Model string `json:"model"`
}
CostInfo shows token usage and cost.
type FileResult ¶
type FileResult struct {
Path string `json:"path"`
Name string `json:"name"`
Content string `json:"content"`
}
FileResult is returned by OpenFile.
type MCPStatus ¶
type MCPStatus struct {
Name string `json:"name"`
Transport string `json:"transport"`
Installed bool `json:"installed"`
}
MCPStatus describes an MCP server's state.
type Message ¶
type Message struct {
ID string `json:"id"`
Role string `json:"role"`
Content string `json:"content"`
Timestamp int64 `json:"timestamp"`
ToolCalls []ToolCall `json:"toolCalls,omitempty"`
}
Message represents a chat message for the frontend.
type Session ¶
type Session struct {
ID string `json:"id"`
Agent string `json:"agent"`
Model string `json:"model"`
CreatedAt int64 `json:"createdAt"`
Messages []Message `json:"messages"`
// contains filtered or unexported fields
}
Session wraps an engine.Session with desktop-specific state.
type SessionInfo ¶
type SessionInfo struct {
ID string `json:"id"`
Agent string `json:"agent"`
Model string `json:"model"`
Messages int `json:"messages"`
CreatedAt int64 `json:"createdAt"`
Preview string `json:"preview"` // first user message
}
SessionInfo is a summary for the session list.
type ThemeInfo ¶
type ThemeInfo struct {
Name string `json:"name"`
BG string `json:"bg"`
BGPanel string `json:"bgPanel"`
BGInput string `json:"bgInput"`
Border string `json:"border"`
User string `json:"user"`
Assistant string `json:"assistant"`
Tool string `json:"tool"`
Error string `json:"error"`
Accent string `json:"accent"`
Text string `json:"text"`
Muted string `json:"muted"`
}
ThemeInfo describes a desktop theme.
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Name string `json:"name"`
Input string `json:"input"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
Duration int64 `json:"duration"` // milliseconds
Status string `json:"status"` // "running", "done", "error", "declined"
}
ToolCall represents a tool execution.
Click to show internal directories.
Click to hide internal directories.