dsh-novel-write-engine 0.2.2 → 0.2.4
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/CHANGELOG.md +45 -0
- package/README.md +74 -34
- package/briefs/P2.md +1 -0
- package/briefs/P5.md +22 -1
- package/briefs/P8.md +67 -1
- package/lib/client.js +344 -57
- package/lib/index.d.ts +140 -35
- package/lib/index.js +3062 -2031
- package/lib/types/client/dto.d.ts +19 -4
- package/lib/types/client/viewmodel.d.ts +21 -3
- package/lib/types/constants.d.ts +3 -1
- package/lib/types/types.d.ts +19 -1
- package/package.json +1 -1
- package/rulepacks/default.yaml +4 -2
- package/skills/entry.md +1 -1
|
@@ -75,7 +75,10 @@ export interface SummaryDto {
|
|
|
75
75
|
quality?: {
|
|
76
76
|
averageScore: number;
|
|
77
77
|
scores: number[];
|
|
78
|
-
trend: number;
|
|
78
|
+
trend: number | null;
|
|
79
|
+
trend_basis?: 'last_five_vs_previous_five' | 'insufficient_samples' | 'insufficient_history';
|
|
80
|
+
samples?: number;
|
|
81
|
+
attempts?: number;
|
|
79
82
|
};
|
|
80
83
|
health?: {
|
|
81
84
|
ok: boolean;
|
|
@@ -88,6 +91,17 @@ export interface SummaryDto {
|
|
|
88
91
|
chapter: number;
|
|
89
92
|
status: string;
|
|
90
93
|
}>;
|
|
94
|
+
advisories?: Array<{
|
|
95
|
+
code: string;
|
|
96
|
+
detail: string;
|
|
97
|
+
hint?: string;
|
|
98
|
+
}>;
|
|
99
|
+
/** Advisory codes the author has already acknowledged in the current check. */
|
|
100
|
+
acknowledgedAdvisories?: number;
|
|
101
|
+
legacy?: Array<{
|
|
102
|
+
code: string;
|
|
103
|
+
detail: string;
|
|
104
|
+
}>;
|
|
91
105
|
}
|
|
92
106
|
export interface ChapterRowDto {
|
|
93
107
|
num: number;
|
|
@@ -115,7 +129,8 @@ export interface ProjectOptionDto {
|
|
|
115
129
|
title: string;
|
|
116
130
|
active: boolean;
|
|
117
131
|
registered: boolean;
|
|
118
|
-
state: 'ok' | 'damaged' | 'missing' | 'unreadable';
|
|
132
|
+
state: 'ok' | 'damaged' | 'missing' | 'not-project' | 'unreadable';
|
|
133
|
+
identity_changed?: boolean;
|
|
119
134
|
}
|
|
120
135
|
export interface PanelSelectionDto {
|
|
121
136
|
root: string | null;
|
|
@@ -124,8 +139,8 @@ export interface PanelSelectionDto {
|
|
|
124
139
|
export interface PanelMissingDto {
|
|
125
140
|
root: string;
|
|
126
141
|
title: string;
|
|
127
|
-
code: 'ENGINE_PROJECT_MISSING' | 'ENGINE_PROJECT_NOT_FOUND';
|
|
128
|
-
reason: 'missing' | 'not-project' | 'damaged' | 'not_registered' | 'unreadable';
|
|
142
|
+
code: 'ENGINE_PROJECT_MISSING' | 'ENGINE_PROJECT_NOT_FOUND' | 'ENGINE_TXN_IN_PROGRESS';
|
|
143
|
+
reason: 'missing' | 'not-project' | 'damaged' | 'not_registered' | 'unreadable' | 'busy';
|
|
129
144
|
hint: string;
|
|
130
145
|
}
|
|
131
146
|
export interface PanelPayloadDto {
|
|
@@ -26,7 +26,9 @@ export interface PanelProject {
|
|
|
26
26
|
label: string;
|
|
27
27
|
active: boolean;
|
|
28
28
|
registered: boolean;
|
|
29
|
-
state: 'ok' | 'damaged' | 'missing' | 'unreadable';
|
|
29
|
+
state: 'ok' | 'damaged' | 'missing' | 'not-project' | 'unreadable';
|
|
30
|
+
identity_changed?: boolean;
|
|
31
|
+
group: 'writing' | 'damaged' | 'missing';
|
|
30
32
|
selected: boolean;
|
|
31
33
|
}
|
|
32
34
|
export interface PanelMissing {
|
|
@@ -105,7 +107,10 @@ export interface PanelView {
|
|
|
105
107
|
quality: {
|
|
106
108
|
averageScore: number;
|
|
107
109
|
scores: number[];
|
|
108
|
-
trend: number;
|
|
110
|
+
trend: number | null;
|
|
111
|
+
trendText: string;
|
|
112
|
+
samples: number;
|
|
113
|
+
attempts: number;
|
|
109
114
|
};
|
|
110
115
|
health: {
|
|
111
116
|
ok: boolean;
|
|
@@ -118,6 +123,19 @@ export interface PanelView {
|
|
|
118
123
|
chapter: number;
|
|
119
124
|
status: string;
|
|
120
125
|
}>;
|
|
126
|
+
/** Machine advisories, shown separately from blocking gates. */
|
|
127
|
+
advisories: Array<{
|
|
128
|
+
code: string;
|
|
129
|
+
detail: string;
|
|
130
|
+
hint: string;
|
|
131
|
+
}>;
|
|
132
|
+
/** How many advisory codes the author already acknowledged. */
|
|
133
|
+
acknowledgedAdvisories: number;
|
|
134
|
+
/** Read-only upgrade findings, shown separately from live errors. */
|
|
135
|
+
legacy: Array<{
|
|
136
|
+
code: string;
|
|
137
|
+
detail: string;
|
|
138
|
+
}>;
|
|
121
139
|
nextTitle: string;
|
|
122
140
|
nextDetail: string;
|
|
123
141
|
nextTool: string;
|
|
@@ -126,7 +144,7 @@ export interface PanelView {
|
|
|
126
144
|
revision: string;
|
|
127
145
|
next: string;
|
|
128
146
|
}
|
|
129
|
-
export declare const PANEL_SCHEMA_VERSION =
|
|
147
|
+
export declare const PANEL_SCHEMA_VERSION = 5;
|
|
130
148
|
/**
|
|
131
149
|
* Project the wire payload into strings. Version mismatch wins over everything
|
|
132
150
|
* else: a stale panel must never render data from another schema as if it were
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ export declare const PLUGIN_NAME = "dsh-novel-write-engine";
|
|
|
4
4
|
export declare const PANEL_ID = "novel-workshop";
|
|
5
5
|
export declare const PANEL_ROUTE = "/api/novel-write-engine/panel";
|
|
6
6
|
export declare const SKILL_NAME = "novel-write-engine";
|
|
7
|
-
export declare const REMOTE_VERSION =
|
|
7
|
+
export declare const REMOTE_VERSION = 5;
|
|
8
8
|
/** The panel is a recent-history view; the wire payload and UI use one cap. */
|
|
9
9
|
export declare const PANEL_CHAPTER_LIMIT = 30;
|
|
10
10
|
/** Project-relative locations. Every write goes through these constants. */
|
|
11
11
|
export declare const PROJECT_FILE = "novel.yaml";
|
|
12
12
|
export declare const OUTLINE_FILE = "outline/outline.yaml";
|
|
13
|
+
/** Last outline replaced by a normal planning write; one level is enough for repair. */
|
|
14
|
+
export declare const OUTLINE_DEPRECATED_FILE = "outline/outline.deprecated.yaml";
|
|
13
15
|
export declare const WORLDBOOK_FILE = "outline/worldbook.yaml";
|
|
14
16
|
export declare const STATE_DIR = "state";
|
|
15
17
|
export declare const CHAPTERS_DIR = "chapters";
|
package/lib/types/types.d.ts
CHANGED
|
@@ -63,9 +63,13 @@ export declare const ERROR_CODES: {
|
|
|
63
63
|
readonly PROJECT_IDENTITY_MISMATCH: "ENGINE_PROJECT_IDENTITY_MISMATCH";
|
|
64
64
|
readonly PROJECT_EXISTS: "ENGINE_PROJECT_EXISTS";
|
|
65
65
|
readonly STAGE_ORDER: "ENGINE_STAGE_ORDER";
|
|
66
|
+
/** The exact same keyed submission already failed in the same context. */
|
|
67
|
+
readonly RETRY_UNCHANGED: "ENGINE_RETRY_UNCHANGED";
|
|
66
68
|
readonly GATE_BLOCKED: "ENGINE_GATE_BLOCKED";
|
|
67
69
|
readonly READING_PROOF_INVALID: "ENGINE_READING_PROOF_INVALID";
|
|
68
70
|
readonly SCORE_MISMATCH: "ENGINE_SCORE_MISMATCH";
|
|
71
|
+
/** A revision tried to rewrite reviewer-owned issue fields. */
|
|
72
|
+
readonly ISSUE_IMMUTABLE: "ENGINE_ISSUE_IMMUTABLE";
|
|
69
73
|
readonly DELTA_UNVERIFIED: "ENGINE_DELTA_UNVERIFIED";
|
|
70
74
|
readonly RESOURCE_NEGATIVE_BALANCE: "ENGINE_RESOURCE_NEGATIVE_BALANCE";
|
|
71
75
|
readonly SCHEMA_TOO_NEW: "ENGINE_SCHEMA_TOO_NEW";
|
|
@@ -464,6 +468,8 @@ export interface ForeshadowsDocument {
|
|
|
464
468
|
resolved_at: number | null;
|
|
465
469
|
description: string;
|
|
466
470
|
anchor?: string;
|
|
471
|
+
/** New 0.2.3 writes are distinguishable from pre-0.2.3 rows by this marker. */
|
|
472
|
+
format_version?: 1;
|
|
467
473
|
advance_log: Array<{
|
|
468
474
|
chapter: number;
|
|
469
475
|
note: string;
|
|
@@ -786,7 +792,13 @@ export interface BookReport {
|
|
|
786
792
|
min: number;
|
|
787
793
|
max: number;
|
|
788
794
|
last_five: number[];
|
|
789
|
-
|
|
795
|
+
/** Null when there are not enough distinct chapter reviews to compare. */
|
|
796
|
+
trend: number | null;
|
|
797
|
+
trend_basis: 'last_five_vs_previous_five' | 'insufficient_samples' | 'insufficient_history';
|
|
798
|
+
/** Number of chapters represented by a final review. */
|
|
799
|
+
samples: number;
|
|
800
|
+
/** Committed review rounds for this report, including history. */
|
|
801
|
+
attempts: number;
|
|
790
802
|
dimensions: Array<{
|
|
791
803
|
id: string;
|
|
792
804
|
average: number;
|
|
@@ -1013,6 +1025,8 @@ export interface StatusReport {
|
|
|
1013
1025
|
chapter: number;
|
|
1014
1026
|
/** The chapter the pipeline is currently working on. */
|
|
1015
1027
|
active_chapter: number;
|
|
1028
|
+
/** SHA-256 of the active manuscript, or null when the stage has no draft. */
|
|
1029
|
+
manuscript_hash: string | null;
|
|
1016
1030
|
stage: Stage;
|
|
1017
1031
|
rounds: RoundCounters;
|
|
1018
1032
|
blocking: BlockingItem[];
|
|
@@ -1089,6 +1103,10 @@ export interface AuditRow {
|
|
|
1089
1103
|
/** True when no transaction started: the gate/input refused the call. */
|
|
1090
1104
|
attempt?: boolean;
|
|
1091
1105
|
blocking?: BlockingItem[];
|
|
1106
|
+
/** Keyed operation fingerprint; lets an identical failed retry be refused. */
|
|
1107
|
+
retry_key?: string;
|
|
1108
|
+
/** Brief/stage/revision context for `retry_key`. */
|
|
1109
|
+
retry_context?: string;
|
|
1092
1110
|
}
|
|
1093
1111
|
/** One diff hunk between two revisions of a chapter. */
|
|
1094
1112
|
export interface DiffReport {
|
package/package.json
CHANGED
package/rulepacks/default.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
schema_version: 1
|
|
2
2
|
name: default
|
|
3
|
-
version: "1.0.
|
|
3
|
+
version: "1.0.1"
|
|
4
4
|
|
|
5
5
|
lexicon:
|
|
6
6
|
zero_tolerance:
|
|
@@ -145,7 +145,9 @@ punctuation:
|
|
|
145
145
|
base: { 战斗/动作章: 3, 日常过渡章: 4, 情感爆发章: 6, 纯叙事章: 3 }
|
|
146
146
|
scale_words: 3000
|
|
147
147
|
token: "——"
|
|
148
|
-
|
|
148
|
+
# Chinese web fiction often uses short sentences; 8/100 flagged ordinary
|
|
149
|
+
# narrative (e.g. 9.52/100). Keep a ceiling, but calibrate it for Chinese.
|
|
150
|
+
period_density: { min: 1.5, max: 10 }
|
|
149
151
|
ellipsis_run: { max: 1, token: "……" }
|
|
150
152
|
uniform_sentence: { min_sentences: 8, ratio: 0.6 }
|
|
151
153
|
consecutive_le: { max: 3, char: "了" }
|
package/skills/entry.md
CHANGED
|
@@ -25,7 +25,7 @@ description: 引擎版小说创作流程——状态、门控、字数与写盘
|
|
|
25
25
|
|
|
26
26
|
## 书级规划(0.2.0)
|
|
27
27
|
|
|
28
|
-
新项目先 `novel_guide`;推荐但不强制:`novel_blueprint`(蓝图/卷)→ `novel_outline`(章卡)→ `novel_worldbook`(设定集)。已有大纲可用 `novel_outline_import` 导入 Markdown/YAML/JSON
|
|
28
|
+
新项目先 `novel_guide`;推荐但不强制:`novel_blueprint`(蓝图/卷)→ `novel_outline`(章卡)→ `novel_worldbook`(设定集)。已有大纲可用 `novel_outline_import` 导入 Markdown/YAML/JSON。`novel_outline` 的章卡按 `num`、卷按 `title` upsert:只提交要改的对象,省略的卡保持不动;删除必须显式 `remove`/`remove_volumes`,不要用重交全量卡来“确保存在”。只要存在章卡,P2/P3 就按章卡校验标题、场景、字数与 cast;严格模式还要求章卡必须存在。要改已归档章先 `novel_reopen`(必须带 reason)。
|
|
29
29
|
|
|
30
30
|
## 流程路由
|
|
31
31
|
|