lasso-mcp 1.22.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +11 -2
- package/README.md +11 -2
- package/dist/browse/cdp-actions.d.ts +25 -1
- package/dist/browse/cdp-actions.d.ts.map +1 -1
- package/dist/browse/cdp-actions.js +54 -2
- package/dist/browse/cdp-actions.js.map +1 -1
- package/dist/channels/BrowseChannel.d.ts +5 -0
- package/dist/channels/BrowseChannel.d.ts.map +1 -1
- package/dist/channels/BrowseChannel.js +92 -1
- package/dist/channels/BrowseChannel.js.map +1 -1
- package/dist/doctor/doctor.d.ts +14 -5
- package/dist/doctor/doctor.d.ts.map +1 -1
- package/dist/doctor/doctor.js +87 -9
- package/dist/doctor/doctor.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/ssrf/dir-allowlist.d.ts +17 -0
- package/dist/ssrf/dir-allowlist.d.ts.map +1 -0
- package/dist/ssrf/dir-allowlist.js +54 -0
- package/dist/ssrf/dir-allowlist.js.map +1 -0
- package/dist/ssrf/file-guard.d.ts +17 -0
- package/dist/ssrf/file-guard.d.ts.map +1 -0
- package/dist/ssrf/file-guard.js +120 -0
- package/dist/ssrf/file-guard.js.map +1 -0
- package/dist/ssrf/screenshot-guard.d.ts +18 -0
- package/dist/ssrf/screenshot-guard.d.ts.map +1 -0
- package/dist/ssrf/screenshot-guard.js +128 -0
- package/dist/ssrf/screenshot-guard.js.map +1 -0
- package/dist/ssrf/ssrf-guard.d.ts +7 -0
- package/dist/ssrf/ssrf-guard.d.ts.map +1 -1
- package/dist/ssrf/ssrf-guard.js +6 -0
- package/dist/ssrf/ssrf-guard.js.map +1 -1
- package/dist/tools/browse.d.ts.map +1 -1
- package/dist/tools/browse.js +57 -5
- package/dist/tools/browse.js.map +1 -1
- package/dist/tools/descriptions.d.ts.map +1 -1
- package/dist/tools/descriptions.js +28 -7
- package/dist/tools/descriptions.js.map +1 -1
- package/dist/tools/fetch-url.d.ts +2 -2
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -1
- package/doc/bugs/04-/351/231/204/345/275/225E-cc-control/347/255/224/345/244/215/344/270/216hook/344/272/244/344/273/230/345/214/205.md +142 -80
- package/doc/bugs/05-2026-09-09-/346/266/210/350/264/271/346/226/271/345/217/260/350/264/246L1-L3-navigate/346/255/273/345/217/202/346/225/260-file/347/231/275/345/220/215/345/215/225-console/346/232/264/351/234/262/351/235/242.md +238 -0
- package/doc/governance/12-/345/233/236/345/221/212/346/224/266/345/217/243/344/270/216/344/272/244/344/273/230/347/211/251/346/265/213/350/257/225/350/275/275/344/275/223/345/206/263/350/256/256.md +125 -0
- package/doc/usage/01-KEY-GUIDE.md +2 -0
- package/package.json +2 -1
- package/src/browse/cdp-actions.ts +66 -2
- package/src/channels/BrowseChannel.ts +102 -1
- package/src/doctor/doctor.ts +92 -9
- package/src/index.ts +1 -1
- package/src/invariants/check-invariants.mjs +244 -0
- package/src/ssrf/dir-allowlist.ts +62 -0
- package/src/ssrf/file-guard.ts +132 -0
- package/src/ssrf/screenshot-guard.ts +145 -0
- package/src/ssrf/ssrf-guard.ts +14 -0
- package/src/tools/browse.ts +71 -5
- package/src/tools/descriptions.ts +28 -7
- package/src/types.ts +29 -0
- package/vitest.workspace.ts +6 -2
package/README.en.md
CHANGED
|
@@ -144,6 +144,8 @@ Auto-strips nav bars, ads, sidebars and other clutter — **saves 30–70% on to
|
|
|
144
144
|
|
|
145
145
|
> **As of v1.5, `browse_headless` has anti-detection on by default** (spoofed UA / `navigator.webdriver` removed / faked webgl, plugins, codecs, and a dozen more layers). **Zero config — automatic.** Many "detect headless" sites now scrape directly (v1.8 fixed a defect where the injection silently failed to apply — it really takes effect now, and injection failures are reported honestly in the logs). As of v1.11 anti-detection is applied **at browser-launch level**: UA, viewport and language are issued together from the profile, so the network-layer HTTP headers and the page's JS see the same values — no more self-contradiction. As of v1.12 the default fingerprint on macOS **matches your system** (no more "UA says Windows while machine traits give away macOS"). Only Cloudflare-grade heavy anti-bot needs the cloud browser (see "Anti-Bot Bypass" below). Want to verify the anti-detection effect? Run `lasso doctor --stealth-check` for a creepjs detection comparison.
|
|
146
146
|
|
|
147
|
+
> **Testing local HTML files** (single-file deliverables, offline acceptance): `file://` URLs are rejected by default (so an injected agent can't wander your local disk); the rejection payload carries an opt-in hint — set `LASSO_ALLOW_FILE_FROM=/your/project/dir` and `browse_headless` / `browse_logged_in` can navigate/snapshot/extract/screenshot local files **inside the allowlisted directory subtrees** only (`../` traversal, symlink escapes and directory-prefix forgery are all sealed; `fetch_url` and other tools stay http(s)-only).
|
|
148
|
+
|
|
147
149
|
### Scrape Logged-in Pages (even with 2FA)
|
|
148
150
|
|
|
149
151
|
> You: "Show me my Jira to-dos" → snapshot of the logged-in page
|
|
@@ -164,7 +166,7 @@ When you don't need to render a full page, direct HTTP is **~4× faster and ~4×
|
|
|
164
166
|
|
|
165
167
|
> You: "Take a full-page screenshot" / "Save as PDF" → file path on disk
|
|
166
168
|
|
|
167
|
-
All images and PDFs are **saved to disk and a path is returned** — no giant blob dumped into your chat to waste context. Oversized text output (fetch_url / network, etc.) beyond 48 KiB is also written to disk automatically, returning a preview plus an `@oN` continuation handle — page through it with the `read_text` tool (directly callable over MCP since v1.8).
|
|
169
|
+
All images and PDFs are **saved to disk and a path is returned** — no giant blob dumped into your chat to waste context. Oversized text output (fetch_url / network, etc.) beyond 48 KiB is also written to disk automatically, returning a preview plus an `@oN` continuation handle — page through it with the `read_text` tool (directly callable over MCP since v1.8). To **choose the screenshot output path yourself** (`options.screenshot.filePath`): rejected by default (no arbitrary-path writes) — set `LASSO_SCREENSHOT_DIR=/your/output/dir` to opt in, and writes are confined to the allowlisted subtrees (auto-created nested dirs included); with no path specified the default `/tmp/lasso-screenshot-*.png` behavior is unchanged.
|
|
168
170
|
|
|
169
171
|
### See What a Page Loads
|
|
170
172
|
|
|
@@ -172,6 +174,8 @@ All images and PDFs are **saved to disk and a path is returned** — no giant bl
|
|
|
172
174
|
|
|
173
175
|
Auto-identifies every resource the page loads, grouped by third-party domain — handy for spotting privacy risk and performance bottlenecks. As of v1.11, resource capture goes through the browser engine's native network layer — **complete even under proxy / TUN networks** — and every resource carries its request method and status code.
|
|
174
176
|
|
|
177
|
+
> **Debugging page errors**: say "read this page's console" — the `console` action of `browse_headless` / `browse_logged_in` reads the current page's console messages since the last navigation (`console_level` filters by severity error/warn/info/debug, `console_limit` keeps the most recent N). No more `window.onerror` injection detours for rendering-defect debugging. Related: option keys you pass that the chosen action doesn't consume are echoed back honestly in `data.ignored_options` — Lasso never drops parameters silently.
|
|
178
|
+
|
|
175
179
|
### Drive Native Desktop Apps
|
|
176
180
|
|
|
177
181
|
> You: "Turn off dark mode" / "Read the first item in my Mail inbox" → automated action (with verification)
|
|
@@ -206,7 +210,7 @@ Goes to the Internet Archive (Wayback Machine) to find the last archived copy of
|
|
|
206
210
|
|
|
207
211
|
## Install
|
|
208
212
|
|
|
209
|
-
**Current version v1.
|
|
213
|
+
**Current version v1.23.0** (changelog in the collapsed block at the end of this section).
|
|
210
214
|
|
|
211
215
|
Prerequisites: Node.js ≥ 20 + Claude Code (or any MCP-capable client).
|
|
212
216
|
|
|
@@ -223,6 +227,8 @@ Restart Claude Code → `/mcp` → `lasso ✓ Connected`. **That's the one line
|
|
|
223
227
|
<details>
|
|
224
228
|
<summary>📋 Changelog (v1.8 → v1.18.6 — click to see what each version changed)</summary>
|
|
225
229
|
|
|
230
|
+
- **v1.23.0**: local-file & debugging batch (BUG-05, novel-engine field driven) — ① **`LASSO_ALLOW_FILE_FROM` file:// directory allowlist**: testing local single-file HTML (a staple for offline-artifact acceptance) used to be flat-blocked by the SSRF guard — now, with `LASSO_ALLOW_FILE_FROM=/your/project/dir`, `browse_*` can navigate/snapshot/extract/screenshot local files **inside the designated directory subtree** (still denied by default; zero-config = zero behavior change; `../` traversal, symlink escapes, prefix forgery and trailing-symlink write escapes all sealed — 18 read-side + 10 write-side attack variants, zero escapes); ② new **`console` action**: read the current page's console messages since the last navigation (severity filter + most-recent-N) — no more window.onerror injection detours when debugging rendering defects; ③ **`ignored_options` honesty contract**: options keys you passed that the current action doesn't consume are listed verbatim in the response (never silently dropped — one root cause of the "worked but no screenshot" trap the consumer hit); and to be explicit: navigate-then-screenshot in one step **is already what `action=screenshot` does**; ④ **`LASSO_SCREENSHOT_DIR` screenshot write-root constraint**: custom screenshot output paths are denied by default (arbitrary-write protection), opt-in and confined to the designated subtree. Two clean adversarial rounds: 6/6 mutations killed + proof the core SSRF guard is unweakened + consumer scenario (real single-file HTML over both http and file://) fully verified on a live machine.
|
|
231
|
+
- **v1.22.1**: audit & stability batch — ① six consumer-deep-inspection callback items closed: the cc-control hook sample **fixed for three defects and now ships in-repo with 17 vector tests** (samples must live in-repo, docs only point — deliverable-quality rule established), doctor port-probe detail wording made honest across four outcome shapes, version-alignment tests generalized (assertions read package.json as the single source of truth), `npm run gate` gate hardening (explicit count assertions — pipes can no longer swallow exit codes); ② full review per the 03 audit checklist (four-track six-dimension + Gauntlet verification + clean double-blind adversarial); ③ three timing flakes fixed (wall-clock boundary → fixed-clock injection, sleep-for-disk → polling, threshold aligned to the discrimination surface) — verified by five consecutive full-suite green runs + gate.
|
|
226
232
|
- **v1.22.0**: ownership-verdict & channel-self-heal batch (BUG-04, consumer-field driven) — ① new subcommand **`chrome-status [--port N]`**: takes "who occupies this port and may I touch it" out of the AI's hands — lasso classifies it directly in ten categories (ledger zombie / stale / suspected user asset …) and outputs a human decision message + machine-readable directives (`allowed_commands` / `must_report` — on a "suspected user asset" verdict the AI is explicitly told it has **zero allowed actions and must report to you**) + a paste-ready report pack; companion `chrome-stop --zombie-gate` is the only machine kill exit (in-ledger + fingerprint match + ledger re-read at kill time — triple gate). Existing commands unchanged. ② fixes the `browse_logged_in` **selected-page wedge** (P1, channel-level): root cause is a structural flaw in the upstream engine — once the selected page closes, every later navigate/evaluate/snapshot fails forever until restart; the wedge signature is now detected and healed by quietly taking over with a background page of our own, with an honest prefix when healing fails. ③ `evaluate` accepts the `(async () => {...})()` form (previously "fn is not a function"); ④ your own bad JS no longer trips the fallback chain (script errors vs channel errors classified); ⑤ doctor port-probe wording made honest ("HTTP 404" → four real outcome shapes). Two clean adversarial rounds: 5/5 mutations killed + live-machine sovereignty checks against a real user Chrome + report-pack weaponization tests. For heavy automation users: a PreToolUse hook sample (hard-blocking AI killing browsers via Bash) is in doc/bugs/04 appendix E.
|
|
227
233
|
- **v1.21.0**: browser-sovereignty & lifecycle root-fix batch (BUG-03, driven by a live-machine incident) — ① 🔴 **behavior change**: `launch-chrome` CLI default idle reaping changes from "never reap" to **auto-reap after 30 minutes** (the old never-reap behavior is restored explicitly with `--idle-ms 0`); ② **user-activation yielding gate**: when you un-hide lasso's hidden Chrome via Dock/Spotlight, lasso recognizes it as a **human at the machine** via a dual predicate (HID idle + frontmost window) — lets it through, then steps aside after a 30-second confirmation window (page-spawned popups are still pressed back; the v1.18.3 silence contract is unchanged); ③ **no collateral kill on shutdown**: fixes a P0 — any lasso server process exiting used to sweep-kill **every hidden Chrome** in the global ledger (violating the `--idle-ms 0` keep-alive promise); collection is now filtered by ownership in three dimensions, so CLI-launched instances survive server exits and are still reaped on idle; ④ **zombie-port self-healing**: when 9222 is occupied by lasso's own hung instance, it is no longer misreported as "a non-CDP process" — the ledger is consulted, the zombie collected, and a fresh instance relaunched; doctor classifies port occupiers three ways (own zombie / stale / user asset) and **never suggests killing a user asset** (forged ledger entries and impersonating pids are also refused; new invariants INV-85/86/87); ⑤ consumer-field fixes (cc-control feedback): `browse` screenshot upstream-contract adaptation (filePath direct-write for large images + Access-denied fallback retry, closing the in-session screenshot gap), `evaluate` always-returning-undefined fixed (dual-form function-expression passthrough), session rotation classified as retryable `session_rotated`; ⑥ optional `launch-chrome --mode headless` tier (for unattended use — honest caveat: headless still shares the Chrome bundle slot). Three adversarial rounds closed: 28/28 mutations killed + 3 CRITICALs fixed and re-verified PASS; tests 2595→2676 / invariants 84→87.
|
|
228
234
|
- **v1.20.0**: render-tier parallel-safety batch (stop/doctor port scoping) — ① 🔴 **behavior change**: `render-chrome --stop` previously ignored `LASSO_RENDER_PORT` and killed **every render tier on the machine** (the #1 entry point for parallel acceptance agents killing each other's instances); now, **an explicitly set `LASSO_RENDER_PORT` stops only that port** (symmetric with `--ensure`/`--status`), unset = collect-all unchanged, an invalid value exits 1 as a usage error. Old scripts that set the port yet expect a full sweep should switch to `chrome-stop --modes render`; the `--stop` output shape is unchanged (idempotent `{"stopped":[...]}`). ② `render-chrome doctor` orphan judgment is scoped the same way with double exemption: an explicit port scans only that port, and other namespaces' in-use instances are no longer misjudged as orphans (out-of-scope port + touch heartbeat within 10 minutes, both exempt — `--clean` no longer kills in-use instances). ③ the **multi-agent parallel acceptance** three-env recipe (`LASSO_RENDER_PORT` + `LASSO_LAUNCHED_CHROMES_PATH` + `LASSO_RENDER_GUARDIAN_PID_PATH`) verified on a live machine: two terminals tearing down concurrently, mutually invisible, zero cross-kills. Consumers like media-gen-mcp only call `--ensure` and are unaffected (verified at source level).
|
|
@@ -369,6 +375,8 @@ You can **completely ignore** the below for daily use. These are only for specia
|
|
|
369
375
|
- Tune the headless browser's idle auto-recycle time (`LASSO_HEADLESS_IDLE_MS`, default 5 minutes; `0` disables)
|
|
370
376
|
- Tune the launched Chrome's "close when done" time (`LASSO_LAUNCH_IDLE_MS`, default 60 s; `300000` restores 5 minutes, `0` disables) or switch back to visible launch (`LASSO_LAUNCH_MODE=visible`)
|
|
371
377
|
- Set an egress proxy for browsers (`LASSO_PROXY`, e.g. `http://127.0.0.1:7890`; **affects the headless browser and the Steel cloud browser only — your logged-in Chrome's egress always stays as-is** — v1.11)
|
|
378
|
+
- Allow `file://` local-file navigation (`LASSO_ALLOW_FILE_FROM`, colon-separated dir allowlist; opens `browse_headless` / `browse_logged_in` only, and only inside the allowlisted subtrees — still rejected by default)
|
|
379
|
+
- Open up custom screenshot output paths (`LASSO_SCREENSHOT_DIR`, colon-separated write roots; `options.screenshot.filePath` is confined to the allowlisted subtrees — rejected by default, default `/tmp` managed path unaffected)
|
|
372
380
|
- Set the Steel self-hosted cloud browser endpoint (`STEEL_ENDPOINT`, e.g. `http://localhost:3000`; needs `LASSO_ALLOW_CLOUD_BROWSER=true` too in order to activate)
|
|
373
381
|
|
|
374
382
|
Full variable list and defaults: [Key Configuration Guide · Advanced Tuning](./doc/usage/01-KEY-GUIDE.md#e-高级调优可选全不配). **Surge / Clash TUN proxy networks (fake-ip, `198.18.0.0/15`) and `127.0.0.1` (used by the local Chrome CDP debug port) are already allowed out of the box** — no extra configuration needed. That's by design, not a missing setting.
|
|
@@ -404,6 +412,7 @@ Your data is yours.
|
|
|
404
412
|
| Search keeps returning nothing | Run `lasso doctor` and check `machine_search_mcp` / `brave_keys`; check whether the Brave key expired / quota is exhausted; machine MCP reuse + the free live-search fallback work with zero config |
|
|
405
413
|
| A link won't open | Say "this link is dead, find an archive" to check the Internet Archive |
|
|
406
414
|
| Prompted that internal-network access was blocked | Double-check the URL; TUN proxy networks are allowed by default, other internal networks need explicit permission |
|
|
415
|
+
| `file://` link blocked (`ssrf_blocked:protocol_not_allowed:file:`) | By design. For testing local single-file HTML set `LASSO_ALLOW_FILE_FROM=project_dir` (colon-separated for multiple); the rejection payload's hint has full guidance; `lasso doctor` shows the `fileFrom=<n>` echo under `ssrf_config` |
|
|
407
416
|
| Want to verify the anti-detection effect | Run `lasso doctor --stealth-check` — it drives the creepjs detection page and compares against a baseline (optional, doesn't affect daily use) |
|
|
408
417
|
|
|
409
418
|
Full FAQ and debugging tips in [`doc/usage/02-TROUBLESHOOTING.md`](./doc/usage/02-TROUBLESHOOTING.md).
|
package/README.md
CHANGED
|
@@ -145,6 +145,8 @@ key 怎么申请、免费额度多少 → [**Key 配置指南**](./doc/usage/01-
|
|
|
145
145
|
|
|
146
146
|
> **v1.5 起,`browse_headless` 默认开启反检测**(伪装 UA / 抹除 `navigator.webdriver` / 伪造 webgl、plugins、codecs 等共十几路)。**无需配置,自动生效**——很多「检测 headless」的站点现在能直接抓(v1.8 修复了一个注入静默失效的缺陷,现在是真的生效,且注入失败会在日志里如实报错)。v1.11 起反检测在**浏览器启动层**就生效:UA、视口、语言随档案统一下发,网络层 HTTP 头和页面 JS 看到的是同一套值,不再自相矛盾;v1.12 起 macOS 上默认指纹**与你的系统对齐**(不再「UA 说 Windows、机器特征招供 macOS」)。只有 Cloudflare 级重度反爬才需要走云浏览器(见下方「反爬强攻」)。想验证反检测效果?跑 `lasso doctor --stealth-check` 看 creepjs 检测对比。
|
|
147
147
|
|
|
148
|
+
> **测本地 HTML 文件**(单文件交付物、离线产物验收):`file://` 链接默认拒(防注入的 agent 顺手读你本地盘);对 Claude 说「打开 file://…」被拒时会带 opt-in 指引——设 `LASSO_ALLOW_FILE_FROM=/你的项目目录` 后,`browse_headless` / `browse_logged_in` 即可导航/快照/抽取/截图**指定目录子树内**的本地文件(`../` 穿越、symlink 逃逸、目录前缀伪造全封口;`fetch_url` 等其余工具仍保持 http(s))。
|
|
149
|
+
|
|
148
150
|
### 抓登录态页(有 2FA 的也行)
|
|
149
151
|
|
|
150
152
|
> 你:「看看我 Jira 的待办」 → 登录态页面快照
|
|
@@ -165,7 +167,7 @@ key 怎么申请、免费额度多少 → [**Key 配置指南**](./doc/usage/01-
|
|
|
165
167
|
|
|
166
168
|
> 你:「截个整页长图」「存成 PDF」 → 落盘文件路径
|
|
167
169
|
|
|
168
|
-
所有图片和 PDF 都**存到本地、返回路径**,不会把一大坨图片数据塞进对话浪费上下文。超大文本输出(fetch_url / network 等)超过 48 KiB 也会自动落盘,返回预览 + `@oN` 续页句柄——用 `read_text` 工具按页续读(v1.8 起经 MCP
|
|
170
|
+
所有图片和 PDF 都**存到本地、返回路径**,不会把一大坨图片数据塞进对话浪费上下文。超大文本输出(fetch_url / network 等)超过 48 KiB 也会自动落盘,返回预览 + `@oN` 续页句柄——用 `read_text` 工具按页续读(v1.8 起经 MCP 可直接调用)。要**自定截图落盘位置**(`options.screenshot.filePath`):默认拒(防任意路径写盘)——设 `LASSO_SCREENSHOT_DIR=/你的输出目录` 开放,且只允许写进指定目录子树(嵌套新目录自动创建也限在内);不指定路径时默认落 `/tmp/lasso-screenshot-*.png`,行为不变。
|
|
169
171
|
|
|
170
172
|
### 看一个页面加载了什么
|
|
171
173
|
|
|
@@ -173,6 +175,8 @@ key 怎么申请、免费额度多少 → [**Key 配置指南**](./doc/usage/01-
|
|
|
173
175
|
|
|
174
176
|
自动识别页面加载的全部资源,按第三方域名聚合,方便看隐私风险、性能瓶颈。v1.11 起资源采集直接走浏览器引擎的原生网络层——**代理 / TUN 网络环境下也完整**,每条资源还带请求方法和状态码。
|
|
175
177
|
|
|
178
|
+
> **排查页面报错**:对 Claude 说「读一下这个页面的 console」——`browse_headless` / `browse_logged_in` 的 `console` action 直接读当前页自上次导航以来的 console 消息(`console_level` 按严重度过滤 error/warn/info/debug,`console_limit` 只留最近 N 条)。渲染类缺陷排查不再需要注入 `window.onerror` 绕路。顺带一提:你传了但当前 action 用不上的 options 键会在响应的 `data.ignored_options` 里如实列出——Lasso 不静默丢参数。
|
|
179
|
+
|
|
176
180
|
### 控桌面原生 app
|
|
177
181
|
|
|
178
182
|
> 你:「把深色模式关掉」「读一下 Mail 收件箱第一条」 → 自动操作(带验证)
|
|
@@ -215,7 +219,7 @@ macOS 上能控 Finder / Mail / Safari / Notes / 系统设置等任何原生 app
|
|
|
215
219
|
|
|
216
220
|
## 安装
|
|
217
221
|
|
|
218
|
-
**当前版本 v1.
|
|
222
|
+
**当前版本 v1.23.0**(更新日志见本节末尾折叠块)。
|
|
219
223
|
|
|
220
224
|
前提:Node.js ≥ 20 + Claude Code(或任何支持 MCP 的客户端)。
|
|
221
225
|
|
|
@@ -232,6 +236,8 @@ claude mcp add lasso -- npx -y lasso-mcp
|
|
|
232
236
|
<details>
|
|
233
237
|
<summary>📋 更新日志(v1.8 → v1.18.6,点开看每版改了什么)</summary>
|
|
234
238
|
|
|
239
|
+
- **v1.23.0**:本地文件与排障能力批(BUG-05,novel-engine 实测驱动)——① **`LASSO_ALLOW_FILE_FROM` file:// 目录白名单**:测本地单文件 HTML(离线产物验收的标配场景)此前被 SSRF 守卫一刀切拦——现在设 `LASSO_ALLOW_FILE_FROM=/你的项目目录` 后 `browse_*` 可导航/快照/抽取/截图**指定目录子树内**的本地文件(默认仍拒、零配置零行为变化;`../` 穿越、symlink 逃逸、目录前缀伪造、末段 symlink 写逃逸全封口——读面 18+写面 10 攻击变体零逃逸);② 新 **`console` action**:直接读当前页自上次导航以来的 console 消息(按严重度过滤 + 最近 N 条)——渲染类缺陷排查不再需要注入 window.onerror 绕路;③ **`ignored_options` 诚实契约**:你传了但当前 action 用不上的 options 键会在响应里如实列出(不再静默丢弃——novel-engine 实测踩到的「worked 但截图没生成」根因之一);顺带明确:navigate+截图一步走**本就是 `action=screenshot` 的行为**(先导航再截图);④ **`LASSO_SCREENSHOT_DIR` 截图写根约束**:自定义截图落盘路径默认拒(防任意写盘),opt-in 且限指定目录子树内。对抗两轮 clean:6 变异全红+SSRF 守卫本体零削弱证明+消费方场景(真实单文件 HTML http/file:// 双路径)真机全通。
|
|
240
|
+
- **v1.22.1**:审查与稳定性批——① 消费方深检回告六项收口:给 cc-control 的 hook 硬拦样例**回修三处缺陷并落仓自带 17 向量测试**(样例必落仓、文档只指路——交付物质量制度成型)、doctor 端口探测 detail 文案四形态如实化、版本对齐测试泛化(断言读 package.json 单一真源,不再逐版手改)、`npm run gate` 门禁固化(显式计数断言防管道吞退出码);② 03 审查测试清单全面审查(四轨六维+Gauntlet 验证+双盲对抗 clean);③ 三个时序 flake 收口(墙钟边界改固定时钟注入/sleep 赌落盘改轮询/阈值贴判别面)——全量连跑 5 轮 + gate 全绿实证。
|
|
235
241
|
- **v1.22.0**:归属鉴定与通道自愈批(BUG-04,消费方实战驱动)——① 新子命令 **`chrome-status [--port N]`**:把「这个端口被谁占着、我能不能动它」的鉴定权从 AI 手里收走——lasso 直接十分类(账本僵尸/陈留/疑似用户资产…),输出人类决策文案 + 机器可读指令(`allowed_commands` / `must_report`——AI 拿到「疑似用户资产」分类时被明确告知**零允许操作、必须上报你**)+ 可直接粘贴的上报包;配套 `chrome-stop --zombie-gate` 唯一机器代杀出口(台账在案+指纹对+kill 时刻重读台账三重门)。旧命令行为零变化。② 修复 `browse_logged_in` **选中页死锁**(P1 通道级):根因是上游引擎的结构性缺陷——选中页一旦被关闭,后续 navigate/evaluate/snapshot 永久报错只能重启;现在自动检测楔死签名并后台自建页接管自愈,修不掉时如实前缀上报。③ `evaluate` 兼容 `(async () => {...})()` 形态(此前报 fn is not a function);④ 调用方自己写错 JS 不再拉响备用通道(脚本错误与通道错误分类);⑤ doctor 端口探测措辞如实化(「HTTP 404」→ 四形态真实归因)。对抗两轮 clean:5 变异全杀 + 真实用户 Chrome 主权实机验证 + 上报包武器化测试不破防。给重度自动化用户的配套:PreToolUse hook 硬拦样例(拦 AI 经 Bash kill 浏览器)见 doc/bugs/04-附录E。
|
|
236
242
|
- **v1.21.0**:浏览器主权与生命周期根治批(BUG-03,真机事故驱动)——① 🔴 **行为变更**:`launch-chrome` CLI 默认空闲回收从「永不回收」改为 **30 分钟自动回收**(旧永不回收行为用 `--idle-ms 0` 显式恢复);② **用户激活让位门**:你点 Dock/Spotlight 掀出 lasso 隐藏的 Chrome 时,lasso 以「HID 空闲 + 前置窗口」双判据识别这是**人在操作**——放行、30 秒确认窗后退位(页面自弹的窗口照常压回,v1.18.3 静默契约零回归);③ **停机不连坐**:修复一个 P0——此前任意 lasso server 进程退出会按全局台账**扫杀全部隐藏 Chrome**(违背 `--idle-ms 0` 保活承诺);现在按归属三维过滤,CLI 拉起的实例在 server 退出后照常存活、照常被回收;④ **僵尸占位自愈**:9222 被自家挂死实例占用时不再误报「非 CDP 进程」,自动按台账归因收尸重拉;doctor 端口占用三分类(自家僵尸/陈留/用户资产),**永不建议代杀用户资产**(台账伪造 + pid 冒名也拒杀,新不变量 INV-85/86/87);⑤ 消费方实战修复(cc-control 反馈):`browse` 截图上游契约适配(大图 filePath 直写 + Access-denied 降级重试,会话内截图通路补齐)、`evaluate` 恒返 undefined 根治(函数表达式双形态透传)、会话轮换归类为可重试的 `session_rotated`;⑥ `launch-chrome --mode headless` 可选档(无人值守专用——诚实声明:headless 也共享 Chrome bundle 槽位)。对抗三轮闭环:28 变异全杀 + 3 个 CRITICAL 当场修复复核 PASS;测试 2595→2676 / 不变量 84→87。
|
|
237
243
|
- **v1.20.0**:渲染档并行安全批(stop/doctor 端口作用域化)——① 🔴 **行为变更**:`render-chrome --stop` 此前无视 `LASSO_RENDER_PORT`、会收掉**全机**渲染档(同机多 agent 并行验收时互杀对方实例的第一入口);现在**显式设了 `LASSO_RENDER_PORT` 只收该 port**(与 `--ensure`/`--status` 对称),未设=维持全收不变,非法值 exit 1 报用法错。设了 port 却想全收的旧脚本请改用 `chrome-stop --modes render`;`--stop` 输出形状不变(幂等 `{"stopped":[...]}`)。② `render-chrome doctor` 孤儿判定同样作用域化 + 双豁免:显式 port 只判该 port,他人命名空间实例不再被误判孤儿(范围外 port + touch 心跳 10 分钟内新鲜双重豁免,`--clean` 不再误杀在用实例)。③ 配套**同机多 agent 并行验收**三 env 隔离配方(`LASSO_RENDER_PORT` + `LASSO_LAUNCHED_CHROMES_PATH` + `LASSO_RENDER_GUARDIAN_PID_PATH`)真机验证:双终端并发各自清场,并行互不可见零互杀。media-gen-mcp 等消费方只调 `--ensure` 不受影响(已源码级实证)。
|
|
@@ -390,6 +396,8 @@ lasso launch-chrome
|
|
|
390
396
|
- 调无头浏览器空闲自动回收时间(`LASSO_HEADLESS_IDLE_MS`,默认 5 分钟;配 `0` 禁用)
|
|
391
397
|
- 调 launch-chrome 起的 Chrome「用完即关」时间(`LASSO_LAUNCH_IDLE_MS`,默认 60 秒;配 `300000` 回退 5 分钟、`0` 禁用)或切回可见启动(`LASSO_LAUNCH_MODE=visible`)
|
|
392
398
|
- 给浏览器配出口代理(`LASSO_PROXY`,如 `http://127.0.0.1:7890`;**只影响无头浏览器和 Steel 云浏览器,登录态 Chrome 的出口永远保持原样**——v1.11)
|
|
399
|
+
- 放行 `file://` 本地文件导航(`LASSO_ALLOW_FILE_FROM`,冒号分隔目录白名单;只开 `browse_headless` / `browse_logged_in` 两工具,且只放行指定目录子树——默认仍拒)
|
|
400
|
+
- 开放自定截图落盘路径(`LASSO_SCREENSHOT_DIR`,冒号分隔写根目录;`options.screenshot.filePath` 只允许写进指定子树,默认拒、默认 `/tmp` 管理路径不受影响)
|
|
393
401
|
- 设 Steel 自托管云浏览器端点(`STEEL_ENDPOINT`,如 `http://localhost:3000`;需同时开 `LASSO_ALLOW_CLOUD_BROWSER=true` 才启用)
|
|
394
402
|
|
|
395
403
|
完整变量清单和默认值见 [Key 配置指南 · 高级调优](./doc/usage/01-KEY-GUIDE.md#e-高级调优可选全不配)。**Surge / Clash 等 TUN 代理网络(fake-ip,`198.18.0.0/15`)与 `127.0.0.1`(本机 Chrome CDP 调试端口用)都已内置放行**,无需额外配置——这是设计行为,不是漏配。
|
|
@@ -442,6 +450,7 @@ lasso launch-chrome
|
|
|
442
450
|
| 搜索一直没结果 | 跑 `lasso doctor` 看 `machine_search_mcp` / `brave_keys`;Brave key 是否过期或额度用完;机器 MCP 复用 + 免费实搜兜底本身零配置可用 |
|
|
443
451
|
| 链接打不开 | 改说「这个链接找不到了,找找存档」,去查互联网档案馆 |
|
|
444
452
|
| 提示要内网访问被拒 | 确认 URL 没写错;TUN 代理网络已默认放行,其他内网需手动允许 |
|
|
453
|
+
| `file://` 链接被拒(`ssrf_blocked:protocol_not_allowed:file:`) | 默认行为。测本地单文件 HTML 时设 `LASSO_ALLOW_FILE_FROM=项目目录`(冒号分隔多目录),拒绝 payload 里的 hint 有完整指引;配没配可用 `lasso doctor` 看 `ssrf_config` 的 `fileFrom=<n>` 回显 |
|
|
445
454
|
| 想验证反检测效果 | 跑 `lasso doctor --stealth-check`,会驱动 creepjs 检测页对比基线(可选,不影响日常使用) |
|
|
446
455
|
|
|
447
456
|
完整 FAQ 与调试技巧见 [`doc/usage/02-TROUBLESHOOTING.md`](./doc/usage/02-TROUBLESHOOTING.md)。
|
|
@@ -126,13 +126,37 @@ export declare function parseNetworkRequestLines(text: string): Array<{
|
|
|
126
126
|
* v1.11(round1 T5):从占位("v0.5 M0.5b placeholder")变实装——调 1.7.0 原生
|
|
127
127
|
* `list_console_messages`。
|
|
128
128
|
*
|
|
129
|
+
* BUG-05 决议 C(doc/bugs/05 §5,消费方台账 L-3):参数化 + 描述暴露。
|
|
130
|
+
* 消费方此前靠 window.onerror 注入绕路(无 console 订阅通道)——实况是
|
|
131
|
+
* action 已实装但 descriptions 零暴露 + 零参数。本 commit 补齐:
|
|
132
|
+
* - console_level:严重度阈值过滤(playwright-mcp browser_console_messages
|
|
133
|
+
* 语义先例——「Each level includes the messages of more severe levels」)
|
|
134
|
+
* - console_limit:过滤后取**最近** N 条(preview 4000 上限截断丢尾部=最新,
|
|
135
|
+
* limit 让最新消息保形)
|
|
136
|
+
*
|
|
129
137
|
* 上游响应(ConsoleFormatter concise 格式):
|
|
130
138
|
* - `## Console messages` 头 + 每消息一行
|
|
131
139
|
* `msgid=<N> [<type>] <text> (<N> args)`(可能带 ` [N times]` 后缀)
|
|
132
140
|
*
|
|
141
|
+
* opts(BrowseOptions.console_*):
|
|
142
|
+
* - console_level : "error"|"warn"|"info"|"debug" —— 严重度阈值
|
|
143
|
+
* (error={error} / warn={error,warn} / info=+log 等非 verbose /
|
|
144
|
+
* debug=全部含 verbose);缺省不过滤(现行为兼容)
|
|
145
|
+
* - console_limit : 1..500 —— 过滤后取最近 N 条;缺省全量
|
|
146
|
+
*
|
|
133
147
|
* @returns Partial<BrowseResult>:preview = messages JSON 字符串
|
|
134
148
|
*/
|
|
135
|
-
export declare function doConsole(c: McpClient, _url: string,
|
|
149
|
+
export declare function doConsole(c: McpClient, _url: string, opts: BrowseOptions): Promise<Partial<BrowseResult>>;
|
|
150
|
+
/** BUG-05 决议 C:console_level 取值(severity 阈值,四档)。 */
|
|
151
|
+
export type ConsoleLevel = "error" | "warn" | "info" | "debug";
|
|
152
|
+
/**
|
|
153
|
+
* BUG-05 决议 C:console 消息过滤纯函数(导出可测)。
|
|
154
|
+
* - level 缺省 = 不过滤(现行为兼容);给定 = severity 阈值(含更严重档)
|
|
155
|
+
* - limit 缺省 = 全量;给定 = 取**最近** N 条(slice(-N),保最新)
|
|
156
|
+
*/
|
|
157
|
+
export declare function filterConsoleMessages<T extends {
|
|
158
|
+
type: string;
|
|
159
|
+
}>(messages: T[], level?: ConsoleLevel, limit?: number): T[];
|
|
136
160
|
/** 1.7.0 list_console_messages 文本行 → 结构化消息。 */
|
|
137
161
|
export declare function parseConsoleMessageLines(text: string): Array<{
|
|
138
162
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdp-actions.d.ts","sourceRoot":"","sources":["../../src/browse/cdp-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM/D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB;IAClC,wEAAwE;;IAExE;;;;;OAKG;;IAEH,+BAA+B;;IAE/B;;;OAGG;;IAEH,qEAAqE;;EAErE,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAInE,CAAC;AAuBH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,KAAK,CACzB,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAsChC;AAKD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAs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AO,CAAC,YAAY,CAAC,CAAC,CAiChC;AAED,uDAAuD;AACvD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAqBD;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,SAAS,CAC7B,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAqBhC;AAED,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAwB/D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAC9D,QAAQ,EAAE,CAAC,EAAE,EACb,KAAK,CAAC,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,CAAC,EAAE,CASL;AAED,+CAA+C;AAC/C,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAuBD"}
|
|
@@ -204,13 +204,27 @@ export function parseNetworkRequestLines(text) {
|
|
|
204
204
|
* v1.11(round1 T5):从占位("v0.5 M0.5b placeholder")变实装——调 1.7.0 原生
|
|
205
205
|
* `list_console_messages`。
|
|
206
206
|
*
|
|
207
|
+
* BUG-05 决议 C(doc/bugs/05 §5,消费方台账 L-3):参数化 + 描述暴露。
|
|
208
|
+
* 消费方此前靠 window.onerror 注入绕路(无 console 订阅通道)——实况是
|
|
209
|
+
* action 已实装但 descriptions 零暴露 + 零参数。本 commit 补齐:
|
|
210
|
+
* - console_level:严重度阈值过滤(playwright-mcp browser_console_messages
|
|
211
|
+
* 语义先例——「Each level includes the messages of more severe levels」)
|
|
212
|
+
* - console_limit:过滤后取**最近** N 条(preview 4000 上限截断丢尾部=最新,
|
|
213
|
+
* limit 让最新消息保形)
|
|
214
|
+
*
|
|
207
215
|
* 上游响应(ConsoleFormatter concise 格式):
|
|
208
216
|
* - `## Console messages` 头 + 每消息一行
|
|
209
217
|
* `msgid=<N> [<type>] <text> (<N> args)`(可能带 ` [N times]` 后缀)
|
|
210
218
|
*
|
|
219
|
+
* opts(BrowseOptions.console_*):
|
|
220
|
+
* - console_level : "error"|"warn"|"info"|"debug" —— 严重度阈值
|
|
221
|
+
* (error={error} / warn={error,warn} / info=+log 等非 verbose /
|
|
222
|
+
* debug=全部含 verbose);缺省不过滤(现行为兼容)
|
|
223
|
+
* - console_limit : 1..500 —— 过滤后取最近 N 条;缺省全量
|
|
224
|
+
*
|
|
211
225
|
* @returns Partial<BrowseResult>:preview = messages JSON 字符串
|
|
212
226
|
*/
|
|
213
|
-
export async function doConsole(c, _url,
|
|
227
|
+
export async function doConsole(c, _url, opts) {
|
|
214
228
|
let r;
|
|
215
229
|
try {
|
|
216
230
|
r = (await c.callTool(CDP_UPSTREAM_TOOL_NAMES.console_log, {}));
|
|
@@ -224,7 +238,45 @@ export async function doConsole(c, _url, _opts) {
|
|
|
224
238
|
throw new Error(`upstream_console_error:is_error:${detail}`);
|
|
225
239
|
}
|
|
226
240
|
const messages = parseConsoleMessageLines(firstText(r) ?? "");
|
|
227
|
-
|
|
241
|
+
const filtered = filterConsoleMessages(messages, opts.console_level, opts.console_limit);
|
|
242
|
+
return { preview: JSON.stringify(filtered) };
|
|
243
|
+
}
|
|
244
|
+
/** severity 秩(小 = 更严重;档位含更严重档——pw 语义先例)。 */
|
|
245
|
+
const CONSOLE_LEVEL_RANK = {
|
|
246
|
+
error: 0,
|
|
247
|
+
warn: 1,
|
|
248
|
+
info: 2,
|
|
249
|
+
debug: 3,
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* 上游 console 消息类型 → severity 档(决议 C 注释锚):
|
|
253
|
+
* - error/warn 直传(0/1)
|
|
254
|
+
* - debug/verbose → debug 档(3)
|
|
255
|
+
* - info/log 及其余非 verbose 类型(dir/dirxml/table/trace/clear/group 族/
|
|
256
|
+
* issue/未知)→ info 档(2)
|
|
257
|
+
*/
|
|
258
|
+
function consoleTypeRank(type) {
|
|
259
|
+
if (type === "error")
|
|
260
|
+
return CONSOLE_LEVEL_RANK.error;
|
|
261
|
+
if (type === "warn")
|
|
262
|
+
return CONSOLE_LEVEL_RANK.warn;
|
|
263
|
+
if (type === "debug" || type === "verbose")
|
|
264
|
+
return CONSOLE_LEVEL_RANK.debug;
|
|
265
|
+
return CONSOLE_LEVEL_RANK.info;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* BUG-05 决议 C:console 消息过滤纯函数(导出可测)。
|
|
269
|
+
* - level 缺省 = 不过滤(现行为兼容);给定 = severity 阈值(含更严重档)
|
|
270
|
+
* - limit 缺省 = 全量;给定 = 取**最近** N 条(slice(-N),保最新)
|
|
271
|
+
*/
|
|
272
|
+
export function filterConsoleMessages(messages, level, limit) {
|
|
273
|
+
const out = level === undefined
|
|
274
|
+
? messages.slice()
|
|
275
|
+
: messages.filter((m) => consoleTypeRank(m.type) <= CONSOLE_LEVEL_RANK[level]);
|
|
276
|
+
if (limit !== undefined && out.length > limit) {
|
|
277
|
+
return out.slice(out.length - limit);
|
|
278
|
+
}
|
|
279
|
+
return out;
|
|
228
280
|
}
|
|
229
281
|
/** 1.7.0 list_console_messages 文本行 → 结构化消息。 */
|
|
230
282
|
export function parseConsoleMessageLines(text) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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AAO,GAAG,CAAC;AACb,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,wBAAwB,CAAC,IAAY;IAOnD,MAAM,GAAG,GAMJ,EAAE,CAAC;IACR,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,+CAA+C;QAC/C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAClB,kFAAkF,CACnF,CAAC;QACF,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,GAAG,CAAC,IAAI,CAAC;YACP,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACtB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACV,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACV,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC7B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -252,4 +252,9 @@ export declare function isIifeString(t: string): boolean;
|
|
|
252
252
|
* truncatePreview 完全一致(byte-identical)。
|
|
253
253
|
*/
|
|
254
254
|
export declare function truncatePreviewKeepingRefs(s: string): string;
|
|
255
|
+
/**
|
|
256
|
+
* BUG-05 决议 D1:计算「传入但该 action 未消费」的 options 键(导出供测试)。
|
|
257
|
+
* 只对 worked 出口调用(didnt/unknown 路径不标——错误已自解释)。
|
|
258
|
+
*/
|
|
259
|
+
export declare function computeIgnoredOptions(action: string, options: BrowseOptions): string[];
|
|
255
260
|
//# sourceMappingURL=BrowseChannel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowseChannel.d.ts","sourceRoot":"","sources":["../../src/channels/BrowseChannel.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,MAAM,EACN,cAAc,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"BrowseChannel.d.ts","sourceRoot":"","sources":["../../src/channels/BrowseChannel.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,MAAM,EACN,cAAc,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA0C5E;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,MAAM,E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D;AA2ED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,MAAM,EAAE,CAKV"}
|
|
@@ -46,6 +46,9 @@ import { applyOutputEnvelope } from "../util/output-envelope.js";
|
|
|
46
46
|
// BUG-04 决议 B(doc/bugs/04 §5):上游选中页死锁签名单一真源(INV-89 锚)
|
|
47
47
|
import { isUpstreamWedgeError } from "../browse/upstream-wedge.js";
|
|
48
48
|
import { parseEvalResult, evalFence, imageBlock, firstText, } from "../browse/upstream-response.js";
|
|
49
|
+
// BUG-05 决议 E(doc/bugs/05 §6-E):options.screenshot.filePath 写根守卫
|
|
50
|
+
//(LASSO_SCREENSHOT_DIR,默认关=显式 filePath 收紧为拒——任意写盘暴露面收窄)
|
|
51
|
+
import { checkScreenshotTarget, loadScreenshotWriteRoots, } from "../ssrf/screenshot-guard.js";
|
|
49
52
|
// v0.5 M0.5b/M0.5c(parse6 §2.1 + §3.3.3 + §3.4.2):doPdf + doConsole + doNetwork
|
|
50
53
|
// 追加进 actionDispatch Map
|
|
51
54
|
// INV-33 守:pdf + console + network 三 action 必经 dispatch Map,禁第二套 dispatch
|
|
@@ -411,6 +414,9 @@ export class BrowseChannel extends UiChannel {
|
|
|
411
414
|
action,
|
|
412
415
|
...partial,
|
|
413
416
|
});
|
|
417
|
+
// BUG-05 决议 D1(INV-91):传入但该 action 未消费的 options 键诚实标注
|
|
418
|
+
//(空省略 = byte-identical;消费表单一真源 CONSUMED_OPTIONS)
|
|
419
|
+
const ignored = computeIgnoredOptions(action, options);
|
|
414
420
|
return {
|
|
415
421
|
outcome: "worked",
|
|
416
422
|
data: {
|
|
@@ -438,6 +444,10 @@ export class BrowseChannel extends UiChannel {
|
|
|
438
444
|
// v1.17 Phase F(parse24 §6.2 C2 + 冲突 #8):raw 档 + include_refs=true 的
|
|
439
445
|
// 诚实标注(运行时忽略,schema 不拒——宽松进严格出)。缺省关时不填。
|
|
440
446
|
...(partial.ignored_include_refs ? { ignored_include_refs: true } : {}),
|
|
447
|
+
// BUG-05 决议 D1:同族诚实标注的泛化(旧 ignored_include_refs 是本机制
|
|
448
|
+
// 的单字段先例,保留兼容;include_refs 传给非 extract action 现在也进
|
|
449
|
+
// ignored_options 超集标注,不冲突)。
|
|
450
|
+
...(ignored.length > 0 ? { ignored_options: ignored } : {}),
|
|
441
451
|
},
|
|
442
452
|
served_by: this.name,
|
|
443
453
|
fallback_used: false,
|
|
@@ -862,6 +872,22 @@ async function doSnapshot(c, _url, _opts) {
|
|
|
862
872
|
return { title, preview: text, final_url: extractRootWebAreaUrl(text) };
|
|
863
873
|
}
|
|
864
874
|
async function doScreenshot(c, _url, opts) {
|
|
875
|
+
// BUG-05 决议 E1(doc/bugs/05 §6-E,写根守卫——位置铁律):显式 filePath 的
|
|
876
|
+
// 双重 containment 判定必须在**任何上游调用与 mkdir 之前**(三条写路径 +
|
|
877
|
+
// mkdir 全部被前置覆盖,含未来协商 roots 后上游兑现的路径 1)。
|
|
878
|
+
// - filePath 缺省 → 管理路径 /tmp/lasso-screenshot-<uuid>.png,行为零变
|
|
879
|
+
// (byte-identical,默认主路径不动);
|
|
880
|
+
// - filePath 显式 + LASSO_SCREENSHOT_DIR 空 → 拒(didnt)——绝不静默回退
|
|
881
|
+
// 随机 /tmp 名(把错误输入伪装成成功比拒绝更糟,「空输出≠空属性」同族);
|
|
882
|
+
// - filePath 显式 + 写根非空 → 词法 containment ∧ 最近存在祖先 realpath
|
|
883
|
+
// containment 双过才放行(screenshot-guard.ts;决议 E1 第 3 步)。
|
|
884
|
+
const explicitPath = opts.screenshot?.filePath;
|
|
885
|
+
if (explicitPath !== undefined) {
|
|
886
|
+
const guard = checkScreenshotTarget(explicitPath, loadScreenshotWriteRoots().roots);
|
|
887
|
+
if (!guard.allowed) {
|
|
888
|
+
throw new Error(guard.reason);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
865
891
|
// E②(BUG-03 决议 E②,doc/bugs/03 §4 E,消费方②screenshot 根治)双路径:
|
|
866
892
|
// 路径 1(优先):传 filePath 给上游(chrome-devtools-mcp@1.7.0 已支持——
|
|
867
893
|
// 0.3.0 时代被 zod strip 的参数未跟进是当日两次大截图失败的根因:上游
|
|
@@ -879,7 +905,7 @@ async function doScreenshot(c, _url, opts) {
|
|
|
879
905
|
// 走 image block 可用)。修复:isError 且文本含 "Access denied"(路径 1 被
|
|
880
906
|
// 拒)→ 不带 filePath 重试一次(落到路径 2 的两形态:image block 或上游
|
|
881
907
|
// 临时文件文本行);其余 isError 维持原样如实抛。
|
|
882
|
-
const target =
|
|
908
|
+
const target = explicitPath ?? `/tmp/lasso-screenshot-${randomUUID()}.png`;
|
|
883
909
|
let r = (await c.callTool("take_screenshot", {
|
|
884
910
|
format: "png",
|
|
885
911
|
fullPage: opts.screenshot?.full ?? false,
|
|
@@ -1425,6 +1451,66 @@ const NAV_FIRST_ACTIONS = new Set(["network", "screenshot", "pdf"]);
|
|
|
1425
1451
|
// dispatchAction)——无条件 nav-first 会把 root 注册 URL 回灌导航、破坏
|
|
1426
1452
|
// 观察态(r3 原提案的反证,故收敛为空白门控)。
|
|
1427
1453
|
const FRESH_PAGE_NAV_ACTIONS = new Set(["snapshot", "extract"]);
|
|
1454
|
+
// ============================================================
|
|
1455
|
+
// BUG-05 决议 D1(doc/bugs/05 §6,INV-91):per-action 实际消费的 options 键表
|
|
1456
|
+
// ============================================================
|
|
1457
|
+
/**
|
|
1458
|
+
* ignored_options 诚实标注机制的单一真源:表项 = **channel 实际消费键**。
|
|
1459
|
+
*
|
|
1460
|
+
* 纪律(决议 r1 修订):把死键列入消费表会让 ignored_options 机制对其豁免
|
|
1461
|
+
* (调用方传了也零信号),恰是本机制要消灭的静默面——
|
|
1462
|
+
* network_timeout_ms / network_include_bodies 自 v1.11 起「字段保留(zod 契约
|
|
1463
|
+
* 稳定),值被忽略」(cdp-actions.ts 注释明载),故不进 network 表项。
|
|
1464
|
+
*
|
|
1465
|
+
* 实施注(白盒修正,偏离决议 D1 字面表——已回写决议 §6-D1 定稿标注):
|
|
1466
|
+
* 「会导航的 action」(navigate 本尊 + NAV_FIRST 三者无条件 + FRESH_PAGE_NAV
|
|
1467
|
+
* 两者的空白会话先导)都经 doNavigate 消费 no_cache——no_cache 记入这些
|
|
1468
|
+
* action 的表项,防止主流路径(如空白会话首 snapshot 传 no_cache)被误标
|
|
1469
|
+
* ignored。方向性理由:误标(实际消费却被标 ignored,诱导调用方删有效参数)
|
|
1470
|
+
* 比漏标(实际忽略却沉默 = 旧行为)有害。wait/click/fill/evaluate 不导航,
|
|
1471
|
+
* 传 no_cache 属真死键 → 如实标注。
|
|
1472
|
+
*
|
|
1473
|
+
* 入口级消费(browse() 分流,非本表):steps 非空 → StepEngine 链(steps 路径
|
|
1474
|
+
* 不走 browseSingle,无本标注);budget_ms 仅 steps 路径消费——单 action 路径
|
|
1475
|
+
* 传入 budget_ms 会出现在 ignored_options(诚实标注)。
|
|
1476
|
+
*/
|
|
1477
|
+
const CONSUMED_OPTIONS = Object.freeze({
|
|
1478
|
+
navigate: ["no_cache"],
|
|
1479
|
+
/** 空白会话 needsFreshPageNav 先导导航时消费 no_cache(见上实施注) */
|
|
1480
|
+
snapshot: ["no_cache"],
|
|
1481
|
+
/** NAV_FIRST:先导航(消费 no_cache)再截屏(消费 screenshot.full/filePath) */
|
|
1482
|
+
screenshot: ["screenshot", "no_cache"],
|
|
1483
|
+
extract: ["extract_mode", "include_refs", "no_cache"],
|
|
1484
|
+
click: ["selectors"],
|
|
1485
|
+
fill: ["selectors"],
|
|
1486
|
+
wait: ["expect"],
|
|
1487
|
+
evaluate: ["js"],
|
|
1488
|
+
pdf: [
|
|
1489
|
+
"pdf_format",
|
|
1490
|
+
"pdf_landscape",
|
|
1491
|
+
"pdf_print_background",
|
|
1492
|
+
"pdf_margin_top",
|
|
1493
|
+
"pdf_margin_bottom",
|
|
1494
|
+
"pdf_margin_left",
|
|
1495
|
+
"pdf_margin_right",
|
|
1496
|
+
"no_cache",
|
|
1497
|
+
],
|
|
1498
|
+
/** 决议 C(§5):console_level/console_limit 由 doConsole 消费(filterConsoleMessages) */
|
|
1499
|
+
console: ["console_level", "console_limit"],
|
|
1500
|
+
/** network_include_bodies / network_timeout_ms 死键不入表(决议 r1) */
|
|
1501
|
+
network: ["network_filter", "no_cache"],
|
|
1502
|
+
});
|
|
1503
|
+
/**
|
|
1504
|
+
* BUG-05 决议 D1:计算「传入但该 action 未消费」的 options 键(导出供测试)。
|
|
1505
|
+
* 只对 worked 出口调用(didnt/unknown 路径不标——错误已自解释)。
|
|
1506
|
+
*/
|
|
1507
|
+
export function computeIgnoredOptions(action, options) {
|
|
1508
|
+
const consumed = CONSUMED_OPTIONS[action];
|
|
1509
|
+
if (!consumed)
|
|
1510
|
+
return Object.keys(options); // 未注册 action 由 unknown_action 早退拦下,此处防御
|
|
1511
|
+
const set = new Set(consumed);
|
|
1512
|
+
return Object.keys(options).filter((k) => !set.has(k));
|
|
1513
|
+
}
|
|
1428
1514
|
function classifyBrowseError(msg, _action) {
|
|
1429
1515
|
const m = msg.toLowerCase();
|
|
1430
1516
|
if (m.includes("needs_manual_2fa"))
|
|
@@ -1442,6 +1528,11 @@ function classifyBrowseError(msg, _action) {
|
|
|
1442
1528
|
// v1.8(W1-DEF-3 / W1-DEF-5):screenshot 落盘失败是明确「本地交付不可得」→ didnt
|
|
1443
1529
|
if (m.includes("screenshot_write_failed"))
|
|
1444
1530
|
return "didnt";
|
|
1531
|
+
// BUG-05 决议 E1(doc/bugs/05 §6-E):显式 filePath 写根**策略拒** → didnt。
|
|
1532
|
+
// 与 screenshot_write_failed(交付失败)显式分流——不复用前缀:对 agent 是
|
|
1533
|
+
// 不同下一步(前者改参数/配 env 可解,后者重试无益)。
|
|
1534
|
+
if (m.includes("screenshot_path_not_allowed"))
|
|
1535
|
+
return "didnt";
|
|
1445
1536
|
// E④(BUG-03 决议 E④):会话轮换("No page selected" 类)是**瞬态可重试**信号
|
|
1446
1537
|
//(页面被轮换/清空,重 snapshot 即恢复)——显式归 unknown(可重试档)+
|
|
1447
1538
|
// session_rotated 前缀供 agent 透明识别下一步(重 snapshot),不再落泛 unknown
|