Documentation
¶
Index ¶
- Constants
- func InstalledCacheRoot(dataDir string) string
- func InstalledIndexPath(dataDir string) string
- func IsBuiltinID(id string) bool
- func LoadManifest(pluginDir string) (Manifest, []Diagnostic, error)
- func NormalizePluginID(id string) string
- func WorkspaceHash(workspaceRoot string) string
- type AgentDefinition
- type Capability
- type CommandClass
- type CommandHookProvider
- type CommandResult
- type CommandTurn
- type Components
- type Config
- type ConfigMap
- type Context
- type Diagnostic
- type DiagnosticLevel
- type Display
- type DoctorProvider
- type HookProvider
- type InstallResult
- type InstalledRecord
- type LoadOutcome
- type LoadedPlugin
- type MCPProvider
- type MCPServerConfig
- type Manager
- func (m *Manager) Agents() []AgentDefinition
- func (m *Manager) CommandClass(name string) (CommandClass, bool)
- func (m *Manager) CommandClassForLine(line string) (CommandClass, bool)
- func (m *Manager) CommandHooks() []agent.ResolvedHook
- func (m *Manager) Diagnostics(ctx context.Context) []Diagnostic
- func (m *Manager) EnabledIDs() []string
- func (m *Manager) HandleCommand(ctx context.Context, line string) (CommandResult, bool, error)
- func (m *Manager) Hooks() []agent.HookHandler
- func (m *Manager) MCPServers() map[string]whalemcp.ServerConfig
- func (m *Manager) Outcome() LoadOutcome
- func (m *Manager) Rules() []RuleBlock
- func (m *Manager) Skills() []*skills.Skill
- func (m *Manager) SlashCommandNames() []string
- func (m *Manager) SlashCommands() []SlashCommand
- func (m *Manager) StartupBlocks(ctx context.Context) []string
- func (m *Manager) Status(id string) (PluginStatus, bool)
- func (m *Manager) Statuses() []PluginStatus
- func (m *Manager) Tools() []core.Tool
- type Manifest
- type PathProvider
- type Permission
- type Plugin
- type PluginStatus
- type RuleBlock
- type ServiceProvider
- type ServiceStatus
- type SkillProvider
- type SlashCommand
- type SlashCommandProvider
- type StartupContextProvider
- type ToolProvider
Constants ¶
View Source
const ( ManifestFileName = "whale-plugin.toml" InstalledFileName = "installed.toml" )
Variables ¶
This section is empty.
Functions ¶
func InstalledCacheRoot ¶ added in v0.1.33
func InstalledIndexPath ¶ added in v0.1.33
func IsBuiltinID ¶ added in v0.1.33
func LoadManifest ¶ added in v0.1.33
func LoadManifest(pluginDir string) (Manifest, []Diagnostic, error)
func NormalizePluginID ¶ added in v0.1.33
func WorkspaceHash ¶
Types ¶
type AgentDefinition ¶ added in v0.1.33
type Capability ¶
type Capability string
const ( CapabilityTools Capability = "tools" CapabilitySlashCommands Capability = "slash_commands" CapabilityStartupContext Capability = "startup_context" CapabilityStorage Capability = "storage" CapabilitySkills Capability = "skills" CapabilityHooks Capability = "hooks" CapabilityBackgroundJobs Capability = "background_jobs" CapabilityLocalModel Capability = "local_model" )
type CommandClass ¶
type CommandClass string
const ( CommandReadOnly CommandClass = "read_only" CommandMutating CommandClass = "mutating" CommandUI CommandClass = "ui" CommandTurnStarting CommandClass = "turn" )
func BuiltinSlashCommandClass ¶
func BuiltinSlashCommandClass(line string) (CommandClass, bool)
type CommandHookProvider ¶ added in v0.1.33
type CommandHookProvider interface {
CommandHooks(Context) []agent.ResolvedHook
}
type CommandResult ¶
type CommandResult struct {
Text string
Mutated bool
Turn *CommandTurn
}
type CommandTurn ¶
type Components ¶ added in v0.1.33
type Config ¶ added in v0.1.33
type Config struct {
Enabled *bool
MCPServers map[string]MCPServerConfig
}
type Context ¶
func (Context) PluginCacheDir ¶
func (Context) PluginDataDir ¶
func (Context) PluginProjectDir ¶
func (Context) PluginRoot ¶
type Diagnostic ¶
type Diagnostic struct {
PluginID string
Level DiagnosticLevel
Label string
Detail string
}
type DiagnosticLevel ¶
type DiagnosticLevel string
const ( DiagnosticOK DiagnosticLevel = "ok" DiagnosticWarn DiagnosticLevel = "warn" DiagnosticFail DiagnosticLevel = "fail" )
type DoctorProvider ¶
type DoctorProvider interface {
Doctor(context.Context, Context) []Diagnostic
}
type HookProvider ¶
type HookProvider interface {
Hooks(Context) []agent.HookHandler
}
type InstallResult ¶ added in v0.1.33
type InstallResult struct {
Record InstalledRecord
}
func InstallLocal ¶ added in v0.1.33
func InstallLocal(dataDir, pluginDir string) (InstallResult, error)
type InstalledRecord ¶ added in v0.1.33
type InstalledRecord struct {
ID string `toml:"id"`
Name string `toml:"name,omitempty"`
Version string `toml:"version,omitempty"`
Description string `toml:"description,omitempty"`
Authors []string `toml:"authors,omitempty"`
License string `toml:"license,omitempty"`
Homepage string `toml:"homepage,omitempty"`
Repository string `toml:"repository,omitempty"`
Keywords []string `toml:"keywords,omitempty"`
SourcePath string `toml:"source_path,omitempty"`
InstallPath string `toml:"install_path,omitempty"`
InstalledAt string `toml:"installed_at,omitempty"`
Components Components `toml:"components,omitempty"`
Display Display `toml:"display,omitempty"`
Diagnostics []Diagnostic `toml:"diagnostics,omitempty"`
}
func FindInstalled ¶ added in v0.1.33
func FindInstalled(dataDir, id string) (InstalledRecord, bool, error)
func LoadInstalled ¶ added in v0.1.33
func LoadInstalled(dataDir string) ([]InstalledRecord, error)
func UninstallLocal ¶ added in v0.1.33
func UninstallLocal(dataDir, id string) (InstalledRecord, error)
func (InstalledRecord) Manifest ¶ added in v0.1.33
func (r InstalledRecord) Manifest() Manifest
type LoadOutcome ¶ added in v0.1.33
type LoadOutcome struct {
Plugins []LoadedPlugin
Statuses []PluginStatus
Commands []SlashCommand
Tools []core.Tool
Skills []*skills.Skill
Agents []AgentDefinition
Rules []RuleBlock
MCPServers map[string]whalemcp.ServerConfig
CommandHooks []agent.ResolvedHook
HookHandlers []agent.HookHandler
Diagnostics []Diagnostic
}
type LoadedPlugin ¶ added in v0.1.33
type LoadedPlugin struct {
Manifest Manifest
Enabled bool
Paths map[string]string
Commands []SlashCommand
Tools []core.Tool
ToolNames []string
Skills []*skills.Skill
Agents []AgentDefinition
Rules []RuleBlock
MCPServers map[string]whalemcp.ServerConfig
CommandHooks []agent.ResolvedHook
HookHandlers []agent.HookHandler
Services []ServiceStatus
Diagnostics []Diagnostic
}
type MCPProvider ¶ added in v0.1.33
type MCPProvider interface {
MCPServers(Context) map[string]whalemcp.ServerConfig
}
type MCPServerConfig ¶ added in v0.1.33
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Agents ¶ added in v0.1.33
func (m *Manager) Agents() []AgentDefinition
func (*Manager) CommandClass ¶
func (m *Manager) CommandClass(name string) (CommandClass, bool)
func (*Manager) CommandClassForLine ¶
func (m *Manager) CommandClassForLine(line string) (CommandClass, bool)
func (*Manager) CommandHooks ¶ added in v0.1.33
func (m *Manager) CommandHooks() []agent.ResolvedHook
func (*Manager) Diagnostics ¶
func (m *Manager) Diagnostics(ctx context.Context) []Diagnostic
func (*Manager) EnabledIDs ¶
func (*Manager) HandleCommand ¶
func (*Manager) Hooks ¶
func (m *Manager) Hooks() []agent.HookHandler
func (*Manager) MCPServers ¶ added in v0.1.33
func (m *Manager) MCPServers() map[string]whalemcp.ServerConfig
func (*Manager) Outcome ¶ added in v0.1.33
func (m *Manager) Outcome() LoadOutcome
func (*Manager) SlashCommandNames ¶
func (*Manager) SlashCommands ¶
func (m *Manager) SlashCommands() []SlashCommand
func (*Manager) Statuses ¶
func (m *Manager) Statuses() []PluginStatus
type Manifest ¶
type Manifest struct {
ID string
Name string
Version string
Description string
Official bool
Authors []string
License string
Homepage string
Repository string
Keywords []string
Components Components
Display Display
Capabilities []Capability
Permissions []Permission
Status string
}
type PathProvider ¶ added in v0.1.33
type Permission ¶
type Permission string
const ( PermissionReadPluginData Permission = "read_plugin_data" PermissionWritePluginData Permission = "write_plugin_data" PermissionReadWorkspace Permission = "read_workspace" PermissionWriteWorkspace Permission = "write_workspace" PermissionBackgroundJobs Permission = "background_jobs" PermissionLocalModel Permission = "local_model" )
type PluginStatus ¶
type PluginStatus struct {
Manifest Manifest
Enabled bool
Commands []SlashCommand
Tools []string
Skills []string
Agents []string
Rules []string
Hooks []string
Services []ServiceStatus
Diagnostics []Diagnostic
Paths map[string]string
}
type ServiceProvider ¶
type ServiceProvider interface {
Services(Context) []ServiceStatus
}
type ServiceStatus ¶
type SkillProvider ¶
type SlashCommand ¶
type SlashCommand struct {
Name string
Usage string
Description string
Class CommandClass
StartsTurn bool
Classify func(line string) CommandClass
Run func(context.Context, Context, string) (CommandResult, error)
}
type SlashCommandProvider ¶
type SlashCommandProvider interface {
SlashCommands(Context) []SlashCommand
}
type StartupContextProvider ¶
type ToolProvider ¶
Click to show internal directories.
Click to hide internal directories.