Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 收紧侧栏插件桥权限

DavidShen1221e5fce105
diff --git a/apps/desktop/src/main/right-sidebar-window/__tests__/preload-contract.test.ts b/apps/desktop/src/main/right-sidebar-window/__tests__/preload-contract.test.ts
index 23ea747454..4cc55354b2 100644
--- a/apps/desktop/src/main/right-sidebar-window/__tests__/preload-contract.test.ts
+++ b/apps/desktop/src/main/right-sidebar-window/__tests__/preload-contract.test.ts
@@ -203,10 +203,11 @@ describe('sidebarWindowPreload 椤跺眰濂戠害', () => {
'claim', 'setBounds', 'command', 'close', 'onEvent',
]));
expect(ghostKeys).toEqual(expect.arrayContaining([
- 'listSync', 'reload', 'setEnabled', 'resolvePanelMedia', 'runtimeStates',
+ 'listSync', 'reload', 'resolvePanelMedia', 'runtimeStates',
'onChanged', 'onRuntimeChanged', 'onPreviewMedia',
'unreadSync', 'clearUnread', 'onBadge', 'onUnreadSnapshot',
]));
+ expect(ghostKeys).not.toEqual(expect.arrayContaining(['setEnabled']));
});
it('涓嶆毚闇?maker / agent / voice / login 鑷不鑳藉姏', () => {
diff --git a/apps/desktop/src/preload/sidebarWindowPreload.ts b/apps/desktop/src/preload/sidebarWindowPreload.ts
index 3dbbc0cabe..70795e6ae5 100644
--- a/apps/desktop/src/preload/sidebarWindowPreload.ts
+++ b/apps/desktop/src/preload/sidebarWindowPreload.ts
@@ -257,8 +257,6 @@ contextBridge.exposeInMainWorld('electronAPI', {
ghosts: {
listSync: (): { ghosts: unknown[] } => ipcRenderer.sendSync('ghosts:list'),
reload: (id: string): Promise<{ state: string }> => ipcRenderer.invoke('ghosts:reload', id),
- setEnabled: (id: string, enabled: boolean): Promise<{ ok: true }> =>
- ipcRenderer.invoke('ghosts:set-enabled', id, enabled),
resolvePanelMedia: (
uri: string,
purpose?: 'attach' | 'menu',