Files
cutdex/lib/features/assistant/chat_state.dart
T
lingjhf 27e77fff39 feat: initial Cutdex application
Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
2026-10-05 23:36:23 +08:00

47 lines
1.1 KiB
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
import '../../integrations/agent/conversation_repository.dart';
part 'chat_state.freezed.dart';
enum AgentChatActivity { replying, compacting, editing, verifying }
enum AgentChatError {
configurationReadFailed,
configurationRequired,
sessionRestoreFailed,
contextBudget,
authentication,
connection,
protocol,
replyFailed,
turnLimit,
recoveryRequired,
interrupted,
exportReplyFailed,
requestFailed,
}
@freezed
abstract class ChatMessage with _$ChatMessage {
const factory ChatMessage({
required String text,
@Default(false) bool isUser,
@Default(false) bool interrupted,
int? elapsedMs,
}) = _ChatMessage;
}
@freezed
abstract class ChatState with _$ChatState {
const factory ChatState({
@Default([]) List<ChatMessage> messages,
@Default('') String partialResponse,
@Default(AgentChatActivity.replying) AgentChatActivity activity,
@Default(false) bool busy,
@Default(false) bool stopping,
AgentChatError? error,
ConversationMetadata? conversation,
}) = _ChatState;
}