mcplifecycle

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mcplifecycle contains the reusable, non-UI part of direct MCP profile lifecycle operations. It deliberately does not parse argv, inspect a terminal, install signals, or render command output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Remove

func Remove(settings []byte, name string) ([]byte, error)

Remove prepares settings with the named direct profile removed. Upstream DCR removal remains a command-owned concern because it owns profile loading and user-facing remedy mapping.

Types

type AddRequest

type AddRequest struct {
	Name, URL, Issuer string
	Settings          []byte
	CredentialRoot    string
	FileKeyPath       string
	CredentialStore   string
	Attended          bool
	ConfirmFile       mcpcredential.ConfirmFile
	Progress          Progress
}

AddRequest supplies validated command inputs and the already-read settings document. Settings publication remains with the caller so its locking and CAS policy stay at the file boundary.

type AddResult

type AddResult struct {
	Settings []byte
	Backend  string
	Locator  string
}

AddResult is the prepared settings document and the selected custody backend.

func Add

func Add(ctx context.Context, req AddRequest) (AddResult, error)

Add discovers the issuer, selects pinned custody, and prepares (but does not publish) the direct MCP profile. Key material is cleared before returning. The issuer is supplied when discovery was intentionally performed by the caller; an empty issuer performs discovery here.

type ListEntry

type ListEntry struct {
	Name, URL, Kind, CredentialStatus string
}

ListEntry is the bounded, non-secret profile projection used by list.

func List

func List(cfg permconfig.Config) []ListEntry

List returns the configured profiles from one winning settings document. Credential status is derived solely through mcpcredential's canonical marker inspector and never opens a keyring or reads a credential.

type Progress

type Progress func(string)

Progress identifies an operator-visible lifecycle stage. The command owns rendering these stages; the package never writes to a stream.

Jump to

Keyboard shortcuts

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