toolbuiltin

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskStatusPending    = string(tasks.TaskPending)
	TaskStatusInProgress = string(tasks.TaskInProgress)
	TaskStatusCompleted  = string(tasks.TaskCompleted)
	TaskStatusBlocked    = string(tasks.TaskBlocked)
)

Variables

This section is empty.

Functions

func LookupShortToolDesc added in v0.1.5

func LookupShortToolDesc(name string) (string, bool)

LookupShortToolDesc returns the model-facing short description for a tool.

func SkillActivationContextFromContext

func SkillActivationContextFromContext(ctx context.Context) (skills.ActivationContext, bool)

SkillActivationContextFromContext extracts an activation context if present.

func WithSkillActivationContext

func WithSkillActivationContext(ctx context.Context, ac skills.ActivationContext) context.Context

WithSkillActivationContext attaches a skills.ActivationContext to the context.

Types

type ActivationContextProvider

type ActivationContextProvider func(context.Context) skills.ActivationContext

ActivationContextProvider resolves the activation context for manual skill calls.

type AskUserQuestionTool

type AskUserQuestionTool struct{}

AskUserQuestionTool requests user input via an external permission component.

func NewAskUserQuestionTool

func NewAskUserQuestionTool() *AskUserQuestionTool

func (*AskUserQuestionTool) Description

func (t *AskUserQuestionTool) Description() string

func (*AskUserQuestionTool) Execute

func (t *AskUserQuestionTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*AskUserQuestionTool) Name

func (t *AskUserQuestionTool) Name() string

func (*AskUserQuestionTool) Schema

func (t *AskUserQuestionTool) Schema() *tool.JSONSchema

type AsyncTask

type AsyncTask struct {
	ID        string
	Command   string
	StartTime time.Time
	Done      chan struct{}
	Error     error
	// contains filtered or unexported fields
}

AsyncTask represents a single async bash invocation.

type AsyncTaskInfo

type AsyncTaskInfo struct {
	ID        string    `json:"id"`
	Command   string    `json:"command"`
	Status    string    `json:"status"`
	StartTime time.Time `json:"start_time"`
	Error     string    `json:"error,omitempty"`
}

AsyncTaskInfo is a lightweight snapshot used by List().

type AsyncTaskManager

type AsyncTaskManager struct {
	// contains filtered or unexported fields
}

AsyncTaskManager tracks and manages async bash tasks.

func DefaultAsyncTaskManager

func DefaultAsyncTaskManager() *AsyncTaskManager

DefaultAsyncTaskManager returns the global async task manager.

func (*AsyncTaskManager) GetOutput

func (m *AsyncTaskManager) GetOutput(id string) (string, bool, error)

GetOutput returns incremental output since last read, whether the task is done, and any task error.

func (*AsyncTaskManager) Kill

func (m *AsyncTaskManager) Kill(id string) error

Kill terminates a running task.

func (*AsyncTaskManager) List

func (m *AsyncTaskManager) List() []AsyncTaskInfo

List reports all known tasks with their status.

func (*AsyncTaskManager) OutputFile

func (m *AsyncTaskManager) OutputFile(id string) string

func (*AsyncTaskManager) SetMaxOutputLen

func (m *AsyncTaskManager) SetMaxOutputLen(maxLen int)

func (*AsyncTaskManager) Shutdown

func (m *AsyncTaskManager) Shutdown(ctx context.Context) error

Shutdown attempts to terminate all tasks and waits for completion. It is best-effort: any kill errors are logged, and the method blocks until every task signals Done or the context is cancelled.

func (*AsyncTaskManager) Start

func (m *AsyncTaskManager) Start(id, command string) error

Start launches a task in the background using a detached context.

type BashOutputTool

type BashOutputTool struct {
	// contains filtered or unexported fields
}

BashOutputTool exposes incremental output retrieval for background shells.

func NewBashOutputTool

func NewBashOutputTool(store *ShellStore) *BashOutputTool

NewBashOutputTool creates a tool backed by the provided shell store.

func (*BashOutputTool) Description

