providers

package
v0.0.0-...-4f7fa88 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 37 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activator

type Activator struct {
	OpenCodeTransitions ports.OpenCodeTransitionRecorder
	Runner              ports.CommandRunner
	NativeConfig        *nativeconfig.Kernel
	// Registry supplies the client adapters that own lifecycle. It is injected
	// by the composition root and never defaulted to "every client".
	Registry *clients.Registry
}

func (Activator) Activate

func (activator Activator) Activate(ctx context.Context, request domain.ActivationRequest) (domain.ActivationOutcome, error)

func (Activator) AutomaticallyActivates

func (activator Activator) AutomaticallyActivates(request domain.ActivationRequest) bool

AutomaticallyActivates reports whether Activate will use a managed client CLI for this exact request. Runtime preflight consumes this same predicate so it cannot drift from the provider's activation paths.

func (Activator) Deactivate

func (activator Activator) Deactivate(ctx context.Context, request domain.DeactivationRequest) (domain.DeactivationOutcome, error)

func (Activator) PreflightActivation

func (activator Activator) PreflightActivation(request domain.ActivationRequest) error

PreflightActivation rejects lifecycle configurations that would otherwise discover a missing required capability only after native client mutation.

func (Activator) VerifierAvailable

func (activator Activator) VerifierAvailable(client domain.DetectedClient, plan domain.DeliveryPlan, backendExecutable string) bool

VerifierAvailable reports whether this backend can observe the delivered plan with an exact client-side verifier. Every supported client answers through its adapter; a missing registry or a client without ReadOnlyVerifier is fail-closed.

type NativeIdentityObserver

type NativeIdentityObserver struct {
	Stager           packageVerifier
	Runner           ports.CommandRunner
	DiscoveryTimeout time.Duration
	NativeConfig     *nativeconfig.Kernel
	// Registry supplies the client adapters that inspect native identity. It is
	// injected by the composition root and never defaulted to "every client".
	Registry *clients.Registry
}

NativeIdentityObserver combines package ownership with the client's native registry. A manager-owned path is not proof that the logical identity is free: another prepared marketplace, local plugin, installed CLI entry, or native config entry can already claim the same manifest identity. Native registry discovery executes trusted, short-lived list commands. A tree-aware runner is used when available so Linux requires atomic cgroup containment and Windows uses a Job Object. Plain runners remain supported as injected test/provider implementations, but OS execution never claims cleanup based on descendant sampling.

func (NativeIdentityObserver) ObserveNativeIdentity

func (NativeIdentityObserver) ObservePreparedIdentity

ObservePreparedIdentity inspects only filesystem-backed package identities. It deliberately excludes native CLI discovery so dry-run cannot launch the detected client executable.

type OpenCodeClientPreparation

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

OpenCodeClientPreparation is the trusted host-preparation port for existing CLI lifecycle paths. New captures launch environment once at composition.

func NewOpenCodeClientPreparation

func NewOpenCodeClientPreparation(registry *clients.Registry) *OpenCodeClientPreparation

func (*OpenCodeClientPreparation) PrepareClient

func (p *OpenCodeClientPreparation) PrepareClient(ctx context.Context, envelope domain.PackageEnvelope, client domain.DetectedClient, previous []domain.NativeObjectOwnership, executable string, processInert bool) (domain.OpenCodeHostAuthority, error)

func (*OpenCodeClientPreparation) RevalidateClient

func (p *OpenCodeClientPreparation) RevalidateClient(ctx context.Context, client domain.DetectedClient, plan domain.DeliveryPlan) error

type OpenCodeNamespacePreflight

type OpenCodeNamespacePreflight struct {
	Kernel nativeconfig.Kernel
}

func (OpenCodeNamespacePreflight) CheckMCPNamespace

func (guard OpenCodeNamespacePreflight) CheckMCPNamespace(ctx context.Context, client domain.DetectedClient, plan domain.DeliveryPlan, managed *domain.ClientBinding) error

type PluginDataManager

