Documentation
¶
Index ¶
- func ToProviderTools(tools []ToolDef) []map[string]any
- type BashTool
- type BreakdownInput
- type BreakdownTool
- type CallGraphTool
- type Context
- type DeepSearchFunc
- type DeepSearchTool
- type EditTool
- type FetchPageTool
- type GlobTool
- type GrepTool
- type MemoryRecallTool
- type MetadataUpdate
- type PdfIndexTool
- type PermissionRequest
- type ProjectIndexTool
- type ReadPdfPageTool
- type ReadTool
- type Registry
- type Result
- type ResultImage
- type SubmitDocIndexTool
- type ToolDef
- type WebSearchTool
- type WriteTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToProviderTools ¶
ToProviderTools converts tool definitions to provider format.
Types ¶
type BashTool ¶
type BashTool struct{}
func (BashTool) Description ¶
func (BashTool) Parameters ¶
func (BashTool) Parameters() json.RawMessage
type BreakdownInput ¶
type BreakdownInput struct {
Tasks []struct {
Title string `json:"title"`
Description string `json:"description"`
Dependencies []int `json:"dependencies"`
Effort string `json:"effort"`
Complexity string `json:"complexity"`
OrderIndex int `json:"orderIndex"`
} `json:"tasks"`
}
BreakdownInput matches the tool's parameter schema.
type BreakdownTool ¶
type BreakdownTool struct{}
BreakdownTool receives a structured task breakdown from the breakdown agent. The LLM calls this tool with properly formatted JSON (guaranteed valid by the tool-calling system), eliminating free-text JSON parsing issues.
func (BreakdownTool) Description ¶
func (t BreakdownTool) Description() string
func (BreakdownTool) Execute ¶
func (t BreakdownTool) Execute(_ context.Context, args json.RawMessage, _ Context) (Result, error)
func (BreakdownTool) ID ¶
func (t BreakdownTool) ID() string
func (BreakdownTool) Parameters ¶
func (t BreakdownTool) Parameters() json.RawMessage
type CallGraphTool ¶ added in v0.5.0
CallGraphTool lets the agent read and query the call graph store. The agent *is* the parser — it reads code, understands call relationships, and writes them into the database. This tool provides structured read/write access to the persisted graph.
func NewCallGraphTool ¶ added in v0.5.0
func NewCallGraphTool(s *callgraph.Store) CallGraphTool
func (CallGraphTool) Description ¶ added in v0.5.0
func (CallGraphTool) Description() string
func (CallGraphTool) Execute ¶ added in v0.5.0
func (t CallGraphTool) Execute(ctx context.Context, args json.RawMessage, tctx Context) (Result, error)
func (CallGraphTool) ID ¶ added in v0.5.0
func (CallGraphTool) ID() string
func (CallGraphTool) Parameters ¶ added in v0.5.0
func (t CallGraphTool) Parameters() json.RawMessage
type Context ¶
type Context struct {
SessionID session.SessionID
MessageID session.MessageID
Agent string
CallID string
Ctx context.Context
SessionDir string
Ask func(req PermissionRequest) error
Metadata func(meta MetadataUpdate) error
// ModelSupportsImages is true when the session's active model accepts image
// input. Tools may use this to decide whether to return an image (e.g. a
// rendered PDF page) instead of text.
ModelSupportsImages bool
// Model is the model ID the parent session is using. Tools that spawn child
// sessions (e.g. deep_search) should inherit this so they run on the same model.
Model string
}
Context is passed to every tool execution.
type DeepSearchFunc ¶ added in v0.8.0
DeepSearchFunc is a function that runs a child search-agent session and returns the synthesised answer. Implemented by agent.LoopRunner.RunSearchSession and wired in from server.go to avoid the tool→agent import cycle.
type DeepSearchTool ¶ added in v0.8.0
type DeepSearchTool struct {
Run DeepSearchFunc
}
DeepSearchTool lets any agent delegate a research query to the SearchAgent. It creates an ephemeral child session, runs the full search loop, and returns the synthesised text as the tool result.
func (DeepSearchTool) Description ¶ added in v0.8.0
func (DeepSearchTool) Description() string
func (DeepSearchTool) Execute ¶ added in v0.8.0
func (t DeepSearchTool) Execute(ctx context.Context, args json.RawMessage, tctx Context) (Result, error)
func (DeepSearchTool) ID ¶ added in v0.8.0
func (DeepSearchTool) ID() string
func (DeepSearchTool) Parameters ¶ added in v0.8.0
func (DeepSearchTool) Parameters() json.RawMessage
type EditTool ¶
type EditTool struct{}
func (EditTool) Description ¶
func (EditTool) Parameters ¶
func (EditTool) Parameters() json.RawMessage
type FetchPageTool ¶ added in v0.8.0
type FetchPageTool struct {
Bridge *search.BridgeClient
}
FetchPageTool retrieves the text content of a URL via the Playwright bridge.
func (FetchPageTool) Description ¶ added in v0.8.0
func (FetchPageTool) Description() string
func (FetchPageTool) Execute ¶ added in v0.8.0
func (t FetchPageTool) Execute(ctx context.Context, args json.RawMessage, _ Context) (Result, error)
func (FetchPageTool) ID ¶ added in v0.8.0
func (FetchPageTool) ID() string
func (FetchPageTool) Parameters ¶ added in v0.8.0
func (FetchPageTool) Parameters() json.RawMessage
type GlobTool ¶
type GlobTool struct{}
func (GlobTool) Description ¶
func (GlobTool) Parameters ¶
func (GlobTool) Parameters() json.RawMessage
type GrepTool ¶
type GrepTool struct{}
func (GrepTool) Description ¶
func (GrepTool) Parameters ¶
func (GrepTool) Parameters() json.RawMessage
type MemoryRecallTool ¶ added in v0.2.1
MemoryRecallTool lets the LLM query the agentic knowledge graph on demand.
func NewMemoryRecallTool ¶ added in v0.2.1
func NewMemoryRecallTool(mem *memory.Memory) MemoryRecallTool
func (MemoryRecallTool) Description ¶ added in v0.2.1
func (t MemoryRecallTool) Description() string
func (MemoryRecallTool) Execute ¶ added in v0.2.1
func (t MemoryRecallTool) Execute(ctx context.Context, args json.RawMessage, tctx Context) (Result, error)
func (MemoryRecallTool) ID ¶ added in v0.2.1
func (t MemoryRecallTool) ID() string
func (MemoryRecallTool) Parameters ¶ added in v0.2.1
func (t MemoryRecallTool) Parameters() json.RawMessage
type MetadataUpdate ¶
type MetadataUpdate struct {
Title string `json:"title,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
MetadataUpdate updates the running tool call's display metadata.
type PdfIndexTool ¶ added in v0.6.0
PdfIndexTool returns the stored semantic map for a PDF — page labels and keyword corpus — so the agent can decide which pages to read before calling read_pdf_page.
func NewPdfIndexTool ¶ added in v0.6.0
func NewPdfIndexTool(store *docindex.Store) PdfIndexTool
func (PdfIndexTool) Description ¶ added in v0.6.0
func (PdfIndexTool) Description() string
func (PdfIndexTool) Execute ¶ added in v0.6.0
func (t PdfIndexTool) Execute(_ context.Context, args json.RawMessage, tctx Context) (Result, error)
func (PdfIndexTool) ID ¶ added in v0.6.0
func (PdfIndexTool) ID() string
func (PdfIndexTool) Parameters ¶ added in v0.6.0
func (PdfIndexTool) Parameters() json.RawMessage
type PermissionRequest ¶
type PermissionRequest struct {
ID session.PermissionID
SessionID session.SessionID
Tool string
Input string
}
PermissionRequest is sent when a tool needs user approval.
type ProjectIndexTool ¶ added in v0.7.0
ProjectIndexTool returns a labeled JSON tree of all indexed text/code files in the session directory, so the agent can navigate the project by topic without knowing file paths upfront.
func NewProjectIndexTool ¶ added in v0.7.0
func NewProjectIndexTool(store *docindex.Store) ProjectIndexTool
func (ProjectIndexTool) Description ¶ added in v0.7.0
func (ProjectIndexTool) Description() string
func (ProjectIndexTool) Execute ¶ added in v0.7.0
func (t ProjectIndexTool) Execute(_ context.Context, args json.RawMessage, tctx Context) (Result, error)
func (ProjectIndexTool) ID ¶ added in v0.7.0
func (ProjectIndexTool) ID() string
func (ProjectIndexTool) Parameters ¶ added in v0.7.0
func (ProjectIndexTool) Parameters() json.RawMessage
type ReadPdfPageTool ¶ added in v0.6.0
type ReadPdfPageTool struct{}
ReadPdfPageTool extracts the text of a single PDF page for the agent to read.
func (ReadPdfPageTool) Description ¶ added in v0.6.0
func (ReadPdfPageTool) Description() string
func (ReadPdfPageTool) Execute ¶ added in v0.6.0
func (ReadPdfPageTool) Execute(_ context.Context, args json.RawMessage, tctx Context) (Result, error)
func (ReadPdfPageTool) ID ¶ added in v0.6.0
func (ReadPdfPageTool) ID() string
func (ReadPdfPageTool) Parameters ¶ added in v0.6.0
func (ReadPdfPageTool) Parameters() json.RawMessage
type ReadTool ¶
type ReadTool struct{}
func (ReadTool) Description ¶
func (ReadTool) Parameters ¶
func (ReadTool) Parameters() json.RawMessage
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered tools.
func NewRegistry ¶
func NewRegistry() *Registry
type Result ¶
type Result struct {
Title string `json:"title"`
Metadata map[string]any `json:"metadata,omitempty"`
Output string `json:"output"`
// Image, when non-nil, is an image the tool wants the model to see (e.g. a
// rendered PDF page). It is delivered to the model alongside Output, in a
// provider-appropriate way. Only honored for vision-capable models.
Image *ResultImage `json:"image,omitempty"`
}
Result is returned from tool execution.
type ResultImage ¶ added in v0.6.0
ResultImage is an image attachment on a tool Result. Data is base64-encoded image bytes; MediaType is e.g. "image/jpeg".
type SubmitDocIndexTool ¶ added in v0.6.0
SubmitDocIndexTool allows the index agent to store semantic page labels.
func NewSubmitDocIndexTool ¶ added in v0.6.0
func NewSubmitDocIndexTool(store *docindex.Store) SubmitDocIndexTool
NewSubmitDocIndexTool creates a new SubmitDocIndexTool.
func (SubmitDocIndexTool) Description ¶ added in v0.6.0
func (SubmitDocIndexTool) Description() string
func (SubmitDocIndexTool) Execute ¶ added in v0.6.0
func (t SubmitDocIndexTool) Execute(_ context.Context, args json.RawMessage, _ Context) (Result, error)
func (SubmitDocIndexTool) ID ¶ added in v0.6.0
func (SubmitDocIndexTool) ID() string
func (SubmitDocIndexTool) Parameters ¶ added in v0.6.0
func (SubmitDocIndexTool) Parameters() json.RawMessage
type ToolDef ¶
type ToolDef interface {
ID() string
Description() string
Parameters() json.RawMessage
Execute(ctx context.Context, args json.RawMessage, tctx Context) (Result, error)
}
ToolDef is the interface every tool must implement.
type WebSearchTool ¶ added in v0.8.0
type WebSearchTool struct {
Bridge *search.BridgeClient
}
WebSearchTool searches the web via the Playwright bridge and returns a markdown list of results.
func (WebSearchTool) Description ¶ added in v0.8.0
func (WebSearchTool) Description() string
func (WebSearchTool) Execute ¶ added in v0.8.0
func (t WebSearchTool) Execute(ctx context.Context, args json.RawMessage, _ Context) (Result, error)
func (WebSearchTool) ID ¶ added in v0.8.0
func (WebSearchTool) ID() string
func (WebSearchTool) Parameters ¶ added in v0.8.0
func (WebSearchTool) Parameters() json.RawMessage
type WriteTool ¶
type WriteTool struct{}
func (WriteTool) Description ¶
func (WriteTool) Parameters ¶
func (WriteTool) Parameters() json.RawMessage