Skip to content

Version Packages (alpha) - #89

Merged
davidkpiano merged 1 commit into
nextfrom
changeset-release/next
Aug 5, 2026
Merged

Version Packages (alpha)#89
davidkpiano merged 1 commit into
nextfrom
changeset-release/next

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

next is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on next.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@statelyai/agent@2.0.0-alpha.15

Minor Changes

  • #88 d857a8a Thanks @davidkpiano! - Machine input is validated against its schema, and defaulted fields are optional at the call site.

    XState's schemas are types only — it never validates, and it resolves schemas.input to one type shared by createActor's input option and the context: ({ input }) factory. A field declared with a default was therefore both absent at runtime and required at the call site.

    runAgent/createAgentActor now validate options.input against the machine's declared input schema before the actor starts: defaults are filled and transforms applied, and the resolved value is what reaches the actor, the replayable event log, and the run.start trace — so a replay reproduces the run even if a default is computed. Invalid input throws an AgentError with code invalid-machine-input (like a mismatched resume snapshot; the actor never starts). Omitting input entirely still skips validation.

    const agent = setupAgent({
      schemas: createAgentSchemas({
        context: z.object({ topic: z.string(), rounds: z.number() }),
        input: z.object({ topic: z.string(), rounds: z.number().default(3) }),
      }),
    });
    
    const machine = agent.createMachine({
      // `rounds` arrives filled in — no `?? 3` restating the default here
      context: ({ input }) => ({ topic: input.topic, rounds: input.rounds }),
      // ...
    });
    
    // `rounds` is optional at the call site; `topic` (no default) is not
    await runAgent(machine, { input: { topic: "otters" } });

    Standard Schema throughout — no validation library is referenced, so this works with whatever the machine was declared with.

    Types: runAgent's input is now AgentInputFrom<TMachine>, which reads the schema's pre-validation side (~standard.types.input) while the context factory keeps the validated side. Machines reached through .provide(...) lose the brand and fall back to xstate's InputFrom. New exported type helpers: AgentInputFrom, InferInput.

@statelyai/agent-demo@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@statelyai/example-cloudflare-agent-host@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@statelyai/example-cloudflare-workers-ai-host@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@statelyai/example-next-host@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@statelyai/example-tanstack-ai-stream@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@statelyai/example-tanstack-start-host@0.0.1-alpha.3

Patch Changes

  • Updated dependencies [d857a8a]:
    • @statelyai/agent@2.0.0-alpha.15

@davidkpiano
davidkpiano merged commit 2381300 into next Aug 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant