Table of Contents

v1.4.2 "Nagare" - Comprehensive Streaming Support

Release Date: 2025-08-06
Code Name: "Nagare" (流れ - Flow)
Type: Minor Release


🎯 Overview

Version 1.4.2 introduces comprehensive streaming capabilities for both gRPC and SignalR communication methods, enabling real-time data flow between Jiro instances and JiroCloud. This release adds three essential streaming functionalities: chat messages, logs, and word-by-word message content.

The "Nagare" release establishes a robust foundation for streaming communication, allowing for efficient real-time data transmission across the Jiro ecosystem.

🚀 Key Features

gRPC Streaming Services

  • StreamChatMessagesToServer: Client streaming for chat messages from Jiro instances to JiroCloud
  • StreamLogsToServer: Client streaming for logs with enhanced metadata support
  • StreamWordsToServer: Client streaming for word-by-word message content delivery

Updated gRPC Service Definition:

service JiroHubProto {
    // Existing services...
    
    // Client streaming for chat messages from client to server
    rpc StreamChatMessagesToServer (stream ChatMessage) returns (ChatStreamResponse);
    
    // Client streaming for logs from client to server
    rpc StreamLogsToServer (stream LogEntry) returns (LogStreamResponse);
    
    // Client streaming for word-by-word message content from client to server
    rpc StreamWordsToServer (stream WordStreamUpdate) returns (WordStreamResponse);
}

SignalR Streaming Integration

  • Enhanced Hub Interfaces: Added streaming request and receive methods to both client and server interfaces
  • Event Coordination: New events for managing streaming operations
  • Channel-Based Streaming: Support for ChannelReader<T> streaming patterns

New SignalR Events:

// Server-to-client requests
public const string StreamChatMessagesRequested = "StreamChatMessagesRequested";
public const string StreamWordsRequested = "StreamWordsRequested";

// Client-to-server streaming
public const string StreamChatMessagesToServer = "StreamChatMessagesToServer";
public const string StreamWordsToServer = "StreamWordsToServer";

🔧 Technical Enhancements

Protocol Buffer Message Types

Enhanced LogEntry

message LogEntry {
    string id = 1;
    string level = 2;                        // Log level (DEBUG, INFO, WARN, ERROR)
    string message = 3;                      // Log message content
    string source = 4;                       // Source component or module
    google.protobuf.Timestamp timestamp = 5; // When log was generated
    map<string, string> metadata = 6;        // Additional log metadata
}

Word Streaming Support

message WordStreamUpdate {
    string sessionId = 1;                    // Session ID for the message
    string messageId = 2;                    // ID of the message being streamed
    string word = 3;                         // The word or token being sent
    int32 position = 4;                      // Position of word in the message
    bool isComplete = 5;                     // True when message is fully streamed
    google.protobuf.Timestamp timestamp = 6; // When this word was sent
}

SignalR Interface Updates

Client Interface (IJiroHubClient)

// Request streaming operations from client
Task<ActionResult> RequestChatMessagesStreamAsync(StreamChatRequest request);
Task<ActionResult> RequestWordStreamAsync(StreamWordRequest request);

Server Interface (IJiroHubServer)

// Receive streaming data from client
Task ReceiveChatMessagesStreamAsync(string requestId, ChannelReader<ChatMessage> stream);
Task ReceiveWordStreamAsync(string requestId, ChannelReader<WordUpdate> stream);

🛠️ New Types and Models

Request Types

  • StreamChatRequest: Configuration for chat message streaming with session ID and buffer size
  • StreamWordRequest: Configuration for word streaming with message ID and buffer settings

Response Types

  • WordUpdate: SignalR word update with message context and completion status
  • ChatStreamResponse: gRPC response for chat streaming operations
  • LogStreamResponse: gRPC response for log streaming operations
  • WordStreamResponse: gRPC response for word streaming operations

📋 Communication Flow

Complete Streaming Pattern

  1. Server Request Phase: JiroCloud requests streaming via IJiroHubClient methods
  2. Client Response Phase: Jiro instance responds by sending stream data via IJiroHubServer methods
  3. Data Flow: Real-time streaming of chat messages, logs, or word-by-word content

Supported Streaming Types

Type Description Use Case
Chat Messages Full chat message streaming Real-time conversation sync
Logs System log streaming with metadata Live monitoring and debugging
Word Stream Word-by-word content delivery Progressive message display

🔄 Migration and Compatibility

Backward Compatibility

  • 100% Compatible: No breaking changes to existing APIs
  • Additive Changes: All new functionality is additive
  • Existing Integrations: Current gRPC and SignalR usage continues unchanged

For Existing Consumers

  • Streaming features are opt-in and don't affect existing workflows
  • Previous communication patterns remain fully supported
  • No code changes required for existing implementations

🐛 Issues Resolved

  • Duplicate Method Definitions: Cleaned up overlapping streaming method definitions
  • Directional Clarity: Removed unused server-to-client streaming to maintain clear client-to-server flow
  • Event Naming: Established consistent event naming convention for streaming operations
  • Interface Consistency: Aligned SignalR and gRPC streaming patterns

📈 Performance Benefits

  • Efficient Streaming: Channel-based streaming reduces memory overhead
  • Real-time Capability: Enables true real-time communication between instances
  • Scalable Architecture: Streaming design supports high-throughput scenarios
  • Reduced Latency: Direct streaming eliminates request-response roundtrip delays

🔗 Dependencies

No dependency changes in this release. All dependencies remain consistent with v1.4.1:

  • Grpc.AspNetCore: 2.71.0
  • Google.Protobuf: 3.31.1
  • Microsoft.AspNetCore.SignalR: 1.2.0
  • Microsoft.AspNetCore.SignalR.Client: 9.0.8

Implementation Note: This release establishes the streaming infrastructure foundation for the Jiro ecosystem. The three streaming types (chat, logs, words) provide comprehensive real-time communication capabilities between Jiro instances and JiroCloud services.