claude-code-session-manager 0.76.0 → 0.78.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 (123) hide show
  1. package/dist/assets/{AgentLibrary-CBx9l4zN.js → AgentLibrary-13pfo8uY.js} +2 -2
  2. package/dist/assets/{DataModel-Bf0EIE_t.js → DataModel-SUyQbFlg.js} +1 -1
  3. package/dist/assets/{History-CpdtWhC8.js → History-2GJMS703.js} +2 -2
  4. package/dist/assets/{Hooks-DyUbMDmg.js → Hooks-DM2nS3RT.js} +2 -2
  5. package/dist/assets/{HostBilko-By-wIpry.js → HostBilko-BLeC-lpp.js} +1 -1
  6. package/dist/assets/{Library-CQmo4QVC.js → Library-BaRkU9m0.js} +1 -1
  7. package/dist/assets/{ListDetail-BQMd6NOm.js → ListDetail-D5scjSKq.js} +1 -1
  8. package/dist/assets/{MarkdownEditor-DEp43FXX.js → MarkdownEditor-B1lgAo9T.js} +1 -1
  9. package/dist/assets/{McpServers-CLarzwqA.js → McpServers-BzyThQSM.js} +1 -1
  10. package/dist/assets/{Memory-B0sCdIy1.js → Memory-7UdaOTtl.js} +6 -6
  11. package/dist/assets/{Panel-BhWPVOCD.js → Panel-JbTMaOPq.js} +1 -1
  12. package/dist/assets/{Permissions-Ddlq8T_O.js → Permissions-UBam0bJG.js} +2 -2
  13. package/dist/assets/{Plugins-D2oA_2Jl.js → Plugins-B3gUDkeb.js} +2 -2
  14. package/dist/assets/{ProvenanceBadge-DgAgavUM.js → ProvenanceBadge-CeHOub7m.js} +1 -1
  15. package/dist/assets/SaveBar-BcvQEq6h.js +1 -0
  16. package/dist/assets/Scheduler-Dc5qiP24.js +14 -0
  17. package/dist/assets/{ScopeSwitcher-C_zWEtIl.js → ScopeSwitcher-BvGQmw4Y.js} +1 -1
  18. package/dist/assets/{Settings-2Vx3X5SI.js → Settings-C2dEFb-v.js} +1 -1
  19. package/dist/assets/{SkillReferenceGraph-BDEUjlTQ.js → SkillReferenceGraph-CIwlosBc.js} +1 -1
  20. package/dist/assets/{Skills-Cmrz_LeN.js → Skills-C0GzzVrQ.js} +2 -2
  21. package/dist/assets/{SystemPrompt-DVA1eYDP.js → SystemPrompt-mtGPK8zo.js} +1 -1
  22. package/dist/assets/TagLibrary-DX54-mpd.js +1 -0
  23. package/dist/assets/{TiptapBody-DmPc3amD.js → TiptapBody-yADC2RWE.js} +1 -1
  24. package/dist/assets/{Toggle-zfd5LJkK.js → Toggle-CRxaCYLI.js} +1 -1
  25. package/dist/assets/{index-DIjnPkRN.css → index-CYhdtisq.css} +1 -1
  26. package/dist/assets/{index-B_4PNh9T.js → index-D6ymGESc.js} +469 -469
  27. package/dist/assets/{settingsSchema-B9es6fdA.js → settingsSchema-TtMvT5Sx.js} +1 -1
  28. package/dist/index.html +2 -2
  29. package/package.json +8 -2
  30. package/plugins/session-manager-dev/skills/develop/standards.md +1 -1
  31. package/scripts/project-pages-logic/dist/logic.cjs +4709 -0
  32. package/scripts/render-project-pages/dist/renderer.cjs +18900 -0
  33. package/scripts/render-project-pages.cjs +70 -0
  34. package/scripts/scheduler-mcp-server.cjs +115 -1
  35. package/scripts/validate-project-pages-summary.cjs +62 -0
  36. package/src/main/__tests__/agentModelResolve.test.cjs +66 -0
  37. package/src/main/__tests__/health-delegation-chain.test.cjs +2 -1
  38. package/src/main/__tests__/prdAgentType.test.cjs +103 -0
  39. package/src/main/__tests__/prdCreate.test.cjs +138 -0
  40. package/src/main/__tests__/prdFrontmatterAgentType.test.cjs +117 -0
  41. package/src/main/__tests__/prdFrontmatterQuietMachine.test.cjs +108 -0
  42. package/src/main/__tests__/projectHomeAdminRoutes.test.cjs +485 -0
  43. package/src/main/__tests__/projectPages.test.cjs +73 -1
  44. package/src/main/__tests__/rcaReport.test.cjs +54 -0
  45. package/src/main/__tests__/runVerify.test.cjs +94 -0
  46. package/src/main/__tests__/scheduler-autofix-select.test.cjs +43 -0
  47. package/src/main/__tests__/scheduler-bash-timeout-env.test.cjs +103 -0
  48. package/src/main/__tests__/scheduler-effective-concurrency.test.cjs +10 -0
  49. package/src/main/__tests__/scheduler-foreign-wip-manifest.test.cjs +78 -0
  50. package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +242 -0
  51. package/src/main/__tests__/scheduler-investigation-prompt.test.cjs +31 -0
  52. package/src/main/__tests__/scheduler-launch-failure.test.cjs +201 -0
  53. package/src/main/__tests__/scheduler-leftover-fields.test.cjs +52 -0
  54. package/src/main/__tests__/scheduler-looks-done.test.cjs +241 -0
  55. package/src/main/__tests__/scheduler-prd-persona-spawn.test.cjs +135 -0
  56. package/src/main/__tests__/scheduler-quiet-machine-lease.test.cjs +222 -0
  57. package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +147 -0
  58. package/src/main/__tests__/scheduler-shared-tree-guard.test.cjs +212 -0
  59. package/src/main/__tests__/scheduler-worktree-cap-defer.test.cjs +194 -0
  60. package/src/main/__tests__/seedAgentPersonas.test.cjs +75 -14
  61. package/src/main/config.cjs +4 -1
  62. package/src/main/index.cjs +16 -4
  63. package/src/main/ipcSchemas.cjs +53 -0
  64. package/src/main/lib/__tests__/childWithLog.test.cjs +78 -0
  65. package/src/main/lib/__tests__/delegationReadiness.test.cjs +197 -2
  66. package/src/main/lib/__tests__/epicWorktreeMint.test.cjs +4 -2
  67. package/src/main/lib/__tests__/fixChainDepth.test.cjs +40 -0
  68. package/src/main/lib/__tests__/gitWorktree.test.cjs +277 -4
  69. package/src/main/lib/__tests__/gitWorktreeSalvageDelta.test.cjs +153 -0
  70. package/src/main/lib/__tests__/jobWorktree.test.cjs +5 -3
  71. package/src/main/lib/__tests__/landedSinceRun.test.cjs +73 -0
  72. package/src/main/lib/__tests__/launchFailure.test.cjs +220 -0
  73. package/src/main/lib/__tests__/mcpToolCatalog.test.cjs +1 -0
  74. package/src/main/lib/__tests__/opsOwnership.test.cjs +7 -0
  75. package/src/main/lib/__tests__/prdDeclaredPaths.test.cjs +82 -0
  76. package/src/main/lib/__tests__/queueHealth.test.cjs +58 -0
  77. package/src/main/lib/__tests__/quietMachineLease.test.cjs +39 -0
  78. package/src/main/lib/__tests__/reaperHelpers.test.cjs +22 -1
  79. package/src/main/lib/__tests__/schedulerBatchLaunchHold.test.cjs +125 -0
  80. package/src/main/lib/__tests__/schedulerBatchQuietMachine.test.cjs +109 -0
  81. package/src/main/lib/__tests__/schedulerMcpServerHeadlessRefusal.test.cjs +71 -0
  82. package/src/main/lib/__tests__/schedulerMcpServerProjectHome.test.cjs +350 -0
  83. package/src/main/lib/agentModelResolve.cjs +58 -0
  84. package/src/main/lib/childWithLog.cjs +40 -5
  85. package/src/main/lib/claudeBin.cjs +54 -1
  86. package/src/main/lib/definitionOfDone.cjs +3 -2
  87. package/src/main/lib/delegationReadiness.cjs +115 -9
  88. package/src/main/lib/epicWorktreeMint.cjs +5 -2
  89. package/src/main/lib/fixChainDepth.cjs +45 -0
  90. package/src/main/lib/gitWorktree.cjs +464 -19
  91. package/src/main/lib/jobWorktree.cjs +1 -0
  92. package/src/main/lib/landedSinceRun.cjs +55 -0
  93. package/src/main/lib/launchFailure.cjs +357 -0
  94. package/src/main/lib/mcpToolCatalog.cjs +87 -2
  95. package/src/main/lib/opsOwnership.cjs +12 -0
  96. package/src/main/lib/prdAgentType.cjs +84 -0
  97. package/src/main/lib/prdCreate.cjs +57 -1
  98. package/src/main/lib/prdDeclaredPaths.cjs +70 -0
  99. package/src/main/lib/prdFrontmatter.cjs +17 -3
  100. package/src/main/lib/projectHomeAdminRoutes.cjs +402 -0
  101. package/src/main/lib/projectPageSummarySchema.cjs +181 -0
  102. package/src/main/lib/queueHealth.cjs +38 -0
  103. package/src/main/lib/queueStore.cjs +9 -2
  104. package/src/main/lib/quietMachineLease.cjs +48 -0
  105. package/src/main/lib/rcaReport.cjs +53 -3
  106. package/src/main/lib/reaperHelpers.cjs +18 -1
  107. package/src/main/lib/scheduleJobSchema.cjs +31 -0
  108. package/src/main/lib/scheduleJobTransitions.cjs +6 -2
  109. package/src/main/lib/schedulerBatch.cjs +133 -29
  110. package/src/main/lib/schedulerConfig.cjs +19 -0
  111. package/src/main/projectPages.cjs +160 -2
  112. package/src/main/runVerify.cjs +50 -9
  113. package/src/main/scheduler/prdParser.cjs +18 -1
  114. package/src/main/scheduler.cjs +1371 -97
  115. package/src/main/seedAgentPersonas.cjs +62 -21
  116. package/src/main/templates/project-pages-catalog.json +741 -0
  117. package/src/main/templates/project-pages-pipeline.md +417 -0
  118. package/src/preload/api.d.ts +126 -6
  119. package/src/preload/index.cjs +8 -0
  120. package/src/seed/agents/project-home-builder.md +59 -0
  121. package/dist/assets/SaveBar-Qvc4Ek-H.js +0 -1
  122. package/dist/assets/Scheduler-BmYJvNzK.js +0 -14
  123. package/dist/assets/TagLibrary-DYJGAKZu.js +0 -1
