@erdoai/cli 0.212.0 → 0.213.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 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2302,7 +2302,12 @@ var ErdoClient = class {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
// --- automations (heartbeats) ---
|
|
2304
2304
|
listHeartbeats(opts = {}) {
|
|
2305
|
-
|
|
2305
|
+
const query = new URLSearchParams();
|
|
2306
|
+
if (opts.includeRefresh) query.set("include_refresh", "true");
|
|
2307
|
+
if (opts.limit !== void 0) query.set("limit", String(opts.limit));
|
|
2308
|
+
if (opts.offset !== void 0) query.set("offset", String(opts.offset));
|
|
2309
|
+
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
2310
|
+
return this.request("GET", `/v1/heartbeats${suffix}`);
|
|
2306
2311
|
}
|
|
2307
2312
|
createHeartbeat(body) {
|
|
2308
2313
|
return this.request("POST", "/v1/heartbeats", body);
|
|
@@ -5255,7 +5260,7 @@ thread: ${res.thread_id}`);
|
|
|
5255
5260
|
fail(e);
|
|
5256
5261
|
}
|
|
5257
5262
|
});
|
|
5258
|
-
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(
|
|
5263
|
+
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(
|
|
5259
5264
|
"--context <text>",
|
|
5260
5265
|
"application context for this turn, or @path to a UTF-8 file; omitted from the visible user message"
|
|
5261
5266
|
).option(
|
|
@@ -5269,6 +5274,7 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
|
|
|
5269
5274
|
message: readMaybeFile(message) ?? "",
|
|
5270
5275
|
context: readMaybeFile(opts.context),
|
|
5271
5276
|
agent_key: opts.agent,
|
|
5277
|
+
model: opts.model,
|
|
5272
5278
|
async: !opts.sync,
|
|
5273
5279
|
read_only: opts.readOnly
|
|
5274
5280
|
});
|
|
@@ -11020,9 +11026,15 @@ autoCmd.command("create <name>").description(
|
|
|
11020
11026
|
}
|
|
11021
11027
|
}
|
|
11022
11028
|
);
|
|
11023
|
-
autoCmd.command("list").description("List automations").option("--include-refresh", "Also list dataset refresh jobs with their state, including auto-paused ones and any that will pause soon").action(async (opts) => {
|
|
11024
|
-
try {
|
|
11025
|
-
const
|
|
11029
|
+
autoCmd.command("list").description("List automations").option("--include-refresh", "Also list dataset refresh jobs with their state, including auto-paused ones and any that will pause soon").option("--limit <n>", "Number of automations to return").option("--offset <n>", "Number of automations to skip", "0").action(async (opts) => {
|
|
11030
|
+
try {
|
|
11031
|
+
const rawLimit = opts.limit;
|
|
11032
|
+
const limit = rawLimit === void 0 ? void 0 : Number(rawLimit);
|
|
11033
|
+
const offset = Number(opts.offset);
|
|
11034
|
+
if (rawLimit !== void 0 && (!/^\d+$/.test(rawLimit) || limit === void 0 || limit < 1 || limit > 50)) throw new Error("limit must be an integer between 1 and 50");
|
|
11035
|
+
if (!/^\d+$/.test(opts.offset) || !Number.isInteger(offset) || offset < 0) throw new Error("offset must be a non-negative integer");
|
|
11036
|
+
const { heartbeats, refreshes, has_more } = await new ErdoClient().listHeartbeats({ includeRefresh: opts.includeRefresh, limit, offset: offset || void 0 });
|
|
11037
|
+
if (has_more) console.error(`more automations exist: rerun with --offset ${offset + heartbeats.length}`);
|
|
11026
11038
|
for (const h of heartbeats) console.log(`${h.id} ${h.state} ${h.name} ${h.kind === "script" ? "script" : h.thread_id ? `thread:${h.thread_id}` : h.conversation ?? "new"}${h.persona_id ? ` persona:${h.persona_id}` : ""}${h.model ? ` model:${h.model}` : ""}${heartbeatBounds(h)}`);
|
|
11027
11039
|
if (opts.includeRefresh) {
|
|
11028
11040
|
for (const r of refreshes ?? []) console.log(formatRefreshJobRow(r));
|