state

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selection

type Selection struct {
	ActiveVersion string    `json:"active_version,omitempty"`
	History       []string  `json:"history,omitempty"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(root string) (*Store, error)

func (*Store) Activate

func (s *Store) Activate(ctx context.Context, skill, version string) error

func (*Store) ActiveVersion

func (s *Store) ActiveVersion(skill string) (string, error)

func (*Store) BundledSkills

func (s *Store) BundledSkills() ([]string, error)

BundledSkills 返回当前由 AgentDock 随附管理的 Skill 名称。 版本和摘要仍由 installed/ 与 state/ 负责,避免在清单中重复保存。

func (*Store) CachePath

func (s *Store) CachePath(name string) (string, error)

func (*Store) EnsureLayout

func (s *Store) EnsureLayout() error

func (*Store) InstalledPath

func (s *Store) InstalledPath(skill, version string) (string, error)

func (*Store) IsBundled

func (s *Store) IsBundled(skill string) (bool, error)

func (*Store) IsInstalled

func (s *Store) IsInstalled(skill, version string) (bool, error)

func (*Store) ListSkills

func (s *Store) ListSkills() ([]string, error)

func (*Store) ListVersions

func (s *Store) ListVersions(skill string) ([]string, error)

func (*Store) PreviousVersion

func (s *Store) PreviousVersion(skill string) (string, error)

func (*Store) RemoveVersion

func (s *Store) RemoveVersion(ctx context.Context, skill, version string) error

func (*Store) ReplaceBundledSkills

func (s *Store) ReplaceBundledSkills(ctx context.Context, skills []string) error

ReplaceBundledSkills 原子替换内置清单。调用方应在所有随附 Skill 安装成功后再提交名单,避免留下“已内置但未安装”的半完成状态。

func (*Store) Resolve

func (s *Store) Resolve(skill, version string) (string, error)

func (*Store) RestoreSelection

func (s *Store) RestoreSelection(ctx context.Context, skill string, selection Selection) error

RestoreSelection 恢复一次操作前保存的版本选择。 它只用于安装事务回滚;正常版本切换应继续使用 Activate 记录历史。

func (*Store) Root

func (s *Store) Root() string

func (*Store) Snapshot

func (s *Store) Snapshot(skill string) (Selection, error)

func (*Store) TempPath

func (s *Store) TempPath(prefix string) (string, error)

Jump to

Keyboard shortcuts

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