import { z } from "zod"; // Top stories from Hacker News (always) plus any configured subreddits. // Both are keyless public JSON APIs. export const HackerNewsConfig = z.object({ limit: z.number().int().min(1).max(30).default(10), subreddits: z.array(z.string()).default([]), }); export type HackerNewsConfig = z.infer; export const FeedStory = z.object({ source: z.string(), // "HN" | "r/" title: z.string(), points: z.number().nullable(), comments: z.number().nullable(), url: z.string().nullable(), }); export const HackerNewsPayload = z.object({ stories: z.array(FeedStory).default([]), }); export type HackerNewsPayload = z.infer;