Reproduce failures, inspect live page state, and fix broken browser automations.
1npx libretto connect <cdp-endpoint-url> --session remote-debug
1Use the Libretto skill. I have a remote browser session open at --session remote-debug. The eligibility check workflow failed with a broken selector error. Inspect the current page state and figure out what changed.
1Use the Libretto skill. The workflow at ./integration.ts is supposed to go to Availity and perform an eligibility check for a patient. But I'm getting a broken selector error. Fix it.
12# What the agent runs npx libretto run ./integration.ts --session debug-flow --headed
npx libretto snapshot and npx libretto exec commands while the browser stays open.They redesigned the eligibility form last week. The submit button used to be in a sidebar but now it's inline.
data-testid, ARIA role, or visible text are more stable than class names)1npx libretto run ./integration.ts --headless
pause() as a breakpointpause() call:123456789101112131415161718192021222324import { workflow, pause } from "libretto"; import { z } from "zod"; export default workflow( "eligibilityCheck", { input: z.object({ memberId: z.string(), }), output: z.void(), }, async (ctx, input) => { const { session, page } = ctx; await page.goto("https://availity.com"); await page.locator("#memberSearch").fill(input.memberId); // Pause here to inspect the page before submitting await pause(session); await page.locator("button[type='submit']").click(); // ... }, );
pause() with the browser open. The agent can also drive this autonomously by adding pause() calls where it wants to inspect, running the workflow, and calling npx libretto resume --session <name> to continue when it's ready. pause() is a no-op when NODE_ENV === "production", so it's safe to leave in during development.attemptWithRecovery() so future runs handle it automatically.waitForSelector or locator action times out because the expected element never appeared. The page might show a loading spinner, an error state, or a redirect. The agent can snapshot to see what actually rendered.