返回 DeepSeek-Reasonix
env.ts
1 export interface RateLimiter {
2 limit(opts: { key: string }): Promise<{ success: boolean }>;
3 }
4
5 export interface Env {
6 DB: D1Database;
7 // Skill/MCP registry database — the folded registry API + moderation console
8 // read and write it; the crash tables stay in DB.
9 REGISTRY_DB: D1Database;
10 RATE_LIMITER: RateLimiter;
11 PING_LIMITER: RateLimiter;
12 METRICS_LIMITER: RateLimiter;
13 WRITE_LIMITER?: RateLimiter;
14 ADMIN_EMAILS?: string;
15 // Shared identity service (id.reasonix.io) and the site that hosts its login
16 // page (reasonix.io). Overridable for local dev.
17 ID_ORIGIN?: string;
18 APP_ORIGIN?: string;
19 // Browsers allowed to call the registry API with credentials (comma-separated).
20 ALLOWED_ORIGINS?: string;
21 // Optional incident webhook for the ingest sentinel, mirrored from the
22 // GitHub repo secret of the same name by deploy-crash-worker.yml. Feishu/
23 // Lark bot URLs get their native payload shape; any other receiver gets
24 // Slack-style {"text": ...}. Unset = log-only.
25 ALERT_WEBHOOK?: string;
26 // Crash sample storage rollout. `d1` is the fail-safe default; `dual`
27 // preserves D1 samples while mirroring Firebase; `firebase` keeps only the
28 // D1 query projection and the bounded retry outbox.
29 CRASH_STORAGE_MODE?: string;
30 FIREBASE_DATABASE_URL?: string;
31 FIREBASE_CLIENT_EMAIL?: string;
32 FIREBASE_PRIVATE_KEY?: string;
33 }
34
34 lines TYPESCRIPT