Documentation
¶
Index ¶
- Constants
- func ComponentsSummary(components PluginComponents) string
- func GetPluginAgentsDir(pluginPath string) string
- func GetPluginCommandsDir(pluginPath string) string
- func GetPluginHooksDir(pluginPath string) string
- func GetPluginMCPPath(pluginPath string) string
- func GetPluginManifestPath(pluginPath string) string
- func GetPluginSkillsDir(pluginPath string) string
- func GetPluginsDir() (string, error)
- func IsPluginDir(path string) bool
- type DefaultPluginManager
- func (m *DefaultPluginManager) Check() ([]PluginStatus, error)
- func (m *DefaultPluginManager) Get(name string) (*Plugin, error)
- func (m *DefaultPluginManager) Install(source string) (*Plugin, error)
- func (m *DefaultPluginManager) List() ([]Plugin, error)
- func (m *DefaultPluginManager) Remove(name string) error
- type Plugin
- type PluginAuthor
- type PluginComponents
- type PluginManager
- type PluginManifest
- type PluginStatus
- type Registry
- type RegistryPlugin
- type SourceInfo
- type SourceType
Constants ¶
const DefaultRegistryURL = "https://raw.githubusercontent.com/agentsdance/agentx/master/registry/plugins.json"
DefaultRegistryURL is the default URL for the plugin registry
Variables ¶
This section is empty.
Functions ¶
func ComponentsSummary ¶
func ComponentsSummary(components PluginComponents) string
ComponentsSummary returns a human-readable summary of components
func GetPluginAgentsDir ¶
GetPluginAgentsDir returns the path to the agents directory
func GetPluginCommandsDir ¶
GetPluginCommandsDir returns the path to the commands directory
func GetPluginHooksDir ¶
GetPluginHooksDir returns the path to the hooks directory
func GetPluginMCPPath ¶
GetPluginMCPPath returns the path to .mcp.json
func GetPluginManifestPath ¶
GetPluginManifestPath returns the path to plugin.json for a plugin
func GetPluginSkillsDir ¶
GetPluginSkillsDir returns the path to the skills directory
func GetPluginsDir ¶
GetPluginsDir returns the plugins directory path (~/.agentx/plugins)
func IsPluginDir ¶
IsPluginDir checks if a directory is a valid plugin directory
Types ¶
type DefaultPluginManager ¶
type DefaultPluginManager struct{}
DefaultPluginManager implements PluginManager
func NewPluginManager ¶
func NewPluginManager() *DefaultPluginManager
NewPluginManager creates a new plugin manager
func (*DefaultPluginManager) Check ¶
func (m *DefaultPluginManager) Check() ([]PluginStatus, error)
Check verifies plugins installation status
func (*DefaultPluginManager) Get ¶
func (m *DefaultPluginManager) Get(name string) (*Plugin, error)
Get retrieves a plugin by name
func (*DefaultPluginManager) Install ¶
func (m *DefaultPluginManager) Install(source string) (*Plugin, error)
Install installs a plugin from a source
func (*DefaultPluginManager) List ¶
func (m *DefaultPluginManager) List() ([]Plugin, error)
List returns all installed plugins
func (*DefaultPluginManager) Remove ¶
func (m *DefaultPluginManager) Remove(name string) error
Remove removes a plugin by name
type Plugin ¶
type Plugin struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author PluginAuthor `json:"author"`
Path string `json:"path"`
Source string `json:"source,omitempty"`
Components PluginComponents `json:"components"`
}
Plugin represents an installed plugin
type PluginAuthor ¶
type PluginAuthor struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
URL string `json:"url,omitempty"`
}
PluginAuthor represents the author of a plugin
type PluginComponents ¶
type PluginComponents struct {
Commands []string `json:"commands,omitempty"`
Agents []string `json:"agents,omitempty"`
Skills []string `json:"skills,omitempty"`
Hooks []string `json:"hooks,omitempty"`
MCPServers []string `json:"mcp_servers,omitempty"`
}
PluginComponents represents what a plugin provides
type PluginManager ¶
type PluginManager interface {
// List returns all installed plugins
List() ([]Plugin, error)
// Install installs a plugin from a source
Install(source string) (*Plugin, error)
// Remove removes a plugin by name
Remove(name string) error
// Check verifies plugins installation status
Check() ([]PluginStatus, error)
// Get retrieves a plugin by name
Get(name string) (*Plugin, error)
}
PluginManager handles plugin operations
type PluginManifest ¶
type PluginManifest struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author PluginAuthor `json:"author"`
}
PluginManifest represents the plugin.json manifest file
type PluginStatus ¶
PluginStatus represents the health status of a plugin
type Registry ¶
type Registry struct {
Plugins []RegistryPlugin `json:"plugins"`
}
Registry represents the plugin registry
type RegistryPlugin ¶
type RegistryPlugin struct {
Name string `json:"name"`
Description string `json:"description"`
Source string `json:"source"`
Version string `json:"version"`
Author string `json:"author"`
Components []string `json:"components"` // Summary like ["commands", "skills", "mcp"]
}
RegistryPlugin represents a plugin entry in the registry
func FetchRegistry ¶
func FetchRegistry() ([]RegistryPlugin, error)
FetchRegistry fetches the plugin registry from the default URL
func FetchRegistryFromURL ¶
func FetchRegistryFromURL(registryURL string) ([]RegistryPlugin, error)
FetchRegistryFromURL fetches the plugin registry from a specific URL
func FetchRegistryWithFallback ¶
func FetchRegistryWithFallback() ([]RegistryPlugin, error)
FetchRegistryWithFallback tries to fetch from network, falls back to cache, then to local file
func GetCachedRegistry ¶
func GetCachedRegistry() ([]RegistryPlugin, error)
GetCachedRegistry returns the cached registry if available
func GetLocalRegistry ¶
func GetLocalRegistry() ([]RegistryPlugin, error)
GetLocalRegistry reads the registry from the local bundled file
type SourceInfo ¶
type SourceInfo struct {
Type SourceType
Path string // Local path (absolute)
RepoURL string // Git repository URL
Fragment string // Plugin name for repo#plugin-name format
PluginPath string // Path within repo (for tree URLs)
}
SourceInfo contains parsed source information
func ParseSource ¶
func ParseSource(source string) (*SourceInfo, error)
ParseSource parses a plugin source string into SourceInfo
func (*SourceInfo) IsGitSource ¶
func (s *SourceInfo) IsGitSource() bool
IsGitSource returns true if the source is a git repository
func (*SourceInfo) IsLocalSource ¶
func (s *SourceInfo) IsLocalSource() bool
IsLocalSource returns true if the source is a local path
type SourceType ¶
type SourceType int
SourceType represents the type of plugin source
const ( // SourceTypeLocal is a local filesystem path SourceTypeLocal SourceType = iota // SourceTypeGitRepo is a git repository URL SourceTypeGitRepo // SourceTypeGitRepoWithFragment is a git URL with #plugin-name fragment SourceTypeGitRepoWithFragment )