Documentation
¶
Index ¶
- func EnrichTreeSkillEntry(entry manifest.Entry, content []byte) (manifest.Entry, error)
- func ParseMarketplace(data []byte, owner, repo string) ([]manifest.Entry, error)
- func ScanTreeForSkills(tree []TreeEntry, owner, repo string) []manifest.Entry
- func ScopedPath(scope, rel string) string
- type CompositeProvider
- func (p *CompositeProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
- func (p *CompositeProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
- func (p *CompositeProvider) Fetch(ctx context.Context, entry manifest.Entry) ([]File, error)
- func (p *CompositeProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
- type DiscoverResult
- type File
- type FilesystemProvider
- func (p *FilesystemProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
- func (p *FilesystemProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
- func (p *FilesystemProvider) Fetch(ctx context.Context, entry manifest.Entry) ([]File, error)
- func (p *FilesystemProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
- type GitHubClient
- type GitHubProvider
- func (p *GitHubProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
- func (p *GitHubProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
- func (p *GitHubProvider) Fetch(ctx context.Context, entry manifest.Entry) ([]File, error)
- func (p *GitHubProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
- type GitProvider
- func (p *GitProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
- func (p *GitProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
- func (p *GitProvider) Fetch(ctx context.Context, entry manifest.Entry) ([]File, error)
- func (p *GitProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
- type KitFetchError
- type KitFetchErrors
- type KitFile
- type Provider
- type SourceProvider
- type TreeEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnrichTreeSkillEntry ¶
EnrichTreeSkillEntry applies SKILL.md frontmatter metadata to a tree-scan entry while preserving source and path fields used for install and lock pins.
func ParseMarketplace ¶
ParseMarketplace parses a marketplace.json byte slice and returns catalog entries. Each plugin's skills are flattened into individual entries with Group set to the plugin name.
func ScanTreeForSkills ¶
ScanTreeForSkills finds all SKILL.md files in a tree listing and returns catalog entries for each. The skill name is derived from the parent directory. A root-level SKILL.md uses the repo name.
func ScopedPath ¶
ScopedPath resolves rel under scope without double-prefixing paths that already include the scope.
Types ¶
type CompositeProvider ¶
type CompositeProvider struct {
// contains filtered or unexported fields
}
CompositeProvider dispatches SourceSpec-aware calls to the matching backend.
func NewCompositeProvider ¶
func NewCompositeProvider(github *GitHubProvider) *CompositeProvider
func (*CompositeProvider) Discover ¶
func (p *CompositeProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
func (*CompositeProvider) DiscoverSource ¶
func (p *CompositeProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
func (*CompositeProvider) FetchSource ¶
func (p *CompositeProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
type DiscoverResult ¶
type DiscoverResult struct {
Entries []manifest.Entry
Kits []KitFile
KitErrors KitFetchErrors
IsTeam bool // true if discovery found a scribe.yaml/toml with a team section
Manifest *manifest.Manifest
}
DiscoverResult holds the output of a Discover call.
type File ¶
File is a single file within a downloaded skill directory. Re-exported from tools for caller clarity.
type FilesystemProvider ¶
type FilesystemProvider struct {
// contains filtered or unexported fields
}
FilesystemProvider discovers and fetches skills from a directory tree.
func NewFilesystemProvider ¶
func NewFilesystemProvider() *FilesystemProvider
func (*FilesystemProvider) Discover ¶
func (p *FilesystemProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
func (*FilesystemProvider) DiscoverSource ¶
func (p *FilesystemProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
func (*FilesystemProvider) FetchSource ¶
func (p *FilesystemProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
type GitHubClient ¶
type GitHubClient interface {
FetchFile(ctx context.Context, owner, repo, path, ref string) ([]byte, error)
FetchDirectory(ctx context.Context, owner, repo, dirPath, ref string) ([]tools.SkillFile, error)
LatestCommitSHA(ctx context.Context, owner, repo, branch string) (string, error)
GetTree(ctx context.Context, owner, repo, ref string) ([]TreeEntry, error)
HasPushAccess(ctx context.Context, owner, repo string) (bool, error)
}
GitHubClient abstracts the GitHub API operations needed by the provider.
func WrapGitHubClient ¶
func WrapGitHubClient(c *gh.Client) GitHubClient
WrapGitHubClient returns a GitHubClient backed by a real github.Client.
type GitHubProvider ¶
type GitHubProvider struct {
OnWarning func(msg string) // optional callback for non-fatal warnings
// contains filtered or unexported fields
}
GitHubProvider discovers and fetches skills from GitHub repositories.
func NewGitHubProvider ¶
func NewGitHubProvider(client GitHubClient) *GitHubProvider
NewGitHubProvider creates a GitHubProvider wrapping the given client.
func (*GitHubProvider) Discover ¶
func (p *GitHubProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
Discover probes the repo using a fallback chain and returns all discovered entries.
func (*GitHubProvider) DiscoverSource ¶
func (p *GitHubProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
DiscoverSource probes a GitHub source using the same fallback chain as Discover, scoped to SourceSpec.Path when configured.
func (*GitHubProvider) FetchSource ¶
func (p *GitHubProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
FetchSource downloads an entry from a GitHub source, resolving paths relative to the source scope unless the entry already includes that scope.
type GitProvider ¶
type GitProvider struct {
// contains filtered or unexported fields
}
GitProvider discovers and fetches skills from arbitrary git repositories by cloning into a temporary directory per operation.
func NewGitProvider ¶
func NewGitProvider() *GitProvider
func (*GitProvider) Discover ¶
func (p *GitProvider) Discover(ctx context.Context, repo string) (*DiscoverResult, error)
func (*GitProvider) DiscoverSource ¶
func (p *GitProvider) DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
func (*GitProvider) FetchSource ¶
func (p *GitProvider) FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
type KitFetchError ¶
KitFetchError records one non-fatal kit fetch/pre-parse failure.
func (KitFetchError) Error ¶
func (e KitFetchError) Error() string
func (KitFetchError) Unwrap ¶
func (e KitFetchError) Unwrap() error
type KitFetchErrors ¶
type KitFetchErrors []KitFetchError
KitFetchErrors is a typed partial-error list returned alongside fetched kits.
func (KitFetchErrors) Error ¶
func (e KitFetchErrors) Error() string
type Provider ¶
type Provider interface {
// Discover probes a repository and returns all discoverable catalog entries.
// The repo argument is "owner/repo" format.
Discover(ctx context.Context, repo string) (*DiscoverResult, error)
// Fetch downloads all files for a single catalog entry.
// Returns skill files ready to be written to the canonical store.
Fetch(ctx context.Context, entry manifest.Entry) ([]File, error)
}
Provider abstracts how skills are discovered and fetched from a repository. Different repo formats (scribe.yaml, marketplace.json, bare SKILL.md trees) are handled transparently behind this interface.
type SourceProvider ¶
type SourceProvider interface {
DiscoverSource(ctx context.Context, spec source.SourceSpec) (*DiscoverResult, error)
FetchSource(ctx context.Context, spec source.SourceSpec, entry manifest.Entry) ([]File, error)
}
SourceProvider is the transitional SourceSpec-aware provider API. Provider remains stable so existing tests and callers can keep using repo strings.