Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.
Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { PortalUser } from '../types';
|
||||
|
||||
export function resolveUserAddressName(
|
||||
user?: Pick<PortalUser, 'displayName' | 'username'> | null,
|
||||
): string {
|
||||
const preferred = user?.displayName?.trim();
|
||||
if (preferred) return preferred;
|
||||
const username = user?.username?.trim();
|
||||
if (username) return username;
|
||||
return '用户';
|
||||
}
|
||||
|
||||
/** Hidden agent prefix so replies greet the user by name, not "TKMind". */
|
||||
export function buildUserAddressPrefix(
|
||||
user?: Pick<PortalUser, 'displayName' | 'username'> | null,
|
||||
): string {
|
||||
const name = resolveUserAddressName(user);
|
||||
return `[用户身份]
|
||||
- 当前登录用户称呼:${name}
|
||||
- 你是 TKMind 助手;与用户对话时用「${name}」称呼对方(如「${name},你好」),禁止把用户叫作 TKMind。
|
||||
|
||||
`;
|
||||
}
|
||||
Reference in New Issue
Block a user