@erdoai/cli 0.238.0 → 0.240.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 +13 -4
- 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();
|
|
@@ -5201,7 +5203,7 @@ thread: ${res.thread_id}`);
|
|
|
5201
5203
|
fail(e);
|
|
5202
5204
|
}
|
|
5203
5205
|
});
|
|
5204
|
-
agentCmd.command("send <threadId> <message>").description("Send a message to a thread and print the agent's reply; message accepts @path to a UTF-8 file").option("-a, --agent <key>", "agent to invoke (e.g. erdo.artifact-builder)").option("--model <id>", "model to use for this turn; empty uses the agent default").option(
|
|
5206
|
+
agentCmd.command("send <threadId> <message>").description("Send a message to a thread and print the agent's reply; message accepts @path to a UTF-8 file").option("-a, --agent <key>", "agent to invoke (e.g. erdo.artifact-builder)").option("--persona <key>", "enabled conversation agent persona key to speak as").option("--skill <slug...>", "skill slug(s) to apply to this message (at most five)").option("--model <id>", "model to use for this turn; empty uses the agent default").option(
|
|
5205
5207
|
"--context <text>",
|
|
5206
5208
|
"application context for this turn, or @path to a UTF-8 file; omitted from the visible user message"
|
|
5207
5209
|
).option(
|
|
@@ -5218,6 +5220,8 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
|
|
|
5218
5220
|
message: readMaybeFile(message) ?? "",
|
|
5219
5221
|
context: readMaybeFile(opts.context),
|
|
5220
5222
|
agent_key: opts.agent,
|
|
5223
|
+
persona_key: opts.persona,
|
|
5224
|
+
skill_ids: opts.skill,
|
|
5221
5225
|
model: opts.model,
|
|
5222
5226
|
timezone: opts.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
5223
5227
|
async: !opts.sync,
|
|
@@ -5354,9 +5358,13 @@ async function resolveConversationPersona(client, selector) {
|
|
|
5354
5358
|
throw new Error(`No enabled agent matches "${selector}"`);
|
|
5355
5359
|
}
|
|
5356
5360
|
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) => {
|
|
5361
|
+
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
5362
|
try {
|
|
5359
|
-
const { threads, total } = await new ErdoClient().listThreads(
|
|
5363
|
+
const { threads, total } = await new ErdoClient().listThreads({
|
|
5364
|
+
...opts,
|
|
5365
|
+
createdAfter: opts.since,
|
|
5366
|
+
createdBefore: opts.until
|
|
5367
|
+
});
|
|
5360
5368
|
for (const thread of threads) {
|
|
5361
5369
|
const preview = (thread.last_message_preview || "").replace(/[\t\r\n]+/g, " ").slice(0, 120);
|
|
5362
5370
|
const speaker = thread.last_message_author_display_name || thread.last_message_author_entity_type || "";
|
|
@@ -11465,7 +11473,8 @@ autoCmd.command("show <id>").description("Show one automation's state, schedule,
|
|
|
11465
11473
|
console.log(`schedule: ${schedule}`);
|
|
11466
11474
|
console.log(`next run: ${h.next_run_at ?? cron?.next_run_at ?? "none"}`);
|
|
11467
11475
|
const latest = h.latest_execution;
|
|
11468
|
-
|
|
11476
|
+
const latestDetail = latest?.error_message ? latest.failure_class === "reported_could_not" ? `; couldn't: ${latest.error_message}` : `; error: ${latest.error_message}` : "";
|
|
11477
|
+
console.log(`latest run: ${latest ? `${latest.status} at ${latest.started_at}${latestDetail}` : "none"}`);
|
|
11469
11478
|
} catch (e) {
|
|
11470
11479
|
fail(e);
|
|
11471
11480
|
}
|