setup

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 36 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 (
	BrowserModuleBrowser      = "browser"
	BrowserProviderPlaywright = "playwright"
)
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 = 4
View Source
const DaemonUnitName = "matrixclawd.service"
View Source
const DefaultAssistantName = "matrixclaw"

DefaultAssistantName is the assistant's name unless the user picks another.

View Source
const TelephonyModuleID = "telephony"

Variables

View Source
var ErrConfigNotFound = errors.New("setup config not found")
View Source
var ErrUnsupportedConfigVersion = errors.New("unsupported setup config version")
View Source
var SupertonicLanguages = []Language{
	{"auto", "Auto"}, {"na", "Fallback"}, {"ar", "Arabic"}, {"bg", "Bulgarian"}, {"cs", "Czech"},
	{"da", "Danish"}, {"de", "German"}, {"el", "Greek"}, {"en", "English"}, {"es", "Spanish"},
	{"et", "Estonian"}, {"fi", "Finnish"}, {"fr", "French"}, {"hi", "Hindi"}, {"hr", "Croatian"},
	{"hu", "Hungarian"}, {"id", "Indonesian"}, {"it", "Italian"}, {"ja", "Japanese"}, {"ko", "Korean"},
	{"lt", "Lithuanian"}, {"lv", "Latvian"}, {"nl", "Dutch"}, {"pl", "Polish"}, {"pt", "Portuguese"},
	{"ro", "Romanian"}, {"ru", "Russian"}, {"sk", "Slovak"}, {"sl", "Slovenian"}, {"sv", "Swedish"},
	{"tr", "Turkish"}, {"uk", "Ukrainian"}, {"vi", "Vietnamese"},
}

SupertonicLanguages are the languages Supertonic speaks.

View Source
var WhisperLanguages = []Language{}/* 101 elements not displayed */

WhisperLanguages are the languages whisper.cpp transcribes.

Functions

func CheckProvider added in v0.2.0

func CheckProvider(p ProviderConfig) error

CheckProvider reports whether p can be saved and used: a valid entry with its API key available.

func ChildEnvironment added in v0.2.1

func ChildEnvironment(cfg Config, environ []string) []string

ChildEnvironment is environ without what the commands and servers the daemon starts for the agent must not see: API key variables (of configured, voice and catalog providers, daemon.env, any *_API_KEY) and every MATRIXCLAW_* one.

func CredentialPaths added in v0.2.1

func CredentialPaths() []string

CredentialPaths are the files holding provider keys and tokens: setup.json and daemon.env, both where this process keeps them and at the default location.

func DaemonEnvironmentFilePath

func DaemonEnvironmentFilePath(setupPath string) string

func DefaultConfigPath

func DefaultConfigPath() (string, error)

func DefaultDBPath

func DefaultDBPath() string

func DirectLogPath added in v0.2.1

func DirectLogPath() string

DirectLogPath is the file a directly launched daemon, one that no service manager runs, writes its log to.

func ExpandHome added in v0.2.1

func ExpandHome(path string) string

ExpandHome replaces a leading "~" or "~/" with the home directory; any other path, or one when the home is unknown, is returned as given.

func ImportDaemonEnvironmentFile

func ImportDaemonEnvironmentFile(setupPath string, cfg Config) error

func MCPConfigStatus added in v0.1.11

func MCPConfigStatus(cfg MCPConfig) string

func MaskSecret

func MaskSecret(value string) string

func NormalizeMCPTransport added in v0.2.0

func NormalizeMCPTransport(value string) string

NormalizeMCPTransport is "http" for the streamable HTTP transport and "stdio" for anything else.

func NormalizeSupertonicLanguage added in v0.2.0

func NormalizeSupertonicLanguage(language string) string

NormalizeSupertonicLanguage is a Supertonic language code; "auto" detects.

func NormalizeVoiceLanguage added in v0.2.0

func NormalizeVoiceLanguage(language string) string

NormalizeVoiceLanguage is a Piper language code such as en_US; "" is any.

func ReadDirectLog added in v0.2.1

func ReadDirectLog(lines int) (string, error)

ReadDirectLog returns the last lines of DirectLogPath.

func VoiceProviderIDs added in v0.2.0

func VoiceProviderIDs(moduleID string) []string

VoiceProviderIDs are the local providers of the TTS or STT module, the default first.

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

func (AssistantConfig) NameOrDefault added in v0.2.0

func (a AssistantConfig) NameOrDefault() string

NameOrDefault is the user's assistant name, or the built-in one.

type AssistantSummary

type AssistantSummary struct {
	Name   string
	Status string
}

type BrowserConfig added in v0.1.15

