store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package store is the content-addressed store of installed skill content, keyed by canonical content hash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the content-addressed store of installed skill content, keyed by canonical content hash. It is the single source of truth that agent directories link to or copy from (FR-019).

func New

func New(root string) *Store

New returns a Store rooted at root.

func (*Store) GC

func (s *Store) GC(referenced map[string]bool) (int, error)

GC removes store entries whose content hash is not in referenced and returns the number removed. The referenced set holds full content keys (e.g. "sha256:abcd"). GC only runs on explicit reconciliation (remove, sync --prune), never during an additive install (FR-019).

func (*Store) Has

func (s *Store) Has(contentHash string) bool

Has reports whether content for contentHash is present.

func (*Store) Path

func (s *Store) Path(contentHash string) string

Path returns the directory for a content hash, whether or not it exists.

func (*Store) Put

func (s *Store) Put(contentHash, srcDir string) (string, error)

Put imports srcDir under contentHash and returns the stored path. It is idempotent.

func (*Store) Root

func (s *Store) Root() string

Root returns the store's root directory.

Jump to

Keyboard shortcuts

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