@xcanwin/manyoyo 6.1.3 → 6.2.0
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/lib/web/frontend/app.css +190 -218
- package/lib/web/frontend/app.html +19 -39
- package/lib/web/frontend/app.js +236 -253
- package/lib/web/frontend/chat-behavior.js +23 -4
- package/package.json +1 -1
|
@@ -17,14 +17,33 @@
|
|
|
17
17
|
return { count, label: `${count} 步 · ${status}` };
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return
|
|
20
|
+
function buildDocumentTitle(agentName) {
|
|
21
|
+
const trimmed = String(agentName || '').trim();
|
|
22
|
+
return trimmed ? `${trimmed} · MANYOYO Web` : 'MANYOYO Web';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function mergeTraceIntoReply(messages) {
|
|
26
|
+
const list = Array.isArray(messages) ? messages : [];
|
|
27
|
+
const result = [];
|
|
28
|
+
for (let i = 0; i < list.length; i += 1) {
|
|
29
|
+
const msg = list[i];
|
|
30
|
+
if (msg && msg.streamTrace) {
|
|
31
|
+
const next = list[i + 1];
|
|
32
|
+
if (next && next.role === 'assistant' && !next.streamTrace) {
|
|
33
|
+
result.push(Object.assign({}, next, { timestamp: msg.timestamp, pairedTrace: msg }));
|
|
34
|
+
i += 1;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
result.push(msg);
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
23
41
|
}
|
|
24
42
|
|
|
25
43
|
window.ManyoyoChatBehavior = {
|
|
26
44
|
isNearBottom,
|
|
27
45
|
summarizeTraceFlow,
|
|
28
|
-
|
|
46
|
+
buildDocumentTitle,
|
|
47
|
+
mergeTraceIntoReply
|
|
29
48
|
};
|
|
30
49
|
}());
|