INNER CODE UNIT · TypeScript

validatedResults

hyperbrowserai/HyperAgent · src/agent/examine-dom/index.ts:83

    const validatedResults = results.filter((result: ExamineDomResult) => {
      // Check if elementId exists in the provided elements map or xpathMap
      const existsInElements = context.elements.has(result.elementId);
      const existsInXpathMap = context.xpathMap[result.elementId] !== undefined;

      if (!existsInElements && !existsInXpathMap) {
        console.warn(
          `[examineDom] Element ${result.elementId} not found in context, skipping`
        );
        return false;
      }

      return true;
    });

    return { elements: validatedResults, llmResponse };
  } catch (error) {
    console.error("[examineDom] Error finding elements:", error);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…