Skip to content
78 linesCodeBlameRaw
1import type { RateLimitBinding, RunnerApi, ServiceBinding } from "@g1t/contracts";
2
3declare global {
4 namespace Cloudflare {
5 interface Env {
6 IDENTITY: ServiceBinding;
7 /** Also serves git over HTTPS through `fetch`. */
8 REPOS: ServiceBinding & { fetch(request: Request): Promise<Response> };
9 /** Also serves the container registry (`/v2/`) through `fetch`. */
10 PACKAGES: ServiceBinding & { fetch(request: Request): Promise<Response> };
11 WORK: ServiceBinding;
12 RUNNER: RunnerApi;
13 BILLING: ServiceBinding;
14 EVENTS: ServiceBinding;
15 INTEGRATIONS: ServiceBinding;
16 WEBHOOKS: ServiceBinding;
17 ACTIONS: ServiceBinding;
18 DEPLOYMENTS: ServiceBinding;
19 PROJECTS: ServiceBinding;
20 SECURITY: ServiceBinding;
21 /** The context hub: catalog, search and scorecards. */
22 CONTEXT: ServiceBinding;
23 /** Search across all of g1t, and Explore. */
24 SEARCH: ServiceBinding;
25 /**
26 * Chat: channels, messages and read state over RPC, and the live
27 * socket, forwarded as it is (app/lib/chat-live.server.ts).
28 */
29 CHAT: ServiceBinding & { fetch(request: Request): Promise<Response> };
30 /** The workspace's own agents: definitions, templates and desks. */
31 AGENTS: ServiceBinding;
32 /**
33 * Live notifications, counts and browser push (services/notify): RPC,
34 * and each tab's feed socket, forwarded as it is (routes/notify/live.ts).
35 * Absent where it is not deployed: pages work without it.
36 */
37 NOTIFY?: ServiceBinding & { fetch(request: Request): Promise<Response> };
38 /** Production screenshots, from the og service's `Screenshots` entrypoint. */
39 SCREENSHOTS?: {
40 image(input: { host: string; commit: string; since?: string }): Promise<{
41 body: ArrayBuffer;
42 contentType: string;
43 commit: string;
44 capturedAt: string;
45 } | null>;
46 };
47 BLOBS: KVNamespace;
48 /** Uploaded avatars by SHA-256, with `{ contentType }`; written by identity. */
49 AVATARS: KVNamespace;
50 /** The self-hosted runner's releases (scripts/runner-release.mjs). Absent when self-hosted. */
51 DOWNLOADS?: R2Bucket;
52 /** The site's own origin. Unset on g1t.sh, which is https://g1t.sh (app/lib/addresses.server.ts). */
53 SITE_URL?: string;
54 /** The REST API's origin, which is also the OAuth issuer. Unset on g1t.sh. */
55 API_URL?: string;
56 /** The MCP server's URL, as agents are told to add it. Unset on g1t.sh. */
57 MCP_URL?: string;
58 /** The social-card image service; an empty string for none. Unset on g1t.sh. */
59 OG_URL?: string;
60 /** The front door's rate limits (app/lib/front-door-limits.ts). Absent when self-hosted. */
61 WEB_ANONYMOUS_LIMIT?: RateLimitBinding;
62 WEB_HEAVY_LIMIT?: RateLimitBinding;
63 WEB_SESSION_LIMIT?: RateLimitBinding;
64 WEB_ADDRESS_LIMIT?: RateLimitBinding;
65 GIT_ANONYMOUS_LIMIT?: RateLimitBinding;
66 GIT_SIGNED_LIMIT?: RateLimitBinding;
67 /**
68 * Where repository files and avatars are served (app/lib/usercontent.ts).
69 * Unset on g1t.sh, which is https://g1tusercontent.com; unset on another
70 * site, `<SITE_URL>/-/usercontent`.
71 */
72 USERCONTENT_URL?: string;
73 /** Signs the short-lived addresses of private repositories' files. A secret. */
74 USERCONTENT_KEY?: string;
75 }
76 }
77 interface Env extends Cloudflare.Env {}
78}