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