setup

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	WebSearchProviderDDG     = "ddg"
	WebSearchProviderTavily  = "tavily"
	WebSearchProviderSerper  = "serper"
	WebSearchProviderSearXNG = "searxng"
)
View Source
const (
	ProviderModelStatusOK          = "ok"
	ProviderModelStatusRequiresKey = "requires_key"
	ProviderModelStatusAuthError   = "auth_error"
	ProviderModelStatusUnavailable = "unavailable"
	ProviderModelStatusUnsupported = "unsupported"

	ProviderModelSourceLiveCatalog   = "live_catalog"
	ProviderModelSourcePublicCatalog = "public_catalog"
	ProviderModelSourceConfiguredKey = "configured_key"
	ProviderModelSourceManual        = "manual"
)
View Source
const (
	VoiceModuleTTS = "tts"
	VoiceModuleSTT = "stt"
)
View Source
const CurrentVersion = 3
View Source
const DaemonUnitName = "matrixclawd.service"
View Source
const FutureVoiceModuleRealtime = "realtime_voice"

Realtime voice is intentionally not exposed as a configurable module yet. Keep the concept documented here so it can be added later when there is a client/runtime capable of testing bidirectional audio.

Variables

View Source
var ErrConfigNotFound = errors.New("setup config not found")
View Source
var ErrDraftNotFound = errors.New("setup draft not found")
View Source
var ErrUnsupportedConfigVersion = errors.New("unsupported setup config version")

Functions

func BoolString

func BoolString(v bool) string

func ClientBootstrapsFromConfig

func ClientBootstrapsFromConfig(cfg Config) (map[string]ClientBootstrap, error)

func DaemonEnvironmentFilePath

func DaemonEnvironmentFilePath(setupPath string) string

func DefaultAssistantSystemPrompt

func DefaultAssistantSystemPrompt() string

func DefaultConfigPath

func DefaultConfigPath() (string, error)

func DefaultDBPath

func DefaultDBPath() string

func ImportDaemonEnvironmentFile

func ImportDaemonEnvironmentFile(setupPath string, cfg Config) error

func InitializeAssistantSystemPrompt

func InitializeAssistantSystemPrompt(current string) string

func InitializeAssistantSystemPromptForConfig

func InitializeAssistantSystemPromptForConfig(current string, cfg Config) string

func InitializeAssistantSystemPromptForDraft

func InitializeAssistantSystemPromptForDraft(current string, draft Draft) string

func InitializeAssistantSystemPromptWithContext

func InitializeAssistantSystemPromptWithContext(current string, promptContext AssistantPromptContext) string

func MCPConfigStatus added in v0.1.11

func MCPConfigStatus(cfg MCPConfig) string

func MaskSecret

func MaskSecret(value string) string

func ParseBool

func ParseBool(v string) bool

func ProviderAPIKeyPreview

func ProviderAPIKeyPreview(provider ProviderConfig) string

func ProviderCompactStatus

func ProviderCompactStatus(item ProviderSetupItem) string

func ProviderDisplayName

func ProviderDisplayName(item ProviderSetupItem) string

func ProviderDisplayStatus

func ProviderDisplayStatus(item ProviderSetupItem) string

func ProviderDraftConfigured

func ProviderDraftConfigured(provider ProviderDraft) bool

func ProviderFormCommandID added in v0.1.9

func ProviderFormCommandID(id ProviderFormFieldID) string

func ProviderFormToolUseModeStatus added in v0.1.1

func ProviderFormToolUseModeStatus(mode providers.ToolUseMode) string

func ProviderFormToolUseModes added in v0.1.1

func ProviderFormToolUseModes() []providers.ToolUseMode

func ProviderModelCatalogAllowsManualInput added in v0.1.11

func ProviderModelCatalogAllowsManualInput(response ProviderModelsResponse) bool

func ProviderModelCatalogManualMessage added in v0.1.11

func ProviderModelCatalogManualMessage(response ProviderModelsResponse) string

func ProviderModelCatalogMessage added in v0.1.11

