@cloud411716/fancy-webnovel 3.0.0 → 3.0.3

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/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # fancy-webnovel
2
+
3
+ DeepSeek Harness(DSH)网文创作插件组合包。它把工作区初始化、扫榜、选题、拆书、故事构建、素材库和抖音图文采集注册成 `/fancy-*` 命令。
4
+
5
+ ## 环境
6
+
7
+ - Node.js >= 18
8
+ - DSH `>=0.1.5-rc.2 <0.2.0 || >=0.2.2-rc.3 <0.3.0`
9
+ - 需要图形桌面时(首次抖音登录、番茄 OCR 截图)要能打开 Chrome
10
+
11
+ ## 安装
12
+
13
+ ```bash
14
+ dsh plugin --profile web add @cloud411716/fancy-webnovel
15
+ ```
16
+
17
+ 安装后确认:
18
+
19
+ ```bash
20
+ dsh --profile web --dump-config
21
+ ```
22
+
23
+ 应能看到 `# == @cloud411716/fancy-webnovel` 这一层。
24
+
25
+ 如果 pnpm 报:
26
+
27
+ ```text
28
+ ERR_PNPM_IGNORED_BUILDS Ignored build scripts: tesseract.js@7.0.0
29
+ ```
30
+
31
+ 编辑 profile 的 `pnpm-workspace.yaml`:
32
+
33
+ ```yaml
34
+ allowBuilds:
35
+ tesseract.js: true
36
+ ```
37
+
38
+ 然后重新执行安装。`tesseract.js` 的 postinstall 只是 OpenCollective 提示;不允许构建时 OCR 模式不可用,但插件其余功能不受影响。
39
+
40
+ ## 依赖解析
41
+
42
+ 依赖声明在 `dependencies` / `peerDependencies` 中。用 `dsh plugin add` 从 npm 安装时,
43
+ 第三方依赖会进入 profile 的 `node_modules`,而不是插件包目录;Node 的向上查找会从
44
+ 插件包解析到这些依赖。插件自带的 `node_modules` 只用于本地 checkout 和测试,不是运行前提。
45
+
46
+ 需要与宿主共享实例的 DSH 包使用 `peerDependencies`(并保留 `devDependencies` 供本地测试),
47
+ 不会被插件重复安装。
48
+
49
+ ## 主要命令
50
+
51
+ ```text
52
+ /fancy-bootstrap
53
+ /fancy-scan
54
+ /fancy-topic
55
+ /fancy-analyze
56
+ /fancy-import
57
+ /fancy-export
58
+ /fancy-project
59
+ /fancy-db
60
+ /fancy-material
61
+ /fancy-douyin
62
+ /fancy-build
63
+ ```
64
+
65
+ 具体用法见各命令的 `/fancy-* help` 和 `docs/`。
package/cordis.patch.yml CHANGED
@@ -6,4 +6,3 @@
6
6
  - insert:
7
7
  - id: fancy-webnovel
8
8
  name: "@cloud411716/fancy-webnovel"
9
- from: "./index.js"
package/index.js CHANGED
@@ -11,6 +11,7 @@ import { apply as applyProject } from './plugins/fancy-project/index.js';
11
11
  import { apply as applyMaterial } from './plugins/fancy-material/index.js';
12
12
  import { apply as applyDouyin } from './plugins/fancy-douyin/index.js';
13
13
 
14
+ export const name = 'fancy-webnovel';
14
15
  export const inject = ['commands', 'userQuestions', 'tools'];
15
16
 
16
17
  export async function apply(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "3.0.0",
3
+ "version": "3.0.3",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -29,7 +29,8 @@
29
29
  "#material-db": "./lib/material-db.js"
30
30
  },
31
31
  "engines": {
32
- "node": ">=18.0.0"
32
+ "node": ">=18.0.0",
33
+ "dsh": ">=0.1.5-rc.2 <0.2.0 || >=0.2.2-rc.3 <0.3.0"
33
34
  },
34
35
  "scripts": {
35
36
  "test": "node tests/run.js",
@@ -38,7 +39,6 @@
38
39
  "files": [
39
40
  "index.js",
40
41
  "lib/",
41
- "templates.js",
42
42
  "cordis.patch.yml",
43
43
  "README.md",
44
44
  "docs/",
@@ -54,13 +54,9 @@
54
54
  "tesseract.js": "^7.0.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
58
- "@deepseek-ai/dsh-tools": "*"
57
+ "@deepseek-ai/dsh-tools": ">=0.1.5-rc.2 <0.2.0 || >=0.2.2-rc.3 <0.3.0"
59
58
  },
60
59
  "peerDependenciesMeta": {
61
- "@deepseek-ai/dsh-llm": {
62
- "optional": true
63
- },
64
60
  "@deepseek-ai/dsh-tools": {
65
61
  "optional": true
66
62
  }
@@ -76,5 +72,8 @@
76
72
  "bin": {
77
73
  "storydb": "./plugins/fancy-story-builder/storydb/cli.js",
78
74
  "fancy-mcp": "./plugins/fancy-story-builder/storydb/mcp.js"
75
+ },
76
+ "devDependencies": {
77
+ "@deepseek-ai/dsh-tools": "0.1.5-rc.2"
79
78
  }
80
79
  }
@@ -72,9 +72,11 @@ export async function countByKind(root, genres) {
72
72
  const { db } = await connectMaterial(root);
73
73
  try {
74
74
  const list = (genres || []).filter(Boolean);
75
+ // count() over a CONTAINSANY predicate counts every matching array
76
+ // element, not every record. Count ids through a subquery instead.
75
77
  const rows = list.length
76
78
  ? await db.query(
77
- 'SELECT kind, count() AS n FROM material WHERE genres CONTAINSANY $genres GROUP BY kind;',
79
+ 'SELECT kind, count() AS n FROM (SELECT id, kind FROM material WHERE genres CONTAINSANY $genres) GROUP BY kind;',
78
80
  { genres: list },
79
81
  )
80
82
  : await db.query('SELECT kind, count() AS n FROM material GROUP BY kind;');
@@ -99,7 +101,7 @@ export async function countKind(root, kind, genres) {
99
101
  const list = (genres || []).filter(Boolean);
100
102
  const rows = list.length
101
103
  ? await db.query(
102
- 'SELECT count() AS n FROM material WHERE kind = $kind AND genres CONTAINSANY $genres GROUP ALL;',
104
+ 'SELECT count() AS n FROM (SELECT VALUE id FROM material WHERE kind = $kind AND genres CONTAINSANY $genres) GROUP ALL;',
103
105
  { kind, genres: list },
104
106
  )
105
107
  : await db.query(