Skip to main content
Version: 1.x

Class: RecipeRegistry

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

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:68

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[]

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

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[]

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

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[]

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

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[]

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

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[]

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

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[]

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

Returns recipes matching the given priority level.

Parameters

priority

Priority level to filter by.

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

Returns

Matching recipe entries.

Example

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

fromEntries()

static fromEntries(entries): RecipeRegistry

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

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