Skip to content

v0.0.8

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 16 Mar 14:51
· 113 commits to main since this release
d851ad5

Patch Changes

  • #22 8a2c34b Thanks @davidkpiano! - The createSchemas(…) function has been removed. The defineEvents(…) function should be used instead, as it is a simpler way of defining events and event schemas using Zod:

    import { defineEvents } from "@statelyai/agent";
    import { z } from "zod";
    import { setup } from "xstate";
    
    const events = defineEvents({
      inc: z.object({
        by: z.number().describe("Increment amount"),
      }),
    });
    
    const machine = setup({
      types: {
        events: events.types,
      },
      schema: {
        events: events.schemas,
      },
    }).createMachine({
      // ...
    });