danube-cli 0.2.3 → 0.2.5
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/danube.mjs +18 -10
- package/package.json +1 -1
package/dist/danube.mjs
CHANGED
|
@@ -55,7 +55,14 @@ function output(data) {
|
|
|
55
55
|
}
|
|
56
56
|
function outputTable(items, columns, title) {
|
|
57
57
|
if (!humanMode) {
|
|
58
|
-
|
|
58
|
+
const slim = items.map((item) => {
|
|
59
|
+
const row = {};
|
|
60
|
+
for (const col of columns) {
|
|
61
|
+
row[col.key] = item[col.key];
|
|
62
|
+
}
|
|
63
|
+
return row;
|
|
64
|
+
});
|
|
65
|
+
output(slim);
|
|
59
66
|
return;
|
|
60
67
|
}
|
|
61
68
|
if (title) {
|
|
@@ -159,7 +166,7 @@ var package_default;
|
|
|
159
166
|
var init_package = __esm(() => {
|
|
160
167
|
package_default = {
|
|
161
168
|
name: "danube-cli",
|
|
162
|
-
version: "0.2.
|
|
169
|
+
version: "0.2.5",
|
|
163
170
|
description: "Danube CLI — agent-first tool infrastructure for AI agents",
|
|
164
171
|
type: "module",
|
|
165
172
|
license: "MIT",
|
|
@@ -711,8 +718,7 @@ Examples:
|
|
|
711
718
|
outputTable(tools, [
|
|
712
719
|
{ header: "ID", key: "id", style: "dim" },
|
|
713
720
|
{ header: "Name", key: "name", style: "bold" },
|
|
714
|
-
{ header: "Description", key: "description" }
|
|
715
|
-
{ header: "Service", key: "service_name" }
|
|
721
|
+
{ header: "Description", key: "description" }
|
|
716
722
|
], `Tools matching '${query}'`);
|
|
717
723
|
}));
|
|
718
724
|
}
|
|
@@ -826,16 +832,19 @@ Examples:
|
|
|
826
832
|
toolId = toolInfo.id;
|
|
827
833
|
}
|
|
828
834
|
const result = await client.post(`/v1/tools/call/${toolId}`, {
|
|
829
|
-
|
|
835
|
+
tool_input: params
|
|
830
836
|
});
|
|
837
|
+
const hasError = result.error || result.success === false;
|
|
831
838
|
output({
|
|
832
|
-
success: result.success,
|
|
839
|
+
success: result.success ?? !result.error,
|
|
833
840
|
result: result.result,
|
|
834
841
|
error: result.error,
|
|
835
842
|
tool_id: result.tool_id,
|
|
836
843
|
tool_name: result.tool_name,
|
|
837
844
|
duration_ms: result.duration_ms
|
|
838
845
|
});
|
|
846
|
+
if (hasError)
|
|
847
|
+
process.exit(1);
|
|
839
848
|
}));
|
|
840
849
|
}
|
|
841
850
|
var init_execute = __esm(() => {
|
|
@@ -1153,8 +1162,7 @@ function register6(program) {
|
|
|
1153
1162
|
outputTable(result, [
|
|
1154
1163
|
{ header: "ID", key: "id", style: "dim" },
|
|
1155
1164
|
{ header: "Name", key: "name", style: "bold" },
|
|
1156
|
-
{ header: "Description", key: "description" }
|
|
1157
|
-
{ header: "Service", key: "service_name" }
|
|
1165
|
+
{ header: "Description", key: "description" }
|
|
1158
1166
|
], `Tools matching '${query}'`);
|
|
1159
1167
|
}));
|
|
1160
1168
|
tools.command("rate <tool> <rating>").description("Rate a tool (1-5 stars)").option("--comment <text>", "Optional comment").action(handleErrors(async (tool, rating, opts) => {
|
|
@@ -1225,11 +1233,11 @@ function register7(program) {
|
|
|
1225
1233
|
services.command("list [query]").description("List or search available services").option("--limit <n>", "Maximum results", "10").action(handleErrors(async (query, opts) => {
|
|
1226
1234
|
const client = getPublicClient(ctx.profile);
|
|
1227
1235
|
let result = await client.publicGet("/v1/services/public", {
|
|
1228
|
-
limit: opts.limit
|
|
1236
|
+
limit: query ? undefined : opts.limit
|
|
1229
1237
|
});
|
|
1230
1238
|
if (query) {
|
|
1231
1239
|
const q = query.toLowerCase();
|
|
1232
|
-
result = result.filter((s) => s.name.toLowerCase().includes(q) || (s.description ?? "").toLowerCase().includes(q));
|
|
1240
|
+
result = result.filter((s) => s.name.toLowerCase().includes(q) || (s.description ?? "").toLowerCase().includes(q)).slice(0, parseInt(opts.limit, 10));
|
|
1233
1241
|
}
|
|
1234
1242
|
outputTable(result, [
|
|
1235
1243
|
{ header: "ID", key: "id", style: "dim" },
|