Documentation
¶
Index ¶
- func DirExists(path string) bool
- func EnsureDir(path string) error
- func ExpandPath(path string) (string, error)
- func FileExists(path string) bool
- func IsExecutable(path string) bool
- func ValidateBinaryPath(path string) error
- func ValidateOutputFormat(format string) error
- type HealthStatus
- type Integration
- type IntegrationConfig
- type IntegrationsConfig
- type OutputFormat
- type Registry
- func (r *Registry) Count() int
- func (r *Registry) DetectAvailable() []Integration
- func (r *Registry) DetectEnabled() []Integration
- func (r *Registry) Exists(name string) bool
- func (r *Registry) Get(name string) (Integration, error)
- func (r *Registry) List() []Integration
- func (r *Registry) Names() []string
- func (r *Registry) Register(integration Integration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath expands ~ to the user's home directory
func FileExists ¶
FileExists checks if a file exists at the given path
func ValidateBinaryPath ¶
ValidateBinaryPath validates that a binary path exists and is executable
func ValidateOutputFormat ¶
ValidateOutputFormat checks if the given format string is valid
Types ¶
type HealthStatus ¶
type HealthStatus struct {
// Healthy indicates if the integration is functioning correctly
Healthy bool
// Status is a human-readable status message
Status string
// Details provides additional information about the health check
Details map[string]any
// LastChecked is the timestamp of the last health check
LastChecked string
}
HealthStatus represents the health status of an integration
type Integration ¶
type Integration interface {
// GetName returns the unique identifier for this integration (e.g., "claude-code-hook")
GetName() string
// GetDescription returns a human-readable description of the integration
GetDescription() string
// GetVersion returns the integration adapter version
GetVersion() string
// Detect checks if the agent framework is installed on the system
// Returns true if the framework's configuration directory/files exist
Detect() (bool, error)
// IsEnabled checks if this integration is currently configured and active
// Returns true if hooks/configuration have been set up
IsEnabled() (bool, error)
// Setup configures the integration by installing hooks or modifying framework config
// binaryPath is the path to the agentic-memorizer binary
// Returns error if setup fails
Setup(binaryPath string) error
// Update modifies an existing integration configuration
// Used when the binary path or integration settings change
// Returns error if update fails
Update(binaryPath string) error
// Remove uninstalls the integration by removing hooks or configuration
// Returns error if removal fails
Remove() error
// GetCommand returns the full command string that the framework should execute
// binaryPath is the path to the agentic-memorizer binary
// format is the desired output format (xml, markdown, json)
// Returns a command string like "agentic-memorizer read --format xml --integration claude-code-hook"
GetCommand(binaryPath string, format OutputFormat) string
// FormatOutput formats the file index for this specific integration
// Applies integration-specific wrapping (e.g., SessionStart JSON for Claude Code)
// index is the file memory index to format
// format is the base output format (xml, markdown, json)
// Returns formatted string ready for the framework to consume
FormatOutput(index *types.FileIndex, format OutputFormat) (string, error)
// FormatFactsOutput formats the facts index for this specific integration
// Applies integration-specific wrapping (e.g., UserPromptSubmit JSON for Claude Code)
// facts is the facts index to format
// format is the base output format (xml, markdown, json)
// Returns formatted string ready for the framework to consume
FormatFactsOutput(facts *types.FactsIndex, format OutputFormat) (string, error)
// Validate checks the health of the integration configuration
// Returns error if configuration is invalid or inconsistent
Validate() error
// Reload applies configuration changes without full teardown/setup
// newConfig contains the updated integration configuration
// Returns error if reload fails (caller should rollback)
Reload(newConfig IntegrationConfig) error
}
Integration defines the interface that all agent framework integrations must implement. Each integration adapter (e.g., Claude Code, Continue, Cline) provides framework-specific implementation for configuration management, output formatting, and lifecycle operations.
type IntegrationConfig ¶
type IntegrationConfig struct {
// Type is the integration type (e.g., "claude-code-hook", "continue", "cline")
Type string `mapstructure:"type" yaml:"type"`
// Enabled indicates if this integration is active
Enabled bool `mapstructure:"enabled" yaml:"enabled"`
// OutputFormat is the preferred output format for this integration
OutputFormat string `mapstructure:"output_format" yaml:"output_format"`
// Settings contains integration-specific settings
// For Claude Code: settings_path, matchers
// For Continue: config_path
// For Cline: config_path
Settings map[string]any `mapstructure:"settings" yaml:"settings"`
}
IntegrationConfig represents the configuration for a specific integration. This is stored in the main config file under the integrations section.
type IntegrationsConfig ¶
type IntegrationsConfig struct {
// Enabled is a list of integration names that are enabled
Enabled []string `mapstructure:"enabled" yaml:"enabled"`
}
IntegrationsConfig represents the complete integrations configuration section. The Enabled list tracks which integrations have been configured via setup commands. Integration-specific configuration (hooks, tools, etc.) is stored in framework-specific files (e.g., ~/.claude.json, ~/.claude/settings.json) rather than in this config file.
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the base format for rendering the memory index. This is distinct from integration-specific wrappers.
const ( // FormatXML renders the index as XML (existing format) FormatXML OutputFormat = "xml" // FormatJSON renders the index as JSON (new format - not the storage format) // This is a human-readable/agent-readable JSON representation FormatJSON OutputFormat = "json" )
func GetDefaultOutputFormat ¶
func GetDefaultOutputFormat() OutputFormat
GetDefaultOutputFormat returns the default output format
func ParseOutputFormat ¶
func ParseOutputFormat(format string) (OutputFormat, error)
ParseOutputFormat parses a string into an OutputFormat
func (OutputFormat) IsValid ¶
func (f OutputFormat) IsValid() bool
IsValid checks if the output format is valid
func (OutputFormat) String ¶
func (f OutputFormat) String() string
String returns the string representation of the output format
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all available integrations. It provides thread-safe registration, lookup, and discovery operations.
func GlobalRegistry ¶
func GlobalRegistry() *Registry
GlobalRegistry returns the singleton registry instance
func (*Registry) DetectAvailable ¶
func (r *Registry) DetectAvailable() []Integration
DetectAvailable returns all integrations that are detected on the system. This scans for frameworks by checking if their configuration directories/files exist.
func (*Registry) DetectEnabled ¶
func (r *Registry) DetectEnabled() []Integration
DetectEnabled returns all integrations that are currently enabled. This checks if the integration has been configured (hooks installed, etc).
func (*Registry) Get ¶
func (r *Registry) Get(name string) (Integration, error)
Get retrieves an integration by name. Returns error if the integration is not found.
func (*Registry) List ¶
func (r *Registry) List() []Integration
List returns all registered integrations. The returned slice is a copy and safe for concurrent use.
func (*Registry) Register ¶
func (r *Registry) Register(integration Integration)
Register adds an integration to the registry. If an integration with the same name already exists, it will be replaced.