agentpluginscli

package
v0.0.0-...-cb63059 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 87 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkillsPlanStale = errors.New("skill installation plan is stale")

Functions

func ErrorText

func ErrorText(args []string, output io.Writer, err error) string

ErrorText uses the same flag parser without executing a command or touching state. Malformed flags and unknown commands deliberately keep their diagnostic unstyled.

func ManagementEnvironmentID

func ManagementEnvironmentID(cfg management.Startup) string

ManagementEnvironmentID identifies the engine's durable receipt environment. cfg must have passed NormalizeManagementStartup. A relocated manifest or client executable must not hide interrupted work for the same native state store.

func NewLegacyLifecycle

func NewLegacyLifecycle(statePath string) ports.LegacyLifecycle

func NewRoot

func NewRoot(app App) *cobra.Command

func NormalizeManagementStartup

func NormalizeManagementStartup(input management.Startup) (management.Startup, error)

NormalizeManagementStartup captures immutable trusted-host facts. A display ID supplied by a host never lets different roots share accepted request identity.

func ShouldWriteAgentFailure

func ShouldWriteAgentFailure(err error) bool

ShouldWriteAgentFailure opts in only early usage errors. Source selection errors already emit their own JSON; old native refusals require empty stdout.

func WriteAgentFailure

func WriteAgentFailure(writer io.Writer, err error) error

WriteAgentFailure is called only when the command has not already emitted a JSON document. The caller must keep the nonzero exit status and stderr.

Types

type AgentAction

type AgentAction struct {
	Code    string `json:"code"`
	Actor   string `json:"actor"`
	Message string `json:"message"`
}

AgentAction is actionable guidance, not proof of native activation.

type AgentFailure

type AgentFailure struct {
	Code        string        `json:"code"`
	Message     string        `json:"message"`
	Retryable   bool          `json:"retryable"`
	NextActions []AgentAction `json:"next_actions,omitempty"`
}

AgentFailure deliberately never serializes raw native/transport errors.

type App

type App struct {
	// Explicit selected-client startup is distinct from install/activation.
	SessionEnv         clients.Env
	StartNativeSession func(context.Context, clients.SessionPlan, []string) error
	ManagementFactory  func(management.Startup) (App, error)
	// ForScope composes an isolated runtime after command flags select its context.
	ForScope    func(domain.InstallScope, string) (App, error) `json:"-"`
	Scope       domain.InstallScope                            `json:"-"`
	ProjectRoot string                                         `json:"-"`

	Prompter      prompt.Prompter
	PromptFactory func(io.Reader, io.Writer, io.Writer, bool, bool) (prompt.Prompter, io.Writer, error)

	// InstallLogDir receives technical install logs. It is always a per-user
	// location: a project root belongs to the repository and never holds logs.
	InstallLogDir string

	Version              string
	UserHome             string
	ManagedRoot          string
	DependenciesRoot     string
	EnvironmentStoreRoot string
	EnvironmentLockPath  string
	StateStore           transaction.StateStore
	Detector             ports.ClientDetector
	// ClientRegistry is the set of client adapters this binary knows about. The
	// composition root decides it; CLI commands receive the already-built planner
	// and never reconstruct one.
	ClientRegistry             *clients.Registry
	Planner                    ports.DeliveryPlanner
	Targets                    ports.DeliveryTargetResolver
	DirectoryClient            DirectoryClient
	DirectoryClientForDryRun   func(string) (DirectoryClient, error)
	CommitDirectoryPreview     func(DirectoryClient) error
	DiscoveryClient            DiscoveryClient
	SourceAcquirer             SourceAcquirer
	PackageLoader              ports.PackageLoader
	NativePackageLoader        ports.PackageLoader
	SecurityIndex              SecurityIndex
	SecurityEvaluator          ports.PackageSecurityEvaluator
	SecurityEvaluatorForDryRun func(string) ports.PackageSecurityEvaluator
	SourceAcquirerForDryRun    func(string) SourceAcquirer
	// Installer is the public facade used by the qualified explicit local
	// package path. Other CLI acquisition and lifecycle paths remain on the
	// existing service until their contracts are qualified separately.
	Installer       *installer.Engine
	Lifecycle       usecase.Service
	StateMigrator   *statemigration.Migrator
	LegacyLifecycle ports.LegacyLifecycle
	LegacyStateLock ports.MutationLock
	Input           io.Reader
	Output          io.Writer
	ErrorOutput     io.Writer
	Terminal        bool
	// contains filtered or unexported fields
}

