Documentation
¶
Index ¶
- type DBStore
- func (s *DBStore) CreateAgent(ctx context.Context, a config.Agent) error
- func (s *DBStore) CreateAgentWithCredentials(ctx context.Context, a config.Agent, creds []providercred.Encrypted) error
- func (s *DBStore) CreateChannel(ctx context.Context, ch config.Channel) error
- func (s *DBStore) CreateProvider(ctx context.Context, p config.Provider) error
- func (s *DBStore) DeleteAgent(ctx context.Context, id string) error
- func (s *DBStore) DeleteAgentProviderCredential(ctx context.Context, agentID, providerID string) error
- func (s *DBStore) DeleteChannel(ctx context.Context, id string) error
- func (s *DBStore) DeleteChatAgent(ctx context.Context, channelID, platform, chatID string) error
- func (s *DBStore) DeleteManifestPluginOverride(ctx context.Context, pluginID string) error
- func (s *DBStore) DeletePlugin(ctx context.Context, id string) error
- func (s *DBStore) DeleteProvider(ctx context.Context, id string) error
- func (s *DBStore) GetAgent(ctx context.Context, id string) (config.Agent, error)
- func (s *DBStore) GetAgentProviderCredential(ctx context.Context, agentID, providerID string) (providercred.Encrypted, bool, error)
- func (s *DBStore) GetChannel(ctx context.Context, id string) (config.Channel, error)
- func (s *DBStore) GetChatAgent(ctx context.Context, channelID, platform, chatID string) (string, error)
- func (s *DBStore) GetManifestPluginOverride(ctx context.Context, pluginID string) (config.ManifestPluginOverride, bool, error)
- func (s *DBStore) GetPlugin(ctx context.Context, id string) (config.Plugin, error)
- func (s *DBStore) GetProvider(ctx context.Context, id string) (config.Provider, error)
- func (s *DBStore) GetSetting(ctx context.Context, key string) (string, error)
- func (s *DBStore) ListAccessibleAgents(ctx context.Context, userID string) ([]config.Agent, error)
- func (s *DBStore) ListAgentProviderCredentials(ctx context.Context, agentID string) ([]providercred.Metadata, error)
- func (s *DBStore) ListAgents(ctx context.Context) ([]config.Agent, error)
- func (s *DBStore) ListCachedModels(ctx context.Context) ([]config.CachedModel, error)
- func (s *DBStore) ListChannels(ctx context.Context) ([]config.Channel, error)
- func (s *DBStore) ListChannelsByType(ctx context.Context, channelType string) ([]config.Channel, error)
- func (s *DBStore) ListEnabledAgents(ctx context.Context) ([]config.Agent, error)
- func (s *DBStore) ListEnabledPlugins(ctx context.Context) ([]config.Plugin, error)
- func (s *DBStore) ListManifestPluginOverrides(ctx context.Context) ([]config.ManifestPluginOverride, error)
- func (s *DBStore) ListPluginOverrides(ctx context.Context) ([]config.Plugin, error)
- func (s *DBStore) ListPlugins(ctx context.Context) ([]config.Plugin, error)
- func (s *DBStore) ListPluginsByKind(ctx context.Context, kind string) ([]config.Plugin, error)
- func (s *DBStore) ListProviderIDs(ctx context.Context) ([]string, error)
- func (s *DBStore) ListProviders(ctx context.Context) ([]config.Provider, error)
- func (s *DBStore) ReplaceCachedModels(ctx context.Context, providerID string, modelIDs []string) error
- func (s *DBStore) Seed(ctx context.Context) error
- func (s *DBStore) SetChannelPluginConfig(ctx context.Context, id, kind, name string, cfg map[string]any) error
- func (s *DBStore) SetChatAgent(ctx context.Context, channelID, platform, chatID, agentID string) error
- func (s *DBStore) SetPluginConfig(ctx context.Context, id string, cfg map[string]any) error
- func (s *DBStore) SetPluginEnabled(ctx context.Context, id string, enabled bool) error
- func (s *DBStore) SetSetting(ctx context.Context, key, value string) error
- func (s *DBStore) Snapshot(ctx context.Context, agentID string) (*config.Snapshot, error)
- func (s *DBStore) UpdateAgent(ctx context.Context, a config.Agent) error
- func (s *DBStore) UpdateChannel(ctx context.Context, ch config.Channel) error
- func (s *DBStore) UpdateProvider(ctx context.Context, p config.Provider) error
- func (s *DBStore) UpsertAgentProviderCredential(ctx context.Context, agentID string, cred providercred.Encrypted) (providercred.Metadata, error)
- func (s *DBStore) UpsertChannel(ctx context.Context, ch config.Channel) error
- func (s *DBStore) UpsertManifestPluginOverride(ctx context.Context, ov config.ManifestPluginOverride) error
- func (s *DBStore) UpsertPlugin(ctx context.Context, p config.Plugin) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
DBStore implements config.Store using sqlc queries backed by PostgreSQL.
func NewDBStore ¶
NewDBStore creates a new DBStore wrapping the given database connection.
func (*DBStore) CreateAgent ¶
func (*DBStore) CreateAgentWithCredentials ¶ added in v0.61.0
func (s *DBStore) CreateAgentWithCredentials(ctx context.Context, a config.Agent, creds []providercred.Encrypted) error
CreateAgentWithCredentials inserts the Agent and all its credential rows in one transaction. A plain (non-upsert) credential insert means a duplicate (agent_id, provider_id) aborts the whole transaction, so a partial write can never leave an Agent with some of its credentials.
func (*DBStore) CreateChannel ¶ added in v0.61.0
func (*DBStore) CreateProvider ¶
func (*DBStore) DeleteAgentProviderCredential ¶ added in v0.61.0
func (s *DBStore) DeleteAgentProviderCredential(ctx context.Context, agentID, providerID string) error
DeleteAgentProviderCredential removes one credential. It is idempotent: a DELETE affecting zero rows is not an error.
func (*DBStore) DeleteChannel ¶
func (*DBStore) DeleteChatAgent ¶
func (*DBStore) DeleteManifestPluginOverride ¶
func (*DBStore) DeleteProvider ¶
func (*DBStore) GetAgentProviderCredential ¶ added in v0.61.0
func (s *DBStore) GetAgentProviderCredential(ctx context.Context, agentID, providerID string) (providercred.Encrypted, bool, error)
GetAgentProviderCredential returns one credential's ciphertext, or found=false when the Agent has no override for that Provider.
func (*DBStore) GetChannel ¶
func (*DBStore) GetChatAgent ¶
func (*DBStore) GetManifestPluginOverride ¶
func (*DBStore) GetProvider ¶
func (*DBStore) GetSetting ¶
func (*DBStore) ListAccessibleAgents ¶
func (*DBStore) ListAgentProviderCredentials ¶ added in v0.61.0
func (s *DBStore) ListAgentProviderCredentials(ctx context.Context, agentID string) ([]providercred.Metadata, error)
ListAgentProviderCredentials returns secret-free metadata for one Agent. The underlying query never selects api_key_enc.
func (*DBStore) ListAgents ¶
func (*DBStore) ListCachedModels ¶ added in v0.60.0
func (*DBStore) ListChannels ¶
func (*DBStore) ListChannelsByType ¶
func (*DBStore) ListEnabledAgents ¶
func (*DBStore) ListEnabledPlugins ¶
func (*DBStore) ListManifestPluginOverrides ¶
func (*DBStore) ListPluginOverrides ¶
func (*DBStore) ListPlugins ¶
func (*DBStore) ListPluginsByKind ¶
func (*DBStore) ListProviderIDs ¶ added in v0.61.0
ListProviderIDs returns canonical Provider row IDs without loading Provider config, which contains the deployment-global API key.
func (*DBStore) ListProviders ¶
func (*DBStore) ReplaceCachedModels ¶ added in v0.60.0
func (*DBStore) Seed ¶
Seed removes legacy configuration and creates Stella only for an empty agent catalog.
func (*DBStore) SetChannelPluginConfig ¶ added in v0.63.2
func (*DBStore) SetChatAgent ¶
func (*DBStore) SetPluginConfig ¶
func (*DBStore) SetPluginEnabled ¶
SetPluginEnabled and SetPluginConfig each write one column. They are the admin kill switch and the channel credential mirror, and those two run concurrently: a read-modify-write of the whole row would let either one silently restore the other's previous value. The read stays only to name a row that may not exist yet.
func (*DBStore) SetSetting ¶
func (*DBStore) UpdateAgent ¶
func (*DBStore) UpdateChannel ¶ added in v0.61.0
func (*DBStore) UpdateProvider ¶
func (*DBStore) UpsertAgentProviderCredential ¶ added in v0.61.0
func (s *DBStore) UpsertAgentProviderCredential(ctx context.Context, agentID string, cred providercred.Encrypted) (providercred.Metadata, error)
UpsertAgentProviderCredential writes or atomically rotates one credential.