export interface PageInput { path: string; body: string; } export type Status = "pass" | "fail"; export interface ContentResult { status: Status; messages: string[]; } interface Rule { description: string; test: (body: string) => boolean; } const QUICKSTART_RULES: Rule[] = [ { description: "install step (bash/npm/uv install)", test: (b) => /install|npm i\b|uv add|npx /i.test(b), }, { description: "run agent step", test: (b) => /run.*(agent|server|dev)/i.test(b), }, { description: "wire CopilotKit provider", test: (b) => /CopilotKit\s*(?:Provider)?| /try it|chat|ask the agent|start chatting/i.test(b), }, ]; const FEATURE_RULES: Rule[] = [ { description: "what-is intro", test: (b) => /what is this|what is\b|introduction/i.test(b), }, { description: "at least one fenced code sample", test: (b) => /```[a-z]/i.test(b), }, { description: "next-steps or further-reading link", test: (b) => /next steps|what's next|further reading|see also/i.test(b) || /