codex-supervisor-mcp 0.9.6 → 0.9.7
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/package.json +1 -1
- package/src/cleanup.js +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-supervisor-mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"mcpName": "io.github.zriyox/codex-supervisor-mcp",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP server that dispatches and supervises parallel Codex CLI workers, one isolated Git worktree each, with a persisted work state machine.",
|
package/src/cleanup.js
CHANGED
|
@@ -11,6 +11,7 @@ function parseArgs(argv) {
|
|
|
11
11
|
days: 14,
|
|
12
12
|
dryRun: true,
|
|
13
13
|
includeFailed: true,
|
|
14
|
+
keepRecords: false,
|
|
14
15
|
vacuum: false
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -25,6 +26,10 @@ function parseArgs(argv) {
|
|
|
25
26
|
options.dryRun = true;
|
|
26
27
|
} else if (arg === "--keep-failed") {
|
|
27
28
|
options.includeFailed = false;
|
|
29
|
+
} else if (arg === "--keep-records") {
|
|
30
|
+
// Remove the directory and the branch, keep the task row and its run log:
|
|
31
|
+
// the work is merged, but the ledger of what ran stays.
|
|
32
|
+
options.keepRecords = true;
|
|
28
33
|
} else if (arg === "--vacuum") {
|
|
29
34
|
options.vacuum = true;
|
|
30
35
|
} else if (arg === "--help" || arg === "-h") {
|
|
@@ -48,6 +53,7 @@ Options:
|
|
|
48
53
|
--apply Actually delete matching rows, JSONL logs, and worktrees.
|
|
49
54
|
--days <n> Keep tasks newer than n days. Default: 14.
|
|
50
55
|
--keep-failed Preserve failed/cancelled tasks even when older than --days.
|
|
56
|
+
--keep-records Remove the worktree and branch but keep the task row and run log.
|
|
51
57
|
--vacuum Vacuum SQLite after deleting rows.
|
|
52
58
|
-h, --help Show help.
|
|
53
59
|
`);
|
|
@@ -152,11 +158,13 @@ for (const task of candidates) {
|
|
|
152
158
|
}
|
|
153
159
|
deleted.worktrees += 1;
|
|
154
160
|
const logPath = task.run_log ?? join(runsDir, `${task.id}.jsonl`);
|
|
155
|
-
if (
|
|
156
|
-
|
|
161
|
+
if (!options.keepRecords) {
|
|
162
|
+
if (await safeDeleteFile(logPath, options.dryRun)) deleted.jsonl += 1;
|
|
163
|
+
removedIds.push(task.id);
|
|
164
|
+
}
|
|
157
165
|
}
|
|
158
166
|
|
|
159
|
-
if (!options.dryRun &&
|
|
167
|
+
if (!options.dryRun && !options.keepRecords && removedIds.length > 0) {
|
|
160
168
|
await deleteTasks(removedIds);
|
|
161
169
|
}
|
|
162
170
|
deleted.tasks = removedIds.length;
|
|
@@ -168,6 +176,7 @@ if (!options.dryRun && options.vacuum) {
|
|
|
168
176
|
console.log(JSON.stringify({
|
|
169
177
|
dry_run: options.dryRun,
|
|
170
178
|
keep_days: options.days,
|
|
179
|
+
records_kept: options.keepRecords,
|
|
171
180
|
cutoff: new Date(cutoffMs).toISOString(),
|
|
172
181
|
candidates: taskIds,
|
|
173
182
|
skipped,
|