@erdoai/cli 0.111.0 → 0.112.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 +49 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1293,6 +1293,15 @@ var ErdoClient = class {
1293
1293
  input
1294
1294
  );
1295
1295
  }
1296
+ // Ends the lead's hold or close now, so the engine decides for it again on
1297
+ // its next pass. Answers the hold or close with resumed_at set.
1298
+ resumeLeadNextActions(datasetSlug, lead) {
1299
+ return this.request(
1300
+ "POST",
1301
+ `/v1/datasets/${encodeURIComponent(datasetSlug)}/leads/${encodeURIComponent(lead)}/next-actions/resume`,
1302
+ {}
1303
+ );
1304
+ }
1296
1305
  // Everything the evaluation reads about one lead.
1297
1306
  getLeadTimeline(datasetSlug, lead) {
1298
1307
  return this.request(
@@ -7346,7 +7355,7 @@ leadPlaybookCmd.command("revision <revision>").description(
7346
7355
  }
7347
7356
  });
7348
7357
  leadsCmd.command("timeline <dataset> <lead>").description(
7349
- "Show everything the next-action evaluation reads about one lead: captures, sent emails, replies, SMS, calls, website chats, bookings and earlier suggestions in time order, plus the timing facts a follow-up rule matches on. <lead> is the canonical_lead_id UUID or the 22-character lead reference."
7358
+ "Show everything the next-action evaluation reads about one lead: their current and earlier answers, context-only row columns, captures, sent emails, replies, SMS, calls, website chats, bookings and earlier suggestions in time order, plus the timing facts a follow-up rule matches on. <lead> is the canonical_lead_id UUID or the 22-character lead reference."
7350
7359
  ).option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
7351
7360
  try {
7352
7361
  const res = await new ErdoClient().getLeadTimeline(dataset, lead);
@@ -7357,6 +7366,31 @@ leadsCmd.command("timeline <dataset> <lead>").description(
7357
7366
  console.log(`lead ${res.canonical_lead_id}`);
7358
7367
  console.log(`reference ${res.lead_reference}`);
7359
7368
  console.log(`dataset ${res.dataset_slug}`);
7369
+ if (res.details?.length) {
7370
+ console.log("\ndetails");
7371
+ printAlignedTable(
7372
+ ["question", "answer", "source", "when", "quote"],
7373
+ res.details.flatMap((detail) => [
7374
+ [detail.label || detail.key, detail.value, detail.source_kind, detail.observed_at, detail.quote ?? ""],
7375
+ ...(detail.earlier ?? []).map((earlier) => [
7376
+ "\u21B3 earlier",
7377
+ earlier.value,
7378
+ earlier.source_kind,
7379
+ earlier.observed_at,
7380
+ earlier.quote ?? ""
7381
+ ])
7382
+ ])
7383
+ );
7384
+ } else {
7385
+ console.log("\nNo lead details.");
7386
+ }
7387
+ if (res.context_columns?.length) {
7388
+ console.log("\ncontext columns (not lead answers)");
7389
+ printAlignedTable(
7390
+ ["column", "value"],
7391
+ res.context_columns.map((column) => [column, res.row?.[column] ?? ""])
7392
+ );
7393
+ }
7360
7394
  if (res.entries?.length) {
7361
7395
  console.log("\nentries");
7362
7396
  printAlignedTable(
@@ -7492,6 +7526,20 @@ leadNextActionsCmd.command("close <dataset> <lead>").description(
7492
7526
  fail(e);
7493
7527
  }
7494
7528
  });
7529
+ leadNextActionsCmd.command("resume <dataset> <lead>").description(
7530
+ "End the lead's hold or close now, so Erdo works the lead again. Nothing is sent from here: Erdo decides for the lead on its next pass, within about fifteen minutes. Refused when the lead is not held or closed."
7531
+ ).option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
7532
+ try {
7533
+ const res = await new ErdoClient().resumeLeadNextActions(dataset, lead);
7534
+ if (opts.json) {
7535
+ print(res);
7536
+ return;
7537
+ }
7538
+ console.log(`Resumed lead ${res.lead_reference}: its ${res.action_kind} ended at ${res.resumed_at ?? "now"}. Erdo decides for it on its next pass.`);
7539
+ } catch (e) {
7540
+ fail(e);
7541
+ }
7542
+ });
7495
7543
  leadNextActionsCmd.command("evaluate <dataset> <lead>").description(
7496
7544
  "Dry-run the playbook on one lead: show the decision Erdo would make now, with the email or handoff it would write, the rule it cites and why. Nothing is stored and nothing is sent. --file tries a draft playbook instead of the saved one."
7497
7545
  ).option("-f, --file <path>", "a draft playbook text to evaluate with instead of the saved one").option("--agent-id <id>", "try the draft as that concierge, from `erdo voice agents`; only read alongside --file").option("--json", "print the raw JSON result instead of a summary").action(async (dataset, lead, opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.111.0",
3
+ "version": "0.112.0",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {