Skip to content
93 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 foliosClient,
13 memoryReviewClient,
14 mirrorsClient,
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 workspaceAgentsClient,
29} from "@g1t/contracts";
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 CONTEXT = instrumented("context", env.CONTEXT);
49const SEARCH = instrumented("search", env.SEARCH);
50const PACKAGES = instrumented("packages", env.PACKAGES);
51const CHAT = instrumented("chat", env.CHAT);
52const AGENTS = instrumented("agents", env.AGENTS);
53const ARTIFACTS = instrumented("artifacts", env.ARTIFACTS);
54
55export const identity = identityClient(IDENTITY);
56/** A person's email addresses and account security: methods of identity. */
57export const accounts = accountsClient(IDENTITY);
58export const repos = reposClient(REPOS);
59export const work = workClient(WORK);
60export const billing = billingClient(BILLING);
61export const events = eventsClient(EVENTS);
62/** Each person's inbox, which the events service keeps. */
63export const inbox = inboxClient(EVENTS);
64export const integrations = integrationsClient(INTEGRATIONS);
65/** Mirroring: a repository's remotes, takeovers and hand-backs, kept by integrations. */
66export const mirrors = mirrorsClient(INTEGRATIONS);
67export const webhooks = webhooksClient(WEBHOOKS);
68export const actions = actionsClient(ACTIONS);
69export const deployments = deploymentsClient(DEPLOYMENTS);
70export const projects = projectsClient(PROJECTS);
71export const security = securityClient(SECURITY);
72/** The security suite: patterns, bypasses, code scanning, the dependency graph, settings. */
73export const securitySuite = securitySuiteClient(SECURITY);
74/** Agent runs, sessions and memory: methods of the work service. */
75export const agents = agentsClient(WORK);
76/** What agents may do in a sandbox: methods of the work service. */
77export const guardrails = guardrailsClient(WORK);
78/** The context hub: catalog, search and scorecards. */
79export const context = contextClient(CONTEXT);
80/** Search across all of g1t, and Explore. */
81export const search = searchClient(SEARCH);
82/** The workspace's registries: container images, and more to come. */
83export const packages = packagesClient(PACKAGES);
84/** Memory candidates and their review: methods of the work service. */
85export const memoryReview = memoryReviewClient(WORK);
86/** Channels, direct messages and threads, where people and agents talk. */
87export const chat = chatClient(CHAT);
88/** The workspace's own agents: who they are, their limits and their desks. */
89export const workspaceAgents = workspaceAgentsClient(AGENTS);
90/** The artifacts service's spaces (Artifacts' spaces) and projects' docs. Its old pages are no longer read. */
91export const docs = docsClient(ARTIFACTS);
92/** Artifacts (folios): docs, and later slides, designs and dashboards, kept by the artifacts service. */
93export const folios = foliosClient(ARTIFACTS);