x402-pkgguard / tree / wrangler.toml ยท raw (this view has old GitHub links rewritten for the mirror; raw is byte-exact)
name = "pkgguard"
main = "src/worker.js"
compatibility_date = "2026-05-01"
compatibility_flags = ["nodejs_compat"]

[vars]
X402_NETWORK = "eip155:8453"
X402_PRICE_SCAN = "$0.003"
X402_PRICE_PACKAGE = "$0.001"
PAY_TO = "0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6F"
FACILITATOR_URL = "https://facilitator.payai.network"
# x402 v2 facilitator: "payai" (FACILITATOR_URL above) or "cdp" (Coinbase CDP; needs the CDP_API_KEY_ID and
# CDP_API_KEY_SECRET secrets, falls back to PayAI with a warning if either is missing). Runbook: /workspace/crypto/distribution/cdp-switch.md
FACILITATOR = "cdp"
PUBLIC_URL = "https://pkgguard.agentgate.workers.dev"
# Reverse proxy (youraitools-api Pages project): public URLs become https://<PROXY_HOSTS><PROXY_PREFIX> only for these hosts
PROXY_HOSTS = "api.youraitools.co"
PROXY_PREFIX = "/pkgguard"
# x402-trust.com provider verification (public key line; private key in the vault, x402-trust-key.pem)
X402_TRUST_TXT = "x402-trust-verification=v1:MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEE3BRokZRE_5VQY8-uCv5Cc6P-FFPNo8kBOO0nSCcw0OL84uR2LpQRaY_3bp2GVU8ph_8cLr9on8kMbbBUyivsA"

# Legacy usage counters: READ-ONLY since 2026-10-22 (history up to that UTC day). No KV writes any more..
[[kv_namespaces]]
binding = "STATS"
id = "8ba00b55f8d44774bf9df6e1c913d6d8"

# Free tier: 10 previews / MCP calls per IP per minute
# Usage counters (batched, flushed <= once/min/isolate) in a SQLite Durable Object (free plan, no KV quota)
[[durable_objects.bindings]]
name = "COUNTER"
class_name = "StatsCounter"

[[migrations]]
tag = "v1-stats-counter"
new_sqlite_classes = ["StatsCounter"]

[[ratelimits]]
name = "FREE_LIMITER"
namespace_id = "1006"
simple = { limit = 10, period = 60 }

agentgate-source: code mirror on Cloudflare Pages. All repos