claude-code-session-manager 0.138.0 → 0.140.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 (194) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +352 -79
  3. package/dist/assets/AppSettings-CMFEM68R.js +2 -0
  4. package/dist/assets/History--JwsFnbn.js +2 -0
  5. package/dist/assets/HomeClaudeConfig-ijEXs--3.js +3 -0
  6. package/dist/assets/{Panel-CeDiyuNn.js → Panel-CALyU0pe.js} +1 -1
  7. package/dist/assets/ProjectClaudeConfig-sdlA-fUb.js +26 -0
  8. package/dist/assets/Scheduler-YT3j8SUa.js +16 -0
  9. package/dist/assets/{SkillReferenceGraph-CFMK8NJh.js → SkillReferenceGraph-CxAuwhNN.js} +1 -1
  10. package/dist/assets/Skills-DtRzghn5.js +67 -0
  11. package/dist/assets/{TiptapBody-D1kTj-tn.js → TiptapBody-DApeu7x8.js} +60 -54
  12. package/dist/assets/ViewTabs-B7qLXRAH.js +1 -0
  13. package/dist/assets/{VoiceButton-CZeyPM31.js → VoiceButton-DtStfv1H.js} +1 -1
  14. package/dist/assets/{historyTotals-B00l64Jw.js → historyTotals-ydfnwepc.js} +1 -1
  15. package/dist/assets/index-CtxruO1L.js +3121 -0
  16. package/dist/assets/{index-62tyjEQB.css → index-DKXdXfka.css} +1 -1
  17. package/dist/index.html +2 -2
  18. package/dist-web/app.css +1 -1
  19. package/dist-web/app.js +467 -451
  20. package/package.json +17 -6
  21. package/plugins/AGENTS.md +60 -0
  22. package/plugins/CLAUDE.md +1 -60
  23. package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
  24. package/plugins/session-manager-dev/skills/builder/SKILL.md +12 -4
  25. package/plugins/session-manager-dev/skills/builder/scripts/publish-preflight.cjs +255 -0
  26. package/plugins/session-manager-dev/skills/develop/SKILL.md +36 -22
  27. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
  28. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
  29. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
  30. package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
  31. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
  32. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
  33. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
  34. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
  35. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
  36. package/scripts/README.md +2 -0
  37. package/scripts/hooks/guard-tool-risk.cjs +91 -0
  38. package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
  39. package/scripts/ops-sweep.cjs +53 -23
  40. package/scripts/scheduler-mcp-server.cjs +360 -35
  41. package/src/main/build-info.json +4 -4
  42. package/src/main/chatRunner.cjs +2 -2
  43. package/src/main/config.cjs +112 -8
  44. package/src/main/docEdit.cjs +6 -1
  45. package/src/main/exchanges.cjs +70 -5
  46. package/src/main/files.cjs +7 -27
  47. package/src/main/health.cjs +48 -15
  48. package/src/main/historyAggregator.cjs +172 -63
  49. package/src/main/historyDashboard.cjs +87 -17
  50. package/src/main/index.cjs +78 -4
  51. package/src/main/ipcSchemas.cjs +233 -20
  52. package/src/main/lib/AGENTS.md +54 -0
  53. package/src/main/lib/CLAUDE.md +1 -54
  54. package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
  55. package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
  56. package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
  57. package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
  58. package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
  59. package/src/main/lib/claude/effectiveModelInfo.cjs +92 -22
  60. package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
  61. package/src/main/lib/claude/modelPricing.cjs +148 -0
  62. package/src/main/lib/claude/personaToolScope.cjs +12 -6
  63. package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
  64. package/src/main/lib/claude/runClaudeP.cjs +6 -1
  65. package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
  66. package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
  67. package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
  68. package/src/main/lib/ephemeralCwd.cjs +37 -2
  69. package/src/main/lib/epic/delegationReadiness.cjs +42 -9
  70. package/src/main/lib/epic/epicAdminRoutes.cjs +121 -0
  71. package/src/main/lib/epic/epicJobReceipt.cjs +87 -0
  72. package/src/main/lib/epic/epicOutsideRead.cjs +423 -0
  73. package/src/main/lib/epic/epicOutsideState.cjs +233 -0
  74. package/src/main/lib/epic/epicSettle.cjs +1 -1
  75. package/src/main/lib/epic/epicStateWatcher.cjs +157 -0
  76. package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
  77. package/src/main/lib/epic/epicValidationHook.cjs +24 -4
  78. package/src/main/lib/epic/externalRef.cjs +37 -0
  79. package/src/main/lib/epic/externalRefIndex.cjs +136 -0
  80. package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
  81. package/src/main/lib/epic/restorableSessions.cjs +151 -17
  82. package/src/main/lib/epic/transcriptUsage.cjs +197 -0
  83. package/src/main/lib/externalContract.cjs +137 -0
  84. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +176 -5
  85. package/src/main/lib/feedback-remote/crossProjectReply.cjs +186 -9
  86. package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +16 -6
  87. package/src/main/lib/feedback-remote/customerFeedbackClient.cjs +50 -8
  88. package/src/main/lib/feedback-remote/customerFeedbackInbox.cjs +218 -4
  89. package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +19 -3
  90. package/src/main/lib/feedback-remote/feedbackImages.cjs +171 -0
  91. package/src/main/lib/feedback-remote/localAdminHttp.cjs +11 -10
  92. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +167 -21
  93. package/src/main/lib/feedback-remote/needsYouAdminRoutes.cjs +133 -0
  94. package/src/main/lib/feedback-remote/needsYouIpc.cjs +50 -0
  95. package/src/main/lib/feedback-remote/needsYouStore.cjs +285 -0
  96. package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
  97. package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
  98. package/src/main/lib/git/branchSweep.cjs +209 -4
  99. package/src/main/lib/git/gitWorktree.cjs +41 -5
  100. package/src/main/lib/guardShims.cjs +1 -1
  101. package/src/main/lib/historyRollup.cjs +58 -5
  102. package/src/main/lib/insideHome.cjs +27 -1
  103. package/src/main/lib/mcpToolCatalog.cjs +232 -25
  104. package/src/main/lib/mdDocCensus.cjs +59 -78
  105. package/src/main/lib/mdDocRefs.cjs +71 -93
  106. package/src/main/lib/mdNetworkScan.cjs +245 -250
  107. package/src/main/lib/mdReviewRecord.cjs +22 -9
  108. package/src/main/lib/memoryMdNetwork.cjs +5 -12
  109. package/src/main/lib/opsOwnership.cjs +18 -2
  110. package/src/main/lib/opsRetentionSettings.cjs +28 -4
  111. package/src/main/lib/persona-macro/agentAdminRoutes.cjs +121 -0
  112. package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
  113. package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
  114. package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
  115. package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
  116. package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
  117. package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
  118. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
  119. package/src/main/lib/prd/depSlugResolve.cjs +104 -4
  120. package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
  121. package/src/main/lib/prd/prdCreate.cjs +351 -23
  122. package/src/main/lib/prd/prdDisposition.cjs +11 -2
  123. package/src/main/lib/prd/prdFrontmatter.cjs +96 -3
  124. package/src/main/lib/process/loginItem.cjs +171 -0
  125. package/src/main/lib/process/loginItemPlan.cjs +193 -0
  126. package/src/main/lib/project-pages/playerBridge.cjs +4 -0
  127. package/src/main/lib/project-pages/videoReview.cjs +268 -0
  128. package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
  129. package/src/main/lib/promptSessionSchema.cjs +4 -0
  130. package/src/main/lib/remoteTranscriptTail.cjs +32 -1
  131. package/src/main/lib/scheduler/cpuSample.cjs +131 -4
  132. package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
  133. package/src/main/lib/scheduler/loadGate.cjs +24 -6
  134. package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
  135. package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
  136. package/src/main/lib/scheduler/queueStore.cjs +7 -0
  137. package/src/main/lib/scheduler/rcaReport.cjs +21 -1
  138. package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
  139. package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
  140. package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
  141. package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
  142. package/src/main/lib/scheduler/schedulerPaths.cjs +12 -0
  143. package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
  144. package/src/main/lib/scheduler/validationQuality.cjs +282 -0
  145. package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
  146. package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
  147. package/src/main/lib/tasks/taskIpc.cjs +80 -0
  148. package/src/main/lib/tasks/taskLedger.cjs +502 -0
  149. package/src/main/lib/tasks/taskRun.cjs +313 -0
  150. package/src/main/lib/tasks/taskSwitch.cjs +120 -0
  151. package/src/main/lib/telemetry/auditEvents.cjs +176 -0
  152. package/src/main/lib/telemetry/eventsAdminRoutes.cjs +45 -0
  153. package/src/main/loginItemIpc.cjs +35 -0
  154. package/src/main/loopEfficiencyHandlers.cjs +11 -2
  155. package/src/main/projectPages.cjs +6 -15
  156. package/src/main/promptSessionEvents.cjs +9 -1
  157. package/src/main/queueOps.cjs +260 -3
  158. package/src/main/runVerify.cjs +53 -25
  159. package/src/main/scheduler/AGENTS.md +26 -0
  160. package/src/main/scheduler/CLAUDE.md +1 -26
  161. package/src/main/scheduler/budget.cjs +239 -9
  162. package/src/main/scheduler/cancelDependents.cjs +154 -0
  163. package/src/main/scheduler/prdParser.cjs +4 -1
  164. package/src/main/scheduler/starvation.cjs +20 -18
  165. package/src/main/scheduler.cjs +774 -64
  166. package/src/main/supervisor.cjs +5 -1
  167. package/src/main/templates/PRD_AUTHORING.md +7 -1
  168. package/src/main/transcripts.cjs +62 -7
  169. package/src/main/validationQualityHandlers.cjs +199 -0
  170. package/src/main/webRemote.cjs +132 -20
  171. package/src/preload/api.d.ts +434 -28
  172. package/src/preload/apiSurface.cjs +7 -0
  173. package/src/preload/apiSurface.json +485 -81
  174. package/src/preload/index.cjs +38 -5
  175. package/src/seed/agents/validator.md +19 -8
  176. package/dist/assets/AgentLibrary-C1d_D7uQ.js +0 -2
  177. package/dist/assets/AppSettings-CgDhqrsU.js +0 -2
  178. package/dist/assets/Button-Bk23rEnZ.js +0 -1
  179. package/dist/assets/DocumentEditorPane-BqY5Nq6W.js +0 -1
  180. package/dist/assets/Extensions-CXem-uwI.js +0 -2
  181. package/dist/assets/History-BwO3coo4.js +0 -2
  182. package/dist/assets/Library-BDV69fSe.js +0 -32
  183. package/dist/assets/ListDetail-CD-Fm6mh.js +0 -1
  184. package/dist/assets/ProjectClaudeConfig-NjdKdwe8.js +0 -25
  185. package/dist/assets/ProvenanceBadge-Bu8NmI_R.js +0 -1
  186. package/dist/assets/Scheduler-CkhTvG7C.js +0 -16
  187. package/dist/assets/Settings-COT34hBF.js +0 -2
  188. package/dist/assets/Skills-BgexoUkQ.js +0 -29
  189. package/dist/assets/SourceChip-BXjcdeb1.js +0 -1
  190. package/dist/assets/SystemPrompt-CeeH3EeW.js +0 -1
  191. package/dist/assets/Toggle-CENi19iK.js +0 -1
  192. package/dist/assets/ViewTabs-DDBb0x96.js +0 -1
  193. package/dist/assets/claude-settings-schema-COigsajx.js +0 -3
  194. package/dist/assets/index-CgCxpunJ.js +0 -3116
