tooling

package
v2026.615.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 19 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 FormatToolResultDisplayLines added in v2026.602.2

func FormatToolResultDisplayLines(toolName string, payload string) []string

func FuncName

func FuncName(fn any) (string, error)

func FuncSignature

func FuncSignature(fn any) (string, error)

func HighlightGoLineForTest added in v2026.613.0

func HighlightGoLineForTest(line string) string

func LegacyProseOutsideToolCalls

func LegacyProseOutsideToolCalls(text string) string

func SplitStyledRangeForTest added in v2026.613.0

func SplitStyledRangeForTest(styled string, start, end int) 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)

func WriteToolDisplayLinesWithWidth added in v2026.613.0

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

Types

type FormatToolLinesFunc

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

type Invocation

type Invocation struct {
	Name       string
	Args       json.RawMessage
	ToolCallID string
}

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