From 752df833baca5cb200ef4c491c049c6e20cfc7dc Mon Sep 17 00:00:00 2001 From: Ankit Ranjan Date: Thu, 20 Aug 2026 11:30:23 +0530 Subject: [PATCH 1/6] fix(cli): eval gaps for --json, profiles, plugins, and fetch discovery Accept --json as --format json, add -f/--stdin on site fixture and memory, scope plugin update dirt to the named plugin, add profile create with PROFILE_NOT_FOUND, refuse monorepo-root installs without --all, and steer blocked/403 fetches to webcmd web fetch. --- cli-manifest.json | 2 +- skill-src/smart-search/SKILL.src.md | 4 +- skill-src/webcmd-usage/SKILL.src.md | 3 + skills/smart-search/SKILL.md | 4 +- skills/webcmd-usage/SKILL.md | 3 + src/browser/command-catalog.ts | 2 +- src/browser/profile.test.ts | 27 ++- src/browser/profile.ts | 38 +++- src/browser/run/runner.ts | 7 + src/builtin-command-surface.ts | 19 +- src/cli-argv-preprocess.ts | 1 + src/cli.test.ts | 32 +++- src/cli.ts | 222 +++++++++++++----------- src/command-presentation.ts | 8 +- src/command-surface.test.ts | 16 ++ src/command-surface.ts | 32 +++- src/commanderAdapter.test.ts | 13 ++ src/commanderAdapter.ts | 6 +- src/commands/auth.ts | 22 +-- src/completion-shared.ts | 2 +- src/errors.ts | 6 +- src/fetch/command.test.ts | 6 + src/fetch/command.ts | 2 +- src/help.ts | 15 +- src/hosted/contract.test.ts | 10 ++ src/hosted/root-command-surface.test.ts | 2 +- src/hosted/runner.test.ts | 2 +- src/hosted/runner.ts | 25 ++- src/output.test.ts | 2 + src/output.ts | 12 +- src/plugin-catalog.ts | 6 +- src/plugin.test.ts | 115 +++++++++++- src/plugin.ts | 115 +++++++++--- src/site-memory/commands.test.ts | 82 +++++++++ src/site-memory/commands.ts | 138 ++++++++++++--- src/skills.test.ts | 7 + 36 files changed, 796 insertions(+), 212 deletions(-) create mode 100644 src/site-memory/commands.test.ts diff --git a/cli-manifest.json b/cli-manifest.json index c3a91a9b..12537b68 100644 --- a/cli-manifest.json +++ b/cli-manifest.json @@ -2,7 +2,7 @@ { "site": "web", "name": "fetch", - "description": "Fetch a URL with local HTTP clients", + "description": "Fetch a URL with local HTTP clients. Use after a blocked, 403, or Cloudflare response; never opens a browser.", "access": "read", "strategy": "public", "browser": false, diff --git a/skill-src/smart-search/SKILL.src.md b/skill-src/smart-search/SKILL.src.md index cec36919..4d93aa63 100644 --- a/skill-src/smart-search/SKILL.src.md +++ b/skill-src/smart-search/SKILL.src.md @@ -1,6 +1,6 @@ --- name: smart-search -description: Use when a request needs search, research, source discovery, direct URL fetch, evidence fetching, or search-capable Webcmd adapter discovery. +description: Use when a request needs search, research, source discovery, direct URL fetch, a blocked/403/Cloudflare retry, evidence fetching, or search-capable Webcmd adapter discovery. --- # Smart Search @@ -43,6 +43,8 @@ webcmd web fetch --url Try fetch once. Only `FETCH_BLOCKED` or `FETCH_REQUIRES_BROWSER` permits browser fallback; otherwise report the returned failure rather than retrying the URL. +If you already fetched the URL outside Webcmd and got non-2xx, 403, blocked, or Cloudflare, still run `webcmd web fetch --url ` once. That command does the TLS-impersonating retry. Do not jump to `browser run` from the raw status line. + For browser fallback, create one Session, navigate the failed URL, inspect it, reuse that Session for allowed fallbacks, then close it. Local browser commands use Cloak; hosted browser commands use Webcmd Cloud and Browser Use. `web fetch` remains local in both modes. ```bash diff --git a/skill-src/webcmd-usage/SKILL.src.md b/skill-src/webcmd-usage/SKILL.src.md index 2654e3c7..29bfbd56 100644 --- a/skill-src/webcmd-usage/SKILL.src.md +++ b/skill-src/webcmd-usage/SKILL.src.md @@ -10,6 +10,8 @@ Webcmd turns websites, Electron desktop apps, and external CLIs into a uniform ` For any search, research, source discovery, direct URL fetch, evidence gathering, or “look this up” request, load `smart-search` before choosing commands. `smart-search` owns fetch-first search, browser-fetch escalation, last-resort search adapters, and source-summary rules. +If a direct fetch (`webfetch`, `curl`, or any non-webcmd HTTP client) returns non-2xx, 403, blocked, or a Cloudflare challenge, the next command is `webcmd web fetch --url `. Do not open a browser until that command returns `FETCH_BLOCKED` or `FETCH_REQUIRES_BROWSER`. + ## CLI Preflight Before the first Webcmd command in a session, run: @@ -274,6 +276,7 @@ Do not invoke these removed commands: - Do not emit a large unfiltered registry into a bounded output or infer absence from a truncation warning; filter at the source and narrow until the result is complete. - Do not assume every adapter needs a browser; check `strategy`. - Do not silently fall back from a failing adapter to hand-rolled `fetch`; use `--trace retain-on-failure` first. +- Do not treat a raw 403 or challenge from a direct fetch as a browser gate; run `webcmd web fetch --url ` first.