@@ -20,15 +20,21 @@
20
20
  'use strict';
21
21
 
22
22
  const { z } = require('zod');
23
+ const { MISS_KINDS } = require('./scheduler/validatorVerdictSchema.cjs');
23
24
 
24
25
  const CatalogEntrySchema = z.object({
25
26
  name: z.string().min(1),
26
- group: z.enum(['scheduler', 'chat', 'feedback', 'help', 'project-home', 'macros', 'customer-feedback']),
27
+ group: z.enum(['scheduler', 'chat', 'feedback', 'help', 'project-home', 'macros', 'customer-feedback', 'epics', 'agents', 'tasks']),
27
28
  purpose: z.string().min(1),
29
+ summary: z.string().min(10).max(90).regex(/^[^|`\n]+$/),
28
30
  whenToUse: z.string().min(1),
29
31
  whenNotToUse: z.string().min(1),
30
32
  exampleArgs: z.record(z.string(), z.unknown()),
31
33
  notes: z.string().nullable(),
34
+ // Arg groups the handler refuses a call without ('exactly one of'). README
35
+ // table only — never enters composeDescription, and never becomes a
36
+ // oneOf/anyOf in inputSchema (the Claude API refuses those at top level).
37
+ requiredOneOf: z.array(z.array(z.string()).min(2)).optional(),
32
38
  });
33
39
 
34
40
  const RecipeSchema = z.object({
@@ -42,6 +48,7 @@ const MCP_TOOL_CATALOG = [
42
48
  name: 'scheduler_reset_job',
43
49
  group: 'scheduler',
44
50
  purpose: "Reset a stuck scheduler job by slug via the session-manager app's admin API.",
51
+ summary: 'Reset a stuck job so the scheduler runs it again.',
45
52
  whenToUse: 'Use after diagnosing why a job is stuck (e.g. via scheduler_get_prd/scheduler_list_jobs) and deciding it should re-run from pending.',
46
53
  whenNotToUse: 'Do not use as a first move on a "needs_review" job without reading it first — reset just clears status, it does not answer the question the job raised.',
47
54
  exampleArgs: { slug: 'add-mcp-tool-catalog', force: false },
@@ -51,6 +58,7 @@ const MCP_TOOL_CATALOG = [
51
58
  name: 'scheduler_pause',
52
59
  group: 'scheduler',
53
60
  purpose: "Pause NEW job dispatch for every project on this machine (machine-wide, not per-repo) via the session-manager app's admin API.",
61
+ summary: 'Pause new job starts for every project on this machine.',
54
62
  whenToUse: 'Use only when the human asks you to stop dispatch everywhere, or for a machine-wide emergency. Pass a `reason`. Running jobs are never killed.',
55
63
  whenNotToUse: "NEVER use it to protect one repo's git/branch state or a single Epic's work — it freezes every project's scheduler. Do not use it to cancel a running job (use scheduler_cancel_job) or as a workaround for a stuck queue.",
56
64
  exampleArgs: { reason: 'machine-wide emergency: disk full' },
@@ -60,6 +68,7 @@ const MCP_TOOL_CATALOG = [
60
68
  name: 'scheduler_resume',
61
69
  group: 'scheduler',
62
70
  purpose: "Clear any scheduler pause (manual or automatic) via the session-manager app's admin API.",
71
+ summary: 'Lift a scheduler pause so jobs start again.',
63
72
  whenToUse: 'Use to restart dispatch after scheduler_pause, or to lift an auto-pause you have judged stale.',
64
73
  whenNotToUse: 'Do not use to retry a parked needs_review job — that is scheduler_reset_job.',
65
74
  exampleArgs: {},
@@ -69,6 +78,7 @@ const MCP_TOOL_CATALOG = [
69
78
  name: 'scheduler_list_jobs',
70
79
  group: 'scheduler',
71
80
  purpose: "List scheduler jobs via the session-manager app's admin API.",
81
+ summary: 'List queued, running and finished jobs on this machine.',
72
82
  whenToUse: 'Use for a quick overview of live queue-row status (pending/running/completed/failed/needs_review) across the machine.',
73
83
  whenNotToUse: 'For PRD content (frontmatter/body) rather than just job status, or for filtering by cwd/Epic, use scheduler_list_prds instead.',
74
84
  exampleArgs: {},
@@ -102,6 +112,11 @@ const MCP_TOOL_CATALOG = [
102
112
  + 'disk by the verifier, and declaring them is the ONLY way an artifact-only PRD can pass the finish '
103
113
  + 'protocol without a commit. Each requires the other (the write is refused if only one is given), and '
104
114
  + 'no path may contain "..". '
115
+ + '`riskTools` (optional, up to 20) names the tool-risk rules this PRD is cleared to call although they are '
116
+ + 'marked irreversible, money or public in a tool-risk.json, in the same syntax as the marks. '
117
+ + 'A bare slug already used by a PRD in ANOTHER Epic is refused as a cross-Epic duplicate (the error names '
118
+ + 'the exact NN slugs); add them to dependsOn, or call again with allowDuplicateOf: [those NN slugs] for a '
119
+ + 'deliberate duplicate. '
105
120
  + '`gate` and `files` are REQUIRED on every call — the tool refuses a call missing either. `gate` lists '
106
121
  + '1-10 commands that prove this PRD is done (each starting with `timeout <seconds>`, joined with `&&`, '
107
122
  + 'no shell metacharacters), or exactly `["none"]` for a PRD with no runnable check; the scheduler '
@@ -110,6 +125,7 @@ const MCP_TOOL_CATALOG = [
110
125
  + 'or folders this PRD may change; The scheduler never runs two PRDs with overlapping files at once '
111
126
  + '(dispatch holds the later one), so `dependsOn` is for real output or order dependencies, not for '
112
127
  + 'avoiding file clashes.',
128
+ summary: 'Queue one PRD (a written work order) in an Epic a human approved.',
113
129
  whenToUse: 'Use whenever new work should be queued into an already-approved Epic — this is the /develop path.',
114
130
  whenNotToUse: 'TWO DISTINCT FAILURE MODES if this tool is not usable — do not conflate them: '
115
131
  + '(a) this tool call is PRESENT in your tool list but ERRORS — NEVER hand-write a PRD file. '
@@ -144,7 +160,10 @@ const MCP_TOOL_CATALOG = [
144
160
  + 'written and every per-entry error is returned as { index, slug, error }. Returns each slug and its NN, plus '
145
161
  + 'any advisory warnings. Like scheduler_create_prd it only writes files; the queue rows are derived by the '
146
162
  + 'next reconcile pass. All entries must resolve to the same project and Epic; top-level cwd, sourcePromptId '
147
- + 'and origin fields are forwarded the same way as scheduler_create_prd.',
163
+ + 'and origin fields are forwarded the same way as scheduler_create_prd. An entry whose bare slug already '
164
+ + 'exists in another Epic fails the batch as a cross-Epic duplicate; give that entry dependsOn on the named NN '
165
+ + 'slugs, or allowDuplicateOf: [those NN slugs] for a deliberate duplicate, and call again.',
166
+ summary: 'Queue a whole plan of PRDs in one all-or-nothing call.',
148
167
  whenToUse: 'Use to queue a whole plan at once, validate PRD included: dependsOn may name other entries of the same call by bare slug (earlier or later), so a chain needs no ordering of calls.',
149
168
  whenNotToUse: 'Do not use for a single PRD — use scheduler_create_prd. Not callable from inside a headless scheduled job (same refusal as scheduler_create_prd). If the app is not running, stop and ask the human to start it; never hand-write PRD files.',
150
169
  exampleArgs: {
@@ -172,6 +191,7 @@ const MCP_TOOL_CATALOG = [
172
191
  + 'limit 100, max 500) sorted by slug ascending — check `hasMore`/`total` in the response before assuming you '
173
192
  + "received every PRD; page further with `offset`. Default fields are compact (no parallelGroup/estimateMinutes/"
174
193
  + 'sourcePromptId/epicId/archivedStatus) — pass fields:"full" to restore them.',
194
+ summary: 'List PRDs and their job status, by project, Epic or status.',
175
195
  whenToUse: 'Use to survey PRDs by project/Epic/status before deciding which one to read, update, reset, or archive.',
176
196
  whenNotToUse: 'Do not assume a page without `hasMore` is the full result set without checking `total` — page further with `offset` first.',
177
197
  exampleArgs: { cwd: '/home/bilko/Projects/session-manager', status: 'needs_review' },
@@ -182,6 +202,7 @@ const MCP_TOOL_CATALOG = [
182
202
  group: 'scheduler',
183
203
  purpose: "THE ONLY SUPPORTED WAY to read one PRD's full body + parsed frontmatter (live or archived) via the "
184
204
  + "session-manager app's admin API.",
205
+ summary: 'Read one PRD in full, with its frontmatter.',
185
206
  whenToUse: 'Use before editing/resetting a PRD, or to answer what a needs_review job actually asked.',
186
207
  whenNotToUse: 'For a fleet-wide overview instead of one PRD, use scheduler_list_prds.',
187
208
  exampleArgs: { slug: 'add-mcp-tool-catalog' },
@@ -198,6 +219,7 @@ const MCP_TOOL_CATALOG = [
198
219
  + 'Patching dependsOn to a non-empty array replaces it wholesale (validated against existing PRD slugs, '
199
220
  + 'same resolver scheduler_create_prd uses); patching it to an explicit empty array CLEARS the dependency — '
200
221
  + 'the safe way to fix a wrong dependsOn without archiving (which marks the PRD completed and wrongly frees its dependents).',
222
+ summary: 'Edit a PRD that has not run yet or has stopped.',
201
223
  whenToUse: 'Use to fix a PRD\'s spec before it runs, or to fix a parked (needs_review or failed) or skipped PRD before you reset it with scheduler_reset_job.',
202
224
  whenNotToUse: 'Do not use on a running or completed job. Do not reset first and edit second: the reset job can start before the edit lands.',
203
225
  exampleArgs: { slug: 'add-mcp-tool-catalog', frontmatter: { estimateMinutes: 8 } },
@@ -208,6 +230,7 @@ const MCP_TOOL_CATALOG = [
208
230
  group: 'scheduler',
209
231
  purpose: "THE ONLY SUPPORTED WAY to archive one or more PRDs (move to prds-archived/) via the session-manager "
210
232
  + "app's admin API.",
233
+ summary: 'Archive PRDs that are done or no longer needed.',
211
234
  whenToUse: 'Use once a batch of PRDs is done and should stop showing up in default (live) listings.',
212
235
  whenNotToUse: 'Do not archive a PRD you still expect to reset/re-run — archived PRDs are not part of the live scheduling loop.',
213
236
  exampleArgs: { slugs: ['add-mcp-tool-catalog'] },
@@ -221,7 +244,10 @@ const MCP_TOOL_CATALOG = [
221
244
  + 'cancelled job lands as "failed" with an error naming the cause. Refuses a slug whose job is already terminal '
222
245
  + '(completed/failed/needs_review) — nothing to cancel. A cancelled running job\'s commits are never landed on '
223
246
  + 'the base branch; they stay on the job branch, reported in the result as landed:false plus '
224
- + 'jobBranch/jobBranchSha.',
247
+ + 'jobBranch/jobBranchSha. If the job has pending dependents the cancel is refused and lists them; call again '
248
+ + 'with dependents: { action: "cascade" } (cancel them too), { action: "repoint", to: "<slug>" } (depend on '
249
+ + 'another PRD instead) or { action: "clear" } (drop the dependency).',
250
+ summary: 'Cancel a job that has not finished.',
225
251
  whenToUse: 'Use to stop a running or pending job that should not continue (e.g. it was queued in error, or scope changed underneath it).',
226
252
  whenNotToUse: 'Do not use on an already-terminal job (completed/failed/needs_review) — use scheduler_reset_job if it should run again.',
227
253
  exampleArgs: { slug: 'add-mcp-tool-catalog' },
@@ -232,6 +258,7 @@ const MCP_TOOL_CATALOG = [
232
258
  group: 'scheduler',
233
259
  purpose: "THE ONLY SUPPORTED WAY to rewrite a PRD's parallelGroup and/or estimateMinutes frontmatter (and, if "
234
260
  + "parallelGroup changes, its NN- filename prefix) via the session-manager app's admin API.",
261
+ summary: "Change a PRD's group number or time estimate.",
235
262
  whenToUse: 'Use to correct an estimate or renumber a PRD file after it was created.',
236
263
  whenNotToUse: 'Do not use parallelGroup as an ordering/dependency barrier — it is only a unique-per-PRD display hint; use dependsOn on scheduler_create_prd/scheduler_update_prd for real ordering.',
237
264
  exampleArgs: { items: [{ slug: 'add-mcp-tool-catalog', estimateMinutes: 10 }] },
@@ -243,6 +270,7 @@ const MCP_TOOL_CATALOG = [
243
270
  purpose: "Push a prompt into an already-open tab's chat queue via the session-manager app's admin "
244
271
  + 'API. The renderer resolves the tab (must currently be open) and runs the prompt through '
245
272
  + 'the same queued-vs-immediate path as a manual send.',
273
+ summary: 'Send a prompt to a session tab that is already open.',
246
274
  whenToUse: 'Use to programmatically continue a conversation in a tab that is already open in the running app.',
247
275
  whenNotToUse: 'Do not use to start new work in a project you are not already chatting in — that is /develop (scheduler_create_prd) or feedback_open_session.',
248
276
  exampleArgs: { tabId: 'a1b2c3d4-tab-id', prompt: 'Please continue with the next step.' },
@@ -254,6 +282,7 @@ const MCP_TOOL_CATALOG = [
254
282
  group: 'feedback',
255
283
  purpose: 'List the OTHER projects on this machine that can receive feedback (i.e. that Session Manager '
256
284
  + 'already manages — they have a session-manager-operations/ directory).',
285
+ summary: 'List the other projects on this machine that can take feedback.',
257
286
  whenToUse: "Call this FIRST when you need the exact `toCwd` for feedback_open_session and are not certain of it — never guess a path.",
258
287
  whenNotToUse: 'A project missing from this list has simply never been opened in Session Manager; ask the human to open it once rather than inventing a path.',
259
288
  exampleArgs: {},
@@ -266,6 +295,7 @@ const MCP_TOOL_CATALOG = [
266
295
  + "PROPOSED session in the receiving project's own Sessions queue, carrying your report as its "
267
296
  + 'opening prompt and stamped with where it came from. Session Manager performs the cross-folder '
268
297
  + 'write; you never write another project\'s files yourself.',
298
+ summary: 'Hand a finding to another project as a proposed session there.',
269
299
  whenToUse: 'Use when work in this project surfaces something that is genuinely another project\'s to fix. '
270
300
  + 'Write for a human who must approve it and has never seen your project. Lead with WHY: `motivation` '
271
301
  + 'in the originating human\'s terms. Then give the full `plan` (required for tag "feature") and '
@@ -311,6 +341,7 @@ const MCP_TOOL_CATALOG = [
311
341
  purpose: 'Answer the project that asked. Only for a session that was opened by ANOTHER project\'s '
312
342
  + 'feedback_open_session: the reply lands in the Epic that asked — as an event on its chain plus its '
313
343
  + 'next chat prompt — not as a new proposed session.',
344
+ summary: 'Answer the project that sent this session its feedback.',
314
345
  whenToUse: 'Use once the work the other project asked for is verified (outcome "done"), or when you are '
315
346
  + 'blocked or need an answer from it (outcome "blocked" / "question"). Send "done" only after the work '
316
347
  + 'is verified — name the commit or version in the message.',
@@ -333,6 +364,7 @@ const MCP_TOOL_CATALOG = [
333
364
  purpose: "ALIAS of project_page_write for the Overview page: write this project's Project Home Overview page — ONE self-contained HTML document — to "
334
365
  + "session-manager-operations/project-pages/knowledge/overview/ via the session-manager app's admin API. "
335
366
  + 'Prefer project_page_write for any new knowledge page.',
367
+ summary: 'Write the Overview page of Project Home (same as project_page_write).',
336
368
  whenToUse: 'Use when asked to generate or refresh the project home Overview page. Compose the whole page yourself '
337
369
  + '(inline <style> only — scripts never run in a page; data: URIs for assets) from what is really true about the project, then '
338
370
  + 'pass the full document as `html`.',
@@ -344,9 +376,11 @@ const MCP_TOOL_CATALOG = [
344
376
  },
345
377
  {
346
378
  name: 'project_page_write',
379
+ requiredOneOf: [['html', 'htmlPath']],
347
380
  group: 'project-home',
348
381
  purpose: "Write one knowledge page for this project's Project Home — ONE self-contained HTML document identified by `pageId` — "
349
382
  + "via the session-manager app's admin API. Writing an existing pageId replaces that page.",
383
+ summary: 'Write one HTML knowledge page for Project Home.',
350
384
  whenToUse: 'Use when asked to document a topic of the project as a page (architecture, how-to, status). Compose the whole page yourself '
351
385
  + 'with inline <style> only — scripts never run in a page — from what is really true about the project, then pass it as `html` '
352
386
  + 'or, for a large document, write it to a local .html file and pass its absolute path as `htmlPath`.',
@@ -360,13 +394,14 @@ const MCP_TOOL_CATALOG = [
360
394
  html: '<!DOCTYPE html><html><head><style>body{font:16px sans-serif}</style></head><body><h1>Architecture</h1></body></html>',
361
395
  },
362
396
  notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted. "
363
- + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2MB read limit).',
397
+ + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2 MiB read limit; the project_video_write cap is 2 MiB per started 30 s of lengthS).',
364
398
  },
365
399
  {
366
400
  name: 'project_matrix_read',
367
401
  group: 'project-home',
368
402
  purpose: "Load this project's saved competitive feature matrix (session-manager-operations/project-pages/matrix/matrix.json) "
369
403
  + "together with its JSON Schema, via the session-manager app's admin API — the warm start for a competitive-analysis run.",
404
+ summary: 'Read the saved competitor feature matrix and its schema.',
370
405
  whenToUse: 'Call FIRST in a competitive-analysis run, before any research: start from the saved products, groups and features '
371
406
  + 'instead of a cold start, and shape every edit to the returned `schema`. `matrix` is null when none has been saved yet.',
372
407
  whenNotToUse: 'Do not use to save — use project_matrix_write. Do not read matrix.json from disk yourself: '
@@ -377,9 +412,11 @@ const MCP_TOOL_CATALOG = [
377
412
  },
378
413
  {
379
414
  name: 'project_matrix_write',
415
+ requiredOneOf: [['matrix', 'matrixPath']],
380
416
  group: 'project-home',
381
417
  purpose: "Save this project's competitive feature matrix — ONE JSON object matching the schema project_matrix_read returns — "
382
418
  + "via the session-manager app's admin API. Each call replaces the whole stored matrix.",
419
+ summary: 'Save the competitor feature matrix as one JSON object.',
383
420
  whenToUse: 'Use once, at the end of a competitive-analysis run, to save the finished matrix. Build the whole object from '
384
421
  + 'project_matrix_read\'s result plus what your research really found, then pass it as `matrix` or — preferred for a large '
385
422
  + 'matrix — write it to a local .json file and pass its absolute path as `matrixPath`. Pass `model` to record which model wrote it.',
@@ -392,14 +429,18 @@ const MCP_TOOL_CATALOG = [
392
429
  },
393
430
  {
394
431
  name: 'project_video_write',
432
+ requiredOneOf: [['html', 'htmlPath']],
395
433
  group: 'project-home',
396
434
  purpose: "Write one video for this project's Project Home — ONE self-contained HTML/JS document identified by `videoId` — "
397
- + "via the session-manager app's admin API. Writing an existing videoId replaces that video.",
435
+ + "via the session-manager app's admin API. Writing an existing videoId replaces that video. `kind` is 'project-demo', 'blog-post', "
436
+ + "'feature' or 'episode' (an episode of a series, e.g. from a Project Video tool). The video is 16:9 by default; a vertical 9:16 video "
437
+ + 'declares <meta name="sm-demo-aspect" content="9:16"> in its head.',
438
+ summary: 'Save one self-contained HTML video for Project Home.',
398
439
  whenToUse: 'Use when asked to make a project video (demo, marketing). Compose the whole document yourself (inline <style>/<script>, '
399
440
  + 'data: URIs for assets, CSS/JS-driven animation) from what is really true about the project, declare `kind` and `lengthS`, '
400
441
  + 'then pass the document as `html` or — preferred when it embeds a base64 audio/image data URI — as an absolute `htmlPath`.',
401
442
  whenNotToUse: 'Never fabricate content. Do not use for static knowledge pages — use project_page_write. The document must be self-contained '
402
- + 'and non-network-capable: the call is rejected for empty input, more than 2MB, remote references, or network-capable APIs.',
443
+ + 'and non-network-capable: the call is rejected for empty input, more than 2 MiB per started 30 s of lengthS, remote references, or network-capable APIs.',
403
444
  exampleArgs: {
404
445
  cwd: '/home/bilko/Projects/session-manager',
405
446
  videoId: 'demo-30s',
@@ -410,14 +451,16 @@ const MCP_TOOL_CATALOG = [
410
451
  meta: {},
411
452
  },
412
453
  notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted. "
413
- + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2MB).',
454
+ + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2 MiB per started 30 s of lengthS).',
414
455
  },
415
456
  {
416
457
  name: 'project_demo_video_write',
458
+ requiredOneOf: [['html', 'htmlPath']],
417
459
  group: 'project-home',
418
460
  purpose: "ALIAS of project_video_write that adds a project-demo video: write this project's demo video (30 seconds or 1 minute) — ONE self-contained HTML/JS document — as a new "
419
461
  + "project-demo entry under session-manager-operations/project-pages/videos/<id>/ via the session-manager app's admin API. "
420
462
  + 'project_video_write is the primary video tool; use this alias only for a quick project-demo.',
463
+ summary: 'Save a 30-second or 1-minute demo video (same as project_video_write).',
421
464
  whenToUse: 'Use when asked to generate or refresh the demo video. Compose the whole document yourself '
422
465
  + '(inline <style>/<script>, data: URIs for assets, CSS/JS-driven animation) from what is really true about '
423
466
  + 'the project, declare its length with <meta name="sm-demo-duration" content="N"> (5-60 seconds), then '
@@ -425,7 +468,7 @@ const MCP_TOOL_CATALOG = [
425
468
  + 'local .html file and pass its absolute path as `htmlPath`.',
426
469
  whenNotToUse: 'Never fabricate content — every claim must trace to something concrete in the project. The '
427
470
  + 'document must be self-contained and non-network-capable: the call is rejected for empty input, more than '
428
- + '2MB, any <script src>, <link href="http…">, @import, or url(http…) (no remote references); any '
471
+ + '2 MiB per started 30 s of lengthS (the sm-demo-duration seconds), any <script src>, <link href="http…">, @import, or url(http…) (no remote references); any '
429
472
  + 'fetch/XMLHttpRequest/WebSocket/EventSource/sendBeacon/dynamic import/importScripts/<iframe>/<object>/'
430
473
  + '<embed>/window.open/http(s)-pointing src or href (no network-capable APIs); or a missing/out-of-range '
431
474
  + 'sm-demo-duration meta tag.',
@@ -434,14 +477,16 @@ const MCP_TOOL_CATALOG = [
434
477
  html: '<!DOCTYPE html><html><head><meta name="sm-demo-duration" content="30"></head><body><h1>Example</h1></body></html>',
435
478
  },
436
479
  notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted. "
437
- + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2MB); prefer `htmlPath` for base64 data URIs. '
480
+ + 'Give exactly one of `html` / `htmlPath` (absolute .html/.htm file, <= 2 MiB per started 30 s of lengthS); prefer `htmlPath` for base64 data URIs. '
438
481
  + 'The document is CSP-stamped after it is written, so the viewer sandbox is the real network fence — these checks are defence in depth.',
439
482
  },
440
483
  {
441
484
  name: 'project_character_write',
485
+ requiredOneOf: [['js', 'jsPath']],
442
486
  group: 'project-home',
443
487
  purpose: "Write this project's reusable video character — a `character.json` descriptor plus a `character.js` drawing module — to "
444
488
  + "the project's videos/_character/ folder via the session-manager app's admin API, so every later video can reuse the same mascot.",
489
+ summary: "Save the reusable character used in this project's videos.",
445
490
  whenToUse: 'Use once per project, before building character videos, to save the mascot you designed. Pass `json` (the descriptor object or its JSON text) '
446
491
  + 'and the module as `js` or — preferred for large modules — an absolute `jsPath` to a local .js file. Pass `replace: true` only to deliberately overwrite an existing character.',
447
492
  whenNotToUse: 'Never fabricate content. Do not use to write a video — use project_video_write. The call is rejected (409) when a character already exists and `replace` is not set, '
@@ -455,15 +500,38 @@ const MCP_TOOL_CATALOG = [
455
500
  notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted. "
456
501
  + 'Give exactly one of `js` / `jsPath` (absolute .js file, <= 300KB).',
457
502
  },
503
+ {
504
+ name: 'project_video_review_write',
505
+ group: 'project-home',
506
+ purpose: 'Save review material (text up to 32000 characters, such as a whole episode script, and 1-6 images, such as a storyboard contact sheet) '
507
+ + "for a review-stage Project Video tool run, via the session-manager app's admin API. Saving again replaces the previous material. "
508
+ + 'It cannot approve, ask for changes or retry: only a human click in Project Home ▸ Video can.',
509
+ summary: 'Save a script and images for a human to review a video.',
510
+ whenToUse: 'Use at the end of a review-stage Project Video tool run, once the material the human must check is ready: pass the `videoId` '
511
+ + 'the run was dispatched for, the review `text`, and `imagePaths` (absolute .png/.jpg/.jpeg/.webp files, each at most 2 MiB). '
512
+ + 'Then stop and say the material waits for the human in Project Home ▸ Video.',
513
+ whenNotToUse: 'Never use it to record a decision — a call carrying decision, status, approved or approvedAt is refused, and no tool can '
514
+ + 'approve, ask for changes or retry. Do not use for the finished video — use project_video_write. The call is refused when the entry '
515
+ + 'has no recorded dispatch, for text outside 1-32000 characters, and for images that are not PNG, JPEG or WebP.',
516
+ exampleArgs: {
517
+ cwd: '/home/bilko/Projects/session-manager',
518
+ videoId: 'ep-1',
519
+ text: 'Episode 1 script: ...',
520
+ imagePaths: ['/tmp/ep-1/storyboard.png'],
521
+ },
522
+ notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted. "
523
+ + 'The images are read from disk and base64-encoded by the MCP server before the save.',
524
+ },
458
525
  {
459
526
  name: 'customer_feedback_list',
460
527
  group: 'customer-feedback',
461
528
  purpose: "List the customers' feedback in the owner's local inbox (bug / feature / discussion items submitted "
462
- + 'from the {F} feedback panel), optionally pulling new items from the feedback service first.',
529
+ + 'from the Feedback panel), optionally pulling new items from the feedback service first.',
530
+ summary: "List feedback that users sent to the owner's inbox.",
463
531
  whenToUse: 'Use to inspect what customers have submitted and each item\'s status. `pull` defaults to true '
464
532
  + '(fetch new items first); pass `includeHidden: true` to include moderated-away items.',
465
533
  whenNotToUse: 'WHEN NOT TO USE IT: this only works on the owner\'s machine (it needs the owner token) and is read-only. '
466
- + 'Turning an item into an Epic is done by the human via Open as Epic in the {F} feedback panel — there is no tool '
534
+ + 'Turning an item into an Epic is done by the human via Open as Epic in the Feedback panel — there is no tool '
467
535
  + 'for it. A finding that belongs to another local project uses feedback_open_session instead.',
468
536
  exampleArgs: { pull: true, includeHidden: false },
469
537
  notes: 'Returns { ok, items, pulled? }. Not-configured machines get { ok:false, error } as an error result. '
@@ -476,9 +544,10 @@ const MCP_TOOL_CATALOG = [
476
544
  group: 'customer-feedback',
477
545
  purpose: 'Set the status of one customer feedback item (open | in_progress | resolved | wontfix) with an optional '
478
546
  + 'note the customer sees, via the session-manager app\'s admin API.',
547
+ summary: 'Set the status of one feedback item, with an optional note.',
479
548
  whenToUse: 'Use after inspecting an item with customer_feedback_list, to mark it in progress, resolved, or wontfix.',
480
549
  whenNotToUse: 'WHEN NOT TO USE IT: this changes status only. Turning an item into an Epic is done by the human via '
481
- + 'Open as Epic in the {F} feedback panel — there is no tool for it. Cross-project findings use '
550
+ + 'Open as Epic in the Feedback panel — there is no tool for it. Cross-project findings use '
482
551
  + 'feedback_open_session. Never mark an item resolved unless the work has actually landed.',
483
552
  exampleArgs: { id: 'fb_123', status: 'resolved', note: 'Fixed in 0.97.0' },
484
553
  notes: 'The note is shown to the customer; keep it short (the inbox enforces a maximum length).',
@@ -486,17 +555,28 @@ const MCP_TOOL_CATALOG = [
486
555
  {
487
556
  name: 'customer_feedback_submit',
488
557
  group: 'customer-feedback',
489
- purpose: 'Send one piece of feedback about Session Manager itself (bug | feature | discussion) to its maintainers, '
490
- + 'the same submission the {F} feedback panel makes, via the session-manager app\'s admin API.',
491
- whenToUse: 'Use only when the human asks to send feedback about Session Manager itself. Draft a title (max 120 chars) '
492
- + 'and body (max 4000 chars) from the conversation, show the human the exact title, body and tag, and call only '
493
- + 'after they agree.',
558
+ purpose: 'Send one piece of feedback about Session Manager itself (bug | feature | discussion) to its maintainers — '
559
+ + 'a one-line goal, a description, and up to 5 PNG/JPEG/WebP/GIF images given by absolute path — the same '
560
+ + 'submission the Feedback panel makes, via the session-manager app\'s admin API.',
561
+ summary: 'Send feedback about Session Manager to its maintainers.',
562
+ whenToUse: 'Use only when the human asks to send feedback about Session Manager itself. Draft a goal (one line, max '
563
+ + '120 chars) and a description (max 4000 chars) from the conversation. For images, use the `Attached: <path>` '
564
+ + 'lines of images the human pasted into this chat, or files the human named — absolute paths only, at most 5. '
565
+ + 'Show the human the exact goal, description, tag and image list, and call only after they agree.',
494
566
  whenNotToUse: 'WHEN NOT TO USE IT: a bug in the project being worked on is /develop; a finding for another local '
495
- + 'project is feedback_open_session. Never call it on your own initiative. Never include secrets, tokens, '
496
- + 'customer data or private file contents in the title or body.',
497
- exampleArgs: { title: 'Feedback panel: prefill from the current session', body: 'What happened, what I expected, steps.', tag: 'feature' },
498
- notes: 'Runs only in a Session Manager chat or terminal session (refused in headless jobs). Returns { ok, item }; '
499
- + '{ ok:false, error } comes back as an error result. The home directory is redacted to ~ before sending.',
567
+ + 'project is feedback_open_session. Never call it on your own initiative. Never attach an image the human did '
568
+ + 'not ask to send. Never include secrets, tokens, customer data or private file contents in the goal, '
569
+ + 'description or images.',
570
+ exampleArgs: {
571
+ goal: 'Feedback panel: prefill from the current session',
572
+ description: 'What happened, what I expected, steps.',
573
+ tag: 'feature',
574
+ imagePaths: ['/home/me/Pictures/feedback-panel.png'],
575
+ },
576
+ notes: 'Runs only in a Session Manager chat or terminal session (refused in headless jobs). Returns { ok, item, '
577
+ + 'warning? }; a warning means the text was sent but the feedback service did not accept every image — tell the '
578
+ + 'human which images did not go. { ok:false, error } comes back as an error result. The home directory is '
579
+ + 'redacted to ~ before sending.',
500
580
  },
501
581
  {
502
582
  name: 'macro_list',
@@ -504,7 +584,11 @@ const MCP_TOOL_CATALOG = [
504
584
  purpose: "List this project's HOT KEYS macros — the saved (agent, tag, prompt) one-click buttons shown "
505
585
  + "in the Sessions tab's HOT KEYS strip or as tools in Project Home ▸ Tools, via the session-manager app's admin API. "
506
586
  + "Each macro's `surface` tells where it shows: 'sessions' = Sessions HOT KEYS strip, 'project-home' = a tool in "
507
- + 'Project Home ▸ Tools, shown in every project (only what it generates is per project).',
587
+ + 'Project Home ▸ Tools, shown in every project (only what it generates is per project), '
588
+ + "'project-video' = this project's own Video tool in Project Home ▸ Video only, beside Demo Video (never in Sessions HOT KEYS, "
589
+ + 'Project Home ▸ Tools, the phone remote or other projects); it carries `job` { estimateMinutes 5-60 (the run budget is 3x, capped at 180 minutes), '
590
+ + 'repoPaths (optional: a committing run that must land a commit under those paths), review (optional: a review stage a human approves first) }.',
591
+ summary: "List this project's saved one-click macros.",
508
592
  whenToUse: 'Use to see what macros already exist for this project (including machine-wide `*` macros and '
509
593
  + 'built-ins) before deciding whether to add, update or delete one.',
510
594
  whenNotToUse: 'WHEN NOT TO USE IT: macros are scoped to the caller\'s own project — this only ever returns '
@@ -517,7 +601,15 @@ const MCP_TOOL_CATALOG = [
517
601
  group: 'macros',
518
602
  purpose: "Create or update one of this project's HOT KEYS macros — a saved (agentName, tag, prompt) "
519
603
  + 'one-click button — via the session-manager app\'s admin API, through the same macroLibrary.cjs store '
520
- + 'the Sessions HOT KEYS strip reads from.',
604
+ + 'the Sessions HOT KEYS strip reads from. `surface` '
605
+ + "'project-video' = this project's own Video tool in Project Home ▸ Video only, beside Demo Video (never in Sessions HOT KEYS, "
606
+ + 'Project Home ▸ Tools, the phone remote or other projects); it carries `job` { estimateMinutes 5-60 (the run budget is 3x, capped at 180 minutes), '
607
+ + 'repoPaths (optional: a committing run that must land a commit under those paths), review (optional: a review stage a human approves first) }. '
608
+ + 'A project-video save always needs `humanRequestQuote`, the human\'s words naming Project Home. '
609
+ + 'A project-video save is refused unless its agentName is a persona file in this project\'s .claude/agents/ or ~/.claude/agents/ '
610
+ + 'and, when that persona lists `tools`, the list includes mcp__session-manager-scheduler__project_video_write '
611
+ + '(plus mcp__session-manager-scheduler__project_video_review_write for a review tool) — the run is a headless job scoped to those tools.',
612
+ summary: 'Create or change a saved one-click macro (agent, mission, prompt).',
521
613
  whenToUse: 'Pass `id` to update an existing macro already visible to this project; omit `id` to create a new '
522
614
  + 'one scoped to this project. Use for things like a "Publish git + npm" macro a human will press '
523
615
  + 'repeatedly, when they have asked for that macro to exist. A surface \'project-home\' macro is a Project Home '
@@ -542,7 +634,8 @@ const MCP_TOOL_CATALOG = [
542
634
  },
543
635
  notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or "
544
636
  + 'process.cwd()) when omitted. label, agentName, tag and prompt are all required strings. '
545
- + "`surface` is optional: 'sessions' = Sessions HOT KEYS strip, 'project-home' = a tool in Project Home ▸ Tools. "
637
+ + "`surface` is optional: 'sessions' = Sessions HOT KEYS strip, 'project-home' = a tool in Project Home ▸ Tools, "
638
+ + "'project-video' = this project's own tool in Project Home ▸ Video (saved for this project only; `projects` is ignored). "
546
639
  + "A surface 'project-home' macro is always saved for every project (only what it generates is per project); it "
547
640
  + 'needs `humanRequestQuote` naming Project Home (or every project) and is refused in a scheduled job or outside '
548
641
  + 'a Session Manager chat session. '
@@ -558,6 +651,7 @@ const MCP_TOOL_CATALOG = [
558
651
  group: 'macros',
559
652
  purpose: "Remove one of this project's HOT KEYS macros via the session-manager app's admin API, through the same "
560
653
  + 'macroLibrary.cjs store the Sessions HOT KEYS strip reads from, so an open strip updates at once.',
654
+ summary: 'Delete one saved macro.',
561
655
  whenToUse: 'Use when the human has asked for that macro to go, for example after its work moved to another project. '
562
656
  + 'Get the `id` from macro_list first.',
563
657
  whenNotToUse: "WHEN NOT TO USE IT: a macro is a HUMAN's one-click button and this cannot be undone — never delete one "
@@ -570,6 +664,83 @@ const MCP_TOOL_CATALOG = [
570
664
  notes: 'Returns { ok, deleted, macro }. `deleted: true` means the macro is gone and `macro` is its last copy. '
571
665
  + '`deleted: false` means other projects still list it, so only this project was dropped. A refusal comes back as an error result.',
572
666
  },
667
+ {
668
+ name: 'epic_list',
669
+ group: 'epics',
670
+ purpose: "Read-only list of one project's open Epics (sessions) via the session-manager app's admin API "
671
+ + '(GET /admin/epics) — the same outside-facing records a script gets: each Epic\'s epicId, title, '
672
+ + 'outside-facing state and PRD progress. Optionally filter by `state`. Results are paginated (default limit 50, '
673
+ + 'max 200) — check `hasMore`/`total` before assuming you received every Epic; page further with `offset`.',
674
+ summary: 'List the open sessions of one project and what state each is in.',
675
+ whenToUse: 'Use to survey which Epics a project has open and which need input, review or approval, before '
676
+ + 'reading one in full with epic_get.',
677
+ whenNotToUse: 'Do not use this to create, approve or change an Epic — it is read-only, and an Epic is only '
678
+ + 'ever created by a human pressing New Epic. Do not use it for PRD status; use scheduler_list_prds.',
679
+ exampleArgs: { cwd: '/home/bilko/Projects/session-manager', state: 'needs_input' },
680
+ notes: 'A partial page carries a `note` naming how many Epics were returned out of `total`.',
681
+ },
682
+ {
683
+ name: 'epic_get',
684
+ group: 'epics',
685
+ purpose: "Read-only fetch of one Epic's outside-facing record via the session-manager app's admin API "
686
+ + '(GET /admin/epic), looked up in project `cwd` by exactly one of `id` (the Epic id) or `externalRef` '
687
+ + '(the reference it was opened with). Returns `{ ok: true, epic }`, or `{ ok: false, error: "not found" }`.',
688
+ summary: 'Read one session by its id or by the outside reference it was opened with.',
689
+ whenToUse: 'Use after epic_list, or when you already hold an Epic id or external reference, to read that '
690
+ + "one Epic's state and progress.",
691
+ whenNotToUse: 'Do not pass both `id` and `externalRef`, or neither — the call is refused without reaching '
692
+ + 'the app. Do not use it to change an Epic; it is read-only.',
693
+ exampleArgs: { cwd: '/home/bilko/Projects/session-manager', id: 'epic-id-from-epic-list' },
694
+ notes: null,
695
+ requiredOneOf: [['id', 'externalRef']],
696
+ },
697
+ {
698
+ name: 'agent_list',
699
+ group: 'agents',
700
+ purpose: "Read-only list of this machine's agent library (personas) via the session-manager app's admin API "
701
+ + '(GET /admin/agents) — the same roster a script gets, sorted by name: each agent\'s name, title, description, '
702
+ + 'model, effort, tags, tools, executorOnly, agentCli and path, never the persona body. With `cwd`, each agent '
703
+ + 'also carries `resolved` { modelId, modelSource, effort, effortSource } for that project, or null when it '
704
+ + 'cannot be resolved.',
705
+ summary: 'List the agents you can launch and the model each one runs on.',
706
+ whenToUse: 'Use to see which agent personas exist and which model and effort each one pins, before naming an '
707
+ + 'agentType in a PRD or a macro. Pass `cwd` to see what each agent resolves to in that project.',
708
+ whenNotToUse: 'Do not use this to create, edit or delete an agent — it is read-only. Do not use it to list '
709
+ + 'saved macros; use macro_list. A `cwd` that is not an absolute path to a project with a '
710
+ + 'session-manager-operations folder is refused.',
711
+ exampleArgs: { cwd: '/home/bilko/Projects/session-manager' },
712
+ notes: 'Returns { ok: true, agents }.',
713
+ },
714
+ {
715
+ name: 'task_list',
716
+ group: 'tasks',
717
+ purpose: "Read-only list of one project's Task ledger via the session-manager app's admin API (GET /admin/tasks) "
718
+ + '— the same rows the Scheduler ▸ Tasks page shows, newest first. A Task is one headless `claude -p` run '
719
+ + 'for the project (run by Session Manager, source "sm", or imported as a direct call, source "direct"). '
720
+ + 'Each row carries taskId, agent, model, effort, caller, status, timings, usage and cost, never prompt or '
721
+ + 'output text.',
722
+ summary: "List a project's Tasks with their status, model and cost.",
723
+ whenToUse: 'Use to audit which Tasks ran in a project, how they ended and what they cost. Filter by '
724
+ + '`since`/`until` (ISO), `pipeline`/`runId`/`step` (the caller), `agent`, `status` or `source`; page with '
725
+ + '`limit` (1-200, default 50) and `offset`.',
726
+ whenNotToUse: 'Do not use this to run or import a Task — it is read-only. Do not use it to read one Task\'s '
727
+ + 'prompt or output; use task_get. A `cwd` that is not an absolute project root is refused.',
728
+ exampleArgs: { cwd: '/home/bilko/Projects/session-manager', status: 'error', limit: 20 },
729
+ notes: 'Returns { ok: true, tasks, total, hasMore }; a partial page adds a `note`.',
730
+ },
731
+ {
732
+ name: 'task_get',
733
+ group: 'tasks',
734
+ purpose: "Read-only fetch of one Task from a project's Task ledger via the session-manager app's admin API "
735
+ + '(GET /admin/task): every task_list field plus prompt, output, stderrTail and envelope (each text capped '
736
+ + 'at 1 MiB, with promptTruncated / outputTruncated flags).',
737
+ summary: 'Read one Task in full, with its prompt and output.',
738
+ whenToUse: 'Use after task_list to see exactly what one Task was asked and what it answered, by its taskId.',
739
+ whenNotToUse: 'Do not use this to run, retry or import a Task — it is read-only. An unknown id answers '
740
+ + '404 unknown_task; a `cwd` that is not an absolute project root is refused.',
741
+ exampleArgs: { cwd: '/home/bilko/Projects/session-manager', id: 'task-abc123' },
742
+ notes: 'Returns { ok: true, task }.',
743
+ },
573
744
  {
574
745
  name: 'session_manager_help',
575
746
  group: 'help',
@@ -578,6 +749,7 @@ const MCP_TOOL_CATALOG = [
578
749
  + "tool's description is composed from, this project's multi-tool recipes, and this machine's "
579
750
  + 'delegation-readiness state (tells apart "not registered", "registered but dead" — the process '
580
751
  + 'won\'t even answer tools/list — and "registered and answering").',
752
+ summary: 'Start here: list every tool, or explain one tool or recipe.',
581
753
  whenToUse: 'Call with no arguments for the full grouped tool list plus recipe titles. Pass `tool` (a tool '
582
754
  + 'name) for that one tool\'s full entry, including its exampleArgs. Pass `topic` (a recipe id) for that '
583
755
  + 'recipe\'s step-by-step instructions. Pass both to get both sections in one call.',
@@ -631,6 +803,19 @@ const MCP_RECIPES = [
631
803
  'Read the result delivery: "delivered", "event-only" or "fallback". Report only that; never say the other project acted. At most 3 replies per thread.',
632
804
  ],
633
805
  },
806
+ {
807
+ id: 'add-project-video-tool',
808
+ title: 'Add a project video tool',
809
+ steps: [
810
+ 'First the persona — a project-video macro_save is refused unless both hold: (1) agentName is a persona file in this project\'s .claude/agents/<name>.md or ~/.claude/agents/<name>.md (project-local resolves first); (2) when that persona lists `tools`, the list includes mcp__session-manager-scheduler__project_video_write, plus mcp__session-manager-scheduler__project_video_review_write for a review tool, because a headless job may call only the MCP tools its persona lists. Write or fix that persona file before macro_save.',
811
+ 'Only when the human asked in this chat for a video tool in Project Home. It shows in this project\'s Project Home ▸ Video only, beside Demo Video — never in Sessions HOT KEYS, Tools, the phone remote or other projects.',
812
+ 'Call macro_save with surface \'project-video\', agentName (that persona), tag, prompt, job { estimateMinutes 5-60 (budget 3x, capped at 180 minutes), repoPaths (optional: a committing run), review (optional: a review stage) } and humanRequestQuote — the human\'s words naming Project Home.',
813
+ 'Each press runs as a scheduled job. The run saves its video with project_video_write (kind e.g. \'episode\'; 9:16 via <meta name="sm-demo-aspect" content="9:16">) using the videoId from the PRD\'s \'Entry id\' line — never a new id.',
814
+ 'A review tool\'s first run calls project_video_review_write (text up to 32000 characters — a whole script fits — plus 1-6 images) and ends. The next run carries \'Review: approved…\' (build the final video) or \'Review: changes requested…\' (redo the review material with that note).',
815
+ 'If an approved final run fails, the owner presses Retry in Project Home ▸ Video; the next run carries the same \'Review: approved by the owner at <time>\' and \'Replace entry: <id>\' lines, so the final stage must start from the approved material (files its review stage committed, or the saved review material), not from the review run\'s context. No agent, script or MCP call can retry.',
816
+ 'A repoPaths run must land a commit under those paths (the saved video entry itself is never committed); without repoPaths the run is artifact-only. Only the human approves, asks for changes or retries — in Project Home ▸ Video; no tool can.',
817
+ ],
818
+ },
634
819
  ];
635
820
 
636
821
  for (const entry of MCP_TOOL_CATALOG) {
@@ -644,7 +829,29 @@ function composeDescription(entry) {
644
829
  return [entry.purpose, entry.whenToUse, entry.whenNotToUse, entry.notes].filter(Boolean).join(' ');
645
830
  }
646
831
 
832
+ // `fixes` input of scheduler_create_prd / each scheduler_create_prds entry
833
+ // (PRD prd-fixes-api-surface). scheduler-mcp-server.cjs puts this exact
834
+ // fragment into its shared create-PRD item schema; the missKind enum is built
835
+ // from MISS_KINDS so it can never drift from the validator's list.
836
+ const FIXES_DESCRIPTION = 'Optional: the earlier PRDs this PRD repairs, each with its miss kind and a one-line reason. '
837
+ + 'Name every PRD whose bug this PRD fixes; one that already had a VERIFIED verdict counts as a validator miss (escape).';
838
+ const FIXES_INPUT_SCHEMA = Object.freeze({
839
+ type: 'array',
840
+ description: FIXES_DESCRIPTION,
841
+ items: {
842
+ type: 'object',
843
+ properties: {
844
+ prd: { type: 'string', description: 'NN-slug or bare slug of the earlier PRD this one repairs.' },
845
+ missKind: { type: 'string', enum: [...MISS_KINDS], description: 'Kind of miss the earlier PRD had.' },
846
+ reason: { type: 'string', description: 'One line: what was wrong with it.' },
847
+ },
848
+ required: ['prd', 'missKind', 'reason'],
849
+ },
850
+ });
851
+
647
852
  module.exports = {
853
+ FIXES_DESCRIPTION,
854
+ FIXES_INPUT_SCHEMA,
648
855
  MCP_TOOL_CATALOG,
649
856
  MCP_RECIPES,
650
857
  CatalogEntrySchema,