Documentation
¶
Overview ¶
Package agents implements declarative agent profiles. An agent is a reusable bundle of (system-prompt addition, tool restrictions, sampler overrides, max-turns) that can replace the default top-level configuration for a session.
Specs come from two places:
- Built-ins compiled into the binary (currently `default` and `plan`).
- Markdown files at `~/.enso/agents/<name>.md` (user) and `<cwd>/.enso/agents/<name>.md` (project). Project shadows user; user shadows built-in on name collision.
Switching at runtime is currently startup-only: pass `--agent <name>` on the CLI. The TUI's `/agents` slash lists what's available.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Applied ¶
type Applied struct {
Provider *llm.Provider
Registry *tools.Registry
PromptAppend string
MaxTurns int // 0 = leave caller default in place
}
Applied is the trio of runtime values a Spec produces: a possibly-cloned provider with sampler overrides, a possibly-filtered registry, and a few agent.Config-bound fields the caller threads in directly. Returning a struct (rather than mutating provider/registry in place) keeps the Apply call non-destructive — the caller's defaults survive untouched if no Spec is in play.
func Apply ¶
Apply layers the spec's overrides onto the given baseline. A nil spec is a no-op — caller gets back the same provider/registry it passed in. Sampler overrides clone the provider so two agents in the same process don't share mutated sampler state; the LLM Pool is shared because the endpoint is the same.
type Spec ¶
type Spec struct {
Name string
Description string
// PromptAppend is appended to the base system prompt with a separating
// blank line. It does not replace the base prompt — the agent still
// inherits the binary's default operating instructions.
PromptAppend string
// AllowedTools, if non-empty, restricts the registry to this set
// (intersected with the registry's contents).
AllowedTools []string
// DeniedTools, if non-empty, removes these tools from the registry.
// Applied after AllowedTools.
DeniedTools []string
// Sampler overrides. nil = unchanged.
Temperature *float64
TopP *float64
TopK *int
// MaxTurns overrides the default per-user-message turn cap. 0 = unchanged.
MaxTurns int
}
Spec is a declarative agent profile. Zero values mean "leave the host's default in place" — `nil` for sampler-override pointers, empty slices for tool lists.
func Builtins ¶
func Builtins() []*Spec
Builtins returns the agent specs compiled into the binary. They are shadowed by user and project agents on name collision so a project can retune the prompt or tool set without forking the source.