/** * Cloudflare Workers entrypoint. Identical proxy logic to the Node build, * just wired up through the Worker `fetch` export. * * Deploy: * npx wrangler deploy * * Dev: * npx wrangler dev * * Config lives in wrangler.toml. */ import type { ExecutionContext } from '@cloudflare/workers-types'; export interface Env { /** Optional single upstream base for every API family. Family-specific env vars override it. */ PXPIPE_UPSTREAM?: string; ANTHROPIC_UPSTREAM?: string; /** Optional override — if set, replaces whatever x-api-key the client sent. */ ANTHROPIC_API_KEY?: string; OPENAI_UPSTREAM?: string; /** Optional override — if set, replaces whatever Authorization the client sent. */ OPENAI_API_KEY?: string; OPENAI_MODELS?: string; CLOUDFLARE_MODELS?: string; CLOUDFLARE_ACCOUNT_ID?: string; CLOUDFLARE_API_TOKEN?: string; COMPRESS?: string; COMPRESS_TOOLS?: string; COMPRESS_TOOL_RESULTS?: string; MIN_COMPRESS_CHARS?: string; MIN_TOOL_RESULT_CHARS?: string; COLS?: string; /** Comma-separated model bases eligible for compression. */ PXPIPE_MODELS?: string; /** Ceiling on a buffered inbound request body, in bytes. A Worker is publicly * reachable by default, so this is the setting that keeps one caller from * choosing the isolate's memory ceiling. Unset uses the core 16 MiB default; * a non-numeric or non-positive value is ignored rather than obeyed. */ PXPIPE_MAX_REQUEST_BYTES?: string; /** When "0" / "false", disable per-request event JSON logs. Default-on. * Cloudflare ingests console.log as Workers Logs; pipe via Logpush to * R2/S3 for the same JSONL shape Node writes to disk. */ PXPIPE_TRACK?: string; /** Max bytes of rendered pages held in memory, or "0" to disable the cache. * Unset uses the core edge default (8 MiB), which is deliberately far below * the Node default: a Worker isolate has ~128 MiB for the request body, the * decoded atlases, the framebuffers and the compressor as well. Bindings are * not visible to core at module-init time, so this is applied per request via * `setRenderCacheMaxBytes`. A negative or non-numeric value is ignored rather * than obeyed; `0` is a real setting and must not be read as "unset". */ PXPIPE_RENDER_CACHE_BYTES?: string; /** Shared secret callers must present via the `x-pxpipe-secret` header * whenever an API-key override is configured. Without this gate a * discovered workers.dev URL is an open key-spender: the Worker would * attach your key to any stranger's request. Set with: * npx wrangler secret put PXPIPE_WORKER_SECRET */ PXPIPE_WORKER_SECRET?: string; } declare const _default: { fetch(req: Request, env: Env, _ctx: ExecutionContext): Promise; }; export default _default; //# sourceMappingURL=worker.d.ts.map