func ProviderModelCatalogMessage(response ProviderModelsResponse) string

func ProviderRequiredMessage added in v0.1.9

func ProviderRequiredMessage(field ProviderFormField) string

func ProviderRequiredStatus added in v0.1.9

func ProviderRequiredStatus(value string) string

func ResolvedProviderAPIKey

func ResolvedProviderAPIKey(provider ProviderConfig) (string, bool)

func WebSearchConfigStatus added in v0.1.11

func WebSearchConfigStatus(cfg WebSearchConfig) string

func WebSearchEnvVars added in v0.1.11

func WebSearchEnvVars(cfg WebSearchConfig) map[string]string

WebSearchEnvVars returns environment variable pairs for the active provider credentials.

Types

type ApplyResult

type ApplyResult struct {
	Config   Config
	Path     string
	Summary  Summary
	Warnings []string
}

type AssistantConfig

type AssistantConfig struct {
	Name               string `json:"name,omitempty"`
	SystemPrompt       string `json:"system_prompt,omitempty"`
	CustomInstructions string `json:"custom_instructions,omitempty"`
}

type AssistantPromptContext

type AssistantPromptContext struct {
	HTTPAddr              string
	DBPath                string
	Timezone              string
	AutostartOnBoot       bool
	TelegramEnabled       bool
	TelegramProviderSetup bool
	ActiveProviderID      string
	ConfiguredProviders   int
}

type AssistantSummary

type AssistantSummary struct {
	Name   string
	Status string
}

type ClientBootstrap

type ClientBootstrap struct {
	Enabled     bool
	Values      map[string]string
	Int64Values map[string]int64
}

type ClientsConfig

type ClientsConfig struct {
	Terminal TerminalConfig `json:"terminal"`
	Telegram TelegramConfig `json:"telegram"`
}

type Config

type Config struct {
	Version          int              `json:"version"`
	CompletedAt      time.Time        `json:"completed_at"`
	ActiveProviderID string           `json:"active_provider_id,omitempty"`
	Assistant        AssistantConfig  `json:"assistant,omitempty"`
	Providers        []ProviderConfig `json:"providers,omitempty"`
	Daemon           DaemonConfig     `json:"daemon"`
	Clients          ClientsConfig    `json:"clients"`
	Modules          ModulesConfig    `json:"modules,omitempty"`
}

func (Config) ExternalAgentConfig added in v0.1.6

func (cfg Config) ExternalAgentConfig(id string) ExternalAgentConfig

type DaemonConfig

type DaemonConfig struct {
	HTTPAddr        string `json:"http_addr"`
	DBPath          string `json:"db_path"`
	Timezone        string `json:"timezone,omitempty"`
	APIToken        string `json:"api_token,omitempty"`
	AutostartOnBoot bool   `json:"autostart_on_boot"`
}

type DaemonSummary

type DaemonSummary struct {
	Status        string
	HTTPAddr      string
	DBPath        string
	Timezone      string
	Autostart     bool
	RuntimeStatus string
	Installed     bool
	Running       bool
	Enabled       bool
	Warning       string
}

type Draft

type Draft struct {
	ActiveProviderID      string
	AssistantName         string
	AssistantSystemPrompt string
	AssistantCustomPrompt string
	Providers             []ProviderDraft
	HTTPAddr              string
	DBPath                string
	Timezone              string
	AutostartOnBoot       string
	TelegramEnabled       string
	TelegramBotToken      string
	TelegramAllowedUID    string
	TelegramProviderSetup string
}

func DeleteProviderDraft

func DeleteProviderDraft(draft Draft, providerID string) Draft

func UpsertProviderDraft

func UpsertProviderDraft(draft Draft, provider ProviderDraft) Draft

type ExternalAgentConfig added in v0.1.6

type ExternalAgentConfig struct {
	Enabled bool   `json:"enabled,omitempty"`
	Path    string `json:"path,omitempty"`
}

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

func NewFileStore

func NewFileStore(path string) *FileStore

