agentcrd

package
v0.10.0-rc4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

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

func HostHomePath(cfg *config.Config, name string) string

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

func HostLegacySoulPath(cfg *config.Config, name string) string

HostLegacySoulPath is the pre-profile seed path used before Hermes profile casing was aligned. It is read during migration only.

func HostSkillsPath

func HostSkillsPath(cfg *config.Config, name string) string

HostSkillsPath is the per-agent skills dir. OBOL_SKILLS_DIR points here from inside the pod.

func HostSoulPath

func HostSoulPath(cfg *config.Config, name string) string

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

func Namespace(name string) string

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

func ParseSkills(csv string) ([]string, error)

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

func ValidateName(name string) error

ValidateName reports whether the agent name is valid for both K8s resource naming and the obol.org/Agent CRD pattern.

func WriteSoul

func WriteSoul(cfg *config.Config, name, objective string, overwrite bool) (bool, error)

WriteSoul renders and writes SOUL.md for the named agent. When overwrite is false, an existing SOUL.md is preserved and the return value is false.

Types

type AgentOptions

type AgentOptions struct {
	Model        string
	Skills       []string
	Objective    string
	CreateWallet bool
}

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.

Jump to

Keyboard shortcuts

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