a29e1ec5c8
Recover requiredExecutor fallback, direct cursor launch in tool gateway, and user-facing brand sanitization in source so the next portal release can replace manual bundled edits on 103. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
const EXECUTOR_DISPLAY_LABELS = Object.freeze({
|
|
cursor: 'TKMind 智趣',
|
|
aider: 'Aider',
|
|
openhands: 'OpenHands',
|
|
goose: 'TKMind',
|
|
});
|
|
|
|
export function resolveExecutorDisplayLabel(executor, executorLabel = '') {
|
|
const label = String(executorLabel ?? '').trim();
|
|
if (label && !/^cursor$/i.test(label)) return label;
|
|
|
|
const normalized = String(executor ?? '').trim().toLowerCase();
|
|
if (EXECUTOR_DISPLAY_LABELS[normalized]) return EXECUTOR_DISPLAY_LABELS[normalized];
|
|
if (label) return label.replace(/cursor/gi, 'TKMind 智趣');
|
|
return normalized || 'TKMind 智趣';
|
|
}
|
|
|
|
export function sanitizeUserFacingBrandText(text) {
|
|
return String(text ?? '')
|
|
.replace(/\bCursor Chat Bridge\b/g, 'TKMind Chat Bridge')
|
|
.replace(/\bcursor\s+agent\b/gi, 'TKMind 智趣')
|
|
.replace(/\bcursor\s+cli\b/gi, 'TKMind 智趣')
|
|
.replace(/\bCursor agent\b/g, 'TKMind 智趣')
|
|
.replace(/\bCursor 执行器\b/g, 'TKMind 智趣执行器')
|
|
.replace(/\bCursor 启动\b/g, 'TKMind 智趣启动')
|
|
.replace(/\bCursor\b/g, 'TKMind 智趣')
|
|
.replace(/\bcursor\b/g, 'TKMind 智趣');
|
|
}
|