claude-code-session-manager 0.139.0 → 0.140.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/README.md +20 -4
- package/dist/assets/AppSettings-CMFEM68R.js +2 -0
- package/dist/assets/History--JwsFnbn.js +2 -0
- package/dist/assets/{HomeClaudeConfig-CGD2Onjv.js → HomeClaudeConfig-ijEXs--3.js} +2 -2
- package/dist/assets/{Panel-Csyd9HbD.js → Panel-CALyU0pe.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-C-jlYpC_.js → ProjectClaudeConfig-sdlA-fUb.js} +1 -1
- package/dist/assets/Scheduler-YT3j8SUa.js +16 -0
- package/dist/assets/{SkillReferenceGraph-DcscPXAG.js → SkillReferenceGraph-CxAuwhNN.js} +1 -1
- package/dist/assets/{Skills-BpGRKOcY.js → Skills-DtRzghn5.js} +26 -26
- package/dist/assets/{TiptapBody-DSU3769X.js → TiptapBody-DApeu7x8.js} +1 -1
- package/dist/assets/{ViewTabs-C0PRZx4_.js → ViewTabs-B7qLXRAH.js} +1 -1
- package/dist/assets/{VoiceButton-D2rMurNg.js → VoiceButton-DtStfv1H.js} +1 -1
- package/dist/assets/{historyTotals-TcIQs2sh.js → historyTotals-ydfnwepc.js} +1 -1
- package/dist/assets/index-CtxruO1L.js +3121 -0
- package/dist/assets/{index-BCySPdtU.css → index-DKXdXfka.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +423 -426
- package/package.json +5 -2
- package/plugins/AGENTS.md +60 -0
- package/plugins/CLAUDE.md +1 -60
- package/plugins/session-manager-dev/skills/develop/SKILL.md +26 -19
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
- package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
- package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
- package/scripts/README.md +1 -0
- package/scripts/hooks/guard-tool-risk.cjs +91 -0
- package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
- package/scripts/ops-sweep.cjs +53 -23
- package/scripts/scheduler-mcp-server.cjs +200 -18
- package/src/main/build-info.json +4 -4
- package/src/main/config.cjs +112 -8
- package/src/main/docEdit.cjs +6 -1
- package/src/main/files.cjs +7 -27
- package/src/main/health.cjs +48 -15
- package/src/main/historyAggregator.cjs +88 -5
- package/src/main/historyDashboard.cjs +69 -4
- package/src/main/index.cjs +56 -2
- package/src/main/ipcSchemas.cjs +112 -16
- package/src/main/lib/AGENTS.md +54 -0
- package/src/main/lib/CLAUDE.md +1 -54
- package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
- package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
- package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
- package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
- package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
- package/src/main/lib/claude/effectiveModelInfo.cjs +90 -20
- package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
- package/src/main/lib/claude/personaToolScope.cjs +12 -6
- package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
- package/src/main/lib/claude/runClaudeP.cjs +6 -1
- package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
- package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
- package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
- package/src/main/lib/ephemeralCwd.cjs +37 -2
- package/src/main/lib/epic/delegationReadiness.cjs +42 -9
- package/src/main/lib/epic/epicAdminRoutes.cjs +25 -5
- package/src/main/lib/epic/epicOutsideRead.cjs +118 -1
- package/src/main/lib/epic/epicOutsideState.cjs +2 -2
- package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
- package/src/main/lib/epic/epicValidationHook.cjs +24 -4
- package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
- package/src/main/lib/externalContract.cjs +31 -5
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +55 -1
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +106 -11
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +47 -19
- package/src/main/lib/feedback-remote/needsYouStore.cjs +6 -2
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
- package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
- package/src/main/lib/git/branchSweep.cjs +209 -4
- package/src/main/lib/git/gitWorktree.cjs +41 -5
- package/src/main/lib/guardShims.cjs +1 -1
- package/src/main/lib/historyRollup.cjs +26 -0
- package/src/main/lib/insideHome.cjs +27 -1
- package/src/main/lib/mcpToolCatalog.cjs +122 -12
- package/src/main/lib/mdDocCensus.cjs +59 -78
- package/src/main/lib/mdDocRefs.cjs +71 -93
- package/src/main/lib/mdNetworkScan.cjs +245 -250
- package/src/main/lib/mdReviewRecord.cjs +22 -9
- package/src/main/lib/memoryMdNetwork.cjs +5 -12
- package/src/main/lib/opsOwnership.cjs +18 -2
- package/src/main/lib/opsRetentionSettings.cjs +28 -4
- package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
- package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
- package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
- package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
- package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
- package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
- package/src/main/lib/prd/depSlugResolve.cjs +104 -4
- package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
- package/src/main/lib/prd/prdCreate.cjs +351 -23
- package/src/main/lib/prd/prdDisposition.cjs +11 -2
- package/src/main/lib/prd/prdFrontmatter.cjs +96 -3
- package/src/main/lib/process/loginItem.cjs +171 -0
- package/src/main/lib/process/loginItemPlan.cjs +193 -0
- package/src/main/lib/project-pages/playerBridge.cjs +4 -0
- package/src/main/lib/project-pages/videoReview.cjs +268 -0
- package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
- package/src/main/lib/scheduler/cpuSample.cjs +131 -4
- package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
- package/src/main/lib/scheduler/loadGate.cjs +24 -6
- package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
- package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
- package/src/main/lib/scheduler/queueStore.cjs +7 -0
- package/src/main/lib/scheduler/rcaReport.cjs +21 -1
- package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
- package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
- package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
- package/src/main/lib/scheduler/schedulerPaths.cjs +3 -0
- package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
- package/src/main/lib/scheduler/validationQuality.cjs +282 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
- package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
- package/src/main/lib/tasks/taskIpc.cjs +80 -0
- package/src/main/lib/tasks/taskLedger.cjs +502 -0
- package/src/main/lib/tasks/taskRun.cjs +313 -0
- package/src/main/lib/tasks/taskSwitch.cjs +120 -0
- package/src/main/loginItemIpc.cjs +35 -0
- package/src/main/loopEfficiencyHandlers.cjs +10 -1
- package/src/main/projectPages.cjs +6 -15
- package/src/main/promptSessionEvents.cjs +9 -1
- package/src/main/queueOps.cjs +260 -3
- package/src/main/runVerify.cjs +53 -25
- package/src/main/scheduler/AGENTS.md +26 -0
- package/src/main/scheduler/CLAUDE.md +1 -26
- package/src/main/scheduler/budget.cjs +239 -9
- package/src/main/scheduler/cancelDependents.cjs +154 -0
- package/src/main/scheduler/prdParser.cjs +4 -1
- package/src/main/scheduler/starvation.cjs +20 -18
- package/src/main/scheduler.cjs +745 -64
- package/src/main/supervisor.cjs +5 -1
- package/src/main/templates/PRD_AUTHORING.md +6 -1
- package/src/main/validationQualityHandlers.cjs +199 -0
- package/src/main/webRemote.cjs +10 -2
- package/src/preload/api.d.ts +364 -21
- package/src/preload/apiSurface.json +89 -10
- package/src/preload/index.cjs +23 -2
- package/src/seed/agents/validator.md +19 -8
- package/dist/assets/AppSettings-CUfWY9vN.js +0 -2
- package/dist/assets/History-DDnqaLyw.js +0 -2
- package/dist/assets/Scheduler-NLs08fx7.js +0 -16
- package/dist/assets/index-C-d0DCre.js +0 -3124
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
* could still fail to block at run time (or vice versa) — so the matching
|
|
10
10
|
* rule lives here once, not copied into each caller.
|
|
11
11
|
*
|
|
12
|
-
* Resolution rule: exact slug match first; else
|
|
13
|
-
* stripping one leading `NN-` prefix — a human-authored
|
|
14
|
-
* know the `NN-` prefix the allocator will hand a sibling
|
|
12
|
+
* Resolution rule (write-time resolveDepSlug): exact slug match first; else
|
|
13
|
+
* bare-name match after stripping one leading `NN-` prefix — a human-authored
|
|
14
|
+
* `dependsOn:` can't know the `NN-` prefix the allocator will hand a sibling
|
|
15
|
+
* PRD. Run-time gating uses makeDepResolver below, which adds the satisfied
|
|
16
|
+
* record and Epic ordering on top of the same bare-name rule.
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
/** Strip one leading `NN-` prefix, if present. */
|
|
@@ -84,4 +86,102 @@ function findNearMatches(depSlug, candidateSlugs, limit = 3) {
|
|
|
84
86
|
.map((entry) => entry.slug);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Was this row cancelled by a human (admin API cancel), rather than failing on
|
|
91
|
+
* its own? scheduler.cjs's cancel handler stamps `cancelledAt` and an error
|
|
92
|
+
* starting 'cancelled via admin API'; either marker counts.
|
|
93
|
+
*/
|
|
94
|
+
function isCancelledRow(row) {
|
|
95
|
+
if (!row) return false;
|
|
96
|
+
if (typeof row.cancelledAt === 'string' ? row.cancelledAt.length > 0 : row.cancelledAt != null) return true;
|
|
97
|
+
return typeof row.error === 'string' && row.error.startsWith('cancelled via admin API');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The Epic a queue row belongs to: `epicId`, else its `sourcePromptId`. */
|
|
101
|
+
function epicOf(job) {
|
|
102
|
+
return job?.epicId ?? job?.sourcePromptId ?? null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** True when `slug` carries a leading `NN-` allocator prefix. */
|
|
106
|
+
function isPrefixedSlug(slug) {
|
|
107
|
+
return /^\d+-/.test(String(slug ?? ''));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* makeDepResolver(projectJobs, satisfiedSlugs, { failOpen, epicId }) — the ONE
|
|
112
|
+
* run-time `dependsOn` resolution rule, shared by every schedulerBatch.cjs
|
|
113
|
+
* gate (findBlockingDep, findUnresolvableDepRoots, pickForProject's hold
|
|
114
|
+
* records and root-blocker walk) so gating, holds and the root walk can never
|
|
115
|
+
* disagree about what a dep names.
|
|
116
|
+
*
|
|
117
|
+
* resolve(dep, dependentJob) → { kind: 'row'|'satisfied'|'unresolved', rows }, in order:
|
|
118
|
+
* 1. an exact live row → 'row'
|
|
119
|
+
* 2. the exact slug in satisfiedSlugs → 'satisfied'
|
|
120
|
+
* 3. NN-prefixed dep: a live row with the same bare name IN THE DEPENDENT'S
|
|
121
|
+
* EPIC → 'row'; else 'unresolved'
|
|
122
|
+
* (a dep written with a full slug names one PRD — another Epic's
|
|
123
|
+
* re-allocated sibling is not it)
|
|
124
|
+
* 4. bare dep: live rows with that bare name, preferring rows in the
|
|
125
|
+
* dependent's Epic → 'row'
|
|
126
|
+
* 5. bare dep: a satisfied record with that bare name → 'satisfied'
|
|
127
|
+
* 6. → 'unresolved'
|
|
128
|
+
* In steps 3-4 a cancelled row (isCancelledRow) is dropped when a satisfied
|
|
129
|
+
* record shares its bare name — a human-cancelled duplicate must never freeze
|
|
130
|
+
* the dependents of the PRD that genuinely finished (Self, 2026-11-22: the
|
|
131
|
+
* cancelled 1056-sm-contract-client froze 16 dependents of the completed
|
|
132
|
+
* 1047-sm-contract-client).
|
|
133
|
+
*
|
|
134
|
+
* `failOpen` (the caller's history/archive lookup failed this tick): any dep
|
|
135
|
+
* that resolves to no live row is 'satisfied' instead of 'unresolved'.
|
|
136
|
+
* `epicId` is the fallback Epic when resolve() is called without a dependent.
|
|
137
|
+
*/
|
|
138
|
+
function makeDepResolver(projectJobs, satisfiedSlugs = new Set(), opts = {}) {
|
|
139
|
+
const failOpen = opts.failOpen === true;
|
|
140
|
+
const satisfied = satisfiedSlugs instanceof Set ? satisfiedSlugs : new Set(satisfiedSlugs ?? []);
|
|
141
|
+
const rowBySlug = new Map();
|
|
142
|
+
const rowsByBareSlug = new Map();
|
|
143
|
+
for (const j of projectJobs) {
|
|
144
|
+
if (!rowBySlug.has(j.slug)) rowBySlug.set(j.slug, j);
|
|
145
|
+
const bare = bareSlug(j.slug);
|
|
146
|
+
if (!rowsByBareSlug.has(bare)) rowsByBareSlug.set(bare, []);
|
|
147
|
+
rowsByBareSlug.get(bare).push(j);
|
|
148
|
+
}
|
|
149
|
+
let satisfiedBareSlugs = null;
|
|
150
|
+
const hasSatisfiedBare = (bare) => {
|
|
151
|
+
if (satisfiedBareSlugs === null) {
|
|
152
|
+
satisfiedBareSlugs = new Set();
|
|
153
|
+
for (const s of satisfied) satisfiedBareSlugs.add(bareSlug(s));
|
|
154
|
+
}
|
|
155
|
+
return satisfiedBareSlugs.has(bare);
|
|
156
|
+
};
|
|
157
|
+
const unresolved = () => (failOpen ? { kind: 'satisfied', rows: [] } : { kind: 'unresolved', rows: [] });
|
|
158
|
+
|
|
159
|
+
const resolve = (dep, dependentJob) => {
|
|
160
|
+
const exact = rowBySlug.get(dep);
|
|
161
|
+
if (exact) return { kind: 'row', rows: [exact] };
|
|
162
|
+
if (satisfied.has(dep)) return { kind: 'satisfied', rows: [] };
|
|
163
|
+
const bare = bareSlug(dep);
|
|
164
|
+
const depEpic = dependentJob ? epicOf(dependentJob) : (opts.epicId ?? null);
|
|
165
|
+
const sameEpic = (r) => depEpic != null && epicOf(r) === depEpic;
|
|
166
|
+
const bareRows = rowsByBareSlug.get(bare) ?? [];
|
|
167
|
+
const bareSatisfied = hasSatisfiedBare(bare);
|
|
168
|
+
const live = (rows) => (bareSatisfied ? rows.filter((r) => !isCancelledRow(r)) : rows);
|
|
169
|
+
|
|
170
|
+
if (isPrefixedSlug(dep)) {
|
|
171
|
+
const rows = live(bareRows.filter(sameEpic));
|
|
172
|
+
return rows.length > 0 ? { kind: 'row', rows } : unresolved();
|
|
173
|
+
}
|
|
174
|
+
const preferred = bareRows.filter(sameEpic);
|
|
175
|
+
const rows = live(preferred.length > 0 ? preferred : bareRows);
|
|
176
|
+
if (rows.length > 0) return { kind: 'row', rows };
|
|
177
|
+
if (bareSatisfied) return { kind: 'satisfied', rows: [] };
|
|
178
|
+
return unresolved();
|
|
179
|
+
};
|
|
180
|
+
const rowsForDep = (dep, dependentJob) => resolve(dep, dependentJob).rows;
|
|
181
|
+
const isKnownSatisfied = (dep, dependentJob) => resolve(dep, dependentJob).kind === 'satisfied';
|
|
182
|
+
return { resolve, rowsForDep, isKnownSatisfied };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
module.exports = {
|
|
186
|
+
bareSlug, resolveDepSlug, findNearMatches, isSatisfiedDepRow, isCancelledRow, epicOf, makeDepResolver,
|
|
187
|
+
};
|
|
@@ -185,9 +185,12 @@ function registerAdminRoute(adminHttp, remote) {
|
|
|
185
185
|
sendJson(res, 400, { ok: false, error: 'invalid payload', details: e?.issues ?? e?.message });
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
const result = await remote.cancelJob(input.slug, { cwd: input.cwd });
|
|
188
|
+
const result = await remote.cancelJob(input.slug, { cwd: input.cwd, dependents: input.dependents });
|
|
189
189
|
if (!result.ok) {
|
|
190
|
-
|
|
190
|
+
// A dependents refusal/abort (result.dependents set) is always a 409 —
|
|
191
|
+
// the job exists; the caller must pass or fix a dependents choice.
|
|
192
|
+
const status = Array.isArray(result.dependents) ? 409
|
|
193
|
+
: result.error === 'invalid slug' ? 400
|
|
191
194
|
: /unknown slug|not found/i.test(result.error ?? '') ? 404
|
|
192
195
|
: 409;
|
|
193
196
|
sendJson(res, status, result);
|
|
@@ -197,6 +200,36 @@ function registerAdminRoute(adminHttp, remote) {
|
|
|
197
200
|
sendJson(res, 200, result);
|
|
198
201
|
});
|
|
199
202
|
|
|
203
|
+
// POST /admin/scheduler/dismiss-cancelled — the honest exit for a cancelled
|
|
204
|
+
// row (PRD 3492): removes it from the live queue and files its PRD under
|
|
205
|
+
// prds-cancelled/, which never satisfies a dependsOn (archive-prd refuses
|
|
206
|
+
// cancelled rows). Same body shape as cancel-job, including `dependents`.
|
|
207
|
+
adminHttp.registerRoute('POST', '/admin/scheduler/dismiss-cancelled', async (req, res) => {
|
|
208
|
+
const raw = await readBody(req);
|
|
209
|
+
const parsedBody = parseJsonBody(raw);
|
|
210
|
+
if (!parsedBody.ok) {
|
|
211
|
+
sendJson(res, 400, { ok: false, error: 'invalid JSON body' });
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
let input;
|
|
215
|
+
try {
|
|
216
|
+
input = schemas.adminCancelJob.parse(parsedBody.value);
|
|
217
|
+
} catch (e) {
|
|
218
|
+
sendJson(res, 400, { ok: false, error: 'invalid payload', details: e?.issues ?? e?.message });
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const result = await queueOps.dismissCancelled(input.slug, input.cwd, { dependents: input.dependents });
|
|
222
|
+
if (!result.ok) {
|
|
223
|
+
const status = Array.isArray(result.dependents) || result.notCancelled ? 409
|
|
224
|
+
: result.error === 'invalid slug' ? 400
|
|
225
|
+
: /unknown slug/i.test(result.error ?? '') ? 404
|
|
226
|
+
: 500;
|
|
227
|
+
sendJson(res, status, result);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
sendJson(res, 200, result);
|
|
231
|
+
});
|
|
232
|
+
|
|
200
233
|
adminHttp.registerRoute('POST', '/admin/scheduler/retag-prd', async (req, res) => {
|
|
201
234
|
const raw = await readBody(req);
|
|
202
235
|
const parsedBody = parseJsonBody(raw);
|