claude-code-session-manager 0.104.2 → 0.105.0

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 (77) hide show
  1. package/README.md +15 -3
  2. package/bin/cli.cjs +0 -5
  3. package/dist/assets/{AgentLibrary-QPw9gC_o.js → AgentLibrary-BDtr4oI-.js} +1 -1
  4. package/dist/assets/{Button-8RAbgh1d.js → Button-CuXBCQDp.js} +1 -1
  5. package/dist/assets/{DataModel-BEkuOZuS.js → DataModel-DmvRipT5.js} +1 -1
  6. package/dist/assets/{History-BLrNSazM.js → History-B-v9pwwr.js} +1 -1
  7. package/dist/assets/{Hooks-C8P6wQq1.js → Hooks-S_0oHHlr.js} +1 -1
  8. package/dist/assets/{Library-CWFvBZw-.js → Library-BcbGJxQ3.js} +1 -1
  9. package/dist/assets/{ListDetail-B1jVMgzN.js → ListDetail-DtqHqJHt.js} +1 -1
  10. package/dist/assets/{MarkdownEditor-JrnUbWjW.js → MarkdownEditor-B56sPp_l.js} +1 -1
  11. package/dist/assets/{McpServers-BGqTxDBm.js → McpServers-D5VnmxAn.js} +1 -1
  12. package/dist/assets/{Memory-h8bhRNyI.js → Memory-0yGZLyRP.js} +1 -1
  13. package/dist/assets/{Panel-srf0FT0m.js → Panel-NoAADJwx.js} +1 -1
  14. package/dist/assets/{Permissions-BA4oWydI.js → Permissions-D2Dh-ee8.js} +1 -1
  15. package/dist/assets/{Plugins-DTuTQqUL.js → Plugins-kGoUgS9b.js} +2 -2
  16. package/dist/assets/{ProvenanceBadge-BW18EquH.js → ProvenanceBadge-CHwDFTX7.js} +1 -1
  17. package/dist/assets/{SaveBar-Cc6UukFa.js → SaveBar-BtKNMIYK.js} +1 -1
  18. package/dist/assets/{Scheduler-BctPlNL1.js → Scheduler-B0_kMMDs.js} +1 -1
  19. package/dist/assets/{ScopeSwitcher-DV1OnSuc.js → ScopeSwitcher-BusohWZ5.js} +1 -1
  20. package/dist/assets/{Settings-Bpyt1RGa.js → Settings-DuRJntaE.js} +1 -1
  21. package/dist/assets/{SkillReferenceGraph-B28AYo12.js → SkillReferenceGraph-BHOdIpsy.js} +1 -1
  22. package/dist/assets/{Skills-zXLI5OB_.js → Skills-DSTLZimI.js} +1 -1
  23. package/dist/assets/{SystemPrompt-DKoN0UAV.js → SystemPrompt-BG7wFWdb.js} +1 -1
  24. package/dist/assets/{TagLibrary-BkDOa8IM.js → TagLibrary-Bx27aE3_.js} +1 -1
  25. package/dist/assets/{TiptapBody-CIY1f6mI.js → TiptapBody-j0O8J7YI.js} +1 -1
  26. package/dist/assets/{Toggle-C139wuAK.js → Toggle-DzVZ6rC7.js} +1 -1
  27. package/dist/assets/{ViewTabs-CUEfsMOe.js → ViewTabs-BizjuynT.js} +1 -1
  28. package/dist/assets/{index-D89EUizB.css → index-BLVzrc4k.css} +1 -1
  29. package/dist/assets/{index-DrvxIbmR.js → index-CLIaYljt.js} +416 -416
  30. package/dist/assets/{settingsSchema-CAFckLz6.js → settingsSchema-7MRAxaJk.js} +1 -1
  31. package/dist/assets/useAgentsDirWatch-BUwfU2Kq.js +1 -0
  32. package/dist/assets/{useConfigDirWatch-QKxfZx9X.js → useConfigDirWatch-ot0VYwQC.js} +1 -1
  33. package/dist/index.html +2 -2
  34. package/package.json +10 -12
  35. package/plugins/session-manager-dev/skills/builder/3-publish/SKILL.md +12 -0
  36. package/plugins/session-manager-dev/skills/develop/SKILL.md +4 -2
  37. package/scripts/scheduler-mcp-server.cjs +7 -17
  38. package/src/main/build-info.json +4 -4
  39. package/src/main/chatRunner.cjs +4 -4
  40. package/src/main/historyAggregator.cjs +7 -1
  41. package/src/main/index.cjs +34 -1
  42. package/src/main/lib/agentPersonaSchema.cjs +8 -1
  43. package/src/main/lib/appRuntime.cjs +57 -0
  44. package/src/main/lib/childWithLog.cjs +10 -10
  45. package/src/main/lib/claudeBin.cjs +40 -16
  46. package/src/main/lib/cleanEnv.cjs +29 -6
  47. package/src/main/lib/defaultShell.cjs +36 -0
  48. package/src/main/lib/definitionOfDone.cjs +6 -2
  49. package/src/main/lib/delegationReadiness.cjs +13 -5
  50. package/src/main/lib/gitWorktree.cjs +6 -3
  51. package/src/main/lib/insideHome.cjs +15 -4
  52. package/src/main/lib/killTree.cjs +80 -0
  53. package/src/main/lib/loadGate.cjs +16 -0
  54. package/src/main/lib/loginShellPath.cjs +82 -0
  55. package/src/main/lib/machineProfile.cjs +4 -2
  56. package/src/main/lib/mcpStdioServer.cjs +127 -0
  57. package/src/main/lib/openExternalApp.cjs +62 -11
  58. package/src/main/lib/otlpTraceExporter.cjs +147 -0
  59. package/src/main/lib/prereqs.cjs +145 -0
  60. package/src/main/lib/procIdentity.cjs +37 -2
  61. package/src/main/lib/rcaReport.cjs +1 -0
  62. package/src/main/lib/reaperHelpers.cjs +5 -2
  63. package/src/main/lib/shippedPersonaSeeds.cjs +10 -0
  64. package/src/main/lib/timeoutShimScript.cjs +14 -2
  65. package/src/main/lib/updateCheck.cjs +41 -11
  66. package/src/main/lib/watchdogHelpers.cjs +23 -3
  67. package/src/main/lib/winSpawn.cjs +67 -0
  68. package/src/main/otel.cjs +18 -62
  69. package/src/main/pty.cjs +32 -11
  70. package/src/main/runVerify.cjs +42 -2
  71. package/src/main/scheduler.cjs +105 -20
  72. package/src/main/seedSchedulerMcp.cjs +11 -2
  73. package/src/preload/api.d.ts +14 -0
  74. package/src/preload/index.cjs +2 -0
  75. package/src/seed/agents/validator.md +2 -2
  76. package/dist/assets/useAgentsDirWatch-XhQEVlaK.js +0 -1
  77. package/scripts/postinstall.cjs +0 -52
@@ -38,6 +38,7 @@ const { spawn } = require('node:child_process');
38
38
  const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claudeBin.cjs');
39
39
  const { cleanChildEnv, pathWithUserBins } = require('./lib/cleanEnv.cjs');
40
40
  const { writeJsonSync } = require('./config.cjs');
41
+ const { nodeSpawnSpec } = require('./lib/appRuntime.cjs');
41
42
 
42
43
  const SERVER_NAME = 'session-manager-scheduler';
43
44
  const MAX_ATTEMPTS = 3; // give a transient first-boot failure a few chances
@@ -102,6 +103,14 @@ function scriptPathMissing() {
102
103
  }
103
104
  }
104
105
 
106
+ /** argv for `claude mcp add`: system `node` in dev/npx, the app binary with
107
+ * ELECTRON_RUN_AS_NODE=1 when packaged (an installer user may have no Node). */
108
+ function mcpAddArgv(serverPath) {
109
+ const spec = nodeSpawnSpec(serverPath);
110
+ const envFlags = Object.entries(spec.env).flatMap(([k, v]) => ['-e', `${k}=${v}`]);
111
+ return ['mcp', 'add', SERVER_NAME, '--scope', 'user', ...envFlags, '--', spec.command, ...spec.args];
112
+ }
113
+
105
114
  /** Run `claude mcp add session-manager-scheduler --scope user -- node <serverPath>`.
106
115
  * No shell:true — argv array passed directly to spawn. */
107
116
  function runClaudeMcpAdd(serverPath) {
@@ -111,7 +120,7 @@ function runClaudeMcpAdd(serverPath) {
111
120
  try {
112
121
  proc = spawn(
113
122
  target.command,
114
- ['mcp', 'add', SERVER_NAME, '--scope', 'user', '--', 'node', serverPath],
123
+ mcpAddArgv(serverPath),
115
124
  {
116
125
  ...(target.argv0 ? { argv0: target.argv0 } : {}),
117
126
  cwd: os.homedir(),
@@ -200,4 +209,4 @@ async function seedSchedulerMcp({ logger = console, addFn = runClaudeMcpAdd, rem
200
209
  }
201
210
  }
202
211
 
203
- module.exports = { seedSchedulerMcp, markerPath, MAX_ATTEMPTS, serverScriptPath, SERVER_NAME };
212
+ module.exports = { seedSchedulerMcp, mcpAddArgv, markerPath, MAX_ATTEMPTS, serverScriptPath, SERVER_NAME };
@@ -1,5 +1,15 @@
1
1
  import type { PromptSession } from '../renderer/state/promptSessions';
2
2
 
3
+ /** Mirrors the item shape returned by main/lib/prereqs.cjs checkPrereqs(). */
4
+ export interface PrereqItem {
5
+ id: string;
6
+ label: string;
7
+ ok: boolean;
8
+ version: string | null;
9
+ detail: string | null;
10
+ fix: { command: string; shell: 'sh' | 'powershell'; url?: string } | null;
11
+ }
12
+
3
13
  export interface ActionOutcome {
4
14
  ok: boolean;
5
15
  kind?: 'info' | 'warn' | 'error';
@@ -1550,6 +1560,10 @@ export interface SessionManagerAPI {
1550
1560
  /** Boot diagnostic — resolved claude binary path + whether it was found
1551
1561
  * on disk (false means spawn will rely on PATH and may ENOENT). */
1552
1562
  claudeBinStatus: () => Promise<{ resolved: string; foundOnDisk: boolean }>;
1563
+ /** Fresh prerequisite probe (git, claude CLI, auth, Git Bash on Windows). */
1564
+ prereqs: () => Promise<PrereqItem[]>;
1565
+ /** Opens the OS terminal running the item's official install command (looked up main-side by id). */
1566
+ prereqsRunFix: (id: string) => Promise<{ ok: true; opener: string } | { ok: false; error: string }>;
1553
1567
  /** Boot diagnostic — assertCwdInsideHome(os.homedir()) result. ok=false
1554
1568
  * on macOS symlinked-/Users mismatch and blocks all session spawns. */
1555
1569
  homeSelfCheck: () => Promise<{ ok: boolean; error?: string; realCwd?: string }>;
@@ -20,6 +20,8 @@ contextBridge.exposeInMainWorld('api', {
20
20
  // Boot diagnostics (v0.10.1) — renderer polls at mount to surface
21
21
  // missing-claude-bin / home-symlink-mismatch as toasts.
22
22
  claudeBinStatus: () => ipcRenderer.invoke('app:claude-bin-status'),
23
+ prereqs: () => ipcRenderer.invoke('app:prereqs'),
24
+ prereqsRunFix: (id) => ipcRenderer.invoke('app:prereqs-run-fix', id),
23
25
  homeSelfCheck: () => ipcRenderer.invoke('app:home-self-check'),
24
26
  seedStatus: () => ipcRenderer.invoke('app:seed-status'),
25
27
  delegationReadiness: (cwd) => ipcRenderer.invoke('app:delegation-readiness', { cwd }),
@@ -4,14 +4,14 @@ description: Validates a finished PLAN (the PRDs its validate PRD lists) once, a
4
4
  tools: Read, Grep, Glob, Bash
5
5
  model: sonnet
6
6
  title: Engineering — Plan Validator
7
- seedVersion: 2
7
+ seedVersion: 3
8
8
  ---
9
9
 
10
10
  You are validator. You judge whether a plan's PRDs actually landed what they promised. You do not fix anything, you do not re-implement, you do not queue PRDs — your output is evidence and verdicts, read by the architect who owns the plan.
11
11
 
12
12
  ## Inputs
13
13
 
14
- Your PRD's `# Acceptance criteria` lists the plan's PRD slugs and where each PRD file lives (`session-manager-operations/scheduler/epics/<epic>/prds/` while queued, `prds-archived/` once terminal — locate by slug in either). Everything else comes from the working tree and `git log`.
14
+ Your PRD's `# Acceptance criteria` lists the plan's PRD slugs. PRD files live under `$SM_PROJECT_ROOT/session-manager-operations/scheduler/epics/<epic>/` — `prds/` while queued, `prds-archived/` (or a timestamped subfolder of it) once terminal; find by slug, e.g. `find "$SM_PROJECT_ROOT/session-manager-operations/scheduler/epics/<epic>" -name '*<slug>.md'`. This folder is gitignored, so it is never present in the job worktree — don't look for it there. If a PRD file is missing, fall back to `$SM_PROJECT_ROOT/session-manager-operations/scheduler/state/queue.json` / `history.jsonl` for that slug's `landedCommit`, and record the missing file as a Minor (not Important) finding. Everything else comes from the working tree and `git log`.
15
15
 
16
16
  ## Procedure (in this order)
17
17
 
@@ -1 +0,0 @@
1
- import{aS as u}from"./index-DrvxIbmR.js";import{u as a}from"./useConfigDirWatch-QKxfZx9X.js";function r(e,s){const o=u();a([o?`${o}/.claude/agents`:null,e?`${e}/.claude/agents`:null],s)}export{r as u};
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- /**
5
- * postinstall — rebuild node-pty against the bundled Electron's ABI.
6
- *
7
- * The terminal needs node-pty's native binary to match the Electron we ship.
8
- * We run electron-rebuild, but a failure here MUST NOT fail `npm i -g` — that
9
- * would block the entire app (config tabs, scheduler, etc.) over one native
10
- * module. So we run it best-effort and, on failure, print the exact manual fix
11
- * and exit 0. pty.cjs surfaces the same guidance in-app if a tab can't start.
12
- */
13
-
14
- const { spawnSync } = require('node:child_process');
15
- const fs = require('node:fs');
16
- const path = require('node:path');
17
-
18
- // Resolve the electron-rebuild bin from THIS package's own node_modules first,
19
- // so a global install never has `npx` reach out to the registry (and risk
20
- // pulling the wrong/deprecated `electron-rebuild` package). Fall back to npx.
21
- function rebuildArgv() {
22
- const pkgRoot = path.join(__dirname, '..');
23
- const local = path.join(pkgRoot, 'node_modules', '.bin', process.platform === 'win32' ? 'electron-rebuild.cmd' : 'electron-rebuild');
24
- if (fs.existsSync(local)) return [local, ['-f', '-w', 'node-pty']];
25
- return [process.platform === 'win32' ? 'npx.cmd' : 'npx', ['electron-rebuild', '-f', '-w', 'node-pty']];
26
- }
27
-
28
- function run() {
29
- const [cmd, args] = rebuildArgv();
30
- const r = spawnSync(cmd, args, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
31
- return r.status === 0 && !r.error;
32
- }
33
-
34
- if (run()) process.exit(0);
35
-
36
- const mac = process.platform === 'darwin';
37
- const bar = '─'.repeat(64);
38
- console.warn(`\n${bar}`);
39
- console.warn('claude-code-session-manager: node-pty rebuild did not complete.');
40
- console.warn('The app will still launch, but terminal tabs may not start until');
41
- console.warn('the native module is rebuilt for this Electron. To fix it:');
42
- console.warn('');
43
- console.warn(' cd "' + __dirname.replace(/\/scripts$/, '') + '"');
44
- console.warn(' npx electron-rebuild -f -w node-pty');
45
- if (mac) {
46
- console.warn('');
47
- console.warn(' # macOS: if the rebuild fails, install the compiler first:');
48
- console.warn(' xcode-select --install');
49
- }
50
- console.warn(`${bar}\n`);
51
- // Exit 0 — never fail the install over the terminal native module.
52
- process.exit(0);