Open History to see the last commit
1import * as Effect from "effect/Effect";
2
3import { receiveProviderAuthCallback, cancelProviderAuthCallback } from "./methods/providerAuth.ts";
4import * as DesktopIpc from "./DesktopIpc.ts";
5import { installNotificationBadge } from "./methods/notificationBadge.ts";
6import { getClientSettings, setClientSettings } from "./methods/clientSettings.ts";
7import {
8 clearConnectionCatalog,
9 getConnectionCatalog,
10 setConnectionCatalog,
11} from "./methods/connectionCatalog.ts";
12import {
13 getLocalEnvironmentEnabled,
14 setLocalEnvironmentEnabled,
15} from "./methods/localEnvironment.ts";
16import {
17 getAdvertisedEndpoints,
18 getServerExposureState,
19 setServerExposureMode,
20 setTailscaleServeEnabled,
21} from "./methods/serverExposure.ts";
22import {
23 bootstrapSshBearerSession,
24 disconnectSshEnvironment,
25 discoverSshHosts,
26 ensureSshEnvironment,
27 fetchSshEnvironmentDescriptor,
28 fetchSshSessionState,
29 issueSshWebSocketTicket,
30 resolveSshHost,
31 resolveSshPasswordPrompt,
32} from "./methods/sshEnvironment.ts";
33import {
34 checkForUpdate,
35 downloadUpdate,
36 getUpdateState,
37 installUpdate,
38 setUpdateChannel,
39} from "./methods/updates.ts";
40import {
41 getAppBranding,
42 getLocalEnvironmentBootstraps,
43 getLocalEnvironmentBearerToken,
44 getSystemLocale,
45 getWindowFullscreenState,
46 openExternal,
47 openSystemSettings,
48 checkSystemPermission,
49 pasteAsText,
50 probeRemoteEditors,
51 pickFolder,
52 pickProjectFavicon,
53 pickThemeFiles,
54 setTheme,
55 showContextMenu,
56} from "./methods/window.ts";
57import {
58 acknowledgeSnapShot,
59 checkSnapShotShortcut,
60 dismissSnapShotAnimation,
61 getSnapShotState,
62 setupSnapShot,
63 previewSnapShotConfig,
64 applySnapShotConfig,
65 listPendingSnapShots,
66 readSnapShot,
67 requestSnapShotPermissions,
68 setSnapShotAnimationDestination,
69 setSnapShotShortcutSuppressed,
70} from "./methods/snapShot.ts";
71import * as PreviewIpc from "./methods/preview.ts";
72import * as AppActivationIpc from "./methods/appActivation.ts";
73import {
74 completeLegacyLocalStorage,
75 takeLegacyLocalStorage,
76} from "./methods/legacyLocalStorage.ts";
77import { getWslState, setWslBackendEnabled, setWslDistro, setWslOnly } from "./methods/wsl.ts";
78import {
79 getCliCommandState,
80 installCliCommand,
81 uninstallCliCommand,
82} from "./methods/cliCommand.ts";
83
84export const installDesktopIpcHandlers = Effect.fn("desktop.ipc.installHandlers")(function* () {
85 const ipc = yield* DesktopIpc.DesktopIpc;
86 yield* installNotificationBadge();
87 yield* PreviewIpc.installPreviewEventForwarding();
88
89 yield* ipc.handle(AppActivationIpc.setReady);
90 yield* ipc.handle(AppActivationIpc.complete);
91
92 yield* ipc.handleSync(takeLegacyLocalStorage);
93 yield* ipc.handle(completeLegacyLocalStorage);
94 yield* ipc.handleSync(getAppBranding);
95 yield* ipc.handleSync(getSystemLocale);
96 yield* ipc.handleSync(getWindowFullscreenState);
97 yield* ipc.handleSync(getLocalEnvironmentBootstraps);
98 yield* ipc.handleSync(getLocalEnvironmentEnabled);
99 yield* ipc.handle(setLocalEnvironmentEnabled);
100 yield* ipc.handle(getLocalEnvironmentBearerToken);
101
102 yield* ipc.handle(getClientSettings);
103 yield* ipc.handle(setClientSettings);
104 yield* ipc.handle(getConnectionCatalog);
105 yield* ipc.handle(getSnapShotState);
106 yield* ipc.handle(setupSnapShot);
107 yield* ipc.handle(previewSnapShotConfig);
108 yield* ipc.handle(applySnapShotConfig);
109 yield* ipc.handle(requestSnapShotPermissions);
110 yield* ipc.handle(checkSnapShotShortcut);
111 yield* ipc.handle(setSnapShotShortcutSuppressed);
112 yield* ipc.handle(listPendingSnapShots);
113 yield* ipc.handle(readSnapShot);
114 yield* ipc.handle(setSnapShotAnimationDestination);
115 yield* ipc.handle(dismissSnapShotAnimation);
116 yield* ipc.handle(acknowledgeSnapShot);
117 yield* ipc.handle(setConnectionCatalog);
118 yield* ipc.handle(clearConnectionCatalog);
119
120 yield* ipc.handle(discoverSshHosts);
121 yield* ipc.handle(resolveSshHost);
122 yield* ipc.handle(ensureSshEnvironment);
123 yield* ipc.handle(disconnectSshEnvironment);
124 yield* ipc.handle(fetchSshEnvironmentDescriptor);
125 yield* ipc.handle(bootstrapSshBearerSession);
126 yield* ipc.handle(fetchSshSessionState);
127 yield* ipc.handle(issueSshWebSocketTicket);
128 yield* ipc.handle(resolveSshPasswordPrompt);
129
130 yield* ipc.handle(getServerExposureState);
131 yield* ipc.handle(setServerExposureMode);
132 yield* ipc.handle(setTailscaleServeEnabled);
133 yield* ipc.handle(getAdvertisedEndpoints);
134
135 yield* ipc.handle(getWslState);
136 yield* ipc.handle(setWslBackendEnabled);
137 yield* ipc.handle(setWslDistro);
138 yield* ipc.handle(setWslOnly);
139
140 yield* ipc.handle(pickFolder);
141 yield* ipc.handle(pickProjectFavicon);
142 yield* ipc.handle(pickThemeFiles);
143 yield* ipc.handle(setTheme);
144 yield* ipc.handle(showContextMenu);
145 yield* ipc.handle(openExternal);
146 yield* ipc.handle(receiveProviderAuthCallback);
147 yield* ipc.handle(cancelProviderAuthCallback);
148 yield* ipc.handle(openSystemSettings);
149 yield* ipc.handle(checkSystemPermission);
150 yield* ipc.handle(pasteAsText);
151 yield* ipc.handle(probeRemoteEditors);
152 yield* ipc.handle(getUpdateState);
153 yield* ipc.handle(setUpdateChannel);
154 yield* ipc.handle(downloadUpdate);
155 yield* ipc.handle(installUpdate);
156 yield* ipc.handle(checkForUpdate);
157 yield* ipc.handle(getCliCommandState);
158 yield* ipc.handle(installCliCommand);
159 yield* ipc.handle(uninstallCliCommand);
160 for (const previewMethod of PreviewIpc.methods) {
161 yield* ipc.handle(previewMethod);
162 }
163 yield* ipc.handle(PreviewIpc.listBrowserImportSources);
164 yield* ipc.handle(PreviewIpc.importBrowserCookies);
165});