Documentation
¶
Overview ¶
Package tools provides the tool system for extending Jeff with external capabilities. ABOUTME: AskUserQuestion tool for interactive decision-making ABOUTME: Presents multiple-choice questions to users and collects answers
ABOUTME: Currency Conversion tool implementation - converts currencies using ECB exchange rates ABOUTME: Uses Frankfurter API (ECB data) - no API key required
ABOUTME: Email Validator tool implementation - validates email addresses ABOUTME: Supports format validation, DNS MX record lookup, and common typo suggestions
ABOUTME: Holiday tool implementation - provides US federal holiday information ABOUTME: Supports checking if dates are holidays, listing holidays by year, and finding next holidays
ABOUTME: Meeting Cost Calculator tool implementation - calculates meeting costs and ROI ABOUTME: Supports cost calculation, per-person breakdown, and ROI analysis
ABOUTME: Stock Price tool implementation - retrieves stock data from Finnhub API ABOUTME: Requires Finnhub API key (supports dynamic configuration via parameters)
ABOUTME: Text Analysis tool implementation - provides text statistics and analysis ABOUTME: Supports word count, character count, reading time estimation, and text statistics
ABOUTME: Weather tool implementation - retrieves weather data from Open-Meteo ABOUTME: Free API, no key required. Supports current conditions and 7-day forecast.
ABOUTME: Working Days tool implementation - provides business day calculations ABOUTME: Supports checking working days, counting business days between dates, adding business days
Example ¶
Example demonstrates the complete tool system workflow
package main
import (
"context"
"fmt"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
// 1. Create a registry
registry := tools.NewRegistry()
// 2. Create and register a safe tool (no approval needed)
safeTool := &tools.MockTool{
NameValue: "echo",
DescriptionValue: "Echoes back the input",
RequiresApprovalValue: false,
ExecuteFunc: func(_ context.Context, params map[string]interface{}) (*tools.Result, error) {
message := params["message"].(string)
return &tools.Result{
ToolName: "echo",
Success: true,
Output: message,
}, nil
},
}
_ = registry.Register(safeTool)
// 3. Create and register a dangerous tool (requires approval)
dangerousTool := &tools.MockTool{
NameValue: "delete_file",
DescriptionValue: "Deletes a file",
RequiresApprovalValue: true,
ExecuteFunc: func(_ context.Context, params map[string]interface{}) (*tools.Result, error) {
path := params["path"].(string)
return &tools.Result{
ToolName: "delete_file",
Success: true,
Output: fmt.Sprintf("Deleted %s", path),
}, nil
},
}
_ = registry.Register(dangerousTool)
// 4. Create an executor with approval function
approvalFunc := func(toolName string, params map[string]interface{}) bool {
// In a real application, this would prompt the user
// For this example, we'll approve delete operations on /tmp
if toolName == "delete_file" {
path := params["path"].(string)
return path == "/tmp/test.txt"
}
return true
}
executor := tools.NewExecutor(registry, approvalFunc)
// 5. Execute the safe tool (no approval needed)
ctx := context.Background()
result1, _ := executor.Execute(ctx, "echo", map[string]interface{}{
"message": "Hello, World!",
})
fmt.Printf("Echo result: %s\n", result1.Output)
// 6. Execute dangerous tool with approved path
result2, _ := executor.Execute(ctx, "delete_file", map[string]interface{}{
"path": "/tmp/test.txt",
})
fmt.Printf("Delete result (approved): %s\n", result2.Output)
// 7. Execute dangerous tool with denied path
result3, _ := executor.Execute(ctx, "delete_file", map[string]interface{}{
"path": "/etc/passwd",
})
fmt.Printf("Delete result (denied): success=%v, error=%s\n", result3.Success, result3.Error)
// 8. List all registered tools
tools := registry.List()
fmt.Printf("Registered tools: %v\n", tools)
}
Output: Echo result: Hello, World! Delete result (approved): Deleted /tmp/test.txt Delete result (denied): success=false, error=user denied permission Registered tools: [delete_file echo]
Example (CompleteWorkflow) ¶
Example_completeWorkflow demonstrates a complete tool system workflow
package main
import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
// Simulate a simple file system tool
type FileSystemTool struct {
name string
}
readTool := &FileSystemTool{name: "read_file"}
writeTool := &FileSystemTool{name: "write_file"}
// Implement Tool interface for FileSystemTool
getName := func(t *FileSystemTool) string { return t.name }
getDesc := func(t *FileSystemTool) string { return fmt.Sprintf("Tool: %s", t.name) }
requiresApproval := func(t *FileSystemTool, _ map[string]interface{}) bool {
// Write operations require approval
return t.name == "write_file"
}
execute := func(t *FileSystemTool, _ context.Context, params map[string]interface{}) (*tools.Result, error) {
path := params["path"].(string)
if t.name == "read_file" {
return &tools.Result{
ToolName: t.name,
Success: true,
Output: fmt.Sprintf("Contents of %s", path),
Metadata: map[string]interface{}{"path": path},
}, nil
}
// write_file
content := params["content"].(string)
return &tools.Result{
ToolName: t.name,
Success: true,
Output: fmt.Sprintf("Wrote %d bytes to %s", len(content), path),
Metadata: map[string]interface{}{"path": path, "bytes": len(content)},
}, nil
}
// Wrap in MockTool for demonstration
readMock := &tools.MockTool{
NameValue: getName(readTool),
DescriptionValue: getDesc(readTool),
ExecuteFunc: func(ctx context.Context, params map[string]interface{}) (*tools.Result, error) {
return execute(readTool, ctx, params)
},
}
writeMock := &tools.MockTool{
NameValue: getName(writeTool),
DescriptionValue: getDesc(writeTool),
RequiresApprovalValue: requiresApproval(writeTool, nil),
ExecuteFunc: func(ctx context.Context, params map[string]interface{}) (*tools.Result, error) {
return execute(writeTool, ctx, params)
},
}
// 1. Setup: Create registry and register tools
registry := tools.NewRegistry()
_ = registry.Register(readMock)
_ = registry.Register(writeMock)
// 2. Create executor with approval logic
approvalFunc := func(toolName string, params map[string]interface{}) bool {
// Approve writes to /tmp, deny others
if toolName == "write_file" {
path := params["path"].(string)
return strings.HasPrefix(path, "/tmp/")
}
return true
}
executor := tools.NewExecutor(registry, approvalFunc)
// 3. Simulate API request (read_file)
apiRequest1 := `{
"type": "tool_use",
"id": "toolu_read_123",
"name": "read_file",
"input": {
"path": "/tmp/config.json"
}
}`
var toolUse1 tools.ToolUse
_ = json.Unmarshal([]byte(apiRequest1), &toolUse1)
// 4. Execute tool
ctx := context.Background()
result1, _ := executor.Execute(ctx, toolUse1.Name, toolUse1.Input)
// 5. Convert to API response
toolResult1 := tools.ResultToToolResult(result1, toolUse1.ID)
fmt.Printf("Read operation: success=%v\n", !toolResult1.IsError)
// 6. Simulate API request (write_file with approval)
apiRequest2 := `{
"type": "tool_use",
"id": "toolu_write_456",
"name": "write_file",
"input": {
"path": "/tmp/output.txt",
"content": "Hello, World!"
}
}`
var toolUse2 tools.ToolUse
_ = json.Unmarshal([]byte(apiRequest2), &toolUse2)
result2, _ := executor.Execute(ctx, toolUse2.Name, toolUse2.Input)
toolResult2 := tools.ResultToToolResult(result2, toolUse2.ID)
fmt.Printf("Write operation (approved): success=%v\n", !toolResult2.IsError)
// 7. Simulate denied write operation
apiRequest3 := `{
"type": "tool_use",
"id": "toolu_write_789",
"name": "write_file",
"input": {
"path": "/etc/passwd",
"content": "malicious"
}
}`
var toolUse3 tools.ToolUse
_ = json.Unmarshal([]byte(apiRequest3), &toolUse3)
result3, _ := executor.Execute(ctx, toolUse3.Name, toolUse3.Input)
toolResult3 := tools.ResultToToolResult(result3, toolUse3.ID)
fmt.Printf("Write operation (denied): success=%v\n", !toolResult3.IsError)
// 8. List all available tools
availableTools := registry.List()
fmt.Printf("Available tools: %v\n", availableTools)
}
Output: Read operation: success=true Write operation (approved): success=true Write operation (denied): success=false Available tools: [read_file write_file]
Index ¶
- Constants
- func GetToolSchema(toolName string) map[string]interface{}
- type AcceptEventTool
- type ApprovalFunc
- type ArchiveEmailTool
- type AskUserQuestionTool
- type BackgroundProcess
- func (bp *BackgroundProcess) AppendStderr(line string)
- func (bp *BackgroundProcess) AppendStdout(line string)
- func (bp *BackgroundProcess) GetExitCode() int
- func (bp *BackgroundProcess) GetNewOutput() (stdout []string, stderr []string)
- func (bp *BackgroundProcess) IsDone() bool
- func (bp *BackgroundProcess) MarkDone(exitCode int)
- type BackgroundProcessRegistry
- type BashOutputTool
- type BashTool
- type CalenderingTool
- type CompleteTaskTool
- type CreateContactTool
- type CreateEmailDraftTool
- type CreateEventTool
- type CreateTaskTool
- type CurrencyTool
- type DeclineEventTool
- type DeleteContactTool
- type DeleteEmailTool
- type DeleteEventTool
- type DeleteTaskTool
- type DisplayCallback
- type DisplayTool
- type EditTool
- type EmailValidatorTool
- type Executor
- type FindFreeTimeTool
- type FinnhubNews
- type FinnhubProfile
- type FinnhubQuote
- type ForwardEmailTool
- type FrankfurterResponse
- type GetEmailThreadTool
- type GetEventTool
- type GlobTool
- type GrepTool
- type HolidayTool
- type KillShellTool
- type LabelEmailTool
- type ListCalendarsTool
- type ListEmailLabelsTool
- type ListEventsTool
- type ListTasksTool
- type MarkEmailReadTool
- type MarkEmailUnreadTool
- type MeetingCostTool
- type MockTool
- type OpenMeteoCurrentResponse
- type OpenMeteoForecastResponse
- type ProposeNewTimeTool
- type ReadContactTool
- type ReadEmailTool
- type ReadTool
- type Registry
- type ReplyEmailTool
- type Result
- type SearchContactsTool
- type SearchEmailsTool
- type SearchEventsTool
- type SearchResult
- type SendEmailTool
- type StockTool
- type TaskTool
- func (t *TaskTool) Description() string
- func (t *TaskTool) Execute(ctx context.Context, params map[string]interface{}) (*Result, error)
- func (t *TaskTool) ExecuteStreaming(ctx context.Context, params map[string]interface{}) (<-chan *Result, error)
- func (t *TaskTool) Name() string
- func (t *TaskTool) RequiresApproval(_ map[string]interface{}) bool
- type TentativeEventTool
- type TextAnalysisTool
- type TextStats
- type TodoWriteTool
- type Tool
- func NewAcceptEventTool(registry *providers.Registry) Tool
- func NewArchiveEmailTool(registry *providers.Registry) Tool
- func NewAskUserQuestionTool() Tool
- func NewCompleteTaskTool(registry *providers.Registry) Tool
- func NewCreateContactTool(registry *providers.Registry) Tool
- func NewCreateEmailDraftTool(registry *providers.Registry) Tool
- func NewCreateEventTool(registry *providers.Registry) Tool
- func NewCreateTaskTool(registry *providers.Registry) Tool
- func NewDeclineEventTool(registry *providers.Registry) Tool
- func NewDeleteContactTool(registry *providers.Registry) Tool
- func NewDeleteEmailTool(registry *providers.Registry) Tool
- func NewDeleteEventTool(registry *providers.Registry) Tool
- func NewDeleteTaskTool(registry *providers.Registry) Tool
- func NewFindFreeTimeTool(registry *providers.Registry) Tool
- func NewForwardEmailTool(registry *providers.Registry) Tool
- func NewGetEmailThreadTool(registry *providers.Registry) Tool
- func NewGetEventTool(registry *providers.Registry) Tool
- func NewLabelEmailTool(registry *providers.Registry) Tool
- func NewListCalendarsTool(registry *providers.Registry) Tool
- func NewListEmailLabelsTool(registry *providers.Registry) Tool
- func NewListEventsTool(registry *providers.Registry) Tool
- func NewListTasksTool(registry *providers.Registry) Tool
- func NewMarkEmailReadTool(registry *providers.Registry) Tool
- func NewMarkEmailUnreadTool(registry *providers.Registry) Tool
- func NewProposeNewTimeTool(registry *providers.Registry) Tool
- func NewReadContactTool(registry *providers.Registry) Tool
- func NewReadEmailTool(registry *providers.Registry) Tool
- func NewReplyEmailTool(registry *providers.Registry) Tool
- func NewSearchContactsTool(registry *providers.Registry) Tool
- func NewSearchEmailsTool(registry *providers.Registry) Tool
- func NewSearchEventsTool(registry *providers.Registry) Tool
- func NewSendEmailTool(registry *providers.Registry) Tool
- func NewTentativeEventTool(registry *providers.Registry) Tool
- func NewTodoWriteTool() Tool
- func NewTodoWriteToolWithDB(db *sql.DB) Tool
- func NewUpdateContactTool(registry *providers.Registry) Tool
- func NewUpdateEventTool(registry *providers.Registry) Tool
- func NewUpdateTaskTool(registry *providers.Registry) Tool
- func NewWebFetchTool() Tool
- func NewWebSearchTool() Tool
- type ToolResult
- type ToolUse
- type UpdateContactTool
- type UpdateEventTool
- type UpdateTaskTool
- type WeatherTool
- type WebFetchTool
- type WebSearchTool
- type WorkingDaysTool
- type WriteTool
Examples ¶
Constants ¶
const ( // DefaultCommandTimeout is the default timeout for command execution DefaultCommandTimeout = 30 * time.Second // MaxCommandTimeout is the maximum allowed timeout (5 minutes) MaxCommandTimeout = 5 * time.Minute // MaxOutputSize is the maximum combined output size (1MB) MaxOutputSize = 1024 * 1024 )
const ( // DefaultTaskTimeout is the default timeout for task execution DefaultTaskTimeout = 5 * time.Minute // MaxTaskTimeout is the maximum allowed timeout (30 minutes) MaxTaskTimeout = 30 * time.Minute )
const ( // DefaultMaxContentSize is the default maximum content size to write (10MB) DefaultMaxContentSize = 10 * 1024 * 1024 // ModeCreate creates a new file, failing if it already exists ModeCreate = "create" // ModeOverwrite overwrites an existing file or creates a new one ModeOverwrite = "overwrite" // ModeAppend appends to an existing file or creates a new one ModeAppend = "append" )
const (
// DefaultMaxFileSize is the default maximum file size to read (1MB)
DefaultMaxFileSize = 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func GetToolSchema ¶ added in v0.3.10
GetToolSchema returns the JSON Schema for a specific tool's input parameters. This is used by the mux adapter to provide schema info to the LLM.
Types ¶
type AcceptEventTool ¶ added in v0.1.9
type AcceptEventTool struct {
// contains filtered or unexported fields
}
AcceptEventTool accepts a calendar event invitation
func (*AcceptEventTool) Description ¶ added in v0.1.9
func (t *AcceptEventTool) Description() string
Description returns what this tool does
func (*AcceptEventTool) Execute ¶ added in v0.1.9
func (t *AcceptEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the accept event operation
func (*AcceptEventTool) Name ¶ added in v0.1.9
func (t *AcceptEventTool) Name() string
Name returns the tool's identifier
func (*AcceptEventTool) RequiresApproval ¶ added in v0.1.9
func (t *AcceptEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ApprovalFunc ¶
ApprovalFunc is called when a tool needs user approval Returns true if approved, false if denied
type ArchiveEmailTool ¶
type ArchiveEmailTool struct {
// contains filtered or unexported fields
}
ArchiveEmailTool archives emails
func (*ArchiveEmailTool) Description ¶
func (t *ArchiveEmailTool) Description() string
Description returns what this tool does
func (*ArchiveEmailTool) Execute ¶
func (t *ArchiveEmailTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the archive email operation
func (*ArchiveEmailTool) Name ¶
func (t *ArchiveEmailTool) Name() string
Name returns the tool's identifier
func (*ArchiveEmailTool) RequiresApproval ¶
func (t *ArchiveEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type AskUserQuestionTool ¶
type AskUserQuestionTool struct{}
AskUserQuestionTool prompts users with multiple-choice questions
func (*AskUserQuestionTool) Description ¶
func (t *AskUserQuestionTool) Description() string
Description returns what the tool does
func (*AskUserQuestionTool) Execute ¶
func (t *AskUserQuestionTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the tool with the given parameters
func (*AskUserQuestionTool) Name ¶
func (t *AskUserQuestionTool) Name() string
Name returns the tool's identifier
func (*AskUserQuestionTool) RequiresApproval ¶
func (t *AskUserQuestionTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type BackgroundProcess ¶
type BackgroundProcess struct {
ID string // Unique identifier for the process
Command string // The command being executed
StartTime time.Time // When the process started
Stdout []string // Lines of stdout output
Stderr []string // Lines of stderr output
ReadOffset int // Number of lines already read by BashOutput
Done bool // Whether the process has finished
ExitCode int // Exit code (valid only if Done is true)
Process *os.Process // The actual OS process
// contains filtered or unexported fields
}
BackgroundProcess represents a running or completed background bash process
func (*BackgroundProcess) AppendStderr ¶
func (bp *BackgroundProcess) AppendStderr(line string)
AppendStderr adds a line to stderr in a thread-safe manner
func (*BackgroundProcess) AppendStdout ¶
func (bp *BackgroundProcess) AppendStdout(line string)
AppendStdout adds a line to stdout in a thread-safe manner
func (*BackgroundProcess) GetExitCode ¶
func (bp *BackgroundProcess) GetExitCode() int
GetExitCode returns the exit code (only valid if Done is true)
func (*BackgroundProcess) GetNewOutput ¶
func (bp *BackgroundProcess) GetNewOutput() (stdout []string, stderr []string)
GetNewOutput returns output since the last read and updates the read offset
func (*BackgroundProcess) IsDone ¶
func (bp *BackgroundProcess) IsDone() bool
IsDone returns whether the process has finished
func (*BackgroundProcess) MarkDone ¶
func (bp *BackgroundProcess) MarkDone(exitCode int)
MarkDone marks the process as completed with the given exit code
type BackgroundProcessRegistry ¶
type BackgroundProcessRegistry struct {
// contains filtered or unexported fields
}
BackgroundProcessRegistry stores running background processes
func GetBackgroundRegistry ¶
func GetBackgroundRegistry() *BackgroundProcessRegistry
GetBackgroundRegistry returns the global background process registry
func (*BackgroundProcessRegistry) Get ¶
func (r *BackgroundProcessRegistry) Get(id string) (*BackgroundProcess, error)
Get retrieves a background process by ID
func (*BackgroundProcessRegistry) List ¶
func (r *BackgroundProcessRegistry) List() []string
List returns all background process IDs
func (*BackgroundProcessRegistry) Register ¶
func (r *BackgroundProcessRegistry) Register(proc *BackgroundProcess) error
Register adds a background process to the registry
func (*BackgroundProcessRegistry) Remove ¶
func (r *BackgroundProcessRegistry) Remove(id string) error
Remove removes a background process from the registry
type BashOutputTool ¶
type BashOutputTool struct{}
BashOutputTool retrieves output from background bash processes
func NewBashOutputTool ¶
func NewBashOutputTool() *BashOutputTool
NewBashOutputTool creates a new bash output tool
func (*BashOutputTool) Description ¶
func (t *BashOutputTool) Description() string
Description returns the tool description
func (*BashOutputTool) RequiresApproval ¶
func (t *BashOutputTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval always returns false - this is a read-only tool
type BashTool ¶
type BashTool struct {
DefaultTimeout time.Duration // Default timeout for commands
MaxOutputSize int // Maximum output size (bytes)
}
BashTool implements shell command execution functionality
Example ¶
// Create a new Bash tool
bashTool := NewBashTool()
// Execute a simple command
result, err := bashTool.Execute(context.Background(), map[string]interface{}{
"command": "echo 'Hello from Bash tool!'",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Success:", result.Success)
fmt.Println("Exit Code:", result.Metadata["exit_code"])
Output: Success: true Exit Code: 0
Example (RequiresApproval) ¶
bashTool := NewBashTool()
// ALL bash commands require approval for safety
params := map[string]interface{}{
"command": "ls /",
}
requiresApproval := bashTool.RequiresApproval(params)
fmt.Println("Requires approval:", requiresApproval)
Output: Requires approval: true
Example (WithExecutor) ¶
// Create a registry and register the bash tool
registry := NewRegistry()
bashTool := NewBashTool()
_ = registry.Register(bashTool)
// Create an executor with approval function
approvalFunc := func(_ string, params map[string]interface{}) bool {
// In real use, prompt the user for approval
command := params["command"].(string)
fmt.Printf("Approve command '%s'? ", command)
return true // Auto-approve for demo
}
executor := NewExecutor(registry, approvalFunc)
// Execute the tool through the executor
result, err := executor.Execute(context.Background(), "bash", map[string]interface{}{
"command": "echo 'Executed via executor'",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Success:", result.Success)
Output: Approve command 'echo 'Executed via executor''? Success: true
Example (WithTimeout) ¶
bashTool := NewBashTool()
// Execute command with custom timeout (2 seconds)
result, err := bashTool.Execute(context.Background(), map[string]interface{}{
"command": "sleep 1; echo 'Done sleeping'",
"timeout": float64(2),
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Success:", result.Success)
Output: Success: true
Example (WithWorkingDirectory) ¶
bashTool := NewBashTool()
// Execute command in a specific directory
result, err := bashTool.Execute(context.Background(), map[string]interface{}{
"command": "pwd",
"working_dir": "/tmp",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Working directory set:", result.Metadata["working_dir"])
Output: Working directory set: /tmp
func NewBashTool ¶
func NewBashTool() *BashTool
NewBashTool creates a new bash tool with default settings
func (*BashTool) Description ¶
Description returns the tool description
func (*BashTool) RequiresApproval ¶
RequiresApproval always returns true for command execution
type CalenderingTool ¶ added in v0.2.0
type CalenderingTool struct{}
CalenderingTool provides temporal awareness capabilities
func NewCalenderingTool ¶ added in v0.2.0
func NewCalenderingTool() *CalenderingTool
NewCalenderingTool creates a new Calendering tool instance
func (*CalenderingTool) Description ¶ added in v0.2.0
func (t *CalenderingTool) Description() string
Description returns the tool's purpose
func (*CalenderingTool) Execute ¶ added in v0.2.0
func (t *CalenderingTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute performs the requested calendering operation
func (*CalenderingTool) Name ¶ added in v0.2.0
func (t *CalenderingTool) Name() string
Name returns the tool identifier
func (*CalenderingTool) RequiresApproval ¶ added in v0.2.0
func (t *CalenderingTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (calendering operations are read-only)
type CompleteTaskTool ¶
type CompleteTaskTool struct {
// contains filtered or unexported fields
}
CompleteTaskTool marks tasks as complete
func (*CompleteTaskTool) Description ¶
func (t *CompleteTaskTool) Description() string
Description returns what this tool does
func (*CompleteTaskTool) Execute ¶
func (t *CompleteTaskTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the complete task operation
func (*CompleteTaskTool) Name ¶
func (t *CompleteTaskTool) Name() string
Name returns the tool's identifier
func (*CompleteTaskTool) RequiresApproval ¶
func (t *CompleteTaskTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type CreateContactTool ¶ added in v0.3.3
type CreateContactTool struct {
// contains filtered or unexported fields
}
CreateContactTool creates a new contact
func (*CreateContactTool) Description ¶ added in v0.3.3
func (t *CreateContactTool) Description() string
Description returns what this tool does
func (*CreateContactTool) Execute ¶ added in v0.3.3
func (t *CreateContactTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the create contact operation
func (*CreateContactTool) Name ¶ added in v0.3.3
func (t *CreateContactTool) Name() string
Name returns the tool's identifier
func (*CreateContactTool) RequiresApproval ¶ added in v0.3.3
func (t *CreateContactTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type CreateEmailDraftTool ¶ added in v0.3.3
type CreateEmailDraftTool struct {
// contains filtered or unexported fields
}
CreateEmailDraftTool saves an email as a draft instead of sending
func (*CreateEmailDraftTool) Description ¶ added in v0.3.3
func (t *CreateEmailDraftTool) Description() string
Description returns what this tool does
func (*CreateEmailDraftTool) Execute ¶ added in v0.3.3
func (t *CreateEmailDraftTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the create email draft operation
func (*CreateEmailDraftTool) Name ¶ added in v0.3.3
func (t *CreateEmailDraftTool) Name() string
Name returns the tool's identifier
func (*CreateEmailDraftTool) RequiresApproval ¶ added in v0.3.3
func (t *CreateEmailDraftTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type CreateEventTool ¶
type CreateEventTool struct {
// contains filtered or unexported fields
}
CreateEventTool creates calendar events
func (*CreateEventTool) Description ¶
func (t *CreateEventTool) Description() string
Description returns what this tool does
func (*CreateEventTool) Execute ¶
func (t *CreateEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the create event operation
func (*CreateEventTool) Name ¶
func (t *CreateEventTool) Name() string
Name returns the tool's identifier
func (*CreateEventTool) RequiresApproval ¶
func (t *CreateEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type CreateTaskTool ¶
type CreateTaskTool struct {
// contains filtered or unexported fields
}
CreateTaskTool creates tasks
func (*CreateTaskTool) Description ¶
func (t *CreateTaskTool) Description() string
Description returns what this tool does
func (*CreateTaskTool) Name ¶
func (t *CreateTaskTool) Name() string
Name returns the tool's identifier
func (*CreateTaskTool) RequiresApproval ¶
func (t *CreateTaskTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type CurrencyTool ¶ added in v0.3.0
type CurrencyTool struct{}
CurrencyTool provides currency conversion capabilities using ECB exchange rates
func NewCurrencyTool ¶ added in v0.3.0
func NewCurrencyTool() *CurrencyTool
NewCurrencyTool creates a new Currency Conversion tool instance
func (*CurrencyTool) Description ¶ added in v0.3.0
func (t *CurrencyTool) Description() string
Description returns the tool's purpose
func (*CurrencyTool) Name ¶ added in v0.3.0
func (t *CurrencyTool) Name() string
Name returns the tool identifier
func (*CurrencyTool) RequiresApproval ¶ added in v0.3.0
func (t *CurrencyTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (currency lookups are read-only)
type DeclineEventTool ¶ added in v0.1.9
type DeclineEventTool struct {
// contains filtered or unexported fields
}
DeclineEventTool declines a calendar event invitation
func (*DeclineEventTool) Description ¶ added in v0.1.9
func (t *DeclineEventTool) Description() string
Description returns what this tool does
func (*DeclineEventTool) Execute ¶ added in v0.1.9
func (t *DeclineEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the decline event operation
func (*DeclineEventTool) Name ¶ added in v0.1.9
func (t *DeclineEventTool) Name() string
Name returns the tool's identifier
func (*DeclineEventTool) RequiresApproval ¶ added in v0.1.9
func (t *DeclineEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type DeleteContactTool ¶ added in v0.3.3
type DeleteContactTool struct {
// contains filtered or unexported fields
}
DeleteContactTool deletes a contact
func (*DeleteContactTool) Description ¶ added in v0.3.3
func (t *DeleteContactTool) Description() string
Description returns what this tool does
func (*DeleteContactTool) Execute ¶ added in v0.3.3
func (t *DeleteContactTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the delete contact operation
func (*DeleteContactTool) Name ¶ added in v0.3.3
func (t *DeleteContactTool) Name() string
Name returns the tool's identifier
func (*DeleteContactTool) RequiresApproval ¶ added in v0.3.3
func (t *DeleteContactTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type DeleteEmailTool ¶ added in v0.1.9
type DeleteEmailTool struct {
// contains filtered or unexported fields
}
DeleteEmailTool deletes an email (moves to trash or permanent)
func (*DeleteEmailTool) Description ¶ added in v0.1.9
func (t *DeleteEmailTool) Description() string
Description returns what this tool does
func (*DeleteEmailTool) Execute ¶ added in v0.1.9
func (t *DeleteEmailTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the delete email operation
func (*DeleteEmailTool) Name ¶ added in v0.1.9
func (t *DeleteEmailTool) Name() string
Name returns the tool's identifier
func (*DeleteEmailTool) RequiresApproval ¶ added in v0.1.9
func (t *DeleteEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type DeleteEventTool ¶
type DeleteEventTool struct {
// contains filtered or unexported fields
}
DeleteEventTool deletes calendar events
func (*DeleteEventTool) Description ¶
func (t *DeleteEventTool) Description() string
Description returns what this tool does
func (*DeleteEventTool) Execute ¶
func (t *DeleteEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the delete event operation
func (*DeleteEventTool) Name ¶
func (t *DeleteEventTool) Name() string
Name returns the tool's identifier
func (*DeleteEventTool) RequiresApproval ¶
func (t *DeleteEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type DeleteTaskTool ¶
type DeleteTaskTool struct {
// contains filtered or unexported fields
}
DeleteTaskTool deletes tasks
func (*DeleteTaskTool) Description ¶
func (t *DeleteTaskTool) Description() string
Description returns what this tool does
func (*DeleteTaskTool) Name ¶
func (t *DeleteTaskTool) Name() string
Name returns the tool's identifier
func (*DeleteTaskTool) RequiresApproval ¶
func (t *DeleteTaskTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type DisplayCallback ¶ added in v0.1.9
type DisplayCallback func(title, content string)
DisplayCallback is called when content should be displayed
type DisplayTool ¶ added in v0.1.9
type DisplayTool struct {
// contains filtered or unexported fields
}
DisplayTool presents formatted content to the user in the display pane
func NewDisplayTool ¶ added in v0.1.9
func NewDisplayTool(callback DisplayCallback) *DisplayTool
NewDisplayTool creates a new display tool with the given callback
func (*DisplayTool) Description ¶ added in v0.1.9
func (t *DisplayTool) Description() string
Description returns a description of what this tool does
func (*DisplayTool) Name ¶ added in v0.1.9
func (t *DisplayTool) Name() string
Name returns the tool name
func (*DisplayTool) RequiresApproval ¶ added in v0.1.9
func (t *DisplayTool) RequiresApproval(params map[string]interface{}) bool
RequiresApproval returns false - display is always safe
type EditTool ¶
type EditTool struct{}
EditTool performs exact string replacements in files
func (*EditTool) Description ¶
Description returns the tool's purpose
func (*EditTool) RequiresApproval ¶
RequiresApproval always returns true - editing files is destructive
type EmailValidatorTool ¶ added in v0.3.0
type EmailValidatorTool struct{}
EmailValidatorTool provides email validation capabilities
func NewEmailValidatorTool ¶ added in v0.3.0
func NewEmailValidatorTool() *EmailValidatorTool
NewEmailValidatorTool creates a new Email Validator tool instance
func (*EmailValidatorTool) Description ¶ added in v0.3.0
func (t *EmailValidatorTool) Description() string
Description returns the tool's purpose
func (*EmailValidatorTool) Execute ¶ added in v0.3.0
func (t *EmailValidatorTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute performs the requested email validation operation
func (*EmailValidatorTool) Name ¶ added in v0.3.0
func (t *EmailValidatorTool) Name() string
Name returns the tool identifier
func (*EmailValidatorTool) RequiresApproval ¶ added in v0.3.0
func (t *EmailValidatorTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (email validation is read-only)
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs tools with permission management
func NewExecutor ¶
func NewExecutor(registry *Registry, approvalFunc ApprovalFunc) *Executor
NewExecutor creates a new tool executor
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, toolName string, params map[string]interface{}) (*Result, error)
Execute runs a tool by name with given parameters
func (*Executor) GetApprovalFunc ¶
func (e *Executor) GetApprovalFunc() ApprovalFunc
GetApprovalFunc returns the executor's approval function. This is needed when spawning sub-agents that should inherit the parent's approval function.
type FindFreeTimeTool ¶ added in v0.1.9
type FindFreeTimeTool struct {
// contains filtered or unexported fields
}
FindFreeTimeTool finds available time slots in the calendar
func (*FindFreeTimeTool) Description ¶ added in v0.1.9
func (t *FindFreeTimeTool) Description() string
Description returns what this tool does
func (*FindFreeTimeTool) Execute ¶ added in v0.1.9
func (t *FindFreeTimeTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the find free time operation
func (*FindFreeTimeTool) Name ¶ added in v0.1.9
func (t *FindFreeTimeTool) Name() string
Name returns the tool's identifier
func (*FindFreeTimeTool) RequiresApproval ¶ added in v0.1.9
func (t *FindFreeTimeTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type FinnhubNews ¶ added in v0.3.0
type FinnhubNews struct {
Category string `json:"category"`
Datetime int64 `json:"datetime"`
Headline string `json:"headline"`
ID int `json:"id"`
Image string `json:"image"`
Related string `json:"related"`
Source string `json:"source"`
Summary string `json:"summary"`
URL string `json:"url"`
}
FinnhubNews represents news article response
type FinnhubProfile ¶ added in v0.3.0
type FinnhubProfile struct {
Country string `json:"country"`
Currency string `json:"currency"`
Exchange string `json:"exchange"`
IPO string `json:"ipo"`
MarketCapitalization float64 `json:"marketCapitalization"`
Name string `json:"name"`
Phone string `json:"phone"`
Ticker string `json:"ticker"`
WebURL string `json:"weburl"`
Logo string `json:"logo"`
Industry string `json:"finnhubIndustry"`
}
FinnhubProfile represents company profile response
type FinnhubQuote ¶ added in v0.3.0
type FinnhubQuote struct {
Current float64 `json:"c"` // Current price
Change float64 `json:"d"` // Change
High float64 `json:"h"` // High price of the day
Low float64 `json:"l"` // Low price of the day
Open float64 `json:"o"` // Open price of the day
PreviousClose float64 `json:"pc"` // Previous close price
Timestamp int64 `json:"t"` // Timestamp
}
FinnhubQuote represents stock quote response
type ForwardEmailTool ¶ added in v0.1.9
type ForwardEmailTool struct {
// contains filtered or unexported fields
}
ForwardEmailTool forwards an email to another recipient
func (*ForwardEmailTool) Description ¶ added in v0.1.9
func (t *ForwardEmailTool) Description() string
Description returns what this tool does
func (*ForwardEmailTool) Execute ¶ added in v0.1.9
func (t *ForwardEmailTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the forward email operation
func (*ForwardEmailTool) Name ¶ added in v0.1.9
func (t *ForwardEmailTool) Name() string
Name returns the tool's identifier
func (*ForwardEmailTool) RequiresApproval ¶ added in v0.1.9
func (t *ForwardEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type FrankfurterResponse ¶ added in v0.3.0
type FrankfurterResponse struct {
Amount float64 `json:"amount"`
Base string `json:"base"`
Date string `json:"date"`
Rates map[string]float64 `json:"rates"`
}
FrankfurterResponse represents the response from Frankfurter API
type GetEmailThreadTool ¶ added in v0.1.9
type GetEmailThreadTool struct {
// contains filtered or unexported fields
}
GetEmailThreadTool retrieves an entire email conversation thread
func (*GetEmailThreadTool) Description ¶ added in v0.1.9
func (t *GetEmailThreadTool) Description() string
Description returns what this tool does
func (*GetEmailThreadTool) Execute ¶ added in v0.1.9
func (t *GetEmailThreadTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the get email thread operation
func (*GetEmailThreadTool) Name ¶ added in v0.1.9
func (t *GetEmailThreadTool) Name() string
Name returns the tool's identifier
func (*GetEmailThreadTool) RequiresApproval ¶ added in v0.1.9
func (t *GetEmailThreadTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type GetEventTool ¶ added in v0.1.9
type GetEventTool struct {
// contains filtered or unexported fields
}
GetEventTool retrieves a single calendar event by ID
func (*GetEventTool) Description ¶ added in v0.1.9
func (t *GetEventTool) Description() string
Description returns what this tool does
func (*GetEventTool) Name ¶ added in v0.1.9
func (t *GetEventTool) Name() string
Name returns the tool's identifier
func (*GetEventTool) RequiresApproval ¶ added in v0.1.9
func (t *GetEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type GlobTool ¶
type GlobTool struct{}
GlobTool finds files matching glob patterns
func (*GlobTool) Description ¶
Description returns the tool's purpose
func (*GlobTool) RequiresApproval ¶
RequiresApproval returns false (glob is read-only)
type GrepTool ¶
type GrepTool struct{}
GrepTool searches code using ripgrep patterns
func (*GrepTool) Description ¶
Description returns the tool's purpose
func (*GrepTool) RequiresApproval ¶
RequiresApproval returns false for normal paths (grep is read-only)
type HolidayTool ¶ added in v0.3.0
type HolidayTool struct{}
HolidayTool provides US federal holiday information
func NewHolidayTool ¶ added in v0.3.0
func NewHolidayTool() *HolidayTool
NewHolidayTool creates a new Holiday tool instance
func (*HolidayTool) Description ¶ added in v0.3.0
func (t *HolidayTool) Description() string
Description returns the tool's purpose
func (*HolidayTool) Name ¶ added in v0.3.0
func (t *HolidayTool) Name() string
Name returns the tool identifier
func (*HolidayTool) RequiresApproval ¶ added in v0.3.0
func (t *HolidayTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (holiday lookups are read-only)
type KillShellTool ¶
type KillShellTool struct{}
KillShellTool implements background process termination
func NewKillShellTool ¶
func NewKillShellTool() *KillShellTool
NewKillShellTool creates a new kill shell tool
func (*KillShellTool) Description ¶
func (t *KillShellTool) Description() string
Description returns the tool description
func (*KillShellTool) RequiresApproval ¶
func (t *KillShellTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval always returns true (killing processes is destructive)
type LabelEmailTool ¶ added in v0.1.9
type LabelEmailTool struct {
// contains filtered or unexported fields
}
LabelEmailTool applies or removes labels from an email
func (*LabelEmailTool) Description ¶ added in v0.1.9
func (t *LabelEmailTool) Description() string
Description returns what this tool does
func (*LabelEmailTool) Name ¶ added in v0.1.9
func (t *LabelEmailTool) Name() string
Name returns the tool's identifier
func (*LabelEmailTool) RequiresApproval ¶ added in v0.1.9
func (t *LabelEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ListCalendarsTool ¶ added in v0.1.9
type ListCalendarsTool struct {
// contains filtered or unexported fields
}
ListCalendarsTool lists all available calendars
func (*ListCalendarsTool) Description ¶ added in v0.1.9
func (t *ListCalendarsTool) Description() string
Description returns what this tool does
func (*ListCalendarsTool) Execute ¶ added in v0.1.9
func (t *ListCalendarsTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the list calendars operation
func (*ListCalendarsTool) Name ¶ added in v0.1.9
func (t *ListCalendarsTool) Name() string
Name returns the tool's identifier
func (*ListCalendarsTool) RequiresApproval ¶ added in v0.1.9
func (t *ListCalendarsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ListEmailLabelsTool ¶ added in v0.1.9
type ListEmailLabelsTool struct {
// contains filtered or unexported fields
}
ListEmailLabelsTool lists all Gmail labels/folders
func (*ListEmailLabelsTool) Description ¶ added in v0.1.9
func (t *ListEmailLabelsTool) Description() string
Description returns what this tool does
func (*ListEmailLabelsTool) Execute ¶ added in v0.1.9
func (t *ListEmailLabelsTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the list email labels operation
func (*ListEmailLabelsTool) Name ¶ added in v0.1.9
func (t *ListEmailLabelsTool) Name() string
Name returns the tool's identifier
func (*ListEmailLabelsTool) RequiresApproval ¶ added in v0.1.9
func (t *ListEmailLabelsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ListEventsTool ¶
type ListEventsTool struct {
// contains filtered or unexported fields
}
ListEventsTool lists calendar events
func (*ListEventsTool) Description ¶
func (t *ListEventsTool) Description() string
Description returns what this tool does
func (*ListEventsTool) Name ¶
func (t *ListEventsTool) Name() string
Name returns the tool's identifier
func (*ListEventsTool) RequiresApproval ¶
func (t *ListEventsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ListTasksTool ¶
type ListTasksTool struct {
// contains filtered or unexported fields
}
ListTasksTool lists tasks
func (*ListTasksTool) Description ¶
func (t *ListTasksTool) Description() string
Description returns what this tool does
func (*ListTasksTool) Name ¶
func (t *ListTasksTool) Name() string
Name returns the tool's identifier
func (*ListTasksTool) RequiresApproval ¶
func (t *ListTasksTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type MarkEmailReadTool ¶
type MarkEmailReadTool struct {
// contains filtered or unexported fields
}
MarkEmailReadTool marks an email as read
func (*MarkEmailReadTool) Description ¶
func (t *MarkEmailReadTool) Description() string
Description returns what this tool does
func (*MarkEmailReadTool) Execute ¶
func (t *MarkEmailReadTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the mark email read operation
func (*MarkEmailReadTool) Name ¶
func (t *MarkEmailReadTool) Name() string
Name returns the tool's identifier
func (*MarkEmailReadTool) RequiresApproval ¶
func (t *MarkEmailReadTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type MarkEmailUnreadTool ¶
type MarkEmailUnreadTool struct {
// contains filtered or unexported fields
}
MarkEmailUnreadTool marks an email as unread
func (*MarkEmailUnreadTool) Description ¶
func (t *MarkEmailUnreadTool) Description() string
Description returns what this tool does
func (*MarkEmailUnreadTool) Execute ¶
func (t *MarkEmailUnreadTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the mark email unread operation
func (*MarkEmailUnreadTool) Name ¶
func (t *MarkEmailUnreadTool) Name() string
Name returns the tool's identifier
func (*MarkEmailUnreadTool) RequiresApproval ¶
func (t *MarkEmailUnreadTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type MeetingCostTool ¶ added in v0.3.0
type MeetingCostTool struct{}
MeetingCostTool provides meeting cost calculation capabilities
func NewMeetingCostTool ¶ added in v0.3.0
func NewMeetingCostTool() *MeetingCostTool
NewMeetingCostTool creates a new Meeting Cost Calculator tool instance
func (*MeetingCostTool) Description ¶ added in v0.3.0
func (t *MeetingCostTool) Description() string
Description returns the tool's purpose
func (*MeetingCostTool) Execute ¶ added in v0.3.0
func (t *MeetingCostTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute performs the requested meeting cost operation
func (*MeetingCostTool) Name ¶ added in v0.3.0
func (t *MeetingCostTool) Name() string
Name returns the tool identifier
func (*MeetingCostTool) RequiresApproval ¶ added in v0.3.0
func (t *MeetingCostTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (cost calculation is read-only)
type MockTool ¶
type MockTool struct {
NameValue string
DescriptionValue string
RequiresApprovalValue bool
ExecuteFunc func(context.Context, map[string]interface{}) (*Result, error)
}
MockTool is a simple tool for testing
func (*MockTool) Description ¶
Description returns the tool description
func (*MockTool) RequiresApproval ¶
RequiresApproval returns whether approval is needed
type OpenMeteoCurrentResponse ¶ added in v0.3.16
type OpenMeteoCurrentResponse struct {
Current struct {
Temperature float64 `json:"temperature_2m"`
Humidity float64 `json:"relative_humidity_2m"`
ApparentTemperature float64 `json:"apparent_temperature"`
WeatherCode int `json:"weather_code"`
WindSpeed float64 `json:"wind_speed_10m"`
WindDirection float64 `json:"wind_direction_10m"`
Pressure float64 `json:"surface_pressure"`
} `json:"current"`
}
OpenMeteoCurrentResponse represents current weather response
type OpenMeteoForecastResponse ¶ added in v0.3.16
type OpenMeteoForecastResponse struct {
Daily struct {
Time []string `json:"time"`
WeatherCode []int `json:"weather_code"`
TempMax []float64 `json:"temperature_2m_max"`
TempMin []float64 `json:"temperature_2m_min"`
FeelsLikeMax []float64 `json:"apparent_temperature_max"`
FeelsLikeMin []float64 `json:"apparent_temperature_min"`
Precipitation []float64 `json:"precipitation_sum"`
WindSpeedMax []float64 `json:"wind_speed_10m_max"`
} `json:"daily"`
}
OpenMeteoForecastResponse represents daily forecast response
type ProposeNewTimeTool ¶ added in v0.1.9
type ProposeNewTimeTool struct {
// contains filtered or unexported fields
}
ProposeNewTimeTool proposes a new time for a calendar event
func (*ProposeNewTimeTool) Description ¶ added in v0.1.9
func (t *ProposeNewTimeTool) Description() string
Description returns what this tool does
func (*ProposeNewTimeTool) Execute ¶ added in v0.1.9
func (t *ProposeNewTimeTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the propose new time operation
func (*ProposeNewTimeTool) Name ¶ added in v0.1.9
func (t *ProposeNewTimeTool) Name() string
Name returns the tool's identifier
func (*ProposeNewTimeTool) RequiresApproval ¶ added in v0.1.9
func (t *ProposeNewTimeTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ReadContactTool ¶
type ReadContactTool struct {
// contains filtered or unexported fields
}
ReadContactTool reads a specific contact
func (*ReadContactTool) Description ¶
func (t *ReadContactTool) Description() string
Description returns what this tool does
func (*ReadContactTool) Execute ¶
func (t *ReadContactTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the read contact operation
func (*ReadContactTool) Name ¶
func (t *ReadContactTool) Name() string
Name returns the tool's identifier
func (*ReadContactTool) RequiresApproval ¶
func (t *ReadContactTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ReadEmailTool ¶
type ReadEmailTool struct {
// contains filtered or unexported fields
}
ReadEmailTool reads a specific email
func (*ReadEmailTool) Description ¶
func (t *ReadEmailTool) Description() string
Description returns what this tool does
func (*ReadEmailTool) Name ¶
func (t *ReadEmailTool) Name() string
Name returns the tool's identifier
func (*ReadEmailTool) RequiresApproval ¶
func (t *ReadEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type ReadTool ¶
type ReadTool struct {
MaxFileSize int64 // Maximum file size to read (bytes)
}
ReadTool implements file reading functionality
Example ¶
ExampleReadTool demonstrates basic file reading
package main
import (
"context"
"fmt"
"os"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
// Create a test file
tmpFile, _ := os.CreateTemp("", "example-*.txt")
defer func() { _ = os.Remove(tmpFile.Name()) }()
_, _ = tmpFile.WriteString("Hello, World!")
_ = tmpFile.Close()
// Create and use the Read tool
tool := tools.NewReadTool()
result, _ := tool.Execute(context.Background(), map[string]interface{}{
"path": tmpFile.Name(),
})
fmt.Println("Success:", result.Success)
fmt.Println("Output:", result.Output)
}
Output: Success: true Output: Hello, World!
Example (RequiresApproval) ¶
ExampleReadTool_requiresApproval demonstrates approval checking
package main
import (
"fmt"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
tool := tools.NewReadTool()
// Sensitive path requires approval
sensitive := tool.RequiresApproval(map[string]interface{}{
"path": "/etc/passwd",
})
fmt.Println("Sensitive path:", sensitive)
// Regular path does not require approval
regular := tool.RequiresApproval(map[string]interface{}{
"path": "/tmp/test.txt",
})
fmt.Println("Regular path:", regular)
}
Output: Sensitive path: true Regular path: false
Example (WithExecutor) ¶
ExampleReadTool_withExecutor demonstrates using the Read tool with Executor
package main
import (
"context"
"fmt"
"os"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
tmpFile, _ := os.CreateTemp("", "example-*.txt")
defer func() { _ = os.Remove(tmpFile.Name()) }()
_, _ = tmpFile.WriteString("Hello from Executor!")
_ = tmpFile.Close()
// Create registry and register the Read tool
registry := tools.NewRegistry()
_ = registry.Register(tools.NewReadTool())
// Create executor with auto-approval
executor := tools.NewExecutor(registry, func(_ string, _ map[string]interface{}) bool {
return true // Auto-approve for this example
})
// Execute the tool through the executor
result, _ := executor.Execute(context.Background(), "read_file", map[string]interface{}{
"path": tmpFile.Name(),
})
fmt.Println("Success:", result.Success)
fmt.Println("Output:", result.Output)
}
Output: Success: true Output: Hello from Executor!
Example (WithLimit) ¶
ExampleReadTool_withLimit demonstrates reading with a limit
package main
import (
"context"
"fmt"
"os"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
tmpFile, _ := os.CreateTemp("", "example-*.txt")
defer func() { _ = os.Remove(tmpFile.Name()) }()
_, _ = tmpFile.WriteString("0123456789")
_ = tmpFile.Close()
tool := tools.NewReadTool()
result, _ := tool.Execute(context.Background(), map[string]interface{}{
"path": tmpFile.Name(),
"limit": float64(5),
})
fmt.Println(result.Output)
}
Output: 01234
Example (WithOffset) ¶
ExampleReadTool_withOffset demonstrates reading with an offset
package main
import (
"context"
"fmt"
"os"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
tmpFile, _ := os.CreateTemp("", "example-*.txt")
defer func() { _ = os.Remove(tmpFile.Name()) }()
_, _ = tmpFile.WriteString("0123456789")
_ = tmpFile.Close()
tool := tools.NewReadTool()
result, _ := tool.Execute(context.Background(), map[string]interface{}{
"path": tmpFile.Name(),
"offset": float64(5),
})
fmt.Println(result.Output)
}
Output: 56789
func NewReadTool ¶
func NewReadTool() *ReadTool
NewReadTool creates a new read tool with default settings
func (*ReadTool) Description ¶
Description returns the tool description
func (*ReadTool) RequiresApproval ¶
RequiresApproval returns true if the path is sensitive
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages available tools
func (*Registry) GetDefinitions ¶
func (r *Registry) GetDefinitions() []core.ToolDefinition
GetDefinitions returns tool definitions for all registered tools in API format
type ReplyEmailTool ¶ added in v0.1.9
type ReplyEmailTool struct {
// contains filtered or unexported fields
}
ReplyEmailTool replies to an email
func (*ReplyEmailTool) Description ¶ added in v0.1.9
func (t *ReplyEmailTool) Description() string
Description returns what this tool does
func (*ReplyEmailTool) Name ¶ added in v0.1.9
func (t *ReplyEmailTool) Name() string
Name returns the tool's identifier
func (*ReplyEmailTool) RequiresApproval ¶ added in v0.1.9
func (t *ReplyEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type Result ¶
type Result struct {
ToolName string // Tool that was executed
Success bool // Did it succeed?
Output string // Standard output/result
Error string // Error message if failed
Metadata map[string]interface{} // Additional metadata (file path, exit code, etc.)
}
Result represents the output of a tool execution
type SearchContactsTool ¶
type SearchContactsTool struct {
// contains filtered or unexported fields
}
SearchContactsTool searches contacts
func (*SearchContactsTool) Description ¶
func (t *SearchContactsTool) Description() string
Description returns what this tool does
func (*SearchContactsTool) Execute ¶
func (t *SearchContactsTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the search contacts operation
func (*SearchContactsTool) Name ¶
func (t *SearchContactsTool) Name() string
Name returns the tool's identifier
func (*SearchContactsTool) RequiresApproval ¶
func (t *SearchContactsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type SearchEmailsTool ¶
type SearchEmailsTool struct {
// contains filtered or unexported fields
}
SearchEmailsTool searches for emails
func (*SearchEmailsTool) Description ¶
func (t *SearchEmailsTool) Description() string
Description returns what this tool does
func (*SearchEmailsTool) Execute ¶
func (t *SearchEmailsTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the search emails operation
func (*SearchEmailsTool) Name ¶
func (t *SearchEmailsTool) Name() string
Name returns the tool's identifier
func (*SearchEmailsTool) RequiresApproval ¶
func (t *SearchEmailsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type SearchEventsTool ¶
type SearchEventsTool struct {
// contains filtered or unexported fields
}
SearchEventsTool searches calendar events
func (*SearchEventsTool) Description ¶
func (t *SearchEventsTool) Description() string
Description returns what this tool does
func (*SearchEventsTool) Execute ¶
func (t *SearchEventsTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the search events operation
func (*SearchEventsTool) Name ¶
func (t *SearchEventsTool) Name() string
Name returns the tool's identifier
func (*SearchEventsTool) RequiresApproval ¶
func (t *SearchEventsTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type SearchResult ¶
SearchResult represents a single web search result
type SendEmailTool ¶
type SendEmailTool struct {
// contains filtered or unexported fields
}
SendEmailTool sends email messages
func (*SendEmailTool) Description ¶
func (t *SendEmailTool) Description() string
Description returns what this tool does
func (*SendEmailTool) Name ¶
func (t *SendEmailTool) Name() string
Name returns the tool's identifier
func (*SendEmailTool) RequiresApproval ¶
func (t *SendEmailTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type StockTool ¶ added in v0.3.0
type StockTool struct{}
StockTool provides stock market data retrieval capabilities
func NewStockTool ¶ added in v0.3.0
func NewStockTool() *StockTool
NewStockTool creates a new Stock Price tool instance
func (*StockTool) Description ¶ added in v0.3.0
Description returns the tool's purpose
func (*StockTool) RequiresApproval ¶ added in v0.3.0
RequiresApproval returns false (stock lookups are read-only)
type TaskTool ¶
type TaskTool struct {
DefaultTimeout time.Duration // Default timeout for tasks
JeffBinPath string // Path to jeff binary (empty = search PATH)
}
TaskTool implements sub-agent task delegation functionality
func NewTaskTool ¶
func NewTaskTool() *TaskTool
NewTaskTool creates a new task tool with default settings
func (*TaskTool) Description ¶
Description returns the tool description
func (*TaskTool) ExecuteStreaming ¶
func (t *TaskTool) ExecuteStreaming(ctx context.Context, params map[string]interface{}) (<-chan *Result, error)
ExecuteStreaming launches a sub-agent and streams incremental output updates. Returns a channel that emits Result objects as output becomes available. The channel is closed when execution completes or fails.
func (*TaskTool) RequiresApproval ¶
RequiresApproval always returns true for task execution
type TentativeEventTool ¶ added in v0.1.9
type TentativeEventTool struct {
// contains filtered or unexported fields
}
TentativeEventTool marks a calendar event as tentative (maybe)
func (*TentativeEventTool) Description ¶ added in v0.1.9
func (t *TentativeEventTool) Description() string
Description returns what this tool does
func (*TentativeEventTool) Execute ¶ added in v0.1.9
func (t *TentativeEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the tentative event operation
func (*TentativeEventTool) Name ¶ added in v0.1.9
func (t *TentativeEventTool) Name() string
Name returns the tool's identifier
func (*TentativeEventTool) RequiresApproval ¶ added in v0.1.9
func (t *TentativeEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type TextAnalysisTool ¶ added in v0.3.0
type TextAnalysisTool struct{}
TextAnalysisTool provides text analysis capabilities
func NewTextAnalysisTool ¶ added in v0.3.0
func NewTextAnalysisTool() *TextAnalysisTool
NewTextAnalysisTool creates a new Text Analysis tool instance
func (*TextAnalysisTool) Description ¶ added in v0.3.0
func (t *TextAnalysisTool) Description() string
Description returns the tool's purpose
func (*TextAnalysisTool) Execute ¶ added in v0.3.0
func (t *TextAnalysisTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute performs the requested text analysis operation
func (*TextAnalysisTool) Name ¶ added in v0.3.0
func (t *TextAnalysisTool) Name() string
Name returns the tool identifier
func (*TextAnalysisTool) RequiresApproval ¶ added in v0.3.0
func (t *TextAnalysisTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (text analysis is read-only)
type TextStats ¶ added in v0.3.0
type TextStats struct {
Words int
CharsWithSpaces int
CharsWithoutSpaces int
Sentences int
Paragraphs int
Lines int
AvgWordsPerSentence float64
AvgCharsPerWord float64
ReadingTimeMinutes float64
SpeakingTimeMinutes float64
}
TextStats contains text analysis statistics
type TodoWriteTool ¶
type TodoWriteTool struct {
// contains filtered or unexported fields
}
TodoWriteTool implements the todo_write tool for managing todo lists
func (*TodoWriteTool) Description ¶
func (t *TodoWriteTool) Description() string
Description returns a human-readable description
func (*TodoWriteTool) RequiresApproval ¶
func (t *TodoWriteTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (TodoWrite is read-only display)
type Tool ¶
type Tool interface {
// Name returns the unique identifier for this tool (e.g., "read_file", "bash")
Name() string
// Description returns a human-readable description of what this tool does
Description() string
// RequiresApproval returns true if this specific tool invocation needs user approval.
// The decision can be based on the parameters (e.g., writing to /etc requires approval).
// params is guaranteed to be non-nil but may be empty or have unexpected types.
RequiresApproval(params map[string]interface{}) bool
// Execute runs the tool with the given parameters.
// Implementations must:
// - Validate required parameters exist
// - Type assert parameters safely (return error on wrong type)
// - Respect context cancellation
// - Return a Result (not error) for expected failures like "file not found"
// - Return an error only for unexpected/catastrophic failures
// params is guaranteed to be non-nil but may be empty.
Execute(ctx context.Context, params map[string]interface{}) (*Result, error)
}
Tool represents an executable tool that can be invoked by the assistant. Implementations must:
- Validate their own parameters in Execute() and return appropriate errors
- Handle type assertions safely (params may have incorrect types)
- Be safe for concurrent execution from multiple goroutines
func NewAcceptEventTool ¶ added in v0.1.9
NewAcceptEventTool creates a new accept event tool
func NewArchiveEmailTool ¶
NewArchiveEmailTool creates a new archive email tool
func NewAskUserQuestionTool ¶
func NewAskUserQuestionTool() Tool
NewAskUserQuestionTool creates a new AskUserQuestion tool instance
func NewCompleteTaskTool ¶
NewCompleteTaskTool creates a new complete task tool
func NewCreateContactTool ¶ added in v0.3.3
NewCreateContactTool creates a new create contact tool
func NewCreateEmailDraftTool ¶ added in v0.3.3
NewCreateEmailDraftTool creates a new create email draft tool
func NewCreateEventTool ¶
NewCreateEventTool creates a new create event tool
func NewCreateTaskTool ¶
NewCreateTaskTool creates a new create task tool
func NewDeclineEventTool ¶ added in v0.1.9
NewDeclineEventTool creates a new decline event tool
func NewDeleteContactTool ¶ added in v0.3.3
NewDeleteContactTool creates a new delete contact tool
func NewDeleteEmailTool ¶ added in v0.1.9
NewDeleteEmailTool creates a new delete email tool
func NewDeleteEventTool ¶
NewDeleteEventTool creates a new delete event tool
func NewDeleteTaskTool ¶
NewDeleteTaskTool creates a new delete task tool
func NewFindFreeTimeTool ¶ added in v0.1.9
NewFindFreeTimeTool creates a new find free time tool
func NewForwardEmailTool ¶ added in v0.1.9
NewForwardEmailTool creates a new forward email tool
func NewGetEmailThreadTool ¶ added in v0.1.9
NewGetEmailThreadTool creates a new get email thread tool
func NewGetEventTool ¶ added in v0.1.9
NewGetEventTool creates a new get event tool
func NewLabelEmailTool ¶ added in v0.1.9
NewLabelEmailTool creates a new label email tool
func NewListCalendarsTool ¶ added in v0.1.9
NewListCalendarsTool creates a new list calendars tool
func NewListEmailLabelsTool ¶ added in v0.1.9
NewListEmailLabelsTool creates a new list email labels tool
func NewListEventsTool ¶
NewListEventsTool creates a new list events tool
func NewListTasksTool ¶
NewListTasksTool creates a new list tasks tool
func NewMarkEmailReadTool ¶
NewMarkEmailReadTool creates a new mark email read tool
func NewMarkEmailUnreadTool ¶
NewMarkEmailUnreadTool creates a new mark email unread tool
func NewProposeNewTimeTool ¶ added in v0.1.9
NewProposeNewTimeTool creates a new propose time tool
func NewReadContactTool ¶
NewReadContactTool creates a new read contact tool
func NewReadEmailTool ¶
NewReadEmailTool creates a new read email tool
func NewReplyEmailTool ¶ added in v0.1.9
NewReplyEmailTool creates a new reply email tool
func NewSearchContactsTool ¶
NewSearchContactsTool creates a new search contacts tool
func NewSearchEmailsTool ¶
NewSearchEmailsTool creates a new search emails tool
func NewSearchEventsTool ¶
NewSearchEventsTool creates a new search events tool
func NewSendEmailTool ¶
NewSendEmailTool creates a new send email tool
func NewTentativeEventTool ¶ added in v0.1.9
NewTentativeEventTool creates a new tentative event tool
func NewTodoWriteTool ¶
func NewTodoWriteTool() Tool
NewTodoWriteTool creates a new TodoWrite tool instance
func NewTodoWriteToolWithDB ¶
NewTodoWriteToolWithDB creates a new TodoWrite tool with database persistence
func NewUpdateContactTool ¶ added in v0.3.3
NewUpdateContactTool creates a new update contact tool
func NewUpdateEventTool ¶
NewUpdateEventTool creates a new update event tool
func NewUpdateTaskTool ¶
NewUpdateTaskTool creates a new update task tool
func NewWebFetchTool ¶
func NewWebFetchTool() Tool
NewWebFetchTool creates a new WebFetch tool instance
func NewWebSearchTool ¶
func NewWebSearchTool() Tool
NewWebSearchTool creates a new web search tool instance
type ToolResult ¶
type ToolResult struct {
Type string `json:"type"` // Always "tool_result"
ToolUseID string `json:"tool_use_id"` // ID from the ToolUse request
Content string `json:"content"` // Tool output or error message
IsError bool `json:"is_error"` // true if this represents an error
}
ToolResult represents a tool execution result to send back to the Anthropic API. This is sent as a content block in a user message after tool execution completes. See: https://docs.anthropic.com/claude/docs/tool-use#returning-tool-results
func ResultToToolResult ¶
func ResultToToolResult(result *Result, toolUseID string) ToolResult
ResultToToolResult converts an internal Result to a ToolResult for the API
Example ¶
ExampleResultToToolResult demonstrates converting internal results to API format
package main
import (
"fmt"
"github.com/2389-research/jeff/internal/tools"
)
func main() {
// Success result
successResult := &tools.Result{
ToolName: "read_file",
Success: true,
Output: "file contents",
}
apiResult1 := tools.ResultToToolResult(successResult, "toolu_123")
fmt.Printf("API result 1: type=%s, error=%v\n", apiResult1.Type, apiResult1.IsError)
// Error result
errorResult := &tools.Result{
ToolName: "write_file",
Success: false,
Error: "permission denied",
}
apiResult2 := tools.ResultToToolResult(errorResult, "toolu_456")
fmt.Printf("API result 2: type=%s, error=%v, content=%s\n",
apiResult2.Type, apiResult2.IsError, apiResult2.Content)
}
Output: API result 1: type=tool_result, error=false API result 2: type=tool_result, error=true, content=Error: permission denied
type ToolUse ¶
ToolUse is an alias for core.ToolUse for convenience Use core.ToolUse directly in new code
type UpdateContactTool ¶ added in v0.3.3
type UpdateContactTool struct {
// contains filtered or unexported fields
}
UpdateContactTool updates an existing contact
func (*UpdateContactTool) Description ¶ added in v0.3.3
func (t *UpdateContactTool) Description() string
Description returns what this tool does
func (*UpdateContactTool) Execute ¶ added in v0.3.3
func (t *UpdateContactTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the update contact operation
func (*UpdateContactTool) Name ¶ added in v0.3.3
func (t *UpdateContactTool) Name() string
Name returns the tool's identifier
func (*UpdateContactTool) RequiresApproval ¶ added in v0.3.3
func (t *UpdateContactTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type UpdateEventTool ¶
type UpdateEventTool struct {
// contains filtered or unexported fields
}
UpdateEventTool updates calendar events
func (*UpdateEventTool) Description ¶
func (t *UpdateEventTool) Description() string
Description returns what this tool does
func (*UpdateEventTool) Execute ¶
func (t *UpdateEventTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute runs the update event operation
func (*UpdateEventTool) Name ¶
func (t *UpdateEventTool) Name() string
Name returns the tool's identifier
func (*UpdateEventTool) RequiresApproval ¶
func (t *UpdateEventTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type UpdateTaskTool ¶
type UpdateTaskTool struct {
// contains filtered or unexported fields
}
UpdateTaskTool updates task details
func (*UpdateTaskTool) Description ¶
func (t *UpdateTaskTool) Description() string
Description returns what this tool does
func (*UpdateTaskTool) Name ¶
func (t *UpdateTaskTool) Name() string
Name returns the tool's identifier
func (*UpdateTaskTool) RequiresApproval ¶
func (t *UpdateTaskTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns whether this tool needs user confirmation
type WeatherTool ¶ added in v0.3.0
type WeatherTool struct{}
WeatherTool provides weather data retrieval capabilities
func NewWeatherTool ¶ added in v0.3.0
func NewWeatherTool() *WeatherTool
NewWeatherTool creates a new Weather tool instance
func (*WeatherTool) Description ¶ added in v0.3.0
func (t *WeatherTool) Description() string
Description returns the tool's purpose
func (*WeatherTool) Name ¶ added in v0.3.0
func (t *WeatherTool) Name() string
Name returns the tool identifier
func (*WeatherTool) RequiresApproval ¶ added in v0.3.0
func (t *WeatherTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (weather lookups are read-only)
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool fetches content from a URL and optionally processes it
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
Description returns the tool description
func (*WebFetchTool) RequiresApproval ¶
func (t *WebFetchTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval always returns true since this makes network requests
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool searches the web using DuckDuckGo and returns formatted results
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
Description returns a human-readable description of the tool
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, params map[string]interface{}) (*Result, error)
Execute performs the web search and returns formatted results
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
Name returns the tool's identifier
func (*WebSearchTool) RequiresApproval ¶
func (t *WebSearchTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns true since this tool makes network requests
type WorkingDaysTool ¶ added in v0.3.0
type WorkingDaysTool struct{}
WorkingDaysTool provides business day calculation capabilities
func NewWorkingDaysTool ¶ added in v0.3.0
func NewWorkingDaysTool() *WorkingDaysTool
NewWorkingDaysTool creates a new Working Days tool instance
func (*WorkingDaysTool) Description ¶ added in v0.3.0
func (t *WorkingDaysTool) Description() string
Description returns the tool's purpose
func (*WorkingDaysTool) Execute ¶ added in v0.3.0
func (t *WorkingDaysTool) Execute(_ context.Context, params map[string]interface{}) (*Result, error)
Execute performs the requested working days operation
func (*WorkingDaysTool) Name ¶ added in v0.3.0
func (t *WorkingDaysTool) Name() string
Name returns the tool identifier
func (*WorkingDaysTool) RequiresApproval ¶ added in v0.3.0
func (t *WorkingDaysTool) RequiresApproval(_ map[string]interface{}) bool
RequiresApproval returns false (working days calculations are read-only)
type WriteTool ¶
type WriteTool struct {
MaxContentSize int64 // Maximum content size to write (bytes)
}
WriteTool implements file writing functionality
func NewWriteTool ¶
func NewWriteTool() *WriteTool
NewWriteTool creates a new write tool with default settings
func (*WriteTool) Description ¶
Description returns the tool description
func (*WriteTool) RequiresApproval ¶
RequiresApproval always returns true for write operations
Source Files
¶
- ask_user_question_tool.go
- background_process_registry.go
- bash_output_tool.go
- bash_tool.go
- calendar_tools.go
- calendering_tool.go
- contact_tools.go
- currency_tool.go
- display_tool.go
- edit_tool.go
- email_tools.go
- email_validator_tool.go
- executor.go
- glob_tool.go
- grep_tool.go
- holiday_tool.go
- kill_shell_tool.go
- meeting_cost_tool.go
- mock_tool.go
- read_tool.go
- registry.go
- result.go
- stock_tool.go
- task_tool.go
- task_tools.go
- text_analysis_tool.go
- todo_write_tool.go
- tool.go
- types.go
- weather_tool.go
- web_fetch_tool.go
- web_search_tool.go
- workingdays_tool.go
- write_tool.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package holidays provides US federal holiday data and operations ABOUTME: Holiday calendar with US federal holidays (2024-2030) ABOUTME: Supports checking if date is holiday, listing holidays, finding next holiday
|
Package holidays provides US federal holiday data and operations ABOUTME: Holiday calendar with US federal holidays (2024-2030) ABOUTME: Supports checking if date is holiday, listing holidays, finding next holiday |
|
Package workingdays provides business day calculations ABOUTME: Working days calculator using US federal holidays ABOUTME: Supports checking working days, counting business days, adding business days
|
Package workingdays provides business day calculations ABOUTME: Working days calculator using US federal holidays ABOUTME: Supports checking working days, counting business days, adding business days |