{ // chat_sessions namespace created via `npx wrangler kv namespace create chat_sessions` — the id below is live. "name": "araharah-bot", "main": "src/webhook.ts", "compatibility_date": "2026-10-22", // workers_dev: serve on the ..workers.dev URL — the WEBHOOK_URL // target for this phase (Phase 3's custom route/domain may supersede) "workers_dev": true, // Workers static assets binding (D-13, D-14): serves ../web/dist. The // Worker fetch still owns /api/* and /telegram/* first via // run_worker_first (a GLOB ARRAY, not a boolean). "assets": { "directory": "../web/dist", "binding": "ASSETS", "not_found_handling": "none" }, "run_worker_first": ["/api/*", "/telegram/*"], // Public vars (NOT secrets): the deployed Mini App ORIGIN used to build // the /cari venue card's OPEN deep link (/?dest=). // It must equal the Mini App URL registered in @BotFather (Bot API 10.2 // enforces the origin). Never derived from user input. "vars": { "MINI_APP_URL": "https://araharah-bot.araharah-bot.workers.dev" }, // R2 binding (D-01, the repo's FIRST r2_buckets entry): hosts the road-graph // binary /api/route loads (worker-router.ts memoizes ONE GET per cold // isolate). A bucket is NOT a KV namespace — GE5 (exactly ONE // kv_namespaces) still holds. Forks create + upload their OWN bucket: // `npx wrangler r2 bucket create ` + routing/scripts/upload-road-graph.mjs // (docs/ROAD-GRAPH.md is the fork contract). The bucket name is public // configuration, never a secret. "r2_buckets": [{ "binding": "ROAD_GRAPH", "bucket_name": "araharah-graphs" }], // The repo's FIRST Cron Trigger (06-07, D-11): */2 scan (LAUNCH-GATE decision // 2025-10-25 — the $0 law holds: 2-min ticks × 1 list-op = 720/day, inside the // free plan's 1,000/day KV-list ceiling; card cadence is 240 s in code // (CARD_CADENCE_S). The tick is STATELESS (zero KV writes — the budget law). // Local test: curl "http://localhost:8787/cdn-cgi/local/scheduled" under // `wrangler dev`. 90 s granularity is NOT cron-expressible — */2 is the // coarsest cadence that stays under the ceiling while honoring D-11's spirit. "triggers": { "crons": ["*/2 * * * *"] }, "kv_namespaces": [{ "binding": "chat_sessions", "id": "59f58a54bc44483e89872b20a005a5eb" }] }