Prometheus Entity Management API
    Preparing search index...

    Class Catalog<T, F>

    Collection of available components and functions.

    The F parameter distinguishes catalogs that carry executable function implementations (FunctionImplementation, the default and the only kind a renderer should hold) from schema-only catalogs (FunctionApi), whose functions are signatures loaded from catalog JSON with no code attached. Consumers that need to execute functions, such as NodeResolver, constrain F to FunctionImplementation so a schema-only catalog is rejected at compile time rather than resolving values to undefined at runtime.

    Type Parameters

    • T extends ComponentApi
    • F extends FunctionApi = FunctionImplementation

    Implements

    • CatalogInterface<T, F>
    Index
    • Initializes a new Catalog.

      Type Parameters

      • T extends ComponentApi<ZodTypeAny>
      • F extends FunctionApi = FunctionImplementation

      Parameters

      • id: string

        Unique identifier for the catalog, usually a URI.

      • protocolVersion: string | string & {}

        Protocol specification version this catalog targets.

      • Optionalcomponents: T[]

        Component definitions to register.

      • Optionalfunctions: F[]

        Function definitions to register.

      • OptionalthemeSchema: ZodTypeAny

        Optional schema for this catalog's theme parameters.

      • Optionalinstructions: string

        Optional system instructions or usage guidelines.

      Returns Catalog<T, F>

      If protocolVersion is empty or not provided.

    components: ReadonlyMap<string, T>

    Map of available components keyed by component name.

    Readonly to encourage immutable extension patterns.

    functions: ReadonlyMap<string, F>

    Map of functions provided by this catalog.

    id: string

    Unique identifier for the catalog.

    instructions?: string

    Optional system instructions or usage guidelines for this catalog.

    invoker: FunctionInvoker

    Function invoker callback that delegates to this catalog's registered functions.

    protocolVersion: string | string & {}

    Protocol specification version supported by this catalog.

    themeSchema?: ZodTypeAny

    Schema for theme parameters used by this catalog.

    • get catalogSchema(): Record<string, unknown>

      Dynamically reconstructs and memoizes the unified standard A2UI catalog JSON Schema document.

      Returns Record<string, unknown>

    • get componentRefMap(): ComponentRefMap

      Lazily computed component reference map for child reference extraction and topology validation.

      Returns ComponentRefMap

    • Constructs a schema-only Catalog directly from a raw A2UI catalog schema.

      Parameters

      • catalogSchema: Record<string, any>

        Raw catalog schema or client capabilities payload object.

      • OptionalprotocolVersion: string

        Protocol version to use when the schema does not declare one. Catalog schemas published before v1.0 omit the field, in which case DEFAULT_PROTOCOL_VERSION applies.

      Returns Catalog<ComponentApi<ZodTypeAny>, FunctionApi>

      A new Catalog populated with component and function schemas.

      If the catalog ID is missing or not a string.