@happyvertical/smrt-chat 0.30.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.
Files changed (169) hide show
  1. package/AGENTS.md +35 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +163 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/chunks/ChatService-Dpzc1Pa5.js +2044 -0
  8. package/dist/chunks/ChatService-Dpzc1Pa5.js.map +1 -0
  9. package/dist/collections/AgentSessionCollection.d.ts +57 -0
  10. package/dist/collections/AgentSessionCollection.d.ts.map +1 -0
  11. package/dist/collections/ChatMessageCollection.d.ts +79 -0
  12. package/dist/collections/ChatMessageCollection.d.ts.map +1 -0
  13. package/dist/collections/ChatParticipantCollection.d.ts +26 -0
  14. package/dist/collections/ChatParticipantCollection.d.ts.map +1 -0
  15. package/dist/collections/ChatReactionCollection.d.ts +23 -0
  16. package/dist/collections/ChatReactionCollection.d.ts.map +1 -0
  17. package/dist/collections/ChatRoomCollection.d.ts +43 -0
  18. package/dist/collections/ChatRoomCollection.d.ts.map +1 -0
  19. package/dist/collections/ChatThreadCollection.d.ts +9 -0
  20. package/dist/collections/ChatThreadCollection.d.ts.map +1 -0
  21. package/dist/index.d.ts +5 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +18 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/internal/agent-runtime.d.ts +16 -0
  26. package/dist/internal/agent-runtime.d.ts.map +1 -0
  27. package/dist/internal/agent-runtime.js +5 -0
  28. package/dist/internal/agent-runtime.js.map +1 -0
  29. package/dist/manifest.json +2811 -0
  30. package/dist/models/AgentSession.d.ts +70 -0
  31. package/dist/models/AgentSession.d.ts.map +1 -0
  32. package/dist/models/ChatMessage.d.ts +55 -0
  33. package/dist/models/ChatMessage.d.ts.map +1 -0
  34. package/dist/models/ChatParticipant.d.ts +32 -0
  35. package/dist/models/ChatParticipant.d.ts.map +1 -0
  36. package/dist/models/ChatReaction.d.ts +19 -0
  37. package/dist/models/ChatReaction.d.ts.map +1 -0
  38. package/dist/models/ChatRoom.d.ts +44 -0
  39. package/dist/models/ChatRoom.d.ts.map +1 -0
  40. package/dist/models/ChatThread.d.ts +24 -0
  41. package/dist/models/ChatThread.d.ts.map +1 -0
  42. package/dist/models/index.d.ts +7 -0
  43. package/dist/models/index.d.ts.map +1 -0
  44. package/dist/playground.d.ts +2 -0
  45. package/dist/playground.d.ts.map +1 -0
  46. package/dist/playground.js +166 -0
  47. package/dist/playground.js.map +1 -0
  48. package/dist/services/ChatService.d.ts +390 -0
  49. package/dist/services/ChatService.d.ts.map +1 -0
  50. package/dist/services/index.d.ts +2 -0
  51. package/dist/services/index.d.ts.map +1 -0
  52. package/dist/smrt-knowledge.json +1507 -0
  53. package/dist/svelte/components/agent/AgentChat.svelte +542 -0
  54. package/dist/svelte/components/agent/AgentChat.svelte.d.ts +21 -0
  55. package/dist/svelte/components/agent/AgentChat.svelte.d.ts.map +1 -0
  56. package/dist/svelte/components/agent/AgentSelector.svelte +175 -0
  57. package/dist/svelte/components/agent/AgentSelector.svelte.d.ts +11 -0
  58. package/dist/svelte/components/agent/AgentSelector.svelte.d.ts.map +1 -0
  59. package/dist/svelte/components/agent/AgentSessionPanel.svelte +322 -0
  60. package/dist/svelte/components/agent/AgentSessionPanel.svelte.d.ts +15 -0
  61. package/dist/svelte/components/agent/AgentSessionPanel.svelte.d.ts.map +1 -0
  62. package/dist/svelte/components/agent/ToolCallDisplay.svelte +335 -0
  63. package/dist/svelte/components/agent/ToolCallDisplay.svelte.d.ts +9 -0
  64. package/dist/svelte/components/agent/ToolCallDisplay.svelte.d.ts.map +1 -0
  65. package/dist/svelte/components/agent/message-blocks.d.ts +12 -0
  66. package/dist/svelte/components/agent/message-blocks.d.ts.map +1 -0
  67. package/dist/svelte/components/agent/message-blocks.js +41 -0
  68. package/dist/svelte/components/agent/message-blocks.test.js +31 -0
  69. package/dist/svelte/components/dialogs/RoomCreateDialog.svelte +403 -0
  70. package/dist/svelte/components/dialogs/RoomCreateDialog.svelte.d.ts +16 -0
  71. package/dist/svelte/components/dialogs/RoomCreateDialog.svelte.d.ts.map +1 -0
  72. package/dist/svelte/components/dialogs/SearchMessages.svelte +457 -0
  73. package/dist/svelte/components/dialogs/SearchMessages.svelte.d.ts +17 -0
  74. package/dist/svelte/components/dialogs/SearchMessages.svelte.d.ts.map +1 -0
  75. package/dist/svelte/components/layout/ChatLayout.svelte +150 -0
  76. package/dist/svelte/components/layout/ChatLayout.svelte.d.ts +18 -0
  77. package/dist/svelte/components/layout/ChatLayout.svelte.d.ts.map +1 -0
  78. package/dist/svelte/components/layout/MemberList.svelte +389 -0
  79. package/dist/svelte/components/layout/MemberList.svelte.d.ts +11 -0
  80. package/dist/svelte/components/layout/MemberList.svelte.d.ts.map +1 -0
  81. package/dist/svelte/components/layout/RoomHeader.svelte +241 -0
  82. package/dist/svelte/components/layout/RoomHeader.svelte.d.ts +15 -0
  83. package/dist/svelte/components/layout/RoomHeader.svelte.d.ts.map +1 -0
  84. package/dist/svelte/components/layout/RoomList.svelte +471 -0
  85. package/dist/svelte/components/layout/RoomList.svelte.d.ts +15 -0
  86. package/dist/svelte/components/layout/RoomList.svelte.d.ts.map +1 -0
  87. package/dist/svelte/components/messages/MessageInput.svelte +232 -0
  88. package/dist/svelte/components/messages/MessageInput.svelte.d.ts +20 -0
  89. package/dist/svelte/components/messages/MessageInput.svelte.d.ts.map +1 -0
  90. package/dist/svelte/components/messages/MessageItem.svelte +431 -0
  91. package/dist/svelte/components/messages/MessageItem.svelte.d.ts +19 -0
  92. package/dist/svelte/components/messages/MessageItem.svelte.d.ts.map +1 -0
  93. package/dist/svelte/components/messages/MessageList.svelte +129 -0
  94. package/dist/svelte/components/messages/MessageList.svelte.d.ts +17 -0
  95. package/dist/svelte/components/messages/MessageList.svelte.d.ts.map +1 -0
  96. package/dist/svelte/components/messages/ThreadPanel.svelte +156 -0
  97. package/dist/svelte/components/messages/ThreadPanel.svelte.d.ts +17 -0
  98. package/dist/svelte/components/messages/ThreadPanel.svelte.d.ts.map +1 -0
  99. package/dist/svelte/components/messages/__tests__/MessageInput.test.js +38 -0
  100. package/dist/svelte/components/shared/Avatar.svelte +30 -0
  101. package/dist/svelte/components/shared/Avatar.svelte.d.ts +14 -0
  102. package/dist/svelte/components/shared/Avatar.svelte.d.ts.map +1 -0
  103. package/dist/svelte/components/shared/FileUpload.svelte +382 -0
  104. package/dist/svelte/components/shared/FileUpload.svelte.d.ts +14 -0
  105. package/dist/svelte/components/shared/FileUpload.svelte.d.ts.map +1 -0
  106. package/dist/svelte/components/shared/LinkPreview.svelte +108 -0
  107. package/dist/svelte/components/shared/LinkPreview.svelte.d.ts +18 -0
  108. package/dist/svelte/components/shared/LinkPreview.svelte.d.ts.map +1 -0
  109. package/dist/svelte/components/shared/MentionAutocomplete.svelte +168 -0
  110. package/dist/svelte/components/shared/MentionAutocomplete.svelte.d.ts +18 -0
  111. package/dist/svelte/components/shared/MentionAutocomplete.svelte.d.ts.map +1 -0
  112. package/dist/svelte/components/shared/MessageBubble.svelte +81 -0
  113. package/dist/svelte/components/shared/MessageBubble.svelte.d.ts +16 -0
  114. package/dist/svelte/components/shared/MessageBubble.svelte.d.ts.map +1 -0
  115. package/dist/svelte/components/shared/ReactionPicker.svelte +103 -0
  116. package/dist/svelte/components/shared/ReactionPicker.svelte.d.ts +10 -0
  117. package/dist/svelte/components/shared/ReactionPicker.svelte.d.ts.map +1 -0
  118. package/dist/svelte/components/shared/ReadReceipts.svelte +127 -0
  119. package/dist/svelte/components/shared/ReadReceipts.svelte.d.ts +13 -0
  120. package/dist/svelte/components/shared/ReadReceipts.svelte.d.ts.map +1 -0
  121. package/dist/svelte/components/shared/TypingIndicator.svelte +90 -0
  122. package/dist/svelte/components/shared/TypingIndicator.svelte.d.ts +12 -0
  123. package/dist/svelte/components/shared/TypingIndicator.svelte.d.ts.map +1 -0
  124. package/dist/svelte/components/shared/UserPresence.svelte +65 -0
  125. package/dist/svelte/components/shared/UserPresence.svelte.d.ts +13 -0
  126. package/dist/svelte/components/shared/UserPresence.svelte.d.ts.map +1 -0
  127. package/dist/svelte/components/shared/__tests__/Avatar.test.js +20 -0
  128. package/dist/svelte/components/shared/__tests__/LinkPreview.test.js +29 -0
  129. package/dist/svelte/components/shared/__tests__/MessageBubble.test.js +21 -0
  130. package/dist/svelte/components/shared/__tests__/ReactionPicker.test.js +35 -0
  131. package/dist/svelte/components/shared/__tests__/ReadReceipts.test.js +28 -0
  132. package/dist/svelte/components/shared/__tests__/TypingIndicator.test.js +27 -0
  133. package/dist/svelte/components/shared/__tests__/UserPresence.test.js +23 -0
  134. package/dist/svelte/components/tabs/ChatTab.svelte +240 -0
  135. package/dist/svelte/components/tabs/ChatTab.svelte.d.ts +21 -0
  136. package/dist/svelte/components/tabs/ChatTab.svelte.d.ts.map +1 -0
  137. package/dist/svelte/components/tabs/ChatTabList.svelte +158 -0
  138. package/dist/svelte/components/tabs/ChatTabList.svelte.d.ts +13 -0
  139. package/dist/svelte/components/tabs/ChatTabList.svelte.d.ts.map +1 -0
  140. package/dist/svelte/components/tabs/ChatTabs.svelte +88 -0
  141. package/dist/svelte/components/tabs/ChatTabs.svelte.d.ts +21 -0
  142. package/dist/svelte/components/tabs/ChatTabs.svelte.d.ts.map +1 -0
  143. package/dist/svelte/components/tabs/MiniChat.svelte +253 -0
  144. package/dist/svelte/components/tabs/MiniChat.svelte.d.ts +15 -0
  145. package/dist/svelte/components/tabs/MiniChat.svelte.d.ts.map +1 -0
  146. package/dist/svelte/i18n.d.ts +51 -0
  147. package/dist/svelte/i18n.d.ts.map +1 -0
  148. package/dist/svelte/i18n.js +72 -0
  149. package/dist/svelte/i18n.messages.d.ts +50 -0
  150. package/dist/svelte/i18n.messages.d.ts.map +1 -0
  151. package/dist/svelte/i18n.messages.js +69 -0
  152. package/dist/svelte/index.d.ts +48 -0
  153. package/dist/svelte/index.d.ts.map +1 -0
  154. package/dist/svelte/index.js +117 -0
  155. package/dist/svelte/playground.d.ts +171 -0
  156. package/dist/svelte/playground.d.ts.map +1 -0
  157. package/dist/svelte/playground.js +161 -0
  158. package/dist/svelte/types.d.ts +116 -0
  159. package/dist/svelte/types.d.ts.map +1 -0
  160. package/dist/svelte/types.js +1 -0
  161. package/dist/types.d.ts +99 -0
  162. package/dist/types.d.ts.map +1 -0
  163. package/dist/types.js +2 -0
  164. package/dist/types.js.map +1 -0
  165. package/dist/ui.d.ts +4 -0
  166. package/dist/ui.d.ts.map +1 -0
  167. package/dist/ui.js +92 -0
  168. package/dist/ui.js.map +1 -0
  169. package/package.json +95 -0
