taskplane 0.21.7 → 0.21.8
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.
|
@@ -431,8 +431,16 @@ export function buildLaneEnvVars(
|
|
|
431
431
|
|
|
432
432
|
let relativePath: string;
|
|
433
433
|
if (workspaceRoot) {
|
|
434
|
-
// Workspace mode:
|
|
435
|
-
|
|
434
|
+
// Workspace mode: use worktree-relative path when the task folder is
|
|
435
|
+
// inside the lane's repo. This ensures STATUS.md, .DONE, and git commits
|
|
436
|
+
// all operate in the worktree (not the original source directory).
|
|
437
|
+
// Falls back to absolute path for cross-repo tasks (task in repo A,
|
|
438
|
+
// worker in repo B — future: issue #51).
|
|
439
|
+
if (promptNorm.startsWith(repoRootNorm + "/")) {
|
|
440
|
+
relativePath = promptNorm.slice(repoRootNorm.length + 1);
|
|
441
|
+
} else {
|
|
442
|
+
relativePath = resolve(promptPath);
|
|
443
|
+
}
|
|
436
444
|
} else if (promptNorm.startsWith(repoRootNorm + "/")) {
|
|
437
445
|
// Repo mode: relative path from repo root (mirrors into worktree)
|
|
438
446
|
relativePath = promptNorm.slice(repoRootNorm.length + 1);
|
|
@@ -764,28 +772,16 @@ export function resolveCanonicalTaskPaths(
|
|
|
764
772
|
let resolvedFolder: string;
|
|
765
773
|
|
|
766
774
|
if (isWorkspaceMode) {
|
|
767
|
-
// Workspace mode:
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
const candidatePaths: string[] = [];
|
|
772
|
-
|
|
773
|
-
// Candidate 1: worktree-relative (task folder mirrored in worktree)
|
|
775
|
+
// Workspace mode: use worktree-relative path when the task folder is
|
|
776
|
+
// inside the lane's repo (same logic as TASK_AUTOSTART resolution).
|
|
777
|
+
// The worker writes .DONE and STATUS.md in the worktree, so the engine
|
|
778
|
+
// must look there too.
|
|
774
779
|
if (folderNorm.startsWith(repoRootNorm + "/")) {
|
|
775
780
|
const relPath = folderNorm.slice(repoRootNorm.length + 1);
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
candidatePaths.push(resolve(taskFolder));
|
|
781
|
-
|
|
782
|
-
// Use whichever has .DONE or STATUS.md; default to first candidate
|
|
783
|
-
resolvedFolder = candidatePaths[0];
|
|
784
|
-
for (const candidate of candidatePaths) {
|
|
785
|
-
if (existsSync(join(candidate, ".DONE")) || existsSync(join(candidate, "STATUS.md"))) {
|
|
786
|
-
resolvedFolder = candidate;
|
|
787
|
-
break;
|
|
788
|
-
}
|
|
781
|
+
resolvedFolder = join(worktreePath, relPath);
|
|
782
|
+
} else {
|
|
783
|
+
// Cross-repo fallback: use absolute path (future: #51)
|
|
784
|
+
resolvedFolder = resolve(taskFolder);
|
|
789
785
|
}
|
|
790
786
|
} else if (folderNorm.startsWith(repoRootNorm + "/")) {
|
|
791
787
|
// Repo mode: task folder is inside the repo root.
|