ReactiveNotesREADME.md1 match
8- [theme](https://github.com/vadimdemedes/thememirror/tree/main/source/themes)
910## API
1112You can access the code using the `code` property:
krazyy-cam-configmain.ts7 matches
35JSON.stringify({
36iss: serviceAccount.client_email,
37scope: "https://www.googleapis.com/auth/datastore",
38aud: "https://oauth2.googleapis.com/token",
39exp: now + 3600,
40iat: now,
7172// ---- Exchange JWT for access token ----
73const tokenRes = await fetch("https://oauth2.googleapis.com/token", {
74method: "POST",
75headers: { "Content-Type": "application/x-www-form-urlencoded" },
90// ---- Query Firestore publicLenses ----
91const pubDocRes = await fetch(
92`https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/publicLenses/${id}`,
93{ headers: { Authorization: `Bearer ${access_token}` } },
94);
106// ---- Query Firestore private user doc ----
107const privDocRes = await fetch(
108`https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/users/${owner}/lenses/${id}`,
109{ headers: { Authorization: `Bearer ${access_token}` } },
110);
116}
117const privDoc = await privDocRes.json();
118const apiToken = privDoc.fields.apiToken.stringValue;
119120// ---- Success ----
121return new Response(JSON.stringify({ apiToken, groupId, lensId }), {
122headers: corsHeaders(),
123});
Gemini-2-5-Pro-O-02main.tsx28 matches
19provider: "google",
20model: "gemini-2.5-pro",
21endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
22headers: {
23"Content-Type": "application/json",
28provider: "google",
29model: "gemini-1.5-flash",
30endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent",
31headers: {
32"Content-Type": "application/json",
37provider: "google",
38model: "models/gemini-2.5-pro",
39endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
40headers: {
41"Content-Type": "application/json",
77};
7879const POE_API_KEYS = [
80process.env.POE_API_KEY,
81process.env.POE_API_KEY2,
82process.env.POE_API_KEY3,
83].filter(Boolean);
849091const providedKey = req.headers.get("Authorization")?.replace("Bearer ", "") ||
92req.headers.get("X-API-Key") ||
93req.headers.get("X-Bot-Access-Key");
9496return {
97isValid: false,
98error: "Missing authentication. Please provide BOT_ACCESS_KEY in Authorization header, X-API-Key header, or X-Bot-Access-Key header."
99};
100}
110}
111112function createPoeClient(apiKey: string): OpenAI {
113return new OpenAI({
114apiKey: apiKey || "YOUR_POE_API_KEY",
115baseURL: "https://api.poe.com/v1",
116});
117}
127model: string,
128prompt: string,
129apiKeyIndex: number,
130taskType: string,
131timeout: number = 15000,
133): Promise<string | null> {
134try {
135const apiKey = POE_API_KEYS[apiKeyIndex];
136const poeClient = createPoeClient(apiKey);
137
138const maxTokens = selectOptimalTokens(prompt.length, taskType);
164return content && content.trim().length > 0 ? content : null;
165} catch (error) {
166console.error(`Model ${model} failed with API key ${apiKeyIndex + 1}:`, error.message);
167return null;
168}
184const promises: Promise<{result: string | null, model: string, keyIndex: number}>[] = [];
185
186for (let keyIndex = 0; keyIndex < Math.min(POE_API_KEYS.length, 2); keyIndex++) {
187for (const model of parallelModels) {
188promises.push(
201202if (successful) {
203console.log(`Success with ${successful.value.model} (API key ${successful.value.keyIndex + 1})`);
204
205if (isImageGeneration) {
231console.log("Trying remaining models sequentially...");
232for (const model of remainingModels) {
233for (let keyIndex = 0; keyIndex < POE_API_KEYS.length; keyIndex++) {
234const result = await callSinglePoeModel(model, prompt, keyIndex, taskType, timeout, isImageGeneration);
235if (result) {
276}
277278async function callGeminiApi(
279config: ModelConfig,
280prompt: string,
308};
309310const url = `${config.endpoint}?key=${process.env.GEMINI_API_KEY}`;
311const response = await fetch(url, {
312method: "POST",
318if (!response.ok) {
319const errorText = await response.text();
320throw new Error(`${config.model} API error: ${response.status} - ${errorText}`);
321}
322371
372if (shouldUseFast) {
373const flashResult = await callGeminiApi(GEMINI_FLASH_CONFIG, prompt, send, "Text Generation");
374if (flashResult) return;
375} else {
376// For complex queries, try Gemini Pro first
377const proResult = await callGeminiApi(GEMINI_PRO_CONFIG, prompt, send, "Text Generation");
378if (proResult) return;
379}
416417// Try fast model first for file analysis
418const flashResult = await callGeminiApi(GEMINI_FLASH_CONFIG, analysisPrompt, send, "File Analysis");
419if (flashResult) return;
420447448// Try Gemini Pro with vision first
449const geminiResult = await callGeminiApi(GEMINI_VISION_CONFIG, analysisPrompt, send, "Image Analysis", imageUrl);
450if (geminiResult) return;
451484if (!poeResult) {
485// Fallback to Gemini Flash for search
486const geminiResult = await callGeminiApi(GEMINI_FLASH_CONFIG, searchPrompt, send, "Web Search");
487if (!geminiResult) {
488send("error", {
733headers: {
734"Content-Type": "application/json",
735"WWW-Authenticate": "Bearer realm=\"Bot API\"",
736},
737});
Gemini-2-5-Pro-O-01main.tsx25 matches
17provider: "google",
18model: "gemini-2.5-pro",
19endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
20headers: {
21"Content-Type": "application/json",
26provider: "google",
27model: "gemini-2.0-flash-lite",
28endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-lite:generateContent",
29headers: {
30"Content-Type": "application/json",
35provider: "google",
36model: "models/gemini-2.5-pro",
37endpoint: "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
38headers: {
39"Content-Type": "application/json",
78};
7980const POE_API_KEYS = [
81process.env.POE_API_KEY,
82process.env.POE_API_KEY2,
83process.env.POE_API_KEY3,
84].filter(Boolean);
8586function createPoeClient(apiKey: string): OpenAI {
87return new OpenAI({
88apiKey: apiKey || "YOUR_POE_API_KEY",
89baseURL: "https://api.poe.com/v1",
90});
91}
99isImageGeneration: boolean = false
100): Promise<string | null> {
101for (let keyIndex = 0; keyIndex < POE_API_KEYS.length; keyIndex++) {
102const apiKey = POE_API_KEYS[keyIndex];
103const poeClient = createPoeClient(apiKey);
104105for (let modelIndex = 0; modelIndex < models.length; modelIndex++) {
106const model = models[modelIndex];
107try {
108console.log(`Trying ${taskType} with model: ${model} (API key ${keyIndex + 1})`);
109110const chatPromise = poeClient.chat.completions.create({
155}
156} catch (error) {
157console.error(`Model ${model} failed with API key ${keyIndex + 1}:`, error.message);
158send("text", { text: `โณ Main model failed, trying next model...` });
159continue;
219};
220221const url = `${GEMINI_PRO_CONFIG.endpoint}?key=${process.env.GEMINI_API_KEY}`;
222const response = await fetch(url, {
223method: "POST",
229if (!response.ok) {
230const errorText = await response.text();
231throw new Error(`Gemini 2.5 Pro API error: ${response.status} - ${errorText}`);
232}
233282};
283284const url = `${GEMINI_VISION_CONFIG.endpoint}?key=${process.env.GEMINI_API_KEY}`;
285const response = await fetch(url, {
286method: "POST",
292if (!response.ok) {
293const errorText = await response.text();
294throw new Error(`Vision API error: ${response.status} - ${errorText}`);
295}
296319): Promise<string | null> {
320try {
321console.log(`Trying ${taskType} with Gemini API`);
322send("text", { text: `๐ Processing with Gemini...` });
323334};
335336const url = `${GEMINI_FALLBACK.endpoint}?key=${process.env.GEMINI_API_KEY}`;
337const response = await fetch(url, {
338method: "POST",
344if (!response.ok) {
345const errorText = await response.text();
346throw new Error(`Gemini API error: ${response.status} - ${errorText}`);
347}
348360} catch (error) {
361console.error("Gemini first attempt failed:", error);
362send("text", { text: `โ Gemini API failed: ${error.message}` });
363return null;
364}
386};
387388const url = `${GEMINI_FALLBACK.endpoint}?key=${process.env.GEMINI_API_KEY}`;
389const response = await fetch(url, {
390method: "POST",
396if (!response.ok) {
397const errorText = await response.text();
398throw new Error(`Gemini API error: ${response.status} - ${errorText}`);
399}
400
last-login-demo-1index.tsx4 matches
52try {
53setLoading(true);
54const response = await fetch('/api/threads');
55if (response.ok) {
56const data = await response.json();
66const fetchMessages = async (threadId: number) => {
67try {
68const response = await fetch(`/api/threads/${threadId}/messages`);
69if (response.ok) {
70const data = await response.json();
8485try {
86const response = await fetch(`/api/threads/${selectedThreadId}/messages`, {
87method: 'POST',
88headers: {
121try {
122setLoading(true);
123const response = await fetch('/api/threads', {
124method: 'POST',
125headers: {
last-login-demo-1README.md9 matches
15```
16โโโ backend/
17โ โโโ index.ts # Main Hono server with API routes
18โโโ frontend/
19โ โโโ index.html # Main HTML template
27- โ Hono app with LastLogin authentication
28- โ SQLite schema for threads and messages
29- โ Basic API endpoints for threads CRUD
30- โ Static file serving for React frontend
3140- โ Chat message display with user/assistant styling
41- โ Message input with textarea and send button
42- โ OpenAI API integration (GPT-4o-mini)
43- โ Real-time message updates
44- โ Loading states and typing indicators
45- โ Conversation history context
4647## API Endpoints
4849- `GET /` - Main React app
50- `GET /api/threads` - List user's threads
51- `POST /api/threads` - Create new thread
52- `GET /api/threads/:id/messages` - Get messages for thread
53- `POST /api/threads/:id/messages` - Send message and get AI response
5455## Database Schema
6768- `/debug` - Check authentication status
69- `/api/test-create-thread` - Create a test thread (when logged in)
last-login-demo-1index.ts7 matches
76});
7778// API Routes for threads
79app.get("/api/threads", async (c) => {
80const email = c.req.header('X-LastLogin-Email');
81if (!email) {
9293// Test route to create a thread
94app.get("/api/test-create-thread", async (c) => {
95const email = c.req.header('X-LastLogin-Email');
96if (!email) {
106message: "Thread created",
107threadId: result.lastInsertRowId,
108redirect: "/api/threads"
109});
110});
127128// Create new thread
129app.post("/api/threads", async (c) => {
130const email = c.req.header('X-LastLogin-Email');
131if (!email) {
151152// Get messages for a thread
153app.get("/api/threads/:threadId/messages", async (c) => {
154const email = c.req.header('X-LastLogin-Email');
155if (!email) {
178179// Send a message and get OpenAI response
180app.post("/api/threads/:threadId/messages", async (c) => {
181const email = c.req.header('X-LastLogin-Email');
182if (!email) {
ReactiveNotesREADME.md1 match
8- [theme](https://github.com/vadimdemedes/thememirror/tree/main/source/themes)
910## API
1112You can access the code using the `code` property:
mcp-registryREADME.md4 matches
9- Val.Town & Deno
10- Hono server
11- Official MCP Registry API
12- Webawesome components and icons
1318This project is available on [Val.Town](https://www.val.town/x/cameronpak/mcp-registry) and can be accessed at: `https://cameronpak-mcp-registry.web.val.run`
1920## API Proxy
2122This server acts as a proxy for the official MCP Registry API, allowing you to access registry endpoints through this server. All requests are forwarded to `https://registry.modelcontextprotocol.io`.
2324- `GET /v0/servers` - [List Servers](https://registry.modelcontextprotocol.io/docs#/operations/list-servers)
27- `GET /v0/health` - Health check
28- `GET /v0/ping` - Ping the registry
29- `GET /docs` - Redirect to official API documentation
3031## Additional MCP Registries
nabanhotelmain.ts2 matches
6<meta name="description" content="NABAN HOTEL โ comfortable rooms, excellent service and minutes from the new airport under construction." />
7<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
8<link rel="preconnect" href="https://fonts.googleapis.com">
9<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap" rel="stylesheet">
11<style>body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }</n/style>
12<style>