@@ -0,0 +1,2811 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1782177125181,
4
+ "packageName": "@happyvertical/smrt-chat",
5
+ "packageVersion": "0.30.0",
6
+ "objects": {
7
+ "@happyvertical/smrt-chat:AgentSessionCollection": {
8
+ "name": "agentsessioncollection",
9
+ "className": "AgentSessionCollection",
10
+ "qualifiedName": "@happyvertical/smrt-chat:AgentSessionCollection",
11
+ "collection": "agentsessions",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/AgentSessionCollection.ts",
13
+ "packageName": "@happyvertical/smrt-chat",
14
+ "fields": {},
15
+ "methods": {
16
+ "findActiveByParticipant": {
17
+ "name": "findActiveByParticipant",
18
+ "async": true,
19
+ "parameters": [
20
+ {
21
+ "name": "participantProfileId",
22
+ "type": "string",
23
+ "optional": false
24
+ }
25
+ ],
26
+ "returnType": "Promise<AgentSession[]>",
27
+ "isStatic": false,
28
+ "isPublic": true
29
+ },
30
+ "findActiveSession": {
31
+ "name": "findActiveSession",
32
+ "async": true,
33
+ "parameters": [
34
+ {
35
+ "name": "agentId",
36
+ "type": "string",
37
+ "optional": false
38
+ },
39
+ {
40
+ "name": "participantProfileId",
41
+ "type": "string",
42
+ "optional": false
43
+ },
44
+ {
45
+ "name": "tenantId",
46
+ "type": "string | null",
47
+ "optional": false
48
+ },
49
+ {
50
+ "name": "sessionKey",
51
+ "type": "string | null",
52
+ "optional": true
53
+ }
54
+ ],
55
+ "returnType": "Promise<AgentSession | null>",
56
+ "isStatic": false,
57
+ "isPublic": true
58
+ },
59
+ "findOrCreate": {
60
+ "name": "findOrCreate",
61
+ "async": true,
62
+ "parameters": [
63
+ {
64
+ "name": "params",
65
+ "type": "object",
66
+ "optional": false
67
+ }
68
+ ],
69
+ "returnType": "Promise<AgentSession>",
70
+ "isStatic": false,
71
+ "isPublic": true
72
+ },
73
+ "findByAgent": {
74
+ "name": "findByAgent",
75
+ "async": true,
76
+ "parameters": [
77
+ {
78
+ "name": "agentId",
79
+ "type": "string",
80
+ "optional": false
81
+ }
82
+ ],
83
+ "returnType": "Promise<AgentSession[]>",
84
+ "isStatic": false,
85
+ "isPublic": true
86
+ },
87
+ "expireStale": {
88
+ "name": "expireStale",
89
+ "async": true,
90
+ "parameters": [
91
+ {
92
+ "name": "olderThan",
93
+ "type": "Date",
94
+ "optional": false
95
+ },
96
+ {
97
+ "name": "scope",
98
+ "type": "object",
99
+ "optional": true
100
+ }
101
+ ],
102
+ "returnType": "Promise<number>",
103
+ "isStatic": false,
104
+ "isPublic": true
105
+ }
106
+ },
107
+ "decoratorConfig": {
108
+ "tableName": "agent_sessions"
109
+ },
110
+ "extends": "SmrtCollection",
111
+ "extendsTypeArg": "AgentSession",
112
+ "exportName": "AgentSessionCollection",
113
+ "collectionExportName": "AgentSessionCollectionCollection",
114
+ "schema": {
115
+ "tableName": "agent_sessions",
116
+ "ddl": "CREATE TABLE IF NOT EXISTS \"agent_sessions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
117
+ "columns": {
118
+ "id": {
119
+ "type": "UUID",
120
+ "primaryKey": true,
121
+ "referenceKind": "id",
122
+ "notNull": true
123
+ },
124
+ "slug": {
125
+ "type": "TEXT",
126
+ "notNull": true
127
+ },
128
+ "context": {
129
+ "type": "TEXT",
130
+ "notNull": true,
131
+ "default": ""
132
+ },
133
+ "created_at": {
134
+ "type": "TIMESTAMP",
135
+ "notNull": true,
136
+ "default": "current_timestamp"
137
+ },
138
+ "updated_at": {
139
+ "type": "TIMESTAMP",
140
+ "notNull": true,
141
+ "default": "current_timestamp"
142
+ }
143
+ },
144
+ "indexes": [
145
+ {
146
+ "name": "agent_sessions_id_idx",
147
+ "columns": [
148
+ "id"
149
+ ]
150
+ },
151
+ {
152
+ "name": "agent_sessions_slug_context_idx",
153
+ "columns": [
154
+ "slug",
155
+ "context"
156
+ ],
157
+ "unique": true
158
+ }
159
+ ],
160
+ "version": "e5de0db6"
161
+ }
162
+ },
163
+ "@happyvertical/smrt-chat:ChatMessageCollection": {
164
+ "name": "chatmessagecollection",
165
+ "className": "ChatMessageCollection",
166
+ "qualifiedName": "@happyvertical/smrt-chat:ChatMessageCollection",
167
+ "collection": "chatmessages",
168
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/ChatMessageCollection.ts",
169
+ "packageName": "@happyvertical/smrt-chat",
170
+ "fields": {},
171
+ "methods": {
172
+ "getByRoom": {
173
+ "name": "getByRoom",
174
+ "async": true,
175
+ "parameters": [
176
+ {
177
+ "name": "roomId",
178
+ "type": "string",
179
+ "optional": false
180
+ },
181
+ {
182
+ "name": "tenantId",
183
+ "type": "string",
184
+ "optional": false
185
+ },
186
+ {
187
+ "name": "options",
188
+ "type": "object",
189
+ "optional": true
190
+ }
191
+ ],
192
+ "returnType": "Promise<ChatMessage[]>",
193
+ "isStatic": false,
194
+ "isPublic": true
195
+ },
196
+ "getByThread": {
197
+ "name": "getByThread",
198
+ "async": true,
199
+ "parameters": [
200
+ {
201
+ "name": "threadId",
202
+ "type": "string",
203
+ "optional": false
204
+ },
205
+ {
206
+ "name": "tenantId",
207
+ "type": "string",
208
+ "optional": false
209
+ }
210
+ ],
211
+ "returnType": "Promise<ChatMessage[]>",
212
+ "isStatic": false,
213
+ "isPublic": true
214
+ },
215
+ "getByAgentSession": {
216
+ "name": "getByAgentSession",
217
+ "async": true,
218
+ "parameters": [
219
+ {
220
+ "name": "agentSessionId",
221
+ "type": "string",
222
+ "optional": false
223
+ },
224
+ {
225
+ "name": "tenantId",
226
+ "type": "string",
227
+ "optional": false
228
+ }
229
+ ],
230
+ "returnType": "Promise<ChatMessage[]>",
231
+ "isStatic": false,
232
+ "isPublic": true
233
+ },
234
+ "search": {
235
+ "name": "search",
236
+ "async": true,
237
+ "parameters": [
238
+ {
239
+ "name": "filters",
240
+ "type": "any",
241
+ "optional": false
242
+ }
243
+ ],
244
+ "returnType": "Promise<ChatMessage[]>",
245
+ "isStatic": false,
246
+ "isPublic": true
247
+ },
248
+ "getUnreadCount": {
249
+ "name": "getUnreadCount",
250
+ "async": true,
251
+ "parameters": [
252
+ {
253
+ "name": "roomId",
254
+ "type": "string",
255
+ "optional": false
256
+ },
257
+ {
258
+ "name": "tenantId",
259
+ "type": "string",
260
+ "optional": false
261
+ },
262
+ {
263
+ "name": "lastReadMessageId",
264
+ "type": "string | null",
265
+ "optional": false
266
+ }
267
+ ],
268
+ "returnType": "Promise<number>",
269
+ "isStatic": false,
270
+ "isPublic": true
271
+ },
272
+ "getLatestPerRoom": {
273
+ "name": "getLatestPerRoom",
274
+ "async": true,
275
+ "parameters": [
276
+ {
277
+ "name": "roomIds",
278
+ "type": "string[]",
279
+ "optional": false
280
+ },
281
+ {
282
+ "name": "tenantId",
283
+ "type": "string",
284
+ "optional": false
285
+ }
286
+ ],
287
+ "returnType": "Promise<Map<string, ChatMessage>>",
288
+ "isStatic": false,
289
+ "isPublic": true
290
+ }
291
+ },
292
+ "decoratorConfig": {
293
+ "tableName": "chat_messages"
294
+ },
295
+ "extends": "SmrtCollection",
296
+ "extendsTypeArg": "ChatMessage",
297
+ "exportName": "ChatMessageCollection",
298
+ "collectionExportName": "ChatMessageCollectionCollection",
299
+ "schema": {
300
+ "tableName": "chat_messages",
301
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
302
+ "columns": {
303
+ "id": {
304
+ "type": "UUID",
305
+ "primaryKey": true,
306
+ "referenceKind": "id",
307
+ "notNull": true
308
+ },
309
+ "slug": {
310
+ "type": "TEXT",
311
+ "notNull": true
312
+ },
313
+ "context": {
314
+ "type": "TEXT",
315
+ "notNull": true,
316
+ "default": ""
317
+ },
318
+ "created_at": {
319
+ "type": "TIMESTAMP",
320
+ "notNull": true,
321
+ "default": "current_timestamp"
322
+ },
323
+ "updated_at": {
324
+ "type": "TIMESTAMP",
325
+ "notNull": true,
326
+ "default": "current_timestamp"
327
+ }
328
+ },
329
+ "indexes": [
330
+ {
331
+ "name": "chat_messages_id_idx",
332
+ "columns": [
333
+ "id"
334
+ ]
335
+ },
336
+ {
337
+ "name": "chat_messages_slug_context_idx",
338
+ "columns": [
339
+ "slug",
340
+ "context"
341
+ ],
342
+ "unique": true
343
+ }
344
+ ],
345
+ "version": "13b2dccb"
346
+ }
347
+ },
348
+ "@happyvertical/smrt-chat:ChatParticipantCollection": {
349
+ "name": "chatparticipantcollection",
350
+ "className": "ChatParticipantCollection",
351
+ "qualifiedName": "@happyvertical/smrt-chat:ChatParticipantCollection",
352
+ "collection": "chatparticipants",
353
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/ChatParticipantCollection.ts",
354
+ "packageName": "@happyvertical/smrt-chat",
355
+ "fields": {},
356
+ "methods": {
357
+ "getByRoom": {
358
+ "name": "getByRoom",
359
+ "async": true,
360
+ "parameters": [
361
+ {
362
+ "name": "roomId",
363
+ "type": "string",
364
+ "optional": false
365
+ }
366
+ ],
367
+ "returnType": "Promise<ChatParticipant[]>",
368
+ "isStatic": false,
369
+ "isPublic": true
370
+ },
371
+ "getByProfile": {
372
+ "name": "getByProfile",
373
+ "async": true,
374
+ "parameters": [
375
+ {
376
+ "name": "profileId",
377
+ "type": "string",
378
+ "optional": false
379
+ }
380
+ ],
381
+ "returnType": "Promise<ChatParticipant[]>",
382
+ "isStatic": false,
383
+ "isPublic": true
384
+ },
385
+ "findMembership": {
386
+ "name": "findMembership",
387
+ "async": true,
388
+ "parameters": [
389
+ {
390
+ "name": "roomId",
391
+ "type": "string",
392
+ "optional": false
393
+ },
394
+ {
395
+ "name": "profileId",
396
+ "type": "string",
397
+ "optional": false
398
+ },
399
+ {
400
+ "name": "tenantId",
401
+ "type": "string",
402
+ "optional": true
403
+ }
404
+ ],
405
+ "returnType": "Promise<ChatParticipant | null>",
406
+ "isStatic": false,
407
+ "isPublic": true
408
+ },
409
+ "findActiveMembership": {
410
+ "name": "findActiveMembership",
411
+ "async": true,
412
+ "parameters": [
413
+ {
414
+ "name": "roomId",
415
+ "type": "string",
416
+ "optional": false
417
+ },
418
+ {
419
+ "name": "profileId",
420
+ "type": "string",
421
+ "optional": false
422
+ },
423
+ {
424
+ "name": "tenantId",
425
+ "type": "string",
426
+ "optional": false
427
+ }
428
+ ],
429
+ "returnType": "Promise<ChatParticipant | null>",
430
+ "isStatic": false,
431
+ "isPublic": true
432
+ },
433
+ "isActiveMember": {
434
+ "name": "isActiveMember",
435
+ "async": true,
436
+ "parameters": [
437
+ {
438
+ "name": "roomId",
439
+ "type": "string",
440
+ "optional": false
441
+ },
442
+ {
443
+ "name": "profileId",
444
+ "type": "string",
445
+ "optional": false
446
+ },
447
+ {
448
+ "name": "tenantId",
449
+ "type": "string",
450
+ "optional": false
451
+ }
452
+ ],
453
+ "returnType": "Promise<boolean>",
454
+ "isStatic": false,
455
+ "isPublic": true
456
+ },
457
+ "getOnlineInRoom": {
458
+ "name": "getOnlineInRoom",
459
+ "async": true,
460
+ "parameters": [
461
+ {
462
+ "name": "roomId",
463
+ "type": "string",
464
+ "optional": false
465
+ }
466
+ ],
467
+ "returnType": "Promise<ChatParticipant[]>",
468
+ "isStatic": false,
469
+ "isPublic": true
470
+ },
471
+ "getAdminsInRoom": {
472
+ "name": "getAdminsInRoom",
473
+ "async": true,
474
+ "parameters": [
475
+ {
476
+ "name": "roomId",
477
+ "type": "string",
478
+ "optional": false
479
+ }
480
+ ],
481
+ "returnType": "Promise<ChatParticipant[]>",
482
+ "isStatic": false,
483
+ "isPublic": true
484
+ },
485
+ "countInRoom": {
486
+ "name": "countInRoom",
487
+ "async": true,
488
+ "parameters": [
489
+ {
490
+ "name": "roomId",
491
+ "type": "string",
492
+ "optional": false
493
+ }
494
+ ],
495
+ "returnType": "Promise<number>",
496
+ "isStatic": false,
497
+ "isPublic": true
498
+ }
499
+ },
500
+ "decoratorConfig": {
501
+ "tableName": "chat_participants"
502
+ },
503
+ "extends": "SmrtCollection",
504
+ "extendsTypeArg": "ChatParticipant",
505
+ "exportName": "ChatParticipantCollection",
506
+ "collectionExportName": "ChatParticipantCollectionCollection",
507
+ "schema": {
508
+ "tableName": "chat_participants",
509
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_participants\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
510
+ "columns": {
511
+ "id": {
512
+ "type": "UUID",
513
+ "primaryKey": true,
514
+ "referenceKind": "id",
515
+ "notNull": true
516
+ },
517
+ "slug": {
518
+ "type": "TEXT",
519
+ "notNull": true
520
+ },
521
+ "context": {
522
+ "type": "TEXT",
523
+ "notNull": true,
524
+ "default": ""
525
+ },
526
+ "created_at": {
527
+ "type": "TIMESTAMP",
528
+ "notNull": true,
529
+ "default": "current_timestamp"
530
+ },
531
+ "updated_at": {
532
+ "type": "TIMESTAMP",
533
+ "notNull": true,
534
+ "default": "current_timestamp"
535
+ }
536
+ },
537
+ "indexes": [
538
+ {
539
+ "name": "chat_participants_id_idx",
540
+ "columns": [
541
+ "id"
542
+ ]
543
+ },
544
+ {
545
+ "name": "chat_participants_slug_context_idx",
546
+ "columns": [
547
+ "slug",
548
+ "context"
549
+ ],
550
+ "unique": true
551
+ }
552
+ ],
553
+ "version": "f70abec0"
554
+ }
555
+ },
556
+ "@happyvertical/smrt-chat:ChatReactionCollection": {
557
+ "name": "chatreactioncollection",
558
+ "className": "ChatReactionCollection",
559
+ "qualifiedName": "@happyvertical/smrt-chat:ChatReactionCollection",
560
+ "collection": "chatreactions",
561
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/ChatReactionCollection.ts",
562
+ "packageName": "@happyvertical/smrt-chat",
563
+ "fields": {},
564
+ "methods": {
565
+ "getByMessage": {
566
+ "name": "getByMessage",
567
+ "async": true,
568
+ "parameters": [
569
+ {
570
+ "name": "messageId",
571
+ "type": "string",
572
+ "optional": false
573
+ }
574
+ ],
575
+ "returnType": "Promise<ChatReaction[]>",
576
+ "isStatic": false,
577
+ "isPublic": true
578
+ },
579
+ "getReactionCounts": {
580
+ "name": "getReactionCounts",
581
+ "async": true,
582
+ "parameters": [
583
+ {
584
+ "name": "messageId",
585
+ "type": "string",
586
+ "optional": false
587
+ }
588
+ ],
589
+ "returnType": "Promise<Map<string, object>>",
590
+ "isStatic": false,
591
+ "isPublic": true
592
+ },
593
+ "toggle": {
594
+ "name": "toggle",
595
+ "async": true,
596
+ "parameters": [
597
+ {
598
+ "name": "messageId",
599
+ "type": "string",
600
+ "optional": false
601
+ },
602
+ {
603
+ "name": "profileId",
604
+ "type": "string",
605
+ "optional": false
606
+ },
607
+ {
608
+ "name": "emoji",
609
+ "type": "string",
610
+ "optional": false
611
+ },
612
+ {
613
+ "name": "tenantId",
614
+ "type": "string",
615
+ "optional": false
616
+ }
617
+ ],
618
+ "returnType": "Promise<object>",
619
+ "isStatic": false,
620
+ "isPublic": true
621
+ }
622
+ },
623
+ "decoratorConfig": {
624
+ "tableName": "chat_reactions"
625
+ },
626
+ "extends": "SmrtCollection",
627
+ "extendsTypeArg": "ChatReaction",
628
+ "exportName": "ChatReactionCollection",
629
+ "collectionExportName": "ChatReactionCollectionCollection",
630
+ "schema": {
631
+ "tableName": "chat_reactions",
632
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_reactions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
633
+ "columns": {
634
+ "id": {
635
+ "type": "UUID",
636
+ "primaryKey": true,
637
+ "referenceKind": "id",
638
+ "notNull": true
639
+ },
640
+ "slug": {
641
+ "type": "TEXT",
642
+ "notNull": true
643
+ },
644
+ "context": {
645
+ "type": "TEXT",
646
+ "notNull": true,
647
+ "default": ""
648
+ },
649
+ "created_at": {
650
+ "type": "TIMESTAMP",
651
+ "notNull": true,
652
+ "default": "current_timestamp"
653
+ },
654
+ "updated_at": {
655
+ "type": "TIMESTAMP",
656
+ "notNull": true,
657
+ "default": "current_timestamp"
658
+ }
659
+ },
660
+ "indexes": [
661
+ {
662
+ "name": "chat_reactions_id_idx",
663
+ "columns": [
664
+ "id"
665
+ ]
666
+ },
667
+ {
668
+ "name": "chat_reactions_slug_context_idx",
669
+ "columns": [
670
+ "slug",
671
+ "context"
672
+ ],
673
+ "unique": true
674
+ }
675
+ ],
676
+ "version": "0ea62683"
677
+ }
678
+ },
679
+ "@happyvertical/smrt-chat:ChatRoomCollection": {
680
+ "name": "chatroomcollection",
681
+ "className": "ChatRoomCollection",
682
+ "qualifiedName": "@happyvertical/smrt-chat:ChatRoomCollection",
683
+ "collection": "chatrooms",
684
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/ChatRoomCollection.ts",
685
+ "packageName": "@happyvertical/smrt-chat",
686
+ "fields": {},
687
+ "methods": {
688
+ "findByType": {
689
+ "name": "findByType",
690
+ "async": true,
691
+ "parameters": [
692
+ {
693
+ "name": "roomType",
694
+ "type": "ChatRoomType",
695
+ "optional": false
696
+ }
697
+ ],
698
+ "returnType": "Promise<ChatRoom[]>",
699
+ "isStatic": false,
700
+ "isPublic": true
701
+ },
702
+ "findPublic": {
703
+ "name": "findPublic",
704
+ "async": true,
705
+ "parameters": [],
706
+ "returnType": "Promise<ChatRoom[]>",
707
+ "isStatic": false,
708
+ "isPublic": true
709
+ },
710
+ "findDMs": {
711
+ "name": "findDMs",
712
+ "async": true,
713
+ "parameters": [],
714
+ "returnType": "Promise<ChatRoom[]>",
715
+ "isStatic": false,
716
+ "isPublic": true
717
+ },
718
+ "findAgentRooms": {
719
+ "name": "findAgentRooms",
720
+ "async": true,
721
+ "parameters": [],
722
+ "returnType": "Promise<ChatRoom[]>",
723
+ "isStatic": false,
724
+ "isPublic": true
725
+ },
726
+ "search": {
727
+ "name": "search",
728
+ "async": true,
729
+ "parameters": [
730
+ {
731
+ "name": "query",
732
+ "type": "string",
733
+ "optional": false
734
+ },
735
+ {
736
+ "name": "options",
737
+ "type": "object",
738
+ "optional": true
739
+ }
740
+ ],
741
+ "returnType": "Promise<ChatRoom[]>",
742
+ "isStatic": false,
743
+ "isPublic": true
744
+ },
745
+ "findOrCreateDM": {
746
+ "name": "findOrCreateDM",
747
+ "async": true,
748
+ "parameters": [
749
+ {
750
+ "name": "profileId1",
751
+ "type": "string",
752
+ "optional": false
753
+ },
754
+ {
755
+ "name": "profileId2",
756
+ "type": "string",
757
+ "optional": false
758
+ },
759
+ {
760
+ "name": "tenantId",
761
+ "type": "string",
762
+ "optional": false
763
+ },
764
+ {
765
+ "name": "participants",
766
+ "type": "ChatParticipantCollection",
767
+ "optional": false
768
+ }
769
+ ],
770
+ "returnType": "Promise<ChatRoom>",
771
+ "isStatic": false,
772
+ "isPublic": true
773
+ }
774
+ },
775
+ "decoratorConfig": {
776
+ "tableName": "chat_rooms"
777
+ },
778
+ "extends": "SmrtCollection",
779
+ "extendsTypeArg": "ChatRoom",
780
+ "exportName": "ChatRoomCollection",
781
+ "collectionExportName": "ChatRoomCollectionCollection",
782
+ "schema": {
783
+ "tableName": "chat_rooms",
784
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_rooms\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
785
+ "columns": {
786
+ "id": {
787
+ "type": "UUID",
788
+ "primaryKey": true,
789
+ "referenceKind": "id",
790
+ "notNull": true
791
+ },
792
+ "slug": {
793
+ "type": "TEXT",
794
+ "notNull": true
795
+ },
796
+ "context": {
797
+ "type": "TEXT",
798
+ "notNull": true,
799
+ "default": ""
800
+ },
801
+ "created_at": {
802
+ "type": "TIMESTAMP",
803
+ "notNull": true,
804
+ "default": "current_timestamp"
805
+ },
806
+ "updated_at": {
807
+ "type": "TIMESTAMP",
808
+ "notNull": true,
809
+ "default": "current_timestamp"
810
+ }
811
+ },
812
+ "indexes": [
813
+ {
814
+ "name": "chat_rooms_id_idx",
815
+ "columns": [
816
+ "id"
817
+ ]
818
+ },
819
+ {
820
+ "name": "chat_rooms_slug_context_idx",
821
+ "columns": [
822
+ "slug",
823
+ "context"
824
+ ],
825
+ "unique": true
826
+ }
827
+ ],
828
+ "version": "40be4b86"
829
+ }
830
+ },
831
+ "@happyvertical/smrt-chat:ChatThreadCollection": {
832
+ "name": "chatthreadcollection",
833
+ "className": "ChatThreadCollection",
834
+ "qualifiedName": "@happyvertical/smrt-chat:ChatThreadCollection",
835
+ "collection": "chatthreads",
836
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/collections/ChatThreadCollection.ts",
837
+ "packageName": "@happyvertical/smrt-chat",
838
+ "fields": {},
839
+ "methods": {
840
+ "getByRoom": {
841
+ "name": "getByRoom",
842
+ "async": true,
843
+ "parameters": [
844
+ {
845
+ "name": "roomId",
846
+ "type": "string",
847
+ "optional": false
848
+ }
849
+ ],
850
+ "returnType": "Promise<ChatThread[]>",
851
+ "isStatic": false,
852
+ "isPublic": true
853
+ },
854
+ "getActive": {
855
+ "name": "getActive",
856
+ "async": true,
857
+ "parameters": [
858
+ {
859
+ "name": "roomId",
860
+ "type": "string",
861
+ "optional": false
862
+ }
863
+ ],
864
+ "returnType": "Promise<ChatThread[]>",
865
+ "isStatic": false,
866
+ "isPublic": true
867
+ },
868
+ "getUnresolved": {
869
+ "name": "getUnresolved",
870
+ "async": true,
871
+ "parameters": [],
872
+ "returnType": "Promise<ChatThread[]>",
873
+ "isStatic": false,
874
+ "isPublic": true
875
+ }
876
+ },
877
+ "decoratorConfig": {
878
+ "tableName": "chat_threads"
879
+ },
880
+ "extends": "SmrtCollection",
881
+ "extendsTypeArg": "ChatThread",
882
+ "exportName": "ChatThreadCollection",
883
+ "collectionExportName": "ChatThreadCollectionCollection",
884
+ "schema": {
885
+ "tableName": "chat_threads",
886
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_threads\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
887
+ "columns": {
888
+ "id": {
889
+ "type": "UUID",
890
+ "primaryKey": true,
891
+ "referenceKind": "id",
892
+ "notNull": true
893
+ },
894
+ "slug": {
895
+ "type": "TEXT",
896
+ "notNull": true
897
+ },
898
+ "context": {
899
+ "type": "TEXT",
900
+ "notNull": true,
901
+ "default": ""
902
+ },
903
+ "created_at": {
904
+ "type": "TIMESTAMP",
905
+ "notNull": true,
906
+ "default": "current_timestamp"
907
+ },
908
+ "updated_at": {
909
+ "type": "TIMESTAMP",
910
+ "notNull": true,
911
+ "default": "current_timestamp"
912
+ }
913
+ },
914
+ "indexes": [
915
+ {
916
+ "name": "chat_threads_id_idx",
917
+ "columns": [
918
+ "id"
919
+ ]
920
+ },
921
+ {
922
+ "name": "chat_threads_slug_context_idx",
923
+ "columns": [
924
+ "slug",
925
+ "context"
926
+ ],
927
+ "unique": true
928
+ }
929
+ ],
930
+ "version": "760b62bd"
931
+ }
932
+ },
933
+ "@happyvertical/smrt-chat:AgentSession": {
934
+ "name": "agentsession",
935
+ "className": "AgentSession",
936
+ "qualifiedName": "@happyvertical/smrt-chat:AgentSession",
937
+ "collection": "agentsessions",
938
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/AgentSession.ts",
939
+ "packageName": "@happyvertical/smrt-chat",
940
+ "fields": {
941
+ "tenantId": {
942
+ "type": "text",
943
+ "required": false,
944
+ "_meta": {
945
+ "sqlType": "UUID",
946
+ "nullable": true,
947
+ "__tenancy": {
948
+ "isTenantIdField": true,
949
+ "autoFilter": true,
950
+ "required": false,
951
+ "autoPopulate": true,
952
+ "nullable": true,
953
+ "mode": "optional",
954
+ "field": "tenantId",
955
+ "allowSuperAdminBypass": false
956
+ }
957
+ }
958
+ },
959
+ "agentId": {
960
+ "type": "text",
961
+ "required": true,
962
+ "default": "",
963
+ "_meta": {
964
+ "required": true
965
+ }
966
+ },
967
+ "participantProfileId": {
968
+ "type": "crossPackageRef",
969
+ "required": true,
970
+ "related": "@happyvertical/smrt-profiles:Profile"
971
+ },
972
+ "chatRoomId": {
973
+ "type": "foreignKey",
974
+ "required": false,
975
+ "related": "ChatRoom"
976
+ },
977
+ "status": {
978
+ "type": "text",
979
+ "required": true,
980
+ "default": "active",
981
+ "_meta": {
982
+ "required": true
983
+ }
984
+ },
985
+ "allowedTools": {
986
+ "type": "text",
987
+ "required": false,
988
+ "default": "[]"
989
+ },
990
+ "sessionContext": {
991
+ "type": "text",
992
+ "required": false,
993
+ "default": "{}"
994
+ },
995
+ "systemPrompt": {
996
+ "type": "text",
997
+ "required": false,
998
+ "default": ""
999
+ },
1000
+ "messageCount": {
1001
+ "type": "integer",
1002
+ "required": false,
1003
+ "default": 0
1004
+ },
1005
+ "totalTokensUsed": {
1006
+ "type": "integer",
1007
+ "required": false,
1008
+ "default": 0
1009
+ },
1010
+ "maxTokens": {
1011
+ "type": "integer",
1012
+ "required": false,
1013
+ "default": 0
1014
+ },
1015
+ "maxMessages": {
1016
+ "type": "integer",
1017
+ "required": false,
1018
+ "default": 0
1019
+ },
1020
+ "lastMessageAt": {
1021
+ "type": "datetime",
1022
+ "required": false
1023
+ },
1024
+ "expiresAt": {
1025
+ "type": "datetime",
1026
+ "required": false
1027
+ },
1028
+ "closedAt": {
1029
+ "type": "datetime",
1030
+ "required": false
1031
+ }
1032
+ },
1033
+ "methods": {
1034
+ "getAllowedTools": {
1035
+ "name": "getAllowedTools",
1036
+ "async": false,
1037
+ "parameters": [],
1038
+ "returnType": "string[]",
1039
+ "isStatic": false,
1040
+ "isPublic": true
1041
+ },
1042
+ "setAllowedTools": {
1043
+ "name": "setAllowedTools",
1044
+ "async": false,
1045
+ "parameters": [
1046
+ {
1047
+ "name": "tools",
1048
+ "type": "string[]",
1049
+ "optional": false
1050
+ }
1051
+ ],
1052
+ "returnType": "void",
1053
+ "isStatic": false,
1054
+ "isPublic": true
1055
+ },
1056
+ "isToolAllowed": {
1057
+ "name": "isToolAllowed",
1058
+ "async": false,
1059
+ "parameters": [
1060
+ {
1061
+ "name": "toolName",
1062
+ "type": "string",
1063
+ "optional": false
1064
+ }
1065
+ ],
1066
+ "returnType": "boolean",
1067
+ "isStatic": false,
1068
+ "isPublic": true
1069
+ },
1070
+ "isActive": {
1071
+ "name": "isActive",
1072
+ "async": false,
1073
+ "parameters": [],
1074
+ "returnType": "boolean",
1075
+ "isStatic": false,
1076
+ "isPublic": true
1077
+ },
1078
+ "isExpired": {
1079
+ "name": "isExpired",
1080
+ "async": false,
1081
+ "parameters": [],
1082
+ "returnType": "boolean",
1083
+ "isStatic": false,
1084
+ "isPublic": true
1085
+ },
1086
+ "close": {
1087
+ "name": "close",
1088
+ "async": true,
1089
+ "parameters": [],
1090
+ "returnType": "Promise<void>",
1091
+ "isStatic": false,
1092
+ "isPublic": true
1093
+ },
1094
+ "expire": {
1095
+ "name": "expire",
1096
+ "async": true,
1097
+ "parameters": [],
1098
+ "returnType": "Promise<void>",
1099
+ "isStatic": false,
1100
+ "isPublic": true
1101
+ },
1102
+ "getSessionContext": {
1103
+ "name": "getSessionContext",
1104
+ "async": false,
1105
+ "parameters": [],
1106
+ "returnType": "Record<string>",
1107
+ "isStatic": false,
1108
+ "isPublic": true
1109
+ },
1110
+ "setSessionContext": {
1111
+ "name": "setSessionContext",
1112
+ "async": false,
1113
+ "parameters": [
1114
+ {
1115
+ "name": "ctx",
1116
+ "type": "Record<string>",
1117
+ "optional": false
1118
+ }
1119
+ ],
1120
+ "returnType": "void",
1121
+ "isStatic": false,
1122
+ "isPublic": true
1123
+ },
1124
+ "getSessionKey": {
1125
+ "name": "getSessionKey",
1126
+ "async": false,
1127
+ "parameters": [],
1128
+ "returnType": "string | null",
1129
+ "isStatic": false,
1130
+ "isPublic": true
1131
+ },
1132
+ "updateSessionContext": {
1133
+ "name": "updateSessionContext",
1134
+ "async": true,
1135
+ "parameters": [
1136
+ {
1137
+ "name": "updates",
1138
+ "type": "Record<string>",
1139
+ "optional": false
1140
+ }
1141
+ ],
1142
+ "returnType": "Promise<void>",
1143
+ "isStatic": false,
1144
+ "isPublic": true
1145
+ },
1146
+ "recordMessage": {
1147
+ "name": "recordMessage",
1148
+ "async": true,
1149
+ "parameters": [
1150
+ {
1151
+ "name": "tokensUsed",
1152
+ "type": "number",
1153
+ "optional": true
1154
+ }
1155
+ ],
1156
+ "returnType": "Promise<void>",
1157
+ "isStatic": false,
1158
+ "isPublic": true
1159
+ }
1160
+ },
1161
+ "decoratorConfig": {
1162
+ "tableName": "agent_sessions",
1163
+ "api": {
1164
+ "include": [
1165
+ "list",
1166
+ "get"
1167
+ ]
1168
+ },
1169
+ "mcp": {
1170
+ "include": [
1171
+ "list",
1172
+ "get"
1173
+ ]
1174
+ },
1175
+ "cli": true,
1176
+ "tenantScoped": {
1177
+ "mode": "optional"
1178
+ }
1179
+ },
1180
+ "extends": "SmrtObject",
1181
+ "exportName": "AgentSession",
1182
+ "collectionExportName": "AgentSessionCollection",
1183
+ "validationRules": [
1184
+ {
1185
+ "field": "agentId",
1186
+ "rule": "required",
1187
+ "fieldType": "text"
1188
+ },
1189
+ {
1190
+ "field": "participantProfileId",
1191
+ "rule": "required",
1192
+ "fieldType": "crossPackageRef"
1193
+ },
1194
+ {
1195
+ "field": "status",
1196
+ "rule": "required",
1197
+ "fieldType": "text"
1198
+ }
1199
+ ],
1200
+ "schema": {
1201
+ "tableName": "agent_sessions",
1202
+ "ddl": "CREATE TABLE IF NOT EXISTS \"agent_sessions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"agent_id\" TEXT NOT NULL DEFAULT '',\n \"participant_profile_id\" UUID NOT NULL,\n \"chat_room_id\" UUID,\n \"status\" TEXT NOT NULL DEFAULT 'active',\n \"allowed_tools\" TEXT DEFAULT '[]',\n \"session_context\" TEXT DEFAULT '{}',\n \"system_prompt\" TEXT DEFAULT '',\n \"message_count\" INTEGER DEFAULT 0,\n \"total_tokens_used\" INTEGER DEFAULT 0,\n \"max_tokens\" INTEGER DEFAULT 0,\n \"max_messages\" INTEGER DEFAULT 0,\n \"last_message_at\" TIMESTAMP,\n \"expires_at\" TIMESTAMP,\n \"closed_at\" TIMESTAMP\n);",
1203
+ "columns": {
1204
+ "id": {
1205
+ "type": "UUID",
1206
+ "primaryKey": true,
1207
+ "referenceKind": "id",
1208
+ "notNull": true
1209
+ },
1210
+ "slug": {
1211
+ "type": "TEXT",
1212
+ "notNull": true
1213
+ },
1214
+ "context": {
1215
+ "type": "TEXT",
1216
+ "notNull": true,
1217
+ "default": ""
1218
+ },
1219
+ "created_at": {
1220
+ "type": "TIMESTAMP",
1221
+ "notNull": true,
1222
+ "default": "current_timestamp"
1223
+ },
1224
+ "updated_at": {
1225
+ "type": "TIMESTAMP",
1226
+ "notNull": true,
1227
+ "default": "current_timestamp"
1228
+ },
1229
+ "tenant_id": {
1230
+ "type": "UUID",
1231
+ "referenceKind": "tenantId",
1232
+ "notNull": false,
1233
+ "unique": false
1234
+ },
1235
+ "agent_id": {
1236
+ "type": "TEXT",
1237
+ "notNull": true,
1238
+ "unique": false,
1239
+ "default": ""
1240
+ },
1241
+ "participant_profile_id": {
1242
+ "type": "UUID",
1243
+ "referenceKind": "crossPackageRef",
1244
+ "notNull": true,
1245
+ "unique": false
1246
+ },
1247
+ "chat_room_id": {
1248
+ "type": "UUID",
1249
+ "referenceKind": "foreignKey",
1250
+ "notNull": false,
1251
+ "unique": false
1252
+ },
1253
+ "status": {
1254
+ "type": "TEXT",
1255
+ "notNull": true,
1256
+ "unique": false,
1257
+ "default": "active"
1258
+ },
1259
+ "allowed_tools": {
1260
+ "type": "TEXT",
1261
+ "notNull": false,
1262
+ "unique": false,
1263
+ "default": "[]"
1264
+ },
1265
+ "session_context": {
1266
+ "type": "TEXT",
1267
+ "notNull": false,
1268
+ "unique": false,
1269
+ "default": "{}"
1270
+ },
1271
+ "system_prompt": {
1272
+ "type": "TEXT",
1273
+ "notNull": false,
1274
+ "unique": false,
1275
+ "default": ""
1276
+ },
1277
+ "message_count": {
1278
+ "type": "INTEGER",
1279
+ "notNull": false,
1280
+ "unique": false,
1281
+ "default": 0
1282
+ },
1283
+ "total_tokens_used": {
1284
+ "type": "INTEGER",
1285
+ "notNull": false,
1286
+ "unique": false,
1287
+ "default": 0
1288
+ },
1289
+ "max_tokens": {
1290
+ "type": "INTEGER",
1291
+ "notNull": false,
1292
+ "unique": false,
1293
+ "default": 0
1294
+ },
1295
+ "max_messages": {
1296
+ "type": "INTEGER",
1297
+ "notNull": false,
1298
+ "unique": false,
1299
+ "default": 0
1300
+ },
1301
+ "last_message_at": {
1302
+ "type": "TIMESTAMP",
1303
+ "notNull": false,
1304
+ "unique": false
1305
+ },
1306
+ "expires_at": {
1307
+ "type": "TIMESTAMP",
1308
+ "notNull": false,
1309
+ "unique": false
1310
+ },
1311
+ "closed_at": {
1312
+ "type": "TIMESTAMP",
1313
+ "notNull": false,
1314
+ "unique": false
1315
+ }
1316
+ },
1317
+ "indexes": [
1318
+ {
1319
+ "name": "agent_sessions_id_idx",
1320
+ "columns": [
1321
+ "id"
1322
+ ]
1323
+ },
1324
+ {
1325
+ "name": "agent_sessions_slug_context_idx",
1326
+ "columns": [
1327
+ "slug",
1328
+ "context"
1329
+ ],
1330
+ "unique": true
1331
+ }
1332
+ ],
1333
+ "version": "9de59339"
1334
+ }
1335
+ },
1336
+ "@happyvertical/smrt-chat:ChatMessage": {
1337
+ "name": "chatmessage",
1338
+ "className": "ChatMessage",
1339
+ "qualifiedName": "@happyvertical/smrt-chat:ChatMessage",
1340
+ "collection": "chatmessages",
1341
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/ChatMessage.ts",
1342
+ "packageName": "@happyvertical/smrt-chat",
1343
+ "fields": {
1344
+ "tenantId": {
1345
+ "type": "text",
1346
+ "required": true,
1347
+ "_meta": {
1348
+ "sqlType": "UUID",
1349
+ "__tenancy": {
1350
+ "isTenantIdField": true,
1351
+ "autoFilter": true,
1352
+ "required": true,
1353
+ "autoPopulate": true,
1354
+ "nullable": false,
1355
+ "mode": "required",
1356
+ "field": "tenantId",
1357
+ "allowSuperAdminBypass": false
1358
+ }
1359
+ }
1360
+ },
1361
+ "roomId": {
1362
+ "type": "foreignKey",
1363
+ "required": true,
1364
+ "related": "ChatRoom",
1365
+ "_meta": {
1366
+ "required": true
1367
+ }
1368
+ },
1369
+ "threadId": {
1370
+ "type": "foreignKey",
1371
+ "required": false,
1372
+ "related": "ChatThread"
1373
+ },
1374
+ "senderProfileId": {
1375
+ "type": "crossPackageRef",
1376
+ "required": true,
1377
+ "related": "@happyvertical/smrt-profiles:Profile"
1378
+ },
1379
+ "agentSessionId": {
1380
+ "type": "foreignKey",
1381
+ "required": false,
1382
+ "related": "AgentSession"
1383
+ },
1384
+ "content": {
1385
+ "type": "text",
1386
+ "required": false,
1387
+ "default": ""
1388
+ },
1389
+ "messageType": {
1390
+ "type": "text",
1391
+ "required": true,
1392
+ "default": "text",
1393
+ "_meta": {
1394
+ "required": true
1395
+ }
1396
+ },
1397
+ "role": {
1398
+ "type": "text",
1399
+ "required": true,
1400
+ "default": "user",
1401
+ "_meta": {
1402
+ "required": true
1403
+ }
1404
+ },
1405
+ "isEdited": {
1406
+ "type": "boolean",
1407
+ "required": false,
1408
+ "default": false
1409
+ },
1410
+ "editedAt": {
1411
+ "type": "datetime",
1412
+ "required": false
1413
+ },
1414
+ "isDeleted": {
1415
+ "type": "boolean",
1416
+ "required": false,
1417
+ "default": false
1418
+ },
1419
+ "replyToMessageId": {
1420
+ "type": "foreignKey",
1421
+ "required": false,
1422
+ "related": "ChatMessage"
1423
+ },
1424
+ "metadata": {
1425
+ "type": "text",
1426
+ "required": false,
1427
+ "default": "{}"
1428
+ },
1429
+ "toolCallData": {
1430
+ "type": "text",
1431
+ "required": false
1432
+ },
1433
+ "attachments": {
1434
+ "type": "text",
1435
+ "required": false,
1436
+ "default": "[]"
1437
+ }
1438
+ },
1439
+ "methods": {
1440
+ "getAttachments": {
1441
+ "name": "getAttachments",
1442
+ "async": false,
1443
+ "parameters": [],
1444
+ "returnType": "Array<object>",
1445
+ "isStatic": false,
1446
+ "isPublic": true
1447
+ },
1448
+ "setAttachments": {
1449
+ "name": "setAttachments",
1450
+ "async": false,
1451
+ "parameters": [
1452
+ {
1453
+ "name": "items",
1454
+ "type": "Array<object>",
1455
+ "optional": false
1456
+ }
1457
+ ],
1458
+ "returnType": "void",
1459
+ "isStatic": false,
1460
+ "isPublic": true
1461
+ },
1462
+ "getMetadata": {
1463
+ "name": "getMetadata",
1464
+ "async": false,
1465
+ "parameters": [],
1466
+ "returnType": "Record<string>",
1467
+ "isStatic": false,
1468
+ "isPublic": true
1469
+ },
1470
+ "setMetadata": {
1471
+ "name": "setMetadata",
1472
+ "async": false,
1473
+ "parameters": [
1474
+ {
1475
+ "name": "data",
1476
+ "type": "Record<string>",
1477
+ "optional": false
1478
+ }
1479
+ ],
1480
+ "returnType": "void",
1481
+ "isStatic": false,
1482
+ "isPublic": true
1483
+ },
1484
+ "getToolCallData": {
1485
+ "name": "getToolCallData",
1486
+ "async": false,
1487
+ "parameters": [],
1488
+ "returnType": "Record<string> | null",
1489
+ "isStatic": false,
1490
+ "isPublic": true
1491
+ },
1492
+ "setToolCallData": {
1493
+ "name": "setToolCallData",
1494
+ "async": false,
1495
+ "parameters": [
1496
+ {
1497
+ "name": "data",
1498
+ "type": "Record<string> | null",
1499
+ "optional": false
1500
+ }
1501
+ ],
1502
+ "returnType": "void",
1503
+ "isStatic": false,
1504
+ "isPublic": true
1505
+ },
1506
+ "hasAttachments": {
1507
+ "name": "hasAttachments",
1508
+ "async": false,
1509
+ "parameters": [],
1510
+ "returnType": "boolean",
1511
+ "isStatic": false,
1512
+ "isPublic": true
1513
+ },
1514
+ "isToolCall": {
1515
+ "name": "isToolCall",
1516
+ "async": false,
1517
+ "parameters": [],
1518
+ "returnType": "boolean",
1519
+ "isStatic": false,
1520
+ "isPublic": true
1521
+ },
1522
+ "isToolResult": {
1523
+ "name": "isToolResult",
1524
+ "async": false,
1525
+ "parameters": [],
1526
+ "returnType": "boolean",
1527
+ "isStatic": false,
1528
+ "isPublic": true
1529
+ },
1530
+ "isFromAgent": {
1531
+ "name": "isFromAgent",
1532
+ "async": false,
1533
+ "parameters": [],
1534
+ "returnType": "boolean",
1535
+ "isStatic": false,
1536
+ "isPublic": true
1537
+ },
1538
+ "isSystemMessage": {
1539
+ "name": "isSystemMessage",
1540
+ "async": false,
1541
+ "parameters": [],
1542
+ "returnType": "boolean",
1543
+ "isStatic": false,
1544
+ "isPublic": true
1545
+ },
1546
+ "edit": {
1547
+ "name": "edit",
1548
+ "async": true,
1549
+ "parameters": [
1550
+ {
1551
+ "name": "newContent",
1552
+ "type": "string",
1553
+ "optional": false
1554
+ }
1555
+ ],
1556
+ "returnType": "Promise<void>",
1557
+ "isStatic": false,
1558
+ "isPublic": true
1559
+ },
1560
+ "softDelete": {
1561
+ "name": "softDelete",
1562
+ "async": true,
1563
+ "parameters": [],
1564
+ "returnType": "Promise<void>",
1565
+ "isStatic": false,
1566
+ "isPublic": true
1567
+ },
1568
+ "getPreview": {
1569
+ "name": "getPreview",
1570
+ "async": false,
1571
+ "parameters": [
1572
+ {
1573
+ "name": "maxLength",
1574
+ "type": "any",
1575
+ "optional": true
1576
+ }
1577
+ ],
1578
+ "returnType": "string",
1579
+ "isStatic": false,
1580
+ "isPublic": true
1581
+ }
1582
+ },
1583
+ "decoratorConfig": {
1584
+ "tableName": "chat_messages",
1585
+ "api": {
1586
+ "include": [
1587
+ "list",
1588
+ "get"
1589
+ ]
1590
+ },
1591
+ "mcp": {
1592
+ "include": [
1593
+ "list",
1594
+ "get"
1595
+ ]
1596
+ },
1597
+ "cli": true,
1598
+ "tenantScoped": {
1599
+ "mode": "required"
1600
+ }
1601
+ },
1602
+ "extends": "SmrtObject",
1603
+ "exportName": "ChatMessage",
1604
+ "collectionExportName": "ChatMessageCollection",
1605
+ "validationRules": [
1606
+ {
1607
+ "field": "tenantId",
1608
+ "rule": "required",
1609
+ "fieldType": "text"
1610
+ },
1611
+ {
1612
+ "field": "roomId",
1613
+ "rule": "required",
1614
+ "fieldType": "foreignKey"
1615
+ },
1616
+ {
1617
+ "field": "senderProfileId",
1618
+ "rule": "required",
1619
+ "fieldType": "crossPackageRef"
1620
+ },
1621
+ {
1622
+ "field": "messageType",
1623
+ "rule": "required",
1624
+ "fieldType": "text"
1625
+ },
1626
+ {
1627
+ "field": "role",
1628
+ "rule": "required",
1629
+ "fieldType": "text"
1630
+ }
1631
+ ],
1632
+ "schema": {
1633
+ "tableName": "chat_messages",
1634
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"room_id\" UUID NOT NULL,\n \"thread_id\" UUID,\n \"sender_profile_id\" UUID NOT NULL,\n \"agent_session_id\" UUID,\n \"content\" TEXT DEFAULT '',\n \"message_type\" TEXT NOT NULL DEFAULT 'text',\n \"role\" TEXT NOT NULL DEFAULT 'user',\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"edited_at\" TIMESTAMP,\n \"is_deleted\" BOOLEAN DEFAULT FALSE,\n \"reply_to_message_id\" UUID,\n \"metadata\" TEXT DEFAULT '{}',\n \"tool_call_data\" TEXT,\n \"attachments\" TEXT DEFAULT '[]'\n);",
1635
+ "columns": {
1636
+ "id": {
1637
+ "type": "UUID",
1638
+ "primaryKey": true,
1639
+ "referenceKind": "id",
1640
+ "notNull": true
1641
+ },
1642
+ "slug": {
1643
+ "type": "TEXT",
1644
+ "notNull": true
1645
+ },
1646
+ "context": {
1647
+ "type": "TEXT",
1648
+ "notNull": true,
1649
+ "default": ""
1650
+ },
1651
+ "created_at": {
1652
+ "type": "TIMESTAMP",
1653
+ "notNull": true,
1654
+ "default": "current_timestamp"
1655
+ },
1656
+ "updated_at": {
1657
+ "type": "TIMESTAMP",
1658
+ "notNull": true,
1659
+ "default": "current_timestamp"
1660
+ },
1661
+ "tenant_id": {
1662
+ "type": "UUID",
1663
+ "referenceKind": "tenantId",
1664
+ "notNull": true,
1665
+ "unique": false
1666
+ },
1667
+ "room_id": {
1668
+ "type": "UUID",
1669
+ "referenceKind": "foreignKey",
1670
+ "notNull": true,
1671
+ "unique": false
1672
+ },
1673
+ "thread_id": {
1674
+ "type": "UUID",
1675
+ "referenceKind": "foreignKey",
1676
+ "notNull": false,
1677
+ "unique": false
1678
+ },
1679
+ "sender_profile_id": {
1680
+ "type": "UUID",
1681
+ "referenceKind": "crossPackageRef",
1682
+ "notNull": true,
1683
+ "unique": false
1684
+ },
1685
+ "agent_session_id": {
1686
+ "type": "UUID",
1687
+ "referenceKind": "foreignKey",
1688
+ "notNull": false,
1689
+ "unique": false
1690
+ },
1691
+ "content": {
1692
+ "type": "TEXT",
1693
+ "notNull": false,
1694
+ "unique": false,
1695
+ "default": ""
1696
+ },
1697
+ "message_type": {
1698
+ "type": "TEXT",
1699
+ "notNull": true,
1700
+ "unique": false,
1701
+ "default": "text"
1702
+ },
1703
+ "role": {
1704
+ "type": "TEXT",
1705
+ "notNull": true,
1706
+ "unique": false,
1707
+ "default": "user"
1708
+ },
1709
+ "is_edited": {
1710
+ "type": "BOOLEAN",
1711
+ "notNull": false,
1712
+ "unique": false,
1713
+ "default": false
1714
+ },
1715
+ "edited_at": {
1716
+ "type": "TIMESTAMP",
1717
+ "notNull": false,
1718
+ "unique": false
1719
+ },
1720
+ "is_deleted": {
1721
+ "type": "BOOLEAN",
1722
+ "notNull": false,
1723
+ "unique": false,
1724
+ "default": false
1725
+ },
1726
+ "reply_to_message_id": {
1727
+ "type": "UUID",
1728
+ "referenceKind": "foreignKey",
1729
+ "notNull": false,
1730
+ "unique": false
1731
+ },
1732
+ "metadata": {
1733
+ "type": "TEXT",
1734
+ "notNull": false,
1735
+ "unique": false,
1736
+ "default": "{}"
1737
+ },
1738
+ "tool_call_data": {
1739
+ "type": "TEXT",
1740
+ "notNull": false,
1741
+ "unique": false
1742
+ },
1743
+ "attachments": {
1744
+ "type": "TEXT",
1745
+ "notNull": false,
1746
+ "unique": false,
1747
+ "default": "[]"
1748
+ }
1749
+ },
1750
+ "indexes": [
1751
+ {
1752
+ "name": "chat_messages_id_idx",
1753
+ "columns": [
1754
+ "id"
1755
+ ]
1756
+ },
1757
+ {
1758
+ "name": "chat_messages_slug_context_idx",
1759
+ "columns": [
1760
+ "slug",
1761
+ "context"
1762
+ ],
1763
+ "unique": true
1764
+ }
1765
+ ],
1766
+ "version": "7469514e"
1767
+ }
1768
+ },
1769
+ "@happyvertical/smrt-chat:ChatParticipant": {
1770
+ "name": "chatparticipant",
1771
+ "className": "ChatParticipant",
1772
+ "qualifiedName": "@happyvertical/smrt-chat:ChatParticipant",
1773
+ "collection": "chatparticipants",
1774
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/ChatParticipant.ts",
1775
+ "packageName": "@happyvertical/smrt-chat",
1776
+ "fields": {
1777
+ "tenantId": {
1778
+ "type": "text",
1779
+ "required": true,
1780
+ "_meta": {
1781
+ "sqlType": "UUID",
1782
+ "__tenancy": {
1783
+ "isTenantIdField": true,
1784
+ "autoFilter": true,
1785
+ "required": true,
1786
+ "autoPopulate": true,
1787
+ "nullable": false,
1788
+ "mode": "required",
1789
+ "field": "tenantId",
1790
+ "allowSuperAdminBypass": false
1791
+ }
1792
+ }
1793
+ },
1794
+ "roomId": {
1795
+ "type": "foreignKey",
1796
+ "required": true,
1797
+ "related": "ChatRoom",
1798
+ "_meta": {
1799
+ "required": true
1800
+ }
1801
+ },
1802
+ "profileId": {
1803
+ "type": "crossPackageRef",
1804
+ "required": true,
1805
+ "related": "@happyvertical/smrt-profiles:Profile"
1806
+ },
1807
+ "role": {
1808
+ "type": "text",
1809
+ "required": true,
1810
+ "default": "member",
1811
+ "_meta": {
1812
+ "required": true
1813
+ }
1814
+ },
1815
+ "status": {
1816
+ "type": "text",
1817
+ "required": true,
1818
+ "default": "active",
1819
+ "_meta": {
1820
+ "required": true
1821
+ }
1822
+ },
1823
+ "onlineStatus": {
1824
+ "type": "text",
1825
+ "required": true,
1826
+ "default": "offline",
1827
+ "_meta": {
1828
+ "required": true
1829
+ }
1830
+ },
1831
+ "lastReadMessageId": {
1832
+ "type": "foreignKey",
1833
+ "required": false,
1834
+ "related": "ChatMessage"
1835
+ },
1836
+ "lastSeenAt": {
1837
+ "type": "datetime",
1838
+ "required": false
1839
+ },
1840
+ "joinedAt": {
1841
+ "type": "datetime",
1842
+ "required": false
1843
+ },
1844
+ "nickname": {
1845
+ "type": "text",
1846
+ "required": false,
1847
+ "default": ""
1848
+ },
1849
+ "isMuted": {
1850
+ "type": "boolean",
1851
+ "required": false,
1852
+ "default": false
1853
+ },
1854
+ "isPinned": {
1855
+ "type": "boolean",
1856
+ "required": false,
1857
+ "default": false
1858
+ }
1859
+ },
1860
+ "methods": {
1861
+ "isActive": {
1862
+ "name": "isActive",
1863
+ "async": false,
1864
+ "parameters": [],
1865
+ "returnType": "boolean",
1866
+ "isStatic": false,
1867
+ "isPublic": true
1868
+ },
1869
+ "isOwner": {
1870
+ "name": "isOwner",
1871
+ "async": false,
1872
+ "parameters": [],
1873
+ "returnType": "boolean",
1874
+ "isStatic": false,
1875
+ "isPublic": true
1876
+ },
1877
+ "isAdmin": {
1878
+ "name": "isAdmin",
1879
+ "async": false,
1880
+ "parameters": [],
1881
+ "returnType": "boolean",
1882
+ "isStatic": false,
1883
+ "isPublic": true
1884
+ },
1885
+ "markRead": {
1886
+ "name": "markRead",
1887
+ "async": true,
1888
+ "parameters": [
1889
+ {
1890
+ "name": "messageId",
1891
+ "type": "string",
1892
+ "optional": false
1893
+ }
1894
+ ],
1895
+ "returnType": "Promise<void>",
1896
+ "isStatic": false,
1897
+ "isPublic": true
1898
+ },
1899
+ "leave": {
1900
+ "name": "leave",
1901
+ "async": true,
1902
+ "parameters": [],
1903
+ "returnType": "Promise<void>",
1904
+ "isStatic": false,
1905
+ "isPublic": true
1906
+ },
1907
+ "setOnline": {
1908
+ "name": "setOnline",
1909
+ "async": true,
1910
+ "parameters": [
1911
+ {
1912
+ "name": "status",
1913
+ "type": "OnlineStatus",
1914
+ "optional": false
1915
+ }
1916
+ ],
1917
+ "returnType": "Promise<void>",
1918
+ "isStatic": false,
1919
+ "isPublic": true
1920
+ }
1921
+ },
1922
+ "decoratorConfig": {
1923
+ "tableName": "chat_participants",
1924
+ "api": {
1925
+ "include": [
1926
+ "list",
1927
+ "get"
1928
+ ]
1929
+ },
1930
+ "mcp": {
1931
+ "include": [
1932
+ "list",
1933
+ "get"
1934
+ ]
1935
+ },
1936
+ "cli": true,
1937
+ "tenantScoped": {
1938
+ "mode": "required"
1939
+ }
1940
+ },
1941
+ "extends": "SmrtObject",
1942
+ "exportName": "ChatParticipant",
1943
+ "collectionExportName": "ChatParticipantCollection",
1944
+ "validationRules": [
1945
+ {
1946
+ "field": "tenantId",
1947
+ "rule": "required",
1948
+ "fieldType": "text"
1949
+ },
1950
+ {
1951
+ "field": "roomId",
1952
+ "rule": "required",
1953
+ "fieldType": "foreignKey"
1954
+ },
1955
+ {
1956
+ "field": "profileId",
1957
+ "rule": "required",
1958
+ "fieldType": "crossPackageRef"
1959
+ },
1960
+ {
1961
+ "field": "role",
1962
+ "rule": "required",
1963
+ "fieldType": "text"
1964
+ },
1965
+ {
1966
+ "field": "status",
1967
+ "rule": "required",
1968
+ "fieldType": "text"
1969
+ },
1970
+ {
1971
+ "field": "onlineStatus",
1972
+ "rule": "required",
1973
+ "fieldType": "text"
1974
+ }
1975
+ ],
1976
+ "schema": {
1977
+ "tableName": "chat_participants",
1978
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_participants\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"room_id\" UUID NOT NULL,\n \"profile_id\" UUID NOT NULL,\n \"role\" TEXT NOT NULL DEFAULT 'member',\n \"status\" TEXT NOT NULL DEFAULT 'active',\n \"online_status\" TEXT NOT NULL DEFAULT 'offline',\n \"last_read_message_id\" UUID,\n \"last_seen_at\" TIMESTAMP,\n \"joined_at\" TIMESTAMP,\n \"nickname\" TEXT DEFAULT '',\n \"is_muted\" BOOLEAN DEFAULT FALSE,\n \"is_pinned\" BOOLEAN DEFAULT FALSE\n);",
1979
+ "columns": {
1980
+ "id": {
1981
+ "type": "UUID",
1982
+ "primaryKey": true,
1983
+ "referenceKind": "id",
1984
+ "notNull": true
1985
+ },
1986
+ "slug": {
1987
+ "type": "TEXT",
1988
+ "notNull": true
1989
+ },
1990
+ "context": {
1991
+ "type": "TEXT",
1992
+ "notNull": true,
1993
+ "default": ""
1994
+ },
1995
+ "created_at": {
1996
+ "type": "TIMESTAMP",
1997
+ "notNull": true,
1998
+ "default": "current_timestamp"
1999
+ },
2000
+ "updated_at": {
2001
+ "type": "TIMESTAMP",
2002
+ "notNull": true,
2003
+ "default": "current_timestamp"
2004
+ },
2005
+ "tenant_id": {
2006
+ "type": "UUID",
2007
+ "referenceKind": "tenantId",
2008
+ "notNull": true,
2009
+ "unique": false
2010
+ },
2011
+ "room_id": {
2012
+ "type": "UUID",
2013
+ "referenceKind": "foreignKey",
2014
+ "notNull": true,
2015
+ "unique": false
2016
+ },
2017
+ "profile_id": {
2018
+ "type": "UUID",
2019
+ "referenceKind": "crossPackageRef",
2020
+ "notNull": true,
2021
+ "unique": false
2022
+ },
2023
+ "role": {
2024
+ "type": "TEXT",
2025
+ "notNull": true,
2026
+ "unique": false,
2027
+ "default": "member"
2028
+ },
2029
+ "status": {
2030
+ "type": "TEXT",
2031
+ "notNull": true,
2032
+ "unique": false,
2033
+ "default": "active"
2034
+ },
2035
+ "online_status": {
2036
+ "type": "TEXT",
2037
+ "notNull": true,
2038
+ "unique": false,
2039
+ "default": "offline"
2040
+ },
2041
+ "last_read_message_id": {
2042
+ "type": "UUID",
2043
+ "referenceKind": "foreignKey",
2044
+ "notNull": false,
2045
+ "unique": false
2046
+ },
2047
+ "last_seen_at": {
2048
+ "type": "TIMESTAMP",
2049
+ "notNull": false,
2050
+ "unique": false
2051
+ },
2052
+ "joined_at": {
2053
+ "type": "TIMESTAMP",
2054
+ "notNull": false,
2055
+ "unique": false
2056
+ },
2057
+ "nickname": {
2058
+ "type": "TEXT",
2059
+ "notNull": false,
2060
+ "unique": false,
2061
+ "default": ""
2062
+ },
2063
+ "is_muted": {
2064
+ "type": "BOOLEAN",
2065
+ "notNull": false,
2066
+ "unique": false,
2067
+ "default": false
2068
+ },
2069
+ "is_pinned": {
2070
+ "type": "BOOLEAN",
2071
+ "notNull": false,
2072
+ "unique": false,
2073
+ "default": false
2074
+ }
2075
+ },
2076
+ "indexes": [
2077
+ {
2078
+ "name": "chat_participants_id_idx",
2079
+ "columns": [
2080
+ "id"
2081
+ ]
2082
+ },
2083
+ {
2084
+ "name": "chat_participants_slug_context_idx",
2085
+ "columns": [
2086
+ "slug",
2087
+ "context"
2088
+ ],
2089
+ "unique": true
2090
+ }
2091
+ ],
2092
+ "version": "50824444"
2093
+ }
2094
+ },
2095
+ "@happyvertical/smrt-chat:ChatReaction": {
2096
+ "name": "chatreaction",
2097
+ "className": "ChatReaction",
2098
+ "qualifiedName": "@happyvertical/smrt-chat:ChatReaction",
2099
+ "collection": "chatreactions",
2100
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/ChatReaction.ts",
2101
+ "packageName": "@happyvertical/smrt-chat",
2102
+ "fields": {
2103
+ "tenantId": {
2104
+ "type": "text",
2105
+ "required": true,
2106
+ "_meta": {
2107
+ "sqlType": "UUID",
2108
+ "__tenancy": {
2109
+ "isTenantIdField": true,
2110
+ "autoFilter": true,
2111
+ "required": true,
2112
+ "autoPopulate": true,
2113
+ "nullable": false,
2114
+ "mode": "required",
2115
+ "field": "tenantId",
2116
+ "allowSuperAdminBypass": false
2117
+ }
2118
+ }
2119
+ },
2120
+ "messageId": {
2121
+ "type": "foreignKey",
2122
+ "required": true,
2123
+ "related": "ChatMessage",
2124
+ "_meta": {
2125
+ "required": true
2126
+ }
2127
+ },
2128
+ "profileId": {
2129
+ "type": "crossPackageRef",
2130
+ "required": true,
2131
+ "related": "@happyvertical/smrt-profiles:Profile"
2132
+ },
2133
+ "emoji": {
2134
+ "type": "text",
2135
+ "required": true,
2136
+ "default": "",
2137
+ "_meta": {
2138
+ "required": true
2139
+ }
2140
+ }
2141
+ },
2142
+ "methods": {},
2143
+ "decoratorConfig": {
2144
+ "tableName": "chat_reactions",
2145
+ "api": {
2146
+ "include": [
2147
+ "list"
2148
+ ]
2149
+ },
2150
+ "mcp": {
2151
+ "include": [
2152
+ "list"
2153
+ ]
2154
+ },
2155
+ "cli": false,
2156
+ "tenantScoped": {
2157
+ "mode": "required"
2158
+ }
2159
+ },
2160
+ "extends": "SmrtObject",
2161
+ "exportName": "ChatReaction",
2162
+ "collectionExportName": "ChatReactionCollection",
2163
+ "validationRules": [
2164
+ {
2165
+ "field": "tenantId",
2166
+ "rule": "required",
2167
+ "fieldType": "text"
2168
+ },
2169
+ {
2170
+ "field": "messageId",
2171
+ "rule": "required",
2172
+ "fieldType": "foreignKey"
2173
+ },
2174
+ {
2175
+ "field": "profileId",
2176
+ "rule": "required",
2177
+ "fieldType": "crossPackageRef"
2178
+ },
2179
+ {
2180
+ "field": "emoji",
2181
+ "rule": "required",
2182
+ "fieldType": "text"
2183
+ }
2184
+ ],
2185
+ "schema": {
2186
+ "tableName": "chat_reactions",
2187
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_reactions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"message_id\" UUID NOT NULL,\n \"profile_id\" UUID NOT NULL,\n \"emoji\" TEXT NOT NULL DEFAULT ''\n);",
2188
+ "columns": {
2189
+ "id": {
2190
+ "type": "UUID",
2191
+ "primaryKey": true,
2192
+ "referenceKind": "id",
2193
+ "notNull": true
2194
+ },
2195
+ "slug": {
2196
+ "type": "TEXT",
2197
+ "notNull": true
2198
+ },
2199
+ "context": {
2200
+ "type": "TEXT",
2201
+ "notNull": true,
2202
+ "default": ""
2203
+ },
2204
+ "created_at": {
2205
+ "type": "TIMESTAMP",
2206
+ "notNull": true,
2207
+ "default": "current_timestamp"
2208
+ },
2209
+ "updated_at": {
2210
+ "type": "TIMESTAMP",
2211
+ "notNull": true,
2212
+ "default": "current_timestamp"
2213
+ },
2214
+ "tenant_id": {
2215
+ "type": "UUID",
2216
+ "referenceKind": "tenantId",
2217
+ "notNull": true,
2218
+ "unique": false
2219
+ },
2220
+ "message_id": {
2221
+ "type": "UUID",
2222
+ "referenceKind": "foreignKey",
2223
+ "notNull": true,
2224
+ "unique": false
2225
+ },
2226
+ "profile_id": {
2227
+ "type": "UUID",
2228
+ "referenceKind": "crossPackageRef",
2229
+ "notNull": true,
2230
+ "unique": false
2231
+ },
2232
+ "emoji": {
2233
+ "type": "TEXT",
2234
+ "notNull": true,
2235
+ "unique": false,
2236
+ "default": ""
2237
+ }
2238
+ },
2239
+ "indexes": [
2240
+ {
2241
+ "name": "chat_reactions_id_idx",
2242
+ "columns": [
2243
+ "id"
2244
+ ]
2245
+ },
2246
+ {
2247
+ "name": "chat_reactions_slug_context_idx",
2248
+ "columns": [
2249
+ "slug",
2250
+ "context"
2251
+ ],
2252
+ "unique": true
2253
+ }
2254
+ ],
2255
+ "version": "8378c874"
2256
+ }
2257
+ },
2258
+ "@happyvertical/smrt-chat:ChatRoom": {
2259
+ "name": "chatroom",
2260
+ "className": "ChatRoom",
2261
+ "qualifiedName": "@happyvertical/smrt-chat:ChatRoom",
2262
+ "collection": "chatrooms",
2263
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/ChatRoom.ts",
2264
+ "packageName": "@happyvertical/smrt-chat",
2265
+ "fields": {
2266
+ "tenantId": {
2267
+ "type": "text",
2268
+ "required": true,
2269
+ "_meta": {
2270
+ "sqlType": "UUID",
2271
+ "__tenancy": {
2272
+ "isTenantIdField": true,
2273
+ "autoFilter": true,
2274
+ "required": true,
2275
+ "autoPopulate": true,
2276
+ "nullable": false,
2277
+ "mode": "required",
2278
+ "field": "tenantId",
2279
+ "allowSuperAdminBypass": false
2280
+ }
2281
+ }
2282
+ },
2283
+ "name": {
2284
+ "type": "text",
2285
+ "required": false,
2286
+ "default": ""
2287
+ },
2288
+ "description": {
2289
+ "type": "text",
2290
+ "required": false,
2291
+ "default": ""
2292
+ },
2293
+ "roomType": {
2294
+ "type": "text",
2295
+ "required": true,
2296
+ "default": "public",
2297
+ "_meta": {
2298
+ "required": true
2299
+ }
2300
+ },
2301
+ "status": {
2302
+ "type": "text",
2303
+ "required": true,
2304
+ "default": "active",
2305
+ "_meta": {
2306
+ "required": true
2307
+ }
2308
+ },
2309
+ "topic": {
2310
+ "type": "text",
2311
+ "required": false,
2312
+ "default": ""
2313
+ },
2314
+ "avatarUrl": {
2315
+ "type": "text",
2316
+ "required": false,
2317
+ "default": ""
2318
+ },
2319
+ "isArchived": {
2320
+ "type": "boolean",
2321
+ "required": false,
2322
+ "default": false
2323
+ },
2324
+ "maxParticipants": {
2325
+ "type": "integer",
2326
+ "required": false,
2327
+ "default": 0
2328
+ },
2329
+ "metadata": {
2330
+ "type": "text",
2331
+ "required": false,
2332
+ "default": "{}"
2333
+ },
2334
+ "createdByProfileId": {
2335
+ "type": "crossPackageRef",
2336
+ "required": false,
2337
+ "related": "@happyvertical/smrt-profiles:Profile"
2338
+ },
2339
+ "lastMessageAt": {
2340
+ "type": "datetime",
2341
+ "required": false
2342
+ }
2343
+ },
2344
+ "methods": {
2345
+ "getMetadata": {
2346
+ "name": "getMetadata",
2347
+ "async": false,
2348
+ "parameters": [],
2349
+ "returnType": "ChatRoomMetadata",
2350
+ "isStatic": false,
2351
+ "isPublic": true
2352
+ },
2353
+ "setMetadata": {
2354
+ "name": "setMetadata",
2355
+ "async": false,
2356
+ "parameters": [
2357
+ {
2358
+ "name": "data",
2359
+ "type": "ChatRoomMetadata",
2360
+ "optional": false
2361
+ }
2362
+ ],
2363
+ "returnType": "void",
2364
+ "isStatic": false,
2365
+ "isPublic": true
2366
+ },
2367
+ "updateMetadata": {
2368
+ "name": "updateMetadata",
2369
+ "async": false,
2370
+ "parameters": [
2371
+ {
2372
+ "name": "updates",
2373
+ "type": "ChatRoomMetadata",
2374
+ "optional": false
2375
+ }
2376
+ ],
2377
+ "returnType": "void",
2378
+ "isStatic": false,
2379
+ "isPublic": true
2380
+ },
2381
+ "isDM": {
2382
+ "name": "isDM",
2383
+ "async": false,
2384
+ "parameters": [],
2385
+ "returnType": "boolean",
2386
+ "isStatic": false,
2387
+ "isPublic": true
2388
+ },
2389
+ "isAgentRoom": {
2390
+ "name": "isAgentRoom",
2391
+ "async": false,
2392
+ "parameters": [],
2393
+ "returnType": "boolean",
2394
+ "isStatic": false,
2395
+ "isPublic": true
2396
+ },
2397
+ "isPublic": {
2398
+ "name": "isPublic",
2399
+ "async": false,
2400
+ "parameters": [],
2401
+ "returnType": "boolean",
2402
+ "isStatic": false,
2403
+ "isPublic": true
2404
+ },
2405
+ "isActive": {
2406
+ "name": "isActive",
2407
+ "async": false,
2408
+ "parameters": [],
2409
+ "returnType": "boolean",
2410
+ "isStatic": false,
2411
+ "isPublic": true
2412
+ },
2413
+ "archive": {
2414
+ "name": "archive",
2415
+ "async": true,
2416
+ "parameters": [],
2417
+ "returnType": "Promise<void>",
2418
+ "isStatic": false,
2419
+ "isPublic": true
2420
+ },
2421
+ "unarchive": {
2422
+ "name": "unarchive",
2423
+ "async": true,
2424
+ "parameters": [],
2425
+ "returnType": "Promise<void>",
2426
+ "isStatic": false,
2427
+ "isPublic": true
2428
+ }
2429
+ },
2430
+ "decoratorConfig": {
2431
+ "tableName": "chat_rooms",
2432
+ "api": {
2433
+ "include": [
2434
+ "list",
2435
+ "get"
2436
+ ]
2437
+ },
2438
+ "mcp": {
2439
+ "include": [
2440
+ "list",
2441
+ "get"
2442
+ ]
2443
+ },
2444
+ "cli": true,
2445
+ "tenantScoped": {
2446
+ "mode": "required"
2447
+ }
2448
+ },
2449
+ "extends": "SmrtObject",
2450
+ "exportName": "ChatRoom",
2451
+ "collectionExportName": "ChatRoomCollection",
2452
+ "validationRules": [
2453
+ {
2454
+ "field": "tenantId",
2455
+ "rule": "required",
2456
+ "fieldType": "text"
2457
+ },
2458
+ {
2459
+ "field": "roomType",
2460
+ "rule": "required",
2461
+ "fieldType": "text"
2462
+ },
2463
+ {
2464
+ "field": "status",
2465
+ "rule": "required",
2466
+ "fieldType": "text"
2467
+ }
2468
+ ],
2469
+ "schema": {
2470
+ "tableName": "chat_rooms",
2471
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_rooms\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"room_type\" TEXT NOT NULL DEFAULT 'public',\n \"status\" TEXT NOT NULL DEFAULT 'active',\n \"topic\" TEXT DEFAULT '',\n \"avatar_url\" TEXT DEFAULT '',\n \"is_archived\" BOOLEAN DEFAULT FALSE,\n \"max_participants\" INTEGER DEFAULT 0,\n \"metadata\" TEXT DEFAULT '{}',\n \"created_by_profile_id\" UUID,\n \"last_message_at\" TIMESTAMP\n);",
2472
+ "columns": {
2473
+ "id": {
2474
+ "type": "UUID",
2475
+ "primaryKey": true,
2476
+ "referenceKind": "id",
2477
+ "notNull": true
2478
+ },
2479
+ "slug": {
2480
+ "type": "TEXT",
2481
+ "notNull": true
2482
+ },
2483
+ "context": {
2484
+ "type": "TEXT",
2485
+ "notNull": true,
2486
+ "default": ""
2487
+ },
2488
+ "created_at": {
2489
+ "type": "TIMESTAMP",
2490
+ "notNull": true,
2491
+ "default": "current_timestamp"
2492
+ },
2493
+ "updated_at": {
2494
+ "type": "TIMESTAMP",
2495
+ "notNull": true,
2496
+ "default": "current_timestamp"
2497
+ },
2498
+ "tenant_id": {
2499
+ "type": "UUID",
2500
+ "referenceKind": "tenantId",
2501
+ "notNull": true,
2502
+ "unique": false
2503
+ },
2504
+ "name": {
2505
+ "type": "TEXT",
2506
+ "notNull": false,
2507
+ "unique": false,
2508
+ "default": ""
2509
+ },
2510
+ "description": {
2511
+ "type": "TEXT",
2512
+ "notNull": false,
2513
+ "unique": false,
2514
+ "default": ""
2515
+ },
2516
+ "room_type": {
2517
+ "type": "TEXT",
2518
+ "notNull": true,
2519
+ "unique": false,
2520
+ "default": "public"
2521
+ },
2522
+ "status": {
2523
+ "type": "TEXT",
2524
+ "notNull": true,
2525
+ "unique": false,
2526
+ "default": "active"
2527
+ },
2528
+ "topic": {
2529
+ "type": "TEXT",
2530
+ "notNull": false,
2531
+ "unique": false,
2532
+ "default": ""
2533
+ },
2534
+ "avatar_url": {
2535
+ "type": "TEXT",
2536
+ "notNull": false,
2537
+ "unique": false,
2538
+ "default": ""
2539
+ },
2540
+ "is_archived": {
2541
+ "type": "BOOLEAN",
2542
+ "notNull": false,
2543
+ "unique": false,
2544
+ "default": false
2545
+ },
2546
+ "max_participants": {
2547
+ "type": "INTEGER",
2548
+ "notNull": false,
2549
+ "unique": false,
2550
+ "default": 0
2551
+ },
2552
+ "metadata": {
2553
+ "type": "TEXT",
2554
+ "notNull": false,
2555
+ "unique": false,
2556
+ "default": "{}"
2557
+ },
2558
+ "created_by_profile_id": {
2559
+ "type": "UUID",
2560
+ "referenceKind": "crossPackageRef",
2561
+ "notNull": false,
2562
+ "unique": false
2563
+ },
2564
+ "last_message_at": {
2565
+ "type": "TIMESTAMP",
2566
+ "notNull": false,
2567
+ "unique": false
2568
+ }
2569
+ },
2570
+ "indexes": [
2571
+ {
2572
+ "name": "chat_rooms_id_idx",
2573
+ "columns": [
2574
+ "id"
2575
+ ]
2576
+ },
2577
+ {
2578
+ "name": "chat_rooms_slug_context_idx",
2579
+ "columns": [
2580
+ "slug",
2581
+ "context"
2582
+ ],
2583
+ "unique": true
2584
+ }
2585
+ ],
2586
+ "version": "3665d881"
2587
+ }
2588
+ },
2589
+ "@happyvertical/smrt-chat:ChatThread": {
2590
+ "name": "chatthread",
2591
+ "className": "ChatThread",
2592
+ "qualifiedName": "@happyvertical/smrt-chat:ChatThread",
2593
+ "collection": "chatthreads",
2594
+ "filePath": "/home/runner/_work/smrt/smrt/packages/chat/src/models/ChatThread.ts",
2595
+ "packageName": "@happyvertical/smrt-chat",
2596
+ "fields": {
2597
+ "tenantId": {
2598
+ "type": "text",
2599
+ "required": true,
2600
+ "_meta": {
2601
+ "sqlType": "UUID",
2602
+ "__tenancy": {
2603
+ "isTenantIdField": true,
2604
+ "autoFilter": true,
2605
+ "required": true,
2606
+ "autoPopulate": true,
2607
+ "nullable": false,
2608
+ "mode": "required",
2609
+ "field": "tenantId",
2610
+ "allowSuperAdminBypass": false
2611
+ }
2612
+ }
2613
+ },
2614
+ "roomId": {
2615
+ "type": "foreignKey",
2616
+ "required": true,
2617
+ "related": "ChatRoom",
2618
+ "_meta": {
2619
+ "required": true
2620
+ }
2621
+ },
2622
+ "rootMessageId": {
2623
+ "type": "foreignKey",
2624
+ "required": false,
2625
+ "related": "ChatMessage",
2626
+ "_meta": {
2627
+ "nullable": true
2628
+ }
2629
+ },
2630
+ "title": {
2631
+ "type": "text",
2632
+ "required": false,
2633
+ "default": ""
2634
+ },
2635
+ "isResolved": {
2636
+ "type": "boolean",
2637
+ "required": false,
2638
+ "default": false
2639
+ },
2640
+ "messageCount": {
2641
+ "type": "integer",
2642
+ "required": false,
2643
+ "default": 0
2644
+ },
2645
+ "lastMessageAt": {
2646
+ "type": "datetime",
2647
+ "required": false
2648
+ },
2649
+ "participantCount": {
2650
+ "type": "integer",
2651
+ "required": false,
2652
+ "default": 0
2653
+ }
2654
+ },
2655
+ "methods": {
2656
+ "resolve": {
2657
+ "name": "resolve",
2658
+ "async": true,
2659
+ "parameters": [],
2660
+ "returnType": "Promise<void>",
2661
+ "isStatic": false,
2662
+ "isPublic": true
2663
+ },
2664
+ "reopen": {
2665
+ "name": "reopen",
2666
+ "async": true,
2667
+ "parameters": [],
2668
+ "returnType": "Promise<void>",
2669
+ "isStatic": false,
2670
+ "isPublic": true
2671
+ }
2672
+ },
2673
+ "decoratorConfig": {
2674
+ "tableName": "chat_threads",
2675
+ "api": {
2676
+ "include": [
2677
+ "list",
2678
+ "get"
2679
+ ]
2680
+ },
2681
+ "mcp": {
2682
+ "include": [
2683
+ "list",
2684
+ "get"
2685
+ ]
2686
+ },
2687
+ "cli": true,
2688
+ "tenantScoped": {
2689
+ "mode": "required"
2690
+ }
2691
+ },
2692
+ "extends": "SmrtObject",
2693
+ "exportName": "ChatThread",
2694
+ "collectionExportName": "ChatThreadCollection",
2695
+ "validationRules": [
2696
+ {
2697
+ "field": "tenantId",
2698
+ "rule": "required",
2699
+ "fieldType": "text"
2700
+ },
2701
+ {
2702
+ "field": "roomId",
2703
+ "rule": "required",
2704
+ "fieldType": "foreignKey"
2705
+ }
2706
+ ],
2707
+ "schema": {
2708
+ "tableName": "chat_threads",
2709
+ "ddl": "CREATE TABLE IF NOT EXISTS \"chat_threads\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"room_id\" UUID NOT NULL,\n \"root_message_id\" UUID,\n \"title\" TEXT DEFAULT '',\n \"is_resolved\" BOOLEAN DEFAULT FALSE,\n \"message_count\" INTEGER DEFAULT 0,\n \"last_message_at\" TIMESTAMP,\n \"participant_count\" INTEGER DEFAULT 0\n);",
2710
+ "columns": {
2711
+ "id": {
2712
+ "type": "UUID",
2713
+ "primaryKey": true,
2714
+ "referenceKind": "id",
2715
+ "notNull": true
2716
+ },
2717
+ "slug": {
2718
+ "type": "TEXT",
2719
+ "notNull": true
2720
+ },
2721
+ "context": {
2722
+ "type": "TEXT",
2723
+ "notNull": true,
2724
+ "default": ""
2725
+ },
2726
+ "created_at": {
2727
+ "type": "TIMESTAMP",
2728
+ "notNull": true,
2729
+ "default": "current_timestamp"
2730
+ },
2731
+ "updated_at": {
2732
+ "type": "TIMESTAMP",
2733
+ "notNull": true,
2734
+ "default": "current_timestamp"
2735
+ },
2736
+ "tenant_id": {
2737
+ "type": "UUID",
2738
+ "referenceKind": "tenantId",
2739
+ "notNull": true,
2740
+ "unique": false
2741
+ },
2742
+ "room_id": {
2743
+ "type": "UUID",
2744
+ "referenceKind": "foreignKey",
2745
+ "notNull": true,
2746
+ "unique": false
2747
+ },
2748
+ "root_message_id": {
2749
+ "type": "UUID",
2750
+ "referenceKind": "foreignKey",
2751
+ "notNull": false,
2752
+ "unique": false
2753
+ },
2754
+ "title": {
2755
+ "type": "TEXT",
2756
+ "notNull": false,
2757
+ "unique": false,
2758
+ "default": ""
2759
+ },
2760
+ "is_resolved": {
2761
+ "type": "BOOLEAN",
2762
+ "notNull": false,
2763
+ "unique": false,
2764
+ "default": false
2765
+ },
2766
+ "message_count": {
2767
+ "type": "INTEGER",
2768
+ "notNull": false,
2769
+ "unique": false,
2770
+ "default": 0
2771
+ },
2772
+ "last_message_at": {
2773
+ "type": "TIMESTAMP",
2774
+ "notNull": false,
2775
+ "unique": false
2776
+ },
2777
+ "participant_count": {
2778
+ "type": "INTEGER",
2779
+ "notNull": false,
2780
+ "unique": false,
2781
+ "default": 0
2782
+ }
2783
+ },
2784
+ "indexes": [
2785
+ {
2786
+ "name": "chat_threads_id_idx",
2787
+ "columns": [
2788
+ "id"
2789
+ ]
2790
+ },
2791
+ {
2792
+ "name": "chat_threads_slug_context_idx",
2793
+ "columns": [
2794
+ "slug",
2795
+ "context"
2796
+ ],
2797
+ "unique": true
2798
+ }
2799
+ ],
2800
+ "version": "6fd35191"
2801
+ }
2802
+ }
2803
+ },
2804
+ "moduleType": "smrt",
2805
+ "smrtDependencies": [
2806
+ "@happyvertical/smrt-agents",
2807
+ "@happyvertical/smrt-core",
2808
+ "@happyvertical/smrt-profiles",
2809
+ "@happyvertical/smrt-tenancy"
2810
+ ]
2811
+ }