Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

30 linesCodeBlameRaw
1/**
2 * /.well-known/g1t.json: where this g1t's parts are (packages/contracts
3 * src/discovery.ts). The phone app reads it when someone points it at their
4 * own g1t, so they type only the site's address. The same for everyone and
5 * public, so any origin may read it.
6 */
7import { env } from "cloudflare:workers";
8
9import type { G1tDiscovery } from "@g1t/contracts/discovery";
10
11import type { Route } from "./+types/well-known-g1t";
12import { HOSTED_ADDRESSES } from "../lib/addresses";
13import { addresses } from "../lib/addresses.server";
14
15export function loader(_: Route.LoaderArgs) {
16 const { site, api, mcp } = addresses();
17 const settings = env as { PHONE_PUSH?: string };
18 const body: G1tDiscovery = {
19 name: "g1t",
20 site,
21 api,
22 mcp,
23 hosted: site === HOSTED_ADDRESSES.site,
24 // Phone pushes go through Expo's push service unless this g1t turned them off (PHONE_PUSH=off).
25 phone: { chat: true, push: settings.PHONE_PUSH !== "off" },
26 };
27 return Response.json(body, {
28 headers: { "cache-control": "public, max-age=300", "access-control-allow-origin": "*" },
29 });
30}