Documentation
¶
Index ¶
- Constants
- Variables
- func GetOptions(c *Controller, icon []byte, assets embed.FS) *options.App
- type ApplicationConfig
- type AssetMeta
- type Controller
- func (c *Controller) AppMounted()
- func (c *Controller) GetApplicationConfig() ApplicationConfig
- func (c *Controller) GetAssetMeta(path string) (AssetMeta, error)
- func (c *Controller) GetAvailableProfiles() map[string]model.ProfileMeta
- func (c *Controller) GetCurrentConversation() LLMMessages
- func (c *Controller) GetDebugConfig() model.DebugConfig
- func (c *Controller) GetLastState() string
- func (c *Controller) HistoryGetCount() (int, error)
- func (c *Controller) HistoryGetLast(skip, limit int) ([]history.Entry, error)
- func (c *Controller) HistorySearch(query string) ([]history.Entry, error)
- func (c *Controller) IsAppMounted() bool
- func (c *Controller) LLMApproveToolCall(callId, message string)
- func (c *Controller) LLMAsk(args LLMAskArgs) (result LLMAskResult, err error)
- func (c *Controller) LLMInterrupt() (err error)
- func (c *Controller) LLMRejectToolCall(callId, message string)
- func (c *Controller) LLMWait() (result LLMAskResult, err error)
- func (c *Controller) ListMcpTools() (map[string][]mcp.Tool, error)
- func (c *Controller) Log(level string, jsonArgs string)
- func (c *Controller) OpenFileDialog(args OpenFileDialogArgs) ([]string, error)
- func (c *Controller) Restart(state string)
- func (c *Controller) SetActiveProfile(profileName string) (model.Profile, error)
- func (c *Controller) SetBuiltinTools(config builtin.BuiltIns)
- func (c *Controller) SetMcpTools(config map[string]iMcp.Server)
- func (c *Controller) Shutdown()
- func (c *Controller) TriggerRestart()
- type LLMAskArgs
- type LLMAskResult
- type LLMMessage
- type LLMMessageCall
- type LLMMessageCallMeta
- type LLMMessageCallResult
- type LLMMessageContentPart
- type LLMMessageContentPartType
- type LLMMessages
- type OpenFileDialogArgs
Constants ¶
View Source
const ( EventNameLLMMessageAdd = "llm:message:add" EventNameLLMMessageUpdate = "llm:message:update" EventNameLLMConsumptionUpdate = "llm:consumption:update" )
Variables ¶
View Source
var ( RuntimeEventsEmit = runtime.EventsEmit RuntimeScreenGetAll = runtime.ScreenGetAll RuntimeWindowShow = runtime.WindowShow RuntimeWindowGetSize = runtime.WindowGetSize RuntimeWindowSetSize = runtime.WindowSetSize RuntimeWindowSetMaxSize = runtime.WindowSetMaxSize RuntimeWindowSetPosition = runtime.WindowSetPosition RuntimeWindowCenter = runtime.WindowCenter RuntimeOpenMultipleFilesDialog = runtime.OpenMultipleFilesDialog RuntimeHide = runtime.Hide RuntimeQuit = runtime.Quit )
Runtime functions that are used in the controller package. These functions can be overridden in tests or other packages if needed.
Functions ¶
func GetOptions ¶
Types ¶
type ApplicationConfig ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func BuildFromConfig ¶
func (*Controller) AppMounted ¶
func (c *Controller) AppMounted()
AppMounted is called when the frontend application is mounted (decided by the frontend itself)
func (*Controller) GetApplicationConfig ¶
func (c *Controller) GetApplicationConfig() ApplicationConfig
func (*Controller) GetAssetMeta ¶
func (c *Controller) GetAssetMeta(path string) (AssetMeta, error)
func (*Controller) GetAvailableProfiles ¶
func (c *Controller) GetAvailableProfiles() map[string]model.ProfileMeta
func (*Controller) GetCurrentConversation ¶
func (c *Controller) GetCurrentConversation() LLMMessages
func (*Controller) GetDebugConfig ¶
func (c *Controller) GetDebugConfig() model.DebugConfig
func (*Controller) GetLastState ¶
func (c *Controller) GetLastState() string
func (*Controller) HistoryGetCount ¶
func (c *Controller) HistoryGetCount() (int, error)
func (*Controller) HistoryGetLast ¶
func (c *Controller) HistoryGetLast(skip, limit int) ([]history.Entry, error)
func (*Controller) HistorySearch ¶
func (c *Controller) HistorySearch(query string) ([]history.Entry, error)
func (*Controller) IsAppMounted ¶
func (c *Controller) IsAppMounted() bool
func (*Controller) LLMApproveToolCall ¶
func (c *Controller) LLMApproveToolCall(callId, message string)
func (*Controller) LLMAsk ¶
func (c *Controller) LLMAsk(args LLMAskArgs) (result LLMAskResult, err error)
func (*Controller) LLMInterrupt ¶
func (c *Controller) LLMInterrupt() (err error)
func (*Controller) LLMRejectToolCall ¶
func (c *Controller) LLMRejectToolCall(callId, message string)
func (*Controller) LLMWait ¶
func (c *Controller) LLMWait() (result LLMAskResult, err error)
func (*Controller) ListMcpTools ¶
func (c *Controller) ListMcpTools() (map[string][]mcp.Tool, error)
func (*Controller) Log ¶
func (c *Controller) Log(level string, jsonArgs string)
func (*Controller) OpenFileDialog ¶
func (c *Controller) OpenFileDialog(args OpenFileDialogArgs) ([]string, error)
func (*Controller) Restart ¶
func (c *Controller) Restart(state string)
func (*Controller) SetActiveProfile ¶
func (c *Controller) SetActiveProfile(profileName string) (model.Profile, error)
func (*Controller) SetBuiltinTools ¶
func (c *Controller) SetBuiltinTools(config builtin.BuiltIns)
func (*Controller) SetMcpTools ¶
func (c *Controller) SetMcpTools(config map[string]iMcp.Server)
func (*Controller) Shutdown ¶
func (c *Controller) Shutdown()
func (*Controller) TriggerRestart ¶
func (c *Controller) TriggerRestart()
type LLMAskArgs ¶
type LLMAskArgs struct {
History LLMMessages
}
type LLMAskResult ¶
type LLMAskResult struct {
Content string
Consumption common.ConsumptionSummary
}
type LLMMessage ¶
type LLMMessage struct {
Id string
Role string
ContentParts []LLMMessageContentPart
Created int64
}
type LLMMessageCall ¶
type LLMMessageCall struct {
Id string
Function string
Arguments string
Meta LLMMessageCallMeta
Result *LLMMessageCallResult
}
type LLMMessageCallMeta ¶
type LLMMessageCallResult ¶
type LLMMessageCallResult struct {
Content string
Error string
DurationMs int64
//only for wails to generate TypeScript types
V mcp.CallToolResult
W mcp.TextContent
X mcp.ImageContent
Y mcp.AudioContent
Z mcp.EmbeddedResource
}
type LLMMessageContentPart ¶
type LLMMessageContentPart struct {
Type LLMMessageContentPartType
Content string
Call LLMMessageCall
}
type LLMMessageContentPartType ¶
type LLMMessageContentPartType string
const ( LLMMessageContentPartTypeAttachment LLMMessageContentPartType = "attachment" LLMMessageContentPartTypeText LLMMessageContentPartType = "text" LLMMessageContentPartTypeToolCall LLMMessageContentPartType = "tool" )
type LLMMessages ¶
type LLMMessages []LLMMessage
func (LLMMessages) ToMessageContent ¶
func (m LLMMessages) ToMessageContent() ([]llms.MessageContent, error)
type OpenFileDialogArgs ¶
type OpenFileDialogArgs struct {
Title string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.