mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 重写agent hub连接器,新增对话记录和微信输入状态
- 新增 Agent Hub 对话记录面板,按会话回看机器人与微信用户的完整收发内容 - 新增微信原生正在输入状态,长任务维持 typing,异常路径强制收尾
This commit is contained in:
1 parent
1337bcb7de
commit
4b2395a8d2
73 files changed
+8855
-2890
No files matched your search
Vendored
+25
-3
@@ -5,7 +5,10 @@ import {
|
||||
GroupReportExportResult,
|
||||
GroupReportRenderSnapshotExportRequest
|
||||
} from '../shared/group-report'
|
||||
import type { InstalledReportTemplate, ReportTemplateOperationResult } from '../shared/report-template-package'
|
||||
import type {
|
||||
InstalledReportTemplate,
|
||||
ReportTemplateOperationResult
|
||||
} from '../shared/report-template-package'
|
||||
import type {
|
||||
ReportTemplateCatalogInstallResult,
|
||||
ReportTemplateCatalogResult
|
||||
@@ -65,6 +68,11 @@ import type {
|
||||
ImageTextIndexStatus
|
||||
} from '../shared/image-text-index'
|
||||
import type { AgentHubActionResult, AgentHubLogEntry, AgentHubStatus } from '../shared/agent-hub'
|
||||
import type {
|
||||
AgentHubConversation,
|
||||
AgentHubConversationMessage,
|
||||
AgentHubConversationSummary
|
||||
} from '../shared/agent-hub-conversation'
|
||||
import type {
|
||||
PersonalWechatGeneratedTtsVoiceRequest,
|
||||
PersonalWechatGeneratedTtsVoiceResult,
|
||||
@@ -672,9 +680,13 @@ declare global {
|
||||
recognizeLocalImageText: (request: SystemOcrRequest) => Promise<SystemOcrResult>
|
||||
getImageTextIndexStatus: () => Promise<ImageTextIndexStatus>
|
||||
countImageMessages: (sinceMs?: number) => Promise<ImageTextIndexCountResult>
|
||||
startImageTextIndex: (options?: ImageTextIndexStartOptions) => Promise<{ started: boolean; state: string }>
|
||||
startImageTextIndex: (
|
||||
options?: ImageTextIndexStartOptions
|
||||
) => Promise<{ started: boolean; state: string }>
|
||||
pauseImageTextIndex: () => Promise<{ paused: boolean; state: string }>
|
||||
resumeImageTextIndex: (options?: ImageTextIndexStartOptions) => Promise<{ started: boolean; state: string }>
|
||||
resumeImageTextIndex: (
|
||||
options?: ImageTextIndexStartOptions
|
||||
) => Promise<{ started: boolean; state: string }>
|
||||
cancelImageTextIndex: () => Promise<{ cancellable: boolean; cancelled: boolean }>
|
||||
clearImageTextIndex: () => Promise<{ removed: boolean; removedBytes: number }>
|
||||
resetImageTextIndexFailures: () => Promise<{ reset: number }>
|
||||
@@ -742,6 +754,16 @@ declare global {
|
||||
reconnectAgentHub: () => Promise<AgentHubActionResult>
|
||||
disconnectAgentHub: () => Promise<AgentHubActionResult>
|
||||
selectAgentHubTestImage: () => Promise<{ canceled: boolean; path?: string }>
|
||||
getAgentHubConversations: () => Promise<AgentHubConversationSummary[]>
|
||||
getAgentHubConversation: (userId: string) => Promise<AgentHubConversation | null>
|
||||
clearAgentHubConversations: () => Promise<{ success: boolean }>
|
||||
onAgentHubConversation: (
|
||||
callback: (payload: {
|
||||
summary: AgentHubConversationSummary
|
||||
message: AgentHubConversationMessage
|
||||
}) => void
|
||||
) => () => void
|
||||
onAgentHubConversationsCleared: (callback: () => void) => () => void
|
||||
onAgentHubStatus: (callback: (status: AgentHubStatus) => void) => () => void
|
||||
onAgentHubLog: (callback: (entry: AgentHubLogEntry) => void) => () => void
|
||||
}
|
||||
|
||||
+33
-5
@@ -38,6 +38,10 @@ import type {
|
||||
ImageTextIndexStatus
|
||||
} from '../shared/image-text-index'
|
||||
import type { AgentHubLogEntry, AgentHubStatus } from '../shared/agent-hub'
|
||||
import type {
|
||||
AgentHubConversationMessage,
|
||||
AgentHubConversationSummary
|
||||
} from '../shared/agent-hub-conversation'
|
||||
import type {
|
||||
PersonalWechatGeneratedTtsVoiceRequest,
|
||||
PersonalWechatGeneratedTtsVoiceResult,
|
||||
@@ -213,9 +217,7 @@ const api = {
|
||||
*
|
||||
* 事件带 requestId:UI 必须只认自己那一次请求,否则用户连问两次时阶段文案会串台。
|
||||
*/
|
||||
onAskWechatProgress: (
|
||||
callback: (requestId: string, event: QueryAgentProgressEvent) => void
|
||||
) => {
|
||||
onAskWechatProgress: (callback: (requestId: string, event: QueryAgentProgressEvent) => void) => {
|
||||
const listener = (
|
||||
_event: Electron.IpcRendererEvent,
|
||||
requestId: string,
|
||||
@@ -481,11 +483,15 @@ const api = {
|
||||
/** 点击索引前的快速统计(SQL COUNT,不解密图片)。 */
|
||||
countImageMessages: (sinceMs?: number): Promise<ImageTextIndexCountResult> =>
|
||||
ipcRenderer.invoke('image-text-index:count', sinceMs),
|
||||
startImageTextIndex: (options?: ImageTextIndexStartOptions): Promise<{ started: boolean; state: string }> =>
|
||||
startImageTextIndex: (
|
||||
options?: ImageTextIndexStartOptions
|
||||
): Promise<{ started: boolean; state: string }> =>
|
||||
ipcRenderer.invoke('image-text-index:start', options),
|
||||
pauseImageTextIndex: (): Promise<{ paused: boolean; state: string }> =>
|
||||
ipcRenderer.invoke('image-text-index:pause'),
|
||||
resumeImageTextIndex: (options?: ImageTextIndexStartOptions): Promise<{ started: boolean; state: string }> =>
|
||||
resumeImageTextIndex: (
|
||||
options?: ImageTextIndexStartOptions
|
||||
): Promise<{ started: boolean; state: string }> =>
|
||||
ipcRenderer.invoke('image-text-index:resume', options),
|
||||
cancelImageTextIndex: (): Promise<{ cancellable: boolean; cancelled: boolean }> =>
|
||||
ipcRenderer.invoke('image-text-index:cancel'),
|
||||
@@ -604,6 +610,28 @@ const api = {
|
||||
reconnectAgentHub: () => ipcRenderer.invoke('agent-hub:reconnect'),
|
||||
disconnectAgentHub: () => ipcRenderer.invoke('agent-hub:disconnect'),
|
||||
selectAgentHubTestImage: () => ipcRenderer.invoke('agent-hub:selectTestImage'),
|
||||
getAgentHubConversations: () => ipcRenderer.invoke('agent-hub:getConversations'),
|
||||
getAgentHubConversation: (userId: string) =>
|
||||
ipcRenderer.invoke('agent-hub:getConversation', userId),
|
||||
clearAgentHubConversations: () => ipcRenderer.invoke('agent-hub:clearConversations'),
|
||||
onAgentHubConversation: (
|
||||
callback: (payload: {
|
||||
summary: AgentHubConversationSummary
|
||||
message: AgentHubConversationMessage
|
||||
}) => void
|
||||
) => {
|
||||
const listener = (
|
||||
_event: Electron.IpcRendererEvent,
|
||||
payload: { summary: AgentHubConversationSummary; message: AgentHubConversationMessage }
|
||||
): void => callback(payload)
|
||||
ipcRenderer.on('agent-hub:conversation', listener)
|
||||
return () => ipcRenderer.removeListener('agent-hub:conversation', listener)
|
||||
},
|
||||
onAgentHubConversationsCleared: (callback: () => void) => {
|
||||
const listener = (): void => callback()
|
||||
ipcRenderer.on('agent-hub:conversationsCleared', listener)
|
||||
return () => ipcRenderer.removeListener('agent-hub:conversationsCleared', listener)
|
||||
},
|
||||
onAgentHubStatus: (callback: (status: AgentHubStatus) => void) => {
|
||||
const listener = (_event: Electron.IpcRendererEvent, status: AgentHubStatus): void =>
|
||||
callback(status)
|
||||
|
||||
Reference in new issue
Block a user