mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 09:15:41 +08:00
feat: 重构问问微信并完善知识库增量检索
统一问问微信与 Agent Hub 的查询链路 完善查询覆盖度、新鲜度和部分结果表达,避免索引滞后产生错误结论 基于会话实现真正的增量追新与历史补齐 支持后台同步、取消恢复、重启续传以及同步期间继续查询 优化知识库跨会话检索、同步状态、进度展示和侧栏布局
This commit is contained in:
1 parent
0c4932d740
commit
ab3b3731b7
69 files changed
+8317
-898
No files matched your search
@@ -2011,6 +2011,50 @@ export class Wcdb4Client {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只取「成员显示名」的轻量路径(Evidence sender enrichment 专用)。
|
||||
*
|
||||
* 与 `getGroupMembersAsync` 的关键差别是它**不做**重活:不 materialize 整群成员行、
|
||||
* 不 hydrate 任何头像、contact 表只查**请求到的** wxid。只做两件必要的事 ——
|
||||
* 群昵称表(native 没有"按成员过滤"的接口,但有 client 级缓存)+ 少量 contact 名称。
|
||||
*
|
||||
* 名称字段与 `normalizeGroupMembers` 同源同优先级
|
||||
* (`nickname = wechatNickname || groupNickname || username`),所以调用方复用同一套
|
||||
* 显示名规则时,语义不会比完整快照差。
|
||||
*/
|
||||
async getGroupMemberNamesAsync(
|
||||
chatroomId: string,
|
||||
usernames: string[]
|
||||
): Promise<Wcdb4GroupMember[]> {
|
||||
if (!chatroomId || !chatroomId.endsWith('@chatroom')) return []
|
||||
const requested = this.uniq(usernames.filter(Boolean))
|
||||
if (requested.length === 0) return []
|
||||
|
||||
try {
|
||||
const groupNicknames = await this.getGroupNicknamesAsync(chatroomId)
|
||||
const contactNames = await this.readContactMemberNamesAsync(requested)
|
||||
return requested.map((username) => {
|
||||
const groupNickname = groupNicknames.get(username) || ''
|
||||
const contact = contactNames.get(username)
|
||||
const wechatNickname = contact?.wechatNickname || ''
|
||||
const remark = contact?.remark || ''
|
||||
return {
|
||||
m_nsUsrName: username,
|
||||
nickname: wechatNickname || groupNickname || username,
|
||||
groupNickname,
|
||||
wechatNickname,
|
||||
remark,
|
||||
// 刻意留空:Evidence 只需要 displayName。头像若将来需要,另走 lazy UI 路径,
|
||||
// 绝不让 Query Tool 为"可能显示头像"付整群 hydration 的成本。
|
||||
m_nsHeadImgUrl: ''
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.warn(`[WCDB4] async group member names failed chatroom=${chatroomId}:`, error)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
isGroupMemberIdsBatchAvailable(): boolean {
|
||||
return Boolean(this.wcdbGetGroupMembersBatch)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user