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 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
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.
Click to show internal directories.
Click to hide internal directories.