func (*FileStore) ClearDraft

func (s *FileStore) ClearDraft() error

func (*FileStore) Load

func (s *FileStore) Load() (Config, error)

func (*FileStore) LoadDraft

func (s *FileStore) LoadDraft() (Draft, error)

func (*FileStore) Path

func (s *FileStore) Path() string

func (*FileStore) Save

func (s *FileStore) Save(cfg Config) error

func (*FileStore) SaveDraft

func (s *FileStore) SaveDraft(draft Draft) error

type MCPConfig added in v0.1.11

type MCPConfig struct {
	Enabled bool              `json:"enabled,omitempty"`
	Servers []MCPServerConfig `json:"servers,omitempty"`
}

type MCPConfigResponse added in v0.1.11

type MCPConfigResponse struct {
	Config  MCPConfig `json:"config"`
	Enabled bool      `json:"enabled"`
	Status  string    `json:"status"`
}

type MCPConfigUpdate added in v0.1.11

type MCPConfigUpdate struct {
	Enabled *bool `json:"enabled,omitempty"`
}

type MCPServerConfig added in v0.1.11

type MCPServerConfig struct {
	ID              string            `json:"id"`
	Name            string            `json:"name,omitempty"`
	Enabled         bool              `json:"enabled,omitempty"`
	Transport       string            `json:"transport,omitempty"`
	Command         string            `json:"command,omitempty"`
	Args            []string          `json:"args,omitempty"`
	Env             map[string]string `json:"env,omitempty"`
	Endpoint        string            `json:"endpoint,omitempty"`
	ToolPrefix      string            `json:"tool_prefix,omitempty"`
	ReadOnly        bool              `json:"read_only,omitempty"`
	RequireApproval bool              `json:"require_approval,omitempty"`
	TimeoutSeconds  int               `json:"timeout_seconds,omitempty"`
}

type MCPServerUpdate added in v0.1.11

type MCPServerUpdate struct {
	Name            *string  `json:"name,omitempty"`
	Enabled         *bool    `json:"enabled,omitempty"`
	Transport       *string  `json:"transport,omitempty"`
	Command         *string  `json:"command,omitempty"`
	Args            []string `json:"args,omitempty"`
	Endpoint        *string  `json:"endpoint,omitempty"`
	ToolPrefix      *string  `json:"tool_prefix,omitempty"`
	ReadOnly        *bool    `json:"read_only,omitempty"`
	RequireApproval *bool    `json:"require_approval,omitempty"`
	TimeoutSeconds  *int     `json:"timeout_seconds,omitempty"`
}

type ModulesConfig added in v0.1.6

type ModulesConfig struct {
	ExternalAgents map[string]ExternalAgentConfig `json:"external_agents,omitempty"`
	TextToSpeech   VoiceModuleConfig              `json:"tts,omitempty"`
	SpeechToText   VoiceModuleConfig              `json:"stt,omitempty"`
	WebSearch      WebSearchConfig                `json:"web_search,omitempty"`
	MCP            MCPConfig                      `json:"mcp,omitempty"`
	Skills         SkillsConfig                   `json:"skills,omitempty"`
}

type ProviderConfig

type ProviderConfig struct {
	ID              string                `json:"id"`
	CatalogID       string                `json:"catalog_id,omitempty"`
	Name            string                `json:"name"`
	Type            string                `json:"type"`
	APIKey          string                `json:"api_key"`
	APIKeyEnv       string                `json:"api_key_env,omitempty"`
	BaseURL         string                `json:"base_url,omitempty"`
	Model           string                `json:"model"`
	ContextWindow   int                   `json:"context_window,omitempty"`
	MaxOutputTokens int64                 `json:"max_output_tokens,omitempty"`
	ReasoningEffort string                `json:"reasoning_effort,omitempty"`
	ToolUseMode     providers.ToolUseMode `json:"tool_use_mode,omitempty"`
}

func ActiveProviderConfig

func ActiveProviderConfig(cfg Config) (ProviderConfig, bool)

