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.

g1t.sh
99 linesCodeBlameRaw
1import { env } from "cloudflare:workers";
2
3import {
4 privacyClient,
5 accountsClient,
6 actionsClient,
7 advisoriesClient,
8 agentSessionsClient,
9 agentsClient,
10 aiClient,
11 billingClient,
12 chatClient,
13 deploymentsClient,
14 docsClient,
15 foliosClient,
16 packagesClient,
17 projectsClient,
18 eventsClient,
19 guardrailsClient,
20 identityClient,
21 inboxClient,
22 integrationsClient,
23 reposClient,
24 searchClient,
25 securityClient,
26 securitySuiteClient,
27 webhooksClient,
28 workClient,
29} from "@g1t/contracts";
30import { telemetryClient } from "@g1t/contracts/telemetry";
31
32import { instrumented } from "./perf.server";
33
34/**
35 * Each binding the clients use, timed for `Server-Timing` and, for the
36 * services that read D1 with sessions, told where to read (lib/perf.ts).
37 */
38const IDENTITY = instrumented("identity", env.IDENTITY);
39const REPOS = instrumented("repos", env.REPOS);
40const WORK = instrumented("work", env.WORK);
41const BILLING = instrumented("billing", env.BILLING);
42const EVENTS = instrumented("events", env.EVENTS);
43const INTEGRATIONS = instrumented("integrations", env.INTEGRATIONS);
44const WEBHOOKS = instrumented("webhooks", env.WEBHOOKS);
45const ACTIONS = instrumented("actions", env.ACTIONS);
46const DEPLOYMENTS = instrumented("deployments", env.DEPLOYMENTS);
47const PROJECTS = instrumented("projects", env.PROJECTS);
48const SECURITY = instrumented("security", env.SECURITY);
49const SEARCH = instrumented("search", env.SEARCH);
50const PACKAGES = instrumented("packages", env.PACKAGES);
51const CHAT = instrumented("chat", env.CHAT);
52const ARTIFACTS = instrumented("artifacts", env.ARTIFACTS);
53const TELEMETRY = env.TELEMETRY ? instrumented("telemetry", env.TELEMETRY) : null;
54
55export const identity = identityClient(IDENTITY);
56/** A person's email addresses and account security: methods of identity. */
57export const accounts = accountsClient(IDENTITY);
58export const repos = reposClient(REPOS);
59export const work = workClient(WORK);
60export const billing = billingClient(BILLING);
61export const events = eventsClient(EVENTS);
62/** Each person's inbox, which the events service keeps. */
63export const inbox = inboxClient(EVENTS);
64export const integrations = integrationsClient(INTEGRATIONS);
65/** A workspace's AI providers and Ask g1t, which the integrations service keeps beside its integrations. */
66export const ai = aiClient(INTEGRATIONS);
67/** Sessions on a workspace's own Anthropic account: the integrations service's agent_sessions.rs. */
68export const agentSessions = agentSessionsClient(INTEGRATIONS);
69export const webhooks = webhooksClient(WEBHOOKS);
70export const actions = actionsClient(ACTIONS);
71export const deployments = deploymentsClient(DEPLOYMENTS);
72export const projects = projectsClient(PROJECTS);
73export const security = securityClient(SECURITY);
74/** The security suite: patterns, bypasses, code scanning, the dependency graph, settings. */
75export const securitySuite = securitySuiteClient(SECURITY);
76/** Security advisories and private vulnerability reports: methods of the security service. */
77export const advisories = advisoriesClient(SECURITY);
78/** Runs and pull request sessions: methods of the work service. */
79export const agents = agentsClient(WORK);
80/** The network a sandbox may reach: methods of the work service. */
81export const guardrails = guardrailsClient(WORK);
82/** Search across all of g1t, and Explore. */
83export const search = searchClient(SEARCH);
84/** The workspace's registries: container images, and more to come. */
85export const packages = packagesClient(PACKAGES);
86/** Channels, direct messages and threads, where people talk. */
87export const chat = chatClient(CHAT);
88/** The artifacts service's spaces (Artifacts' spaces) and projects' docs. Its old pages are no longer read. */
89export const docs = docsClient(ARTIFACTS);
90/** Artifacts (folios): docs, and later slides, designs and dashboards, kept by the artifacts service. */
91export const folios = foliosClient(ARTIFACTS);
92
93/**
94 * Observability (services/telemetry): a project's requests, logs, traces,
95 * metrics and errors. Null where it is not deployed; the pages say so.
96 */
97export const telemetry = TELEMETRY ? telemetryClient(TELEMETRY) : null;
98
99export const privacy = privacyClient(env.IDENTITY);