sillyspec 3.17.10 → 3.17.12

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 +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.17.10",
3
+ "version": "3.17.12",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/run.js CHANGED
@@ -632,11 +632,12 @@ async function outputStep(stageName, stepIndex, steps, cwd, changeName, dbProjec
632
632
 
633
633
  // 注入模块上下文(brainstorm/plan/execute 阶段,基于 Module Context Index)
634
634
  if (['brainstorm', 'plan', 'execute'].includes(stageName) && projectName) {
635
- const moduleIndex = loadModuleContextIndex(specBase || join(cwd, '.sillyspec'), projectName)
635
+ const effectiveSpecBase = platformOpts?.specRoot || join(cwd, '.sillyspec')
636
+ const moduleIndex = loadModuleContextIndex(effectiveSpecBase, projectName)
636
637
  if (moduleIndex && Object.keys(moduleIndex).length > 0) {
637
638
  // 尝试从 step prompt / changeName 匹配模块
638
639
  const taskDesc = step.prompt || changeName || ''
639
- const injection = buildModuleContextInjection(taskDesc, moduleIndex, specBase || join(cwd, '.sillyspec'), projectName)
640
+ const injection = buildModuleContextInjection(taskDesc, moduleIndex, effectiveSpecBase, projectName)
640
641
  if (injection) {
641
642
  promptText = injection + '\n' + promptText
642
643
  }
@@ -1126,7 +1127,7 @@ export async function runCommand(args, cwd, specDir = null) {
1126
1127
 
1127
1128
  // --reset
1128
1129
  if (isReset) {
1129
- return await resetStage(pm, progress, stageName, cwd, effectiveChange)
1130
+ return await resetStage(pm, progress, stageName, cwd, effectiveChange, platformOpts)
1130
1131
  }
1131
1132
 
1132
1133
  // 确保步骤已初始化
@@ -2261,7 +2262,7 @@ function showStatus(progress, stageName) {
2261
2262
  })
2262
2263
  }
2263
2264
 
2264
- async function resetStage(pm, progress, stageName, cwd, changeName) {
2265
+ async function resetStage(pm, progress, stageName, cwd, changeName, platformOpts = {}) {
2265
2266
  const defSteps = await getStageSteps(stageName, cwd, progress)
2266
2267
  progress.stages[stageName] = {
2267
2268
  status: 'in-progress',