Skip to main content
Version: 1.x

Class: RecipeRegistry

Queryable registry of reusable test pattern recipes.

Intent​

Provide curated SAP Fiori test patterns to AI agents and human testers.

Capability​

pramanAI.recipes

Example​

const registry = new RecipeRegistry();
const aiRecipes = registry.forAI();

Constructors​

Constructor​

new RecipeRegistry(): RecipeRegistry

Constructs a registry pre-seeded from the generated recipe list.

Returns​

RecipeRegistry

Example​

const registry = new RecipeRegistry();
logger.info(registry.select({}).length);

Methods​

forAI()​

forAI(): object[]

Returns all recipes in an AI-agent-friendly format.

Returns​

All recipe entries ordered by insertion.

Remarks​

Currently returns all registered entries. Future versions may apply token-budget-aware truncation or relevance scoring.

Example​

const allRecipes = registry.forAI();
const prompt = JSON.stringify(allRecipes);

getTopRecipes()​

getTopRecipes(n): object[]

Returns the top n recipes from the registry.

Parameters​

n​

number

Maximum number of recipes to return.

Returns​

Up to n recipe entries.

Remarks​

Returns at most n entries in insertion order. If fewer than n recipes are registered, all registered entries are returned.

Example​

const topThree = registry.getTopRecipes(3);

search(query): object[]

Searches recipes by substring match against name or description.

Parameters​

query​

string

Substring to search for.

Returns​

Matching recipe entries.

Remarks​

Case-insensitive substring match. For semantic search, pass forAI() output directly to an LLM.

Example​

const loginRecipes = registry.search('login');
const tableRecipes = registry.search('table');

select()​

select(filter): object[]

Returns recipes matching the given filter criteria.

Parameters​

filter​

RecipeFilter

Optional category and/or role constraints.

Returns​

Matching recipe entries.

Remarks​

All specified filter properties are AND-combined. An empty filter object returns all registered recipes.

Example​

const uiRecipes = registry.select({ domain: 'ui5' });
const essential = registry.select({ domain: 'auth', priority: 'essential' });

selectByDomain()​

selectByDomain(domain): object[]

Returns recipes matching the given domain.

Parameters​

domain​

string

Domain string to filter by (e.g. 'ui5', 'table', 'auth').

Returns​

Matching recipe entries.

Example​

const authRecipes = registry.selectByDomain('auth');

selectByPriority()​

selectByPriority(priority): object[]

Returns recipes matching the given priority level.

Parameters​

priority​

"optional" | "essential" | "recommended" | "advanced" | "deprecated"

Priority level to filter by.

Returns​

Matching recipe entries.

Example​

const essentialRecipes = registry.selectByPriority('essential');

fromEntries()​

static fromEntries(entries): RecipeRegistry

Creates a registry seeded with an explicit list of entries.

Parameters​

entries​

readonly object[]

Recipe entries to seed the registry with.

Returns​

RecipeRegistry

A new RecipeRegistry instance containing the given entries.

Remarks​

Use this factory in tests or plugins to provide a known set of recipes without modifying GENERATED_RECIPES.

Example​

const registry = RecipeRegistry.fromEntries([authRecipe, navRecipe]);