type BrowserConfig struct {
	Enabled        bool                  `json:"enabled,omitempty"`
	ProviderID     string                `json:"provider_id,omitempty"`
	ProviderConfig BrowserProviderConfig `json:"provider_config,omitempty"`
}

type BrowserModuleDescriptor added in v0.1.15

type BrowserModuleDescriptor 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       BrowserProviderConfig   `json:"config,omitempty"`
	Providers    []BrowserProviderOption `json:"providers,omitempty"`
}

func BrowserModuleFromConfig added in v0.1.15

func BrowserModuleFromConfig(modules ModulesConfig) BrowserModuleDescriptor

type BrowserProviderActionIDs added in v0.1.15

type BrowserProviderActionIDs struct {
	InstallRuntime string `json:"install_runtime,omitempty"`
	DeleteRuntime  string `json:"delete_runtime,omitempty"`
	Start          string `json:"start,omitempty"`
	Stop           string `json:"stop,omitempty"`
	Test           string `json:"test,omitempty"`
}

type BrowserProviderActionRequest added in v0.1.15

type BrowserProviderActionRequest struct {
	Action string `json:"action"`
}

type BrowserProviderConfig added in v0.1.15

type BrowserProviderConfig struct {
	RuntimeMode string `json:"runtime_mode,omitempty"`
	BinaryPath  string `json:"binary_path,omitempty"`
	BrowserPath string `json:"browser_path,omitempty"`
}

type BrowserProviderOption added in v0.1.15

type BrowserProviderOption struct {
	ID               string                   `json:"id"`
	Name             string                   `json:"name"`
	Local            bool                     `json:"local,omitempty"`
	Status           string                   `json:"status"`
	RuntimeState     string                   `json:"runtime_state,omitempty"`
	RuntimeDetail    string                   `json:"runtime_detail,omitempty"`
	RuntimePath      string                   `json:"runtime_path,omitempty"`
	RuntimeInstalled bool                     `json:"runtime_installed,omitempty"`
	BrowserInstalled bool                     `json:"browser_installed,omitempty"`
	BrowserPath      string                   `json:"browser_path,omitempty"`
	BrowserCachePath string                   `json:"browser_cache_path,omitempty"`
	RuntimeRSS       uint64                   `json:"runtime_rss_bytes,omitempty"`
	ActionIDs        BrowserProviderActionIDs `json:"action_ids,omitempty"`
	Config           BrowserProviderConfig    `json:"config,omitempty"`
}

type CheckpointsConfig added in v0.2.1

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

CheckpointsConfig controls file checkpoints (docs/CHECKPOINTS.md); they are on unless Enabled is false.

func (CheckpointsConfig) On added in v0.2.1

func (c CheckpointsConfig) On() bool

On reports whether file checkpoints are taken.

type ClientsConfig

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

type CompactModelConfig added in v0.2.0

type CompactModelConfig struct {
	Provider string `json:"provider,omitempty"`
	Model    string `json:"model,omitempty"`
}

CompactModelConfig names the provider and model that write context summaries instead of each run's own model; empty keeps the run's model.

type Config

type Config struct {
	Version          int              `json:"version"`
	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"`
	// Hooks are commands run at the agent's seams (docs/HOOKS.md).
	Hooks []hooks.Hook `json:"hooks,omitempty"`
	// Diagnostics overrides or turns off the checks after file edits.
	Diagnostics hooks.Diagnostics `json:"diagnostics,omitzero"`
}

func NewConfig added in v0.2.0

func NewConfig() Config

NewConfig is a first-run config with this machine's defaults.

func (Config) ActiveProvider added in v0.2.0

func (cfg Config) ActiveProvider() (ProviderConfig, bool)

ActiveProvider returns the stored active provider.

func (Config) ExternalAgentConfig added in v0.1.6

func (cfg Config) ExternalAgentConfig(id string) ExternalAgentConfig

func (Config) Provider added in v0.2.0

func (cfg Config) Provider(id string) (ProviderConfig, bool)

Provider returns the stored provider with id.

func (*Config) SetProvider added in v0.2.0

func (cfg *Config) SetProvider(p ProviderConfig)

SetProvider adds p or replaces the stored provider with its id.

func (Config) Validate added in v0.2.0

func (cfg Config) Validate() error

