Documentation
¶
Overview ¶
Package resources bundles embedded resources (skills, souls, delegates, templates, and builtin plugin manifest) that Stella ships with its binary. Runtime code accesses them through Registry, not by walking the filesystem directly.
Index ¶
- func BuiltinOAuthYAML() []byte
- func BuiltinToolsYAML() []byte
- func FS() fs.FS
- func SubFS(kind Kind) (fs.FS, bool)
- func WriteBuiltinManifest(sourceRoot, output string) error
- type BuiltinManifest
- type BuiltinSkillDescriptor
- type BuiltinSkillFile
- type Kind
- type LegacySkillBlocker
- type Registry
- func (r *Registry) BuiltinSkill(name string) (BuiltinSkillDescriptor, bool)
- func (r *Registry) BuiltinSkills() []BuiltinSkillDescriptor
- func (r *Registry) BundlePath(stellaHome string) (string, error)
- func (r *Registry) BundleRevision() string
- func (r *Registry) Get(kind Kind, id string) (Resource, bool)
- func (r *Registry) InstallBuiltinBundle(stellaHome string) (string, error)
- func (r *Registry) InventoryLegacySkills(skillsDir string) ([]LegacySkillBlocker, error)
- func (r *Registry) Kinds() []Kind
- func (r *Registry) List(kind Kind) []Resource
- func (r *Registry) ReadBuiltinSkillFile(name, filePath string) ([]byte, BuiltinSkillFile, error)
- func (r *Registry) VerifyBuiltinBundle(stellaHome string) error
- type Resource
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinOAuthYAML ¶ added in v0.50.5
func BuiltinOAuthYAML() []byte
BuiltinOAuthYAML returns the raw bytes of the builtin OAuth provider manifest.
func BuiltinToolsYAML ¶ added in v0.50.5
func BuiltinToolsYAML() []byte
BuiltinToolsYAML returns the raw bytes of the builtin tool plugin manifest.
func FS ¶
FS returns the full embedded filesystem rooted at the package directory. Prefer SubFS for kind-scoped access.
func SubFS ¶
SubFS returns the embedded filesystem scoped to a single Kind's subdirectory. Empty (nil, false) when the kind has no known subdir.
func WriteBuiltinManifest ¶ added in v0.64.0
WriteBuiltinManifest writes the generated source only when its bytes differ, keeping generation checks and source mtimes deterministic.
Types ¶
type BuiltinManifest ¶ added in v0.64.0
type BuiltinManifest struct {
Revision string `json:"revision"`
Skills []BuiltinSkillDescriptor `json:"skills"`
}
BuiltinManifest is the generated, deterministic description of every release-owned builtin skill. Revision changes when any catalog byte or mode changes.
func GenerateBuiltinManifest ¶ added in v0.64.0
func GenerateBuiltinManifest(sourceRoot string) (BuiltinManifest, error)
GenerateBuiltinManifest validates sourceRoot and returns its deterministic manifest. sourceRoot is the on-disk resources/skills directory, not a user path.
func GeneratedBuiltinManifest ¶ added in v0.64.0
func GeneratedBuiltinManifest() (BuiltinManifest, error)
GeneratedBuiltinManifest returns the manifest compiled into this binary.
type BuiltinSkillDescriptor ¶ added in v0.64.0
type BuiltinSkillDescriptor struct {
Ref string `json:"ref"`
APIID string `json:"api_id"`
Name string `json:"name"`
Description string `json:"description"`
Tags []string `json:"tags"`
DisableModelInvocation bool `json:"disable_model_invocation"`
Metadata map[string]any `json:"metadata"`
Root string `json:"root"`
Files []BuiltinSkillFile `json:"files"`
Digest string `json:"digest"`
}
BuiltinSkillDescriptor is the release-owned identity and complete file list for one builtin skill. Metadata retains nested frontmatter fields verbatim.
type BuiltinSkillFile ¶ added in v0.64.0
type BuiltinSkillFile struct {
Path string `json:"path"`
Digest string `json:"digest"`
Size int64 `json:"size"`
Mode fs.FileMode `json:"mode"`
}
BuiltinSkillFile describes one immutable file relative to a skill root.
type LegacySkillBlocker ¶ added in v0.64.0
LegacySkillBlocker is an unsupported entry in the retired extracted builtin projection. Path is relative to $STELLA_HOME/.agents/skills using slash paths.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the read-only catalog of builtin resources, keyed by Kind and ID.
func Load ¶
Load walks sourceFS and parses every supported resource kind it finds. sourceFS must have subdirectories matching Kind.subdir() for each kind to load. Missing subdirectories are silently skipped (useful for tests with partial fixtures).
func LoadBuiltin ¶ added in v0.64.0
func LoadBuiltin(sourceFS fs.FS, manifest BuiltinManifest) (*Registry, error)
LoadBuiltin loads a registry from an embedded-style filesystem and validates every manifest-described byte before making it available to callers.
func (*Registry) BuiltinSkill ¶ added in v0.64.0
func (r *Registry) BuiltinSkill(name string) (BuiltinSkillDescriptor, bool)
BuiltinSkill returns one release-owned descriptor by its stable skill name.
func (*Registry) BuiltinSkills ¶ added in v0.64.0
func (r *Registry) BuiltinSkills() []BuiltinSkillDescriptor
BuiltinSkills returns all release-owned skill descriptors in stable name order.
func (*Registry) BundlePath ¶ added in v0.64.0
BundlePath returns the deterministic projection path for this registry under stellaHome. The path is derived only from a validated manifest revision.
func (*Registry) BundleRevision ¶ added in v0.64.0
BundleRevision identifies the exact builtin bundle loaded by this registry.
Example ¶
registry, err := Default()
if err != nil {
panic(err)
}
fmt.Println(len(registry.BundleRevision()))
Output: 64
func (*Registry) InstallBuiltinBundle ¶ added in v0.64.0
InstallBuiltinBundle materializes the exact embedded bundle below stellaHome. It returns only a fully verified revision and leaves an existing verified tree untouched so repeat installs do not rewrite operator-visible files.
func (*Registry) InventoryLegacySkills ¶ added in v0.64.0
func (r *Registry) InventoryLegacySkills(skillsDir string) ([]LegacySkillBlocker, error)
InventoryLegacySkills classifies the legacy extracted projection without changing it. Manifest file paths are inert old derived bytes and may have different contents or modes; every other entry blocks the bundle cutover.
func (*Registry) ReadBuiltinSkillFile ¶ added in v0.64.0
func (r *Registry) ReadBuiltinSkillFile(name, filePath string) ([]byte, BuiltinSkillFile, error)
ReadBuiltinSkillFile returns an embedded skill file selected by canonical root-relative path, together with its manifest descriptor.
func (*Registry) VerifyBuiltinBundle ¶ added in v0.64.0
VerifyBuiltinBundle proves that the projected revision contains exactly the manifest files and completion marker, with the expected content and modes.
type Resource ¶
type Resource struct {
Kind Kind
ID string
Name string
Description string
Tags []string
Metadata map[string]any
Content string
Hash string
}
Resource is one builtin entry of a given Kind. Content is the markdown body with frontmatter stripped. Metadata holds kind-specific frontmatter fields (anything beyond name/description/tags).