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,174 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# 角色关系管理(Bash)
|
|
3
|
-
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR=$(dirname "$0")
|
|
7
|
-
source "$SCRIPT_DIR/common.sh"
|
|
8
|
-
|
|
9
|
-
PROJECT_ROOT=$(get_project_root)
|
|
10
|
-
STORY_DIR=$(get_current_story)
|
|
11
|
-
|
|
12
|
-
REL_FILE=""
|
|
13
|
-
if [ -n "$STORY_DIR" ] && [ -f "$STORY_DIR/tracking/relationships.json" ]; then
|
|
14
|
-
REL_FILE="$STORY_DIR/tracking/relationships.json"
|
|
15
|
-
elif [ -f "$PROJECT_ROOT/tracking/relationships.json" ]; then
|
|
16
|
-
REL_FILE="$PROJECT_ROOT/tracking/relationships.json"
|
|
17
|
-
else
|
|
18
|
-
# 尝试用模板初始化
|
|
19
|
-
mkdir -p "$PROJECT_ROOT/tracking"
|
|
20
|
-
if [ -f "$PROJECT_ROOT/tracking/relationships.json" ]; then
|
|
21
|
-
cp "$PROJECT_ROOT/tracking/relationships.json" "$PROJECT_ROOT/tracking/relationships.json"
|
|
22
|
-
REL_FILE="$PROJECT_ROOT/tracking/relationships.json"
|
|
23
|
-
elif [ -f "$SCRIPT_DIR/../../templates/tracking/relationships.json" ]; then
|
|
24
|
-
cp "$SCRIPT_DIR/../../templates/tracking/relationships.json" "$PROJECT_ROOT/tracking/relationships.json"
|
|
25
|
-
REL_FILE="$PROJECT_ROOT/tracking/relationships.json"
|
|
26
|
-
else
|
|
27
|
-
echo "❌ 未找到 relationships.json,且无法从模板创建" >&2
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
CMD=${1:-show}
|
|
33
|
-
shift || true
|
|
34
|
-
|
|
35
|
-
print_header() {
|
|
36
|
-
echo "👥 角色关系管理"
|
|
37
|
-
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
cmd_show() {
|
|
41
|
-
print_header
|
|
42
|
-
if ! jq empty "$REL_FILE" >/dev/null 2>&1; then
|
|
43
|
-
echo "❌ relationships.json 格式无效" >&2; exit 1
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
echo "文件:$REL_FILE"
|
|
47
|
-
echo ""
|
|
48
|
-
# 输出主角或首个角色关系摘要
|
|
49
|
-
local main_char=$(jq -r '.characters | keys[0] // ""' "$REL_FILE")
|
|
50
|
-
if [ -z "$main_char" ] || [ "$main_char" = "null" ]; then
|
|
51
|
-
echo "无角色记录"
|
|
52
|
-
exit 0
|
|
53
|
-
fi
|
|
54
|
-
echo "主角:$main_char"
|
|
55
|
-
# 支持两种结构:嵌套 relationships 或直接分类键
|
|
56
|
-
jq -r --arg name "$main_char" '
|
|
57
|
-
.characters[$name] as $c |
|
|
58
|
-
($c.relationships // $c) as $r |
|
|
59
|
-
[
|
|
60
|
-
{k:"romantic", v:($r.romantic // [])},
|
|
61
|
-
{k:"allies", v:($r.allies // [])},
|
|
62
|
-
{k:"mentors", v:($r.mentors // [])},
|
|
63
|
-
{k:"enemies", v:($r.enemies // [])},
|
|
64
|
-
{k:"family", v:($r.family // [])},
|
|
65
|
-
{k:"neutral", v:($r.neutral // [])}
|
|
66
|
-
] | .[] | select((.v|length)>0) |
|
|
67
|
-
"├─ " + (if .k=="romantic" then "💕 爱慕" elseif .k=="allies" then "🤝 盟友" elseif .k=="mentors" then "📚 导师" elseif .k=="enemies" then "⚔️ 敌对" elseif .k=="family" then "👪 家人" else "・ 关系" end) + ":" + (.v | join("、"))
|
|
68
|
-
' "$REL_FILE"
|
|
69
|
-
|
|
70
|
-
# 最近变化
|
|
71
|
-
echo ""
|
|
72
|
-
if jq -e '.history' "$REL_FILE" >/dev/null 2>&1; then
|
|
73
|
-
local recent=$(jq -r '.history[-1] // empty' "$REL_FILE")
|
|
74
|
-
if [ -n "$recent" ]; then
|
|
75
|
-
echo "最近变化:"
|
|
76
|
-
jq -r '.history[-1].changes[]? | "- " + (.characters|join("↔")) + ":" + (.relation // .type // "变化")' "$REL_FILE"
|
|
77
|
-
fi
|
|
78
|
-
elif jq -e '.relationshipChanges' "$REL_FILE" >/dev/null 2>&1; then
|
|
79
|
-
echo "最近变化:"
|
|
80
|
-
jq -r '.relationshipChanges[-5:][]? | "- " + (.type // "变化") + ": " + (.characters|join("↔"))' "$REL_FILE" 2>/dev/null || true
|
|
81
|
-
fi
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
cmd_update() {
|
|
85
|
-
local a="$1"; local rel="$2"; local b="$3"; shift 3 || true
|
|
86
|
-
local chapter=""; local note=""
|
|
87
|
-
while [ $# -gt 0 ]; do
|
|
88
|
-
case "$1" in
|
|
89
|
-
--chapter) chapter="$2"; shift 2;;
|
|
90
|
-
--note) note="$2"; shift 2;;
|
|
91
|
-
*) shift;;
|
|
92
|
-
esac
|
|
93
|
-
done
|
|
94
|
-
if [ -z "$a" ] || [ -z "$rel" ] || [ -z "$b" ]; then
|
|
95
|
-
echo "用法: manage-relations.sh update <人物A> <allies|enemies|romantic|neutral|family|mentors> <人物B> [--chapter N] [--note 说明]" >&2
|
|
96
|
-
exit 1
|
|
97
|
-
fi
|
|
98
|
-
|
|
99
|
-
# 确保角色节点存在
|
|
100
|
-
for name in "$a" "$b"; do
|
|
101
|
-
if ! jq --arg n "$name" '(.characters[$n] // null) != null' "$REL_FILE" | grep -q true; then
|
|
102
|
-
tmp=$(mktemp)
|
|
103
|
-
jq --arg n "$name" '.characters[$n] = (.characters[$n] // {name:$n, relationships:{allies:[],enemies:[],romantic:[],family:[],mentors:[],neutral:[]}})' "$REL_FILE" > "$tmp"
|
|
104
|
-
mv "$tmp" "$REL_FILE"
|
|
105
|
-
fi
|
|
106
|
-
done
|
|
107
|
-
|
|
108
|
-
# 写入关系
|
|
109
|
-
tmp=$(mktemp)
|
|
110
|
-
jq --arg a "$a" --arg b "$b" --arg rel "$rel" '
|
|
111
|
-
.characters[$a].relationships[$rel] = ((.characters[$a].relationships[$rel] // []) + [$b] | unique) |
|
|
112
|
-
.lastUpdated = now | todate
|
|
113
|
-
' "$REL_FILE" > "$tmp"
|
|
114
|
-
mv "$tmp" "$REL_FILE"
|
|
115
|
-
|
|
116
|
-
# 记录历史(history 优先,否则 relationshipChanges)
|
|
117
|
-
local now=$(date -Iseconds)
|
|
118
|
-
if jq -e '.history' "$REL_FILE" >/dev/null 2>&1; then
|
|
119
|
-
tmp=$(mktemp)
|
|
120
|
-
jq --arg ch "${chapter:-null}" --arg a "$a" --arg b "$b" --arg rel "$rel" --arg note "$note" --arg t "$now" '
|
|
121
|
-
.history += [{
|
|
122
|
-
chapter: ( ($ch|tonumber) // null ),
|
|
123
|
-
date: $t,
|
|
124
|
-
changes: [{ type: "update", characters: [$a,$b], relation: $rel, note: ($note // "") }]
|
|
125
|
-
}]
|
|
126
|
-
' "$REL_FILE" > "$tmp" && mv "$tmp" "$REL_FILE"
|
|
127
|
-
else
|
|
128
|
-
tmp=$(mktemp)
|
|
129
|
-
jq --arg a "$a" --arg b "$b" --arg rel "$rel" '.relationshipChanges += [{type:"update", characters:[$a,$b], relation:$rel}]' "$REL_FILE" > "$tmp" && mv "$tmp" "$REL_FILE"
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
echo "✅ 已更新关系:$a [$rel] $b"
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
cmd_history() {
|
|
136
|
-
print_header
|
|
137
|
-
if jq -e '.history' "$REL_FILE" >/dev/null 2>&1; then
|
|
138
|
-
jq -r '.history[] | "第" + ((.chapter // 0|tostring)) + "章:" + (.changes | map((.characters|join("↔"))+"→"+(.relation // .type)) | join(";"))' "$REL_FILE"
|
|
139
|
-
elif jq -e '.relationshipChanges' "$REL_FILE" >/dev/null 2>&1; then
|
|
140
|
-
jq -r '.relationshipChanges[] | (.date // "") + " " + (.type // "") + ": " + (.characters|join("↔")) + "→" + (.relation // "")' "$REL_FILE"
|
|
141
|
-
else
|
|
142
|
-
echo "暂无历史记录"
|
|
143
|
-
fi
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
cmd_check() {
|
|
147
|
-
print_header
|
|
148
|
-
local issues=0
|
|
149
|
-
# 检查所有引用角色是否存在于 characters
|
|
150
|
-
missing=$(jq -r '
|
|
151
|
-
.characters as $c |
|
|
152
|
-
[
|
|
153
|
-
.characters | to_entries[] | .value.relationships // empty |
|
|
154
|
-
to_entries[] | .value[]
|
|
155
|
-
] | flatten | unique | map(select(has(.) | not))
|
|
156
|
-
' "$REL_FILE" 2>/dev/null || true)
|
|
157
|
-
if [ -n "$missing" ]; then
|
|
158
|
-
echo "⚠️ 发现未建档角色引用,建议补充:"
|
|
159
|
-
echo "$missing"
|
|
160
|
-
issues=1
|
|
161
|
-
fi
|
|
162
|
-
if [ "$issues" -eq 0 ]; then
|
|
163
|
-
echo "✅ 关系数据检查通过"
|
|
164
|
-
fi
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
case "$CMD" in
|
|
168
|
-
show) cmd_show ;;
|
|
169
|
-
update) cmd_update "$@" ;;
|
|
170
|
-
history) cmd_history ;;
|
|
171
|
-
check) cmd_check ;;
|
|
172
|
-
*) echo "用法: $0 [show|update|history|check]" >&2; exit 1;;
|
|
173
|
-
esac
|
|
174
|
-
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# migrate-tracking.sh
|
|
3
|
-
# 用法: migrate-tracking.sh [-m|--mode <auto|check|backup>] [-j|--json]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# 默认参数
|
|
8
|
-
MODE="check"
|
|
9
|
-
JSON_OUTPUT=false
|
|
10
|
-
|
|
11
|
-
# 解析参数
|
|
12
|
-
while [[ $# -gt 0 ]]; do
|
|
13
|
-
case $1 in
|
|
14
|
-
-m|--mode)
|
|
15
|
-
MODE="$2"
|
|
16
|
-
if [[ ! "$MODE" =~ ^(auto|check|backup)$ ]]; then
|
|
17
|
-
echo "错误: Mode 必须是 auto, check 或 backup" >&2
|
|
18
|
-
exit 1
|
|
19
|
-
fi
|
|
20
|
-
shift 2
|
|
21
|
-
;;
|
|
22
|
-
-j|--json)
|
|
23
|
-
JSON_OUTPUT=true
|
|
24
|
-
shift
|
|
25
|
-
;;
|
|
26
|
-
*)
|
|
27
|
-
echo "未知参数: $1" >&2
|
|
28
|
-
exit 1
|
|
29
|
-
;;
|
|
30
|
-
esac
|
|
31
|
-
done
|
|
32
|
-
|
|
33
|
-
# 目录路径
|
|
34
|
-
TRACKING_DIR="${PWD}/tracking"
|
|
35
|
-
BACKUP_DIR="${TRACKING_DIR}/backup"
|
|
36
|
-
SUMMARY_DIR="${TRACKING_DIR}/summary"
|
|
37
|
-
VOLUMES_DIR="${TRACKING_DIR}/volumes"
|
|
38
|
-
|
|
39
|
-
# 跟踪文件列表
|
|
40
|
-
TRACKING_FILES=(
|
|
41
|
-
"character-state.json"
|
|
42
|
-
"plot-tracker.json"
|
|
43
|
-
"timeline.json"
|
|
44
|
-
"relationships.json"
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# 获取跟踪状态
|
|
48
|
-
get_tracking_status() {
|
|
49
|
-
local mode="single-file"
|
|
50
|
-
local total_size=0
|
|
51
|
-
local needs_migration=false
|
|
52
|
-
local files_json="[]"
|
|
53
|
-
local volumes=0
|
|
54
|
-
|
|
55
|
-
# 检查是否为分片模式
|
|
56
|
-
if [[ -d "$VOLUMES_DIR" ]]; then
|
|
57
|
-
mode="sharded"
|
|
58
|
-
volumes=$(find "$VOLUMES_DIR" -maxdepth 1 -type d -name "vol-*" 2>/dev/null | wc -l)
|
|
59
|
-
|
|
60
|
-
if [[ "$JSON_OUTPUT" == true ]]; then
|
|
61
|
-
echo "{\"mode\":\"${mode}\",\"volumes\":${volumes}}"
|
|
62
|
-
else
|
|
63
|
-
echo "Tracking mode: ${mode}"
|
|
64
|
-
echo "Volumes: ${volumes}"
|
|
65
|
-
fi
|
|
66
|
-
return
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
# 单文件模式 - 检查文件大小
|
|
70
|
-
local file_list=""
|
|
71
|
-
for file in "${TRACKING_FILES[@]}"; do
|
|
72
|
-
local file_path="${TRACKING_DIR}/${file}"
|
|
73
|
-
if [[ -f "$file_path" ]]; then
|
|
74
|
-
local size=$(stat -f%z "$file_path" 2>/dev/null || stat -c%s "$file_path" 2>/dev/null || echo 0)
|
|
75
|
-
local size_kb=$(awk "BEGIN {printf \"%.1f\", $size / 1024}")
|
|
76
|
-
total_size=$((total_size + size))
|
|
77
|
-
|
|
78
|
-
if [[ -n "$file_list" ]]; then
|
|
79
|
-
file_list="${file_list},"
|
|
80
|
-
fi
|
|
81
|
-
file_list="${file_list}{\"name\":\"${file}\",\"size\":${size},\"sizeKB\":${size_kb}}"
|
|
82
|
-
fi
|
|
83
|
-
done
|
|
84
|
-
|
|
85
|
-
# 50KB 阈值
|
|
86
|
-
if [[ $total_size -gt $((50 * 1024)) ]]; then
|
|
87
|
-
needs_migration=true
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
if [[ "$JSON_OUTPUT" == true ]]; then
|
|
91
|
-
local total_kb=$(awk "BEGIN {printf \"%.1f\", $total_size / 1024}")
|
|
92
|
-
echo "{\"mode\":\"${mode}\",\"files\":[${file_list}],\"totalSize\":${total_size},\"totalKB\":${total_kb},\"needsMigration\":${needs_migration}}"
|
|
93
|
-
else
|
|
94
|
-
echo "Tracking mode: ${mode}"
|
|
95
|
-
echo "Total size: $(awk "BEGIN {printf \"%.1f\", $total_size / 1024}") KB"
|
|
96
|
-
echo "Needs migration: ${needs_migration}"
|
|
97
|
-
for file in "${TRACKING_FILES[@]}"; do
|
|
98
|
-
local file_path="${TRACKING_DIR}/${file}"
|
|
99
|
-
if [[ -f "$file_path" ]]; then
|
|
100
|
-
local size=$(stat -f%z "$file_path" 2>/dev/null || stat -c%s "$file_path" 2>/dev/null || echo 0)
|
|
101
|
-
local size_kb=$(awk "BEGIN {printf \"%.1f\", $size / 1024}")
|
|
102
|
-
echo " ${file}: ${size_kb} KB"
|
|
103
|
-
fi
|
|
104
|
-
done
|
|
105
|
-
fi
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
# 备份跟踪文件
|
|
109
|
-
backup_tracking_files() {
|
|
110
|
-
local timestamp=$(date +"%Y%m%d-%H%M%S")
|
|
111
|
-
local backup_path="${BACKUP_DIR}/${timestamp}"
|
|
112
|
-
|
|
113
|
-
if [[ ! -d "$backup_path" ]]; then
|
|
114
|
-
mkdir -p "$backup_path"
|
|
115
|
-
fi
|
|
116
|
-
|
|
117
|
-
for file in "${TRACKING_FILES[@]}"; do
|
|
118
|
-
local src="${TRACKING_DIR}/${file}"
|
|
119
|
-
if [[ -f "$src" ]]; then
|
|
120
|
-
cp "$src" "${backup_path}/${file}"
|
|
121
|
-
fi
|
|
122
|
-
done
|
|
123
|
-
|
|
124
|
-
# 也备份 story-facts.json
|
|
125
|
-
local facts_file="${TRACKING_DIR}/story-facts.json"
|
|
126
|
-
if [[ -f "$facts_file" ]]; then
|
|
127
|
-
cp "$facts_file" "${backup_path}/story-facts.json"
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
echo "$backup_path"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# 初始化分片结构
|
|
134
|
-
initialize_sharded_structure() {
|
|
135
|
-
if [[ ! -d "$SUMMARY_DIR" ]]; then
|
|
136
|
-
mkdir -p "$SUMMARY_DIR"
|
|
137
|
-
fi
|
|
138
|
-
if [[ ! -d "$VOLUMES_DIR" ]]; then
|
|
139
|
-
mkdir -p "$VOLUMES_DIR"
|
|
140
|
-
fi
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
# 主执行逻辑
|
|
144
|
-
case $MODE in
|
|
145
|
-
check)
|
|
146
|
-
get_tracking_status
|
|
147
|
-
;;
|
|
148
|
-
backup)
|
|
149
|
-
backup_path=$(backup_tracking_files)
|
|
150
|
-
if [[ "$JSON_OUTPUT" == true ]]; then
|
|
151
|
-
echo "{\"backupPath\":\"${backup_path}\"}"
|
|
152
|
-
else
|
|
153
|
-
echo "Backup created at: ${backup_path}"
|
|
154
|
-
fi
|
|
155
|
-
;;
|
|
156
|
-
auto)
|
|
157
|
-
# 检查是否已经是分片模式
|
|
158
|
-
if [[ -d "$VOLUMES_DIR" ]]; then
|
|
159
|
-
volumes=$(find "$VOLUMES_DIR" -maxdepth 1 -type d -name "vol-*" 2>/dev/null | wc -l)
|
|
160
|
-
if [[ "$JSON_OUTPUT" == true ]]; then
|
|
161
|
-
echo "{\"status\":\"already-sharded\",\"volumes\":${volumes}}"
|
|
162
|
-
else
|
|
163
|
-
echo "Already in sharded mode."
|
|
164
|
-
fi
|
|
165
|
-
exit 0
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
# 先备份
|
|
169
|
-
backup_path=$(backup_tracking_files)
|
|
170
|
-
|
|
171
|
-
# 创建目录结构
|
|
172
|
-
initialize_sharded_structure
|
|
173
|
-
|
|
174
|
-
if [[ "$JSON_OUTPUT" == true ]]; then
|
|
175
|
-
cat <<EOF
|
|
176
|
-
{"status":"ready","backupPath":"${backup_path}","summaryDir":"${SUMMARY_DIR}","volumesDir":"${VOLUMES_DIR}","message":"Directory structure created. AI should now split data by volume boundaries."}
|
|
177
|
-
EOF
|
|
178
|
-
else
|
|
179
|
-
echo "Backup: ${backup_path}"
|
|
180
|
-
echo "Structure created. AI should now split data by volume boundaries."
|
|
181
|
-
fi
|
|
182
|
-
;;
|
|
183
|
-
esac
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# 创作计划脚本
|
|
4
|
-
# 用于 /plan 命令
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Source common functions
|
|
9
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
-
source "$SCRIPT_DIR/common.sh"
|
|
11
|
-
|
|
12
|
-
# Parse arguments
|
|
13
|
-
STORY_NAME=""
|
|
14
|
-
if [ $# -gt 0 ]; then
|
|
15
|
-
STORY_NAME="$1"
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# Get project root
|
|
19
|
-
PROJECT_ROOT=$(get_project_root)
|
|
20
|
-
cd "$PROJECT_ROOT"
|
|
21
|
-
|
|
22
|
-
# 确定故事名称
|
|
23
|
-
if [ -z "$STORY_NAME" ]; then
|
|
24
|
-
STORY_NAME=$(get_active_story)
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
STORY_DIR="stories/$STORY_NAME"
|
|
28
|
-
SPEC_FILE="$STORY_DIR/specification.md"
|
|
29
|
-
CLARIFY_FILE="$STORY_DIR/clarification.md"
|
|
30
|
-
PLAN_FILE="$STORY_DIR/creative-plan.md"
|
|
31
|
-
|
|
32
|
-
echo "创作计划制定"
|
|
33
|
-
echo "============"
|
|
34
|
-
echo "故事:$STORY_NAME"
|
|
35
|
-
echo ""
|
|
36
|
-
|
|
37
|
-
# 检查前置文档
|
|
38
|
-
missing=()
|
|
39
|
-
|
|
40
|
-
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
41
|
-
missing+=("宪法文件")
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
if [ ! -f "$SPEC_FILE" ]; then
|
|
45
|
-
missing+=("规格文件")
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if [ ${#missing[@]} -gt 0 ]; then
|
|
49
|
-
echo "⚠️ 缺少以下前置文档:"
|
|
50
|
-
for doc in "${missing[@]}"; do
|
|
51
|
-
echo " - $doc"
|
|
52
|
-
done
|
|
53
|
-
echo ""
|
|
54
|
-
echo "请先完成:"
|
|
55
|
-
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
56
|
-
echo " 1. /constitution - 创建创作宪法"
|
|
57
|
-
fi
|
|
58
|
-
if [ ! -f "$SPEC_FILE" ]; then
|
|
59
|
-
echo " 2. /specify - 定义故事规格"
|
|
60
|
-
fi
|
|
61
|
-
exit 1
|
|
62
|
-
fi
|
|
63
|
-
|
|
64
|
-
# 检查是否有未澄清的点
|
|
65
|
-
if [ -f "$SPEC_FILE" ]; then
|
|
66
|
-
unclear_count=$(grep -o '\[需要澄清\]' "$SPEC_FILE" | wc -l | tr -d ' ')
|
|
67
|
-
|
|
68
|
-
if [ "$unclear_count" -gt 0 ]; then
|
|
69
|
-
echo "⚠️ 规格中有 $unclear_count 处需要澄清"
|
|
70
|
-
echo "建议先运行 /clarify 澄清关键决策"
|
|
71
|
-
echo ""
|
|
72
|
-
fi
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
# 检查澄清记录
|
|
76
|
-
if [ -f "$CLARIFY_FILE" ]; then
|
|
77
|
-
echo "✅ 已完成澄清,将基于澄清决策制定计划"
|
|
78
|
-
else
|
|
79
|
-
echo "📝 未找到澄清记录,将基于原始规格制定计划"
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
# 检查计划文件
|
|
83
|
-
if [ -f "$PLAN_FILE" ]; then
|
|
84
|
-
echo ""
|
|
85
|
-
echo "📋 计划文件已存在,将更新现有计划"
|
|
86
|
-
|
|
87
|
-
# 显示当前版本
|
|
88
|
-
if grep -q "版本:" "$PLAN_FILE"; then
|
|
89
|
-
version=$(grep "版本:" "$PLAN_FILE" | head -1 | sed 's/.*版本://')
|
|
90
|
-
echo " 当前版本:$version"
|
|
91
|
-
fi
|
|
92
|
-
else
|
|
93
|
-
echo ""
|
|
94
|
-
echo "📝 将创建新的创作计划"
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
echo ""
|
|
98
|
-
echo "计划文件路径:$PLAN_FILE"
|
|
99
|
-
echo ""
|
|
100
|
-
echo "准备就绪,可以制定创作计划"
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# 故事规格定义脚本
|
|
4
|
-
# 用于 /specify 命令
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Source common functions
|
|
9
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
-
source "$SCRIPT_DIR/common.sh"
|
|
11
|
-
|
|
12
|
-
# Parse arguments
|
|
13
|
-
JSON_MODE=false
|
|
14
|
-
|
|
15
|
-
while [[ $# -gt 0 ]]; do
|
|
16
|
-
case $1 in
|
|
17
|
-
--json)
|
|
18
|
-
JSON_MODE=true
|
|
19
|
-
shift
|
|
20
|
-
;;
|
|
21
|
-
*)
|
|
22
|
-
STORY_NAME="$1"
|
|
23
|
-
shift
|
|
24
|
-
;;
|
|
25
|
-
esac
|
|
26
|
-
done
|
|
27
|
-
|
|
28
|
-
# Get project root
|
|
29
|
-
PROJECT_ROOT=$(get_project_root)
|
|
30
|
-
cd "$PROJECT_ROOT"
|
|
31
|
-
|
|
32
|
-
# 确定故事名称和路径
|
|
33
|
-
if [ -z "$STORY_NAME" ]; then
|
|
34
|
-
# 查找最新的故事
|
|
35
|
-
STORIES_DIR="stories"
|
|
36
|
-
if [ -d "$STORIES_DIR" ] && [ "$(ls -A $STORIES_DIR 2>/dev/null)" ]; then
|
|
37
|
-
STORY_DIR=$(find "$STORIES_DIR" -maxdepth 1 -type d ! -name "stories" | sort -r | head -n 1)
|
|
38
|
-
if [ -n "$STORY_DIR" ]; then
|
|
39
|
-
STORY_NAME=$(basename "$STORY_DIR")
|
|
40
|
-
fi
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# 如果还是没有,生成默认名称
|
|
44
|
-
if [ -z "$STORY_NAME" ]; then
|
|
45
|
-
STORY_NAME="story-$(date +%Y%m%d)"
|
|
46
|
-
fi
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# 设置路径
|
|
50
|
-
STORY_DIR="stories/$STORY_NAME"
|
|
51
|
-
SPEC_FILE="$STORY_DIR/specification.md"
|
|
52
|
-
|
|
53
|
-
# 创建目录
|
|
54
|
-
mkdir -p "$STORY_DIR"
|
|
55
|
-
|
|
56
|
-
# 检查文件状态
|
|
57
|
-
SPEC_EXISTS=false
|
|
58
|
-
STATUS="new"
|
|
59
|
-
|
|
60
|
-
if [ -f "$SPEC_FILE" ]; then
|
|
61
|
-
SPEC_EXISTS=true
|
|
62
|
-
STATUS="exists"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# 输出 JSON 格式
|
|
66
|
-
if [ "$JSON_MODE" = true ]; then
|
|
67
|
-
cat <<EOF
|
|
68
|
-
{
|
|
69
|
-
"STORY_NAME": "$STORY_NAME",
|
|
70
|
-
"STORY_DIR": "$STORY_DIR",
|
|
71
|
-
"SPEC_PATH": "$SPEC_FILE",
|
|
72
|
-
"STATUS": "$STATUS",
|
|
73
|
-
"PROJECT_ROOT": "$PROJECT_ROOT"
|
|
74
|
-
}
|
|
75
|
-
EOF
|
|
76
|
-
else
|
|
77
|
-
echo "故事规格初始化"
|
|
78
|
-
echo "================"
|
|
79
|
-
echo "故事名称:$STORY_NAME"
|
|
80
|
-
echo "规格路径:$SPEC_FILE"
|
|
81
|
-
|
|
82
|
-
if [ "$SPEC_EXISTS" = true ]; then
|
|
83
|
-
echo "状态:规格文件已存在,准备更新"
|
|
84
|
-
else
|
|
85
|
-
echo "状态:准备创建新规格"
|
|
86
|
-
fi
|
|
87
|
-
|
|
88
|
-
# 检查宪法
|
|
89
|
-
if [ -f "resources/memory/constitution.md" ]; then
|
|
90
|
-
echo ""
|
|
91
|
-
echo "✅ 检测到创作宪法,规格将遵循宪法原则"
|
|
92
|
-
fi
|
|
93
|
-
fi
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# 任务分解脚本
|
|
4
|
-
# 用于 /tasks 命令
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Source common functions
|
|
9
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
-
source "$SCRIPT_DIR/common.sh"
|
|
11
|
-
|
|
12
|
-
# Parse arguments
|
|
13
|
-
STORY_NAME=""
|
|
14
|
-
if [ $# -gt 0 ]; then
|
|
15
|
-
STORY_NAME="$1"
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# Get project root
|
|
19
|
-
PROJECT_ROOT=$(get_project_root)
|
|
20
|
-
cd "$PROJECT_ROOT"
|
|
21
|
-
|
|
22
|
-
# 确定故事名称
|
|
23
|
-
if [ -z "$STORY_NAME" ]; then
|
|
24
|
-
STORY_NAME=$(get_active_story)
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
STORY_DIR="stories/$STORY_NAME"
|
|
28
|
-
SPEC_FILE="$STORY_DIR/specification.md"
|
|
29
|
-
PLAN_FILE="$STORY_DIR/creative-plan.md"
|
|
30
|
-
TASKS_FILE="$STORY_DIR/tasks.md"
|
|
31
|
-
|
|
32
|
-
echo "任务分解"
|
|
33
|
-
echo "========"
|
|
34
|
-
echo "故事:$STORY_NAME"
|
|
35
|
-
echo ""
|
|
36
|
-
|
|
37
|
-
# 检查前置文档
|
|
38
|
-
missing=()
|
|
39
|
-
|
|
40
|
-
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
41
|
-
missing+=("宪法文件")
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
if [ ! -f "$SPEC_FILE" ]; then
|
|
45
|
-
missing+=("规格文件")
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if [ ! -f "$PLAN_FILE" ]; then
|
|
49
|
-
missing+=("计划文件")
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
if [ ${#missing[@]} -gt 0 ]; then
|
|
53
|
-
echo "⚠️ 缺少以下前置文档:"
|
|
54
|
-
for doc in "${missing[@]}"; do
|
|
55
|
-
echo " - $doc"
|
|
56
|
-
done
|
|
57
|
-
echo ""
|
|
58
|
-
echo "请先完成:"
|
|
59
|
-
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
60
|
-
echo " 1. /constitution - 创建创作宪法"
|
|
61
|
-
fi
|
|
62
|
-
if [ ! -f "$SPEC_FILE" ]; then
|
|
63
|
-
echo " 2. /specify - 定义故事规格"
|
|
64
|
-
fi
|
|
65
|
-
if [ ! -f "$PLAN_FILE" ]; then
|
|
66
|
-
echo " 3. /plan - 制定创作计划"
|
|
67
|
-
fi
|
|
68
|
-
exit 1
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
# 检查任务文件
|
|
72
|
-
if [ -f "$TASKS_FILE" ]; then
|
|
73
|
-
echo ""
|
|
74
|
-
echo "📋 任务文件已存在,将更新现有任务"
|
|
75
|
-
|
|
76
|
-
# 显示任务统计
|
|
77
|
-
total_tasks=$(grep -c "^- \[" "$TASKS_FILE" 2>/dev/null || echo "0")
|
|
78
|
-
completed_tasks=$(grep -c "^- \[x\]" "$TASKS_FILE" 2>/dev/null || echo "0")
|
|
79
|
-
echo " 总任务数:$total_tasks"
|
|
80
|
-
echo " 已完成:$completed_tasks"
|
|
81
|
-
else
|
|
82
|
-
echo ""
|
|
83
|
-
echo "📝 将创建新的任务清单"
|
|
84
|
-
fi
|
|
85
|
-
|
|
86
|
-
echo ""
|
|
87
|
-
echo "任务文件路径:$TASKS_FILE"
|
|
88
|
-
echo ""
|
|
89
|
-
echo "准备就绪,可以分解任务"
|
|
90
|
-
echo ""
|
|
91
|
-
echo "任务分解将包括:"
|
|
92
|
-
echo " - 章节写作任务(基于计划)"
|
|
93
|
-
echo " - 角色档案完善"
|
|
94
|
-
echo " - 世界观文档补充"
|
|
95
|
-
echo " - 质量检查节点"
|
|
96
|
-
echo " - 验证和修订任务"
|