config

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SystemPromptModeDefault (or "" / unset) means the teammate inherits
	// the host's universal base block and teammate addendum;
	// cfg.SystemPrompt is wrapped as "# Custom Agent Instructions" inside
	// the role block. Recommended path for new role-specific agents.
	SystemPromptModeDefault = "default"

	// SystemPromptModeReplace skips both the universal base and the
	// teammate addendum; cfg.SystemPrompt becomes the only SystemBlock.
	// Use when the agent definition is already a complete self-contained
	// prompt.
	SystemPromptModeReplace = "replace"

	// SystemPromptModeAppend builds the default composition and then
	// appends cfg.SystemPrompt at the end of the role block — rare, only
	// when an agent needs to add tail content on top of the default.
	SystemPromptModeAppend = "append"
)

SystemPromptMode* are the host-recognized values for agentcore/subagent.Config.SystemPromptMode. The enum stays as untyped string constants because agentcore stores it as a string hint and codebot is the only consumer that interprets it.

View Source
const ConfigDir = ".codebot"

ConfigDir is the project-level config directory name.

View Source
const MemoryMaxLines = 200

MemoryMaxLines is where LoadMemory truncates MEMORY.md. Exported so the prompts that tell the model about the limit cannot drift from it.

View Source
const SuggestionPrompt = `` /* 1132-byte string literal not displayed */

SuggestionPrompt is the instruction appended as a user message to generate a prompt suggestion after the agent completes a turn.

Variables

View Source
var SessionDate = sync.OnceValue(func() string { return time.Now().Format("2006-01-02") })

BuildUniversalBase returns the agent-agnostic head of the system prompt: neutral identity preamble, environment metadata, and the five shared conventions (parallel exec / doing tasks / using your tools / system conventions / output efficiency). Tool inventory is deliberately NOT here — leader and teammate have different tool sets, so listing tools in the shared prefix would break the byte-equality precondition for cross-agent prompt cache reuse.

Inputs MUST be process-stable: cwd does not change inside a session, OS metadata is fixed at compile time. MCP tools and runtime overlays go in BuildDynamicSystemPart, never here.

This is the first SystemBlock of both leader and teammate AgentContexts, both with cache_control="ephemeral". When the leader has run a few turns, Anthropic's server-side cache holds these bytes; a fresh teammate's first request hits the same key and reads from cache instead of paying full input-token cost. SessionDate is the calendar date baked into system block 1, frozen at first use. Freezing is what keeps BuildUniversalBase a pure function of its inputs: the leader renders block 1 at boot and a worktree teammate re-renders it at spawn (see team.teammateBaseBlocks), and the two must produce identical bytes or they cannot share the cached prefix. A live time.Now() here would silently split that cache for every teammate spawned after midnight.

The cost is a stale date in a process that outlives a day; the agent corrects it with a one-shot reminder instead (see agent.queueDateChangeReminder).

Functions

func ApprovalsPath added in v0.0.4

func ApprovalsPath(cwd string) string

ApprovalsPath returns ~/.codebot/approvals/<projectID>.json.

func AuditLogPath added in v0.0.2

func AuditLogPath() string

AuditLogPath returns ~/.codebot/audit.log.

func BuildAutoMemoryInstructions added in v0.0.4

func BuildAutoMemoryInstructions(memoryDir string) string

BuildAutoMemoryInstructions returns the system prompt instructions that teach the LLM how to use auto memory. Returns empty string when memoryDir is empty (e.g. no user config dir).

func BuildDynamicSystemPart added in v0.1.3

func BuildDynamicSystemPart(mcpTools []ToolInfo, overlays []string) string

BuildDynamicSystemPart assembles the runtime-mutable portion of the system prompt: late-arriving tool descriptions (MCP) and named overlays (plan_mode, mcp instructions, etc.).

Returns "" when neither input contributes content; callers should then omit the third system block entirely.

overlays must be passed in a deterministic order — the same content in a different order changes the hash and uselessly breaks any cache placed on this segment by the caller.

func BuildFrozenSystemParts added in v0.1.3

func BuildFrozenSystemParts(cwd string, ctx ContextFiles, localTools []ToolInfo, skills []skill.Spec) (identity, frozenInstructions string)

BuildFrozenSystemParts returns the two cached system blocks: block 1 is the agent-agnostic identity, block 2 the leader role block. Both stay fixed for the session unless the workspace root moves or a reload swaps context files in; MCP tools, plan_mode overlays, and anything else runtime-mutable belong in BuildDynamicSystemPart, which is deliberately outside the cache prefix.

