Skip to main content

Class: RecipeRegistry

Defined in: src/ai/recipe-registry.ts:49

Queryable registry of reusable test pattern recipes.

Intent​

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

Capability​

AI recipe lookup, test scaffolding.

Example​

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

Constructors​

Constructor​

new RecipeRegistry(): RecipeRegistry

Defined in: src/ai/recipe-registry.ts:61

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(): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:211

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

Returns​

RecipeEntry[]

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): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:230

Returns the top n recipes from the registry.

Parameters​

n​

number

Maximum number of recipes to return.

Returns​

RecipeEntry[]

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): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:186

Searches recipes by substring match against title or description.

Parameters​

query​

string

Substring to search for.

Returns​

RecipeEntry[]

Matching recipe entries.

Remarks​

Case-insensitive substring match. Also checks tags for matches. For semantic search, pass forAI() output directly to an LLM.

Example​

const loginRecipes = registry.search('login');
const samlRecipes = registry.search('saml');

select()​

select(filter): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:110

Returns recipes matching the given filter criteria.

Parameters​

filter​

RecipeFilter

Optional category and/or role constraints.

Returns​

RecipeEntry[]

Matching recipe entries.

Remarks​

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

Example​

const agentRecipes = registry.select({ role: 'ai-agent' });
const authNav = registry.select({ category: 'auth', role: 'both' });

selectByCategory()​

selectByCategory(category): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:151

Returns recipes matching the given category.

Parameters​

category​

string

Category string to filter by.

Returns​

RecipeEntry[]

Matching recipe entries.

Example​

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

selectByPriority()​

selectByPriority(priority): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:166

Returns recipes matching the given priority level.

Parameters​

priority​

RecipePriority

Priority level to filter by.

Returns​

RecipeEntry[]

Matching recipe entries.

Example​

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

selectByRole()​

selectByRole(role): RecipeEntry[]

Defined in: src/ai/recipe-registry.ts:136

Returns recipes matching the given role.

Parameters​

role​

RecipeRole

Audience role to filter by.

Returns​

RecipeEntry[]

Matching recipe entries.

Example​

const agentRecipes = registry.selectByRole('ai-agent');

fromEntries()​

static fromEntries(entries): RecipeRegistry

Defined in: src/ai/recipe-registry.ts:80

Creates a registry seeded with an explicit list of entries.

Parameters​

entries​

readonly RecipeEntry[]

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]);