claude-code-session-manager 0.35.18 → 0.37.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 (39) hide show
  1. package/dist/assets/{TiptapBody-DgFO_m3g.js → TiptapBody-Cg8YZhVZ.js} +58 -58
  2. package/dist/assets/index-CTTjT08J.css +32 -0
  3. package/dist/assets/index-_iBXLuvt.js +3496 -0
  4. package/dist/index.html +2 -2
  5. package/package.json +1 -1
  6. package/plugins/session-manager-dev/skills/develop/SKILL.md +5 -1
  7. package/src/main/__tests__/broadcastCoalescer.test.cjs +104 -0
  8. package/src/main/__tests__/docEdit.test.cjs +82 -0
  9. package/src/main/__tests__/historyDashboard.test.cjs +163 -0
  10. package/src/main/__tests__/historyRollup.test.cjs +333 -0
  11. package/src/main/__tests__/memoryStale.test.cjs +88 -0
  12. package/src/main/__tests__/prdParserHighWater.test.cjs +74 -0
  13. package/src/main/__tests__/queueHistory.test.cjs +233 -0
  14. package/src/main/__tests__/queueOpsAutoArchive.test.cjs +142 -0
  15. package/src/main/__tests__/rcaFeedbackHook.test.cjs +259 -0
  16. package/src/main/__tests__/scheduler-committed-in-window.test.cjs +4 -5
  17. package/src/main/__tests__/scheduler-effective-concurrency.test.cjs +51 -0
  18. package/src/main/chatRunner.cjs +57 -18
  19. package/src/main/config.cjs +8 -0
  20. package/src/main/docEdit.cjs +133 -0
  21. package/src/main/files.cjs +53 -0
  22. package/src/main/historyAggregator.cjs +391 -50
  23. package/src/main/historyDashboard.cjs +226 -0
  24. package/src/main/index.cjs +37 -1
  25. package/src/main/ipcSchemas.cjs +29 -0
  26. package/src/main/lib/broadcastCoalescer.cjs +46 -0
  27. package/src/main/lib/historyRollup.cjs +148 -0
  28. package/src/main/lib/memoryStale.cjs +116 -0
  29. package/src/main/lib/queueHistory.cjs +216 -0
  30. package/src/main/lib/rcaFeedbackHook.cjs +346 -0
  31. package/src/main/lib/schedulerConfig.cjs +16 -0
  32. package/src/main/memoryTool.cjs +49 -0
  33. package/src/main/queueOps.cjs +92 -0
  34. package/src/main/scheduler/prdParser.cjs +52 -1
  35. package/src/main/scheduler.cjs +237 -29
  36. package/src/preload/api.d.ts +92 -1
  37. package/src/preload/index.cjs +7 -0
  38. package/dist/assets/index-4dJkn9nT.js +0 -3559
  39. package/dist/assets/index-DX2w2YhJ.css +0 -32
@@ -500,6 +500,12 @@ export interface SchedulePollHealth {
500
500
  lastFailureKind: string | null;
501
501
  }
502
502
 
