feat(agents): 完成云智能体工作台与交互流程
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user