-
Notifications
You must be signed in to change notification settings - Fork 1
Add registerEvent to the React Native SDK #128
Copy link
Copy link
Open
Labels
area:react-native-sdkpackages/react-nativepackages/react-nativeplatform:react-nativeAffects the React Native SDK, Expo plugin or Metro helperAffects the React Native SDK, Expo plugin or Metro helperstatus:readySpec and fix direction are clear; an agent can pick it upSpec and fix direction are clear; an agent can pick it uptype:featureSomething Appduct should do that it does not todaySomething Appduct should do that it does not today
Description
Activity
Metadata
Metadata
Assignees
Labels
area:react-native-sdkpackages/react-nativepackages/react-nativeplatform:react-nativeAffects the React Native SDK, Expo plugin or Metro helperAffects the React Native SDK, Expo plugin or Metro helperstatus:readySpec and fix direction are clear; an agent can pick it upSpec and fix direction are clear; an agent can pick it uptype:featureSomething Appduct should do that it does not todaySomething Appduct should do that it does not today
Part of #95. Needs #126 and #127.
Why
React Native apps post events that agents can't discover, and app authors get no feedback when a posted event doesn't match what they meant to post.
Expected outcome
registerEvent({ name, description, payloadSchema? })in@appduct/react-native, returning whatregisterToolreturns. It goes through new TurboModule methodsregisterEvent(json)andunregisterEvent(name)to the native cores.payloadSchematakes a Standard Schema or raw JSON Schema, as tool schemas do. The JS layer keeps the Standard Schemas and uses them for development warnings.Constraints and non-goals
postEventstill reaches agents, and every existingpostEventcaller keeps working unchanged.How we know it is done
registerEvent({ name: "checkout_completed", description, payloadSchema }),events.listreturns the event with its description and schema, and after the disposer runs it's gone.appduct_events.docs/TOOLS.mdand the shipped skill'swriting-tools.mdtell app authors to declare each event they post.Alternatives considered
none