taskplane 0.5.2 → 0.5.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.
|
@@ -155,20 +155,30 @@ export function buildLaneEnvVars(
|
|
|
155
155
|
repoRoot: string,
|
|
156
156
|
workspaceRoot?: string,
|
|
157
157
|
): Record<string, string> {
|
|
158
|
-
// TASK_AUTOSTART
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
158
|
+
// TASK_AUTOSTART: resolve the prompt path for the lane session.
|
|
159
|
+
//
|
|
160
|
+
// In workspace mode, tasks may live in a different repo than the lane's
|
|
161
|
+
// worktree (e.g., task PROMPT.md in shared-libs, worker runs in api-service).
|
|
162
|
+
// Always use the absolute path — task-runner's resolve(cwd, autoPath) handles
|
|
163
|
+
// absolute paths correctly, and this avoids broken relative paths when the
|
|
164
|
+
// task folder is outside the lane's repo.
|
|
165
|
+
//
|
|
166
|
+
// In repo mode (no workspace), we still use relative paths from repoRoot
|
|
167
|
+
// because the worktree mirrors the repo structure and the task folder is
|
|
168
|
+
// inside the repo.
|
|
162
169
|
const repoRootNorm = resolve(repoRoot).replace(/\\/g, "/");
|
|
163
170
|
const promptNorm = resolve(promptPath).replace(/\\/g, "/");
|
|
164
171
|
|
|
165
172
|
let relativePath: string;
|
|
166
|
-
if (
|
|
173
|
+
if (workspaceRoot) {
|
|
174
|
+
// Workspace mode: always use absolute path for cross-repo safety
|
|
175
|
+
relativePath = resolve(promptPath);
|
|
176
|
+
} else if (promptNorm.startsWith(repoRootNorm + "/")) {
|
|
177
|
+
// Repo mode: relative path from repo root (mirrors into worktree)
|
|
167
178
|
relativePath = promptNorm.slice(repoRootNorm.length + 1);
|
|
168
179
|
} else {
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
relativePath = promptPath;
|
|
180
|
+
// Fallback: absolute path
|
|
181
|
+
relativePath = resolve(promptPath);
|
|
172
182
|
}
|
|
173
183
|
|
|
174
184
|
const nodePathEntries: string[] = [join(repoRoot, "node_modules")];
|