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

main
ts 27 lines 1.06 KB
Raw
1 import * as HttpApi from "effect/http-api/HttpApi";
2 /**
3 * The engine's internal API: routes the engine calls on itself, never a
4 * user. Register `Git.InternalApiLive` beside public routes, outside user middleware.
5 */
6 import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
7 import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
8 import { HASH_ROUTE } from "../Hasher/Protocol.ts";
9
10 /**
11 * The push pipeline's hashing endpoint (DESIGN §22.7), reached through the
12 * Worker's self service binding by the fan-out {@link Hasher} and
13 * authenticated with the deploy-time internal secret, never a user
14 * credential.
15 */
16 export const HashPart = HttpApiEndpoint.post("hashPart", HASH_ROUTE);
17
18 /** The internal group, mounted at the root. */
19 export class Internal extends HttpApiGroup.make("internal", {
20 topLevel: true,
21 }).add(HashPart) {}
22
23 /**
24 * The internal API schema. `Git.InternalApiLive` registers its routes using
25 * `HttpApiBuilder.layer(Git.InternalApi)` with `Git.InternalLive`.
26 */
27 export class InternalApi extends HttpApi.make("git-internal").add(Internal) {}