func ProviderConfigWithResolvedAPIKey

func ProviderConfigWithResolvedAPIKey(provider ProviderConfig) (ProviderConfig, bool)

type ProviderDraft

type ProviderDraft struct {
	ID                  string
	CatalogID           string
	Name                string
	Type                string
	APIKey              string
	APIKeyEnv           string
	BaseURL             string
	Model               string
	ToolUseMode         providers.ToolUseMode
	ContextWindow       string
	MaxOutputTokens     string
	ReasoningEffort     string
	HasStoredAPIKey     bool
	StoredAPIKeyPreview string
}

func ConfiguredProviders

func ConfiguredProviders(draft Draft) []ProviderDraft

func FindProviderDraft

func FindProviderDraft(draft Draft, providerID string) (ProviderDraft, bool)

type ProviderFormChoice added in v0.1.9

type ProviderFormChoice struct {
	ID       string
	Title    string
	Status   string
	Value    string
	Selected bool
}

type ProviderFormField added in v0.1.1

type ProviderFormField struct {
	ID        ProviderFormFieldID
	Label     string
	Value     string
	Status    string
	Options   []string
	Choices   []ProviderFormChoice
	Required  bool
	Sensitive bool
	Editable  bool
	Picker    bool
	Disabled  bool
}

type ProviderFormFieldID added in v0.1.1

type ProviderFormFieldID string
const (
	ProviderFormFieldName            ProviderFormFieldID = "name"
	ProviderFormFieldBaseURL         ProviderFormFieldID = "base_url"
	ProviderFormFieldAPIKey          ProviderFormFieldID = "api_key"
	ProviderFormFieldModel           ProviderFormFieldID = "model"
	ProviderFormFieldReasoningEffort ProviderFormFieldID = "reasoning_effort"
	ProviderFormFieldToolUse         ProviderFormFieldID = "tool_use"
)

func ProviderFormFieldIDFromCommand added in v0.1.9

func ProviderFormFieldIDFromCommand(value string) (ProviderFormFieldID, bool)

type ProviderFormSpec added in v0.1.1

type ProviderFormSpec struct {
	ID           string
	CatalogID    string
	Type         string
	Custom       bool
	Capabilities providers.Capabilities
	Fields       []ProviderFormField
}

func ProviderFormSpecForDraft added in v0.1.1

func ProviderFormSpecForDraft(provider ProviderDraft) ProviderFormSpec

func ProviderFormSpecForSetupItem added in v0.1.1

func ProviderFormSpecForSetupItem(item ProviderSetupItem) ProviderFormSpec

func ProviderFormSpecFromInput added in v0.1.1

func ProviderFormSpecFromInput(input ProviderFormSpecInput) ProviderFormSpec

func (ProviderFormSpec) Field added in v0.1.1

type ProviderFormSpecInput added in v0.1.1

type ProviderFormSpecInput struct {
	ID                  string
	CatalogID           string
	Name                string
	Type                string
	APIKey              string
	BaseURL             string
	BaseURLOptions      []providers.BaseURLOption
	Model               string
	ReasoningEffort     string
	ToolUseMode         providers.ToolUseMode
	HasStoredAPIKey     bool
	StoredAPIKeyPreview string

	Custom            bool
	CustomKnown       bool
	Capabilities      providers.Capabilities
	CapabilitiesKnown bool
}

type ProviderFormState added in v0.1.9

type ProviderFormState struct {
	Name            string
	BaseURL         string
	Model           string
	APIKey          string
	ReasoningEffort string
	ToolUseMode     providers.ToolUseMode
}

func (ProviderFormState) Field added in v0.1.9

func (state ProviderFormState) Field(commandID string) string

func (ProviderFormState) ToSetupUpdate added in v0.1.9

func (state ProviderFormState) ToSetupUpdate(providerType string, active bool) ProviderSetupUpdate

func (ProviderFormState) ValidationMessage added in v0.1.9

func (state ProviderFormState) ValidationMessage(requireAPIKey bool) string

