dsh-novel-generator 0.1.28 → 0.1.30

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 CHANGED
@@ -37,6 +37,7 @@ dsh plugin --profile web add dsh-novel-generator
37
37
  - 也不收录上一份快照已经收录过的章节(`结束日 < 上一快照日` 的跳过),所以**每一章恰好被一份快照收录一次**。
38
38
  - 例:间隔 30、章节各 10 天 → 第 30 天快照收录第 1、2 章;第 60 天快照收录第 3、4、5 章。
39
39
  - 这样改间隔不会把旧快照重排:网格随当前间隔移动,自动生成只沿着链条向前推进,断档的地方留给你手动补。
40
+ - **空段落点不调用模型**:如果某个网格点没有可收录的章节(例如一章就占满整个间隔),插件直接把上一版快照抄过来、注明"这段时间没有已写章节",既省一次模型调用,也避免模型凭空编出世界设定——那种编造会污染后续所有章节的提示。落点那一章不会因此丢失:写下一章时它照样出现在「已发生的章节梗概」里。
40
41
  - 同一部作品同一时间只跑一个快照任务,避免并发把同一个点重复生成。
41
42
 
42
43
  - **重置**:时间线右上角的「重置快照」会清空全部快照,再按当前间隔从第 1 格逐格重建到故事末端(确认框里写明要生成几份)。
@@ -86,15 +87,24 @@ dsh plugin --profile web add dsh-novel-generator
86
87
  - 正文为空时按钮不可点,接口也会拒绝(400);修改意见为空同样拒绝。
87
88
  - **重写结果只放进编辑区、不自动保存**,状态变成「未保存」,你确认后再点「保存」——避免 AI 的改动直接覆盖原稿。
88
89
 
89
- ## 附属子插件:小说工坊 · 作者预设
90
+ ## 「小说工坊 · 作者」预设(随主插件一起装)
90
91
 
91
- 另有一个**独立包** `dsh-novel-author-preset`,只负责往 DSH 注册一个 Agent 预设「小说工坊 · 作者」:
92
+ 本插件的 `cordis.patch.yml` 声明了**两行**,所以装一个包就有两件事:
92
93
 
93
- - 装上它(`dsh plugin --profile web add dsh-novel-author-preset`),作品列表的「预设」与「设置 → 预设」里就多出这一项,**新建作品默认用它**;
94
- - 卸掉它,预设立刻消失;已绑定的作品不会因此损坏——重建会话时检测到预设已不在,会自动退回 profile 的默认预设。
94
+ | 行 id | 作用 |
95
+ |---|---|
96
+ | `dsh-novel-generator` | 小说工坊本体(时间线、章节、快照、前置提示词) |
97
+ | `preset-novel-studio-author` | Agent 预设「小说工坊 · 作者」 |
98
+
99
+ - 在「设置 → 插件」里,这两行都挂在**小说工坊**条目下,**可以分别启停**。
100
+ - 关掉预设行只是把它从预设列表里隐藏;小说工坊照常工作(作品可以改用 standard 等任何已装预设)。
101
+ - 单独关掉整条小说工坊,预设也会随之消失,两者互不残留。
102
+ - 装了它之后**新建作品默认用这个预设**;预设被关掉或卸载时,重建会话会自动退回 profile 默认预设,作品不会坏。
95
103
 
96
104
  预设内容刻意做得很薄:三句人设(你是小说写作者/只输出正文/文风视角篇幅以用户要求为准)+ 关闭运行时上下文 + **不挂任何工具** + 只保留上下文压缩。所有文学倾向都交给作品级「前置提示词」。
97
105
 
106
+ > 早先发布过的独立包 `dsh-novel-author-preset` 已并入本插件;它从 0.2.0 起是空补丁,装过 0.1.0 的环境请 `dsh plugin remove dsh-novel-author-preset`。
107
+
98
108
  ## 迁移、导入与会话
99
109
 
100
110
  - **改预设**:作品列表每行的「预设」改的是「下次建会话时用哪个预设」。会话在创建时就固定了预设,所以保存后会提示「重建会话后生效」——要立刻换,点同一行的「重建会话」。
package/cordis.patch.yml CHANGED
@@ -1,4 +1,43 @@
1
+ # Two rows, so the plugin list shows them together under 小说工坊 and each can be
2
+ # switched independently:
3
+ #
4
+ # 1. `dsh-novel-generator` — the studio itself (timeline, chapters, snapshots).
5
+ # 2. `preset-novel-studio-author` — the blank author Agent preset. Turning this
6
+ # row off in the plugin list simply hides the preset; the studio keeps
7
+ # working with whatever preset the profile already offers.
8
+ #
9
+ # The second row is what used to be the separate `dsh-novel-author-preset`
10
+ # package: shipping it here means installing the studio brings the preset too.
1
11
  - insert:
