@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 17 lines 764 Bytes
Raw
1 import * as Effect from "effect/Effect";
2
3 import { environmentEndpointUrl } from "./endpoint.ts";
4 import { executeEnvironmentHttpRequest, makeEnvironmentHttpApiGroupClient } from "../rpc/http.ts";
5
6 const DEFAULT_REMOTE_REQUEST_TIMEOUT_MS = 10_000;
7
8 export const fetchRemoteEnvironmentDescriptor = Effect.fn(
9 "clientRuntime.environment.fetchRemoteEnvironmentDescriptor",
10 )(function* (input: { readonly httpBaseUrl: string; readonly timeoutMs?: number }) {
11 const client = yield* makeEnvironmentHttpApiGroupClient(input.httpBaseUrl, "metadata");
12 return yield* executeEnvironmentHttpRequest(
13 environmentEndpointUrl(input.httpBaseUrl, "/.well-known/t3/environment"),
14 input.timeoutMs ?? DEFAULT_REMOTE_REQUEST_TIMEOUT_MS,
15 client.descriptor(),
16 );
17 });