Unified · Split
| @@ -4,11 +4,11 @@ import { FileSystem, HttpApiBuilder, HttpServer } from "@effect/platform"; · 3 unmodified lines | |||
| 4 | import { NodeFileSystem, NodeHttpServer } from "@effect/platform-node"; | 4 | import { NodeFileSystem, NodeHttpServer } from "@effect/platform-node"; |
| 5 | import { describe, expect, it } from "@effect/vitest"; | 5 | import { describe, expect, it } from "@effect/vitest"; |
| 6 | import { | 6 | import { |
| 7 | createControlPlaneApiLayer, | 7 | createExecutorApiLayer, |
| 8 | } from "@executor/platform-api"; | 8 | } from "@executor/platform-api"; |
| 9 | import { createExecutorEffect } from "@executor/platform-sdk"; | 9 | import { createExecutorEffect } from "@executor/platform-sdk"; |
| 10 | import type { ControlPlaneRuntime } from "@executor/platform-sdk/runtime"; | 10 | import type { ExecutorRuntime } from "@executor/platform-sdk/runtime"; |
| 11 | import { createLocalControlPlaneRuntime as createControlPlaneRuntime } from "@executor/platform-sdk-file"; | 11 | import { createLocalExecutorRuntime as createExecutorRuntime } from "@executor/platform-sdk-file"; |
| 12 | import type { | 12 | import type { |
| 13 | LocalInstallation, | 13 | LocalInstallation, |
| 14 | Source, | 14 | Source, |
| @@ -70,7 +70,7 @@ type RunningServer = { · 55 unmodified lines | |||
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | type ApiServer = RunningServer & { | 72 | type ApiServer = RunningServer & { |
| 73 | runtime: ControlPlaneRuntime; | 73 | runtime: ExecutorRuntime; |
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | type HookHarness<T> = { | 76 | type HookHarness<T> = { |
| @@ -102,7 +102,7 @@ const startControlPlaneServer = async (): Promise<ApiServer> => { · 25 unmodified lines | |||
| 102 | ), | 102 | ), |
| 103 | ); | 103 | ); |
| 104 | const runtime = await Effect.runPromise( | 104 | const runtime = await Effect.runPromise( |
| 105 | createControlPlaneRuntime({ | 105 | createExecutorRuntime({ |
| 106 | workspaceRoot, | 106 | workspaceRoot, |
| 107 | }), | 107 | }), |
| 108 | ); | 108 | ); |
| @@ -117,7 +117,7 @@ const startControlPlaneServer = async (): Promise<ApiServer> => { · 8 unmodified lines | |||
| 117 | }), | 117 | }), |
| 118 | ); | 118 | ); |
| 119 | const serverLayer = HttpApiBuilder.serve().pipe( | 119 | const serverLayer = HttpApiBuilder.serve().pipe( |
| 120 | Layer.provide(createControlPlaneApiLayer(executor)), | 120 | Layer.provide(createExecutorApiLayer(executor)), |
| 121 | Layer.provideMerge(NodeHttpServer.layerTest), | 121 | Layer.provideMerge(NodeHttpServer.layerTest), |
| 122 | ); | 122 | ); |
| 123 | const context = await Effect.runPromise(Layer.buildWithScope(serverLayer, scope)); | 123 | const context = await Effect.runPromise(Layer.buildWithScope(serverLayer, scope)); |
| @@ -2,8 +2,8 @@ import { Atom, Result } from "@effect-atom/atom"; · 1 unmodified line | |||
| 2 | import type * as Registry from "@effect-atom/atom/Registry"; | 2 | import type * as Registry from "@effect-atom/atom/Registry"; |
| 3 | import { RegistryContext, RegistryProvider, useAtomValue } from "@effect-atom/atom-react"; | 3 | import { RegistryContext, RegistryProvider, useAtomValue } from "@effect-atom/atom-react"; |
| 4 | import { | 4 | import { |
| 5 | createControlPlaneClient, | 5 | createExecutorApiClient, |
| 6 | type ControlPlaneClient, | 6 | type ExecutorApiClient, |
| 7 | } from "@executor/platform-api/client"; | 7 | } from "@executor/platform-api/client"; |
| 8 | import { | 8 | import { |
| 9 | type CompleteSourceOAuthResult, | 9 | type CompleteSourceOAuthResult, |
| @@ -238,13 +238,13 @@ const logExecutorDevError = (label: string, details: Record<string, unknown>): v · 228 unmodified lines | |||
| 238 | const runControlPlane = async <A>(input: { | 238 | const runControlPlane = async <A>(input: { |
| 239 | baseUrl?: string; | 239 | baseUrl?: string; |
| 240 | accountId?: string; | 240 | accountId?: string; |
| 241 | execute: (client: ControlPlaneClient) => Effect.Effect<A, unknown, never>; | 241 | execute: (client: ExecutorApiClient) => Effect.Effect<A, unknown, never>; |
| 242 | }): Promise<A> => { | 242 | }): Promise<A> => { |
| 243 | const baseUrl = input.baseUrl ?? apiBaseUrl; | 243 | const baseUrl = input.baseUrl ?? apiBaseUrl; |
| 244 | const accountId = input.accountId; | 244 | const accountId = input.accountId; |
| 245 | 245 | ||
| 246 | const exit = await Effect.runPromiseExit( | 246 | const exit = await Effect.runPromiseExit( |
| 247 | createControlPlaneClient({ | 247 | createExecutorApiClient({ |
| 248 | baseUrl, | 248 | baseUrl, |
| 249 | ...(accountId !== undefined ? { accountId } : {}), | 249 | ...(accountId !== undefined ? { accountId } : {}), |
| 250 | }).pipe(Effect.flatMap(input.execute)), | 250 | }).pipe(Effect.flatMap(input.execute)), |
| @@ -267,7 +267,7 @@ const runControlPlane = async <A>(input: { · 16 unmodified lines | |||
| 267 | const controlPlaneRequest = <A>(input: { | 267 | const controlPlaneRequest = <A>(input: { |
| 268 | baseUrl?: string; | 268 | baseUrl?: string; |
| 269 | accountId?: string; | 269 | accountId?: string; |
| 270 | execute: (client: ControlPlaneClient) => Effect.Effect<A, unknown, never>; | 270 | execute: (client: ExecutorApiClient) => Effect.Effect<A, unknown, never>; |
| 271 | }): Effect.Effect<A, Error> => | 271 | }): Effect.Effect<A, Error> => |
| 272 | Effect.tryPromise({ | 272 | Effect.tryPromise({ |
| 273 | try: () => runControlPlane(input), | 273 | try: () => runControlPlane(input), |