@yeaft/webchat-agent 0.1.969 → 0.1.971
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/yeaft/web-bridge.js +15 -1
package/package.json
CHANGED
package/yeaft/web-bridge.js
CHANGED
|
@@ -629,7 +629,7 @@ function projectPersistedToHistoryEntry(m) {
|
|
|
629
629
|
if (m.ts) entry.ts = m.ts;
|
|
630
630
|
else if (m.time) entry.ts = m.time;
|
|
631
631
|
if (Array.isArray(m.attachments) && m.attachments.length > 0) entry.attachments = m.attachments;
|
|
632
|
-
if ((entry.role === 'user' || entry.role === 'assistant') && !entry.content && !entry.attachments) return null;
|
|
632
|
+
if ((entry.role === 'user' || entry.role === 'assistant') && !entry.content && !entry.attachments && !entry.toolCalls) return null;
|
|
633
633
|
return entry;
|
|
634
634
|
}
|
|
635
635
|
|
|
@@ -4013,6 +4013,20 @@ export async function handleYeaftLoadHistory(msg) {
|
|
|
4013
4013
|
message: { id: entry.id || null, content: [{ type: 'text', text: entry.content }] },
|
|
4014
4014
|
ts: entry.ts || null,
|
|
4015
4015
|
}, envelopeOpts);
|
|
4016
|
+
if (Array.isArray(entry.toolCalls) && entry.toolCalls.length > 0) {
|
|
4017
|
+
sendSessionOutputFrame({
|
|
4018
|
+
type: 'assistant',
|
|
4019
|
+
message: {
|
|
4020
|
+
content: [{
|
|
4021
|
+
type: 'tool_summary',
|
|
4022
|
+
count: entry.toolCalls.length,
|
|
4023
|
+
omittedCount: entry.toolCalls.length,
|
|
4024
|
+
source: 'history',
|
|
4025
|
+
}],
|
|
4026
|
+
},
|
|
4027
|
+
ts: entry.ts || null,
|
|
4028
|
+
}, envelopeOpts);
|
|
4029
|
+
}
|
|
4016
4030
|
sendSessionOutputFrame({ type: 'result', result_text: '' }, envelopeOpts);
|
|
4017
4031
|
}
|
|
4018
4032
|
}
|