skydive-cli 0.1.0-beta.106 → 0.1.0-beta.109
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/js/bin.mjs +39 -6
- package/package.json +1 -1
package/dist/js/bin.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import fs from "node:fs";
|
|
|
13
13
|
import zlib from "node:zlib";
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
|
-
var version$1 = "0.1.0-beta.
|
|
16
|
+
var version$1 = "0.1.0-beta.109";
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/types.ts
|
|
@@ -824,17 +824,50 @@ const listCommand$3 = {
|
|
|
824
824
|
console.log("No agents found.");
|
|
825
825
|
return;
|
|
826
826
|
}
|
|
827
|
-
|
|
827
|
+
const { headers, rows } = buildAgentTable(agents);
|
|
828
|
+
printTable(headers, rows);
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
const DESCRIPTION_MAX = 48;
|
|
832
|
+
/**
|
|
833
|
+
* Build the `agents list` table. A Description column is added only when at
|
|
834
|
+
* least one agent actually has a description, so an all-empty column doesn't
|
|
835
|
+
* add noise for accounts that never set them. Descriptions can be long, so
|
|
836
|
+
* they are truncated to keep one verbose agent from blowing out the width.
|
|
837
|
+
*/
|
|
838
|
+
function buildAgentTable(agents) {
|
|
839
|
+
if (agents.some((a) => (a.description ?? "").trim().length > 0)) return {
|
|
840
|
+
headers: [
|
|
828
841
|
"Name",
|
|
842
|
+
"Description",
|
|
829
843
|
"URL",
|
|
830
844
|
"Model"
|
|
831
|
-
],
|
|
845
|
+
],
|
|
846
|
+
rows: agents.map((a) => [
|
|
832
847
|
a.name,
|
|
848
|
+
truncate(a.description ?? "", DESCRIPTION_MAX),
|
|
833
849
|
a.url ?? "-",
|
|
834
850
|
a.model ?? "default"
|
|
835
|
-
])
|
|
836
|
-
}
|
|
837
|
-
|
|
851
|
+
])
|
|
852
|
+
};
|
|
853
|
+
return {
|
|
854
|
+
headers: [
|
|
855
|
+
"Name",
|
|
856
|
+
"URL",
|
|
857
|
+
"Model"
|
|
858
|
+
],
|
|
859
|
+
rows: agents.map((a) => [
|
|
860
|
+
a.name,
|
|
861
|
+
a.url ?? "-",
|
|
862
|
+
a.model ?? "default"
|
|
863
|
+
])
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
function truncate(value, max) {
|
|
867
|
+
const trimmed = value.trim();
|
|
868
|
+
if (trimmed.length <= max) return trimmed || "-";
|
|
869
|
+
return `${trimmed.slice(0, max - 1)}\u2026`;
|
|
870
|
+
}
|
|
838
871
|
const getCommand = {
|
|
839
872
|
command: "get <id>",
|
|
840
873
|
describe: "Get agent details",
|