taskplane 0.21.9 → 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.
@@ -27,6 +27,7 @@ export const TASKPLANE_GITIGNORE_ENTRIES = [
27
27
  ".pi/orch-abort-signal",
28
28
  ".pi/settings.json",
29
29
  ".worktrees/",
30
+ ".taskplane-tasks/",
30
31
  ];
31
32
 
32
33
  export const TASKPLANE_GITIGNORE_NPM_ENTRIES = [
@@ -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
- relativePath = resolve(promptPath);
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 fallback: use absolute path (future: #51)
784
- resolvedFolder = resolve(taskFolder);
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.21.9",
3
+ "version": "0.21.10",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",