forge-pipeline 0.3.0 → 0.3.1

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/forge.js +40 -19
  2. package/package.json +1 -1
package/bin/forge.js CHANGED
@@ -6,58 +6,79 @@ const path = require("path");
6
6
  const forgePath = path.join(__dirname, "..", "forge");
7
7
 
8
8
  if (process.platform === "win32") {
9
- // Check if WSL is available
10
- let hasWsl = false;
9
+ // Check if WSL has a working Linux distro (not just WSL installed)
10
+ let hasWslDistro = false;
11
11
  try {
12
- execSync("wsl --status", { stdio: "ignore" });
13
- hasWsl = true;
12
+ const result = execSync("wsl echo ok", {
13
+ stdio: ["ignore", "pipe", "ignore"],
14
+ timeout: 5000,
15
+ }).toString().trim();
16
+ hasWslDistro = result.includes("ok");
14
17
  } catch {}
15
18
 
16
- if (!hasWsl) {
19
+ if (!hasWslDistro) {
17
20
  console.error(
18
- "Error: forge requires a Unix environment.\n" +
21
+ "forge requires WSL with a Linux distribution installed.\n" +
19
22
  "\n" +
20
- "Install WSL (Windows Subsystem for Linux):\n" +
23
+ "Setup steps:\n" +
21
24
  " 1. Open PowerShell as Administrator\n" +
22
25
  " 2. Run: wsl --install\n" +
23
26
  " 3. Restart your computer\n" +
24
- " 4. Run: npm install -g forge-pipeline (inside WSL)\n" +
27
+ " 4. Open 'Ubuntu' from the Start Menu and complete setup\n" +
28
+ " 5. Inside Ubuntu, install forge:\n" +
29
+ " curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -\n" +
30
+ " sudo apt install -y nodejs tmux git jq\n" +
31
+ " npm install -g forge-pipeline\n" +
32
+ " 6. Install Claude Code inside WSL:\n" +
33
+ " npm install -g @anthropic-ai/claude-code\n" +
25
34
  "\n" +
26
- "forge depends on bash, tmux, and git worktrees which\n" +
27
- "are not available natively on Windows."
35
+ "Then run forge from inside the Ubuntu terminal."
28
36
  );
29
37
  process.exit(1);
30
38
  }
31
39
 
32
- // Check if required tools exist inside WSL
40
+ // WSL has a working distro check for required tools
33
41
  let missing = [];
34
- for (const tool of ["tmux", "git", "claude", "jq"]) {
42
+ for (const tool of ["bash", "tmux", "git", "claude", "jq"]) {
35
43
  try {
36
- execSync(`wsl which ${tool}`, { stdio: "ignore" });
44
+ execSync(`wsl which ${tool}`, { stdio: "ignore", timeout: 3000 });
37
45
  } catch {
38
46
  missing.push(tool);
39
47
  }
40
48
  }
41
49
 
42
50
  if (missing.length > 0) {
51
+ const aptTools = missing.filter(t => !["claude"].includes(t));
43
52
  console.error(
44
53
  "WSL detected but missing required tools: " + missing.join(", ") + "\n" +
45
54
  "\n" +
46
55
  "Open WSL and install them:\n" +
47
56
  " wsl\n" +
48
- " sudo apt update && sudo apt install -y " +
49
- missing.filter(t => t !== "claude").join(" ") + "\n" +
57
+ (aptTools.length > 0
58
+ ? " sudo apt update && sudo apt install -y " + aptTools.join(" ") + "\n"
59
+ : "") +
50
60
  (missing.includes("claude")
51
- ? " # Install Claude Code: https://docs.anthropic.com/en/docs/claude-code\n"
61
+ ? " npm install -g @anthropic-ai/claude-code\n"
52
62
  : "")
53
63
  );
54
64
  process.exit(1);
55
65
  }
56
66
 
57
67
  // Convert Windows path to WSL path and run
58
- const wslForgePath = execSync(`wsl wslpath -u "${forgePath.replace(/\\/g, "\\\\")}"`)
59
- .toString()
60
- .trim();
68
+ let wslForgePath;
69
+ try {
70
+ wslForgePath = execSync(`wsl wslpath -u "${forgePath.replace(/\\/g, "\\\\")}"`, {
71
+ stdio: ["ignore", "pipe", "ignore"],
72
+ }).toString().trim();
73
+ } catch {
74
+ console.error(
75
+ "Failed to convert path for WSL.\n" +
76
+ "Run forge directly from inside WSL instead:\n" +
77
+ " wsl\n" +
78
+ " forge --help"
79
+ );
80
+ process.exit(1);
81
+ }
61
82
 
62
83
  try {
63
84
  execFileSync("wsl", ["bash", wslForgePath, ...process.argv.slice(2)], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-pipeline",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Autonomous multi-agent coding pipeline",
5
5
  "bin": {
6
6
  "forge": "./bin/forge.js"