| 1 | import type { RateLimitBinding, RunnerApi, 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 | 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 | /** Artifacts (services/artifacts): RPC, each artifact's live socket, and files in them. */ |
| 31 | ARTIFACTS: ServiceBinding & { fetch(request: Request | string, init?: RequestInit): Promise<Response> }; |
| 32 | /** The workspace's own agents: definitions, templates and desks. */ |
| 33 | AGENTS: ServiceBinding; |
| 34 | /** |
| 35 | * Live notifications, counts and browser push (services/notify): RPC, |
| 36 | * and each tab's feed socket, forwarded as it is (routes/notify/live.ts). |
| 37 | * Absent where it is not deployed: pages work without it. |
| 38 | */ |
| 39 | NOTIFY?: ServiceBinding & { fetch(request: Request): Promise<Response> }; |
| 40 | /** Production screenshots, from the og service's `Screenshots` entrypoint. */ |
| 41 | SCREENSHOTS?: { |
| 42 | image(input: { host: string; commit: string; since?: string }): Promise<{ |
| 43 | body: ArrayBuffer; |
| 44 | contentType: string; |
| 45 | commit: string; |
| 46 | capturedAt: string; |
| 47 | } | null>; |
| 48 | }; |
| 49 | BLOBS: KVNamespace; |
| 50 | /** Uploaded avatars by SHA-256, with `{ contentType }`; written by identity. */ |
| 51 | AVATARS: KVNamespace; |
| 52 | /** The self-hosted runner's releases (scripts/runner-release.mjs). Absent when self-hosted. */ |
| 53 | DOWNLOADS?: R2Bucket; |
| 54 | /** The site's own origin. Unset on g1t.sh, which is https://g1t.sh (app/lib/addresses.server.ts). */ |
| 55 | SITE_URL?: string; |
| 56 | /** The REST API's origin, which is also the OAuth issuer. Unset on g1t.sh. */ |
| 57 | API_URL?: string; |
| 58 | /** The MCP server's URL, as agents are told to add it. Unset on g1t.sh. */ |
| 59 | MCP_URL?: string; |
| 60 | /** The social-card image service; an empty string for none. Unset on g1t.sh. */ |
| 61 | OG_URL?: string; |
| 62 | /** The front door's rate limits (app/lib/front-door-limits.ts). Absent when self-hosted. */ |
| 63 | WEB_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 64 | WEB_HEAVY_LIMIT?: RateLimitBinding; |
| 65 | WEB_SESSION_LIMIT?: RateLimitBinding; |
| 66 | WEB_ADDRESS_LIMIT?: RateLimitBinding; |
| 67 | WEB_TOKEN_LIMIT?: RateLimitBinding; |
| 68 | GIT_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 69 | GIT_SIGNED_LIMIT?: RateLimitBinding; |
| 70 | /** |
| 71 | * Where repository files and avatars are served (app/lib/usercontent.ts). |
| 72 | * Unset on g1t.sh, which is https://g1tusercontent.com; unset on another |
| 73 | * site, `<SITE_URL>/-/usercontent`. |
| 74 | */ |
| 75 | USERCONTENT_URL?: string; |
| 76 | /** Signs the short-lived addresses of private repositories' files. A secret. */ |
| 77 | USERCONTENT_KEY?: string; |
| 78 | } |
| 79 | } |
| 80 | interface Env extends Cloudflare.Env {} |
| 81 | } |