sillyspec 3.7.26 → 3.7.27

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 +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.7.26",
3
+ "version": "3.7.27",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/run.js CHANGED
@@ -211,13 +211,21 @@ async function runStage(pm, progress, stageName, cwd) {
211
211
  let currentIdx = steps.findIndex(s => s.status !== 'completed' && s.status !== 'skipped')
212
212
 
213
213
  if (currentIdx === -1) {
214
- // 阶段已完成,自动重置,允许重复执行
214
+ // 阶段已完成
215
+ console.log(`✅ ${stageName} 阶段已完成。`)
216
+ console.log(` 继续执行将重新开始,可用 --reset 显式重置。\n`)
217
+ // 自动重置,允许重复执行
215
218
  steps.forEach(s => { s.status = 'pending'; s.completedAt = null; s.output = null; s.startedAt = null })
216
219
  stageData.status = 'in_progress'
217
220
  stageData.completedAt = null
218
- console.log(`🔄 ${stageName} 阶段已完成,重新开始...\n`)
219
221
  pm._write(cwd, progress)
220
222
  currentIdx = 0
223
+ } else if (currentIdx > 0) {
224
+ // 有进行中的步骤,提示用户
225
+ const completed = currentIdx
226
+ const total = steps.length
227
+ console.log(`⚠️ ${stageName} 已进行到第 ${currentIdx + 1}/${total} 步(前 ${completed} 步已完成)。`)
228
+ console.log(` 继续执行将从中断处恢复,用 --reset 可重新开始。\n`)
221
229
  }
222
230
 
223
231
  const stageDef = stageRegistry[stageName]
@@ -284,7 +292,7 @@ async function completeStep(pm, progress, stageName, cwd, outputText) {
284
292
  // Save full output to artifacts/
285
293
  const artifactsDir = join(cwd, '.sillyspec', '.runtime', 'artifacts')
286
294
  mkdirSync(artifactsDir, { recursive: true })
287
- const ts = new Date().toLocaleString('zh-CN',{hour12:false}).replace(/[:.]/g, '-')
295
+ const ts = new Date().toISOString().slice(0,19).replace(/[-T:]/g, '')
288
296
  writeFileSync(join(artifactsDir, `${stageName}-step${currentIdx + 1}-${ts}.txt`), outputText)
289
297
  } else {
290
298
  steps[currentIdx].output = outputText