claude-code-session-manager 0.142.0 → 0.144.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 (162) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +22 -107
  3. package/dist/assets/AppSettings-Z68gQiVE.js +2 -0
  4. package/dist/assets/{History-DpZuJXi1.js → History-C3E6y_7t.js} +2 -2
  5. package/dist/assets/HomeClaudeConfig-Yd1vXzBn.js +5 -0
  6. package/dist/assets/{Panel-BjdJjhqt.js → Panel-CnfWs46Z.js} +1 -1
  7. package/dist/assets/ProjectClaudeConfig-CP0Wsg-H.js +26 -0
  8. package/dist/assets/Scheduler-D8un7N3B.js +16 -0
  9. package/dist/assets/{SkillReferenceGraph-Cqyu4mef.js → SkillReferenceGraph-DRtZV1Al.js} +1 -1
  10. package/dist/assets/{Skills-vv0noNVI.js → Skills-Bg5O2Hyn.js} +23 -23
  11. package/dist/assets/{TiptapBody-CXi8Pvut.js → TiptapBody-BdzoBmqu.js} +27 -27
  12. package/dist/assets/{Toggle-CiYCWLjh.js → Toggle-Dt5K1OXt.js} +1 -1
  13. package/dist/assets/{VoiceButton-4NKKd1sC.js → VoiceButton-CTLyRgdF.js} +1 -1
  14. package/dist/assets/{historyTotals-DDunb8Ch.js → historyTotals-B2_KWBga.js} +1 -1
  15. package/dist/assets/{index-Cn5E9958.js → index-446b69rr.js} +715 -714
  16. package/dist/assets/{index-DVHIHoJf.css → index-BJ5TJvmz.css} +1 -1
  17. package/dist/index.html +2 -2
  18. package/dist-web/app.css +1 -1
  19. package/dist-web/app.js +438 -435
  20. package/package.json +6 -4
  21. package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
  22. package/plugins/session-manager-dev/skills/builder/SKILL.md +5 -0
  23. package/plugins/session-manager-dev/skills/develop/SKILL.md +23 -16
  24. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +16 -2
  25. package/plugins/session-manager-dev/skills/maintaining-md-network/weekly-consolidation.md +87 -0
  26. package/scripts/README.md +1 -0
  27. package/scripts/scheduler-mcp-server.cjs +381 -6
  28. package/src/main/adminRouteRegistry.cjs +16 -0
  29. package/src/main/agentLibrary.cjs +60 -11
  30. package/src/main/agentsIpc.cjs +19 -0
  31. package/src/main/build-info.json +4 -4
  32. package/src/main/chatRunner.cjs +214 -7
  33. package/src/main/config.cjs +5 -1
  34. package/src/main/health.cjs +92 -14
  35. package/src/main/index.cjs +16 -4
  36. package/src/main/ipcSchemas.cjs +61 -1
  37. package/src/main/lib/claude/agentArmory.cjs +128 -0
  38. package/src/main/lib/claude/agentModelResolve.cjs +3 -2
  39. package/src/main/lib/claude/agentSnapshot.cjs +24 -3
  40. package/src/main/lib/claude/builtinTools.cjs +110 -0
  41. package/src/main/lib/claude/environmentProfiles.cjs +1 -1
  42. package/src/main/lib/claude/headlessMcpServers.cjs +138 -0
  43. package/src/main/lib/claude/jobSandboxPolicy.cjs +8 -2
  44. package/src/main/lib/claude/personaToolScope.cjs +77 -6
  45. package/src/main/lib/demo-video-kit/cast.md +10 -1
  46. package/src/main/lib/demo-video-kit/character.cjs +77 -21
  47. package/src/main/lib/demo-video-kit/kind-tiktok.md +5 -1
  48. package/src/main/lib/demo-video-kit/projectSounds.cjs +191 -0
  49. package/src/main/lib/demo-video-kit/seedKit.cjs +3 -3
  50. package/src/main/lib/demo-video-kit/sound.cjs +166 -9
  51. package/src/main/lib/demo-video-kit/standalone.cjs +231 -0
  52. package/src/main/lib/epic/activeIndexMerge.cjs +5 -0
  53. package/src/main/lib/epic/artifactRetention.cjs +55 -9
  54. package/src/main/lib/epic/artifactStore.cjs +78 -35
  55. package/src/main/lib/epic/delegationReadiness.cjs +10 -3
  56. package/src/main/lib/epic/epicDepsSync.cjs +66 -0
  57. package/src/main/lib/epic/epicEventLog.cjs +45 -1
  58. package/src/main/lib/epic/epicOutsideRead.cjs +38 -1
  59. package/src/main/lib/epic/epicSettle.cjs +48 -4
  60. package/src/main/lib/epic/epicSpawnPlan.cjs +3 -1
  61. package/src/main/lib/epic/epicStateEmitter.cjs +248 -0
  62. package/src/main/lib/epic/epicValidationHook.cjs +22 -3
  63. package/src/main/lib/epic/planReviewInput.cjs +123 -0
  64. package/src/main/lib/epic/restorableSessions.cjs +1 -0
  65. package/src/main/lib/epic/scriptStartedBy.cjs +71 -0
  66. package/src/main/lib/externalContract.cjs +24 -1
  67. package/src/main/lib/feedback-remote/autoStartedSession.cjs +1 -1
  68. package/src/main/lib/feedback-remote/createdProjects.cjs +291 -0
  69. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +24 -2
  70. package/src/main/lib/feedback-remote/crossProjectReply.cjs +96 -8
  71. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +54 -3
  72. package/src/main/lib/feedback-remote/pendingReplies.cjs +22 -0
  73. package/src/main/lib/feedback-remote/projectCreate.cjs +415 -0
  74. package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +94 -4
  75. package/src/main/lib/feedback-remote/replyClaims.cjs +168 -0
  76. package/src/main/lib/feedback-remote/serviceMcpSession.cjs +29 -1
  77. package/src/main/lib/feedback-remote/serviceMcpTools.cjs +43 -2
  78. package/src/main/lib/feedback-remote/servicePairLocalRoutes.cjs +91 -0
  79. package/src/main/lib/feedback-remote/servicePairings.cjs +47 -7
  80. package/src/main/lib/feedback-remote/serviceStdioBridge.cjs +99 -1
  81. package/src/main/lib/git/gitWorktree.cjs +8 -0
  82. package/src/main/lib/git/runtimeStateUntrack.cjs +15 -1
  83. package/src/main/lib/git/worktreeDeps.cjs +119 -10
  84. package/src/main/lib/mcpToolCatalog.cjs +144 -12
  85. package/src/main/lib/mcpToolsProbe.cjs +19 -2
  86. package/src/main/lib/opsOwnership.cjs +113 -28
  87. package/src/main/lib/packs/packCatalog.cjs +98 -5
  88. package/src/main/lib/persona-macro/agentPersonaSchema.cjs +6 -0
  89. package/src/main/lib/persona-macro/builtinMacros.cjs +6 -4
  90. package/src/main/lib/persona-macro/personaFrontmatterSchema.cjs +9 -0
  91. package/src/main/lib/persona-macro/personaLoadout.cjs +58 -0
  92. package/src/main/lib/persona-macro/personaMerge.cjs +11 -3
  93. package/src/main/lib/persona-macro/personaUpgrade.cjs +96 -0
  94. package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +1 -1
  95. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +140 -0
  96. package/src/main/lib/prd/prdCreate.cjs +395 -229
  97. package/src/main/lib/prd/prdCriteria.cjs +7 -4
  98. package/src/main/lib/prd/prdFrontmatter.cjs +5 -2
  99. package/src/main/lib/prd/prdMcpReachWarnings.cjs +44 -0
  100. package/src/main/lib/prd/prdSandboxWarnings.cjs +49 -0
  101. package/src/main/lib/process/peerChatSession.cjs +165 -0
  102. package/src/main/lib/project-pages/videoPressLines.cjs +145 -0
  103. package/src/main/lib/project-pages/videoScriptPress.cjs +266 -0
  104. package/src/main/lib/project-pages/videoScriptRunRoute.cjs +371 -0
  105. package/src/main/lib/project-pages/videoScriptSwitchIpc.cjs +49 -0
  106. package/src/main/lib/project-pages/videoScriptSwitchRoute.cjs +173 -0
  107. package/src/main/lib/promptSessionSchema.cjs +2 -0
  108. package/src/main/lib/scheduler/baselineGate.cjs +31 -2
  109. package/src/main/lib/scheduler/criteriaChecks.cjs +164 -20
  110. package/src/main/lib/scheduler/heldSchedulerTurns.cjs +238 -0
  111. package/src/main/lib/scheduler/jobMemoryStats.cjs +13 -2
  112. package/src/main/lib/scheduler/planRecordHarvest.cjs +215 -55
  113. package/src/main/lib/scheduler/planReleaseRoute.cjs +110 -0
  114. package/src/main/lib/scheduler/planReviewSchema.cjs +182 -0
  115. package/src/main/lib/scheduler/planReviewStats.cjs +63 -0
  116. package/src/main/lib/scheduler/planReviewStore.cjs +128 -0
  117. package/src/main/lib/scheduler/prdOutcomeRecord.cjs +60 -2
  118. package/src/main/lib/scheduler/queueStore.cjs +16 -0
  119. package/src/main/lib/scheduler/rcaReport.cjs +79 -15
  120. package/src/main/lib/scheduler/sandboxEnvironmentLimit.cjs +141 -0
  121. package/src/main/lib/scheduler/scheduleJobSchema.cjs +15 -0
  122. package/src/main/lib/scheduler/schedulerPaths.cjs +9 -0
  123. package/src/main/lib/scheduler/slotsRoute.cjs +101 -87
  124. package/src/main/lib/scheduler/upgradeDrain.cjs +32 -5
  125. package/src/main/lib/scheduler/usageHoldRoute.cjs +97 -0
  126. package/src/main/lib/scheduler/validatorVerdictSchema.cjs +28 -7
  127. package/src/main/lib/tasks/memoryConsolidation.cjs +123 -39
  128. package/src/main/lib/tasks/mitigationReview.cjs +21 -1
  129. package/src/main/lib/tasks/taskAdminRoutes.cjs +104 -17
  130. package/src/main/lib/tasks/taskLedger.cjs +2 -2
  131. package/src/main/lib/tasks/taskRun.cjs +3 -1
  132. package/src/main/lib/tasks/weeklyConsolidationInputs.cjs +178 -0
  133. package/src/main/lib/telemetry/auditEvents.cjs +21 -24
  134. package/src/main/lib/telemetry/auditLog.cjs +6 -2
  135. package/src/main/lib/util/atomicFs.cjs +2 -2
  136. package/src/main/projectPages.cjs +22 -14
  137. package/src/main/promptSessionEvents.cjs +16 -1
  138. package/src/main/pty.cjs +14 -2
  139. package/src/main/queueOps.cjs +1 -1
  140. package/src/main/runVerify.cjs +4 -3
  141. package/src/main/scheduler/planReviewHold.cjs +140 -0
  142. package/src/main/scheduler/prdParser.cjs +1 -0
  143. package/src/main/scheduler/reviewLadder.cjs +2 -0
  144. package/src/main/scheduler/utilizationHold.cjs +101 -6
  145. package/src/main/scheduler.cjs +1055 -107
  146. package/src/main/seedAgentPersonas.cjs +11 -6
  147. package/src/main/seedStatus.cjs +1 -1
  148. package/src/main/templates/PRD_AUTHORING.md +22 -2
  149. package/src/main/webRemote.cjs +47 -7
  150. package/src/preload/api.d.ts +118 -2
  151. package/src/preload/apiSurface.json +42 -0
  152. package/src/preload/index.cjs +11 -0
  153. package/src/seed/agents/architect.md +28 -43
  154. package/src/seed/agents/demo-video-builder.md +15 -8
  155. package/src/seed/agents/dev-lead.md +3 -1
  156. package/src/seed/agents/md-network-curator.md +27 -0
  157. package/src/seed/agents/plan-reviewer.md +47 -0
  158. package/src/seed/agents/validator.md +21 -19
  159. package/dist/assets/AppSettings-BcZgIvvY.js +0 -2
  160. package/dist/assets/HomeClaudeConfig-D32ZJtU-.js +0 -3
  161. package/dist/assets/ProjectClaudeConfig-BTClYV6i.js +0 -26
  162. package/dist/assets/Scheduler-DPobKx1Z.js +0 -16
