| 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 | /** The workspace's own agents: definitions, templates and desks. */ |
| 31 | AGENTS: ServiceBinding; |
| 32 | /** Production screenshots, from the og service's `Screenshots` entrypoint. */ |
| 33 | SCREENSHOTS?: { |
| 34 | image(input: { host: string; commit: string; since?: string }): Promise<{ |
| 35 | body: ArrayBuffer; |
| 36 | contentType: string; |
| 37 | commit: string; |
| 38 | capturedAt: string; |
| 39 | } | null>; |
| 40 | }; |
| 41 | BLOBS: KVNamespace; |
| 42 | /** Uploaded avatars by SHA-256, with `{ contentType }`; written by identity. */ |
| 43 | AVATARS: KVNamespace; |
| 44 | /** The self-hosted runner's releases (scripts/runner-release.mjs). Absent when self-hosted. */ |
| 45 | DOWNLOADS?: R2Bucket; |
| 46 | /** The site's own origin. Unset on g1t.sh, which is https://g1t.sh (app/lib/addresses.server.ts). */ |
| 47 | SITE_URL?: string; |
| 48 | /** The REST API's origin, which is also the OAuth issuer. Unset on g1t.sh. */ |
| 49 | API_URL?: string; |
| 50 | /** The MCP server's URL, as agents are told to add it. Unset on g1t.sh. */ |
| 51 | MCP_URL?: string; |
| 52 | /** The social-card image service; an empty string for none. Unset on g1t.sh. */ |
| 53 | OG_URL?: string; |
| 54 | /** The front door's rate limits (app/lib/front-door-limits.ts). Absent when self-hosted. */ |
| 55 | WEB_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 56 | WEB_HEAVY_LIMIT?: RateLimitBinding; |
| 57 | WEB_SESSION_LIMIT?: RateLimitBinding; |
| 58 | WEB_ADDRESS_LIMIT?: RateLimitBinding; |
| 59 | GIT_ANONYMOUS_LIMIT?: RateLimitBinding; |
| 60 | GIT_SIGNED_LIMIT?: RateLimitBinding; |
| 61 | /** |
| 62 | * Where repository files and avatars are served (app/lib/usercontent.ts). |
| 63 | * Unset on g1t.sh, which is https://g1tusercontent.com; unset on another |
| 64 | * site, `<SITE_URL>/-/usercontent`. |
| 65 | */ |
| 66 | USERCONTENT_URL?: string; |
| 67 | /** Signs the short-lived addresses of private repositories' files. A secret. */ |
| 68 | USERCONTENT_KEY?: string; |
| 69 | } |
| 70 | } |
| 71 | interface Env extends Cloudflare.Env {} |
| 72 | } |