setup

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentNameForIDE added in v0.1.5

func AgentNameForIDE(ide string) (string, error)

AgentNameForIDE maps a compozy runtime IDE name to the setup agent name.

func InstallBundledReusableAgents added in v0.1.11

func InstallBundledReusableAgents(
	cfg ReusableAgentInstallConfig,
) ([]ReusableAgentSuccessItem, []ReusableAgentFailureItem, error)

InstallBundledReusableAgents installs every bundled reusable agent into the selected setup scope.

func InstallReusableAgents added in v0.1.11

InstallReusableAgents installs the provided reusable agents into the selected setup scope.

func InstallSelectedSkills added in v0.1.11

func InstallSelectedSkills(
	options ResolverOptions,
	skills []Skill,
	agentNames []string,
	global bool,
	mode InstallMode,
) ([]SuccessItem, []FailureItem, error)

InstallSelectedSkills installs an explicit skill selection for the requested agents.

Types

type Agent

type Agent struct {
	Name           string
	DisplayName    string
	ProjectRootDir string
	GlobalRootDir  string
	Universal      bool
	Detected       bool
}

Agent describes one supported agent/editor destination.

func DetectInstalledAgents

func DetectInstalledAgents(options ResolverOptions) ([]Agent, error)

func SelectAgents

func SelectAgents(all []Agent, names []string) ([]Agent, error)

func SupportedAgents

func SupportedAgents(options ResolverOptions) ([]Agent, error)

type AssetOrigin added in v0.1.11

type AssetOrigin string

AssetOrigin identifies where one setup asset originates.

const (
	// AssetOriginBundled identifies first-party setup assets shipped with Compozy.
	AssetOriginBundled AssetOrigin = "bundled"
	// AssetOriginExtension identifies setup assets shipped by an enabled extension.
	AssetOriginExtension AssetOrigin = "extension"
)

type AssetRef added in v0.1.11

type AssetRef struct {
	Origin          AssetOrigin
	Name            string
	ExtensionName   string
	ExtensionSource string
	ManifestPath    string
	ResolvedPath    string
}

AssetRef captures the source metadata needed to explain one effective-setup conflict.

type CatalogAssetKind added in v0.1.11

type CatalogAssetKind string

CatalogAssetKind identifies the setup asset family participating in conflict resolution.

const (
	// CatalogAssetKindSkill identifies skill assets.
	CatalogAssetKindSkill CatalogAssetKind = "skill"
	// CatalogAssetKindReusableAgent identifies reusable-agent assets.
	CatalogAssetKindReusableAgent CatalogAssetKind = "reusable-agent"
)

type CatalogConflict added in v0.1.11

type CatalogConflict struct {
	Kind       CatalogAssetKind
	Name       string
	Resolution CatalogConflictResolution
	Winner     AssetRef
	Ignored    AssetRef
}

CatalogConflict records one ignored setup asset and the winner that shadowed it.

type CatalogConflictResolution added in v0.1.11

type CatalogConflictResolution string

CatalogConflictResolution describes why one setup asset won over another.

const (
	// CatalogConflictCoreWins indicates a bundled core asset shadowed an extension asset.
	CatalogConflictCoreWins CatalogConflictResolution = "core-wins"
	// CatalogConflictExtensionPrecedence indicates one extension asset shadowed another by precedence.
	CatalogConflictExtensionPrecedence CatalogConflictResolution = "extension-precedence"
)

type EffectiveCatalog added in v0.1.11

type EffectiveCatalog struct {
	Skills         []Skill
	ReusableAgents []ReusableAgent
	Conflicts      []CatalogConflict
}

EffectiveCatalog summarizes the setup assets eligible for installation after conflict resolution.

func BuildEffectiveCatalog added in v0.1.11

func BuildEffectiveCatalog(
	bundledSkills []Skill,
	extensionSkills []Skill,
	bundledReusableAgents []ReusableAgent,
	extensionReusableAgents []ReusableAgent,
) EffectiveCatalog

BuildEffectiveCatalog merges bundled and extension setup assets into one effective install catalog.

type ExtensionFailureItem added in v0.1.11

type ExtensionFailureItem struct {
	Pack SkillPackSource
	FailureItem
}

