sillyspec 3.10.4 → 3.10.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.10.4",
3
+ "version": "3.10.6",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/index.js CHANGED
@@ -136,9 +136,13 @@ async function main() {
136
136
  break;
137
137
  case 'progress': {
138
138
  const pm = new ProgressManager();
139
+ pm._migrateIfNeeded(dir);
139
140
  const subCommand = filteredArgs[1];
140
141
  const stageIdx = filteredArgs.indexOf('--stage');
141
142
  const stage = stageIdx >= 0 && filteredArgs[stageIdx + 1] ? filteredArgs[stageIdx + 1] : null;
143
+ // 解析 --change 参数
144
+ const progChangeIdx = args.indexOf('--change');
145
+ const progChangeName = progChangeIdx >= 0 && args[progChangeIdx + 1] ? args[progChangeIdx + 1] : null;
142
146
 
143
147
  switch (subCommand) {
144
148
  case 'init':
@@ -146,49 +150,48 @@ async function main() {
146
150
  break;
147
151
  case 'status':
148
152
  case 'show':
149
- pm.show(dir);
153
+ pm.show(dir, progChangeName);
150
154
  break;
151
155
  case 'validate':
152
- await pm.validate(dir);
156
+ await pm.validate(dir, progChangeName);
153
157
  break;
154
158
  case 'reset':
155
- pm.reset(dir, stage);
159
+ pm.reset(dir, stage, progChangeName);
156
160
  break;
157
161
  case 'set-stage': {
158
162
  const setStageName = filteredArgs[2];
159
- if (!setStageName) { console.log('❌ 用法: sillyspec progress set-stage <stage>'); break; }
160
- pm.setStage(dir, setStageName);
163
+ if (!setStageName) { console.log('❌ 用法: sillyspec progress set-stage <stage> [--change <name>]'); break; }
164
+ pm.setStage(dir, setStageName, progChangeName);
161
165
  break;
162
166
  }
163
167
  case 'add-step': {
164
168
  const addStepStage = filteredArgs[2];
165
169
  const addStepName = filteredArgs[3];
166
- if (!addStepStage || !addStepName) { console.log('❌ 用法: sillyspec progress add-step <stage> <step-name>'); break; }
167
- pm.addStep(dir, addStepStage, addStepName);
170
+ if (!addStepStage || !addStepName) { console.log('❌ 用法: sillyspec progress add-step <stage> <step-name> [--change <name>]'); break; }
171
+ pm.addStep(dir, addStepStage, addStepName, progChangeName);
168
172
  break;
169
173
  }
170
174
  case 'update-step': {
171
175
  const updStepStage = filteredArgs[2];
172
176
  const updStepName = filteredArgs[3];
173
- if (!updStepStage || !updStepName) { console.log('❌ 用法: sillyspec progress update-step <stage> <step-name> --status <status> [--output <text>]'); break; }
174
- // Parse --status and --output from args
177
+ if (!updStepStage || !updStepName) { console.log('❌ 用法: sillyspec progress update-step <stage> <step-name> --status <status> [--output <text>] [--change <name>]'); break; }
175
178
  let updStatus = null, updOutput = undefined;
176
179
  for (let ai = 0; ai < args.length; ai++) {
177
180
  if (args[ai] === '--status' && args[ai + 1]) { updStatus = args[ai + 1]; ai++; }
178
181
  if (args[ai] === '--output' && args[ai + 1]) { updOutput = args[ai + 1]; ai++; }
179
182
  }
180
- pm.updateStep(dir, updStepStage, updStepName, { status: updStatus, output: updOutput });
183
+ pm.updateStep(dir, updStepStage, updStepName, { status: updStatus, output: updOutput }, progChangeName);
181
184
  break;
182
185
  }
183
186
  case 'complete-stage': {
184
187
  const compStageName = filteredArgs[2];
185
188
  if (!compStageName) { console.log('❌ 用法: sillyspec progress complete-stage <stage>'); break; }
186
- pm.completeStage(dir, compStageName);
189
+ pm.completeStage(dir, compStageName, progChangeName);
187
190
  break;
188
191
  }
189
192
  case 'batch': {
190
193
  if (filteredArgs.includes('--status')) {
191
- const bp = pm.readBatchProgress(dir);
194
+ const bp = pm.readBatchProgress(dir, progChangeName);
192
195
  if (!bp) { console.log('📭 无批量进度数据'); break; }
193
196
  const line = pm._renderBatchProgress(bp);
194
197
  console.log(line || '📭 无批量进度数据');
@@ -207,7 +210,7 @@ async function main() {
207
210
  console.log(' sillyspec progress batch --status');
208
211
  break;
209
212
  }
210
- pm.updateBatchProgress(dir, batchData);
213
+ pm.updateBatchProgress(dir, batchData, progChangeName);
211
214
  console.log('✅ 批量进度已更新');
212
215
  }
213
216
  break;
package/src/init.js CHANGED
@@ -56,7 +56,7 @@ const INJECTION_CONTENT = `## SillySpec — 规范驱动开发
56
56
  - 遵循 \`.sillyspec/docs/<project>/scan/CONVENTIONS.md\` 中的代码风格
57
57
 
58
58
  ### 工作流程
59
- - 读取 \`.sillyspec/.runtime/progress.json\` 确认当前阶段(使用 \`sillyspec progress show\`)
59
+ - 读取当前变更的 progress.json 确认当前阶段(使用 \`sillyspec progress show\`)
60
60
  - 各阶段产出文件位于 \`.sillyspec/changes/<变更名>/\` 下
61
61
  `;
62
62
 
@@ -141,18 +141,15 @@ async function doInstall(projectDir, tools, subprojects = []) {
141
141
  writeFileSync(uncatPath, `# 未分类知识\n\n> execute/quick 执行中发现的坑暂存于此,用户审阅后归类到对应文件并更新 INDEX.md。\n`);
142
142
  }
143
143
 
144
- // 创建 .sillyspec/.runtime/ 目录结构
144
+ // 创建 .sillyspec/.runtime/ 目录结构(全局状态)
145
145
  const runtimeDir = join(projectDir, '.sillyspec', '.runtime');
146
146
  for (const sub of ['artifacts', 'history', 'logs', 'templates']) {
147
147
  mkdirSync(join(runtimeDir, sub), { recursive: true });
148
148
  }
149
149
 
150
- // 创建初始 progress.json
151
- const progressPath = join(runtimeDir, 'progress.json');
152
- if (!existsSync(progressPath)) {
153
- const pm = new ProgressManager();
154
- pm.init(projectDir);
155
- }
150
+ // 创建全局状态文件
151
+ const pm = new ProgressManager();
152
+ pm.init(projectDir);
156
153
 
157
154
  // 创建初始 user-inputs.md
158
155
  const inputsPath = join(runtimeDir, 'user-inputs.md');