plugins

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndroidPlugin

type AndroidPlugin struct {
	// contains filtered or unexported fields
}

AndroidPlugin shows connected Android devices (via adb) Config options:

  • display: what to show for each device (default: "serial") Options: serial, model, version, sdk, manufacturer, device, build, arch Combine with colons: "model:version", "device:sdk:build"
  • packages: array of package names for version lookup (supports wildcards)

func (*AndroidPlugin) Execute

func (p *AndroidPlugin) Execute(ctx context.Context, input plugin.Input) (string, error)

func (*AndroidPlugin) Name

func (p *AndroidPlugin) Name() string

func (*AndroidPlugin) OnHook

func (p *AndroidPlugin) OnHook(ctx context.Context, hookType HookType, hookCtx HookContext) (string, error)

OnHook invalidates cache when Claude becomes idle (fresh data on next render)

func (*AndroidPlugin) SetCache

func (p *AndroidPlugin) SetCache(c *cache.Cache)

type GitPlugin

type GitPlugin struct {
	// contains filtered or unexported fields
}

GitPlugin shows git branch and status

func (*GitPlugin) Execute

func (p *GitPlugin) Execute(ctx context.Context, input plugin.Input) (string, error)

func (*GitPlugin) Name

func (p *GitPlugin) Name() string

func (*GitPlugin) OnHook

func (p *GitPlugin) OnHook(ctx context.Context, hookType HookType, hookCtx HookContext) (string, error)

OnHook invalidates git cache when Claude becomes idle (fresh data on next render)

func (*GitPlugin) SetCache

func (p *GitPlugin) SetCache(c *cache.Cache)

type HookContext

type HookContext struct {
	SessionID string
	Config    map[string]any // Plugin configuration
}

HookContext provides context for hook handlers

type HookType

type HookType string

HookType represents the type of hook event

const (
	// Core hooks (most useful for plugins)
	HookIdle         HookType = "idle"          // Stop - Claude finished responding
	HookBusy         HookType = "busy"          // UserPromptSubmit - User submitted prompt
	HookSessionStart HookType = "session_start" // SessionStart - Session started/resumed
	HookSessionEnd   HookType = "session_end"   // SessionEnd - Session ending
	HookPreCompact   HookType = "pre_compact"   // PreCompact - Before context compaction
)

type Hookable

type Hookable interface {
	// OnHook is called when a hook event occurs
	// Return value is optional output to display (e.g., notifications)
	OnHook(ctx context.Context, hookType HookType, hookCtx HookContext) (string, error)
}

Hookable is an optional interface for plugins that want to respond to state changes

type MCPPlugin

type MCPPlugin struct {
	// contains filtered or unexported fields
}

MCPPlugin shows MCP server count

func (*MCPPlugin) Execute

func (p *MCPPlugin) Execute(ctx context.Context, input plugin.Input) (string, error)

func (*MCPPlugin) Name

func (p *MCPPlugin) Name() string

func (*MCPPlugin) SetCache

func (p *MCPPlugin) SetCache(c *cache.Cache)

type NativePlugin

type NativePlugin interface {
	Name() string
	Execute(ctx context.Context, input plugin.Input) (string, error)
	SetCache(c *cache.Cache)
}

NativePlugin defines the interface for built-in Go plugins

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds all available native plugins

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new plugin registry with all native plugins

func (*Registry) Get

func (r *Registry) Get(name string) NativePlugin

Get returns a native plugin by name, or nil if not found

func (*Registry) GetHookablePlugins

func (r *Registry) GetHookablePlugins() []Hookable

GetHookablePlugins returns all plugins implementing Hookable

func (*Registry) Has

func (r *Registry) Has(name string) bool

Has returns true if a native plugin exists for the given name

func (*Registry) List

func (r *Registry) List() []string

List returns all native plugin names

func (*Registry) Register

func (r *Registry) Register(p NativePlugin)

Register adds a plugin to the registry

func (*Registry) RunHooks

func (r *Registry) RunHooks(ctx context.Context, hookType HookType, hookCtx HookContext) []string

RunHooks executes hooks on all hookable plugins sequentially

type UpdatePlugin

type UpdatePlugin struct {
	// contains filtered or unexported fields
}

UpdatePlugin shows indicator when Prism update is available

func (*UpdatePlugin) Execute

func (p *UpdatePlugin) Execute(ctx context.Context, input plugin.Input) (string, error)

func (*UpdatePlugin) Name

func (p *UpdatePlugin) Name() string

func (*UpdatePlugin) OnHook

func (p *UpdatePlugin) OnHook(ctx context.Context, hookType HookType, hookCtx HookContext) (string, error)

OnHook implements Hookable interface for auto-update and notifications

func (*UpdatePlugin) SetCache

func (p *UpdatePlugin) SetCache(c *cache.Cache)

Jump to

Keyboard shortcuts

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