33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37
4import { ImapFlow } from "https://esm.sh/imapflow";
5
6function App() {
7 const [email, setEmail] = useState("");
8 const [password, setPassword] = useState("");
127}
128
129function client() {
130 createRoot(document.getElementById("root")).render(<App />);
131}
135}
136
137function getImapConfig(email: string): ImapServerConfig {
138 const lowerEmail = email.toLowerCase();
139 if (lowerEmail.endsWith('@gmail.com')) {
158}
159
160export default async function server(request: Request): Promise<Response> {
161 const url = new URL(request.url);
162
272}
273
274async function streamToString(stream) {
275 const chunks = [];
276 for await (const chunk of stream) {
2import type { ReactNode } from "npm:react@18.2.0";
3
4export function Layout({ children }: { children: ReactNode }) {
5 return (
6 <html lang="en">
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [url, setUrl] = useState("");
7 const [proxyLists, setProxyLists] = useState({ http: "", socks5: "" });
70}
71
72function client() {
73 createRoot(document.getElementById("root")).render(<App />);
74}
78}
79
80export default async function server(request: Request): Promise<Response> {
81 const url = new URL(request.url);
82
5import { Layout } from "./Layout.tsx";
6
7function PostComponent({ markdown, link }: { markdown: string; link?: string }) {
8 return (
9 <div style={{ border: "1px solid gray", padding: "10px", marginBottom: "20px", borderRadius: "5px" }}>
14}
15
16export default async function(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18 if (url.pathname === "/") {
44}
45
46function html(children: React.ReactNode) {
47 return new Response(
48 renderToString(
1// deno-lint-ignore require-await
2export default async function test() {
3 console.log("this is a test");
4}
288 const [agentResults, setAgentResults] = useState({});
289
290 // Helper function to update results for a specific agent
291 const setAgentResult = useCallback((agentType, result) => {
292 setAgentResults(prev => ({
464
465// --- Root Application with Login Gate (Simplified Bypass) ---
466function App() {
467 const [isLoggedIn, setIsLoggedIn] = useState(false); // Default to false
468
491
492// --- Frontend Entry Point ---
493function client() {
494 const rootElement = document.getElementById("root");
495 if (rootElement) {
507// --- Backend Server Logic (Val Town) ---
508// ----------------------------------------------
509export default async function server(request: Request): Promise<Response> {
510 // Only import server-side dependencies here
511 const { OpenAI } = await import("https://esm.town/v/std/openai");
532 // --- Agent Prompts (Corrected PartnershipID Prompt) ---
533
534 const PREFIX_SYSTEM_PROMPT = `System Objective: To function as a specialized component within an AI-powered Funding Assistant system. Your specific role and task are defined below. Adhere strictly to your defined function. Maintain objectivity, precision, and structure in all analyses and outputs, mirroring the rigor of technical or scientific documentation. Your operation is part of a larger workflow aimed at identifying, analyzing, and strategizing around federal funding opportunities for small businesses, including those for disadvantaged/underrepresented groups and considering geographic context (e.g., Chandler, AZ) and partnership potential.`;
535
536 const POSTFIX_SYSTEM_PROMPT = `System Output Protocol: Execute your assigned task meticulously. All generated outputs must be factual, verifiable, and directly derived from the provided context. Structure your final output according to the specific requirements of your task (e.g., JSON, structured text, list). If providing analysis or recommendations, clearly state the basis for each point. Use precise, objective, and professional language. If unable to complete the task due to missing information or limitations, clearly state the obstacle in the 'error' field of the JSON output. Ensure the output format is directly usable by subsequent processes or for user review. If the input context is insufficient or missing required elements for your task, return a JSON object like \`{"error": "Missing required context: [specify missing elements]."}\` instead of attempting to proceed. Respond ONLY with the final JSON object.`;
51}
52
53export function ChatInput({
54 input,
55 handleInputChange,
177 onClick={() => {
178 const customStop = (window as any).customStopRef?.current;
179 if (typeof customStop === "function") {
180 customStop();
181 }
22}
23
24export function useChatLogic({
25 project,
26 branchId,
22### 1. Setting loader state for multiple loaders
23
24Right now I've converted every loader into its own fetch call. This is the opposite of what frameworks refer to as "single fetch". However on the backend, I actually get access the full loaderData for all nested routes. I even wrote [this silly function to combine all the loaderData objects into one big object](https://www.val.town/x/stevekrouse/reactRouter7Example/code/backend/index.ts#L36-50).
25
26Ideally we should make a single loader call per navigation event, and set the internal router state. In other words, I would like to somehow reach into React Router and set this `state` here: