code

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ApplyEditToolName is the public name exposed to the agent for applying code edits.
	ApplyEditToolName = "apply_edit"
)

Variables

This section is empty.

Functions

func ApplyEditDoc

func ApplyEditDoc() string

Types

type ApplyEditRequest

type ApplyEditRequest struct {
	CodeOutput string `json:"code_output"`
}

type ApplyEditTool

type ApplyEditTool struct {
	Code *cont.CodeContainer
}

ApplyEditTool applies a CodeOutput XML to an in-memory CodeContainer and persists changes to disk.

The tool expects JSON arguments with a single required field:

  • code_output: XML string representing cont.CodeOutput edits (see comments on cont.CodeOutput)

It returns a short summary string indicating which files were written.

func (*ApplyEditTool) Info

func (t *ApplyEditTool) Info(ctx context.Context) (*schema.ToolInfo, error)

Info implements the tool metadata for exposure to the agent runtime.

func (*ApplyEditTool) InvokableRun

func (t *ApplyEditTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...tool.Option) (string, error)

InvokableRun applies the provided CodeOutput XML to the container and writes changed files to disk. Invokable don't return error unless it is unrecoverable. It just returns the error as message to the model and let the model to handle it.

Jump to

Keyboard shortcuts

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