claude-code-session-manager 0.139.0 → 0.141.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 (154) hide show
  1. package/README.md +20 -4
  2. package/dist/assets/AppSettings-DExeJhqQ.js +2 -0
  3. package/dist/assets/History-DJMiuXyK.js +2 -0
  4. package/dist/assets/{HomeClaudeConfig-CGD2Onjv.js → HomeClaudeConfig-CTp2tkZ4.js} +2 -2
  5. package/dist/assets/{Panel-Csyd9HbD.js → Panel-Bf1Cf8UL.js} +1 -1
  6. package/dist/assets/{ProjectClaudeConfig-C-jlYpC_.js → ProjectClaudeConfig-BWPpypf9.js} +1 -1
  7. package/dist/assets/Scheduler-cyr61UAC.js +16 -0
  8. package/dist/assets/{SkillReferenceGraph-DcscPXAG.js → SkillReferenceGraph-Ba4TkX2C.js} +1 -1
  9. package/dist/assets/{Skills-BpGRKOcY.js → Skills-C1v91GEO.js} +26 -26
  10. package/dist/assets/{TiptapBody-DSU3769X.js → TiptapBody-BrcWVpiW.js} +1 -1
  11. package/dist/assets/{ViewTabs-C0PRZx4_.js → ViewTabs-DXhOWFG0.js} +1 -1
  12. package/dist/assets/{VoiceButton-D2rMurNg.js → VoiceButton-qivnDV6K.js} +1 -1
  13. package/dist/assets/{historyTotals-TcIQs2sh.js → historyTotals-CMCPTKqC.js} +1 -1
  14. package/dist/assets/index-B2TQz3nd.js +3121 -0
  15. package/dist/assets/{index-BCySPdtU.css → index-DKXdXfka.css} +1 -1
  16. package/dist/index.html +2 -2
  17. package/dist-web/app.css +1 -1
  18. package/dist-web/app.js +423 -426
  19. package/package.json +5 -2
  20. package/plugins/AGENTS.md +60 -0
  21. package/plugins/CLAUDE.md +1 -60
  22. package/plugins/session-manager-dev/skills/builder/SKILL.md +4 -2
  23. package/plugins/session-manager-dev/skills/develop/SKILL.md +29 -19
  24. package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
  25. package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
  26. package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
  27. package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
  28. package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
  29. package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
  30. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
  31. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
  32. package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
  33. package/scripts/README.md +1 -0
  34. package/scripts/hooks/guard-tool-risk.cjs +91 -0
  35. package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
  36. package/scripts/ops-sweep.cjs +53 -23
  37. package/scripts/scheduler-mcp-server.cjs +205 -18
  38. package/src/main/build-info.json +4 -4
  39. package/src/main/config.cjs +112 -8
  40. package/src/main/docEdit.cjs +6 -1
  41. package/src/main/files.cjs +7 -27
  42. package/src/main/health.cjs +48 -15
  43. package/src/main/historyAggregator.cjs +88 -5
  44. package/src/main/historyDashboard.cjs +69 -4
  45. package/src/main/index.cjs +56 -2
  46. package/src/main/ipcSchemas.cjs +122 -16
  47. package/src/main/lib/AGENTS.md +54 -0
  48. package/src/main/lib/CLAUDE.md +1 -54
  49. package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
  50. package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
  51. package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
  52. package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
  53. package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
  54. package/src/main/lib/claude/effectiveModelInfo.cjs +90 -20
  55. package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
  56. package/src/main/lib/claude/personaToolScope.cjs +12 -6
  57. package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
  58. package/src/main/lib/claude/runClaudeP.cjs +6 -1
  59. package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
  60. package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
  61. package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
  62. package/src/main/lib/ephemeralCwd.cjs +37 -2
  63. package/src/main/lib/epic/delegationReadiness.cjs +42 -9
  64. package/src/main/lib/epic/epicAdminRoutes.cjs +25 -5
  65. package/src/main/lib/epic/epicOutsideRead.cjs +118 -1
  66. package/src/main/lib/epic/epicOutsideState.cjs +2 -2
  67. package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
  68. package/src/main/lib/epic/epicValidationHook.cjs +24 -4
  69. package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
  70. package/src/main/lib/externalContract.cjs +31 -5
  71. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +55 -1
  72. package/src/main/lib/feedback-remote/crossProjectReply.cjs +106 -11
  73. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +47 -19
  74. package/src/main/lib/feedback-remote/needsYouStore.cjs +6 -2
  75. package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
  76. package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
  77. package/src/main/lib/git/branchSweep.cjs +209 -4
  78. package/src/main/lib/git/gitWorktree.cjs +41 -5
  79. package/src/main/lib/guardShims.cjs +1 -1
  80. package/src/main/lib/historyRollup.cjs +26 -0
  81. package/src/main/lib/insideHome.cjs +27 -1
  82. package/src/main/lib/mcpToolCatalog.cjs +132 -13
  83. package/src/main/lib/mdDocCensus.cjs +59 -78
  84. package/src/main/lib/mdDocRefs.cjs +71 -93
  85. package/src/main/lib/mdNetworkScan.cjs +245 -250
  86. package/src/main/lib/mdReviewRecord.cjs +22 -9
  87. package/src/main/lib/memoryMdNetwork.cjs +5 -12
  88. package/src/main/lib/opsOwnership.cjs +18 -2
  89. package/src/main/lib/opsRetentionSettings.cjs +28 -4
  90. package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
  91. package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
  92. package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
  93. package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
  94. package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
  95. package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
  96. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
  97. package/src/main/lib/prd/depSlugResolve.cjs +104 -4
  98. package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
  99. package/src/main/lib/prd/prdCreate.cjs +377 -23
  100. package/src/main/lib/prd/prdDisposition.cjs +11 -2
  101. package/src/main/lib/prd/prdFrontmatter.cjs +121 -3
  102. package/src/main/lib/process/loginItem.cjs +171 -0
  103. package/src/main/lib/process/loginItemPlan.cjs +193 -0
  104. package/src/main/lib/project-pages/playerBridge.cjs +4 -0
  105. package/src/main/lib/project-pages/videoReview.cjs +268 -0
  106. package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
  107. package/src/main/lib/scheduler/cpuSample.cjs +131 -4
  108. package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
  109. package/src/main/lib/scheduler/loadGate.cjs +24 -6
  110. package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
  111. package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
  112. package/src/main/lib/scheduler/preflightCheck.cjs +97 -0
  113. package/src/main/lib/scheduler/queueStore.cjs +7 -0
  114. package/src/main/lib/scheduler/rcaReport.cjs +21 -1
  115. package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
  116. package/src/main/lib/scheduler/reviewNotice.cjs +39 -0
  117. package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
  118. package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
  119. package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
  120. package/src/main/lib/scheduler/schedulerPaths.cjs +3 -0
  121. package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
  122. package/src/main/lib/scheduler/validationQuality.cjs +282 -0
  123. package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
  124. package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
  125. package/src/main/lib/tasks/taskIpc.cjs +80 -0
  126. package/src/main/lib/tasks/taskLedger.cjs +502 -0
  127. package/src/main/lib/tasks/taskRun.cjs +313 -0
  128. package/src/main/lib/tasks/taskSwitch.cjs +120 -0
  129. package/src/main/loginItemIpc.cjs +35 -0
  130. package/src/main/loopEfficiencyHandlers.cjs +10 -1
  131. package/src/main/projectPages.cjs +6 -15
  132. package/src/main/promptSessionEvents.cjs +9 -1
  133. package/src/main/queueOps.cjs +260 -3
  134. package/src/main/runVerify.cjs +53 -25
  135. package/src/main/scheduler/AGENTS.md +26 -0
  136. package/src/main/scheduler/CLAUDE.md +1 -26
  137. package/src/main/scheduler/budget.cjs +239 -9
  138. package/src/main/scheduler/cancelDependents.cjs +154 -0
  139. package/src/main/scheduler/prdParser.cjs +19 -1
  140. package/src/main/scheduler/reviewLadder.cjs +36 -3
  141. package/src/main/scheduler/starvation.cjs +89 -18
  142. package/src/main/scheduler.cjs +1080 -89
  143. package/src/main/supervisor.cjs +5 -1
  144. package/src/main/templates/PRD_AUTHORING.md +14 -1
  145. package/src/main/validationQualityHandlers.cjs +199 -0
  146. package/src/main/webRemote.cjs +10 -2
  147. package/src/preload/api.d.ts +364 -21
  148. package/src/preload/apiSurface.json +89 -10
  149. package/src/preload/index.cjs +23 -2
  150. package/src/seed/agents/validator.md +19 -8
  151. package/dist/assets/AppSettings-CUfWY9vN.js +0 -2
  152. package/dist/assets/History-DDnqaLyw.js +0 -2
  153. package/dist/assets/Scheduler-NLs08fx7.js +0 -16
  154. package/dist/assets/index-C-d0DCre.js +0 -3124
