feat: chat uploads, vision turn isolation, and MindSpace agent improvements
Add chat file/image upload UX, attachment proxying, vision thumbnails, and per-turn image scoping so agents only use the current upload. Extend MindSpace asset context, billing token state, OA/scenario verify scripts, and related runtime config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { UserNotification } from '../types';
|
||||
|
||||
export const BALANCE_REFRESH_EVENT = 'tkmind:balance-refresh';
|
||||
|
||||
const RECHARGE_NOTIFICATION_TYPES = new Set(['admin_recharge', 'self_recharge', 'recharge']);
|
||||
|
||||
export function isRechargeNotification(
|
||||
notification: Pick<UserNotification, 'notificationType' | 'title' | 'body'>,
|
||||
): boolean {
|
||||
if (RECHARGE_NOTIFICATION_TYPES.has(String(notification.notificationType ?? '').trim())) {
|
||||
return true;
|
||||
}
|
||||
const title = String(notification.title ?? '');
|
||||
const body = String(notification.body ?? '');
|
||||
return /充值/.test(title) && /余额已更新/.test(body);
|
||||
}
|
||||
|
||||
export function requestBalanceRefresh() {
|
||||
if (typeof window === 'undefined') return;
|
||||
window.dispatchEvent(new CustomEvent(BALANCE_REFRESH_EVENT));
|
||||
}
|
||||
Reference in New Issue
Block a user