@cometchat/skills 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -17
- package/bin/install.js +389 -43
- package/package.json +19 -9
- package/skills/cometchat/SKILL.md +1066 -265
- package/skills/cometchat-android-v5/SKILL.md +120 -0
- package/skills/cometchat-android-v5-components/SKILL.md +430 -0
- package/skills/cometchat-android-v5-core/SKILL.md +468 -0
- package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
- package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
- package/skills/cometchat-android-v5-features/SKILL.md +130 -0
- package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
- package/skills/cometchat-android-v5-production/SKILL.md +94 -0
- package/skills/cometchat-android-v5-push/SKILL.md +620 -0
- package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
- package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
- package/skills/cometchat-android-v6/SKILL.md +107 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
- package/skills/cometchat-android-v6-core/SKILL.md +354 -0
- package/skills/cometchat-android-v6-events/SKILL.md +212 -0
- package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
- package/skills/cometchat-android-v6-features/SKILL.md +130 -0
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
- package/skills/cometchat-android-v6-production/SKILL.md +187 -0
- package/skills/cometchat-android-v6-push/SKILL.md +274 -0
- package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
- package/skills/cometchat-angular-components/SKILL.md +706 -0
- package/skills/cometchat-angular-core/SKILL.md +444 -0
- package/skills/cometchat-angular-customization/SKILL.md +424 -0
- package/skills/cometchat-angular-features/SKILL.md +447 -0
- package/skills/cometchat-angular-patterns/SKILL.md +447 -0
- package/skills/cometchat-angular-placement/SKILL.md +685 -0
- package/skills/cometchat-angular-production/SKILL.md +415 -0
- package/skills/cometchat-angular-theming/SKILL.md +365 -0
- package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
- package/skills/cometchat-astro-patterns/SKILL.md +3 -3
- package/skills/cometchat-components/SKILL.md +11 -0
- package/skills/cometchat-core/SKILL.md +11 -6
- package/skills/cometchat-customization/references/component-catalog.md +1 -1
- package/skills/cometchat-features/SKILL.md +176 -108
- package/skills/cometchat-flutter-v5/SKILL.md +167 -0
- package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
- package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
- package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
- package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
- package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
- package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
- package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
- package/skills/cometchat-flutter-v6/SKILL.md +445 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
- package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
- package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
- package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
- package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
- package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
- package/skills/cometchat-ios/SKILL.md +323 -0
- package/skills/cometchat-ios-components/SKILL.md +651 -0
- package/skills/cometchat-ios-core/SKILL.md +822 -0
- package/skills/cometchat-ios-customization/SKILL.md +825 -0
- package/skills/cometchat-ios-features/SKILL.md +725 -0
- package/skills/cometchat-ios-placement/SKILL.md +750 -0
- package/skills/cometchat-ios-production/SKILL.md +730 -0
- package/skills/cometchat-ios-push/SKILL.md +582 -0
- package/skills/cometchat-ios-theming/SKILL.md +631 -0
- package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
- package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
- package/skills/cometchat-native-components/SKILL.md +594 -0
- package/skills/cometchat-native-core/SKILL.md +407 -0
- package/skills/cometchat-native-customization/SKILL.md +594 -0
- package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
- package/skills/cometchat-native-features/SKILL.md +608 -0
- package/skills/cometchat-native-placement/SKILL.md +500 -0
- package/skills/cometchat-native-production/SKILL.md +694 -0
- package/skills/cometchat-native-push/SKILL.md +593 -0
- package/skills/cometchat-native-testing/SKILL.md +583 -0
- package/skills/cometchat-native-theming/SKILL.md +656 -0
- package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
- package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
- package/skills/cometchat-production/SKILL.md +60 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v6-events
|
|
3
|
+
description: "CometChat Android UIKit v6 event system — SharedFlow-based reactive event bus for messages, calls, users, groups, conversations, and UI events"
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-core-android:6.x"
|
|
6
|
+
allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
|
|
7
|
+
metadata:
|
|
8
|
+
author: "CometChat"
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
tags: "cometchat, android, events, sharedflow, kotlin-flow, reactive"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
> **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Subscribe to and emit CometChat events using the v6 Kotlin SharedFlow-based event bus. This replaces the v5 Java listener interface pattern with a reactive, type-safe system built on `kotlinx.coroutines.flow.SharedFlow`.
|
|
18
|
+
|
|
19
|
+
## Use this skill when
|
|
20
|
+
|
|
21
|
+
- Listening for message sent/received/edited/deleted events
|
|
22
|
+
- Listening for call accepted/rejected/ended events
|
|
23
|
+
- Listening for user or group membership changes
|
|
24
|
+
- Listening for conversation updates
|
|
25
|
+
- Listening for UI events (custom UI position events)
|
|
26
|
+
- Emitting custom events to trigger UI updates
|
|
27
|
+
|
|
28
|
+
## Do not use this skill when
|
|
29
|
+
|
|
30
|
+
- Setting up the SDK (use `cometchat-android-v6-core`)
|
|
31
|
+
- Working with CometChat SDK-level listeners (`CometChat.addMessageListener`) — those are separate from UIKit events
|
|
32
|
+
|
|
33
|
+
## 1. Event Bus Architecture
|
|
34
|
+
|
|
35
|
+
`CometChatEvents` is a singleton object in `com.cometchat.uikit.core.events` that manages 6 event flows:
|
|
36
|
+
|
|
37
|
+
```kotlin
|
|
38
|
+
import com.cometchat.uikit.core.events.CometChatEvents
|
|
39
|
+
|
|
40
|
+
// 6 event flows — all are SharedFlow<T>
|
|
41
|
+
CometChatEvents.messageEvents // SharedFlow<CometChatMessageEvent>
|
|
42
|
+
CometChatEvents.callEvents // SharedFlow<CometChatCallEvent>
|
|
43
|
+
CometChatEvents.userEvents // SharedFlow<CometChatUserEvent>
|
|
44
|
+
CometChatEvents.groupEvents // SharedFlow<CometChatGroupEvent>
|
|
45
|
+
CometChatEvents.conversationEvents // SharedFlow<CometChatConversationEvent>
|
|
46
|
+
CometChatEvents.uiEvents // SharedFlow<CometChatUIEvent>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Each flow uses:
|
|
50
|
+
- `replay = 0` — no replay of past events to new subscribers
|
|
51
|
+
- `BufferOverflow.DROP_OLDEST` — drops oldest events when buffer is full
|
|
52
|
+
- Buffer capacities: messages=64, groups=32, users/conversations/ui=16, calls=8
|
|
53
|
+
|
|
54
|
+
## 2. Subscribing to Events
|
|
55
|
+
|
|
56
|
+
### 2.1 In a ViewModel or CoroutineScope
|
|
57
|
+
|
|
58
|
+
```kotlin
|
|
59
|
+
import com.cometchat.uikit.core.events.*
|
|
60
|
+
import kotlinx.coroutines.launch
|
|
61
|
+
|
|
62
|
+
// In a ViewModel
|
|
63
|
+
viewModelScope.launch {
|
|
64
|
+
CometChatEvents.messageEvents.collect { event ->
|
|
65
|
+
when (event) {
|
|
66
|
+
is CometChatMessageEvent.MessageSent -> {
|
|
67
|
+
val message = event.message
|
|
68
|
+
val status = event.status // IN_PROGRESS, SUCCESS, or ERROR
|
|
69
|
+
}
|
|
70
|
+
is CometChatMessageEvent.MessageEdited -> {
|
|
71
|
+
val editedMessage = event.message
|
|
72
|
+
}
|
|
73
|
+
is CometChatMessageEvent.MessageDeleted -> {
|
|
74
|
+
val deletedMessage = event.message
|
|
75
|
+
}
|
|
76
|
+
// handle other message events...
|
|
77
|
+
else -> {}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 2.2 In Jetpack Compose
|
|
84
|
+
|
|
85
|
+
```kotlin
|
|
86
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
87
|
+
import com.cometchat.uikit.core.events.*
|
|
88
|
+
|
|
89
|
+
@Composable
|
|
90
|
+
fun ChatScreen() {
|
|
91
|
+
LaunchedEffect(Unit) {
|
|
92
|
+
CometChatEvents.callEvents.collect { event ->
|
|
93
|
+
when (event) {
|
|
94
|
+
is CometChatCallEvent.CallAccepted -> {
|
|
95
|
+
// Navigate to ongoing call screen
|
|
96
|
+
}
|
|
97
|
+
is CometChatCallEvent.CallRejected -> {
|
|
98
|
+
// Dismiss call UI
|
|
99
|
+
}
|
|
100
|
+
else -> {}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 2.3 In an Activity or Application class
|
|
108
|
+
|
|
109
|
+
```kotlin
|
|
110
|
+
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
|
|
111
|
+
|
|
112
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
113
|
+
super.onCreate(savedInstanceState)
|
|
114
|
+
|
|
115
|
+
scope.launch {
|
|
116
|
+
CometChatEvents.callEvents.collect { event ->
|
|
117
|
+
when (event) {
|
|
118
|
+
is CometChatCallEvent.CallAccepted -> { /* ... */ }
|
|
119
|
+
is CometChatCallEvent.CallRejected -> { /* ... */ }
|
|
120
|
+
else -> {}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
override fun onDestroy() {
|
|
127
|
+
super.onDestroy()
|
|
128
|
+
scope.cancel() // Always cancel to avoid leaks
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 3. Emitting Events
|
|
133
|
+
|
|
134
|
+
```kotlin
|
|
135
|
+
// Emit a message event
|
|
136
|
+
CometChatEvents.emitMessageEvent(
|
|
137
|
+
CometChatMessageEvent.MessageSent(message, MessageStatus.SUCCESS)
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
// Emit a call event
|
|
141
|
+
CometChatEvents.emitCallEvent(
|
|
142
|
+
CometChatCallEvent.CallRejected(call)
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
// Emit a user event
|
|
146
|
+
CometChatEvents.emitUserEvent(event)
|
|
147
|
+
|
|
148
|
+
// Emit a group event
|
|
149
|
+
CometChatEvents.emitGroupEvent(event)
|
|
150
|
+
|
|
151
|
+
// Emit a conversation event
|
|
152
|
+
CometChatEvents.emitConversationEvent(event)
|
|
153
|
+
|
|
154
|
+
// Emit a UI event
|
|
155
|
+
CometChatEvents.emitUIEvent(event)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
All emit functions are thread-safe — they launch on `Dispatchers.Default` internally.
|
|
159
|
+
|
|
160
|
+
## 4. Event Types Reference
|
|
161
|
+
|
|
162
|
+
### 4.1 CometChatMessageEvent (sealed class)
|
|
163
|
+
|
|
164
|
+
| Event | Properties | When emitted |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `MessageSent` | `message: BaseMessage`, `status: MessageStatus` | Text/media/custom message sent (IN_PROGRESS → SUCCESS or ERROR) |
|
|
167
|
+
| `MessageEdited` | `message: BaseMessage` | Message edited |
|
|
168
|
+
| `MessageDeleted` | `message: BaseMessage` | Message deleted |
|
|
169
|
+
|
|
170
|
+
`MessageStatus` enum: `IN_PROGRESS`, `SUCCESS`, `ERROR`
|
|
171
|
+
|
|
172
|
+
### 4.2 CometChatCallEvent (sealed class)
|
|
173
|
+
|
|
174
|
+
| Event | Properties | When emitted |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| `CallAccepted` | `call: Call` | Incoming call accepted |
|
|
177
|
+
| `CallRejected` | `call: Call` | Call rejected |
|
|
178
|
+
|
|
179
|
+
### 4.3 CometChatUserEvent (sealed class)
|
|
180
|
+
|
|
181
|
+
User-related events (block, unblock, etc.)
|
|
182
|
+
|
|
183
|
+
### 4.4 CometChatGroupEvent (sealed class)
|
|
184
|
+
|
|
185
|
+
Group membership events (member added, removed, scope changed, etc.)
|
|
186
|
+
|
|
187
|
+
### 4.5 CometChatConversationEvent (sealed class)
|
|
188
|
+
|
|
189
|
+
Conversation-level events (conversation deleted, etc.)
|
|
190
|
+
|
|
191
|
+
### 4.6 CometChatUIEvent (sealed class)
|
|
192
|
+
|
|
193
|
+
UI-level events including `CustomUIPosition` for custom view positioning.
|
|
194
|
+
|
|
195
|
+
## 5. Migration from v5
|
|
196
|
+
|
|
197
|
+
| v5 Pattern | v6 Pattern |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `CometChatMessageEvents.addListener(id, listener)` | `CometChatEvents.messageEvents.collect { }` |
|
|
200
|
+
| `CometChatCallEvents.addListener(id, listener)` | `CometChatEvents.callEvents.collect { }` |
|
|
201
|
+
| `listener.onTextMessageSent(message)` | `is CometChatMessageEvent.MessageSent` |
|
|
202
|
+
| `removeListener(id)` | Cancel the coroutine scope |
|
|
203
|
+
| Java interface callbacks | Kotlin sealed class + when expression |
|
|
204
|
+
|
|
205
|
+
## Hard rules
|
|
206
|
+
|
|
207
|
+
- NEVER collect flows on `Dispatchers.Default` for UI updates — switch to `Dispatchers.Main` or use `viewModelScope` / `lifecycleScope`
|
|
208
|
+
- ALWAYS cancel coroutine scopes when the component is destroyed to avoid memory leaks
|
|
209
|
+
- Events are emitted on `Dispatchers.Default` — the subscriber is responsible for thread switching
|
|
210
|
+
- Buffer overflow uses `DROP_OLDEST` — high-frequency events may be dropped if the subscriber is slow
|
|
211
|
+
- Do NOT confuse UIKit events (`CometChatEvents`) with SDK-level listeners (`CometChat.addMessageListener`) — they are separate systems
|
|
212
|
+
- `CometChatUIKit.sendTextMessage()` / `sendMediaMessage()` / `sendCustomMessage()` automatically emit message events — do not double-emit
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v6-extensions
|
|
3
|
+
description: "CometChat Android UIKit v6 extension architecture — DataSource/Repository pattern, custom message types, and data-layer overrides"
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-core-android:6.x"
|
|
6
|
+
allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
|
|
7
|
+
metadata:
|
|
8
|
+
author: "CometChat"
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
tags: "cometchat, android, extensions, datasource, repository, clean-architecture"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
> **Companion skills:** cometchat-android-v6-features (feature catalog), cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Extend the CometChat UIKit v6 data layer using the clean architecture DataSource/Repository pattern. Create custom DataSource implementations, override repository behavior, and register custom message types.
|
|
18
|
+
|
|
19
|
+
## Use this skill when
|
|
20
|
+
|
|
21
|
+
- Creating a custom DataSource implementation to change how data is fetched
|
|
22
|
+
- Overriding default repository behavior
|
|
23
|
+
- Registering custom message types
|
|
24
|
+
- Understanding the data flow from DataSource → Repository → ViewModel
|
|
25
|
+
|
|
26
|
+
## Do not use this skill when
|
|
27
|
+
|
|
28
|
+
- Customizing UI/bubble rendering (use `cometchat-*-customization` — that's the BubbleFactory layer)
|
|
29
|
+
- Working with component APIs (use `cometchat-*-components`)
|
|
30
|
+
|
|
31
|
+
## 1. Clean Architecture Overview
|
|
32
|
+
|
|
33
|
+
The `chatuikit-core` module follows clean architecture with three layers:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
┌─────────────────────────────────────────┐
|
|
37
|
+
│ UI Layer (chatuikit-kotlin / compose) │
|
|
38
|
+
│ Components observe ViewModel state │
|
|
39
|
+
├─────────────────────────────────────────┤
|
|
40
|
+
│ ViewModel Layer (core/viewmodel/) │
|
|
41
|
+
│ Calls use cases / repositories │
|
|
42
|
+
├─────────────────────────────────────────┤
|
|
43
|
+
│ Domain Layer (core/domain/) │
|
|
44
|
+
│ Repository interfaces, Use cases │
|
|
45
|
+
├─────────────────────────────────────────┤
|
|
46
|
+
│ Data Layer (core/data/) │
|
|
47
|
+
│ DataSource interfaces + impls │
|
|
48
|
+
│ Repository implementations │
|
|
49
|
+
└─────────────────────────────────────────┘
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 2. DataSource Pattern
|
|
53
|
+
|
|
54
|
+
Each feature area has a DataSource interface and default implementation:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
core/data/datasource/
|
|
58
|
+
├── ConversationListDataSource.kt (interface)
|
|
59
|
+
├── ConversationListDataSourceImpl.kt (default implementation)
|
|
60
|
+
├── MessageListDataSource.kt
|
|
61
|
+
├── MessageListDataSourceImpl.kt
|
|
62
|
+
├── ...
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2.1 All DataSource Types
|
|
66
|
+
|
|
67
|
+
| DataSource | Implementation | What it provides |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| `CallButtonsDataSource` | `CallButtonsDataSourceImpl` | Call button actions |
|
|
70
|
+
| `CallLogsDataSource` | `CallLogsDataSourceImpl` | Call history fetching |
|
|
71
|
+
| `CollaborativeDataSource` | `CollaborativeDataSourceImpl` | Document/whiteboard data |
|
|
72
|
+
| `ConversationListDataSource` | `ConversationListDataSourceImpl` | Conversation list fetching |
|
|
73
|
+
| `GroupMembersDataSource` | `GroupMembersDataSourceImpl` | Group member operations |
|
|
74
|
+
| `GroupsDataSource` | `GroupsDataSourceImpl` | Group list fetching |
|
|
75
|
+
| `MessageComposerDataSource` | `MessageComposerDataSourceImpl` | Composer actions/attachments |
|
|
76
|
+
| `MessageHeaderDataSource` | `MessageHeaderDataSourceImpl` | Header data (name, status) |
|
|
77
|
+
| `MessageInformationDataSource` | `MessageInformationDataSourceImpl` | Read receipts, delivery info |
|
|
78
|
+
| `MessageListDataSource` | `MessageListDataSourceImpl` | Message fetching/pagination |
|
|
79
|
+
| `PollDataSource` | `PollDataSourceImpl` | Poll creation/voting |
|
|
80
|
+
| `ReactionListDataSource` | `ReactionListDataSourceImpl` | Reaction data |
|
|
81
|
+
| `SearchDataSource` | `SearchDataSourceImpl` | Global search |
|
|
82
|
+
| `StickerDataSource` | `StickerDataSourceImpl` | Sticker fetching |
|
|
83
|
+
| `UsersDataSource` | `UsersDataSourceImpl` | User list fetching |
|
|
84
|
+
|
|
85
|
+
### 2.2 Additional DataSource
|
|
86
|
+
|
|
87
|
+
| File | Purpose |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `MessageReceiptEventListener.kt` | Listens for receipt events at the data layer |
|
|
90
|
+
|
|
91
|
+
## 3. Repository Pattern
|
|
92
|
+
|
|
93
|
+
Repositories in `core/data/repository/` implement domain interfaces from `core/domain/repository/`:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
core/data/repository/
|
|
97
|
+
├── CallButtonsRepositoryImpl.kt
|
|
98
|
+
├── CallLogsRepositoryImpl.kt
|
|
99
|
+
├── ConversationListRepositoryImpl.kt
|
|
100
|
+
├── GroupMembersRepositoryImpl.kt
|
|
101
|
+
├── GroupsRepositoryImpl.kt
|
|
102
|
+
├── MessageComposerRepositoryImpl.kt
|
|
103
|
+
├── MessageHeaderRepositoryImpl.kt
|
|
104
|
+
├── MessageInformationRepositoryImpl.kt
|
|
105
|
+
├── MessageListRepositoryImpl.kt
|
|
106
|
+
├── PollRepositoryImpl.kt
|
|
107
|
+
├── ReactionListRepositoryImpl.kt
|
|
108
|
+
├── SearchRepositoryImpl.kt
|
|
109
|
+
├── StickerRepositoryImpl.kt
|
|
110
|
+
├── UsersRepositoryImpl.kt
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Each repository wraps a DataSource and adds business logic, caching, or transformation.
|
|
114
|
+
|
|
115
|
+
## 4. ViewModel Layer
|
|
116
|
+
|
|
117
|
+
ViewModels in `core/viewmodel/` consume repositories and expose UI state:
|
|
118
|
+
|
|
119
|
+
```kotlin
|
|
120
|
+
// Example: CometChatConversationsViewModel
|
|
121
|
+
// - Injected via CometChatConversationsViewModelFactory
|
|
122
|
+
// - Exposes StateFlow<ConversationListUIState>
|
|
123
|
+
// - Calls ConversationListRepositoryImpl internally
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
ViewModel factories in `core/factory/` handle dependency injection:
|
|
127
|
+
|
|
128
|
+
| Factory | ViewModel |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `CometChatConversationsViewModelFactory` | `CometChatConversationsViewModel` |
|
|
131
|
+
| `CometChatMessageListViewModelFactory` | `CometChatMessageListViewModel` |
|
|
132
|
+
| `CometChatGroupsViewModelFactory` | `CometChatGroupsViewModel` |
|
|
133
|
+
| `CometChatUsersViewModelFactory` | `CometChatUsersViewModel` |
|
|
134
|
+
| `CometChatCallLogsViewModelFactory` | `CometChatCallLogsViewModel` |
|
|
135
|
+
| `CometChatMessageComposerViewModelFactory` | `CometChatMessageComposerViewModel` |
|
|
136
|
+
| `CometChatMessageHeaderViewModelFactory` | `CometChatMessageHeaderViewModel` |
|
|
137
|
+
| `CometChatGroupMembersViewModelFactory` | `CometChatGroupMembersViewModel` |
|
|
138
|
+
| `CometChatMessageInformationViewModelFactory` | `CometChatMessageInformationViewModel` |
|
|
139
|
+
| `CometChatReactionListViewModelFactory` | `CometChatReactionListViewModel` |
|
|
140
|
+
| `CometChatSearchViewModelFactory` | `CometChatSearchViewModel` |
|
|
141
|
+
| `CometChatCallButtonsViewModelFactory` | `CometChatCallButtonsViewModel` |
|
|
142
|
+
| `CometChatCreatePollViewModelFactory` | `CometChatCreatePollViewModel` |
|
|
143
|
+
| `CometChatThreadHeaderViewModelFactory` | `CometChatThreadHeaderViewModel` |
|
|
144
|
+
| `CometChatStickerKeyboardViewModelFactory` | `CometChatStickerKeyboardViewModel` |
|
|
145
|
+
| `CometChatIncomingCallViewModelFactory` | `CometChatIncomingCallViewModel` |
|
|
146
|
+
| `CometChatOutgoingCallViewModelFactory` | `CometChatOutgoingCallViewModel` |
|
|
147
|
+
| `CometChatAIAssistantChatHistoryViewModelFactory` | `CometChatAIAssistantChatHistoryViewModel` |
|
|
148
|
+
|
|
149
|
+
## 5. UI State Classes
|
|
150
|
+
|
|
151
|
+
Each ViewModel exposes a sealed UI state from `core/state/`:
|
|
152
|
+
|
|
153
|
+
| State Class | Used By |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `CallLogsUIState` | Call logs |
|
|
156
|
+
| `MessageListUIState` | Message list |
|
|
157
|
+
| `GroupsUIState` | Groups list |
|
|
158
|
+
| `UsersUIState` | Users list |
|
|
159
|
+
| `GroupMembersUIState` | Group members |
|
|
160
|
+
| `MessageComposerUIState` | Composer |
|
|
161
|
+
| `MessageHeaderUIState` | Header |
|
|
162
|
+
| `MessageInformationUIState` | Message info |
|
|
163
|
+
| `ReactionListUIState` | Reactions |
|
|
164
|
+
| `SearchUIState` | Search |
|
|
165
|
+
| `CallButtonsUIState` | Call buttons |
|
|
166
|
+
| `CreatePollUIState` | Poll creation |
|
|
167
|
+
| `ThreadHeaderUIState` | Thread header |
|
|
168
|
+
| `StickerKeyboardUIState` | Sticker keyboard |
|
|
169
|
+
| `IncomingCallUIState` | Incoming call |
|
|
170
|
+
| `OutgoingCallUIState` | Outgoing call |
|
|
171
|
+
| `ChatHistoryUIState` | AI chat history |
|
|
172
|
+
| `ConversationStarterUIState` | AI conversation starter |
|
|
173
|
+
| `ConversationSummaryUIState` | AI conversation summary |
|
|
174
|
+
| `SmartRepliesUIState` | AI smart replies |
|
|
175
|
+
| `DeleteState` | Delete operations |
|
|
176
|
+
| `UIState` | Base UI state |
|
|
177
|
+
|
|
178
|
+
## 6. Data Flow
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
User Action → Component → ViewModel → Repository → DataSource → CometChat SDK
|
|
182
|
+
↓
|
|
183
|
+
UI Update ← Component ← ViewModel ← StateFlow ← Repository ← SDK Response
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Hard rules
|
|
187
|
+
|
|
188
|
+
- DataSources are the DATA layer — they fetch and mutate data. Do NOT confuse with BubbleFactory which is the UI rendering layer
|
|
189
|
+
- The v5 `DataSource` decorator / `ChatConfigurator` pattern for bubble customization does NOT exist in v6 — use BubbleFactory instead (see `cometchat-*-customization`)
|
|
190
|
+
- ViewModels are shared across both UI stacks (Kotlin Views and Compose) — they live in `chatuikit-core`
|
|
191
|
+
- Always use the provided ViewModel factories — do not instantiate ViewModels directly
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v6-features
|
|
3
|
+
description: "CometChat Android UIKit v6 feature catalog — AI features, reactions, polls, stickers, moderation, collaborative, and media features"
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
+
allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
|
|
7
|
+
metadata:
|
|
8
|
+
author: "CometChat"
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
tags: "cometchat, android, features, ai, reactions, polls, stickers, moderation"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
> **Companion skills:** cometchat-android-v6-kotlin-components, cometchat-android-v6-compose-components, cometchat-android-v6-extensions (DataSource pattern), cometchat-android-v6-events
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Catalog of all features available in CometChat UIKit v6, how they map to components and DataSources, and how to enable/disable them.
|
|
18
|
+
|
|
19
|
+
## Use this skill when
|
|
20
|
+
|
|
21
|
+
- Enabling or disabling specific features (AI, reactions, polls, stickers)
|
|
22
|
+
- Understanding what features are available out of the box
|
|
23
|
+
- Mapping a feature to its component and DataSource
|
|
24
|
+
|
|
25
|
+
## Do not use this skill when
|
|
26
|
+
|
|
27
|
+
- Working with component APIs directly (use `cometchat-*-components`)
|
|
28
|
+
- Customizing bubble rendering (use `cometchat-*-customization`)
|
|
29
|
+
|
|
30
|
+
## 1. AI Features
|
|
31
|
+
|
|
32
|
+
AI features need an OpenAI API key on the app's AI settings. Enable each one with the CLI in stateless mode (Android projects don't write `.cometchat/state.json`):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cometchat apply-feature smart-replies --app-id <your-app-id> --openai-key sk-...
|
|
36
|
+
cometchat apply-feature conversation-summary --app-id <your-app-id>
|
|
37
|
+
cometchat apply-feature conversation-starter --app-id <your-app-id>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The OpenAI key is stored on the app once, so subsequent ai-feature applies don't need `--openai-key` repeated. Requires `cometchat auth login` once per machine.
|
|
41
|
+
|
|
42
|
+
| Feature | Compose Component | Core DataSource | Description |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| AI Assistant Chat History | `CometChatAIAssistantChatHistory` | — | Shows AI bot conversation history |
|
|
45
|
+
| AI Conversation Starter | Shared element in `presentation/shared/aiconversationstarter/` | — | Suggests conversation starters |
|
|
46
|
+
| AI Conversation Summary | Shared element in `presentation/shared/aiconversationsummary/` | — | Summarizes long conversations |
|
|
47
|
+
| AI Smart Replies | Shared element in `presentation/shared/aismartreplies/` | — | Suggests contextual replies |
|
|
48
|
+
|
|
49
|
+
AI features integrate with `CometChatMessageList` via the `smartRepliesView` slot and AI-specific parameters.
|
|
50
|
+
|
|
51
|
+
The `CometChatAIStreamService` in `chatuikit-core` handles streaming AI responses.
|
|
52
|
+
|
|
53
|
+
## 2. Reactions
|
|
54
|
+
|
|
55
|
+
| Feature | Component | DataSource | Description |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| Reaction List | `CometChatReactionList` | `ReactionListDataSource` | Shows who reacted with what |
|
|
58
|
+
| Add Reaction | Shared element in `presentation/shared/reaction/` | — | Emoji picker for adding reactions |
|
|
59
|
+
|
|
60
|
+
Reactions appear in the **footer slot** of message bubbles. Reaction events flow through `CometChatEvents.messageEvents`.
|
|
61
|
+
|
|
62
|
+
## 3. Polls
|
|
63
|
+
|
|
64
|
+
| Feature | Component | DataSource | Description |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| Create Poll | `CometChatCreatePoll` (Compose) | `PollDataSource` | Create a new poll |
|
|
67
|
+
| Poll Bubble | Shared element in `presentation/shared/` | `PollDataSourceImpl` | Renders poll in message list |
|
|
68
|
+
|
|
69
|
+
Polls are custom messages with type `extension_poll`. The `PollRepositoryImpl` handles vote submission.
|
|
70
|
+
|
|
71
|
+
## 4. Stickers
|
|
72
|
+
|
|
73
|
+
| Feature | Component | DataSource | Description |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| Sticker Keyboard | `CometChatStickerKeyboard` | `StickerDataSource` | Browse and send stickers |
|
|
76
|
+
| Sticker Bubble | `stickerbubble/` (Kotlin Views) | `StickerDataSourceImpl` | Renders sticker in message list |
|
|
77
|
+
|
|
78
|
+
Stickers integrate with `CometChatMessageComposer` as an auxiliary input.
|
|
79
|
+
|
|
80
|
+
## 5. Moderation
|
|
81
|
+
|
|
82
|
+
| Feature | Component | Description |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| Report/Flag Message | `CometChatFlagMessageDialog` (Views) / `CometChatFlagMessageDialog` (Compose) | Report inappropriate messages |
|
|
85
|
+
|
|
86
|
+
Moderation views appear in the **bottom slot** of message bubbles when moderation is enabled.
|
|
87
|
+
|
|
88
|
+
## 6. Collaborative Features
|
|
89
|
+
|
|
90
|
+
| Feature | DataSource | Description |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| Collaborative Document | `CollaborativeDataSource` | Real-time document editing |
|
|
93
|
+
| Collaborative Whiteboard | `CollaborativeDataSourceImpl` | Real-time whiteboard |
|
|
94
|
+
|
|
95
|
+
## 7. Media Features
|
|
96
|
+
|
|
97
|
+
| Feature | Component | Description |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| Image Viewer | `CometChatImageViewerScreen` (Compose) | Full-screen image viewing with zoom |
|
|
100
|
+
| Media Recorder | Shared element in `presentation/shared/mediarecorder/` | Audio/video recording |
|
|
101
|
+
| Inline Audio Recorder | Shared element in `presentation/shared/inlineaudiorecorder/` | In-composer audio recording |
|
|
102
|
+
| Media Selection | Shared element in `presentation/shared/mediaselection/` | Photo/video picker |
|
|
103
|
+
|
|
104
|
+
## 8. Feature-to-DataSource Mapping
|
|
105
|
+
|
|
106
|
+
All DataSources live in `chatuikit-core/data/datasource/`:
|
|
107
|
+
|
|
108
|
+
| DataSource Interface | Implementation | Feature Area |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `CallButtonsDataSource` | `CallButtonsDataSourceImpl` | Audio/video call buttons |
|
|
111
|
+
| `CallLogsDataSource` | `CallLogsDataSourceImpl` | Call history |
|
|
112
|
+
| `CollaborativeDataSource` | `CollaborativeDataSourceImpl` | Documents/whiteboards |
|
|
113
|
+
| `ConversationListDataSource` | `ConversationListDataSourceImpl` | Conversation list |
|
|
114
|
+
| `GroupMembersDataSource` | `GroupMembersDataSourceImpl` | Group member management |
|
|
115
|
+
| `GroupsDataSource` | `GroupsDataSourceImpl` | Group list |
|
|
116
|
+
| `MessageComposerDataSource` | `MessageComposerDataSourceImpl` | Message input |
|
|
117
|
+
| `MessageHeaderDataSource` | `MessageHeaderDataSourceImpl` | Chat header |
|
|
118
|
+
| `MessageInformationDataSource` | `MessageInformationDataSourceImpl` | Message info/receipts |
|
|
119
|
+
| `MessageListDataSource` | `MessageListDataSourceImpl` | Message list |
|
|
120
|
+
| `PollDataSource` | `PollDataSourceImpl` | Polls |
|
|
121
|
+
| `ReactionListDataSource` | `ReactionListDataSourceImpl` | Reactions |
|
|
122
|
+
| `SearchDataSource` | `SearchDataSourceImpl` | Global search |
|
|
123
|
+
| `StickerDataSource` | `StickerDataSourceImpl` | Stickers |
|
|
124
|
+
| `UsersDataSource` | `UsersDataSourceImpl` | User list |
|
|
125
|
+
|
|
126
|
+
## Hard rules
|
|
127
|
+
|
|
128
|
+
- AI features require dashboard configuration — they cannot be enabled purely from client code
|
|
129
|
+
- Polls and stickers are custom message types — they require the corresponding extensions enabled on the dashboard
|
|
130
|
+
- Do NOT confuse DataSources (data layer in core) with BubbleFactory (UI layer in kotlin/compose) — DataSources fetch data, BubbleFactories render bubbles
|