dsh-novel-write-engine 0.1.1 → 0.1.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/CHANGELOG.md +35 -0
- package/README.md +192 -160
- package/briefs/P1.md +6 -4
- package/briefs/P2.md +4 -1
- package/briefs/P3.md +4 -0
- package/briefs/P4.md +3 -0
- package/briefs/P5.md +4 -3
- package/briefs/P6.md +7 -1
- package/lib/client.js +8 -3
- package/lib/index.d.ts +85 -1
- package/lib/index.js +1885 -219
- package/lib/types/client/dto.d.ts +6 -0
- package/lib/types/constants.d.ts +8 -0
- package/lib/types/types.d.ts +28 -0
- package/package.json +2 -1
|
@@ -21,6 +21,12 @@ export interface SummaryDto {
|
|
|
21
21
|
revision: number;
|
|
22
22
|
totalWords: number;
|
|
23
23
|
totalChapters: number;
|
|
24
|
+
/** Book-wide archived average; absent on older payloads. */
|
|
25
|
+
averageScore?: number;
|
|
26
|
+
volume?: number;
|
|
27
|
+
volume_name?: string;
|
|
28
|
+
act?: string;
|
|
29
|
+
act_progress?: string;
|
|
24
30
|
phases: PhaseDto[];
|
|
25
31
|
blocking: BlockingDto[];
|
|
26
32
|
next?: {
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ 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
7
|
export declare const REMOTE_VERSION = 1;
|
|
8
|
+
/** The panel is a recent-history view; the wire payload and UI use one cap. */
|
|
9
|
+
export declare const PANEL_CHAPTER_LIMIT = 30;
|
|
8
10
|
/** Project-relative locations. Every write goes through these constants. */
|
|
9
11
|
export declare const PROJECT_FILE = "novel.yaml";
|
|
10
12
|
export declare const STATE_DIR = "state";
|
|
@@ -49,6 +51,12 @@ export declare const LIMITS: {
|
|
|
49
51
|
lockWaitMs: number;
|
|
50
52
|
/** Reading proofs shorter than this cannot be verified. */
|
|
51
53
|
minQuoteChars: number;
|
|
54
|
+
/** World-plan text fields are protected context, so they need a hard bound. */
|
|
55
|
+
maxWorldPlanItems: number;
|
|
56
|
+
maxWorldPlanTextChars: number;
|
|
57
|
+
maxWorldPlanObjectiveChars: number;
|
|
58
|
+
/** Cast plus summary may exceed eight, but not without a bound. */
|
|
59
|
+
maxActiveCast: number;
|
|
52
60
|
};
|
|
53
61
|
/** Re-exported enums make adapter code readable without importing types twice. */
|
|
54
62
|
export declare const SCENE_TYPE_DEFAULT: SceneType;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -171,6 +171,14 @@ export interface CheckDocument {
|
|
|
171
171
|
};
|
|
172
172
|
verdict: 'pass' | 'fail';
|
|
173
173
|
}
|
|
174
|
+
/** Every persisted document whose damage status/panel can report. */
|
|
175
|
+
export type StateErrorCode = 'PROJECT_UNREADABLE' | 'PLAN_UNREADABLE' | 'WORLD_PLAN_UNREADABLE' | 'REVIEW_UNREADABLE' | 'CHECK_UNREADABLE' | 'CHAPTERS_UNREADABLE' | 'CHARACTERS_UNREADABLE' | 'WORLD_UNREADABLE' | 'LOCKS_UNREADABLE' | 'TIMELINE_UNREADABLE' | 'FORESHADOWS_UNREADABLE' | 'RELATIONSHIPS_UNREADABLE' | 'HANDOFF_UNREADABLE';
|
|
176
|
+
/** A state document that exists but cannot be read safely. */
|
|
177
|
+
export interface StateError {
|
|
178
|
+
path: string;
|
|
179
|
+
code: StateErrorCode;
|
|
180
|
+
message: string;
|
|
181
|
+
}
|
|
174
182
|
/** Word statistics with the single engine-wide counting rule. */
|
|
175
183
|
export interface WordMetrics {
|
|
176
184
|
total_word_count: number;
|
|
@@ -497,6 +505,14 @@ export interface WorldPlanInput {
|
|
|
497
505
|
}>;
|
|
498
506
|
continuity_notes: string[];
|
|
499
507
|
}
|
|
508
|
+
/** A character the chapter plan puts on stage; no new persisted schema. */
|
|
509
|
+
export interface ChapterCastMember {
|
|
510
|
+
name: string;
|
|
511
|
+
entry_state?: string;
|
|
512
|
+
goal?: string;
|
|
513
|
+
knowledge?: string[];
|
|
514
|
+
exit_change?: string;
|
|
515
|
+
}
|
|
500
516
|
/** Chapter plan (`plans/chNNN.chapter.yaml`). */
|
|
501
517
|
export interface ChapterPlanInput {
|
|
502
518
|
chapter: number;
|
|
@@ -507,6 +523,8 @@ export interface ChapterPlanInput {
|
|
|
507
523
|
opening: string;
|
|
508
524
|
ending: string;
|
|
509
525
|
target_words: [number, number];
|
|
526
|
+
/** Optional in 0.1.3: older plans remain readable; new plans may name 1–8 actors. */
|
|
527
|
+
cast?: ChapterCastMember[];
|
|
510
528
|
}
|
|
511
529
|
/** Draft submission payload. */
|
|
512
530
|
export interface DraftInput {
|
|
@@ -557,6 +575,8 @@ export interface GateInput {
|
|
|
557
575
|
summaryProvided?: boolean;
|
|
558
576
|
review: ReviewDocument | null;
|
|
559
577
|
check: CheckDocument | null;
|
|
578
|
+
/** When set, result-bearing gates run only the named check scopes. */
|
|
579
|
+
scope?: string[];
|
|
560
580
|
semantic: SemanticItem[];
|
|
561
581
|
proof: ReadingProof | null;
|
|
562
582
|
rounds: RoundCounters;
|
|
@@ -608,7 +628,14 @@ export interface StatusReport {
|
|
|
608
628
|
stage: Stage;
|
|
609
629
|
rounds: RoundCounters;
|
|
610
630
|
blocking: BlockingItem[];
|
|
631
|
+
/** plan/review/check/ledger files that exist but cannot be read safely. */
|
|
632
|
+
state_errors: StateError[];
|
|
611
633
|
metrics: WordMetrics | null;
|
|
634
|
+
/** Inherited handoff labels; absent before the first archive. */
|
|
635
|
+
volume?: number;
|
|
636
|
+
volume_name?: string;
|
|
637
|
+
act?: string;
|
|
638
|
+
act_progress?: string;
|
|
612
639
|
next: {
|
|
613
640
|
tool: string;
|
|
614
641
|
args: Record<string, unknown>;
|
|
@@ -623,6 +650,7 @@ export interface AdviceReport {
|
|
|
623
650
|
args: Record<string, unknown>;
|
|
624
651
|
reason: string;
|
|
625
652
|
blocking: BlockingItem[];
|
|
653
|
+
state_errors: StateError[];
|
|
626
654
|
}
|
|
627
655
|
/** One history row derived from the journal. */
|
|
628
656
|
export interface AuditRow {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-novel-write-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Novel writing engine for DeepSeek Harness: state machine, gates, rulepacks and ledgers moved from prompts into code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"check:artifacts": "node scripts/check-artifacts.mjs",
|
|
85
85
|
"check:install": "node scripts/check-install.mjs",
|
|
86
86
|
"check:host": "node scripts/check-host.mjs",
|
|
87
|
+
"check:crash": "node scripts/check-crash.mjs",
|
|
87
88
|
"check:hygiene": "node scripts/check-hygiene.mjs"
|
|
88
89
|
},
|
|
89
90
|
"dependencies": {
|