claude-code-session-manager 0.128.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 (108) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +2 -0
  3. package/dist/assets/AgentLibrary-ctvNes4y.js +2 -0
  4. package/dist/assets/AppSettings-C03qTDSi.js +2 -0
  5. package/dist/assets/Button-fOCJry21.js +1 -0
  6. package/dist/assets/Extensions-BWiDwigT.js +13 -0
  7. package/dist/assets/{History-4rrDdWNP.js → History-BIQFPXM8.js} +2 -2
  8. package/dist/assets/Library-BGmD-xZN.js +32 -0
  9. package/dist/assets/ListDetail-BeO3lY8t.js +1 -0
  10. package/dist/assets/{Memory-DgQlvQrO.js → Memory-BeXuYIcE.js} +8 -8
  11. package/dist/assets/{Panel-DZHiD8Ar.js → Panel-OUbLHNsS.js} +1 -1
  12. package/dist/assets/ProvenanceBadge-kr7arZqu.js +1 -0
  13. package/dist/assets/Scheduler-DycegnjH.js +16 -0
  14. package/dist/assets/Settings-BSq6VASG.js +2 -0
  15. package/dist/assets/{SkillReferenceGraph-C5lKqf5y.js → SkillReferenceGraph-CvPdxg56.js} +1 -1
  16. package/dist/assets/SourceChip-C2YMnlV8.js +1 -0
  17. package/dist/assets/SystemPrompt-fpXEK_Rm.js +1 -0
  18. package/dist/assets/{TiptapBody-C2Iu6rZd.js → TiptapBody-DusJg0je.js} +1 -1
  19. package/dist/assets/{Toggle-C-oD66BG.js → Toggle-BnJF4V6k.js} +1 -1
  20. package/dist/assets/ViewTabs-BYrRSHb6.js +1 -0
  21. package/dist/assets/VoiceButton-Bk66E-fP.js +1 -0
  22. package/dist/assets/{historyTotals-CbRSLD8f.js → historyTotals-DnuVADtI.js} +1 -1
  23. package/dist/assets/{index-DtdWBGrI.css → index-Bp8XE9A6.css} +1 -1
  24. package/dist/assets/index-DfWJO7nP.js +3086 -0
  25. package/dist/index.html +2 -2
  26. package/dist-web/app.css +1 -1
  27. package/dist-web/app.js +391 -405
  28. package/package.json +1 -1
  29. package/plugins/CLAUDE.md +2 -2
  30. package/plugins/session-manager-dev/.claude-plugin/plugin.json +2 -2
  31. package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +2 -2
  32. package/plugins/session-manager-dev/skills/develop/SKILL.md +7 -5
  33. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +62 -0
  34. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +169 -0
  35. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +183 -0
  36. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +39 -0
  37. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +79 -0
  38. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +400 -0
  39. package/scripts/hooks/lib/guard-inline-implementation-policy.cjs +10 -0
  40. package/scripts/scheduler-mcp-server.cjs +25 -6
  41. package/src/main/agentLibrary.cjs +36 -10
  42. package/src/main/build-info.json +4 -4
  43. package/src/main/chatRunner.cjs +8 -0
  44. package/src/main/config.cjs +15 -0
  45. package/src/main/health.cjs +49 -22
  46. package/src/main/index.cjs +32 -3
  47. package/src/main/ipcSchemas.cjs +39 -4
  48. package/src/main/lib/claude/agentModelResolve.cjs +5 -3
  49. package/src/main/lib/claude/effectiveModelInfo.cjs +14 -4
  50. package/src/main/lib/claude/modelCatalog.cjs +26 -15
  51. package/src/main/lib/claudeConfig.cjs +156 -0
  52. package/src/main/lib/effectiveSettings.cjs +120 -0
  53. package/src/main/lib/epic/delegationReadiness.cjs +3 -3
  54. package/src/main/lib/epic/developLoopSpawn.cjs +18 -0
  55. package/src/main/lib/epic/epicMint.cjs +4 -2
  56. package/src/main/lib/epic/promptSessionsCreateEpic.cjs +4 -3
  57. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +21 -21
  58. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +84 -11
  59. package/src/main/lib/git/gitWorktree.cjs +400 -9
  60. package/src/main/lib/git/runtimeStateUntrack.cjs +124 -0
  61. package/src/main/lib/mcpToolCatalog.cjs +8 -2
  62. package/src/main/lib/memoryDirResolve.cjs +2 -8
  63. package/src/main/lib/opsOwnership.cjs +63 -2
  64. package/src/main/lib/persona-macro/builtinMacros.cjs +30 -0
  65. package/src/main/lib/persona-macro/macroLibrary.cjs +34 -6
  66. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +46 -0
  67. package/src/main/lib/prd/prdCreate.cjs +15 -0
  68. package/src/main/lib/promptSessionSchema.cjs +8 -0
  69. package/src/main/lib/updateCheck.cjs +6 -1
  70. package/src/main/pluginInstall.cjs +100 -1
  71. package/src/main/scheduler.cjs +12 -2
  72. package/src/main/seedDevPlugin.cjs +2 -1
  73. package/src/main/templates/PRD_AUTHORING.md +3 -3
  74. package/src/main/updaterIpc.cjs +5 -1
  75. package/src/main/usage.cjs +5 -20
  76. package/src/main/voiceHotkey.cjs +16 -0
  77. package/src/main/voiceSettings.cjs +24 -0
  78. package/src/main/voiceWizard.cjs +27 -36
  79. package/src/preload/api.d.ts +59 -3
  80. package/src/preload/apiSurface.json +70 -7
  81. package/src/preload/index.cjs +17 -1
  82. package/src/seed/agents/architect.md +8 -8
  83. package/src/seed/agents/demo-video-builder.md +2 -2
  84. package/src/seed/agents/validator.md +2 -2
  85. package/dist/assets/AgentLibrary-cNQU5YWy.js +0 -2
  86. package/dist/assets/Button-9dIPAOBg.js +0 -1
  87. package/dist/assets/DataModel-DrDJ6ysw.js +0 -1
  88. package/dist/assets/Hooks-Bj_jF5Pa.js +0 -3
  89. package/dist/assets/Library-D-Wsxrh7.js +0 -46
  90. package/dist/assets/ListDetail-D7Om0H8j.js +0 -1
  91. package/dist/assets/McpServers-CbIbSd5o.js +0 -2
  92. package/dist/assets/Permissions-CfzduF4B.js +0 -3
  93. package/dist/assets/Plugins-D-AG5nAo.js +0 -2
  94. package/dist/assets/ProvenanceBadge-B9JSEjll.js +0 -1
  95. package/dist/assets/SaveBar-mVKig6hL.js +0 -1
  96. package/dist/assets/Scheduler-DFTCnh60.js +0 -16
  97. package/dist/assets/ScopeSwitcher-s8J-yr7Z.js +0 -1
  98. package/dist/assets/Settings-BTmxRMaP.js +0 -4
  99. package/dist/assets/Skills-CxOacq0k.js +0 -2
  100. package/dist/assets/SystemPrompt-BCWg5FAz.js +0 -1
  101. package/dist/assets/TagLibrary-BnF0_PkG.js +0 -1
  102. package/dist/assets/ViewTabs-Cs4v7vLY.js +0 -1
  103. package/dist/assets/index-DzY_GXYY.js +0 -3081
  104. package/dist/assets/listSkills-C1aWKf0T.js +0 -1
  105. package/dist/assets/settingsSchema-bSBfHuan.js +0 -1
  106. package/dist/assets/skillFrontmatter-BEseWm8r.js +0 -10
  107. package/dist/assets/useAgentsDirWatch-CdyHxKCI.js +0 -1
  108. package/src/main/lib/epic/epicStandingInstructions.cjs +0 -73