The teammate path composes block 1 from the same builder, so the leader and its teammates share a byte-identical cache prefix.

func BuildIdentity added in v0.3.0

func BuildIdentity(cwd string, ctx ContextFiles) string

BuildIdentity returns system block 1 on its own, for callers that must recompute it without block 2 — a worktree enter/exit moves the working directory this block states. A SystemOverride replaces the whole prompt, so there is no identity block to build.

func BuildLeaderInstructions added in v0.3.0

func BuildLeaderInstructions(ctx ContextFiles, localTools []ToolInfo, skills []skill.Spec) string

BuildLeaderInstructions returns system block 2 on its own: the SYSTEM.md override verbatim when present, otherwise the composed leader role block. Sessions call this to rebuild block 2 after a reload without touching block 1.

func BuildLeaderRoleBlock added in v0.2.0

func BuildLeaderRoleBlock(ctx ContextFiles, localTools []ToolInfo, skills []skill.Spec) string

BuildLeaderRoleBlock returns the leader-specific portion of the system prompt: leader identity, the leader's own tool inventory, the optional Task Management section (gated on task_* tools being present), the optional Team coordination section (gated on team_*+send_message+subagent), the optional auto-memory hints, and the project-scoped context (skill listing, AGENTS.md, MEMORY.md, APPEND_SYSTEM.md).

That last group used to ride along with every user message as <system-reminder> fragments, which put one copy per turn into history. It lives here instead because none of it changes mid-session — only an explicit Session.Reload (/memory edit, plugin reload) can move it, and that is rare enough to be worth one cache write. See tasks/todo.md for the admission rule.

localTools should be the leader's session-stable tool set (caller already filtered out MCP via SplitToolsByOrigin). The list is rendered verbatim so pass it in the order callers want the model to see. skills should already be ranked by skill.OrderForPrompt; RenderListing re-sorts them into a time-independent order so this block stays byte-stable.

Goes in the second SystemBlock with cache_control="ephemeral".

func BuildTeammateRoleBlock added in v0.2.0

func BuildTeammateRoleBlock(localTools []ToolInfo, agentRolePrompt string) string

BuildTeammateRoleBlock returns the teammate-specific portion of the system prompt: identity preamble, tool inventory, mailbox/coordination addendum, and (when set) the agent definition's custom prompt under "# Custom Agent Instructions". localTools is the effective tool set (Config.Tools + injected coordination tools); empty/nil omits the tool list. Lives in the second SystemBlock with cache_control="ephemeral".

func BuildUniversalBase added in v0.2.0

func BuildUniversalBase(cwd string) string

func CollectGitSnapshot added in v0.0.4

func CollectGitSnapshot(cwd string) string

CollectGitSnapshot runs git commands in cwd and returns a formatted snapshot suitable for LLM system prompt injection. Returns empty string when cwd is not a git repository.

func CommandsDir added in v0.0.2

func CommandsDir(cwd string) string

CommandsDir returns <cwd>/.codebot/commands/.

func EnsureMemoryDir added in v0.0.4

func EnsureMemoryDir(cwd string)

EnsureMemoryDir creates the memory directory if it doesn't exist.

func ExpandHome added in v0.0.4

func ExpandHome(path string) string

func ExploreSubAgentPrompt

func ExploreSubAgentPrompt(cwd string) string

ExploreSubAgentPrompt returns the system prompt for the explore sub-agent.

func FormatMemoryRecallReminder added in v0.3.0

func FormatMemoryRecallReminder(r MemoryRecall) string

FormatMemoryRecallReminder wraps a recalled memory in a system-reminder with its age; memories older than a day carry a staleness caveat.

func FormatModelID

func FormatModelID(provider, model string) string

FormatModelID combines provider and model into "provider/model". If model already contains "/", it is returned as-is.

func GeneralPurposeSubAgentPrompt added in v0.2.0

func GeneralPurposeSubAgentPrompt(cwd string) string

GeneralPurposeSubAgentPrompt returns the system prompt for the general-purpose sub-agent.

func GlobalConfigExists added in v0.1.0

func GlobalConfigExists() bool

GlobalConfigExists reports whether ~/.codebot/settings.json exists.

func GlobalSettingsPath added in v0.1.0

func GlobalSettingsPath() string

GlobalSettingsPath returns ~/.codebot/settings.json.

