Add attachment text extraction, auto web news skill, and chat/voice UI updates.

Simplify asset upload temp paths, refresh deploy docs for Aliyun DNS topology, and ship MindSpace content-scan and auth improvements.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-06-20 15:08:10 +08:00
parent 2e5afe3bfd
commit 70492d9eba
24 changed files with 648 additions and 129 deletions
+10 -7
View File
@@ -1,5 +1,6 @@
import type { Message, MessageContent } from '../types';
import { mergeMessageContent } from '../../message-stream.mjs';
import { stripUserAddressPrefix } from './userAddress';
const IMAGE_URL_LINE_RE = /^\[图片\d+]: (.+)$/;
@@ -76,7 +77,7 @@ export function normalizeUserMessageForApi(message: Message): Message {
content: agentText ? [{ type: 'text', text: agentText }] : [],
metadata: {
...message.metadata,
...(displayText ? { displayText } : {}),
displayText,
...(imageUrls.length ? { imageUrls } : {}),
},
};
@@ -100,7 +101,7 @@ export function buildUserMessage(
metadata: {
userVisible: true,
agentVisible: true,
...(displayText ? { displayText } : {}),
displayText,
...(imageUrls.length ? { imageUrls } : {}),
},
};
@@ -113,11 +114,13 @@ export function normalizeConversationMessages(messages: Message[]): Message[] {
}
export function getDisplayText(message: Message): string {
return (
message.metadata.displayText ??
getSystemNotificationText(message) ??
getVisibleText(message)
);
if ('displayText' in message.metadata) {
return message.metadata.displayText ?? '';
}
const systemText = getSystemNotificationText(message);
if (systemText) return systemText;
const visible = getVisibleText(message);
return message.role === 'user' ? stripUserAddressPrefix(visible) : visible;
}
export function pushMessage(messages: Message[], incoming: Message): Message[] {
+9
View File
@@ -21,3 +21,12 @@ export function buildUserAddressPrefix(
`;
}
/** Strip hidden user-identity prefix when UI falls back to agent-side content. */
export function stripUserAddressPrefix(text: string): string {
if (!text.startsWith('[用户身份]\n')) return text;
const separator = '\n\n';
const end = text.indexOf(separator);
if (end === -1) return text;
return text.slice(end + separator.length).trim();
}