| 1 | import type { RateLimitBinding, ServiceBinding } from "@g1t/contracts"; |
| 2 | |
| 3 | declare 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 | BILLING: ServiceBinding; |
| 13 | EVENTS: ServiceBinding; |
| 14 | INTEGRATIONS: ServiceBinding; |
| 15 | WEBHOOKS: ServiceBinding; |
| 16 | ACTIONS: ServiceBinding; |
| 17 | DEPLOYMENTS: ServiceBinding; |
| 18 | PROJECTS: ServiceBinding; |
| 19 | SECURITY: ServiceBinding; |
| 20 | /** Search across all of g1t, and Explore. */ |
| 21 | SEARCH: ServiceBinding; |
| 22 | /** |
| 23 | * Chat: channels, messages and read state over RPC, and the live |
| 24 | * socket, forwarded as it is (app/lib/chat-live.server.ts). |
| 25 | */ |
| 26 | CHAT: ServiceBinding & { fetch(request: Request): Promise<Response> }; |
| 27 | /** Artifacts (services/artifacts): RPC, each artifact's live socket, and files in them. */ |
| 28 | ARTIFACTS: ServiceBinding & { fetch(request: Request | string, init?: RequestInit): Promise<Response> }; |
| 29 | /** |
| 30 | * Live notifications, counts and browser push (services/notify): RPC, |
| 31 | * and each tab's feed socket, forwarded as it is (routes/notify/live.ts). |
| 32 | * Absent where it is not deployed: pages work without it. |
| 33 | */ |
| 34 | NOTIFY?: ServiceBinding & { fetch(request: Request): Promise<Response> }; |
| 35 | /** |
| 36 | * Observability (services/telemetry): RPC, and a project's live tail, |
| 37 | * forwarded as it is (routes/repo/observability/live.ts). Absent where |
| 38 | * it is not deployed: the pages say so. |
| 39 | */ |
| 40 | TELEMETRY?: ServiceBinding & { fetch(request: Request): Promise<Response> }; |
| 41 | /** Production screenshots, from the og service's `Screenshots` entrypoint. */ |
| 42 | SCREENSHOTS?: { |
| 43 | image(input: { host: string; commit: string; since?: string }): Promise<{ |
| 44 | body: ArrayBuffer; |
| 45 | contentType: string; |
| 46 | commit: string; |
| 47 | capturedAt: string; |
| 48 | } | null>; |
| 49 | /** A production deployed elsewhere, at its address; `commit` is a deploy's commit or a UTC day. */ |
| 50 | externalImage(input: { url: string; commit: string; since?: string }): Promise<{ |
| 51 | body: ArrayBuffer; |
| 52 | contentType: string; |
| 53 | commit: string; |
| 54 | capturedAt: string; |
| 55 | } | null>; |
| 56 | }; |
| 57 | BLOBS: KVNamespace; |
| 58 | /** Uploaded avatars by SHA-256, with `{ contentType }`; written by identity. */ |
| 59 | AVATARS: KVNamespace; |
| 60 | /** The self-hosted runner's releases (scripts/runner-release.mjs). Absent when self-hosted. */ |
| 61 | DOWNLOADS?: R2Bucket; |
| 62 | /** The site's own origin. Unset on g1t.sh, which is https://g1t.sh (app/lib/addresses.server.ts). */ |
| 63 | SITE_URL?: string; |
| 64 | /** The REST API's origin, which is also the OAuth issuer. Unset on g1t.sh. */ |
| 65 | API_URL?: string; |
| 66 | /** The MCP server's URL, as agents are told to add it. Unset on g1t.sh. */ |
| 67 | MCP_URL?: string; |
| 68 | /** The social-card image service; an empty string for none. Unset on g1t.sh. */ |
| 69 | OG_URL?: string; |
| 70 | /** The front door's rate limits (app/lib/front-door-limits.ts). Absent when self-hosted. */ |
| 71 | WEB_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 72 | WEB_HEAVY_LIMIT?: RateLimitBinding; |
| 73 | WEB_SESSION_LIMIT?: RateLimitBinding; |
| 74 | WEB_ADDRESS_LIMIT?: RateLimitBinding; |
| 75 | WEB_TOKEN_LIMIT?: RateLimitBinding; |
| 76 | /** Ask g1t's questions, per person (app/routes/workspace/ask.ts). */ |
| 77 | WEB_ASK_LIMIT?: RateLimitBinding; |
| 78 | GIT_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 79 | GIT_SIGNED_LIMIT?: RateLimitBinding; |
| 80 | /** |
| 81 | * Where repository files and avatars are served (app/lib/usercontent.ts). |
| 82 | * Unset on g1t.sh, which is https://g1tusercontent.com; unset on another |
| 83 | * site, `<SITE_URL>/-/usercontent`. |
| 84 | */ |
| 85 | USERCONTENT_URL?: string; |
| 86 | /** Signs the short-lived addresses of private repositories' files. A secret. */ |
| 87 | USERCONTENT_KEY?: string; |
| 88 | } |
| 89 | } |
| 90 | interface Env extends Cloudflare.Env {} |
| 91 | } |