@yeaft/webchat-agent 1.0.269 → 1.0.270
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/local-runtime/server/session-catalog.js +11 -2
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +51 -43
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +2 -2
- package/local-runtime/web/style.bundle.css +1 -1
- package/local-runtime/web/style.bundle.css.gz +0 -0
- package/package.json +1 -1
|
@@ -20,6 +20,15 @@ export function yeaftCatalogKey(agentId, sessionId) {
|
|
|
20
20
|
return `yeaft:${agentId}:${sessionId}`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
function timestampValue(value) {
|
|
24
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : 0;
|
|
25
|
+
if (typeof value !== 'string' || !value) return 0;
|
|
26
|
+
const numeric = Number(value);
|
|
27
|
+
if (Number.isFinite(numeric)) return numeric;
|
|
28
|
+
const parsed = Date.parse(value);
|
|
29
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
export function projectSessionCatalog({
|
|
24
33
|
chatSessions = [],
|
|
25
34
|
yeaftSessions = [],
|
|
@@ -75,8 +84,8 @@ export function projectSessionCatalog({
|
|
|
75
84
|
const leftRank = Number.isFinite(left.sortRank) ? left.sortRank : Number.MAX_SAFE_INTEGER;
|
|
76
85
|
const rightRank = Number.isFinite(right.sortRank) ? right.sortRank : Number.MAX_SAFE_INTEGER;
|
|
77
86
|
if (leftRank !== rightRank) return leftRank - rightRank;
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
87
|
+
const creationDelta = timestampValue(right.createdAt) - timestampValue(left.createdAt);
|
|
88
|
+
if (creationDelta !== 0) return creationDelta;
|
|
80
89
|
return left.catalogKey.localeCompare(right.catalogKey);
|
|
81
90
|
});
|
|
82
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.270"}
|