toolargs

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package toolargs picks the short argument a tool call is shown by, from its input as JSON, the same for the transcript and the live phase.

Index

Constants

View Source
const (
	// MaxPaths and MaxPathBytes bound the paths read from a patch or asked
	// about at once, and each path; MaxHintBytes bounds a patch's paths
	// together.
	MaxPaths     = 64
	MaxPathBytes = 4096
	MaxHintBytes = 16 << 10
)

Variables

This section is empty.

Functions

func BoundedPreview

func BoundedPreview(s string, limit int) string

BoundedPreview is s on one line, each run of white space one space, cut to at most limit bytes on a rune boundary.

func Compact

func Compact(name, input string) (arg, path string)

Compact is the argument a call of tool name with input (its arguments as JSON) is shown by, and the file path it names, if any.

func PatchFilePaths

func PatchFilePaths(patch string) []string

PatchFilePaths parses only the supported patch framing and file headers. Content lines must belong to Add or Update sections; unknown or truncated syntax discards all paths.

func ValidPath

func ValidPath(path string) bool

ValidPath reports whether path is a usable file path: present, bounded, valid UTF-8 and without NUL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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