feat: 内置微信连接器并完善 Agent 查询能力

This commit is contained in:
Wxw-Gu
2026-07-15 20:27:05 +08:00
parent 1e97953d67
commit eaea8d8435
26 changed files with 2340 additions and 38 deletions
@@ -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}>
+34 -14
View File
@@ -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
}
})
)