Documentation
¶
Index ¶
- Constants
- func NormalizeGitHubRepo(s string) (string, error)
- func ParseOwnerRepo(s string) (owner, repo string, err error)
- func ScaffoldPackageManifest(meta PackageMeta, skills []Skill) ([]byte, error)
- func ValidatePackageName(name string) error
- type Entry
- type FileFetcher
- type KitEntry
- type LegacyConverter
- type Manifest
- type Package
- type PackageMeta
- type Skill
- type Source
- type Targets
- type Team
Constants ¶
const EntryTypePackage = "package"
EntryTypePackage is the type value for package catalog entries.
const KitNamePattern = `^[a-zA-Z0-9._-]+$`
KitNamePattern is the local-safe name shape for registry-published kit refs and kit body names. Keep in sync with internal/kit.
const LegacyManifestFilename = "scribe.toml"
LegacyManifestFilename is the old TOML-based manifest filename.
const ManifestFilename = "scribe.yaml"
ManifestFilename is the conventional name for a scribe manifest file.
Variables ¶
This section is empty.
Functions ¶
func NormalizeGitHubRepo ¶
NormalizeGitHubRepo returns owner/repo for either a plain owner/repo string or a github.com repository URL. Tree/blob URLs are accepted and normalized to the containing repository; subdirectory-scoped sources need a richer source schema and are intentionally not represented here.
func ParseOwnerRepo ¶
ParseOwnerRepo splits an "owner/repo" string and validates it.
func ScaffoldPackageManifest ¶
func ScaffoldPackageManifest(meta PackageMeta, skills []Skill) ([]byte, error)
ScaffoldPackageManifest builds a parseable package manifest for a new skill package.
func ValidatePackageName ¶
ValidatePackageName checks whether name is suitable for a package manifest.
Types ¶
type Entry ¶
type Entry struct {
Name string `yaml:"name"`
Source string `yaml:"source,omitempty"`
Path string `yaml:"path,omitempty"`
Type string `yaml:"type,omitempty"`
Install string `yaml:"install,omitempty"` // global fallback install command
Update string `yaml:"update,omitempty"` // global fallback update command
Installs map[string]string `yaml:"installs,omitempty"` // per-tool install commands; override Install
Updates map[string]string `yaml:"updates,omitempty"` // per-tool update commands; override Update
Author string `yaml:"author,omitempty"`
Description string `yaml:"description,omitempty"`
Timeout int `yaml:"timeout,omitempty"`
Group string `yaml:"-"` // display-only, set by marketplace discovery
}
Entry represents one item in the catalog list.
func (Entry) InstallFor ¶
InstallFor returns the install command for toolName. Per-tool commands take precedence over the global Install fallback.
type FileFetcher ¶
type FileFetcher interface {
FetchFile(ctx context.Context, owner, repo, path, ref string) ([]byte, error)
}
FileFetcher abstracts fetching a single file from a remote repository.
type KitEntry ¶
type KitEntry struct {
Name string `yaml:"name"`
Path string `yaml:"path,omitempty"`
Description string `yaml:"description,omitempty"`
Author string `yaml:"author,omitempty"`
}
KitEntry represents one registry-published kit advertised by the manifest.
func (KitEntry) PathOrDefault ¶
PathOrDefault returns the kit body path for this entry.
type LegacyConverter ¶
LegacyConverter converts raw legacy TOML bytes into a Manifest. Supplied by the caller to avoid an import cycle with the migrate package.
type Manifest ¶
type Manifest struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Team *Team `yaml:"team,omitempty"`
Package *Package `yaml:"package,omitempty"`
Catalog []Entry `yaml:"catalog"`
Kits []KitEntry `yaml:"kits,omitempty"`
Targets *Targets `yaml:"targets,omitempty"`
}
Manifest represents a parsed scribe.yaml. A file with team: is a registry; package: is a skill package.
func FetchWithFallback ¶
func FetchWithFallback(ctx context.Context, f FileFetcher, owner, repo string, convert LegacyConverter) (*Manifest, bool, error)
FetchWithFallback fetches and parses a manifest, trying scribe.yaml first then falling back to legacy scribe.toml with automatic conversion. Returns (manifest, isLegacy, error).
func (*Manifest) FindByName ¶
FindByName returns the first catalog entry with the given name, or nil.
func (*Manifest) IsRegistry ¶
IsRegistry reports whether this manifest describes a team registry.
type Package ¶
type Package struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description,omitempty"`
License string `yaml:"license,omitempty"`
Authors []string `yaml:"authors,omitempty"`
Repository string `yaml:"repository,omitempty"`
Installs map[string]string `yaml:"installs,omitempty"` // per-tool install commands
Updates map[string]string `yaml:"updates,omitempty"` // per-tool update commands
}
type PackageMeta ¶
type PackageMeta struct {
Name string `json:"name"`
Description string `json:"description"`
Author string `json:"author"`
}
PackageMeta contains the package-level fields collected by scribe init.
type Source ¶
type Source struct {
Host string // always "github" for now
Owner string
Repo string
Ref string // tag or branch name
}
Source is a parsed skill source reference. Format: "github:owner/repo@ref" Ref can be a semver tag (v1.2.3), a non-semver tag (v0.12.9.0), or a branch (main).
func ParseSource ¶
ParseSource parses a source string like "github:owner/repo@ref".