novelws 3.0.0 → 4.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 +131 -0
- package/README.md +94 -66
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +35 -33
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +63 -6
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/core/config.d.ts +22 -15
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -16
- package/dist/core/config.js.map +1 -1
- package/dist/core/errors.d.ts +16 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +26 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/utils/diagnostics.d.ts +64 -0
- package/dist/utils/diagnostics.d.ts.map +1 -0
- package/dist/utils/diagnostics.js +227 -0
- package/dist/utils/diagnostics.js.map +1 -0
- package/package.json +1 -1
- package/templates/commands/analyze.md +27 -110
- package/templates/commands/character.md +32 -180
- package/templates/commands/checklist.md +27 -27
- package/templates/commands/clarify.md +2 -2
- package/templates/commands/constitution.md +8 -8
- package/templates/commands/expert.md +3 -3
- package/templates/commands/facts.md +9 -9
- package/templates/commands/guide.md +129 -19
- package/templates/commands/help-me.md +221 -0
- package/templates/commands/plan.md +27 -26
- package/templates/commands/recap.md +16 -16
- package/templates/commands/relations.md +13 -13
- package/templates/commands/revise.md +16 -15
- package/templates/commands/search.md +11 -10
- package/templates/commands/specify.md +4 -4
- package/templates/commands/tasks.md +9 -9
- package/templates/commands/timeline.md +13 -13
- package/templates/commands/track-init.md +8 -8
- package/templates/commands/track.md +177 -552
- package/templates/commands/volume-summary.md +6 -6
- package/templates/commands/write.md +148 -38
- package/templates/dot-claude/CLAUDE.md +5 -5
- package/templates/{config → resources/config}/keyword-mappings.json +19 -19
- package/templates/resources/genres/horror.md +211 -0
- package/templates/resources/genres/military.md +209 -0
- package/templates/resources/genres/sports.md +216 -0
- package/templates/resources/genres/workplace.md +214 -0
- package/templates/resources/genres/youth.md +219 -0
- package/templates/{knowledge-base/requirements/anti-ai-v4.md → resources/requirements/anti-ai-v4-deprecated.md} +13 -1
- package/templates/resources/requirements/anti-ai-v5-balanced.md +203 -0
- package/templates/{scripts → resources/scripts}/README.md +8 -8
- package/templates/{scripts → resources/scripts}/bash/analyze-story.sh +1 -1
- package/templates/resources/scripts/bash/check-analyze-stage.sh +108 -0
- package/templates/{scripts → resources/scripts}/bash/check-consistency.sh +7 -7
- package/templates/{scripts → resources/scripts}/bash/check-facts.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/check-plot.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/check-timeline.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/check-world.sh +5 -5
- package/templates/{scripts → resources/scripts}/bash/check-writing-state.sh +26 -26
- package/templates/{scripts → resources/scripts}/bash/common.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/constitution.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/init-tracking.sh +13 -13
- package/templates/{scripts → resources/scripts}/bash/manage-relations.sh +10 -10
- package/templates/resources/scripts/bash/migrate-tracking.sh +183 -0
- package/templates/{scripts → resources/scripts}/bash/plan-story.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/specify-story.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tasks-story.sh +2 -2
- package/templates/{scripts → resources/scripts}/bash/tests/bench-preload-cache.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/tests/test-cross-platform.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tests/test-preload-cache.sh +1 -1
- package/templates/{scripts → resources/scripts}/bash/tests/test-regex-precompile.sh +4 -4
- package/templates/{scripts → resources/scripts}/bash/text-audit.sh +3 -3
- package/templates/{scripts → resources/scripts}/bash/track-progress.sh +5 -5
- package/templates/{scripts → resources/scripts}/powershell/analyze-story.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/check-consistency.ps1 +8 -8
- package/templates/{scripts → resources/scripts}/powershell/check-plot.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/check-timeline.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/check-writing-state.ps1 +31 -31
- package/templates/{scripts → resources/scripts}/powershell/common.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/constitution.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/init-tracking.ps1 +5 -5
- package/templates/{scripts → resources/scripts}/powershell/manage-relations.ps1 +6 -6
- package/templates/{scripts → resources/scripts}/powershell/migrate-tracking.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/plan-story.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/specify-story.ps1 +1 -1
- package/templates/{scripts → resources/scripts}/powershell/tests/bench-ps-cache.ps1 +10 -10
- package/templates/{scripts → resources/scripts}/powershell/tests/test-ps-cache.ps1 +4 -4
- package/templates/{scripts → resources/scripts}/powershell/text-audit.ps1 +2 -2
- package/templates/{scripts → resources/scripts}/powershell/track-progress.ps1 +2 -2
- package/templates/skills/analysis/character-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/foreshadow-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/hook-analysis/SKILL.md +2 -2
- package/templates/skills/analysis/logic-analysis/SKILL.md +2 -2
- package/templates/skills/analysis/opening-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/pacing-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/power-analysis/SKILL.md +3 -3
- package/templates/skills/analysis/reader-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/style-analysis/SKILL.md +1 -1
- package/templates/skills/analysis/voice-analysis/SKILL.md +1 -1
- package/templates/skills/auto-tracking/SKILL.md +1 -1
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +1 -1
- package/templates/skills/quality-assurance/facts-checker/SKILL.md +2 -2
- package/templates/skills/quality-assurance/hook-checker/SKILL.md +2 -2
- package/templates/skills/quality-assurance/long-series-continuity/SKILL.md +7 -7
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +22 -22
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +15 -15
- package/templates/skills/quality-assurance/voice-consistency-checker/SKILL.md +1 -1
- package/templates/skills/writing-techniques/character-arc/SKILL.md +1 -1
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +1 -1
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +1 -1
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +1 -1
- package/templates/skills/writing-techniques/style-learning/SKILL.md +2 -2
- package/templates/skills/writing-techniques/writing-balance/.gitkeep +0 -0
- package/templates/skills/writing-techniques/writing-balance/SKILL.md +460 -0
- package/templates/skills/writing-techniques/writing-techniques/SKILL.md +727 -0
- package/templates/knowledge-base/README.md +0 -285
- package/templates/scripts/powershell/check-writing-state.ps1.backup +0 -135
- /package/templates/{knowledge-base → resources}/character-archetypes/01-hero.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/02-mentor.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/03-shadow.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/04-ally.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/05-shapeshifter.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/06-trickster.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/07-threshold-guardian.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/08-herald.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/09-father.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/10-mother.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/11-child.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/12-sage.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/README.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/application-guide.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/archetype-combinations.md +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/config.yaml +0 -0
- /package/templates/{knowledge-base → resources}/character-archetypes/examples-analysis.md +0 -0
- /package/templates/{specification-example.md → resources/config/specification-example.md} +0 -0
- /package/templates/{knowledge-base → resources}/craft/character-arc.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/dialogue.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/hook-design.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/pacing.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/power-system.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/scene-structure.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/show-not-tell.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/story-structures.md +0 -0
- /package/templates/{knowledge-base → resources}/craft/tension-management.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/01-first-meeting.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/02-bonding-moment.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/03-declaration.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/04-triumph.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/05-reunion.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/06-forgiveness.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/07-betrayal.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/08-loss.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/09-rejection.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/10-failure.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/11-misunderstanding.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/12-farewell.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/13-revelation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/14-point-of-no-return.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/15-dark-night.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/16-sacrifice.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/17-awakening.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/18-confrontation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/19-bittersweet-goodbye.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/20-moral-dilemma.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/21-temptation.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/22-redemption.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/README.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/beat-sequences.md +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/config.yaml +0 -0
- /package/templates/{knowledge-base → resources}/emotional-beats/pacing-guide.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/game-lit.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/historical.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/mystery.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/rebirth.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/revenge.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/romance.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/sci-fi.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/thriller.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/urban.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/wuxia.md +0 -0
- /package/templates/{knowledge-base → resources}/genres/xuanhuan.md +0 -0
- /package/templates/{memory → resources/memory}/constitution.md +0 -0
- /package/templates/{memory → resources/memory}/personal-voice.md +0 -0
- /package/templates/{knowledge-base → resources}/references/README.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/culture.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/society.md +0 -0
- /package/templates/{knowledge-base → resources}/references/china-1920s/warlords.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/power-system.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/sects.md +0 -0
- /package/templates/{knowledge-base → resources}/references/cultivation-world/world-setting.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/corporate.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/relationships.md +0 -0
- /package/templates/{knowledge-base → resources}/references/modern-workplace/tech-industry.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/culture.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/daily-life.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/overview.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/politics.md +0 -0
- /package/templates/{knowledge-base → resources}/references/tang-dynasty/society.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/README.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/anti-ai-v3.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/concretization.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/fast-paced.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/no-poison.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/romance-angst.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/romance-sweet.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/serious-literature.md +0 -0
- /package/templates/{knowledge-base → resources}/requirements/strong-emotion.md +0 -0
- /package/templates/{scripts → resources/scripts}/bash/clarify-story.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/generate-tasks.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/test-word-count.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/run-all-benchmarks.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-cache-semantics.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-edge-cases-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-phase1-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-regression-bash.sh +0 -0
- /package/templates/{scripts → resources/scripts}/bash/tests/test-task6-verification.sh +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/check-analyze-stage.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/check-facts.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/clarify-story.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/generate-tasks.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-cross-platform.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-edge-cases-ps.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-phase1-ps.ps1 +0 -0
- /package/templates/{scripts → resources/scripts}/powershell/tests/test-regression-ps.ps1 +0 -0
- /package/templates/{knowledge-base → resources}/styles/README.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/ancient-style.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/literary.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/minimal.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/natural-voice.md +0 -0
- /package/templates/{knowledge-base → resources}/styles/web-novel.md +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
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
|
|
@@ -37,7 +37,7 @@ echo ""
|
|
|
37
37
|
# 检查前置文档
|
|
38
38
|
missing=()
|
|
39
39
|
|
|
40
|
-
if [ ! -f "
|
|
40
|
+
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
41
41
|
missing+=("宪法文件")
|
|
42
42
|
fi
|
|
43
43
|
|
|
@@ -52,7 +52,7 @@ if [ ${#missing[@]} -gt 0 ]; then
|
|
|
52
52
|
done
|
|
53
53
|
echo ""
|
|
54
54
|
echo "请先完成:"
|
|
55
|
-
if [ ! -f "
|
|
55
|
+
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
56
56
|
echo " 1. /constitution - 创建创作宪法"
|
|
57
57
|
fi
|
|
58
58
|
if [ ! -f "$SPEC_FILE" ]; then
|
|
@@ -37,7 +37,7 @@ echo ""
|
|
|
37
37
|
# 检查前置文档
|
|
38
38
|
missing=()
|
|
39
39
|
|
|
40
|
-
if [ ! -f "
|
|
40
|
+
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
41
41
|
missing+=("宪法文件")
|
|
42
42
|
fi
|
|
43
43
|
|
|
@@ -56,7 +56,7 @@ if [ ${#missing[@]} -gt 0 ]; then
|
|
|
56
56
|
done
|
|
57
57
|
echo ""
|
|
58
58
|
echo "请先完成:"
|
|
59
|
-
if [ ! -f "
|
|
59
|
+
if [ ! -f "resources/memory/constitution.md" ]; then
|
|
60
60
|
echo " 1. /constitution - 创建创作宪法"
|
|
61
61
|
fi
|
|
62
62
|
if [ ! -f "$SPEC_FILE" ]; then
|
|
@@ -7,11 +7,11 @@ echo ""
|
|
|
7
7
|
|
|
8
8
|
# 测试文件列表
|
|
9
9
|
files=(
|
|
10
|
-
"
|
|
10
|
+
"resources/config/keyword-mappings.json"
|
|
11
11
|
"templates/scripts/bash/check-writing-state.sh"
|
|
12
12
|
"templates/scripts/bash/common.sh"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"resources/craft/dialogue.md"
|
|
14
|
+
"resources/craft/scene-structure.md"
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
echo "测试文件数: ${#files[@]}"
|
|
@@ -7,7 +7,7 @@ echo ""
|
|
|
7
7
|
|
|
8
8
|
# 测试 1.1: 验证 JSON 结构
|
|
9
9
|
echo "测试 1.1: 验证 JSON 结构"
|
|
10
|
-
version=$(jq -r '.version'
|
|
10
|
+
version=$(jq -r '.version' resources/config/keyword-mappings.json)
|
|
11
11
|
if [[ "$version" == "1.1.0" ]]; then
|
|
12
12
|
echo "✅ 版本号正确: $version"
|
|
13
13
|
else
|
|
@@ -35,8 +35,8 @@ for mapping in "${mappings[@]}"; do
|
|
|
35
35
|
category=$(echo "$mapping" | cut -d. -f1)
|
|
36
36
|
name=$(echo "$mapping" | cut -d. -f2)
|
|
37
37
|
|
|
38
|
-
regex=$(jq -r ".mappings[\"$category\"][\"$name\"].regex"
|
|
39
|
-
regex_flags=$(jq -r ".mappings[\"$category\"][\"$name\"].regex_flags"
|
|
38
|
+
regex=$(jq -r ".mappings[\"$category\"][\"$name\"].regex" resources/config/keyword-mappings.json)
|
|
39
|
+
regex_flags=$(jq -r ".mappings[\"$category\"][\"$name\"].regex_flags" resources/config/keyword-mappings.json)
|
|
40
40
|
|
|
41
41
|
if [[ -n "$regex" && "$regex" != "null" ]]; then
|
|
42
42
|
echo "✅ $mapping: regex='$regex', flags='$regex_flags'"
|
|
@@ -71,7 +71,7 @@ for test_case in "${!test_cases[@]}"; do
|
|
|
71
71
|
category=$(echo "$mapping" | cut -d. -f1)
|
|
72
72
|
name=$(echo "$mapping" | cut -d. -f2)
|
|
73
73
|
|
|
74
|
-
regex=$(jq -r ".mappings[\"$category\"][\"$name\"].regex"
|
|
74
|
+
regex=$(jq -r ".mappings[\"$category\"][\"$name\"].regex" resources/config/keyword-mappings.json)
|
|
75
75
|
|
|
76
76
|
if echo "$keyword" | grep -iE "$regex" > /dev/null; then
|
|
77
77
|
echo "✅ $mapping + '$keyword' → 匹配成功"
|
|
@@ -14,9 +14,9 @@ if [ -z "$FILE_PATH" ] || [ ! -f "$FILE_PATH" ]; then
|
|
|
14
14
|
exit 1
|
|
15
15
|
fi
|
|
16
16
|
|
|
17
|
-
# 选择配置:优先项目
|
|
18
|
-
CFG_PROJECT="$PROJECT_ROOT/
|
|
19
|
-
CFG_TEMPLATE="$PROJECT_ROOT
|
|
17
|
+
# 选择配置:优先项目 resources/knowledge,其次 resources
|
|
18
|
+
CFG_PROJECT="$PROJECT_ROOT/resources/knowledge/audit-config.json"
|
|
19
|
+
CFG_TEMPLATE="$PROJECT_ROOT/resources/knowledge/audit-config.json"
|
|
20
20
|
if [ -f "$CFG_PROJECT" ]; then
|
|
21
21
|
CFG="$CFG_PROJECT"
|
|
22
22
|
elif [ -f "$CFG_TEMPLATE" ]; then
|
|
@@ -38,7 +38,7 @@ check_files() {
|
|
|
38
38
|
has_files=true
|
|
39
39
|
fi
|
|
40
40
|
|
|
41
|
-
if [[ -f "
|
|
41
|
+
if [[ -f "tracking/plot-tracker.json" ]]; then
|
|
42
42
|
has_files=true
|
|
43
43
|
fi
|
|
44
44
|
|
|
@@ -61,7 +61,7 @@ show_basic_report() {
|
|
|
61
61
|
fi
|
|
62
62
|
|
|
63
63
|
# 读取情节追踪
|
|
64
|
-
if [[ -f "
|
|
64
|
+
if [[ -f "tracking/plot-tracker.json" ]]; then
|
|
65
65
|
echo -e "${BLUE}📍 情节状态${NC}"
|
|
66
66
|
echo " 主线进度等待分析..."
|
|
67
67
|
fi
|
|
@@ -85,7 +85,7 @@ run_deep_check() {
|
|
|
85
85
|
echo -e "${BLUE}Phase 2: 角色深度验证${NC}"
|
|
86
86
|
|
|
87
87
|
# 检查验证规则文件
|
|
88
|
-
if [[ -f "
|
|
88
|
+
if [[ -f "tracking/validation-rules.json" ]]; then
|
|
89
89
|
echo " ✅ 加载验证规则"
|
|
90
90
|
echo " 扫描章节中的角色名称..."
|
|
91
91
|
echo " 对比character-state.json..."
|
|
@@ -117,7 +117,7 @@ EOF
|
|
|
117
117
|
echo -e "${GREEN} ✅ 验证任务已生成${NC}"
|
|
118
118
|
else
|
|
119
119
|
echo -e "${YELLOW} ⚠️ 未找到验证规则文件${NC}"
|
|
120
|
-
echo " 建议创建
|
|
120
|
+
echo " 建议创建 tracking/validation-rules.json"
|
|
121
121
|
fi
|
|
122
122
|
|
|
123
123
|
# Phase 3: 生成报告
|
|
@@ -135,7 +135,7 @@ run_auto_fix() {
|
|
|
135
135
|
echo -e "${GREEN}🔧 执行自动修复...${NC}"
|
|
136
136
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
137
137
|
|
|
138
|
-
if [[ ! -f "
|
|
138
|
+
if [[ ! -f "tracking/validation-rules.json" ]]; then
|
|
139
139
|
echo -e "${RED}❌ 需要先运行 --check 生成验证报告${NC}"
|
|
140
140
|
exit 1
|
|
141
141
|
fi
|
|
@@ -28,7 +28,7 @@ function Test-StoryFiles {
|
|
|
28
28
|
$missingFiles = @()
|
|
29
29
|
|
|
30
30
|
# 检查基准文档
|
|
31
|
-
if (-not (Test-Path "
|
|
31
|
+
if (-not (Test-Path "resources\memory\constitution.md")) {
|
|
32
32
|
$missingFiles += "宪法文件"
|
|
33
33
|
}
|
|
34
34
|
if (-not (Test-Path "$StoryDir\specification.md")) {
|
|
@@ -11,14 +11,14 @@ $storyDir = Get-CurrentStoryDir
|
|
|
11
11
|
if (-not $storyDir) { throw "未找到故事项目(stories/*)" }
|
|
12
12
|
|
|
13
13
|
$progress = Join-Path $storyDir "progress.json"
|
|
14
|
-
$plot = Join-Path $storyDir "
|
|
15
|
-
if (-not (Test-Path $plot)) { $plot = Join-Path $root "
|
|
16
|
-
$timeline = Join-Path $storyDir "
|
|
17
|
-
if (-not (Test-Path $timeline)) { $timeline = Join-Path $root "
|
|
18
|
-
$rels = Join-Path $storyDir "
|
|
19
|
-
if (-not (Test-Path $rels)) { $rels = Join-Path $root "
|
|
20
|
-
$charState = Join-Path $storyDir "
|
|
21
|
-
if (-not (Test-Path $charState)) { $charState = Join-Path $root "
|
|
14
|
+
$plot = Join-Path $storyDir "tracking/plot-tracker.json"
|
|
15
|
+
if (-not (Test-Path $plot)) { $plot = Join-Path $root "tracking/plot-tracker.json" }
|
|
16
|
+
$timeline = Join-Path $storyDir "tracking/timeline.json"
|
|
17
|
+
if (-not (Test-Path $timeline)) { $timeline = Join-Path $root "tracking/timeline.json" }
|
|
18
|
+
$rels = Join-Path $storyDir "tracking/relationships.json"
|
|
19
|
+
if (-not (Test-Path $rels)) { $rels = Join-Path $root "tracking/relationships.json" }
|
|
20
|
+
$charState = Join-Path $storyDir "tracking/character-state.json"
|
|
21
|
+
if (-not (Test-Path $charState)) { $charState = Join-Path $root "tracking/character-state.json" }
|
|
22
22
|
|
|
23
23
|
$TOTAL=0; $PASS=0; $WARN=0; $ERR=0
|
|
24
24
|
function Check([string]$name, [bool]$ok, [string]$msg) {
|
|
@@ -10,8 +10,8 @@ $root = Get-ProjectRoot
|
|
|
10
10
|
$storyDir = Get-CurrentStoryDir
|
|
11
11
|
if (-not $storyDir) { throw "未找到故事项目(stories/*)" }
|
|
12
12
|
|
|
13
|
-
$plotPath = Join-Path $storyDir "
|
|
14
|
-
if (-not (Test-Path $plotPath)) { $plotPath = Join-Path $root "
|
|
13
|
+
$plotPath = Join-Path $storyDir "tracking/plot-tracker.json"
|
|
14
|
+
if (-not (Test-Path $plotPath)) { $plotPath = Join-Path $root "tracking/plot-tracker.json" }
|
|
15
15
|
$outlinePath = Join-Path $storyDir "creative-plan.md"
|
|
16
16
|
$progressPath = Join-Path $storyDir "progress.json"
|
|
17
17
|
|
|
@@ -17,8 +17,8 @@ $root = Get-ProjectRoot
|
|
|
17
17
|
$storyDir = Get-CurrentStoryDir
|
|
18
18
|
if (-not $storyDir) { throw "未找到故事项目(stories/*)" }
|
|
19
19
|
|
|
20
|
-
$timelinePath = Join-Path $storyDir "
|
|
21
|
-
if (-not (Test-Path $timelinePath)) { $timelinePath = Join-Path $root "
|
|
20
|
+
$timelinePath = Join-Path $storyDir "tracking/timeline.json"
|
|
21
|
+
if (-not (Test-Path $timelinePath)) { $timelinePath = Join-Path $root "tracking/timeline.json" }
|
|
22
22
|
|
|
23
23
|
function Init-Timeline {
|
|
24
24
|
if (-not (Test-Path $timelinePath)) {
|
|
@@ -50,7 +50,7 @@ function Mark-ResourceLoaded {
|
|
|
50
50
|
# 防御性设计:缓存目录不存在时直接返回
|
|
51
51
|
|
|
52
52
|
function Cleanup-OldCache {
|
|
53
|
-
$cacheDir = Join-Path $ProjectRoot ".
|
|
53
|
+
$cacheDir = Join-Path $ProjectRoot ".claude" ".cache"
|
|
54
54
|
|
|
55
55
|
# 缓存目录不存在,无需清理
|
|
56
56
|
if (-not (Test-Path $cacheDir)) {
|
|
@@ -145,17 +145,17 @@ $StoryDir = Join-Path "stories" $StoryName
|
|
|
145
145
|
if (-not $script:PreloadCompleted) {
|
|
146
146
|
$preloadFileList = @(
|
|
147
147
|
# 知识库文件
|
|
148
|
-
(Join-Path $ProjectRoot "
|
|
149
|
-
(Join-Path $ProjectRoot "
|
|
150
|
-
(Join-Path $ProjectRoot "
|
|
151
|
-
(Join-Path $ProjectRoot "
|
|
152
|
-
(Join-Path $ProjectRoot "
|
|
148
|
+
(Join-Path $ProjectRoot "resources/craft/dialogue.md")
|
|
149
|
+
(Join-Path $ProjectRoot "resources/craft/scene-structure.md")
|
|
150
|
+
(Join-Path $ProjectRoot "resources/craft/character-arc.md")
|
|
151
|
+
(Join-Path $ProjectRoot "resources/craft/pacing.md")
|
|
152
|
+
(Join-Path $ProjectRoot "resources/craft/show-not-tell.md")
|
|
153
153
|
# Skill 文件
|
|
154
|
-
(Join-Path $ProjectRoot ".
|
|
155
|
-
(Join-Path $ProjectRoot ".
|
|
156
|
-
(Join-Path $ProjectRoot ".
|
|
157
|
-
(Join-Path $ProjectRoot ".
|
|
158
|
-
(Join-Path $ProjectRoot ".
|
|
154
|
+
(Join-Path $ProjectRoot ".claude/skills/writing-techniques/dialogue-techniques/SKILL.md")
|
|
155
|
+
(Join-Path $ProjectRoot ".claude/skills/writing-techniques/scene-structure/SKILL.md")
|
|
156
|
+
(Join-Path $ProjectRoot ".claude/skills/writing-techniques/character-arc/SKILL.md")
|
|
157
|
+
(Join-Path $ProjectRoot ".claude/skills/writing-techniques/pacing-control/SKILL.md")
|
|
158
|
+
(Join-Path $ProjectRoot ".claude/skills/quality-assurance/consistency-checker/SKILL.md")
|
|
159
159
|
# 规格文件
|
|
160
160
|
(Join-Path $StoryDir "specification.md")
|
|
161
161
|
)
|
|
@@ -182,19 +182,19 @@ function Generate-LoadReport {
|
|
|
182
182
|
|
|
183
183
|
# 默认加载所有资源
|
|
184
184
|
$knowledgeBaseFiles = @(
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
185
|
+
"resources/craft/dialogue.md",
|
|
186
|
+
"resources/craft/scene-structure.md",
|
|
187
|
+
"resources/craft/character-arc.md",
|
|
188
|
+
"resources/craft/pacing.md",
|
|
189
|
+
"resources/craft/show-not-tell.md"
|
|
190
190
|
)
|
|
191
191
|
|
|
192
192
|
$skillsFiles = @(
|
|
193
|
-
".
|
|
194
|
-
".
|
|
195
|
-
".
|
|
196
|
-
".
|
|
197
|
-
".
|
|
193
|
+
".claude/skills/writing-techniques/dialogue-techniques",
|
|
194
|
+
".claude/skills/writing-techniques/scene-structure",
|
|
195
|
+
".claude/skills/writing-techniques/character-arc",
|
|
196
|
+
".claude/skills/writing-techniques/pacing-control",
|
|
197
|
+
".claude/skills/quality-assurance/consistency-checker"
|
|
198
198
|
)
|
|
199
199
|
|
|
200
200
|
$disabledResources = @()
|
|
@@ -301,7 +301,7 @@ Write-Host ""
|
|
|
301
301
|
function Test-MethodologyDocs {
|
|
302
302
|
$missing = @()
|
|
303
303
|
|
|
304
|
-
if (-not (Test-Path "
|
|
304
|
+
if (-not (Test-Path "resources\memory\constitution.md")) {
|
|
305
305
|
$missing += "宪法"
|
|
306
306
|
}
|
|
307
307
|
if (-not (Test-Path "$StoryDir\specification.md")) {
|
|
@@ -410,11 +410,11 @@ function Check-KnowledgeBaseAvailable {
|
|
|
410
410
|
$available = @()
|
|
411
411
|
|
|
412
412
|
$craftFiles = @(
|
|
413
|
-
"
|
|
414
|
-
"
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"
|
|
413
|
+
"resources/craft/dialogue.md",
|
|
414
|
+
"resources/craft/scene-structure.md",
|
|
415
|
+
"resources/craft/character-arc.md",
|
|
416
|
+
"resources/craft/pacing.md",
|
|
417
|
+
"resources/craft/show-not-tell.md"
|
|
418
418
|
)
|
|
419
419
|
|
|
420
420
|
foreach ($file in $craftFiles) {
|
|
@@ -445,10 +445,10 @@ function Check-SkillsAvailable {
|
|
|
445
445
|
$available = @()
|
|
446
446
|
|
|
447
447
|
$skillDirs = @(
|
|
448
|
-
".
|
|
449
|
-
".
|
|
450
|
-
".
|
|
451
|
-
".
|
|
448
|
+
".claude/skills/writing-techniques/dialogue-techniques",
|
|
449
|
+
".claude/skills/writing-techniques/scene-structure",
|
|
450
|
+
".claude/skills/writing-techniques/character-arc",
|
|
451
|
+
".claude/skills/writing-techniques/pacing-control"
|
|
452
452
|
)
|
|
453
453
|
|
|
454
454
|
foreach ($dir in $skillDirs) {
|
|
@@ -7,13 +7,13 @@ $ErrorActionPreference = 'Stop'
|
|
|
7
7
|
function Get-ProjectRoot {
|
|
8
8
|
$current = (Get-Location).Path
|
|
9
9
|
while ($true) {
|
|
10
|
-
$cfg = Join-Path $current "
|
|
10
|
+
$cfg = Join-Path $current "resources/config/config.json"
|
|
11
11
|
if (Test-Path $cfg) { return $current }
|
|
12
12
|
$parent = Split-Path $current -Parent
|
|
13
13
|
if (-not $parent -or $parent -eq $current) { break }
|
|
14
14
|
$current = $parent
|
|
15
15
|
}
|
|
16
|
-
throw "未找到项目根目录(缺少
|
|
16
|
+
throw "未找到项目根目录(缺少 resources/config/config.json)"
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function Get-CurrentStoryDir {
|
|
@@ -13,7 +13,7 @@ $storyDir = Get-CurrentStoryDir
|
|
|
13
13
|
if (-not $storyDir) { throw "请先完成 /specify 和 /plan,未找到 stories/*/ 目录" }
|
|
14
14
|
|
|
15
15
|
$storyName = Split-Path $storyDir -Leaf
|
|
16
|
-
$specTrack = Join-Path $root "
|
|
16
|
+
$specTrack = Join-Path $root "tracking"
|
|
17
17
|
New-Item -ItemType Directory -Path $specTrack -Force | Out-Null
|
|
18
18
|
|
|
19
19
|
Write-Host "📖 为《$storyName》初始化追踪系统..."
|
|
@@ -86,10 +86,10 @@ Write-Host ""
|
|
|
86
86
|
Write-Host "✅ 追踪系统初始化完成!"
|
|
87
87
|
Write-Host ""
|
|
88
88
|
Write-Host "📊 已创建以下追踪文件:"
|
|
89
|
-
Write-Host " •
|
|
90
|
-
Write-Host " •
|
|
91
|
-
Write-Host " •
|
|
92
|
-
Write-Host " •
|
|
89
|
+
Write-Host " • tracking/plot-tracker.json - 情节追踪"
|
|
90
|
+
Write-Host " • tracking/timeline.json - 时间线管理"
|
|
91
|
+
Write-Host " • tracking/relationships.json - 关系网络"
|
|
92
|
+
Write-Host " • tracking/character-state.json - 角色状态"
|
|
93
93
|
Write-Host ""
|
|
94
94
|
Write-Host "💡 下一步:"
|
|
95
95
|
Write-Host " 1. 使用 /write 开始创作(会自动更新追踪数据)"
|
|
@@ -20,14 +20,14 @@ $ErrorActionPreference = 'Stop'
|
|
|
20
20
|
$root = Get-ProjectRoot
|
|
21
21
|
$storyDir = Get-CurrentStoryDir
|
|
22
22
|
$relPath = $null
|
|
23
|
-
if ($storyDir -and (Test-Path (Join-Path $storyDir '
|
|
24
|
-
$relPath = Join-Path $storyDir '
|
|
25
|
-
} elseif (Test-Path (Join-Path $root '
|
|
26
|
-
$relPath = Join-Path $root '
|
|
23
|
+
if ($storyDir -and (Test-Path (Join-Path $storyDir 'tracking/relationships.json'))) {
|
|
24
|
+
$relPath = Join-Path $storyDir 'tracking/relationships.json'
|
|
25
|
+
} elseif (Test-Path (Join-Path $root 'tracking/relationships.json')) {
|
|
26
|
+
$relPath = Join-Path $root 'tracking/relationships.json'
|
|
27
27
|
} else {
|
|
28
|
-
$tpl1 = Join-Path $root '
|
|
28
|
+
$tpl1 = Join-Path $root 'tracking/relationships.json'
|
|
29
29
|
$tpl2 = Join-Path $root 'templates/tracking/relationships.json'
|
|
30
|
-
$dest = Join-Path $root '
|
|
30
|
+
$dest = Join-Path $root 'tracking/relationships.json'
|
|
31
31
|
New-Item -ItemType Directory -Path (Split-Path $dest -Parent) -Force | Out-Null
|
|
32
32
|
if (Test-Path $tpl1) { Copy-Item $tpl1 $dest -Force; $relPath = $dest }
|
|
33
33
|
elseif (Test-Path $tpl2) { Copy-Item $tpl2 $dest -Force; $relPath = $dest }
|
|
@@ -7,7 +7,7 @@ param(
|
|
|
7
7
|
[switch]$Json
|
|
8
8
|
)
|
|
9
9
|
|
|
10
|
-
$trackingDir = Join-Path
|
|
10
|
+
$trackingDir = Join-Path $PWD 'tracking'
|
|
11
11
|
$backupDir = Join-Path $trackingDir 'backup'
|
|
12
12
|
$summaryDir = Join-Path $trackingDir 'summary'
|
|
13
13
|
$volumesDir = Join-Path $trackingDir 'volumes'
|
|
@@ -33,7 +33,7 @@ Write-Host ""
|
|
|
33
33
|
# 检查前置文档
|
|
34
34
|
$missing = @()
|
|
35
35
|
|
|
36
|
-
if (-not (Test-Path "
|
|
36
|
+
if (-not (Test-Path "resources\memory\constitution.md")) {
|
|
37
37
|
$missing += "宪法文件"
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -48,7 +48,7 @@ if ($missing.Count -gt 0) {
|
|
|
48
48
|
}
|
|
49
49
|
Write-Host ""
|
|
50
50
|
Write-Host "请先完成:"
|
|
51
|
-
if (-not (Test-Path "
|
|
51
|
+
if (-not (Test-Path "resources\memory\constitution.md")) {
|
|
52
52
|
Write-Host " 1. /constitution - 创建创作宪法"
|
|
53
53
|
}
|
|
54
54
|
if (-not (Test-Path $SpecFile)) {
|