claude-code-session-manager 0.111.0 → 0.113.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 (290) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/dist/assets/{AgentLibrary-rBO1daqM.js → AgentLibrary-wvrcLGGS.js} +2 -2
  3. package/dist/assets/{Button-DsEYRZg0.js → Button-B6h0F0XT.js} +1 -1
  4. package/dist/assets/{DataModel-D8sbvvBC.js → DataModel-C5pW9E3u.js} +1 -1
  5. package/dist/assets/{History-BEHLtxia.js → History-BV4e8YOM.js} +2 -2
  6. package/dist/assets/{Hooks-CKpvlXrg.js → Hooks-CrFSv4x1.js} +3 -3
  7. package/dist/assets/{Library-CeF4qh9d.js → Library-D-GIt3EY.js} +5 -5
  8. package/dist/assets/{ListDetail-DcfmxPFk.js → ListDetail-Bco_wfs6.js} +1 -1
  9. package/dist/assets/{MarkdownEditor-CvK1pyto.js → MarkdownEditor-C-yHSXNV.js} +1 -1
  10. package/dist/assets/{McpServers-D-h2ihzJ.js → McpServers-CfDekadG.js} +2 -2
  11. package/dist/assets/{Memory-BnF89x8v.js → Memory-CGGLexkR.js} +4 -4
  12. package/dist/assets/{Panel-CQY5zano.js → Panel-DGMEuYYG.js} +1 -1
  13. package/dist/assets/{Permissions-DLukmmsz.js → Permissions-Cx2zjtYZ.js} +3 -3
  14. package/dist/assets/{Plugins-0Pf0OZ4l.js → Plugins-Bc_W3IyR.js} +2 -2
  15. package/dist/assets/ProvenanceBadge-DiKAUR1u.js +1 -0
  16. package/dist/assets/RemoteMachines-8_77-WPD.js +3 -0
  17. package/dist/assets/{SaveBar-DjijiUb0.js → SaveBar-Blpzdq1R.js} +1 -1
  18. package/dist/assets/{Scheduler-Cm3EXZvE.js → Scheduler-Bd70AM4X.js} +9 -9
  19. package/dist/assets/{ScopeSwitcher-B-P-kSfq.js → ScopeSwitcher-wxN0h4YW.js} +1 -1
  20. package/dist/assets/Settings-CQ7DA3zW.js +4 -0
  21. package/dist/assets/{SkillReferenceGraph-Epv2GJmj.js → SkillReferenceGraph-DH1NLOiS.js} +1 -1
  22. package/dist/assets/Skills-CmyRyu4_.js +2 -0
  23. package/dist/assets/SystemPrompt-KAc3UMCd.js +1 -0
  24. package/dist/assets/TagLibrary-C8EvHnpg.js +1 -0
  25. package/dist/assets/{TiptapBody-DAMO3DhO.js → TiptapBody-d423mH6D.js} +1 -1
  26. package/dist/assets/{Toggle-Ba_f7q_m.js → Toggle-D1wsGE9S.js} +1 -1
  27. package/dist/assets/{ViewTabs-CGX6MAhc.js → ViewTabs-CjHw3kGY.js} +1 -1
  28. package/dist/assets/{historyTotals-vgfk8EOL.js → historyTotals-DFHzqLt7.js} +1 -1
  29. package/dist/assets/{index-CPieAFsl.js → index-Ci1u018F.js} +266 -266
  30. package/dist/assets/{settingsSchema-D0FxNrTy.js → settingsSchema-Ctf3pZVI.js} +1 -1
  31. package/dist/assets/{useAgentsDirWatch-DCu6BNYN.js → useAgentsDirWatch-B1NBmOAe.js} +1 -1
  32. package/dist/assets/{useRemotePeers-D4cdJDyh.js → useRemotePeers-BHjSJs9D.js} +1 -1
  33. package/dist/index.html +1 -1
  34. package/package.json +3 -2
  35. package/plugins/CLAUDE.md +5 -8
  36. package/plugins/session-manager-dev/.claude-plugin/plugin.json +3 -6
  37. package/plugins/session-manager-dev/skills/builder/1-classify-and-bump/SKILL.md +2 -2
  38. package/plugins/session-manager-dev/skills/builder/SKILL.md +2 -3
  39. package/plugins/session-manager-dev/skills/develop/SKILL.md +1 -1
  40. package/plugins/session-manager-dev/skills/develop/standards.md +3 -3
  41. package/plugins/session-manager-dev/skills/send-feedback/SKILL.md +13 -0
  42. package/scripts/README.md +3 -3
  43. package/scripts/audit-ops-hygiene.cjs +4 -4
  44. package/scripts/hooks/guard-destructive-git.cjs +4 -4
  45. package/scripts/hooks/guard-inline-implementation.cjs +1 -1
  46. package/scripts/hooks/guard-prd-writes.cjs +2 -2
  47. package/scripts/hooks/lib/guard-destructive-git-policy.cjs +1 -1
  48. package/scripts/mint-epic.cjs +2 -2
  49. package/scripts/scheduler-mcp-server.cjs +27 -9
  50. package/src/main/agentLibrary.cjs +5 -5
  51. package/src/main/agentsIpc.cjs +76 -0
  52. package/src/main/build-info.json +4 -4
  53. package/src/main/chatRunner.cjs +30 -13
  54. package/src/main/config.cjs +20 -3
  55. package/src/main/crashDiagnostics.cjs +2 -2
  56. package/src/main/docEdit.cjs +5 -5
  57. package/src/main/files.cjs +2 -2
  58. package/src/main/git.cjs +1 -1
  59. package/src/main/health.cjs +20 -18
  60. package/src/main/heapSnapshot.cjs +1 -1
  61. package/src/main/historyAggregator.cjs +2 -2
  62. package/src/main/index.cjs +50 -132
  63. package/src/main/ipcSchemas.cjs +13 -10
  64. package/src/main/lib/CLAUDE.md +48 -0
  65. package/src/main/lib/activeSessions.cjs +14 -1
  66. package/src/main/lib/classifyPromptTicket.cjs +2 -2
  67. package/src/main/lib/{agentModelResolve.cjs → claude/agentModelResolve.cjs} +7 -7
  68. package/src/main/lib/{claudeBin.cjs → claude/claudeBin.cjs} +4 -4
  69. package/src/main/lib/{effectiveModelInfo.cjs → claude/effectiveModelInfo.cjs} +9 -9
  70. package/src/main/lib/{modelCatalog.cjs → claude/modelCatalog.cjs} +3 -3
  71. package/src/main/lib/claude/rateLimitDetect.cjs +54 -0
  72. package/src/main/lib/{rateLimitWindow.cjs → claude/rateLimitWindow.cjs} +24 -12
  73. package/src/main/lib/{runClaudeP.cjs → claude/runClaudeP.cjs} +1 -1
  74. package/src/main/lib/credentials.cjs +18 -92
  75. package/src/main/lib/cwdClassify.cjs +1 -1
  76. package/src/main/lib/{activeIndexMerge.cjs → epic/activeIndexMerge.cjs} +3 -3
  77. package/src/main/lib/{activeIndexRebuild.cjs → epic/activeIndexRebuild.cjs} +1 -1
  78. package/src/main/lib/{delegationReadiness.cjs → epic/delegationReadiness.cjs} +21 -29
  79. package/src/main/lib/{epicContextDigest.cjs → epic/epicContextDigest.cjs} +1 -1
  80. package/src/main/lib/{epicDelegationStats.cjs → epic/epicDelegationStats.cjs} +2 -2
  81. package/src/main/lib/{epicMint.cjs → epic/epicMint.cjs} +11 -11
  82. package/src/main/lib/{epicSpawnPlan.cjs → epic/epicSpawnPlan.cjs} +3 -3
  83. package/src/main/lib/{epicStatusMirror.cjs → epic/epicStatusMirror.cjs} +2 -2
  84. package/src/main/lib/{epicTranscriptDiagnostic.cjs → epic/epicTranscriptDiagnostic.cjs} +2 -2
  85. package/src/main/lib/{epicTranscriptPath.cjs → epic/epicTranscriptPath.cjs} +2 -2
  86. package/src/main/lib/{epicValidationHook.cjs → epic/epicValidationHook.cjs} +3 -3
  87. package/src/main/lib/{epicWorktreeBoot.cjs → epic/epicWorktreeBoot.cjs} +1 -1
  88. package/src/main/lib/{epicWorktreeMerge.cjs → epic/epicWorktreeMerge.cjs} +3 -3
  89. package/src/main/lib/{epicWorktreeMint.cjs → epic/epicWorktreeMint.cjs} +3 -3
  90. package/src/main/lib/{epicWorktreeProjectConfig.cjs → epic/epicWorktreeProjectConfig.cjs} +4 -4
  91. package/src/main/lib/{promptSessionsCreateEpic.cjs → epic/promptSessionsCreateEpic.cjs} +4 -4
  92. package/src/main/lib/{crossProjectFeedback.cjs → feedback-remote/crossProjectFeedback.cjs} +114 -16
  93. package/src/main/lib/{customerFeedbackClient.cjs → feedback-remote/customerFeedbackClient.cjs} +3 -3
  94. package/src/main/lib/{customerFeedbackInbox.cjs → feedback-remote/customerFeedbackInbox.cjs} +2 -2
  95. package/src/main/lib/{customerFeedbackIpc.cjs → feedback-remote/customerFeedbackIpc.cjs} +1 -1
  96. package/src/main/lib/feedback-remote/humanPromptLedger.cjs +93 -0
  97. package/src/main/lib/{localAdminHttp.cjs → feedback-remote/localAdminHttp.cjs} +2 -2
  98. package/src/main/lib/{macroAdminRoutes.cjs → feedback-remote/macroAdminRoutes.cjs} +1 -1
  99. package/src/main/lib/{projectHomeAdminRoutes.cjs → feedback-remote/projectHomeAdminRoutes.cjs} +4 -4
  100. package/src/main/lib/{relayClientAuth.cjs → feedback-remote/relayClientAuth.cjs} +2 -2
  101. package/src/main/lib/{remoteClientSessions.cjs → feedback-remote/remoteClientSessions.cjs} +1 -1
  102. package/src/main/lib/{gitWorktree.cjs → git/gitWorktree.cjs} +7 -7
  103. package/src/main/lib/historyRollup.cjs +1 -1
  104. package/src/main/lib/importReferences.cjs +1 -1
  105. package/src/main/lib/machineProfile.cjs +1 -1
  106. package/src/main/lib/mcpToolCatalog.cjs +9 -3
  107. package/src/main/lib/openExternalApp.cjs +1 -1
  108. package/src/main/lib/opsOwnership.cjs +3 -3
  109. package/src/main/lib/{agentPersonaSchema.cjs → persona-macro/agentPersonaSchema.cjs} +2 -2
  110. package/src/main/lib/{macroLibrary.cjs → persona-macro/macroLibrary.cjs} +5 -5
  111. package/src/main/lib/{personaMerge.cjs → persona-macro/personaMerge.cjs} +4 -4
  112. package/src/main/lib/{depSlugResolve.cjs → prd/depSlugResolve.cjs} +16 -1
  113. package/src/main/lib/{prdAdminRoutes.cjs → prd/prdAdminRoutes.cjs} +7 -7
  114. package/src/main/lib/{prdAgentType.cjs → prd/prdAgentType.cjs} +3 -3
  115. package/src/main/lib/{prdCreate.cjs → prd/prdCreate.cjs} +12 -12
  116. package/src/main/lib/{prdDeclaredPaths.cjs → prd/prdDeclaredPaths.cjs} +1 -1
  117. package/src/main/lib/{prdGateFiles.cjs → prd/prdGateFiles.cjs} +1 -1
  118. package/src/main/lib/{prdLocations.cjs → prd/prdLocations.cjs} +2 -2
  119. package/src/main/lib/{prdMigration.cjs → prd/prdMigration.cjs} +3 -3
  120. package/src/main/lib/prereqs.cjs +2 -2
  121. package/src/main/lib/{instanceLock.cjs → process/instanceLock.cjs} +4 -11
  122. package/src/main/lib/{pidAlive.cjs → process/pidAlive.cjs} +1 -1
  123. package/src/main/lib/{procName.cjs → process/procName.cjs} +2 -2
  124. package/src/main/lib/{timeoutShim.cjs → process/timeoutShim.cjs} +1 -1
  125. package/src/main/lib/projectRootResolve.cjs +1 -1
  126. package/src/main/lib/promptSessionSchema.cjs +1 -1
  127. package/src/main/lib/{definitionOfDone.cjs → scheduler/definitionOfDone.cjs} +6 -12
  128. package/src/main/lib/scheduler/finalizeReason.cjs +30 -0
  129. package/src/main/lib/{fixChainDepth.cjs → scheduler/fixChainDepth.cjs} +1 -1
  130. package/src/main/lib/scheduler/flatSweepThrottle.cjs +17 -0
  131. package/src/main/lib/{jobDirtFilter.cjs → scheduler/jobDirtFilter.cjs} +1 -1
  132. package/src/main/lib/{jobSupervisorRecord.cjs → scheduler/jobSupervisorRecord.cjs} +1 -1
  133. package/src/main/lib/{launchFailure.cjs → scheduler/launchFailure.cjs} +2 -2
  134. package/src/main/lib/{queueStore.cjs → scheduler/queueStore.cjs} +6 -6
  135. package/src/main/lib/{quietMachineLease.cjs → scheduler/quietMachineLease.cjs} +1 -1
  136. package/src/main/lib/{rcaReport.cjs → scheduler/rcaReport.cjs} +4 -4
  137. package/src/main/lib/{reaperHelpers.cjs → scheduler/reaperHelpers.cjs} +3 -3
  138. package/src/main/lib/{reservationExpiry.cjs → scheduler/reservationExpiry.cjs} +4 -11
  139. package/src/main/lib/{reviewNotice.cjs → scheduler/reviewNotice.cjs} +1 -1
  140. package/src/main/lib/{runLogRetention.cjs → scheduler/runLogRetention.cjs} +34 -13
  141. package/src/main/lib/{scheduleJobTransitions.cjs → scheduler/scheduleJobTransitions.cjs} +3 -3
  142. package/src/main/lib/{schedulerBatch.cjs → scheduler/schedulerBatch.cjs} +9 -13
  143. package/src/main/lib/{schedulerConfig.cjs → scheduler/schedulerConfig.cjs} +1 -1
  144. package/src/main/lib/{schedulerRuntimeState.cjs → scheduler/schedulerRuntimeState.cjs} +1 -1
  145. package/src/main/lib/{sessionSlots.cjs → scheduler/sessionSlots.cjs} +2 -2
  146. package/src/main/lib/{upgradeDrain.cjs → scheduler/upgradeDrain.cjs} +8 -11
  147. package/src/main/lib/{watchdogHelpers.cjs → scheduler/watchdogHelpers.cjs} +5 -19
  148. package/src/main/lib/{auditLog.cjs → telemetry/auditLog.cjs} +1 -1
  149. package/src/main/lib/{opsErrorLog.cjs → telemetry/opsErrorLog.cjs} +4 -4
  150. package/src/main/lib/{telemetryBacklog.cjs → telemetry/telemetryBacklog.cjs} +4 -4
  151. package/src/main/lib/{telemetryBoot.cjs → telemetry/telemetryBoot.cjs} +1 -1
  152. package/src/main/lib/{telemetryClient.cjs → telemetry/telemetryClient.cjs} +12 -8
  153. package/src/main/lib/{telemetrySettings.cjs → telemetry/telemetrySettings.cjs} +1 -1
  154. package/src/main/lib/{atomicFs.cjs → util/atomicFs.cjs} +42 -0
  155. package/src/main/lib/{loopDelay.cjs → util/loopDelay.cjs} +1 -1
  156. package/src/main/logs.cjs +1 -1
  157. package/src/main/mcpStatus.cjs +2 -2
  158. package/src/main/memoryAggregate.cjs +3 -3
  159. package/src/main/memoryTool.cjs +1 -1
  160. package/src/main/otel.cjs +2 -2
  161. package/src/main/pluginInstall.cjs +29 -3
  162. package/src/main/projectBrief.cjs +6 -6
  163. package/src/main/projectPages.cjs +1 -1
  164. package/src/main/promptSessionEvents.cjs +2 -2
  165. package/src/main/pty.cjs +7 -7
  166. package/src/main/queueOps.cjs +6 -6
  167. package/src/main/remoteClient.cjs +4 -4
  168. package/src/main/remoteClientIpc.cjs +1 -1
  169. package/src/main/runVerify.cjs +6 -3
  170. package/src/main/scheduler/CLAUDE.md +26 -0
  171. package/src/main/scheduler/budget.cjs +576 -0
  172. package/src/main/scheduler/gitTreeGuard.cjs +672 -0
  173. package/src/main/scheduler/prdParser.cjs +4 -4
  174. package/src/main/scheduler/prdPaths.cjs +487 -0
  175. package/src/main/scheduler/reviewLadder.cjs +1011 -0
  176. package/src/main/scheduler/starvation.cjs +390 -0
  177. package/src/main/scheduler.cjs +331 -3320
  178. package/src/main/seedAgentPersonas.cjs +5 -5
  179. package/src/main/seedDevPlugin.cjs +70 -3
  180. package/src/main/seedSchedulerMcp.cjs +2 -2
  181. package/src/main/supervisor.cjs +50 -27
  182. package/src/main/telemetryIpc.cjs +51 -0
  183. package/src/main/transcripts.cjs +3 -3
  184. package/src/main/updaterIpc.cjs +1 -1
  185. package/src/main/usage.cjs +1 -1
  186. package/src/main/watchers.cjs +1 -1
  187. package/src/main/webRemote.cjs +22 -7
  188. package/src/preload/api.d.ts +14 -8
  189. package/src/preload/index.cjs +9 -3
  190. package/dist/assets/ProvenanceBadge-vC7Tj-JP.js +0 -1
  191. package/dist/assets/RemoteMachines-CWnKbFHc.js +0 -3
  192. package/dist/assets/Settings-DYDlp2m_.js +0 -4
  193. package/dist/assets/Skills-DHO0N0C2.js +0 -2
  194. package/dist/assets/SystemPrompt-DxeNofL9.js +0 -1
  195. package/dist/assets/TagLibrary-QOAs7ISO.js +0 -1
  196. package/plugins/session-manager-dev/skills/blog-for-project-feature/0-select/SKILL.md +0 -39
  197. package/plugins/session-manager-dev/skills/blog-for-project-feature/1-research/SKILL.md +0 -37
  198. package/plugins/session-manager-dev/skills/blog-for-project-feature/2-storyboard/SKILL.md +0 -64
  199. package/plugins/session-manager-dev/skills/blog-for-project-feature/3-capture/SKILL.md +0 -52
  200. package/plugins/session-manager-dev/skills/blog-for-project-feature/4-draft-copy/SKILL.md +0 -37
  201. package/plugins/session-manager-dev/skills/blog-for-project-feature/5-illustrate/SKILL.md +0 -50
  202. package/plugins/session-manager-dev/skills/blog-for-project-feature/6-compose/SKILL.md +0 -51
  203. package/plugins/session-manager-dev/skills/blog-for-project-feature/7-review/SKILL.md +0 -54
  204. package/plugins/session-manager-dev/skills/blog-for-project-feature/SKILL.md +0 -144
  205. package/plugins/session-manager-dev/skills/blog-for-project-feature/feature.config.yaml +0 -90
  206. package/plugins/session-manager-dev/skills/discover-features/SKILL.md +0 -95
  207. package/plugins/session-manager-dev/skills/explain-to-me/SKILL.md +0 -205
  208. package/plugins/session-manager-dev/skills/explain-to-me/assets/style-reference.html +0 -163
  209. package/plugins/session-manager-dev/skills/find-opportunity/SKILL.md +0 -83
  210. package/plugins/session-manager-dev/skills/issue-address/0-select/0-fetch-pool/SKILL.md +0 -38
  211. package/plugins/session-manager-dev/skills/issue-address/0-select/1-reject-fixed/SKILL.md +0 -64
  212. package/plugins/session-manager-dev/skills/issue-address/0-select/2-reject-claimed/SKILL.md +0 -71
  213. package/plugins/session-manager-dev/skills/issue-address/0-select/3-rank-impact/SKILL.md +0 -39
  214. package/plugins/session-manager-dev/skills/issue-address/0-select/SKILL.md +0 -75
  215. package/plugins/session-manager-dev/skills/issue-address/1-confirm-open/SKILL.md +0 -39
  216. package/plugins/session-manager-dev/skills/issue-address/2-claim/SKILL.md +0 -57
  217. package/plugins/session-manager-dev/skills/issue-address/3-reproduce/SKILL.md +0 -40
  218. package/plugins/session-manager-dev/skills/issue-address/4-fix/SKILL.md +0 -33
  219. package/plugins/session-manager-dev/skills/issue-address/5-verify/SKILL.md +0 -40
  220. package/plugins/session-manager-dev/skills/issue-address/SKILL.md +0 -120
  221. package/plugins/session-manager-dev/skills/local-project-health/SKILL.md +0 -58
  222. package/plugins/session-manager-dev/skills/memory-sanitation/SKILL.md +0 -147
  223. package/plugins/session-manager-dev/skills/ops-sweep/SKILL.md +0 -137
  224. package/plugins/session-manager-dev/skills/pr-review-sweep/0-fetch/SKILL.md +0 -41
  225. package/plugins/session-manager-dev/skills/pr-review-sweep/1-classify/SKILL.md +0 -56
  226. package/plugins/session-manager-dev/skills/pr-review-sweep/2-check-fixed/SKILL.md +0 -49
  227. package/plugins/session-manager-dev/skills/pr-review-sweep/3-queue/SKILL.md +0 -57
  228. package/plugins/session-manager-dev/skills/pr-review-sweep/4-land-and-resolve/SKILL.md +0 -60
  229. package/plugins/session-manager-dev/skills/pr-review-sweep/SKILL.md +0 -124
  230. package/plugins/session-manager-dev/skills/pr-signal/SKILL.md +0 -67
  231. package/plugins/session-manager-dev/skills/project-status/SKILL.md +0 -243
  232. package/plugins/session-manager-dev/skills/requesting-code-review/SKILL.md +0 -98
  233. package/plugins/session-manager-dev/skills/requesting-code-review/code-reviewer.md +0 -146
  234. package/src/main/lib/rateLimitDetect.cjs +0 -35
  235. /package/src/main/lib/{agentEffortResolve.cjs → claude/agentEffortResolve.cjs} +0 -0
  236. /package/src/main/lib/{claudeCliCaps.cjs → claude/claudeCliCaps.cjs} +0 -0
  237. /package/src/main/lib/{usageCircuit.cjs → claude/usageCircuit.cjs} +0 -0
  238. /package/src/main/lib/{epicSpawnCwd.cjs → epic/epicSpawnCwd.cjs} +0 -0
  239. /package/src/main/lib/{customerFeedbackAdminRoutes.cjs → feedback-remote/customerFeedbackAdminRoutes.cjs} +0 -0
  240. /package/src/main/lib/{remoteE2eCrypto.cjs → feedback-remote/remoteE2eCrypto.cjs} +0 -0
  241. /package/src/main/lib/{branchSweep.cjs → git/branchSweep.cjs} +0 -0
  242. /package/src/main/lib/{gitExec.cjs → git/gitExec.cjs} +0 -0
  243. /package/src/main/lib/{jobWorktree.cjs → git/jobWorktree.cjs} +0 -0
  244. /package/src/main/lib/{jobWorktreeBootLive.cjs → git/jobWorktreeBootLive.cjs} +0 -0
  245. /package/src/main/lib/{jobWorktreeTerminalOrphanLive.cjs → git/jobWorktreeTerminalOrphanLive.cjs} +0 -0
  246. /package/src/main/lib/{builtinMacros.cjs → persona-macro/builtinMacros.cjs} +0 -0
  247. /package/src/main/lib/{personaImportHealth.cjs → persona-macro/personaImportHealth.cjs} +0 -0
  248. /package/src/main/lib/{shippedPersonaSeeds.cjs → persona-macro/shippedPersonaSeeds.cjs} +0 -0
  249. /package/src/main/lib/{planValidator.cjs → prd/planValidator.cjs} +0 -0
  250. /package/src/main/lib/{prdAuthoringSeed.cjs → prd/prdAuthoringSeed.cjs} +0 -0
  251. /package/src/main/lib/{prdDisposition.cjs → prd/prdDisposition.cjs} +0 -0
  252. /package/src/main/lib/{prdFrontmatter.cjs → prd/prdFrontmatter.cjs} +0 -0
  253. /package/src/main/lib/{prdSizing.cjs → prd/prdSizing.cjs} +0 -0
  254. /package/src/main/lib/{workTypeLibrary.cjs → prd/workTypeLibrary.cjs} +0 -0
  255. /package/src/main/lib/{childWithLog.cjs → process/childWithLog.cjs} +0 -0
  256. /package/src/main/lib/{cleanEnv.cjs → process/cleanEnv.cjs} +0 -0
  257. /package/src/main/lib/{defaultShell.cjs → process/defaultShell.cjs} +0 -0
  258. /package/src/main/lib/{killTree.cjs → process/killTree.cjs} +0 -0
  259. /package/src/main/lib/{loginShellPath.cjs → process/loginShellPath.cjs} +0 -0
  260. /package/src/main/lib/{procIdentity.cjs → process/procIdentity.cjs} +0 -0
  261. /package/src/main/lib/{singleInstanceGuard.cjs → process/singleInstanceGuard.cjs} +0 -0
  262. /package/src/main/lib/{smProcNames.cjs → process/smProcNames.cjs} +0 -0
  263. /package/src/main/lib/{timeoutShimScript.cjs → process/timeoutShimScript.cjs} +0 -0
  264. /package/src/main/lib/{winSpawn.cjs → process/winSpawn.cjs} +0 -0
  265. /package/src/main/lib/{adoptedRunSupervisor.cjs → scheduler/adoptedRunSupervisor.cjs} +0 -0
  266. /package/src/main/lib/{dispatchLoop.cjs → scheduler/dispatchLoop.cjs} +0 -0
  267. /package/src/main/lib/{dodDrainHook.cjs → scheduler/dodDrainHook.cjs} +0 -0
  268. /package/src/main/lib/{fixPlanSlug.cjs → scheduler/fixPlanSlug.cjs} +0 -0
  269. /package/src/main/lib/{gateAuthority.cjs → scheduler/gateAuthority.cjs} +0 -0
  270. /package/src/main/lib/{landedSinceRun.cjs → scheduler/landedSinceRun.cjs} +0 -0
  271. /package/src/main/lib/{loadGate.cjs → scheduler/loadGate.cjs} +0 -0
  272. /package/src/main/lib/{needsReviewLedger.cjs → scheduler/needsReviewLedger.cjs} +0 -0
  273. /package/src/main/lib/{queueHealth.cjs → scheduler/queueHealth.cjs} +0 -0
  274. /package/src/main/lib/{queueHistory.cjs → scheduler/queueHistory.cjs} +0 -0
  275. /package/src/main/lib/{scheduleJobSchema.cjs → scheduler/scheduleJobSchema.cjs} +0 -0
  276. /package/src/main/lib/{schedulerPaths.cjs → scheduler/schedulerPaths.cjs} +0 -0
  277. /package/src/main/lib/{terminalRunOutcome.cjs → scheduler/terminalRunOutcome.cjs} +0 -0
  278. /package/src/main/lib/{validationSentinels.cjs → scheduler/validationSentinels.cjs} +0 -0
  279. /package/src/main/lib/{crashTelemetry.cjs → telemetry/crashTelemetry.cjs} +0 -0
  280. /package/src/main/lib/{otlpTraceExporter.cjs → telemetry/otlpTraceExporter.cjs} +0 -0
  281. /package/src/main/lib/{telemetryConsent.cjs → telemetry/telemetryConsent.cjs} +0 -0
  282. /package/src/main/lib/{telemetryCounters.cjs → telemetry/telemetryCounters.cjs} +0 -0
  283. /package/src/main/lib/{encodeCwd.cjs → util/encodeCwd.cjs} +0 -0
  284. /package/src/main/lib/{expandHome.cjs → util/expandHome.cjs} +0 -0
  285. /package/src/main/lib/{extractJson.cjs → util/extractJson.cjs} +0 -0
  286. /package/src/main/lib/{fileTail.cjs → util/fileTail.cjs} +0 -0
  287. /package/src/main/lib/{headTailBuffer.cjs → util/headTailBuffer.cjs} +0 -0
  288. /package/src/main/lib/{kebabCase.cjs → util/kebabCase.cjs} +0 -0
  289. /package/src/main/lib/{lruCache.cjs → util/lruCache.cjs} +0 -0
  290. /package/src/main/lib/{withTimeout.cjs → util/withTimeout.cjs} +0 -0
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * agentsIpc.cjs — registers the `agents:*` IPC handlers (Agent Library CRUD + persona/model/effort
5
+ * resolvers). Moved verbatim out of index.cjs; handler bodies and zod wrappers are unchanged.
6
+ */
7
+
8
+ const { schemas, validated } = require('./ipcSchemas.cjs');
9
+ const agentLibrary = require('./agentLibrary.cjs');
10
+ const agentModelResolve = require('./lib/claude/agentModelResolve.cjs');
11
+ const agentEffortResolve = require('./lib/claude/agentEffortResolve.cjs');
12
+ const { resolveEffectiveModelInfo } = require('./lib/claude/effectiveModelInfo.cjs');
13
+ const { sendIfAlive } = require('./lib/sendToRenderer.cjs');
14
+
15
+ /**
16
+ * @param {{ ipcMain: any, getWindow: () => any }} opts
17
+ */
18
+ function registerAgentsHandlers({ ipcMain, getWindow }) {
19
+ // Agent Library nav page (Home face only): global `~/.claude/agents/*.md`
20
+ // personas plus, per currently-open project tab, whether that project
21
+ // overlays the same agent name at `<cwd>/.claude/agents/<name>.md`. Read-only.
22
+ ipcMain.handle('agents:list-personas', () => agentLibrary.listPersonas());
23
+ // Agent Library CRUD — global personas only (`~/.claude/agents/*.md`); a
24
+ // project's local overlay can only be removed here (removeOverride), never
25
+ // created, since Agent Library is a Home-face, machine-wide surface with no
26
+ // per-tab cwd context of its own. Each mutation broadcasts `agents:changed`
27
+ // so Agent Library and Tag Library — two independently-mounted dockview
28
+ // panels, each with its own component-local `listPersonas()` snapshot —
29
+ // both refresh off the one file on disk instead of one panel going stale
30
+ // after the other edits the agent<->tag relationship.
31
+ function broadcastAgentsChanged() {
32
+ sendIfAlive(getWindow(), 'agents:changed', {});
33
+ }
34
+ ipcMain.handle('agents:save-persona', validated(schemas.agentsSavePersona, async (payload) => {
35
+ const result = await agentLibrary.savePersona(payload);
36
+ broadcastAgentsChanged();
37
+ return result;
38
+ }));
39
+ ipcMain.handle('agents:delete-persona', async (_e, payload) => {
40
+ const result = await agentLibrary.deletePersona(payload);
41
+ broadcastAgentsChanged();
42
+ return result;
43
+ });
44
+ ipcMain.handle('agents:remove-override', async (_e, payload) => {
45
+ const result = await agentLibrary.removeOverride(payload);
46
+ broadcastAgentsChanged();
47
+ return result;
48
+ });
49
+ // New Epic AIM composer (epicIntake.ts's `agentBody`/`agentPath`): unlike
50
+ // list-personas above (global dir only), this honors the project-overlay-
51
+ // then-global precedence so an Epic's opening prompt carries the persona
52
+ // body that actually applies to its cwd. Read-only.
53
+ ipcMain.handle('agents:get-persona-body', validated(schemas.agentsGetPersonaBody, (payload) =>
54
+ agentLibrary.getPersonaBody(payload)));
55
+
56
+ // "What will this Epic's launch actually use for --model?" — the SAME
57
+ // resolver chatRunner.cjs's Chat-view launch calls in-process
58
+ // (agentModelResolve.cjs's resolveEpicModel), reached here so Terminal's
59
+ // launch (EpicTerminalPane.tsx, a renderer module with no fs access) agrees
60
+ // with Chat by calling the identical function rather than a second one that
61
+ // is merely supposed to. Never throws (resolveEpicModel's own contract).
62
+ ipcMain.handle('agents:resolve-epic-model', validated(schemas.agentsResolveEpicModel, (payload) =>
63
+ agentModelResolve.resolveEpicModel(payload)));
64
+ // Effort twin of the above (agentEffortResolve.cjs): Terminal appends
65
+ // `--effort <level>` only when `effort` is non-null. Never throws.
66
+ ipcMain.handle('agents:resolve-epic-effort', validated(schemas.agentsResolveEpicEffort, (payload) =>
67
+ agentEffortResolve.resolveEpicEffort(payload)));
68
+
69
+ // "What will this Epic actually run as?" (PRD: effective-model-resolver) —
70
+ // persona alias + evidence-based concrete model id + provenance, for a given
71
+ // (cwd, agentType). Read-only observer; never affects what a launch resolves.
72
+ ipcMain.handle('agents:resolve-model-info', validated(schemas.agentsResolveModelInfo, (payload) =>
73
+ resolveEffectiveModelInfo(payload)));
74
+ }
75
+
76
+ module.exports = { registerAgentsHandlers };
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "0.111.0",
3
- "gitSha": "ca0cbc30d2ee72698993f0f07f878a932843c758",
4
- "gitShortSha": "ca0cbc30",
2
+ "version": "0.113.0",
3
+ "gitSha": "07baa2cc0601e109b6591f57bfb2ced8f34884dd",
4
+ "gitShortSha": "07baa2cc",
5
5
  "gitBranch": "HEAD",