func IsGitRepo added in v0.2.0

func IsGitRepo(cwd string) bool

IsGitRepo reports whether cwd is inside a git working tree.

func IsKnownSystemPromptMode added in v0.2.0

func IsKnownSystemPromptMode(s string) bool

IsKnownSystemPromptMode reports whether s is one of the modes this package understands. Empty string is treated as known (it falls back to Default).

func IsMCPTool added in v0.1.3

func IsMCPTool(name string) bool

IsMCPTool reports whether a tool name belongs to an MCP server.

func LoadMemory added in v0.0.4

func LoadMemory(cwd string) (content, dir string)

LoadMemory reads MEMORY.md (first 200 lines) and returns the content along with the memory directory path. Returns empty strings when no memory file exists.

func MemoryDir added in v0.0.4

func MemoryDir(cwd string) string

MemoryDir returns ~/.codebot/projects/<projectID>/memory/.

func MemoryFilePath added in v0.0.4

func MemoryFilePath(cwd string) string

MemoryFilePath returns the path to MEMORY.md.

func NeedsSetup added in v0.3.0

func NeedsSetup(cwd string) bool

NeedsSetup reports whether no settings file exists (global or project). Credentials come exclusively from settings.json, so a missing file means the interactive frontend must run onboarding before booting the runtime.

func PatchEffectiveSettings added in v0.3.0

func PatchEffectiveSettings(cwd string, patch Settings) error

PatchEffectiveSettings writes to the project settings file when it exists, otherwise to the global settings file. Runtime UI changes should use this so the visible state matches the settings layer ResolveAllStrict reads.

func PatchGlobalSettings added in v0.0.2

func PatchGlobalSettings(patch Settings) error

PatchGlobalSettings loads the global settings, applies the patch, and saves back. Only non-nil fields in patch are updated.

func PatchProjectSettings added in v0.0.2

func PatchProjectSettings(cwd string, patch Settings) error

PatchProjectSettings loads project-level settings, applies the patch, and saves back.

func PlanSubAgentPrompt

func PlanSubAgentPrompt(cwd string) string

PlanSubAgentPrompt returns the system prompt for the plan sub-agent.

func PlansDir

func PlansDir(_ string) string

PlansDir returns ~/.codebot/plans/. A single global directory shared across projects; word-slug filenames make collisions vanishingly rare.

func ProjectConfigExists added in v0.0.2

func ProjectConfigExists(cwd string) bool

ProjectConfigExists reports whether <cwd>/.codebot/settings.json exists.

func ResolveConfiguredProviderType added in v0.1.0

func ResolveConfiguredProviderType(providers map[string]ProviderConfig, name string) (string, error)

ResolveConfiguredProviderType resolves the protocol type for a configured provider.

func ResolveProviderType added in v0.1.0

func ResolveProviderType(name, explicitType string) (string, error)

ResolveProviderType resolves a provider's protocol type. When explicitType is set it wins (and must be registered); otherwise the provider name itself must be a registered litellm provider.

func SaveSettings

func SaveSettings(s Settings) error

SaveSettings writes settings to ~/.codebot/settings.json (global).

func SessionsDir

func SessionsDir(cwd string) string

SessionsDir returns ~/.codebot/projects/<projectID>/. Sessions are stored globally but scoped by project.

func SettingsPath

func SettingsPath(cwd string) string

SettingsPath returns <cwd>/.codebot/settings.json.

func SnapshotDir added in v0.2.0

func SnapshotDir(cwd string) string

SnapshotDir returns ~/.codebot/snapshot/<projectID> — the shadow git repository backing /undo file checkpoints for this project.

func TasksDir

func TasksDir() string

TasksDir returns ~/.codebot/tasks/.

func TeamDir added in v0.2.0

func TeamDir(sessionID string) string

TeamDir returns ~/.codebot/tasks/<sessionID>/team/ — the per-session home for team coordination artifacts (roster, teammate transcripts, mailbox backlog) that must survive a restart alongside the durable task list. It lives under the session's task dir so a session's entire coordination state is reclaimed together.

func UndoStatePath added in v0.2.0

func UndoStatePath(cwd, sessionID string) string

UndoStatePath returns the per-session sidecar that persists /undo's snapshot stack across restarts: ~/.codebot/projects/<projectID>/<sessionID>/undo-stack.json. It sits under the per-session dir alongside bg/ and tool-outputs/.

func UserConfigDir

