claude-code-session-manager 0.110.0 → 0.112.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 (283) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/dist/assets/{AgentLibrary-Cm6MrOnF.js → AgentLibrary-RwPvEgqm.js} +2 -2
  3. package/dist/assets/{Button-CGVncJ6a.js → Button-36j3PzYv.js} +1 -1
  4. package/dist/assets/{DataModel-C3hlMoa8.js → DataModel-DUhANo4l.js} +1 -1
  5. package/dist/assets/{History-CTyfGNKn.js → History-BeZzNjmv.js} +2 -2
  6. package/dist/assets/{Hooks-BXxCBibx.js → Hooks-iQ8845Hp.js} +3 -3
  7. package/dist/assets/{Library-aCs7zxAg.js → Library-DPE1h-1L.js} +6 -6
  8. package/dist/assets/{ListDetail-B9Hqk1_f.js → ListDetail-PStOuQAo.js} +1 -1
  9. package/dist/assets/{MarkdownEditor-Djfgp32k.js → MarkdownEditor-DPw-N2-m.js} +1 -1
  10. package/dist/assets/{McpServers-8HQC6QgR.js → McpServers-CUyRTNep.js} +2 -2
  11. package/dist/assets/{Memory-c4SVE3l2.js → Memory-bZ2xjBGy.js} +3 -3
  12. package/dist/assets/{Panel-BEQTwE4z.js → Panel-_VZ_uXNg.js} +1 -1
  13. package/dist/assets/{Permissions-BaYzgZtc.js → Permissions-PPRmfNbK.js} +3 -3
  14. package/dist/assets/{Plugins-DnXsVau7.js → Plugins-BFcvfvlx.js} +2 -2
  15. package/dist/assets/{ProvenanceBadge-CT2vWps1.js → ProvenanceBadge-B1WUknak.js} +1 -1
  16. package/dist/assets/RemoteMachines-D5V0lzgW.js +3 -0
  17. package/dist/assets/{SaveBar-DwcHt3iR.js → SaveBar-Dw64FVdM.js} +1 -1
  18. package/dist/assets/{Scheduler-D6Gcuo0M.js → Scheduler-C8s_pJ3I.js} +9 -9
  19. package/dist/assets/{ScopeSwitcher-CgvWDc9Y.js → ScopeSwitcher-D-nKDMAE.js} +1 -1
  20. package/dist/assets/{Settings-CJoogVAB.js → Settings-CQSrR4mO.js} +4 -4
  21. package/dist/assets/{SkillReferenceGraph-4fq01kxq.js → SkillReferenceGraph-BbZFMHim.js} +1 -1
  22. package/dist/assets/{Skills-BU4ZX4h4.js → Skills-Bzyrh6EQ.js} +1 -1
  23. package/dist/assets/SystemPrompt-DP6i3Dx0.js +1 -0
  24. package/dist/assets/TagLibrary-iip0C6Bl.js +1 -0
  25. package/dist/assets/{TiptapBody-DVyBsfsT.js → TiptapBody-Cr-hxX8L.js} +1 -1
  26. package/dist/assets/Toggle-7WpPzcZH.js +1 -0
  27. package/dist/assets/{ViewTabs-BLHjKUv-.js → ViewTabs-9lQCRwWJ.js} +1 -1
  28. package/dist/assets/{historyTotals-BXDd3EzP.js → historyTotals-BrFxw5J1.js} +1 -1
  29. package/dist/assets/{index-CuiU3I-8.js → index-CTBpf-26.js} +250 -249
  30. package/dist/assets/{settingsSchema-DD4bc5cT.js → settingsSchema-Dh5Kl7VO.js} +1 -1
  31. package/dist/assets/{useAgentsDirWatch-DMQ_XZtr.js → useAgentsDirWatch-CMpx0d04.js} +1 -1
  32. package/dist/assets/{useRemotePeers-C9NfteSD.js → useRemotePeers-CI2axd-L.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/scripts/README.md +3 -3
  42. package/scripts/audit-ops-hygiene.cjs +4 -4
  43. package/scripts/hooks/guard-destructive-git.cjs +4 -4
  44. package/scripts/hooks/guard-inline-implementation.cjs +1 -1
  45. package/scripts/hooks/guard-prd-writes.cjs +2 -2
  46. package/scripts/hooks/lib/guard-destructive-git-policy.cjs +1 -1
  47. package/scripts/mint-epic.cjs +2 -2
  48. package/scripts/scheduler-mcp-server.cjs +4 -4
  49. package/src/main/agentLibrary.cjs +5 -5
  50. package/src/main/agentsIpc.cjs +76 -0
  51. package/src/main/build-info.json +4 -4
  52. package/src/main/chatRunner.cjs +12 -12
  53. package/src/main/config.cjs +2 -2
  54. package/src/main/crashDiagnostics.cjs +2 -2
  55. package/src/main/docEdit.cjs +5 -5
  56. package/src/main/files.cjs +2 -2
  57. package/src/main/git.cjs +1 -1
  58. package/src/main/health.cjs +20 -18
  59. package/src/main/heapSnapshot.cjs +1 -1
  60. package/src/main/historyAggregator.cjs +2 -2
  61. package/src/main/index.cjs +44 -132
  62. package/src/main/ipcSchemas.cjs +10 -10
  63. package/src/main/lib/CLAUDE.md +48 -0
  64. package/src/main/lib/activeSessions.cjs +1 -1
  65. package/src/main/lib/classifyPromptTicket.cjs +2 -2
  66. package/src/main/lib/{agentModelResolve.cjs → claude/agentModelResolve.cjs} +7 -7
  67. package/src/main/lib/{claudeBin.cjs → claude/claudeBin.cjs} +4 -4
  68. package/src/main/lib/{effectiveModelInfo.cjs → claude/effectiveModelInfo.cjs} +9 -9
  69. package/src/main/lib/{modelCatalog.cjs → claude/modelCatalog.cjs} +3 -3
  70. package/src/main/lib/{rateLimitDetect.cjs → claude/rateLimitDetect.cjs} +1 -1
  71. package/src/main/lib/{rateLimitWindow.cjs → claude/rateLimitWindow.cjs} +1 -1
  72. package/src/main/lib/{runClaudeP.cjs → claude/runClaudeP.cjs} +1 -1
  73. package/src/main/lib/credentials.cjs +3 -3
  74. package/src/main/lib/cwdClassify.cjs +1 -1
  75. package/src/main/lib/{activeIndexMerge.cjs → epic/activeIndexMerge.cjs} +3 -3
  76. package/src/main/lib/{activeIndexRebuild.cjs → epic/activeIndexRebuild.cjs} +1 -1
  77. package/src/main/lib/{delegationReadiness.cjs → epic/delegationReadiness.cjs} +21 -29
  78. package/src/main/lib/{epicContextDigest.cjs → epic/epicContextDigest.cjs} +1 -1
  79. package/src/main/lib/{epicDelegationStats.cjs → epic/epicDelegationStats.cjs} +2 -2
  80. package/src/main/lib/{epicMint.cjs → epic/epicMint.cjs} +11 -11
  81. package/src/main/lib/{epicSpawnPlan.cjs → epic/epicSpawnPlan.cjs} +3 -3
  82. package/src/main/lib/{epicStatusMirror.cjs → epic/epicStatusMirror.cjs} +2 -2
  83. package/src/main/lib/{epicTranscriptDiagnostic.cjs → epic/epicTranscriptDiagnostic.cjs} +2 -2
  84. package/src/main/lib/{epicTranscriptPath.cjs → epic/epicTranscriptPath.cjs} +2 -2
  85. package/src/main/lib/{epicValidationHook.cjs → epic/epicValidationHook.cjs} +3 -3
  86. package/src/main/lib/{epicWorktreeBoot.cjs → epic/epicWorktreeBoot.cjs} +1 -1
  87. package/src/main/lib/{epicWorktreeMerge.cjs → epic/epicWorktreeMerge.cjs} +3 -3
  88. package/src/main/lib/{epicWorktreeMint.cjs → epic/epicWorktreeMint.cjs} +3 -3
  89. package/src/main/lib/{epicWorktreeProjectConfig.cjs → epic/epicWorktreeProjectConfig.cjs} +4 -4
  90. package/src/main/lib/{promptSessionsCreateEpic.cjs → epic/promptSessionsCreateEpic.cjs} +4 -4
  91. package/src/main/lib/{crossProjectFeedback.cjs → feedback-remote/crossProjectFeedback.cjs} +7 -7
  92. package/src/main/lib/{customerFeedbackClient.cjs → feedback-remote/customerFeedbackClient.cjs} +3 -3
  93. package/src/main/lib/{customerFeedbackInbox.cjs → feedback-remote/customerFeedbackInbox.cjs} +2 -2
  94. package/src/main/lib/{customerFeedbackIpc.cjs → feedback-remote/customerFeedbackIpc.cjs} +1 -1
  95. package/src/main/lib/{localAdminHttp.cjs → feedback-remote/localAdminHttp.cjs} +2 -2
  96. package/src/main/lib/{macroAdminRoutes.cjs → feedback-remote/macroAdminRoutes.cjs} +1 -1
  97. package/src/main/lib/{projectHomeAdminRoutes.cjs → feedback-remote/projectHomeAdminRoutes.cjs} +4 -4
  98. package/src/main/lib/{relayClientAuth.cjs → feedback-remote/relayClientAuth.cjs} +2 -2
  99. package/src/main/lib/{remoteClientSessions.cjs → feedback-remote/remoteClientSessions.cjs} +1 -1
  100. package/src/main/lib/{gitWorktree.cjs → git/gitWorktree.cjs} +7 -7
  101. package/src/main/lib/historyRollup.cjs +1 -1
  102. package/src/main/lib/importReferences.cjs +1 -1
  103. package/src/main/lib/machineProfile.cjs +1 -1
  104. package/src/main/lib/openExternalApp.cjs +1 -1
  105. package/src/main/lib/opsOwnership.cjs +3 -3
  106. package/src/main/lib/{agentPersonaSchema.cjs → persona-macro/agentPersonaSchema.cjs} +2 -2
  107. package/src/main/lib/{builtinMacros.cjs → persona-macro/builtinMacros.cjs} +2 -2
  108. package/src/main/lib/{macroLibrary.cjs → persona-macro/macroLibrary.cjs} +5 -5
  109. package/src/main/lib/{personaMerge.cjs → persona-macro/personaMerge.cjs} +4 -4
  110. package/src/main/lib/{shippedPersonaSeeds.cjs → persona-macro/shippedPersonaSeeds.cjs} +11 -0
  111. package/src/main/lib/{prdAdminRoutes.cjs → prd/prdAdminRoutes.cjs} +7 -7
  112. package/src/main/lib/{prdAgentType.cjs → prd/prdAgentType.cjs} +3 -3
  113. package/src/main/lib/{prdCreate.cjs → prd/prdCreate.cjs} +12 -12
  114. package/src/main/lib/{prdDeclaredPaths.cjs → prd/prdDeclaredPaths.cjs} +1 -1
  115. package/src/main/lib/{prdGateFiles.cjs → prd/prdGateFiles.cjs} +1 -1
  116. package/src/main/lib/{prdLocations.cjs → prd/prdLocations.cjs} +2 -2
  117. package/src/main/lib/{prdMigration.cjs → prd/prdMigration.cjs} +3 -3
  118. package/src/main/lib/prereqs.cjs +2 -2
  119. package/src/main/lib/{instanceLock.cjs → process/instanceLock.cjs} +4 -11
  120. package/src/main/lib/{pidAlive.cjs → process/pidAlive.cjs} +1 -1
  121. package/src/main/lib/{procName.cjs → process/procName.cjs} +2 -2
  122. package/src/main/lib/{timeoutShim.cjs → process/timeoutShim.cjs} +1 -1
  123. package/src/main/lib/projectRootResolve.cjs +1 -1
  124. package/src/main/lib/promptSessionSchema.cjs +1 -1
  125. package/src/main/lib/{definitionOfDone.cjs → scheduler/definitionOfDone.cjs} +6 -12
  126. package/src/main/lib/{fixChainDepth.cjs → scheduler/fixChainDepth.cjs} +1 -1
  127. package/src/main/lib/{jobDirtFilter.cjs → scheduler/jobDirtFilter.cjs} +1 -1
  128. package/src/main/lib/{jobSupervisorRecord.cjs → scheduler/jobSupervisorRecord.cjs} +1 -1
  129. package/src/main/lib/{launchFailure.cjs → scheduler/launchFailure.cjs} +2 -2
  130. package/src/main/lib/{queueStore.cjs → scheduler/queueStore.cjs} +6 -6
  131. package/src/main/lib/{quietMachineLease.cjs → scheduler/quietMachineLease.cjs} +1 -1
  132. package/src/main/lib/{rcaReport.cjs → scheduler/rcaReport.cjs} +4 -4
  133. package/src/main/lib/{reaperHelpers.cjs → scheduler/reaperHelpers.cjs} +3 -3
  134. package/src/main/lib/{reservationExpiry.cjs → scheduler/reservationExpiry.cjs} +4 -11
  135. package/src/main/lib/{reviewNotice.cjs → scheduler/reviewNotice.cjs} +1 -1
  136. package/src/main/lib/{scheduleJobTransitions.cjs → scheduler/scheduleJobTransitions.cjs} +3 -3
  137. package/src/main/lib/{schedulerBatch.cjs → scheduler/schedulerBatch.cjs} +2 -2
  138. package/src/main/lib/{schedulerConfig.cjs → scheduler/schedulerConfig.cjs} +1 -1
  139. package/src/main/lib/{schedulerRuntimeState.cjs → scheduler/schedulerRuntimeState.cjs} +1 -1
  140. package/src/main/lib/{sessionSlots.cjs → scheduler/sessionSlots.cjs} +2 -2
  141. package/src/main/lib/{upgradeDrain.cjs → scheduler/upgradeDrain.cjs} +8 -11
  142. package/src/main/lib/{watchdogHelpers.cjs → scheduler/watchdogHelpers.cjs} +5 -19
  143. package/src/main/lib/{auditLog.cjs → telemetry/auditLog.cjs} +1 -1
  144. package/src/main/lib/{opsErrorLog.cjs → telemetry/opsErrorLog.cjs} +4 -4
  145. package/src/main/lib/{telemetryBacklog.cjs → telemetry/telemetryBacklog.cjs} +4 -4
  146. package/src/main/lib/{telemetryBoot.cjs → telemetry/telemetryBoot.cjs} +1 -1
  147. package/src/main/lib/{telemetryClient.cjs → telemetry/telemetryClient.cjs} +4 -4
  148. package/src/main/lib/{telemetrySettings.cjs → telemetry/telemetrySettings.cjs} +1 -1
  149. package/src/main/logs.cjs +1 -1
  150. package/src/main/mcpStatus.cjs +2 -2
  151. package/src/main/memoryAggregate.cjs +3 -3
  152. package/src/main/memoryTool.cjs +1 -1
  153. package/src/main/otel.cjs +2 -2
  154. package/src/main/pluginInstall.cjs +29 -3
  155. package/src/main/projectBrief.cjs +6 -6
  156. package/src/main/projectPages.cjs +1 -1
  157. package/src/main/promptSessionEvents.cjs +2 -2
  158. package/src/main/pty.cjs +7 -7
  159. package/src/main/queueOps.cjs +6 -6
  160. package/src/main/remoteClient.cjs +4 -4
  161. package/src/main/remoteClientIpc.cjs +1 -1
  162. package/src/main/runVerify.cjs +1 -1
  163. package/src/main/scheduler/CLAUDE.md +26 -0
  164. package/src/main/scheduler/budget.cjs +576 -0
  165. package/src/main/scheduler/gitTreeGuard.cjs +672 -0
  166. package/src/main/scheduler/prdParser.cjs +4 -4
  167. package/src/main/scheduler/prdPaths.cjs +487 -0
  168. package/src/main/scheduler/reviewLadder.cjs +1011 -0
  169. package/src/main/scheduler/starvation.cjs +390 -0
  170. package/src/main/scheduler.cjs +289 -3311
  171. package/src/main/seedAgentPersonas.cjs +5 -5
  172. package/src/main/seedDevPlugin.cjs +70 -3
  173. package/src/main/seedSchedulerMcp.cjs +2 -2
  174. package/src/main/supervisor.cjs +5 -5
  175. package/src/main/telemetryIpc.cjs +51 -0
  176. package/src/main/transcripts.cjs +3 -3
  177. package/src/main/updaterIpc.cjs +1 -1
  178. package/src/main/usage.cjs +1 -1
  179. package/src/main/watchers.cjs +1 -1
  180. package/src/main/webRemote.cjs +7 -7
  181. package/src/preload/api.d.ts +8 -8
  182. package/src/preload/index.cjs +3 -3
  183. package/src/seed/agents/demo-video-builder.md +62 -19
  184. package/dist/assets/RemoteMachines-DHJZfdJC.js +0 -3
  185. package/dist/assets/SystemPrompt-BCEyMSEq.js +0 -1
  186. package/dist/assets/TagLibrary-m3It8Oal.js +0 -1
  187. package/dist/assets/Toggle-In_AExPV.js +0 -1
  188. package/plugins/session-manager-dev/skills/blog-for-project-feature/0-select/SKILL.md +0 -39
  189. package/plugins/session-manager-dev/skills/blog-for-project-feature/1-research/SKILL.md +0 -37
  190. package/plugins/session-manager-dev/skills/blog-for-project-feature/2-storyboard/SKILL.md +0 -64
  191. package/plugins/session-manager-dev/skills/blog-for-project-feature/3-capture/SKILL.md +0 -52
  192. package/plugins/session-manager-dev/skills/blog-for-project-feature/4-draft-copy/SKILL.md +0 -37
  193. package/plugins/session-manager-dev/skills/blog-for-project-feature/5-illustrate/SKILL.md +0 -50
  194. package/plugins/session-manager-dev/skills/blog-for-project-feature/6-compose/SKILL.md +0 -51
  195. package/plugins/session-manager-dev/skills/blog-for-project-feature/7-review/SKILL.md +0 -54
  196. package/plugins/session-manager-dev/skills/blog-for-project-feature/SKILL.md +0 -144
  197. package/plugins/session-manager-dev/skills/blog-for-project-feature/feature.config.yaml +0 -90
  198. package/plugins/session-manager-dev/skills/discover-features/SKILL.md +0 -95
  199. package/plugins/session-manager-dev/skills/explain-to-me/SKILL.md +0 -205
  200. package/plugins/session-manager-dev/skills/explain-to-me/assets/style-reference.html +0 -163
  201. package/plugins/session-manager-dev/skills/find-opportunity/SKILL.md +0 -83
  202. package/plugins/session-manager-dev/skills/issue-address/0-select/0-fetch-pool/SKILL.md +0 -38
  203. package/plugins/session-manager-dev/skills/issue-address/0-select/1-reject-fixed/SKILL.md +0 -64
  204. package/plugins/session-manager-dev/skills/issue-address/0-select/2-reject-claimed/SKILL.md +0 -71
  205. package/plugins/session-manager-dev/skills/issue-address/0-select/3-rank-impact/SKILL.md +0 -39
  206. package/plugins/session-manager-dev/skills/issue-address/0-select/SKILL.md +0 -75
  207. package/plugins/session-manager-dev/skills/issue-address/1-confirm-open/SKILL.md +0 -39
  208. package/plugins/session-manager-dev/skills/issue-address/2-claim/SKILL.md +0 -57
  209. package/plugins/session-manager-dev/skills/issue-address/3-reproduce/SKILL.md +0 -40
  210. package/plugins/session-manager-dev/skills/issue-address/4-fix/SKILL.md +0 -33
  211. package/plugins/session-manager-dev/skills/issue-address/5-verify/SKILL.md +0 -40
  212. package/plugins/session-manager-dev/skills/issue-address/SKILL.md +0 -120
  213. package/plugins/session-manager-dev/skills/local-project-health/SKILL.md +0 -58
  214. package/plugins/session-manager-dev/skills/memory-sanitation/SKILL.md +0 -147
  215. package/plugins/session-manager-dev/skills/ops-sweep/SKILL.md +0 -137
  216. package/plugins/session-manager-dev/skills/pr-review-sweep/0-fetch/SKILL.md +0 -41
  217. package/plugins/session-manager-dev/skills/pr-review-sweep/1-classify/SKILL.md +0 -56
  218. package/plugins/session-manager-dev/skills/pr-review-sweep/2-check-fixed/SKILL.md +0 -49
  219. package/plugins/session-manager-dev/skills/pr-review-sweep/3-queue/SKILL.md +0 -57
  220. package/plugins/session-manager-dev/skills/pr-review-sweep/4-land-and-resolve/SKILL.md +0 -60
  221. package/plugins/session-manager-dev/skills/pr-review-sweep/SKILL.md +0 -124
  222. package/plugins/session-manager-dev/skills/pr-signal/SKILL.md +0 -67
  223. package/plugins/session-manager-dev/skills/project-status/SKILL.md +0 -243
  224. package/plugins/session-manager-dev/skills/requesting-code-review/SKILL.md +0 -98
  225. package/plugins/session-manager-dev/skills/requesting-code-review/code-reviewer.md +0 -146
  226. /package/src/main/lib/{agentEffortResolve.cjs → claude/agentEffortResolve.cjs} +0 -0
  227. /package/src/main/lib/{claudeCliCaps.cjs → claude/claudeCliCaps.cjs} +0 -0
  228. /package/src/main/lib/{usageCircuit.cjs → claude/usageCircuit.cjs} +0 -0
  229. /package/src/main/lib/{epicSpawnCwd.cjs → epic/epicSpawnCwd.cjs} +0 -0
  230. /package/src/main/lib/{customerFeedbackAdminRoutes.cjs → feedback-remote/customerFeedbackAdminRoutes.cjs} +0 -0
  231. /package/src/main/lib/{remoteE2eCrypto.cjs → feedback-remote/remoteE2eCrypto.cjs} +0 -0
  232. /package/src/main/lib/{branchSweep.cjs → git/branchSweep.cjs} +0 -0
  233. /package/src/main/lib/{gitExec.cjs → git/gitExec.cjs} +0 -0
  234. /package/src/main/lib/{jobWorktree.cjs → git/jobWorktree.cjs} +0 -0
  235. /package/src/main/lib/{jobWorktreeBootLive.cjs → git/jobWorktreeBootLive.cjs} +0 -0
  236. /package/src/main/lib/{jobWorktreeTerminalOrphanLive.cjs → git/jobWorktreeTerminalOrphanLive.cjs} +0 -0
  237. /package/src/main/lib/{personaImportHealth.cjs → persona-macro/personaImportHealth.cjs} +0 -0
  238. /package/src/main/lib/{depSlugResolve.cjs → prd/depSlugResolve.cjs} +0 -0
  239. /package/src/main/lib/{planValidator.cjs → prd/planValidator.cjs} +0 -0
  240. /package/src/main/lib/{prdAuthoringSeed.cjs → prd/prdAuthoringSeed.cjs} +0 -0
  241. /package/src/main/lib/{prdDisposition.cjs → prd/prdDisposition.cjs} +0 -0
  242. /package/src/main/lib/{prdFrontmatter.cjs → prd/prdFrontmatter.cjs} +0 -0
  243. /package/src/main/lib/{prdSizing.cjs → prd/prdSizing.cjs} +0 -0
  244. /package/src/main/lib/{workTypeLibrary.cjs → prd/workTypeLibrary.cjs} +0 -0
  245. /package/src/main/lib/{childWithLog.cjs → process/childWithLog.cjs} +0 -0
  246. /package/src/main/lib/{cleanEnv.cjs → process/cleanEnv.cjs} +0 -0
  247. /package/src/main/lib/{defaultShell.cjs → process/defaultShell.cjs} +0 -0
  248. /package/src/main/lib/{killTree.cjs → process/killTree.cjs} +0 -0
  249. /package/src/main/lib/{loginShellPath.cjs → process/loginShellPath.cjs} +0 -0
  250. /package/src/main/lib/{procIdentity.cjs → process/procIdentity.cjs} +0 -0
  251. /package/src/main/lib/{singleInstanceGuard.cjs → process/singleInstanceGuard.cjs} +0 -0
  252. /package/src/main/lib/{smProcNames.cjs → process/smProcNames.cjs} +0 -0
  253. /package/src/main/lib/{timeoutShimScript.cjs → process/timeoutShimScript.cjs} +0 -0
  254. /package/src/main/lib/{winSpawn.cjs → process/winSpawn.cjs} +0 -0
  255. /package/src/main/lib/{adoptedRunSupervisor.cjs → scheduler/adoptedRunSupervisor.cjs} +0 -0
  256. /package/src/main/lib/{dispatchLoop.cjs → scheduler/dispatchLoop.cjs} +0 -0
  257. /package/src/main/lib/{dodDrainHook.cjs → scheduler/dodDrainHook.cjs} +0 -0
  258. /package/src/main/lib/{fixPlanSlug.cjs → scheduler/fixPlanSlug.cjs} +0 -0
  259. /package/src/main/lib/{gateAuthority.cjs → scheduler/gateAuthority.cjs} +0 -0
  260. /package/src/main/lib/{landedSinceRun.cjs → scheduler/landedSinceRun.cjs} +0 -0
  261. /package/src/main/lib/{loadGate.cjs → scheduler/loadGate.cjs} +0 -0
  262. /package/src/main/lib/{needsReviewLedger.cjs → scheduler/needsReviewLedger.cjs} +0 -0
  263. /package/src/main/lib/{queueHealth.cjs → scheduler/queueHealth.cjs} +0 -0
  264. /package/src/main/lib/{queueHistory.cjs → scheduler/queueHistory.cjs} +0 -0
  265. /package/src/main/lib/{runLogRetention.cjs → scheduler/runLogRetention.cjs} +0 -0
  266. /package/src/main/lib/{scheduleJobSchema.cjs → scheduler/scheduleJobSchema.cjs} +0 -0
  267. /package/src/main/lib/{schedulerPaths.cjs → scheduler/schedulerPaths.cjs} +0 -0
  268. /package/src/main/lib/{terminalRunOutcome.cjs → scheduler/terminalRunOutcome.cjs} +0 -0
  269. /package/src/main/lib/{validationSentinels.cjs → scheduler/validationSentinels.cjs} +0 -0
  270. /package/src/main/lib/{crashTelemetry.cjs → telemetry/crashTelemetry.cjs} +0 -0
  271. /package/src/main/lib/{otlpTraceExporter.cjs → telemetry/otlpTraceExporter.cjs} +0 -0
  272. /package/src/main/lib/{telemetryConsent.cjs → telemetry/telemetryConsent.cjs} +0 -0
  273. /package/src/main/lib/{telemetryCounters.cjs → telemetry/telemetryCounters.cjs} +0 -0
  274. /package/src/main/lib/{atomicFs.cjs → util/atomicFs.cjs} +0 -0
  275. /package/src/main/lib/{encodeCwd.cjs → util/encodeCwd.cjs} +0 -0
  276. /package/src/main/lib/{expandHome.cjs → util/expandHome.cjs} +0 -0
  277. /package/src/main/lib/{extractJson.cjs → util/extractJson.cjs} +0 -0
  278. /package/src/main/lib/{fileTail.cjs → util/fileTail.cjs} +0 -0
  279. /package/src/main/lib/{headTailBuffer.cjs → util/headTailBuffer.cjs} +0 -0
  280. /package/src/main/lib/{kebabCase.cjs → util/kebabCase.cjs} +0 -0
  281. /package/src/main/lib/{loopDelay.cjs → util/loopDelay.cjs} +0 -0
  282. /package/src/main/lib/{lruCache.cjs → util/lruCache.cjs} +0 -0
  283. /package/src/main/lib/{withTimeout.cjs → util/withTimeout.cjs} +0 -0
@@ -15,7 +15,7 @@
15
15
  * VERIFIED or REFUTED with evidence. The job's self-reported status is an
16
16
  * input to that check, never a substitute for it.
17
17
  *
18
- * Shape mirrors lib/dodDrainHook.cjs: fire-and-forget (never throws to the
18
+ * Shape mirrors lib/scheduler/dodDrainHook.cjs: fire-and-forget (never throws to the
19
19
  * caller — errors are logged), kill-switched, idempotent.
20
20
  *
21
21
  * Kill-switch: SM_EPIC_VALIDATION_DISABLE=1 (mirrors the SM_DOD_DISABLE
@@ -24,7 +24,7 @@
24
24
  * SESSION SLOT POOL: this module spawns NOTHING. The prompt is enqueued via
25
25
  * chatRunner.cjs's enqueueExternalPrompt → `chat:external-send` → the
26
26
  * renderer's chat queue → chatRunner's pump, which acquires a slot from the
27
- * machine-wide lib/sessionSlots.cjs pool (chatRunner.cjs pump()) before any
27
+ * machine-wide lib/scheduler/sessionSlots.cjs pool (chatRunner.cjs pump()) before any
28
28
  * `claude -p` process starts. So the validation session cannot start outside
29
29
  * the pool — if the pool is exhausted the prompt simply waits in the chat
30
30
  * lane's FIFO, it never fans out into an extra parallel process (the
@@ -62,7 +62,7 @@ function pairKey(epicId, prdSlug) {
62
62
  */
63
63
  function defaultReadActiveIndex(cwd) {
64
64
  try {
65
- const { opsPath } = require('./opsOwnership.cjs');
65
+ const { opsPath } = require('../opsOwnership.cjs');
66
66
  const p = opsPath(cwd, 'prompt-sessions', 'active-index.json');
67
67
  return JSON.parse(fs.readFileSync(p, 'utf8'));
68
68
  } catch {
@@ -22,7 +22,7 @@
22
22
  * automatically — this predicate covers the other half.
23
23
  */
24
24
 
25
- const gitWorktree = require('./gitWorktree.cjs');
25
+ const gitWorktree = require('../git/gitWorktree.cjs');
26
26
  const { readActiveIndex } = require('./epicMint.cjs');
27
27
 
28
28
  /**
@@ -25,8 +25,8 @@
25
25
  * them from the command line.
26
26
  */
27
27
 
28
- const { integrateEpicBranch, cleanupEpicWorktree } = require('./gitWorktree.cjs');
29
- const { validatePath } = require('../config.cjs');
28
+ const { integrateEpicBranch, cleanupEpicWorktree } = require('../git/gitWorktree.cjs');
29
+ const { validatePath } = require('../../config.cjs');
30
30
 
31
31
  /**
32
32
  * mergeEpicToMainViaIpc(cwd, epicId, branch, dir) → Promise<MergeOutcome>
@@ -54,7 +54,7 @@ async function mergeEpicToMainViaIpc(cwd, epicId, branch, dir, carriedPaths) {
54
54
 
55
55
  function registerEpicWorktreeMergeHandlers() {
56
56
  const { ipcMain } = require('electron');
57
- const { schemas: s, validated: v } = require('../ipcSchemas.cjs');
57
+ const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
58
58
  ipcMain.handle(
59
59
  'promptSessions:merge-to-main',
60
60
  v(s.promptSessionsMergeToMain, ({ cwd, epicId, branch, dir, carriedPaths }) => mergeEpicToMainViaIpc(cwd, epicId, branch, dir, carriedPaths)),
@@ -24,8 +24,8 @@
24
24
  * since this is likewise reachable from the renderer over IPC.
25
25
  */
26
26
 
27
- const { createEpicWorktree } = require('./gitWorktree.cjs');
28
- const { validatePath } = require('../config.cjs');
27
+ const { createEpicWorktree } = require('../git/gitWorktree.cjs');
28
+ const { validatePath } = require('../../config.cjs');
29
29
 
30
30
  /**
31
31
  * createEpicWorktreeViaIpc(cwd, epicId) → Promise<EpicWorktree | null>
@@ -59,7 +59,7 @@ async function createEpicWorktreeViaIpc(cwd, epicId) {
59
59
 
60
60
  function registerEpicWorktreeMintHandlers() {
61
61
  const { ipcMain } = require('electron');
62
- const { schemas: s, validated: v } = require('../ipcSchemas.cjs');
62
+ const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
63
63
  ipcMain.handle(
64
64
  'promptSessions:create-worktree',
65
65
  v(s.promptSessionsCreateWorktree, ({ cwd, epicId }) => createEpicWorktreeViaIpc(cwd, epicId)),
@@ -35,8 +35,8 @@
35
35
  const fs = require('node:fs');
36
36
  const path = require('node:path');
37
37
  const os = require('node:os');
38
- const { assertOpsWrite, opsPath } = require('./opsOwnership.cjs');
39
- const atomicFs = require('./atomicFs.cjs');
38
+ const { assertOpsWrite, opsPath } = require('../opsOwnership.cjs');
39
+ const atomicFs = require('../util/atomicFs.cjs');
40
40
 
41
41
  // The old machine-wide map. Read-only from here on (migration source only) —
42
42
  // never written again, and deliberately never deleted so unmigrated projects
@@ -116,8 +116,8 @@ function setEpicWorktreeDisabledForProject(cwd, disabled, writer = 'epics') {
116
116
 
117
117
  function registerEpicWorktreeProjectConfigHandlers() {
118
118
  const { ipcMain } = require('electron');
119
- const { schemas: s, validated: v } = require('../ipcSchemas.cjs');
120
- const { validatePath } = require('../config.cjs');
119
+ const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
120
+ const { validatePath } = require('../../config.cjs');
121
121
  ipcMain.handle(
122
122
  'promptSessions:get-worktree-disabled',
123
123
  v(s.promptSessionsGetWorktreeDisabled, ({ cwd }) => {
@@ -7,14 +7,14 @@
7
7
  *
8
8
  * Step 1 of a two-PRD chain (PRD 953 here; PRD 954 routes createPromptSession
9
9
  * through it): purely additive today — nothing calls this handler yet. Kept
10
- * as a sibling module (mirrors lib/activeIndexMerge.cjs, which does the same
10
+ * as a sibling module (mirrors lib/epic/activeIndexMerge.cjs, which does the same
11
11
  * "own file, own register*Handlers export, wired from index.cjs" shape for
12
12
  * the neighboring active-index merge IPC) rather than growing epicMint.cjs
13
13
  * itself, since this is IPC-registration plumbing, not Epic-minting logic.
14
14
  */
15
15
 
16
16
  const { ensureEpic, readActiveIndex, MINT_AUTHORITY_NEW_EPIC_UI } = require('./epicMint.cjs');
17
- const { validatePath } = require('../config.cjs');
17
+ const { validatePath } = require('../../config.cjs');
18
18
 
19
19
  /**
20
20
  * createEpicViaIpc(cwd, { goalText, tag?, agentType?, source? }) → Promise<{ epicId, session }>
@@ -38,7 +38,7 @@ const { validatePath } = require('../config.cjs');
38
38
  * + every cwd a TAB has opened) closes the gap so this handler can't be used
39
39
  * to make main write session-manager-operations/ into an arbitrary
40
40
  * filesystem location — the same boundary every other renderer-facing path
41
- * IPC (config:read-json/write-json, lib/activeIndexMerge.cjs's own merge) is
41
+ * IPC (config:read-json/write-json, lib/epic/activeIndexMerge.cjs's own merge) is
42
42
  * already required to pass through.
43
43
  */
44
44
  async function createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort, source, openingPrompt, sections } = {}) {
@@ -61,7 +61,7 @@ async function createEpicViaIpc(cwd, { goalText, tag, agentType, model, effort,
61
61
 
62
62
  function registerPromptSessionsCreateEpicHandlers() {
63
63
  const { ipcMain } = require('electron');
64
- const { schemas: s, validated: v } = require('../ipcSchemas.cjs');
64
+ const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
65
65
  ipcMain.handle(
66
66
  'promptSessions:create-epic',
67
67
  v(s.promptSessionsCreateEpic, ({ cwd, goalText, tag, agentType, model, effort, source, openingPrompt, sections }) =>
@@ -57,16 +57,16 @@ const fsp = require('node:fs/promises');
57
57
  const os = require('node:os');
58
58
  const path = require('node:path');
59
59
 
60
- const config = require('../config.cjs');
60
+ const config = require('../../config.cjs');
61
61
  const { readBody, sendJson } = require('./localAdminHttp.cjs');
62
62
  const {
63
63
  ensureEpic,
64
64
  readActiveIndex,
65
65
  MINT_AUTHORITY_CROSS_PROJECT_FEEDBACK,
66
- } = require('./epicMint.cjs');
67
- const { appendAuditEvent } = require('./auditLog.cjs');
68
- const { OPS_ROOT_DIR } = require('./opsOwnership.cjs');
69
- const { resolveProjectContext } = require('./projectRootResolve.cjs');
66
+ } = require('../epic/epicMint.cjs');
67
+ const { appendAuditEvent } = require('../telemetry/auditLog.cjs');
68
+ const { OPS_ROOT_DIR } = require('../opsOwnership.cjs');
69
+ const { resolveProjectContext } = require('../projectRootResolve.cjs');
70
70
 
71
71
  /** Only these three Epic tags make sense for an inbound report — they are
72
72
  * exactly the tags that route through /develop (tagLibrary.ts). 'build' and
@@ -437,7 +437,7 @@ async function openFeedbackSession(input, deps = {}) {
437
437
  // Required lazily: promptSessionEvents.cjs pulls in config.cjs's watcher
438
438
  // machinery, and this module is also required from unit tests that never
439
439
  // boot the main process.
440
- || ((...args) => require('../promptSessionEvents.cjs').appendResponseEventIfKnown(...args));
440
+ || ((...args) => require('../../promptSessionEvents.cjs').appendResponseEventIfKnown(...args));
441
441
 
442
442
  const checked = validateFeedbackInput(input);
443
443
  if (!checked.ok) return checked;
@@ -449,7 +449,7 @@ async function openFeedbackSession(input, deps = {}) {
449
449
  // the same lookup (required lazily: prdCreate pulls in ipcSchemas/config).
450
450
  if (!v.fromEpicId && input.originClaudeSessionId) {
451
451
  try {
452
- const { resolveSourcePromptIdFromClaudeSession } = require('./prdCreate.cjs');
452
+ const { resolveSourcePromptIdFromClaudeSession } = require('../prd/prdCreate.cjs');
453
453
  v.fromEpicId = resolveSourcePromptIdFromClaudeSession(v.fromCwd, String(input.originClaudeSessionId)) || null;
454
454
  } catch { /* unresolvable — the proposal still delivers, just without a receipt */ }
455
455
  }
@@ -14,8 +14,8 @@
14
14
 
15
15
  const path = require('node:path');
16
16
  const fsp = require('node:fs/promises');
17
- const atomicFs = require('./atomicFs.cjs');
18
- const schedulerPaths = require('./schedulerPaths.cjs');
17
+ const atomicFs = require('../util/atomicFs.cjs');
18
+ const schedulerPaths = require('../scheduler/schedulerPaths.cjs');
19
19
 
20
20
  const FEEDBACK_SLUG = 'session-manager';
21
21
  const TAGS = /** @type {const} */ (['bug', 'feature', 'discussion']);
@@ -77,7 +77,7 @@ function defaultVersion() {
77
77
  if (electron && electron.app && typeof electron.app.getVersion === 'function') return electron.app.getVersion();
78
78
  } catch { /* not running under Electron */ }
79
79
  try {
80
- return String(require('../../../package.json').version || 'unknown');
80
+ return String(require('../../../../package.json').version || 'unknown');
81
81
  } catch {
82
82
  return 'unknown';
83
83
  }
@@ -12,8 +12,8 @@
12
12
 
13
13
  const path = require('node:path');
14
14
  const fsp = require('node:fs/promises');
15
- const atomicFs = require('./atomicFs.cjs');
16
- const schedulerPaths = require('./schedulerPaths.cjs');
15
+ const atomicFs = require('../util/atomicFs.cjs');
16
+ const schedulerPaths = require('../scheduler/schedulerPaths.cjs');
17
17
  const { resolveFeedbackBase, fromWireType, FEEDBACK_SLUG } = require('./customerFeedbackClient.cjs');
18
18
 
19
19
  const STATUSES = /** @type {const} */ (['open', 'in_progress', 'resolved', 'wontfix']);
@@ -10,7 +10,7 @@ const REFRESH_DELAY_MS = 30_000;
10
10
  */
11
11
  function registerCustomerFeedbackHandlers(deps = {}) {
12
12
  const ipcMain = deps.ipcMain || require('electron').ipcMain;
13
- const { schemas: s, validated: v } = require('../ipcSchemas.cjs');
13
+ const { schemas: s, validated: v } = require('../../ipcSchemas.cjs');
14
14
  const client = deps.client || require('./customerFeedbackClient.cjs');
15
15
  const inbox = deps.inbox || require('./customerFeedbackInbox.cjs');
16
16
  const timer = deps.setTimeoutImpl || setTimeout;
@@ -35,8 +35,8 @@ const http = require('node:http');
35
35
  const path = require('node:path');
36
36
  const crypto = require('node:crypto');
37
37
  const fsp = require('node:fs/promises');
38
- const config = require('../config.cjs');
39
- const schedulerPaths = require('./schedulerPaths.cjs');
38
+ const config = require('../../config.cjs');
39
+ const schedulerPaths = require('../scheduler/schedulerPaths.cjs');
40
40
 
41
41
  /**
42
42
  * Mode-aware token file path, resolved fresh on every call (never cached at
@@ -19,7 +19,7 @@
19
19
 
20
20
  const { readBody, sendJson } = require('./localAdminHttp.cjs');
21
21
  const { resolveCwd } = require('./projectHomeAdminRoutes.cjs');
22
- const macroLibrary = require('./macroLibrary.cjs');
22
+ const macroLibrary = require('../persona-macro/macroLibrary.cjs');
23
23
 
24
24
  function listHandler(onChanged, libOpts) {
25
25
  return async (_req, res, query) => {
@@ -23,10 +23,10 @@
23
23
  const fs = require('node:fs');
24
24
  const path = require('node:path');
25
25
  const { readBody, sendJson } = require('./localAdminHttp.cjs');
26
- const { resolveProjectContext } = require('./projectRootResolve.cjs');
27
- const { opsPath, OPS_ROOT_DIR } = require('./opsOwnership.cjs');
28
- const config = require('../config.cjs');
29
- const { schemas } = require('../ipcSchemas.cjs');
26
+ const { resolveProjectContext } = require('../projectRootResolve.cjs');
27
+ const { opsPath, OPS_ROOT_DIR } = require('../opsOwnership.cjs');
28
+ const config = require('../../config.cjs');
29
+ const { schemas } = require('../../ipcSchemas.cjs');
30
30
 
31
31
  const MAX_HTML_BYTES = 1024 * 1024;
32
32
  const MAX_DEMO_VIDEO_BYTES = 2 * 1024 * 1024;
@@ -8,8 +8,8 @@
8
8
  const fs = require('node:fs');
9
9
  const https = require('node:https');
10
10
  const path = require('node:path');
11
- const { claudeHome } = require('./schedulerPaths.cjs');
12
- const { writeJsonAtomicSync, readJsonOrSync } = require('./atomicFs.cjs');
11
+ const { claudeHome } = require('../scheduler/schedulerPaths.cjs');
12
+ const { writeJsonAtomicSync, readJsonOrSync } = require('../util/atomicFs.cjs');
13
13
 
14
14
  const RELAY_CLIENT_API_BASE = 'https://bilko.run/api/sm-relay';
15
15
  const REQUEST_TIMEOUT_MS = 15_000;
@@ -9,7 +9,7 @@
9
9
  * which preserves single-client behaviour.
10
10
  */
11
11
 
12
- const { makeState } = require('./e2eStateMachine.cjs')
12
+ const { makeState } = require('../e2eStateMachine.cjs')
13
13
 
14
14
  const LEGACY_CLIENT_KEY = 'legacy'
15
15
  const MAX_KEY_LEN = 64
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * `<cwd>/session-manager-operations/` (PRDs, queue state, run logs, the
18
18
  * active-index.json Epic store) is resolved from a project's cwd by
19
- * lib/prdLocations.cjs, lib/queueStore.cjs, and every prompt-sessions IPC
19
+ * lib/prd/prdLocations.cjs, lib/scheduler/queueStore.cjs, and every prompt-sessions IPC
20
20
  * handler — all of them take `cwd` as an explicit parameter, never
21
21
  * `process.cwd()`. That means the ops root follows WHATEVER cwd value the
22
22
  * caller passes in. A prior incident (recorded in this project's memory as
@@ -53,8 +53,8 @@ const fsp = require('node:fs/promises');
53
53
  const path = require('node:path');
54
54
  const os = require('node:os');
55
55
  const crypto = require('node:crypto');
56
- const { OPS_ROOT_DIR } = require('./opsOwnership.cjs');
57
- const schedulerPaths = require('./schedulerPaths.cjs');
56
+ const { OPS_ROOT_DIR } = require('../opsOwnership.cjs');
57
+ const schedulerPaths = require('../scheduler/schedulerPaths.cjs');
58
58
  const sharedGitExec = require('./gitExec.cjs');
59
59
 
60
60
  // Per-kind configuration. Roots are kept OUTSIDE any project's own tree
@@ -148,7 +148,7 @@ function worktreeRootFor(kind) {
148
148
  function isWorktreeDisabled(kind, cwd) {
149
149
  if (process.env[configFor(kind).disableEnv] === '1') return true;
150
150
  if (kind === 'epic' && cwd) {
151
- const { isEpicWorktreeDisabledForProject } = require('./epicWorktreeProjectConfig.cjs');
151
+ const { isEpicWorktreeDisabledForProject } = require('../epic/epicWorktreeProjectConfig.cjs');
152
152
  if (isEpicWorktreeDisabledForProject(cwd)) return true;
153
153
  }
154
154
  return false;
@@ -169,7 +169,7 @@ function getMaxConcurrentWorktrees(kind) {
169
169
  const raw = Number(process.env[cfg.maxEnv]);
170
170
  if (Number.isFinite(raw) && raw > 0) return Math.floor(raw);
171
171
  if (kind === 'job') {
172
- const sessionSlots = require('./sessionSlots.cjs');
172
+ const sessionSlots = require('../scheduler/sessionSlots.cjs');
173
173
  return Math.max(cfg.defaultMax, sessionSlots.totalSlots());
174
174
  }
175
175
  return cfg.defaultMax;
@@ -1546,7 +1546,7 @@ async function salvageWorktreeDiff({ cwd, outFile }) {
1546
1546
  }
1547
1547
  const patch = await execGit(['diff', 'HEAD', '--binary'], { cwd, timeout: 30_000 });
1548
1548
  if (!patch || !patch.trim()) return { ok: false };
1549
- const { writeTextAtomic } = require('../config.cjs');
1549
+ const { writeTextAtomic } = require('../../config.cjs');
1550
1550
  await writeTextAtomic(outFile, patch);
1551
1551
  return { ok: true, bytes: Buffer.byteLength(patch, 'utf8') };
1552
1552
  } catch {
@@ -1628,7 +1628,7 @@ async function salvageDirtyDelta({ cwd, paths, outFile }) {
1628
1628
  }
1629
1629
  }
1630
1630
  if (!patch.trim()) return { ok: false };
1631
- const { writeTextAtomic } = require('../config.cjs');
1631
+ const { writeTextAtomic } = require('../../config.cjs');
1632
1632
  await writeTextAtomic(outFile, patch);
1633
1633
  return { ok: true, bytes: Buffer.byteLength(patch, 'utf8') };
1634
1634
  } catch {
@@ -28,7 +28,7 @@
28
28
  const path = require('node:path');
29
29
  const config = require('../config.cjs');
30
30
 
31
- const { historyRollupPath } = require('./schedulerPaths.cjs');
31
+ const { historyRollupPath } = require('./scheduler/schedulerPaths.cjs');
32
32
  const COMPACT_THRESHOLD_BYTES = 5 * 1024 * 1024;
33
33
 
34
34
  const TOTALS_MODEL_ID = '';
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  const fs = require('node:fs');
10
- const { walkImports } = require('./personaImportHealth.cjs');
10
+ const { walkImports } = require('./persona-macro/personaImportHealth.cjs');
11
11
 
12
12
  // Maps walkImports' result shape to what the renderer panel needs per file:
13
13
  // resolved path, existence, size, a rough token estimate, and overall health.
@@ -15,7 +15,7 @@
15
15
  const os = require('node:os');
16
16
  const crypto = require('node:crypto');
17
17
  const path = require('node:path');
18
- const claudeBin = require('./claudeBin.cjs');
18
+ const claudeBin = require('./claude/claudeBin.cjs');
19
19
  const { isPackagedApp } = require('./appRuntime.cjs');
20
20
 
21
21
  function resolveElectronApp() {
@@ -14,7 +14,7 @@ const { execFileSync, spawn } = require('node:child_process');
14
14
  const path = require('node:path');
15
15
  const fsp = require('node:fs/promises');
16
16
  const { shell } = require('electron');
17
- const { cleanChildEnv } = require('./cleanEnv.cjs');
17
+ const { cleanChildEnv } = require('./process/cleanEnv.cjs');
18
18
 
19
19
  // IMAGE_RE — extensions opened in the OS default viewer, not a code editor.
20
20
  // Keep in sync with the comment in index.cjs open-file-in-editor handler.
@@ -24,9 +24,9 @@
24
24
  *
25
25
  * Enforcement points (every write path into the ops root calls assertOpsWrite):
26
26
  * - config.cjs writeTextAtomic / writeBinaryAtomic / writeJson / writeJsonSync
27
- * - lib/epicMint.cjs (raw fs tmp+rename)
28
- * - lib/queueStore.cjs (raw fs tmp+rename)
29
- * - lib/opsErrorLog.cjs (raw fs append, JSONL error log)
27
+ * - lib/epic/epicMint.cjs (raw fs tmp+rename)
28
+ * - lib/scheduler/queueStore.cjs (raw fs tmp+rename)
29
+ * - lib/telemetry/opsErrorLog.cjs (raw fs append, JSONL error log)
30
30
  * Renderer callers declare their writer id through the IPC payload.
31
31
  */
32
32
 
@@ -24,8 +24,8 @@
24
24
 
25
25
  const path = require('node:path');
26
26
  const { z } = require('zod');
27
- const { WorkTypeSchema, LEGACY_WORK_TYPES } = require('./workTypeLibrary.cjs');
28
- const { PERSONA_NAME_RE, ALL_PROJECTS } = require('../agentLibrary.cjs');
27
+ const { WorkTypeSchema, LEGACY_WORK_TYPES } = require('../prd/workTypeLibrary.cjs');
28
+ const { PERSONA_NAME_RE, ALL_PROJECTS } = require('../../agentLibrary.cjs');
29
29
 
30
30
  // Bounded free-text fields — generous for legitimate persona authoring while
31
31
  // still blocking a renderer from writing an effectively-unbounded frontmatter
@@ -30,9 +30,9 @@ const BUILTIN_MACROS = Object.freeze([
30
30
  tag: 'project-home-builder',
31
31
  surface: 'project-home',
32
32
  projects: ['*'],
33
- builtinVersion: 3,
33
+ builtinVersion: 4,
34
34
  prompt:
35
- 'Generate a 30-second demo video for this project as one self-contained HTML/JavaScript animation that presents its main goals and key features, grounded only in what you read in the repository, with a matching on-device narration track: narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_demo_video_write call passing htmlPath.',
35
+ "Generate a character and cute animated JavaScript video: a 30-second demo of this project as one self-contained HTML/JavaScript animation. Ground everything in what you read in the repository — invent an original mascot character whose look, name and personality match the project's theme and purpose, and tell the project's real goals and key features through it. The character, story and visuals must match the project's theme and purpose as read from the repository. Write the narration script first (hook, problem, solution, three features, call to action), then build every scene to match its line, with fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits the project. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_demo_video_write call passing htmlPath.",
36
36
  }),
37
37
  ]);
38
38
 
@@ -38,11 +38,11 @@ const fsp = require('node:fs/promises');
38
38
  const path = require('node:path');
39
39
  const crypto = require('node:crypto');
40
40
  const { z } = require('zod');
41
- const { writeJsonAtomic } = require('./atomicFs.cjs');
42
- const { EpicTagSchema } = require('./promptSessionSchema.cjs');
43
- const { WORK_TYPES } = require('./workTypeLibrary.cjs');
41
+ const { writeJsonAtomic } = require('../util/atomicFs.cjs');
42
+ const { EpicTagSchema } = require('../promptSessionSchema.cjs');
43
+ const { WORK_TYPES } = require('../prd/workTypeLibrary.cjs');
44
44
  const { PERSONA_NAME_RE } = require('./personaMerge.cjs');
45
- const { schedulerHome } = require('./schedulerPaths.cjs');
45
+ const { schedulerHome } = require('../scheduler/schedulerPaths.cjs');
46
46
  const { BUILTIN_MACROS } = require('./builtinMacros.cjs');
47
47
 
48
48
  const ALL_PROJECTS = '*';
@@ -306,7 +306,7 @@ function personasToMacros(personas, now) {
306
306
  /** Returns the migrated macros, or `null` on failure (caller must NOT write). */
307
307
  async function migrateFromPersonas(opts) {
308
308
  try {
309
- const listPersonas = (opts && opts.listPersonas) || require('../agentLibrary.cjs').listPersonas;
309
+ const listPersonas = (opts && opts.listPersonas) || require('../../agentLibrary.cjs').listPersonas;
310
310
  const personas = await listPersonas();
311
311
  return personasToMacros(personas, new Date().toISOString());
312
312
  } catch (err) {
@@ -33,9 +33,9 @@
33
33
  */
34
34
 
35
35
  const fs = require('node:fs');
36
- const { splitFrontmatter } = require('./prdFrontmatter.cjs');
37
- const { resolvePersonaPaths } = require('./epicMint.cjs');
38
- const configMgr = require('../config.cjs');
36
+ const { splitFrontmatter } = require('../prd/prdFrontmatter.cjs');
37
+ const { resolvePersonaPaths } = require('../epic/epicMint.cjs');
38
+ const configMgr = require('../../config.cjs');
39
39
 
40
40
  /** Filename-safe persona name: lowercase, hyphenated, matches the `.md` files on disk. */
41
41
  const PERSONA_NAME_RE = /^[a-z][a-z0-9-]*$/;
@@ -47,7 +47,7 @@ function reportOverlayIssueOnce(cwd, agentType, overlayPath, message) {
47
47
  if (reportedIssues.has(key)) return;
48
48
  reportedIssues.add(key);
49
49
  try {
50
- const { appendError } = require('./opsErrorLog.cjs');
50
+ const { appendError } = require('../telemetry/opsErrorLog.cjs');
51
51
  appendError({
52
52
  cwd,
53
53
  scope: 'personaMerge',
@@ -285,6 +285,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
285
285
  effort: "medium",
286
286
  },
287
287
  },
288
+ {
289
+ commit: "seed-v4",
290
+ bodySha256: "247f5244d376e9842f368955bdb9b6c7c4bfc45821ba44aa6ebf44aa30b5afb1",
291
+ fm: {
292
+ description: "30-second self-contained HTML/JS demo video for Project Home, saved via project_demo_video_write.",
293
+ tools: "Read, Grep, Glob, Bash, Write, Edit",
294
+ title: "Project Home — Demo Video",
295
+ model: "opus",
296
+ effort: "max",
297
+ },
298
+ },
288
299
  ],
289
300
  });
290
301
 
@@ -25,13 +25,13 @@
25
25
  */
26
26
  'use strict';
27
27
 
28
- const { schemas } = require('../ipcSchemas.cjs');
29
- const { readBody, sendJson } = require('./localAdminHttp.cjs');
30
- const { appendAuditEvent } = require('./auditLog.cjs');
31
- const queueOps = require('../queueOps.cjs');
32
- const { MCP_TOOL_CATALOG, MCP_RECIPES } = require('./mcpToolCatalog.cjs');
33
- const { checkDelegationReadiness } = require('./delegationReadiness.cjs');
34
- const { resolveProjectContext } = require('./projectRootResolve.cjs');
28
+ const { schemas } = require('../../ipcSchemas.cjs');
29
+ const { readBody, sendJson } = require('../feedback-remote/localAdminHttp.cjs');
30
+ const { appendAuditEvent } = require('../telemetry/auditLog.cjs');
31
+ const queueOps = require('../../queueOps.cjs');
32
+ const { MCP_TOOL_CATALOG, MCP_RECIPES } = require('../mcpToolCatalog.cjs');
33
+ const { checkDelegationReadiness } = require('../epic/delegationReadiness.cjs');
34
+ const { resolveProjectContext } = require('../projectRootResolve.cjs');
35
35
 
36
36
  function parseJsonBody(raw) {
37
37
  try {
@@ -13,8 +13,8 @@
13
13
  * "available personas" name list surfaced in the write-time rejection error.
14
14
  */
15
15
 
16
- const { personaFileExists, resolvePersonaPaths } = require('./epicMint.cjs');
17
- const { listPersonas } = require('../agentLibrary.cjs');
16
+ const { personaFileExists, resolvePersonaPaths } = require('../epic/epicMint.cjs');
17
+ const { listPersonas } = require('../../agentLibrary.cjs');
18
18
 
19
19
  /** PRD execution's documented default persona (dev-lead.md's own frontmatter role). */
20
20
  const DEFAULT_PRD_AGENT_TYPE = 'dev-lead';
@@ -41,7 +41,7 @@ function reportDanglingAgentTypeOnce(cwd, agentType, deps = {}) {
41
41
  // Required lazily, same rationale as agentModelResolve.cjs's
42
42
  // logDanglingPersonaOnce: pay for this leaf module only on the (rare)
43
43
  // miss path.
44
- const { appendError } = require('./opsErrorLog.cjs');
44
+ const { appendError } = require('../telemetry/opsErrorLog.cjs');
45
45
  appendError({
46
46
  cwd,
47
47
  scope: 'prdAgentType',
@@ -18,22 +18,22 @@
18
18
 
19
19
  const fsp = require('node:fs/promises');
20
20
  const path = require('node:path');
21
- const { schemas, PRD_CREATE_SLUG_RE } = require('../ipcSchemas.cjs');
22
- const { kebabCase } = require('./kebabCase.cjs');
23
- const config = require('../config.cjs');
24
- const { expandHome } = require('./expandHome.cjs');
25
- const { readBody, sendJson } = require('./localAdminHttp.cjs');
26
- const { readActiveIndex } = require('./epicMint.cjs');
27
- const { appendAuditEvent } = require('./auditLog.cjs');
28
- const { resolveProjectContext } = require('./projectRootResolve.cjs');
29
- const { fixChainDepthOf, baseSlugOf } = require('./fixChainDepth.cjs');
21
+ const { schemas, PRD_CREATE_SLUG_RE } = require('../../ipcSchemas.cjs');
22
+ const { kebabCase } = require('../util/kebabCase.cjs');
23
+ const config = require('../../config.cjs');
24
+ const { expandHome } = require('../util/expandHome.cjs');
25
+ const { readBody, sendJson } = require('../feedback-remote/localAdminHttp.cjs');
26
+ const { readActiveIndex } = require('../epic/epicMint.cjs');
27
+ const { appendAuditEvent } = require('../telemetry/auditLog.cjs');
28
+ const { resolveProjectContext } = require('../projectRootResolve.cjs');
29
+ const { fixChainDepthOf, baseSlugOf } = require('../scheduler/fixChainDepth.cjs');
30
30
  const { DEFAULT_PRD_AGENT_TYPE, assertAgentTypeWritable } = require('./prdAgentType.cjs');
31
31
  const { resolveDepSlug, findNearMatches } = require('./depSlugResolve.cjs');
32
- const { isFixPlanSlug } = require('./fixPlanSlug.cjs');
32
+ const { isFixPlanSlug } = require('../scheduler/fixPlanSlug.cjs');
33
33
  const { isIncomplete, resolveChainTerminals, isValidPlanId, mintPlanId, resolveInheritedPlanId } = require('./prdDisposition.cjs');
34
34
  const { sizingWarnings } = require('./prdSizing.cjs');
35
35
  const { validateGate, validateFiles, renderFilesSection, renderGateSection } = require('./prdGateFiles.cjs');
36
- const { resolveGate, parseChain, isNoneGate } = require('./definitionOfDone.cjs');
36
+ const { resolveGate, parseChain, isNoneGate } = require('../scheduler/definitionOfDone.cjs');
37
37
 
38
38
  // A caller-supplied slug that already starts with its own `NN-` (e.g.
39
39
  // "254-perf-x") used to silently become the double-prefixed row
@@ -55,7 +55,7 @@ const SLUG_HAS_NN_PREFIX_RE = /^(\d+)-/;
55
55
  const FIX_CHAIN_DEPTH_CAP = 1;
56
56
 
57
57
  const STANDARDS_PATH = path.join(
58
- __dirname, '..', '..', '..',
58
+ __dirname, '..', '..', '..', '..',
59
59
  'plugins', 'session-manager-dev', 'skills', 'develop', 'standards.md',
60
60
  );
61
61
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  const fs = require('node:fs');
13
13
  const { splitFrontmatter } = require('./prdFrontmatter.cjs');
14
- const { extractSection } = require('./definitionOfDone.cjs');
14
+ const { extractSection } = require('../scheduler/definitionOfDone.cjs');
15
15
 
16
16
  // Backtick-quoted, extension-bearing relative paths, e.g. `src/main/scheduler.cjs`
17
17
  // or `src/main/scheduler.cjs:490` (trailing :line dropped). Requires at least
@@ -15,7 +15,7 @@
15
15
  * No I/O, no scheduler imports — pure string-in, string/array-out.
16
16
  */
17
17
 
18
- const { parseChain, explainChain, isNoneGate } = require('./definitionOfDone.cjs');
18
+ const { parseChain, explainChain, isNoneGate } = require('../scheduler/definitionOfDone.cjs');
19
19
 
20
20
  const GATE_MIN_ENTRIES = 1;
21
21
  const GATE_MAX_ENTRIES = 10;
@@ -27,9 +27,9 @@
27
27
 
28
28
  const fs = require('node:fs');
29
29
  const path = require('node:path');
30
- const { activeProjectCwds, allProjectCwds } = require('./activeSessions.cjs');
30
+ const { activeProjectCwds, allProjectCwds } = require('../activeSessions.cjs');
31
31
 
32
- const { opsPath, OPS_ROOT_DIR } = require('./opsOwnership.cjs');
32
+ const { opsPath, OPS_ROOT_DIR } = require('../opsOwnership.cjs');
33
33
 
34
34
  // Segments UNDER the ops root; the ops root itself is resolved by
35
35
  // opsOwnership.opsPath (PRD 1082) — never joined onto a raw cwd here.
@@ -18,9 +18,9 @@ const fsp = require('node:fs/promises');
18
18
  const path = require('node:path');
19
19
  const { splitFrontmatter, parsePrdFile, serializePrdFile } = require('./prdFrontmatter.cjs');
20
20
  const { resolvePrdWriteDir, resolvePrdsDirs } = require('./prdLocations.cjs');
21
- const { projectQueuePath } = require('./queueStore.cjs');
22
- const { expandHome } = require('./expandHome.cjs');
23
- const atomicFs = require('./atomicFs.cjs');
21
+ const { projectQueuePath } = require('../scheduler/queueStore.cjs');
22
+ const { expandHome } = require('../util/expandHome.cjs');
23
+ const atomicFs = require('../util/atomicFs.cjs');
24
24
 
25
25
  /**
26
26
  * Move every `.md` file in legacyPrdsDir whose frontmatter `cwd` resolves to