6
- "builtAt": "2026-10-11T04:47:08.011Z",
6
+ "builtAt": "2026-10-12T19:15:00.757Z",
7
7
  "dirty": false
8
8
  }
@@ -44,20 +44,20 @@
44
44
 
45
45
  const { spawn } = require('node:child_process');
46
46
  const { ipcMain } = require('electron');
47
- const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claudeBin.cjs');
48
- const { cleanChildEnv, pathWithUserBins } = require('./lib/cleanEnv.cjs');
47
+ const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claude/claudeBin.cjs');
48
+ const { cleanChildEnv, pathWithUserBins } = require('./lib/process/cleanEnv.cjs');
49
49
  const { recordExchange } = require('./exchanges.cjs');
50
50
  const { classifyToolUse } = require('./lib/toolUseClassify.cjs');
51
- const { extractJson } = require('./lib/extractJson.cjs');
51
+ const { extractJson } = require('./lib/util/extractJson.cjs');
52
52
  const { classifyPromptTicket } = require('./lib/classifyPromptTicket.cjs');
53
- const sessionSlots = require('./lib/sessionSlots.cjs');
54
- const opsErrorLog = require('./lib/opsErrorLog.cjs');
55
- const { killTree, detachedSpawnOpts } = require('./lib/killTree.cjs');
56
- const agentModelResolve = require('./lib/agentModelResolve.cjs');
57
- const { resolveEpicEffort, effortArgs } = require('./lib/agentEffortResolve.cjs');
58
- const { planEpicSpawn } = require('./lib/epicSpawnPlan.cjs');
53
+ const sessionSlots = require('./lib/scheduler/sessionSlots.cjs');
54
+ const opsErrorLog = require('./lib/telemetry/opsErrorLog.cjs');
55
+ const { killTree, detachedSpawnOpts } = require('./lib/process/killTree.cjs');
56
+ const agentModelResolve = require('./lib/claude/agentModelResolve.cjs');
57
+ const { resolveEpicEffort, effortArgs } = require('./lib/claude/agentEffortResolve.cjs');
58
+ const { planEpicSpawn } = require('./lib/epic/epicSpawnPlan.cjs');
59
59
  const logs = require('./logs.cjs');
