Skip to main content
Version: 1.x

Class: CapabilityRegistry

Queryable registry of Praman API capabilities for AI agents.

Intent

Expose Praman API surface to LLMs for test generation.

Capability

pramanAI.capabilities

Example

const registry = new CapabilityRegistry();
const tableCaps = registry.byCategory('table');
const aiContext = registry.forAI();

Constructors

Constructor

new CapabilityRegistry(): CapabilityRegistry

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

Returns

CapabilityRegistry

Example

const registry = new CapabilityRegistry();
logger.info(registry.list().length);

Properties

registryVersion

readonly static registryVersion: 1 = 1

Registry schema version.

Remarks

Bumped when the entry shape changes. Consumers can use this to detect incompatible generated files at runtime.

Methods

byCategory()

byCategory(category): object[]

Returns capabilities matching the given category.

Parameters

category

"ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert"

Category to filter by.

Returns

Entries whose category matches exactly.

Example

const navCaps = registry.byCategory('navigate');

byNamespace()

byNamespace(namespace): object[]

Returns capabilities matching the given namespace prefix.

Parameters

namespace

string

Dot-separated namespace prefix, e.g. 'ui5.table'.

Returns

Entries whose qualifiedName starts with the namespace.

Example

const tableCaps = registry.byNamespace('ui5.table');

find()

find(query): object[]

Searches capabilities by partial match against name or description.

Parameters

query

string

Substring to search for.

Returns

Entries whose name or description contains the query.

Remarks

Case-insensitive substring match. For semantic search, feed the result list into an embedding model or pass forAI() output to an LLM.

Example

const clickCaps = registry.find('click');

findByName()

