installs

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package installs manages a generic sidecar tracker for every kind of marketplace content installed via `promptvm add` (skill, agent, command, prompt, hook, mcp, settings). It records provenance (name, canonical ref, kind, target path, timestamp) so a future `promptvm list/remove/update` has a stable, kind-agnostic index. Hooks continue to also use the hook-specific .promptvm-hooks.json sidecar for settings-merge ownership; this file is additive and never authoritative for uninstall of merged config.

Index

Constants

View Source
const FileName = ".promptvm-installs.json"

FileName is the sidecar filename, written inside the .claude root.

Variables

This section is empty.

Functions

func PathIn

func PathIn(claudeRoot string) string

PathIn returns the sidecar path inside the given .claude root.

func Record

func Record(claudeRoot string, e Entry) error

Record is a convenience: load the sidecar in claudeRoot, upsert the entry, and save. It is best-effort at the call site (the caller swallows errors).

Types

type Entry

type Entry struct {
	Name        string `json:"name"`
	Ref         string `json:"ref"`
	Kind        string `json:"kind"`
	Target      string `json:"target"`
	InstalledAt string `json:"installed_at"`
}

Entry is one recorded install.

type Tracker

type Tracker struct {
	Installs []Entry `json:"installs"`
	// contains filtered or unexported fields
}

Tracker is the on-disk sidecar shape.

func Load

func Load(path string) (*Tracker, error)

Load reads the sidecar at path; a missing file yields an empty tracker.

func (*Tracker) Add

func (t *Tracker) Add(e Entry)

Add inserts or replaces the entry with the same Ref (or, absent a ref, the same Kind+Name) so re-installs update in place instead of duplicating.

func (*Tracker) Save

func (t *Tracker) Save() error

Save atomically writes the sidecar (tmp + rename).

Jump to

Keyboard shortcuts

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