The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as NodeServices from "@effect/platform-node/NodeServices"; |
| 2 | import { assert, it } from "@effect/vitest"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import * as FileSystem from "effect/FileSystem"; |
| 5 | import * as Path from "effect/Path"; |
| 6 | |
| 7 | import packageJson from "../../package.json" with { type: "json" }; |
| 8 | import { |
| 9 | makePersistedServerRuntimeState, |
| 10 | persistServerRuntimeState, |
| 11 | } from "../serverRuntimeState.ts"; |
| 12 | import { describeServerProcess } from "./triageSession.ts"; |
| 13 | |
| 14 | it.effect("reports the version the running server recorded, not the CLI's", () => |
| 15 | Effect.gen(function* () { |
| 16 | const fs = yield* FileSystem.FileSystem; |
| 17 | const path = yield* Path.Path; |
| 18 | const statePath = path.join( |
| 19 | yield* fs.makeTempDirectoryScoped({ prefix: "t3-triage-" }), |
| 20 | "server-runtime.json", |
| 21 | ); |
| 22 | const state = yield* makePersistedServerRuntimeState({ |
| 23 | config: { host: undefined, devUrl: undefined }, |
| 24 | port: 3773, |
| 25 | }); |
| 26 | yield* persistServerRuntimeState({ path: statePath, state }); |
| 27 | |
| 28 | assert.equal( |
| 29 | yield* describeServerProcess(statePath), |
| 30 | `running (pid ${String(process.pid)}, http://127.0.0.1:3773, version ${packageJson.version})`, |
| 31 | ); |
| 32 | }).pipe(Effect.provide(NodeServices.layer)), |
| 33 | ); |