@adviverse/mcp 0.1.1 → 0.1.3

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 (3) hide show
  1. package/dist/http.js +626 -151
  2. package/dist/index.js +626 -151
  3. package/package.json +2 -2
package/dist/http.js CHANGED
@@ -31,11 +31,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  mod
32
32
  ));
33
33
 
34
- // ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
34
+ // ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
35
35
  import path from "path";
36
36
  import { fileURLToPath } from "url";
37
37
  var init_esm_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -14411,6 +14411,16 @@ var AuthResource = class extends Resource {
14411
14411
  resetPassword(token, password) {
14412
14412
  return this.c.request("POST", "/v1/auth/reset-password", { body: { token, password } });
14413
14413
  }
14414
+ /**
14415
+ * Set or change the signed-in account's password. Omit `currentPassword` when
14416
+ * the account is SSO-only (setting a password for the first time so email+password
14417
+ * login also works); it's required when changing an existing password.
14418
+ */
14419
+ setPassword(newPassword, currentPassword) {
14420
+ return this.c.request("POST", "/v1/auth/password", {
14421
+ body: { newPassword, ...currentPassword ? { currentPassword } : {} }
14422
+ });
14423
+ }
14414
14424
  login(body) {
14415
14425
  return this.c.request("POST", "/v1/auth/login", { body });
14416
14426
  }
@@ -14473,14 +14483,19 @@ var ReportingResource = class extends Resource {
14473
14483
  publisher(query) {
14474
14484
  return this.c.request("GET", "/v1/reporting/publisher", { query });
14475
14485
  }
14486
+ /** Fill summary: requests, fill_rate, paid_fill_rate (house excluded), no-fill reasons. */
14476
14487
  publisherFill(query) {
14477
14488
  return this.c.request("GET", "/v1/reporting/publisher/fill", { query });
14478
14489
  }
14479
14490
  /** Per-placement rollup (impressions, clicks, CTR, revenue, RPM, eCPM, fill
14480
- * rate, viewable rate) for the authed publisher. */
14491
+ * rate, paid fill rate, viewable rate, slot CLS) for the authed publisher. */
14481
14492
  publisherPlacements(query) {
14482
14493
  return this.c.request("GET", "/v1/reporting/publisher/placements", { query });
14483
14494
  }
14495
+ /** Anti-adblock: impressions recovered from adblock visitors (first-party serving). */
14496
+ antiAdblock(query) {
14497
+ return this.c.request("GET", "/v1/reporting/publisher/anti-adblock", { query });
14498
+ }
14484
14499
  advertiser(query) {
14485
14500
  return this.c.request("GET", "/v1/reporting/advertiser", { query });
14486
14501
  }
@@ -14498,7 +14513,13 @@ var ReportingResource = class extends Resource {
14498
14513
  reach(query) {
14499
14514
  return this.c.request("GET", "/v1/reporting/reach", { query });
14500
14515
  }
14501
- /** OS / browser / deal breakdown (bdim=os|browser|deal) — dropped by the rollup. */
14516
+ /**
14517
+ * Breakdown over a dimension the hourly rollup drops
14518
+ * (bdim=os|browser|deal|page|page_url|app|property). 'page' groups by site
14519
+ * (host), 'page_url' by individual page (host+path), 'app' by in-app/in-game
14520
+ * app id, 'property' by owning property (app/site). Rows carry impressions,
14521
+ * clicks, ctr, revenue (publisher earnings or advertiser spend) and ecpm.
14522
+ */
14502
14523
  breakdown(query) {
14503
14524
  return this.c.request("GET", "/v1/reporting/breakdown", { query });
14504
14525
  }
@@ -14574,6 +14595,23 @@ var ReportingResource = class extends Resource {
14574
14595
  viewability(query) {
14575
14596
  return this.c.request("GET", "/v1/reporting/viewability", { query });
14576
14597
  }
14598
+ /** Video completion: the funnel (starts → quartiles → completes) and completion
14599
+ * rate / VTR, plus a per-placement (publisher) or per-campaign (advertiser)
14600
+ * breakdown. Returns { funnel, breakdown }. */
14601
+ video(query) {
14602
+ return this.c.request("GET", "/v1/reporting/video", { query });
14603
+ }
14604
+ /** Affiliate sub-id funnel: impressions → clicks → conversions per sub-id, with
14605
+ * CTR / CVR / revenue / payout. `sub` picks which of sub1..sub5 to group by
14606
+ * (default sub1). Conversions populate on advertiser scope only. */
14607
+ affiliate(query) {
14608
+ return this.c.request("GET", "/v1/reporting/affiliate", { query });
14609
+ }
14610
+ /** Per-card carousel click attribution: clicks per card of each carousel
14611
+ * creative, with the card's title/price. Advertiser-scoped. */
14612
+ carousel(query) {
14613
+ return this.c.request("GET", "/v1/reporting/carousel", { query });
14614
+ }
14577
14615
  /** List saved report configurations. */
14578
14616
  saved() {
14579
14617
  return this.c.request("GET", "/v1/reporting/saved");
@@ -14642,6 +14680,14 @@ var ReferralsResource = class extends Resource {
14642
14680
  list() {
14643
14681
  return this.c.request("GET", "/v1/referrals");
14644
14682
  }
14683
+ /** Refer & earn: partner status, `?via=` link, clicks, sign-ups and commissions. */
14684
+ affiliate() {
14685
+ return this.c.request("GET", "/v1/referrals/affiliate");
14686
+ }
14687
+ /** Join Refer & earn (idempotent); returns the new overview. */
14688
+ joinAffiliate() {
14689
+ return this.c.request("POST", "/v1/referrals/affiliate/join");
14690
+ }
14645
14691
  };
14646
14692
  var WebhooksResource = class extends Resource {
14647
14693
  constructor(c) {
@@ -14656,9 +14702,33 @@ var WebhooksResource = class extends Resource {
14656
14702
  create(body) {
14657
14703
  return this.c.request("POST", "/v1/webhooks", { body });
14658
14704
  }
14705
+ /** Update an endpoint's URL, subscribed events, and/or active (pause) flag. */
14706
+ update(id, body) {
14707
+ return this.c.request("PATCH", `/v1/webhooks/${encodeURIComponent(id)}`, { body });
14708
+ }
14659
14709
  delete(id) {
14660
14710
  return this.c.request("DELETE", `/v1/webhooks/${encodeURIComponent(id)}`);
14661
14711
  }
14712
+ /** Roll the signing secret (old one stops verifying immediately). */
14713
+ rotateSecret(id) {
14714
+ return this.c.request("POST", `/v1/webhooks/${encodeURIComponent(id)}/rotate-secret`);
14715
+ }
14716
+ /** Fetch the signing secret (list()/update() only return `has_secret` + `secret_hint`). */
14717
+ revealSecret(id) {
14718
+ return this.c.request("POST", `/v1/webhooks/${encodeURIComponent(id)}/secret/reveal`);
14719
+ }
14720
+ /** Fire a synthetic `ping` event to verify the endpoint. */
14721
+ ping(id) {
14722
+ return this.c.request("POST", `/v1/webhooks/${encodeURIComponent(id)}/ping`);
14723
+ }
14724
+ /** Recent delivery attempts for one subscription (newest first). */
14725
+ deliveries(id, query) {
14726
+ return this.c.request("GET", `/v1/webhooks/${encodeURIComponent(id)}/deliveries`, { query });
14727
+ }
14728
+ /** Manually re-send a past delivery's payload. */
14729
+ redeliver(deliveryId) {
14730
+ return this.c.request("POST", `/v1/webhooks/deliveries/${encodeURIComponent(deliveryId)}/redeliver`);
14731
+ }
14662
14732
  };
14663
14733
  var KeysResource = class extends Resource {
14664
14734
  constructor(c) {
@@ -14747,6 +14817,186 @@ var StatsResource = class extends Resource {
14747
14817
  return this.c.request("GET", "/v1/stats");
14748
14818
  }
14749
14819
  };
14820
+ var TeamResource = class extends Resource {
14821
+ constructor(c) {
14822
+ super(c);
14823
+ }
14824
+ /** Every seat under the account, with each member's role + pixel grants. */
14825
+ list() {
14826
+ return this.c.request("GET", "/v1/advertiser/team");
14827
+ }
14828
+ /**
14829
+ * Invite a team member. `role` 'admin' grants full account access; 'manager'
14830
+ * and 'analyst' are confined to the assigned `pixelIds` (managers can write,
14831
+ * analysts are read-only). `allPixels: true` grants every pixel.
14832
+ */
14833
+ invite(body) {
14834
+ return this.c.request("POST", "/v1/advertiser/team", { body });
14835
+ }
14836
+ /** Change a member's role, pixel grants, name, or status ('active'|'disabled'). */
14837
+ update(id, body) {
14838
+ return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}`, { body });
14839
+ }
14840
+ /** Re-send a pending member's invitation email. */
14841
+ resendInvite(id) {
14842
+ return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}/resend`);
14843
+ }
14844
+ /** Remove a seat entirely (revokes their sessions). */
14845
+ remove(id) {
14846
+ return this.c.request("DELETE", `/v1/advertiser/team/${encodeURIComponent(id)}`);
14847
+ }
14848
+ };
14849
+ var ClientsResource = class extends Resource {
14850
+ constructor(c) {
14851
+ super(c);
14852
+ }
14853
+ /** List the agency's clients (with tagged-campaign counts). */
14854
+ list() {
14855
+ return this.c.request("GET", "/v1/advertiser/clients");
14856
+ }
14857
+ get(id) {
14858
+ return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
14859
+ }
14860
+ create(body) {
14861
+ return this.c.request("POST", "/v1/advertiser/clients", { body });
14862
+ }
14863
+ update(id, body) {
14864
+ return this.c.request("POST", `/v1/advertiser/clients/${encodeURIComponent(id)}`, { body });
14865
+ }
14866
+ remove(id) {
14867
+ return this.c.request("DELETE", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
14868
+ }
14869
+ /** Campaigns owned by the account with their current client tag. */
14870
+ campaigns() {
14871
+ return this.c.request("GET", "/v1/advertiser/clients/campaigns");
14872
+ }
14873
+ /** Tag (or untag with clientId=null) a campaign to a client so its spend rolls up. */
14874
+ tagCampaign(campaignId, clientId) {
14875
+ return this.c.request("POST", "/v1/advertiser/clients/tag", { body: { campaignId, clientId } });
14876
+ }
14877
+ /** Spend + delivery for a client over a period (defaults to last 30d). */
14878
+ spend(id, from, to) {
14879
+ return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}/spend`, { query: { ...from ? { from } : {}, ...to ? { to } : {} } });
14880
+ }
14881
+ };
14882
+ var InvoicesResource = class extends Resource {
14883
+ constructor(c) {
14884
+ super(c);
14885
+ }
14886
+ list(clientId) {
14887
+ return this.c.request("GET", "/v1/advertiser/invoices", { query: clientId ? { clientId } : void 0 });
14888
+ }
14889
+ get(id) {
14890
+ return this.c.request("GET", `/v1/advertiser/invoices/${encodeURIComponent(id)}`);
14891
+ }
14892
+ /**
14893
+ * Create a draft invoice. With a period, auto-adds the client's tagged-campaign
14894
+ * spend as a line, plus an optional markupPct agency fee. Extra manual items
14895
+ * may be supplied.
14896
+ */
14897
+ create(body) {
14898
+ return this.c.request("POST", "/v1/advertiser/invoices", { body });
14899
+ }
14900
+ addItem(id, item) {
14901
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items`, { body: item });
14902
+ }
14903
+ removeItem(id, itemId) {
14904
+ return this.c.request("DELETE", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items/${encodeURIComponent(itemId)}`);
14905
+ }
14906
+ /** Send the invoice: mints a public pay link + emails the client. Returns it with `payLink`. */
14907
+ send(id) {
14908
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/send`);
14909
+ }
14910
+ /** Record an offline/out-of-band payment. */
14911
+ markPaid(id) {
14912
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/mark-paid`);
14913
+ }
14914
+ void(id) {
14915
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/void`);
14916
+ }
14917
+ };
14918
+ var TransfersResource = class extends Resource {
14919
+ constructor(c) {
14920
+ super(c);
14921
+ }
14922
+ /** Initiate a transfer of one of your pixels (and its audiences) to an email. */
14923
+ initiate(pixelId, email2) {
14924
+ return this.c.request("POST", "/v1/advertiser/transfers", { body: { pixelId, email: email2 } });
14925
+ }
14926
+ /** Outgoing transfers you've initiated. */
14927
+ list() {
14928
+ return this.c.request("GET", "/v1/advertiser/transfers");
14929
+ }
14930
+ cancel(id) {
14931
+ return this.c.request("POST", `/v1/advertiser/transfers/${encodeURIComponent(id)}/cancel`);
14932
+ }
14933
+ /** Preview an incoming transfer by its token (the recipient must be logged in). */
14934
+ info(token) {
14935
+ return this.c.request("GET", "/v1/transfers/info", { query: { token } });
14936
+ }
14937
+ /** Accept an incoming transfer — the pixel + its audiences move to YOUR account. */
14938
+ accept(token) {
14939
+ return this.c.request("POST", "/v1/transfers/accept", { body: { token } });
14940
+ }
14941
+ };
14942
+ var TerminalResource = class extends Resource {
14943
+ constructor(c) {
14944
+ super(c);
14945
+ }
14946
+ /**
14947
+ * Fetch one rotated terminal ad from YOUR OWN campaigns. Auth precedence:
14948
+ * `token` (public ts_… — safe to ship) → the client's `x-api-key` (secret).
14949
+ */
14950
+ serve(opts = {}) {
14951
+ return this.c.request("GET", "/terminal/serve", {
14952
+ baseUrl: this.c.servingBaseUrl,
14953
+ query: { token: opts.token, campaignId: opts.campaignId, uid: opts.uid }
14954
+ });
14955
+ }
14956
+ /** Mint a PUBLIC serve token (ts_…) — non-secret, serve-only, safe to embed in
14957
+ * a distributed client. Optionally pin it to one terminal campaign, and/or arm
14958
+ * adaptive mode-switching (`switch`) so the engine rotates each install between
14959
+ * your ads and the marketplace based on engagement. */
14960
+ createToken(body = {}) {
14961
+ return this.c.request("POST", "/v1/advertiser/terminal-tokens", { body });
14962
+ }
14963
+ listTokens() {
14964
+ return this.c.request("GET", "/v1/advertiser/terminal-tokens");
14965
+ }
14966
+ /** Arm / update / disable a token's mode-switching policy in place (same ts_
14967
+ * value keeps working). Pass an empty object (or all-zero policy) to disable. */
14968
+ setTokenPolicy(id, policy) {
14969
+ return this.c.request("PATCH", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}/switch`, { body: policy });
14970
+ }
14971
+ /** Rotate a token's value (old value stops working immediately). */
14972
+ rotateToken(id) {
14973
+ return this.c.request("POST", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}/rotate`);
14974
+ }
14975
+ revokeToken(id) {
14976
+ return this.c.request("DELETE", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}`);
14977
+ }
14978
+ };
14979
+ var CampaignGroupsResource = class extends Resource {
14980
+ constructor(c) {
14981
+ super(c);
14982
+ }
14983
+ /** Groups with their ad sets nested + a per-group spend rollup. */
14984
+ list() {
14985
+ return this.c.request("GET", "/v1/advertiser/campaign-groups");
14986
+ }
14987
+ get(id) {
14988
+ return this.c.request("GET", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`);
14989
+ }
14990
+ create(body) {
14991
+ return this.c.request("POST", "/v1/advertiser/campaign-groups", { body });
14992
+ }
14993
+ update(id, body) {
14994
+ return this.c.request("PATCH", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`, { body });
14995
+ }
14996
+ remove(id) {
14997
+ return this.c.request("DELETE", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`);
14998
+ }
14999
+ };
14750
15000
  var CampaignsResource = class extends Resource {
14751
15001
  constructor(c) {
14752
15002
  super(c);
@@ -14763,6 +15013,11 @@ var CampaignsResource = class extends Resource {
14763
15013
  update(id, body) {
14764
15014
  return this.c.request("PATCH", `/v1/advertiser/campaigns/${encodeURIComponent(id)}`, { body });
14765
15015
  }
15016
+ /** Soft-delete a campaign: stops serving + removes it from the list. Past
15017
+ * spend/stats stay for reporting. */
15018
+ remove(id) {
15019
+ return this.c.request("DELETE", `/v1/advertiser/campaigns/${encodeURIComponent(id)}`);
15020
+ }
14766
15021
  submit(id) {
14767
15022
  return this.c.request("POST", `/v1/advertiser/campaigns/${encodeURIComponent(id)}/submit`);
14768
15023
  }
@@ -14845,6 +15100,15 @@ var CreativesResource = class extends Resource {
14845
15100
  if (fields2) for (const [k, v] of Object.entries(fields2)) form.append(k, v);
14846
15101
  return this.c.request("POST", "/v1/advertiser/creatives/upload", { form });
14847
15102
  }
15103
+ /** Uploads a PLAYABLE (interactive HTML5) as a ZIP bundle. The server validates
15104
+ * it, injects the sandbox runtime into its index.html, and hosts it on the CDN.
15105
+ * Returns { assetUrl, type:'html5', … } to pass to create() as a full-screen
15106
+ * (interstitial/rewarded) creative. `zip` is a Blob/File of the .zip. */
15107
+ uploadPlayable(zip, filename = "playable.zip") {
15108
+ const form = new FormData();
15109
+ form.append("file", zip, filename);
15110
+ return this.c.request("POST", "/v1/advertiser/creatives/playable", { form });
15111
+ }
14848
15112
  delete(id) {
14849
15113
  return this.c.request("DELETE", `/v1/advertiser/creatives/${encodeURIComponent(id)}`);
14850
15114
  }
@@ -15095,128 +15359,6 @@ var PixelResource = class extends Resource {
15095
15359
  return this.c.request("GET", "/v1/advertiser/pixel/traits", { query: { user, ...pixelId ? { pixelId } : {} } });
15096
15360
  }
15097
15361
  };
15098
- var TeamResource = class extends Resource {
15099
- constructor(c) {
15100
- super(c);
15101
- }
15102
- /** Every seat under the account, with each member's role + pixel grants. */
15103
- list() {
15104
- return this.c.request("GET", "/v1/advertiser/team");
15105
- }
15106
- /**
15107
- * Invite a team member. `role` 'admin' grants full account access; 'manager'
15108
- * and 'analyst' are confined to the assigned `pixelIds` (managers can write,
15109
- * analysts are read-only). `allPixels: true` grants every pixel.
15110
- */
15111
- invite(body) {
15112
- return this.c.request("POST", "/v1/advertiser/team", { body });
15113
- }
15114
- /** Change a member's role, pixel grants, name, or status ('active'|'disabled'). */
15115
- update(id, body) {
15116
- return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}`, { body });
15117
- }
15118
- /** Re-send a pending member's invitation email. */
15119
- resendInvite(id) {
15120
- return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}/resend`);
15121
- }
15122
- /** Remove a seat entirely (revokes their sessions). */
15123
- remove(id) {
15124
- return this.c.request("DELETE", `/v1/advertiser/team/${encodeURIComponent(id)}`);
15125
- }
15126
- };
15127
- var ClientsResource = class extends Resource {
15128
- constructor(c) {
15129
- super(c);
15130
- }
15131
- /** List the agency's clients (with tagged-campaign counts). */
15132
- list() {
15133
- return this.c.request("GET", "/v1/advertiser/clients");
15134
- }
15135
- get(id) {
15136
- return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
15137
- }
15138
- create(body) {
15139
- return this.c.request("POST", "/v1/advertiser/clients", { body });
15140
- }
15141
- update(id, body) {
15142
- return this.c.request("POST", `/v1/advertiser/clients/${encodeURIComponent(id)}`, { body });
15143
- }
15144
- remove(id) {
15145
- return this.c.request("DELETE", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
15146
- }
15147
- /** Campaigns owned by the account with their current client tag. */
15148
- campaigns() {
15149
- return this.c.request("GET", "/v1/advertiser/clients/campaigns");
15150
- }
15151
- /** Tag (or untag with clientId=null) a campaign to a client so its spend rolls up. */
15152
- tagCampaign(campaignId, clientId) {
15153
- return this.c.request("POST", "/v1/advertiser/clients/tag", { body: { campaignId, clientId } });
15154
- }
15155
- /** Spend + delivery for a client over a period (defaults to last 30d). */
15156
- spend(id, from, to) {
15157
- return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}/spend`, { query: { ...from ? { from } : {}, ...to ? { to } : {} } });
15158
- }
15159
- };
15160
- var InvoicesResource = class extends Resource {
15161
- constructor(c) {
15162
- super(c);
15163
- }
15164
- list(clientId) {
15165
- return this.c.request("GET", "/v1/advertiser/invoices", { query: clientId ? { clientId } : void 0 });
15166
- }
15167
- get(id) {
15168
- return this.c.request("GET", `/v1/advertiser/invoices/${encodeURIComponent(id)}`);
15169
- }
15170
- /**
15171
- * Create a draft invoice. With a period, auto-adds the client's tagged-campaign
15172
- * spend as a line, plus an optional markupPct agency fee. Extra manual items
15173
- * may be supplied.
15174
- */
15175
- create(body) {
15176
- return this.c.request("POST", "/v1/advertiser/invoices", { body });
15177
- }
15178
- addItem(id, item) {
15179
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items`, { body: item });
15180
- }
15181
- removeItem(id, itemId) {
15182
- return this.c.request("DELETE", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items/${encodeURIComponent(itemId)}`);
15183
- }
15184
- /** Send the invoice: mints a public pay link + emails the client. Returns it with `payLink`. */
15185
- send(id) {
15186
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/send`);
15187
- }
15188
- /** Record an offline/out-of-band payment. */
15189
- markPaid(id) {
15190
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/mark-paid`);
15191
- }
15192
- void(id) {
15193
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/void`);
15194
- }
15195
- };
15196
- var TransfersResource = class extends Resource {
15197
- constructor(c) {
15198
- super(c);
15199
- }
15200
- /** Initiate a transfer of one of your pixels (and its audiences) to an email. */
15201
- initiate(pixelId, email2) {
15202
- return this.c.request("POST", "/v1/advertiser/transfers", { body: { pixelId, email: email2 } });
15203
- }
15204
- /** Outgoing transfers you've initiated. */
15205
- list() {
15206
- return this.c.request("GET", "/v1/advertiser/transfers");
15207
- }
15208
- cancel(id) {
15209
- return this.c.request("POST", `/v1/advertiser/transfers/${encodeURIComponent(id)}/cancel`);
15210
- }
15211
- /** Preview an incoming transfer by its token (the recipient must be logged in). */
15212
- info(token) {
15213
- return this.c.request("GET", "/v1/transfers/info", { query: { token } });
15214
- }
15215
- /** Accept an incoming transfer — the pixel + its audiences move to YOUR account. */
15216
- accept(token) {
15217
- return this.c.request("POST", "/v1/transfers/accept", { body: { token } });
15218
- }
15219
- };
15220
15362
  var FeedsResource = class extends Resource {
15221
15363
  constructor(c) {
15222
15364
  super(c);
@@ -15311,6 +15453,10 @@ var AutomationResource = class extends Resource {
15311
15453
  deleteRule(id) {
15312
15454
  return this.c.request("DELETE", `/v1/automation/rules/${encodeURIComponent(id)}`);
15313
15455
  }
15456
+ /** Enable or disable a rule (pause it without deleting). */
15457
+ setRuleEnabled(id, enabled) {
15458
+ return this.c.request("PATCH", `/v1/automation/rules/${encodeURIComponent(id)}`, { body: { enabled } });
15459
+ }
15314
15460
  /** Recent automated budget-reallocation actions. */
15315
15461
  optimizerLog(limit) {
15316
15462
  return this.c.request("GET", "/v1/optimizer/log", { query: { limit } });
@@ -15353,13 +15499,39 @@ var PropertiesResource = class extends Resource {
15353
15499
  return this.c.request("POST", "/v1/publisher/properties", { body, idempotencyKey });
15354
15500
  }
15355
15501
  /** Update a property's editable fields: display name, domain, category, and
15356
- * verification method. Changing the domain resets verification. */
15502
+ * verification method. Changing the domain resets verification. `category`
15503
+ * (a site-niche id) is kept as the publisher's manual choice; 0 hands it back
15504
+ * to auto-detection. */
15357
15505
  update(id, body) {
15358
15506
  return this.c.request("PATCH", `/v1/publisher/properties/${encodeURIComponent(id)}`, { body });
15359
15507
  }
15508
+ /** Re-detect a website's niche from its pages (updates `category` only when it is auto). */
15509
+ classify(id) {
15510
+ return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/classify`);
15511
+ }
15512
+ /** The site-niche taxonomy: ids for property `category` and campaign `propertyCategoryInclude/Exclude`. Public. */
15513
+ niches() {
15514
+ return this.c.request("GET", "/v1/site-niches");
15515
+ }
15360
15516
  verify(id) {
15361
15517
  return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/verify`);
15362
15518
  }
15519
+ /** The ads.txt line(s) to publish at https://<domain>/ads.txt (plain text). */
15520
+ adsTxt(id) {
15521
+ return this.c.request("GET", `/v1/publisher/properties/${encodeURIComponent(id)}/ads.txt`, { text: true });
15522
+ }
15523
+ /** Set/clear the property's first-party ad-serving domain (anti-adblock). Pass
15524
+ * null/undefined to remove. Returns the CNAME target to point the domain at. */
15525
+ setServingDomain(id, domain) {
15526
+ return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain`, { body: { domain } });
15527
+ }
15528
+ /** Verify the custom serving domain CNAMEs to our edge (proves control + routes). */
15529
+ verifyServingDomain(id) {
15530
+ return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain/verify`);
15531
+ }
15532
+ removeServingDomain(id) {
15533
+ return this.c.request("DELETE", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain`);
15534
+ }
15363
15535
  domainConnect(id) {
15364
15536
  return this.c.request(
15365
15537
  "POST",
@@ -15387,6 +15559,7 @@ var PlacementsResource = class extends Resource {
15387
15559
  update(id, body) {
15388
15560
  return this.c.request("PATCH", `/v1/publisher/placements/${encodeURIComponent(id)}`, { body });
15389
15561
  }
15562
+ /** Install code; responsive banners also carry `autoAdsScript` (site-wide auto-ads tag). */
15390
15563
  tag(id) {
15391
15564
  return this.c.request("GET", `/v1/publisher/placements/${encodeURIComponent(id)}/tag`);
15392
15565
  }
@@ -15429,11 +15602,19 @@ var ConsentResource = class extends Resource {
15429
15602
  constructor(c) {
15430
15603
  super(c);
15431
15604
  }
15432
- /** Get this publisher's consent config (defaults when none saved). */
15433
- getConfig() {
15434
- return this.c.request("GET", "/v1/publisher/consent-config");
15605
+ /**
15606
+ * Get consent config. Consent is scoped per PROPERTY (domain) — pass a
15607
+ * propertyId to read that property's config (falling back to the account-wide
15608
+ * default). Omit it to read the account-wide default directly.
15609
+ */
15610
+ getConfig(propertyId) {
15611
+ const q = propertyId ? `?propertyId=${encodeURIComponent(propertyId)}` : "";
15612
+ return this.c.request("GET", `/v1/publisher/consent-config${q}`);
15435
15613
  }
15436
- /** Save the CMP framework + default-consent + snippet behavior. */
15614
+ /**
15615
+ * Save the CMP framework + default-consent + snippet behavior for a property
15616
+ * (set `propertyId` in the body). Omit `propertyId` to save the account default.
15617
+ */
15437
15618
  saveConfig(body) {
15438
15619
  return this.c.request("POST", "/v1/publisher/consent-config", { body });
15439
15620
  }
@@ -15580,6 +15761,18 @@ var AdminResource = class extends Resource {
15580
15761
  return this.c.request("GET", "/v1/admin/audit");
15581
15762
  }
15582
15763
  /** Properties ranked by Made-For-Advertising risk score. */
15764
+ /** Website/app properties with trust tier, lock, niches and promotion progress. */
15765
+ trustProperties(query) {
15766
+ return this.c.request("GET", "/v1/admin/properties/trust", { query });
15767
+ }
15768
+ /** Override a property's trust tier and/or lock it against automatic changes. */
15769
+ setPropertyTrust(id, body) {
15770
+ return this.c.request("POST", `/v1/admin/properties/${encodeURIComponent(id)}/trust`, { body });
15771
+ }
15772
+ /** The trust audit log (auto promotions/demotions, domain resets, overrides). */
15773
+ trustEvents(query) {
15774
+ return this.c.request("GET", "/v1/admin/trust-events", { query });
15775
+ }
15583
15776
  mfaRanking(limit) {
15584
15777
  return this.c.request("GET", "/v1/admin/mfa", { query: { limit } });
15585
15778
  }
@@ -15656,10 +15849,235 @@ var BlogResource = class extends Resource {
15656
15849
  return this.c.request("DELETE", `/v1/admin/blog/${encodeURIComponent(id)}`);
15657
15850
  }
15658
15851
  };
15852
+ var MarketplaceCatalogResource = class extends Resource {
15853
+ constructor(c) {
15854
+ super(c);
15855
+ }
15856
+ /** Bulk upsert catalog items (create or update by `external_id`). */
15857
+ upsert(items) {
15858
+ const body = { items };
15859
+ return this.c.request("POST", "/v1/advertiser/marketplace-catalog", { body });
15860
+ }
15861
+ /** The catalog items the account has uploaded. */
15862
+ list() {
15863
+ return this.c.request("GET", "/v1/advertiser/marketplace-catalog");
15864
+ }
15865
+ /**
15866
+ * Register (or update) a hosted catalog feed URL that we re-fetch on a schedule
15867
+ * (SSRF-guarded pull → the same upsert path). Re-registering the same URL updates
15868
+ * its interval and re-activates it.
15869
+ */
15870
+ registerFeed(input) {
15871
+ return this.c.request("POST", "/v1/advertiser/catalog-feeds", { body: input });
15872
+ }
15873
+ /** The scheduled catalog feeds the account has registered. */
15874
+ listFeeds() {
15875
+ return this.c.request("GET", "/v1/advertiser/catalog-feeds");
15876
+ }
15877
+ /** Remove a registered feed (stops its scheduled refresh). */
15878
+ removeFeed(id) {
15879
+ return this.c.request("DELETE", `/v1/advertiser/catalog-feeds/${encodeURIComponent(id)}`);
15880
+ }
15881
+ };
15882
+ var PromoteCampaignsResource = class extends Resource {
15883
+ constructor(c) {
15884
+ super(c);
15885
+ }
15886
+ create(body) {
15887
+ return this.c.request("POST", "/v1/advertiser/promote-campaigns", { body });
15888
+ }
15889
+ list() {
15890
+ return this.c.request("GET", "/v1/advertiser/promote-campaigns");
15891
+ }
15892
+ /** Submit a promote campaign for review. */
15893
+ submit(id) {
15894
+ return this.c.request("POST", `/v1/advertiser/promote-campaigns/${encodeURIComponent(id)}/submit`);
15895
+ }
15896
+ /** Set a promote campaign's status (e.g. active, paused). */
15897
+ setStatus(id, status) {
15898
+ return this.c.request("POST", `/v1/advertiser/promote-campaigns/${encodeURIComponent(id)}/status`, {
15899
+ body: { status }
15900
+ });
15901
+ }
15902
+ };
15903
+ var ConversionsResource = class extends Resource {
15904
+ constructor(c) {
15905
+ super(c);
15906
+ }
15907
+ /**
15908
+ * Report an attributed purchase (advertiser postback / S2S). `clickId` is the
15909
+ * ad click id (adclid); `orderId` is the marketplace order id (dedup key);
15910
+ * `orderValue` is the gross order amount (sent as `order_value`). Optional
15911
+ * `value` overrides the billable value, `eventId` gives at-most-once
15912
+ * ingestion, and `campaignId` hints attribution when the click id can't
15913
+ * resolve one on its own.
15914
+ */
15915
+ purchase(req) {
15916
+ const { orderValue, ...rest } = req;
15917
+ return this.c.request("POST", "/v1/track/conversion", {
15918
+ body: { ...rest, order_value: orderValue }
15919
+ });
15920
+ }
15921
+ /** Report a refund / chargeback for a previously reported order — reverses
15922
+ * its settlement with a compensating ledger entry. */
15923
+ refund(req) {
15924
+ return this.c.request("POST", "/v1/track/refund", { body: req });
15925
+ }
15926
+ };
15927
+ var CurrenciesResource = class extends Resource {
15928
+ constructor(c) {
15929
+ super(c);
15930
+ }
15931
+ /** List all registered tokens/currencies and their USD rates. */
15932
+ list() {
15933
+ return this.c.request("GET", "/v1/finance/currencies");
15934
+ }
15935
+ /** Register or update the caller's token and its USD rate (or live feed). */
15936
+ register(req) {
15937
+ return this.c.request("POST", "/v1/finance/currencies", { body: req });
15938
+ }
15939
+ };
15940
+ var DoohResource = class extends Resource {
15941
+ constructor(c) {
15942
+ super(c);
15943
+ }
15944
+ /** Claim a pending screen by the code it is displaying (attaches venue + activates). */
15945
+ claimScreen(req) {
15946
+ return this.c.request("POST", "/v1/dooh/screens/claim", { body: req });
15947
+ }
15948
+ /** The caller's screen fleet, each with a live online flag. */
15949
+ listScreens() {
15950
+ return this.c.request("GET", "/v1/dooh/screens");
15951
+ }
15952
+ getScreen(id) {
15953
+ return this.c.request("GET", `/v1/dooh/screens/${encodeURIComponent(id)}`);
15954
+ }
15955
+ updateScreen(id, req) {
15956
+ return this.c.request("PATCH", `/v1/dooh/screens/${encodeURIComponent(id)}`, { body: req });
15957
+ }
15958
+ setScreenStatus(id, status) {
15959
+ return this.c.request("POST", `/v1/dooh/screens/${encodeURIComponent(id)}/status`, { body: { status } });
15960
+ }
15961
+ /** Publisher proof-of-play earnings report. */
15962
+ plays(params) {
15963
+ return this.c.request("GET", "/v1/dooh/plays", { query: params });
15964
+ }
15965
+ /** Advertiser proof-of-play VERIFICATION report (prove ads ran on real screens). */
15966
+ advertiserPlays(params) {
15967
+ return this.c.request("GET", "/v1/advertiser/dooh/plays", { query: params });
15968
+ }
15969
+ };
15970
+ var MetaverseResource = class extends Resource {
15971
+ constructor(c) {
15972
+ super(c);
15973
+ }
15974
+ /** Onboard a world integration (returns the signing secret ONCE). */
15975
+ createWorld(req) {
15976
+ return this.c.request("POST", "/v1/metaverse/worlds", { body: req });
15977
+ }
15978
+ listWorlds() {
15979
+ return this.c.request("GET", "/v1/metaverse/worlds");
15980
+ }
15981
+ /** Claim a pending surface by the code it is displaying (activates serving). */
15982
+ claimSurface(req) {
15983
+ return this.c.request("POST", "/v1/metaverse/surfaces/claim", { body: req });
15984
+ }
15985
+ listSurfaces() {
15986
+ return this.c.request("GET", "/v1/metaverse/surfaces");
15987
+ }
15988
+ getSurface(id) {
15989
+ return this.c.request("GET", `/v1/metaverse/surfaces/${encodeURIComponent(id)}`);
15990
+ }
15991
+ updateSurface(id, req) {
15992
+ return this.c.request("PATCH", `/v1/metaverse/surfaces/${encodeURIComponent(id)}`, { body: req });
15993
+ }
15994
+ setSurfaceStatus(id, status) {
15995
+ return this.c.request("POST", `/v1/metaverse/surfaces/${encodeURIComponent(id)}/status`, { body: { status } });
15996
+ }
15997
+ /** Publisher proof-of-view earnings report. */
15998
+ views(params) {
15999
+ return this.c.request("GET", "/v1/metaverse/views", { query: params });
16000
+ }
16001
+ /** Advertiser proof-of-view VERIFICATION report (real avatars, dwell, completions). */
16002
+ advertiserViews(params) {
16003
+ return this.c.request("GET", "/v1/advertiser/metaverse/views", { query: params });
16004
+ }
16005
+ /** ADMIN: latest automatic trust-score snapshot per world (CPA-only ⇄ CPM tiering). */
16006
+ adminTrustScores() {
16007
+ return this.c.request("GET", "/v1/admin/metaverse/trust-scores");
16008
+ }
16009
+ };
16010
+ var PortalTemplatesResource = class extends Resource {
16011
+ constructor(c) {
16012
+ super(c);
16013
+ }
16014
+ /** The template catalog (each with its schema-driven `fields`). */
16015
+ listTemplates() {
16016
+ return this.c.request("GET", "/v1/portal/templates");
16017
+ }
16018
+ /**
16019
+ * Store a portal config and get back `{ id, url }`. The `url` is the hosted
16020
+ * template with the config id baked in — pass it as an `html5` creative's
16021
+ * `assetUrl` (and the config's landing URL as `landingUrl`) to make a normal
16022
+ * creative attachable to a metaverse portal-surface campaign.
16023
+ */
16024
+ createConfig(req) {
16025
+ return this.c.request("POST", "/v1/portal/configs", { body: req });
16026
+ }
16027
+ };
16028
+ var RewardsResource = class extends Resource {
16029
+ constructor(c) {
16030
+ super(c);
16031
+ }
16032
+ /** Fund (or top up) a campaign's reward pool — escrows `amount` from your balance. */
16033
+ fundPool(req) {
16034
+ return this.c.request("POST", "/v1/rewards/pools", { body: req });
16035
+ }
16036
+ /**
16037
+ * Create an ADVERTISER-CUSTODIED, on-chain-in-the-creative reward pool. No escrow:
16038
+ * your own dApp/contract in the portal pays the user on-chain. Returns the pool
16039
+ * plus the one-time `voucher_secret` your contract/backend uses to verify the
16040
+ * eligibility voucher Adviverse issues on each verified completion before paying.
16041
+ */
16042
+ createOnchainPool(req) {
16043
+ return this.c.request("POST", "/v1/rewards/pools/onchain", { body: req });
16044
+ }
16045
+ /** Fetch a campaign's on-chain reward voucher secret (verify vouchers with it). */
16046
+ voucherSecret(campaignId) {
16047
+ return this.c.request("GET", `/v1/rewards/pools/${encodeURIComponent(campaignId)}/voucher-secret`);
16048
+ }
16049
+ /** List your reward pools. */
16050
+ listPools() {
16051
+ return this.c.request("GET", "/v1/rewards/pools");
16052
+ }
16053
+ /** Get one campaign's reward pool. */
16054
+ getPool(campaignId) {
16055
+ return this.c.request("GET", `/v1/rewards/pools/${encodeURIComponent(campaignId)}`);
16056
+ }
16057
+ /** Pause / resume a reward pool. */
16058
+ setPoolStatus(campaignId, status) {
16059
+ return this.c.request("POST", `/v1/rewards/pools/${encodeURIComponent(campaignId)}/status`, {
16060
+ body: { status }
16061
+ });
16062
+ }
16063
+ /** Reward-payout report: completions, amounts paid, per-campaign + per-payout rows. */
16064
+ report(params) {
16065
+ return this.c.request("GET", "/v1/rewards/report", { query: params });
16066
+ }
16067
+ /**
16068
+ * Point a metaverse world's reward-payout webhook at your endpoint. Adviverse
16069
+ * POSTs a signed `{ completion_id, campaign_id, user_ref, wallet, amount, token,
16070
+ * ts, sig }` per verified completion; you fulfil the end-user's on-chain payout.
16071
+ */
16072
+ setWorldWebhook(worldId, url) {
16073
+ return this.c.request("POST", "/v1/rewards/world-webhook", { body: { worldId, url } });
16074
+ }
16075
+ };
15659
16076
  var AdNetClient = class {
15660
16077
  constructor(opts) {
15661
16078
  if (!opts?.baseUrl) throw new Error("AdNetClient: baseUrl is required");
15662
16079
  this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
16080
+ this.servingBaseUrl = (opts.servingBaseUrl ?? "https://serve.adviverse.com").replace(/\/+$/, "");
15663
16081
  this.token = opts.token;
15664
16082
  this.apiKey = opts.apiKey;
15665
16083
  this.timeoutMs = opts.timeoutMs ?? 3e4;
@@ -15670,6 +16088,8 @@ var AdNetClient = class {
15670
16088
  this.fetchImpl = f.bind(globalThis);
15671
16089
  this.auth = new AuthResource(this);
15672
16090
  this.campaigns = new CampaignsResource(this);
16091
+ this.terminal = new TerminalResource(this);
16092
+ this.campaignGroups = new CampaignGroupsResource(this);
15673
16093
  this.creatives = new CreativesResource(this);
15674
16094
  this.properties = new PropertiesResource(this);
15675
16095
  this.placements = new PlacementsResource(this);
@@ -15706,6 +16126,14 @@ var AdNetClient = class {
15706
16126
  this.guides = new GuidesResource(this);
15707
16127
  this.blog = new BlogResource(this);
15708
16128
  this.stats = new StatsResource(this);
16129
+ this.marketplaceCatalog = new MarketplaceCatalogResource(this);
16130
+ this.promoteCampaigns = new PromoteCampaignsResource(this);
16131
+ this.conversions = new ConversionsResource(this);
16132
+ this.currencies = new CurrenciesResource(this);
16133
+ this.dooh = new DoohResource(this);
16134
+ this.metaverse = new MetaverseResource(this);
16135
+ this.portalTemplates = new PortalTemplatesResource(this);
16136
+ this.rewards = new RewardsResource(this);
15709
16137
  }
15710
16138
  /** Sets (or clears) the bearer session token used for subsequent requests. */
15711
16139
  setToken(token) {
@@ -15725,7 +16153,7 @@ var AdNetClient = class {
15725
16153
  }
15726
16154
  /** Low-level request. Most callers should use the typed resource methods. */
15727
16155
  async request(method, path2, opts = {}) {
15728
- const url = new URL(this.baseUrl + path2);
16156
+ const url = new URL((opts.baseUrl ?? this.baseUrl) + path2);
15729
16157
  if (opts.query) {
15730
16158
  for (const [k, v] of Object.entries(opts.query)) {
15731
16159
  if (v !== void 0) url.searchParams.set(k, String(v));
@@ -23998,35 +24426,57 @@ function createServer(client) {
23998
24426
  tool("public_stats", "Public network stats: total ads served and total paid out (Redis-cached).", {}, () => client.stats.public());
23999
24427
  tool("list_campaigns", "List the advertiser account's campaigns.", page, (a) => client.campaigns.list(a));
24000
24428
  tool("get_campaign", "Get one campaign by id.", { id: external_exports.string() }, (a) => client.campaigns.get(a.id));
24001
- tool("create_campaign", "Create a campaign. `fields` follows the API CreateCampaign body (name, format, pricingModel, bidAmount, budgetDaily, \u2026). Optional `utm` object ({enabled,source,medium,campaign,content,term}) tags the landing URL for the advertiser's own analytics; omit for the default (enabled, auto values).", { fields, idempotencyKey: idem }, (a) => client.campaigns.create(a.fields, a.idempotencyKey));
24002
- tool("update_campaign", "Update a campaign (partial fields).", { id: external_exports.string(), fields }, (a) => client.campaigns.update(a.id, a.fields));
24429
+ tool("create_campaign", "Create a campaign. `fields` follows the API CreateCampaign body (name, format, pricingModel, bidAmount, budgetDaily, \u2026). Optional `utm` object ({enabled,source,medium,campaign,content,term}) tags the landing URL for the advertiser's own analytics; omit for the default (enabled, auto values). Routing booleans (both default true): `autoOwnPlacements` \u2014 a house/backfill-tier campaign also runs on every placement your account publishes, even if not on its placement whitelist; `networkExpansion` \u2014 smart routing weights delivery toward sites where similar ads perform well (false = pure targeting).", { fields, idempotencyKey: idem }, (a) => client.campaigns.create(a.fields, a.idempotencyKey));
24430
+ tool("update_campaign", "Update a campaign (partial fields, incl. autoOwnPlacements / networkExpansion routing booleans).", { id: external_exports.string(), fields }, (a) => client.campaigns.update(a.id, a.fields));
24431
+ tool("delete_campaign", "Delete a campaign (soft-delete): stops serving and removes it from the list; past spend/stats stay in reporting.", { id: external_exports.string() }, (a) => client.campaigns.remove(a.id));
24003
24432
  tool("submit_campaign", "Submit a campaign for review.", { id: external_exports.string() }, (a) => client.campaigns.submit(a.id));
24004
24433
  tool("set_campaign_status", "Set a campaign status (e.g. active, paused).", { id: external_exports.string(), status: external_exports.string() }, (a) => client.campaigns.setStatus(a.id, a.status));
24434
+ tool("upsert_marketplace_catalog", "Bulk upsert marketplace catalog items (create or update by external_id). fields.items = [{ external_id, title, description?, image_url?, price?, currency?, landing_url?, brand?, category?, keywords?: string[], availability? }]. These SKUs become eligible to be promoted as sponsored products in search.", { items: external_exports.array(fields) }, (a) => client.marketplaceCatalog.upsert(a.items));
24435
+ tool("list_marketplace_catalog", "List the marketplace catalog items the account has uploaded.", {}, () => client.marketplaceCatalog.list());
24436
+ tool("create_promote_campaign", 'Create a seller "promote products" campaign (sponsored products). fields (camelCase): { name, pricingModel: cpc|cpa, bidAmount (max CPC, or the flat CPA rate \u2014 required unless cpaMode=percent), cpaMode?: flat|percent (CPA basis), cpaPercent? (fraction of order value billed per checkout when cpaMode=percent, 0\u20131 e.g. 0.15=15%), minOrderValue? (anti-fraud floor; checkouts below it never bill), budgetDaily?, budgetTotal?, pacing?, currency?, itemSelector ({item_ids:[]} | {keywords:[]} | {all:true}), targeting? }.', { fields }, (a) => client.promoteCampaigns.create(a.fields));
24437
+ tool("list_promote_campaigns", "List the account's promote-products campaigns.", {}, () => client.promoteCampaigns.list());
24438
+ tool("submit_promote_campaign", "Submit a promote-products campaign for review.", { id: external_exports.string() }, (a) => client.promoteCampaigns.submit(a.id));
24439
+ tool("set_promote_campaign_status", "Set a promote-products campaign status (e.g. active, paused).", { id: external_exports.string(), status: external_exports.string() }, (a) => client.promoteCampaigns.setStatus(a.id, a.status));
24440
+ tool("report_conversion", "Report an attributed purchase (advertiser postback / S2S) for per-checkout (CPA) settlement. clickId = the ad click id (adclid) captured on the landing page; orderId = the marketplace order id (dedup key); orderValue = gross order amount (sent as order_value). Optional: value (billable-value override), eventId (at-most-once ingestion), campaignId (attribution hint). A verified, deduped Purchase debits the advertiser (CPA) and credits the publisher (rev-share).", { clickId: external_exports.string(), orderId: external_exports.string(), orderValue: external_exports.number(), value: external_exports.number().optional(), eventId: external_exports.string().optional(), campaignId: external_exports.string().optional() }, (a) => client.conversions.purchase({ clickId: a.clickId, orderId: a.orderId, orderValue: a.orderValue, value: a.value, eventId: a.eventId, campaignId: a.campaignId }));
24441
+ tool("report_refund", "Report a refund / chargeback for a previously reported order \u2014 reverses its CPA settlement with a compensating (append-only) ledger entry. orderId = the marketplace order id to reverse; advertiserId optionally scopes the reversal.", { orderId: external_exports.string(), advertiserId: external_exports.string().optional() }, (a) => client.conversions.refund({ orderId: a.orderId, advertiserId: a.advertiserId }));
24005
24442
  tool("list_creatives", "List the advertiser's whole creative library.", {}, () => client.creatives.list());
24006
24443
  tool("list_campaign_creatives", "List creatives serving a campaign (authored + attached).", { campaignId: external_exports.string() }, (a) => client.creatives.listForCampaign(a.campaignId));
24007
24444
  tool("get_creative", "Get one creative by id.", { id: external_exports.string() }, (a) => client.creatives.get(a.id));
24008
- tool("create_creative", "Create a creative (full Studio parity \u2014 camelCase fields). fields: { type: image|native|popunder_url|push|html5|video, landingUrl, assetUrl?, title?, description?, iconUrl?, mainImageUrl?, cta?, brandName?, starRating?(0-5), width?, height?, weight?, campaignId? (omit for library-only) }. Use upload to host an asset, then add DCO variants via add_creative_component / set_creative_dco.", { fields }, (a) => client.creatives.create(a.fields));
24009
- tool("update_creative", "Update a creative's content (camelCase fields: assetUrl, landingUrl, title, description, iconUrl, mainImageUrl, cta, brandName, starRating, width, height, weight). type & campaignId are fixed at creation.", { id: external_exports.string(), fields }, (a) => client.creatives.update(a.id, a.fields));
24445
+ tool("create_creative", "Create a creative (full Studio parity \u2014 camelCase fields). fields: { type: image|native|popunder_url|push|html5|video|audio, landingUrl, assetUrl?, title?, description?, iconUrl?, mainImageUrl?, cta?, brandName?, starRating?(0-5), width?, height?, weight?, campaignId? (omit for library-only), duration?(sec 1-600), skipOffsetSec?(0-600, >0 = skippable), vpaidUrl?(https), companions?[{width,height,staticUrl(https),staticMime?,clickUrl?}] (max 5), vastTagUrl?(https third-party VAST tag; video/audio only) }. A video creative needs assetUrl OR vastTagUrl \u2014 with only vastTagUrl it serves as a VAST Wrapper around your own ad server's tag (duration is probed from the tag when omitted). type html5 = a playable (interactive HTML5) \u2014 host the ZIP via POST /v1/advertiser/creatives/playable first (returns assetUrl), then create with type html5 + that assetUrl on a full-screen/interstitial placement. Use upload to host a static asset, then add DCO variants via add_creative_component / set_creative_dco.", { fields }, (a) => client.creatives.create(a.fields));
24446
+ tool("update_creative", "Update a creative's content (camelCase fields: assetUrl, landingUrl, title, description, iconUrl, mainImageUrl, cta, brandName, starRating, width, height, weight, carouselItems, duration, skipOffsetSec, vpaidUrl, companions, vastTagUrl (null clears)). Changing assetUrl/landing/text/vastTagUrl/vpaidUrl/companions re-enters moderation. type & campaignId are fixed at creation.", { id: external_exports.string(), fields }, (a) => client.creatives.update(a.id, a.fields));
24010
24447
  tool("delete_creative", "Delete a creative.", { id: external_exports.string() }, (a) => client.creatives.delete(a.id));
24011
24448
  tool("attach_creative", "Attach a library creative to a campaign (optional rotation weight).", { id: external_exports.string(), campaignId: external_exports.string(), weight: external_exports.number().optional() }, (a) => client.creatives.attach(a.id, a.campaignId, a.weight));
24012
24449
  tool("detach_creative", "Detach a library creative from a campaign.", { id: external_exports.string(), campaignId: external_exports.string() }, (a) => client.creatives.detach(a.id, a.campaignId));
24013
24450
  tool("creative_campaigns", "List campaigns a library creative is attached to.", { id: external_exports.string() }, (a) => client.creatives.campaigns(a.id));
24451
+ tool("serve_terminal_ad", "Fetch ONE rotated terminal (CLI status-line) ad from YOUR OWN active terminal campaigns. Auth: a public `token` (ts_\u2026) if given, else this key. Rotation/eligibility/frequency capping applied server-side. Optional campaignId narrows to one campaign; uid is a stable per-install id. Returns { text, cta, url, impression_url, ... } or {} on no-fill.", { token: external_exports.string().optional(), campaignId: external_exports.string().optional(), uid: external_exports.string().optional() }, (a) => client.terminal.serve({ token: a.token, campaignId: a.campaignId, uid: a.uid }));
24452
+ tool("create_terminal_token", "Mint a PUBLIC terminal serve token (ts_\u2026) \u2014 a non-secret, serve-only credential SAFE to embed in a distributed CLI/desktop app. Optionally pin it to one terminal campaign, and/or arm adaptive mode-switching (`switch`) so the engine flips each install from YOUR ads to the marketplace after it engages. Returns { id, token, ... }.", { name: external_exports.string().optional(), campaignId: external_exports.string().optional(), switch: external_exports.object({ flipAfter: external_exports.number().int().min(0).optional(), flipOnClick: external_exports.boolean().optional(), fallbackTag: external_exports.string().optional() }).optional() }, (a) => client.terminal.createToken({ name: a.name, campaignId: a.campaignId, switch: a.switch }));
24453
+ tool("list_terminal_tokens", "List your public terminal serve tokens (includes each token's switch policy).", {}, () => client.terminal.listTokens());
24454
+ tool("set_terminal_token_policy", "Arm / update / disable a terminal serve token's adaptive mode-switching policy IN PLACE (the ts_ value keeps working). `flipAfter` flips an install to the marketplace after N self-network impressions; `flipOnClick` flips once it clicks your ad; `fallbackTag` (tk_\u2026, one of your own placements) is served post-flip (omit = flip to no ad). Needs a campaign-pinned token. Pass all-zero/empty to disable.", { id: external_exports.string(), flipAfter: external_exports.number().int().min(0).optional(), flipOnClick: external_exports.boolean().optional(), fallbackTag: external_exports.string().optional() }, (a) => client.terminal.setTokenPolicy(a.id, { flipAfter: a.flipAfter, flipOnClick: a.flipOnClick, fallbackTag: a.fallbackTag }));
24455
+ tool("rotate_terminal_token", "Rotate a terminal serve token by id (its old value stops working immediately). Returns the new token. The switch policy is preserved.", { id: external_exports.string() }, (a) => client.terminal.rotateToken(a.id));
24456
+ tool("revoke_terminal_token", "Revoke (delete) a terminal serve token by id.", { id: external_exports.string() }, (a) => client.terminal.revokeToken(a.id));
24014
24457
  tool("list_properties", "List publisher properties (sites, CLIs, apps).", page, (a) => client.properties.list(a));
24015
24458
  tool("create_property", "Register a property. fields: { kind: website|cli|mobile_app|ctv, domain, name?, verificationMethod? }.", { fields, idempotencyKey: idem }, (a) => client.properties.create(a.fields, a.idempotencyKey));
24016
- tool("update_property", "Update a property. fields: { name?, domain?, category?, verificationMethod? }. Changing the domain resets verification.", { id: external_exports.string(), fields }, (a) => client.properties.update(a.id, a.fields));
24459
+ tool("update_property", "Update a property. fields: { name?, domain?, category? (site-niche id from list_site_niches; manual, 0 = back to auto-detect), verificationMethod?, crossFill? }. Changing the domain resets verification and trust.", { id: external_exports.string(), fields }, (a) => client.properties.update(a.id, a.fields));
24460
+ tool("get_property_ads_txt", "A property's ads.txt line(s), to publish at https://<domain>/ads.txt.", { id: external_exports.string() }, (a) => client.properties.adsTxt(a.id));
24017
24461
  tool("verify_property", "Trigger ownership verification for a property.", { id: external_exports.string() }, (a) => client.properties.verify(a.id));
24018
- tool("list_placements", "List ad placements.", page, (a) => client.placements.list(a));
24462
+ tool("classify_property", "Re-detect a website property's niche from its pages; returns the top-3 niches. Updates category only if it was auto-detected.", { id: external_exports.string() }, (a) => client.properties.classify(a.id));
24463
+ tool("list_site_niches", "The site-niche taxonomy (IAB v1 tier-1 ids + names) used by property category and campaign targeting propertyCategoryInclude/Exclude.", {}, () => client.properties.niches());
24464
+ tool("set_serving_domain", "Set a first-party ad-serving domain on a property (anti-adblock). The publisher CNAMEs this host to our edge; returns the CNAME target. Pass domain:null to remove.", { id: external_exports.string(), domain: external_exports.string().nullable() }, (a) => client.properties.setServingDomain(a.id, a.domain));
24465
+ tool("verify_serving_domain", "Verify a property custom serving domain CNAMEs to our edge (routes traffic + proves control). On success the tag serves first-party.", { id: external_exports.string() }, (a) => client.properties.verifyServingDomain(a.id));
24466
+ tool("list_placements", "List ad placements. has_signing_secret says whether signed-tag enforcement is on (the secret itself is only returned by rotate_placement_signing_secret).", page, (a) => client.placements.list(a));
24019
24467
  tool("create_placement", "Create a placement. fields: { propertyId, name, format, floorCpm, \u2026 }.", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
24020
- tool("get_placement_tag", "Get the ad tag / install code for a placement.", { id: external_exports.string() }, (a) => client.placements.tag(a.id));
24468
+ tool("get_placement_tag", "Get the ad tag / install code for a placement (responsive banners also return autoAdsScript, the one-line site-wide auto-ads tag).", { id: external_exports.string() }, (a) => client.placements.tag(a.id));
24021
24469
  tool("rotate_placement_signing_secret", "Generate/rotate a placement signing secret (Layer 3, returned once). With a secret set, the engine only serves /terminal requests carrying a valid HMAC signature.", { id: external_exports.string() }, (a) => client.placements.rotateSigningSecret(a.id));
24022
24470
  tool("disable_placement_signing", "Disable signed-tag enforcement on a placement.", { id: external_exports.string() }, (a) => client.placements.disableSigning(a.id));
24023
24471
  tool("list_combo_presets", "List the static combo / layout presets (each bundles several ad units: standard_combo, leaderboard_pop, social_push, sticky_interstitial, full_monetization).", {}, () => client.placements.comboPresets());
24024
24472
  tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
24025
- tool("get_balance", "Get the account balance (available / held).", {}, () => client.finance.balance());
24473
+ tool("get_balance", "Get the account balance (available / held). The balance currency may be a tenant's own platform-token code (not an ISO code).", {}, () => client.finance.balance());
24026
24474
  tool("list_ledger", "List ledger entries.", { limit: external_exports.number().optional(), offset: external_exports.number().optional() }, (a) => client.finance.ledger({ limit: a.limit, offset: a.offset }));
24027
24475
  tool("advertiser_report", "Advertiser spend/performance report.", reportQuery, (a) => client.reporting.advertiser(a));
24028
24476
  tool("publisher_report", "Publisher revenue/delivery report.", reportQuery, (a) => client.reporting.publisher(a));
24029
- tool("publisher_placements_report", "Per-placement publisher rollup: impressions, clicks, CTR, revenue, RPM, eCPM, fill rate and viewable rate.", reportQuery, (a) => client.reporting.publisherPlacements(a));
24477
+ tool("publisher_placements_report", "Per-placement publisher rollup: impressions, clicks, CTR, revenue, RPM, eCPM, fill rate, paid fill rate (paid_fill_rate: house/self-promo fills excluded), viewable rate, and layout shift the slot causes (cls_avg per measured impression, cls_poor_rate = share with CLS > 0.1; reserve the slot box size to fix).", reportQuery, (a) => client.reporting.publisherPlacements(a));
24478
+ tool("publisher_fill_report", "Publisher fill summary: requests, filled, fill_rate, paid_filled + paid_fill_rate (paid demand only, house/self-promo excluded; rates are %), and no-fill counts by reason.", reportQuery, (a) => client.reporting.publisherFill(a));
24479
+ tool("anti_adblock_report", "Anti-adblock: impressions recovered from visitors running an adblocker (served first-party), with daily series + recovered %.", reportQuery, (a) => client.reporting.antiAdblock(a));
24030
24480
  const dealRole = external_exports.enum(["advertiser", "publisher"]).optional().describe("Which side to view: deals where the account is the publisher (seller) or advertiser (buyer). Omit for the account default.");
24031
24481
  tool("list_deals", "List private marketplace deals.", { ...page, role: dealRole }, (a) => client.deals.list(a));
24032
24482
  tool(
@@ -24224,7 +24674,7 @@ function createServer(client) {
24224
24674
  tool("property_domain_connect", "Initiate DomainConnect DNS automation for a property.", { id: external_exports.string() }, (a) => client.properties.domainConnect(a.id));
24225
24675
  tool("delete_property", "Delete a publisher property.", { id: external_exports.string() }, (a) => client.properties.delete(a.id));
24226
24676
  tool("property_mfa_score", "A property's Made-For-Advertising quality score + guidance.", { id: external_exports.string() }, (a) => client.properties.mfa(a.id));
24227
- tool("update_placement", "Update a placement (partial fields: floorCpm, floorSoft, revShare, status, houseShare, \u2026). Set floorAuto:true to let the yield optimizer manage floorCpm + floorSoft automatically from recent clearing prices (floorAuto:false = full manual control).", { id: external_exports.string(), fields }, (a) => client.placements.update(a.id, a.fields));
24677
+ tool("update_placement", `Update a placement (partial fields: floorCpm, floorSoft, revShare, status, houseShare, \u2026). Set floorAuto:true to let the yield optimizer manage floorCpm + floorSoft automatically from recent clearing prices (floorAuto:false = full manual control). autoAds tunes auto ads on a responsive banner placement (stored at settings.auto_ads, wins over the page's data-max): { enabled?, max?(1-10), every?(paragraphs between ads, 2-12), min_paragraph_chars?(0-2000), exclude_paths?["/checkout*"], selectors?[css] } \u2014 null clears.`, { id: external_exports.string(), fields }, (a) => client.placements.update(a.id, a.fields));
24228
24678
  tool("list_feeds", "List product feeds.", {}, () => client.feeds.list());
24229
24679
  tool("create_feed", "Create a product feed. fields: { name, url, format: csv|xml|google_merchant, scheduleCron? }.", { fields }, (a) => client.feeds.create(a.fields));
24230
24680
  tool("fetch_feed", "Trigger an immediate feed fetch/refresh.", { id: external_exports.string() }, (a) => client.feeds.fetch(a.id));
@@ -24242,11 +24692,25 @@ function createServer(client) {
24242
24692
  tool("issue_invoice", "Issue a draft invoice (admin).", { id: external_exports.string() }, (a) => client.billing.issueInvoice(a.id));
24243
24693
  tool("pay_invoice", "Pay an invoice (advertiser own; admin any).", { id: external_exports.string() }, (a) => client.billing.payInvoice(a.id));
24244
24694
  tool("void_invoice", "Void an invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
24245
- tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|paypal|crypto|mock, currency? }.", { fields }, (a) => client.finance.deposit(a.fields));
24695
+ tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|card|paypal|crypto|wire|paxum|mock, currency? }. card=Stripe card checkout; wire/paxum are instruction-based \u2014 the response carries where to send funds + a reference, and the balance is credited once receipt is confirmed. Accounts on a tenant network transact in that tenant's own platform token: currency is the token code and amount is denominated in it.", { fields }, (a) => client.finance.deposit(a.fields));
24246
24696
  tool("list_deposits", "List deposit history.", {}, () => client.finance.deposits());
24247
- tool("request_payout", "Request a publisher payout. fields: { amount, method: paypal|crypto, destination? }.", { fields }, (a) => client.finance.requestPayout(a.fields));
24697
+ tool("request_payout", "Request a publisher payout. fields: { amount, method: crypto|paxum|wire, destination? }. crypto\u2192OxaPay, paxum\u2192Paxum wallet email (destination.email), wire\u2192bank transfer (destination bank fields; settled once ops confirms it was sent).", { fields }, (a) => client.finance.requestPayout(a.fields));
24248
24698
  tool("list_payouts", "List payout history.", {}, () => client.finance.payouts());
24249
24699
  tool("get_tax_form", "Get the saved payout tax form (W-9 / W-8BEN).", {}, () => client.finance.taxForm());
24700
+ tool("list_currencies", "List all registered platform tokens / currencies and their USD rates. Feed-backed tokens also show their live price-feed URL (rate_url), the JSON dot-path (rate_json_path), and last_rate_at (when the feed last synced usd_micro).", {}, () => client.currencies.list());
24701
+ tool("register_currency", "Register or update YOUR tenant's own token and its USD rate. Provide EITHER a static `usdMicro` (micro-USD per unit, 1_000_000 = $1.00) OR a live `rateUrl` \u2014 a price API returning the token's USD price, polled to keep the rate current \u2014 with an optional `rateJsonPath` dot-path to the numeric price in the response (e.g. 'price' or 'data.usd'; empty = the body is the bare number or a { price: ... }). A code owned by another account cannot be overwritten.", { code: external_exports.string(), name: external_exports.string(), usdMicro: external_exports.number().optional(), rateUrl: external_exports.string().optional(), rateJsonPath: external_exports.string().optional() }, (a) => client.currencies.register({ code: a.code, name: a.name, usdMicro: a.usdMicro, rateUrl: a.rateUrl, rateJsonPath: a.rateJsonPath }));
24702
+ tool("list_dooh_screens", "List the account's DOOH screens (physical screens running the Adviverse player), each with venue, resolution, loop length, status, and a live `online` flag derived from the screen's heartbeat.", {}, () => client.dooh.listScreens());
24703
+ tool("dooh_proof_of_play_report", 'Proof-of-play report over a date range (default last 30 days). scope="advertiser" verifies YOUR ads actually ran on real screens (what creative/campaign played, on which screen/venue, when, duration, completed, spend, screenshots if present); scope="publisher" is your screen-fleet earnings. Returns { summary, rows }.', { scope: external_exports.enum(["advertiser", "publisher"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => a.scope === "publisher" ? client.dooh.plays({ from: a.from, to: a.to }) : client.dooh.advertiserPlays({ from: a.from, to: a.to }));
24704
+ tool("create_metaverse_world", "Onboard a metaverse world integration. Returns a signing_secret ONCE \u2014 the world's server signs proofs of view with it (attestation). fields: { name, networkId? (the tenant network these surfaces belong to) }.", { fields }, (a) => client.metaverse.createWorld(a.fields));
24705
+ tool("list_metaverse_surfaces", "List the account's metaverse ad surfaces (screens/posters/portals placed in shops), each with venue, status, and a live `online` flag.", {}, () => client.metaverse.listSurfaces());
24706
+ tool("metaverse_proof_of_view_report", 'Proof-of-view report over a date range (default last 30 days). scope="advertiser" verifies YOUR ads were actually seen by real avatars (dwell, distance, portal completions, spend); scope="publisher" is your surface earnings. Returns { summary, rows }.', { scope: external_exports.enum(["advertiser", "publisher"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => a.scope === "publisher" ? client.metaverse.views({ from: a.from, to: a.to }) : client.metaverse.advertiserViews({ from: a.from, to: a.to }));
24707
+ tool("metaverse_trust_scores", "ADMIN: the automatic world TRUST-SCORING snapshot. Each world's last-7-day proof-of-view traffic is scored 0..1 (attested-identity rate, IVT valid rate, unique-user ratio, dwell plausibility); clean high-volume worlds are auto-promoted from CPA-only ('unverified') to CPM ('trusted'), degraded ones demoted. Returns per-world { current_tier, auto_tier, score, views_7d, valid_rate, attested_rate, unique_user_ratio, dwell_cv, factors }.", {}, () => client.metaverse.adminTrustScores());
24708
+ tool("list_portal_templates", "List the prebuilt HTML5 portal experience templates an advertiser can configure WITHOUT authoring a bundle (e.g. product-showcase, spin-to-win, 360-viewer). Each returns { key, name, description, fields:[{ key, label, type, required? }] } \u2014 the `fields` define that template's config shape.", {}, () => client.portalTemplates.listTemplates());
24709
+ tool("create_portal_experience", "Create a configured portal experience from a template. fields: { template (a key from list_portal_templates), config (the template's fields, e.g. { title, productImage, ctaUrl, bgColor }) }. Returns { id, url } \u2014 the hosted template URL. Pass that url as an `html5` creative's assetUrl (via create_creative) and the config's ctaUrl as landingUrl to make a normal creative attachable to a metaverse PORTAL surface campaign.", { fields }, (a) => client.portalTemplates.createConfig(a.fields));
24710
+ tool("fund_reward_pool", "Fund (or top up) a metaverse portal/experience campaign's REWARD POOL. Each VERIFIED completion pays the end-user a crypto reward \u2014 TENANT-CUSTODIED (Adviverse escrows your money + emits a signed payout webhook; the metaverse operator fulfils the on-chain payout in its own coin). fields (camelCase): { campaignId, perCompletion (fixed reward per completion), amount (escrowed now from your balance), token? (reward denomination; defaults to your account currency), perUserDailyCap?, perWalletDailyCap? }. Escrow reduces your available balance; insufficient funds is refused.", { fields }, (a) => client.rewards.fundPool(a.fields));
24711
+ tool("create_onchain_reward_pool", "Create an ADVERTISER-CUSTODIED, on-chain-in-the-creative reward pool. Your OWN dApp/contract inside the portal experience pays the end-user on-chain in a coin YOU choose (BTC/ETH/USDC/\u2026); Adviverse never touches the crypto \u2014 it only verifies each completion (attested real user + per-user/per-wallet daily caps + no replay) and hands the creative a single-use signed ELIGIBILITY VOUCHER your contract verifies before paying. NO escrow / no funding. fields (camelCase): { campaignId, perCompletion (display amount; real amount enforced by your contract), token (coin symbol), chain? (e.g. bitcoin/ethereum/base), perUserDailyCap?, perWalletDailyCap? }. Returns the pool plus a one-time `voucher_secret` \u2014 embed it in your contract/backend to verify vouchers.", { fields }, (a) => client.rewards.createOnchainPool(a.fields));
24712
+ tool("reward_voucher_secret", "Fetch a campaign's on-chain reward VOUCHER SECRET (the HMAC key your contract/backend uses to verify the eligibility voucher Adviverse issues on each verified completion). Applies to on-chain reward pools only. fields: { campaignId }.", { campaignId: external_exports.string() }, (a) => client.rewards.voucherSecret(a.campaignId));
24713
+ tool("reward_report", "Reward-payout report over a date range (default last 30 days): completions, amount paid, distinct recipients, sent/pending/failed webhook counts (tenant-custodied) + attributed/tx-confirmed on-chain counts (advertiser-custodied), a per-campaign breakdown, your pools (funded/spent/mode), and per-payout rows (incl. tx_hash for on-chain payouts).", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.rewards.report({ from: a.from, to: a.to }));
24250
24714
  tool("submit_tax_form", "Submit/update the payout tax form. fields: { formType: w9|w8ben, legalName, taxId, address, country, certified, taxClassification? }.", { fields }, (a) => client.finance.submitTaxForm(a.fields));
24251
24715
  tool("run_export", "Export analytics to a warehouse format. fields: { dataset: events|conversions|spend, from, to, format?: ndjson|csv }.", { fields }, (a) => client.exports.run(a.fields));
24252
24716
  tool("list_exports", "List export jobs.", {}, () => client.exports.list());
@@ -24256,14 +24720,15 @@ function createServer(client) {
24256
24720
  tool("list_automation_rules", "List automation rules.", {}, () => client.automation.rules());
24257
24721
  tool("create_automation_rule", "Create an automation rule. fields: { name?, scope?: campaign|all, targetId?, metric?: cpa|ctr|spend|conversions|fill_rate, operator?: gt|lt, threshold?, windowHours?, action?: pause|resume|notify|adjust_bid, actionValue?, enabled? }.", { fields }, (a) => client.automation.createRule(a.fields));
24258
24722
  tool("delete_automation_rule", "Delete an automation rule.", { id: external_exports.string() }, (a) => client.automation.deleteRule(a.id));
24723
+ tool("set_automation_rule_enabled", "Enable or disable an automation rule (pause it without deleting).", { id: external_exports.string(), enabled: external_exports.boolean() }, (a) => client.automation.setRuleEnabled(a.id, a.enabled));
24259
24724
  tool("optimizer_log", "Recent automated budget-reallocation actions.", { limit: external_exports.number().optional() }, (a) => client.automation.optimizerLog(a.limit));
24260
24725
  tool("list_alerts", "List anomaly/optimizer alerts.", {}, () => client.automation.alerts());
24261
24726
  tool("ack_alert", "Acknowledge (mark read) an alert.", { id: external_exports.string() }, (a) => client.automation.ackAlert(a.id));
24262
- tool("identity_resolve", "Resolve a canonical identity from signals. fields: { email?, phone?, cookieId?, deviceId? }.", { fields }, (a) => client.identity.resolve(a.fields));
24263
- tool("identity_link", "Link signals to a canonical id. fields: { canonicalId, signals: [{type,value}] }.", { fields }, (a) => client.identity.link(a.fields));
24264
- tool("identity_consent", "Set consent for a canonical id. fields: { canonicalId, state: granted|denied }.", { fields }, (a) => client.identity.setConsent(a.fields));
24265
- tool("identity_stats", "Identity graph stats.", {}, () => client.identity.stats());
24266
- tool("get_identity", "Get an identity record by canonical id.", { canonicalId: external_exports.string() }, (a) => client.identity.get(a.canonicalId));
24727
+ tool("identity_resolve", "Resolve a canonical identity from signals (shared graph; you become an owner of the signals you supply, and only your own signals are returned; unifiedId is per-advertiser, not comparable across accounts). fields: { email?, phone?, cookieId?, deviceId? }.", { fields }, (a) => client.identity.resolve(a.fields));
24728
+ tool("identity_link", "Link signals to a canonical id you own (404 otherwise; 409 if a signal sits on another identity and you never supplied it). fields: { canonicalId, signals: [{type,value}] }.", { fields }, (a) => client.identity.link(a.fields));
24729
+ tool("identity_consent", "Set consent for a canonical id you own (404 otherwise). fields: { canonicalId, state: granted|denied }.", { fields }, (a) => client.identity.setConsent(a.fields));
24730
+ tool("identity_stats", "Identity stats for your own identities/signals (admins: graph-wide).", {}, () => client.identity.stats());
24731
+ tool("get_identity", "Get an identity you own by canonical id, with only the signals you supplied (404 if you own none of its signals).", { canonicalId: external_exports.string() }, (a) => client.identity.get(a.canonicalId));
24267
24732
  tool("list_apps", "List publisher mobile/CTV apps.", {}, () => client.apps.list());
24268
24733
  tool("get_app", "Get one app by id.", { id: external_exports.string() }, (a) => client.apps.get(a.id));
24269
24734
  tool("create_app", "Register a mobile/CTV app. fields: { kind: mobile_app|ctv, name, bundleId, platform, storeUrl?, appStoreId?, category?, ctvMeta? }.", { fields }, (a) => client.apps.create(a.fields));
@@ -24271,7 +24736,7 @@ function createServer(client) {
24271
24736
  tool("get_app_ads_txt", "An app's generated app-ads.txt content.", { id: external_exports.string() }, (a) => client.apps.appAdsTxt(a.id));
24272
24737
  tool("report_ivt", "Invalid-traffic breakdown.", reportQuery, (a) => client.reporting.ivt(a));
24273
24738
  tool("report_reach", "Reach & frequency (unique users): total reach, average frequency, a frequency-distribution histogram (impressions per user), and daily unique reach.", reportQuery, (a) => client.reporting.reach(a));
24274
- tool("report_breakdown", "Impressions/clicks/CTR broken down by a dimension the hourly rollup drops: bdim = 'os' | 'browser' | 'deal' (PMP) | 'page' (page host). Defaults to os.", { ...reportQuery, bdim: external_exports.enum(["os", "browser", "deal", "page"]).optional().describe("os | browser | deal | page") }, (a) => client.reporting.breakdown(a));
24739
+ tool("report_breakdown", "Impressions/clicks/CTR/revenue/eCPM broken down by a dimension the hourly rollup drops: bdim = 'os' | 'browser' | 'deal' (PMP) | 'page' (site, by host) | 'page_url' (individual page, host+path \u2014 earnings per page) | 'app' (in-app/in-game app id \u2014 earnings per app) | 'property' (owning property) | 'region' | 'make'/'model' (device) | 'sub1'..'sub5' (affiliate sub-ids). revenue is publisher earnings or advertiser spend depending on the account. Defaults to os.", { ...reportQuery, bdim: external_exports.enum(["os", "browser", "deal", "page", "page_url", "app", "property", "region", "make", "model", "sub1", "sub2", "sub3", "sub4", "sub5"]).optional().describe("os | browser | deal | page | page_url | app | property") }, (a) => client.reporting.breakdown(a));
24275
24740
  tool("report_creatives", "Per-creative performance for the advertiser: impressions, clicks, CTR, conversions, CVR per creative, plus a daily-CTR fatigue series for the top creative.", reportQuery, (a) => client.reporting.creatives(a));
24276
24741
  tool("report_roas", "Advertiser ROAS / conversion-value daily trend: spend, conversions, conversion value, and ROAS (value/spend) per day.", reportQuery, (a) => client.reporting.roas(a));
24277
24742
  tool("report_time_to_click", "Time-to-click engagement latency: average, median, and a distribution histogram (<1s / 1-3s / 3-10s / 10-30s / 30s+).", reportQuery, (a) => client.reporting.timeToClick(a));
@@ -24292,6 +24757,9 @@ function createServer(client) {
24292
24757
  tool("report_closed_loop", "Closed-loop full-funnel attribution for house campaigns.", reportQuery, (a) => client.reporting.closedLoop(a));
24293
24758
  tool("report_personal_network", "Personal Network (house ads) infra fees + delivery.", reportQuery, (a) => client.reporting.personalNetwork(a));
24294
24759
  tool("report_viewability", "Viewability metrics grouped by placement or campaign.", { groupBy: external_exports.enum(["placement", "campaign"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.viewability(a));
24760
+ tool("report_video", "Video completion analytics from quartile tracking: a funnel (starts \u2192 firstQuartile \u2192 midpoint \u2192 thirdQuartile \u2192 completes) with completionRate (completes\xF7starts), per-quartile retention, skips/skipRate and VAST error counts, plus a breakdown by placement (publisher) or campaign (advertiser). Returns { funnel, breakdown }.", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.video(a));
24761
+ tool("report_affiliate", "Affiliate sub-id performance: the FULL funnel per sub-id \u2014 impressions \u2192 clicks \u2192 conversions with CTR, CVR, revenue and payout. `sub` groups by sub1..sub5 (default sub1). Conversions/payout/CVR populate on advertiser scope (conversions carry no publisher_id).", { sub: external_exports.enum(["sub1", "sub2", "sub3", "sub4", "sub5"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.affiliate(a));
24762
+ tool("report_carousel", "Per-card carousel click attribution: clicks per card (0-based index) of each carousel creative, with the card title/price. Advertiser-scoped.", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.carousel(a));
24295
24763
  tool("list_saved_reports", "List saved report configs.", {}, () => client.reporting.saved());
24296
24764
  tool("save_report", "Save a report configuration. fields: { name?, config? }.", { fields }, (a) => client.reporting.saveSaved(a.fields));
24297
24765
  tool("delete_saved_report", "Delete a saved report.", { id: external_exports.string() }, (a) => client.reporting.deleteSaved(a.id));
@@ -24352,7 +24820,8 @@ function createServer(client) {
24352
24820
  {},
24353
24821
  () => client.publisherInsights.deals()
24354
24822
  );
24355
- tool("list_webhooks", "List webhook subscriptions.", {}, () => client.webhooks.list());
24823
+ tool("list_webhooks", "List webhook subscriptions (secrets omitted: has_secret + secret_hint only).", {}, () => client.webhooks.list());
24824
+ tool("reveal_webhook_secret", "Return a webhook endpoint's HMAC signing secret (whsec_...).", { id: external_exports.string() }, (a) => client.webhooks.revealSecret(a.id));
24356
24825
  tool("list_webhook_events", "List available webhook event types.", {}, () => client.webhooks.events());
24357
24826
  tool("create_webhook", "Subscribe to webhook events. fields: { url (https), events: [...] }.", { fields }, (a) => client.webhooks.create(a.fields));
24358
24827
  tool("delete_webhook", "Delete a webhook subscription.", { id: external_exports.string() }, (a) => client.webhooks.delete(a.id));
@@ -24365,7 +24834,10 @@ function createServer(client) {
24365
24834
  tool("save_onboarding_profile", "Save the onboarding profile. fields: { goal?, name?, company?, country?, currency?, timezone?, marketingOptIn? }.", { fields }, (a) => client.account.saveOnboardingProfile(a.fields));
24366
24835
  tool("list_connections", "List linked social-login providers.", {}, () => client.auth.connections());
24367
24836
  tool("disconnect_provider", "Disconnect a linked social-login provider.", { provider: external_exports.string() }, (a) => client.auth.disconnect(a.provider));
24837
+ tool("set_password", "Set or change the account password. Omit currentPassword when the account is SSO-only (setting a password for the first time so email+password login also works); required when changing an existing password.", { newPassword: external_exports.string(), currentPassword: external_exports.string().optional() }, (a) => client.auth.setPassword(a.newPassword, a.currentPassword));
24368
24838
  tool("list_referrals", "Referral program overview.", {}, () => client.referrals.list());
24839
+ tool("get_affiliate", "Refer & earn (Referalli affiliate program): joined?, ?via= link, clicks, sign-ups, commissions pending/credited, terms.", {}, () => client.referrals.affiliate());
24840
+ tool("join_affiliate", "Join Refer & earn: enroll this account as an affiliate and get its ?via= link (idempotent).", {}, () => client.referrals.joinAffiliate());
24369
24841
  tool("list_regions", "List active edge regions.", {}, () => client.regions.list());
24370
24842
  tool("nearest_region", "Resolve the nearest region for a country/geo.", { country: external_exports.string().optional(), lat: external_exports.number().optional(), lng: external_exports.number().optional() }, (a) => client.regions.nearest(a));
24371
24843
  tool("regions_health", "Per-region engine health.", {}, () => client.regions.health());
@@ -24383,6 +24855,9 @@ function createServer(client) {
24383
24855
  tool("admin_get_config", "Get platform config / feature flags.", {}, () => client.admin.getConfig());
24384
24856
  tool("admin_set_config", "Set a platform config value.", { key: external_exports.string(), value: external_exports.any().optional() }, (a) => client.admin.setConfig(a.key, a.value));
24385
24857
  tool("admin_audit_log", "Recent admin audit-log entries.", {}, () => client.admin.audit());
24858
+ tool("admin_trust_properties", "Properties with trust tier, lock, detected niches and progress toward auto-promotion. q filters by domain/name.", { q: external_exports.string().optional(), limit: external_exports.number().optional() }, (a) => client.admin.trustProperties(a));
24859
+ tool("admin_set_property_trust", "Override a property's trust tier (trusted = full demand, unverified = CPA-only) and lock it against automatic changes.", { id: external_exports.string(), tier: external_exports.enum(["trusted", "unverified"]).optional(), locked: external_exports.boolean(), note: external_exports.string().optional() }, (a) => client.admin.setPropertyTrust(a.id, { tier: a.tier, locked: a.locked, note: a.note }));
24860
+ tool("admin_trust_events", "Trust audit log: auto promotions/demotions, domain resets and admin overrides, with metrics.", { propertyId: external_exports.string().optional(), limit: external_exports.number().optional() }, (a) => client.admin.trustEvents(a));
24386
24861
  tool("admin_mfa_ranking", "Properties ranked by Made-For-Advertising risk.", { limit: external_exports.number().optional() }, (a) => client.admin.mfaRanking(a.limit));
24387
24862
  tool("admin_create_region", "Create an edge region. fields: { code, name, public_endpoint, lat, lng, country_codes?, status?, priority? }.", { fields }, (a) => client.admin.createRegion(a.fields));
24388
24863
  tool("admin_update_region", "Update an edge region. fields: { status?, public_endpoint?, priority?, country_codes?, name? }.", { id: external_exports.string(), fields }, (a) => client.admin.updateRegion(a.id, a.fields));