@@ -4,29 +4,26 @@
4
4
  /**
5
5
  * mdDocRefs — pure helpers for a markdown doc's currency and usage:
6
6
  * - backtickPaths: the repo-path-shaped inline-code tokens a doc names;
7
- * - assessRefs: which named paths no longer exist, and which existing files
8
- * were committed after the doc last changed;
7
+ * - assessRefs: which named paths no longer exist (dead), which name 2+
8
+ * tracked paths by suffix (ambiguous), and which existing files were
9
+ * committed after the doc last changed;
10
+ * - suffixIndex: a resolver from a shorthand token (`lib/x.ts`) to the
11
+ * tracked paths it names (`src/renderer/lib/x.ts`), built once per scan;
9
12
  * - mentionPatterns / parseMentions: the fixed-string patterns for a
10
13
  * `git grep -F -o --null` run and the parse of its output into
11
14
  * doc -> code files that name it.
12
- * No fs, no git: all IO is injected (`exists`, `lastCommitOf`) or done by the
13
- * caller (scanMdNetwork). Fence/comment handling mirrors mdNetworkScan.cjs.
15
+ * No fs, no git: all IO is injected (`exists`, `lastCommitOf`, `ignored`) or done by the
16
+ * caller (scanMdNetwork). backtickPaths (fence/comment handling included) is
17
+ * the shared link convention's, from the skill's mdLinks.cjs; re-exported here.
14
18
  */
