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