claude-code-session-manager 0.141.0 → 0.143.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 +76 -153
- package/bin/cli.cjs +11 -0
- package/dist/assets/AppSettings-BO4jDVGO.js +2 -0
- package/dist/assets/{History-DJMiuXyK.js → History-DTttbvPb.js} +1 -1
- package/dist/assets/HomeClaudeConfig-DADP5bfn.js +3 -0
- package/dist/assets/{Panel-Bf1Cf8UL.js → Panel-B_D4Bg7L.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-BWPpypf9.js → ProjectClaudeConfig-DPnDJKcr.js} +7 -7
- package/dist/assets/Scheduler-CNLjn90m.js +16 -0
- package/dist/assets/{SkillReferenceGraph-Ba4TkX2C.js → SkillReferenceGraph-D1b2aiol.js} +1 -1
- package/dist/assets/{Skills-C1v91GEO.js → Skills-cfV7sgk6.js} +5 -5
- package/dist/assets/{TiptapBody-BrcWVpiW.js → TiptapBody-DVXtEIVy.js} +1 -1
- package/dist/assets/Toggle-CYajnSdx.js +1 -0
- package/dist/assets/{VoiceButton-qivnDV6K.js → VoiceButton-DJ4gGRuE.js} +1 -1
- package/dist/assets/{historyTotals-CMCPTKqC.js → historyTotals-D3MoHY2U.js} +1 -1
- package/dist/assets/index-CdTppjKR.js +3133 -0
- package/dist/assets/{index-DKXdXfka.css → index-DVHIHoJf.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +496 -484
- package/package.json +6 -4
- package/plugins/AGENTS.md +4 -3
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/hooks/hooks.json +15 -0
- package/plugins/session-manager-dev/hooks/residue-check.cjs +241 -0
- package/plugins/session-manager-dev/skills/builder/SKILL.md +5 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +58 -18
- package/plugins/session-manager-dev/skills/develop/standards.md +3 -2
- package/scripts/README.md +2 -0
- package/scripts/hooks/guard-tool-risk.cjs +5 -1
- package/scripts/hooks/lib/guard-tool-risk-policy.cjs +158 -1
- package/scripts/scheduler-mcp-server.cjs +1032 -112
- package/src/main/adminRouteRegistry.cjs +69 -0
- package/src/main/agentLibrary.cjs +72 -4
- package/src/main/agentsIpc.cjs +3 -2
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +336 -23
- package/src/main/config.cjs +35 -1
- package/src/main/docEdit.cjs +4 -2
- package/src/main/health.cjs +129 -2
- package/src/main/index.cjs +110 -52
- package/src/main/ipcSchemas.cjs +172 -8
- package/src/main/lib/AGENTS.md +1 -1
- package/src/main/lib/chatBootRecovery.cjs +2 -0
- package/src/main/lib/claude/agentModelResolve.cjs +51 -25
- package/src/main/lib/claude/agentSnapshot.cjs +186 -0
- package/src/main/lib/claude/environmentProfiles.cjs +242 -0
- package/src/main/lib/claude/jobSandboxPolicy.cjs +241 -33
- package/src/main/lib/claude/personaToolScope.cjs +82 -31
- package/src/main/lib/claude/runClaudeP.cjs +4 -2
- package/src/main/lib/claude/toolRiskMarks.cjs +41 -1
- package/src/main/lib/claude/usageCircuit.cjs +49 -21
- package/src/main/lib/claude/vaultRefs.cjs +277 -0
- package/src/main/lib/demo-video-kit/capture.cjs +282 -12
- package/src/main/lib/demo-video-kit/cast.md +52 -0
- package/src/main/lib/demo-video-kit/character.cjs +778 -30
- package/src/main/lib/demo-video-kit/checks.cjs +120 -1
- package/src/main/lib/demo-video-kit/export.cjs +218 -0
- package/src/main/lib/demo-video-kit/frames.cjs +104 -9
- package/src/main/lib/demo-video-kit/kind-marketing.md +121 -0
- package/src/main/lib/demo-video-kit/kind-tiktok.md +103 -0
- package/src/main/lib/demo-video-kit/kokoroSay.cjs +205 -0
- package/src/main/lib/demo-video-kit/project-home-html.md +43 -0
- package/src/main/lib/demo-video-kit/projectSounds.cjs +191 -0
- package/src/main/lib/demo-video-kit/resumableRun.cjs +298 -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/demo-video-kit/voiceLane.cjs +233 -0
- package/src/main/lib/demo-video-kit/voiceLibrary.cjs +312 -0
- package/src/main/lib/epic/activeIndexMerge.cjs +5 -0
- package/src/main/lib/epic/artifactAdminRoutes.cjs +211 -0
- package/src/main/lib/epic/artifactIpc.cjs +153 -0
- package/src/main/lib/epic/artifactNotice.cjs +72 -0
- package/src/main/lib/epic/artifactRetention.cjs +356 -0
- package/src/main/lib/epic/artifactStore.cjs +435 -0
- package/src/main/lib/epic/delegationReadiness.cjs +83 -2
- package/src/main/lib/epic/epicAgentRefresh.cjs +97 -0
- package/src/main/lib/epic/epicEventLog.cjs +258 -0
- package/src/main/lib/epic/epicMint.cjs +43 -1
- package/src/main/lib/epic/epicOutsideRead.cjs +1 -0
- package/src/main/lib/epic/epicOutsideState.cjs +18 -4
- package/src/main/lib/epic/epicPurge.cjs +347 -0
- package/src/main/lib/epic/epicReopen.cjs +5 -2
- package/src/main/lib/epic/epicSettle.cjs +4 -13
- package/src/main/lib/epic/epicSpawnPlan.cjs +57 -4
- package/src/main/lib/epic/epicStateEmitter.cjs +248 -0
- package/src/main/lib/epic/epicStatusMirror.cjs +34 -1
- package/src/main/lib/epic/epicTransitions.cjs +139 -0
- package/src/main/lib/epic/epicValidationHook.cjs +94 -4
- package/src/main/lib/epic/guardSpawnSettings.cjs +3 -2
- package/src/main/lib/externalContract.cjs +48 -4
- package/src/main/lib/feedback-remote/autoStartedSession.cjs +1 -1
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +478 -127
- package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +16 -3
- package/src/main/lib/feedback-remote/customerFeedbackClient.cjs +11 -6
- package/src/main/lib/feedback-remote/customerFeedbackInbox.cjs +26 -1
- package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +5 -2
- package/src/main/lib/feedback-remote/feedbackBoxDrain.cjs +409 -0
- package/src/main/lib/feedback-remote/feedbackBoxKeys.cjs +218 -0
- package/src/main/lib/feedback-remote/feedbackEnvelope.cjs +163 -0
- package/src/main/lib/feedback-remote/feedbackRelayClient.cjs +164 -0
- package/src/main/lib/feedback-remote/feedbackReport.cjs +234 -0
- package/src/main/lib/feedback-remote/feedbackSeal.cjs +217 -0
- package/src/main/lib/feedback-remote/localAdminHttp.cjs +108 -2
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +32 -1
- package/src/main/lib/feedback-remote/needsYouIpc.cjs +17 -0
- package/src/main/lib/feedback-remote/needsYouStore.cjs +177 -6
- package/src/main/lib/feedback-remote/pendingReplies.cjs +207 -0
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +282 -14
- package/src/main/lib/feedback-remote/replyClaims.cjs +159 -0
- package/src/main/lib/feedback-remote/serviceClient.cjs +429 -0
- package/src/main/lib/feedback-remote/serviceMcpSession.cjs +252 -0
- package/src/main/lib/feedback-remote/serviceMcpTools.cjs +284 -0
- package/src/main/lib/feedback-remote/servicePairings.cjs +313 -0
- package/src/main/lib/feedback-remote/serviceStdioBridge.cjs +290 -0
- package/src/main/lib/feedback-remote/siteFeedbackAdminRoutes.cjs +295 -0
- package/src/main/lib/feedback-remote/siteFeedbackInbox.cjs +598 -0
- package/src/main/lib/feedback-remote/siteFeedbackIpc.cjs +86 -0
- package/src/main/lib/feedback-remote/siteFeedbackService.cjs +477 -0
- 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 +182 -4
- package/src/main/lib/mcpToolCatalog.cjs +399 -29
- package/src/main/lib/opsOwnership.cjs +141 -28
- package/src/main/lib/opsRetentionSettings.cjs +27 -5
- package/src/main/lib/persona-macro/builtinMacros.cjs +7 -2
- package/src/main/lib/persona-macro/macroJobDispatch.cjs +52 -8
- package/src/main/lib/persona-macro/macroJobIpc.cjs +16 -6
- package/src/main/lib/persona-macro/macroLibrary.cjs +49 -7
- package/src/main/lib/persona-macro/personaFrontmatterSchema.cjs +83 -0
- package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +3 -0
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +309 -0
- package/src/main/lib/phaseProjection.cjs +103 -0
- package/src/main/lib/prd/depSlugResolve.cjs +4 -13
- package/src/main/lib/prd/prdBodyPatch.cjs +12 -17
- package/src/main/lib/prd/prdCreate.cjs +387 -228
- package/src/main/lib/prd/prdCriteria.cjs +228 -0
- package/src/main/lib/prd/prdFrontmatter.cjs +43 -3
- package/src/main/lib/prd/prdGateFiles.cjs +125 -49
- package/src/main/lib/prd/prdSizing.cjs +3 -1
- package/src/main/lib/process/cleanEnv.cjs +52 -1
- package/src/main/lib/process/leftoverRenice.cjs +178 -0
- package/src/main/lib/process/memoryScope.cjs +31 -3
- package/src/main/lib/project-pages/pagesLibrary.cjs +72 -6
- package/src/main/lib/project-pages/videoPressLines.cjs +145 -0
- package/src/main/lib/project-pages/videoReviewIpc.cjs +3 -2
- package/src/main/lib/project-pages/videoScriptPress.cjs +260 -0
- package/src/main/lib/project-pages/videoScriptRunRoute.cjs +351 -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/project-pages/voiceAdminRoutes.cjs +175 -0
- package/src/main/lib/project-pages/voicePreview.cjs +196 -0
- package/src/main/lib/project-pages/voicesIpc.cjs +186 -0
- package/src/main/lib/promptSessionSchema.cjs +6 -0
- package/src/main/lib/scheduler/cancelledRow.cjs +57 -0
- package/src/main/lib/scheduler/cpuSample.cjs +133 -42
- package/src/main/lib/scheduler/criteriaChecks.cjs +313 -0
- package/src/main/lib/scheduler/definitionOfDone.cjs +44 -5
- package/src/main/lib/scheduler/heldSchedulerTurns.cjs +238 -0
- package/src/main/lib/scheduler/jobMemoryStats.cjs +324 -0
- package/src/main/lib/scheduler/loadGate.cjs +82 -4
- package/src/main/lib/scheduler/planRecordHarvest.cjs +152 -54
- package/src/main/lib/scheduler/prdOutcomeRecord.cjs +191 -0
- package/src/main/lib/scheduler/queueStore.cjs +16 -0
- package/src/main/lib/scheduler/rcaReport.cjs +79 -15
- package/src/main/lib/scheduler/runLogRetention.cjs +42 -1
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +18 -0
- package/src/main/lib/scheduler/scheduleJobTransitions.cjs +47 -0
- package/src/main/lib/scheduler/schedulerConfig.cjs +47 -0
- package/src/main/lib/scheduler/schedulerPaths.cjs +9 -3
- package/src/main/lib/scheduler/schedulerRuntimeState.cjs +50 -1
- package/src/main/lib/scheduler/sessionSlots.cjs +5 -1
- package/src/main/lib/scheduler/slotsRoute.cjs +251 -0
- package/src/main/lib/scheduler/toolClearance.cjs +258 -0
- package/src/main/lib/scheduler/usageHoldRoute.cjs +97 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +152 -11
- package/src/main/lib/tasks/memoryConsolidation.cjs +312 -0
- package/src/main/lib/tasks/mitigationReview.cjs +314 -0
- package/src/main/lib/tasks/taskAdminRoutes.cjs +390 -25
- package/src/main/lib/tasks/taskIpc.cjs +22 -18
- package/src/main/lib/tasks/taskLedger.cjs +147 -25
- package/src/main/lib/tasks/taskRun.cjs +186 -17
- package/src/main/lib/tasks/taskSwitch.cjs +85 -12
- package/src/main/lib/tasks/taskSwitchRoute.cjs +172 -0
- package/src/main/lib/telemetry/auditEvents.cjs +204 -6
- package/src/main/lib/telemetry/auditLog.cjs +6 -2
- package/src/main/lib/telemetry/eventsAdminRoutes.cjs +198 -6
- package/src/main/lib/telemetry/webhookDelivery.cjs +205 -0
- package/src/main/lib/telemetry/webhookRegistry.cjs +281 -0
- package/src/main/lib/toolUseClassify.cjs +181 -0
- package/src/main/lib/util/atomicFs.cjs +2 -2
- package/src/main/lib/util/smfileRange.cjs +77 -0
- package/src/main/projectPages.cjs +3 -1
- package/src/main/promptSessionEvents.cjs +21 -1
- package/src/main/pty.cjs +77 -0
- package/src/main/queueOps.cjs +33 -14
- package/src/main/runVerify.cjs +74 -9
- package/src/main/scheduler/AGENTS.md +1 -0
- package/src/main/scheduler/budget.cjs +6 -5
- package/src/main/scheduler/prdParser.cjs +46 -13
- package/src/main/scheduler/reviewLadder.cjs +9 -25
- package/src/main/scheduler/utilizationHold.cjs +191 -0
- package/src/main/scheduler.cjs +1932 -213
- package/src/main/templates/PRD_AUTHORING.md +11 -3
- package/src/main/webRemote.cjs +463 -6
- package/src/preload/api.d.ts +576 -39
- package/src/preload/apiSurface.json +223 -7
- package/src/preload/index.cjs +48 -1
- package/src/seed/agents/architect.md +6 -1
- package/src/seed/agents/blender-artist.md +2 -1
- package/src/seed/agents/competitive-analyst.md +3 -1
- package/src/seed/agents/competitive-researcher.md +2 -1
- package/src/seed/agents/demo-video-builder.md +98 -87
- package/src/seed/agents/dev-lead.md +3 -3
- package/src/seed/agents/project-home-builder.md +9 -31
- package/src/seed/agents/validator.md +23 -23
- package/dist/assets/AppSettings-DExeJhqQ.js +0 -2
- package/dist/assets/HomeClaudeConfig-CTp2tkZ4.js +0 -3
- package/dist/assets/Scheduler-cyr61UAC.js +0 -16
- package/dist/assets/ViewTabs-DXhOWFG0.js +0 -1
- package/dist/assets/index-B2TQz3nd.js +0 -3121
- package/src/main/lib/epic/epicStateWatcher.cjs +0 -157
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// The one list of loopback admin routes the app registers. index.cjs calls
|
|
3
|
+
// registerAppAdminRoutes once at boot; tests call it with a recording fake to see
|
|
4
|
+
// exactly what the running app serves. Every module is required INSIDE the
|
|
5
|
+
// function, so requiring this file has no side effect.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {{ registerRoute: Function }} adminHttp
|
|
9
|
+
* @param {{ onMacrosChanged?: Function, onNeedsYouChanged?: Function }} [deps]
|
|
10
|
+
*/
|
|
11
|
+
function registerAppAdminRoutes(adminHttp, deps = {}) {
|
|
12
|
+
const scheduler = require('./scheduler.cjs');
|
|
13
|
+
const chatRunner = require('./chatRunner.cjs');
|
|
14
|
+
scheduler.registerAdminRoutes(adminHttp);
|
|
15
|
+
// GET/POST /admin/scheduler/slots — read the slot cap; change it only on the human's verified words.
|
|
16
|
+
require('./lib/scheduler/slotsRoute.cjs').registerSlotsRoute(adminHttp);
|
|
17
|
+
// GET /admin/usage-hold — the 'pause above' hold POST /admin/tasks refuses on, for runners that start claude -p directly (read-only).
|
|
18
|
+
require('./lib/scheduler/usageHoldRoute.cjs').registerUsageHoldRoute(adminHttp);
|
|
19
|
+
require('./lib/prd/prdCreate.cjs').registerAdminRoute(adminHttp, scheduler.remote);
|
|
20
|
+
require('./lib/prd/prdAdminRoutes.cjs').registerAdminRoute(adminHttp, scheduler.remote);
|
|
21
|
+
require('./lib/feedback-remote/projectHomeAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
22
|
+
// GET /admin/voices + POST /admin/voices/preview — voice library reads for agents; no route changes a voice.
|
|
23
|
+
require('./lib/project-pages/voiceAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
24
|
+
// POST /admin/project-home/videos/script-switch — 'Scripts may run Demo Video', only on the human's verified words.
|
|
25
|
+
require('./lib/project-pages/videoScriptSwitchRoute.cjs').registerVideoScriptSwitchRoute(adminHttp);
|
|
26
|
+
// POST /admin/project-home/videos/run — a project's own script presses Demo Video, only while that switch is on.
|
|
27
|
+
require('./lib/project-pages/videoScriptRunRoute.cjs').registerAdminRoute(adminHttp, {
|
|
28
|
+
startExternalNewSession: chatRunner.startExternalNewSession,
|
|
29
|
+
isTabBusy: chatRunner.isTabBusy,
|
|
30
|
+
listJobRows: () => scheduler.remote.listJobRows(),
|
|
31
|
+
});
|
|
32
|
+
require('./lib/feedback-remote/macroAdminRoutes.cjs').registerAdminRoute(adminHttp, {
|
|
33
|
+
onChanged: deps.onMacrosChanged,
|
|
34
|
+
startExternalNewSession: chatRunner.startExternalNewSession,
|
|
35
|
+
isTabBusy: chatRunner.isTabBusy,
|
|
36
|
+
});
|
|
37
|
+
chatRunner.registerAdminRoute(adminHttp);
|
|
38
|
+
// Outside apps' "Needs you" items (lib/feedback-remote/needsYouStore.cjs); changes broadcast `needsYou:changed`.
|
|
39
|
+
require('./lib/feedback-remote/needsYouAdminRoutes.cjs').registerAdminRoute(adminHttp, {
|
|
40
|
+
onChanged: deps.onNeedsYouChanged,
|
|
41
|
+
});
|
|
42
|
+
// Project-to-project feedback conduit — the app is the only process holding
|
|
43
|
+
// several projects' operations roots open, so it performs the cross-folder
|
|
44
|
+
// write (lib/feedback-remote/crossProjectFeedback.cjs).
|
|
45
|
+
require('./lib/feedback-remote/crossProjectFeedback.cjs').registerAdminRoute(adminHttp);
|
|
46
|
+
// Its return leg: the receiving session answers INTO the Epic that asked
|
|
47
|
+
// (lib/feedback-remote/crossProjectReply.cjs).
|
|
48
|
+
require('./lib/feedback-remote/crossProjectReply.cjs').registerAdminRoute(adminHttp);
|
|
49
|
+
require('./lib/feedback-remote/customerFeedbackAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
50
|
+
// Website-feedback widgets + their decrypted inbox, behind the Feedback MCP tools.
|
|
51
|
+
require('./lib/feedback-remote/siteFeedbackAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
52
|
+
// Per-project Artifacts store (publish + list), behind the artifact MCP tool.
|
|
53
|
+
require('./lib/epic/artifactAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
54
|
+
// Cursor read over the audit log for outside scripts (read-only).
|
|
55
|
+
require('./lib/telemetry/eventsAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
56
|
+
// Outside-facing Epic records for scripts/other projects (read-only).
|
|
57
|
+
require('./lib/epic/epicAdminRoutes.cjs').registerAdminRoute(adminHttp, {
|
|
58
|
+
isTabBusy: chatRunner.isTabBusy,
|
|
59
|
+
listJobs: () => scheduler.remote.listJobRows(),
|
|
60
|
+
});
|
|
61
|
+
// Validator quality numbers per project for outside callers (read-only).
|
|
62
|
+
require('./validationQualityHandlers.cjs').registerAdminRoute(adminHttp);
|
|
63
|
+
// Persona roster + per-project effective model/effort for outside apps (read-only).
|
|
64
|
+
require('./lib/persona-macro/agentAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
65
|
+
// Task primitive: one headless claude -p run for a project, under the slot cap (POST /admin/tasks).
|
|
66
|
+
require('./lib/tasks/taskAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = { registerAppAdminRoutes };
|
|
@@ -33,6 +33,24 @@ function parseTools(raw) {
|
|
|
33
33
|
return raw.split(',').map((t) => t.trim()).filter(Boolean);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* A declared-capability frontmatter value (`mcpServers:` / `packs:`) as a
|
|
38
|
+
* list: a comma string ("a, b") or a string list (structured callers).
|
|
39
|
+
* Trimmed, deduped, order-preserving; anything else → [].
|
|
40
|
+
* @param {unknown} raw
|
|
41
|
+
* @returns {string[]}
|
|
42
|
+
*/
|
|
43
|
+
function parseCapabilityList(raw) {
|
|
44
|
+
const items = Array.isArray(raw) ? raw : typeof raw === 'string' ? raw.split(',') : [];
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const it of items) {
|
|
47
|
+
if (typeof it !== 'string') continue;
|
|
48
|
+
const v = it.trim();
|
|
49
|
+
if (v && !out.includes(v)) out.push(v);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
|
|
36
54
|
/** Sentinel `projects:` entry meaning "this agent's Action button shows in every project". */
|
|
37
55
|
const ALL_PROJECTS = '*';
|
|
38
56
|
|
|
@@ -75,8 +93,18 @@ function decodeLine(s) {
|
|
|
75
93
|
*
|
|
76
94
|
* `agentCli` / `agentCliModel` are this app's extension too: the persona's
|
|
77
95
|
* default agent CLI (and its model) for New Session — Claude Code ignores them.
|
|
96
|
+
*
|
|
97
|
+
* `mcpServers` / `packs` are the persona's declared capabilities (comma
|
|
98
|
+
* lists): the exact MCP servers and context packs a scheduler job running as
|
|
99
|
+
* this persona loads (personaToolScope.cjs passes them under
|
|
100
|
+
* --strict-mcp-config; an unknown name parks the job). The Agent Library form
|
|
101
|
+
* has no field for them, so savePersona carries the file's values over.
|
|
102
|
+
*
|
|
103
|
+
* `environment` names the persona's declared environment profile
|
|
104
|
+
* (lib/claude/environmentProfiles.cjs; absent = headless-default). Same
|
|
105
|
+
* carry-over rule as mcpServers/packs.
|
|
78
106
|
*/
|
|
79
|
-
const MANAGED_PERSONA_KEYS = new Set(['name', 'description', 'tools', 'model', 'effort', 'color', 'tags', 'projects', 'action', 'actionLabel', 'title', 'seedVersion', 'executorOnly', 'agentCli', 'agentCliModel']);
|
|
107
|
+
const MANAGED_PERSONA_KEYS = new Set(['name', 'description', 'tools', 'model', 'effort', 'color', 'tags', 'projects', 'action', 'actionLabel', 'title', 'seedVersion', 'executorOnly', 'agentCli', 'agentCliModel', 'mcpServers', 'packs', 'environment']);
|
|
80
108
|
|
|
81
109
|
/**
|
|
82
110
|
* Raw text lines of every top-level frontmatter key block in `raw` whose key
|
|
@@ -97,7 +125,7 @@ function extractUnmanagedLines(raw, managed) {
|
|
|
97
125
|
return out;
|
|
98
126
|
}
|
|
99
127
|
|
|
100
|
-
function serializePersona({ name, description, tools, model, effort, color, tags, projects, action, actionLabel, title, seedVersion, executorOnly, agentCli, agentCliModel, body, preservedLines }) {
|
|
128
|
+
function serializePersona({ name, description, tools, model, effort, color, tags, projects, action, actionLabel, title, seedVersion, executorOnly, agentCli, agentCliModel, mcpServers, packs, environment, body, preservedLines }) {
|
|
101
129
|
const lines = ['---', `name: ${name}`];
|
|
102
130
|
if (description) lines.push(`description: ${description}`);
|
|
103
131
|
if (tools && tools.length) lines.push(`tools: ${tools.join(', ')}`);
|
|
@@ -116,6 +144,9 @@ function serializePersona({ name, description, tools, model, effort, color, tags
|
|
|
116
144
|
if (title) lines.push(`title: ${title}`);
|
|
117
145
|
if (typeof seedVersion === 'number' && Number.isFinite(seedVersion)) lines.push(`seedVersion: ${seedVersion}`);
|
|
118
146
|
if (executorOnly === true) lines.push('executorOnly: true');
|
|
147
|
+
if (Array.isArray(mcpServers) && mcpServers.length) lines.push(`mcpServers: ${mcpServers.join(', ')}`);
|
|
148
|
+
if (Array.isArray(packs) && packs.length) lines.push(`packs: ${packs.join(', ')}`);
|
|
149
|
+
if (typeof environment === 'string' && environment.trim()) lines.push(`environment: ${environment.trim()}`);
|
|
119
150
|
if (Array.isArray(preservedLines) && preservedLines.length) lines.push(...preservedLines);
|
|
120
151
|
lines.push('---', '');
|
|
121
152
|
return lines.join('\n') + (body || '').trim() + '\n';
|
|
@@ -196,6 +227,31 @@ async function saveOverlay({ name, projectCwd, model, effort, loadSessions, vali
|
|
|
196
227
|
return { ok: true, path: target };
|
|
197
228
|
}
|
|
198
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Throws (before anything is written) when the persona text about to be
|
|
232
|
+
* written fails validatePersonaFrontmatter, naming every failing key. The
|
|
233
|
+
* checked object is the frontmatter as it will land on disk — managed keys
|
|
234
|
+
* re-parsed from the serialized text, plus every preserved unmanaged key
|
|
235
|
+
* (an unmanaged key is by definition unknown to the schema, so it fails).
|
|
236
|
+
* Required lazily: personaFrontmatterSchema.cjs imports MANAGED_PERSONA_KEYS
|
|
237
|
+
* from this module.
|
|
238
|
+
* @param {string} name
|
|
239
|
+
* @param {string} text
|
|
240
|
+
* @param {string[]} preservedLines
|
|
241
|
+
*/
|
|
242
|
+
function assertValidPersonaText(name, text, preservedLines) {
|
|
243
|
+
const { validatePersonaFrontmatter } = require('./lib/persona-macro/personaFrontmatterSchema.cjs');
|
|
244
|
+
const fm = { ...splitFrontmatter(text).fm };
|
|
245
|
+
for (const line of preservedLines) {
|
|
246
|
+
const m = line.match(/^([A-Za-z][A-Za-z0-9_-]*)\s*:/);
|
|
247
|
+
if (m && !(m[1] in fm)) fm[m[1]] = '';
|
|
248
|
+
}
|
|
249
|
+
const result = validatePersonaFrontmatter(fm);
|
|
250
|
+
if (!result.ok) {
|
|
251
|
+
throw new Error(`invalid persona frontmatter for ${name}: ${result.errors.join('; ')}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
199
255
|
/**
|
|
200
256
|
* Writes a global persona `.md` file — `~/.claude/agents/<name>.md`. Pass
|
|
201
257
|
* `originalName` when renaming an existing persona so the old file is
|
|
@@ -224,6 +280,9 @@ async function savePersona({
|
|
|
224
280
|
executorOnly,
|
|
225
281
|
agentCli,
|
|
226
282
|
agentCliModel,
|
|
283
|
+
mcpServers,
|
|
284
|
+
packs,
|
|
285
|
+
environment,
|
|
227
286
|
body,
|
|
228
287
|
projectCwd,
|
|
229
288
|
globalDir = path.join(os.homedir(), '.claude', 'agents'),
|
|
@@ -253,11 +312,14 @@ async function savePersona({
|
|
|
253
312
|
// agentCli undefined = carry the file's pair over; 'claude' (or any non-CLI value) = write neither line.
|
|
254
313
|
let resolvedAgentCli = agentCli;
|
|
255
314
|
let resolvedAgentCliModel = agentCliModel;
|
|
315
|
+
let resolvedMcpServers = mcpServers;
|
|
316
|
+
let resolvedPacks = packs;
|
|
317
|
+
let resolvedEnvironment = environment;
|
|
256
318
|
let preservedLines = [];
|
|
257
319
|
try {
|
|
258
320
|
preservedLines = extractUnmanagedLines(fsSync.readFileSync(target, 'utf8'), MANAGED_PERSONA_KEYS);
|
|
259
321
|
} catch { /* no existing file — nothing to preserve */ }
|
|
260
|
-
if ([seedVersion, title, projects, action, actionLabel, executorOnly, agentCli].some((v) => v === undefined)) {
|
|
322
|
+
if ([seedVersion, title, projects, action, actionLabel, executorOnly, agentCli, mcpServers, packs, environment].some((v) => v === undefined)) {
|
|
261
323
|
try {
|
|
262
324
|
const { fm } = splitFrontmatter(fsSync.readFileSync(target, 'utf8'));
|
|
263
325
|
if (resolvedSeedVersion === undefined) {
|
|
@@ -274,9 +336,13 @@ async function savePersona({
|
|
|
274
336
|
if (resolvedProjects === undefined && fm.projects) resolvedProjects = parseTools(fm.projects);
|
|
275
337
|
if (resolvedAction === undefined && fm.action) resolvedAction = decodeLine(fm.action);
|
|
276
338
|
if (resolvedActionLabel === undefined && fm.actionLabel) resolvedActionLabel = decodeLine(fm.actionLabel);
|
|
339
|
+
if (resolvedMcpServers === undefined && fm.mcpServers) resolvedMcpServers = parseCapabilityList(fm.mcpServers);
|
|
340
|
+
if (resolvedPacks === undefined && fm.packs) resolvedPacks = parseCapabilityList(fm.packs);
|
|
341
|
+
if (resolvedEnvironment === undefined && typeof fm.environment === 'string' && fm.environment.trim()) resolvedEnvironment = fm.environment.trim();
|
|
277
342
|
} catch { /* no existing file (or unreadable) — nothing to carry over */ }
|
|
278
343
|
}
|
|
279
|
-
const text = serializePersona({ name, description, tools, model, effort, color, tags, projects: resolvedProjects, action: resolvedAction, actionLabel: resolvedActionLabel, title: resolvedTitle, seedVersion: resolvedSeedVersion, executorOnly: resolvedExecutorOnly, agentCli: resolvedAgentCli, agentCliModel: resolvedAgentCliModel, body, preservedLines });
|
|
344
|
+
const text = serializePersona({ name, description, tools, model, effort, color, tags, projects: resolvedProjects, action: resolvedAction, actionLabel: resolvedActionLabel, title: resolvedTitle, seedVersion: resolvedSeedVersion, executorOnly: resolvedExecutorOnly, agentCli: resolvedAgentCli, agentCliModel: resolvedAgentCliModel, mcpServers: resolvedMcpServers, packs: resolvedPacks, environment: resolvedEnvironment, body, preservedLines });
|
|
345
|
+
assertValidPersonaText(name, text, preservedLines);
|
|
280
346
|
await writeTextAtomic(target, text);
|
|
281
347
|
if (originalName && originalName !== name) {
|
|
282
348
|
const oldReal = validatePath(path.join(globalDir, `${originalName}.md`));
|
|
@@ -485,4 +551,6 @@ module.exports = {
|
|
|
485
551
|
getPersonaBody,
|
|
486
552
|
PERSONA_NAME_RE,
|
|
487
553
|
ALL_PROJECTS,
|
|
554
|
+
MANAGED_PERSONA_KEYS,
|
|
555
|
+
parseCapabilityList,
|
|
488
556
|
};
|
package/src/main/agentsIpc.cjs
CHANGED
|
@@ -63,9 +63,10 @@ function registerAgentsHandlers({ ipcMain, getWindow }) {
|
|
|
63
63
|
// (agentModelResolve.cjs's resolveEpicModel), reached here so Terminal's
|
|
64
64
|
// launch (EpicTerminalPane.tsx, a renderer module with no fs access) agrees
|
|
65
65
|
// with Chat by calling the identical function rather than a second one that
|
|
66
|
-
// is merely supposed to.
|
|
66
|
+
// is merely supposed to. Pinned Epics (agentSnapshotId) read the model from
|
|
67
|
+
// their AgentSnapshot (epicSpawnPlan.cjs's resolveEpicTurnModel). Never throws.
|
|
67
68
|
ipcMain.handle('agents:resolve-epic-model', validated(schemas.agentsResolveEpicModel, (payload) =>
|
|
68
|
-
|
|
69
|
+
require('./lib/epic/epicSpawnPlan.cjs').resolveEpicTurnModel(payload)));
|
|
69
70
|
// Effort twin of the above (agentEffortResolve.cjs): Terminal appends
|
|
70
71
|
// `--effort <level>` only when `effort` is non-null. Never throws.
|
|
71
72
|
ipcMain.handle('agents:resolve-epic-effort', validated(schemas.agentsResolveEpicEffort, (payload) =>
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.143.0",
|
|
3
|
+
"gitSha": "9e3a35ddcda5eb03942c74a5c9f9777e31fd81ab",
|
|
4
|
+
"gitShortSha": "9e3a35dd",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-25T04:24:39.027Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|