gissue-rolodexApp.tsx2 matches
2import { useState } from "https://esm.sh/react@18.2.0";
34console.log("useState", typeof useState); // should be 'function'
567export default function App(): React.JSX.Element {
8const [refreshFrequency, setRefreshFrequency] = useState("");
9const [isSubmitting, setIsSubmitting] = useState(false);
mcp-starterREADME.md1 match
3132The MCP TypeScript SDK uses Node-specific APIs that don't play nicely with Deno
33or edge functions:
3435- https://github.com/modelcontextprotocol/typescript-sdk/issues/260
mcp-servermain.ts13 matches
32};
3334function postFilter(post: Post) {
35return post.type == "post" || post.type == "page";
36}
3738function buildTagsIndex(tags: Array<Tag>) {
39return lunr(function() {
40this.ref("id");
41this.field("name");
50});
51}
52function search(input: string, index: lunr.Index, searchData: Record<string, Post>) {
53let results = index.search(input);
5455if ((results.length == 0) && (input.length > 2)) {
56let tokens = lunr.tokenizer(input).filter(function(token, i) {
57return token.str.length < 20;
58});
5960if (tokens.length > 0) {
61results = index.query(function(query) {
62query.term(tokens, {
63editDistance: Math.round(Math.sqrt(input.length / 2 - 1)),
90}
9192function searchTags(input: string, index: lunr.Index, tags: Array<Tag>) {
93let results = index.search(input);
9495if ((results.length == 0) && (input.length > 2)) {
96let tokens = lunr.tokenizer(input).filter(function(token, i) {
97return token.str.length < 20;
98});
99100if (tokens.length > 0) {
101results = index.query(function(query) {
102query.term(tokens, {
103editDistance: Math.round(Math.sqrt(input.length / 2 - 1)),
116});
117}
118function formatPage(page: Post) {
119return [
120`# [${page.title}](${SITE_URL + page.url})`,
135}
136137function extractPostCategory(post: Post) {
138if (post.type == "page") {
139return "page";
160* Uses a cached instance if available
161*/
162async function setupMcpServer(): Promise<McpServer> {
163// Return cached instance if available
164if (mcpServerInstance) {
498499/**
500* Val.town handler function for HTTP requests
501* This will be exposed as a Val.town HTTP endpoint
502*/
untitled-8413index.html1 match
37import { createRoot } from 'https://esm.sh/react-dom@18.2.0/client';
3839function App() {
40const [vals, setVals] = useState([]);
41const [loading, setLoading] = useState(true);
1export async function blobKeyForDemoCache(id: string) {
2// get the url of this file
3// we'll use this to get values for the blob key
untitled-6415main.ts1 match
12const FAST_MODEL = 'claude-3-5-haiku-latest';
1314export default async function handler(request: Request) {
15if (request.method !== "POST") {
16return Response.json({ message: "This endpoint responds to POST requests." }, {
EnhancedVNodevnode.js5 matches
7this._createElement = createElement;
89// Initialize goober with prefixing and bind the render function
10setup(this._vnode.bind(this), prefix);
1112// Return the bound render function with attached helpers
13return Object.assign(this._vnode.bind(this), {
14toStyleObject: this.toStyleObject.bind(this),
33// Registers a plugin that mutates props before rendering
34plugin(fn) {
35if (typeof fn !== "function") {
36throw new TypeError("[EnhancedVNode] plugin must be a function");
37} else {
38this._plugins.push(fn);
96}
9798// Core render function that normalizes props, applies plugins, and returns a VNode
99_vnode(type, props, children) {
100props = this._normalizeProps(props, children);
6const SHEET = Deno.env.get("GSHEET")!;
78export default async function handler() {
9const data: Record<string, any> = {};
10
3import { crypto } from "./ticker_config.tsx";
45export default async function daily() {
6const lows: Record<string, number> = {};
7
3*
4* This is the HTTP entry point for the ValTown MCP Server when deployed
5* on ValTown itself. It excludes CLI-dependent functionality and uses
6* header-based authentication with Hono and StreamableHTTPServerTransport.
7*/