@lobehub/lobehub 2.0.0-next.190 → 2.0.0-next.191

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 (87) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/changelog/v1.json +9 -0
  3. package/package.json +1 -1
  4. package/packages/const/src/utils/merge.test.ts +679 -0
  5. package/packages/context-engine/src/processors/__tests__/AgentCouncilFlatten.test.ts +0 -20
  6. package/packages/context-engine/src/processors/__tests__/MessageContent.test.ts +5 -23
  7. package/packages/context-engine/src/providers/SystemRoleInjector.ts +0 -1
  8. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/simple.json +4 -19
  9. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/with-supervisor-reply.json +4 -23
  10. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentGroup/speak-different-agent.json +3 -13
  11. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-chain-with-followup.json +3 -8
  12. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/assistant-with-tools.json +21 -17
  13. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/tools-with-branches.json +15 -15
  14. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/active-index-1.json +3 -13
  15. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-branch.json +2 -9
  16. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-group-branches.json +0 -11
  17. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-user-branch.json +5 -15
  18. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/conversation.json +4 -14
  19. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/multi-assistant-group.json +0 -13
  20. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/nested.json +2 -15
  21. package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/simple.json +4 -9
  22. package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/with-tools.json +8 -17
  23. package/packages/conversation-flow/src/__tests__/fixtures/inputs/linear-conversation.json +3 -7
  24. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/simple.json +1 -7
  25. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/with-summary.json +10 -11
  26. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/simple.json +2 -32
  27. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/with-supervisor-reply.json +8 -46
  28. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentGroup/speak-different-agent.json +5 -24
  29. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistant-chain-with-followup.json +5 -13
  30. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/assistant-with-tools.json +6 -16
  31. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +6 -17
  32. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/active-index-1.json +4 -18
  33. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-branch.json +4 -16
  34. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-group-branches.json +0 -19
  35. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-user-branch.json +8 -24
  36. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/conversation.json +7 -23
  37. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/multi-assistant-group.json +0 -15
  38. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/nested.json +4 -25
  39. package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/simple.json +2 -13
  40. package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/with-tools.json +4 -20
  41. package/packages/conversation-flow/src/__tests__/fixtures/outputs/linear-conversation.json +4 -12
  42. package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/simple.json +2 -14
  43. package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/with-summary.json +20 -22
  44. package/packages/conversation-flow/src/__tests__/indexing.test.ts +0 -35
  45. package/packages/conversation-flow/src/__tests__/structuring.test.ts +0 -41
  46. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +0 -4
  47. package/packages/conversation-flow/src/transformation/__tests__/BranchResolver.test.ts +0 -10
  48. package/packages/conversation-flow/src/transformation/__tests__/ContextTreeBuilder.test.ts +0 -19
  49. package/packages/conversation-flow/src/transformation/__tests__/FlatListBuilder.test.ts +0 -37
  50. package/packages/conversation-flow/src/transformation/__tests__/MessageCollector.test.ts +0 -12
  51. package/packages/conversation-flow/src/transformation/__tests__/MessageTransformer.test.ts +0 -2
  52. package/packages/database/src/models/message.ts +0 -1
  53. package/packages/prompts/src/prompts/chatMessages/index.test.ts +0 -1
  54. package/packages/prompts/src/prompts/groupChat/__snapshots__/index.test.ts.snap +0 -21
  55. package/packages/prompts/src/prompts/groupChat/index.test.ts +0 -3
  56. package/packages/types/src/message/ui/chat.ts +0 -2
  57. package/src/features/Conversation/store/slices/data/action.test.ts +0 -14
  58. package/src/features/Conversation/store/slices/data/reducer.test.ts +0 -21
  59. package/src/features/Conversation/store/slices/data/reducer.ts +1 -1
  60. package/src/features/Conversation/store/slices/message/action/crud.test.ts +0 -10
  61. package/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts +3 -5
  62. package/src/server/routers/lambda/__tests__/message.test.ts +1 -2
  63. package/src/server/services/agentRuntime/AgentRuntimeService.ts +109 -109
  64. package/src/server/services/agentRuntime/types.ts +8 -8
  65. package/src/server/services/doc/index.tsx +2 -2
  66. package/src/server/services/generation/index.ts +2 -2
  67. package/src/server/services/message/index.ts +3 -3
  68. package/src/server/services/usage/index.ts +4 -4
  69. package/src/services/chat/chat.test.ts +0 -6
  70. package/src/services/chat/mecha/contextEngineering.test.ts +3 -29
  71. package/src/services/chat/mecha/modelParamsResolver.test.ts +803 -0
  72. package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +0 -2
  73. package/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts +0 -6
  74. package/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts +0 -3
  75. package/src/store/chat/agents/createAgentExecutors.ts +4 -4
  76. package/src/store/chat/slices/aiAgent/actions/__tests__/agentGroup.test.ts +0 -2
  77. package/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts +0 -3
  78. package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +0 -1
  79. package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +0 -4
  80. package/src/store/chat/slices/message/reducer.test.ts +0 -5
  81. package/src/store/chat/slices/message/reducer.ts +1 -1
  82. package/src/store/chat/slices/message/selectors/displayMessage.test.ts +0 -13
  83. package/src/store/chat/slices/message/selectors/displayMessage.ts +3 -34
  84. package/src/store/chat/slices/portal/selectors.test.ts +0 -7
  85. package/src/store/chat/slices/thread/action.test.ts +0 -1
  86. package/src/store/chat/slices/translate/action.test.ts +0 -1
  87. package/src/store/tool/slices/oldStore/action.test.ts +0 -1
