<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>API Reference - Sharur</title><link>https://goppydae.github.io/sharur/reference/index.html</link><description>GoDoc-generated reference for sharur's public and contract packages</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://goppydae.github.io/sharur/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>agent</title><link>https://goppydae.github.io/sharur/reference/agent/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goppydae.github.io/sharur/reference/agent/index.html</guid><description>agent import "github.com/goppydae/sharur/internal/agent" Package agent provides the stateful agent with transcript, tools, and events.
Index Constants func EstimateMessageTokens(m Message) int type Agent func New(provider llm.Provider, registry *tools.ToolRegistry) *Agent func (a *Agent) Abort() func (a *Agent) Compact(ctx context.Context, keepRecentTokens int) func (a *Agent) Continue(ctx context.Context) error func (a *Agent) EstimateContextTokens() int func (a *Agent) EventBus() *events.EventBus func (a *Agent) FollowUp(text string, images …Image) func (a *Agent) GetInfo() llm.ProviderInfo func (a *Agent) GetSession() *types.Session func (a *Agent) GetStats() AgentStats func (a *Agent) Idle() &lt;-chan struct{} func (a *Agent) InvokeTool(ctx context.Context, name string, args string) error func (a *Agent) IsRunning() bool func (a *Agent) LifecycleState() string func (a *Agent) Messages() []Message func (a *Agent) Prompt(ctx context.Context, text string, images …Image) error func (a *Agent) Reset() func (a *Agent) ResetSession(id string) func (a *Agent) Session() *session.Session func (a *Agent) SetCompactionConfig(enabled bool, reserve, keepRecent int) func (a *Agent) SetDryRun(dry bool) func (a *Agent) SetExtensions(exts []Extension) func (a *Agent) SetMaxTokens(n int) func (a *Agent) SetModel(model string) func (a *Agent) SetProvider(provider llm.Provider) func (a *Agent) SetSession(mgr *session.Manager, sess *session.Session) func (a *Agent) SetSessionName(name string) func (a *Agent) SetSystemPrompt(prompt string) func (a *Agent) SetThinkingLevel(level ThinkingLevel) func (a *Agent) State() *AgentState func (a *Agent) Steer(text string, images …Image) func (a *Agent) Subscribe(fn func(Event)) func() func (a *Agent) ToolRegistry() *tools.ToolRegistry type AgentState type AgentStats type CompactionPrep type CompactionResult type Event type EventType type Extension type Image type InputAction type InputResult type LifecycleState type Message type NoopExtension func (n *NoopExtension) AfterCompact(_ context.Context, _ int) func (n *NoopExtension) AfterProviderResponse(_ context.Context, _ string, _ int) func (n *NoopExtension) AfterToolCall(_ context.Context, _ *ToolCall, result *tools.ToolResult) *tools.ToolResult func (n *NoopExtension) AgentEnd(_ context.Context) func (n *NoopExtension) AgentStart(_ context.Context) func (n *NoopExtension) BeforeCompact(_ context.Context, _ CompactionPrep) *CompactionResult func (n *NoopExtension) BeforePrompt(_ context.Context, state *AgentState) *AgentState func (n *NoopExtension) BeforeProviderRequest(_ context.Context, req *llm.CompletionRequest) *llm.CompletionRequest func (n *NoopExtension) BeforeToolCall(_ context.Context, _ *ToolCall, _ json.RawMessage) (*tools.ToolResult, bool) func (n *NoopExtension) ModifyContext(_ context.Context, messages []types.Message) []types.Message func (n *NoopExtension) ModifyInput(_ context.Context, _ string) InputResult func (n *NoopExtension) ModifySystemPrompt(prompt string) string func (n *NoopExtension) Name() string func (n *NoopExtension) SessionEnd(_ context.Context, _ string, _ SessionEndReason) func (n *NoopExtension) SessionStart(_ context.Context, _ string, _ SessionStartReason) func (n *NoopExtension) Tools() []tools.Tool func (n *NoopExtension) TurnEnd(_ context.Context) func (n *NoopExtension) TurnStart(_ context.Context) type Session type SessionEndReason type SessionStartReason type StateMachine func NewStateMachine(initial LifecycleState, onTransition func(StateTransition)) *StateMachine func (s *StateMachine) Current() LifecycleState func (s *StateMachine) Transition(to LifecycleState) error type StateTransition type ThinkingLevel type ToolCall type ToolInfo type ToolOutput Constants</description></item><item><title>extensions</title><link>https://goppydae.github.io/sharur/reference/extensions/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goppydae.github.io/sharur/reference/extensions/index.html</guid><description>extensions import "github.com/goppydae/sharur/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 func NewLoader(dirs []string, pythonPath string) *Loader func (l *Loader) Cleanup() func (l *Loader) Load() ([]agent.Extension, []error) func (l *Loader) LoadOrLog() []agent.Extension 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 func (t *RemoteTool) Description() string func (t *RemoteTool) Execute(ctx context.Context, args json.RawMessage, update tools.ToolUpdate) (*tools.ToolResult, error) func (t *RemoteTool) IsReadOnly() bool func (t *RemoteTool) Name() string func (t *RemoteTool) Schema() json.RawMessage type SkillLoader func NewSkillLoader(dirs []string) *SkillLoader func (l *SkillLoader) Load() ([]agent.Extension, error) type SkillTool func (s *SkillTool) Description() string func (s *SkillTool) Execute(ctx context.Context, args json.RawMessage, update tools.ToolUpdate) (*tools.ToolResult, error) func (s *SkillTool) IsReadOnly() bool func (s *SkillTool) Name() string func (s *SkillTool) Schema() json.RawMessage type SkillsMetadataExtension func NewSkillsMetadataExtension(allSkills []*skills.Skill) *SkillsMetadataExtension func (s *SkillsMetadataExtension) ModifySystemPrompt(prompt string) string func (s *SkillsMetadataExtension) Tools() []tools.Tool type ToolCall type ToolDefinition type ToolResult</description></item><item><title>sdk</title><link>https://goppydae.github.io/sharur/reference/sdk/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goppydae.github.io/sharur/reference/sdk/index.html</guid><description>sdk import "github.com/goppydae/sharur/sdk" Package sdk provides the public Go SDK for embedding sharur agents in your own applications.
Example:
ag, err := sdk.NewAgent(sdk.Config{ Model: "llama3", Provider: "ollama", Tools: sdk.DefaultTools(), }) if err != nil { panic(err) } ag.Subscribe(func(e sdk.Event) { if e.Type == sdk.EventTextDelta { fmt.Print(e.Content) } }) if err := ag.Prompt(context.Background(), "What files are in this directory?"); err != nil { panic(err) } &lt;-ag.Idle() Index Constants type Agent func NewAgent(cfg Config) (*Agent, error) type CompactionPrep type CompactionResult type Config type Event type EventType type Extension type InputAction type InputResult type SessionEndReason type SessionStartReason type ThinkingLevel type Tool func DefaultTools() []Tool type ToolResult Constants</description></item><item><title>tools</title><link>https://goppydae.github.io/sharur/reference/tools/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://goppydae.github.io/sharur/reference/tools/index.html</guid><description>tools import "github.com/goppydae/sharur/internal/tools" Package tools provides the universal tool interface and registry.
Index func NormalizePath(path string) string type Bash func (Bash) Description() string func (t Bash) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Bash) IsReadOnly() bool func (Bash) Name() string func (Bash) Schema() json.RawMessage type Edit func (Edit) Description() string func (Edit) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Edit) IsReadOnly() bool func (Edit) Name() string func (Edit) Schema() json.RawMessage type Find func (Find) Description() string func (Find) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Find) IsReadOnly() bool func (Find) Name() string func (Find) Schema() json.RawMessage type Grep func (Grep) Description() string func (Grep) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Grep) IsReadOnly() bool func (Grep) Name() string func (Grep) Schema() json.RawMessage type Ls func (Ls) Description() string func (Ls) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Ls) IsReadOnly() bool func (Ls) Name() string func (Ls) Schema() json.RawMessage type Read func (Read) Description() string func (Read) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Read) IsReadOnly() bool func (Read) Name() string func (Read) Schema() json.RawMessage type Tool type ToolCall type ToolRegistry func NewToolRegistry() *ToolRegistry func (r *ToolRegistry) All() []Tool func (r *ToolRegistry) Get(name string) (Tool, bool) func (r *ToolRegistry) Has(name string) bool func (r *ToolRegistry) Register(t Tool) type ToolResult type ToolUpdate type Write func (Write) Description() string func (Write) Execute(ctx context.Context, args json.RawMessage, update ToolUpdate) (*ToolResult, error) func (Write) IsReadOnly() bool func (Write) Name() string func (Write) Schema() json.RawMessage</description></item></channel></rss>