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