Validate checks the config's structure; it reads no environment and makes no network calls.

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"`
	Budgets         RunBudgetsConfig   `json:"budgets,omitzero"`
	CompactModel    CompactModelConfig `json:"compact_model,omitzero"`
	// ContextWindowCap bounds every model's context window in tokens; 0 keeps
	// the default of 200000. Set it to the model's window to disable the cap.
	ContextWindowCap int `json:"context_window_cap,omitempty"`
	// ModelConcurrency bounds the model requests all runs make at once; 0
	// keeps the default of 4.
	ModelConcurrency int `json:"model_concurrency,omitempty"`
	// BackgroundTasks bounds the background commands one session runs at
	// once; 0 keeps the default of 8.
	BackgroundTasks int `json:"background_tasks,omitempty"`
	// BackgroundAgents bounds the background subagents one session runs at
	// once; 0 keeps the default of 4.
	BackgroundAgents int `json:"background_agents,omitempty"`
	// Checkpoints controls the file checkpoints taken before tool batches.
	Checkpoints CheckpointsConfig `json:"checkpoints,omitzero"`
	// Sandbox confines the agent's shell commands (docs/SANDBOX.md).
	Sandbox sandbox.Settings `json:"sandbox,omitzero"`
}

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 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) Load

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

func (*FileStore) Path

func (s *FileStore) Path() string

func (*FileStore) Save

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

func (*FileStore) Upgrade added in v0.2.1

func (s *FileStore) Upgrade() error

Upgrade saves a version 3 file as version 4, keeping the original as <path>.pre-v4 (an existing copy is kept). Only the daemon calls it: other readers convert in memory, so a new client leaves an older running daemon's file alone.

type Language added in v0.2.0

type Language struct{ Code, Name string }

Language is a language a voice engine speaks or understands.

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"`
	TimeoutSeconds int               `json:"timeout_seconds,omitempty"`
}

type MCPServerCreateRequest added in v0.1.15

type MCPServerCreateRequest struct {
	Server MCPServerConfig `json:"server"`
}

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"`
	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"`
	RealtimeVoice  VoiceModuleConfig              `json:"realtime_voice,omitempty"`
	Telephony      TelephonyConfig                `json:"telephony,omitempty"`
	Browser        BrowserConfig                  `json:"browser,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"`
	Name            string                `json:"name,omitempty"`
	Type            string                `json:"type,omitempty"`
	APIKey          string                `json:"api_key,omitempty"`
	APIKeyEnv       string                `json:"api_key_env,omitempty"`
	BaseURL         string                `json:"base_url,omitempty"`
	Model           string                `json:"model,omitempty"`
	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"`
}

ProviderConfig is a configured provider as stored: for a built-in provider the fields the catalog defines are left empty (see Effective).

func NewProviderConfig added in v0.2.0

func NewProviderConfig(providerID string, providerType string, name string) (ProviderConfig, error)

NewProviderConfig starts a provider that is not saved yet: a built-in one by catalog id, otherwise a custom one of providerType.

func (ProviderConfig) APIKeyPreview added in v0.2.0

func (p ProviderConfig) APIKeyPreview() string

APIKeyPreview shows where the provider's key comes from without the key.

func (ProviderConfig) Effective added in v0.2.0

func (p ProviderConfig) Effective() ProviderConfig

Effective fills the catalog defaults the stored config leaves out: name, type, key env name, base URL, model, and the model's reasoning effort.

func (ProviderConfig) Runtime added in v0.2.0

func (p ProviderConfig) Runtime() (ProviderConfig, bool)

Runtime is the effective provider with its API key taken from the file or the environment; ok is false when a required key is missing. A server on a loopback address needs no key.

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

func ProviderModelCatalog added in v0.2.0

func ProviderModelCatalog(ctx context.Context, provider ProviderConfig) ProviderModelsResponse

ProviderModelCatalog asks the provider for its models with its stored or environment API key.

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 ProviderItems added in v0.2.0

func ProviderItems(cfg Config) []ProviderSetupItem

ProviderItems lists the configured providers, the active one first, then the built-in providers that are not configured yet.

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

ProviderSetupUpdate changes the fields that are present; an empty value resets a field to its built-in default (or clears the key).

type ProviderSummary

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

type RunBudgetConfig added in v0.2.0

type RunBudgetConfig struct {
	Steps      int    `json:"steps,omitempty"`
	ActiveTime string `json:"active_time,omitempty"`
	Tokens     int64  `json:"tokens,omitempty"`
}

RunBudgetConfig: zero fields keep the default; ActiveTime is a Go duration such as "4h". Tokens 0 means unlimited.

type RunBudgetsConfig added in v0.2.0

type RunBudgetsConfig struct {
	User       RunBudgetConfig `json:"user,omitzero"`
	Subagent   RunBudgetConfig `json:"subagent,omitzero"`
	Automation RunBudgetConfig `json:"automation,omitzero"`
}

RunBudgetsConfig overrides the built-in run budget per trigger.

type Service

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

func NewDefaultService

func NewDefaultService() (*Service, error)

func NewService

func NewService(store *FileStore) *Service

func (*Service) AllowProviderSetupForClient

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