func ConfigureManagementApp

func ConfigureManagementApp(app App, cfg management.Startup) (App, error)

ConfigureManagementApp is called after the executable composition root creates the engine for StateRoot. Native profile detection is explicit in this mode.

func (App) PrepareSkills

func (app App) PrepareSkills(ctx context.Context, input SkillsBatchRequest) (plan *PreparedSkillsBatch, err error)

PrepareSkills acquires exact selected commits in disposable storage and prepares one complete candidate graph. It never writes intent, persistent cache or profiles.

func (App) StartSkillsPicker

func (app App) StartSkillsPicker(ctx context.Context, input SkillsPickerRequest) (*skillspicker.Server, error)

StartSkillsPicker resolves a real immutable Git source and joins discovery and the same prepared batch installer used by terminal selection. Closing the server releases all source and review scratch workspaces.

type CLIUsageError

type CLIUsageError struct {
	Code    string
	Message string
}

CLIUsageError carries a fixed safe diagnostic without re-parsing stderr.

func (CLIUsageError) Error

func (e CLIUsageError) Error() string

type DirectoryClient

type DirectoryClient interface {
	Load(context.Context, uint64) (directoryv1.VerifiedBundle, error)
}

type DiscoveryClient

type DiscoveryClient interface {
	Load(context.Context, uint64) (discoveryv1.VerifiedBundle, error)
}

type ManagementBackend

type ManagementBackend struct {
	// contains filtered or unexported fields
}

ManagementBackend adapts shared application behavior to the generated wire contract. Prepared handles and catalog selections remain private Go objects.

func NewManagementBackend

func NewManagementBackend(app App, input management.Startup) (*ManagementBackend, error)

func (*ManagementBackend) Catalog

func (b *ManagementBackend) Catalog(ctx context.Context, query string) (management.Catalog, error)

func (*ManagementBackend) CatalogDetail

func (b *ManagementBackend) CatalogDetail(ctx context.Context, id string) (management.CatalogEntry, error)

func (*ManagementBackend) CheckUpdates

CheckUpdates is explicit network work. Inspect remains a passive snapshot.

func (*ManagementBackend) Close

func (b *ManagementBackend) Close()

func (*ManagementBackend) ContextID

func (b *ManagementBackend) ContextID() string

func (*ManagementBackend) DiscardSkillsCatalog

func (b *ManagementBackend) DiscardSkillsCatalog(ctx context.Context, catalogID string) error

DiscardSkillsCatalog releases only discovery resources. Prepared selected-Skill plans own independently retained source snapshots and remain valid.

func (*ManagementBackend) EnvironmentID

func (b *ManagementBackend) EnvironmentID() string

func (*ManagementBackend) ForgetObservation

func (b *ManagementBackend) ForgetObservation(ctx context.Context, operation management.Operation) error

ForgetObservation is called only for an expired settled observation while the transport holds its acceptance lock. It removes verified private undo data, never an active Skill, and refuses ambiguous or user-modified backup contents.

func (*ManagementBackend) Inspect

func (*ManagementBackend) Prepare

func (b *ManagementBackend) Prepare(ctx context.Context, input management.ChangeRequest, operationID string) (management.Prepared, error)

func (*ManagementBackend) PrepareLocalSkill

func (b *ManagementBackend) PrepareLocalSkill(ctx context.Context, input management.LocalSkillRequest, operationID string) (management.Prepared, error)

func (*ManagementBackend) Session

func (*ManagementBackend) SkillPreview

func (b *ManagementBackend) SkillPreview(ctx context.Context, catalogID, candidateID string) (management.SkillPreview, error)

func (*ManagementBackend) SkillsCatalog

type PreparedSkillsBatch

