contextswitch 0.1.11 → 0.1.12

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/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.11";
27
+ return "0.1.12";
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-CJZHDQYU.js");
196
+ const { switchCommand } = await import("./switch-7VRJ5KEK.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) => {
@@ -43,9 +43,14 @@ async function switchCommand(domainName, options = {}) {
43
43
  const domain = configManager.loadDomain(domainName);
44
44
  const state = configManager.loadState();
45
45
  if (state.activeDomain === domainName && !options.force) {
46
- console.log(pc.yellow(`Domain '${domainName}' is already active.`));
47
- console.log(pc.gray("Use --force to restart the session."));
48
- return;
46
+ const runningProcesses = processManager.findClaudeProcesses();
47
+ if (runningProcesses.length > 0) {
48
+ console.log(pc.yellow(`Domain '${domainName}' is already active with a running Claude session.`));
49
+ console.log(pc.gray("Use --force to restart the session."));
50
+ return;
51
+ }
52
+ debug("switch", `Domain '${domainName}' is active but no Claude process found, relaunching`);
53
+ console.log(pc.gray("Session ended. Relaunching Claude..."));
49
54
  }
50
55
  console.log(pc.gray("Terminating existing Claude sessions..."));
51
56
  await processManager.killAllClaudeProcesses();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contextswitch",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Domain-based context management for Claude Code CLI",
5
5
  "main": "dist/cli.js",
6
6
  "type": "module",