Documentation
¶
Overview ¶
Package agentcrd contains host-side helpers for managing the obol.org/Agent CRD: building a spec from CLI flags, seeding the per-agent skills dir + SOUL.md on the host (which becomes the data PVC inside the cluster), and thin wrappers around kubectl apply/get/delete. The in-cluster reconciler in internal/serviceoffercontroller is the source of truth for the resulting K8s primitives; this package is just the host-side seam.
Index ¶
- func BuildAgent(name string, opts AgentOptions) map[string]any
- func HostHomePath(cfg *config.Config, name string) string
- func HostLegacySoulPath(cfg *config.Config, name string) string
- func HostSkillsPath(cfg *config.Config, name string) string
- func HostSoulPath(cfg *config.Config, name string) string
- func Namespace(name string) string
- func ParseSkills(csv string) ([]string, error)
- func SeedHostFiles(cfg *config.Config, name string, skills []string, objective string, ...) (soulWritten bool, err error)
- func ValidateName(name string) error
- func WriteSoul(cfg *config.Config, name, objective string, overwrite bool) (bool, error)
- type AgentOptions
- type SeedOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAgent ¶
func BuildAgent(name string, opts AgentOptions) map[string]any
BuildAgent assembles the unstructured Agent manifest for kubectl apply. The reconciler is responsible for filling status; we never write it from the CLI side.
func HostHomePath ¶
HostHomePath is where the agent's .hermes data lives on the host. The cluster mounts this into the Hermes pod via hostPath; writing SOUL.md/skills here puts them inside the pod automatically.
func HostLegacySoulPath ¶
HostLegacySoulPath is the pre-profile seed path used before Hermes profile casing was aligned. It is read during migration only.
func HostSkillsPath ¶
HostSkillsPath is the per-agent skills dir. OBOL_SKILLS_DIR points here from inside the pod.
func HostSoulPath ¶
HostSoulPath is where the seeded Hermes identity file lives. Hermes reads uppercase SOUL.md from HERMES_HOME, so keep this path aligned with upstream Hermes profile semantics.
func Namespace ¶
Namespace returns the namespace for an agent of the given name. Single source of truth: keep callers from spreading "agent-" prefixes through the codebase.
func ParseSkills ¶
ParseSkills splits the CLI-style comma list and validates that every name matches the CRD's skill-name pattern. Empty strings between commas are dropped; nothing is fancy on purpose.
func SeedHostFiles ¶
func SeedHostFiles(cfg *config.Config, name string, skills []string, objective string, opts SeedOptions) (soulWritten bool, err error)
SeedHostFiles writes the chosen skill subset and seeds SOUL.md on the host data path. SOUL.md is only written when missing (or when OverwriteSoul is true).
Returns whether SOUL.md was written this call so callers can report the difference between "fresh agent" and "existing agent, skills resynced".
func ValidateName ¶
ValidateName reports whether the agent name is valid for both K8s resource naming and the obol.org/Agent CRD pattern.
Types ¶
type AgentOptions ¶
AgentOptions is the host-side projection of AgentSpec used by the CLI.
type SeedOptions ¶
type SeedOptions struct {
// OverwriteSoul forces a SOUL.md rewrite even if one already exists.
// Default false: agent-owned after first reconcile.
OverwriteSoul bool
// ExactSkills removes any previously seeded skill dirs not present in the
// requested set before copying the embedded skill subset.
ExactSkills bool
}
SeedOptions controls how host-side seed data is written.