extensions
Index
- func LoadErrors(errs []error) error
- func Serve(impl Plugin)
- type AgentState
- type GRPCClient
- func (m *GRPCClient) AfterCompact(ctx context.Context, freedTokens int)
- func (m *GRPCClient) AfterProviderResponse(ctx context.Context, content string, numToolCalls int)
- func (m *GRPCClient) AfterToolCall(ctx context.Context, call *agent.ToolCall, result *tools.ToolResult) *tools.ToolResult
- func (m *GRPCClient) AgentEnd(ctx context.Context)
- func (m *GRPCClient) AgentStart(ctx context.Context)
- func (m *GRPCClient) BeforeCompact(ctx context.Context, prep agent.CompactionPrep) *agent.CompactionResult
- func (m *GRPCClient) BeforePrompt(ctx context.Context, state *agent.AgentState) *agent.AgentState
- func (m *GRPCClient) BeforeProviderRequest(ctx context.Context, req *llm.CompletionRequest) *llm.CompletionRequest
- func (m *GRPCClient) BeforeToolCall(ctx context.Context, call *agent.ToolCall, args json.RawMessage) (*tools.ToolResult, bool)
- func (m *GRPCClient) Degraded() (bool, error)
- func (m *GRPCClient) ModifyContext(ctx context.Context, messages []types.Message) []types.Message
- func (m *GRPCClient) ModifyInput(ctx context.Context, text string) agent.InputResult
- func (m *GRPCClient) ModifySystemPrompt(prompt string) string
- func (m *GRPCClient) Name() string
- func (m *GRPCClient) SessionEnd(ctx context.Context, sessionID string, reason agent.SessionEndReason)
- func (m *GRPCClient) SessionStart(ctx context.Context, sessionID string, reason agent.SessionStartReason)
- func (m *GRPCClient) Tools() []tools.Tool
- func (m *GRPCClient) TurnEnd(ctx context.Context)
- func (m *GRPCClient) TurnStart(ctx context.Context)
- type GRPCServer
- func (m *GRPCServer) AfterCompact(ctx context.Context, req *proto.AfterCompactRequest) (*proto.Empty, error)
- func (m *GRPCServer) AfterProviderResponse(ctx context.Context, req *proto.AfterProviderResponseRequest) (*proto.Empty, error)
- func (m *GRPCServer) AfterToolCall(ctx context.Context, req *proto.AfterToolCallRequest) (*proto.AfterToolCallResponse, error)
- func (m *GRPCServer) AgentEnd(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (m *GRPCServer) AgentStart(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (m *GRPCServer) BeforeCompact(ctx context.Context, req *proto.BeforeCompactRequest) (*proto.BeforeCompactResponse, error)
- func (m *GRPCServer) BeforePrompt(ctx context.Context, req *proto.BeforePromptRequest) (*proto.BeforePromptResponse, error)
- func (m *GRPCServer) BeforeProviderRequest(ctx context.Context, req *proto.BeforeProviderRequestRequest) (*proto.BeforeProviderRequestResponse, error)
- func (m *GRPCServer) BeforeToolCall(ctx context.Context, req *proto.BeforeToolCallRequest) (*proto.BeforeToolCallResponse, error)
- func (m *GRPCServer) ExecuteTool(ctx context.Context, req *proto.ExecuteToolRequest) (*proto.ExecuteToolResponse, error)
- func (m *GRPCServer) ModifyContext(ctx context.Context, req *proto.ModifyContextRequest) (*proto.ModifyContextResponse, error)
- func (m *GRPCServer) ModifyInput(ctx context.Context, req *proto.ModifyInputRequest) (*proto.ModifyInputResponse, error)
- func (m *GRPCServer) ModifySystemPrompt(ctx context.Context, req *proto.ModifySystemPromptRequest) (*proto.ModifySystemPromptResponse, error)
- func (m *GRPCServer) Name(ctx context.Context, _ *proto.Empty) (*proto.NameResponse, error)
- func (m *GRPCServer) SessionEnd(ctx context.Context, req *proto.SessionEndRequest) (*proto.Empty, error)
- func (m *GRPCServer) SessionStart(ctx context.Context, req *proto.SessionStartRequest) (*proto.Empty, error)
- func (m *GRPCServer) Tools(ctx context.Context, _ *proto.Empty) (*proto.ToolsResponse, error)
- func (m *GRPCServer) TurnEnd(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (m *GRPCServer) TurnStart(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- type Loader
- type NoopPlugin
- func (n *NoopPlugin) AfterCompact(_ context.Context, _ int)
- func (n *NoopPlugin) AfterProviderResponse(_ context.Context, _ string, _ int)
- func (n *NoopPlugin) AfterToolCall(_ context.Context, _ ToolCall, result ToolResult) ToolResult
- func (n *NoopPlugin) AgentEnd(_ context.Context)
- func (n *NoopPlugin) AgentStart(_ context.Context)
- func (n *NoopPlugin) BeforeCompact(_ context.Context, _ agent.CompactionPrep) *agent.CompactionResult
- func (n *NoopPlugin) BeforePrompt(_ context.Context, state AgentState) AgentState
- func (n *NoopPlugin) BeforeProviderRequest(_ context.Context, requestJSON string) string
- func (n *NoopPlugin) BeforeToolCall(_ context.Context, _ ToolCall, _ json.RawMessage) (ToolResult, bool)
- func (n *NoopPlugin) ExecuteTool(_ context.Context, name string, _ json.RawMessage) ToolResult
- func (n *NoopPlugin) ModifyContext(_ context.Context, messagesJSON string) string
- func (n *NoopPlugin) ModifyInput(_ context.Context, _ string) agent.InputResult
- func (n *NoopPlugin) ModifySystemPrompt(prompt string) string
- func (n *NoopPlugin) Name() string
- func (n *NoopPlugin) SessionEnd(_ context.Context, _ string, _ agent.SessionEndReason)
- func (n *NoopPlugin) SessionStart(_ context.Context, _ string, _ agent.SessionStartReason)
- func (n *NoopPlugin) Tools() []ToolDefinition
- func (n *NoopPlugin) TurnEnd(_ context.Context)
- func (n *NoopPlugin) TurnStart(_ context.Context)
- type Plugin
- type RemoteTool
- type SkillLoader
- type SkillTool
- type SkillsMetadataExtension
- type ToolCall
- type ToolDefinition
- type ToolResult
func LoadErrors
LoadErrors joins all errors from a Load call into a single error, or nil if there were none.
func Serve
Serve starts a gRPC server on the Unix socket path provided via SHARUR_SOCKET_PATH. This is the entry point for extension binaries.
type AgentState
AgentState is the mutable prompt state passed to BeforePrompt.
type GRPCClient
GRPCClient is an implementation of agent.Extension that talks over RPC. It runs on the host side when a plugin binary is loaded.
If Name() or Tools() fail, the client is marked degraded and all subsequent tool executions return an error rather than silently doing nothing.
func (*GRPCClient) AfterCompact
func (*GRPCClient) AfterProviderResponse
func (*GRPCClient) AfterToolCall
func (*GRPCClient) AgentEnd
func (*GRPCClient) AgentStart
func (*GRPCClient) BeforeCompact
func (*GRPCClient) BeforePrompt
func (*GRPCClient) BeforeProviderRequest
func (*GRPCClient) BeforeToolCall
func (*GRPCClient) Degraded
Degraded reports whether the extension failed to initialise. Callers can surface this to the user rather than letting the failure be silent.
func (*GRPCClient) ModifyContext
func (*GRPCClient) ModifyInput
func (*GRPCClient) ModifySystemPrompt
func (*GRPCClient) Name
func (*GRPCClient) SessionEnd
func (*GRPCClient) SessionStart
func (*GRPCClient) Tools
Tools queries the extension process for its tool definitions and returns RemoteTool wrappers that execute each tool over the ExecuteTool RPC.
func (*GRPCClient) TurnEnd
func (*GRPCClient) TurnStart
type GRPCServer
GRPCServer is the gRPC server that runs inside the plugin binary. It adapts the Plugin interface to the proto service.
func (*GRPCServer) AfterCompact
func (*GRPCServer) AfterProviderResponse
func (*GRPCServer) AfterToolCall
func (*GRPCServer) AgentEnd
func (*GRPCServer) AgentStart
func (*GRPCServer) BeforeCompact
func (*GRPCServer) BeforePrompt
func (*GRPCServer) BeforeProviderRequest
func (*GRPCServer) BeforeToolCall
func (*GRPCServer) ExecuteTool
func (*GRPCServer) ModifyContext
func (*GRPCServer) ModifyInput
func (*GRPCServer) ModifySystemPrompt
func (*GRPCServer) Name
func (*GRPCServer) SessionEnd
func (*GRPCServer) SessionStart
func (*GRPCServer) Tools
func (*GRPCServer) TurnEnd
func (*GRPCServer) TurnStart
type Loader
Loader discovers and loads extensions (executable binaries and scripts).
func NewLoader
NewLoader creates a new extension loader.
func (*Loader) Cleanup
Cleanup kills all running extension subprocesses and removes their socket files.
func (*Loader) Load
Load discovers extensions, starts them as subprocesses, and returns gRPC client interfaces. Extensions that fail to load are logged and skipped; the returned error accumulates all failures so callers can distinguish “nothing loaded” from “everything succeeded”.
func (*Loader) LoadOrLog
LoadOrLog calls Load and logs any errors, returning only the successfully loaded extensions.
type NoopPlugin
NoopPlugin is a base Plugin implementation with no-op defaults. Embed it in your Plugin struct and override only what you need.
func (*NoopPlugin) AfterCompact
func (*NoopPlugin) AfterProviderResponse
func (*NoopPlugin) AfterToolCall
func (*NoopPlugin) AgentEnd
func (*NoopPlugin) AgentStart
func (*NoopPlugin) BeforeCompact
func (*NoopPlugin) BeforePrompt
func (*NoopPlugin) BeforeProviderRequest
func (*NoopPlugin) BeforeToolCall
func (*NoopPlugin) ExecuteTool
func (*NoopPlugin) ModifyContext
func (*NoopPlugin) ModifyInput
func (*NoopPlugin) ModifySystemPrompt
func (*NoopPlugin) Name
func (*NoopPlugin) SessionEnd
func (*NoopPlugin) SessionStart
func (*NoopPlugin) Tools
func (*NoopPlugin) TurnEnd
func (*NoopPlugin) TurnStart
type Plugin
Plugin is the interface that standalone gRPC extension binaries implement. Embed NoopPlugin and override only the methods you need.
type RemoteTool
RemoteTool is a tools.Tool that executes over the extension’s ExecuteTool gRPC.
func (*RemoteTool) Description
func (*RemoteTool) Execute
func (*RemoteTool) IsReadOnly
func (*RemoteTool) Name
func (*RemoteTool) Schema
type SkillLoader
SkillLoader discovers and loads Markdown-based skills.
func NewSkillLoader
NewSkillLoader creates a new loader for Markdown skills.
func (*SkillLoader) Load
Load finds all skills and returns a SkillsMetadataExtension.
type SkillTool
SkillTool implements tools.Tool for a single Markdown-based skill.
func (*SkillTool) Description
func (*SkillTool) Execute
func (*SkillTool) IsReadOnly
func (*SkillTool) Name
func (*SkillTool) Schema
type SkillsMetadataExtension
SkillsMetadataExtension lists all available skills in the system prompt.
func NewSkillsMetadataExtension
NewSkillsMetadataExtension creates an extension that adds skill metadata to the prompt.
func (*SkillsMetadataExtension) ModifySystemPrompt
ModifySystemPrompt injects a brief list of skills into the system prompt. This tells the agent it can call these skills (as tools) when needed.
func (*SkillsMetadataExtension) Tools
Tools returns a SkillTool for each loaded skill.
type ToolCall
ToolCall describes a tool invocation passed to Plugin hook methods.
type ToolDefinition
ToolDefinition describes a tool contributed by a Plugin.
type ToolResult
ToolResult is the outcome of a tool call or an interception.
Generated by gomarkdoc