Skip to content

Conversation

@micwrim
Copy link

@micwrim micwrim commented Dec 10, 2025

Adds a tutorial demonstrating how to intercept and process events as they happen during agent execution using Async iterators and Hooks.

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

@github-actions
Copy link

Latest scan for commit: 02f60a0 | Updated: 2025-12-15 02:34:22 UTC

✅ Security Scan Report (PR Files Only)

Scanned Files

  • typescript/01-tutorials/01-fundamentals/04-streaming/.gitignore
  • typescript/01-tutorials/01-fundamentals/04-streaming/architecture.png
  • typescript/01-tutorials/01-fundamentals/04-streaming/architecture2.png
  • typescript/01-tutorials/01-fundamentals/04-streaming/package-lock.json
  • typescript/01-tutorials/01-fundamentals/04-streaming/package.json
  • typescript/01-tutorials/01-fundamentals/04-streaming/src/async-sample-1.ts
  • typescript/01-tutorials/01-fundamentals/04-streaming/src/async-sample-2.ts
  • typescript/01-tutorials/01-fundamentals/04-streaming/src/hooks-sample.ts
  • typescript/01-tutorials/01-fundamentals/04-streaming/src/streaming-sample.ts
  • typescript/01-tutorials/01-fundamentals/04-streaming/src/tools.ts
  • ... and 2 more files

Security Scan Results

Critical High Medium Low Info
0 0 0 0 0

Threshold: High

No security issues detected in your changes. Great job!

This scan only covers files changed in this PR.

@manoj-selvakumar5
Copy link
Collaborator

Hi @micwrim
Looks like these tutorials covers two streaming and hooks.

  1. Streaming - async iterators, stream() method, Express HTTP integration
  2. Hooks - event callbacks via agent.hooks.addCallback()

I believe these features could each benefit from their own focused tutorial. Could we remove hooks from this PR and have it as a separate numbered tutorial (e.g., 07-hooks or 08-hooks)? That way, this tutorial can focus solely on streaming.

here is the structure Im thinking about

04-streaming/
├── images/
│ └── architecture.png
├── src/
│ ├── 01-basic-stream.ts # Simple: stream() + filter textBlocks
│ ├── 02-http-streaming.ts # Express HTTP streaming
│ └── tools.ts
├── package.json
├── tsconfig.json
└── README.md

07-hooks/
├── images/
│ └── architecture.png
├── src/
│ ├── hooks.ts
│ └── tools.ts
├── package.json
├── tsconfig.json
└── README.md

Also, please ensure the README follows the same structure as other tutorials.

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.

2 participants