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