mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 11:37:06 +08:00
feat: 内置微信连接器并完善 Agent 查询能力
This commit is contained in:
@@ -241,7 +241,11 @@ export function AgentHubWorkspace(): React.ReactElement {
|
||||
<option value="agent-hub">Agent Hub</option>
|
||||
<option value="wechat-connector">微信连接器</option>
|
||||
</select>
|
||||
<button type="button" onClick={() => void copyLogs()} disabled={visibleLogs.length === 0}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => void copyLogs()}
|
||||
disabled={visibleLogs.length === 0}
|
||||
>
|
||||
复制日志
|
||||
</button>
|
||||
<button type="button" onClick={() => void clearLogs()}>
|
||||
@@ -251,7 +255,9 @@ export function AgentHubWorkspace(): React.ReactElement {
|
||||
</div>
|
||||
<div className="agent-hub-log-body" ref={logBodyRef}>
|
||||
{visibleLogs.length === 0 ? (
|
||||
<div className="agent-hub-log-empty">暂无运行日志。收到消息后,这里会显示处理到哪一步。</div>
|
||||
<div className="agent-hub-log-empty">
|
||||
暂无运行日志。收到消息后,这里会显示处理到哪一步。
|
||||
</div>
|
||||
) : (
|
||||
visibleLogs.map((entry) => (
|
||||
<div className={`agent-hub-log-line ${entry.level}`} key={entry.id}>
|
||||
|
||||
@@ -10,12 +10,32 @@ import {
|
||||
ReportVoiceHighlight,
|
||||
ReportVoiceLeaderboardItem
|
||||
} from '../../../shared/group-report'
|
||||
import type {
|
||||
ImageAnalysisRequest,
|
||||
ImageAnalysisResponse,
|
||||
ImageCandidate,
|
||||
ImageCandidateQuery
|
||||
} from '../../../shared/image-insight'
|
||||
|
||||
interface ReportImageReadResult {
|
||||
success: boolean
|
||||
data?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
declare const window: {
|
||||
api: {
|
||||
imageListCandidates: (...args: unknown[]) => Promise<any>
|
||||
imageAnalyze: (...args: unknown[]) => Promise<any>
|
||||
getImage: (...args: unknown[]) => Promise<any>
|
||||
imageListCandidates: (query: ImageCandidateQuery) => Promise<{
|
||||
success: boolean
|
||||
candidates: ImageCandidate[]
|
||||
error?: string
|
||||
}>
|
||||
imageAnalyze: (request: ImageAnalysisRequest) => Promise<ImageAnalysisResponse>
|
||||
getImage: (
|
||||
imageMd5?: string,
|
||||
imageDatNameOrThumb?: string | boolean,
|
||||
sessionId?: string
|
||||
) => Promise<ReportImageReadResult>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,17 +357,17 @@ const buildMediaSection = async (
|
||||
? await Promise.all(
|
||||
rawImageCandidates.map(async (item) => {
|
||||
const result = await rendererApi.getImage(item.md5, item.datName, item.sessionId)
|
||||
if (!result.success || !result.data?.startsWith('data:image/')) return null
|
||||
return {
|
||||
sender: item.sender,
|
||||
time: item.time,
|
||||
imageUrl: result.data,
|
||||
note: item.note,
|
||||
stats: item.stats,
|
||||
inferenceLabel: '基于图片后的聊天上下文推断',
|
||||
sourceMessageIds: item.sourceMessageIds,
|
||||
replyCount: item.replyCount,
|
||||
score: item.score
|
||||
if (!result.success || !result.data?.startsWith('data:image/')) return null
|
||||
return {
|
||||
sender: item.sender,
|
||||
time: item.time,
|
||||
imageUrl: result.data,
|
||||
note: item.note,
|
||||
stats: item.stats,
|
||||
inferenceLabel: '基于图片后的聊天上下文推断',
|
||||
sourceMessageIds: item.sourceMessageIds,
|
||||
replyCount: item.replyCount,
|
||||
score: item.score
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user