@@ -49,8 +49,10 @@
49
49
  * task_list({ cwd, since?, until?, pipeline?, runId?, step?, agent?, status?, source?, limit?, offset? }) -> GET /admin/tasks?cwd=<encoded>&...
50
50
  * task_get({ cwd, id, after? }) -> GET /admin/task?cwd=<encoded>&id=<encoded>[&after=<n>]
51
51
  * task_switch_set({ enabled, humanRequestQuote, cwd? }) -> POST /admin/tasks/switch
52
+ * video_script_switch_set({ enabled, humanRequestQuote, cwd? }) -> POST /admin/project-home/videos/script-switch
52
53
  * scheduler_slots_get() -> GET /admin/scheduler/slots
53
54
  * scheduler_slots_set({ cap, quote }) -> POST /admin/scheduler/slots
55
+ * usage_hold_get() -> GET /admin/usage-hold
54
56
  *
55
57
  * This is a separate process from the Electron app — it only ever reaches
56
58
  * it over the token-authed loopback HTTP API in admin-api.json, never by
@@ -76,8 +78,11 @@ const { MCP_TOOL_CATALOG, MCP_RECIPES, composeDescription, FIXES_INPUT_SCHEMA }
76
78
  const {
77
79
  FEEDBACK_LIST_PROJECTS_INPUT_SCHEMA, FEEDBACK_OPEN_SESSION_INPUT_SCHEMA, MACRO_LIST_INPUT_SCHEMA, EPIC_GET_INPUT_SCHEMA,
78
80
  } = require('../src/main/lib/feedback-remote/serviceMcpTools.cjs');
