Documentation
ΒΆ
Index ΒΆ
- Constants
- Variables
- func CopyKey(storage Storage, srcKey, dstKey string) error
- func ExportStorage(storage Storage, w io.Writer) error
- func FormatToolName(serverName, toolName string) string
- func HandleDuplicateName(baseName string, existingNames map[string]bool, maxLength int) string
- func ImportStorage(storage Storage, r io.Reader) error
- func LoadJSON(storage Storage, key string, v interface{}) error
- func ParseToolName(toolName string) (serverName, tool string, isMCP bool)
- func SanitizeServerName(name string) string
- func SaveJSON(storage Storage, key string, v interface{}) error
- func ValidateServer(name string, config ServerConfig) error
- type AutoSyncConfig
- type AutoSyncSettings
- type AutoSyncStatus
- type BackupEvent
- type BackupInfo
- type BackupSettings
- type Change
- type ClaudeCodeAdapter
- func (c *ClaudeCodeAdapter) GetAllowedTools(projectPath string) ([]string, error)
- func (c *ClaudeCodeAdapter) ReadClaudeCodeConfig() (*ClaudeCodeConfig, error)
- func (c *ClaudeCodeAdapter) TestMCPServer(name string, config ServerConfig) error
- func (c *ClaudeCodeAdapter) ValidateServerConfig(name string, config ServerConfig) error
- func (c *ClaudeCodeAdapter) WriteClaudeCodeConfig(config *ClaudeCodeConfig) error
- type ClaudeCodeConfig
- type Config
- type ConfigChange
- type ConfigChangeEvent
- type ConfigChangeHandler
- type ConfigTransformer
- type ConflictSettings
- type DefaultProjectDetector
- type DefaultValidator
- type Destination
- type DirectTransformer
- type Engine
- type ErrorEvent
- type ErrorHandler
- type EventType
- type ExportFormat
- type FileChange
- type FileDestination
- func (f *FileDestination) Backup() (string, error)
- func (f *FileDestination) Exists() bool
- func (f *FileDestination) GetDescription() string
- func (f *FileDestination) GetID() string
- func (f *FileDestination) Read() ([]byte, error)
- func (f *FileDestination) SupportsBackup() bool
- func (f *FileDestination) Transform(config *Config) (interface{}, error)
- func (f *FileDestination) Write(data []byte) error
- type FileStorage
- func (fs *FileStorage) Delete(key string) error
- func (fs *FileStorage) GetBasePath() string
- func (fs *FileStorage) List(prefix string) ([]string, error)
- func (fs *FileStorage) Read(key string) ([]byte, error)
- func (fs *FileStorage) Watch(key string, handler func([]byte)) (func(), error)
- func (fs *FileStorage) Write(key string, data []byte) error
- type FlatTransformer
- type ImportFormat
- type ImportOptions
- type ImportResult
- type InternalMetadata
- type LogLevel
- type MCPConfig
- type MCPInput
- type MCPVersion
- type MCPWrapper
- type MemoryStorage
- func (ms *MemoryStorage) Delete(key string) error
- func (ms *MemoryStorage) List(prefix string) ([]string, error)
- func (ms *MemoryStorage) Read(key string) ([]byte, error)
- func (ms *MemoryStorage) Watch(key string, handler func([]byte)) (func(), error)
- func (ms *MemoryStorage) Write(key string, data []byte) error
- type MultiSyncResult
- type NameSanitizer
- type NestedTransformer
- type NoOpSanitizer
- type Option
- type PatternValidator
- type ProjectConfig
- type ProjectDetector
- type ProjectInfo
- type ProjectScanSettings
- type ProjectSettings
- type ReplacementSanitizer
- type ServerChangeEvent
- type ServerConfig
- type ServerFilter
- type ServerInfo
- type ServerValidator
- type ServerWithMetadata
- type Settings
- type Storage
- type StorageKeys
- func (StorageKeys) AutoSyncState() string
- func (StorageKeys) Backup(id string) string
- func (StorageKeys) BackupList() string
- func (StorageKeys) Config() string
- func (StorageKeys) LastSync(target string) string
- func (StorageKeys) Project(path string) string
- func (StorageKeys) ProjectCache(path string) string
- func (StorageKeys) ServerCache() string
- func (StorageKeys) Target(name string) string
- type SyncCompleteHandler
- type SyncError
- type SyncEvent
- type SyncManager
- func (sm *SyncManager) PreviewSync(targetName string) (*SyncPreview, error)
- func (sm *SyncManager) SyncToAllTargets(ctx context.Context, options SyncOptions) (*MultiSyncResult, error)
- func (sm *SyncManager) SyncToTarget(ctx context.Context, targetName string, options SyncOptions) (*SyncResult, error)
- type SyncOptions
- type SyncPreview
- type SyncResult
- type SyncSettings
- type TargetConfig
- type TargetInfo
- type ValidationSettings
Constants ΒΆ
const ( DefaultWatchInterval = 1000 // milliseconds DefaultDebounceDelay = 500 // milliseconds DefaultMaxBackups = 10 DefaultMaxSyncWorkers = 5 DefaultConfigVersion = "1.0.2" )
Default configuration values
const ( ClaudeConfigFile = ".claude.json" MCPConfigFile = ".mcp.json" BackupExtension = ".backup" )
File patterns
const ( ErrServerNotFound = "server not found" ErrTargetNotFound = "target not found" ErrInvalidTransport = "invalid transport type" ErrInvalidServerName = "invalid server name" ErrDuplicateServer = "server already exists" )
Error messages
const ( ChangeTypeAdd = "add" ChangeTypeUpdate = "update" ChangeTypeDelete = "remove" )
Change type constants
Variables ΒΆ
var Keys = StorageKeys{}
Functions ΒΆ
func ExportStorage ΒΆ
ExportStorage exports all data to a writer
func FormatToolName ΒΆ
FormatToolName formats a tool name according to Claude Code conventions MCP tools follow pattern: mcp__<serverName>__<toolName>
func HandleDuplicateName ΒΆ
HandleDuplicateName generates unique name by appending number
func ImportStorage ΒΆ
ImportStorage imports data from a reader
func ParseToolName ΒΆ
ParseToolName parses a Claude Code tool name
func SanitizeServerName ΒΆ
SanitizeServerName sanitizes a server name
func ValidateServer ΒΆ
func ValidateServer(name string, config ServerConfig) error
ValidateServer validates a server configuration
Types ΒΆ
type AutoSyncConfig ΒΆ
type AutoSyncConfig struct { Enabled bool `json:"enabled"` WatchInterval time.Duration `json:"watchInterval"` DebounceDelay time.Duration `json:"debounceDelay"` TargetWhitelist []string `json:"targetWhitelist,omitempty"` TargetBlacklist []string `json:"targetBlacklist,omitempty"` IgnorePatterns []string `json:"ignorePatterns"` }
AutoSyncConfig configures automatic synchronization
type AutoSyncSettings ΒΆ
type AutoSyncSettings struct { Enabled bool `json:"enabled"` WatchInterval time.Duration `json:"watchInterval,omitempty"` DebounceDelay time.Duration `json:"debounceDelay,omitempty"` Destinations []string `json:"destinations,omitempty"` }
AutoSyncSettings controls automatic synchronization
type AutoSyncStatus ΒΆ
type AutoSyncStatus struct { Enabled bool `json:"enabled"` Running bool `json:"running"` LastSync time.Time `json:"lastSync,omitempty"` NextSync time.Time `json:"nextSync,omitempty"` WatchInterval time.Duration `json:"watchInterval"` }
AutoSyncStatus represents auto-sync state
type BackupEvent ΒΆ added in v0.1.3
type BackupEvent struct {
BackupInfo BackupInfo
}
type BackupInfo ΒΆ
type BackupInfo struct { ID string `json:"id"` Path string `json:"path"` Timestamp time.Time `json:"timestamp"` Size int64 `json:"size"` Type string `json:"type"` // "manual", "auto", "pre-sync" Description string `json:"description,omitempty"` }
BackupInfo contains backup details
type BackupSettings ΒΆ
type BackupSettings struct { Enabled bool `json:"enabled"` MaxBackups int `json:"maxBackups,omitempty"` BackupPath string `json:"backupPath,omitempty"` Location string `json:"location,omitempty"` // Alternative to BackupPath BeforeSync bool `json:"beforeSync,omitempty"` Compression bool `json:"compression,omitempty"` }
BackupSettings controls backup behavior
type Change ΒΆ
type Change struct { Type string `json:"type"` // "add", "update", "remove" Server string `json:"server"` Description string `json:"description,omitempty"` Before interface{} `json:"before,omitempty"` After interface{} `json:"after,omitempty"` }
Change represents a configuration change
type ClaudeCodeAdapter ΒΆ
type ClaudeCodeAdapter struct {
// contains filtered or unexported fields
}
ClaudeCodeAdapter provides integration with Claude Code
func NewClaudeCodeAdapter ΒΆ
func NewClaudeCodeAdapter() (*ClaudeCodeAdapter, error)
NewClaudeCodeAdapter creates a new Claude Code adapter
func (*ClaudeCodeAdapter) GetAllowedTools ΒΆ
func (c *ClaudeCodeAdapter) GetAllowedTools(projectPath string) ([]string, error)
GetAllowedTools extracts allowed tools from Claude Code configuration
func (*ClaudeCodeAdapter) ReadClaudeCodeConfig ΒΆ
func (c *ClaudeCodeAdapter) ReadClaudeCodeConfig() (*ClaudeCodeConfig, error)
ReadClaudeCodeConfig reads the Claude Code configuration
func (*ClaudeCodeAdapter) TestMCPServer ΒΆ
func (c *ClaudeCodeAdapter) TestMCPServer(name string, config ServerConfig) error
TestMCPServer tests if an MCP server starts correctly
func (*ClaudeCodeAdapter) ValidateServerConfig ΒΆ
func (c *ClaudeCodeAdapter) ValidateServerConfig(name string, config ServerConfig) error
ValidateServerConfig validates a server config using Claude Code SDK
func (*ClaudeCodeAdapter) WriteClaudeCodeConfig ΒΆ
func (c *ClaudeCodeAdapter) WriteClaudeCodeConfig(config *ClaudeCodeConfig) error
WriteClaudeCodeConfig writes the Claude Code configuration
type ClaudeCodeConfig ΒΆ
type ClaudeCodeConfig struct { MCPServers map[string]ServerConfig `json:"mcpServers"` Projects map[string]ProjectSettings `json:"projects"` Theme string `json:"theme,omitempty"` }
ClaudeCodeConfig represents the full Claude Code configuration
type Config ΒΆ
type Config struct { Version string `json:"version"` Servers map[string]ServerWithMetadata `json:"servers"` Settings Settings `json:"settings,omitempty"` Targets map[string]TargetConfig `json:"targets,omitempty"` // Legacy field Metadata map[string]interface{} `json:"metadata,omitempty"` }
Config represents the MCP configuration Renamed from MasterConfig for clarity and brevity
func ParseMCPConfig ΒΆ added in v0.1.2
ParseMCPConfig attempts to parse various MCP configuration formats
type ConfigChange ΒΆ
type ConfigChange struct { Type string `json:"type"` // "server-added", "server-removed", "server-updated", "settings-changed" Name string `json:"name,omitempty"` Timestamp time.Time `json:"timestamp"` Source string `json:"source"` // "user", "sync", "import", "auto-sync" Details map[string]interface{} `json:"details,omitempty"` }
ConfigChange represents a configuration change event
type ConfigChangeEvent ΒΆ added in v0.1.3
Event data types
type ConfigTransformer ΒΆ
ConfigTransformer transforms configuration for specific formats
type ConflictSettings ΒΆ
type ConflictSettings struct {
Mode string `json:"mode"` // "interactive", "master-wins", "target-wins"
}
ConflictSettings controls conflict resolution behavior
type DefaultProjectDetector ΒΆ added in v0.1.7
type DefaultProjectDetector struct { // ConfigFiles are the files that indicate a project root ConfigFiles []string }
DefaultProjectDetector provides a basic implementation of ProjectDetector
func NewDefaultProjectDetector ΒΆ added in v0.1.7
func NewDefaultProjectDetector() *DefaultProjectDetector
NewDefaultProjectDetector creates a new default project detector
func (*DefaultProjectDetector) DetectProject ΒΆ added in v0.1.7
func (d *DefaultProjectDetector) DetectProject(path string) (*ProjectConfig, error)
DetectProject detects and creates a project configuration for the given path
func (*DefaultProjectDetector) IsProjectRoot ΒΆ added in v0.1.7
func (d *DefaultProjectDetector) IsProjectRoot(path string) bool
IsProjectRoot checks if the given path is a project root
type DefaultValidator ΒΆ
type DefaultValidator struct {
// contains filtered or unexported fields
}
DefaultValidator provides basic MCP validation rules
func NewDefaultValidator ΒΆ
func NewDefaultValidator() *DefaultValidator
NewDefaultValidator creates a validator with standard MCP rules
func (*DefaultValidator) ValidateConfig ΒΆ
func (v *DefaultValidator) ValidateConfig(config ServerConfig) error
ValidateConfig validates a server configuration
func (*DefaultValidator) ValidateName ΒΆ
func (v *DefaultValidator) ValidateName(name string) error
ValidateName validates a server name
type Destination ΒΆ
type Destination interface { // Identity GetID() string GetDescription() string // Configuration transformation Transform(config *Config) (interface{}, error) // IO operations Read() ([]byte, error) Write(data []byte) error Exists() bool // Optional features SupportsBackup() bool Backup() (string, error) }
Destination represents any sync target (file, API, etc.)
type DirectTransformer ΒΆ
type DirectTransformer struct{}
DirectTransformer returns config as-is
func (*DirectTransformer) Format ΒΆ
func (d *DirectTransformer) Format() string
func (*DirectTransformer) Transform ΒΆ
func (d *DirectTransformer) Transform(config *Config) (interface{}, error)
type Engine ΒΆ
type Engine interface { // Configuration Management LoadConfig(path string) error SaveConfig() error GetConfig() (*Config, error) SetConfig(config *Config) error // Server Management AddServer(name string, server ServerConfig) error UpdateServer(name string, server ServerConfig) error RemoveServer(name string) error GetServer(name string) (*ServerWithMetadata, error) ListServers(filter ServerFilter) ([]*ServerInfo, error) EnableServer(name string) error DisableServer(name string) error // Destination Management RegisterDestination(name string, dest Destination) error RemoveDestination(name string) error GetDestination(name string) (Destination, error) ListDestinations() map[string]Destination // Generic Sync Operations SyncTo(ctx context.Context, dest Destination, options SyncOptions) (*SyncResult, error) SyncToMultiple(ctx context.Context, dests []Destination, options SyncOptions) (*MultiSyncResult, error) PreviewSync(dest Destination) (*SyncPreview, error) // Import/Export (format agnostic) Export(format ExportFormat) ([]byte, error) Import(data []byte, format ImportFormat, options ImportOptions) error MergeConfigs(configs ...*Config) (*Config, error) // Validation (pluggable) SetValidator(validator ServerValidator) SetSanitizer(sanitizer NameSanitizer) ValidateServer(name string, server ServerConfig) error SanitizeName(name string) string // Project Management ScanForProjects(paths []string, detector ProjectDetector) ([]*ProjectConfig, error) RegisterProject(path string, config ProjectConfig) error GetProjectConfig(path string) (*ProjectConfig, error) ListProjects() ([]*ProjectInfo, error) // Auto-sync Management StartAutoSync(config AutoSyncConfig) error StopAutoSync() error GetAutoSyncStatus() (*AutoSyncStatus, error) // Backup/Restore CreateBackup(description string) (*BackupInfo, error) ListBackups() ([]*BackupInfo, error) RestoreBackup(backupID string) error // Event Handling OnConfigChange(handler ConfigChangeHandler) func() OnSyncComplete(handler SyncCompleteHandler) func() OnError(handler ErrorHandler) func() }
Engine is a generic MCP server configuration manager
type ErrorEvent ΒΆ added in v0.1.3
type ErrorHandler ΒΆ
type ErrorHandler func(err error)
type EventType ΒΆ
type EventType string
EventType represents different event types in the system
const ( // Configuration Events EventConfigLoaded EventType = "config.loaded" EventConfigSaved EventType = "config.saved" EventServerAdded EventType = "server.added" EventServerUpdated EventType = "server.updated" EventServerRemoved EventType = "server.removed" // Sync Events EventSyncStarted EventType = "sync.started" EventSyncCompleted EventType = "sync.completed" EventSyncFailed EventType = "sync.failed" EventConflictDetected EventType = "sync.conflict" // Auto-Sync Events EventAutoSyncStarted EventType = "autosync.started" EventAutoSyncStopped EventType = "autosync.stopped" EventFileChanged EventType = "autosync.file.changed" // Project Events EventProjectDiscovered EventType = "project.discovered" EventProjectRegistered EventType = "project.registered" EventProjectRemoved EventType = "project.removed" // Error Events EventError EventType = "error" EventWarning EventType = "warning" // Additional Events EventConfigChanged EventType = "config.changed" EventBackupCreated EventType = "backup.created" EventBackupRestored EventType = "backup.restored" )
Event type constants
type ExportFormat ΒΆ
type ExportFormat string
ExportFormat represents supported export formats
const ( ExportFormatJSON ExportFormat = "json" ExportFormatYAML ExportFormat = "yaml" ExportFormatTOML ExportFormat = "toml" )
type FileChange ΒΆ
type FileChange struct { Path string `json:"path"` Type string `json:"type"` // "create", "modify", "delete" Timestamp time.Time `json:"timestamp"` }
FileChange represents a file system change
type FileDestination ΒΆ
type FileDestination struct { ID string Path string Format ExportFormat Transformer ConfigTransformer }
FileDestination is a generic file-based destination
func NewFileDestination ΒΆ
func NewFileDestination(id, path string, format ExportFormat) *FileDestination
NewFileDestination creates a new file destination
func (*FileDestination) Backup ΒΆ
func (f *FileDestination) Backup() (string, error)
Backup creates a backup of the current file
func (*FileDestination) Exists ΒΆ
func (f *FileDestination) Exists() bool
Exists checks if the destination exists
func (*FileDestination) GetDescription ΒΆ
func (f *FileDestination) GetDescription() string
GetDescription returns a human-readable description
func (*FileDestination) GetID ΒΆ
func (f *FileDestination) GetID() string
GetID returns the destination identifier
func (*FileDestination) Read ΒΆ
func (f *FileDestination) Read() ([]byte, error)
Read reads the current configuration
func (*FileDestination) SupportsBackup ΒΆ
func (f *FileDestination) SupportsBackup() bool
SupportsBackup returns true
func (*FileDestination) Transform ΒΆ
func (f *FileDestination) Transform(config *Config) (interface{}, error)
Transform converts the config to the appropriate format
func (*FileDestination) Write ΒΆ
func (f *FileDestination) Write(data []byte) error
Write writes the configuration
type FileStorage ΒΆ
type FileStorage struct {
// contains filtered or unexported fields
}
FileStorage implements Storage interface using filesystem
func NewFileStorage ΒΆ
func NewFileStorage(basePath string) (*FileStorage, error)
NewFileStorage creates a new file-based storage
func (*FileStorage) Delete ΒΆ
func (fs *FileStorage) Delete(key string) error
Delete removes data from storage
func (*FileStorage) GetBasePath ΒΆ
func (fs *FileStorage) GetBasePath() string
GetBasePath returns the base path of the file storage
func (*FileStorage) List ΒΆ
func (fs *FileStorage) List(prefix string) ([]string, error)
List lists keys with given prefix
func (*FileStorage) Read ΒΆ
func (fs *FileStorage) Read(key string) ([]byte, error)
Read reads data from storage
type FlatTransformer ΒΆ
type FlatTransformer struct {
WrapperKey string // e.g., "mcpServers"
}
FlatTransformer creates a flat structure
func (*FlatTransformer) Format ΒΆ
func (f *FlatTransformer) Format() string
func (*FlatTransformer) Transform ΒΆ
func (f *FlatTransformer) Transform(config *Config) (interface{}, error)
type ImportFormat ΒΆ
type ImportFormat string
ImportFormat represents supported import formats
const ( ImportFormatJSON ImportFormat = "json" ImportFormatYAML ImportFormat = "yaml" ImportFormatTOML ImportFormat = "toml" )
type ImportOptions ΒΆ
type ImportOptions struct { Overwrite bool `json:"overwrite"` OverwriteExisting bool `json:"overwriteExisting"` // Alias for Overwrite MergeStrategy string `json:"mergeStrategy"` // "replace", "merge", "skip" MergeMode string `json:"mergeMode"` // Alias for MergeStrategy ServerWhitelist []string `json:"serverWhitelist,omitempty"` ServerBlacklist []string `json:"serverBlacklist,omitempty"` ImportMetadata bool `json:"importMetadata"` SkipInvalid bool `json:"skipInvalid"` SubstituteEnvVars bool `json:"substituteEnvVars"` // Whether to replace ${ENV_VAR} patterns }
ImportOptions controls import behavior
type ImportResult ΒΆ
type ImportResult struct { Source string `json:"source"` ServersImported int `json:"serversImported"` ServersSkipped int `json:"serversSkipped"` ServersUpdated int `json:"serversUpdated"` Errors []string `json:"errors,omitempty"` }
ImportResult contains the outcome of an import operation
type InternalMetadata ΒΆ
type InternalMetadata struct { Enabled bool `json:"enabled,omitempty"` LastSynced time.Time `json:"lastSynced,omitempty"` LastModified time.Time `json:"lastModified,omitempty"` Source string `json:"source,omitempty"` CreatedBy string `json:"createdBy,omitempty"` Version string `json:"version,omitempty"` SyncTargets []string `json:"syncTargets,omitempty"` ExcludeFromTargets []string `json:"excludeFromTargets,omitempty"` Tags []string `json:"tags,omitempty"` ProjectPath string `json:"projectPath,omitempty"` ProjectSpecific bool `json:"projectSpecific,omitempty"` ErrorCount int `json:"errorCount,omitempty"` }
InternalMetadata contains engine-specific metadata
type MCPConfig ΒΆ added in v0.1.2
type MCPConfig struct { MCP *MCPWrapper `json:"mcp,omitempty"` // Also support direct mcpServers for Claude/Cursor format MCPServers map[string]ServerConfig `json:"mcpServers,omitempty"` // And direct servers for simpler formats Servers map[string]ServerConfig `json:"servers,omitempty"` }
MCPConfig represents the newer MCP configuration format with inputs support
type MCPInput ΒΆ added in v0.1.2
type MCPInput struct { Type string `json:"type"` // "promptString", "promptNumber", etc. ID string `json:"id"` // Variable identifier Description string `json:"description"` // Human-readable description Default string `json:"default,omitempty"` // Default value Password bool `json:"password,omitempty"` // Hide input (for secrets) Required bool `json:"required,omitempty"` // Is this input required? }
MCPInput defines an input variable for MCP configurations
type MCPVersion ΒΆ added in v0.1.2
type MCPVersion string
MCPVersion represents different MCP protocol versions
const ( MCPVersion20241105 MCPVersion = "2024-11-05" MCPVersion20250326 MCPVersion = "2025-03-26" MCPVersionDraft MCPVersion = "draft" )
type MCPWrapper ΒΆ added in v0.1.2
type MCPWrapper struct { Inputs []MCPInput `json:"inputs,omitempty"` Servers map[string]ServerConfig `json:"servers"` }
MCPWrapper contains the MCP-specific configuration
type MemoryStorage ΒΆ
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage implements Storage interface in memory
func NewMemoryStorage ΒΆ
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage creates a new memory-based storage
func (*MemoryStorage) Delete ΒΆ
func (ms *MemoryStorage) Delete(key string) error
Delete removes data from memory
func (*MemoryStorage) List ΒΆ
func (ms *MemoryStorage) List(prefix string) ([]string, error)
List lists keys with given prefix
func (*MemoryStorage) Read ΒΆ
func (ms *MemoryStorage) Read(key string) ([]byte, error)
Read reads data from memory
type MultiSyncResult ΒΆ
type MultiSyncResult struct { Results []SyncResult `json:"results"` TotalDuration time.Duration `json:"totalDuration"` SuccessCount int `json:"successCount"` FailureCount int `json:"failureCount"` }
MultiSyncResult aggregates multiple sync results
type NameSanitizer ΒΆ
NameSanitizer can sanitize server names
type NestedTransformer ΒΆ
type NestedTransformer struct { RootKey string // e.g., "mcp" ServersKey string // e.g., "servers" }
NestedTransformer creates a nested structure
func (*NestedTransformer) Format ΒΆ
func (n *NestedTransformer) Format() string
func (*NestedTransformer) Transform ΒΆ
func (n *NestedTransformer) Transform(config *Config) (interface{}, error)
type NoOpSanitizer ΒΆ
type NoOpSanitizer struct{}
NoOpSanitizer doesn't modify names
func (*NoOpSanitizer) NeedsSanitization ΒΆ
func (n *NoOpSanitizer) NeedsSanitization(name string) bool
NeedsSanitization always returns false
func (*NoOpSanitizer) Sanitize ΒΆ
func (n *NoOpSanitizer) Sanitize(name string) string
Sanitize returns the name unchanged
type Option ΒΆ
type Option func(*engineConfig) error
Option configuration
func WithDefaultTargets ΒΆ
func WithDefaultTargets() Option
func WithFileStorage ΒΆ
func WithMemoryStorage ΒΆ added in v0.1.2
func WithMemoryStorage() Option
func WithStorage ΒΆ
type PatternValidator ΒΆ
type PatternValidator struct {
// contains filtered or unexported fields
}
PatternValidator validates names against a regex pattern
func NewPatternValidator ΒΆ
func NewPatternValidator(pattern string, maxLength int) (*PatternValidator, error)
NewPatternValidator creates a validator with a custom pattern
func (*PatternValidator) ValidateConfig ΒΆ
func (p *PatternValidator) ValidateConfig(config ServerConfig) error
ValidateConfig delegates to default validator
func (*PatternValidator) ValidateName ΒΆ
func (p *PatternValidator) ValidateName(name string) error
ValidateName validates against the pattern
type ProjectConfig ΒΆ
type ProjectConfig struct { Name string `json:"name"` Path string `json:"path"` Servers map[string]ServerWithMetadata `json:"servers,omitempty"` Destinations []string `json:"destinations,omitempty"` AutoSync bool `json:"autoSync,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
ProjectConfig represents project-specific configuration
type ProjectDetector ΒΆ
type ProjectDetector interface { DetectProject(path string) (*ProjectConfig, error) IsProjectRoot(path string) bool }
ProjectDetector can detect project configurations
type ProjectInfo ΒΆ
type ProjectInfo struct { Name string `json:"name"` Path string `json:"path"` ServerCount int `json:"serverCount"` Servers []string `json:"servers,omitempty"` }
ProjectInfo contains project information
type ProjectScanSettings ΒΆ
type ProjectScanSettings struct { Enabled bool `json:"enabled"` ScanPaths []string `json:"scanPaths,omitempty"` ExcludePaths []string `json:"excludePaths,omitempty"` MaxDepth int `json:"maxDepth,omitempty"` }
ProjectScanSettings controls project scanning behavior
type ProjectSettings ΒΆ
type ProjectSettings struct { MCPServers map[string]ServerConfig `json:"mcpServers,omitempty"` AllowedTools []string `json:"allowedTools,omitempty"` DisabledMCPJSONServers []string `json:"disabledMcpjsonServers,omitempty"` EnabledMCPJSONServers []string `json:"enabledMcpjsonServers,omitempty"` EnableAllProjectMCPServers bool `json:"enableAllProjectMcpServers,omitempty"` DontCrawlDirectory bool `json:"dontCrawlDirectory,omitempty"` }
ProjectSettings represents Claude Code project-specific settings
type ReplacementSanitizer ΒΆ
type ReplacementSanitizer struct {
// contains filtered or unexported fields
}
ReplacementSanitizer sanitizes names by replacing characters
func NewReplacementSanitizer ΒΆ
func NewReplacementSanitizer(replacements map[string]string, removeChars string, maxLength int) *ReplacementSanitizer
NewReplacementSanitizer creates a sanitizer with custom replacements
func (*ReplacementSanitizer) NeedsSanitization ΒΆ
func (r *ReplacementSanitizer) NeedsSanitization(name string) bool
NeedsSanitization checks if sanitization would change the name
func (*ReplacementSanitizer) Sanitize ΒΆ
func (r *ReplacementSanitizer) Sanitize(name string) string
Sanitize applies replacements and removals
type ServerChangeEvent ΒΆ added in v0.1.3
type ServerChangeEvent struct { ServerName string Server ServerWithMetadata ChangeType string }
type ServerConfig ΒΆ
type ServerConfig struct { Transport string `json:"transport"` // "stdio" or "sse" Command string `json:"command,omitempty"` Args []string `json:"args,omitempty"` Env map[string]string `json:"env,omitempty"` URL string `json:"url,omitempty"` Headers map[string]string `json:"headers,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
ServerConfig represents a basic server configuration
func SubstituteVariables ΒΆ added in v0.1.2
func SubstituteVariables(config ServerConfig, inputs map[string]string, env map[string]string) ServerConfig
SubstituteVariables replaces ${input:xxx} and ${ENV_VAR} in server configs
type ServerFilter ΒΆ
type ServerFilter struct { Enabled *bool `json:"enabled,omitempty"` Transport string `json:"transport,omitempty"` SyncTargets []string `json:"syncTargets,omitempty"` ProjectSpecific *bool `json:"projectSpecific,omitempty"` Source string `json:"source,omitempty"` NamePattern string `json:"namePattern,omitempty"` }
ServerFilter for listing servers
type ServerInfo ΒΆ
type ServerInfo struct { Name string `json:"name"` Config ServerConfig `json:"config"` Transport string `json:"transport,omitempty"` Enabled bool `json:"enabled"` Internal InternalMetadata `json:"internal,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` SyncTargetCount int `json:"syncTargetCount,omitempty"` LastModified time.Time `json:"lastModified,omitempty"` HasErrors bool `json:"hasErrors,omitempty"` }
ServerInfo contains detailed server information
type ServerValidator ΒΆ
type ServerValidator interface { ValidateName(name string) error ValidateConfig(config ServerConfig) error ValidateServerConfig(name string, config ServerConfig) error }
ServerValidator can validate server configurations
type ServerWithMetadata ΒΆ
type ServerWithMetadata struct { ServerConfig Internal InternalMetadata `json:"internal,omitempty"` }
ServerWithMetadata includes internal metadata
type Settings ΒΆ
type Settings struct { AutoSync AutoSyncSettings `json:"autoSync,omitempty"` Backup BackupSettings `json:"backup,omitempty"` Sync SyncSettings `json:"sync,omitempty"` ConflictResolution ConflictSettings `json:"conflictResolution,omitempty"` ProjectScanning ProjectScanSettings `json:"projectScanning,omitempty"` Validation ValidationSettings `json:"validation,omitempty"` DefaultTransport string `json:"defaultTransport,omitempty"` Projects map[string]ProjectConfig `json:"projects,omitempty"` }
Settings contains global configuration settings Renamed from GlobalSettings for brevity
type Storage ΒΆ
type Storage interface { Read(key string) ([]byte, error) Write(key string, data []byte) error Delete(key string) error List(prefix string) ([]string, error) Watch(key string, handler func([]byte)) (func(), error) }
Storage interface for persistence layer abstraction
type StorageKeys ΒΆ
type StorageKeys struct{}
StorageKeys defines standard storage keys
func (StorageKeys) AutoSyncState ΒΆ
func (StorageKeys) AutoSyncState() string
func (StorageKeys) Backup ΒΆ
func (StorageKeys) Backup(id string) string
func (StorageKeys) BackupList ΒΆ
func (StorageKeys) BackupList() string
func (StorageKeys) Config ΒΆ
func (StorageKeys) Config() string
func (StorageKeys) LastSync ΒΆ
func (StorageKeys) LastSync(target string) string
func (StorageKeys) Project ΒΆ
func (StorageKeys) Project(path string) string
func (StorageKeys) ProjectCache ΒΆ
func (StorageKeys) ProjectCache(path string) string
func (StorageKeys) ServerCache ΒΆ
func (StorageKeys) ServerCache() string
func (StorageKeys) Target ΒΆ
func (StorageKeys) Target(name string) string
type SyncCompleteHandler ΒΆ
type SyncCompleteHandler func(result SyncResult)
type SyncEvent ΒΆ added in v0.1.3
type SyncEvent struct {
Result SyncResult
}
type SyncManager ΒΆ
type SyncManager struct {
// contains filtered or unexported fields
}
SyncManager handles synchronization operations
func NewSyncManager ΒΆ
func NewSyncManager(engine *engineImpl) *SyncManager
NewSyncManager creates a new sync manager
func (*SyncManager) PreviewSync ΒΆ
func (sm *SyncManager) PreviewSync(targetName string) (*SyncPreview, error)
PreviewSync previews what changes would be made
func (*SyncManager) SyncToAllTargets ΒΆ
func (sm *SyncManager) SyncToAllTargets(ctx context.Context, options SyncOptions) (*MultiSyncResult, error)
SyncToAllTargets synchronizes to all enabled targets
func (*SyncManager) SyncToTarget ΒΆ
func (sm *SyncManager) SyncToTarget(ctx context.Context, targetName string, options SyncOptions) (*SyncResult, error)
SyncToTarget synchronizes configuration to a specific target
type SyncOptions ΒΆ
type SyncOptions struct { DryRun bool `json:"dryRun,omitempty"` Force bool `json:"force,omitempty"` CreateBackup bool `json:"createBackup,omitempty"` BackupFirst bool `json:"backupFirst,omitempty"` // Alias for CreateBackup IncludeDisabled bool `json:"includeDisabled,omitempty"` ServerFilter []string `json:"serverFilter,omitempty"` DestinationConfig map[string]string `json:"destinationConfig,omitempty"` Verbose bool `json:"verbose,omitempty"` }
SyncOptions controls a synchronization operation
type SyncPreview ΒΆ
type SyncPreview struct { Destination string `json:"destination"` Changes []Change `json:"changes"` EstimatedTime time.Duration `json:"estimatedTime"` RequiresBackup bool `json:"requiresBackup"` HasConflicts bool `json:"hasConflicts"` }
SyncPreview shows what will happen in a sync
type SyncResult ΒΆ
type SyncResult struct { Target string `json:"target,omitempty"` // Legacy field for compatibility Destination string `json:"destination"` Success bool `json:"success"` ServersAdded int `json:"serversAdded"` ServersUpdated int `json:"serversUpdated"` ServersRemoved int `json:"serversRemoved"` Changes []Change `json:"changes,omitempty"` Errors []SyncError `json:"errors,omitempty"` BackupPath string `json:"backupPath,omitempty"` ConfigPath string `json:"configPath,omitempty"` Duration time.Duration `json:"duration"` Timestamp time.Time `json:"timestamp"` }
SyncResult represents the outcome of a sync operation
type SyncSettings ΒΆ
type SyncSettings struct { Strategy string `json:"strategy,omitempty"` // "merge", "replace", "selective" ConflictResolution string `json:"conflictResolution,omitempty"` // "master-wins", "target-wins", "manual" PreserveMissing bool `json:"preserveMissing,omitempty"` BatchSize int `json:"batchSize,omitempty"` Timeout time.Duration `json:"timeout,omitempty"` }
SyncSettings controls synchronization behavior
type TargetConfig ΒΆ
type TargetConfig struct { Name string `json:"name"` Type string `json:"type"` Enabled bool `json:"enabled"` ConfigPath string `json:"configPath"` RequiresSanitization bool `json:"requiresSanitization"` SupportsProjects bool `json:"supportsProjects"` ConfigFormat string `json:"configFormat"` ServerNamePattern string `json:"serverNamePattern,omitempty"` }
TargetConfig represents legacy target configuration
Source Files
ΒΆ
Directories
ΒΆ
Path | Synopsis |
---|---|
cmd
|
|
daemon
command
|
|
examples
|
|
basic_usage
command
|
|
redis_storage
command
|
|
github.com
|
|
Package presets provides common MCP destination configurations This is separate from the core engine and completely optional
|
Package presets provides common MCP destination configurations This is separate from the core engine and completely optional |
storage
|
|
redis
Package redis provides a Redis-based storage implementation for the Agent Master Engine.
|
Package redis provides a Redis-based storage implementation for the Agent Master Engine. |