func (ProviderFormState) WithDefaultProviderOptions added in v0.1.9

func (state ProviderFormState) WithDefaultProviderOptions(capabilities providers.Capabilities) ProviderFormState

func (ProviderFormState) WithDefaultToolProfile added in v0.1.9

func (state ProviderFormState) WithDefaultToolProfile(providerType string) ProviderFormState

func (ProviderFormState) WithField added in v0.1.9

func (state ProviderFormState) WithField(commandID string, value string) ProviderFormState

type ProviderFormViewField added in v0.1.9

type ProviderFormViewField struct {
	ID              ProviderFormFieldID
	CommandID       string
	Label           string
	Status          string
	RequiredMessage string
	Sensitive       bool
	Picker          bool
	Accent          bool
	Disabled        bool
}

func ProviderFormViewFields added in v0.1.9

func ProviderFormViewFields(spec ProviderFormSpec, options ProviderFormViewOptions) []ProviderFormViewField

type ProviderFormViewOptions added in v0.1.9

type ProviderFormViewOptions struct {
	APIKeyStatus       string
	ShowRequiredStatus bool
}

type ProviderModelPickerState added in v0.1.11

type ProviderModelPickerState struct {
	Picker        bool
	Disabled      bool
	Status        string
	ManualInput   bool
	RequiresKey   bool
	PublicCatalog bool
}

func ProviderModelPickerStateForInput added in v0.1.11

func ProviderModelPickerStateForInput(input ProviderFormSpecInput, custom bool, capabilities providers.Capabilities, policy providers.ProviderPolicy) ProviderModelPickerState

type ProviderModelsResponse added in v0.1.1

type ProviderModelsResponse struct {
	Models         []string                  `json:"models"`
	Metadata       []providers.ModelMetadata `json:"metadata,omitempty"`
	Status         string                    `json:"status,omitempty"`
	Source         string                    `json:"source,omitempty"`
	Message        string                    `json:"message,omitempty"`
	RequiresAPIKey bool                      `json:"requires_api_key,omitempty"`
	ManualInput    bool                      `json:"manual_input,omitempty"`
}

type ProviderOption

type ProviderOption struct {
	ID              string
	Name            string
	Type            string
	Implemented     bool
	RequiresBaseURL bool
	Capabilities    providers.Capabilities
	DefaultBaseURL  string
	BaseURLOptions  []providers.BaseURLOption
	DefaultModel    string
	APIKeyEnv       string
	Notes           string
}

type ProviderSetupItem

type ProviderSetupItem struct {
	ID              string                    `json:"id"`
	CatalogID       string                    `json:"catalog_id,omitempty"`
	Name            string                    `json:"name"`
	Type            string                    `json:"type"`
	Status          string                    `json:"status"`
	Configured      bool                      `json:"configured"`
	Active          bool                      `json:"active"`
	Implemented     bool                      `json:"implemented"`
	RequiresBaseURL bool                      `json:"requires_base_url,omitempty"`
	Capabilities    providers.Capabilities    `json:"capabilities,omitempty"`
	BaseURL         string                    `json:"base_url,omitempty"`
	BaseURLOptions  []providers.BaseURLOption `json:"base_url_options,omitempty"`
	Model           string                    `json:"model,omitempty"`
	ContextWindow   int                       `json:"context_window,omitempty"`
	ReasoningEffort string                    `json:"reasoning_effort,omitempty"`
	ToolUseMode     providers.ToolUseMode     `json:"tool_use_mode,omitempty"`
	DefaultModel    string                    `json:"default_model,omitempty"`
	APIKeyPreview   string                    `json:"api_key_preview,omitempty"`
	Notes           string                    `json:"notes,omitempty"`
}

func ProviderSetupItemsFromConfig

func ProviderSetupItemsFromConfig(cfg Config, options []ProviderOption) []ProviderSetupItem

func ProviderSetupItemsFromDraft

func ProviderSetupItemsFromDraft(draft Draft, options []ProviderOption) []ProviderSetupItem

