Documentation
¶
Overview ¶
Package builtins is part of the GoFastr harness.
See docs/harness-architecture.md for the architecture this package implements.
Package builtins implements the v0.1 default tool set: Read, Write, Edit, Bash, Grep, Glob, Ls, WebFetch. Each tool is small, focused, and declares is_mutating per the persistence layer's contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultBashBlocklist = []string{
"security",
"secret-tool",
"keyctl",
"kwalletcli",
"systemd-ask-password",
}
DefaultBashBlocklist names the commands the Bash tool refuses to run by default. The threat model rationale is in docs/harness-architecture.md § Threat model → Standing rules.
Functions ¶
func PackTools ¶
PackTools returns the tool names belonging to a built-in pack name. See § Profiles → tool_packs.
func ResetTasks ¶
ResetTasks clears a session's task list. Used by /clear-style commands or explicit test teardown.
Types ¶
type Bash ¶
type Bash = bashImpl
Bash is the public alias for the shell-execution tool implementation.
type Glob ¶
type Glob struct{}
Glob returns paths matching a glob pattern. Uses doublestar-compatible semantics: `**` matches any number of directories.
func (Glob) Description ¶
func (Glob) InputSchema ¶
type Grep ¶
type Grep struct{}
Grep finds lines matching a regex across files. Tiny ripgrep substitute — exact line matches per file.
func (Grep) Description ¶
func (Grep) InputSchema ¶
type Ls ¶
type Ls struct{}
Ls lists files in a directory.
func (Ls) Description ¶
func (Ls) InputSchema ¶
type Read ¶
type Read struct {
// MaxBytes caps a single Read response. 0 means use the default (1 MiB).
MaxBytes int64
}
Read is the file-read tool. Reads up to MaxBytes from a file (default 1 MiB) and returns the text. Optional Offset (byte) and Limit (lines) for partial reads.
func (Read) Description ¶
func (Read) InputSchema ¶
type Source ¶
type Source struct {
// EnabledPacks lets a profile constrain which packs of tools are
// exposed (e.g., a CI profile that doesn't want Bash). Empty
// means "all v0.1 built-ins."
EnabledPacks []string
}
Source is the ToolSource that exposes the built-in tool set.
type TaskItem ¶
type TaskItem struct {
Content string `json:"content"` // imperative form, "Read x.go"
Status string `json:"status"` // pending|in_progress|completed
ActiveForm string `json:"activeForm,omitempty"` // present-progressive, "Reading x.go"
}
TaskItem is one entry in the plan.
type TaskList ¶
type TaskList struct{}
TaskList is the tool the model calls to rewrite its plan. The active session is resolved from the dispatch ctx via tool.SessionFromContext, so a single registered instance serves all sessions without stale-binding bugs.
func (TaskList) Description ¶
func (TaskList) InputSchema ¶
type ToolSearch ¶
type ToolSearch struct{}
ToolSearch tool. Stateless — pulls the registry from the dispatch ctx via tool.RegistryFromContext.
func (ToolSearch) Description ¶
func (ToolSearch) Description() string
func (ToolSearch) InputSchema ¶
func (ToolSearch) InputSchema() []byte
func (ToolSearch) Mutating ¶
func (ToolSearch) Mutating() bool
func (ToolSearch) Name ¶
func (ToolSearch) Name() string