INNER CODE UNIT · TypeScript

extractValueFromInstruction

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

export function extractValueFromInstruction(instruction: string): string {
  // Pattern: "with X", "into X", "in X"
  const patterns = [/with\s+(.+)$/i, /into\s+(.+)$/i, /in\s+(.+)$/i];

  for (const pattern of patterns) {
    const match = instruction.match(pattern);
    if (match) {
      return match[1].trim();
    }
  }

  return "";
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…