claude-code-session-manager 0.129.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/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-B2x-LMlT.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-CnalwnFf.js → Memory-BeXuYIcE.js} +8 -8
- package/dist/assets/{Panel-BzIklgKf.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-DOhiCxuL.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-Du6jRBoW.js → TiptapBody-DusJg0je.js} +1 -1
- package/dist/assets/{Toggle-Qdi2Z7VD.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-8ecP_6wF.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 +390 -406
- 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 +3 -3
- 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/scheduler-mcp-server.cjs +25 -6
- package/src/main/agentLibrary.cjs +36 -10
- package/src/main/build-info.json +4 -4
- package/src/main/config.cjs +15 -0
- package/src/main/health.cjs +49 -22
- package/src/main/index.cjs +19 -3
- package/src/main/ipcSchemas.cjs +36 -3
- package/src/main/lib/claude/modelCatalog.cjs +15 -31
- 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/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 +22 -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 +53 -2
- package/src/preload/apiSurface.json +63 -7
- package/src/preload/index.cjs +12 -1
- package/src/seed/agents/demo-video-builder.md +2 -2
- package/src/seed/agents/validator.md +2 -2
- package/dist/assets/AgentLibrary-Cp250YHF.js +0 -2
- package/dist/assets/Button-DU5UF-6L.js +0 -1
- package/dist/assets/DataModel-CPf6f17e.js +0 -1
- package/dist/assets/Hooks-BWr33C4Q.js +0 -3
- package/dist/assets/Library-DBNLTAa8.js +0 -46
- package/dist/assets/ListDetail-BGBw6egp.js +0 -1
- package/dist/assets/McpServers-DywZ50Ec.js +0 -2
- package/dist/assets/Permissions-mgRifwQc.js +0 -3
- package/dist/assets/Plugins-CV42zfid.js +0 -2
- package/dist/assets/ProvenanceBadge-DYmX4xgB.js +0 -1
- package/dist/assets/SaveBar-DxrAfnlC.js +0 -1
- package/dist/assets/Scheduler-iyUl1NDl.js +0 -16
- package/dist/assets/ScopeSwitcher-CC8BDPgf.js +0 -1
- package/dist/assets/Settings-CWBnQghD.js +0 -4
- package/dist/assets/Skills-3Er-9YA9.js +0 -2
- package/dist/assets/SystemPrompt-BLxdvZ9K.js +0 -1
- package/dist/assets/TagLibrary-BZ6QHYMQ.js +0 -1
- package/dist/assets/ViewTabs-BKfFsziD.js +0 -1
- package/dist/assets/index-GI6F_j41.js +0 -3083
- package/dist/assets/listSkills-C1aWKf0T.js +0 -1
- package/dist/assets/settingsSchema-lHTHAabD.js +0 -1
- package/dist/assets/skillFrontmatter-8X1Uc282.js +0 -10
- package/dist/assets/useAgentsDirWatch-CcsoD1bp.js +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runtimeStateUntrack.cjs — find and safely untrack Session Manager runtime
|
|
3
|
+
* state that a project accidentally committed.
|
|
4
|
+
*
|
|
5
|
+
* Why the preconditions: `git rm --cached` committed in a linked worktree and
|
|
6
|
+
* then merged deletes the LIVE files in the main checkout. So the untrack runs
|
|
7
|
+
* only from the project's MAIN checkout, on the default branch, with a clean
|
|
8
|
+
* index, no in-flight merge/rebase/cherry-pick, and no running job.
|
|
9
|
+
*
|
|
10
|
+
* Never edits the root .gitignore: each runtime namespace carries its own
|
|
11
|
+
* self-ignore file (opsOwnership.ensureRuntimeIgnores). Not wired to any UI or
|
|
12
|
+
* MCP route — surface it in a follow-up.
|
|
13
|
+
*/
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('node:fs');
|
|
17
|
+
const path = require('node:path');
|
|
18
|
+
const { execGit } = require('./gitExec.cjs');
|
|
19
|
+
const { RUNTIME_NAMESPACES, OPS_ROOT_DIR } = require('../opsOwnership.cjs');
|
|
20
|
+
|
|
21
|
+
const ATTRIBUTION = 'Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>';
|
|
22
|
+
const RM_BATCH = 200;
|
|
23
|
+
|
|
24
|
+
const nsPathspecs = () => RUNTIME_NAMESPACES.map((ns) => `${OPS_ROOT_DIR}/${ns}`);
|
|
25
|
+
|
|
26
|
+
/** Tracked paths (repo-relative, posix) under runtime namespaces, README.md excluded. */
|
|
27
|
+
async function findTrackedRuntimeState(projectRoot) {
|
|
28
|
+
let out;
|
|
29
|
+
try {
|
|
30
|
+
out = await execGit(projectRoot, ['ls-files', '-z', '--', ...nsPathspecs()], { maxBuffer: 64 * 1024 * 1024 });
|
|
31
|
+
} catch {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return out.split('\0').filter((p) => p && path.posix.basename(p) !== 'README.md');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Sorted list of every file on disk under the runtime namespaces. */
|
|
38
|
+
function listRuntimeFilesOnDisk(projectRoot) {
|
|
39
|
+
const found = [];
|
|
40
|
+
const walk = (abs, rel) => {
|
|
41
|
+
let entries;
|
|
42
|
+
try { entries = fs.readdirSync(abs, { withFileTypes: true }); } catch { return; }
|
|
43
|
+
for (const e of entries) {
|
|
44
|
+
const r = `${rel}/${e.name}`;
|
|
45
|
+
if (e.isDirectory()) walk(path.join(abs, e.name), r);
|
|
46
|
+
else found.push(r);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
for (const ns of RUNTIME_NAMESPACES) {
|
|
50
|
+
walk(path.join(projectRoot, OPS_ROOT_DIR, ns), `${OPS_ROOT_DIR}/${ns}`);
|
|
51
|
+
}
|
|
52
|
+
return found.sort();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function git(cwd, args) {
|
|
56
|
+
return (await execGit(cwd, args)).trim();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function defaultBranchOf(cwd) {
|
|
60
|
+
try {
|
|
61
|
+
const ref = await git(cwd, ['symbolic-ref', '--short', 'refs/remotes/origin/HEAD']);
|
|
62
|
+
if (ref) return ref.replace(/^origin\//, '');
|
|
63
|
+
} catch { /* no remote HEAD */ }
|
|
64
|
+
for (const b of ['main', 'master']) {
|
|
65
|
+
try {
|
|
66
|
+
await git(cwd, ['rev-parse', '--verify', '--quiet', `refs/heads/${b}`]);
|
|
67
|
+
return b;
|
|
68
|
+
} catch { /* try next */ }
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* untrackRuntimeState(projectRoot, opts) → { ok, reason?, removed?, committed? }
|
|
75
|
+
* opts: { isProjectBusy: () => boolean|Promise<boolean> (required),
|
|
76
|
+
* defaultBranch?: string }
|
|
77
|
+
* On refusal nothing is touched.
|
|
78
|
+
*/
|
|
79
|
+
async function untrackRuntimeState(projectRoot, opts = {}) {
|
|
80
|
+
const refuse = (reason) => ({ ok: false, reason });
|
|
81
|
+
try {
|
|
82
|
+
const gitDir = path.resolve(projectRoot, await git(projectRoot, ['rev-parse', '--git-dir']));
|
|
83
|
+
const commonDir = path.resolve(projectRoot, await git(projectRoot, ['rev-parse', '--git-common-dir']));
|
|
84
|
+
if (gitDir !== commonDir) return refuse('projectRoot is a linked worktree; run from the main checkout');
|
|
85
|
+
|
|
86
|
+
const branch = await git(projectRoot, ['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
87
|
+
const def = opts.defaultBranch || await defaultBranchOf(projectRoot);
|
|
88
|
+
if (!def) return refuse('cannot determine the default branch');
|
|
89
|
+
if (branch !== def) return refuse(`HEAD is on '${branch}', not the default branch '${def}'`);
|
|
90
|
+
|
|
91
|
+
for (const marker of ['MERGE_HEAD', 'CHERRY_PICK_HEAD', 'REVERT_HEAD', 'rebase-merge', 'rebase-apply']) {
|
|
92
|
+
if (fs.existsSync(path.join(gitDir, marker))) {
|
|
93
|
+
return refuse(`a merge, rebase or cherry-pick is in progress (${marker})`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if ((await git(projectRoot, ['diff', '--cached', '--name-only'])) !== '') {
|
|
98
|
+
return refuse('the index already has staged changes');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (typeof opts.isProjectBusy !== 'function') return refuse('opts.isProjectBusy is required');
|
|
102
|
+
if (await opts.isProjectBusy()) return refuse('a job is running for this project');
|
|
103
|
+
|
|
104
|
+
const tracked = await findTrackedRuntimeState(projectRoot);
|
|
105
|
+
if (tracked.length === 0) return { ok: true, removed: 0, committed: false };
|
|
106
|
+
|
|
107
|
+
const before = listRuntimeFilesOnDisk(projectRoot);
|
|
108
|
+
for (let i = 0; i < tracked.length; i += RM_BATCH) {
|
|
109
|
+
await execGit(projectRoot, ['rm', '-r', '--cached', '-q', '--', ...tracked.slice(i, i + RM_BATCH)], { timeout: 120_000 });
|
|
110
|
+
}
|
|
111
|
+
const msg = `chore(ops): untrack Session Manager runtime state (${tracked.length} files)\n\n${ATTRIBUTION}`;
|
|
112
|
+
await execGit(projectRoot, ['commit', '-m', msg], { timeout: 60_000 });
|
|
113
|
+
|
|
114
|
+
const after = listRuntimeFilesOnDisk(projectRoot);
|
|
115
|
+
if (before.length !== after.length || before.some((f, i) => f !== after[i])) {
|
|
116
|
+
return { ok: false, reason: 'on-disk runtime file list changed across the untrack', removed: tracked.length, committed: true };
|
|
117
|
+
}
|
|
118
|
+
return { ok: true, removed: tracked.length, committed: true };
|
|
119
|
+
} catch (err) {
|
|
120
|
+
return refuse(`git failed: ${(err && (err.stderrText || err.message)) || err}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
module.exports = { findTrackedRuntimeState, untrackRuntimeState, listRuntimeFilesOnDisk };
|
|
@@ -434,7 +434,8 @@ const MCP_TOOL_CATALOG = [
|
|
|
434
434
|
name: 'macro_list',
|
|
435
435
|
group: 'macros',
|
|
436
436
|
purpose: "List this project's HOT KEYS macros — the saved (agent, tag, prompt) one-click buttons shown "
|
|
437
|
-
+ "in the Sessions tab's HOT KEYS strip, via the session-manager app's admin API."
|
|
437
|
+
+ "in the Sessions tab's HOT KEYS strip or the Project Home button row, via the session-manager app's admin API. "
|
|
438
|
+
+ "Each macro's `surface` tells where it shows: 'sessions' = Sessions HOT KEYS strip, 'project-home' = Project Home button row.",
|
|
438
439
|
whenToUse: 'Use to see what macros already exist for this project (including machine-wide `*` macros and '
|
|
439
440
|
+ 'built-ins) before deciding whether to add, update or delete one.',
|
|
440
441
|
whenNotToUse: 'WHEN NOT TO USE IT: macros are scoped to the caller\'s own project — this only ever returns '
|
|
@@ -455,7 +456,8 @@ const MCP_TOOL_CATALOG = [
|
|
|
455
456
|
+ '`id` resolves to a macro not visible to this project. Built-in macros (`id` starting with `builtin-`) '
|
|
456
457
|
+ "cannot be edited through this route. A macro is a HUMAN's one-click button, not a task runner — never "
|
|
457
458
|
+ 'create or update one unless the human has actually asked for that macro to exist. '
|
|
458
|
-
+ 'To remove a macro use macro_delete; never rewrite it into a placeholder.'
|
|
459
|
+
+ 'To remove a macro use macro_delete; never rewrite it into a placeholder. '
|
|
460
|
+
+ 'Never pass `projects` unless the human asked for every project in this chat; quote their words in `humanRequestQuote`.',
|
|
459
461
|
exampleArgs: {
|
|
460
462
|
cwd: '/home/bilko/Projects/session-manager',
|
|
461
463
|
label: 'Publish git + npm',
|
|
@@ -466,6 +468,10 @@ const MCP_TOOL_CATALOG = [
|
|
|
466
468
|
},
|
|
467
469
|
notes: "cwd is optional — defaults to the calling session's own project root (SM_PROJECT_ROOT or "
|
|
468
470
|
+ 'process.cwd()) when omitted. label, agentName, tag and prompt are all required strings. '
|
|
471
|
+
+ "`surface` is optional: 'sessions' = Sessions HOT KEYS strip, 'project-home' = Project Home button row. "
|
|
472
|
+
+ '`projects: ["*"]` shows the macro in every project; it needs `humanRequestQuote`, the words the human typed in '
|
|
473
|
+
+ 'this chat that ask for every/all projects, and is refused in a scheduled job or outside a Session Manager session. '
|
|
474
|
+
+ 'Without `projects` the macro stays scoped to this project. '
|
|
469
475
|
+ '`inputs` is an optional array of { name, label, default, required, options } fields the human fills in '
|
|
470
476
|
+ 'when pressing the macro; reference each in the prompt as {{name}}. Omitting `inputs` on update keeps '
|
|
471
477
|
+ 'the existing inputs; `[]` clears them.',
|
|
@@ -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],
|
|
@@ -332,6 +332,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
332
332
|
tools: "Read, Grep, Glob, Bash",
|
|
333
333
|
},
|
|
334
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
|
+
},
|
|
335
346
|
],
|
|
336
347
|
"demo-video-builder": [
|
|
337
348
|
{
|
|
@@ -466,6 +477,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
|
|
|
466
477
|
effort: "max",
|
|
467
478
|
},
|
|
468
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
|
+
},
|
|
469
491
|
],
|
|
470
492
|
"blender-artist": [
|
|
471
493
|
{
|
|
@@ -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.
|