@erdoai/cli 0.280.0 → 0.281.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 +47 -22
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -916,6 +916,7 @@ var ErdoClient = class {
916
916
  if (params?.limit) q.set("limit", String(params.limit));
917
917
  if (params?.leadRef) q.set("lead_ref", params.leadRef);
918
918
  if (params?.dataset) q.set("dataset", params.dataset);
919
+ if (params?.cursor) q.set("cursor", params.cursor);
919
920
  const qs = q.toString();
920
921
  return this.request(
921
922
  "GET",
@@ -935,6 +936,7 @@ var ErdoClient = class {
935
936
  if (params?.search) q.set("search", params.search);
936
937
  if (params?.limit) q.set("limit", String(params.limit));
937
938
  if (params?.offset) q.set("offset", String(params.offset));
939
+ if (params?.cursor) q.set("cursor", params.cursor);
938
940
  const qs = q.toString();
939
941
  return this.request("GET", `/v1/emails${qs ? `?${qs}` : ""}`);
940
942
  }
@@ -1695,6 +1697,7 @@ var ErdoClient = class {
1695
1697
  if (params?.createdBefore) q.set("created_before", params.createdBefore);
1696
1698
  if (params?.limit !== void 0) q.set("limit", String(params.limit));
1697
1699
  if (params?.offset !== void 0) q.set("offset", String(params.offset));
1700
+ if (params?.cursor) q.set("cursor", params.cursor);
1698
1701
  const qs = q.toString();
1699
1702
  return this.request("GET", `/v1/threads${qs ? `?${qs}` : ""}`);
1700
1703
  }
@@ -1748,8 +1751,10 @@ var ErdoClient = class {
1748
1751
  }
1749
1752
  getDatasetRowActions(slug, opts) {
1750
1753
  const q = new URLSearchParams({ dataset: slug });
1754
+ if (opts?.name) q.set("name", opts.name);
1751
1755
  if (opts?.include_receipts) q.set("include_receipts", "true");
1752
1756
  if (opts?.include_unresolved) q.set("include_unresolved", "true");
1757
+ if (opts?.cursor) q.set("cursor", opts.cursor);
1753
1758
  return this.request("GET", `/v1/dataset-row-actions?${q.toString()}`);
1754
1759
  }
1755
1760
  setDatasetRowAction(input) {
@@ -2431,10 +2436,11 @@ var ErdoClient = class {
2431
2436
  updateEventPipeline(slug, body) {
2432
2437
  return this.request("PUT", `/v1/event-pipelines/${encodeURIComponent(slug)}`, body);
2433
2438
  }
2434
- listEventPipelineExecutions(slug, limit, offset) {
2439
+ listEventPipelineExecutions(slug, limit, offset, cursor) {
2435
2440
  const q = new URLSearchParams();
2436
2441
  if (limit) q.set("limit", String(limit));
2437
2442
  if (offset) q.set("offset", String(offset));
2443
+ if (cursor) q.set("cursor", cursor);
2438
2444
  const qs = q.toString();
2439
2445
  return this.request(
2440
2446
  "GET",
@@ -2524,11 +2530,13 @@ var ErdoClient = class {
2524
2530
  runHeartbeat(id, body) {
2525
2531
  return this.request("POST", `/v1/heartbeats/${encodeURIComponent(id)}/run`, body ?? {});
2526
2532
  }
2527
- listHeartbeatExecutions(id, limit = 10) {
2533
+ listHeartbeatExecutions(id, limit = 10, cursor) {
2528
2534
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
2529
2535
  throw new Error("limit must be an integer between 1 and 100");
2530
2536
  }
2531
- return this.request("GET", `/v1/heartbeats/${encodeURIComponent(id)}/executions?limit=${limit}`);
2537
+ const q = new URLSearchParams({ limit: String(limit) });
2538
+ if (cursor) q.set("cursor", cursor);
2539
+ return this.request("GET", `/v1/heartbeats/${encodeURIComponent(id)}/executions?${q.toString()}`);
2532
2540
  }
2533
2541
  updateHeartbeat(id, body) {
2534
2542
  return this.request(
@@ -2601,6 +2609,7 @@ var ErdoClient = class {
2601
2609
  if (opts.thread) params.set("thread_id", opts.thread);
2602
2610
  if (opts.status) params.set("status", opts.status);
2603
2611
  if (opts.limit) params.set("limit", String(opts.limit));
2612
+ if (opts.cursor) params.set("cursor", opts.cursor);
2604
2613
  const qs = params.toString();
2605
2614
  return this.request("GET", `/v1/runs${qs ? `?${qs}` : ""}`);
2606
2615
  }
@@ -2756,10 +2765,11 @@ var ErdoClient = class {
2756
2765
  getArtifact(id) {
2757
2766
  return this.request("GET", `/v1/artifacts/${encodeURIComponent(id)}`);
2758
2767
  }
2759
- listEvalRuns(suiteSlug, limit) {
2768
+ listEvalRuns(suiteSlug, limit, cursor) {
2760
2769
  const params = new URLSearchParams();
2761
2770
  if (suiteSlug) params.set("suite_slug", suiteSlug);
2762
2771
  if (limit) params.set("limit", String(limit));
2772
+ if (cursor) params.set("cursor", cursor);
2763
2773
  const qs = params.toString();
2764
2774
  return this.request("GET", `/v1/evals/runs${qs ? `?${qs}` : ""}`);
2765
2775
  }
@@ -5208,14 +5218,16 @@ evalCmd.command("results <runId>").description("Show a run's results").option("-
5208
5218
  fail(e);
5209
5219
  }
5210
5220
  });
5211
- evalCmd.command("runs").description("List recent runs").option("-s, --suite <slug>", "filter to one suite").option("-l, --limit <n>", "max runs", (v) => parseInt(v, 10)).action(async (opts) => {
5221
+ evalCmd.command("runs").description("List recent runs").option("-s, --suite <slug>", "filter to one suite").option("-l, --limit <n>", "max runs", (v) => parseInt(v, 10)).option("--cursor <cursor>", "next_cursor from the preceding page").action(async (opts) => {
5212
5222
  try {
5213
- const { runs } = await new ErdoClient().listEvalRuns(opts.suite, opts.limit);
5223
+ const { runs, has_more, next_cursor } = await new ErdoClient().listEvalRuns(opts.suite, opts.limit, opts.cursor);
5214
5224
  for (const r of runs) {
5215
5225
  console.log(
5216
5226
  `${r.id} ${r.status} ${r.passed_cases}/${r.total_cases} avg ${r.avg_score.toFixed(2)} ${compactEvalRunAttribution(r)}`
5217
5227
  );
5218
5228
  }
5229
+ if (has_more && next_cursor) process.stderr.write(`more available \u2014 re-run with --cursor ${next_cursor}
5230
+ `);
5219
5231
  } catch (e) {
5220
5232
  fail(e);
5221
5233
  }
@@ -5504,9 +5516,9 @@ async function resolveConversationPersona(client, selector) {
5504
5516
  throw new Error(`No enabled agent matches "${selector}"`);
5505
5517
  }
5506
5518
  var conversationsCmd = program.command("threads").description("List and open conversations with people and named agents");
5507
- conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("--since <iso>", "include conversations created at or after this RFC3339 timestamp").option("--until <iso>", "include conversations created before this RFC3339 timestamp").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
5519
+ conversationsCmd.command("list").description("List conversations with the latest message, speaker, unread status and open questions").option("-s, --scope <scope>", "own (default) | org | shared | all \u2014 org/shared require org membership").option("--order-by <order>", "created_at (default) | activity (last message time) \u2014 scope=org/shared only").option("--include-automation", "include automation/heartbeat-sourced threads \u2014 scope=org/shared only").option("--origin <origin>", "person (default) | erdo (automation and Shortcut runs) | all \u2014 scope=org/shared only").option("--since <iso>", "include conversations created at or after this RFC3339 timestamp").option("--until <iso>", "include conversations created before this RFC3339 timestamp").option("-l, --limit <n>", "max conversations (default 20, max 100)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option("--cursor <cursor>", "next_cursor from the preceding creation-ordered page").action(async (opts) => {
5508
5520
  try {
5509
- const { threads, total } = await new ErdoClient().listThreads({
5521
+ const { threads, total, has_more, next_cursor } = await new ErdoClient().listThreads({
5510
5522
  ...opts,
5511
5523
  createdAfter: opts.since,
5512
5524
  createdBefore: opts.until
@@ -5518,7 +5530,10 @@ conversationsCmd.command("list").description("List conversations with the latest
5518
5530
  console.log(`${thread.id} ${thread.name || ""} ${creator} ${thread.source || "unrecorded"} ${thread.unread ? "unread" : "read"} ${speaker} ${preview} questions=${thread.open_question_count ?? 0}`);
5519
5531
  }
5520
5532
  const shown = (opts.offset ?? 0) + threads.length;
5521
- console.error(total > shown ? `(showing ${threads.length} of ${total} \u2014 use --limit/--offset for more)` : `(${total} conversation${total === 1 ? "" : "s"})`);
5533
+ if (has_more && next_cursor) console.error(`more available \u2014 re-run with --cursor ${next_cursor}`);
5534
+ else if (opts.orderBy === "activity") {
5535
+ console.error(total > shown ? `(showing ${threads.length} of ${total} \u2014 use --limit/--offset for more; activity order has no cursor)` : `(${total} conversation${total === 1 ? "" : "s"})`);
5536
+ } else console.error(`(${total} conversation${total === 1 ? "" : "s"})`);
5522
5537
  } catch (e) {
5523
5538
  fail(e);
5524
5539
  }
@@ -5657,10 +5672,12 @@ agentCmd.command("messages <threadId>").description("Show a thread's messages (r
5657
5672
  }
5658
5673
  });
5659
5674
  var runsCmd = program.command("runs").description("Inspect agent runs");
5660
- runsCmd.command("list").description("List agent runs; select an exact invocation, optionally constrained by agent OR thread").option("--invocation <id>", "select the exact root run for an invocation").option("-a, --agent <key>", "filter by agent key").option("-t, --thread <id>", "filter to a thread").option("-s, --status <status>", "filter by status (running, completed, failed, cancelled, pending)").option("-l, --limit <n>", "max runs", (v) => parseInt(v, 10)).action(async (opts) => {
5675
+ runsCmd.command("list").description("List agent runs; select an exact invocation, optionally constrained by agent OR thread").option("--invocation <id>", "select the exact root run for an invocation").option("-a, --agent <key>", "filter by agent key").option("-t, --thread <id>", "filter to a thread").option("-s, --status <status>", "filter by status (running, completed, failed, cancelled, pending)").option("-l, --limit <n>", "max runs", (v) => parseInt(v, 10)).option("--cursor <cursor>", "next_cursor from the preceding page").action(async (opts) => {
5661
5676
  try {
5662
- const { runs } = await new ErdoClient().listAgentRuns(opts);
5677
+ const { runs, has_more, next_cursor } = await new ErdoClient().listAgentRuns(opts);
5663
5678
  for (const r of runs) console.log(`${r.id} ${r.status} ${r.agent_key}`);
5679
+ if (has_more && next_cursor) process.stderr.write(`more available \u2014 re-run with --cursor ${next_cursor}
5680
+ `);
5664
5681
  } catch (e) {
5665
5682
  fail(e);
5666
5683
  }
@@ -7488,19 +7505,22 @@ sendingDomainsCmd.command("remove <domain>").description(
7488
7505
  });
7489
7506
  emailCmd.command("received").description(
7490
7507
  "Read the mail that arrived at the org's sending domain, newest first \u2014 usually leads replying to outreach an agent sent. Omit --domain: an org has one sending domain and the read resolves it."
7491
- ).option("--domain <domain>", "the sending domain to read (only needed if the org has more than one)").option("--limit <n>", "maximum messages to return, newest first").option("--lead-ref <ref>", "only one lead's email conversation with the desk").option("--dataset <slug>", "with --lead-ref, only that lead dataset").option("--json", "print the raw JSON result instead of the message list").action(async (opts) => {
7508
+ ).option("--domain <domain>", "the sending domain to read (only needed if the org has more than one)").option("--limit <n>", "maximum messages to return, newest first").option("--cursor <cursor>", "next_cursor from the preceding page").option("--lead-ref <ref>", "only one lead's email conversation with the desk").option("--dataset <slug>", "with --lead-ref, only that lead dataset").option("--json", "print the raw JSON result instead of the message list").action(async (opts) => {
7492
7509
  try {
7493
7510
  const res = await new ErdoClient().listReceivedEmails({
7494
7511
  domain: opts.domain,
7495
7512
  limit: opts.limit ? Number(opts.limit) : void 0,
7496
7513
  leadRef: opts.leadRef,
7497
- dataset: opts.dataset
7514
+ dataset: opts.dataset,
7515
+ cursor: opts.cursor
7498
7516
  });
7499
7517
  if (opts.json) {
7500
7518
  print(res);
7501
7519
  return;
7502
7520
  }
7503
7521
  const emails = res.emails ?? [];
7522
+ if (res.has_more && res.next_cursor) process.stderr.write(`more available \u2014 re-run with --cursor ${res.next_cursor}
7523
+ `);
7504
7524
  if (emails.length === 0) {
7505
7525
  console.log(
7506
7526
  `No mail has arrived at ${res.domain}. Replies only come back for a domain registered with receiving on and verified active \u2014 a sending-only domain sends them straight to its nominated mailbox, which is the configuration working rather than a fault.`
@@ -7544,7 +7564,7 @@ emailCmd.command("send").description("Send one transactional email from the org'
7544
7564
  }
7545
7565
  });
7546
7566
  var sentEmailsCmd = emailCmd.command("sent").description("Read the audited outbound email log and provider delivery evidence");
7547
- sentEmailsCmd.command("list").description("List sent email, newest first, including immutable delivered_at evidence").option("--to <email>", "only mail sent to this address").option("--since <timestamp>", "only mail created at or after this RFC 3339 timestamp").option("--search <text>", "case-insensitive subject substring").option("--limit <n>", "page size (default 25, max 200)").option("--offset <n>", "rows to skip").option("--json", "print the raw JSON result instead of a table").action(
7567
+ sentEmailsCmd.command("list").description("List sent email, newest first, including immutable delivered_at evidence").option("--to <email>", "only mail sent to this address").option("--since <timestamp>", "only mail created at or after this RFC 3339 timestamp").option("--search <text>", "case-insensitive subject substring").option("--limit <n>", "page size (default 25, max 200)").option("--offset <n>", "rows to skip").option("--cursor <cursor>", "next_cursor from the preceding page").option("--json", "print the raw JSON result instead of a table").action(
7548
7568
  async (opts) => {
7549
7569
  try {
7550
7570
  const res = await new ErdoClient().listSentEmails({
@@ -7552,13 +7572,16 @@ sentEmailsCmd.command("list").description("List sent email, newest first, includ
7552
7572
  since: opts.since,
7553
7573
  search: opts.search,
7554
7574
  limit: opts.limit ? Number(opts.limit) : void 0,
7555
- offset: opts.offset ? Number(opts.offset) : void 0
7575
+ offset: opts.offset ? Number(opts.offset) : void 0,
7576
+ cursor: opts.cursor
7556
7577
  });
7557
7578
  if (opts.json) {
7558
7579
  print(res);
7559
7580
  return;
7560
7581
  }
7561
7582
  const emails = res.emails ?? [];
7583
+ if (res.has_more && res.next_cursor) process.stderr.write(`more available \u2014 re-run with --cursor ${res.next_cursor}
7584
+ `);
7562
7585
  if (emails.length === 0) {
7563
7586
  console.log("No sent email matches those filters.");
7564
7587
  return;
@@ -7575,7 +7598,7 @@ sentEmailsCmd.command("list").description("List sent email, newest first, includ
7575
7598
  email.sent_at ?? ""
7576
7599
  ])
7577
7600
  );
7578
- process.stderr.write(`showing ${emails.length} of ${res.total} matching message(s)
7601
+ if (!res.has_more) process.stderr.write(`showing ${emails.length} of ${res.total} matching message(s)
7579
7602
  `);
7580
7603
  } catch (e) {
7581
7604
  fail(e);
@@ -8963,11 +8986,13 @@ providerLeadSourcesCmd.command("delete").description("Delete a lead source, by -
8963
8986
  }
8964
8987
  });
8965
8988
  var datasetRowActionsCmd = datasetsCmd.command("row-actions").description("Read and replace actions for arriving or excluded dataset rows");
8966
- datasetRowActionsCmd.command("get <slug>").description("Read the row-action declarations and optional bounded diagnostics for a dataset").option("--include-receipts", "include bounded provider receipt diagnostics").option("--include-unresolved", "include bounded unresolved lookup diagnostics").action(async (slug, opts) => {
8989
+ datasetRowActionsCmd.command("get <slug>").description("Read the row-action declarations and optional bounded diagnostics for a dataset").option("--name <name>", "read one declaration by name (required with --cursor)").option("--include-receipts", "include bounded provider receipt diagnostics").option("--cursor <cursor>", "continue the provider receipt page returned by the previous read").option("--include-unresolved", "include bounded unresolved lookup diagnostics").action(async (slug, opts) => {
8967
8990
  try {
8968
8991
  print(await new ErdoClient().getDatasetRowActions(slug, {
8992
+ ...opts.name ? { name: opts.name } : {},
8969
8993
  ...opts.includeReceipts ? { include_receipts: true } : {},
8970
- ...opts.includeUnresolved ? { include_unresolved: true } : {}
8994
+ ...opts.includeUnresolved ? { include_unresolved: true } : {},
8995
+ ...opts.cursor ? { cursor: opts.cursor } : {}
8971
8996
  }));
8972
8997
  } catch (e) {
8973
8998
  fail(e);
@@ -11621,9 +11646,9 @@ filterCmd.command("remove <slug> <filterId>").description("Remove a filter from
11621
11646
  fail(e);
11622
11647
  }
11623
11648
  });
11624
- pipelinesCmd.command("executions <slug>").description("Show an event pipeline's recent run history (newest first)").option("-n, --limit <n>", "max executions", (v) => parseInt(v, 10)).action(async (slug, opts) => {
11649
+ pipelinesCmd.command("executions <slug>").description("Show an event pipeline's recent run history (newest first)").option("-n, --limit <n>", "max executions", (v) => parseInt(v, 10)).option("--cursor <cursor>", "next_cursor from the preceding page").action(async (slug, opts) => {
11625
11650
  try {
11626
- print(await new ErdoClient().listEventPipelineExecutions(slug, opts.limit));
11651
+ print(await new ErdoClient().listEventPipelineExecutions(slug, opts.limit, void 0, opts.cursor));
11627
11652
  } catch (e) {
11628
11653
  fail(e);
11629
11654
  }
@@ -11990,13 +12015,13 @@ autoCmd.command("show <id>").description("Show one automation's state, schedule,
11990
12015
  fail(e);
11991
12016
  }
11992
12017
  });
11993
- autoCmd.command("executions <id>").description("Read recent execution history for one automation or refresh job").option("--limit <n>", "Number of executions (integer 1\u2013100)", "10").action(async (id, opts) => {
12018
+ autoCmd.command("executions <id>").description("Read recent execution history for one automation or refresh job").option("--limit <n>", "Number of executions (integer 1\u2013100)", "10").option("--cursor <cursor>", "next_cursor from the preceding page").action(async (id, opts) => {
11994
12019
  try {
11995
12020
  const limit = Number(opts.limit);
11996
12021
  if (!/^\d+$/.test(opts.limit) || !Number.isInteger(limit) || limit < 1 || limit > 100) {
11997
12022
  throw new Error("limit must be an integer between 1 and 100");
11998
12023
  }
11999
- print(await new ErdoClient().listHeartbeatExecutions(id, limit));
12024
+ print(await new ErdoClient().listHeartbeatExecutions(id, limit, opts.cursor));
12000
12025
  } catch (e) {
12001
12026
  fail(e);
12002
12027
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.280.0",
4
- "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.281.0",
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"