val-to-textValOutput.tsx1 match
3import type { ValOutputProps } from "../types.ts";
45export function ValOutput({
6text,
7files,
val-to-textValForm.tsx1 match
3import type { ValFormProps } from "../types.ts";
45export function ValForm({
6username,
7valName,
val-to-textutils.ts3 matches
10type File = ValTown.Vals.Files.FileRetrieveResponse;
1112export function formatOutput({
13username,
14valname,
42}
4344export async function getTreeAndContent(id: string): Promise<{
45filesWithContent: { name: string; content: string }[];
46tree: FileTree;
71}
7273export async function getFilesWithContent(
74files: File[],
75valId: string,
val-to-textuseValExport.ts1 match
1import { useState } from "https://esm.sh/react@18.2.0";
23export function useValExport() {
4const [text, setText] = useState<undefined | string>();
5const [files, setFiles] = useState<number>(0);
val-to-textApp.tsx1 match
5import { useValExport } from "../hooks/useValExport.ts";
67export function App() {
8const [name, setName] = React.useState("val-to-text");
9const [username, setUsername] = React.useState("nbbaier");
autonomous-valdemo.tsx7 matches
1import agent from "./agent.tsx";
23export default async function(req: Request) {
4// Default objective as fallback
5let objective = `Buy 100 shares of MSFT and 100 shares of NVDA.`;
89}
9091// Function to generate HTML for tool calls
92function generateToolCallsHtml(results: any): string {
93if (!results || !results.steps) {
94return "";
146}
147148// Function to generate the HTML page with the form and optional results
149function generateHtmlPage(objective?: string, results?: any, errorMessage?: string): string {
150const defaultObjective = objective || `What is the current temperature in Tokyo?`;
151233</style>
234<script>
235// Function to populate the textarea with the selected prompt
236function setPrompt(value) {
237if (value) {
238document.getElementById('objective').value = value;
autonomous-valagent.tsx1 match
16import { formatResult, parseStatusToolResult } from "./utils.tsx";
1718export default async function POST(req: Request) {
19if (req.headers.get("Authorization") !== `Bearer ${Deno.env.get("AGENT_API_KEY")}`) {
20return new Response("Unauthorized", { status: 401 });
RequirementsWriterApp.tsx1 match
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
5const [clicked, setClicked] = useState(0);
6return (
untitled-6069main.tsx19 matches
296297<script>
298// Data loading functions
299async function fetchData(endpoint) {
300try {
301const response = await fetch(`/Repository/docrepo/backend/api/${endpoint}.php`);
371372// Toggle loading spinner
373function toggleLoading(elementId, show) {
374const element = document.getElementById(elementId);
375if (element) {
378}
379380// Render functions for each section
381function renderWebinars(webinars) {
382const container = document.getElementById('webinarsContainer');
383if (!container) return;
399}
400401function renderResearch(featured, recent) {
402const featuredContainer = document.getElementById('featuredResearch');
403const recentContainer = document.getElementById('recentResearch');
431}
432433// Additional render functions would follow the same pattern...
434// (renderInnovations, renderConferences, renderDepartments, etc.)
435436// Helper function to display time since
437function timeSince(date) {
438const seconds = Math.floor((new Date() - date) / 1000);
439let interval = Math.floor(seconds / 31536000);
451}
452453// Authentication functions
454function checkAuthStatus() {
455fetch('/Repository/docrepo/backend/api/auth/session.php')
456.then(res => res.json())
463}
464465function updateUIForLoggedInUser(user) {
466const loginBtn = document.getElementById('loginToggle');
467const registerBtn = document.getElementById('registerToggle');
478}
479480async function handleLogout() {
481try {
482const response = await fetch('/Repository/docrepo/backend/api/auth/logout.php', {
498const registerModal = document.getElementById('registerModal');
499500function toggleModal(show, hide) {
501show.classList.remove('hidden');
502hide.classList.add('hidden');
504}
505506function clearMessages() {
507document.getElementById('loginError').textContent = '';
508document.getElementById('loginError').classList.add('hidden');
542// Smooth scrolling for navigation links
543document.querySelectorAll('a[href^="#"]').forEach(anchor => {
544anchor.addEventListener('click', function (e) {
545e.preventDefault();
546const target = document.querySelector(this.getAttribute('href'));
614});
615616function renderDepartments(departments) {
617const container = document.getElementById('departmentsContainer');
618if (!container || !departments) return;
639640641function renderDepartmentsDropdown(departments) {
642const dropdown = document.getElementById('departmentsDropdown');
643if (!dropdown || !departments) return;
650}
651652async function fetchData(endpoint) {
653const loadingElement = document.getElementById(`${endpoint}Loading`);
654if (loadingElement) loadingElement.style.display = 'block';
GlancergenerateHTML.tsx28 matches
8let heightSent = false;
910function notifyParentOfHeight() {
11// Only send height once and only if we're in an iframe
12if (!heightSent && window.parent !== window) {
55}
5657function escapeHtml(text: string): string {
58return text
59.replace(/&/g, "&")
64}
6566function extractYouTubeId(url: string): string | null {
67const patterns = [
68/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\n?#]+)/,
77}
7879function extractVimeoId(url: string): string | null {
80const match = url.match(/vimeo\.com\/(?:video\/)?(\d+)/);
81return match ? match[1] : null;
82}
8384function extractLoomId(url: string): string | null {
85const match = url.match(/loom\.com\/share\/([a-zA-Z0-9]+)/);
86return match ? match[1] : null;
87}
8889function extractDomain(url: string): string {
90try {
91const urlObj = new URL(url);
96}
9798export function GenerateHTML({ data }: any) {
99if (!data || !data.results) {
100return <div>No content available</div>;
156}
157158function renderChildBlocks(children: NotionBlock[]): string {
159if (!children || !Array.isArray(children) || children.length === 0) {
160return "";
164}
165166function renderBlock(block: NotionBlock): string {
167const { type } = block;
168217}
218219function renderRichText(richTextArray: NotionRichText[]): string {
220if (!richTextArray || !Array.isArray(richTextArray)) {
221return "";
250}
251252function renderParagraph(block: NotionBlock): string {
253const content = renderRichText(block.paragraph?.rich_text || []);
254return content ? `<p>${content}</p>` : "<p></p>";
255}
256257function renderHeading(block: NotionBlock, level: number): string {
258const headingData = block[`heading_${level}`];
259const content = renderRichText(headingData?.rich_text || []);
261}
262263function renderListItem(block: NotionBlock, listType: "ul" | "ol"): string {
264const itemData =
265block[listType === "ul" ? "bulleted_list_item" : "numbered_list_item"];
275}
276277function renderTodo(block: NotionBlock): string {
278const todoData = block.to_do;
279const content = renderRichText(todoData?.rich_text || []);
289}
290291function renderToggle(block: NotionBlock): string {
292const toggleData = block.toggle;
293const content = renderRichText(toggleData?.rich_text || []);
304}
305306function renderCode(block: NotionBlock): string {
307const codeData = block.code;
308const content = renderRichText(codeData?.rich_text || []);
312}
313314function renderQuote(block: NotionBlock): string {
315const quoteData = block.quote;
316const content = renderRichText(quoteData?.rich_text || []);
325}
326327function renderCallout(block: NotionBlock): string {
328const calloutData = block.callout;
329const content = renderRichText(calloutData?.rich_text || []);
346}
347348function renderImage(block: NotionBlock): string {
349const imageData = block.image;
350let imageUrl = "";
366}
367368function renderVideo(block: NotionBlock): string {
369const videoData = block.video;
370let videoUrl = "";
427}
428429function renderFile(block: NotionBlock): string {
430const fileData = block.file;
431let fileUrl = "";
447}
448449function renderBookmark(block: NotionBlock): string {
450const bookmarkData = block.bookmark;
451const url = bookmarkData?.url || "";
474}
475476function renderLinkPreview(block: NotionBlock): string {
477const linkData = block.link_preview;
478const url = linkData?.url || "";
494}
495496function renderEmbed(block: NotionBlock): string {
497const embedData = block.embed;
498const url = embedData?.url || "";
588}
589590function renderTable(block: NotionBlock): string {
591// Tables in Notion are complex and would need child blocks to be fully rendered
592return '<table class="notion-table"><tbody><!-- Table rows would be rendered here --></tbody></table>';
593}
594595function renderTableRow(block: NotionBlock): string {
596const rowData = block.table_row;
597const cells = rowData?.cells || [];
607}
608609function renderColumnList(block: NotionBlock): string {
610return '<div class="column-list"><!-- Columns would be rendered here --></div>';
611}
612613function renderColumn(block: NotionBlock): string {
614return '<div class="column"><!-- Column content would be rendered here --></div>';
615}