tooling

package
v0.20260526.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLegacyToolBlockComplete = errors.New("legacy tool_calls block complete")
View Source
var ErrMalformedLegacyTool = errors.New("malformed legacy tool block")
View Source
var ErrUnknownLegacyTool = errors.New("unknown legacy tool name")

Functions

func BaseNameFromFuncName

func BaseNameFromFuncName(full string) string

func FormatToolDisplayLines added in v0.20260525.0

func FormatToolDisplayLines(name string, rawArgs json.RawMessage) []string

func FuncName

func FuncName(fn any) (string, error)

func FuncSignature

func FuncSignature(fn any) (string, error)

func LegacyProseOutsideToolCalls added in v0.20260525.0

func LegacyProseOutsideToolCalls(text string) string

func StripLegacyToolBlocks added in v0.20260525.0

func StripLegacyToolBlocks(text string) string

func UserFacingLegacyToolError added in v0.20260525.0

func UserFacingLegacyToolError(err error) string

func ValidateInvocationNames added in v0.20260523.0

func ValidateInvocationNames(invs []Invocation, allowed map[string]struct{}) error

func ValidateLegacyToolLines added in v0.20260523.0

func ValidateLegacyToolLines(text string) error

func WriteToolDisplayLines added in v0.20260526.3

func WriteToolDisplayLines(out io.Writer, cpSeq int, branchKey string, lines []string)

Types

type FormatToolLinesFunc added in v0.20260523.0

type FormatToolLinesFunc func(name string, args json.RawMessage) []string

type Invocation

type Invocation struct {
	Name string
	Args json.RawMessage
}

func ExtractToolInvocations

func ExtractToolInvocations(text string) ([]Invocation, error)

func ParseToolCallsBlock added in v0.20260523.0

func ParseToolCallsBlock(block string) ([]Invocation, error)

type LegacyStreamWriter added in v0.20260523.0

type LegacyStreamWriter struct {
	Out     io.Writer
	Format  FormatToolLinesFunc
	Allowed map[string]struct{}
	// contains filtered or unexported fields
}

func NewLegacyStreamWriter added in v0.20260523.0

func NewLegacyStreamWriter(out io.Writer, format FormatToolLinesFunc, allowed map[string]struct{}) *LegacyStreamWriter

func (*LegacyStreamWriter) DisplayRendered added in v0.20260523.0

func (w *LegacyStreamWriter) DisplayRendered() bool

func (*LegacyStreamWriter) Flush added in v0.20260523.0

func (w *LegacyStreamWriter) Flush() error

func (*LegacyStreamWriter) HasOpenToolCalls added in v0.20260523.0

func (w *LegacyStreamWriter) HasOpenToolCalls() bool

func (*LegacyStreamWriter) Invocations added in v0.20260523.0

func (w *LegacyStreamWriter) Invocations() []Invocation

func (*LegacyStreamWriter) TruncatedContent added in v0.20260523.0

func (w *LegacyStreamWriter) TruncatedContent() string

func (*LegacyStreamWriter) Write added in v0.20260523.0

func (w *LegacyStreamWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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