ExtensionFailureItem captures one failed extension skill installation mapping.

type ExtensionInstallConfig added in v0.1.11

type ExtensionInstallConfig struct {
	ResolverOptions

	Packs      []SkillPackSource
	AgentNames []string
	Global     bool
	Mode       InstallMode
}

ExtensionInstallConfig describes one extension-skill installation run.

type ExtensionPreviewItem added in v0.1.11

type ExtensionPreviewItem struct {
	Pack SkillPackSource
	PreviewItem
}

ExtensionPreviewItem describes the on-disk plan for one extension skill/agent install pair.

type ExtensionResult added in v0.1.11

type ExtensionResult struct {
	Global     bool
	Mode       InstallMode
	Successful []ExtensionSuccessItem
	Failed     []ExtensionFailureItem
}

ExtensionResult summarizes one extension-skill installation run.

func InstallExtensionSkillPacks added in v0.1.11

func InstallExtensionSkillPacks(cfg ExtensionInstallConfig) (*ExtensionResult, error)

InstallExtensionSkillPacks materializes enabled extension skill packs for the selected agents.

type ExtensionReusableAgentSource added in v0.1.11

type ExtensionReusableAgentSource struct {
	ExtensionName   string
	ExtensionSource string
	ManifestPath    string
	Pattern         string
	ResolvedPath    string
	SourceFS        fs.FS
	SourceDir       string
}

ExtensionReusableAgentSource captures one declarative reusable-agent source resolved during extension discovery.

type ExtensionSuccessItem added in v0.1.11

type ExtensionSuccessItem struct {
	Pack SkillPackSource
	SuccessItem
}

ExtensionSuccessItem captures one successful extension skill installation mapping.

type ExtensionVerifiedSkill added in v0.1.11

type ExtensionVerifiedSkill struct {
	Pack SkillPackSource
	VerifiedSkill
}

ExtensionVerifiedSkill captures the verification result for one extension skill pack.

type ExtensionVerifyConfig added in v0.1.11

type ExtensionVerifyConfig struct {
	ResolverOptions

	Packs     []SkillPackSource
	AgentName string
	ScopeHint InstallScope
}

ExtensionVerifyConfig describes one extension-skill verification run.

type ExtensionVerifyResult added in v0.1.11

type ExtensionVerifyResult struct {
	Agent  Agent
	Scope  InstallScope
	Mode   InstallMode
	Skills []ExtensionVerifiedSkill
}

ExtensionVerifyResult summarizes one extension-skill verification run.

func VerifyExtensionSkillPacks added in v0.1.11

func VerifyExtensionSkillPacks(cfg ExtensionVerifyConfig) (ExtensionVerifyResult, error)

VerifyExtensionSkillPacks checks whether declared extension skill packs are installed and current.

func (ExtensionVerifyResult) DriftedSkillNames added in v0.1.11

func (r ExtensionVerifyResult) DriftedSkillNames() []string

DriftedSkillNames returns every drifted extension skill name in sorted order.

func (ExtensionVerifyResult) HasDrift added in v0.1.11

func (r ExtensionVerifyResult) HasDrift() bool

HasDrift reports whether any extension skill differs from its declared source.

func (ExtensionVerifyResult) HasMissing added in v0.1.11

func (r ExtensionVerifyResult) HasMissing() bool

HasMissing reports whether any extension skill is missing.

func (ExtensionVerifyResult) MissingSkillNames added in v0.1.11

func (r ExtensionVerifyResult) MissingSkillNames() []string

MissingSkillNames returns every missing extension skill name in sorted order.

type FailureItem

type FailureItem struct {
	Skill Skill
	Agent Agent
	Path  string
	Mode  InstallMode
	Error string
}

FailureItem captures one failed installation mapping.

type InstallConfig

type InstallConfig struct {
	Bundle fs.FS

	ResolverOptions

	SkillNames []string
	AgentNames []string
	Global     bool
	Mode       InstallMode
}

InstallConfig describes one bundled-skill installation run.

type InstallMode

type InstallMode string

InstallMode determines how bundled skills are materialized for agents.

const (
	// InstallModeSymlink installs a canonical copy and symlinks agent paths to it.
	InstallModeSymlink InstallMode = "symlink"
	// InstallModeCopy copies the bundled skill into each target agent path.
	InstallModeCopy InstallMode = "copy"
)

