Skip to content

docs: update TypeScript streaming events for sdk-typescript#544#578

Merged
dbschmigelski merged 8 commits intostrands-agents:mainfrom
dbschmigelski:454
Feb 25, 2026
Merged

docs: update TypeScript streaming events for sdk-typescript#544#578
dbschmigelski merged 8 commits intostrands-agents:mainfrom
dbschmigelski:454

Conversation

@dbschmigelski
Copy link
Member

Description

  • Update TypeScript code examples and documentation to reflect breaking changes from feat: wrap raw data objects in event wrappers for agent stream sdk-typescript#544, which wraps all raw data objects in event
    wrappers for agent.stream()
  • Raw event types are no longer yielded directly — they are now accessed through wrapper events (e.g., event.type === 'modelStreamUpdateEvent' then event.event.type ===
    'modelContentBlockDeltaEvent')
  • Rewrite the TypeScript event type reference in the streaming overview to document the new event hierarchy

Event mapping applied

┌──────────────────────────────────┬─────────────────────────────────┐
│           Before (raw)           │         After (wrapped)         │
├──────────────────────────────────┼─────────────────────────────────┤
│ modelContentBlockDeltaEvent etc. │ modelStreamUpdateEvent → .event │
├──────────────────────────────────┼─────────────────────────────────┤
│ toolStreamEvent                  │ toolStreamUpdateEvent → .event  │
├──────────────────────────────────┼─────────────────────────────────┤
│ modelMetadataEvent               │ modelStreamUpdateEvent → .event │
└──────────────────────────────────┴─────────────────────────────────┘

Files changed

  • docs/user-guide/concepts/streaming/overview.ts — Updated all stream event type checks in quick example, lifecycle, and sub-agent snippets
  • docs/user-guide/concepts/tools/tools.ts — Updated tool streaming example
  • docs/user-guide/observability-evaluation/metrics.ts — Updated metadata/metrics access pattern
  • docs/user-guide/concepts/streaming/index.md — Rewrote TypeScript event type documentation (lifecycle, model stream, tool events)
  • docs/user-guide/concepts/streaming/async-iterators.md — Fixed event names in descriptive text

Related Issues

Type of Change

  • New content
  • Content update/revision
  • Structure/organization improvement
  • Typo/formatting fix
  • Bug fix
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using mkdocs serve
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Update docs to reflect breaking changes from sdk-typescript PR strands-agents#544 which
wraps all raw data objects in event wrappers for agent.stream(). Raw event
types like modelContentBlockDeltaEvent and toolStreamEvent are now accessed
through wrapper events (ModelStreamUpdateEvent, ToolStreamUpdateEvent, etc.).
Add CLAUDE.md to .gitignore.
@github-actions
Copy link
Contributor

Assessment: Comment

Review Summary

This PR correctly updates the TypeScript documentation to reflect breaking changes from sdk-typescript#544. The changes are well-structured:

  • Event wrapping: Correctly documents the new wrapper pattern (modelStreamUpdateEvent.event)
  • Event renaming: beforeModelEventbeforeModelCallEvent, afterModelEventafterModelCallEvent
  • Tool events: toolStreamEventtoolStreamUpdateEvent correctly updated
  • New events: AgentResultEvent, ContentBlockEvent, ModelMessageEvent, and tool events properly documented
  • TypeScript validation: All code compiles successfully (npm run test passes)
Minor Issue

The .gitignore change adding CLAUDE.md appears unrelated to the PR scope. Consider removing or explaining its relationship.

Overall, the documentation accurately reflects the SDK changes and the code examples are correct. Nice work keeping the docs in sync with the breaking changes! 👍

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

…script#544

Add new hookable data events (ModelStreamUpdateEvent, ContentBlockEvent,
ModelMessageEvent, ToolStreamUpdateEvent, ToolResultEvent, AgentResultEvent)
to the Available Events table and mermaid lifecycle diagram. Replace incorrect
ts_not_supported_code macros with actual TypeScript snippets for composability
and fixed tool arguments sections.
@github-actions
Copy link
Contributor

Updated Review - Including hooks.md Changes

I've also reviewed the hooks.md and hooks.ts additions:

Lifecycle Diagram Updated: The mermaid diagram now correctly shows the data events flow:

  • ModelStreamUpdateEventContentBlockEventModelMessageEvent in model events
  • ToolStreamUpdateEventToolResultEvent in tool events
  • AgentResultEvent in end events

Data Events Documentation: The new "Data Events (TypeScript only)" section properly documents:

  • ModelStreamUpdateEvent - wraps streaming deltas
  • ContentBlockEvent - wraps assembled content blocks
  • ModelMessageEvent - wraps complete model messages
  • ToolStreamUpdateEvent - wraps tool streaming progress
  • ToolResultEvent - wraps tool results
  • AgentResultEvent - wraps final agent result

TypeScript Examples: hooks.ts compiles successfully with proper typing for all hook patterns.

The note *\* Data events are TypeScript only. In Python, equivalent data is available through the streaming event dictionary.* is a helpful clarification for users.

My previous review assessment remains: Comment (approve with minor suggestion to remove unrelated .gitignore change).

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

@github-actions
Copy link
Contributor

Updated Review - hooks.md Improvements

The hooks.md file has been significantly improved with better separation of Python and TypeScript documentation:

Separate Lifecycle Diagrams: The mermaid diagrams are now properly split into Python/TypeScript tabs:

  • Python diagram shows the simpler event flow without data events
  • TypeScript diagram includes ModelStreamUpdateEvent, ContentBlockEvent, ModelMessageEvent, ToolStreamUpdateEvent, ToolResultEvent, AgentResultEvent

Separate Event Tables: Each SDK now has its own "Available Events" table:

  • Python table includes multi-agent events (MultiAgentInitializedEvent, BeforeNodeCallEvent, etc.)
  • TypeScript table includes data events with clear access patterns (.event, .contentBlock, .message, .result)

Proper Macros: Uses {{ ts_not_supported_code() }} for multi-agent section

This is a cleaner approach than the previous single diagram with footnotes. TypeScript compilation continues to pass.

Assessment remains: Comment (approve with minor suggestion to address unrelated .gitignore change)

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

@strands-agent
Copy link
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-578/

@dbschmigelski dbschmigelski merged commit 9050b97 into strands-agents:main Feb 25, 2026
10 checks 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.

3 participants