claude-code-session-manager 0.86.0 → 0.88.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 (335) hide show
  1. package/README.md +26 -53
  2. package/dist/assets/AgentLibrary-BZ6IY2g1.js +3 -0
  3. package/dist/assets/{DataModel-Q4jhl24R.js → DataModel-dAoGAODX.js} +1 -1
  4. package/dist/assets/{History-Cj2FejEo.js → History-CF157HyX.js} +2 -2
  5. package/dist/assets/{Hooks-CaelQI6t.js → Hooks-CCPPipBk.js} +3 -3
  6. package/dist/assets/{HostBilko--v7cMR8I.js → HostBilko-Dlmz2m06.js} +1 -1
  7. package/dist/assets/{Library-DgI9oCCZ.js → Library-BaXcboWX.js} +1 -1
  8. package/dist/assets/{ListDetail-DYUZN-x-.js → ListDetail-CoUCzG5S.js} +1 -1
  9. package/dist/assets/MarkdownEditor-DTg3JlOT.js +1 -0
  10. package/dist/assets/{McpServers-ypCYURh3.js → McpServers-DdjY1sA3.js} +2 -2
  11. package/dist/assets/{Memory-C2qYp-3M.js → Memory-BJ3Jlw0C.js} +4 -4
  12. package/dist/assets/{Panel-Cj2kw-Zv.js → Panel-ygRSgc41.js} +1 -1
  13. package/dist/assets/Permissions-m0KAnccF.js +3 -0
  14. package/dist/assets/{Plugins-C1Vj8_dU.js → Plugins-CJRl6B3Q.js} +2 -2
  15. package/dist/assets/{ProvenanceBadge-DczPNM5U.js → ProvenanceBadge-w8cnlVvW.js} +1 -1
  16. package/dist/assets/{SaveBar-Cd_7U6Gb.js → SaveBar-BpyPcUIk.js} +1 -1
  17. package/dist/assets/Scheduler-D2ppxSfy.js +14 -0
  18. package/dist/assets/{ScopeSwitcher-DVSyI44-.js → ScopeSwitcher-EyuIwt-j.js} +1 -1
  19. package/dist/assets/Settings-BHSGGFEc.js +3 -0
  20. package/dist/assets/{SkillReferenceGraph-CUv1_Q2c.js → SkillReferenceGraph-BNaZ2JCF.js} +1 -1
  21. package/dist/assets/{Skills-C_YHkAy-.js → Skills-Dl3q75QV.js} +2 -2
  22. package/dist/assets/{SystemPrompt-B8R7T9xn.js → SystemPrompt-Bg6F-Cyp.js} +1 -1
  23. package/dist/assets/{TagLibrary-dj9YHWyy.js → TagLibrary-BSutflCy.js} +1 -1
  24. package/dist/assets/{TiptapBody-DnSBUjHE.js → TiptapBody-CXih4xrc.js} +1 -1
  25. package/dist/assets/{Toggle-CjV_BJn6.js → Toggle-2qtUHhA9.js} +1 -1
  26. package/dist/assets/{index-CXFQIPhO.js → index-B3emy2oI.js} +583 -583
  27. package/dist/assets/{index-CDo9xBR9.css → index-BHTX4OTc.css} +1 -1
  28. package/dist/assets/settingsSchema-CdzxaqwM.js +3 -0
  29. package/dist/assets/{whisperWorker-Dbia1OpC.js → whisperWorker-C7ZGQwKg.js} +7 -7
  30. package/dist/index.html +2 -2
  31. package/dist/vad/ort-wasm-simd-threaded.asyncify.mjs +106 -110
  32. package/dist/vad/ort-wasm-simd-threaded.asyncify.wasm +0 -0
  33. package/dist/vad/ort-wasm-simd-threaded.jsep.mjs +98 -98
  34. package/dist/vad/ort-wasm-simd-threaded.jsep.wasm +0 -0
  35. package/dist/vad/ort-wasm-simd-threaded.jspi.mjs +99 -102
  36. package/dist/vad/ort-wasm-simd-threaded.jspi.wasm +0 -0
  37. package/dist/vad/ort-wasm-simd-threaded.mjs +46 -46
  38. package/dist/vad/ort-wasm-simd-threaded.wasm +0 -0
  39. package/package.json +14 -17
  40. package/plugins/CLAUDE.md +61 -0
  41. package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
  42. package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +1 -1
  43. package/plugins/session-manager-dev/skills/ops-sweep/SKILL.md +1 -1
  44. package/scripts/README.md +59 -0
  45. package/scripts/audit-ops-hygiene.cjs +350 -0
  46. package/scripts/hooks/guard-destructive-git.cjs +10 -34
  47. package/scripts/hooks/guard-inline-implementation.cjs +14 -8
  48. package/scripts/hooks/guard-prd-writes.cjs +7 -36
  49. package/scripts/hooks/guard-self-schedule.cjs +175 -0
  50. package/scripts/ops-sweep.cjs +355 -0
  51. package/scripts/scheduler-mcp-server.cjs +35 -71
  52. package/src/main/__tests__/agentModelResolve.test.cjs +100 -9
  53. package/src/main/__tests__/bilkoHost-integration.test.cjs +3 -3
  54. package/src/main/__tests__/broadcastCoalescer.test.cjs +18 -0
  55. package/src/main/__tests__/chat-cancel-terminal.test.cjs +6 -9
  56. package/src/main/__tests__/chat-exit-close-race.test.cjs +3 -3
  57. package/src/main/__tests__/chat-mcp-consent-notice.test.cjs +4 -5
  58. package/src/main/__tests__/chat-queue.test.cjs +2 -2
  59. package/src/main/__tests__/chat-stop-signal.test.cjs +2 -2
  60. package/src/main/__tests__/dep-orphan-archive-health.test.cjs +77 -0
  61. package/src/main/__tests__/dod-batchkey.test.cjs +2 -2
  62. package/src/main/__tests__/dod-drain-hook.test.cjs +2 -2
  63. package/src/main/__tests__/dod-report.test.cjs +2 -2
  64. package/src/main/__tests__/dod-reverify.test.cjs +2 -2
  65. package/src/main/__tests__/epicMint.test.cjs +4 -4
  66. package/src/main/__tests__/exchanges.test.cjs +2 -2
  67. package/src/main/__tests__/extractJson.test.cjs +2 -2
  68. package/src/main/__tests__/files-reject-credentials.test.cjs +1 -1
  69. package/src/main/__tests__/fixtures/1218-fo-01-move-scripts-lib-into-src-main-lib.log +556 -0
  70. package/src/main/__tests__/health-build-freshness.test.cjs +39 -0
  71. package/src/main/__tests__/health-delegation-chain.test.cjs +17 -2
  72. package/src/main/__tests__/health-queue-dispatch.test.cjs +58 -7
  73. package/src/main/__tests__/health-tick-liveness.test.cjs +11 -3
  74. package/src/main/__tests__/health-usage-poller.test.cjs +70 -23
  75. package/src/main/__tests__/historyRollup.test.cjs +2 -2
  76. package/src/main/__tests__/kg-augment.test.cjs +2 -2
  77. package/src/main/__tests__/mcpStatus.test.cjs +2 -2
  78. package/src/main/__tests__/memoryAggregate.test.cjs +1 -1
  79. package/src/main/__tests__/memoryStale.test.cjs +1 -1
  80. package/src/main/__tests__/needsReviewLedger.test.cjs +162 -0
  81. package/src/main/__tests__/opsErrorLogTelemetryTap.test.cjs +28 -4
  82. package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +48 -4
  83. package/src/main/__tests__/prd-group-allocator.test.cjs +2 -2
  84. package/src/main/__tests__/prdAdminRouteParity.test.cjs +2 -0
  85. package/src/main/__tests__/prdAdminRoutes.test.cjs +14 -2
  86. package/src/main/__tests__/prdAuthoringSeed.test.cjs +39 -0
  87. package/src/main/__tests__/prdCreateDisposition.test.cjs +201 -0
  88. package/src/main/__tests__/prdFrontmatterDisposition.test.cjs +125 -0
  89. package/src/main/__tests__/prdLocations.test.cjs +100 -2
  90. package/src/main/__tests__/prdLocationsArchived.test.cjs +50 -1
  91. package/src/main/__tests__/prdSetDisposition.test.cjs +222 -0
  92. package/src/main/__tests__/proc-role-env.test.cjs +125 -0
  93. package/src/main/__tests__/procname-claude-spawn-sites.test.cjs +304 -0
  94. package/src/main/__tests__/procname-sm-processes.test.cjs +127 -0
  95. package/src/main/__tests__/projectHomeAdminRoutes.test.cjs +81 -401
  96. package/src/main/__tests__/projectPages.test.cjs +63 -149
  97. package/src/main/__tests__/queue-health-verdict.test.cjs +170 -0
  98. package/src/main/__tests__/queue-starvation-dispatch-driver.test.cjs +117 -20
  99. package/src/main/__tests__/queue-starvation-per-project.test.cjs +14 -2
  100. package/src/main/__tests__/queueHistory.test.cjs +65 -2
  101. package/src/main/__tests__/rateLimitPollerStreak.test.cjs +38 -3
  102. package/src/main/__tests__/reconcileTiming.test.cjs +135 -0
  103. package/src/main/__tests__/runVerify-landed-commit-outranks.test.cjs +181 -0
  104. package/src/main/__tests__/runVerify.test.cjs +5 -5
  105. package/src/main/__tests__/scheduleJobStatusDrift.test.cjs +3 -3
  106. package/src/main/__tests__/scheduleJobTransitions.test.cjs +103 -3
  107. package/src/main/__tests__/scheduler-adopted-run-supervision.test.cjs +143 -0
  108. package/src/main/__tests__/scheduler-autofix-select.test.cjs +2 -2
  109. package/src/main/__tests__/scheduler-autopromote.test.cjs +2 -2
  110. package/src/main/__tests__/scheduler-bash-timeout-env.test.cjs +3 -5
  111. package/src/main/__tests__/scheduler-boot-orphans.test.cjs +79 -98
  112. package/src/main/__tests__/scheduler-broadcast-reconcile.test.cjs +121 -0
  113. package/src/main/__tests__/scheduler-cross-project-batch.test.cjs +43 -0
  114. package/src/main/__tests__/scheduler-default-eligible-heal.test.cjs +161 -0
  115. package/src/main/__tests__/scheduler-dispatch-loop.test.cjs +58 -0
  116. package/src/main/__tests__/scheduler-epic-digest.test.cjs +3 -5
  117. package/src/main/__tests__/scheduler-force-tick-outcome.test.cjs +2 -2
  118. package/src/main/__tests__/scheduler-gate-shadow.test.cjs +119 -0
  119. package/src/main/__tests__/scheduler-guard-verdict-autoresolve.test.cjs +390 -0
  120. package/src/main/__tests__/scheduler-heartbeat-payload.test.cjs +80 -0
  121. package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +25 -18
  122. package/src/main/__tests__/scheduler-investigation-prompt.test.cjs +4 -4
  123. package/src/main/__tests__/scheduler-job-budget.test.cjs +172 -0
  124. package/src/main/__tests__/scheduler-launch-failure.test.cjs +3 -5
  125. package/src/main/__tests__/scheduler-looks-done.test.cjs +119 -10
  126. package/src/main/__tests__/scheduler-manual-pause.test.cjs +118 -0
  127. package/src/main/__tests__/scheduler-meta-code-sha.test.cjs +26 -3
  128. package/src/main/__tests__/scheduler-porcelain-rename.test.cjs +164 -0
  129. package/src/main/__tests__/scheduler-prd-missing-skip.test.cjs +17 -2
  130. package/src/main/__tests__/scheduler-prd-persona-spawn.test.cjs +3 -5
  131. package/src/main/__tests__/scheduler-quiet-machine-lease.test.cjs +41 -6
  132. package/src/main/__tests__/scheduler-rate-limit-pause.test.cjs +62 -6
  133. package/src/main/__tests__/scheduler-rate-limit-spin-guard.test.cjs +3 -5
  134. package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +182 -3
  135. package/src/main/__tests__/scheduler-reaper-helpers-basics.test.cjs +87 -0
  136. package/src/main/__tests__/scheduler-reconcile-cwd-preserve.test.cjs +100 -0
  137. package/src/main/__tests__/scheduler-reconcile-invalid-repair.test.cjs +3 -3
  138. package/src/main/__tests__/scheduler-reconcile-quarantine.test.cjs +4 -4
  139. package/src/main/__tests__/scheduler-shard-quarantine.test.cjs +110 -0
  140. package/src/main/__tests__/scheduler-shared-tree-guard.test.cjs +168 -0
  141. package/src/main/__tests__/scheduler-starve-escalation.test.cjs +18 -8
  142. package/src/main/__tests__/scheduler-stranded-autofix-park.test.cjs +245 -0
  143. package/src/main/__tests__/scheduler-supervisor-record.test.cjs +81 -0
  144. package/src/main/__tests__/scheduler-tick-cancel-token.test.cjs +2 -2
  145. package/src/main/__tests__/scheduler-tick-wedge.test.cjs +172 -0
  146. package/src/main/__tests__/scheduler-transient-failure.test.cjs +2 -2
  147. package/src/main/__tests__/scheduler-worktree-cap-defer.test.cjs +51 -11
  148. package/src/main/__tests__/scheduler-worktree-exec-cwd.test.cjs +3 -5
  149. package/src/main/__tests__/usageSingleFlight.test.cjs +157 -0
  150. package/src/main/__tests__/workTypeLibrary.test.cjs +1 -1
  151. package/src/main/bilkoHost.cjs +16 -7
  152. package/src/main/build-info.json +8 -0
  153. package/src/main/chatRunner.cjs +12 -7
  154. package/src/main/config.cjs +2 -3
  155. package/src/main/docEdit.cjs +4 -2
  156. package/src/main/health.cjs +268 -52
  157. package/src/main/heapSnapshot.cjs +2 -2
  158. package/src/main/historyAggregator.cjs +6 -1
  159. package/src/main/index.cjs +152 -50
  160. package/src/main/ipcSchemas.cjs +53 -17
  161. package/src/main/lib/__tests__/active-sessions.test.cjs +251 -0
  162. package/src/main/lib/__tests__/auditLog.test.cjs +38 -0
  163. package/src/main/lib/__tests__/bootSelfHeal.test.cjs +107 -0
  164. package/src/main/lib/__tests__/buildIdentity.test.cjs +121 -0
  165. package/src/main/lib/__tests__/cwdClassify.test.cjs +111 -0
  166. package/src/main/lib/__tests__/definitionOfDoneSequence.test.cjs +95 -0
  167. package/src/main/lib/__tests__/delegationReadiness.test.cjs +323 -44
  168. package/src/main/lib/__tests__/dispatchLoop.test.cjs +63 -0
  169. package/src/main/lib/__tests__/effectiveModelInfo.test.cjs +239 -0
  170. package/src/main/lib/__tests__/gateFixtures.json +20 -0
  171. package/src/main/lib/__tests__/gitWorktree.test.cjs +97 -1
  172. package/src/main/lib/__tests__/guardShims.test.cjs +151 -0
  173. package/src/main/lib/__tests__/instanceLock.test.cjs +93 -7
  174. package/src/main/lib/__tests__/jobSupervisorRecord.test.cjs +78 -0
  175. package/src/main/lib/__tests__/jobWorktreeBootLive.test.cjs +11 -0
  176. package/src/main/lib/__tests__/localAdminHttp.test.cjs +1 -1
  177. package/src/main/lib/__tests__/mcpToolCatalog.test.cjs +6 -1
  178. package/src/main/lib/__tests__/opsRootAbsoluteCwd.test.cjs +5 -5
  179. package/src/main/lib/__tests__/prdDisposition.test.cjs +224 -0
  180. package/src/main/lib/__tests__/procIdentity.test.cjs +119 -0
  181. package/src/main/lib/__tests__/procName.test.cjs +92 -0
  182. package/src/main/lib/__tests__/queueStoreMachineStateRecovery.test.cjs +67 -0
  183. package/src/main/lib/__tests__/reaperHelpers.test.cjs +179 -1
  184. package/src/main/lib/__tests__/schedulerMcpServerHelp.test.cjs +6 -7
  185. package/src/main/lib/__tests__/schedulerMcpServerProjectHome.test.cjs +37 -204
  186. package/src/main/lib/__tests__/schedulerPaths.test.cjs +226 -0
  187. package/src/main/lib/__tests__/schedulerPathsWorktree.test.cjs +94 -0
  188. package/src/main/lib/__tests__/schedulerRuntimeState.test.cjs +56 -0
  189. package/src/main/lib/__tests__/sessionSlots.test.cjs +45 -0
  190. package/src/main/lib/__tests__/telemetryBacklog.test.cjs +1 -1
  191. package/src/main/lib/__tests__/upgradeDrain.test.cjs +130 -0
  192. package/src/main/lib/__tests__/usageCircuit.test.cjs +285 -0
  193. package/src/main/lib/__tests__/watchdog-helpers.test.cjs +375 -0
  194. package/src/main/lib/__tests__/watchdog-relaunch.test.cjs +266 -0
  195. package/src/main/lib/activeIndexRebuild.cjs +1 -3
  196. package/{scripts → src/main}/lib/activeSessions.cjs +67 -89
  197. package/src/main/lib/adoptedRunSupervisor.cjs +136 -0
  198. package/src/main/lib/agentModelResolve.cjs +94 -24
  199. package/src/main/lib/agentPersonaSchema.cjs +2 -2
  200. package/src/main/lib/auditLog.cjs +30 -5
  201. package/src/main/lib/bootSelfHeal.cjs +88 -0
  202. package/src/main/lib/buildIdentity.cjs +113 -0
  203. package/src/main/lib/classifyPromptTicket.cjs +3 -2
  204. package/src/main/lib/claudeBin.cjs +37 -2
  205. package/src/main/lib/cleanEnv.cjs +27 -1
  206. package/src/main/lib/credentials.cjs +4 -2
  207. package/src/main/lib/cwdClassify.cjs +185 -0
  208. package/src/main/lib/definitionOfDone.cjs +296 -52
  209. package/src/main/lib/delegationReadiness.cjs +290 -225
  210. package/src/main/lib/dispatchLoop.cjs +40 -0
  211. package/src/main/lib/effectiveModelInfo.cjs +332 -0
  212. package/src/main/lib/ephemeralCwd.cjs +7 -28
  213. package/src/main/lib/epicMint.cjs +3 -3
  214. package/src/main/lib/gitWorktree.cjs +136 -19
  215. package/src/main/lib/guardShims.cjs +156 -0
  216. package/src/main/lib/historyRollup.cjs +6 -7
  217. package/src/main/lib/instanceLock.cjs +32 -5
  218. package/src/main/lib/jobDirtFilter.cjs +7 -2
  219. package/src/main/lib/jobSupervisorRecord.cjs +147 -0
  220. package/src/main/lib/jobWorktreeBootLive.cjs +9 -5
  221. package/src/main/lib/launchFailure.cjs +2 -1
  222. package/src/main/lib/localAdminHttp.cjs +9 -27
  223. package/src/main/lib/mcpToolCatalog.cjs +33 -78
  224. package/src/main/lib/needsReviewLedger.cjs +205 -0
  225. package/src/main/lib/opsErrorLog.cjs +1 -1
  226. package/src/main/lib/opsOwnership.cjs +27 -19
  227. package/src/main/lib/prdAuthoringSeed.cjs +36 -0
  228. package/src/main/lib/prdCreate.cjs +56 -1
  229. package/src/main/lib/prdDisposition.cjs +199 -0
  230. package/src/main/lib/prdFrontmatter.cjs +8 -2
  231. package/src/main/lib/prdLocations.cjs +214 -45
  232. package/src/main/lib/procIdentity.cjs +126 -0
  233. package/src/main/lib/procName.cjs +98 -0
  234. package/src/main/lib/projectHomeAdminRoutes.cjs +56 -327
  235. package/src/main/lib/projectRootResolve.cjs +1 -1
  236. package/src/main/lib/queueHistory.cjs +27 -8
  237. package/src/main/lib/queueStore.cjs +63 -38
  238. package/src/main/lib/quietMachineLease.cjs +19 -2
  239. package/src/main/lib/reaperHelpers.cjs +181 -15
  240. package/src/main/lib/reservationExpiry.cjs +30 -0
  241. package/src/main/lib/runClaudeP.cjs +4 -2
  242. package/src/main/lib/runLogRetention.cjs +3 -2
  243. package/src/main/lib/scheduleJobSchema.cjs +10 -2
  244. package/src/main/lib/scheduleJobTransitions.cjs +60 -0
  245. package/src/main/lib/schedulerBatch.cjs +27 -2
  246. package/src/main/lib/schedulerConfig.cjs +24 -0
  247. package/src/main/lib/schedulerPaths.cjs +175 -0
  248. package/src/main/lib/schedulerRuntimeState.cjs +59 -0
  249. package/src/main/lib/sessionSlots.cjs +47 -9
  250. package/src/main/lib/smProcNames.cjs +51 -0
  251. package/src/main/lib/upgradeDrain.cjs +188 -0
  252. package/src/main/lib/usageCircuit.cjs +206 -0
  253. package/{scripts → src/main}/lib/watchdogHelpers.cjs +71 -38
  254. package/src/main/lib/withTimeout.cjs +33 -0
  255. package/src/main/mcpStatus.cjs +4 -2
  256. package/src/main/pluginInstall.cjs +6 -2
  257. package/src/main/projectPages.cjs +41 -145
  258. package/src/main/pty.cjs +8 -1
  259. package/src/main/queueOps.cjs +10 -10
  260. package/src/main/runVerify.cjs +69 -3
  261. package/src/main/scheduler/prdParser.cjs +13 -0
  262. package/src/main/scheduler.cjs +2841 -482
  263. package/src/main/seedAgentPersonas.cjs +1 -1
  264. package/src/main/seedDevPlugin.cjs +1 -1
  265. package/src/main/seedSchedulerMcp.cjs +7 -6
  266. package/src/main/seedStatus.cjs +1 -1
  267. package/src/main/supervisor.cjs +5 -3
  268. package/src/main/templates/PRD_AUTHORING.md +50 -0
  269. package/src/main/usage.cjs +140 -58
  270. package/src/preload/api.d.ts +110 -65
  271. package/src/preload/index.cjs +12 -4
  272. package/src/seed/agents/project-home-builder.md +31 -48
  273. package/dist/assets/AgentLibrary-DTFL7y8G.js +0 -3
  274. package/dist/assets/MarkdownEditor-DCIubYWf.js +0 -1
  275. package/dist/assets/Permissions-BiYZNGYW.js +0 -3
  276. package/dist/assets/Scheduler-DcLBiJBq.js +0 -14
  277. package/dist/assets/Settings-Cv-pRyms.js +0 -3
  278. package/dist/assets/settingsSchema-BJVciriw.js +0 -3
  279. package/screenshots/.gitkeep +0 -0
  280. package/screenshots/README-screenshots.md +0 -13
  281. package/scripts/project-pages-logic/dist/logic.cjs +0 -4709
  282. package/scripts/render-project-pages/dist/renderer.cjs +0 -18900
  283. package/scripts/render-project-pages.cjs +0 -70
  284. package/scripts/validate-project-pages-summary.cjs +0 -62
  285. package/src/main/lib/projectPageSummarySchema.cjs +0 -181
  286. package/src/main/teams.cjs +0 -95
  287. package/src/main/templates/project-pages-catalog.json +0 -741
  288. package/src/main/templates/project-pages-default-home.html +0 -123
  289. package/src/main/templates/project-pages-pipeline.md +0 -417
  290. package/src/seed/prompts/code-review/ac-coverage-check.md +0 -8
  291. package/src/seed/prompts/code-review/correctness-only.md +0 -8
  292. package/src/seed/prompts/code-review/full-spectrum-high.md +0 -8
  293. package/src/seed/prompts/code-review/hallucination-check.md +0 -8
  294. package/src/seed/prompts/code-review/public-api-compat.md +0 -8
  295. package/src/seed/prompts/code-review/readability-naming.md +0 -8
  296. package/src/seed/prompts/debugging/bug-as-failing-test.md +0 -8
  297. package/src/seed/prompts/debugging/git-bisect-regression.md +0 -8
  298. package/src/seed/prompts/debugging/instrument-intermittent-bug.md +0 -8
  299. package/src/seed/prompts/debugging/localize-pipeline-failure.md +0 -8
  300. package/src/seed/prompts/debugging/reproduce-then-diagnose.md +0 -8
  301. package/src/seed/prompts/documentation/adr-from-change.md +0 -8
  302. package/src/seed/prompts/documentation/module-readme.md +0 -8
  303. package/src/seed/prompts/documentation/onboarding-plan.md +0 -8
  304. package/src/seed/prompts/documentation/refresh-claude-md.md +0 -8
  305. package/src/seed/prompts/documentation/tsdoc-public-exports.md +0 -8
  306. package/src/seed/prompts/git-pr/conventional-commit.md +0 -8
  307. package/src/seed/prompts/git-pr/draft-pr-title-body.md +0 -8
  308. package/src/seed/prompts/git-pr/pre-commit-safety-sweep.md +0 -8
  309. package/src/seed/prompts/git-pr/release-notes-block.md +0 -8
  310. package/src/seed/prompts/git-pr/split-large-pr.md +0 -8
  311. package/src/seed/prompts/performance/bundle-startup-audit.md +0 -8
  312. package/src/seed/prompts/performance/complexity-audit.md +0 -8
  313. package/src/seed/prompts/performance/cpu-profile-hot-path.md +0 -8
  314. package/src/seed/prompts/performance/db-query-plan-review.md +0 -8
  315. package/src/seed/prompts/performance/memory-leak-hunt.md +0 -8
  316. package/src/seed/prompts/qa/api-contract-tests.md +0 -8
  317. package/src/seed/prompts/qa/e2e-critical-path.md +0 -8
  318. package/src/seed/prompts/qa/failing-test-for-bug.md +0 -8
  319. package/src/seed/prompts/qa/find-missing-test-coverage.md +0 -8
  320. package/src/seed/prompts/qa/stabilize-flaky-test.md +0 -8
  321. package/src/seed/prompts/qa/tdd-red-first.md +0 -8
  322. package/src/seed/prompts/qa/visual-regression-review.md +0 -8
  323. package/src/seed/prompts/qa/wcag-axe-scan.md +0 -8
  324. package/src/seed/prompts/refactoring/dead-code-sweep.md +0 -8
  325. package/src/seed/prompts/refactoring/extract-duplicated-pattern.md +0 -8
  326. package/src/seed/prompts/refactoring/modernize-legacy-file.md +0 -8
  327. package/src/seed/prompts/refactoring/reduce-cyclomatic-complexity.md +0 -8
  328. package/src/seed/prompts/refactoring/tighten-module-boundaries.md +0 -8
  329. package/src/seed/prompts/security/authz-audit.md +0 -8
  330. package/src/seed/prompts/security/crypto-correctness.md +0 -8
  331. package/src/seed/prompts/security/cwe-top-25-hunt.md +0 -8
  332. package/src/seed/prompts/security/dependency-audit.md +0 -8
  333. package/src/seed/prompts/security/ipc-boundary-hardening.md +0 -8
  334. package/src/seed/prompts/security/owasp-top-10-staged-diff.md +0 -8
  335. package/src/seed/prompts/security/secret-credential-scan.md +0 -8
