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/$%7Bsuccess?q=function&page=117&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 20709 results for "function"(1223ms)

Townie-05Messages.tsx9 matches

@jxnblk•Updated 3 days ago
23});
24
25export function Messages ({
26 messages,
27 messageEndTimes,
58}
59
60function Message ({
61 message,
62 messageEndTimes,
86}
87
88function AssistantMessage ({ message, messageEndTimes, running }: {
89 message: Message;
90 messageEndTimes: Record<string, number>;
107}
108
109function Part ({ part }) {
110 switch (part.type) {
111 case "text":
122}
123
124function TextPart ({ part }) {
125 return (
126 <ReactMarkdown>
130}
131
132function Details ({ open, onClick, children, summary }) {
133 return (
134 <details
148}
149
150function ToolPart ({ part }) {
151 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
152 const {
226}
227
228function EditorToolPart ({ part }) {
229 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
230 const {
293}
294
295function UserMessage ({ message }: {
296 message: Message;
297}) {

Townie-05LoginRoute.tsx1 match

@jxnblk•Updated 3 days ago
4import { useAuth } from "../hooks/useAuth.tsx";
5
6export function LoginRoute() {
7 const navigate = useNavigate();
8 const { isAuthenticated, authenticate, error } = useAuth();

Townie-05LayoutRoute.tsx1 match

@jxnblk•Updated 3 days ago
3import { Header } from "./Header.tsx";
4
5export function LayoutRoute() {
6 return (
7 <>

Townie-05InputBox.tsx6 matches

@jxnblk•Updated 3 days ago
4import { processFiles } from "../utils/images.ts";
5
6export function InputBox ({
7 value,
8 onChange,
88}
89
90export function ImageDropContainer ({
91 images,
92 setImages,
115}
116
117export function useImageDrop ({ images, setImages, running }: {
118 images: (string|null)[];
119 setImages(images: (string|null)[]) => void;
164}
165
166function ImageRow ({ images, setImages }: {
167 images: (string|null)[];
168 setImages: (images: (string|null)[]) => void;
186}
187
188function Thumbnail ({ image, onRemove }: {
189 image: string|null;
190 onRemove: () => void;
211}
212
213function UploadButton ({
214 images,
215 setImages,

Townie-05InlinePreview.tsx2 matches

@jxnblk•Updated 3 days ago
4import { MessageContext } from "./Messages.tsx";
5
6export function InlinePreview ({ part }) {
7 const project = useContext(ProjectContext);
8 const message = useContext(MessageContext);
73const SCREENSHOT_URL = "https://screenshots.valtown.net/screenshot.png";
74
75function getScreenshotURL ({
76 version,
77 endpoint,

Townie-05Home.tsx1 match

@jxnblk•Updated 3 days ago
9} from "./icons.tsx";
10
11export function Home() {
12 return (
13 <div className="container">

Townie-05Header.tsx5 matches

@jxnblk•Updated 3 days ago
6import { AppContext } from "./App.tsx";
7
8export function Header () {
9 const navigate = useNavigate();
10
25}
26
27function LogOut () {
28 const { user } = useContext(AppContext);
29 return (
46}
47
48function ValTownLogo () {
49 return (
50 <svg
64}
65
66function DarkButton () {
67 const [dark, setDark] = useLocalStorage("DARK_MODE", false);
68 const toggle = () => {
89}
90
91function AudioButton () {
92 const {audio, setAudio} = useContext(AppContext);
93

Townie-05DebugStyles.tsx1 match

@jxnblk•Updated 3 days ago
4import { Messages } from "./Messages.tsx";
5
6export function DebugStyles() {
7 const [pathname, setPathname] = useState("");
8 return (

Townie-05ChatRouteSingleColumn.tsx3 matches

@jxnblk•Updated 3 days ago
19
20// alt single-column version of /chat route
21export function ChatRouteSingleColumn () {
22 const { projectId, branchId } = useParams() as {
23 projectId: string;
56}
57
58function Conversation ({
59 project,
60 files,
177}
178
179function shouldRefetch (message) {
180 for (let i = 0; i < message?.parts?.length; i++) {
181 let part = message.parts[i];

Townie-05ChatRoute.tsx3 matches

@jxnblk•Updated 3 days ago
14import { Loading } from "./Loading.tsx";
15
16export function ChatRoute() {
17 const { projectId, branchId } = useParams() as {
18 projectId: string;
50}
51
52function Conversation({
53 project,
54 files,
163}
164
165function shouldRefetch(message) {
166 for (let i = 0; i < message?.parts?.length; i++) {
167 let part = message.parts[i];

getFileEmail4 file matches

@shouser•Updated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 3 weeks 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.