bundle

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefinitionForArtifact

func DefinitionForArtifact(
	snapshot catalog.Snapshot,
	record artifact.Artifact,
) (definition.Definition, error)

func DefinitionsForDocument

func DefinitionsForDocument(
	document BundleDocument,
) (map[basespec.SubresourceLocator]definition.Definition, error)

func DocumentLocatorForPackage

func DocumentLocatorForPackage(
	address source.ManagedPackageAddress,
) (basespec.Locator, error)

func EncodeAttachmentData

func EncodeAttachmentData(
	value AttachmentData,
) (json.RawMessage, error)

func EncodeCollectionData

func EncodeCollectionData(
	value CollectionData,
) (json.RawMessage, error)

func IsBundleDocumentLocator

func IsBundleDocumentLocator(value basespec.Locator) bool

func PackageAddressForBundle

func PackageAddressForBundle(
	logicalName basespec.LogicalName,
	logicalVersion basespec.LogicalVersion,
) (source.ManagedPackageAddress, error)

func ServerFromCanonicalBundle

func ServerFromCanonicalBundle(
	bundle BundleDocument,
	name string,
) (mcpDomainServer.ServerDocument, error)

ServerFromCanonicalBundle projects one server from a Bundle that has already been accepted and canonicalized by the Artifact Store shareable schema registry.

It deliberately does not call CanonicalizeServer. MCP lifecycle code must not create a second portable-document validation path after registry canonicalization.

func ValidateStoreTopology

func ValidateStoreTopology(value StoreTopology) error

ValidateStoreTopology validates MCP Bundle-specific attachment and Source invariants. It deliberately does not repeat generic Artifact Store model validation or CollectionData decoding.

Types

type AttachmentData

type AttachmentData struct {
	SchemaVersion  string                       `json:"schemaVersion"`
	PackageAddress source.ManagedPackageAddress `json:"packageAddress"`
}

func DecodeAttachmentData

func DecodeAttachmentData(
	raw json.RawMessage,
) (AttachmentData, error)

func (AttachmentData) DocumentLocator

func (d AttachmentData) DocumentLocator() (basespec.Locator, error)

func (AttachmentData) Validate

func (d AttachmentData) Validate() error

type BundleDocument

type BundleDocument struct {
	Kind          collection.CollectionKind `json:"kind"`
	SchemaID      schema.SchemaID           `json:"schemaID"`
	SchemaVersion string                    `json:"schemaVersion"`
	Digest        cryptoutil.Digest         `json:"digest,omitempty"`

	LogicalName    basespec.LogicalName    `json:"logicalName"`
	LogicalVersion basespec.LogicalVersion `json:"logicalVersion,omitempty"`
	DisplayName    string                  `json:"displayName,omitempty"`
	Description    string                  `json:"description,omitempty"`
	Labels         map[string]string       `json:"labels,omitempty"`

	MCPServers      map[string]mcpDomainServer.CoreServer `json:"mcpServers"`
	BundleExtension BundleExtension                       `json:"bundleExtension"`
}

func BundleFromParsedDocument

func BundleFromParsedDocument(
	input schema.ParsedDocument,
) (BundleDocument, error)

BundleFromParsedDocument projects an Artifact Store-validated canonical MCP Bundle document into the MCP domain model.

It is intentionally not a second schema-validation entry point. Untrusted bytes must first pass through shareable.ExpectedCanonicalizer with BundleCodec{}.Key(). This helper verifies the registry output identity, canonical-byte invariant, and document digest before MCP lifecycle code consumes the typed projection.

func CanonicalizeBundle

func CanonicalizeBundle(
	input BundleDocument,
) (BundleDocument, json.RawMessage, error)

func (BundleDocument) Validate

func (value BundleDocument) Validate() error

type BundleExtension

type BundleExtension struct {
	Servers  map[string]mcpDomainServer.ServerExtension `json:"servers,omitempty"`
	Policies map[string]mcpDomainPolicy.PolicyDocument  `json:"policies,omitempty"`
}

type CollectionData

type CollectionData struct {
	SchemaVersion           string                  `json:"schemaVersion"`
	DiscoveryPolicyRevision string                  `json:"discoveryPolicyRevision"`
	LogicalName             basespec.LogicalName    `json:"logicalName"`
	LogicalVersion          basespec.LogicalVersion `json:"logicalVersion,omitempty"`
	Labels                  map[string]string       `json:"labels,omitempty"`
	ManagedSourceID         source.SourceID         `json:"managedSourceID,omitempty"`
}

func DecodeCollectionData

func DecodeCollectionData(
	raw json.RawMessage,
) (CollectionData, error)

func (CollectionData) Validate

func (value CollectionData) Validate() error

type StoreAttachment

type StoreAttachment struct {
	RootID       root.RootID
	CollectionID collection.CollectionID
	SourceID     source.SourceID
	Role         collection.AttachmentRole
}

type StoreSource

type StoreSource struct {
	ID     source.SourceID
	RootID root.RootID
	Kind   source.SourceKind
}

type StoreTopology

type StoreTopology struct {
	Collection  collection.CollectionRef
	Data        CollectionData
	Attachments []StoreAttachment
	Sources     []StoreSource
}

StoreTopology is the normalized MCP Bundle topology projected from Artifact Store values.

Generic Artifact Store entity validation is complete before this value is assembled. This type validates only MCP Bundle-specific relationships.

Jump to

Keyboard shortcuts

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