sillyspec 3.24.4 → 3.24.5

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 +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.24.4",
3
+ "version": "3.24.5",
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,26 @@ async function getStageSteps(stageName, cwd, progress, specDir = null) {
632
632
  if (stageName === 'execute') {
633
633
  const changeDir = resolveChangeDir(cwd, progress, specDir)
634
634
  let planFile = null
635
+ let worktreePath = null
635
636
  if (changeDir) {
636
637
  const p = join(changeDir, 'plan.md')
637
638
  if (existsSync(p)) planFile = p
639
+ // 自动检测 worktree 路径,注入 Wave prompt 的 workdir 指令
640
+ // 修复:之前未传 worktreePath 给 buildExecuteSteps,导致 Wave prompt 缺失工作目录指令,
641
+ // 子代理可能把文件写到主工作区而非 worktree 内,破坏隔离。
642
+ try {
643
+ const changeName = basename(changeDir)
644
+ const { WorktreeManager } = await import('./worktree.js')
645
+ const wm = new WorktreeManager({ cwd })
646
+ const meta = wm.getMeta(changeName)
647
+ if (meta?.worktreePath && existsSync(meta.worktreePath)) {
648
+ worktreePath = meta.worktreePath
649
+ }
650
+ } catch {
651
+ // 无 worktree meta 不阻断——可能是首次启动或 in-place 模式
652
+ }
638
653
  }
639
- return buildExecuteSteps(planFile)
654
+ return buildExecuteSteps(planFile, { worktreePath })
640
655
  }
641
656
  if (stageName === 'plan') {
642
657
  const changeDir = resolveChangeDir(cwd, progress, specDir)