@@ -181,7 +181,7 @@ export type BillingFetchResult =
181
181
  | { kind: 'ok-stale'; data: BillingData; staleSince: number; lastError: string }
182
182
  | { kind: 'auth'; message: string; httpStatus: number; expiredAt?: number | null; cached?: BillingData; staleSince?: number }
183
183
  | { kind: 'transient'; message: string; httpStatus: number | null }
184
- | { kind: 'meter_rate_limited'; message: string; httpStatus: number; cached?: BillingData; staleSince?: number }
184
+ | { kind: 'meter_rate_limited'; message: string; httpStatus: number; retryAfterMs?: number | null; cached?: BillingData; staleSince?: number }
185
185
  | { kind: 'config'; message: string };
186
186
 
187
187
  // ── MCP server live connection probe (`claude mcp list`)
@@ -356,22 +356,23 @@ export interface DelegationReadinessCheck {
356
356
  | 'agent-personas'
357
357
  | 'prd-write-guard'
358
358
  | 'destructive-git-guard'
359
- | 'inline-implementation-guard';
359
+ | 'inline-implementation-guard'
360
+ | 'self-schedule-guard';
360
361
  label: string;
361
362
  ok: boolean;
362
363
  detail: string;
363
364
  fix: string | null;
364
365
  /** Non-null when Session Manager can install this fix itself, one press. */
365
- fixAction: 'install-prd-write-guard' | 'install-destructive-git-guard' | 'install-inline-implementation-guard' | null;
366
+ fixAction: 'install-prd-write-guard' | 'install-destructive-git-guard' | 'install-inline-implementation-guard' | 'install-self-schedule-guard' | null;
366
367
  /** True when ok:true is a WARNING (still passing, but worth a human's attention) — today only scheduler-mcp-project-duplicate. */
367
368
  warn?: boolean;
368
369
  /** True when this check didn't run because a precondition (another check) already failed — reported ok:true, not a failure. */
369
370
  skipped?: boolean;
370
371
  }
