tools

package
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ask func(ctx context.Context, req AskRequest) (answers []string, ok bool)
View Source
var Browser *browser.Manager
View Source
var ComputerApprover func(app string) bool
View Source
var ComputerPolicy *computer.Policy
View Source
var LSP interface {
	WaitDiagnostics(ctx context.Context, path string) string
}
View Source
var ScreenshotSink func(jpegs [][]byte)
View Source
var Suggester func(name string) []string

Functions

func BinaryPlaceholder

func BinaryPlaceholder(name string, size int) string

func CommandRule

func CommandRule(command string) string

func Defs

func Defs(ts []Tool) []ai.Tool

func Execute

func Execute(ctx context.Context, ts []Tool, name string, args json.RawMessage) string

func IsBinary

func IsBinary(data []byte) bool

func IsStale

func IsStale(err error) bool

func SuggestTool

func SuggestTool(name string, candidates []string) []string

func Truncate

func Truncate(s string) string

func TruncateTail

func TruncateTail(s string) string

func WithOnUpdate

func WithOnUpdate(ctx context.Context, onUpdate func(outputSoFar string)) context.Context

Types

type AskOption

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

type AskRequest

type AskRequest struct {
	Question string      `json:"question"`
	Options  []AskOption `json:"options"`
	Multiple bool        `json:"multiple"`
}

type GateDecision

type GateDecision int
const (
	GateAllowOnce GateDecision = iota
	GateAllowAlways
	GateReject
)

type GateRequest

type GateRequest struct {
	Tool    string
	Command string
	Rule    string
}

type InteractiveRunner

type InteractiveRunner interface {
	Run(ctx context.Context, command string, timeout time.Duration, keys <-chan []byte) string
}
var InteractiveBash InteractiveRunner

type Tool

type Tool struct {
	Def ai.Tool
	Run func(ctx context.Context, args json.RawMessage) (string, error)
}

func All

func All() []Tool

func BrowserExec

func BrowserExec() Tool

func ComputerExec

func ComputerExec() Tool

func QuestionTool

func QuestionTool() Tool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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