func UserConfigDir() string

UserConfigDir returns ~/.codebot/.

func ValidateResolved added in v0.3.0

func ValidateResolved(r Resolved) error

ValidateResolved rejects unsupported values after global/project settings have been merged and defaults applied.

Types

type ContextFiles

type ContextFiles struct {
	// Agents is the concatenated content of all AGENTS.md files found
	// from filesystem root down to cwd, separated by newlines.
	Agents string

	// SystemOverride is the content of SYSTEM.md if found in cwd.
	// When non-empty, it replaces the default system prompt entirely.
	SystemOverride string

	// SystemAppend is the content of APPEND_SYSTEM.md if found in cwd.
	// When non-empty, it is appended to the system prompt.
	SystemAppend string

	// GitSnapshot is the git status snapshot collected at session start.
	// Injected as a separate system block so the LLM knows the repo state.
	GitSnapshot string

	// Memory is the auto memory content (first 200 lines of MEMORY.md).
	Memory string

	// MemoryDir is the absolute path to the memory directory.
	// Used by auto memory instructions to tell the LLM where to write.
	MemoryDir string
}

ContextFiles holds the loaded context file contents.

func LoadContextFiles

func LoadContextFiles(cwd string) ContextFiles

LoadContextFiles searches for context files from cwd upward to the filesystem root.

Loading order (lowest to highest specificity):

  1. ~/.codebot/AGENTS.md (global user-level, auto-created if missing)
  2. AGENTS.md in each ancestor from root down to cwd

CLAUDE.md is used as fallback when AGENTS.md is not found in a directory. SYSTEM.md and APPEND_SYSTEM.md are only looked for in cwd.

type DreamConfig added in v0.3.0

type DreamConfig struct {
	Enabled     *bool `json:"enabled,omitempty"`      // nil = enabled
	MinHours    *int  `json:"min_hours,omitempty"`    // hours since last consolidation; default 24
	MinSessions *int  `json:"min_sessions,omitempty"` // other sessions touched since; default 5
}

DreamConfig configures background memory consolidation ("dream"): when the session goes idle, a restricted subagent reorganizes the auto-memory directory. Fields are pointers so unset falls back to defaults (on, 24h, 5).

type DreamSettings added in v0.3.0

type DreamSettings struct {
	Enabled     bool
	MinHours    int
	MinSessions int
}

DreamSettings is the resolved form of DreamConfig.

type ExtraCommandSource added in v0.1.0

type ExtraCommandSource struct {
	Path   string
	Source string
}

type FileCommand added in v0.0.2

type FileCommand struct {
	Name        string
	Aliases     []string
	Description string
	Usage       string
	Content     string
	Source      string // "user" or "project"
	FilePath    string
	Category    string // prompt/info/session/config/plan/exit
	NeedsIdle   bool
	Hidden      bool
}

FileCommand is a user-defined slash command loaded from a Markdown file. Its body is treated as a prompt template with optional frontmatter metadata.

func LoadCommandsFromDir added in v0.1.0

func LoadCommandsFromDir(dir, source string) []FileCommand

func LoadFileCommands added in v0.0.2

func LoadFileCommands(cwd string, extraPaths ...string) []FileCommand

LoadFileCommands discovers and loads Markdown-backed slash commands from user, project, and extra paths (e.g. skill-declared command files). Project commands override user commands; extra paths have lowest priority.

func LoadFileCommandsWithSources added in v0.1.0

func LoadFileCommandsWithSources(cwd string, extraSources ...ExtraCommandSource) []FileCommand

LoadFileCommandsWithSources discovers Markdown-backed slash commands from user, project, and extra plugin/skill paths. Project commands override user commands; extra paths have lowest priority.

func ValidateCommandsDir added in v0.1.0

func ValidateCommandsDir(dir, source string) ([]FileCommand, []error)

type HookEntry added in v0.0.2

type HookEntry struct {
	Type     string            `json:"type"`               // "command", "prompt", or "http"
	Command  string            `json:"command,omitempty"`  // type=command: shell command
	Prompt   string            `json:"prompt,omitempty"`   // type=prompt: LLM prompt ($ARGUMENTS = payload)
	URL      string            `json:"url,omitempty"`      // type=http: POST endpoint
	Headers  map[string]string `json:"headers,omitempty"`  // type=http: request headers
	Matcher  string            `json:"matcher,omitempty"`  // tool name filter: exact or /regex/
	If       string            `json:"if,omitempty"`       // argument content filter: substring or /regex/
	Blocking *bool             `json:"blocking,omitempty"` // can block execution
	Timeout  *int              `json:"timeout,omitempty"`  // seconds (default 60)
}

