Skip to content
78 linesCodeBlameRaw
1import { env } from "cloudflare:workers";
2
3import {
4 accountsClient,
5 actionsClient,
6 agentsClient,
7 billingClient,
8 contextClient,
9 deploymentsClient,
10 memoryReviewClient,
11 mirrorsClient,
12 packagesClient,
13 projectsClient,
14 eventsClient,
15 guardrailsClient,
16 identityClient,
17 inboxClient,
18 integrationsClient,
19 reposClient,
20 searchClient,
21 securityClient,
22 securitySuiteClient,
23 webhooksClient,
24 workClient,
25} from "@g1t/contracts";
26
27import { instrumented } from "./perf.server";
28
29/**
30 * Each binding the clients use, timed for `Server-Timing` and, for the
31 * services that read D1 with sessions, told where to read (lib/perf.ts).
32 */
33const IDENTITY = instrumented("identity", env.IDENTITY);
34const REPOS = instrumented("repos", env.REPOS);
35const WORK = instrumented("work", env.WORK);
36const BILLING = instrumented("billing", env.BILLING);
37const EVENTS = instrumented("events", env.EVENTS);
38const INTEGRATIONS = instrumented("integrations", env.INTEGRATIONS);
39const WEBHOOKS = instrumented("webhooks", env.WEBHOOKS);
40const ACTIONS = instrumented("actions", env.ACTIONS);
41const DEPLOYMENTS = instrumented("deployments", env.DEPLOYMENTS);
42const PROJECTS = instrumented("projects", env.PROJECTS);
43const SECURITY = instrumented("security", env.SECURITY);
44const CONTEXT = instrumented("context", env.CONTEXT);
45const SEARCH = instrumented("search", env.SEARCH);
46const PACKAGES = instrumented("packages", env.PACKAGES);
47
48export const identity = identityClient(IDENTITY);
49/** A person's email addresses and account security: methods of identity. */
50export const accounts = accountsClient(IDENTITY);
51export const repos = reposClient(REPOS);
52export const work = workClient(WORK);
53export const billing = billingClient(BILLING);
54export const events = eventsClient(EVENTS);
55/** Each person's inbox, which the events service keeps. */
56export const inbox = inboxClient(EVENTS);
57export const integrations = integrationsClient(INTEGRATIONS);
58/** Mirroring: a repository's remotes, takeovers and hand-backs, kept by integrations. */
59export const mirrors = mirrorsClient(INTEGRATIONS);
60export const webhooks = webhooksClient(WEBHOOKS);
61export const actions = actionsClient(ACTIONS);
62export const deployments = deploymentsClient(DEPLOYMENTS);
63export const projects = projectsClient(PROJECTS);
64export const security = securityClient(SECURITY);
65/** The security suite: patterns, bypasses, code scanning, the dependency graph, settings. */
66export const securitySuite = securitySuiteClient(SECURITY);
67/** Agent runs, sessions and memory: methods of the work service. */
68export const agents = agentsClient(WORK);
69/** What agents may do in a sandbox: methods of the work service. */
70export const guardrails = guardrailsClient(WORK);
71/** The context hub: catalog, search and scorecards. */
72export const context = contextClient(CONTEXT);
73/** Search across all of g1t, and Explore. */
74export const search = searchClient(SEARCH);
75/** The workspace's registries: container images, and more to come. */
76export const packages = packagesClient(PACKAGES);
77/** Memory candidates and their review: methods of the work service. */
78export const memoryReview = memoryReviewClient(WORK);