- Add external opener support alongside browser/editor launches - Remove the `open` dependency and cover platform behavior in tests
Showing the changes to apps/server/src/wsServer.ts (1 of 7 files). Show all
Unified · Split
| @@ -58,7 +58,7 @@ import { ProviderService } from "./provider/Services/ProviderService"; · 57 unmodified lines | ||
| 58 | 58 | import { ProviderRegistry } from "./provider/Services/ProviderRegistry"; |
| 59 | 59 | import { CheckpointDiffQuery } from "./checkpointing/Services/CheckpointDiffQuery"; |
| 60 | 60 | import { clamp } from "effect/Number"; |
| 61 | −import { Open, resolveAvailableEditors } from "./open"; | |
| 61 | +import { Open } from "./open"; | |
| 62 | 62 | import { ServerConfig } from "./config"; |
| 63 | 63 | import { GitCore } from "./git/Services/GitCore.ts"; |
| 64 | 64 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; |
| @@ -250,7 +250,10 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 185 unmodified lines | ||
| 250 | 250 | logWebSocketEvents, |
| 251 | 251 | autoBootstrapProjectFromCwd, |
| 252 | 252 | } = serverConfig; |
| 253 | − const availableEditors = resolveAvailableEditors(); | |
| 253 | + const open = yield* Open; | |
| 254 | + const availableEditors = yield* open.getAvailableEditors.pipe( | |
| 255 | + Effect.mapError((cause) => new ServerLifecycleError({ operation: "availableEditors", cause })), | |
| 256 | + ); | |
| 254 | 257 | |
| 255 | 258 | const runtimeServices = yield* Effect.services< |
| 256 | 259 | ServerRuntimeServices | ServerConfig | FileSystem.FileSystem | Path.Path |
| @@ -615,7 +618,7 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 358 unmodified lines | ||
| 615 | 618 | const projectionReadModelQuery = yield* ProjectionSnapshotQuery; |
| 616 | 619 | const checkpointDiffQuery = yield* CheckpointDiffQuery; |
| 617 | 620 | const orchestrationReactor = yield* OrchestrationReactor; |
| 618 | − const { openInEditor } = yield* Open; | |
| 621 | + const { openInEditor } = open; | |
| 619 | 622 | |
| 620 | 623 | const subscriptionsScope = yield* Scope.make("sequential"); |
| 621 | 624 | yield* Effect.addFinalizer(() => Scope.close(subscriptionsScope, Exit.void)); |