@magnusekdahl/parallix 1.2.0 → 1.3.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/index.js +190 -185
- package/lib/agents/agents.js +737 -838
- package/lib/agents/agents.ts +930 -0
- package/lib/agents/claude-telemetry.js +149 -154
- package/lib/agents/claude-telemetry.ts +233 -0
- package/lib/agents/claude.js +121 -131
- package/lib/agents/claude.ts +156 -0
- package/lib/agents/codex-telemetry.js +176 -164
- package/lib/agents/codex-telemetry.ts +205 -0
- package/lib/agents/codex.js +168 -201
- package/lib/agents/codex.ts +236 -0
- package/lib/agents/limit-hit.js +216 -226
- package/lib/agents/limit-hit.ts +262 -0
- package/lib/agents/mistral-telemetry.js +7 -10
- package/lib/agents/mistral-telemetry.ts +44 -0
- package/lib/agents/mistral.js +40 -58
- package/lib/agents/mistral.ts +84 -0
- package/lib/agents/opencode-export.js +126 -127
- package/lib/agents/opencode-export.ts +160 -0
- package/lib/agents/opencode-telemetry.js +282 -261
- package/lib/agents/opencode-telemetry.ts +350 -0
- package/lib/agents/opencode.js +263 -305
- package/lib/agents/opencode.ts +370 -0
- package/lib/agents/stage-telemetry.js +23 -24
- package/lib/agents/stage-telemetry.ts +47 -0
- package/lib/commands/active.js +502 -579
- package/lib/commands/active.ts +665 -0
- package/lib/commands/checkpoint.js +98 -74
- package/lib/commands/checkpoint.ts +79 -0
- package/lib/commands/config.js +61 -31
- package/lib/commands/config.ts +47 -0
- package/lib/commands/coverage-gate.js +271 -246
- package/lib/commands/coverage-gate.ts +362 -0
- package/lib/commands/diff.js +140 -119
- package/lib/commands/diff.ts +125 -0
- package/lib/commands/draft.js +770 -923
- package/lib/commands/draft.ts +1021 -0
- package/lib/commands/handoff.js +588 -608
- package/lib/commands/handoff.ts +694 -0
- package/lib/commands/integrate.js +1332 -1463
- package/lib/commands/integrate.ts +1688 -0
- package/lib/commands/mission-start.js +279 -237
- package/lib/commands/mission-start.ts +263 -0
- package/lib/commands/rebase.js +606 -582
- package/lib/commands/rebase.ts +635 -0
- package/lib/commands/repair-handoff.js +181 -179
- package/lib/commands/repair-handoff.ts +228 -0
- package/lib/commands/resolve-conflict.js +121 -102
- package/lib/commands/resolve-conflict.ts +112 -0
- package/lib/commands/review.js +3 -4
- package/lib/commands/review.ts +14 -0
- package/lib/commands/setup-review.js +4 -5
- package/lib/commands/setup-review.ts +14 -0
- package/lib/commands/setup.js +3 -3
- package/lib/commands/setup.ts +2 -0
- package/lib/commands/stats-backfill.js +394 -359
- package/lib/commands/stats-backfill.ts +418 -0
- package/lib/commands/stats.js +1424 -1665
- package/lib/commands/stats.ts +2186 -0
- package/lib/commands/status.js +219 -200
- package/lib/commands/status.ts +219 -0
- package/lib/commands/verify.js +3 -1
- package/lib/commands/verify.ts +2 -0
- package/lib/core/fmt.js +140 -211
- package/lib/core/fmt.ts +189 -0
- package/lib/core/git.js +121 -102
- package/lib/core/git.ts +146 -0
- package/lib/core/gitignore.js +59 -106
- package/lib/core/gitignore.ts +103 -0
- package/lib/core/mission-utils.js +833 -875
- package/lib/core/mission-utils.ts +998 -0
- package/lib/core/nels.js +112 -127
- package/lib/core/nels.ts +189 -0
- package/lib/core/persistent-data-migration.js +247 -205
- package/lib/core/persistent-data-migration.ts +255 -0
- package/lib/core/product-config.js +400 -476
- package/lib/core/product-config.ts +518 -0
- package/lib/core/runtime-matrix.js +41 -87
- package/lib/core/runtime-matrix.ts +84 -0
- package/lib/core/spawn-tee.js +152 -192
- package/lib/core/spawn-tee.ts +202 -0
- package/lib/core/state-map.js +92 -92
- package/lib/core/state-map.ts +115 -0
- package/lib/core/storage.js +101 -129
- package/lib/core/storage.ts +182 -0
- package/lib/core/subagent-limit.js +15 -16
- package/lib/core/subagent-limit.ts +25 -0
- package/lib/core/verification.js +148 -138
- package/lib/core/verification.ts +200 -0
- package/lib/index.js +142 -59
- package/lib/index.ts +134 -0
- package/lib/review/rebase.js +142 -145
- package/lib/review/rebase.ts +188 -0
- package/lib/review/review-adapter.js +99 -87
- package/lib/review/review-adapter.ts +198 -0
- package/lib/review/review-artifacts.js +486 -629
- package/lib/review/review-artifacts.ts +622 -0
- package/lib/review/review-commands.js +1220 -1373
- package/lib/review/review-commands.ts +1579 -0
- package/lib/review/review-events.js +544 -886
- package/lib/review/review-events.ts +954 -0
- package/lib/review/review-loop.js +945 -1020
- package/lib/review/review-loop.ts +1174 -0
- package/lib/review/review-polling.js +86 -115
- package/lib/review/review-polling.ts +194 -0
- package/lib/review/review-prompts.js +154 -189
- package/lib/review/review-prompts.ts +182 -0
- package/lib/review/review-state.js +246 -225
- package/lib/review/review-state.ts +353 -0
- package/lib/review/review.js +63 -84
- package/lib/review/review.ts +138 -0
- package/lib/tools/backlog.js +694 -680
- package/lib/tools/backlog.ts +835 -0
- package/lib/tools/forgejo.js +1270 -1405
- package/lib/tools/forgejo.ts +1793 -0
- package/lib/tools/gatekeeper.js +106 -96
- package/lib/tools/gatekeeper.ts +124 -0
- package/lib/tools/redgreen.js +200 -181
- package/lib/tools/redgreen.ts +221 -0
- package/lib/tools/sessions.js +58 -52
- package/lib/tools/sessions.ts +81 -0
- package/lib/tools/setup-review.js +902 -975
- package/lib/tools/setup-review.ts +1152 -0
- package/package.json +7 -5
- package/prompts/draft.md +1 -0
- package/prompts/portfolio.md +1 -1
- package/px.js +226 -210
package/lib/commands/status.js
CHANGED
|
@@ -1,220 +1,239 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
const git_js_1 = require("../core/git.js");
|
|
36
|
+
const backlog_js_1 = require("../tools/backlog.js");
|
|
37
|
+
const mission_utils_js_1 = require("../core/mission-utils.js");
|
|
38
|
+
const agents_js_1 = require("../agents/agents.js");
|
|
39
|
+
const forgejo_js_1 = require("../tools/forgejo.js");
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const fmt = __importStar(require("../core/fmt.js"));
|
|
9
42
|
/** @param {string} porcelain */
|
|
10
43
|
function parseWorktreeList(porcelain) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
const entries = [];
|
|
45
|
+
/** @type{{path: string, branch: string | null} | null} */
|
|
46
|
+
let current = null;
|
|
47
|
+
for (const line of porcelain.split('\n')) {
|
|
48
|
+
if (!line.trim()) {
|
|
49
|
+
if (current) {
|
|
50
|
+
entries.push(current);
|
|
51
|
+
current = null;
|
|
52
|
+
}
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (line.startsWith('worktree ')) {
|
|
56
|
+
if (current) {
|
|
57
|
+
entries.push(current);
|
|
58
|
+
}
|
|
59
|
+
current = { path: line.slice('worktree '.length).trim(), branch: null };
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (line.startsWith('branch ') && current) {
|
|
63
|
+
current.branch = line.slice('branch '.length).trim();
|
|
64
|
+
}
|
|
28
65
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
current.branch = line.slice('branch '.length).trim();
|
|
66
|
+
if (current) {
|
|
67
|
+
entries.push(current);
|
|
32
68
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (current) {entries.push(current);}
|
|
36
|
-
return entries;
|
|
69
|
+
return entries;
|
|
37
70
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!resolvedPrimary) {
|
|
53
|
-
try {
|
|
54
|
-
const { getPrimaryWorktree } = require('../core/mission-utils');
|
|
55
|
-
resolvedPrimary = getPrimaryWorktree();
|
|
56
|
-
} catch (_) {
|
|
57
|
-
resolvedPrimary = null;
|
|
71
|
+
function findStaleMissionWorktrees({ gitRun = git_js_1.run, findTaskFileFn = backlog_js_1.findTaskFile, getTaskStatusFn = backlog_js_1.getTaskStatus, primaryWorktree = null } = {}) {
|
|
72
|
+
const result = gitRun('git', ['worktree', 'list', '--porcelain']);
|
|
73
|
+
if (result.status !== 0) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
/** @type {string | null} */
|
|
77
|
+
let resolvedPrimary = primaryWorktree;
|
|
78
|
+
if (!resolvedPrimary) {
|
|
79
|
+
try {
|
|
80
|
+
resolvedPrimary = (0, mission_utils_js_1.getPrimaryWorktree)();
|
|
81
|
+
}
|
|
82
|
+
catch (_) {
|
|
83
|
+
resolvedPrimary = null;
|
|
84
|
+
}
|
|
58
85
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
: `git worktree remove ${entry.path} && git branch -D ${missionBranchName(slug, resolvedPrimary || process.cwd())}`
|
|
87
|
-
};
|
|
86
|
+
return parseWorktreeList(result.stdout)
|
|
87
|
+
.filter(entry => entry.path !== resolvedPrimary)
|
|
88
|
+
.map(entry => {
|
|
89
|
+
const branchRef = entry.branch || '';
|
|
90
|
+
const prefix = (0, mission_utils_js_1.missionBranchPrefix)(resolvedPrimary || process.cwd());
|
|
91
|
+
const normalizedRefPrefix = `refs/heads/${prefix}`;
|
|
92
|
+
const match = branchRef.startsWith(normalizedRefPrefix)
|
|
93
|
+
? [branchRef, branchRef.slice(normalizedRefPrefix.length)]
|
|
94
|
+
: null;
|
|
95
|
+
if (!match) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const slug = match[1];
|
|
99
|
+
const taskFile = findTaskFileFn(slug);
|
|
100
|
+
const taskStatus = taskFile ? getTaskStatusFn(taskFile) : null;
|
|
101
|
+
if (taskStatus !== 'done' && taskFile) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
slug,
|
|
106
|
+
path: entry.path,
|
|
107
|
+
branch: branchRef,
|
|
108
|
+
taskStatus: taskStatus || 'missing',
|
|
109
|
+
cleanupCommand: taskStatus === 'done'
|
|
110
|
+
? `scripts/cleanup-mission-worktree.sh ${slug}`
|
|
111
|
+
: `git worktree remove ${entry.path} && git branch -D ${(0, mission_utils_js_1.missionBranchName)(slug, resolvedPrimary || process.cwd())}`
|
|
112
|
+
};
|
|
88
113
|
})
|
|
89
|
-
|
|
114
|
+
.filter(Boolean);
|
|
90
115
|
}
|
|
91
|
-
|
|
92
116
|
/** @param {string} ref */
|
|
93
117
|
function formatWorktreeBranch(ref) {
|
|
94
|
-
|
|
95
|
-
|
|
118
|
+
if (!ref) {
|
|
119
|
+
return '(detached HEAD)';
|
|
120
|
+
}
|
|
121
|
+
return ref.replace(/^refs\/heads\//, '');
|
|
96
122
|
}
|
|
97
|
-
|
|
98
123
|
/** @param {Function} log @param {string} label @param {{detached?: boolean, unmergedFiles: string[]}} rebaseState */
|
|
99
124
|
function logRebaseDiagnostics(log, label, rebaseState) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
const detachedText = rebaseState.detached ? 'detached HEAD, ' : '';
|
|
126
|
+
log(`${label}: ${detachedText}${rebaseState.unmergedFiles.length} unmerged file(s)`);
|
|
127
|
+
rebaseState.unmergedFiles.forEach(file => {
|
|
128
|
+
log(` - ${file}`);
|
|
129
|
+
});
|
|
105
130
|
}
|
|
106
|
-
|
|
107
131
|
/** @param {string[]} args @param {{exit?: Function, log?: Function, inferSlugFn?: Function, getCurrentBranchFn?: Function, findTaskFileFn?: Function, getTaskStatusFn?: Function, findMissionDirFn?: Function, findCheckpointsFn?: Function, getFirstLineFn?: Function, getPrStatusFn?: Function, findStaleMissionWorktreesFn?: Function, readAgentConfigOrExitFn?: Function, eligibleAgentsForStepFn?: Function, allWorkflowAgentNamesFn?: Function, workflowLauncherStatusFn?: Function, getLastThreeCommitsFn?: Function, getUncommittedCountFn?: Function, detectRebaseStateFn?: Function}} opts */
|
|
108
|
-
function status(args, opts
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (rebaseState.inProgress && rebaseState.detached) {
|
|
138
|
-
logRebaseDiagnostics(log, 'Detached HEAD: rebase in progress', rebaseState);
|
|
139
|
-
}
|
|
140
|
-
} catch (_) {
|
|
141
|
-
// Ignore transient worktree/git-state failures in status output.
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (slug) {
|
|
145
|
-
const taskFile = findTaskFileFn(slug);
|
|
146
|
-
const taskStatus = getTaskStatusFn(taskFile);
|
|
147
|
-
log(`Backlog status: ${taskStatus || 'unknown'}`);
|
|
148
|
-
|
|
149
|
-
const missionDir = findMissionDirFn(slug);
|
|
150
|
-
if (missionDir) {
|
|
151
|
-
const checkpoints = findCheckpointsFn(missionDir);
|
|
152
|
-
if (checkpoints.length > 0) {
|
|
153
|
-
const lastCP = checkpoints[checkpoints.length - 1];
|
|
154
|
-
const firstLine = getFirstLineFn(lastCP);
|
|
155
|
-
log(`Last checkpoint: ${path.basename(lastCP)} - ${firstLine}`);
|
|
156
|
-
} else {
|
|
157
|
-
log('Last checkpoint: none');
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
log('Last checkpoint: unknown');
|
|
132
|
+
function status(args, opts) {
|
|
133
|
+
const exit = opts.exit || process.exit;
|
|
134
|
+
const log = opts.log || fmt.log.plain;
|
|
135
|
+
const inferSlugFn = opts.inferSlugFn || mission_utils_js_1.inferSlug;
|
|
136
|
+
const getCurrentBranchFn = opts.getCurrentBranchFn || git_js_1.getCurrentBranch;
|
|
137
|
+
const findTaskFileFn = opts.findTaskFileFn || backlog_js_1.findTaskFile;
|
|
138
|
+
const getTaskStatusFn = opts.getTaskStatusFn || backlog_js_1.getTaskStatus;
|
|
139
|
+
const findMissionDirFn = opts.findMissionDirFn || mission_utils_js_1.findMissionDir;
|
|
140
|
+
const findCheckpointsFn = opts.findCheckpointsFn || mission_utils_js_1.findCheckpoints;
|
|
141
|
+
const getFirstLineFn = opts.getFirstLineFn || mission_utils_js_1.getFirstLine;
|
|
142
|
+
const getPrStatusFn = opts.getPrStatusFn || forgejo_js_1.getPrStatus;
|
|
143
|
+
const findStaleMissionWorktreesFn = opts.findStaleMissionWorktreesFn || findStaleMissionWorktrees;
|
|
144
|
+
const readAgentConfigOrExitFn = opts.readAgentConfigOrExitFn || agents_js_1.readAgentConfigOrExit;
|
|
145
|
+
const eligibleAgentsForStepFn = opts.eligibleAgentsForStepFn || agents_js_1.eligibleAgentsForStep;
|
|
146
|
+
const allWorkflowAgentNamesFn = opts.allWorkflowAgentNamesFn || (() => agents_js_1.WORKFLOW_AGENT_NAMES);
|
|
147
|
+
const workflowLauncherStatusFn = opts.workflowLauncherStatusFn || agents_js_1.workflowLauncherStatus;
|
|
148
|
+
const getLastThreeCommitsFn = opts.getLastThreeCommitsFn || git_js_1.getLastThreeCommits;
|
|
149
|
+
const getUncommittedCountFn = opts.getUncommittedCountFn || git_js_1.getUncommittedCount;
|
|
150
|
+
const detectRebaseStateFn = opts.detectRebaseStateFn || git_js_1.detectRebaseState;
|
|
151
|
+
const explicitSlug = args[0];
|
|
152
|
+
const slug = inferSlugFn(explicitSlug);
|
|
153
|
+
log(fmt.bold('--- Mission Status ---'));
|
|
154
|
+
log(`Branch: ${fmt.branch(getCurrentBranchFn())}`);
|
|
155
|
+
log(`Worktree: ${fmt.path(process.cwd())}`);
|
|
156
|
+
try {
|
|
157
|
+
const rebaseState = detectRebaseStateFn(process.cwd());
|
|
158
|
+
if (rebaseState.inProgress && rebaseState.detached) {
|
|
159
|
+
logRebaseDiagnostics(log, 'Detached HEAD: rebase in progress', rebaseState);
|
|
160
|
+
}
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const pr = getPrStatusFn(missionBranchName(slug));
|
|
165
|
-
if (pr.exists) {
|
|
166
|
-
log(`Forgejo PR: #${pr.number} (${pr.state})`);
|
|
167
|
-
} else if (pr.raw) {
|
|
168
|
-
log(`Forgejo PR: unavailable (${pr.raw})`);
|
|
169
|
-
} else {
|
|
170
|
-
log('Forgejo PR: none');
|
|
162
|
+
catch (_) {
|
|
163
|
+
// Ignore transient worktree/git-state failures in status output.
|
|
171
164
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
165
|
+
if (slug) {
|
|
166
|
+
const taskFile = findTaskFileFn(slug);
|
|
167
|
+
const taskStatus = getTaskStatusFn(taskFile);
|
|
168
|
+
log(`Backlog status: ${taskStatus || 'unknown'}`);
|
|
169
|
+
const missionDir = findMissionDirFn(slug);
|
|
170
|
+
if (missionDir) {
|
|
171
|
+
const checkpoints = findCheckpointsFn(missionDir);
|
|
172
|
+
if (checkpoints.length > 0) {
|
|
173
|
+
const lastCP = checkpoints[checkpoints.length - 1];
|
|
174
|
+
const firstLine = getFirstLineFn(lastCP);
|
|
175
|
+
log(`Last checkpoint: ${path.basename(lastCP)} - ${firstLine}`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
log('Last checkpoint: none');
|
|
179
|
+
}
|
|
182
180
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
181
|
+
else {
|
|
182
|
+
log('Last checkpoint: unknown');
|
|
183
|
+
}
|
|
184
|
+
// Forgejo PR state
|
|
185
|
+
const pr = getPrStatusFn((0, mission_utils_js_1.missionBranchName)(slug));
|
|
186
|
+
if (pr.exists) {
|
|
187
|
+
log(`Forgejo PR: #${pr.number} (${pr.state})`);
|
|
188
|
+
}
|
|
189
|
+
else if (pr.raw) {
|
|
190
|
+
log(`Forgejo PR: unavailable (${pr.raw})`);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
log('Forgejo PR: none');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (!explicitSlug) {
|
|
197
|
+
const staleWorktrees = findStaleMissionWorktreesFn();
|
|
198
|
+
staleWorktrees.forEach((entry) => {
|
|
199
|
+
log(`Stale worktree: ${fmt.path(entry.path)} (task: ${entry.taskStatus})`);
|
|
200
|
+
try {
|
|
201
|
+
const rebaseState = detectRebaseStateFn(entry.path);
|
|
202
|
+
if (rebaseState.inProgress) {
|
|
203
|
+
logRebaseDiagnostics(log, `Rebase in progress on ${formatWorktreeBranch(entry.branch || '')}`, rebaseState);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (_) {
|
|
207
|
+
// Ignore stale worktrees that disappear during inspection.
|
|
208
|
+
}
|
|
209
|
+
log(` Cleanup: ${fmt.command(entry.cleanupCommand || '')}`);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
// Agent eligibility matrix
|
|
213
|
+
const config = readAgentConfigOrExitFn();
|
|
214
|
+
const draftEligible = eligibleAgentsForStepFn('draft', { config });
|
|
215
|
+
const activeEligible = eligibleAgentsForStepFn('active', { config });
|
|
216
|
+
const baseAgents = allWorkflowAgentNamesFn();
|
|
217
|
+
const allAgents = [...new Set([...baseAgents, ...draftEligible, ...activeEligible])].sort();
|
|
218
|
+
const envOverride = process.env.WORKFLOW_AGENT;
|
|
219
|
+
log('Agent launcher matrix:');
|
|
220
|
+
for (const agent of allAgents) {
|
|
221
|
+
const launcher = workflowLauncherStatusFn(agent);
|
|
222
|
+
const support = launcher.supported ? 'supported' : 'blocked';
|
|
223
|
+
const draftMark = draftEligible.includes(agent) ? 'draft' : '-';
|
|
224
|
+
const activeMark = activeEligible.includes(agent) ? 'active' : '-';
|
|
225
|
+
log(` ${fmt.agent(agent)}: ${support} | eligible: ${draftMark},${activeMark}`);
|
|
226
|
+
}
|
|
227
|
+
if (envOverride) {
|
|
228
|
+
log(` (WORKFLOW_AGENT override: ${fmt.agent(envOverride)})`);
|
|
229
|
+
}
|
|
230
|
+
const lastThree = getLastThreeCommitsFn();
|
|
231
|
+
log('Last 3 commits:');
|
|
232
|
+
lastThree.forEach((c) => log(` - ${c}`));
|
|
233
|
+
log(`Uncommitted files: ${getUncommittedCountFn()}`);
|
|
234
|
+
log(fmt.bold('----------------------'));
|
|
235
|
+
exit(0);
|
|
216
236
|
}
|
|
217
|
-
|
|
237
|
+
status.parseWorktreeList = parseWorktreeList;
|
|
238
|
+
status.findStaleMissionWorktrees = findStaleMissionWorktrees;
|
|
218
239
|
module.exports = status;
|
|
219
|
-
module.exports.parseWorktreeList = parseWorktreeList;
|
|
220
|
-
module.exports.findStaleMissionWorktrees = findStaleMissionWorktrees;
|