repl

package
v1.3.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package repl hosts the repl tool: a scratch REPL that runs a Python or JavaScript snippet in a fresh subprocess and returns its output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() []tools.ToolName

Names lists every tool name this package contributes.

Types

type REPLTool

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

REPLTool runs a code snippet via a language interpreter with cmd.Dir set to the workdir captured at construction. One instance per agent. The interpreter process is fresh per call — no variables, imports, or definitions persist between invocations.

func NewREPL

func NewREPL(workdir string) *REPLTool

NewREPL constructs a REPLTool bound to workdir. An empty workdir means "use the process's current directory" (cmd.Dir = "" — exec defaults).

func (*REPLTool) Description

func (t *REPLTool) Description() string

func (*REPLTool) Execute

func (t *REPLTool) Execute(ctx context.Context, logger *slog.Logger, input json.RawMessage) (tools.Result, error)

func (*REPLTool) Name

func (t *REPLTool) Name() string

func (*REPLTool) Schema

func (t *REPLTool) Schema() json.RawMessage

Jump to

Keyboard shortcuts

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