type PreparedSkillsBatch struct {
	// contains filtered or unexported fields
}

func (*PreparedSkillsBatch) Actions

func (p *PreparedSkillsBatch) Actions() []SkillsAction

func (*PreparedSkillsBatch) Apply

Apply is called only after explicit confirmation by the caller. The existing environment lock/rechecks and installer receipts own all durable effects.

func (*PreparedSkillsBatch) ApplyWithProgress

func (p *PreparedSkillsBatch) ApplyWithProgress(ctx context.Context, progress func(SkillsProgress)) (SkillsBatchResult, error)

ApplyWithProgress observes the same transaction as Apply. An observer is presentation only; its panic cannot change native effects or receipts.

func (*PreparedSkillsBatch) Check

func (p *PreparedSkillsBatch) Check(ctx context.Context) error

func (*PreparedSkillsBatch) Close

func (p *PreparedSkillsBatch) Close()

func (*PreparedSkillsBatch) Warnings

func (p *PreparedSkillsBatch) Warnings() []string

type SecurityIndex

type SecurityIndex interface {
	Lookup(context.Context, domain.SecuritySubject) (*domain.SecurityAssessment, error)
}

type SkillsAction

type SkillsAction struct{ Alias, ClientID, Action, TargetPath, CandidateID, FromPath, ToPath string }

type SkillsBatchItem

type SkillsBatchItem struct {
	Alias, ClientID, Action, TargetPath, CandidateID, Status, Reason string
	Client                                                           installer.ClientResult
	ManualActions                                                    []string
	// contains filtered or unexported fields
}

type SkillsBatchRequest

type SkillsBatchRequest struct {
	Selections []SkillsSelection
	TargetIDs  []string
}

type SkillsBatchResult

type SkillsBatchResult struct {
	Status             string
	Items              []SkillsBatchItem
	RepairInstructions []string
}

type SkillsPickerRequest

type SkillsPickerRequest struct {
	Input, Ref, Path string
	PathSet          bool
}

SkillsPickerRequest selects one public source; PathSet distinguishes an exact repository root Skill from an unrestricted repository scan.

type SkillsProgress

type SkillsProgress struct {
	Alias, ClientID, Action, Phase string
	Result                         installer.Result
}

type SkillsSelection

type SkillsSelection struct {
	Repository, Commit, Path, Name, Alias, CandidateID string
	Website                                            string
	ExpectedIndexSHA256, ExpectedRawTreeDigest         string
	Selector                                           environment.Selector
}

type SkillsSelectionError

type SkillsSelectionError struct {
	CandidateID string
	Cause       error
}

SkillsSelectionError associates a failed source with the immutable selection. Presentation layers choose a safe message; the cause remains classifiable.

func (*SkillsSelectionError) Error

func (e *SkillsSelectionError) Error() string

func (*SkillsSelectionError) Unwrap

func (e *SkillsSelectionError) Unwrap() error

type SourceAcquirer

type SourceAcquirer interface {
	AcquireLocal(context.Context, string) (domain.PackageSnapshot, error)
	DiscoverGitHubPackages(context.Context, string, string) ([]string, error)
	AcquireGitHub(context.Context, string, string, string) (domain.PackageSnapshot, error)
	AcquireGitHubVerified(context.Context, string, string, string, string) (domain.PackageSnapshot, error)
}

Source Files

Directories

Path Synopsis
Package management provides primitives to interact with the openapi HTTP API.
Package management provides primitives to interact with the openapi HTTP API.
Package managementhttp adapts the Management application to private loopback HTTP.
Package managementhttp adapts the Management application to private loopback HTTP.
Package managementstate implements Management observation persistence and its cross-process mutation lock.
Package managementstate implements Management observation persistence and its cross-process mutation lock.
Package manifestedit edits the supported outer syntax of uap.toml.
Package manifestedit edits the supported outer syntax of uap.toml.
Package prompt is the CLI-owned, presentation-independent interaction port.
Package prompt is the CLI-owned, presentation-independent interaction port.
Package skillspicker provides primitives to interact with the openapi HTTP API.
Package skillspicker provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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