@codexhost/cli-linux-x64 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -7,7 +7,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g @codexhost/cli@0.3.0
10
+ npm install -g @codexhost/cli@0.3.2
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@codexhost/cli`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.3.0","distribution":"npm","target":"linux-x64"}
1
+ {"schemaVersion":1,"version":"0.3.2","distribution":"npm","target":"linux-x64"}
@@ -45631,6 +45631,16 @@ function isExecutable(candidate, platform) {
45631
45631
  return false;
45632
45632
  }
45633
45633
  }
45634
+ function claudeNpmNativeExecutable(npmDirectory) {
45635
+ return path4.join(npmDirectory, "node_modules", "@anthropic-ai", "claude-code", "bin", "claude.exe");
45636
+ }
45637
+ function runnableCandidate(candidate, platform) {
45638
+ if (platform === "win32" && path4.basename(candidate).toLowerCase() === "claude.cmd") {
45639
+ const nativeExecutable = claudeNpmNativeExecutable(path4.dirname(candidate));
45640
+ return isExecutable(nativeExecutable, platform) ? nativeExecutable : void 0;
45641
+ }
45642
+ return candidate;
45643
+ }
45634
45644
  function nvmCandidates(homeDirectory) {
45635
45645
  const versionsDirectory = path4.join(homeDirectory, ".nvm", "versions", "node");
45636
45646
  try {
@@ -45643,6 +45653,7 @@ function userInstallCandidates(platform, environment, homeDirectory) {
45643
45653
  if (platform === "win32") {
45644
45654
  const appData = environment.APPDATA ?? path4.join(homeDirectory, "AppData", "Roaming");
45645
45655
  return [
45656
+ claudeNpmNativeExecutable(path4.join(appData, "npm")),
45646
45657
  path4.join(appData, "npm", "claude.cmd"),
45647
45658
  path4.join(homeDirectory, ".local", "bin", "claude.exe"),
45648
45659
  path4.join(homeDirectory, ".local", "bin", "claude.cmd")
@@ -45667,7 +45678,7 @@ function resolveClaudeCodeExecutable(input = {}) {
45667
45678
  ...candidates(command, platform, environment),
45668
45679
  ...configuredCommand ? [] : userInstallCandidates(platform, environment, homeDirectory)
45669
45680
  ];
45670
- const executable2 = resolutionCandidates.find((candidate) => isExecutable(candidate, platform));
45681
+ const executable2 = resolutionCandidates.map((candidate) => runnableCandidate(candidate, platform)).find((candidate) => candidate !== void 0 && isExecutable(candidate, platform));
45671
45682
  if (!executable2)
45672
45683
  throw new ClaudeCodeExecutableError("Claude Code is not installed");
45673
45684
  return path4.resolve(executable2);
@@ -68879,22 +68890,27 @@ function createRemoteAppServerWebSocketListener(input) {
68879
68890
  closing = (async () => {
68880
68891
  for (const socket of webSockets.clients) socket.terminate();
68881
68892
  await new Promise((resolve2) => webSockets.close(() => resolve2()));
68882
- if (listening) {
68893
+ const closeServer = async () => {
68894
+ if (!listening) return;
68883
68895
  await new Promise(
68884
68896
  (resolve2, reject) => server.close((error54) => error54 ? reject(error54) : resolve2())
68885
68897
  );
68886
- }
68887
- await Promise.allSettled(sessions);
68888
- if (process.platform !== "win32" && ownedSocketIdentity) {
68889
- const identity = ownedSocketIdentity;
68898
+ };
68899
+ if (process.platform !== "win32" && listening) {
68890
68900
  await withRemoteAppServerSocketInitializationLock(input.socketPath, async () => {
68891
- const current = await unixSocketIdentity(input.socketPath);
68892
- if (current && sameUnixFileIdentity2(current, identity)) {
68893
- await rm6(input.socketPath, { force: true });
68901
+ await closeServer();
68902
+ if (ownedSocketIdentity) {
68903
+ const current = await unixSocketIdentity(input.socketPath);
68904
+ if (current && sameUnixFileIdentity2(current, ownedSocketIdentity)) {
68905
+ await rm6(input.socketPath, { force: true });
68906
+ }
68907
+ ownedSocketIdentity = null;
68894
68908
  }
68895
68909
  });
68896
- ownedSocketIdentity = null;
68910
+ } else {
68911
+ await closeServer();
68897
68912
  }
68913
+ await Promise.allSettled(sessions);
68898
68914
  closed.resolve(void 0);
68899
68915
  })();
68900
68916
  return closing;
@@ -68922,12 +68938,16 @@ function publicStatus(status) {
68922
68938
  function createHostUpdateCoordinator(options) {
68923
68939
  const platform = options.platform ?? process.platform;
68924
68940
  const manager = options.manager ?? createBackgroundUpdateManager({ platform });
68925
- const contextPromise = resolveInstalledUpdateContext({
68926
- hostRuntimePath: options.hostRuntimePath,
68927
- ...options.environment ? { environment: options.environment } : {},
68928
- ...options.platform ? { platform: options.platform } : {},
68929
- ...options.architecture ? { architecture: options.architecture } : {}
68930
- });
68941
+ let contextPromise;
68942
+ const installedContext = () => {
68943
+ contextPromise ??= resolveInstalledUpdateContext({
68944
+ hostRuntimePath: options.hostRuntimePath,
68945
+ ...options.environment ? { environment: options.environment } : {},
68946
+ ...options.platform ? { platform: options.platform } : {},
68947
+ ...options.architecture ? { architecture: options.architecture } : {}
68948
+ });
68949
+ return contextPromise;
68950
+ };
68931
68951
  const fetchLatest = options.fetchLatest ?? ((signal) => fetchLatestGitHubRelease({ signal: signal ?? AbortSignal.timeout(15e3) }));
68932
68952
  let candidate = null;
68933
68953
  async function latestStatus(context) {
@@ -68953,7 +68973,7 @@ function createHostUpdateCoordinator(options) {
68953
68973
  async check(signal) {
68954
68974
  let context;
68955
68975
  try {
68956
- context = await contextPromise;
68976
+ context = await installedContext();
68957
68977
  await recoverUpdateOperationLock(context.common.stateDirectory);
68958
68978
  await cleanupTerminalUpdateState(context.common.stateDirectory);
68959
68979
  } catch (error54) {
@@ -69008,7 +69028,7 @@ function createHostUpdateCoordinator(options) {
69008
69028
  }
69009
69029
  },
69010
69030
  async start() {
69011
- const context = await contextPromise;
69031
+ const context = await installedContext();
69012
69032
  await recoverUpdateOperationLock(context.common.stateDirectory);
69013
69033
  const lock = await acquireUpdateOperationLock(context.common.stateDirectory);
69014
69034
  if (!lock) {
@@ -69076,7 +69096,7 @@ function createHostUpdateCoordinator(options) {
69076
69096
  },
69077
69097
  async status() {
69078
69098
  try {
69079
- const context = await contextPromise;
69099
+ const context = await installedContext();
69080
69100
  await recoverUpdateOperationLock(context.common.stateDirectory);
69081
69101
  return { status: await latestStatus(context) };
69082
69102
  } catch {
package/bin/codexhost CHANGED
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexhost/cli-linux-x64",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.",
5
5
  "type": "module",
6
6
  "files": [