v2
Marketplace Documentation
Marketplace Adapter Interface

Marketplace Adapter Interface

The Marketplace Adapter Interface is the contract between the CLI and marketplaces. All marketplaces must implement this interface.

Note: For the complete interface reference, see Marketplace Adapter Interface.

Overview

Marketplace adapters provide a standardized interface for:

  • Loading manifests, recipe books, and path keys
  • Transforming genomes (V2Genome → StandardizedGenome)
  • Resolving paths and modules
  • Providing default parameters

Required Methods

loadManifest()

Loads the marketplace manifest that describes all available modules.

async loadManifest(): Promise<MarketplaceManifest>

transformGenome()

Transforms a raw genome (V2Genome, Genome, etc.) into a StandardizedGenome.

async transformGenome(
  genome: V2Genome,
  options?: MarketplaceTransformationOptions,
  context?: MarketplaceTransformationContext
): Promise<StandardizedGenome>

Optional Methods

  • loadRecipeBook() - Loads recipe book
  • loadPathKeys() - Loads path keys
  • resolvePathDefaults() - Resolves default paths
  • resolveModule() - Resolves module by ID
  • getDefaultParameters() - Returns default parameters
  • validateGenome() - Validates genome
  • loadTemplate() - Loads template content

V2Genome Transformation

For V2Genome, the adapter uses the Composition Engine:

async transformGenome(genome: V2Genome, options, context) {
  const handler = new context.V2GenomeHandler(
    context.marketplaceAdapters,
    context.logger,
    context.projectRoot
  );
  
  const lockFile = await handler.resolveGenome(genome, context.projectRoot);
  return handler.convertLockFileToResolvedGenome(lockFile, genome);
}

Related