Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a347a70
feat(ai): add @ag-ui/core as dependency for spec-compliant event types
AlemTuzlak Mar 31, 2026
f964462
feat(ai): redefine AG-UI event types extending @ag-ui/core
AlemTuzlak Mar 31, 2026
3aa7217
feat(ai): add stripToSpec middleware to strip non-spec fields from st…
AlemTuzlak Mar 31, 2026
06bae70
feat(ai): plumb threadId and runId through chat() to adapters
AlemTuzlak Mar 31, 2026
7af0890
feat(ai-openai): update text adapter for AG-UI spec compliance
AlemTuzlak Mar 31, 2026
1757208
fix: update tests and fix type errors for AG-UI spec compliance
AlemTuzlak Mar 31, 2026
6859631
fix(ai): re-add stripToSpec middleware, process raw chunks internally…
AlemTuzlak Mar 31, 2026
b705b3a
fix(ai): pipe tool-phase events through middleware, strip toolCallNam…
AlemTuzlak Mar 31, 2026
3e1d948
style: format test files
AlemTuzlak Mar 31, 2026
41dbb19
test(ai): add tests for REASONING events, TOOL_CALL_RESULT, threadId,…
AlemTuzlak Apr 1, 2026
ebad94f
fix: resolve eslint, type, and test failures across all packages
AlemTuzlak Apr 1, 2026
95c2ecb
fix: resolve eslint and test failures from strip-to-spec middleware
AlemTuzlak Apr 1, 2026
e8bdbbf
fix: honor caller runId, prevent duplicate thinking, add error IDs, f…
AlemTuzlak Apr 1, 2026
eeb3060
fix(smoke-tests): update harness to read spec-compliant event fields
AlemTuzlak Apr 1, 2026
1907e71
ci: apply automated fixes
autofix-ci[bot] Apr 1, 2026
be289d6
fix(smoke-tests): remove unnecessary as-any casts, use proper type na…
AlemTuzlak Apr 1, 2026
6f834da
ci: apply automated fixes
autofix-ci[bot] Apr 1, 2026
2c54b5f
fix(ai-ollama): emit TOOL_CALL_ARGS before TOOL_CALL_END for spec com…
AlemTuzlak Apr 1, 2026
2f92e8b
fix(ai): hide strip-to-spec middleware from devtools instrumentation
AlemTuzlak Apr 1, 2026
7904137
fix(ai): handle TOOL_CALL_RESULT in StreamProcessor to create tool-re…
AlemTuzlak Apr 1, 2026
5d13044
fix(ai): stop stripping finishReason from RUN_FINISHED events
AlemTuzlak Apr 1, 2026
374b82a
fix(ai): only strip deprecated aliases and rawEvent, keep all extras
AlemTuzlak Apr 1, 2026
9046480
ci: apply automated fixes
autofix-ci[bot] Apr 1, 2026
af99dde
fix(ai): stop stripping fields — passthrough allows all extras
AlemTuzlak Apr 1, 2026
3e88109
fix: resolve type errors from @ag-ui/core Zod passthrough types
AlemTuzlak Apr 2, 2026
f8bca89
ci: apply automated fixes
autofix-ci[bot] Apr 2, 2026
2c83fbd
chore(ai): bump @ag-ui/core from 0.0.48 to 0.0.49
AlemTuzlak Apr 2, 2026
3c08043
fix: CR fixes for AG-UI core interop
AlemTuzlak Apr 2, 2026
f3246a3
ci: apply automated fixes
autofix-ci[bot] Apr 2, 2026
14a78f3
fix(ai-client): use cast for RUN_ERROR message to satisfy eslint
AlemTuzlak Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/typescript/ai-anthropic/src/adapters/summarize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import type {
} from '@tanstack/ai'
import type { AnthropicClientConfig } from '../utils'

/** Cast an event object to StreamChunk. */
const asChunk = (chunk: Record<string, unknown>) =>
chunk as unknown as StreamChunk

/**
* Configuration for Anthropic summarize adapter
*/
Expand Down Expand Up @@ -103,18 +107,18 @@ export class AnthropicSummarizeAdapter<
if (event.delta.type === 'text_delta') {
const delta = event.delta.text
accumulatedContent += delta
yield {
yield asChunk({
type: 'TEXT_MESSAGE_CONTENT',
messageId: id,
model,
timestamp: Date.now(),
delta,
content: accumulatedContent,
}
})
}
} else if (event.type === 'message_delta') {
outputTokens = event.usage.output_tokens
yield {
yield asChunk({
type: 'RUN_FINISHED',
runId: id,
model,
Expand All @@ -129,7 +133,7 @@ export class AnthropicSummarizeAdapter<
completionTokens: outputTokens,
totalTokens: inputTokens + outputTokens,
},
}
})
}
}
}
Expand Down
Loading
Loading