tools

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithStateWriter added in v0.6.0

func ContextWithStateWriter(ctx context.Context, w io.Writer) context.Context

ContextWithStateWriter returns a new context carrying the given state writer. This is retained for test assertions and potential downstream integrations where state is logged directly via context (rather than through reporter callbacks).

func FetchGitCommits

func FetchGitCommits(ctx context.Context, workingDir, base, head string) (string, error)

FetchGitCommits returns a bulleted list of commit subjects (first line of message) between base and head, excluding merge commits.

func FetchGitDiff

func FetchGitDiff(ctx context.Context, workingDir, base, head string, ignoredLockFiles []string) (string, []string, error)

func RegisterLocalTools

func RegisterLocalTools(r *Registry, root string, ignoredLockFiles []string, wishlistDir string, allowAskDeveloper bool, notifier UserNotifier)

func RegisterToolWithArgs added in v0.5.0

func RegisterToolWithArgs[T any](r *Registry, def llm.ToolDef, handler func(context.Context, T) (string, error))

RegisterToolWithArgs registers a tool that uses a specific struct for its arguments. It handles unmarshaling the arguments and returns an error if they are malformed.

func StateWriterFromContext added in v0.6.0

func StateWriterFromContext(ctx context.Context) io.Writer

StateWriterFromContext extracts the state writer from the context, if present.

func WithAskDeveloperTimeout added in v0.6.0

func WithAskDeveloperTimeout(ctx context.Context, d time.Duration) context.Context

WithAskDeveloperTimeout wraps a context to override the ask_developer timeout.

func WithTestStreams added in v0.6.0

func WithTestStreams(ctx context.Context, in io.Reader, out io.Writer) context.Context

WithTestStreams wraps a context to override standard input/output of ask_developer.

Types

type NoOpUserNotifier added in v0.6.0

type NoOpUserNotifier struct{}

func (NoOpUserNotifier) NotifyUser added in v0.6.0

func (NoOpUserNotifier) NotifyUser()

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) HandleCall

func (r *Registry) HandleCall(ctx context.Context, tc llm.ToolCall) (string, error)

func (*Registry) RegisterTool

func (r *Registry) RegisterTool(def llm.ToolDef, handler ToolHandler)

func (*Registry) ToTools

func (r *Registry) ToTools() []llm.ToolDef

type ToolHandler

type ToolHandler func(ctx context.Context, tc llm.ToolCall) (string, error)

type UserNotifier added in v0.6.0

type UserNotifier interface {
	NotifyUser()
}

Directories

Path Synopsis
mcp_servers

Jump to

Keyboard shortcuts

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