claude-code-session-manager 0.39.3 → 0.40.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-B90xy18x.js → TiptapBody-CNr1qGoi.js} +1 -1
  2. package/dist/assets/{index-DVlD8N1X.css → index-CR-WdMgm.css} +1 -1
  3. package/dist/assets/index-oMNYp73N.js +3194 -0
  4. package/dist/index.html +2 -2
  5. package/package.json +1 -1
  6. package/plugins/session-manager-dev/skills/develop/SKILL.md +34 -27
  7. package/scripts/lib/watchdogHelpers.cjs +57 -21
  8. package/src/main/__tests__/health-prd-migration.test.cjs +37 -0
  9. package/src/main/__tests__/prdCreate.test.cjs +54 -15
  10. package/src/main/__tests__/prdSourcePromptIdBackfill.test.cjs +118 -0
  11. package/src/main/__tests__/queueHistory.test.cjs +9 -4
  12. package/src/main/__tests__/queueOpsAutoArchive.test.cjs +12 -0
  13. package/src/main/__tests__/scheduler-archived-twin-guard.test.cjs +92 -0
  14. package/src/main/__tests__/scheduler-unreadable-queue-guard.test.cjs +1 -1
  15. package/src/main/__tests__/uniquePrdNumbers.test.cjs +119 -0
  16. package/src/main/chatRunner.cjs +11 -1
  17. package/src/main/config.cjs +10 -0
  18. package/src/main/health.cjs +46 -10
  19. package/src/main/index.cjs +28 -9
  20. package/src/main/ipcSchemas.cjs +10 -0
  21. package/src/main/lib/__tests__/instanceLock.test.cjs +87 -0
  22. package/src/main/lib/__tests__/sessionSlots.test.cjs +55 -0
  23. package/src/main/lib/epicMint.cjs +144 -0
  24. package/src/main/lib/instanceLock.cjs +100 -0
  25. package/src/main/lib/prdCreate.cjs +19 -6
  26. package/src/main/lib/prdLocations.cjs +82 -1
  27. package/src/main/lib/prdMigration.cjs +47 -1
  28. package/src/main/lib/queueHistory.cjs +85 -37
  29. package/src/main/lib/queueStore.cjs +299 -0
  30. package/src/main/lib/schedulerBatch.cjs +36 -4
  31. package/src/main/lib/sessionSlots.cjs +85 -0
  32. package/src/main/pty.cjs +9 -0
  33. package/src/main/queueOps.cjs +20 -1
  34. package/src/main/scheduler/prdParser.cjs +28 -4
  35. package/src/main/scheduler.cjs +333 -52
  36. package/src/main/templates/PRD_AUTHORING.md +9 -5
  37. package/src/preload/api.d.ts +18 -3
  38. package/src/preload/index.cjs +2 -0
  39. package/dist/assets/index-BUuhV6vT.js +0 -3180
@@ -398,16 +398,22 @@ export interface ScheduleJob {
398
398
  */
399
399
  verifierVerdict?: string;
400
400
  /** Per-job values carried in queue.json for dependency checking. */
401
+ /** Explicit cross-PRD ordering (PRD 832): slugs that must complete before
402
+ * this job is eligible. Replaces the retired shared-NN-parallel convention. */
401
403
  dependsOn?: string[];
404
+ /** The originating claude session — the Epic's claudeSessionId, resolved
405
+ * from active-index.json at ingest (PRD 832). An Epic IS a tagged session. */
406
+ originSessionId?: string | null;
402
407
  /** Originating tab id (PRD frontmatter `sourceTabId`), refreshed from the
403
408
  * PRD file on every reconcile. When the PRD was authored from inside a
404
409
  * PromptSessionConversation, this equals that PromptSession's own id
405
410
  * (its chat key) — lets the Scheduler UI trace a job back to the
406
411
  * PromptSession that spawned it. */
407
412
  sourceTabId?: string | null;
408
- /** Originating prompt id (PRD frontmatter `sourcePromptId`) — the chain-root
409
- * PromptTicket id this PRD was dispatched from. Kept alongside `sourceTabId`
410
- * for referential tracing even when the tab/session no longer resolves. */
413
+ /** Originating prompt id (PRD frontmatter `sourcePromptId`) — the
414
+ * PromptSession (Epic) id this PRD was dispatched from. Kept alongside
415
+ * `sourceTabId` for referential tracing even when the tab/session no
416
+ * longer resolves. */
411
417
  sourcePromptId?: string | null;
412
418
  }
