cardmetadata

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package cardmetadata prepares and transactionally materializes repository- relative Agent Cards. It deliberately treats cards as opaque Git blobs: the bytes are neither parsed nor rewritten.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(root, alias string, prepared Prepared) (restore func() error, finalize func(), err error)

Apply replaces the alias metadata atomically. For an HTTPS card this removes an obsolete local snapshot. The returned restore and finalize callbacks let lifecycle include the operation in its wider dependency transaction.

func ForList

func ForList(root, alias string, locked manifest.LockedAgent) (manifest.LockedAgent, []string)

ForList returns a copy suitable for offline list output. A missing or unsafe local file is never returned as a usable card reference.

func Remove

func Remove(root, alias string) (restore func() error, finalize func(), err error)

Remove transactionally removes metadata for an alias.

func ResolvedPath

func ResolvedPath(alias string) string

ResolvedPath returns the stable consumer-relative reference used in locks and list output for a repository-relative card.

Types

type FileFetcher

type FileFetcher interface {
	File(ctx context.Context, source, commit, filePath string) ([]byte, error)
}

FileFetcher reads one byte-exact file from a resolved Git commit.

type Prepared

type Prepared struct {
	Agent manifest.LockedAgent
	// contains filtered or unexported fields
}

Prepared is read-only preparation for a later transactional Apply.

func Prepare

func Prepare(ctx context.Context, fetcher FileFetcher, alias, source, commit, manifestRoot string, agent manifest.Agent) (Prepared, error)

Prepare resolves an upstream card declaration. HTTPS references remain external; repository-relative declarations are fetched relative to the upstream manifest root from the already resolved commit.

Jump to

Keyboard shortcuts

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