4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}
9const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
10
11export async function uptimeCheck(url: string, attempt = 1) {
12 let reason: string = "";
13 let status: number | null = null;
11// this cron updates a blob that the ../../shared/utils/pollEnabledStatus.ts hits during demos
12// that blob determines whether or not the cobrowsing button is ON or OFF
13export default async function (interval: Interval) {
14 // every page in the "Glancer demo" database should have it's own blob, so we have a cache for each demo
15 // this cron saves a blob for every page in the Demos DB
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
4
5function isHTMLElement(node: Node): node is HTMLElement {
6 return node.nodeType === Node.ELEMENT_NODE;
7}
19}
20
21export default function MessageComponent({ message }: MessageProps) {
22 const [expandedSections, setExpandedSections] = useState<Set<string>>(new Set());
23
152
153 // Detect tool calls
154 if (line.includes('tool_use') || line.includes('function_call')) {
155 try {
156 // Try to parse as JSON
170
171 // Detect tool results
172 if (line.includes('tool_result') || line.includes('function_result')) {
173 try {
174 const resultData = JSON.parse(line);
1import axios from "axios";
2async function fetchUsers() {
3 try {
4 const response = await axios.get("https://jsonplaceholder.typicode.com/users");
1export default async function(req: Request) {
2 try {
3 const apiKey = Deno.env.get("VALTOWN_API_TOKEN");
40}
41
42function App() {
43 const [weatherData, setWeatherData] = useState<WeatherData | null>(null);
44 const [location, setLocation] = useState<Location | null>(null);
22}
23
24export function App() {
25 const [apiKey, setApiKey] = useState<string>("");
26 const [messages, setMessages] = useState<Message[]>([]);
7}
8
9export function ApiKeyInput({ apiKey, onApiKeyChange }: ApiKeyInputProps) {
10 const [isVisible, setIsVisible] = useState(false);
11 const [tempKey, setTempKey] = useState(apiKey);
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.