dsh-novel-write-engine 0.1.3 → 0.2.1
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 +172 -74
- package/briefs/P1.md +1 -0
- package/briefs/P2.md +4 -0
- package/briefs/P3.md +1 -1
- package/briefs/P4.md +1 -1
- package/briefs/P6.md +5 -2
- package/briefs/P8.md +2 -0
- package/lib/client.js +514 -17
- package/lib/index.d.ts +775 -12
- package/lib/index.js +5369 -390
- package/lib/types/client/dto.d.ts +51 -0
- package/lib/types/client/viewmodel.d.ts +46 -1
- package/lib/types/constants.d.ts +23 -3
- package/lib/types/next-reasons.d.ts +6 -0
- package/lib/types/types.d.ts +417 -6
- package/package.json +1 -1
- package/presets/novel-write-engine.patch.yml +1 -1
- package/skills/entry.md +22 -8
|
@@ -35,6 +35,57 @@ export interface SummaryDto {
|
|
|
35
35
|
};
|
|
36
36
|
/** True only when the book target is reached; done alone means the chapter is archived. */
|
|
37
37
|
finished?: boolean;
|
|
38
|
+
book?: {
|
|
39
|
+
premise: string;
|
|
40
|
+
logline: string;
|
|
41
|
+
strict: boolean;
|
|
42
|
+
target: number | null;
|
|
43
|
+
outline: {
|
|
44
|
+
present: boolean;
|
|
45
|
+
total: number;
|
|
46
|
+
planned: number;
|
|
47
|
+
archived: number;
|
|
48
|
+
target?: number | null;
|
|
49
|
+
missing_cards?: number;
|
|
50
|
+
planned_coverage?: number | null;
|
|
51
|
+
archived_coverage?: number | null;
|
|
52
|
+
coverage: number;
|
|
53
|
+
card_coverage?: number;
|
|
54
|
+
volumes: Array<{
|
|
55
|
+
title: string;
|
|
56
|
+
start: number;
|
|
57
|
+
end: number;
|
|
58
|
+
planned: number;
|
|
59
|
+
archived: number;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
worldbook: {
|
|
63
|
+
present: boolean;
|
|
64
|
+
characters: number;
|
|
65
|
+
locations: number;
|
|
66
|
+
factions: number;
|
|
67
|
+
rules: number;
|
|
68
|
+
glossary: number;
|
|
69
|
+
backstory: number;
|
|
70
|
+
facts?: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
quality?: {
|
|
74
|
+
averageScore: number;
|
|
75
|
+
scores: number[];
|
|
76
|
+
trend: number;
|
|
77
|
+
};
|
|
78
|
+
health?: {
|
|
79
|
+
ok: boolean;
|
|
80
|
+
blocking: number;
|
|
81
|
+
stateErrors: number;
|
|
82
|
+
};
|
|
83
|
+
activity?: Array<{
|
|
84
|
+
at: string;
|
|
85
|
+
op: string;
|
|
86
|
+
chapter: number;
|
|
87
|
+
status: string;
|
|
88
|
+
}>;
|
|
38
89
|
}
|
|
39
90
|
export interface ChapterRowDto {
|
|
40
91
|
num: number;
|
|
@@ -44,6 +44,51 @@ export interface PanelView {
|
|
|
44
44
|
averageScore: number;
|
|
45
45
|
blocking: number;
|
|
46
46
|
};
|
|
47
|
+
book: {
|
|
48
|
+
present: boolean;
|
|
49
|
+
strict: boolean;
|
|
50
|
+
premise: string;
|
|
51
|
+
target: number | null;
|
|
52
|
+
planned: number;
|
|
53
|
+
outlineTotal: number;
|
|
54
|
+
archivedCards: number;
|
|
55
|
+
coverage: number;
|
|
56
|
+
missingCards: number;
|
|
57
|
+
plannedCoverage: number | null;
|
|
58
|
+
archivedCoverage: number | null;
|
|
59
|
+
cardCoverage: number;
|
|
60
|
+
volumes: Array<{
|
|
61
|
+
title: string;
|
|
62
|
+
range: string;
|
|
63
|
+
planned: number;
|
|
64
|
+
archived: number;
|
|
65
|
+
}>;
|
|
66
|
+
worldbook: {
|
|
67
|
+
characters: number;
|
|
68
|
+
locations: number;
|
|
69
|
+
factions: number;
|
|
70
|
+
rules: number;
|
|
71
|
+
glossary: number;
|
|
72
|
+
backstory: number;
|
|
73
|
+
facts?: number;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
quality: {
|
|
77
|
+
averageScore: number;
|
|
78
|
+
scores: number[];
|
|
79
|
+
trend: number;
|
|
80
|
+
};
|
|
81
|
+
health: {
|
|
82
|
+
ok: boolean;
|
|
83
|
+
blocking: number;
|
|
84
|
+
stateErrors: number;
|
|
85
|
+
};
|
|
86
|
+
activity: Array<{
|
|
87
|
+
at: string;
|
|
88
|
+
op: string;
|
|
89
|
+
chapter: number;
|
|
90
|
+
status: string;
|
|
91
|
+
}>;
|
|
47
92
|
nextTitle: string;
|
|
48
93
|
nextDetail: string;
|
|
49
94
|
nextTool: string;
|
|
@@ -52,7 +97,7 @@ export interface PanelView {
|
|
|
52
97
|
revision: string;
|
|
53
98
|
next: string;
|
|
54
99
|
}
|
|
55
|
-
export declare const PANEL_SCHEMA_VERSION =
|
|
100
|
+
export declare const PANEL_SCHEMA_VERSION = 3;
|
|
56
101
|
/**
|
|
57
102
|
* Project the wire payload into strings. Version mismatch wins over everything
|
|
58
103
|
* else: a stale panel must never render data from another schema as if it were
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ 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 = 3;
|
|
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
|
+
export declare const OUTLINE_FILE = "outline/outline.yaml";
|
|
13
|
+
export declare const WORLDBOOK_FILE = "outline/worldbook.yaml";
|
|
12
14
|
export declare const STATE_DIR = "state";
|
|
13
15
|
export declare const CHAPTERS_DIR = "chapters";
|
|
14
16
|
export declare const PLAN_DIR = "plans";
|
|
@@ -16,6 +18,9 @@ export declare const REVIEW_DIR = "reviews";
|
|
|
16
18
|
export declare const CHECK_DIR = "checks";
|
|
17
19
|
export declare const EXPORT_DIR = "exports";
|
|
18
20
|
export declare const BACKUP_DIR = "backups";
|
|
21
|
+
export declare const HISTORY_DIR = "history";
|
|
22
|
+
/** Brief receipts are append-only evidence, separate from content transactions. */
|
|
23
|
+
export declare const BRIEF_RECEIPTS_FILE = "state/briefs.yaml";
|
|
19
24
|
export declare const OUTLINE_DIR = "outline";
|
|
20
25
|
export declare const LOCK_FILE = ".engine.lock";
|
|
21
26
|
export declare const STAGING_DIR = ".staging";
|
|
@@ -41,6 +46,13 @@ export declare const planWorldFile: (chapter: number) => string;
|
|
|
41
46
|
export declare const planChapterFile: (chapter: number) => string;
|
|
42
47
|
export declare const reviewFile: (chapter: number) => string;
|
|
43
48
|
export declare const checkFile: (chapter: number) => string;
|
|
49
|
+
export declare const reviewHistoryFile: (chapter: number, revision: number) => string;
|
|
50
|
+
export declare const checkHistoryFile: (chapter: number, revision: number) => string;
|
|
51
|
+
export declare const chapterHistoryFile: (chapter: number, revision: number) => string;
|
|
52
|
+
export declare const deprecatedHistoryFile: (chapter: number, revision: number) => string;
|
|
53
|
+
export declare const planHistoryFile: (chapter: number, revision: number) => string;
|
|
54
|
+
export declare const HISTORY_KINDS: readonly ["reviews", "checks", "chapters", "deprecated", "plans"];
|
|
55
|
+
export type HistoryKind = (typeof HISTORY_KINDS)[number];
|
|
44
56
|
/** Limits that are structural, not taste. */
|
|
45
57
|
export declare const LIMITS: {
|
|
46
58
|
/** P4 <-> P5/P6 retries before a forced rollback. */
|
|
@@ -57,6 +69,14 @@ export declare const LIMITS: {
|
|
|
57
69
|
maxWorldPlanObjectiveChars: number;
|
|
58
70
|
/** Cast plus summary may exceed eight, but not without a bound. */
|
|
59
71
|
maxActiveCast: number;
|
|
72
|
+
/** Outline and worldbook are protected context, so they need hard bounds. */
|
|
73
|
+
maxOutlineChapters: number;
|
|
74
|
+
maxOutlineVolumes: number;
|
|
75
|
+
maxOutlineTextFieldChars: number;
|
|
76
|
+
maxOutlineNotesChars: number;
|
|
77
|
+
maxWorldbookEntries: number;
|
|
78
|
+
maxWorldbookTextChars: number;
|
|
79
|
+
maxSearchQueryChars: number;
|
|
60
80
|
};
|
|
61
81
|
/** Re-exported enums make adapter code readable without importing types twice. */
|
|
62
82
|
export declare const SCENE_TYPE_DEFAULT: SceneType;
|
|
@@ -66,7 +86,7 @@ export declare const INITIAL_STAGE: Stage;
|
|
|
66
86
|
/** The order used to render the nine-phase progress strip. */
|
|
67
87
|
export declare const PHASE_STRIP: readonly ["P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9"];
|
|
68
88
|
/** Tool names, kept here so the arch test can assert one namespace. */
|
|
69
|
-
export declare const TOOL_NAMES: readonly ["novel_init", "novel_status", "novel_brief", "novel_plan_world", "novel_plan_chapter", "novel_write_draft", "novel_review", "novel_revise", "novel_check", "novel_archive", "novel_word_count", "novel_state", "novel_amend", "novel_rollback", "novel_diff", "novel_export", "novel_audit", "novel_pipeline"];
|
|
89
|
+
export declare const TOOL_NAMES: readonly ["novel_init", "novel_status", "novel_brief", "novel_plan_world", "novel_plan_chapter", "novel_write_draft", "novel_review", "novel_revise", "novel_check", "novel_archive", "novel_word_count", "novel_state", "novel_amend", "novel_rollback", "novel_diff", "novel_export", "novel_audit", "novel_pipeline", "novel_blueprint", "novel_outline", "novel_outline_import", "novel_worldbook", "novel_search", "novel_doctor", "novel_report", "novel_guide", "novel_reopen", "novel_restore"];
|
|
70
90
|
export type ToolName = (typeof TOOL_NAMES)[number];
|
|
71
|
-
/** The
|
|
91
|
+
/** The ten high-frequency tools kept when `tools.mode = core`. */
|
|
72
92
|
export declare const CORE_TOOLS: readonly ToolName[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chinese one-line explanation for the tool each engine state recommends.
|
|
3
|
+
* Shared by the panel and slash commands so both surfaces speak the same
|
|
4
|
+
* language; unknown tools fall back to the engine's own reason.
|
|
5
|
+
*/
|
|
6
|
+
export declare const NEXT_DETAILS: Record<string, string>;
|