@jayyuen66/dsh-scrapling 0.1.2 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayyuen66/dsh-scrapling",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Scrapling 网页抓取插件(dsh):静态/浏览器抓取 + CSS/XPath 结构化抽取 + 选择器自愈 + capture_xhr 与会话网络历史 + 登录态存取 + Spider 爬虫,由常驻 Python 进程驱动。",
5
5
  "keywords": [
6
6
  "dsh",
@@ -20,15 +20,27 @@
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/JayYuen666/dsh-scrapling.git"
22
22
  },
23
+ "bin": {
24
+ "dsh-scrapling": "./bin/dsh-scrapling.mjs"
25
+ },
23
26
  "files": [
24
27
  "icon.svg",
28
+ "bin/dsh-scrapling.mjs",
25
29
  "host.js",
26
30
  "client.js",
27
31
  "cordis.patch.yml",
32
+ "runtime-manifest.json",
28
33
  "py/crawl.py",
29
34
  "py/bridge.py",
30
35
  "py/adapters.py",
31
36
  "py/guard.py",
37
+ "py/extraction.py",
38
+ "py/search.py",
39
+ "py/session_page.py",
40
+ "py/media.py",
41
+ "py/redact.py",
42
+ "py/redis_storage.py",
43
+ "py/runtime-requirements.txt",
32
44
  "CHANGELOG.md",
33
45
  "THIRD_PARTY_NOTICES.md"
34
46
  ],
@@ -50,6 +62,7 @@
50
62
  "registry": "https://registry.npmjs.org"
51
63
  },
52
64
  "dependencies": {
65
+ "@modelcontextprotocol/sdk": "1.32.2",
53
66
  "ipaddr.js": "2.5.0"
54
67
  },
55
68
  "devDependencies": {
@@ -82,6 +95,7 @@
82
95
  "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
83
96
  "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.3",
84
97
  "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
98
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
85
99
  "@deepseek-ai/dsh-user-approval": "0.2.1-rc.3",
86
100
  "@deepseek-ai/dsh-web": "0.2.1-rc.3",
87
101
  "@deepseek-ai/schemastery": "3.18.5",
@@ -103,6 +117,7 @@
103
117
  "@deepseek-ai/dsh": "^0.2.1-rc.3",
104
118
  "@deepseek-ai/dsh-output-retention": "0.2.1-rc.3",
105
119
  "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
120
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
106
121
  "@deepseek-ai/dsh-web": "0.2.1-rc.3",
107
122
  "@deepseek-ai/schemastery": "3.18.5"
108
123
  },
@@ -131,23 +146,25 @@
131
146
  },
132
147
  "scripts": {
133
148
  "build:client": "node build-client.ts",
134
- "build": "node build-host.ts",
149
+ "build": "node build-host.ts && node build-cli.ts",
135
150
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.client.json",
136
151
  "lint": "oxlint .",
137
152
  "test": "vitest run --coverage",
138
153
  "test:watch": "vitest",
139
154
  "check": "npm run --loglevel=warn typecheck && npm run --loglevel=warn lint && npm run --loglevel=warn build:client && npm run --loglevel=warn build && npm run --loglevel=warn test && npm run --loglevel=warn fmt:check && npm run --loglevel=warn check:py",
140
155
  "fmt:check": "oxfmt --check .",
141
- "py": "sh -c 'P=python3; test -x _env/.venv/bin/python && P=_env/.venv/bin/python; exec \"$P\" \"$@\"' --",
142
- "py:which": "sh -c 'test -x _env/.venv/bin/python && echo \"[py] 解释器:$PWD/_env/.venv/bin/python\" || echo \"[py] 解释器:PATH 上的 python3(本仓没有 _env/.venv,在伞根跑 pnpm py:setup)\"'",
143
- "face:py": "npm run --loglevel=warn py -- -c \"import pathlib,sys;MIN=6;fs=sorted(str(p) for p in pathlib.Path('py').rglob('*.py'));td=pathlib.Path('py/tests').is_dir();print('[face:py] bandit 与覆盖率量到的面:py/ 下 %d 份 *.py(下限 %d),py/tests/ 目录存在:%s' % (len(fs),MIN,td),flush=True);sys.exit('py/ 下只找到 %d 份 *.py,低于下限 %d:bandit 与 coverage 的分母已经空了,后面每一段都在量空气' % (len(fs),MIN) if len(fs)<MIN else 'py/tests/ 不是目录:coverage 的 --omit=py/tests/* 会连分母一起放宽,地板量的就成了虚高的那一面' if not td else 0)\"",
156
+ "py": "node py-launcher.mjs",
157
+ "py:which": "node py-launcher.mjs --which",
158
+ "face:py": "node face-py.mjs",
144
159
  "lint:py": "npm run --loglevel=warn py -- -m ruff check py/",
145
160
  "fmt:py": "npm run --loglevel=warn py -- -m ruff format --check py/",
146
161
  "typecheck:py": "npm run --loglevel=warn py -- -m mypy py/",
147
162
  "test:py": "npm run --loglevel=warn py -- py/tests/test_bridge.py",
148
- "bandit:py": "npm run --loglevel=warn py -- -m bandit -q -ll -r py/",
149
- "cov:py": "npm run --loglevel=warn py -- -m coverage erase && DSH_PY_COVERAGE=1 npm run --loglevel=warn py -- -m coverage run --parallel-mode py/tests/test_bridge.py && npm run --loglevel=warn py -- -m coverage combine && npm run --loglevel=warn py -- -m coverage report -m && npm run --loglevel=warn py -- -m coverage erase",
150
- "coverage:floor": "npm run --loglevel=warn py -- -m coverage erase && DSH_PY_COVERAGE=1 npm run --loglevel=warn py -- -m coverage run --parallel-mode py/tests/test_bridge.py && npm run --loglevel=warn py -- -m coverage combine && npm run --loglevel=warn py -- -m coverage report --omit=\"py/tests/*\" --fail-under=74 && npm run --loglevel=warn py -- -m coverage erase",
151
- "check:py": "npm run --loglevel=warn py:which && npm run --loglevel=warn face:py && npm run --loglevel=warn lint:py && npm run --loglevel=warn fmt:py && npm run --loglevel=warn typecheck:py && npm run --loglevel=warn test:py && npm run --loglevel=warn bandit:py && npm run --loglevel=warn coverage:floor"
163
+ "bandit:py": "npm run --loglevel=warn py -- -m bandit -q -r py/",
164
+ "cov:py": "node py-launcher.mjs -m coverage erase && node py-launcher.mjs --env=DSH_PY_COVERAGE=1 -m coverage run --parallel-mode py/tests/test_bridge.py && node py-launcher.mjs -m coverage combine && node py-launcher.mjs -m coverage report -m && node py-launcher.mjs -m coverage erase",
165
+ "coverage:floor": "node py-launcher.mjs -m coverage erase && node py-launcher.mjs --env=DSH_PY_COVERAGE=1 -m coverage run --parallel-mode py/tests/test_bridge.py && node py-launcher.mjs -m coverage combine && node py-launcher.mjs -m coverage report --omit=\"py/tests/*\" --fail-under=74 && node -e \"require('node:fs').mkdirSync('coverage',{recursive:true})\" && node py-launcher.mjs -m coverage json --omit=\"py/tests/*\" -o coverage/python-coverage.json && node coverage-floor.mjs && node py-launcher.mjs -m coverage erase",
166
+ "deps:py": "node deps-check.mjs",
167
+ "check:py": "npm run --loglevel=warn py:which && npm run --loglevel=warn face:py && npm run --loglevel=warn deps:py && npm run --loglevel=warn lint:py && npm run --loglevel=warn fmt:py && npm run --loglevel=warn typecheck:py && npm run --loglevel=warn test:py && npm run --loglevel=warn bandit:py && npm run --loglevel=warn coverage:floor",
168
+ "build:cli": "node build-cli.ts"
152
169
  }
153
170
  }