claude-code-session-manager 0.139.0 → 0.141.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 (154) hide show
  1. package/README.md +20 -4
  2. package/dist/assets/AppSettings-DExeJhqQ.js +2 -0
  3. package/dist/assets/History-DJMiuXyK.js +2 -0
  4. package/dist/assets/{HomeClaudeConfig-CGD2Onjv.js → HomeClaudeConfig-CTp2tkZ4.js} +2 -2
  5. package/dist/assets/{Panel-Csyd9HbD.js → Panel-Bf1Cf8UL.js} +1 -1
  6. package/dist/assets/{ProjectClaudeConfig-C-jlYpC_.js → ProjectClaudeConfig-BWPpypf9.js} +1 -1
  7. package/dist/assets/Scheduler-cyr61UAC.js +16 -0
  8. package/dist/assets/{SkillReferenceGraph-DcscPXAG.js → SkillReferenceGraph-Ba4TkX2C.js} +1 -1
  9. package/dist/assets/{Skills-BpGRKOcY.js → Skills-C1v91GEO.js} +26 -26
  10. package/dist/assets/{TiptapBody-DSU3769X.js → TiptapBody-BrcWVpiW.js} +1 -1
  11. package/dist/assets/{ViewTabs-C0PRZx4_.js → ViewTabs-DXhOWFG0.js} +1 -1
  12. package/dist/assets/{VoiceButton-D2rMurNg.js → VoiceButton-qivnDV6K.js} +1 -1
  13. package/dist/assets/{historyTotals-TcIQs2sh.js → historyTotals-CMCPTKqC.js} +1 -1
  14. package/dist/assets/index-B2TQz3nd.js +3121 -0
  15. package/dist/assets/{index-BCySPdtU.css → index-DKXdXfka.css} +1 -1
  16. package/dist/index.html +2 -2
  17. package/dist-web/app.css +1 -1
  18. package/dist-web/app.js +423 -426
  19. package/package.json +5 -2
  20. package/plugins/AGENTS.md +60 -0
  21. package/plugins/CLAUDE.md +1 -60
  22. package/plugins/session-manager-dev/skills/builder/SKILL.md +4 -2
  23. package/plugins/session-manager-dev/skills/develop/SKILL.md +29 -19
  24. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
  25. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
  26. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
  27. package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
  28. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
  29. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
  30. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
  31. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
  32. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
  33. package/scripts/README.md +1 -0
  34. package/scripts/hooks/guard-tool-risk.cjs +91 -0
  35. package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
  36. package/scripts/ops-sweep.cjs +53 -23
  37. package/scripts/scheduler-mcp-server.cjs +205 -18
  38. package/src/main/build-info.json +4 -4
  39. package/src/main/config.cjs +112 -8
  40. package/src/main/docEdit.cjs +6 -1
  41. package/src/main/files.cjs +7 -27
  42. package/src/main/health.cjs +48 -15
  43. package/src/main/historyAggregator.cjs +88 -5
  44. package/src/main/historyDashboard.cjs +69 -4
  45. package/src/main/index.cjs +56 -2
  46. package/src/main/ipcSchemas.cjs +122 -16
  47. package/src/main/lib/AGENTS.md +54 -0
  48. package/src/main/lib/CLAUDE.md +1 -54
  49. package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
  50. package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
  51. package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
  52. package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
  53. package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
  54. package/src/main/lib/claude/effectiveModelInfo.cjs +90 -20
  55. package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
  56. package/src/main/lib/claude/personaToolScope.cjs +12 -6
  57. package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
  58. package/src/main/lib/claude/runClaudeP.cjs +6 -1
  59. package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
  60. package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
  61. package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
  62. package/src/main/lib/ephemeralCwd.cjs +37 -2
  63. package/src/main/lib/epic/delegationReadiness.cjs +42 -9
  64. package/src/main/lib/epic/epicAdminRoutes.cjs +25 -5
  65. package/src/main/lib/epic/epicOutsideRead.cjs +118 -1
  66. package/src/main/lib/epic/epicOutsideState.cjs +2 -2
  67. package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
  68. package/src/main/lib/epic/epicValidationHook.cjs +24 -4
  69. package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
  70. package/src/main/lib/externalContract.cjs +31 -5
  71. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +55 -1
  72. package/src/main/lib/feedback-remote/crossProjectReply.cjs +106 -11
  73. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +47 -19
  74. package/src/main/lib/feedback-remote/needsYouStore.cjs +6 -2
  75. package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
  76. package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
  77. package/src/main/lib/git/branchSweep.cjs +209 -4
  78. package/src/main/lib/git/gitWorktree.cjs +41 -5
  79. package/src/main/lib/guardShims.cjs +1 -1
  80. package/src/main/lib/historyRollup.cjs +26 -0
  81. package/src/main/lib/insideHome.cjs +27 -1
  82. package/src/main/lib/mcpToolCatalog.cjs +132 -13
  83. package/src/main/lib/mdDocCensus.cjs +59 -78
  84. package/src/main/lib/mdDocRefs.cjs +71 -93
  85. package/src/main/lib/mdNetworkScan.cjs +245 -250
  86. package/src/main/lib/mdReviewRecord.cjs +22 -9
  87. package/src/main/lib/memoryMdNetwork.cjs +5 -12
  88. package/src/main/lib/opsOwnership.cjs +18 -2
  89. package/src/main/lib/opsRetentionSettings.cjs +28 -4
  90. package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
  91. package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
  92. package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
  93. package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
  94. package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
  95. package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
  96. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
  97. package/src/main/lib/prd/depSlugResolve.cjs +104 -4
  98. package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
  99. package/src/main/lib/prd/prdCreate.cjs +377 -23
  100. package/src/main/lib/prd/prdDisposition.cjs +11 -2
  101. package/src/main/lib/prd/prdFrontmatter.cjs +121 -3
  102. package/src/main/lib/process/loginItem.cjs +171 -0
  103. package/src/main/lib/process/loginItemPlan.cjs +193 -0
  104. package/src/main/lib/project-pages/playerBridge.cjs +4 -0
  105. package/src/main/lib/project-pages/videoReview.cjs +268 -0
  106. package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
  107. package/src/main/lib/scheduler/cpuSample.cjs +131 -4
  108. package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
  109. package/src/main/lib/scheduler/loadGate.cjs +24 -6
  110. package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
  111. package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
  112. package/src/main/lib/scheduler/preflightCheck.cjs +97 -0
  113. package/src/main/lib/scheduler/queueStore.cjs +7 -0
  114. package/src/main/lib/scheduler/rcaReport.cjs +21 -1
  115. package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
  116. package/src/main/lib/scheduler/reviewNotice.cjs +39 -0
  117. package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
  118. package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
  119. package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
  120. package/src/main/lib/scheduler/schedulerPaths.cjs +3 -0
  121. package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
  122. package/src/main/lib/scheduler/validationQuality.cjs +282 -0
  123. package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
  124. package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
  125. package/src/main/lib/tasks/taskIpc.cjs +80 -0
  126. package/src/main/lib/tasks/taskLedger.cjs +502 -0
  127. package/src/main/lib/tasks/taskRun.cjs +313 -0
  128. package/src/main/lib/tasks/taskSwitch.cjs +120 -0
  129. package/src/main/loginItemIpc.cjs +35 -0
  130. package/src/main/loopEfficiencyHandlers.cjs +10 -1
  131. package/src/main/projectPages.cjs +6 -15
  132. package/src/main/promptSessionEvents.cjs +9 -1
  133. package/src/main/queueOps.cjs +260 -3
  134. package/src/main/runVerify.cjs +53 -25
  135. package/src/main/scheduler/AGENTS.md +26 -0
  136. package/src/main/scheduler/CLAUDE.md +1 -26
  137. package/src/main/scheduler/budget.cjs +239 -9
  138. package/src/main/scheduler/cancelDependents.cjs +154 -0
  139. package/src/main/scheduler/prdParser.cjs +19 -1
  140. package/src/main/scheduler/reviewLadder.cjs +36 -3
  141. package/src/main/scheduler/starvation.cjs +89 -18
  142. package/src/main/scheduler.cjs +1080 -89
  143. package/src/main/supervisor.cjs +5 -1
  144. package/src/main/templates/PRD_AUTHORING.md +14 -1
  145. package/src/main/validationQualityHandlers.cjs +199 -0
  146. package/src/main/webRemote.cjs +10 -2
  147. package/src/preload/api.d.ts +364 -21
  148. package/src/preload/apiSurface.json +89 -10
  149. package/src/preload/index.cjs +23 -2
  150. package/src/seed/agents/validator.md +19 -8
  151. package/dist/assets/AppSettings-CUfWY9vN.js +0 -2
  152. package/dist/assets/History-DDnqaLyw.js +0 -2
  153. package/dist/assets/Scheduler-NLs08fx7.js +0 -16
  154. package/dist/assets/index-C-d0DCre.js +0 -3124
