@erdoai/cli 0.217.0 → 0.222.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/dist/index.js +17 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2298,6 +2298,9 @@ var ErdoClient = class {
|
|
|
2298
2298
|
if (limit) params.set("limit", String(limit));
|
|
2299
2299
|
return this.request("GET", `/v1/knowledge-search?${params.toString()}`);
|
|
2300
2300
|
}
|
|
2301
|
+
deleteKnowledge(id) {
|
|
2302
|
+
return this.request("DELETE", `/v1/knowledge/${encodeURIComponent(id)}`);
|
|
2303
|
+
}
|
|
2301
2304
|
setKnowledgeVisibility(id, visibility) {
|
|
2302
2305
|
return this.request("PATCH", `/v1/knowledge/${id}/visibility`, { visibility });
|
|
2303
2306
|
}
|
|
@@ -5553,11 +5556,14 @@ conversationParticipantsCmd.command("remove <threadId> <agent>").description("Re
|
|
|
5553
5556
|
fail(e);
|
|
5554
5557
|
}
|
|
5555
5558
|
});
|
|
5556
|
-
function contentBlockLabel(c) {
|
|
5559
|
+
function contentBlockLabel(c, verbose = false) {
|
|
5557
5560
|
const type = c.ui_content_type || c.content_type;
|
|
5558
5561
|
const payload = c.content;
|
|
5559
5562
|
const toolName = payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.name === "string" ? payload.name : void 0;
|
|
5560
|
-
|
|
5563
|
+
let label = toolName ? `${type}: ${toolName}` : type;
|
|
5564
|
+
const producer = [c.created_by_agent_key, verbose && c.created_by_agent_run_id ? `run ${c.created_by_agent_run_id}` : void 0].filter(Boolean).join(" ");
|
|
5565
|
+
if (producer) label += ` \xB7 by ${producer}`;
|
|
5566
|
+
return label;
|
|
5561
5567
|
}
|
|
5562
5568
|
agentCmd.command("messages <threadId>").description("Show a thread's messages (role + text)").option("-v, --verbose", "print full content for non-text entries (tool calls, results, etc.) instead of a placeholder").action(async (threadId, opts) => {
|
|
5563
5569
|
try {
|
|
@@ -5573,7 +5579,7 @@ agentCmd.command("messages <threadId>").description("Show a thread's messages (r
|
|
|
5573
5579
|
if (c.content_type === "text") {
|
|
5574
5580
|
console.log(c.content);
|
|
5575
5581
|
} else if (opts.verbose) {
|
|
5576
|
-
console.log(`\x1B[2m[${contentBlockLabel(c)}]\x1B[0m`);
|
|
5582
|
+
console.log(`\x1B[2m[${contentBlockLabel(c, true)}]\x1B[0m`);
|
|
5577
5583
|
console.log(typeof c.content === "string" ? c.content : JSON.stringify(c.content, null, 2));
|
|
5578
5584
|
} else {
|
|
5579
5585
|
console.log(`\x1B[2m[${contentBlockLabel(c)}]\x1B[0m`);
|
|
@@ -10982,6 +10988,14 @@ knowledgeCmd.command("visibility <id> <visibility>").description(
|
|
|
10982
10988
|
fail(e);
|
|
10983
10989
|
}
|
|
10984
10990
|
});
|
|
10991
|
+
knowledgeCmd.command("delete <id>").description("Delete a Knowledge object you can manage (same as the erdo_delete_knowledge MCP tool)").action(async (id) => {
|
|
10992
|
+
try {
|
|
10993
|
+
await new ErdoClient().deleteKnowledge(id);
|
|
10994
|
+
print({ deleted: id });
|
|
10995
|
+
} catch (e) {
|
|
10996
|
+
fail(e);
|
|
10997
|
+
}
|
|
10998
|
+
});
|
|
10985
10999
|
knowledgeCmd.command("attach <objectId> <file>").description(
|
|
10986
11000
|
"Attach an image or other small binary to a knowledge object as an org-hosted asset, and print its asset id \u2014 the value a page's assetId field takes. Pass a local path, or --url to have the service download it (the only path for video)."
|
|
10987
11001
|
).option("--url <sourceUrl>", "download from this URL instead of reading a local file").option(
|