Public vals
46
lucia_hono
saolsen
lucia_hono
// deno-lint-ignore-file no-namespace
HTTP
migrations
saolsen
migrations
An interactive, runnable TypeScript val by saolsen
Script
ace
saolsen
ace
@jsxImportSource npm:hono/jsx
HTTP
gameplay_agent
saolsen
gameplay_agent
gameplay_agent This is a val.town mirror of gameplay/games/agent . Click the link to see docs.
Script
poker_agent_all_in
saolsen
poker_agent_all_in
An interactive, runnable TypeScript val by saolsen
HTTP
poker_agent_folds
saolsen
poker_agent_folds
An interactive, runnable TypeScript val by saolsen
HTTP
gameplay_poker
saolsen
gameplay_poker
gameplay_poker This is a val.town mirror of gameplay/games/poker . Click the link to see docs.
Script
connect4_agent_mcts
saolsen
connect4_agent_mcts
An interactive, runnable TypeScript val by saolsen
HTTP
connect4_agent_rand
saolsen
connect4_agent_rand
An interactive, runnable TypeScript val by saolsen
HTTP
telemetry
saolsen
telemetry
Telemetry For Vals. Telemetry is a library that lets you trace val town executions with opentelemetry. All traces are stored in val.town sqlite and there is an integrated trace viewer to see them. Quickstart Instrument an http val like this. import { init, tracedHandler, } from "https://esm.town/v/saolsen/telemetry"; // Set up tracing by passing in `import.meta.url`. // be sure to await it!!! await init(import.meta.url); async function handler(req: Request): Promise<Response> { // whatever else you do. return } export default tracedHandler(handler); This will instrument the http val and trace every request. Too add additional traces see this widgets example . Then, too see your traces create another http val like this. import { traceViewer } from "https://esm.town/v/saolsen/telemetry"; export default traceViewer; This val will serve a UI that lets you browse traces. For example, you can see my UI here . Tracing By wrapping your http handler in tracedHandler all your val executions will be traced. You can add additional traces by using the helpers. trace lets you trace a block of syncronous code. import { trace } from "https://esm.town/v/saolsen/telemetry"; trace("traced block", () => { // do something }); traceAsync lets you trace a block of async code. import { traceAsync } from "https://esm.town/v/saolsen/telemetry"; await traceAsync("traced block", await () => { // await doSomething(); }); traced wraps an async function in tracing. import { traceAsync } from "https://esm.town/v/saolsen/telemetry"; const myTracedFunction: () => Promise<string> = traced( "myTracedFunction", async () => { // await sleep(100); return "something"; }, ); fetch is a traced version of the builtin fetch function that traces the request. Just import it and use it like you would use fetch . sqlite is a traced version of the val town sqlite client. Just import it and use it like you would use https://www.val.town/v/std/sqlite attribute adds an attribute to the current span, which you can see in the UI. event adds an event to the current span, which you can see in the UI.
Script
gameplay_connect4
saolsen
gameplay_connect4
gameplay_connect4 This is a val.town mirror of gameplay/games/connect4 . Click the link to see docs.
Script
gameplay_games
saolsen
gameplay_games
gameplay_games This is a val.town mirror of gameplay/games . Click the link to see docs.
Script
schema_example
saolsen
schema_example
An interactive, runnable TypeScript val by saolsen
Script
display_markdown
saolsen
display_markdown
Display Markdown Takes a markdown document (as a string) and returns an http handler that renders it. Example https://www.val.town/v/saolsen/display_markdown_example
Script
display_mermaid
saolsen
display_mermaid
Display Mermaid Takes a mermaid document (as a string) and returns an http handler that renders it. Example https://www.val.town/v/saolsen/display_mermaid_example import { displayMermaid } from "https://esm.town/v/saolsen/display_mermaid"; const mermaid = ` sequenceDiagram Alice->>John: Hello John, how are you? John-->>Alice: Great! Alice-)John: See you later! `; export default displayMermaid(mermaid);
Script
gltf_torus
saolsen
gltf_torus
Builds a torus as a gltf file and displays it with https://modelviewer.dev/ based on https://www.donmccurdy.com/2023/08/01/generating-gltf/ https://github.com/mrdoob/three.js/tree/dev/src/geometries
HTTP