claudish 14.18.3 → 14.18.4

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/dist/index.js +22 -6
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -5494,7 +5494,7 @@ var init_onepassword_config = __esm(() => {
5494
5494
  });
5495
5495
 
5496
5496
  // src/version.ts
5497
- var VERSION = "14.18.3";
5497
+ var VERSION = "14.18.4";
5498
5498
 
5499
5499
  // src/redact.ts
5500
5500
  function isPlaceholder(value) {
@@ -98593,6 +98593,8 @@ async function computeMainThreadContextWindow(config, cachePath) {
98593
98593
  let min = Number.POSITIVE_INFINITY;
98594
98594
  const unresolved = [];
98595
98595
  for (const spec of specs) {
98596
+ if (signalShutdownExitCode() !== null)
98597
+ break;
98596
98598
  try {
98597
98599
  const resolved = await resolveLocalContextWindow(spec, cachePath);
98598
98600
  if (!resolved)
@@ -98725,6 +98727,7 @@ async function runClaudeWithProxy(config, proxyUrl, onCleanup) {
98725
98727
  statusLine,
98726
98728
  tokenFilePath
98727
98729
  } = createTempSettingsFile(modelId ?? "default", port, proxyAuthMode, userStatusLineCommand);
98730
+ const signalShutdown = setupSignalHandlers(tempSettingsPath, config.quiet, onCleanup);
98728
98731
  mergeUserSettingsIfPresent(config, tempSettingsPath, statusLine, proxyAuthMode);
98729
98732
  const claudeArgs = [];
98730
98733
  claudeArgs.push("--settings", tempSettingsPath);
@@ -98864,6 +98867,11 @@ async function runClaudeWithProxy(config, proxyUrl, onCleanup) {
98864
98867
  `);
98865
98868
  }
98866
98869
  const claudeBinary = await findClaudeBinary();
98870
+ const stoppedBeforeSpawn = signalShutdownExitCode();
98871
+ if (stoppedBeforeSpawn !== null) {
98872
+ signalShutdown.removeSettingsFile();
98873
+ return stoppedBeforeSpawn;
98874
+ }
98867
98875
  if (!claudeBinary) {
98868
98876
  console.error("Error: Claude Code CLI not found");
98869
98877
  console.error("Install it from: https://claude.com/claude-code");
@@ -98926,6 +98934,7 @@ Or set CLAUDE_PATH to your custom installation:`);
98926
98934
  stdio,
98927
98935
  shell: needsShell
98928
98936
  });
98937
+ signalShutdown.attachClaudeCode(proc);
98929
98938
  if (wrap) {
98930
98939
  wrap.watch(proc);
98931
98940
  }
@@ -98992,7 +99001,6 @@ Or set CLAUDE_PATH to your custom installation:`);
98992
99001
  } catch {}
98993
99002
  });
98994
99003
  }
98995
- const signalShutdown = setupSignalHandlers(proc, tempSettingsPath, config.quiet, onCleanup);
98996
99004
  const { exitCode, exitSignal } = await new Promise((resolve) => {
98997
99005
  proc.on("exit", (code, signal) => {
98998
99006
  setClaudeCodeRunning(false);
@@ -99026,9 +99034,10 @@ function sessionOutcomeOf(exitCode) {
99026
99034
  function signalShutdownExitCode() {
99027
99035
  return signalShutdownCode;
99028
99036
  }
99029
- function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
99037
+ function setupSignalHandlers(tempSettingsPath, quiet, onCleanup) {
99030
99038
  const signals = isWindows2() ? ["SIGINT", "SIGTERM"] : ["SIGINT", "SIGTERM", "SIGHUP"];
99031
99039
  let shuttingDown = null;
99040
+ let claudeCode = null;
99032
99041
  let claudeCodeStopped = Promise.resolve();
99033
99042
  let settingsFileRemoved = false;
99034
99043
  const removeSettingsFile = () => {
@@ -99039,7 +99048,7 @@ function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
99039
99048
  unlinkSync11(tempSettingsPath);
99040
99049
  } catch {}
99041
99050
  };
99042
- const stopClaudeCode = async () => {
99051
+ const stopClaudeCode = async (proc) => {
99043
99052
  try {
99044
99053
  proc.kill("SIGTERM");
99045
99054
  if (await waitForExit(proc, SIGNAL_CHILD_EXIT_GRACE_MS))
@@ -99089,10 +99098,17 @@ function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
99089
99098
  console.error(`
99090
99099
  [claudish] Received ${signal}, shutting down...`);
99091
99100
  }
99092
- claudeCodeStopped = stopClaudeCode();
99101
+ if (claudeCode)
99102
+ claudeCodeStopped = stopClaudeCode(claudeCode);
99093
99103
  });
99094
99104
  }
99095
- return { removeSettingsFile, claudeCodeStopped: () => claudeCodeStopped };
99105
+ return {
99106
+ attachClaudeCode: (child) => {
99107
+ claudeCode = child;
99108
+ },
99109
+ removeSettingsFile,
99110
+ claudeCodeStopped: () => claudeCodeStopped
99111
+ };
99096
99112
  }
99097
99113
  async function findClaudeBinary(env = process.env) {
99098
99114
  const isWindows = process.platform === "win32";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "14.18.3",
3
+ "version": "14.18.4",
4
4
  "description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -71,10 +71,10 @@
71
71
  "ai"
72
72
  ],
73
73
  "optionalDependencies": {
74
- "@claudish/magmux-darwin-arm64": "14.18.3",
75
- "@claudish/magmux-darwin-x64": "14.18.3",
76
- "@claudish/magmux-linux-arm64": "14.18.3",
77
- "@claudish/magmux-linux-x64": "14.18.3"
74
+ "@claudish/magmux-darwin-arm64": "14.18.4",
75
+ "@claudish/magmux-darwin-x64": "14.18.4",
76
+ "@claudish/magmux-linux-arm64": "14.18.4",
77
+ "@claudish/magmux-linux-x64": "14.18.4"
78
78
  },
79
79
  "author": "Jack Rudenko <i@madappgang.com>",
80
80
  "license": "MIT",