tools

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolOutputsSubdir = "tool-outputs"
)

Variables

This section is empty.

Functions

func CleanOldOutputs

func CleanOldOutputs(sessionsRoot string)

CleanOldOutputs sweeps every session, not just the live one, whose directory is too new to hold anything old enough to delete.

func ForkSkill

func ForkSkill(ctx context.Context, inv *skill.Invocation, fork ForkExecutor) (agentcore.Result, error)

func NewAskUser

func NewAskUser(ui interact.UI) agentcore.Tool

func NewEnterWorktree

func NewEnterWorktree(enter func(name string) (dir string, err error)) agentcore.Tool

func NewExitWorktree

func NewExitWorktree(exit func(discard bool) (message string, err error)) agentcore.Tool

func NewSkillTool

func NewSkillTool(catalog func() *skill.Catalog, sessionID string, fork ForkExecutor, invoked func(*skill.Invocation)) agentcore.Tool

NewSkillTool calls invoked with every invocation before it runs. catalog returns the skills active in the conversation's workspace.

func NewTodoWrite

func NewTodoWrite() agentcore.Tool

NewTodoWrite stores nothing: the list lives in the history (see todo.FromHistory).

func NewWebFetch

func NewWebFetch(provider, apiKey string) agentcore.Tool

NewWebFetch takes provider "tavily" or "jina"; only jina works without an API key.

func NewWebSearch

func NewWebSearch(provider, apiKey string) agentcore.Tool

Types

type ForkExecutor

type ForkExecutor func(ctx context.Context, args json.RawMessage) (agentcore.Result, error)

ForkExecutor has the subagent tool's Run signature, so it can be wired directly.

type OutputLimiter

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

OutputLimiter saves oversized tool output to disk and leaves a head/tail preview with the path. As middleware it covers every tool, MCP included.

func NewOutputLimiter

func NewOutputLimiter(dir string) *OutputLimiter

func (*OutputLimiter) Middleware

func (l *OutputLimiter) Middleware() agentcore.ToolMiddleware

Middleware must be installed innermost (last in the slice) so hooks and telemetry see the same shortened result as the model.

type SearchResult

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

Jump to

Keyboard shortcuts

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