@@ -1,18 +1,34 @@
1
1
  /**
2
- * First-boot seeder for the bundled Agent personas (Architect, Dev Lead).
2
+ * First-boot (and stay-current) seeder for the bundled Agent personas.
3
3
  *
4
4
  * On a fresh install `~/.claude/agents/` is empty, so the Agent Library has
5
5
  * nothing to offer — no persona to select for an Epic's Actor. This seeder
6
- * copies the personas bundled at `src/seed/agents/*.md` into `~/.claude/agents/`
7
- * on first boot, one file per persona, and NEVER overwrites a file that
8
- * already exists there (hand-edited or user-authored personas win).
6
+ * copies the personas bundled at `src/seed/agents/*.md` into `~/.claude/agents/`,
7
+ * one file per persona, and NEVER overwrites a file that already exists there
8
+ * (hand-edited or user-authored personas win).
9
9
  *
10
- * Idempotent the same way as seedDevPlugin.cjs:
11
- * 1. A marker file (`~/.claude/session-manager/.agent-personas-seeded`)
12
- * records seed state. Once seeding SUCCEEDS we write `done` and never
13
- * touch it again. A FAILED attempt only bumps an attempt counter and
14
- * retries on the next few boots (bounded by MAX_ATTEMPTS), so a
15
- * transient first-boot failure doesn't permanently skip the personas.
10
+ * Idempotent the same way as seedDevPlugin.cjs, but per-persona rather than
11
+ * whole-run: the marker (`~/.claude/session-manager/.agent-personas-seeded`)
12
+ * records the SET of persona names already delivered (`seeded: string[]`),
13
+ * not just a single `done` flag. Every boot, any name in `PERSONAS` not yet in
14
+ * that set gets copied (subject to the same never-overwrite guard) and added
15
+ * to the set. This is what lets a persona added to `PERSONAS` in a later
16
+ * release reach a machine that already booted successfully long ago — a
17
+ * plain one-shot `done:true` would silently never re-run and that persona
18
+ * would never arrive. A name already in `seeded` is skipped even if its
19
+ * on-disk file was later deleted by hand — deleting a seeded persona is
20
+ * read as an intentional opt-out, not a request to reseed it.
21
+ *
22
+ * A whole-run FAILURE (thrown before any per-persona copy could be attempted,
23
+ * e.g. the bundled source dir is missing) only bumps an attempt counter and
24
+ * retries on the next few boots (bounded by MAX_ATTEMPTS); once attempts are
25
+ * exhausted the seeder gives up permanently and the machine is left exactly
26
+ * where it was — whatever subset of `PERSONAS` it had already reached stays
27
+ * in `seeded`, nothing is retried automatically, and delivering the rest is a
28
+ * manual copy. This is a deliberate choice: an install that has already
29
+ * failed MAX_ATTEMPTS times has something wrong with it (e.g. a read-only
30
+ * home dir) that retrying forever would not fix, and endlessly retrying on
31
+ * every boot would cost a syscall per persona per boot for no benefit.
16
32
  *
17
33
  * Fire-and-forget: called post-window from index.cjs. Errors are logged,
18
34
  * never thrown. Kill-switch: SM_SEED_AGENT_PERSONAS_DISABLE=1.
@@ -23,7 +39,12 @@ const path = require('node:path');
23
39
  const os = require('node:os');
24
40
  const { writeJsonSync } = require('./config.cjs');
25
41
 
26
- const PERSONAS = ['architect', 'dev-lead'];
42
+ const PERSONAS = ['architect', 'dev-lead', 'project-home-builder'];
43
+ // What `{ done: true }` (the pre-seeded-set marker format) meant: only these two personas existed
44
+ // in PERSONAS at the time. Fixed, not derived from the current PERSONAS array above — otherwise
45
+ // every future persona added to PERSONAS would retroactively count as already delivered to a
46
+ // machine that finished its run under the old format, and would silently never seed there.
47
+ const LEGACY_DONE_PERSONAS = ['architect', 'dev-lead'];
27
48
  const MAX_ATTEMPTS = 3; // give a transient first-boot failure a few chances
28
49
 
29
50
  function bundledSourceDir() {
@@ -38,14 +59,30 @@ function markerPath() {
38
59
  return path.join(os.homedir(), '.claude', 'session-manager', '.agent-personas-seeded');
39
60
  }
40
61
 
41
- /** Read the marker → { done:boolean, attempts:number }. Absent = fresh. */
62
+ /**
63
+ * Read the marker → { seeded:string[], attempts:number }. Absent/corrupt/
64
+ * legacy = treated as fresh (a corrupt marker must never block seeding — a
65
+ * try/catch here is load-bearing, not defensive filler).
66
+ *
67
+ * Back-compat: an old-format marker (`{ done: true }`, no `seeded` array)
68
+ * reads as `seeded: LEGACY_DONE_PERSONAS` (the fixed set that existed when
69
+ * that format was the only one) — a machine that already completed a full
70
+ * run under the old scheme picks up only personas added to `PERSONAS` since,
71
+ * not a spurious reseed of architect/dev-lead.
72
+ */
42
73
  function readMarker() {
43
74
  try {
44
75
  const raw = fs.readFileSync(markerPath(), 'utf8').trim();
45
76
  const m = JSON.parse(raw);
46
- return { done: !!m.done, attempts: Number(m.attempts) || 0 };
77
+ if (Array.isArray(m.seeded)) {
78
+ return { seeded: m.seeded.filter((n) => typeof n === 'string'), attempts: Number(m.attempts) || 0 };
79
+ }
80
+ if (m.done) {
81
+ return { seeded: [...LEGACY_DONE_PERSONAS], attempts: Number(m.attempts) || 0 };
82
+ }
83
+ return { seeded: [], attempts: Number(m.attempts) || 0 };
47
84
  } catch {
48
- return { done: false, attempts: 0 };
85
+ return { seeded: [], attempts: 0 };
49
86
  }
50
87
  }
