1// Relative import (not `@/` alias) so this file runs under both Bun and Node
2// without a paths-aware loader. This fixture is excluded from the test
3// project's typecheck (see tsconfig.test.json) because the relative path
4// crosses composite-project boundaries.
5import * as Context from "effect/Context";
6import * as Effect from "effect/Effect";
7import * as Layer from "effect/Layer";
8import { launch } from "../../../src/Local/RpcServer.ts";
9
10/**
11 * `RpcServer.launch` fixture that keeps printing on both stdio channels
12 * after boot, so tests can assert the spawner's log hub forwards sidecar
13 * output to `/logs` subscribers.
14 */
15export class TestNoise extends Context.Service<
16 TestNoise,
17 { echo: (msg: string) => Effect.Effect<string> }
18>()("Test.Noise") {}
19
20const TestNoiseLive = Layer.succeed(TestNoise, {
21 echo: (msg) => Effect.succeed(`echo:${msg}`),
22});
23
24launch(TestNoiseLive);
25
26setInterval(() => {
27 console.log("fixture-stdout-ping");
28 console.error("fixture-stderr-ping");
29}, 100);