1export function prepareRunErrorsEmail(runs) {
2 if ((runs?.length ?? 0) === 0) {
3 return "";
11 byVal[valId] = byVal[valId] ? [...byVal[valId], run] : [run];
12 }
13 function errorMessage(err) {
14 if (err && "message" in err) {
15 return err.message;
17 return `${err}`;
18 }
19 function errorLine(run) {
20 return `Error: <a href="https://www.val.town/v/${
21 run.val.username.replace(/^@/, "")
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getMktpTotals() {
4 const body = {
5 "filters": [{
6 );
7 const { default: he } = await import("npm:he");
8 async function getRss() {
9 return fetch("https://stream.thesephist.com/?n=25")
10 .then(function (response) {
11 return response.text();
12 })
13 .then(function (html) {
14 var parser = new DOMParser();
15 let title = "Linus's stream";
44 return rss.join("");
45 })
46 .catch(function (err) {
47 return "Failed to fetch page: " + err;
48 });
1export function daysUntil(date) {
2 // console.log("run");
3 // console.log(date);
1export function myApi(name) {
2 return "hi " + name;
3}
2import { sha256OfText } from "https://esm.town/v/jdan/sha256OfText";
3
4export async function hashmail(e: {
5 from: string;
6 to: string[];
1export async function duckDB(url) {
2 const { Database } = await import("npm:duckdb-async");
3 const db = await Database.create(":memory:");
1export function myApi(name) {
2 return "hi " + name;
3}
1export function Snake({ x, y, dir }) {
2 return {
3 body: [
2import { pipe } from "https://esm.town/v/adamgonda/pipe";
3
4export function update({ state, input }) {
5 const newState = pipe(state)(
6 // turnSnake(input),
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",