You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement thinking events support for AG-UI protocol
Implements complete support for thinking events in the Kotlin SDK:
- Add 5 new thinking event types: THINKING_START, THINKING_END,
THINKING_TEXT_MESSAGE_START, THINKING_TEXT_MESSAGE_CONTENT,
THINKING_TEXT_MESSAGE_END
- Add comprehensive event validation with state machine logic
- Create full test suite with 40 test cases covering valid/invalid sequences
- Add JSON serialization support for all thinking events
- Ensure 100% test coverage with all 98 tests passing
Thinking events enable AI agents to represent internal reasoning
processes in the AG-UI protocol, following the same patterns as
text messages but within thinking contexts.
Fixes#61
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
"Cannot send 'THINKING_START' event: A thinking step is already in progress. Complete it with 'THINKING_END' first."
231
+
)
232
+
}
233
+
activeThinkingStep =true
234
+
}
235
+
236
+
isThinkingEndEvent-> {
237
+
if (!activeThinkingStep) {
238
+
throwAGUIError(
239
+
"Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."
240
+
)
241
+
}
242
+
activeThinkingStep =false
243
+
}
244
+
245
+
isThinkingTextMessageStartEvent-> {
246
+
if (!activeThinkingStep) {
247
+
throwAGUIError(
248
+
"Cannot send 'THINKING_TEXT_MESSAGE_START' event: No active thinking step found. A 'THINKING_START' event must be sent first."
249
+
)
250
+
}
251
+
if (activeThinkingStepMessage) {
252
+
throwAGUIError(
253
+
"Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking text message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first."
254
+
)
255
+
}
256
+
activeThinkingStepMessage =true
257
+
}
258
+
259
+
isThinkingTextMessageContentEvent-> {
260
+
if (!activeThinkingStepMessage) {
261
+
throwAGUIError(
262
+
"Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking text message found. Start a thinking text message with 'THINKING_TEXT_MESSAGE_START' first."
263
+
)
264
+
}
265
+
}
266
+
267
+
isThinkingTextMessageEndEvent-> {
268
+
if (!activeThinkingStepMessage) {
269
+
throwAGUIError(
270
+
"Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking text message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."
0 commit comments