Documentation
¶
Overview ¶
Package preset composes agentcore's default agent out of the plugin packages.
This is the "build agentcore from its own plugins" step made literal: Plugins(cfg) returns the plugin list that reproduces agentcore.New(cfg), and preset_test.go proves the two agree field by field. If the plugin surface ever drifts from Config, that test fails.
Full(cfg, opts) is that same list plus the capabilities Config has no field for — spill, jobs, the repeat guard, session retrieval, telemetry supplied by the host — and is what a real deployment composes.
Use either as the starting point for a custom agent. Take the list, drop or replace the entries you want to change, append your own, and hand the result to agentcore.Build:
ps := preset.Full(cfg, preset.Options{Spill: myStore})
ps = append(ps, myCapability{})
agent, err := agentcore.Build(ps...)
Plugins configure the native engine through hooks and extensions.
Index ¶
- func Full(cfg agentcore.Config, o Options) []agentcore.Plugin
- func New(cfg agentcore.Config) (*agentcore.Agent, error)
- func Plugins(cfg agentcore.Config) []agentcore.Plugin
- func Replace(list []agentcore.Plugin, p agentcore.Plugin) []agentcore.Plugin
- func Without(list []agentcore.Plugin, names ...string) []agentcore.Plugin
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Full ¶
Full is the default agent plus the capabilities that agentcore.Config has no field for: retrieval over the run's own history, background work, oversized output, the repeat-loop nudge, and native lifecycle hooks.
The split from Plugins is the point. Plugins is pinned to agentcore.New(cfg) parity — every entry there answers to a Config field, and preset_test proves the two cannot drift. The five below answer to no Config field at all; they are plugins in the sense the architecture means, added to a list. Full is where a real deployment starts; Plugins is where the parity proof lives.
Everything here is still ejectable: preset.Without(preset.Full(cfg, o), "spill") is a complete agent minus spilling, with no trace of it left.
func New ¶
New builds an agent from the default plugin set. It is agentcore.New spelled through the plugin packages.
func Plugins ¶
Plugins returns the plugin set that reproduces agentcore.New(cfg).
Core seams are provided by agentcore.*Plugin adapters in seams.go; capabilities and extensions come from their respective plugin packages.
Types ¶
type Options ¶
type Options struct {
// Plan pins and checkpoints this run's checklist; forks get an isolated plan.
Plan *todo.Store
// Subagents enables governed delegation with these host-selected bounds.
Subagents *subagent.Plugin
// NativeAdvisor reviews finished work with cfg.NativeProvider and accounts usage.
NativeAdvisor bool
AdvisorOptions advisor.Plugin
// GoalLifecycle opts into durable lifecycle controls; optional budgets are absolute.
GoalLifecycle *goal.Plugin
// ConsolidateMemory enables native distillation when Memory supports ConsolidationStore.
ConsolidateMemory bool
// MemoryWorker moves consolidation off the primary run when supplied.
MemoryWorker *memory.ConsolidationWorker
// Interactive exposes ask; the host must publish questions and resume answers.
Interactive bool
// NativeHistory enables retrieval from opaque native checkpoints.
NativeHistory bool
// FinishGuard supplies the host's completion evidence rule, if any.
FinishGuard finishguard.Guard
// Spill persists an oversized tool result and hands the model a locator for
// the rest. nil leaves spilling OFF (the loop's head+tail truncation stands),
// which is the honest default: the locator is written to the durable session
// log, so a store that cannot outlive the process would mint locators that a
// resumed run reads back as not-found. Supply a durable store to turn it on.
Spill spill.SpillStore
// Jobs owns background work. nil uses a fresh in-process store per run —
// correct for a single server, since a job cannot outlive the run that
// started it anyway.
Jobs jobs.JobStore
// SessionQuery backs the session_query tool. nil searches the run's OWN
// durable log, which needs no external index.
SessionQuery sessionquery.SessionQuery
}
Options configures the capabilities Full adds on top of Plugins. Every field is optional and every zero value degrades to "that capability is not installed" rather than to a broken one — a partially wired composition must lose a feature, never gain a silently wrong one.