func (b *BashOutputTool) Description() string

func (*BashOutputTool) Execute

func (b *BashOutputTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*BashOutputTool) Name

func (b *BashOutputTool) Name() string

func (*BashOutputTool) Schema

func (b *BashOutputTool) Schema() *tool.JSONSchema

type BashStatusTool

type BashStatusTool struct{}

BashStatusTool checks async task status without consuming buffered output. Returns: {"status":"running|completed|failed", "exit_code":0}

func NewBashStatusTool

func NewBashStatusTool() *BashStatusTool

func (*BashStatusTool) Description

func (b *BashStatusTool) Description() string

func (*BashStatusTool) Execute

func (b *BashStatusTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*BashStatusTool) Name

func (b *BashStatusTool) Name() string

func (*BashStatusTool) Schema

func (b *BashStatusTool) Schema() *tool.JSONSchema

type BashTool

type BashTool struct {
	// contains filtered or unexported fields
}

BashTool executes validated commands using bash within a sandbox.

func NewBashTool

func NewBashTool() *BashTool

NewBashTool builds a BashTool rooted at the current directory.

func NewBashToolWithRoot

func NewBashToolWithRoot(root string) *BashTool

NewBashToolWithRoot builds a BashTool rooted at the provided directory.

func NewBashToolWithSandbox

func NewBashToolWithSandbox(root string, sandbox *security.Sandbox) *BashTool

NewBashToolWithSandbox builds a BashTool with a custom sandbox. Used when sandbox needs to be pre-configured (e.g., disabled mode).

func (*BashTool) AllowShellMetachars

func (b *BashTool) AllowShellMetachars(allow bool)

AllowShellMetachars enables shell pipes and metacharacters (CLI mode).

func (*BashTool) Description

func (b *BashTool) Description() string

func (*BashTool) Execute

func (b *BashTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*BashTool) Name

func (b *BashTool) Name() string

func (*BashTool) Schema

func (b *BashTool) Schema() *tool.JSONSchema

func (*BashTool) SetOutputThresholdBytes

func (b *BashTool) SetOutputThresholdBytes(threshold int)

SetOutputThresholdBytes controls when output is spooled to disk.

func (*BashTool) StreamExecute

func (b *BashTool) StreamExecute(ctx context.Context, params map[string]interface{}, emit func(chunk string, isStderr bool)) (*tool.ToolResult, error)

StreamExecute runs the bash command while emitting incremental output. It preserves backwards compatibility by sharing validation and metadata with Execute, and spools output to disk after crossing the configured threshold.

type EditTool

type EditTool struct {
	// contains filtered or unexported fields
}

EditTool applies safe in-place replacements.

func NewEditTool

func NewEditTool() *EditTool

NewEditTool builds an EditTool rooted at the current directory.

func NewEditToolWithRoot

func NewEditToolWithRoot(root string) *EditTool

NewEditToolWithRoot builds an EditTool rooted at the provided directory.

func NewEditToolWithSandbox

func NewEditToolWithSandbox(root string, sandbox *security.Sandbox) *EditTool

NewEditToolWithSandbox builds an EditTool using a custom sandbox.

func (*EditTool) Description

func (e *EditTool) Description() string

func (*EditTool) Execute

func (e *EditTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*EditTool) Name

func (e *EditTool) Name() string

func (*EditTool) Schema

func (e *EditTool) Schema() *tool.JSONSchema

type GlobTool

type GlobTool struct {
	// contains filtered or unexported fields
}

GlobTool looks up files via glob patterns.

func NewGlobTool

func NewGlobTool() *GlobTool

NewGlobTool builds a GlobTool rooted at the current directory.

func NewGlobToolWithRoot

func NewGlobToolWithRoot(root string) *GlobTool

NewGlobToolWithRoot builds a GlobTool rooted at the provided directory.

func NewGlobToolWithSandbox

func NewGlobToolWithSandbox(root string, sandbox *security.Sandbox) *GlobTool

NewGlobToolWithSandbox builds a GlobTool using a custom sandbox.

func (*GlobTool) Description