type ProviderSetupListResponse

type ProviderSetupListResponse struct {
	Providers []ProviderSetupItem `json:"providers"`
}

type ProviderSetupOKResponse

type ProviderSetupOKResponse struct {
	OK bool `json:"ok"`
}

type ProviderSetupResponse

type ProviderSetupResponse struct {
	Provider ProviderSetupItem `json:"provider"`
}

type ProviderSetupUpdate

type ProviderSetupUpdate struct {
	Name            string                `json:"name,omitempty"`
	Type            string                `json:"type,omitempty"`
	APIKey          string                `json:"api_key,omitempty"`
	BaseURL         string                `json:"base_url,omitempty"`
	Model           string                `json:"model,omitempty"`
	ContextWindow   int                   `json:"context_window,omitempty"`
	ReasoningEffort string                `json:"reasoning_effort,omitempty"`
	ToolUseMode     providers.ToolUseMode `json:"tool_use_mode,omitempty"`
	Active          bool                  `json:"active,omitempty"`
}

type ProviderSummary

type ProviderSummary struct {
	ID            string
	Name          string
	Model         string
	Status        string
	APIKeyPreview string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewDefaultService

func NewDefaultService() (*Service, error)

func NewService

func NewService(store Store) *Service

func (*Service) AllowProviderSetupForClient

func (s *Service) AllowProviderSetupForClient(client string) (bool, error)

func (*Service) Apply

func (s *Service) Apply(draft Draft) (ApplyResult, error)

func (*Service) ApplyContext

func (s *Service) ApplyContext(ctx context.Context, draft Draft) (ApplyResult, error)

func (*Service) BuiltInProviderDraft

func (s *Service) BuiltInProviderDraft(draft Draft, providerID string) (ProviderDraft, error)

func (*Service) ConfigureProviderContext

func (s *Service) ConfigureProviderContext(ctx context.Context, providerID string, update ProviderSetupUpdate) (ProviderSetupItem, error)

func (*Service) DeleteProviderContext

func (s *Service) DeleteProviderContext(ctx context.Context, providerID string) error

func (*Service) Draft

func (s *Service) Draft() (Draft, error)

func (*Service) EnsureDaemonAPIToken

func (s *Service) EnsureDaemonAPIToken() (Config, error)

func (*Service) EnsureDaemonContext

func (s *Service) EnsureDaemonContext(ctx context.Context) (DaemonSummary, error)

func (*Service) ExternalAgentConfig added in v0.1.6

func (s *Service) ExternalAgentConfig(id string) ExternalAgentConfig

func (*Service) GetMCPConfig added in v0.1.11

func (s *Service) GetMCPConfig() (MCPConfig, error)

func (*Service) GetWebSearchConfig added in v0.1.11

func (s *Service) GetWebSearchConfig() (WebSearchConfig, error)

func (*Service) IsConfigured

func (s *Service) IsConfigured() (bool, error)

func (*Service) Load

func (s *Service) Load() (Config, error)

func (*Service) NewCustomProviderDraft

func (s *Service) NewCustomProviderDraft(draft Draft, providerType string) (ProviderDraft, error)

func (*Service) Path

func (s *Service) Path() string

func (*Service) ProviderModelCatalog added in v0.1.11

func (s *Service) ProviderModelCatalog(ctx context.Context, provider ProviderDraft) (ProviderModelsResponse, error)

func (*Service) ProviderModelCatalogContext added in v0.1.11

func (s *Service) ProviderModelCatalogContext(ctx context.Context, providerID string, update ProviderSetupUpdate) (ProviderModelsResponse, error)

func (*Service) ProviderModels

func (s *Service) ProviderModels(ctx context.Context, provider ProviderDraft) ([]string, error)

func (*Service) ProviderOptions

func (s *Service) ProviderOptions() []ProviderOption

func (*Service) ProviderSetupItems

func (s *Service) ProviderSetupItems() ([]ProviderSetupItem, error)

func (*Service) RestartDaemonContext

func (s *Service) RestartDaemonContext(ctx context.Context) (DaemonSummary, error)

func (*Service) SaveDraft

func (s *Service) SaveDraft(draft Draft) error

func (*Service) SaveRuntimeConfigContext

func (s *Service) SaveRuntimeConfigContext(ctx context.Context, draft Draft) (ApplyResult, error)

func (*Service) StopDaemonContext added in v0.1.10

func (s *Service) StopDaemonContext(ctx context.Context) (DaemonSummary, error)

func (*Service) Summary

func (s *Service) Summary() (Summary, error)

func (*Service) SummaryContext

func (s *Service) SummaryContext(ctx context.Context) (Summary, error)

func (*Service) UpdateExternalAgent added in v0.1.6

func (s *Service) UpdateExternalAgent(id string, update ExternalAgentConfig) (Config, error)

func (*Service) UpdateMCPConfig added in v0.1.11

func (s *Service) UpdateMCPConfig(update MCPConfigUpdate) (MCPConfig, error)

func (*Service) UpdateMCPServer added in v0.1.11

func (s *Service) UpdateMCPServer(serverID string, update MCPServerUpdate) (MCPConfig, error)

func (*Service) UpdateVoiceModule added in v0.1.9

func (s *Service) UpdateVoiceModule(id string, update VoiceModuleUpdate) ([]VoiceModuleDescriptor, error)

func (*Service) UpdateWebSearchConfig added in v0.1.11

func (s *Service) UpdateWebSearchConfig(update WebSearchConfig) (WebSearchConfig, error)

func (*Service) VoiceModules added in v0.1.9

func (s *Service) VoiceModules() ([]VoiceModuleDescriptor, error)

type SkillsConfig added in v0.1.11

type SkillsConfig struct {
	Enabled     bool   `json:"enabled,omitempty"`
	AutoInvoke  bool   `json:"auto_invoke,omitempty"`
	TrustPolicy string `json:"trust_policy,omitempty"`
	SelfImprove string `json:"self_improve,omitempty"`
}

type Store

type Store interface {
	Load() (Config, error)
	Save(cfg Config) error
	LoadDraft() (Draft, error)
	SaveDraft(draft Draft) error
	ClearDraft() error
	Path() string
}

type Summary

type Summary struct {
	Assistant AssistantSummary
	Provider  ProviderSummary
	Daemon    DaemonSummary
	Telegram  TelegramSummary
}

func SummaryFromConfig

func SummaryFromConfig(cfg Config) Summary

func SummaryFromDraft

func SummaryFromDraft(d Draft) Summary

type TelegramConfig

type TelegramConfig struct {
	Enabled            bool   `json:"enabled"`
	BotToken           string `json:"bot_token,omitempty"`
	AllowedUserID      string `json:"allowed_user_id,omitempty"`
	AllowProviderSetup bool   `json:"allow_provider_setup,omitempty"`
}

type TelegramSummary

type TelegramSummary struct {
	Status   string
	Username string
	Warning  string
}

type TerminalConfig

type TerminalConfig struct {
	Enabled bool `json:"enabled"`
}

type TimezoneOption

type TimezoneOption struct {
	ID     string
	Name   string
	Offset string
	Label  string
}

func TimezoneOptions

func TimezoneOptions(now time.Time) []TimezoneOption

type VoiceModelOption added in v0.1.9

type VoiceModelOption struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Size         string `json:"size,omitempty"`
	RAM          string `json:"ram,omitempty"`
	Description  string `json:"description,omitempty"`
	Default      bool   `json:"default,omitempty"`
	LanguageCode string `json:"language_code,omitempty"`
	LanguageName string `json:"language_name,omitempty"`
	Quality      string `json:"quality,omitempty"`
	Installed    bool   `json:"installed,omitempty"`
	Path         string `json:"path,omitempty"`
}

