@erdoai/cli 0.193.1 → 0.195.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.
Files changed (2) hide show
  1. package/dist/index.js +36 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1515,6 +1515,9 @@ var ErdoClient = class {
1515
1515
  setProviderLeadSource(input) {
1516
1516
  return this.request("PUT", "/v1/provider-lead-sources", input, false);
1517
1517
  }
1518
+ upsertDeclaration(input) {
1519
+ return this.request("PUT", "/v1/declarations", input, false);
1520
+ }
1518
1521
  importLeadSourceRows(input) {
1519
1522
  return this.request("POST", "/v1/provider-lead-sources/import", input, false);
1520
1523
  }
@@ -2089,8 +2092,8 @@ var ErdoClient = class {
2089
2092
  createHeartbeat(body) {
2090
2093
  return this.request("POST", "/v1/heartbeats", body);
2091
2094
  }
2092
- runHeartbeat(id) {
2093
- return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, {});
2095
+ runHeartbeat(id, body) {
2096
+ return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, body ?? {});
2094
2097
  }
2095
2098
  listHeartbeatExecutions(id, limit = 10) {
2096
2099
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
@@ -10306,6 +10309,25 @@ pipelinesCmd.command("mark-handled <slug>").description("Record that failed exec
10306
10309
  fail(e);
10307
10310
  }
10308
10311
  });
10312
+ var declarationsCmd = program.command("declarations").description("Metric and other declarations an app commits for this organization");
10313
+ declarationsCmd.command("upsert").description("Write one declaration. The same namespace, kind, key and scope update the existing row").requiredOption("--namespace <namespace>", "the owning app's namespace").requiredOption("--kind <kind>", "declaration kind, for example metric").requiredOption("--key <key>", "what is declared, for example spend").option("--meaning <meaning>", "the expression; leave empty with --adopt to take the connector template").option("--status <status>", "confirmed only after the owning app merged it through a reviewed pull request; anything else is a draft", "draft").option("--source <source>", "synced source the declaration covers (requires --table)").option("--table <table>", "synced table the declaration covers (requires --source)").option("--adopt", "copy the connector template for this kind, key, source and table").option("--reasoning <text>", "why").option("--confidence <level>", "confidence in a proposal").action(async (opts) => {
10314
+ try {
10315
+ if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
10316
+ print(await new ErdoClient().upsertDeclaration({
10317
+ namespace: opts.namespace,
10318
+ kind: opts.kind,
10319
+ key: opts.key,
10320
+ meaning: opts.meaning ?? "",
10321
+ status: opts.status,
10322
+ reasoning: opts.reasoning,
10323
+ confidence: opts.confidence,
10324
+ adopt: opts.adopt,
10325
+ scope: opts.source && opts.table ? { source: opts.source, table: opts.table } : void 0
10326
+ }));
10327
+ } catch (e) {
10328
+ fail(e);
10329
+ }
10330
+ });
10309
10331
  var knowledgeCmd = program.command("knowledge").description("Knowledge objects");
10310
10332
  knowledgeCmd.command("create").description("Create a Knowledge object").requiredOption("--title <title>", "title").requiredOption("--body <body>", "body text, or @file").option("--description <description>", "short description").option("--type <type>", "snippet or skill", "snippet").option("--category <category>", "category").option("--tags <tags>", "comma-separated tags").option("--agent <name>", "name of the agent making the write").action(async (opts) => {
10311
10333
  try {
@@ -10446,7 +10468,7 @@ function scheduleBound(flag, v) {
10446
10468
  }
10447
10469
  autoCmd.command("create <name>").description(
10448
10470
  "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"
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(
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"])).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(
10450
10472
  async (name, opts) => {
10451
10473
  try {
10452
10474
  if (opts.scriptJs && opts.scriptFile) {
@@ -10469,6 +10491,7 @@ autoCmd.command("create <name>").description(
10469
10491
  run_at: scheduleBound("--run-at", opts.runAt),
10470
10492
  ends_at: scheduleBound("--ends-at", opts.endsAt),
10471
10493
  agent_key: opts.agentKey,
10494
+ model: opts.model,
10472
10495
  conversation: opts.conversation,
10473
10496
  thread_id: opts.threadId,
10474
10497
  persona_id: opts.personaId
@@ -10482,7 +10505,7 @@ autoCmd.command("create <name>").description(
10482
10505
  autoCmd.command("list").description("List automations").action(async () => {
10483
10506
  try {
10484
10507
  const { heartbeats } = await new ErdoClient().listHeartbeats();
10485
- 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)}`);
10508
+ 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)}`);
10486
10509
  } catch (e) {
10487
10510
  fail(e);
10488
10511
  }
@@ -10498,14 +10521,14 @@ autoCmd.command("executions <id>").description("Read recent execution history fo
10498
10521
  fail(e);
10499
10522
  }
10500
10523
  });
10501
- autoCmd.command("run <id>").description("Trigger an automation now").action(async (id) => {
10524
+ 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) => {
10502
10525
  try {
10503
- print(await new ErdoClient().runHeartbeat(id));
10526
+ print(await new ErdoClient().runHeartbeat(id, opts.model ? { model: opts.model } : void 0));
10504
10527
  } catch (e) {
10505
10528
  fail(e);
10506
10529
  }
10507
10530
  });
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(
10531
+ 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(
10509
10532
  "--script-file <path>",
10510
10533
  "Read the replacement script body from a file (scripted automation)"
10511
10534
  ).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(
@@ -10515,6 +10538,10 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
10515
10538
  fail(new Error("pass either --script-js or --script-file, not both"));
10516
10539
  return;
10517
10540
  }
10541
+ if (opts.model && opts.clearModel) {
10542
+ fail(new Error("pass either --model or --clear-model, not both"));
10543
+ return;
10544
+ }
10518
10545
  const scriptJs = opts.scriptFile ? readFileSync4(opts.scriptFile, "utf8") : opts.scriptJs;
10519
10546
  if (opts.at !== void 0 && opts.clearAt) {
10520
10547
  fail(new Error("pass either --at or --clear-at, not both"));
@@ -10533,6 +10560,8 @@ autoCmd.command("update <id>").description("Edit an automation \u2014 rename, re
10533
10560
  description: opts.description,
10534
10561
  instructions: opts.instructions,
10535
10562
  agent_key: opts.agentKey,
10563
+ model: opts.model,
10564
+ clear_model: opts.clearModel,
10536
10565
  script_js: scriptJs,
10537
10566
  interval_minutes: opts.interval,
10538
10567
  timezone: opts.timezone,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.193.1",
4
- "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.195.0",
4
+ "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "erdo": "dist/index.js"