@@ -35,7 +35,6 @@ describe('ContextTreeBuilder', () => {
35
35
  content: 'Hello',
36
36
  createdAt: 0,
37
37
  id: 'msg-1',
38
- meta: {},
39
38
  role: 'user',
40
39
  updatedAt: 0,
41
40
  },
@@ -46,7 +45,6 @@ describe('ContextTreeBuilder', () => {
46
45
  content: 'Hi',
47
46
  createdAt: 0,
48
47
  id: 'msg-2',
49
- meta: {},
50
48
  role: 'assistant',
51
49
  updatedAt: 0,
52
50
  },
@@ -76,7 +74,6 @@ describe('ContextTreeBuilder', () => {
76
74
  content: 'Hello',
77
75
  createdAt: 0,
78
76
  id: 'msg-1',
79
- meta: {},
80
77
  metadata: { activeBranchIndex: 0 },
81
78
  role: 'user',
82
79
  updatedAt: 0,
@@ -88,7 +85,6 @@ describe('ContextTreeBuilder', () => {
88
85
  content: 'Response 1',
89
86
  createdAt: 0,
90
87
  id: 'msg-2',
91
- meta: {},
92
88
  role: 'assistant',
93
89
  updatedAt: 0,
94
90
  },
@@ -99,7 +95,6 @@ describe('ContextTreeBuilder', () => {
99
95
  content: 'Response 2',
100
96
  createdAt: 0,
101
97
  id: 'msg-3',
102
- meta: {},
103
98
  role: 'assistant',
104
99
  updatedAt: 0,
105
100
  },
@@ -137,7 +132,6 @@ describe('ContextTreeBuilder', () => {
137
132
  content: 'Assistant with tools',
138
133
  createdAt: 0,
139
134
  id: 'msg-1',
140
- meta: {},
141
135
  role: 'assistant',
142
136
  tools: [
143
137
  {
@@ -157,7 +151,6 @@ describe('ContextTreeBuilder', () => {
157
151
  content: 'Tool result',
158
152
  createdAt: 0,
159
153
  id: 'tool-1',
160
- meta: {},
161
154
  role: 'tool',
162
155
  updatedAt: 0,
163
156
  },
@@ -191,7 +184,6 @@ describe('ContextTreeBuilder', () => {
191
184
  createdAt: 0,
192
185
  groupId: 'group-1',
193
186
  id: 'msg-1',
194
- meta: {},
195
187
  metadata: { activeColumn: true },
196
188
  role: 'assistant',
197
189
  updatedAt: 0,
@@ -204,7 +196,6 @@ describe('ContextTreeBuilder', () => {
204
196
  createdAt: 0,
205
197
  groupId: 'group-1',
206
198
  id: 'msg-2',
207
- meta: {},
208
199
  role: 'assistant',
209
200
  updatedAt: 0,
210
201
  },
@@ -237,7 +228,6 @@ describe('ContextTreeBuilder', () => {
237
228
  content: 'User message',
238
229
  createdAt: 0,
239
230
  id: 'msg-1',
240
- meta: {},
241
231
  metadata: { compare: true },
242
232
  role: 'user',
243
233
  updatedAt: 0,
@@ -249,7 +239,6 @@ describe('ContextTreeBuilder', () => {
249
239
  content: 'Assistant 1',
250
240
  createdAt: 0,
251
241
  id: 'msg-2',
252
- meta: {},
253
242
  metadata: { activeColumn: true },
254
243
  role: 'assistant',
255
244
  updatedAt: 0,
@@ -261,7 +250,6 @@ describe('ContextTreeBuilder', () => {
261
250
  content: 'Assistant 2',
262
251
  createdAt: 0,
263
252
  id: 'msg-3',
264
- meta: {},
265
253
  role: 'assistant',
266
254
  updatedAt: 0,
267
255
  },
@@ -319,7 +307,6 @@ describe('ContextTreeBuilder', () => {
319
307
  content: 'Hello',
320
308
  createdAt: 0,
321
309
  id: 'msg-1',
322
- meta: {},
323
310
  // activeBranchIndex = 2 means optimistic update (pointing to not-yet-created branch)
324
311
  metadata: { activeBranchIndex: 2 },
325
312
  role: 'user',
@@ -332,7 +319,6 @@ describe('ContextTreeBuilder', () => {
332
319
  content: 'Response 1',
333
320
  createdAt: 0,
334
321
  id: 'msg-2',
335
- meta: {},
336
322
  role: 'assistant',
337
323
  updatedAt: 0,
338
324
  },
@@ -343,7 +329,6 @@ describe('ContextTreeBuilder', () => {
343
329
  content: 'Response 2',
344
330
  createdAt: 0,
345
331
  id: 'msg-3',
346
- meta: {},
347
332
  role: 'assistant',
348
333
  updatedAt: 0,
349
334
  },
@@ -383,7 +368,6 @@ describe('ContextTreeBuilder', () => {
383
368
  content: 'User',
384
369
  createdAt: 0,
385
370
  id: 'msg-1',
386
- meta: {},
387
371
  metadata: { compare: true },
388
372
  role: 'user',
389
373
  updatedAt: 0,
@@ -395,7 +379,6 @@ describe('ContextTreeBuilder', () => {
395
379
  content: 'Assistant 1',
396
380
  createdAt: 0,
397
381
  id: 'msg-2',
398
- meta: {},
399
382
  metadata: { activeColumn: true },
400
383
  role: 'assistant',
401
384
  updatedAt: 0,
@@ -407,7 +390,6 @@ describe('ContextTreeBuilder', () => {
407
390
  content: 'Assistant 2',
408
391
  createdAt: 0,
409
392
  id: 'msg-3',
410
- meta: {},
411
393
  role: 'assistant',
412
394
  updatedAt: 0,
413
395
  },
@@ -418,7 +400,6 @@ describe('ContextTreeBuilder', () => {
418
400
  content: 'Follow-up',
419
401
  createdAt: 0,
420
402
  id: 'msg-4',
421
- meta: {},
422
403
  role: 'user',
423
404
  updatedAt: 0,
424
405
  },
@@ -45,7 +45,6 @@ describe('FlatListBuilder', () => {
45
45
  content: 'Hello',
46
46
  createdAt: 0,
47
47
  id: 'msg-1',
48
- meta: {},
49
48
  role: 'user',
50
49
  updatedAt: 0,
51
50
  },
@@ -53,7 +52,6 @@ describe('FlatListBuilder', () => {
53
52
  content: 'Hi',
54
53
  createdAt: 0,
55
54
  id: 'msg-2',
56
- meta: {},
57
55
  parentId: 'msg-1',
58
56
  role: 'assistant',
59
57
  updatedAt: 0,
@@ -74,7 +72,6 @@ describe('FlatListBuilder', () => {
74
72
  content: 'Request',
75
73
  createdAt: 0,
76
74
  id: 'msg-1',
77
- meta: {},
78
75
  role: 'user',
79
76
  updatedAt: 0,
80
77
  },
@@ -82,7 +79,6 @@ describe('FlatListBuilder', () => {
82
79
  content: 'Using tool',
83
80
  createdAt: 0,
84
81
  id: 'msg-2',
85
- meta: {},
86
82
  metadata: { totalInputTokens: 10, totalOutputTokens: 20 },
87
83
  parentId: 'msg-1',
88
84
  role: 'assistant',
@@ -95,7 +91,6 @@ describe('FlatListBuilder', () => {
95
91
  content: 'Tool result',
96
92
  createdAt: 0,
97
93
  id: 'tool-1',
98
- meta: {},
99
94
  parentId: 'msg-2',
100
95
  role: 'tool',
101
96
  tool_call_id: 'tool-1',
@@ -119,7 +114,6 @@ describe('FlatListBuilder', () => {
119
114
  content: 'User',
120
115
  createdAt: 0,
121
116
  id: 'msg-1',
122
- meta: {},
123
117
  metadata: { activeBranchIndex: 0 },
124
118
  role: 'user',
125
119
  updatedAt: 0,
@@ -128,7 +122,6 @@ describe('FlatListBuilder', () => {
128
122
  content: 'Branch 1',
129
123
  createdAt: 0,
130
124
  id: 'msg-2',
131
- meta: {},
132
125
  parentId: 'msg-1',
133
126
  role: 'assistant',
134
127
  updatedAt: 0,
@@ -137,7 +130,6 @@ describe('FlatListBuilder', () => {
137
130
  content: 'Branch 2',
138
131
  createdAt: 0,
139
132
  id: 'msg-3',
140
- meta: {},
141
133
  parentId: 'msg-1',
142
134
  role: 'assistant',
143
135
  updatedAt: 0,
@@ -158,7 +150,6 @@ describe('FlatListBuilder', () => {
158
150
  content: 'User',
159
151
  createdAt: 0,
160
152
  id: 'msg-1',
161
- meta: {},
162
153
  role: 'user',
163
154
  updatedAt: 0,
164
155
  },
@@ -166,7 +157,6 @@ describe('FlatListBuilder', () => {
166
157
  content: 'Assistant',
167
158
  createdAt: 0,
168
159
  id: 'msg-2',
169
- meta: {},
170
160
  metadata: { activeBranchIndex: 1 },
171
161
  parentId: 'msg-1',
172
162
  role: 'assistant',
@@ -176,7 +166,6 @@ describe('FlatListBuilder', () => {
176
166
  content: 'Branch 1',
177
167
  createdAt: 0,
178
168
  id: 'msg-3',
179
- meta: {},
180
169
  parentId: 'msg-2',
181
170
  role: 'user',
182
171
  updatedAt: 0,
@@ -185,7 +174,6 @@ describe('FlatListBuilder', () => {
185
174
  content: 'Branch 2',
186
175
  createdAt: 0,
187
176
  id: 'msg-4',
188
- meta: {},
189
177
  parentId: 'msg-2',
190
178
  role: 'user',
191
179
  updatedAt: 0,
@@ -208,7 +196,6 @@ describe('FlatListBuilder', () => {
208
196
  createdAt: 0,
209
197
  groupId: 'group-1',
210
198
  id: 'msg-1',
211
- meta: {},
212
199
  metadata: { activeColumn: true },
213
200
  role: 'assistant',
214
201
  updatedAt: 0,
@@ -218,7 +205,6 @@ describe('FlatListBuilder', () => {
218
205
  createdAt: 0,
219
206
  groupId: 'group-1',
220
207
  id: 'msg-2',
221
- meta: {},
222
208
  role: 'assistant',
223
209
  updatedAt: 0,
224
210
  },
@@ -244,7 +230,6 @@ describe('FlatListBuilder', () => {
244
230
  content: 'User',
245
231
  createdAt: 0,
246
232
  id: 'msg-1',
247
- meta: {},
248
233
  metadata: { compare: true },
249
234
  role: 'user',
250
235
  updatedAt: 0,
@@ -253,7 +238,6 @@ describe('FlatListBuilder', () => {
253
238
  content: 'Assistant 1',
254
239
  createdAt: 0,
255
240
  id: 'msg-2',
256
- meta: {},
257
241
  metadata: { activeColumn: true },
258
242
  parentId: 'msg-1',
259
243
  role: 'assistant',
@@ -263,7 +247,6 @@ describe('FlatListBuilder', () => {
263
247
  content: 'Assistant 2',
264
248
  createdAt: 0,
265
249
  id: 'msg-3',
266
- meta: {},
267
250
  parentId: 'msg-1',
268
251
  role: 'assistant',
269
252
  updatedAt: 0,
@@ -292,7 +275,6 @@ describe('FlatListBuilder', () => {
292
275
  content: 'User',
293
276
  createdAt: 0,
294
277
  id: 'msg-1',
295
- meta: {},
296
278
  metadata: { activeBranchIndex: 0 },
297
279
  role: 'user',
298
280
  updatedAt: 0,
@@ -301,7 +283,6 @@ describe('FlatListBuilder', () => {
301
283
  content: 'Branch 1',
302
284
  createdAt: 0,
303
285
  id: 'msg-2',
304
- meta: {},
305
286
  parentId: 'msg-1',
306
287
  role: 'assistant',
307
288
  updatedAt: 0,
@@ -310,7 +291,6 @@ describe('FlatListBuilder', () => {
310
291
  content: 'Branch 2',
311
292
  createdAt: 0,
312
293
  id: 'msg-3',
313
- meta: {},
314
294
  parentId: 'msg-1',
315
295
  role: 'assistant',
316
296
  updatedAt: 0,
@@ -319,7 +299,6 @@ describe('FlatListBuilder', () => {
319
299
  content: 'Follow-up',
320
300
  createdAt: 0,
321
301
  id: 'msg-4',
322
- meta: {},
323
302
  parentId: 'msg-2',
324
303
  role: 'user',
325
304
  updatedAt: 0,
@@ -341,7 +320,6 @@ describe('FlatListBuilder', () => {
341
320
  content: 'User',
342
321
  createdAt: 0,
343
322
  id: 'msg-1',
344
- meta: {},
345
323
  metadata: { compare: true },
346
324
  role: 'user',
347
325
  updatedAt: 0,
@@ -350,7 +328,6 @@ describe('FlatListBuilder', () => {
350
328
  content: 'Assistant 1',
351
329
  createdAt: 0,
352
330
  id: 'msg-2',
353
- meta: {},
354
331
  parentId: 'msg-1',
355
332
  role: 'assistant',
356
333
  tools: [
@@ -362,7 +339,6 @@ describe('FlatListBuilder', () => {
362
339
  content: 'Tool result',
363
340
  createdAt: 0,
364
341
  id: 'tool-1',
365
- meta: {},
366
342
  parentId: 'msg-2',
367
343
  role: 'tool',
368
344
  tool_call_id: 'tool-1',
@@ -372,7 +348,6 @@ describe('FlatListBuilder', () => {
372
348
  content: 'Assistant 2',
373
349
  createdAt: 0,
374
350
  id: 'msg-3',
375
- meta: {},
376
351
  parentId: 'msg-1',
377
352
  role: 'assistant',
378
353
  updatedAt: 0,
@@ -399,7 +374,6 @@ describe('FlatListBuilder', () => {
399
374
  content: 'User request',
400
375
  createdAt: 0,
401
376
  id: 'msg-1',
402
- meta: {},
403
377
  role: 'user',
404
378
  updatedAt: 0,
405
379
  },
@@ -407,7 +381,6 @@ describe('FlatListBuilder', () => {
407
381
  content: 'Using tool',
408
382
  createdAt: 0,
409
383
  id: 'msg-2',
410
- meta: {},
411
384
  parentId: 'msg-1',
412
385
  role: 'assistant',
413
386
  tools: [
@@ -419,7 +392,6 @@ describe('FlatListBuilder', () => {
419
392
  content: 'Tool result',
420
393
  createdAt: 0,
421
394
  id: 'tool-1',
422
- meta: {},
423
395
  parentId: 'msg-2',
424
396
  role: 'tool',
425
397
  tool_call_id: 'tool-1',
@@ -429,7 +401,6 @@ describe('FlatListBuilder', () => {
429
401
  content: 'Response based on tool',
430
402
  createdAt: 0,
431
403
  id: 'msg-3',
432
- meta: {},
433
404
  parentId: 'tool-1',
434
405
  role: 'assistant',
435
406
  updatedAt: 0,
@@ -438,7 +409,6 @@ describe('FlatListBuilder', () => {
438
409
  content: 'User follow-up',
439
410
  createdAt: 0,
440
411
  id: 'msg-4',
441
- meta: {},
442
412
  parentId: 'msg-3',
443
413
  role: 'user',
444
414
  updatedAt: 0,
@@ -461,7 +431,6 @@ describe('FlatListBuilder', () => {
461
431
  content: 'User request',
462
432
  createdAt: 0,
463
433
  id: 'msg-1',
464
- meta: {},
465
434
  role: 'user',
466
435
  updatedAt: 0,
467
436
  },
@@ -469,7 +438,6 @@ describe('FlatListBuilder', () => {
469
438
  content: 'Using tool',
470
439
  createdAt: 0,
471
440
  id: 'msg-2',
472
- meta: {},
473
441
  parentId: 'msg-1',
474
442
  role: 'assistant',
475
443
  tools: [
@@ -481,7 +449,6 @@ describe('FlatListBuilder', () => {
481
449
  content: 'Tool result',
482
450
  createdAt: 0,
483
451
  id: 'tool-1',
484
- meta: {},
485
452
  parentId: 'msg-2',
486
453
  role: 'tool',
487
454
  tool_call_id: 'tool-1',
@@ -491,7 +458,6 @@ describe('FlatListBuilder', () => {
491
458
  content: 'User reply to tool',
492
459
  createdAt: 0,
493
460
  id: 'msg-3',
494
- meta: {},
495
461
  parentId: 'tool-1',
496
462
  role: 'user',
497
463
  updatedAt: 0,
@@ -516,7 +482,6 @@ describe('FlatListBuilder', () => {
516
482
  content: 'User',
517
483
  createdAt: 0,
518
484
  id: 'msg-1',
519
- meta: {},
520
485
  // activeBranchIndex = 2 means pointing to a not-yet-created branch (optimistic update)
521
486
  // when there are only 2 existing children (msg-2, msg-3)
522
487
  metadata: { activeBranchIndex: 2 },
@@ -527,7 +492,6 @@ describe('FlatListBuilder', () => {
527
492
  content: 'Branch 1',
528
493
  createdAt: 0,
529
494
  id: 'msg-2',
530
- meta: {},
531
495
  parentId: 'msg-1',
532
496
  role: 'assistant',
533
497
  updatedAt: 0,
@@ -536,7 +500,6 @@ describe('FlatListBuilder', () => {
536
500
  content: 'Branch 2',
537
501
  createdAt: 0,
538
502
  id: 'msg-3',
539
- meta: {},
540
503
  parentId: 'msg-1',
541
504
  role: 'assistant',
542
505
  updatedAt: 0,
@@ -16,7 +16,6 @@ describe('MessageCollector', () => {
16
16
  createdAt: 0,
17
17
  groupId: 'group-1',
18
18
  id: 'msg-1',
19
- meta: {},
20
19
  role: 'assistant',
21
20
  updatedAt: 0,
22
21
  },
@@ -25,7 +24,6 @@ describe('MessageCollector', () => {
25
24
  createdAt: 0,
26
25
  groupId: 'group-1',
27
26
  id: 'msg-2',
28
- meta: {},
29
27
  role: 'assistant',
30
28
  updatedAt: 0,
31
29
  },
@@ -34,7 +32,6 @@ describe('MessageCollector', () => {
34
32
  createdAt: 0,
35
33
  groupId: 'group-2',
36
34
  id: 'msg-3',
37
- meta: {},
38
35
  role: 'assistant',
39
36
  updatedAt: 0,
40
37
  },
@@ -57,7 +54,6 @@ describe('MessageCollector', () => {
57
54
  content: 'test',
58
55
  createdAt: 0,
59
56
  id: 'msg-1',
60
- meta: {},
61
57
  role: 'assistant',
62
58
  tools: [
63
59
  { apiName: 'tool1', arguments: '{}', id: 'tool-1', identifier: 'test', type: 'default' },
@@ -71,7 +67,6 @@ describe('MessageCollector', () => {
71
67
  content: 'result1',
72
68
  createdAt: 0,
73
69
  id: 'msg-2',
74
- meta: {},
75
70
  parentId: 'msg-1',
76
71
  role: 'tool',
77
72
  tool_call_id: 'tool-1',
@@ -81,7 +76,6 @@ describe('MessageCollector', () => {
81
76
  content: 'result2',
82
77
  createdAt: 0,
83
78
  id: 'msg-3',
84
- meta: {},
85
79
  parentId: 'msg-1',
86
80
  role: 'tool',
87
81
  tool_call_id: 'tool-2',
@@ -91,7 +85,6 @@ describe('MessageCollector', () => {
91
85
  content: 'other',
92
86
  createdAt: 0,
93
87
  id: 'msg-4',
94
- meta: {},
95
88
  parentId: 'msg-1',
96
89
  role: 'tool',
97
90
  tool_call_id: 'tool-3',
@@ -130,7 +123,6 @@ describe('MessageCollector', () => {
130
123
  content: 'test',
131
124
  createdAt: 0,
132
125
  id: 'msg-1',
133
- meta: {},
134
126
  role: 'assistant',
135
127
  updatedAt: 0,
136
128
  },
@@ -141,7 +133,6 @@ describe('MessageCollector', () => {
141
133
  content: 'result',
142
134
  createdAt: 0,
143
135
  id: 'tool-1',
144
- meta: {},
145
136
  parentId: 'msg-1',
146
137
  role: 'tool',
147
138
  updatedAt: 0,
@@ -169,7 +160,6 @@ describe('MessageCollector', () => {
169
160
  content: 'test1',
170
161
  createdAt: 0,
171
162
  id: 'msg-1',
172
- meta: {},
173
163
  role: 'assistant',
174
164
  updatedAt: 0,
175
165
  },
@@ -180,7 +170,6 @@ describe('MessageCollector', () => {
180
170
  content: 'result1',
181
171
  createdAt: 0,
182
172
  id: 'tool-1',
183
- meta: {},
184
173
  parentId: 'msg-1',
185
174
  role: 'tool',
186
175
  updatedAt: 0,
@@ -192,7 +181,6 @@ describe('MessageCollector', () => {
192
181
  content: 'test2',
193
182
  createdAt: 0,
194
183
  id: 'msg-2',
195
- meta: {},
196
184
  parentId: 'tool-1',
197
185
  role: 'assistant',
198
186
  updatedAt: 0,
@@ -13,7 +13,6 @@ describe('MessageTransformer', () => {
13
13
  content: 'Hello',
14
14
  createdAt: 0,
15
15
  id: 'msg-1',
16
- meta: {},
17
16
  metadata: {
18
17
  cost: 0.001,
19
18
  duration: 1000,
@@ -53,7 +52,6 @@ describe('MessageTransformer', () => {
53
52
  content: 'Hello',
54
53
  createdAt: 0,
55
54
  id: 'msg-1',
56
- meta: {},
57
55
  role: 'assistant',
58
56
  updatedAt: 0,
59
57
  };
@@ -485,7 +485,6 @@ export class MessageModel {
485
485
  .filter((relation) => relation.messageId === item.id)
486
486
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
487
487
  .map<ChatImageItem>(({ id, url, name }) => ({ alt: name!, id, url })),
488
- meta: {},
489
488
 
490
489
  model,
491
490
 
@@ -15,7 +15,6 @@ const createMessage = (
15
15
  id: overrides.id ?? `msg-${++messageCounter}`,
16
16
  createdAt: overrides.createdAt ?? 0,
17
17
  updatedAt: overrides.updatedAt ?? 0,
18
- meta: overrides.meta ?? {},
19
18
  ...overrides,
20
19
  });
21
20