taskplane 0.2.2 → 0.2.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.
- package/extensions/task-runner.ts +1899 -1894
- package/extensions/taskplane/execution.ts +19 -4
- package/package.json +1 -1
|
@@ -106,6 +106,7 @@ export function buildLaneEnvVars(
|
|
|
106
106
|
lane: AllocatedLane,
|
|
107
107
|
promptPath: string,
|
|
108
108
|
repoRoot: string,
|
|
109
|
+
workspaceRoot?: string,
|
|
109
110
|
): Record<string, string> {
|
|
110
111
|
// TASK_AUTOSTART needs a path relative to the worktree root.
|
|
111
112
|
// The promptPath is absolute (from the main repo). We need the
|
|
@@ -129,7 +130,7 @@ export function buildLaneEnvVars(
|
|
|
129
130
|
}
|
|
130
131
|
const nodePath = [...new Set(nodePathEntries)].join(pathDelimiter);
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
const vars: Record<string, string> = {
|
|
133
134
|
TASK_AUTOSTART: relativePath,
|
|
134
135
|
TASK_RUNNER_SPAWN_MODE: "subprocess",
|
|
135
136
|
TASK_RUNNER_TMUX_PREFIX: lane.tmuxSessionName,
|
|
@@ -139,6 +140,15 @@ export function buildLaneEnvVars(
|
|
|
139
140
|
// Force xterm-256color so pi can render and start execution.
|
|
140
141
|
TERM: "xterm-256color",
|
|
141
142
|
};
|
|
143
|
+
|
|
144
|
+
// In workspace mode, the worktree cwd is inside a repo — not the workspace root.
|
|
145
|
+
// The task-runner needs TASKPLANE_WORKSPACE_ROOT to find .pi/task-runner.yaml
|
|
146
|
+
// and resolve task area paths from the correct base directory.
|
|
147
|
+
if (workspaceRoot && workspaceRoot !== repoRoot) {
|
|
148
|
+
vars.TASKPLANE_WORKSPACE_ROOT = workspaceRoot;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return vars;
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
/**
|
|
@@ -438,6 +448,7 @@ export function spawnLaneSession(
|
|
|
438
448
|
task: AllocatedTask,
|
|
439
449
|
config: OrchestratorConfig,
|
|
440
450
|
repoRoot: string,
|
|
451
|
+
workspaceRoot?: string,
|
|
441
452
|
): void {
|
|
442
453
|
const sessionName = lane.tmuxSessionName;
|
|
443
454
|
const laneId = lane.laneId;
|
|
@@ -460,7 +471,7 @@ export function spawnLaneSession(
|
|
|
460
471
|
}
|
|
461
472
|
|
|
462
473
|
// Build env vars
|
|
463
|
-
const envVars = buildLaneEnvVars(lane, task.task.promptPath, repoRoot);
|
|
474
|
+
const envVars = buildLaneEnvVars(lane, task.task.promptPath, repoRoot, workspaceRoot);
|
|
464
475
|
|
|
465
476
|
// Prepare per-task lane log path for post-mortem diagnostics
|
|
466
477
|
const laneLogPath = resolveLaneLogPath(lane, task);
|
|
@@ -761,6 +772,7 @@ export async function executeLane(
|
|
|
761
772
|
config: OrchestratorConfig,
|
|
762
773
|
repoRoot: string,
|
|
763
774
|
pauseSignal: { paused: boolean },
|
|
775
|
+
workspaceRoot?: string,
|
|
764
776
|
): Promise<LaneExecutionResult> {
|
|
765
777
|
const laneId = lane.laneId;
|
|
766
778
|
const laneStartTime = Date.now();
|
|
@@ -797,7 +809,7 @@ export async function executeLane(
|
|
|
797
809
|
|
|
798
810
|
try {
|
|
799
811
|
// Spawn TMUX session
|
|
800
|
-
spawnLaneSession(lane, task, config, repoRoot);
|
|
812
|
+
spawnLaneSession(lane, task, config, repoRoot, workspaceRoot);
|
|
801
813
|
|
|
802
814
|
// Poll until completion
|
|
803
815
|
const pollResult = await pollUntilTaskComplete(
|
|
@@ -1745,8 +1757,11 @@ export async function executeWave(
|
|
|
1745
1757
|
const wavePauseSignal = pauseSignal;
|
|
1746
1758
|
|
|
1747
1759
|
// Start lane execution promises
|
|
1760
|
+
// In workspace mode, pass the workspace root so lane sessions can find .pi/ config.
|
|
1761
|
+
// configPath is .pi/taskplane-workspace.yaml → parent of parent is workspace root.
|
|
1762
|
+
const wsRoot = workspaceConfig ? dirname(dirname(workspaceConfig.configPath)) : undefined;
|
|
1748
1763
|
const lanePromises = lanes.map(lane =>
|
|
1749
|
-
executeLane(lane, config, repoRoot, wavePauseSignal),
|
|
1764
|
+
executeLane(lane, config, repoRoot, wavePauseSignal, wsRoot),
|
|
1750
1765
|
);
|
|
1751
1766
|
|
|
1752
1767
|
// Start monitoring as a sibling async loop
|