@@ -7,10 +7,15 @@
7
7
 
8
8
  const launchFailure = require('../lib/scheduler/launchFailure.cjs');
9
9
  const { findBlockingDep, DEP_HISTORY_FAIL_OPEN } = require('../lib/scheduler/schedulerBatch.cjs');
10
+ const { makeDepResolver, isSatisfiedDepRow } = require('../lib/prd/depSlugResolve.cjs');
10
11
  const { STARVE_ESCALATION_MS } = require('../lib/scheduler/schedulerConfig.cjs');
11
12
 
12
13
  /**
13
- * computeBlockedChains(jobs) → [{ cwd, blockedBy, blocked }]
14
+ * computeBlockedChains(jobs, satisfiedSlugsByCwd?) → [{ cwd, blockedBy, blocked }]
15
+ *
16
+ * `satisfiedSlugsByCwd`: optional `Map<cwd, Set<string>|DEP_HISTORY_FAIL_OPEN>`
17
+ * of history/archive completion records (budget.computeDepHistorySatisfaction),
18
+ * fed to the shared dep resolver; default empty (no records known).
14
19
  *
15
20
  * Pure, no IO. The gap computeStallSummary above cannot see.
16
21
  *
@@ -31,7 +36,7 @@ const { STARVE_ESCALATION_MS } = require('../lib/scheduler/schedulerConfig.cjs')
31
36
  * Transitive by construction: a row blocked by a row that is itself blocked
32
37
  * resolves through the same walk.
33
38
  */
