@erdoai/cli 0.194.0 → 0.196.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 +30 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1574,6 +1574,11 @@ var ErdoClient = class {
|
|
|
1574
1574
|
// `purpose_sibling: true` only to declare a deliberate parallel carrier (a
|
|
1575
1575
|
// separate program a human chose to run), which leaves the other carriers
|
|
1576
1576
|
// alone.
|
|
1577
|
+
// deleteDataset permanently deletes a dataset and its data (DELETE
|
|
1578
|
+
// /v1/datasets/:slug, the same path as the erdo_delete_dataset MCP tool).
|
|
1579
|
+
deleteDataset(slug) {
|
|
1580
|
+
return this.request("DELETE", `/v1/datasets/${encodeURIComponent(slug)}`);
|
|
1581
|
+
}
|
|
1577
1582
|
setDatasetPurpose(slug, input) {
|
|
1578
1583
|
return this.updateDatasetSchema(slug, input);
|
|
1579
1584
|
}
|
|
@@ -2092,8 +2097,8 @@ var ErdoClient = class {
|
|
|
2092
2097
|
createHeartbeat(body) {
|
|
2093
2098
|
return this.request("POST", "/v1/heartbeats", body);
|
|
2094
2099
|
}
|
|
2095
|
-
runHeartbeat(id) {
|
|
2096
|
-
return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, {});
|
|
2100
|
+
runHeartbeat(id, body) {
|
|
2101
|
+
return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, body ?? {});
|
|
2097
2102
|
}
|
|
2098
2103
|
listHeartbeatExecutions(id, limit = 10) {
|
|
2099
2104
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
@@ -8492,6 +8497,17 @@ datasetsCmd.command("update-schema <slug>").description("Evolve an existing data
|
|
|
8492
8497
|
fail(e);
|
|
8493
8498
|
}
|
|
8494
8499
|
});
|
|
8500
|
+
datasetsCmd.command("delete <slug>").description("Permanently delete a dataset and all its data (the erdo_delete_dataset MCP tool). Nothing is deleted without --yes").option("--yes", "confirm the permanent deletion").action(async (slug, opts) => {
|
|
8501
|
+
try {
|
|
8502
|
+
if (!opts.yes) {
|
|
8503
|
+
fail(new Error(`deleting ${slug} is permanent and removes all its data; rerun with --yes to delete it`));
|
|
8504
|
+
}
|
|
8505
|
+
await new ErdoClient().deleteDataset(slug);
|
|
8506
|
+
console.log(`deleted ${slug}`);
|
|
8507
|
+
} catch (e) {
|
|
8508
|
+
fail(e);
|
|
8509
|
+
}
|
|
8510
|
+
});
|
|
8495
8511
|
datasetsCmd.command("set-purpose <slug> [purpose]").description(
|
|
8496
8512
|
"Set (or with --clear, remove) the dataset's purpose \u2014 the org-vocabulary role `datasets purposes` reports. Use it to CORRECT a purpose that names the wrong dataset: one purpose maps to one dataset per org, so a purpose left on the wrong one points everything that resolves through the vocabulary at the wrong rows. Setting a purpose another dataset carries is an atomic MOVE: the old carrier is cleared in the same transaction, so one call on the right dataset lands it (the response says which dataset it moved from). Use --sibling only when deliberately running a parallel table for the same purpose."
|
|
8497
8513
|
).option("--clear", "remove the dataset's purpose instead of setting one").option(
|
|
@@ -10468,7 +10484,7 @@ function scheduleBound(flag, v) {
|
|
|
10468
10484
|
}
|
|
10469
10485
|
autoCmd.command("create <name>").description(
|
|
10470
10486
|
"Create an automation. Pass --run-at for one-off work at a date (it runs once, then stops for good) instead of a recurring automation that checks the date"
|
|
10471
|
-
).option("--description <text>", "What the automation does").option("--instructions <text>", "Instructions for each run (agent automation)").option("--script-js <js>", "Deterministic script body (scripted automation, no LLM)").option("--script-file <path>", "Read the script body from a file (scripted automation)").requiredOption("--interval <minutes>", "Interval in minutes (minimum 5)", (v) => parseInt(v, 10)).option("--timezone <tz>", "Scheduling timezone, e.g. America/New_York (default UTC)").option("--at <HH:MM>", "Clock time of each run in --timezone, e.g. 21:02").option("--run-after <id>", "Also start when this automation finishes").option("--after-when <when>", "success or finished (default finished)").option("--after-delay <minutes>", "Wait this many minutes after the predecessor finishes", (v) => parseInt(v, 10)).option("--instead-of-schedule", "Run only after --run-after, with no clock of its own").option("--run-at <rfc3339>", "Run once at or after this instant, then stop permanently").option("--ends-at <rfc3339>", "Never run after this instant").addOption(new Option2("--agent-key <key>", "Executor for an agent automation").choices(["erdo.heartbeat-executor", "erdo.workflow-executor"])).addOption(new Option2("--conversation <target>", "Target 'new' (fresh thread) or 'direct' conversation").choices(["new", "direct"])).option("--thread-id <id>", "Post each run into an existing conversation UUID").option("--persona-id <id>", "Org-enabled persona UUID to speak as").action(
|
|
10487
|
+
).option("--description <text>", "What the automation does").option("--instructions <text>", "Instructions for each run (agent automation)").option("--script-js <js>", "Deterministic script body (scripted automation, no LLM)").option("--script-file <path>", "Read the script body from a file (scripted automation)").requiredOption("--interval <minutes>", "Interval in minutes (minimum 5)", (v) => parseInt(v, 10)).option("--timezone <tz>", "Scheduling timezone, e.g. America/New_York (default UTC)").option("--at <HH:MM>", "Clock time of each run in --timezone, e.g. 21:02").option("--run-after <id>", "Also start when this automation finishes").option("--after-when <when>", "success or finished (default finished)").option("--after-delay <minutes>", "Wait this many minutes after the predecessor finishes", (v) => parseInt(v, 10)).option("--instead-of-schedule", "Run only after --run-after, with no clock of its own").option("--run-at <rfc3339>", "Run once at or after this instant, then stop permanently").option("--ends-at <rfc3339>", "Never run after this instant").addOption(new Option2("--agent-key <key>", "Executor for an agent automation").choices(["erdo.heartbeat-executor", "erdo.workflow-executor"])).option("--model <id>", "LLM for each run, for example claude-haiku-5-5. Omit for the executor default").addOption(new Option2("--conversation <target>", "Target 'new' (fresh thread) or 'direct' conversation").choices(["new", "direct"])).option("--thread-id <id>", "Post each run into an existing conversation UUID").option("--persona-id <id>", "Org-enabled persona UUID to speak as").action(
|
|
10472
10488
|
async (name, opts) => {
|
|
10473
10489
|
try {
|
|
10474
10490
|
if (opts.scriptJs && opts.scriptFile) {
|
|
@@ -10491,6 +10507,7 @@ autoCmd.command("create <name>").description(
|
|
|
10491
10507
|
run_at: scheduleBound("--run-at", opts.runAt),
|
|
10492
10508
|
ends_at: scheduleBound("--ends-at", opts.endsAt),
|
|
10493
10509
|
agent_key: opts.agentKey,
|
|
10510
|
+
model: opts.model,
|
|
10494
10511
|
conversation: opts.conversation,
|
|
10495
10512
|
thread_id: opts.threadId,
|
|
10496
10513
|
persona_id: opts.personaId
|
|
@@ -10504,7 +10521,7 @@ autoCmd.command("create <name>").description(
|
|
|
10504
10521
|
autoCmd.command("list").description("List automations").action(async () => {
|
|
10505
10522
|
try {
|
|
10506
10523
|
const { heartbeats } = await new ErdoClient().listHeartbeats();
|
|
10507
|
-
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}` : ""}${heartbeatBounds(h)}`);
|
|
10524
|
+
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)}`);
|
|
10508
10525
|
} catch (e) {
|
|
10509
10526
|
fail(e);
|
|
10510
10527
|
}
|
|
@@ -10520,14 +10537,14 @@ autoCmd.command("executions <id>").description("Read recent execution history fo
|
|
|
10520
10537
|
fail(e);
|
|
10521
10538
|
}
|
|
10522
10539
|
});
|
|
10523
|
-
autoCmd.command("run <id>").description("Trigger an automation now").action(async (id) => {
|
|
10540
|
+
autoCmd.command("run <id>").description("Trigger an automation now").option("--model <id>", "LLM for this run only. Omit to use the automation's model").action(async (id, opts) => {
|
|
10524
10541
|
try {
|
|
10525
|
-
print(await new ErdoClient().runHeartbeat(id));
|
|
10542
|
+
print(await new ErdoClient().runHeartbeat(id, opts.model ? { model: opts.model } : void 0));
|
|
10526
10543
|
} catch (e) {
|
|
10527
10544
|
fail(e);
|
|
10528
10545
|
}
|
|
10529
10546
|
});
|
|
10530
|
-
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule, or replace its script/instructions").option("--name <name>", "New name").option("--description <text>", "New description").option("--instructions <text>", "Replacement instructions (agent automation)").addOption(new Option2("--agent-key <key>", "Executor for an agent automation; omit to keep current").choices(["erdo.heartbeat-executor", "erdo.workflow-executor"])).option("--script-js <js>", "Replacement script body (scripted automation)").option(
|
|
10547
|
+
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule, or replace its script/instructions").option("--name <name>", "New name").option("--description <text>", "New description").option("--instructions <text>", "Replacement instructions (agent automation)").addOption(new Option2("--agent-key <key>", "Executor for an agent automation; omit to keep current").choices(["erdo.heartbeat-executor", "erdo.workflow-executor"])).option("--model <id>", "Pin the LLM for later runs. Omit to keep the current pin").option("--clear-model", "Remove the model pin so later runs use the skill model, then the executor default").option("--script-js <js>", "Replacement script body (scripted automation)").option(
|
|
10531
10548
|
"--script-file <path>",
|
|
10532
10549
|
"Read the replacement script body from a file (scripted automation)"
|
|
10533
10550
|
).addOption(new Option2("--conversation <target>", "Target 'new' (fresh thread) or 'direct' conversation").choices(["new", "direct"])).option("--thread-id <id>", "Post each run into an existing conversation UUID").option("--persona-id <id>", "Org-enabled persona UUID to speak as").option("--interval <minutes>", "New interval in minutes (minimum 5)", (v) => parseInt(v, 10)).option("--timezone <tz>", "New scheduling timezone, e.g. America/New_York").option("--at <HH:MM>", "Clock time of each run in the automation timezone, e.g. 21:02").option("--clear-at", "Clear the clock time so the next run is one interval after this save").option("--run-after <id>", "Start when this automation finishes").option("--clear-run-after", "Stop following another automation").option("--after-when <when>", "success or finished").option("--after-delay <minutes>", "Wait this many minutes after the predecessor finishes", (v) => parseInt(v, 10)).option("--instead-of-schedule", "Run only from the chain, with no clock").option("--keep-schedule", "Keep the clock as well as the chain").option("--run-at <rfc3339>", "New one-off fire time: runs once at or after it, then stops permanently (omit to keep)").option("--ends-at <rfc3339>", "New end time after which it never runs (omit to keep)").action(
|
|
@@ -10537,6 +10554,10 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
|
|
|
10537
10554
|
fail(new Error("pass either --script-js or --script-file, not both"));
|
|
10538
10555
|
return;
|
|
10539
10556
|
}
|
|
10557
|
+
if (opts.model && opts.clearModel) {
|
|
10558
|
+
fail(new Error("pass either --model or --clear-model, not both"));
|
|
10559
|
+
return;
|
|
10560
|
+
}
|
|
10540
10561
|
const scriptJs = opts.scriptFile ? readFileSync4(opts.scriptFile, "utf8") : opts.scriptJs;
|
|
10541
10562
|
if (opts.at !== void 0 && opts.clearAt) {
|
|
10542
10563
|
fail(new Error("pass either --at or --clear-at, not both"));
|
|
@@ -10555,6 +10576,8 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
|
|
|
10555
10576
|
description: opts.description,
|
|
10556
10577
|
instructions: opts.instructions,
|
|
10557
10578
|
agent_key: opts.agentKey,
|
|
10579
|
+
model: opts.model,
|
|
10580
|
+
clear_model: opts.clearModel,
|
|
10558
10581
|
script_js: scriptJs,
|
|
10559
10582
|
interval_minutes: opts.interval,
|
|
10560
10583
|
timezone: opts.timezone,
|