claude-code-session-manager 0.138.0 → 0.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +352 -79
- package/dist/assets/AppSettings-CMFEM68R.js +2 -0
- package/dist/assets/History--JwsFnbn.js +2 -0
- package/dist/assets/HomeClaudeConfig-ijEXs--3.js +3 -0
- package/dist/assets/{Panel-CeDiyuNn.js → Panel-CALyU0pe.js} +1 -1
- package/dist/assets/ProjectClaudeConfig-sdlA-fUb.js +26 -0
- package/dist/assets/Scheduler-YT3j8SUa.js +16 -0
- package/dist/assets/{SkillReferenceGraph-CFMK8NJh.js → SkillReferenceGraph-CxAuwhNN.js} +1 -1
- package/dist/assets/Skills-DtRzghn5.js +67 -0
- package/dist/assets/{TiptapBody-D1kTj-tn.js → TiptapBody-DApeu7x8.js} +60 -54
- package/dist/assets/ViewTabs-B7qLXRAH.js +1 -0
- package/dist/assets/{VoiceButton-CZeyPM31.js → VoiceButton-DtStfv1H.js} +1 -1
- package/dist/assets/{historyTotals-B00l64Jw.js → historyTotals-ydfnwepc.js} +1 -1
- package/dist/assets/index-CtxruO1L.js +3121 -0
- package/dist/assets/{index-62tyjEQB.css → index-DKXdXfka.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +467 -451
- package/package.json +17 -6
- package/plugins/AGENTS.md +60 -0
- package/plugins/CLAUDE.md +1 -60
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +12 -4
- package/plugins/session-manager-dev/skills/builder/scripts/publish-preflight.cjs +255 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +36 -22
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +5 -4
- package/plugins/session-manager-dev/skills/maintaining-md-network/audit.md +4 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +16 -12
- package/plugins/session-manager-dev/skills/maintaining-md-network/migrate-to-agents-md.md +15 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/placement.md +50 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/plan.md +10 -10
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +117 -112
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdDuplicates.cjs +182 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs +340 -0
- package/scripts/README.md +2 -0
- package/scripts/hooks/guard-tool-risk.cjs +91 -0
- package/scripts/hooks/lib/guard-tool-risk-policy.cjs +217 -0
- package/scripts/ops-sweep.cjs +53 -23
- package/scripts/scheduler-mcp-server.cjs +360 -35
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +2 -2
- package/src/main/config.cjs +112 -8
- package/src/main/docEdit.cjs +6 -1
- package/src/main/exchanges.cjs +70 -5
- package/src/main/files.cjs +7 -27
- package/src/main/health.cjs +48 -15
- package/src/main/historyAggregator.cjs +172 -63
- package/src/main/historyDashboard.cjs +87 -17
- package/src/main/index.cjs +78 -4
- package/src/main/ipcSchemas.cjs +233 -20
- package/src/main/lib/AGENTS.md +54 -0
- package/src/main/lib/CLAUDE.md +1 -54
- package/src/main/lib/agent-cli/adapters/codex.cjs +5 -2
- package/src/main/lib/agent-cli/agentCliIpc.cjs +18 -2
- package/src/main/lib/agent-cli/agentCliSessionStore.cjs +1 -0
- package/src/main/lib/agent-cli/agentCliTurn.cjs +20 -2
- package/src/main/lib/agent-cli/geminiContextDefaults.cjs +94 -0
- package/src/main/lib/claude/effectiveModelInfo.cjs +92 -22
- package/src/main/lib/claude/jobSandboxPolicy.cjs +202 -0
- package/src/main/lib/claude/modelPricing.cjs +148 -0
- package/src/main/lib/claude/personaToolScope.cjs +12 -6
- package/src/main/lib/claude/rateLimitDetect.cjs +13 -2
- package/src/main/lib/claude/runClaudeP.cjs +6 -1
- package/src/main/lib/claude/toolRiskIpc.cjs +177 -0
- package/src/main/lib/claude/toolRiskMarks.cjs +373 -0
- package/src/main/lib/demo-video-kit/seedKit.cjs +27 -6
- package/src/main/lib/ephemeralCwd.cjs +37 -2
- package/src/main/lib/epic/delegationReadiness.cjs +42 -9
- package/src/main/lib/epic/epicAdminRoutes.cjs +121 -0
- package/src/main/lib/epic/epicJobReceipt.cjs +87 -0
- package/src/main/lib/epic/epicOutsideRead.cjs +423 -0
- package/src/main/lib/epic/epicOutsideState.cjs +233 -0
- package/src/main/lib/epic/epicSettle.cjs +1 -1
- package/src/main/lib/epic/epicStateWatcher.cjs +157 -0
- package/src/main/lib/epic/epicSweepValidator.cjs +7 -2
- package/src/main/lib/epic/epicValidationHook.cjs +24 -4
- package/src/main/lib/epic/externalRef.cjs +37 -0
- package/src/main/lib/epic/externalRefIndex.cjs +136 -0
- package/src/main/lib/epic/guardSpawnSettings.cjs +57 -1
- package/src/main/lib/epic/restorableSessions.cjs +151 -17
- package/src/main/lib/epic/transcriptUsage.cjs +197 -0
- package/src/main/lib/externalContract.cjs +137 -0
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +176 -5
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +186 -9
- package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +16 -6
- package/src/main/lib/feedback-remote/customerFeedbackClient.cjs +50 -8
- package/src/main/lib/feedback-remote/customerFeedbackInbox.cjs +218 -4
- package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +19 -3
- package/src/main/lib/feedback-remote/feedbackImages.cjs +171 -0
- package/src/main/lib/feedback-remote/localAdminHttp.cjs +11 -10
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +167 -21
- package/src/main/lib/feedback-remote/needsYouAdminRoutes.cjs +133 -0
- package/src/main/lib/feedback-remote/needsYouIpc.cjs +50 -0
- package/src/main/lib/feedback-remote/needsYouStore.cjs +285 -0
- package/src/main/lib/feedback-remote/projectHomeAdminRoutes.cjs +98 -1
- package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +5 -0
- package/src/main/lib/git/branchSweep.cjs +209 -4
- package/src/main/lib/git/gitWorktree.cjs +41 -5
- package/src/main/lib/guardShims.cjs +1 -1
- package/src/main/lib/historyRollup.cjs +58 -5
- package/src/main/lib/insideHome.cjs +27 -1
- package/src/main/lib/mcpToolCatalog.cjs +232 -25
- package/src/main/lib/mdDocCensus.cjs +59 -78
- package/src/main/lib/mdDocRefs.cjs +71 -93
- package/src/main/lib/mdNetworkScan.cjs +245 -250
- package/src/main/lib/mdReviewRecord.cjs +22 -9
- package/src/main/lib/memoryMdNetwork.cjs +5 -12
- package/src/main/lib/opsOwnership.cjs +18 -2
- package/src/main/lib/opsRetentionSettings.cjs +28 -4
- package/src/main/lib/persona-macro/agentAdminRoutes.cjs +121 -0
- package/src/main/lib/persona-macro/macroJobDispatch.cjs +90 -20
- package/src/main/lib/persona-macro/macroJobIpc.cjs +144 -46
- package/src/main/lib/persona-macro/macroJobStatus.cjs +87 -9
- package/src/main/lib/persona-macro/macroLibrary.cjs +95 -5
- package/src/main/lib/persona-macro/personaImportHealth.cjs +78 -17
- package/src/main/lib/persona-macro/projectVideoToolCheck.cjs +96 -0
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +11 -0
- package/src/main/lib/prd/depSlugResolve.cjs +104 -4
- package/src/main/lib/prd/prdAdminRoutes.cjs +35 -2
- package/src/main/lib/prd/prdCreate.cjs +351 -23
- package/src/main/lib/prd/prdDisposition.cjs +11 -2
- package/src/main/lib/prd/prdFrontmatter.cjs +96 -3
- package/src/main/lib/process/loginItem.cjs +171 -0
- package/src/main/lib/process/loginItemPlan.cjs +193 -0
- package/src/main/lib/project-pages/playerBridge.cjs +4 -0
- package/src/main/lib/project-pages/videoReview.cjs +268 -0
- package/src/main/lib/project-pages/videoReviewIpc.cjs +229 -0
- package/src/main/lib/promptSessionSchema.cjs +4 -0
- package/src/main/lib/remoteTranscriptTail.cjs +32 -1
- package/src/main/lib/scheduler/cpuSample.cjs +131 -4
- package/src/main/lib/scheduler/fixPlanSlug.cjs +4 -3
- package/src/main/lib/scheduler/loadGate.cjs +24 -6
- package/src/main/lib/scheduler/planRecordHarvest.cjs +108 -0
- package/src/main/lib/scheduler/planRecordRetention.cjs +144 -0
- package/src/main/lib/scheduler/queueStore.cjs +7 -0
- package/src/main/lib/scheduler/rcaReport.cjs +21 -1
- package/src/main/lib/scheduler/reaperHelpers.cjs +35 -5
- package/src/main/lib/scheduler/runLogRetention.cjs +104 -3
- package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
- package/src/main/lib/scheduler/schedulerBatch.cjs +25 -48
- package/src/main/lib/scheduler/schedulerPaths.cjs +12 -0
- package/src/main/lib/scheduler/sessionSlots.cjs +176 -21
- package/src/main/lib/scheduler/validationQuality.cjs +282 -0
- package/src/main/lib/scheduler/validatorVerdictSchema.cjs +254 -0
- package/src/main/lib/tasks/taskAdminRoutes.cjs +641 -0
- package/src/main/lib/tasks/taskIpc.cjs +80 -0
- package/src/main/lib/tasks/taskLedger.cjs +502 -0
- package/src/main/lib/tasks/taskRun.cjs +313 -0
- package/src/main/lib/tasks/taskSwitch.cjs +120 -0
- package/src/main/lib/telemetry/auditEvents.cjs +176 -0
- package/src/main/lib/telemetry/eventsAdminRoutes.cjs +45 -0
- package/src/main/loginItemIpc.cjs +35 -0
- package/src/main/loopEfficiencyHandlers.cjs +11 -2
- package/src/main/projectPages.cjs +6 -15
- package/src/main/promptSessionEvents.cjs +9 -1
- package/src/main/queueOps.cjs +260 -3
- package/src/main/runVerify.cjs +53 -25
- package/src/main/scheduler/AGENTS.md +26 -0
- package/src/main/scheduler/CLAUDE.md +1 -26
- package/src/main/scheduler/budget.cjs +239 -9
- package/src/main/scheduler/cancelDependents.cjs +154 -0
- package/src/main/scheduler/prdParser.cjs +4 -1
- package/src/main/scheduler/starvation.cjs +20 -18
- package/src/main/scheduler.cjs +774 -64
- package/src/main/supervisor.cjs +5 -1
- package/src/main/templates/PRD_AUTHORING.md +7 -1
- package/src/main/transcripts.cjs +62 -7
- package/src/main/validationQualityHandlers.cjs +199 -0
- package/src/main/webRemote.cjs +132 -20
- package/src/preload/api.d.ts +434 -28
- package/src/preload/apiSurface.cjs +7 -0
- package/src/preload/apiSurface.json +485 -81
- package/src/preload/index.cjs +38 -5
- package/src/seed/agents/validator.md +19 -8
- package/dist/assets/AgentLibrary-C1d_D7uQ.js +0 -2
- package/dist/assets/AppSettings-CgDhqrsU.js +0 -2
- package/dist/assets/Button-Bk23rEnZ.js +0 -1
- package/dist/assets/DocumentEditorPane-BqY5Nq6W.js +0 -1
- package/dist/assets/Extensions-CXem-uwI.js +0 -2
- package/dist/assets/History-BwO3coo4.js +0 -2
- package/dist/assets/Library-BDV69fSe.js +0 -32
- package/dist/assets/ListDetail-CD-Fm6mh.js +0 -1
- package/dist/assets/ProjectClaudeConfig-NjdKdwe8.js +0 -25
- package/dist/assets/ProvenanceBadge-Bu8NmI_R.js +0 -1
- package/dist/assets/Scheduler-CkhTvG7C.js +0 -16
- package/dist/assets/Settings-COT34hBF.js +0 -2
- package/dist/assets/Skills-BgexoUkQ.js +0 -29
- package/dist/assets/SourceChip-BXjcdeb1.js +0 -1
- package/dist/assets/SystemPrompt-CeeH3EeW.js +0 -1
- package/dist/assets/Toggle-CENi19iK.js +0 -1
- package/dist/assets/ViewTabs-DDBb0x96.js +0 -1
- package/dist/assets/claude-settings-schema-COigsajx.js +0 -3
- package/dist/assets/index-CgCxpunJ.js +0 -3116
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
* - newestRecordName(names) — pure: the newest record file name, or null.
|
|
17
17
|
* - parseReviewRecord(text) — pure: the template fields; never throws.
|
|
18
18
|
* - readMdReview(root, { epicIds }) — newest record + validation record paths
|
|
19
|
-
*
|
|
19
|
+
* for each safe Epic id, read from disk in plan-records/<epicId>/ (the
|
|
20
|
+
* machine-local, never-committed namespace) merged with the legacy
|
|
21
|
+
* reviews/validation/<epicId>/ history. On a file-name clash the
|
|
22
|
+
* plan-records copy wins.
|
|
20
23
|
*/
|
|
21
24
|
|
|
22
25
|
const fsp = require('node:fs/promises');
|
|
@@ -244,11 +247,14 @@ async function readMdReview(root, opts = {}) {
|
|
|
244
247
|
/** @type {string} */
|
|
245
248
|
let docsDir;
|
|
246
249
|
/** @type {string} */
|
|
247
|
-
let
|
|
250
|
+
let planRecordsDir;
|
|
251
|
+
/** @type {string} */
|
|
252
|
+
let legacyValidationDir;
|
|
248
253
|
try {
|
|
249
254
|
projectRoot = resolveProjectRoot(root);
|
|
250
255
|
docsDir = opsPath(root, 'reviews', 'docs');
|
|
251
|
-
|
|
256
|
+
planRecordsDir = opsPath(root, 'plan-records');
|
|
257
|
+
legacyValidationDir = opsPath(root, 'reviews', 'validation');
|
|
252
258
|
} catch (err) {
|
|
253
259
|
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
254
260
|
}
|
|
@@ -273,12 +279,19 @@ async function readMdReview(root, opts = {}) {
|
|
|
273
279
|
const ids = Array.isArray(opts.epicIds) ? opts.epicIds : [];
|
|
274
280
|
for (const id of ids) {
|
|
275
281
|
if (typeof id !== 'string' || !EPIC_ID_RE.test(id) || validation[id]) continue;
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
.
|
|
281
|
-
|
|
282
|
+
/** @type {Map<string, string>} file name -> repo-relative path */
|
|
283
|
+
const byName = new Map();
|
|
284
|
+
// plan-records first so its copy wins a name clash with the legacy folder.
|
|
285
|
+
for (const base of [planRecordsDir, legacyValidationDir]) {
|
|
286
|
+
const dir = path.join(base, id);
|
|
287
|
+
for (const e of await listDir(dir)) {
|
|
288
|
+
if (!e.isFile() || !e.name.endsWith('.md') || byName.has(e.name)) continue;
|
|
289
|
+
byName.set(e.name, rel(projectRoot, path.join(dir, e.name)));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// Ordered by file name so the last entry is the newest record (the
|
|
293
|
+
// renderer's pickValidationPath takes the last one).
|
|
294
|
+
validation[id] = [...byName.keys()].sort().map((n) => /** @type {string} */ (byName.get(n)));
|
|
282
295
|
}
|
|
283
296
|
|
|
284
297
|
return { ok: true, record, recordPath, validation };
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
const fs = require('node:fs');
|
|
11
11
|
const path = require('node:path');
|
|
12
|
+
const { linksOf } = require('../../../plugins/session-manager-dev/skills/maintaining-md-network/scripts/mdLinks.cjs');
|
|
12
13
|
|
|
13
14
|
const ROOT_MAX_BYTES = 16 * 1024;
|
|
14
15
|
const MAX_DOCS = 60;
|
|
@@ -18,7 +19,6 @@ const HITS_PER_DOC = 3;
|
|
|
18
19
|
const HITS_TOTAL = 8;
|
|
19
20
|
const MAX_LINE_CHARS = 200;
|
|
20
21
|
|
|
21
|
-
const MD_LINK_RE = /\]\(([^)\s]+\.md)(#[^)]*)?\)/g;
|
|
22
22
|
const TERM_RE = /`([^`\n]{4,80})`/g;
|
|
23
23
|
const ROOT_DOC = 'CLAUDE.md';
|
|
24
24
|
|
|
@@ -35,18 +35,11 @@ function safeRead(readFile, abs) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** Docs the root CLAUDE.md links to, by the shared link convention (mdLinks.cjs). */
|
|
38
39
|
function extractLinkedDocs(rootText) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
while ((m = MD_LINK_RE.exec(rootText)) !== null) {
|
|
43
|
-
const target = m[1];
|
|
44
|
-
if (/^(?:https?|file):\/\//i.test(target)) continue;
|
|
45
|
-
const norm = path.posix.normalize(target);
|
|
46
|
-
if (norm.startsWith('..') || norm.startsWith('/')) continue;
|
|
47
|
-
out.push(norm);
|
|
48
|
-
}
|
|
49
|
-
return out;
|
|
40
|
+
return linksOf({ path: ROOT_DOC, text: rootText })
|
|
41
|
+
.filter((l) => !l.escapes && /\.md$/i.test(l.to))
|
|
42
|
+
.map((l) => l.to);
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
function extractTerms(body) {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* - lib/epic/epicMint.cjs (raw fs tmp+rename)
|
|
28
28
|
* - lib/scheduler/queueStore.cjs (raw fs tmp+rename)
|
|
29
29
|
* - lib/telemetry/opsErrorLog.cjs (raw fs append, JSONL error log)
|
|
30
|
+
* - lib/tasks/taskLedger.cjs (raw fs append + atomicFs bodies)
|
|
30
31
|
* Renderer callers declare their writer id through the IPC payload.
|
|
31
32
|
*/
|
|
32
33
|
|
|
@@ -70,6 +71,16 @@ const OWNERS = Object.freeze({
|
|
|
70
71
|
// the renderer through the generic config:write-json IPC with writer:
|
|
71
72
|
// 'ui-prefs'; no dedicated main-process module. See ui-prefs/README.md.
|
|
72
73
|
'ui-prefs': 'ui-prefs',
|
|
74
|
+
// The Task ledger: one summary JSONL line per Task event (a Task = one
|
|
75
|
+
// headless claude -p run for this project) in tasks/<YYYY-MM-DD>.jsonl, plus
|
|
76
|
+
// tasks/bodies/<taskId>.json prompt/output bodies. lib/tasks/taskLedger.cjs is
|
|
77
|
+
// the ONLY writer; routes, IPC and history read through it. See tasks/README.md.
|
|
78
|
+
'tasks': 'tasks',
|
|
79
|
+
// Per-run plan records (validator + ship/deploy records), laid out as
|
|
80
|
+
// plan-records/<epic-id>/<slug>.md. Machine-local runtime state: the
|
|
81
|
+
// scheduler copies them out of job worktrees and prunes them after the Epic
|
|
82
|
+
// completes. See plan-records/README.md.
|
|
83
|
+
'plan-records': 'scheduler',
|
|
73
84
|
});
|
|
74
85
|
|
|
75
86
|
/**
|
|
@@ -80,7 +91,8 @@ const OWNERS = Object.freeze({
|
|
|
80
91
|
* runtime state all the same, so it lives only in this set.
|
|
81
92
|
*/
|
|
82
93
|
const RUNTIME_NAMESPACES = Object.freeze([
|
|
83
|
-
'scheduler', 'prompt-sessions', 'feedback', 'logs', 'ui-prefs', 'memory-clusters',
|
|
94
|
+
'scheduler', 'prompt-sessions', 'feedback', 'logs', 'ui-prefs', 'memory-clusters', 'tasks',
|
|
95
|
+
'plan-records',
|
|
84
96
|
]);
|
|
85
97
|
|
|
86
98
|
/** Writer id for the per-namespace self-ignore file. */
|
|
@@ -303,7 +315,11 @@ function resolveProjectRoot(cwd, { opsInternal = 'normalize' } = {}) {
|
|
|
303
315
|
// `unknown` deliberately does NOT throw here: reads and dispatch must keep
|
|
304
316
|
// working; assertOpsWrite is the choke point that refuses the WRITE.
|
|
305
317
|
const root = classifyCwd(cwd).projectRoot;
|
|
306
|
-
|
|
318
|
+
// refuseMissingInTmp:false — a MISSING path is not a write target this
|
|
319
|
+
// resolver can refuse; readers need its path, and existence-aware callers
|
|
320
|
+
// report it themselves (see ephemeralCwd.cjs). Existing tmpdir roots and
|
|
321
|
+
// linked worktrees are still refused below.
|
|
322
|
+
if (isEphemeralCwd(root, { refuseMissingInTmp: false })) {
|
|
307
323
|
const err = new Error(
|
|
308
324
|
`resolveProjectRoot: refusing ephemeral cwd (tmpdir or linked git worktree), got "${cwd}"`,
|
|
309
325
|
);
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Storage: ~/.claude/session-manager/ops-retention.json
|
|
5
5
|
* Shape (DEFAULTS): { runLogs:{maxAgeDays,keepPerSlug}, runsArchiveDays, auditLogMonths,
|
|
6
|
-
* reservedMarkersKeep }
|
|
6
|
+
* reservedMarkersKeep, tasksDays, planRecordsDays }
|
|
7
|
+
* tasksDays: Task ledger day files + bodies (lib/tasks/taskLedger.cjs pruneOld).
|
|
8
|
+
* planRecordsDays: plan-records/<epic-id>/ folders of completed/orphan Epics
|
|
9
|
+
* (lib/scheduler/planRecordRetention.cjs prunePlanRecords).
|
|
7
10
|
* Archived transcripts are kept forever (fixed policy, not a setting).
|
|
8
11
|
*
|
|
9
12
|
* Top-level in lib/ (no domain fits: read by scheduler, telemetry and epic sweeps alike).
|
|
@@ -22,6 +25,8 @@ const DEFAULTS = Object.freeze({
|
|
|
22
25
|
runsArchiveDays: 30,
|
|
23
26
|
auditLogMonths: 6,
|
|
24
27
|
reservedMarkersKeep: 100,
|
|
28
|
+
tasksDays: 30,
|
|
29
|
+
planRecordsDays: 14,
|
|
25
30
|
});
|
|
26
31
|
|
|
27
32
|
// [min, max] per integer field; out-of-range values clamp, non-integers round.
|
|
@@ -31,6 +36,8 @@ const BOUNDS = Object.freeze({
|
|
|
31
36
|
runsArchiveDays: [1, 3650],
|
|
32
37
|
auditLogMonths: [1, 120],
|
|
33
38
|
reservedMarkersKeep: [1, 100000],
|
|
39
|
+
tasksDays: [1, 3650],
|
|
40
|
+
planRecordsDays: [1, 3650],
|
|
34
41
|
});
|
|
35
42
|
|
|
36
43
|
function storePath() {
|
|
@@ -64,7 +71,7 @@ function validatePatch(patch) {
|
|
|
64
71
|
if (rk !== 'maxAgeDays' && rk !== 'keepPerSlug') throw new Error(`Invalid ops retention config: runLogs.${rk}`);
|
|
65
72
|
out.runLogs[rk] = num(`runLogs.${rk}`, rv);
|
|
66
73
|
}
|
|
67
|
-
} else if (k === 'runsArchiveDays' || k === 'auditLogMonths' || k === 'reservedMarkersKeep') {
|
|
74
|
+
} else if (k === 'runsArchiveDays' || k === 'auditLogMonths' || k === 'reservedMarkersKeep' || k === 'tasksDays' || k === 'planRecordsDays') {
|
|
68
75
|
out[k] = num(k, v);
|
|
69
76
|
} else {
|
|
70
77
|
throw new Error(`Invalid ops retention config: unknown key ${k}`);
|
|
@@ -88,7 +95,7 @@ function sanitizeStored(data) {
|
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
97
|
}
|
|
91
|
-
for (const key of ['runsArchiveDays', 'auditLogMonths', 'reservedMarkersKeep']) {
|
|
98
|
+
for (const key of ['runsArchiveDays', 'auditLogMonths', 'reservedMarkersKeep', 'tasksDays', 'planRecordsDays']) {
|
|
92
99
|
const v = int(key, data[key]);
|
|
93
100
|
if (v !== undefined) out[key] = v;
|
|
94
101
|
}
|
|
@@ -113,6 +120,8 @@ function withDefaults(stored) {
|
|
|
113
120
|
runsArchiveDays: s.runsArchiveDays ?? DEFAULTS.runsArchiveDays,
|
|
114
121
|
auditLogMonths: s.auditLogMonths ?? DEFAULTS.auditLogMonths,
|
|
115
122
|
reservedMarkersKeep: s.reservedMarkersKeep ?? DEFAULTS.reservedMarkersKeep,
|
|
123
|
+
tasksDays: s.tasksDays ?? DEFAULTS.tasksDays,
|
|
124
|
+
planRecordsDays: s.planRecordsDays ?? DEFAULTS.planRecordsDays,
|
|
116
125
|
};
|
|
117
126
|
}
|
|
118
127
|
|
|
@@ -136,7 +145,9 @@ function write(patch) {
|
|
|
136
145
|
|
|
137
146
|
/**
|
|
138
147
|
* Dry-run report of what each policy would free, via the sweeps' own
|
|
139
|
-
* eligibility code. Read-only. opts: { now, runsDir, plansRoot, jobs, liveKeys
|
|
148
|
+
* eligibility code. Read-only. opts: { now, runsDir, plansRoot, jobs, liveKeys,
|
|
149
|
+
* projectRoot, epicStatus }. planRecords is reported only when projectRoot is given;
|
|
150
|
+
* epicStatus defaults to reading that project's prompt-sessions/<id>.json.
|
|
140
151
|
*/
|
|
141
152
|
function preview(opts) {
|
|
142
153
|
const o = opts || {};
|
|
@@ -167,10 +178,23 @@ function preview(opts) {
|
|
|
167
178
|
dryRun: true,
|
|
168
179
|
});
|
|
169
180
|
const tmp = staleTmpSweep.sweepStaleTmp(plansRoot, { now, dryRun: true });
|
|
181
|
+
let planRecords = null;
|
|
182
|
+
if (o.projectRoot) {
|
|
183
|
+
const planRecordRetention = require('./scheduler/planRecordRetention.cjs');
|
|
184
|
+
const pr = planRecordRetention.prunePlanRecords({
|
|
185
|
+
projectRoot: o.projectRoot,
|
|
186
|
+
epicStatus: typeof o.epicStatus === 'function' ? o.epicStatus : planRecordRetention.defaultEpicStatus(o.projectRoot),
|
|
187
|
+
now,
|
|
188
|
+
days: s.planRecordsDays,
|
|
189
|
+
dryRun: true,
|
|
190
|
+
});
|
|
191
|
+
planRecords = { folders: pr.removed.length };
|
|
192
|
+
}
|
|
170
193
|
return {
|
|
171
194
|
runLogs: { files: report.eligible.reduce((n, e) => n + e.removeFiles.length, 0) + report.dodFiles.length, bytes: report.eligibleSummary.bytes },
|
|
172
195
|
runsArchive: { entries: archive.removedFiles, bytes: archive.freedBytes },
|
|
173
196
|
tmp: { files: tmp.removedFiles, bytes: tmp.freedBytes },
|
|
197
|
+
...(planRecords ? { planRecords } : {}),
|
|
174
198
|
};
|
|
175
199
|
}
|
|
176
200
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentAdminRoutes.cjs — read-only admin HTTP route over the persona library
|
|
3
|
+
* (agentLibrary.cjs's listPersonas), so an outside app on this machine can
|
|
4
|
+
* launch from the same roster with a pinned model instead of copying persona
|
|
5
|
+
* text into its own prompts.
|
|
6
|
+
*
|
|
7
|
+
* GET /admin/agents[?cwd=<abs>]
|
|
8
|
+
* → 200 { ok: true, agents } sorted by name. Each agent carries
|
|
9
|
+
* name, title, description, model, effort, tags, tools, executorOnly,
|
|
10
|
+
* agentCli, agentCliModel, seedVersion, path — never the persona body or
|
|
11
|
+
* the per-project override details.
|
|
12
|
+
* With cwd, each agent also has resolved: { modelId, modelAlias,
|
|
13
|
+
* modelSource, effort, effortSource } (effectiveModelInfo.cjs), or
|
|
14
|
+
* resolved: null when that persona's resolution throws. modelAlias is
|
|
15
|
+
* the effective alias: the persona's own, or the Settings default when
|
|
16
|
+
* the persona inherits.
|
|
17
|
+
*
|
|
18
|
+
* A query the schema rejects → 400 { ok: false, error: 'invalid query', details }.
|
|
19
|
+
* A cwd that is not absolute or has no session-manager-operations folder →
|
|
20
|
+
* 400 { ok: false, error: <reason> }.
|
|
21
|
+
*
|
|
22
|
+
* Writes no file and no audit row. Auth/loopback binding are the injected
|
|
23
|
+
* localAdminHttp.cjs transport's job (see index.cjs).
|
|
24
|
+
*/
|
|
25
|
+
'use strict';
|
|
26
|
+
|
|
27
|
+
const fs = require('node:fs');
|
|
28
|
+
const path = require('node:path');
|
|
29
|
+
const { schemas } = require('../../ipcSchemas.cjs');
|
|
30
|
+
const { sendJson } = require('../feedback-remote/localAdminHttp.cjs');
|
|
31
|
+
const { opsPath } = require('../opsOwnership.cjs');
|
|
32
|
+
|
|
33
|
+
/** @param {unknown} cwd @returns {string | null} the reason this cwd is not a project, or null. */
|
|
34
|
+
function projectProblem(cwd) {
|
|
35
|
+
if (typeof cwd !== 'string' || !path.isAbsolute(cwd)) return 'cwd must be an absolute path';
|
|
36
|
+
let dir;
|
|
37
|
+
try {
|
|
38
|
+
dir = opsPath(cwd);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
return e instanceof Error ? e.message : String(e);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
if (!fs.statSync(dir).isDirectory()) return 'cwd has no session-manager-operations folder';
|
|
44
|
+
} catch {
|
|
45
|
+
return 'cwd has no session-manager-operations folder';
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** @param {any} p the listPersonas row → the outside-facing fields only. */
|
|
51
|
+
function publicAgent(p) {
|
|
52
|
+
return {
|
|
53
|
+
name: p.name,
|
|
54
|
+
title: p.title ?? null,
|
|
55
|
+
description: p.description ?? null,
|
|
56
|
+
model: p.model ?? null,
|
|
57
|
+
effort: p.effort ?? null,
|
|
58
|
+
tags: Array.isArray(p.tags) ? p.tags : [],
|
|
59
|
+
tools: Array.isArray(p.tools) ? p.tools : [],
|
|
60
|
+
executorOnly: p.executorOnly === true,
|
|
61
|
+
agentCli: p.agentCli ?? null,
|
|
62
|
+
agentCliModel: p.agentCliModel ?? null,
|
|
63
|
+
seedVersion: p.seedVersion ?? null,
|
|
64
|
+
path: p.path ?? null,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @param {{ registerRoute: Function }} adminHttp
|
|
70
|
+
* @param {{ listPersonas?: () => Promise<any[]>, resolveEffectiveModelInfo?: (args: { cwd: string, agentType: string }) => Promise<any> }} [deps]
|
|
71
|
+
*/
|
|
72
|
+
function registerAdminRoute(adminHttp, deps = {}) {
|
|
73
|
+
// Lazy defaults: agentLibrary pulls in the sessions store + config manager.
|
|
74
|
+
const listPersonas = deps.listPersonas || (() => require('../../agentLibrary.cjs').listPersonas());
|
|
75
|
+
const resolveInfo = deps.resolveEffectiveModelInfo
|
|
76
|
+
|| ((/** @type {{ cwd: string, agentType: string }} */ args) => require('../claude/effectiveModelInfo.cjs').resolveEffectiveModelInfo(args));
|
|
77
|
+
|
|
78
|
+
adminHttp.registerRoute('GET', '/admin/agents', async (/** @type {any} */ req, /** @type {any} */ res, /** @type {any} */ query) => {
|
|
79
|
+
let input;
|
|
80
|
+
try {
|
|
81
|
+
input = schemas.adminListAgentsQuery.parse(Object.fromEntries(query ?? []));
|
|
82
|
+
} catch (e) {
|
|
83
|
+
sendJson(res, 400, { ok: false, error: 'invalid query', details: e?.issues ?? e?.message });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (input.cwd !== undefined) {
|
|
87
|
+
const problem = projectProblem(input.cwd);
|
|
88
|
+
if (problem) {
|
|
89
|
+
sendJson(res, 400, { ok: false, error: problem });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const personas = await listPersonas();
|
|
95
|
+
const agents = personas
|
|
96
|
+
.map(publicAgent)
|
|
97
|
+
.sort((a, b) => String(a.name).localeCompare(String(b.name)));
|
|
98
|
+
|
|
99
|
+
if (input.cwd !== undefined) {
|
|
100
|
+
const cwd = input.cwd;
|
|
101
|
+
await Promise.all(agents.map(async (/** @type {any} */ agent) => {
|
|
102
|
+
try {
|
|
103
|
+
const info = await resolveInfo({ cwd, agentType: agent.name });
|
|
104
|
+
agent.resolved = {
|
|
105
|
+
modelId: info?.resolvedModelId ?? null,
|
|
106
|
+
modelAlias: info?.modelAlias ?? null,
|
|
107
|
+
modelSource: info?.modelSource ?? null,
|
|
108
|
+
effort: info?.personaEffort ?? null,
|
|
109
|
+
effortSource: info?.personaEffortSource ?? null,
|
|
110
|
+
};
|
|
111
|
+
} catch {
|
|
112
|
+
agent.resolved = null;
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
sendJson(res, 200, { ok: true, agents });
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = { registerAdminRoute };
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* macro's persona under the scheduler's budget instead of a chat turn.
|
|
7
7
|
* Never mints an Epic (single-creator law): the caller supplies epicId.
|
|
8
8
|
* A press may carry a lower per-run effort, written as the PRD's `effort` frontmatter.
|
|
9
|
+
* A project's own Video tool (library macro, surface 'project-video', projects
|
|
10
|
+
* [cwd], with a job) dispatches the same way: artifact-only, or a committing PRD
|
|
11
|
+
* when job.repoPaths is set, with an optional review stage when job.review is set.
|
|
9
12
|
*
|
|
10
13
|
* Plain Node, no Electron imports; all I/O is injected.
|
|
11
14
|
*/
|
|
@@ -14,6 +17,7 @@ const path = require('node:path');
|
|
|
14
17
|
const { BUILTIN_MACROS } = require('./builtinMacros.cjs');
|
|
15
18
|
const { kebabCase } = require('../util/kebabCase.cjs');
|
|
16
19
|
const { PRD_EFFORT_LEVELS } = require('../prd/prdFrontmatter.cjs');
|
|
20
|
+
const { renderMacroPrompt } = require('./macroLibrary.cjs');
|
|
17
21
|
|
|
18
22
|
const ACTIVE = new Set(['pending', 'held', 'running']);
|
|
19
23
|
const RETRYABLE = new Set(['needs_review', 'failed']);
|
|
@@ -55,21 +59,67 @@ function rawEntryIdFor(kind, extra, t) {
|
|
|
55
59
|
return kebabCase(custom ? custom[1] : name, { maxLen: 40, fallback: 'overview' });
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
const VIDEO_INDEX_REL = 'session-manager-operations/project-pages/videos/{id}/index.html';
|
|
63
|
+
// Same string as video-review-store's REVIEW_MATERIAL_REL (asserted by the IPC wiring test).
|
|
64
|
+
const REVIEW_MATERIAL_REL = 'session-manager-operations/project-pages/videos/{id}/review/material.json';
|
|
65
|
+
|
|
66
|
+
const oneLine = (v) => String(v).replace(/[\r\n]+/g, ' ').trim();
|
|
67
|
+
|
|
68
|
+
// A caller can never forge a review decision: every 'Review:' line goes, and
|
|
69
|
+
// only the internal `review` param writes one back.
|
|
70
|
+
function stripReviewLines(extra) {
|
|
71
|
+
return extra.split(/\r?\n/).filter((l) => !/^\s*review:/i.test(l)).join('\n').trim();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function reviewLine(review) {
|
|
75
|
+
if (!review || typeof review !== 'object') return '';
|
|
76
|
+
if (review.decision === 'approved' && typeof review.at === 'string' && oneLine(review.at)) {
|
|
77
|
+
return `Review: approved by the owner at ${oneLine(review.at)}`;
|
|
78
|
+
}
|
|
79
|
+
if (review.decision === 'changes' && typeof review.note === 'string' && oneLine(review.note)) {
|
|
80
|
+
return `Review: changes requested: ${oneLine(review.note)}`;
|
|
81
|
+
}
|
|
82
|
+
return '';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// A project's own Video tool: only from the library, only on the Video surface,
|
|
86
|
+
// only for exactly this project, only with a job declaration.
|
|
87
|
+
function resolveProjectTool(macros, macroId, cwd) {
|
|
88
|
+
const m = (Array.isArray(macros) ? macros : []).find((x) => x && x.id === macroId);
|
|
89
|
+
if (!m || m.builtin || m.surface !== 'project-video' || !m.job || typeof m.job !== 'object') return null;
|
|
90
|
+
if (!Array.isArray(m.projects) || m.projects.length !== 1 || m.projects[0] !== cwd) return null;
|
|
91
|
+
return m;
|
|
92
|
+
}
|
|
93
|
+
|
|
58
94
|
async function dispatchMacroJob(
|
|
59
|
-
{ cwd, macroId, epicId, extraInstructions, effort } = {},
|
|
60
|
-
{ createPrd, listRows, archivePrd, builtins = BUILTIN_MACROS, now = Date.now } = {},
|
|
95
|
+
{ cwd, macroId, epicId, extraInstructions, effort, inputValues, review } = {},
|
|
96
|
+
{ createPrd, listRows, archivePrd, builtins = BUILTIN_MACROS, macros = [], now = Date.now } = {},
|
|
61
97
|
) {
|
|
62
|
-
const
|
|
98
|
+
const builtin = (builtins || []).find((m) => m && m.id === macroId);
|
|
99
|
+
const tool = builtin ? null : resolveProjectTool(macros, macroId, cwd);
|
|
100
|
+
const macro = builtin || tool;
|
|
63
101
|
if (!macro || !macro.job) return { ok: false, error: `macro ${macroId} has no background job declaration` };
|
|
64
102
|
if (typeof epicId !== 'string' || !epicId.trim()) return { ok: false, error: 'epicId is required — a background build joins an existing Epic' };
|
|
65
103
|
if (typeof cwd !== 'string' || !cwd) return { ok: false, error: 'cwd is required' };
|
|
66
104
|
if (typeof createPrd !== 'function') return { ok: false, error: 'createPrd is not available' };
|
|
67
105
|
|
|
106
|
+
let prompt = macro.prompt;
|
|
107
|
+
if (tool) {
|
|
108
|
+
const r = renderMacroPrompt(tool.prompt, tool.inputs, inputValues);
|
|
109
|
+
if (!r.ok) return { ok: false, error: r.error };
|
|
110
|
+
prompt = r.prompt;
|
|
111
|
+
}
|
|
112
|
+
|
|
68
113
|
const t = now();
|
|
69
|
-
const
|
|
70
|
-
const
|
|
114
|
+
const rLine = reviewLine(review);
|
|
115
|
+
const extra = [stripReviewLines(typeof extraInstructions === 'string' ? extraInstructions : ''), rLine].filter(Boolean).join('\n');
|
|
116
|
+
const entryKind = tool ? 'video' : macro.job.entryKind;
|
|
71
117
|
const entryId = entryKind ? entryIdFor(entryKind, extra, t) : null;
|
|
72
|
-
const
|
|
118
|
+
const stage = tool && tool.job.review ? (review && review.decision === 'approved' ? 'final' : 'review') : null;
|
|
119
|
+
const repoPaths = tool && Array.isArray(tool.job.repoPaths) && tool.job.repoPaths.length ? tool.job.repoPaths.slice() : null;
|
|
120
|
+
const artifactPaths = tool
|
|
121
|
+
? [(stage === 'review' ? REVIEW_MATERIAL_REL : VIDEO_INDEX_REL).split('{id}').join(entryId)]
|
|
122
|
+
: macro.job.artifactPaths.map((p) => (entryId ? p.split('{id}').join(entryId) : p));
|
|
73
123
|
const absPaths = artifactPaths.map((p) => path.join(cwd, p));
|
|
74
124
|
for (const s of [cwd, ...absPaths]) {
|
|
75
125
|
if (s.includes("'") || /[\r\n]/.test(s)) return { ok: false, error: "cwd or artifact path contains a character the gate cannot quote (single quote or newline)" };
|
|
@@ -93,33 +143,53 @@ async function dispatchMacroJob(
|
|
|
93
143
|
}
|
|
94
144
|
|
|
95
145
|
const slug = `${kebabCase(macro.label, { maxLen: 30, fallback: 'macro' })}-build-${t.toString(36)}${Math.random().toString(36).slice(2, 5)}`;
|
|
96
|
-
let goal = extra ? `${
|
|
146
|
+
let goal = extra ? `${prompt}\n\nAdditional instructions: ${extra}` : prompt;
|
|
97
147
|
if (entryId) goal += `\n\nEntry id: ${entryId}. Save with ${entryKind === 'video' ? 'videoId' : 'pageId'} = ${entryId}.`;
|
|
148
|
+
if (stage === 'review') {
|
|
149
|
+
goal += `\n\nReview stage: save the review material for entry ${entryId} with one project_video_review_write call (images and short text), then end; do not build or save the video in this run.`;
|
|
150
|
+
}
|
|
98
151
|
|
|
152
|
+
const saveTool = stage === 'review' ? 'the project_video_review_write tool' : 'the save tool your persona names';
|
|
99
153
|
const input = {
|
|
100
|
-
title: `${macro.label}: background build`,
|
|
154
|
+
title: `${macro.label}: ${stage === 'review' ? 'review material' : 'background build'}`,
|
|
101
155
|
slug,
|
|
102
156
|
cwd,
|
|
103
157
|
agentType: macro.agentName,
|
|
104
158
|
tag: macro.tag,
|
|
105
|
-
deliverable: 'artifact',
|
|
106
|
-
artifactPaths,
|
|
107
|
-
files: artifactPaths,
|
|
108
159
|
estimateMinutes: macro.job.estimateMinutes,
|
|
109
160
|
macroId,
|
|
110
161
|
sourcePromptId: epicId,
|
|
111
162
|
disposition: 'new-head',
|
|
112
163
|
goal,
|
|
113
|
-
acceptanceCriteria: [
|
|
114
|
-
`${artifactPaths[0]} is written during this run by the save tool your persona names, never by hand.`,
|
|
115
|
-
'Nothing in the repository is committed. No commit is the expected result: once the gate is green, end with SCHEDULER_VERDICT: PASS, never FAIL for the missing commit.',
|
|
116
|
-
],
|
|
117
|
-
implementationNotes:
|
|
118
|
-
`Work as the ${macro.agentName} persona (your system prompt) end to end. This build was started from Project Home and no one is watching: never stop to ask. `
|
|
119
|
-
+ 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd. '
|
|
120
|
-
+ 'This build is artifact-only (deliverable: artifact) and lands no commit by design: a green gate with no commit means SCHEDULER_VERDICT: PASS.',
|
|
121
164
|
gate: absPaths.map((p) => buildGate(p, t)),
|
|
122
165
|
};
|
|
166
|
+
if (repoPaths) {
|
|
167
|
+
Object.assign(input, {
|
|
168
|
+
files: repoPaths,
|
|
169
|
+
acceptanceCriteria: [
|
|
170
|
+
`${artifactPaths[0]} is written during this run by ${saveTool}, never by hand. That entry is saved by the save tool and is never committed.`,
|
|
171
|
+
`This run must commit its changes under ${repoPaths.join(', ')} (stage only those paths). With nothing to commit it fails like any PRD.`,
|
|
172
|
+
],
|
|
173
|
+
implementationNotes:
|
|
174
|
+
`Work as the ${macro.agentName} persona (your system prompt) end to end. This build was started from Project Home and no one is watching: never stop to ask. `
|
|
175
|
+
+ 'SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd. '
|
|
176
|
+
+ `This build lands a commit: change files only under ${repoPaths.join(', ')}, commit them, and never commit the saved entry.`,
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
Object.assign(input, {
|
|
180
|
+
deliverable: 'artifact',
|
|
181
|
+
artifactPaths,
|
|
182
|
+
files: artifactPaths,
|
|
183
|
+
acceptanceCriteria: [
|
|
184
|
+
`${artifactPaths[0]} is written during this run by ${saveTool}, never by hand.`,
|
|
185
|
+
'Nothing in the repository is committed. No commit is the expected result: once the gate is green, end with SCHEDULER_VERDICT: PASS, never FAIL for the missing commit.',
|
|
186
|
+
],
|
|
187
|
+
implementationNotes:
|
|
188
|
+
`Work as the ${macro.agentName} persona (your system prompt) end to end. This build was started from Project Home and no one is watching: never stop to ask. `
|
|
189
|
+
+ 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd. '
|
|
190
|
+
+ 'This build is artifact-only (deliverable: artifact) and lands no commit by design: a green gate with no commit means SCHEDULER_VERDICT: PASS.',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
123
193
|
if (typeof effort === 'string' && PRD_EFFORT_LEVELS.includes(effort)) input.effort = effort;
|
|
124
194
|
|
|
125
195
|
let res;
|
|
@@ -129,7 +199,7 @@ async function dispatchMacroJob(
|
|
|
129
199
|
return { ok: false, error: `createPrd failed: ${e?.message ?? e}` };
|
|
130
200
|
}
|
|
131
201
|
if (!res || res.ok === false) return { ok: false, error: res?.error || 'createPrd failed' };
|
|
132
|
-
return { ok: true, slug, epicId };
|
|
202
|
+
return { ok: true, slug, epicId, entryId, stage };
|
|
133
203
|
}
|
|
134
204
|
|
|
135
205
|
module.exports = { dispatchMacroJob };
|