2import { email } from "https://esm.town/v/std/email?v=13";
3
4export function usageAlert(handler: (req: Request) => Promise<Response>) {
5 const requestCounts: number[] = [];
6 const LIMIT = 1000;
9import { usageAlert } from "https://esm.town/v/stevekrouse/usageAlert"
10
11async function sampleHandler(req: Request): Promise<Response> {
12 return new Response("Hello, World!");
13}
84};
85
86export default async function(req: Request): Promise<Response> {
87 const url = new URL(req.url);
88 const pageKeys = (await blob.list()).filter(e => e.key.split("/")[0] === nameSpacePrefix).map(e => e.key);
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
21
22 useEffect(() => {
23 function handleKeyDown(e: KeyboardEvent) {
24 if (e.key === "ArrowLeft" && currentIndex > 0) {
25 setCurrentIndex(i => i - 1);
39 }, [currentIndex, history]);
40
41 async function handleSubmit(e: React.FormEvent) {
42 e.preventDefault();
43 setLoading(true);
131}
132
133function client() {
134 createRoot(document.getElementById("root")!).render(<App />);
135}
139}
140
141function extractCodeFromFence(text: string): string {
142 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
143 return htmlMatch ? htmlMatch[1].trim() : text;
144}
145
146export default async function server(req: Request): Promise<Response> {
147 if (req.method === "POST") {
148 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
123}
124
125function client() {
126 createRoot(document.getElementById("root")!).render(<App />);
127}
131}
132
133function extractCodeFromFence(text: string): string {
134 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
135 return htmlMatch ? htmlMatch[1].trim() : text;
136}
137
138export default async function server(req: Request): Promise<Response> {
139 if (req.method === "POST") {
140 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
18 >(null);
19
20 async function handleSubmit(e: React.FormEvent) {
21 e.preventDefault();
22 setLoading(true);
92}
93
94function client() {
95 createRoot(document.getElementById("root")!).render(<App />);
96}
100}
101
102function extractCodeFromFence(text: string): string {
103 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
104 return htmlMatch ? htmlMatch[1].trim() : text;
105}
106
107export default async function server(req: Request): Promise<Response> {
108 if (req.method === "POST") {
109 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
135}
136
137function client() {
138 createRoot(document.getElementById("root")!).render(<App />);
139}
143}
144
145function extractCodeFromFence(text: string): string {
146 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
147 return htmlMatch ? htmlMatch[1].trim() : text;
148}
149
150export default async function server(req: Request): Promise<Response> {
151 if (req.method === "POST") {
152 const client = new Cerebras();
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
45 }
46
47 function handleBack() {
48 if (currentIndex > 0) {
49 setCurrentIndex(currentIndex - 1);
52 }
53
54 function handleForward() {
55 if (currentIndex < history.length - 1) {
56 setCurrentIndex(currentIndex + 1);
132}
133
134function client() {
135 createRoot(document.getElementById("root")!).render(<App />);
136}
140}
141
142function extractCodeFromFence(text: string): string {
143 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
144 return htmlMatch ? htmlMatch[1].trim() : text;
145}
146
147export default async function server(req: Request): Promise<Response> {
148 if (req.method === "POST") {
149 const client = new Cerebras();
16];
17
18function App() {
19 const [personality1, setPersonality1] = useState("an emacs enthusiast");
20 const [personality2, setPersonality2] = useState("a vim enthusiast");
205}
206
207function client() {
208 createRoot(document.getElementById("root")).render(<App />);
209}
213}
214
215export default async function server(req: Request): Promise<Response> {
216 const url = new URL(req.url);
217
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
131}
132
133function client() {
134 createRoot(document.getElementById("root")!).render(<App />);
135}
139}
140
141function extractCodeFromFence(text: string): string {
142 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
143 return htmlMatch ? htmlMatch[1].trim() : text;
144}
145
146export default async function server(req: Request): Promise<Response> {
147 if (req.method === "POST") {
148 const client = new Cerebras();