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,9 @@
|
|
|
1
|
+
import type { NovelConfig } from "../config/schema";
|
|
2
|
+
type OpenCodeConfig = Record<string, unknown> & {
|
|
3
|
+
model?: unknown;
|
|
4
|
+
agent?: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare function createConfigHandler(deps: {
|
|
7
|
+
pluginConfig: NovelConfig;
|
|
8
|
+
}): (config: OpenCodeConfig) => Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createConfigHandler } from "./config-handler";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type DiagnosticSeverity = "error" | "warn" | "info";
|
|
2
|
+
export type DiagnosticEvidence = {
|
|
3
|
+
file: string;
|
|
4
|
+
line?: number;
|
|
5
|
+
excerpt?: string;
|
|
6
|
+
};
|
|
7
|
+
export type Diagnostic = {
|
|
8
|
+
severity: DiagnosticSeverity;
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
file?: string;
|
|
12
|
+
line?: number;
|
|
13
|
+
evidence?: DiagnosticEvidence[];
|
|
14
|
+
suggestedFix?: string;
|
|
15
|
+
repro?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function inferReproFromDiagnosticCode(code: string): string | undefined;
|
|
18
|
+
export declare function sortDiagnostics(diagnostics: Diagnostic[]): Diagnostic[];
|
|
19
|
+
export declare function formatDiagnosticsMarkdown(diagnostics: Diagnostic[]): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type WriteResult = {
|
|
2
|
+
changed: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare function ensureDirForFile(filePath: string): void;
|
|
5
|
+
export declare function normalizeLf(text: string): string;
|
|
6
|
+
export declare function writeTextFile(filePath: string, content: string, options?: {
|
|
7
|
+
mode?: "always" | "if-changed";
|
|
8
|
+
}): WriteResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hash8(input: string): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Diagnostic } from "../errors/diagnostics";
|
|
2
|
+
export type ParsedFrontmatter<T extends Record<string, unknown>> = {
|
|
3
|
+
data: Partial<T>;
|
|
4
|
+
body: string;
|
|
5
|
+
hasFrontmatter: boolean;
|
|
6
|
+
diagnostics: Diagnostic[];
|
|
7
|
+
};
|
|
8
|
+
export declare function parseFrontmatter<T extends Record<string, unknown>>(content: string, options?: {
|
|
9
|
+
file?: string;
|
|
10
|
+
strict?: boolean;
|
|
11
|
+
}): ParsedFrontmatter<T>;
|
|
12
|
+
export declare function serializeFrontmatter(data: Record<string, unknown>, options?: {
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function buildFrontmatterFile(data: Record<string, unknown>, body: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function yamlQuote(value: string): string;
|
|
2
|
+
export declare function buildCommandMarkdown(def: {
|
|
3
|
+
description?: string;
|
|
4
|
+
agent?: string;
|
|
5
|
+
argumentHint?: string;
|
|
6
|
+
template: string;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function buildSkillMarkdown(def: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
template: string;
|
|
12
|
+
}): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseChineseNumber(input: string): number | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slugify(input: string): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelCandidatesV1 = {
|
|
3
|
+
version: 1;
|
|
4
|
+
generatedAt: string;
|
|
5
|
+
scope: {
|
|
6
|
+
kind: "all";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "chapter";
|
|
9
|
+
chapter_id: string;
|
|
10
|
+
};
|
|
11
|
+
notes?: string;
|
|
12
|
+
ops: CandidateOp[];
|
|
13
|
+
};
|
|
14
|
+
export type CandidateOp = {
|
|
15
|
+
op: "ensure_entity";
|
|
16
|
+
kind: "character" | "faction" | "location" | "thread";
|
|
17
|
+
id: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
filePath?: string;
|
|
20
|
+
} | {
|
|
21
|
+
op: "patch_frontmatter";
|
|
22
|
+
filePath: string;
|
|
23
|
+
patch: Record<string, unknown>;
|
|
24
|
+
mode?: "deep_merge" | "shallow_merge" | "merge" | "replace";
|
|
25
|
+
};
|
|
26
|
+
export type NovelApplyCandidatesArgs = {
|
|
27
|
+
rootDir?: string;
|
|
28
|
+
candidatesPath?: string;
|
|
29
|
+
dryRun?: boolean;
|
|
30
|
+
writeReport?: boolean;
|
|
31
|
+
snapshot?: boolean;
|
|
32
|
+
snapshotTag?: string;
|
|
33
|
+
};
|
|
34
|
+
export type NovelApplyCandidatesResultJson = {
|
|
35
|
+
version: 1;
|
|
36
|
+
dryRun: boolean;
|
|
37
|
+
appliedOps: number;
|
|
38
|
+
writtenFiles: string[];
|
|
39
|
+
skippedOps: {
|
|
40
|
+
index: number;
|
|
41
|
+
reason: string;
|
|
42
|
+
}[];
|
|
43
|
+
snapshot?: {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
tag?: string;
|
|
46
|
+
dir?: string;
|
|
47
|
+
savedFiles: string[];
|
|
48
|
+
};
|
|
49
|
+
nextSteps?: string[];
|
|
50
|
+
reportPath?: string;
|
|
51
|
+
diagnostics: Diagnostic[];
|
|
52
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelBibleArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
manuscriptDir?: string;
|
|
5
|
+
outputDir?: string;
|
|
6
|
+
writeDerivedFiles?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type BibleRule = {
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
sourceFile: string;
|
|
12
|
+
line?: number;
|
|
13
|
+
};
|
|
14
|
+
export type GlossaryTerm = {
|
|
15
|
+
term: string;
|
|
16
|
+
definition?: string;
|
|
17
|
+
sourceFile: string;
|
|
18
|
+
};
|
|
19
|
+
export type NovelBibleResultJson = {
|
|
20
|
+
version: 1;
|
|
21
|
+
summaryPath?: string;
|
|
22
|
+
glossaryPath?: string;
|
|
23
|
+
rules: BibleRule[];
|
|
24
|
+
glossary: GlossaryTerm[];
|
|
25
|
+
diagnostics: Diagnostic[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
import type { NovelCharacterReportResultJson } from "../novel-character-report/types";
|
|
3
|
+
import type { NovelEntityGapsResultJson } from "../novel-entity-gaps/types";
|
|
4
|
+
import type { NovelGraphResultJson } from "../novel-graph/types";
|
|
5
|
+
import type { NovelImportMode, NovelImportResultJson } from "../novel-import/types";
|
|
6
|
+
import type { NovelIndexResultJson } from "../novel-index/types";
|
|
7
|
+
import type { NovelScaffoldResultJson } from "../novel-scaffold/types";
|
|
8
|
+
export type NovelBootstrapArgs = {
|
|
9
|
+
rootDir?: string;
|
|
10
|
+
fromDir?: string;
|
|
11
|
+
manuscriptDir?: string;
|
|
12
|
+
bookTitle?: string;
|
|
13
|
+
importMode?: NovelImportMode;
|
|
14
|
+
createStubs?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type NovelBootstrapResultJson = {
|
|
17
|
+
version: 1;
|
|
18
|
+
rootDir: string;
|
|
19
|
+
fromDir: string;
|
|
20
|
+
manuscriptDir: string;
|
|
21
|
+
results: {
|
|
22
|
+
scaffold: NovelScaffoldResultJson;
|
|
23
|
+
import: NovelImportResultJson;
|
|
24
|
+
index: NovelIndexResultJson;
|
|
25
|
+
entityGaps: NovelEntityGapsResultJson;
|
|
26
|
+
graphs: {
|
|
27
|
+
relationships: NovelGraphResultJson;
|
|
28
|
+
factions: NovelGraphResultJson;
|
|
29
|
+
};
|
|
30
|
+
characterReport: NovelCharacterReportResultJson;
|
|
31
|
+
};
|
|
32
|
+
writtenFiles: string[];
|
|
33
|
+
nextSteps: string[];
|
|
34
|
+
diagnostics: Diagnostic[];
|
|
35
|
+
stats: {
|
|
36
|
+
durationMs: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelCandidatesWriteArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
candidatesPath?: string;
|
|
5
|
+
candidates: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type NovelCandidatesWriteResultJson = {
|
|
8
|
+
version: 1;
|
|
9
|
+
candidatesPath?: string;
|
|
10
|
+
changed?: boolean;
|
|
11
|
+
ops?: number;
|
|
12
|
+
diagnostics: Diagnostic[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelChapterPlanArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
manuscriptDir?: string;
|
|
5
|
+
chapter_id: string;
|
|
6
|
+
structureRef?: string;
|
|
7
|
+
outputPath?: string;
|
|
8
|
+
writeFile?: boolean;
|
|
9
|
+
sceneCount?: number;
|
|
10
|
+
};
|
|
11
|
+
export type ChapterPlanScene = {
|
|
12
|
+
scene_id: string;
|
|
13
|
+
objective: string;
|
|
14
|
+
conflict: string;
|
|
15
|
+
outcome: string;
|
|
16
|
+
hook?: string;
|
|
17
|
+
};
|
|
18
|
+
export type ChapterPlanJson = {
|
|
19
|
+
chapter_id: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
structureRef?: string;
|
|
22
|
+
sourceChapterPath?: string;
|
|
23
|
+
sceneBlueprint: ChapterPlanScene[];
|
|
24
|
+
writingChecklist: string[];
|
|
25
|
+
qualityGates: string[];
|
|
26
|
+
};
|
|
27
|
+
export type NovelChapterPlanResultJson = {
|
|
28
|
+
version: 1;
|
|
29
|
+
planPath?: string;
|
|
30
|
+
planJson: ChapterPlanJson;
|
|
31
|
+
diagnostics: Diagnostic[];
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelCharacterReportArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
manuscriptDir?: string;
|
|
5
|
+
outputDir?: string;
|
|
6
|
+
writeReport?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type CharacterReportItem = {
|
|
9
|
+
id: string;
|
|
10
|
+
path: string;
|
|
11
|
+
appearances: number;
|
|
12
|
+
first_seen?: string;
|
|
13
|
+
last_seen?: string;
|
|
14
|
+
threads_involved: string[];
|
|
15
|
+
arc_summary?: string;
|
|
16
|
+
missingFields?: string[];
|
|
17
|
+
};
|
|
18
|
+
export type NovelCharacterReportResultJson = {
|
|
19
|
+
version: 1;
|
|
20
|
+
reportPath?: string;
|
|
21
|
+
characters: CharacterReportItem[];
|
|
22
|
+
diagnostics: Diagnostic[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelConfigCheckArgs = {
|
|
3
|
+
rootDir?: string;
|
|
4
|
+
};
|
|
5
|
+
export type NovelConfigCheckResultJson = {
|
|
6
|
+
version: 1;
|
|
7
|
+
valid: boolean;
|
|
8
|
+
projectRoot: string;
|
|
9
|
+
sources: {
|
|
10
|
+
user?: string;
|
|
11
|
+
project?: string;
|
|
12
|
+
};
|
|
13
|
+
nextSteps?: string[];
|
|
14
|
+
diagnostics: Diagnostic[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelContextPackTask = "draft" | "review" | "rewrite" | "continuity" | "foreshadowing";
|
|
3
|
+
export type NovelContextPackArgs = {
|
|
4
|
+
rootDir?: string;
|
|
5
|
+
manuscriptDir?: string;
|
|
6
|
+
task: NovelContextPackTask;
|
|
7
|
+
chapter_id?: string;
|
|
8
|
+
thread_id?: string;
|
|
9
|
+
budget?: {
|
|
10
|
+
maxChars: number;
|
|
11
|
+
};
|
|
12
|
+
include?: {
|
|
13
|
+
bible?: boolean;
|
|
14
|
+
characters?: boolean;
|
|
15
|
+
openThreads?: boolean;
|
|
16
|
+
lastChapters?: number;
|
|
17
|
+
};
|
|
18
|
+
redaction?: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
patterns: string[];
|
|
21
|
+
};
|
|
22
|
+
writeFile?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type NovelContextPackResultJson = {
|
|
25
|
+
version: 1;
|
|
26
|
+
packPath?: string;
|
|
27
|
+
included: {
|
|
28
|
+
path: string;
|
|
29
|
+
reason: string;
|
|
30
|
+
chars: number;
|
|
31
|
+
}[];
|
|
32
|
+
stats: {
|
|
33
|
+
totalChars: number;
|
|
34
|
+
budgetChars: number;
|
|
35
|
+
};
|
|
36
|
+
diagnostics: Diagnostic[];
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Diagnostic, DiagnosticEvidence } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelContinuityScope = {
|
|
3
|
+
kind: "all";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "chapter";
|
|
6
|
+
chapter_id: string;
|
|
7
|
+
};
|
|
8
|
+
export type NovelContinuityArgs = {
|
|
9
|
+
rootDir?: string;
|
|
10
|
+
manuscriptDir?: string;
|
|
11
|
+
outputDir?: string;
|
|
12
|
+
scope?: NovelContinuityScope;
|
|
13
|
+
strictMode?: boolean;
|
|
14
|
+
writeReport?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type ContinuitySeverity = "error" | "warn" | "info";
|
|
17
|
+
export type ContinuityFinding = {
|
|
18
|
+
ruleId: string;
|
|
19
|
+
severity: ContinuitySeverity;
|
|
20
|
+
message: string;
|
|
21
|
+
evidence: DiagnosticEvidence[];
|
|
22
|
+
suggestedFix?: string;
|
|
23
|
+
repro?: string;
|
|
24
|
+
};
|
|
25
|
+
export type NovelContinuityResultJson = {
|
|
26
|
+
version: 1;
|
|
27
|
+
reportPath?: string;
|
|
28
|
+
stats: {
|
|
29
|
+
errors: number;
|
|
30
|
+
warns: number;
|
|
31
|
+
infos: number;
|
|
32
|
+
durationMs: number;
|
|
33
|
+
};
|
|
34
|
+
findings: ContinuityFinding[];
|
|
35
|
+
nextSteps?: string[];
|
|
36
|
+
diagnostics: Diagnostic[];
|
|
37
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
2
|
+
export type NovelEntityKind = "characters" | "threads" | "factions" | "locations";
|
|
3
|
+
export type NovelEntityGapsArgs = {
|
|
4
|
+
rootDir?: string;
|
|
5
|
+
manuscriptDir?: string;
|
|
6
|
+
outputDir?: string;
|
|
7
|
+
writeReport?: boolean;
|
|
8
|
+
createStubs?: boolean;
|
|
9
|
+
stubPolicy?: "skip" | "write";
|
|
10
|
+
};
|
|
11
|
+
export type MissingEntityRef = {
|
|
12
|
+
kind: NovelEntityKind;
|
|
13
|
+
id: string;
|
|
14
|
+
referencedBy: {
|
|
15
|
+
chapter_id: string;
|
|
16
|
+
path: string;
|
|
17
|
+
}[];
|
|
18
|
+
suggestedPath: string;
|
|
19
|
+
};
|
|
20
|
+
export type OrphanEntity = {
|
|
21
|
+
kind: NovelEntityKind;
|
|
22
|
+
id: string;
|
|
23
|
+
path: string;
|
|
24
|
+
};
|
|
25
|
+
export type NovelEntityGapsResultJson = {
|
|
26
|
+
version: 1;
|
|
27
|
+
reportPath?: string;
|
|
28
|
+
missing: MissingEntityRef[];
|
|
29
|
+
orphans: OrphanEntity[];
|
|
30
|
+
createdStubs: string[];
|
|
31
|
+
nextSteps?: string[];
|
|
32
|
+
diagnostics: Diagnostic[];
|
|
33
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToolContext } from "@opencode-ai/plugin";
|
|
2
|
+
import type { NovelConfig } from "../../config/schema";
|
|
3
|
+
import type { Diagnostic } from "../../shared/errors/diagnostics";
|
|
4
|
+
import type { NovelExportPreflightCheck, NovelExportPreflightFailOn, NovelExportPreflightSummary } from "./types";
|
|
5
|
+
export type RunPreflightOptions = {
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
config: NovelConfig;
|
|
8
|
+
rootDir: string;
|
|
9
|
+
manuscriptDir: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
checks: NovelExportPreflightCheck[];
|
|
12
|
+
failOn: NovelExportPreflightFailOn;
|
|
13
|
+
context?: ToolContext;
|
|
14
|
+
};
|
|
15
|
+
/** 执行配置的预检项并汇总检查报告。 */
|
|
16
|
+
export declare function runPreflight(options: RunPreflightOptions): Promise<{
|
|
17
|
+
summary: NovelExportPreflightSummary | undefined;
|
|
18
|
+
diagnostics: Diagnostic[];
|
|
19
|
+
}>;
|