karajan-code 1.37.0 → 1.38.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.
@@ -5,37 +5,46 @@ import os from "node:os";
5
5
  */
6
6
  export function getPlatform() {
7
7
  const platform = os.platform();
8
- return platform === "darwin" ? "macos" : "linux";
8
+ if (platform === "win32") return "windows";
9
+ if (platform === "darwin") return "macos";
10
+ return "linux";
9
11
  }
10
12
 
11
13
  const INSTALL_COMMANDS = {
12
14
  rtk: {
13
15
  macos: "brew install rtk && rtk init --global",
14
- linux: "curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh && rtk init --global"
16
+ linux: "curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh && rtk init --global",
17
+ windows: "Download from https://github.com/rtk-ai/rtk/releases and add to PATH"
15
18
  },
16
19
  claude: {
17
20
  macos: "npm install -g @anthropic-ai/claude-code",
18
- linux: "npm install -g @anthropic-ai/claude-code"
21
+ linux: "npm install -g @anthropic-ai/claude-code",
22
+ windows: "npm install -g @anthropic-ai/claude-code"
19
23
  },
20
24
  codex: {
21
25
  macos: "npm install -g @openai/codex",
22
- linux: "npm install -g @openai/codex"
26
+ linux: "npm install -g @openai/codex",
27
+ windows: "npm install -g @openai/codex"
23
28
  },
24
29
  gemini: {
25
30
  macos: "npm install -g @google/gemini-cli",
26
- linux: "npm install -g @google/gemini-cli"
31
+ linux: "npm install -g @google/gemini-cli",
32
+ windows: "npm install -g @google/gemini-cli"
27
33
  },
28
34
  aider: {
29
35
  macos: "pipx install aider-chat",
30
- linux: "pipx install aider-chat || pip3 install aider-chat"
36
+ linux: "pipx install aider-chat || pip3 install aider-chat",
37
+ windows: "pip install aider-chat"
31
38
  },
32
39
  opencode: {
33
40
  macos: "curl -fsSL https://opencode.ai/install | bash",
34
- linux: "curl -fsSL https://opencode.ai/install | bash"
41
+ linux: "curl -fsSL https://opencode.ai/install | bash",
42
+ windows: "See https://github.com/nicepkg/opencode for Windows install"
35
43
  },
36
44
  docker: {
37
45
  macos: "brew install --cask docker",
38
- linux: "sudo apt install docker.io docker-compose-v2 (or see https://docs.docker.com/engine/install/)"
46
+ linux: "sudo apt install docker.io docker-compose-v2 (or see https://docs.docker.com/engine/install/)",
47
+ windows: "Download Docker Desktop from https://www.docker.com/products/docker-desktop/"
39
48
  }
40
49
  };
41
50
 
@@ -1,12 +1,15 @@
1
1
  import { execa } from "execa";
2
2
 
3
+ const isWin = process.platform === "win32";
4
+ const KILL_SIGNAL = isWin ? "SIGTERM" : "SIGKILL";
5
+
3
6
  function buildSilenceKilledResult(silenceTimeoutMs, stdout, signal) {
4
7
  return {
5
8
  exitCode: 143,
6
9
  stdout,
7
10
  stderr: `Command killed after ${Number(silenceTimeoutMs)}ms without output`,
8
11
  timedOut: true,
9
- signal: signal || "SIGKILL"
12
+ signal: signal || KILL_SIGNAL
10
13
  };
11
14
  }
12
15
 
@@ -52,7 +55,7 @@ async function awaitWithTimeout(subprocess, timeout, getStdout) {
52
55
  const timeoutResult = new Promise((resolve) => {
53
56
  timer = setTimeout(() => {
54
57
  try {
55
- subprocess.kill("SIGKILL", { forceKillAfterDelay: 1000 });
58
+ subprocess.kill(KILL_SIGNAL, { forceKillAfterDelay: 1000 });
56
59
  } catch {
57
60
  // no-op
58
61
  }
@@ -61,7 +64,7 @@ async function awaitWithTimeout(subprocess, timeout, getStdout) {
61
64
  stdout: getStdout(),
62
65
  stderr: `Command timed out after ${timeout}ms`,
63
66
  timedOut: true,
64
- signal: "SIGKILL"
67
+ signal: KILL_SIGNAL
65
68
  });
66
69
  }, timeout);
67
70
  });
@@ -94,7 +97,7 @@ export async function runCommand(command, args = [], options = {}) {
94
97
  outputSilenceTimer = setTimeout(() => {
95
98
  silenceTimedOut = true;
96
99
  try {
97
- subprocess.kill("SIGKILL", { forceKillAfterDelay: 1000 });
100
+ subprocess.kill(KILL_SIGNAL, { forceKillAfterDelay: 1000 });
98
101
  } catch {
99
102
  // no-op
100
103
  }