@commonlyai/cli 0.1.57 → 0.1.58
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/commands/daemon.js +19 -6
package/package.json
CHANGED
package/src/commands/daemon.js
CHANGED
|
@@ -34,6 +34,24 @@ import {
|
|
|
34
34
|
import { daemonLogsDir, daemonSeatLogPath, readLogTail } from '../lib/daemon-logs.js';
|
|
35
35
|
import { loadDaemonState, saveDaemonState } from '../lib/daemon-state.js';
|
|
36
36
|
|
|
37
|
+
// One supervised seat, as `commonly daemon status --verbose` names it. Two of these
|
|
38
|
+
// fields are worth reading closely: the seat's `instanceId` (the identity the
|
|
39
|
+
// platform routes by, so a seat attached to the wrong instance is otherwise
|
|
40
|
+
// invisible) and the supervisor's `restarts` flap counter — which is written,
|
|
41
|
+
// persisted and served, and was shown by no surface at all, so a seat that had
|
|
42
|
+
// been crash-looping looked exactly like a healthy one (TASK-072, 2026-09-19).
|
|
43
|
+
//
|
|
44
|
+
// `restarts` distinguishes 0 from absent on purpose: a state file written by an
|
|
45
|
+
// older daemon has no such field, and printing 0 for it would claim a reading the
|
|
46
|
+
// file does not carry.
|
|
47
|
+
export const formatSeatLine = (seat = {}) => {
|
|
48
|
+
const model = seat.model || 'default model';
|
|
49
|
+
const effort = seat.effort ? `/${seat.effort}` : '';
|
|
50
|
+
const error = seat.lastError ? ` error=${seat.lastError}` : '';
|
|
51
|
+
const restarts = seat.restarts === undefined || seat.restarts === null ? '-' : seat.restarts;
|
|
52
|
+
return ` ${seat.agentName}: ${seat.state} instance=${seat.instanceId || '-'} adapter=${seat.adapter || 'unknown'} model=${model}${effort} pid=${seat.pid || '-'} restarts=${restarts} lastTurn=${seat.lastTurnAt || 'never'}${error}`;
|
|
53
|
+
};
|
|
54
|
+
|
|
37
55
|
const requireDaemonRecord = () => {
|
|
38
56
|
const record = loadDaemonRecord();
|
|
39
57
|
if (!record) {
|
|
@@ -397,12 +415,7 @@ Examples:
|
|
|
397
415
|
console.log('Local supervisor state: no supervised seats.');
|
|
398
416
|
} else {
|
|
399
417
|
console.log('Local supervised seats:');
|
|
400
|
-
for (const seat of local.seats)
|
|
401
|
-
const model = seat.model || 'default model';
|
|
402
|
-
const effort = seat.effort ? `/${seat.effort}` : '';
|
|
403
|
-
const error = seat.lastError ? ` error=${seat.lastError}` : '';
|
|
404
|
-
console.log(` ${seat.agentName}: ${seat.state} adapter=${seat.adapter || 'unknown'} model=${model}${effort} pid=${seat.pid || '-'} lastTurn=${seat.lastTurnAt || 'never'}${error}`);
|
|
405
|
-
}
|
|
418
|
+
for (const seat of local.seats) console.log(formatSeatLine(seat));
|
|
406
419
|
}
|
|
407
420
|
}
|
|
408
421
|
} catch (error) {
|