Return Cursor ACP runtime with explicit scope

- Type the runtime effect with `Scope`
- Build the ACP session runtime without wrapping it in `Effect.scoped`
This commit is contained in:
Julius Marminge committed 2026-08-07 13:17:01 +02:00
1 parent b2155632ce
commit 4d6492e788
1 file changed
+3 -3
@@ -1,5 +1,5 @@
import { type CursorModelOptions, type CursorSettings } from "@t3tools/contracts";
import { Effect, Layer } from "effect";
import { Effect, Layer, Scope } from "effect";
import { ChildProcessSpawner } from "effect/unstable/process";
import type * as EffectAcpErrors from "effect-acp/errors";
@@ -45,7 +45,7 @@ export function buildCursorAcpSpawnInput(
export const makeCursorAcpRuntime = (
input: CursorAcpRuntimeInput,
): Effect.Effect<AcpSessionRuntimeShape, EffectAcpErrors.AcpError> =>
): Effect.Effect<AcpSessionRuntimeShape, EffectAcpErrors.AcpError, Scope.Scope> =>
Effect.gen(function* () {
const acpContext = yield* Layer.build(
AcpSessionRuntime.layer({
@@ -60,7 +60,7 @@ export const makeCursorAcpRuntime = (
),
);
return yield* Effect.service(AcpSessionRuntime).pipe(Effect.provide(acpContext));
}).pipe(Effect.scoped);
});
interface CursorAcpModelSelectionRuntime {
readonly getConfigOptions: AcpSessionRuntime.AcpSessionRuntime["Service"]["getConfigOptions"];