a3fe0b4b61
The mobile app was receiving SSE status events but showing the peek text only while the assistant bubble was empty — as soon as the first token arrived, the status line was replaced by streaming content and any tool calls fired mid-turn left no trace. Tool call SSE events were also being dropped by the parser, and Message.fromJson never read the persisted tool_calls array, so chips never rendered after reload either. Parse tool_call SSE frames into a new ChatToolCall event, carry tool calls on Message, and update the chat and briefing streaming loops to append chips to the in-flight assistant message as they arrive. Rework ChatMessageBubble to show a chip row + rolling peek status line above any streamed text, matching the web ToolCallCard/status indicator behaviour across chat, briefing, and briefing history surfaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
877 B
Dart
22 lines
877 B
Dart
import '../api/chat_api.dart';
|
|
export '../api/chat_api.dart'
|
|
show ChatStreamEvent, ChatTextChunk, ChatStatusUpdate, ChatToolCall;
|
|
import '../models/conversation.dart';
|
|
import '../models/message.dart';
|
|
|
|
class ChatRepository {
|
|
final ChatApi _api;
|
|
const ChatRepository(this._api);
|
|
|
|
Future<List<Conversation>> getConversations() => _api.getConversations();
|
|
Future<Conversation> createConversation(String title) =>
|
|
_api.createConversation(title);
|
|
Future<void> deleteConversation(int id) => _api.deleteConversation(id);
|
|
Future<(Conversation, List<Message>)> getMessages(int conversationId) =>
|
|
_api.getMessages(conversationId);
|
|
Future<void> sendMessage(int conversationId, String content) =>
|
|
_api.sendMessage(conversationId, content);
|
|
Stream<ChatStreamEvent> streamGeneration(int conversationId) =>
|
|
_api.streamGeneration(conversationId);
|
|
}
|