15
19
 
16
20
  const path = require('node:path');
21
+ const { backtickPaths } = require('../../../plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs');
17
22
 
18
- const MAX_TOKENS = 200;
19
23
  const MAX_CHANGED = 20;
20
24
  const MAX_PATTERNS = 4000;
21
25
 
22
- const FENCE_RE = /^\s*(`{3,}|~{3,})(.*)$/;
23
- const INLINE_CODE_RE = /(`+)(.{0,1024}?)\1/g;
24
- const BAD_START_RE = /^(?:[/~$<]|http)/i;
25
- const BAD_CHAR_RE = /[*{}<>:]/;
26
- const EXT_RE = /\.[A-Za-z0-9]{1,8}$/;
27
-
28
26
  /**
29
- * @typedef {{ fence: string, inComment: boolean }} LineState
30
27
  * @typedef {{ path: string, ms: number }} ChangedRef
31
28
  * @typedef {{
32
29
  * docPath: string,
@@ -35,83 +32,11 @@ const EXT_RE = /\.[A-Za-z0-9]{1,8}$/;
35
32
  * docMs: number | null,
36
33
  * exists: (repoPath: string) => boolean,
37
34
  * lastCommitOf: (repoPath: string) => number | null | undefined,
35
+ * ignored?: (repoPath: string) => boolean,
36
+ * suffixMatches?: (token: string) => string[],
38
37
  * }} AssessInput
39
38
  */
40
39
 
