claude-code-session-manager 0.142.0 → 0.143.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +20 -107
- package/dist/assets/{AppSettings-BcZgIvvY.js → AppSettings-BO4jDVGO.js} +1 -1
- package/dist/assets/{History-DpZuJXi1.js → History-DTttbvPb.js} +1 -1
- package/dist/assets/{HomeClaudeConfig-D32ZJtU-.js → HomeClaudeConfig-DADP5bfn.js} +2 -2
- package/dist/assets/{Panel-BjdJjhqt.js → Panel-B_D4Bg7L.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-BTClYV6i.js → ProjectClaudeConfig-DPnDJKcr.js} +1 -1
- package/dist/assets/{Scheduler-DPobKx1Z.js → Scheduler-CNLjn90m.js} +8 -8
- package/dist/assets/{SkillReferenceGraph-Cqyu4mef.js → SkillReferenceGraph-D1b2aiol.js} +1 -1
- package/dist/assets/{Skills-vv0noNVI.js → Skills-cfV7sgk6.js} +1 -1
- package/dist/assets/{TiptapBody-CXi8Pvut.js → TiptapBody-DVXtEIVy.js} +1 -1
- package/dist/assets/{Toggle-CiYCWLjh.js → Toggle-CYajnSdx.js} +1 -1
- package/dist/assets/{VoiceButton-4NKKd1sC.js → VoiceButton-DJ4gGRuE.js} +1 -1
- package/dist/assets/{historyTotals-DDunb8Ch.js → historyTotals-D3MoHY2U.js} +1 -1
- package/dist/assets/{index-Cn5E9958.js → index-CdTppjKR.js} +436 -436
- package/dist/index.html +1 -1
- package/dist-web/app.js +356 -356
- package/package.json +3 -3
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +5 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +9 -3
- package/scripts/README.md +1 -0
- package/scripts/scheduler-mcp-server.cjs +304 -6
- package/src/main/adminRouteRegistry.cjs +10 -0
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +105 -7
- package/src/main/config.cjs +5 -1
- package/src/main/health.cjs +38 -2
- package/src/main/index.cjs +12 -4
- package/src/main/ipcSchemas.cjs +11 -0
- package/src/main/lib/demo-video-kit/cast.md +10 -1
- package/src/main/lib/demo-video-kit/character.cjs +77 -21
- package/src/main/lib/demo-video-kit/kind-tiktok.md +5 -1
- package/src/main/lib/demo-video-kit/projectSounds.cjs +191 -0
- package/src/main/lib/demo-video-kit/seedKit.cjs +3 -3
- package/src/main/lib/demo-video-kit/sound.cjs +166 -9
- package/src/main/lib/demo-video-kit/standalone.cjs +231 -0
- package/src/main/lib/epic/activeIndexMerge.cjs +5 -0
- package/src/main/lib/epic/artifactRetention.cjs +55 -9
- package/src/main/lib/epic/artifactStore.cjs +78 -35
- package/src/main/lib/epic/delegationReadiness.cjs +10 -3
- package/src/main/lib/epic/epicEventLog.cjs +45 -1
- package/src/main/lib/epic/epicStateEmitter.cjs +248 -0
- package/src/main/lib/epic/epicValidationHook.cjs +13 -2
- package/src/main/lib/externalContract.cjs +12 -1
- package/src/main/lib/feedback-remote/autoStartedSession.cjs +1 -1
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +96 -8
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +30 -0
- package/src/main/lib/feedback-remote/pendingReplies.cjs +18 -0
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +94 -4
- package/src/main/lib/feedback-remote/replyClaims.cjs +159 -0
- package/src/main/lib/git/gitWorktree.cjs +8 -0
- package/src/main/lib/git/runtimeStateUntrack.cjs +15 -1
- package/src/main/lib/git/worktreeDeps.cjs +113 -10
- package/src/main/lib/mcpToolCatalog.cjs +102 -8
- package/src/main/lib/opsOwnership.cjs +113 -28
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +46 -0
- package/src/main/lib/prd/prdCreate.cjs +350 -227
- package/src/main/lib/prd/prdCriteria.cjs +7 -4
- package/src/main/lib/project-pages/videoPressLines.cjs +145 -0
- package/src/main/lib/project-pages/videoScriptPress.cjs +260 -0
- package/src/main/lib/project-pages/videoScriptRunRoute.cjs +351 -0
- package/src/main/lib/project-pages/videoScriptSwitchIpc.cjs +49 -0
- package/src/main/lib/project-pages/videoScriptSwitchRoute.cjs +173 -0
- package/src/main/lib/scheduler/criteriaChecks.cjs +164 -20
- package/src/main/lib/scheduler/heldSchedulerTurns.cjs +238 -0
- package/src/main/lib/scheduler/jobMemoryStats.cjs +13 -2
- package/src/main/lib/scheduler/planRecordHarvest.cjs +120 -52
- package/src/main/lib/scheduler/prdOutcomeRecord.cjs +60 -2
- package/src/main/lib/scheduler/queueStore.cjs +16 -0
- package/src/main/lib/scheduler/rcaReport.cjs +79 -15
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +13 -0
- package/src/main/lib/scheduler/schedulerPaths.cjs +9 -0
- package/src/main/lib/scheduler/slotsRoute.cjs +101 -87
- package/src/main/lib/scheduler/usageHoldRoute.cjs +97 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +16 -5
- package/src/main/lib/tasks/memoryConsolidation.cjs +14 -2
- package/src/main/lib/tasks/mitigationReview.cjs +21 -1
- package/src/main/lib/tasks/taskAdminRoutes.cjs +78 -3
- package/src/main/lib/tasks/taskLedger.cjs +2 -2
- package/src/main/lib/telemetry/auditEvents.cjs +21 -24
- package/src/main/lib/telemetry/auditLog.cjs +6 -2
- package/src/main/lib/util/atomicFs.cjs +2 -2
- package/src/main/promptSessionEvents.cjs +16 -1
- package/src/main/pty.cjs +11 -2
- package/src/main/queueOps.cjs +1 -1
- package/src/main/runVerify.cjs +1 -1
- package/src/main/scheduler/utilizationHold.cjs +96 -6
- package/src/main/scheduler.cjs +533 -39
- package/src/main/templates/PRD_AUTHORING.md +7 -2
- package/src/preload/api.d.ts +47 -1
- package/src/preload/apiSurface.json +14 -0
- package/src/preload/index.cjs +2 -0
- package/src/seed/agents/demo-video-builder.md +15 -8
- package/src/seed/agents/validator.md +20 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-session-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.143.0",
|
|
4
4
|
"description": "Free desktop app for Claude Code: run many sessions, each in its own git worktree; queue work that runs headless within your usage limits; agents drive it through an MCP server and skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main/index.cjs",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
],
|
|
113
113
|
"author": "bilkobibitkov",
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"homepage": "https://bilko.run/
|
|
115
|
+
"homepage": "https://bilko.run/products/session-manager",
|
|
116
116
|
"repository": {
|
|
117
117
|
"type": "git",
|
|
118
118
|
"url": "https://github.com/StanislavBG/claude-code-session-manager.git"
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"type": "individual",
|
|
130
|
-
"url": "https://bilko.run/
|
|
130
|
+
"url": "https://bilko.run/products/session-manager"
|
|
131
131
|
}
|
|
132
132
|
],
|
|
133
133
|
"publishConfig": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "session-manager-dev",
|
|
3
3
|
"description": "The default end-to-end development skillset for the Claude Code Session Manager: decompose work into scheduler PRDs and track them to a validated finish (/develop), publish releases to npm (/builder), hand a finding to another project on this machine (/send-feedback), and review or drift-check a project's CLAUDE.md/markdown network (/maintaining-md-network). Together with the session-manager scheduler these form a develop → queue → validate → release loop.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.5",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bilko Bibitkov",
|
|
7
7
|
"email": "BilkoBibitkov2000@gmail.com",
|
|
@@ -125,6 +125,10 @@ have no `release.yml`) always use steps 5-11:
|
|
|
125
125
|
```
|
|
126
126
|
Report the installer assets found (here: `.dmg`, `.exe`, `.AppImage`) and any missing. If
|
|
127
127
|
no run is listed yet, say so instead of polling.
|
|
128
|
+
12. Post-publish steps. If the project's distribution doc (its conventions or release doc)
|
|
129
|
+
lists steps to run after the npm publish, run each one in order and record its result —
|
|
130
|
+
done, failed with its output, or skipped and why. A failed post-publish step never undoes the
|
|
131
|
+
npm publish; report it and carry on with the rest.
|
|
128
132
|
|
|
129
133
|
On any failing step: stop there and report the step and its output. Once the worktree exists,
|
|
130
134
|
leave it only when its state is evidence for the failure; otherwise remove it (step 9) so a
|
|
@@ -146,6 +150,7 @@ One plain-text report, whether the pipeline finished or stopped:
|
|
|
146
150
|
- **Registry**: packument `dist-tags` / version and tarball status.
|
|
147
151
|
- **Git**: both pushes confirmed, worktree removed.
|
|
148
152
|
- **Installer release**: assets found and missing, or "no release workflow".
|
|
153
|
+
- **Post-publish steps**: each listed step and its result, or "none listed".
|
|
149
154
|
- **Manual**: `manual.md`'s report, "no content change", or "no manual".
|
|
150
155
|
- **Stopped early?** Which step, why, its output, and anything a retry must account for
|
|
151
156
|
(a leftover worktree or local tag).
|
|
@@ -146,6 +146,10 @@ three failure modes have different fixes:
|
|
|
146
146
|
needs another PRD's output.
|
|
147
147
|
9. **Write plain, checkable criteria.** Each names a file, a symbol and the result; one names
|
|
148
148
|
the test file and tests. Commands go in `gate`. No open-ended "grep X and update" lines.
|
|
149
|
+
A check against a running local service is an `http` criterion `{ kind: 'http', spec: { url, status?, contains? } }` (loopback only), run by the scheduler outside the sandbox,
|
|
150
|
+
because a job's Bash cannot reach host loopback; the URL host is 127.0.0.1 or localhost, whichever the server listens on ([::1] only for an IPv6 listener), never the machine hostname, which criteria refuse.
|
|
151
|
+
Write a structural expectation (for example every item has a non-empty field) in the criterion statement; the validator judges it from the stored response body.
|
|
152
|
+
What http cannot express (auth, POST, UI) the architect checks at PLAN SETTLED from the Epic.
|
|
149
153
|
10. **Show the plan once**: the plan goal line, the stage view (for example `Stage 1: A ∥ B →
|
|
150
154
|
Stage 2: C → validate`), and a table (#, PRD, files, gate, dependsOn) — not PRD
|
|
151
155
|
drafts. Queue at once when the Epic is `feature`, `bug` or `art` and scope is clear; otherwise ask
|
|
@@ -310,9 +314,11 @@ Rules:
|
|
|
310
314
|
checkout's `session-manager-operations/plan-records/<epic-id>/`).
|
|
311
315
|
2. **Decided:** each choice you made instead of asking, with a one-line revert.
|
|
312
316
|
3. **Queued:** side plans and later waves still to run, by slug. They finish without the human.
|
|
313
|
-
4. **Scheduled:** what fires on its own later, and its trigger. A reply owed to another project after a release is
|
|
314
|
-
|
|
315
|
-
|
|
317
|
+
4. **Scheduled:** what fires on its own later, and its trigger. A reply owed to another project after a release is a
|
|
318
|
+
`feedback_reply` with `release.commits` (the work's commits) whose message writes `{version}`; never hand-type a version.
|
|
319
|
+
On an app newer than 0.142.0, send it at once with `deliverWhen.appVersionAbove` = `admin-api.json` `appVersion`:
|
|
320
|
+
it sends itself once a release whose tag contains the commits runs, even if this Epic is closed. On 0.142.0 or older,
|
|
321
|
+
queue a held release check PRD and send the reply live, with `release.commits`, at its PLAN SETTLED.
|
|
316
322
|
5. **Needs you:** only steps rule 6 allows, including a PRD refuted twice, one exact action each. Omit it when empty.
|
|
317
323
|
|
|
318
324
|
Expected API warnings and skipped optional steps are not reported.
|
package/scripts/README.md
CHANGED
|
@@ -32,6 +32,7 @@ scripts/lib was moved into src/main/lib (2026-09); nothing under src/ may requir
|
|
|
32
32
|
| ops-sweep.cjs | manual; `node scripts/ops-sweep.cjs <cwd>` | yes |
|
|
33
33
|
| postinstall.cjs | npm `postinstall` | yes |
|
|
34
34
|
| purge-dry-run.cjs | manual / validators, read-only; `node scripts/purge-dry-run.cjs <cwd> <epicId>` prints `purgeEpic({ dryRun: true })` JSON (artifacts by kind + counts), deletes nothing; a real purge stays the epic:purge IPC | no |
|
|
35
|
+
| release-notes.cjs | `.github/workflows/release.yml` finalize-release job, and manual; `node scripts/release-notes.cjs --tag <ref> [--prev <tag>]` prints the GitHub release body (upgrade note from the tag tree + commit subjects since prev) — convention in [release-notes/README.md](../release-notes/README.md) | no |
|
|
35
36
|
| refresh-vad-assets.mjs | `npm run refresh:vad-assets` | no |
|
|
36
37
|
| replay-verdicts.cjs | manual, dev-only, read-only | no |
|
|
37
38
|
| scheduler-mcp-server.cjs | registered as an MCP server (`seedSchedulerMcp.cjs`, `send-feedback` SKILL.md) | yes |
|
|
@@ -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
|
|
@@ -77,7 +79,9 @@ 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');
|
|
79
81
|
const { EPIC_OUTSIDE_STATES } = require('../src/main/lib/epic/epicOutsideState.cjs');
|
|
82
|
+
const { KINDS: ARTIFACT_KINDS } = require('../src/main/lib/epic/artifactStore.cjs');
|
|
80
83
|
const { REVIEW_TEXT_MAX, REVIEW_IMAGES_MAX, REVIEW_IMAGE_BYTES_MAX } = require('../src/main/lib/project-pages/videoReview.cjs');
|
|
84
|
+
const { SOUND_NAME_RE, MAX_BED_WAV_BYTES, MAX_SOUNDS_TOTAL_BYTES } = require('../src/main/lib/demo-video-kit/projectSounds.cjs');
|
|
81
85
|
|
|
82
86
|
const CATALOG_BY_NAME = new Map(MCP_TOOL_CATALOG.map((entry) => [entry.name, entry]));
|
|
83
87
|
|
|
@@ -89,6 +93,9 @@ function descriptionFor(toolName) {
|
|
|
89
93
|
|
|
90
94
|
const { adminTokenPath } = require('../src/main/lib/scheduler/schedulerPaths.cjs');
|
|
91
95
|
const { normalizePreflight } = require('../src/main/lib/scheduler/preflightCheck.cjs');
|
|
96
|
+
const {
|
|
97
|
+
findUnfilledPlaceholders, findSessionManagerVersions, normalizeReleaseClaim, isSessionManagerRepo, checkReleaseContains,
|
|
98
|
+
} = require('../src/main/lib/feedback-remote/replyClaims.cjs');
|
|
92
99
|
|
|
93
100
|
// Defined once so every failure path points to the same next call, verbatim
|
|
94
101
|
// — never paste this sentence at each return site (PRD: session_manager_help).
|
|
@@ -164,6 +171,44 @@ async function resolveVideoExports(args) {
|
|
|
164
171
|
return { exports: { mp4Base64: mp4.base64, posterBase64: poster.base64 } };
|
|
165
172
|
}
|
|
166
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Reads one project_character_write soundPaths file into { buf } or { error }.
|
|
176
|
+
* Errors name soundPaths.<name>, never file contents. The per-file cap is the
|
|
177
|
+
* bed cap; the route re-checks an effect against its smaller cap.
|
|
178
|
+
*/
|
|
179
|
+
async function readSoundFile(p, name) {
|
|
180
|
+
const argName = `soundPaths.${name}`;
|
|
181
|
+
if (typeof p !== 'string' || !path.isAbsolute(p)) return { error: `${argName} must be an absolute path` };
|
|
182
|
+
if (!p.toLowerCase().endsWith('.wav')) return { error: `${argName} must end in .wav` };
|
|
183
|
+
try {
|
|
184
|
+
const st = await fsp.stat(p);
|
|
185
|
+
if (!st.isFile()) return { error: `${argName} is not a regular file` };
|
|
186
|
+
if (st.size === 0) return { error: `${argName} file is empty` };
|
|
187
|
+
if (st.size > MAX_BED_WAV_BYTES) return { error: `${argName} file exceeds ${MAX_BED_WAV_BYTES} bytes` };
|
|
188
|
+
return { buf: await fsp.readFile(p) };
|
|
189
|
+
} catch (err) {
|
|
190
|
+
return { error: `cannot read ${argName}: ${err && err.code ? err.code : 'read failed'}` };
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Resolves soundPaths into { sounds: { name: base64 } } or { error }. */
|
|
195
|
+
async function resolveSoundPaths(soundPaths) {
|
|
196
|
+
if (!soundPaths || typeof soundPaths !== 'object' || Array.isArray(soundPaths)) {
|
|
197
|
+
return { error: 'soundPaths must be an object of { sound name: absolute .wav path }' };
|
|
198
|
+
}
|
|
199
|
+
const sounds = {};
|
|
200
|
+
let total = 0;
|
|
201
|
+
for (const [name, p] of Object.entries(soundPaths)) {
|
|
202
|
+
if (!SOUND_NAME_RE.test(name)) return { error: `soundPaths key "${name}" is not a sound name (${SOUND_NAME_RE})` };
|
|
203
|
+
const loaded = await readSoundFile(p, name);
|
|
204
|
+
if (loaded.error) return { error: loaded.error };
|
|
205
|
+
total += loaded.buf.length;
|
|
206
|
+
if (total > MAX_SOUNDS_TOTAL_BYTES) return { error: `soundPaths files exceed ${MAX_SOUNDS_TOTAL_BYTES} bytes in all` };
|
|
207
|
+
sounds[name] = loaded.buf.toString('base64');
|
|
208
|
+
}
|
|
209
|
+
return { sounds };
|
|
210
|
+
}
|
|
211
|
+
|
|
167
212
|
/** Reads a local .js file for project_character_write; errors carry only the reason, never file contents. */
|
|
168
213
|
async function readCharacterJsFile(p) {
|
|
169
214
|
if (typeof p !== 'string' || !path.isAbsolute(p)) return { error: 'jsPath must be an absolute path' };
|
|
@@ -275,6 +320,40 @@ function errorResult(text) {
|
|
|
275
320
|
return { content: [{ type: 'text', text: withPointer(text) }], isError: true };
|
|
276
321
|
}
|
|
277
322
|
|
|
323
|
+
const ZOD_ISSUE_LINE_MAX = 20;
|
|
324
|
+
|
|
325
|
+
// Renders a zod issue path as a field path: ['fixes', 0, 'reason'] -> 'fixes[0].reason'.
|
|
326
|
+
function zodFieldPath(segs) {
|
|
327
|
+
let out = '';
|
|
328
|
+
for (const seg of segs) {
|
|
329
|
+
if (typeof seg === 'number') out += `[${seg}]`;
|
|
330
|
+
else out += (out ? '.' : '') + String(seg);
|
|
331
|
+
}
|
|
332
|
+
return out || '(root)';
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// One line per zod issue from an admin route's `details` (capped, '+N more').
|
|
336
|
+
// Batch mode (prds = the caller's entries): a path ['prds', i, ...rest] names
|
|
337
|
+
// entry i and its slug; any other path prints under [-1] with its full path.
|
|
338
|
+
// Single mode (prds = null): '- <field path>: <message>'. Returns null when
|
|
339
|
+
// details is not an array of issues with a path, so callers keep today's text.
|
|
340
|
+
function formatZodIssueLines(details, prds) {
|
|
341
|
+
if (!Array.isArray(details)) return null;
|
|
342
|
+
const issues = details.filter((d) => d && typeof d === 'object' && Array.isArray(d.path));
|
|
343
|
+
if (issues.length === 0) return null;
|
|
344
|
+
const lines = issues.slice(0, ZOD_ISSUE_LINE_MAX).map((issue) => {
|
|
345
|
+
const msg = issue.message ?? 'invalid';
|
|
346
|
+
if (!prds) return `- ${zodFieldPath(issue.path)}: ${msg}`;
|
|
347
|
+
const [head, idx, ...rest] = issue.path;
|
|
348
|
+
if (head === 'prds' && Number.isInteger(idx)) {
|
|
349
|
+
return `- [${idx}] ${prds[idx]?.slug ?? '(no slug)'}: ${zodFieldPath(rest)}: ${msg}`;
|
|
350
|
+
}
|
|
351
|
+
return `- [-1] (no slug): ${zodFieldPath(issue.path)}: ${msg}`;
|
|
352
|
+
});
|
|
353
|
+
if (issues.length > ZOD_ISSUE_LINE_MAX) lines.push(`+${issues.length - ZOD_ISSUE_LINE_MAX} more`);
|
|
354
|
+
return lines;
|
|
355
|
+
}
|
|
356
|
+
|
|
278
357
|
const NOT_RUNNING_ERROR =
|
|
279
358
|
`session-manager app is not running (admin API unreachable) — start it first${HELP_POINTER}`;
|
|
280
359
|
|
|
@@ -474,7 +553,7 @@ const ACCEPTANCE_CRITERION_ITEM_SCHEMA = {
|
|
|
474
553
|
kind: { type: 'string', enum: ['command', 'file', 'http', 'manual'] },
|
|
475
554
|
spec: {
|
|
476
555
|
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.',
|
|
556
|
+
+ '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
557
|
},
|
|
479
558
|
},
|
|
480
559
|
required: ['kind'],
|
|
@@ -700,11 +779,29 @@ const TOOLS = [
|
|
|
700
779
|
required: ['enabled', 'humanRequestQuote'],
|
|
701
780
|
},
|
|
702
781
|
},
|
|
782
|
+
{
|
|
783
|
+
name: 'video_script_switch_set',
|
|
784
|
+
description: descriptionFor('video_script_switch_set'),
|
|
785
|
+
inputSchema: {
|
|
786
|
+
type: 'object',
|
|
787
|
+
properties: {
|
|
788
|
+
enabled: { type: 'boolean', description: "true turns 'Scripts may run Demo Video' on, false turns it off" },
|
|
789
|
+
humanRequestQuote: { type: 'string', description: "The human's words from this chat asking for the change, verbatim" },
|
|
790
|
+
cwd: { type: 'string', description: "Optional: absolute project root whose switch to set; defaults to this session's project" },
|
|
791
|
+
},
|
|
792
|
+
required: ['enabled', 'humanRequestQuote'],
|
|
793
|
+
},
|
|
794
|
+
},
|
|
703
795
|
{
|
|
704
796
|
name: 'scheduler_slots_get',
|
|
705
797
|
description: descriptionFor('scheduler_slots_get'),
|
|
706
798
|
inputSchema: { type: 'object', properties: {} },
|
|
707
799
|
},
|
|
800
|
+
{
|
|
801
|
+
name: 'usage_hold_get',
|
|
802
|
+
description: descriptionFor('usage_hold_get'),
|
|
803
|
+
inputSchema: { type: 'object', properties: {} },
|
|
804
|
+
},
|
|
708
805
|
{
|
|
709
806
|
name: 'scheduler_slots_set',
|
|
710
807
|
description: descriptionFor('scheduler_slots_set'),
|
|
@@ -712,7 +809,7 @@ const TOOLS = [
|
|
|
712
809
|
type: 'object',
|
|
713
810
|
properties: {
|
|
714
811
|
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
|
|
812
|
+
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
813
|
},
|
|
717
814
|
required: ['cap', 'quote'],
|
|
718
815
|
},
|
|
@@ -802,6 +899,27 @@ const TOOLS = [
|
|
|
802
899
|
required: ['slug'],
|
|
803
900
|
},
|
|
804
901
|
},
|
|
902
|
+
{
|
|
903
|
+
name: 'scheduler_dismiss_cancelled',
|
|
904
|
+
description: descriptionFor('scheduler_dismiss_cancelled'),
|
|
905
|
+
inputSchema: {
|
|
906
|
+
type: 'object',
|
|
907
|
+
properties: {
|
|
908
|
+
slug: { type: 'string', description: 'PRD slug of the cancelled row to dismiss' },
|
|
909
|
+
cwd: { type: 'string', description: 'Optional: the PRD project cwd, narrows/speeds the search' },
|
|
910
|
+
dependents: {
|
|
911
|
+
type: 'object',
|
|
912
|
+
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.',
|
|
913
|
+
properties: {
|
|
914
|
+
action: { type: 'string', enum: ['cascade', 'repoint', 'clear'] },
|
|
915
|
+
to: { type: 'string', description: 'PRD slug the dependents should depend on instead — required for action "repoint"' },
|
|
916
|
+
},
|
|
917
|
+
required: ['action'],
|
|
918
|
+
},
|
|
919
|
+
},
|
|
920
|
+
required: ['slug'],
|
|
921
|
+
},
|
|
922
|
+
},
|
|
805
923
|
{
|
|
806
924
|
name: 'scheduler_retag_prd',
|
|
807
925
|
description: descriptionFor('scheduler_retag_prd'),
|
|
@@ -870,6 +988,16 @@ const TOOLS = [
|
|
|
870
988
|
description: 'Optional: hold this reply until Session Manager runs a version above appVersionAbove (give the version running now); '
|
|
871
989
|
+ 'it then sends itself, even after this Epic closes; `{version}` in the message becomes that version.',
|
|
872
990
|
},
|
|
991
|
+
release: {
|
|
992
|
+
type: 'object',
|
|
993
|
+
properties: {
|
|
994
|
+
commits: { type: 'array', items: { type: 'string' }, description: 'Commit hashes (7-40 hex) the reply says shipped.' },
|
|
995
|
+
},
|
|
996
|
+
required: ['commits'],
|
|
997
|
+
additionalProperties: false,
|
|
998
|
+
description: 'Required for a Session Manager release claim: the commits must be in the running Session Manager release '
|
|
999
|
+
+ '(tag v<running version>); `{version}` in a live reply becomes that version.',
|
|
1000
|
+
},
|
|
873
1001
|
},
|
|
874
1002
|
required: ['message', 'outcome'],
|
|
875
1003
|
},
|
|
@@ -897,6 +1025,11 @@ const TOOLS = [
|
|
|
897
1025
|
js: { type: 'string', description: 'The character drawing module source (<= 300KB; no remote references or network-capable APIs). Give exactly one of js / jsPath.' },
|
|
898
1026
|
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
1027
|
replace: { type: 'boolean', description: 'Overwrite an existing character. Without it an existing character is refused with 409.' },
|
|
1028
|
+
soundPaths: {
|
|
1029
|
+
type: 'object',
|
|
1030
|
+
additionalProperties: { type: 'string' },
|
|
1031
|
+
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.',
|
|
1032
|
+
},
|
|
900
1033
|
},
|
|
901
1034
|
required: ['json'],
|
|
902
1035
|
},
|
|
@@ -948,7 +1081,12 @@ const TOOLS = [
|
|
|
948
1081
|
properties: {
|
|
949
1082
|
path: { type: 'string', description: 'Path of the file to publish: absolute (worktree, project or /tmp), or relative to your Epic worktree.' },
|
|
950
1083
|
title: { type: 'string', description: 'Optional: human label shown in File Explorer > Artifacts.' },
|
|
951
|
-
|
|
1084
|
+
// Derived from the store so the schema cannot drift from what it accepts.
|
|
1085
|
+
kind: {
|
|
1086
|
+
type: 'string',
|
|
1087
|
+
enum: [...ARTIFACT_KINDS],
|
|
1088
|
+
description: `Optional: one of ${ARTIFACT_KINDS.join(', ')}; omit to infer it from the file extension. A report is doc.`,
|
|
1089
|
+
},
|
|
952
1090
|
},
|
|
953
1091
|
required: ['path'],
|
|
954
1092
|
},
|
|
@@ -1412,7 +1550,8 @@ function siteErrorText(result, fallback, cwd) {
|
|
|
1412
1550
|
// A switch only the human flips (the Tasks switch, the session slot limit): a
|
|
1413
1551
|
// scheduled job, a Task or any other internal headless run (SM_KG_INTERNAL=1),
|
|
1414
1552
|
// or a process outside a chat session, is refused before any request. One
|
|
1415
|
-
// helper so task_switch_set and scheduler_slots_set
|
|
1553
|
+
// helper so task_switch_set, video_script_switch_set and scheduler_slots_set
|
|
1554
|
+
// can never drift apart.
|
|
1416
1555
|
function humanSwitchRefusal(message) {
|
|
1417
1556
|
if (process.env.SM_KG_INTERNAL === '1') return errorResult(message);
|
|
1418
1557
|
return humanSessionRefusal(message);
|
|
@@ -1423,6 +1562,11 @@ function taskSwitchSetRefusal() {
|
|
|
1423
1562
|
+ 'say in your final result what the human should switch on Scheduler → Tasks.');
|
|
1424
1563
|
}
|
|
1425
1564
|
|
|
1565
|
+
function videoScriptSwitchSetRefusal() {
|
|
1566
|
+
return humanSwitchRefusal('refused: video_script_switch_set runs only in a Session Manager chat or terminal session where the human asked for it; '
|
|
1567
|
+
+ "say in your final result that the human should turn on 'Scripts may run Demo Video' in Project Home > Video.");
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1426
1570
|
function slotsSetRefusal() {
|
|
1427
1571
|
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
1572
|
+ 'say in your final result what limit the human should set.');
|
|
@@ -1491,6 +1635,92 @@ async function preflightAppRefusal(expected) {
|
|
|
1491
1635
|
+ "Restart Session Manager into a newer build (Command Palette: 'Reboot app (drain first)') and call again.";
|
|
1492
1636
|
}
|
|
1493
1637
|
|
|
1638
|
+
// First app release whose POST /admin/feedback/reply knows deliverWhen (held
|
|
1639
|
+
// replies, 58b70bc2). An older app ignores the key and delivers at once with
|
|
1640
|
+
// {version} unfilled, spending a reply slot (seen live 2026-11-24 on 0.141.0).
|
|
1641
|
+
const HELD_REPLY_MIN_APP_VERSION = '0.142.0';
|
|
1642
|
+
|
|
1643
|
+
// Refuses (returns an error line) when a feedback_reply carries deliverWhen but
|
|
1644
|
+
// the running app is older than HELD_REPLY_MIN_APP_VERSION or reports no
|
|
1645
|
+
// version. A missing admin-api.json returns null so adminRequest reports "not running".
|
|
1646
|
+
// Last app release whose held replies key on version only and ignore
|
|
1647
|
+
// release.commits, so a held commit-gated reply would go out unchecked.
|
|
1648
|
+
const COMMIT_GATED_HOLD_AFTER_APP_VERSION = '0.142.0';
|
|
1649
|
+
|
|
1650
|
+
function runningAppVersion(cfg) {
|
|
1651
|
+
return cfg && typeof cfg.appVersion === 'string' && cfg.appVersion ? cfg.appVersion : null;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
// Applies the replyClaims rules to a feedback_reply before any request.
|
|
1655
|
+
// Returns { refusal } or { message } (the message to forward).
|
|
1656
|
+
async function feedbackReplyClaimCheck(args, held) {
|
|
1657
|
+
const refuse = (text) => ({ refusal: `refused: ${text}` });
|
|
1658
|
+
const { message } = args;
|
|
1659
|
+
const hasRelease = args.release !== undefined && args.release !== null;
|
|
1660
|
+
const unfilled = findUnfilledPlaceholders(message, { allowVersionToken: held || hasRelease });
|
|
1661
|
+
if (unfilled.length) {
|
|
1662
|
+
return refuse(`the message has unfilled placeholder(s) ${unfilled.join(', ')}. Write the real value, `
|
|
1663
|
+
+ 'or use {version} only with deliverWhen or release so it is filled for you.');
|
|
1664
|
+
}
|
|
1665
|
+
let claim = null;
|
|
1666
|
+
if (hasRelease) {
|
|
1667
|
+
const norm = normalizeReleaseClaim(args.release);
|
|
1668
|
+
if (!norm.ok) return refuse(`${norm.error}.`);
|
|
1669
|
+
claim = norm.value;
|
|
1670
|
+
}
|
|
1671
|
+
const projectRoot = process.env.SM_PROJECT_ROOT || process.cwd();
|
|
1672
|
+
const smRepo = isSessionManagerRepo(projectRoot);
|
|
1673
|
+
if (claim && !smRepo) {
|
|
1674
|
+
return refuse(`release is for Session Manager release claims, but ${projectRoot} is not the Session Manager repo. `
|
|
1675
|
+
+ 'Send the reply without release and write your own version by hand.');
|
|
1676
|
+
}
|
|
1677
|
+
if (!claim && smRepo && args.outcome === 'done') {
|
|
1678
|
+
const named = findSessionManagerVersions(message);
|
|
1679
|
+
if (named.length || message.includes('{version}')) {
|
|
1680
|
+
return refuse(`this done reply claims a Session Manager release (${named.length ? named.join(', ') : '{version}'}) `
|
|
1681
|
+
+ 'without release.commits, so nothing checks it. Add release: { commits: [...] } naming the commits that shipped.');
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
if (!claim) return { message };
|
|
1685
|
+
let cfg = null;
|
|
1686
|
+
try { cfg = await readAdminConfig(); } catch { cfg = null; }
|
|
1687
|
+
const appVersion = runningAppVersion(cfg);
|
|
1688
|
+
if (held) {
|
|
1689
|
+
const cmp = appVersion ? compareVersions(appVersion, COMMIT_GATED_HOLD_AFTER_APP_VERSION) : NaN;
|
|
1690
|
+
if (cmp > 0) return { message };
|
|
1691
|
+
return refuse(`the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) holds replies by version only `
|
|
1692
|
+
+ 'and would ignore release.commits, so the held reply could go out naming a release without them. '
|
|
1693
|
+
+ 'Send it live with release.commits once the release that contains them runs.');
|
|
1694
|
+
}
|
|
1695
|
+
if (!appVersion) {
|
|
1696
|
+
return refuse('the running Session Manager app reports no version, so release.commits cannot be checked against its release. '
|
|
1697
|
+
+ 'Restart Session Manager into a current build and call again.');
|
|
1698
|
+
}
|
|
1699
|
+
const check = await checkReleaseContains({ repoCwd: projectRoot, version: appVersion, commits: claim.commits });
|
|
1700
|
+
if (!check.ok) {
|
|
1701
|
+
return refuse(`the running Session Manager release v${appVersion} does not hold this claim: ${check.error}. `
|
|
1702
|
+
+ 'Send the reply once the release that contains the commits runs.');
|
|
1703
|
+
}
|
|
1704
|
+
const other = findSessionManagerVersions(message).filter((v) => v !== appVersion);
|
|
1705
|
+
if (other.length) {
|
|
1706
|
+
return refuse(`the message names Session Manager ${other.join(', ')}, but the running release is v${appVersion}. `
|
|
1707
|
+
+ 'Write {version} (filled with the running version) or the running version itself.');
|
|
1708
|
+
}
|
|
1709
|
+
return { message: message.split('{version}').join(appVersion) };
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
async function heldReplyAppRefusal(deliverWhen) {
|
|
1713
|
+
if (deliverWhen === undefined || deliverWhen === null) return null;
|
|
1714
|
+
let cfg;
|
|
1715
|
+
try { cfg = await readAdminConfig(); } catch { return null; }
|
|
1716
|
+
const appVersion = typeof cfg.appVersion === 'string' && cfg.appVersion ? cfg.appVersion : null;
|
|
1717
|
+
const cmp = appVersion ? compareVersions(appVersion, HELD_REPLY_MIN_APP_VERSION) : NaN;
|
|
1718
|
+
if (cmp >= 0) return null;
|
|
1719
|
+
return `refused: the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) predates held replies `
|
|
1720
|
+
+ `and would ignore deliverWhen: it would deliver the reply at once with {version} unfilled and spend one of the thread's replies. `
|
|
1721
|
+
+ `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.`;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1494
1724
|
// Adds originClaudeSessionId (SM_CHAT_SESSION_ID fallback when sourcePromptId
|
|
1495
1725
|
// is absent) and originProjectRoot (SM_PROJECT_ROOT hint) to a create payload.
|
|
1496
1726
|
function withCreateOrigin(payload) {
|
|
@@ -1622,11 +1852,35 @@ async function handleCallTool(request) {
|
|
|
1622
1852
|
if (result?.ok === false) return errorResult(adminErrorText(result, 'task_switch_set failed'));
|
|
1623
1853
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1624
1854
|
}
|
|
1855
|
+
if (name === 'video_script_switch_set') {
|
|
1856
|
+
const refusal = videoScriptSwitchSetRefusal();
|
|
1857
|
+
if (refusal) return refusal;
|
|
1858
|
+
if (typeof args?.enabled !== 'boolean') return errorResult('missing or invalid required argument: enabled (boolean)');
|
|
1859
|
+
if (typeof args?.humanRequestQuote !== 'string' || args.humanRequestQuote.trim() === '') {
|
|
1860
|
+
return errorResult('missing or invalid required argument: humanRequestQuote (the human\'s words, verbatim)');
|
|
1861
|
+
}
|
|
1862
|
+
// Identity comes from this process's env only, exactly as task_switch_set.
|
|
1863
|
+
const payload = {
|
|
1864
|
+
enabled: args.enabled,
|
|
1865
|
+
humanRequestQuote: args.humanRequestQuote,
|
|
1866
|
+
originClaudeSessionId: process.env.SM_CHAT_SESSION_ID,
|
|
1867
|
+
};
|
|
1868
|
+
if (process.env.SM_PROJECT_ROOT) payload.originProjectRoot = process.env.SM_PROJECT_ROOT;
|
|
1869
|
+
if (typeof args.cwd === 'string') payload.cwd = args.cwd;
|
|
1870
|
+
const result = await adminRequest('POST', '/admin/project-home/videos/script-switch', payload);
|
|
1871
|
+
if (result?.ok === false) return errorResult(adminErrorText(result, 'video_script_switch_set failed'));
|
|
1872
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1873
|
+
}
|
|
1625
1874
|
if (name === 'scheduler_slots_get') {
|
|
1626
1875
|
const result = await adminRequest('GET', '/admin/scheduler/slots');
|
|
1627
1876
|
if (result?.ok === false) return errorResult(adminErrorText(result, 'scheduler_slots_get failed'));
|
|
1628
1877
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1629
1878
|
}
|
|
1879
|
+
if (name === 'usage_hold_get') {
|
|
1880
|
+
const result = await adminRequest('GET', '/admin/usage-hold');
|
|
1881
|
+
if (result?.ok === false) return errorResult(adminErrorText(result, 'usage_hold_get failed'));
|
|
1882
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1883
|
+
}
|
|
1630
1884
|
if (name === 'scheduler_slots_set') {
|
|
1631
1885
|
const refusal = slotsSetRefusal();
|
|
1632
1886
|
if (refusal) return refusal;
|
|
@@ -1697,6 +1951,17 @@ async function handleCallTool(request) {
|
|
|
1697
1951
|
const result = await adminRequest('POST', '/admin/scheduler/cancel-job', { slug, cwd, dependents });
|
|
1698
1952
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1699
1953
|
}
|
|
1954
|
+
if (name === 'scheduler_dismiss_cancelled') {
|
|
1955
|
+
const slug = args && typeof args.slug === 'string' ? args.slug : null;
|
|
1956
|
+
if (!slug) {
|
|
1957
|
+
return errorResult('missing required argument: slug');
|
|
1958
|
+
}
|
|
1959
|
+
const cwd = args && typeof args.cwd === 'string' ? args.cwd : undefined;
|
|
1960
|
+
// Same body as cancel-job (schemas.adminCancelJob); the route validates dependents.
|
|
1961
|
+
const dependents = args && args.dependents && typeof args.dependents === 'object' ? args.dependents : undefined;
|
|
1962
|
+
const result = await adminRequest('POST', '/admin/scheduler/dismiss-cancelled', { slug, cwd, dependents });
|
|
1963
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1964
|
+
}
|
|
1700
1965
|
if (name === 'scheduler_retag_prd') {
|
|
1701
1966
|
const items = Array.isArray(args?.items) ? args.items : null;
|
|
1702
1967
|
if (!items || items.length === 0) {
|
|
@@ -1756,6 +2021,10 @@ async function handleCallTool(request) {
|
|
|
1756
2021
|
if (Array.isArray(result?.files)) {
|
|
1757
2022
|
text += `\nFiles: ${result.files.join(', ')}`;
|
|
1758
2023
|
}
|
|
2024
|
+
const issueLines = result?.ok === false ? formatZodIssueLines(result.details, null) : null;
|
|
2025
|
+
if (issueLines) {
|
|
2026
|
+
text += `\nFix these fields and call again:\n${issueLines.join('\n')}`;
|
|
2027
|
+
}
|
|
1759
2028
|
return { content: [{ type: 'text', text }] };
|
|
1760
2029
|
}
|
|
1761
2030
|
if (name === 'scheduler_create_prds') {
|
|
@@ -1780,7 +2049,8 @@ async function handleCallTool(request) {
|
|
|
1780
2049
|
const result = await adminRequest('POST', '/admin/scheduler/create-prds', payload);
|
|
1781
2050
|
if (result?.ok === false) {
|
|
1782
2051
|
const errs = Array.isArray(result.errors) ? result.errors : [{ index: -1, slug: null, error: result.error ?? 'batch refused' }];
|
|
1783
|
-
const lines =
|
|
2052
|
+
const lines = (!Array.isArray(result.errors) && formatZodIssueLines(result.details, prds))
|
|
2053
|
+
|| errs.map((e) => `- [${e.index}] ${e.slug ?? '(no slug)'}: ${e.error}`);
|
|
1784
2054
|
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
2055
|
}
|
|
1786
2056
|
const written = Array.isArray(result?.prds) ? result.prds : [];
|
|
@@ -1866,7 +2136,12 @@ async function handleCallTool(request) {
|
|
|
1866
2136
|
if (typeof args.outcome !== 'string' || !args.outcome) {
|
|
1867
2137
|
return errorResult('missing required argument: outcome');
|
|
1868
2138
|
}
|
|
1869
|
-
const
|
|
2139
|
+
const held = args.deliverWhen !== undefined && args.deliverWhen !== null;
|
|
2140
|
+
const heldRefusal = held ? await heldReplyAppRefusal(args.deliverWhen) : null;
|
|
2141
|
+
if (heldRefusal) return errorResult(heldRefusal);
|
|
2142
|
+
const claimCheck = await feedbackReplyClaimCheck(args, held);
|
|
2143
|
+
if (claimCheck.refusal) return errorResult(claimCheck.refusal);
|
|
2144
|
+
const payload = { ...args, message: claimCheck.message };
|
|
1870
2145
|
// Identity comes only from this process's env — never from the caller.
|
|
1871
2146
|
delete payload.originClaudeSessionId;
|
|
1872
2147
|
delete payload.originProjectRoot;
|
|
@@ -1902,6 +2177,10 @@ async function handleCallTool(request) {
|
|
|
1902
2177
|
note = ' — the asking Epic could not take it, so the reply fell back to a new proposed session in that project'
|
|
1903
2178
|
+ `${result.fallbackEpicId ? ` (${result.fallbackEpicId})` : ''}; a human there must approve it.`;
|
|
1904
2179
|
}
|
|
2180
|
+
if (held && result?.delivery !== 'scheduled') {
|
|
2181
|
+
note += ` WARNING: deliverWhen was sent, but the app delivered the reply immediately instead of holding it `
|
|
2182
|
+
+ `(delivery '${result?.delivery ?? 'none'}'); any {version} in the message went out unfilled.`;
|
|
2183
|
+
}
|
|
1905
2184
|
}
|
|
1906
2185
|
return { content: [{ type: 'text', text: JSON.stringify(result) + note }] };
|
|
1907
2186
|
}
|
|
@@ -1949,10 +2228,29 @@ async function handleCallTool(request) {
|
|
|
1949
2228
|
if (typeof args.js !== 'string') return errorResult('missing required argument: js');
|
|
1950
2229
|
js = args.js;
|
|
1951
2230
|
}
|
|
2231
|
+
let sounds;
|
|
2232
|
+
if (args.soundPaths !== undefined && args.soundPaths !== null) {
|
|
2233
|
+
const resolved = await resolveSoundPaths(args.soundPaths);
|
|
2234
|
+
if (resolved.error) return errorResult(resolved.error);
|
|
2235
|
+
sounds = resolved.sounds;
|
|
2236
|
+
}
|
|
1952
2237
|
const cwd = resolveCwdArg(args);
|
|
1953
2238
|
const body = { cwd, json: args.json, js };
|
|
1954
2239
|
if (args.replace === true) body.replace = true;
|
|
2240
|
+
if (sounds) body.sounds = sounds;
|
|
1955
2241
|
const result = await adminRequest('POST', '/admin/project-home/character/write', body);
|
|
2242
|
+
// An app older than project sounds ignores body.sounds and still answers
|
|
2243
|
+
// ok — without the sounds array. Report that instead of a false success.
|
|
2244
|
+
if (sounds && result && result.ok === true && !Array.isArray(result.sounds)) {
|
|
2245
|
+
let appVersion = null;
|
|
2246
|
+
try {
|
|
2247
|
+
const cfg = await readAdminConfig();
|
|
2248
|
+
if (typeof cfg.appVersion === 'string' && cfg.appVersion) appVersion = cfg.appVersion;
|
|
2249
|
+
} catch { /* version stays unreported */ }
|
|
2250
|
+
return errorResult(`the running Session Manager app (${appVersion ? `v${appVersion}` : 'version not reported'}) saved character.json `
|
|
2251
|
+
+ 'but ignored its sounds because it predates project sounds, so no sound WAV was written. Call project_character_write again '
|
|
2252
|
+
+ 'with replace: true once the app runs a release with project sounds.');
|
|
2253
|
+
}
|
|
1956
2254
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1957
2255
|
}
|
|
1958
2256
|
if (name === 'project_demo_video_write') {
|
|
@@ -14,11 +14,21 @@ 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
|
+
// GET /admin/usage-hold — the 'pause above' hold POST /admin/tasks refuses on, for runners that start claude -p directly (read-only).
|
|
18
|
+
require('./lib/scheduler/usageHoldRoute.cjs').registerUsageHoldRoute(adminHttp);
|
|
17
19
|
require('./lib/prd/prdCreate.cjs').registerAdminRoute(adminHttp, scheduler.remote);
|
|
18
20
|
require('./lib/prd/prdAdminRoutes.cjs').registerAdminRoute(adminHttp, scheduler.remote);
|
|
19
21
|
require('./lib/feedback-remote/projectHomeAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
20
22
|
// GET /admin/voices + POST /admin/voices/preview — voice library reads for agents; no route changes a voice.
|
|
21
23
|
require('./lib/project-pages/voiceAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
24
|
+
// POST /admin/project-home/videos/script-switch — 'Scripts may run Demo Video', only on the human's verified words.
|
|
25
|
+
require('./lib/project-pages/videoScriptSwitchRoute.cjs').registerVideoScriptSwitchRoute(adminHttp);
|
|
26
|
+
// POST /admin/project-home/videos/run — a project's own script presses Demo Video, only while that switch is on.
|
|
27
|
+
require('./lib/project-pages/videoScriptRunRoute.cjs').registerAdminRoute(adminHttp, {
|
|
28
|
+
startExternalNewSession: chatRunner.startExternalNewSession,
|
|
29
|
+
isTabBusy: chatRunner.isTabBusy,
|
|
30
|
+
listJobRows: () => scheduler.remote.listJobRows(),
|
|
31
|
+
});
|
|
22
32
|
require('./lib/feedback-remote/macroAdminRoutes.cjs').registerAdminRoute(adminHttp, {
|
|
23
33
|
onChanged: deps.onMacrosChanged,
|
|
24
34
|
startExternalNewSession: chatRunner.startExternalNewSession,
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.143.0",
|
|
3
|
+
"gitSha": "9e3a35ddcda5eb03942c74a5c9f9777e31fd81ab",
|
|
4
|
+
"gitShortSha": "9e3a35dd",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-25T04:24:39.027Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|