type InstallScope added in v0.1.5

type InstallScope string

InstallScope identifies whether a skill installation is project-local or global.

const (
	// InstallScopeUnknown indicates that no existing installation scope could be resolved.
	InstallScopeUnknown InstallScope = "unknown"
	// InstallScopeProject identifies a project-local installation.
	InstallScopeProject InstallScope = "project"
	// InstallScopeGlobal identifies a global installation.
	InstallScopeGlobal InstallScope = "global"
)

type LegacyAssetCleanupConfig added in v0.1.11

type LegacyAssetCleanupConfig struct {
	ResolverOptions

	Global bool
}

LegacyAssetCleanupConfig describes one cleanup run for legacy setup-managed assets that changed ownership and must no longer remain active after setup.

type LegacyAssetCleanupResult added in v0.1.11

type LegacyAssetCleanupResult struct {
	Removed []LegacyAssetRemoval
}

LegacyAssetCleanupResult summarizes one legacy cleanup run.

func CleanupLegacyTransferredAssets added in v0.1.11

func CleanupLegacyTransferredAssets(cfg LegacyAssetCleanupConfig) (LegacyAssetCleanupResult, error)

CleanupLegacyTransferredAssets prunes legacy setup-managed installs for assets that moved out of the bundled core catalog. This prevents stale copies from remaining active after an ownership transfer to extensions.

type LegacyAssetRemoval added in v0.1.11

type LegacyAssetRemoval struct {
	Kind CatalogAssetKind
	Name string
	Path string
}

LegacyAssetRemoval captures one legacy setup-managed path removed during cleanup.

type PreviewItem

type PreviewItem struct {
	Skill         Skill
	Agent         Agent
	CanonicalPath string
	TargetPath    string
	WillOverwrite bool
}

PreviewItem describes the on-disk plan for one skill/agent install pair.

func Preview

func Preview(cfg InstallConfig) ([]PreviewItem, error)

Preview resolves selected bundled skills and agents to on-disk install targets.

func PreviewBundledSkillInstall

func PreviewBundledSkillInstall(cfg InstallConfig) ([]PreviewItem, error)

PreviewBundledSkillInstall resolves the on-disk install plan for bundled skills.

func PreviewSelectedSkills added in v0.1.11

func PreviewSelectedSkills(
	options ResolverOptions,
	skills []Skill,
	agentNames []string,
	global bool,
	mode InstallMode,
) ([]PreviewItem, error)

PreviewSelectedSkills resolves the on-disk install plan for an explicit skill selection.

type ResolverOptions

type ResolverOptions struct {
	CWD             string
	HomeDir         string
	XDGConfigHome   string
	CodeXHome       string
	ClaudeConfigDir string
}

ResolverOptions configures environment-sensitive path resolution.

type Result

type Result struct {
	Global     bool
	Mode       InstallMode
	Successful []SuccessItem
	Failed     []FailureItem

	ReusableAgentsSuccessful []ReusableAgentSuccessItem
	ReusableAgentsFailed     []ReusableAgentFailureItem
}

Result summarizes one bundled-skill installation run.

func Install

func Install(cfg InstallConfig) (*Result, error)

Install materializes bundled skills for the selected agents.

func InstallBundledSetupAssets added in v0.1.11

func InstallBundledSetupAssets(cfg InstallConfig) (*Result, error)

InstallBundledSetupAssets materializes bundled skills and any bundled reusable agents.

func InstallBundledSkills

func InstallBundledSkills(cfg InstallConfig) (*Result, error)

InstallBundledSkills materializes bundled public skills for the selected agents.

type ReusableAgent added in v0.1.11

type ReusableAgent struct {
	Name        string
	Title       string
	Description string
	Directory   string
	Origin      AssetOrigin

	ExtensionName   string
	ExtensionSource string
	ManifestPath    string
	ResolvedPath    string
	SourceFS        fs.FS
	SourceDir       string
}

ReusableAgent describes one reusable agent available for setup-managed installation.

func ListBundledReusableAgents added in v0.1.11

func ListBundledReusableAgents() ([]ReusableAgent, error)