@@ -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>;
@@ -1850,6 +1882,7 @@ export interface SessionManagerAPI {
1850
1882
  installSelfScheduleGuard: (cwd: string) => Promise<InstallGuardResult>;
1851
1883
  onNewSession: (handler: () => void) => () => void;
1852
1884
  onRebootSession: (handler: () => void) => () => void;
1885
+ onOpenFreeHour: (handler: () => void) => () => void;
1853
1886
  archiveProject: (encoded: string) => Promise<{ ok: boolean; error?: string }>;
1854
1887
  };
1855
1888
  pty: {
@@ -1921,7 +1954,7 @@ export interface SessionManagerAPI {
1921
1954
  * with the renderer's `useEffectiveSettings.ts` scope-chain reader for
1922
1955
  * the effortLevel/effortSource half — this call only covers the parts
1923
1956
  * that need main-process filesystem access. */
1924
- resolveModelInfo: (payload: { cwd: string; agentType: string }) => Promise<{
1957
+ resolveModelInfo: (payload: { cwd: string; agentType?: string }) => Promise<{
1925
1958
  agentType: string;
1926
1959
  modelAlias: string | null;
1927
1960
  modelSource: 'persona' | 'persona-overlay' | 'inherit' | 'fallback';
@@ -1958,6 +1991,8 @@ export interface SessionManagerAPI {
1958
1991
  delete: (payload: { id: string }) => Promise<{ ok: boolean }>;
1959
1992
  /** Add/remove one project cwd. A macro shown in every project (`'*'`) cannot be narrowed: `{ ok: false, error: 'macro is shown in every project' }`. */
1960
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 }>;
1961
1996
  /** Dispatch a built-in macro's background build as a scheduler job. */
1962
1997
  dispatchJob: (payload: MacroJobDispatchInput) => Promise<MacroJobDispatchResult>;
1963
1998
  /** Status of this project's macro background builds. */
@@ -1995,6 +2030,11 @@ export interface SessionManagerAPI {
1995
2030
  ) => void;
1996
2031
  dir: () => Promise<string>;
1997
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
+ };
1998
2038
  config: {
1999
2039
  readJson: (path: string) => Promise<ReadJsonResult>;
2000
2040
  readText: (path: string, opts?: ReadTextOptions) => Promise<ReadTextResult>;
@@ -2003,6 +2043,8 @@ export interface SessionManagerAPI {
2003
2043
  writeJson: (path: string, data: unknown, writer?: OpsWriter) => Promise<WriteResult>;
2004
2044
  writeText: (path: string, text: string, writer?: OpsWriter) => Promise<WriteResult>;
2005
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>;
2006
2048
  exists: (path: string) => Promise<boolean>;
2007
2049
  watch: (paths: string[], opts?: { depth?: 0 | 1 | 2 }) => void;
2008
2050
  unwatch: (paths: string[], opts?: { depth?: 0 | 1 | 2 }) => void;
@@ -2023,6 +2065,10 @@ export interface SessionManagerAPI {
2023
2065
  getWizardState: () => Promise<VoiceWizardState>;
2024
2066
  /** F7: stamp wizard as complete with the current schema. */
2025
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 }>;
2026
2072
  /** F8 — read persisted turn-detector settings. */
2027
2073
  getTurnDetector: () => Promise<VoiceTurnDetectorState>;
2028
2074
  /** F8 — persist turn-detector settings. */
@@ -2200,6 +2246,12 @@ export interface SessionManagerAPI {
2200
2246
  marketplace?: { add: string; name: string };
2201
2247
  }) => Promise<PluginInstallResult>;
2202
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>;
2203
2255
  };
2204
2256
  clipboard: {
2205
2257
  /** Ctrl+V image paste — reads OS clipboard, saves any image to a temp
@@ -2297,7 +2349,7 @@ export interface SessionManagerAPI {
2297
2349
  * Kind allowlist is enforced main-side (ipcSchemas.cjs) — this channel is
2298
2350
  * append-only, no read/list IPC exists. */
2299
2351
  append: (
2300
- 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',
2301
2353
  fields: { cwd: string; epicId: string; source: string },
2302
2354
  ) => Promise<{ ok: boolean }>;
2303
2355
  };
@@ -2463,6 +2515,8 @@ export interface PromptSessionsCreateEpicPayload {
2463
2515
  /** Per-Epic model/effort overrides (New Session card); omitted = the persona's own. */
2464
2516
  model?: string;
2465
2517
  effort?: string;
2518
+ /** Absent = develop loop on; false = started without it, fixed for the life of the session. */
2519
+ developLoop?: boolean;
2466
2520
  source?: {
2467
2521
  producer: 'new-epic-ui' | 'scheduler-dispatch';
2468
2522
  prdSlug?: string;
@@ -2480,6 +2534,8 @@ export interface PromptSessionsCreateEpicPayload {
2480
2534
  label: string;
2481
2535
  text: string;
2482
2536
  source?: string;
2537
+ /** Which part of its AIM slot this entry is; absent on Epics minted before AIM sections. */
2538
+ part?: 'persona' | 'grounding' | 'injection' | 'reference' | 'job-type' | 'goal';
2483
2539
  }>;
2484
2540
  }
2485
2541
 
@@ -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",
@@ -174,6 +167,13 @@
174
167
  "kind": "on",
175
168
  "remote": "read"
176
169
  },
170
+ {
171
+ "ns": "app",
172
+ "method": "onOpenFreeHour",
173
+ "channel": "app:open-free-hour",
174
+ "kind": "on",
175
+ "remote": "deny"
176
+ },
177
177
  {
178
178
  "ns": "pty",
179
179
  "method": "spawn",
@@ -440,6 +440,13 @@
440
440
  "kind": "invoke",
441
441
  "remote": "mutate"
442
442
  },
443
+ {
444
+ "ns": "macros",
445
+ "method": "removeFromProject",
446
+ "channel": "macros:remove-from-project",
447
+ "kind": "invoke",
448
+ "remote": "mutate"
449
+ },
443
450
  {
444
451
  "ns": "macros",
445
452
  "method": "dispatchJob",
@@ -524,6 +531,13 @@
524
531
  "kind": "invoke",
525
532
  "remote": "deny"
526
533
  },
534
+ {
535
+ "ns": "config",
536
+ "method": "canWrite",
537
+ "channel": "config:can-write",
538
+ "kind": "invoke",
539
+ "remote": "deny"
540
+ },
527
541
  {
528
542
  "ns": "config",
529
543
  "method": "watch",
@@ -552,6 +566,20 @@
552
566
  "kind": "on",
553
567
  "remote": "deny"
554
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
+ },
555
583
  {
556
584
  "ns": "voice",
557
585
  "method": "onHotkey",
@@ -622,6 +650,20 @@
622
650
  "kind": "invoke",
623
651
  "remote": "read"
624
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
+ },
625
667
  {
626
668
  "ns": "voice",
627
669
  "method": "setTurnDetector",
@@ -1147,6 +1189,27 @@
1147
1189
  "kind": "invoke",
1148
1190
  "remote": "deny"
1149
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
+ },
1150
1213
  {
1151
1214
  "ns": "plugins",
1152
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'),
@@ -50,6 +49,11 @@ contextBridge.exposeInMainWorld('api', {
50
49
  ipcRenderer.on('app:reboot-session', listener);
51
50
  return () => ipcRenderer.removeListener('app:reboot-session', listener);
52
51
  },
52
+ onOpenFreeHour: (handler) => {
53
+ const listener = () => handler();
54
+ ipcRenderer.on('app:open-free-hour', listener);
55
+ return () => ipcRenderer.removeListener('app:open-free-hour', listener);
56
+ },
53
57
  },
54
58
  pty: {
55
59
  spawn: (payload) => ipcRenderer.invoke('pty:spawn', payload),
@@ -136,6 +140,7 @@ contextBridge.exposeInMainWorld('api', {
136
140
  list: () => ipcRenderer.invoke('macros:list'),
137
141
  save: (payload) => ipcRenderer.invoke('macros:save', payload),
138
142
  delete: (payload) => ipcRenderer.invoke('macros:delete', payload),
143
+ removeFromProject: (payload) => ipcRenderer.invoke('macros:remove-from-project', payload),
139
144
  setProject: (payload) => ipcRenderer.invoke('macros:set-project', payload),
140
145
  dispatchJob: (payload) => ipcRenderer.invoke('macros:dispatch-job', payload),
141
146
  jobStatus: (payload) => ipcRenderer.invoke('macros:job-status', payload),
@@ -157,12 +162,17 @@ contextBridge.exposeInMainWorld('api', {
157
162
  ipcRenderer.send('log:write', { scope, level, message, meta, ...ctx }),
158
163
  dir: () => ipcRenderer.invoke('log:dir'),
159
164
  },
165
+ claudeConfig: {
166
+ read: (payload) => ipcRenderer.invoke('claudeConfig:read', payload),
167
+ patch: (payload) => ipcRenderer.invoke('claudeConfig:patch', payload),
168
+ },
160
169
  config: {
161
170
  readJson: (path) => ipcRenderer.invoke('config:read-json', { path }),
162
171
  readText: (path, opts) => ipcRenderer.invoke('config:read-text', { path, maxBytes: opts?.maxBytes }),
163
172
  writeJson: (path, data, writer) => ipcRenderer.invoke('config:write-json', { path, data, writer }),
164
173
  writeText: (path, text, writer) => ipcRenderer.invoke('config:write-text', { path, text, writer }),
165
174
  listDir: (path, opts) => ipcRenderer.invoke('config:list-dir', { path, opts }),
175
+ canWrite: (path) => ipcRenderer.invoke('config:can-write', { path }),
166
176
  exists: (path) => ipcRenderer.invoke('config:exists', { path }),
167
177
  watch: (paths, opts) => ipcRenderer.send('config:watch', { paths, opts }),
168
178
  unwatch: (paths, opts) => ipcRenderer.send('config:unwatch', { paths, opts }),
@@ -195,6 +205,9 @@ contextBridge.exposeInMainWorld('api', {
195
205
  markWizardComplete: () => ipcRenderer.invoke('voice:wizard-complete'),
196
206
  // F8 turn-detector settings (~/.claude/session-manager/voice.json `turnDetector` key).
197
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),
198
211
  getTurnDetector: () => ipcRenderer.invoke('voice:get-turn-detector'),
199
212
  setTurnDetector: (state) => ipcRenderer.invoke('voice:set-turn-detector', state),
200
213
  },
@@ -338,6 +351,9 @@ contextBridge.exposeInMainWorld('api', {
338
351
  plugins: {
339
352
  install: (payload) => ipcRenderer.invoke('plugins:install', payload),
340
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),
341
357
  onInstallProgress: (handler) => {
342
358
  const listener = (_e, payload) => handler(payload);
343
359
  ipcRenderer.on('plugins:install-progress', listener);
@@ -6,7 +6,7 @@ model: opus
6
6
  effort: medium
7
7
  tags: feature, bug, discussion, art
8
8
  title: Engineering — Architect
9
- seedVersion: 3
9
+ seedVersion: 5
10
10
  ---
11
11
 
12
12
  You are the architect. You are the one Actor a human talks to for the whole life of an Epic's
@@ -36,8 +36,8 @@ parallel process, the same way `/develop` itself references `standards.md` inste
36
36
  5. **Never treat "the tests pass" as "it's done."** Verify live against the real acceptance
37
37
  criteria before reporting anything as complete.
38
38
  6. **Stay agnostic about what kind of work this is.** Whether this Epic is a feature build, a bug
39
- fix, or an open-ended discussion is decided by its Mission tag, which frames the conversation
40
- before this persona's own line is even read. Don't restate or second-guess that framing here —
39
+ fix, or an open-ended discussion is decided by its Mission tag, which reaches you in the Mission
40
+ part of the opening prompt, after this persona. Don't restate or second-guess that framing here —
41
41
  your job is *how* to plan, not *what* the work is.
42
42
 
43
43
  ## Relationship to `dev-lead`
@@ -49,11 +49,11 @@ You and `dev-lead` are deliberately different scopes, not two names for the same
49
49
  the overall plan — it reads a PRD's Goal/Acceptance Criteria/Implementation notes and executes
50
50
  that PRD, nothing more.
51
51
 
52
- There is no automatic wiring that assigns `dev-lead` to a scheduled PRD run today — PRD execution
53
- has no persona/agentType field. If a PRD should be executed *as* `dev-lead`, say so explicitly in
54
- that PRD's own Implementation notes (e.g. "work as the dev-lead persona — read
55
- `~/.claude/agents/dev-lead.md` first"), the same way a PRD already points its executor at
56
- `standards.md` by path. Don't assume it happens by default.
52
+ A PRD's `agentType` frontmatter names its executor. When omitted, the PRD API stamps `dev-lead`.
53
+ Set it only when another persona must run the PRD (`validator` on the validate PRD, the project's
54
+ art persona on art PRDs). The scheduler reads it at dispatch and launches the run as that persona:
55
+ its body appended as the system prompt, plus its model, effort and tools. You can change it before
56
+ the run with `scheduler_update_prd`.
57
57
 
58
58
  ## What you don't do
59
59
 
@@ -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-DzY_GXYY.js";import{P as he}from"./Panel-DZHiD8Ar.js";import{L as pe}from"./ListDetail-D7Om0H8j.js";import{B as R}from"./Button-9dIPAOBg.js";import{u as ue,t as ge,a as ve}from"./useAgentsDirWatch-CdyHxKCI.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-DzY_GXYY.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};