Documentation
¶
Index ¶
- func ScheduleWithResult[T any](s *PluginScheduler, ctx context.Context, fn func(context.Context) (T, error)) (T, error)
- func ValidatePluginID(raw string) (string, error)
- func WrapServiceStart(pluginID, serviceName string, startFn func(ctx context.Context) error, ...) func(ctx context.Context) error
- func WrapServiceStop(pluginID, serviceName string, stopFn func(ctx context.Context) error, ...) func(ctx context.Context) error
- type Command
- type CommandHandler
- type Dependency
- type DependencyError
- type DependencyResolver
- type HTTPHandler
- type HTTPRequest
- type HTTPResponse
- type HookHandler
- type IsolatedPlugin
- func (p *IsolatedPlugin) ID() string
- func (p *IsolatedPlugin) Init(ctx context.Context, api PluginAPI) error
- func (p *IsolatedPlugin) IsNative() bool
- func (p *IsolatedPlugin) Manifest() *Manifest
- func (p *IsolatedPlugin) Start(ctx context.Context) error
- func (p *IsolatedPlugin) Stop(ctx context.Context) error
- type IsolatedService
- type IsolationConfig
- type JSBridge
- type Logger
- type Manifest
- type NativePlugin
- type Plugin
- type PluginAPI
- type PluginError
- type PluginInfo
- type PluginKind
- type PluginOrigin
- type PluginRestrictions
- type PluginSandbox
- type PluginScheduler
- type PluginStatus
- type Registry
- func (r *Registry) GetCommand(name string) *Command
- func (r *Registry) GetHTTPHandler(path string) HTTPHandler
- func (r *Registry) GetPlugin(id string) *PluginInfo
- func (r *Registry) GetPluginDependencies(pluginID string) []string
- func (r *Registry) GetPluginDependents(pluginID string) []string
- func (r *Registry) GetTool(name string) *Tool
- func (r *Registry) InitializePlugins(ctx context.Context) error
- func (r *Registry) ListCommands() []*Command
- func (r *Registry) ListPlugins() []*PluginInfo
- func (r *Registry) ListTools() []*Tool
- func (r *Registry) LoadPluginsFromDir(ctx context.Context, dir string) error
- func (r *Registry) RegisterNativePlugin(plugin NativePlugin) error
- func (r *Registry) ResolveDependencies() *ResolutionResult
- func (r *Registry) SetPluginStatus(id string, status PluginStatus) error
- func (r *Registry) StartPlugin(ctx context.Context, id string) error
- func (r *Registry) StartPlugins(ctx context.Context) error
- func (r *Registry) StopPlugin(ctx context.Context, id string) error
- func (r *Registry) StopPlugins(ctx context.Context) error
- func (r *Registry) TriggerHook(ctx context.Context, event string, data interface{}) error
- func (r *Registry) UnregisterPlugin(id string)
- type ResolutionResult
- type ResourceLimits
- type ResourceMonitor
- type ResourceStats
- type RestrictedPluginAPI
- func (a *RestrictedPluginAPI) GetResourceStats() *ResourceStats
- func (a *RestrictedPluginAPI) Logger() Logger
- func (a *RestrictedPluginAPI) PluginConfig() map[string]interface{}
- func (a *RestrictedPluginAPI) PluginID() string
- func (a *RestrictedPluginAPI) RegisterCommand(command Command) error
- func (a *RestrictedPluginAPI) RegisterHTTPHandler(path string, handler HTTPHandler) error
- func (a *RestrictedPluginAPI) RegisterHook(event string, handler HookHandler) error
- func (a *RestrictedPluginAPI) RegisterService(service Service) error
- func (a *RestrictedPluginAPI) RegisterTool(tool Tool) error
- type SandboxStats
- type Service
- type Store
- func (s *Store) GetPlugin(ctx context.Context, id string) (*StorePlugin, error)
- func (s *Store) InstallPlugin(ctx context.Context, id string) error
- func (s *Store) ListPlugins(ctx context.Context) ([]*StorePlugin, error)
- func (s *Store) SearchPlugins(ctx context.Context, query string) ([]*StorePlugin, error)
- func (s *Store) UninstallPlugin(ctx context.Context, id string) error
- type StoreConfig
- type StorePlugin
- type StoreSource
- type Tool
- type ToolHandler
- type UIHint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScheduleWithResult ¶
func ScheduleWithResult[T any](s *PluginScheduler, ctx context.Context, fn func(context.Context) (T, error)) (T, error)
ScheduleWithResult schedules a function for execution and returns a result
func ValidatePluginID ¶
Types ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Handler CommandHandler `json:"-"`
}
Command represents a custom command
type CommandHandler ¶
CommandHandler is the function signature for command handlers
func WrapCommandHandler ¶
func WrapCommandHandler(pluginID string, handler CommandHandler, timeout time.Duration) CommandHandler
WrapCommandHandler wraps a command handler with isolation
type Dependency ¶
type Dependency struct {
ID string `json:"id"` // Required plugin ID
Version string `json:"version,omitempty"` // Version constraint (semver)
Optional bool `json:"optional,omitempty"` // If true, plugin can work without this dependency
}
Dependency represents a plugin dependency
type DependencyError ¶
DependencyError represents a dependency resolution error
func (*DependencyError) Error ¶
func (e *DependencyError) Error() string
type DependencyResolver ¶
type DependencyResolver struct {
// contains filtered or unexported fields
}
DependencyResolver handles plugin dependency resolution
func NewDependencyResolver ¶
func NewDependencyResolver(plugins map[string]*PluginInfo) *DependencyResolver
NewDependencyResolver creates a new dependency resolver
func (*DependencyResolver) CheckDependenciesSatisfied ¶
func (r *DependencyResolver) CheckDependenciesSatisfied(pluginID string) (bool, []*DependencyError)
CheckDependenciesSatisfied checks if all dependencies of a plugin are satisfied
func (*DependencyResolver) GetDependencies ¶
func (r *DependencyResolver) GetDependencies(pluginID string) []string
GetDependencies returns the dependencies of a plugin
func (*DependencyResolver) GetDependents ¶
func (r *DependencyResolver) GetDependents(pluginID string) []string
GetDependents returns plugins that depend on the given plugin
func (*DependencyResolver) Resolve ¶
func (r *DependencyResolver) Resolve() *ResolutionResult
Resolve resolves dependencies and returns a topologically sorted order
type HTTPHandler ¶
type HTTPHandler func(ctx context.Context, req *HTTPRequest) (*HTTPResponse, error)
HTTPHandler is the function signature for HTTP handlers
func WrapHTTPHandler ¶
func WrapHTTPHandler(pluginID string, handler HTTPHandler, timeout time.Duration) HTTPHandler
WrapHTTPHandler wraps an HTTP handler with isolation
type HTTPRequest ¶
HTTPRequest represents an HTTP request
type HTTPResponse ¶
HTTPResponse represents an HTTP response
type HookHandler ¶
HookHandler is the function signature for hook handlers
func WrapHookHandler ¶
func WrapHookHandler(pluginID string, handler HookHandler, timeout time.Duration) HookHandler
WrapHookHandler wraps a hook handler with isolation
type IsolatedPlugin ¶
type IsolatedPlugin struct {
// contains filtered or unexported fields
}
IsolatedPlugin wraps a plugin with isolation
func NewIsolatedPlugin ¶
func NewIsolatedPlugin(plugin NativePlugin, config *IsolationConfig) *IsolatedPlugin
NewIsolatedPlugin creates a new isolated plugin wrapper
func (*IsolatedPlugin) ID ¶
func (p *IsolatedPlugin) ID() string
func (*IsolatedPlugin) Init ¶
func (p *IsolatedPlugin) Init(ctx context.Context, api PluginAPI) error
func (*IsolatedPlugin) IsNative ¶
func (p *IsolatedPlugin) IsNative() bool
func (*IsolatedPlugin) Manifest ¶
func (p *IsolatedPlugin) Manifest() *Manifest
type IsolatedService ¶
type IsolatedService struct {
// contains filtered or unexported fields
}
IsolatedService wraps a service with isolation
func NewIsolatedService ¶
func NewIsolatedService(service Service, pluginID string, config *IsolationConfig) *IsolatedService
NewIsolatedService creates a new isolated service wrapper
func (*IsolatedService) Name ¶
func (s *IsolatedService) Name() string
type IsolationConfig ¶
type IsolationConfig struct {
// InitTimeout is the maximum time allowed for plugin initialization
InitTimeout time.Duration
// StartTimeout is the maximum time allowed for plugin start
StartTimeout time.Duration
// StopTimeout is the maximum time allowed for plugin stop
StopTimeout time.Duration
// ToolTimeout is the maximum time allowed for tool execution
ToolTimeout time.Duration
// HookTimeout is the maximum time allowed for hook execution
HookTimeout time.Duration
// CommandTimeout is the maximum time allowed for command execution
CommandTimeout time.Duration
// HTTPTimeout is the maximum time allowed for HTTP handler execution
HTTPTimeout time.Duration
}
IsolationConfig configures plugin isolation behavior
func DefaultIsolationConfig ¶
func DefaultIsolationConfig() *IsolationConfig
DefaultIsolationConfig returns the default isolation configuration
type JSBridge ¶
type JSBridge struct {
// contains filtered or unexported fields
}
JSBridge handles loading and executing JavaScript/TypeScript plugins Note: JavaScript plugin support is disabled to reduce binary size. Use native Go plugins instead.
func NewJSBridge ¶
NewJSBridge creates a new JavaScript bridge
func (*JSBridge) LoadJSPlugin ¶
LoadJSPlugin loads a JavaScript plugin from a path Note: JavaScript plugin support is disabled to reduce binary size.
type Logger ¶
type Logger interface {
Debug(msg string, fields ...interface{})
Info(msg string, fields ...interface{})
Warn(msg string, fields ...interface{})
Error(msg string, fields ...interface{})
}
Logger interface for plugin logging
type Manifest ¶
type Manifest struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Author string `json:"author,omitempty"`
Kind PluginKind `json:"kind,omitempty"`
ConfigSchema map[string]interface{} `json:"configSchema"`
Channels []string `json:"channels,omitempty"`
Providers []string `json:"providers,omitempty"`
Skills []string `json:"skills,omitempty"`
UIHints map[string]UIHint `json:"uiHints,omitempty"`
Dependencies []Dependency `json:"dependencies,omitempty"`
}
Manifest represents the plugin manifest (clawdbot.plugin.json compatible)
type NativePlugin ¶
type NativePlugin interface {
Plugin
// IsNative returns true for native Go plugins
IsNative() bool
}
NativePlugin is the interface for Go native plugins
type Plugin ¶
type Plugin interface {
// ID returns the unique identifier of the plugin
ID() string
// Manifest returns the plugin manifest
Manifest() *Manifest
// Init initializes the plugin with the given API
Init(ctx context.Context, api PluginAPI) error
// Start starts the plugin
Start(ctx context.Context) error
// Stop stops the plugin
Stop(ctx context.Context) error
}
Plugin is the interface that all plugins must implement
type PluginAPI ¶
type PluginAPI interface {
// Plugin metadata
PluginID() string
PluginConfig() map[string]interface{}
// Tool registration
RegisterTool(tool Tool) error
// Hook registration
RegisterHook(event string, handler HookHandler) error
// Service registration
RegisterService(service Service) error
// Command registration
RegisterCommand(command Command) error
// HTTP handler registration
RegisterHTTPHandler(path string, handler HTTPHandler) error
// Logger
Logger() Logger
}
PluginAPI is the API provided to plugins for registration
type PluginError ¶
PluginError represents an error that occurred in a plugin
func (*PluginError) Error ¶
func (e *PluginError) Error() string
func (*PluginError) Unwrap ¶
func (e *PluginError) Unwrap() error
type PluginInfo ¶
type PluginInfo struct {
Manifest *Manifest `json:"manifest"`
Origin PluginOrigin `json:"origin"`
Status PluginStatus `json:"status"`
Path string `json:"path"`
Config map[string]interface{} `json:"config,omitempty"`
Error string `json:"error,omitempty"`
IsNative bool `json:"is_native"`
}
PluginInfo contains metadata about a loaded plugin
type PluginKind ¶
type PluginKind string
PluginKind represents the type of plugin
const ( PluginKindGeneral PluginKind = "" PluginKindMemory PluginKind = "memory" PluginKindChannel PluginKind = "channel" PluginKindTool PluginKind = "tool" )
type PluginOrigin ¶
type PluginOrigin string
PluginOrigin represents where the plugin was loaded from
const ( OriginBundled PluginOrigin = "bundled" OriginWorkspace PluginOrigin = "workspace" OriginConfig PluginOrigin = "config" OriginNative PluginOrigin = "native" // Go native plugins )
type PluginRestrictions ¶
type PluginRestrictions struct {
// AllowNetworkAccess allows the plugin to make network requests
AllowNetworkAccess bool `json:"allow_network_access"`
// AllowFileAccess allows the plugin to access the filesystem
AllowFileAccess bool `json:"allow_file_access"`
// AllowedPaths restricts file access to specific paths
AllowedPaths []string `json:"allowed_paths,omitempty"`
// AllowedHosts restricts network access to specific hosts
AllowedHosts []string `json:"allowed_hosts,omitempty"`
// AllowExec allows the plugin to execute external commands
AllowExec bool `json:"allow_exec"`
// AllowedCommands restricts exec to specific commands
AllowedCommands []string `json:"allowed_commands,omitempty"`
}
PluginRestrictions defines what a plugin is allowed to do
func DefaultPluginRestrictions ¶
func DefaultPluginRestrictions() *PluginRestrictions
DefaultPluginRestrictions returns default plugin restrictions
func (*PluginRestrictions) CheckExec ¶
func (r *PluginRestrictions) CheckExec(command string) error
CheckExec checks if executing a command is allowed
func (*PluginRestrictions) CheckFileAccess ¶
func (r *PluginRestrictions) CheckFileAccess(path string) error
CheckFileAccess checks if file access to a path is allowed
func (*PluginRestrictions) CheckNetworkAccess ¶
func (r *PluginRestrictions) CheckNetworkAccess(host string) error
CheckNetworkAccess checks if network access to a host is allowed
type PluginSandbox ¶
type PluginSandbox struct {
// contains filtered or unexported fields
}
PluginSandbox provides a sandboxed execution environment for plugins
func NewPluginSandbox ¶
func NewPluginSandbox(pluginID string, limits *ResourceLimits) *PluginSandbox
NewPluginSandbox creates a new plugin sandbox
func (*PluginSandbox) GetStats ¶
func (s *PluginSandbox) GetStats() *SandboxStats
GetStats returns sandbox statistics
func (*PluginSandbox) Go ¶
func (s *PluginSandbox) Go(fn func()) error
Go spawns a controlled goroutine within the sandbox
func (*PluginSandbox) GoWithContext ¶
GoWithContext spawns a controlled goroutine with context
func (*PluginSandbox) GoroutineCount ¶
func (s *PluginSandbox) GoroutineCount() int
GoroutineCount returns the current number of goroutines
type PluginScheduler ¶
type PluginScheduler struct {
// contains filtered or unexported fields
}
PluginScheduler controls plugin execution
func NewPluginScheduler ¶
func NewPluginScheduler(pluginID string, maxConcurrent int) *PluginScheduler
NewPluginScheduler creates a new plugin scheduler
func (*PluginScheduler) Acquire ¶
func (s *PluginScheduler) Acquire(ctx context.Context) error
Acquire acquires a slot in the scheduler
func (*PluginScheduler) Release ¶
func (s *PluginScheduler) Release()
Release releases a slot in the scheduler
type PluginStatus ¶
type PluginStatus string
PluginStatus represents the current status of a plugin
const ( StatusLoaded PluginStatus = "loaded" StatusDisabled PluginStatus = "disabled" StatusError PluginStatus = "error" StatusStopped PluginStatus = "stopped" )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all loaded plugins
func NewRegistryWithConfig ¶
func NewRegistryWithConfig(config *IsolationConfig) *Registry
NewRegistryWithConfig creates a new plugin registry with custom isolation config
func (*Registry) GetCommand ¶
GetCommand returns a command by name
func (*Registry) GetHTTPHandler ¶
func (r *Registry) GetHTTPHandler(path string) HTTPHandler
GetHTTPHandler returns an HTTP handler by path
func (*Registry) GetPlugin ¶
func (r *Registry) GetPlugin(id string) *PluginInfo
GetPlugin returns plugin info by ID
func (*Registry) GetPluginDependencies ¶
GetPluginDependencies returns the dependencies of a plugin
func (*Registry) GetPluginDependents ¶
GetPluginDependents returns plugins that depend on the given plugin
func (*Registry) InitializePlugins ¶
InitializePlugins initializes all loaded plugins in dependency order
func (*Registry) ListCommands ¶
ListCommands returns all registered commands
func (*Registry) ListPlugins ¶
func (r *Registry) ListPlugins() []*PluginInfo
ListPlugins returns all loaded plugins
func (*Registry) LoadPluginsFromDir ¶
LoadPluginsFromDir loads plugins from a directory
func (*Registry) RegisterNativePlugin ¶
func (r *Registry) RegisterNativePlugin(plugin NativePlugin) error
RegisterNativePlugin registers a Go native plugin
func (*Registry) ResolveDependencies ¶
func (r *Registry) ResolveDependencies() *ResolutionResult
ResolveDependencies resolves plugin dependencies and returns the result
func (*Registry) SetPluginStatus ¶
func (r *Registry) SetPluginStatus(id string, status PluginStatus) error
SetPluginStatus updates the status of a plugin
func (*Registry) StartPlugin ¶
StartPlugin starts a specific plugin by ID
func (*Registry) StartPlugins ¶
StartPlugins starts all loaded plugins in dependency order
func (*Registry) StopPlugin ¶
StopPlugin stops a specific plugin by ID
func (*Registry) StopPlugins ¶
StopPlugins stops all loaded plugins
func (*Registry) TriggerHook ¶
TriggerHook triggers all handlers for a hook event
func (*Registry) UnregisterPlugin ¶
UnregisterPlugin removes a plugin from the registry
type ResolutionResult ¶
type ResolutionResult struct {
// Order is the topologically sorted list of plugin IDs
Order []string
// Errors contains any dependency errors encountered
Errors []*DependencyError
// Warnings contains non-fatal issues (e.g., optional dependencies not found)
Warnings []string
}
ResolutionResult contains the result of dependency resolution
type ResourceLimits ¶
type ResourceLimits struct {
// MaxMemoryMB is the maximum memory usage in megabytes (0 = unlimited)
MaxMemoryMB int64 `json:"max_memory_mb"`
// MaxCPUPercent is the maximum CPU usage percentage (0 = unlimited)
MaxCPUPercent int `json:"max_cpu_percent"`
// MaxGoroutines is the maximum number of goroutines (0 = unlimited)
MaxGoroutines int `json:"max_goroutines"`
// MaxExecutionTime is the maximum execution time for a single operation
MaxExecutionTime time.Duration `json:"max_execution_time"`
// MaxConcurrentOps is the maximum number of concurrent operations
MaxConcurrentOps int `json:"max_concurrent_ops"`
}
ResourceLimits defines resource limits for a plugin
func DefaultResourceLimits ¶
func DefaultResourceLimits() *ResourceLimits
DefaultResourceLimits returns default resource limits
type ResourceMonitor ¶
type ResourceMonitor struct {
// contains filtered or unexported fields
}
ResourceMonitor monitors resource usage for plugins
func NewResourceMonitor ¶
func NewResourceMonitor(pluginID string, limits *ResourceLimits) *ResourceMonitor
NewResourceMonitor creates a new resource monitor
func (*ResourceMonitor) AcquireOperation ¶
func (m *ResourceMonitor) AcquireOperation(ctx context.Context) error
AcquireOperation acquires a slot for an operation
func (*ResourceMonitor) CheckLimits ¶
func (m *ResourceMonitor) CheckLimits() error
CheckLimits checks if the plugin is within resource limits
func (*ResourceMonitor) GetStats ¶
func (m *ResourceMonitor) GetStats() *ResourceStats
GetStats returns current resource usage statistics
func (*ResourceMonitor) RecordFailure ¶
func (m *ResourceMonitor) RecordFailure()
RecordFailure records a failed operation
func (*ResourceMonitor) ReleaseOperation ¶
func (m *ResourceMonitor) ReleaseOperation()
ReleaseOperation releases an operation slot
type ResourceStats ¶
type ResourceStats struct {
PluginID string `json:"plugin_id"`
CurrentOps int64 `json:"current_ops"`
TotalOps int64 `json:"total_ops"`
FailedOps int64 `json:"failed_ops"`
GoroutineCount int64 `json:"goroutine_count"`
Violations int64 `json:"violations"`
}
ResourceStats contains resource usage statistics
type RestrictedPluginAPI ¶
type RestrictedPluginAPI struct {
// contains filtered or unexported fields
}
RestrictedPluginAPI wraps PluginAPI with resource restrictions
func NewRestrictedPluginAPI ¶
func NewRestrictedPluginAPI(inner PluginAPI, limits *ResourceLimits) *RestrictedPluginAPI
NewRestrictedPluginAPI creates a new restricted plugin API
func (*RestrictedPluginAPI) GetResourceStats ¶
func (a *RestrictedPluginAPI) GetResourceStats() *ResourceStats
GetResourceStats returns the resource usage statistics
func (*RestrictedPluginAPI) Logger ¶
func (a *RestrictedPluginAPI) Logger() Logger
func (*RestrictedPluginAPI) PluginConfig ¶
func (a *RestrictedPluginAPI) PluginConfig() map[string]interface{}
func (*RestrictedPluginAPI) PluginID ¶
func (a *RestrictedPluginAPI) PluginID() string
func (*RestrictedPluginAPI) RegisterCommand ¶
func (a *RestrictedPluginAPI) RegisterCommand(command Command) error
func (*RestrictedPluginAPI) RegisterHTTPHandler ¶
func (a *RestrictedPluginAPI) RegisterHTTPHandler(path string, handler HTTPHandler) error
func (*RestrictedPluginAPI) RegisterHook ¶
func (a *RestrictedPluginAPI) RegisterHook(event string, handler HookHandler) error
func (*RestrictedPluginAPI) RegisterService ¶
func (a *RestrictedPluginAPI) RegisterService(service Service) error
func (*RestrictedPluginAPI) RegisterTool ¶
func (a *RestrictedPluginAPI) RegisterTool(tool Tool) error
type SandboxStats ¶
type SandboxStats struct {
PluginID string `json:"plugin_id"`
GoroutineCount int `json:"goroutine_count"`
ResourceStats *ResourceStats `json:"resource_stats"`
}
SandboxStats contains sandbox statistics
type Service ¶
type Service interface {
Name() string
Start(ctx context.Context) error
Stop(ctx context.Context) error
}
Service represents a background service
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the plugin marketplace
func NewStore ¶
func NewStore(config *StoreConfig, registry *Registry) *Store
NewStore creates a new plugin store
func (*Store) InstallPlugin ¶
InstallPlugin downloads and installs a plugin
func (*Store) ListPlugins ¶
func (s *Store) ListPlugins(ctx context.Context) ([]*StorePlugin, error)
ListPlugins returns all available plugins from all sources
func (*Store) SearchPlugins ¶
SearchPlugins searches for plugins by query
type StoreConfig ¶
type StoreConfig struct {
CacheDir string `json:"cache_dir"`
CacheDuration time.Duration `json:"cache_duration"`
MoltbotRepo string `json:"moltbot_repo"`
MoltbotBranch string `json:"moltbot_branch"`
CustomSources []string `json:"custom_sources"`
UseJsdelivr bool `json:"use_jsdelivr"` // If true, try jsdelivr CDN first for faster access
JsdelivrMirror string `json:"jsdelivr_mirror"` // Custom jsdelivr mirror (e.g., "fastly.jsdelivr.net", "gcore.jsdelivr.net")
}
StoreConfig holds plugin store configuration
func DefaultStoreConfig ¶
func DefaultStoreConfig() *StoreConfig
DefaultStoreConfig returns default store configuration
type StorePlugin ¶
type StorePlugin struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Author string `json:"author"`
Source StoreSource `json:"source"`
RepoURL string `json:"repo_url"`
DownloadURL string `json:"download_url"`
Manifest *Manifest `json:"manifest,omitempty"`
Tags []string `json:"tags,omitempty"`
Downloads int `json:"downloads"`
Rating float64 `json:"rating"`
UpdatedAt time.Time `json:"updated_at"`
Installed bool `json:"installed"`
}
StorePlugin represents a plugin available in the store
type StoreSource ¶
type StoreSource string
StoreSource represents a plugin source
const ( SourceMoltbot StoreSource = "moltbot" SourceClawdHub StoreSource = "clawdhub" SourceGitHub StoreSource = "github" SourceCustom StoreSource = "custom" )
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters map[string]interface{} `json:"parameters"`
RiskLevel string `json:"risk_level,omitempty"`
VisibilityAllowlist []string `json:"visibility_allowlist,omitempty"`
Handler ToolHandler `json:"-"`
}
Tool represents an agent tool
type ToolHandler ¶
ToolHandler is the function signature for tool handlers
func WrapToolHandler ¶
func WrapToolHandler(pluginID string, handler ToolHandler, timeout time.Duration) ToolHandler
WrapToolHandler wraps a tool handler with isolation