ListBundledReusableAgents returns the reusable agents bundled into the compozy binary.

func ListExtensionReusableAgents added in v0.1.11

func ListExtensionReusableAgents(sources []ExtensionReusableAgentSource) ([]ReusableAgent, error)

ListExtensionReusableAgents enumerates reusable agents declared by enabled extensions.

func ListReusableAgents added in v0.1.11

func ListReusableAgents(bundle fs.FS) ([]ReusableAgent, error)

ListReusableAgents enumerates bundled reusable agents from the provided bundle.

type ReusableAgentFailureItem added in v0.1.11

type ReusableAgentFailureItem struct {
	ReusableAgent ReusableAgent
	Path          string
	Error         string
}

ReusableAgentFailureItem captures one failed bundled reusable-agent installation.

type ReusableAgentInstallConfig added in v0.1.11

type ReusableAgentInstallConfig struct {
	ResolverOptions

	ReusableAgents []ReusableAgent
	Global         bool
}

ReusableAgentInstallConfig describes one reusable-agent install or preview run.

type ReusableAgentPreviewItem added in v0.1.11

type ReusableAgentPreviewItem struct {
	ReusableAgent ReusableAgent
	TargetPath    string
	WillOverwrite bool
}

ReusableAgentPreviewItem describes the on-disk plan for one bundled reusable agent.

func PreviewBundledReusableAgentInstall added in v0.1.11

func PreviewBundledReusableAgentInstall(cfg ReusableAgentInstallConfig) ([]ReusableAgentPreviewItem, error)

PreviewBundledReusableAgentInstall resolves the on-disk install plan for bundled reusable agents.

func PreviewReusableAgentInstall added in v0.1.11

func PreviewReusableAgentInstall(cfg ReusableAgentInstallConfig) ([]ReusableAgentPreviewItem, error)

PreviewReusableAgentInstall resolves the on-disk install plan for reusable agents.

type ReusableAgentSuccessItem added in v0.1.11

type ReusableAgentSuccessItem struct {
	ReusableAgent ReusableAgent
	Path          string
}

ReusableAgentSuccessItem captures one successful bundled reusable-agent installation.

type ReusableAgentVerifyConfig added in v0.1.11

type ReusableAgentVerifyConfig struct {
	ResolverOptions

	ReusableAgents []ReusableAgent
	ScopeHint      InstallScope
}

ReusableAgentVerifyConfig describes one reusable-agent verification run.

type ReusableAgentVerifyResult added in v0.1.11

type ReusableAgentVerifyResult struct {
	Scope  InstallScope
	Agents []VerifiedReusableAgent
}

ReusableAgentVerifyResult summarizes one reusable-agent verification run.

func VerifyReusableAgents added in v0.1.11

func VerifyReusableAgents(cfg ReusableAgentVerifyConfig) (ReusableAgentVerifyResult, error)

VerifyReusableAgents checks whether reusable agents are installed and current.

func (ReusableAgentVerifyResult) DriftedReusableAgentNames added in v0.1.11

func (r ReusableAgentVerifyResult) DriftedReusableAgentNames() []string

DriftedReusableAgentNames returns every drifted reusable-agent name in sorted order.

func (ReusableAgentVerifyResult) HasDrift added in v0.1.11

func (r ReusableAgentVerifyResult) HasDrift() bool

HasDrift reports whether any reusable agent differs from its source.

func (ReusableAgentVerifyResult) HasMissing added in v0.1.11

func (r ReusableAgentVerifyResult) HasMissing() bool

HasMissing reports whether any reusable agent is missing.

func (ReusableAgentVerifyResult) MissingReusableAgentNames added in v0.1.11

func (r ReusableAgentVerifyResult) MissingReusableAgentNames() []string

MissingReusableAgentNames returns every missing reusable-agent name in sorted order.

type Skill

type Skill struct {
	Name        string
	Description string
	Directory   string
	Origin      AssetOrigin

	ExtensionName   string
	ExtensionSource string
	ManifestPath    string
	ResolvedPath    string
	SourceFS        fs.FS
	SourceDir       string
}

Skill describes one bundled skill available for installation.

func ListBundledSkills

func ListBundledSkills() ([]Skill, error)

ListBundledSkills returns the public skills bundled into the compozy binary.

