@erdoai/cli 0.156.0 → 0.158.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 +85 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -275,10 +275,22 @@ var ErdoClient = class {
275
275
  input
276
276
  );
277
277
  }
278
+ listPaidMediaAudiences(customerId, provider = "google_ads") {
279
+ const query = new URLSearchParams({ provider });
280
+ if (customerId) query.set("customer_id", customerId);
281
+ return this.request("GET", `/v1/paid-media/audiences?${query}`);
282
+ }
278
283
  listPaidMediaCampaigns(customerId) {
279
284
  const query = customerId ? `?customer_id=${encodeURIComponent(customerId)}` : "";
280
285
  return this.request("GET", `/v1/paid-media/campaigns${query}`);
281
286
  }
287
+ setPaidMediaAudienceMode(campaignId, input) {
288
+ return this.request(
289
+ "POST",
290
+ `/v1/paid-media/campaigns/${encodeURIComponent(campaignId)}/audience-mode`,
291
+ input
292
+ );
293
+ }
282
294
  setPaidMediaCampaignConversionGoals(campaignId, input) {
283
295
  return this.request(
284
296
  "POST",
@@ -747,6 +759,20 @@ var ErdoClient = class {
747
759
  { enabled }
748
760
  );
749
761
  }
762
+ setVoiceAgentRealtimeModel(slug, model) {
763
+ return this.request(
764
+ "POST",
765
+ `/v1/voice/agents/${encodeURIComponent(slug)}/realtime-model`,
766
+ { realtime_model: model }
767
+ );
768
+ }
769
+ setVoiceWidgetRealtimeModel(widget, model) {
770
+ return this.request(
771
+ "POST",
772
+ `/v1/voice/widgets/${encodeURIComponent(widget)}/realtime-model`,
773
+ { realtime_model: model }
774
+ );
775
+ }
750
776
  // A separate switch from the text one, on the same number: the two are
751
777
  // separate permissions, so one endpoint per channel rather than a channel
752
778
  // argument that could move the wrong one.
@@ -2765,7 +2791,45 @@ program.command(REFRESH_COMMAND, { hidden: true }).description("Internal: refres
2765
2791
  await refreshVersionCache();
2766
2792
  });
2767
2793
  var paidMedia = program.command("paid-media").description("Paid media setup and operations");
2794
+ paidMedia.command("audiences").description("Read live audience lists, eligibility, attachments and targeting mode").option("--provider <provider>", "ad platform", "google_ads").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--json", "print the raw JSON result, including partial-read errors").action(async (opts) => {
2795
+ try {
2796
+ const result = await new ErdoClient().listPaidMediaAudiences(opts.customerId, opts.provider);
2797
+ if (opts.json) {
2798
+ print(result);
2799
+ return;
2800
+ }
2801
+ console.log(`${result.provider} customer ${result.customer_id}: ${result.status}`);
2802
+ console.log(`lists: ${result.list_presence}; attachments: ${result.attachment_state}`);
2803
+ for (const list of result.lists) {
2804
+ console.log(`${list.id} ${list.name} ${list.type} ${list.membership_status} ${list.population_state} search=${list.size_for_search ?? "unknown"} display=${list.size_for_display ?? "unknown"}`);
2805
+ }
2806
+ for (const link of result.attachments) {
2807
+ console.log(`${link.campaign_id}${link.ad_group_id ? "/" + link.ad_group_id : ""} ${link.user_list_resource_name} ${link.negative ? "EXCLUSION" : link.mode} ${link.enabled ? "enabled" : "inactive"}`);
2808
+ }
2809
+ for (const read of result.reads) {
2810
+ if (read.status !== "available") console.log(`${read.resource}: ${read.status} \u2014 ${read.error}`);
2811
+ }
2812
+ console.log(`Customer Match: ${result.customer_match.status} \u2014 ${result.customer_match.detail}`);
2813
+ for (const fact of result.facts) console.log(fact);
2814
+ } catch (e) {
2815
+ fail(e);
2816
+ }
2817
+ });
2768
2818
  var paidMediaCampaigns = paidMedia.command("campaigns").description("Google Ads campaigns and their conversion goals");
2819
+ paidMedia.command("audience-mode <campaignId>").description("Set audience Observation or Targeting, preserving other targeting dimensions (approval-gated)").requiredOption("--customer-id <id>", "Google Ads customer ID").requiredOption("--mode <mode>", "observation or targeting").option("--adgroup-id <id>", "update this ad group instead of its parent campaign").option("--reason <text>", "reason shown on the approval card").action(async (campaignId, opts) => {
2820
+ try {
2821
+ if (opts.mode !== "observation" && opts.mode !== "targeting") throw new Error("--mode must be observation or targeting");
2822
+ print(await new ErdoClient().setPaidMediaAudienceMode(campaignId, {
2823
+ provider: "google_ads",
2824
+ customer_id: opts.customerId,
2825
+ adgroup_id: opts.adgroupId,
2826
+ mode: opts.mode,
2827
+ reason: opts.reason
2828
+ }));
2829
+ } catch (e) {
2830
+ fail(e);
2831
+ }
2832
+ });
2769
2833
  paidMediaCampaigns.command("list").description("List the organization's owned Google Ads campaigns and owned conversion actions").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--json", "print the raw JSON result").action(async (opts) => {
2770
2834
  try {
2771
2835
  const result = await new ErdoClient().listPaidMediaCampaigns(opts.customerId);
@@ -7369,6 +7433,27 @@ voiceAgentsCmd.command("whatsapp-replies <slug>").description("Turn a voice agen
7369
7433
  fail(e);
7370
7434
  }
7371
7435
  });
7436
+ function parseVoiceRealtimeModel(value) {
7437
+ if (value === "off" || value === "mini" || value === "max") return value;
7438
+ throw new Error("realtime model must be one of: off, mini, max");
7439
+ }
7440
+ voiceAgentsCmd.command("realtime-model <slug> <model>").description("Choose the voice model used by a voice agent").action(async (slug, model) => {
7441
+ try {
7442
+ const res = await new ErdoClient().setVoiceAgentRealtimeModel(slug, parseVoiceRealtimeModel(model));
7443
+ console.log(`${res.agent ?? slug} ${res.realtime_model} ${res.name}`);
7444
+ } catch (e) {
7445
+ fail(e);
7446
+ }
7447
+ });
7448
+ var voiceWidgetsCmd = voiceCmd.command("widgets").description("Change settings on a website voice widget");
7449
+ voiceWidgetsCmd.command("realtime-model <widget> <model>").description("Choose the voice model used by a website widget").action(async (widget, model) => {
7450
+ try {
7451
+ const res = await new ErdoClient().setVoiceWidgetRealtimeModel(widget, parseVoiceRealtimeModel(model));
7452
+ console.log(`${res.widget ?? widget} ${res.realtime_model} ${res.name}`);
7453
+ } catch (e) {
7454
+ fail(e);
7455
+ }
7456
+ });
7372
7457
  var datasetsCmd = program.command("datasets").description("Datasets");
7373
7458
  var providerLeadSourcesCmd = program.command("provider-lead-sources").description("Ingest ad-platform lead form responses into a lead dataset");
7374
7459
  providerLeadSourcesCmd.command("list").description("List LinkedIn lead form source declarations").option("--provider <provider>", "filter by ad platform provider").option("--account-id <id>", "filter by provider ad account id").action(async (opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.156.0",
3
+ "version": "0.158.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {