claude-code-session-manager 0.127.0 → 0.129.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 (91) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +2 -0
  3. package/dist/assets/{AgentLibrary-DKQznr7o.js → AgentLibrary-Cp250YHF.js} +1 -1
  4. package/dist/assets/{Button-CZXqmIiM.js → Button-DU5UF-6L.js} +1 -1
  5. package/dist/assets/{DataModel-piyV33To.js → DataModel-CPf6f17e.js} +1 -1
  6. package/dist/assets/{History-BxwtrKF2.js → History-B2x-LMlT.js} +1 -1
  7. package/dist/assets/{Hooks-DogeSPII.js → Hooks-BWr33C4Q.js} +1 -1
  8. package/dist/assets/{Library-BDt6EeQQ.js → Library-DBNLTAa8.js} +1 -1
  9. package/dist/assets/{ListDetail-CwS-LKar.js → ListDetail-BGBw6egp.js} +1 -1
  10. package/dist/assets/{McpServers-D2HVljgS.js → McpServers-DywZ50Ec.js} +1 -1
  11. package/dist/assets/{Memory-hNzuOGn8.js → Memory-CnalwnFf.js} +1 -1
  12. package/dist/assets/{Panel-BLDrsUeq.js → Panel-BzIklgKf.js} +1 -1
  13. package/dist/assets/{Permissions-DzZ5vaJW.js → Permissions-mgRifwQc.js} +1 -1
  14. package/dist/assets/{Plugins-Cz9yaxzG.js → Plugins-CV42zfid.js} +2 -2
  15. package/dist/assets/{ProvenanceBadge-CCgLO4m9.js → ProvenanceBadge-DYmX4xgB.js} +1 -1
  16. package/dist/assets/{SaveBar-Shmn699J.js → SaveBar-DxrAfnlC.js} +1 -1
  17. package/dist/assets/{Scheduler-Bqr0WHNd.js → Scheduler-iyUl1NDl.js} +1 -1
  18. package/dist/assets/{ScopeSwitcher-CBx1fB5g.js → ScopeSwitcher-CC8BDPgf.js} +1 -1
  19. package/dist/assets/{Settings-Ci8in-yF.js → Settings-CWBnQghD.js} +1 -1
  20. package/dist/assets/{SkillReferenceGraph-BWwljba8.js → SkillReferenceGraph-DOhiCxuL.js} +1 -1
  21. package/dist/assets/{Skills-BON6o-c4.js → Skills-3Er-9YA9.js} +1 -1
  22. package/dist/assets/{SystemPrompt-D5epIYYs.js → SystemPrompt-BLxdvZ9K.js} +1 -1
  23. package/dist/assets/{TagLibrary-C2qDZROJ.js → TagLibrary-BZ6QHYMQ.js} +1 -1
  24. package/dist/assets/{TiptapBody-SZhI3-bW.js → TiptapBody-Du6jRBoW.js} +1 -1
  25. package/dist/assets/{Toggle-C_qFDG0g.js → Toggle-Qdi2Z7VD.js} +1 -1
  26. package/dist/assets/{ViewTabs-C9q5WCEd.js → ViewTabs-BKfFsziD.js} +1 -1
  27. package/dist/assets/{historyTotals-BCl7IOhY.js → historyTotals-8ecP_6wF.js} +1 -1
  28. package/dist/assets/{index-BnKaYERU.css → index-DtdWBGrI.css} +1 -1
  29. package/dist/assets/index-GI6F_j41.js +3083 -0
  30. package/dist/assets/{settingsSchema-BBrRBrBr.js → settingsSchema-lHTHAabD.js} +1 -1
  31. package/dist/assets/{skillFrontmatter-B01qJk6N.js → skillFrontmatter-8X1Uc282.js} +1 -1
  32. package/dist/assets/{useAgentsDirWatch-CuR3GSjS.js → useAgentsDirWatch-CcsoD1bp.js} +1 -1
  33. package/dist/index.html +2 -2
  34. package/dist-web/app.css +1 -1
  35. package/dist-web/app.js +373 -369
  36. package/package.json +1 -1
  37. package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
  38. package/plugins/session-manager-dev/skills/develop/SKILL.md +4 -2
  39. package/scripts/hooks/lib/guard-inline-implementation-policy.cjs +10 -0
  40. package/scripts/scheduler-mcp-server.cjs +170 -6
  41. package/src/main/build-info.json +4 -4
  42. package/src/main/chatRunner.cjs +8 -0
  43. package/src/main/index.cjs +27 -0
  44. package/src/main/ipcSchemas.cjs +110 -1
  45. package/src/main/lib/claude/agentModelResolve.cjs +31 -10
  46. package/src/main/lib/claude/effectiveModelInfo.cjs +14 -4
  47. package/src/main/lib/claude/modelCatalog.cjs +28 -1
  48. package/src/main/lib/claude/personaToolScope.cjs +40 -2
  49. package/src/main/lib/demo-video-kit/capture.cjs +113 -0
  50. package/src/main/lib/demo-video-kit/character.cjs +97 -0
  51. package/src/main/lib/demo-video-kit/checks.cjs +150 -0
  52. package/src/main/lib/demo-video-kit/frames.cjs +200 -0
  53. package/src/main/lib/demo-video-kit/seedKit.cjs +52 -0
  54. package/src/main/lib/demo-video-kit/sound.cjs +312 -0
  55. package/src/main/lib/epic/developLoopSpawn.cjs +18 -0
  56. package/src/main/lib/epic/epicMint.cjs +4 -2
  57. package/src/main/lib/epic/epicValidationHook.cjs +17 -1
  58. package/src/main/lib/epic/promptSessionsCreateEpic.cjs +4 -3
  59. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +21 -21
  60. package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +185 -34
  61. package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +15 -0
  62. package/src/main/lib/mcpToolCatalog.cjs +71 -11
  63. package/src/main/lib/opsOwnership.cjs +9 -5
  64. package/src/main/lib/persona-macro/builtinMacros.cjs +19 -5
  65. package/src/main/lib/persona-macro/macroJobDispatch.cjs +116 -0
  66. package/src/main/lib/persona-macro/macroJobIpc.cjs +50 -0
  67. package/src/main/lib/persona-macro/macroJobStatus.cjs +112 -0
  68. package/src/main/lib/persona-macro/macroLibrary.cjs +16 -0
  69. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +113 -0
  70. package/src/main/lib/prd/prdCreate.cjs +27 -1
  71. package/src/main/lib/prd/prdFrontmatter.cjs +7 -2
  72. package/src/main/lib/project-pages/pagesLibrary.cjs +171 -0
  73. package/src/main/lib/project-pages/playerBridge.cjs +129 -0
  74. package/src/main/lib/promptSessionSchema.cjs +8 -0
  75. package/src/main/lib/scheduler/scheduleJobSchema.cjs +2 -0
  76. package/src/main/lib/smfileHeaders.cjs +11 -3
  77. package/src/main/projectPages.cjs +107 -30
  78. package/src/main/promptSessionsIpc.cjs +131 -0
  79. package/src/main/scheduler/prdParser.cjs +2 -0
  80. package/src/main/scheduler.cjs +26 -9
  81. package/src/main/seedSchedulerMcp.cjs +10 -1
  82. package/src/main/transcripts.cjs +8 -0
  83. package/src/main/webRemote.cjs +3 -1
  84. package/src/preload/api.d.ts +107 -6
  85. package/src/preload/apiSurface.json +77 -0
  86. package/src/preload/index.cjs +18 -0
  87. package/src/seed/agents/architect.md +8 -8
  88. package/src/seed/agents/demo-video-builder.md +86 -36
  89. package/src/seed/agents/project-home-builder.md +26 -13
  90. package/dist/assets/index-CMIYLbPb.js +0 -3079
  91. package/src/main/lib/epic/epicStandingInstructions.cjs +0 -73
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-session-manager",
3
- "version": "0.127.0",
3
+ "version": "0.129.0",
4
4
  "description": "Local cockpit for the Claude Code CLI — multi-tab terminal, full config surface, scheduler, voice dictation, and live observability.",
5
5
  "type": "module",
6
6
  "main": "src/main/index.cjs",
@@ -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), and hand a finding to another project on this machine (/send-feedback). Together with the session-manager scheduler these form a develop → queue → validate → release loop.",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "author": {
6
6
  "name": "Bilko Bibitkov",
7
7
  "email": "BilkoBibitkov2000@gmail.com",
@@ -27,13 +27,15 @@ new work. **report** = your final message to the human.
27
27
  (`$SM_PROJECT_ROOT`, or the first `git worktree list` path). Why: a worktree copy is
28
28
  frozen at branch time and often lacks this Epic.
29
29
  3. The `sessions` entry whose `claudeSessionId` matches is this Epic: its `id` is
30
- `<epic-id>`, its `tag` drives rule 2.
30
+ `<epic-id>`, its `tag` and `developLoop` drive rule 2.
31
31
  4. No match: stop and say so. Tell the human to open an Epic with the New Epic card and run
32
32
  /develop there. Never mint an Epic or write a PRD without one. Why: only a human creates
33
33
  an Epic.
34
34
  2. **Tag-aware default.** On a `feature`, `bug` or `art` Epic, PRDs are the expected path once scope
35
35
  is clear; start unasked. On a `discussion` Epic it stays available, but wait until the
36
- human settles that code is wanted.
36
+ human settles that code is wanted. An Epic with no tag (No mission) is treated like `discussion`.
37
+ If `developLoop` is `false`, do not author PRDs (the API refuses them): tell the human this
38
+ session was started without the develop loop and a new session with it on is needed to queue work. Stop.
37
39
  3. **Never hand-implement in this session**, even when the plan is agreed. Why: this session
38
40
  runs an expensive planner model; a cheaper executor runs each PRD as a headless `claude -p`
39
41
  job.
@@ -13,6 +13,10 @@
13
13
  * `git rev-parse` to resolve the ops root (see `resolveOpsRootCwd` below).
14
14
  * Calling it directly from a test still removes the outer CLI-process spawn
15
15
  * per case, exercising real filesystem/git behavior instead of mocking it.
16
+ *
17
+ * A developLoop:false Epic was started as a plain session (develop loop off)
18
+ * and may edit inline whatever its tag, like the allowInlineImplementation
19
+ * per-Epic escape hatch.
16
20
  */
17
21
  'use strict';
18
22
 
@@ -132,6 +136,12 @@ function decide(payload) {
132
136
  if (!epic) return buildAllow(); // unresolvable session — allow by construction
133
137
 
134
138
  if (epic.allowInlineImplementation) return buildAllow();
139
+ if (epic.developLoop === false) {
140
+ return {
141
+ continue: true,
142
+ reason: 'This Epic was started with the develop loop off (developLoop: false) as a plain session, so inline edits are allowed.',
143
+ };
144
+ }
135
145
  if (!DENY_TAGS.has(epic.tag)) return buildAllow();
136
146
 
137
147
  const reason = [
@@ -13,6 +13,9 @@
13
13
  *
14
14
  * project_home_write({ cwd?, html }) -> POST /admin/project-home/write
15
15
  * project_demo_video_write({ cwd?, html? | htmlPath? }) -> POST /admin/project-home/demo-video/write
16
+ * project_page_write({ cwd?, pageId, title, topic?, html? | htmlPath? }) -> POST /admin/project-home/pages/write
17
+ * project_character_write({ cwd?, json, js? | jsPath?, replace? }) -> POST /admin/project-home/character/write
18
+ * project_video_write({ cwd?, videoId, title, kind, lengthS, html? | htmlPath?, meta? }) -> POST /admin/project-home/videos/write
16
19
  *
17
20
  * macro_list({ cwd? }) -> GET /admin/macros?cwd=<encoded>
18
21
  * macro_save({ cwd?, id?, label, agentName, tag, prompt }) -> POST /admin/macros/save
@@ -22,8 +25,11 @@
22
25
  *
23
26
  * This is a separate process from the Electron app — it only ever reaches
24
27
  * it over the token-authed loopback HTTP API in admin-api.json, never by
25
- * requiring scheduler.cjs/localAdminHttp.cjs directly. The admin server IS the
26
- * security boundary; this file stays on the client side of it.
28
+ * requiring scheduler.cjs/localAdminHttp.cjs directly. The admin API (loopback +
29
+ * bearer token) is the boundary against other users and remote callers, not
30
+ * against a job running as the same user (it can read admin-api.json). The env
31
+ * refusals in this file (job tool scope, headless queue, macro delete) are
32
+ * guardrails for agents acting in good faith, not containment.
27
33
  */
28
34
 
29
35
  'use strict';
@@ -57,6 +63,23 @@ function withPointer(text) {
57
63
  }
58
64
 
59
65
  const MAX_DEMO_VIDEO_BYTES = 2 * 1024 * 1024;
66
+ const MAX_CHARACTER_JS_BYTES = 300 * 1024;
67
+
68
+ /** Reads a local .js file for project_character_write; errors carry only the reason, never file contents. */
69
+ async function readCharacterJsFile(p) {
70
+ if (typeof p !== 'string' || !path.isAbsolute(p)) return { error: 'jsPath must be an absolute path' };
71
+ if (!/\.(c|m)?js$/i.test(p)) return { error: 'jsPath must end in .js' };
72
+ try {
73
+ const st = await fsp.stat(p);
74
+ if (!st.isFile()) return { error: 'jsPath is not a regular file' };
75
+ if (st.size > MAX_CHARACTER_JS_BYTES) return { error: `jsPath file exceeds ${MAX_CHARACTER_JS_BYTES} bytes` };
76
+ const js = await fsp.readFile(p, 'utf8');
77
+ if (js.length === 0) return { error: 'jsPath file is empty' };
78
+ return { js };
79
+ } catch (err) {
80
+ return { error: `cannot read jsPath: ${err && err.code ? err.code : 'read failed'}` };
81
+ }
82
+ }
60
83
 
61
84
  /** Reads a local .html/.htm file for project_demo_video_write; errors carry only the reason, never file contents. */
62
85
  async function readDemoVideoHtmlFile(p) {
@@ -74,6 +97,16 @@ async function readDemoVideoHtmlFile(p) {
74
97
  }
75
98
  }
76
99
 
100
+ /** Resolves exactly one of html / htmlPath into { html } or { error }. */
101
+ async function resolveHtmlArg(args) {
102
+ const hasHtml = !!args && args.html !== undefined && args.html !== null && args.html !== '';
103
+ const hasPath = !!args && args.htmlPath !== undefined && args.htmlPath !== null && args.htmlPath !== '';
104
+ if (hasHtml === hasPath) return { error: 'provide exactly one of html or htmlPath' };
105
+ if (hasPath) return readDemoVideoHtmlFile(args.htmlPath);
106
+ if (typeof args.html !== 'string') return { error: 'missing required argument: html' };
107
+ return { html: args.html };
108
+ }
109
+
77
110
  function errorResult(text) {
78
111
  return { content: [{ type: 'text', text: withPointer(text) }], isError: true };
79
112
  }
@@ -477,11 +510,26 @@ const TOOLS = [
477
510
  type: 'object',
478
511
  properties: {
479
512
  cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
480
- html: { type: 'string', description: 'The complete self-contained HTML document (<= 1MB; no <script src>, <link href=http*>, @import, or url(http*)).' },
513
+ html: { type: 'string', description: 'The complete self-contained HTML document (<= 1MB; inline <style> only — scripts never run in a page; no <script src>, <link href=http*>, @import, or url(http*)).' },
481
514
  },
482
515
  required: ['html'],
483
516
  },
484
517
  },
518
+ {
519
+ name: 'project_character_write',
520
+ description: descriptionFor('project_character_write'),
521
+ inputSchema: {
522
+ type: 'object',
523
+ properties: {
524
+ cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
525
+ json: { description: 'The character descriptor: a JSON object (or its JSON text).' },
526
+ js: { type: 'string', description: 'The character drawing module source (<= 300KB; no remote references or network-capable APIs). Give exactly one of js / jsPath.' },
527
+ 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.' },
528
+ replace: { type: 'boolean', description: 'Overwrite an existing character. Without it an existing character is refused with 409.' },
529
+ },
530
+ required: ['json'],
531
+ },
532
+ },
485
533
  {
486
534
  name: 'project_demo_video_write',
487
535
  description: descriptionFor('project_demo_video_write'),
@@ -491,11 +539,11 @@ const TOOLS = [
491
539
  cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
492
540
  html: {
493
541
  type: 'string',
494
- description: 'The complete self-contained HTML/JS document for a 30-second-or-less demo video (<= 2MB). '
542
+ description: 'The complete self-contained HTML/JS document for a demo video of 60 seconds or less (<= 2MB). '
495
543
  + 'It is rejected for: being empty; <script src>, <link href=http*>, @import, or url(http*) (no remote references); '
496
544
  + 'fetch/XMLHttpRequest/WebSocket/EventSource/sendBeacon/dynamic import/importScripts/<iframe>/<object>/<embed>/window.open/'
497
545
  + 'any http(s)/// src or href (no network-capable APIs — the document is CSP-fenced after it is written); '
498
- + 'or missing a <meta name="sm-demo-duration" content="N"> tag with 5 <= N <= 30.',
546
+ + 'or missing a <meta name="sm-demo-duration" content="N"> tag with 5 <= N <= 60.',
499
547
  },
500
548
  htmlPath: {
501
549
  type: 'string',
@@ -505,6 +553,40 @@ const TOOLS = [
505
553
  },
506
554
  },
507
555
  },
556
+ {
557
+ name: 'project_page_write',
558
+ description: descriptionFor('project_page_write'),
559
+ inputSchema: {
560
+ type: 'object',
561
+ properties: {
562
+ cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
563
+ pageId: { type: 'string', description: 'Stable id (kebab-case) of the knowledge page; writing the same id replaces that page.' },
564
+ title: { type: 'string', description: 'Human title shown in the page list.' },
565
+ topic: { type: 'string', description: 'Optional: one-line topic/summary of the page.' },
566
+ html: { type: 'string', description: 'The complete self-contained HTML document (<= 1MB). Inline <style> only; scripts never run in a page. No <script src>, <link href=http*>, @import, or url(http*).' },
567
+ htmlPath: { type: 'string', description: 'Absolute path to a local .html/.htm file holding the document (same rules as html). Give exactly one of html / htmlPath.' },
568
+ },
569
+ required: ['pageId', 'title'],
570
+ },
571
+ },
572
+ {
573
+ name: 'project_video_write',
574
+ description: descriptionFor('project_video_write'),
575
+ inputSchema: {
576
+ type: 'object',
577
+ properties: {
578
+ cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
579
+ videoId: { type: 'string', description: 'Stable id (kebab-case) of the video; writing the same id replaces that video.' },
580
+ title: { type: 'string', description: 'Human title shown in the video list.' },
581
+ kind: { type: 'string', description: 'What the video is, e.g. project-demo or marketing.' },
582
+ lengthS: { type: 'number', description: 'Length of the video in seconds.' },
583
+ html: { type: 'string', description: 'The complete self-contained HTML/JS video document (<= 2MB; no remote references or network-capable APIs).' },
584
+ htmlPath: { type: 'string', description: 'Absolute path to a local .html/.htm file holding the document (<= 2MB). Prefer this for base64 data URIs. Give exactly one of html / htmlPath.' },
585
+ meta: { type: 'object', description: 'Optional: free-form metadata object stored with the video.' },
586
+ },
587
+ required: ['videoId', 'title', 'kind', 'lengthS'],
588
+ },
589
+ },
508
590
  {
509
591
  name: 'macro_list',
510
592
  description: descriptionFor('macro_list'),
@@ -593,6 +675,36 @@ const TOOLS = [
593
675
  },
594
676
  ];
595
677
 
678
+ // SM_SCHEDULER_JOB_MCP_TOOLS: JSON array of full mcp__<server>__<tool> names a
679
+ // scoped job may use. Unset = no filter. Malformed = fail closed. Guardrail only.
680
+ function jobToolScope() {
681
+ const raw = process.env.SM_SCHEDULER_JOB_MCP_TOOLS;
682
+ if (raw === undefined) return null;
683
+ let parsed;
684
+ try { parsed = JSON.parse(raw); } catch { return { names: new Set(), malformed: true }; }
685
+ if (!Array.isArray(parsed) || !parsed.every((e) => typeof e === 'string')) {
686
+ return { names: new Set(), malformed: true };
687
+ }
688
+ const names = new Set();
689
+ for (const entry of parsed) {
690
+ if (!entry.startsWith('mcp__')) continue;
691
+ const i = entry.indexOf('__', 5);
692
+ if (i > 0) names.add(entry.slice(i + 2));
693
+ }
694
+ return { names, malformed: false };
695
+ }
696
+
697
+ function jobToolScopeRefusal(toolName) {
698
+ const scope = jobToolScope();
699
+ if (!scope || (!scope.malformed && scope.names.has(toolName))) return null;
700
+ const text = scope.malformed
701
+ ? `refused: ${toolName} was not run because SM_SCHEDULER_JOB_MCP_TOOLS is malformed (expected a JSON array of tool-name strings). `
702
+ + 'Say in your final result that the tool scope is malformed and stop.'
703
+ : `refused: ${toolName} is outside the tool scope of headless scheduled job '${process.env.SM_SCHEDULER_JOB_SLUG || '(unknown)'}' — its persona does not list it. `
704
+ + "Starting this server yourself does not widen a job's scope. Say in your final result which tool was missing and stop.";
705
+ return { content: [{ type: 'text', text }], isError: true };
706
+ }
707
+
596
708
  // A macro is a human's button and its delete cannot be undone, so this runs
597
709
  // only in a session a human is attached to. headlessQueueRefusal does not fit:
598
710
  // it lets an architect job through.
@@ -642,6 +754,8 @@ function withCreateOrigin(payload) {
642
754
 
643
755
  async function handleCallTool(request) {
644
756
  const { name, arguments: args } = request.params;
757
+ const scopeRefusal = jobToolScopeRefusal(name);
758
+ if (scopeRefusal) return scopeRefusal;
645
759
  try {
646
760
  if (name === 'scheduler_reset_job') {
647
761
  const slug = args && typeof args.slug === 'string' ? args.slug : null;
@@ -857,6 +971,28 @@ async function handleCallTool(request) {
857
971
  const result = await adminRequest('POST', '/admin/project-home/write', { cwd, html: args.html });
858
972
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
859
973
  }
974
+ if (name === 'project_character_write') {
975
+ if (!args || args.json === undefined || args.json === null || args.json === '') {
976
+ return errorResult('missing required argument: json');
977
+ }
978
+ const hasJs = args.js !== undefined && args.js !== null && args.js !== '';
979
+ const hasJsPath = args.jsPath !== undefined && args.jsPath !== null && args.jsPath !== '';
980
+ if (hasJs === hasJsPath) return errorResult('provide exactly one of js or jsPath');
981
+ let js;
982
+ if (hasJsPath) {
983
+ const loaded = await readCharacterJsFile(args.jsPath);
984
+ if (loaded.error) return errorResult(loaded.error);
985
+ js = loaded.js;
986
+ } else {
987
+ if (typeof args.js !== 'string') return errorResult('missing required argument: js');
988
+ js = args.js;
989
+ }
990
+ const cwd = resolveCwdArg(args);
991
+ const body = { cwd, json: args.json, js };
992
+ if (args.replace === true) body.replace = true;
993
+ const result = await adminRequest('POST', '/admin/project-home/character/write', body);
994
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
995
+ }
860
996
  if (name === 'project_demo_video_write') {
861
997
  const hasHtml = !!args && args.html !== undefined && args.html !== null && args.html !== '';
862
998
  const hasPath = !!args && args.htmlPath !== undefined && args.htmlPath !== null && args.htmlPath !== '';
@@ -876,6 +1012,31 @@ async function handleCallTool(request) {
876
1012
  const result = await adminRequest('POST', '/admin/project-home/demo-video/write', { cwd, html });
877
1013
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
878
1014
  }
1015
+ if (name === 'project_page_write') {
1016
+ if (!args || typeof args.pageId !== 'string' || !args.pageId || typeof args.title !== 'string' || !args.title) {
1017
+ return errorResult('missing required arguments: pageId, title');
1018
+ }
1019
+ const loaded = await resolveHtmlArg(args);
1020
+ if (loaded.error) return errorResult(loaded.error);
1021
+ const cwd = resolveCwdArg(args);
1022
+ const body = { cwd, pageId: args.pageId, title: args.title, html: loaded.html };
1023
+ if (typeof args.topic === 'string' && args.topic) body.topic = args.topic;
1024
+ const result = await adminRequest('POST', '/admin/project-home/pages/write', body);
1025
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1026
+ }
1027
+ if (name === 'project_video_write') {
1028
+ if (!args || typeof args.videoId !== 'string' || !args.videoId || typeof args.title !== 'string' || !args.title
1029
+ || typeof args.kind !== 'string' || !args.kind || typeof args.lengthS !== 'number' || !Number.isFinite(args.lengthS)) {
1030
+ return errorResult('missing required arguments: videoId, title, kind, lengthS');
1031
+ }
1032
+ const loaded = await resolveHtmlArg(args);
1033
+ if (loaded.error) return errorResult(loaded.error);
1034
+ const cwd = resolveCwdArg(args);
1035
+ const body = { cwd, videoId: args.videoId, title: args.title, kind: args.kind, lengthS: args.lengthS, html: loaded.html };
1036
+ if (args.meta && typeof args.meta === 'object') body.meta = args.meta;
1037
+ const result = await adminRequest('POST', '/admin/project-home/videos/write', body);
1038
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
1039
+ }
879
1040
  if (name === 'macro_list') {
880
1041
  const cwd = resolveCwdArg(args);
881
1042
  const result = await adminRequest('GET', `/admin/macros?cwd=${encodeURIComponent(cwd)}`);
@@ -969,7 +1130,10 @@ async function main() {
969
1130
  createStdioServer({
970
1131
  name: 'session-manager-scheduler',
971
1132
  version: '1.0.0',
972
- listTools: () => TOOLS,
1133
+ listTools: () => {
1134
+ const scope = jobToolScope();
1135
+ return scope ? TOOLS.filter((t) => scope.names.has(t.name)) : TOOLS;
1136
+ },
973
1137
  callTool: (params) => handleCallTool({ params }),
974
1138
  }).start();
975
1139
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "0.127.0",
3
- "gitSha": "40558ffe7293dc3e982e98ea4eb282c9c72824c9",
4
- "gitShortSha": "40558ffe",
2
+ "version": "0.129.0",
3
+ "gitSha": "6bb933179c6b91ea91b4ef8bfe113b95fae19466",
4
+ "gitShortSha": "6bb93317",
5
5
  "gitBranch": "HEAD",
6
- "builtAt": "2026-11-03T03:08:26.011Z",
6
+ "builtAt": "2026-11-06T22:56:53.741Z",
7
7
  "dirty": false
8
8
  }
@@ -48,6 +48,7 @@ const sessionSlots = require('./lib/scheduler/sessionSlots.cjs');
48
48
  const opsErrorLog = require('./lib/telemetry/opsErrorLog.cjs');
49
49
  const { killTree, detachedSpawnOpts } = require('./lib/process/killTree.cjs');
50
50
  const agentModelResolve = require('./lib/claude/agentModelResolve.cjs');
51
+ const { developLoopOffSettingsArgs } = require('./lib/epic/developLoopSpawn.cjs');
51
52
  const { resolveEpicEffort, effortArgs } = require('./lib/claude/agentEffortResolve.cjs');
52
53
  const { planEpicSpawn } = require('./lib/epic/epicSpawnPlan.cjs');
53
54
  const epicWorktreeMint = require('./lib/epic/epicWorktreeMint.cjs');
@@ -631,6 +632,12 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
631
632
  // effortArgs() yields NO tokens for inherit/absent/dangling.
632
633
  const effortFlags = effortArgs(resolveEpicEffort({ cwd, claudeSessionId: sessionId }).effort);
633
634
 
635
+ // Develop-loop-off Epics launch with the dev plugin disabled for this session only.
636
+ let loopOffArgs = [];
637
+ try {
638
+ loopOffArgs = developLoopOffSettingsArgs(agentModelResolve.findEpicByClaudeSessionId(cwd, sessionId));
639
+ } catch { /* lookup failure = launch as today */ }
640
+
634
641
  // Main is authoritative about --resume vs --session-id AND the spawn cwd, and it decides
635
642
  // them TOGETHER (epicSpawnPlan.cjs): a transcript under an encoding the spawn cwd cannot see
636
643
  // must never yield a claimed flag. Unreachable / closed Epics are refused before any spawn.
@@ -665,6 +672,7 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
665
672
  '--model', model,
666
673
  ...effortFlags,
667
674
  '--dangerously-skip-permissions',
675
+ ...loopOffArgs,
668
676
  '--output-format', 'stream-json',
669
677
  '--verbose',
670
678
  ];
@@ -103,6 +103,7 @@ const queueOps = require('./queueOps.cjs');
103
103
  const pluginInstall = require('./pluginInstall.cjs');
104
104
  const { seedDevPlugin } = require('./seedDevPlugin.cjs');
105
105
  const { seedAgentPersonas } = require('./seedAgentPersonas.cjs');
106
+ const { seedDemoVideoKit } = require('./lib/demo-video-kit/seedKit.cjs');
106
107
  const { seedSchedulerMcp } = require('./seedSchedulerMcp.cjs');
107
108
  const { runSeedersSerially } = require('./lib/runSeeders.cjs');
108
109
  const { getSeedStatus } = require('./seedStatus.cjs');
@@ -606,6 +607,16 @@ function broadcastMacrosChanged() {
606
607
  sendIfAlive(mainWindow, 'macros:changed', {});
607
608
  }
608
609
  ipcMain.handle('macros:list', () => macroLibrary.listMacros());
610
+ // Background macro jobs: dispatch a built-in macro as a scheduler PRD inside an existing Epic.
611
+ // createPrd is wired exactly as chat:create-prd (below) so its own reconcile request queues the row.
612
+ require('./lib/persona-macro/macroJobIpc.cjs').registerMacroJobIpc(ipcMain, {
613
+ schemas,
614
+ validatePath: require('./config.cjs').validatePath,
615
+ readActiveIndex: require('./lib/epic/epicMint.cjs').readActiveIndex,
616
+ createPrd: (input) => prdCreate.createPrd(input, scheduler.remote),
617
+ loadJobs: async () => (await require('./lib/scheduler/queueStore.cjs').readMerged()).jobs || [],
618
+ archivePrd: (slug, cwd) => queueOps.archiveMany([slug], cwd),
619
+ });
609
620
  ipcMain.handle('macros:save', validated(schemas.macrosSave, async (payload) => {
610
621
  const macro = await macroLibrary.saveMacro(payload);
611
622
  broadcastMacrosChanged();
@@ -1042,6 +1053,7 @@ registerLoopEfficiencyHandlers();
1042
1053
  pluginInstall.registerPluginInstallHandlers();
1043
1054
  memoryTool.registerMemoryHandlers();
1044
1055
  activeIndexMerge.registerActiveIndexMergeHandlers();
1056
+ require('./promptSessionsIpc.cjs').registerPromptSessionsReadHandlers();
1045
1057
  promptSessionsCreateEpic.registerPromptSessionsCreateEpicHandlers();
1046
1058
  require('./lib/epic/archivedTranscript.cjs').registerIpc(ipcMain);
1047
1059
  customerFeedbackIpc.registerCustomerFeedbackHandlers();
@@ -1455,6 +1467,19 @@ app.whenReady().then(async () => {
1455
1467
  { role: 'selectAll' },
1456
1468
  ],
1457
1469
  },
1470
+ {
1471
+ label: 'Help',
1472
+ submenu: [
1473
+ {
1474
+ label: 'Book a Free Hour with Bilko',
1475
+ click: () => {
1476
+ if (mainWindow && !mainWindow.isDestroyed()) {
1477
+ sendIfAlive(mainWindow, 'app:open-free-hour');
1478
+ }
1479
+ },
1480
+ },
1481
+ ],
1482
+ },
1458
1483
  ];
1459
1484
  Menu.setApplicationMenu(Menu.buildFromTemplate(template));
1460
1485
 
@@ -1522,6 +1547,8 @@ app.whenReady().then(async () => {
1522
1547
  bootSeedingPromise = runSeedersSerially([
1523
1548
  { name: 'dev-plugin', run: () => seedDevPlugin({ logger: console, writeLog: logs.writeLine }) },
1524
1549
  { name: 'agent-personas', run: () => seedAgentPersonas({ logger: console, writeLog: logs.writeLine }) },
1550
+ // Demo-video kit -> ~/.claude/session-manager/demo-video-kit/ (stamp-gated). SM_SEED_DEMO_VIDEO_KIT_DISABLE=1 to opt out.
1551
+ { name: 'demo-video-kit', run: () => seedDemoVideoKit({ logger: console, writeLog: logs.writeLine }) },
1525
1552
  { name: 'scheduler-mcp', run: () => seedSchedulerMcp({ logger: console, writeLog: logs.writeLine }) },
1526
1553
  ]).catch((e) => {
1527
1554
  logs.writeLine({ scope: 'seed', level: 'error', message: 'seed chain failed', meta: { error: e?.message } });
@@ -209,6 +209,15 @@ const promptSessionsMergeActiveIndex = z.object({
209
209
  // routes state/promptSessions.ts's createPromptSession through it. `tag`/
210
210
  // `source` reuse promptSessionSchema.cjs's own enums rather than retyping
211
211
  // the value lists a third time.
212
+ // Archive write for markCompleted — main resolves the path via opsPath() and
213
+ // writes as the 'epics' owner, so the renderer (and a remote browser) never
214
+ // hands over a path. `archive` is opaque here; the handler checks its shape.
215
+ const promptSessionsWriteArchive = z.object({
216
+ cwd: z.string().min(1).max(4096),
217
+ epicId: z.string().regex(PROMPT_SESSION_ID_RE),
218
+ archive: z.record(z.string(), z.unknown()),
219
+ }).strict();
220
+
212
221
  const promptSessionsCreateEpic = z.object({
213
222
  cwd: z.string().min(1).max(4096),
214
223
  goalText: z.string().min(1).max(20000),
@@ -217,6 +226,8 @@ const promptSessionsCreateEpic = z.object({
217
226
  // Per-Epic runtime overrides (New Session card) — absent = use the persona's own value.
218
227
  model: z.string().min(1).max(256).optional(),
219
228
  effort: z.string().min(1).max(64).optional(),
229
+ // false = develop loop off for this Epic's whole life; absent = on.
230
+ developLoop: z.boolean().optional(),
220
231
  source: EpicSourceSchema.optional(),
221
232
  // The full first-prompt body + its labeled sections (epicIntake.ts's
222
233
  // composeEpicIntake) — both optional, since not every mint caller (e.g. a
@@ -233,6 +244,9 @@ const promptSessionsCreateWorktree = z.object({
233
244
  });
234
245
 
235
246
  // Renderer entry point for reopening a completed Epic in place (lib/epic/epicReopen.cjs).
247
+ const promptSessionsCwd = z.object({ cwd: z.string().min(1).max(4096) }).strict();
248
+ const promptSessionsReadArchived = z.object({ cwd: z.string().min(1).max(4096), epicId: z.string().regex(PROMPT_SESSION_ID_RE) }).strict();
249
+ const promptSessionsReadSessionTranscript = z.object({ cwd: z.string().min(1).max(4096), sessionId: z.string().min(1).max(128) }).strict();
236
250
  const promptSessionsReopen = z.object({ cwd: z.string().min(1).max(4096), epicId: z.string().regex(PROMPT_SESSION_ID_RE) }).strict();
237
251
 
238
252
  // Renderer entry point for folding an Epic's isolated git worktree branch
@@ -651,6 +665,14 @@ const agentsSavePersona = AgentPersonaSaveSchema;
651
665
  const macrosSave = MacroSaveSchema;
652
666
  const macrosDelete = MacroDeleteSchema;
653
667
  const macrosSetProject = MacroSetProjectSchema;
668
+ // Background macro job (macroJobIpc.cjs): press a built-in macro as a scheduler PRD inside an existing Epic.
669
+ const macrosDispatchJob = z.object({
670
+ cwd: z.string().min(1).max(4096),
671
+ macroId: z.string().min(1).max(128),
672
+ epicId: z.string().min(1).max(200),
673
+ extraInstructions: z.string().max(4000).optional(),
674
+ });
675
+ const macrosJobStatus = z.object({ cwd: z.string().min(1).max(4096) });
654
676
 
655
677
  // ──────────────────────────────────────────── Memory tool (Bundle C, cycle 3)
656
678
  // Workspace-scoped markdown store at ~/.claude/projects/<ws>/memory/.
@@ -785,7 +807,7 @@ const agentsGetPersonaBody = z.object({
785
807
  // ──────────────────────────────────────────── Effective model info (PRD: what-will-this-run-as)
786
808
  const agentsResolveModelInfo = z.object({
787
809
  cwd: z.string().min(1).max(4096),
788
- agentType: z.string().min(1).max(200),
810
+ agentType: z.string().min(1).max(200).optional(),
789
811
  }).strict();
790
812
 
791
813
  // ──────────────────────────────────────────── Live model/effort catalog (modelCatalog.cjs)
@@ -826,6 +848,80 @@ const projectDemoVideoAdminWriteBody = z.object({
826
848
  html: z.string(),
827
849
  }).strict();
828
850
 
851
+ // ──────────────────────────────────────────── Project Home library entries
852
+ // One id rule for every library entry; '_character' starts with '_' so it can
853
+ // never match.
854
+ const ENTRY_ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
855
+ const entryId = z.string().regex(ENTRY_ID_RE);
856
+ const projectVideoReportFields = {
857
+ lufs: z.number().nullable(),
858
+ truePeakDb: z.number().nullable(),
859
+ speechS: z.number().nullable(),
860
+ readingGrade: z.number().nullable(),
861
+ checks: z.array(z.object({
862
+ id: z.string().max(60),
863
+ ok: z.boolean(),
864
+ detail: z.string().max(300),
865
+ }).strict()).max(60),
866
+ };
867
+ const projectVideoMeta = z.object({
868
+ id: entryId,
869
+ title: z.string().min(1).max(120),
870
+ kind: z.enum(['project-demo', 'blog-post', 'feature']),
871
+ style: z.string().max(40),
872
+ lengthS: z.number().int().min(5).max(60),
873
+ createdAt: z.string().datetime(),
874
+ character: z.string().max(80).nullable(),
875
+ sources: z.array(z.object({
876
+ claim: z.string().max(300),
877
+ source: z.string().max(600),
878
+ ref: z.string().max(300),
879
+ }).strict()).max(40),
880
+ report: z.object({ ...projectVideoReportFields, bytes: z.number().int() }).strict(),
881
+ macroVersion: z.number().int().min(0),
882
+ seedVersion: z.number().int().min(0),
883
+ model: z.string().max(60),
884
+ effort: z.string().max(60),
885
+ }).strict();
886
+ const projectPagesEntryKind = z.enum(['knowledge', 'video']);
887
+ const projectPagesRename = z.object({
888
+ cwd: z.string().min(1).max(4096),
889
+ kind: projectPagesEntryKind,
890
+ id: entryId,
891
+ title: z.string().min(1).max(120),
892
+ }).strict();
893
+ const projectPagesDelete = z.object({
894
+ cwd: z.string().min(1).max(4096),
895
+ kind: projectPagesEntryKind,
896
+ id: entryId,
897
+ }).strict();
898
+ const projectPageMeta = z.object({
899
+ id: entryId,
900
+ title: z.string().min(1).max(120),
901
+ topic: z.string().max(120),
902
+ createdAt: z.string().datetime(),
903
+ model: z.string().max(60),
904
+ }).strict();
905
+ const projectPageAdminWriteBody = z.object({
906
+ cwd: z.string().min(1).max(4096).optional(),
907
+ pageId: entryId,
908
+ title: z.string().min(1).max(120),
909
+ topic: z.string().max(120).optional(),
910
+ html: z.string(),
911
+ }).strict();
912
+ // Server stamps id, createdAt and report.bytes.
913
+ const projectVideoAdminWriteBody = z.object({
914
+ cwd: z.string().min(1).max(4096).optional(),
915
+ videoId: entryId,
916
+ title: z.string().min(1).max(120),
917
+ kind: z.enum(['project-demo', 'blog-post', 'feature']),
918
+ lengthS: z.number().int().min(5).max(60),
919
+ html: z.string(),
920
+ meta: projectVideoMeta.omit({ id: true, createdAt: true }).extend({
921
+ report: z.object(projectVideoReportFields).strict(),
922
+ }),
923
+ }).strict();
924
+
829
925
  const projectBriefSetPin = z.object({
830
926
  cwd: z.string().min(1).max(4096),
831
927
  block: PROJECT_BRIEF_BLOCK,
@@ -1275,6 +1371,7 @@ module.exports = {
1275
1371
  SCHEDULE_SLUG_RE,
1276
1372
  SCHEDULE_RUN_ID_RE,
1277
1373
  PRD_CREATE_SLUG_RE,
1374
+ ENTRY_ID_RE,
1278
1375
  READ_COMMANDS,
1279
1376
  SAS_GATED_READS,
1280
1377
  MUTATE_COMMANDS,
@@ -1353,17 +1450,27 @@ module.exports = {
1353
1450
  memoryProposeFix,
1354
1451
  projectBriefCwd,
1355
1452
  projectPagesCwd,
1453
+ projectPagesRename,
1454
+ projectPagesDelete,
1356
1455
  projectHomeAdminWriteBody,
1357
1456
  projectDemoVideoAdminWriteBody,
1457
+ projectVideoMeta,
1458
+ projectPageMeta,
1459
+ projectPageAdminWriteBody,
1460
+ projectVideoAdminWriteBody,
1358
1461
  projectBriefSetPin,
1359
1462
  projectBriefUpdate,
1360
1463
  promptSessionTranscriptAppend,
1361
1464
  promptSessionTranscriptRead,
1362
1465
  epicDelegationStatsGet,
1363
1466
  promptSessionsMergeActiveIndex,
1467
+ promptSessionsWriteArchive,
1364
1468
  promptSessionsCreateEpic,
1365
1469
  promptSessionsCreateWorktree,
1366
1470
  promptSessionsReopen,
1471
+ promptSessionsCwd,
1472
+ promptSessionsReadArchived,
1473
+ promptSessionsReadSessionTranscript,
1367
1474
  promptSessionsMergeToMain,
1368
1475
  promptSessionsGetWorktreeDisabled,
1369
1476
  promptSessionsSetWorktreeDisabled,
@@ -1390,6 +1497,8 @@ module.exports = {
1390
1497
  macrosSave,
1391
1498
  macrosDelete,
1392
1499
  macrosSetProject,
1500
+ macrosDispatchJob,
1501
+ macrosJobStatus,
1393
1502
  agentsGetPersonaBody,
1394
1503
  agentsResolveModelInfo,
1395
1504
  modelsCatalog,