@yeaft/webchat-agent 0.1.832 → 0.1.833
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 +1 -1
- package/unify/web-bridge.js +13 -1
package/package.json
CHANGED
package/unify/web-bridge.js
CHANGED
|
@@ -1231,12 +1231,24 @@ export async function __testResetVpState() {
|
|
|
1231
1231
|
* Envelope fields: conversationId, groupId, vpId, turnId, threadId let the
|
|
1232
1232
|
* frontend route incremental deltas to the correct per-VP/thread block.
|
|
1233
1233
|
*/
|
|
1234
|
+
function resolveGroupDefaultVpId(groupId) {
|
|
1235
|
+
if (!groupId) return null;
|
|
1236
|
+
try {
|
|
1237
|
+
const meta = ensureGroupCoordinator(groupId)?.group?.getMeta?.();
|
|
1238
|
+
const vpId = typeof meta?.defaultVpId === 'string' ? meta.defaultVpId.trim() : '';
|
|
1239
|
+
return vpId || null;
|
|
1240
|
+
} catch {
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1234
1245
|
function sendUnifyOutput(data, { groupId, vpId, turnId, threadId } = {}) {
|
|
1246
|
+
const resolvedVpId = vpId || resolveGroupDefaultVpId(groupId);
|
|
1235
1247
|
sendToServer({
|
|
1236
1248
|
type: 'unify_output',
|
|
1237
1249
|
conversationId: unifyConversationId,
|
|
1238
1250
|
...(groupId ? { groupId } : {}),
|
|
1239
|
-
...(
|
|
1251
|
+
...(resolvedVpId ? { vpId: resolvedVpId } : {}),
|
|
1240
1252
|
...(turnId ? { turnId } : {}),
|
|
1241
1253
|
...(threadId ? { threadId } : {}),
|
|
1242
1254
|
data,
|