Skip to content

Replace old product taxonomy with canonical primitives (Fetch / Extract / Batch / Browser Sessions) - #3

Merged
AnderRV merged 24 commits into
mainfrom
fix/cli-taxonomy-primitives
Aug 4, 2026
Merged

Replace old product taxonomy with canonical primitives (Fetch / Extract / Batch / Browser Sessions)#3
AnderRV merged 24 commits into
mainfrom
fix/cli-taxonomy-primitives

Conversation

@claude

@claude claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

The CLI's README, help text, capability matrix, skills, templates, workflows, and code comments described the product with the old taxonomy — "Universal Scraper API", "Scraping Browser", and "Residential Proxies". This PR rewrites all of that descriptive text to the new canonical taxonomy: the four primitives Fetch, Extract, Batch, and Browser Sessions.

Before → After

Old name New name
Universal Scraper API Fetch (retrieving a page) / Extract (structured extraction) / Fetch and Extract (umbrella)
Scraping Browser Browser Sessions
Residential Proxies (standalone product) folded into the primitives — the README intro now names the 4 primitives (Fetch, Extract, Batch, Browser Sessions)
Batch Scraper API Batch (prose/labels) / Batch API (error & diagnostic strings)

claude and others added 7 commits July 31, 2026 11:10
Update descriptive/label/help/comment text across the CLI, registry, skills,
templates, workflows, and docs to use the four canonical primitives:

- "Universal Scraper API" -> Fetch / Extract / "Fetch and Extract" (umbrella)
- "Scraping Browser" -> Browser Sessions
- "Residential Proxies" (standalone) -> folded into the primitives
- "Batch Scraper API" -> "Batch" in prose/labels, "Batch API" in error strings

Text-only: no command names, flags, endpoints, or hosts changed. Typecheck
passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsXfB6dR3rRX64K3NwyuoD
Open-beta capabilities are usable; AUTH010 on extract=auto retries once
with autoparse so any domain still works.
Add src/core/browser-api.ts — a thin REST client for the managed Browser
Sessions API (https://mcp.zenrows.com/browser/sessions/*, Authorization: Bearer),
modeled on batch-api.ts (separate host, header auth, injectable fetch). Covers
session create/verb/close, base64 capture decode (screenshot/PDF), the CDP
connect-URL builder, and normalizeSelectValue (the backend matches <option> by
CSS selector, so a bare value becomes option[value="…"]). Unit-tested.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mitive

Browser Sessions is a GA Zenrows product (formerly Scraping Browser), so treat
it like fetch/extract rather than an experimental gate: capability status is
now "available" and policy.allow_browser defaults to true (opt out with
`zenrows policy set allow_browser false`). The gate becomes a plain opt-out —
new POLICY_BROWSER_DISABLED error (replacing the experimental code for browser)
with a copy-paste re-enable command. Update policy + capability tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rewrite the browser command as subcommand dispatch: open/close, the full set of
session verbs (navigate, click, type, fill, select, get-text/html, screenshot,
pdf, wait*, cookies, local-storage, tabs, …), `run <script.json>` (one process,
auto-closes in a finally; steps use action or verb), and `connect` (prints the
CDP wss URL for bring-your-own Playwright). Binary-safe screenshot/PDF via --out.
Tests: dispatch/validation, run sequencing + always-close, verb discriminator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…kill

Document the Browser Sessions primitive: GA product (formerly Scraping Browser),
escalation-only (prefer fetch/extract — they cost less), billed by bandwidth +
session time with a 15-minute auto-terminate cap, on by default with a
policy.allow_browser opt-out. Updates README, docs/capabilities.md, the registry
skill entry, and the interact-browser + master skills.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AnderRV
AnderRV marked this pull request as ready for review August 1, 2026 12:05
AnderRV and others added 13 commits August 3, 2026 15:21
Wire extract=auto as default with Autoparse fallback.
Resolve capability-matrix conflicts: take base's extract=beta (extract=auto open beta) and batch open-beta/usable; keep browser 'available' (GA) with the new REST-session entry; merge the status legend.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsXfB6dR3rRX64K3NwyuoD
…ation

Browser sessions bypassed the domain allow/deny policy that fetch/extract
enforce. Add assertDomainAllowed on every navigation target — `open <url>`,
the `navigate`/`new-tab` verbs, and `navigate`/`new_tab` steps in `run` — so a
blocked domain is rejected (POLICY_BLOCKED_DOMAIN) before any session is
created. Test proves the block fires before any network call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… caps note

Finish the label cleanup the earlier pass missed in agent-facing files: registry
skills (extract available→beta, interact-browser experimental→available), the
master zenrows skill routing table/tree, and compliance-policy (browser is
on-by-default, opt-out). Clarify that policy numeric caps (credits/pages/
concurrency) are advisory budgets, not hard-enforced. Document extract --outputs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…vailable

`plugin install`/`update` filtered skills to status=available, which dropped the
now-beta extract and batch-jobs skills from the payload — even though beta is a
usable status. Filter by assetRunnable (all required capabilities usable) so
core skills like extract ship with the plugin again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…T-1514)

