Documentation
¶
Index ¶
- Variables
- func Source(language Language) ([]byte, error)
- type Change
- type Language
- type Manager
- func (m *Manager) Backup(targets []Target) ([]Change, error)
- func (m *Manager) Install(language Language, targets []Target) ([]Change, error)
- func (m *Manager) Restore(targets []Target, backupID string) ([]Change, error)
- func (m *Manager) Status(language Language, targets []Target) ([]TargetStatus, error)
- func (m *Manager) Update(language Language, targets []Target) ([]Change, error)
- type Target
- type TargetStatus
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Change ¶
type Change struct {
Target Target `json:"target" yaml:"target"`
Path string `json:"path" yaml:"path"`
Status string `json:"status" yaml:"status"`
Language Language `json:"language,omitempty" yaml:"language,omitempty"`
Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"`
BackupID string `json:"backup_id,omitempty" yaml:"backup_id,omitempty"`
SafetyBackupID string `json:"safety_backup_id,omitempty" yaml:"safety_backup_id,omitempty"`
}
Change 描述安装、更新、备份或恢复对一个目标产生的结果。 Change describes the result of install, update, backup, or restore for one target.
type Language ¶
type Language string
Language 表示内置 Skill 的语言。 Language identifies one embedded Skill language.
func DetectLanguage ¶
DetectLanguage 只在系统明确使用英语时选择英文,其他情况默认中文。 DetectLanguage selects English only for an explicit English locale and defaults to Chinese otherwise.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 管理 Claude 与 Agents 目录中的 STX Skill 文件。 Manager manages STX Skill files in the Claude and Agents directories.
func NewManager ¶
NewManager 创建只操作指定用户目录的 Skill 管理器。 NewManager creates a Skill manager scoped to the supplied home directory.
func (*Manager) Backup ¶
Backup 备份当前存在的 SKILL.md,缺失目标返回 skipped_missing。 Backup saves existing SKILL.md files and reports skipped_missing for absent targets.
func (*Manager) Install ¶
Install 只写入尚未存在的 SKILL.md,不覆盖已有文件。 Install writes only missing SKILL.md files and never overwrites existing files.
func (*Manager) Restore ¶
Restore 从指定备份恢复;backupID 为空时使用每个目标的最新备份。 Restore restores a selected backup; an empty backupID selects the latest backup for each target.
type Target ¶
type Target string
Target 表示 STX 可以管理的 Skill 安装目标。 Target identifies one Skill installation target managed by STX.
func ParseTargets ¶
ParseTargets 解析 all、claude 或 agents 安装目标。 ParseTargets parses the all, claude, or agents installation selector.
type TargetStatus ¶
type TargetStatus struct {
Target Target `json:"target" yaml:"target"`
Path string `json:"path" yaml:"path"`
Installed bool `json:"installed" yaml:"installed"`
Current bool `json:"current" yaml:"current"`
Language Language `json:"language,omitempty" yaml:"language,omitempty"`
Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"`
SourceChecksum string `json:"source_checksum" yaml:"source_checksum"`
BackupCount int `json:"backup_count" yaml:"backup_count"`
LatestBackup string `json:"latest_backup,omitempty" yaml:"latest_backup,omitempty"`
}
TargetStatus 描述一个安装目标当前的文件状态。 TargetStatus describes the current file state of one installation target.