371
372
 
372
- /** Result of installPrdWriteGuard, installDestructiveGitGuard, and
373
- * installInlineImplementationGuard alike (delegationReadiness.cjs) — the
374
- * three installers share one contract. */
373
+ /** Result of installPrdWriteGuard, installDestructiveGitGuard,
374
+ * installInlineImplementationGuard, and installSelfScheduleGuard alike
375
+ * (delegationReadiness.cjs) — all four installers share one contract. */
375
376
  export interface InstallGuardResult {
376
377
  ok: boolean;
377
378
  action: 'installed' | 'repaired' | 'already-installed' | 'error';
@@ -550,6 +551,11 @@ export interface ScheduleJob {
550
551
  /** Explicit cross-PRD ordering (PRD 832): slugs that must complete before
551
552
  * this job is eligible. Replaces the retired shared-NN-parallel convention. */
552
553
  dependsOn?: string[];
554
+ /** Wave-authoring decision (scheduler wave-disposition PRD): 'append' (this
555
+ * row's dependsOn extends the Epic's existing chain) or 'new-head' (an
556
+ * independent root). Refreshed from the PRD file on every reconcile, like
557
+ * dependsOn above; null when this row never needed the decision. */
558
+ disposition?: 'append' | 'new-head' | null;
553
559
  /** The originating claude session — the Epic's claudeSessionId, resolved
554
560
  * from active-index.json at ingest (PRD 832). An Epic IS a tagged session. */
555
561
  originSessionId?: string | null;
@@ -653,13 +659,6 @@ export interface ScheduleJobStatusHistoryEntry {
653
659
  at: string;
654
660
  }
655
661
 
656
- export interface SchedulePaths {
657
- root: string;
658
- prds: string;
659
- runs: string;
660
- queue: string;
661
- }
662
-
663
662
  export type SchedulePauseReason = 'rate_limit' | 'auth' | 'network' | 'manual' | 'reset_failure';
664
663
 
665
664
  export interface SchedulePauseInfo {
@@ -697,6 +696,13 @@ export interface PrdListItem {
697
696
  sourcePromptId?: string | null;
698
697
  /** Owning Epic id, derived from the PRD's directory. See ScheduleJob.epicId. */
699
698
  epicId?: string | null;
699
+ /** PRD frontmatter `dependsOn` — slugs that must complete before this PRD
700
+ * is eligible. Mirrors ScheduleJob.dependsOn; parsed by parsePrd but
701
+ * previously dropped by listPrdsInternal before reaching this type, the
702
+ * same class of bug this field's sibling comment (epicId) warns about. */
703
+ dependsOn?: string[] | null;
704
+ /** PRD frontmatter `disposition` — see ScheduleJob.disposition. */
705
+ disposition?: 'append' | 'new-head' | null;
700
706
  /** True when this PRD's source .md was found in a `prds-archived/` dir
701
707
  * (its scheduler job already ran to completion) rather than the live
702
708
  * `prds/` dir. Archived PRDs have no matching queue.json job row (the
@@ -824,6 +830,10 @@ export interface ScheduleStateSnapshot {
824
830
  jobs: ScheduleJob[];
825
831
  scheduledFor: string | null;
826
832
  lastRunAt: string | null;
833
+ /** Stamped every time tickQueue reaches the picker at all, whether or not
834
+ * that pass ends in a launch — distinct from lastRunAt (only stamped on an
835
+ * actual launch). See classifyQueueHealth's header comment. */
836
+ lastDispatchAttemptAt?: string | null;
827
837
  nextReset: string | null;
828
838
  /** Set when scheduler self-paused (rate-limit detected). null when running normally. */
829
839
  paused: SchedulePauseInfo | null;
@@ -842,8 +852,6 @@ export interface ScheduleStateSnapshot {
842
852
  * is saturated. Null before the first tick that evaluated it.
843
853
  */
844
854
  loadGate?: ScheduleLoadGate | null;
845
- /** Returned only by the initial state() call, not the broadcast event. */
846
- paths?: SchedulePaths;
847
855
  }
848
856
 
849
857
  export interface ScheduleLoadGate {
@@ -862,6 +870,48 @@ export interface ScheduleLoadGate {
862
870
  at: string;
863
871
  }
864
872
 
873
+ /** One dependency-chain group blocked on a terminal (failed/skipped) row — computeBlockedChains' shape. */
874
+ export interface ScheduleBlockedChain {
875
+ cwd: string;
876
+ blockedBy: string[];
877
+ blocked: number;
878
+ }
879
+
880
+ /** classifyQueueHealth's verdict — the one honest cause behind a stale-looking queue. */
881
+ export interface ScheduleQueueHealthVerdict {
882
+ kind: 'paused' | 'launch-blocked' | 'idle' | 'saturated' | 'blocked' | 'stalled' | 'running';
883
+ cwd: string | null;
884
+ pending: number;
885
+ needsReviewCount: number;
886
+ runningCount: number;
887
+ /** Pending rows whose dependsOn chain is fully satisfied right now — always computed, regardless of kind. */
888
+ dispatchable: number;
889
+ blockedChains: ScheduleBlockedChain[];
890
+ /** Present on 'blocked' / 'stalled' — ms since lastDispatchAttemptAt. */
891
+ idleMs?: number;
892
+ /** Present on 'paused'. */
893
+ reason?: string | null;
894
+ /** Present on 'launch-blocked'. */
895
+ agentType?: string;
896
+ block?: ScheduleLaunchBlock;
897
+ /** Present on 'saturated'. */
898
+ totalSlots?: number | null;
899
+ }
900
+
901
+ export interface ScheduleQueueHealthResult {
902
+ /** True when queue.json was unreadable — every other field is absent; render "unknown", never a zero. */
903
+ unknown: boolean;
904
+ reason?: string;
905
+ now?: number;
906
+ verdict?: ScheduleQueueHealthVerdict;
907
+ /** Machine-wide session slot pool — not scoped to the requested cwd. */
908
+ slots?: { inUse: number; total: number; free: number; source: 'env' | 'pool' };
909
+ /** Oldest currently-running job's age in ms, across every project. null when nothing is running. */
910
+ oldestRunningAgeMs?: number | null;
911
+ lastRunAt?: string | null;
912
+ lastDispatchAttemptAt?: string | null;
913
+ }
914
+
865
915
  export interface HistoryAggregateRequest {
866
916
  fromDate?: string;
867
917
  toDate?: string;
@@ -1023,26 +1073,6 @@ export interface WatcherClosedEvent {
1023
1073
  watcherId: string;
1024
1074
  }
1025
1075
 
1026
- export interface TeamMember {
1027
- name: string;
1028
- agentType: string | null;
1029
- model: string | null;
1030
- }
1031
-
1032
- export interface TeamInfo {
1033
- name: string;
1034
- configPath: string;
1035
- description: string | null;
1036
- leadAgentId: string | null;
1037
- members: TeamMember[];
1038
- memberCount: number;
1039
- inboxDepth: number;
1040
- }
1041
-
1042
- export interface TeamsListResult {
1043
- teams: TeamInfo[];
1044
- }
1045
-
1046
1076
  // ────────────────────────────────────────────── Bundle D — queue ops
1047
1077
 
1048
1078
  export interface LintFinding {
@@ -1239,29 +1269,12 @@ export type ProjectBriefUpdateResult =
1239
1269
  | { ok: true; brief: ProjectBrief }
1240
1270
  | { ok: false; error: string };
1241
1271
 
1242
- // ────────────────────────────────────────────── Project Pages (PRD 929-932, 969, project-home-hosted-html-spec)
1243
- export interface ProjectPagesOutput {
1244
- home: string;
1245
- /** Absent when `isDefault` is true — the shipped default only covers the home lens. */
1246
- marketing?: string;
1247
- /** Absent when `isDefault` is true — the shipped default only covers the home lens. */
1248
- feature?: string;
1249
- /** Absent when `isDefault` is true — the shipped default only covers the home lens. */
1250
- architecture?: string;
1251
- /** Absent for output generated before the 'brief' lens existed (PRD 969), or
1252
- * when `isDefault` is true — a project must regenerate to pick it up. */
1253
- brief?: string;
1254
- /** null for the shipped default (never generated). */
1255
- generatedAt: string | null;
1256
- /** True when `home` is the build-time shipped default, not this project's own
1257
- * generated output — the renderer must label provenance rather than infer it. */
1258
- isDefault: boolean;
1259
- }
1260
-
1272
+ // ────────────────────────────────────────────── Project Pages (single home.html)
1261
1273
  export interface ProjectPagesGetResult {
1262
- /** Never null in practice — a project with no generated output still gets the
1263
- * shipped default (isDefault: true). The type stays nullable defensively. */
1264
- output: ProjectPagesOutput | null;
1274
+ /** Contents of session-manager-operations/project-pages/home.html, or null when it has not been generated. */
1275
+ html: string | null;
1276
+ /** home.html's mtime, or null when `html` is null. */
1277
+ mtimeMs: number | null;
1265
1278
  }
1266
1279
 
1267
1280
  // ────────────────────────────────────────────── Host on Bilko.run
@@ -1535,7 +1548,8 @@ export interface SessionManagerAPI {
1535
1548
  gitBranch: (cwd: string) => Promise<string | null>;
1536
1549
  /** Publish target for 'build'-tagged Epics — null disables the Build toolbar button. */
1537
1550
  resolveBuildTarget: (cwd: string) => Promise<BuildTarget | null>;
1538
- rebootApp: () => void;
1551
+ /** Default: request a drain-first restart. `force: true` restarts immediately, killing running jobs. */
1552
+ rebootApp: (opts?: { force?: boolean }) => void;
1539
1553
  testFireHook: (args: TestFireHookArgs) => Promise<TestFireHookResult>;
1540
1554
  /** F7 — true under SM_E2E=1; renderer uses this to suppress wizard auto-trigger. */
1541
1555
  isE2E: () => Promise<boolean>;
@@ -1557,6 +1571,7 @@ export interface SessionManagerAPI {
1557
1571
  installPrdWriteGuard: (cwd: string) => Promise<InstallGuardResult>;
1558
1572
  installDestructiveGitGuard: (cwd: string) => Promise<InstallGuardResult>;
1559
1573
  installInlineImplementationGuard: (cwd: string) => Promise<InstallGuardResult>;
1574
+ installSelfScheduleGuard: (cwd: string) => Promise<InstallGuardResult>;
1560
1575
  onNewSession: (handler: () => void) => () => void;
1561
1576
  onRebootSession: (handler: () => void) => () => void;
1562
1577
  archiveProject: (encoded: string) => Promise<{ ok: boolean; error?: string }>;
@@ -1621,6 +1636,28 @@ export interface SessionManagerAPI {
1621
1636
  * `listPersonas` above, which only reads the global directory. Null when neither
1622
1637
  * location has the file. */
1623
1638
  getPersonaBody: (payload: { cwd: string; name: string }) => Promise<{ path: string; text: string } | null>;
1639
+ /** "What will this Epic actually run as?" — persona alias, overlay-aware
1640
+ * provenance, and evidence-based concrete model id (scheduler run log or
1641
+ * session transcript). Never throws on the main side; a dangling
1642
+ * agentType or missing evidence degrades individual fields to null. Pair
1643
+ * with the renderer's `useEffectiveSettings.ts` scope-chain reader for
1644
+ * the effortLevel/effortSource half — this call only covers the parts
1645
+ * that need main-process filesystem access. */
1646
+ resolveModelInfo: (payload: { cwd: string; agentType: string }) => Promise<{
1647
+ agentType: string;
1648
+ modelAlias: string | null;
1649
+ modelSource: 'persona' | 'persona-overlay' | 'inherit' | 'fallback';
1650
+ resolvedModelId: string | null;
1651
+ resolvedFrom: 'scheduler-run' | 'transcript' | null;
1652
+ effortReachable: boolean;
1653
+ }>;
1654
+ /** The launch-time authority for an Epic-backed session's `--model`: the SAME
1655
+ * resolver (`agentModelResolve.cjs`'s `resolveEpicModel`) chatRunner.cjs's Chat
1656
+ * path calls in-process, reached here so Terminal (`EpicTerminalPane.tsx`, no
1657
+ * fs access) agrees with Chat by calling the identical function. Overlay-aware
1658
+ * (project `.claude/agents/<name>.md` wins over global), never throws — a
1659
+ * dangling agentType or absent/`inherit` model falls back to `'sonnet'`. */
1660
+ resolveEpicModel: (payload: { cwd: string; claudeSessionId: string }) => Promise<string>;
1624
1661
  /** Fires after any save/delete/removeOverride — subscribers should re-fetch listPersonas(). */
1625
1662
  onChanged: (handler: () => void) => () => void;
1626
1663
  };
@@ -1752,6 +1789,7 @@ export interface SessionManagerAPI {
1752
1789
  resetJob: (slug: string) => Promise<{ ok: boolean; error?: string }>;
1753
1790
  runNow: () => Promise<{ ok: boolean }>;
1754
1791
  forceTick: () => Promise<ActionOutcome>;
1792
+ pause: () => Promise<{ ok: boolean }>;
1755
1793
  resume: () => Promise<{ ok: boolean }>;
1756
1794
  /** Re-scan prds/ and merge into queue.json; broadcasts updated state. */
1757
1795
  rescan: () => Promise<ActionOutcome>;
@@ -1764,6 +1802,10 @@ export interface SessionManagerAPI {
1764
1802
  writePrd: (slug: string, body: string) => Promise<{ ok: true; bytesWritten: number } | { ok: false; error: string }>;
1765
1803
  listPrds: () => Promise<PrdListItem[]>;
1766
1804
  health: () => Promise<ScheduleHealthSnapshot>;
1805
+ /** Queue-health header verdict — reuses classifyQueueHealth so this can
1806
+ * never disagree with the starvation watchdog. `cwd` null/omitted =
1807
+ * machine-wide scope. */
1808
+ queueHealth: (cwd?: string | null) => Promise<ScheduleQueueHealthResult>;
1767
1809
  onState: (handler: (snapshot: ScheduleStateSnapshot) => void) => () => void;
1768
1810
  /** Heartbeat-driven stall alert: queue holds jobs but 0 running / 0 pending / not paused for a full poll interval. Fires at most once per stall episode. */
1769
1811
  onStall: (handler: (event: ScheduleStallEvent) => void) => () => void;
@@ -1775,6 +1817,13 @@ export interface SessionManagerAPI {
1775
1817
  retagPrds: (items: RetagPrdItem[]) => Promise<RetagPrdResult>;
1776
1818
  /** Stamps a 'quarantined' PRD (no createdVia provenance) as legacy-adopted via the update-prd API, then reconciles it to 'pending'. */
1777
1819
  adoptPrd: (slug: string) => Promise<ActionOutcome>;
1820
+ /** Change a PRD's wave disposition (promote to a new head, or attach behind another chain's terminal PRD(s)) — refuses a running/completed row or a dependsOn cycle. */
1821
+ setPrdDisposition: (args: {
1822
+ slug: string;
1823
+ cwd?: string;
1824
+ disposition: 'append' | 'new-head';
1825
+ dependsOn?: string[];
1826
+ }) => Promise<ActionOutcome>;
1778
1827
  /** Return the last N completed/failed jobs from queue.json (newest first). */
1779
1828
  getHistory: (limit?: number) => Promise<ScheduleHistoryResult>;
1780
1829
  };
@@ -1784,10 +1833,6 @@ export interface SessionManagerAPI {
1784
1833
  /** Return last 50 supervisor log entries, descending by ts. */
1785
1834
  getLog: () => Promise<SupervisorLogEntry[]>;
1786
1835
  };
1787
- teams: {
1788
- /** Enumerate ~/.claude/teams/<name>/config.json + inbox depths. */
1789
- list: () => Promise<TeamsListResult>;
1790
- };
1791
1836
  plugins: {
1792
1837
  /** Run `claude plugin install <slug>` in a hidden pty. Streams output
1793
1838
  * via `onInstallProgress`. Returns { ok, exitCode } on exit.
@@ -1845,14 +1890,14 @@ export interface SessionManagerAPI {
1845
1890
  update: (cwd: string, patch: ProjectBriefPatch) => Promise<ProjectBriefUpdateResult>;
1846
1891
  };
1847
1892
  projectPages: {
1848
- /** Read output/*.html + manifest.json (or `{output: null}` if none exist yet). Never fires an LLM call. */
1893
+ /** Read project-pages/home.html (`{html: null, mtimeMs: null}` if it does not exist yet). Never fires an LLM call. */
1849
1894
  get: (cwd: string) => Promise<ProjectPagesGetResult>;
1850
1895
  /** Start pushing `onChanged` events for this cwd's output dir. Refcounted per cwd; `ok:false` (reason 'ephemeral'|'invalid-cwd') means no live updates are possible, not an error. */
1851
1896
  watch: (cwd: string) => Promise<{ ok: boolean; reason?: 'ephemeral' | 'invalid-cwd' }>;
1852
1897
  /** Stop pushing `onChanged` events for this cwd — must be paired 1:1 with a prior `watch` call. */
1853
1898
  unwatch: (cwd: string) => Promise<{ ok: boolean }>;
1854
- /** Fires whenever a watched cwd's project-pages output dir changes, carrying the freshly recomputed output. */
1855
- onChanged: (handler: (payload: { cwd: string; output: ProjectPagesOutput | null }) => void) => () => void;
1899
+ /** Fires whenever a watched cwd's home.html is added/changed/removed, carrying the freshly read result. */
1900
+ onChanged: (handler: (payload: { cwd: string } & ProjectPagesGetResult) => void) => () => void;
1856
1901
  };
1857
1902
  bilkoHost: {
1858
1903
  /** Read compatibility-gate inputs + any existing bundle/publish state. Never fires an LLM call. */
@@ -9,7 +9,7 @@ contextBridge.exposeInMainWorld('api', {
9
9
  pickDirectory: () => ipcRenderer.invoke('app:pick-directory'),
10
10
  gitBranch: (cwd) => ipcRenderer.invoke('app:git-branch', { cwd }),
11
11
  resolveBuildTarget: (cwd) => ipcRenderer.invoke('build:resolve-target', { cwd }),
12
- rebootApp: () => ipcRenderer.send('app:reboot-app'),
12
+ rebootApp: (opts) => ipcRenderer.send('app:reboot-app', opts),
13
13
  archiveProject: (encoded) => ipcRenderer.invoke('app:archive-project', { encoded }),
14
14
  testFireHook: (args) => ipcRenderer.invoke('app:test-fire-hook', args),
15
15
  // F7: lets the renderer suppress the wizard auto-trigger under SM_E2E=1.
@@ -105,6 +105,8 @@ contextBridge.exposeInMainWorld('api', {
105
105
  deletePersona: (payload) => ipcRenderer.invoke('agents:delete-persona', payload),
106
106
  removeOverride: (payload) => ipcRenderer.invoke('agents:remove-override', payload),
107
107
  getPersonaBody: (payload) => ipcRenderer.invoke('agents:get-persona-body', payload),
108
+ resolveModelInfo: (payload) => ipcRenderer.invoke('agents:resolve-model-info', payload),
109
+ resolveEpicModel: (payload) => ipcRenderer.invoke('agents:resolve-epic-model', payload),
108
110
  // Fired after any save/delete/removeOverride so every mounted
109
111
  // subscriber (Agent Library, Tag Library) re-fetches the same file.
110
112
  onChanged: (handler) => {
@@ -234,6 +236,7 @@ contextBridge.exposeInMainWorld('api', {
234
236
  resetJob: (slug) => ipcRenderer.invoke('schedule:reset-job', { slug }),
235
237
  runNow: () => ipcRenderer.invoke('schedule:run-now'),
236
238
  forceTick: () => ipcRenderer.invoke('schedule:force-tick'),
239
+ pause: () => ipcRenderer.invoke('schedule:pause'),
237
240
  resume: () => ipcRenderer.invoke('schedule:resume'),
238
241
  rescan: () => ipcRenderer.invoke('schedule:rescan'),
239
242
  clearQueue: () => ipcRenderer.invoke('schedule:clear-queue'),
@@ -243,6 +246,10 @@ contextBridge.exposeInMainWorld('api', {
243
246
  writePrd: (slug, body) => ipcRenderer.invoke('schedule:write-prd', { slug, body }),
244
247
  listPrds: () => ipcRenderer.invoke('schedule:list-prds'),
245
248
  health: () => ipcRenderer.invoke('schedule:health'),
249
+ // Queue-health header: one honest verdict for "why does the queue look
250
+ // stale" (saturated/blocked/idle/stalled/paused/launch-blocked), scoped
251
+ // to `cwd` (null = machine-wide).
252
+ queueHealth: (cwd) => ipcRenderer.invoke('schedule:queue-health', cwd ? { cwd } : {}),
246
253
  onState: (handler) => {
247
254
  const listener = (_e, payload) => handler(payload);
248
255
  ipcRenderer.on('schedule:state', listener);
@@ -264,6 +271,10 @@ contextBridge.exposeInMainWorld('api', {
264
271
  // the same update-prd API path the admin route/MCP tool use, then
265
272
  // reconciles so the row promotes to 'pending' on the very same call.
266
273
  adoptPrd: (slug) => ipcRenderer.invoke('schedule:adopt-prd', { slug }),
274
+ // Change a PRD's wave disposition (promote to a new head, or attach
275
+ // behind another chain's terminal PRD(s)) — see scheduler.cjs's
276
+ // remote.setPrdDisposition for the safety validation this goes through.
277
+ setPrdDisposition: (args) => ipcRenderer.invoke('schedule:set-prd-disposition', args),
267
278
  // History — last N completed/failed jobs from queue.json.
268
279
  getHistory: (limit) => ipcRenderer.invoke('schedule:get-history', limit !== undefined ? { limit } : {}),
269
280
  },
@@ -271,9 +282,6 @@ contextBridge.exposeInMainWorld('api', {
271
282
  tickNow: () => ipcRenderer.invoke('supervisor:tick-now'),
272
283
  getLog: () => ipcRenderer.invoke('supervisor:get-log'),
273
284
  },
274
- teams: {
275
- list: () => ipcRenderer.invoke('teams:list'),
276
- },
277
285
  plugins: {
278
286
  install: (payload) => ipcRenderer.invoke('plugins:install', payload),
279
287
  abort: (slug) => ipcRenderer.invoke('plugins:abort', slug),
@@ -1,59 +1,42 @@
1
1
  ---
2
2
  name: project-home-builder
3
- description: Generates a project's 5 static Project Page HTML files (Home / Marketing Landing / Feature Description / Architecture Overview / Brief) by following the session-manager app's own MCP contract for the pipeline — portable to any machine with the app installed, no source-repo paths required.
3
+ description: Reads a project and writes ONE self-contained overview page (home.html) for its Project Home tab, then saves it with a single project_home_write call.
4
4
  tools: Read, Grep, Glob, Bash, Write, Edit
5
- title: Project Pages — Builder
5
+ title: Project Home — Builder
6
6
  ---
7
7
 
8
- You are the project-home-builder. Your whole job is to generate a project's Project Home pages by
9
- following the exact protocol the session-manager app hands you over MCP — never by re-deriving the
10
- pipeline from a repo you may not have, and never by inventing content.
11
-
12
- ## Ground on the live contract, every run
13
-
14
- 1. Call `project_home_get_contract` FIRST, before composing or reading anything else. It returns
15
- everything you need: the operating protocol, the `ProjectPageSummary`/`ProjectPagePicks` JSON
16
- schemas, the full component catalog for every lens (which slots exist, which variants are
17
- available per slot, and each variant's own selection notes), the exact output paths, and the
18
- full pipeline spec text.
19
- 2. Follow the protocol the contract response describes. It is the single source of truth for this
20
- run — do not fall back to a remembered or assumed version of the pipeline shape.
21
- 3. If `project_home_get_contract` is unavailable, errors, or the MCP tools it depends on
22
- (`project_home_validate_summary`, `project_home_render`, `project_home_status`) are not present
23
- in this session's toolset: **report that plainly and stop.** Do not attempt to build, script, or
24
- hand-roll any part of the pipeline yourself, and do not treat the missing contract as a coding
25
- task for this Epic. The pipeline is owned by the session-manager app, not by the target project.
8
+ You are the project-home-builder. Your whole job is to read the real project and produce a single
9
+ self-contained HTML overview page, then hand it to the app with one `project_home_write` call.
10
+
11
+ ## What the page is
12
+
13
+ One overview page for a person opening this project for the first time. It covers:
14
+
15
+ - **What it is** — a one- or two-sentence description of the project.
16
+ - **Who it's for** — the audience or user the project serves.
17
+ - **Structure** — the main directories/modules and what each one does.
18
+ - **How to run it** — the real install / build / start steps.
19
+ - **Key commands** — the commands a contributor actually uses (test, lint, build, etc.).
26
20
 
27
21
  ## Hard rules
28
22
 
29
- - **Never fabricate.** Every field of the summary you author must trace to something concrete about
30
- the real project: an Epic goal, a source file/dir, a documented convention, a git log entry, or an
31
- existing project brief. An omitted field beats an invented one, every time — no invented stats, no
32
- invented testimonials/quotes, no invented screenshots.
33
- - **Author the summary from real evidence.** Read the target project itself (its repo tree, its git
34
- history, its own docs/brief, its active Epics) to build the `ProjectPageSummary` the contract's
35
- schema describes — the contract gives you the shape, not the content.
36
- - **Validate before you render.** Call `project_home_validate_summary` with your composed summary
37
- and fix every returned `{field, message}` error, re-validating until it reports `valid: true`.
38
- Don't skip straight to rendering an unvalidated summary.
39
- - **Choose picks from the returned catalog only.** For every lens/slot the contract's catalog lists,
40
- pick the one variant that genuinely fits this project's summary content, using the catalog's own
41
- per-variant notes — never a variant name you assumed instead of one the catalog actually offered.
42
- - **Respect existing picks on a regenerate.** If the project already has picks for a slot, keep them
43
- unless this run was explicitly asked to start over — same spirit as any other pinned-content
44
- regenerate.
45
- - **Cost-gated, manual only.** This is a real-cost pass. Run it once per explicit "Generate" /
46
- "Regenerate" request — never automatically, never in a loop.
23
+ - **Never fabricate.** Every claim must trace to something you read in the project: its README,
24
+ manifest (`package.json`, `pyproject.toml`, ...), source tree, docs, or git history. An omitted
25
+ section beats an invented one — no invented stats, quotes, screenshots, or features.
26
+ - **Read before you write.** Explore the repo itself (tree, manifest, docs, recent git log) first.
27
+ - **Self-contained HTML only.** One complete HTML document with all CSS inline in a `<style>` block.
28
+ No `<script src>`, no `<link href="http...">`, no `@import`, no `url(http...)`, no external fonts
29
+ or images. Keep it under 1 MB. Support both light and dark color schemes.
30
+ - **Cost-gated, manual only.** Run once per explicit "Generate" / "Regenerate" request — never
31
+ automatically, never in a loop.
47
32
 
48
33
  ## Protocol
49
34
 
50
- 1. `project_home_get_contract` — read its protocol, schemas, and catalog before anything else.
51
- 2. Gather real evidence about the target project and compose a `ProjectPageSummary` matching the
52
- contract's schema.
53
- 3. `project_home_validate_summary` with that summary — fix and repeat until `valid: true`.
54
- 4. Choose one variant per lens/slot from the contract's catalog, forming a `ProjectPagePicks` object
55
- in the shape the contract specifies.
56
- 5. `project_home_render` with the validated summary and the picks — this is the only write path;
57
- it re-validates server-side and writes nothing on schema failure.
58
- 6. `project_home_status` — confirm the expected files now exist with a fresh `generatedAt`, and
59
- report what was generated.
35
+ 1. Read the project: manifest, README/docs, directory structure, key scripts, recent commits.
36
+ 2. Compose the single HTML document described above.
37
+ 3. Call `project_home_write` exactly once with `{ html }`. It validates the document and writes it as
38
+ the project's Project Home page.
39
+ 4. If the tool rejects the HTML, fix the reported problem and call it again; if
40
+ `project_home_write` is unavailable in this session, report that plainly and stop — do not build
41
+ any tooling in the target project as a workaround.
42
+ 5. Report in one or two lines what the page covers.
@@ -1,3 +0,0 @@
1
- import{a9 as e,z as V,ai as m,j as z,b as D,as as b,ap as X,T as _,ar as Z,az as ee,A as T}from"./index-CXFQIPhO.js";import{P as te}from"./Panel-Cj2kw-Zv.js";import{L as ne}from"./ListDetail-DYUZN-x-.js";import"./monaco-editor-BW5C4Iv1.js";function y({children:t,onClick:r,disabled:x,variant:g="default",tooltip:i,type:f="button",className:u}){const v=`px-2 py-0.5 text-xs rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${g==="primary"?"text-accent border-accent/50 hover:bg-bg-hi":g==="danger"?"text-red-400 hover:text-red-300 border-line hover:border-red-400/50":"text-fg-dim border-line hover:text-fg hover:bg-bg-hi"} ${u??""}`,a=e.jsx("button",{type:f,title:i,onClick:r,disabled:x,className:v,children:t});return i?e.jsx(V,{content:i,align:"bottom-center",children:a}):a}const ae=["inherit","haiku","sonnet","opus"],B=["Read","Grep","Glob","Bash","Write","Edit","WebFetch","WebSearch","Task"],se=["","red","orange","yellow","green","cyan","blue","purple","pink"],G={red:"#c0392b",orange:"#b85c34",yellow:"#c9a227",green:"#6f7d52",cyan:"#3f8f8a",blue:"#4a6fa5",purple:"#7a6a8a",pink:"#b45a80"};function R(t){return{name:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:t.tags,projects:t.projects??[],action:t.action??"",actionLabel:t.actionLabel??"",body:t.body}}const I={name:"new-agent",description:"",tools:["Read","Grep"],model:"inherit",color:"",tags:[],projects:[],action:"",actionLabel:"",body:""},re=new Set(_.map(t=>t.tag));function oe(t){return t.filter(r=>re.has(r))}function ie(){const[t,r]=m.useState(null),[x,g]=m.useState(null),[i,f]=m.useState(""),[u,c]=m.useState(null),[v,a]=m.useState(!1),[j,N]=m.useState(!1),[O,C]=m.useState(null),[k,s]=m.useState(!1),w=m.useRef(!0);m.useEffect(()=>()=>{w.current=!1},[]);const p=async n=>{try{const d=await window.api.agents.listPersonas();if(!w.current)return;r(d),g(L=>{var P;return n??L??((P=d[0])==null?void 0:P.name)??null})}catch(d){if(!w.current)return;r([]),b.error(d.message||"failed to load agent personas")}};if(m.useEffect(()=>{p()},[]),m.useEffect(()=>window.api.agents.onChanged(()=>p()),[]),m.useEffect(()=>{const n=X();n&&g(n);const d=L=>g(L.detail);return window.addEventListener("sm:select-persona",d),()=>window.removeEventListener("sm:select-persona",d)},[]),t===null)return e.jsx(z,{title:"loading…"});const $=i.toLowerCase(),E=t.filter(n=>!$||n.name.toLowerCase().includes($)||(n.description??"").toLowerCase().includes($)),l=t.find(n=>n.name===x)??t[0]??null,o=u??(l?R(l):null),F=!!u&&!!l&&JSON.stringify(u)!==JSON.stringify(R(l)),S=v,K=n=>{c(null),a(!1),N(!1),C(null),g(n)},W=n=>c(d=>({...d??(l?R(l):I),...n})),M=()=>{c({...I}),a(!0),N(!1)},J=()=>{o&&(c({...o,name:o.name+"-copy"}),a(!0))},H=()=>{c(null),a(!1)},Y=async()=>{if(o){if(!/^[a-z][a-z0-9-]*$/.test(o.name)){b.error('agent name must be lowercase, hyphenated (e.g. "my-agent")');return}s(!0);try{const n={name:o.name,originalName:S||l==null?void 0:l.name,description:o.description,tools:o.tools,model:o.model,color:o.color,tags:oe(o.tags),projects:o.projects,action:o.action,actionLabel:o.actionLabel,body:o.body};await window.api.agents.savePersona(n),b.info(S?`created ${o.name}`:`saved ${o.name}`),c(null),a(!1),await p(o.name)}catch(n){b.error(n.message||"failed to save agent persona")}finally{s(!1)}}},q=async()=>{if(l){s(!0);try{await window.api.agents.deletePersona({name:l.name}),b.info(`deleted ${l.name}`),N(!1),c(null),a(!1),await p()}catch(n){b.error(n.message||"failed to delete agent persona")}finally{s(!1)}}},Q=async n=>{s(!0);try{await window.api.agents.deletePersona({name:n}),b.info(`deleted ${n}`),C(null),x===n&&(c(null),a(!1)),await p()}catch(d){b.error(d.message||"failed to delete agent persona")}finally{s(!1)}},U=async n=>{if(l)try{await window.api.agents.removeOverride({name:l.name,projectName:n}),b.info(`removed ${n}'s override of ${l.name}`),await p(l.name)}catch(d){b.error(d.message||"failed to remove override")}};return e.jsx(te,{toolbar:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-faint",children:[t.length," persona",t.length===1?"":"s"]}),e.jsx("input",{value:i,onChange:n=>f(n.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-40"}),e.jsx("div",{className:"flex-1"}),e.jsx(y,{variant:"primary",onClick:M,children:"+ New agent"})]}),children:e.jsx(ne,{sidebar:e.jsxs("div",{className:"py-1",children:[S&&e.jsx("div",{className:"w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 bg-bg-hi text-fg border-l-2 border-accent",children:e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsx("span",{className:"truncate font-mono",children:o==null?void 0:o.name}),e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-accent",children:"new"})]})}),E.length===0&&!S?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agent personas found"}):E.map(n=>{const d=!S&&n.name===x,L=d&&F,P=O===n.name;return e.jsxs("div",{"data-agent-row":n.name,className:`group w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 border-l-2 cursor-pointer ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,onClick:()=>K(n.name),children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:n.color?G[n.color]??n.color:"var(--fg-faint, #999)",opacity:n.color?1:.35}}),e.jsx("span",{className:"truncate font-mono",children:n.name})]}),e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5",children:[L&&e.jsx("span",{className:"text-[10px] font-semibold text-accent",children:"unsaved"}),!L&&n.overridingProjects.length>0&&e.jsxs(D,{tone:"dim",children:[n.overridingProjects.length," override",n.overridingProjects.length>1?"s":""]}),P?e.jsxs("span",{className:"flex items-center gap-1",onClick:A=>A.stopPropagation(),children:[e.jsx("button",{onClick:()=>Q(n.name),disabled:k,title:`Delete ${n.name}`,className:"text-[10px] font-semibold text-red-400 hover:text-red-300",children:"confirm"}),e.jsx("button",{onClick:()=>C(null),title:"Cancel",className:"text-[10px] text-fg-faint hover:text-fg",children:"cancel"})]}):e.jsx("button",{onClick:A=>{A.stopPropagation(),C(n.name)},title:`Delete ${n.name}`,className:"opacity-0 group-hover:opacity-100 text-fg-faint hover:text-red-400 transition-opacity",children:"×"})]})]}),n.description&&e.jsx("span",{className:"truncate text-fg-faint",children:n.description})]},n.name)})]}),detail:o?e.jsx(le,{obj:o,set:W,saved:l,dirty:F,isNew:S,busy:k,confirmDelete:j,setConfirmDelete:N,onDuplicate:J,onRevert:H,onSave:Y,onDelete:q,onDropOverride:U}):e.jsx(z,{title:"select an agent"})})})}const pe=m.memo(ie);function le({obj:t,set:r,saved:x,dirty:g,isNew:i,busy:f,confirmDelete:u,setConfirmDelete:c,onDuplicate:v,onRevert:a,onSave:j,onDelete:N,onDropOverride:O}){const C=`~/.claude/agents/${t.name}.md`,k=g||i;return e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-line flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-fg font-mono",children:t.name}),i?e.jsx(D,{tone:"accent",children:"unsaved draft"}):g?e.jsx(D,{tone:"warn",children:"edited"}):e.jsx(D,{tone:"good",children:"saved"}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:C})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx(h,{label:"name",hint:"Filename on disk — lowercase, hyphenated.",children:e.jsx("input",{value:t.name,onChange:s=>r({name:s.target.value.toLowerCase()}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})}),e.jsx(h,{label:"description",hint:"Shown in the list and in agent pickers.",children:e.jsx("input",{value:t.description,onChange:s=>r({description:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(h,{label:"default model",hint:"This persona's default model for its Epics — sets the --model an Epic launches with (Terminal + Chat both honor it). 'inherit' falls back to each view's own default, not this Settings page. Cheap models for read-only personas; opus for judgement calls.",children:e.jsx(de,{options:ae,value:t.model,onChange:s=>r({model:s}),mono:!0})}),e.jsx(h,{label:"tools",hint:`${t.tools.length} of ${B.length} granted. Anything not ticked is refused at call time.`,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:B.map(s=>{const w=t.tools.includes(s);return e.jsx("button",{onClick:()=>r({tools:w?t.tools.filter(p=>p!==s):[...t.tools,s]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"}`,children:s},s)})})}),e.jsx(h,{label:"color",children:e.jsx("div",{className:"flex gap-1.5",children:se.map(s=>e.jsx("button",{title:s||"none",onClick:()=>r({color:s}),className:"w-5 h-5 rounded",style:{background:s?G[s]:"transparent",border:t.color===s?"2px solid var(--accent, #b85c34)":"1px solid var(--line, #555)"}},s||"none"))})}),e.jsx(h,{label:"tags",hint:"Session mission tags this persona is associated with — shown as the default agent on that tag's own page. The first one (in Tag Library order) is the MISSION an Action button's session opens with.",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.map(s=>{const w=t.tags.includes(s.tag),p=Z(s.tag);return e.jsxs("button",{onClick:()=>r({tags:w?t.tags.filter($=>$!==s.tag):[...t.tags,s.tag]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?`${p.bg} ${p.text} ${p.border?"border-current/30":"border-transparent"}`:"bg-bg-hi text-fg-faint border-line"}`,children:["#",s.tag]},s.tag)})})}),e.jsx(ce,{obj:t,set:r}),e.jsx(h,{label:"definition",hint:"The system prompt this persona runs under.",children:e.jsx("textarea",{rows:9,value:t.body,onChange:s=>r({body:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})}),e.jsx(h,{label:"project overrides",hint:"Open projects that shadow this definition with a local copy.",children:x&&x.overridingProjects.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:x.overridingProjects.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s,e.jsx("button",{onClick:()=>O(s),title:"Drop the local copy",className:"text-fg-faint hover:text-fg",children:"×"})]},s))}):e.jsx("div",{className:"text-xs text-fg-faint italic",children:i?"save first to see project overrides.":"no open project overlays this agent — the global definition applies everywhere."})})]}),e.jsx("div",{className:"px-4 py-2.5 border-t border-line flex items-center gap-2 flex-wrap",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-fg-dim",children:["Delete ",e.jsx("strong",{className:"font-mono",children:t.name})," and its file?"]}),e.jsx(y,{variant:"danger",onClick:N,disabled:f,children:"Delete"}),e.jsx(y,{onClick:()=>c(!1),children:"Keep"})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{onClick:v,disabled:f,children:"Duplicate"}),!i&&e.jsx(y,{variant:"danger",onClick:()=>c(!0),disabled:f,children:"Delete"}),e.jsx("div",{className:"flex-1"}),k&&e.jsx("span",{className:"text-[11px] text-fg-faint",children:"unsaved changes"}),e.jsx(y,{onClick:a,disabled:!k||f,children:"Revert"}),e.jsx(y,{variant:"primary",onClick:j,disabled:!k||f,children:f?"Saving…":i?"Create":"Save"})]})})]})}function ce({obj:t,set:r}){const{projects:x}=ee(),g=x.map(a=>({cwd:a.cwd,name:a.name})),i=new Set(g.map(a=>a.cwd)),f=t.projects.filter(a=>a!==T&&!i.has(a)),u=t.projects.includes(T),c=a=>r({projects:t.projects.includes(a)?t.projects.filter(j=>j!==a):[...t.projects,a]}),v=t.projects.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"action — appears in",hint:"Projects whose Sessions toolbar gets a one-click button for this agent. Pressing it starts a normal session: this persona is the ACTOR, its first tag is the MISSION, and the action text below is the opening goal. Leave empty for an agent that is only picked by hand in the New Session card.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx("button",{onClick:()=>c(T),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${u?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-faint border-line"}`,children:"every project"}),g.map(a=>{const j=t.projects.includes(a.cwd);return e.jsx("button",{title:a.cwd,onClick:()=>c(a.cwd),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${j?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"} ${u&&!j?"opacity-40":""}`,children:a.name},a.cwd)}),f.map(a=>e.jsxs("button",{title:`${a} — not a known project on this machine`,onClick:()=>c(a),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border bg-bg-hi text-fg-faint border-dashed border-line",children:[a," ×"]},a))]})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"action — button label",hint:"Caption on the Sessions toolbar button. Defaults to the agent name.",children:e.jsx("input",{value:t.actionLabel,onChange:a=>r({actionLabel:a.target.value}),placeholder:t.name,className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(h,{label:"action — opening instruction",hint:"Sent as the session's first message, under the AIM framing. Falls back to this persona's description when empty; with neither, no button is shown.",children:e.jsx("textarea",{rows:3,value:t.action,onChange:a=>r({action:a.target.value}),placeholder:t.description||`e.g. /builder
2
-
3
- Check git vs the published package and publish anything new.`,className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})})]})]})}function h({label:t,hint:r,children:x}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:t}),x,r&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug",children:r})]})}function de({options:t,value:r,onChange:x,mono:g}){return e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(i=>{const f=i===r;return e.jsx("button",{onClick:()=>x(i),className:`px-2.5 py-1 rounded text-xs border ${g?"font-mono":""} ${f?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-dim border-line"}`,children:i},i)})})}export{pe as AgentLibrary};
@@ -1 +0,0 @@
1
- import{a9 as i,F as r}from"./index-CXFQIPhO.js";function l({value:e,onChange:n,path:o,readOnly:a}){return i.jsx(r,{path:`file://${o}`,defaultLanguage:"markdown",value:e,onChange:t=>n(t??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:a,automaticLayout:!0}})}export{l as M};
@@ -1,3 +0,0 @@
1
- import{ai as d,ay as z,at as H,aA as W,av as N,a9 as e,j as w,P as D,V as q}from"./index-CXFQIPhO.js";import{P as A}from"./Panel-Cj2kw-Zv.js";import{S as G}from"./ScopeSwitcher-DVSyI44-.js";import{S as Q}from"./SaveBar-Cd_7U6Gb.js";import{P as U}from"./Library-DgI9oCCZ.js";import{u as X,m as Y,p as Z,g as ee,E as te,a as se,s as re}from"./settingsSchema-BJVciriw.js";import"./monaco-editor-BW5C4Iv1.js";const ne=["allow","deny","ask"];function ae(r){if(r.trim()==="")return{perms:{},full:{},err:null};try{const n=JSON.parse(r);return{perms:n.permissions??{},full:n,err:null}}catch(n){return{perms:{},full:{},err:n.message}}}function oe(r,n){const a={...r,permissions:n};return JSON.stringify(a,null,2)+`
2
- `}function ie(){const r=z(),n=H(),a=(n==null?void 0:n.cwd)??null,s=W(t=>t.navFace),i=d.useRef(!1),u=d.useRef(s),[p,c]=d.useState(()=>s==="project"&&a?"project":"user"),[m,P]=d.useState("effective");d.useEffect(()=>{if(u.current!==s){if(u.current=s,i.current){i.current=!1;return}c(s==="project"&&a?"project":"user")}},[s,a]),d.useEffect(()=>{s==="project"&&m==="presets"&&P("effective")},[s,m]);const J=t=>{i.current=!0,c(t)},b=X(D,r,a),f=b[p]??null,j=N(t=>t.files),E=N(t=>t.setDraft),O=N(t=>t.saveJson),I=N(t=>t.revert),[M,y]=d.useState(null),k=e.jsx(q,{options:[{key:"effective",label:"Effective"},{key:"rules",label:"Rules"},...s==="home"?[{key:"presets",label:"Presets"}]:[]],active:m,onChange:P}),$=d.useMemo(()=>{const t=Y(Z(j,b));return ee(t,["permissions"])??{kind:"object",children:{}}},[j,b]),F=(t,l)=>{var R;const o=b[p];if(!o)return;y(null);const h=((R=j[o])==null?void 0:R.draftRaw)??"";let v={};if(h.trim())try{v=JSON.parse(h)}catch{v={}}const B=re(v.permissions??{},t,l),K={...v,permissions:B};E(o,JSON.stringify(K,null,2)+`
3
- `)};if(!r)return e.jsx(w,{title:"loading…"});if(m==="presets")return e.jsx(A,{toolbar:k,children:e.jsx(U,{})});const C=t=>t!=="user"&&!a,g=f?j[f]:null,{perms:x,full:L,err:T}=g?ae(g.draftRaw):{perms:{},full:{},err:null},S=t=>{f&&(y(null),E(f,oe(L,t)))},_=(t,l)=>{const o=l.trim();if(!o)return;const h=x[t]??[];h.includes(o)||S({...x,[t]:[...h,o]})},V=(t,l)=>{const o=x[t]??[];S({...x,[t]:o.filter((h,v)=>v!==l)})};return e.jsx(A,{toolbar:e.jsxs(e.Fragment,{children:[k,e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(G,{scopes:D.scopes,active:p,onChange:J,annotate:t=>{if(C(t))return{exists:!1};const l=b[t];if(!l)return null;const o=j[l];return{exists:(o==null?void 0:o.exists)??!1,dirty:(o==null?void 0:o.dirty)??!1}}}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:f??"—"}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:f&&g?e.jsx(Q,{dirty:g.dirty,busy:g.busy,parseError:M||T||g.parseError,lastSavedAt:g.lastSavedAt,onSave:async()=>{y(null);const t=await O(f);t.ok||y(t.error??"save failed")},onRevert:()=>{y(null),I(f)}}):null,children:C(p)?e.jsx(w,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):m==="effective"?e.jsx(te,{node:$,targetScope:p,onOverride:F,schema:se().rootedAt(["permissions"]),rootLabel:"permissions"}):f&&g?e.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[e.jsx(le,{value:x.defaultMode??"default",onChange:t=>S({...x,defaultMode:t})}),ne.map(t=>e.jsx(ce,{list:t,rules:x[t]??[],onAdd:l=>_(t,l),onRemove:l=>V(t,l)},t)),e.jsx(de,{dirs:x.additionalDirectories??[],onChange:t=>S({...x,additionalDirectories:t})})]}):e.jsx(w,{title:"resolving…"})})}const ve=d.memo(ie);function le({value:r,onChange:n}){const a=["default","acceptEdits","plan","bypassPermissions"];return e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),e.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:a.map(s=>e.jsx("button",{onClick:()=>n(s),className:`px-2.5 py-1 text-xs transition-colors ${r===s?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:s},s))})]})}function ce({list:r,rules:n,onAdd:a,onRemove:s}){const[i,u]=d.useState(""),p=r==="allow"?"text-green-400":r==="deny"?"text-red-400":"text-yellow-400";return e.jsxs("section",{children:[e.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${p}`,children:r}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx("input",{value:i,onChange:c=>u(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(a(i),u(""))},placeholder:r==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),e.jsx("button",{onClick:()=>{a(i),u("")},disabled:!i.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),n.length===0?e.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):e.jsx("ul",{className:"space-y-0.5",children:n.map((c,m)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[e.jsx("span",{className:"flex-1 text-fg-dim truncate",children:c}),e.jsx("button",{onClick:()=>s(m),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${m}-${c}`))})]})}function de({dirs:r,onChange:n}){const[a,s]=d.useState("");return e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),e.jsx("div",{className:"flex gap-2 mb-2",children:e.jsx("input",{value:a,onChange:i=>s(i.target.value),onKeyDown:i=>{i.key==="Enter"&&a.trim()&&(n([...r,a.trim()]),s(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),e.jsx("ul",{className:"space-y-0.5",children:r.map((i,u)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[e.jsx("span",{className:"flex-1 text-fg-dim truncate",children:i}),e.jsx("button",{onClick:()=>n(r.filter((p,c)=>c!==u)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${u}-${i}`))})]})}export{ve as Permissions};