extract=auto/autoparse could return an empty result (null / {} / [] / non-JSON)
and the CLI reported it as a normal success — an agent gets nothing but thinks
it worked. Detect empty structured results (new outcome.empty), print a visible
warning suggesting --js-render / --css, add `empty` to --json output, and make
--validate fail (EXTRACT_VALIDATION_FAILED) on an empty result, not just on
non-JSON. Verified live on example.com; real extractions are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Batch was the odd primitive out: `create` skipped the capability gate, used
`requireApiKey` (no auto-signup), never enforced the domain policy or the
numeric run caps, and wrote no run artifact — unlike fetch/extract.

Batch is the one primitive that fans out into many requests, so the per-run
caps (max_pages_per_run / max_credits_per_run) actually bind here (a single
fetch/extract is one request; browser bills separately). Enforce them, plus
the domain allow/deny policy, all as local pre-flight — before any network call.

- add `POLICY_LIMIT_EXCEEDED` + `assertWithinLimits({pages?,credits?}, policy)`
- `batch create`: `assertUsable("batch")`, `assertDomainAllowed` per task URL,
  `assertWithinLimits` (task count + estimated credits), `ensureApiKey`
  honoring `--no-signup`, and a `writeRun` artifact on success/error
- add `assertUsable("batch")` gate parity to status/results/cancel/wait/retry
- tests: policy caps (pure) + batch create pre-flight blocks (no-network)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ow polish

Additive CLI-consistency pass (the safe half of the coherence review;
the exit-code contract change is deferred to its own PR):

- every success --json path now leads with a flat `ok` field, matching the
  established shape (fetch/browser/batch already did). Errors already emit
  `{ok:false, error}` via printError, so agents can branch on `.ok` uniformly.
  Touched: account/config/policy/usage/mcp/plugin/trace/browser(info)/batch
  (estimate) + asset explain/validate. `ok` reflects validity where meaningful
  (estimate, asset validate). Raw-dump paths left as-is by intent (trace
  export, eval stored results, browser human-readable fallback).
- batch `--output`: fail loudly (INVALID_USAGE) on an unknown format instead of
  silently dropping it — matching fetch's normalizeOutput (no silent drops).
- batch `--follow`: clearer name for "poll until done"; `--wait` kept as a
  back-compat alias (fetch/extract use `--wait <ms>` for a different meaning).
- tests: --output loud-fail (no-network) + estimate --json envelope (ok true/false).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The top-level catch mapped CAPABILITY_UNAVAILABLE to exit 2, but the
capability-gated commands (fetch/extract/batch/browser) all catch internally
and return 1, so that branch never fired — the CLI already exits 1 on every
error in practice, and no docs promised otherwise.

Make the contract honest: any error exits 1. Machine consumers read the precise
`error.code` from --json output to tell a denial from a failure, which is finer-
grained than a 1-vs-2 exit code would ever be. Behavior-preserving.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(cli): consistent --json success envelope + batch --output/--follow polish
Make batch a first-class, governed primitive
@AnderRV AnderRV self-assigned this Aug 4, 2026
AnderRV and others added 4 commits August 4, 2026 09:43
Dead code: nothing in src/ or tests/ references it (assertUsable is the sole
CAPABILITY_UNAVAILABLE thrower). Drop the exported helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
State the contract plainly (any error exits 1; read error.code from --json for
the kind) instead of explaining why the removed CAPABILITY_UNAVAILABLE→2 branch
was dead — that archaeology belongs in the commit that removed it, not inline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AnderRV
AnderRV merged commit 3fb6de4 into main Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants