claude-code-session-manager 0.129.0 → 0.130.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.
Files changed (97) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/assets/AgentLibrary-Dlhtc8Ty.js +2 -0
  3. package/dist/assets/AppSettings-A3KoPcmL.js +2 -0
  4. package/dist/assets/Button-DvTXa_-4.js +1 -0
  5. package/dist/assets/Extensions-Ddb4sQpO.js +13 -0
  6. package/dist/assets/{History-B2x-LMlT.js → History-DcnZxMoU.js} +2 -2
  7. package/dist/assets/Library-LftcMs6C.js +32 -0
  8. package/dist/assets/ListDetail-CnL1azR0.js +1 -0
  9. package/dist/assets/{Memory-CnalwnFf.js → Memory-smN9-Yoo.js} +8 -8
  10. package/dist/assets/{Panel-BzIklgKf.js → Panel-CA6TdCHv.js} +1 -1
  11. package/dist/assets/ProvenanceBadge-Y3DhyiJo.js +1 -0
  12. package/dist/assets/Scheduler-Ca1qo_kp.js +16 -0
  13. package/dist/assets/Settings-BFwlV-as.js +2 -0
  14. package/dist/assets/{SkillReferenceGraph-DOhiCxuL.js → SkillReferenceGraph-2WMsKdmr.js} +1 -1
  15. package/dist/assets/SourceChip-CeprSxwb.js +1 -0
  16. package/dist/assets/SystemPrompt-B8TXIGXo.js +1 -0
  17. package/dist/assets/{TiptapBody-Du6jRBoW.js → TiptapBody-BvxcQ_tS.js} +1 -1
  18. package/dist/assets/{Toggle-Qdi2Z7VD.js → Toggle-keTV_HDb.js} +1 -1
  19. package/dist/assets/ViewTabs-fupn9keJ.js +1 -0
  20. package/dist/assets/VoiceButton-5ETBv9eI.js +1 -0
  21. package/dist/assets/{historyTotals-8ecP_6wF.js → historyTotals-NAZqiuzd.js} +1 -1
  22. package/dist/assets/{index-DtdWBGrI.css → index-Bp8XE9A6.css} +1 -1
  23. package/dist/assets/index-QJxszEhM.js +3086 -0
  24. package/dist/index.html +2 -2
  25. package/dist-web/app.css +1 -1
  26. package/dist-web/app.js +396 -412
  27. package/package.json +1 -1
  28. package/plugins/CLAUDE.md +2 -2
  29. package/plugins/session-manager-dev/.claude-plugin/plugin.json +2 -2
  30. package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +2 -2
  31. package/plugins/session-manager-dev/skills/develop/SKILL.md +3 -3
  32. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +62 -0
  33. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +169 -0
  34. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +183 -0
  35. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +39 -0
  36. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +79 -0
  37. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +400 -0
  38. package/scripts/scheduler-mcp-server.cjs +25 -6
  39. package/src/main/agentLibrary.cjs +36 -10
  40. package/src/main/build-info.json +4 -4
  41. package/src/main/config.cjs +15 -0
  42. package/src/main/health.cjs +49 -22
  43. package/src/main/index.cjs +19 -3
  44. package/src/main/ipcSchemas.cjs +36 -3
  45. package/src/main/lib/activeSessions.cjs +6 -2
  46. package/src/main/lib/claude/modelCatalog.cjs +15 -31
  47. package/src/main/lib/claudeConfig.cjs +156 -0
  48. package/src/main/lib/effectiveSettings.cjs +120 -0
  49. package/src/main/lib/epic/delegationReadiness.cjs +3 -3
  50. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +84 -11
  51. package/src/main/lib/git/gitWorktree.cjs +400 -9
  52. package/src/main/lib/git/runtimeStateUntrack.cjs +124 -0
  53. package/src/main/lib/mcpToolCatalog.cjs +8 -2
  54. package/src/main/lib/memoryDirResolve.cjs +2 -8
  55. package/src/main/lib/opsOwnership.cjs +63 -2
  56. package/src/main/lib/persona-macro/builtinMacros.cjs +30 -0
  57. package/src/main/lib/persona-macro/macroLibrary.cjs +34 -6
  58. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +22 -0
  59. package/src/main/lib/updateCheck.cjs +6 -1
  60. package/src/main/pluginInstall.cjs +100 -1
  61. package/src/main/promptSessionsIpc.cjs +39 -1
  62. package/src/main/scheduler.cjs +12 -2
  63. package/src/main/seedDevPlugin.cjs +2 -1
  64. package/src/main/templates/PRD_AUTHORING.md +3 -3
  65. package/src/main/updaterIpc.cjs +5 -1
  66. package/src/main/usage.cjs +5 -20
  67. package/src/main/voiceHotkey.cjs +16 -0
  68. package/src/main/voiceSettings.cjs +24 -0
  69. package/src/main/voiceWizard.cjs +27 -36
  70. package/src/preload/api.d.ts +53 -2
  71. package/src/preload/apiSurface.json +63 -7
  72. package/src/preload/index.cjs +12 -1
  73. package/src/seed/agents/demo-video-builder.md +2 -2
  74. package/src/seed/agents/validator.md +2 -2
  75. package/dist/assets/AgentLibrary-Cp250YHF.js +0 -2
  76. package/dist/assets/Button-DU5UF-6L.js +0 -1
  77. package/dist/assets/DataModel-CPf6f17e.js +0 -1
  78. package/dist/assets/Hooks-BWr33C4Q.js +0 -3
  79. package/dist/assets/Library-DBNLTAa8.js +0 -46
  80. package/dist/assets/ListDetail-BGBw6egp.js +0 -1
  81. package/dist/assets/McpServers-DywZ50Ec.js +0 -2
  82. package/dist/assets/Permissions-mgRifwQc.js +0 -3
  83. package/dist/assets/Plugins-CV42zfid.js +0 -2
  84. package/dist/assets/ProvenanceBadge-DYmX4xgB.js +0 -1
  85. package/dist/assets/SaveBar-DxrAfnlC.js +0 -1
  86. package/dist/assets/Scheduler-iyUl1NDl.js +0 -16
  87. package/dist/assets/ScopeSwitcher-CC8BDPgf.js +0 -1
  88. package/dist/assets/Settings-CWBnQghD.js +0 -4
  89. package/dist/assets/Skills-3Er-9YA9.js +0 -2
  90. package/dist/assets/SystemPrompt-BLxdvZ9K.js +0 -1
  91. package/dist/assets/TagLibrary-BZ6QHYMQ.js +0 -1
  92. package/dist/assets/ViewTabs-BKfFsziD.js +0 -1
  93. package/dist/assets/index-GI6F_j41.js +0 -3083
  94. package/dist/assets/listSkills-C1aWKf0T.js +0 -1
  95. package/dist/assets/settingsSchema-lHTHAabD.js +0 -1
  96. package/dist/assets/skillFrontmatter-8X1Uc282.js +0 -10
  97. package/dist/assets/useAgentsDirWatch-CcsoD1bp.js +0 -1
