Skip to content
90 linesCodeBlameRaw
1import { env } from "cloudflare:workers";
2
3import {
4 accountsClient,
5 actionsClient,
6 agentsClient,
7 billingClient,
8 chatClient,
9 contextClient,
10 deploymentsClient,
11 docsClient,
12 memoryReviewClient,
13 mirrorsClient,
14 packagesClient,
15 projectsClient,
16 eventsClient,
17 guardrailsClient,
18 identityClient,
19 inboxClient,
20 integrationsClient,
21 reposClient,
22 searchClient,
23 securityClient,
24 securitySuiteClient,
25 webhooksClient,
26 workClient,
27 workspaceAgentsClient,
28} from "@g1t/contracts";
29
30import { instrumented } from "./perf.server";
31
32/**
33 * Each binding the clients use, timed for `Server-Timing` and, for the
34 * services that read D1 with sessions, told where to read (lib/perf.ts).
35 */
36const IDENTITY = instrumented("identity", env.IDENTITY);
37const REPOS = instrumented("repos", env.REPOS);
38const WORK = instrumented("work", env.WORK);
39const BILLING = instrumented("billing", env.BILLING);
40const EVENTS = instrumented("events", env.EVENTS);
41const INTEGRATIONS = instrumented("integrations", env.INTEGRATIONS);
42const WEBHOOKS = instrumented("webhooks", env.WEBHOOKS);
43const ACTIONS = instrumented("actions", env.ACTIONS);
44const DEPLOYMENTS = instrumented("deployments", env.DEPLOYMENTS);
45const PROJECTS = instrumented("projects", env.PROJECTS);
46const SECURITY = instrumented("security", env.SECURITY);
47const CONTEXT = instrumented("context", env.CONTEXT);
48const SEARCH = instrumented("search", env.SEARCH);
49const PACKAGES = instrumented("packages", env.PACKAGES);
50const CHAT = instrumented("chat", env.CHAT);
51const AGENTS = instrumented("agents", env.AGENTS);
52const DOCS = instrumented("docs", env.DOCS);
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/** Mirroring: a repository's remotes, takeovers and hand-backs, kept by integrations. */
65export const mirrors = mirrorsClient(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/** Agent runs, sessions and memory: methods of the work service. */
74export const agents = agentsClient(WORK);
75/** What agents may do in a sandbox: methods of the work service. */
76export const guardrails = guardrailsClient(WORK);
77/** The context hub: catalog, search and scorecards. */
78export const context = contextClient(CONTEXT);
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/** Memory candidates and their review: methods of the work service. */
84export const memoryReview = memoryReviewClient(WORK);
85/** Channels, direct messages and threads, where people and agents talk. */
86export const chat = chatClient(CHAT);
87/** The workspace's own agents: who they are, their limits and their desks. */
88export const workspaceAgents = workspaceAgentsClient(AGENTS);
89/** Docs: spaces, pages, history, suggestions and comments. */
90export const docs = docsClient(DOCS);