larkcc 0.12.5 → 0.12.6

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/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.6] - 2026-05-09
11
+
12
+ ### Fixed
13
+
14
+ - Fix `Claude Code native binary not found` error on Windows: cross-platform claude binary detection (`where` on Windows, `which` on POSIX)
15
+ - Add `claude.path` config field for manual override of Claude Code binary location
16
+ - Fix `ensureEnv()` and `ensureClaudeInPath()` for Windows: skip bash PATH injection, use Windows common paths (`APPDATA/npm`), correct PATH separator (`;` vs `:`)
17
+
10
18
  ## [0.12.5] - 2026-05-09
11
19
 
12
20
  ### Changed
package/dist/index.js CHANGED
@@ -6665,7 +6665,8 @@ function loadConfig(cwd2, profile2) {
6665
6665
  claude: {
6666
6666
  permission_mode: claude.permission_mode ?? "acceptEdits",
6667
6667
  allowed_tools: claude.allowed_tools ?? DEFAULT_TOOLS,
6668
- thinking: claude.thinking ?? { type: "adaptive" }
6668
+ thinking: claude.thinking ?? { type: "adaptive" },
6669
+ path: claude.path
6669
6670
  },
6670
6671
  overflow: {
6671
6672
  mode: overflow.mode ?? DEFAULT_OVERFLOW.mode,
@@ -137994,7 +137995,7 @@ var VERSION3;
137994
137995
  var init_version = __esm({
137995
137996
  "src/version.ts"() {
137996
137997
  "use strict";
137997
- VERSION3 = "0.12.5";
137998
+ VERSION3 = "0.12.6";
137998
137999
  }
137999
138000
  });
138000
138001
 
@@ -155665,6 +155666,15 @@ var init_task_panel2 = __esm({
155665
155666
 
155666
155667
  // src/agent.ts
155667
155668
  import { execSync } from "child_process";
155669
+ function findClaudeBinary() {
155670
+ const cmd = process.platform === "win32" ? "where claude 2>nul" : "which claude 2>/dev/null || command -v claude 2>/dev/null";
155671
+ try {
155672
+ const result = execSync(cmd, { encoding: "utf8", timeout: 5e3 }).trim();
155673
+ if (result) return result.split(/[\r\n]/)[0];
155674
+ } catch {
155675
+ }
155676
+ return void 0;
155677
+ }
155668
155678
  function formatInput(name, input) {
155669
155679
  if (["Read", "Write", "Edit"].includes(name))
155670
155680
  return String(input.file_path ?? input.path ?? "");
@@ -155776,7 +155786,7 @@ async function runAgent(prompt2, cwd2, config2, client, chatId, rootMsgId, image
155776
155786
  thinking: config2.claude.thinking,
155777
155787
  abortController,
155778
155788
  agentProgressSummaries: true,
155779
- pathToClaudeCodeExecutable: execSync("which claude 2>/dev/null || echo ''", { encoding: "utf8" }).trim() || void 0,
155789
+ pathToClaudeCodeExecutable: config2.claude.path || findClaudeBinary(),
155780
155790
  ...systemPrompt ? { systemPrompt: { type: "preset", preset: "claude_code", append: systemPrompt } } : {}
155781
155791
  }
155782
155792
  })) {
@@ -156954,6 +156964,7 @@ function ensureClaudeOnboarding() {
156954
156964
  }
156955
156965
  function ensureEnv() {
156956
156966
  if (!process.env.HOME) process.env.HOME = os8.homedir();
156967
+ if (IS_WIN) return;
156957
156968
  try {
156958
156969
  const shellPath = execSync3("bash -lc 'echo $PATH' 2>/dev/null", { timeout: 3e3 }).toString().trim();
156959
156970
  if (shellPath) process.env.PATH = shellPath;
@@ -156961,7 +156972,10 @@ function ensureEnv() {
156961
156972
  }
156962
156973
  }
156963
156974
  function ensureClaudeInPath() {
156964
- const commonPaths = [
156975
+ const commonPaths = IS_WIN ? [
156976
+ path7.join(process.env.APPDATA ?? "", "npm"),
156977
+ path7.join(process.env.LOCALAPPDATA ?? "", "Programs", "claude")
156978
+ ] : [
156965
156979
  "/usr/local/bin",
156966
156980
  "/usr/bin",
156967
156981
  `${os8.homedir()}/.npm-global/bin`,
@@ -156969,23 +156983,29 @@ function ensureClaudeInPath() {
156969
156983
  "/opt/homebrew/bin",
156970
156984
  "/home/linuxbrew/.linuxbrew/bin"
156971
156985
  ];
156986
+ const findCmd = IS_WIN ? "where claude 2>nul" : "which claude 2>/dev/null || command -v claude 2>/dev/null";
156987
+ const shellOpt = IS_WIN ? {} : { shell: "/bin/bash" };
156972
156988
  try {
156973
- const claudePath = execSync3("which claude 2>/dev/null || command -v claude 2>/dev/null", {
156974
- shell: "/bin/bash",
156975
- env: { ...process.env, PATH: [...commonPaths, process.env.PATH ?? ""].join(":") }
156976
- }).toString().trim();
156989
+ const claudePath = execSync3(findCmd, {
156990
+ ...shellOpt,
156991
+ encoding: "utf8",
156992
+ timeout: 5e3,
156993
+ env: { ...process.env, PATH: [...commonPaths, process.env.PATH ?? ""].join(PATH_SEP) }
156994
+ }).trim();
156977
156995
  if (claudePath) {
156978
- const dir = path7.dirname(claudePath);
156979
- if (!process.env.PATH?.includes(dir)) process.env.PATH = `${dir}:${process.env.PATH}`;
156980
- logger.dim(`claude found: ${claudePath}`);
156996
+ const resolved = claudePath.split(/[\r\n]/)[0];
156997
+ const dir = path7.dirname(resolved);
156998
+ if (!process.env.PATH?.includes(dir)) process.env.PATH = `${dir}${PATH_SEP}${process.env.PATH}`;
156999
+ logger.dim(`claude found: ${resolved}`);
156981
157000
  return;
156982
157001
  }
156983
157002
  } catch {
156984
157003
  }
156985
157004
  for (const dir of commonPaths) {
156986
- if (fs8.existsSync(path7.join(dir, "claude"))) {
156987
- if (!process.env.PATH?.includes(dir)) process.env.PATH = `${dir}:${process.env.PATH}`;
156988
- logger.dim(`claude found: ${dir}/claude`);
157005
+ const binName = IS_WIN ? "claude.cmd" : "claude";
157006
+ if (fs8.existsSync(path7.join(dir, binName)) || fs8.existsSync(path7.join(dir, "claude"))) {
157007
+ if (!process.env.PATH?.includes(dir)) process.env.PATH = `${dir}${PATH_SEP}${process.env.PATH}`;
157008
+ logger.dim(`claude found: ${dir}`);
156989
157009
  return;
156990
157010
  }
156991
157011
  }
@@ -157116,7 +157136,7 @@ async function startApp(cwd2, config2, profile2, continueSession = false, force
157116
157136
  process.on("SIGINT", shutdown);
157117
157137
  process.on("SIGTERM", shutdown);
157118
157138
  }
157119
- var CLAUDE_SETTINGS_PATH, LOCK_DIR;
157139
+ var CLAUDE_SETTINGS_PATH, LOCK_DIR, IS_WIN, PATH_SEP;
157120
157140
  var init_app = __esm({
157121
157141
  "src/app.ts"() {
157122
157142
  "use strict";
@@ -157130,6 +157150,8 @@ var init_app = __esm({
157130
157150
  init_message_handler();
157131
157151
  CLAUDE_SETTINGS_PATH = path7.join(os8.homedir(), ".claude", "settings.json");
157132
157152
  LOCK_DIR = path7.join(os8.homedir(), ".larkcc");
157153
+ IS_WIN = process.platform === "win32";
157154
+ PATH_SEP = IS_WIN ? ";" : ":";
157133
157155
  }
157134
157156
  });
157135
157157