81
+ const { SERVICE_TOOL_NAMES } = require('../src/main/lib/feedback-remote/servicePairings.cjs');
79
82
  const { EPIC_OUTSIDE_STATES } = require('../src/main/lib/epic/epicOutsideState.cjs');
83
+ const { KINDS: ARTIFACT_KINDS } = require('../src/main/lib/epic/artifactStore.cjs');
80
84
  const { REVIEW_TEXT_MAX, REVIEW_IMAGES_MAX, REVIEW_IMAGE_BYTES_MAX } = require('../src/main/lib/project-pages/videoReview.cjs');
85
+ const { SOUND_NAME_RE, MAX_BED_WAV_BYTES, MAX_SOUNDS_TOTAL_BYTES } = require('../src/main/lib/demo-video-kit/projectSounds.cjs');
81
86
 
82
87
  const CATALOG_BY_NAME = new Map(MCP_TOOL_CATALOG.map((entry) => [entry.name, entry]));
83
88
 
@@ -89,6 +94,9 @@ function descriptionFor(toolName) {
89
94
 
90
95
  const { adminTokenPath } = require('../src/main/lib/scheduler/schedulerPaths.cjs');
91
96
  const { normalizePreflight } = require('../src/main/lib/scheduler/preflightCheck.cjs');
97
+ const {
98
+ findUnfilledPlaceholders, findSessionManagerVersions, normalizeReleaseClaim, isSessionManagerRepo, checkReleaseContains,
99
+ } = require('../src/main/lib/feedback-remote/replyClaims.cjs');
92
100
 
93
101
  // Defined once so every failure path points to the same next call, verbatim
94
102
  // — never paste this sentence at each return site (PRD: session_manager_help).
@@ -164,6 +172,44 @@ async function resolveVideoExports(args) {
164
172
  return { exports: { mp4Base64: mp4.base64, posterBase64: poster.base64 } };
165
173
  }
166
174
 
175
+ /**
176
+ * Reads one project_character_write soundPaths file into { buf } or { error }.
177
+ * Errors name soundPaths.<name>, never file contents. The per-file cap is the
178
+ * bed cap; the route re-checks an effect against its smaller cap.
179
+ */
180
+ async function readSoundFile(p, name) {
181
+ const argName = `soundPaths.${name}`;
182
+ if (typeof p !== 'string' || !path.isAbsolute(p)) return { error: `${argName} must be an absolute path` };
183
+ if (!p.toLowerCase().endsWith('.wav')) return { error: `${argName} must end in .wav` };
184
+ try {
185
+ const st = await fsp.stat(p);
186
+ if (!st.isFile()) return { error: `${argName} is not a regular file` };
187
+ if (st.size === 0) return { error: `${argName} file is empty` };
188
+ if (st.size > MAX_BED_WAV_BYTES) return { error: `${argName} file exceeds ${MAX_BED_WAV_BYTES} bytes` };
189
+ return { buf: await fsp.readFile(p) };
190
+ } catch (err) {
191
+ return { error: `cannot read ${argName}: ${err && err.code ? err.code : 'read failed'}` };
192
+ }
193
+ }
194
+
195
+ /** Resolves soundPaths into { sounds: { name: base64 } } or { error }. */
196
+ async function resolveSoundPaths(soundPaths) {
197
+ if (!soundPaths || typeof soundPaths !== 'object' || Array.isArray(soundPaths)) {
198
+ return { error: 'soundPaths must be an object of { sound name: absolute .wav path }' };
199
+ }
200
+ const sounds = {};
201
+ let total = 0;
202
+ for (const [name, p] of Object.entries(soundPaths)) {
203
+ if (!SOUND_NAME_RE.test(name)) return { error: `soundPaths key "${name}" is not a sound name (${SOUND_NAME_RE})` };
204
+ const loaded = await readSoundFile(p, name);
205
+ if (loaded.error) return { error: loaded.error };
206
+ total += loaded.buf.length;
207
+ if (total > MAX_SOUNDS_TOTAL_BYTES) return { error: `soundPaths files exceed ${MAX_SOUNDS_TOTAL_BYTES} bytes in all` };
208
+ sounds[name] = loaded.buf.toString('base64');
209
+ }
210
+ return { sounds };
211
+ }
212
+
167
213
  /** Reads a local .js file for project_character_write; errors carry only the reason, never file contents. */
168
214
  async function readCharacterJsFile(p) {
169
215
  if (typeof p !== 'string' || !path.isAbsolute(p)) return { error: 'jsPath must be an absolute path' };
@@ -275,6 +321,40 @@ function errorResult(text) {
275
321
  return { content: [{ type: 'text', text: withPointer(text) }], isError: true };
276
322
  }
277
323
 
324
+ const ZOD_ISSUE_LINE_MAX = 20;
325
+
326
+ // Renders a zod issue path as a field path: ['fixes', 0, 'reason'] -> 'fixes[0].reason'.
327
+ function zodFieldPath(segs) {
328
+ let out = '';
329
+ for (const seg of segs) {
330
+ if (typeof seg === 'number') out += `[${seg}]`;
331
+ else out += (out ? '.' : '') + String(seg);
332
+ }
333
+ return out || '(root)';
334
+ }
335
+
336
+ // One line per zod issue from an admin route's `details` (capped, '+N more').
337
+ // Batch mode (prds = the caller's entries): a path ['prds', i, ...rest] names
338
+ // entry i and its slug; any other path prints under [-1] with its full path.
339
+ // Single mode (prds = null): '- <field path>: <message>'. Returns null when
340
+ // details is not an array of issues with a path, so callers keep today's text.
341
+ function formatZodIssueLines(details, prds) {
342
+ if (!Array.isArray(details)) return null;
343
+ const issues = details.filter((d) => d && typeof d === 'object' && Array.isArray(d.path));
344
+ if (issues.length === 0) return null;
345
+ const lines = issues.slice(0, ZOD_ISSUE_LINE_MAX).map((issue) => {
346
+ const msg = issue.message ?? 'invalid';
347
+ if (!prds) return `- ${zodFieldPath(issue.path)}: ${msg}`;
348
+ const [head, idx, ...rest] = issue.path;
349
+ if (head === 'prds' && Number.isInteger(idx)) {
350
+ return `- [${idx}] ${prds[idx]?.slug ?? '(no slug)'}: ${zodFieldPath(rest)}: ${msg}`;
351
+ }
352
+ return `- [-1] (no slug): ${zodFieldPath(issue.path)}: ${msg}`;
353
+ });
354
+ if (issues.length > ZOD_ISSUE_LINE_MAX) lines.push(`+${issues.length - ZOD_ISSUE_LINE_MAX} more`);
355
+ return lines;
356
+ }
357
+
278
358
  const NOT_RUNNING_ERROR =
279
359
  `session-manager app is not running (admin API unreachable) — start it first${HELP_POINTER}`;
280
360
 
@@ -474,7 +554,7 @@ const ACCEPTANCE_CRITERION_ITEM_SCHEMA = {
474
554
  kind: { type: 'string', enum: ['command', 'file', 'http', 'manual'] },
475
555
  spec: {
476
556
  description: 'command: one gate-syntax command string. file: repo-relative path, or { path, contains? }. '
477
- + 'http: loopback URL (localhost/127.0.0.1/[::1]), or { url, status? } (status defaults to 200). manual: optional guidance string.',
557
+ + 'http: loopback URL (localhost/127.0.0.1/[::1]), or { url, status?, contains? } (status defaults to 200; contains is body text that must appear in the response). manual: optional guidance string.',
478
558
  },
479
559
  },
480
560
  required: ['kind'],
@@ -614,6 +694,30 @@ const TOOLS = [
614
694
  required: ['prds'],
615
695
  },
616
696
  },
697
+ {
698
+ name: 'scheduler_release_plan',
699
+ description: descriptionFor('scheduler_release_plan'),
700
+ inputSchema: {
701
+ type: 'object',
702
+ properties: {
703
+ epicId: { type: 'string', description: 'The Epic id the plan belongs to.' },
704
+ validateSlug: { type: 'string', description: "The plan's validate PRD slug." },
705
+ accepted: { type: 'number', description: 'How many review findings you accepted.' },
706
+ rejected: {
707
+ type: 'array',
708
+ description: 'Each rejected finding with a one-line reason (reason must be non-empty).',
709
+ items: {
710
+ type: 'object',
711
+ properties: { finding: { type: 'string' }, reason: { type: 'string' } },
712
+ required: ['finding', 'reason'],
713
+ },
714
+ },
715
+ rereview: { type: 'boolean', description: 'Instead of releasing, request the single re-review after a block (once per plan).' },
716
+ cwd: { type: 'string', description: 'Optional: project cwd; defaults to this process cwd.' },
717
+ },
718
+ required: ['epicId', 'validateSlug'],
719
+ },
720
+ },
617
721
  {
618
722
  name: 'scheduler_list_prds',
619
723
  description: descriptionFor('scheduler_list_prds'),
@@ -700,11 +804,29 @@ const TOOLS = [
700
804
  required: ['enabled', 'humanRequestQuote'],
701
805
  },
702
806
  },
807
+ {
808
+ name: 'video_script_switch_set',
809
+ description: descriptionFor('video_script_switch_set'),
810
+ inputSchema: {
811
+ type: 'object',
812
+ properties: {
813
+ enabled: { type: 'boolean', description: "true turns 'Scripts may run Demo Video' on, false turns it off" },
814
+ humanRequestQuote: { type: 'string', description: "The human's words from this chat asking for the change, verbatim" },
815
+ cwd: { type: 'string', description: "Optional: absolute project root whose switch to set; defaults to this session's project" },
816
+ },
817
+ required: ['enabled', 'humanRequestQuote'],
818
+ },
819
+ },
703
820
  {
704
821
  name: 'scheduler_slots_get',
705
822
  description: descriptionFor('scheduler_slots_get'),
706
823
  inputSchema: { type: 'object', properties: {} },
707
824
  },
825
+ {
826
+ name: 'usage_hold_get',
827
+ description: descriptionFor('usage_hold_get'),
828
+ inputSchema: { type: 'object', properties: {} },
829
+ },
708
830
  {
709
831
  name: 'scheduler_slots_set',
710
832
  description: descriptionFor('scheduler_slots_set'),
@@ -712,7 +834,7 @@ const TOOLS = [
712
834
  type: 'object',
713
835
  properties: {
714
836
  cap: { type: 'integer', description: 'The new machine-wide limit on parallel claude sessions (an integer between the min and max scheduler_slots_get reports)' },
715
- quote: { type: 'string', description: "The human's own words from this session naming the limit and this number, quoted verbatim" },
837
+ quote: { type: 'string', description: "The human's own words from this session, quoted verbatim; one sentence must be exactly the accepted form, e.g. 'raise the limit to 14'" },
716
838
  },
717
839
  required: ['cap', 'quote'],
718
840
  },
@@ -802,6 +924,27 @@ const TOOLS = [
802
924
  required: ['slug'],
803
925
  },
804
926
  },
927
+ {
928
+ name: 'scheduler_dismiss_cancelled',
929
+ description: descriptionFor('scheduler_dismiss_cancelled'),
930
+ inputSchema: {
931
+ type: 'object',
932
+ properties: {
933
+ slug: { type: 'string', description: 'PRD slug of the cancelled row to dismiss' },
934
+ cwd: { type: 'string', description: 'Optional: the PRD project cwd, narrows/speeds the search' },
935
+ dependents: {
936
+ type: 'object',
937
+ description: 'Required when the row has pending dependents (the dismiss is refused and lists them otherwise): "cascade" cancels them too, "repoint" makes them depend on `to` instead, "clear" drops the dependency.',
938
+ properties: {
939
+ action: { type: 'string', enum: ['cascade', 'repoint', 'clear'] },
940
+ to: { type: 'string', description: 'PRD slug the dependents should depend on instead — required for action "repoint"' },
941
+ },
942
+ required: ['action'],
943
+ },
944
+ },
945
+ required: ['slug'],
946
+ },
947
+ },
805
948
  {
806
949
  name: 'scheduler_retag_prd',
807
950
  description: descriptionFor('scheduler_retag_prd'),
@@ -847,6 +990,25 @@ const TOOLS = [
847
990
  description: descriptionFor('feedback_open_session'),
848
991
  inputSchema: FEEDBACK_OPEN_SESSION_INPUT_SCHEMA,
849
992
  },
993
+ {
994
+ name: 'service_pair_local',
995
+ description: descriptionFor('service_pair_local'),
996
+ inputSchema: {
997
+ type: 'object',
998
+ properties: {
999
+ stateDir: { type: 'string', description: 'Absolute path of the directory where the service keeps its pairing state.' },
1000
+ name: { type: 'string', description: 'Display name of the service.' },
1001
+ homeCwd: { type: 'string', description: 'Absolute path of the service\'s home project.' },
1002
+ tools: {
1003
+ type: 'array', minItems: 1,
1004
+ items: { type: 'string', enum: [...SERVICE_TOOL_NAMES] },
1005
+ description: 'The Session Manager tools the service may call.',
1006
+ },
1007
+ projectRoot: { type: 'string', description: 'Optional: the service\'s project root.' },
1008
+ },
1009
+ required: ['stateDir', 'name', 'homeCwd', 'tools'],
1010
+ },
1011
+ },
850
1012
  {
851
1013
  name: 'feedback_reply',
852
1014
  description: descriptionFor('feedback_reply'),
@@ -870,6 +1032,16 @@ const TOOLS = [
870
1032
  description: 'Optional: hold this reply until Session Manager runs a version above appVersionAbove (give the version running now); '
871
1033
  + 'it then sends itself, even after this Epic closes; `{version}` in the message becomes that version.',
872
1034
  },
1035
+ release: {
1036
+ type: 'object',
1037
+ properties: {
1038
+ commits: { type: 'array', items: { type: 'string' }, description: 'Commit hashes (7-40 hex) the reply says shipped.' },
1039
+ },
1040
+ required: ['commits'],
1041
+ additionalProperties: false,
1042
+ description: 'Required for a Session Manager release claim: the commits must be in the running Session Manager release '
1043
+ + '(tag v<running version>); `{version}` in a live reply becomes that version.',
1044
+ },
873
1045
  },
874
1046
  required: ['message', 'outcome'],
875
1047
  },
@@ -897,6 +1069,11 @@ const TOOLS = [
897
1069
  js: { type: 'string', description: 'The character drawing module source (<= 300KB; no remote references or network-capable APIs). Give exactly one of js / jsPath.' },
898
1070
  jsPath: { type: 'string', description: 'Absolute path to a local .js file holding the module (same rules as js; <= 300KB). Give exactly one of js / jsPath.' },
899
1071
  replace: { type: 'boolean', description: 'Overwrite an existing character. Without it an existing character is refused with 409.' },
1072
+ soundPaths: {
1073
+ type: 'object',
1074
+ additionalProperties: { type: 'string' },
1075
+ description: 'Optional: one absolute local .wav path per file-backed sound the json declares (every sounds.sfx name, and every sounds.beds name without a command), keyed by sound name, e.g. {"bark": "/tmp/sounds/bark.wav"}. Read and sent by this server: a sound effect <= 1 MiB, a bed <= 12 MiB, 32 MiB in all.',
1076
+ },
900
1077
  },
901
1078
  required: ['json'],
902
1079
  },
