claude-code-session-manager 0.129.0 → 0.130.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 (95) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/assets/AgentLibrary-ctvNes4y.js +2 -0
  3. package/dist/assets/AppSettings-C03qTDSi.js +2 -0
  4. package/dist/assets/Button-fOCJry21.js +1 -0
  5. package/dist/assets/Extensions-BWiDwigT.js +13 -0
  6. package/dist/assets/{History-B2x-LMlT.js → History-BIQFPXM8.js} +2 -2
  7. package/dist/assets/Library-BGmD-xZN.js +32 -0
  8. package/dist/assets/ListDetail-BeO3lY8t.js +1 -0
  9. package/dist/assets/{Memory-CnalwnFf.js → Memory-BeXuYIcE.js} +8 -8
  10. package/dist/assets/{Panel-BzIklgKf.js → Panel-OUbLHNsS.js} +1 -1
  11. package/dist/assets/ProvenanceBadge-kr7arZqu.js +1 -0
  12. package/dist/assets/Scheduler-DycegnjH.js +16 -0
  13. package/dist/assets/Settings-BSq6VASG.js +2 -0
  14. package/dist/assets/{SkillReferenceGraph-DOhiCxuL.js → SkillReferenceGraph-CvPdxg56.js} +1 -1
  15. package/dist/assets/SourceChip-C2YMnlV8.js +1 -0
  16. package/dist/assets/SystemPrompt-fpXEK_Rm.js +1 -0
  17. package/dist/assets/{TiptapBody-Du6jRBoW.js → TiptapBody-DusJg0je.js} +1 -1
  18. package/dist/assets/{Toggle-Qdi2Z7VD.js → Toggle-BnJF4V6k.js} +1 -1
  19. package/dist/assets/ViewTabs-BYrRSHb6.js +1 -0
  20. package/dist/assets/VoiceButton-Bk66E-fP.js +1 -0
  21. package/dist/assets/{historyTotals-8ecP_6wF.js → historyTotals-DnuVADtI.js} +1 -1
  22. package/dist/assets/{index-DtdWBGrI.css → index-Bp8XE9A6.css} +1 -1
  23. package/dist/assets/index-DfWJO7nP.js +3086 -0
  24. package/dist/index.html +2 -2
  25. package/dist-web/app.css +1 -1
  26. package/dist-web/app.js +390 -406
  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/claude/modelCatalog.cjs +15 -31
  46. package/src/main/lib/claudeConfig.cjs +156 -0
  47. package/src/main/lib/effectiveSettings.cjs +120 -0
  48. package/src/main/lib/epic/delegationReadiness.cjs +3 -3
  49. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +84 -11
  50. package/src/main/lib/git/gitWorktree.cjs +400 -9
  51. package/src/main/lib/git/runtimeStateUntrack.cjs +124 -0
  52. package/src/main/lib/mcpToolCatalog.cjs +8 -2
  53. package/src/main/lib/memoryDirResolve.cjs +2 -8
  54. package/src/main/lib/opsOwnership.cjs +63 -2
  55. package/src/main/lib/persona-macro/builtinMacros.cjs +30 -0
  56. package/src/main/lib/persona-macro/macroLibrary.cjs +34 -6
  57. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +22 -0
  58. package/src/main/lib/updateCheck.cjs +6 -1
  59. package/src/main/pluginInstall.cjs +100 -1
  60. package/src/main/scheduler.cjs +12 -2
  61. package/src/main/seedDevPlugin.cjs +2 -1
  62. package/src/main/templates/PRD_AUTHORING.md +3 -3
  63. package/src/main/updaterIpc.cjs +5 -1
  64. package/src/main/usage.cjs +5 -20
  65. package/src/main/voiceHotkey.cjs +16 -0
  66. package/src/main/voiceSettings.cjs +24 -0
  67. package/src/main/voiceWizard.cjs +27 -36
  68. package/src/preload/api.d.ts +53 -2
  69. package/src/preload/apiSurface.json +63 -7
  70. package/src/preload/index.cjs +12 -1
  71. package/src/seed/agents/demo-video-builder.md +2 -2
  72. package/src/seed/agents/validator.md +2 -2
  73. package/dist/assets/AgentLibrary-Cp250YHF.js +0 -2
  74. package/dist/assets/Button-DU5UF-6L.js +0 -1
  75. package/dist/assets/DataModel-CPf6f17e.js +0 -1
  76. package/dist/assets/Hooks-BWr33C4Q.js +0 -3
  77. package/dist/assets/Library-DBNLTAa8.js +0 -46
  78. package/dist/assets/ListDetail-BGBw6egp.js +0 -1
  79. package/dist/assets/McpServers-DywZ50Ec.js +0 -2
  80. package/dist/assets/Permissions-mgRifwQc.js +0 -3
  81. package/dist/assets/Plugins-CV42zfid.js +0 -2
  82. package/dist/assets/ProvenanceBadge-DYmX4xgB.js +0 -1
  83. package/dist/assets/SaveBar-DxrAfnlC.js +0 -1
  84. package/dist/assets/Scheduler-iyUl1NDl.js +0 -16
  85. package/dist/assets/ScopeSwitcher-CC8BDPgf.js +0 -1
  86. package/dist/assets/Settings-CWBnQghD.js +0 -4
  87. package/dist/assets/Skills-3Er-9YA9.js +0 -2
  88. package/dist/assets/SystemPrompt-BLxdvZ9K.js +0 -1
  89. package/dist/assets/TagLibrary-BZ6QHYMQ.js +0 -1
  90. package/dist/assets/ViewTabs-BKfFsziD.js +0 -1
  91. package/dist/assets/index-GI6F_j41.js +0 -3083
  92. package/dist/assets/listSkills-C1aWKf0T.js +0 -1
  93. package/dist/assets/settingsSchema-lHTHAabD.js +0 -1
  94. package/dist/assets/skillFrontmatter-8X1Uc282.js +0 -10
  95. package/dist/assets/useAgentsDirWatch-CcsoD1bp.js +0 -1
