novelws 1.2.0
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 +161 -0
- package/LICENSE +22 -0
- package/README.md +372 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +50 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/check.d.ts +6 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +32 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +160 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/plugin.d.ts +6 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/commands/plugin.js +135 -0
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/upgrade.d.ts +6 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +92 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/core/config.d.ts +72 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +136 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors.d.ts +59 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +125 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/platform.d.ts +27 -0
- package/dist/core/platform.d.ts.map +1 -0
- package/dist/core/platform.js +75 -0
- package/dist/core/platform.js.map +1 -0
- package/dist/core/template.d.ts +35 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +94 -0
- package/dist/core/template.js.map +1 -0
- package/dist/plugins/identifier.d.ts +13 -0
- package/dist/plugins/identifier.d.ts.map +1 -0
- package/dist/plugins/identifier.js +72 -0
- package/dist/plugins/identifier.js.map +1 -0
- package/dist/plugins/installers/base.d.ts +27 -0
- package/dist/plugins/installers/base.d.ts.map +1 -0
- package/dist/plugins/installers/base.js +30 -0
- package/dist/plugins/installers/base.js.map +1 -0
- package/dist/plugins/installers/github.d.ts +22 -0
- package/dist/plugins/installers/github.d.ts.map +1 -0
- package/dist/plugins/installers/github.js +133 -0
- package/dist/plugins/installers/github.js.map +1 -0
- package/dist/plugins/installers/local.d.ts +16 -0
- package/dist/plugins/installers/local.d.ts.map +1 -0
- package/dist/plugins/installers/local.js +69 -0
- package/dist/plugins/installers/local.js.map +1 -0
- package/dist/plugins/installers/npm.d.ts +20 -0
- package/dist/plugins/installers/npm.d.ts.map +1 -0
- package/dist/plugins/installers/npm.js +99 -0
- package/dist/plugins/installers/npm.js.map +1 -0
- package/dist/plugins/manager.d.ts +77 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +349 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/registry.d.ts +48 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +111 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/types.d.ts +66 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/validator.d.ts +19 -0
- package/dist/plugins/validator.d.ts.map +1 -0
- package/dist/plugins/validator.js +164 -0
- package/dist/plugins/validator.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +48 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/project.d.ts +24 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +61 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +21 -0
- package/dist/version.js.map +1 -0
- package/package.json +76 -0
- package/plugins/authentic-voice/README.md +31 -0
- package/plugins/authentic-voice/commands/authentic-voice.md +73 -0
- package/plugins/authentic-voice/commands/authenticity-audit.md +37 -0
- package/plugins/authentic-voice/config.yaml +30 -0
- package/plugins/authentic-voice/experts/authentic-editor.md +27 -0
- package/plugins/export/README.md +319 -0
- package/plugins/export/commands/export.md +460 -0
- package/plugins/export/commands/generate-cover.md +256 -0
- package/plugins/export/commands/metadata.md +309 -0
- package/plugins/export/config.yaml +47 -0
- package/plugins/export/experts/publishing-expert.md +171 -0
- package/plugins/export/templates/epub/chapter-template.html +13 -0
- package/plugins/export/templates/epub/cover-template.html +14 -0
- package/plugins/export/templates/epub/stylesheet.css +200 -0
- package/plugins/export/templates/pdf/ebook-style.css +137 -0
- package/plugins/export/templates/pdf/print-style.css +179 -0
- package/plugins/export/templates/platforms/jinjiang-format.md +101 -0
- package/plugins/export/templates/platforms/qidian-format.md +108 -0
- package/plugins/export/templates/platforms/tomato-format.md +95 -0
- package/plugins/translate/README.md +265 -0
- package/plugins/translate/commands/glossary.md +731 -0
- package/plugins/translate/commands/translate-preview.md +543 -0
- package/plugins/translate/commands/translate.md +649 -0
- package/plugins/translate/config.yaml +43 -0
- package/plugins/translate/experts/literary-translator.md +605 -0
- package/templates/commands/analyze.md +1485 -0
- package/templates/commands/checklist.md +434 -0
- package/templates/commands/clarify.md +257 -0
- package/templates/commands/constitution.md +257 -0
- package/templates/commands/expert.md +136 -0
- package/templates/commands/plan.md +749 -0
- package/templates/commands/recap.md +613 -0
- package/templates/commands/relations.md +96 -0
- package/templates/commands/revise.md +341 -0
- package/templates/commands/specify.md +682 -0
- package/templates/commands/tasks.md +142 -0
- package/templates/commands/timeline.md +73 -0
- package/templates/commands/track-init.md +137 -0
- package/templates/commands/track.md +463 -0
- package/templates/commands/write.md +1264 -0
- package/templates/config/keyword-mappings.json +106 -0
- package/templates/knowledge/audit-config.json +26 -0
- package/templates/knowledge/character-profiles.md +152 -0
- package/templates/knowledge/character-voices.md +137 -0
- package/templates/knowledge/locations.md +184 -0
- package/templates/knowledge/world-setting.md +121 -0
- package/templates/knowledge-base/README.md +285 -0
- package/templates/knowledge-base/character-archetypes/01-hero.md +233 -0
- package/templates/knowledge-base/character-archetypes/02-mentor.md +177 -0
- package/templates/knowledge-base/character-archetypes/03-shadow.md +221 -0
- package/templates/knowledge-base/character-archetypes/04-ally.md +178 -0
- package/templates/knowledge-base/character-archetypes/05-shapeshifter.md +177 -0
- package/templates/knowledge-base/character-archetypes/06-trickster.md +181 -0
- package/templates/knowledge-base/character-archetypes/07-threshold-guardian.md +177 -0
- package/templates/knowledge-base/character-archetypes/08-herald.md +180 -0
- package/templates/knowledge-base/character-archetypes/09-father.md +249 -0
- package/templates/knowledge-base/character-archetypes/10-mother.md +202 -0
- package/templates/knowledge-base/character-archetypes/11-child.md +183 -0
- package/templates/knowledge-base/character-archetypes/12-sage.md +202 -0
- package/templates/knowledge-base/character-archetypes/README.md +60 -0
- package/templates/knowledge-base/character-archetypes/application-guide.md +222 -0
- package/templates/knowledge-base/character-archetypes/archetype-combinations.md +242 -0
- package/templates/knowledge-base/character-archetypes/config.yaml +28 -0
- package/templates/knowledge-base/character-archetypes/examples-analysis.md +223 -0
- package/templates/knowledge-base/craft/character-arc.md +1153 -0
- package/templates/knowledge-base/craft/dialogue.md +1170 -0
- package/templates/knowledge-base/craft/pacing.md +1200 -0
- package/templates/knowledge-base/craft/scene-structure.md +1136 -0
- package/templates/knowledge-base/craft/show-not-tell.md +1012 -0
- package/templates/knowledge-base/emotional-beats/01-first-meeting.md +145 -0
- package/templates/knowledge-base/emotional-beats/02-bonding-moment.md +226 -0
- package/templates/knowledge-base/emotional-beats/03-declaration.md +284 -0
- package/templates/knowledge-base/emotional-beats/04-triumph.md +240 -0
- package/templates/knowledge-base/emotional-beats/05-reunion.md +396 -0
- package/templates/knowledge-base/emotional-beats/06-forgiveness.md +204 -0
- package/templates/knowledge-base/emotional-beats/07-betrayal.md +204 -0
- package/templates/knowledge-base/emotional-beats/08-loss.md +214 -0
- package/templates/knowledge-base/emotional-beats/09-rejection.md +254 -0
- package/templates/knowledge-base/emotional-beats/10-failure.md +244 -0
- package/templates/knowledge-base/emotional-beats/11-misunderstanding.md +205 -0
- package/templates/knowledge-base/emotional-beats/12-farewell.md +283 -0
- package/templates/knowledge-base/emotional-beats/13-revelation.md +242 -0
- package/templates/knowledge-base/emotional-beats/14-point-of-no-return.md +215 -0
- package/templates/knowledge-base/emotional-beats/15-dark-night.md +244 -0
- package/templates/knowledge-base/emotional-beats/16-sacrifice.md +246 -0
- package/templates/knowledge-base/emotional-beats/17-awakening.md +246 -0
- package/templates/knowledge-base/emotional-beats/18-confrontation.md +217 -0
- package/templates/knowledge-base/emotional-beats/19-bittersweet-goodbye.md +368 -0
- package/templates/knowledge-base/emotional-beats/20-moral-dilemma.md +248 -0
- package/templates/knowledge-base/emotional-beats/21-temptation.md +240 -0
- package/templates/knowledge-base/emotional-beats/22-redemption.md +210 -0
- package/templates/knowledge-base/emotional-beats/README.md +104 -0
- package/templates/knowledge-base/emotional-beats/beat-sequences.md +276 -0
- package/templates/knowledge-base/emotional-beats/config.yaml +30 -0
- package/templates/knowledge-base/emotional-beats/pacing-guide.md +390 -0
- package/templates/knowledge-base/genres/historical.md +1127 -0
- package/templates/knowledge-base/genres/mystery.md +1123 -0
- package/templates/knowledge-base/genres/revenge.md +846 -0
- package/templates/knowledge-base/genres/romance.md +948 -0
- package/templates/knowledge-base/genres/sci-fi.md +156 -0
- package/templates/knowledge-base/genres/thriller.md +166 -0
- package/templates/knowledge-base/genres/wuxia.md +143 -0
- package/templates/knowledge-base/references/README.md +96 -0
- package/templates/knowledge-base/references/china-1920s/culture.md +423 -0
- package/templates/knowledge-base/references/china-1920s/daily-life.md +616 -0
- package/templates/knowledge-base/references/china-1920s/overview.md +298 -0
- package/templates/knowledge-base/references/china-1920s/society.md +703 -0
- package/templates/knowledge-base/references/china-1920s/warlords.md +427 -0
- package/templates/knowledge-base/references/cultivation-world/daily-life.md +108 -0
- package/templates/knowledge-base/references/cultivation-world/overview.md +64 -0
- package/templates/knowledge-base/references/cultivation-world/power-system.md +108 -0
- package/templates/knowledge-base/references/cultivation-world/sects.md +104 -0
- package/templates/knowledge-base/references/cultivation-world/world-setting.md +108 -0
- package/templates/knowledge-base/references/modern-workplace/corporate.md +115 -0
- package/templates/knowledge-base/references/modern-workplace/daily-life.md +129 -0
- package/templates/knowledge-base/references/modern-workplace/overview.md +73 -0
- package/templates/knowledge-base/references/modern-workplace/relationships.md +107 -0
- package/templates/knowledge-base/references/modern-workplace/tech-industry.md +131 -0
- package/templates/knowledge-base/references/tang-dynasty/culture.md +135 -0
- package/templates/knowledge-base/references/tang-dynasty/daily-life.md +139 -0
- package/templates/knowledge-base/references/tang-dynasty/overview.md +76 -0
- package/templates/knowledge-base/references/tang-dynasty/politics.md +121 -0
- package/templates/knowledge-base/references/tang-dynasty/society.md +126 -0
- package/templates/knowledge-base/requirements/README.md +240 -0
- package/templates/knowledge-base/requirements/anti-ai-v3.md +46 -0
- package/templates/knowledge-base/requirements/anti-ai-v4.md +430 -0
- package/templates/knowledge-base/requirements/fast-paced.md +552 -0
- package/templates/knowledge-base/requirements/no-poison.md +60 -0
- package/templates/knowledge-base/requirements/romance-angst.md +102 -0
- package/templates/knowledge-base/requirements/romance-sweet.md +63 -0
- package/templates/knowledge-base/requirements/serious-literature.md +45 -0
- package/templates/knowledge-base/requirements/strong-emotion.md +60 -0
- package/templates/knowledge-base/styles/README.md +302 -0
- package/templates/knowledge-base/styles/ancient-style.md +579 -0
- package/templates/knowledge-base/styles/literary.md +439 -0
- package/templates/knowledge-base/styles/minimal.md +472 -0
- package/templates/knowledge-base/styles/natural-voice.md +930 -0
- package/templates/knowledge-base/styles/web-novel.md +525 -0
- package/templates/memory/constitution.md +140 -0
- package/templates/memory/personal-voice.md +113 -0
- package/templates/scripts/README.md +187 -0
- package/templates/scripts/bash/analyze-story.sh +170 -0
- package/templates/scripts/bash/check-consistency.sh +463 -0
- package/templates/scripts/bash/check-plot.sh +374 -0
- package/templates/scripts/bash/check-timeline.sh +346 -0
- package/templates/scripts/bash/check-world.sh +395 -0
- package/templates/scripts/bash/check-writing-state.sh +854 -0
- package/templates/scripts/bash/clarify-story.sh +117 -0
- package/templates/scripts/bash/common.sh +151 -0
- package/templates/scripts/bash/constitution.sh +114 -0
- package/templates/scripts/bash/generate-tasks.sh +65 -0
- package/templates/scripts/bash/init-tracking.sh +183 -0
- package/templates/scripts/bash/manage-relations.sh +174 -0
- package/templates/scripts/bash/plan-story.sh +100 -0
- package/templates/scripts/bash/specify-story.sh +93 -0
- package/templates/scripts/bash/tasks-story.sh +96 -0
- package/templates/scripts/bash/test-word-count.sh +182 -0
- package/templates/scripts/bash/tests/bench-preload-cache.sh +100 -0
- package/templates/scripts/bash/tests/run-all-benchmarks.sh +16 -0
- package/templates/scripts/bash/tests/test-cache-semantics.sh +199 -0
- package/templates/scripts/bash/tests/test-cross-platform.sh +35 -0
- package/templates/scripts/bash/tests/test-edge-cases-bash.sh +60 -0
- package/templates/scripts/bash/tests/test-phase1-bash.sh +28 -0
- package/templates/scripts/bash/tests/test-preload-cache.sh +123 -0
- package/templates/scripts/bash/tests/test-regex-precompile.sh +89 -0
- package/templates/scripts/bash/tests/test-regression-bash.sh +42 -0
- package/templates/scripts/bash/tests/test-task6-verification.sh +200 -0
- package/templates/scripts/bash/text-audit.sh +144 -0
- package/templates/scripts/bash/track-progress.sh +194 -0
- package/templates/scripts/powershell/analyze-story.ps1 +171 -0
- package/templates/scripts/powershell/check-analyze-stage.ps1 +110 -0
- package/templates/scripts/powershell/check-consistency.ps1 +138 -0
- package/templates/scripts/powershell/check-plot.ps1 +139 -0
- package/templates/scripts/powershell/check-timeline.ps1 +112 -0
- package/templates/scripts/powershell/check-writing-state.ps1 +490 -0
- package/templates/scripts/powershell/check-writing-state.ps1.backup +135 -0
- package/templates/scripts/powershell/clarify-story.ps1 +107 -0
- package/templates/scripts/powershell/common.ps1 +36 -0
- package/templates/scripts/powershell/constitution.ps1 +142 -0
- package/templates/scripts/powershell/generate-tasks.ps1 +75 -0
- package/templates/scripts/powershell/init-tracking.ps1 +98 -0
- package/templates/scripts/powershell/manage-relations.ps1 +134 -0
- package/templates/scripts/powershell/plan-story.ps1 +96 -0
- package/templates/scripts/powershell/specify-story.ps1 +82 -0
- package/templates/scripts/powershell/tests/bench-ps-cache.ps1 +80 -0
- package/templates/scripts/powershell/tests/test-cross-platform.ps1 +27 -0
- package/templates/scripts/powershell/tests/test-edge-cases-ps.ps1 +29 -0
- package/templates/scripts/powershell/tests/test-phase1-ps.ps1 +28 -0
- package/templates/scripts/powershell/tests/test-ps-cache.ps1 +73 -0
- package/templates/scripts/powershell/tests/test-regression-ps.ps1 +40 -0
- package/templates/scripts/powershell/text-audit.ps1 +100 -0
- package/templates/scripts/powershell/track-progress.ps1 +105 -0
- package/templates/skills/genre-knowledge/fantasy/SKILL.md +355 -0
- package/templates/skills/genre-knowledge/mystery/SKILL.md +337 -0
- package/templates/skills/genre-knowledge/romance/SKILL.md +228 -0
- package/templates/skills/genre-knowledge/sci-fi/SKILL.md +65 -0
- package/templates/skills/genre-knowledge/thriller/SKILL.md +95 -0
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +341 -0
- package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +157 -0
- package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +147 -0
- package/templates/skills/quality-assurance/getting-started/SKILL.md +224 -0
- package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +143 -0
- package/templates/skills/quality-assurance/pov-validator/SKILL.md +135 -0
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +583 -0
- package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +119 -0
- package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +146 -0
- package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +160 -0
- package/templates/skills/quality-assurance/requirement-detector/SKILL.md +149 -0
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +611 -0
- package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +126 -0
- package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +206 -0
- package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +207 -0
- package/templates/skills/quality-assurance/style-detector/SKILL.md +126 -0
- package/templates/skills/quality-assurance/workflow-guide/SKILL.md +381 -0
- package/templates/skills/writing-techniques/character-arc/SKILL.md +267 -0
- package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +366 -0
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +553 -0
- package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +226 -0
- package/templates/skills/writing-techniques/pacing-control/SKILL.md +377 -0
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +578 -0
- package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +209 -0
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +496 -0
- package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +221 -0
- package/templates/skills/writing-techniques/scene-structure/SKILL.md +361 -0
- package/templates/skills/writing-techniques/style-learning/SKILL.md +436 -0
- package/templates/specification-example.md +146 -0
- package/templates/tracking/character-state.json +78 -0
- package/templates/tracking/plot-tracker.json +62 -0
- package/templates/tracking/relationships.json +70 -0
- package/templates/tracking/timeline.json +49 -0
- package/templates/tracking/tracking-log.md +110 -0
- package/templates/tracking/validation-rules.json +128 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# 检查情节发展的一致性和连贯性
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# 加载通用函数
|
|
7
|
+
SCRIPT_DIR=$(dirname "$0")
|
|
8
|
+
source "$SCRIPT_DIR/common.sh"
|
|
9
|
+
|
|
10
|
+
# 检查模式
|
|
11
|
+
CHECKLIST_MODE=false
|
|
12
|
+
if [ "$1" = "--checklist" ]; then
|
|
13
|
+
CHECKLIST_MODE=true
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# 获取当前故事目录
|
|
17
|
+
STORY_DIR=$(get_current_story)
|
|
18
|
+
|
|
19
|
+
if [ -z "$STORY_DIR" ]; then
|
|
20
|
+
echo "错误: 未找到故事项目" >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# 文件路径
|
|
25
|
+
PLOT_TRACKER="$STORY_DIR/spec/tracking/plot-tracker.json"
|
|
26
|
+
OUTLINE="$STORY_DIR/outline.md"
|
|
27
|
+
PROGRESS="$STORY_DIR/progress.json"
|
|
28
|
+
|
|
29
|
+
# 检查必要文件
|
|
30
|
+
check_required_files() {
|
|
31
|
+
local missing=false
|
|
32
|
+
|
|
33
|
+
if [ ! -f "$PLOT_TRACKER" ]; then
|
|
34
|
+
echo "⚠️ 未找到情节追踪文件,正在创建..." >&2
|
|
35
|
+
mkdir -p "$STORY_DIR/spec/tracking"
|
|
36
|
+
# 复制模板
|
|
37
|
+
if [ -f "$SCRIPT_DIR/../../templates/tracking/plot-tracker.json" ]; then
|
|
38
|
+
cp "$SCRIPT_DIR/../../templates/tracking/plot-tracker.json" "$PLOT_TRACKER"
|
|
39
|
+
else
|
|
40
|
+
echo "错误: 无法找到模板文件" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
if [ ! -f "$OUTLINE" ]; then
|
|
46
|
+
echo "错误: 未找到章节大纲 (outline.md)" >&2
|
|
47
|
+
echo "请先使用 /outline 命令创建大纲" >&2
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# 读取当前进度
|
|
53
|
+
get_current_progress() {
|
|
54
|
+
if [ -f "$PROGRESS" ]; then
|
|
55
|
+
CURRENT_CHAPTER=$(jq -r '.statistics.currentChapter // 1' "$PROGRESS")
|
|
56
|
+
CURRENT_VOLUME=$(jq -r '.statistics.currentVolume // 1' "$PROGRESS")
|
|
57
|
+
else
|
|
58
|
+
CURRENT_CHAPTER=$(jq -r '.currentState.chapter // 1' "$PLOT_TRACKER")
|
|
59
|
+
CURRENT_VOLUME=$(jq -r '.currentState.volume // 1' "$PLOT_TRACKER")
|
|
60
|
+
fi
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# 分析情节对齐
|
|
64
|
+
analyze_plot_alignment() {
|
|
65
|
+
echo "📊 情节发展检查报告"
|
|
66
|
+
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
67
|
+
|
|
68
|
+
# 当前进度
|
|
69
|
+
echo "📍 当前进度:第${CURRENT_CHAPTER}章(第${CURRENT_VOLUME}卷)"
|
|
70
|
+
|
|
71
|
+
# 读取情节追踪数据
|
|
72
|
+
if [ -f "$PLOT_TRACKER" ]; then
|
|
73
|
+
MAIN_PLOT=$(jq -r '.plotlines.main.currentNode // "未设定"' "$PLOT_TRACKER")
|
|
74
|
+
PLOT_STATUS=$(jq -r '.plotlines.main.status // "unknown"' "$PLOT_TRACKER")
|
|
75
|
+
echo "📖 主线进度:$MAIN_PLOT [$PLOT_STATUS]"
|
|
76
|
+
|
|
77
|
+
# 完成的节点
|
|
78
|
+
COMPLETED_COUNT=$(jq '.plotlines.main.completedNodes | length' "$PLOT_TRACKER")
|
|
79
|
+
echo ""
|
|
80
|
+
echo "✅ 已完成节点:${COMPLETED_COUNT}个"
|
|
81
|
+
jq -r '.plotlines.main.completedNodes[]? | " • " + .' "$PLOT_TRACKER" 2>/dev/null || true
|
|
82
|
+
|
|
83
|
+
# 即将到来的节点
|
|
84
|
+
UPCOMING_COUNT=$(jq '.plotlines.main.upcomingNodes | length' "$PLOT_TRACKER")
|
|
85
|
+
if [ "$UPCOMING_COUNT" -gt 0 ]; then
|
|
86
|
+
echo ""
|
|
87
|
+
echo "→ 接下来的节点:"
|
|
88
|
+
jq -r '.plotlines.main.upcomingNodes[0:3][]? | " • " + .' "$PLOT_TRACKER" 2>/dev/null || true
|
|
89
|
+
fi
|
|
90
|
+
fi
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# 检查伏笔状态
|
|
94
|
+
check_foreshadowing() {
|
|
95
|
+
echo ""
|
|
96
|
+
echo "🎯 伏笔追踪"
|
|
97
|
+
echo "───────────"
|
|
98
|
+
|
|
99
|
+
if [ -f "$PLOT_TRACKER" ]; then
|
|
100
|
+
# 统计伏笔
|
|
101
|
+
TOTAL_FORESHADOW=$(jq '.foreshadowing | length' "$PLOT_TRACKER")
|
|
102
|
+
ACTIVE_FORESHADOW=$(jq '[.foreshadowing[] | select(.status == "active")] | length' "$PLOT_TRACKER")
|
|
103
|
+
RESOLVED_FORESHADOW=$(jq '[.foreshadowing[] | select(.status == "resolved")] | length' "$PLOT_TRACKER")
|
|
104
|
+
|
|
105
|
+
echo "统计:总计${TOTAL_FORESHADOW}个,活跃${ACTIVE_FORESHADOW}个,已回收${RESOLVED_FORESHADOW}个"
|
|
106
|
+
|
|
107
|
+
# 列出待处理的伏笔
|
|
108
|
+
if [ "$ACTIVE_FORESHADOW" -gt 0 ]; then
|
|
109
|
+
echo ""
|
|
110
|
+
echo "⚠️ 待处理伏笔:"
|
|
111
|
+
jq -r '.foreshadowing[] | select(.status == "active") |
|
|
112
|
+
" • " + .content + "(第" + (.planted.chapter | tostring) + "章埋设)"' \
|
|
113
|
+
"$PLOT_TRACKER" 2>/dev/null || true
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
# 检查是否有过期的伏笔(超过30章未处理)
|
|
117
|
+
OVERDUE=$(jq --arg current "$CURRENT_CHAPTER" '
|
|
118
|
+
[.foreshadowing[] |
|
|
119
|
+
select(.status == "active" and .planted.chapter and
|
|
120
|
+
(($current | tonumber) - .planted.chapter) > 30)] |
|
|
121
|
+
length' "$PLOT_TRACKER")
|
|
122
|
+
|
|
123
|
+
if [ "$OVERDUE" -gt 0 ]; then
|
|
124
|
+
echo ""
|
|
125
|
+
echo "⚠️ 警告:有${OVERDUE}个伏笔超过30章未处理"
|
|
126
|
+
fi
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# 检查冲突发展
|
|
131
|
+
check_conflicts() {
|
|
132
|
+
echo ""
|
|
133
|
+
echo "⚔️ 冲突追踪"
|
|
134
|
+
echo "───────────"
|
|
135
|
+
|
|
136
|
+
if [ -f "$PLOT_TRACKER" ]; then
|
|
137
|
+
ACTIVE_CONFLICTS=$(jq '.conflicts.active | length' "$PLOT_TRACKER")
|
|
138
|
+
|
|
139
|
+
if [ "$ACTIVE_CONFLICTS" -gt 0 ]; then
|
|
140
|
+
echo "当前活跃冲突:${ACTIVE_CONFLICTS}个"
|
|
141
|
+
jq -r '.conflicts.active[] |
|
|
142
|
+
" • " + .name + " [" + .intensity + "]"' \
|
|
143
|
+
"$PLOT_TRACKER" 2>/dev/null || true
|
|
144
|
+
else
|
|
145
|
+
echo "暂无活跃冲突"
|
|
146
|
+
fi
|
|
147
|
+
fi
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
# 生成建议
|
|
151
|
+
generate_suggestions() {
|
|
152
|
+
echo ""
|
|
153
|
+
echo "💡 建议"
|
|
154
|
+
echo "───────"
|
|
155
|
+
|
|
156
|
+
# 基于当前章节给出建议
|
|
157
|
+
if [ "$CURRENT_CHAPTER" -lt 10 ]; then
|
|
158
|
+
echo "• 前10章是关键,确保有足够的钩子吸引读者"
|
|
159
|
+
elif [ "$CURRENT_CHAPTER" -lt 30 ]; then
|
|
160
|
+
echo "• 接近第一个小高潮,检查冲突是否足够激烈"
|
|
161
|
+
elif [ "$((CURRENT_CHAPTER % 60))" -gt 50 ]; then
|
|
162
|
+
echo "• 接近卷尾,准备高潮和悬念设置"
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# 基于伏笔状态给建议
|
|
166
|
+
if [ "$ACTIVE_FORESHADOW" -gt 5 ]; then
|
|
167
|
+
echo "• 活跃伏笔较多,考虑在接下来几章回收部分"
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# 基于冲突状态给建议
|
|
171
|
+
if [ "$ACTIVE_CONFLICTS" -eq 0 ] && [ "$CURRENT_CHAPTER" -gt 5 ]; then
|
|
172
|
+
echo "• 当前无活跃冲突,考虑引入新的矛盾点"
|
|
173
|
+
fi
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
# 生成 checklist 格式输出
|
|
177
|
+
output_checklist() {
|
|
178
|
+
# 检查必要文件(静默)
|
|
179
|
+
check_required_files > /dev/null 2>&1 || true
|
|
180
|
+
|
|
181
|
+
# 获取当前进度
|
|
182
|
+
get_current_progress
|
|
183
|
+
|
|
184
|
+
# 收集数据
|
|
185
|
+
local main_plot="未设定"
|
|
186
|
+
local plot_status="unknown"
|
|
187
|
+
local completed_count=0
|
|
188
|
+
local upcoming_count=0
|
|
189
|
+
local total_foreshadow=0
|
|
190
|
+
local active_foreshadow=0
|
|
191
|
+
local resolved_foreshadow=0
|
|
192
|
+
local overdue_foreshadow=0
|
|
193
|
+
local active_conflicts=0
|
|
194
|
+
|
|
195
|
+
if [ -f "$PLOT_TRACKER" ]; then
|
|
196
|
+
main_plot=$(jq -r '.plotlines.main.currentNode // "未设定"' "$PLOT_TRACKER")
|
|
197
|
+
plot_status=$(jq -r '.plotlines.main.status // "unknown"' "$PLOT_TRACKER")
|
|
198
|
+
completed_count=$(jq '.plotlines.main.completedNodes | length' "$PLOT_TRACKER")
|
|
199
|
+
upcoming_count=$(jq '.plotlines.main.upcomingNodes | length' "$PLOT_TRACKER")
|
|
200
|
+
|
|
201
|
+
total_foreshadow=$(jq '.foreshadowing | length' "$PLOT_TRACKER")
|
|
202
|
+
active_foreshadow=$(jq '[.foreshadowing[] | select(.status == "active")] | length' "$PLOT_TRACKER")
|
|
203
|
+
resolved_foreshadow=$(jq '[.foreshadowing[] | select(.status == "resolved")] | length' "$PLOT_TRACKER")
|
|
204
|
+
|
|
205
|
+
overdue_foreshadow=$(jq --arg current "$CURRENT_CHAPTER" '
|
|
206
|
+
[.foreshadowing[] |
|
|
207
|
+
select(.status == "active" and .planted.chapter and
|
|
208
|
+
(($current | tonumber) - .planted.chapter) > 30)] |
|
|
209
|
+
length' "$PLOT_TRACKER")
|
|
210
|
+
|
|
211
|
+
active_conflicts=$(jq '.conflicts.active | length' "$PLOT_TRACKER")
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
# 输出 checklist 格式
|
|
215
|
+
cat <<EOF
|
|
216
|
+
# 情节对齐检查 Checklist
|
|
217
|
+
|
|
218
|
+
**检查时间**: $(date '+%Y-%m-%d %H:%M:%S')
|
|
219
|
+
**检查对象**: plot-tracker.json, outline.md, progress.json
|
|
220
|
+
**当前进度**: 第 ${CURRENT_CHAPTER} 章(第 ${CURRENT_VOLUME} 卷)
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 文件完整性
|
|
225
|
+
|
|
226
|
+
- [$([ -f "$PLOT_TRACKER" ] && echo "x" || echo " ")] CHK001 plot-tracker.json 存在
|
|
227
|
+
- [$([ -f "$OUTLINE" ] && echo "x" || echo " ")] CHK002 outline.md 存在
|
|
228
|
+
- [$([ -f "$PROGRESS" ] && echo "x" || echo " ")] CHK003 progress.json 存在
|
|
229
|
+
|
|
230
|
+
## 情节进度
|
|
231
|
+
|
|
232
|
+
- [$([ "$plot_status" != "unknown" ] && echo "x" || echo " ")] CHK004 主线情节状态已更新(当前:$plot_status)
|
|
233
|
+
- [x] CHK005 主线情节节点进度:$main_plot
|
|
234
|
+
- [$([ $completed_count -gt 0 ] && echo "x" || echo " ")] CHK006 已完成情节节点($completed_count 个)
|
|
235
|
+
- [$([ $upcoming_count -gt 0 ] && echo "x" || echo " ")] CHK007 后续情节节点已规划($upcoming_count 个)
|
|
236
|
+
|
|
237
|
+
## 伏笔管理
|
|
238
|
+
|
|
239
|
+
EOF
|
|
240
|
+
|
|
241
|
+
if [ $total_foreshadow -gt 0 ]; then
|
|
242
|
+
echo "- [x] CHK008 伏笔记录存在(总计 $total_foreshadow 个)"
|
|
243
|
+
echo "- [x] CHK009 伏笔状态跟踪(活跃 $active_foreshadow 个,已回收 $resolved_foreshadow 个)"
|
|
244
|
+
|
|
245
|
+
if [ $overdue_foreshadow -eq 0 ]; then
|
|
246
|
+
echo "- [x] CHK010 伏笔回收及时(无超过30章未处理)"
|
|
247
|
+
else
|
|
248
|
+
echo "- [!] CHK010 伏笔回收及时(⚠️ ${overdue_foreshadow}个超过30章未处理)"
|
|
249
|
+
fi
|
|
250
|
+
|
|
251
|
+
if [ $active_foreshadow -le 5 ]; then
|
|
252
|
+
echo "- [x] CHK011 活跃伏笔数量合理($active_foreshadow ≤ 5)"
|
|
253
|
+
elif [ $active_foreshadow -le 10 ]; then
|
|
254
|
+
echo "- [!] CHK011 活跃伏笔数量偏多($active_foreshadow 个,建议回收部分)"
|
|
255
|
+
else
|
|
256
|
+
echo "- [!] CHK011 活跃伏笔数量过多(⚠️ $active_foreshadow > 10,可能造成混乱)"
|
|
257
|
+
fi
|
|
258
|
+
else
|
|
259
|
+
echo "- [ ] CHK008 伏笔记录存在(未找到伏笔记录)"
|
|
260
|
+
echo "- [ ] CHK009 伏笔状态跟踪(无数据)"
|
|
261
|
+
echo "- [ ] CHK010 伏笔回收及时(无数据)"
|
|
262
|
+
echo "- [ ] CHK011 活跃伏笔数量合理(无数据)"
|
|
263
|
+
fi
|
|
264
|
+
|
|
265
|
+
cat <<EOF
|
|
266
|
+
|
|
267
|
+
## 冲突发展
|
|
268
|
+
|
|
269
|
+
EOF
|
|
270
|
+
|
|
271
|
+
if [ $active_conflicts -gt 0 ]; then
|
|
272
|
+
echo "- [x] CHK012 存在活跃冲突($active_conflicts 个)"
|
|
273
|
+
elif [ $CURRENT_CHAPTER -gt 5 ]; then
|
|
274
|
+
echo "- [!] CHK012 存在活跃冲突(⚠️ 当前无活跃冲突,建议引入矛盾点)"
|
|
275
|
+
else
|
|
276
|
+
echo "- [x] CHK012 存在活跃冲突(前期章节,可暂无冲突)"
|
|
277
|
+
fi
|
|
278
|
+
|
|
279
|
+
cat <<EOF
|
|
280
|
+
|
|
281
|
+
## 节奏建议
|
|
282
|
+
|
|
283
|
+
EOF
|
|
284
|
+
|
|
285
|
+
# 基于当前章节给出检查项
|
|
286
|
+
if [ $CURRENT_CHAPTER -lt 10 ]; then
|
|
287
|
+
echo "- [ ] CHK013 前10章钩子设置(确保有足够吸引力)"
|
|
288
|
+
elif [ $CURRENT_CHAPTER -lt 30 ]; then
|
|
289
|
+
echo "- [ ] CHK014 第一个小高潮准备(检查冲突强度)"
|
|
290
|
+
elif [ $((CURRENT_CHAPTER % 60)) -gt 50 ]; then
|
|
291
|
+
echo "- [ ] CHK015 卷尾高潮设置(准备悬念和高潮)"
|
|
292
|
+
else
|
|
293
|
+
echo "- [x] CHK016 节奏正常(无特殊节点提醒)"
|
|
294
|
+
fi
|
|
295
|
+
|
|
296
|
+
cat <<EOF
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 后续行动
|
|
301
|
+
|
|
302
|
+
EOF
|
|
303
|
+
|
|
304
|
+
# 动态生成后续行动
|
|
305
|
+
local has_actions=false
|
|
306
|
+
|
|
307
|
+
if [ $overdue_foreshadow -gt 0 ]; then
|
|
308
|
+
echo "- [ ] 回收超期伏笔(${overdue_foreshadow}个)"
|
|
309
|
+
has_actions=true
|
|
310
|
+
fi
|
|
311
|
+
|
|
312
|
+
if [ $active_foreshadow -gt 10 ]; then
|
|
313
|
+
echo "- [ ] 减少活跃伏笔数量(当前 $active_foreshadow 个)"
|
|
314
|
+
has_actions=true
|
|
315
|
+
fi
|
|
316
|
+
|
|
317
|
+
if [ $active_conflicts -eq 0 ] && [ $CURRENT_CHAPTER -gt 5 ]; then
|
|
318
|
+
echo "- [ ] 引入新的冲突点"
|
|
319
|
+
has_actions=true
|
|
320
|
+
fi
|
|
321
|
+
|
|
322
|
+
if [ $upcoming_count -eq 0 ]; then
|
|
323
|
+
echo "- [ ] 规划后续情节节点"
|
|
324
|
+
has_actions=true
|
|
325
|
+
fi
|
|
326
|
+
|
|
327
|
+
if [ "$has_actions" = false ]; then
|
|
328
|
+
echo "*当前情节发展良好,无需特别行动*"
|
|
329
|
+
fi
|
|
330
|
+
|
|
331
|
+
cat <<EOF
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
**检查工具**: check-plot.sh
|
|
336
|
+
**版本**: 1.1 (支持 checklist 输出)
|
|
337
|
+
EOF
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
# 主函数
|
|
341
|
+
main() {
|
|
342
|
+
if [ "$CHECKLIST_MODE" = true ]; then
|
|
343
|
+
output_checklist
|
|
344
|
+
else
|
|
345
|
+
echo "🔍 开始检查情节一致性..."
|
|
346
|
+
echo ""
|
|
347
|
+
|
|
348
|
+
# 检查必要文件
|
|
349
|
+
check_required_files
|
|
350
|
+
|
|
351
|
+
# 获取当前进度
|
|
352
|
+
get_current_progress
|
|
353
|
+
|
|
354
|
+
# 执行各项检查
|
|
355
|
+
analyze_plot_alignment
|
|
356
|
+
check_foreshadowing
|
|
357
|
+
check_conflicts
|
|
358
|
+
generate_suggestions
|
|
359
|
+
|
|
360
|
+
echo ""
|
|
361
|
+
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
362
|
+
echo "✅ 检查完成"
|
|
363
|
+
fi
|
|
364
|
+
|
|
365
|
+
# 更新检查时间
|
|
366
|
+
if [ -f "$PLOT_TRACKER" ]; then
|
|
367
|
+
TEMP_FILE=$(mktemp)
|
|
368
|
+
jq --arg date "$(date -Iseconds)" '.lastUpdated = $date' "$PLOT_TRACKER" > "$TEMP_FILE"
|
|
369
|
+
mv "$TEMP_FILE" "$PLOT_TRACKER"
|
|
370
|
+
fi
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
# 执行主函数
|
|
374
|
+
main
|