HookEntry describes a single hook. Supported types: "command" (shell), "prompt" (LLM evaluation), "http" (POST).

type HooksConfig added in v0.0.2

type HooksConfig map[string][]HookEntry

HooksConfig maps event names to their hook entries.

type MemoryRecall added in v0.3.0

type MemoryRecall struct {
	Path      string
	Content   string // truncated to recallMaxFileBytes
	Age       time.Duration
	Truncated bool
}

MemoryRecall is one memory file selected for injection.

func RecallMemories added in v0.3.0

func RecallMemories(dir, message string, exclude map[string]bool, maxFiles int) []MemoryRecall

RecallMemories scans dir for topic files whose frontmatter matches the message and returns at most maxFiles of them, best match first. Files in exclude (already surfaced this session) and MEMORY.md (always injected separately) are skipped. Returns nil when the message is too short to score meaningfully.

type PermissionsConfig added in v0.0.4

type PermissionsConfig struct {
	Allow      []string `json:"allow,omitempty"`
	Deny       []string `json:"deny,omitempty"`
	ReadRoots  []string `json:"read_roots,omitempty"`
	WriteRoots []string `json:"write_roots,omitempty"`
}

PermissionsConfig holds user-defined permission rules.

type ProviderConfig

type ProviderConfig struct {
	Type       string         `json:"type,omitempty"` // LiteLLM protocol type; required only when the provider name is not a known litellm provider
	API        string         `json:"api,omitempty"`  // OpenAI protocol endpoint: chat (default) or responses
	APIKey     string         `json:"api_key,omitempty"`
	BaseURL    string         `json:"base_url,omitempty"`
	Models     []string       `json:"models,omitempty"`      // available model list for this provider
	SmallModel string         `json:"small_model,omitempty"` // lightweight model for sub-agents
	Extra      map[string]any `json:"extra,omitempty"`       // provider-level litellm config: headers, user_agent, anthropic_beta
}

ProviderConfig holds credentials and model configuration for a single provider.

func (ProviderConfig) ProviderExtra added in v0.3.0

func (pc ProviderConfig) ProviderExtra() map[string]any

ProviderExtra returns provider-level litellm config, including codebot's first-class provider fields that agentcore still receives through Extra.

func (ProviderConfig) ProviderType added in v0.0.2

func (pc ProviderConfig) ProviderType(name string) (string, error)

ProviderType resolves the protocol type for this provider. The protocol type maps to a name registered in litellm's provider registry.

type Resolved

type Resolved struct {
	Provider   string                    // active provider name
	Model      string                    // model name sent to API as-is
	SmallModel string                    // sub-agent model; equals Model when not configured
	Providers  map[string]ProviderConfig // per-provider credentials

	ContextWindow   int     // effective window after applying CompactWindow cap
	MaxOutputTokens int     // model's output ceiling from the registry; 0 = unknown
	CompactWindow   int     // user-configured cap on effective window; 0 = disabled
	CompactRatio    float64 // usage ratio that triggers compaction; 0 = engine default
	ReasoningEffort string
	MaxTurns        int
	SearchProvider  string
	SearchAPIKey    string

	Hooks HooksConfig // lifecycle hooks

	Permissions PermissionsConfig // user-defined permission rules

	Telemetry TelemetryConfig // OTLP trace export config

	Dream DreamSettings // background memory consolidation; defaults on

	Snapshot bool // workspace checkpoints for /undo; defaults on
}

Resolved holds settings resolved to concrete values (no pointers).

func LoadSettingsStrict added in v0.1.0

func LoadSettingsStrict(cwd string) (Resolved, error)

LoadSettingsStrict loads and merges settings from global (~/.codebot/settings.json) and project (<cwd>/.codebot/settings.json). Project-level values override global. Returns an error when either settings file exists and cannot be parsed.

func ResolveAllStrict added in v0.1.0

func ResolveAllStrict(cwd string) (Resolved, error)

ResolveAllStrict merges global and project settings, applies defaults, and returns a fully resolved configuration. Refuses to continue when an existing settings file is malformed. Model is deliberately never defaulted — hardcoded model names go stale; boot validates it is set.

func (Resolved) CompactReserveTokens added in v0.3.1