type PluginDataManager struct {
	Base string
	Now  func() time.Time
	// RunNPM is a test seam; production uses the bounded npm ci runner.
	RunNPM func(context.Context, string, string, bool) error
}

func (PluginDataManager) EnsureData

func (manager PluginDataManager) EnsureData(ctx context.Context, installationID, physicalBackend, scope string) (domain.DataReceipt, bool, error)

func (PluginDataManager) PreflightDataPath

func (manager PluginDataManager) PreflightDataPath(physicalBackend string) (string, bool, error)

PreflightDataPath observes the same locator EnsureData owns, without creating it.

func (PluginDataManager) PrepareRuntime

func (manager PluginDataManager) PrepareRuntime(ctx context.Context, envelope domain.PackageEnvelope, plan domain.DeliveryPlan, dataPath string) error

PrepareRuntime materializes a declarative, integrity-locked npm runtime before client activation. It never runs the plugin's launcher or npm lifecycle scripts. Unselected/non-runtime MCP packages remain inert.

func (PluginDataManager) PurgeData

func (manager PluginDataManager) PurgeData(ctx context.Context, receipt domain.DataReceipt) error

func (PluginDataManager) ValidateData

func (manager PluginDataManager) ValidateData(ctx context.Context, receipt domain.DataReceipt) error

func (PluginDataManager) ValidateDataAt

func (manager PluginDataManager) ValidateDataAt(ctx context.Context, receipt domain.DataReceipt, physicalPath string) error

ValidateDataAt reads a moved physical directory while keeping the original logical locator in both the marker and the caller receipt. The ownership digest binds that locator, not the temporary backup name.

type Stager

type Stager struct {
	LauncherSource  *managedstdio.Source
	SnapshotBuilder packagesnapshot.Builder
	PluginDataRoot  string
	// Registry supplies the client adapters that project a sanitized tree.
	// It is injected by the composition root and never defaulted to "every client".
	Registry *clients.Registry
	// Paths is required. There is deliberately no default: a silently supplied
	// one would let a caller that forgot to wire it keep running with whatever
	// containment rules that default happened to carry.
	Paths ports.PathPolicy
}

func (Stager) Discard

func (stager Stager) Discard(ctx context.Context, delivery domain.StagedDelivery) error

func (Stager) ManagedMCPNames

func (stager Stager) ManagedMCPNames(ctx context.Context, client domain.ClientID, root, digest string) ([]string, error)

ManagedMCPNames reads delivery selection only from a digest-verified artifact. A second verification detects artifact drift during the read. It does not promise protection from same-principal ABA races.

func (Stager) PreflightManagedStdio

func (stager Stager) PreflightManagedStdio(snapshotRoot string) error

PreflightManagedStdio is read-only and called before any installation writes.

func (Stager) ProjectActiveNative

func (stager Stager) ProjectActiveNative(ctx context.Context, envelope domain.PackageEnvelope, plan domain.DeliveryPlan, expectedDigest, dataPath string) ([]domain.NativeObjectOwnership, error)

ProjectActiveNative recomputes the selected native projection in place from the exact installed package. The package digest is checked before reading any projected files; unlike Project, these builders never write to the tree.

func (Stager) Stage

func (stager Stager) Stage(
	ctx context.Context,
	envelope domain.PackageEnvelope,
	plan domain.DeliveryPlan,
	operationID string,
	hints domain.CompatibilityHints,
) (delivery domain.StagedDelivery, err error)

func (Stager) StageWithPluginData

func (stager Stager) StageWithPluginData(
	ctx context.Context,
	envelope domain.PackageEnvelope,
	plan domain.DeliveryPlan,
	operationID string,
	hints domain.CompatibilityHints,
	pluginDataPath string,
) (delivery domain.StagedDelivery, err error)

StageWithPluginData binds projections to the exact owned locator recorded by lifecycle state. It is an optional extension to ports.PackageStager so older non-stdio test doubles remain source-compatible.

func (Stager) Verify

func (stager Stager) Verify(ctx context.Context, root, expectedDigest string) error

Jump to

Keyboard shortcuts

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