51
88
 
@@ -60,23 +97,27 @@ function writeMarker(state) {
60
97
  async function seedAgentPersonas({ logger = console, writeLog = () => {} } = {}) {
61
98
  if (process.env.SM_SEED_AGENT_PERSONAS_DISABLE === '1') return;
62
99
  const marker = readMarker();
63
- if (marker.done) return; // succeeded before — leave it alone.
100
+ const pending = PERSONAS.filter((name) => !marker.seeded.includes(name));
101
+ if (pending.length === 0) return; // every known persona already delivered.
64
102
  if (marker.attempts >= MAX_ATTEMPTS) return; // gave up — manual copy only.
65
103
 
104
+ const seeded = [...marker.seeded];
66
105
  try {
67
106
  const srcDir = bundledSourceDir();
68
107
  const destDir = destAgentsDir();
69
108
  fs.mkdirSync(destDir, { recursive: true });
70
109
 
71
- for (const name of PERSONAS) {
110
+ for (const name of pending) {
72
111
  const src = path.join(srcDir, `${name}.md`);
73
112
  const dest = path.join(destDir, `${name}.md`);
74
- if (fs.existsSync(dest)) continue; // never overwrite an existing persona
75
- fs.copyFileSync(src, dest);
76
- logger.log?.(`[seedAgentPersonas] seeded ${name}.md`);
113
+ if (!fs.existsSync(dest)) {
114
+ fs.copyFileSync(src, dest);
115
+ logger.log?.(`[seedAgentPersonas] seeded ${name}.md`);
116
+ }
117
+ seeded.push(name); // never overwrite an existing persona, but count it delivered either way
77
118
  }
78
119
 
79
- writeMarker({ done: true, attempts: marker.attempts });
120
+ writeMarker({ seeded, attempts: marker.attempts });
80
121
  } catch (err) {
81
122
  logger.warn?.('[seedAgentPersonas] error:', err?.message ?? err);
82
123
  writeLog({
@@ -85,7 +126,7 @@ async function seedAgentPersonas({ logger = console, writeLog = () => {} } = {})
85
126
  message: 'seed error',
86
127
  meta: { error: err?.message ?? String(err), attempt: marker.attempts + 1, maxAttempts: MAX_ATTEMPTS },
87
128
  });
88
- writeMarker({ done: false, attempts: marker.attempts + 1 });
129
+ writeMarker({ seeded, attempts: marker.attempts + 1 });
89
130
  }
90
131
  }
91
132