claude-kanban 0.2.1 → 0.3.0
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/dist/bin/cli.js +133 -11
- package/dist/bin/cli.js.map +1 -1
- package/dist/server/index.js +48 -8
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { existsSync as existsSync3 } from "fs";
|
|
|
9
9
|
// src/server/services/executor.ts
|
|
10
10
|
import { spawn, execSync } from "child_process";
|
|
11
11
|
import { join as join4 } from "path";
|
|
12
|
-
import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync } from "fs";
|
|
12
|
+
import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync, symlinkSync } from "fs";
|
|
13
13
|
import { EventEmitter } from "events";
|
|
14
14
|
|
|
15
15
|
// src/server/services/project.ts
|
|
@@ -379,6 +379,7 @@ ${summary}
|
|
|
379
379
|
cwd: this.projectPath,
|
|
380
380
|
stdio: "pipe"
|
|
381
381
|
});
|
|
382
|
+
this.symlinkDependencies(worktreePath);
|
|
382
383
|
console.log(`[executor] Created worktree at ${worktreePath} on branch ${branchName}`);
|
|
383
384
|
return { worktreePath, branchName };
|
|
384
385
|
} catch (error) {
|
|
@@ -386,6 +387,38 @@ ${summary}
|
|
|
386
387
|
return null;
|
|
387
388
|
}
|
|
388
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Symlink dependency directories from main project to worktree
|
|
392
|
+
*/
|
|
393
|
+
symlinkDependencies(worktreePath) {
|
|
394
|
+
const depDirs = [
|
|
395
|
+
"node_modules",
|
|
396
|
+
".pnpm",
|
|
397
|
+
// pnpm store
|
|
398
|
+
".yarn",
|
|
399
|
+
// yarn cache
|
|
400
|
+
"vendor",
|
|
401
|
+
// PHP/Ruby deps
|
|
402
|
+
"__pycache__",
|
|
403
|
+
// Python cache
|
|
404
|
+
".venv",
|
|
405
|
+
// Python virtual env
|
|
406
|
+
"venv"
|
|
407
|
+
// Python virtual env
|
|
408
|
+
];
|
|
409
|
+
for (const dir of depDirs) {
|
|
410
|
+
const sourcePath = join4(this.projectPath, dir);
|
|
411
|
+
const targetPath = join4(worktreePath, dir);
|
|
412
|
+
if (existsSync2(sourcePath) && !existsSync2(targetPath)) {
|
|
413
|
+
try {
|
|
414
|
+
symlinkSync(sourcePath, targetPath, "junction");
|
|
415
|
+
console.log(`[executor] Symlinked ${dir} to worktree`);
|
|
416
|
+
} catch (error) {
|
|
417
|
+
console.log(`[executor] Could not symlink ${dir}:`, error);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
389
422
|
/**
|
|
390
423
|
* Remove a git worktree
|
|
391
424
|
*/
|
|
@@ -478,6 +511,17 @@ ${summary}
|
|
|
478
511
|
const stepsText = task.steps.length > 0 ? `
|
|
479
512
|
Verification steps:
|
|
480
513
|
${task.steps.map((s, i) => `${i + 1}. ${s}`).join("\n")}` : "";
|
|
514
|
+
const verifySteps = [];
|
|
515
|
+
if (config.project.typecheckCommand) {
|
|
516
|
+
verifySteps.push(`Run typecheck: ${config.project.typecheckCommand}`);
|
|
517
|
+
}
|
|
518
|
+
if (config.project.testCommand) {
|
|
519
|
+
verifySteps.push(`Run tests: ${config.project.testCommand}`);
|
|
520
|
+
}
|
|
521
|
+
const verifySection = verifySteps.length > 0 ? `2. Verify your work:
|
|
522
|
+
${verifySteps.map((s) => ` - ${s}`).join("\n")}
|
|
523
|
+
|
|
524
|
+
` : "";
|
|
481
525
|
return `You are an AI coding agent. Complete the following task:
|
|
482
526
|
|
|
483
527
|
## TASK
|
|
@@ -491,23 +535,19 @@ ${stepsText}
|
|
|
491
535
|
## INSTRUCTIONS
|
|
492
536
|
1. Implement this task as described above.
|
|
493
537
|
|
|
494
|
-
2.
|
|
495
|
-
- Run typecheck: ${config.project.typecheckCommand}
|
|
496
|
-
- Run tests: ${config.project.testCommand}
|
|
497
|
-
|
|
498
|
-
3. When complete, update the task in ${prdPath}:
|
|
538
|
+
${verifySection}${verifySteps.length > 0 ? "3" : "2"}. When complete, update the task in ${prdPath}:
|
|
499
539
|
- Find the task with id "${task.id}"
|
|
500
540
|
- Set "passes": true
|
|
501
541
|
- Set "status": "completed"
|
|
502
542
|
|
|
503
|
-
4. Document your work in ${progressPath}:
|
|
543
|
+
${verifySteps.length > 0 ? "4" : "3"}. Document your work in ${progressPath}:
|
|
504
544
|
- What you implemented and files changed
|
|
505
545
|
- Key decisions made and why
|
|
506
546
|
- Gotchas, edge cases, or tricky parts discovered
|
|
507
547
|
- Useful patterns or approaches that worked well
|
|
508
548
|
- Anything a future agent should know about this area of the codebase
|
|
509
549
|
|
|
510
|
-
5. Make a git commit with a descriptive message.
|
|
550
|
+
${verifySteps.length > 0 ? "5" : "4"}. Make a git commit with a descriptive message.
|
|
511
551
|
|
|
512
552
|
Focus only on this task. When successfully complete, output: <promise>COMPLETE</promise>`;
|
|
513
553
|
}
|