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 bookloadPathKeys()- Loads path keysresolvePathDefaults()- Resolves default pathsresolveModule()- Resolves module by IDgetDefaultParameters()- Returns default parametersvalidateGenome()- Validates genomeloadTemplate()- 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
- Complete Interface Reference - Full documentation
- Recipe Books - Package → Module mapping
- Path Keys - Semantic path definitions
- Marketplace-CLI Relationship - How they work together