503
+ export interface ScheduleEffectiveConcurrency {
504
+ cap: number;
505
+ /** 'env' when SM_SCHEDULER_MAX_CONCURRENCY pins the cap; 'config' when concurrencyCap governs. */
506
+ source: 'env' | 'config';
507
+ }
508
+
503
509
  export interface ScheduleStateSnapshot {
504
510
  config: ScheduleConfig & { supervisor?: SupervisorConfig };
505
511
  jobs: ScheduleJob[];
@@ -512,6 +518,8 @@ export interface ScheduleStateSnapshot {
512
518
  utilization: number | null;
513
519
  /** Poll health — last billing poll result; used to detect stale utilization. */
514
520
  pollHealth?: SchedulePollHealth;
521
+ /** Effective concurrency cap and whether it's env-pinned or config-driven. */
522
+ effectiveConcurrency: ScheduleEffectiveConcurrency;
515
523
  /** Returned only by the initial state() call, not the broadcast event. */
516
524
  paths?: SchedulePaths;
517
525
  }
@@ -567,6 +575,63 @@ export interface SessionScanResult {
567
575
  scannedMs: number;
568
576
  }
569
577
 
578
+ export interface HistoryDashboardRequest {
579
+ rangeDays: 30 | 60 | 90 | 0;
580
+ }
581
+
582
+ export interface HistoryDashboardTotals {
583
+ promptCount: number;
584
+ inputTokens: number;
585
+ outputTokens: number;
586
+ cacheReadTokens: number;
587
+ cacheCreationTokens: number;
588
+ toolCallCount: number;
589
+ sessionCount: number;
590
+ errorCount: number;
591
+ activeMinutes: number;
592
+ estimatedCostUsd: number;
593
+ }
594
+
595
+ export interface HistoryDashboardProjectRow extends HistoryDashboardTotals {
596
+ date: string;
597
+ projectDir: string;
598
+ toolBreakdown: Record<string, number>;
599
+ byModel: Record<string, {
600
+ inputTokens: number;
601
+ outputTokens: number;
602
+ cacheReadTokens: number;
603
+ cacheCreationTokens: number;
604
+ costUsd: number;
605
+ estimated?: boolean;
606
+ }>;
607
+ }
608
+
609
+ export interface HistoryDashboardDay {
610
+ date: string;
611
+ byProject: Record<string, HistoryDashboardProjectRow>;
612
+ }
613
+
614
+ export interface HistoryDashboardResult {
615
+ from: string;
616
+ to: string;
617
+ days: HistoryDashboardDay[];
618
+ prevTotals: HistoryDashboardTotals;
619
+ totals: HistoryDashboardTotals;
620
+ byProjectTotals: Record<string, HistoryDashboardTotals>;
621
+ byModelTotals: Record<string, {
622
+ inputTokens: number;
623
+ outputTokens: number;
624
+ cacheReadTokens: number;
625
+ cacheCreationTokens: number;
626
+ costUsd: number;
627
+ estimated?: boolean;
628
+ }>;
629
+ toolsByProject: Record<string, Record<string, number>>;
630
+ generatedAt: number;
631
+ /** Dates included in `days` that are NOT yet finalized (typically just today). */
632
+ provisionalDates: string[];
633
+ }
634
+
570
635
 
571
636
  export interface FileEntry {
572
637
  name: string;
@@ -583,6 +648,8 @@ export interface FilesWriteResult { ok: boolean; error: string | null }
583
648
  export interface FilesCreateResult { ok: boolean; path?: string; error: string | null }
584
649
  export interface FilesRenameResult { ok: boolean; newPath?: string; error: string | null }
585
650
  export interface FilesDeleteResult { ok: boolean; error: string | null }
651
+ export interface FilesDuplicateResult { ok: boolean; path?: string; error?: string | null }
652
+ export interface DocEditResult { ok: boolean; after?: string; error?: string }
586
653
 
587
654
  export interface SearchFileEntry {
588
655
  name: string;
@@ -796,6 +863,21 @@ export interface MemoryAggregateResult {
796
863
  error?: string;
797
864
  }
798
865
 
866
+ export interface MemoryStaleEntry {
867
+ name: string;
868
+ ageDays: number;
869
+ inboundLinks: number;
870
+ deadRefs: string[];
871
+ stale: boolean;
872
+ reasons: string[];
873
+ }
874
+
875
+ export interface MemoryStaleResult {
876
+ entries: MemoryStaleEntry[];
877
+ workspace: string;
878
+ error: string | null;
879
+ }
880
+
799
881
  // ────────────────────────────────────────────── Per-subagent memory
800
882
  // Stored at ~/.claude/session-manager/agent-memory/<agentId>.json. Keyed by
801
883
  // agent name (the .md filename in ~/.claude/agents/), not by workspace cwd.
@@ -993,7 +1075,9 @@ export interface ChatRunNeedsInputEvent {
993
1075
  sessionId: string;
994
1076
  /** Questions the agent is blocked on. */
995
1077
  questions: string[];
996
- /** Full raw assistant text including the stop-signal sentinel. */
1078
+ /** Everything the agent produced before the stop-signal sentinel, trimmed. */
1079
+ answerBody: string;
1080
+ /** Full raw assistant text including the stop-signal sentinel. @deprecated use answerBody */
997
1081
  raw: string;
998
1082
  }
999
1083
 
@@ -1185,6 +1269,10 @@ export interface SessionManagerAPI {
1185
1269
  create: (parentPath: string, name: string, kind: 'file' | 'folder') => Promise<FilesCreateResult>;
1186
1270
  rename: (path: string, newName: string) => Promise<FilesRenameResult>;
1187
1271
  delete: (path: string) => Promise<FilesDeleteResult>;
1272
+ duplicate: (path: string) => Promise<FilesDuplicateResult>;
1273
+ };
1274
+ docEdit: {
1275
+ run: (payload: { path: string; before: string; instruction: string }) => Promise<DocEditResult>;
1188
1276
  };
1189
1277
  /** Consolidated shell open/reveal. One method, discriminated on `as`, replaces
1190
1278
  * the former app.openIn* / app.openExternal / files.openExternal / files.showInFinder.
@@ -1217,6 +1305,7 @@ export interface SessionManagerAPI {
1217
1305
  history: {
1218
1306
  aggregate: (req?: HistoryAggregateRequest) => Promise<HistoryAggregateResult>;
1219
1307
  scanProjects: () => Promise<SessionScanResult>;
1308
+ dashboard: (req: HistoryDashboardRequest) => Promise<HistoryDashboardResult>;
1220
1309
  };
1221
1310
  schedule: {
1222
1311
  state: () => Promise<ScheduleStateSnapshot>;
@@ -1301,6 +1390,8 @@ export interface SessionManagerAPI {
1301
1390
  create: (name: string, description?: string, workspace?: string) => Promise<MemoryMutationResult>;
1302
1391
  /** Aggregate workspace memories into semantic clusters. `refresh:true` fires a cost-gated `claude -p` pass; otherwise returns the cache only. */
1303
1392
  aggregate: (workspace: string, refresh?: boolean) => Promise<MemoryAggregateResult>;
1393
+ /** Deterministic, zero-LLM-cost staleness report. `cwd` (optional) scopes the dead-repo-ref check. */
1394
+ stale: (workspace?: string, cwd?: string) => Promise<MemoryStaleResult>;
1304
1395
  };
1305
1396
  agentMemory: {
1306
1397
  /** List all memory entries for one subagent. Sorted newest first. */
@@ -216,6 +216,7 @@ contextBridge.exposeInMainWorld('api', {
216
216
  history: {
217
217
  aggregate: (req) => ipcRenderer.invoke('history:aggregate', req),
218
218
  scanProjects: () => ipcRenderer.invoke('history:scan-projects'),
219
+ dashboard: (req) => ipcRenderer.invoke('history:dashboard', req),
219
220
  },
220
221
  files: {
221
222
  list: (path, showHidden) => ipcRenderer.invoke('files:list', { path, showHidden }),
@@ -224,6 +225,10 @@ contextBridge.exposeInMainWorld('api', {
224
225
  create: (parentPath, name, kind) => ipcRenderer.invoke('files:create', { parentPath, name, kind }),
225
226
  rename: (path, newName) => ipcRenderer.invoke('files:rename', { path, newName }),
226
227
  delete: (path) => ipcRenderer.invoke('files:delete', { path }),
228
+ duplicate: (path) => ipcRenderer.invoke('files:duplicate', { path }),
229
+ },
230
+ docEdit: {
231
+ run: (payload) => ipcRenderer.invoke('docedit:run', payload),
227
232
  },
228
233
  // Consolidated shell open/reveal — see shell:open in index.cjs.
229
234
  // as: 'editor' | 'fileInEditor' | 'finder' | 'terminal' | 'external' | 'openPath' | 'revealPath'
@@ -307,6 +312,8 @@ contextBridge.exposeInMainWorld('api', {
307
312
  },
308
313
  aggregate: (workspace, refresh) =>
309
314
  ipcRenderer.invoke('memory:aggregate', refresh ? { workspace, refresh: true } : { workspace }),
315
+ stale: (workspace, cwd) =>
316
+ ipcRenderer.invoke('memory:stale', { ...(workspace ? { workspace } : {}), ...(cwd ? { cwd } : {}) }),
310
317
  },
311
318
  agentMemory: {
312
319
  list: (agentId) => ipcRenderer.invoke('agent-memory:list', { agentId }),