func (g *GlobTool) Description() string

func (*GlobTool) Execute

func (g *GlobTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*GlobTool) Name

func (g *GlobTool) Name() string

func (*GlobTool) Schema

func (g *GlobTool) Schema() *tool.JSONSchema

func (*GlobTool) SetRespectGitignore

func (g *GlobTool) SetRespectGitignore(respect bool)

SetRespectGitignore configures whether the tool should respect .gitignore patterns.

type GrepMatch

type GrepMatch struct {
	File   string   `json:"file"`
	Line   int      `json:"line"`
	Match  string   `json:"match"`
	Before []string `json:"before,omitempty"`
	After  []string `json:"after,omitempty"`
}

GrepMatch captures a single match along with optional context.

type GrepTool

type GrepTool struct {
	// contains filtered or unexported fields
}

GrepTool enables scoped code searches.

func NewGrepTool

func NewGrepTool() *GrepTool

NewGrepTool builds a GrepTool rooted at the current directory.

func NewGrepToolWithRoot

func NewGrepToolWithRoot(root string) *GrepTool

NewGrepToolWithRoot builds a GrepTool rooted at the provided directory.

func NewGrepToolWithSandbox

func NewGrepToolWithSandbox(root string, sandbox *security.Sandbox) *GrepTool

NewGrepToolWithSandbox builds a GrepTool using a custom sandbox.

func (*GrepTool) Description

func (g *GrepTool) Description() string

func (*GrepTool) Execute

func (g *GrepTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*GrepTool) Name

func (g *GrepTool) Name() string

func (*GrepTool) Schema

func (g *GrepTool) Schema() *tool.JSONSchema

func (*GrepTool) SetRespectGitignore

func (g *GrepTool) SetRespectGitignore(respect bool)

SetRespectGitignore configures whether the tool should respect .gitignore patterns.

type KillTaskTool

type KillTaskTool struct{}

KillTaskTool terminates async bash tasks.

func NewKillTaskTool

func NewKillTaskTool() *KillTaskTool

func (*KillTaskTool) Description

func (k *KillTaskTool) Description() string

func (*KillTaskTool) Execute

func (k *KillTaskTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*KillTaskTool) Name

func (k *KillTaskTool) Name() string

func (*KillTaskTool) Schema

func (k *KillTaskTool) Schema() *tool.JSONSchema

type ListSkillsTool

type ListSkillsTool struct {
	// contains filtered or unexported fields
}

ListSkillsTool scans workspace/.claude/skills/ and returns all SKILL.md metadata.

func NewListSkillsTool

func NewListSkillsTool(workspaceDir string) *ListSkillsTool

NewListSkillsTool creates a ListSkillsTool rooted at workspaceDir.

func (*ListSkillsTool) Description

func (t *ListSkillsTool) Description() string

func (*ListSkillsTool) Execute

func (t *ListSkillsTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*ListSkillsTool) Name

func (t *ListSkillsTool) Name() string

func (*ListSkillsTool) Schema

func (t *ListSkillsTool) Schema() *tool.JSONSchema

type MemoryChunk

