@erdoai/cli 0.54.0 → 0.54.1
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 +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2471,6 +2471,12 @@ agentCmd.command("threads").description("List your threads").action(async () =>
|
|
|
2471
2471
|
fail(e);
|
|
2472
2472
|
}
|
|
2473
2473
|
});
|
|
2474
|
+
function contentBlockLabel(c) {
|
|
2475
|
+
const type = c.ui_content_type || c.content_type;
|
|
2476
|
+
const payload = c.content;
|
|
2477
|
+
const toolName = payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.name === "string" ? payload.name : void 0;
|
|
2478
|
+
return toolName ? `${type}: ${toolName}` : type;
|
|
2479
|
+
}
|
|
2474
2480
|
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) => {
|
|
2475
2481
|
try {
|
|
2476
2482
|
const { messages } = await new ErdoClient().getThreadMessages(threadId);
|
|
@@ -2485,10 +2491,10 @@ agentCmd.command("messages <threadId>").description("Show a thread's messages (r
|
|
|
2485
2491
|
if (c.content_type === "text") {
|
|
2486
2492
|
console.log(c.content);
|
|
2487
2493
|
} else if (opts.verbose) {
|
|
2488
|
-
console.log(`\x1B[2m[${c
|
|
2494
|
+
console.log(`\x1B[2m[${contentBlockLabel(c)}]\x1B[0m`);
|
|
2489
2495
|
console.log(typeof c.content === "string" ? c.content : JSON.stringify(c.content, null, 2));
|
|
2490
2496
|
} else {
|
|
2491
|
-
console.log(`\x1B[2m[${c
|
|
2497
|
+
console.log(`\x1B[2m[${contentBlockLabel(c)}]\x1B[0m`);
|
|
2492
2498
|
}
|
|
2493
2499
|
}
|
|
2494
2500
|
}
|