Documentation
¶
Overview ¶
Package plugins defines the shared plugin-facing contracts for Anna's unified plugin host.
Index ¶
- Constants
- func Names() []string
- func NewBotManagedRuntime[T any](deps BotRuntimeDeps[T]) *botManagedRuntime[T]
- func Register(id string, plugin Plugin)
- func RegisterManagedChannelPlugin(host Host, reg ManagedChannelPluginRegistration)
- type AdminContext
- type AdminSpec
- type AfterToolResult
- type AfterToolResultContext
- type AfterToolResultSpec
- type Auth
- type BeforeRunContext
- type BeforeRunResult
- type BeforeRunSpec
- type BeforeToolCallContext
- type BeforeToolCallResult
- type BeforeToolCallSpec
- type BinaryAsset
- type BinarySpec
- type BotRuntimeDeps
- type Catalog
- type ChannelContext
- type ChannelPlatform
- type ChannelRegistry
- type ChannelSpec
- type ConfigStore
- type HookContext
- type HookSpec
- type Host
- type LinkedIdentity
- type ManagedChannelPluginRegistration
- type MemoryContext
- type MemorySpec
- type Notifier
- type Platform
- type Plugin
- type PluginFunc
- type PluginInfo
- type PluginState
- type PromptInventoryContext
- type PromptInventorySpec
- type PromptToolInfo
- type ProviderContext
- type ProviderMeta
- type ProviderSpec
- type ReflectAgent
- type ReflectPlatform
- type ReflectProviderCreds
- type ReflectSnapshot
- type ReflectStore
- type RegisteredPlugin
- type Runtime
- type RuntimeContext
- type RuntimeHandle
- type RuntimeLookup
- type RuntimeSpec
- type RuntimeState
- type RuntimeStatus
- type ScheduledJobRunner
- type Scheduler
- type SchedulerJob
- type SchedulerJobSpec
- type SchedulerSchedule
- type Skill
- type SkillStore
- type SkillUpdatePatch
- type SkillViewContext
- type StateScope
- type StateStore
- type SystemPromptContext
- type SystemPromptSection
- type SystemPromptSpec
- type ToolContext
- type ToolPaths
- type ToolSpec
- type UserInfo
Constants ¶
const ( CapabilityChannel = "channel" CapabilityRuntime = "runtime" CapabilityLifecycle = "lifecycle" CapabilityConfig = "config" CapabilityStatus = "status" CapabilityTool = "tool" CapabilityPrompt = "prompt" CapabilityProvider = "provider" CapabilityHook = "hook" CapabilityMemory = "memory" CapabilityBinary = "binary" )
const ( ReflectModelTierStrong = "strong" ReflectModelTierFast = "fast" )
const ( StateScopeGlobal = "global" StateScopeUser = "user" StateScopeAgent = "agent" StateScopeSession = "session" )
const SkillMainFile = "SKILL.md"
Variables ¶
This section is empty.
Functions ¶
func Names ¶
func Names() []string
Names returns all plugin IDs from the process-wide default catalog in sorted order.
func NewBotManagedRuntime ¶
func NewBotManagedRuntime[T any](deps BotRuntimeDeps[T]) *botManagedRuntime[T]
func RegisterManagedChannelPlugin ¶
func RegisterManagedChannelPlugin(host Host, reg ManagedChannelPluginRegistration)
Types ¶
type AdminContext ¶
type AdminContext struct {
Platform Platform
State PluginState
}
AdminContext is the narrow build context for plugin admin/status behavior.
type AdminSpec ¶
type AdminSpec struct {
PluginID string
DefaultConfig func() map[string]any
Schema map[string]any
Validate func(raw map[string]any) error
Redact func(raw map[string]any) map[string]any
Status func(ctx context.Context, build AdminContext) (any, error)
}
AdminSpec declares plugin-owned admin behavior: config defaults, schema, validation, redaction, and status.
func (AdminSpec) Redacted ¶
Redacted returns a redacted copy of raw config, or a cloned copy when no redactor is set.
func (AdminSpec) SchemaDefinition ¶
SchemaDefinition returns a defensive deep copy of the registered config schema.
type AfterToolResult ¶
type AfterToolResult struct {
Result *string `json:"result,omitempty"`
IsError *bool `json:"is_error,omitempty"`
}
AfterToolResult is the mutable post-execution output from tool lifecycle plugins.
type AfterToolResultContext ¶
type AfterToolResultContext struct {
Platform Platform
State PluginState
SessionID string
Channel string
UserID int64
AgentID string
ToolName string
ToolCallID string
Arguments map[string]any
Result string
IsError bool
Duration time.Duration
}
AfterToolResultContext is the narrow post-tool lifecycle context exposed to plugins.
type AfterToolResultSpec ¶
type AfterToolResultSpec struct {
PluginID string
Name string
Order int
Required bool
Run func(ctx context.Context, build AfterToolResultContext) (AfterToolResult, error)
}
AfterToolResultSpec declares a post-tool lifecycle hook owned by a plugin.
type Auth ¶
type Auth interface {
GetUser(ctx context.Context, userID int64) (UserInfo, error)
ListUserIdentities(ctx context.Context, userID int64) ([]LinkedIdentity, error)
GetIdentityByPlatform(ctx context.Context, platform, externalID string) (LinkedIdentity, error)
}
Auth exposes narrow user and identity lookups without leaking auth internals.
type BeforeRunContext ¶
type BeforeRunContext struct {
Platform Platform
State PluginState
SessionID string
Channel string
UserID int64
AgentID string
Model string
MessageText string
SystemPrompt string
History []ai.Message
}
BeforeRunContext is the narrow per-run lifecycle context exposed to plugins.
type BeforeRunResult ¶
type BeforeRunResult struct {
SystemPrompt string `json:"system_prompt,omitempty"`
}
BeforeRunResult is the mutable per-run output from lifecycle plugins.
type BeforeRunSpec ¶
type BeforeRunSpec struct {
PluginID string
Name string
Order int
Required bool
Run func(ctx context.Context, build BeforeRunContext) (BeforeRunResult, error)
}
BeforeRunSpec declares a dynamic per-run lifecycle hook owned by a plugin.
type BeforeToolCallContext ¶
type BeforeToolCallContext struct {
Platform Platform
State PluginState
SessionID string
Channel string
UserID int64
AgentID string
ToolName string
ToolCallID string
Arguments map[string]any
}
BeforeToolCallContext is the narrow per-tool-call lifecycle context exposed to plugins.
type BeforeToolCallResult ¶
type BeforeToolCallResult struct {
Arguments map[string]any `json:"arguments,omitempty"`
Block bool `json:"block,omitempty"`
BlockMessage string `json:"block_message,omitempty"`
}
BeforeToolCallResult is the mutable pre-execution output from tool lifecycle plugins.
type BeforeToolCallSpec ¶
type BeforeToolCallSpec struct {
PluginID string
Name string
Order int
Required bool
Run func(ctx context.Context, build BeforeToolCallContext) (BeforeToolCallResult, error)
}
BeforeToolCallSpec declares a pre-tool lifecycle hook owned by a plugin.
type BinaryAsset ¶ added in v0.13.0
type BinaryAsset struct {
File string // may contain {version} and {tag} placeholders
RawBinary bool // true if the asset IS the binary (no archive to extract)
}
BinaryAsset describes a GitHub release asset for one platform.
type BinarySpec ¶ added in v0.13.0
type BinarySpec struct {
PluginID string
Name string // binary name on disk, e.g. "tap"
Repo string // "owner/repo" on GitHub
Version string // pinned version string, or "" for latest
AssetTemplates map[string]BinaryAsset // platform key e.g. "darwin-arm64"
PostInstall func(ctx context.Context, binPath, annaHome string, logger *slog.Logger)
}
BinarySpec declares a downloadable binary a plugin requires. A plugin may register multiple BinarySpecs, one per distinct binary.
type BotRuntimeDeps ¶
type BotRuntimeDeps[T any] struct { Parent context.Context Handler pkgchannel.Handler Notifier ChannelRegistry Log *slog.Logger Now func() time.Time Platform string DecodeConfig func(map[string]any) (T, error) ConfigureConfig func(T, PluginState) T ValidateConfig func(T) string NotificationsEnabled func(T) bool NewChannel func(T, pkgchannel.Handler) (pkgchannel.Channel, error) Snapshot func(time.Time, RuntimeState, string, T) RuntimeStatus }
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog stores plugins by plugin ID.
type ChannelContext ¶
type ChannelContext struct {
Platform Platform
State PluginState
Handler channel.Handler
}
ChannelContext is the narrow build context for channel capabilities.
type ChannelPlatform ¶
type ChannelPlatform interface {
ParentContext() context.Context
Handler() pkgchannel.Handler
Notifications() ChannelRegistry
}
ChannelPlatform exposes the narrow platform services needed by managed channel runtimes.
type ChannelRegistry ¶
type ChannelRegistry interface {
Register(pkgchannel.Channel)
Unregister(name string)
}
ChannelRegistry exposes channel registration needed by managed channel runtimes.
type ChannelSpec ¶
type ChannelSpec struct {
PluginID string
Name string
SupportsNotifications bool
Configured func(raw map[string]any) bool
NotificationsEnabled func(raw map[string]any) bool
Build func(ctx ChannelContext) (channel.Channel, error)
}
ChannelSpec declares a channel capability owned by a plugin.
type ConfigStore ¶
type ConfigStore interface {
Get(ctx context.Context) (PluginState, error)
Set(ctx context.Context, config map[string]any) error
}
ConfigStore exposes plugin-owned config persistence through a narrow interface.
type HookContext ¶
type HookContext struct {
Platform Platform
State PluginState
ToolsBinDir string
}
HookContext is the narrow build context for hook capabilities.
type HookSpec ¶
type HookSpec struct {
PluginID string
Name string
Build func(ctx HookContext) (hooks.HookPlugin, error)
}
HookSpec declares a hook capability owned by a plugin.
type Host ¶
type Host interface {
SetInfo(PluginInfo)
AddAdmin(AdminSpec)
AddTool(ToolSpec)
AddProvider(ProviderSpec)
AddChannel(ChannelSpec)
AddHook(HookSpec)
AddMemory(MemorySpec)
AddRuntime(RuntimeSpec)
AddPromptInventory(PromptInventorySpec)
AddSystemPrompt(SystemPromptSpec)
AddBeforeRun(BeforeRunSpec)
AddBeforeToolCall(BeforeToolCallSpec)
AddAfterToolResult(AfterToolResultSpec)
AddBinary(BinarySpec)
}
Host is the flat registration surface exposed to plugins. Platform services are provided only through capability-specific contexts.
type LinkedIdentity ¶
type LinkedIdentity struct {
ID int64
UserID int64
Platform string
ExternalID string
Name string
LinkedAt time.Time
}
LinkedIdentity is the host-owned linked identity record exposed to plugins.
type ManagedChannelPluginRegistration ¶
type ManagedChannelPluginRegistration struct {
PluginID string
RuntimeName string
Meta PluginInfo
Info PluginInfo
DefaultConfig func() map[string]any
Schema map[string]any
Validate func(raw map[string]any) error
Redact func(raw map[string]any) map[string]any
Configured func(raw map[string]any) bool
NotificationsEnabled func(raw map[string]any) bool
RuntimeFactory func(Platform) (Runtime, error)
}
type MemoryContext ¶
type MemoryContext struct {
Platform Platform
State PluginState
DB *sql.DB
AnnaHome string
SummarizerFn func(context.Context, string) (string, error)
}
MemoryContext is the narrow build context for memory capabilities. DB is a construction-time exception for memory providers, not a general plugin service surface.
type MemorySpec ¶
type MemorySpec struct {
PluginID string
Name string
Build func(ctx context.Context, build MemoryContext) (memory.Provider, error)
}
MemorySpec declares a memory capability owned by a plugin.
type Notifier ¶
type Notifier interface {
Notify(ctx context.Context, n pkgchannel.Notification) error
NotifyUser(ctx context.Context, userID int64, n pkgchannel.Notification) error
}
Notifier exposes user-visible notification delivery through the host.
type Platform ¶
type Platform interface {
Logger() *slog.Logger
ConfigStore() ConfigStore
StateStore() StateStore
Scheduler() Scheduler
Notifier() Notifier
Auth() Auth
RuntimeLookup() RuntimeLookup
ChannelPlatform() ChannelPlatform
ReflectPlatform() ReflectPlatform
SkillStore() SkillStore
}
Platform is the plugin-scoped service surface available during build/runtime work.
type Plugin ¶
type Plugin interface {
Register(host Host)
}
Plugin is the ownership unit in the unified plugin host. A plugin may register multiple capabilities against the provided host.
type PluginFunc ¶
type PluginFunc func(host Host)
PluginFunc adapts a function to the Plugin interface.
type PluginInfo ¶
type PluginInfo struct {
ID string `json:"id"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description,omitempty"`
Managed bool `json:"managed,omitempty"`
AdminVisible bool `json:"admin_visible,omitempty"`
HasConfig bool `json:"has_config,omitempty"`
HasStatus bool `json:"has_status,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
SupportsNotifications bool `json:"supports_notifications,omitempty"`
}
PluginInfo is the host discovery metadata registered by a plugin. Capability traits are derived from actual registrations rather than declared here.
type PluginState ¶
type PluginState struct {
ID string `json:"id"`
Enabled bool `json:"enabled"`
Config map[string]any `json:"config,omitempty"`
}
PluginState is the canonical plugin-level desired state.
func (PluginState) Clone ¶
func (s PluginState) Clone() PluginState
Clone returns a shallow copy with an independent config map.
type PromptInventoryContext ¶
type PromptInventoryContext struct {
Platform Platform
State PluginState
}
PromptInventoryContext is the narrow build context for prompt inventory contributions.
type PromptInventorySpec ¶
type PromptInventorySpec struct {
PluginID string
Name string
GetTools func(ctx context.Context, build PromptInventoryContext) ([]PromptToolInfo, error)
}
PromptInventorySpec declares structured tool inventory contribution.
type PromptToolInfo ¶
type PromptToolInfo struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
PromptToolInfo is a structured tool inventory item contributed to prompt building.
func (PromptToolInfo) Clone ¶
func (i PromptToolInfo) Clone() PromptToolInfo
Clone returns a shallow copy with independent metadata.
type ProviderContext ¶
type ProviderContext struct {
Platform Platform
State PluginState
}
ProviderContext is the narrow build context for provider capabilities.
type ProviderMeta ¶
ProviderMeta contains provider display metadata.
type ProviderSpec ¶
type ProviderSpec struct {
PluginID string
Name string
Meta ProviderMeta
Build func(ctx ProviderContext) (providers.ProviderAdapter, error)
}
ProviderSpec declares a provider capability owned by a plugin.
type ReflectAgent ¶
type ReflectAgent struct {
ID string
}
type ReflectPlatform ¶
type ReflectProviderCreds ¶
type ReflectSnapshot ¶
type ReflectSnapshot struct {
AgentID string
Provider string
Model string
ModelStrong string
ModelFast string
Workspace string
APIKey string
BaseURL string
SystemPrompt string
Providers map[string]ReflectProviderCreds
}
func (*ReflectSnapshot) ResolveModelID ¶
func (s *ReflectSnapshot) ResolveModelID(tier string) string
func (*ReflectSnapshot) ResolveModelTier ¶
func (s *ReflectSnapshot) ResolveModelTier(tier string) ai.Model
func (*ReflectSnapshot) ResolveProviderCreds ¶
func (s *ReflectSnapshot) ResolveProviderCreds(providerID string) ReflectProviderCreds
type ReflectStore ¶
type ReflectStore interface {
ListEnabledAgents(ctx context.Context) ([]ReflectAgent, error)
Snapshot(ctx context.Context, agentID string) (*ReflectSnapshot, error)
}
type RegisteredPlugin ¶
type RegisteredPlugin struct {
Info PluginInfo
Kind string
Name string
SupportsNotifications bool
HasConfig bool
HasStatus bool
Capabilities []string
State PluginState
Persisted bool
PersistedID string
}
RegisteredPlugin is the merged discovery view of registered metadata and persisted state.
func (RegisteredPlugin) Clone ¶
func (p RegisteredPlugin) Clone() RegisteredPlugin
Clone returns a shallow copy with independent nested maps/slices.
func (RegisteredPlugin) SortedCapabilities ¶
func (p RegisteredPlugin) SortedCapabilities() []string
SortedCapabilities returns a normalized, sorted copy of the capability list.
type Runtime ¶
type Runtime interface {
Apply(ctx context.Context, desired PluginState) error
Start(ctx context.Context, desired PluginState) error
Reconcile(ctx context.Context, desired PluginState) error
Stop(ctx context.Context) error
Snapshot(ctx context.Context) (RuntimeStatus, error)
Status(ctx context.Context) (RuntimeStatus, error)
}
Runtime is implemented by plugin-owned long-lived runtime services.
type RuntimeContext ¶
type RuntimeContext struct {
Platform Platform
State PluginState
}
RuntimeContext is the narrow construction context for runtime capabilities.
type RuntimeHandle ¶
type RuntimeHandle interface {
Snapshot(ctx context.Context) (RuntimeStatus, error)
Status(ctx context.Context) (RuntimeStatus, error)
}
RuntimeHandle exposes status access to a running runtime.
type RuntimeLookup ¶
type RuntimeLookup interface {
Get(pluginID string, runtimeName string) (RuntimeHandle, bool)
Lookup(pluginID string, runtimeName string) (RuntimeHandle, bool)
}
RuntimeLookup resolves running runtime handles by plugin and runtime capability ID.
type RuntimeSpec ¶
type RuntimeSpec struct {
PluginID string
Name string
Build func(ctx RuntimeContext) (Runtime, error)
}
RuntimeSpec declares a managed runtime capability owned by a plugin.
type RuntimeState ¶
type RuntimeState string
RuntimeState is the shared high-level runtime state used by host orchestration.
const ( RuntimeStateUnknown RuntimeState = "unknown" RuntimeStateStopped RuntimeState = "stopped" RuntimeStateRunning RuntimeState = "running" RuntimeStateError RuntimeState = "error" )
type RuntimeStatus ¶
type RuntimeStatus struct {
State RuntimeState `json:"state"`
Message string `json:"message,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
Metadata map[string]any `json:"metadata,omitempty"`
}
RuntimeStatus is the minimal shared runtime status envelope.
func (RuntimeStatus) Clone ¶
func (s RuntimeStatus) Clone() RuntimeStatus
Clone returns a shallow copy with independent metadata.
type ScheduledJobRunner ¶
type ScheduledJobRunner interface {
RunScheduledJob(ctx context.Context, key string, payload map[string]any) error
}
ScheduledJobRunner is implemented by runtimes that can handle plugin-owned scheduled jobs.
type Scheduler ¶
type Scheduler interface {
ReconcileJobs(ctx context.Context, jobs []SchedulerJobSpec) error
DeleteJobs(ctx context.Context) error
DeleteJob(ctx context.Context, key string) error
ListJobs(ctx context.Context) ([]SchedulerJob, error)
}
Scheduler exposes plugin-owned scheduled job reconciliation through the host.
type SchedulerJob ¶
type SchedulerJob struct {
ID string `json:"id"`
PluginID string `json:"plugin_id"`
Key string `json:"key"`
RuntimeName string `json:"runtime_name"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Schedule SchedulerSchedule `json:"schedule"`
Payload map[string]any `json:"payload,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastError string `json:"last_error,omitempty"`
}
SchedulerJob is the host view of one reconciled plugin-owned scheduled job.
type SchedulerJobSpec ¶
type SchedulerJobSpec struct {
Key string `json:"key"`
RuntimeName string `json:"runtime_name"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Schedule SchedulerSchedule `json:"schedule"`
Payload map[string]any `json:"payload,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
SchedulerJobSpec is the desired state for one plugin-owned scheduled job.
type SchedulerSchedule ¶
type SchedulerSchedule struct {
Cron string `json:"cron,omitempty"`
Every string `json:"every,omitempty"`
At string `json:"at,omitempty"`
}
SchedulerSchedule identifies when a plugin-owned job should run.
type Skill ¶ added in v0.13.0
type Skill struct {
ID string
Scope string // system | agent | user | project (project is filesystem-only)
UserID int64
AgentID string
Name string
Description string
Status string // draft | active | deprecated
DisableModelInvocation bool
Metadata json.RawMessage
CreatedAt time.Time
UpdatedAt time.Time
}
Skill represents a skill row (metadata only, no file content).
type SkillStore ¶ added in v0.13.0
type SkillStore interface {
// List returns all visible skills for the given context (metadata only, no file content).
List(ctx context.Context, vc SkillViewContext) ([]Skill, error)
// Resolve finds the highest-priority visible skill by name.
// Priority: user > agent > system (project skills are resolved via filesystem).
Resolve(ctx context.Context, name string, vc SkillViewContext) (*Skill, error)
// LoadFile fetches a single file by path. Pass SkillMainFile ("SKILL.md") for the body.
LoadFile(ctx context.Context, skillID, path string) (string, error)
// Create inserts the skill row and all its files (must include "SKILL.md").
Create(ctx context.Context, s Skill, files map[string]string) (string, error)
// Update patches metadata fields. Use UpsertFile to change file content.
Update(ctx context.Context, id string, patch SkillUpdatePatch) error
// UpsertFile creates or replaces a single file under a skill.
UpsertFile(ctx context.Context, skillID, path, content string) error
DeleteFile(ctx context.Context, skillID, path string) error
Delete(ctx context.Context, id string) error
// ExpireDrafts deprecates all draft skills whose created-at timestamp is
// before the given cutoff.
ExpireDrafts(ctx context.Context, before time.Time) error
}
SkillStore is the persistence interface for skills, available to plugins via Platform. It mirrors internal/skills.Store method-for-method; internal/skills re-exports these types as aliases so both sides remain in sync.
type SkillUpdatePatch ¶ added in v0.13.0
type SkillUpdatePatch struct {
Description *string
Status *string
DisableModelInvocation *bool
Metadata json.RawMessage // optional; set to overwrite
}
SkillUpdatePatch carries optional updates for a skill's metadata fields.
type SkillViewContext ¶ added in v0.13.0
SkillViewContext describes who is asking and from where. Empty fields mean no such context (e.g. UserID=0 → only system skills visible).
type StateScope ¶
StateScope identifies the owner of a stored plugin state entry.
func (StateScope) Normalize ¶
func (s StateScope) Normalize() StateScope
Normalize returns the canonical scope shape used by the host store.
type StateStore ¶
type StateStore interface {
Get(ctx context.Context, scope StateScope, key string) (map[string]any, bool, error)
Set(ctx context.Context, scope StateScope, key string, value map[string]any) error
Delete(ctx context.Context, scope StateScope, key string) error
}
StateStore exposes host-owned plugin persistence without leaking DB packages.
type SystemPromptContext ¶
type SystemPromptContext struct {
Platform Platform
State PluginState
AnnaHome string
HomeDir string
AgentRoot string
ProjectRoot string
UserID int64
AgentID string
UserRoot string
// EnabledBuiltinSkills is the per-agent allowlist of builtin (system-scope)
// skills that should appear in the prompt catalog. The always-on "anna"
// skill is visible to every agent regardless of this list.
EnabledBuiltinSkills []string
}
SystemPromptContext is the shared build context for prompt contributions. HomeDir is host-scoped discovery context; UserRoot is the runtime writable root.
type SystemPromptSection ¶
SystemPromptSection is a structured prompt contribution from a plugin.
type SystemPromptSpec ¶
type SystemPromptSpec struct {
PluginID string
Name string
Required bool
Build func(ctx context.Context, build SystemPromptContext) (SystemPromptSection, error)
}
SystemPromptSpec declares prompt contribution owned by a plugin.
type ToolContext ¶
ToolContext is the narrow build context for tool capabilities.
type ToolPaths ¶ added in v0.10.1
type ToolPaths struct {
UserRoot string
ToolsBinDir string
AnnaHome string
AgentRoot string
ProjectRoot string // tool-facing project root for relative path resolution
}
ToolPaths is the tool-facing session path surface. UserRoot is the writable execution root and process HOME. ProjectRoot is the tool-facing current-project directory; relative paths in project-aware tools resolve against it. AnnaHome and AgentRoot are discovery roots.