@yeaft/webchat-agent 0.1.826 → 0.1.827

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.826",
3
+ "version": "0.1.827",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -562,6 +562,8 @@ function projectPersistedToHistoryEntry(m) {
562
562
  if (isPersistedInternalMessage(m)) return null;
563
563
  const entry = { role: m.role, content: m.role === 'tool' ? m.content : __testNormalizePersistedVisibleContent(m.content) };
564
564
  if (m.id) entry.id = m.id;
565
+ entry.threadId = m.threadId || m.turnId || 'main';
566
+ entry.turnId = m.turnId || entry.threadId;
565
567
  if (m.groupId) entry.groupId = m.groupId;
566
568
  if (m.speakerVpId) entry.speakerVpId = m.speakerVpId;
567
569
  if (m.toolCallId) entry.toolCallId = m.toolCallId;
@@ -2268,6 +2270,7 @@ export async function handleUnifyGroupChat(msg) {
2268
2270
  let report;
2269
2271
  try {
2270
2272
  report = coord.ingest({
2273
+ id: typeof msg.id === 'string' && msg.id ? msg.id : undefined,
2271
2274
  from: 'user',
2272
2275
  role: 'user',
2273
2276
  text,
@@ -3585,7 +3588,7 @@ export async function handleUnifyLoadHistory(msg) {
3585
3588
  ...(Array.isArray(entry.attachments) && entry.attachments.length > 0 ? { attachments: hydrateHistoryAttachmentPreviews(entry.attachments) } : {}),
3586
3589
  },
3587
3590
  ts: entry.ts || null,
3588
- }, { groupId: entry.groupId || null });
3591
+ }, { groupId: entry.groupId || null, threadId: entry.threadId || 'main', turnId: entry.turnId || entry.threadId || 'main' });
3589
3592
  } else if (entry.role === 'assistant') {
3590
3593
  // speakerVpId rides on the envelope so the frontend can route this
3591
3594
  // replayed assistant text to the correct VP track. Without it, the
@@ -3593,6 +3596,8 @@ export async function handleUnifyLoadHistory(msg) {
3593
3596
  // anonymous assistant turn.
3594
3597
  const envelopeOpts = {
3595
3598
  groupId: entry.groupId || null,
3599
+ threadId: entry.threadId || 'main',
3600
+ turnId: entry.turnId || entry.threadId || 'main',
3596
3601
  };
3597
3602
  if (entry.speakerVpId) envelopeOpts.vpId = entry.speakerVpId;
3598
3603
  sendUnifyOutput({
@@ -3676,6 +3681,8 @@ export async function handleUnifyLoadMoreHistory(msg) {
3676
3681
  role: m.role,
3677
3682
  content: m.content,
3678
3683
  groupId: m.groupId || null,
3684
+ threadId: m.threadId || m.turnId || 'main',
3685
+ turnId: m.turnId || m.threadId || 'main',
3679
3686
  ...(Array.isArray(m.attachments) && m.attachments.length > 0 ? { attachments: hydrateHistoryAttachmentPreviews(m.attachments) } : {}),
3680
3687
  ...(m.speakerVpId ? { speakerVpId: m.speakerVpId } : {}),
3681
3688
  }));