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 * as WebLinksIpc from "./methods/webLinks.ts";
74import {
75 completeLegacyLocalStorage,
76 takeLegacyLocalStorage,
77} from "./methods/legacyLocalStorage.ts";
78import { getWslState, setWslBackendEnabled, setWslDistro, setWslOnly } from "./methods/wsl.ts";
79import {
80 getCliCommandState,
81 installCliCommand,
82 uninstallCliCommand,
83} from "./methods/cliCommand.ts";
84
85export const installDesktopIpcHandlers = Effect.fn("desktop.ipc.installHandlers")(function* () {
86 const ipc = yield* DesktopIpc.DesktopIpc;
87 yield* installNotificationBadge();
88 yield* PreviewIpc.installPreviewEventForwarding();
89
90 yield* ipc.handle(AppActivationIpc.setReady);
91 yield* ipc.handle(AppActivationIpc.complete);
92 yield* ipc.handle(WebLinksIpc.setReady);
93
94 yield* ipc.handleSync(takeLegacyLocalStorage);
95 yield* ipc.handle(completeLegacyLocalStorage);
96 yield* ipc.handleSync(getAppBranding);
97 yield* ipc.handleSync(getSystemLocale);
98 yield* ipc.handleSync(getWindowFullscreenState);
99 yield* ipc.handleSync(getLocalEnvironmentBootstraps);
100 yield* ipc.handleSync(getLocalEnvironmentEnabled);
101 yield* ipc.handle(setLocalEnvironmentEnabled);
102 yield* ipc.handle(getLocalEnvironmentBearerToken);
103
104 yield* ipc.handle(getClientSettings);
105 yield* ipc.handle(setClientSettings);
106 yield* ipc.handle(getConnectionCatalog);
107 yield* ipc.handle(getSnapShotState);
108 yield* ipc.handle(setupSnapShot);
109 yield* ipc.handle(previewSnapShotConfig);
110 yield* ipc.handle(applySnapShotConfig);
111 yield* ipc.handle(requestSnapShotPermissions);
112 yield* ipc.handle(checkSnapShotShortcut);
113 yield* ipc.handle(setSnapShotShortcutSuppressed);
114 yield* ipc.handle(listPendingSnapShots);
115 yield* ipc.handle(readSnapShot);
116 yield* ipc.handle(setSnapShotAnimationDestination);
117 yield* ipc.handle(dismissSnapShotAnimation);
118 yield* ipc.handle(acknowledgeSnapShot);
119 yield* ipc.handle(setConnectionCatalog);
120 yield* ipc.handle(clearConnectionCatalog);
121
122 yield* ipc.handle(discoverSshHosts);
123 yield* ipc.handle(resolveSshHost);
124 yield* ipc.handle(ensureSshEnvironment);
125 yield* ipc.handle(disconnectSshEnvironment);
126 yield* ipc.handle(fetchSshEnvironmentDescriptor);
127 yield* ipc.handle(bootstrapSshBearerSession);
128 yield* ipc.handle(fetchSshSessionState);
129 yield* ipc.handle(issueSshWebSocketTicket);
130 yield* ipc.handle(resolveSshPasswordPrompt);
131
132 yield* ipc.handle(getServerExposureState);
133 yield* ipc.handle(setServerExposureMode);
134 yield* ipc.handle(setTailscaleServeEnabled);
135 yield* ipc.handle(getAdvertisedEndpoints);
136
137 yield* ipc.handle(getWslState);
138 yield* ipc.handle(setWslBackendEnabled);
139 yield* ipc.handle(setWslDistro);
140 yield* ipc.handle(setWslOnly);
141
142 yield* ipc.handle(pickFolder);
143 yield* ipc.handle(pickProjectFavicon);
144 yield* ipc.handle(pickThemeFiles);
145 yield* ipc.handle(setTheme);
146 yield* ipc.handle(showContextMenu);
147 yield* ipc.handle(openExternal);
148 yield* ipc.handle(receiveProviderAuthCallback);
149 yield* ipc.handle(cancelProviderAuthCallback);
150 yield* ipc.handle(openSystemSettings);
151 yield* ipc.handle(checkSystemPermission);
152 yield* ipc.handle(pasteAsText);
153 yield* ipc.handle(probeRemoteEditors);
154 yield* ipc.handle(getUpdateState);
155 yield* ipc.handle(setUpdateChannel);
156 yield* ipc.handle(downloadUpdate);
157 yield* ipc.handle(installUpdate);
158 yield* ipc.handle(checkForUpdate);
159 yield* ipc.handle(getCliCommandState);
160 yield* ipc.handle(installCliCommand);
161 yield* ipc.handle(uninstallCliCommand);
162 for (const previewMethod of PreviewIpc.methods) {
163 yield* ipc.handle(previewMethod);
164 }
165 yield* ipc.handle(PreviewIpc.listBrowserImportSources);
166 yield* ipc.handle(PreviewIpc.importBrowserCookies);
167});