A simple Bluesky bot to make sense of the noise, with responses powered by Gemini, similar to Grok.
1import { z } from "zod";
2
3const envSchema = z.object({
4 AUTHORIZED_USERS: z.preprocess(
5 (val) =>
6 (typeof val === "string" && val.trim() !== "") ? val.split(",") : null,
7 z.array(z.string()).nullable().default(null),
8 ),
9
10 SERVICE: z.string().default("https://bsky.social"),
11 DB_PATH: z.string().default("sqlite.db"),
12 GEMINI_MODEL: z.string().default("gemini-2.5-flash"),
13
14 ADMIN_DID: z.string().optional(),
15
16 DID: z.string(),
17 HANDLE: z.string(),
18 APP_PASSWORD: z.string(),
19
20 GEMINI_API_KEY: z.string(),
21 DAILY_QUERY_LIMIT: z.preprocess(
22 (val) =>
23 (typeof val === "string" && val.trim() !== "") ? Number(val) : undefined,
24 z.number().int().positive().default(15),
25 ),
26 USE_JETSTREAM: z.preprocess(
27 (val) => val === "true",
28 z.boolean().default(false),
29 ),
30});
31
32export type Env = z.infer<typeof envSchema>;
33export const env = envSchema.parse(Bun.env);