Versions in this module Expand all Collapse all v0 v0.4.10 Jul 30, 2026 Changes in this version + func DetectLineEnding(content string) string + func DetectSupportedImageMimeType(buffer []byte) string + func ExpandPath(filePath string) (string, error) + func FormatDimensionNote(result ResizedImage) string + func GenerateUnifiedPatch(path, oldContent, newContent string, contextLines int) (string, error) + func GetShellEnv() (map[string]string, error) — darwin/amd64, js/wasm, linux/amd64 + func KillProcessTree(pid int) — darwin/amd64, js/wasm, linux/amd64 + func KillTrackedDetachedChildren() — darwin/amd64, js/wasm, linux/amd64 + func ManagedFDPath() string + func NewBashTool(cwd string, options *BashToolOptions) agent.AgentTool + func NewCodingTools(cwd string, options *ToolsOptions) []agent.AgentTool + func NewEditTool(cwd string, options *EditToolOptions) agent.AgentTool + func NewFindTool(cwd string, options *FindToolOptions) agent.AgentTool + func NewGrepTool(cwd string, options *GrepToolOptions) agent.AgentTool + func NewLsTool(cwd string, options *LsToolOptions) agent.AgentTool + func NewReadOnlyTools(cwd string, options *ToolsOptions) []agent.AgentTool + func NewReadTool(cwd string, options *ReadToolOptions) agent.AgentTool + func NewWriteTool(cwd string, options *WriteToolOptions) agent.AgentTool + func NormalizeForFuzzyMatch(text string) string + func NormalizeToLF(text string) string + func PathExists(filePath string) bool + func ResolveReadPath(filePath, cwd string) (string, error) + func ResolveToCwd(filePath, cwd string) (string, error) + func RestoreLineEndings(text, ending string) string + func ShortenPath(path string) string + func StripBOM(content string) (bom, text string) + func TrackDetachedChildPID(pid int) — darwin/amd64, js/wasm, linux/amd64 + func UntrackDetachedChildPID(pid int) — darwin/amd64, js/wasm, linux/amd64 + func WithFileMutationQueue[T any](filePath string, fn func() (T, error)) (T, error) + type AppliedEditsResult struct + BaseContent string + NewContent string + func ApplyEditsToNormalizedContent(normalizedContent string, edits []Edit, path string) (AppliedEditsResult, error) + type BashExecOptions struct + Env map[string]string + OnData func([]byte) + Timeout *float64 + type BashExecResult struct + ExitCode *int + type BashOperations interface + Exec func(context.Context, string, string, BashExecOptions) (BashExecResult, error) + func NewLocalBashOperations(options ...LocalBashOperationsOptions) BashOperations + type BashResult struct + Cancelled bool + ExitCode *int + FullOutputPath string + Output string + Truncated bool + func ExecuteBash(ctx context.Context, command, cwd, prefix, shellPath string, ...) (BashResult, error) + type BashSessionEnvironment struct + Model string + Provider string + ReasoningLevel string + SessionFile string + SessionID string + type BashSessionEnvironmentBinder interface + BindSessionEnvironment func(BashSessionEnvironmentSource) + type BashSessionEnvironmentSource func() *BashSessionEnvironment + type BashSpawnContext struct + Command string + Cwd string + Env map[string]string + type BashSpawnHook func(BashSpawnContext) BashSpawnContext + type BashToolDetails struct + FullOutputPath string + Truncation *truncate.Result + type BashToolInput struct + Command string + Timeout *float64 + type BashToolOptions struct + CommandPrefix string + ExposeSessionEnvironment *bool + Operations BashOperations + ShellPath string + SpawnHook BashSpawnHook + type DiffResult struct + Diff string + FirstChangedLine *int + func ComputeEditsDiff(path string, edits []Edit, cwd string) (DiffResult, error) + func GenerateDiffString(oldContent, newContent string, contextLines int) DiffResult + type Edit struct + NewText string + OldText string + type EditOperations interface + Access func(context.Context, string) error + ReadFile func(context.Context, string) ([]byte, error) + WriteFile func(context.Context, string, string) error + type EditToolDetails struct + Diff string + FirstChangedLine *int + Patch string + type EditToolInput struct + Edits []Edit + Path string + type EditToolOptions struct + Operations EditOperations + type FindGlobOptions struct + Ignore []string + Limit float64 + type FindOperations interface + Exists func(context.Context, string) (bool, error) + Glob func(context.Context, string, string, FindGlobOptions) ([]string, error) + type FindToolDetails struct + ResultLimitReached *float64 + Truncation *truncate.Result + type FindToolInput struct + Limit *float64 + Path *string + Pattern string + type FindToolOptions struct + Operations FindOperations + type FuzzyMatchResult struct + ContentForReplacement string + Found bool + Index int + MatchLength int + UsedFuzzyMatch bool + func FuzzyFindText(content, oldText string) FuzzyMatchResult + type GrepOperations interface + IsDirectory func(context.Context, string) (bool, error) + ReadFile func(context.Context, string) (string, error) + type GrepToolDetails struct + LinesTruncated bool + MatchLimitReached *float64 + Truncation *truncate.Result + type GrepToolInput struct + Context *float64 + Glob *string + IgnoreCase *bool + Limit *float64 + Literal *bool + Path *string + Pattern string + type GrepToolOptions struct + Operations GrepOperations + type ImageResizeOptions struct + JPEGQuality int + MaxBytes int + MaxHeight int + MaxWidth int + type LocalBashOperationsOptions struct + ShellPath string + type LsOperations interface + Exists func(context.Context, string) (bool, error) + ReadDir func(context.Context, string) ([]string, error) + Stat func(context.Context, string) (LsPathStat, error) + type LsPathStat struct + Directory bool + func (stat LsPathStat) IsDirectory() bool + type LsToolDetails struct + EntryLimitReached *float64 + Truncation *truncate.Result + type LsToolInput struct + Limit *float64 + Path *string + type LsToolOptions struct + Operations LsOperations + type OutputAccumulator struct + func NewOutputAccumulator(options ...OutputAccumulatorOptions) *OutputAccumulator + func (output *OutputAccumulator) Append(data []byte) error + func (output *OutputAccumulator) CloseTempFile() error + func (output *OutputAccumulator) Finish() error + func (output *OutputAccumulator) LastLineBytes() int + func (output *OutputAccumulator) Snapshot(options ...OutputSnapshotOptions) (OutputSnapshot, error) + type OutputAccumulatorOptions struct + MaxBytes *int + MaxLines *int + TempFilePrefix *string + type OutputSnapshot struct + Content string + FullOutputPath string + Truncation truncate.Result + type OutputSnapshotOptions struct + PersistIfTruncated bool + type PlainTextRenderer interface + RenderCall func(args any) string + RenderResult func(result agent.AgentToolResult) string + type ProcessImageOptions struct + AutoResizeImages *bool + ResizeOptions *ImageResizeOptions + type ProcessImageResult struct + Data string + Hints []string + Message string + MimeType string + OK bool + func ProcessImage(input []byte, mimeType string, options *ProcessImageOptions) ProcessImageResult + type ReadImageOperations interface + DetectImageMimeType func(context.Context, string) (string, error) + type ReadOperations interface + Access func(context.Context, string) error + ReadFile func(context.Context, string) ([]byte, error) + type ReadToolDetails struct + Truncation *truncate.Result + type ReadToolInput struct + Limit *float64 + Offset *float64 + Path string + type ReadToolOptions struct + AutoResizeImages *bool + Operations ReadOperations + type ResizedImage struct + Data string + Height int + MimeType string + OriginalHeight int + OriginalWidth int + WasResized bool + Width int + func ResizeImage(input []byte, mimeType string, options *ImageResizeOptions) *ResizedImage + type ShellCommandTransport string — darwin/amd64, js/wasm, linux/amd64 + const ShellCommandArgv + const ShellCommandStdin + type ShellConfig struct — darwin/amd64, js/wasm, linux/amd64 + Args []string + CommandTransport ShellCommandTransport + Shell string + func GetShellConfig(customShellPath string) (ShellConfig, error) + type ToolsOptions struct + Bash *BashToolOptions + Edit *EditToolOptions + Find *FindToolOptions + Grep *GrepToolOptions + Ls *LsToolOptions + Read *ReadToolOptions + Write *WriteToolOptions + type WriteOperations interface + MkdirAll func(context.Context, string) error + WriteFile func(context.Context, string, string) error + type WriteToolInput struct + Content string + Path string + type WriteToolOptions struct + Operations WriteOperations