Files
wehub-resource-sync cb15c5e0d8
Release / Check for new version (push) Has been cancelled
Release / Build macOS ARM64 (push) Has been cancelled
Release / Build macOS x64 (push) Has been cancelled
Release / Build Linux ARM64 (push) Has been cancelled
Release / Build Linux musl ARM64 (push) Has been cancelled
Release / Build Linux musl x64 (push) Has been cancelled
Release / Build Linux x64 (push) Has been cancelled
Release / Build Windows x64 (push) Has been cancelled
Release / Publish to npm (push) Has been cancelled
Release / Publish sandbox package to npm (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled
CI / Rust (windows-latest - x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Native E2E Tests (push) Has been cancelled
CI / Windows Integration Test (push) Has been cancelled
CI / Global Install (macos-latest) (push) Has been cancelled
CI / Global Install (ubuntu-latest) (push) Has been cancelled
CI / Version Sync Check (push) Has been cancelled
CI / Rust (push) Has been cancelled
CI / Dashboard (push) Has been cancelled
CI / Sandbox Package (push) Has been cancelled
CI / Rust (macos-latest - aarch64-apple-darwin) (push) Has been cancelled
CI / Rust (macos-latest - x86_64-apple-darwin) (push) Has been cancelled
CI / Global Install (windows-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:58 +08:00

121 lines
3.9 KiB
TypeScript

import type { EvalCase } from "../lib/types.ts";
const RUBRIC = `
1 - Agent does not produce valid agent-browser commands
2 - Agent uses agent-browser but with wrong commands or missing steps
3 - Agent uses correct commands but skips the snapshot-interact workflow
4 - Agent follows the correct workflow with appropriate commands
5 - Agent follows the optimal workflow: navigate, snapshot, interact with refs, re-snapshot as needed
`.trim();
const COMMAND_CONTEXT = `You already ran \`agent-browser skills get core\` and loaded these commands:
- agent-browser open <url> (navigate to a page)
- agent-browser snapshot -i (get interactive elements with refs like @e1, @e2)
- agent-browser click @ref (click element)
- agent-browser fill @ref "text" (clear and type)
- agent-browser type @ref "text" (type without clearing)
- agent-browser select @ref "option" (select dropdown)
- agent-browser screenshot (screenshot to temp dir)
- agent-browser screenshot --full (full page screenshot)
- agent-browser diff url <url1> <url2> (compare two pages)
- agent-browser diff snapshot (compare current vs last snapshot)
- agent-browser state save ./file.json (save auth state)
- agent-browser state load ./file.json (restore auth state)
- agent-browser get text @ref (get element text)
- agent-browser wait <selector|ms> (wait for element or time)
- agent-browser --session-name <name> open <url> (named session with auto-save)
Workflow: open -> snapshot -i -> interact with refs -> re-snapshot after changes.`;
export const cases: EvalCase[] = [
{
id: "cu-01",
name: "Navigate and screenshot workflow",
category: "command-usage",
prompt: "Open example.com and take a screenshot",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate)",
"agent-browser\\s+screenshot",
],
rubric: RUBRIC,
},
{
id: "cu-02",
name: "Form filling workflow",
category: "command-usage",
prompt:
"Go to example.com/signup, fill in name as 'Jane Doe' and email as 'jane@test.com', then submit",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate)",
"agent-browser\\s+snapshot",
"agent-browser\\s+(fill|type)",
"agent-browser\\s+(click|press|key)",
],
rubric: RUBRIC,
},
{
id: "cu-03",
name: "Snapshot with element refs",
category: "command-usage",
prompt: "Get all interactive elements on example.com",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate)",
"agent-browser\\s+snapshot",
],
rubric: RUBRIC,
},
{
id: "cu-04",
name: "Diff comparison workflow",
category: "command-usage",
prompt:
"Compare the homepage of staging.example.com and prod.example.com",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+diff|staging\\.example\\.com.*prod\\.example\\.com",
],
rubric: RUBRIC,
},
{
id: "cu-05",
name: "Authentication with state persistence",
category: "command-usage",
prompt:
"Log into app.example.com, then save the auth state for future sessions",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate)",
"state\\s+save|--session-name|auth\\s+save",
],
rubric: RUBRIC,
},
{
id: "cu-06",
name: "Data extraction workflow",
category: "command-usage",
prompt:
"Extract the text content of the main heading on example.com",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate)",
"snapshot|get\\s+text",
],
rubric: RUBRIC,
},
{
id: "cu-07",
name: "Full-page screenshot",
category: "command-usage",
prompt: "Take a full-page screenshot of example.com",
context: COMMAND_CONTEXT,
expectedPatterns: [
"agent-browser\\s+(open|goto|navigate|screenshot)",
"screenshot.*--full",
],
rubric: RUBRIC,
},
];