localinstall

package
v0.7.14-dev.9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package localinstall installs a QuickAgent from a folder on this machine that was never published, into the runner home, where it lists among the installed QuickAgents and runs by name. It is how the desktop's Drafter "Install" puts a draft on this computer without a registry, a pipeline or a credit, and `agentry install --local DIR` is the CLI's form of it.

A local install is unsigned: nothing but the folder vouches for it, so a run of it asks the unsigned consent every time, as `run --local` does. Unlike `run --local`, it is not its own source once installed: the folder is staged as `agentry publish` would pack it, the consent is the staged manifest's, that same staged tree is laid down and sealed under the runner home's integrity key, and a run holds it to that record like any installed release. A copy whose files changed after the install is refused, and laid down again only from its folder, on the person's word (Repair).

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidManifest = errors.New("the folder's manifest is invalid")

ErrInvalidManifest wraps a folder whose manifest the registry's own publish rules refuse.

Functions

func Materialize

func Materialize(home, namespace, name, version string) (meta *installdir.Meta, releaseDir string, ok bool, err error)

Materialize finds a local install of namespace/name under home when the agent's record is one, and holds it to its integrity record before anything trusts it. ok is false when the agent has no local install (a registry release, or nothing installed), or when version names another version than the local one: the caller resolves through the registry then. A local install whose files changed is refused (*installdir.ChangedError), and one missing or unsealed is an error: a local install has no registry to fetch it again from. An install record that cannot be read is an error with ok false, for the caller to say.

Types

type Staged

type Staged struct {
	Manifest *manifest.Manifest
	// Digest is the archive digest, the same one `agentry publish` would
	// claim for this folder.
	Digest string
	// Tree is the staged package, in a directory only this user can read;
	// Close removes it.
	Tree string
	// Warnings are the manifest rules' warnings, for the caller to show.
	Warnings []error
}

Staged is a folder packed as publish packs it and extracted aside: the tree and the manifest a consent is shown for, and the only tree Install lays down, so what is installed is what was consented to.

func Stage

func Stage(dir string, lim pkgarchive.ExtractLimits) (*Staged, error)

Stage packs the folder with publish.include, extracts the archive aside within lim, and holds the staged manifest, the one shown and installed, to the registry's own publish rules.

func (*Staged) Close

func (s *Staged) Close() error

Close removes the staged tree.

func (*Staged) Install

func (s *Staged) Install(home, style string) (string, error)

Install lays the staged tree down under home, sealed, with the coding-agent export in style (installdir.StyleForHome's, as a registry install writes it), records it in installed.yaml as a local install of this digest under the runner's consent key, and removes the agent's other releases, as an install of a newer version does. An installed.yaml that cannot be read is rewritten holding this record alone, as a registry install treats it as a first install. It is called once the person has consented to s.Manifest's contract; it asks nothing, and refuses a staged tree whose manifest no longer matches what was shown. An installed copy of the same digest whose files changed is refused (*installdir.ChangedError); Repair replaces it.

func (*Staged) Meta

func (s *Staged) Meta() *installdir.Meta

Meta is the release's install.json: the local source, and the local attestation state with no consent in it (install.json holds the verdict, never a consent).

func (*Staged) Ref

func (s *Staged) Ref() string

Ref is the installed QuickAgent's ns/name@version.

func (*Staged) ReleaseDir

func (s *Staged) ReleaseDir(home string) string

ReleaseDir is where Install lays the release down under home.

func (*Staged) Repair

func (s *Staged) Repair(home, style string) (string, error)

Repair is Install on the person's word that an installed copy of this release whose files changed is to be replaced from the folder.

Jump to

Keyboard shortcuts

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