dsh-novel-generator 0.1.18 → 0.1.19

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.
Files changed (2) hide show
  1. package/index.js +9 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1389,7 +1389,7 @@ async function bootstrap(ctx, root) {
1389
1389
  }
1390
1390
  }
1391
1391
  return {
1392
- revision: '2026-10-21.2',
1392
+ revision: '2026-10-21.3',
1393
1393
  projects,
1394
1394
  models: {
1395
1395
  default: modelCatalog.default || null,
@@ -2114,8 +2114,15 @@ function registerSnapshot(ctx, root, registry, projectId, targetDay) {
2114
2114
  }
2115
2115
 
2116
2116
  /** Wipe every snapshot (and its files) so the work can be rebuilt from day 1. */
2117
- function startSnapshotReset(ctx, root, registry, body) {
2117
+ async function startSnapshotReset(ctx, root, registry, body) {
2118
2118
  const projectId = asText(body.projectId);
2119
+ // Validate before queueing, like the other job routes: an unknown work must
2120
+ // come back as a plain 404 instead of a job that fails a second later.
2121
+ const preview = await readProject(root, projectId);
2122
+ const previewUnit = Math.max(1, preview.timeline.unitDays || 30);
2123
+ if (Math.floor(lastChapterEnd(preview) / previewUnit) * previewUnit < previewUnit) {
2124
+ throw httpError(409, '故事还不到一个快照间隔,没有可重建的快照');
2125
+ }
2119
2126
  return startJob(registry, { kind: 'snapshot-reset', projectId }, async (job) => {
2120
2127
  const project = await readProject(root, projectId);
2121
2128
  const unit = Math.max(1, project.timeline.unitDays || 30);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-novel-generator",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
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",