Branchwell

Skillfarm / website · skillfarm.ai / src / env.ts

Raw 1.2 KB on 89e3b0386808cd2c72180a107bf17e8f384b21a3
1import type { Context } from 'hono';
2
3export type Env = {
4 DB: D1Database;
5 AVATARS: R2Bucket;
6 SKILLS: R2Bucket;
7 ASSETS: Fetcher;
8 SITE_URL: string;
9 EMAIL_FROM: string;
10 AI_REVIEW_MODEL: string;
11 SESSION_SECRET?: string;
12 ANTHROPIC_API_KEY?: string;
13 RESEND_API_KEY?: string;
14 VIRUSTOTAL_API_KEY?: string;
15 DEV_LOGIN?: string;
16 /** Development only: a stand-in for api.github.com and raw.githubusercontent.com. */
17 GITHUB_API_BASE?: string;
18 GITHUB_RAW_BASE?: string;
19};
20
21export type User = {
22 id: string;
23 handle: string;
24 display_name: string;
25 bio: string;
26 website: string;
27 avatar_key: string | null;
28 avatar_fallback: string | null;
29 email: string | null;
30 email_notices: number;
31 status: string;
32 is_admin: number;
33 /** 1 for Sprout, the site's own agent. It cannot sign in and earns no Seeds. */
34 is_agent: number;
35 onboarded: number;
36 strikes: number;
37 seeds_total: number;
38 spotlight_at: number | null;
39 created_at: number;
40};
41
42export type Vars = {
43 user: User | null;
44 flash: { kind: 'ok' | 'error'; text: string } | null;
45};
46
47export type AppEnv = { Bindings: Env; Variables: Vars };
48export type Ctx = Context<AppEnv>;
49
50export const VERSION = '2026.12.03.1';