Documentation
¶
Index ¶
- func BuildSystemPrompt(ctx context.Context, pool *pgxpool.Pool, repoName string, toolNames []string) string
- type Agent
- func (a *Agent) Ask(ctx context.Context, question string) (string, error)
- func (a *Agent) Chat(ctx context.Context, history []ConversationMessage, message string) (string, []ConversationMessage, error)
- func (a *Agent) Close()
- func (a *Agent) GenerateDoc(ctx context.Context, systemPrompt, userPrompt string) (string, error)
- type AgentConfig
- type ConversationMessage
- type DocGenerator
- type LLMProvider
- type ProviderConfig
- type SkillResult
- type ToolBridge
- type ToolCall
- type ToolHandler
- type UseCases
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the LLM-powered code intelligence agent. It delegates to a pluggable LLMProvider (Gemini, Ollama, etc.).
func NewAgent ¶
func NewAgent(ctx context.Context, cfg AgentConfig, provCfg ProviderConfig, bridge *ToolBridge, systemPrompt string) (*Agent, error)
NewAgent creates an Agent backed by the provider selected in provCfg.
func (*Agent) Chat ¶
func (a *Agent) Chat(ctx context.Context, history []ConversationMessage, message string) (string, []ConversationMessage, error)
Chat runs one turn in a multi-turn conversation and returns the updated history.
type AgentConfig ¶
AgentConfig configures the Gemini agent.
type ConversationMessage ¶
ConversationMessage is a single turn in a conversation.
type DocGenerator ¶
type DocGenerator struct {
// contains filtered or unexported fields
}
DocGenerator orchestrates multi-step documentation generation from graph data.
func NewDocGenerator ¶
func NewDocGenerator(agent *Agent, pool *pgxpool.Pool) *DocGenerator
NewDocGenerator creates a new DocGenerator.
func (*DocGenerator) GenerateSkillsForRepo ¶
func (g *DocGenerator) GenerateSkillsForRepo(ctx context.Context, repoID int64, repoPath string) ([]SkillResult, error)
GenerateSkillsForRepo generates one SKILL.md per community for the given repo.
func (*DocGenerator) GenerateWiki ¶
func (g *DocGenerator) GenerateWiki(ctx context.Context, repoID int64, outputDir string) ([]string, error)
GenerateWiki generates a full Markdown wiki from the knowledge graph.
func (*DocGenerator) GetWikiPages ¶
func (g *DocGenerator) GetWikiPages() map[string]string
GetWikiPages returns generated pages after GenerateWiki is called.
type LLMProvider ¶ added in v0.2.0
type LLMProvider interface {
Ask(ctx context.Context, question string) (string, error)
Chat(ctx context.Context, history []ConversationMessage, message string) (string, []ConversationMessage, error)
GenerateDoc(ctx context.Context, systemPrompt, userPrompt string) (string, error)
Close()
}
LLMProvider is the interface for an LLM-backed agent provider. Each provider manages its own agentic tool-calling loop.
type ProviderConfig ¶ added in v0.2.0
type ProviderConfig struct {
Provider string // "gemini" (default) | "ollama" | "openai"
GeminiKey string
OllamaURL string // default: http://localhost:11434
OllamaModel string // default: llama3.2
// OpenAI-compatible API settings
OpenAIBaseURL string // e.g. "http://10.1.1.246:8001/v1"
OpenAIAPIKey string
OpenAIModel string // e.g. "qwen3.5-35b"
OpenAIDisableThinking bool // disable reasoning/thinking mode (e.g. Qwen3)
}
ProviderConfig selects and configures the LLM provider.
type SkillResult ¶
SkillResult represents a generated SKILL.md file.
type ToolBridge ¶
type ToolBridge struct {
// contains filtered or unexported fields
}
ToolBridge holds all tool handlers for direct invocation.
func NewToolBridge ¶
func NewToolBridge(uc *UseCases) *ToolBridge
NewToolBridge wires all use cases into a callable tool map.
func (*ToolBridge) Execute ¶
func (b *ToolBridge) Execute(ctx context.Context, name string, args map[string]interface{}) (string, error)
Execute runs the named tool with the given arguments.
func (*ToolBridge) ToolNames ¶
func (b *ToolBridge) ToolNames() []string
ToolNames returns the list of registered tool names.
type ToolHandler ¶
ToolHandler executes a tool and returns a string result.
type UseCases ¶
type UseCases struct {
SearchCode *usecase.SearchCodeUseCase
ReadFile *usecase.ReadFileUseCase
FindSymbol *usecase.FindSymbolUseCase
FindCallers *usecase.FindCallersUseCase
ListEndpoints *usecase.ListEndpointsUseCase
GetFileSymbols *usecase.GetFileSymbolsUseCase
ListServices *usecase.ListServicesUseCase
GetServiceDeps *usecase.GetServiceDepsUseCase
GetAPIHandlers *usecase.GetAPIHandlersUseCase
}
UseCases groups all MCP use cases needed by the bridge.