Add support for step functions defined as object properties#342
Merged
TooTallNate merged 2 commits intoNov 15, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: 48ddccb The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
ijjk
approved these changes
Nov 14, 2025
This was referenced Nov 14, 2025
2c7bbdf to
2288833
Compare
528be20 to
a2ddb2b
Compare
a2ddb2b to
577f570
Compare
2288833 to
6be03f3
Compare
577f570 to
48ddccb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Added support for step functions defined as object properties in the SWC plugin.
What changed?
This PR extends the SWC plugin to support step functions defined as object properties. It now handles three different patterns:
tool({ execute: async () => { "use step"; ... } })tool({ execute: async function() { "use step"; ... } })tool({ async execute() { "use step"; ... } })The implementation:
How to test?
Test with various object property function patterns:
Why make this change?
This change enables a common pattern in JavaScript where functions are defined as object properties, particularly in AI SDK tool definitions.
Previously, the SWC plugin only supported top-level function declarations and expressions with the
"use step"directive. This enhancement provides a more natural developer experience by allowing step functions to be defined directly within their object context.