taskplane 0.1.13 → 0.1.14

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.
Files changed (2) hide show
  1. package/bin/taskplane.mjs +35 -33
  2. package/package.json +1 -1
package/bin/taskplane.mjs CHANGED
@@ -291,16 +291,17 @@ async function autoCommitTaskFiles(projectRoot, tasksRoot) {
291
291
  }
292
292
  }
293
293
 
294
- function discoverTaskAreaPaths(projectRoot) {
294
+ function discoverTaskAreaMetadata(projectRoot) {
295
295
  const runnerPath = path.join(projectRoot, ".pi", "task-runner.yaml");
296
- if (!fs.existsSync(runnerPath)) return [];
296
+ if (!fs.existsSync(runnerPath)) return { paths: [], contexts: [] };
297
297
 
298
298
  const raw = readYaml(runnerPath);
299
- if (!raw) return [];
299
+ if (!raw) return { paths: [], contexts: [] };
300
300
 
301
301
  const lines = raw.split(/\r?\n/);
302
302
  let inTaskAreas = false;
303
303
  const paths = new Set();
304
+ const contexts = new Set();
304
305
 
305
306
  for (const line of lines) {
306
307
  const trimmed = line.trim();
@@ -317,13 +318,22 @@ function discoverTaskAreaPaths(projectRoot) {
317
318
  break;
318
319
  }
319
320
 
320
- const m = line.match(/^\s{4}path:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
321
- if (m?.[1]) {
322
- paths.add(m[1].trim());
321
+ const pathMatch = line.match(/^\s{4}path:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
322
+ if (pathMatch?.[1]) {
323
+ paths.add(pathMatch[1].trim());
324
+ }
325
+
326
+ const contextMatch = line.match(/^\s{4}context:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/);
327
+ if (contextMatch?.[1]) {
328
+ contexts.add(contextMatch[1].trim());
323
329
  }
324
330
  }
325
331
 
326
- return [...paths];
332
+ return { paths: [...paths], contexts: [...contexts] };
333
+ }
334
+
335
+ function discoverTaskAreaPaths(projectRoot) {
336
+ return discoverTaskAreaMetadata(projectRoot).paths;
327
337
  }
328
338
 
329
339
  function pruneEmptyDir(dirPath) {
@@ -825,33 +835,25 @@ function cmdDoctor() {
825
835
  }
826
836
 
827
837
  // Check task areas from config
828
- const runnerYaml = readYaml(path.join(projectRoot, ".pi", "task-runner.yaml"));
829
- if (runnerYaml) {
830
- // Simple regex extraction of task area paths
831
- const pathMatches = [...runnerYaml.matchAll(/^\s+path:\s*"?([^"\n]+)"?/gm)];
832
- const contextMatches = [...runnerYaml.matchAll(/^\s+context:\s*"?([^"\n]+)"?/gm)];
833
-
834
- if (pathMatches.length > 0) {
835
- console.log();
836
- for (const match of pathMatches) {
837
- const areaPath = match[1].trim();
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++;
845
- }
838
+ const { paths: taskAreaPaths, contexts: taskAreaContexts } = discoverTaskAreaMetadata(projectRoot);
839
+ if (taskAreaPaths.length > 0) {
840
+ console.log();
841
+ for (const areaPath of taskAreaPaths) {
842
+ const exists = fs.existsSync(path.join(projectRoot, areaPath));
843
+ if (exists) {
844
+ console.log(` ${OK} task area path: ${areaPath}`);
845
+ } else {
846
+ console.log(` ${FAIL} task area path: ${areaPath} ${c.dim}(directory not found)${c.reset}`);
847
+ console.log(` ${c.dim}→ Run: mkdir -p ${areaPath}${c.reset}`);
848
+ issues++;
846
849
  }
847
- for (const match of contextMatches) {
848
- const ctxPath = match[1].trim();
849
- const exists = fs.existsSync(path.join(projectRoot, ctxPath));
850
- if (exists) {
851
- console.log(` ${OK} CONTEXT.md: ${ctxPath}`);
852
- } else {
853
- console.log(` ${WARN} CONTEXT.md: ${ctxPath} ${c.dim}(not found)${c.reset}`);
854
- }
850
+ }
851
+ for (const ctxPath of taskAreaContexts) {
852
+ const exists = fs.existsSync(path.join(projectRoot, ctxPath));
853
+ if (exists) {
854
+ console.log(` ${OK} CONTEXT.md: ${ctxPath}`);
855
+ } else {
856
+ console.log(` ${WARN} CONTEXT.md: ${ctxPath} ${c.dim}(not found)${c.reset}`);
855
857
  }
856
858
  }
857
859
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",