413
419
 
@@ -450,6 +456,9 @@ export interface PrdListItem {
450
456
  cwd: string;
451
457
  estimateMinutes: number | null;
452
458
  mtimeMs: number;
459
+ /** PRD frontmatter `sourcePromptId` — the PromptSession (Epic) id this PRD
460
+ * was dispatched from, if any. */
461
+ sourcePromptId?: string | null;
453
462
  }
454
463
 
455
464
  export interface SupervisorConfig {
@@ -1092,6 +1101,10 @@ export interface SessionManagerAPI {
1092
1101
  write: (payload: { tabId: string; data: string }) => void;
1093
1102
  resize: (payload: { tabId: string; cols: number; rows: number }) => void;
1094
1103
  kill: (tabId: string) => void;
1104
+ /** Subset of `tabIds` (session keys) that currently have a live PTY —
1105
+ * used by the Epics workspace to reconcile Terminal-mode attachment
1106
+ * after a renderer reload (PRD 833 C1). */
1107
+ alive: (tabIds: string[]) => Promise<string[]>;
1095
1108
  onData: (tabId: string, handler: (data: string) => void) => () => void;
1096
1109
  onExit: (tabId: string, handler: (info: PtyExit) => void) => () => void;
1097
1110
  onWriteError: (handler: (ev: WriteErrorEvent) => void) => () => void;
@@ -1277,6 +1290,8 @@ export interface SessionManagerAPI {
1277
1290
  };
1278
1291
  schedule: {
1279
1292
  state: () => Promise<ScheduleStateSnapshot>;
1293
+ /** Machine-wide claude -p slot pool (sessionSlots.cjs): total/inUse/holders. */
1294
+ sessionSlots: () => Promise<{ total: number; inUse: number; holders: { owner: string; at: string }[] }>;
1280
1295
  setConfig: (partial: Partial<ScheduleConfig & { supervisor?: Partial<SupervisorConfig> }>) => Promise<{ ok: boolean; config: ScheduleConfig }>;
1281
1296
  resetJob: (slug: string) => Promise<{ ok: boolean; error?: string }>;
1282
1297
  runNow: () => Promise<{ ok: boolean }>;
@@ -36,6 +36,7 @@ contextBridge.exposeInMainWorld('api', {
36
36
  write: (payload) => ipcRenderer.send('pty:write', payload),
37
37
  resize: (payload) => ipcRenderer.send('pty:resize', payload),
38
38
  kill: (tabId) => ipcRenderer.send('pty:kill', tabId),
39
+ alive: (tabIds) => ipcRenderer.invoke('pty:alive', { tabIds }),
39
40
  onData: (tabId, handler) => {
40
41
  const channel = `pty:data:${tabId}`;
41
42
  const listener = (_e, data) => handler(data);
@@ -247,6 +248,7 @@ contextBridge.exposeInMainWorld('api', {
247
248
  },
248
249
  schedule: {
249
250
  state: () => ipcRenderer.invoke('schedule:state'),
251
+ sessionSlots: () => ipcRenderer.invoke('schedule:session-slots'),
250
252
  setConfig: (partial) => ipcRenderer.invoke('schedule:set-config', partial),
251
253
  resetJob: (slug) => ipcRenderer.invoke('schedule:reset-job', { slug }),
252
254
  runNow: () => ipcRenderer.invoke('schedule:run-now'),