boggleSolverTowniemain.tsx5 matches
16}
1718function buildTrie(words: string[]): TrieNode {
19const root = new TrieNode();
20for (const word of words) {
31}
3233function findBoggleWords(board: { x: number; y: number; letter: string }[], wordList: string[]): string[] {
34const trie = buildTrie(wordList);
35const foundWords = new Set<string>();
49];
5051function isValidCell(x: number, y: number): boolean {
52return x >= 0 && x < cols && y >= 0 && y < rows;
53}
5455function dfs(x: number, y: number, node: TrieNode, visited: Set<string>, currentWord: string) {
56// Out of bounds or already visited cell
57const cellKey = `${x},${y}`;
93}
9495export default function boggleSolver(
96board: { x: number; y: number; letter: string }[],
97wordList: string[] = wordListCache || [],
3import { Chat } from "./Chat.tsx";
45export function App() {
6return (
7<div className="app-container">
parquetpages.html1 match
110const pages = __PAGES_DATA__;
111
112function renderPages() {
113const pagesListElement = document.getElementById('pagesList');
114
31}
3233export function App() {
34const [url, setUrl] = useState("");
35const [maxPages, setMaxPages] = useState(5);
10* @returns The newly created val or throws an error
11*/
12export async function forkVal(valId: string, newValName: string) {
13const projectDetails = await sdk.vals.retrieve(valId);
14
Apiifyinputer.ts14 matches
17}
1819public async generateQueryFunction() {
20const page = await this.browser.newPage();
21await page.goto(this.page);
47console.log("Element info:", elementInfo);
4849const { object: generatedFunction } = await generateObject({
50model: google("gemini-1.5-pro"),
51schema: z.object({
52functionCode: z.string().describe(
53"JavaScript function code that will interact with the element",
54),
55inputArgSchema: z.string().describe(
56"JSON schema for the input data that the function expects",
57),
58}),
59prompt: `
60You are a specialized automation engineer. Your task is to create a JavaScript function that will
61interact with a specific element on a webpage.
626667# REQUIREMENTS
68Create an async JavaScript function that:
691. Takes two parameters: 'page' (a Puppeteer Page object) and 'inputData' (an object containing input values)
702. Uses the element's data-element-id attribute to find and interact with the element
7475# IMPORTANT NOTES
76- The function should work with Puppeteer's Page API
77- Find the element using: page.$('[data-element-id="${this.elementId}"]')
78- Use page.waitForSelector() for waiting
85# EXAMPLE FORMAT (adapt based on the actual element type):
86\`\`\`javascript
87async function(page, inputData) {
88try {
89// Find the element by its data attribute
112\`\`\`
113114Generate ONLY the function body code that would be used between the function() { } brackets.
115Make it as specific as possible to this particular element and its behavior.
116IMPORTANT: Use the data-element-id attribute approach shown in the example with Puppeteer syntax.
119120return {
121code: generatedFunction.functionCode,
122inputSchema: generatedFunction.inputArgSchema,
123};
124}
125}
126127export async function generateQueryFunction(
128browser: Browser,
129elementId: string,
132return await Inputer
133.of(browser, elementId, page)
134.generateQueryFunction();
135}
136
Apiifywebsite-analyzer.ts3 matches
130schema: z.object({
131mainClass: z.string().describe("Main automation class code"),
132helperFunctions: z.string().describe("Helper functions for element interactions"),
133usageExamples: z.string().describe("Example usage code"),
134documentation: z.string().describe("Documentation explaining how to use the generated code"),
180${codeGeneration.mainClass}
181182${codeGeneration.helperFunctions}
183184// Usage Examples:
217}
218219export async function analyzeWebsite(
220startUrl: string,
221browser: Browser,
Apiifyelements.ts1 match
101}
102103export async function getAllGoodElements(url: string, browser: Browser) {
104const scraper = Scraper.of(url, browser);
105return await scraper.findUsefulElements();
live-reloadclient.ts3 matches
5* @returns {Promise<void>} A promise that resolves when the long poll is registered
6*/
7async function registerLongPoll({ pageLoadedAt }: { pageLoadedAt: number }) {
8const { lastUpdatedAt, status } = await (await fetch("/__lastUpdatedAt"))
9.json();
21}
2223async function wait(ms: number) {
24return new Promise((resolve) => setTimeout(resolve, ms));
25}
2627async function pollForChange(message?: string) {
28let targetURL = new URLSearchParams(window.location.search).get("url");
29if (!targetURL) {