Documentation
¶
Overview ¶
Package tool holds the registry of actions the agent may take. Every tool declares a capability class so the policy layer can gate whole categories without knowing individual tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶ added in v0.2.5
Clamp bounds an oversized text result by keeping the head and the tail and eliding the middle on line boundaries. A long result front-loads its frame (the command, the first error) and back-loads its verdict (the assertion, the summary line), so a head-only cut throws away the verdict and a tail-only cut throws away the frame; keeping both ends preserves the signal at the same token budget. Three quarters of max goes to the head, the rest to the tail, and both cut points back off to line boundaries so the elision never splits a line. The note in the middle names how many bytes were dropped; advice, when non-empty, is appended to the note to tell the model how to see the elided part (it should start with "; ").
Types ¶
type Class ¶
type Class string
Class is what a tool is allowed to touch, from the policy engine's point of view. One class per tool, the strongest thing it does.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is an ordered set of tools. The zero value and the nil pointer are both empty, usable registries.
func NewRegistry ¶
NewRegistry builds a registry from tools, keeping order.