@erdoai/cli 0.86.0 → 0.87.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 +35 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -587,6 +587,16 @@ var ErdoClient = class {
587
587
  `/v1/voice/phone-numbers/${encodeURIComponent(number)}/sms`
588
588
  );
589
589
  }
590
+ // Turn an agent's answering of texts on or off. Only the switch changes: the
591
+ // agent's persona, number and calls are untouched, and texts keep arriving and
592
+ // stay readable either way.
593
+ setVoiceAgentSMSReplies(slug, enabled) {
594
+ return this.request(
595
+ "POST",
596
+ `/v1/voice/agents/${encodeURIComponent(slug)}/sms-replies`,
597
+ { enabled }
598
+ );
599
+ }
590
600
  // Run a read-only HogQL query against the org's page-analytics events. Rows are
591
601
  // positional per columns; enabled:false means page analytics is off for the org
592
602
  // (not zero traffic). A rejected query surfaces PostHog's message as the error.
@@ -5356,6 +5366,12 @@ voiceSMSCmd.command("get <sessionID>").description("Read one SMS conversation: i
5356
5366
  ]
5357
5367
  ]
5358
5368
  );
5369
+ const contact = c.contact;
5370
+ if (contact && (contact.name || contact.email || contact.phone || contact.company)) {
5371
+ const parts = [contact.name, contact.email, contact.phone, contact.company].filter(Boolean);
5372
+ console.log(`
5373
+ contact: ${parts.join(" \xB7 ")}`);
5374
+ }
5359
5375
  const messages = res.messages ?? [];
5360
5376
  if (messages.length === 0) {
5361
5377
  console.log("\nNo texts have been recorded in this conversation yet.");
@@ -5500,6 +5516,25 @@ voiceNumbersCmd.command("provision-sms <number>").description("Ask for A2P SMS r
5500
5516
  fail(e);
5501
5517
  }
5502
5518
  });
5519
+ var voiceAgentsCmd = voiceCmd.command("agents").description("Settings on a voice agent itself");
5520
+ voiceAgentsCmd.command("sms-replies <slug>").description("Turn a voice agent's answering of texts on or off").option("--on", "the agent answers texts sent to its own number").option("--off", "texts still arrive and stay readable; the agent does not write back").action(async (slug, opts) => {
5521
+ if (Boolean(opts.on) === Boolean(opts.off)) {
5522
+ fail(new Error("say which way: pass --on or --off (exactly one)"));
5523
+ }
5524
+ try {
5525
+ const agent = await new ErdoClient().setVoiceAgentSMSReplies(slug, Boolean(opts.on));
5526
+ console.log(
5527
+ `${agent.slug} ${agent.sms_replies_enabled ? "on" : "off"} ${agent.phone_number ?? "-"} ${agent.name}`
5528
+ );
5529
+ if (!agent.phone_number) {
5530
+ process.stderr.write(
5531
+ "this agent has no phone number yet \u2014 the setting is stored and applies once it gets one\n"
5532
+ );
5533
+ }
5534
+ } catch (e) {
5535
+ fail(e);
5536
+ }
5537
+ });
5503
5538
  var datasetsCmd = program.command("datasets").description("Datasets");
5504
5539
  datasetsCmd.command("list").description("List datasets").option(
5505
5540
  "--class <class>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {