dsh-ab-wechat-scrape 0.4.5 → 0.4.7
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/lib/index.js +12 -11
- package/lib/sandbox.js +13 -11
- package/package.json +94 -90
- package/pnpm-workspace.yaml +22 -0
package/lib/index.js
CHANGED
|
@@ -625,17 +625,18 @@ function closeElement(stack, name) {
|
|
|
625
625
|
//#endregion
|
|
626
626
|
//#region lib/sandbox.js
|
|
627
627
|
/**
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
* the shared `[sandbox: …]` marker the model already knows from bash.
|
|
637
|
-
* @module @deepseek-ai/dsh-ab-wechat-scrape/sandbox
|
|
628
|
+
* Whether a thrown value carries the filesystem sandbox denial code.
|
|
629
|
+
*
|
|
630
|
+
* The test is structural rather than `instanceof FsError` on purpose: this
|
|
631
|
+
* package declares its own filesystem dependency, so an error raised by the
|
|
632
|
+
* host's copy is never an instance of this copy's class, and the refusal would
|
|
633
|
+
* silently stop being mapped to the marker the model knows.
|
|
634
|
+
* @param error - the value a write threw.
|
|
635
|
+
* @returns true when the value publishes the backend's denial code.
|
|
638
636
|
*/
|
|
637
|
+
function isSandboxDenial(error) {
|
|
638
|
+
return typeof error === "object" && error !== null && error.code === "FS_SANDBOX_DENIED";
|
|
639
|
+
}
|
|
639
640
|
/**
|
|
640
641
|
* The sandbox-fence controller shared by every article write.
|
|
641
642
|
*
|
|
@@ -674,7 +675,7 @@ var MutationPolicy = class {
|
|
|
674
675
|
* @returns the error to throw — the marker for a sandbox denial, else the original.
|
|
675
676
|
*/
|
|
676
677
|
mapError(error, policy) {
|
|
677
|
-
if (!(error
|
|
678
|
+
if (!isSandboxDenial(error)) return error;
|
|
678
679
|
const mode = policy.mode;
|
|
679
680
|
return new FsError(sandboxDenialMarker(mode), "FS_SANDBOX_DENIED", { cause: error });
|
|
680
681
|
}
|
package/lib/sandbox.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the shared `[sandbox: …]` marker the model already knows from bash.
|
|
11
|
-
* @module @deepseek-ai/dsh-ab-wechat-scrape/sandbox
|
|
2
|
+
* Whether a thrown value carries the filesystem sandbox denial code.
|
|
3
|
+
*
|
|
4
|
+
* The test is structural rather than `instanceof FsError` on purpose: this
|
|
5
|
+
* package declares its own filesystem dependency, so an error raised by the
|
|
6
|
+
* host's copy is never an instance of this copy's class, and the refusal would
|
|
7
|
+
* silently stop being mapped to the marker the model knows.
|
|
8
|
+
* @param error - the value a write threw.
|
|
9
|
+
* @returns true when the value publishes the backend's denial code.
|
|
12
10
|
*/
|
|
11
|
+
function isSandboxDenial(error) {
|
|
12
|
+
return typeof error === 'object' && error !== null
|
|
13
|
+
&& error.code === 'FS_SANDBOX_DENIED';
|
|
14
|
+
}
|
|
13
15
|
import { FsError } from '@deepseek-ai/dsh-fs';
|
|
14
16
|
import { sandboxDenialMarker } from '@deepseek-ai/dsh-sandbox';
|
|
15
17
|
/**
|
|
@@ -52,7 +54,7 @@ export class MutationPolicy {
|
|
|
52
54
|
* @returns the error to throw — the marker for a sandbox denial, else the original.
|
|
53
55
|
*/
|
|
54
56
|
mapError(error, policy) {
|
|
55
|
-
if (!(error
|
|
57
|
+
if (!isSandboxDenial(error))
|
|
56
58
|
return error;
|
|
57
59
|
const mode = policy.mode;
|
|
58
60
|
return new FsError(sandboxDenialMarker(mode), 'FS_SANDBOX_DENIED', { cause: error });
|
package/package.json
CHANGED
|
@@ -1,90 +1,94 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-ab-wechat-scrape",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./lib/index.d.ts",
|
|
10
|
-
"default": "./lib/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./package.json": "./package.json"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"lib/**/*.js",
|
|
16
|
-
"lib/**/*.d.ts",
|
|
17
|
-
"cordis.patch.yml",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"wechat
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"@deepseek-ai/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"@deepseek-ai/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"@
|
|
74
|
-
"@deepseek-ai/
|
|
75
|
-
"@deepseek-ai/
|
|
76
|
-
"@deepseek-ai/
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"@
|
|
85
|
-
"prettier": "^3.3.0"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-ab-wechat-scrape",
|
|
3
|
+
"version": "0.4.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./lib/index.d.ts",
|
|
10
|
+
"default": "./lib/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib/**/*.js",
|
|
16
|
+
"lib/**/*.d.ts",
|
|
17
|
+
"cordis.patch.yml",
|
|
18
|
+
"pnpm-workspace.yaml",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json && tsdown",
|
|
24
|
+
"clean": "rimraf lib",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
+
"test": "node --test",
|
|
27
|
+
"lint": "publint && attw --pack . --profile esm-only",
|
|
28
|
+
"format": "prettier --write \"src/**/*.{ts,mjs}\" \"tests/**/*.mjs\" \"*.{json,yml,md}\"",
|
|
29
|
+
"verify": "npm run typecheck && npm run build && npm run test && npm run lint",
|
|
30
|
+
"prepublishOnly": "npm run verify",
|
|
31
|
+
"prepack": "npm run build",
|
|
32
|
+
"release": "npm publish --access public --no-git-checks"
|
|
33
|
+
},
|
|
34
|
+
"dsh": {
|
|
35
|
+
"bundle": {
|
|
36
|
+
"patch": "./cordis.patch.yml"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
45
|
+
"directory": ".dsh/plugins/dsh-ab-wechat-scrape"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/deepseek-ai/deepseek-harness/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/deepseek-ai/deepseek-harness/tree/main/.dsh/plugins/dsh-ab-wechat-scrape",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"keywords": [
|
|
53
|
+
"deepseek-harness",
|
|
54
|
+
"dsh-plugin",
|
|
55
|
+
"cordis-plugin",
|
|
56
|
+
"wechat",
|
|
57
|
+
"wechat-scrape",
|
|
58
|
+
"scraper"
|
|
59
|
+
],
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
68
|
+
"@deepseek-ai/dsh-fs": "^0.1.7-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.1"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@arethetypeswrong/cli": "^0.18.3",
|
|
74
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
75
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.9",
|
|
76
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.5",
|
|
77
|
+
"@deepseek-ai/dsh-fs": "^0.1.7-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-fs-local": "^0.1.7-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-fs-sandbox": "^0.1.7-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.7-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.7-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.1",
|
|
84
|
+
"@types/node": "^22.10.2",
|
|
85
|
+
"prettier": "^3.3.0",
|
|
86
|
+
"publint": "^0.2.0",
|
|
87
|
+
"rimraf": "^6.0.1",
|
|
88
|
+
"tsdown": "^0.22.2",
|
|
89
|
+
"typescript": "^6.0.3"
|
|
90
|
+
},
|
|
91
|
+
"optionalDependencies": {
|
|
92
|
+
"playwright": "^1.61.1"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# pnpm settings (pnpm v11+: `onlyBuiltDependencies` was REMOVED, replaced by
|
|
2
|
+
# the `allowBuilds` map; the package.json "pnpm" field is also no longer read).
|
|
3
|
+
#
|
|
4
|
+
# koffi: DENIED on purpose. Its prebuilt binary ships in the platform optional
|
|
5
|
+
# dependency (@koromix/koffi-win32-x64) and is verified working; the cnoke
|
|
6
|
+
# install script is only a source-build fallback that would need CMake, and
|
|
7
|
+
# it mis-detects on this machine (its spawnSync probe of `node -e` fails with
|
|
8
|
+
# EBUSY under antivirus interception). Explicit `false` = reviewed, never
|
|
9
|
+
# built, no ERR_PNPM_IGNORED_BUILDS under the default strictDepBuilds.
|
|
10
|
+
#
|
|
11
|
+
# playwright: ALLOWED - its postinstall downloads the chromium binary used by
|
|
12
|
+
# the wechat-scrape tool.
|
|
13
|
+
allowBuilds:
|
|
14
|
+
koffi: false
|
|
15
|
+
playwright: true
|
|
16
|
+
|
|
17
|
+
# The `overrides: fflate: 0.8.2` pin that used to sit here is gone. It worked
|
|
18
|
+
# around attw 0.17's tarball reader, which kept only the last chunk of fflate's
|
|
19
|
+
# streaming Gunzip — and fflate >= 0.8.3 flushes a trailing empty chunk, so
|
|
20
|
+
# `attw --pack` died on any tarball past one chunk. attw >= 0.18.3 accumulates
|
|
21
|
+
# the chunks instead, so the pin is obsolete: do not re-add it, and do not
|
|
22
|
+
# downgrade @arethetypeswrong/cli below 0.18.3.
|