func (*Service) Apply

func (s *Service) Apply(ctx context.Context, edited Config) (ApplyResult, error)

Apply saves the sections the setup wizard edits (assistant, providers, daemon address, paths, timezone and autostart, clients) over the current file, after checking the Telegram token, and installs and starts the daemon.

func (*Service) ConfigureProvider added in v0.2.0

func (s *Service) ConfigureProvider(providerID string, update ProviderSetupUpdate) (ProviderSetupItem, error)

ConfigureProvider applies update to the provider, adding it when it is not configured yet; update.Active, or no active provider yet, makes it active.

func (*Service) CreateMCPServer added in v0.1.15

func (s *Service) CreateMCPServer(server MCPServerConfig) (MCPConfig, error)

func (*Service) DeleteMCPServer added in v0.1.15

func (s *Service) DeleteMCPServer(serverID string) (MCPConfig, error)

func (*Service) DeleteProvider added in v0.2.0

func (s *Service) DeleteProvider(providerID string) error

DeleteProvider removes a custom provider; built-in ones stay.

func (*Service) EditableConfig added in v0.2.0

func (s *Service) EditableConfig() (cfg Config, existing bool, err error)

EditableConfig is the saved config, or a new one with local defaults when none is saved yet; existing reports which.

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) IsConfigured

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

func (*Service) Load

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

func (*Service) Path

func (s *Service) Path() string

func (*Service) ProviderItems added in v0.2.0

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

func (*Service) ProviderModelCatalogFor added in v0.2.0

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

ProviderModelCatalogFor lists the models of a provider as update would leave it, without saving anything.

func (*Service) RestartDaemonContext

func (s *Service) RestartDaemonContext(ctx context.Context) (DaemonSummary, 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) Update added in v0.2.0

func (s *Service) Update(change func(*Config) error) (Config, error)

Update applies change to the saved config, validates the result and saves it under the service lock, so concurrent edits don't overwrite each other.

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) Upgrade added in v0.2.1

func (s *Service) Upgrade() error

Upgrade saves a version 3 setup.json as version 4; see FileStore.Upgrade.

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"`
	Review      SkillsReviewConfig `json:"review,omitzero"`
}

SkillsConfig leaves Enabled and AutoInvoke unset unless the user turned them off; unset means on.

func (SkillsConfig) IsAutoInvoke added in v0.2.0

func (c SkillsConfig) IsAutoInvoke() bool

func (SkillsConfig) IsEnabled added in v0.2.0

func (c SkillsConfig) IsEnabled() bool

func (SkillsConfig) IsReviewEnabled added in v0.2.1

func (c SkillsConfig) IsReviewEnabled() bool

IsReviewEnabled reports whether finished sessions are reviewed: only while the skills module is on, and unless the review is turned off.

type SkillsReviewConfig added in v0.2.1

type SkillsReviewConfig struct {
	Enabled *bool `json:"enabled,omitempty"`
	// MinToolSteps is how many model steps that called tools a session needs
	// since its last review; 0 keeps the default of 10.
	MinToolSteps int `json:"min_tool_steps,omitempty"`
	// IntervalHours is the least time between two reviews of a session; 0
	// keeps the default of 6.
	IntervalHours int `json:"interval_hours,omitempty"`
}

SkillsReviewConfig sets the review of finished sessions that proposes skill drafts and memory entries. Enabled unset follows the skills module; a zero number keeps its default.

type Summary

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

func SummaryFromConfig

func SummaryFromConfig(cfg Config) 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 TelephonyConfig added in v0.1.16

type TelephonyConfig struct {
	Enabled        bool   `json:"enabled,omitempty"`
	GatewayURL     string `json:"gateway_url,omitempty"`
	GatewayToken   string `json:"gateway_token,omitempty"`
	DefaultProfile string `json:"default_profile,omitempty"`
	PhonePrompt    string `json:"phone_prompt,omitempty"`
}

type TimezoneOption

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

func TimezoneOptions

func TimezoneOptions(now time.Time) []TimezoneOption

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 VoiceProviderConfig added in v0.1.9

type VoiceProviderConfig struct {
	APIKey      string `json:"api_key,omitempty"`
	APIKeyEnv   string `json:"api_key_env,omitempty"`
	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"`
}

func EffectiveVoiceConfig added in v0.2.0

func EffectiveVoiceConfig(moduleID string, providerID string, cfg VoiceProviderConfig) VoiceProviderConfig

EffectiveVoiceConfig is a local voice provider's settings with its defaults filled and its language normalized.

type WebSearchConfig added in v0.1.11

type WebSearchConfig struct {
	Provider  string `json:"provider,omitempty"`
	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.

Jump to

Keyboard shortcuts

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