@@ -948,7 +1125,12 @@ const TOOLS = [
948
1125
  properties: {
949
1126
  path: { type: 'string', description: 'Path of the file to publish: absolute (worktree, project or /tmp), or relative to your Epic worktree.' },
950
1127
  title: { type: 'string', description: 'Optional: human label shown in File Explorer > Artifacts.' },
951
- kind: { type: 'string', description: 'Optional: file kind hint (e.g. image, audio, video, report).' },
1128
+ // Derived from the store so the schema cannot drift from what it accepts.
1129
+ kind: {
1130
+ type: 'string',
1131
+ enum: [...ARTIFACT_KINDS],
1132
+ description: `Optional: one of ${ARTIFACT_KINDS.join(', ')}; omit to infer it from the file extension. A report is doc.`,
1133
+ },
952
1134
  },
953
1135
  required: ['path'],
954
1136
  },
@@ -1412,7 +1594,8 @@ function siteErrorText(result, fallback, cwd) {
1412
1594
  // A switch only the human flips (the Tasks switch, the session slot limit): a
1413
1595
  // scheduled job, a Task or any other internal headless run (SM_KG_INTERNAL=1),
1414
1596
  // or a process outside a chat session, is refused before any request. One
1415
- // helper so task_switch_set and scheduler_slots_set can never drift apart.
1597
+ // helper so task_switch_set, video_script_switch_set and scheduler_slots_set
1598
+ // can never drift apart.
1416
1599
  function humanSwitchRefusal(message) {
1417
1600
  if (process.env.SM_KG_INTERNAL === '1') return errorResult(message);
1418
1601
  return humanSessionRefusal(message);
@@ -1423,6 +1606,11 @@ function taskSwitchSetRefusal() {
1423
1606
  + 'say in your final result what the human should switch on Scheduler → Tasks.');
1424
1607
  }
1425
1608
 
1609
+ function videoScriptSwitchSetRefusal() {
1610
+ return humanSwitchRefusal('refused: video_script_switch_set runs only in a Session Manager chat or terminal session where the human asked for it; '
1611
+ + "say in your final result that the human should turn on 'Scripts may run Demo Video' in Project Home > Video.");
1612
+ }
1613
+
1426
1614
  function slotsSetRefusal() {
1427
1615
  return humanSwitchRefusal('refused: scheduler_slots_set runs only in a Session Manager chat or terminal session where the human asked for the new limit; '
1428
1616
  + 'say in your final result what limit the human should set.');
@@ -1491,6 +1679,92 @@ async function preflightAppRefusal(expected) {
1491
1679
  + "Restart Session Manager into a newer build (Command Palette: 'Reboot app (drain first)') and call again.";
1492
1680
  }
1493
1681
 
1682
+ // First app release whose POST /admin/feedback/reply knows deliverWhen (held
1683
+ // replies, 58b70bc2). An older app ignores the key and delivers at once with
1684
+ // {version} unfilled, spending a reply slot (seen live 2026-11-24 on 0.141.0).
1685
+ const HELD_REPLY_MIN_APP_VERSION = '0.142.0';
1686
+
1687
+ // Refuses (returns an error line) when a feedback_reply carries deliverWhen but
1688
+ // the running app is older than HELD_REPLY_MIN_APP_VERSION or reports no
1689
+ // version. A missing admin-api.json returns null so adminRequest reports "not running".
1690
+ // Last app release whose held replies key on version only and ignore
1691
+ // release.commits, so a held commit-gated reply would go out unchecked.
1692
+ const COMMIT_GATED_HOLD_AFTER_APP_VERSION = '0.142.0';
1693
+
1694
+ function runningAppVersion(cfg) {
1695
+ return cfg && typeof cfg.appVersion === 'string' && cfg.appVersion ? cfg.appVersion : null;
1696
+ }
1697
+
1698
+ // Applies the replyClaims rules to a feedback_reply before any request.
1699
+ // Returns { refusal } or { message } (the message to forward).
1700
+ async function feedbackReplyClaimCheck(args, held) {
1701
+ const refuse = (text) => ({ refusal: `refused: ${text}` });
1702
+ const { message } = args;
1703
+ const hasRelease = args.release !== undefined && args.release !== null;
1704
+ const unfilled = findUnfilledPlaceholders(message, { allowVersionToken: held || hasRelease });
1705
+ if (unfilled.length) {
1706
+ return refuse(`the message has unfilled placeholder(s) ${unfilled.join(', ')}. Write the real value, `
1707
+ + 'or use {version} only with deliverWhen or release so it is filled for you.');
1708
+ }
1709
+ let claim = null;
1710
+ if (hasRelease) {
1711
+ const norm = normalizeReleaseClaim(args.release);
1712
+ if (!norm.ok) return refuse(`${norm.error}.`);
1713
+ claim = norm.value;
1714
+ }
1715
+ const projectRoot = process.env.SM_PROJECT_ROOT || process.cwd();
1716
+ const smRepo = isSessionManagerRepo(projectRoot);
1717
+ if (claim && !smRepo) {
1718
+ return refuse(`release is for Session Manager release claims, but ${projectRoot} is not the Session Manager repo. `
1719
+ + 'Send the reply without release and write your own version by hand.');
1720
+ }
1721
+ if (!claim && smRepo && args.outcome === 'done') {
1722
+ const named = findSessionManagerVersions(message);
1723
+ if (named.length || message.includes('{version}')) {
1724
+ return refuse(`this done reply claims a Session Manager release (${named.length ? named.join(', ') : '{version}'}) `
1725
+ + 'without release.commits, so nothing checks it. Add release: { commits: [...] } naming the commits that shipped.');
1726
+ }
1727
+ }
1728
+ if (!claim) return { message };
1729
+ let cfg = null;
1730
+ try { cfg = await readAdminConfig(); } catch { cfg = null; }
1731
+ const appVersion = runningAppVersion(cfg);
1732
+ if (held) {
1733
+ const cmp = appVersion ? compareVersions(appVersion, COMMIT_GATED_HOLD_AFTER_APP_VERSION) : NaN;
1734
+ if (cmp > 0) return { message };
1735
+ return refuse(`the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) holds replies by version only `
1736
+ + 'and would ignore release.commits, so the held reply could go out naming a release without them. '
1737
+ + 'Send it live with release.commits once the release that contains them runs.');
1738
+ }
1739
+ if (!appVersion) {
1740
+ return refuse('the running Session Manager app reports no version, so release.commits cannot be checked against its release. '
1741
+ + 'Restart Session Manager into a current build and call again.');
1742
+ }
1743
+ const check = await checkReleaseContains({ repoCwd: projectRoot, version: appVersion, commits: claim.commits });
1744
+ if (!check.ok) {
1745
+ return refuse(`the running Session Manager release v${appVersion} does not hold this claim: ${check.error}. `
1746
+ + 'Send the reply once the release that contains the commits runs.');
1747
+ }
1748
+ const other = findSessionManagerVersions(message).filter((v) => v !== appVersion);
1749
+ if (other.length) {
1750
+ return refuse(`the message names Session Manager ${other.join(', ')}, but the running release is v${appVersion}. `
1751
+ + 'Write {version} (filled with the running version) or the running version itself.');
1752
+ }
1753
+ return { message: message.split('{version}').join(appVersion) };
1754
+ }
1755
+
1756
+ async function heldReplyAppRefusal(deliverWhen) {
1757
+ if (deliverWhen === undefined || deliverWhen === null) return null;
1758
+ let cfg;
1759
+ try { cfg = await readAdminConfig(); } catch { return null; }
1760
+ const appVersion = typeof cfg.appVersion === 'string' && cfg.appVersion ? cfg.appVersion : null;
1761
+ const cmp = appVersion ? compareVersions(appVersion, HELD_REPLY_MIN_APP_VERSION) : NaN;
1762
+ if (cmp >= 0) return null;
1763
+ return `refused: the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) predates held replies `
1764
+ + `and would ignore deliverWhen: it would deliver the reply at once with {version} unfilled and spend one of the thread's replies. `
1765
+ + `Send it after the app runs v${HELD_REPLY_MIN_APP_VERSION} or later, or send it now without deliverWhen with the version written by hand.`;
1766
+ }
1767
+
1494
1768
  // Adds originClaudeSessionId (SM_CHAT_SESSION_ID fallback when sourcePromptId
1495
1769
  // is absent) and originProjectRoot (SM_PROJECT_ROOT hint) to a create payload.
1496
1770
  function withCreateOrigin(payload) {
@@ -1622,11 +1896,35 @@ async function handleCallTool(request) {
1622
1896
  if (result?.ok === false) return errorResult(adminErrorText(result, 'task_switch_set failed'));
1623
1897
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1624
1898
  }
1899
+ if (name === 'video_script_switch_set') {
1900
+ const refusal = videoScriptSwitchSetRefusal();
1901
+ if (refusal) return refusal;
1902
+ if (typeof args?.enabled !== 'boolean') return errorResult('missing or invalid required argument: enabled (boolean)');
1903
+ if (typeof args?.humanRequestQuote !== 'string' || args.humanRequestQuote.trim() === '') {
1904
+ return errorResult('missing or invalid required argument: humanRequestQuote (the human\'s words, verbatim)');
1905
+ }
1906
+ // Identity comes from this process's env only, exactly as task_switch_set.
1907
+ const payload = {
1908
+ enabled: args.enabled,
1909
+ humanRequestQuote: args.humanRequestQuote,
1910
+ originClaudeSessionId: process.env.SM_CHAT_SESSION_ID,
1911
+ };
1912
+ if (process.env.SM_PROJECT_ROOT) payload.originProjectRoot = process.env.SM_PROJECT_ROOT;
1913
+ if (typeof args.cwd === 'string') payload.cwd = args.cwd;
1914
+ const result = await adminRequest('POST', '/admin/project-home/videos/script-switch', payload);
1915
+ if (result?.ok === false) return errorResult(adminErrorText(result, 'video_script_switch_set failed'));
1916
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1917
+ }
1625
1918
  if (name === 'scheduler_slots_get') {
1626
1919
  const result = await adminRequest('GET', '/admin/scheduler/slots');
1627
1920
  if (result?.ok === false) return errorResult(adminErrorText(result, 'scheduler_slots_get failed'));
1628
1921
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1629
1922
  }
1923
+ if (name === 'usage_hold_get') {
1924
+ const result = await adminRequest('GET', '/admin/usage-hold');
1925
+ if (result?.ok === false) return errorResult(adminErrorText(result, 'usage_hold_get failed'));
1926
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1927
+ }
1630
1928
  if (name === 'scheduler_slots_set') {
1631
1929
  const refusal = slotsSetRefusal();
1632
1930
  if (refusal) return refusal;
@@ -1697,6 +1995,17 @@ async function handleCallTool(request) {
1697
1995
  const result = await adminRequest('POST', '/admin/scheduler/cancel-job', { slug, cwd, dependents });
1698
1996
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1699
1997
  }
1998
+ if (name === 'scheduler_dismiss_cancelled') {
1999
+ const slug = args && typeof args.slug === 'string' ? args.slug : null;
2000
+ if (!slug) {
2001
+ return errorResult('missing required argument: slug');
2002
+ }
2003
+ const cwd = args && typeof args.cwd === 'string' ? args.cwd : undefined;
2004
+ // Same body as cancel-job (schemas.adminCancelJob); the route validates dependents.
2005
+ const dependents = args && args.dependents && typeof args.dependents === 'object' ? args.dependents : undefined;
2006
+ const result = await adminRequest('POST', '/admin/scheduler/dismiss-cancelled', { slug, cwd, dependents });
2007
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
2008
+ }
1700
2009
  if (name === 'scheduler_retag_prd') {
1701
2010
  const items = Array.isArray(args?.items) ? args.items : null;
1702
2011
  if (!items || items.length === 0) {
@@ -1756,6 +2065,12 @@ async function handleCallTool(request) {
1756
2065
  if (Array.isArray(result?.files)) {
1757
2066
  text += `\nFiles: ${result.files.join(', ')}`;
1758
2067
  }
2068
+ const issueLines = result?.ok === false ? formatZodIssueLines(result.details, null) : null;
2069
+ if (issueLines) {
2070
+ text += `\nFix these fields and call again:\n${issueLines.join('\n')}`;
2071
+ }
2072
+ // A refusal wrote nothing: return it as an error like scheduler_create_prds does.
2073
+ if (result?.ok === false) return errorResult(text);
1759
2074
  return { content: [{ type: 'text', text }] };
1760
2075
  }
1761
2076
  if (name === 'scheduler_create_prds') {
@@ -1780,7 +2095,8 @@ async function handleCallTool(request) {
1780
2095
  const result = await adminRequest('POST', '/admin/scheduler/create-prds', payload);
1781
2096
  if (result?.ok === false) {
1782
2097
  const errs = Array.isArray(result.errors) ? result.errors : [{ index: -1, slug: null, error: result.error ?? 'batch refused' }];
1783
- const lines = errs.map((e) => `- [${e.index}] ${e.slug ?? '(no slug)'}: ${e.error}`);
2098
+ const lines = (!Array.isArray(result.errors) && formatZodIssueLines(result.details, prds))
2099
+ || errs.map((e) => `- [${e.index}] ${e.slug ?? '(no slug)'}: ${e.error}`);
1784
2100
  return errorResult(`scheduler_create_prds refused the batch — nothing was written (all-or-nothing). Fix every entry below and call again:\n${lines.join('\n')}`);
1785
2101
  }
1786
2102
  const written = Array.isArray(result?.prds) ? result.prds : [];
@@ -1801,6 +2117,21 @@ async function handleCallTool(request) {
1801
2117
  }
1802
2118
  return { content: [{ type: 'text', text }] };
1803
2119
  }
2120
+ if (name === 'scheduler_release_plan') {
2121
+ const refusal = headlessQueueRefusal('scheduler_release_plan');
2122
+ if (refusal) return refusal;
2123
+ const body = {
2124
+ cwd: typeof args?.cwd === 'string' && args.cwd ? args.cwd : process.cwd(),
2125
+ epicId: args?.epicId,
2126
+ validateSlug: args?.validateSlug,
2127
+ rejected: Array.isArray(args?.rejected) ? args.rejected : [],
2128
+ accepted: typeof args?.accepted === 'number' ? args.accepted : 0,
2129
+ ...(args?.rereview === true ? { rereview: true } : {}),
2130
+ };
2131
+ const result = await adminRequest('POST', '/admin/scheduler/release-plan', body);
2132
+ if (result?.ok === false) return errorResult(`scheduler_release_plan refused: ${result.reason ?? result.error ?? JSON.stringify(result)}`);
2133
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
2134
+ }
1804
2135
  if (name === 'feedback_list_projects') {
1805
2136
  const result = await adminRequest('GET', '/admin/feedback/targets');
1806
2137
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
@@ -1851,6 +2182,22 @@ async function handleCallTool(request) {
1851
2182
  }
1852
2183
  return { content: [{ type: 'text', text: JSON.stringify(result) + note }] };
1853
2184
  }
2185
+ if (name === 'service_pair_local') {
2186
+ const refused = humanSessionRefusal('refused: service_pair_local runs only in a Session Manager chat or terminal session where the human asked for the pairing; '
2187
+ + 'say in your final result which service the human should pair.');
2188
+ if (refused) return refused;
2189
+ if (process.env.SM_KG_INTERNAL === '1') return errorResult('refused: service_pair_local is not available to internal headless runs.');
2190
+ for (const key of ['stateDir', 'name', 'homeCwd']) {
2191
+ if (!args || typeof args[key] !== 'string' || !args[key].trim()) return errorResult(`missing required argument: ${key}`);
2192
+ }
2193
+ if (!path.isAbsolute(args.stateDir)) return errorResult('stateDir must be an absolute path');
2194
+ if (!Array.isArray(args.tools) || args.tools.length === 0) return errorResult('missing required argument: tools');
2195
+ const opts = { stateDir: args.stateDir, name: args.name, homeCwd: args.homeCwd, tools: args.tools };
2196
+ if (typeof args.projectRoot === 'string' && args.projectRoot.trim()) opts.projectRoot = args.projectRoot;
2197
+ const r = await require('../src/main/lib/feedback-remote/serviceStdioBridge.cjs').pairLocal(opts);
2198
+ if (!r || r.ok !== true) return errorResult(String((r && r.error) || 'pairing failed'));
2199
+ return { content: [{ type: 'text', text: JSON.stringify({ ok: true, service: r.service }) }] };
2200
+ }
1854
2201
  if (name === 'feedback_reply') {
1855
2202
  // Only the Epic's own interactive session can reply: a scheduled job has
1856
2203
  // no chat identity, and its work is reported in its result instead.
@@ -1866,7 +2213,12 @@ async function handleCallTool(request) {
1866
2213
  if (typeof args.outcome !== 'string' || !args.outcome) {
1867
2214
  return errorResult('missing required argument: outcome');
1868
2215
  }
1869
- const payload = { ...args };
2216
+ const held = args.deliverWhen !== undefined && args.deliverWhen !== null;
2217
+ const heldRefusal = held ? await heldReplyAppRefusal(args.deliverWhen) : null;
2218
+ if (heldRefusal) return errorResult(heldRefusal);
2219
+ const claimCheck = await feedbackReplyClaimCheck(args, held);
2220
+ if (claimCheck.refusal) return errorResult(claimCheck.refusal);
2221
+ const payload = { ...args, message: claimCheck.message };
1870
2222
  // Identity comes only from this process's env — never from the caller.
1871
2223
  delete payload.originClaudeSessionId;
1872
2224
  delete payload.originProjectRoot;
@@ -1902,6 +2254,10 @@ async function handleCallTool(request) {
1902
2254
  note = ' — the asking Epic could not take it, so the reply fell back to a new proposed session in that project'
1903
2255
  + `${result.fallbackEpicId ? ` (${result.fallbackEpicId})` : ''}; a human there must approve it.`;
1904
2256
  }
2257
+ if (held && result?.delivery !== 'scheduled') {
2258
+ note += ` WARNING: deliverWhen was sent, but the app delivered the reply immediately instead of holding it `
2259
+ + `(delivery '${result?.delivery ?? 'none'}'); any {version} in the message went out unfilled.`;
2260
+ }
1905
2261
  }
1906
2262
  return { content: [{ type: 'text', text: JSON.stringify(result) + note }] };
1907
2263
  }
@@ -1949,10 +2305,29 @@ async function handleCallTool(request) {
1949
2305
  if (typeof args.js !== 'string') return errorResult('missing required argument: js');
1950
2306
  js = args.js;
1951
2307
  }
2308
+ let sounds;
2309
+ if (args.soundPaths !== undefined && args.soundPaths !== null) {
2310
+ const resolved = await resolveSoundPaths(args.soundPaths);
2311
+ if (resolved.error) return errorResult(resolved.error);
2312
+ sounds = resolved.sounds;
2313
+ }
1952
2314
  const cwd = resolveCwdArg(args);
1953
2315
  const body = { cwd, json: args.json, js };
1954
2316
  if (args.replace === true) body.replace = true;
2317
+ if (sounds) body.sounds = sounds;
1955
2318
  const result = await adminRequest('POST', '/admin/project-home/character/write', body);
2319
+ // An app older than project sounds ignores body.sounds and still answers
2320
+ // ok — without the sounds array. Report that instead of a false success.
2321
+ if (sounds && result && result.ok === true && !Array.isArray(result.sounds)) {
2322
+ let appVersion = null;
2323
+ try {
2324
+ const cfg = await readAdminConfig();
2325
+ if (typeof cfg.appVersion === 'string' && cfg.appVersion) appVersion = cfg.appVersion;
2326
+ } catch { /* version stays unreported */ }
2327
+ return errorResult(`the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) saved character.json `
2328
+ + 'but ignored its sounds because it predates project sounds, so no sound WAV was written. Call project_character_write again '
2329
+ + 'with replace: true once the app runs a release with project sounds.');
2330
+ }
1956
2331
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1957
2332
  }
1958
2333
  if (name === 'project_demo_video_write') {
@@ -14,11 +14,23 @@ function registerAppAdminRoutes(adminHttp, deps = {}) {
14
14
  scheduler.registerAdminRoutes(adminHttp);
15
15
  // GET/POST /admin/scheduler/slots — read the slot cap; change it only on the human's verified words.
16
16
  require('./lib/scheduler/slotsRoute.cjs').registerSlotsRoute(adminHttp);
17
+ // POST /admin/scheduler/release-plan — the planner releases a plan held for review (or asks one re-review).
18
+ require('./lib/scheduler/planReleaseRoute.cjs').registerPlanReleaseRoute(adminHttp);
19
+ // GET /admin/usage-hold — the 'pause above' hold POST /admin/tasks refuses on, for runners that start claude -p directly (read-only).
20
+ require('./lib/scheduler/usageHoldRoute.cjs').registerUsageHoldRoute(adminHttp);
17
21
  require('./lib/prd/prdCreate.cjs').registerAdminRoute(adminHttp, scheduler.remote);
18
22
  require('./lib/prd/prdAdminRoutes.cjs').registerAdminRoute(adminHttp, scheduler.remote);
19
23
  require('./lib/feedback-remote/projectHomeAdminRoutes.cjs').registerAdminRoute(adminHttp);
20
24
  // GET /admin/voices + POST /admin/voices/preview — voice library reads for agents; no route changes a voice.
21
25
  require('./lib/project-pages/voiceAdminRoutes.cjs').registerAdminRoute(adminHttp);
26
+ // POST /admin/project-home/videos/script-switch — 'Scripts may run Demo Video', only on the human's verified words.
27
+ require('./lib/project-pages/videoScriptSwitchRoute.cjs').registerVideoScriptSwitchRoute(adminHttp);
28
+ // POST /admin/project-home/videos/run — a project's own script presses Demo Video, only while that switch is on.
29
+ require('./lib/project-pages/videoScriptRunRoute.cjs').registerAdminRoute(adminHttp, {
30
+ startExternalNewSession: chatRunner.startExternalNewSession,
31
+ isTabBusy: chatRunner.isTabBusy,
32
+ listJobRows: () => scheduler.remote.listJobRows(),
33
+ });
22
34
  require('./lib/feedback-remote/macroAdminRoutes.cjs').registerAdminRoute(adminHttp, {
23
35
  onChanged: deps.onMacrosChanged,
24
36
  startExternalNewSession: chatRunner.startExternalNewSession,
@@ -33,6 +45,10 @@ function registerAppAdminRoutes(adminHttp, deps = {}) {
33
45
  // several projects' operations roots open, so it performs the cross-folder
34
46
  // write (lib/feedback-remote/crossProjectFeedback.cjs).
35
47
  require('./lib/feedback-remote/crossProjectFeedback.cjs').registerAdminRoute(adminHttp);
48
+ // POST /admin/projects/create — a paired service's new local (+ private GitHub) project; broadcasts `projects:created`.
49
+ require('./lib/feedback-remote/projectCreate.cjs').registerAdminRoute(adminHttp);
50
+ // POST /admin/services/pair-local[/confirm] — same-machine service pairing with no window step.
51
+ require('./lib/feedback-remote/servicePairLocalRoutes.cjs').registerAdminRoute(adminHttp);
36
52
  // Its return leg: the receiving session answers INTO the Epic that asked
37
53
  // (lib/feedback-remote/crossProjectReply.cjs).
38
54
  require('./lib/feedback-remote/crossProjectReply.cjs').registerAdminRoute(adminHttp);