Documentation
¶
Index ¶
- Constants
- func GetContextValues(ctx context.Context) (string, string)
- func ResetAllCaches()
- func ResetRegexCache()
- type BaseTool
- func NewBashTool(permission permission.Service) BaseTool
- func NewCodeFindSymbolTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeGetProjectStatsTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeGetSymbolsOverviewTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeHybridSearchTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeIndexProjectTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeIndexStatusTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeListProjectsTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeReindexFileTool(indexer *code.CodeIndexer) BaseTool
- func NewCodeSearchPatternTool(indexer *code.CodeIndexer) BaseTool
- func NewDiagnosticsTool(lspClients map[string]*lsp.Client) BaseTool
- func NewEditTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewFetchTool(permissions permission.Service) BaseTool
- func NewGlobTool() BaseTool
- func NewGrepTool() BaseTool
- func NewKBAddDocumentTool(store *kb.KBStore) BaseTool
- func NewKBDeleteDocumentTool(store *kb.KBStore) BaseTool
- func NewKBGetDocumentTool(store *kb.KBStore) BaseTool
- func NewKBSearchDocumentsTool(store *kb.KBStore) BaseTool
- func NewLsTool() BaseTool
- func NewMesnadaCancelTaskTool(orch *orchestrator.Orchestrator) BaseTool
- func NewMesnadaGetOutputTool(orch *orchestrator.Orchestrator) BaseTool
- func NewMesnadaGetTaskTool(orch *orchestrator.Orchestrator) BaseTool
- func NewMesnadaListTasksTool(orch *orchestrator.Orchestrator) BaseTool
- func NewMesnadaSpawnTool(orch *orchestrator.Orchestrator) BaseTool
- func NewMesnadaWaitTaskTool(orch *orchestrator.Orchestrator) BaseTool
- func NewPatchTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewSaveEventTool(store *events.EventStore) BaseTool
- func NewSearchEventsTool(store *events.EventStore) BaseTool
- func NewSourcegraphTool() BaseTool
- func NewViewTool(lspClients map[string]*lsp.Client) BaseTool
- func NewWriteTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- type BashParams
- type BashPermissionsParams
- type BashResponseMetadata
- type CodeFindSymbolTool
- type CodeGetProjectStatsTool
- type CodeGetSymbolsOverviewTool
- type CodeHybridSearchTool
- type CodeIndexProjectTool
- type CodeIndexStatusTool
- type CodeListProjectsTool
- type CodeReindexFileTool
- type CodeSearchPatternTool
- type DiagnosticsParams
- type EditParams
- type EditPermissionsParams
- type EditResponseMetadata
- type EditStrategy
- type FetchParams
- type FetchPermissionsParams
- type GlobParams
- type GlobResponseMetadata
- type GrepParams
- type GrepResponseMetadata
- type KBAddDocumentTool
- type KBDeleteDocumentTool
- type KBGetDocumentTool
- type KBSearchDocumentsTool
- type LSParams
- type LSResponseMetadata
- type LineScanner
- type MesnadaCancelTaskTool
- type MesnadaGetOutputTool
- type MesnadaGetTaskTool
- type MesnadaListTasksTool
- type MesnadaSpawnTool
- type MesnadaWaitTaskTool
- type PatchParams
- type PatchResponseMetadata
- type SaveEventTool
- type SearchEventsTool
- type SourcegraphParams
- type SourcegraphResponseMetadata
- type ToolCall
- type ToolInfo
- type ToolResponse
- type TreeNode
- type ViewParams
- type ViewResponseMetadata
- type WriteParams
- type WritePermissionsParams
- type WriteResponseMetadata
Constants ¶
const ( BashToolName = "bash" DefaultTimeout = 1 * 60 * 1000 // 1 minutes in milliseconds MaxTimeout = 10 * 60 * 1000 // 10 minutes in milliseconds MaxOutputLength = 30000 )
const ( LSToolName = "ls" MaxLSFiles = 1000 )
const ( ToolResponseTypeText toolResponseType = "text" ToolResponseTypeImage toolResponseType = "image" SessionIDContextKey sessionIDContextKey = "session_id" MessageIDContextKey messageIDContextKey = "message_id" ACPClientConnContextKey acpClientConnContextKey = "acp_client_connection" )
const ( ViewToolName = "view" MaxReadSize = 250 * 1024 DefaultReadLimit = 2000 MaxLineLength = 2000 )
const (
DiagnosticsToolName = "diagnostics"
)
const (
EditToolName = "edit"
)
const (
FetchToolName = "fetch"
)
const (
GlobToolName = "glob"
)
const (
GrepToolName = "grep"
)
const (
PatchToolName = "patch"
)
const (
SourcegraphToolName = "sourcegraph"
)
const (
WriteToolName = "write"
)
Variables ¶
This section is empty.
Functions ¶
func ResetAllCaches ¶ added in v0.14.0
func ResetAllCaches()
ResetAllCaches clears all session-scoped caches (file locks and regex cache). Call this at the end of each session to prevent memory leaks.
func ResetRegexCache ¶ added in v0.14.0
func ResetRegexCache()
ResetRegexCache clears all cached regular expressions. Should be called at session end to prevent memory leaks.
Types ¶
type BaseTool ¶
type BaseTool interface {
Info() ToolInfo
Run(ctx context.Context, params ToolCall) (ToolResponse, error)
}
func NewBashTool ¶
func NewBashTool(permission permission.Service) BaseTool
func NewCodeFindSymbolTool ¶ added in v0.7.0
func NewCodeFindSymbolTool(indexer *code.CodeIndexer) BaseTool
func NewCodeGetProjectStatsTool ¶ added in v0.7.0
func NewCodeGetProjectStatsTool(indexer *code.CodeIndexer) BaseTool
func NewCodeGetSymbolsOverviewTool ¶ added in v0.7.0
func NewCodeGetSymbolsOverviewTool(indexer *code.CodeIndexer) BaseTool
func NewCodeHybridSearchTool ¶ added in v0.7.0
func NewCodeHybridSearchTool(indexer *code.CodeIndexer) BaseTool
func NewCodeIndexProjectTool ¶ added in v0.7.0
func NewCodeIndexProjectTool(indexer *code.CodeIndexer) BaseTool
func NewCodeIndexStatusTool ¶ added in v0.7.0
func NewCodeIndexStatusTool(indexer *code.CodeIndexer) BaseTool
func NewCodeListProjectsTool ¶ added in v0.7.0
func NewCodeListProjectsTool(indexer *code.CodeIndexer) BaseTool
func NewCodeReindexFileTool ¶ added in v0.7.0
func NewCodeReindexFileTool(indexer *code.CodeIndexer) BaseTool
func NewCodeSearchPatternTool ¶ added in v0.7.0
func NewCodeSearchPatternTool(indexer *code.CodeIndexer) BaseTool
func NewEditTool ¶
func NewFetchTool ¶
func NewFetchTool(permissions permission.Service) BaseTool
func NewGlobTool ¶
func NewGlobTool() BaseTool
func NewGrepTool ¶
func NewGrepTool() BaseTool
func NewKBAddDocumentTool ¶ added in v0.7.0
NewKBAddDocumentTool creates a new KBAddDocumentTool.
func NewKBDeleteDocumentTool ¶ added in v0.7.0
NewKBDeleteDocumentTool creates a new KBDeleteDocumentTool.
func NewKBGetDocumentTool ¶ added in v0.7.0
NewKBGetDocumentTool creates a new KBGetDocumentTool.
func NewKBSearchDocumentsTool ¶ added in v0.7.0
NewKBSearchDocumentsTool creates a new KBSearchDocumentsTool.
func NewMesnadaCancelTaskTool ¶
func NewMesnadaCancelTaskTool(orch *orchestrator.Orchestrator) BaseTool
func NewMesnadaGetOutputTool ¶
func NewMesnadaGetOutputTool(orch *orchestrator.Orchestrator) BaseTool
func NewMesnadaGetTaskTool ¶
func NewMesnadaGetTaskTool(orch *orchestrator.Orchestrator) BaseTool
func NewMesnadaListTasksTool ¶
func NewMesnadaListTasksTool(orch *orchestrator.Orchestrator) BaseTool
func NewMesnadaSpawnTool ¶
func NewMesnadaSpawnTool(orch *orchestrator.Orchestrator) BaseTool
func NewMesnadaWaitTaskTool ¶
func NewMesnadaWaitTaskTool(orch *orchestrator.Orchestrator) BaseTool
func NewPatchTool ¶
func NewSaveEventTool ¶ added in v0.7.0
func NewSaveEventTool(store *events.EventStore) BaseTool
NewSaveEventTool creates a new SaveEventTool.
func NewSearchEventsTool ¶ added in v0.7.0
func NewSearchEventsTool(store *events.EventStore) BaseTool
NewSearchEventsTool creates a new SearchEventsTool.
func NewSourcegraphTool ¶
func NewSourcegraphTool() BaseTool
func NewWriteTool ¶
type BashParams ¶
type BashPermissionsParams ¶
type BashResponseMetadata ¶
type CodeFindSymbolTool ¶ added in v0.7.0
type CodeFindSymbolTool struct {
// contains filtered or unexported fields
}
CodeFindSymbolTool finds symbols by name pattern.
func (*CodeFindSymbolTool) Info ¶ added in v0.7.0
func (t *CodeFindSymbolTool) Info() ToolInfo
func (*CodeFindSymbolTool) Run ¶ added in v0.7.0
func (t *CodeFindSymbolTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeGetProjectStatsTool ¶ added in v0.7.0
type CodeGetProjectStatsTool struct {
// contains filtered or unexported fields
}
CodeGetProjectStatsTool returns statistics for an indexed project.
func (*CodeGetProjectStatsTool) Info ¶ added in v0.7.0
func (t *CodeGetProjectStatsTool) Info() ToolInfo
func (*CodeGetProjectStatsTool) Run ¶ added in v0.7.0
func (t *CodeGetProjectStatsTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeGetSymbolsOverviewTool ¶ added in v0.7.0
type CodeGetSymbolsOverviewTool struct {
// contains filtered or unexported fields
}
CodeGetSymbolsOverviewTool returns a high-level overview of symbols in a file.
func (*CodeGetSymbolsOverviewTool) Info ¶ added in v0.7.0
func (t *CodeGetSymbolsOverviewTool) Info() ToolInfo
func (*CodeGetSymbolsOverviewTool) Run ¶ added in v0.7.0
func (t *CodeGetSymbolsOverviewTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeHybridSearchTool ¶ added in v0.7.0
type CodeHybridSearchTool struct {
// contains filtered or unexported fields
}
CodeHybridSearchTool performs hybrid semantic + FTS search over code symbols.
func (*CodeHybridSearchTool) Info ¶ added in v0.7.0
func (t *CodeHybridSearchTool) Info() ToolInfo
func (*CodeHybridSearchTool) Run ¶ added in v0.7.0
func (t *CodeHybridSearchTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeIndexProjectTool ¶ added in v0.7.0
type CodeIndexProjectTool struct {
// contains filtered or unexported fields
}
CodeIndexProjectTool starts indexing a code project.
func (*CodeIndexProjectTool) Info ¶ added in v0.7.0
func (t *CodeIndexProjectTool) Info() ToolInfo
func (*CodeIndexProjectTool) Run ¶ added in v0.7.0
func (t *CodeIndexProjectTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeIndexStatusTool ¶ added in v0.7.0
type CodeIndexStatusTool struct {
// contains filtered or unexported fields
}
CodeIndexStatusTool returns the status of an indexing job.
func (*CodeIndexStatusTool) Info ¶ added in v0.7.0
func (t *CodeIndexStatusTool) Info() ToolInfo
func (*CodeIndexStatusTool) Run ¶ added in v0.7.0
func (t *CodeIndexStatusTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeListProjectsTool ¶ added in v0.7.0
type CodeListProjectsTool struct {
// contains filtered or unexported fields
}
CodeListProjectsTool lists all indexed projects.
func (*CodeListProjectsTool) Info ¶ added in v0.7.0
func (t *CodeListProjectsTool) Info() ToolInfo
func (*CodeListProjectsTool) Run ¶ added in v0.7.0
func (t *CodeListProjectsTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeReindexFileTool ¶ added in v0.7.0
type CodeReindexFileTool struct {
// contains filtered or unexported fields
}
CodeReindexFileTool re-indexes a single file.
func (*CodeReindexFileTool) Info ¶ added in v0.7.0
func (t *CodeReindexFileTool) Info() ToolInfo
func (*CodeReindexFileTool) Run ¶ added in v0.7.0
func (t *CodeReindexFileTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type CodeSearchPatternTool ¶ added in v0.7.0
type CodeSearchPatternTool struct {
// contains filtered or unexported fields
}
CodeSearchPatternTool searches for text patterns in code symbols.
func (*CodeSearchPatternTool) Info ¶ added in v0.7.0
func (t *CodeSearchPatternTool) Info() ToolInfo
func (*CodeSearchPatternTool) Run ¶ added in v0.7.0
func (t *CodeSearchPatternTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type DiagnosticsParams ¶
type DiagnosticsParams struct {
FilePath string `json:"file_path"`
}
type EditParams ¶
type EditPermissionsParams ¶
type EditResponseMetadata ¶
type EditStrategy ¶ added in v0.14.0
type EditStrategy interface {
Apply(content, oldStr, newStr string) (result string, matched bool)
Name() string
}
EditStrategy tries to find oldStr in content and replace it with newStr. Returns (result, true) on success, ("", false) if not matched. IMPORTANT: normalization is applied only for MATCHING, not for the replacement. The actual replacement must use the original content at the found position.
type FetchParams ¶
type FetchPermissionsParams ¶
type GlobParams ¶
type GlobResponseMetadata ¶
type GrepParams ¶
type GrepParams struct {
Pattern string `json:"pattern"`
Path string `json:"path"`
Include string `json:"include"`
LiteralText bool `json:"literal_text"`
// Extended parameters
OutputMode string `json:"output_mode"` // "content" | "files_with_matches" | "count" (default: "files_with_matches")
Context int `json:"context"` // lines of context before AND after (-C)
Before int `json:"before"` // lines before match (-B), overrides Context
After int `json:"after"` // lines after match (-A), overrides Context
Type string `json:"type"` // file type filter: "go", "js", "py", "ts", "rust", etc.
Multiline bool `json:"multiline"` // enable multiline matching
HeadLimit int `json:"head_limit"` // cap total results (0 = use default 100)
Offset int `json:"offset"` // skip first N results for pagination
}
type GrepResponseMetadata ¶
type KBAddDocumentTool ¶ added in v0.7.0
type KBAddDocumentTool struct {
// contains filtered or unexported fields
}
KBAddDocumentTool adds a document to the knowledge base.
func (*KBAddDocumentTool) Info ¶ added in v0.7.0
func (t *KBAddDocumentTool) Info() ToolInfo
func (*KBAddDocumentTool) Run ¶ added in v0.7.0
func (t *KBAddDocumentTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type KBDeleteDocumentTool ¶ added in v0.7.0
type KBDeleteDocumentTool struct {
// contains filtered or unexported fields
}
KBDeleteDocumentTool removes a document from the knowledge base.
func (*KBDeleteDocumentTool) Info ¶ added in v0.7.0
func (t *KBDeleteDocumentTool) Info() ToolInfo
func (*KBDeleteDocumentTool) Run ¶ added in v0.7.0
func (t *KBDeleteDocumentTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type KBGetDocumentTool ¶ added in v0.7.0
type KBGetDocumentTool struct {
// contains filtered or unexported fields
}
KBGetDocumentTool retrieves a document from the knowledge base by path.
func (*KBGetDocumentTool) Info ¶ added in v0.7.0
func (t *KBGetDocumentTool) Info() ToolInfo
func (*KBGetDocumentTool) Run ¶ added in v0.7.0
func (t *KBGetDocumentTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type KBSearchDocumentsTool ¶ added in v0.7.0
type KBSearchDocumentsTool struct {
// contains filtered or unexported fields
}
KBSearchDocumentsTool searches documents in the knowledge base.
func (*KBSearchDocumentsTool) Info ¶ added in v0.7.0
func (t *KBSearchDocumentsTool) Info() ToolInfo
func (*KBSearchDocumentsTool) Run ¶ added in v0.7.0
func (t *KBSearchDocumentsTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type LSResponseMetadata ¶
type LineScanner ¶
type LineScanner struct {
// contains filtered or unexported fields
}
func NewLineScanner ¶
func NewLineScanner(r io.Reader) *LineScanner
func (*LineScanner) Err ¶
func (s *LineScanner) Err() error
func (*LineScanner) Scan ¶
func (s *LineScanner) Scan() bool
func (*LineScanner) Text ¶
func (s *LineScanner) Text() string
type MesnadaCancelTaskTool ¶
type MesnadaCancelTaskTool struct {
// contains filtered or unexported fields
}
MesnadaCancelTaskTool cancels a running or pending Mesnada task.
func (*MesnadaCancelTaskTool) Info ¶
func (t *MesnadaCancelTaskTool) Info() ToolInfo
func (*MesnadaCancelTaskTool) Run ¶
func (t *MesnadaCancelTaskTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type MesnadaGetOutputTool ¶
type MesnadaGetOutputTool struct {
// contains filtered or unexported fields
}
MesnadaGetOutputTool returns task output for a Mesnada task.
func (*MesnadaGetOutputTool) Info ¶
func (t *MesnadaGetOutputTool) Info() ToolInfo
func (*MesnadaGetOutputTool) Run ¶
func (t *MesnadaGetOutputTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type MesnadaGetTaskTool ¶
type MesnadaGetTaskTool struct {
// contains filtered or unexported fields
}
MesnadaGetTaskTool returns full task information for a Mesnada task.
func (*MesnadaGetTaskTool) Info ¶
func (t *MesnadaGetTaskTool) Info() ToolInfo
func (*MesnadaGetTaskTool) Run ¶
func (t *MesnadaGetTaskTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type MesnadaListTasksTool ¶
type MesnadaListTasksTool struct {
// contains filtered or unexported fields
}
MesnadaListTasksTool lists Mesnada tasks using optional filters.
func (*MesnadaListTasksTool) Info ¶
func (t *MesnadaListTasksTool) Info() ToolInfo
func (*MesnadaListTasksTool) Run ¶
func (t *MesnadaListTasksTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type MesnadaSpawnTool ¶
type MesnadaSpawnTool struct {
// contains filtered or unexported fields
}
MesnadaSpawnTool creates and runs a Mesnada task directly through the orchestrator.
func (*MesnadaSpawnTool) Info ¶
func (t *MesnadaSpawnTool) Info() ToolInfo
func (*MesnadaSpawnTool) Run ¶
func (t *MesnadaSpawnTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type MesnadaWaitTaskTool ¶
type MesnadaWaitTaskTool struct {
// contains filtered or unexported fields
}
MesnadaWaitTaskTool waits for a Mesnada task to reach a terminal state.
func (*MesnadaWaitTaskTool) Info ¶
func (t *MesnadaWaitTaskTool) Info() ToolInfo
func (*MesnadaWaitTaskTool) Run ¶
func (t *MesnadaWaitTaskTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type PatchParams ¶
type PatchParams struct {
PatchText string `json:"patch_text"`
}
type PatchResponseMetadata ¶
type SaveEventTool ¶ added in v0.7.0
type SaveEventTool struct {
// contains filtered or unexported fields
}
SaveEventTool stores a temporal event with semantic search.
func (*SaveEventTool) Info ¶ added in v0.7.0
func (t *SaveEventTool) Info() ToolInfo
func (*SaveEventTool) Run ¶ added in v0.7.0
func (t *SaveEventTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type SearchEventsTool ¶ added in v0.7.0
type SearchEventsTool struct {
// contains filtered or unexported fields
}
SearchEventsTool searches events with hybrid text and time filters.
func (*SearchEventsTool) Info ¶ added in v0.7.0
func (t *SearchEventsTool) Info() ToolInfo
func (*SearchEventsTool) Run ¶ added in v0.7.0
func (t *SearchEventsTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error)
type SourcegraphParams ¶
type ToolResponse ¶
type ToolResponse struct {
Type toolResponseType `json:"type"`
Content string `json:"content"`
Metadata string `json:"metadata,omitempty"`
IsError bool `json:"is_error"`
}
func NewTextErrorResponse ¶
func NewTextErrorResponse(content string) ToolResponse
func NewTextResponse ¶
func NewTextResponse(content string) ToolResponse
func WithResponseMetadata ¶
func WithResponseMetadata(response ToolResponse, metadata any) ToolResponse