func (r Resolved) CompactReserveTokens() int

CompactReserveTokens returns reply headroom; zero selects the engine default.

func (Resolved) ProviderCredentials

func (r Resolved) ProviderCredentials(prov string) (apiKey, baseURL string)

ProviderCredentials returns API key and base URL for the given provider. Credentials come exclusively from settings.json — no environment fallback.

func (Resolved) ProviderExtra added in v0.3.0

func (r Resolved) ProviderExtra(prov string) map[string]any

ProviderExtra returns provider-level litellm config for the given provider.

type Settings

type Settings struct {
	Provider        *string                    `json:"provider,omitempty"`         // provider name (matches key in providers map)
	Model           *string                    `json:"model,omitempty"`            // model name sent to API as-is
	ReasoningEffort *string                    `json:"reasoning_effort,omitempty"` // "" = provider default; off | low | medium | high | xhigh | max
	SmallModel      *string                    `json:"small_model,omitempty"`      // sub-agent model; defaults to Model if empty
	Providers       map[string]*ProviderConfig `json:"providers,omitempty"`

	MaxTurns *int `json:"max_turns,omitempty"`

	// CompactWindow caps the effective context window used for compaction.
	// Effective = min(model's detected window, CompactWindow). 0 = disabled.
	CompactWindow *int `json:"compact_window,omitempty"`
	// CompactRatio triggers compaction when usage >= effective * ratio.
	// Range (0, 1). 0 = engine default (fixed headroom buffer).
	CompactRatio *float64 `json:"compact_ratio,omitempty"`

	SearchProvider *string `json:"search_provider,omitempty"`
	SearchAPIKey   *string `json:"search_api_key,omitempty"`

	Hooks HooksConfig `json:"hooks,omitempty"` // lifecycle hooks

	Permissions *PermissionsConfig `json:"permissions,omitempty"`

	Telemetry *TelemetryConfig `json:"telemetry,omitempty"` // OpenTelemetry trace export

	Dream *DreamConfig `json:"dream,omitempty"` // background memory consolidation

	// Snapshot toggles workspace file checkpoints backing /undo. Unset means on;
	// set false to disable (e.g. on a large repo where per-turn scans lag).
	Snapshot *bool `json:"snapshot,omitempty"`
}

Settings holds application-level configuration. Fields use pointer types so unset fields fall back to defaults.

func (Settings) Resolve

func (s Settings) Resolve() Resolved

Resolve converts Settings to Resolved using defaults for unset fields.

type SetupChoice added in v0.3.0

type SetupChoice struct {
	Provider string // provider key, e.g. "anthropic", or a custom name
	Type     string // protocol type for custom providers; empty = derive from name
	BaseURL  string // optional custom endpoint
	APIKey   string
	Model    string // exact model id; required — hardcoded defaults go stale
}

SetupChoice is the input collected by the onboarding wizard.

type SetupOutcome added in v0.3.0

type SetupOutcome struct {
	Provider string
	Model    string
	Path     string // settings.json that was written
}

SetupOutcome reports what ApplySetup wrote.

func ApplySetup added in v0.3.0

func ApplySetup(c SetupChoice) (SetupOutcome, error)

ApplySetup persists the choice into ~/.codebot/settings.json. It patches rather than overwrites, so unrelated fields in an existing file survive a re-run (codebot -setup).

type TelemetryConfig added in v0.2.0

type TelemetryConfig struct {
	Enabled   bool   `json:"enabled,omitempty"`
	Endpoint  string `json:"endpoint,omitempty"`   // OTLP/HTTP endpoint URL, e.g. https://cloud.langfuse.com/api/public/otel
	PublicKey string `json:"public_key,omitempty"` // basic-auth username
	SecretKey string `json:"secret_key,omitempty"` // basic-auth password
}

TelemetryConfig configures OpenTelemetry trace export to an OTLP backend (e.g. Langfuse). Telemetry stays off unless Enabled is true.

type ToolInfo

type ToolInfo struct {
	Name        string
	Description string
}

ToolInfo describes a tool for system prompt generation. Decoupled from agentcore.Tool to avoid package dependency.

func SplitToolsByOrigin added in v0.1.3

func SplitToolsByOrigin(all []ToolInfo) (local, mcp []ToolInfo)

SplitToolsByOrigin partitions tools into local (session-stable) and MCP (runtime-mutable) buckets so callers can route them to the right frozen/dynamic system block.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL