@erdoai/cli 0.244.0 → 0.245.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 +26 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125,7 +125,7 @@ function describeFreshnessTarget(state) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
// src/index.ts
|
|
128
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
128
|
+
import { readFileSync as readFileSync5, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
129
129
|
|
|
130
130
|
// src/script-edits.ts
|
|
131
131
|
function parseScriptEdits(text) {
|
|
@@ -11473,22 +11473,37 @@ knowledgeCmd.command("delete <id>").description("Delete a Knowledge object you c
|
|
|
11473
11473
|
fail(e);
|
|
11474
11474
|
}
|
|
11475
11475
|
});
|
|
11476
|
-
knowledgeCmd.command("attach <objectId>
|
|
11476
|
+
knowledgeCmd.command("attach <objectId> [file]").description(
|
|
11477
11477
|
"Attach an image or other small binary to a knowledge object as an org-hosted asset, and print its asset id \u2014 the value a page's assetId field takes. Pass a local path, or --url to have the service download it (the only path for video)."
|
|
11478
|
-
).option("--url <sourceUrl>", "download from this URL instead of reading a local file").option(
|
|
11478
|
+
).option("--url <sourceUrl>", "download from this URL instead of reading a local file").addOption(new Option2("--caption <text>", "caption describing the attachment").conflicts("description")).option("--role <prefix>", "filename role prefix, e.g. customer-logo; already prefixed names are preserved").option(
|
|
11479
11479
|
"-d, --description <text>",
|
|
11480
11480
|
"caption for the asset; for an image this is the only text search can match, so describe what is in the picture"
|
|
11481
11481
|
).option("--media-type <mime>", "MIME type hint, e.g. image/jpeg; detected from the filename otherwise").action(
|
|
11482
11482
|
async (objectId, file, opts) => {
|
|
11483
11483
|
try {
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11484
|
+
let body;
|
|
11485
|
+
if (opts.url) {
|
|
11486
|
+
const source = new URL(opts.url);
|
|
11487
|
+
if (!["http:", "https:"].includes(source.protocol) || source.username || source.password) {
|
|
11488
|
+
throw new Error("--url must be an HTTP(S) URL without credentials");
|
|
11489
|
+
}
|
|
11490
|
+
const filename = file ? basename2(file) : basename2(decodeURIComponent(source.pathname));
|
|
11491
|
+
if (!filename || filename === "/") throw new Error("provide a filename for this download URL");
|
|
11492
|
+
body = { filename, source_url: opts.url };
|
|
11493
|
+
} else {
|
|
11494
|
+
if (!file) throw new Error("provide a local file or --url URL");
|
|
11495
|
+
if (statSync2(file).size > 20 * 1024 * 1024) throw new Error("file exceeds the 20 MiB limit; use --url for larger files");
|
|
11496
|
+
const content = readFileSync5(file);
|
|
11497
|
+
if (!content.length) throw new Error("attachment file is empty");
|
|
11498
|
+
if (content.length > 20 * 1024 * 1024) throw new Error("file exceeds the 20 MiB limit; use --url for larger files");
|
|
11499
|
+
body = { filename: basename2(file), content_base64: content.toString("base64") };
|
|
11500
|
+
}
|
|
11488
11501
|
print(
|
|
11489
11502
|
await new ErdoClient().attachKnowledgeAsset(objectId, {
|
|
11490
11503
|
...body,
|
|
11491
11504
|
description: opts.description,
|
|
11505
|
+
caption: opts.caption,
|
|
11506
|
+
role: opts.role,
|
|
11492
11507
|
media_type: opts.mediaType
|
|
11493
11508
|
})
|
|
11494
11509
|
);
|
|
@@ -11535,7 +11550,7 @@ function scheduleBound(flag, v) {
|
|
|
11535
11550
|
}
|
|
11536
11551
|
autoCmd.command("create <name>").description(
|
|
11537
11552
|
"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"
|
|
11538
|
-
).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("--effort <level>", "Reasoning effort: low, medium, or high (workflow executor defaults to high)").choices(["low", "medium", "high"])).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(
|
|
11553
|
+
).option("--description <text>", "What the automation does").option("--instructions <text>", "Instructions for each run (agent automation), or @path to a UTF-8 file").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("--effort <level>", "Reasoning effort: low, medium, or high (workflow executor defaults to high)").choices(["low", "medium", "high"])).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(
|
|
11539
11554
|
async (name, opts) => {
|
|
11540
11555
|
try {
|
|
11541
11556
|
if (opts.scriptJs && opts.scriptFile) {
|
|
@@ -11546,7 +11561,7 @@ autoCmd.command("create <name>").description(
|
|
|
11546
11561
|
const h = await new ErdoClient().createHeartbeat({
|
|
11547
11562
|
name,
|
|
11548
11563
|
description: opts.description,
|
|
11549
|
-
instructions: opts.instructions,
|
|
11564
|
+
instructions: readMaybeFile(opts.instructions),
|
|
11550
11565
|
script_js: scriptJs,
|
|
11551
11566
|
interval_minutes: opts.interval,
|
|
11552
11567
|
timezone: opts.timezone,
|
|
@@ -11641,7 +11656,7 @@ autoCmd.command("run <id>").description("Trigger an automation now").option("--m
|
|
|
11641
11656
|
fail(e);
|
|
11642
11657
|
}
|
|
11643
11658
|
});
|
|
11644
|
-
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule (--cron for a scheduled job, --interval/--at for a heartbeat), 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").addOption(new Option2("--effort <level>", "Reasoning effort: low, medium, or high. Omit to keep the current value").choices(["low", "medium", "high"])).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(
|
|
11659
|
+
autoCmd.command("update <id>").description("Edit an automation \u2014 rename, reschedule (--cron for a scheduled job, --interval/--at for a heartbeat), or replace its script/instructions").option("--name <name>", "New name").option("--description <text>", "New description").option("--instructions <text>", "Replacement instructions (agent automation), or @path to a UTF-8 file").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").addOption(new Option2("--effort <level>", "Reasoning effort: low, medium, or high. Omit to keep the current value").choices(["low", "medium", "high"])).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(
|
|
11645
11660
|
"--script-file <path>",
|
|
11646
11661
|
"Read the replacement script body from a file (scripted automation)"
|
|
11647
11662
|
).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").addOption(new Option2("--clear-persona", "Remove the explicit persona binding; template attribution may still apply").conflicts("personaId")).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)").option("--cron <expr>", 'New schedule for a cron-scheduled automation, read in --timezone (or its saved one), e.g. "0 17 * * 5" for Fridays at 17:00. Edits the same automation in place').option("--cron-trigger <id>", "Which cron trigger to change, when the automation has more than one (see list)").action(
|
|
@@ -11671,7 +11686,7 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
|
|
|
11671
11686
|
const body = {
|
|
11672
11687
|
name: opts.name,
|
|
11673
11688
|
description: opts.description,
|
|
11674
|
-
instructions: opts.instructions,
|
|
11689
|
+
instructions: readMaybeFile(opts.instructions),
|
|
11675
11690
|
agent_key: opts.agentKey,
|
|
11676
11691
|
model: opts.model,
|
|
11677
11692
|
effort: opts.effort,
|