skill

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 9 Imported by: 0

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

View Source
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.

View Source
const Kind = "Skill"

Kind is the resource kind name skills are stored under.

Variables

View Source
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

func RegisterKind(reg *resource.Registry) error

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

func NewStore(rs resource.Store) *Store

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) Delete

func (s *Store) Delete(ctx context.Context, idOrSlug string) error

Delete tombstones a skill by id or slug, or returns state.ErrNotFound.

func (*Store) Get

func (s *Store) Get(ctx context.Context, idOrSlug string) (state.Skill, error)

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) List

func (s *Store) List(ctx context.Context, scope state.Scope) ([]state.Skill, error)

List returns the live skills in a scope, ordered by slug.

func (*Store) Search

func (s *Store) Search(ctx context.Context, query string, limit int) ([]state.Skill, error)

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.

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, sk state.Skill) (state.Skill, error)

Upsert creates or updates a skill keyed by (Scope, Slug), mapping it to a Skill resource and back. Versioning, origin preservation, and optimistic concurrency are the resource foundation's, so the contract matches every other kind.

Directories

Path Synopsis
Package skilltest is the conformance suite for state.SkillStore.
Package skilltest is the conformance suite for state.SkillStore.

Jump to

Keyboard shortcuts

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