@jayyuen66/dsh-scrapling 0.1.17 → 0.2.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/CHANGELOG.md +56 -0
- package/README.md +150 -265
- package/README.zh-CN.md +218 -333
- package/THIRD_PARTY_NOTICES.md +52 -15
- package/bin/dsh-scrapling.mjs +12 -73
- package/client.js +6 -6
- package/docs/DETAIL.md +19 -28
- package/docs/DETAIL.zh.md +24 -33
- package/docs/images/architecture.svg +100 -0
- package/docs/images/architecture.zh.svg +99 -0
- package/docs/images/tool-selection.svg +88 -0
- package/docs/images/tool-selection.zh.svg +88 -0
- package/host.js +23 -46
- package/package.json +64 -62
- package/py/adapters.py +14 -13
- package/py/bridge.py +3 -3
- package/py/crawl.py +1 -1
- package/py/document.py +1 -1
- package/py/documents-requirements.txt +1 -1
- package/py/extraction.py +2 -2
- package/py/media.py +1 -1
- package/py/runtime-requirements.txt +3 -3
- package/py/search.py +3 -2
- package/py/session_page.py +2 -2
- package/runtime-manifest.json +2 -2
package/README.md
CHANGED
|
@@ -12,14 +12,10 @@
|
|
|
12
12
|
<a href="https://github.com/JayYuen666/dsh-scrapling/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-scrapling/ci.yml?branch=main&style=flat-square&label=ci" alt="ci" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/license-MIT-4c1?style=flat-square" alt="MIT" />
|
|
14
14
|
<img src="https://img.shields.io/badge/node-%5E24.22.3%7C%7C%3E%3D26.13.1-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
|
|
15
|
-
<img src="https://img.shields.io/badge/dsh-%5E0.2.3--alpha.
|
|
15
|
+
<img src="https://img.shields.io/badge/dsh-%5E0.2.3--alpha.3-658EFF?style=flat-square" alt="dsh" />
|
|
16
16
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by_dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" /></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
<p align="center">
|
|
20
|
-
<img src="https://skillicons.dev/icons?i=typescript,python,react,nodejs,vitest,githubactions" alt="tech stack" />
|
|
21
|
-
</p>
|
|
22
|
-
|
|
23
19
|
<p align="center">
|
|
24
20
|
<a href="https://github.com/JayYuen666"><img src="https://img.shields.io/badge/GitHub-JayYuen666-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" /></a>
|
|
25
21
|
<a href="mailto:cqwkkj@gmail.com"><img src="https://img.shields.io/badge/Email-cqwkkj@gmail.com-EA4335?style=flat-square&logo=gmail&logoColor=white" alt="Email" /></a>
|
|
@@ -29,34 +25,29 @@
|
|
|
29
25
|
|
|
30
26
|
**A web-scraping extension for [dsh](https://github.com/deepseek-ai/deepseek-harness): [Scrapling](https://github.com/D4Vinci/Scrapling) as agent tools — JavaScript rendering, CSS/XPath extraction with self-healing selectors, sessions with login state, a background crawler and page Q&A. You supply the interpreter and the browser engine; everything runs in one resident Python process.**
|
|
31
27
|
|
|
32
|
-
##
|
|
28
|
+
## Contents
|
|
33
29
|
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [ Install](#-install)
|
|
37
|
-
- [ Shared version floor](#-shared-version-floor)
|
|
30
|
+
- [What it does](#what-it-does)
|
|
31
|
+
- [Install](#install)
|
|
38
32
|
- [Runtime packs (macOS arm64)](#runtime-packs-macos-arm64)
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> What it does
|
|
58
|
-
|
|
59
|
-
dsh ships `web_fetch` and `web_search`. The built-in `web_fetch` is deliberately honest and minimal: a plain HTTP(S) GET with no JavaScript execution and an honest User-Agent. That is a good default — and it means a single-page application yields only its loading shell, and there is no way to ask for "just the product table". Measured on a page whose content exists only after JavaScript runs:
|
|
33
|
+
- [Verify it is live](#verify-it-is-live)
|
|
34
|
+
- [What it does not provide](#what-it-does-not-provide)
|
|
35
|
+
- [Enabling it in dsh](#enabling-it-in-dsh)
|
|
36
|
+
- [The tools](#the-tools)
|
|
37
|
+
- [Replacing the built-in fetch and search](#replacing-the-built-in-fetch-and-search)
|
|
38
|
+
- [MCP mode](#mcp-mode)
|
|
39
|
+
- [Settings](#settings)
|
|
40
|
+
- [Proxies](#proxies)
|
|
41
|
+
- [Security](#security)
|
|
42
|
+
- [Data and privacy](#data-and-privacy)
|
|
43
|
+
- [Known boundaries](#known-boundaries)
|
|
44
|
+
- [Development](#development)
|
|
45
|
+
- [Feedback](#feedback)
|
|
46
|
+
- [License](#license)
|
|
47
|
+
|
|
48
|
+
## What it does
|
|
49
|
+
|
|
50
|
+
dsh ships `web_fetch` and `web_search`. The built-in `web_fetch` is deliberately honest and minimal: a plain HTTP(S) GET with no JavaScript execution and an honest User-Agent. That is a good default — and it means a single-page application yields only its loading shell. Measured on a page whose content exists only after JavaScript runs:
|
|
60
51
|
|
|
61
52
|
| Pipeline | Text obtained |
|
|
62
53
|
|---|---|
|
|
@@ -64,15 +55,17 @@ dsh ships `web_fetch` and `web_search`. The built-in `web_fetch` is deliberately
|
|
|
64
55
|
| `Fetcher` (curl_cffi, still no JS) | `SPA Shell / LOADING_PLACEHOLDER` |
|
|
65
56
|
| browser render (patchright) | full rendered DOM, Markdown table, structured rows |
|
|
66
57
|
|
|
58
|
+

|
|
59
|
+
|
|
67
60
|
This package adds what the built-ins structurally cannot do:
|
|
68
61
|
|
|
69
62
|
- **Browser rendering** — JavaScript execution via patchright.
|
|
70
63
|
- **Structured extraction** — CSS/XPath selection returning data, not a wall of Markdown.
|
|
71
64
|
- **Self-healing selectors** — Scrapling's `adaptive` mode relocates an element after the site's markup changes; a selector that returns `None` after a class rename returns the relocated element with `adaptive` on.
|
|
72
65
|
|
|
73
|
-
Everything runs against **one long-lived Python process**. That is not an optimisation: Scrapling's session classes keep cookies, the browser engines keep a page pool, and `adaptive` keeps a SQLite fingerprint database — a process per call would throw all of that away. Tools are registered **conditionally**: the plugin probes what the environment can actually do at startup and registers only what will work, so the model never burns a turn on a tool that was guaranteed to fail. Every tool renders its result row through the official tool-call view slot. `scrapling_answer` is the only tool that spends **another model call
|
|
66
|
+
Everything runs against **one long-lived Python process**. That is not an optimisation: Scrapling's session classes keep cookies, the browser engines keep a page pool, and `adaptive` keeps a SQLite fingerprint database — a process per call would throw all of that away. Tools are registered **conditionally**: the plugin probes what the environment can actually do at startup and registers only what will work, so the model never burns a turn on a tool that was guaranteed to fail. Every tool renders its result row through the official tool-call view slot. `scrapling_answer` is the only tool that spends **another model call**.
|
|
74
67
|
|
|
75
|
-
##
|
|
68
|
+
## Install
|
|
76
69
|
|
|
77
70
|
```sh
|
|
78
71
|
dsh plugin --profile web add @jayyuen66/dsh-scrapling
|
|
@@ -80,9 +73,9 @@ dsh plugin --profile web add @jayyuen66/dsh-scrapling
|
|
|
80
73
|
|
|
81
74
|
Remove with `dsh plugin --profile web remove @jayyuen66/dsh-scrapling`. The package is on the public npm registry, so installation needs no credentials and no scoped-registry line.
|
|
82
75
|
|
|
83
|
-
- **Requires Node.js `^24.22.3 || >=26.13.1`.**
|
|
84
|
-
- **Requires host `dsh` at the `0.2.3-alpha.
|
|
85
|
-
- **Requires Python 3.14+ with Scrapling installed** — named by `pythonBin`, or found by the fixed chain
|
|
76
|
+
- **Requires Node.js `^24.22.3 || >=26.13.1`.** The declared range is the host floor, not the Node 22.18 type-stripping line: `0.2.3` hosts declare that range (Node 25 sits outside it), and a host below it never starts.
|
|
77
|
+
- **Requires host `dsh` at the `0.2.3-alpha.3` line or later.** The requirement the host actually reads is `engines.dsh` (`^0.2.3-alpha.3`), and it decides alone; a host on a later line is refused and needs the explicit risk grant `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`. The support window rolls, so the version number in this bullet is not a standing promise.
|
|
78
|
+
- **Requires Python 3.14+ with Scrapling installed** — named by `pythonBin`, or found by the fixed chain (managed venv on macOS arm64 → repository `_env/.venv` in a source checkout → `python3`/`python` on `PATH`). Whichever one is chosen is logged at load time, and a missing Scrapling reports an error carrying the install line to copy:
|
|
86
79
|
|
|
87
80
|
```sh
|
|
88
81
|
pip install "scrapling[rag]>=0.5,<0.6"
|
|
@@ -90,15 +83,11 @@ python -m patchright install chromium
|
|
|
90
83
|
```
|
|
91
84
|
|
|
92
85
|
- **Why `rag` and not `fetchers`:** `rag` is `fetchers` plus `markdownify`, and the default `extractionType` is `markdown` — with plain `fetchers` the first fetch raises `ModuleNotFoundError` at the Markdown conversion.
|
|
93
|
-
- **Version range:** developed and verified against Scrapling **0.5**, through interfaces that are not stable API surface (`Selector`, `Spider`, `SessionManager`, and the converter's noise-stripping helpers). The upper bound is pinned below `0.6
|
|
94
|
-
- **Without the installer, the browser engine is yours.** The optional CLI can install the verified macOS arm64 set; the plugin itself downloads nothing at load time. Without a browser it simply does not register the browser-dependent tools
|
|
95
|
-
- **
|
|
96
|
-
- **No `@deepseek-ai/*` under `dependencies`, by contract** (`test/publish-manifest.test.ts` enforces it). Consumer profiles install with `nodeLinker: hoisted` and `autoInstallPeers: false`, so a host package there becomes a real second copy whose module-level state splits from the running host's — every native tool call then throws while build and tests stay green. The host packages the artifact imports for value are required peers and stay externalized; the gate imports the built artifact and asserts that no host package body is inlined.
|
|
86
|
+
- **Version range:** developed and verified against Scrapling **0.5.1**, through interfaces that are not stable API surface (`Selector`, `Spider`, `SessionManager`, and the converter's noise-stripping helpers). The upper bound is pinned below `0.6`.
|
|
87
|
+
- **Without the installer, the browser engine is yours.** The optional CLI can install the verified macOS arm64 set; the plugin itself downloads nothing at load time. Without a browser it simply does not register the browser-dependent tools.
|
|
88
|
+
- **No `@deepseek-ai/*` under `dependencies`.** Consumer profiles install with `nodeLinker: hoisted` and `autoInstallPeers: false`, so a host package there becomes a real second copy whose module-level state splits from the running host's. The host packages the artifact imports for value are required peers and stay externalized; `test/publish-manifest.test.ts` asserts that no host package body is inlined.
|
|
97
89
|
- **The artifact is ESM-only and never committed** — `prepack` rebuilds it, so what ships is always what the current source produces.
|
|
98
|
-
|
|
99
|
-
### <img src="https://api.iconify.design/lucide/arrow-down-to-line.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Shared version floor
|
|
100
|
-
|
|
101
|
-
If your profile pins `@jayyuen66/dsh-plugin-shared` with a pnpm `overrides` entry, that pin must be at least the version this package declares. A lower pin installs a copy without the names the sources use, and the host then reports `N entries did not activate` together with `does not provide an export named ...` at boot - the package installs fine and never loads, and no per-repository CI run can see it.
|
|
90
|
+
- If your profile pins `@jayyuen66/dsh-plugin-shared` with a pnpm `overrides` entry, that pin must be at least the version this package declares: a lower pin installs a copy without the names the sources use, and the host reports `N entries did not activate` with `does not provide an export named ...` at boot — the package installs fine and never loads.
|
|
102
91
|
|
|
103
92
|
## Runtime packs (macOS arm64)
|
|
104
93
|
|
|
@@ -110,42 +99,37 @@ dsh-scrapling setup --feature browser --apply
|
|
|
110
99
|
dsh-scrapling setup --status
|
|
111
100
|
```
|
|
112
101
|
|
|
113
|
-
- `core` installs managed Python 3.14.9, Scrapling 0.5.1 and its pinned wheels; `browser` adds the full Chromium build
|
|
114
|
-
- `
|
|
115
|
-
- `--
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- `dsh.bundle.patch` points at `cordis.patch.yml`, which carries a `- id: dsh-plugin-shared` supplier row (keep it enabled; disabling it removes the cards' shared component supply) plus the `- id: scrapling` entry with the **bare package name** — the host scans `dsh.client` on bare package-name entries only. The card components come from the shared client row, externalized as `@jayyuen66/dsh-plugin-shared/client`; the host module table provides `react`, `zod` and that shared row.
|
|
140
|
-
- The client half registers two surfaces: the settings card (on the `plugins.bundle.config` slot, keyed by the bundle package name — the host dispatches `entryKey: pkg.name`, so the card renders on this package's detail page) and one result row per tool on `tool.call.toolview`, drawn with the official tool-call view props.
|
|
141
|
-
- The settings namespace is the entry id `scrapling`; precedence is settings-card value > registration-line `config:` > schema default. Setting a field back to its default saves a **clear-override**, not a write of the same value, so a later default change still reaches you.
|
|
142
|
-
- Most card values are read per call — extraction and browser knobs, the five output budgets, `fetchTimeoutMs`, `answerMaxTokens`, the answer route and the search-provider settings — so a saved change reaches the **next tool call**. The assembly-time set needs a restart: the sixteen tool switches, `provideWebFetch` / `provideWebSearch`, `pythonBin`, `failFastOnMissingPython`, `dataDir`, `sidecarHandshakeTimeoutMs` / `sidecarGraceMs`, and the URL-gate / sidecar-environment values (`proxyUrl`, `proxyBypass`, `allowedHosts`, `nat64Prefixes`, `syntheticDnsRanges`).
|
|
143
|
-
- Disabling a tool also removes its guidance, in two layers: the **resident section is a single summary** (cross-tool selection rules, naming no specific tool), while the sixteen per-tool lines are registered as a virtual skill `scrapling`. Both are re-read at each prompt assembly against the tools that scope can actually see — a machine without a browser loses the render / capture_xhr lines from the skill body, and a sidecar that never came up gets **neither the section nor the skill** (registering an empty skill would only put a catalog entry that opens to nothing). Without the host's skill service (a trimmed profile) the plugin still composes normally, it just lacks that skill and the summary drops its "full guidance lives in the skill" pointer. The section is placed next to the built-in `web_fetch` guidance.
|
|
102
|
+
- `core` installs managed Python 3.14.9, Scrapling 0.5.1 and its pinned wheels; `browser` adds the full Chromium build. `search`, `media`, `documents`, `mcp` and `adaptive-redis` ride on `core`'s venv: `documents` adds pinned pypdf 7.2.0, `mcp` brings the official `scrapling-mcp` server that `official-mcp` mode needs, and `adaptive-redis` brings the `redis` client. The settings card reports each pack as `ready`, `missing`, `corrupt` or `installing` and can start the same install / repair / cancel actions as a background job.
|
|
103
|
+
- `--feature` is a dry run by default; `--apply` writes. `--repair` re-installs without touching user data, and `--uninstall <pack> [--purge]` removes runtime files.
|
|
104
|
+
- `--offline <dir>` installs with no network at all (Python archive + a hash-locked `wheels/` directory); a missing asset fails as `INSTALL_OFFLINE_ASSETS` instead of silently going online. `setup --status --profile <dir>` reads that profile's `pythonBin` / `dataDir` and reports the packs for that directory.
|
|
105
|
+
- Only **macOS arm64** is verified. Windows, Linux and macOS x64 are blocked: every pack reports `blocked` and the installer refuses rather than guessing an asset path.
|
|
106
|
+
|
|
107
|
+
## Verify it is live
|
|
108
|
+
|
|
109
|
+
1. **The layer is mounted.** `dsh --profile web --dump-config` shows this package's layer line. That command is **not read-only** (it rewrites the profile's root assembly file); read stdout **and** stderr separately, and accept both `# == <layer>` and `# == <layer>, patched by <path>`.
|
|
110
|
+
2. **The startup log names the interpreter and the plan.** One line prints the probed capabilities and how many of the tools registered; the chosen interpreter path is logged at load.
|
|
111
|
+
3. **The settings card renders** on the plugin detail page, grouped by purpose; toggling a value enables Save, and the write returns 200.
|
|
112
|
+
4. **A tool round-trip.** Ask the model to fetch a JavaScript-heavy page: the result row renders in the chat through the official tool-call view. On a machine without a browser the render / capture_xhr tools are absent from the model's tool list and their guidance is gone from the skill body too — that absence is the conditional registration working, not a failure. If **every** tool is missing, the sidecar did not start: the startup log names the chosen interpreter, and a missing Scrapling carries the `pip install` line to copy.
|
|
113
|
+
|
|
114
|
+
## What it does not provide
|
|
115
|
+
|
|
116
|
+
- **It is not a search engine.** Discovery uses one of seven concrete backends, or `searchBackend: auto` to pick from the configured discovery paths. Six run in the Python sidecar; `deepseek` runs in Host through optional `ctx.deepseekAuth`. A selected backend without credentials reports `SEARCH_AUTH` instead of silently switching.
|
|
117
|
+
- **The npm tarball bundles no interpreter or browser.** They come from your machine or from the optional CLI installer; missing pieces remove the matching tools instead of being fetched at load time.
|
|
118
|
+
- **It adds no HTTP route on the host side.** The one socket that really listens is the MCP server under `integrationMode: mcp`, bound to `127.0.0.1`: any other path gets 404, a declared body over 1 MiB gets 411/413, and the bearer token is read only from `DSH_SCRAPLING_MCP_TOKEN` — with no token set, startup prints a stderr notice that the endpoint is unauthenticated and reachable from any local process.
|
|
119
|
+
- **It adds no dsh subcommand.** The package's own `dsh-scrapling` CLI manages runtime packs and the manual half of the MCP hookup (`setup --mode native|mcp|official-mcp`, `doctor --mode`).
|
|
120
|
+
|
|
121
|
+
## Enabling it in dsh
|
|
122
|
+
|
|
123
|
+
- `dsh.bundle.patch` points at `cordis.patch.yml`, which carries a `- id: dsh-plugin-shared` supplier row (keep it enabled; disabling it removes the cards' shared component supply) plus the `- id: scrapling` entry with the **bare package name**. The card components come from the shared client row, externalized as `@jayyuen66/dsh-plugin-shared/client`; the host module table provides `react`, `zod` and that shared row.
|
|
124
|
+
- The client half registers two surfaces: the settings card (keyed by the bundle package name) and one result row per tool on `tool.call.toolview`, drawn with the official tool-call view props.
|
|
125
|
+
- The settings namespace is the entry id `scrapling`; precedence is settings-card value > registration-line `config:` > schema default. Setting a field back to its default saves a **clear-override**, not a write of the same value.
|
|
126
|
+
- Most card values are read per call, so a saved change reaches the **next tool call**. The assembly-time set needs a restart: the sixteen tool switches, `provideWebFetch` / `provideWebSearch`, `pythonBin`, `failFastOnMissingPython`, `dataDir`, the timeout pair, and the URL-gate / sidecar-environment values.
|
|
127
|
+
- Disabling a tool also removes its guidance, in two layers: the **resident section is a single summary** carried as `guidance` on every tool definition, while the sixteen per-tool lines are registered as a virtual skill `scrapling`. The host renders the section only while the viewing scope still resolves at least one of those definitions — which covers native declarations, PTC program bindings, `restrict()` and shadowing alike. In `mcp` and `official-mcp` the plugin registers the same summary as a plain section itself.
|
|
144
128
|
- `scrapling_crawl` registers its own job kind, so `job_list` labels its jobs as crawls rather than shell jobs.
|
|
145
129
|
|
|
146
|
-
##
|
|
130
|
+
## The tools
|
|
147
131
|
|
|
148
|
-
Twenty tools, behind sixteen settings switches (the
|
|
132
|
+
Twenty tools, behind sixteen settings switches (the nine session tools share five of those switches), all exercised by the test suite:
|
|
149
133
|
|
|
150
134
|
| Tool | Backend | Needs a browser | Concurrency |
|
|
151
135
|
|---|---|---|---|
|
|
@@ -164,101 +148,65 @@ Twenty tools, behind sixteen settings switches (the seven session/state tools sh
|
|
|
164
148
|
| `scrapling_crawl` | Scrapling Spider framework (`content` / `sitemap` / `feed` / `shopify`) as a job | no | serialised |
|
|
165
149
|
| `scrapling_answer` | any fetch path plus `ctx.llm` | with `render: true` | serialised |
|
|
166
150
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
-
|
|
151
|
+

|
|
152
|
+
|
|
153
|
+
- **Quotas.** At most 8 open sessions (3 of them browser sessions), 2 crawls in flight, per-page bodies clipped by `*MaxOutputChars`, 8 MB per protocol frame, 16 queued frames. A ceiling answers with a specific code (`SESSION_LIMIT` / `CRAWL_BUSY` / `BAD_FRAME`) the model can back off from.
|
|
154
|
+
- **`scrapling_crawl` returns a job id immediately.** Watch it with `job_list`, read it with `job_output`, stop it with `job_kill`; a profile without a jobs registry simply does not register it. The crawl has a wall-clock ceiling (`crawlMaxRuntimeSeconds`) and never leaves the start domain.
|
|
155
|
+
- **`scrapling_answer` fetches the page first, then hands the text plus your question to a model.** It follows the model the current session is already using by default; pin `answerProvider` / `answerModel` to route page-reading elsewhere. When the host exposes a model catalog and that catalog is non-empty without your pinned route, the call is refused up front with `ANSWER_MODEL_UNKNOWN` naming the provider and model; an empty, unreachable or throwing catalog never blocks a request. Page text is **untrusted input** — the prompt frames it explicitly as data, but that defence is prompt-level: it lowers the risk, it does not remove it.
|
|
170
156
|
|
|
171
157
|
### Browser sessions, ARIA and drag
|
|
172
158
|
|
|
173
|
-
`sessionType=remote` appears only when the sidecar reports `RemoteSession` support and deployment config sets `browserCdpUrl` to a `ws://`, `wss://`, `http://` or `https://` endpoint. It connects to an already-running Chromium and creates an isolated context;
|
|
159
|
+
`sessionType=remote` appears only when the sidecar reports `RemoteSession` support and deployment config sets `browserCdpUrl` to a `ws://`, `wss://`, `http://` or `https://` endpoint. It connects to an already-running Chromium and creates an isolated context; the endpoint is a strong capability and never enters model input.
|
|
174
160
|
|
|
175
|
-
`scrapling_session_read` accepts `snapshotType: "text" | "aria"` (default `text`). ARIA uses Patchright's AI-mode accessibility snapshot and can be narrowed with `cssSelector
|
|
161
|
+
`scrapling_session_read` accepts `snapshotType: "text" | "aria"` (default `text`). ARIA uses Patchright's AI-mode accessibility snapshot and can be narrowed with `cssSelector`.
|
|
176
162
|
|
|
177
|
-
`scrapling_session_act` adds `type: "drag"` in two exclusive forms: `
|
|
163
|
+
`scrapling_session_act` adds `type: "drag"` in two exclusive forms: selectors (`from`/`to`) or coordinates (`fromX`/`fromY`/`toX`/`toY`). It still requires `allowBrowserActions: true`.
|
|
178
164
|
|
|
179
165
|
### Render or static
|
|
180
166
|
|
|
181
167
|
`scrapling_render` is much slower and heavier than `scrapling_fetch`, so start static. Two criteria:
|
|
182
168
|
|
|
183
|
-
- **If the rendered result is shorter than the static fetch, go back to static.**
|
|
184
|
-
- **`waitSelector` waits for an element to appear, not for content to settle.** The element can be removed after it matched
|
|
169
|
+
- **If the rendered result is shorter than the static fetch, go back to static.** Sites that ship readable text and then swap it for canvas / Lottie animation can only lose content through rendering — that is site behaviour, not a plugin defect.
|
|
170
|
+
- **`waitSelector` waits for an element to appear, not for content to settle.** The element can be removed after it matched.
|
|
185
171
|
|
|
186
|
-
One thing that is not a criterion but worth knowing: axis ticks inside SVG **cannot be fetched at all** — the Markdown conversion emits no `<svg>` / `<text>` nodes
|
|
172
|
+
One thing that is not a criterion but worth knowing: axis ticks inside SVG **cannot be fetched at all** — the Markdown conversion emits no `<svg>` / `<text>` nodes. For actual values, go through `scrapling_capture_xhr` to locate the JSON endpoint.
|
|
187
173
|
|
|
188
|
-
##
|
|
174
|
+
## Replacing the built-in fetch and search
|
|
189
175
|
|
|
190
|
-
The plugin registers itself as a **fetch provider** and a **search provider** on `ctx.web`, so the built-in
|
|
176
|
+
The plugin registers itself as a **fetch provider** and a **search provider** on `ctx.web`, so the built-in tools can run on Scrapling instead of dsh's plain-HTTP implementation. Both providers stay registered even while the sidecar is down (the host's provider list does not filter by availability, and its ambiguity check only counts usable providers), and both declare `title` / `description` for the provider picker.
|
|
191
177
|
|
|
192
178
|
1. leave `provideWebFetch` / `provideWebSearch` at their default (`true`);
|
|
193
179
|
2. set `fetchProvider` / `searchProvider` to `"scrapling"` in the **deployment** config.
|
|
194
180
|
|
|
195
|
-
Both content-reading paths share `webFetchStrategy` (default `auto`): `static` always reads statically; `auto` reads statically first and renders only when the body is under 200 characters; `browser` renders directly. Without a browser, `auto` stays static.
|
|
181
|
+
Both content-reading paths share `webFetchStrategy` (default `auto`): `static` always reads statically; `auto` reads statically first and renders only when the body is under 200 characters; `browser` renders directly. Without a browser, `auto` stays static.
|
|
196
182
|
|
|
197
|
-
A configured id wins over auto-selection, which is why step 2 is required —
|
|
183
|
+
A configured id wins over auto-selection, which is why step 2 is required — with two usable providers and no id named, `ctx.web` answers `WEB_PROVIDER_AMBIGUOUS` and the tool becomes unavailable outright. Two consequences of pointing that line at this plugin:
|
|
198
184
|
|
|
199
|
-
- **If the sidecar cannot start, the built-in `web_fetch` reports `WEB_PROVIDER_CONFIGURED_UNAVAILABLE`** rather than quietly falling back to plain HTTP.
|
|
200
|
-
- **
|
|
201
|
-
- **The fetch provider really applies the output budget**: a body over `fetchMaxOutputChars` is cut to a head/tail window and flagged `truncated`, not passed through with a flag. Failures keep the sidecar code prefix (`URL_BLOCKED`, `SIDECAR_TIMEOUT`, `SIDECAR_UNAVAILABLE`), so a policy refusal is distinguishable from a crash or a timeout.
|
|
185
|
+
- **If the sidecar cannot start, the built-in `web_fetch` reports `WEB_PROVIDER_CONFIGURED_UNAVAILABLE`** rather than quietly falling back to plain HTTP; if you remove the plugin but leave the line in, the built-in tools report `WEB_PROVIDER_CONFIGURED_MISSING` — go back and remove `fetchProvider` / `searchProvider` too.
|
|
186
|
+
- **The fetch provider really applies the output budget** and carries the sidecar error-code prefix (`URL_BLOCKED`, `SIDECAR_TIMEOUT`, `SIDECAR_UNAVAILABLE`), so a policy refusal is distinguishable from a crash or a timeout.
|
|
202
187
|
|
|
203
|
-
Search is split in two
|
|
188
|
+
Search is split in two: **discovery** uses `searchBackend` (Tavily, Bing HTML, Brave, Serper, DuckDuckGo HTML, SearXNG, or DeepSeek's direct Search API through optional `ctx.deepseekAuth`); **reading** stays this plugin's — the first `searchRenderTopN` results are fetched according to `webFetchStrategy`. `auto` keeps the Tavily → SearXNG → explicitly allowed public-engine order. Source URLs are canonicalized (fragments and tracking parameters removed) and deduplicated before citation, successful discovery is cached in memory for 300 seconds with at most 128 entries (cache keys never contain key values), and every returned URL goes through the same gate as a fetch; a page that fails to read is skipped alone.
|
|
204
189
|
|
|
205
|
-
|
|
190
|
+
## MCP mode
|
|
206
191
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
## <img src="https://api.iconify.design/lucide/plug-zap.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> MCP mode
|
|
210
|
-
|
|
211
|
-
`integrationMode` selects one of three mutually exclusive tool surfaces. It is deployment configuration (the `config:` block of `cordis.patch.yml`), it is read once when the plugin is assembled, and changing it requires a restart.
|
|
212
|
-
|
|
213
|
-
`mcpToolLoading` is deployment-only too and defaults to `eager`, which keeps the existing behavior of putting the server's tools directly into the tool list. Set it to `on-demand` when those definitions are too large to send with every request: the system prompt then lists each raw tool name with the first line of its description, and the model loads what it needs through `mcp__scrapling__load_tools`. Loaded tools join only the calling agent's list; subagents, forks and resumed sessions start empty. The value is passed to both dynamic `mcpManager` registration and `setup`-generated manual entries as `toolLoading`; changing it requires a restart. For a manual entry, also rerun `setup --mode <mode> --profile <profileDir> --apply` and reapply the generated patch — restarting alone does not rewrite that entry.
|
|
192
|
+
`integrationMode` selects one of three mutually exclusive tool surfaces. It is deployment configuration, read once when the plugin is assembled, and changing it requires a restart.
|
|
214
193
|
|
|
215
194
|
| Mode | What it registers |
|
|
216
195
|
|---|---|
|
|
217
196
|
| `native` (default) | the `scrapling_*` tools listed above |
|
|
218
197
|
| `mcp` | no native tools; the plugin serves the same tool table over MCP |
|
|
219
|
-
| `official-mcp` | no native tools and no server from this plugin;
|
|
198
|
+
| `official-mcp` | no native tools and no server from this plugin; it hooks the official `scrapling-mcp` — dynamically via `mcpManager` where mounted, otherwise a `dsh-mcp-client` entry. Its own process, its own sessions, **no URL guard from this plugin** |
|
|
220
199
|
|
|
221
|
-
|
|
200
|
+
`mcpToolLoading` is deployment-only and defaults to `eager`, which puts the server's tools directly into the tool list. Set it to `on-demand` when those definitions are too large to send with every request: the prompt then lists each raw tool name with the first line of its description, and the model loads what it needs through `mcp__scrapling__load_tools`. Loaded tools join only the calling agent's list; subagents, forks and resumed sessions start empty. The value is passed to both dynamic registration and manual entries as `toolLoading`; changing it requires a restart, and manual entries must be regenerated with `setup --mode <mode> --profile <profileDir> --apply`.
|
|
222
201
|
|
|
223
|
-
- **Endpoint
|
|
224
|
-
- **
|
|
225
|
-
- **
|
|
226
|
-
- **Results** are text content; a screenshot comes back as MCP image content instead of a host attachment. A failing tool returns `isError` with a readable message rather than dropping the connection.
|
|
227
|
-
- **Names**: the MCP raw name is the tool name without the `scrapling_` prefix, and dsh's MCP client shows it as `mcp__scrapling__<raw>`.
|
|
228
|
-
|
|
229
|
-
| Native tool | MCP raw name |
|
|
230
|
-
|---|---|
|
|
231
|
-
| `scrapling_fetch` | `fetch` |
|
|
232
|
-
| `scrapling_extract` | `extract` |
|
|
233
|
-
| `scrapling_locate` | `locate` |
|
|
234
|
-
| `scrapling_links` | `links` |
|
|
235
|
-
| `scrapling_render` | `render` |
|
|
236
|
-
| `scrapling_capture_xhr` | `capture_xhr` |
|
|
237
|
-
| `scrapling_session_open` | `session_open` |
|
|
238
|
-
| `scrapling_session_fetch` | `session_fetch` |
|
|
239
|
-
| `scrapling_session_network` | `session_network` |
|
|
240
|
-
| `scrapling_session_state_save` | `session_state_save` |
|
|
241
|
-
| `scrapling_session_state_load` | `session_state_load` |
|
|
242
|
-
| `scrapling_session_list` | `session_list` |
|
|
243
|
-
| `scrapling_session_close` | `session_close` |
|
|
244
|
-
| `scrapling_crawl` | `crawl` |
|
|
245
|
-
| `scrapling_session_read` | `session_read` |
|
|
246
|
-
| `scrapling_session_act` | `session_act` |
|
|
247
|
-
| `scrapling_download` | `download` |
|
|
248
|
-
| `scrapling_read_document` | `read_document` |
|
|
249
|
-
| `scrapling_screenshot` | `screenshot` |
|
|
250
|
-
| — (`ctx.web` only) | `search` |
|
|
251
|
-
|
|
252
|
-
On a host that exposes the `mcpManager` service (the rc.2 web/desktop bundle) the plugin registers its server there at load: no `dsh-mcp-client` install and no profile entry are needed, and `mcpPort` alone decides the endpoint. The manual entry below is for CLI/headless profiles, where that service is absent. If an upgraded profile still carries the manual entry, remove it when relying on dynamic registration - otherwise the manager refuses the duplicate server name and the old entry keeps serving.
|
|
253
|
-
|
|
254
|
-
Connecting dsh needs `@deepseek-ai/dsh-mcp-client`, which this plugin deliberately does not depend on. Pin the exact build matching the host version - npm `latest` is older than the host's own line, and the client's peer versions are literal, so one prerelease off installs but never activates. `0.2.3-alpha.2` is the default; a host still on rc.1 takes `0.2.2-rc.1`, and `next` tracks the official beta line:
|
|
202
|
+
- **`mcp` mode** runs the server inside the plugin's own host process and calls the same sidecar — the URL guard, sessions, jobs and adaptive storage are the same ones the native tools use. Endpoint `http://127.0.0.1:<mcpPort>/mcp` (default `39217`), loopback only; a declared body over 1 MiB gets `413`, any other path gets `404`. Auth: set `DSH_SCRAPLING_MCP_TOKEN` and every request must carry `Authorization: Bearer <token>`; the token is only ever read from the environment. Tools are the same `ToolDefinition` objects native registers; `scrapling_answer` is not served (an external client has no session model), and a `search` tool exists only on this surface. MCP raw names drop the `scrapling_` prefix (`mcp__scrapling__fetch`, …).
|
|
203
|
+
- **On a host exposing `mcpManager`** (mounted by the `web-app` and `sdk-app` bundles) the plugin registers its server at load: no `dsh-mcp-client` install and no profile entry needed. If an upgraded profile still carries a manual entry, remove it when relying on dynamic registration — otherwise the manager refuses the duplicate server name.
|
|
204
|
+
- **Manual hookup (CLI/headless)** needs `@deepseek-ai/dsh-mcp-client` pinned to the host's exact build (`0.2.3-alpha.3` by default; `0.2.2-rc.5` / `0.2.2-rc.1` for exempted old hosts, `next` tracks the beta line):
|
|
255
205
|
|
|
256
206
|
```bash
|
|
257
|
-
dsh plugin --profile <name> add @deepseek-ai/dsh-mcp-client@0.2.3-alpha.
|
|
207
|
+
dsh plugin --profile <name> add @deepseek-ai/dsh-mcp-client@0.2.3-alpha.3
|
|
258
208
|
```
|
|
259
209
|
|
|
260
|
-
Then add one entry to that profile's `cordis.patch.yml` — this is exactly what `dsh-scrapling setup --mode mcp` prints, so you can also let the CLI write it (drop `headers` when no token is configured):
|
|
261
|
-
|
|
262
210
|
```yaml
|
|
263
211
|
- insert:
|
|
264
212
|
- id: scrapling-mcp
|
|
@@ -269,98 +217,59 @@ Then add one entry to that profile's `cordis.patch.yml` — this is exactly what
|
|
|
269
217
|
url: http://127.0.0.1:39217/mcp
|
|
270
218
|
failOnStartupError: false
|
|
271
219
|
toolLoading: eager
|
|
272
|
-
# only with DSH_SCRAPLING_MCP_TOKEN set:
|
|
273
|
-
# headers:
|
|
274
|
-
# Authorization: !!js '`Bearer ${process.env.DSH_SCRAPLING_MCP_TOKEN}`'
|
|
275
220
|
```
|
|
276
221
|
|
|
277
|
-
`mcpPort` and
|
|
222
|
+
`failOnStartupError` is `false` on purpose: the port only starts listening once the plugin has handshaked with the Python sidecar, so the first connect at host startup is bound to fail and the client's reconnect absorbs it. `mcpPort` and the URL have to say the same thing; after changing the port, re-apply the entry.
|
|
278
223
|
|
|
279
|
-
`
|
|
224
|
+
### `setup --mode` and `doctor`
|
|
280
225
|
|
|
281
|
-
|
|
226
|
+
`dsh-scrapling setup --mode mcp [--port <port>] [--with-auth] [--apply]` prints or writes the entry text to `<dataDir>/mcp/<mode>.patch.yml` (the profile itself is never touched — applying it stays your action); `dsh-scrapling doctor --mode mcp --profile <profileDir>` reads what the profile actually says and prints one line per problem (duplicate `serverName`, mode mismatches, port disagreement, a missing or wrongly pinned `dsh-mcp-client`, an official entry while `officialMcpEnabled` is off). Exit `0` is consistent, `1` names a problem, `2` is a bad argument.
|
|
282
227
|
|
|
283
|
-
`setup
|
|
228
|
+
`setup` for `official-mcp` asks for two separate statements before it writes anything: `officialMcpEnabled: true` in the profile and `--accept-risk` on the command line (`OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED` otherwise). Both generated and dynamically registered official entries carry `startupTimeoutMs: 60000` (`OFFICIAL_MCP_STARTUP_TIMEOUT_MS`): the managed server is a Python process that imports the scrapling dependency chain on first start, so the host default of 30s can expire on a slow machine. The binary comes from the `mcp` pack (`setup --feature mcp --apply`).
|
|
284
229
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
dsh-scrapling doctor --mode mcp --profile <profileDir>
|
|
289
|
-
```
|
|
230
|
+
## Settings
|
|
231
|
+
|
|
232
|
+
Settings live on the **scrapling** card in the plugin detail page, and the card is their documentation: every field is grouped by purpose and carries a one-line "what changes if you edit this" in the host's language, so there is no second knob list in this README to drift out of date. The card's language follows the host locale; values are validated by the same schema that renders the card.
|
|
290
233
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
`setup` for `official-mcp` asks for two separate statements before it writes anything: `officialMcpEnabled: true` in the profile and `--accept-risk` on the command line; missing either one prints `OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED` and writes nothing. At load time the host-side path is gated by `officialMcpEnabled` alone: a host exposing `mcpManager` registers the managed `scrapling-mcp` directly, while the `setup`-generated `dsh-mcp-client` entry is the fallback for CLI/headless profiles. Either path starts `<dataDir>/runtime/venv/bin/scrapling-mcp`, so run `setup --feature mcp --apply` first - see [Runtime packs](#runtime-packs-macos-arm64). When that binary is missing, `setup` prints a line saying so.
|
|
294
|
-
|
|
295
|
-
## <img src="https://api.iconify.design/lucide/sliders-horizontal.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Settings
|
|
296
|
-
|
|
297
|
-
Settings live on the **scrapling** card in the plugin detail page, grouped by purpose, each field with a one-line "what changes if you edit this". The card's language follows the host locale. Values marked below live on the card; the deployment table after them is only settable through the `config:` block of `cordis.patch.yml`.
|
|
298
|
-
|
|
299
|
-
| Field | Type | Default | Purpose |
|
|
300
|
-
| --- | --- | --- | --- |
|
|
301
|
-
| `pythonBin` | string | `""` | Interpreter name or absolute path. Empty walks the fixed chain in `lib/runtime.ts`: the managed venv `dataDir/runtime/venv` (where `setup --feature core --apply` installs every wheel), then the bare managed interpreter `dataDir/runtime/python/<version>` (an install that stopped halfway), then the repository `_env/.venv` when usable (a source checkout only), then `python3` on `PATH` (`python` on Windows) |
|
|
302
|
-
| `failFastOnMissingPython` | boolean | `true` | Refuses to load when the sidecar process cannot start (wrong path, protocol mismatch, handshake timeout). An interpreter that starts but lacks Scrapling always degrades to "tools unavailable" with the path named in the log, whatever this switch says |
|
|
303
|
-
| `fetchEnabled` / `extractEnabled` / `locateEnabled` / `linksEnabled` / `renderEnabled` / `captureXhrEnabled` / `networkEnabled` / `sessionEnabled` / `sessionStateEnabled` / `crawlEnabled` / `answerEnabled` / `sessionReadEnabled` / `sessionActionsEnabled` / `downloadEnabled` / `documentsEnabled` / `screenshotEnabled` | boolean | `true` | One kill switch per tool or tool pair. `sessionStateEnabled` gates the state save / load pair, which also needs a deployment-side `sessionStateDir` |
|
|
304
|
-
| `extractionType` | enum | `markdown` | `markdown` / `html` / `text`; all three run the same anti-injection cleaning, and `html` additionally strips event-handler attributes, so it is not byte-for-byte raw HTML |
|
|
305
|
-
| `mainContentOnly` | boolean | `true` | Extraction scope |
|
|
306
|
-
| `*MaxOutputChars` | natural | fetch / extract / render / document `200000`, xhr `120000` | Per-tool output caps. The sidecar clips by characters, the host then trims to a byte budget. `scrapling_render` and `scrapling_capture_xhr` carry XHR history **in addition** to the body, and that section is capped by the same budget separately — so one such call can return up to twice the budget |
|
|
307
|
-
| `crawlMaxItems` | natural | `1000` | Ceiling over the model-supplied `maxPages`. An out-of-range `maxPages` is passed through so the sidecar reports the parameter error rather than this plugin silently clamping it |
|
|
308
|
-
| `stripInlineImages` | boolean | `true` | Drops inline `data:` URI images from the body, keeping only alt text — pure token noise for the model. Code fences are left untouched; pages without inline images come back byte-identical. Stripping happens before the cap. Turn off only when the raw base64 **is** the data (colours, fingerprints) |
|
|
309
|
-
| `headless` / `networkIdle` | boolean | `true` / `false` | Browser mode and whether a page must reach network idle before it is read |
|
|
310
|
-
| `blockAds` | boolean | `true` | Stacks **on top of** the SSRF guard rather than competing with it: the guard is registered last (so the engine runs it first) and yields with `route.fallback()` |
|
|
311
|
-
| `pierceShadow` | boolean | `false` | Merges open shadow roots into the body — the switch for pages that hide their text in shadow DOM. The model can also override it per call on the browser tools |
|
|
312
|
-
| `waitSelectorState` | enum | `attached` | The state a `waitSelector` element must reach (`attached` / `detached` / `hidden` / `visible`) |
|
|
313
|
-
| `sidecarHandshakeTimeoutMs` / `fetchTimeoutMs` / `sidecarGraceMs` | natural | `30000` / `120000` / `5000` | Handshake budget, per-call cooperative timeout (declared on the tools' `timeoutMs`), and how long the client waits for the process to exit before forcing it down. `scrapling_crawl` passes no timeout — a crawl is measured in minutes |
|
|
314
|
-
| `dataDir` | string | `""` | Sidecar working directory (the `adaptive` fingerprint database lands here); empty = `~/.dsh-scrapling`. If it cannot be created, `failFastOnMissingPython` decides whether the plugin refuses to load or degrades to no tools |
|
|
315
|
-
| `provideWebFetch` / `provideWebSearch` | boolean | `true` | Whether the `ctx.web` providers are registered at all — see [Replacing the built-in fetch and search](#replacing-the-built-in-fetch-and-search) |
|
|
316
|
-
| `webFetchStrategy` | enum | `auto` | `static` always reads statically; `auto` reads statically first and renders only when the body is under 200 characters; `browser` renders directly. Without a browser, `auto` stays static. Network and protocol failures do not trigger rendering |
|
|
317
|
-
| `searchMaxOutputBytes` | number | `24000` | UTF-8 byte cap across all body sections returned by one search; raising it increases context and token cost |
|
|
318
|
-
| `searchBackend` / `tavilyApiKey` | enum / secret | `auto` / `""` | Discovery backend (`auto` / `tavily` / `bing` / `brave` / `serper` / `duckduckgo` / `searxng` / `deepseek`) and the Tavily key. `deepseek` uses optional Host `ctx.deepseekAuth`; other backends keep their own credentials. `auto` retains Tavily → SearXNG → explicitly allowed public fallback |
|
|
319
|
-
| `searchPublicFallback` | boolean | `false` | Lets `auto` fall back to the public Bing engine when neither a key nor SearXNG is configured — `py/search.py` resolves `auto` in the order `tavily` → `searxng` → `bing`. DuckDuckGo is not reachable through `auto` at all; name `searchBackend=duckduckgo` to use it. Off by default on purpose: turning it on sends query strings to a third-party public engine |
|
|
320
|
-
| `braveApiKey` / `serperApiKey` | secret | `""` | Keys for the Brave Search and Serper.dev backends |
|
|
321
|
-
| `searxngEndpoint` | string | `""` | Base URL of a SearXNG instance (`…/search?format=json` is appended); empty means the backend is unusable and reports `SEARCH_AUTH` |
|
|
322
|
-
| `answerProvider` / `answerModel` / `answerMaxTokens` | string / natural | `""` / `""` / `2000` | The model `scrapling_answer` routes to and the per-reply token cap. Provider and model left empty mean "follow the model the current session is already using" |
|
|
323
|
-
| `allowedHosts` | string | `""` | Extra host names that skip the public-address check (comma-separated). Pointing it at an intranet address means giving up SSRF protection for those targets on purpose |
|
|
324
|
-
| `syntheticDnsRanges` | string | `""` | Manual fallback for synthetic DNS: a comma-separated CIDR list of your proxy's fake-IP pool, for resolvers that mix synthetic and real answers. Invalid entries are dropped — a broken fallback degrades to "stay strict", not to a crash |
|
|
325
|
-
| `proxyUrl` | string | `""` | Where fetches go out (`http://…` / `socks5://…`, optionally `user:pass@`). Empty = follow the environment; see [Proxies](#proxies). Masked on the card, never enters a tool schema |
|
|
326
|
-
| `proxyBypass` | string | `""` | Host names that connect directly, mirroring `NO_PROXY`; `*` means the whole machine goes direct |
|
|
327
|
-
| `nat64Prefixes` | string | `""` | Extra NAT64 prefixes (comma-separated `<IPv6 prefix>/<32\|40\|48\|56\|64\|96>`) for operator-specific networks. A declared prefix is consulted for every IPv6 answer and applies to the addresses inside it. A malformed entry makes the plugin **refuse to load** (`CONFIG_INVALID`), unlike `syntheticDnsRanges` below: dropping a prefix would let a private IPv4 embedded in IPv6 through as ordinary public IPv6 |
|
|
234
|
+
What the card cannot tell you is the **split that decides when a change takes effect**: most values are read on every call and reach the next tool call; the values read once at assembly (the sixteen tool switches, `provideWebFetch` / `provideWebSearch`, `pythonBin`, `failFastOnMissingPython`, `dataDir`, the timeout pair, and the URL-gate / sidecar-environment values) need the host assembled again. A few switches also pair with a deployment-side setting — see [Replacing the built-in fetch and search](#replacing-the-built-in-fetch-and-search) and the deployment table below.
|
|
328
235
|
|
|
329
236
|
**Deployment-only knobs** (not on the card; set them in the `config:` block of `cordis.patch.yml`):
|
|
330
237
|
|
|
331
238
|
| Field | Default | Purpose |
|
|
332
239
|
| --- | --- | --- |
|
|
240
|
+
| `integrationMode` | `native` | Tool surface selector — see [MCP mode](#mcp-mode) |
|
|
241
|
+
| `mcpPort` | `39217` | Port of the plugin's MCP server; must equal the URL in a manual client entry |
|
|
242
|
+
| `officialMcpEnabled` | `false` | Gate for hooking the upstream `scrapling-mcp` server |
|
|
243
|
+
| `mcpToolLoading` | `eager` | `eager` registers MCP tools directly; `on-demand` loads them via `mcp__scrapling__load_tools`. Restart required |
|
|
333
244
|
| `requestTimeoutSeconds` / `maxUrlLength` | `120` / `2048` | Python-side per-request ceiling; URL length cap aligned with the built-in fetch |
|
|
334
245
|
| `allowWriteMethods` | `false` | Whether the model may change state on a remote host at all — see [Security](#security) |
|
|
335
|
-
| `mcpToolLoading` | `eager` | `eager` registers MCP tools directly; `on-demand` keeps them out of each agent's tool list until `mcp__scrapling__load_tools` loads them. Passed to dynamic registration and manual entries as `toolLoading`; restart required, and manual entries must be regenerated with `setup --mode --profile` |
|
|
336
246
|
| `browserExecutablePath` / `browserInitScript` | `""` | Strong capabilities: they hand Chromium a file to execute, or inject a JS file into every page. Deployment config only, unreachable from model input |
|
|
337
|
-
| `browserCdpUrl` | `""` | CDP endpoint for `sessionType=remote`; accepts ws/wss/http/https. Empty hides remote sessions
|
|
247
|
+
| `browserCdpUrl` | `""` | CDP endpoint for `sessionType=remote`; accepts ws/wss/http/https. Empty hides remote sessions |
|
|
338
248
|
| `browserRealChrome` / `browserDnsOverHttps` | `false` | Use the locally installed Google Chrome; route the browser's DNS over HTTPS (useful with a proxy to avoid DNS leaks) |
|
|
339
|
-
| `recordRequests` / `maxRecordedRequests` | `false` / `100` | Whether browser sessions record network history by default
|
|
340
|
-
| `sessionStateDir` | `""` | Directory for Playwright-compatible login-state files. The model can only pass a **plain file name
|
|
341
|
-
| `adaptiveStorage` | `sqlite` | Where `adaptive` fingerprints live: `sqlite` (one file under `dataDir`) or `redis` (
|
|
342
|
-
| `redisUrl` | `redis://127.0.0.1:6379/0` | Connection string read when `adaptiveStorage: redis`. The password never reaches logs
|
|
249
|
+
| `recordRequests` / `maxRecordedRequests` | `false` / `100` | Whether browser sessions record network history by default, and how many entries a session keeps |
|
|
250
|
+
| `sessionStateDir` | `""` | Directory for Playwright-compatible login-state files. The model can only pass a **plain file name**; empty disables the state save / load pair |
|
|
251
|
+
| `adaptiveStorage` | `sqlite` | Where `adaptive` fingerprints live: `sqlite` (one file under `dataDir`) or `redis` (shareable across processes and hosts) |
|
|
252
|
+
| `redisUrl` | `redis://127.0.0.1:6379/0` | Connection string read when `adaptiveStorage: redis`. The password never reaches logs; an unreachable server degrades extraction to non-adaptive with an `ADAPTIVE_STORAGE_FAILED` notice |
|
|
343
253
|
| `crawlMaxRuntimeSeconds` | `1800` | Wall-clock ceiling of one crawl — the page cap says nothing about a site that takes a minute per page |
|
|
344
|
-
| `crawlRespectRobots` | `false` | Obey robots.txt;
|
|
254
|
+
| `crawlRespectRobots` | `false` | Obey robots.txt; a domain whose robots.txt fetch **fails** is blocked, a **missing** one (HTTP 404) is treated as allowing everything |
|
|
345
255
|
| `crawlDownloadDelayMs` / `crawlConcurrentRequests` / `crawlAutothrottle` / `crawlStrategy` | `0` / `4` / `false` / `bfs` | Gap between requests, parallelism, adaptive throttling, breadth- or depth-first order |
|
|
346
256
|
| `crawlCheckpointDir` | `""` | Persist the crawl queue so a restarted crawl resumes instead of going back to the start URL |
|
|
347
|
-
| `tavilyApiEndpoint` / `bingEndpoint` / `
|
|
348
|
-
| `
|
|
349
|
-
| `deepseekSearchEndpoint` | `https://api.deepseek.com/v1/tools/search` | DeepSeek direct Search API endpoint. HTTPS only, no embedded credentials; changing it requires restart |
|
|
257
|
+
| `tavilyApiEndpoint` / `bingEndpoint` / `duckduckgoEndpoint` / `deepseekSearchEndpoint` | vendor defaults | Discovery endpoints, overridable for tests or proxies; HTTPS only |
|
|
258
|
+
| `searchRenderTopN` | `3` | How many search results are actually read according to `webFetchStrategy` (`0` = link list only) |
|
|
350
259
|
| `allowBrowserActions` / `allowFileDownloads` / `downloadMaxBytes` | `false` / `false` / `10485760` | Deployment-only gates for structured actions and persistent downloads, plus the per-download byte cap. Both gates default off and also hide their tools from the model |
|
|
351
|
-
| `documentMaxBytes` / `documentMaxPages` | `20971520` / `200` | Hard ceilings for PDF reads. Model arguments may only lower them
|
|
260
|
+
| `documentMaxBytes` / `documentMaxPages` | `20971520` / `200` | Hard ceilings for PDF reads. Model arguments may only lower them |
|
|
352
261
|
|
|
353
|
-
##
|
|
262
|
+
## Proxies
|
|
354
263
|
|
|
355
264
|
Where a fetch goes out, resolved in this order — **first hit wins**:
|
|
356
265
|
|
|
357
266
|
1. `proxyBypass` or the environment's `NO_PROXY` matches this host -> direct.
|
|
358
267
|
2. `proxyUrl` on the settings card is non-empty -> use it.
|
|
359
|
-
3. `http_proxy` / `https_proxy` / `all_proxy` in the environment
|
|
360
|
-
4. The operating system's proxy settings (`scutil --proxy
|
|
268
|
+
3. `http_proxy` / `https_proxy` / `all_proxy` in the environment -> use the matching slot.
|
|
269
|
+
4. The operating system's proxy settings (macOS `scutil --proxy`, Windows Internet Settings) -> use them.
|
|
361
270
|
5. Neither -> direct.
|
|
362
271
|
|
|
363
|
-
|
|
272
|
+
**With or without a proxy, the tools just work, with no setting to fill in** — the resolved proxy is handed to the browser engine explicitly, because Chromium does not read `HTTP_PROXY`. What is worth knowing:
|
|
364
273
|
|
|
365
274
|
| Your setup | Static fetching | Render / XHR |
|
|
366
275
|
| --- | --- | --- |
|
|
@@ -371,84 +280,60 @@ What that looks like in practice — **with or without a proxy, the tools just w
|
|
|
371
280
|
| Intranet targets / internal Git | exclude with `proxyBypass` | exclude with `proxyBypass` |
|
|
372
281
|
| PAC (auto-config script) | not followed; stderr says to set `proxyUrl` | followed natively by the browser |
|
|
373
282
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
- **
|
|
377
|
-
- **
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
- **
|
|
382
|
-
- **
|
|
383
|
-
|
|
384
|
-
## <img src="https://api.iconify.design/lucide/shield-alert.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Security
|
|
385
|
-
|
|
386
|
-
- **SSRF.** Scrapling itself has no SSRF protection. This package adds a URL policy on the host side — scheme allowlist, rejection of URLs with embedded credentials, length cap, rejection of an authority containing a backslash or control characters, DNS resolution with a whole-answer-set public-address check, IPv4-mapped and NAT64 addresses reclassified by their embedded IPv4 — and enforces the scheme, credential and address rules again on the Python side (the length cap stays with the host policy, because it is a deployment setting). Outbound paths accept only `http`/`https` and reject embedded credentials; `ws`/`wss` are judged by address alone in the WebSocket-handshake check. **What is judged is what gets sent**: the gate decides on the WHATWG-normalised form and the sidecar forwards that same string, otherwise "judged A, connected to B" would be a bypass in its own right. The host-side policy is enforced in one place (`SidecarClient.call`), and that one place screens every URL the model hands over **as something to fetch** — `url`, plus crawl's `sitemapUrl` and `feedUrl` — with one deliberate exclusion: the three offline parsers (`scrapling_extract`, `scrapling_locate`, `scrapling_links`) send their `url` to the sidecar as nothing but the base for resolving relative links, so `lib/sidecar.ts` (`BASE_ONLY_METHODS`) does not screen it and no request is made with it — so it covers every tool and the `web_fetch` provider alike, with a rejection throwing `URL_BLOCKED` before the request reaches the pipe; the `web_search` provider runs the same gate over the URLs it is about to return, so a hit the gate rejects never becomes a citeable source. The browser-side guard covers navigation, subresources, XHR and WebSocket handshakes.
|
|
387
|
-
- Known gaps, stated in the open:
|
|
388
|
-
- **Connection pinning** (an undici-level technique) is unavailable for a non-Node transport, leaving a TOCTOU window between validation and connect. Static fetches are covered by curl_cffi's `follow_redirects="safe"`; browser fetches by a route handler on the Python side.
|
|
389
|
-
- **NAT64 prefixes are not discovered dynamically.** The two standardized prefixes are covered; operator-specific ones must be declared via `nat64Prefixes`, otherwise a private IPv4 hidden inside IPv6 is judged as an ordinary public IPv6.
|
|
390
|
-
- **No port allowlist** (any port allowed by default), matching dsh's own built-in fetch provider.
|
|
391
|
-
- **The crawl re-checks every page twice** before it enters the result set — once against the guard (the final URL may still have landed somewhere private) and once against the start domain, because Scrapling's `allow_domains` is a string comparison over links found in the page, not redirect targets. The crawl session uses `follow_redirects="safe"` so curl_cffi refuses a jump into a private range.
|
|
392
|
-
- **WebSocket coverage depends on the Playwright version.** The guard intercepts handshakes via `route_web_socket`; older builds lack that method, WebSocket is then outside the guard, and the plugin reports that as `websocketGuard` in the handshake capabilities (the startup log prints the probed capabilities) rather than degrading silently.
|
|
393
|
-
- **No code execution from model input.** `page_action`, `page_setup`, `selector_config`, `proxy` and `executablePath` never appear in any tool schema, and the browser-side network guard is installed by plugin code. The strong browser capabilities and `allowWriteMethods` come only from deployment config.
|
|
394
|
-
- **Write verbs are off by default.** With `allowWriteMethods` off, `method` and `body` are absent from `scrapling_fetch`'s parameter surface, and the sidecar independently refuses a non-GET with `WRITE_DISABLED` — two halves that do not rely on each other. The gate, the proxy decision and `follow_redirects="safe"` bound **where** a request goes, not **what it does once there**; prompt-injected page text can ask for a POST, so turn it on only where the task really is to submit data. `headers` and `cookies` stay available either way — anything handed to them lands in the model context by design.
|
|
283
|
+
- **A proxy and synthetic DNS are two different problems.** A fake-IP proxy resolves every domain into a non-public range, which the gate would reject; the gate detects that class of resolver on its own and relaxes to the whole of the known pools, while private, loopback and link-local addresses stay blocked on a proxied machine. `syntheticDnsRanges` is the manual fallback for a self-built pool outside them.
|
|
284
|
+
- **A browser session's proxy is fixed at `scrapling_session_open`** — switching it means a new context, which discards the session's cookies and login state. Static sessions decide per request.
|
|
285
|
+
- **WebRTC leaks are closed whenever a proxy is in play** (`blockWebrtc` forced on, no model input involved).
|
|
286
|
+
- **Credentials never reach a log or the capability frame**: the proxy summary echoes `scheme://host:port` plus which rung answered, and the installer's stderr and download URLs go through the same redaction gate.
|
|
287
|
+
|
|
288
|
+
## Security
|
|
289
|
+
|
|
290
|
+
- **SSRF.** Scrapling itself has no SSRF protection; this package adds a URL policy on the host side — scheme allowlist, embedded-credential rejection, length cap, DNS resolution with a whole-answer-set public-address check, IPv4-mapped and NAT64 addresses reclassified — and enforces it again on the Python side. **What is judged is what gets sent**: the gate decides on the WHATWG-normalised form and the sidecar forwards that same string. It screens every URL the model hands over as something to fetch, across every tool and the `web_fetch` provider alike, with a rejection throwing `URL_BLOCKED` before the request reaches the pipe; the `web_search` provider runs the same gate over the URLs it is about to return. The browser-side guard covers navigation, subresources, XHR and WebSocket handshakes. Known gaps, stated in the open: connection pinning is unavailable (a TOCTOU window remains, mitigated by curl_cffi's safe redirects and the Python route handler), NAT64 prefixes beyond the two standard ones must be declared via `nat64Prefixes`, there is no port allowlist (matching dsh's own provider), and WebSocket coverage depends on the Playwright version (reported as `websocketGuard` in the handshake capabilities rather than degrading silently).
|
|
291
|
+
- **No code execution from model input.** `page_action`, `page_setup`, `selector_config`, `proxy` and `executablePath` never appear in any tool schema, and the browser-side network guard is installed by plugin code.
|
|
292
|
+
- **Write verbs are off by default.** With `allowWriteMethods` off, `method` and `body` are absent from `scrapling_fetch`'s parameter surface, and the sidecar independently refuses a non-GET with `WRITE_DISABLED` — two halves that do not rely on each other. The gate bounds **where** a request goes, not **what it does once there**; turn it on only where the task really is to submit data.
|
|
395
293
|
- **Prompt-injection scrubbing runs unconditionally** on all three extraction paths; there is no model-facing switch to turn it off.
|
|
396
294
|
|
|
397
|
-
##
|
|
295
|
+
## Data and privacy
|
|
398
296
|
|
|
399
297
|
| Aspect | Content |
|
|
400
298
|
| --- | --- |
|
|
401
|
-
| On disk | Under the sidecar working directory (`dataDir`, default `~/.dsh-scrapling`):
|
|
402
|
-
| Network | Fetches go to the URLs the model supplies, through the configured proxy if any. Search queries go to the
|
|
299
|
+
| On disk | Under the sidecar working directory (`dataDir`, default `~/.dsh-scrapling`): the `adaptive` fingerprint database (SQLite by default; with `adaptiveStorage: redis` it goes to the Redis at `redisUrl` instead), `downloads/`, the managed runtime installed by `setup`, and the MCP entry written by `setup --mode … --apply`. Crawl queue only when `crawlCheckpointDir` is set; login-state files under `sessionStateDir`; screenshots go to the host attachment service |
|
|
300
|
+
| Network | Fetches go to the URLs the model supplies, through the configured proxy if any. Search queries go to the one backend `searchBackend` selects — Tavily (`api.tavily.com`, key in the request body), Bing (`www.bing.com`, no key), Brave (`api.search.brave.com`, `X-Subscription-Token`), Serper (`google.serper.dev`, `X-API-KEY`), DuckDuckGo (`html.duckduckgo.com`, no key), the SearXNG instance at `searxngEndpoint`, or DeepSeek's direct Search API at `deepseekSearchEndpoint`. A backend receives only its own credential plus the query string; keys are never logged. `scrapling_answer` sends page text and the question through the host `llm` service — that content leaves the machine when the routed model is remote |
|
|
403
301
|
| Logs | The chosen interpreter, the probed capabilities, and the proxy summary (`scheme://host:port` plus which rung answered — never credentials) |
|
|
404
302
|
| In memory | Sessions, cookies and recorded network history live in the sidecar process and disappear with it |
|
|
405
303
|
| Telemetry | None |
|
|
406
304
|
|
|
407
|
-
##
|
|
305
|
+
## Known boundaries
|
|
408
306
|
|
|
409
307
|
Registered honestly, one entry per class.
|
|
410
308
|
|
|
411
|
-
- **Rendering can only lose content on pages that ship readable text and then swap it out
|
|
412
|
-
- **Axis ticks inside SVG are unreachable in every tool
|
|
413
|
-
- **A browser session's proxy is fixed at `session_open`**, and `proxyBypass` does not apply per URL inside it
|
|
414
|
-
- **`headers` and `retries` on `scrapling_session_fetch` belong to static sessions
|
|
415
|
-
- **Browser identity knobs only live on the tools that can apply them
|
|
416
|
-
- **Network history is session-level
|
|
417
|
-
- **`scrapling_screenshot` bypasses text cleaning
|
|
418
|
-
- **`scrapling_extract`, `scrapling_locate` and `scrapling_links` are offline parsers.**
|
|
419
|
-
- **Adaptive relocation is best-effort.**
|
|
420
|
-
- **TLS trust comes from certifi, not the bare managed interpreter's OpenSSL defaults
|
|
421
|
-
-
|
|
422
|
-
- **
|
|
423
|
-
- **
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
- **`official-mcp` connects the upstream server.** `integrationMode=official-mcp` registers no native tool and starts no server from this plugin; on a host that exposes `mcpManager` (the rc.2 web bundle) the managed `scrapling-mcp` is registered dynamically, and where that service is absent (CLI/headless) `setup --mode official-mcp --accept-risk` produces the `dsh-mcp-client` entry instead. The binary comes from the `mcp` pack (B10 is the risk decision that entry stands on).
|
|
427
|
-
|
|
428
|
-
## <img src="https://api.iconify.design/lucide/circle-help.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> FAQ
|
|
429
|
-
|
|
430
|
-
| Question | Answer |
|
|
431
|
-
| --- | --- |
|
|
432
|
-
| The model says the render / capture_xhr tools do not exist | No browser engine on this machine — the plugin registers only what works. Run `python -m patchright install chromium` and restart. If **every** tool is missing, the sidecar did not start: the startup log names the chosen interpreter, and a missing Scrapling carries the pip line to copy |
|
|
433
|
-
| After enabling a proxy, every fetch is blocked | A fake-IP proxy resolves every domain into a non-public range; the gate auto-detects that class and relaxes to the known pools. A self-built pool outside them goes into `syntheticDnsRanges`. Private and loopback addresses stay blocked on purpose |
|
|
434
|
-
| `web_fetch` reports `WEB_PROVIDER_CONFIGURED_UNAVAILABLE` / `_MISSING` | The deployment line points at this plugin: either the sidecar is down (interpreter or Scrapling — see the startup log), or the plugin was removed and the `fetchProvider` / `searchProvider` line is still there. Remove the line too |
|
|
435
|
-
| The model cannot POST a form | `allowWriteMethods` is off by default and deployment-only — it decides whether the model may change state on a remote host |
|
|
436
|
-
| `web_search` reports `SEARCH_AUTH` | The selected backend has no credential: Tavily/Brave/Serper need their key, SearXNG needs `searxngEndpoint`. Set it, or switch `searchBackend`. With `searchBackend=auto` and no key and no `searxngEndpoint`, the plugin reports `SEARCH_BACKEND_MISSING` — set a key / endpoint, or turn on `searchPublicFallback` to allow public engines |
|
|
437
|
-
| The numbers on a chart are missing | SVG tick labels do not survive the Markdown conversion in any tool. Use `scrapling_capture_xhr` to find the JSON endpoint behind the chart |
|
|
438
|
-
|
|
439
|
-
## <img src="https://api.iconify.design/lucide/wrench.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Development
|
|
309
|
+
- **Rendering can only lose content on pages that ship readable text and then swap it out** — see [Render or static](#render-or-static).
|
|
310
|
+
- **Axis ticks inside SVG are unreachable in every tool**; locate the JSON endpoint with `scrapling_capture_xhr`.
|
|
311
|
+
- **A browser session's proxy is fixed at `session_open`**, and `proxyBypass` does not apply per URL inside it.
|
|
312
|
+
- **`headers` and `retries` on `scrapling_session_fetch` belong to static sessions**; upstream silently drops both for browser sessions, so this package refuses them with `BAD_ARGS` naming the knob to use instead.
|
|
313
|
+
- **Browser identity knobs only live on the tools that can apply them** (`useragent` / `locale` / `timezoneId` / `headless` take effect at session construction).
|
|
314
|
+
- **Network history is session-level**: a session that is not recording answers an error, not an empty list.
|
|
315
|
+
- **`scrapling_screenshot` bypasses text cleaning** — it captures whatever the page renders, including visual secrets that never appear in the DOM text the other tools clean.
|
|
316
|
+
- **`scrapling_extract`, `scrapling_locate` and `scrapling_links` are offline parsers.** `scrapling_links` keeps relative links only when `baseUrl` is supplied — with an empty `baseUrl` it returns no links rather than guessing absolute URLs.
|
|
317
|
+
- **Adaptive relocation is best-effort.** A near-identical sibling can be chosen when the original attributes change; treat a relocated match as a hint and verify it — `scrapling_locate` never saves fingerprints.
|
|
318
|
+
- **TLS trust comes from certifi, not the bare managed interpreter's OpenSSL defaults** (`SSL_CERT_FILE` / `CURL_CA_BUNDLE` are pointed at `certifi.where()` only when neither is already set, so a corporate MITM proxy or a private root you pin yourself still wins).
|
|
319
|
+
- **`maxPages` caps the pages collected, not the requests the spider makes**; politeness toward the target site is governed by the deployment knobs (`crawlRespectRobots`, `crawlDownloadDelayMs`, `crawlConcurrentRequests`, `crawlAutothrottle`).
|
|
320
|
+
- **Heavy pages can keep the browser path from ever settling**; mitigations are per-call parameters (`waitSelector`, `disableResources`).
|
|
321
|
+
- **Runtime packs are verified on macOS arm64 only**; other platforms report every pack as `blocked`.
|
|
322
|
+
|
|
323
|
+
## Development
|
|
440
324
|
|
|
441
325
|
```sh
|
|
442
326
|
pnpm install
|
|
443
|
-
pnpm run check # typecheck → lint → client build → host build → tests → format, then the Python chain
|
|
327
|
+
pnpm run check # typecheck → lint → client build → host build → tests → EOL gate → format, then the Python chain
|
|
444
328
|
pnpm run test:py # end-to-end check of the Python sidecar
|
|
445
329
|
```
|
|
446
330
|
|
|
447
|
-
- **The Python half is gated like the TypeScript half.** `check` ends with `check:py`: an interpreter report, a face count
|
|
448
|
-
- **The Python 3.14 floor is one fact in
|
|
449
|
-
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
331
|
+
- **The Python half is gated like the TypeScript half.** `check` ends with `check:py`: an interpreter report, a face count, a dependency consistency check, ruff check/format, mypy, bandit (all severities), and a coverage floor measured **only over the modules that ship**.
|
|
332
|
+
- **The Python 3.14 floor is one fact stated in several places:** both READMEs, the ruff target, the mypy target, a runtime gate in `py/bridge.py` (exits before any Scrapling import — stdout is protocol frames), plus the `python-version` pin in CI.
|
|
333
|
+
- Sources are TypeScript. `host.js` and `client.js` are **build artifacts** and deliberately `.js`: Node refuses to strip types for packages inside `node_modules`, which is exactly where dsh loads the plugin from.
|
|
334
|
+
- **The build orchestration lives in shared's four facets; this repository keeps three thin scripts.** All three artifacts (`host.js`, `client.js`, `bin/dsh-scrapling.mjs`) are **not tracked**; `test/artifact-freshness.test.ts` compares existing artifacts byte for byte and skips explicitly when absent.
|
|
335
|
+
- `host.js` keeps shared **external**; `bin/dsh-scrapling.mjs` inlines the whole dependency set (a CLI must be self-contained), with a structural assertion that no `@deepseek-ai/*` package ends up inside.
|
|
336
|
+
- Gates that pin the published shape: `test/publish-manifest.test.ts` and `test/readme-parity.test.ts` (the two READMEs name every tool and every deployment knob, keep their section structures in step, and the detail document's images all exist).
|
|
452
337
|
- Publishing runs through [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) (manual, OIDC trusted publishing plus `--provenance`).
|
|
453
338
|
|
|
454
339
|
## Feedback
|
|
@@ -457,8 +342,8 @@ Issues and pull requests are welcome: [https://github.com/JayYuen666/dsh-scrapli
|
|
|
457
342
|
|
|
458
343
|
If a plugin fails to boot, include the dsh host version, the profile install shape, and the browser console line. The `missed the module table` line is especially useful: it tells us whether the shared client row was materialized.
|
|
459
344
|
|
|
460
|
-
##
|
|
345
|
+
## License
|
|
461
346
|
|
|
462
347
|
MIT. Source at [github.com/JayYuen666/dsh-scrapling](https://github.com/JayYuen666/dsh-scrapling). Issues go to that repository's tracker.
|
|
463
348
|
|
|
464
|
-
This package
|
|
349
|
+
This package vendors no third-party source outside the single-file CLI bundle: Scrapling and the browser engines are runtime dependencies, while the CLI inlines `zod` and `ipaddr.js` (the host-side bundles keep `zod` external). The third-party content in the package is the icon (the official Scrapling mark, BSD 3-Clause) plus those two inlined libraries. [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md) records that boundary and the licenses.
|