feat(agents): 完成云智能体工作台与交互流程

This commit is contained in:
2026-09-10 19:25:12 +08:00
parent 46fbae9dec
commit 64a3cf4934
26 changed files with 1955 additions and 49 deletions

View File

@@ -24,6 +24,7 @@ import { useUserSyncStore } from './stores/user-sync';
import { flushPendingAgentSessionSync } from '@/lib/agent-session-sync';
import { subscribeHostEvent } from '@/lib/host-events';
import { reportDesktopActivity, type DesktopActivityModule } from '@/lib/host-api';
import { invokeIpc } from '@/lib/api-client';
import { installRendererPerformanceDiagnostics } from '@/lib/performance-diagnostics';
import { resolveSupportedLanguage } from '../shared/language';
import {
@@ -399,11 +400,19 @@ function App() {
};
const unsubscribe = window.electron.ipcRenderer.on('navigate', handleNavigate);
const openAgentLink = () => {
void invokeIpc<string | null>('app:take-cloud-agent-link').then(path => {
if (path && /^\/cloud-agents\/shared\/ml-[a-f0-9]{32}$/.test(path)) navigate(path);
}).catch(() => undefined);
};
const unsubscribeAgentLink = window.electron.ipcRenderer.on('cloud-agent-link', openAgentLink);
openAgentLink();
return () => {
if (typeof unsubscribe === 'function') {
unsubscribe();
}
if (typeof unsubscribeAgentLink === 'function') unsubscribeAgentLink();
};
}, [navigate]);