Documentation
¶
Overview ¶
Package config currently holds two distinct concepts that share a package only for historical reasons (it is a leaf package everything can import without cycles). Files are grouped so a future package split is mechanical:
Process/environment configuration — parsed from the environment at the server startup boundary and injected into subsystems:
- server_config.go: ServerConfig, the boot-time env contract (issue #701)
- lifecycle.go: graceful-shutdown drain budgets (nested in ServerConfig)
- paths.go: STELLA_HOME bootstrap (pre-ServerConfig by necessity)
- sandbox_env.go: per-call STELLA_SANDBOX_BACKEND override
DB-backed application configuration — domain types persisted in PostgreSQL and served through the Store interface (implemented by internal/store):
- store.go: the Store interface
- provider.go, agent.go, channel.go, plugin.go, models_cache.go: row types
- settings.go, embedding.go: app_setting key-value payloads
- sandbox.go: per-agent sandbox settings (part of Agent)
- snapshot.go: the assembled per-agent runtime view and its model/creds resolution
New process/env variables belong on ServerConfig (env_scan_test.go enforces this); new DB-backed types belong in their own file on the second group.
Index ¶
- Constants
- Variables
- func ActiveSandboxBackend(plugins []Plugin) string
- func BuiltinPluginIDs() []string
- func CachePath() string
- func IsBuiltinPlugin(id string) bool
- func ParseModelRef(ref string) (provider, model string)
- func PluginID(kind, name string) string
- func ResetStellaHome()
- func SandboxBackendEnvOverride() string
- func SaveEmbeddingSettings(ctx context.Context, store SettingStore, s EmbeddingSettings) error
- func StellaHome() string
- type Agent
- type BlobS3Config
- type BuiltinPlugin
- type CachedModel
- type Channel
- type ChannelBindingConflictError
- type CompactionConfig
- type DatabaseConfig
- type DiagnosticsConfig
- type EmbeddingSettings
- type Lifecycle
- type ManifestPluginOverride
- type OIDCConfig
- type ObservabilityConfig
- type Plugin
- type Provider
- type ProviderCreds
- type ProviderModel
- type ProviderModelCost
- type ReflectConfig
- type RunnerConfig
- type SandboxConfig
- type SandboxNetworkConfig
- type SchedulerConfig
- type ServerConfig
- type SettingStore
- type Snapshot
- func (s *Snapshot) LogPath() string
- func (s *Snapshot) ResolveModel() ai.Model
- func (s *Snapshot) ResolveModelID(tier string) string
- func (s *Snapshot) ResolveModelTier(tier string) ai.Model
- func (s *Snapshot) ResolveProviderCreds(providerID string) ProviderCreds
- func (s *Snapshot) ResolveThinkingLevel(tier string) ai.ThinkingLevel
- func (s *Snapshot) SkillsPath() string
- type Store
- type VaultConfig
Constants ¶
const ( AgentScopeSystem = "system" // all users can access AgentScopeRestricted = "restricted" // only assigned users can access )
AgentScope constants define the access scope for an agent.
const ( DefaultEmbeddingModel = "text-embedding-3-small" DefaultEmbeddingDim = 1536 )
Day-1 canonical vector space: OpenAI text-embedding-3-small emits 1536-dim vectors natively, matching the sidecar storage width with no padding.
const ( PluginKindTool = "tool" PluginKindCLI = "cli" PluginKindChannel = "channel" PluginKindHook = "hook" PluginKindProvider = "provider" PluginKindSandbox = "sandbox" PluginKindAuth = "auth" )
Plugin kind constants.
const ( SandboxBackendDocker = "docker" SandboxBackendLocal = "local" SandboxBackendNone = "none" SandboxNetworkDisabled = "disabled" SandboxNetworkAllowAll = "allow_all" )
const ( ModelTierStrong = "strong" ModelTierFast = "fast" )
Model tier constants.
const EmbeddingSettingKey = "embedding"
EmbeddingSettingKey is the app_setting key under which the singleton embedding configuration JSON is stored (same key-value mechanism as runner/compaction/ scheduler settings).
Variables ¶
var BuiltinChannelNames = []string{"telegram", "qq", "feishu", "weixin"}
BuiltinChannelNames lists the 4 built-in channel plugins.
var BuiltinHookNames = []string{"rtk"}
BuiltinHookNames lists the built-in hook plugins.
var BuiltinProviderNames = []string{"anthropic", "openai", "openai-response"}
BuiltinProviderNames lists the built-in provider types.
var BuiltinSandboxNames = []string{SandboxBackendDocker, SandboxBackendLocal, SandboxBackendNone}
BuiltinSandboxNames lists the built-in sandbox backend plugins.
var BuiltinToolNames = []string{"gh", "lark-cli", "mise", "tap-web", "webfetch"}
BuiltinToolNames lists the built-in tool plugins. Core tools (read, bash, edit, write) are always-on and no longer managed as plugins.
Functions ¶
func ActiveSandboxBackend ¶
ActiveSandboxBackend returns the name of the enabled sandbox backend plugin. STELLA_SANDBOX_BACKEND takes precedence; otherwise the DB-enabled plugin wins, defaulting to SandboxBackendLocal.
func BuiltinPluginIDs ¶
func BuiltinPluginIDs() []string
BuiltinPluginIDs returns all built-in plugin IDs in deterministic order. Provider instances are stored separately in provider.
func CachePath ¶
func CachePath() string
CachePath returns the cache directory inside the stella home.
func IsBuiltinPlugin ¶ added in v0.38.0
IsBuiltinPlugin reports whether the given ID is a code-defined builtin.
func ParseModelRef ¶
ParseModelRef splits a "provider/model" string into its parts. If the string contains no "/", it returns ("", ref) as fallback.
func ResetStellaHome ¶
func ResetStellaHome()
ResetStellaHome clears the cached StellaHome value (for testing).
func SandboxBackendEnvOverride ¶ added in v0.44.1
func SandboxBackendEnvOverride() string
SandboxBackendEnvOverride returns the env-forced sandbox backend name, or "" when the operator has not set STELLA_SANDBOX_BACKEND.
This read is deliberately per-call and lenient (an unknown value means "no override"), so it stays outside ServerConfig; see the allowlist entry in env_scan_test.go.
func SaveEmbeddingSettings ¶ added in v0.50.3
func SaveEmbeddingSettings(ctx context.Context, store SettingStore, s EmbeddingSettings) error
SaveEmbeddingSettings persists the singleton embedding config.
func StellaHome ¶
func StellaHome() string
StellaHome returns the stella home directory. Priority: STELLA_HOME env -> ~/.stella The result is cached after the first call.
Types ¶
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `json:"name"`
Model string `json:"model"`
ModelThinking string `json:"model_thinking"`
ModelStrong string `json:"model_strong"`
ModelStrongThinking string `json:"model_strong_thinking"`
ModelFast string `json:"model_fast"`
ModelFastThinking string `json:"model_fast_thinking"`
SystemPrompt string `json:"system_prompt"`
Soul string `json:"soul"`
Workspace string `json:"workspace"`
Sandbox SandboxConfig `json:"sandbox"`
Scope string `json:"scope"`
CreatorID string `json:"creator_id"`
Enabled bool `json:"enabled"`
LastActive *time.Time `json:"last_active,omitempty"`
}
Agent represents an agent definition. Model fields use {provider}/{model} format (e.g. "anthropic/claude-sonnet-4-6").
type BlobS3Config ¶ added in v0.60.0
type BlobS3Config struct {
Endpoint string
Bucket string
AccessKey string
SecretKey string
Region string
UseSSL string
}
BlobS3Config holds the six raw S3 blob-store variables. The blob package owns the group constraint and the USE_SSL dialect, so these stay untyped strings here.
type BuiltinPlugin ¶ added in v0.38.0
BuiltinPlugin describes a code-defined plugin with its default enabled state.
func BuiltinPluginByID ¶ added in v0.38.0
func BuiltinPluginByID(id string) (BuiltinPlugin, bool)
BuiltinPluginByID returns the builtin definition for the given ID.
func BuiltinPlugins ¶ added in v0.38.0
func BuiltinPlugins() []BuiltinPlugin
BuiltinPlugins returns the authoritative list of code-defined plugins. DB rows in plugin are optional overrides of enabled/config.
type CachedModel ¶
type CachedModel struct {
Provider string `json:"provider"`
ProviderName string `json:"provider_name,omitempty"`
Model string `json:"model"`
}
CachedModel is one fetched provider/model pair. The set of fetched models per provider is persisted in PostgreSQL (see Store.ListCachedModels) so it is shared across replicas and survives restarts; ProviderName is filled by readers from the live provider config, not stored with the cache.
type Channel ¶
type Channel struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
AgentID string `json:"agent_id,omitempty"`
Enabled bool `json:"enabled"`
Config string `json:"config"`
}
Channel represents a platform channel configuration.
type ChannelBindingConflictError ¶ added in v0.60.0
ChannelBindingConflictError reports an attempted second bidirectional channel for one (agent_id, type) binding. Webhooks and unbound channels are exempt.
func (*ChannelBindingConflictError) Error ¶ added in v0.60.0
func (e *ChannelBindingConflictError) Error() string
type CompactionConfig ¶
type CompactionConfig struct {
// MaxTokens triggers compaction when the estimated token count exceeds this.
// 0 (or omitted) uses the default of 80000. Negative values disable
// automatic compaction. Manual /compact still works.
MaxTokens int `json:"max_tokens"`
// KeepTail is the number of recent user turns to preserve verbatim
// after compaction. Default: 6.
KeepTail int `json:"keep_tail"`
}
CompactionConfig controls automatic session compaction.
type DatabaseConfig ¶ added in v0.60.0
type DatabaseConfig struct {
// RequireExternalDB forbids the embedded-PostgreSQL fallback. The embedded
// cluster is a single-node local convenience: in a container it lands on an
// ephemeral filesystem, and with multiple replicas each process would create
// its own database. The Docker image sets this by default; set it to 0 to
// deliberately run embedded PostgreSQL inside a container (e.g. a single
// container with a persistent volume). Unset or empty is false; any other
// value is parsed as a boolean and an unparseable value fails fast.
RequireExternalDB bool
// URL is an explicitly configured PostgreSQL DSN (STELLA_DATABASE_URL), or ""
// when none is set. An empty result tells the server to start and manage its
// own embedded PostgreSQL — the zero-config default, so a fresh install needs
// no separately installed or running database.
URL string
}
DatabaseConfig holds the two variables that jointly decide, at startup, whether the server runs its own embedded PostgreSQL or connects to an external one.
type DiagnosticsConfig ¶ added in v0.60.0
type DiagnosticsConfig struct {
// PprofAddr is the listen address for the net/http/pprof debug server
// (STELLA_PPROF_ADDR). Empty (unset) leaves the debug server disabled. Raw
// (os.Getenv semantics) so the disabled-when-empty check is unchanged.
PprofAddr string
}
DiagnosticsConfig holds optional local debug-server settings.
type EmbeddingSettings ¶ added in v0.50.3
type EmbeddingSettings struct {
Enabled bool `json:"enabled"`
Model string `json:"model"`
Dim int `json:"dim"`
APIKey string `json:"api_key"`
BaseURL string `json:"base_url"`
Normalize bool `json:"normalize"`
}
EmbeddingSettings is the deployment-wide semantic-search configuration, edited in the web settings page and stored as one JSON value in app_setting. The lane is opt-in: with Enabled false (the default) search stays pure-BM25. APIKey is stored as-is, consistent with how provider credentials are stored.
func LoadEmbeddingSettings ¶ added in v0.50.3
func LoadEmbeddingSettings(ctx context.Context, store SettingStore) (EmbeddingSettings, error)
LoadEmbeddingSettings reads the singleton embedding config, filling defaults for an unset deployment (disabled, default model/dim) so callers always get a usable struct. A missing row is not an error — it means "never configured".
type Lifecycle ¶ added in v0.60.0
type Lifecycle struct {
// HTTPShutdownTimeout is the drain budget for in-flight HTTP requests. When
// the budget is spent the server force-closes any still-open connections.
HTTPShutdownTimeout time.Duration
// RiverSoftStopTimeout is the drain budget for in-flight background jobs
// (goal/scheduler agent runs) before River cancels their work contexts and
// escalates to a hard stop.
RiverSoftStopTimeout time.Duration
}
Lifecycle holds the parsed shutdown-lifecycle durations. It is a nested group of ServerConfig; #700's injection (setup/runServer taking a config.Lifecycle) depends on this type staying stable.
type ManifestPluginOverride ¶ added in v0.38.0
type ManifestPluginOverride struct {
PluginID string
Enabled *bool // nil = fallback to manifest default; non-nil = override
SessionEnvVaultKey string // empty = fallback; non-empty = vault blob with session_env override map
Config string // JSON manifest plugin definition override; empty = fallback to builtin
UpdatedAt string
}
Plugin represents a unified plugin entry stored in plugin. IDs follow "kind/name" format, e.g. "tool/webfetch" or "channel/telegram". ManifestPluginOverride is an override of a manifest-declared plugin. Both Enabled and SessionEnvVaultKey are nullable / empty-as-sentinel so the row can express "fallback to manifest default" without losing the row itself.
type OIDCConfig ¶ added in v0.60.0
type OIDCConfig struct {
ProviderName string
IssuerURL string
ClientID string
ClientSecret string
RedirectURL string
Scopes string
}
OIDCConfig is the static single-provider OIDC block (OIDC_* variables), read raw. ClientSecret is a secret and must never be logged. Scopes is the raw OIDC_SCOPES string; the oidc package owns splitting and defaulting it so the parsing stays next to its use.
type ObservabilityConfig ¶ added in v0.60.0
type ObservabilityConfig struct {
// RecordToolIO records tool input/output payloads on spans
// (OTEL_STELLA_RECORD_TOOL_IO). Preserves the exact ==\"true\" opt-in: any
// other value, including unset, leaves it off.
RecordToolIO bool
// RiverLogLevel is the raw LOG_LEVEL_RIVER value ("" for unset). The River
// job queue heartbeats at DEBUG/INFO, so its logger is capped at WARN unless
// this opens it up; internal/cli.ParseLogLevel owns the level dialect.
RiverLogLevel string
}
ObservabilityConfig holds tracing and logging toggles this server owns.
type Provider ¶
type Provider struct {
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
APIKey string `json:"api_key"`
BaseURL string `json:"base_url"`
Models map[string]ProviderModel `json:"models,omitempty"`
}
Provider represents an LLM API provider.
type ProviderCreds ¶
ProviderCreds holds credentials for a single provider.
type ProviderModel ¶
type ProviderModel struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Enabled bool `json:"enabled"`
Reasoning bool `json:"reasoning,omitempty"`
Input []string `json:"input,omitempty"`
Output []string `json:"output,omitempty"`
ContextWindow int `json:"contextWindow,omitempty"`
MaxTokens int `json:"maxTokens,omitempty"`
Cost ProviderModelCost `json:"cost,omitzero"`
}
type ProviderModelCost ¶
type ReflectConfig ¶ added in v0.60.0
ReflectConfig carries the raw reflect-scheduler tuning strings so the reflect setup keeps ownership of interval parsing (lenient warn-and-clamp) and curator mode parsing (fail-fast enum).
type RunnerConfig ¶
type RunnerConfig struct {
System string `json:"system"`
IdleTimeout int `json:"idle_timeout"`
DelegateTimeout int `json:"delegate_timeout"` // minutes; 0 = use default (15m)
Compaction CompactionConfig `json:"compaction"`
}
RunnerConfig configures the agent runner.
func (RunnerConfig) DelegateTimeoutDuration ¶ added in v0.33.0
func (c RunnerConfig) DelegateTimeoutDuration() time.Duration
DelegateTimeoutDuration returns the configured delegate timeout as a time.Duration. Zero means "use the built-in default" (15 minutes).
type SandboxConfig ¶
type SandboxConfig struct {
Network SandboxNetworkConfig `json:"network"`
}
SandboxConfig configures the sandbox backend. The active backend is selected globally on the Plugins page.
func (SandboxConfig) NetworkMode ¶
func (c SandboxConfig) NetworkMode() string
NetworkMode returns the configured network mode with defaults applied.
func (SandboxConfig) Validate ¶
func (c SandboxConfig) Validate() error
Validate returns an error when the sandbox configuration is invalid.
type SandboxNetworkConfig ¶
type SandboxNetworkConfig struct {
Mode string `json:"mode"`
Allowlist []string `json:"allowlist"`
}
SandboxNetworkConfig configures sandbox network access.
type SchedulerConfig ¶
SchedulerConfig configures the scheduler subsystem.
func (SchedulerConfig) IsEnabled ¶
func (c SchedulerConfig) IsEnabled() bool
IsEnabled returns whether the scheduler is enabled (defaults to true).
type ServerConfig ¶ added in v0.60.0
type ServerConfig struct {
// Database selects between the embedded PostgreSQL convenience cluster and an
// external server.
Database DatabaseConfig
// Lifecycle bounds the two-phase graceful-shutdown drain. It is the same type
// injected since #700; keep it a nested group so that injection path is
// unchanged.
Lifecycle Lifecycle
// ServerURL is the URL CLI commands use to reach the local stella server.
// It has no Go consumer today (the sandbox injects STELLA_SERVER_URL into the
// container itself); the field is carried so a future CLI client threads it
// from here instead of reading the environment directly.
ServerURL string
// BaseURL is the externally reachable base URL of the deployment
// (STELLA_BASE_URL), raw and un-normalized: "" means "derive from the bind
// host". The gateway trims a trailing slash where it builds absolute URLs;
// the raw value is carried so that trimming stays at the use site.
BaseURL string
// Vault carries the master key used to seal per-user secrets.
Vault VaultConfig
// OIDC is the static single-provider OIDC block. It is read raw (no trim) so
// the external-vs-local mode decision, the provider config, and the
// dependent-feature check all observe one snapshot with no os.Getenv/config
// generation split.
OIDC OIDCConfig
// Blob holds the raw S3-compatible blob-store settings. The group constraint
// (any set => the four core fields required) and the USE_SSL bool dialect stay
// in the blob package, which consumes these raw strings.
Blob BlobS3Config
// Reflect carries the raw reflect-scheduler tuning strings. Parsing stays in
// the reflect setup so its lenient-warn-and-clamp interval behavior and
// fail-fast curator-mode enum are preserved exactly.
Reflect ReflectConfig
// Diagnostics holds optional debug-server settings.
Diagnostics DiagnosticsConfig
// Observability holds tracing/telemetry toggles owned by this server (the
// standard OTEL SDK variables stay with the SDK and are not mirrored here).
Observability ObservabilityConfig
}
ServerConfig is the boot-time-static environment configuration the stella server parses once, at its startup boundary (serverAction), and threads into the subsystems that need it. It is deliberately NOT read on the hot path: parse it once and inject the values, so a misconfiguration fails fast at startup rather than surfacing mid-request.
It carries every boot/setup-time environment variable the server owns (issue #701). Variables that are read per-call, live in pkg/ (which must not import this package), or need dialect/validation the consuming subsystem owns are NOT here; the allowlist in env_scan_test.go enumerates every such exception with the reason it stays a direct read.
func LoadServerConfig ¶ added in v0.60.0
func LoadServerConfig(lookup func(string) (string, bool)) (ServerConfig, error)
LoadServerConfig parses the server's boot-time environment. lookup resolves a variable name to its value and presence (os.LookupEnv in production); passing it in keeps the function pure and lets tests drive it without mutating process state.
Normalization (typed fields only, serverConfigKeys): the value is trimmed, and a whitespace-only or empty value is treated as unset so the default applies — preserving the legacy TrimSpace-then-default parsers. String passthrough fields (URLs, secrets, subsystem-validated blocks) are exempt and keep exact os.Getenv semantics. Parse errors for every field are aggregated (env.AggregateError) so a misconfigured deployment sees all its mistakes at once, not one per restart.
type SettingStore ¶ added in v0.50.3
type SettingStore interface {
GetSetting(ctx context.Context, key string) (string, error)
SetSetting(ctx context.Context, key, value string) error
}
SettingStore is the slice of Store the embedding helpers need: the key-value setting accessors. Narrowing the dependency keeps the helpers testable with a trivial fake instead of the full Store; config.Store satisfies it.
type Snapshot ¶
type Snapshot struct {
AgentID string // the agent ID this snapshot belongs to
// Provider, APIKey, BaseURL are the default provider credentials derived
// from the Model field's provider prefix. Kept for backward compatibility.
Provider string
Model string
ModelThinking string
ModelStrong string
ModelStrongThinking string
ModelFast string
ModelFastThinking string
Workspace string
Sandbox SandboxConfig
APIKey string
BaseURL string
SystemPrompt string // agent's base system prompt from DB
Soul string // agent's default soul from DB (fallback for all users)
Runner RunnerConfig
Compaction CompactionConfig
Scheduler SchedulerConfig
Plugins []Plugin
// Providers maps provider ID to credentials, enabling per-tier provider
// resolution when model_strong or model_fast use a different provider.
Providers map[string]ProviderCreds
}
Snapshot is a read-only config snapshot assembled from DB for downstream consumption. It replaces the old *Config for code that needs provider/model information for a specific agent.
func (*Snapshot) ResolveModel ¶
ResolveModel returns the ai.Model for the default (strong) tier.
func (*Snapshot) ResolveModelID ¶
ResolveModelID returns the model ID string for the given tier, falling back to Model if the tier-specific value is not set.
func (*Snapshot) ResolveModelTier ¶
ResolveModelTier returns the ai.Model for the given tier, constructing a minimal Model from the snapshot's provider and model information. It parses the provider from the model ref and looks up per-provider credentials from the Providers map.
func (*Snapshot) ResolveProviderCreds ¶
func (s *Snapshot) ResolveProviderCreds(providerID string) ProviderCreds
ResolveProviderCreds returns the API key and base URL for the given provider ID, falling back to the default Provider credentials.
func (*Snapshot) ResolveThinkingLevel ¶ added in v0.45.0
func (s *Snapshot) ResolveThinkingLevel(tier string) ai.ThinkingLevel
ResolveThinkingLevel returns the thinking level for the given tier, falling back to the default model's setting when a tier-specific setting is unset.
func (*Snapshot) SkillsPath ¶
SkillsPath returns the per-workspace agent-level skills directory.
type Store ¶
type Store interface {
// Providers
ListProviders(ctx context.Context) ([]Provider, error)
GetProvider(ctx context.Context, id string) (Provider, error)
CreateProvider(ctx context.Context, p Provider) error
UpdateProvider(ctx context.Context, p Provider) error
DeleteProvider(ctx context.Context, id string) error
// Fetched-model cache — the model IDs an admin pulled from each provider's
// API. ListCachedModels returns a flat list across providers; ReplaceCachedModels
// replaces the fetched set for one provider only, leaving others untouched.
ListCachedModels(ctx context.Context) ([]CachedModel, error)
ReplaceCachedModels(ctx context.Context, providerID string, modelIDs []string) error
// Agents
ListAgents(ctx context.Context) ([]Agent, error)
ListEnabledAgents(ctx context.Context) ([]Agent, error)
ListAccessibleAgents(ctx context.Context, userID string) ([]Agent, error)
GetAgent(ctx context.Context, id string) (Agent, error)
CreateAgent(ctx context.Context, a Agent) error
UpdateAgent(ctx context.Context, a Agent) error
DeleteAgent(ctx context.Context, id string) error
// Channels
ListChannels(ctx context.Context) ([]Channel, error)
ListChannelsByType(ctx context.Context, channelType string) ([]Channel, error)
GetChannel(ctx context.Context, id string) (Channel, error)
UpsertChannel(ctx context.Context, ch Channel) error
DeleteChannel(ctx context.Context, id string) error
// Manifest plugin overrides — tunables for manifest-declared plugins.
// Reads merge the builtin manifest defaults with these rows.
GetManifestPluginOverride(ctx context.Context, pluginID string) (ManifestPluginOverride, bool, error)
ListManifestPluginOverrides(ctx context.Context) ([]ManifestPluginOverride, error)
UpsertManifestPluginOverride(ctx context.Context, override ManifestPluginOverride) error
DeleteManifestPluginOverride(ctx context.Context, pluginID string) error
// Plugins — read paths merge BuiltinPlugins() with DB override rows.
ListPlugins(ctx context.Context) ([]Plugin, error)
ListPluginOverrides(ctx context.Context) ([]Plugin, error)
ListPluginsByKind(ctx context.Context, kind string) ([]Plugin, error)
ListEnabledPlugins(ctx context.Context) ([]Plugin, error)
GetPlugin(ctx context.Context, id string) (Plugin, error)
UpsertPlugin(ctx context.Context, p Plugin) error
SetPluginEnabled(ctx context.Context, id string, enabled bool) error
SetPluginConfig(ctx context.Context, id string, config map[string]any) error
DeletePlugin(ctx context.Context, id string) error
// Chat Agents (group -> agent mapping)
GetChatAgent(ctx context.Context, channelID, platform, chatID string) (string, error) // returns agentID
SetChatAgent(ctx context.Context, channelID, platform, chatID, agentID string) error
DeleteChatAgent(ctx context.Context, channelID, platform, chatID string) error
// Settings (key-value JSON)
GetSetting(ctx context.Context, key string) (string, error) // returns JSON string
SetSetting(ctx context.Context, key, value string) error
// Snapshot assembles a read-only config snapshot for an agent.
Snapshot(ctx context.Context, agentID string) (*Snapshot, error)
// Bootstrap seeds default config for a fresh install.
Seed(ctx context.Context) error
}
Store provides typed access to configuration stored in the database.
type VaultConfig ¶ added in v0.60.0
type VaultConfig struct {
Key string
}
VaultConfig carries the vault master key (STELLA_VAULT_KEY). The key is a secret: it must never appear in any error or log text, so this struct is not logged and callers thread Key only into the vault service. The value is raw (os.Getenv semantics, no trim) to preserve the exact "empty => required error" check at the server startup boundary.