@erdoai/cli 0.179.0 → 0.181.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 +122 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -365,6 +365,27 @@ var ErdoClient = class {
365
365
  input
366
366
  );
367
367
  }
368
+ setPaidMediaCampaignBidding(campaignId, input) {
369
+ return this.request(
370
+ "POST",
371
+ `/v1/paid-media/campaigns/${encodeURIComponent(campaignId)}/bidding`,
372
+ input
373
+ );
374
+ }
375
+ setPaidMediaCampaignNetworkSettings(campaignId, input) {
376
+ return this.request(
377
+ "POST",
378
+ `/v1/paid-media/campaigns/${encodeURIComponent(campaignId)}/network-settings`,
379
+ input
380
+ );
381
+ }
382
+ setPaidMediaNegativeKeywords(campaignId, input) {
383
+ return this.request(
384
+ "POST",
385
+ `/v1/paid-media/campaigns/${encodeURIComponent(campaignId)}/negative-keywords`,
386
+ input
387
+ );
388
+ }
368
389
  setPaidMediaCampaignConversionGoals(campaignId, input) {
369
390
  return this.request(
370
391
  "POST",
@@ -407,6 +428,15 @@ var ErdoClient = class {
407
428
  creditBalance() {
408
429
  return this.request("GET", "/v1/credits/balance");
409
430
  }
431
+ listMCPToolsets() {
432
+ return this.request("GET", "/v1/mcp/toolsets");
433
+ }
434
+ searchMCPTools(query, toolset, limit) {
435
+ const params = new URLSearchParams({ query });
436
+ if (toolset) params.set("toolset", toolset);
437
+ if (limit !== void 0) params.set("limit", String(limit));
438
+ return this.request("GET", `/v1/mcp/tools?${params.toString()}`);
439
+ }
410
440
  async grantCredits(organization, amount, reason) {
411
441
  try {
412
442
  const result = await this.request(
@@ -2839,6 +2869,30 @@ function compactEvalRunAttribution(run) {
2839
2869
  var program = new Command2();
2840
2870
  program.name("erdo").description("Erdo CLI").version(pkg.version);
2841
2871
  bindScopeFlags(program);
2872
+ var mcpCatalog = program.command("mcp").description("Inspect the MCP tool catalog AI clients load");
2873
+ mcpCatalog.command("toolsets").description("List MCP toolsets and how many tools each one contains").action(async () => {
2874
+ try {
2875
+ print(await new ErdoClient().listMCPToolsets());
2876
+ } catch (error) {
2877
+ fail(error);
2878
+ }
2879
+ });
2880
+ mcpCatalog.command("tools").description("Search registered MCP tools").command("search <query...>").description("Find MCP tools by words in the name or description").option("--toolset <id>", "Limit the search to one toolset").option("--limit <n>", "Maximum matches, from 1 to 20").action(async (query, options) => {
2881
+ try {
2882
+ const text = query.join(" ").trim();
2883
+ if (!text) throw new Error("query is required");
2884
+ let limit;
2885
+ if (options.limit !== void 0) {
2886
+ if (!/^[0-9]+$/.test(options.limit) || Number(options.limit) < 1 || Number(options.limit) > 20) {
2887
+ throw new Error("--limit must be an integer from 1 to 20");
2888
+ }
2889
+ limit = Number(options.limit);
2890
+ }
2891
+ print(await new ErdoClient().searchMCPTools(text, options.toolset, limit));
2892
+ } catch (error) {
2893
+ fail(error);
2894
+ }
2895
+ });
2842
2896
  var credits = program.command("credits").description("Read organization credits");
2843
2897
  credits.command("balance").description("Read the current organization's credit balance (use --org to select)").action(async () => {
2844
2898
  try {
@@ -3036,6 +3090,66 @@ paidMediaCampaigns.command("list").description("List the organization's owned Go
3036
3090
  fail(e);
3037
3091
  }
3038
3092
  });
3093
+ function parsePaidMediaBool(value, name) {
3094
+ if (value === "true") return true;
3095
+ if (value === "false") return false;
3096
+ throw new Error(`${name} must be true or false`);
3097
+ }
3098
+ function parsePaidMediaKeyword(value) {
3099
+ const split = value.lastIndexOf(":");
3100
+ const text = split > 0 ? value.slice(0, split).trim() : "";
3101
+ const match = (split > 0 ? value.slice(split + 1) : "").trim().toUpperCase();
3102
+ if (!text || match !== "EXACT" && match !== "PHRASE" && match !== "BROAD") {
3103
+ throw new Error(`keyword ${JSON.stringify(value)} must be text:EXACT, text:PHRASE, or text:BROAD`);
3104
+ }
3105
+ return { text, match_type: match };
3106
+ }
3107
+ paidMediaCampaigns.command("bidding <campaignId>").description("Set a campaign's bidding strategy, including clearing a target CPA (approval-gated)").requiredOption("--customer-id <id>", "Google Ads customer ID").requiredOption("--strategy <strategy>", "MAXIMIZE_CONVERSIONS, TARGET_CPA, MAXIMIZE_CONVERSION_VALUE, TARGET_ROAS, or MAXIMIZE_CLICKS").option("--target-cpa-micros <micros>", "target CPA in micros").option("--clear-target-cpa", "clear Maximize Conversions target CPA").option("--target-roas <roas>", "target ROAS").option("--cpc-bid-ceiling-micros <micros>", "CPC ceiling in micros for MAXIMIZE_CLICKS").option("--confirm-detach-portfolio", "detach a portfolio bidding strategy").option("--reason <text>", "reason shown on the approval card").action(async (campaignId, opts) => {
3108
+ try {
3109
+ print(await new ErdoClient().setPaidMediaCampaignBidding(campaignId, {
3110
+ provider: "google_ads",
3111
+ customer_id: opts.customerId,
3112
+ bidding_strategy_type: opts.strategy,
3113
+ target_cpa_micros: opts.targetCpaMicros === void 0 ? void 0 : Number(opts.targetCpaMicros),
3114
+ clear_target_cpa: opts.clearTargetCpa || void 0,
3115
+ target_roas: opts.targetRoas === void 0 ? void 0 : Number(opts.targetRoas),
3116
+ cpc_bid_ceiling_micros: opts.cpcBidCeilingMicros === void 0 ? void 0 : Number(opts.cpcBidCeilingMicros),
3117
+ confirm_detach_portfolio: opts.confirmDetachPortfolio || void 0,
3118
+ reason: opts.reason
3119
+ }));
3120
+ } catch (e) {
3121
+ fail(e);
3122
+ }
3123
+ });
3124
+ paidMediaCampaigns.command("network-settings <campaignId>").description("Set Search Partners and Display on a Search campaign (approval-gated)").requiredOption("--customer-id <id>", "Google Ads customer ID").option("--search-partners <true|false>", "target_search_network, Search Partners").option("--display <true|false>", "target_content_network, Display").option("--confirm-network-expansion", "required to enable Search Partners or Display").option("--reason <text>", "reason shown on the approval card").action(async (campaignId, opts) => {
3125
+ try {
3126
+ if (opts.searchPartners === void 0 && opts.display === void 0) throw new Error("set --search-partners or --display");
3127
+ print(await new ErdoClient().setPaidMediaCampaignNetworkSettings(campaignId, {
3128
+ provider: "google_ads",
3129
+ customer_id: opts.customerId,
3130
+ target_search_network: opts.searchPartners === void 0 ? void 0 : parsePaidMediaBool(opts.searchPartners, "--search-partners"),
3131
+ target_content_network: opts.display === void 0 ? void 0 : parsePaidMediaBool(opts.display, "--display"),
3132
+ confirm_network_expansion: opts.confirmNetworkExpansion || void 0,
3133
+ reason: opts.reason
3134
+ }));
3135
+ } catch (e) {
3136
+ fail(e);
3137
+ }
3138
+ });
3139
+ paidMediaCampaigns.command("negative-keywords <campaignId>").description("Add or remove campaign or ad-group negative keywords (approval-gated)").requiredOption("--customer-id <id>", "Google Ads customer ID").option("--adgroup-id <id>", "edit this ad group's negatives").option("--add <text:MATCH>", "keyword to add, repeatable", (value, previous) => previous.concat(value), []).option("--remove <text:MATCH>", "keyword to remove, repeatable", (value, previous) => previous.concat(value), []).option("--reason <text>", "reason shown on the approval card").action(async (campaignId, opts) => {
3140
+ try {
3141
+ print(await new ErdoClient().setPaidMediaNegativeKeywords(campaignId, {
3142
+ provider: "google_ads",
3143
+ customer_id: opts.customerId,
3144
+ adgroup_id: opts.adgroupId,
3145
+ add: opts.add.map(parsePaidMediaKeyword),
3146
+ remove: opts.remove.map(parsePaidMediaKeyword),
3147
+ reason: opts.reason
3148
+ }));
3149
+ } catch (e) {
3150
+ fail(e);
3151
+ }
3152
+ });
3039
3153
  paidMediaCampaigns.command("conversion-goals <campaignId>").description("Set a campaign's custom conversion goal to exactly these conversion action ids").requiredOption("--actions <ids>", "comma-separated conversion action ids").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--json", "print the raw JSON result").action(async (campaignId, opts) => {
3040
3154
  try {
3041
3155
  const ids = opts.actions.split(",").map((id) => id.trim()).filter(Boolean);
@@ -3052,6 +3166,10 @@ paidMediaCampaigns.command("conversion-goals <campaignId>").description("Set a c
3052
3166
  if (result.status === "ready") {
3053
3167
  console.log("status: ready");
3054
3168
  if (result.goal_config_level) console.log(`goal config level: ${result.goal_config_level}`);
3169
+ } else if (result.status === "in_progress") {
3170
+ console.log("status: in progress (already approved; no decision pending)");
3171
+ console.log(`execution phase: ${result.execution_phase}`);
3172
+ console.log(`approval request id: ${result.approval_request_id}`);
3055
3173
  } else {
3056
3174
  console.log("status: pending approval");
3057
3175
  console.log(`approval request id: ${result.approval_request_id}`);
@@ -3081,6 +3199,10 @@ paidMedia.command("conversion-actions").command("ensure").description("Find or a
3081
3199
  if (result.status === "ready") {
3082
3200
  console.log(`status: ready`);
3083
3201
  if (result.conversion_action_id) console.log(`conversion action id: ${result.conversion_action_id}`);
3202
+ } else if (result.status === "in_progress") {
3203
+ console.log("status: in progress (already approved; no decision pending)");
3204
+ console.log(`execution phase: ${result.execution_phase}`);
3205
+ console.log(`approval request id: ${result.approval_request_id}`);
3084
3206
  } else {
3085
3207
  console.log(`status: pending approval`);
3086
3208
  console.log(`approval request id: ${result.approval_request_id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.179.0",
3
+ "version": "0.181.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {