@rippling/pebble-sdui-web 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/ai_gateway/action-params.d.ts +5 -0
- package/dist/catalogs/ai_gateway/actions.d.ts +5 -0
- package/dist/catalogs/ai_gateway/catalog.d.ts +33 -0
- package/dist/catalogs/ai_gateway/component-events.d.ts +6 -0
- package/dist/catalogs/ai_gateway/component-props.d.ts +51 -0
- package/dist/catalogs/ai_gateway/components.d.ts +7 -0
- package/dist/catalogs/ai_gateway/function-params.d.ts +5 -0
- package/dist/catalogs/ai_gateway/functions.d.ts +5 -0
- package/dist/catalogs/ai_gateway/index.cjs +2 -0
- package/dist/catalogs/ai_gateway/index.cjs.map +1 -0
- package/dist/catalogs/ai_gateway/index.d.ts +11 -0
- package/dist/catalogs/ai_gateway/index.js +366 -0
- package/dist/catalogs/ai_gateway/index.js.map +1 -0
- package/dist/catalogs/ai_gateway/render.d.ts +20 -0
- package/dist/catalogs/custom-apps/action-params.d.ts +4 -0
- package/dist/catalogs/custom-apps/actions.d.ts +2 -1
- package/dist/catalogs/custom-apps/catalog.d.ts +1 -1
- package/dist/catalogs/custom-apps/component-events.d.ts +16 -13
- package/dist/catalogs/custom-apps/component-props.d.ts +973 -161
- package/dist/catalogs/custom-apps/components.d.ts +5 -2
- package/dist/catalogs/custom-apps/index.cjs +3 -2
- package/dist/catalogs/custom-apps/index.cjs.map +1 -1
- package/dist/catalogs/custom-apps/index.d.ts +5 -5
- package/dist/catalogs/custom-apps/index.js +5951 -1306
- package/dist/catalogs/custom-apps/index.js.map +1 -1
- package/dist/docs/typescript/web/catalogs/ai_gateway/actions.md +6 -0
- package/dist/docs/typescript/web/catalogs/ai_gateway/components.md +31 -0
- package/dist/docs/typescript/web/catalogs/ai_gateway/computed-functions.md +6 -0
- package/dist/docs/typescript/web/catalogs/ai_gateway/definitions.md +6 -0
- package/dist/docs/typescript/web/catalogs/ai_gateway/readme.md +16 -0
- package/dist/docs/typescript/web/catalogs/ai_gateway/types.md +75 -0
- package/dist/docs/typescript/web/catalogs/custom-apps/actions.md +28 -0
- package/dist/docs/typescript/web/catalogs/custom-apps/components.md +450 -222
- package/dist/docs/typescript/web/catalogs/custom-apps/definitions.md +274 -242
- package/dist/docs/typescript/web/catalogs/custom-apps/readme.md +1 -1
- package/dist/docs/typescript/web/catalogs/custom-apps/types.md +1329 -116
- package/package.json +6 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog introspection utilities for ai_gateway.
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.
|
|
5
|
+
*
|
|
6
|
+
* Provides runtime access to the raw catalog schema: component definitions,
|
|
7
|
+
* action definitions, and spec validation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CATALOG_NAME = "ai_gateway";
|
|
10
|
+
export declare const CATALOG_VERSION = "1.0.0";
|
|
11
|
+
/** Return component descriptions keyed by component name. */
|
|
12
|
+
export declare function getComponents(): Record<string, string>;
|
|
13
|
+
/** Return action descriptions keyed by action name. */
|
|
14
|
+
export declare function getActions(): Record<string, string>;
|
|
15
|
+
/** Return computed function descriptions keyed by function name. */
|
|
16
|
+
export declare function getFunctions(): Record<string, string>;
|
|
17
|
+
/** Return full computed function definitions keyed by function name. */
|
|
18
|
+
export declare function getComputedFunctions(): Record<string, Record<string, unknown>>;
|
|
19
|
+
/** Return reusable JSON Schema definitions keyed by definition name. */
|
|
20
|
+
export declare function getDefs(): Record<string, Record<string, unknown>>;
|
|
21
|
+
/** Get the full JSON definition of a component by name. */
|
|
22
|
+
export declare function getComponent(name: string): Record<string, unknown>;
|
|
23
|
+
/** Get the full JSON definition of an action by name. */
|
|
24
|
+
export declare function getAction(name: string): Record<string, unknown>;
|
|
25
|
+
/** Get the full JSON definition of a computed function by name. */
|
|
26
|
+
export declare function getFunction(name: string): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Validate a rendered spec against this catalog's schema.
|
|
29
|
+
* Returns a list of error messages. Empty list means valid.
|
|
30
|
+
*/
|
|
31
|
+
export declare function validate(spec: {
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}): string[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated component prop interfaces for ai_gateway.
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.
|
|
5
|
+
*/
|
|
6
|
+
export interface DeprecatedModel {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
isCompanyDefault: boolean;
|
|
10
|
+
isDeprecated?: boolean;
|
|
11
|
+
isEnabled: boolean;
|
|
12
|
+
isLatest?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface Key {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Model {
|
|
20
|
+
name: string;
|
|
21
|
+
id: string;
|
|
22
|
+
isCompanyDefault: boolean;
|
|
23
|
+
isDeprecated?: boolean;
|
|
24
|
+
isEnabled: boolean;
|
|
25
|
+
isLatest?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ModelGroup {
|
|
28
|
+
name: string;
|
|
29
|
+
models: Model[];
|
|
30
|
+
}
|
|
31
|
+
export interface Provider {
|
|
32
|
+
name: string;
|
|
33
|
+
allowedModelCount: number;
|
|
34
|
+
brand: string;
|
|
35
|
+
deprecatedModels: DeprecatedModel[];
|
|
36
|
+
id: string;
|
|
37
|
+
keys: Key[];
|
|
38
|
+
modelGroups: ModelGroup[];
|
|
39
|
+
status: string;
|
|
40
|
+
totalModelCount: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ProviderManagementProps {
|
|
43
|
+
activeTab: string;
|
|
44
|
+
addProviderLabel: string;
|
|
45
|
+
isLoading?: boolean;
|
|
46
|
+
providers: Provider[];
|
|
47
|
+
sectionDescription: string;
|
|
48
|
+
sectionTitle: string;
|
|
49
|
+
tabs: string[];
|
|
50
|
+
title: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentInputs } from '../../core/component-utils';
|
|
2
|
+
import { ElementNode } from '../../core/elements';
|
|
3
|
+
import { ProviderManagementProps } from './component-props';
|
|
4
|
+
import { ProviderManagementEvents } from './component-events';
|
|
5
|
+
type CatalogElementNode = ElementNode<'web', 'ai_gateway'>;
|
|
6
|
+
export declare const ProviderManagement: (input: ComponentInputs<ProviderManagementProps, ProviderManagementEvents>) => CatalogElementNode;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../core/component-utils.cjs"),v=require("../../2020-C_v5qH0D.cjs"),P=require("../../core/spec.cjs"),E=e=>O.buildNode("ProviderManagement",e),g="ai_gateway",b="1.0.0",a={ProviderManagement:{description:"Interactive provider, credential, and model-management page driven by serializable SDUI data.",events:["addProvider","providerToggle","modelToggle","modelAction"],propsSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,properties:{activeTab:{type:"string"},addProviderLabel:{type:"string"},isLoading:{type:"boolean"},providers:{items:{additionalProperties:!1,properties:{name:{type:"string"},allowedModelCount:{type:"number"},brand:{type:"string"},deprecatedModels:{items:{additionalProperties:!1,properties:{name:{type:"string"},id:{type:"string"},isCompanyDefault:{type:"boolean"},isDeprecated:{type:"boolean"},isEnabled:{type:"boolean"},isLatest:{type:"boolean"}},required:["id","name","isEnabled","isCompanyDefault"],type:"object"},type:"array"},id:{type:"string"},keys:{items:{additionalProperties:!1,properties:{name:{type:"string"},description:{type:"string"},id:{type:"string"}},required:["id","name","description"],type:"object"},type:"array"},modelGroups:{items:{additionalProperties:!1,properties:{name:{type:"string"},models:{items:{additionalProperties:!1,properties:{name:{type:"string"},id:{type:"string"},isCompanyDefault:{type:"boolean"},isDeprecated:{type:"boolean"},isEnabled:{type:"boolean"},isLatest:{type:"boolean"}},required:["id","name","isEnabled","isCompanyDefault"],type:"object"},type:"array"}},required:["name","models"],type:"object"},type:"array"},status:{type:"string"},totalModelCount:{type:"number"}},required:["id","name","brand","status","allowedModelCount","totalModelCount","keys","modelGroups","deprecatedModels"],type:"object"},type:"array"},sectionDescription:{type:"string"},sectionTitle:{type:"string"},tabs:{items:{type:"string"},type:"array"},title:{type:"string"}},required:["title","activeTab","tabs","addProviderLabel","sectionTitle","sectionDescription","providers"],type:"object"},acceptsChildren:!1}},d={},p={},u={};function C(){return Object.fromEntries(Object.entries(a).map(([e,t])=>[e,String(t.description??"")]))}function A(){return Object.fromEntries(Object.entries(d).map(([e,t])=>[e,String(t.description??"")]))}function S(){return Object.fromEntries(Object.entries(p).map(([e,t])=>[e,String(t.description??"")]))}function w(){return p}function _(){return u}function q(e){if(!(e in a))throw new Error(`Unknown component '${e}'. Available: ${Object.keys(a).join(", ")}`);const t={...a[e]};return delete t.example,t}function k(e){if(!(e in d))throw new Error(`Unknown action '${e}'. Available: ${Object.keys(d).join(", ")}`);return d[e]}function T(e){if(!(e in p))throw new Error(`Unknown function '${e}'. Available: ${Object.keys(p).join(", ")}`);return p[e]}const m=[{type:"object",additionalProperties:!1,properties:{$state:{type:"string"}},required:["$state"]},{type:"object",additionalProperties:!1,properties:{$bindState:{type:"string"}},required:["$bindState"]},{type:"object",additionalProperties:!1,properties:{$item:{type:"string"}},required:["$item"]},{type:"object",additionalProperties:!1,properties:{$bindItem:{type:"string"}},required:["$bindItem"]},{type:"object",additionalProperties:!1,properties:{$index:{}},required:["$index"]},{type:"object",additionalProperties:!1,properties:{$template:{type:"string"}},required:["$template"]},{type:"object",additionalProperties:!1,properties:{$cond:{},$then:{},$else:{}},required:["$cond","$then","$else"]},{type:"object",additionalProperties:!1,properties:{$computed:{type:"string"},args:{type:"object"}},required:["$computed","args"]}];function M(e){return Object.keys(u).length===0?e:{...e,$defs:{...u,...e.$defs??{}}}}function N(e){const t=JSON.parse(JSON.stringify(e)),i=t.properties??{};for(const o of Object.keys(i)){const n=i[o];Array.isArray(n.anyOf)?n.anyOf=[...n.anyOf,...m]:i[o]={anyOf:[n,...m]}}return t}function D(e){return e?e.slice(1).split("/").map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")).join("."):"(root)"}function I(e){const t=D(e.instancePath);return e.keyword==="anyOf"?`props ${t}: must match the declared schema or a reactive reference`:`props ${t}: ${e.message??"failed schema validation"}`}function L(e,t){const o=new v._2020Exports.Ajv2020({allErrors:!0,strict:!1}).compile(e);if(o(t))return[];const n=o.errors??[],s=new Set(n.filter(r=>r.keyword==="anyOf").map(r=>r.instancePath));return n.filter(r=>r.keyword==="anyOf"?!0:!(r.schemaPath.includes("/anyOf/")&&s.has(r.instancePath))).map(I)}function F(e){const t=[],i=e.elements??{},o=e.root;o&&!(o in i)&&t.push(`Root element '${o}' not found in elements map`);for(const[n,s]of Object.entries(i)){const r=s.type??"";if(!(r in a)){t.push(`Element '${n}': unknown type '${r}'`);continue}const l=a[r],y=l.propsSchema;if(y){const c=M(N(y)),h=s.props??{};for(const j of L(c,h))t.push(`Element '${n}': ${j}`)}const $=s.on??{},f=l.events??[];for(const c of Object.keys($))f.includes(c)||t.push(`Element '${n}': unknown event '${c}'. Valid: ${f.join(", ")}`);(s.children??[]).length>0&&!l.acceptsChildren&&t.push(`Element '${n}': '${r}' does not accept children`)}return t}function U(e){return{...P.renderElementTree(e.root,e.state),platform:"web",catalog:g,catalogVersion:b}}exports.CATALOG_NAME=g;exports.CATALOG_VERSION=b;exports.ProviderManagement=E;exports.getAction=k;exports.getActions=A;exports.getComponent=q;exports.getComponents=C;exports.getComputedFunctions=w;exports.getDefs=_;exports.getFunction=T;exports.getFunctions=S;exports.render=U;exports.validate=F;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/catalogs/ai_gateway/components.ts","../../../src/catalogs/ai_gateway/catalog.ts","../../../src/catalogs/ai_gateway/render.ts"],"sourcesContent":["/**\n * Generated component builders for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n */\n\nimport type { ComponentInputs } from '#core/component-utils';\nimport { buildNode } from '#core/component-utils';\nimport type { ElementNode } from '#core/elements';\nimport type { ProviderManagementProps } from './component-props';\nimport type { ProviderManagementEvents } from './component-events';\n\ntype CatalogElementNode = ElementNode<'web', 'ai_gateway'>;\n\nexport const ProviderManagement = (\n input: ComponentInputs<ProviderManagementProps, ProviderManagementEvents>\n): CatalogElementNode =>\n buildNode<'web', 'ai_gateway'>('ProviderManagement', input);\n","/**\n * Catalog introspection utilities for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n *\n * Provides runtime access to the raw catalog schema: component definitions,\n * action definitions, and spec validation.\n */\n\nimport { Ajv2020, type ErrorObject } from 'ajv/dist/2020';\n\nexport const CATALOG_NAME = 'ai_gateway';\nexport const CATALOG_VERSION = '1.0.0';\n\n// ---------------------------------------------------------------------------\n// Raw catalog data — embedded verbatim from the catalog JSON\n// ---------------------------------------------------------------------------\n\nconst _COMPONENTS: Record<string, Record<string, unknown>> = {\n ProviderManagement: {\n description:\n 'Interactive provider, credential, and model-management page driven by serializable SDUI data.',\n events: ['addProvider', 'providerToggle', 'modelToggle', 'modelAction'],\n propsSchema: {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n additionalProperties: false,\n properties: {\n activeTab: {\n type: 'string',\n },\n addProviderLabel: {\n type: 'string',\n },\n isLoading: {\n type: 'boolean',\n },\n providers: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n allowedModelCount: {\n type: 'number',\n },\n brand: {\n type: 'string',\n },\n deprecatedModels: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n isCompanyDefault: {\n type: 'boolean',\n },\n isDeprecated: {\n type: 'boolean',\n },\n isEnabled: {\n type: 'boolean',\n },\n isLatest: {\n type: 'boolean',\n },\n },\n required: ['id', 'name', 'isEnabled', 'isCompanyDefault'],\n type: 'object',\n },\n type: 'array',\n },\n id: {\n type: 'string',\n },\n keys: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['id', 'name', 'description'],\n type: 'object',\n },\n type: 'array',\n },\n modelGroups: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n models: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n isCompanyDefault: {\n type: 'boolean',\n },\n isDeprecated: {\n type: 'boolean',\n },\n isEnabled: {\n type: 'boolean',\n },\n isLatest: {\n type: 'boolean',\n },\n },\n required: [\n 'id',\n 'name',\n 'isEnabled',\n 'isCompanyDefault',\n ],\n type: 'object',\n },\n type: 'array',\n },\n },\n required: ['name', 'models'],\n type: 'object',\n },\n type: 'array',\n },\n status: {\n type: 'string',\n },\n totalModelCount: {\n type: 'number',\n },\n },\n required: [\n 'id',\n 'name',\n 'brand',\n 'status',\n 'allowedModelCount',\n 'totalModelCount',\n 'keys',\n 'modelGroups',\n 'deprecatedModels',\n ],\n type: 'object',\n },\n type: 'array',\n },\n sectionDescription: {\n type: 'string',\n },\n sectionTitle: {\n type: 'string',\n },\n tabs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n title: {\n type: 'string',\n },\n },\n required: [\n 'title',\n 'activeTab',\n 'tabs',\n 'addProviderLabel',\n 'sectionTitle',\n 'sectionDescription',\n 'providers',\n ],\n type: 'object',\n },\n acceptsChildren: false,\n },\n};\n\nconst _ACTIONS: Record<string, Record<string, unknown>> = {};\n\nconst _FUNCTIONS: Record<string, Record<string, unknown>> = {};\n\nconst _DEFS: Record<string, Record<string, unknown>> = {};\n\n// ---------------------------------------------------------------------------\n// Public introspection API\n// ---------------------------------------------------------------------------\n\n/** Return component descriptions keyed by component name. */\nexport function getComponents(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_COMPONENTS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return action descriptions keyed by action name. */\nexport function getActions(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_ACTIONS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return computed function descriptions keyed by function name. */\nexport function getFunctions(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_FUNCTIONS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return full computed function definitions keyed by function name. */\nexport function getComputedFunctions(): Record<\n string,\n Record<string, unknown>\n> {\n return _FUNCTIONS;\n}\n\n/** Return reusable JSON Schema definitions keyed by definition name. */\nexport function getDefs(): Record<string, Record<string, unknown>> {\n return _DEFS;\n}\n\n/** Get the full JSON definition of a component by name. */\nexport function getComponent(name: string): Record<string, unknown> {\n if (!(name in _COMPONENTS)) {\n throw new Error(\n `Unknown component '${name}'. Available: ${Object.keys(_COMPONENTS).join(', ')}`\n );\n }\n const definition = { ..._COMPONENTS[name] };\n delete definition.example;\n return definition;\n}\n\n/** Get the full JSON definition of an action by name. */\nexport function getAction(name: string): Record<string, unknown> {\n if (!(name in _ACTIONS)) {\n throw new Error(\n `Unknown action '${name}'. Available: ${Object.keys(_ACTIONS).join(', ')}`\n );\n }\n return _ACTIONS[name];\n}\n\n/** Get the full JSON definition of a computed function by name. */\nexport function getFunction(name: string): Record<string, unknown> {\n if (!(name in _FUNCTIONS)) {\n throw new Error(\n `Unknown function '${name}'. Available: ${Object.keys(_FUNCTIONS).join(', ')}`\n );\n }\n return _FUNCTIONS[name];\n}\n\n// Prop value refs — objects like {\"$state\": \"/path\"}, {\"$item\": \"field\"}, etc.\nconst _PROP_VALUE_REF_SCHEMAS = [\n {\n type: 'object',\n additionalProperties: false,\n properties: { $state: { type: 'string' } },\n required: ['$state'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $bindState: { type: 'string' } },\n required: ['$bindState'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $item: { type: 'string' } },\n required: ['$item'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $bindItem: { type: 'string' } },\n required: ['$bindItem'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $index: {} },\n required: ['$index'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $template: { type: 'string' } },\n required: ['$template'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $cond: {}, $then: {}, $else: {} },\n required: ['$cond', '$then', '$else'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $computed: { type: 'string' }, args: { type: 'object' } },\n required: ['$computed', 'args'],\n },\n];\n\ntype JsonSchema = Record<string, unknown> & {\n anyOf?: unknown[];\n properties?: Record<string, JsonSchema>;\n $defs?: Record<string, Record<string, unknown>>;\n};\n\nfunction _withCatalogDefs(schema: JsonSchema): JsonSchema {\n if (Object.keys(_DEFS).length === 0) {\n return schema;\n }\n\n return {\n ...schema,\n $defs: {\n ..._DEFS,\n ...(schema.$defs ?? {}),\n },\n };\n}\n\nfunction _withPropValueRefs(schema: JsonSchema): JsonSchema {\n const result = JSON.parse(JSON.stringify(schema)) as JsonSchema;\n const properties = result.properties ?? {};\n for (const propName of Object.keys(properties)) {\n const propSchema = properties[propName];\n if (Array.isArray(propSchema.anyOf)) {\n propSchema.anyOf = [...propSchema.anyOf, ..._PROP_VALUE_REF_SCHEMAS];\n } else {\n properties[propName] = {\n anyOf: [propSchema, ..._PROP_VALUE_REF_SCHEMAS],\n };\n }\n }\n return result;\n}\n\nfunction _formatJsonPointer(pointer: string): string {\n if (!pointer) {\n return '(root)';\n }\n\n return pointer\n .slice(1)\n .split('/')\n .map(part => part.replace(/~1/g, '/').replace(/~0/g, '~'))\n .join('.');\n}\n\nfunction _formatValidationError(error: ErrorObject): string {\n const path = _formatJsonPointer(error.instancePath);\n if (error.keyword === 'anyOf') {\n return `props ${path}: must match the declared schema or a reactive reference`;\n }\n\n return `props ${path}: ${error.message ?? 'failed schema validation'}`;\n}\n\nfunction _schemaErrors(\n schema: Record<string, unknown>,\n value: unknown\n): string[] {\n const ajv = new Ajv2020({ allErrors: true, strict: false });\n const validateSchema = ajv.compile(schema);\n if (validateSchema(value)) {\n return [];\n }\n\n const validationErrors = validateSchema.errors ?? [];\n const anyOfPaths = new Set(\n validationErrors\n .filter((error: ErrorObject) => error.keyword === 'anyOf')\n .map((error: ErrorObject) => error.instancePath)\n );\n\n return validationErrors\n .filter((error: ErrorObject) => {\n if (error.keyword === 'anyOf') {\n return true;\n }\n return !(\n error.schemaPath.includes('/anyOf/') &&\n anyOfPaths.has(error.instancePath)\n );\n })\n .map(_formatValidationError);\n}\n\n/**\n * Validate a rendered spec against this catalog's schema.\n * Returns a list of error messages. Empty list means valid.\n */\nexport function validate(spec: { [key: string]: unknown }): string[] {\n const errors: string[] = [];\n const elements = (spec.elements ?? {}) as Record<\n string,\n Record<string, unknown>\n >;\n\n // Check root exists\n const rootId = spec.root as string | undefined;\n if (rootId && !(rootId in elements)) {\n errors.push(`Root element '${rootId}' not found in elements map`);\n }\n\n // Check each element\n for (const [elId, el] of Object.entries(elements)) {\n const elType = (el.type ?? '') as string;\n\n if (!(elType in _COMPONENTS)) {\n errors.push(`Element '${elId}': unknown type '${elType}'`);\n continue;\n }\n\n const defn = _COMPONENTS[elType];\n\n // Validate props against propsSchema\n const propsSchema = defn.propsSchema as JsonSchema | undefined;\n if (propsSchema) {\n const extended = _withCatalogDefs(_withPropValueRefs(propsSchema));\n const props = (el.props ?? {}) as Record<string, unknown>;\n for (const error of _schemaErrors(extended, props)) {\n errors.push(`Element '${elId}': ${error}`);\n }\n }\n\n // Valid event names\n const onHandlers = (el.on ?? {}) as Record<string, unknown>;\n const validEvents = (defn.events ?? []) as string[];\n for (const eventName of Object.keys(onHandlers)) {\n if (!validEvents.includes(eventName)) {\n errors.push(\n `Element '${elId}': unknown event '${eventName}'. Valid: ${validEvents.join(', ')}`\n );\n }\n }\n\n // Children on leaf components\n const children = (el.children ?? []) as unknown[];\n if (children.length > 0 && !(defn.acceptsChildren as boolean)) {\n errors.push(`Element '${elId}': '${elType}' does not accept children`);\n }\n }\n\n return errors;\n}\n","/**\n * Catalog-scoped render for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n */\n\nimport type { ElementNode } from '#core/elements';\nimport type { CoreSpec } from '#core/spec';\nimport { renderElementTree } from '#core/spec';\nimport { CATALOG_NAME, CATALOG_VERSION } from './catalog';\n\nexport interface CatalogSpec extends CoreSpec {\n platform: 'web';\n catalog: string;\n catalogVersion: string;\n}\n\ntype CatalogElementNode = ElementNode<'web', 'ai_gateway'>;\n\n/**\n * Render an element tree into a flat json-render spec tagged with\n * the ai_gateway catalog name and version.\n *\n * This is the catalog-level render — consumers import this instead\n * of using createSpec().render() directly.\n */\nexport function render<TState extends object = Record<string, unknown>>(opts: {\n root: CatalogElementNode;\n state?: TState;\n}): CatalogSpec {\n const spec = renderElementTree(opts.root, opts.state);\n\n return {\n ...spec,\n platform: 'web',\n catalog: CATALOG_NAME,\n catalogVersion: CATALOG_VERSION,\n };\n}\n"],"names":["ProviderManagement","input","buildNode","CATALOG_NAME","CATALOG_VERSION","_COMPONENTS","_ACTIONS","_FUNCTIONS","_DEFS","getComponents","name","defn","getActions","getFunctions","getComputedFunctions","getDefs","getComponent","definition","getAction","getFunction","_PROP_VALUE_REF_SCHEMAS","_withCatalogDefs","schema","_withPropValueRefs","result","properties","propName","propSchema","_formatJsonPointer","pointer","part","_formatValidationError","error","path","_schemaErrors","value","validateSchema","Ajv2020","validationErrors","anyOfPaths","validate","spec","errors","elements","rootId","elId","el","elType","propsSchema","extended","props","onHandlers","validEvents","eventName","render","opts","renderElementTree"],"mappings":"wMAcaA,EACXC,GAEAC,EAAAA,UAA+B,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AAS,aAAaD,EAAY,KAAK,IAAI,CAAC,EAAA,GAMrEN,EAAG,UAAY,CAAA,GACpB,OAAS,GAAK,CAAEnC,EAAK,iBAChC+B,EAAO,KAAK,YAAYG,CAAI,OAAOE,CAAM,4BAA4B,CAEzE,CAEA,OAAOL,CACT,CCrcO,SAASY,EAAwDC,EAGxD,CAGd,MAAO,CACL,GAHWC,EAAAA,kBAAkBD,EAAK,KAAMA,EAAK,KAAK,EAIlD,SAAU,MACV,QAASpD,EACT,eAAgBC,CAAA,CAEpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ai_gateway — generated catalog module.
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.
|
|
5
|
+
*/
|
|
6
|
+
export { ProviderManagement } from './components';
|
|
7
|
+
export type { DeprecatedModel, Key, Model, ModelGroup, Provider, ProviderManagementProps, } from './component-props';
|
|
8
|
+
export type { ProviderManagementEvents } from './component-events';
|
|
9
|
+
export { CATALOG_NAME, CATALOG_VERSION, getComponents, getActions, getFunctions, getComputedFunctions, getDefs, getComponent, getAction, getFunction, validate, } from './catalog';
|
|
10
|
+
export { render } from './render';
|
|
11
|
+
export type { CatalogSpec } from './render';
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { buildNode as h } from "../../core/component-utils.js";
|
|
2
|
+
import { _ as j } from "../../2020-PBERvPzO.js";
|
|
3
|
+
import { renderElementTree as O } from "../../core/spec.js";
|
|
4
|
+
const D = (e) => h("ProviderManagement", e), v = "ai_gateway", P = "1.0.0", a = {
|
|
5
|
+
ProviderManagement: {
|
|
6
|
+
description: "Interactive provider, credential, and model-management page driven by serializable SDUI data.",
|
|
7
|
+
events: ["addProvider", "providerToggle", "modelToggle", "modelAction"],
|
|
8
|
+
propsSchema: {
|
|
9
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
10
|
+
additionalProperties: !1,
|
|
11
|
+
properties: {
|
|
12
|
+
activeTab: {
|
|
13
|
+
type: "string"
|
|
14
|
+
},
|
|
15
|
+
addProviderLabel: {
|
|
16
|
+
type: "string"
|
|
17
|
+
},
|
|
18
|
+
isLoading: {
|
|
19
|
+
type: "boolean"
|
|
20
|
+
},
|
|
21
|
+
providers: {
|
|
22
|
+
items: {
|
|
23
|
+
additionalProperties: !1,
|
|
24
|
+
properties: {
|
|
25
|
+
name: {
|
|
26
|
+
type: "string"
|
|
27
|
+
},
|
|
28
|
+
allowedModelCount: {
|
|
29
|
+
type: "number"
|
|
30
|
+
},
|
|
31
|
+
brand: {
|
|
32
|
+
type: "string"
|
|
33
|
+
},
|
|
34
|
+
deprecatedModels: {
|
|
35
|
+
items: {
|
|
36
|
+
additionalProperties: !1,
|
|
37
|
+
properties: {
|
|
38
|
+
name: {
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
id: {
|
|
42
|
+
type: "string"
|
|
43
|
+
},
|
|
44
|
+
isCompanyDefault: {
|
|
45
|
+
type: "boolean"
|
|
46
|
+
},
|
|
47
|
+
isDeprecated: {
|
|
48
|
+
type: "boolean"
|
|
49
|
+
},
|
|
50
|
+
isEnabled: {
|
|
51
|
+
type: "boolean"
|
|
52
|
+
},
|
|
53
|
+
isLatest: {
|
|
54
|
+
type: "boolean"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
required: ["id", "name", "isEnabled", "isCompanyDefault"],
|
|
58
|
+
type: "object"
|
|
59
|
+
},
|
|
60
|
+
type: "array"
|
|
61
|
+
},
|
|
62
|
+
id: {
|
|
63
|
+
type: "string"
|
|
64
|
+
},
|
|
65
|
+
keys: {
|
|
66
|
+
items: {
|
|
67
|
+
additionalProperties: !1,
|
|
68
|
+
properties: {
|
|
69
|
+
name: {
|
|
70
|
+
type: "string"
|
|
71
|
+
},
|
|
72
|
+
description: {
|
|
73
|
+
type: "string"
|
|
74
|
+
},
|
|
75
|
+
id: {
|
|
76
|
+
type: "string"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
required: ["id", "name", "description"],
|
|
80
|
+
type: "object"
|
|
81
|
+
},
|
|
82
|
+
type: "array"
|
|
83
|
+
},
|
|
84
|
+
modelGroups: {
|
|
85
|
+
items: {
|
|
86
|
+
additionalProperties: !1,
|
|
87
|
+
properties: {
|
|
88
|
+
name: {
|
|
89
|
+
type: "string"
|
|
90
|
+
},
|
|
91
|
+
models: {
|
|
92
|
+
items: {
|
|
93
|
+
additionalProperties: !1,
|
|
94
|
+
properties: {
|
|
95
|
+
name: {
|
|
96
|
+
type: "string"
|
|
97
|
+
},
|
|
98
|
+
id: {
|
|
99
|
+
type: "string"
|
|
100
|
+
},
|
|
101
|
+
isCompanyDefault: {
|
|
102
|
+
type: "boolean"
|
|
103
|
+
},
|
|
104
|
+
isDeprecated: {
|
|
105
|
+
type: "boolean"
|
|
106
|
+
},
|
|
107
|
+
isEnabled: {
|
|
108
|
+
type: "boolean"
|
|
109
|
+
},
|
|
110
|
+
isLatest: {
|
|
111
|
+
type: "boolean"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
required: [
|
|
115
|
+
"id",
|
|
116
|
+
"name",
|
|
117
|
+
"isEnabled",
|
|
118
|
+
"isCompanyDefault"
|
|
119
|
+
],
|
|
120
|
+
type: "object"
|
|
121
|
+
},
|
|
122
|
+
type: "array"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
required: ["name", "models"],
|
|
126
|
+
type: "object"
|
|
127
|
+
},
|
|
128
|
+
type: "array"
|
|
129
|
+
},
|
|
130
|
+
status: {
|
|
131
|
+
type: "string"
|
|
132
|
+
},
|
|
133
|
+
totalModelCount: {
|
|
134
|
+
type: "number"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
required: [
|
|
138
|
+
"id",
|
|
139
|
+
"name",
|
|
140
|
+
"brand",
|
|
141
|
+
"status",
|
|
142
|
+
"allowedModelCount",
|
|
143
|
+
"totalModelCount",
|
|
144
|
+
"keys",
|
|
145
|
+
"modelGroups",
|
|
146
|
+
"deprecatedModels"
|
|
147
|
+
],
|
|
148
|
+
type: "object"
|
|
149
|
+
},
|
|
150
|
+
type: "array"
|
|
151
|
+
},
|
|
152
|
+
sectionDescription: {
|
|
153
|
+
type: "string"
|
|
154
|
+
},
|
|
155
|
+
sectionTitle: {
|
|
156
|
+
type: "string"
|
|
157
|
+
},
|
|
158
|
+
tabs: {
|
|
159
|
+
items: {
|
|
160
|
+
type: "string"
|
|
161
|
+
},
|
|
162
|
+
type: "array"
|
|
163
|
+
},
|
|
164
|
+
title: {
|
|
165
|
+
type: "string"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
required: [
|
|
169
|
+
"title",
|
|
170
|
+
"activeTab",
|
|
171
|
+
"tabs",
|
|
172
|
+
"addProviderLabel",
|
|
173
|
+
"sectionTitle",
|
|
174
|
+
"sectionDescription",
|
|
175
|
+
"providers"
|
|
176
|
+
],
|
|
177
|
+
type: "object"
|
|
178
|
+
},
|
|
179
|
+
acceptsChildren: !1
|
|
180
|
+
}
|
|
181
|
+
}, c = {}, p = {}, y = {};
|
|
182
|
+
function M() {
|
|
183
|
+
return Object.fromEntries(
|
|
184
|
+
Object.entries(a).map(([e, t]) => [
|
|
185
|
+
e,
|
|
186
|
+
String(t.description ?? "")
|
|
187
|
+
])
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function N() {
|
|
191
|
+
return Object.fromEntries(
|
|
192
|
+
Object.entries(c).map(([e, t]) => [
|
|
193
|
+
e,
|
|
194
|
+
String(t.description ?? "")
|
|
195
|
+
])
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function I() {
|
|
199
|
+
return Object.fromEntries(
|
|
200
|
+
Object.entries(p).map(([e, t]) => [
|
|
201
|
+
e,
|
|
202
|
+
String(t.description ?? "")
|
|
203
|
+
])
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function L() {
|
|
207
|
+
return p;
|
|
208
|
+
}
|
|
209
|
+
function x() {
|
|
210
|
+
return y;
|
|
211
|
+
}
|
|
212
|
+
function F(e) {
|
|
213
|
+
if (!(e in a))
|
|
214
|
+
throw new Error(
|
|
215
|
+
`Unknown component '${e}'. Available: ${Object.keys(a).join(", ")}`
|
|
216
|
+
);
|
|
217
|
+
const t = { ...a[e] };
|
|
218
|
+
return delete t.example, t;
|
|
219
|
+
}
|
|
220
|
+
function U(e) {
|
|
221
|
+
if (!(e in c))
|
|
222
|
+
throw new Error(
|
|
223
|
+
`Unknown action '${e}'. Available: ${Object.keys(c).join(", ")}`
|
|
224
|
+
);
|
|
225
|
+
return c[e];
|
|
226
|
+
}
|
|
227
|
+
function V(e) {
|
|
228
|
+
if (!(e in p))
|
|
229
|
+
throw new Error(
|
|
230
|
+
`Unknown function '${e}'. Available: ${Object.keys(p).join(", ")}`
|
|
231
|
+
);
|
|
232
|
+
return p[e];
|
|
233
|
+
}
|
|
234
|
+
const m = [
|
|
235
|
+
{
|
|
236
|
+
type: "object",
|
|
237
|
+
additionalProperties: !1,
|
|
238
|
+
properties: { $state: { type: "string" } },
|
|
239
|
+
required: ["$state"]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
type: "object",
|
|
243
|
+
additionalProperties: !1,
|
|
244
|
+
properties: { $bindState: { type: "string" } },
|
|
245
|
+
required: ["$bindState"]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
type: "object",
|
|
249
|
+
additionalProperties: !1,
|
|
250
|
+
properties: { $item: { type: "string" } },
|
|
251
|
+
required: ["$item"]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
type: "object",
|
|
255
|
+
additionalProperties: !1,
|
|
256
|
+
properties: { $bindItem: { type: "string" } },
|
|
257
|
+
required: ["$bindItem"]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: "object",
|
|
261
|
+
additionalProperties: !1,
|
|
262
|
+
properties: { $index: {} },
|
|
263
|
+
required: ["$index"]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
type: "object",
|
|
267
|
+
additionalProperties: !1,
|
|
268
|
+
properties: { $template: { type: "string" } },
|
|
269
|
+
required: ["$template"]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
type: "object",
|
|
273
|
+
additionalProperties: !1,
|
|
274
|
+
properties: { $cond: {}, $then: {}, $else: {} },
|
|
275
|
+
required: ["$cond", "$then", "$else"]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
type: "object",
|
|
279
|
+
additionalProperties: !1,
|
|
280
|
+
properties: { $computed: { type: "string" }, args: { type: "object" } },
|
|
281
|
+
required: ["$computed", "args"]
|
|
282
|
+
}
|
|
283
|
+
];
|
|
284
|
+
function E(e) {
|
|
285
|
+
return Object.keys(y).length === 0 ? e : {
|
|
286
|
+
...e,
|
|
287
|
+
$defs: {
|
|
288
|
+
...y,
|
|
289
|
+
...e.$defs ?? {}
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function w(e) {
|
|
294
|
+
const t = JSON.parse(JSON.stringify(e)), i = t.properties ?? {};
|
|
295
|
+
for (const o of Object.keys(i)) {
|
|
296
|
+
const r = i[o];
|
|
297
|
+
Array.isArray(r.anyOf) ? r.anyOf = [...r.anyOf, ...m] : i[o] = {
|
|
298
|
+
anyOf: [r, ...m]
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return t;
|
|
302
|
+
}
|
|
303
|
+
function S(e) {
|
|
304
|
+
return e ? e.slice(1).split("/").map((t) => t.replace(/~1/g, "/").replace(/~0/g, "~")).join(".") : "(root)";
|
|
305
|
+
}
|
|
306
|
+
function C(e) {
|
|
307
|
+
const t = S(e.instancePath);
|
|
308
|
+
return e.keyword === "anyOf" ? `props ${t}: must match the declared schema or a reactive reference` : `props ${t}: ${e.message ?? "failed schema validation"}`;
|
|
309
|
+
}
|
|
310
|
+
function _(e, t) {
|
|
311
|
+
const o = new j.Ajv2020({ allErrors: !0, strict: !1 }).compile(e);
|
|
312
|
+
if (o(t))
|
|
313
|
+
return [];
|
|
314
|
+
const r = o.errors ?? [], s = new Set(
|
|
315
|
+
r.filter((n) => n.keyword === "anyOf").map((n) => n.instancePath)
|
|
316
|
+
);
|
|
317
|
+
return r.filter((n) => n.keyword === "anyOf" ? !0 : !(n.schemaPath.includes("/anyOf/") && s.has(n.instancePath))).map(C);
|
|
318
|
+
}
|
|
319
|
+
function R(e) {
|
|
320
|
+
const t = [], i = e.elements ?? {}, o = e.root;
|
|
321
|
+
o && !(o in i) && t.push(`Root element '${o}' not found in elements map`);
|
|
322
|
+
for (const [r, s] of Object.entries(i)) {
|
|
323
|
+
const n = s.type ?? "";
|
|
324
|
+
if (!(n in a)) {
|
|
325
|
+
t.push(`Element '${r}': unknown type '${n}'`);
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
const l = a[n], f = l.propsSchema;
|
|
329
|
+
if (f) {
|
|
330
|
+
const d = E(w(f)), g = s.props ?? {};
|
|
331
|
+
for (const $ of _(d, g))
|
|
332
|
+
t.push(`Element '${r}': ${$}`);
|
|
333
|
+
}
|
|
334
|
+
const b = s.on ?? {}, u = l.events ?? [];
|
|
335
|
+
for (const d of Object.keys(b))
|
|
336
|
+
u.includes(d) || t.push(
|
|
337
|
+
`Element '${r}': unknown event '${d}'. Valid: ${u.join(", ")}`
|
|
338
|
+
);
|
|
339
|
+
(s.children ?? []).length > 0 && !l.acceptsChildren && t.push(`Element '${r}': '${n}' does not accept children`);
|
|
340
|
+
}
|
|
341
|
+
return t;
|
|
342
|
+
}
|
|
343
|
+
function G(e) {
|
|
344
|
+
return {
|
|
345
|
+
...O(e.root, e.state),
|
|
346
|
+
platform: "web",
|
|
347
|
+
catalog: v,
|
|
348
|
+
catalogVersion: P
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
export {
|
|
352
|
+
v as CATALOG_NAME,
|
|
353
|
+
P as CATALOG_VERSION,
|
|
354
|
+
D as ProviderManagement,
|
|
355
|
+
U as getAction,
|
|
356
|
+
N as getActions,
|
|
357
|
+
F as getComponent,
|
|
358
|
+
M as getComponents,
|
|
359
|
+
L as getComputedFunctions,
|
|
360
|
+
x as getDefs,
|
|
361
|
+
V as getFunction,
|
|
362
|
+
I as getFunctions,
|
|
363
|
+
G as render,
|
|
364
|
+
R as validate
|
|
365
|
+
};
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/catalogs/ai_gateway/components.ts","../../../src/catalogs/ai_gateway/catalog.ts","../../../src/catalogs/ai_gateway/render.ts"],"sourcesContent":["/**\n * Generated component builders for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n */\n\nimport type { ComponentInputs } from '#core/component-utils';\nimport { buildNode } from '#core/component-utils';\nimport type { ElementNode } from '#core/elements';\nimport type { ProviderManagementProps } from './component-props';\nimport type { ProviderManagementEvents } from './component-events';\n\ntype CatalogElementNode = ElementNode<'web', 'ai_gateway'>;\n\nexport const ProviderManagement = (\n input: ComponentInputs<ProviderManagementProps, ProviderManagementEvents>\n): CatalogElementNode =>\n buildNode<'web', 'ai_gateway'>('ProviderManagement', input);\n","/**\n * Catalog introspection utilities for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n *\n * Provides runtime access to the raw catalog schema: component definitions,\n * action definitions, and spec validation.\n */\n\nimport { Ajv2020, type ErrorObject } from 'ajv/dist/2020';\n\nexport const CATALOG_NAME = 'ai_gateway';\nexport const CATALOG_VERSION = '1.0.0';\n\n// ---------------------------------------------------------------------------\n// Raw catalog data — embedded verbatim from the catalog JSON\n// ---------------------------------------------------------------------------\n\nconst _COMPONENTS: Record<string, Record<string, unknown>> = {\n ProviderManagement: {\n description:\n 'Interactive provider, credential, and model-management page driven by serializable SDUI data.',\n events: ['addProvider', 'providerToggle', 'modelToggle', 'modelAction'],\n propsSchema: {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n additionalProperties: false,\n properties: {\n activeTab: {\n type: 'string',\n },\n addProviderLabel: {\n type: 'string',\n },\n isLoading: {\n type: 'boolean',\n },\n providers: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n allowedModelCount: {\n type: 'number',\n },\n brand: {\n type: 'string',\n },\n deprecatedModels: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n isCompanyDefault: {\n type: 'boolean',\n },\n isDeprecated: {\n type: 'boolean',\n },\n isEnabled: {\n type: 'boolean',\n },\n isLatest: {\n type: 'boolean',\n },\n },\n required: ['id', 'name', 'isEnabled', 'isCompanyDefault'],\n type: 'object',\n },\n type: 'array',\n },\n id: {\n type: 'string',\n },\n keys: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['id', 'name', 'description'],\n type: 'object',\n },\n type: 'array',\n },\n modelGroups: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n models: {\n items: {\n additionalProperties: false,\n properties: {\n name: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n isCompanyDefault: {\n type: 'boolean',\n },\n isDeprecated: {\n type: 'boolean',\n },\n isEnabled: {\n type: 'boolean',\n },\n isLatest: {\n type: 'boolean',\n },\n },\n required: [\n 'id',\n 'name',\n 'isEnabled',\n 'isCompanyDefault',\n ],\n type: 'object',\n },\n type: 'array',\n },\n },\n required: ['name', 'models'],\n type: 'object',\n },\n type: 'array',\n },\n status: {\n type: 'string',\n },\n totalModelCount: {\n type: 'number',\n },\n },\n required: [\n 'id',\n 'name',\n 'brand',\n 'status',\n 'allowedModelCount',\n 'totalModelCount',\n 'keys',\n 'modelGroups',\n 'deprecatedModels',\n ],\n type: 'object',\n },\n type: 'array',\n },\n sectionDescription: {\n type: 'string',\n },\n sectionTitle: {\n type: 'string',\n },\n tabs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n title: {\n type: 'string',\n },\n },\n required: [\n 'title',\n 'activeTab',\n 'tabs',\n 'addProviderLabel',\n 'sectionTitle',\n 'sectionDescription',\n 'providers',\n ],\n type: 'object',\n },\n acceptsChildren: false,\n },\n};\n\nconst _ACTIONS: Record<string, Record<string, unknown>> = {};\n\nconst _FUNCTIONS: Record<string, Record<string, unknown>> = {};\n\nconst _DEFS: Record<string, Record<string, unknown>> = {};\n\n// ---------------------------------------------------------------------------\n// Public introspection API\n// ---------------------------------------------------------------------------\n\n/** Return component descriptions keyed by component name. */\nexport function getComponents(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_COMPONENTS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return action descriptions keyed by action name. */\nexport function getActions(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_ACTIONS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return computed function descriptions keyed by function name. */\nexport function getFunctions(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(_FUNCTIONS).map(([name, defn]) => [\n name,\n String(defn.description ?? ''),\n ])\n );\n}\n\n/** Return full computed function definitions keyed by function name. */\nexport function getComputedFunctions(): Record<\n string,\n Record<string, unknown>\n> {\n return _FUNCTIONS;\n}\n\n/** Return reusable JSON Schema definitions keyed by definition name. */\nexport function getDefs(): Record<string, Record<string, unknown>> {\n return _DEFS;\n}\n\n/** Get the full JSON definition of a component by name. */\nexport function getComponent(name: string): Record<string, unknown> {\n if (!(name in _COMPONENTS)) {\n throw new Error(\n `Unknown component '${name}'. Available: ${Object.keys(_COMPONENTS).join(', ')}`\n );\n }\n const definition = { ..._COMPONENTS[name] };\n delete definition.example;\n return definition;\n}\n\n/** Get the full JSON definition of an action by name. */\nexport function getAction(name: string): Record<string, unknown> {\n if (!(name in _ACTIONS)) {\n throw new Error(\n `Unknown action '${name}'. Available: ${Object.keys(_ACTIONS).join(', ')}`\n );\n }\n return _ACTIONS[name];\n}\n\n/** Get the full JSON definition of a computed function by name. */\nexport function getFunction(name: string): Record<string, unknown> {\n if (!(name in _FUNCTIONS)) {\n throw new Error(\n `Unknown function '${name}'. Available: ${Object.keys(_FUNCTIONS).join(', ')}`\n );\n }\n return _FUNCTIONS[name];\n}\n\n// Prop value refs — objects like {\"$state\": \"/path\"}, {\"$item\": \"field\"}, etc.\nconst _PROP_VALUE_REF_SCHEMAS = [\n {\n type: 'object',\n additionalProperties: false,\n properties: { $state: { type: 'string' } },\n required: ['$state'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $bindState: { type: 'string' } },\n required: ['$bindState'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $item: { type: 'string' } },\n required: ['$item'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $bindItem: { type: 'string' } },\n required: ['$bindItem'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $index: {} },\n required: ['$index'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $template: { type: 'string' } },\n required: ['$template'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $cond: {}, $then: {}, $else: {} },\n required: ['$cond', '$then', '$else'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: { $computed: { type: 'string' }, args: { type: 'object' } },\n required: ['$computed', 'args'],\n },\n];\n\ntype JsonSchema = Record<string, unknown> & {\n anyOf?: unknown[];\n properties?: Record<string, JsonSchema>;\n $defs?: Record<string, Record<string, unknown>>;\n};\n\nfunction _withCatalogDefs(schema: JsonSchema): JsonSchema {\n if (Object.keys(_DEFS).length === 0) {\n return schema;\n }\n\n return {\n ...schema,\n $defs: {\n ..._DEFS,\n ...(schema.$defs ?? {}),\n },\n };\n}\n\nfunction _withPropValueRefs(schema: JsonSchema): JsonSchema {\n const result = JSON.parse(JSON.stringify(schema)) as JsonSchema;\n const properties = result.properties ?? {};\n for (const propName of Object.keys(properties)) {\n const propSchema = properties[propName];\n if (Array.isArray(propSchema.anyOf)) {\n propSchema.anyOf = [...propSchema.anyOf, ..._PROP_VALUE_REF_SCHEMAS];\n } else {\n properties[propName] = {\n anyOf: [propSchema, ..._PROP_VALUE_REF_SCHEMAS],\n };\n }\n }\n return result;\n}\n\nfunction _formatJsonPointer(pointer: string): string {\n if (!pointer) {\n return '(root)';\n }\n\n return pointer\n .slice(1)\n .split('/')\n .map(part => part.replace(/~1/g, '/').replace(/~0/g, '~'))\n .join('.');\n}\n\nfunction _formatValidationError(error: ErrorObject): string {\n const path = _formatJsonPointer(error.instancePath);\n if (error.keyword === 'anyOf') {\n return `props ${path}: must match the declared schema or a reactive reference`;\n }\n\n return `props ${path}: ${error.message ?? 'failed schema validation'}`;\n}\n\nfunction _schemaErrors(\n schema: Record<string, unknown>,\n value: unknown\n): string[] {\n const ajv = new Ajv2020({ allErrors: true, strict: false });\n const validateSchema = ajv.compile(schema);\n if (validateSchema(value)) {\n return [];\n }\n\n const validationErrors = validateSchema.errors ?? [];\n const anyOfPaths = new Set(\n validationErrors\n .filter((error: ErrorObject) => error.keyword === 'anyOf')\n .map((error: ErrorObject) => error.instancePath)\n );\n\n return validationErrors\n .filter((error: ErrorObject) => {\n if (error.keyword === 'anyOf') {\n return true;\n }\n return !(\n error.schemaPath.includes('/anyOf/') &&\n anyOfPaths.has(error.instancePath)\n );\n })\n .map(_formatValidationError);\n}\n\n/**\n * Validate a rendered spec against this catalog's schema.\n * Returns a list of error messages. Empty list means valid.\n */\nexport function validate(spec: { [key: string]: unknown }): string[] {\n const errors: string[] = [];\n const elements = (spec.elements ?? {}) as Record<\n string,\n Record<string, unknown>\n >;\n\n // Check root exists\n const rootId = spec.root as string | undefined;\n if (rootId && !(rootId in elements)) {\n errors.push(`Root element '${rootId}' not found in elements map`);\n }\n\n // Check each element\n for (const [elId, el] of Object.entries(elements)) {\n const elType = (el.type ?? '') as string;\n\n if (!(elType in _COMPONENTS)) {\n errors.push(`Element '${elId}': unknown type '${elType}'`);\n continue;\n }\n\n const defn = _COMPONENTS[elType];\n\n // Validate props against propsSchema\n const propsSchema = defn.propsSchema as JsonSchema | undefined;\n if (propsSchema) {\n const extended = _withCatalogDefs(_withPropValueRefs(propsSchema));\n const props = (el.props ?? {}) as Record<string, unknown>;\n for (const error of _schemaErrors(extended, props)) {\n errors.push(`Element '${elId}': ${error}`);\n }\n }\n\n // Valid event names\n const onHandlers = (el.on ?? {}) as Record<string, unknown>;\n const validEvents = (defn.events ?? []) as string[];\n for (const eventName of Object.keys(onHandlers)) {\n if (!validEvents.includes(eventName)) {\n errors.push(\n `Element '${elId}': unknown event '${eventName}'. Valid: ${validEvents.join(', ')}`\n );\n }\n }\n\n // Children on leaf components\n const children = (el.children ?? []) as unknown[];\n if (children.length > 0 && !(defn.acceptsChildren as boolean)) {\n errors.push(`Element '${elId}': '${elType}' does not accept children`);\n }\n }\n\n return errors;\n}\n","/**\n * Catalog-scoped render for ai_gateway.\n *\n * Auto-generated from catalogs/ai_gateway.catalog.json — do not edit.\n */\n\nimport type { ElementNode } from '#core/elements';\nimport type { CoreSpec } from '#core/spec';\nimport { renderElementTree } from '#core/spec';\nimport { CATALOG_NAME, CATALOG_VERSION } from './catalog';\n\nexport interface CatalogSpec extends CoreSpec {\n platform: 'web';\n catalog: string;\n catalogVersion: string;\n}\n\ntype CatalogElementNode = ElementNode<'web', 'ai_gateway'>;\n\n/**\n * Render an element tree into a flat json-render spec tagged with\n * the ai_gateway catalog name and version.\n *\n * This is the catalog-level render — consumers import this instead\n * of using createSpec().render() directly.\n */\nexport function render<TState extends object = Record<string, unknown>>(opts: {\n root: CatalogElementNode;\n state?: TState;\n}): CatalogSpec {\n const spec = renderElementTree(opts.root, opts.state);\n\n return {\n ...spec,\n platform: 'web',\n catalog: CATALOG_NAME,\n catalogVersion: CATALOG_VERSION,\n };\n}\n"],"names":["ProviderManagement","input","buildNode","CATALOG_NAME","CATALOG_VERSION","_COMPONENTS","_ACTIONS","_FUNCTIONS","_DEFS","getComponents","name","defn","getActions","getFunctions","getComputedFunctions","getDefs","getComponent","definition","getAction","getFunction","_PROP_VALUE_REF_SCHEMAS","_withCatalogDefs","schema","_withPropValueRefs","result","properties","propName","propSchema","_formatJsonPointer","pointer","part","_formatValidationError","error","path","_schemaErrors","value","validateSchema","Ajv2020","validationErrors","anyOfPaths","validate","spec","errors","elements","rootId","elId","el","elType","propsSchema","extended","props","onHandlers","validEvents","eventName","render","opts","renderElementTree"],"mappings":";;;AAcO,MAAMA,IAAqB,CAChCC,MAEAC,EAA+B,sBAAsBD,CAAK,GCN/CE,IAAe,cACfC,IAAkB,SAMzBC,IAAuD;AAAA,EAC3D,oBAAoB;AAAA,IAClB,aACE;AAAA,IACF,QAAQ,CAAC,eAAe,kBAAkB,eAAe,aAAa;AAAA,IACtE,aAAa;AAAA,MACX,SAAS;AAAA,MACT,sBAAsB;AAAA,MACtB,YAAY;AAAA,QACV,WAAW;AAAA,UACT,MAAM;AAAA,QAAA;AAAA,QAER,kBAAkB;AAAA,UAChB,MAAM;AAAA,QAAA;AAAA,QAER,WAAW;AAAA,UACT,MAAM;AAAA,QAAA;AAAA,QAER,WAAW;AAAA,UACT,OAAO;AAAA,YACL,sBAAsB;AAAA,YACtB,YAAY;AAAA,cACV,MAAM;AAAA,gBACJ,MAAM;AAAA,cAAA;AAAA,cAER,mBAAmB;AAAA,gBACjB,MAAM;AAAA,cAAA;AAAA,cAER,OAAO;AAAA,gBACL,MAAM;AAAA,cAAA;AAAA,cAER,kBAAkB;AAAA,gBAChB,OAAO;AAAA,kBACL,sBAAsB;AAAA,kBACtB,YAAY;AAAA,oBACV,MAAM;AAAA,sBACJ,MAAM;AAAA,oBAAA;AAAA,oBAER,IAAI;AAAA,sBACF,MAAM;AAAA,oBAAA;AAAA,oBAER,kBAAkB;AAAA,sBAChB,MAAM;AAAA,oBAAA;AAAA,oBAER,cAAc;AAAA,sBACZ,MAAM;AAAA,oBAAA;AAAA,oBAER,WAAW;AAAA,sBACT,MAAM;AAAA,oBAAA;AAAA,oBA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