agentxchain 2.70.0 → 2.71.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/package.json
CHANGED
package/src/commands/multi.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* multi resync — detect divergence and rebuild coordinator state from repo authority
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import chalk from 'chalk';
|
|
13
14
|
import { loadCoordinatorConfig } from '../lib/coordinator-config.js';
|
|
14
15
|
import {
|
|
15
16
|
initializeCoordinatorRun,
|
|
@@ -105,11 +106,44 @@ export async function multiStatusCommand(options) {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
console.log(`Super Run: ${status.super_run_id}`);
|
|
108
|
-
console.log(`Status: ${status.status}`);
|
|
109
|
+
console.log(`Status: ${formatCoordinatorStatus(status.status)}`);
|
|
109
110
|
console.log(`Phase: ${status.phase}`);
|
|
110
111
|
|
|
112
|
+
// Elapsed time for active runs
|
|
113
|
+
if (status.created_at && status.status === 'active') {
|
|
114
|
+
const elapsedMs = Date.now() - new Date(status.created_at).getTime();
|
|
115
|
+
if (elapsedMs >= 0) {
|
|
116
|
+
const secs = Math.floor(elapsedMs / 1000);
|
|
117
|
+
const mins = Math.floor(secs / 60);
|
|
118
|
+
const remainSecs = secs % 60;
|
|
119
|
+
const elapsed = mins > 0 ? `${mins}m ${remainSecs}s` : `${remainSecs}s`;
|
|
120
|
+
console.log(`Elapsed: ${elapsed}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Blocked state with reason
|
|
125
|
+
if (status.status === 'blocked') {
|
|
126
|
+
const reason = (typeof status.blocked_reason === 'string' && status.blocked_reason.trim())
|
|
127
|
+
? status.blocked_reason.trim()
|
|
128
|
+
: 'unknown reason';
|
|
129
|
+
console.log(`Blocked: ${chalk.red.bold('BLOCKED')} — ${reason}`);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Pending gate with phase transition direction
|
|
111
133
|
if (status.pending_gate) {
|
|
112
|
-
|
|
134
|
+
const pg = status.pending_gate;
|
|
135
|
+
const fromTo = pg.from && pg.to ? ` ${pg.from} → ${pg.to}` : '';
|
|
136
|
+
console.log(`Pending Gate: ${pg.gate} (${pg.gate_type})${fromTo}`);
|
|
137
|
+
console.log(`Action: Run ${chalk.cyan('agentxchain multi approve-gate')} to advance`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Completed state
|
|
141
|
+
if (status.status === 'completed') {
|
|
142
|
+
console.log('');
|
|
143
|
+
console.log(` ${chalk.green.bold('✓ Coordinator run completed')}`);
|
|
144
|
+
if (status.updated_at) {
|
|
145
|
+
console.log(` ${chalk.dim('Completed:')} ${status.updated_at}`);
|
|
146
|
+
}
|
|
113
147
|
}
|
|
114
148
|
|
|
115
149
|
console.log('');
|
|
@@ -119,6 +153,17 @@ export async function multiStatusCommand(options) {
|
|
|
119
153
|
console.log(` ${repoId}: ${info.status || 'unknown'}${phase} (run: ${info.run_id})`);
|
|
120
154
|
}
|
|
121
155
|
|
|
156
|
+
// Phase gate status
|
|
157
|
+
const gateEntries = Object.entries(status.phase_gate_status || {});
|
|
158
|
+
if (gateEntries.length > 0) {
|
|
159
|
+
console.log('');
|
|
160
|
+
console.log('Gates:');
|
|
161
|
+
for (const [gate, gateStatus] of gateEntries) {
|
|
162
|
+
const icon = gateStatus === 'passed' ? chalk.green('✓') : chalk.dim('○');
|
|
163
|
+
console.log(` ${icon} ${gate}: ${gateStatus}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
122
167
|
const barrierEntries = Object.entries(barriers || {});
|
|
123
168
|
if (barrierEntries.length > 0) {
|
|
124
169
|
console.log('');
|
|
@@ -129,6 +174,15 @@ export async function multiStatusCommand(options) {
|
|
|
129
174
|
}
|
|
130
175
|
}
|
|
131
176
|
|
|
177
|
+
function formatCoordinatorStatus(status) {
|
|
178
|
+
switch (status) {
|
|
179
|
+
case 'active': return chalk.green(status);
|
|
180
|
+
case 'blocked': return chalk.red.bold(status);
|
|
181
|
+
case 'completed': return chalk.cyan(status);
|
|
182
|
+
default: return status;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
132
186
|
// ── multi step ─────────────────────────────────────────────────────────────
|
|
133
187
|
|
|
134
188
|
export async function multiStepCommand(options) {
|
|
@@ -401,6 +401,10 @@ export function getCoordinatorStatus(workspacePath) {
|
|
|
401
401
|
repo_runs: state.repo_runs,
|
|
402
402
|
pending_barriers: pendingBarriers,
|
|
403
403
|
pending_gate: state.pending_gate ?? null,
|
|
404
|
+
blocked_reason: state.blocked_reason ?? null,
|
|
405
|
+
created_at: state.created_at ?? null,
|
|
406
|
+
updated_at: state.updated_at ?? null,
|
|
407
|
+
phase_gate_status: state.phase_gate_status ?? null,
|
|
404
408
|
};
|
|
405
409
|
}
|
|
406
410
|
|