claude-code-session-manager 0.142.0 → 0.144.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +22 -107
- package/dist/assets/AppSettings-Z68gQiVE.js +2 -0
- package/dist/assets/{History-DpZuJXi1.js → History-C3E6y_7t.js} +2 -2
- package/dist/assets/HomeClaudeConfig-Yd1vXzBn.js +5 -0
- package/dist/assets/{Panel-BjdJjhqt.js → Panel-CnfWs46Z.js} +1 -1
- package/dist/assets/ProjectClaudeConfig-CP0Wsg-H.js +26 -0
- package/dist/assets/Scheduler-D8un7N3B.js +16 -0
- package/dist/assets/{SkillReferenceGraph-Cqyu4mef.js → SkillReferenceGraph-DRtZV1Al.js} +1 -1
- package/dist/assets/{Skills-vv0noNVI.js → Skills-Bg5O2Hyn.js} +23 -23
- package/dist/assets/{TiptapBody-CXi8Pvut.js → TiptapBody-BdzoBmqu.js} +27 -27
- package/dist/assets/{Toggle-CiYCWLjh.js → Toggle-Dt5K1OXt.js} +1 -1
- package/dist/assets/{VoiceButton-4NKKd1sC.js → VoiceButton-CTLyRgdF.js} +1 -1
- package/dist/assets/{historyTotals-DDunb8Ch.js → historyTotals-B2_KWBga.js} +1 -1
- package/dist/assets/{index-Cn5E9958.js → index-446b69rr.js} +715 -714
- package/dist/assets/{index-DVHIHoJf.css → index-BJ5TJvmz.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +438 -435
- package/package.json +6 -4
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +5 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +23 -16
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +16 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/weekly-consolidation.md +87 -0
- package/scripts/README.md +1 -0
- package/scripts/scheduler-mcp-server.cjs +381 -6
- package/src/main/adminRouteRegistry.cjs +16 -0
- package/src/main/agentLibrary.cjs +60 -11
- package/src/main/agentsIpc.cjs +19 -0
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +214 -7
- package/src/main/config.cjs +5 -1
- package/src/main/health.cjs +92 -14
- package/src/main/index.cjs +16 -4
- package/src/main/ipcSchemas.cjs +61 -1
- package/src/main/lib/claude/agentArmory.cjs +128 -0
- package/src/main/lib/claude/agentModelResolve.cjs +3 -2
- package/src/main/lib/claude/agentSnapshot.cjs +24 -3
- package/src/main/lib/claude/builtinTools.cjs +110 -0
- package/src/main/lib/claude/environmentProfiles.cjs +1 -1
- package/src/main/lib/claude/headlessMcpServers.cjs +138 -0
- package/src/main/lib/claude/jobSandboxPolicy.cjs +8 -2
- package/src/main/lib/claude/personaToolScope.cjs +77 -6
- package/src/main/lib/demo-video-kit/cast.md +10 -1
- package/src/main/lib/demo-video-kit/character.cjs +77 -21
- package/src/main/lib/demo-video-kit/kind-tiktok.md +5 -1
- package/src/main/lib/demo-video-kit/projectSounds.cjs +191 -0
- package/src/main/lib/demo-video-kit/seedKit.cjs +3 -3
- package/src/main/lib/demo-video-kit/sound.cjs +166 -9
- package/src/main/lib/demo-video-kit/standalone.cjs +231 -0
- package/src/main/lib/epic/activeIndexMerge.cjs +5 -0
- package/src/main/lib/epic/artifactRetention.cjs +55 -9
- package/src/main/lib/epic/artifactStore.cjs +78 -35
- package/src/main/lib/epic/delegationReadiness.cjs +10 -3
- package/src/main/lib/epic/epicDepsSync.cjs +66 -0
- package/src/main/lib/epic/epicEventLog.cjs +45 -1
- package/src/main/lib/epic/epicOutsideRead.cjs +38 -1
- package/src/main/lib/epic/epicSettle.cjs +48 -4
- package/src/main/lib/epic/epicSpawnPlan.cjs +3 -1
- package/src/main/lib/epic/epicStateEmitter.cjs +248 -0
- package/src/main/lib/epic/epicValidationHook.cjs +22 -3
- package/src/main/lib/epic/planReviewInput.cjs +123 -0
- package/src/main/lib/epic/restorableSessions.cjs +1 -0
- package/src/main/lib/epic/scriptStartedBy.cjs +71 -0
- package/src/main/lib/externalContract.cjs +24 -1
- package/src/main/lib/feedback-remote/autoStartedSession.cjs +1 -1
- package/src/main/lib/feedback-remote/createdProjects.cjs +291 -0
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +24 -2
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +96 -8
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +54 -3
- package/src/main/lib/feedback-remote/pendingReplies.cjs +22 -0
- package/src/main/lib/feedback-remote/projectCreate.cjs +415 -0
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +94 -4
- package/src/main/lib/feedback-remote/replyClaims.cjs +168 -0
- package/src/main/lib/feedback-remote/serviceMcpSession.cjs +29 -1
- package/src/main/lib/feedback-remote/serviceMcpTools.cjs +43 -2
- package/src/main/lib/feedback-remote/servicePairLocalRoutes.cjs +91 -0
- package/src/main/lib/feedback-remote/servicePairings.cjs +47 -7
- package/src/main/lib/feedback-remote/serviceStdioBridge.cjs +99 -1
- package/src/main/lib/git/gitWorktree.cjs +8 -0
- package/src/main/lib/git/runtimeStateUntrack.cjs +15 -1
- package/src/main/lib/git/worktreeDeps.cjs +119 -10
- package/src/main/lib/mcpToolCatalog.cjs +144 -12
- package/src/main/lib/mcpToolsProbe.cjs +19 -2
- package/src/main/lib/opsOwnership.cjs +113 -28
- package/src/main/lib/packs/packCatalog.cjs +98 -5
- package/src/main/lib/persona-macro/agentPersonaSchema.cjs +6 -0
- package/src/main/lib/persona-macro/builtinMacros.cjs +6 -4
- package/src/main/lib/persona-macro/personaFrontmatterSchema.cjs +9 -0
- package/src/main/lib/persona-macro/personaLoadout.cjs +58 -0
- package/src/main/lib/persona-macro/personaMerge.cjs +11 -3
- package/src/main/lib/persona-macro/personaUpgrade.cjs +96 -0
- package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +1 -1
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +140 -0
- package/src/main/lib/prd/prdCreate.cjs +395 -229
- package/src/main/lib/prd/prdCriteria.cjs +7 -4
- package/src/main/lib/prd/prdFrontmatter.cjs +5 -2
- package/src/main/lib/prd/prdMcpReachWarnings.cjs +44 -0
- package/src/main/lib/prd/prdSandboxWarnings.cjs +49 -0
- package/src/main/lib/process/peerChatSession.cjs +165 -0
- package/src/main/lib/project-pages/videoPressLines.cjs +145 -0
- package/src/main/lib/project-pages/videoScriptPress.cjs +266 -0
- package/src/main/lib/project-pages/videoScriptRunRoute.cjs +371 -0
- package/src/main/lib/project-pages/videoScriptSwitchIpc.cjs +49 -0
- package/src/main/lib/project-pages/videoScriptSwitchRoute.cjs +173 -0
- package/src/main/lib/promptSessionSchema.cjs +2 -0
- package/src/main/lib/scheduler/baselineGate.cjs +31 -2
- package/src/main/lib/scheduler/criteriaChecks.cjs +164 -20
- package/src/main/lib/scheduler/heldSchedulerTurns.cjs +238 -0
- package/src/main/lib/scheduler/jobMemoryStats.cjs +13 -2
- package/src/main/lib/scheduler/planRecordHarvest.cjs +215 -55
- package/src/main/lib/scheduler/planReleaseRoute.cjs +110 -0
- package/src/main/lib/scheduler/planReviewSchema.cjs +182 -0
- package/src/main/lib/scheduler/planReviewStats.cjs +63 -0
- package/src/main/lib/scheduler/planReviewStore.cjs +128 -0
- package/src/main/lib/scheduler/prdOutcomeRecord.cjs +60 -2
- package/src/main/lib/scheduler/queueStore.cjs +16 -0
- package/src/main/lib/scheduler/rcaReport.cjs +79 -15
- package/src/main/lib/scheduler/sandboxEnvironmentLimit.cjs +141 -0
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +15 -0
- package/src/main/lib/scheduler/schedulerPaths.cjs +9 -0
- package/src/main/lib/scheduler/slotsRoute.cjs +101 -87
- package/src/main/lib/scheduler/upgradeDrain.cjs +32 -5
- package/src/main/lib/scheduler/usageHoldRoute.cjs +97 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +28 -7
- package/src/main/lib/tasks/memoryConsolidation.cjs +123 -39
- package/src/main/lib/tasks/mitigationReview.cjs +21 -1
- package/src/main/lib/tasks/taskAdminRoutes.cjs +104 -17
- package/src/main/lib/tasks/taskLedger.cjs +2 -2
- package/src/main/lib/tasks/taskRun.cjs +3 -1
- package/src/main/lib/tasks/weeklyConsolidationInputs.cjs +178 -0
- package/src/main/lib/telemetry/auditEvents.cjs +21 -24
- package/src/main/lib/telemetry/auditLog.cjs +6 -2
- package/src/main/lib/util/atomicFs.cjs +2 -2
- package/src/main/projectPages.cjs +22 -14
- package/src/main/promptSessionEvents.cjs +16 -1
- package/src/main/pty.cjs +14 -2
- package/src/main/queueOps.cjs +1 -1
- package/src/main/runVerify.cjs +4 -3
- package/src/main/scheduler/planReviewHold.cjs +140 -0
- package/src/main/scheduler/prdParser.cjs +1 -0
- package/src/main/scheduler/reviewLadder.cjs +2 -0
- package/src/main/scheduler/utilizationHold.cjs +101 -6
- package/src/main/scheduler.cjs +1055 -107
- package/src/main/seedAgentPersonas.cjs +11 -6
- package/src/main/seedStatus.cjs +1 -1
- package/src/main/templates/PRD_AUTHORING.md +22 -2
- package/src/main/webRemote.cjs +47 -7
- package/src/preload/api.d.ts +118 -2
- package/src/preload/apiSurface.json +42 -0
- package/src/preload/index.cjs +11 -0
- package/src/seed/agents/architect.md +28 -43
- package/src/seed/agents/demo-video-builder.md +15 -8
- package/src/seed/agents/dev-lead.md +3 -1
- package/src/seed/agents/md-network-curator.md +27 -0
- package/src/seed/agents/plan-reviewer.md +47 -0
- package/src/seed/agents/validator.md +21 -19
- package/dist/assets/AppSettings-BcZgIvvY.js +0 -2
- package/dist/assets/HomeClaudeConfig-D32ZJtU-.js +0 -3
- package/dist/assets/ProjectClaudeConfig-BTClYV6i.js +0 -26
- package/dist/assets/Scheduler-DPobKx1Z.js +0 -16
|
@@ -160,6 +160,7 @@ async function parsePrdRaw(filePath) {
|
|
|
160
160
|
// Optional precondition command (preflightCheck.cjs); reconcile copies it
|
|
161
161
|
// onto the queue row so spawnJob can hold the job while it exits non-zero.
|
|
162
162
|
preflight: typeof fm.preflight === 'string' ? parsePreflightValue(rawFrontmatterValue(text, 'preflight')) : null,
|
|
163
|
+
planReview: typeof fm.planReview === 'string' && fm.planReview.trim().toLowerCase() === 'required' ? 'required' : null,
|
|
163
164
|
// Opt-in exclusive-lease flag (PRD 1107, quietMachineLease.cjs +
|
|
164
165
|
// schedulerBatch.cjs's pickNextBatch). Only a literal `true` opts in —
|
|
165
166
|
// matches prdFrontmatter.cjs's applyKey semantics for this field.
|
|
@@ -942,6 +942,8 @@ function selectAutoFixTargets(jobs, { fixSlugExists, resolveJobRunId = resolveRu
|
|
|
942
942
|
// fix-plan investigation to diagnose — there is no code defect to
|
|
943
943
|
// author a PRD against, only another job's still-uncommitted tree.
|
|
944
944
|
if (job.blockedByForeignWip === true) return false;
|
|
945
|
+
// The job sandbox refused it (environmentLimit): an investigation runs in the same sandbox and hits the same wall.
|
|
946
|
+
if (job.environmentLimit) return false;
|
|
945
947
|
// A budget-killed job parks for a human/ladder decision, never an
|
|
946
948
|
// auto-fix investigation or auto-retry — the run didn't fail, it simply
|
|
947
949
|
// overran its own estimate; there's no code defect to diagnose (Out of
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* window: string | null,
|
|
30
30
|
* percent: number | null,
|
|
31
31
|
* threshold: number | null,
|
|
32
|
+
* baseThreshold?: number | null,
|
|
32
33
|
* resetsAt: string | null,
|
|
33
34
|
* detail: string,
|
|
34
35
|
* }} AutoDispatchHold
|
|
@@ -44,6 +45,68 @@ function resetMs(resetsAt) {
|
|
|
44
45
|
return Number.isFinite(ms) ? ms : Infinity;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
49
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The pro-rated threshold reaches this in a window's final stretch. 99, not
|
|
53
|
+
* 100: automatic work stops one point short of the account limit so
|
|
54
|
+
* interactive chats keep working until the reset (owner's choice, 2026-11-24).
|
|
55
|
+
* A saved 'pause above' at or above it is returned unchanged.
|
|
56
|
+
*/
|
|
57
|
+
const PRO_RATE_CEILING = 99;
|
|
58
|
+
/** Share of a window left at which the threshold reaches the ceiling (last 2 days of a week). */
|
|
59
|
+
const PRO_RATE_FULL_FRACTION = 2 / 7;
|
|
60
|
+
/** Length of each usage window kind. */
|
|
61
|
+
const WINDOW_LENGTH_MS = Object.freeze({ weekly: 7 * DAY_MS, fiveHour: 5 * HOUR_MS });
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Window length from its name, or null for an unknown window.
|
|
65
|
+
* @param {string | null | undefined} window
|
|
66
|
+
* @returns {number | null}
|
|
67
|
+
*/
|
|
68
|
+
function windowLengthMs(window) {
|
|
69
|
+
if (typeof window !== 'string') return null;
|
|
70
|
+
if (/weekly|seven_day/i.test(window)) return WINDOW_LENGTH_MS.weekly;
|
|
71
|
+
if (/five_hour|session/i.test(window)) return WINDOW_LENGTH_MS.fiveHour;
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Effective 'pause above' value for one window: the owner would rather touch
|
|
77
|
+
* the limit than leave credits unspent, so the threshold rises from `base`
|
|
78
|
+
* (whole window left) linearly to PRO_RATE_CEILING once only
|
|
79
|
+
* PRO_RATE_FULL_FRACTION of the window is left. Never below `base`; unknown
|
|
80
|
+
* window, missing/unparseable reset, or non-finite base -> base unchanged.
|
|
81
|
+
* @param {{ base: number, window: string | null | undefined, resetsAt: string | null | undefined, now: number }} args
|
|
82
|
+
* @returns {number}
|
|
83
|
+
*/
|
|
84
|
+
function proRatedThreshold({ base, window, resetsAt, now }) {
|
|
85
|
+
if (typeof base !== 'number' || !Number.isFinite(base)) return base;
|
|
86
|
+
if (base >= PRO_RATE_CEILING) return base;
|
|
87
|
+
const length = windowLengthMs(window);
|
|
88
|
+
if (length === null) return base;
|
|
89
|
+
const reset = resetMs(resetsAt);
|
|
90
|
+
if (!Number.isFinite(reset)) return base;
|
|
91
|
+
const f = (reset - now) / length;
|
|
92
|
+
if (!Number.isFinite(f)) return base;
|
|
93
|
+
if (f >= 1) return base;
|
|
94
|
+
if (f <= PRO_RATE_FULL_FRACTION) return PRO_RATE_CEILING;
|
|
95
|
+
const value = base + (PRO_RATE_CEILING - base) * (1 - f) / (1 - PRO_RATE_FULL_FRACTION);
|
|
96
|
+
return Math.max(base, value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Human time left: "1.7 days", "4.0 h", "25 min".
|
|
101
|
+
* @param {number} ms
|
|
102
|
+
* @returns {string}
|
|
103
|
+
*/
|
|
104
|
+
function formatTimeLeft(ms) {
|
|
105
|
+
if (ms >= DAY_MS) return `${(ms / DAY_MS).toFixed(1)} days`;
|
|
106
|
+
if (ms >= HOUR_MS) return `${(ms / HOUR_MS).toFixed(1)} h`;
|
|
107
|
+
return `${String(Math.max(0, Math.round(ms / 60_000)))} min`;
|
|
108
|
+
}
|
|
109
|
+
|
|
47
110
|
/**
|
|
48
111
|
* @param {{
|
|
49
112
|
* firePolicy: string | null | undefined,
|
|
@@ -66,14 +129,13 @@ function evaluateAutoDispatchHold({ firePolicy, threshold, reading, now }) {
|
|
|
66
129
|
}
|
|
67
130
|
if (reading == null || reading.known !== true) return null;
|
|
68
131
|
if (typeof threshold !== 'number' || !Number.isFinite(threshold)) return null;
|
|
69
|
-
const limit = threshold;
|
|
70
132
|
|
|
71
133
|
/** @type {UsageWindow[]} */
|
|
72
134
|
const candidates = Array.isArray(reading.windows) && reading.windows.length > 0
|
|
73
135
|
? reading.windows
|
|
74
136
|
: [{ window: reading.window, percent: reading.percent, resetsAt: reading.resetsAt }];
|
|
75
137
|
|
|
76
|
-
/** @type {{ window: string | null, percent: number, resetsAt: string | null, resetAt: number } | null} */
|
|
138
|
+
/** @type {{ window: string | null, percent: number, resetsAt: string | null, resetAt: number, limit: number } | null} */
|
|
77
139
|
let pick = null;
|
|
78
140
|
for (const c of candidates) {
|
|
79
141
|
if (!c) continue;
|
|
@@ -81,21 +143,54 @@ function evaluateAutoDispatchHold({ firePolicy, threshold, reading, now }) {
|
|
|
81
143
|
if (typeof percent !== 'number' || !Number.isFinite(percent)) continue;
|
|
82
144
|
const resetAt = resetMs(c.resetsAt);
|
|
83
145
|
if (resetAt <= now) continue; // already reset: its old reading no longer applies
|
|
146
|
+
const limit = utilizationHold.proRatedThreshold({ base: threshold, window: c.window, resetsAt: c.resetsAt, now });
|
|
84
147
|
if (percent < limit) continue;
|
|
85
148
|
if (pick === null || resetAt > pick.resetAt || (resetAt === pick.resetAt && percent > pick.percent)) {
|
|
86
|
-
pick = { window: c.window ?? null, percent, resetsAt: c.resetsAt ?? null, resetAt };
|
|
149
|
+
pick = { window: c.window ?? null, percent, resetsAt: c.resetsAt ?? null, resetAt, limit };
|
|
87
150
|
}
|
|
88
151
|
}
|
|
89
152
|
if (pick === null) return null;
|
|
90
153
|
|
|
154
|
+
const proRated = pick.limit !== threshold
|
|
155
|
+
? ` (pause above ${String(threshold)}%, pro-rated: ${formatTimeLeft(pick.resetAt - now)} to reset)`
|
|
156
|
+
: '';
|
|
157
|
+
const shownLimit = Math.round(pick.limit * 10) / 10;
|
|
91
158
|
return {
|
|
92
159
|
reason: 'utilization-held',
|
|
93
160
|
window: pick.window,
|
|
94
161
|
percent: pick.percent,
|
|
95
|
-
threshold: limit,
|
|
162
|
+
threshold: pick.limit,
|
|
163
|
+
baseThreshold: threshold,
|
|
96
164
|
resetsAt: pick.resetsAt,
|
|
97
|
-
detail: `${pick.window ?? 'binding'} window at ${String(pick.percent)}% ≥ ${String(
|
|
165
|
+
detail: `${pick.window ?? 'binding'} window at ${String(pick.percent)}% ≥ ${String(shownLimit)}%${proRated}, resets ${pick.resetsAt ?? 'unknown'}`,
|
|
98
166
|
};
|
|
99
167
|
}
|
|
100
168
|
|
|
101
|
-
|
|
169
|
+
const MINUTE_MS = 60_000;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Identity of one auto-dispatch hold: reason + window + reset, for the
|
|
173
|
+
* once-per-hold audit keys. The usage API returns a different resets_at string
|
|
174
|
+
* for the same reset on almost every fetch (329 distinct strings for one
|
|
175
|
+
* weekly reset across 640 heartbeat lines, about ±0.5 s either side of the
|
|
176
|
+
* minute), so the reset is rounded to the nearest whole minute. An unparseable
|
|
177
|
+
* resetsAt is used raw ('' when absent) so the key stays stable.
|
|
178
|
+
* @param {{ reason: string, window?: string | null, resetsAt?: string | null }} hold
|
|
179
|
+
* @returns {string}
|
|
180
|
+
*/
|
|
181
|
+
function holdIdentityKey(hold) {
|
|
182
|
+
const raw = hold.resetsAt ?? '';
|
|
183
|
+
const ms = typeof hold.resetsAt === 'string' ? Date.parse(hold.resetsAt) : NaN;
|
|
184
|
+
const reset = Number.isFinite(ms) ? new Date(Math.round(ms / MINUTE_MS) * MINUTE_MS).toISOString() : raw;
|
|
185
|
+
return `${hold.reason}|${hold.window ?? ''}|${reset}`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const utilizationHold = {
|
|
189
|
+
evaluateAutoDispatchHold,
|
|
190
|
+
holdIdentityKey,
|
|
191
|
+
proRatedThreshold,
|
|
192
|
+
PRO_RATE_CEILING,
|
|
193
|
+
PRO_RATE_FULL_FRACTION,
|
|
194
|
+
WINDOW_LENGTH_MS,
|
|
195
|
+
};
|
|
196
|
+
module.exports = utilizationHold;
|