@@ -76,7 +76,7 @@ const {
76
76
  findLiveProcessForJob, logHasOutput, resolvePidlessGateOutcome, resolveCommitGuardOutcome,
77
77
  readSpawnedPidFromLog, readLogMtimeMs, isClaudeArgv,
78
78
  } = require('./lib/scheduler/reaperHelpers.cjs');
79
- const { resolveProjectRoot } = require('./lib/opsOwnership.cjs');
79
+ const { resolveProjectRoot, ensureRuntimeIgnores } = require('./lib/opsOwnership.cjs');
80
80
  const { sweepStrandedJobBranches } = require('./lib/git/branchSweep.cjs');
81
81
  const { detectRateLimitInLog } = require('./lib/claude/rateLimitDetect.cjs');
82
82
  const { stripAppOwnedChurn } = require('./lib/scheduler/jobDirtFilter.cjs');
@@ -1655,6 +1655,16 @@ async function reconcilePass(state) {
1655
1655
  if (shouldRunFlatSweep(phaseStartMs, lastFlatSweepMs, FLAT_SWEEP_INTERVAL_MS)) {
1656
1656
  lastFlatSweepMs = phaseStartMs;
1657
1657
  await prdPaths.consolidateAllFlatPrds(allProjectCwds(), skipCwds);
1658
+ // Runtime namespaces self-ignore (once per project root; throttled with the sweep).
1659
+ try {
1660
+ const roots = new Set();
1661
+ for (const c of allProjectCwds()) {
1662
+ try { roots.add(resolveProjectRoot(c)); } catch { /* ephemeral/invalid cwd */ }
1663
+ }
1664
+ for (const r of roots) {
1665
+ try { ensureRuntimeIgnores(r); } catch { /* best-effort */ }
1666
+ }
1667
+ } catch { /* best-effort */ }
1658
1668
  phaseMs.flatPrdSweep = Date.now() - phaseStartMs;
1659
1669
  } else {
1660
1670
  phaseMs.flatPrdSweep = 0;
@@ -6059,7 +6069,7 @@ async function finalizeJobWorktree({ job, runId = null, runDir, worktree, guardC
6059
6069
  console.error(`[scheduler] ${job.slug}: worktree branch integration FAILED (${integration.reason}) — branch ${worktree.branch} preserved in ${guardCwd} for manual recovery`);
6060
6070
  } else if (integration.integrated) {
6061
6071
  integratedSha = integration.sha || null;
6062
- console.log(`[scheduler] ${job.slug}: worktree branch ${worktree.branch} integrated into ${guardCwd}${integration.mergeCommit ? ' (merge commit)' : ' (fast-forward)'}`);
6072
+ console.log(`[scheduler] ${job.slug}: worktree branch ${worktree.branch} integrated into ${guardCwd}${integration.linear ? ' (linear replay)' : integration.mergeCommit ? ' (merge commit)' : ' (fast-forward)'}`);
6063
6073
  if (integration.autoResolved) {
6064
6074
  mergeAutoResolved = integration.autoResolved;
6065
6075
  mergeAutoResolvedPaths = integration.resolvedPaths || [];
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * First-boot seeder for the bundled `session-manager-dev` plugin.
3
3
  *
4
- * The plugin (3 skills under plugins/session-manager-dev/skills: builder, develop, send-feedback) ships inside the npx distribution. To make it
4
+ * The plugin (4 skills under plugins/session-manager-dev/skills: builder, develop,
5
+ * maintaining-md-network, send-feedback) ships inside the npx distribution. To make it
5
6
  * a true default, the app installs it on first launch from its own bundled
6
7
  * marketplace (offline — no GitHub/registry). Idempotent two ways:
7
8
  *
@@ -1,4 +1,4 @@
1
- <!-- PRD_AUTHORING.md v18 -->
1
+ <!-- PRD_AUTHORING.md v19 -->
2
2
  # PRD Authoring Guide — Scheduler Safety Rules
3
3
 
4
4
  Rule: every PRD you queue follows the rules below.
@@ -129,8 +129,8 @@ A short Epic-context digest is prepended automatically for orientation only —
129
129
 
130
130
  The executor can't ask you anything: no `ScheduleWakeup`, Cron, Monitor, `AskUserQuestion`, plan mode, or worktree tools; background tasks are off (a `timeout` command is always on PATH — the app installs a shim on macOS). It must never stop to ask a question — it makes the safest reasonable call and reports it, so write the PRD so that call is obvious.
131
131
 
132
- Worktree reach: every PRD runs in an isolated git worktree holding tracked files plus `node_modules` and non-uv `.venv`/`venv` symlinked from the main checkout; pnpm projects (pnpm-lock.yaml) get a worktree-local `node_modules` installed offline from the store, and uv projects (uv.lock) get a worktree-local env built by an offline frozen `uv sync`, not a symlink. Why: a pnpm install through the symlink purged the main checkout's node_modules (Bilko-Game-Academy 2026-10-18). A step that needs gitignored runtime state (databases, `downloads/`, browser profiles, logs) or a live side effect must address the main checkout by absolute path (e.g. `$HOME/Projects/<repo>/...`), be artifact-only (a deliverable artifact + `artifactPaths`, no tracked edits), and `dependsOn` the PRD that lands its tracked edits. A project may declare `worktreeSetup` gate-syntax commands in a tracked `.session-manager.json` at the repo root; they run once per fresh job worktree and baseline scratch worktree, before the executor starts, with cwd = the worktree root (a project in a subfolder names it, e.g. `timeout 600 godot --headless --path game --import`). Setups run one at a time per project and are never skipped; they must write only inside the worktree (node_modules and non-uv venvs are symlinks into the main checkout). The outcome is the `[scheduler] worktree setup:` lines at the top of the run log plus `worktreeSetup` in the run's meta.json. Host crontab installs stay human-only (see §14).
133
- Why: burrow PRD 1516 halted because its relative `.venv` python against `downloads/fb-tracker.db`, `scripts/install-cron.sh` and `pipeline-cron.sh --now` resolved inside the worktree (no runtime state; install-cron would bake a temporary worktree path into crontab), while sibling 1494 succeeded the same day using an absolute main-checkout path and artifact-only output. `scheduler_create_prd` warns on relative gitignored paths.
132
+ Worktree reach: every PRD runs in an isolated git worktree holding tracked files plus `node_modules` and non-uv `.venv`/`venv` symlinked from the main checkout; pnpm projects (pnpm-lock.yaml) get a worktree-local `node_modules` installed offline from the store, and uv projects (uv.lock) get a worktree-local env built by an offline frozen `uv sync`, not a symlink. Why: a pnpm install through the symlink purged the main checkout's node_modules (Bilko-Game-Academy 2026-10-18). A step that needs gitignored runtime state (databases, downloads/, browser profiles, logs) or a live side effect must address the main checkout by absolute path (e.g. `$HOME/Projects/<repo>/...`), be artifact-only (a deliverable artifact + `artifactPaths`, no tracked edits), and `dependsOn` the PRD that lands its tracked edits. A project may declare `worktreeSetup` gate-syntax commands in a tracked `.session-manager.json` at the repo root; they run once per fresh job worktree and baseline scratch worktree, before the executor starts, with cwd = the worktree root (a project in a subfolder names it, e.g. `timeout 600 godot --headless --path game --import`). Setups run one at a time per project and are never skipped; they must write only inside the worktree (node_modules and non-uv venvs are symlinks into the main checkout). The outcome is the `[scheduler] worktree setup:` lines at the top of the run log plus `worktreeSetup` in the run's meta.json. Host crontab installs stay human-only (see §14).
133
+ Why: burrow PRD 1516 halted because its relative `.venv` python against downloads/fb-tracker.db, scripts/install-cron.sh and `pipeline-cron.sh --now` resolved inside the worktree (no runtime state; install-cron would bake a temporary worktree path into crontab), while sibling 1494 succeeded the same day using an absolute main-checkout path and artifact-only output. `scheduler_create_prd` warns on relative gitignored paths.
134
134
 
135
135
  Rule: a job's processes never outlive it — the group sweep at exit, the job scope stop (systemd) and the 5-minute leftover sweep (Linux) stop anything it started, so `nohup` or `&` does not daemonize. Anything that must keep running goes to a service manager (systemd unit, cron), never `nohup` or `&`.
136
136
  Why: finished jobs left dev servers running for days, holding memory and ports.
@@ -73,7 +73,11 @@ function registerUpdaterIpc({ ipcMain, getWindow, ptyManager, deps = {} }) {
73
73
  const snapshot = () => ({ ...updater.status(), enabled });
74
74
  updater.subscribe(() => sendIfAlive(getWindow(), 'updater:status', snapshot()));
75
75
 
76
- ipcMain.handle('updater:status', () => snapshot());
76
+ // One status API: updater state plus the latest-version probe result (`check`), which honours `enabled`.
77
+ const checkResult = () => (d.getUpdateStatus || require('./lib/updateCheck.cjs').getUpdateStatus)({
78
+ deps: { isAutoUpdateEnabled: () => enabled },
79
+ });
80
+ ipcMain.handle('updater:status', async () => ({ ...snapshot(), check: await checkResult() }));
77
81
  ipcMain.handle('updater:check', async () => {
78
82
  await updater.checkNow();
79
83
  return snapshot();
@@ -23,6 +23,7 @@ const os = require('node:os');
23
23
  const { ipcMain } = require('electron');
24
24
  const { refreshIfNeeded, expiresAtMs } = require('./lib/credentials.cjs');
25
25
  const { writeJson } = require('./config.cjs');
26
+ const { effectiveSettings } = require('./lib/effectiveSettings.cjs');
26
27
  const { createUsageCircuit, singleFlight } = require('./lib/claude/usageCircuit.cjs');
27
28
 
28
29
  const USAGE_URL = 'https://api.anthropic.com/api/oauth/usage';
@@ -40,29 +41,13 @@ function envEnabled(v) {
40
41
  * not inherit the shell's environment, so `process.env` looks like a clean
41
42
  * consumer install even when `claude` itself is talking to a gateway.
42
43
  *
43
- * Precedence mirrors Claude Code: managed (enterprise) settings, then user
44
- * settings, then user-local settings. Missing/unreadable/invalid files are
44
+ * Precedence via lib/effectiveSettings.cjs: managed (enterprise) beats local beats user. Missing/unreadable/invalid files are
45
45
  * skipped. Returns `{ env, apiKeyHelper }`.
46
46
  */
47
47
  function readClaudeSettingsAuth() {
48
- const merged = {};
49
- let apiKeyHelper = false;
50
- const managed = process.platform === 'darwin'
51
- ? '/Library/Application Support/ClaudeCode/managed-settings.json'
52
- : '/etc/claude-code/managed-settings.json';
53
- const files = [
54
- managed,
55
- path.join(os.homedir(), '.claude', 'settings.json'),
56
- path.join(os.homedir(), '.claude', 'settings.local.json'),
57
- ];
58
- for (const f of files) {
59
- try {
60
- const data = JSON.parse(fs.readFileSync(f, 'utf8'));
61
- if (data && typeof data.env === 'object' && data.env) Object.assign(merged, data.env);
62
- if (data && data.apiKeyHelper) apiKeyHelper = true;
63
- } catch { /* missing / unreadable / invalid JSON → skip */ }
64
- }
65
- return { env: merged, apiKeyHelper };
48
+ const { merged } = effectiveSettings({ home: os.homedir() });
49
+ const env = merged.env && typeof merged.env === 'object' && !Array.isArray(merged.env) ? merged.env : {};
50
+ return { env, apiKeyHelper: !!merged.apiKeyHelper };
66
51
  }
67
52
 
68
53
  /**
@@ -17,6 +17,7 @@
17
17
 
18
18
  const { app, globalShortcut, ipcMain } = require('electron');
19
19
  const voiceSettings = require('./voiceSettings.cjs');
20
+ const voiceWizard = require('./voiceWizard.cjs');
20
21
  const { voiceHotkeyLog } = require('./lib/voice-hotkey-log.cjs');
21
22
  const { sendIfAlive } = require('./lib/sendToRenderer.cjs');
22
23
  const { schemas, validated } = require('./ipcSchemas.cjs');
@@ -324,6 +325,21 @@ function registerHotkeyHandlers() {
324
325
  return { ok: true };
325
326
  }));
326
327
 
328
+ // F7 wizard + F8 turn-detector (logic in voiceWizard.cjs; registered here
329
+ // so every voice:* handler lives in this one module).
330
+ ipcMain.handle('voice:wizard-state', () => voiceWizard.wizardState());
331
+ ipcMain.handle('voice:wizard-complete', () => voiceWizard.wizardComplete());
332
+ ipcMain.handle('voice:get-turn-detector', () => voiceWizard.getTurnDetector());
333
+ ipcMain.handle('voice:set-turn-detector', validated(schemas.voiceSetTurnDetector, (state) => voiceWizard.setTurnDetector(state)));
334
+
335
+ // TTS toggle persistence (top-level `ttsEnabled` on voice.json).
336
+ ipcMain.handle('voice:get-tts-enabled', async () => await voiceSettings.loadTtsEnabled());
337
+ ipcMain.handle('voice:set-tts-enabled', async (_e, enabled) => {
338
+ if (typeof enabled !== 'boolean') throw new Error('ttsEnabled must be a boolean');
339
+ await voiceSettings.saveTtsEnabled(enabled);
340
+ return { ok: true, ttsEnabled: enabled };
341
+ });
342
+
327
343
  // Renderer pings this when isRecording flips so we can prefix the window
328
344
  // title with `● REC — ` (PRD F1 v2 §Security: privacy invariant). This is
329
345
  // `ipcMain.on` (not handle), so we can't use the validated() helper —
@@ -299,7 +299,31 @@ async function saveTurnDetector(state) {
299
299
  return writeMerged({ turnDetector: normalizeTurnDetector(state) });
300
300
  }
301
301
 
302
+ // ──────────────────────────────────────────── TTS toggle
303
+ // Top-level boolean `ttsEnabled` on voice.json. Absent/non-boolean = false.
304
+ // Not part of the hotkey normalize(), but writeMerged preserves it, and
305
+ // save() stamps schemaVersion as for every other write.
306
+
307
+ async function loadTtsEnabled() {
308
+ const raw = await readRaw();
309
+ return !!raw && raw.ttsEnabled === true;
310
+ }
311
+
312
+ async function saveTtsEnabled(enabled) {
313
+ if (typeof enabled !== 'boolean') {
314
+ throw new Error('Invalid ttsEnabled value');
315
+ }
316
+ const raw = await readRaw();
317
+ const patch = { ttsEnabled: enabled };
318
+ // Keep the file's existing schemaVersion handling: stamp it when the file
319
+ // is fresh or lacks one; never downgrade an existing value.
320
+ if (!raw || typeof raw.schemaVersion !== 'number') patch.schemaVersion = SCHEMA_VERSION;
321
+ return writeMerged(patch);
322
+ }
323
+
302
324
  module.exports = {
325
+ loadTtsEnabled,
326
+ saveTtsEnabled,
303
327
  load,
304
328
  save,
305
329
  storePath,
@@ -1,47 +1,38 @@
1
1
  /**
2
- * voiceWizard — F7 first-run mic-check wizard, main-process side.
2
+ * voiceWizard — F7 first-run mic-check wizard + F8 turn-detector, main side.
3
3
  *
4
- * Owns:
5
- * - voice:wizard-state → returns persisted state + current schema constant
6
- * - voice:wizard-complete → stamps completedAt + completedSchema to voice.json
7
- *
8
- * No window state held here; persistence is delegated to voiceSettings.cjs
9
- * (additive `wizard` subtree on the same file as F1/F5).
4
+ * Exports plain functions only. The `voice:*` ipcMain handlers for all of
5
+ * these are registered in ONE place: voiceHotkey.registerHotkeyHandlers().
6
+ * Persistence is delegated to voiceSettings.cjs (additive subtrees on voice.json).
10
7
  */
11
8
 
12
- const { ipcMain } = require('electron');
13
9
  const voiceSettings = require('./voiceSettings.cjs');
14
- const { schemas, validated } = require('./ipcSchemas.cjs');
15
10
 
16
- function registerWizardHandlers() {
17
- ipcMain.handle('voice:wizard-state', async () => {
18
- const w = await voiceSettings.loadWizard();
19
- return {
20
- completedSchema: w.completedSchema,
21
- completedAt: w.completedAt,
22
- currentSchema: voiceSettings.WIZARD_SCHEMA,
23
- };
24
- });
11
+ async function wizardState() {
12
+ const w = await voiceSettings.loadWizard();
13
+ return {
14
+ completedSchema: w.completedSchema,
15
+ completedAt: w.completedAt,
16
+ currentSchema: voiceSettings.WIZARD_SCHEMA,
17
+ };
18
+ }
25
19
 
26
- ipcMain.handle('voice:wizard-complete', async () => {
27
- const next = {
28
- completedSchema: voiceSettings.WIZARD_SCHEMA,
29
- completedAt: new Date().toISOString(),
30
- };
31
- await voiceSettings.saveWizard(next);
32
- return { ok: true, ...next, currentSchema: voiceSettings.WIZARD_SCHEMA };
33
- });
20
+ async function wizardComplete() {
21
+ const next = {
22
+ completedSchema: voiceSettings.WIZARD_SCHEMA,
23
+ completedAt: new Date().toISOString(),
24
+ };
25
+ await voiceSettings.saveWizard(next);
26
+ return { ok: true, ...next, currentSchema: voiceSettings.WIZARD_SCHEMA };
27
+ }
34
28
 
35
- // F8 — turn-detector settings (additive subtree on voice.json).
36
- // MVP: persistence only; no model loaded in v1 (see PRD §Loading & inference).
37
- ipcMain.handle('voice:get-turn-detector', async () => {
38
- return await voiceSettings.loadTurnDetector();
39
- });
29
+ async function getTurnDetector() {
30
+ return await voiceSettings.loadTurnDetector();
31
+ }
40
32
 
41
- ipcMain.handle('voice:set-turn-detector', validated(schemas.voiceSetTurnDetector, async (state) => {
42
- await voiceSettings.saveTurnDetector(state);
43
- return { ok: true, state: await voiceSettings.loadTurnDetector() };
44
- }));
33
+ async function setTurnDetector(state) {
34
+ await voiceSettings.saveTurnDetector(state);
35
+ return { ok: true, state: await voiceSettings.loadTurnDetector() };
45
36
  }
46
37
 
47
- module.exports = { registerWizardHandlers };
38
+ module.exports = { wizardState, wizardComplete, getTurnDetector, setTurnDetector };
@@ -23,6 +23,14 @@ export type AutoUpdaterState =
23
23
  | 'unsupported' | 'disabled' | 'idle' | 'checking'
24
24
  | 'downloading' | 'ready' | 'deferred' | 'error';
25
25
 
26
+ export type UpdateCheckResult = {
27
+ current: string;
28
+ latest: string | null;
29
+ behind: boolean;
30
+ channel?: 'npm' | 'installer';
31
+ downloadUrl?: string | null;
32
+ };
33
+
26
34
  export type AutoUpdaterStatus = {
27
35
  state: AutoUpdaterState;
28
36
  current: string;
@@ -32,6 +40,8 @@ export type AutoUpdaterStatus = {
32
40
  busyReason: string | null;
33
41
  lastCheckedAt: number | null;
34
42
  enabled: boolean;
43
+ /** Latest-version probe result; present on `updater.status()` only (pushes omit it). */
44
+ check?: UpdateCheckResult;
35
45
  };
36
46
 
37
47
  export interface PrereqItem {
@@ -340,6 +350,18 @@ export interface Macro {
340
350
  }
341
351
 
342
352
  /** Omit `id` to create; set it to update an existing macro. */
353
+ export interface ClaudeConfigReadInput {
354
+ fileId: 'settings' | 'claudeJson' | 'mcpJson';
355
+ scope: 'user' | 'project' | 'local';
356
+ cwd?: string | null;
357
+ }
358
+ export interface ClaudeConfigPatchInput extends ClaudeConfigReadInput {
359
+ /** 1–8 non-empty segments. */
360
+ keyPath: string[];
361
+ /** Any JSON value; omit to delete the key. */
362
+ value?: unknown;
363
+ }
364
+
343
365
  export interface MacroSaveInput {
344
366
  id?: string;
345
367
  label: string;
@@ -1618,6 +1640,17 @@ export interface PluginInstallResult {
1618
1640
  error?: string;
1619
1641
  }
1620
1642
 
1643
+ /** One entry of ~/.claude/plugins/installed_plugins.json joined with user-scope enabledPlugins. */
1644
+ export interface InstalledPlugin {
1645
+ key: string;
1646
+ name: string;
1647
+ marketplace: string;
1648
+ version: string | null;
1649
+ scope: string | null;
1650
+ installPath: string | null;
1651
+ enabled: boolean;
1652
+ }
1653
+
1621
1654
  export interface PluginInstallProgressEvent {
1622
1655
  slug: string;
1623
1656
  line: string;
@@ -1812,7 +1845,6 @@ export interface SessionManagerAPI {
1812
1845
  app: {
1813
1846
  version: () => Promise<string>;
1814
1847
  /** Published-`latest` probe (cached 6h, opt-out SM_UPDATE_CHECK=0). Never rejects; offline → latest null. */
1815
- updateStatus: () => Promise<{ current: string; latest: string | null; behind: boolean }>;
1816
1848
  homeDir: () => Promise<string>;
1817
1849
  cwd: () => Promise<string>;
1818
1850
  engageRulesPath: () => Promise<string | null>;
@@ -1959,6 +1991,8 @@ export interface SessionManagerAPI {
1959
1991
  delete: (payload: { id: string }) => Promise<{ ok: boolean }>;
1960
1992
  /** Add/remove one project cwd. A macro shown in every project (`'*'`) cannot be narrowed: `{ ok: false, error: 'macro is shown in every project' }`. */
1961
1993
  setProject: (payload: { id: string; cwd: string; enabled: boolean }) => Promise<{ ok: true; macro: Macro } | { ok: false; error: string }>;
1994
+ /** This project only gives up the macro (same library call as the macro_delete MCP route); deleted when it was the last project. */
1995
+ removeFromProject: (payload: { id: string; cwd: string }) => Promise<{ ok: true; deleted: boolean; macro: Macro } | { ok: false; error: string }>;
1962
1996
  /** Dispatch a built-in macro's background build as a scheduler job. */
1963
1997
  dispatchJob: (payload: MacroJobDispatchInput) => Promise<MacroJobDispatchResult>;
1964
1998
  /** Status of this project's macro background builds. */
@@ -1996,6 +2030,11 @@ export interface SessionManagerAPI {
1996
2030
  ) => void;
1997
2031
  dir: () => Promise<string>;
1998
2032
  };
2033
+ claudeConfig: {
2034
+ read: (payload: ClaudeConfigReadInput) => Promise<{ path: string; data: Record<string, unknown> }>;
2035
+ /** Sets one key path; omit `value` to delete it. Broadcasts `config:changed`. */
2036
+ patch: (payload: ClaudeConfigPatchInput) => Promise<{ ok: true; path: string; data: Record<string, unknown> }>;
2037
+ };
1999
2038
  config: {
2000
2039
  readJson: (path: string) => Promise<ReadJsonResult>;
2001
2040
  readText: (path: string, opts?: ReadTextOptions) => Promise<ReadTextResult>;
@@ -2004,6 +2043,8 @@ export interface SessionManagerAPI {
2004
2043
  writeJson: (path: string, data: unknown, writer?: OpsWriter) => Promise<WriteResult>;
2005
2044
  writeText: (path: string, text: string, writer?: OpsWriter) => Promise<WriteResult>;
2006
2045
  listDir: (path: string, opts?: { filesOnly?: boolean; dirsOnly?: boolean; includeHidden?: boolean }) => Promise<ListDirResult>;
2046
+ /** True when config:write-text would accept this path (same validateWrite). */
2047
+ canWrite: (path: string) => Promise<boolean>;
2007
2048
  exists: (path: string) => Promise<boolean>;
2008
2049
  watch: (paths: string[], opts?: { depth?: 0 | 1 | 2 }) => void;
2009
2050
  unwatch: (paths: string[], opts?: { depth?: 0 | 1 | 2 }) => void;
@@ -2024,6 +2065,10 @@ export interface SessionManagerAPI {
2024
2065
  getWizardState: () => Promise<VoiceWizardState>;
2025
2066
  /** F7: stamp wizard as complete with the current schema. */
2026
2067
  markWizardComplete: () => Promise<VoiceMarkWizardCompleteResult>;
2068
+ /** Read persisted TTS toggle (voice.json `ttsEnabled`). */
2069
+ getTtsEnabled: () => Promise<boolean>;
2070
+ /** Persist TTS toggle. */
2071
+ setTtsEnabled: (enabled: boolean) => Promise<{ ok: boolean; ttsEnabled: boolean }>;
2027
2072
  /** F8 — read persisted turn-detector settings. */
2028
2073
  getTurnDetector: () => Promise<VoiceTurnDetectorState>;
2029
2074
  /** F8 — persist turn-detector settings. */
@@ -2201,6 +2246,12 @@ export interface SessionManagerAPI {
2201
2246
  marketplace?: { add: string; name: string };
2202
2247
  }) => Promise<PluginInstallResult>;
2203
2248
  onInstallProgress: (handler: (ev: PluginInstallProgressEvent) => void) => () => void;
2249
+ /** Installed plugins (installed_plugins.json) with user-scope enabled flag; key = name@marketplace. */
2250
+ list: () => Promise<InstalledPlugin[]>;
2251
+ /** Writes ~/.claude/settings.json enabledPlugins[key] via claudeConfig.patch. */
2252
+ setEnabled: (payload: { key: string; enabled: boolean }) => Promise<{ ok: boolean; error?: string }>;
2253
+ /** Runs `claude plugin uninstall <slug>@<marketplaceName>` in the hidden pty. */
2254
+ uninstall: (payload: { slug: string; marketplaceName: string }) => Promise<PluginInstallResult>;
2204
2255
  };
2205
2256
  clipboard: {
2206
2257
  /** Ctrl+V image paste — reads OS clipboard, saves any image to a temp
@@ -2298,7 +2349,7 @@ export interface SessionManagerAPI {
2298
2349
  * Kind allowlist is enforced main-side (ipcSchemas.cjs) — this channel is
2299
2350
  * append-only, no read/list IPC exists. */
2300
2351
  append: (
2301
- kind: 'epic_create' | 'epic_approve' | 'epic_complete' | 'epic_delete' | 'epic_resume' | 'epic_duplicate',
2352
+ kind: 'epic_create' | 'epic_approve' | 'epic_complete' | 'epic_delete' | 'epic_resume' | 'epic_duplicate' | 'epic_draft_update',
2302
2353
  fields: { cwd: string; epicId: string; source: string },
2303
2354
  ) => Promise<{ ok: boolean }>;
2304
2355
  };
@@ -6,13 +6,6 @@
6
6
  "kind": "invoke",
7
7
  "remote": "read"
8
8
  },
9
- {
10
- "ns": "app",
11
- "method": "updateStatus",
12
- "channel": "app:update-status",
13
- "kind": "invoke",
14
- "remote": "read"
15
- },
16
9
  {
17
10
  "ns": "app",
18
11
  "method": "homeDir",
@@ -447,6 +440,13 @@
447
440
  "kind": "invoke",
448
441
  "remote": "mutate"
449
442
  },
443
+ {
444
+ "ns": "macros",
445
+ "method": "removeFromProject",
446
+ "channel": "macros:remove-from-project",
447
+ "kind": "invoke",
448
+ "remote": "mutate"
449
+ },
450
450
  {
451
451
  "ns": "macros",
452
452
  "method": "dispatchJob",
@@ -531,6 +531,13 @@
531
531
  "kind": "invoke",
532
532
  "remote": "deny"
533
533
  },
534
+ {
535
+ "ns": "config",
536
+ "method": "canWrite",
537
+ "channel": "config:can-write",
538
+ "kind": "invoke",
539
+ "remote": "deny"
540
+ },
534
541
  {
535
542
  "ns": "config",
536
543
  "method": "watch",
@@ -559,6 +566,20 @@
559
566
  "kind": "on",
560
567
  "remote": "deny"
561
568
  },
569
+ {
570
+ "ns": "claudeConfig",
571
+ "method": "read",
572
+ "channel": "claudeConfig:read",
573
+ "kind": "invoke",
574
+ "remote": "deny"
575
+ },
576
+ {
577
+ "ns": "claudeConfig",
578
+ "method": "patch",
579
+ "channel": "claudeConfig:patch",
580
+ "kind": "invoke",
581
+ "remote": "deny"
582
+ },
562
583
  {
563
584
  "ns": "voice",
564
585
  "method": "onHotkey",
@@ -629,6 +650,20 @@
629
650
  "kind": "invoke",
630
651
  "remote": "read"
631
652
  },
653
+ {
654
+ "ns": "voice",
655
+ "method": "getTtsEnabled",
656
+ "channel": "voice:get-tts-enabled",
657
+ "kind": "invoke",
658
+ "remote": "read"
659
+ },
660
+ {
661
+ "ns": "voice",
662
+ "method": "setTtsEnabled",
663
+ "channel": "voice:set-tts-enabled",
664
+ "kind": "invoke",
665
+ "remote": "mutate"
666
+ },
632
667
  {
633
668
  "ns": "voice",
634
669
  "method": "setTurnDetector",
@@ -1154,6 +1189,27 @@
1154
1189
  "kind": "invoke",
1155
1190
  "remote": "deny"
1156
1191
  },
1192
+ {
1193
+ "ns": "plugins",
1194
+ "method": "list",
1195
+ "channel": "plugins:list",
1196
+ "kind": "invoke",
1197
+ "remote": "read"
1198
+ },
1199
+ {
1200
+ "ns": "plugins",
1201
+ "method": "setEnabled",
1202
+ "channel": "plugins:set-enabled",
1203
+ "kind": "invoke",
1204
+ "remote": "mutate"
1205
+ },
1206
+ {
1207
+ "ns": "plugins",
1208
+ "method": "uninstall",
1209
+ "channel": "plugins:uninstall",
1210
+ "kind": "invoke",
1211
+ "remote": "deny"
1212
+ },
1157
1213
  {
1158
1214
  "ns": "plugins",
1159
1215
  "method": "onInstallProgress",
@@ -13,7 +13,6 @@ function memoryTarget(target) {
13
13
  contextBridge.exposeInMainWorld('api', {
14
14
  app: {
15
15
  version: () => ipcRenderer.invoke('app:version'),
16
- updateStatus: () => ipcRenderer.invoke('app:update-status'),
17
16
  homeDir: () => ipcRenderer.invoke('app:home-dir'),
18
17
  cwd: () => ipcRenderer.invoke('app:cwd'),
19
18
  engageRulesPath: () => ipcRenderer.invoke('app:engage-rules-path'),
@@ -141,6 +140,7 @@ contextBridge.exposeInMainWorld('api', {
141
140
  list: () => ipcRenderer.invoke('macros:list'),
142
141
  save: (payload) => ipcRenderer.invoke('macros:save', payload),
143
142
  delete: (payload) => ipcRenderer.invoke('macros:delete', payload),
143
+ removeFromProject: (payload) => ipcRenderer.invoke('macros:remove-from-project', payload),
144
144
  setProject: (payload) => ipcRenderer.invoke('macros:set-project', payload),
145
145
  dispatchJob: (payload) => ipcRenderer.invoke('macros:dispatch-job', payload),
146
146
  jobStatus: (payload) => ipcRenderer.invoke('macros:job-status', payload),
@@ -162,12 +162,17 @@ contextBridge.exposeInMainWorld('api', {
162
162
  ipcRenderer.send('log:write', { scope, level, message, meta, ...ctx }),
163
163
  dir: () => ipcRenderer.invoke('log:dir'),
164
164
  },
165
+ claudeConfig: {
166
+ read: (payload) => ipcRenderer.invoke('claudeConfig:read', payload),
167
+ patch: (payload) => ipcRenderer.invoke('claudeConfig:patch', payload),
168
+ },
165
169
  config: {
166
170
  readJson: (path) => ipcRenderer.invoke('config:read-json', { path }),
167
171
  readText: (path, opts) => ipcRenderer.invoke('config:read-text', { path, maxBytes: opts?.maxBytes }),
168
172
  writeJson: (path, data, writer) => ipcRenderer.invoke('config:write-json', { path, data, writer }),
169
173
  writeText: (path, text, writer) => ipcRenderer.invoke('config:write-text', { path, text, writer }),
170
174
  listDir: (path, opts) => ipcRenderer.invoke('config:list-dir', { path, opts }),
175
+ canWrite: (path) => ipcRenderer.invoke('config:can-write', { path }),
171
176
  exists: (path) => ipcRenderer.invoke('config:exists', { path }),
172
177
  watch: (paths, opts) => ipcRenderer.send('config:watch', { paths, opts }),
173
178
  unwatch: (paths, opts) => ipcRenderer.send('config:unwatch', { paths, opts }),
@@ -200,6 +205,9 @@ contextBridge.exposeInMainWorld('api', {
200
205
  markWizardComplete: () => ipcRenderer.invoke('voice:wizard-complete'),
201
206
  // F8 turn-detector settings (~/.claude/session-manager/voice.json `turnDetector` key).
202
207
  // MVP: settings persistence + kill switch only; no model is actually loaded in v1.
208
+ // TTS toggle (~/.claude/session-manager/voice.json `ttsEnabled` key).
209
+ getTtsEnabled: () => ipcRenderer.invoke('voice:get-tts-enabled'),
210
+ setTtsEnabled: (enabled) => ipcRenderer.invoke('voice:set-tts-enabled', !!enabled),
203
211
  getTurnDetector: () => ipcRenderer.invoke('voice:get-turn-detector'),
204
212
  setTurnDetector: (state) => ipcRenderer.invoke('voice:set-turn-detector', state),
205
213
  },
@@ -343,6 +351,9 @@ contextBridge.exposeInMainWorld('api', {
343
351
  plugins: {
344
352
  install: (payload) => ipcRenderer.invoke('plugins:install', payload),
345
353
  abort: (slug) => ipcRenderer.invoke('plugins:abort', slug),
354
+ list: () => ipcRenderer.invoke('plugins:list', {}),
355
+ setEnabled: (payload) => ipcRenderer.invoke('plugins:set-enabled', payload),
356
+ uninstall: (payload) => ipcRenderer.invoke('plugins:uninstall', payload),
346
357
  onInstallProgress: (handler) => {
347
358
  const listener = (_e, payload) => handler(payload);
348
359
  ipcRenderer.on('plugins:install-progress', listener);
@@ -5,7 +5,7 @@ tools: Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__proj
5
5
  title: 'Project Home — Demo Video'
6
6
  model: opus
7
7
  effort: max
8
- seedVersion: 9
8
+ seedVersion: 10
9
9
  ---
10
10
 
11
11
  You are the demo-video-builder. You make a short animated demo, 30 seconds or 1 minute long per `<length_and_pacing>`, that shows someone what this
@@ -100,7 +100,7 @@ Use the shared kit in `~/.claude/session-manager/demo-video-kit/`. It needs only
100
100
  - `sound.cjs`: `node sound.cjs spec.json` with `{ narrationWav, cues, style, lengthS, out }` builds a music bed and sound effects, ducks them under the narration, and normalizes the mix to -14 LUFS. Use the mix as the audio track.
101
101
  - `frames.cjs`: `sampleFrames({ htmlPath, lengthS })` seeks the finished document and returns per-frame stats plus a contact sheet. Look at the sheet; no blank frame may last past 0.5 s.
102
102
  - `checks.cjs`: `node checks.cjs input.json` with `{ captions, narration, closing, lines, speechS, lengthS, frames, html }` must exit 0 before you save. Fix every failing check and run it again.
103
- - `_character`: reuse the mascot in the project's `session-manager-operations/project-pages/videos/_character/` when it exists (read `character.json` and `character.js`). Otherwise design one per `<character>` and save it once with `project_character_write`.
103
+ - `_character`: reuse the mascot in the project's session-manager-operations/project-pages/videos/_character/ when it exists (read `character.json` and `character.js`). Otherwise design one per `<character>` and save it once with `project_character_write`.
104
104
  If a kit tool fails, report its exact command and error; do not skip the check silently.
105
105
  </kit>
106
106
 
@@ -4,7 +4,7 @@ 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: 4
7
+ seedVersion: 5
8
8
  executorOnly: true
9
9
  ---
10
10
 
@@ -12,7 +12,7 @@ You are validator. You judge whether a plan's PRDs actually landed what they pro
12
12
 
13
13
  ## Inputs
14
14
 
15
- 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
+ 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`.
16
16
 
17
17
  ## Procedure (in this order)
18
18