Documentation
¶
Overview ¶
Package skill provides skills as a typed facade over the unified resource foundation. A skill is stored as a resource.Resource of kind "Skill": the slug is the resource name, the scope is the resource namespace, and the name/body/tags live in a schema-validated Spec. The facade implements state.SkillStore, so call sites keep the same ergonomic, type-safe API while the data lives on one event-sourced store with one envelope, one schema/admission path, and one provenance/sync model shared with every other kind.
Search is a read model over that store: the facade ranks live skills by a case-insensitive scan today, and a backend can maintain a full-text projection of the same resource events without changing this contract.
Index ¶
- Constants
- Variables
- func RegisterKind(reg *resource.Registry) error
- type Store
- func (s *Store) Delete(ctx context.Context, idOrSlug string) error
- func (s *Store) Get(ctx context.Context, idOrSlug string) (state.Skill, error)
- func (s *Store) List(ctx context.Context, scope state.Scope) ([]state.Skill, error)
- func (s *Store) Search(ctx context.Context, query string, limit int) ([]state.Skill, error)
- func (s *Store) Upsert(ctx context.Context, sk state.Skill) (state.Skill, error)
Constants ¶
const GroupVersion = "skill.ionagent.io/v1"
GroupVersion is the skill kind's API group/version. The `.ionagent.io` suffix marks it unmistakably as ours, never a Kubernetes built-in.
const Kind = "Skill"
Kind is the resource kind name skills are stored under.
Variables ¶
var KindDef = resource.Kind{ APIVersion: GroupVersion, Name: Kind, Schema: specSchema, Singular: "skill", Plural: "skills", }
KindDef is the Skill kind definition, the value registered with a resource registry so the store admits skills.
Functions ¶
func RegisterKind ¶
RegisterKind registers the Skill kind with reg so a resource store admits skills. It is idempotent: registering again replaces the definition.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the typed skill facade over a resource.Store. It is the SkillStore the agent uses; underneath, every read and write is a resource operation on one event-sourced foundation.
func NewStore ¶
NewStore returns a skill facade over rs. The caller must have registered the Skill kind with the registry rs admits against (see RegisterKind).
func (*Store) Get ¶
Get returns a live skill by id or slug, or state.ErrNotFound. A slug is resolved across every scope (the SkillStore handle is scope-independent).
func (*Store) Search ¶
Search returns live skills whose name, body, or tags contain query (case insensitive), across every scope, ordered by slug and capped at limit (limit <= 0 means no cap). An empty query matches every live skill.