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 CHANGED
@@ -625,17 +625,18 @@ function closeElement(stack, name) {
625
625
  //#endregion
626
626
  //#region lib/sandbox.js
627
627
  /**
628
- * The sandbox-fence controller every article write carries, mirroring the
629
- * framework's own file-writing tools (`tool-fs`'s `FsSandboxController`,
630
- * `tool-str-replace-editor`'s `MutationPolicy`). `fs` is a required injection of
631
- * this plugin (declared in `inject`), so `ctx.fs` is present when `apply` runs;
632
- * the controller reads `ctx.fs.sandboxMode` once to learn whether a confining
633
- * backend is mounted, and refuses the row at load if the backend confines but no
634
- * policy service can name the calling session's workspace. Each call then
635
- * resolves the per-session policy and stamps it on the write; a refusal becomes
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 instanceof FsError) || error.code !== "FS_SANDBOX_DENIED") return 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
- * The sandbox-fence controller every article write carries, mirroring the
3
- * framework's own file-writing tools (`tool-fs`'s `FsSandboxController`,
4
- * `tool-str-replace-editor`'s `MutationPolicy`). `fs` is a required injection of
5
- * this plugin (declared in `inject`), so `ctx.fs` is present when `apply` runs;
6
- * the controller reads `ctx.fs.sandboxMode` once to learn whether a confining
7
- * backend is mounted, and refuses the row at load if the backend confines but no
8
- * policy service can name the calling session's workspace. Each call then
9
- * resolves the per-session policy and stamps it on the write; a refusal becomes
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 instanceof FsError) || error.code !== 'FS_SANDBOX_DENIED')
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.5",
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
- "README.md",
19
- "LICENSE"
20
- ],
21
- "scripts": {
22
- "build": "tsc -p tsconfig.json && tsdown",
23
- "clean": "rimraf lib",
24
- "typecheck": "tsc -p tsconfig.json --noEmit",
25
- "test": "node --test",
26
- "lint": "publint && attw --pack . --profile esm-only",
27
- "format": "prettier --write \"src/**/*.{ts,mjs}\" \"tests/**/*.mjs\" \"*.{json,yml,md}\"",
28
- "verify": "npm run typecheck && npm run build && npm run test && npm run lint",
29
- "prepublishOnly": "npm run verify",
30
- "prepack": "npm run build",
31
- "release": "npm publish --access public --no-git-checks"
32
- },
33
- "dsh": {
34
- "bundle": {
35
- "patch": "./cordis.patch.yml"
36
- }
37
- },
38
- "publishConfig": {
39
- "access": "public"
40
- },
41
- "repository": {
42
- "type": "git",
43
- "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
44
- "directory": ".dsh/plugins/dsh-ab-wechat-scrape"
45
- },
46
- "bugs": {
47
- "url": "https://github.com/deepseek-ai/deepseek-harness/issues"
48
- },
49
- "homepage": "https://github.com/deepseek-ai/deepseek-harness/tree/main/.dsh/plugins/dsh-ab-wechat-scrape",
50
- "license": "MIT",
51
- "keywords": [
52
- "deepseek-harness",
53
- "dsh-plugin",
54
- "cordis-plugin",
55
- "wechat",
56
- "wechat-scrape",
57
- "scraper"
58
- ],
59
- "engines": {
60
- "node": "^22.19.0 || >=24.0.0"
61
- },
62
- "dependencies": {
63
- "@deepseek-ai/schemastery": "^3.18.4"
64
- },
65
- "peerDependencies": {
66
- "@deepseek-ai/cordis": "^4.0.4",
67
- "@deepseek-ai/dsh-tools": "^0.1.7-rc.1"
68
- },
69
- "devDependencies": {
70
- "@deepseek-ai/cordis": "^4.0.4",
71
- "@deepseek-ai/cordis-plugin-include": "^1.0.9",
72
- "@deepseek-ai/cordis-plugin-loader": "^1.0.5",
73
- "@deepseek-ai/dsh-fs": "^0.1.7-rc.1",
74
- "@deepseek-ai/dsh-fs-local": "^0.1.7-rc.1",
75
- "@deepseek-ai/dsh-fs-sandbox": "^0.1.7-rc.1",
76
- "@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1",
77
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.7-rc.1",
78
- "@deepseek-ai/dsh-system-prompt": "^0.1.7-rc.1",
79
- "@types/node": "^22.10.2",
80
- "tsdown": "^0.22.2",
81
- "typescript": "^6.0.3",
82
- "rimraf": "^6.0.1",
83
- "publint": "^0.2.0",
84
- "@arethetypeswrong/cli": "^0.18.3",
85
- "prettier": "^3.3.0"
86
- },
87
- "optionalDependencies": {
88
- "playwright": "^1.61.1"
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.