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