import { type DashboardLocale } from './i18n.js'; import { type ResolvedTheme, type ThemeMode, type SkinId } from './preferences.js'; import { type WorkbenchCapabilities } from './agent-workbench-capabilities.js'; type UiListener = () => void; declare class DashboardUiState { locale: DashboardLocale; themeMode: ThemeMode; resolvedTheme: ResolvedTheme; skin: SkinId; authed: boolean; workbenchAuthed: boolean; workbenchCapabilities: WorkbenchCapabilities; publicReadOnly: boolean; private listeners; private translate; private mediaQuery; init(): void; t(key: string, params?: Record): string; setLocale(locale: DashboardLocale): void; get theme(): string; setTheme(value: string): void; on(fn: UiListener): () => void; private emit; private applyTheme; private applySkin; private applyLocale; } export declare const ui: DashboardUiState; export declare function t(key: string, params?: Record): string; export declare function escapeHtml(s: string): string; export declare function relTime(ms: number): string; export declare function botOrbStyle(name: string): string; /** 查 bot 头像 URL:larkAppId 是唯一稳定键,在场就只认它——绝不在 appId 落空时 * 串到 botName 兜底,否则两个同名 bot 会互相借用头像(按名查 last-writer-wins)。 * 只有完全没有 appId 的渲染点才退回按名查。 */ export declare function botAvatarUrlFor(name?: string, larkAppId?: string): string | undefined; /** 该 bot 在飞书/Lark 开放平台的应用后台深链。larkAppId 即开放平台 AppID * (cli_xxx),host 必须按 bot 的 brand 派生:feishu 租户走 open.feishu.cn、 * 国际版 lark 租户走 open.larksuite.com——两者是**独立平台上的独立应用** * (AppID 各自独立、登录域不同),拿 feishu host 打开 lark 应用后台不通, * 反之亦然。brand 缺省 / 非法值经 normalizeBrand 归一为 feishu,向后兼容 * 旧 payload。非 cli_ 前缀(首屏聚合未回来时的占位键、按名聚合的历史卡、 * headless 的 local_ 身份)返回 null,避免拼出无效地址。 */ export declare function larkConsoleUrl(larkAppId?: string, brand?: string): string | null; export interface BotAvatarOpts { /** 展示名 —— 决定回退渐变球的色相,也用于按名查头像。 */ name?: string; /** 主查询键。 */ larkAppId?: string; /** 显式头像 URL(调用方已拿到时传,省一次 map 查询、首屏即出图)。 */ avatarUrl?: string; /** 尺寸:md=42px(默认),sm=24px。 */ size?: 'sm' | 'md'; /** 右下角状态点;不传则不渲染圆点。 */ dot?: 'ok' | 'busy' | 'warn' | 'off'; } /** 全站统一的 bot 头像渲染:有头像出 (盖在渐变球上、加载失败自动回退到 * 渐变球),没有就直接渲染渐变球。避免"先球后头像"闪烁靠 CSS 的 .orb-has-img。 */ export declare function botAvatarHtml(opts: BotAvatarOpts): string; /** 查飞书群头像 URL(按 chatId)。 */ export declare function chatAvatarUrlFor(chatId?: string): string | undefined; export interface ChatAvatarOpts { chatId?: string; /** 群名 —— 决定回退占位的色相。 */ name?: string; /** 显式群头像 URL(调用方已有时传,省一次 map 查询)。 */ avatarUrl?: string; /** 尺寸:md=42px(默认),sm=24px。 */ size?: 'sm' | 'md'; } /** 飞书群头像渲染:圆角方形(.orb-square)以区别于圆形的 bot 头像;复用同一套 * 占位 / 淡入 / 加载失败回退机制(.orb-has-img / .orb-img)。 */ export declare function chatAvatarHtml(opts: ChatAvatarOpts): string; /** Bot 改头像成功后本地即时生效:更新内存映射 + localStorage 缓存,让所有 * 渲染点(配置页 / 会话行 / 总览)下一次重绘就用新图,不必等 /api/groups * 的注册表数据收敛。 */ export declare function overrideBotAvatar(larkAppId: string, name: string | undefined, url: string): void; export declare function loadNameMaps(): Promise; /** 按 larkAppId 查注册表友好名(含 localStorage 回灌的缓存);查不到返回 undefined。 */ export declare function botNameForAppId(appId?: string): string | undefined; /** 会话所属 bot 的显示名:注册表友好名 → 会话自带 botName(非 id 时)→ id。 */ export declare function botDisplayName(s: Record): string; /** 会话所在聊天的标题;p2p 优先使用后端行上的直聊显示名,群聊走 /api/groups 名字表。 */ export declare function chatDisplayTitle(s: Record): string | null; /** 话题首条消息常以 "@bot " 开头(群里要 @ 才能触发)——展示时剥掉开头的 * 连续 mention,只留真正的消息内容;剥空了(纯 @ 消息)就保留原文。 */ export declare function stripMentionPrefix(title: unknown): string; /** 会话当前是否卡在等人,以及等什么(全局 strip 和工作台共用同一判定)。 */ export declare function attentionReason(s: Record): string | null; export declare function attentionWaitSince(s: Record): number; export {}; //# sourceMappingURL=ui.d.ts.map