feat(tools): implement CRUD operations for thoughts and projects
* Add tools for creating, retrieving, updating, and deleting thoughts. * Implement project management tools for creating and listing projects. * Introduce linking functionality between thoughts. * Add search and recall capabilities for thoughts based on semantic queries. * Implement statistics and summarization tools for thought analysis. * Create database migrations for thoughts, projects, and links. * Add helper functions for UUID parsing and project resolution.
This commit is contained in:
119
internal/config/config.go
Normal file
119
internal/config/config.go
Normal file
@@ -0,0 +1,119 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
DefaultConfigPath = "./configs/dev.yaml"
|
||||
DefaultSource = "mcp"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Server ServerConfig `yaml:"server"`
|
||||
MCP MCPConfig `yaml:"mcp"`
|
||||
Auth AuthConfig `yaml:"auth"`
|
||||
Database DatabaseConfig `yaml:"database"`
|
||||
AI AIConfig `yaml:"ai"`
|
||||
Capture CaptureConfig `yaml:"capture"`
|
||||
Search SearchConfig `yaml:"search"`
|
||||
Logging LoggingConfig `yaml:"logging"`
|
||||
Observability ObservabilityConfig `yaml:"observability"`
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
ReadTimeout time.Duration `yaml:"read_timeout"`
|
||||
WriteTimeout time.Duration `yaml:"write_timeout"`
|
||||
IdleTimeout time.Duration `yaml:"idle_timeout"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
}
|
||||
|
||||
type MCPConfig struct {
|
||||
Path string `yaml:"path"`
|
||||
ServerName string `yaml:"server_name"`
|
||||
Version string `yaml:"version"`
|
||||
Transport string `yaml:"transport"`
|
||||
}
|
||||
|
||||
type AuthConfig struct {
|
||||
Mode string `yaml:"mode"`
|
||||
HeaderName string `yaml:"header_name"`
|
||||
QueryParam string `yaml:"query_param"`
|
||||
AllowQueryParam bool `yaml:"allow_query_param"`
|
||||
Keys []APIKey `yaml:"keys"`
|
||||
}
|
||||
|
||||
type APIKey struct {
|
||||
ID string `yaml:"id"`
|
||||
Value string `yaml:"value"`
|
||||
Description string `yaml:"description"`
|
||||
}
|
||||
|
||||
type DatabaseConfig struct {
|
||||
URL string `yaml:"url"`
|
||||
MaxConns int32 `yaml:"max_conns"`
|
||||
MinConns int32 `yaml:"min_conns"`
|
||||
MaxConnLifetime time.Duration `yaml:"max_conn_lifetime"`
|
||||
MaxConnIdleTime time.Duration `yaml:"max_conn_idle_time"`
|
||||
}
|
||||
|
||||
type AIConfig struct {
|
||||
Provider string `yaml:"provider"`
|
||||
Embeddings AIEmbeddingConfig `yaml:"embeddings"`
|
||||
Metadata AIMetadataConfig `yaml:"metadata"`
|
||||
LiteLLM LiteLLMConfig `yaml:"litellm"`
|
||||
OpenRouter OpenRouterAIConfig `yaml:"openrouter"`
|
||||
}
|
||||
|
||||
type AIEmbeddingConfig struct {
|
||||
Model string `yaml:"model"`
|
||||
Dimensions int `yaml:"dimensions"`
|
||||
}
|
||||
|
||||
type AIMetadataConfig struct {
|
||||
Model string `yaml:"model"`
|
||||
Temperature float64 `yaml:"temperature"`
|
||||
}
|
||||
|
||||
type LiteLLMConfig struct {
|
||||
BaseURL string `yaml:"base_url"`
|
||||
APIKey string `yaml:"api_key"`
|
||||
UseResponsesAPI bool `yaml:"use_responses_api"`
|
||||
RequestHeaders map[string]string `yaml:"request_headers"`
|
||||
EmbeddingModel string `yaml:"embedding_model"`
|
||||
MetadataModel string `yaml:"metadata_model"`
|
||||
}
|
||||
|
||||
type OpenRouterAIConfig struct {
|
||||
BaseURL string `yaml:"base_url"`
|
||||
APIKey string `yaml:"api_key"`
|
||||
AppName string `yaml:"app_name"`
|
||||
SiteURL string `yaml:"site_url"`
|
||||
ExtraHeaders map[string]string `yaml:"extra_headers"`
|
||||
}
|
||||
|
||||
type CaptureConfig struct {
|
||||
Source string `yaml:"source"`
|
||||
MetadataDefaults CaptureMetadataDefault `yaml:"metadata_defaults"`
|
||||
}
|
||||
|
||||
type CaptureMetadataDefault struct {
|
||||
Type string `yaml:"type"`
|
||||
TopicFallback string `yaml:"topic_fallback"`
|
||||
}
|
||||
|
||||
type SearchConfig struct {
|
||||
DefaultLimit int `yaml:"default_limit"`
|
||||
DefaultThreshold float64 `yaml:"default_threshold"`
|
||||
MaxLimit int `yaml:"max_limit"`
|
||||
}
|
||||
|
||||
type LoggingConfig struct {
|
||||
Level string `yaml:"level"`
|
||||
Format string `yaml:"format"`
|
||||
}
|
||||
|
||||
type ObservabilityConfig struct {
|
||||
MetricsEnabled bool `yaml:"metrics_enabled"`
|
||||
PprofEnabled bool `yaml:"pprof_enabled"`
|
||||
}
|
||||
Reference in New Issue
Block a user