| author | |
| committer | |
| log | 938b19a6bb2e361845cb5a497174d4062549c39c |
| tree | 6186ca27ae6ee3b061588661e26bca5c589915d8 |
| parent | 3b56dc17a5550de0f3ffd376ed2785cc12fbb96b |
| signature | Signed by PGP key B5690EEEBB952194 |
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 @@ | ... | @@ -1,5 +1,6 @@ |
| 1 | import * as Context from "effect/Context"; | 1 | import * as Context from "effect/Context"; |
| 2 | import * as Effect from "effect/Effect"; | 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Layer from "effect/Layer"; | ||
| 3 | import * as Schema from "effect/Schema"; | 4 | import * as Schema from "effect/Schema"; |
| 4 | import * as Scope from "effect/Scope"; | 5 | import * as Scope from "effect/Scope"; |
| 5 | 6 | ||
| ... | @@ -33,20 +34,19 @@ export interface DesktopSyncIpcMethod<E, R> { | ... | @@ -33,20 +34,19 @@ export interface DesktopSyncIpcMethod<E, R> { |
| 33 | readonly handler: () => Effect.Effect<unknown, E, R>; | 34 | readonly handler: () => Effect.Effect<unknown, E, R>; |
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | export interface DesktopIpcShape { | 37 | export class DesktopIpc extends Context.Service< |
| 37 | readonly handle: <E, R>( | 38 | DesktopIpc, |
| 38 | input: DesktopIpcMethod<E, R>, | 39 | { |
| 39 | ) => Effect.Effect<void, never, R | Scope.Scope>; | 40 | readonly handle: <E, R>( |
| 40 | readonly handleSync: <E, R>( | 41 | input: DesktopIpcMethod<E, R>, |
| 41 | input: DesktopSyncIpcMethod<E, R>, | 42 | ) => Effect.Effect<void, never, R | Scope.Scope>; |
| 42 | ) => Effect.Effect<void, never, R | Scope.Scope>; | 43 | readonly handleSync: <E, R>( |
| 43 | } | 44 | input: DesktopSyncIpcMethod<E, R>, |
| 44 | 45 | ) => Effect.Effect<void, never, R | Scope.Scope>; | |
| 45 | export class DesktopIpc extends Context.Service<DesktopIpc, DesktopIpcShape>()( | 46 | } |
| 46 | "@t3tools/desktop/ipc/DesktopIpc", | 47 | >()("@t3tools/desktop/ipc/DesktopIpc") {} |
| 47 | ) {} | 48 | |
| 48 | 49 | export const make = (ipcMain: DesktopIpcMain): DesktopIpc["Service"] => | |
| 49 | export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape => | ||
| 50 | DesktopIpc.of({ | 50 | DesktopIpc.of({ |
| 51 | handle: Effect.fn("desktop.ipc.registerInvoke")(function* <E, R>({ | 51 | handle: Effect.fn("desktop.ipc.registerInvoke")(function* <E, R>({ |
| 52 | channel, | 52 | channel, |
| ... | @@ -97,6 +97,8 @@ export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape => | ... | @@ -97,6 +97,8 @@ export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape => |
| 97 | }), | 97 | }), |
| 98 | }); | 98 | }); |
| 99 | 99 | ||
| 100 | export const layer = (ipcMain: DesktopIpcMain) => Layer.succeed(DesktopIpc, make(ipcMain)); | ||
| 101 | |||
| 100 | /** | 102 | /** |
| 101 | * Convenience helpers for creating IPC methods | 103 | * Convenience helpers for creating IPC methods |
| 102 | */ | 104 | */ |
apps/desktop/src/ipc/methods/clientSettings.ts+3-3| ... | @@ -5,9 +5,9 @@ import * as Schema from "effect/Schema"; | ... | @@ -5,9 +5,9 @@ import * as Schema from "effect/Schema"; |
| 5 | 5 | ||
| 6 | import * as DesktopClientSettings from "../../settings/DesktopClientSettings.ts"; | 6 | import * as DesktopClientSettings from "../../settings/DesktopClientSettings.ts"; |
| 7 | import * as IpcChannels from "../channels.ts"; | 7 | import * as IpcChannels from "../channels.ts"; |
| 8 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 8 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 9 | 9 | ||
| 10 | export const getClientSettings = makeIpcMethod({ | 10 | export const getClientSettings = DesktopIpc.makeIpcMethod({ |
| 11 | channel: IpcChannels.GET_CLIENT_SETTINGS_CHANNEL, | 11 | channel: IpcChannels.GET_CLIENT_SETTINGS_CHANNEL, |
| 12 | payload: Schema.Void, | 12 | payload: Schema.Void, |
| 13 | result: Schema.NullOr(ClientSettingsSchema), | 13 | result: Schema.NullOr(ClientSettingsSchema), |
| ... | @@ -17,7 +17,7 @@ export const getClientSettings = makeIpcMethod({ | ... | @@ -17,7 +17,7 @@ export const getClientSettings = makeIpcMethod({ |
| 17 | }), | 17 | }), |
| 18 | }); | 18 | }); |
| 19 | 19 | ||
| 20 | export const setClientSettings = makeIpcMethod({ | 20 | export const setClientSettings = DesktopIpc.makeIpcMethod({ |
| 21 | channel: IpcChannels.SET_CLIENT_SETTINGS_CHANNEL, | 21 | channel: IpcChannels.SET_CLIENT_SETTINGS_CHANNEL, |
| 22 | payload: ClientSettingsSchema, | 22 | payload: ClientSettingsSchema, |
| 23 | result: Schema.Void, | 23 | result: Schema.Void, |
apps/desktop/src/ipc/methods/connectionCatalog.ts+4-4| ... | @@ -4,9 +4,9 @@ import * as Schema from "effect/Schema"; | ... | @@ -4,9 +4,9 @@ import * as Schema from "effect/Schema"; |
| 4 | 4 | ||
| 5 | import * as DesktopConnectionCatalogStore from "../../app/DesktopConnectionCatalogStore.ts"; | 5 | import * as DesktopConnectionCatalogStore from "../../app/DesktopConnectionCatalogStore.ts"; |
| 6 | import * as IpcChannels from "../channels.ts"; | 6 | import * as IpcChannels from "../channels.ts"; |
| 7 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 7 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 8 | 8 | ||
| 9 | export const getConnectionCatalog = makeIpcMethod({ | 9 | export const getConnectionCatalog = DesktopIpc.makeIpcMethod({ |
| 10 | channel: IpcChannels.GET_CONNECTION_CATALOG_CHANNEL, | 10 | channel: IpcChannels.GET_CONNECTION_CATALOG_CHANNEL, |
| 11 | payload: Schema.Void, | 11 | payload: Schema.Void, |
| 12 | result: Schema.NullOr(Schema.String), | 12 | result: Schema.NullOr(Schema.String), |
| ... | @@ -16,7 +16,7 @@ export const getConnectionCatalog = makeIpcMethod({ | ... | @@ -16,7 +16,7 @@ export const getConnectionCatalog = makeIpcMethod({ |
| 16 | }), | 16 | }), |
| 17 | }); | 17 | }); |
| 18 | 18 | ||
| 19 | export const setConnectionCatalog = makeIpcMethod({ | 19 | export const setConnectionCatalog = DesktopIpc.makeIpcMethod({ |
| 20 | channel: IpcChannels.SET_CONNECTION_CATALOG_CHANNEL, | 20 | channel: IpcChannels.SET_CONNECTION_CATALOG_CHANNEL, |
| 21 | payload: Schema.String, | 21 | payload: Schema.String, |
| 22 | result: Schema.Boolean, | 22 | result: Schema.Boolean, |
| ... | @@ -26,7 +26,7 @@ export const setConnectionCatalog = makeIpcMethod({ | ... | @@ -26,7 +26,7 @@ export const setConnectionCatalog = makeIpcMethod({ |
| 26 | }), | 26 | }), |
| 27 | }); | 27 | }); |
| 28 | 28 | ||
| 29 | export const clearConnectionCatalog = makeIpcMethod({ | 29 | export const clearConnectionCatalog = DesktopIpc.makeIpcMethod({ |
| 30 | channel: IpcChannels.CLEAR_CONNECTION_CATALOG_CHANNEL, | 30 | channel: IpcChannels.CLEAR_CONNECTION_CATALOG_CHANNEL, |
| 31 | payload: Schema.Void, | 31 | payload: Schema.Void, |
| 32 | result: Schema.Void, | 32 | result: Schema.Void, |
apps/desktop/src/ipc/methods/preview.ts+23-23| ... | @@ -27,7 +27,7 @@ import { pathToFileURL } from "node:url"; | ... | @@ -27,7 +27,7 @@ import { pathToFileURL } from "node:url"; |
| 27 | import * as PreviewManager from "../../preview/Manager.ts"; | 27 | import * as PreviewManager from "../../preview/Manager.ts"; |
| 28 | import { PREVIEW_WEBVIEW_PREFERENCES } from "../../preview/WebviewPreferences.ts"; | 28 | import { PREVIEW_WEBVIEW_PREFERENCES } from "../../preview/WebviewPreferences.ts"; |
| 29 | import * as IpcChannels from "../channels.ts"; | 29 | import * as IpcChannels from "../channels.ts"; |
| 30 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 30 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 31 | 31 | ||
| 32 | const broadcast = (channel: string, ...args: ReadonlyArray<unknown>): void => { | 32 | const broadcast = (channel: string, ...args: ReadonlyArray<unknown>): void => { |
| 33 | for (const window of BrowserWindow.getAllWindows()) { | 33 | for (const window of BrowserWindow.getAllWindows()) { |
| ... | @@ -52,7 +52,7 @@ export const installPreviewEventForwarding = Effect.fn( | ... | @@ -52,7 +52,7 @@ export const installPreviewEventForwarding = Effect.fn( |
| 52 | }); | 52 | }); |
| 53 | }); | 53 | }); |
| 54 | 54 | ||
| 55 | export const createTab = makeIpcMethod({ | 55 | export const createTab = DesktopIpc.makeIpcMethod({ |
| 56 | channel: IpcChannels.PREVIEW_CREATE_TAB_CHANNEL, | 56 | channel: IpcChannels.PREVIEW_CREATE_TAB_CHANNEL, |
| 57 | payload: DesktopPreviewTabInputSchema, | 57 | payload: DesktopPreviewTabInputSchema, |
| 58 | result: Schema.Void, | 58 | result: Schema.Void, |
| ... | @@ -62,7 +62,7 @@ export const createTab = makeIpcMethod({ | ... | @@ -62,7 +62,7 @@ export const createTab = makeIpcMethod({ |
| 62 | }), | 62 | }), |
| 63 | }); | 63 | }); |
| 64 | 64 | ||
| 65 | export const closeTab = makeIpcMethod({ | 65 | export const closeTab = DesktopIpc.makeIpcMethod({ |
| 66 | channel: IpcChannels.PREVIEW_CLOSE_TAB_CHANNEL, | 66 | channel: IpcChannels.PREVIEW_CLOSE_TAB_CHANNEL, |
| 67 | payload: DesktopPreviewTabInputSchema, | 67 | payload: DesktopPreviewTabInputSchema, |
| 68 | result: Schema.Void, | 68 | result: Schema.Void, |
| ... | @@ -72,7 +72,7 @@ export const closeTab = makeIpcMethod({ | ... | @@ -72,7 +72,7 @@ export const closeTab = makeIpcMethod({ |
| 72 | }), | 72 | }), |
| 73 | }); | 73 | }); |
| 74 | 74 | ||
| 75 | export const registerWebview = makeIpcMethod({ | 75 | export const registerWebview = DesktopIpc.makeIpcMethod({ |
| 76 | channel: IpcChannels.PREVIEW_REGISTER_WEBVIEW_CHANNEL, | 76 | channel: IpcChannels.PREVIEW_REGISTER_WEBVIEW_CHANNEL, |
| 77 | payload: DesktopPreviewRegisterWebviewInputSchema, | 77 | payload: DesktopPreviewRegisterWebviewInputSchema, |
| 78 | result: Schema.Void, | 78 | result: Schema.Void, |
| ... | @@ -82,7 +82,7 @@ export const registerWebview = makeIpcMethod({ | ... | @@ -82,7 +82,7 @@ export const registerWebview = makeIpcMethod({ |
| 82 | }), | 82 | }), |
| 83 | }); | 83 | }); |
| 84 | 84 | ||
| 85 | export const navigate = makeIpcMethod({ | 85 | export const navigate = DesktopIpc.makeIpcMethod({ |
| 86 | channel: IpcChannels.PREVIEW_NAVIGATE_CHANNEL, | 86 | channel: IpcChannels.PREVIEW_NAVIGATE_CHANNEL, |
| 87 | payload: DesktopPreviewNavigateInputSchema, | 87 | payload: DesktopPreviewNavigateInputSchema, |
| 88 | result: Schema.Void, | 88 | result: Schema.Void, |
| ... | @@ -100,7 +100,7 @@ const tabMethod = ( | ... | @@ -100,7 +100,7 @@ const tabMethod = ( |
| 100 | tabId: string, | 100 | tabId: string, |
| 101 | ) => Effect.Effect<void, PreviewManager.PreviewManagerError>, | 101 | ) => Effect.Effect<void, PreviewManager.PreviewManagerError>, |
| 102 | ) => | 102 | ) => |
| 103 | makeIpcMethod({ | 103 | DesktopIpc.makeIpcMethod({ |
| 104 | channel, | 104 | channel, |
| 105 | payload: DesktopPreviewTabInputSchema, | 105 | payload: DesktopPreviewTabInputSchema, |
| 106 | result: Schema.Void, | 106 | result: Schema.Void, |
| ... | @@ -166,7 +166,7 @@ export const stopRecording = tabMethod( | ... | @@ -166,7 +166,7 @@ export const stopRecording = tabMethod( |
| 166 | (manager, tabId) => manager.stopRecording(tabId), | 166 | (manager, tabId) => manager.stopRecording(tabId), |
| 167 | ); | 167 | ); |
| 168 | 168 | ||
| 169 | export const clearCookies = makeIpcMethod({ | 169 | export const clearCookies = DesktopIpc.makeIpcMethod({ |
| 170 | channel: IpcChannels.PREVIEW_CLEAR_COOKIES_CHANNEL, | 170 | channel: IpcChannels.PREVIEW_CLEAR_COOKIES_CHANNEL, |
| 171 | payload: Schema.Void, | 171 | payload: Schema.Void, |
| 172 | result: Schema.Void, | 172 | result: Schema.Void, |
| ... | @@ -176,7 +176,7 @@ export const clearCookies = makeIpcMethod({ | ... | @@ -176,7 +176,7 @@ export const clearCookies = makeIpcMethod({ |
| 176 | }), | 176 | }), |
| 177 | }); | 177 | }); |
| 178 | 178 | ||
| 179 | export const clearCache = makeIpcMethod({ | 179 | export const clearCache = DesktopIpc.makeIpcMethod({ |
| 180 | channel: IpcChannels.PREVIEW_CLEAR_CACHE_CHANNEL, | 180 | channel: IpcChannels.PREVIEW_CLEAR_CACHE_CHANNEL, |
| 181 | payload: Schema.Void, | 181 | payload: Schema.Void, |
| 182 | result: Schema.Void, | 182 | result: Schema.Void, |
| ... | @@ -186,7 +186,7 @@ export const clearCache = makeIpcMethod({ | ... | @@ -186,7 +186,7 @@ export const clearCache = makeIpcMethod({ |
| 186 | }), | 186 | }), |
| 187 | }); | 187 | }); |
| 188 | 188 | ||
| 189 | export const getPreviewConfig = makeIpcMethod({ | 189 | export const getPreviewConfig = DesktopIpc.makeIpcMethod({ |
| 190 | channel: IpcChannels.PREVIEW_GET_CONFIG_CHANNEL, | 190 | channel: IpcChannels.PREVIEW_GET_CONFIG_CHANNEL, |
| 191 | payload: DesktopPreviewConfigInputSchema, | 191 | payload: DesktopPreviewConfigInputSchema, |
| 192 | result: DesktopPreviewWebviewConfigSchema, | 192 | result: DesktopPreviewWebviewConfigSchema, |
| ... | @@ -201,7 +201,7 @@ export const getPreviewConfig = makeIpcMethod({ | ... | @@ -201,7 +201,7 @@ export const getPreviewConfig = makeIpcMethod({ |
| 201 | }), | 201 | }), |
| 202 | }); | 202 | }); |
| 203 | 203 | ||
| 204 | export const setAnnotationTheme = makeIpcMethod({ | 204 | export const setAnnotationTheme = DesktopIpc.makeIpcMethod({ |
| 205 | channel: IpcChannels.PREVIEW_SET_ANNOTATION_THEME_CHANNEL, | 205 | channel: IpcChannels.PREVIEW_SET_ANNOTATION_THEME_CHANNEL, |
| 206 | payload: DesktopPreviewAnnotationThemeInputSchema, | 206 | payload: DesktopPreviewAnnotationThemeInputSchema, |
| 207 | result: Schema.Void, | 207 | result: Schema.Void, |
| ... | @@ -211,7 +211,7 @@ export const setAnnotationTheme = makeIpcMethod({ | ... | @@ -211,7 +211,7 @@ export const setAnnotationTheme = makeIpcMethod({ |
| 211 | }), | 211 | }), |
| 212 | }); | 212 | }); |
| 213 | 213 | ||
| 214 | export const pickElement = makeIpcMethod({ | 214 | export const pickElement = DesktopIpc.makeIpcMethod({ |
| 215 | channel: IpcChannels.PREVIEW_PICK_ELEMENT_CHANNEL, | 215 | channel: IpcChannels.PREVIEW_PICK_ELEMENT_CHANNEL, |
| 216 | payload: DesktopPreviewTabInputSchema, | 216 | payload: DesktopPreviewTabInputSchema, |
| 217 | result: Schema.NullOr(PreviewAnnotationPayloadSchema), | 217 | result: Schema.NullOr(PreviewAnnotationPayloadSchema), |
| ... | @@ -221,7 +221,7 @@ export const pickElement = makeIpcMethod({ | ... | @@ -221,7 +221,7 @@ export const pickElement = makeIpcMethod({ |
| 221 | }), | 221 | }), |
| 222 | }); | 222 | }); |
| 223 | 223 | ||
| 224 | export const captureScreenshot = makeIpcMethod({ | 224 | export const captureScreenshot = DesktopIpc.makeIpcMethod({ |
| 225 | channel: IpcChannels.PREVIEW_CAPTURE_SCREENSHOT_CHANNEL, | 225 | channel: IpcChannels.PREVIEW_CAPTURE_SCREENSHOT_CHANNEL, |
| 226 | payload: DesktopPreviewTabInputSchema, | 226 | payload: DesktopPreviewTabInputSchema, |
| 227 | result: DesktopPreviewScreenshotArtifactSchema, | 227 | result: DesktopPreviewScreenshotArtifactSchema, |
| ... | @@ -231,7 +231,7 @@ export const captureScreenshot = makeIpcMethod({ | ... | @@ -231,7 +231,7 @@ export const captureScreenshot = makeIpcMethod({ |
| 231 | }), | 231 | }), |
| 232 | }); | 232 | }); |
| 233 | 233 | ||
| 234 | export const revealArtifact = makeIpcMethod({ | 234 | export const revealArtifact = DesktopIpc.makeIpcMethod({ |
| 235 | channel: IpcChannels.PREVIEW_REVEAL_ARTIFACT_CHANNEL, | 235 | channel: IpcChannels.PREVIEW_REVEAL_ARTIFACT_CHANNEL, |
| 236 | payload: DesktopPreviewArtifactInputSchema, | 236 | payload: DesktopPreviewArtifactInputSchema, |
| 237 | result: Schema.Void, | 237 | result: Schema.Void, |
| ... | @@ -241,7 +241,7 @@ export const revealArtifact = makeIpcMethod({ | ... | @@ -241,7 +241,7 @@ export const revealArtifact = makeIpcMethod({ |
| 241 | }), | 241 | }), |
| 242 | }); | 242 | }); |
| 243 | 243 | ||
| 244 | export const copyArtifactToClipboard = makeIpcMethod({ | 244 | export const copyArtifactToClipboard = DesktopIpc.makeIpcMethod({ |
| 245 | channel: IpcChannels.PREVIEW_COPY_ARTIFACT_CHANNEL, | 245 | channel: IpcChannels.PREVIEW_COPY_ARTIFACT_CHANNEL, |
| 246 | payload: DesktopPreviewArtifactInputSchema, | 246 | payload: DesktopPreviewArtifactInputSchema, |
| 247 | result: Schema.Void, | 247 | result: Schema.Void, |
| ... | @@ -251,7 +251,7 @@ export const copyArtifactToClipboard = makeIpcMethod({ | ... | @@ -251,7 +251,7 @@ export const copyArtifactToClipboard = makeIpcMethod({ |
| 251 | }), | 251 | }), |
| 252 | }); | 252 | }); |
| 253 | 253 | ||
| 254 | export const automationStatus = makeIpcMethod({ | 254 | export const automationStatus = DesktopIpc.makeIpcMethod({ |
| 255 | channel: IpcChannels.PREVIEW_AUTOMATION_STATUS_CHANNEL, | 255 | channel: IpcChannels.PREVIEW_AUTOMATION_STATUS_CHANNEL, |
| 256 | payload: DesktopPreviewTabInputSchema, | 256 | payload: DesktopPreviewTabInputSchema, |
| 257 | result: PreviewAutomationStatus, | 257 | result: PreviewAutomationStatus, |
| ... | @@ -261,7 +261,7 @@ export const automationStatus = makeIpcMethod({ | ... | @@ -261,7 +261,7 @@ export const automationStatus = makeIpcMethod({ |
| 261 | }), | 261 | }), |
| 262 | }); | 262 | }); |
| 263 | 263 | ||
| 264 | export const automationSnapshot = makeIpcMethod({ | 264 | export const automationSnapshot = DesktopIpc.makeIpcMethod({ |
| 265 | channel: IpcChannels.PREVIEW_AUTOMATION_SNAPSHOT_CHANNEL, | 265 | channel: IpcChannels.PREVIEW_AUTOMATION_SNAPSHOT_CHANNEL, |
| 266 | payload: DesktopPreviewTabInputSchema, | 266 | payload: DesktopPreviewTabInputSchema, |
| 267 | result: PreviewAutomationSnapshot, | 267 | result: PreviewAutomationSnapshot, |
| ... | @@ -271,7 +271,7 @@ export const automationSnapshot = makeIpcMethod({ | ... | @@ -271,7 +271,7 @@ export const automationSnapshot = makeIpcMethod({ |
| 271 | }), | 271 | }), |
| 272 | }); | 272 | }); |
| 273 | 273 | ||
| 274 | export const automationClick = makeIpcMethod({ | 274 | export const automationClick = DesktopIpc.makeIpcMethod({ |
| 275 | channel: IpcChannels.PREVIEW_AUTOMATION_CLICK_CHANNEL, | 275 | channel: IpcChannels.PREVIEW_AUTOMATION_CLICK_CHANNEL, |
| 276 | payload: DesktopPreviewAutomationClickInputSchema, | 276 | payload: DesktopPreviewAutomationClickInputSchema, |
| 277 | result: Schema.Void, | 277 | result: Schema.Void, |
| ... | @@ -281,7 +281,7 @@ export const automationClick = makeIpcMethod({ | ... | @@ -281,7 +281,7 @@ export const automationClick = makeIpcMethod({ |
| 281 | }), | 281 | }), |
| 282 | }); | 282 | }); |
| 283 | 283 | ||
| 284 | export const automationType = makeIpcMethod({ | 284 | export const automationType = DesktopIpc.makeIpcMethod({ |
| 285 | channel: IpcChannels.PREVIEW_AUTOMATION_TYPE_CHANNEL, | 285 | channel: IpcChannels.PREVIEW_AUTOMATION_TYPE_CHANNEL, |
| 286 | payload: DesktopPreviewAutomationTypeInputSchema, | 286 | payload: DesktopPreviewAutomationTypeInputSchema, |
| 287 | result: Schema.Void, | 287 | result: Schema.Void, |
| ... | @@ -291,7 +291,7 @@ export const automationType = makeIpcMethod({ | ... | @@ -291,7 +291,7 @@ export const automationType = makeIpcMethod({ |
| 291 | }), | 291 | }), |
| 292 | }); | 292 | }); |
| 293 | 293 | ||
| 294 | export const automationPress = makeIpcMethod({ | 294 | export const automationPress = DesktopIpc.makeIpcMethod({ |
| 295 | channel: IpcChannels.PREVIEW_AUTOMATION_PRESS_CHANNEL, | 295 | channel: IpcChannels.PREVIEW_AUTOMATION_PRESS_CHANNEL, |
| 296 | payload: DesktopPreviewAutomationPressInputSchema, | 296 | payload: DesktopPreviewAutomationPressInputSchema, |
| 297 | result: Schema.Void, | 297 | result: Schema.Void, |
| ... | @@ -301,7 +301,7 @@ export const automationPress = makeIpcMethod({ | ... | @@ -301,7 +301,7 @@ export const automationPress = makeIpcMethod({ |
| 301 | }), | 301 | }), |
| 302 | }); | 302 | }); |
| 303 | 303 | ||
| 304 | export const automationScroll = makeIpcMethod({ | 304 | export const automationScroll = DesktopIpc.makeIpcMethod({ |
| 305 | channel: IpcChannels.PREVIEW_AUTOMATION_SCROLL_CHANNEL, | 305 | channel: IpcChannels.PREVIEW_AUTOMATION_SCROLL_CHANNEL, |
| 306 | payload: DesktopPreviewAutomationScrollInputSchema, | 306 | payload: DesktopPreviewAutomationScrollInputSchema, |
| 307 | result: Schema.Void, | 307 | result: Schema.Void, |
| ... | @@ -311,7 +311,7 @@ export const automationScroll = makeIpcMethod({ | ... | @@ -311,7 +311,7 @@ export const automationScroll = makeIpcMethod({ |
| 311 | }), | 311 | }), |
| 312 | }); | 312 | }); |
| 313 | 313 | ||
| 314 | export const automationEvaluate = makeIpcMethod({ | 314 | export const automationEvaluate = DesktopIpc.makeIpcMethod({ |
| 315 | channel: IpcChannels.PREVIEW_AUTOMATION_EVALUATE_CHANNEL, | 315 | channel: IpcChannels.PREVIEW_AUTOMATION_EVALUATE_CHANNEL, |
| 316 | payload: DesktopPreviewAutomationEvaluateInputSchema, | 316 | payload: DesktopPreviewAutomationEvaluateInputSchema, |
| 317 | result: Schema.Unknown, | 317 | result: Schema.Unknown, |
| ... | @@ -321,7 +321,7 @@ export const automationEvaluate = makeIpcMethod({ | ... | @@ -321,7 +321,7 @@ export const automationEvaluate = makeIpcMethod({ |
| 321 | }), | 321 | }), |
| 322 | }); | 322 | }); |
| 323 | 323 | ||
| 324 | export const automationWaitFor = makeIpcMethod({ | 324 | export const automationWaitFor = DesktopIpc.makeIpcMethod({ |
| 325 | channel: IpcChannels.PREVIEW_AUTOMATION_WAIT_FOR_CHANNEL, | 325 | channel: IpcChannels.PREVIEW_AUTOMATION_WAIT_FOR_CHANNEL, |
| 326 | payload: DesktopPreviewAutomationWaitForInputSchema, | 326 | payload: DesktopPreviewAutomationWaitForInputSchema, |
| 327 | result: Schema.Void, | 327 | result: Schema.Void, |
| ... | @@ -331,7 +331,7 @@ export const automationWaitFor = makeIpcMethod({ | ... | @@ -331,7 +331,7 @@ export const automationWaitFor = makeIpcMethod({ |
| 331 | }), | 331 | }), |
| 332 | }); | 332 | }); |
| 333 | 333 | ||
| 334 | export const saveRecording = makeIpcMethod({ | 334 | export const saveRecording = DesktopIpc.makeIpcMethod({ |
| 335 | channel: IpcChannels.PREVIEW_RECORDING_SAVE_CHANNEL, | 335 | channel: IpcChannels.PREVIEW_RECORDING_SAVE_CHANNEL, |
| 336 | payload: DesktopPreviewRecordingSaveInputSchema, | 336 | payload: DesktopPreviewRecordingSaveInputSchema, |
| 337 | result: DesktopPreviewRecordingArtifactSchema, | 337 | result: DesktopPreviewRecordingArtifactSchema, |
apps/desktop/src/ipc/methods/serverExposure.ts+5-5| ... | @@ -9,14 +9,14 @@ import * as Schema from "effect/Schema"; | ... | @@ -9,14 +9,14 @@ import * as Schema from "effect/Schema"; |
| 9 | import * as DesktopLifecycle from "../../app/DesktopLifecycle.ts"; | 9 | import * as DesktopLifecycle from "../../app/DesktopLifecycle.ts"; |
| 10 | import * as DesktopServerExposure from "../../backend/DesktopServerExposure.ts"; | 10 | import * as DesktopServerExposure from "../../backend/DesktopServerExposure.ts"; |
| 11 | import * as IpcChannels from "../channels.ts"; | 11 | import * as IpcChannels from "../channels.ts"; |
| 12 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 12 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 13 | 13 | ||
| 14 | const SetTailscaleServeEnabledInput = Schema.Struct({ | 14 | const SetTailscaleServeEnabledInput = Schema.Struct({ |
| 15 | enabled: Schema.Boolean, | 15 | enabled: Schema.Boolean, |
| 16 | port: Schema.optionalKey(Schema.Number), | 16 | port: Schema.optionalKey(Schema.Number), |
| 17 | }); | 17 | }); |
| 18 | 18 | ||
| 19 | export const getServerExposureState = makeIpcMethod({ | 19 | export const getServerExposureState = DesktopIpc.makeIpcMethod({ |
| 20 | channel: IpcChannels.GET_SERVER_EXPOSURE_STATE_CHANNEL, | 20 | channel: IpcChannels.GET_SERVER_EXPOSURE_STATE_CHANNEL, |
| 21 | payload: Schema.Void, | 21 | payload: Schema.Void, |
| 22 | result: DesktopServerExposureStateSchema, | 22 | result: DesktopServerExposureStateSchema, |
| ... | @@ -26,7 +26,7 @@ export const getServerExposureState = makeIpcMethod({ | ... | @@ -26,7 +26,7 @@ export const getServerExposureState = makeIpcMethod({ |
| 26 | }), | 26 | }), |
| 27 | }); | 27 | }); |
| 28 | 28 | ||
| 29 | export const setServerExposureMode = makeIpcMethod({ | 29 | export const setServerExposureMode = DesktopIpc.makeIpcMethod({ |
| 30 | channel: IpcChannels.SET_SERVER_EXPOSURE_MODE_CHANNEL, | 30 | channel: IpcChannels.SET_SERVER_EXPOSURE_MODE_CHANNEL, |
| 31 | payload: DesktopServerExposureModeSchema, | 31 | payload: DesktopServerExposureModeSchema, |
| 32 | result: DesktopServerExposureStateSchema, | 32 | result: DesktopServerExposureStateSchema, |
| ... | @@ -41,7 +41,7 @@ export const setServerExposureMode = makeIpcMethod({ | ... | @@ -41,7 +41,7 @@ export const setServerExposureMode = makeIpcMethod({ |
| 41 | }), | 41 | }), |
| 42 | }); | 42 | }); |
| 43 | 43 | ||
| 44 | export const setTailscaleServeEnabled = makeIpcMethod({ | 44 | export const setTailscaleServeEnabled = DesktopIpc.makeIpcMethod({ |
| 45 | channel: IpcChannels.SET_TAILSCALE_SERVE_ENABLED_CHANNEL, | 45 | channel: IpcChannels.SET_TAILSCALE_SERVE_ENABLED_CHANNEL, |
| 46 | payload: SetTailscaleServeEnabledInput, | 46 | payload: SetTailscaleServeEnabledInput, |
| 47 | result: DesktopServerExposureStateSchema, | 47 | result: DesktopServerExposureStateSchema, |
| ... | @@ -58,7 +58,7 @@ export const setTailscaleServeEnabled = makeIpcMethod({ | ... | @@ -58,7 +58,7 @@ export const setTailscaleServeEnabled = makeIpcMethod({ |
| 58 | }), | 58 | }), |
| 59 | }); | 59 | }); |
| 60 | 60 | ||
| 61 | export const getAdvertisedEndpoints = makeIpcMethod({ | 61 | export const getAdvertisedEndpoints = DesktopIpc.makeIpcMethod({ |
| 62 | channel: IpcChannels.GET_ADVERTISED_ENDPOINTS_CHANNEL, | 62 | channel: IpcChannels.GET_ADVERTISED_ENDPOINTS_CHANNEL, |
| 63 | payload: Schema.Void, | 63 | payload: Schema.Void, |
| 64 | result: Schema.Array(AdvertisedEndpoint), | 64 | result: Schema.Array(AdvertisedEndpoint), |
apps/desktop/src/ipc/methods/sshEnvironment.ts+9-9| ... | @@ -33,7 +33,7 @@ import * as Effect from "effect/Effect"; | ... | @@ -33,7 +33,7 @@ import * as Effect from "effect/Effect"; |
| 33 | import * as Schema from "effect/Schema"; | 33 | import * as Schema from "effect/Schema"; |
| 34 | 34 | ||
| 35 | import * as IpcChannels from "../channels.ts"; | 35 | import * as IpcChannels from "../channels.ts"; |
| 36 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 36 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 37 | import * as DesktopSshEnvironment from "../../ssh/DesktopSshEnvironment.ts"; | 37 | import * as DesktopSshEnvironment from "../../ssh/DesktopSshEnvironment.ts"; |
| 38 | import * as DesktopSshPasswordPrompts from "../../ssh/DesktopSshPasswordPrompts.ts"; | 38 | import * as DesktopSshPasswordPrompts from "../../ssh/DesktopSshPasswordPrompts.ts"; |
| 39 | 39 | ||
| ... | @@ -107,7 +107,7 @@ const withLoopbackSshApi = | ... | @@ -107,7 +107,7 @@ const withLoopbackSshApi = |
| 107 | ), | 107 | ), |
| 108 | ); | 108 | ); |
| 109 | 109 | ||
| 110 | export const discoverSshHosts = makeIpcMethod({ | 110 | export const discoverSshHosts = DesktopIpc.makeIpcMethod({ |
| 111 | channel: IpcChannels.DISCOVER_SSH_HOSTS_CHANNEL, | 111 | channel: IpcChannels.DISCOVER_SSH_HOSTS_CHANNEL, |
| 112 | payload: Schema.Void, | 112 | payload: Schema.Void, |
| 113 | result: Schema.Array(DesktopDiscoveredSshHostSchema), | 113 | result: Schema.Array(DesktopDiscoveredSshHostSchema), |
| ... | @@ -117,7 +117,7 @@ export const discoverSshHosts = makeIpcMethod({ | ... | @@ -117,7 +117,7 @@ export const discoverSshHosts = makeIpcMethod({ |
| 117 | }), | 117 | }), |
| 118 | }); | 118 | }); |
| 119 | 119 | ||
| 120 | export const ensureSshEnvironment = makeIpcMethod({ | 120 | export const ensureSshEnvironment = DesktopIpc.makeIpcMethod({ |
| 121 | channel: IpcChannels.ENSURE_SSH_ENVIRONMENT_CHANNEL, | 121 | channel: IpcChannels.ENSURE_SSH_ENVIRONMENT_CHANNEL, |
| 122 | payload: DesktopSshEnvironmentEnsureInputSchema, | 122 | payload: DesktopSshEnvironmentEnsureInputSchema, |
| 123 | result: DesktopSshEnvironmentEnsureResultSchema, | 123 | result: DesktopSshEnvironmentEnsureResultSchema, |
| ... | @@ -139,7 +139,7 @@ export const ensureSshEnvironment = makeIpcMethod({ | ... | @@ -139,7 +139,7 @@ export const ensureSshEnvironment = makeIpcMethod({ |
| 139 | }), | 139 | }), |
| 140 | }); | 140 | }); |
| 141 | 141 | ||
| 142 | export const disconnectSshEnvironment = makeIpcMethod({ | 142 | export const disconnectSshEnvironment = DesktopIpc.makeIpcMethod({ |
| 143 | channel: IpcChannels.DISCONNECT_SSH_ENVIRONMENT_CHANNEL, | 143 | channel: IpcChannels.DISCONNECT_SSH_ENVIRONMENT_CHANNEL, |
| 144 | payload: DesktopSshEnvironmentTargetSchema, | 144 | payload: DesktopSshEnvironmentTargetSchema, |
| 145 | result: Schema.Void, | 145 | result: Schema.Void, |
| ... | @@ -149,7 +149,7 @@ export const disconnectSshEnvironment = makeIpcMethod({ | ... | @@ -149,7 +149,7 @@ export const disconnectSshEnvironment = makeIpcMethod({ |
| 149 | }), | 149 | }), |
| 150 | }); | 150 | }); |
| 151 | 151 | ||
| 152 | export const fetchSshEnvironmentDescriptor = makeIpcMethod({ | 152 | export const fetchSshEnvironmentDescriptor = DesktopIpc.makeIpcMethod({ |
| 153 | channel: IpcChannels.FETCH_SSH_ENVIRONMENT_DESCRIPTOR_CHANNEL, | 153 | channel: IpcChannels.FETCH_SSH_ENVIRONMENT_DESCRIPTOR_CHANNEL, |
| 154 | payload: DesktopSshHttpBaseUrlInputSchema, | 154 | payload: DesktopSshHttpBaseUrlInputSchema, |
| 155 | result: ExecutionEnvironmentDescriptor, | 155 | result: ExecutionEnvironmentDescriptor, |
| ... | @@ -160,7 +160,7 @@ export const fetchSshEnvironmentDescriptor = makeIpcMethod({ | ... | @@ -160,7 +160,7 @@ export const fetchSshEnvironmentDescriptor = makeIpcMethod({ |
| 160 | }), | 160 | }), |
| 161 | }); | 161 | }); |
| 162 | 162 | ||
| 163 | export const bootstrapSshBearerSession = makeIpcMethod({ | 163 | export const bootstrapSshBearerSession = DesktopIpc.makeIpcMethod({ |
| 164 | channel: IpcChannels.BOOTSTRAP_SSH_BEARER_SESSION_CHANNEL, | 164 | channel: IpcChannels.BOOTSTRAP_SSH_BEARER_SESSION_CHANNEL, |
| 165 | payload: DesktopSshBearerBootstrapInputSchema, | 165 | payload: DesktopSshBearerBootstrapInputSchema, |
| 166 | result: AuthAccessTokenResult, | 166 | result: AuthAccessTokenResult, |
| ... | @@ -177,7 +177,7 @@ export const bootstrapSshBearerSession = makeIpcMethod({ | ... | @@ -177,7 +177,7 @@ export const bootstrapSshBearerSession = makeIpcMethod({ |
| 177 | }), | 177 | }), |
| 178 | }); | 178 | }); |
| 179 | 179 | ||
| 180 | export const fetchSshSessionState = makeIpcMethod({ | 180 | export const fetchSshSessionState = DesktopIpc.makeIpcMethod({ |
| 181 | channel: IpcChannels.FETCH_SSH_SESSION_STATE_CHANNEL, | 181 | channel: IpcChannels.FETCH_SSH_SESSION_STATE_CHANNEL, |
| 182 | payload: DesktopSshBearerRequestInputSchema, | 182 | payload: DesktopSshBearerRequestInputSchema, |
| 183 | result: AuthSessionState, | 183 | result: AuthSessionState, |
| ... | @@ -194,7 +194,7 @@ export const fetchSshSessionState = makeIpcMethod({ | ... | @@ -194,7 +194,7 @@ export const fetchSshSessionState = makeIpcMethod({ |
| 194 | }), | 194 | }), |
| 195 | }); | 195 | }); |
| 196 | 196 | ||
| 197 | export const issueSshWebSocketTicket = makeIpcMethod({ | 197 | export const issueSshWebSocketTicket = DesktopIpc.makeIpcMethod({ |
| 198 | channel: IpcChannels.ISSUE_SSH_WEBSOCKET_TOKEN_CHANNEL, | 198 | channel: IpcChannels.ISSUE_SSH_WEBSOCKET_TOKEN_CHANNEL, |
| 199 | payload: DesktopSshBearerRequestInputSchema, | 199 | payload: DesktopSshBearerRequestInputSchema, |
| 200 | result: AuthWebSocketTicketResult, | 200 | result: AuthWebSocketTicketResult, |
| ... | @@ -211,7 +211,7 @@ export const issueSshWebSocketTicket = makeIpcMethod({ | ... | @@ -211,7 +211,7 @@ export const issueSshWebSocketTicket = makeIpcMethod({ |
| 211 | }), | 211 | }), |
| 212 | }); | 212 | }); |
| 213 | 213 | ||
| 214 | export const resolveSshPasswordPrompt = makeIpcMethod({ | 214 | export const resolveSshPasswordPrompt = DesktopIpc.makeIpcMethod({ |
| 215 | channel: IpcChannels.RESOLVE_SSH_PASSWORD_PROMPT_CHANNEL, | 215 | channel: IpcChannels.RESOLVE_SSH_PASSWORD_PROMPT_CHANNEL, |
| 216 | payload: DesktopSshPasswordPromptResolutionInputSchema, | 216 | payload: DesktopSshPasswordPromptResolutionInputSchema, |
| 217 | result: Schema.Void, | 217 | result: Schema.Void, |
apps/desktop/src/ipc/methods/updates.ts+6-6| ... | @@ -9,9 +9,9 @@ import * as Schema from "effect/Schema"; | ... | @@ -9,9 +9,9 @@ import * as Schema from "effect/Schema"; |
| 9 | 9 | ||
| 10 | import * as DesktopUpdates from "../../updates/DesktopUpdates.ts"; | 10 | import * as DesktopUpdates from "../../updates/DesktopUpdates.ts"; |
| 11 | import * as IpcChannels from "../channels.ts"; | 11 | import * as IpcChannels from "../channels.ts"; |
| 12 | import { makeIpcMethod } from "../DesktopIpc.ts"; | 12 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 13 | 13 | ||
| 14 | export const getUpdateState = makeIpcMethod({ | 14 | export const getUpdateState = DesktopIpc.makeIpcMethod({ |
| 15 | channel: IpcChannels.UPDATE_GET_STATE_CHANNEL, | 15 | channel: IpcChannels.UPDATE_GET_STATE_CHANNEL, |
| 16 | payload: Schema.Void, | 16 | payload: Schema.Void, |
| 17 | result: DesktopUpdateStateSchema, | 17 | result: DesktopUpdateStateSchema, |
| ... | @@ -21,7 +21,7 @@ export const getUpdateState = makeIpcMethod({ | ... | @@ -21,7 +21,7 @@ export const getUpdateState = makeIpcMethod({ |
| 21 | }), | 21 | }), |
| 22 | }); | 22 | }); |
| 23 | 23 | ||
| 24 | export const setUpdateChannel = makeIpcMethod({ | 24 | export const setUpdateChannel = DesktopIpc.makeIpcMethod({ |
| 25 | channel: IpcChannels.UPDATE_SET_CHANNEL_CHANNEL, | 25 | channel: IpcChannels.UPDATE_SET_CHANNEL_CHANNEL, |
| 26 | payload: DesktopUpdateChannelSchema, | 26 | payload: DesktopUpdateChannelSchema, |
| 27 | result: DesktopUpdateStateSchema, | 27 | result: DesktopUpdateStateSchema, |
| ... | @@ -31,7 +31,7 @@ export const setUpdateChannel = makeIpcMethod({ | ... | @@ -31,7 +31,7 @@ export const setUpdateChannel = makeIpcMethod({ |
| 31 | }), | 31 | }), |
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | export const downloadUpdate = makeIpcMethod({ | 34 | export const downloadUpdate = DesktopIpc.makeIpcMethod({ |
| 35 | channel: IpcChannels.UPDATE_DOWNLOAD_CHANNEL, | 35 | channel: IpcChannels.UPDATE_DOWNLOAD_CHANNEL, |
| 36 | payload: Schema.Void, | 36 | payload: Schema.Void, |
| 37 | result: DesktopUpdateActionResultSchema, | 37 | result: DesktopUpdateActionResultSchema, |
| ... | @@ -41,7 +41,7 @@ export const downloadUpdate = makeIpcMethod({ | ... | @@ -41,7 +41,7 @@ export const downloadUpdate = makeIpcMethod({ |
| 41 | }), | 41 | }), |
| 42 | }); | 42 | }); |
| 43 | 43 | ||
| 44 | export const installUpdate = makeIpcMethod({ | 44 | export const installUpdate = DesktopIpc.makeIpcMethod({ |
| 45 | channel: IpcChannels.UPDATE_INSTALL_CHANNEL, | 45 | channel: IpcChannels.UPDATE_INSTALL_CHANNEL, |
| 46 | payload: Schema.Void, | 46 | payload: Schema.Void, |
| 47 | result: DesktopUpdateActionResultSchema, | 47 | result: DesktopUpdateActionResultSchema, |
| ... | @@ -51,7 +51,7 @@ export const installUpdate = makeIpcMethod({ | ... | @@ -51,7 +51,7 @@ export const installUpdate = makeIpcMethod({ |
| 51 | }), | 51 | }), |
| 52 | }); | 52 | }); |
| 53 | 53 | ||
| 54 | export const checkForUpdate = makeIpcMethod({ | 54 | export const checkForUpdate = DesktopIpc.makeIpcMethod({ |
| 55 | channel: IpcChannels.UPDATE_CHECK_CHANNEL, | 55 | channel: IpcChannels.UPDATE_CHECK_CHANNEL, |
| 56 | payload: Schema.Void, | 56 | payload: Schema.Void, |
| 57 | result: DesktopUpdateCheckResultSchema, | 57 | result: DesktopUpdateCheckResultSchema, |
apps/desktop/src/ipc/methods/window.ts+9-9| ... | @@ -18,7 +18,7 @@ import * as ElectronShell from "../../electron/ElectronShell.ts"; | ... | @@ -18,7 +18,7 @@ import * as ElectronShell from "../../electron/ElectronShell.ts"; |
| 18 | import * as ElectronTheme from "../../electron/ElectronTheme.ts"; | 18 | import * as ElectronTheme from "../../electron/ElectronTheme.ts"; |
| 19 | import * as ElectronWindow from "../../electron/ElectronWindow.ts"; | 19 | import * as ElectronWindow from "../../electron/ElectronWindow.ts"; |
| 20 | import * as IpcChannels from "../channels.ts"; | 20 | import * as IpcChannels from "../channels.ts"; |
| 21 | import { makeIpcMethod, makeSyncIpcMethod } from "../DesktopIpc.ts"; | 21 | import * as DesktopIpc from "../DesktopIpc.ts"; |
| 22 | 22 | ||
| 23 | const ContextMenuPosition = Schema.Struct({ | 23 | const ContextMenuPosition = Schema.Struct({ |
| 24 | x: Schema.Number, | 24 | x: Schema.Number, |
| ... | @@ -36,7 +36,7 @@ function toWebSocketBaseUrl(httpBaseUrl: URL): string { | ... | @@ -36,7 +36,7 @@ function toWebSocketBaseUrl(httpBaseUrl: URL): string { |
| 36 | return url.href; | 36 | return url.href; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | export const getAppBranding = makeSyncIpcMethod({ | 39 | export const getAppBranding = DesktopIpc.makeSyncIpcMethod({ |
| 40 | channel: IpcChannels.GET_APP_BRANDING_CHANNEL, | 40 | channel: IpcChannels.GET_APP_BRANDING_CHANNEL, |
| 41 | result: Schema.NullOr(DesktopAppBrandingSchema), | 41 | result: Schema.NullOr(DesktopAppBrandingSchema), |
| 42 | handler: Effect.fn("desktop.ipc.window.getAppBranding")(function* () { | 42 | handler: Effect.fn("desktop.ipc.window.getAppBranding")(function* () { |
| ... | @@ -45,7 +45,7 @@ export const getAppBranding = makeSyncIpcMethod({ | ... | @@ -45,7 +45,7 @@ export const getAppBranding = makeSyncIpcMethod({ |
| 45 | }), | 45 | }), |
| 46 | }); | 46 | }); |
| 47 | 47 | ||
| 48 | export const getLocalEnvironmentBootstrap = makeSyncIpcMethod({ | 48 | export const getLocalEnvironmentBootstrap = DesktopIpc.makeSyncIpcMethod({ |
| 49 | channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAP_CHANNEL, | 49 | channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAP_CHANNEL, |
| 50 | result: Schema.NullOr(DesktopEnvironmentBootstrapSchema), | 50 | result: Schema.NullOr(DesktopEnvironmentBootstrapSchema), |
| 51 | handler: Effect.fn("desktop.ipc.window.getLocalEnvironmentBootstrap")(function* () { | 51 | handler: Effect.fn("desktop.ipc.window.getLocalEnvironmentBootstrap")(function* () { |
| ... | @@ -65,7 +65,7 @@ export const getLocalEnvironmentBootstrap = makeSyncIpcMethod({ | ... | @@ -65,7 +65,7 @@ export const getLocalEnvironmentBootstrap = makeSyncIpcMethod({ |
| 65 | }), | 65 | }), |
| 66 | }); | 66 | }); |
| 67 | 67 | ||
| 68 | export const getLocalEnvironmentBearerToken = makeIpcMethod({ | 68 | export const getLocalEnvironmentBearerToken = DesktopIpc.makeIpcMethod({ |
| 69 | channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BEARER_TOKEN_CHANNEL, | 69 | channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BEARER_TOKEN_CHANNEL, |
| 70 | payload: Schema.Void, | 70 | payload: Schema.Void, |
| 71 | result: Schema.String, | 71 | result: Schema.String, |
| ... | @@ -75,7 +75,7 @@ export const getLocalEnvironmentBearerToken = makeIpcMethod({ | ... | @@ -75,7 +75,7 @@ export const getLocalEnvironmentBearerToken = makeIpcMethod({ |
| 75 | }), | 75 | }), |
| 76 | }); | 76 | }); |
| 77 | 77 | ||
| 78 | export const pickFolder = makeIpcMethod({ | 78 | export const pickFolder = DesktopIpc.makeIpcMethod({ |
| 79 | channel: IpcChannels.PICK_FOLDER_CHANNEL, | 79 | channel: IpcChannels.PICK_FOLDER_CHANNEL, |
| 80 | payload: Schema.UndefinedOr(PickFolderOptionsSchema), | 80 | payload: Schema.UndefinedOr(PickFolderOptionsSchema), |
| 81 | result: Schema.NullOr(Schema.String), | 81 | result: Schema.NullOr(Schema.String), |
| ... | @@ -91,7 +91,7 @@ export const pickFolder = makeIpcMethod({ | ... | @@ -91,7 +91,7 @@ export const pickFolder = makeIpcMethod({ |
| 91 | }), | 91 | }), |
| 92 | }); | 92 | }); |
| 93 | 93 | ||
| 94 | export const confirm = makeIpcMethod({ | 94 | export const confirm = DesktopIpc.makeIpcMethod({ |
| 95 | channel: IpcChannels.CONFIRM_CHANNEL, | 95 | channel: IpcChannels.CONFIRM_CHANNEL, |
| 96 | payload: Schema.String, | 96 | payload: Schema.String, |
| 97 | result: Schema.Boolean, | 97 | result: Schema.Boolean, |
| ... | @@ -104,7 +104,7 @@ export const confirm = makeIpcMethod({ | ... | @@ -104,7 +104,7 @@ export const confirm = makeIpcMethod({ |
| 104 | }), | 104 | }), |
| 105 | }); | 105 | }); |
| 106 | 106 | ||
| 107 | export const setTheme = makeIpcMethod({ | 107 | export const setTheme = DesktopIpc.makeIpcMethod({ |
| 108 | channel: IpcChannels.SET_THEME_CHANNEL, | 108 | channel: IpcChannels.SET_THEME_CHANNEL, |
| 109 | payload: DesktopThemeSchema, | 109 | payload: DesktopThemeSchema, |
| 110 | result: Schema.Void, | 110 | result: Schema.Void, |
| ... | @@ -114,7 +114,7 @@ export const setTheme = makeIpcMethod({ | ... | @@ -114,7 +114,7 @@ export const setTheme = makeIpcMethod({ |
| 114 | }), | 114 | }), |
| 115 | }); | 115 | }); |
| 116 | 116 | ||
| 117 | export const showContextMenu = makeIpcMethod({ | 117 | export const showContextMenu = DesktopIpc.makeIpcMethod({ |
| 118 | channel: IpcChannels.CONTEXT_MENU_CHANNEL, | 118 | channel: IpcChannels.CONTEXT_MENU_CHANNEL, |
| 119 | payload: ContextMenuInput, | 119 | payload: ContextMenuInput, |
| 120 | result: Schema.NullOr(Schema.String), | 120 | result: Schema.NullOr(Schema.String), |
| ... | @@ -135,7 +135,7 @@ export const showContextMenu = makeIpcMethod({ | ... | @@ -135,7 +135,7 @@ export const showContextMenu = makeIpcMethod({ |
| 135 | }), | 135 | }), |
| 136 | }); | 136 | }); |
| 137 | 137 | ||
| 138 | export const openExternal = makeIpcMethod({ | 138 | export const openExternal = DesktopIpc.makeIpcMethod({ |
| 139 | channel: IpcChannels.OPEN_EXTERNAL_CHANNEL, | 139 | channel: IpcChannels.OPEN_EXTERNAL_CHANNEL, |
| 140 | payload: Schema.String, | 140 | payload: Schema.String, |
| 141 | result: Schema.Boolean, | 141 | result: Schema.Boolean, |
apps/desktop/src/main.ts+1-1| ... | @@ -109,7 +109,7 @@ const electronLayer = Layer.mergeAll( | ... | @@ -109,7 +109,7 @@ const electronLayer = Layer.mergeAll( |
| 109 | ElectronTheme.layer, | 109 | ElectronTheme.layer, |
| 110 | ElectronUpdater.layer, | 110 | ElectronUpdater.layer, |
| 111 | ElectronWindow.layer, | 111 | ElectronWindow.layer, |
| 112 | Layer.succeed(DesktopIpc.DesktopIpc, DesktopIpc.make(Electron.ipcMain)), | 112 | DesktopIpc.layer(Electron.ipcMain), |
| 113 | ); | 113 | ); |
| 114 | 114 | ||
| 115 | const desktopFoundationLayer = Layer.mergeAll( | 115 | const desktopFoundationLayer = Layer.mergeAll( |