adapter.go — SendResult struct (success, message_id, error, retryable, retry_after, continuation_message_ids, error_kind), ChatInfo struct (name, type, chat_id, thread_id), BasePlatformAdapter interface (Connect, Disconnect, Send, ChatInfo). session.go — SessionSource (platform, chat_id/name/type, user_id/name, thread_id, guild_id, scope_id, profile, is_bot, metadata) with Key() for deterministic session key. SessionContext wrapping source with connected_platforms, home_channels, session_key/id, timestamps. session_store.go — SessionStore interface (GetOrCreate, Get, Reset, List, GetByChannel, Touch, Delete, Close) + nellSessionStore backed by nell.DocDB with mutex-guarded Save/Delete for race safety. Verification: 4 findings fixed (gofmt alignment, race on mutex, != true anti-pattern, missing zero-value assertions). 58 tests pass (incl -race), go vet + gofmt + golangci-lint clean. Closes: archie-core-abg.16.3, 16.5, 16.9, 16.10, 16.11
31 lines
1.5 KiB
Go
31 lines
1.5 KiB
Go
package memory
|
|
|
|
// ── Configuration helper interfaces ───────────────────────────────────────
|
|
//
|
|
// Providers that support dynamic configuration implement these interfaces.
|
|
// The MemoryManager uses ConfigSchemaProvider to validate user-provided
|
|
// config before passing it to SaveConfigProvider for persistence.
|
|
|
|
// ConfigSchemaProvider is an optional interface for providers that expose a
|
|
// JSON Schema describing their configuration shape. The schema is used to
|
|
// validate user-provided config values before they are persisted.
|
|
type ConfigSchemaProvider interface {
|
|
// GetConfigSchema returns a JSON Schema document (as map[string]any)
|
|
// describing the provider's configuration. The schema is used by the
|
|
// config system to validate user-provided values.
|
|
GetConfigSchema() map[string]any
|
|
}
|
|
|
|
// SaveConfigProvider is an optional interface for providers that support
|
|
// persisting configuration. The MemoryManager calls SaveConfig after
|
|
// validating user-provided values against the schema (if the provider
|
|
// also implements ConfigSchemaProvider).
|
|
type SaveConfigProvider interface {
|
|
// SaveConfig validates and persists the given configuration values.
|
|
// values is the complete set of provider-specific config key/value
|
|
// pairs. hermesHome is the root of the HERMES_HOME directory tree;
|
|
// the provider should write its config to a provider-specific location
|
|
// under this path.
|
|
SaveConfig(values map[string]any, hermesHome string) error
|
|
}
|