taskplane 0.1.3 → 0.1.5
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 +48 -3
- package/package.json +1 -1
package/bin/taskplane.mjs
CHANGED
|
@@ -215,7 +215,7 @@ orchestrator:
|
|
|
215
215
|
integration_branch: "${vars.integration_branch}"
|
|
216
216
|
batch_id_format: "timestamp"
|
|
217
217
|
spawn_mode: "subprocess"
|
|
218
|
-
tmux_prefix: "
|
|
218
|
+
tmux_prefix: "${vars.tmux_prefix}"
|
|
219
219
|
|
|
220
220
|
dependencies:
|
|
221
221
|
source: "prompt"
|
|
@@ -255,6 +255,42 @@ monitoring:
|
|
|
255
255
|
// COMMANDS
|
|
256
256
|
// ═════════════════════════════════════════════════════════════════════════════
|
|
257
257
|
|
|
258
|
+
/** Auto-commit task files to git so they're available in orchestrator worktrees. */
|
|
259
|
+
async function autoCommitTaskFiles(projectRoot, tasksRoot) {
|
|
260
|
+
// Check if we're in a git repo
|
|
261
|
+
try {
|
|
262
|
+
execSync("git rev-parse --is-inside-work-tree", { cwd: projectRoot, stdio: "pipe" });
|
|
263
|
+
} catch {
|
|
264
|
+
// Not a git repo — skip silently
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Stage the tasks directory (not .pi/ — that's gitignored)
|
|
269
|
+
const tasksDir = path.join(projectRoot, tasksRoot);
|
|
270
|
+
if (!fs.existsSync(tasksDir)) return;
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
// Check if there's anything new to commit
|
|
274
|
+
execSync(`git add "${tasksRoot}"`, { cwd: projectRoot, stdio: "pipe" });
|
|
275
|
+
const status = execSync("git diff --cached --name-only", { cwd: projectRoot, stdio: "pipe" })
|
|
276
|
+
.toString()
|
|
277
|
+
.trim();
|
|
278
|
+
|
|
279
|
+
if (!status) return; // nothing staged
|
|
280
|
+
|
|
281
|
+
execSync('git commit -m "chore: initialize taskplane tasks"', {
|
|
282
|
+
cwd: projectRoot,
|
|
283
|
+
stdio: "pipe",
|
|
284
|
+
});
|
|
285
|
+
console.log(`\n ${c.green}git${c.reset} committed ${tasksRoot}/ to git`);
|
|
286
|
+
console.log(` ${c.dim}(orchestrator worktrees require committed files)${c.reset}`);
|
|
287
|
+
} catch (err) {
|
|
288
|
+
// Git commit failed — warn but don't block init
|
|
289
|
+
console.log(`\n ${WARN} Could not auto-commit task files to git.`);
|
|
290
|
+
console.log(` ${c.dim}Run manually before using /orch: git add ${tasksRoot} && git commit -m "add taskplane tasks"${c.reset}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
258
294
|
// ─── init ───────────────────────────────────────────────────────────────────
|
|
259
295
|
|
|
260
296
|
async function cmdInit(args) {
|
|
@@ -359,6 +395,11 @@ async function cmdInit(args) {
|
|
|
359
395
|
}
|
|
360
396
|
}
|
|
361
397
|
|
|
398
|
+
// Auto-commit task files to git so they're available in worktrees
|
|
399
|
+
if (!dryRun) {
|
|
400
|
+
await autoCommitTaskFiles(projectRoot, vars.tasks_root);
|
|
401
|
+
}
|
|
402
|
+
|
|
362
403
|
// Report
|
|
363
404
|
console.log(`\n${OK} ${c.bold}Taskplane initialized!${c.reset}\n`);
|
|
364
405
|
console.log(`${c.bold}Quick start:${c.reset}`);
|
|
@@ -378,12 +419,14 @@ async function cmdInit(args) {
|
|
|
378
419
|
|
|
379
420
|
function getPresetVars(preset, projectRoot) {
|
|
380
421
|
const dirName = path.basename(projectRoot);
|
|
422
|
+
const slug = slugify(dirName);
|
|
381
423
|
const { test: test_cmd, build: build_cmd } = detectStack(projectRoot);
|
|
382
424
|
return {
|
|
383
425
|
project_name: dirName,
|
|
384
426
|
integration_branch: "main",
|
|
385
427
|
max_lanes: 3,
|
|
386
|
-
worktree_prefix: `${
|
|
428
|
+
worktree_prefix: `${slug}-wt`,
|
|
429
|
+
tmux_prefix: `${slug}-orch`,
|
|
387
430
|
tasks_root: "taskplane-tasks",
|
|
388
431
|
default_area: "general",
|
|
389
432
|
default_prefix: "TP",
|
|
@@ -406,11 +449,13 @@ async function getInteractiveVars(projectRoot) {
|
|
|
406
449
|
const test_cmd = await ask("Test command (agents run this to verify work — blank to skip)", detected.test || "");
|
|
407
450
|
const build_cmd = await ask("Build command (agents run this after tests — blank to skip)", detected.build || "");
|
|
408
451
|
|
|
452
|
+
const slug = slugify(project_name);
|
|
409
453
|
return {
|
|
410
454
|
project_name,
|
|
411
455
|
integration_branch,
|
|
412
456
|
max_lanes,
|
|
413
|
-
worktree_prefix: `${
|
|
457
|
+
worktree_prefix: `${slug}-wt`,
|
|
458
|
+
tmux_prefix: `${slug}-orch`,
|
|
414
459
|
tasks_root,
|
|
415
460
|
default_area,
|
|
416
461
|
default_prefix,
|