type VoiceModuleConfig added in v0.1.9

type VoiceModuleConfig struct {
	Enabled    bool                           `json:"enabled,omitempty"`
	ProviderID string                         `json:"provider_id,omitempty"`
	Providers  map[string]VoiceProviderConfig `json:"providers,omitempty"`
}

type VoiceModuleDescriptor added in v0.1.9

type VoiceModuleDescriptor struct {
	ID           string                `json:"id"`
	Title        string                `json:"title"`
	Enabled      bool                  `json:"enabled"`
	ProviderID   string                `json:"provider_id"`
	ProviderName string                `json:"provider_name"`
	Local        bool                  `json:"local"`
	Status       string                `json:"status"`
	Config       VoiceProviderConfig   `json:"config,omitempty"`
	Providers    []VoiceProviderOption `json:"providers,omitempty"`
}

func VoiceModuleDescriptors added in v0.1.9

func VoiceModuleDescriptors(modules ModulesConfig) []VoiceModuleDescriptor

type VoiceModuleUpdate added in v0.1.9

type VoiceModuleUpdate struct {
	Enabled        *bool                `json:"enabled,omitempty"`
	ProviderID     string               `json:"provider_id,omitempty"`
	ProviderConfig *VoiceProviderConfig `json:"provider_config,omitempty"`
}

