@@ -12,6 +12,7 @@ import { WorktreeRepository } from "../db/repositories/worktree-repository";
1212import { DatabaseService } from "../db/service" ;
1313import { ElectronAppLifecycle } from "../platform-adapters/electron-app-lifecycle" ;
1414import { ElectronAppMeta } from "../platform-adapters/electron-app-meta" ;
15+ import { ElectronAppMetrics } from "../platform-adapters/electron-app-metrics" ;
1516import { ElectronBundledResources } from "../platform-adapters/electron-bundled-resources" ;
1617import { ElectronClipboard } from "../platform-adapters/electron-clipboard" ;
1718import { ElectronContextMenu } from "../platform-adapters/electron-context-menu" ;
@@ -35,6 +36,11 @@ import { CloudTaskService } from "../services/cloud-task/service";
3536import { ConnectivityService } from "../services/connectivity/service" ;
3637import { ContextMenuService } from "../services/context-menu/service" ;
3738import { DeepLinkService } from "../services/deep-link/service" ;
39+ import { DevActionsService } from "../services/dev-actions/service" ;
40+ import { DevFlagsService } from "../services/dev-flags/service" ;
41+ import { DevLogsService } from "../services/dev-logs/service" ;
42+ import { DevMetricsService } from "../services/dev-metrics/service" ;
43+ import { DevNetworkService } from "../services/dev-network/service" ;
3844import { EnrichmentService } from "../services/enrichment/service" ;
3945import { EnvironmentService } from "../services/environment/service" ;
4046import { ExternalAppsService } from "../services/external-apps/service" ;
@@ -76,6 +82,18 @@ export const container = new Container({
7682 defaultScope : "Singleton" ,
7783} ) ;
7884
85+ export function getService < T > ( token : symbol ) : T {
86+ return container . get < T > ( token ) ;
87+ }
88+
89+ export function tryGetService < T > ( token : symbol ) : T | null {
90+ try {
91+ return container . get < T > ( token ) ;
92+ } catch {
93+ return null ;
94+ }
95+ }
96+
7997container . bind ( MAIN_TOKENS . UrlLauncher ) . to ( ElectronUrlLauncher ) ;
8098container . bind ( MAIN_TOKENS . StoragePaths ) . to ( ElectronStoragePaths ) ;
8199container . bind ( MAIN_TOKENS . AppMeta ) . to ( ElectronAppMeta ) ;
@@ -91,6 +109,7 @@ container.bind(MAIN_TOKENS.Notifier).to(ElectronNotifier);
91109container . bind ( MAIN_TOKENS . ContextMenu ) . to ( ElectronContextMenu ) ;
92110container . bind ( MAIN_TOKENS . BundledResources ) . to ( ElectronBundledResources ) ;
93111container . bind ( MAIN_TOKENS . ImageProcessor ) . to ( ElectronImageProcessor ) ;
112+ container . bind ( MAIN_TOKENS . AppMetrics ) . to ( ElectronAppMetrics ) ;
94113
95114container . bind ( MAIN_TOKENS . DatabaseService ) . to ( DatabaseService ) ;
96115container
@@ -156,3 +175,9 @@ container.bind(MAIN_TOKENS.WatcherRegistryService).to(WatcherRegistryService);
156175container . bind ( MAIN_TOKENS . WorkspaceService ) . to ( WorkspaceService ) ;
157176
158177container . bind ( MAIN_TOKENS . SettingsStore ) . toConstantValue ( settingsStore ) ;
178+
179+ container . bind ( MAIN_TOKENS . DevFlagsService ) . to ( DevFlagsService ) ;
180+ container . bind ( MAIN_TOKENS . DevMetricsService ) . to ( DevMetricsService ) ;
181+ container . bind ( MAIN_TOKENS . DevNetworkService ) . to ( DevNetworkService ) ;
182+ container . bind ( MAIN_TOKENS . DevLogsService ) . to ( DevLogsService ) ;
183+ container . bind ( MAIN_TOKENS . DevActionsService ) . to ( DevActionsService ) ;
0 commit comments