func ListExtensionSkills added in v0.1.11

func ListExtensionSkills(packs []SkillPackSource) ([]Skill, error)

ListExtensionSkills enumerates installable skill assets declared by enabled extensions.

func ListSkills

func ListSkills(bundle fs.FS) ([]Skill, error)

ListSkills enumerates bundled public skills from the provided bundle.

func SelectSkills

func SelectSkills(all []Skill, names []string) ([]Skill, error)

SelectSkills filters a discovered catalog to the requested bundled skill names.

type SkillDrift added in v0.1.5

type SkillDrift struct {
	MissingFiles []string
	ExtraFiles   []string
	ChangedFiles []string
	Reason       string
}

SkillDrift describes how an installed skill differs from the bundled version.

type SkillPackSource added in v0.1.11

type SkillPackSource struct {
	ExtensionName   string
	ExtensionSource string
	ManifestPath    string
	Pattern         string
	ResolvedPath    string
	SourceFS        fs.FS
	SourceDir       string
}

SkillPackSource captures one declarative skill-pack source resolved during extension discovery.

func ExtensionSkillPackSources added in v0.1.11

func ExtensionSkillPackSources(skills []Skill) []SkillPackSource

ExtensionSkillPackSources converts effective extension skills back into declarative skill-pack sources.

type SuccessItem

type SuccessItem struct {
	Skill         Skill
	Agent         Agent
	Path          string
	CanonicalPath string
	Mode          InstallMode
	SymlinkFailed bool
}

SuccessItem captures one successful installation mapping.

type VerifiedReusableAgent added in v0.1.11

type VerifiedReusableAgent struct {
	ReusableAgent ReusableAgent
	TargetPath    string
	ResolvedPath  string
	State         VerifyState
	Drift         SkillDrift
}

VerifiedReusableAgent captures the verification result for one reusable agent.

type VerifiedSkill added in v0.1.5

type VerifiedSkill struct {
	Skill         Skill
	CanonicalPath string
	TargetPath    string
	ResolvedPath  string
	State         VerifyState
	Drift         SkillDrift
}

VerifiedSkill captures the verification result for one skill.

type VerifyConfig added in v0.1.5

type VerifyConfig struct {
	Bundle fs.FS

	ResolverOptions

	AgentName  string
	SkillNames []string
}

VerifyConfig describes one bundled-skill verification run.

type VerifyResult added in v0.1.5

type VerifyResult struct {
	Agent  Agent
	Scope  InstallScope
	Mode   InstallMode
	Skills []VerifiedSkill
}

VerifyResult summarizes one bundled-skill verification run.

func Verify added in v0.1.5

func Verify(cfg VerifyConfig) (VerifyResult, error)

Verify checks whether the selected bundled skills are installed and current for one agent.

func VerifyBundledSkills added in v0.1.5

func VerifyBundledSkills(cfg VerifyConfig) (VerifyResult, error)

VerifyBundledSkills checks whether bundled public skills are installed and current.

func (VerifyResult) DriftedSkillNames added in v0.1.5

func (r VerifyResult) DriftedSkillNames() []string

DriftedSkillNames returns every drifted skill name in sorted order.

func (VerifyResult) HasDrift added in v0.1.5

func (r VerifyResult) HasDrift() bool

HasDrift reports whether any installed skill differs from the bundled version.

func (VerifyResult) HasMissing added in v0.1.5

func (r VerifyResult) HasMissing() bool

HasMissing reports whether any skill is missing.

func (VerifyResult) MissingSkillNames added in v0.1.5

func (r VerifyResult) MissingSkillNames() []string

MissingSkillNames returns every missing skill name in sorted order.

type VerifyState added in v0.1.5

type VerifyState string

VerifyState describes the verification status for one installed skill.

const (
	// VerifyStateCurrent indicates the installed skill matches the bundled version.
	VerifyStateCurrent VerifyState = "current"
	// VerifyStateMissing indicates the installed skill is missing from the selected scope.
	VerifyStateMissing VerifyState = "missing"
	// VerifyStateDrifted indicates the installed skill differs from the bundled version.
	VerifyStateDrifted VerifyState = "drifted"
)

Jump to

Keyboard shortcuts

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