skillimport

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectPluginName

func DetectPluginName(rootDir string) string

DetectPluginName looks for .claude-plugin/plugin.json in the root directory and returns the plugin name if found.

func RegisterRoutes

func RegisterRoutes(api huma.API, router chi.Router, importStore *Store, skillStore *skill.Store, storage platform.Storage, fetcher *Fetcher, ext ...*scan.ExternalScanner)

Types

type DiscoveredSkill

type DiscoveredSkill struct {
	Name              string            `json:"name"`
	Description       string            `json:"description"`
	Path              string            `json:"path"`
	Files             []skill.FileEntry `json:"files"`
	ScanStatus        string            `json:"scan_status"`
	ScanFindingsCount int               `json:"scan_findings_count"`
	ExistingVersion   int               `json:"existing_version"`
}

func Discover

func Discover(rootDir, subPath string) ([]DiscoveredSkill, error)

type FetchResult

type FetchResult struct {
	Dir       string // temp directory with unpacked contents (caller must clean up)
	CommitSHA string // extracted from tarball root dir name
}

type Fetcher

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

func NewFetcher

func NewFetcher(apiBase, githubToken string) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(src Source) (*FetchResult, error)

type ImportSource

type ImportSource struct {
	ID          string     `json:"id"`
	SkillID     string     `json:"skill_id"`
	SkillName   string     `json:"skill_name,omitempty"`
	SourceType  string     `json:"source_type"`
	SourceURL   string     `json:"source_url"`
	SourcePath  string     `json:"source_path"`
	SourceRef   string     `json:"source_ref"`
	CommitSHA   string     `json:"commit_sha"`
	ImportedAt  time.Time  `json:"imported_at"`
	LastChecked *time.Time `json:"last_checked"`
}

type Source

type Source struct {
	Type      string `json:"type"`
	Owner     string `json:"owner"`
	Repo      string `json:"repo"`
	Ref       string `json:"ref"`
	Path      string `json:"path"`
	CommitSHA string `json:"commit_sha"`
}

func ResolveURL

func ResolveURL(raw string) (Source, error)

type Store

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

func NewStore

func NewStore(pool *pgxpool.Pool) *Store

func (*Store) GetBySkillID

func (s *Store) GetBySkillID(ctx context.Context, skillID string) (*ImportSource, error)

func (*Store) GetBySkillName

func (s *Store) GetBySkillName(ctx context.Context, skillName string) (*ImportSource, error)

func (*Store) ListAll

func (s *Store) ListAll(ctx context.Context) ([]ImportSource, error)

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, src ImportSource) error

Jump to

Keyboard shortcuts

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