myagent-ai 1.27.7 → 1.27.8
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
CHANGED
|
@@ -416,7 +416,7 @@ async function loadAgentSessions(){
|
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
async function viewSessionMsgs(sid){
|
|
419
|
-
const msgs=await api(`/api/
|
|
419
|
+
const msgs=await api(`/api/session/messages?sid=${encodeURIComponent(sid)}&limit=100`);
|
|
420
420
|
if(!Array.isArray(msgs)){$('sessionsContent').innerHTML='<div class="empty">加载失败</div>';return;}
|
|
421
421
|
let html='<h4 style="margin-bottom:12px">会话消息 <span class="badge badge-blue">'+msgs.length+' 条</span></h4>';
|
|
422
422
|
html+='<div style="max-height:500px;overflow-y:auto">';
|
|
@@ -36,7 +36,7 @@ async function viewSession(sid){
|
|
|
36
36
|
async function _loadSessionMessages(){
|
|
37
37
|
const sid=window._viewSessionSid;if(!sid)return;
|
|
38
38
|
const offset=window._viewSessionOffset||0;
|
|
39
|
-
const msgs=await api(`/api/
|
|
39
|
+
const msgs=await api(`/api/session/messages?sid=${encodeURIComponent(sid)}&limit=100&offset=${offset}`);
|
|
40
40
|
if(!Array.isArray(msgs)){showToast('加载失败','danger');return}
|
|
41
41
|
const hasMore=msgs.length>=100;
|
|
42
42
|
let html='<h3 style="margin-bottom:12px">会话: '+escHtml(sid)+' <span class="badge badge-blue">'+msgs.length+' 条</span></h3>';
|
|
@@ -232,7 +232,7 @@ function _buildTimeNav(msgs){
|
|
|
232
232
|
}
|
|
233
233
|
nav.innerHTML=navHtml;
|
|
234
234
|
}
|
|
235
|
-
async function clearSession(sid){await api(`/api/
|
|
235
|
+
async function clearSession(sid){await api(`/api/session?sid=${encodeURIComponent(sid)}`,{method:'DELETE'});renderSessions()}
|
|
236
236
|
// 切入会话: 打开聊天页面并自动加载指定会话
|
|
237
237
|
// [v1.27.2] 使用 aid(数字 agent ID)+ s(编码 session ID),不再暴露明文 agent 名字
|
|
238
238
|
function enterSession(sid,agentDbId){
|
|
@@ -2893,7 +2893,7 @@ const StreamingRecovery = {
|
|
|
2893
2893
|
|
|
2894
2894
|
loadSessionMessages: async function(sessionId, recovery = null) {
|
|
2895
2895
|
try {
|
|
2896
|
-
const response = await fetch(`/api/
|
|
2896
|
+
const response = await fetch(`/api/session/messages?sid=${encodeURIComponent(sessionId)}&limit=500`);
|
|
2897
2897
|
if (!response.ok) {
|
|
2898
2898
|
throw new Error(`HTTP ${response.status}`);
|
|
2899
2899
|
}
|