profile

package
v0.7.29-dev.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package profile stores a QuickAgent's MCP profile: the persistent, credentialed half of its gateway configuration, keyed by signature — ns/name@version plus the archive digest, the same identity the install cache uses. A profile holds the application keys and identities the declared contract needs so a later run of the same release "just uses the authenticated resources"; whether it survives the run is the operator's keep/remove choice.

Values live only here (dir 0700, file 0600) and in the per-run gateway secrets file the engine deletes at teardown; they never enter plans, receipts, or process listings — the v1 invariants hold unchanged.

Index

Constants

View Source
const Version = "1"

Version is the profile schema major.

Variables

This section is empty.

Functions

func Dir

func Dir(home, ns, name, version, digestSuffix string) string

Dir is the profile directory for one signature under the runner home.

func RefMatches

func RefMatches(ref, sel string) bool

RefMatches is the release selector the runner's state commands share (`profiles remove`, `connections remove`, `uninstall`): ref is ns/name@version; sel names it exactly, or as ns/name for every version.

func Remove

func Remove(dir string) error

Remove deletes a profile directory; absence is not an error.

Types

type Entry

type Entry struct {
	Dir     string
	Profile *Profile
}

Entry is one stored profile plus its location, for listings.

func List

func List(home string) ([]Entry, error)

List walks every stored profile under the runner home, sorted by ref. Unreadable entries are skipped with their error attached to a nil Profile so `agentry profiles list` can show, not hide, a broken one.

type Profile

type Profile struct {
	// ProfileVersion pins the schema ("1").
	ProfileVersion string `json:"profileVersion"`
	// Ref is ns/name@version; Digest is the verified archive digest. A
	// different digest is a different trust decision and gets a fresh
	// guided setup.
	Ref    string `json:"ref"`
	Digest string `json:"digest"`
	// Keep records the operator's completion choice: true → the profile
	// survives the run; false → the run deletes it on completion.
	Keep bool `json:"keep"`
	// CreatedAt / LastUsedAt are RFC3339 audit stamps.
	CreatedAt  string `json:"createdAt"`
	LastUsedAt string `json:"lastUsedAt,omitempty"`
	// Secrets maps declared env NAMES to the values guided setup
	// collected. A name absent here falls back to the policy secret
	// source at run time.
	Secrets map[string]string `json:"secrets,omitempty"`
}

Profile is one QuickAgent signature's stored configuration.

func Load

func Load(dir string) (*Profile, error)

Load reads a profile; (nil, nil) when none exists — absence is the normal first-run state, not an error.

func New

func New(ref, digest string, keep bool, secrets map[string]string) *Profile

New builds a fresh profile for a signature.

func (*Profile) MatchesRef

func (p *Profile) MatchesRef(sel string) bool

MatchesRef reports whether the profile belongs to ns/name or ns/name@version (the `agentry profiles remove` selector).

func (*Profile) Save

func (p *Profile) Save(dir string) error

Save writes the profile with owner-only permissions.

func (*Profile) SecretNames

func (p *Profile) SecretNames() []string

SecretNames lists the stored secret names, sorted — for display; values are never printed by any surface.

func (*Profile) Touch

func (p *Profile) Touch(dir string) error

Touch stamps LastUsedAt and persists.

Jump to

Keyboard shortcuts

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