plugins

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

func GetPluginAgentsDir(pluginPath string) string

GetPluginAgentsDir returns the path to the agents directory

func GetPluginCommandsDir

func GetPluginCommandsDir(pluginPath string) string

GetPluginCommandsDir returns the path to the commands directory

func GetPluginHooksDir

func GetPluginHooksDir(pluginPath string) string

GetPluginHooksDir returns the path to the hooks directory

func GetPluginMCPPath

func GetPluginMCPPath(pluginPath string) string

GetPluginMCPPath returns the path to .mcp.json

func GetPluginManifestPath

func GetPluginManifestPath(pluginPath string) string

GetPluginManifestPath returns the path to plugin.json for a plugin

func GetPluginSkillsDir

func GetPluginSkillsDir(pluginPath string) string

GetPluginSkillsDir returns the path to the skills directory

func GetPluginsDir

func GetPluginsDir() (string, error)

GetPluginsDir returns the plugins directory path (~/.agentx/plugins)

func IsPluginDir

func IsPluginDir(path string) bool

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

type PluginStatus struct {
	Plugin Plugin
	Valid  bool
	Error  error
	Issues []string
}

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL