@yeaft/webchat-agent 1.0.335 → 1.0.337
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/handlers/agent-output.js +15 -0
- package/local-runtime/server/handlers/client-conversation.js +13 -1
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +93 -94
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +1 -1
- package/package.json +1 -1
- package/yeaft/conversation/history-index-state.js +294 -0
- package/yeaft/conversation/history-index-worker.js +574 -0
- package/yeaft/conversation/history-index.js +530 -0
- package/yeaft/conversation/persist.js +197 -94
- package/yeaft/conversation/visible-entry.js +143 -0
- package/yeaft/sessions/session-crud.js +65 -2
- package/yeaft/web-bridge.js +199 -23
|
@@ -684,7 +684,9 @@ export async function handleAgentOutput(agentId, agent, msg) {
|
|
|
684
684
|
results: Array.isArray(msg.results) ? msg.results : [],
|
|
685
685
|
hasMore: !!msg.hasMore,
|
|
686
686
|
nextBeforeSeq: msg.nextBeforeSeq ?? null,
|
|
687
|
+
nextCursor: msg.nextCursor && typeof msg.nextCursor === 'object' ? msg.nextCursor : null,
|
|
687
688
|
totalCount: Number.isFinite(msg.totalCount) ? msg.totalCount : null,
|
|
689
|
+
...(typeof msg.perfTraceId === 'string' ? { perfTraceId: msg.perfTraceId } : {}),
|
|
688
690
|
...(msg.error ? { error: msg.error } : {}),
|
|
689
691
|
});
|
|
690
692
|
}
|
|
@@ -704,6 +706,8 @@ export async function handleAgentOutput(agentId, agent, msg) {
|
|
|
704
706
|
results: Array.isArray(msg.results) ? msg.results : [],
|
|
705
707
|
hasMore: !!msg.hasMore,
|
|
706
708
|
nextBeforeSeq: msg.nextBeforeSeq ?? null,
|
|
709
|
+
nextCursor: msg.nextCursor && typeof msg.nextCursor === 'object' ? msg.nextCursor : null,
|
|
710
|
+
...(typeof msg.perfTraceId === 'string' ? { perfTraceId: msg.perfTraceId } : {}),
|
|
707
711
|
...(msg.error ? { error: msg.error } : {}),
|
|
708
712
|
});
|
|
709
713
|
}
|
|
@@ -723,11 +727,18 @@ export async function handleAgentOutput(agentId, agent, msg) {
|
|
|
723
727
|
requestId: msg.requestId ?? null,
|
|
724
728
|
conversationId: msg.conversationId ?? null,
|
|
725
729
|
sessionId: msg.sessionId ?? null,
|
|
730
|
+
entryId: msg.entryId ?? null,
|
|
731
|
+
indexGeneration: msg.indexGeneration ?? null,
|
|
732
|
+
entryStartSeq: msg.entryStartSeq ?? null,
|
|
733
|
+
entryEndSeq: msg.entryEndSeq ?? null,
|
|
734
|
+
sourceMessageIds: Array.isArray(msg.sourceMessageIds) ? msg.sourceMessageIds : [],
|
|
726
735
|
anchorMessageId: msg.anchorMessageId ?? null,
|
|
727
736
|
anchorSeq: msg.anchorSeq ?? null,
|
|
728
737
|
messages,
|
|
729
738
|
oldestSeq: msg.oldestSeq ?? null,
|
|
730
739
|
hasMoreBefore: !!msg.hasMoreBefore,
|
|
740
|
+
rowCount: Number.isFinite(msg.rowCount) ? msg.rowCount : messages.length,
|
|
741
|
+
byteCount: Number.isFinite(msg.byteCount) ? msg.byteCount : null,
|
|
731
742
|
...(msg.error ? { error: msg.error } : {}),
|
|
732
743
|
});
|
|
733
744
|
}
|
|
@@ -776,10 +787,14 @@ export async function handleAgentOutput(agentId, agent, msg) {
|
|
|
776
787
|
messages,
|
|
777
788
|
mode: msg.mode || 'older',
|
|
778
789
|
oldestSeq: msg.oldestSeq ?? null,
|
|
790
|
+
nextBeforeSeq: msg.nextBeforeSeq ?? msg.oldestSeq ?? null,
|
|
779
791
|
hasMore: !!msg.hasMore,
|
|
780
792
|
latestSeq: msg.latestSeq ?? null,
|
|
781
793
|
afterSeq: msg.afterSeq ?? null,
|
|
782
794
|
turns: msg.turns ?? null,
|
|
795
|
+
pageKind: msg.pageKind === 'gap' ? 'gap' : (msg.pageKind || null),
|
|
796
|
+
gapStopAtSeq: msg.gapStopAtSeq ?? null,
|
|
797
|
+
cacheEpoch: msg.cacheEpoch ?? null,
|
|
783
798
|
});
|
|
784
799
|
if (msg.perfTraceId) {
|
|
785
800
|
recordPerfTraceEvent({
|
|
@@ -1204,7 +1204,9 @@ export async function handleClientConversation(clientId, client, msg, checkAgent
|
|
|
1204
1204
|
requestId: typeof msg.requestId === 'string' ? msg.requestId : null,
|
|
1205
1205
|
limit: typeof msg.limit === 'number' ? msg.limit : 50,
|
|
1206
1206
|
beforeSeq: typeof msg.beforeSeq === 'number' ? msg.beforeSeq : null,
|
|
1207
|
-
|
|
1207
|
+
...(msg.cursor && typeof msg.cursor === 'object' ? { cursor: msg.cursor } : {}),
|
|
1208
|
+
includeTotal: msg.includeTotal === true,
|
|
1209
|
+
...(typeof msg.perfTraceId === 'string' ? { perfTraceId: msg.perfTraceId } : {}),
|
|
1208
1210
|
_requestClientId: clientId,
|
|
1209
1211
|
});
|
|
1210
1212
|
break;
|
|
@@ -1224,6 +1226,8 @@ export async function handleClientConversation(clientId, client, msg, checkAgent
|
|
|
1224
1226
|
senderKey: typeof msg.senderKey === 'string' ? msg.senderKey.slice(0, 103) : '',
|
|
1225
1227
|
limit: typeof msg.limit === 'number' ? msg.limit : 20,
|
|
1226
1228
|
beforeSeq: typeof msg.beforeSeq === 'number' ? msg.beforeSeq : null,
|
|
1229
|
+
...(msg.cursor && typeof msg.cursor === 'object' ? { cursor: msg.cursor } : {}),
|
|
1230
|
+
...(typeof msg.perfTraceId === 'string' ? { perfTraceId: msg.perfTraceId } : {}),
|
|
1227
1231
|
_requestClientId: clientId,
|
|
1228
1232
|
});
|
|
1229
1233
|
break;
|
|
@@ -1239,10 +1243,15 @@ export async function handleClientConversation(clientId, client, msg, checkAgent
|
|
|
1239
1243
|
type: 'yeaft_load_history_window',
|
|
1240
1244
|
sessionId: windowSessionId,
|
|
1241
1245
|
requestId: typeof msg.requestId === 'string' ? msg.requestId : null,
|
|
1246
|
+
entryId: typeof msg.entryId === 'string' ? msg.entryId : null,
|
|
1247
|
+
indexGeneration: typeof msg.indexGeneration === 'number' ? msg.indexGeneration : null,
|
|
1248
|
+
entryStartSeq: typeof msg.entryStartSeq === 'number' ? msg.entryStartSeq : null,
|
|
1242
1249
|
anchorMessageId: typeof msg.anchorMessageId === 'string' ? msg.anchorMessageId : null,
|
|
1243
1250
|
anchorSeq: typeof msg.anchorSeq === 'number' ? msg.anchorSeq : null,
|
|
1244
1251
|
beforeTurns: typeof msg.beforeTurns === 'number' ? msg.beforeTurns : 3,
|
|
1245
1252
|
afterTurns: typeof msg.afterTurns === 'number' ? msg.afterTurns : 3,
|
|
1253
|
+
maxRows: typeof msg.maxRows === 'number' ? msg.maxRows : 200,
|
|
1254
|
+
maxBytes: typeof msg.maxBytes === 'number' ? msg.maxBytes : 512 * 1024,
|
|
1246
1255
|
_requestClientId: clientId,
|
|
1247
1256
|
});
|
|
1248
1257
|
break;
|
|
@@ -1258,6 +1267,9 @@ export async function handleClientConversation(clientId, client, msg, checkAgent
|
|
|
1258
1267
|
sessionId: msg.sessionId || null,
|
|
1259
1268
|
requestId: typeof msg.requestId === 'string' ? msg.requestId : null,
|
|
1260
1269
|
beforeSeq: typeof msg.beforeSeq === 'number' ? msg.beforeSeq : null,
|
|
1270
|
+
pageKind: msg.pageKind === 'gap' ? 'gap' : 'server',
|
|
1271
|
+
gapStopAtSeq: typeof msg.gapStopAtSeq === 'number' ? msg.gapStopAtSeq : null,
|
|
1272
|
+
cacheEpoch: typeof msg.cacheEpoch === 'number' ? msg.cacheEpoch : 0,
|
|
1261
1273
|
turns: typeof msg.turns === 'number' ? msg.turns : 20,
|
|
1262
1274
|
...(typeof msg.perfTraceId === 'string' ? { perfTraceId: msg.perfTraceId } : {}),
|
|
1263
1275
|
_requestClientId: clientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.337"}
|