@@ -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
 
@@ -1,2 +0,0 @@
1
- import{ao as A,aB as y,ba as le,al as e,m as z,a as M,aT as $,aQ as de,V as ce,aS as fe,b3 as Q,M as me,c as _,E as xe}from"./index-GI6F_j41.js";import{P as he}from"./Panel-BzIklgKf.js";import{L as pe}from"./ListDetail-BGBw6egp.js";import{B as R}from"./Button-DU5UF-6L.js";import{u as ue,t as ge,a as ve}from"./useAgentsDirWatch-CcsoD1bp.js";import{r as be}from"./claude-settings-schema-COigsajx.js";import"./monaco-editor-BsIlgG7c.js";const je=n=>{const[s,r]=n.split(".");return Number(s)+(r?Number(r)/100:0)};function we(n){const s=/Effort is supported on ([^.]*?)(?:, with|\.|$)/.exec(n);if(!s)return[];const r=[];for(const d of s[1].split(/,\s*|\s+and\s+/)){const o=/^(\w+)\s+(\d+(?:\.\d+)?)$/.exec(d.trim());o&&r.push({family:o[1].toLowerCase(),version:je(o[2])})}return r}var J,Y;const ye=we(String(((Y=(J=be.properties)==null?void 0:J.effortLevel)==null?void 0:Y.description)??""));function Ne(n,s){const r=new RegExp(`${s}-(\\d+)(?:-(\\d{1,2})(?!\\d))?`,"i").exec(n);if(r)return Number(r[1])+(r[2]?Number(r[2])/100:0);const d=new RegExp(`claude-(\\d+)(?:-(\\d{1,2}))?-${s}`,"i").exec(n);return d?Number(d[1])+(d[2]?Number(d[2])/100:0):null}function Ce(n,s=ye){if(!n||n==="inherit"||s.length===0)return null;const r=A(n);if(!r)return null;const d=s.filter(l=>l.family===r);if(d.length===0)return!1;const o=Ne(n,r);return o===null?null:o>=Math.min(...d.map(l=>l.version))}const U=["Read","Grep","Glob","Bash","Write","Edit","WebFetch","WebSearch","Task"],ke=["","red","orange","yellow","green","cyan","blue","purple","pink"],X={red:"#c0392b",orange:"#b85c34",yellow:"#c9a227",green:"#6f7d52",cyan:"#3f8f8a",blue:"#4a6fa5",purple:"#7a6a8a",pink:"#b45a80"};function G(n){return{name:n.name,description:n.description??"",tools:n.tools,model:n.model??"inherit",effort:n.effort??"inherit",color:n.color??"",tags:n.tags,body:n.body}}const q={name:"new-agent",description:"",tools:["Read","Grep"],model:"inherit",effort:"inherit",color:"",tags:[],body:""};function $e(n){return n.overridingProjects.map(s=>{var o;const r=(o=n.overrideDetails)==null?void 0:o.find(l=>l.project===s);if(!r)return s;const d=[...r.fields.filter(l=>l!=="name"),...r.bodyOverridden?["full body"]:[]];return`${s}: ${d.join(", ")||"overlay"}`}).join(`
2
- `)}function Se(){const[n,s]=y.useState(null),[r,d]=y.useState(null),[o,l]=y.useState(""),[i,x]=y.useState(null),[L,h]=y.useState(!1),[w,v]=y.useState(!1),[N,u]=y.useState(null),[b,j]=y.useState(!1),E=y.useRef(!0);y.useEffect(()=>()=>{E.current=!1},[]);const a=le(t=>{var m;return((m=t.tabs.find(k=>k.id===t.activeTabId))==null?void 0:m.cwd)??null}),g=a?a.replace(/\/+$/,"").split("/").pop()||a:null,C=y.useRef(0),S=async t=>{const m=++C.current;try{const k=await window.api.agents.listPersonas();if(!E.current||C.current!==m)return;s(k),d(W=>{var P;return t??W??((P=k[0])==null?void 0:P.name)??null})}catch(k){if(!E.current||C.current!==m)return;s([]),$.error(k.message||"failed to load agent personas")}};if(y.useEffect(()=>{S()},[]),y.useEffect(()=>window.api.agents.onChanged(()=>S()),[]),ue(a,()=>S()),y.useEffect(()=>{const t=de();t&&d(t);const m=k=>d(k.detail);return window.addEventListener("sm:select-persona",m),()=>window.removeEventListener("sm:select-persona",m)},[]),n===null)return e.jsx(z,{title:"loading…"});const T=o.toLowerCase(),F=n.filter(t=>!T||t.name.toLowerCase().includes(T)||(t.description??"").toLowerCase().includes(T)),f=n.find(t=>t.name===r)??n[0]??null,c=i??(f?G(f):null),B=!!i&&!!f&&JSON.stringify(i)!==JSON.stringify(G(f)),O=L,I=t=>{x(null),h(!1),v(!1),u(null),d(t)},p=t=>x(m=>({...m??(f?G(f):q),...t})),V=()=>{x({...q}),h(!0),v(!1)},te=()=>{c&&(x({...c,name:c.name+"-copy"}),h(!0))},ne=()=>{x(null),h(!1)},se=async()=>{if(c){if(!/^[a-z][a-z0-9-]*$/.test(c.name)){$.error('agent name must be lowercase, hyphenated (e.g. "my-agent")');return}j(!0);try{const t=O?null:f,m={name:c.name,originalName:t==null?void 0:t.name,description:c.description,tools:c.tools,model:c.model,effort:c.effort,color:c.color,tags:ge(c.tags),body:c.body},k=t?ve(t,m):m;await window.api.agents.savePersona(k),$.info(O?`created ${c.name}`:`saved ${c.name}`),x(null),h(!1),await S(c.name)}catch(t){$.error(t.message||"failed to save agent persona")}finally{j(!1)}}},ae=async()=>{if(f){j(!0);try{await window.api.agents.deletePersona({name:f.name}),$.info(`deleted ${f.name}`),v(!1),x(null),h(!1),await S()}catch(t){$.error(t.message||"failed to delete agent persona")}finally{j(!1)}}},oe=async t=>{j(!0);try{await window.api.agents.deletePersona({name:t}),$.info(`deleted ${t}`),u(null),r===t&&(x(null),h(!1)),await S()}catch(m){$.error(m.message||"failed to delete agent persona")}finally{j(!1)}},re=async t=>{if(f)try{await window.api.agents.removeOverride({name:f.name,projectName:t}),$.info(`removed ${t}'s override of ${f.name}`),await S(f.name)}catch(m){$.error(m.message||"failed to remove override")}},ie=async t=>{if(!(!f||!g)){j(!0);try{t.model==="inherit"&&t.effort==="inherit"?(await window.api.agents.removeOverride({name:f.name,projectName:g}),$.info(`cleared ${g}'s override of ${f.name}`)):(await window.api.agents.savePersona({name:f.name,projectName:g,description:"",tools:[],color:"",tags:[],body:"",model:t.model,effort:t.effort}),$.info(`saved ${g}'s override of ${f.name}`)),await S(f.name)}catch(m){$.error(m.message||"failed to save project override")}finally{j(!1)}}};return e.jsx(he,{toolbar:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-faint",children:[n.length," persona",n.length===1?"":"s"]}),e.jsx("input",{value:o,onChange:t=>l(t.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-40"}),e.jsx("div",{className:"flex-1"}),e.jsx(R,{variant:"primary",onClick:V,children:"+ New agent"})]}),children:e.jsx(pe,{sidebar:e.jsxs("div",{className:"py-1",children:[O&&e.jsx("div",{className:"w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 bg-bg-hi text-fg border-l-2 border-accent",children:e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsx("span",{className:"truncate font-mono",children:c==null?void 0:c.name}),e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-accent",children:"new"})]})}),F.length===0&&!O?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agent personas found"}):F.map(t=>{const m=!O&&t.name===r,k=m&&B,W=N===t.name;return e.jsxs("div",{"data-agent-row":t.name,className:`group w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 border-l-2 cursor-pointer ${m?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,onClick:()=>I(t.name),children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:t.color?X[t.color]??t.color:"var(--fg-faint, #999)",opacity:t.color?1:.35}}),e.jsx("span",{className:"truncate font-mono",children:t.name})]}),e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5",children:[k&&e.jsx("span",{className:"text-[10px] font-semibold text-accent",children:"unsaved"}),!k&&t.overridingProjects.length>0&&e.jsx("span",{title:$e(t),children:e.jsxs(M,{tone:"dim",children:[t.overridingProjects.length," override",t.overridingProjects.length>1?"s":""]})}),W?e.jsxs("span",{className:"flex items-center gap-1",onClick:P=>P.stopPropagation(),children:[e.jsx("button",{onClick:()=>oe(t.name),disabled:b,title:`Delete ${t.name}`,className:"text-[10px] font-semibold text-red-400 hover:text-red-300",children:"confirm"}),e.jsx("button",{onClick:()=>u(null),title:"Cancel",className:"text-[10px] text-fg-faint hover:text-fg",children:"cancel"})]}):e.jsx("button",{onClick:P=>{P.stopPropagation(),u(t.name)},title:`Delete ${t.name}`,className:"opacity-0 group-hover:opacity-100 text-fg-faint hover:text-red-400 transition-opacity",children:"×"})]})]}),t.description&&e.jsx("span",{className:"truncate text-fg-faint",children:t.description})]},t.name)})]}),detail:c?e.jsx(Le,{obj:c,set:p,saved:f,dirty:B,isNew:O,busy:b,confirmDelete:w,setConfirmDelete:v,onDuplicate:te,onRevert:ne,onSave:se,onDelete:ae,onDropOverride:re,activeProject:g,onSaveOverride:ie}):e.jsx(z,{title:"select an agent"})})})}const Be=y.memo(Se);function Le({obj:n,set:s,saved:r,dirty:d,isNew:o,busy:l,confirmDelete:i,setConfirmDelete:x,onDuplicate:L,onRevert:h,onSave:w,onDelete:v,onDropOverride:N,activeProject:u,onSaveOverride:b}){const j=`~/.claude/agents/${n.name}.md`,E=d||o;return e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-line flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-fg font-mono",children:n.name}),o?e.jsx(M,{tone:"accent",children:"unsaved draft"}):d?e.jsx(M,{tone:"warn",children:"edited"}):e.jsx(M,{tone:"good",children:"saved"}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:j})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx(D,{label:"name",hint:"Filename on disk — lowercase, hyphenated.",children:e.jsx("input",{value:n.name,onChange:a=>s({name:a.target.value.toLowerCase()}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})}),e.jsx(D,{label:"description",hint:"Shown in the list and in agent pickers.",children:e.jsx("input",{value:n.description,onChange:a=>s({description:a.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(Z,{value:n.model,onChange:a=>s({model:a})}),e.jsx(ee,{value:n.effort,model:n.model,onChange:a=>s({effort:a})}),!o&&r&&e.jsx(Ee,{saved:r,activeProject:u,busy:l,onSave:b}),e.jsx(D,{label:"tools",hint:`${n.tools.length} of ${U.length} granted. Anything not ticked is refused at call time.`,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:U.map(a=>{const g=n.tools.includes(a);return e.jsx("button",{onClick:()=>s({tools:g?n.tools.filter(C=>C!==a):[...n.tools,a]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${g?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"}`,children:a},a)})})}),e.jsx(D,{label:"color",children:e.jsx("div",{className:"flex gap-1.5",children:ke.map(a=>e.jsx("button",{title:a||"none",onClick:()=>s({color:a}),className:"w-5 h-5 rounded",style:{background:a?X[a]:"transparent",border:n.color===a?"2px solid var(--accent, #b85c34)":"1px solid var(--line, #555)"}},a||"none"))})}),e.jsx(D,{label:"tags",hint:"Session mission tags this persona is associated with — shown as the default agent on that tag's own page. The first one (in Tag Library order) is the MISSION an Action button's session opens with.",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:ce.map(a=>{const g=n.tags.includes(a.tag),C=fe(a.tag);return e.jsxs("button",{onClick:()=>s({tags:g?n.tags.filter(S=>S!==a.tag):[...n.tags,a.tag]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${g?`${C.bg} ${C.text} ${C.border?"border-current/30":"border-transparent"}`:"bg-bg-hi text-fg-faint border-line"}`,children:["#",a.tag]},a.tag)})})}),e.jsx(D,{label:"definition",hint:"The system prompt this persona runs under.",children:e.jsx("textarea",{rows:9,value:n.body,onChange:a=>s({body:a.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})}),e.jsx(D,{label:"project overrides",hint:"Open projects that shadow this definition with a local copy.",children:r&&r.overridingProjects.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.overridingProjects.map(a=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[a,e.jsx("button",{onClick:()=>N(a),title:"Drop the local copy",className:"text-fg-faint hover:text-fg",children:"×"})]},a))}):e.jsx("div",{className:"text-xs text-fg-faint italic",children:o?"save first to see project overrides.":"no open project overlays this agent — the global definition applies everywhere."})})]}),e.jsx("div",{className:"px-4 py-2.5 border-t border-line flex items-center gap-2 flex-wrap",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-fg-dim",children:["Delete ",e.jsx("strong",{className:"font-mono",children:n.name})," and its file?"]}),e.jsx(R,{variant:"danger",onClick:v,disabled:l,children:"Delete"}),e.jsx(R,{onClick:()=>x(!1),children:"Keep"})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{onClick:L,disabled:l,children:"Duplicate"}),!o&&e.jsx(R,{variant:"danger",onClick:()=>x(!0),disabled:l,children:"Delete"}),e.jsx("div",{className:"flex-1"}),E&&e.jsx("span",{className:"text-[11px] text-fg-faint",children:"unsaved changes"}),e.jsx(R,{onClick:h,disabled:!E||l,children:"Revert"}),e.jsx(R,{variant:"primary",onClick:w,disabled:!E||l,children:l?"Saving…":o?"Create":"Save"})]})})]})}function D({label:n,hint:s,children:r}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:n}),r,s&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug",children:s})]})}const K="latest",H="Blocked by the availableModels allowlist in your Claude settings";function Z({value:n,onChange:s,label:r="default model",hint:d,testIdPrefix:o="",inheritLabel:l}){var O,I;const{catalog:i,loading:x,degraded:L,refresh:h}=Q(null),w=i?["inherit",...i.aliases]:[...me],v=(i==null?void 0:i.availableModels)??null,N=p=>!!v&&p!=="inherit"&&!v.includes(p),u=(p,V)=>!!v&&!v.includes(p)&&!(V&&v.includes(V)),b=n||"inherit",j=((O=/\[[^\]]*\]$/.exec(b))==null?void 0:O[0])??"",E=w.includes(b),a=!E&&i&&A(b)&&w.includes(A(b)+j)?A(b)+j:null,g=E?b:a??b,C=A(g),S=((I=/\[[^\]]*\]$/.exec(g))==null?void 0:I[0])??"",T=!!i&&b!=="inherit"&&!!C&&w.includes(g),F=T?i.models.filter(p=>A(p)===C).map(p=>p+S):[],f=E?K:b,c={};if(i)for(const p of w)N(p)&&(c[p]=H);const B={};for(const p of F)u(p,C)&&(B[p]=H);return e.jsxs(D,{label:r,hint:d??"This persona's default model for its Epics — sets the --model an Epic launches with (Terminal + Chat both honor it). 'inherit' falls back to each view's own default, not this Settings page. Cheap models for read-only personas; opus for judgement calls.",children:[e.jsx("div",{"data-testid":`${o}model-row`,children:e.jsx(_,{options:w,value:g,onChange:s,mono:!0,blocked:c,labels:l?{inherit:l}:void 0})}),T&&e.jsxs("div",{className:"mt-2","data-testid":`${o}model-version-row`,children:[e.jsx("div",{className:"text-[10.5px] text-fg-faint mb-1 font-mono",children:"version"}),e.jsx(_,{options:[K,...F],value:f,onChange:p=>s(p===K?g:p),mono:!0,blocked:B})]}),e.jsxs("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug flex items-center gap-2",children:[e.jsx("span",{children:i?`Models are live-read from the installed claude CLI${L?" (cached — CLI probe unavailable)":""}. "latest" keeps the floating alias.`:x?"Loading model catalog…":"catalog unavailable — showing the standard list."}),e.jsx("button",{"data-testid":`${o}model-catalog-refresh`,onClick:()=>{h()},disabled:x,className:"underline text-fg-dim disabled:opacity-40",children:"refresh"})]})]})}function ee({value:n,model:s,onChange:r,label:d="effort",testIdPrefix:o="",inheritLabel:l}){const{catalog:i}=Q(null),x=i&&i.effortLevels.length?["inherit",...i.effortLevels]:[...xe],L=(i==null?void 0:i.settingsEffortLevels)??[],h=i?x.filter(N=>N!=="inherit"&&!L.includes(N)):[],w=n||"inherit",v=w!=="inherit"&&Ce(s)===!1;return e.jsxs(D,{label:d,hint:i?`Effort levels are live-read from the installed claude CLI (what /effort accepts). ${h.length?`${h.join(", ")} ${h.length>1?"are":"is"} session-only — settings.json accepts ${L.join(", ")}. `:""}'inherit' writes no effort: line.`:"catalog unavailable — showing the standard list. 'inherit' writes no effort: line.",children:[e.jsx("div",{"data-testid":`${o}effort-row`,children:e.jsx(_,{options:x,value:w,onChange:r,mono:!0,labels:l?{inherit:l}:void 0})}),h.length>0&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 font-mono","data-testid":`${o}effort-session-only`,children:h.map(N=>`${N} (session-only)`).join(" · ")}),v&&e.jsx("div",{className:"text-[11px] text-amber-400 mt-1 leading-snug","data-testid":`${o}effort-unsupported-note`,children:"The selected model does not support effort — the CLI will ignore this setting."})]})}function Ee({saved:n,activeProject:s,busy:r,onSave:d}){var w,v,N;if(!s)return e.jsxs("div",{"data-testid":"project-override-none",className:"border border-dashed border-line rounded p-3 text-[11px] text-fg-faint",children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide mb-1 font-mono",children:"project override"}),"No active project — open a project tab to override this persona's model or effort for that project only."]});const o=(w=n.overrideDetails)==null?void 0:w.find(u=>u.project===s),l=!!(o!=null&&o.bodyOverridden),i=((v=o==null?void 0:o.values)==null?void 0:v.model)??"inherit",x=((N=o==null?void 0:o.values)==null?void 0:N.effort)??"inherit",L=n.model??"inherit",h=n.effort??"inherit";return e.jsxs("div",{"data-testid":"project-override",className:"border border-accent/40 rounded p-3 space-y-3 bg-accent/5",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-accent font-mono",children:"project override"}),e.jsxs(M,{tone:"accent",children:[s," only"]}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:`<project>/.claude/agents/${n.name}.md`})]}),e.jsxs("div",{className:"text-[11px] text-fg-faint leading-snug",children:["Changes what the SCHEDULER (and new Epics) spawn for ",e.jsx("strong",{children:s})," only — a frontmatter-only overlay with just the keys you set; the persona's body stays the global one. The global model/effort rows edit the machine-wide persona and are never touched here."]}),l&&e.jsxs("div",{"data-testid":"project-override-fullbody",className:"text-[11px] text-amber-400 leading-snug",children:[s,' already has a FULL-BODY override of this persona (its own definition text). It is shown as-is and not converted to a frontmatter-only overlay — edit that file directly, or drop it with × under "project overrides" below.']}),e.jsxs("fieldset",{disabled:r||l,className:"space-y-3 border-0 p-0 m-0 min-w-0",children:[e.jsx(Z,{value:i,onChange:u=>{l||d({model:u,effort:x})},label:"project model",hint:"'use global' writes no model: line in the overlay.",testIdPrefix:"override-",inheritLabel:"use global"}),e.jsx(ee,{value:x,model:i!=="inherit"?i:L,onChange:u=>{l||d({model:i,effort:u})},label:"project effort",testIdPrefix:"override-",inheritLabel:"use global"})]}),e.jsx("div",{"data-testid":"override-provenance",className:"text-[11px] font-mono text-fg-dim space-y-0.5",children:[["model",L,i],["effort",h,x]].map(([u,b,j])=>e.jsxs("div",{"data-testid":`override-provenance-${u}`,children:[u,": ",j!=="inherit"?e.jsxs(e.Fragment,{children:[b," ",e.jsx("span",{className:"text-fg-faint",children:"(global)"})," → ",e.jsx("span",{className:"text-accent",children:j})," ",e.jsx("span",{className:"text-fg-faint",children:"(this project)"})]}):e.jsxs(e.Fragment,{children:[b," ",e.jsx("span",{className:"text-fg-faint",children:"(global — not overridden)"})]})]},u))})]})}export{Be as AgentLibrary};
@@ -1 +0,0 @@
1
- import{al as o,X as l}from"./index-GI6F_j41.js";function u({children:n,onClick:s,disabled:a,variant:e="default",tooltip:t,type:d="button",className:c}){const i=`px-2 py-0.5 text-xs rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${e==="primary"?"text-accent border-accent/50 hover:bg-bg-hi":e==="danger"?"text-red-400 hover:text-red-300 border-line hover:border-red-400/50":"text-fg-dim border-line hover:text-fg hover:bg-bg-hi"} ${c??""}`,r=o.jsx("button",{type:d,title:t,onClick:s,disabled:a,className:i,children:n});return t?o.jsx(l,{content:t,align:"bottom-center",children:r}):r}export{u as B};
@@ -1 +0,0 @@
1
- import{aB as d,i as j,am as $,a5 as g,al as e,m as N,ap as E,a6 as b,aF as S,a as f,a0 as T,j as v,h as D}from"./index-GI6F_j41.js";import{P as R}from"./Panel-BzIklgKf.js";import{V}from"./ViewTabs-BKfFsziD.js";import"./monaco-editor-BsIlgG7c.js";const C=[{key:"diagram",label:"Diagram"},{key:"tables",label:"Tables"}];function G(){const[s,t]=d.useState("diagram"),[a,i]=d.useState(null),[l,n]=d.useState(()=>new Set),c=d.useMemo(()=>j.filter(r=>!l.has(r.group)),[l]),m=d.useMemo(()=>$(c),[c]),o=r=>{n(x=>{const h=new Set(x);return h.has(r)?h.delete(r):h.add(r),h}),i(null)},u=a?g(a):null,y=r=>c.some(x=>x.id===r);return e.jsx(R,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(V,{options:C,active:s,onChange:t}),e.jsx(M,{hiddenGroups:l,onToggle:o}),e.jsxs("span",{className:"ml-auto text-fg-faint",children:[j.length," entities"]})]}),children:s==="diagram"?e.jsxs("div",{className:"h-full flex",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:e.jsx(O,{layout:m,selectedId:a,onSelect:r=>i(x=>x===r?null:r)})}),e.jsx("div",{className:"w-96 shrink-0 border-l border-line overflow-y-auto",children:u?e.jsx(F,{entity:u,onSelectRelated:r=>y(r)?i(r):void 0}):e.jsx(N,{title:"select an entity",hint:"click a box in the diagram to see its storage, fields, and relations"})})]}):e.jsx(B,{})})}const X=d.memo(G);function M({hiddenGroups:s,onToggle:t}){return e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:v.map(a=>{const i=s.has(a.id);return e.jsxs("button",{onClick:()=>t(a.id),title:`${a.blurb} (${a.realm})`,className:`flex items-center gap-1 px-1.5 py-0.5 rounded border text-[10.5px] ${i?"border-line text-fg-faint opacity-50":"border-line text-fg-dim hover:text-fg"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${a.tone.dot}`}),a.label,e.jsx("span",{className:"text-fg-faint",children:a.realm})]},a.id)})})}function O({layout:s,selectedId:t,onSelect:a}){const i=d.useMemo(()=>t?new Set(E(t)):null,[t]),l=n=>!!t&&(n.relation.from===t||n.relation.to===t);return s.boxes.length===0?e.jsx(N,{title:"no entities in view",hint:"toggle a group in the legend to show its entities"}):e.jsxs("div",{className:"relative p-4",style:{width:s.width+32,height:s.height+32},children:[e.jsxs("svg",{width:s.width,height:s.height,className:"absolute left-4 top-4 overflow-visible",children:[s.edges.map(n=>{const c=l(n);return e.jsx("path",{"data-testid":`erd-edge-${n.relation.from}-${n.relation.to}`,d:n.d,fill:"none",className:c?"stroke-accent":"stroke-line",strokeWidth:c?2:1,opacity:t&&!c?.25:1},`${n.relation.from}-${n.relation.to}-${n.relation.label}`)}),s.edges.map(n=>l(n)?e.jsx("text",{x:n.mx,y:n.my,textAnchor:"middle",className:"fill-fg-dim text-[10px]",children:n.relation.label},`label-${n.relation.from}-${n.relation.to}-${n.relation.label}`):null)]}),s.boxes.map(n=>e.jsx(_,{box:n,selected:n.id===t,dimmed:!!t&&n.id!==t&&!(i!=null&&i.has(n.id)),onClick:()=>a(n.id)},n.id))]})}function _({box:s,selected:t,dimmed:a,onClick:i}){const l=g(s.id),n=b(s.group),c=l.fields.slice(0,D),m=l.fields.length-c.length;return e.jsxs("button",{type:"button","data-testid":`erd-box-${s.id}`,onClick:i,className:`absolute text-left rounded border overflow-hidden bg-bg-hi ${t?"border-accent ring-1 ring-accent":"border-line"} ${a?"opacity-30":""}`,style:{left:s.x,top:s.y,width:s.w,height:s.h},children:[e.jsxs("div",{className:"px-2 py-1 border-b border-line flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${n.tone.dot}`}),e.jsx("span",{className:"text-[11px] font-semibold text-fg truncate",children:l.name})]}),l.aka&&e.jsx("div",{className:"px-2 pt-0.5 text-[9.5px] text-fg-faint truncate",children:l.aka}),e.jsxs("div",{className:"px-2 py-0.5",children:[c.map(o=>e.jsxs("div",{className:"text-[9.5px] font-mono text-fg-dim truncate flex items-center gap-1",children:[o.key&&e.jsx("span",{className:"text-fg-faint",children:o.key}),e.jsx("span",{className:"truncate",children:o.name})]},o.name)),m>0&&e.jsxs("div",{className:"text-[9.5px] text-fg-faint italic",children:["+",m," more"]})]})]})}function w({fields:s}){return e.jsxs("table",{className:"w-full text-[11px] font-mono",children:[e.jsx("thead",{className:"text-fg-faint uppercase tracking-wide text-[9.5px]",children:e.jsxs("tr",{className:"border-b border-line",children:[e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"name"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"type"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"key"}),e.jsx("th",{className:"text-left font-normal px-2 py-1",children:"note"})]})}),e.jsx("tbody",{children:s.map(t=>e.jsxs("tr",{className:"border-b border-line/50",children:[e.jsxs("td",{className:"px-2 py-1 text-fg",children:[t.name,t.optional&&e.jsx("span",{className:"text-fg-faint",children:"?"})]}),e.jsx("td",{className:"px-2 py-1 text-fg-dim",children:t.type}),e.jsx("td",{className:"px-2 py-1",children:t.key&&e.jsxs(f,{tone:t.key==="pk"?"accent":"dim",children:[t.key,t.ref?` → ${t.ref}`:""]})}),e.jsx("td",{className:"px-2 py-1 text-fg-faint",children:t.note})]},t.name))})]})}function k({entity:s}){return e.jsxs("div",{className:"space-y-1 text-[11px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"path"}),e.jsx("span",{className:"font-mono text-fg-dim break-all",children:s.store.path})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"format"}),e.jsx("span",{className:"font-mono text-fg-dim",children:s.store.format})]}),s.store.writer&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"writer"}),e.jsxs(f,{tone:"accent",children:["single-writer: ",s.store.writer]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-faint w-20 shrink-0",children:"definedIn"}),e.jsx("span",{className:"font-mono text-fg-dim break-all",children:s.store.definedIn})]})]})}function F({entity:s,onSelectRelated:t}){const a=b(s.group),i=S(s.id);return e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.tone.dot}`}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:s.name})]}),s.aka&&e.jsx("div",{className:"text-[10.5px] text-fg-faint",children:s.aka}),e.jsx(f,{tone:"dim",className:"mt-1",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:s.summary}),e.jsxs("div",{children:[e.jsx(p,{children:"storage"}),e.jsx(k,{entity:s})]}),e.jsxs("div",{children:[e.jsx(p,{children:"fields"}),e.jsx(w,{fields:s.fields})]}),s.notes&&s.notes.length>0&&e.jsxs("div",{children:[e.jsx(p,{children:"notes"}),e.jsx("ul",{className:"list-disc pl-4 space-y-0.5 text-xs text-fg-dim",children:s.notes.map(l=>e.jsx("li",{children:l},l))})]}),e.jsxs("div",{children:[e.jsx(p,{children:"relations"}),i.length===0?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"no relations"}):e.jsx("ul",{className:"space-y-1",children:i.map(l=>{const n=l.from===s.id?l.to:l.from,c=g(n);return e.jsxs("li",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"font-mono text-fg-faint w-10 shrink-0",children:T(l.cardinality)}),e.jsx("span",{className:"text-fg-dim",children:l.label}),l.via&&e.jsxs("span",{className:"font-mono text-[10px] text-fg-faint",children:["via ",l.via]}),e.jsx("button",{type:"button",onClick:()=>t(n),className:"ml-auto text-accent hover:underline font-mono",children:c.name})]},`${l.from}-${l.to}-${l.label}`)})})]})]})}function p({children:s}){return e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1 font-mono",children:s})}function B(){return e.jsx("div",{className:"p-4 space-y-6",children:v.map(s=>{const t=j.filter(a=>a.group===s.id);return t.length===0?null:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${s.tone.dot}`}),e.jsx("span",{className:"text-xs font-semibold text-fg",children:s.label}),e.jsx("span",{className:"text-[10.5px] text-fg-faint",children:s.realm})]}),e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:t.map(a=>e.jsxs("div",{className:"border border-line rounded bg-bg-hi p-3 space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.name}),a.aka&&e.jsx("span",{className:"text-[10.5px] text-fg-faint",children:a.aka})]}),e.jsx(f,{tone:"dim",className:"mt-1",children:s.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.summary}),e.jsx(k,{entity:a}),e.jsx(w,{fields:a.fields}),a.notes&&a.notes.length>0&&e.jsx("ul",{className:"list-disc pl-4 space-y-0.5 text-xs text-fg-dim",children:a.notes.map(i=>e.jsx("li",{children:i},i))})]},a.id))})]},s.id)})})}export{X as DataModel};