@jayyuen66/dsh-scrapling 0.1.16 → 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 +73 -0
- package/README.md +160 -251
- package/README.zh-CN.md +226 -317
- package/THIRD_PARTY_NOTICES.md +54 -15
- package/bin/dsh-scrapling.mjs +13 -74
- package/client.js +6 -6
- package/cordis.patch.yml +1 -1
- package/docs/DETAIL.md +22 -22
- package/docs/DETAIL.zh.md +27 -27
- 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 +26 -45
- package/package.json +67 -62
- package/py/adapters.py +204 -57
- package/py/bridge.py +80 -8
- package/py/cancellation.py +56 -0
- package/py/crawl.py +1 -1
- package/py/document.py +128 -0
- package/py/documents-requirements.txt +1 -0
- package/py/extraction.py +2 -2
- package/py/media.py +4 -3
- package/py/runtime-requirements.txt +4 -3
- package/py/search.py +109 -24
- package/py/session_page.py +92 -24
- package/runtime-manifest.json +6 -0
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
本包自身编写的代码以 MIT 发布,见 [`LICENSE`](./LICENSE)。本文件记录**与第三方的边界**:
|
|
4
4
|
哪一部分来自第三方、在什么意义上「来自」,以及本包自身代码与第三方代码的分界在哪里。
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## 结论:随包分发的第三方内容有三处
|
|
7
7
|
|
|
8
8
|
`py/`、`lib/`、`host.ts`、`src/` 下全部是本仓原创代码,不含任何第三方源码、词表或文案。
|
|
9
9
|
Scrapling 及浏览器引擎都是**运行期依赖**——本包调用它们暴露的接口,其中反注入清洗用的
|
|
10
10
|
`Convertor._strip_noise_tags` 与 `Convertor._sanitize_for_ai` 是上游的私有下划线方法,不在上游文档
|
|
11
11
|
里(见「机制与接口来源」)。它们不由本包分发,许可文本也随各自的包走,本文件不重复。
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
**CLI 单文件产物内联的 zod**(`bin/dsh-scrapling.mjs`,MIT
|
|
15
|
-
|
|
13
|
+
随包分发的第三方内容有三处:**图标**(`icon.svg`,Scrapling 官方标记,BSD 3-Clause)、
|
|
14
|
+
**CLI 单文件产物内联的 zod**(`bin/dsh-scrapling.mjs`,MIT)与**同一产物内联的
|
|
15
|
+
`ipaddr.js`**(MIT)。本包在下方保留各自的版权与许可声明。
|
|
16
16
|
|
|
17
17
|
## 图标:Scrapling 官方标记
|
|
18
18
|
|
|
@@ -69,10 +69,43 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
69
69
|
- 上游许可:MIT,Copyright (c) 2020 Colin McDonnell
|
|
70
70
|
- 版本:伞根 catalog 4.6.7(`package.json` 写作 `catalog:`)
|
|
71
71
|
|
|
72
|
-
`bin/dsh-scrapling.mjs` 由 `build-cli.
|
|
72
|
+
`bin/dsh-scrapling.mjs` 由 `build-cli.mjs` 用 rolldown 打成单文件、只外置 `node:` 内置模块,
|
|
73
73
|
因此 zod 的实现被内联进该产物;host 侧的 `client.js` 按宿主 `PLATFORM_MODULES` 外置 zod。
|
|
74
74
|
所以 zod 既是运行期依赖,也是 CLI 产物里的一份第三方代码,此处保留其版权与许可声明。
|
|
75
75
|
|
|
76
|
+
## CLI 单文件产物内联的 ipaddr.js
|
|
77
|
+
|
|
78
|
+
- 上游项目:`ipaddr.js`
|
|
79
|
+
- 上游仓库:https://github.com/whitequark/ipaddr.js
|
|
80
|
+
- 上游许可:MIT,Copyright (C) 2011-2017 whitequark <whitequark@whitequark.org>
|
|
81
|
+
- 版本:2.5.0(`package.json` 精确钉版)
|
|
82
|
+
|
|
83
|
+
`lib/installer.ts` 通过 `lib/url-policy.ts` 的 `redactUrlSecrets` 间接引用本包,而 CLI 的单文件
|
|
84
|
+
产物同样只外置 `node:` 内置模块,因此 `ipaddr.js` 的实现也被内联进 `bin/dsh-scrapling.mjs`。
|
|
85
|
+
host 侧的 `host.js` / `client.js` 仍把它当普通运行期依赖,不重复打包。
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
Copyright (C) 2011-2017 whitequark <whitequark@whitequark.org>
|
|
89
|
+
|
|
90
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
91
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
92
|
+
in the Software without restriction, including without limitation the rights
|
|
93
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
94
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
95
|
+
furnished to do so, subject to the following conditions:
|
|
96
|
+
|
|
97
|
+
The above copyright notice and this permission notice shall be included in
|
|
98
|
+
all copies or substantial portions of the Software.
|
|
99
|
+
|
|
100
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
103
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
104
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
105
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
106
|
+
THE SOFTWARE.
|
|
107
|
+
```
|
|
108
|
+
|
|
76
109
|
## 机制与接口来源:Scrapling
|
|
77
110
|
|
|
78
111
|
- 上游项目:`Scrapling`
|
|
@@ -96,19 +129,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
96
129
|
|
|
97
130
|
| 依赖 | 版本 | 许可 | 引入方 |
|
|
98
131
|
| --- | --- | --- | --- |
|
|
99
|
-
| `@jayyuen66/dsh-plugin-shared` | catalog(根 ^0.
|
|
100
|
-
| `scrapling` | 0.5 | BSD-3-Clause | Python sidecar |
|
|
132
|
+
| `@jayyuen66/dsh-plugin-shared` | catalog(根 ^0.3.1) | MIT | 设置卡的共享组件供应行与 shared 子路径 |
|
|
133
|
+
| `scrapling` | 0.5.1 | BSD-3-Clause | Python sidecar |
|
|
134
|
+
| `pypdf` | 7.2.0 | BSD-3-Clause | 可选 `documents` 能力包的 PDF 文本读取 |
|
|
101
135
|
| `browserforge` | 1.2.4 | MIT | Scrapling 静态抓取的浏览器头生成 |
|
|
102
136
|
| `apify-fingerprint-datapoints` | 0.15.0 | Apache-2.0 | browserforge 的指纹数据 |
|
|
103
137
|
| `playwright` | 1.64.1 | Apache-2.0(Microsoft) | 网络守卫 |
|
|
104
138
|
| `patchright` | 1.64.2 | Apache-2.0(Microsoft,patch 由 Kaliiiiiiiiii-Vinyzu 提供) | 浏览器渲染与网络守卫 |
|
|
105
139
|
| `@modelcontextprotocol/sdk` | 1.32.2 | MIT | `lib/mcp-server.ts` 的 MCP server 实现 |
|
|
106
|
-
| `ipaddr.js` | 2.5.0 | MIT | Host 侧 URL
|
|
107
|
-
| `fs-native-extensions` | 1.5.
|
|
140
|
+
| `ipaddr.js` | 2.5.0 | MIT | Host 侧 URL 策略的地址分类;CLI 单文件产物也内联了它 |
|
|
141
|
+
| `fs-native-extensions` | 1.5.4 | Apache-2.0 | `lib/installer.ts` 的安装锁:OS 级 `flock`/`LockFileEx` 互斥,进程退出自动释放 |
|
|
108
142
|
| `zod` | catalog(伞根 4.6.7) | MIT | Host 侧 `lib/runtime.ts` / `lib/sidecar.ts` 的形状校验走本包 dependencies 里的 zod;设置卡 `src/runtime-reader.ts`、`src/settings-card.ts` 的 strict codec 由宿主 `PLATFORM_MODULES` 提供;CLI 单文件产物内联 |
|
|
109
143
|
|
|
110
144
|
其余随 venv 安装的固定版本(含 `click`、`protego`、`curl_cffi`、`lxml` 等)见
|
|
111
|
-
`py/runtime-requirements.txt`,每一行都带 SHA256
|
|
145
|
+
`py/runtime-requirements.txt`,每一行都带 SHA256;可选 pypdf 单独钉在
|
|
146
|
+
`py/documents-requirements.txt`,同样带 wheel 的 SHA256;本文件不复述整张表。
|
|
112
147
|
|
|
113
148
|
## 运行时下载的资产(不随 npm 分发)
|
|
114
149
|
|
|
@@ -128,8 +163,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
128
163
|
`patchright` 是 Playwright 的补丁分支,与 `playwright` 并存安装:两者是不同的 Python 包,
|
|
129
164
|
本包按能力探测判断浏览器抓取能不能用。
|
|
130
165
|
|
|
131
|
-
dsh 宿主族包里本仓声明为 peer
|
|
132
|
-
`@deepseek-ai/dsh-
|
|
133
|
-
`@deepseek-ai/
|
|
134
|
-
|
|
135
|
-
`@deepseek-ai
|
|
166
|
+
dsh 宿主族包里本仓声明为 peer 的有 `@deepseek-ai/dsh`、`@deepseek-ai/dsh-error`、
|
|
167
|
+
`@deepseek-ai/dsh-fs-patch`、`@deepseek-ai/dsh-output-retention`、`@deepseek-ai/dsh-tools`、
|
|
168
|
+
`@deepseek-ai/dsh-typert-protocol`、`@deepseek-ai/dsh-web` 与 `@deepseek-ai/schemastery`,
|
|
169
|
+
由宿主提供、不随本包分发。产物里 `host.js` 运行期按值 import 的是六枚:
|
|
170
|
+
`@deepseek-ai/dsh-error`、`@deepseek-ai/dsh-output-retention`、`@deepseek-ai/dsh-tools`、
|
|
171
|
+
`@deepseek-ai/dsh-typert-protocol`、`@deepseek-ai/dsh-web` 与 `@deepseek-ai/schemastery`;
|
|
172
|
+
`@deepseek-ai/dsh` 与 `@deepseek-ai/dsh-fs-patch` 只用于类型与装载契约,`client.js` 只外置
|
|
173
|
+
`react` 与 `zod`。其余 `@deepseek-ai/*` 是本仓 devDependencies,只用于类型检查与客户端构建,
|
|
174
|
+
产物里没有对它们的运行期 import。
|