Documentation
¶
Index ¶
- Constants
- func DigestDirectory(root string) (string, error)
- func DigestFile(path string) (string, error)
- func DigestPackageContent(root string) (string, error)
- func FinalizeLegacyMigration(agentDockHome string) (string, error)
- func IsIgnoredPackageMetadataPath(relative string) bool
- func ValidatePackage(packageDir string) error
- type ErrDocumentIdentityMismatch
- type Error
- type InstallRequest
- type InstallResult
- type LegacyMigrationResult
- type Manager
- func (m *Manager) Install(ctx context.Context, req InstallRequest) (InstallResult, error)
- func (m *Manager) Remove(ctx context.Context, skill string) (RemoveResult, error)
- func (m *Manager) RemoveWithPurge(ctx context.Context, skill string, purge func() error) (RemoveResult, error)
- func (m *Manager) Validate(ctx context.Context, req ValidateRequest) (ValidateResult, error)
- type RemoveResult
- type SkillDocument
- type SkillMetadata
- type ValidateIssue
- type ValidateRequest
- type ValidateResult
Constants ¶
const ( ErrInvalidPackage = "INVALID_SKILL_PACKAGE" ErrDigestMismatch = "SKILL_DIGEST_MISMATCH" ErrDocumentInvalid = "SKILL_DOCUMENT_INVALID" ErrInstallFailed = "SKILL_INSTALL_FAILED" ErrUninstallFailed = "SKILL_UNINSTALL_FAILED" ErrPurgeFailed = "SKILL_PURGE_FAILED" )
Variables ¶
This section is empty.
Functions ¶
func DigestDirectory ¶
func DigestFile ¶
func DigestPackageContent ¶ added in v0.9.0
DigestPackageContent returns the stable digest of the effective Skill package content.
func FinalizeLegacyMigration ¶ added in v0.9.0
FinalizeLegacyMigration archives the preserved legacy roots after the outer install/update transaction has committed. It is safe to call repeatedly.
func IsIgnoredPackageMetadataPath ¶ added in v0.9.0
IsIgnoredPackageMetadataPath reports transport/OS metadata that is outside the semantic Skill/Plugin package content. These entries are intentionally excluded from package snapshots/digests so Finder or macOS ZIP metadata cannot mutate an installed package after review.
func ValidatePackage ¶
Types ¶
type ErrDocumentIdentityMismatch ¶
type ErrDocumentIdentityMismatch struct {
Skill string
Document SkillDocument
}
func (ErrDocumentIdentityMismatch) Error ¶
func (e ErrDocumentIdentityMismatch) Error() string
type InstallRequest ¶
type InstallResult ¶
type LegacyMigrationResult ¶ added in v0.9.0
type LegacyMigrationResult struct {
MigratedSkills []string
MigratedData []string
PendingPath string
}
func MigrateLegacyLayout ¶ added in v0.9.0
func MigrateLegacyLayout(ctx context.Context, agentDockHome string, manager *Manager) (LegacyMigrationResult, error)
MigrateLegacyLayout prepares the one-time transition from the historical skill-store/skill-data layout to current managed Skill content.
Preparation is deliberately non-destructive: the old roots stay in place until the outer install/update transaction has committed. That keeps pre-migration binaries rollback-safe even when a legacy updater does not understand the new migration protocol.
func MigrateLegacyLayoutForUpdate ¶ added in v0.9.0
func MigrateLegacyLayoutForUpdate(ctx context.Context, agentDockHome string, manager *Manager) (LegacyMigrationResult, error)
MigrateLegacyLayoutForUpdate may refresh paths already created by a pending migration from the still-authoritative legacy roots. Only update/bootstrap paths may use it: normal runtime startup must never overwrite data produced by the new runtime after a successful legacy upgrade.
type Manager ¶
type Manager struct {
State *skillstate.Store
HTTPClient *http.Client
MaxDownload int64
MaxFiles int
}
func (*Manager) Install ¶
func (m *Manager) Install(ctx context.Context, req InstallRequest) (InstallResult, error)
func (*Manager) RemoveWithPurge ¶ added in v0.9.0
func (m *Manager) RemoveWithPurge(ctx context.Context, skill string, purge func() error) (RemoveResult, error)
RemoveWithPurge removes the managed package and runs purge while the same Skill lifecycle write lock is still held. It is intentionally idempotent: when the package is already absent, purge still runs so preserved env/data from an earlier keep removal can be cleaned safely.
func (*Manager) Validate ¶
func (m *Manager) Validate(ctx context.Context, req ValidateRequest) (ValidateResult, error)
type RemoveResult ¶ added in v0.9.0
type SkillDocument ¶
type SkillDocument struct {
Name string `json:"name"`
Description string `json:"description"`
Body string `json:"body,omitempty"`
}
func LoadSkillDocument ¶
func LoadSkillDocument(packageDir string) (SkillDocument, error)
func ParseSkillDocument ¶
func ParseSkillDocument(data []byte) (SkillDocument, error)
type SkillMetadata ¶ added in v0.8.2
func ParseSkillMetadata ¶ added in v0.8.2
func ParseSkillMetadata(data []byte) (SkillMetadata, error)
type ValidateIssue ¶
type ValidateRequest ¶
type ValidateResult ¶
type ValidateResult struct {
Valid bool `json:"valid"`
Source string `json:"source"`
SourceDigest string `json:"source_digest,omitempty"`
ContentDigest string `json:"content_digest,omitempty"`
Document SkillDocument `json:"document,omitempty"`
Issues []ValidateIssue `json:"issues"`
}