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 resolveSshPasswordPrompt,
25} from "./methods/sshEnvironment.ts";
26import {
27 checkForUpdate,
28 downloadUpdate,
29 getUpdateState,
30 installUpdate,
31 setUpdateChannel,
32} from "./methods/updates.ts";
33import {
34 getAppBranding,
35 getLocalEnvironmentBootstraps,
36 getLocalEnvironmentBearerToken,
37 getSystemLocale,
38 getWindowFullscreenState,
39 openExternal,
40 probeRemoteEditors,
41 pickFolder,
42 pickProjectFavicon,
43 pickThemeFiles,
44 setTheme,
45 showContextMenu,
46} from "./methods/window.ts";
47import * as PreviewIpc from "./methods/preview.ts";
48import * as AppActivationIpc from "./methods/appActivation.ts";
49import { getWslState, setWslBackendEnabled, setWslDistro, setWslOnly } from "./methods/wsl.ts";
50
51export const installDesktopIpcHandlers = Effect.fn("desktop.ipc.installHandlers")(function* () {
52 const ipc = yield* DesktopIpc.DesktopIpc;
53 yield* PreviewIpc.installPreviewEventForwarding();
54
55 yield* ipc.handle(AppActivationIpc.setReady);
56 yield* ipc.handle(AppActivationIpc.complete);
57
58 yield* ipc.handleSync(getAppBranding);
59 yield* ipc.handleSync(getSystemLocale);
60 yield* ipc.handleSync(getWindowFullscreenState);
61 yield* ipc.handleSync(getLocalEnvironmentBootstraps);
62 yield* ipc.handle(getLocalEnvironmentBearerToken);
63
64 yield* ipc.handle(getClientSettings);
65 yield* ipc.handle(setClientSettings);
66 yield* ipc.handle(getConnectionCatalog);
67 yield* ipc.handle(setConnectionCatalog);
68 yield* ipc.handle(clearConnectionCatalog);
69
70 yield* ipc.handle(discoverSshHosts);
71 yield* ipc.handle(ensureSshEnvironment);
72 yield* ipc.handle(disconnectSshEnvironment);
73 yield* ipc.handle(fetchSshEnvironmentDescriptor);
74 yield* ipc.handle(bootstrapSshBearerSession);
75 yield* ipc.handle(fetchSshSessionState);
76 yield* ipc.handle(issueSshWebSocketTicket);
77 yield* ipc.handle(resolveSshPasswordPrompt);
78
79 yield* ipc.handle(getServerExposureState);
80 yield* ipc.handle(setServerExposureMode);
81 yield* ipc.handle(setTailscaleServeEnabled);
82 yield* ipc.handle(getAdvertisedEndpoints);
83
84 yield* ipc.handle(getWslState);
85 yield* ipc.handle(setWslBackendEnabled);
86 yield* ipc.handle(setWslDistro);
87 yield* ipc.handle(setWslOnly);
88
89 yield* ipc.handle(pickFolder);
90 yield* ipc.handle(pickProjectFavicon);
91 yield* ipc.handle(pickThemeFiles);
92 yield* ipc.handle(setTheme);
93 yield* ipc.handle(showContextMenu);
94 yield* ipc.handle(openExternal);
95 yield* ipc.handle(probeRemoteEditors);
96 yield* ipc.handle(getUpdateState);
97 yield* ipc.handle(setUpdateChannel);
98 yield* ipc.handle(downloadUpdate);
99 yield* ipc.handle(installUpdate);
100 yield* ipc.handle(checkForUpdate);
101 for (const previewMethod of PreviewIpc.methods) {
102 yield* ipc.handle(previewMethod);
103 }
104});