You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Bug: a2ui-renderer: createCatalog renderer props are typed as the raw schema (Action props aren't callable, bound values unresolved, set<Prop> setters missing) #7814
import{createCatalog}from"@copilotkit/a2ui-renderer";import{CommonSchemas}from"@a2ui/web_core/v0_9";import{z}from"zod";constdefinitions={Dimmer: {props: z.object({level: CommonSchemas.DynamicNumber,changeLevel: CommonSchemas.Action})},};exportconstcatalog=createCatalog(definitions,{Dimmer: ({ props })=>(<inputtype="range"value={Number(props.level??0)}onChange={(e)=>{props.setLevel(Number(e.target.value));// writes the bound data-model pathprops.changeLevel();// dispatches the action, context resolved}}/>),});
npx tsc --noEmit
✅ Expected Behavior
It type-checks, because that is what the renderer receives at runtime: the GenericBinder passes resolved props. Action props are functions that dispatch the action with its context resolved, a bound DynamicNumber arrives as a number, and every bindable prop gets a set<Prop> setter. The basic catalog's own components rely on this: Slider calls props.setValue(...) and Button passes props.action to onClick.
❌ Actual Behavior
Two errors, and level is typed as the binding rather than the value:
u5.tsx: error TS2339: Property 'setLevel' does not exist on type '{ level: number | { path: string; } | { call: string; ... }; changeLevel: { ...; } | { ...; }; }'.
u5.tsx: error TS2349: This expression is not callable. No constituent of type '{ event: { name: string; context?: ... }; } | { ...; }' is callable.
CatalogRenderers (create-catalog.tsx) types each renderer as ComponentRenderer<z.infer<D[K]["props"]>>, the schema's input shape. The built-in components avoid this because they're typed through createReactComponent, which uses ResolveA2uiProps from @a2ui/web_core.
Fix: ComponentRenderer<ResolveA2uiProps<z.infer<D[K]["props"]>>> (and the same in createA2UICatalog). I checked it by patching the published 1.79.0 create-catalog.d.mts: the example above then type-checks, and props.setLevel("x") is still rejected. I can open a PR.
⚠️ This is an AI-generated response. We've escalated this to our engineering team — someone will follow up in this thread shortly.
The type mismatch you've identified is real and the analysis is accurate — CatalogRenderers maps to z.infer<D[K]["props"]> (the raw schema input shape) rather than the runtime-resolved shape, while the built-in components go through createReactComponent which applies ResolveA2uiProps from @a2ui/web_core. The discrepancy is visible in create-catalog.tsx line 65.
A PR would be welcome — engineering will need to verify the fix and confirm there are no downstream type impacts before merging, but the direction you've described (ResolveA2uiProps<z.infer<D[K]["props"]>> in CatalogRenderers and createA2UICatalog) matches what the runtime actually delivers to renderers.
🤖 Generated by CopilotKit AI Support · Documentation
Activity
copilotkit-outpost-bot commentedon Oct 14, 2026
The type mismatch you've identified is real and the analysis is accurate —
CatalogRenderersmaps toz.infer<D[K]["props"]>(the raw schema input shape) rather than the runtime-resolved shape, while the built-in components go throughcreateReactComponentwhich appliesResolveA2uiPropsfrom@a2ui/web_core. The discrepancy is visible increate-catalog.tsxline 65.A PR would be welcome — engineering will need to verify the fix and confirm there are no downstream type impacts before merging, but the direction you've described (
ResolveA2uiProps<z.infer<D[K]["props"]>>inCatalogRenderersandcreateA2UICatalog) matches what the runtime actually delivers to renderers.🤖 Generated by CopilotKit AI Support · Documentation
Was this helpful? React with 👍 or 👎