@copilotkit/a2ui-renderer 1.55.3 → 1.56.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/index.d.cts CHANGED
@@ -5,7 +5,7 @@ import { A2UIRenderer, A2UIRendererProps } from "./react-renderer/core/A2UIRende
5
5
  import { UseA2UIResult, useA2UI } from "./react-renderer/hooks/useA2UI.cjs";
6
6
  import { ThemeProvider, useTheme, useThemeOptional } from "./react-renderer/theme/ThemeContext.cjs";
7
7
  import { cn } from "./react-renderer/lib/utils.cjs";
8
- import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./react-renderer/catalog-utils.cjs";
8
+ import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./react-renderer/catalog-utils.cjs";
9
9
  import { ReactComponentImplementation, createReactComponent } from "./react-renderer/a2ui-react/adapter.cjs";
10
10
  import { basicCatalog } from "./react-renderer/a2ui-react/catalog/basic/index.cjs";
11
11
  import { A2UIComponentDefinition, A2UIComponentMap, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentRenderer, PropsOf, RendererProps, createA2UICatalog, createCatalog, extractA2UISchema, extractSchema } from "./react-renderer/create-catalog.cjs";
@@ -15,5 +15,5 @@ import { Catalog, defaultTheme, initializeDefaultCatalog, litTheme, registerDefa
15
15
  //#region src/index.d.ts
16
16
  declare const viewerTheme: Record<string, unknown>;
17
17
  //#endregion
18
- export { type A2UIClientEventMessage, A2UIComponentDefinition, A2UIComponentMap, A2UIComponentProps, A2UIProvider, A2UIProviderConfig, A2UIProviderProps, A2UIRenderer, A2UIRendererProps, A2UI_SCHEMA_CONTEXT_DESCRIPTION, Action, AnyComponentNode, BooleanValue, Catalog, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentLoader, ComponentRegistration, ComponentRenderer, DEFAULT_SURFACE_ID, DataValue, MessageProcessor, NumberValue, OnActionCallback, Primitives, PropsOf, ReactComponentImplementation, RendererProps, ServerToClientMessage, StringValue, Surface, SurfaceID, type Theme, ThemeProvider, Types, UseA2UIResult, basicCatalog, buildCatalogContextValue, cn, createA2UICatalog, createCatalog, createReactComponent, defaultTheme, extendsBasicCatalog, extractA2UISchema, extractCatalogComponentSchemas, extractSchema, getCustomComponentNames, initializeDefaultCatalog, injectStyles, litTheme, registerDefaultCatalog, removeStyles, useA2UI, useA2UIActions, useA2UIContext, useA2UIError, useA2UIState, useA2UIStore, useA2UIStoreSelector, useTheme, useThemeOptional, viewerTheme };
18
+ export { type A2UIClientEventMessage, A2UIComponentDefinition, A2UIComponentMap, A2UIComponentProps, A2UIProvider, A2UIProviderConfig, A2UIProviderProps, A2UIRenderer, A2UIRendererProps, A2UI_SCHEMA_CONTEXT_DESCRIPTION, Action, AnyComponentNode, BooleanValue, Catalog, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentLoader, ComponentRegistration, ComponentRenderer, DEFAULT_SURFACE_ID, DataValue, InlineCatalogSchema, MessageProcessor, NumberValue, OnActionCallback, Primitives, PropsOf, ReactComponentImplementation, RendererProps, ServerToClientMessage, StringValue, Surface, SurfaceID, type Theme, ThemeProvider, Types, UseA2UIResult, basicCatalog, buildCatalogContextValue, cn, createA2UICatalog, createCatalog, createReactComponent, defaultTheme, extendsBasicCatalog, extractA2UISchema, extractCatalogComponentSchemas, extractSchema, getCustomComponentNames, initializeDefaultCatalog, injectStyles, litTheme, registerDefaultCatalog, removeStyles, useA2UI, useA2UIActions, useA2UIContext, useA2UIError, useA2UIState, useA2UIStore, useA2UIStoreSelector, useTheme, useThemeOptional, viewerTheme };
19
19
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import { A2UIRenderer, A2UIRendererProps } from "./react-renderer/core/A2UIRende
5
5
  import { UseA2UIResult, useA2UI } from "./react-renderer/hooks/useA2UI.mjs";
6
6
  import { ThemeProvider, useTheme, useThemeOptional } from "./react-renderer/theme/ThemeContext.mjs";
7
7
  import { cn } from "./react-renderer/lib/utils.mjs";
8
- import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./react-renderer/catalog-utils.mjs";
8
+ import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./react-renderer/catalog-utils.mjs";
9
9
  import { ReactComponentImplementation, createReactComponent } from "./react-renderer/a2ui-react/adapter.mjs";
10
10
  import { basicCatalog } from "./react-renderer/a2ui-react/catalog/basic/index.mjs";
11
11
  import { A2UIComponentDefinition, A2UIComponentMap, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentRenderer, PropsOf, RendererProps, createA2UICatalog, createCatalog, extractA2UISchema, extractSchema } from "./react-renderer/create-catalog.mjs";
@@ -15,5 +15,5 @@ import { Catalog, defaultTheme, initializeDefaultCatalog, litTheme, registerDefa
15
15
  //#region src/index.d.ts
16
16
  declare const viewerTheme: Record<string, unknown>;
17
17
  //#endregion
18
- export { type A2UIClientEventMessage, A2UIComponentDefinition, A2UIComponentMap, A2UIComponentProps, A2UIProvider, A2UIProviderConfig, A2UIProviderProps, A2UIRenderer, A2UIRendererProps, A2UI_SCHEMA_CONTEXT_DESCRIPTION, Action, AnyComponentNode, BooleanValue, Catalog, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentLoader, ComponentRegistration, ComponentRenderer, DEFAULT_SURFACE_ID, DataValue, MessageProcessor, NumberValue, OnActionCallback, Primitives, PropsOf, ReactComponentImplementation, RendererProps, ServerToClientMessage, StringValue, Surface, SurfaceID, type Theme, ThemeProvider, Types, UseA2UIResult, basicCatalog, buildCatalogContextValue, cn, createA2UICatalog, createCatalog, createReactComponent, defaultTheme, extendsBasicCatalog, extractA2UISchema, extractCatalogComponentSchemas, extractSchema, getCustomComponentNames, initializeDefaultCatalog, injectStyles, litTheme, registerDefaultCatalog, removeStyles, useA2UI, useA2UIActions, useA2UIContext, useA2UIError, useA2UIState, useA2UIStore, useA2UIStoreSelector, useTheme, useThemeOptional, viewerTheme };
18
+ export { type A2UIClientEventMessage, A2UIComponentDefinition, A2UIComponentMap, A2UIComponentProps, A2UIProvider, A2UIProviderConfig, A2UIProviderProps, A2UIRenderer, A2UIRendererProps, A2UI_SCHEMA_CONTEXT_DESCRIPTION, Action, AnyComponentNode, BooleanValue, Catalog, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentLoader, ComponentRegistration, ComponentRenderer, DEFAULT_SURFACE_ID, DataValue, InlineCatalogSchema, MessageProcessor, NumberValue, OnActionCallback, Primitives, PropsOf, ReactComponentImplementation, RendererProps, ServerToClientMessage, StringValue, Surface, SurfaceID, type Theme, ThemeProvider, Types, UseA2UIResult, basicCatalog, buildCatalogContextValue, cn, createA2UICatalog, createCatalog, createReactComponent, defaultTheme, extendsBasicCatalog, extractA2UISchema, extractCatalogComponentSchemas, extractSchema, getCustomComponentNames, initializeDefaultCatalog, injectStyles, litTheme, registerDefaultCatalog, removeStyles, useA2UI, useA2UIActions, useA2UIContext, useA2UIError, useA2UIState, useA2UIStore, useA2UIStoreSelector, useTheme, useThemeOptional, viewerTheme };
19
19
  //# sourceMappingURL=index.d.mts.map
package/dist/index.umd.js CHANGED
@@ -1808,7 +1808,7 @@ react = __toESM(react);
1808
1808
  * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite
1809
1809
  * a frontend-provided schema with a server-side one.
1810
1810
  */
1811
- const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.";
1811
+ const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
1812
1812
  /**
1813
1813
  * Check whether a catalog is a superset of the basic catalog
1814
1814
  * (i.e., it contains all basic components by name).
@@ -1856,21 +1856,37 @@ react = __toESM(react);
1856
1856
  return lines.join("\n");
1857
1857
  }
1858
1858
  /**
1859
- * Extract component schemas from a catalog in the same format used by
1860
- * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod
1861
- * schema is converted to JSON Schema via zod-to-json-schema.
1859
+ * Extract component schemas from a catalog in the A2UI v0.9 inline catalog
1860
+ * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so
1861
+ * the schema the LLM sees matches the spec and the flat wire format:
1862
+ *
1863
+ * { "Column": { "allOf": [
1864
+ * { "$ref": "common_types.json#/$defs/ComponentCommon" },
1865
+ * { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
1866
+ * "required": ["component"] }
1867
+ * ]}}
1862
1868
  *
1863
1869
  * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,
1864
1870
  * the middleware can optionally overwrite it with a server-side schema.
1865
1871
  */
1866
1872
  function extractCatalogComponentSchemas(catalog) {
1867
1873
  const resolved = catalog !== null && catalog !== void 0 ? catalog : basicCatalog;
1868
- const schemas = [];
1869
- for (const [name, comp] of resolved.components) schemas.push({
1870
- name,
1871
- props: (0, zod_to_json_schema.zodToJsonSchema)(comp.schema, { target: "openApi3" })
1872
- });
1873
- return schemas;
1874
+ const components = {};
1875
+ for (const [name, comp] of resolved.components) {
1876
+ var _zodSchema$properties, _zodSchema$required;
1877
+ const zodSchema = (0, zod_to_json_schema.zodToJsonSchema)(comp.schema, { target: "jsonSchema2019-09" });
1878
+ components[name] = { allOf: [{ $ref: "common_types.json#/$defs/ComponentCommon" }, {
1879
+ properties: {
1880
+ component: { const: name },
1881
+ ...(_zodSchema$properties = zodSchema.properties) !== null && _zodSchema$properties !== void 0 ? _zodSchema$properties : {}
1882
+ },
1883
+ required: ["component", ...(_zodSchema$required = zodSchema.required) !== null && _zodSchema$required !== void 0 ? _zodSchema$required : []]
1884
+ }] };
1885
+ }
1886
+ return {
1887
+ catalogId: resolved.id,
1888
+ components
1889
+ };
1874
1890
  }
1875
1891
 
1876
1892
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","names":["ComponentContext","GenericBinder","mapJustify","mapAlign","Text","TextApi","ImageApi","IconApi","VideoApi","AudioPlayerApi","ChildList","React","Row","RowApi","mapJustify","mapAlign","ChildList","Column","ColumnApi","mapJustify","mapAlign","ChildList","ListApi","mapAlign","ChildList","CardApi","TabsApi","DividerApi","ModalApi","Button","ButtonApi","TextField","TextFieldApi","React","CheckBoxApi","React","ChoicePickerApi","SliderApi","React","DateTimeInputApi","React","Text","Row","Column","Button","TextField","Catalog","BASIC_FUNCTIONS","z","CommonSchemas","z","CommonSchemas","React","z","CommonSchemas","mapJustify","mapAlign","z","CommonSchemas","z","CommonSchemas","Catalog","z","MessageProcessor","Suspense","Catalog"],"sources":["../src/react-renderer/a2ui-react/A2uiSurface.tsx","../src/react-renderer/a2ui-react/adapter.tsx","../src/react-renderer/a2ui-react/catalog/basic/utils.ts","../src/react-renderer/a2ui-react/catalog/basic/components/Text.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Image.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Icon.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Video.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/ChildList.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Row.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Column.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/List.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Card.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Tabs.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Divider.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Modal.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Button.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/TextField.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/CheckBox.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Slider.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.tsx","../src/react-renderer/a2ui-react/catalog/basic/index.ts","../src/react-renderer/a2ui-react/catalog/minimal/components/Text.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Button.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/ChildList.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Row.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Column.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/TextField.tsx","../src/react-renderer/a2ui-react/catalog/minimal/index.ts","../src/react-renderer/theme/ThemeContext.tsx","../src/react-renderer/core/A2UIProvider.tsx","../src/react-renderer/hooks/useA2UI.ts","../src/react-renderer/lib/utils.ts","../src/react-renderer/core/A2UIRenderer.tsx","../src/react-renderer/catalog-utils.ts","../src/react-renderer/create-catalog.tsx","../src/react-renderer/styles/index.ts","../src/react-renderer/index.ts","../src/a2ui-types.ts","../src/index.ts"],"sourcesContent":["/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useSyncExternalStore, memo, useMemo, useCallback } from \"react\";\nimport {\n type SurfaceModel,\n ComponentContext,\n type ComponentModel,\n} from \"@a2ui/web_core/v0_9\";\nimport type { ReactComponentImplementation } from \"./adapter\";\n\nconst ResolvedChild = memo(\n ({\n surface,\n id,\n basePath,\n compImpl,\n componentModel,\n }: {\n surface: SurfaceModel<ReactComponentImplementation>;\n id: string;\n basePath: string;\n componentModel: ComponentModel;\n compImpl: ReactComponentImplementation;\n }) => {\n const ComponentToRender = compImpl.render;\n\n // Create context. Recreate if the componentModel instance changes (e.g. type change recreation).\n const context = useMemo(\n () => new ComponentContext(surface, id, basePath),\n // componentModel is used as a trigger for recreation even if not in the body\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [surface, id, basePath, componentModel],\n );\n\n const buildChild = useCallback(\n (childId: string, specificPath?: string) => {\n const path = specificPath || context.dataContext.path;\n return (\n <DeferredChild\n key={`${childId}-${path}`}\n surface={surface}\n id={childId}\n basePath={path}\n />\n );\n },\n [surface, context.dataContext.path],\n );\n\n return <ComponentToRender context={context} buildChild={buildChild} />;\n },\n);\nResolvedChild.displayName = \"ResolvedChild\";\n\nexport const DeferredChild: React.FC<{\n surface: SurfaceModel<ReactComponentImplementation>;\n id: string;\n basePath: string;\n}> = memo(({ surface, id, basePath }) => {\n // 1. Subscribe specifically to this component's existence\n const store = useMemo(() => {\n let version = 0;\n return {\n subscribe: (cb: () => void) => {\n const unsub1 = surface.componentsModel.onCreated.subscribe((comp) => {\n if (comp.id === id) {\n version++;\n cb();\n }\n });\n const unsub2 = surface.componentsModel.onDeleted.subscribe((delId) => {\n if (delId === id) {\n version++;\n cb();\n }\n });\n return () => {\n unsub1.unsubscribe();\n unsub2.unsubscribe();\n };\n },\n getSnapshot: () => {\n const comp = surface.componentsModel.get(id);\n // We use instance identity + version as the snapshot to ensure\n // type replacements (e.g. Button -> Text) trigger a re-render.\n return comp ? `${comp.type}-${version}` : `missing-${version}`;\n },\n };\n }, [surface, id]);\n\n useSyncExternalStore(store.subscribe, store.getSnapshot);\n\n const componentModel = surface.componentsModel.get(id);\n\n if (!componentModel) {\n return (\n <div\n style={{\n padding: \"12px 16px\",\n borderRadius: \"8px\",\n background:\n \"linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%)\",\n backgroundSize: \"200% 100%\",\n animation: \"a2ui-shimmer 1.5s ease-in-out infinite\",\n minHeight: \"2rem\",\n }}\n >\n <style>{`@keyframes a2ui-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }`}</style>\n </div>\n );\n }\n\n const compImpl = surface.catalog.components.get(componentModel.type);\n\n if (!compImpl) {\n return (\n <div style={{ color: \"red\" }}>\n Unknown component: {componentModel.type}\n </div>\n );\n }\n\n return (\n <ResolvedChild\n surface={surface}\n id={id}\n basePath={basePath}\n componentModel={componentModel}\n compImpl={compImpl}\n />\n );\n});\nDeferredChild.displayName = \"DeferredChild\";\n\nexport const A2uiSurface: React.FC<{\n surface: SurfaceModel<ReactComponentImplementation>;\n}> = ({ surface }) => {\n // The root component always has ID 'root' and base path '/'\n return <DeferredChild surface={surface} id=\"root\" basePath=\"/\" />;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n useRef,\n useSyncExternalStore,\n useCallback,\n memo,\n useEffect,\n} from \"react\";\nimport { type ComponentContext, GenericBinder } from \"@a2ui/web_core/v0_9\";\nimport type {\n ComponentApi,\n InferredComponentApiSchemaType,\n ResolveA2uiProps,\n} from \"@a2ui/web_core/v0_9\";\n\nexport interface ReactComponentImplementation extends ComponentApi {\n /** The framework-specific rendering wrapper. */\n render: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }>;\n}\n\nexport type ReactA2uiComponentProps<T> = {\n props: T;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n context: ComponentContext;\n};\n\n// --- Component Factories ---\n\n/**\n * Creates a React component implementation using the deep generic binder.\n */\nexport function createReactComponent<Api extends ComponentApi>(\n api: Api,\n RenderComponent: React.FC<\n ReactA2uiComponentProps<\n ResolveA2uiProps<InferredComponentApiSchemaType<Api>>\n >\n >,\n): ReactComponentImplementation {\n type Props = ResolveA2uiProps<InferredComponentApiSchemaType<Api>>;\n\n const MemoizedRender = memo(RenderComponent, (prev, next) => {\n if (prev.props !== next.props) return false;\n if (prev.context.componentModel.id !== next.context.componentModel.id)\n return false;\n if (prev.context.dataContext.path !== next.context.dataContext.path)\n return false;\n return true;\n });\n\n const ReactWrapper: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }> = ({ context, buildChild }) => {\n const bindingRef = useRef<GenericBinder<Props> | null>(null);\n\n // Create or recreate the binder if the context object changes.\n // DeferredChild memoizes `context`, so reference changes strictly correspond\n // to ComponentModel updates (like type changes) or Base Path adjustments.\n if (!bindingRef.current) {\n bindingRef.current = new GenericBinder<Props>(context, api.schema);\n } else if (\n (bindingRef.current as unknown as { context: ComponentContext })\n .context !== context\n ) {\n bindingRef.current.dispose();\n bindingRef.current = new GenericBinder<Props>(context, api.schema);\n }\n const binding = bindingRef.current;\n\n const subscribe = useCallback(\n (callback: () => void) => {\n const sub = binding.subscribe(callback);\n return () => sub.unsubscribe();\n },\n [binding],\n );\n\n const getSnapshot = useCallback(() => binding.snapshot, [binding]);\n const props = useSyncExternalStore(subscribe, getSnapshot);\n\n // Prevent DataModel subscription leaks on unmount\n useEffect(() => {\n return () => binding.dispose();\n }, [binding]);\n\n return (\n <MemoizedRender\n props={props || ({} as Props)}\n buildChild={buildChild}\n context={context}\n />\n );\n };\n\n return {\n name: api.name,\n schema: api.schema,\n render: ReactWrapper,\n };\n}\n\n/**\n * Creates a React component implementation that manages its own context bindings (no generic binder).\n */\nexport function createBinderlessComponent(\n api: ComponentApi,\n RenderComponent: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }>,\n): ReactComponentImplementation {\n return {\n name: api.name,\n schema: api.schema,\n render: RenderComponent,\n };\n}\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type React from \"react\";\n\n/** Standard leaf margin from the implementation guide. */\nexport const LEAF_MARGIN = \"8px\";\n\n/** Standard internal padding for visually bounded containers. */\nexport const CONTAINER_PADDING = \"16px\";\n\n/** Standard border for cards and inputs. */\nexport const STANDARD_BORDER = \"1px solid #ccc\";\n\n/** Standard border radius. */\nexport const STANDARD_RADIUS = \"8px\";\n\nexport const mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nexport const mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const getBaseLeafStyle = (): React.CSSProperties => ({\n margin: LEAF_MARGIN,\n boxSizing: \"border-box\",\n});\n\nexport const getBaseContainerStyle = (): React.CSSProperties => ({\n margin: LEAF_MARGIN,\n padding: CONTAINER_PADDING,\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TextApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Text = createReactComponent(TextApi, ({ props }) => {\n const text = props.text ?? \"\";\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n display: \"inline-block\",\n };\n\n switch (props.variant) {\n case \"h1\":\n return <h1 style={style}>{text}</h1>;\n case \"h2\":\n return <h2 style={style}>{text}</h2>;\n case \"h3\":\n return <h3 style={style}>{text}</h3>;\n case \"h4\":\n return <h4 style={style}>{text}</h4>;\n case \"h5\":\n return <h5 style={style}>{text}</h5>;\n case \"caption\":\n return (\n <small style={{ ...style, color: \"#666\", textAlign: \"left\" }}>\n {text}\n </small>\n );\n case \"body\":\n default:\n return <span style={style}>{text}</span>;\n }\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ImageApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Image = createReactComponent(ImageApi, ({ props }) => {\n const mapFit = (fit?: string): React.CSSProperties[\"objectFit\"] => {\n if (fit === \"scaleDown\") return \"scale-down\";\n return (fit as React.CSSProperties[\"objectFit\"]) || \"fill\";\n };\n\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n objectFit: mapFit(props.fit),\n width: \"100%\",\n height: \"auto\",\n display: \"block\",\n };\n\n if (props.variant === \"icon\") {\n style.width = \"24px\";\n style.height = \"24px\";\n } else if (props.variant === \"avatar\") {\n style.width = \"40px\";\n style.height = \"40px\";\n style.borderRadius = \"50%\";\n } else if (props.variant === \"smallFeature\") {\n style.maxWidth = \"100px\";\n } else if (props.variant === \"largeFeature\") {\n style.maxHeight = \"400px\";\n } else if (props.variant === \"header\") {\n style.height = \"200px\";\n style.objectFit = \"cover\";\n }\n\n return <img src={props.url} alt={props.description || \"\"} style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { IconApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Icon = createReactComponent(IconApi, ({ props }) => {\n const iconName =\n typeof props.name === \"string\"\n ? props.name\n : (props.name as { path?: string })?.path;\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n fontSize: \"24px\",\n width: \"24px\",\n height: \"24px\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n return (\n <span className=\"material-symbols-outlined\" style={style}>\n {iconName}\n </span>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { VideoApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Video = createReactComponent(VideoApi, ({ props }) => {\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n width: \"100%\",\n aspectRatio: \"16/9\",\n };\n\n return <video src={props.url} controls style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { AudioPlayerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const AudioPlayer = createReactComponent(AudioPlayerApi, ({ props }) => {\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n width: \"100%\",\n };\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n }}\n >\n {props.description && (\n <span style={{ fontSize: \"12px\", color: \"#666\" }}>\n {props.description}\n </span>\n )}\n <audio src={props.url} controls style={style} />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { type ComponentContext } from \"@a2ui/web_core/v0_9\";\n\nexport const ChildList: React.FC<{\n childList: unknown;\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n}> = ({ childList, buildChild }) => {\n if (Array.isArray(childList)) {\n return (\n <>\n {childList.map((item: unknown, i: number) => {\n // The new binder outputs objects like { id: string, basePath: string } for arrays of structural nodes\n if (item && typeof item === \"object\" && \"id\" in item) {\n const node = item as { id: string; basePath?: string };\n return (\n <React.Fragment key={`${node.id}-${i}`}>\n {buildChild(node.id, node.basePath)}\n </React.Fragment>\n );\n }\n // Fallback for static string lists\n if (typeof item === \"string\") {\n return (\n <React.Fragment key={`${item}-${i}`}>\n {buildChild(item)}\n </React.Fragment>\n );\n }\n return null;\n })}\n </>\n );\n }\n\n return null;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { RowApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapJustify, mapAlign } from \"../utils\";\n\nexport const Row = createReactComponent(\n RowApi,\n ({ props, buildChild, context }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n width: \"100%\",\n margin: 0,\n padding: 0,\n }}\n >\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { ColumnApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapJustify, mapAlign } from \"../utils\";\n\nexport const Column = createReactComponent(\n ColumnApi,\n ({ props, buildChild, context }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n width: \"100%\",\n margin: 0,\n padding: 0,\n }}\n >\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ListApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapAlign } from \"../utils\";\n\nexport const List = createReactComponent(\n ListApi,\n ({ props, buildChild, context }) => {\n const isHorizontal = props.direction === \"horizontal\";\n const style: React.CSSProperties = {\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: mapAlign(props.align),\n overflowX: isHorizontal ? \"auto\" : \"hidden\",\n overflowY: isHorizontal ? \"hidden\" : \"auto\",\n width: \"100%\",\n margin: 0,\n padding: 0,\n };\n\n return (\n <div style={style}>\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { CardApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseContainerStyle } from \"../utils\";\n\nexport const Card = createReactComponent(CardApi, ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n ...getBaseContainerStyle(),\n backgroundColor: \"#fff\",\n boxShadow: \"0 2px 4px rgba(0,0,0,0.1)\",\n width: \"100%\",\n };\n\n return (\n <div style={style}>{props.child ? buildChild(props.child) : null}</div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TabsApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\n// The type of a tab is deeply nested into the TabsApi schema, and\n// it seems z.infer is not inferring it correctly (?). We use `any` for now.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype _Tab = any;\n\nexport const Tabs = createReactComponent(TabsApi, ({ props, buildChild }) => {\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n const tabs = props.tabs || [];\n const activeTab = tabs[selectedIndex];\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n <div\n style={{\n display: \"flex\",\n borderBottom: \"1px solid #ccc\",\n marginBottom: \"8px\",\n }}\n >\n {tabs.map((tab: _Tab, i: number) => (\n <button\n key={i}\n onClick={() => setSelectedIndex(i)}\n style={{\n padding: \"8px 16px\",\n border: \"none\",\n background: \"none\",\n borderBottom:\n selectedIndex === i\n ? \"2px solid var(--a2ui-primary-color, #007bff)\"\n : \"none\",\n fontWeight: selectedIndex === i ? \"bold\" : \"normal\",\n cursor: \"pointer\",\n color:\n selectedIndex === i\n ? \"var(--a2ui-primary-color, #007bff)\"\n : \"inherit\",\n }}\n >\n {tab.title}\n </button>\n ))}\n </div>\n <div style={{ flex: 1 }}>\n {activeTab ? buildChild(activeTab.child) : null}\n </div>\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { DividerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Divider = createReactComponent(DividerApi, ({ props }) => {\n const isVertical = props.axis === \"vertical\";\n const style: React.CSSProperties = {\n margin: LEAF_MARGIN,\n border: \"none\",\n backgroundColor: \"#ccc\",\n };\n\n if (isVertical) {\n style.width = \"1px\";\n style.height = \"100%\";\n } else {\n style.width = \"100%\";\n style.height = \"1px\";\n }\n\n return <div style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ModalApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\n\nexport const Modal = createReactComponent(ModalApi, ({ props, buildChild }) => {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <div onClick={() => setIsOpen(true)} style={{ display: \"inline-block\" }}>\n {props.trigger ? buildChild(props.trigger) : null}\n </div>\n {isOpen && (\n <div\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 1000,\n }}\n onClick={() => setIsOpen(false)}\n >\n <div\n style={{\n backgroundColor: \"#fff\",\n padding: \"24px\",\n borderRadius: \"8px\",\n maxWidth: \"90%\",\n maxHeight: \"90%\",\n overflow: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n onClick={(e) => e.stopPropagation()}\n >\n <div style={{ display: \"flex\", justifyContent: \"flex-end\" }}>\n <button\n onClick={() => setIsOpen(false)}\n style={{\n border: \"none\",\n background: \"none\",\n fontSize: \"20px\",\n cursor: \"pointer\",\n padding: \"4px\",\n }}\n >\n &times;\n </button>\n </div>\n <div style={{ flex: 1 }}>\n {props.content ? buildChild(props.content) : null}\n </div>\n </div>\n </div>\n )}\n </>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ButtonApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Button = createReactComponent(\n ButtonApi,\n ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n margin: LEAF_MARGIN,\n padding: \"8px 16px\",\n cursor: \"pointer\",\n border: props.variant === \"borderless\" ? \"none\" : \"1px solid #ccc\",\n backgroundColor:\n props.variant === \"primary\"\n ? \"var(--a2ui-primary-color, #007bff)\"\n : props.variant === \"borderless\"\n ? \"transparent\"\n : \"#fff\",\n color: props.variant === \"primary\" ? \"#fff\" : \"inherit\",\n borderRadius: \"4px\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxSizing: \"border-box\",\n };\n\n return (\n <button\n style={style}\n onClick={props.action}\n disabled={props.isValid === false}\n >\n {props.child ? buildChild(props.child) : null}\n </button>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TextFieldApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\nexport const TextField = createReactComponent(TextFieldApi, ({ props }) => {\n const onChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n props.setValue(e.target.value);\n };\n\n const isLong = props.variant === \"longText\";\n const type =\n props.variant === \"number\"\n ? \"number\"\n : props.variant === \"obscured\"\n ? \"password\"\n : \"text\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n };\n\n // Note: To have a unique id without passing context we can use a random or provided id,\n // but the simplest is just relying on React's useId if we really need it.\n // For now, we'll omit the `id` from the label connection since we removed context.\n const uniqueId = React.useId();\n\n const hasError = props.validationErrors && props.validationErrors.length > 0;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n {isLong ? (\n <textarea\n id={uniqueId}\n style={{\n ...style,\n border: hasError ? \"1px solid red\" : STANDARD_BORDER,\n }}\n value={props.value || \"\"}\n onChange={onChange}\n />\n ) : (\n <input\n id={uniqueId}\n type={type}\n style={{\n ...style,\n border: hasError ? \"1px solid red\" : STANDARD_BORDER,\n }}\n value={props.value || \"\"}\n onChange={onChange}\n />\n )}\n {hasError && (\n <span style={{ fontSize: \"12px\", color: \"red\" }}>\n {props.validationErrors![0]}\n </span>\n )}\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { CheckBoxApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const CheckBox = createReactComponent(CheckBoxApi, ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(e.target.checked);\n };\n\n const uniqueId = React.useId();\n\n const hasError = props.validationErrors && props.validationErrors.length > 0;\n\n return (\n <div\n style={{ display: \"flex\", flexDirection: \"column\", margin: LEAF_MARGIN }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n <input\n id={uniqueId}\n type=\"checkbox\"\n checked={!!props.value}\n onChange={onChange}\n style={{\n cursor: \"pointer\",\n outline: hasError ? \"1px solid red\" : \"none\",\n }}\n />\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ cursor: \"pointer\", color: hasError ? \"red\" : \"inherit\" }}\n >\n {props.label}\n </label>\n )}\n </div>\n {hasError && (\n <span style={{ fontSize: \"12px\", color: \"red\", marginTop: \"4px\" }}>\n {props.validationErrors?.[0]}\n </span>\n )}\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ChoicePickerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\n// The type of an option is deeply nested into the ChoicePickerApi schema, and\n// it seems z.infer is not inferring it correctly (?). We use `any` for now.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype _Option = any;\n\nexport const ChoicePicker = createReactComponent(\n ChoicePickerApi,\n ({ props, context }) => {\n const [filter, setFilter] = useState(\"\");\n\n const values = Array.isArray(props.value) ? props.value : [];\n const isMutuallyExclusive = props.variant === \"mutuallyExclusive\";\n\n const onToggle = (val: string) => {\n if (isMutuallyExclusive) {\n props.setValue([val]);\n } else {\n const newValues = values.includes(val)\n ? values.filter((v: string) => v !== val)\n : [...values, val];\n props.setValue(newValues);\n }\n };\n\n const options = (props.options || []).filter(\n (opt: _Option) =>\n !props.filterable ||\n filter === \"\" ||\n String(opt.label).toLowerCase().includes(filter.toLowerCase()),\n );\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"8px\",\n margin: LEAF_MARGIN,\n width: \"100%\",\n };\n\n const listStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: props.displayStyle === \"chips\" ? \"row\" : \"column\",\n flexWrap: props.displayStyle === \"chips\" ? \"wrap\" : \"nowrap\",\n gap: \"8px\",\n };\n\n return (\n <div style={containerStyle}>\n {props.label && (\n <strong style={{ fontSize: \"14px\" }}>{props.label}</strong>\n )}\n {props.filterable && (\n <input\n type=\"text\"\n placeholder=\"Filter options...\"\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n style={{\n padding: \"4px 8px\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n }}\n />\n )}\n <div style={listStyle}>\n {options.map((opt: _Option, i: number) => {\n const isSelected = values.includes(opt.value);\n if (props.displayStyle === \"chips\") {\n return (\n <button\n key={i}\n onClick={() => onToggle(opt.value)}\n style={{\n padding: \"4px 12px\",\n borderRadius: \"16px\",\n border: isSelected\n ? \"1px solid var(--a2ui-primary-color, #007bff)\"\n : STANDARD_BORDER,\n backgroundColor: isSelected\n ? \"var(--a2ui-primary-color, #007bff)\"\n : \"#fff\",\n color: isSelected ? \"#fff\" : \"inherit\",\n cursor: \"pointer\",\n fontSize: \"12px\",\n }}\n >\n {opt.label}\n </button>\n );\n }\n return (\n <label\n key={i}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n cursor: \"pointer\",\n }}\n >\n <input\n type={isMutuallyExclusive ? \"radio\" : \"checkbox\"}\n checked={isSelected}\n onChange={() => onToggle(opt.value)}\n name={\n isMutuallyExclusive\n ? `choice-${context.componentModel.id}`\n : undefined\n }\n />\n <span style={{ fontSize: \"14px\" }}>{opt.label}</span>\n </label>\n );\n })}\n </div>\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { SliderApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Slider = createReactComponent(SliderApi, ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(Number(e.target.value));\n };\n\n const uniqueId = React.useId();\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n margin: LEAF_MARGIN,\n width: \"100%\",\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"space-between\" }}>\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n <span style={{ fontSize: \"12px\", color: \"#666\" }}>{props.value}</span>\n </div>\n <input\n id={uniqueId}\n type=\"range\"\n min={props.min ?? 0}\n max={props.max}\n value={props.value ?? 0}\n onChange={onChange}\n style={{ width: \"100%\", cursor: \"pointer\" }}\n />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { DateTimeInputApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\nexport const DateTimeInput = createReactComponent(\n DateTimeInputApi,\n ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(e.target.value);\n };\n\n const uniqueId = React.useId();\n\n // Map enableDate/enableTime to input type\n let type = \"datetime-local\";\n if (props.enableDate && !props.enableTime) type = \"date\";\n if (!props.enableDate && props.enableTime) type = \"time\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n };\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n <input\n id={uniqueId}\n type={type}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n min={typeof props.min === \"string\" ? props.min : undefined}\n max={typeof props.max === \"string\" ? props.max : undefined}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Catalog } from \"@a2ui/web_core/v0_9\";\nimport { BASIC_FUNCTIONS } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport type { ReactComponentImplementation } from \"../../adapter\";\n\nimport { Text } from \"./components/Text\";\nimport { Image } from \"./components/Image\";\nimport { Icon } from \"./components/Icon\";\nimport { Video } from \"./components/Video\";\nimport { AudioPlayer } from \"./components/AudioPlayer\";\nimport { Row } from \"./components/Row\";\nimport { Column } from \"./components/Column\";\nimport { List } from \"./components/List\";\nimport { Card } from \"./components/Card\";\nimport { Tabs } from \"./components/Tabs\";\nimport { Divider } from \"./components/Divider\";\nimport { Modal } from \"./components/Modal\";\nimport { Button } from \"./components/Button\";\nimport { TextField } from \"./components/TextField\";\nimport { CheckBox } from \"./components/CheckBox\";\nimport { ChoicePicker } from \"./components/ChoicePicker\";\nimport { Slider } from \"./components/Slider\";\nimport { DateTimeInput } from \"./components/DateTimeInput\";\n\nconst basicComponents: ReactComponentImplementation[] = [\n Text,\n Image,\n Icon,\n Video,\n AudioPlayer,\n Row,\n Column,\n List,\n Card,\n Tabs,\n Divider,\n Modal,\n Button,\n TextField,\n CheckBox,\n ChoicePicker,\n Slider,\n DateTimeInput,\n];\n\nexport const basicCatalog = new Catalog<ReactComponentImplementation>(\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\",\n basicComponents,\n BASIC_FUNCTIONS,\n);\n\nexport {\n Text,\n Image,\n Icon,\n Video,\n AudioPlayer,\n Row,\n Column,\n List,\n Card,\n Tabs,\n Divider,\n Modal,\n Button,\n TextField,\n CheckBox,\n ChoicePicker,\n Slider,\n DateTimeInput,\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const TextSchema = z.object({\n text: CommonSchemas.DynamicString,\n variant: z.enum([\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"caption\", \"body\"]).optional(),\n});\n\nexport const TextApiDef = {\n name: \"Text\",\n schema: TextSchema,\n};\n\nexport const Text = createReactComponent(TextApiDef, ({ props }) => {\n const text = props.text ?? \"\";\n switch (props.variant) {\n case \"h1\":\n return <h1>{text}</h1>;\n case \"h2\":\n return <h2>{text}</h2>;\n case \"h3\":\n return <h3>{text}</h3>;\n case \"h4\":\n return <h4>{text}</h4>;\n case \"h5\":\n return <h5>{text}</h5>;\n case \"caption\":\n return <small>{text}</small>;\n case \"body\":\n default:\n return <span>{text}</span>;\n }\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const ButtonSchema = z.object({\n child: CommonSchemas.ComponentId,\n action: CommonSchemas.Action,\n variant: z.enum([\"primary\", \"borderless\"]).optional(),\n});\n\nexport const ButtonApiDef = {\n name: \"Button\",\n schema: ButtonSchema,\n};\n\nexport const Button = createReactComponent(\n ButtonApiDef,\n ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n padding: \"8px 16px\",\n cursor: \"pointer\",\n border: props.variant === \"borderless\" ? \"none\" : \"1px solid #ccc\",\n backgroundColor: props.variant === \"primary\" ? \"#007bff\" : \"transparent\",\n color: props.variant === \"primary\" ? \"#fff\" : \"inherit\",\n borderRadius: \"4px\",\n };\n\n return (\n <button style={style} onClick={props.action}>\n {props.child ? buildChild(props.child) : null}\n </button>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const ChildList: React.FC<{\n childList: unknown;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n}> = ({ childList, buildChild }) => {\n if (Array.isArray(childList)) {\n return (\n <>\n {childList.map((item: unknown, i: number) => {\n // The new binder outputs objects like { id: string, basePath: string } for arrays of structural nodes\n if (item && typeof item === \"object\" && \"id\" in item) {\n const node = item as { id: string; basePath?: string };\n return (\n <React.Fragment key={`${node.id}-${i}`}>\n {buildChild(node.id, node.basePath)}\n </React.Fragment>\n );\n }\n // Fallback for static string lists\n if (typeof item === \"string\") {\n return (\n <React.Fragment key={`${item}-${i}`}>\n {buildChild(item)}\n </React.Fragment>\n );\n }\n return null;\n })}\n </>\n );\n }\n\n return null;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\nimport { ChildList } from \"./ChildList\";\n\nexport const RowSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"center\",\n \"end\",\n \"spaceAround\",\n \"spaceBetween\",\n \"spaceEvenly\",\n \"start\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n});\n\nconst mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nconst mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const RowApiDef = {\n name: \"Row\",\n schema: RowSchema,\n};\n\nexport const Row = createReactComponent(RowApiDef, ({ props, buildChild }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n }}\n >\n <ChildList childList={props.children} buildChild={buildChild} />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\nimport { ChildList } from \"./ChildList\";\n\nexport const ColumnSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"center\", \"end\", \"start\", \"stretch\"]).optional(),\n});\n\nconst mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nconst mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const ColumnApiDef = {\n name: \"Column\",\n schema: ColumnSchema,\n};\n\nexport const Column = createReactComponent(\n ColumnApiDef,\n ({ props, buildChild }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n gap: \"8px\",\n }}\n >\n <ChildList childList={props.children} buildChild={buildChild} />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const TextFieldSchema = z.object({\n label: CommonSchemas.DynamicString,\n value: CommonSchemas.DynamicString,\n variant: z.enum([\"longText\", \"number\", \"shortText\", \"obscured\"]).optional(),\n validationRegexp: z.string().optional(),\n});\n\nexport const TextFieldApiDef = {\n name: \"TextField\",\n schema: TextFieldSchema,\n};\n\nexport const TextField = createReactComponent(\n TextFieldApiDef,\n ({ props, context }) => {\n const onChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n if (props.setValue) {\n props.setValue(e.target.value);\n }\n };\n\n const isLong = props.variant === \"longText\";\n const type =\n props.variant === \"number\"\n ? \"number\"\n : props.variant === \"obscured\"\n ? \"password\"\n : \"text\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: \"1px solid #ccc\",\n borderRadius: \"4px\",\n boxSizing: \"border-box\",\n };\n\n const id = `textfield-${context.componentModel.id}`;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n }}\n >\n {props.label && (\n <label htmlFor={id} style={{ fontSize: \"14px\", fontWeight: \"bold\" }}>\n {props.label}\n </label>\n )}\n {isLong ? (\n <textarea\n id={id}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n />\n ) : (\n <input\n id={id}\n type={type}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n />\n )}\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Catalog, createFunctionImplementation } from \"@a2ui/web_core/v0_9\";\nimport { Text } from \"./components/Text\";\nimport { Button } from \"./components/Button\";\nimport { Row } from \"./components/Row\";\nimport { Column } from \"./components/Column\";\nimport { TextField } from \"./components/TextField\";\nimport type { ReactComponentImplementation } from \"../../adapter\";\nimport { z } from \"zod\";\n\nconst minimalComponents: ReactComponentImplementation[] = [\n Text,\n Button,\n Row,\n Column,\n TextField,\n];\n\nexport const minimalCatalog = new Catalog<ReactComponentImplementation>(\n \"https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json\",\n minimalComponents,\n [\n createFunctionImplementation(\n {\n name: \"capitalize\",\n returnType: \"string\",\n schema: z.object({\n value: z.unknown(),\n }),\n },\n (args) => {\n const val = args.value;\n if (typeof val === \"string\") {\n return val.toUpperCase();\n }\n return val as string;\n },\n ),\n ],\n);\n\nexport { Text, Button, Row, Column, TextField };\n","import { createContext, useContext, type ReactNode } from \"react\";\n\ntype ThemeType = Record<string, unknown>;\n\n/** React context for the A2UI theme. */\nconst ThemeContext = createContext<ThemeType | undefined>(undefined);\n\nexport interface ThemeProviderProps {\n theme?: ThemeType;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme, children }: ThemeProviderProps) {\n return (\n <ThemeContext.Provider value={theme ?? {}}>\n {children}\n </ThemeContext.Provider>\n );\n}\n\nexport function useTheme(): ThemeType {\n const theme = useContext(ThemeContext);\n if (!theme) {\n throw new Error(\n \"useTheme must be used within a ThemeProvider or A2UIProvider\",\n );\n }\n return theme;\n}\n\nexport function useThemeOptional(): ThemeType | undefined {\n return useContext(ThemeContext);\n}\n","import {\n createContext,\n useContext,\n useRef,\n useState,\n useMemo,\n type ReactNode,\n} from \"react\";\nimport { MessageProcessor } from \"@a2ui/web_core/v0_9\";\nimport { basicCatalog } from \"../a2ui-react\";\nimport type { A2UIContextValue, A2UIActions } from \"./store\";\nimport { ThemeProvider } from \"../theme/ThemeContext\";\nimport type { OnActionCallback } from \"../types\";\nimport type { A2UIClientEventMessage, Theme } from \"../../a2ui-types\";\n\n/**\n * Context for stable actions (never changes reference, prevents re-renders).\n */\nconst A2UIActionsContext = createContext<A2UIActions | null>(null);\n\n/**\n * Context for reactive state (changes trigger re-renders).\n */\nconst A2UIStateContext = createContext<{\n version: number;\n error: string | null;\n} | null>(null);\n\n/**\n * Props for the A2UIProvider component.\n */\nexport interface A2UIProviderProps {\n /** Callback invoked when a user action is dispatched (button click, etc.) */\n onAction?: OnActionCallback;\n /** Theme configuration */\n theme?: Theme;\n /** Optional component catalog to use instead of the default basicCatalog */\n catalog?: any;\n /** Child components */\n children: ReactNode;\n}\n\n/**\n * Provider component that sets up the A2UI v0.9 context for descendant components.\n * Uses a two-context architecture for performance:\n * - A2UIActionsContext: Stable actions that never change (no re-renders)\n * - A2UIStateContext: Reactive state that triggers re-renders when needed\n */\nexport function A2UIProvider({\n onAction,\n theme,\n catalog,\n children,\n}: A2UIProviderProps) {\n // Store onAction in a ref so callbacks always have the latest value\n const onActionRef = useRef<OnActionCallback | null>(onAction ?? null);\n onActionRef.current = onAction ?? null;\n\n // Create v0.9 MessageProcessor only once using ref\n const processorRef = useRef<MessageProcessor<any> | null>(null);\n if (!processorRef.current) {\n processorRef.current = new MessageProcessor(\n [catalog ?? basicCatalog],\n // Action handler: convert v0.9 Action to A2UIClientEventMessage format\n (action: any) => {\n if (onActionRef.current) {\n const message: A2UIClientEventMessage = {\n userAction: {\n name: action?.name ?? \"unknown\",\n surfaceId: action?.surfaceId ?? \"default\",\n sourceComponentId: action?.sourceComponentId,\n context: action?.context,\n timestamp: action?.timestamp ?? new Date().toISOString(),\n },\n };\n onActionRef.current(message);\n }\n },\n );\n }\n const processor = processorRef.current;\n\n // Version counter for triggering re-renders\n const [version, setVersion] = useState(0);\n\n // Error state for graceful error handling\n const [error, setError] = useState<string | null>(null);\n\n // Create stable actions object once - stored in ref, never changes\n const actionsRef = useRef<A2UIActions | null>(null);\n if (!actionsRef.current) {\n actionsRef.current = {\n processMessages: (messages: Array<Record<string, unknown>>) => {\n try {\n processor.processMessages(messages as any[]);\n } catch (err) {\n console.warn(\"[A2UI] processMessages error:\", err);\n setError(err instanceof Error ? err.message : String(err));\n return;\n }\n setError(null);\n setVersion((v) => v + 1);\n },\n\n dispatch: (message: any) => {\n if (onActionRef.current) {\n onActionRef.current(message);\n }\n },\n\n getSurface: (surfaceId: string) => {\n return processor.model.getSurface(surfaceId);\n },\n\n clearSurfaces: () => {\n // Process a deleteSurface for all known surfaces\n const surfaces = processor.model.surfacesMap;\n for (const [id] of surfaces) {\n processor.processMessages([\n { version: \"v0.9\", deleteSurface: { surfaceId: id } } as any,\n ]);\n }\n setVersion((v) => v + 1);\n },\n };\n }\n const actions = actionsRef.current;\n\n // State context value - changes when version or error changes\n const stateValue = useMemo(() => ({ version, error }), [version, error]);\n\n return (\n <A2UIActionsContext.Provider value={actions}>\n <A2UIStateContext.Provider value={stateValue}>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </A2UIStateContext.Provider>\n </A2UIActionsContext.Provider>\n );\n}\n\n/**\n * Hook to access stable A2UI actions (won't cause re-renders).\n */\nexport function useA2UIActions(): A2UIActions {\n const actions = useContext(A2UIActionsContext);\n if (!actions) {\n throw new Error(\"useA2UIActions must be used within an A2UIProvider\");\n }\n return actions;\n}\n\n/**\n * Hook to subscribe to A2UI state changes.\n */\nexport function useA2UIState(): { version: number } {\n const state = useContext(A2UIStateContext);\n if (!state) {\n throw new Error(\"useA2UIState must be used within an A2UIProvider\");\n }\n return state;\n}\n\n/**\n * Hook to access the full A2UI context (actions + state).\n */\nexport function useA2UIContext(): A2UIContextValue {\n const actions = useA2UIActions();\n const state = useA2UIState();\n\n return useMemo(\n () => ({\n ...actions,\n version: state.version,\n onAction: null,\n }),\n [actions, state.version],\n );\n}\n\n/** @deprecated Use useA2UIContext instead. */\nexport const useA2UIStore = useA2UIContext;\n\n/**\n * Hook to access the current A2UI error state.\n */\nexport function useA2UIError(): string | null {\n const state = useContext(A2UIStateContext);\n return state?.error ?? null;\n}\n\n/** @deprecated Use useA2UIContext() or useA2UI() directly instead. */\nexport function useA2UIStoreSelector<T>(\n selector: (state: A2UIContextValue) => T,\n): T {\n const context = useA2UIContext();\n return selector(context);\n}\n","import { useA2UIActions, useA2UIState } from \"../core/A2UIProvider\";\n\n/**\n * Result returned by the useA2UI hook.\n */\nexport interface UseA2UIResult {\n /** Process incoming v0.9 A2UI messages */\n processMessages: (messages: Array<Record<string, unknown>>) => void;\n\n /** Get a surface model by ID */\n getSurface: (surfaceId: string) => any | undefined;\n\n /** Clear all surfaces */\n clearSurfaces: () => void;\n\n /** The current version number (increments on state changes) */\n version: number;\n}\n\n/**\n * Main API hook for A2UI v0.9. Provides methods to process messages\n * and access surface state.\n */\nexport function useA2UI(): UseA2UIResult {\n const actions = useA2UIActions();\n const state = useA2UIState();\n\n return {\n processMessages: actions.processMessages,\n getSurface: actions.getSurface,\n clearSurfaces: actions.clearSurfaces,\n version: state.version,\n };\n}\n","import { clsx, type ClassValue } from \"clsx\";\n\n/**\n * Utility function to merge class names.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return clsx(inputs);\n}\n","import { Suspense, memo, type ReactNode } from \"react\";\nimport { useA2UI } from \"../hooks/useA2UI\";\nimport { A2uiSurface } from \"../a2ui-react\";\nimport { cn } from \"../lib/utils\";\n\n/** Default loading fallback - memoized to prevent recreation */\nconst DefaultLoadingFallback = memo(function DefaultLoadingFallback() {\n return (\n <div className=\"a2ui-loading\" style={{ padding: \"16px\", opacity: 0.5 }}>\n Loading...\n </div>\n );\n});\n\nexport interface A2UIRendererProps {\n /** The surface ID to render */\n surfaceId: string;\n /** Additional CSS classes for the surface container */\n className?: string;\n /** Fallback content when surface is not yet available */\n fallback?: ReactNode;\n /** Loading fallback for lazy-loaded components */\n loadingFallback?: ReactNode;\n /** @deprecated - No longer needed in v0.9, components come from catalog */\n registry?: any;\n}\n\n/**\n * A2UIRenderer - renders an A2UI surface using the v0.9 renderer.\n *\n * Uses A2uiSurface from a2ui-react which handles all component\n * rendering internally via the catalog system.\n */\nexport const A2UIRenderer = memo(function A2UIRenderer({\n surfaceId,\n className,\n fallback = null,\n loadingFallback,\n}: A2UIRendererProps) {\n const { getSurface, version } = useA2UI();\n\n // Get v0.9 SurfaceModel - this will re-render when version changes\n const surface = getSurface(surfaceId);\n\n // No surface yet\n if (!surface) {\n return <>{fallback}</>;\n }\n\n // Use provided fallback or default memoized component\n const actualLoadingFallback = loadingFallback ?? <DefaultLoadingFallback />;\n\n return (\n <div\n className={cn(\"a2ui-surface\", className)}\n data-surface-id={surfaceId}\n data-version={version}\n >\n <Suspense fallback={actualLoadingFallback}>\n <A2uiSurface surface={surface} />\n </Suspense>\n </div>\n );\n});\n\nexport default A2UIRenderer;\n","import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Extract component schemas from a catalog in the same format used by\n * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod\n * schema is converted to JSON Schema via zod-to-json-schema.\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): Array<{ name: string; props: Record<string, unknown> }> {\n const resolved = catalog ?? basicCatalog;\n const schemas: Array<{ name: string; props: Record<string, unknown> }> = [];\n\n for (const [name, comp] of resolved.components) {\n schemas.push({\n name,\n props: zodToJsonSchema(comp.schema, { target: \"openApi3\" }) as Record<\n string,\n unknown\n >,\n });\n }\n\n return schemas;\n}\n","import { z, type ZodObject, type ZodRawShape } from \"zod\";\nimport { Catalog } from \"@a2ui/web_core/v0_9\";\nimport { BASIC_FUNCTIONS } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { basicCatalog, createReactComponent } from \"./a2ui-react\";\nimport type { ReactComponentImplementation } from \"./a2ui-react\";\nimport type { ComponentApi } from \"@a2ui/web_core/v0_9\";\n\n// ─── Catalog Definitions (platform-agnostic) ─────────────────────────\n\n/**\n * A single component definition — Zod props schema + optional description.\n * Platform-agnostic: no React or rendering details.\n */\nexport interface CatalogComponentDefinition<\n T extends ZodRawShape = ZodRawShape,\n> {\n /** Zod schema for component props */\n props: ZodObject<T>;\n /** Description for the AI agent */\n description?: string;\n}\n\n/**\n * A record mapping component names to their definitions.\n * This is the platform-agnostic \"contract\" that agents use.\n */\nexport type CatalogDefinitions = Record<\n string,\n CatalogComponentDefinition<any>\n>;\n\n/**\n * Infer the props type for a specific component in the definitions.\n */\nexport type PropsOf<D extends CatalogDefinitions, K extends keyof D> = z.infer<\n D[K][\"props\"]\n>;\n\n// ─── Catalog Renderers (platform-specific) ───────────────────────────\n\n/**\n * Props passed to a renderer function.\n */\nexport interface RendererProps<T = Record<string, unknown>> {\n /** Resolved prop values from the A2UI data model */\n props: T;\n /** Render a child component by ID */\n children: (id: string) => React.ReactNode;\n /** Dispatch an A2UI action from this component (e.g., on button click) */\n dispatch?: (action: any) => void;\n}\n\n/**\n * A renderer function for a component.\n */\nexport type ComponentRenderer<T = Record<string, unknown>> = React.FC<\n RendererProps<T>\n>;\n\n/**\n * A record mapping component names to React renderer functions.\n * Type-checked against the catalog definitions.\n */\nexport type CatalogRenderers<D extends CatalogDefinitions> = {\n [K in keyof D]: ComponentRenderer<z.infer<D[K][\"props\"]>>;\n};\n\n// ─── Create Catalog ──────────────────────────────────────────────────\n\n/**\n * Create an A2UI catalog from definitions and renderers.\n *\n * Definitions are platform-agnostic (Zod schemas + descriptions).\n * Renderers are platform-specific (React components).\n * TypeScript enforces that renderers match definitions exactly.\n *\n * @example\n * ```tsx\n * // schema.ts (platform-agnostic)\n * export const demoCatalogDefinitions = {\n * Card: {\n * description: \"A card container\",\n * props: z.object({ title: z.string(), child: z.string().optional() }),\n * },\n * } satisfies CatalogDefinitions;\n *\n * // catalog.tsx (React renderers)\n * export const demoCatalog = createCatalog(demoCatalogDefinitions, {\n * Card: ({ props, children }) => (\n * <div>{props.title}{props.child && children(props.child)}</div>\n * ),\n * });\n * ```\n */\nexport function createCatalog<D extends CatalogDefinitions>(\n definitions: D,\n renderers: CatalogRenderers<D>,\n options?: {\n /** Catalog ID. Defaults to a generated URI. */\n catalogId?: string;\n /** If true, merge the built-in basic catalog components (Text, Button, Row, etc.) into this catalog. Default: false */\n includeBasicCatalog?: boolean;\n },\n): Catalog<ReactComponentImplementation> {\n const catalogId = options?.catalogId ?? \"copilotkit://custom-catalog\";\n const includeBasic = options?.includeBasicCatalog === true;\n\n const customComponents: ReactComponentImplementation[] = [];\n\n for (const [name, def] of Object.entries(definitions)) {\n const api: ComponentApi = {\n name,\n schema: def.props,\n };\n\n const renderer = (renderers as Record<string, ComponentRenderer<any>>)[\n name\n ];\n const wrapped = createReactComponent(\n api,\n ({ props, buildChild, context }) => {\n const Render = renderer;\n const dispatch = (action: any) => context.dispatchAction(action);\n return (\n <Render props={props} children={buildChild} dispatch={dispatch} />\n );\n },\n );\n\n customComponents.push(wrapped);\n }\n\n const allComponents = includeBasic\n ? [...Array.from(basicCatalog.components.values()), ...customComponents]\n : customComponents;\n\n const functions = includeBasic\n ? Array.from(basicCatalog.functions.values())\n : [];\n\n return new Catalog<ReactComponentImplementation>(\n catalogId,\n allComponents,\n functions,\n );\n}\n\n// ─── Extract Schema (for runtime) ────────────────────────────────────\n\n/**\n * Extract a JSON-serializable schema from catalog definitions.\n * Suitable for passing to the runtime's `a2ui.schema` config.\n */\nexport function extractSchema(definitions: CatalogDefinitions): Array<{\n name: string;\n description?: string;\n props?: Record<string, unknown>;\n}> {\n return Object.entries(definitions).map(([name, def]) => ({\n name,\n description: def.description,\n props: zodSchemaToSimpleObject(def.props),\n }));\n}\n\nfunction zodSchemaToSimpleObject(\n schema: ZodObject<any>,\n): Record<string, unknown> {\n const shape = schema.shape;\n const properties: Record<string, { type: string; description?: string }> = {};\n for (const [key, value] of Object.entries(shape)) {\n const zodValue = value as any;\n properties[key] = {\n type: zodValue._def?.typeName ?? \"unknown\",\n ...(zodValue.description ? { description: zodValue.description } : {}),\n };\n }\n return { type: \"object\", properties };\n}\n\n// ─── Backward Compatibility ──────────────────────────────────────────\n\n// Old API — definitions + renderers combined in one object\nexport interface A2UIComponentDefinition<T extends ZodRawShape = ZodRawShape> {\n props: ZodObject<T>;\n description?: string;\n render: React.FC<RendererProps<z.infer<ZodObject<T>>>>;\n}\n\nexport type A2UIComponentMap = Record<string, A2UIComponentDefinition<any>>;\n\n/**\n * @deprecated Use `createCatalog(definitions, renderers)` instead.\n */\nexport function createA2UICatalog(\n components: A2UIComponentMap,\n options?: {\n catalogId?: string;\n includeBasicCatalog?: boolean;\n },\n): Catalog<ReactComponentImplementation> {\n const definitions: CatalogDefinitions = {};\n const renderers: Record<string, ComponentRenderer<any>> = {};\n\n for (const [name, def] of Object.entries(components)) {\n definitions[name] = { props: def.props, description: def.description };\n renderers[name] = def.render;\n }\n\n return createCatalog(definitions, renderers as any, options);\n}\n\n/**\n * @deprecated Use `extractSchema(definitions)` instead.\n */\nexport function extractA2UISchema(components: A2UIComponentMap): Array<{\n name: string;\n description?: string;\n props?: Record<string, unknown>;\n}> {\n const definitions: CatalogDefinitions = {};\n for (const [name, def] of Object.entries(components)) {\n definitions[name] = { props: def.props, description: def.description };\n }\n return extractSchema(definitions);\n}\n","/**\n * v0.9: Styles are now handled by a2ui-react components internally.\n * These functions are kept as no-ops for backward compatibility.\n */\n\nexport function injectStyles(): void {\n // v0.9: styles are inline in a2ui-react components (no external injection needed)\n}\n\nexport function removeStyles(): void {\n // v0.9: no-op\n}\n","// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n","/**\n * v0.9 A2UI type definitions for CopilotKit integration.\n */\n\n/** Theme type - v0.9 themes are passed via createSurface message */\nexport type Theme = Record<string, unknown>;\n\n/**\n * Client event message dispatched when a user interacts with an A2UI surface.\n * This is the format expected by A2UIMessageRenderer's handleAction.\n */\nexport interface A2UIClientEventMessage {\n userAction?: {\n name: string;\n surfaceId: string;\n sourceComponentId?: string;\n context?: Record<string, unknown>;\n timestamp?: string;\n dataContextPath?: string;\n };\n}\n\n/** Default surface ID when none is specified */\nexport const DEFAULT_SURFACE_ID = \"default\";\n","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\nexport * from \"./react-renderer/index.js\";\nexport { DEFAULT_SURFACE_ID } from \"./a2ui-types.js\";\nexport type { Theme, A2UIClientEventMessage } from \"./a2ui-types.js\";\n\n// Backward compat: viewerTheme (v0.9 themes handled internally)\nexport const viewerTheme: Record<string, unknown> = {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBA,MAAM,iCACH,EACC,SACA,IACA,UACA,UACA,qBAOI;EACJ,MAAM,oBAAoB,SAAS;EAGnC,MAAM,mCACE,IAAIA,qCAAiB,SAAS,IAAI,SAAS,EAGjD;GAAC;GAAS;GAAI;GAAU;GAAe,CACxC;AAiBD,SAAO,2CAAC;GAA2B;GAAS,oCAdzC,SAAiB,iBAA0B;IAC1C,MAAM,OAAO,gBAAgB,QAAQ,YAAY;AACjD,WACE,2CAAC;KAEU;KACT,IAAI;KACJ,UAAU;OAHL,GAAG,QAAQ,GAAG,OAInB;MAGN,CAAC,SAAS,QAAQ,YAAY,KAAK,CACpC;IAEqE;GAEzE;AACD,eAAc,cAAc;CAE5B,MAAa,iCAIF,EAAE,SAAS,IAAI,eAAe;EAEvC,MAAM,iCAAsB;GAC1B,IAAI,UAAU;AACd,UAAO;IACL,YAAY,OAAmB;KAC7B,MAAM,SAAS,QAAQ,gBAAgB,UAAU,WAAW,SAAS;AACnE,UAAI,KAAK,OAAO,IAAI;AAClB;AACA,WAAI;;OAEN;KACF,MAAM,SAAS,QAAQ,gBAAgB,UAAU,WAAW,UAAU;AACpE,UAAI,UAAU,IAAI;AAChB;AACA,WAAI;;OAEN;AACF,kBAAa;AACX,aAAO,aAAa;AACpB,aAAO,aAAa;;;IAGxB,mBAAmB;KACjB,MAAM,OAAO,QAAQ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IAAI;IAAa;AACtE,aAAU,QAAQ,IAAI;;AAGxB,SAAO,cAAc,aAAa,WAAkB,QAAQ;;;;;CAM9D,SAAgB,kBAAkB,YAI/B;EACD,MAAM,cAAkC,EAAE;AAC1C,OAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,WAAW,CAClD,aAAY,QAAQ;GAAE,OAAO,IAAI;GAAO,aAAa,IAAI;GAAa;AAExE,SAAO,cAAc,YAAY;;;;;;;;;CC3NnC,SAAgB,eAAqB;CAIrC,SAAgB,eAAqB;;;;CC+ErC,SAAgB,yBAAyB;CAGzC,SAAgB,2BAA2B;CAK3C,MAAa,eAAwC,EAAE;CACvD,MAAa,WAAW;;;;;CC1ExB,MAAa,qBAAqB;;;;CCFlC,MAAa,cAAuC,EAAE"}
1
+ {"version":3,"file":"index.umd.js","names":["ComponentContext","GenericBinder","mapJustify","mapAlign","Text","TextApi","ImageApi","IconApi","VideoApi","AudioPlayerApi","ChildList","React","Row","RowApi","mapJustify","mapAlign","ChildList","Column","ColumnApi","mapJustify","mapAlign","ChildList","ListApi","mapAlign","ChildList","CardApi","TabsApi","DividerApi","ModalApi","Button","ButtonApi","TextField","TextFieldApi","React","CheckBoxApi","React","ChoicePickerApi","SliderApi","React","DateTimeInputApi","React","Text","Row","Column","Button","TextField","Catalog","BASIC_FUNCTIONS","z","CommonSchemas","z","CommonSchemas","React","z","CommonSchemas","mapJustify","mapAlign","z","CommonSchemas","z","CommonSchemas","Catalog","z","MessageProcessor","Suspense","Catalog"],"sources":["../src/react-renderer/a2ui-react/A2uiSurface.tsx","../src/react-renderer/a2ui-react/adapter.tsx","../src/react-renderer/a2ui-react/catalog/basic/utils.ts","../src/react-renderer/a2ui-react/catalog/basic/components/Text.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Image.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Icon.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Video.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/ChildList.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Row.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Column.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/List.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Card.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Tabs.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Divider.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Modal.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Button.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/TextField.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/CheckBox.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/Slider.tsx","../src/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.tsx","../src/react-renderer/a2ui-react/catalog/basic/index.ts","../src/react-renderer/a2ui-react/catalog/minimal/components/Text.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Button.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/ChildList.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Row.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/Column.tsx","../src/react-renderer/a2ui-react/catalog/minimal/components/TextField.tsx","../src/react-renderer/a2ui-react/catalog/minimal/index.ts","../src/react-renderer/theme/ThemeContext.tsx","../src/react-renderer/core/A2UIProvider.tsx","../src/react-renderer/hooks/useA2UI.ts","../src/react-renderer/lib/utils.ts","../src/react-renderer/core/A2UIRenderer.tsx","../src/react-renderer/catalog-utils.ts","../src/react-renderer/create-catalog.tsx","../src/react-renderer/styles/index.ts","../src/react-renderer/index.ts","../src/a2ui-types.ts","../src/index.ts"],"sourcesContent":["/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useSyncExternalStore, memo, useMemo, useCallback } from \"react\";\nimport {\n type SurfaceModel,\n ComponentContext,\n type ComponentModel,\n} from \"@a2ui/web_core/v0_9\";\nimport type { ReactComponentImplementation } from \"./adapter\";\n\nconst ResolvedChild = memo(\n ({\n surface,\n id,\n basePath,\n compImpl,\n componentModel,\n }: {\n surface: SurfaceModel<ReactComponentImplementation>;\n id: string;\n basePath: string;\n componentModel: ComponentModel;\n compImpl: ReactComponentImplementation;\n }) => {\n const ComponentToRender = compImpl.render;\n\n // Create context. Recreate if the componentModel instance changes (e.g. type change recreation).\n const context = useMemo(\n () => new ComponentContext(surface, id, basePath),\n // componentModel is used as a trigger for recreation even if not in the body\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [surface, id, basePath, componentModel],\n );\n\n const buildChild = useCallback(\n (childId: string, specificPath?: string) => {\n const path = specificPath || context.dataContext.path;\n return (\n <DeferredChild\n key={`${childId}-${path}`}\n surface={surface}\n id={childId}\n basePath={path}\n />\n );\n },\n [surface, context.dataContext.path],\n );\n\n return <ComponentToRender context={context} buildChild={buildChild} />;\n },\n);\nResolvedChild.displayName = \"ResolvedChild\";\n\nexport const DeferredChild: React.FC<{\n surface: SurfaceModel<ReactComponentImplementation>;\n id: string;\n basePath: string;\n}> = memo(({ surface, id, basePath }) => {\n // 1. Subscribe specifically to this component's existence\n const store = useMemo(() => {\n let version = 0;\n return {\n subscribe: (cb: () => void) => {\n const unsub1 = surface.componentsModel.onCreated.subscribe((comp) => {\n if (comp.id === id) {\n version++;\n cb();\n }\n });\n const unsub2 = surface.componentsModel.onDeleted.subscribe((delId) => {\n if (delId === id) {\n version++;\n cb();\n }\n });\n return () => {\n unsub1.unsubscribe();\n unsub2.unsubscribe();\n };\n },\n getSnapshot: () => {\n const comp = surface.componentsModel.get(id);\n // We use instance identity + version as the snapshot to ensure\n // type replacements (e.g. Button -> Text) trigger a re-render.\n return comp ? `${comp.type}-${version}` : `missing-${version}`;\n },\n };\n }, [surface, id]);\n\n useSyncExternalStore(store.subscribe, store.getSnapshot);\n\n const componentModel = surface.componentsModel.get(id);\n\n if (!componentModel) {\n return (\n <div\n style={{\n padding: \"12px 16px\",\n borderRadius: \"8px\",\n background:\n \"linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%)\",\n backgroundSize: \"200% 100%\",\n animation: \"a2ui-shimmer 1.5s ease-in-out infinite\",\n minHeight: \"2rem\",\n }}\n >\n <style>{`@keyframes a2ui-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }`}</style>\n </div>\n );\n }\n\n const compImpl = surface.catalog.components.get(componentModel.type);\n\n if (!compImpl) {\n return (\n <div style={{ color: \"red\" }}>\n Unknown component: {componentModel.type}\n </div>\n );\n }\n\n return (\n <ResolvedChild\n surface={surface}\n id={id}\n basePath={basePath}\n componentModel={componentModel}\n compImpl={compImpl}\n />\n );\n});\nDeferredChild.displayName = \"DeferredChild\";\n\nexport const A2uiSurface: React.FC<{\n surface: SurfaceModel<ReactComponentImplementation>;\n}> = ({ surface }) => {\n // The root component always has ID 'root' and base path '/'\n return <DeferredChild surface={surface} id=\"root\" basePath=\"/\" />;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n useRef,\n useSyncExternalStore,\n useCallback,\n memo,\n useEffect,\n} from \"react\";\nimport { type ComponentContext, GenericBinder } from \"@a2ui/web_core/v0_9\";\nimport type {\n ComponentApi,\n InferredComponentApiSchemaType,\n ResolveA2uiProps,\n} from \"@a2ui/web_core/v0_9\";\n\nexport interface ReactComponentImplementation extends ComponentApi {\n /** The framework-specific rendering wrapper. */\n render: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }>;\n}\n\nexport type ReactA2uiComponentProps<T> = {\n props: T;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n context: ComponentContext;\n};\n\n// --- Component Factories ---\n\n/**\n * Creates a React component implementation using the deep generic binder.\n */\nexport function createReactComponent<Api extends ComponentApi>(\n api: Api,\n RenderComponent: React.FC<\n ReactA2uiComponentProps<\n ResolveA2uiProps<InferredComponentApiSchemaType<Api>>\n >\n >,\n): ReactComponentImplementation {\n type Props = ResolveA2uiProps<InferredComponentApiSchemaType<Api>>;\n\n const MemoizedRender = memo(RenderComponent, (prev, next) => {\n if (prev.props !== next.props) return false;\n if (prev.context.componentModel.id !== next.context.componentModel.id)\n return false;\n if (prev.context.dataContext.path !== next.context.dataContext.path)\n return false;\n return true;\n });\n\n const ReactWrapper: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }> = ({ context, buildChild }) => {\n const bindingRef = useRef<GenericBinder<Props> | null>(null);\n\n // Create or recreate the binder if the context object changes.\n // DeferredChild memoizes `context`, so reference changes strictly correspond\n // to ComponentModel updates (like type changes) or Base Path adjustments.\n if (!bindingRef.current) {\n bindingRef.current = new GenericBinder<Props>(context, api.schema);\n } else if (\n (bindingRef.current as unknown as { context: ComponentContext })\n .context !== context\n ) {\n bindingRef.current.dispose();\n bindingRef.current = new GenericBinder<Props>(context, api.schema);\n }\n const binding = bindingRef.current;\n\n const subscribe = useCallback(\n (callback: () => void) => {\n const sub = binding.subscribe(callback);\n return () => sub.unsubscribe();\n },\n [binding],\n );\n\n const getSnapshot = useCallback(() => binding.snapshot, [binding]);\n const props = useSyncExternalStore(subscribe, getSnapshot);\n\n // Prevent DataModel subscription leaks on unmount\n useEffect(() => {\n return () => binding.dispose();\n }, [binding]);\n\n return (\n <MemoizedRender\n props={props || ({} as Props)}\n buildChild={buildChild}\n context={context}\n />\n );\n };\n\n return {\n name: api.name,\n schema: api.schema,\n render: ReactWrapper,\n };\n}\n\n/**\n * Creates a React component implementation that manages its own context bindings (no generic binder).\n */\nexport function createBinderlessComponent(\n api: ComponentApi,\n RenderComponent: React.FC<{\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n }>,\n): ReactComponentImplementation {\n return {\n name: api.name,\n schema: api.schema,\n render: RenderComponent,\n };\n}\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type React from \"react\";\n\n/** Standard leaf margin from the implementation guide. */\nexport const LEAF_MARGIN = \"8px\";\n\n/** Standard internal padding for visually bounded containers. */\nexport const CONTAINER_PADDING = \"16px\";\n\n/** Standard border for cards and inputs. */\nexport const STANDARD_BORDER = \"1px solid #ccc\";\n\n/** Standard border radius. */\nexport const STANDARD_RADIUS = \"8px\";\n\nexport const mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nexport const mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const getBaseLeafStyle = (): React.CSSProperties => ({\n margin: LEAF_MARGIN,\n boxSizing: \"border-box\",\n});\n\nexport const getBaseContainerStyle = (): React.CSSProperties => ({\n margin: LEAF_MARGIN,\n padding: CONTAINER_PADDING,\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TextApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Text = createReactComponent(TextApi, ({ props }) => {\n const text = props.text ?? \"\";\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n display: \"inline-block\",\n };\n\n switch (props.variant) {\n case \"h1\":\n return <h1 style={style}>{text}</h1>;\n case \"h2\":\n return <h2 style={style}>{text}</h2>;\n case \"h3\":\n return <h3 style={style}>{text}</h3>;\n case \"h4\":\n return <h4 style={style}>{text}</h4>;\n case \"h5\":\n return <h5 style={style}>{text}</h5>;\n case \"caption\":\n return (\n <small style={{ ...style, color: \"#666\", textAlign: \"left\" }}>\n {text}\n </small>\n );\n case \"body\":\n default:\n return <span style={style}>{text}</span>;\n }\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ImageApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Image = createReactComponent(ImageApi, ({ props }) => {\n const mapFit = (fit?: string): React.CSSProperties[\"objectFit\"] => {\n if (fit === \"scaleDown\") return \"scale-down\";\n return (fit as React.CSSProperties[\"objectFit\"]) || \"fill\";\n };\n\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n objectFit: mapFit(props.fit),\n width: \"100%\",\n height: \"auto\",\n display: \"block\",\n };\n\n if (props.variant === \"icon\") {\n style.width = \"24px\";\n style.height = \"24px\";\n } else if (props.variant === \"avatar\") {\n style.width = \"40px\";\n style.height = \"40px\";\n style.borderRadius = \"50%\";\n } else if (props.variant === \"smallFeature\") {\n style.maxWidth = \"100px\";\n } else if (props.variant === \"largeFeature\") {\n style.maxHeight = \"400px\";\n } else if (props.variant === \"header\") {\n style.height = \"200px\";\n style.objectFit = \"cover\";\n }\n\n return <img src={props.url} alt={props.description || \"\"} style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { IconApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Icon = createReactComponent(IconApi, ({ props }) => {\n const iconName =\n typeof props.name === \"string\"\n ? props.name\n : (props.name as { path?: string })?.path;\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n fontSize: \"24px\",\n width: \"24px\",\n height: \"24px\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n return (\n <span className=\"material-symbols-outlined\" style={style}>\n {iconName}\n </span>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { VideoApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const Video = createReactComponent(VideoApi, ({ props }) => {\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n width: \"100%\",\n aspectRatio: \"16/9\",\n };\n\n return <video src={props.url} controls style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { AudioPlayerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseLeafStyle } from \"../utils\";\n\nexport const AudioPlayer = createReactComponent(AudioPlayerApi, ({ props }) => {\n const style: React.CSSProperties = {\n ...getBaseLeafStyle(),\n width: \"100%\",\n };\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n }}\n >\n {props.description && (\n <span style={{ fontSize: \"12px\", color: \"#666\" }}>\n {props.description}\n </span>\n )}\n <audio src={props.url} controls style={style} />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { type ComponentContext } from \"@a2ui/web_core/v0_9\";\n\nexport const ChildList: React.FC<{\n childList: unknown;\n context: ComponentContext;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n}> = ({ childList, buildChild }) => {\n if (Array.isArray(childList)) {\n return (\n <>\n {childList.map((item: unknown, i: number) => {\n // The new binder outputs objects like { id: string, basePath: string } for arrays of structural nodes\n if (item && typeof item === \"object\" && \"id\" in item) {\n const node = item as { id: string; basePath?: string };\n return (\n <React.Fragment key={`${node.id}-${i}`}>\n {buildChild(node.id, node.basePath)}\n </React.Fragment>\n );\n }\n // Fallback for static string lists\n if (typeof item === \"string\") {\n return (\n <React.Fragment key={`${item}-${i}`}>\n {buildChild(item)}\n </React.Fragment>\n );\n }\n return null;\n })}\n </>\n );\n }\n\n return null;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { RowApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapJustify, mapAlign } from \"../utils\";\n\nexport const Row = createReactComponent(\n RowApi,\n ({ props, buildChild, context }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n width: \"100%\",\n margin: 0,\n padding: 0,\n }}\n >\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { ColumnApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapJustify, mapAlign } from \"../utils\";\n\nexport const Column = createReactComponent(\n ColumnApi,\n ({ props, buildChild, context }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n width: \"100%\",\n margin: 0,\n padding: 0,\n }}\n >\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ListApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { ChildList } from \"./ChildList\";\nimport { mapAlign } from \"../utils\";\n\nexport const List = createReactComponent(\n ListApi,\n ({ props, buildChild, context }) => {\n const isHorizontal = props.direction === \"horizontal\";\n const style: React.CSSProperties = {\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: mapAlign(props.align),\n overflowX: isHorizontal ? \"auto\" : \"hidden\",\n overflowY: isHorizontal ? \"hidden\" : \"auto\",\n width: \"100%\",\n margin: 0,\n padding: 0,\n };\n\n return (\n <div style={style}>\n <ChildList\n childList={props.children}\n buildChild={buildChild}\n context={context}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { CardApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { getBaseContainerStyle } from \"../utils\";\n\nexport const Card = createReactComponent(CardApi, ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n ...getBaseContainerStyle(),\n backgroundColor: \"#fff\",\n boxShadow: \"0 2px 4px rgba(0,0,0,0.1)\",\n width: \"100%\",\n };\n\n return (\n <div style={style}>{props.child ? buildChild(props.child) : null}</div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TabsApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\n// The type of a tab is deeply nested into the TabsApi schema, and\n// it seems z.infer is not inferring it correctly (?). We use `any` for now.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype _Tab = any;\n\nexport const Tabs = createReactComponent(TabsApi, ({ props, buildChild }) => {\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n const tabs = props.tabs || [];\n const activeTab = tabs[selectedIndex];\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n <div\n style={{\n display: \"flex\",\n borderBottom: \"1px solid #ccc\",\n marginBottom: \"8px\",\n }}\n >\n {tabs.map((tab: _Tab, i: number) => (\n <button\n key={i}\n onClick={() => setSelectedIndex(i)}\n style={{\n padding: \"8px 16px\",\n border: \"none\",\n background: \"none\",\n borderBottom:\n selectedIndex === i\n ? \"2px solid var(--a2ui-primary-color, #007bff)\"\n : \"none\",\n fontWeight: selectedIndex === i ? \"bold\" : \"normal\",\n cursor: \"pointer\",\n color:\n selectedIndex === i\n ? \"var(--a2ui-primary-color, #007bff)\"\n : \"inherit\",\n }}\n >\n {tab.title}\n </button>\n ))}\n </div>\n <div style={{ flex: 1 }}>\n {activeTab ? buildChild(activeTab.child) : null}\n </div>\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { DividerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Divider = createReactComponent(DividerApi, ({ props }) => {\n const isVertical = props.axis === \"vertical\";\n const style: React.CSSProperties = {\n margin: LEAF_MARGIN,\n border: \"none\",\n backgroundColor: \"#ccc\",\n };\n\n if (isVertical) {\n style.width = \"1px\";\n style.height = \"100%\";\n } else {\n style.width = \"100%\";\n style.height = \"1px\";\n }\n\n return <div style={style} />;\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ModalApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\n\nexport const Modal = createReactComponent(ModalApi, ({ props, buildChild }) => {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <>\n <div onClick={() => setIsOpen(true)} style={{ display: \"inline-block\" }}>\n {props.trigger ? buildChild(props.trigger) : null}\n </div>\n {isOpen && (\n <div\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 1000,\n }}\n onClick={() => setIsOpen(false)}\n >\n <div\n style={{\n backgroundColor: \"#fff\",\n padding: \"24px\",\n borderRadius: \"8px\",\n maxWidth: \"90%\",\n maxHeight: \"90%\",\n overflow: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n onClick={(e) => e.stopPropagation()}\n >\n <div style={{ display: \"flex\", justifyContent: \"flex-end\" }}>\n <button\n onClick={() => setIsOpen(false)}\n style={{\n border: \"none\",\n background: \"none\",\n fontSize: \"20px\",\n cursor: \"pointer\",\n padding: \"4px\",\n }}\n >\n &times;\n </button>\n </div>\n <div style={{ flex: 1 }}>\n {props.content ? buildChild(props.content) : null}\n </div>\n </div>\n </div>\n )}\n </>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ButtonApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Button = createReactComponent(\n ButtonApi,\n ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n margin: LEAF_MARGIN,\n padding: \"8px 16px\",\n cursor: \"pointer\",\n border: props.variant === \"borderless\" ? \"none\" : \"1px solid #ccc\",\n backgroundColor:\n props.variant === \"primary\"\n ? \"var(--a2ui-primary-color, #007bff)\"\n : props.variant === \"borderless\"\n ? \"transparent\"\n : \"#fff\",\n color: props.variant === \"primary\" ? \"#fff\" : \"inherit\",\n borderRadius: \"4px\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxSizing: \"border-box\",\n };\n\n return (\n <button\n style={style}\n onClick={props.action}\n disabled={props.isValid === false}\n >\n {props.child ? buildChild(props.child) : null}\n </button>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { TextFieldApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\nexport const TextField = createReactComponent(TextFieldApi, ({ props }) => {\n const onChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n props.setValue(e.target.value);\n };\n\n const isLong = props.variant === \"longText\";\n const type =\n props.variant === \"number\"\n ? \"number\"\n : props.variant === \"obscured\"\n ? \"password\"\n : \"text\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n };\n\n // Note: To have a unique id without passing context we can use a random or provided id,\n // but the simplest is just relying on React's useId if we really need it.\n // For now, we'll omit the `id` from the label connection since we removed context.\n const uniqueId = React.useId();\n\n const hasError = props.validationErrors && props.validationErrors.length > 0;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n {isLong ? (\n <textarea\n id={uniqueId}\n style={{\n ...style,\n border: hasError ? \"1px solid red\" : STANDARD_BORDER,\n }}\n value={props.value || \"\"}\n onChange={onChange}\n />\n ) : (\n <input\n id={uniqueId}\n type={type}\n style={{\n ...style,\n border: hasError ? \"1px solid red\" : STANDARD_BORDER,\n }}\n value={props.value || \"\"}\n onChange={onChange}\n />\n )}\n {hasError && (\n <span style={{ fontSize: \"12px\", color: \"red\" }}>\n {props.validationErrors![0]}\n </span>\n )}\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { CheckBoxApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const CheckBox = createReactComponent(CheckBoxApi, ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(e.target.checked);\n };\n\n const uniqueId = React.useId();\n\n const hasError = props.validationErrors && props.validationErrors.length > 0;\n\n return (\n <div\n style={{ display: \"flex\", flexDirection: \"column\", margin: LEAF_MARGIN }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n <input\n id={uniqueId}\n type=\"checkbox\"\n checked={!!props.value}\n onChange={onChange}\n style={{\n cursor: \"pointer\",\n outline: hasError ? \"1px solid red\" : \"none\",\n }}\n />\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ cursor: \"pointer\", color: hasError ? \"red\" : \"inherit\" }}\n >\n {props.label}\n </label>\n )}\n </div>\n {hasError && (\n <span style={{ fontSize: \"12px\", color: \"red\", marginTop: \"4px\" }}>\n {props.validationErrors?.[0]}\n </span>\n )}\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { ChoicePickerApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\n// The type of an option is deeply nested into the ChoicePickerApi schema, and\n// it seems z.infer is not inferring it correctly (?). We use `any` for now.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype _Option = any;\n\nexport const ChoicePicker = createReactComponent(\n ChoicePickerApi,\n ({ props, context }) => {\n const [filter, setFilter] = useState(\"\");\n\n const values = Array.isArray(props.value) ? props.value : [];\n const isMutuallyExclusive = props.variant === \"mutuallyExclusive\";\n\n const onToggle = (val: string) => {\n if (isMutuallyExclusive) {\n props.setValue([val]);\n } else {\n const newValues = values.includes(val)\n ? values.filter((v: string) => v !== val)\n : [...values, val];\n props.setValue(newValues);\n }\n };\n\n const options = (props.options || []).filter(\n (opt: _Option) =>\n !props.filterable ||\n filter === \"\" ||\n String(opt.label).toLowerCase().includes(filter.toLowerCase()),\n );\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"8px\",\n margin: LEAF_MARGIN,\n width: \"100%\",\n };\n\n const listStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: props.displayStyle === \"chips\" ? \"row\" : \"column\",\n flexWrap: props.displayStyle === \"chips\" ? \"wrap\" : \"nowrap\",\n gap: \"8px\",\n };\n\n return (\n <div style={containerStyle}>\n {props.label && (\n <strong style={{ fontSize: \"14px\" }}>{props.label}</strong>\n )}\n {props.filterable && (\n <input\n type=\"text\"\n placeholder=\"Filter options...\"\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n style={{\n padding: \"4px 8px\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n }}\n />\n )}\n <div style={listStyle}>\n {options.map((opt: _Option, i: number) => {\n const isSelected = values.includes(opt.value);\n if (props.displayStyle === \"chips\") {\n return (\n <button\n key={i}\n onClick={() => onToggle(opt.value)}\n style={{\n padding: \"4px 12px\",\n borderRadius: \"16px\",\n border: isSelected\n ? \"1px solid var(--a2ui-primary-color, #007bff)\"\n : STANDARD_BORDER,\n backgroundColor: isSelected\n ? \"var(--a2ui-primary-color, #007bff)\"\n : \"#fff\",\n color: isSelected ? \"#fff\" : \"inherit\",\n cursor: \"pointer\",\n fontSize: \"12px\",\n }}\n >\n {opt.label}\n </button>\n );\n }\n return (\n <label\n key={i}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n cursor: \"pointer\",\n }}\n >\n <input\n type={isMutuallyExclusive ? \"radio\" : \"checkbox\"}\n checked={isSelected}\n onChange={() => onToggle(opt.value)}\n name={\n isMutuallyExclusive\n ? `choice-${context.componentModel.id}`\n : undefined\n }\n />\n <span style={{ fontSize: \"14px\" }}>{opt.label}</span>\n </label>\n );\n })}\n </div>\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { SliderApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN } from \"../utils\";\n\nexport const Slider = createReactComponent(SliderApi, ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(Number(e.target.value));\n };\n\n const uniqueId = React.useId();\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n margin: LEAF_MARGIN,\n width: \"100%\",\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"space-between\" }}>\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n <span style={{ fontSize: \"12px\", color: \"#666\" }}>{props.value}</span>\n </div>\n <input\n id={uniqueId}\n type=\"range\"\n min={props.min ?? 0}\n max={props.max}\n value={props.value ?? 0}\n onChange={onChange}\n style={{ width: \"100%\", cursor: \"pointer\" }}\n />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { DateTimeInputApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS } from \"../utils\";\n\nexport const DateTimeInput = createReactComponent(\n DateTimeInputApi,\n ({ props }) => {\n const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n props.setValue(e.target.value);\n };\n\n const uniqueId = React.useId();\n\n // Map enableDate/enableTime to input type\n let type = \"datetime-local\";\n if (props.enableDate && !props.enableTime) type = \"date\";\n if (!props.enableDate && props.enableTime) type = \"time\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: STANDARD_BORDER,\n borderRadius: STANDARD_RADIUS,\n boxSizing: \"border-box\",\n };\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n margin: LEAF_MARGIN,\n }}\n >\n {props.label && (\n <label\n htmlFor={uniqueId}\n style={{ fontSize: \"14px\", fontWeight: \"bold\" }}\n >\n {props.label}\n </label>\n )}\n <input\n id={uniqueId}\n type={type}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n min={typeof props.min === \"string\" ? props.min : undefined}\n max={typeof props.max === \"string\" ? props.max : undefined}\n />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Catalog } from \"@a2ui/web_core/v0_9\";\nimport { BASIC_FUNCTIONS } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport type { ReactComponentImplementation } from \"../../adapter\";\n\nimport { Text } from \"./components/Text\";\nimport { Image } from \"./components/Image\";\nimport { Icon } from \"./components/Icon\";\nimport { Video } from \"./components/Video\";\nimport { AudioPlayer } from \"./components/AudioPlayer\";\nimport { Row } from \"./components/Row\";\nimport { Column } from \"./components/Column\";\nimport { List } from \"./components/List\";\nimport { Card } from \"./components/Card\";\nimport { Tabs } from \"./components/Tabs\";\nimport { Divider } from \"./components/Divider\";\nimport { Modal } from \"./components/Modal\";\nimport { Button } from \"./components/Button\";\nimport { TextField } from \"./components/TextField\";\nimport { CheckBox } from \"./components/CheckBox\";\nimport { ChoicePicker } from \"./components/ChoicePicker\";\nimport { Slider } from \"./components/Slider\";\nimport { DateTimeInput } from \"./components/DateTimeInput\";\n\nconst basicComponents: ReactComponentImplementation[] = [\n Text,\n Image,\n Icon,\n Video,\n AudioPlayer,\n Row,\n Column,\n List,\n Card,\n Tabs,\n Divider,\n Modal,\n Button,\n TextField,\n CheckBox,\n ChoicePicker,\n Slider,\n DateTimeInput,\n];\n\nexport const basicCatalog = new Catalog<ReactComponentImplementation>(\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\",\n basicComponents,\n BASIC_FUNCTIONS,\n);\n\nexport {\n Text,\n Image,\n Icon,\n Video,\n AudioPlayer,\n Row,\n Column,\n List,\n Card,\n Tabs,\n Divider,\n Modal,\n Button,\n TextField,\n CheckBox,\n ChoicePicker,\n Slider,\n DateTimeInput,\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const TextSchema = z.object({\n text: CommonSchemas.DynamicString,\n variant: z.enum([\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"caption\", \"body\"]).optional(),\n});\n\nexport const TextApiDef = {\n name: \"Text\",\n schema: TextSchema,\n};\n\nexport const Text = createReactComponent(TextApiDef, ({ props }) => {\n const text = props.text ?? \"\";\n switch (props.variant) {\n case \"h1\":\n return <h1>{text}</h1>;\n case \"h2\":\n return <h2>{text}</h2>;\n case \"h3\":\n return <h3>{text}</h3>;\n case \"h4\":\n return <h4>{text}</h4>;\n case \"h5\":\n return <h5>{text}</h5>;\n case \"caption\":\n return <small>{text}</small>;\n case \"body\":\n default:\n return <span>{text}</span>;\n }\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const ButtonSchema = z.object({\n child: CommonSchemas.ComponentId,\n action: CommonSchemas.Action,\n variant: z.enum([\"primary\", \"borderless\"]).optional(),\n});\n\nexport const ButtonApiDef = {\n name: \"Button\",\n schema: ButtonSchema,\n};\n\nexport const Button = createReactComponent(\n ButtonApiDef,\n ({ props, buildChild }) => {\n const style: React.CSSProperties = {\n padding: \"8px 16px\",\n cursor: \"pointer\",\n border: props.variant === \"borderless\" ? \"none\" : \"1px solid #ccc\",\n backgroundColor: props.variant === \"primary\" ? \"#007bff\" : \"transparent\",\n color: props.variant === \"primary\" ? \"#fff\" : \"inherit\",\n borderRadius: \"4px\",\n };\n\n return (\n <button style={style} onClick={props.action}>\n {props.child ? buildChild(props.child) : null}\n </button>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const ChildList: React.FC<{\n childList: unknown;\n buildChild: (id: string, basePath?: string) => React.ReactNode;\n}> = ({ childList, buildChild }) => {\n if (Array.isArray(childList)) {\n return (\n <>\n {childList.map((item: unknown, i: number) => {\n // The new binder outputs objects like { id: string, basePath: string } for arrays of structural nodes\n if (item && typeof item === \"object\" && \"id\" in item) {\n const node = item as { id: string; basePath?: string };\n return (\n <React.Fragment key={`${node.id}-${i}`}>\n {buildChild(node.id, node.basePath)}\n </React.Fragment>\n );\n }\n // Fallback for static string lists\n if (typeof item === \"string\") {\n return (\n <React.Fragment key={`${item}-${i}`}>\n {buildChild(item)}\n </React.Fragment>\n );\n }\n return null;\n })}\n </>\n );\n }\n\n return null;\n};\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\nimport { ChildList } from \"./ChildList\";\n\nexport const RowSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"center\",\n \"end\",\n \"spaceAround\",\n \"spaceBetween\",\n \"spaceEvenly\",\n \"start\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n});\n\nconst mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nconst mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const RowApiDef = {\n name: \"Row\",\n schema: RowSchema,\n};\n\nexport const Row = createReactComponent(RowApiDef, ({ props, buildChild }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n }}\n >\n <ChildList childList={props.children} buildChild={buildChild} />\n </div>\n );\n});\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\nimport { ChildList } from \"./ChildList\";\n\nexport const ColumnSchema = z.object({\n children: CommonSchemas.ChildList,\n justify: z\n .enum([\n \"start\",\n \"center\",\n \"end\",\n \"spaceBetween\",\n \"spaceAround\",\n \"spaceEvenly\",\n \"stretch\",\n ])\n .optional(),\n align: z.enum([\"center\", \"end\", \"start\", \"stretch\"]).optional(),\n});\n\nconst mapJustify = (j?: string) => {\n switch (j) {\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"spaceAround\":\n return \"space-around\";\n case \"spaceBetween\":\n return \"space-between\";\n case \"spaceEvenly\":\n return \"space-evenly\";\n case \"start\":\n return \"flex-start\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"flex-start\";\n }\n};\n\nconst mapAlign = (a?: string) => {\n switch (a) {\n case \"start\":\n return \"flex-start\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"flex-end\";\n case \"stretch\":\n return \"stretch\";\n default:\n return \"stretch\";\n }\n};\n\nexport const ColumnApiDef = {\n name: \"Column\",\n schema: ColumnSchema,\n};\n\nexport const Column = createReactComponent(\n ColumnApiDef,\n ({ props, buildChild }) => {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: mapJustify(props.justify),\n alignItems: mapAlign(props.align),\n gap: \"8px\",\n }}\n >\n <ChildList childList={props.children} buildChild={buildChild} />\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createReactComponent } from \"../../../adapter\";\nimport { z } from \"zod\";\nimport { CommonSchemas } from \"@a2ui/web_core/v0_9\";\n\nexport const TextFieldSchema = z.object({\n label: CommonSchemas.DynamicString,\n value: CommonSchemas.DynamicString,\n variant: z.enum([\"longText\", \"number\", \"shortText\", \"obscured\"]).optional(),\n validationRegexp: z.string().optional(),\n});\n\nexport const TextFieldApiDef = {\n name: \"TextField\",\n schema: TextFieldSchema,\n};\n\nexport const TextField = createReactComponent(\n TextFieldApiDef,\n ({ props, context }) => {\n const onChange = (\n e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n if (props.setValue) {\n props.setValue(e.target.value);\n }\n };\n\n const isLong = props.variant === \"longText\";\n const type =\n props.variant === \"number\"\n ? \"number\"\n : props.variant === \"obscured\"\n ? \"password\"\n : \"text\";\n\n const style: React.CSSProperties = {\n padding: \"8px\",\n width: \"100%\",\n border: \"1px solid #ccc\",\n borderRadius: \"4px\",\n boxSizing: \"border-box\",\n };\n\n const id = `textfield-${context.componentModel.id}`;\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n width: \"100%\",\n }}\n >\n {props.label && (\n <label htmlFor={id} style={{ fontSize: \"14px\", fontWeight: \"bold\" }}>\n {props.label}\n </label>\n )}\n {isLong ? (\n <textarea\n id={id}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n />\n ) : (\n <input\n id={id}\n type={type}\n style={style}\n value={props.value || \"\"}\n onChange={onChange}\n />\n )}\n </div>\n );\n },\n);\n","/**\n * Copyright 2026 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Catalog, createFunctionImplementation } from \"@a2ui/web_core/v0_9\";\nimport { Text } from \"./components/Text\";\nimport { Button } from \"./components/Button\";\nimport { Row } from \"./components/Row\";\nimport { Column } from \"./components/Column\";\nimport { TextField } from \"./components/TextField\";\nimport type { ReactComponentImplementation } from \"../../adapter\";\nimport { z } from \"zod\";\n\nconst minimalComponents: ReactComponentImplementation[] = [\n Text,\n Button,\n Row,\n Column,\n TextField,\n];\n\nexport const minimalCatalog = new Catalog<ReactComponentImplementation>(\n \"https://a2ui.org/specification/v0_9/catalogs/minimal/minimal_catalog.json\",\n minimalComponents,\n [\n createFunctionImplementation(\n {\n name: \"capitalize\",\n returnType: \"string\",\n schema: z.object({\n value: z.unknown(),\n }),\n },\n (args) => {\n const val = args.value;\n if (typeof val === \"string\") {\n return val.toUpperCase();\n }\n return val as string;\n },\n ),\n ],\n);\n\nexport { Text, Button, Row, Column, TextField };\n","import { createContext, useContext, type ReactNode } from \"react\";\n\ntype ThemeType = Record<string, unknown>;\n\n/** React context for the A2UI theme. */\nconst ThemeContext = createContext<ThemeType | undefined>(undefined);\n\nexport interface ThemeProviderProps {\n theme?: ThemeType;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme, children }: ThemeProviderProps) {\n return (\n <ThemeContext.Provider value={theme ?? {}}>\n {children}\n </ThemeContext.Provider>\n );\n}\n\nexport function useTheme(): ThemeType {\n const theme = useContext(ThemeContext);\n if (!theme) {\n throw new Error(\n \"useTheme must be used within a ThemeProvider or A2UIProvider\",\n );\n }\n return theme;\n}\n\nexport function useThemeOptional(): ThemeType | undefined {\n return useContext(ThemeContext);\n}\n","import {\n createContext,\n useContext,\n useRef,\n useState,\n useMemo,\n type ReactNode,\n} from \"react\";\nimport { MessageProcessor } from \"@a2ui/web_core/v0_9\";\nimport { basicCatalog } from \"../a2ui-react\";\nimport type { A2UIContextValue, A2UIActions } from \"./store\";\nimport { ThemeProvider } from \"../theme/ThemeContext\";\nimport type { OnActionCallback } from \"../types\";\nimport type { A2UIClientEventMessage, Theme } from \"../../a2ui-types\";\n\n/**\n * Context for stable actions (never changes reference, prevents re-renders).\n */\nconst A2UIActionsContext = createContext<A2UIActions | null>(null);\n\n/**\n * Context for reactive state (changes trigger re-renders).\n */\nconst A2UIStateContext = createContext<{\n version: number;\n error: string | null;\n} | null>(null);\n\n/**\n * Props for the A2UIProvider component.\n */\nexport interface A2UIProviderProps {\n /** Callback invoked when a user action is dispatched (button click, etc.) */\n onAction?: OnActionCallback;\n /** Theme configuration */\n theme?: Theme;\n /** Optional component catalog to use instead of the default basicCatalog */\n catalog?: any;\n /** Child components */\n children: ReactNode;\n}\n\n/**\n * Provider component that sets up the A2UI v0.9 context for descendant components.\n * Uses a two-context architecture for performance:\n * - A2UIActionsContext: Stable actions that never change (no re-renders)\n * - A2UIStateContext: Reactive state that triggers re-renders when needed\n */\nexport function A2UIProvider({\n onAction,\n theme,\n catalog,\n children,\n}: A2UIProviderProps) {\n // Store onAction in a ref so callbacks always have the latest value\n const onActionRef = useRef<OnActionCallback | null>(onAction ?? null);\n onActionRef.current = onAction ?? null;\n\n // Create v0.9 MessageProcessor only once using ref\n const processorRef = useRef<MessageProcessor<any> | null>(null);\n if (!processorRef.current) {\n processorRef.current = new MessageProcessor(\n [catalog ?? basicCatalog],\n // Action handler: convert v0.9 Action to A2UIClientEventMessage format\n (action: any) => {\n if (onActionRef.current) {\n const message: A2UIClientEventMessage = {\n userAction: {\n name: action?.name ?? \"unknown\",\n surfaceId: action?.surfaceId ?? \"default\",\n sourceComponentId: action?.sourceComponentId,\n context: action?.context,\n timestamp: action?.timestamp ?? new Date().toISOString(),\n },\n };\n onActionRef.current(message);\n }\n },\n );\n }\n const processor = processorRef.current;\n\n // Version counter for triggering re-renders\n const [version, setVersion] = useState(0);\n\n // Error state for graceful error handling\n const [error, setError] = useState<string | null>(null);\n\n // Create stable actions object once - stored in ref, never changes\n const actionsRef = useRef<A2UIActions | null>(null);\n if (!actionsRef.current) {\n actionsRef.current = {\n processMessages: (messages: Array<Record<string, unknown>>) => {\n try {\n processor.processMessages(messages as any[]);\n } catch (err) {\n console.warn(\"[A2UI] processMessages error:\", err);\n setError(err instanceof Error ? err.message : String(err));\n return;\n }\n setError(null);\n setVersion((v) => v + 1);\n },\n\n dispatch: (message: any) => {\n if (onActionRef.current) {\n onActionRef.current(message);\n }\n },\n\n getSurface: (surfaceId: string) => {\n return processor.model.getSurface(surfaceId);\n },\n\n clearSurfaces: () => {\n // Process a deleteSurface for all known surfaces\n const surfaces = processor.model.surfacesMap;\n for (const [id] of surfaces) {\n processor.processMessages([\n { version: \"v0.9\", deleteSurface: { surfaceId: id } } as any,\n ]);\n }\n setVersion((v) => v + 1);\n },\n };\n }\n const actions = actionsRef.current;\n\n // State context value - changes when version or error changes\n const stateValue = useMemo(() => ({ version, error }), [version, error]);\n\n return (\n <A2UIActionsContext.Provider value={actions}>\n <A2UIStateContext.Provider value={stateValue}>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </A2UIStateContext.Provider>\n </A2UIActionsContext.Provider>\n );\n}\n\n/**\n * Hook to access stable A2UI actions (won't cause re-renders).\n */\nexport function useA2UIActions(): A2UIActions {\n const actions = useContext(A2UIActionsContext);\n if (!actions) {\n throw new Error(\"useA2UIActions must be used within an A2UIProvider\");\n }\n return actions;\n}\n\n/**\n * Hook to subscribe to A2UI state changes.\n */\nexport function useA2UIState(): { version: number } {\n const state = useContext(A2UIStateContext);\n if (!state) {\n throw new Error(\"useA2UIState must be used within an A2UIProvider\");\n }\n return state;\n}\n\n/**\n * Hook to access the full A2UI context (actions + state).\n */\nexport function useA2UIContext(): A2UIContextValue {\n const actions = useA2UIActions();\n const state = useA2UIState();\n\n return useMemo(\n () => ({\n ...actions,\n version: state.version,\n onAction: null,\n }),\n [actions, state.version],\n );\n}\n\n/** @deprecated Use useA2UIContext instead. */\nexport const useA2UIStore = useA2UIContext;\n\n/**\n * Hook to access the current A2UI error state.\n */\nexport function useA2UIError(): string | null {\n const state = useContext(A2UIStateContext);\n return state?.error ?? null;\n}\n\n/** @deprecated Use useA2UIContext() or useA2UI() directly instead. */\nexport function useA2UIStoreSelector<T>(\n selector: (state: A2UIContextValue) => T,\n): T {\n const context = useA2UIContext();\n return selector(context);\n}\n","import { useA2UIActions, useA2UIState } from \"../core/A2UIProvider\";\n\n/**\n * Result returned by the useA2UI hook.\n */\nexport interface UseA2UIResult {\n /** Process incoming v0.9 A2UI messages */\n processMessages: (messages: Array<Record<string, unknown>>) => void;\n\n /** Get a surface model by ID */\n getSurface: (surfaceId: string) => any | undefined;\n\n /** Clear all surfaces */\n clearSurfaces: () => void;\n\n /** The current version number (increments on state changes) */\n version: number;\n}\n\n/**\n * Main API hook for A2UI v0.9. Provides methods to process messages\n * and access surface state.\n */\nexport function useA2UI(): UseA2UIResult {\n const actions = useA2UIActions();\n const state = useA2UIState();\n\n return {\n processMessages: actions.processMessages,\n getSurface: actions.getSurface,\n clearSurfaces: actions.clearSurfaces,\n version: state.version,\n };\n}\n","import { clsx, type ClassValue } from \"clsx\";\n\n/**\n * Utility function to merge class names.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return clsx(inputs);\n}\n","import { Suspense, memo, type ReactNode } from \"react\";\nimport { useA2UI } from \"../hooks/useA2UI\";\nimport { A2uiSurface } from \"../a2ui-react\";\nimport { cn } from \"../lib/utils\";\n\n/** Default loading fallback - memoized to prevent recreation */\nconst DefaultLoadingFallback = memo(function DefaultLoadingFallback() {\n return (\n <div className=\"a2ui-loading\" style={{ padding: \"16px\", opacity: 0.5 }}>\n Loading...\n </div>\n );\n});\n\nexport interface A2UIRendererProps {\n /** The surface ID to render */\n surfaceId: string;\n /** Additional CSS classes for the surface container */\n className?: string;\n /** Fallback content when surface is not yet available */\n fallback?: ReactNode;\n /** Loading fallback for lazy-loaded components */\n loadingFallback?: ReactNode;\n /** @deprecated - No longer needed in v0.9, components come from catalog */\n registry?: any;\n}\n\n/**\n * A2UIRenderer - renders an A2UI surface using the v0.9 renderer.\n *\n * Uses A2uiSurface from a2ui-react which handles all component\n * rendering internally via the catalog system.\n */\nexport const A2UIRenderer = memo(function A2UIRenderer({\n surfaceId,\n className,\n fallback = null,\n loadingFallback,\n}: A2UIRendererProps) {\n const { getSurface, version } = useA2UI();\n\n // Get v0.9 SurfaceModel - this will re-render when version changes\n const surface = getSurface(surfaceId);\n\n // No surface yet\n if (!surface) {\n return <>{fallback}</>;\n }\n\n // Use provided fallback or default memoized component\n const actualLoadingFallback = loadingFallback ?? <DefaultLoadingFallback />;\n\n return (\n <div\n className={cn(\"a2ui-surface\", className)}\n data-surface-id={surfaceId}\n data-version={version}\n >\n <Suspense fallback={actualLoadingFallback}>\n <A2uiSurface surface={surface} />\n </Suspense>\n </div>\n );\n});\n\nexport default A2UIRenderer;\n","import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * A2UI v0.9 inline catalog format — matches the structure defined by the\n * A2UI specification (basic_catalog.json). Each component is keyed by\n * name and uses `allOf` to compose ComponentCommon with component-specific\n * properties so the schema mirrors the flat wire format the LLM must produce.\n */\nexport interface InlineCatalogSchema {\n catalogId: string;\n components: Record<string, Record<string, unknown>>;\n}\n\n/**\n * Extract component schemas from a catalog in the A2UI v0.9 inline catalog\n * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so\n * the schema the LLM sees matches the spec and the flat wire format:\n *\n * { \"Column\": { \"allOf\": [\n * { \"$ref\": \"common_types.json#/$defs/ComponentCommon\" },\n * { \"properties\": { \"component\": {\"const\":\"Column\"}, \"gap\": ..., \"children\": ... },\n * \"required\": [\"component\"] }\n * ]}}\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): InlineCatalogSchema {\n const resolved = catalog ?? basicCatalog;\n const components: Record<string, Record<string, unknown>> = {};\n\n for (const [name, comp] of resolved.components) {\n const zodSchema = zodToJsonSchema(comp.schema, {\n target: \"jsonSchema2019-09\",\n }) as { properties?: Record<string, unknown>; required?: string[] };\n\n components[name] = {\n allOf: [\n { $ref: \"common_types.json#/$defs/ComponentCommon\" },\n {\n properties: {\n component: { const: name },\n ...(zodSchema.properties ?? {}),\n },\n required: [\"component\", ...(zodSchema.required ?? [])],\n },\n ],\n };\n }\n\n return { catalogId: resolved.id, components };\n}\n","import { z, type ZodObject, type ZodRawShape } from \"zod\";\nimport { Catalog } from \"@a2ui/web_core/v0_9\";\nimport { BASIC_FUNCTIONS } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { basicCatalog, createReactComponent } from \"./a2ui-react\";\nimport type { ReactComponentImplementation } from \"./a2ui-react\";\nimport type { ComponentApi } from \"@a2ui/web_core/v0_9\";\n\n// ─── Catalog Definitions (platform-agnostic) ─────────────────────────\n\n/**\n * A single component definition — Zod props schema + optional description.\n * Platform-agnostic: no React or rendering details.\n */\nexport interface CatalogComponentDefinition<\n T extends ZodRawShape = ZodRawShape,\n> {\n /** Zod schema for component props */\n props: ZodObject<T>;\n /** Description for the AI agent */\n description?: string;\n}\n\n/**\n * A record mapping component names to their definitions.\n * This is the platform-agnostic \"contract\" that agents use.\n */\nexport type CatalogDefinitions = Record<\n string,\n CatalogComponentDefinition<any>\n>;\n\n/**\n * Infer the props type for a specific component in the definitions.\n */\nexport type PropsOf<D extends CatalogDefinitions, K extends keyof D> = z.infer<\n D[K][\"props\"]\n>;\n\n// ─── Catalog Renderers (platform-specific) ───────────────────────────\n\n/**\n * Props passed to a renderer function.\n */\nexport interface RendererProps<T = Record<string, unknown>> {\n /** Resolved prop values from the A2UI data model */\n props: T;\n /** Render a child component by ID */\n children: (id: string) => React.ReactNode;\n /** Dispatch an A2UI action from this component (e.g., on button click) */\n dispatch?: (action: any) => void;\n}\n\n/**\n * A renderer function for a component.\n */\nexport type ComponentRenderer<T = Record<string, unknown>> = React.FC<\n RendererProps<T>\n>;\n\n/**\n * A record mapping component names to React renderer functions.\n * Type-checked against the catalog definitions.\n */\nexport type CatalogRenderers<D extends CatalogDefinitions> = {\n [K in keyof D]: ComponentRenderer<z.infer<D[K][\"props\"]>>;\n};\n\n// ─── Create Catalog ──────────────────────────────────────────────────\n\n/**\n * Create an A2UI catalog from definitions and renderers.\n *\n * Definitions are platform-agnostic (Zod schemas + descriptions).\n * Renderers are platform-specific (React components).\n * TypeScript enforces that renderers match definitions exactly.\n *\n * @example\n * ```tsx\n * // schema.ts (platform-agnostic)\n * export const demoCatalogDefinitions = {\n * Card: {\n * description: \"A card container\",\n * props: z.object({ title: z.string(), child: z.string().optional() }),\n * },\n * } satisfies CatalogDefinitions;\n *\n * // catalog.tsx (React renderers)\n * export const demoCatalog = createCatalog(demoCatalogDefinitions, {\n * Card: ({ props, children }) => (\n * <div>{props.title}{props.child && children(props.child)}</div>\n * ),\n * });\n * ```\n */\nexport function createCatalog<D extends CatalogDefinitions>(\n definitions: D,\n renderers: CatalogRenderers<D>,\n options?: {\n /** Catalog ID. Defaults to a generated URI. */\n catalogId?: string;\n /** If true, merge the built-in basic catalog components (Text, Button, Row, etc.) into this catalog. Default: false */\n includeBasicCatalog?: boolean;\n },\n): Catalog<ReactComponentImplementation> {\n const catalogId = options?.catalogId ?? \"copilotkit://custom-catalog\";\n const includeBasic = options?.includeBasicCatalog === true;\n\n const customComponents: ReactComponentImplementation[] = [];\n\n for (const [name, def] of Object.entries(definitions)) {\n const api: ComponentApi = {\n name,\n schema: def.props,\n };\n\n const renderer = (renderers as Record<string, ComponentRenderer<any>>)[\n name\n ];\n const wrapped = createReactComponent(\n api,\n ({ props, buildChild, context }) => {\n const Render = renderer;\n const dispatch = (action: any) => context.dispatchAction(action);\n return (\n <Render props={props} children={buildChild} dispatch={dispatch} />\n );\n },\n );\n\n customComponents.push(wrapped);\n }\n\n const allComponents = includeBasic\n ? [...Array.from(basicCatalog.components.values()), ...customComponents]\n : customComponents;\n\n const functions = includeBasic\n ? Array.from(basicCatalog.functions.values())\n : [];\n\n return new Catalog<ReactComponentImplementation>(\n catalogId,\n allComponents,\n functions,\n );\n}\n\n// ─── Extract Schema (for runtime) ────────────────────────────────────\n\n/**\n * Extract a JSON-serializable schema from catalog definitions.\n * Suitable for passing to the runtime's `a2ui.schema` config.\n */\nexport function extractSchema(definitions: CatalogDefinitions): Array<{\n name: string;\n description?: string;\n props?: Record<string, unknown>;\n}> {\n return Object.entries(definitions).map(([name, def]) => ({\n name,\n description: def.description,\n props: zodSchemaToSimpleObject(def.props),\n }));\n}\n\nfunction zodSchemaToSimpleObject(\n schema: ZodObject<any>,\n): Record<string, unknown> {\n const shape = schema.shape;\n const properties: Record<string, { type: string; description?: string }> = {};\n for (const [key, value] of Object.entries(shape)) {\n const zodValue = value as any;\n properties[key] = {\n type: zodValue._def?.typeName ?? \"unknown\",\n ...(zodValue.description ? { description: zodValue.description } : {}),\n };\n }\n return { type: \"object\", properties };\n}\n\n// ─── Backward Compatibility ──────────────────────────────────────────\n\n// Old API — definitions + renderers combined in one object\nexport interface A2UIComponentDefinition<T extends ZodRawShape = ZodRawShape> {\n props: ZodObject<T>;\n description?: string;\n render: React.FC<RendererProps<z.infer<ZodObject<T>>>>;\n}\n\nexport type A2UIComponentMap = Record<string, A2UIComponentDefinition<any>>;\n\n/**\n * @deprecated Use `createCatalog(definitions, renderers)` instead.\n */\nexport function createA2UICatalog(\n components: A2UIComponentMap,\n options?: {\n catalogId?: string;\n includeBasicCatalog?: boolean;\n },\n): Catalog<ReactComponentImplementation> {\n const definitions: CatalogDefinitions = {};\n const renderers: Record<string, ComponentRenderer<any>> = {};\n\n for (const [name, def] of Object.entries(components)) {\n definitions[name] = { props: def.props, description: def.description };\n renderers[name] = def.render;\n }\n\n return createCatalog(definitions, renderers as any, options);\n}\n\n/**\n * @deprecated Use `extractSchema(definitions)` instead.\n */\nexport function extractA2UISchema(components: A2UIComponentMap): Array<{\n name: string;\n description?: string;\n props?: Record<string, unknown>;\n}> {\n const definitions: CatalogDefinitions = {};\n for (const [name, def] of Object.entries(components)) {\n definitions[name] = { props: def.props, description: def.description };\n }\n return extractSchema(definitions);\n}\n","/**\n * v0.9: Styles are now handled by a2ui-react components internally.\n * These functions are kept as no-ops for backward compatibility.\n */\n\nexport function injectStyles(): void {\n // v0.9: styles are inline in a2ui-react components (no external injection needed)\n}\n\nexport function removeStyles(): void {\n // v0.9: no-op\n}\n","// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\nexport type { InlineCatalogSchema } from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n","/**\n * v0.9 A2UI type definitions for CopilotKit integration.\n */\n\n/** Theme type - v0.9 themes are passed via createSurface message */\nexport type Theme = Record<string, unknown>;\n\n/**\n * Client event message dispatched when a user interacts with an A2UI surface.\n * This is the format expected by A2UIMessageRenderer's handleAction.\n */\nexport interface A2UIClientEventMessage {\n userAction?: {\n name: string;\n surfaceId: string;\n sourceComponentId?: string;\n context?: Record<string, unknown>;\n timestamp?: string;\n dataContextPath?: string;\n };\n}\n\n/** Default surface ID when none is specified */\nexport const DEFAULT_SURFACE_ID = \"default\";\n","/*\n Copyright 2025 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\nexport * from \"./react-renderer/index.js\";\nexport { DEFAULT_SURFACE_ID } from \"./a2ui-types.js\";\nexport type { Theme, A2UIClientEventMessage } from \"./a2ui-types.js\";\n\n// Backward compat: viewerTheme (v0.9 themes handled internally)\nexport const viewerTheme: Record<string, unknown> = {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;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C,EAAE;AAC1C,OAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,WAAW,CAClD,aAAY,QAAQ;GAAE,OAAO,IAAI;GAAO,aAAa,IAAI;GAAa;AAExE,SAAO,cAAc,YAAY;;;;;;;;;CC3NnC,SAAgB,eAAqB;CAIrC,SAAgB,eAAqB;;;;CCgFrC,SAAgB,yBAAyB;CAGzC,SAAgB,2BAA2B;CAK3C,MAAa,eAAwC,EAAE;CACvD,MAAa,WAAW;;;;;CC3ExB,MAAa,qBAAqB;;;;CCFlC,MAAa,cAAuC,EAAE"}
@@ -10,7 +10,7 @@ const BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/basic_catalog.json
10
10
  * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite
11
11
  * a frontend-provided schema with a server-side one.
12
12
  */
13
- const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.";
13
+ const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
14
14
  /**
15
15
  * Check whether a catalog is a superset of the basic catalog
16
16
  * (i.e., it contains all basic components by name).
@@ -58,21 +58,36 @@ function buildCatalogContextValue(catalog) {
58
58
  return lines.join("\n");
59
59
  }
60
60
  /**
61
- * Extract component schemas from a catalog in the same format used by
62
- * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod
63
- * schema is converted to JSON Schema via zod-to-json-schema.
61
+ * Extract component schemas from a catalog in the A2UI v0.9 inline catalog
62
+ * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so
63
+ * the schema the LLM sees matches the spec and the flat wire format:
64
+ *
65
+ * { "Column": { "allOf": [
66
+ * { "$ref": "common_types.json#/$defs/ComponentCommon" },
67
+ * { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
68
+ * "required": ["component"] }
69
+ * ]}}
64
70
  *
65
71
  * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,
66
72
  * the middleware can optionally overwrite it with a server-side schema.
67
73
  */
68
74
  function extractCatalogComponentSchemas(catalog) {
69
75
  const resolved = catalog ?? require_index.basicCatalog;
70
- const schemas = [];
71
- for (const [name, comp] of resolved.components) schemas.push({
72
- name,
73
- props: (0, zod_to_json_schema.zodToJsonSchema)(comp.schema, { target: "openApi3" })
74
- });
75
- return schemas;
76
+ const components = {};
77
+ for (const [name, comp] of resolved.components) {
78
+ const zodSchema = (0, zod_to_json_schema.zodToJsonSchema)(comp.schema, { target: "jsonSchema2019-09" });
79
+ components[name] = { allOf: [{ $ref: "common_types.json#/$defs/ComponentCommon" }, {
80
+ properties: {
81
+ component: { const: name },
82
+ ...zodSchema.properties ?? {}
83
+ },
84
+ required: ["component", ...zodSchema.required ?? []]
85
+ }] };
86
+ }
87
+ return {
88
+ catalogId: resolved.id,
89
+ components
90
+ };
76
91
  }
77
92
 
78
93
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-utils.cjs","names":["basicCatalog"],"sources":["../../src/react-renderer/catalog-utils.ts"],"sourcesContent":["import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Extract component schemas from a catalog in the same format used by\n * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod\n * schema is converted to JSON Schema via zod-to-json-schema.\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): Array<{ name: string; props: Record<string, unknown> }> {\n const resolved = catalog ?? basicCatalog;\n const schemas: Array<{ name: string; props: Record<string, unknown> }> = [];\n\n for (const [name, comp] of resolved.components) {\n schemas.push({\n name,\n props: zodToJsonSchema(comp.schema, { target: \"openApi3\" }) as Record<\n string,\n unknown\n >,\n });\n }\n\n return schemas;\n}\n"],"mappings":";;;;;;AAIA,MAAM,mBACJ;;;;;;AAOF,MAAa,kCACX;;;;;AAMF,SAAgB,oBAAoB,SAAyC;AAC3E,MAAK,MAAM,QAAQA,2BAAa,WAAW,MAAM,CAC/C,KAAI,CAAC,QAAQ,WAAW,IAAI,KAAK,CAC/B,QAAO;AAGX,QAAO;;;;;AAMT,SAAgB,wBACd,SACU;CACV,MAAM,SAAmB,EAAE;AAC3B,MAAK,MAAM,QAAQ,QAAQ,WAAW,MAAM,CAC1C,KAAI,CAACA,2BAAa,WAAW,IAAI,KAAK,CACpC,QAAO,KAAK,KAAK;AAGrB,QAAO;;;;;;;AAQT,SAAgB,yBACd,SACQ;CACR,MAAM,WAAW,WAAWA;CAC5B,MAAM,QAAkB,EAAE;AAC1B,OAAM,KAAK,0BAA0B;AAErC,KAAI,SAAS,OAAO,kBAAkB;AACpC,QAAM,KAAK,KAAK,SAAS,GAAG,kBAAkB;AAC9C,SAAO,MAAM,KAAK,KAAK;;CAGzB,MAAM,aAAa,oBAAoB,SAAS;CAChD,MAAM,cAAc,wBAAwB,SAAS;AAErD,OAAM,KAAK,KAAK,SAAS,KAAK;AAC9B,KAAI,WACF,OAAM,KACJ,iEACD;MACI;AACL,QAAM,KAAK,4DAA4D;AACvE,QAAM,KAAK,uBAAuB;;AAGpC,MAAK,MAAM,QAAQ,aAAa;EAC9B,MAAM,OAAO,SAAS,WAAW,IAAI,KAAK;AAC1C,MAAI,CAAC,KAAM;EACX,MAAM,qDAA6B,KAAK,OAAO;AAC/C,QAAM,KAAK,OAAO,KAAK,GAAG;AAC1B,QAAM,KACJ,OAAO,KAAK,UAAU,YAAY,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,KAAK,SAAS,GACtE;;AAGH,QAAO,MAAM,KAAK,KAAK;;;;;;;;;;AAWzB,SAAgB,+BACd,SACyD;CACzD,MAAM,WAAW,WAAWA;CAC5B,MAAM,UAAmE,EAAE;AAE3E,MAAK,MAAM,CAAC,MAAM,SAAS,SAAS,WAClC,SAAQ,KAAK;EACX;EACA,+CAAuB,KAAK,QAAQ,EAAE,QAAQ,YAAY,CAAC;EAI5D,CAAC;AAGJ,QAAO"}
1
+ {"version":3,"file":"catalog-utils.cjs","names":["basicCatalog"],"sources":["../../src/react-renderer/catalog-utils.ts"],"sourcesContent":["import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * A2UI v0.9 inline catalog format — matches the structure defined by the\n * A2UI specification (basic_catalog.json). Each component is keyed by\n * name and uses `allOf` to compose ComponentCommon with component-specific\n * properties so the schema mirrors the flat wire format the LLM must produce.\n */\nexport interface InlineCatalogSchema {\n catalogId: string;\n components: Record<string, Record<string, unknown>>;\n}\n\n/**\n * Extract component schemas from a catalog in the A2UI v0.9 inline catalog\n * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so\n * the schema the LLM sees matches the spec and the flat wire format:\n *\n * { \"Column\": { \"allOf\": [\n * { \"$ref\": \"common_types.json#/$defs/ComponentCommon\" },\n * { \"properties\": { \"component\": {\"const\":\"Column\"}, \"gap\": ..., \"children\": ... },\n * \"required\": [\"component\"] }\n * ]}}\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): InlineCatalogSchema {\n const resolved = catalog ?? basicCatalog;\n const components: Record<string, Record<string, unknown>> = {};\n\n for (const [name, comp] of resolved.components) {\n const zodSchema = zodToJsonSchema(comp.schema, {\n target: \"jsonSchema2019-09\",\n }) as { properties?: Record<string, unknown>; required?: string[] };\n\n components[name] = {\n allOf: [\n { $ref: \"common_types.json#/$defs/ComponentCommon\" },\n {\n properties: {\n component: { const: name },\n ...(zodSchema.properties ?? {}),\n },\n required: [\"component\", ...(zodSchema.required ?? [])],\n },\n ],\n };\n }\n\n return { catalogId: resolved.id, components };\n}\n"],"mappings":";;;;;;AAIA,MAAM,mBACJ;;;;;;AAOF,MAAa,kCACX;;;;;AAMF,SAAgB,oBAAoB,SAAyC;AAC3E,MAAK,MAAM,QAAQA,2BAAa,WAAW,MAAM,CAC/C,KAAI,CAAC,QAAQ,WAAW,IAAI,KAAK,CAC/B,QAAO;AAGX,QAAO;;;;;AAMT,SAAgB,wBACd,SACU;CACV,MAAM,SAAmB,EAAE;AAC3B,MAAK,MAAM,QAAQ,QAAQ,WAAW,MAAM,CAC1C,KAAI,CAACA,2BAAa,WAAW,IAAI,KAAK,CACpC,QAAO,KAAK,KAAK;AAGrB,QAAO;;;;;;;AAQT,SAAgB,yBACd,SACQ;CACR,MAAM,WAAW,WAAWA;CAC5B,MAAM,QAAkB,EAAE;AAC1B,OAAM,KAAK,0BAA0B;AAErC,KAAI,SAAS,OAAO,kBAAkB;AACpC,QAAM,KAAK,KAAK,SAAS,GAAG,kBAAkB;AAC9C,SAAO,MAAM,KAAK,KAAK;;CAGzB,MAAM,aAAa,oBAAoB,SAAS;CAChD,MAAM,cAAc,wBAAwB,SAAS;AAErD,OAAM,KAAK,KAAK,SAAS,KAAK;AAC9B,KAAI,WACF,OAAM,KACJ,iEACD;MACI;AACL,QAAM,KAAK,4DAA4D;AACvE,QAAM,KAAK,uBAAuB;;AAGpC,MAAK,MAAM,QAAQ,aAAa;EAC9B,MAAM,OAAO,SAAS,WAAW,IAAI,KAAK;AAC1C,MAAI,CAAC,KAAM;EACX,MAAM,qDAA6B,KAAK,OAAO;AAC/C,QAAM,KAAK,OAAO,KAAK,GAAG;AAC1B,QAAM,KACJ,OAAO,KAAK,UAAU,YAAY,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,KAAK,SAAS,GACtE;;AAGH,QAAO,MAAM,KAAK,KAAK;;;;;;;;;;;;;;;;AA4BzB,SAAgB,+BACd,SACqB;CACrB,MAAM,WAAW,WAAWA;CAC5B,MAAM,aAAsD,EAAE;AAE9D,MAAK,MAAM,CAAC,MAAM,SAAS,SAAS,YAAY;EAC9C,MAAM,oDAA4B,KAAK,QAAQ,EAC7C,QAAQ,qBACT,CAAC;AAEF,aAAW,QAAQ,EACjB,OAAO,CACL,EAAE,MAAM,4CAA4C,EACpD;GACE,YAAY;IACV,WAAW,EAAE,OAAO,MAAM;IAC1B,GAAI,UAAU,cAAc,EAAE;IAC/B;GACD,UAAU,CAAC,aAAa,GAAI,UAAU,YAAY,EAAE,CAAE;GACvD,CACF,EACF;;AAGH,QAAO;EAAE,WAAW,SAAS;EAAI;EAAY"}
@@ -6,7 +6,7 @@ import { Catalog, ComponentApi } from "@a2ui/web_core/v0_9";
6
6
  * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite
7
7
  * a frontend-provided schema with a server-side one.
8
8
  */
9
- declare const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema \u2014 available components for generating UI surfaces. Use these component names and props when creating A2UI operations.";
9
+ declare const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema \u2014 available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
10
10
  /**
11
11
  * Check whether a catalog is a superset of the basic catalog
12
12
  * (i.e., it contains all basic components by name).
@@ -23,17 +23,30 @@ declare function getCustomComponentNames(catalog: Catalog<ComponentApi>): string
23
23
  */
24
24
  declare function buildCatalogContextValue(catalog?: Catalog<ComponentApi>): string;
25
25
  /**
26
- * Extract component schemas from a catalog in the same format used by
27
- * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod
28
- * schema is converted to JSON Schema via zod-to-json-schema.
26
+ * A2UI v0.9 inline catalog format matches the structure defined by the
27
+ * A2UI specification (basic_catalog.json). Each component is keyed by
28
+ * name and uses `allOf` to compose ComponentCommon with component-specific
29
+ * properties so the schema mirrors the flat wire format the LLM must produce.
30
+ */
31
+ interface InlineCatalogSchema {
32
+ catalogId: string;
33
+ components: Record<string, Record<string, unknown>>;
34
+ }
35
+ /**
36
+ * Extract component schemas from a catalog in the A2UI v0.9 inline catalog
37
+ * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so
38
+ * the schema the LLM sees matches the spec and the flat wire format:
39
+ *
40
+ * { "Column": { "allOf": [
41
+ * { "$ref": "common_types.json#/$defs/ComponentCommon" },
42
+ * { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
43
+ * "required": ["component"] }
44
+ * ]}}
29
45
  *
30
46
  * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,
31
47
  * the middleware can optionally overwrite it with a server-side schema.
32
48
  */
33
- declare function extractCatalogComponentSchemas(catalog?: Catalog<ComponentApi>): Array<{
34
- name: string;
35
- props: Record<string, unknown>;
36
- }>;
49
+ declare function extractCatalogComponentSchemas(catalog?: Catalog<ComponentApi>): InlineCatalogSchema;
37
50
  //#endregion
38
- export { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames };
51
+ export { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames };
39
52
  //# sourceMappingURL=catalog-utils.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-utils.d.cts","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"mappings":";;;;;AAYA;;;cAAa,+BAAA;;AAOb;;;iBAAgB,mBAAA,CAAoB,OAAA,EAAS,OAAA,CAAQ,YAAA;;;;iBAYrC,uBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,YAAA;;AADnB;;;;iBAiBgB,wBAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA;;;;;AADpB;;;;iBA8CgB,8BAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA,IACjB,KAAA;EAAQ,IAAA;EAAc,KAAA,EAAO,MAAA;AAAA"}
1
+ {"version":3,"file":"catalog-utils.d.cts","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"mappings":";;;;;AAYA;;;cAAa,+BAAA;;AAOb;;;iBAAgB,mBAAA,CAAoB,OAAA,EAAS,OAAA,CAAQ,YAAA;;;;iBAYrC,uBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,YAAA;;AADnB;;;;iBAiBgB,wBAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA;;;;;AADpB;;UA4CiB,mBAAA;EACf,SAAA;EACA,UAAA,EAAY,MAAA,SAAe,MAAA;AAAA;;;;AAF7B;;;;;;;;;;AAmBA;iBAAgB,8BAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA,IACjB,mBAAA"}
@@ -6,7 +6,7 @@ import { Catalog, ComponentApi } from "@a2ui/web_core/v0_9";
6
6
  * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite
7
7
  * a frontend-provided schema with a server-side one.
8
8
  */
9
- declare const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema \u2014 available components for generating UI surfaces. Use these component names and props when creating A2UI operations.";
9
+ declare const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema \u2014 available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
10
10
  /**
11
11
  * Check whether a catalog is a superset of the basic catalog
12
12
  * (i.e., it contains all basic components by name).
@@ -23,17 +23,30 @@ declare function getCustomComponentNames(catalog: Catalog<ComponentApi>): string
23
23
  */
24
24
  declare function buildCatalogContextValue(catalog?: Catalog<ComponentApi>): string;
25
25
  /**
26
- * Extract component schemas from a catalog in the same format used by
27
- * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod
28
- * schema is converted to JSON Schema via zod-to-json-schema.
26
+ * A2UI v0.9 inline catalog format matches the structure defined by the
27
+ * A2UI specification (basic_catalog.json). Each component is keyed by
28
+ * name and uses `allOf` to compose ComponentCommon with component-specific
29
+ * properties so the schema mirrors the flat wire format the LLM must produce.
30
+ */
31
+ interface InlineCatalogSchema {
32
+ catalogId: string;
33
+ components: Record<string, Record<string, unknown>>;
34
+ }
35
+ /**
36
+ * Extract component schemas from a catalog in the A2UI v0.9 inline catalog
37
+ * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so
38
+ * the schema the LLM sees matches the spec and the flat wire format:
39
+ *
40
+ * { "Column": { "allOf": [
41
+ * { "$ref": "common_types.json#/$defs/ComponentCommon" },
42
+ * { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
43
+ * "required": ["component"] }
44
+ * ]}}
29
45
  *
30
46
  * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,
31
47
  * the middleware can optionally overwrite it with a server-side schema.
32
48
  */
33
- declare function extractCatalogComponentSchemas(catalog?: Catalog<ComponentApi>): Array<{
34
- name: string;
35
- props: Record<string, unknown>;
36
- }>;
49
+ declare function extractCatalogComponentSchemas(catalog?: Catalog<ComponentApi>): InlineCatalogSchema;
37
50
  //#endregion
38
- export { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames };
51
+ export { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames };
39
52
  //# sourceMappingURL=catalog-utils.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-utils.d.mts","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"mappings":";;;;;AAYA;;;cAAa,+BAAA;;AAOb;;;iBAAgB,mBAAA,CAAoB,OAAA,EAAS,OAAA,CAAQ,YAAA;;;;iBAYrC,uBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,YAAA;;AADnB;;;;iBAiBgB,wBAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA;;;;;AADpB;;;;iBA8CgB,8BAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA,IACjB,KAAA;EAAQ,IAAA;EAAc,KAAA,EAAO,MAAA;AAAA"}
1
+ {"version":3,"file":"catalog-utils.d.mts","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"mappings":";;;;;AAYA;;;cAAa,+BAAA;;AAOb;;;iBAAgB,mBAAA,CAAoB,OAAA,EAAS,OAAA,CAAQ,YAAA;;;;iBAYrC,uBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,YAAA;;AADnB;;;;iBAiBgB,wBAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA;;;;;AADpB;;UA4CiB,mBAAA;EACf,SAAA;EACA,UAAA,EAAY,MAAA,SAAe,MAAA;AAAA;;;;AAF7B;;;;;;;;;;AAmBA;iBAAgB,8BAAA,CACd,OAAA,GAAU,OAAA,CAAQ,YAAA,IACjB,mBAAA"}
@@ -9,7 +9,7 @@ const BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/basic_catalog.json
9
9
  * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite
10
10
  * a frontend-provided schema with a server-side one.
11
11
  */
12
- const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.";
12
+ const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
13
13
  /**
14
14
  * Check whether a catalog is a superset of the basic catalog
15
15
  * (i.e., it contains all basic components by name).
@@ -57,21 +57,36 @@ function buildCatalogContextValue(catalog) {
57
57
  return lines.join("\n");
58
58
  }
59
59
  /**
60
- * Extract component schemas from a catalog in the same format used by
61
- * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod
62
- * schema is converted to JSON Schema via zod-to-json-schema.
60
+ * Extract component schemas from a catalog in the A2UI v0.9 inline catalog
61
+ * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so
62
+ * the schema the LLM sees matches the spec and the flat wire format:
63
+ *
64
+ * { "Column": { "allOf": [
65
+ * { "$ref": "common_types.json#/$defs/ComponentCommon" },
66
+ * { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
67
+ * "required": ["component"] }
68
+ * ]}}
63
69
  *
64
70
  * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,
65
71
  * the middleware can optionally overwrite it with a server-side schema.
66
72
  */
67
73
  function extractCatalogComponentSchemas(catalog) {
68
74
  const resolved = catalog ?? basicCatalog;
69
- const schemas = [];
70
- for (const [name, comp] of resolved.components) schemas.push({
71
- name,
72
- props: zodToJsonSchema(comp.schema, { target: "openApi3" })
73
- });
74
- return schemas;
75
+ const components = {};
76
+ for (const [name, comp] of resolved.components) {
77
+ const zodSchema = zodToJsonSchema(comp.schema, { target: "jsonSchema2019-09" });
78
+ components[name] = { allOf: [{ $ref: "common_types.json#/$defs/ComponentCommon" }, {
79
+ properties: {
80
+ component: { const: name },
81
+ ...zodSchema.properties ?? {}
82
+ },
83
+ required: ["component", ...zodSchema.required ?? []]
84
+ }] };
85
+ }
86
+ return {
87
+ catalogId: resolved.id,
88
+ components
89
+ };
75
90
  }
76
91
 
77
92
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-utils.mjs","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"sourcesContent":["import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and props when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Extract component schemas from a catalog in the same format used by\n * the A2UI middleware (`A2UIComponentSchema[]`). Each component's Zod\n * schema is converted to JSON Schema via zod-to-json-schema.\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): Array<{ name: string; props: Record<string, unknown> }> {\n const resolved = catalog ?? basicCatalog;\n const schemas: Array<{ name: string; props: Record<string, unknown> }> = [];\n\n for (const [name, comp] of resolved.components) {\n schemas.push({\n name,\n props: zodToJsonSchema(comp.schema, { target: \"openApi3\" }) as Record<\n string,\n unknown\n >,\n });\n }\n\n return schemas;\n}\n"],"mappings":";;;;;AAIA,MAAM,mBACJ;;;;;;AAOF,MAAa,kCACX;;;;;AAMF,SAAgB,oBAAoB,SAAyC;AAC3E,MAAK,MAAM,QAAQ,aAAa,WAAW,MAAM,CAC/C,KAAI,CAAC,QAAQ,WAAW,IAAI,KAAK,CAC/B,QAAO;AAGX,QAAO;;;;;AAMT,SAAgB,wBACd,SACU;CACV,MAAM,SAAmB,EAAE;AAC3B,MAAK,MAAM,QAAQ,QAAQ,WAAW,MAAM,CAC1C,KAAI,CAAC,aAAa,WAAW,IAAI,KAAK,CACpC,QAAO,KAAK,KAAK;AAGrB,QAAO;;;;;;;AAQT,SAAgB,yBACd,SACQ;CACR,MAAM,WAAW,WAAW;CAC5B,MAAM,QAAkB,EAAE;AAC1B,OAAM,KAAK,0BAA0B;AAErC,KAAI,SAAS,OAAO,kBAAkB;AACpC,QAAM,KAAK,KAAK,SAAS,GAAG,kBAAkB;AAC9C,SAAO,MAAM,KAAK,KAAK;;CAGzB,MAAM,aAAa,oBAAoB,SAAS;CAChD,MAAM,cAAc,wBAAwB,SAAS;AAErD,OAAM,KAAK,KAAK,SAAS,KAAK;AAC9B,KAAI,WACF,OAAM,KACJ,iEACD;MACI;AACL,QAAM,KAAK,4DAA4D;AACvE,QAAM,KAAK,uBAAuB;;AAGpC,MAAK,MAAM,QAAQ,aAAa;EAC9B,MAAM,OAAO,SAAS,WAAW,IAAI,KAAK;AAC1C,MAAI,CAAC,KAAM;EACX,MAAM,aAAa,gBAAgB,KAAK,OAAO;AAC/C,QAAM,KAAK,OAAO,KAAK,GAAG;AAC1B,QAAM,KACJ,OAAO,KAAK,UAAU,YAAY,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,KAAK,SAAS,GACtE;;AAGH,QAAO,MAAM,KAAK,KAAK;;;;;;;;;;AAWzB,SAAgB,+BACd,SACyD;CACzD,MAAM,WAAW,WAAW;CAC5B,MAAM,UAAmE,EAAE;AAE3E,MAAK,MAAM,CAAC,MAAM,SAAS,SAAS,WAClC,SAAQ,KAAK;EACX;EACA,OAAO,gBAAgB,KAAK,QAAQ,EAAE,QAAQ,YAAY,CAAC;EAI5D,CAAC;AAGJ,QAAO"}
1
+ {"version":3,"file":"catalog-utils.mjs","names":[],"sources":["../../src/react-renderer/catalog-utils.ts"],"sourcesContent":["import { basicCatalog } from \"./a2ui-react\";\nimport type { ComponentApi, Catalog } from \"@a2ui/web_core/v0_9\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\n\nconst BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\n/**\n * Context description used to identify the A2UI component schema in RunAgentInput.context.\n * Must match the constant in @ag-ui/a2ui-middleware so the middleware can overwrite\n * a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.\";\n\n/**\n * Check whether a catalog is a superset of the basic catalog\n * (i.e., it contains all basic components by name).\n */\nexport function extendsBasicCatalog(catalog: Catalog<ComponentApi>): boolean {\n for (const name of basicCatalog.components.keys()) {\n if (!catalog.components.has(name)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Return the names of components in a catalog that are not in the basic catalog.\n */\nexport function getCustomComponentNames(\n catalog: Catalog<ComponentApi>,\n): string[] {\n const custom: string[] = [];\n for (const name of catalog.components.keys()) {\n if (!basicCatalog.components.has(name)) {\n custom.push(name);\n }\n }\n return custom;\n}\n\n/**\n * Build a context string describing the available A2UI catalog and custom components.\n * Custom components (those not in the basic catalog) are described using their\n * JSON Schema representation, matching the canonical A2UI catalog format.\n */\nexport function buildCatalogContextValue(\n catalog?: Catalog<ComponentApi>,\n): string {\n const resolved = catalog ?? basicCatalog;\n const lines: string[] = [];\n lines.push(\"Available A2UI catalog:\");\n\n if (resolved.id === BASIC_CATALOG_ID) {\n lines.push(`- ${resolved.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = extendsBasicCatalog(resolved);\n const customNames = getCustomComponentNames(resolved);\n\n lines.push(`- ${resolved.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n for (const name of customNames) {\n const comp = resolved.components.get(name);\n if (!comp) continue;\n const jsonSchema = zodToJsonSchema(comp.schema);\n lines.push(` - ${name}:`);\n lines.push(\n ` ${JSON.stringify(jsonSchema, null, 2).split(\"\\n\").join(\"\\n \")}`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * A2UI v0.9 inline catalog format — matches the structure defined by the\n * A2UI specification (basic_catalog.json). Each component is keyed by\n * name and uses `allOf` to compose ComponentCommon with component-specific\n * properties so the schema mirrors the flat wire format the LLM must produce.\n */\nexport interface InlineCatalogSchema {\n catalogId: string;\n components: Record<string, Record<string, unknown>>;\n}\n\n/**\n * Extract component schemas from a catalog in the A2UI v0.9 inline catalog\n * format. This mirrors `generateInlineCatalog` from `@a2ui/web_core` so\n * the schema the LLM sees matches the spec and the flat wire format:\n *\n * { \"Column\": { \"allOf\": [\n * { \"$ref\": \"common_types.json#/$defs/ComponentCommon\" },\n * { \"properties\": { \"component\": {\"const\":\"Column\"}, \"gap\": ..., \"children\": ... },\n * \"required\": [\"component\"] }\n * ]}}\n *\n * When sent via `useAgentContext` with `A2UI_SCHEMA_CONTEXT_DESCRIPTION`,\n * the middleware can optionally overwrite it with a server-side schema.\n */\nexport function extractCatalogComponentSchemas(\n catalog?: Catalog<ComponentApi>,\n): InlineCatalogSchema {\n const resolved = catalog ?? basicCatalog;\n const components: Record<string, Record<string, unknown>> = {};\n\n for (const [name, comp] of resolved.components) {\n const zodSchema = zodToJsonSchema(comp.schema, {\n target: \"jsonSchema2019-09\",\n }) as { properties?: Record<string, unknown>; required?: string[] };\n\n components[name] = {\n allOf: [\n { $ref: \"common_types.json#/$defs/ComponentCommon\" },\n {\n properties: {\n component: { const: name },\n ...(zodSchema.properties ?? {}),\n },\n required: [\"component\", ...(zodSchema.required ?? [])],\n },\n ],\n };\n }\n\n return { catalogId: resolved.id, components };\n}\n"],"mappings":";;;;;AAIA,MAAM,mBACJ;;;;;;AAOF,MAAa,kCACX;;;;;AAMF,SAAgB,oBAAoB,SAAyC;AAC3E,MAAK,MAAM,QAAQ,aAAa,WAAW,MAAM,CAC/C,KAAI,CAAC,QAAQ,WAAW,IAAI,KAAK,CAC/B,QAAO;AAGX,QAAO;;;;;AAMT,SAAgB,wBACd,SACU;CACV,MAAM,SAAmB,EAAE;AAC3B,MAAK,MAAM,QAAQ,QAAQ,WAAW,MAAM,CAC1C,KAAI,CAAC,aAAa,WAAW,IAAI,KAAK,CACpC,QAAO,KAAK,KAAK;AAGrB,QAAO;;;;;;;AAQT,SAAgB,yBACd,SACQ;CACR,MAAM,WAAW,WAAW;CAC5B,MAAM,QAAkB,EAAE;AAC1B,OAAM,KAAK,0BAA0B;AAErC,KAAI,SAAS,OAAO,kBAAkB;AACpC,QAAM,KAAK,KAAK,SAAS,GAAG,kBAAkB;AAC9C,SAAO,MAAM,KAAK,KAAK;;CAGzB,MAAM,aAAa,oBAAoB,SAAS;CAChD,MAAM,cAAc,wBAAwB,SAAS;AAErD,OAAM,KAAK,KAAK,SAAS,KAAK;AAC9B,KAAI,WACF,OAAM,KACJ,iEACD;MACI;AACL,QAAM,KAAK,4DAA4D;AACvE,QAAM,KAAK,uBAAuB;;AAGpC,MAAK,MAAM,QAAQ,aAAa;EAC9B,MAAM,OAAO,SAAS,WAAW,IAAI,KAAK;AAC1C,MAAI,CAAC,KAAM;EACX,MAAM,aAAa,gBAAgB,KAAK,OAAO;AAC/C,QAAM,KAAK,OAAO,KAAK,GAAG;AAC1B,QAAM,KACJ,OAAO,KAAK,UAAU,YAAY,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,KAAK,SAAS,GACtE;;AAGH,QAAO,MAAM,KAAK,KAAK;;;;;;;;;;;;;;;;AA4BzB,SAAgB,+BACd,SACqB;CACrB,MAAM,WAAW,WAAW;CAC5B,MAAM,aAAsD,EAAE;AAE9D,MAAK,MAAM,CAAC,MAAM,SAAS,SAAS,YAAY;EAC9C,MAAM,YAAY,gBAAgB,KAAK,QAAQ,EAC7C,QAAQ,qBACT,CAAC;AAEF,aAAW,QAAQ,EACjB,OAAO,CACL,EAAE,MAAM,4CAA4C,EACpD;GACE,YAAY;IACV,WAAW,EAAE,OAAO,MAAM;IAC1B,GAAI,UAAU,cAAc,EAAE;IAC/B;GACD,UAAU,CAAC,aAAa,GAAI,UAAU,YAAY,EAAE,CAAE;GACvD,CACF,EACF;;AAGH,QAAO;EAAE,WAAW,SAAS;EAAI;EAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/react-renderer/index.ts"],"sourcesContent":["// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n"],"mappings":";;;;;;;;;;;;;;AAwFA,SAAgB,yBAAyB;AAGzC,SAAgB,2BAA2B;AAK3C,MAAa,eAAwC,EAAE;AACvD,MAAa,WAAW"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/react-renderer/index.ts"],"sourcesContent":["// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\nexport type { InlineCatalogSchema } from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n"],"mappings":";;;;;;;;;;;;;;AAyFA,SAAgB,yBAAyB;AAGzC,SAAgB,2BAA2B;AAK3C,MAAa,eAAwC,EAAE;AACvD,MAAa,WAAW"}
@@ -5,7 +5,7 @@ import { A2UIRenderer, A2UIRendererProps } from "./core/A2UIRenderer.cjs";
5
5
  import { UseA2UIResult, useA2UI } from "./hooks/useA2UI.cjs";
6
6
  import { ThemeProvider, useTheme, useThemeOptional } from "./theme/ThemeContext.cjs";
7
7
  import { cn } from "./lib/utils.cjs";
8
- import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./catalog-utils.cjs";
8
+ import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./catalog-utils.cjs";
9
9
  import { ReactComponentImplementation, createReactComponent } from "./a2ui-react/adapter.cjs";
10
10
  import { basicCatalog } from "./a2ui-react/catalog/basic/index.cjs";
11
11
  import { A2UIComponentDefinition, A2UIComponentMap, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentRenderer, PropsOf, RendererProps, createA2UICatalog, createCatalog, extractA2UISchema, extractSchema } from "./create-catalog.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/react-renderer/index.ts"],"mappings":";;;;;;;;;;;;;;;iBAwFgB,sBAAA,CAAA;AAAA,iBAGA,wBAAA,CAAA;AAAA,cAKH,YAAA,EAAc,MAAA;AAAA,cACd,QAAA,EAAQ,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/react-renderer/index.ts"],"mappings":";;;;;;;;;;;;;;;iBAyFgB,sBAAA,CAAA;AAAA,iBAGA,wBAAA,CAAA;AAAA,cAKH,YAAA,EAAc,MAAA;AAAA,cACd,QAAA,EAAQ,MAAA"}
@@ -5,7 +5,7 @@ import { A2UIRenderer, A2UIRendererProps } from "./core/A2UIRenderer.mjs";
5
5
  import { UseA2UIResult, useA2UI } from "./hooks/useA2UI.mjs";
6
6
  import { ThemeProvider, useTheme, useThemeOptional } from "./theme/ThemeContext.mjs";
7
7
  import { cn } from "./lib/utils.mjs";
8
- import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./catalog-utils.mjs";
8
+ import { A2UI_SCHEMA_CONTEXT_DESCRIPTION, InlineCatalogSchema, buildCatalogContextValue, extendsBasicCatalog, extractCatalogComponentSchemas, getCustomComponentNames } from "./catalog-utils.mjs";
9
9
  import { ReactComponentImplementation, createReactComponent } from "./a2ui-react/adapter.mjs";
10
10
  import { basicCatalog } from "./a2ui-react/catalog/basic/index.mjs";
11
11
  import { A2UIComponentDefinition, A2UIComponentMap, CatalogComponentDefinition, CatalogDefinitions, CatalogRenderers, ComponentRenderer, PropsOf, RendererProps, createA2UICatalog, createCatalog, extractA2UISchema, extractSchema } from "./create-catalog.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/react-renderer/index.ts"],"mappings":";;;;;;;;;;;;;;;iBAwFgB,sBAAA,CAAA;AAAA,iBAGA,wBAAA,CAAA;AAAA,cAKH,YAAA,EAAc,MAAA;AAAA,cACd,QAAA,EAAQ,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/react-renderer/index.ts"],"mappings":";;;;;;;;;;;;;;;iBAyFgB,sBAAA,CAAA;AAAA,iBAGA,wBAAA,CAAA;AAAA,cAKH,YAAA,EAAc,MAAA;AAAA,cACd,QAAA,EAAQ,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/react-renderer/index.ts"],"sourcesContent":["// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n"],"mappings":";;;;;;;;;;;;;AAwFA,SAAgB,yBAAyB;AAGzC,SAAgB,2BAA2B;AAK3C,MAAa,eAAwC,EAAE;AACvD,MAAa,WAAW"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/react-renderer/index.ts"],"sourcesContent":["// Core components and provider\nexport {\n A2UIProvider,\n useA2UIActions,\n useA2UIState,\n useA2UIContext,\n useA2UIStore, // @deprecated - use useA2UIContext\n useA2UIStoreSelector, // @deprecated - use useA2UIContext or useA2UI\n useA2UIError,\n} from \"./core/A2UIProvider\";\nexport type { A2UIProviderProps } from \"./core/A2UIProvider\";\nexport { A2UIRenderer } from \"./core/A2UIRenderer\";\nexport type { A2UIRendererProps } from \"./core/A2UIRenderer\";\n\n// Hooks\nexport { useA2UI } from \"./hooks/useA2UI\";\nexport type { UseA2UIResult } from \"./hooks/useA2UI\";\n\n// Theme\nexport {\n ThemeProvider,\n useTheme,\n useThemeOptional,\n} from \"./theme/ThemeContext\";\n\n// Utilities\nexport { cn } from \"./lib/utils\";\n\n// Catalog utilities\nexport {\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n extendsBasicCatalog,\n getCustomComponentNames,\n buildCatalogContextValue,\n extractCatalogComponentSchemas,\n} from \"./catalog-utils\";\nexport type { InlineCatalogSchema } from \"./catalog-utils\";\n\n// Catalog creation — new API (definitions + renderers)\nexport { createCatalog, extractSchema } from \"./create-catalog\";\nexport type {\n CatalogComponentDefinition,\n CatalogDefinitions,\n CatalogRenderers,\n RendererProps,\n ComponentRenderer,\n PropsOf,\n} from \"./create-catalog\";\n\n// Catalog creation — deprecated API (combined definitions + renderers)\nexport { createA2UICatalog, extractA2UISchema } from \"./create-catalog\";\nexport type {\n A2UIComponentDefinition,\n A2UIComponentMap,\n} from \"./create-catalog\";\n\n// Styles\nexport { injectStyles, removeStyles } from \"./styles\";\n\n// Types\nexport type {\n Types,\n Primitives,\n AnyComponentNode,\n Surface,\n SurfaceID,\n Theme,\n ServerToClientMessage,\n A2UIClientEventMessage,\n Action,\n DataValue,\n MessageProcessor,\n StringValue,\n NumberValue,\n BooleanValue,\n A2UIComponentProps,\n ComponentRegistration,\n ComponentLoader,\n OnActionCallback,\n A2UIProviderConfig,\n} from \"./types\";\n\n// Low-level a2ui-react primitives (vendored from @a2ui/react)\nexport { createReactComponent } from \"./a2ui-react/adapter\";\nexport type { ReactComponentImplementation } from \"./a2ui-react/adapter\";\nexport { basicCatalog } from \"./a2ui-react/catalog/basic\";\nexport { Catalog } from \"@a2ui/web_core/v0_9\";\n\n// Backward compat: no-op functions for initializeDefaultCatalog\nexport function registerDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\nexport function initializeDefaultCatalog() {\n /* v0.9: catalog is built-in */\n}\n\n// Backward compat: defaultTheme export (v0.9 themes are handled internally)\nexport const defaultTheme: Record<string, unknown> = {};\nexport const litTheme = defaultTheme;\n"],"mappings":";;;;;;;;;;;;;AAyFA,SAAgB,yBAAyB;AAGzC,SAAgB,2BAA2B;AAK3C,MAAa,eAAwC,EAAE;AACvD,MAAa,WAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/a2ui-renderer",
3
- "version": "1.55.3",
3
+ "version": "1.56.0",
4
4
  "private": false,
5
5
  "description": "A2UI Renderer for CopilotKit - render A2UI surfaces in React applications",
6
6
  "keywords": [