@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.
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/packages/const/src/utils/merge.test.ts +679 -0
- package/packages/context-engine/src/processors/__tests__/AgentCouncilFlatten.test.ts +0 -20
- package/packages/context-engine/src/processors/__tests__/MessageContent.test.ts +5 -23
- package/packages/context-engine/src/providers/SystemRoleInjector.ts +0 -1
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/simple.json +4 -19
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/with-supervisor-reply.json +4 -23
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentGroup/speak-different-agent.json +3 -13
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-chain-with-followup.json +3 -8
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/assistant-with-tools.json +21 -17
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/tools-with-branches.json +15 -15
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/active-index-1.json +3 -13
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-branch.json +2 -9
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-group-branches.json +0 -11
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-user-branch.json +5 -15
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/conversation.json +4 -14
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/multi-assistant-group.json +0 -13
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/nested.json +2 -15
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/simple.json +4 -9
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/with-tools.json +8 -17
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/linear-conversation.json +3 -7
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/simple.json +1 -7
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/with-summary.json +10 -11
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/simple.json +2 -32
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/with-supervisor-reply.json +8 -46
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentGroup/speak-different-agent.json +5 -24
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistant-chain-with-followup.json +5 -13
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/assistant-with-tools.json +6 -16
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +6 -17
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/active-index-1.json +4 -18
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-branch.json +4 -16
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-group-branches.json +0 -19
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-user-branch.json +8 -24
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/conversation.json +7 -23
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/multi-assistant-group.json +0 -15
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/nested.json +4 -25
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/simple.json +2 -13
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/with-tools.json +4 -20
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/linear-conversation.json +4 -12
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/simple.json +2 -14
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/with-summary.json +20 -22
- package/packages/conversation-flow/src/__tests__/indexing.test.ts +0 -35
- package/packages/conversation-flow/src/__tests__/structuring.test.ts +0 -41
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +0 -4
- package/packages/conversation-flow/src/transformation/__tests__/BranchResolver.test.ts +0 -10
- package/packages/conversation-flow/src/transformation/__tests__/ContextTreeBuilder.test.ts +0 -19
- package/packages/conversation-flow/src/transformation/__tests__/FlatListBuilder.test.ts +0 -37
- package/packages/conversation-flow/src/transformation/__tests__/MessageCollector.test.ts +0 -12
- package/packages/conversation-flow/src/transformation/__tests__/MessageTransformer.test.ts +0 -2
- package/packages/database/src/models/message.ts +0 -1
- package/packages/prompts/src/prompts/chatMessages/index.test.ts +0 -1
- package/packages/prompts/src/prompts/groupChat/__snapshots__/index.test.ts.snap +0 -21
- package/packages/prompts/src/prompts/groupChat/index.test.ts +0 -3
- package/packages/types/src/message/ui/chat.ts +0 -2
- package/src/features/Conversation/store/slices/data/action.test.ts +0 -14
- package/src/features/Conversation/store/slices/data/reducer.test.ts +0 -21
- package/src/features/Conversation/store/slices/data/reducer.ts +1 -1
- package/src/features/Conversation/store/slices/message/action/crud.test.ts +0 -10
- package/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts +3 -5
- package/src/server/routers/lambda/__tests__/message.test.ts +1 -2
- package/src/server/services/agentRuntime/AgentRuntimeService.ts +109 -109
- package/src/server/services/agentRuntime/types.ts +8 -8
- package/src/server/services/doc/index.tsx +2 -2
- package/src/server/services/generation/index.ts +2 -2
- package/src/server/services/message/index.ts +3 -3
- package/src/server/services/usage/index.ts +4 -4
- package/src/services/chat/chat.test.ts +0 -6
- package/src/services/chat/mecha/contextEngineering.test.ts +3 -29
- package/src/services/chat/mecha/modelParamsResolver.test.ts +803 -0
- package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +0 -2
- package/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts +0 -6
- package/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts +0 -3
- package/src/store/chat/agents/createAgentExecutors.ts +4 -4
- package/src/store/chat/slices/aiAgent/actions/__tests__/agentGroup.test.ts +0 -2
- package/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts +0 -3
- package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +0 -1
- package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +0 -4
- package/src/store/chat/slices/message/reducer.test.ts +0 -5
- package/src/store/chat/slices/message/reducer.ts +1 -1
- package/src/store/chat/slices/message/selectors/displayMessage.test.ts +0 -13
- package/src/store/chat/slices/message/selectors/displayMessage.ts +3 -34
- package/src/store/chat/slices/portal/selectors.test.ts +0 -7
- package/src/store/chat/slices/thread/action.test.ts +0 -1
- package/src/store/chat/slices/translate/action.test.ts +0 -1
- package/src/store/tool/slices/oldStore/action.test.ts +0 -1
|
@@ -11,7 +11,6 @@ describe('buildHelperMaps', () => {
|
|
|
11
11
|
content: 'Hello',
|
|
12
12
|
createdAt: 1000,
|
|
13
13
|
id: 'msg-1',
|
|
14
|
-
meta: {},
|
|
15
14
|
role: 'user',
|
|
16
15
|
updatedAt: 1000,
|
|
17
16
|
},
|
|
@@ -19,7 +18,6 @@ describe('buildHelperMaps', () => {
|
|
|
19
18
|
content: 'Hi there',
|
|
20
19
|
createdAt: 2000,
|
|
21
20
|
id: 'msg-2',
|
|
22
|
-
meta: {},
|
|
23
21
|
parentId: 'msg-1',
|
|
24
22
|
role: 'assistant',
|
|
25
23
|
updatedAt: 2000,
|
|
@@ -45,7 +43,6 @@ describe('buildHelperMaps', () => {
|
|
|
45
43
|
content: 'Single message',
|
|
46
44
|
createdAt: 1000,
|
|
47
45
|
id: 'msg-1',
|
|
48
|
-
meta: {},
|
|
49
46
|
role: 'user',
|
|
50
47
|
updatedAt: 1000,
|
|
51
48
|
},
|
|
@@ -65,7 +62,6 @@ describe('buildHelperMaps', () => {
|
|
|
65
62
|
content: 'Root',
|
|
66
63
|
createdAt: 1000,
|
|
67
64
|
id: 'msg-1',
|
|
68
|
-
meta: {},
|
|
69
65
|
role: 'user',
|
|
70
66
|
updatedAt: 1000,
|
|
71
67
|
},
|
|
@@ -73,7 +69,6 @@ describe('buildHelperMaps', () => {
|
|
|
73
69
|
content: 'Child 1',
|
|
74
70
|
createdAt: 2000,
|
|
75
71
|
id: 'msg-2',
|
|
76
|
-
meta: {},
|
|
77
72
|
parentId: 'msg-1',
|
|
78
73
|
role: 'assistant',
|
|
79
74
|
updatedAt: 2000,
|
|
@@ -82,7 +77,6 @@ describe('buildHelperMaps', () => {
|
|
|
82
77
|
content: 'Child 2',
|
|
83
78
|
createdAt: 3000,
|
|
84
79
|
id: 'msg-3',
|
|
85
|
-
meta: {},
|
|
86
80
|
parentId: 'msg-1',
|
|
87
81
|
role: 'assistant',
|
|
88
82
|
updatedAt: 3000,
|
|
@@ -101,7 +95,6 @@ describe('buildHelperMaps', () => {
|
|
|
101
95
|
content: 'Root 1',
|
|
102
96
|
createdAt: 1000,
|
|
103
97
|
id: 'msg-1',
|
|
104
|
-
meta: {},
|
|
105
98
|
role: 'user',
|
|
106
99
|
updatedAt: 1000,
|
|
107
100
|
},
|
|
@@ -109,7 +102,6 @@ describe('buildHelperMaps', () => {
|
|
|
109
102
|
content: 'Root 2',
|
|
110
103
|
createdAt: 2000,
|
|
111
104
|
id: 'msg-2',
|
|
112
|
-
meta: {},
|
|
113
105
|
role: 'user',
|
|
114
106
|
updatedAt: 2000,
|
|
115
107
|
},
|
|
@@ -126,7 +118,6 @@ describe('buildHelperMaps', () => {
|
|
|
126
118
|
content: 'Level 0',
|
|
127
119
|
createdAt: 1000,
|
|
128
120
|
id: 'msg-1',
|
|
129
|
-
meta: {},
|
|
130
121
|
role: 'user',
|
|
131
122
|
updatedAt: 1000,
|
|
132
123
|
},
|
|
@@ -134,7 +125,6 @@ describe('buildHelperMaps', () => {
|
|
|
134
125
|
content: 'Level 1',
|
|
135
126
|
createdAt: 2000,
|
|
136
127
|
id: 'msg-2',
|
|
137
|
-
meta: {},
|
|
138
128
|
parentId: 'msg-1',
|
|
139
129
|
role: 'assistant',
|
|
140
130
|
updatedAt: 2000,
|
|
@@ -143,7 +133,6 @@ describe('buildHelperMaps', () => {
|
|
|
143
133
|
content: 'Level 2',
|
|
144
134
|
createdAt: 3000,
|
|
145
135
|
id: 'msg-3',
|
|
146
|
-
meta: {},
|
|
147
136
|
parentId: 'msg-2',
|
|
148
137
|
role: 'user',
|
|
149
138
|
updatedAt: 3000,
|
|
@@ -152,7 +141,6 @@ describe('buildHelperMaps', () => {
|
|
|
152
141
|
content: 'Level 3',
|
|
153
142
|
createdAt: 4000,
|
|
154
143
|
id: 'msg-4',
|
|
155
|
-
meta: {},
|
|
156
144
|
parentId: 'msg-3',
|
|
157
145
|
role: 'assistant',
|
|
158
146
|
updatedAt: 4000,
|
|
@@ -173,7 +161,6 @@ describe('buildHelperMaps', () => {
|
|
|
173
161
|
content: 'Root',
|
|
174
162
|
createdAt: 1000,
|
|
175
163
|
id: 'msg-1',
|
|
176
|
-
meta: {},
|
|
177
164
|
role: 'user',
|
|
178
165
|
updatedAt: 1000,
|
|
179
166
|
},
|
|
@@ -181,7 +168,6 @@ describe('buildHelperMaps', () => {
|
|
|
181
168
|
content: 'Branch 1',
|
|
182
169
|
createdAt: 2000,
|
|
183
170
|
id: 'msg-2',
|
|
184
|
-
meta: {},
|
|
185
171
|
parentId: 'msg-1',
|
|
186
172
|
role: 'assistant',
|
|
187
173
|
updatedAt: 2000,
|
|
@@ -190,7 +176,6 @@ describe('buildHelperMaps', () => {
|
|
|
190
176
|
content: 'Branch 2',
|
|
191
177
|
createdAt: 3000,
|
|
192
178
|
id: 'msg-3',
|
|
193
|
-
meta: {},
|
|
194
179
|
parentId: 'msg-1',
|
|
195
180
|
role: 'assistant',
|
|
196
181
|
updatedAt: 3000,
|
|
@@ -199,7 +184,6 @@ describe('buildHelperMaps', () => {
|
|
|
199
184
|
content: 'Sub-branch 1',
|
|
200
185
|
createdAt: 4000,
|
|
201
186
|
id: 'msg-4',
|
|
202
|
-
meta: {},
|
|
203
187
|
parentId: 'msg-2',
|
|
204
188
|
role: 'user',
|
|
205
189
|
updatedAt: 4000,
|
|
@@ -208,7 +192,6 @@ describe('buildHelperMaps', () => {
|
|
|
208
192
|
content: 'Sub-branch 2',
|
|
209
193
|
createdAt: 5000,
|
|
210
194
|
id: 'msg-5',
|
|
211
|
-
meta: {},
|
|
212
195
|
parentId: 'msg-2',
|
|
213
196
|
role: 'user',
|
|
214
197
|
updatedAt: 5000,
|
|
@@ -230,7 +213,6 @@ describe('buildHelperMaps', () => {
|
|
|
230
213
|
content: 'Main message',
|
|
231
214
|
createdAt: 1000,
|
|
232
215
|
id: 'msg-1',
|
|
233
|
-
meta: {},
|
|
234
216
|
role: 'user',
|
|
235
217
|
updatedAt: 1000,
|
|
236
218
|
},
|
|
@@ -238,7 +220,6 @@ describe('buildHelperMaps', () => {
|
|
|
238
220
|
content: 'Thread message 1',
|
|
239
221
|
createdAt: 2000,
|
|
240
222
|
id: 'msg-2',
|
|
241
|
-
meta: {},
|
|
242
223
|
parentId: 'msg-1',
|
|
243
224
|
role: 'assistant',
|
|
244
225
|
threadId: 'thread-1',
|
|
@@ -248,7 +229,6 @@ describe('buildHelperMaps', () => {
|
|
|
248
229
|
content: 'Thread message 2',
|
|
249
230
|
createdAt: 3000,
|
|
250
231
|
id: 'msg-3',
|
|
251
|
-
meta: {},
|
|
252
232
|
parentId: 'msg-2',
|
|
253
233
|
role: 'user',
|
|
254
234
|
threadId: 'thread-1',
|
|
@@ -269,7 +249,6 @@ describe('buildHelperMaps', () => {
|
|
|
269
249
|
content: 'Thread 1 - msg 1',
|
|
270
250
|
createdAt: 1000,
|
|
271
251
|
id: 'msg-1',
|
|
272
|
-
meta: {},
|
|
273
252
|
role: 'user',
|
|
274
253
|
threadId: 'thread-1',
|
|
275
254
|
updatedAt: 1000,
|
|
@@ -278,7 +257,6 @@ describe('buildHelperMaps', () => {
|
|
|
278
257
|
content: 'Thread 1 - msg 2',
|
|
279
258
|
createdAt: 2000,
|
|
280
259
|
id: 'msg-2',
|
|
281
|
-
meta: {},
|
|
282
260
|
role: 'assistant',
|
|
283
261
|
threadId: 'thread-1',
|
|
284
262
|
updatedAt: 2000,
|
|
@@ -287,7 +265,6 @@ describe('buildHelperMaps', () => {
|
|
|
287
265
|
content: 'Thread 2 - msg 1',
|
|
288
266
|
createdAt: 3000,
|
|
289
267
|
id: 'msg-3',
|
|
290
|
-
meta: {},
|
|
291
268
|
role: 'user',
|
|
292
269
|
threadId: 'thread-2',
|
|
293
270
|
updatedAt: 3000,
|
|
@@ -307,7 +284,6 @@ describe('buildHelperMaps', () => {
|
|
|
307
284
|
content: 'No thread',
|
|
308
285
|
createdAt: 1000,
|
|
309
286
|
id: 'msg-1',
|
|
310
|
-
meta: {},
|
|
311
287
|
role: 'user',
|
|
312
288
|
updatedAt: 1000,
|
|
313
289
|
},
|
|
@@ -315,7 +291,6 @@ describe('buildHelperMaps', () => {
|
|
|
315
291
|
content: 'With thread',
|
|
316
292
|
createdAt: 2000,
|
|
317
293
|
id: 'msg-2',
|
|
318
|
-
meta: {},
|
|
319
294
|
role: 'assistant',
|
|
320
295
|
threadId: 'thread-1',
|
|
321
296
|
updatedAt: 2000,
|
|
@@ -334,7 +309,6 @@ describe('buildHelperMaps', () => {
|
|
|
334
309
|
content: 'Message 1',
|
|
335
310
|
createdAt: 1000,
|
|
336
311
|
id: 'msg-1',
|
|
337
|
-
meta: {},
|
|
338
312
|
role: 'user',
|
|
339
313
|
updatedAt: 1000,
|
|
340
314
|
},
|
|
@@ -342,7 +316,6 @@ describe('buildHelperMaps', () => {
|
|
|
342
316
|
content: 'Message 2',
|
|
343
317
|
createdAt: 2000,
|
|
344
318
|
id: 'msg-2',
|
|
345
|
-
meta: {},
|
|
346
319
|
role: 'assistant',
|
|
347
320
|
updatedAt: 2000,
|
|
348
321
|
},
|
|
@@ -361,7 +334,6 @@ describe('buildHelperMaps', () => {
|
|
|
361
334
|
content: 'Message',
|
|
362
335
|
createdAt: 1000,
|
|
363
336
|
id: 'msg-1',
|
|
364
|
-
meta: {},
|
|
365
337
|
role: 'user',
|
|
366
338
|
updatedAt: 1000,
|
|
367
339
|
},
|
|
@@ -391,7 +363,6 @@ describe('buildHelperMaps', () => {
|
|
|
391
363
|
content: 'Message',
|
|
392
364
|
createdAt: 1000,
|
|
393
365
|
id: 'msg-1',
|
|
394
|
-
meta: {},
|
|
395
366
|
role: 'user',
|
|
396
367
|
updatedAt: 1000,
|
|
397
368
|
},
|
|
@@ -408,7 +379,6 @@ describe('buildHelperMaps', () => {
|
|
|
408
379
|
content: 'Message',
|
|
409
380
|
createdAt: 1000,
|
|
410
381
|
id: 'msg-1',
|
|
411
|
-
meta: {},
|
|
412
382
|
role: 'user',
|
|
413
383
|
updatedAt: 1000,
|
|
414
384
|
},
|
|
@@ -427,7 +397,6 @@ describe('buildHelperMaps', () => {
|
|
|
427
397
|
content: 'Root message',
|
|
428
398
|
createdAt: 1000,
|
|
429
399
|
id: 'msg-1',
|
|
430
|
-
meta: {},
|
|
431
400
|
role: 'user',
|
|
432
401
|
updatedAt: 1000,
|
|
433
402
|
},
|
|
@@ -436,7 +405,6 @@ describe('buildHelperMaps', () => {
|
|
|
436
405
|
createdAt: 2000,
|
|
437
406
|
groupId: 'group-1',
|
|
438
407
|
id: 'msg-2',
|
|
439
|
-
meta: {},
|
|
440
408
|
parentId: 'msg-1',
|
|
441
409
|
role: 'assistant',
|
|
442
410
|
updatedAt: 2000,
|
|
@@ -445,7 +413,6 @@ describe('buildHelperMaps', () => {
|
|
|
445
413
|
content: 'Thread message',
|
|
446
414
|
createdAt: 3000,
|
|
447
415
|
id: 'msg-3',
|
|
448
|
-
meta: {},
|
|
449
416
|
parentId: 'msg-2',
|
|
450
417
|
role: 'user',
|
|
451
418
|
threadId: 'thread-1',
|
|
@@ -455,7 +422,6 @@ describe('buildHelperMaps', () => {
|
|
|
455
422
|
content: 'Branch message',
|
|
456
423
|
createdAt: 4000,
|
|
457
424
|
id: 'msg-4',
|
|
458
|
-
meta: {},
|
|
459
425
|
parentId: 'msg-1',
|
|
460
426
|
role: 'assistant',
|
|
461
427
|
updatedAt: 4000,
|
|
@@ -493,7 +459,6 @@ describe('buildHelperMaps', () => {
|
|
|
493
459
|
content: `Message ${i}`,
|
|
494
460
|
createdAt: i,
|
|
495
461
|
id: `msg-${i}`,
|
|
496
|
-
meta: {},
|
|
497
462
|
parentId: i > 0 ? `msg-${i - 1}` : undefined,
|
|
498
463
|
role: i % 2 === 0 ? ('user' as const) : ('assistant' as const),
|
|
499
464
|
updatedAt: i,
|
|
@@ -12,7 +12,6 @@ describe('buildIdTree', () => {
|
|
|
12
12
|
content: 'Root',
|
|
13
13
|
createdAt: 1000,
|
|
14
14
|
id: 'msg-1',
|
|
15
|
-
meta: {},
|
|
16
15
|
role: 'user',
|
|
17
16
|
updatedAt: 1000,
|
|
18
17
|
},
|
|
@@ -34,7 +33,6 @@ describe('buildIdTree', () => {
|
|
|
34
33
|
content: 'Message 1',
|
|
35
34
|
createdAt: 1000,
|
|
36
35
|
id: 'msg-1',
|
|
37
|
-
meta: {},
|
|
38
36
|
role: 'user',
|
|
39
37
|
updatedAt: 1000,
|
|
40
38
|
},
|
|
@@ -42,7 +40,6 @@ describe('buildIdTree', () => {
|
|
|
42
40
|
content: 'Message 2',
|
|
43
41
|
createdAt: 2000,
|
|
44
42
|
id: 'msg-2',
|
|
45
|
-
meta: {},
|
|
46
43
|
parentId: 'msg-1',
|
|
47
44
|
role: 'assistant',
|
|
48
45
|
updatedAt: 2000,
|
|
@@ -51,7 +48,6 @@ describe('buildIdTree', () => {
|
|
|
51
48
|
content: 'Message 3',
|
|
52
49
|
createdAt: 3000,
|
|
53
50
|
id: 'msg-3',
|
|
54
|
-
meta: {},
|
|
55
51
|
parentId: 'msg-2',
|
|
56
52
|
role: 'user',
|
|
57
53
|
updatedAt: 3000,
|
|
@@ -75,7 +71,6 @@ describe('buildIdTree', () => {
|
|
|
75
71
|
content: 'Root 1',
|
|
76
72
|
createdAt: 1000,
|
|
77
73
|
id: 'msg-1',
|
|
78
|
-
meta: {},
|
|
79
74
|
role: 'user',
|
|
80
75
|
updatedAt: 1000,
|
|
81
76
|
},
|
|
@@ -83,7 +78,6 @@ describe('buildIdTree', () => {
|
|
|
83
78
|
content: 'Root 2',
|
|
84
79
|
createdAt: 2000,
|
|
85
80
|
id: 'msg-2',
|
|
86
|
-
meta: {},
|
|
87
81
|
role: 'user',
|
|
88
82
|
updatedAt: 2000,
|
|
89
83
|
},
|
|
@@ -105,7 +99,6 @@ describe('buildIdTree', () => {
|
|
|
105
99
|
content: 'Root',
|
|
106
100
|
createdAt: 1000,
|
|
107
101
|
id: 'msg-1',
|
|
108
|
-
meta: {},
|
|
109
102
|
role: 'user',
|
|
110
103
|
updatedAt: 1000,
|
|
111
104
|
},
|
|
@@ -113,7 +106,6 @@ describe('buildIdTree', () => {
|
|
|
113
106
|
content: 'Branch 1',
|
|
114
107
|
createdAt: 2000,
|
|
115
108
|
id: 'msg-2',
|
|
116
|
-
meta: {},
|
|
117
109
|
parentId: 'msg-1',
|
|
118
110
|
role: 'assistant',
|
|
119
111
|
updatedAt: 2000,
|
|
@@ -122,7 +114,6 @@ describe('buildIdTree', () => {
|
|
|
122
114
|
content: 'Branch 2',
|
|
123
115
|
createdAt: 3000,
|
|
124
116
|
id: 'msg-3',
|
|
125
|
-
meta: {},
|
|
126
117
|
parentId: 'msg-1',
|
|
127
118
|
role: 'assistant',
|
|
128
119
|
updatedAt: 3000,
|
|
@@ -145,7 +136,6 @@ describe('buildIdTree', () => {
|
|
|
145
136
|
content: 'Root',
|
|
146
137
|
createdAt: 1000,
|
|
147
138
|
id: 'msg-1',
|
|
148
|
-
meta: {},
|
|
149
139
|
role: 'user',
|
|
150
140
|
updatedAt: 1000,
|
|
151
141
|
},
|
|
@@ -153,7 +143,6 @@ describe('buildIdTree', () => {
|
|
|
153
143
|
content: 'Branch 1',
|
|
154
144
|
createdAt: 2000,
|
|
155
145
|
id: 'msg-2',
|
|
156
|
-
meta: {},
|
|
157
146
|
parentId: 'msg-1',
|
|
158
147
|
role: 'assistant',
|
|
159
148
|
updatedAt: 2000,
|
|
@@ -162,7 +151,6 @@ describe('buildIdTree', () => {
|
|
|
162
151
|
content: 'Branch 1.1',
|
|
163
152
|
createdAt: 3000,
|
|
164
153
|
id: 'msg-3',
|
|
165
|
-
meta: {},
|
|
166
154
|
parentId: 'msg-2',
|
|
167
155
|
role: 'user',
|
|
168
156
|
updatedAt: 3000,
|
|
@@ -171,7 +159,6 @@ describe('buildIdTree', () => {
|
|
|
171
159
|
content: 'Branch 1.2',
|
|
172
160
|
createdAt: 4000,
|
|
173
161
|
id: 'msg-4',
|
|
174
|
-
meta: {},
|
|
175
162
|
parentId: 'msg-2',
|
|
176
163
|
role: 'user',
|
|
177
164
|
updatedAt: 4000,
|
|
@@ -194,7 +181,6 @@ describe('buildIdTree', () => {
|
|
|
194
181
|
content: 'Level 0',
|
|
195
182
|
createdAt: 1000,
|
|
196
183
|
id: 'msg-1',
|
|
197
|
-
meta: {},
|
|
198
184
|
role: 'user',
|
|
199
185
|
updatedAt: 1000,
|
|
200
186
|
},
|
|
@@ -202,7 +188,6 @@ describe('buildIdTree', () => {
|
|
|
202
188
|
content: 'Level 1',
|
|
203
189
|
createdAt: 2000,
|
|
204
190
|
id: 'msg-2',
|
|
205
|
-
meta: {},
|
|
206
191
|
parentId: 'msg-1',
|
|
207
192
|
role: 'assistant',
|
|
208
193
|
updatedAt: 2000,
|
|
@@ -211,7 +196,6 @@ describe('buildIdTree', () => {
|
|
|
211
196
|
content: 'Level 2',
|
|
212
197
|
createdAt: 3000,
|
|
213
198
|
id: 'msg-3',
|
|
214
|
-
meta: {},
|
|
215
199
|
parentId: 'msg-2',
|
|
216
200
|
role: 'user',
|
|
217
201
|
updatedAt: 3000,
|
|
@@ -220,7 +204,6 @@ describe('buildIdTree', () => {
|
|
|
220
204
|
content: 'Level 3',
|
|
221
205
|
createdAt: 4000,
|
|
222
206
|
id: 'msg-4',
|
|
223
|
-
meta: {},
|
|
224
207
|
parentId: 'msg-3',
|
|
225
208
|
role: 'assistant',
|
|
226
209
|
updatedAt: 4000,
|
|
@@ -254,7 +237,6 @@ describe('buildIdTree', () => {
|
|
|
254
237
|
content: 'Root',
|
|
255
238
|
createdAt: 1000,
|
|
256
239
|
id: 'msg-1',
|
|
257
|
-
meta: {},
|
|
258
240
|
role: 'user',
|
|
259
241
|
updatedAt: 1000,
|
|
260
242
|
},
|
|
@@ -262,7 +244,6 @@ describe('buildIdTree', () => {
|
|
|
262
244
|
content: 'Main flow',
|
|
263
245
|
createdAt: 2000,
|
|
264
246
|
id: 'msg-2',
|
|
265
|
-
meta: {},
|
|
266
247
|
parentId: 'msg-1',
|
|
267
248
|
role: 'assistant',
|
|
268
249
|
updatedAt: 2000,
|
|
@@ -271,7 +252,6 @@ describe('buildIdTree', () => {
|
|
|
271
252
|
content: 'Thread message',
|
|
272
253
|
createdAt: 3000,
|
|
273
254
|
id: 'msg-3',
|
|
274
|
-
meta: {},
|
|
275
255
|
parentId: 'msg-1',
|
|
276
256
|
role: 'assistant',
|
|
277
257
|
threadId: 'thread-1',
|
|
@@ -294,7 +274,6 @@ describe('buildIdTree', () => {
|
|
|
294
274
|
content: 'Main root',
|
|
295
275
|
createdAt: 1000,
|
|
296
276
|
id: 'msg-1',
|
|
297
|
-
meta: {},
|
|
298
277
|
role: 'user',
|
|
299
278
|
updatedAt: 1000,
|
|
300
279
|
},
|
|
@@ -302,7 +281,6 @@ describe('buildIdTree', () => {
|
|
|
302
281
|
content: 'Thread root',
|
|
303
282
|
createdAt: 2000,
|
|
304
283
|
id: 'msg-2',
|
|
305
|
-
meta: {},
|
|
306
284
|
role: 'assistant',
|
|
307
285
|
threadId: 'thread-1',
|
|
308
286
|
updatedAt: 2000,
|
|
@@ -322,7 +300,6 @@ describe('buildIdTree', () => {
|
|
|
322
300
|
content: 'Root',
|
|
323
301
|
createdAt: 1000,
|
|
324
302
|
id: 'msg-1',
|
|
325
|
-
meta: {},
|
|
326
303
|
role: 'user',
|
|
327
304
|
updatedAt: 1000,
|
|
328
305
|
},
|
|
@@ -330,7 +307,6 @@ describe('buildIdTree', () => {
|
|
|
330
307
|
content: 'Main child',
|
|
331
308
|
createdAt: 2000,
|
|
332
309
|
id: 'msg-2',
|
|
333
|
-
meta: {},
|
|
334
310
|
parentId: 'msg-1',
|
|
335
311
|
role: 'assistant',
|
|
336
312
|
updatedAt: 2000,
|
|
@@ -339,7 +315,6 @@ describe('buildIdTree', () => {
|
|
|
339
315
|
content: 'Main grandchild',
|
|
340
316
|
createdAt: 3000,
|
|
341
317
|
id: 'msg-3',
|
|
342
|
-
meta: {},
|
|
343
318
|
parentId: 'msg-2',
|
|
344
319
|
role: 'user',
|
|
345
320
|
updatedAt: 3000,
|
|
@@ -348,7 +323,6 @@ describe('buildIdTree', () => {
|
|
|
348
323
|
content: 'Thread grandchild',
|
|
349
324
|
createdAt: 4000,
|
|
350
325
|
id: 'msg-4',
|
|
351
|
-
meta: {},
|
|
352
326
|
parentId: 'msg-2',
|
|
353
327
|
role: 'user',
|
|
354
328
|
threadId: 'thread-1',
|
|
@@ -380,7 +354,6 @@ describe('buildIdTree', () => {
|
|
|
380
354
|
content: 'Lone message',
|
|
381
355
|
createdAt: 1000,
|
|
382
356
|
id: 'msg-1',
|
|
383
|
-
meta: {},
|
|
384
357
|
role: 'user',
|
|
385
358
|
updatedAt: 1000,
|
|
386
359
|
},
|
|
@@ -402,7 +375,6 @@ describe('buildIdTree', () => {
|
|
|
402
375
|
content: 'Orphan',
|
|
403
376
|
createdAt: 1000,
|
|
404
377
|
id: 'msg-1',
|
|
405
|
-
meta: {},
|
|
406
378
|
parentId: 'non-existent',
|
|
407
379
|
role: 'user',
|
|
408
380
|
updatedAt: 1000,
|
|
@@ -422,7 +394,6 @@ describe('buildIdTree', () => {
|
|
|
422
394
|
content: 'Thread 1',
|
|
423
395
|
createdAt: 1000,
|
|
424
396
|
id: 'msg-1',
|
|
425
|
-
meta: {},
|
|
426
397
|
role: 'user',
|
|
427
398
|
threadId: 'thread-1',
|
|
428
399
|
updatedAt: 1000,
|
|
@@ -431,7 +402,6 @@ describe('buildIdTree', () => {
|
|
|
431
402
|
content: 'Thread 2',
|
|
432
403
|
createdAt: 2000,
|
|
433
404
|
id: 'msg-2',
|
|
434
|
-
meta: {},
|
|
435
405
|
role: 'assistant',
|
|
436
406
|
threadId: 'thread-1',
|
|
437
407
|
updatedAt: 2000,
|
|
@@ -452,7 +422,6 @@ describe('buildIdTree', () => {
|
|
|
452
422
|
content: 'Root',
|
|
453
423
|
createdAt: 1000,
|
|
454
424
|
id: 'msg-1',
|
|
455
|
-
meta: {},
|
|
456
425
|
role: 'user',
|
|
457
426
|
updatedAt: 1000,
|
|
458
427
|
},
|
|
@@ -460,7 +429,6 @@ describe('buildIdTree', () => {
|
|
|
460
429
|
content: 'Branch A',
|
|
461
430
|
createdAt: 2000,
|
|
462
431
|
id: 'msg-2',
|
|
463
|
-
meta: {},
|
|
464
432
|
parentId: 'msg-1',
|
|
465
433
|
role: 'assistant',
|
|
466
434
|
updatedAt: 2000,
|
|
@@ -469,7 +437,6 @@ describe('buildIdTree', () => {
|
|
|
469
437
|
content: 'Branch A -> Child',
|
|
470
438
|
createdAt: 3000,
|
|
471
439
|
id: 'msg-3',
|
|
472
|
-
meta: {},
|
|
473
440
|
parentId: 'msg-2',
|
|
474
441
|
role: 'user',
|
|
475
442
|
updatedAt: 3000,
|
|
@@ -478,7 +445,6 @@ describe('buildIdTree', () => {
|
|
|
478
445
|
content: 'Branch B',
|
|
479
446
|
createdAt: 4000,
|
|
480
447
|
id: 'msg-4',
|
|
481
|
-
meta: {},
|
|
482
448
|
parentId: 'msg-1',
|
|
483
449
|
role: 'assistant',
|
|
484
450
|
updatedAt: 4000,
|
|
@@ -487,7 +453,6 @@ describe('buildIdTree', () => {
|
|
|
487
453
|
content: 'Branch B -> Child 1',
|
|
488
454
|
createdAt: 5000,
|
|
489
455
|
id: 'msg-5',
|
|
490
|
-
meta: {},
|
|
491
456
|
parentId: 'msg-4',
|
|
492
457
|
role: 'user',
|
|
493
458
|
updatedAt: 5000,
|
|
@@ -496,7 +461,6 @@ describe('buildIdTree', () => {
|
|
|
496
461
|
content: 'Branch B -> Child 2',
|
|
497
462
|
createdAt: 6000,
|
|
498
463
|
id: 'msg-6',
|
|
499
|
-
meta: {},
|
|
500
464
|
parentId: 'msg-4',
|
|
501
465
|
role: 'user',
|
|
502
466
|
updatedAt: 6000,
|
|
@@ -529,7 +493,6 @@ describe('buildIdTree', () => {
|
|
|
529
493
|
content: 'Tree 1 Root',
|
|
530
494
|
createdAt: 1000,
|
|
531
495
|
id: 'msg-1',
|
|
532
|
-
meta: {},
|
|
533
496
|
role: 'user',
|
|
534
497
|
updatedAt: 1000,
|
|
535
498
|
},
|
|
@@ -537,7 +500,6 @@ describe('buildIdTree', () => {
|
|
|
537
500
|
content: 'Tree 1 Child',
|
|
538
501
|
createdAt: 2000,
|
|
539
502
|
id: 'msg-2',
|
|
540
|
-
meta: {},
|
|
541
503
|
parentId: 'msg-1',
|
|
542
504
|
role: 'assistant',
|
|
543
505
|
updatedAt: 2000,
|
|
@@ -547,7 +509,6 @@ describe('buildIdTree', () => {
|
|
|
547
509
|
content: 'Tree 2 Root',
|
|
548
510
|
createdAt: 3000,
|
|
549
511
|
id: 'msg-3',
|
|
550
|
-
meta: {},
|
|
551
512
|
role: 'user',
|
|
552
513
|
updatedAt: 3000,
|
|
553
514
|
},
|
|
@@ -555,7 +516,6 @@ describe('buildIdTree', () => {
|
|
|
555
516
|
content: 'Tree 2 Child',
|
|
556
517
|
createdAt: 4000,
|
|
557
518
|
id: 'msg-4',
|
|
558
|
-
meta: {},
|
|
559
519
|
parentId: 'msg-3',
|
|
560
520
|
role: 'assistant',
|
|
561
521
|
updatedAt: 4000,
|
|
@@ -579,7 +539,6 @@ describe('buildIdTree', () => {
|
|
|
579
539
|
content: `Message ${i}`,
|
|
580
540
|
createdAt: i,
|
|
581
541
|
id: `msg-${i}`,
|
|
582
|
-
meta: {},
|
|
583
542
|
parentId: i > 0 ? `msg-${i - 1}` : undefined,
|
|
584
543
|
role: i % 2 === 0 ? ('user' as const) : ('assistant' as const),
|
|
585
544
|
updatedAt: i,
|
|
@@ -497,7 +497,6 @@ export class FlatListBuilder {
|
|
|
497
497
|
parentMessageId: parentMessage.id,
|
|
498
498
|
},
|
|
499
499
|
id: compareId,
|
|
500
|
-
meta: parentMessage.meta || {},
|
|
501
500
|
role: 'compare' as any,
|
|
502
501
|
updatedAt,
|
|
503
502
|
} as Message;
|
|
@@ -585,7 +584,6 @@ export class FlatListBuilder {
|
|
|
585
584
|
id: agentCouncilId,
|
|
586
585
|
// members is a flat array of messages (not nested arrays)
|
|
587
586
|
members: members as any,
|
|
588
|
-
meta: parentMessage.meta || {},
|
|
589
587
|
role: 'agentCouncil' as any,
|
|
590
588
|
updatedAt,
|
|
591
589
|
} as Message;
|
|
@@ -611,7 +609,6 @@ export class FlatListBuilder {
|
|
|
611
609
|
parentMessageId: group.parentMessageId,
|
|
612
610
|
},
|
|
613
611
|
id: group.id,
|
|
614
|
-
meta: members[0]?.meta || {},
|
|
615
612
|
role: 'compare' as any,
|
|
616
613
|
updatedAt: Math.max(...members.map((m) => m.updatedAt)),
|
|
617
614
|
} as Message;
|
|
@@ -925,7 +922,6 @@ export class FlatListBuilder {
|
|
|
925
922
|
parentMessageId: parentMessage.id,
|
|
926
923
|
},
|
|
927
924
|
id: tasksId,
|
|
928
|
-
meta: parentMessage.meta || {},
|
|
929
925
|
role: 'tasks' as any,
|
|
930
926
|
tasks: taskMessages as any,
|
|
931
927
|
updatedAt,
|
|
@@ -12,7 +12,6 @@ describe('BranchResolver', () => {
|
|
|
12
12
|
content: 'test',
|
|
13
13
|
createdAt: 0,
|
|
14
14
|
id: 'msg-1',
|
|
15
|
-
meta: {},
|
|
16
15
|
metadata: { activeBranchIndex: 1 },
|
|
17
16
|
role: 'user',
|
|
18
17
|
updatedAt: 0,
|
|
@@ -34,7 +33,6 @@ describe('BranchResolver', () => {
|
|
|
34
33
|
content: 'test',
|
|
35
34
|
createdAt: 0,
|
|
36
35
|
id: 'msg-1',
|
|
37
|
-
meta: {},
|
|
38
36
|
role: 'user',
|
|
39
37
|
updatedAt: 0,
|
|
40
38
|
};
|
|
@@ -55,7 +53,6 @@ describe('BranchResolver', () => {
|
|
|
55
53
|
content: 'test',
|
|
56
54
|
createdAt: 0,
|
|
57
55
|
id: 'msg-1',
|
|
58
|
-
meta: {},
|
|
59
56
|
role: 'user',
|
|
60
57
|
updatedAt: 0,
|
|
61
58
|
};
|
|
@@ -76,7 +73,6 @@ describe('BranchResolver', () => {
|
|
|
76
73
|
content: 'test',
|
|
77
74
|
createdAt: 0,
|
|
78
75
|
id: 'msg-1',
|
|
79
|
-
meta: {},
|
|
80
76
|
metadata: { activeBranchIndex: 2 }, // index = children.length (optimistic update)
|
|
81
77
|
role: 'user',
|
|
82
78
|
updatedAt: 0,
|
|
@@ -100,7 +96,6 @@ describe('BranchResolver', () => {
|
|
|
100
96
|
content: 'test',
|
|
101
97
|
createdAt: 0,
|
|
102
98
|
id: 'msg-1',
|
|
103
|
-
meta: {},
|
|
104
99
|
metadata: { activeBranchIndex: 5 }, // > children.length (invalid)
|
|
105
100
|
role: 'user',
|
|
106
101
|
updatedAt: 0,
|
|
@@ -125,7 +120,6 @@ describe('BranchResolver', () => {
|
|
|
125
120
|
content: 'test',
|
|
126
121
|
createdAt: 0,
|
|
127
122
|
id: 'msg-1',
|
|
128
|
-
meta: {},
|
|
129
123
|
metadata: { activeBranchIndex: 1 },
|
|
130
124
|
role: 'user',
|
|
131
125
|
updatedAt: 0,
|
|
@@ -142,7 +136,6 @@ describe('BranchResolver', () => {
|
|
|
142
136
|
content: 'test',
|
|
143
137
|
createdAt: 0,
|
|
144
138
|
id: 'msg-1',
|
|
145
|
-
meta: {},
|
|
146
139
|
role: 'user',
|
|
147
140
|
updatedAt: 0,
|
|
148
141
|
};
|
|
@@ -161,7 +154,6 @@ describe('BranchResolver', () => {
|
|
|
161
154
|
content: 'test',
|
|
162
155
|
createdAt: 0,
|
|
163
156
|
id: 'msg-1',
|
|
164
|
-
meta: {},
|
|
165
157
|
role: 'user',
|
|
166
158
|
updatedAt: 0,
|
|
167
159
|
};
|
|
@@ -177,7 +169,6 @@ describe('BranchResolver', () => {
|
|
|
177
169
|
content: 'test',
|
|
178
170
|
createdAt: 0,
|
|
179
171
|
id: 'msg-1',
|
|
180
|
-
meta: {},
|
|
181
172
|
metadata: { activeBranchIndex: 2 }, // index = childIds.length (optimistic update)
|
|
182
173
|
role: 'user',
|
|
183
174
|
updatedAt: 0,
|
|
@@ -198,7 +189,6 @@ describe('BranchResolver', () => {
|
|
|
198
189
|
content: 'test',
|
|
199
190
|
createdAt: 0,
|
|
200
191
|
id: 'msg-1',
|
|
201
|
-
meta: {},
|
|
202
192
|
metadata: { activeBranchIndex: 5 }, // > childIds.length (invalid)
|
|
203
193
|
role: 'user',
|
|
204
194
|
updatedAt: 0,
|