/** * Don't forget to edit src/preload/common/services.ts to export service to renderer process */ import { registerProxy } from 'electron-ipc-cat/server'; import { container } from '@services/container'; import serviceIdentifier from '@services/serviceIdentifier'; import { AgentBrowserService } from '@services/agentBrowser'; import { AgentDefinitionService } from '@services/agentDefinition'; import { AgentInstanceService } from '@services/agentInstance'; import { Authentication } from '@services/auth'; import { ContextService } from '@services/context'; import { DatabaseService } from '@services/database'; import { DeepLinkService } from '@services/deepLink'; import { Git } from '@services/git'; import { MenuService } from '@services/menu'; import { NativeService } from '@services/native'; import { NotificationService } from '@services/notifications'; import { Preference } from '@services/preferences'; import { Sync } from '@services/sync'; import { SystemPreference } from '@services/systemPreferences'; import { ThemeService } from '@services/theme'; import { Updater } from '@services/updater'; import { View } from '@services/view'; import { Wiki } from '@services/wiki'; import { WikiEmbeddingService } from '@services/wikiEmbedding'; import { WikiGitWorkspace } from '@services/wikiGitWorkspace'; import { Window } from '@services/windows'; import { Workspace } from '@services/workspaces'; import { WorkspaceView } from '@services/workspacesView'; import { AgentBrowserServiceIPCDescriptor, type IAgentBrowserService } from '@services/agentBrowser/interface'; import { AgentDefinitionServiceIPCDescriptor, type IAgentDefinitionService } from '@services/agentDefinition/interface'; import { AgentInstanceServiceIPCDescriptor, type IAgentInstanceService } from '@services/agentInstance/interface'; import type { IAuthenticationService } from '@services/auth/interface'; import { AuthenticationServiceIPCDescriptor } from '@services/auth/interface'; import type { IContextService } from '@services/context/interface'; import { ContextServiceIPCDescriptor } from '@services/context/interface'; import type { IDatabaseService } from '@services/database/interface'; import { DatabaseServiceIPCDescriptor } from '@services/database/interface'; import type { IDeepLinkService } from '@services/deepLink/interface'; import { DeepLinkServiceIPCDescriptor } from '@services/deepLink/interface'; import type { IGitService } from '@services/git/interface'; import { GitServiceIPCDescriptor } from '@services/git/interface'; import type { IMenuService } from '@services/menu/interface'; import { MenuServiceIPCDescriptor } from '@services/menu/interface'; import type { INativeService } from '@services/native/interface'; import { NativeServiceIPCDescriptor } from '@services/native/interface'; import type { INotificationService } from '@services/notifications/interface'; import { NotificationServiceIPCDescriptor } from '@services/notifications/interface'; import type { IPreferenceService } from '@services/preferences/interface'; import { PreferenceServiceIPCDescriptor } from '@services/preferences/interface'; import type { ISyncService } from '@services/sync/interface'; import { SyncServiceIPCDescriptor } from '@services/sync/interface'; import type { ISystemPreferenceService } from '@services/systemPreferences/interface'; import { SystemPreferenceServiceIPCDescriptor } from '@services/systemPreferences/interface'; import type { IThemeService } from '@services/theme/interface'; import { ThemeServiceIPCDescriptor } from '@services/theme/interface'; import type { IUpdaterService } from '@services/updater/interface'; import { UpdaterServiceIPCDescriptor } from '@services/updater/interface'; import type { IViewService } from '@services/view/interface'; import { ViewServiceIPCDescriptor } from '@services/view/interface'; import type { IWikiService } from '@services/wiki/interface'; import { WikiServiceIPCDescriptor } from '@services/wiki/interface'; import type { IWikiEmbeddingService } from '@services/wikiEmbedding/interface'; import { WikiEmbeddingServiceIPCDescriptor } from '@services/wikiEmbedding/interface'; import type { IWikiGitWorkspaceService } from '@services/wikiGitWorkspace/interface'; import { WikiGitWorkspaceServiceIPCDescriptor } from '@services/wikiGitWorkspace/interface'; import type { IWindowService } from '@services/windows/interface'; import { WindowServiceIPCDescriptor } from '@services/windows/interface'; import type { IWorkspaceService } from '@services/workspaces/interface'; import { WorkspaceServiceIPCDescriptor } from '@services/workspaces/interface'; import type { IWorkspaceViewService } from '@services/workspacesView/interface'; import { WorkspaceViewServiceIPCDescriptor } from '@services/workspacesView/interface'; import { ExternalAPIService } from '../externalAPI'; import { ExternalAPIServiceIPCDescriptor, type IExternalAPIService } from '../externalAPI/interface'; export function bindServiceAndProxy(): void { container.bind(serviceIdentifier.AgentBrowser).to(AgentBrowserService).inSingletonScope(); container.bind(serviceIdentifier.AgentDefinition).to(AgentDefinitionService).inSingletonScope(); container.bind(serviceIdentifier.AgentInstance).to(AgentInstanceService).inSingletonScope(); container.bind(serviceIdentifier.Authentication).to(Authentication).inSingletonScope(); container.bind(serviceIdentifier.Context).to(ContextService).inSingletonScope(); container.bind(serviceIdentifier.Database).to(DatabaseService).inSingletonScope(); container.bind(serviceIdentifier.DeepLink).to(DeepLinkService).inSingletonScope(); container.bind(serviceIdentifier.ExternalAPI).to(ExternalAPIService).inSingletonScope(); container.bind(serviceIdentifier.Git).to(Git).inSingletonScope(); container.bind(serviceIdentifier.MenuService).to(MenuService).inSingletonScope(); container.bind(serviceIdentifier.NativeService).to(NativeService).inSingletonScope(); container.bind(serviceIdentifier.NotificationService).to(NotificationService).inSingletonScope(); container.bind(serviceIdentifier.Preference).to(Preference).inSingletonScope(); container.bind(serviceIdentifier.Sync).to(Sync).inSingletonScope(); container.bind(serviceIdentifier.SystemPreference).to(SystemPreference).inSingletonScope(); container.bind(serviceIdentifier.ThemeService).to(ThemeService).inSingletonScope(); container.bind(serviceIdentifier.Updater).to(Updater).inSingletonScope(); container.bind(serviceIdentifier.View).to(View).inSingletonScope(); container.bind(serviceIdentifier.WikiEmbedding).to(WikiEmbeddingService).inSingletonScope(); container.bind(serviceIdentifier.WikiGitWorkspace).to(WikiGitWorkspace).inSingletonScope(); container.bind(serviceIdentifier.Wiki).to(Wiki).inSingletonScope(); container.bind(serviceIdentifier.Window).to(Window).inSingletonScope(); container.bind(serviceIdentifier.Workspace).to(Workspace).inSingletonScope(); container.bind(serviceIdentifier.WorkspaceView).to(WorkspaceView).inSingletonScope(); const agentBrowserService = container.get(serviceIdentifier.AgentBrowser); const agentDefinitionService = container.get(serviceIdentifier.AgentDefinition); const agentInstanceService = container.get(serviceIdentifier.AgentInstance); const authService = container.get(serviceIdentifier.Authentication); const contextService = container.get(serviceIdentifier.Context); const databaseService = container.get(serviceIdentifier.Database); const deepLinkService = container.get(serviceIdentifier.DeepLink); const externalAPIService = container.get(serviceIdentifier.ExternalAPI); const gitService = container.get(serviceIdentifier.Git); const menuService = container.get(serviceIdentifier.MenuService); const nativeService = container.get(serviceIdentifier.NativeService); const notificationService = container.get(serviceIdentifier.NotificationService); const preferenceService = container.get(serviceIdentifier.Preference); const syncService = container.get(serviceIdentifier.Sync); const systemPreferenceService = container.get(serviceIdentifier.SystemPreference); const themeService = container.get(serviceIdentifier.ThemeService); const updaterService = container.get(serviceIdentifier.Updater); const viewService = container.get(serviceIdentifier.View); const wikiEmbeddingService = container.get(serviceIdentifier.WikiEmbedding); const wikiGitWorkspaceService = container.get(serviceIdentifier.WikiGitWorkspace); const wikiService = container.get(serviceIdentifier.Wiki); const windowService = container.get(serviceIdentifier.Window); const workspaceService = container.get(serviceIdentifier.Workspace); const workspaceViewService = container.get(serviceIdentifier.WorkspaceView); registerProxy(agentBrowserService, AgentBrowserServiceIPCDescriptor); registerProxy(agentDefinitionService, AgentDefinitionServiceIPCDescriptor); registerProxy(agentInstanceService, AgentInstanceServiceIPCDescriptor); registerProxy(authService, AuthenticationServiceIPCDescriptor); registerProxy(contextService, ContextServiceIPCDescriptor); registerProxy(databaseService, DatabaseServiceIPCDescriptor); registerProxy(deepLinkService, DeepLinkServiceIPCDescriptor); registerProxy(externalAPIService, ExternalAPIServiceIPCDescriptor); registerProxy(gitService, GitServiceIPCDescriptor); registerProxy(menuService, MenuServiceIPCDescriptor); registerProxy(nativeService, NativeServiceIPCDescriptor); registerProxy(notificationService, NotificationServiceIPCDescriptor); registerProxy(preferenceService, PreferenceServiceIPCDescriptor); registerProxy(syncService, SyncServiceIPCDescriptor); registerProxy(systemPreferenceService, SystemPreferenceServiceIPCDescriptor); registerProxy(themeService, ThemeServiceIPCDescriptor); registerProxy(updaterService, UpdaterServiceIPCDescriptor); registerProxy(viewService, ViewServiceIPCDescriptor); registerProxy(wikiEmbeddingService, WikiEmbeddingServiceIPCDescriptor); registerProxy(wikiGitWorkspaceService, WikiGitWorkspaceServiceIPCDescriptor); registerProxy(wikiService, WikiServiceIPCDescriptor); registerProxy(windowService, WindowServiceIPCDescriptor); registerProxy(workspaceService, WorkspaceServiceIPCDescriptor); registerProxy(workspaceViewService, WorkspaceViewServiceIPCDescriptor); }