@erdoai/cli 0.238.0 → 0.239.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 +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1642,6 +1642,8 @@ var ErdoClient = class {
|
|
|
1642
1642
|
if (params?.orderBy) q.set("order_by", params.orderBy);
|
|
1643
1643
|
if (params?.includeAutomation) q.set("include_automation", "true");
|
|
1644
1644
|
if (params?.origin) q.set("origin", params.origin);
|
|
1645
|
+
if (params?.createdAfter) q.set("created_after", params.createdAfter);
|
|
1646
|
+
if (params?.createdBefore) q.set("created_before", params.createdBefore);
|
|
1645
1647
|
if (params?.limit !== void 0) q.set("limit", String(params.limit));
|
|
1646
1648
|
if (params?.offset !== void 0) q.set("offset", String(params.offset));
|
|
1647
1649
|
const qs = q.toString();
|
|
@@ -5354,9 +5356,13 @@ async function resolveConversationPersona(client, selector) {
|
|
|
5354
5356
|
throw new Error(`No enabled agent matches "${selector}"`);
|
|
5355
5357
|
}
|
|
5356
5358
|
var conversationsCmd = program.command("threads").description("List and open conversations with people and named agents");
|
|
5357
|
-
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
5359
|
+
conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("--since <iso>", "include conversations created at or after this RFC3339 timestamp").option("--until <iso>", "include conversations created before this RFC3339 timestamp").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
5358
5360
|
try {
|
|
5359
|
-
const { threads, total } = await new ErdoClient().listThreads(
|
|
5361
|
+
const { threads, total } = await new ErdoClient().listThreads({
|
|
5362
|
+
...opts,
|
|
5363
|
+
createdAfter: opts.since,
|
|
5364
|
+
createdBefore: opts.until
|
|
5365
|
+
});
|
|
5360
5366
|
for (const thread of threads) {
|
|
5361
5367
|
const preview = (thread.last_message_preview || "").replace(/[\t\r\n]+/g, " ").slice(0, 120);
|
|
5362
5368
|
const speaker = thread.last_message_author_display_name || thread.last_message_author_entity_type || "";
|
|
@@ -11465,7 +11471,8 @@ autoCmd.command("show <id>").description("Show one automation's state, schedule,
|
|
|
11465
11471
|
console.log(`schedule: ${schedule}`);
|
|
11466
11472
|
console.log(`next run: ${h.next_run_at ?? cron?.next_run_at ?? "none"}`);
|
|
11467
11473
|
const latest = h.latest_execution;
|
|
11468
|
-
|
|
11474
|
+
const latestDetail = latest?.error_message ? latest.failure_class === "reported_could_not" ? `; couldn't: ${latest.error_message}` : `; error: ${latest.error_message}` : "";
|
|
11475
|
+
console.log(`latest run: ${latest ? `${latest.status} at ${latest.started_at}${latestDetail}` : "none"}`);
|
|
11469
11476
|
} catch (e) {
|
|
11470
11477
|
fail(e);
|
|
11471
11478
|
}
|