Documentation
¶
Overview ¶
Package registry provides the client interface for accessing the devlore registry. It abstracts the underlying transport (git for demo, OCI for scale) and provides a sync-based API where the registry is cloned/pulled locally and accessed from cache.
Index ¶
- Constants
- Variables
- func ParsePackagePrefix(name string) (string, string)
- func PhaseOrder(op Operation) []string
- func PlatformResolutionOrder(platform string) []string
- func RequiredPhase(op Operation) string
- type CacheStats
- type Confidence
- type ExampleEntry
- type Feature
- type GitProvider
- func (g *GitProvider) Branch() string
- func (g *GitProvider) CheckoutVersion(ctx context.Context, cacheDir, version string) error
- func (g *GitProvider) CurrentRef(ctx context.Context, cacheDir string) (string, error)
- func (g *GitProvider) CurrentVersion(ctx context.Context, cacheDir string) (string, error)
- func (g *GitProvider) HasTag(ctx context.Context, cacheDir, tag string) (bool, error)
- func (g *GitProvider) ListVersions(ctx context.Context, cacheDir string) ([]string, error)
- func (g *GitProvider) Name() string
- func (g *GitProvider) RepoURL() string
- func (g *GitProvider) ResolveVersion(ctx context.Context, cacheDir, version string) (string, error)
- func (g *GitProvider) Sync(ctx context.Context, cacheDir string, opts SyncOptions) (*SyncResult, error)
- type HardwareProvision
- type KnowledgeDomain
- func (k *KnowledgeDomain) Examples(name string) ([]byte, error)
- func (k *KnowledgeDomain) Index() (*KnowledgeIndex, error)
- func (k *KnowledgeDomain) Prompt(name string) (string, error)
- func (k *KnowledgeDomain) Providers(name string) ([]byte, error)
- func (k *KnowledgeDomain) Schema(name string) ([]byte, error)
- func (k *KnowledgeDomain) Signature(name string) ([]byte, error)
- func (k *KnowledgeDomain) Slots(name string) ([]byte, error)
- func (k *KnowledgeDomain) Transform(name string) ([]byte, error)
- type KnowledgeIndex
- type Lifecycle
- func (l *Lifecycle) DiscoverAllPhases(packageDir, platform string, op Operation) map[string][]string
- func (l *Lifecycle) DiscoverPhaseScripts(packageDir, platform string, op Operation, phase string) []string
- func (l *Lifecycle) EnabledFeatures(explicit []string) []string
- func (l *Lifecycle) GetPhaseScript(packageDir, platform string, op Operation, phase string) string
- func (l *Lifecycle) HasPhase(packageDir, platform string, op Operation, phase string) bool
- func (l *Lifecycle) IsSynthetic() bool
- func (l *Lifecycle) ResolvedSettings(explicit map[string]string) map[string]string
- func (l *Lifecycle) SupportsPlatform(platform string) bool
- type NativePMAction
- type Operation
- type PMOperation
- type PackageSource
- type PhaseAction
- type PhaseActionType
- type PromptEntry
- type Provider
- type Registry
- func (r *Registry) Branch() string
- func (r *Registry) CacheDir() string
- func (r *Registry) CheckoutVersion(ctx context.Context, version string) error
- func (r *Registry) CurrentVersion(ctx context.Context) (string, error)
- func (r *Registry) Exists() bool
- func (r *Registry) FileExists(relPath string) bool
- func (r *Registry) FilePath(relPath string) string
- func (r *Registry) ForceTags() bool
- func (r *Registry) Knowledge(domain string) *KnowledgeDomain
- func (r *Registry) ListPackages() ([]SearchResultItem, error)
- func (r *Registry) ListVersions(ctx context.Context) ([]string, error)
- func (r *Registry) Open(relPath string) (io.ReadCloser, error)
- func (r *Registry) ReadDir(relPath string) ([]os.DirEntry, error)
- func (r *Registry) ReadFile(relPath string) ([]byte, error)
- func (r *Registry) Resolve(name string, platform string) (*Release, error)
- func (r *Registry) ResolveVersion(ctx context.Context, version string) (string, error)
- func (r *Registry) ResolveWithConfidence(name string, platform string) (*Release, Confidence, error)
- func (r *Registry) Search(query string, opts SearchOptions) ([]SearchResultItem, error)
- func (r *Registry) SignatureIndex() map[string]map[string]string
- func (r *Registry) Sync(ctx context.Context, opts SyncOptions) (*SyncResult, error)
- func (r *Registry) SyncInfo() (*SyncInfo, error)
- func (r *Registry) SyntheticCache() *SyntheticCache
- func (r *Registry) VerifySyntheticPackage(pkg *Release) bool
- type RegistryConfig
- type Release
- func (rel *Release) DiscoverPhaseScripts(platform string, op Operation, phase string) []string
- func (rel *Release) HasPhase(platform string, op Operation, phase string) bool
- func (rel *Release) IsNative() bool
- func (rel *Release) IsSynthetic() bool
- func (rel *Release) Lifecycle() *Lifecycle
- func (rel *Release) PhaseActions(platform string, op Operation, phase string) []PhaseAction
- type SchemaEntry
- type ScriptAction
- type SearchOptions
- type SearchResultItem
- type Setting
- type SignatureEntry
- type Signatures
- type SlotEntry
- type SyncInfo
- type SyncOptions
- type SyncResult
- type SyntheticCache
- func (c *SyntheticCache) Clear() error
- func (c *SyntheticCache) ClearSource(source PackageSource) error
- func (c *SyntheticCache) Delete(source PackageSource, name string) error
- func (c *SyntheticCache) Get(source PackageSource, name string) *SyntheticPackageInfo
- func (c *SyntheticCache) List() ([]SyntheticPackageInfo, error)
- func (c *SyntheticCache) Put(info *SyntheticPackageInfo) error
- func (c *SyntheticCache) Stats() (*CacheStats, error)
- type SyntheticPackageInfo
- type TransformEntry
Constants ¶
const ( DefaultRegistryURL = "https://github.com/NobleFactor/devlore-registry.git" DefaultRegistryBranch = "develop" // develop branch has AI assets; main is release-only )
Default registry settings.
Variables ¶
var DecommissionPhaseOrder = []string{"unprovision", "uninstall", "cleanup"}
DecommissionPhaseOrder is the order for decommission operations.
var DeployPhaseOrder = []string{"prepare", "install", "provision", "verify"}
DeployPhaseOrder is the standard order of deploy pipeline phases.
var LifecycleSchema []byte
LifecycleSchema is the JSON schema for lifecycle.yaml files. These files define lore package metadata. Phase scripts are discovered from the directory structure (see RFC Section 9.3).
var UpgradePhaseOrder = []string{"prepare", "upgrade", "migrate", "verify"}
UpgradePhaseOrder is the order for upgrade operations. The "migrate" phase handles version-specific migrations (config format changes, data migrations, etc.) that may be needed between versions.
Functions ¶
func ParsePackagePrefix ¶
ParsePackagePrefix extracts the package manager prefix from a package name. On Darwin, packages can be prefixed to explicitly select the package manager:
- brew: — Homebrew formula (CLI tools)
- cask: — Homebrew Cask (GUI applications)
- port: — MacPorts
Without a prefix, auto-detection is used (port if installed, else brew).
Examples:
"brew:wget" → ("wget", "brew")
"cask:iterm2" → ("iterm2", "cask")
"port:wget" → ("wget", "port")
"wget" → ("wget", "")
Returns (packageName, prefix) where prefix is "brew", "cask", "port", or "" for auto-detect.
func PhaseOrder ¶
PhaseOrder returns the phase order for an operation.
func PlatformResolutionOrder ¶
PlatformResolutionOrder returns the order of platform directories for phase script chaining, from most general to most specific.
Scripts are executed in this order, allowing specific platforms to build upon general setup. Each script that exists is executed.
Examples:
- "Linux.Debian" → ["Common", "Unix", "Linux", "Linux.Debian"]
- "Darwin" → ["Common", "Unix", "Darwin"]
- "Windows" → ["Common", "Windows"]
func RequiredPhase ¶
RequiredPhase returns the required phase for an operation. Each operation has exactly one required phase that must be implemented. Native PM packages implement only this phase; lore packages may add others.
- Deploy requires "install"
- Upgrade requires "upgrade"
- Decommission requires "uninstall"
Types ¶
type CacheStats ¶
type CacheStats struct {
TotalPackages int
VerifiedPackages int
ExpiredPackages int
BySource map[PackageSource]int
}
Stats returns cache statistics.
type Confidence ¶
type Confidence int
Confidence indicates how reliably a package can be installed.
const ( // ConfidenceHigh means the package is from the lore registry with full lifecycle support. ConfidenceHigh Confidence = iota // ConfidenceMedium means the package was found in a native PM and verified to exist. ConfidenceMedium // ConfidenceLow means the package was synthesized but not verified to exist. ConfidenceLow )
func (Confidence) String ¶
func (c Confidence) String() string
type ExampleEntry ¶
type ExampleEntry struct {
Name string `yaml:"name"`
Purpose string `yaml:"purpose,omitempty"`
Description string `yaml:"description,omitempty"`
}
ExampleEntry describes an examples asset with discovery metadata.
type Feature ¶
type Feature struct {
Description string `yaml:"description"`
Default bool `yaml:"default"`
Platforms []string `yaml:"platforms,omitempty"`
}
Feature represents a package feature definition.
type GitProvider ¶
type GitProvider struct {
// contains filtered or unexported fields
}
GitProvider implements the Provider interface using git. This is the demo-phase provider per ADR-014.
Versioning model:
- Tags represent package versions (e.g., v1.0.0, v1.2.3)
- "latest" is a special tag tracking the latest release
- On main branch: "latest" resolves to the "latest" tag
- On other branches: "latest" resolves to HEAD (dev convenience)
func NewGitProvider ¶
func NewGitProvider(repoURL, branch string) *GitProvider
NewGitProvider creates a new git-based registry provider.
func (*GitProvider) Branch ¶
func (g *GitProvider) Branch() string
Branch returns the configured branch.
func (*GitProvider) CheckoutVersion ¶
func (g *GitProvider) CheckoutVersion(ctx context.Context, cacheDir, version string) error
CheckoutVersion checks out a specific version (tag or ref) in the cache. This is used when a user requests a specific package version.
func (*GitProvider) CurrentRef ¶
CurrentRef returns the current HEAD ref in the cache.
func (*GitProvider) CurrentVersion ¶
CurrentVersion returns the version tag at HEAD, or "" if HEAD is not tagged.
func (*GitProvider) ListVersions ¶
ListVersions returns all available version tags from the repository. Tags are returned in descending semver order (newest first). Non-semver tags are excluded.
func (*GitProvider) RepoURL ¶
func (g *GitProvider) RepoURL() string
RepoURL returns the configured repository URL.
func (*GitProvider) ResolveVersion ¶
ResolveVersion resolves a version string to a git ref.
Resolution rules:
- "latest" on main branch → resolves to "latest" tag
- "latest" on other branches → resolves to HEAD
- Semver (e.g., "v1.0.0", "1.0.0") → resolves to that tag
- Empty string → same as "latest"
func (*GitProvider) Sync ¶
func (g *GitProvider) Sync(ctx context.Context, cacheDir string, opts SyncOptions) (*SyncResult, error)
Sync clones or updates the registry cache. Per ADR-014, uses shallow clone and hard reset (cache semantics, not workspace).
type HardwareProvision ¶
type HardwareProvision struct {
Description string `yaml:"description"`
Reference string `yaml:"reference,omitempty"`
BootArg string `yaml:"boot_arg,omitempty"`
}
HardwareProvision defines hardware-specific configuration.
type KnowledgeDomain ¶
type KnowledgeDomain struct {
// contains filtered or unexported fields
}
KnowledgeDomain provides access to knowledge assets within a domain. Methods correspond to subdirectories in the knowledge/{domain}/ structure. Assets are resolved with fallback to the "shared" domain.
func (*KnowledgeDomain) Examples ¶
func (k *KnowledgeDomain) Examples(name string) ([]byte, error)
Examples reads an examples file from knowledge/{domain}/examples/{name}. Falls back to knowledge/shared/examples/{name} if not found in domain.
func (*KnowledgeDomain) Index ¶
func (k *KnowledgeDomain) Index() (*KnowledgeIndex, error)
Index loads the index.yaml manifest for this knowledge domain. Returns nil if the index doesn't exist (domain may have no indexed assets).
func (*KnowledgeDomain) Prompt ¶
func (k *KnowledgeDomain) Prompt(name string) (string, error)
Prompt reads a prompt file from knowledge/{domain}/prompts/{name}. Falls back to knowledge/shared/prompts/{name} if not found in domain.
func (*KnowledgeDomain) Providers ¶
func (k *KnowledgeDomain) Providers(name string) ([]byte, error)
Providers reads a providers reference file from knowledge/{domain}/providers/{name}. Falls back to knowledge/shared/providers/{name} if not found in domain. This is typically used for model context limits and configuration.
func (*KnowledgeDomain) Schema ¶
func (k *KnowledgeDomain) Schema(name string) ([]byte, error)
Schema reads a JSON schema file from knowledge/{domain}/schemas/{name}. Falls back to knowledge/shared/schemas/{name} if not found in domain.
func (*KnowledgeDomain) Signature ¶
func (k *KnowledgeDomain) Signature(name string) ([]byte, error)
Signature reads a signature file from knowledge/{domain}/signatures/{name}. Falls back to knowledge/shared/signatures/{name} if not found in domain.
type KnowledgeIndex ¶
type KnowledgeIndex struct {
Domain string `yaml:"domain"`
Prompts []PromptEntry `yaml:"prompts,omitempty"`
Schemas []SchemaEntry `yaml:"schemas,omitempty"`
Examples []ExampleEntry `yaml:"examples,omitempty"`
Transforms []TransformEntry `yaml:"transforms,omitempty"`
Signatures []SignatureEntry `yaml:"signatures,omitempty"`
Slots []SlotEntry `yaml:"slots,omitempty"`
}
KnowledgeIndex represents the index.yaml manifest for a knowledge domain. It lists all available assets by type with metadata for discovery.
func (*KnowledgeIndex) PromptByPurpose ¶
func (idx *KnowledgeIndex) PromptByPurpose(purpose string) string
PromptByPurpose finds a prompt by its semantic purpose key. Returns empty string if not found.
func (*KnowledgeIndex) SchemaByPurpose ¶
func (idx *KnowledgeIndex) SchemaByPurpose(purpose string) string
SchemaByPurpose finds a schema by its semantic purpose key.
func (*KnowledgeIndex) SignatureNames ¶
func (idx *KnowledgeIndex) SignatureNames() []string
SignatureNames returns just the filenames for iteration.
func (*KnowledgeIndex) TransformBySourceSystem ¶
func (idx *KnowledgeIndex) TransformBySourceSystem(system string) string
TransformBySourceSystem finds a transform by the source system it handles.
type Lifecycle ¶
type Lifecycle struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Homepage string `yaml:"homepage,omitempty"`
Repository string `yaml:"repository,omitempty"`
License string `yaml:"license,omitempty"`
Maintainer string `yaml:"maintainer,omitempty"`
Aliases []string `yaml:"aliases,omitempty"`
Signatures Signatures `yaml:"signatures,omitempty"`
Platforms []string `yaml:"platforms"`
Provides []string `yaml:"provides,omitempty"`
Conflicts []string `yaml:"conflicts,omitempty"`
Features map[string]Feature `yaml:"features,omitempty"`
Settings map[string]Setting `yaml:"settings,omitempty"`
Tags []string `yaml:"tags,omitempty"`
Notes string `yaml:"notes,omitempty"`
// Verification defines how to verify the installation.
Verification struct {
Command string `yaml:"command,omitempty"`
Pattern string `yaml:"pattern,omitempty"`
} `yaml:"verification,omitempty"`
// HardwareProvisions defines hardware-specific configuration requirements.
HardwareProvisions map[string]HardwareProvision `yaml:"hardware_provisions,omitempty"`
// contains filtered or unexported fields
}
Lifecycle represents a lore package's lifecycle manifest. This is loaded from lifecycle.yaml in the package directory. Phase scripts are discovered from the directory structure, not from YAML.
func LoadLifecycle ¶
LoadLifecycle loads a lifecycle manifest from a package directory.
func (*Lifecycle) DiscoverAllPhases ¶
func (l *Lifecycle) DiscoverAllPhases(packageDir, platform string, op Operation) map[string][]string
DiscoverAllPhases returns a map of phase name to script paths for all phases in an operation on the given platform.
func (*Lifecycle) DiscoverPhaseScripts ¶
func (l *Lifecycle) DiscoverPhaseScripts(packageDir, platform string, op Operation, phase string) []string
DiscoverPhaseScripts returns all phase scripts for a phase, ordered from most general to most specific for chained execution.
Example for platform="Linux.Debian", op=OpDeploy, phase="install":
["Common/Deploy/install.star", "Unix/Deploy/install.star", "Linux/Deploy/install.star", "Linux.Debian/Deploy/install.star"]
Only scripts that exist are included.
func (*Lifecycle) EnabledFeatures ¶
EnabledFeatures returns the list of enabled features given explicit enables and the default settings.
func (*Lifecycle) GetPhaseScript ¶
GetPhaseScript returns the path to a single phase script for the given platform and operation. This finds the MOST SPECIFIC script only. For chained execution, use DiscoverPhaseScripts instead.
Returns empty string if no script exists for this phase.
func (*Lifecycle) HasPhase ¶
HasPhase returns true if at least one phase script exists for this phase on the given platform and operation.
func (*Lifecycle) IsSynthetic ¶
IsSynthetic returns true if this lifecycle was synthesized for a native PM package.
func (*Lifecycle) ResolvedSettings ¶
ResolvedSettings returns settings with defaults filled in.
func (*Lifecycle) SupportsPlatform ¶
SupportsPlatform returns true if the lifecycle supports the given platform.
type NativePMAction ¶
type NativePMAction struct {
// Manager identifies which package manager to use.
Manager PackageSource
// Operation is the PM operation (install, remove, update).
Operation PMOperation
// Packages is the list of package names to operate on.
Packages []string
// PhaseName is the phase this action belongs to.
PhaseName string
}
NativePMAction executes a native package manager operation.
func (*NativePMAction) Batchable ¶
func (a *NativePMAction) Batchable() bool
Batchable returns true if this action can be batched with others. Native PM install/upgrade/remove operations are batchable; update (index refresh) is not.
func (*NativePMAction) CanBatchWith ¶
func (a *NativePMAction) CanBatchWith(other *NativePMAction) bool
CanBatchWith returns true if this action can be batched with another. Actions can be batched if they have the same manager, operation, and phase.
func (*NativePMAction) Merge ¶
func (a *NativePMAction) Merge(other *NativePMAction) *NativePMAction
Merge combines this action with another, returning a new batched action. Returns nil if the actions cannot be batched.
func (*NativePMAction) Phase ¶
func (a *NativePMAction) Phase() string
Phase returns the phase name.
func (*NativePMAction) Type ¶
func (a *NativePMAction) Type() PhaseActionType
Type returns ActionNativePM.
type PMOperation ¶
type PMOperation int
PMOperation represents a native package manager operation.
const ( // PMInstall installs packages. PMInstall PMOperation = iota // PMRemove removes packages. PMRemove // PMUpdate refreshes the package index. PMUpdate // PMUpgrade upgrades installed packages. PMUpgrade )
func (PMOperation) String ¶
func (op PMOperation) String() string
String returns the operation name.
type PackageSource ¶
type PackageSource string
PackageSource indicates where a package was resolved from.
const ( SourceLore PackageSource = "lore" // Lore registry (full lifecycle) SourceApt PackageSource = "apt" // Debian/Ubuntu apt SourceDnf PackageSource = "dnf" // Fedora/RHEL dnf SourceBrew PackageSource = "brew" // macOS Homebrew SourcePort PackageSource = "port" // macOS MacPorts SourceWinget PackageSource = "winget" // Windows winget )
type PhaseAction ¶
type PhaseAction interface {
// Type returns the action type (script or native PM).
Type() PhaseActionType
// Phase returns the phase name this action belongs to.
Phase() string
}
PhaseAction represents an executable phase action. This provides a uniform interface for both Starlark scripts and native PM operations.
type PhaseActionType ¶
type PhaseActionType int
PhaseActionType distinguishes between script and native PM actions.
const ( // ActionScript is a Starlark phase script. ActionScript PhaseActionType = iota // ActionNativePM is a native package manager operation. ActionNativePM )
type PromptEntry ¶
type PromptEntry struct {
Name string `yaml:"name"`
Purpose string `yaml:"purpose,omitempty"` // semantic key for discovery
Description string `yaml:"description,omitempty"` // human-readable description
}
PromptEntry describes a prompt asset with discovery metadata.
type Provider ¶
type Provider interface {
// Sync updates the local cache from the remote registry.
// Returns information about what changed.
Sync(ctx context.Context, cacheDir string, opts SyncOptions) (*SyncResult, error)
// Name returns the provider type ("git", "oci", etc.)
Name() string
}
Provider abstracts the transport mechanism for registry access.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry provides access to a devlore registry.
func NewDefault ¶
NewDefault creates a registry with default settings for the central registry. Uses the develop branch during demo phase (AI assets and latest packages).
To customize registry settings, use NewFromConfig with values from ~/.config/devlore/config.yaml:
lore:
registry:
url: https://github.com/MyOrg/my-registry.git
branch: main
force_tags: true
func NewFromConfig ¶
func NewFromConfig(cfg RegistryConfig) (*Registry, error)
NewFromConfig creates a registry with the given configuration. Empty config values use defaults.
func NewWithConfig ¶
NewWithConfig creates a registry using configuration from viper. This is the preferred way to create a registry in lore commands.
func (*Registry) CheckoutVersion ¶
CheckoutVersion checks out a specific version in the cache.
func (*Registry) CurrentVersion ¶
CurrentVersion returns the version tag at HEAD, or "" if HEAD is not tagged.
func (*Registry) FileExists ¶
FileExists returns true if the file exists in the cache.
func (*Registry) ForceTags ¶
ForceTags returns whether tag resolution is forced (even on non-main branches).
func (*Registry) Knowledge ¶
func (r *Registry) Knowledge(domain string) *KnowledgeDomain
Knowledge returns a domain accessor for reading knowledge assets. The registry organizes knowledge by domain:
knowledge/migration/ - writ migrate prompts, transforms, signatures knowledge/onboarding/ - environment initialization knowledge/package-authoring/ - lore package creation knowledge/shared/ - common assets inherited by all domains
Usage:
registry.Knowledge("migration").Prompt("migrate-to-writ.txt")
registry.Knowledge("migration").Transform("from-stow.yaml")
func (*Registry) ListPackages ¶
func (r *Registry) ListPackages() ([]SearchResultItem, error)
ListPackages returns all packages in the lore registry.
func (*Registry) ListVersions ¶
ListVersions returns all available version tags. Tags are returned in descending semver order (newest first).
func (*Registry) Open ¶
func (r *Registry) Open(relPath string) (io.ReadCloser, error)
Open opens a file from the cache for reading.
func (*Registry) Resolve ¶
Resolve looks up a package by name in the registry. It checks the lore registry first, then falls back to native package managers.
func (*Registry) ResolveVersion ¶
ResolveVersion resolves a version string to a git ref. Uses ForceTags setting to determine behavior on non-main branches.
func (*Registry) ResolveWithConfidence ¶
func (r *Registry) ResolveWithConfidence(name string, platform string) (*Release, Confidence, error)
ResolveWithConfidence resolves a package and returns confidence information.
func (*Registry) Search ¶
func (r *Registry) Search(query string, opts SearchOptions) ([]SearchResultItem, error)
Search performs a federated search across the lore registry and native package managers.
func (*Registry) SignatureIndex ¶
SignatureIndex returns the package signature index from signatures.yaml. The index maps manager → native_name → lore_package for detecting native package installations and resolving them to lore packages. Returns an empty map if the file doesn't exist or is invalid.
func (*Registry) Sync ¶
func (r *Registry) Sync(ctx context.Context, opts SyncOptions) (*SyncResult, error)
Sync updates the local cache from the remote registry.
func (*Registry) SyntheticCache ¶
func (r *Registry) SyntheticCache() *SyntheticCache
SyntheticCache returns the synthetic package cache for this registry.
func (*Registry) VerifySyntheticPackage ¶
VerifySyntheticPackage checks if a synthetic package is available and updates the cache.
type RegistryConfig ¶
type RegistryConfig struct {
// URL overrides the default registry URL.
// Default: https://github.com/NobleFactor/devlore-registry.git
URL string `yaml:"url" mapstructure:"url"`
// Branch overrides the default branch.
// Default: develop (for demo phase; main for releases)
Branch string `yaml:"branch" mapstructure:"branch"`
// ForceTags forces tag resolution even on non-main branches.
// When true, "latest" always resolves to the "latest" tag.
// Default: false
ForceTags bool `yaml:"force_tags" mapstructure:"force_tags"`
}
RegistryConfig holds optional configuration for registry access. These values can be set in ~/.config/devlore/config.yaml under lore.registry.
Example config:
lore:
registry:
url: https://github.com/MyOrg/my-registry.git
branch: main
force_tags: true
func LoadRegistryConfig ¶
func LoadRegistryConfig() RegistryConfig
LoadRegistryConfig loads registry configuration from viper. Reads from lore.registry.* keys in the config file.
type Release ¶
type Release struct {
Name string // Package name
Version string // Version (may be "latest" for native PMs)
Description string // One-line description
Source PackageSource // Where this package was resolved from
Dir string // Package directory (lore packages only)
// Native package manager name (for non-lore packages)
// e.g., "docker.io" for apt, "docker" for brew
NativeName string
// contains filtered or unexported fields
}
Release provides a uniform view over any package release, whether from the lore registry or a native package manager. Use Lifecycle() to get phase and feature metadata.
func (*Release) DiscoverPhaseScripts ¶
DiscoverPhaseScripts returns all phase scripts for a phase, ordered from most general to most specific for chained execution.
For native PM packages, returns empty (the engine handles install directly).
func (*Release) HasPhase ¶
HasPhase returns true if at least one phase script exists for this phase.
func (*Release) IsNative ¶
IsNative returns true if this package comes from a native package manager.
func (*Release) IsSynthetic ¶
IsSynthetic returns true if the lifecycle is synthetic (not from lifecycle.yaml).
func (*Release) Lifecycle ¶
Lifecycle returns the package's lifecycle metadata. For lore packages, this loads from lifecycle.yaml. For native PM packages, this returns a synthetic lifecycle.
func (*Release) PhaseActions ¶
func (rel *Release) PhaseActions(platform string, op Operation, phase string) []PhaseAction
PhaseActions returns the executable actions for a phase. This provides a uniform interface for both lore and native PM packages.
For lore packages: returns ScriptAction items for each discovered script. For native PM packages: returns a NativePMAction for install/uninstall phases.
type SchemaEntry ¶
type SchemaEntry struct {
Name string `yaml:"name"`
Purpose string `yaml:"purpose,omitempty"`
Description string `yaml:"description,omitempty"`
}
SchemaEntry describes a JSON schema asset with discovery metadata.
type ScriptAction ¶
type ScriptAction struct {
// Path is the absolute path to the .star file.
Path string
// PhaseName is the phase name (function to call in the script).
PhaseName string
// Platform is the platform directory this script came from.
Platform string
}
ScriptAction executes a Starlark phase script.
func (*ScriptAction) Type ¶
func (a *ScriptAction) Type() PhaseActionType
Type returns ActionScript.
type SearchOptions ¶
type SearchOptions struct {
IncludeLore bool // Search lore registry
IncludeNative bool // Search native package manager
Limit int // Maximum results per source (0 = no limit)
}
SearchOptions controls search behavior.
func DefaultSearchOptions ¶
func DefaultSearchOptions() SearchOptions
DefaultSearchOptions returns sensible defaults for search.
type SearchResultItem ¶
type SearchResultItem struct {
Name string // Package name
Version string // Available version (may be empty)
Description string // Package description
Source PackageSource // Where this package came from
Confidence Confidence // How reliable is this result
Installed bool // Is it currently installed
}
SearchResultItem represents a package found during federated search.
type Setting ¶
type Setting struct {
Description string `yaml:"description"`
Type string `yaml:"type"`
Default string `yaml:"default"`
Values []string `yaml:"values,omitempty"`
Platforms []string `yaml:"platforms,omitempty"`
}
Setting represents a package setting definition.
type SignatureEntry ¶
type SignatureEntry struct {
Name string `yaml:"name"`
System string `yaml:"system,omitempty"` // system this signature detects
Description string `yaml:"description,omitempty"`
}
SignatureEntry describes a signature asset with discovery metadata.
type Signatures ¶
Signatures maps package managers to the names this package is known by. Keys are package manager names (brew, apt, dnf, pacman, winget, choco, cargo, pip, npm, go). Special key "urls" contains regex patterns for detecting URL-based installations (curl|bash, wget, etc.).
Example:
signatures: brew: [ripgrep, rg] apt: [ripgrep] cargo: [ripgrep] urls: ['github\.com/BurntSushi/ripgrep']
type SlotEntry ¶
type SlotEntry struct {
Name string `yaml:"name"`
Purpose string `yaml:"purpose,omitempty"`
Description string `yaml:"description,omitempty"`
}
SlotEntry describes a slots asset with discovery metadata.
type SyncInfo ¶
type SyncInfo struct {
LastSync time.Time `yaml:"last_sync"`
Ref string `yaml:"ref"`
Provider string `yaml:"provider"`
Endpoint string `yaml:"endpoint"`
}
SyncInfo tracks the last sync state.
type SyncOptions ¶
type SyncOptions struct {
Force bool // Force sync even if cache is fresh
}
SyncOptions controls sync behavior.
type SyncResult ¶
type SyncResult struct {
Updated bool // Whether the cache was updated
FromRef string // Previous reference (commit SHA, digest, etc.)
ToRef string // New reference
SyncedAt time.Time // When sync completed
FromClone bool // True if this was a fresh clone
}
SyncResult contains information about a sync operation.
type SyntheticCache ¶
type SyntheticCache struct {
// contains filtered or unexported fields
}
SyntheticCache manages cached synthetic package definitions. Synthetic packages are created for native PM packages that aren't in the lore registry. The cache reduces repeated package manager queries and provides persistence.
func NewSyntheticCache ¶
func NewSyntheticCache(cacheDir string) *SyntheticCache
NewSyntheticCache creates a new synthetic package cache.
func (*SyntheticCache) Clear ¶
func (c *SyntheticCache) Clear() error
Clear removes all cached synthetic packages.
func (*SyntheticCache) ClearSource ¶
func (c *SyntheticCache) ClearSource(source PackageSource) error
ClearSource removes all cached synthetic packages for a specific source.
func (*SyntheticCache) Delete ¶
func (c *SyntheticCache) Delete(source PackageSource, name string) error
Delete removes a synthetic package from the cache.
func (*SyntheticCache) Get ¶
func (c *SyntheticCache) Get(source PackageSource, name string) *SyntheticPackageInfo
Get retrieves a cached synthetic package, if it exists and is not expired. Returns nil if not cached or expired.
func (*SyntheticCache) List ¶
func (c *SyntheticCache) List() ([]SyntheticPackageInfo, error)
List returns all cached synthetic packages.
func (*SyntheticCache) Put ¶
func (c *SyntheticCache) Put(info *SyntheticPackageInfo) error
Put stores a synthetic package in the cache.
func (*SyntheticCache) Stats ¶
func (c *SyntheticCache) Stats() (*CacheStats, error)
Stats returns statistics about the synthetic cache.
type SyntheticPackageInfo ¶
type SyntheticPackageInfo struct {
Name string `yaml:"name"`
Source PackageSource `yaml:"source"`
NativeName string `yaml:"native_name"`
Version string `yaml:"version,omitempty"`
Description string `yaml:"description,omitempty"`
Verified bool `yaml:"verified"` // Was availability verified?
CachedAt time.Time `yaml:"cached_at"` // When was this cached?
VerifiedAt time.Time `yaml:"verified_at"` // When was availability last verified?
}
SyntheticPackageInfo is the cached metadata for a synthetic package.
type TransformEntry ¶
type TransformEntry struct {
Name string `yaml:"name"`
SourceSystem string `yaml:"source_system,omitempty"` // source system this transform handles
Description string `yaml:"description,omitempty"`
}
TransformEntry describes a transform asset with discovery metadata.