@futdevpro/fsm-dynamo 1.14.14 → 1.14.16
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/build/_collections/utils/log.util.js +10 -10
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/log.util.spec.js +36 -36
- package/build/_collections/utils/log.util.spec.js.map +1 -1
- package/build/_collections/utils/object.util.d.ts +6 -3
- package/build/_collections/utils/object.util.d.ts.map +1 -1
- package/build/_collections/utils/object.util.js +21 -0
- package/build/_collections/utils/object.util.js.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.js +1 -0
- package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/build/_models/control-models/error.control-model.d.ts.map +1 -1
- package/build/_models/control-models/error.control-model.js +11 -0
- package/build/_models/control-models/error.control-model.js.map +1 -1
- package/build/_modules/messaging/_enums/msg-provider-type.enum.d.ts +8 -0
- package/build/_modules/messaging/_enums/msg-provider-type.enum.d.ts.map +1 -0
- package/build/_modules/messaging/_enums/msg-provider-type.enum.js +12 -0
- package/build/_modules/messaging/_enums/msg-provider-type.enum.js.map +1 -0
- package/build/_modules/messaging/index.d.ts +1 -0
- package/build/_modules/messaging/index.d.ts.map +1 -1
- package/build/_modules/messaging/index.js +1 -0
- package/build/_modules/messaging/index.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.14.16.tgz +0 -0
- package/package.json +3 -3
- package/src/_collections/utils/log.util.spec.ts +39 -39
- package/src/_collections/utils/log.util.ts +10 -10
- package/src/_collections/utils/object.util.ts +27 -1
- package/src/_models/control-models/data-property-params.control-model.ts +1 -0
- package/src/_models/control-models/error.control-model.ts +12 -0
- package/src/_modules/messaging/README.md +279 -0
- package/src/_modules/messaging/_enums/msg-provider-type.enum.ts +7 -0
- package/src/_modules/messaging/index.ts +1 -0
- package/futdevpro-fsm-dynamo-01.14.14.tgz +0 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# Dynamo FSM Messaging Module [DyFM-MSG]
|
|
2
|
+
|
|
3
|
+
TODO: The Entire Messaging system is AI generated, therefore we need to clean it up, and remove the unnecessary elements
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Messaging module provides a unified messaging system for user↔user and user↔AI communication across all Dynamo Systems. It serves as the foundation for messaging functionality by defining core data models, enums, and interfaces that are shared across Dynamo packages (FSM, NTS, NGX).
|
|
8
|
+
|
|
9
|
+
This module follows a **model-first approach**, providing type-safe interfaces and data models for the entire messaging infrastructure.
|
|
10
|
+
|
|
11
|
+
## Import
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import * from '@futdevpro/fsm-dynamo/messaging';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Key Features
|
|
18
|
+
|
|
19
|
+
- **Unified Message Schema**: Single core for user↔user and user↔Assistant/Agent messaging
|
|
20
|
+
- **Real-time Communication**: Socket-based event handling for live updates
|
|
21
|
+
- **Agent Integration**: Support for AI agent process visualization and reasoning
|
|
22
|
+
- **Message Types**: Text, attachments, reactions, mentions, threads
|
|
23
|
+
- **Conversation Management**: Direct, group, assistant chat, agent process, channel conversations
|
|
24
|
+
- **Participant Roles**: Owner, admin, member, viewer with permission management
|
|
25
|
+
- **Message Status Tracking**: Draft, sending, sent, delivered, read, failed, deleted
|
|
26
|
+
- **Attachment Support**: Images, videos, documents, audio, files
|
|
27
|
+
- **Reaction System**: Emoji-based message reactions
|
|
28
|
+
- **Thread Support**: Reply chains and conversation threading
|
|
29
|
+
- **Agent Process Visualization**: Step-by-step AI reasoning display
|
|
30
|
+
|
|
31
|
+
## Architecture
|
|
32
|
+
|
|
33
|
+
The messaging module is organized into:
|
|
34
|
+
|
|
35
|
+
- **Enums**: Type definitions and status enumerations
|
|
36
|
+
- **Models**: Data models and interfaces
|
|
37
|
+
- **Collections**: Module settings and constants
|
|
38
|
+
- **Agent Module**: AI agent process tracking sub-module
|
|
39
|
+
|
|
40
|
+
## Enums
|
|
41
|
+
|
|
42
|
+
### `DyFM_Msg_Type`
|
|
43
|
+
Defines message types:
|
|
44
|
+
- `text` - Regular text message
|
|
45
|
+
- `userToUser` - User-to-user message
|
|
46
|
+
- `userToAi` - User-to-AI message
|
|
47
|
+
- `aiToUser` - AI-to-user message
|
|
48
|
+
- `system` - System-generated message
|
|
49
|
+
- `agentProcess` - Agent process message
|
|
50
|
+
|
|
51
|
+
### `DyFM_Msg_Status`
|
|
52
|
+
Message status lifecycle:
|
|
53
|
+
- `draft` - Message is being drafted
|
|
54
|
+
- `sending` - Message is being sent
|
|
55
|
+
- `sent` - Message was sent successfully
|
|
56
|
+
- `delivered` - Message was delivered to recipient(s)
|
|
57
|
+
- `read` - Message was read by recipient(s)
|
|
58
|
+
- `failed` - Message sending failed
|
|
59
|
+
- `deleted` - Message was deleted
|
|
60
|
+
|
|
61
|
+
### `DyFM_Msg_ConversationType`
|
|
62
|
+
Conversation type definitions:
|
|
63
|
+
- `direct` - One-on-one conversation
|
|
64
|
+
- `group` - Group conversation
|
|
65
|
+
- `assistantChat` - Conversation with AI assistant
|
|
66
|
+
- `agentProcess` - Agent process conversation
|
|
67
|
+
- `channel` - Channel-based conversation
|
|
68
|
+
|
|
69
|
+
### `DyFM_Msg_ParticipantRole`
|
|
70
|
+
Participant role hierarchy:
|
|
71
|
+
- `owner` - Conversation owner
|
|
72
|
+
- `admin` - Conversation administrator
|
|
73
|
+
- `member` - Regular member
|
|
74
|
+
- `viewer` - Read-only viewer
|
|
75
|
+
|
|
76
|
+
### `DyFM_Msg_AttachmentType`
|
|
77
|
+
Attachment type definitions:
|
|
78
|
+
- `image` - Image attachments
|
|
79
|
+
- `video` - Video attachments
|
|
80
|
+
- `document` - Document attachments
|
|
81
|
+
- `audio` - Audio file attachments
|
|
82
|
+
- `file` - Generic file attachments
|
|
83
|
+
|
|
84
|
+
### `DyFM_Msg_EventKey`
|
|
85
|
+
Socket event keys for real-time communication:
|
|
86
|
+
- `messageSent` - New message sent
|
|
87
|
+
- `messageUpdated` - Message updated
|
|
88
|
+
- `messageDeleted` - Message deleted
|
|
89
|
+
- `messageRead` - Message read
|
|
90
|
+
- `typingStart` - User started typing
|
|
91
|
+
- `typingStop` - User stopped typing
|
|
92
|
+
- `reactionAdded` - Reaction added to message
|
|
93
|
+
- `reactionRemoved` - Reaction removed from message
|
|
94
|
+
- `conversationCreated` - New conversation created
|
|
95
|
+
- `conversationUpdated` - Conversation updated
|
|
96
|
+
- `conversationDeleted` - Conversation deleted
|
|
97
|
+
- `participantAdded` - Participant added
|
|
98
|
+
- `participantRemoved` - Participant removed
|
|
99
|
+
|
|
100
|
+
## Models
|
|
101
|
+
|
|
102
|
+
### `DyFM_Msg_Message`
|
|
103
|
+
Core message data model with comprehensive message properties:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
class DyFM_Msg_Message extends DyFM_Metadata {
|
|
107
|
+
conversationId: string;
|
|
108
|
+
content: string;
|
|
109
|
+
type: DyFM_Msg_Type;
|
|
110
|
+
status: DyFM_Msg_Status;
|
|
111
|
+
senderId: string;
|
|
112
|
+
senderName?: string;
|
|
113
|
+
senderDisplayName?: string;
|
|
114
|
+
recipientIds?: string[];
|
|
115
|
+
parentMessageId?: string;
|
|
116
|
+
threadId?: string;
|
|
117
|
+
threadInfo?: DyFM_Msg_ThreadInfo;
|
|
118
|
+
attachments?: DyFM_Msg_Attachment[];
|
|
119
|
+
mentions?: DyFM_Msg_Mention[];
|
|
120
|
+
reactions?: DyFM_Msg_Reaction[];
|
|
121
|
+
aiProvider?: string;
|
|
122
|
+
aiModel?: string;
|
|
123
|
+
isAIGenerated?: boolean;
|
|
124
|
+
systemPrompt?: string;
|
|
125
|
+
agentProcessSteps?: DyFM_Agt_ProcessStep[];
|
|
126
|
+
platformSource?: string;
|
|
127
|
+
platformMessageId?: string;
|
|
128
|
+
deliveryStatus?: DyFM_Msg_DeliveryStatus;
|
|
129
|
+
// ... metadata fields
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `DyFM_Msg_Conversation`
|
|
134
|
+
Conversation data model:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
class DyFM_Msg_Conversation extends DyFM_Metadata {
|
|
138
|
+
type: DyFM_Msg_ConversationType;
|
|
139
|
+
name?: string;
|
|
140
|
+
participants: DyFM_Msg_Participant[];
|
|
141
|
+
lastMessage?: {
|
|
142
|
+
messageId: string;
|
|
143
|
+
content: string;
|
|
144
|
+
sentAt: Date;
|
|
145
|
+
senderId: string;
|
|
146
|
+
};
|
|
147
|
+
lastReadByUser?: Record<string, Date>;
|
|
148
|
+
// ... metadata fields
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### `DyFM_Msg_Participant`
|
|
153
|
+
Participant interface:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
interface DyFM_Msg_Participant {
|
|
157
|
+
userId: string;
|
|
158
|
+
role: DyFM_Msg_ParticipantRole;
|
|
159
|
+
joinedAt: Date;
|
|
160
|
+
leftAt?: Date;
|
|
161
|
+
isMuted?: boolean;
|
|
162
|
+
isArchived?: boolean;
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### `DyFM_Msg_Attachment`
|
|
167
|
+
Attachment interface:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
interface DyFM_Msg_Attachment {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
type: DyFM_Msg_AttachmentType;
|
|
174
|
+
url: string;
|
|
175
|
+
size?: number;
|
|
176
|
+
mimeType?: string;
|
|
177
|
+
thumbnailUrl?: string;
|
|
178
|
+
uploadedAt: Date;
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### `DyFM_Msg_Reaction`
|
|
183
|
+
Reaction interface:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
interface DyFM_Msg_Reaction {
|
|
187
|
+
emoji: string;
|
|
188
|
+
userId: string;
|
|
189
|
+
reactedAt: Date;
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### `DyFM_Msg_Mention`
|
|
194
|
+
Mention interface:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
interface DyFM_Msg_Mention {
|
|
198
|
+
userId: string;
|
|
199
|
+
username?: string;
|
|
200
|
+
offset: number;
|
|
201
|
+
length: number;
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### `DyFM_Msg_ThreadInfo`
|
|
206
|
+
Thread information interface:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
interface DyFM_Msg_ThreadInfo {
|
|
210
|
+
threadId: string;
|
|
211
|
+
replyCount: number;
|
|
212
|
+
lastReplyAt?: Date;
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Agent Module
|
|
217
|
+
|
|
218
|
+
The agent sub-module provides AI agent process tracking:
|
|
219
|
+
|
|
220
|
+
### Enums
|
|
221
|
+
|
|
222
|
+
- `DyFM_Agt_ProcessStepType` - Agent process step types
|
|
223
|
+
- `DyFM_Agt_ToolStatus` - Tool usage status
|
|
224
|
+
|
|
225
|
+
### Interfaces
|
|
226
|
+
|
|
227
|
+
- `DyFM_Agt_ProcessStep` - Agent reasoning step
|
|
228
|
+
- `DyFM_Agt_ReasoningInfo` - AI reasoning information
|
|
229
|
+
- `DyFM_Agt_ToolUsage` - Tool usage tracking
|
|
230
|
+
|
|
231
|
+
## Usage Examples
|
|
232
|
+
|
|
233
|
+
### Creating a Message Model
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
import { DyFM_Msg_Message, DyFM_Msg_Type, DyFM_Msg_Status } from '@futdevpro/fsm-dynamo/messaging';
|
|
237
|
+
|
|
238
|
+
const message = new DyFM_Msg_Message({
|
|
239
|
+
conversationId: 'conv-123',
|
|
240
|
+
senderId: 'user-456',
|
|
241
|
+
content: 'Hello, world!',
|
|
242
|
+
type: DyFM_Msg_Type.text,
|
|
243
|
+
status: DyFM_Msg_Status.draft,
|
|
244
|
+
sentAt: new Date(),
|
|
245
|
+
__createdBy: 'user-456',
|
|
246
|
+
});
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Creating a Conversation Model
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { DyFM_Msg_Conversation, DyFM_Msg_ConversationType } from '@futdevpro/fsm-dynamo/messaging';
|
|
253
|
+
|
|
254
|
+
const conversation = new DyFM_Msg_Conversation({
|
|
255
|
+
type: DyFM_Msg_ConversationType.direct,
|
|
256
|
+
participants: [
|
|
257
|
+
{ userId: 'user-123', role: DyFM_Msg_ParticipantRole.member, joinedAt: new Date() },
|
|
258
|
+
{ userId: 'user-456', role: DyFM_Msg_ParticipantRole.member, joinedAt: new Date() }
|
|
259
|
+
],
|
|
260
|
+
__createdBy: 'user-123',
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Integration
|
|
265
|
+
|
|
266
|
+
This FSM module provides the foundation for:
|
|
267
|
+
|
|
268
|
+
- **Dynamo NTS**: Backend implementation using these models
|
|
269
|
+
- **Dynamo NGX**: Frontend Angular components using these types
|
|
270
|
+
- **Bot Module**: Integration with bot providers
|
|
271
|
+
- **Assistant Module**: AI assistant workflows
|
|
272
|
+
|
|
273
|
+
All Dynamo packages import and extend these models for their specific implementations.
|
|
274
|
+
|
|
275
|
+
## Related Documentation
|
|
276
|
+
|
|
277
|
+
- [Dynamo NTS Messaging Module](../dynamo-nts/messaging/README.md)
|
|
278
|
+
- [Dynamo NGX Messaging Module](../dynamo-ngx/messaging/README.md)
|
|
279
|
+
- [Messaging System Architecture](../../../specifications/messaging-system-architecture.md)
|
|
@@ -11,6 +11,7 @@ export * from './_enums/msg-status.enum';
|
|
|
11
11
|
export * from './_enums/msg-delivery-status.enum';
|
|
12
12
|
export * from './_enums/msg-conversation-type.enum';
|
|
13
13
|
export * from './_enums/msg-participant-role.enum';
|
|
14
|
+
export * from './_enums/msg-provider-type.enum';
|
|
14
15
|
export * from './_enums/msg-attachment-type.enum';
|
|
15
16
|
export * from './_enums/msg-event-key.enum';
|
|
16
17
|
|
|
Binary file
|