-
-
Notifications
You must be signed in to change notification settings - Fork 134
AG-UI CustomEvents #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+108
β43
Closed
AG-UI CustomEvents #306
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| '@tanstack/tests-adapters': patch | ||
| '@tanstack/ai-client': patch | ||
| '@tanstack/ai': patch | ||
| --- | ||
|
|
||
| Refactor CustomEvent property from 'data' to 'value' for AG-UI compliance | ||
|
|
||
| ## What Changed | ||
|
|
||
| The `CustomEvent` interface and class now use a `value` property instead of `data` to align with the AG-UI specification for custom events. | ||
|
|
||
| ### TypeScript | ||
|
|
||
| ```typescript | ||
| // Before | ||
| interface CustomEvent { | ||
| type: 'CUSTOM' | ||
| name: string | ||
| data?: unknown | ||
| } | ||
|
|
||
| // After | ||
| interface CustomEvent { | ||
| type: 'CUSTOM' | ||
| name: string | ||
| value?: unknown | ||
| } | ||
| ``` | ||
|
|
||
| ### Python | ||
|
|
||
| ```python | ||
| # Before | ||
| class CustomEvent: | ||
| def __init__(self, name: str, data=None): | ||
| self.data = data | ||
|
|
||
| # After | ||
| class CustomEvent: | ||
| def __init__(self, name: str, value=None): | ||
| self.value = value | ||
| ``` | ||
|
|
||
| ## Migration Guide | ||
|
|
||
| Update any code that accesses the `data` property on CustomEvent objects: | ||
|
|
||
| ```typescript | ||
| // Before | ||
| if (chunk.type === 'CUSTOM' && chunk.data) { | ||
| console.log(chunk.data) | ||
| } | ||
|
|
||
| // After | ||
| if (chunk.type === 'CUSTOM' && chunk.value) { | ||
| console.log(chunk.value) | ||
| } | ||
| ``` | ||
|
|
||
| This affects: | ||
|
|
||
| - Custom event handlers that access event data | ||
| - Test utilities that create or verify CustomEvent objects | ||
| - Stream processing code that handles CUSTOM event types | ||
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking API change incorrectly versioned as
patch.Renaming
CustomEvent.dataβCustomEvent.valuesilently breaks any consumer that readsevent.data(they getundefinedwith no error). This is a breaking change and must be versioned accordingly:@tanstack/aiand@tanstack/ai-client: should beminorat minimum (ormajorif following strict SemVer). Apatchbump gives consumers no semver signal that their code may break.@tanstack/tests-adapters:patchis acceptable since it is a test/dev-only package.π§ Suggested fix
π Committable suggestion
π€ Prompt for AI Agents