41
- /** Drops HTML comments (which may span lines) from one line. @param {string} line @param {LineState} state */
42
- function stripComments(line, state) {
43
- let out = '';
44
- let i = 0;
45
- while (i < line.length) {
46
- if (state.inComment) {
47
- const close = line.indexOf('-->', i);
48
- if (close === -1) return out;
49
- state.inComment = false;
50
- i = close + 3;
51
- } else {
52
- const open = line.indexOf('<!--', i);
53
- if (open === -1) return out + line.slice(i);
54
- out += `${line.slice(i, open)} `;
55
- state.inComment = true;
56
- i = open + 4;
57
- }
58
- }
59
- return out;
60
- }
61
-
62
- /** One line outside fences, comments removed (inline code kept). @param {string} line @param {LineState} state */
63
- function visibleLine(line, state) {
64
- const fence = state.inComment ? null : FENCE_RE.exec(line);
65
- if (state.fence) {
66
- if (fence && fence[1][0] === state.fence[0] && fence[1].length >= state.fence.length && fence[2].trim() === '') {
67
- state.fence = '';
68
- }
69
- return '';
70
- }
71
- if (fence && !(fence[1][0] === '`' && fence[2].includes('`'))) {
72
- state.fence = fence[1];
73
- return '';
74
- }
75
- return stripComments(line, state);
76
- }
77
-
78
- /** The repo-path form of one inline-code token, or null. @param {string} raw @returns {string | null} */
79
- function pathToken(raw) {
80
- const t = raw.trim();
81
- if (t === '' || !t.includes('/') || /\s/.test(t) || BAD_START_RE.test(t)) return null;
82
- const bare = t.replace(/:\d+$/, '').replace(/#.*$/, '');
83
- if (bare === '' || BAD_CHAR_RE.test(bare)) return null;
84
- if (!bare.endsWith('/') && !EXT_RE.test(bare)) return null;
85
- return bare;
86
- }
87
-
88
- /**
89
- * Distinct path-shaped inline-code tokens outside fenced code and HTML comments,
90
- * in document order, at most MAX_TOKENS. O(text length).
91
- * @param {string} text
92
- * @returns {string[]}
93
- */
94
- function backtickPaths(text) {
95
- if (typeof text !== 'string' || text === '') return [];
96
- /** @type {LineState} */
97
- const state = { fence: '', inComment: false };
98
- const seen = new Set();
99
- /** @type {string[]} */
100
- const out = [];
101
- for (const line of text.split(/\r?\n/)) {
102
- const visible = visibleLine(line, state);
103
- if (visible === '' || !visible.includes('`')) continue;
104
- for (const m of visible.matchAll(INLINE_CODE_RE)) {
105
- const tok = pathToken(m[2]);
106
- if (tok === null || seen.has(tok)) continue;
107
- seen.add(tok);
108
- out.push(tok);
109
- if (out.length >= MAX_TOKENS) return out;
110
- }
111
- }
112
- return out;
113
- }
114
-
115
40
  /** Normalised repo path, or null when it escapes the repo. @param {string} p @returns {string | null} */
116
41
  function repoPath(p) {
117
42
  const n = path.posix.normalize(p).replace(/\/+$/, '');
@@ -120,17 +45,48 @@ function repoPath(p) {
120
45
  }
121
46
 
122
47
  /**
123
- * Dead refs (tokens that resolve nowhere) and existing file refs committed
124
- * after the doc (newest first, at most MAX_CHANGED).
48
+ * Resolver from a token to every tracked path equal to it or ending with
49
+ * '/<token>' (whole segments only), in listing order. One Map by basename.
50
+ * @param {string[]} paths tracked files and folders, repo-relative POSIX
51
+ * @returns {(token: string) => string[]}
52
+ */
53
+ function suffixIndex(paths) {
54
+ /** @type {Map<string, string[]>} */
55
+ const byBase = new Map();
56
+ for (const p of Array.isArray(paths) ? paths : []) {
57
+ if (typeof p !== 'string' || p === '') continue;
58
+ const base = path.posix.basename(p);
59
+ const list = byBase.get(base);
60
+ if (list) list.push(p);
61
+ else byBase.set(base, [p]);
62
+ }
63
+ return (token) => {
64
+ const t = typeof token === 'string' ? repoPath(token) : null;
65
+ if (t === null) return [];
66
+ const list = byBase.get(path.posix.basename(t)) ?? [];
67
+ return [...new Set(list.filter((p) => p === t || p.endsWith(`/${t}`)))];
68
+ };
69
+ }
70
+
71
+ /**
72
+ * Dead refs (tokens that resolve nowhere: not present, not gitignored, naming
73
+ * no tracked path by suffix), ambiguous refs (a suffix naming 2+ tracked
74
+ * paths), and existing file refs committed after the doc (newest first, at
75
+ * most MAX_CHANGED). A unique suffix match counts as that file. A bare
76
+ * token (no '/', no extension; one trailing '/' allowed) resolves only as an
77
+ * exact top-level path and is otherwise ignored.
125
78
  * @param {AssessInput} input
126
- * @returns {{ deadRefs: string[], changedSince: ChangedRef[] }}
79
+ * @returns {{ deadRefs: string[], ambiguousRefs: string[], changedSince: ChangedRef[] }}
127
80
  */
128
- function assessRefs({ docPath, linkTargets, tokens, docMs, exists, lastCommitOf }) {
81
+ function assessRefs({ docPath, linkTargets, tokens, docMs, exists, lastCommitOf, ignored, suffixMatches }) {
129
82
  const dir = path.posix.dirname(docPath);
130
83
  /** @type {string[]} */
131
84
  const deadRefs = [];
132
85
  const deadSeen = new Set();
133
86
  /** @type {string[]} */
87
+ const ambiguousRefs = [];
88
+ const ambiguousSeen = new Set();
89
+ /** @type {string[]} */
134
90
  const fileRefs = [];
135
91
  const fileSeen = new Set();
136
92
  /** @param {string} p */
@@ -145,12 +101,34 @@ function assessRefs({ docPath, linkTargets, tokens, docMs, exists, lastCommitOf
145
101
  }
146
102
  for (const tok of Array.isArray(tokens) ? tokens : []) {
147
103
  if (typeof tok !== 'string' || tok === '') continue;
104
+ // A token whose only '/' is one trailing slash (`tasks/`) is the bare name.
105
+ const bare = /^[^/]+\/$/.test(tok) ? tok.slice(0, -1) : tok;
106
+ if (!bare.includes('/') && path.posix.extname(bare) === '') {
107
+ // A bare name (`tasks`, `scripts`) is a name unless it is exactly a
108
+ // top-level tracked file or folder: no suffix match, no doc-folder join,
109
+ // never ambiguous, never dead.
110
+ const top = repoPath(bare);
111
+ if (top !== null && exists(top)) addFile(top);
112
+ continue;
113
+ }
148
114
  const isFolder = tok.endsWith('/');
149
115
  const root = repoPath(tok);
150
116
  const local = dir === '.' ? null : repoPath(path.posix.join(dir, tok));
151
117
  const candidates = [root, local].filter((c) => c !== null);
152
118
  if (candidates.length === 0) continue;
153
- const hit = candidates.find((c) => exists(c));
119
+ let hit = candidates.find((c) => exists(c));
120
+ if (hit === undefined && typeof ignored === 'function' && candidates.some((c) => ignored(c))) continue;
121
+ if (hit === undefined && root !== null && typeof suffixMatches === 'function') {
122
+ const matches = suffixMatches(root);
123
+ if (matches.length === 1) hit = matches[0];
124
+ else if (matches.length >= 2) {
125
+ if (!ambiguousSeen.has(root)) {
126
+ ambiguousSeen.add(root);
127
+ ambiguousRefs.push(root);
128
+ }
129
+ continue;
130
+ }
131
+ }
154
132
  if (hit === undefined) {
155
133
  const dead = /** @type {string} */ (root ?? candidates[0]);
156
134
  if (!deadSeen.has(dead)) {
@@ -169,7 +147,7 @@ function assessRefs({ docPath, linkTargets, tokens, docMs, exists, lastCommitOf
169
147
  if (docMs === null || docMs === undefined || ms > docMs) changed.push({ path: p, ms });
170
148
  }
171
149
  changed.sort((a, b) => b.ms - a.ms || (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
172
- return { deadRefs, changedSince: changed.slice(0, MAX_CHANGED) };
150
+ return { deadRefs, ambiguousRefs, changedSince: changed.slice(0, MAX_CHANGED) };
173
151
  }
174
152
 
175
153
  /**
@@ -246,4 +224,4 @@ function parseMentions(stdout, owner) {
246
224
  return out;
247
225
  }
248
226
 
249
- module.exports = { backtickPaths, assessRefs, mentionPatterns, parseMentions };
227
+ module.exports = { backtickPaths, assessRefs, suffixIndex, mentionPatterns, parseMentions };