type VoiceModulesResponse added in v0.1.9

type VoiceModulesResponse struct {
	Modules []VoiceModuleDescriptor `json:"modules"`
}

type VoiceProviderActionRequest added in v0.1.9

type VoiceProviderActionRequest struct {
	Action  string `json:"action"`
	ModelID string `json:"model_id,omitempty"`
}

type VoiceProviderActionResponse added in v0.1.9

type VoiceProviderActionResponse struct {
	Provider VoiceProviderOption `json:"provider"`
}

type VoiceProviderConfig added in v0.1.9

type VoiceProviderConfig struct {
	ModelID     string `json:"model_id,omitempty"`
	VoiceID     string `json:"voice_id,omitempty"`
	Language    string `json:"language,omitempty"`
	Autostart   bool   `json:"autostart,omitempty"`
	RuntimeMode string `json:"runtime_mode,omitempty"`
	BinaryPath  string `json:"binary_path,omitempty"`
	Endpoint    string `json:"endpoint,omitempty"`
	Threads     int    `json:"threads,omitempty"`
}

type VoiceProviderOption added in v0.1.9

type VoiceProviderOption struct {
	ID               string              `json:"id"`
	Name             string              `json:"name"`
	Local            bool                `json:"local"`
	Status           string              `json:"status,omitempty"`
	CatalogStatus    string              `json:"catalog_status,omitempty"`
	CatalogDetail    string              `json:"catalog_detail,omitempty"`
	Endpoint         string              `json:"endpoint,omitempty"`
	Downloaded       bool                `json:"downloaded,omitempty"`
	ModelPath        string              `json:"model_path,omitempty"`
	RuntimeState     string              `json:"runtime_state,omitempty"`
	RuntimeDetail    string              `json:"runtime_detail,omitempty"`
	RuntimePath      string              `json:"runtime_path,omitempty"`
	RuntimeInstalled bool                `json:"runtime_installed,omitempty"`
	RuntimeRSS       uint64              `json:"runtime_rss_bytes,omitempty"`
	Config           VoiceProviderConfig `json:"config,omitempty"`
	Models           []VoiceModelOption  `json:"models,omitempty"`
}

type WebSearchConfig added in v0.1.11

type WebSearchConfig struct {
	Provider  string `json:"provider,omitempty"`
	APIKey    string `json:"api_key,omitempty"` // legacy field, migrated on read
	TavilyKey string `json:"tavily_key,omitempty"`
	SerperKey string `json:"serper_key,omitempty"`
	BaseURL   string `json:"base_url,omitempty"`
}

WebSearchConfig stores the web search provider choice and credentials.

type WebSearchConfigResponse added in v0.1.11

type WebSearchConfigResponse struct {
	Config   WebSearchConfig `json:"config"`
	Provider string          `json:"provider"`
	Status   string          `json:"status"`
}

Jump to

Keyboard shortcuts

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