type MemoryChunk struct {
	Path      string  `json:"path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Snippet   string  `json:"snippet"`
	Score     float64 `json:"score"`
}

MemoryChunk is a scored chunk of a memory file returned by SearchMemory.

func SearchMemory

func SearchMemory(workspaceDir, query string, maxResults int) ([]MemoryChunk, error)

SearchMemory runs a BM25 search over MEMORY.md + memory/*.md and returns the top matching snippets. It is exported so the SDK runtime can call it before each agent turn to auto-inject relevant memories (auto-recall). Returns nil if no files exist or no results match. SearchMemory runs a BM25 search over MEMORY.md + memory/*.md and returns the top matching snippets. It is exported so the SDK runtime can call it before each agent turn to auto-inject relevant memories (auto-recall). Returns nil if no files exist or no results match.

type MemoryGetTool

type MemoryGetTool struct {
	// contains filtered or unexported fields
}

MemoryGetTool reads specific lines from memory files.

func NewMemoryGetTool

func NewMemoryGetTool(workspaceDir string) *MemoryGetTool

NewMemoryGetTool creates a MemoryGetTool rooted at workspaceDir.

func (*MemoryGetTool) Description

func (t *MemoryGetTool) Description() string

func (*MemoryGetTool) Execute

func (t *MemoryGetTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*MemoryGetTool) Name

func (t *MemoryGetTool) Name() string

func (*MemoryGetTool) Schema

func (t *MemoryGetTool) Schema() *tool.JSONSchema

type MemorySearchTool

type MemorySearchTool struct {
	// contains filtered or unexported fields
}

MemorySearchTool searches MEMORY.md and memory/*.md files for relevant content.

func NewMemorySearchTool

func NewMemorySearchTool(workspaceDir string) *MemorySearchTool

NewMemorySearchTool creates a MemorySearchTool rooted at workspaceDir.

func (*MemorySearchTool) Description

func (t *MemorySearchTool) Description() string

func (*MemorySearchTool) Execute

func (t *MemorySearchTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*MemorySearchTool) Name

func (t *MemorySearchTool) Name() string

func (*MemorySearchTool) Schema

func (t *MemorySearchTool) Schema() *tool.JSONSchema

type MemoryWriteTool

type MemoryWriteTool struct {
	// contains filtered or unexported fields
}

MemoryWriteTool writes content to memory files.

func NewMemoryWriteTool

func NewMemoryWriteTool(workspaceDir string) *MemoryWriteTool

NewMemoryWriteTool creates a MemoryWriteTool rooted at workspaceDir.

func (*MemoryWriteTool) Description

func (t *MemoryWriteTool) Description() string

func (*MemoryWriteTool) Execute

func (t *MemoryWriteTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*MemoryWriteTool) Name

func (t *MemoryWriteTool) Name() string

func (*MemoryWriteTool) Schema

func (t *MemoryWriteTool) Schema() *tool.JSONSchema

type Question

type Question struct {
	Question    string           `json:"question"`
	Header      string           `json:"header"`
	Options     []QuestionOption `json:"options"`
	MultiSelect bool             `json:"multiSelect"`
}

Question represents a question to ask the user.

type QuestionOption

type QuestionOption struct {
	Label       string `json:"label"`
	Description string `json:"description"`
}

QuestionOption represents a selectable option for a question.

type ReadTool

type ReadTool struct {
	// contains filtered or unexported fields
}

ReadTool streams files with strict sandbox boundaries.

func NewReadTool

func NewReadTool() *ReadTool

NewReadTool builds a ReadTool rooted at the current directory.

func NewReadToolWithRoot

func NewReadToolWithRoot(root string) *ReadTool

NewReadToolWithRoot builds a ReadTool rooted at the provided directory.

func NewReadToolWithSandbox

func NewReadToolWithSandbox(root string, sandbox *security.Sandbox) *ReadTool

NewReadToolWithSandbox builds a ReadTool using a custom sandbox.

func (*ReadTool) Description

func (r *ReadTool) Description() string

func (*ReadTool) Execute

func (r *ReadTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*ReadTool) Name

func (r *ReadTool) Name() string

func (*ReadTool) Schema

func (r *ReadTool) Schema() *tool.JSONSchema

type SearchResult

type SearchResult struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	Snippet string `json:"snippet"`
}

SearchResult describes a single search hit.

type SendFileTool

type SendFileTool struct{}

SendFileTool sends a file to the user

func NewSendFileTool

func NewSendFileTool() *SendFileTool

func (*SendFileTool) Description

func (t *SendFileTool) Description() string

func (*SendFileTool) Execute

func (t *SendFileTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*SendFileTool) Name

func (t *SendFileTool) Name() string

func (*SendFileTool) Schema

func (t *SendFileTool) Schema() *tool.JSONSchema

type ShellHandle

type ShellHandle struct {
	// contains filtered or unexported fields
}

ShellHandle allows append/close operations scoped to a shell.

func (*ShellHandle) Append

func (h *ShellHandle) Append(stream ShellStream, data string) error

Append sends stdout/stderr chunks to the shell buffer.

func (*ShellHandle) Close

func (h *ShellHandle) Close(exitCode int) error

Close marks the shell as completed.

func (*ShellHandle) Fail

func (h *ShellHandle) Fail(err error) error

Fail marks the shell as failed.

type ShellLine

type ShellLine struct {
	Stream    ShellStream `json:"stream"`
	Content   string      `json:"content"`
	Sequence  int         `json:"sequence"`
	Timestamp time.Time   `json:"timestamp"`
}

ShellLine represents a single line of shell output.

type ShellRead

type ShellRead struct {
	ShellID   string      `json:"shell_id"`
	Status    ShellStatus `json:"status"`
	Lines     []ShellLine `json:"lines"`
	Dropped   int         `json:"dropped"`
	ExitCode  int         `json:"exit_code"`
	Error     string      `json:"error,omitempty"`
	UpdatedAt time.Time   `json:"updated_at"`
}

ShellRead reports the outcome of consuming buffered shell output.

type ShellStatus

type ShellStatus string

ShellStatus represents the lifecycle status of a shell.

const (
	// ShellStatusRunning indicates the shell is still producing output.
	ShellStatusRunning ShellStatus = "running"
	// ShellStatusCompleted indicates the shell exited without error.
	ShellStatusCompleted ShellStatus = "completed"
	// ShellStatusFailed indicates the shell exited with an error.
	ShellStatusFailed ShellStatus = "failed"
)

type ShellStore

type ShellStore struct {
	// contains filtered or unexported fields
}

ShellStore tracks background shell buffers safely.

func DefaultShellStore

func DefaultShellStore() *ShellStore

DefaultShellStore exposes the shared global store.

func (*ShellStore) Append

func (s *ShellStore) Append(id string, stream ShellStream, data string) error

Append appends output to the shell buffer.

func (*ShellStore) Close

func (s *ShellStore) Close(id string, exitCode int) error

Close marks the shell as completed with the provided exit code.

func (*ShellStore) Consume

func (s *ShellStore) Consume(id string, filter *regexp.Regexp) (ShellRead, error)

Consume drains pending lines applying an optional regex filter.

func (*ShellStore) Fail

func (s *ShellStore) Fail(id string, err error) error

Fail marks the shell as failed with an error.

func (*ShellStore) Register

func (s *ShellStore) Register(id string) (*ShellHandle, error)

Register initialises a shell buffer with the given id.

type ShellStream

type ShellStream string

ShellStream distinguishes stdout/stderr streams.

const (
	// ShellStreamStdout captures stdout data.
	ShellStreamStdout ShellStream = "stdout"
	// ShellStreamStderr captures stderr data.
	ShellStreamStderr ShellStream = "stderr"
)

type SkillSummary added in v0.1.1

type SkillSummary struct {
	Name        string
	Description string
	Location    string
}

SkillSummary holds the minimal metadata needed to describe a skill.

func ScanSkillsList added in v0.1.1

func ScanSkillsList(workspaceDir string) []SkillSummary

ScanSkillsList reads {workspaceDir}/.claude/skills/*/SKILL.md and returns name+description for every valid skill, sorted by name. It is exported so that other packages (e.g. api) can inject the list into prompts without duplicating frontmatter-parsing logic.

type SkillTool

type SkillTool struct {
	// contains filtered or unexported fields
}

SkillTool adapts the runtime skills registry into a tool.

func NewSkillTool

func NewSkillTool(reg *skills.Registry, provider ActivationContextProvider) *SkillTool

NewSkillTool wires the registry with an optional activation provider.

func (*SkillTool) Description

func (s *SkillTool) Description() string

func (*SkillTool) Execute

func (s *SkillTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*SkillTool) Name

func (s *SkillTool) Name() string

func (*SkillTool) Schema

func (s *SkillTool) Schema() *tool.JSONSchema

type SlashCommandTool

type SlashCommandTool struct {
	// contains filtered or unexported fields
}

SlashCommandTool routes slash command invocations to the command executor.

func NewSlashCommandTool

func NewSlashCommandTool(exec *commands.Executor) *SlashCommandTool

NewSlashCommandTool builds a tool backed by the provided executor.

func (*SlashCommandTool) Description

func (s *SlashCommandTool) Description() string

func (*SlashCommandTool) Execute

func (s *SlashCommandTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*SlashCommandTool) Name

func (s *SlashCommandTool) Name() string

func (*SlashCommandTool) Schema

func (s *SlashCommandTool) Schema() *tool.JSONSchema

type TaskCreateTool

type TaskCreateTool struct {
	// contains filtered or unexported fields
}

func NewTaskCreateTool

func NewTaskCreateTool(store *tasks.TaskStore) *TaskCreateTool

func (*TaskCreateTool) Description

func (t *TaskCreateTool) Description() string

func (*TaskCreateTool) Execute

func (t *TaskCreateTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TaskCreateTool) Name

func (t *TaskCreateTool) Name() string

func (*TaskCreateTool) Schema

func (t *TaskCreateTool) Schema() *tool.JSONSchema

type TaskGetTool

type TaskGetTool struct {
	// contains filtered or unexported fields
}

func NewTaskGetTool

func NewTaskGetTool(store *tasks.TaskStore) *TaskGetTool

func (*TaskGetTool) Description

func (t *TaskGetTool) Description() string

func (*TaskGetTool) Execute

func (t *TaskGetTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TaskGetTool) Name

func (t *TaskGetTool) Name() string

func (*TaskGetTool) Schema

func (t *TaskGetTool) Schema() *tool.JSONSchema

type TaskListTool

type TaskListTool struct {
	// contains filtered or unexported fields
}

func NewTaskListTool

func NewTaskListTool(store *tasks.TaskStore) *TaskListTool

func (*TaskListTool) Description

func (t *TaskListTool) Description() string

func (*TaskListTool) Execute

func (t *TaskListTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TaskListTool) Name

func (t *TaskListTool) Name() string

func (*TaskListTool) Schema

func (t *TaskListTool) Schema() *tool.JSONSchema

type TaskRef

type TaskRef struct {
	ID      string `json:"id"`
	Subject string `json:"subject,omitempty"`
	Status  string `json:"status"`
	Owner   string `json:"owner,omitempty"`
}

type TaskRequest

type TaskRequest struct {
	Description  string
	Prompt       string
	SubagentType string
	Model        string
	Resume       string
}

TaskRequest carries normalized parameters gathered from the tool input.

type TaskRunner

type TaskRunner func(context.Context, TaskRequest) (*tool.ToolResult, error)

TaskRunner executes a validated task invocation.

type TaskTool

type TaskTool struct {
	// contains filtered or unexported fields
}

TaskTool launches specialized subagents through the runtime.

func NewTaskTool

func NewTaskTool() *TaskTool

NewTaskTool constructs an instance with no runner attached.

func (*TaskTool) Description

func (t *TaskTool) Description() string

func (*TaskTool) Execute

func (t *TaskTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TaskTool) Name

func (t *TaskTool) Name() string

func (*TaskTool) Schema

func (t *TaskTool) Schema() *tool.JSONSchema

func (*TaskTool) SetRunner

func (t *TaskTool) SetRunner(runner TaskRunner)

SetRunner wires the runtime callback that executes task invocations.

type TaskUpdateTool

type TaskUpdateTool struct {
	// contains filtered or unexported fields
}

func NewTaskUpdateTool

func NewTaskUpdateTool(store *tasks.TaskStore) *TaskUpdateTool

func (*TaskUpdateTool) Description

func (t *TaskUpdateTool) Description() string

func (*TaskUpdateTool) Execute

func (t *TaskUpdateTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TaskUpdateTool) Name

func (t *TaskUpdateTool) Name() string

func (*TaskUpdateTool) Schema

func (t *TaskUpdateTool) Schema() *tool.JSONSchema

func (*TaskUpdateTool) Snapshot

func (t *TaskUpdateTool) Snapshot(taskID string) (tasks.Task, bool)

type TodoWriteItem

type TodoWriteItem struct {
	Content    string `json:"content"`
	Status     string `json:"status"`
	ActiveForm string `json:"activeForm"`
}

type TodoWriteTool

type TodoWriteTool struct {
	// contains filtered or unexported fields
}

TodoWriteTool stores a session-local todo list in memory. It mirrors the Claude Code style TodoWrite tool surface.

func NewTodoWriteTool

func NewTodoWriteTool() *TodoWriteTool

func (*TodoWriteTool) Description

func (t *TodoWriteTool) Description() string

func (*TodoWriteTool) Execute

func (t *TodoWriteTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*TodoWriteTool) Name

func (t *TodoWriteTool) Name() string

func (*TodoWriteTool) Schema

func (t *TodoWriteTool) Schema() *tool.JSONSchema

func (*TodoWriteTool) Snapshot

func (t *TodoWriteTool) Snapshot() []TodoWriteItem

type WebFetchOptions

type WebFetchOptions struct {
	HTTPClient        *http.Client
	Timeout           time.Duration
	CacheTTL          time.Duration
	MaxContentSize    int64
	AllowedHosts      []string
	BlockedHosts      []string
	AllowPrivateHosts bool
}

WebFetchOptions configures WebFetchTool behaviour.

type WebFetchTool

type WebFetchTool struct {
	// contains filtered or unexported fields
}

WebFetchTool fetches remote web pages and returns Markdown content.

func NewWebFetchTool

func NewWebFetchTool(opts *WebFetchOptions) *WebFetchTool

NewWebFetchTool builds a WebFetchTool with sane defaults.

func (*WebFetchTool) Description

func (w *WebFetchTool) Description() string

func (*WebFetchTool) Execute

func (w *WebFetchTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

Execute fetches the requested URL, converts it to Markdown and returns metadata.

func (*WebFetchTool) Name

func (w *WebFetchTool) Name() string

func (*WebFetchTool) Schema

func (w *WebFetchTool) Schema() *tool.JSONSchema

type WebSearchOptions

type WebSearchOptions struct {
	HTTPClient *http.Client
	Timeout    time.Duration
	MaxResults int
	CacheTTL   time.Duration
	FailureTTL time.Duration
}

WebSearchOptions configures HTTP behaviour for WebSearchTool.

type WebSearchTool

type WebSearchTool struct {
	// contains filtered or unexported fields
}

WebSearchTool proxies search queries to an HTTP endpoint and filters domains.

func NewWebSearchTool

func NewWebSearchTool(opts *WebSearchOptions) *WebSearchTool

NewWebSearchTool constructs a search tool with defaults.

func (*WebSearchTool) Description

func (w *WebSearchTool) Description() string

func (*WebSearchTool) Execute

func (w *WebSearchTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

Execute performs a remote search and filters results using domain lists.

func (*WebSearchTool) Name

func (w *WebSearchTool) Name() string

func (*WebSearchTool) Schema

func (w *WebSearchTool) Schema() *tool.JSONSchema

type WriteTool

type WriteTool struct {
	// contains filtered or unexported fields
}

WriteTool writes files within the sandbox root.

func NewWriteTool

func NewWriteTool() *WriteTool

NewWriteTool builds a WriteTool rooted at the current directory.

func NewWriteToolWithRoot

func NewWriteToolWithRoot(root string) *WriteTool

NewWriteToolWithRoot builds a WriteTool rooted at the provided directory.

func NewWriteToolWithSandbox

func NewWriteToolWithSandbox(root string, sandbox *security.Sandbox) *WriteTool

NewWriteToolWithSandbox builds a WriteTool using a custom sandbox.

func (*WriteTool) Description

func (w *WriteTool) Description() string

func (*WriteTool) Execute

func (w *WriteTool) Execute(ctx context.Context, params map[string]interface{}) (*tool.ToolResult, error)

func (*WriteTool) Name

func (w *WriteTool) Name() string

func (*WriteTool) Schema

func (w *WriteTool) Schema() *tool.JSONSchema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL