opencode-novel 0.0.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/README.md +110 -0
- package/assets/templates/bible-glossary.md +4 -0
- package/assets/templates/bible-rules.md +5 -0
- package/assets/templates/bible-world.md +8 -0
- package/assets/templates/chapter.md +21 -0
- package/assets/templates/character.md +27 -0
- package/assets/templates/faction.md +14 -0
- package/assets/templates/location.md +11 -0
- package/assets/templates/thread.md +16 -0
- package/dist/agents/editor.d.ts +2 -0
- package/dist/agents/experts.d.ts +13 -0
- package/dist/agents/index.d.ts +7 -0
- package/dist/agents/muse.d.ts +2 -0
- package/dist/agents/novel.d.ts +2 -0
- package/dist/agents/security.d.ts +1 -0
- package/dist/agents/sentinel.d.ts +2 -0
- package/dist/agents/types.d.ts +3 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +3716 -0
- package/dist/config/defaults.d.ts +2 -0
- package/dist/config/load.d.ts +16 -0
- package/dist/config/schema.d.ts +203 -0
- package/dist/config/types.d.ts +5 -0
- package/dist/features/builtin-commands/commands.d.ts +2 -0
- package/dist/features/builtin-commands/index.d.ts +2 -0
- package/dist/features/builtin-commands/templates/novel-apply-candidates.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-bible.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-bootstrap.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-chapter-draft.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-chapter-plan.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-chapter-review.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-character-report.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-character.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-config-check.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-continuation.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-continuity-check.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-entities-audit.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-export.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-extract-entities.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-faction.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-foreshadowing-audit.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-graph.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-import.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-index.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-init.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-outline.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-polish.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-rewrite.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-snapshot.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-style-check.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-style-guide.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-summary.d.ts +1 -0
- package/dist/features/builtin-commands/templates/novel-thread.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +11 -0
- package/dist/features/builtin-skills/artifacts.d.ts +16 -0
- package/dist/features/builtin-skills/index.d.ts +4 -0
- package/dist/features/builtin-skills/skills/audience-classifier.d.ts +1 -0
- package/dist/features/builtin-skills/skills/emotion-classifier.d.ts +1 -0
- package/dist/features/builtin-skills/skills/genre-classifier.d.ts +1 -0
- package/dist/features/builtin-skills/skills/market-tagger.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-character-expert.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-continuation-expert.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-continuity-sentinel.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-entity-extractor.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-faction-relations.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-flaw-finder.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-foreshadowing-unresolved.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-oracle.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-polish-expert.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-summary-expert.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-timeline-keeper.d.ts +1 -0
- package/dist/features/builtin-skills/skills/novel-worldbible-keeper.d.ts +1 -0
- package/dist/features/builtin-skills/skills/profile-aggregator.d.ts +1 -0
- package/dist/features/builtin-skills/skills/structure-classifier.d.ts +1 -0
- package/dist/features/builtin-skills/skills/taxonomy-registry.d.ts +1 -0
- package/dist/features/builtin-skills/skills/trope-classifier.d.ts +1 -0
- package/dist/features/builtin-skills/skills.d.ts +2 -0
- package/dist/features/builtin-skills/taxonomy/index.d.ts +3 -0
- package/dist/features/builtin-skills/taxonomy/references.d.ts +8 -0
- package/dist/features/builtin-skills/taxonomy/registry.d.ts +2 -0
- package/dist/features/builtin-skills/taxonomy/types.d.ts +42 -0
- package/dist/features/builtin-skills/types.d.ts +11 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +61966 -0
- package/dist/novel.schema.json +904 -0
- package/dist/plugin-handlers/config-handler.d.ts +9 -0
- package/dist/plugin-handlers/index.d.ts +1 -0
- package/dist/shared/errors/diagnostics.d.ts +19 -0
- package/dist/shared/fs/paths.d.ts +3 -0
- package/dist/shared/fs/read.d.ts +5 -0
- package/dist/shared/fs/write.d.ts +8 -0
- package/dist/shared/hashing/hash8.d.ts +1 -0
- package/dist/shared/hashing/sha256.d.ts +2 -0
- package/dist/shared/markdown/frontmatter.d.ts +15 -0
- package/dist/shared/opencode/artifacts.d.ts +12 -0
- package/dist/shared/strings/chinese-number.d.ts +1 -0
- package/dist/shared/strings/slug.d.ts +1 -0
- package/dist/shared/strings/text-encoding.d.ts +2 -0
- package/dist/shared/tool-output.d.ts +6 -0
- package/dist/tools/novel-apply-candidates/index.d.ts +2 -0
- package/dist/tools/novel-apply-candidates/render.d.ts +2 -0
- package/dist/tools/novel-apply-candidates/tool.d.ts +6 -0
- package/dist/tools/novel-apply-candidates/types.d.ts +52 -0
- package/dist/tools/novel-bible/index.d.ts +2 -0
- package/dist/tools/novel-bible/render.d.ts +3 -0
- package/dist/tools/novel-bible/tool.d.ts +6 -0
- package/dist/tools/novel-bible/types.d.ts +26 -0
- package/dist/tools/novel-bootstrap/index.d.ts +2 -0
- package/dist/tools/novel-bootstrap/tool.d.ts +6 -0
- package/dist/tools/novel-bootstrap/types.d.ts +38 -0
- package/dist/tools/novel-candidates-write/index.d.ts +2 -0
- package/dist/tools/novel-candidates-write/tool.d.ts +6 -0
- package/dist/tools/novel-candidates-write/types.d.ts +13 -0
- package/dist/tools/novel-chapter-plan/index.d.ts +2 -0
- package/dist/tools/novel-chapter-plan/tool.d.ts +6 -0
- package/dist/tools/novel-chapter-plan/types.d.ts +32 -0
- package/dist/tools/novel-character-report/index.d.ts +2 -0
- package/dist/tools/novel-character-report/render.d.ts +2 -0
- package/dist/tools/novel-character-report/tool.d.ts +6 -0
- package/dist/tools/novel-character-report/types.d.ts +23 -0
- package/dist/tools/novel-config-check/index.d.ts +2 -0
- package/dist/tools/novel-config-check/tool.d.ts +4 -0
- package/dist/tools/novel-config-check/types.d.ts +15 -0
- package/dist/tools/novel-context-pack/index.d.ts +2 -0
- package/dist/tools/novel-context-pack/tool.d.ts +6 -0
- package/dist/tools/novel-context-pack/types.d.ts +37 -0
- package/dist/tools/novel-continuity-check/index.d.ts +2 -0
- package/dist/tools/novel-continuity-check/render.d.ts +9 -0
- package/dist/tools/novel-continuity-check/tool.d.ts +6 -0
- package/dist/tools/novel-continuity-check/types.d.ts +37 -0
- package/dist/tools/novel-entity-gaps/index.d.ts +2 -0
- package/dist/tools/novel-entity-gaps/render.d.ts +5 -0
- package/dist/tools/novel-entity-gaps/tool.d.ts +6 -0
- package/dist/tools/novel-entity-gaps/types.d.ts +33 -0
- package/dist/tools/novel-export/docx.d.ts +5 -0
- package/dist/tools/novel-export/epub.d.ts +10 -0
- package/dist/tools/novel-export/index.d.ts +2 -0
- package/dist/tools/novel-export/preflight.d.ts +19 -0
- package/dist/tools/novel-export/render.d.ts +6 -0
- package/dist/tools/novel-export/tool.d.ts +6 -0
- package/dist/tools/novel-export/types.d.ts +109 -0
- package/dist/tools/novel-foreshadowing-audit/index.d.ts +2 -0
- package/dist/tools/novel-foreshadowing-audit/render.d.ts +5 -0
- package/dist/tools/novel-foreshadowing-audit/tool.d.ts +6 -0
- package/dist/tools/novel-foreshadowing-audit/types.d.ts +40 -0
- package/dist/tools/novel-graph/index.d.ts +2 -0
- package/dist/tools/novel-graph/render.d.ts +5 -0
- package/dist/tools/novel-graph/tool.d.ts +6 -0
- package/dist/tools/novel-graph/types.d.ts +21 -0
- package/dist/tools/novel-import/index.d.ts +2 -0
- package/dist/tools/novel-import/tool.d.ts +7 -0
- package/dist/tools/novel-import/types.d.ts +47 -0
- package/dist/tools/novel-index/index.d.ts +2 -0
- package/dist/tools/novel-index/render.d.ts +35 -0
- package/dist/tools/novel-index/tool.d.ts +6 -0
- package/dist/tools/novel-index/types.d.ts +41 -0
- package/dist/tools/novel-outline/index.d.ts +2 -0
- package/dist/tools/novel-outline/tool.d.ts +6 -0
- package/dist/tools/novel-outline/types.d.ts +37 -0
- package/dist/tools/novel-scaffold/index.d.ts +2 -0
- package/dist/tools/novel-scaffold/scaffold.d.ts +18 -0
- package/dist/tools/novel-scaffold/templates.d.ts +5 -0
- package/dist/tools/novel-scaffold/tool.d.ts +6 -0
- package/dist/tools/novel-scaffold/types.d.ts +19 -0
- package/dist/tools/novel-scan/helpers.d.ts +88 -0
- package/dist/tools/novel-scan/index.d.ts +3 -0
- package/dist/tools/novel-scan/scan.d.ts +17 -0
- package/dist/tools/novel-scan/tool.d.ts +6 -0
- package/dist/tools/novel-scan/types.d.ts +106 -0
- package/dist/tools/novel-scene-check/index.d.ts +2 -0
- package/dist/tools/novel-scene-check/render.d.ts +11 -0
- package/dist/tools/novel-scene-check/tool.d.ts +6 -0
- package/dist/tools/novel-scene-check/types.d.ts +38 -0
- package/dist/tools/novel-setup/index.d.ts +2 -0
- package/dist/tools/novel-setup/tool.d.ts +6 -0
- package/dist/tools/novel-setup/types.d.ts +35 -0
- package/dist/tools/novel-snapshot/index.d.ts +2 -0
- package/dist/tools/novel-snapshot/tool.d.ts +6 -0
- package/dist/tools/novel-snapshot/types.d.ts +26 -0
- package/dist/tools/novel-structure-check/index.d.ts +2 -0
- package/dist/tools/novel-structure-check/render.d.ts +14 -0
- package/dist/tools/novel-structure-check/tool.d.ts +6 -0
- package/dist/tools/novel-structure-check/types.d.ts +42 -0
- package/dist/tools/novel-style-check/index.d.ts +2 -0
- package/dist/tools/novel-style-check/render.d.ts +8 -0
- package/dist/tools/novel-style-check/tool.d.ts +6 -0
- package/dist/tools/novel-style-check/types.d.ts +39 -0
- package/dist/tools/skill/index.d.ts +3 -0
- package/dist/tools/skill/loader.d.ts +5 -0
- package/dist/tools/skill/tool.d.ts +5 -0
- package/dist/tools/skill/types.d.ts +14 -0
- package/dist/tools/slashcommand/index.d.ts +3 -0
- package/dist/tools/slashcommand/loader.d.ts +5 -0
- package/dist/tools/slashcommand/tool.d.ts +6 -0
- package/dist/tools/slashcommand/types.d.ts +14 -0
- package/package.json +55 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelScanMode = "full" | "incremental";
|
|
3
|
+
export type NovelScanArgs = {
|
|
4
|
+
rootDir?: string;
|
|
5
|
+
manuscriptDir?: string;
|
|
6
|
+
mode?: NovelScanMode;
|
|
7
|
+
strictMode?: boolean;
|
|
8
|
+
writeCache?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type NovelFileHash = {
|
|
11
|
+
path: string;
|
|
12
|
+
mtimeMs: number;
|
|
13
|
+
size: number;
|
|
14
|
+
sha256: string;
|
|
15
|
+
};
|
|
16
|
+
export type ChapterStructureEntity = {
|
|
17
|
+
act?: number;
|
|
18
|
+
beat_id?: string;
|
|
19
|
+
beat_goal?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ChapterSceneEntity = {
|
|
22
|
+
scene_id?: string;
|
|
23
|
+
objective?: string;
|
|
24
|
+
conflict?: string;
|
|
25
|
+
outcome?: string;
|
|
26
|
+
hook?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ChapterEntity = {
|
|
29
|
+
chapter_id: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
path: string;
|
|
32
|
+
pov?: string;
|
|
33
|
+
timeline?: {
|
|
34
|
+
date?: string;
|
|
35
|
+
start?: string;
|
|
36
|
+
end?: string;
|
|
37
|
+
location?: string;
|
|
38
|
+
};
|
|
39
|
+
characters?: string[];
|
|
40
|
+
factions?: string[];
|
|
41
|
+
locations?: string[];
|
|
42
|
+
threads_opened?: string[];
|
|
43
|
+
threads_advanced?: string[];
|
|
44
|
+
threads_closed?: string[];
|
|
45
|
+
summary?: string;
|
|
46
|
+
tags?: string[];
|
|
47
|
+
structure?: ChapterStructureEntity;
|
|
48
|
+
scenes?: ChapterSceneEntity[];
|
|
49
|
+
};
|
|
50
|
+
export type CharacterEntity = {
|
|
51
|
+
id: string;
|
|
52
|
+
name?: string;
|
|
53
|
+
path: string;
|
|
54
|
+
alias?: string[];
|
|
55
|
+
};
|
|
56
|
+
export type ThreadEntity = {
|
|
57
|
+
thread_id: string;
|
|
58
|
+
type?: string;
|
|
59
|
+
status?: string;
|
|
60
|
+
path: string;
|
|
61
|
+
};
|
|
62
|
+
export type FactionEntity = {
|
|
63
|
+
id: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
path: string;
|
|
66
|
+
};
|
|
67
|
+
export type LocationEntity = {
|
|
68
|
+
id: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
path: string;
|
|
71
|
+
};
|
|
72
|
+
export type NovelScanResultJson = {
|
|
73
|
+
version: 1;
|
|
74
|
+
rootDir: string;
|
|
75
|
+
manuscriptDir: string;
|
|
76
|
+
stats: {
|
|
77
|
+
filesScanned: number;
|
|
78
|
+
entities: Record<string, number>;
|
|
79
|
+
durationMs: number;
|
|
80
|
+
cache: {
|
|
81
|
+
mode: NovelScanMode;
|
|
82
|
+
loaded: boolean;
|
|
83
|
+
written: boolean;
|
|
84
|
+
fastHits: number;
|
|
85
|
+
hashHits: number;
|
|
86
|
+
misses: number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
files: NovelFileHash[];
|
|
90
|
+
entities: {
|
|
91
|
+
chapters: ChapterEntity[];
|
|
92
|
+
characters: CharacterEntity[];
|
|
93
|
+
threads: ThreadEntity[];
|
|
94
|
+
factions: FactionEntity[];
|
|
95
|
+
locations: LocationEntity[];
|
|
96
|
+
};
|
|
97
|
+
diagnostics: Diagnostic[];
|
|
98
|
+
cache: {
|
|
99
|
+
scanCachePath?: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export type ScanCacheV1 = NovelScanResultJson & {
|
|
103
|
+
__internal?: {
|
|
104
|
+
perFileDiagnostics?: Record<string, Diagnostic[]>;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SceneFinding } from "./types";
|
|
2
|
+
export declare function renderSceneReportMd(options: {
|
|
3
|
+
stats: {
|
|
4
|
+
sceneCount: number;
|
|
5
|
+
invalidCount: number;
|
|
6
|
+
errors: number;
|
|
7
|
+
warns: number;
|
|
8
|
+
infos: number;
|
|
9
|
+
};
|
|
10
|
+
findings: SceneFinding[];
|
|
11
|
+
}): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Diagnostic, DiagnosticEvidence } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelSceneScope = {
|
|
3
|
+
kind: "all";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "chapter";
|
|
6
|
+
chapter_id: string;
|
|
7
|
+
};
|
|
8
|
+
export type NovelSceneArgs = {
|
|
9
|
+
rootDir?: string;
|
|
10
|
+
manuscriptDir?: string;
|
|
11
|
+
outputDir?: string;
|
|
12
|
+
scope?: NovelSceneScope;
|
|
13
|
+
writeReport?: boolean;
|
|
14
|
+
requiredFields?: Array<"scene_id" | "objective" | "conflict" | "outcome" | "hook">;
|
|
15
|
+
};
|
|
16
|
+
export type SceneFinding = {
|
|
17
|
+
severity: "error" | "warn" | "info";
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
evidence: DiagnosticEvidence[];
|
|
21
|
+
suggestedFix?: string;
|
|
22
|
+
repro?: string;
|
|
23
|
+
};
|
|
24
|
+
export type NovelSceneResultJson = {
|
|
25
|
+
version: 1;
|
|
26
|
+
reportPath?: string;
|
|
27
|
+
stats: {
|
|
28
|
+
sceneCount: number;
|
|
29
|
+
invalidCount: number;
|
|
30
|
+
errors: number;
|
|
31
|
+
warns: number;
|
|
32
|
+
infos: number;
|
|
33
|
+
durationMs: number;
|
|
34
|
+
};
|
|
35
|
+
findings: SceneFinding[];
|
|
36
|
+
nextSteps?: string[];
|
|
37
|
+
diagnostics: Diagnostic[];
|
|
38
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelSetupArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
manuscriptDir?: string;
|
|
5
|
+
bookTitle?: string;
|
|
6
|
+
writeTemplates?: boolean;
|
|
7
|
+
forceOverwriteTemplates?: boolean;
|
|
8
|
+
exportCommands?: boolean;
|
|
9
|
+
exportSkills?: boolean;
|
|
10
|
+
forceOverwriteCommands?: boolean;
|
|
11
|
+
forceOverwriteSkills?: boolean;
|
|
12
|
+
writeConfigJsonc?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type NovelSetupResultJson = {
|
|
15
|
+
version: 1;
|
|
16
|
+
manuscriptDir: string;
|
|
17
|
+
configPath?: string;
|
|
18
|
+
createdDirs: string[];
|
|
19
|
+
writtenFiles: string[];
|
|
20
|
+
skippedExisting: string[];
|
|
21
|
+
commands: {
|
|
22
|
+
dir: string;
|
|
23
|
+
written: string[];
|
|
24
|
+
skipped: string[];
|
|
25
|
+
};
|
|
26
|
+
skills: {
|
|
27
|
+
dir: string;
|
|
28
|
+
written: string[];
|
|
29
|
+
skipped: string[];
|
|
30
|
+
};
|
|
31
|
+
stats: {
|
|
32
|
+
durationMs: number;
|
|
33
|
+
};
|
|
34
|
+
diagnostics: Diagnostic[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelSnapshotArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
manuscriptDir?: string;
|
|
5
|
+
outputDir?: string;
|
|
6
|
+
tag?: string;
|
|
7
|
+
includeBible?: boolean;
|
|
8
|
+
includeDerived?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type NovelSnapshotEntry = {
|
|
11
|
+
source: string;
|
|
12
|
+
dest: string;
|
|
13
|
+
};
|
|
14
|
+
export type NovelSnapshotResultJson = {
|
|
15
|
+
version: 1;
|
|
16
|
+
tag: string;
|
|
17
|
+
snapshotDir: string;
|
|
18
|
+
entries: NovelSnapshotEntry[];
|
|
19
|
+
savedFiles: string[];
|
|
20
|
+
stats: {
|
|
21
|
+
durationMs: number;
|
|
22
|
+
savedFiles: number;
|
|
23
|
+
};
|
|
24
|
+
nextSteps?: string[];
|
|
25
|
+
diagnostics: Diagnostic[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StructureFinding } from "./types";
|
|
2
|
+
export declare function renderStructureReportMd(options: {
|
|
3
|
+
stats: {
|
|
4
|
+
coverage: number;
|
|
5
|
+
requiredBeats: number;
|
|
6
|
+
seenRequiredBeats: number;
|
|
7
|
+
missing: number;
|
|
8
|
+
orderErrors: number;
|
|
9
|
+
errors: number;
|
|
10
|
+
warns: number;
|
|
11
|
+
infos: number;
|
|
12
|
+
};
|
|
13
|
+
findings: StructureFinding[];
|
|
14
|
+
}): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Diagnostic, DiagnosticEvidence } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelStructureScope = {
|
|
3
|
+
kind: "all";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "chapter";
|
|
6
|
+
chapter_id: string;
|
|
7
|
+
};
|
|
8
|
+
export type NovelStructureArgs = {
|
|
9
|
+
rootDir?: string;
|
|
10
|
+
manuscriptDir?: string;
|
|
11
|
+
outputDir?: string;
|
|
12
|
+
scope?: NovelStructureScope;
|
|
13
|
+
writeReport?: boolean;
|
|
14
|
+
requiredBeats?: string[];
|
|
15
|
+
minCoverage?: number;
|
|
16
|
+
};
|
|
17
|
+
export type StructureFinding = {
|
|
18
|
+
severity: "error" | "warn" | "info";
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
evidence: DiagnosticEvidence[];
|
|
22
|
+
suggestedFix?: string;
|
|
23
|
+
repro?: string;
|
|
24
|
+
};
|
|
25
|
+
export type NovelStructureResultJson = {
|
|
26
|
+
version: 1;
|
|
27
|
+
reportPath?: string;
|
|
28
|
+
stats: {
|
|
29
|
+
coverage: number;
|
|
30
|
+
requiredBeats: number;
|
|
31
|
+
seenRequiredBeats: number;
|
|
32
|
+
missing: number;
|
|
33
|
+
orderErrors: number;
|
|
34
|
+
errors: number;
|
|
35
|
+
warns: number;
|
|
36
|
+
infos: number;
|
|
37
|
+
durationMs: number;
|
|
38
|
+
};
|
|
39
|
+
findings: StructureFinding[];
|
|
40
|
+
nextSteps?: string[];
|
|
41
|
+
diagnostics: Diagnostic[];
|
|
42
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Diagnostic, DiagnosticEvidence } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelStyleScope = {
|
|
3
|
+
kind: "all";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "chapter";
|
|
6
|
+
chapter_id: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "character";
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
export type NovelStyleArgs = {
|
|
12
|
+
rootDir?: string;
|
|
13
|
+
manuscriptDir?: string;
|
|
14
|
+
outputDir?: string;
|
|
15
|
+
scope?: NovelStyleScope;
|
|
16
|
+
catchphraseMaxCount?: number;
|
|
17
|
+
catchphraseReportMissing?: boolean;
|
|
18
|
+
writeReport?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type StyleFinding = {
|
|
21
|
+
severity: "warn" | "info";
|
|
22
|
+
code: string;
|
|
23
|
+
message: string;
|
|
24
|
+
evidence: DiagnosticEvidence[];
|
|
25
|
+
suggestedFix?: string;
|
|
26
|
+
repro?: string;
|
|
27
|
+
};
|
|
28
|
+
export type NovelStyleResultJson = {
|
|
29
|
+
version: 1;
|
|
30
|
+
reportPath?: string;
|
|
31
|
+
stats: {
|
|
32
|
+
warns: number;
|
|
33
|
+
infos: number;
|
|
34
|
+
durationMs: number;
|
|
35
|
+
};
|
|
36
|
+
findings: StyleFinding[];
|
|
37
|
+
nextSteps?: string[];
|
|
38
|
+
diagnostics: Diagnostic[];
|
|
39
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SkillScope = "builtin" | "project" | "user";
|
|
2
|
+
export type LoadedSkill = {
|
|
3
|
+
name: string;
|
|
4
|
+
scope: SkillScope;
|
|
5
|
+
path?: string;
|
|
6
|
+
definition: {
|
|
7
|
+
description?: string;
|
|
8
|
+
argumentHint?: string;
|
|
9
|
+
agent?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
subtask?: boolean;
|
|
12
|
+
template: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CommandScope = "builtin" | "project" | "user";
|
|
2
|
+
export type CommandInfo = {
|
|
3
|
+
name: string;
|
|
4
|
+
scope: CommandScope;
|
|
5
|
+
path?: string;
|
|
6
|
+
metadata: {
|
|
7
|
+
description?: string;
|
|
8
|
+
argumentHint?: string;
|
|
9
|
+
agent?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
subtask?: boolean;
|
|
12
|
+
};
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opencode-novel",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Novel writing workflow plugin for OpenCode (Bun/TypeScript).",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"opencode-novel": "dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"assets"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./schema.json": "./dist/novel.schema.json"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "bun run clean && bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly && bun run build:schema",
|
|
24
|
+
"build:schema": "bun run script/build-schema.ts",
|
|
25
|
+
"clean": "rm -rf dist",
|
|
26
|
+
"install:opencode": "bun run script/install-opencode.ts -- --target=global",
|
|
27
|
+
"uninstall:opencode": "bun run script/uninstall-opencode.ts -- --target=global",
|
|
28
|
+
"benchmark:index": "bun run script/perf-index-benchmark.ts",
|
|
29
|
+
"check:code-rules": "bun run script/check-code-rules.ts",
|
|
30
|
+
"lint": "biome check --error-on-warnings .",
|
|
31
|
+
"lint:fix": "biome check --write .",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"check": "bun run lint && bun run check:code-rules && bun run typecheck && bun test && bun run build",
|
|
34
|
+
"test": "bun test"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@opencode-ai/plugin": "^1.1.19",
|
|
38
|
+
"@opencode-ai/sdk": "^1.1.19",
|
|
39
|
+
"docx": "^9.5.1",
|
|
40
|
+
"fflate": "^0.8.2",
|
|
41
|
+
"js-yaml": "^4.1.1",
|
|
42
|
+
"jsonc-parser": "^3.3.1",
|
|
43
|
+
"marked": "^16.2.1",
|
|
44
|
+
"picomatch": "^4.0.2",
|
|
45
|
+
"zod": "^4.1.8"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@biomejs/biome": "^2.2.4",
|
|
49
|
+
"@types/js-yaml": "^4.0.9",
|
|
50
|
+
"@types/picomatch": "^3.0.2",
|
|
51
|
+
"bun-types": "1.3.6",
|
|
52
|
+
"lefthook": "^1.13.4",
|
|
53
|
+
"typescript": "^5.7.3"
|
|
54
|
+
}
|
|
55
|
+
}
|