tooling

package
v2026.601.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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 ExtractToolIntent

func ExtractToolIntent(rawArgs json.RawMessage) string

func FormatToolDisplayLines

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

func LegacyProseOutsideToolCalls(text string) string

func StripLegacyToolBlocks

func StripLegacyToolBlocks(text string) string

func UserFacingLegacyToolError

func UserFacingLegacyToolError(err error) string

func ValidateInvocationNames

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

func ValidateLegacyToolLines

func ValidateLegacyToolLines(text string) error

func WriteToolDisplayLines

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

Types

type FormatToolLinesFunc

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

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

type LegacyStreamWriter

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

func NewLegacyStreamWriter

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

func (*LegacyStreamWriter) DisplayRendered

func (w *LegacyStreamWriter) DisplayRendered() bool

func (*LegacyStreamWriter) Flush

func (w *LegacyStreamWriter) Flush() error

func (*LegacyStreamWriter) HasOpenToolCalls

func (w *LegacyStreamWriter) HasOpenToolCalls() bool

func (*LegacyStreamWriter) Invocations

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

func (*LegacyStreamWriter) TruncatedContent

func (w *LegacyStreamWriter) TruncatedContent() string

func (*LegacyStreamWriter) Write

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