@erdoai/cli 0.190.0 → 0.193.1

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/README.md CHANGED
@@ -114,6 +114,7 @@ erdo agent ask "what was revenue last week?" --datasets sales
114
114
  erdo threads create --name "landing build" # -> thread id
115
115
  erdo agent send <thread> "Build a landing page for ACME ..." --agent erdo.artifact-builder
116
116
  erdo agent send <thread> "What should I do next?" --context "Current screen: checkout experiment"
117
+ erdo agent send <thread> "Summarize the existing data" --read-only
117
118
 
118
119
  erdo pages deploy --title "ACME" --html @page.html --js @page.js --public
119
120
  erdo pages list --type html_page
@@ -122,6 +123,9 @@ erdo pages get <artifact-id>
122
123
 
123
124
  `--html/--js/--css` accept `@path` to read a file. Sending a message to a thread
124
125
  runs an agent — that's also how the artifact-builder produces a page from a brief.
126
+ Use `--read-only` to limit the default `erdo.data-question-answerer` turn to
127
+ read-only agent tools. Other agents are rejected, and the flag is omitted by
128
+ default so existing sends retain their behavior.
125
129
 
126
130
  ```bash
127
131
  erdo runs list --agent erdo.artifact-builder --status failed # inspect agent runs
package/dist/index.js CHANGED
@@ -4943,7 +4943,7 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
4943
4943
  ).option(
4944
4944
  "--sync",
4945
4945
  "hold one long HTTP request open until the run finishes, instead of polling. Faster for quick questions; a proxy will time it out on any run over ~100s while the run continues server-side"
4946
- ).action(async (threadId, message, opts) => {
4946
+ ).option("--read-only", "restrict the default data-question-answerer turn to read-only tools").action(async (threadId, message, opts) => {
4947
4947
  try {
4948
4948
  const client = new ErdoClient();
4949
4949
  const baselineRunID = opts.sync ? void 0 : await client.latestRunID(threadId);
@@ -4951,7 +4951,8 @@ agentCmd.command("send <threadId> <message>").description("Send a message to a t
4951
4951
  message: readMaybeFile(message) ?? "",
4952
4952
  context: readMaybeFile(opts.context),
4953
4953
  agent_key: opts.agent,
4954
- async: !opts.sync
4954
+ async: !opts.sync,
4955
+ read_only: opts.readOnly
4955
4956
  });
4956
4957
  if (res.error) throw new Error(res.error);
4957
4958
  if (opts.sync) {
@@ -10417,7 +10418,23 @@ knowledgeAssetsCmd.command("list <objectId>").description("List files attached t
10417
10418
  });
10418
10419
  var autoCmd = program.command("automations").description("Scheduled automations (heartbeats)");
10419
10420
  function heartbeatBounds(h) {
10420
- return `${h.run_at ? ` run_at:${h.run_at}` : ""}${h.ends_at ? ` ends_at:${h.ends_at}` : ""}`;
10421
+ const at = h.anchor_time ? ` at:${h.anchor_time}${h.timezone ? ` ${h.timezone}` : ""}` : "";
10422
+ const after = h.run_after_id ? ` after:${h.run_after_id}` : "";
10423
+ return `${at}${after}${h.run_at ? ` run_at:${h.run_at}` : ""}${h.ends_at ? ` ends_at:${h.ends_at}` : ""}`;
10424
+ }
10425
+ function clockTime(flag, v) {
10426
+ if (v === void 0) return void 0;
10427
+ const value = v.trim();
10428
+ if (!/^([01]\d|2[0-3]):[0-5]\d$/.test(value)) {
10429
+ throw new Error(`${flag} must be a 24-hour clock time such as 21:02 \u2014 got ${JSON.stringify(v)}`);
10430
+ }
10431
+ return value;
10432
+ }
10433
+ function afterWhenFlag(v) {
10434
+ if (v === void 0) return void 0;
10435
+ if (v === "success") return true;
10436
+ if (v === "finished") return false;
10437
+ throw new Error(`--after-when must be "success" or "finished" \u2014 got ${JSON.stringify(v)}`);
10421
10438
  }
10422
10439
  function scheduleBound(flag, v) {
10423
10440
  if (v === void 0) return void 0;
@@ -10429,7 +10446,7 @@ function scheduleBound(flag, v) {
10429
10446
  }
10430
10447
  autoCmd.command("create <name>").description(
10431
10448
  "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"
10432
- ).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("--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(
10449
+ ).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(
10433
10450
  async (name, opts) => {
10434
10451
  try {
10435
10452
  if (opts.scriptJs && opts.scriptFile) {
@@ -10444,6 +10461,11 @@ autoCmd.command("create <name>").description(
10444
10461
  script_js: scriptJs,
10445
10462
  interval_minutes: opts.interval,
10446
10463
  timezone: opts.timezone,
10464
+ anchor_time: clockTime("--at", opts.at),
10465
+ run_after_id: opts.runAfter,
10466
+ run_after_on_success: afterWhenFlag(opts.afterWhen),
10467
+ run_after_delay_minutes: opts.afterDelay,
10468
+ run_after_replaces_schedule: opts.insteadOfSchedule ? true : void 0,
10447
10469
  run_at: scheduleBound("--run-at", opts.runAt),
10448
10470
  ends_at: scheduleBound("--ends-at", opts.endsAt),
10449
10471
  agent_key: opts.agentKey,
@@ -10486,7 +10508,7 @@ autoCmd.command("run <id>").description("Trigger an automation now").action(asyn
10486
10508
  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(
10487
10509
  "--script-file <path>",
10488
10510
  "Read the replacement script body from a file (scripted automation)"
10489
- ).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("--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(
10511
+ ).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(
10490
10512
  async (id, opts) => {
10491
10513
  try {
10492
10514
  if (opts.scriptJs && opts.scriptFile) {
@@ -10494,6 +10516,18 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
10494
10516
  return;
10495
10517
  }
10496
10518
  const scriptJs = opts.scriptFile ? readFileSync4(opts.scriptFile, "utf8") : opts.scriptJs;
10519
+ if (opts.at !== void 0 && opts.clearAt) {
10520
+ fail(new Error("pass either --at or --clear-at, not both"));
10521
+ return;
10522
+ }
10523
+ if (opts.runAfter && opts.clearRunAfter) {
10524
+ fail(new Error("pass either --run-after or --clear-run-after, not both"));
10525
+ return;
10526
+ }
10527
+ if (opts.insteadOfSchedule && opts.keepSchedule) {
10528
+ fail(new Error("pass either --instead-of-schedule or --keep-schedule, not both"));
10529
+ return;
10530
+ }
10497
10531
  const body = {
10498
10532
  name: opts.name,
10499
10533
  description: opts.description,
@@ -10502,6 +10536,11 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
10502
10536
  script_js: scriptJs,
10503
10537
  interval_minutes: opts.interval,
10504
10538
  timezone: opts.timezone,
10539
+ anchor_time: opts.clearAt ? "" : clockTime("--at", opts.at),
10540
+ run_after_id: opts.clearRunAfter ? "" : opts.runAfter,
10541
+ run_after_on_success: afterWhenFlag(opts.afterWhen),
10542
+ run_after_delay_minutes: opts.afterDelay,
10543
+ run_after_replaces_schedule: opts.insteadOfSchedule ? true : opts.keepSchedule ? false : void 0,
10505
10544
  run_at: scheduleBound("--run-at", opts.runAt),
10506
10545
  ends_at: scheduleBound("--ends-at", opts.endsAt),
10507
10546
  conversation: opts.conversation,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.190.0",
4
- "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.193.1",
4
+ "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "erdo": "dist/index.js"