contextswitch 0.1.8 → 0.1.10

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.
@@ -190,6 +190,8 @@ ${script}`);
190
190
  detached: true,
191
191
  stdio: "ignore"
192
192
  });
193
+ proc2.on("error", () => {
194
+ });
193
195
  proc2.unref();
194
196
  return proc2.pid || 0;
195
197
  } catch {
@@ -203,18 +205,24 @@ ${script}`);
203
205
  debug("process", `PowerShell script:
204
206
  ${psScript}`);
205
207
  const useTab = mode === "tab";
206
- try {
207
- const wtArgs = useTab ? ["-w", "0", "nt", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile] : ["powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile];
208
- const proc2 = spawn("wt.exe", wtArgs, {
209
- detached: true,
210
- stdio: "ignore",
211
- windowsHide: false
212
- });
213
- proc2.unref();
214
- debug("process", "Launched via Windows Terminal (wt.exe)");
215
- return proc2.pid || 0;
216
- } catch {
217
- debug("process", "Windows Terminal not available, falling back");
208
+ const wtInstalled = this.isCommandAvailable("wt.exe");
209
+ debug("process", `Windows Terminal available: ${wtInstalled}`);
210
+ if (wtInstalled) {
211
+ try {
212
+ const wtArgs = useTab ? ["-w", "0", "nt", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile] : ["powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile];
213
+ const proc2 = spawn("wt.exe", wtArgs, {
214
+ detached: true,
215
+ stdio: "ignore",
216
+ windowsHide: false
217
+ });
218
+ proc2.on("error", () => {
219
+ });
220
+ proc2.unref();
221
+ debug("process", "Launched via Windows Terminal (wt.exe)");
222
+ return proc2.pid || 0;
223
+ } catch {
224
+ debug("process", "Windows Terminal launch failed, falling back");
225
+ }
218
226
  }
219
227
  try {
220
228
  const proc2 = spawn("cmd.exe", ["/c", "start", "powershell", "-ExecutionPolicy", "Bypass", "-File", psScriptFile], {
@@ -222,6 +230,8 @@ ${psScript}`);
222
230
  stdio: "ignore",
223
231
  windowsHide: false
224
232
  });
233
+ proc2.on("error", () => {
234
+ });
225
235
  proc2.unref();
226
236
  debug("process", "Launched via PowerShell (cmd start)");
227
237
  return proc2.pid || 0;
@@ -236,6 +246,8 @@ ${psScript}`);
236
246
  stdio: "ignore",
237
247
  windowsHide: false
238
248
  });
249
+ proc2.on("error", () => {
250
+ });
239
251
  proc2.unref();
240
252
  debug("process", "Launched via Git Bash");
241
253
  return proc2.pid || 0;
@@ -369,6 +381,18 @@ ${psScript}`);
369
381
  }
370
382
  return parts;
371
383
  }
384
+ /**
385
+ * Check if a command is available on the system PATH.
386
+ */
387
+ isCommandAvailable(cmd) {
388
+ try {
389
+ const which = this.platform === "win32" ? "where" : "which";
390
+ execSync(`${which} ${cmd}`, { stdio: "ignore" });
391
+ return true;
392
+ } catch {
393
+ return false;
394
+ }
395
+ }
372
396
  findGitBash() {
373
397
  if (this.platform !== "win32") return null;
374
398
  const candidates = [
@@ -401,7 +425,7 @@ ${psScript}`);
401
425
  const output = execSync("where claude", { encoding: "utf-8" }).trim();
402
426
  const candidates = output.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
403
427
  debug("process", `'where claude' returned ${candidates.length} result(s): ${candidates.join(", ")}`);
404
- const cliIndicators = ["npm", "node_modules", "bun", "nvm", ".volta", "Roaming"];
428
+ const cliIndicators = ["npm", "node_modules", "bun", "nvm", ".volta", "Roaming", ".local\\bin", ".local/bin"];
405
429
  const guiIndicators = ["Program Files", "AppData\\Local\\claude", "AppData\\Local\\Programs\\claude"];
406
430
  for (const candidate of candidates) {
407
431
  const isLikelyCLI = cliIndicators.some((ind) => candidate.toLowerCase().includes(ind.toLowerCase()));
@@ -430,6 +454,8 @@ ${psScript}`);
430
454
  // npm global installs
431
455
  join(process.env.APPDATA || "", "npm", "claude.cmd"),
432
456
  join(process.env.APPDATA || "", "npm", "claude"),
457
+ // .local/bin (common default for Claude Code CLI)
458
+ join(process.env.USERPROFILE || "", ".local", "bin", "claude.exe"),
433
459
  // bun installs
434
460
  join(process.env.USERPROFILE || "", ".bun", "bin", "claude.exe"),
435
461
  // Volta
package/dist/cli.js CHANGED
@@ -24,7 +24,7 @@ function getVersion() {
24
24
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
25
25
  return packageJson.version;
26
26
  } catch {
27
- return "0.1.8";
27
+ return "0.1.10";
28
28
  }
29
29
  }
30
30
  function processSessionFallbackMarker() {
@@ -193,7 +193,7 @@ program.command("switch <domain>").description("Switch to a domain and launch Cl
193
193
  console.error(pc.red(`\u274C Invalid launch mode '${options.mode}'. Must be: window, tab, or inline`));
194
194
  process.exit(1);
195
195
  }
196
- const { switchCommand } = await import("./switch-HUW2NAZD.js");
196
+ const { switchCommand } = await import("./switch-B76YGZCJ.js");
197
197
  await switchCommand(domain, options);
198
198
  });
199
199
  program.command("reset <domain>").description("Reset a domain session (archives current session by default)").option("--skip-archive", "Skip archiving the current session").option("-f, --force", "Skip confirmation prompt").action(async (domain, options) => {
@@ -299,7 +299,7 @@ domainCmd.command("remove <name>").alias("rm").description("Remove a domain from
299
299
  }
300
300
  });
301
301
  program.command("doctor").description("Check system configuration and diagnose issues").action(async () => {
302
- const { processManager } = await import("./process-AKHWPKQE.js");
302
+ const { processManager } = await import("./process-AOZWZKS4.js");
303
303
  console.log(pc.cyan("\u{1FA7A} Running diagnostics...\n"));
304
304
  const failures = [];
305
305
  const claudeInstalled = processManager.verifyClaudeInstalled();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ProcessManager,
3
3
  processManager
4
- } from "./chunk-7GF2GND2.js";
4
+ } from "./chunk-COZ4MN2L.js";
5
5
  import "./chunk-F36TGFK2.js";
6
6
  export {
7
7
  ProcessManager,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MGIXKKM6.js";
4
4
  import {
5
5
  processManager
6
- } from "./chunk-7GF2GND2.js";
6
+ } from "./chunk-COZ4MN2L.js";
7
7
  import {
8
8
  LAUNCH_MODES,
9
9
  configManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contextswitch",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Domain-based context management for Claude Code CLI",
5
5
  "main": "dist/cli.js",
6
6
  "type": "module",