skillcontent

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package skillcontent reads embedded skill content from an injected fs.FS rooted at the skill list (entries like "lark-calendar/SKILL.md").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitArg

func SplitArg(arg string) (name, rest string)

SplitArg splits "<name>/<rest>" at the first separator; an argument with no separator is a bare skill name (rest "").

Types

type DirEntry

type DirEntry struct {
	Path  string `json:"path"`
	IsDir bool   `json:"is_dir"`
}

DirEntry.Path is skill-prefixed (e.g. "lark-doc/references/x.md") so it can be fed straight back into `read`.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func New

func New(fsys fs.FS) *Reader

func (*Reader) List

func (r *Reader) List() ([]SkillInfo, error)

func (*Reader) ListPath

func (r *Reader) ListPath(arg string) ([]DirEntry, string, error)

ListPath lists one directory layer (no recursion) under "<name>" or "<name>/<sub>", returning the entries and the cleaned path listed.

func (*Reader) ReadReference

func (r *Reader) ReadReference(name, relpath string) ([]byte, string, error)

ReadReference returns the bytes of <name>/<relpath> and the cleaned path.

func (*Reader) ReadSkill

func (r *Reader) ReadSkill(name string) ([]byte, error)

type SkillInfo

type SkillInfo struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Version     string         `json:"version,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

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