Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=function&page=12&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 28622 results for "function"(2942ms)

ChatMessage.tsx1 match

@AIWBโ€ขUpdated 14 hours ago
49/* โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */
50
51export default function MessageComponent({ message, onDelete, onRetry, canRetry }: MessageProps) {
52 const formatRegularContent = (content: string) => <div dangerouslySetInnerHTML={{ __html: marked(content) }}></div>;
53

ChatmcpTesting.ts2 matches

@AIWBโ€ขUpdated 14 hours ago
26 * @returns Promise<MCPTestResult>
27 */
28export async function testMCPServer(server: MCPServerConfig): Promise<MCPTestResult> {
29 if (!server.url) {
30 return {
122 * @returns Promise<Record<string, MCPTestResult>>
123 */
124export async function testMCPServers(servers: MCPServerConfig[]): Promise<Record<string, MCPTestResult>> {
125 const enabledServers = servers.filter(server => server.enabled && server.url);
126

ChatmcpPrompts.ts4 matches

@AIWBโ€ขUpdated 14 hours ago
27 * @returns Promise<MCPPrompt[]>
28 */
29async function fetchPromptsFromServer(server: MCPServerConfig): Promise<MCPPrompt[]> {
30 if (!server.enabled || !server.url) {
31 return [];
122 * @returns Promise<MCPPromptsResult>
123 */
124export async function fetchMCPPrompts(servers: MCPServerConfig[]): Promise<MCPPromptsResult> {
125 try {
126 if (!servers || !Array.isArray(servers)) {
181 * @returns Promise<MCPPromptsResult>
182 */
183export async function fetchMCPPromptsWithCache(
184 servers: MCPServerConfig[],
185 cacheKey: string = "mcp_prompts_cache",
246 * @param cacheKey - Cache key to clear
247 */
248export function clearMCPPromptsCache(cacheKey: string = "mcp_prompts_cache"): void {
249 localStorage.removeItem(cacheKey);
250}

ChatCommandPalette.tsx1 match

@AIWBโ€ขUpdated 14 hours ago
13}
14
15export default function CommandPalette({
16 prompts,
17 query,

ChatApp.tsx1 match

@AIWBโ€ขUpdated 14 hours ago
35];
36
37export default function App() {
38 const [config, setConfig] = useState<AppConfig>({
39 anthropicApiKey: "",

openai-clientmain.tsx3 matches

@cricks_unmixed4uโ€ขUpdated 14 hours ago
11}
12
13export function ChatOpenAI(model: string): ChatOpenAI {
14 const openai = new OpenAI();
15
30
31// Decorator for ChatOpenAI that will eventually add rate limiting
32export function GlobalRateLimitedChatOpenAI(model: string, requestsPerSecond: number): ChatOpenAI {
33 const openAi = ChatOpenAI(model);
34
45
46// Ensures the global rate limit table exists in the database
47async function ensureGlobalRateLimitTableExists(tableName: string) {
48 console.debug(`Ensuring table ${tableName} exists`);
49 await sqlite.execute({

createFileTreemain.ts3 matches

@nbbaierโ€ขUpdated 14 hours ago
6}
7
8async function getProjectFiles(
9 username: string,
10 valName: string,
40 * @returns A nested object representing the file tree
41 */
42function createFileTree(paths: string[]): FileTree {
43 const tree: FileTree = {};
44
64 * @returns A formatted string representation of the tree
65 */
66function renderTree(tree: FileTree, indent = ""): string {
67 let result = "";
68

crm_OBUO_FARMSproducts.ts1 match

@eddie_walkโ€ขUpdated 14 hours ago
289products.post("/reset-stock", async (c) => {
290 try {
291 // Import the function dynamically to avoid circular dependency issues
292 const { resetAllStockToZero } = await import("../database/queries.ts");
293

stevensDemotestDailyBrief.ts1 match

@sysbotโ€ขUpdated 15 hours ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

stevensDemosetupTelegramChatDb.ts1 match

@sysbotโ€ขUpdated 15 hours ago
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
5 try {
6 // Import SQLite module

getFileEmail4 file matches

@shouserโ€ขUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkโ€ขUpdated 1 month ago
Simple functional CSS library for Val Town
lost1991
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.