claude-code-session-manager 0.57.0 → 0.57.1

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/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Geist:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
10
- <script type="module" crossorigin src="./assets/index-DdVGnaCd.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-DCa3QvAi.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="./assets/monaco-editor-BW5C4Iv1.js">
12
12
  <link rel="stylesheet" crossorigin href="./assets/monaco-editor-BTnBOi8r.css">
13
13
  <link rel="stylesheet" crossorigin href="./assets/index-WUc_GHMf.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-session-manager",
3
- "version": "0.57.0",
3
+ "version": "0.57.1",
4
4
  "description": "Local cockpit for the Claude Code CLI — multi-tab terminal, full config surface, scheduler, voice dictation, and live observability.",
5
5
  "type": "module",
6
6
  "main": "src/main/index.cjs",
@@ -36,8 +36,20 @@ function old(overrides = {}) {
36
36
  }
37
37
 
38
38
  let queueHistory;
39
+ let prevOverride;
39
40
 
40
41
  beforeEach(() => {
42
+ // Point HISTORY_PATH at an isolated tmpdir file (SM_HISTORY_PATH_OVERRIDE)
43
+ // instead of the real machine-global history.jsonl — a live Electron
44
+ // instance's scheduler.cjs writes that same global file concurrently,
45
+ // which races this suite's unlink/append calls and produces real
46
+ // production data in place of the expected empty state.
47
+ prevOverride = process.env.SM_HISTORY_PATH_OVERRIDE;
48
+ process.env.SM_HISTORY_PATH_OVERRIDE = path.join(
49
+ os.tmpdir(),
50
+ `queueHistory-test-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2)}.jsonl`
51
+ );
52
+
41
53
  // Fresh require per test so HISTORY_PATH's target file starts clean.
42
54
  delete require.cache[require.resolve('../lib/queueHistory.cjs')];
43
55
  queueHistory = require('../lib/queueHistory.cjs');
@@ -46,6 +58,8 @@ beforeEach(() => {
46
58
 
47
59
  afterEach(() => {
48
60
  try { fs.unlinkSync(queueHistory.HISTORY_PATH); } catch { /* ok if absent */ }
61
+ if (prevOverride === undefined) delete process.env.SM_HISTORY_PATH_OVERRIDE;
62
+ else process.env.SM_HISTORY_PATH_OVERRIDE = prevOverride;
49
63
  });
50
64
 
51
65
  // ---------- partitionJobs ----------
@@ -21,10 +21,22 @@ const { projectHistoryPath, stateCwds } = require('./queueStore.cjs');
21
21
  // resolved via queueStore.cjs). Old rows stay readable from here; new appends
22
22
  // go to the owning project's shard (entries without a cwd still land here so
23
23
  // nothing is ever dropped).
24
- const HISTORY_PATH = path.join(os.homedir(), '.claude', 'session-manager', 'scheduled-plans', 'history.jsonl');
24
+ //
25
+ // Overridable via SM_HISTORY_PATH_OVERRIDE so queueHistory.test.cjs can point
26
+ // this at an isolated tmpdir path instead of racing a live Electron
27
+ // instance's scheduler.cjs, which writes this same machine-global file.
28
+ const HISTORY_PATH = process.env.SM_HISTORY_PATH_OVERRIDE
29
+ || path.join(os.homedir(), '.claude', 'session-manager', 'scheduled-plans', 'history.jsonl');
25
30
 
26
- /** Every history file currently in play: each project's shard + the legacy global. */
31
+ /**
32
+ * Every history file currently in play: each project's shard + the legacy
33
+ * global. Under SM_HISTORY_PATH_OVERRIDE (queueHistory.test.cjs), skip the
34
+ * federated per-project shards entirely — they're real files under whatever
35
+ * projects exist on this machine's ~/.claude/projects, so including them
36
+ * would leak real production history rows into an otherwise-isolated test.
37
+ */
27
38
  function historyPaths() {
39
+ if (process.env.SM_HISTORY_PATH_OVERRIDE) return [HISTORY_PATH];
28
40
  const paths = [];
29
41
  for (const cwd of stateCwds()) {
30
42
  try { paths.push(projectHistoryPath(cwd)); } catch { /* unusable cwd */ }