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