feat(streaming): add Tauri streaming chat command

Add agent_chat_stream Tauri command that:
- Accepts StreamChatRequest with agent_id, session_id, message
- Gets streaming receiver from kernel.send_message_stream()
- Spawns background task to emit Tauri events ("stream:chunk")
- Emits StreamChatEvent types (Delta, ToolStart, ToolEnd, Complete, Error)
- Includes session_id for frontend routing

Registered in lib.rs invoke_handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-24 01:50:47 +08:00
parent 6f82723225
commit 936c922081
3 changed files with 175 additions and 2 deletions

View File

@@ -1332,6 +1332,7 @@ pub fn run() {
kernel_commands::agent_get,
kernel_commands::agent_delete,
kernel_commands::agent_chat,
kernel_commands::agent_chat_stream,
// OpenFang commands (new naming)
openfang_status,
openfang_start,
@@ -1347,7 +1348,6 @@ pub fn run() {
openfang_process_logs,
openfang_version,
// Health check commands
openfang_health_check,
openfang_ping,
// Backward-compatible aliases (OpenClaw naming)
gateway_status,