findByName(name): { aiSteering?: string; async?: boolean; category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert"; controlTypes?: string[]; description: string; id: string; intent?: string; name: string; priority: "fixture" | "namespace" | "implementation"; qualifiedName: string; registryVersion: 1; sapModule?: string; usageExample: string; } | undefined

Returns the first capability entry matching the given name, or undefined.

Parameters

name

string

Human-readable capability name to look up (case-sensitive).

Returns

The matching entry, or undefined if not found.

Type Literal

{ aiSteering?: string; async?: boolean; category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert"; controlTypes?: string[]; description: string; id: string; intent?: string; name: string; priority: "fixture" | "namespace" | "implementation"; qualifiedName: string; registryVersion: 1; sapModule?: string; usageExample: string; }

aiSteering?

optional aiSteering?: string

AI agent steering — tells agents to prefer a higher-level alternative.

async?

optional async?: boolean

Whether this is an async method.

category

category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert" = CapabilityCategorySchema

Logical grouping for filtering.

controlTypes?

optional controlTypes?: string[]

UI5 control types this capability works with.

description

description: string

One-sentence description of what this capability does.

id

id: string

Unique identifier in UI5-PREFIX-NNN format.

intent?

optional intent?: string

Optional intent tag.

name

name: string

Human-readable function or method name.

priority

priority: "fixture" | "namespace" | "implementation" = CapabilityPrioritySchema

REQUIRED priority tier.

qualifiedName

qualifiedName: string

Dot-separated agent-friendly name, e.g. 'ui5.table.getRows'.

registryVersion

registryVersion: 1

Registry schema version for forward compatibility.

sapModule?

optional sapModule?: string

Optional SAP UI5 module tag.

usageExample

usageExample: string

Ready-to-run usage example string.


undefined

Remarks

Searches by human-readable name (not id). For exact ID lookup use get().

Example

const cap = registry.findByName('clickButton');
if (cap !== undefined) {
logger.info(cap.usageExample);
}

forAI()

forAI(): CapabilitiesJSON

Returns the full registry as structured JSON optimised for AI agent consumption.

Returns

CapabilitiesJSON

Structured JSON snapshot of the entire registry.

Remarks

Currently an alias for toJSON(). Future releases may apply provider-specific formatting or token-budget-aware truncation.

Example

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

forProvider()

forProvider(provider): string

Returns capabilities formatted for a specific AI provider.

Parameters

provider

AiProviderName

Target AI provider name.

Returns

string

Formatted capability descriptions as a string.

Remarks

Each provider receives a format optimised for its native consumption pattern:

  • 'claude' — XML-structured {@literal <capability>} elements with attributes
  • 'openai' — JSON array of function-calling tool schemas
  • 'gemini' — Plain text listing with name, description, and example

Example

const registry = new CapabilityRegistry();
const claudeContext = registry.forProvider('claude');
const openaiTools = registry.forProvider('openai');
const geminiText = registry.forProvider('gemini');

get()

get(id): { aiSteering?: string; async?: boolean; category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert"; controlTypes?: string[]; description: string; id: string; intent?: string; name: string; priority: "fixture" | "namespace" | "implementation"; qualifiedName: string; registryVersion: 1; sapModule?: string; usageExample: string; } | undefined

Returns the capability entry with the given id, or undefined.

Parameters

id

string

Unique kebab-case capability identifier.

Returns

The matching entry, or undefined if not registered.

Type Literal

{ aiSteering?: string; async?: boolean; category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert"; controlTypes?: string[]; description: string; id: string; intent?: string; name: string; priority: "fixture" | "namespace" | "implementation"; qualifiedName: string; registryVersion: 1; sapModule?: string; usageExample: string; }

aiSteering?

optional aiSteering?: string

AI agent steering — tells agents to prefer a higher-level alternative.

async?

optional async?: boolean

Whether this is an async method.

category

category: "ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert" = CapabilityCategorySchema

Logical grouping for filtering.

controlTypes?

optional controlTypes?: string[]

UI5 control types this capability works with.

description

description: string

One-sentence description of what this capability does.

id

id: string

Unique identifier in UI5-PREFIX-NNN format.

intent?

optional intent?: string

Optional intent tag.

name

name: string

Human-readable function or method name.

priority

priority: "fixture" | "namespace" | "implementation" = CapabilityPrioritySchema

REQUIRED priority tier.

qualifiedName

qualifiedName: string

Dot-separated agent-friendly name, e.g. 'ui5.table.getRows'.

registryVersion

registryVersion: 1

Registry schema version for forward compatibility.

sapModule?

optional sapModule?: string

Optional SAP UI5 module tag.

usageExample

usageExample: string

Ready-to-run usage example string.


undefined

Example

const cap = registry.get('click-button');
if (cap !== undefined) {
logger.info(cap.usageExample);
}

getStatistics()

getStatistics(): CapabilityStats

Returns a statistical summary of the capability registry.

Returns

CapabilityStats

Statistics including total count, categories, and priority breakdown.

Example

const stats = registry.getStatistics();
logger.info(`Total: ${stats.totalMethods}`);

has()

has(name): boolean

Returns true if a capability with the given name is registered.

Parameters

name

string

Human-readable capability name to look up.

Returns

boolean

true when at least one entry matches.

Remarks

Searches by name (not id). Names are not guaranteed unique but are human-readable and match the TSDoc @capability tag value.

Example

if (registry.has('clickButton')) {
// safe to use
}

list()

list(): object[]

Returns all registered capability entries.

Returns

Shallow copy of the full capability list.

Example

const all = registry.list();
logger.info(all.length);

listByPriority()

listByPriority(priority): object[]

Returns capabilities matching the given priority tier.

Parameters

priority

"fixture" | "namespace" | "implementation"

Priority level to filter by.

Returns

Entries whose priority matches exactly.

Example

const fixtures = registry.listByPriority('fixture');
const handlers = registry.listByPriority('namespace');

register()

register(entry): void

Registers a new capability entry or overwrites an existing one by id.

Parameters

entry

Capability entry to add or replace.

aiSteering?

string = ...

AI agent steering — tells agents to prefer a higher-level alternative.

async?

boolean = ...

Whether this is an async method.

category

"ui5" | "auth" | "navigate" | "table" | "dialog" | "date" | "odata" | "fe" | "intent" | "flp" | "shell" | "footer" | "ai" | "data" | "assert" = CapabilityCategorySchema

Logical grouping for filtering.

controlTypes?

string[] = ...

UI5 control types this capability works with.

description

string = ...

One-sentence description of what this capability does.

id

string = ...

Unique identifier in UI5-PREFIX-NNN format.

intent?

string = ...

Optional intent tag.

name

string = ...

Human-readable function or method name.

priority

"fixture" | "namespace" | "implementation" = CapabilityPrioritySchema

REQUIRED priority tier.

qualifiedName

string = ...

Dot-separated agent-friendly name, e.g. 'ui5.table.getRows'.

registryVersion

1 = ...

Registry schema version for forward compatibility.

sapModule?

string = ...

Optional SAP UI5 module tag.

usageExample

string = ...

Ready-to-run usage example string.

Returns

void

Remarks

Intended for use in tests and plugins. The generated file should not call this method — run npm run generate:capabilities instead.

Example

registry.register({
id: 'UI5-UI5-020',
qualifiedName: 'ui5.myCapability',
name: 'myCapability',
description: 'Does something useful for testing.',
category: 'ui5',
priority: 'fixture',
usageExample: 'await ui5.myCapability()',
registryVersion: 1,
});

toJSON()

toJSON(): CapabilitiesJSON

Exports the full registry as a structured JSON object.

Returns

CapabilitiesJSON

Structured JSON snapshot of the entire registry.

Remarks

Fixtures are listed first (Playwright best practice), then all methods.

Example

const json = registry.toJSON();
logger.info(JSON.stringify(json, null, 2));