claude-code-session-manager 0.128.0 → 0.130.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 +2 -0
- package/dist/assets/AgentLibrary-ctvNes4y.js +2 -0
- package/dist/assets/AppSettings-C03qTDSi.js +2 -0
- package/dist/assets/Button-fOCJry21.js +1 -0
- package/dist/assets/Extensions-BWiDwigT.js +13 -0
- package/dist/assets/{History-4rrDdWNP.js → History-BIQFPXM8.js} +2 -2
- package/dist/assets/Library-BGmD-xZN.js +32 -0
- package/dist/assets/ListDetail-BeO3lY8t.js +1 -0
- package/dist/assets/{Memory-DgQlvQrO.js → Memory-BeXuYIcE.js} +8 -8
- package/dist/assets/{Panel-DZHiD8Ar.js → Panel-OUbLHNsS.js} +1 -1
- package/dist/assets/ProvenanceBadge-kr7arZqu.js +1 -0
- package/dist/assets/Scheduler-DycegnjH.js +16 -0
- package/dist/assets/Settings-BSq6VASG.js +2 -0
- package/dist/assets/{SkillReferenceGraph-C5lKqf5y.js → SkillReferenceGraph-CvPdxg56.js} +1 -1
- package/dist/assets/SourceChip-C2YMnlV8.js +1 -0
- package/dist/assets/SystemPrompt-fpXEK_Rm.js +1 -0
- package/dist/assets/{TiptapBody-C2Iu6rZd.js → TiptapBody-DusJg0je.js} +1 -1
- package/dist/assets/{Toggle-C-oD66BG.js → Toggle-BnJF4V6k.js} +1 -1
- package/dist/assets/ViewTabs-BYrRSHb6.js +1 -0
- package/dist/assets/VoiceButton-Bk66E-fP.js +1 -0
- package/dist/assets/{historyTotals-CbRSLD8f.js → historyTotals-DnuVADtI.js} +1 -1
- package/dist/assets/{index-DtdWBGrI.css → index-Bp8XE9A6.css} +1 -1
- package/dist/assets/index-DfWJO7nP.js +3086 -0
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +391 -405
- package/package.json +1 -1
- package/plugins/CLAUDE.md +2 -2
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +2 -2
- package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +2 -2
- package/plugins/session-manager-dev/skills/develop/SKILL.md +7 -5
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +62 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +169 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +183 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +39 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +79 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +400 -0
- package/scripts/hooks/lib/guard-inline-implementation-policy.cjs +10 -0
- package/scripts/scheduler-mcp-server.cjs +25 -6
- package/src/main/agentLibrary.cjs +36 -10
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +8 -0
- package/src/main/config.cjs +15 -0
- package/src/main/health.cjs +49 -22
- package/src/main/index.cjs +32 -3
- package/src/main/ipcSchemas.cjs +39 -4
- package/src/main/lib/claude/agentModelResolve.cjs +5 -3
- package/src/main/lib/claude/effectiveModelInfo.cjs +14 -4
- package/src/main/lib/claude/modelCatalog.cjs +26 -15
- package/src/main/lib/claudeConfig.cjs +156 -0
- package/src/main/lib/effectiveSettings.cjs +120 -0
- package/src/main/lib/epic/delegationReadiness.cjs +3 -3
- package/src/main/lib/epic/developLoopSpawn.cjs +18 -0
- package/src/main/lib/epic/epicMint.cjs +4 -2
- package/src/main/lib/epic/promptSessionsCreateEpic.cjs +4 -3
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +21 -21
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +84 -11
- package/src/main/lib/git/gitWorktree.cjs +400 -9
- package/src/main/lib/git/runtimeStateUntrack.cjs +124 -0
- package/src/main/lib/mcpToolCatalog.cjs +8 -2
- package/src/main/lib/memoryDirResolve.cjs +2 -8
- package/src/main/lib/opsOwnership.cjs +63 -2
- package/src/main/lib/persona-macro/builtinMacros.cjs +30 -0
- package/src/main/lib/persona-macro/macroLibrary.cjs +34 -6
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +46 -0
- package/src/main/lib/prd/prdCreate.cjs +15 -0
- package/src/main/lib/promptSessionSchema.cjs +8 -0
- package/src/main/lib/updateCheck.cjs +6 -1
- package/src/main/pluginInstall.cjs +100 -1
- package/src/main/scheduler.cjs +12 -2
- package/src/main/seedDevPlugin.cjs +2 -1
- package/src/main/templates/PRD_AUTHORING.md +3 -3
- package/src/main/updaterIpc.cjs +5 -1
- package/src/main/usage.cjs +5 -20
- package/src/main/voiceHotkey.cjs +16 -0
- package/src/main/voiceSettings.cjs +24 -0
- package/src/main/voiceWizard.cjs +27 -36
- package/src/preload/api.d.ts +59 -3
- package/src/preload/apiSurface.json +70 -7
- package/src/preload/index.cjs +17 -1
- package/src/seed/agents/architect.md +8 -8
- package/src/seed/agents/demo-video-builder.md +2 -2
- package/src/seed/agents/validator.md +2 -2
- package/dist/assets/AgentLibrary-cNQU5YWy.js +0 -2
- package/dist/assets/Button-9dIPAOBg.js +0 -1
- package/dist/assets/DataModel-DrDJ6ysw.js +0 -1
- package/dist/assets/Hooks-Bj_jF5Pa.js +0 -3
- package/dist/assets/Library-D-Wsxrh7.js +0 -46
- package/dist/assets/ListDetail-D7Om0H8j.js +0 -1
- package/dist/assets/McpServers-CbIbSd5o.js +0 -2
- package/dist/assets/Permissions-CfzduF4B.js +0 -3
- package/dist/assets/Plugins-D-AG5nAo.js +0 -2
- package/dist/assets/ProvenanceBadge-B9JSEjll.js +0 -1
- package/dist/assets/SaveBar-mVKig6hL.js +0 -1
- package/dist/assets/Scheduler-DFTCnh60.js +0 -16
- package/dist/assets/ScopeSwitcher-s8J-yr7Z.js +0 -1
- package/dist/assets/Settings-BTmxRMaP.js +0 -4
- package/dist/assets/Skills-CxOacq0k.js +0 -2
- package/dist/assets/SystemPrompt-BCWg5FAz.js +0 -1
- package/dist/assets/TagLibrary-BnF0_PkG.js +0 -1
- package/dist/assets/ViewTabs-Cs4v7vLY.js +0 -1
- package/dist/assets/index-DzY_GXYY.js +0 -3081
- package/dist/assets/listSkills-C1aWKf0T.js +0 -1
- package/dist/assets/settingsSchema-bSBfHuan.js +0 -1
- package/dist/assets/skillFrontmatter-BEseWm8r.js +0 -10
- package/dist/assets/useAgentsDirWatch-CdyHxKCI.js +0 -1
- package/src/main/lib/epic/epicStandingInstructions.cjs +0 -73
|
@@ -12,18 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
const path = require('node:path');
|
|
14
14
|
const { encodeCwd } = require('./util/encodeCwd.cjs');
|
|
15
|
+
const { pickByPrecedence } = require('./effectiveSettings.cjs');
|
|
15
16
|
|
|
16
17
|
const SCOPES = ['user', 'project', 'local'];
|
|
17
18
|
const NAME_RE = /^[A-Za-z0-9._-]{1,128}$/;
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
function pick(settings, key, pred) {
|
|
21
|
-
for (const layer of ['local', 'project', 'user']) {
|
|
22
|
-
const s = settings && settings[layer];
|
|
23
|
-
if (s && typeof s === 'object' && pred(s[key])) return s[key];
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
20
|
+
const pick = pickByPrecedence;
|
|
27
21
|
|
|
28
22
|
function expandDir(value, home, cwd) {
|
|
29
23
|
if (value === '~') return home;
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* Renderer callers declare their writer id through the IPC payload.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
+
const fs = require('node:fs');
|
|
33
34
|
const path = require('node:path');
|
|
34
35
|
|
|
35
36
|
const OPS_ROOT_DIR = 'session-manager-operations';
|
|
@@ -71,13 +72,31 @@ const OWNERS = Object.freeze({
|
|
|
71
72
|
'ui-prefs': 'ui-prefs',
|
|
72
73
|
});
|
|
73
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Machine-local RUNTIME namespaces: regenerable/ephemeral state that must never
|
|
77
|
+
* be committed. Mirrors this repo's root .gitignore. Everything else in OWNERS
|
|
78
|
+
* (reviews, architecture, project-brief, project-pages, ...) is authored.
|
|
79
|
+
* `feedback` has no OWNERS entry (nothing writes it through the gate) but is
|
|
80
|
+
* runtime state all the same, so it lives only in this set.
|
|
81
|
+
*/
|
|
82
|
+
const RUNTIME_NAMESPACES = Object.freeze([
|
|
83
|
+
'scheduler', 'prompt-sessions', 'feedback', 'logs', 'ui-prefs', 'memory-clusters',
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
/** Writer id for the per-namespace self-ignore file. */
|
|
87
|
+
const RUNTIME_IGNORE_WRITER = 'runtime-ignore';
|
|
88
|
+
|
|
74
89
|
/**
|
|
75
90
|
* Narrow, explicit exceptions to single-writer. Each entry names a second
|
|
76
91
|
* writer, the exact file it may touch, and why the owner can't do it itself.
|
|
77
92
|
* Anything not listed here is refused — a delegation must be argued for in
|
|
78
93
|
* code review, not discovered later in a race.
|
|
79
94
|
*/
|
|
80
|
-
const
|
|
95
|
+
const DELEGATIONS_BASE = {
|
|
96
|
+
// Each runtime namespace carries its own `.gitignore` (content `*`) so the
|
|
97
|
+
// project's root .gitignore needs no edit. Only that one file, only
|
|
98
|
+
// ensureRuntimeIgnores writes it.
|
|
99
|
+
...Object.fromEntries(RUNTIME_NAMESPACES.map((ns) => [ns, []])),
|
|
81
100
|
'prompt-sessions': Object.freeze([
|
|
82
101
|
Object.freeze({
|
|
83
102
|
writer: 'scheduler',
|
|
@@ -91,7 +110,20 @@ const DELEGATIONS = Object.freeze({
|
|
|
91
110
|
+ 'perform them. Serialized per-path by each module\'s own write lock.',
|
|
92
111
|
}),
|
|
93
112
|
]),
|
|
94
|
-
}
|
|
113
|
+
};
|
|
114
|
+
for (const ns of RUNTIME_NAMESPACES) {
|
|
115
|
+
DELEGATIONS_BASE[ns] = Object.freeze([
|
|
116
|
+
...DELEGATIONS_BASE[ns],
|
|
117
|
+
Object.freeze({
|
|
118
|
+
writer: RUNTIME_IGNORE_WRITER,
|
|
119
|
+
file: '.gitignore',
|
|
120
|
+
reason:
|
|
121
|
+
'Self-ignore so machine-local runtime state is never captured by a '
|
|
122
|
+
+ 'sweeping `git add` in a managed project (ensureRuntimeIgnores).',
|
|
123
|
+
}),
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
const DELEGATIONS = Object.freeze(DELEGATIONS_BASE);
|
|
95
127
|
|
|
96
128
|
/**
|
|
97
129
|
* Split an absolute path into { inOps, namespace, relative }.
|
|
@@ -294,7 +326,36 @@ function opsPath(cwd, ...segments) {
|
|
|
294
326
|
return path.join(resolveOpsRoot(cwd), ...segments);
|
|
295
327
|
}
|
|
296
328
|
|
|
329
|
+
/**
|
|
330
|
+
* ensureRuntimeIgnores(projectRoot) → string[] of `.gitignore` paths written.
|
|
331
|
+
* For each runtime namespace dir that already exists under the project's ops
|
|
332
|
+
* root and has no `.gitignore`, write one containing `*` (which also ignores
|
|
333
|
+
* itself). Never creates a namespace dir, never runs git. Idempotent.
|
|
334
|
+
* `projectRoot` must already be resolved (resolveProjectRoot/projectRootOf).
|
|
335
|
+
*/
|
|
336
|
+
function ensureRuntimeIgnores(projectRoot) {
|
|
337
|
+
const { writeTextAtomicSync } = require('./util/atomicFs.cjs');
|
|
338
|
+
const opsRoot = path.join(projectRoot, OPS_ROOT_DIR);
|
|
339
|
+
const written = [];
|
|
340
|
+
for (const ns of RUNTIME_NAMESPACES) {
|
|
341
|
+
const dir = path.join(opsRoot, ns);
|
|
342
|
+
let isDir = false;
|
|
343
|
+
try { isDir = fs.statSync(dir).isDirectory(); } catch { /* absent */ }
|
|
344
|
+
if (!isDir) continue;
|
|
345
|
+
const file = path.join(dir, '.gitignore');
|
|
346
|
+
if (fs.existsSync(file)) continue;
|
|
347
|
+
const verdict = checkOpsWrite(file, RUNTIME_IGNORE_WRITER);
|
|
348
|
+
if (!verdict.ok) throw new Error(verdict.error);
|
|
349
|
+
writeTextAtomicSync(file, '*\n');
|
|
350
|
+
written.push(file);
|
|
351
|
+
}
|
|
352
|
+
return written;
|
|
353
|
+
}
|
|
354
|
+
|
|
297
355
|
module.exports = {
|
|
356
|
+
RUNTIME_NAMESPACES,
|
|
357
|
+
RUNTIME_IGNORE_WRITER,
|
|
358
|
+
ensureRuntimeIgnores,
|
|
298
359
|
OPS_ROOT_DIR,
|
|
299
360
|
OWNERS,
|
|
300
361
|
DELEGATIONS,
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
* prompt means moving the OLD prompt into `priorPrompts` (oldest first) and
|
|
14
14
|
* bumping `builtinVersion`; `builtinVersion === priorPrompts.length + 1`.
|
|
15
15
|
*
|
|
16
|
+
* Optional fields: `inputs` (MacroInput[] — `{ name, label, default?, options?,
|
|
17
|
+
* required? }`, one per `{{name}}` placeholder in the prompt; the hot key asks for
|
|
18
|
+
* them before launching, and `ensureBuiltins` copies them into the seeded macro) and
|
|
19
|
+
* `supersedes` (ids of custom, non-built-in macros retired from the library when
|
|
20
|
+
* this built-in is first seeded, so the owner sees one button, not two). A built-in
|
|
21
|
+
* with no `job` is never a background job; pressing it opens an Epic.
|
|
22
|
+
*
|
|
16
23
|
* Plain Node, no Electron imports.
|
|
17
24
|
*/
|
|
18
25
|
|
|
@@ -59,6 +66,29 @@ const BUILTIN_MACROS = Object.freeze([
|
|
|
59
66
|
prompt:
|
|
60
67
|
"Generate a character and cute animated JavaScript video as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise. The video kind is named on a 'Video kind: <name>' line in the additional instructions: Blog post (a video that presents the blog post named on the 'Video target:' line — a post path in this repository or a URL; read it and tell its real content) or Feature (a video about the feature named on the 'Video target:' line, found in the repository); with no Video kind line, make a Project demo of the whole project's main goals and key features. Ground everything in what you read in the repository (and the target) — invent an original mascot character whose look, name and personality match the subject's theme and purpose, and tell its real story through it. Write the narration script first (hook, problem, solution, key points, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_video_write call passing the htmlPath and the id on the 'Entry id' line.",
|
|
61
68
|
}),
|
|
69
|
+
Object.freeze({
|
|
70
|
+
id: 'builtin-review-md-network',
|
|
71
|
+
label: 'Review MD network',
|
|
72
|
+
agentName: 'architect',
|
|
73
|
+
tag: 'discussion',
|
|
74
|
+
surface: 'project-home',
|
|
75
|
+
projects: ['*'],
|
|
76
|
+
builtinVersion: 1,
|
|
77
|
+
inputs: Object.freeze([
|
|
78
|
+
Object.freeze({ name: 'scope', label: 'Scope', default: 'the whole project', required: true }),
|
|
79
|
+
Object.freeze({
|
|
80
|
+
name: 'mode',
|
|
81
|
+
label: 'Mode',
|
|
82
|
+
options: Object.freeze(['Full review', 'Drift check']),
|
|
83
|
+
default: 'Full review',
|
|
84
|
+
required: true,
|
|
85
|
+
}),
|
|
86
|
+
]),
|
|
87
|
+
supersedes: Object.freeze(['review-md-network-d38ffd']),
|
|
88
|
+
priorPrompts: Object.freeze([]),
|
|
89
|
+
prompt:
|
|
90
|
+
"Use the session-manager-dev:maintaining-md-network skill to review this project's markdown network. Scope: {{scope}}. Mode: {{mode}}.",
|
|
91
|
+
}),
|
|
62
92
|
]);
|
|
63
93
|
|
|
64
94
|
module.exports = { BUILTIN_MACROS };
|
|
@@ -330,15 +330,21 @@ function isShippedCopy(stored, builtin) {
|
|
|
330
330
|
);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
function copyInputs(inputs) {
|
|
334
|
+
return inputs.map((i) => ({ ...i, ...(i.options ? { options: i.options.slice() } : {}) }));
|
|
335
|
+
}
|
|
336
|
+
|
|
333
337
|
function ensureBuiltins(macros, builtins) {
|
|
334
|
-
|
|
338
|
+
/** @type {string[]} */
|
|
339
|
+
const retired = [];
|
|
340
|
+
if (!builtins || builtins.length === 0) return { macros, changed: false, retired };
|
|
335
341
|
let changed = false;
|
|
336
|
-
|
|
342
|
+
let next = macros.slice();
|
|
337
343
|
const now = new Date().toISOString();
|
|
338
344
|
for (const b of builtins) {
|
|
339
345
|
const idx = next.findIndex((m) => m.id === b.id);
|
|
340
346
|
if (idx === -1) {
|
|
341
|
-
|
|
347
|
+
const seeded = {
|
|
342
348
|
id: b.id,
|
|
343
349
|
label: b.label,
|
|
344
350
|
agentName: b.agentName,
|
|
@@ -350,8 +356,20 @@ function ensureBuiltins(macros, builtins) {
|
|
|
350
356
|
builtinVersion: b.builtinVersion,
|
|
351
357
|
createdAt: now,
|
|
352
358
|
updatedAt: now,
|
|
353
|
-
}
|
|
359
|
+
};
|
|
360
|
+
if (b.inputs) seeded.inputs = copyInputs(b.inputs);
|
|
361
|
+
next.push(seeded);
|
|
354
362
|
changed = true;
|
|
363
|
+
if (Array.isArray(b.supersedes) && b.supersedes.length > 0) {
|
|
364
|
+
const gone = new Set(b.supersedes);
|
|
365
|
+
next = next.filter((m) => {
|
|
366
|
+
if (gone.has(m.id) && m.builtin !== true) {
|
|
367
|
+
retired.push(m.id);
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
return true;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
355
373
|
continue;
|
|
356
374
|
}
|
|
357
375
|
const stored = next[idx];
|
|
@@ -368,15 +386,18 @@ function ensureBuiltins(macros, builtins) {
|
|
|
368
386
|
builtinVersion: b.builtinVersion,
|
|
369
387
|
updatedAt: stored.createdAt,
|
|
370
388
|
};
|
|
389
|
+
if (b.inputs) next[idx].inputs = copyInputs(b.inputs);
|
|
390
|
+
else delete next[idx].inputs;
|
|
371
391
|
changed = true;
|
|
372
392
|
}
|
|
373
393
|
}
|
|
374
|
-
return { macros: next, changed };
|
|
394
|
+
return { macros: next, changed, retired };
|
|
375
395
|
}
|
|
376
396
|
|
|
377
397
|
/** Apply builtin seeding/upgrades, writing only when something changed. */
|
|
378
398
|
async function applyBuiltins(filePath, macros, opts) {
|
|
379
|
-
const
|
|
399
|
+
const builtins = resolveBuiltins(opts);
|
|
400
|
+
const { macros: next, changed, retired } = ensureBuiltins(macros, builtins);
|
|
380
401
|
if (!changed) return { macros, failed: false };
|
|
381
402
|
try {
|
|
382
403
|
await writeStore(filePath, next);
|
|
@@ -384,6 +405,10 @@ async function applyBuiltins(filePath, macros, opts) {
|
|
|
384
405
|
console.warn('[macroLibrary] could not persist built-in macro seeding:', err && err.message);
|
|
385
406
|
return { macros, failed: false };
|
|
386
407
|
}
|
|
408
|
+
for (const id of retired) {
|
|
409
|
+
const by = (builtins || []).find((b) => Array.isArray(b.supersedes) && b.supersedes.includes(id));
|
|
410
|
+
console.info(`[macroLibrary] retired macro ${id}, superseded by built-in ${by ? by.id : 'unknown'}`);
|
|
411
|
+
}
|
|
387
412
|
return { macros: next, failed: false };
|
|
388
413
|
}
|
|
389
414
|
|
|
@@ -538,6 +563,9 @@ async function saveMacro(input, opts = {}) {
|
|
|
538
563
|
if (parsed.id) {
|
|
539
564
|
const idx = macros.findIndex((m) => m.id === parsed.id);
|
|
540
565
|
if (idx === -1) throw new Error(`macro not found: ${parsed.id}`);
|
|
566
|
+
if (macros[idx].builtin && parsed.surface !== undefined && parsed.surface !== macros[idx].surface) {
|
|
567
|
+
throw new Error('built-in macro surface cannot be changed');
|
|
568
|
+
}
|
|
541
569
|
const projects = parsed.projects !== undefined ? normalizeProjects(parsed.projects) : macros[idx].projects;
|
|
542
570
|
saved = {
|
|
543
571
|
...macros[idx],
|
|
@@ -63,6 +63,30 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
63
63
|
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
commit: "f91d78eb",
|
|
68
|
+
bodySha256: "f0b9bf01ddb9dc4c52a2c446dd20759070347ccc5b125ddbe812bb82cfec17c6",
|
|
69
|
+
fm: {
|
|
70
|
+
description: "The primary Actor for an Epic's whole interactive conversation — owns overall plan and decomposition, clarifies scope, searches before building, decomposes work into scheduled PRDs via /develop, tracks them to completion, and verifies before calling anything done. Never implements a PRD itself — that's dev-lead's job, one PRD at a time, headless. Task-type framing is the Epic's Mission tag's job, not this persona's.",
|
|
71
|
+
model: "opus",
|
|
72
|
+
effort: "medium",
|
|
73
|
+
tags: "feature, bug, discussion, art",
|
|
74
|
+
title: "Engineering — Architect",
|
|
75
|
+
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
commit: "2651bc05",
|
|
80
|
+
bodySha256: "522f0bd3b4119a4fe7a01571907657de2cc2c01129171cf5b60aa16eecaf4375",
|
|
81
|
+
fm: {
|
|
82
|
+
description: "The primary Actor for an Epic's whole interactive conversation — owns overall plan and decomposition, clarifies scope, searches before building, decomposes work into scheduled PRDs via /develop, tracks them to completion, and verifies before calling anything done. Never implements a PRD itself — that's dev-lead's job, one PRD at a time, headless. Task-type framing is the Epic's Mission tag's job, not this persona's.",
|
|
83
|
+
model: "opus",
|
|
84
|
+
effort: "medium",
|
|
85
|
+
tags: "feature, bug, discussion, art",
|
|
86
|
+
title: "Engineering — Architect",
|
|
87
|
+
tools: "Read, Grep, Glob, Bash, Edit, Write",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
66
90
|
],
|
|
67
91
|
"dev-lead": [
|
|
68
92
|
{
|
|
@@ -308,6 +332,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
308
332
|
tools: "Read, Grep, Glob, Bash",
|
|
309
333
|
},
|
|
310
334
|
},
|
|
335
|
+
{
|
|
336
|
+
commit: "94bb42df",
|
|
337
|
+
bodySha256: "3e4759c7c8d801edb8ac44222f59373aaa1cd0711358b73705bb93edef2dff7d",
|
|
338
|
+
fm: {
|
|
339
|
+
description: "Validates a finished PLAN (the PRDs its validate PRD lists) once, after its last PRD lands — re-runs each PRD's gate, checks every acceptance criterion against the real tree, reviews the plan's combined diff, and reports one VERIFIED/REFUTED verdict per PRD via sentinel lines. Runs headless as a scheduled PRD (agentType: validator); never edits product code and never queues work.",
|
|
340
|
+
executorOnly: "true",
|
|
341
|
+
model: "sonnet",
|
|
342
|
+
title: "Engineering — Plan Validator",
|
|
343
|
+
tools: "Read, Grep, Glob, Bash",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
311
346
|
],
|
|
312
347
|
"demo-video-builder": [
|
|
313
348
|
{
|
|
@@ -442,6 +477,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
442
477
|
effort: "max",
|
|
443
478
|
},
|
|
444
479
|
},
|
|
480
|
+
{
|
|
481
|
+
commit: "94bb42df",
|
|
482
|
+
bodySha256: "a94b4555c975711a57ab35a90db8de10f47065cddf83b47c3be75822728de069",
|
|
483
|
+
fm: {
|
|
484
|
+
description: "30-second or 1-minute self-contained HTML/JS demo video for Project Home, saved via project_video_write.",
|
|
485
|
+
tools: "Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__project_demo_video_write, mcp__session-manager-scheduler__project_video_write, mcp__session-manager-scheduler__project_character_write",
|
|
486
|
+
title: "Project Home — Demo Video",
|
|
487
|
+
model: "opus",
|
|
488
|
+
effort: "max",
|
|
489
|
+
},
|
|
490
|
+
},
|
|
445
491
|
],
|
|
446
492
|
"blender-artist": [
|
|
447
493
|
{
|
|
@@ -313,6 +313,21 @@ async function createPrdInner(input, remote, ctl, opts = {}) {
|
|
|
313
313
|
if (fallback) input = { ...input, sourcePromptId: fallback };
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
// Develop-loop-off Epics never receive PRDs (so no check-ins, digests or
|
|
317
|
+
// validation sweeps either). Safety refusal — deliberately no bypass.
|
|
318
|
+
if (input.sourcePromptId) {
|
|
319
|
+
const { sessions } = readActiveIndex(cwd);
|
|
320
|
+
const row = Object.prototype.hasOwnProperty.call(sessions, input.sourcePromptId)
|
|
321
|
+
? sessions[input.sourcePromptId] : null;
|
|
322
|
+
if (row && row.developLoop === false) {
|
|
323
|
+
return {
|
|
324
|
+
ok: false, applied: false, status: 409,
|
|
325
|
+
error: `Epic ${input.sourcePromptId} was started with the develop loop off, so it cannot queue PRDs. `
|
|
326
|
+
+ 'Start a new session with the develop loop on to queue this work.',
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
316
331
|
// Wave-disposition decision point (scheduler wave-disposition PRD): only
|
|
317
332
|
// matters for a PRD that would become a ROOT of its own wave — one the
|
|
318
333
|
// caller didn't already give an explicit dependsOn (that already fixes
|
|
@@ -59,6 +59,11 @@ const EpicIntakeSectionSchema = z.object({
|
|
|
59
59
|
label: z.string(),
|
|
60
60
|
text: z.string(),
|
|
61
61
|
source: z.string().optional(),
|
|
62
|
+
// Mirrors AimPart in src/renderer/lib/epicIntake.ts (main cannot import the
|
|
63
|
+
// renderer module). Optional because Epics minted before AIM sections carry
|
|
64
|
+
// none. NEVER narrow the kind enum above — dropInvalidSessions in
|
|
65
|
+
// ipcSchemas.cjs drops a whole stored Epic whose record fails this schema.
|
|
66
|
+
part: z.enum(['persona', 'grounding', 'injection', 'reference', 'job-type', 'goal']).optional(),
|
|
62
67
|
});
|
|
63
68
|
|
|
64
69
|
// Mirrors PromptSession's `worktree` field (src/renderer/state/
|
|
@@ -89,6 +94,9 @@ const PromptSessionSchema = z.object({
|
|
|
89
94
|
// Per-Epic runtime overrides chosen on the New Session card; absent = the persona's own value.
|
|
90
95
|
model: z.string().optional(),
|
|
91
96
|
effort: z.string().optional(),
|
|
97
|
+
// false = started with the develop loop (/develop skill, delegation guard, PRD queueing) switched off;
|
|
98
|
+
// fixed for the life of its session; absent = on; only false is ever written.
|
|
99
|
+
developLoop: z.boolean().optional(),
|
|
92
100
|
// Absent on Epics minted before this field existed — those fall back to
|
|
93
101
|
// rendering the flat `openingPrompt` as a single block (see
|
|
94
102
|
// ChatTranscriptTurn.tsx's EpicIntakeCard).
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* against the latest GitHub Release; npx/dev builds against the npm registry). Never throws/rejects; any failure
|
|
8
8
|
* (offline, DNS, non-200, bad JSON, timeout) → { current, latest: null, behind: false, channel }.
|
|
9
9
|
* The request is a bare GET (only a static User-Agent; no cookies/query/body) so it carries nothing that
|
|
10
|
-
* identifies the user or machine. Disabled by SM_UPDATE_CHECK=0
|
|
10
|
+
* identifies the user or machine. Disabled by SM_UPDATE_CHECK=0, E2E mode (SM_E2E=1), or the auto-update toggle being off.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
const https = require('node:https');
|
|
@@ -91,6 +91,11 @@ async function getUpdateStatus({ deps } = {}) {
|
|
|
91
91
|
channel = packaged ? 'installer' : 'npm';
|
|
92
92
|
const env = d.env || process.env;
|
|
93
93
|
if (env.SM_UPDATE_CHECK === '0' || env.SM_E2E === '1') return { current, latest: null, behind: false, channel };
|
|
94
|
+
// The in-app auto-update toggle (updaterSettings) also gates the probe: off = no network request.
|
|
95
|
+
const autoUpdateOn = d.isAutoUpdateEnabled
|
|
96
|
+
? await d.isAutoUpdateEnabled()
|
|
97
|
+
: (await require('./updaterSettings.cjs').load()).enabled !== false;
|
|
98
|
+
if (!autoUpdateOn) return { current, latest: null, behind: false, channel };
|
|
94
99
|
|
|
95
100
|
const now = (d.now || Date.now)();
|
|
96
101
|
const write = d.writeJson || require('../config.cjs').writeJson;
|
|
@@ -34,6 +34,7 @@ const { cleanChildEnv, pathWithUserBins } = require('./lib/process/cleanEnv.cjs'
|
|
|
34
34
|
const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claude/claudeBin.cjs');
|
|
35
35
|
const { sendIfAlive } = require('./lib/sendToRenderer.cjs');
|
|
36
36
|
const { schemas } = require('./ipcSchemas.cjs');
|
|
37
|
+
const claudeConfig = require('./lib/claudeConfig.cjs');
|
|
37
38
|
|
|
38
39
|
// Must start with an alphanumeric so a leading `-` can't smuggle a CLI flag into
|
|
39
40
|
// `claude plugin install <slug>` (argv flag injection).
|
|
@@ -255,6 +256,84 @@ async function update({ slug, marketplaceName }) {
|
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
|
|
259
|
+
// ── Installed-plugin truth: ONE definition ────────────────────────────────
|
|
260
|
+
// A plugin is "installed" iff ~/.claude/plugins/installed_plugins.json has an
|
|
261
|
+
// entry under key `name@marketplace`. "Enabled" is user-scope
|
|
262
|
+
// ~/.claude/settings.json enabledPlugins[key] === true (same meaning as
|
|
263
|
+
// delegationReadiness's check).
|
|
264
|
+
const PLUGIN_KEY_RE = /^[a-z0-9][a-z0-9._\-]*@[a-z0-9][a-z0-9._\-]*$/i;
|
|
265
|
+
|
|
266
|
+
/** @param {string} [home] */
|
|
267
|
+
function listInstalled(home) {
|
|
268
|
+
const h = home || os.homedir();
|
|
269
|
+
let installed = {};
|
|
270
|
+
let enabledMap = {};
|
|
271
|
+
try {
|
|
272
|
+
const raw = JSON.parse(fs.readFileSync(path.join(h, '.claude', 'plugins', 'installed_plugins.json'), 'utf8'));
|
|
273
|
+
if (raw && typeof raw.plugins === 'object' && raw.plugins && !Array.isArray(raw.plugins)) installed = raw.plugins;
|
|
274
|
+
} catch { /* missing/invalid => none installed */ }
|
|
275
|
+
try {
|
|
276
|
+
const st = JSON.parse(fs.readFileSync(path.join(h, '.claude', 'settings.json'), 'utf8'));
|
|
277
|
+
if (st && typeof st.enabledPlugins === 'object' && st.enabledPlugins) enabledMap = st.enabledPlugins;
|
|
278
|
+
} catch { /* none enabled */ }
|
|
279
|
+
return Object.keys(installed).map((key) => {
|
|
280
|
+
const at = key.lastIndexOf('@');
|
|
281
|
+
const rec = Array.isArray(installed[key]) ? installed[key][0] : installed[key];
|
|
282
|
+
return {
|
|
283
|
+
key,
|
|
284
|
+
name: at > 0 ? key.slice(0, at) : key,
|
|
285
|
+
marketplace: at > 0 ? key.slice(at + 1) : '',
|
|
286
|
+
version: rec && typeof rec.version === 'string' ? rec.version : null,
|
|
287
|
+
scope: rec && typeof rec.scope === 'string' ? rec.scope : null,
|
|
288
|
+
installPath: rec && typeof rec.installPath === 'string' ? rec.installPath : null,
|
|
289
|
+
enabled: enabledMap[key] === true,
|
|
290
|
+
};
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** @param {string} key name@marketplace @param {string} [home] */
|
|
295
|
+
function isInstalled(key, home) {
|
|
296
|
+
return listInstalled(home).some((p) => p.key === key);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Write enabledPlugins[key] in user settings.json via claudeConfig.patch. */
|
|
300
|
+
async function setEnabled({ key, enabled, home }) {
|
|
301
|
+
if (typeof key !== 'string' || !PLUGIN_KEY_RE.test(key) || key.length > 256 || typeof enabled !== 'boolean') {
|
|
302
|
+
return { ok: false, error: 'invalid plugin key' };
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
await claudeConfig.patch({ fileId: 'settings', scope: 'user', home, keyPath: ['enabledPlugins', key], value: enabled });
|
|
306
|
+
return { ok: true };
|
|
307
|
+
} catch (err) {
|
|
308
|
+
return { ok: false, error: err?.message ?? String(err) };
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Uninstall `<slug>@<marketplaceName>` through the same runStep pty runner.
|
|
314
|
+
* `runner` is injectable for tests; defaults to runStep.
|
|
315
|
+
*/
|
|
316
|
+
async function uninstall({ slug, marketplaceName, runner }) {
|
|
317
|
+
if (typeof slug !== 'string' || !SLUG_RE.test(slug) || slug.length > 128 ||
|
|
318
|
+
typeof marketplaceName !== 'string' || !MKT_NAME_RE.test(marketplaceName) || marketplaceName.length > 128) {
|
|
319
|
+
return { ok: false, exitCode: -1, error: 'invalid slug or marketplace' };
|
|
320
|
+
}
|
|
321
|
+
if (inFlight.has(slug)) {
|
|
322
|
+
return { ok: false, exitCode: -1, error: 'install already in progress' };
|
|
323
|
+
}
|
|
324
|
+
inFlight.set(slug, null);
|
|
325
|
+
try {
|
|
326
|
+
return await (runner || runStep)({
|
|
327
|
+
slug,
|
|
328
|
+
args: ['plugin', 'uninstall', `${slug}@${marketplaceName}`],
|
|
329
|
+
register: (proc) => inFlight.set(slug, proc),
|
|
330
|
+
unregister: () => inFlight.set(slug, null),
|
|
331
|
+
});
|
|
332
|
+
} finally {
|
|
333
|
+
inFlight.delete(slug);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
258
337
|
function registerPluginInstallHandlers() {
|
|
259
338
|
ipcMain.handle('plugins:install', async (_e, payload) => {
|
|
260
339
|
// safeParse to preserve the existing `{ ok:false, exitCode:-1, error }`
|
|
@@ -267,6 +346,23 @@ function registerPluginInstallHandlers() {
|
|
|
267
346
|
return install({ slug: parsed.data.slug, marketplace: parsed.data.marketplace });
|
|
268
347
|
});
|
|
269
348
|
|
|
349
|
+
ipcMain.handle('plugins:list', async (_e, payload) => {
|
|
350
|
+
schemas.pluginsList.parse(payload ?? {});
|
|
351
|
+
return listInstalled();
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
ipcMain.handle('plugins:set-enabled', async (_e, payload) => {
|
|
355
|
+
const parsed = schemas.pluginsSetEnabled.safeParse(payload);
|
|
356
|
+
if (!parsed.success) return { ok: false, error: 'invalid plugin key' };
|
|
357
|
+
return setEnabled(parsed.data);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
ipcMain.handle('plugins:uninstall', async (_e, payload) => {
|
|
361
|
+
const parsed = schemas.pluginsUninstall.safeParse(payload);
|
|
362
|
+
if (!parsed.success) return { ok: false, exitCode: -1, error: 'invalid slug or marketplace' };
|
|
363
|
+
return uninstall(parsed.data);
|
|
364
|
+
});
|
|
365
|
+
|
|
270
366
|
// plugins:abort — send SIGKILL to a stuck install and release the inFlight
|
|
271
367
|
// lock immediately, analogous to pty:kill. UI wiring is a follow-up PRD.
|
|
272
368
|
ipcMain.handle('plugins:abort', async (_e, payload) => {
|
|
@@ -283,4 +379,7 @@ function registerPluginInstallHandlers() {
|
|
|
283
379
|
});
|
|
284
380
|
}
|
|
285
381
|
|
|
286
|
-
module.exports = {
|
|
382
|
+
module.exports = {
|
|
383
|
+
registerPluginInstallHandlers, attachWindow, install, update, bundledMarketplaceDir,
|
|
384
|
+
listInstalled, isInstalled, setEnabled, uninstall,
|
|
385
|
+
};
|
package/src/main/scheduler.cjs
CHANGED
|
@@ -76,7 +76,7 @@ const {
|
|
|
76
76
|
findLiveProcessForJob, logHasOutput, resolvePidlessGateOutcome, resolveCommitGuardOutcome,
|
|
77
77
|
readSpawnedPidFromLog, readLogMtimeMs, isClaudeArgv,
|
|
78
78
|
} = require('./lib/scheduler/reaperHelpers.cjs');
|
|
79
|
-
const { resolveProjectRoot } = require('./lib/opsOwnership.cjs');
|
|
79
|
+
const { resolveProjectRoot, ensureRuntimeIgnores } = require('./lib/opsOwnership.cjs');
|
|
80
80
|
const { sweepStrandedJobBranches } = require('./lib/git/branchSweep.cjs');
|
|
81
81
|
const { detectRateLimitInLog } = require('./lib/claude/rateLimitDetect.cjs');
|
|
82
82
|
const { stripAppOwnedChurn } = require('./lib/scheduler/jobDirtFilter.cjs');
|
|
@@ -1655,6 +1655,16 @@ async function reconcilePass(state) {
|
|
|
1655
1655
|
if (shouldRunFlatSweep(phaseStartMs, lastFlatSweepMs, FLAT_SWEEP_INTERVAL_MS)) {
|
|
1656
1656
|
lastFlatSweepMs = phaseStartMs;
|
|
1657
1657
|
await prdPaths.consolidateAllFlatPrds(allProjectCwds(), skipCwds);
|
|
1658
|
+
// Runtime namespaces self-ignore (once per project root; throttled with the sweep).
|
|
1659
|
+
try {
|
|
1660
|
+
const roots = new Set();
|
|
1661
|
+
for (const c of allProjectCwds()) {
|
|
1662
|
+
try { roots.add(resolveProjectRoot(c)); } catch { /* ephemeral/invalid cwd */ }
|
|
1663
|
+
}
|
|
1664
|
+
for (const r of roots) {
|
|
1665
|
+
try { ensureRuntimeIgnores(r); } catch { /* best-effort */ }
|
|
1666
|
+
}
|
|
1667
|
+
} catch { /* best-effort */ }
|
|
1658
1668
|
phaseMs.flatPrdSweep = Date.now() - phaseStartMs;
|
|
1659
1669
|
} else {
|
|
1660
1670
|
phaseMs.flatPrdSweep = 0;
|
|
@@ -6059,7 +6069,7 @@ async function finalizeJobWorktree({ job, runId = null, runDir, worktree, guardC
|
|
|
6059
6069
|
console.error(`[scheduler] ${job.slug}: worktree branch integration FAILED (${integration.reason}) — branch ${worktree.branch} preserved in ${guardCwd} for manual recovery`);
|
|
6060
6070
|
} else if (integration.integrated) {
|
|
6061
6071
|
integratedSha = integration.sha || null;
|
|
6062
|
-
console.log(`[scheduler] ${job.slug}: worktree branch ${worktree.branch} integrated into ${guardCwd}${integration.mergeCommit ? ' (merge commit)' : ' (fast-forward)'}`);
|
|
6072
|
+
console.log(`[scheduler] ${job.slug}: worktree branch ${worktree.branch} integrated into ${guardCwd}${integration.linear ? ' (linear replay)' : integration.mergeCommit ? ' (merge commit)' : ' (fast-forward)'}`);
|
|
6063
6073
|
if (integration.autoResolved) {
|
|
6064
6074
|
mergeAutoResolved = integration.autoResolved;
|
|
6065
6075
|
mergeAutoResolvedPaths = integration.resolvedPaths || [];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* First-boot seeder for the bundled `session-manager-dev` plugin.
|
|
3
3
|
*
|
|
4
|
-
* The plugin (
|
|
4
|
+
* The plugin (4 skills under plugins/session-manager-dev/skills: builder, develop,
|
|
5
|
+
* maintaining-md-network, send-feedback) ships inside the npx distribution. To make it
|
|
5
6
|
* a true default, the app installs it on first launch from its own bundled
|
|
6
7
|
* marketplace (offline — no GitHub/registry). Idempotent two ways:
|
|
7
8
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- PRD_AUTHORING.md
|
|
1
|
+
<!-- PRD_AUTHORING.md v19 -->
|
|
2
2
|
# PRD Authoring Guide — Scheduler Safety Rules
|
|
3
3
|
|
|
4
4
|
Rule: every PRD you queue follows the rules below.
|
|
@@ -129,8 +129,8 @@ A short Epic-context digest is prepended automatically for orientation only —
|
|
|
129
129
|
|
|
130
130
|
The executor can't ask you anything: no `ScheduleWakeup`, Cron, Monitor, `AskUserQuestion`, plan mode, or worktree tools; background tasks are off (a `timeout` command is always on PATH — the app installs a shim on macOS). It must never stop to ask a question — it makes the safest reasonable call and reports it, so write the PRD so that call is obvious.
|
|
131
131
|
|
|
132
|
-
Worktree reach: every PRD runs in an isolated git worktree holding tracked files plus `node_modules` and non-uv `.venv`/`venv` symlinked from the main checkout; pnpm projects (pnpm-lock.yaml) get a worktree-local `node_modules` installed offline from the store, and uv projects (uv.lock) get a worktree-local env built by an offline frozen `uv sync`, not a symlink. Why: a pnpm install through the symlink purged the main checkout's node_modules (Bilko-Game-Academy 2026-10-18). A step that needs gitignored runtime state (databases,
|
|
133
|
-
Why: burrow PRD 1516 halted because its relative `.venv` python against
|
|
132
|
+
Worktree reach: every PRD runs in an isolated git worktree holding tracked files plus `node_modules` and non-uv `.venv`/`venv` symlinked from the main checkout; pnpm projects (pnpm-lock.yaml) get a worktree-local `node_modules` installed offline from the store, and uv projects (uv.lock) get a worktree-local env built by an offline frozen `uv sync`, not a symlink. Why: a pnpm install through the symlink purged the main checkout's node_modules (Bilko-Game-Academy 2026-10-18). A step that needs gitignored runtime state (databases, downloads/, browser profiles, logs) or a live side effect must address the main checkout by absolute path (e.g. `$HOME/Projects/<repo>/...`), be artifact-only (a deliverable artifact + `artifactPaths`, no tracked edits), and `dependsOn` the PRD that lands its tracked edits. A project may declare `worktreeSetup` gate-syntax commands in a tracked `.session-manager.json` at the repo root; they run once per fresh job worktree and baseline scratch worktree, before the executor starts, with cwd = the worktree root (a project in a subfolder names it, e.g. `timeout 600 godot --headless --path game --import`). Setups run one at a time per project and are never skipped; they must write only inside the worktree (node_modules and non-uv venvs are symlinks into the main checkout). The outcome is the `[scheduler] worktree setup:` lines at the top of the run log plus `worktreeSetup` in the run's meta.json. Host crontab installs stay human-only (see §14).
|
|
133
|
+
Why: burrow PRD 1516 halted because its relative `.venv` python against downloads/fb-tracker.db, scripts/install-cron.sh and `pipeline-cron.sh --now` resolved inside the worktree (no runtime state; install-cron would bake a temporary worktree path into crontab), while sibling 1494 succeeded the same day using an absolute main-checkout path and artifact-only output. `scheduler_create_prd` warns on relative gitignored paths.
|
|
134
134
|
|
|
135
135
|
Rule: a job's processes never outlive it — the group sweep at exit, the job scope stop (systemd) and the 5-minute leftover sweep (Linux) stop anything it started, so `nohup` or `&` does not daemonize. Anything that must keep running goes to a service manager (systemd unit, cron), never `nohup` or `&`.
|
|
136
136
|
Why: finished jobs left dev servers running for days, holding memory and ports.
|
package/src/main/updaterIpc.cjs
CHANGED
|
@@ -73,7 +73,11 @@ function registerUpdaterIpc({ ipcMain, getWindow, ptyManager, deps = {} }) {
|
|
|
73
73
|
const snapshot = () => ({ ...updater.status(), enabled });
|
|
74
74
|
updater.subscribe(() => sendIfAlive(getWindow(), 'updater:status', snapshot()));
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
// One status API: updater state plus the latest-version probe result (`check`), which honours `enabled`.
|
|
77
|
+
const checkResult = () => (d.getUpdateStatus || require('./lib/updateCheck.cjs').getUpdateStatus)({
|
|
78
|
+
deps: { isAutoUpdateEnabled: () => enabled },
|
|
79
|
+
});
|
|
80
|
+
ipcMain.handle('updater:status', async () => ({ ...snapshot(), check: await checkResult() }));
|
|
77
81
|
ipcMain.handle('updater:check', async () => {
|
|
78
82
|
await updater.checkNow();
|
|
79
83
|
return snapshot();
|
package/src/main/usage.cjs
CHANGED
|
@@ -23,6 +23,7 @@ const os = require('node:os');
|
|
|
23
23
|
const { ipcMain } = require('electron');
|
|
24
24
|
const { refreshIfNeeded, expiresAtMs } = require('./lib/credentials.cjs');
|
|
25
25
|
const { writeJson } = require('./config.cjs');
|
|
26
|
+
const { effectiveSettings } = require('./lib/effectiveSettings.cjs');
|
|
26
27
|
const { createUsageCircuit, singleFlight } = require('./lib/claude/usageCircuit.cjs');
|
|
27
28
|
|
|
28
29
|
const USAGE_URL = 'https://api.anthropic.com/api/oauth/usage';
|
|
@@ -40,29 +41,13 @@ function envEnabled(v) {
|
|
|
40
41
|
* not inherit the shell's environment, so `process.env` looks like a clean
|
|
41
42
|
* consumer install even when `claude` itself is talking to a gateway.
|
|
42
43
|
*
|
|
43
|
-
* Precedence
|
|
44
|
-
* settings, then user-local settings. Missing/unreadable/invalid files are
|
|
44
|
+
* Precedence via lib/effectiveSettings.cjs: managed (enterprise) beats local beats user. Missing/unreadable/invalid files are
|
|
45
45
|
* skipped. Returns `{ env, apiKeyHelper }`.
|
|
46
46
|
*/
|
|
47
47
|
function readClaudeSettingsAuth() {
|
|
48
|
-
const merged = {};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
? '/Library/Application Support/ClaudeCode/managed-settings.json'
|
|
52
|
-
: '/etc/claude-code/managed-settings.json';
|
|
53
|
-
const files = [
|
|
54
|
-
managed,
|
|
55
|
-
path.join(os.homedir(), '.claude', 'settings.json'),
|
|
56
|
-
path.join(os.homedir(), '.claude', 'settings.local.json'),
|
|
57
|
-
];
|
|
58
|
-
for (const f of files) {
|
|
59
|
-
try {
|
|
60
|
-
const data = JSON.parse(fs.readFileSync(f, 'utf8'));
|
|
61
|
-
if (data && typeof data.env === 'object' && data.env) Object.assign(merged, data.env);
|
|
62
|
-
if (data && data.apiKeyHelper) apiKeyHelper = true;
|
|
63
|
-
} catch { /* missing / unreadable / invalid JSON → skip */ }
|
|
64
|
-
}
|
|
65
|
-
return { env: merged, apiKeyHelper };
|
|
48
|
+
const { merged } = effectiveSettings({ home: os.homedir() });
|
|
49
|
+
const env = merged.env && typeof merged.env === 'object' && !Array.isArray(merged.env) ? merged.env : {};
|
|
50
|
+
return { env, apiKeyHelper: !!merged.apiKeyHelper };
|
|
66
51
|
}
|
|
67
52
|
|
|
68
53
|
/**
|