Skip to content

Merge pull request #464 from saffron-health/release-v0.6.34

Choose a tag to compare

@github-actions github-actions released this 14 Jul 15:37
b564d9a

v0.6.34 Release Notes

Features

  • New @libretto/browser-tools package: A new SDK for building AI agents that can drive real browsers. Agents using the AI SDK (or other supported frameworks) can open browsers, inspect pages via accessibility snapshots, and execute Playwright code against them.

    import { createAiSdkBrowserTools } from "@libretto/browser-tools/ai-sdk";
    import { LocalBrowserProvider } from "@libretto/browser-tools";
    
    const { tools, dispose } = createAiSdkBrowserTools(new LocalBrowserProvider());
    // tools: browser_open, browser_exec, browser_snapshot,
    //        browser_status, browser_close, browser_connect
  • browser_snapshot tool: Captures the current page as a compact, labelled accessibility tree with ref handles for precise element targeting. Supports optional PNG screenshots returned as multipart AI SDK output.

  • Full session control (browser_status, browser_close, browser_connect): Agents can now list open sessions and pages, close sessions, and attach to externally managed browsers via CDP without killing them on detach.

  • Snapshot diff on browser_exec: Every successful browser_exec call now returns a snapshotDiff field — a compact accessibility-tree diff showing what the page changed since the previous exec. Empty when nothing changed.

    // Each exec result includes:
    { ok: true, result: ..., stdout: "", stderr: "", snapshotDiff: "..." }
  • Per-page targeting: Both browser_exec and browser_snapshot accept an optional pageId (from browser_status) to target a specific tab rather than the most recently active one.

  • Cloud browser providers: New subpath exports for four cloud browser services — @libretto/browser-tools/kernel, @libretto/browser-tools/browserbase, @libretto/browser-tools/steel, and @libretto/browser-tools/libretto-cloud — with live-view URLs and optional recording.

    import { KernelBrowserProvider } from "@libretto/browser-tools/kernel";
    
    const { tools, dispose } = createAiSdkBrowserTools(
      new KernelBrowserProvider({ stealth: true, headless: false }),
    );
  • Domain policy (allow/block lists): Factory-level allowedDomains and blockedDomains options enforce navigation restrictions across browser_open, browser_connect, and navigations from browser_exec. Blocked top-level navigations throw a typed DomainPolicyRestricted error; blocked subresources are silently aborted.

    const { tools, dispose } = createAiSdkBrowserTools(provider, {
      blockedDomains: ["private.example.com"],
      allowedDomains: ["*.example.com"],
    });
  • Pi adapter (@libretto/browser-tools/pi): A new adapter exposes the six browser tools as Pi custom tools, with screenshot content preserved as Pi image content.

  • @libretto/playwright-debug package: A new package for investigating Playwright failures and automatically opening fix pull requests on GitHub. Add debugPlaywrightFailure(error, page) to your automation's failure path and the agent inspects the live page — preserving authentication and in-memory state — then commits a targeted fix to a new branch and opens a pull request citing observed evidence. Infrastructure failures return a structured debugger_failed result so the caller's original error and fallback are never replaced.

    import { createLibrettoDebugger } from "@libretto/playwright-debug";
    
    const librettoDebugger = createLibrettoDebugger({
      github: { owner: "acme", repo: "automations", baseBranch: "main" },
      agent: { model: "openai/gpt-5.4" },
    });
    
    try {
      await runAutomation(page);
    } catch (error) {
      await librettoDebugger.debugPlaywrightFailure(error, page);
      throw error;
    }
  • Playwright debugging agent and GitHub setup: New documentation and a Libretto Cloud setup wizard for connecting GitHub repositories, generating API keys, and adding the Playwright debugger to existing scripts. A new /dashboard/cloud-browsers page provides a dedicated view for cloud browser sessions, jobs, users, and billing.

  • GitHub sign-in: The sign-in page now supports GitHub as an OAuth provider alongside Google and email/password.

Improvements

  • Borrowed-page browser tools: createBrowserToolsForPage(page) and createAiSdkBrowserToolsForPage(page) attach the browser-tools session to an existing Playwright Page without taking ownership. Disposing detaches listeners without closing the caller's page, context, or browser — enabling safe use inside automation failure paths.

  • beforeExit cleanup backstop: The session registry now installs a process.beforeExit hook as a last resort to release provider-owned (cloud) sessions when dispose() is forgotten. The hook is removed after a successful dispose() call.

  • Linting migrated from lintcn to oxlint: The Go-based lintcn/tsgolint toolchain has been replaced with oxlint + a small JS plugin. no-floating-promises, await-thenable, no-await-import, and disable-directive reason enforcement are all preserved. The Go toolchain is no longer required.

  • Benchmarks now type-checked: The @libretto/benchmarks package has a type-check script wired into the root Turbo validation task, with stale cross-package imports replaced by supported workspace package imports.