sillyspec 3.10.2 → 3.10.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/run.js +14 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/run.js CHANGED
@@ -280,10 +280,20 @@ async function runStage(pm, progress, stageName, cwd) {
280
280
  let currentIdx = steps.findIndex(s => s.status !== 'completed' && s.status !== 'skipped')
281
281
 
282
282
  if (currentIdx === -1) {
283
- console.log(`✅ ${stageName} 阶段已完成。`)
284
- console.log(` 如需重新开始,请显式执行 --reset。\n`)
285
- return
286
- } else if (currentIdx > 0) {
283
+ // 已完成 → 自动重置,重新开始
284
+ const freshSteps = await getStageSteps(stageName, cwd, progress)
285
+ stageData.steps = freshSteps
286
+ ? freshSteps.map(s => ({ name: s.name, status: 'pending' }))
287
+ : []
288
+ stageData.status = 'in-progress'
289
+ stageData.startedAt = new Date().toLocaleString('zh-CN', { hour12: false })
290
+ stageData.completedAt = null
291
+ pm._write(cwd, progress)
292
+ currentIdx = 0
293
+ console.log(`🔄 ${stageName} 阶段已自动重置,重新开始。\n`)
294
+ }
295
+
296
+ if (currentIdx > 0) {
287
297
  // 有进行中的步骤,提示用户
288
298
  const completed = currentIdx
289
299
  const total = steps.length