34
- function computeBlockedChains(jobs) {
39
+ function computeBlockedChains(jobs, satisfiedSlugsByCwd = new Map()) {
35
40
  const rows = (Array.isArray(jobs) ? jobs : []).filter(Boolean);
36
41
  const byCwd = new Map();
37
42
  for (const j of rows) {
@@ -42,20 +47,14 @@ function computeBlockedChains(jobs) {
42
47
 
43
48
  const out = [];
44
49
  for (const [cwd, projectJobs] of byCwd) {
45
- // Reuse the picker's OWN dep resolution so this can never disagree with
46
- // what the scheduler will actually dispatch (bare-name fallback included).
47
- const rowBySlug = new Map(projectJobs.map((j) => [j.slug, j]));
48
- const rowsByBareSlug = new Map();
49
- for (const j of projectJobs) {
50
- const bare = String(j.slug ?? '').replace(/^\d+-/, '');
51
- if (!rowsByBareSlug.has(bare)) rowsByBareSlug.set(bare, []);
52
- rowsByBareSlug.get(bare).push(j);
53
- }
54
- const rowsForDep = (slug) => {
55
- const exact = rowBySlug.get(slug);
56
- if (exact) return [exact];
57
- return rowsByBareSlug.get(String(slug ?? '').replace(/^\d+-/, '')) ?? [];
58
- };
50
+ // The ONE run-time dep rule (depSlugResolve.cjs makeDepResolver) — the
51
+ // same resolver schedulerBatch.findBlockingDep dispatches with, so this
52
+ // monitor can never disagree with dispatch (exact row, exact satisfied
53
+ // record, Epic-scoped prefixed fallback, cancelled-duplicate drop).
54
+ const satisfied = satisfiedSlugsByCwd?.get?.(cwd) ?? new Set();
55
+ const { rowsForDep } = satisfied === DEP_HISTORY_FAIL_OPEN
56
+ ? makeDepResolver(projectJobs, new Set(), { failOpen: true })
57
+ : makeDepResolver(projectJobs, satisfied);
59
58
 
60
59
  // Memoised walk: does this row's dep closure hit a terminally-stuck row?
61
60
  const TERMINAL_STUCK = new Set(['failed', 'skipped']);
@@ -68,9 +67,12 @@ function computeBlockedChains(jobs) {
68
67
  visiting.add(job.slug);
69
68
  const found = new Set();
70
69
  for (const depSlug of job.dependsOn ?? []) {
71
- for (const dep of rowsForDep(depSlug)) {
70
+ for (const dep of rowsForDep(depSlug, job)) {
71
+ // isSatisfiedDepRow: completed, or an auto-resolve skip — the
72
+ // dispatcher's own predicate, so neither is a terminal blocker.
73
+ if (isSatisfiedDepRow(dep)) continue;
72
74
  if (TERMINAL_STUCK.has(dep.status)) found.add(dep.slug);
73
- else if (dep.status !== 'completed') for (const b of blockersFor(dep)) found.add(b);
75
+ else for (const b of blockersFor(dep)) found.add(b);
74
76
  }
75
77
  }
76
78
  visiting.delete(job.slug);
@@ -153,6 +155,73 @@ function describeStarveHold({ projectRows = [], launchBlocks = {}, lastTick = nu
153
155
  return lastHoldTick?.reason ?? 'dispatching-elsewhere';
154
156
  }
155
157
 
158
+ /** Max dependency links findRootBlocker follows before giving up on a chain. */
159
+ const ROOT_BLOCKER_MAX_DEPTH = 50;
160
+
161
+ /** Root row's human reason: heldReason, else its last statusHistory reason, else null. */
162
+ function rootBlockerReason(row) {
163
+ if (typeof row.heldReason === 'string' && row.heldReason) return row.heldReason;
164
+ const h = Array.isArray(row.statusHistory) ? row.statusHistory : [];
165
+ const last = h[h.length - 1];
166
+ return last && typeof last.reason === 'string' && last.reason ? last.reason : null;
167
+ }
168
+
169
+ function rootBlockerRow(job, rows, resolver) {
170
+ const visited = new Set([job.slug]);
171
+ let cur = job;
172
+ for (let depth = 0; depth < ROOT_BLOCKER_MAX_DEPTH; depth++) {
173
+ const depSlug = findBlockingDep(cur, rows, DEP_HISTORY_FAIL_OPEN, resolver);
174
+ if (!depSlug) return cur === job ? null : cur;
175
+ const next = resolver.rowsForDep(depSlug, cur).find((r) => !isSatisfiedDepRow(r));
176
+ if (!next || visited.has(next.slug)) return cur === job ? null : cur; // cycle: stop at last new row
177
+ visited.add(next.slug);
178
+ cur = next;
179
+ }
180
+ return cur === job ? null : cur;
181
+ }
182
+
183
+ /**
184
+ * findRootBlocker(job, rows) → null | { slug, status, reason, preflightHeld }
185
+ *
186
+ * Pure. Walks findBlockingDep (fail-open history, as describeStarveHold does)
187
+ * transitively to the first row that is not itself waiting on a dependency —
188
+ * the row a starved chain actually waits on. Cycle-safe; stops at depth 50
189
+ * and reports the deepest row reached. null when `job` has no blocking dep.
190
+ */
191
+ function findRootBlocker(job, rows, resolver = null) {
192
+ if (!job) return null;
193
+ const list = (Array.isArray(rows) ? rows : []).filter(Boolean);
194
+ const res = resolver ?? makeDepResolver(list, new Set(), { failOpen: true });
195
+ const root = rootBlockerRow(job, list, res);
196
+ if (!root) return null;
197
+ return {
198
+ slug: root.slug,
199
+ status: root.status,
200
+ reason: rootBlockerReason(root),
201
+ preflightHeld: !!root.preflightHold && typeof root.preflightHold === 'object',
202
+ };
203
+ }
204
+
205
+ /**
206
+ * rootBlockersForProject(projectRows) → [{ slug, status, reason, preflightHeld, heldSlugs }]
207
+ *
208
+ * Pure. Distinct root blockers over every dependency-blocked pending row,
209
+ * in first-seen order; `heldSlugs` lists the pending rows each one holds.
210
+ */
211
+ function rootBlockersForProject(projectRows) {
212
+ const rows = (Array.isArray(projectRows) ? projectRows : []).filter(Boolean);
213
+ const resolver = makeDepResolver(rows, new Set(), { failOpen: true });
214
+ const bySlug = new Map();
215
+ for (const j of rows) {
216
+ if (j.status !== 'pending') continue;
217
+ const root = findRootBlocker(j, rows, resolver);
218
+ if (!root) continue;
219
+ if (!bySlug.has(root.slug)) bySlug.set(root.slug, { ...root, heldSlugs: [] });
220
+ bySlug.get(root.slug).heldSlugs.push(j.slug);
221
+ }
222
+ return [...bySlug.values()];
223
+ }
224
+
156
225
  /**
157
226
  * classifyQueueStarvation({ jobs, paused, runningCount, lastRunAtMs, now, thresholdMs })
158
227
  * → null | { kind: 'starved' | 'blocked', pending, dispatchable, blockedChains, idleMs }
@@ -405,6 +474,8 @@ module.exports = {
405
474
  dispatchIdleMs,
406
475
  launchBlockedSlugs,
407
476
  describeStarveHold,
477
+ findRootBlocker,
478
+ rootBlockersForProject,
408
479
  classifyQueueStarvation,
409
480
  classifyQueueStarvationByProject,
410
481
  classifyQueueHealth,