@decocms/runtime 1.0.0-alpha.33 → 1.0.0-alpha.34

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/runtime",
3
- "version": "1.0.0-alpha.33",
3
+ "version": "1.0.0-alpha.34",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit"
package/src/tools.ts CHANGED
@@ -349,8 +349,8 @@ const toolsFor = <TSchema extends z.ZodTypeAny = never>({
349
349
  outputSchema: OnEventsOutputSchema,
350
350
  execute: async (input) => {
351
351
  const env = input.runtimeContext.env;
352
- // Get state from env - it should have the binding values
353
- const state = env as z.infer<TSchema>;
352
+ // Get state from MESH_REQUEST_CONTEXT - this has the binding values
353
+ const state = env.MESH_REQUEST_CONTEXT?.state as z.infer<TSchema>;
354
354
  return Event.execute(
355
355
  events.handlers!,
356
356
  input.context.events,