cerebras_codermain.tsx1 match
6await createTables();
78export default async function cerebras_coder(req: Request): Promise<Response> {
9if (req.method === "POST") {
10let { prompt, currentCode, versionHistory, projectId } = await req.json();
cerebras_coderindex.ts7 matches
23);
2425function Hero({
26prompt,
27setPrompt,
4445<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46Turn your ideas into fully functional apps in{" "}
47<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48less than a second
115}
116117function App() {
118const previewRef = React.useRef<HTMLDivElement>(null);
119const [prompt, setPrompt] = useState("");
169});
170171function handleStarterPromptClick(promptItem: typeof prompts[number]) {
172setLoading(true);
173setTimeout(() => handleSubmit(promptItem.prompt), 0);
174}
175176async function handleSubmit(e: React.FormEvent | string) {
177if (typeof e !== "string") {
178e.preventDefault();
225}
226227function handleVersionChange(direction: "back" | "forward") {
228const { currentVersionIndex, versions } = versionHistory;
229if (direction === "back" && currentVersionIndex > 0) {
973);
974975function client() {
976const path = window.location.pathname;
977const root = createRoot(document.getElementById("root")!);
cerebras_coderindex.html1 match
19<meta property="og:site_name" content="Cerebras Coder">
20<meta property="og:url" content="https://cerebrascoder.com"/>
21<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second โ powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22<meta property="og:type" content="website">
23<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
cerebras_codergenerate-code.ts2 matches
2import STARTER_PROMPTS from "../public/starter-prompts.js";
34function extractCodeFromFence(text: string): string {
5const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
6return htmlMatch ? htmlMatch[1].trim() : text;
7}
89export async function generateCode(prompt: string, currentCode: string) {
10const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
11if (starterPrompt) {
getdependenciesmain.tsx2 matches
1async function getLibrariesIoDependents(packageName: string) {
2// Retrieve API key from environment variable
3const apiKey = Deno.env.get("LIBRARY_IO");
38}
3940export default async function server(request: Request): Promise<Response> {
41try {
42// Fetch dependents for react package
stevensDemoSETUP.md1 match
22To use all features, you'll need to set these environment variables:
23
24#### For LLM functionality:
25- `ANTHROPIC_API_KEY` - For AI responses and daily briefings
26
stevensDemocronDailyBrief.ts1 match
2import { sendDailyBriefing } from "./sendDailyBrief.ts";
34export async function cronDailyBrief() {
5try {
6console.log("Sending scheduled daily briefing...");
hello-worldindex.http.tsx1 match
1export default async function(req: Request): Promise<Response> {
2const test = await Deno.readTextFile("deno.json");
3return new Response("Hello world! -Wolf" + test);
promptEvolvermain.tsx12 matches
15const APP_VERSION = "7.2.1-pipeline-integrated"; // Updated version identifier
1617// โโโโโโโโ AI Prompt Engineering Functions (Verbatim from Pipeline Description) โโโโโโโโ //
1819// Prompt for Stage 2: Core Intent Identification
20function createIntentExtractionPrompt(text: string): string {
21return `Analyze the following text and provide ONLY a concise summary (1-2 sentences) capturing the core message, key claims, and overall purpose. Text: "${text}"`;
22}
2324// Prompt for Stages 3-6: Main Improvement (incorporates core intent)
25function createMainImprovementPrompt(originalText: string, coreIntentSummary: string): string {
26return `
27You are an expert editor assisting a user with ADHD, 2e, Aphantasia, and Anauralia.
341. **Structure:** Reorganize for logical flow. Group related ideas. Add minimal transitions ONLY where needed to bridge gaps. Evaluate tangents against the core intent; prune non-essential ones.
352. **Clarity/Conciseness:** Simplify complex sentences ONLY if nuance isn't lost (verify against core intent). Remove redundancy ONLY if it adds no value. Resolve ambiguities.
363. **Sensory Language:** Replace visual/auditory descriptions/metaphors with functional, logical, or factual equivalents.
374. **Grammar/Spelling:** Correct all standard English errors.
384950// โโโโโโโโ React App Component (Integrating Pipeline Logic Display) โโโโโโโโ //
51function App() {
52// State variables from original PRESERVED, plus new progress state
53const [inputText, setInputText] = useState("");
138// --- End Speech Recognition ---
139140// Manual Improvement Function - UPDATED for Pipeline & Progress Indicator
141const handleManualImprove = useCallback(async () => {
142const currentInput = inputText.trim();
213}, [inputText]); // Dependencies for useCallback
214215// Render functions (kept from original)
216const renderTextStats = () => { // Will likely not render as backend doesn't send stats
217if (!textStats || Object.keys(textStats).length === 0) return null;
434435// --- Client-side Bootstrapping (Kept from original) ---
436function client() {
437const rootElement = document.getElementById("root");
438if (rootElement) { createRoot(rootElement).render(<App />); }
441if (typeof document !== "undefined") { client(); }
442443// --- Helper Function for Server (Pipeline Logic) ---
444async function runImprovementPipeline(
445originalText: string,
446openai: OpenAI,
485}
486487// --- Val.town Server Function (Updated POST Handler) ---
488export default async function server(req: Request): Promise<Response> {
489const url = new URL(req.url);
490const apiKey = Deno.env.get("OPENAI_API_KEY");
reflectivePinkBeavermain.tsx3 matches
9}
1011function App() {
12const profileName = "Your Name";
13const profileBio = "Brief description about yourself";
81}
8283function client() {
84createRoot(document.getElementById("root")).render(<App />);
85}
86if (typeof document !== "undefined") { client(); }
8788export default async function server(request: Request): Promise<Response> {
89return new Response(
90`