taskplane 0.1.13 → 0.1.15
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/bin/taskplane.mjs +35 -37
- package/extensions/taskplane/engine.ts +771 -758
- package/extensions/taskplane/execution.ts +4 -2
- package/extensions/taskplane/git.ts +25 -7
- package/extensions/taskplane/merge.ts +18 -16
- package/extensions/taskplane/persistence.ts +1136 -1121
- package/extensions/taskplane/resume.ts +1096 -1092
- package/extensions/taskplane/types.ts +5 -2
- package/extensions/taskplane/waves.ts +894 -900
- package/extensions/taskplane/worktree.ts +6 -5
- package/package.json +1 -1
- package/templates/config/task-orchestrator.yaml +86 -89
- package/templates/config/task-runner.yaml +95 -99
package/bin/taskplane.mjs
CHANGED
|
@@ -212,7 +212,6 @@ orchestrator:
|
|
|
212
212
|
max_lanes: ${vars.max_lanes}
|
|
213
213
|
worktree_location: "subdirectory"
|
|
214
214
|
worktree_prefix: "${vars.worktree_prefix}"
|
|
215
|
-
integration_branch: "${vars.integration_branch}"
|
|
216
215
|
batch_id_format: "timestamp"
|
|
217
216
|
spawn_mode: "subprocess"
|
|
218
217
|
tmux_prefix: "${vars.tmux_prefix}"
|
|
@@ -291,16 +290,17 @@ async function autoCommitTaskFiles(projectRoot, tasksRoot) {
|
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
292
|
|
|
294
|
-
function
|
|
293
|
+
function discoverTaskAreaMetadata(projectRoot) {
|
|
295
294
|
const runnerPath = path.join(projectRoot, ".pi", "task-runner.yaml");
|
|
296
|
-
if (!fs.existsSync(runnerPath)) return [];
|
|
295
|
+
if (!fs.existsSync(runnerPath)) return { paths: [], contexts: [] };
|
|
297
296
|
|
|
298
297
|
const raw = readYaml(runnerPath);
|
|
299
|
-
if (!raw) return [];
|
|
298
|
+
if (!raw) return { paths: [], contexts: [] };
|
|
300
299
|
|
|
301
300
|
const lines = raw.split(/\r?\n/);
|
|
302
301
|
let inTaskAreas = false;
|
|
303
302
|
const paths = new Set();
|
|
303
|
+
const contexts = new Set();
|
|
304
304
|
|
|
305
305
|
for (const line of lines) {
|
|
306
306
|
const trimmed = line.trim();
|
|
@@ -317,13 +317,22 @@ function discoverTaskAreaPaths(projectRoot) {
|
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
paths.add(
|
|
320
|
+
const pathMatch = line.match(/^\s{4}path:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
|
|
321
|
+
if (pathMatch?.[1]) {
|
|
322
|
+
paths.add(pathMatch[1].trim());
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const contextMatch = line.match(/^\s{4}context:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
|
|
326
|
+
if (contextMatch?.[1]) {
|
|
327
|
+
contexts.add(contextMatch[1].trim());
|
|
323
328
|
}
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
return [...paths];
|
|
331
|
+
return { paths: [...paths], contexts: [...contexts] };
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function discoverTaskAreaPaths(projectRoot) {
|
|
335
|
+
return discoverTaskAreaMetadata(projectRoot).paths;
|
|
327
336
|
}
|
|
328
337
|
|
|
329
338
|
function pruneEmptyDir(dirPath) {
|
|
@@ -697,7 +706,6 @@ function getPresetVars(preset, projectRoot, tasksRootOverride = null) {
|
|
|
697
706
|
const { test: test_cmd, build: build_cmd } = detectStack(projectRoot);
|
|
698
707
|
return {
|
|
699
708
|
project_name: dirName,
|
|
700
|
-
integration_branch: "main",
|
|
701
709
|
max_lanes: 3,
|
|
702
710
|
worktree_prefix: `${slug}-wt`,
|
|
703
711
|
tmux_prefix: `${slug}-orch`,
|
|
@@ -715,7 +723,6 @@ async function getInteractiveVars(projectRoot, tasksRootOverride = null) {
|
|
|
715
723
|
const detected = detectStack(projectRoot);
|
|
716
724
|
|
|
717
725
|
const project_name = await ask("Project name", dirName);
|
|
718
|
-
const integration_branch = await ask("Default branch (fallback — orchestrator uses your current branch at runtime)", "main");
|
|
719
726
|
const max_lanes = parseInt(await ask("Max parallel lanes", "3")) || 3;
|
|
720
727
|
const tasks_root = tasksRootOverride || await ask("Tasks directory", "taskplane-tasks");
|
|
721
728
|
const default_area = await ask("Default area name", "general");
|
|
@@ -726,7 +733,6 @@ async function getInteractiveVars(projectRoot, tasksRootOverride = null) {
|
|
|
726
733
|
const slug = slugify(project_name);
|
|
727
734
|
return {
|
|
728
735
|
project_name,
|
|
729
|
-
integration_branch,
|
|
730
736
|
max_lanes,
|
|
731
737
|
worktree_prefix: `${slug}-wt`,
|
|
732
738
|
tmux_prefix: `${slug}-orch`,
|
|
@@ -825,33 +831,25 @@ function cmdDoctor() {
|
|
|
825
831
|
}
|
|
826
832
|
|
|
827
833
|
// Check task areas from config
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
if (exists) {
|
|
840
|
-
console.log(` ${OK} task area path: ${areaPath}`);
|
|
841
|
-
} else {
|
|
842
|
-
console.log(` ${FAIL} task area path: ${areaPath} ${c.dim}(directory not found)${c.reset}`);
|
|
843
|
-
console.log(` ${c.dim}→ Run: mkdir -p ${areaPath}${c.reset}`);
|
|
844
|
-
issues++;
|
|
845
|
-
}
|
|
834
|
+
const { paths: taskAreaPaths, contexts: taskAreaContexts } = discoverTaskAreaMetadata(projectRoot);
|
|
835
|
+
if (taskAreaPaths.length > 0) {
|
|
836
|
+
console.log();
|
|
837
|
+
for (const areaPath of taskAreaPaths) {
|
|
838
|
+
const exists = fs.existsSync(path.join(projectRoot, areaPath));
|
|
839
|
+
if (exists) {
|
|
840
|
+
console.log(` ${OK} task area path: ${areaPath}`);
|
|
841
|
+
} else {
|
|
842
|
+
console.log(` ${FAIL} task area path: ${areaPath} ${c.dim}(directory not found)${c.reset}`);
|
|
843
|
+
console.log(` ${c.dim}→ Run: mkdir -p ${areaPath}${c.reset}`);
|
|
844
|
+
issues++;
|
|
846
845
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
846
|
+
}
|
|
847
|
+
for (const ctxPath of taskAreaContexts) {
|
|
848
|
+
const exists = fs.existsSync(path.join(projectRoot, ctxPath));
|
|
849
|
+
if (exists) {
|
|
850
|
+
console.log(` ${OK} CONTEXT.md: ${ctxPath}`);
|
|
851
|
+
} else {
|
|
852
|
+
console.log(` ${WARN} CONTEXT.md: ${ctxPath} ${c.dim}(not found)${c.reset}`);
|
|
855
853
|
}
|
|
856
854
|
}
|
|
857
855
|
}
|