60
- const { createHeadTailBuffer } = require('./lib/headTailBuffer.cjs');
60
+ const { createHeadTailBuffer } = require('./lib/util/headTailBuffer.cjs');
61
61
 
62
62
  // Caps on per-run stream buffers (a run can last hours).
63
63
  const STDERR_TAIL_MAX = 64 * 1024;
@@ -424,7 +424,7 @@ function pump() {
424
424
  if (idx === -1) break;
425
425
  // The chat lane cap is a POLICY bound; actual capacity comes from the
426
426
  // Session-Manager-wide slot pool shared with the scheduler
427
- // (lib/sessionSlots.cjs). No slot → everyone keeps waiting; the next
427
+ // (lib/scheduler/sessionSlots.cjs). No slot → everyone keeps waiting; the next
428
428
  // settle() in either subsystem re-pumps.
429
429
  const slotToken = sessionSlots.acquire(`chat:${waiting[idx].tabId}`);
430
430
  if (!slotToken) break;
@@ -982,7 +982,7 @@ function requestExternalNewSession(payload) {
982
982
  * job; this only owns route logic + body parsing).
983
983
  */
984
984
  function registerAdminRoute(adminHttp) {
985
- const { readBody, sendJson } = require('./lib/localAdminHttp.cjs');
985
+ const { readBody, sendJson } = require('./lib/feedback-remote/localAdminHttp.cjs');
986
986
  const { schemas } = require('./ipcSchemas.cjs');
987
987
 
988
988
  adminHttp.registerRoute('POST', '/admin/chat/send-prompt', async (req, res) => {
@@ -1008,10 +1008,26 @@ function registerAdminRoute(adminHttp) {
1008
1008
 
1009
1009
  // ─── IPC handler registration ─────────────────────────────────────────────
1010
1010
 
1011
+ /**
1012
+ * Record a chat prompt into the human prompt ledger, only when the renderer
1013
+ * explicitly declared origin === 'human'. Absent/other origins are not-human
1014
+ * (fail-closed). Never throws.
1015
+ * @param {{ sessionId: string, prompt: string, origin?: string }} args
1016
+ */
1017
+ function noteChatRunOrigin({ sessionId, prompt, origin }) {
1018
+ try {
1019
+ if (origin !== 'human') return;
1020
+ require('./lib/feedback-remote/humanPromptLedger.cjs').recordHumanPrompt(sessionId, prompt);
1021
+ } catch {
1022
+ /* never throws */
1023
+ }
1024
+ }
1025
+
1011
1026
  function registerChatHandlers() {
1012
1027
  const { schemas, validated } = require('./ipcSchemas.cjs');
1013
1028
 
1014
- ipcMain.handle('chat:run', validated(schemas.chatRun, async ({ tabId, sessionId, prompt, cwd, resume, promptId }) => {
1029
+ ipcMain.handle('chat:run', validated(schemas.chatRun, async ({ tabId, sessionId, prompt, cwd, resume, promptId, origin }) => {
1030
+ noteChatRunOrigin({ sessionId, prompt, origin });
1015
1031
  // Report what actually happened instead of an unconditional { ok: true }.
1016
1032
  // A user send is always accepted now (queued behind the tab's live run if
1017
1033
  // one holds it), but the renderer gets the truth either way rather than a
@@ -1042,6 +1058,7 @@ module.exports = {
1042
1058
  __liveSessionCount: () => liveSessions.size,
1043
1059
  attachWindow,
1044
1060
  registerChatHandlers,
1061
+ noteChatRunOrigin,
1045
1062
  parseStopSignal,
1046
1063
  splitStopSignal,
1047
1064
  parseContextUsageMarkdown,
@@ -23,9 +23,9 @@ const { assertOpsWrite, opsPath, OWNERS } = require('./lib/opsOwnership.cjs');
23
23
  const chokidar = require('chokidar');
24
24
  const logs = require('./logs.cjs');
25
25
  const { sendIfAlive } = require('./lib/sendToRenderer.cjs');
26
- const { expandHome } = require('./lib/expandHome.cjs');
26
+ const { expandHome } = require('./lib/util/expandHome.cjs');
27
27
  const { listReferencedFiles } = require('./lib/importReferences.cjs');
28
- const atomicFs = require('./lib/atomicFs.cjs');
28
+ const atomicFs = require('./lib/util/atomicFs.cjs');
29
29
 
30
30
  /** Map<watchKey, {watcher, refCount}> — one chokidar watcher per path (+ depth, see watchKeyOf). */
31
31
  const watchers = new Map();
@@ -392,8 +392,21 @@ function watchKeyOf(key, depth) {
392
392
  */
393
393
  function watch(paths, senderId, opts) {
394
394
  const depth = opts?.depth;
395
+ const watched = [];
396
+ const rejected = [];
395
397
  for (const rawPath of paths) {
396
- validatePath(expandHome(rawPath)); // security check — throws if out of bounds
398
+ try {
399
+ validatePath(expandHome(rawPath)); // security check — throws if out of bounds
400
+ } catch (err) {
401
+ // Per-path: one bad path must not abort the rest of the batch.
402
+ rejected.push(rawPath);
403
+ if (!warnedRejectedPaths.has(rawPath)) {
404
+ warnedRejectedPaths.add(rawPath);
405
+ logs.writeLine({ level: 'warn', scope: 'config', message: 'config:watch path reject', meta: { path: rawPath, error: err?.message } });
406
+ }
407
+ continue;
408
+ }
409
+ watched.push(rawPath);
397
410
  const key = normalizePathKey(rawPath);
398
411
  const mapKey = watchKeyOf(key, depth);
399
412
  if (senderId != null) {
@@ -430,8 +443,12 @@ function watch(paths, senderId, opts) {
430
443
  });
431
444
  watchers.set(mapKey, { watcher: w, refCount: 1 });
432
445
  }
446
+ return { watched, rejected };
433
447
  }
434
448
 
449
+ // Distinct rejected watch paths already warned about (once per process).
450
+ const warnedRejectedPaths = new Set();
451
+
435
452
  function unwatch(paths, senderId, opts) {
436
453
  for (const rawPath of paths) {
437
454
  const key = watchKeyOf(normalizePathKey(rawPath), opts?.depth);
@@ -26,8 +26,8 @@
26
26
  const { app, powerSaveBlocker, powerMonitor, crashReporter } = require('electron');
27
27
  const fs = require('node:fs');
28
28
  const path = require('node:path');
29
- const { reportCrash } = require('./lib/crashTelemetry.cjs');
30
- const { createLoopDelayMonitor, stallVerdict } = require('./lib/loopDelay.cjs');
29
+ const { reportCrash } = require('./lib/telemetry/crashTelemetry.cjs');
30
+ const { createLoopDelayMonitor, stallVerdict } = require('./lib/util/loopDelay.cjs');
31
31
 
32
32
  let logs = null;
33
33
  let getPowerBlockerId = () => -1;
@@ -17,12 +17,12 @@
17
17
  const { ipcMain } = require('electron');
18
18
  const { spawn } = require('node:child_process');
19
19
  const crypto = require('node:crypto');
20
- const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claudeBin.cjs');
21
- const { headlessPermissionArgs, ensureCliCapsProbed } = require('./lib/claudeCliCaps.cjs');
22
- const { withProcRole } = require('./lib/cleanEnv.cjs');
23
- const { extractJson } = require('./lib/extractJson.cjs');
20
+ const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claude/claudeBin.cjs');
21
+ const { headlessPermissionArgs, ensureCliCapsProbed } = require('./lib/claude/claudeCliCaps.cjs');
22
+ const { withProcRole } = require('./lib/process/cleanEnv.cjs');
23
+ const { extractJson } = require('./lib/util/extractJson.cjs');
24
24
  const { assertInsideHome } = require('./lib/insideHome.cjs');
25
- const { expandHome } = require('./lib/expandHome.cjs');
25
+ const { expandHome } = require('./lib/util/expandHome.cjs');
26
26
  const chatRunner = require('./chatRunner.cjs');
27
27
 
28
28
  // System prompt sets the role server-side so the selection is treated as
@@ -21,8 +21,8 @@ const os = require('node:os');
21
21
 
22
22
  const { z } = require('zod');
23
23
  const { assertInsideHome } = require('./lib/insideHome.cjs');
24
- const { expandHome } = require('./lib/expandHome.cjs');
25
- const atomicFs = require('./lib/atomicFs.cjs');
24
+ const { expandHome } = require('./lib/util/expandHome.cjs');
25
+ const atomicFs = require('./lib/util/atomicFs.cjs');
26
26
  const { schemas } = require('./ipcSchemas.cjs');
27
27
 
28
28
  /**
package/src/main/git.cjs CHANGED
@@ -23,7 +23,7 @@ const { spawn } = require('node:child_process');
23
23
  const path = require('node:path');
24
24
  const { schemas } = require('./ipcSchemas.cjs');
25
25
  const { validatePath } = require('./config.cjs');
26
- const { LRUCache } = require('./lib/lruCache.cjs');
26
+ const { LRUCache } = require('./lib/util/lruCache.cjs');
27
27
 
28
28
  const GIT_TIMEOUT_MS = 5_000;
29
29
  const CACHE_TTL_MS = 5_000;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * health.cjs — health check for session-manager Electron app.
3
3
  * Verifies: app startup, IPC responsiveness, scheduler health, watchers active.
4
- * Exported as check() for /local-project-health skill.
4
+ * Exported as check(); run via `npm run health`.
5
5
  */
6
6
 
7
7
  const fs = require('node:fs');
@@ -9,23 +9,25 @@ const fsp = require('node:fs/promises');
9
9
  const path = require('node:path');
10
10
  const os = require('node:os');
11
11
  const { execFileSync } = require('node:child_process');
12
- const { POLL_INTERVAL_MS, loadGateThreshold } = require('./lib/schedulerConfig.cjs');
12
+ const { POLL_INTERVAL_MS, loadGateThreshold } = require('./lib/scheduler/schedulerConfig.cjs');
13
13
  const { opsPath } = require('./lib/opsOwnership.cjs');
14
- const { effectivePaused } = require('./lib/upgradeDrain.cjs');
15
- const { checkPersonaImports } = require('./lib/personaImportHealth.cjs');
16
- const { checkDelegationReadiness } = require('./lib/delegationReadiness.cjs');
17
- const { resolvePrdsDirs } = require('./lib/prdLocations.cjs');
18
- const { migratePrds } = require('./lib/prdMigration.cjs');
19
- const queueStore = require('./lib/queueStore.cjs');
20
- const schedulerPaths = require('./lib/schedulerPaths.cjs');
21
- const { evaluateDispatchLiveness } = require('./lib/watchdogHelpers.cjs');
22
- const { computeStallSummary, computeDepHistorySatisfaction, FAILURE_STREAK_ESCALATION_MS, classifyQueueStarvation, launchBlockedSlugs, STARVE_ESCALATION_MS, REVERIFY_INTERVAL_MS } = require('./scheduler.cjs');
23
- const { findStarvedProjects, findUnresolvableDepRoots, DEFAULT_PROJECT_CWD, DEP_HISTORY_FAIL_OPEN } = require('./lib/schedulerBatch.cjs');
24
- const { auditLogPath, readTail } = require('./lib/auditLog.cjs');
14
+ const { effectivePaused } = require('./lib/scheduler/upgradeDrain.cjs');
15
+ const { checkPersonaImports } = require('./lib/persona-macro/personaImportHealth.cjs');
16
+ const { checkDelegationReadiness } = require('./lib/epic/delegationReadiness.cjs');
17
+ const { resolvePrdsDirs } = require('./lib/prd/prdLocations.cjs');
18
+ const { migratePrds } = require('./lib/prd/prdMigration.cjs');
19
+ const queueStore = require('./lib/scheduler/queueStore.cjs');
20
+ const schedulerPaths = require('./lib/scheduler/schedulerPaths.cjs');
21
+ const { evaluateDispatchLiveness } = require('./lib/scheduler/watchdogHelpers.cjs');
22
+ const { computeStallSummary, computeDepHistorySatisfaction, FAILURE_STREAK_ESCALATION_MS } = require('./scheduler/budget.cjs');
23
+ const { classifyQueueStarvation, launchBlockedSlugs, STARVE_ESCALATION_MS } = require('./scheduler/starvation.cjs');
24
+ const { REVERIFY_INTERVAL_MS } = require('./scheduler/reviewLadder.cjs');
25
+ const { findStarvedProjects, findUnresolvableDepRoots, DEFAULT_PROJECT_CWD, DEP_HISTORY_FAIL_OPEN } = require('./lib/scheduler/schedulerBatch.cjs');
26
+ const { auditLogPath, readTail } = require('./lib/telemetry/auditLog.cjs');
25
27
  const { resolveBuildIdentity } = require('./lib/buildIdentity.cjs');
26
- const { computeReport, isRetentionEnabled, liveKeysFromJobs } = require('./lib/runLogRetention.cjs');
28
+ const { computeReport, isRetentionEnabled, liveKeysFromJobs } = require('./lib/scheduler/runLogRetention.cjs');
27
29
  const { allProjectCwds } = require('./lib/activeSessions.cjs');
28
- const { scanEpicTranscripts } = require('./lib/epicTranscriptDiagnostic.cjs');
30
+ const { scanEpicTranscripts } = require('./lib/epic/epicTranscriptDiagnostic.cjs');
29
31
 
30
32
  const MAX_LOG_AGE_MS = 5 * 60_000; // 5 min — warn if no logs this old
31
33
  const PROJECT_ROOT = path.resolve(__dirname, '../..');
@@ -106,7 +108,7 @@ function evaluateTickLiveness(queueState, heartbeat, now, runningCount) {
106
108
  // sessionSlots pool is the only limit. Read it lazily so this stays a pure
107
109
  // function of its args when a caller supplies slotCap explicitly.
108
110
  const concurrencyCap = queueState.slotCap
109
- ?? (() => { try { return require('./lib/sessionSlots.cjs').totalSlots(); } catch { return Infinity; } })();
111
+ ?? (() => { try { return require('./lib/scheduler/sessionSlots.cjs').totalSlots(); } catch { return Infinity; } })();
110
112
 
111
113
  if (pending.length === 0) return { stalled: false, reason: 'no-pending-jobs' };
112
114
  if (effectivePaused(queueState)) return { stalled: false, reason: queueState.paused ? 'paused' : 'draining' };
@@ -641,7 +643,7 @@ function evaluateBuildFreshness({ running = null, installedOnDisk = null, repoHe
641
643
  * names the cause and the fix (`claude login`).
642
644
  *
643
645
  * NON-CRITICAL by design: reported in components.credentials + issues so
644
- * /local-project-health shows it, but it does not flip status.ok — health must
646
+ * `npm run health` shows it, but it does not flip status.ok — health must
645
647
  * not hard-fail a repo checkout just because THIS machine's token lapsed, and
646
648
  * an expired token is an operator action (re-login), not a code defect. Maps:
647
649
  * kind 'auth' → not ok, actionable `claude login` message (the real block)
@@ -897,7 +899,7 @@ async function check(opts = {}) {
897
899
  path: queuePath,
898
900
  jobs: Object.keys(queueState.jobs || {}).length,
899
901
  running: runningCount,
900
- // Deliberate restart drain (lib/upgradeDrain.cjs) — reported so it is never read as a stall.
902
+ // Deliberate restart drain (lib/scheduler/upgradeDrain.cjs) — reported so it is never read as a stall.
901
903
  drain: queueState.drain?.active ? { since: queueState.drain.since ?? null, requestedAt: queueState.drain.requestedAt ?? null } : null,
902
904
  failed: failedCount,
903
905
  needsReview: needsReviewCount,
@@ -24,7 +24,7 @@
24
24
 
25
25
  const path = require('node:path');
26
26
  const fsp = require('node:fs/promises');
27
- const { heapSnapshotDir } = require('./lib/schedulerPaths.cjs');
27
+ const { heapSnapshotDir } = require('./lib/scheduler/schedulerPaths.cjs');
28
28
 
29
29
  const CHANNEL = 'diagnostics:heap-snapshot';
30
30
  const DEFAULT_TIMEOUT_MS = 3 * 60 * 1000; // 3 min — snapshots can be multi-hundred-MB
@@ -50,8 +50,8 @@ function resolvePricingKey(modelId) {
50
50
  }
51
51
 
52
52
  // ── LRU cache ─────────────────────────────────────────────────────────────────
53
- // Shared implementation: lib/lruCache.cjs (re-exported below for existing callers).
54
- const { LRUCache } = require('./lib/lruCache.cjs');
53
+ // Shared implementation: lib/util/lruCache.cjs (re-exported below for existing callers).
54
+ const { LRUCache } = require('./lib/util/lruCache.cjs');
55
55
 
56
56
  // ── history:updated broadcast ─────────────────────────────────────────────────
57
57
  // Open History pages re-fetch on this event. Throttled leading+trailing so a