novelws 4.0.0 → 5.0.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 +100 -623
- package/README.md +79 -594
- package/dist/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -99
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +17 -108
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/core/config.d.ts +1 -37
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +6 -45
- package/dist/core/config.js.map +1 -1
- package/dist/core/errors.d.ts +0 -31
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +0 -58
- package/dist/core/errors.js.map +1 -1
- package/dist/utils/diagnostics.d.ts +2 -16
- package/dist/utils/diagnostics.d.ts.map +1 -1
- package/dist/utils/diagnostics.js +5 -72
- package/dist/utils/diagnostics.js.map +1 -1
- package/dist/utils/project.d.ts +1 -1
- package/dist/utils/project.d.ts.map +1 -1
- package/dist/utils/project.js +3 -3
- package/dist/utils/project.js.map +1 -1
- package/package.json +1 -2
- package/templates/commands/analyze.md +65 -265
- package/templates/commands/expand.md +70 -0
- package/templates/commands/plan.md +47 -452
- package/templates/commands/specify.md +43 -869
- package/templates/commands/write.md +49 -643
- package/templates/dot-claude/CLAUDE.md +38 -202
- package/templates/resources/anti-ai.md +16 -0
- package/templates/resources/style-reference.md +19 -0
- package/templates/tracking/character-state.json +1 -76
- package/templates/tracking/plot-tracker.json +3 -60
- package/templates/tracking/relationships.json +1 -68
- package/templates/tracking/timeline.json +1 -47
- package/dist/commands/plugin.d.ts +0 -6
- package/dist/commands/plugin.d.ts.map +0 -1
- package/dist/commands/plugin.js +0 -135
- package/dist/commands/plugin.js.map +0 -1
- package/dist/plugins/identifier.d.ts +0 -13
- package/dist/plugins/identifier.d.ts.map +0 -1
- package/dist/plugins/identifier.js +0 -72
- package/dist/plugins/identifier.js.map +0 -1
- package/dist/plugins/installers/base.d.ts +0 -27
- package/dist/plugins/installers/base.d.ts.map +0 -1
- package/dist/plugins/installers/base.js +0 -30
- package/dist/plugins/installers/base.js.map +0 -1
- package/dist/plugins/installers/github.d.ts +0 -22
- package/dist/plugins/installers/github.d.ts.map +0 -1
- package/dist/plugins/installers/github.js +0 -133
- package/dist/plugins/installers/github.js.map +0 -1
- package/dist/plugins/installers/local.d.ts +0 -16
- package/dist/plugins/installers/local.d.ts.map +0 -1
- package/dist/plugins/installers/local.js +0 -69
- package/dist/plugins/installers/local.js.map +0 -1
- package/dist/plugins/installers/npm.d.ts +0 -20
- package/dist/plugins/installers/npm.d.ts.map +0 -1
- package/dist/plugins/installers/npm.js +0 -99
- package/dist/plugins/installers/npm.js.map +0 -1
- package/dist/plugins/manager.d.ts +0 -77
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -349
- package/dist/plugins/manager.js.map +0 -1
- package/dist/plugins/registry.d.ts +0 -48
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -111
- package/dist/plugins/registry.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -66
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -2
- package/dist/plugins/types.js.map +0 -1
- package/dist/plugins/validator.d.ts +0 -19
- package/dist/plugins/validator.d.ts.map +0 -1
- package/dist/plugins/validator.js +0 -164
- package/dist/plugins/validator.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -13
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -48
- package/dist/utils/logger.js.map +0 -1
- package/plugins/authentic-voice/README.md +0 -31
- package/plugins/authentic-voice/commands/authentic-voice.md +0 -73
- package/plugins/authentic-voice/commands/authenticity-audit.md +0 -37
- package/plugins/authentic-voice/config.yaml +0 -30
- package/plugins/authentic-voice/experts/authentic-editor.md +0 -27
- package/plugins/export/README.md +0 -319
- package/plugins/export/commands/export.md +0 -460
- package/plugins/export/commands/generate-cover.md +0 -256
- package/plugins/export/commands/metadata.md +0 -309
- package/plugins/export/config.yaml +0 -47
- package/plugins/export/experts/publishing-expert.md +0 -171
- package/plugins/export/templates/epub/chapter-template.html +0 -13
- package/plugins/export/templates/epub/cover-template.html +0 -14
- package/plugins/export/templates/epub/stylesheet.css +0 -200
- package/plugins/export/templates/pdf/ebook-style.css +0 -137
- package/plugins/export/templates/pdf/print-style.css +0 -179
- package/plugins/export/templates/platforms/jinjiang-format.md +0 -101
- package/plugins/export/templates/platforms/qidian-format.md +0 -108
- package/plugins/export/templates/platforms/tomato-format.md +0 -95
- package/plugins/translate/README.md +0 -265
- package/plugins/translate/commands/glossary.md +0 -731
- package/plugins/translate/commands/translate-preview.md +0 -543
- package/plugins/translate/commands/translate.md +0 -649
- package/plugins/translate/config.yaml +0 -43
- package/plugins/translate/experts/literary-translator.md +0 -605
- package/templates/commands/character.md +0 -287
- package/templates/commands/checklist.md +0 -744
- package/templates/commands/clarify.md +0 -269
- package/templates/commands/constitution.md +0 -269
- package/templates/commands/expert.md +0 -188
- package/templates/commands/facts.md +0 -552
- package/templates/commands/guide.md +0 -900
- package/templates/commands/help-me.md +0 -221
- package/templates/commands/recap.md +0 -748
- package/templates/commands/relations.md +0 -385
- package/templates/commands/revise.md +0 -450
- package/templates/commands/search.md +0 -531
- package/templates/commands/tasks.md +0 -396
- package/templates/commands/timeline.md +0 -309
- package/templates/commands/track-init.md +0 -149
- package/templates/commands/track.md +0 -704
- package/templates/commands/volume-summary.md +0 -471
- package/templates/knowledge/audit-config.json +0 -26
- package/templates/knowledge/character-profiles.md +0 -152
- package/templates/knowledge/character-voices.md +0 -137
- package/templates/knowledge/locations.md +0 -184
- package/templates/knowledge/world-setting.md +0 -121
- package/templates/resources/character-archetypes/01-hero.md +0 -233
- package/templates/resources/character-archetypes/02-mentor.md +0 -177
- package/templates/resources/character-archetypes/03-shadow.md +0 -221
- package/templates/resources/character-archetypes/04-ally.md +0 -178
- package/templates/resources/character-archetypes/05-shapeshifter.md +0 -177
- package/templates/resources/character-archetypes/06-trickster.md +0 -181
- package/templates/resources/character-archetypes/07-threshold-guardian.md +0 -177
- package/templates/resources/character-archetypes/08-herald.md +0 -180
- package/templates/resources/character-archetypes/09-father.md +0 -249
- package/templates/resources/character-archetypes/10-mother.md +0 -202
- package/templates/resources/character-archetypes/11-child.md +0 -183
- package/templates/resources/character-archetypes/12-sage.md +0 -202
- package/templates/resources/character-archetypes/README.md +0 -60
- package/templates/resources/character-archetypes/application-guide.md +0 -222
- package/templates/resources/character-archetypes/archetype-combinations.md +0 -242
- package/templates/resources/character-archetypes/config.yaml +0 -28
- package/templates/resources/character-archetypes/examples-analysis.md +0 -223
- package/templates/resources/config/keyword-mappings.json +0 -226
- package/templates/resources/config/specification-example.md +0 -146
- package/templates/resources/craft/character-arc.md +0 -1153
- package/templates/resources/craft/dialogue.md +0 -1170
- package/templates/resources/craft/hook-design.md +0 -345
- package/templates/resources/craft/pacing.md +0 -1200
- package/templates/resources/craft/power-system.md +0 -254
- package/templates/resources/craft/scene-structure.md +0 -1136
- package/templates/resources/craft/show-not-tell.md +0 -1012
- package/templates/resources/craft/story-structures.md +0 -134
- package/templates/resources/craft/tension-management.md +0 -168
- package/templates/resources/emotional-beats/01-first-meeting.md +0 -145
- package/templates/resources/emotional-beats/02-bonding-moment.md +0 -226
- package/templates/resources/emotional-beats/03-declaration.md +0 -284
- package/templates/resources/emotional-beats/04-triumph.md +0 -240
- package/templates/resources/emotional-beats/05-reunion.md +0 -396
- package/templates/resources/emotional-beats/06-forgiveness.md +0 -204
- package/templates/resources/emotional-beats/07-betrayal.md +0 -204
- package/templates/resources/emotional-beats/08-loss.md +0 -214
- package/templates/resources/emotional-beats/09-rejection.md +0 -254
- package/templates/resources/emotional-beats/10-failure.md +0 -244
- package/templates/resources/emotional-beats/11-misunderstanding.md +0 -205
- package/templates/resources/emotional-beats/12-farewell.md +0 -283
- package/templates/resources/emotional-beats/13-revelation.md +0 -242
- package/templates/resources/emotional-beats/14-point-of-no-return.md +0 -215
- package/templates/resources/emotional-beats/15-dark-night.md +0 -244
- package/templates/resources/emotional-beats/16-sacrifice.md +0 -246
- package/templates/resources/emotional-beats/17-awakening.md +0 -246
- package/templates/resources/emotional-beats/18-confrontation.md +0 -217
- package/templates/resources/emotional-beats/19-bittersweet-goodbye.md +0 -368
- package/templates/resources/emotional-beats/20-moral-dilemma.md +0 -248
- package/templates/resources/emotional-beats/21-temptation.md +0 -240
- package/templates/resources/emotional-beats/22-redemption.md +0 -210
- package/templates/resources/emotional-beats/README.md +0 -104
- package/templates/resources/emotional-beats/beat-sequences.md +0 -276
- package/templates/resources/emotional-beats/config.yaml +0 -30
- package/templates/resources/emotional-beats/pacing-guide.md +0 -390
- package/templates/resources/genres/game-lit.md +0 -174
- package/templates/resources/genres/historical.md +0 -1127
- package/templates/resources/genres/horror.md +0 -211
- package/templates/resources/genres/military.md +0 -209
- package/templates/resources/genres/mystery.md +0 -1123
- package/templates/resources/genres/rebirth.md +0 -177
- package/templates/resources/genres/revenge.md +0 -846
- package/templates/resources/genres/romance.md +0 -948
- package/templates/resources/genres/sci-fi.md +0 -156
- package/templates/resources/genres/sports.md +0 -216
- package/templates/resources/genres/thriller.md +0 -166
- package/templates/resources/genres/urban.md +0 -170
- package/templates/resources/genres/workplace.md +0 -214
- package/templates/resources/genres/wuxia.md +0 -143
- package/templates/resources/genres/xuanhuan.md +0 -234
- package/templates/resources/genres/youth.md +0 -219
- package/templates/resources/memory/personal-voice.md +0 -113
- package/templates/resources/references/README.md +0 -96
- package/templates/resources/references/china-1920s/culture.md +0 -423
- package/templates/resources/references/china-1920s/daily-life.md +0 -616
- package/templates/resources/references/china-1920s/overview.md +0 -298
- package/templates/resources/references/china-1920s/society.md +0 -703
- package/templates/resources/references/china-1920s/warlords.md +0 -427
- package/templates/resources/references/cultivation-world/daily-life.md +0 -108
- package/templates/resources/references/cultivation-world/overview.md +0 -64
- package/templates/resources/references/cultivation-world/power-system.md +0 -108
- package/templates/resources/references/cultivation-world/sects.md +0 -104
- package/templates/resources/references/cultivation-world/world-setting.md +0 -108
- package/templates/resources/references/modern-workplace/corporate.md +0 -115
- package/templates/resources/references/modern-workplace/daily-life.md +0 -129
- package/templates/resources/references/modern-workplace/overview.md +0 -73
- package/templates/resources/references/modern-workplace/relationships.md +0 -107
- package/templates/resources/references/modern-workplace/tech-industry.md +0 -131
- package/templates/resources/references/tang-dynasty/culture.md +0 -135
- package/templates/resources/references/tang-dynasty/daily-life.md +0 -139
- package/templates/resources/references/tang-dynasty/overview.md +0 -76
- package/templates/resources/references/tang-dynasty/politics.md +0 -121
- package/templates/resources/references/tang-dynasty/society.md +0 -126
- package/templates/resources/requirements/README.md +0 -240
- package/templates/resources/requirements/anti-ai-v3.md +0 -46
- package/templates/resources/requirements/anti-ai-v4-deprecated.md +0 -442
- package/templates/resources/requirements/anti-ai-v5-balanced.md +0 -203
- package/templates/resources/requirements/concretization.md +0 -90
- package/templates/resources/requirements/fast-paced.md +0 -552
- package/templates/resources/requirements/no-poison.md +0 -60
- package/templates/resources/requirements/romance-angst.md +0 -102
- package/templates/resources/requirements/romance-sweet.md +0 -63
- package/templates/resources/requirements/serious-literature.md +0 -45
- package/templates/resources/requirements/strong-emotion.md +0 -60
- package/templates/resources/scripts/README.md +0 -187
- package/templates/resources/scripts/bash/analyze-story.sh +0 -170
- package/templates/resources/scripts/bash/check-analyze-stage.sh +0 -108
- package/templates/resources/scripts/bash/check-consistency.sh +0 -463
- package/templates/resources/scripts/bash/check-facts.sh +0 -214
- package/templates/resources/scripts/bash/check-plot.sh +0 -374
- package/templates/resources/scripts/bash/check-timeline.sh +0 -346
- package/templates/resources/scripts/bash/check-world.sh +0 -395
- package/templates/resources/scripts/bash/check-writing-state.sh +0 -854
- package/templates/resources/scripts/bash/clarify-story.sh +0 -117
- package/templates/resources/scripts/bash/common.sh +0 -151
- package/templates/resources/scripts/bash/constitution.sh +0 -114
- package/templates/resources/scripts/bash/generate-tasks.sh +0 -65
- package/templates/resources/scripts/bash/init-tracking.sh +0 -183
- package/templates/resources/scripts/bash/manage-relations.sh +0 -174
- package/templates/resources/scripts/bash/migrate-tracking.sh +0 -183
- package/templates/resources/scripts/bash/plan-story.sh +0 -100
- package/templates/resources/scripts/bash/specify-story.sh +0 -93
- package/templates/resources/scripts/bash/tasks-story.sh +0 -96
- package/templates/resources/scripts/bash/test-word-count.sh +0 -182
- package/templates/resources/scripts/bash/tests/bench-preload-cache.sh +0 -100
- package/templates/resources/scripts/bash/tests/run-all-benchmarks.sh +0 -16
- package/templates/resources/scripts/bash/tests/test-cache-semantics.sh +0 -199
- package/templates/resources/scripts/bash/tests/test-cross-platform.sh +0 -35
- package/templates/resources/scripts/bash/tests/test-edge-cases-bash.sh +0 -60
- package/templates/resources/scripts/bash/tests/test-phase1-bash.sh +0 -28
- package/templates/resources/scripts/bash/tests/test-preload-cache.sh +0 -123
- package/templates/resources/scripts/bash/tests/test-regex-precompile.sh +0 -89
- package/templates/resources/scripts/bash/tests/test-regression-bash.sh +0 -42
- package/templates/resources/scripts/bash/tests/test-task6-verification.sh +0 -200
- package/templates/resources/scripts/bash/text-audit.sh +0 -144
- package/templates/resources/scripts/bash/track-progress.sh +0 -194
- package/templates/resources/scripts/powershell/analyze-story.ps1 +0 -174
- package/templates/resources/scripts/powershell/check-analyze-stage.ps1 +0 -110
- package/templates/resources/scripts/powershell/check-consistency.ps1 +0 -138
- package/templates/resources/scripts/powershell/check-facts.ps1 +0 -195
- package/templates/resources/scripts/powershell/check-plot.ps1 +0 -139
- package/templates/resources/scripts/powershell/check-timeline.ps1 +0 -112
- package/templates/resources/scripts/powershell/check-writing-state.ps1 +0 -486
- package/templates/resources/scripts/powershell/clarify-story.ps1 +0 -107
- package/templates/resources/scripts/powershell/common.ps1 +0 -36
- package/templates/resources/scripts/powershell/constitution.ps1 +0 -145
- package/templates/resources/scripts/powershell/generate-tasks.ps1 +0 -70
- package/templates/resources/scripts/powershell/init-tracking.ps1 +0 -98
- package/templates/resources/scripts/powershell/manage-relations.ps1 +0 -134
- package/templates/resources/scripts/powershell/migrate-tracking.ps1 +0 -145
- package/templates/resources/scripts/powershell/plan-story.ps1 +0 -99
- package/templates/resources/scripts/powershell/specify-story.ps1 +0 -85
- package/templates/resources/scripts/powershell/tests/bench-ps-cache.ps1 +0 -80
- package/templates/resources/scripts/powershell/tests/test-cross-platform.ps1 +0 -27
- package/templates/resources/scripts/powershell/tests/test-edge-cases-ps.ps1 +0 -29
- package/templates/resources/scripts/powershell/tests/test-phase1-ps.ps1 +0 -28
- package/templates/resources/scripts/powershell/tests/test-ps-cache.ps1 +0 -73
- package/templates/resources/scripts/powershell/tests/test-regression-ps.ps1 +0 -40
- package/templates/resources/scripts/powershell/text-audit.ps1 +0 -102
- package/templates/resources/scripts/powershell/track-progress.ps1 +0 -105
- package/templates/resources/styles/README.md +0 -302
- package/templates/resources/styles/ancient-style.md +0 -579
- package/templates/resources/styles/literary.md +0 -439
- package/templates/resources/styles/minimal.md +0 -472
- package/templates/resources/styles/natural-voice.md +0 -930
- package/templates/resources/styles/web-novel.md +0 -525
- package/templates/skills/analysis/character-analysis/SKILL.md +0 -71
- package/templates/skills/analysis/foreshadow-analysis/SKILL.md +0 -45
- package/templates/skills/analysis/hook-analysis/SKILL.md +0 -111
- package/templates/skills/analysis/logic-analysis/SKILL.md +0 -58
- package/templates/skills/analysis/opening-analysis/SKILL.md +0 -59
- package/templates/skills/analysis/pacing-analysis/SKILL.md +0 -55
- package/templates/skills/analysis/power-analysis/SKILL.md +0 -148
- package/templates/skills/analysis/reader-analysis/SKILL.md +0 -117
- package/templates/skills/analysis/style-analysis/SKILL.md +0 -60
- package/templates/skills/analysis/voice-analysis/SKILL.md +0 -42
- package/templates/skills/auto-tracking/SKILL.md +0 -280
- package/templates/skills/genre-knowledge/fantasy/SKILL.md +0 -355
- package/templates/skills/genre-knowledge/mystery/SKILL.md +0 -337
- package/templates/skills/genre-knowledge/romance/SKILL.md +0 -228
- package/templates/skills/genre-knowledge/sci-fi/SKILL.md +0 -65
- package/templates/skills/genre-knowledge/thriller/SKILL.md +0 -95
- package/templates/skills/planning/volume-detail/SKILL.md +0 -219
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +0 -412
- package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +0 -157
- package/templates/skills/quality-assurance/facts-checker/SKILL.md +0 -405
- package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +0 -147
- package/templates/skills/quality-assurance/getting-started/SKILL.md +0 -224
- package/templates/skills/quality-assurance/hook-checker/SKILL.md +0 -164
- package/templates/skills/quality-assurance/hook-checker/experts/hook-analyst.md +0 -33
- package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +0 -570
- package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +0 -143
- package/templates/skills/quality-assurance/pov-validator/SKILL.md +0 -135
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +0 -583
- package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +0 -119
- package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +0 -146
- package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +0 -160
- package/templates/skills/quality-assurance/requirement-detector/SKILL.md +0 -149
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +0 -611
- package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +0 -126
- package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +0 -206
- package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +0 -207
- package/templates/skills/quality-assurance/style-detector/SKILL.md +0 -264
- package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +0 -103
- package/templates/skills/quality-assurance/voice-consistency-checker/experts/voice-analyst.md +0 -21
- package/templates/skills/quality-assurance/workflow-guide/SKILL.md +0 -381
- package/templates/skills/writing-techniques/character-arc/SKILL.md +0 -267
- package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +0 -366
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +0 -708
- package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +0 -226
- package/templates/skills/writing-techniques/pacing-control/SKILL.md +0 -480
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +0 -1026
- package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +0 -209
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +0 -496
- package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +0 -221
- package/templates/skills/writing-techniques/scene-structure/SKILL.md +0 -361
- package/templates/skills/writing-techniques/style-learning/SKILL.md +0 -436
- package/templates/skills/writing-techniques/writing-balance/.gitkeep +0 -0
- package/templates/skills/writing-techniques/writing-balance/SKILL.md +0 -460
- package/templates/skills/writing-techniques/writing-techniques/SKILL.md +0 -727
- package/templates/tracking/story-facts.json +0 -5
- package/templates/tracking/summary/characters-summary.json +0 -7
- package/templates/tracking/summary/plot-summary.json +0 -13
- package/templates/tracking/summary/timeline-summary.json +0 -8
- package/templates/tracking/summary/volume-summaries.json +0 -5
- package/templates/tracking/tracking-log.md +0 -110
- package/templates/tracking/validation-rules.json +0 -128
- /package/templates/resources/{memory/constitution.md → constitution.md} +0 -0
|
@@ -1,346 +0,0 @@
|
|
|
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
|
-
# 检查是否为 checklist 模式
|
|
11
|
-
CHECKLIST_MODE=false
|
|
12
|
-
COMMAND="${1:-show}"
|
|
13
|
-
if [ "$COMMAND" = "--checklist" ]; then
|
|
14
|
-
CHECKLIST_MODE=true
|
|
15
|
-
COMMAND="check"
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# 获取当前故事目录
|
|
19
|
-
STORY_DIR=$(get_current_story)
|
|
20
|
-
|
|
21
|
-
if [ -z "$STORY_DIR" ]; then
|
|
22
|
-
echo "错误: 未找到故事项目" >&2
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# 文件路径
|
|
27
|
-
TIMELINE="$STORY_DIR/tracking/timeline.json"
|
|
28
|
-
PROGRESS="$STORY_DIR/progress.json"
|
|
29
|
-
|
|
30
|
-
# 命令参数(已在上面处理 checklist 模式)
|
|
31
|
-
PARAM2="${2:-}"
|
|
32
|
-
|
|
33
|
-
# 初始化时间线文件
|
|
34
|
-
init_timeline() {
|
|
35
|
-
if [ ! -f "$TIMELINE" ]; then
|
|
36
|
-
echo "⚠️ 未找到时间线文件,正在创建..." >&2
|
|
37
|
-
mkdir -p "$STORY_DIR/tracking"
|
|
38
|
-
|
|
39
|
-
if [ -f "$SCRIPT_DIR/../../templates/tracking/timeline.json" ]; then
|
|
40
|
-
cp "$SCRIPT_DIR/../../templates/tracking/timeline.json" "$TIMELINE"
|
|
41
|
-
echo "✅ 时间线文件已创建"
|
|
42
|
-
else
|
|
43
|
-
echo "错误: 无法找到模板文件" >&2
|
|
44
|
-
exit 1
|
|
45
|
-
fi
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
# 显示时间线
|
|
50
|
-
show_timeline() {
|
|
51
|
-
echo "📅 故事时间线"
|
|
52
|
-
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
53
|
-
|
|
54
|
-
if [ -f "$TIMELINE" ]; then
|
|
55
|
-
# 当前时间
|
|
56
|
-
CURRENT_TIME=$(jq -r '.storyTime.current // "未设定"' "$TIMELINE")
|
|
57
|
-
echo "⏰ 当前时间:$CURRENT_TIME"
|
|
58
|
-
echo ""
|
|
59
|
-
|
|
60
|
-
# 时间跨度计算
|
|
61
|
-
START_TIME=$(jq -r '.storyTime.start // ""' "$TIMELINE")
|
|
62
|
-
if [ -n "$START_TIME" ]; then
|
|
63
|
-
echo "📍 起始时间:$START_TIME"
|
|
64
|
-
|
|
65
|
-
# 计算已经历的事件数
|
|
66
|
-
EVENT_COUNT=$(jq '.events | length' "$TIMELINE")
|
|
67
|
-
echo "📊 记录事件:${EVENT_COUNT}个"
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
|
-
echo ""
|
|
71
|
-
echo "📖 重要事件:"
|
|
72
|
-
echo "───────────────"
|
|
73
|
-
|
|
74
|
-
# 显示最近的事件
|
|
75
|
-
jq -r '.events | sort_by(.chapter) | reverse | .[0:5][] |
|
|
76
|
-
"第" + (.chapter | tostring) + "章 | " + .date + " | " + .event' \
|
|
77
|
-
"$TIMELINE" 2>/dev/null || echo " 暂无事件记录"
|
|
78
|
-
|
|
79
|
-
# 显示并行事件
|
|
80
|
-
PARALLEL_COUNT=$(jq '.parallelEvents.timepoints | length' "$TIMELINE" 2>/dev/null || echo "0")
|
|
81
|
-
if [ "$PARALLEL_COUNT" != "0" ] && [ "$PARALLEL_COUNT" != "null" ]; then
|
|
82
|
-
echo ""
|
|
83
|
-
echo "🔄 并行事件:"
|
|
84
|
-
jq -r '.parallelEvents.timepoints | to_entries[] |
|
|
85
|
-
.key + ": " + (.value | join(", "))' "$TIMELINE" 2>/dev/null || true
|
|
86
|
-
fi
|
|
87
|
-
else
|
|
88
|
-
echo "未找到时间线文件"
|
|
89
|
-
fi
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
# 添加时间节点
|
|
93
|
-
add_event() {
|
|
94
|
-
local chapter="${2:-}"
|
|
95
|
-
local date="${3:-}"
|
|
96
|
-
local event="${4:-}"
|
|
97
|
-
|
|
98
|
-
if [ -z "$chapter" ] || [ -z "$date" ] || [ -z "$event" ]; then
|
|
99
|
-
echo "用法: $0 add <章节号> <时间> <事件描述>" >&2
|
|
100
|
-
echo "示例: $0 add 5 '万历三十年春' '主角抵达京城'" >&2
|
|
101
|
-
exit 1
|
|
102
|
-
fi
|
|
103
|
-
|
|
104
|
-
if [ ! -f "$TIMELINE" ]; then
|
|
105
|
-
init_timeline
|
|
106
|
-
fi
|
|
107
|
-
|
|
108
|
-
# 添加新事件
|
|
109
|
-
TEMP_FILE=$(mktemp)
|
|
110
|
-
jq --arg ch "$chapter" \
|
|
111
|
-
--arg dt "$date" \
|
|
112
|
-
--arg ev "$event" \
|
|
113
|
-
'.events += [{
|
|
114
|
-
chapter: ($ch | tonumber),
|
|
115
|
-
date: $dt,
|
|
116
|
-
event: $ev,
|
|
117
|
-
duration: "",
|
|
118
|
-
participants: []
|
|
119
|
-
}] |
|
|
120
|
-
.events |= sort_by(.chapter) |
|
|
121
|
-
.lastUpdated = now | strftime("%Y-%m-%dT%H:%M:%S")' \
|
|
122
|
-
"$TIMELINE" > "$TEMP_FILE"
|
|
123
|
-
|
|
124
|
-
mv "$TEMP_FILE" "$TIMELINE"
|
|
125
|
-
echo "✅ 事件已添加:第${chapter}章 - $date - $event"
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
# 检查时间连续性
|
|
129
|
-
check_continuity() {
|
|
130
|
-
echo "🔍 检查时间线连续性"
|
|
131
|
-
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
132
|
-
|
|
133
|
-
if [ ! -f "$TIMELINE" ]; then
|
|
134
|
-
echo "错误: 时间线文件不存在" >&2
|
|
135
|
-
exit 1
|
|
136
|
-
fi
|
|
137
|
-
|
|
138
|
-
# 检查事件顺序
|
|
139
|
-
echo "检查章节顺序..."
|
|
140
|
-
|
|
141
|
-
# 获取所有章节号并检查是否递增
|
|
142
|
-
CHAPTERS=$(jq -r '.events | sort_by(.chapter) | .[].chapter' "$TIMELINE")
|
|
143
|
-
|
|
144
|
-
prev_chapter=0
|
|
145
|
-
issues=0
|
|
146
|
-
|
|
147
|
-
for chapter in $CHAPTERS; do
|
|
148
|
-
if [ "$chapter" -le "$prev_chapter" ]; then
|
|
149
|
-
echo "⚠️ 章节顺序异常:第${chapter}章出现在第${prev_chapter}章之后"
|
|
150
|
-
((issues++))
|
|
151
|
-
fi
|
|
152
|
-
prev_chapter=$chapter
|
|
153
|
-
done
|
|
154
|
-
|
|
155
|
-
# 检查时间跨度
|
|
156
|
-
echo ""
|
|
157
|
-
echo "检查时间跨度..."
|
|
158
|
-
|
|
159
|
-
# 这里可以添加更复杂的时间逻辑检查
|
|
160
|
-
# 比如检查旅行时间是否合理等
|
|
161
|
-
|
|
162
|
-
if [ "$issues" -eq 0 ]; then
|
|
163
|
-
echo ""
|
|
164
|
-
echo "✅ 时间线检查通过,未发现逻辑问题"
|
|
165
|
-
else
|
|
166
|
-
echo ""
|
|
167
|
-
echo "⚠️ 发现${issues}个潜在问题,请检查"
|
|
168
|
-
fi
|
|
169
|
-
|
|
170
|
-
# 记录检查结果
|
|
171
|
-
if [ -f "$TIMELINE" ]; then
|
|
172
|
-
TEMP_FILE=$(mktemp)
|
|
173
|
-
jq --arg date "$(date -Iseconds)" \
|
|
174
|
-
--arg issues "$issues" \
|
|
175
|
-
'.lastChecked = $date |
|
|
176
|
-
.anomalies.lastCheckIssues = ($issues | tonumber)' \
|
|
177
|
-
"$TIMELINE" > "$TEMP_FILE"
|
|
178
|
-
mv "$TEMP_FILE" "$TIMELINE"
|
|
179
|
-
fi
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
# 同步并行事件
|
|
183
|
-
sync_parallel() {
|
|
184
|
-
local timepoint="${2:-}"
|
|
185
|
-
local events="${3:-}"
|
|
186
|
-
|
|
187
|
-
if [ -z "$timepoint" ] || [ -z "$events" ]; then
|
|
188
|
-
echo "用法: $0 sync <时间点> <事件列表>" >&2
|
|
189
|
-
echo "示例: $0 sync '万历三十年春' '战争爆发,使团到达'" >&2
|
|
190
|
-
exit 1
|
|
191
|
-
fi
|
|
192
|
-
|
|
193
|
-
if [ ! -f "$TIMELINE" ]; then
|
|
194
|
-
init_timeline
|
|
195
|
-
fi
|
|
196
|
-
|
|
197
|
-
# 将事件列表转换为JSON数组
|
|
198
|
-
IFS=',' read -ra EVENT_ARRAY <<< "$events"
|
|
199
|
-
JSON_ARRAY=$(printf '"%s",' "${EVENT_ARRAY[@]}" | sed 's/,$//')
|
|
200
|
-
JSON_ARRAY="[${JSON_ARRAY}]"
|
|
201
|
-
|
|
202
|
-
# 更新并行事件
|
|
203
|
-
TEMP_FILE=$(mktemp)
|
|
204
|
-
jq --arg tp "$timepoint" \
|
|
205
|
-
--argjson events "$JSON_ARRAY" \
|
|
206
|
-
'.parallelEvents.timepoints[$tp] = $events |
|
|
207
|
-
.lastUpdated = now | strftime("%Y-%m-%dT%H:%M:%S")' \
|
|
208
|
-
"$TIMELINE" > "$TEMP_FILE"
|
|
209
|
-
|
|
210
|
-
mv "$TEMP_FILE" "$TIMELINE"
|
|
211
|
-
echo "✅ 并行事件已同步:$timepoint"
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
# 生成 checklist 格式输出
|
|
215
|
-
output_checklist() {
|
|
216
|
-
init_timeline
|
|
217
|
-
|
|
218
|
-
local event_count=0
|
|
219
|
-
local parallel_count=0
|
|
220
|
-
local current_time=""
|
|
221
|
-
local start_time=""
|
|
222
|
-
local has_issues=0
|
|
223
|
-
|
|
224
|
-
if [ -f "$TIMELINE" ]; then
|
|
225
|
-
event_count=$(jq '.events | length' "$TIMELINE")
|
|
226
|
-
parallel_count=$(jq '.parallelEvents.timepoints | length' "$TIMELINE" 2>/dev/null || echo "0")
|
|
227
|
-
current_time=$(jq -r '.storyTime.current // ""' "$TIMELINE")
|
|
228
|
-
start_time=$(jq -r '.storyTime.start // ""' "$TIMELINE")
|
|
229
|
-
|
|
230
|
-
# 检查事件顺序问题
|
|
231
|
-
has_issues=$(jq '
|
|
232
|
-
.events |
|
|
233
|
-
sort_by(.chapter) |
|
|
234
|
-
. as $sorted |
|
|
235
|
-
reduce range(1; length) as $i (0;
|
|
236
|
-
if $sorted[$i].chapter <= $sorted[$i-1].chapter then . + 1 else . end
|
|
237
|
-
)' "$TIMELINE")
|
|
238
|
-
fi
|
|
239
|
-
|
|
240
|
-
cat <<EOF
|
|
241
|
-
# 时间线检查 Checklist
|
|
242
|
-
|
|
243
|
-
**检查时间**: $(date '+%Y-%m-%d %H:%M:%S')
|
|
244
|
-
**检查对象**: tracking/timeline.json
|
|
245
|
-
**记录事件数**: $event_count
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## 文件完整性
|
|
250
|
-
|
|
251
|
-
- [$([ -f "$TIMELINE" ] && echo "x" || echo " ")] CHK001 timeline.json 存在且格式有效
|
|
252
|
-
|
|
253
|
-
## 时间设定
|
|
254
|
-
|
|
255
|
-
- [$([ -n "$start_time" ] && echo "x" || echo " ")] CHK002 故事起始时间已设定($start_time)
|
|
256
|
-
- [$([ -n "$current_time" ] && echo "x" || echo " ")] CHK003 当前故事时间已更新($current_time)
|
|
257
|
-
|
|
258
|
-
## 事件记录
|
|
259
|
-
|
|
260
|
-
- [$([ $event_count -gt 0 ] && echo "x" || echo " ")] CHK004 时间事件已记录($event_count 个)
|
|
261
|
-
- [$([ $has_issues -eq 0 ] && echo "x" || echo "!")] CHK005 时间事件按章节有序排列$([ $has_issues -gt 0 ] && echo "(⚠️ 发现 $has_issues 个乱序)" || echo "")
|
|
262
|
-
|
|
263
|
-
## 并行事件
|
|
264
|
-
|
|
265
|
-
EOF
|
|
266
|
-
|
|
267
|
-
if [ "$parallel_count" -gt 0 ]; then
|
|
268
|
-
echo "- [x] CHK006 并行事件时间点已记录($parallel_count 个)"
|
|
269
|
-
else
|
|
270
|
-
echo "- [ ] CHK006 并行事件时间点已记录(无记录)"
|
|
271
|
-
fi
|
|
272
|
-
|
|
273
|
-
cat <<EOF
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## 后续行动
|
|
278
|
-
|
|
279
|
-
EOF
|
|
280
|
-
|
|
281
|
-
local has_actions=false
|
|
282
|
-
|
|
283
|
-
if [ $event_count -eq 0 ]; then
|
|
284
|
-
echo "- [ ] 开始记录时间事件"
|
|
285
|
-
has_actions=true
|
|
286
|
-
fi
|
|
287
|
-
|
|
288
|
-
if [ -z "$current_time" ]; then
|
|
289
|
-
echo "- [ ] 设置当前故事时间"
|
|
290
|
-
has_actions=true
|
|
291
|
-
fi
|
|
292
|
-
|
|
293
|
-
if [ $has_issues -gt 0 ]; then
|
|
294
|
-
echo "- [ ] 修复 $has_issues 个事件顺序问题"
|
|
295
|
-
has_actions=true
|
|
296
|
-
fi
|
|
297
|
-
|
|
298
|
-
if [ "$has_actions" = false ]; then
|
|
299
|
-
echo "*时间线记录完整,无需特别行动*"
|
|
300
|
-
fi
|
|
301
|
-
|
|
302
|
-
cat <<EOF
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
**检查工具**: check-timeline.sh
|
|
307
|
-
**版本**: 1.1 (支持 checklist 输出)
|
|
308
|
-
EOF
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
# 主函数
|
|
312
|
-
main() {
|
|
313
|
-
if [ "$CHECKLIST_MODE" = true ]; then
|
|
314
|
-
output_checklist
|
|
315
|
-
exit 0
|
|
316
|
-
fi
|
|
317
|
-
|
|
318
|
-
init_timeline
|
|
319
|
-
|
|
320
|
-
case "$COMMAND" in
|
|
321
|
-
show)
|
|
322
|
-
show_timeline
|
|
323
|
-
;;
|
|
324
|
-
add)
|
|
325
|
-
add_event "$@"
|
|
326
|
-
;;
|
|
327
|
-
check)
|
|
328
|
-
check_continuity
|
|
329
|
-
;;
|
|
330
|
-
sync)
|
|
331
|
-
sync_parallel "$@"
|
|
332
|
-
;;
|
|
333
|
-
*)
|
|
334
|
-
echo "用法: $0 [show|add|check|sync] [参数...]" >&2
|
|
335
|
-
echo "命令:" >&2
|
|
336
|
-
echo " show - 显示时间线" >&2
|
|
337
|
-
echo " add - 添加时间节点" >&2
|
|
338
|
-
echo " check - 检查连续性" >&2
|
|
339
|
-
echo " sync - 同步并行事件" >&2
|
|
340
|
-
exit 1
|
|
341
|
-
;;
|
|
342
|
-
esac
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
# 执行主函数
|
|
346
|
-
main "$@"
|