### Example: Login Task using page.aiAction() (Explicit Steps) Source: https://github.com/hyperbrowserai/hyperagent/blob/main/docs/cdp-overview.md Shows how to perform the same login task using page.aiAction() by explicitly defining each step. ```typescript await page.aiAction("click the email field"); await page.aiAction("type 'test@example.com' into the email field"); await page.aiAction("click the password field"); await page.aiAction("type 'pass123' into the password field"); await page.aiAction("click the login button"); ``` -------------------------------- ### Example: Login Task using page.ai() (Multi-step Agent) Source: https://github.com/hyperbrowserai/hyperagent/blob/main/docs/cdp-overview.md Demonstrates how page.ai() handles a multi-step task like login autonomously, breaking it down into agent actions. ```typescript await page.ai("Login with email 'test@example.com' and password 'pass123'"); // Agent executes: // Step 1: actElement (click email field) // Step 2: actElement (type 'test@example.com') // Step 3: actElement (click password field) // Step 4: actElement (type 'pass123') // Step 5: actElement (click login button) // Step 6: complete ``` -------------------------------- ### Build and Development Commands Source: https://github.com/hyperbrowserai/hyperagent/blob/main/CLAUDE.md Common commands for building, linting, formatting, testing, and running the CLI or examples. Ensure 'yarn build' is run before publishing. ```bash yarn build # Wipe dist/, run tsc + tsc-alias, restore CLI executable bits yarn lint # ESLint on src/**/*.ts (flat config) yarn format # Prettier on src/**/*.ts yarn test # Jest yarn cli -c "task" [--debug --hyperbrowser --mcp ] # Run agent interactively yarn example # Execute a file from examples/ or scripts/ via ts-node ``` -------------------------------- ### CDP Synchronization Timeline Example Source: https://github.com/hyperbrowserai/hyperagent/blob/main/docs/cdp-overview.md Illustrates the step-by-step process of synchronizing frame information using CDP events and DOM traversal, highlighting the role of backendNodeId. ```text Step 1: ensureInitialized() - Attach event listeners └─ Page.frameAttached fires → frameId="ABC123" └─ Call DOM.getFrameOwner("ABC123") → backendNodeId=99 └─ Store: { frameId: "ABC123", backendNodeId: 99 } Step 2: buildBackendIdMaps() - DOM traversal └─ DOM.getDocument finds