tinycanvasmain.ts2 matches
1314*/
15const handler = async function(req) {
16const req_url = new URL(req.url);
17if (req_url.pathname == "/canvasser.js") {
52`, { status: 404, statusText: "Not found.", headers: { "Content-Type": "text/html", }})
53}
54export default async function (req: Request): Promise<Response> {
55try {
56return await handler(req);
ReactiveNotesmain.tsx1 match
1export default function () {
2const body = `<!DOCTYPE html>
3<html lang="en">
krazyy-cam-configmain.ts2 matches
1function corsHeaders() {
2return {
3"Content-Type": "application/json",
8}
910export default async function handle(req: Request): Promise<Response> {
11// ---- Handle CORS preflight ----
12if (req.method === "OPTIONS") {
Gemini-2-5-Pro-O-02main.tsx17 matches
83].filter(Boolean);
8485function authenticateRequest(req: Request): { isValid: boolean; error?: string } {
86if (!BOT_ACCESS_KEY) {
87console.warn("Warning: BOT_ACCESS_KEY is not set in environment variables");
110}
111112function createPoeClient(apiKey: string): OpenAI {
113return new OpenAI({
114apiKey: apiKey || "YOUR_POE_API_KEY",
117}
118119function selectOptimalTokens(contentLength: number, taskType: string): number {
120if (taskType === "Image Generation") return 1024;
121if (contentLength < 100) return 1024; // Short queries
124}
125126async function callSinglePoeModel(
127model: string,
128prompt: string,
169}
170171async function callPoeModelParallel(
172models: string[],
173prompt: string,
260}
261262async function imageToBase64(imageUrl: string): Promise<{ data: string; mimeType: string }> {
263try {
264const response = await fetch(imageUrl, { timeout: 8000 });
276}
277278async function callGeminiApi(
279config: ModelConfig,
280prompt: string,
338}
339340async function generateImage(prompt: string, send: SendEventFn): Promise<void> {
341let cleanPrompt = prompt;
342if (cleanPrompt.endsWith('--image')) {
364}
365366async function generateText(prompt: string, send: SendEventFn, useClaudeModels: boolean = false): Promise<void> {
367send("text", { text: `💬 Processing...` });
368391}
392393async function analyzeFile(fileContent: string, fileName: string, userPrompt: string, send: SendEventFn): Promise<void> {
394if (!fileContent || fileContent.trim().length === 0) {
395send("error", {
436}
437438async function analyzeImage(imageUrl: string, userPrompt: string, send: SendEventFn): Promise<void> {
439let analysisPrompt: string;
440if (!userPrompt || userPrompt.trim().length === 0) {
468}
469470async function performSearch(query: string, send: SendEventFn): Promise<void> {
471const searchPrompt = `Search for comprehensive, current information about: ${query}\n\nProvide detailed, accurate information with sources and references where available. Focus on the most recent and relevant information.`;
472494}
495496function detectIntent(content: string, hasAttachments: boolean): { intent: string; useClaudeModels: boolean } {
497const lowerContent = content.toLowerCase();
498let useClaudeModels = false;
541}
542543async function getResponse(req: Query, send: SendEventFn) {
544send("meta", { content_type: "text/markdown" });
545649}
650651async function getBotSettings(): Promise<BotSettings> {
652const rateCard = "| Task Type | Price |\n" +
653"|-----------|-------|\n" +
716) => void;
717718function encodeEvent(event: string, data: any = {}) {
719return new TextEncoder().encode(
720`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`,
722}
723724export default async function (req: Request): Promise<Response> {
725if (req.method !== "OPTIONS") {
726const authResult = authenticateRequest(req);
lastLoginGoogleDemomain.tsx3 matches
3import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton";
45function App() {
6const email = (window as any).__HYDRATED_EMAIL__;
726}
2728function client() {
29createRoot(document.getElementById("root")!).render(<App />);
30}
36import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";
3738function server(request: Request): Response {
39const email = request.headers.get("X-LastLogin-Email");
40
untitled-8233main.ts1 match
1// Learn more: https://docs.val.town/vals/http/
2export default async function (req: Request): Promise<Response> {
3return Response.json({ ok: true })
4}
Gemini-2-5-Pro-O-01main.tsx18 matches
84].filter(Boolean);
8586function createPoeClient(apiKey: string): OpenAI {
87return new OpenAI({
88apiKey: apiKey || "YOUR_POE_API_KEY",
91}
9293async function callPoeModel(
94models: string[],
95prompt: string,
164}
165166async function imageToBase64(imageUrl: string): Promise<{ data: string; mimeType: string }> {
167try {
168const response = await fetch(imageUrl, { timeout: 10000 });
185}
186187async function callGeminiPro(
188prompt: string,
189send: SendEventFn,
250}
251252async function callGeminiVision(
253prompt: string,
254imageUrl: string,
313}
314315async function callGeminiFirst(
316prompt: string,
317send: SendEventFn,
365}
366367async function fallbackToGemini(
368prompt: string,
369send: SendEventFn,
418}
419420async function generateImage(prompt: string, send: SendEventFn): Promise<void> {
421let cleanPrompt = prompt;
422if (cleanPrompt.endsWith('--image')) {
441}
442443async function generateText(prompt: string, send: SendEventFn, useClaudeModels: boolean = false): Promise<void> {
444let models = POE_MODELS.textGeneration;
445if (useClaudeModels) {
465}
466467async function analyzeFile(fileContent: string, fileName: string, userPrompt: string, send: SendEventFn): Promise<void> {
468if (!fileContent || fileContent.trim().length === 0) {
469send("error", {
508}
509510async function analyzeImage(imageUrl: string, userPrompt: string, send: SendEventFn): Promise<void> {
511let analysisPrompt: string;
512if (!userPrompt || userPrompt.trim().length === 0) {
536}
537538async function performSearch(query: string, send: SendEventFn): Promise<void> {
539const searchPrompt = `Search for comprehensive, current information about: ${query}\n\nProvide detailed, accurate information with sources and references where available. Focus on the most recent and relevant information.`;
540560}
561562function detectIntent(content: string, hasAttachments: boolean): { intent: string; useClaudeModels: boolean } {
563const lowerContent = content.toLowerCase();
564let useClaudeModels = false;
607}
608609async function getResponse(req: Query, send: SendEventFn) {
610send("meta", { content_type: "text/markdown" });
611720}
721722async function getBotSettings(): Promise<BotSettings> {
723const rateCard = "| Task Type | Price |\n" +
724"|-----------|-------|\n" +
787) => void;
788789function encodeEvent(event: string, data: any = {}) {
790return new TextEncoder().encode(
791`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`,
793}
794795function validateBotAccess(req: Request): { success: boolean; error?: string } {
796const botAccessKey = process.env.BOT_ACCESS_KEY;
797
819}
820821export default async function (req: Request): Promise<Response> {
822const reqBody = await req.json().catch((e) => {
823console.error("body parse error", e);
last-login-demo-1index.tsx2 matches
24}
2526function App({ initialEmail, initialThreads = [] }: AppProps) {
27const [email, setEmail] = useState<string | null>(initialEmail || null);
28const [threads, setThreads] = useState<Thread[]>(initialThreads);
315316// Initialize the app
317function initApp() {
318const initialData = (window as any).__INITIAL_DATA__;
319const root = createRoot(document.getElementById('root')!);
ReactiveNotescomputedValuesPlugin.js3 matches
5const math = create(all, {});
67// parse vars + functions
8function buildContext(doc) {
9const lines = doc.split("\n");
10const vars = {};
11for (const line of lines) {
12// function def: name(args) = expr
13const funcMatch = line.match(/^([a-zA-Z_]\w*)\(([^)]*)\)\s*=\s*(.+)$/);
14if (funcMatch) {
last-login-demo-1index.ts1 match
1213// Initialize database tables
14async function initDatabase() {
15// Create threads table
16await sqlite.execute(`