4/**** how long until "OpenAIChatCompletion" becomes available again? ****/
5
6 export default async function (Request:Request):Promise<Response> {
7 if (Request.method === 'OPTIONS') {
8 return new Response(null, {
1/** @jsxImportSource npm:hono/jsx */
2async function createSession(email: string, hostname: string) {
3 const { zip } = await import("https://esm.town/v/pomdtr/sql");
4 const { sqlite } = await import("https://esm.town/v/std/sqlite");
23}
24
25async function getSession(sessionID: string, hostname: string) {
26 const { zip } = await import("https://esm.town/v/pomdtr/sql");
27 const { sqlite } = await import("https://esm.town/v/std/sqlite");
52}
53
54async function deleteSession(sessionID: string) {
55 const { sqlite } = await import("https://esm.town/v/std/sqlite");
56
64const OAUTH_COOKIE = "oauth_store";
65
66export function lastlogin(
67 handler: (req: Request) => Response | Promise<Response>,
68) {
346
347
348 // Helper function to get the supported MIME type
349 function getSupportedMimeType() {
350 const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
351 const mimeTypes = [
1export async function getLemmyJwt({ instance, username, password }: {
2 instance: string;
3 username: string;
7 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
8 let client = new LemmyHttp(`https://${instance}`, {
9 fetchFunction: fetch,
10 });
11 try {
8});
9
10export default async function(req: Request): Promise<Response> {
11 if (req.method === "GET") {
12 return Response.json({ ignored: true });
3import { URLCrawler } from "./urlCrawlerComponent";
4
5export async function checkWebsite(inputURL: string) {
6 const urlReceiver = new URLReceiver();
7 const urlCrawler = new URLCrawler(3);
96}
97
98// Helper function to safely get attachment URL
99function getAttachmentUrl(attachments: AirtableAttachment[] | undefined): string {
100 if (!attachments || !attachments[0]) return '';
101 return attachments[0].url;
103
104// Val Town HTTP Endpoint for Airtable → Framer Fetch
105export default async function (req: Request): Promise<Response> {
106 // Setup CORS Headers for Framer Fetch compatibility
107 const headers = new Headers({
149 } while (offset);
150
151 // Helper function to extract attachment URL
152 const getAttachmentUrl = (field: any): string => {
153 if (Array.isArray(field) && field[0]?.url) {
195 };
196
197 // Helper functions for AI analysis parsing
198 const extractTags = (analysis: string): string[] => {
199 const tagMatch = analysis.match(/Tags:([^\n]*)/);
4import * as THREE from 'https://esm.sh/three@0.132.2';
5
6function HelloWorld() {
7 React.useEffect(() => {
8 const scene = new THREE.Scene();
119}
120
121function client() {
122 createRoot(document.getElementById("root")).render(<HelloWorld />);
123}
125if (typeof document !== "undefined") { client(); }
126
127export default async function server(request: Request) {
128 return new Response(`
129 <html>
9 * @param val Define which val should open. Defaults to the root reference
10 */
11export function modifyHtmlString(
12 bodyText: string,
13 { val, style }: { val?: ValRef; style?: string } = {},
40 * @param val Define which val should open
41 */
42export function modifyFetchHandler(
43 handler: (req: Request) => Response | Promise<Response>,
44 { val, style }: { val?: ValRef; style?: string } = {},
49### Linking to the val
50
51These functions infer the val using the call stack or the request URL. If the inference isn't working, or if you want to ensure it links to a specific val, pass the `val` argument:
52
53- `modifyFetchHandler(handler, {val: { handle: "andre", name: "foo" }})`