@great-arrow/cli 0.7.1 → 0.7.3
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/dist/index.js +35 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9483,7 +9483,7 @@ function isNodeError(value) {
|
|
|
9483
9483
|
|
|
9484
9484
|
// src/lib/version.ts
|
|
9485
9485
|
var CLI_PACKAGE_NAME = "@great-arrow/cli";
|
|
9486
|
-
var CLI_VERSION = "0.7.
|
|
9486
|
+
var CLI_VERSION = "0.7.3";
|
|
9487
9487
|
var GAD_INSTALL_VERSION = "2026.08.08";
|
|
9488
9488
|
var GAD_INSTALL_MIN_VERSION = "2026.06.22";
|
|
9489
9489
|
var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
|
|
@@ -10455,7 +10455,7 @@ var Formatter = class {
|
|
|
10455
10455
|
}
|
|
10456
10456
|
if (this.options.quiet) {
|
|
10457
10457
|
const lines = data.map(
|
|
10458
|
-
(row) => columns.map((col) => this.
|
|
10458
|
+
(row) => columns.map((col) => this.tableCell(row, col)).join(" ")
|
|
10459
10459
|
);
|
|
10460
10460
|
const output3 = lines.join("\n");
|
|
10461
10461
|
this.writeStdout(output3);
|
|
@@ -10465,7 +10465,7 @@ var Formatter = class {
|
|
|
10465
10465
|
if (col.width) return col.width;
|
|
10466
10466
|
const headerLen = col.header.length;
|
|
10467
10467
|
const maxDataLen = data.reduce((max, row) => {
|
|
10468
|
-
const val = this.
|
|
10468
|
+
const val = this.tableCell(row, col);
|
|
10469
10469
|
return Math.max(max, val.length);
|
|
10470
10470
|
}, 0);
|
|
10471
10471
|
return Math.max(headerLen, maxDataLen);
|
|
@@ -10473,12 +10473,21 @@ var Formatter = class {
|
|
|
10473
10473
|
const headerRow = columns.map((col, i) => this.color.bold(col.header.padEnd(widths[i]))).join(" ");
|
|
10474
10474
|
const separator = widths.map((w) => "\u2500".repeat(w)).join("\u2500\u2500");
|
|
10475
10475
|
const rows = data.map(
|
|
10476
|
-
(row) => columns.map((col, i) => this.
|
|
10476
|
+
(row) => columns.map((col, i) => this.tableCell(row, col).padEnd(widths[i])).join(" ")
|
|
10477
10477
|
);
|
|
10478
10478
|
const output2 = [headerRow, separator, ...rows].join("\n");
|
|
10479
10479
|
this.writeStdout(output2);
|
|
10480
10480
|
return output2;
|
|
10481
10481
|
}
|
|
10482
|
+
/**
|
|
10483
|
+
* One table cell: always a single line (a newline in a value would split the
|
|
10484
|
+
* row and shift every column after it), cut to the column's declared width.
|
|
10485
|
+
* Columns without a width (links, ids) are never cut.
|
|
10486
|
+
*/
|
|
10487
|
+
tableCell(row, col) {
|
|
10488
|
+
const flat = this.getCellValue(row, col).replace(/[\r\n\t\v\f]+/g, " ");
|
|
10489
|
+
return col.width && flat.length > col.width ? `${flat.slice(0, col.width - 1)}\u2026` : flat;
|
|
10490
|
+
}
|
|
10482
10491
|
/**
|
|
10483
10492
|
* Render key-value pairs for a single object.
|
|
10484
10493
|
*
|
|
@@ -18118,6 +18127,10 @@ function itemLine(item) {
|
|
|
18118
18127
|
const detail = item.detail ? stripControlChars(String(item.detail)) : "";
|
|
18119
18128
|
return detail ? ` ${who} \u2014 ${detail}` : ` ${who}`;
|
|
18120
18129
|
}
|
|
18130
|
+
function liveLines(live) {
|
|
18131
|
+
if (!live) return [];
|
|
18132
|
+
return [live.activity?.line, live.spend?.line].filter((l) => typeof l === "string" && l.length > 0).map((l) => ` ${stripControlChars(l)}`);
|
|
18133
|
+
}
|
|
18121
18134
|
function count(n) {
|
|
18122
18135
|
return typeof n === "number" && Number.isFinite(n) ? n : 0;
|
|
18123
18136
|
}
|
|
@@ -18126,14 +18139,30 @@ function renderAgentsNow(payload) {
|
|
|
18126
18139
|
const groups = (Array.isArray(safe.working) ? safe.working : []).filter(
|
|
18127
18140
|
(g) => g && Array.isArray(g.items) && g.items.length > 0
|
|
18128
18141
|
);
|
|
18142
|
+
const sessions = (Array.isArray(safe.sessions) ? safe.sessions : []).filter(
|
|
18143
|
+
(s2) => s2 && typeof s2.name === "string"
|
|
18144
|
+
);
|
|
18145
|
+
const byId = new Map(
|
|
18146
|
+
(Array.isArray(safe.agents) ? safe.agents : []).map((a) => [a?.id, a])
|
|
18147
|
+
);
|
|
18129
18148
|
const counts = safe.counts ?? {};
|
|
18130
18149
|
const lines = [];
|
|
18131
|
-
if (groups.length === 0) {
|
|
18150
|
+
if (groups.length === 0 && sessions.length === 0) {
|
|
18132
18151
|
lines.push("No agent is working right now.");
|
|
18133
18152
|
} else {
|
|
18134
18153
|
for (const g of groups) {
|
|
18135
18154
|
lines.push(groupTitle(g.where, g.machine));
|
|
18136
|
-
for (const item of g.items)
|
|
18155
|
+
for (const item of g.items) {
|
|
18156
|
+
lines.push(itemLine(item));
|
|
18157
|
+
if (item.connectionId)
|
|
18158
|
+
lines.push(...liveLines(byId.get(item.connectionId)));
|
|
18159
|
+
}
|
|
18160
|
+
lines.push("");
|
|
18161
|
+
}
|
|
18162
|
+
for (const s2 of sessions) {
|
|
18163
|
+
lines.push(groupTitle(s2.where, s2.machine));
|
|
18164
|
+
lines.push(itemLine({ who: s2.name }));
|
|
18165
|
+
lines.push(...liveLines(s2));
|
|
18137
18166
|
lines.push("");
|
|
18138
18167
|
}
|
|
18139
18168
|
if (lines[lines.length - 1] === "") lines.pop();
|