refactor: modularize portal server and harden session recovery

This commit is contained in:
john
2026-07-24 18:39:24 +08:00
parent 1d291fd528
commit 785731d98d
109 changed files with 29185 additions and 5836 deletions
+14
View File
@@ -55,6 +55,20 @@ test('deriveUserFacingText removes Memind task orchestration prefix', () => {
assert.equal(deriveUserFacingText(agentPayload), userText);
});
test('deriveUserFacingText removes image turn scope metadata appended for the agent', () => {
const userText =
'请识别这张图片,只回答主体场景、时间氛围、主要颜色、是否有人物。';
const persistedText = [
userText,
'',
'【本轮图片主题(硬性)】',
'- 本轮用户仅上传 1 张图片;每次上传都是独立主题,不得与历史轮次混用。',
' 1. asset=asset-1 页面嵌入=/api/mindspace/v1/assets/asset-1/download?inline=1',
].join('\n');
assert.equal(deriveUserFacingText(persistedText), userText);
});
test('deriveAssistantFacingText hides skill/process narration without a deliverable link', () => {
const internal =
'好的,John!注意到技能更新了几个细节要求,比如页脚要用`data-mindspace-page-tag="platform-brand"`和`tkmind.cn`。我来为你重新生成全面增强版的AI机器人研究报告页面:';