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