Praman — AI-First SAP UI5 Test Automation Platform - v1.0.1
    Preparing search index...

    Class CapabilityRegistry

    Queryable registry of Praman API capabilities for AI agents.

    Expose Praman API surface to LLMs for test generation.

    AI context building, capability discovery.

    const registry = new CapabilityRegistry();
    const caps = registry.byCategory('navigation');
    Index

    Constructors

    Properties

    registryVersion: 1

    Registry schema version.

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

    Methods

    • Returns capabilities matching the given category.

      Parameters

      • category: string

        Category string to filter by (case-sensitive).

      Returns CapabilityEntry[]

      Entries whose category matches exactly.

      const navCaps = registry.byCategory('navigation');
      
    • Searches capabilities by partial match against name or description.

      Parameters

      • query: string

        Substring to search for.

      Returns CapabilityEntry[]

      Entries whose name or description contains the query.

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

      const clickCaps = registry.find('click');
      
    • Returns the first capability entry matching the given name, or undefined.

      Parameters

      • name: string

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

      Returns CapabilityEntry | undefined

      The matching entry, or undefined if not found.

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

      const cap = registry.findByName('clickButton');
      if (cap !== undefined) {
      logger.info(cap.usage_example);
      }
    • Returns the full registry as structured JSON optimised for AI agent consumption.

      Returns CapabilitiesJSON

      Structured JSON snapshot of the entire registry.

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

      const aiContext = registry.forAI();
      const prompt = JSON.stringify(aiContext);
    • Returns capabilities formatted for a specific AI provider.

      Parameters

      Returns string

      Formatted capability descriptions as a string.

      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
      const registry = new CapabilityRegistry();
      const claudeContext = registry.forProvider('claude');
      const openaiTools = registry.forProvider('openai');
      const geminiText = registry.forProvider('gemini');
    • Returns the capability entry with the given id, or undefined.

      Parameters

      • id: string

        Unique kebab-case capability identifier.

      Returns CapabilityEntry | undefined

      The matching entry, or undefined if not registered.

      const cap = registry.get('click-button');
      if (cap !== undefined) {
      logger.info(cap.usage_example);
      }
    • Returns a statistical summary of the capability registry.

      Returns CapabilityStats

      Statistics including total count, categories, and priority breakdown.

      const stats = registry.getStatistics();
      logger.info(`Total: ${stats.totalMethods}`);
    • 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.

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

      if (registry.has('clickButton')) {
      // safe to use
      }
    • Returns capabilities matching the given priority tier.

      Parameters

      • priority: "fixture" | "namespace" | "implementation"

        Priority level to filter by.

      Returns CapabilityEntry[]

      Entries whose priority matches exactly.

      const fixtures = registry.listByPriority('fixture');
      const handlers = registry.listByPriority('namespace');
    • Registers a new capability entry or overwrites an existing one by id.

      Parameters

      Returns void

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

      registry.register({
      id: 'my-capability',
      name: 'myCapability',
      description: 'Does something useful',
      category: 'custom',
      usage_example: 'await custom.doSomething()',
      registryVersion: 1,
      });
    • Exports the full registry as a structured JSON object.

      Returns CapabilitiesJSON

      Structured JSON snapshot of the entire registry.

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

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