authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-06-19 20:10:33-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-06-20 03:10:33+00:00
log938b19a6bb2e361845cb5a497174d4062549c39c
tree6186ca27ae6ee3b061588661e26bca5c589915d8
parent3b56dc17a5550de0f3ffd376ed2785cc12fbb96b
signature Signed by PGP key B5690EEEBB952194

[codex] Normalize Desktop IPC Effect service (#3203)

Co-authored-by: codex <codex@users.noreply.github.com>

9 files changed, 76 insertions(+), 74 deletions(-)

apps/desktop/src/ipc/DesktopIpc.ts+16-14
......@@ -1,5 +1,6 @@
11import * as Context from "effect/Context";
22import * as Effect from "effect/Effect";
3import * as Layer from "effect/Layer";
34import * as Schema from "effect/Schema";
45import * as Scope from "effect/Scope";
56
......@@ -33,20 +34,19 @@ export interface DesktopSyncIpcMethod<E, R> {
3334 readonly handler: () => Effect.Effect<unknown, E, R>;
3435}
3536
36export interface DesktopIpcShape {
37 readonly handle: <E, R>(
38 input: DesktopIpcMethod<E, R>,
39 ) => Effect.Effect<void, never, R | Scope.Scope>;
40 readonly handleSync: <E, R>(
41 input: DesktopSyncIpcMethod<E, R>,
42 ) => Effect.Effect<void, never, R | Scope.Scope>;
43}
44
45export class DesktopIpc extends Context.Service<DesktopIpc, DesktopIpcShape>()(
46 "@t3tools/desktop/ipc/DesktopIpc",
47) {}
48
49export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape =>
37export class DesktopIpc extends Context.Service<
38 DesktopIpc,
39 {
40 readonly handle: <E, R>(
41 input: DesktopIpcMethod<E, R>,
42 ) => Effect.Effect<void, never, R | Scope.Scope>;
43 readonly handleSync: <E, R>(
44 input: DesktopSyncIpcMethod<E, R>,
45 ) => Effect.Effect<void, never, R | Scope.Scope>;
46 }
47>()("@t3tools/desktop/ipc/DesktopIpc") {}
48
49export const make = (ipcMain: DesktopIpcMain): DesktopIpc["Service"] =>
5050 DesktopIpc.of({
5151 handle: Effect.fn("desktop.ipc.registerInvoke")(function* <E, R>({
5252 channel,
......@@ -97,6 +97,8 @@ export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape =>
9797 }),
9898 });
9999
100export const layer = (ipcMain: DesktopIpcMain) => Layer.succeed(DesktopIpc, make(ipcMain));
101
100102/**
101103 * Convenience helpers for creating IPC methods
102104 */
apps/desktop/src/ipc/methods/clientSettings.ts+3-3
......@@ -5,9 +5,9 @@ import * as Schema from "effect/Schema";
55
66import * as DesktopClientSettings from "../../settings/DesktopClientSettings.ts";
77import * as IpcChannels from "../channels.ts";
8import { makeIpcMethod } from "../DesktopIpc.ts";
8import * as DesktopIpc from "../DesktopIpc.ts";
99
10export const getClientSettings = makeIpcMethod({
10export const getClientSettings = DesktopIpc.makeIpcMethod({
1111 channel: IpcChannels.GET_CLIENT_SETTINGS_CHANNEL,
1212 payload: Schema.Void,
1313 result: Schema.NullOr(ClientSettingsSchema),
......@@ -17,7 +17,7 @@ export const getClientSettings = makeIpcMethod({
1717 }),
1818});
1919
20export const setClientSettings = makeIpcMethod({
20export const setClientSettings = DesktopIpc.makeIpcMethod({
2121 channel: IpcChannels.SET_CLIENT_SETTINGS_CHANNEL,
2222 payload: ClientSettingsSchema,
2323 result: Schema.Void,
apps/desktop/src/ipc/methods/connectionCatalog.ts+4-4
......@@ -4,9 +4,9 @@ import * as Schema from "effect/Schema";
44
55import * as DesktopConnectionCatalogStore from "../../app/DesktopConnectionCatalogStore.ts";
66import * as IpcChannels from "../channels.ts";
7import { makeIpcMethod } from "../DesktopIpc.ts";
7import * as DesktopIpc from "../DesktopIpc.ts";
88
9export const getConnectionCatalog = makeIpcMethod({
9export const getConnectionCatalog = DesktopIpc.makeIpcMethod({
1010 channel: IpcChannels.GET_CONNECTION_CATALOG_CHANNEL,
1111 payload: Schema.Void,
1212 result: Schema.NullOr(Schema.String),
......@@ -16,7 +16,7 @@ export const getConnectionCatalog = makeIpcMethod({
1616 }),
1717});
1818
19export const setConnectionCatalog = makeIpcMethod({
19export const setConnectionCatalog = DesktopIpc.makeIpcMethod({
2020 channel: IpcChannels.SET_CONNECTION_CATALOG_CHANNEL,
2121 payload: Schema.String,
2222 result: Schema.Boolean,
......@@ -26,7 +26,7 @@ export const setConnectionCatalog = makeIpcMethod({
2626 }),
2727});
2828
29export const clearConnectionCatalog = makeIpcMethod({
29export const clearConnectionCatalog = DesktopIpc.makeIpcMethod({
3030 channel: IpcChannels.CLEAR_CONNECTION_CATALOG_CHANNEL,
3131 payload: Schema.Void,
3232 result: Schema.Void,
apps/desktop/src/ipc/methods/preview.ts+23-23
......@@ -27,7 +27,7 @@ import { pathToFileURL } from "node:url";
2727import * as PreviewManager from "../../preview/Manager.ts";
2828import { PREVIEW_WEBVIEW_PREFERENCES } from "../../preview/WebviewPreferences.ts";
2929import * as IpcChannels from "../channels.ts";
30import { makeIpcMethod } from "../DesktopIpc.ts";
30import * as DesktopIpc from "../DesktopIpc.ts";
3131
3232const broadcast = (channel: string, ...args: ReadonlyArray<unknown>): void => {
3333 for (const window of BrowserWindow.getAllWindows()) {
......@@ -52,7 +52,7 @@ export const installPreviewEventForwarding = Effect.fn(
5252 });
5353});
5454
55export const createTab = makeIpcMethod({
55export const createTab = DesktopIpc.makeIpcMethod({
5656 channel: IpcChannels.PREVIEW_CREATE_TAB_CHANNEL,
5757 payload: DesktopPreviewTabInputSchema,
5858 result: Schema.Void,
......@@ -62,7 +62,7 @@ export const createTab = makeIpcMethod({
6262 }),
6363});
6464
65export const closeTab = makeIpcMethod({
65export const closeTab = DesktopIpc.makeIpcMethod({
6666 channel: IpcChannels.PREVIEW_CLOSE_TAB_CHANNEL,
6767 payload: DesktopPreviewTabInputSchema,
6868 result: Schema.Void,
......@@ -72,7 +72,7 @@ export const closeTab = makeIpcMethod({
7272 }),
7373});
7474
75export const registerWebview = makeIpcMethod({
75export const registerWebview = DesktopIpc.makeIpcMethod({
7676 channel: IpcChannels.PREVIEW_REGISTER_WEBVIEW_CHANNEL,
7777 payload: DesktopPreviewRegisterWebviewInputSchema,
7878 result: Schema.Void,
......@@ -82,7 +82,7 @@ export const registerWebview = makeIpcMethod({
8282 }),
8383});
8484
85export const navigate = makeIpcMethod({
85export const navigate = DesktopIpc.makeIpcMethod({
8686 channel: IpcChannels.PREVIEW_NAVIGATE_CHANNEL,
8787 payload: DesktopPreviewNavigateInputSchema,
8888 result: Schema.Void,
......@@ -100,7 +100,7 @@ const tabMethod = (
100100 tabId: string,
101101 ) => Effect.Effect<void, PreviewManager.PreviewManagerError>,
102102) =>
103 makeIpcMethod({
103 DesktopIpc.makeIpcMethod({
104104 channel,
105105 payload: DesktopPreviewTabInputSchema,
106106 result: Schema.Void,
......@@ -166,7 +166,7 @@ export const stopRecording = tabMethod(
166166 (manager, tabId) => manager.stopRecording(tabId),
167167);
168168
169export const clearCookies = makeIpcMethod({
169export const clearCookies = DesktopIpc.makeIpcMethod({
170170 channel: IpcChannels.PREVIEW_CLEAR_COOKIES_CHANNEL,
171171 payload: Schema.Void,
172172 result: Schema.Void,
......@@ -176,7 +176,7 @@ export const clearCookies = makeIpcMethod({
176176 }),
177177});
178178
179export const clearCache = makeIpcMethod({
179export const clearCache = DesktopIpc.makeIpcMethod({
180180 channel: IpcChannels.PREVIEW_CLEAR_CACHE_CHANNEL,
181181 payload: Schema.Void,
182182 result: Schema.Void,
......@@ -186,7 +186,7 @@ export const clearCache = makeIpcMethod({
186186 }),
187187});
188188
189export const getPreviewConfig = makeIpcMethod({
189export const getPreviewConfig = DesktopIpc.makeIpcMethod({
190190 channel: IpcChannels.PREVIEW_GET_CONFIG_CHANNEL,
191191 payload: DesktopPreviewConfigInputSchema,
192192 result: DesktopPreviewWebviewConfigSchema,
......@@ -201,7 +201,7 @@ export const getPreviewConfig = makeIpcMethod({
201201 }),
202202});
203203
204export const setAnnotationTheme = makeIpcMethod({
204export const setAnnotationTheme = DesktopIpc.makeIpcMethod({
205205 channel: IpcChannels.PREVIEW_SET_ANNOTATION_THEME_CHANNEL,
206206 payload: DesktopPreviewAnnotationThemeInputSchema,
207207 result: Schema.Void,
......@@ -211,7 +211,7 @@ export const setAnnotationTheme = makeIpcMethod({
211211 }),
212212});
213213
214export const pickElement = makeIpcMethod({
214export const pickElement = DesktopIpc.makeIpcMethod({
215215 channel: IpcChannels.PREVIEW_PICK_ELEMENT_CHANNEL,
216216 payload: DesktopPreviewTabInputSchema,
217217 result: Schema.NullOr(PreviewAnnotationPayloadSchema),
......@@ -221,7 +221,7 @@ export const pickElement = makeIpcMethod({
221221 }),
222222});
223223
224export const captureScreenshot = makeIpcMethod({
224export const captureScreenshot = DesktopIpc.makeIpcMethod({
225225 channel: IpcChannels.PREVIEW_CAPTURE_SCREENSHOT_CHANNEL,
226226 payload: DesktopPreviewTabInputSchema,
227227 result: DesktopPreviewScreenshotArtifactSchema,
......@@ -231,7 +231,7 @@ export const captureScreenshot = makeIpcMethod({
231231 }),
232232});
233233
234export const revealArtifact = makeIpcMethod({
234export const revealArtifact = DesktopIpc.makeIpcMethod({
235235 channel: IpcChannels.PREVIEW_REVEAL_ARTIFACT_CHANNEL,
236236 payload: DesktopPreviewArtifactInputSchema,
237237 result: Schema.Void,
......@@ -241,7 +241,7 @@ export const revealArtifact = makeIpcMethod({
241241 }),
242242});
243243
244export const copyArtifactToClipboard = makeIpcMethod({
244export const copyArtifactToClipboard = DesktopIpc.makeIpcMethod({
245245 channel: IpcChannels.PREVIEW_COPY_ARTIFACT_CHANNEL,
246246 payload: DesktopPreviewArtifactInputSchema,
247247 result: Schema.Void,
......@@ -251,7 +251,7 @@ export const copyArtifactToClipboard = makeIpcMethod({
251251 }),
252252});
253253
254export const automationStatus = makeIpcMethod({
254export const automationStatus = DesktopIpc.makeIpcMethod({
255255 channel: IpcChannels.PREVIEW_AUTOMATION_STATUS_CHANNEL,
256256 payload: DesktopPreviewTabInputSchema,
257257 result: PreviewAutomationStatus,
......@@ -261,7 +261,7 @@ export const automationStatus = makeIpcMethod({
261261 }),
262262});
263263
264export const automationSnapshot = makeIpcMethod({
264export const automationSnapshot = DesktopIpc.makeIpcMethod({
265265 channel: IpcChannels.PREVIEW_AUTOMATION_SNAPSHOT_CHANNEL,
266266 payload: DesktopPreviewTabInputSchema,
267267 result: PreviewAutomationSnapshot,
......@@ -271,7 +271,7 @@ export const automationSnapshot = makeIpcMethod({
271271 }),
272272});
273273
274export const automationClick = makeIpcMethod({
274export const automationClick = DesktopIpc.makeIpcMethod({
275275 channel: IpcChannels.PREVIEW_AUTOMATION_CLICK_CHANNEL,
276276 payload: DesktopPreviewAutomationClickInputSchema,
277277 result: Schema.Void,
......@@ -281,7 +281,7 @@ export const automationClick = makeIpcMethod({
281281 }),
282282});
283283
284export const automationType = makeIpcMethod({
284export const automationType = DesktopIpc.makeIpcMethod({
285285 channel: IpcChannels.PREVIEW_AUTOMATION_TYPE_CHANNEL,
286286 payload: DesktopPreviewAutomationTypeInputSchema,
287287 result: Schema.Void,
......@@ -291,7 +291,7 @@ export const automationType = makeIpcMethod({
291291 }),
292292});
293293
294export const automationPress = makeIpcMethod({
294export const automationPress = DesktopIpc.makeIpcMethod({
295295 channel: IpcChannels.PREVIEW_AUTOMATION_PRESS_CHANNEL,
296296 payload: DesktopPreviewAutomationPressInputSchema,
297297 result: Schema.Void,
......@@ -301,7 +301,7 @@ export const automationPress = makeIpcMethod({
301301 }),
302302});
303303
304export const automationScroll = makeIpcMethod({
304export const automationScroll = DesktopIpc.makeIpcMethod({
305305 channel: IpcChannels.PREVIEW_AUTOMATION_SCROLL_CHANNEL,
306306 payload: DesktopPreviewAutomationScrollInputSchema,
307307 result: Schema.Void,
......@@ -311,7 +311,7 @@ export const automationScroll = makeIpcMethod({
311311 }),
312312});
313313
314export const automationEvaluate = makeIpcMethod({
314export const automationEvaluate = DesktopIpc.makeIpcMethod({
315315 channel: IpcChannels.PREVIEW_AUTOMATION_EVALUATE_CHANNEL,
316316 payload: DesktopPreviewAutomationEvaluateInputSchema,
317317 result: Schema.Unknown,
......@@ -321,7 +321,7 @@ export const automationEvaluate = makeIpcMethod({
321321 }),
322322});
323323
324export const automationWaitFor = makeIpcMethod({
324export const automationWaitFor = DesktopIpc.makeIpcMethod({
325325 channel: IpcChannels.PREVIEW_AUTOMATION_WAIT_FOR_CHANNEL,
326326 payload: DesktopPreviewAutomationWaitForInputSchema,
327327 result: Schema.Void,
......@@ -331,7 +331,7 @@ export const automationWaitFor = makeIpcMethod({
331331 }),
332332});
333333
334export const saveRecording = makeIpcMethod({
334export const saveRecording = DesktopIpc.makeIpcMethod({
335335 channel: IpcChannels.PREVIEW_RECORDING_SAVE_CHANNEL,
336336 payload: DesktopPreviewRecordingSaveInputSchema,
337337 result: DesktopPreviewRecordingArtifactSchema,
apps/desktop/src/ipc/methods/serverExposure.ts+5-5
......@@ -9,14 +9,14 @@ import * as Schema from "effect/Schema";
99import * as DesktopLifecycle from "../../app/DesktopLifecycle.ts";
1010import * as DesktopServerExposure from "../../backend/DesktopServerExposure.ts";
1111import * as IpcChannels from "../channels.ts";
12import { makeIpcMethod } from "../DesktopIpc.ts";
12import * as DesktopIpc from "../DesktopIpc.ts";
1313
1414const SetTailscaleServeEnabledInput = Schema.Struct({
1515 enabled: Schema.Boolean,
1616 port: Schema.optionalKey(Schema.Number),
1717});
1818
19export const getServerExposureState = makeIpcMethod({
19export const getServerExposureState = DesktopIpc.makeIpcMethod({
2020 channel: IpcChannels.GET_SERVER_EXPOSURE_STATE_CHANNEL,
2121 payload: Schema.Void,
2222 result: DesktopServerExposureStateSchema,
......@@ -26,7 +26,7 @@ export const getServerExposureState = makeIpcMethod({
2626 }),
2727});
2828
29export const setServerExposureMode = makeIpcMethod({
29export const setServerExposureMode = DesktopIpc.makeIpcMethod({
3030 channel: IpcChannels.SET_SERVER_EXPOSURE_MODE_CHANNEL,
3131 payload: DesktopServerExposureModeSchema,
3232 result: DesktopServerExposureStateSchema,
......@@ -41,7 +41,7 @@ export const setServerExposureMode = makeIpcMethod({
4141 }),
4242});
4343
44export const setTailscaleServeEnabled = makeIpcMethod({
44export const setTailscaleServeEnabled = DesktopIpc.makeIpcMethod({
4545 channel: IpcChannels.SET_TAILSCALE_SERVE_ENABLED_CHANNEL,
4646 payload: SetTailscaleServeEnabledInput,
4747 result: DesktopServerExposureStateSchema,
......@@ -58,7 +58,7 @@ export const setTailscaleServeEnabled = makeIpcMethod({
5858 }),
5959});
6060
61export const getAdvertisedEndpoints = makeIpcMethod({
61export const getAdvertisedEndpoints = DesktopIpc.makeIpcMethod({
6262 channel: IpcChannels.GET_ADVERTISED_ENDPOINTS_CHANNEL,
6363 payload: Schema.Void,
6464 result: Schema.Array(AdvertisedEndpoint),
apps/desktop/src/ipc/methods/sshEnvironment.ts+9-9
......@@ -33,7 +33,7 @@ import * as Effect from "effect/Effect";
3333import * as Schema from "effect/Schema";
3434
3535import * as IpcChannels from "../channels.ts";
36import { makeIpcMethod } from "../DesktopIpc.ts";
36import * as DesktopIpc from "../DesktopIpc.ts";
3737import * as DesktopSshEnvironment from "../../ssh/DesktopSshEnvironment.ts";
3838import * as DesktopSshPasswordPrompts from "../../ssh/DesktopSshPasswordPrompts.ts";
3939
......@@ -107,7 +107,7 @@ const withLoopbackSshApi =
107107 ),
108108 );
109109
110export const discoverSshHosts = makeIpcMethod({
110export const discoverSshHosts = DesktopIpc.makeIpcMethod({
111111 channel: IpcChannels.DISCOVER_SSH_HOSTS_CHANNEL,
112112 payload: Schema.Void,
113113 result: Schema.Array(DesktopDiscoveredSshHostSchema),
......@@ -117,7 +117,7 @@ export const discoverSshHosts = makeIpcMethod({
117117 }),
118118});
119119
120export const ensureSshEnvironment = makeIpcMethod({
120export const ensureSshEnvironment = DesktopIpc.makeIpcMethod({
121121 channel: IpcChannels.ENSURE_SSH_ENVIRONMENT_CHANNEL,
122122 payload: DesktopSshEnvironmentEnsureInputSchema,
123123 result: DesktopSshEnvironmentEnsureResultSchema,
......@@ -139,7 +139,7 @@ export const ensureSshEnvironment = makeIpcMethod({
139139 }),
140140});
141141
142export const disconnectSshEnvironment = makeIpcMethod({
142export const disconnectSshEnvironment = DesktopIpc.makeIpcMethod({
143143 channel: IpcChannels.DISCONNECT_SSH_ENVIRONMENT_CHANNEL,
144144 payload: DesktopSshEnvironmentTargetSchema,
145145 result: Schema.Void,
......@@ -149,7 +149,7 @@ export const disconnectSshEnvironment = makeIpcMethod({
149149 }),
150150});
151151
152export const fetchSshEnvironmentDescriptor = makeIpcMethod({
152export const fetchSshEnvironmentDescriptor = DesktopIpc.makeIpcMethod({
153153 channel: IpcChannels.FETCH_SSH_ENVIRONMENT_DESCRIPTOR_CHANNEL,
154154 payload: DesktopSshHttpBaseUrlInputSchema,
155155 result: ExecutionEnvironmentDescriptor,
......@@ -160,7 +160,7 @@ export const fetchSshEnvironmentDescriptor = makeIpcMethod({
160160 }),
161161});
162162
163export const bootstrapSshBearerSession = makeIpcMethod({
163export const bootstrapSshBearerSession = DesktopIpc.makeIpcMethod({
164164 channel: IpcChannels.BOOTSTRAP_SSH_BEARER_SESSION_CHANNEL,
165165 payload: DesktopSshBearerBootstrapInputSchema,
166166 result: AuthAccessTokenResult,
......@@ -177,7 +177,7 @@ export const bootstrapSshBearerSession = makeIpcMethod({
177177 }),
178178});
179179
180export const fetchSshSessionState = makeIpcMethod({
180export const fetchSshSessionState = DesktopIpc.makeIpcMethod({
181181 channel: IpcChannels.FETCH_SSH_SESSION_STATE_CHANNEL,
182182 payload: DesktopSshBearerRequestInputSchema,
183183 result: AuthSessionState,
......@@ -194,7 +194,7 @@ export const fetchSshSessionState = makeIpcMethod({
194194 }),
195195});
196196
197export const issueSshWebSocketTicket = makeIpcMethod({
197export const issueSshWebSocketTicket = DesktopIpc.makeIpcMethod({
198198 channel: IpcChannels.ISSUE_SSH_WEBSOCKET_TOKEN_CHANNEL,
199199 payload: DesktopSshBearerRequestInputSchema,
200200 result: AuthWebSocketTicketResult,
......@@ -211,7 +211,7 @@ export const issueSshWebSocketTicket = makeIpcMethod({
211211 }),
212212});
213213
214export const resolveSshPasswordPrompt = makeIpcMethod({
214export const resolveSshPasswordPrompt = DesktopIpc.makeIpcMethod({
215215 channel: IpcChannels.RESOLVE_SSH_PASSWORD_PROMPT_CHANNEL,
216216 payload: DesktopSshPasswordPromptResolutionInputSchema,
217217 result: Schema.Void,
apps/desktop/src/ipc/methods/updates.ts+6-6
......@@ -9,9 +9,9 @@ import * as Schema from "effect/Schema";
99
1010import * as DesktopUpdates from "../../updates/DesktopUpdates.ts";
1111import * as IpcChannels from "../channels.ts";
12import { makeIpcMethod } from "../DesktopIpc.ts";
12import * as DesktopIpc from "../DesktopIpc.ts";
1313
14export const getUpdateState = makeIpcMethod({
14export const getUpdateState = DesktopIpc.makeIpcMethod({
1515 channel: IpcChannels.UPDATE_GET_STATE_CHANNEL,
1616 payload: Schema.Void,
1717 result: DesktopUpdateStateSchema,
......@@ -21,7 +21,7 @@ export const getUpdateState = makeIpcMethod({
2121 }),
2222});
2323
24export const setUpdateChannel = makeIpcMethod({
24export const setUpdateChannel = DesktopIpc.makeIpcMethod({
2525 channel: IpcChannels.UPDATE_SET_CHANNEL_CHANNEL,
2626 payload: DesktopUpdateChannelSchema,
2727 result: DesktopUpdateStateSchema,
......@@ -31,7 +31,7 @@ export const setUpdateChannel = makeIpcMethod({
3131 }),
3232});
3333
34export const downloadUpdate = makeIpcMethod({
34export const downloadUpdate = DesktopIpc.makeIpcMethod({
3535 channel: IpcChannels.UPDATE_DOWNLOAD_CHANNEL,
3636 payload: Schema.Void,
3737 result: DesktopUpdateActionResultSchema,
......@@ -41,7 +41,7 @@ export const downloadUpdate = makeIpcMethod({
4141 }),
4242});
4343
44export const installUpdate = makeIpcMethod({
44export const installUpdate = DesktopIpc.makeIpcMethod({
4545 channel: IpcChannels.UPDATE_INSTALL_CHANNEL,
4646 payload: Schema.Void,
4747 result: DesktopUpdateActionResultSchema,
......@@ -51,7 +51,7 @@ export const installUpdate = makeIpcMethod({
5151 }),
5252});
5353
54export const checkForUpdate = makeIpcMethod({
54export const checkForUpdate = DesktopIpc.makeIpcMethod({
5555 channel: IpcChannels.UPDATE_CHECK_CHANNEL,
5656 payload: Schema.Void,
5757 result: DesktopUpdateCheckResultSchema,
apps/desktop/src/ipc/methods/window.ts+9-9
......@@ -18,7 +18,7 @@ import * as ElectronShell from "../../electron/ElectronShell.ts";
1818import * as ElectronTheme from "../../electron/ElectronTheme.ts";
1919import * as ElectronWindow from "../../electron/ElectronWindow.ts";
2020import * as IpcChannels from "../channels.ts";
21import { makeIpcMethod, makeSyncIpcMethod } from "../DesktopIpc.ts";
21import * as DesktopIpc from "../DesktopIpc.ts";
2222
2323const ContextMenuPosition = Schema.Struct({
2424 x: Schema.Number,
......@@ -36,7 +36,7 @@ function toWebSocketBaseUrl(httpBaseUrl: URL): string {
3636 return url.href;
3737}
3838
39export const getAppBranding = makeSyncIpcMethod({
39export const getAppBranding = DesktopIpc.makeSyncIpcMethod({
4040 channel: IpcChannels.GET_APP_BRANDING_CHANNEL,
4141 result: Schema.NullOr(DesktopAppBrandingSchema),
4242 handler: Effect.fn("desktop.ipc.window.getAppBranding")(function* () {
......@@ -45,7 +45,7 @@ export const getAppBranding = makeSyncIpcMethod({
4545 }),
4646});
4747
48export const getLocalEnvironmentBootstrap = makeSyncIpcMethod({
48export const getLocalEnvironmentBootstrap = DesktopIpc.makeSyncIpcMethod({
4949 channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAP_CHANNEL,
5050 result: Schema.NullOr(DesktopEnvironmentBootstrapSchema),
5151 handler: Effect.fn("desktop.ipc.window.getLocalEnvironmentBootstrap")(function* () {
......@@ -65,7 +65,7 @@ export const getLocalEnvironmentBootstrap = makeSyncIpcMethod({
6565 }),
6666});
6767
68export const getLocalEnvironmentBearerToken = makeIpcMethod({
68export const getLocalEnvironmentBearerToken = DesktopIpc.makeIpcMethod({
6969 channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BEARER_TOKEN_CHANNEL,
7070 payload: Schema.Void,
7171 result: Schema.String,
......@@ -75,7 +75,7 @@ export const getLocalEnvironmentBearerToken = makeIpcMethod({
7575 }),
7676});
7777
78export const pickFolder = makeIpcMethod({
78export const pickFolder = DesktopIpc.makeIpcMethod({
7979 channel: IpcChannels.PICK_FOLDER_CHANNEL,
8080 payload: Schema.UndefinedOr(PickFolderOptionsSchema),
8181 result: Schema.NullOr(Schema.String),
......@@ -91,7 +91,7 @@ export const pickFolder = makeIpcMethod({
9191 }),
9292});
9393
94export const confirm = makeIpcMethod({
94export const confirm = DesktopIpc.makeIpcMethod({
9595 channel: IpcChannels.CONFIRM_CHANNEL,
9696 payload: Schema.String,
9797 result: Schema.Boolean,
......@@ -104,7 +104,7 @@ export const confirm = makeIpcMethod({
104104 }),
105105});
106106
107export const setTheme = makeIpcMethod({
107export const setTheme = DesktopIpc.makeIpcMethod({
108108 channel: IpcChannels.SET_THEME_CHANNEL,
109109 payload: DesktopThemeSchema,
110110 result: Schema.Void,
......@@ -114,7 +114,7 @@ export const setTheme = makeIpcMethod({
114114 }),
115115});
116116
117export const showContextMenu = makeIpcMethod({
117export const showContextMenu = DesktopIpc.makeIpcMethod({
118118 channel: IpcChannels.CONTEXT_MENU_CHANNEL,
119119 payload: ContextMenuInput,
120120 result: Schema.NullOr(Schema.String),
......@@ -135,7 +135,7 @@ export const showContextMenu = makeIpcMethod({
135135 }),
136136});
137137
138export const openExternal = makeIpcMethod({
138export const openExternal = DesktopIpc.makeIpcMethod({
139139 channel: IpcChannels.OPEN_EXTERNAL_CHANNEL,
140140 payload: Schema.String,
141141 result: Schema.Boolean,
apps/desktop/src/main.ts+1-1
......@@ -109,7 +109,7 @@ const electronLayer = Layer.mergeAll(
109109 ElectronTheme.layer,
110110 ElectronUpdater.layer,
111111 ElectronWindow.layer,
112 Layer.succeed(DesktopIpc.DesktopIpc, DesktopIpc.make(Electron.ipcMain)),
112 DesktopIpc.layer(Electron.ipcMain),
113113);
114114
115115const desktopFoundationLayer = Layer.mergeAll(