projreg

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package projreg maintains the advisory per-user project registry under <home>/projects (spec 015 FR-027–029). Every entry is rebuilt from the project itself whenever gskill touches it, so the registry is never a source of truth: deleting it breaks nothing, and reproduction always comes from the project's own skills-lock.json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prune

func Prune(h *home.Home) (removed []string, err error)

Prune removes entries whose recorded root no longer exists or is no longer a gskill project (no lockfile). It removes registry files only — never repository content (FR-028). Minimal-mode entries (no recorded root) are kept: their liveness cannot be judged. The caller holds the registry lock.

func Write

func Write(h *home.Home, e Entry, privacy string) error

Write registers or refreshes a project entry per the privacy mode: "full" records everything, "minimal" drops the absolute paths, and "disabled" writes nothing and removes any existing entry (FR-029). The caller holds the registry lock.

Types

type Entry

type Entry struct {
	SchemaVersion int         `json:"schemaVersion"`
	ProjectID     string      `json:"projectId"`
	Root          string      `json:"root,omitempty"`
	Lockfile      string      `json:"lockfile,omitempty"`
	LastSeen      time.Time   `json:"lastSeen"`
	References    []Reference `json:"references"`
}

Entry is one registered project (data-model §4). In minimal privacy mode Root and Lockfile stay empty; registry files are owner-only and never carry credentials.

func Get

func Get(h *home.Home, projectID string) (Entry, bool, error)

Get returns the entry for projectID.

func List

func List(h *home.Home) ([]Entry, error)

List returns every registry entry, sorted by project ID. Unreadable or foreign files are skipped — the registry is advisory.

type Reference

type Reference struct {
	Skill     string `json:"skill"`
	StoreHash string `json:"storeHash"`
}

Reference is one skill's content identity at last-seen time.

Jump to

Keyboard shortcuts

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