Documentation
¶
Index ¶
- Constants
- func DefaultDBPath(dataDir string) string
- func MarketplaceCategoryOrder(category string) int
- func NormalizeMarketplaceCategory(raw, content string, tags []string) string
- func NormalizeSkillID(raw string) string
- func ValidateSkillID(raw string) (string, error)
- type AdditionalSeed
- type AvailableUpdate
- type Classifier
- type Config
- type CrawlRun
- type CuratedConfig
- type CurationEntry
- type CurationSyncState
- type DiscoverProgressEvent
- type DiscoverResult
- type DiscoverSourceResult
- type DiscoverStatus
- type EmbeddingProgressEvent
- type EmbeddingStatus
- type FilterOption
- type InstallRequest
- type InstallResult
- type InstallSurface
- type InstalledSkill
- type LLMClassifier
- type NoopVulnProvider
- type Options
- type RemoteCrawlCheckpoint
- type RemoteCrawlFailure
- type RemoteCrawlPage
- type RemoteCrawlQueueItem
- type RemoteCrawlRequest
- type RemoteCrawlResult
- type RemoteReadRequest
- type RemoteReadResult
- type RemoteReader
- type Scanner
- type SearchQuery
- type SearchResponse
- type SearchResult
- type SecurityEvidence
- type SecurityFinding
- type SecurityReport
- type Service
- func (s *Service) CheckForUpdates(ctx context.Context, apply bool) ([]AvailableUpdate, error)
- func (s *Service) Close() error
- func (s *Service) Discover(ctx context.Context) (*DiscoverResult, error)
- func (s *Service) Featured(ctx context.Context, category, source string, limit int) ([]SkillDocument, error)
- func (s *Service) Filters(ctx context.Context) (*SkillFilters, error)
- func (s *Service) GetDiscoverStatus() DiscoverStatus
- func (s *Service) GetEmbeddingStatus() EmbeddingStatus
- func (s *Service) GetSecurity(ctx context.Context, id, version string) (*SecurityReport, error)
- func (s *Service) GetSkill(ctx context.Context, id string) (*SkillDetail, error)
- func (s *Service) Install(ctx context.Context, req InstallRequest) (*InstallResult, error)
- func (s *Service) ListInstalled(ctx context.Context) ([]InstalledSkill, error)
- func (s *Service) ListUpdates(ctx context.Context) ([]AvailableUpdate, error)
- func (s *Service) Search(ctx context.Context, query SearchQuery) (*SearchResponse, error)
- func (s *Service) Start(ctx context.Context)
- func (s *Service) StartDiscoverAsync() (DiscoverStatus, bool)
- func (s *Service) Stop()
- func (s *Service) Store() *Store
- func (s *Service) Trending(ctx context.Context, category string, limit int) ([]SkillDocument, error)
- func (s *Service) Uninstall(ctx context.Context, skillID string) error
- func (s *Service) Update(ctx context.Context, skillID string) (*InstallResult, error)
- type SkillBatchUpsertResult
- type SkillCuration
- type SkillDetail
- type SkillDocument
- type SkillFilters
- type SkillUpsertRecord
- type SkillVersion
- type Source
- type SourceSecuritySignals
- type Store
- func (s *Store) BeginCrawlRun(ctx context.Context, sourceID string) (*CrawlRun, error)
- func (s *Store) CompleteCrawlRun(ctx context.Context, run *CrawlRun) error
- func (s *Store) GetCurationSyncState(ctx context.Context, id string) (*CurationSyncState, error)
- func (s *Store) GetFilters(ctx context.Context) (*SkillFilters, error)
- func (s *Store) GetInstalledSkill(ctx context.Context, skillID string) (*InstalledSkill, error)
- func (s *Store) GetLatestVersion(ctx context.Context, skillID string) (*SkillVersion, error)
- func (s *Store) GetSecurityReport(ctx context.Context, skillID, version string) (*SecurityReport, error)
- func (s *Store) GetSkill(ctx context.Context, id string) (*SkillDetail, error)
- func (s *Store) GetSkillVersion(ctx context.Context, skillID, version string) (*SkillVersion, error)
- func (s *Store) ListFeatured(ctx context.Context, category string, source string, limit int) ([]SkillDocument, error)
- func (s *Store) ListFilteredSkills(ctx context.Context, query SearchQuery) ([]SkillDocument, error)
- func (s *Store) ListInstalledSkills(ctx context.Context) ([]InstalledSkill, error)
- func (s *Store) ListSources(ctx context.Context) ([]Source, error)
- func (s *Store) ListTrending(ctx context.Context, category string, limit int) ([]SkillDocument, error)
- func (s *Store) ListUpdates(ctx context.Context) ([]AvailableUpdate, error)
- func (s *Store) RecordTelemetry(ctx context.Context, skillID, event string) error
- func (s *Store) RecordUpdateCheck(ctx context.Context, update AvailableUpdate) error
- func (s *Store) RemoveInstalledSkill(ctx context.Context, skillID string) error
- func (s *Store) ReplaceCurations(ctx context.Context, entries []SkillCuration) error
- func (s *Store) RerankSemantic(queryVector []float32, results []SearchResult) []SearchResult
- func (s *Store) Search(ctx context.Context, query SearchQuery) (*SearchResponse, error)
- func (s *Store) SearchKeywordCandidates(ctx context.Context, query SearchQuery) ([]SearchResult, error)
- func (s *Store) SetInstalledSkill(ctx context.Context, installed InstalledSkill) error
- func (s *Store) SetSourceEnabled(ctx context.Context, sourceID string, enabled bool) error
- func (s *Store) SetSourceEnabledByIdentity(ctx context.Context, sourceID, sourceType, baseURL string, enabled bool) error
- func (s *Store) UpdateSkillEmbedding(ctx context.Context, skillID, embeddingJSON, embeddingModel string) error
- func (s *Store) UpsertCurationSyncState(ctx context.Context, state CurationSyncState) error
- func (s *Store) UpsertSkill(ctx context.Context, doc *SkillDocument, version *SkillVersion, ...) error
- func (s *Store) UpsertSkillBatch(ctx context.Context, records []*SkillUpsertRecord) (*SkillBatchUpsertResult, error)
- func (s *Store) UpsertSource(ctx context.Context, source Source) error
- type VulnProvider
Constants ¶
View Source
const ( DefaultDBFilename = "blue.db" DefaultPageSize = 20 DefaultSearchLimit = 100 DefaultDiscoverTimeout = 8 * time.Minute DefaultDiscoverStepTimeout = 90 * time.Second RiskLow = "low" RiskMedium = "medium" RiskHigh = "high" RiskCritical = "critical" BadgeGreen = "green" BadgeYellow = "yellow" BadgeRed = "red" InstallTypeBuiltinCommands = "builtin_commands" InstallTypeRawSkill = "raw_skill" InstallTypeGitRepo = "git_repo" InstallTypeSourceArchive = "source_archive" InstallTypeScriptPackage = "script_package" InstallTypeBinaryPackage = "binary_package" InstallTypeManualExternal = "manual_external" ArtifactKindOpenSource = "open_source" ArtifactKindClosedBinary = "closed_binary" ArtifactKindMixed = "mixed" ArtifactKindUnknown = "unknown" VulnerabilityStatusNone = "none" VulnerabilityStatusUnknown = "unknown" VulnerabilityStatusSuspected = "suspected" VulnerabilityStatusDetected = "detected" VulnerabilityStatusNotApplicable = "not_applicable" ScannerVersion = "skillmarket-detector-v2" GitHubAwesomeSkillsSourceID = "github-awesome-skills" GitHubAwesomeSkillsSourceName = "GitHub Awesome Skills" GitHubAwesomeSkillsSourceGroup = "github-awesome-skills" )
Variables ¶
This section is empty.
Functions ¶
func DefaultDBPath ¶
func NormalizeSkillID ¶
NormalizeSkillID converts a human-provided skill identifier into a safe slug.
func ValidateSkillID ¶
ValidateSkillID rejects identifiers that could escape installation roots or create ambiguous paths.
Types ¶
type AdditionalSeed ¶
type AdditionalSeed struct {
ID string `yaml:"id" json:"id"`
Type string `yaml:"type" json:"type"`
Value string `yaml:"value" json:"value"`
DisplayName string `yaml:"display_name" json:"display_name"`
SourceGroup string `yaml:"source_group" json:"source_group"`
OriginName string `yaml:"origin_name" json:"origin_name"`
}
type AvailableUpdate ¶
type AvailableUpdate struct {
SkillID string `json:"skill_id"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
CurrentChecksum string `json:"current_checksum"`
LatestChecksum string `json:"latest_checksum"`
Action string `json:"action"`
CheckedAt time.Time `json:"checked_at"`
}
type Classifier ¶
type Config ¶
type Config struct {
Enabled bool
DBPath string
GitHubToken string
GitHubAPIBaseURL string
ClawHubBaseURL string
ClawHubMirrorBaseURLs []string
TencentSkillHubAPIBaseURL string
SkillHubBaseURL string
SkillHubAPIKey string
LLMSkillsBaseURL string
DiscoveryPageURLs []string
CrawlIncrementalInterval time.Duration
CrawlFullInterval time.Duration
UpdateCheckInterval time.Duration
TelemetryRollupInterval time.Duration
SemanticRatio float64
SearchCandidateLimit int
CacheRoot string
ActiveSkillsDir string
CuratedConfigPath string
CuratedConfigURLs []string
LightmakePageSize int
GitHubSearchPageSize int
IngestBatchSize int
HTMLCatalogCrawlBatchPages int
HTMLCatalogCrawlMaxPages int
SeedPageMaxConcurrency int
DiscoverTimeout time.Duration
DiscoverStepTimeout time.Duration
}
func DefaultConfig ¶
type CrawlRun ¶
type CrawlRun struct {
ID string `json:"id"`
SourceID string `json:"source_id"`
Status string `json:"status"`
Discovered int `json:"discovered"`
Updated int `json:"updated"`
Failed int `json:"failed"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
ErrorText string `json:"error_text,omitempty"`
}
type CuratedConfig ¶
type CuratedConfig struct {
Version string `yaml:"version" json:"version"`
Featured []CurationEntry `yaml:"featured" json:"featured"`
Boosts []CurationEntry `yaml:"boosts" json:"boosts"`
Hidden []string `yaml:"hidden" json:"hidden"`
AdditionalSeeds []AdditionalSeed `yaml:"additional_seeds" json:"additional_seeds"`
}
type CurationEntry ¶
type CurationSyncState ¶
type DiscoverProgressEvent ¶
type DiscoverProgressEvent struct {
Running bool `json:"running"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
LastError string `json:"last_error,omitempty"`
TotalSources int `json:"total_sources,omitempty"`
ProcessedSources int `json:"processed_sources,omitempty"`
CurrentSourceID string `json:"current_source_id,omitempty"`
CurrentSourceName string `json:"current_source_name,omitempty"`
SourceResults []DiscoverSourceResult `json:"source_results,omitempty"`
Result *DiscoverResult `json:"result,omitempty"`
BatchInserted int `json:"batch_inserted,omitempty"`
BatchUpdated int `json:"batch_updated,omitempty"`
BatchFailed int `json:"batch_failed,omitempty"`
Phase string `json:"phase,omitempty"`
}
type DiscoverResult ¶
type DiscoverResult struct {
SourcesProcessed int `json:"sources_processed"`
Discovered int `json:"discovered"`
Updated int `json:"updated"`
Failed int `json:"failed"`
SourceResults []DiscoverSourceResult `json:"source_results,omitempty"`
}
type DiscoverSourceResult ¶
type DiscoverSourceResult struct {
SourceID string `json:"source_id"`
Status string `json:"status"`
Partial bool `json:"partial,omitempty"`
Discovered int `json:"discovered"`
Updated int `json:"updated"`
Failed int `json:"failed"`
Warnings []string `json:"warnings,omitempty"`
Pages int `json:"pages,omitempty"`
Requests int `json:"requests,omitempty"`
}
type DiscoverStatus ¶
type DiscoverStatus struct {
Running bool `json:"running"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
LastError string `json:"last_error,omitempty"`
TotalSources int `json:"total_sources,omitempty"`
ProcessedSources int `json:"processed_sources,omitempty"`
CurrentSourceID string `json:"current_source_id,omitempty"`
CurrentSourceName string `json:"current_source_name,omitempty"`
SourceResults []DiscoverSourceResult `json:"source_results,omitempty"`
Result *DiscoverResult `json:"result,omitempty"`
}
type EmbeddingProgressEvent ¶
type EmbeddingProgressEvent struct {
Running bool `json:"running"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
LastError string `json:"last_error,omitempty"`
TotalSkills int `json:"total_skills,omitempty"`
ProcessedSkills int `json:"processed_skills,omitempty"`
EmbeddedSkills int `json:"embedded_skills,omitempty"`
FailedSkills int `json:"failed_skills,omitempty"`
CurrentSkillID string `json:"current_skill_id,omitempty"`
CurrentSkillName string `json:"current_skill_name,omitempty"`
Phase string `json:"phase,omitempty"`
}
type EmbeddingStatus ¶
type EmbeddingStatus struct {
Running bool `json:"running"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
LastError string `json:"last_error,omitempty"`
TotalSkills int `json:"total_skills,omitempty"`
ProcessedSkills int `json:"processed_skills,omitempty"`
EmbeddedSkills int `json:"embedded_skills,omitempty"`
FailedSkills int `json:"failed_skills,omitempty"`
CurrentSkillID string `json:"current_skill_id,omitempty"`
CurrentSkillName string `json:"current_skill_name,omitempty"`
Phase string `json:"phase,omitempty"`
}
type FilterOption ¶
type InstallRequest ¶
type InstallResult ¶
type InstallResult struct {
SkillID string `json:"skill_id"`
Version string `json:"version"`
Path string `json:"path"`
CachePath string `json:"cache_path"`
Warnings []string `json:"warnings,omitempty"`
Security *SecurityReport `json:"security,omitempty"`
InstalledAt time.Time `json:"installed_at"`
}
type InstallSurface ¶
type InstalledSkill ¶
type InstalledSkill struct {
SkillID string `json:"skill_id"`
Name string `json:"name,omitempty"`
InstalledVersion string `json:"installed_version"`
Checksum string `json:"checksum"`
SourceURL string `json:"source_url,omitempty"`
Enabled bool `json:"enabled"`
AutoUpdate bool `json:"auto_update"`
InstalledAt time.Time `json:"installed_at"`
UpdatedAt time.Time `json:"updated_at"`
LastSecurityScore int `json:"last_security_score"`
LatestVersion string `json:"latest_version,omitempty"`
UpdateAvailable bool `json:"update_available"`
LatestChecksum string `json:"latest_checksum,omitempty"`
PendingUpdateState string `json:"pending_update_state,omitempty"`
SecurityBadge string `json:"security_badge,omitempty"`
}
type LLMClassifier ¶
type LLMClassifier struct {
// contains filtered or unexported fields
}
func NewLLMClassifier ¶
func NewLLMClassifier(registry *llm.ProviderRegistry, provider, model string) *LLMClassifier
type NoopVulnProvider ¶
type NoopVulnProvider struct{}
func (NoopVulnProvider) Analyze ¶
func (NoopVulnProvider) Analyze(_ context.Context, surface InstallSurface) (string, []string, error)
type Options ¶
type Options struct {
Config Config
Logger *zap.Logger
Registry *skill.Registry
LocalScanner *skillstore.LocalSkillScanner
EmbeddingProvider embedding.Provider
HTTPClient *http.Client
RemoteReader RemoteReader
Scanner *Scanner
DiscoverEventBroadcaster func(eventType string, data any)
}
type RemoteCrawlCheckpoint ¶
type RemoteCrawlCheckpoint struct {
Pending []RemoteCrawlQueueItem `json:"pending,omitempty"`
Seen []string `json:"seen,omitempty"`
Completed int `json:"completed,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
type RemoteCrawlFailure ¶
type RemoteCrawlPage ¶
type RemoteCrawlPage struct {
URL string `json:"url"`
FinalURL string `json:"final_url,omitempty"`
Title string `json:"title,omitempty"`
Depth int `json:"depth"`
StatusCode int `json:"status_code,omitempty"`
Content string `json:"content,omitempty"`
Source string `json:"source,omitempty"`
Warnings []string `json:"warnings,omitempty"`
InteractiveRequired bool `json:"interactive_required,omitempty"`
Links []string `json:"links,omitempty"`
Truncated bool `json:"truncated,omitempty"`
RawHTML string `json:"raw_html,omitempty"`
ContentType string `json:"content_type,omitempty"`
}
type RemoteCrawlQueueItem ¶
type RemoteCrawlRequest ¶
type RemoteCrawlResult ¶
type RemoteCrawlResult struct {
Pages []RemoteCrawlPage `json:"pages,omitempty"`
Failures []RemoteCrawlFailure `json:"failures,omitempty"`
Checkpoint RemoteCrawlCheckpoint `json:"checkpoint"`
Stats map[string]int `json:"stats,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type RemoteReadRequest ¶
type RemoteReadResult ¶
type RemoteReadResult struct {
URL string `json:"url,omitempty"`
FinalURL string `json:"final_url,omitempty"`
Title string `json:"title,omitempty"`
Content string `json:"content,omitempty"`
Source string `json:"source,omitempty"`
Warnings []string `json:"warnings,omitempty"`
InteractiveRequired bool `json:"interactive_required,omitempty"`
StatusCode int `json:"status_code,omitempty"`
Links []string `json:"links,omitempty"`
ContentType string `json:"content_type,omitempty"`
RawHTML string `json:"raw_html,omitempty"`
Truncated bool `json:"truncated,omitempty"`
}
type RemoteReader ¶
type RemoteReader interface {
ReadURL(ctx context.Context, req RemoteReadRequest) (*RemoteReadResult, error)
CrawlSite(ctx context.Context, req RemoteCrawlRequest) (*RemoteCrawlResult, error)
}
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner(classifier Classifier) *Scanner
func (*Scanner) ScanWithSurface ¶
func (s *Scanner) ScanWithSurface(ctx context.Context, skillID, version, content string, declaredPermissions []string, surface InstallSurface) *SecurityReport
type SearchQuery ¶
type SearchQuery struct {
Query string
Category string
Categories []string
Sources []string
RiskBadges []string
InstallTypes []string
ArtifactKinds []string
Sort string
Page int
PageSize int
Semantic bool
Installable *bool
Curated *bool
OpenSourceOnly bool
HasVulnerabilities *bool
HasPromptInjection *bool
HasShellInjection *bool
HasDataExfiltration *bool
}
type SearchResponse ¶
type SearchResponse struct {
Skills []SearchResult `json:"skills"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
}
type SearchResult ¶
type SearchResult struct {
Skill SkillDocument `json:"skill"`
Score float64 `json:"score"`
KeywordScore float64 `json:"keyword_score,omitempty"`
SemanticScore float64 `json:"semantic_score,omitempty"`
MatchSource string `json:"match_source,omitempty"`
}
type SecurityEvidence ¶
type SecurityFinding ¶
type SecurityReport ¶
type SecurityReport struct {
ID string `json:"id"`
SkillVersionID string `json:"skill_version_id"`
SkillID string `json:"skill_id"`
Version string `json:"version"`
Score int `json:"score"`
RiskLevel string `json:"risk_level"`
SecurityBadge string `json:"security_badge"`
VulnerabilityStatus string `json:"vulnerability_status"`
Risks []SecurityFinding `json:"risks"`
Permissions []string `json:"permissions"`
Secrets []string `json:"secrets"`
Vulnerabilities []string `json:"vulnerabilities,omitempty"`
InstallSurface InstallSurface `json:"install_surface"`
Evidence []SecurityEvidence `json:"evidence,omitempty"`
HasVulnerabilities bool `json:"has_vulnerabilities"`
HasPromptInjection bool `json:"has_prompt_injection"`
HasShellInjection bool `json:"has_shell_injection"`
HasDataExfiltration bool `json:"has_data_exfiltration"`
HasBinary bool `json:"has_binary"`
ScannerVersion string `json:"scanner_version"`
LLMStatus string `json:"llm_status"`
LLMVerdictJSON string `json:"llm_verdict_json,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewServiceWithDBPath ¶
func NewServiceWithReadDB ¶
func (*Service) CheckForUpdates ¶
func (*Service) GetDiscoverStatus ¶
func (s *Service) GetDiscoverStatus() DiscoverStatus
func (*Service) GetEmbeddingStatus ¶
func (s *Service) GetEmbeddingStatus() EmbeddingStatus
func (*Service) GetSecurity ¶
func (*Service) Install ¶
func (s *Service) Install(ctx context.Context, req InstallRequest) (*InstallResult, error)
func (*Service) ListInstalled ¶
func (s *Service) ListInstalled(ctx context.Context) ([]InstalledSkill, error)
func (*Service) ListUpdates ¶
func (s *Service) ListUpdates(ctx context.Context) ([]AvailableUpdate, error)
func (*Service) Search ¶
func (s *Service) Search(ctx context.Context, query SearchQuery) (*SearchResponse, error)
func (*Service) StartDiscoverAsync ¶
func (s *Service) StartDiscoverAsync() (DiscoverStatus, bool)
type SkillBatchUpsertResult ¶
type SkillCuration ¶
type SkillCuration struct {
ID string `json:"id"`
SkillID string `json:"skill_id"`
Hidden bool `json:"hidden"`
FeaturedRank int `json:"featured_rank"`
BoostWeight float64 `json:"boost_weight"`
Label string `json:"label,omitempty"`
Reason string `json:"reason,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SkillDetail ¶
type SkillDetail struct {
Skill SkillDocument `json:"skill"`
Version *SkillVersion `json:"version,omitempty"`
Security *SecurityReport `json:"security,omitempty"`
Installed bool `json:"installed"`
Enabled bool `json:"enabled"`
}
type SkillDocument ¶
type SkillDocument struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
Author string `json:"author,omitempty"`
RepoURL string `json:"repo_url,omitempty"`
Homepage string `json:"homepage,omitempty"`
DownloadURL string `json:"download_url,omitempty"`
Stars int `json:"stars"`
Downloads int `json:"downloads"`
Tags []string `json:"tags,omitempty"`
Category string `json:"category,omitempty"`
SecurityScore int `json:"security_score"`
Permissions []string `json:"permissions,omitempty"`
LatestVersion string `json:"latest_version,omitempty"`
RiskLevel string `json:"risk_level"`
SecurityBadge string `json:"security_badge"`
Installable bool `json:"installable"`
InstallType string `json:"install_type,omitempty"`
ArtifactKind string `json:"artifact_kind,omitempty"`
VulnerabilityStatus string `json:"vulnerability_status"`
HasVulnerabilities bool `json:"has_vulnerabilities"`
HasPromptInjection bool `json:"has_prompt_injection"`
HasShellInjection bool `json:"has_shell_injection"`
HasDataExfiltration bool `json:"has_data_exfiltration"`
HasBinary bool `json:"has_binary"`
HasScripts bool `json:"has_scripts"`
PopularityScore float64 `json:"popularity_score"`
TrendingScore float64 `json:"trending_score"`
ScanStatus string `json:"scan_status,omitempty"`
ContentSHA256 string `json:"content_sha256,omitempty"`
Published bool `json:"published"`
SourceID string `json:"source_id,omitempty"`
SourceName string `json:"source_name,omitempty"`
SourceGroup string `json:"source_group,omitempty"`
OriginSourceID string `json:"origin_source_id,omitempty"`
OriginSourceName string `json:"origin_source_name,omitempty"`
OriginSourceURL string `json:"origin_source_url,omitempty"`
SourceType string `json:"source_type,omitempty"`
SkillPath string `json:"skill_path,omitempty"`
SkillContent string `json:"skill_content,omitempty"`
EmbeddingJSON string `json:"embedding_json,omitempty"`
EmbeddingModel string `json:"embedding_model,omitempty"`
CuratedRank int `json:"curated_rank,omitempty"`
CuratedBoost float64 `json:"curated_boost,omitempty"`
CuratedLabel string `json:"curated_label,omitempty"`
CuratedReason string `json:"curated_reason,omitempty"`
LastUpdated time.Time `json:"last_updated"`
LastCrawledAt time.Time `json:"last_crawled_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SkillFilters ¶
type SkillFilters struct {
Categories []FilterOption `json:"categories"`
Sources []FilterOption `json:"sources"`
RiskBadges []FilterOption `json:"risk_badges"`
InstallTypes []FilterOption `json:"install_types"`
ArtifactKinds []FilterOption `json:"artifact_kinds"`
Installable map[string]int `json:"installable"`
SecuritySignals map[string]int `json:"security_signals"`
}
type SkillUpsertRecord ¶
type SkillUpsertRecord struct {
Doc *SkillDocument
Version *SkillVersion
Report *SecurityReport
}
type SkillVersion ¶
type SkillVersion struct {
ID string `json:"id"`
SkillID string `json:"skill_id"`
Version string `json:"version"`
CommitHash string `json:"commit_hash,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Checksum string `json:"checksum,omitempty"`
SkillPath string `json:"skill_path,omitempty"`
RawSkillMD string `json:"raw_skill_md,omitempty"`
ManifestJSON string `json:"manifest_json,omitempty"`
ReleasedAt time.Time `json:"released_at"`
ScannedAt time.Time `json:"scanned_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Source ¶
type Source struct {
ID string `json:"id"`
Type string `json:"type"`
BaseURL string `json:"base_url"`
DisplayName string `json:"display_name,omitempty"`
SourceGroup string `json:"source_group,omitempty"`
MirrorOf string `json:"mirror_of,omitempty"`
AuthMode string `json:"auth_mode,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Enabled bool `json:"enabled"`
LastCursor string `json:"last_cursor,omitempty"`
ETag string `json:"etag,omitempty"`
RateLimitPerMinute int `json:"rate_limit_per_minute"`
Priority int `json:"priority"`
LastSuccessAt time.Time `json:"last_success_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SourceSecuritySignals ¶
type SourceSecuritySignals struct {
Score *int `json:"score,omitempty"`
RiskLevel string `json:"risk_level,omitempty"`
SecurityBadge string `json:"security_badge,omitempty"`
VulnerabilityStatus string `json:"vulnerability_status,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Vulnerabilities []string `json:"vulnerabilities,omitempty"`
HasVulnerabilities bool `json:"has_vulnerabilities,omitempty"`
HasPromptInjection bool `json:"has_prompt_injection,omitempty"`
HasShellInjection bool `json:"has_shell_injection,omitempty"`
HasDataExfiltration bool `json:"has_data_exfiltration,omitempty"`
HasBinary bool `json:"has_binary,omitempty"`
HasScripts bool `json:"has_scripts,omitempty"`
InstallType string `json:"install_type,omitempty"`
ArtifactKind string `json:"artifact_kind,omitempty"`
Installable *bool `json:"installable,omitempty"`
Findings []SecurityFinding `json:"findings,omitempty"`
Evidence []SecurityEvidence `json:"evidence,omitempty"`
ScannerVersion string `json:"scanner_version,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) BeginCrawlRun ¶
func (*Store) CompleteCrawlRun ¶
func (*Store) GetCurationSyncState ¶
func (*Store) GetFilters ¶
func (s *Store) GetFilters(ctx context.Context) (*SkillFilters, error)
func (*Store) GetInstalledSkill ¶
func (*Store) GetLatestVersion ¶
func (*Store) GetSecurityReport ¶
func (*Store) GetSkillVersion ¶
func (*Store) ListFeatured ¶
func (*Store) ListFilteredSkills ¶
func (s *Store) ListFilteredSkills(ctx context.Context, query SearchQuery) ([]SkillDocument, error)
func (*Store) ListInstalledSkills ¶
func (s *Store) ListInstalledSkills(ctx context.Context) ([]InstalledSkill, error)
func (*Store) ListTrending ¶
func (*Store) ListUpdates ¶
func (s *Store) ListUpdates(ctx context.Context) ([]AvailableUpdate, error)
func (*Store) RecordTelemetry ¶
func (*Store) RecordUpdateCheck ¶
func (s *Store) RecordUpdateCheck(ctx context.Context, update AvailableUpdate) error
func (*Store) RemoveInstalledSkill ¶
func (*Store) ReplaceCurations ¶
func (s *Store) ReplaceCurations(ctx context.Context, entries []SkillCuration) error
func (*Store) RerankSemantic ¶
func (s *Store) RerankSemantic(queryVector []float32, results []SearchResult) []SearchResult
func (*Store) Search ¶
func (s *Store) Search(ctx context.Context, query SearchQuery) (*SearchResponse, error)
func (*Store) SearchKeywordCandidates ¶
func (s *Store) SearchKeywordCandidates(ctx context.Context, query SearchQuery) ([]SearchResult, error)
func (*Store) SetInstalledSkill ¶
func (s *Store) SetInstalledSkill(ctx context.Context, installed InstalledSkill) error
func (*Store) SetSourceEnabled ¶
func (*Store) SetSourceEnabledByIdentity ¶
func (*Store) UpdateSkillEmbedding ¶
func (*Store) UpsertCurationSyncState ¶
func (s *Store) UpsertCurationSyncState(ctx context.Context, state CurationSyncState) error
func (*Store) UpsertSkill ¶
func (s *Store) UpsertSkill(ctx context.Context, doc *SkillDocument, version *SkillVersion, report *SecurityReport) error
func (*Store) UpsertSkillBatch ¶
func (s *Store) UpsertSkillBatch(ctx context.Context, records []*SkillUpsertRecord) (*SkillBatchUpsertResult, error)
type VulnProvider ¶
Click to show internal directories.
Click to hide internal directories.