feat(channels): add BlockStreamer for progressive message delivery

- Add BlockStreamer class to split streaming responses into multiple messages
- Configure block streaming with min/max chars and idle coalescing
- Integrate into ChannelBase when blockStreaming: 'on'
- Add comprehensive test coverage (16 tests)

This improves UX by delivering completed paragraphs as separate messages
instead of waiting for the full response.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-27 14:36:40 +00:00
parent f7979aa902
commit 3d24a9c3fe
6 changed files with 375 additions and 3 deletions

View file

@ -5,5 +5,5 @@
"rootDir": "src"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules", "dist", "src/**/*.test.ts"]
}