tool

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package tool implements the 4 built-in tools for piglet: read, write, edit, bash. grep, find, and ls have moved to extensions/filetools and are bundled in pack-code. All tools register through the ext API, same as external extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSize added in v0.5.0

func FormatSize(bytes int64) string

func RegisterBuiltins

func RegisterBuiltins(app *ext.App, bash BashConfig, tools ToolConfig)

RegisterBuiltins registers the 4 built-in tools via the extension API.

func UndoSnapshots added in v0.5.0

func UndoSnapshots() (map[string][]byte, error)

UndoSnapshots returns all undo snapshots as path→content pairs.

Types

type BashConfig added in v0.4.0

type BashConfig struct {
	DefaultTimeout int // seconds, default 30
	MaxTimeout     int // seconds, default 300
	MaxStdout      int // bytes, default 100000
	MaxStderr      int // bytes, default 50000
}

BashConfig holds configurable limits for the bash tool. Zero values use defaults.

type ToolConfig added in v0.5.0

type ToolConfig struct {
	ReadLimit int // max lines per read; 0 = default (2000)
}

ToolConfig holds configurable defaults for built-in tools.

Jump to

Keyboard shortcuts

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