taskplane 0.21.8 → 0.21.10
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.
|
@@ -243,8 +243,12 @@ export function parsePromptForOrchestrator(
|
|
|
243
243
|
const scopeBody = fileScopeMatch[1].trim();
|
|
244
244
|
const scopeLines = scopeBody.split("\n");
|
|
245
245
|
for (const line of scopeLines) {
|
|
246
|
-
// "- extensions/task-orchestrator.ts" or "-
|
|
247
|
-
|
|
246
|
+
// "- extensions/task-orchestrator.ts" or "- `api-service/src/health.js`"
|
|
247
|
+
let trimmed = line.replace(/^[\s-*]+/, "").trim();
|
|
248
|
+
// Strip inline backticks: `path/to/file` → path/to/file
|
|
249
|
+
if (trimmed.startsWith("`") && trimmed.endsWith("`")) {
|
|
250
|
+
trimmed = trimmed.slice(1, -1);
|
|
251
|
+
}
|
|
248
252
|
if (trimmed && !trimmed.startsWith("#") && !trimmed.startsWith("```")) {
|
|
249
253
|
fileScope.push(trimmed);
|
|
250
254
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Lane execution, monitoring, wave execution loop
|
|
3
3
|
* @module orch/execution
|
|
4
4
|
*/
|
|
5
|
-
import { readFileSync, existsSync, statSync, unlinkSync, mkdirSync, writeFileSync } from "fs";
|
|
5
|
+
import { readFileSync, existsSync, statSync, unlinkSync, mkdirSync, writeFileSync, copyFileSync } from "fs";
|
|
6
6
|
import { access as fsAccess, readFile as fsReadFile, stat as fsStat } from "fs/promises";
|
|
7
7
|
import { spawnSync, spawn } from "child_process";
|
|
8
|
-
import { join, dirname, resolve, relative, delimiter as pathDelimiter } from "path";
|
|
8
|
+
import { join, dirname, basename, resolve, relative, delimiter as pathDelimiter } from "path";
|
|
9
9
|
import { userInfo } from "os";
|
|
10
10
|
|
|
11
11
|
import { DONE_GRACE_MS, EXECUTION_POLL_INTERVAL_MS, ExecutionError, SESSION_SPAWN_RETRY_MAX } from "./types.ts";
|
|
@@ -434,12 +434,30 @@ export function buildLaneEnvVars(
|
|
|
434
434
|
// Workspace mode: use worktree-relative path when the task folder is
|
|
435
435
|
// inside the lane's repo. This ensures STATUS.md, .DONE, and git commits
|
|
436
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
437
|
if (promptNorm.startsWith(repoRootNorm + "/")) {
|
|
440
438
|
relativePath = promptNorm.slice(repoRootNorm.length + 1);
|
|
441
439
|
} else {
|
|
442
|
-
|
|
440
|
+
// Cross-repo: task files live in a different repo than the worker's
|
|
441
|
+
// worktree. Copy the task folder into the worktree so STATUS.md,
|
|
442
|
+
// .DONE, and git commits all happen locally.
|
|
443
|
+
const taskFolder = dirname(resolve(promptPath));
|
|
444
|
+
const taskDirName = basename(taskFolder);
|
|
445
|
+
const localTaskDir = join(lane.worktreePath, ".taskplane-tasks", taskDirName);
|
|
446
|
+
mkdirSync(localTaskDir, { recursive: true });
|
|
447
|
+
// Copy PROMPT.md and STATUS.md into the local task dir
|
|
448
|
+
for (const file of ["PROMPT.md", "STATUS.md"]) {
|
|
449
|
+
const src = join(taskFolder, file);
|
|
450
|
+
const dst = join(localTaskDir, file);
|
|
451
|
+
if (existsSync(src) && !existsSync(dst)) {
|
|
452
|
+
copyFileSync(src, dst);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
// Create .reviews dir if it exists in source
|
|
456
|
+
const reviewsDir = join(taskFolder, ".reviews");
|
|
457
|
+
if (existsSync(reviewsDir)) {
|
|
458
|
+
mkdirSync(join(localTaskDir, ".reviews"), { recursive: true });
|
|
459
|
+
}
|
|
460
|
+
relativePath = join(".taskplane-tasks", taskDirName, "PROMPT.md");
|
|
443
461
|
}
|
|
444
462
|
} else if (promptNorm.startsWith(repoRootNorm + "/")) {
|
|
445
463
|
// Repo mode: relative path from repo root (mirrors into worktree)
|
|
@@ -780,8 +798,10 @@ export function resolveCanonicalTaskPaths(
|
|
|
780
798
|
const relPath = folderNorm.slice(repoRootNorm.length + 1);
|
|
781
799
|
resolvedFolder = join(worktreePath, relPath);
|
|
782
800
|
} else {
|
|
783
|
-
// Cross-repo
|
|
784
|
-
|
|
801
|
+
// Cross-repo: task files were copied into the worktree under
|
|
802
|
+
// .taskplane-tasks/<taskDirName>/ by buildLaneEnvVars
|
|
803
|
+
const taskDirName = basename(resolve(taskFolder));
|
|
804
|
+
resolvedFolder = join(worktreePath, ".taskplane-tasks", taskDirName);
|
|
785
805
|
}
|
|
786
806
|
} else if (folderNorm.startsWith(repoRootNorm + "/")) {
|
|
787
807
|
// Repo mode: task folder is inside the repo root.
|