2
12
  - id: dsh-novel-generator
3
13
  name: 'dsh-novel-generator'
4
14
  config: {}
15
+ - id: preset-novel-studio-author
16
+ name: '@deepseek-ai/dsh-agent-preset'
17
+ config:
18
+ id: novel-studio-author
19
+ name: 小说工坊 · 作者
20
+ description: 小说工坊自带的空白写作预设,只规定"写正文"这件事,不预设任何文风或视角。
21
+ order: 60
22
+ plugins:
23
+ - id: persona
24
+ name: '@deepseek-ai/dsh-persona'
25
+ config:
26
+ # Short, neutral, output contract only; style and viewpoint belong
27
+ # to the work-level preface prompt.
28
+ prefix: |-
29
+ 你是小说写作者,负责按用户给出的设定、梗概与要求,写出完整的中文小说正文。
30
+ 只输出正文本身:不要解释、不要提纲、不要评论、不要加标题行。
31
+ 文风、叙事视角、人称与篇幅一律以上下文中的要求为准,不要自行添加偏好。
32
+ complete: true
33
+ includeRuntimeContext: false
34
+ # Compaction only: a long serial is a long conversation, and the writer
35
+ # has no use for shell, files, web or delegation.
36
+ - id: compaction
37
+ name: cordis:group
38
+ group: true
39
+ isolate:
40
+ compaction: true
41
+ config:
42
+ - id: compaction-basic
43
+ name: '@deepseek-ai/dsh-compaction-basic'
package/index.js CHANGED
@@ -1499,7 +1499,7 @@ async function bootstrap(ctx, root) {
1499
1499
  }
1500
1500
  }
1501
1501
  return {
1502
- revision: '2026-10-27.16',
1502
+ revision: '2026-10-27.17',
1503
1503
  projects,
1504
1504
  models: {
1505
1505
  default: modelCatalog.default || null,
@@ -2333,6 +2333,36 @@ function registerSnapshot(ctx, root, registry, projectId, targetDay) {
2333
2333
  const project = await readProject(root, projectId);
2334
2334
  const base = (project.snapshots || []).filter((snapshot) => snapshot.day < point).pop() || null;
2335
2335
  const chapters = chaptersForPoint(project, base ? base.day : 0, point);
2336
+ // A point whose stretch holds no chapter is a blank update: carry the
2337
+ // previous snapshot forward verbatim instead of asking the model to invent
2338
+ // a world out of nothing — that invented text would then feed every later
2339
+ // chapter. No material, no call.
2340
+ if (chapters.length === 0) {
2341
+ const carried = {
2342
+ snapshotId: randomUUID(),
2343
+ day: point,
2344
+ createdAt: Date.now(),
2345
+ unitDays: unit,
2346
+ world: (base && base.world) || '',
2347
+ characters: (base && base.characters) || [],
2348
+ factions: (base && base.factions) || [],
2349
+ relations: (base && base.relations) || [],
2350
+ items: (base && base.items) || [],
2351
+ events: (base && base.events) || [],
2352
+ summary: base
2353
+ ? `第 ${base.day} 天至第 ${point} 天之间没有已写章节,沿用上一版设定。`
2354
+ : `第 ${point} 天之前还没有已写章节。`,
2355
+ };
2356
+ await mutateProject(root, projectId, (draft) => {
2357
+ draft.snapshots = (draft.snapshots || []).filter((entry) => entry.day !== point);
2358
+ draft.snapshots.push(carried);
2359
+ draft.snapshots.sort((a, b) => a.day - b.day);
2360
+ return carried;
2361
+ });
2362
+ await exportSnapshot(project, carried);
2363
+ made.push(point);
2364
+ continue;
2365
+ }
2336
2366
  job.message = `正在生成第 ${point} 天的世界快照(第 ${made.length + 1}/${points.length} 份,目标第 ${target} 天)`;
2337
2367
  const reply = await askAgent(ctx, root, project, snapshotPrompt(project, base, chapters, point), (note) => {
2338
2368
  job.message = note;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-novel-generator",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "type": "module",
5
5
  "description": "Novel studio for DeepSeek Harness: a draggable story timeline, world snapshots, chapter outlines, and chapters written by the work's own agent.",
6
6
  "license": "MIT",