@ainyc/canonry 4.179.1 → 4.180.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 (25) hide show
  1. package/assets/assets/{AuditHistoryPanel-lD6Q5KaA.js → AuditHistoryPanel-DI6iXS0J.js} +1 -1
  2. package/assets/assets/{BacklinksPage-ClN1xbOa.js → BacklinksPage-DiwTMJTp.js} +1 -1
  3. package/assets/assets/{HistoryPage-CXKCPfG7.js → HistoryPage-BWODoEok.js} +1 -1
  4. package/assets/assets/{MeasurementPropertyPage-CiJsa0If.js → MeasurementPropertyPage-C1uZ9LEl.js} +1 -1
  5. package/assets/assets/{ProjectPage-CD0QbHPd.js → ProjectPage-C-fk0Jja.js} +8 -8
  6. package/assets/assets/{RunRow-DkFcHvDU.js → RunRow-CMSISg-I.js} +1 -1
  7. package/assets/assets/{RunsPage-CLzUDwTj.js → RunsPage-HZwwLQDE.js} +1 -1
  8. package/assets/assets/{SettingsPage-0PRgB0gI.js → SettingsPage-3eoRO4ze.js} +1 -1
  9. package/assets/assets/{SiteHealthSection-BXAMjVeD.js → SiteHealthSection-CATUc26x.js} +3 -3
  10. package/assets/assets/{TrafficPage-CP4qsn82.js → TrafficPage-Cw8AM5VR.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-DoaIZ_ix.js → TrafficSourceDetailPage-ChFDAstr.js} +1 -1
  12. package/assets/assets/{extract-error-message-Cn74-t3z.js → extract-error-message-CG_IQ_9c.js} +1 -1
  13. package/assets/assets/{index-BR9BgNb3.js → index-Dz0ju3qg.js} +22 -22
  14. package/assets/assets/{react-sigma_core.esm.min-CZrBq6qL.js → react-sigma_core.esm.min-BvgsCKLZ.js} +1 -1
  15. package/assets/index.html +1 -1
  16. package/dist/{chunk-A2AB7UK5.js → chunk-3JW762Q4.js} +44 -12
  17. package/dist/{chunk-LPUTKQDR.js → chunk-A6XDLCKF.js} +2 -2
  18. package/dist/{chunk-FFXYNYPZ.js → chunk-NFALEGSZ.js} +1 -1
  19. package/dist/{chunk-5BZWU35I.js → chunk-QPJC2H6J.js} +133 -37
  20. package/dist/{chunk-WG4EDZT3.js → chunk-UD3YJQOV.js} +4 -4
  21. package/dist/cli.js +10 -5
  22. package/dist/index.js +4 -4
  23. package/dist/{intelligence-service-CKGM2RUJ.js → intelligence-service-WQPUIJO6.js} +2 -2
  24. package/dist/mcp.js +3 -3
  25. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- import{g as Bt,t as S,r as C}from"./vendor-tanstack-Dock0eH1.js";import{e as Ht,G as Wt}from"./SiteHealthSection-BXAMjVeD.js";import"./index-BR9BgNb3.js";import"./vendor-radix-4UOaVWza.js";import"./vendor-recharts-D8rt5lKn.js";import"./vendor-lucide-nYKv-BB7.js";import"./vendor-markdown-Bn7fRwrx.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-DG35TyhH.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{g as Bt,t as S,r as C}from"./vendor-tanstack-Dock0eH1.js";import{e as Ht,G as Wt}from"./SiteHealthSection-CATUc26x.js";import"./index-Dz0ju3qg.js";import"./vendor-radix-4UOaVWza.js";import"./vendor-recharts-D8rt5lKn.js";import"./vendor-lucide-nYKv-BB7.js";import"./vendor-markdown-Bn7fRwrx.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-DG35TyhH.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(r,n){return qt(r)||Yt(r,n)||Tt(r,n)||Xt()}var pe={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Ct=new Int8Array(4),be=new Int32Array(Ct.buffer,0,1),$t=new Float32Array(Ct.buffer,0,1),Kt=/^\s*rgba?\s*\(/,Jt=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function Qt(r){var n=0,i=0,e=0,t=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),e=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),e=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(t=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(Kt.test(r)){var a=r.match(Jt);a&&(n=+a[1],i=+a[2],e=+a[3],a[4]&&(t=+a[4]))}return{r:n,g:i,b:e,a:t}}var J={};for(var le in pe)J[le]=oe(pe[le]),J[pe[le]]=J[le];function Rt(r,n,i,e,t){return be[0]=e<<24|i<<16|n<<8|r,be[0]=be[0]&4278190079,$t[0]}function oe(r){if(r=r.toLowerCase(),typeof J[r]<"u")return J[r];var n=Qt(r),i=n.r,e=n.g,t=n.b,a=n.a;a=a*255|0;var o=Rt(i,e,t,a);return J[r]=o,o}var Ee={};function _t(r){if(typeof Ee[r]<"u")return Ee[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,e=r&255,t=255,a=Rt(n,i,e,t);return Ee[r]=a,a}function We(r,n,i,e){return i+(n<<8)+(r<<16)}function Ve(r,n,i,e,t,a){var o=Math.floor(i/a*t),s=Math.floor(r.drawingBufferHeight/a-e/a*t),l=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(o,s,1,1,r.RGBA,r.UNSIGNED_BYTE,l);var h=ee(l,4),u=h[0],d=h[1],f=h[2],g=h[3];return[u,d,f,g]}function c(r,n,i){return(n=ae(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function je(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.push.apply(i,e)}return i}function b(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?je(Object(i),!0).forEach(function(e){c(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function ei(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=Q(r))!==null;);return r}function Ae(){return Ae=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var e=ei(r,n);if(e){var t=Object.getOwnPropertyDescriptor(e,n);return t.get?t.get.call(arguments.length<3?r:i):t.value}},Ae.apply(null,arguments)}function wt(r,n,i,e){var t=Ae(Q(r.prototype),n,i);return typeof t=="function"?function(a){return t.apply(i,a)}:t}function ti(r){return r.normalized?1:r.size}function ye(r){var n=0;return r.forEach(function(i){return n+=ti(i)}),n}function xt(r,n,i){var e=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,t=n.createShader(e);if(t===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(t,i),n.compileShader(t);var a=n.getShaderParameter(t,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`loadShader: error while compiling the shader:
3
3
  `.concat(o,`
4
4
  `).concat(i))}return t}function ii(r,n){return xt("VERTEX",r,n)}function ri(r,n){return xt("FRAGMENT",r,n)}function ni(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var e,t;for(e=0,t=n.length;e<t;e++)r.attachShader(i,n[e]);r.linkProgram(i);var a=r.getProgramParameter(i,r.LINK_STATUS);if(!a){var o=r.getProgramInfoLog(i);throw r.deleteProgram(i),new Error("loadProgram: error while linking the program: ".concat(o))}return i}function Ze(r){var n=r.gl,i=r.buffer,e=r.program,t=r.vertexShader,a=r.fragmentShader;n.deleteShader(t),n.deleteShader(a),n.deleteProgram(e),n.deleteBuffer(i)}var qe=`#define PICKING_MODE
package/assets/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-BR9BgNb3.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-Dz0ju3qg.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Dock0eH1.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-4UOaVWza.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-D8rt5lKn.js">
@@ -7687,8 +7687,33 @@ var gscPeriodTotalsSchema = z19.object({
7687
7687
  source: z19.enum(["property-daily", "dimensioned", "mixed", "empty"])
7688
7688
  });
7689
7689
  var gscPeriodComparisonSchema = z19.object({
7690
- /** Length of EACH period in calendar days. */
7690
+ /**
7691
+ * Length of EACH period in calendar days. Equals the selected window under
7692
+ * `basis: 'prior-window'`, and half of it under `basis: 'split-window'`.
7693
+ */
7691
7694
  days: z19.number(),
7695
+ /**
7696
+ * Which two periods these are, so a surface can say what it is showing.
7697
+ *
7698
+ * `prior-window` — the selected window against the equal-length period
7699
+ * immediately before it. What a reader means by "vs prior 90d".
7700
+ *
7701
+ * `split-window` — the selected window's own trailing and leading halves.
7702
+ * Used when there is nothing before the window to compare with: an unbounded
7703
+ * selection (`window=all`), or a prior period the sync never reached, whose
7704
+ * unsynced days would otherwise be counted as zeroes and manufacture growth.
7705
+ * A surface printing "vs prior {days}d" here is naming a period HALF the
7706
+ * length of the control the reader pressed, which is honest but surprising —
7707
+ * hence the label.
7708
+ *
7709
+ * Optional for the same reason as `window` and `trends`: a server older than
7710
+ * this field returns the comparison WITHOUT it, and declaring it required
7711
+ * would tell a generated consumer it may dereference the field safely against
7712
+ * a legacy response. Absent means the basis is unstated; every such server
7713
+ * split the window, but a surface should render the absence with its
7714
+ * period-length copy rather than assert a basis nobody sent.
7715
+ */
7716
+ basis: z19.enum(["prior-window", "split-window"]).optional(),
7692
7717
  prior: gscPeriodTotalsSchema,
7693
7718
  trailing: gscPeriodTotalsSchema,
7694
7719
  /**
@@ -7744,9 +7769,9 @@ var gscPerformanceDailyDtoSchema = z19.object({
7744
7769
  trends: gscPerformanceTrendsSchema.optional(),
7745
7770
  /**
7746
7771
  * Optional for the same reason as `window` and `trends`, and additionally
7747
- * null when the window is too short to split into two periods, has no
7748
- * evidence, or extends beyond the project's known GSC data frontier. A
7749
- * consumer must render the absence rather than substitute a percentage.
7772
+ * null when there is no span to divide into two periods, no evidence, or the
7773
+ * span extends beyond the project's known GSC data frontier. A consumer must
7774
+ * render the absence rather than substitute a percentage.
7750
7775
  */
7751
7776
  periodComparison: gscPeriodComparisonSchema.nullable().optional()
7752
7777
  });
@@ -15427,12 +15452,19 @@ var adsActivationEntityRefSchema = z52.object({
15427
15452
  expectedUpdatedAt: z52.number().int().nonnegative()
15428
15453
  }).strict();
15429
15454
  var adsActivationAdSchema = adsActivationEntityRefSchema;
15455
+ var ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES = 1e3;
15430
15456
  var ADS_ACTIVATION_MAX_ENTITIES = 100;
15457
+ function countAdsActivationManifestEntities(manifest) {
15458
+ return 1 + manifest.campaign.adGroups.reduce(
15459
+ (count, group) => count + 1 + group.ads.length,
15460
+ 0
15461
+ );
15462
+ }
15431
15463
  var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
15432
- ads: z52.array(adsActivationAdSchema).min(1).max(ADS_ACTIVATION_MAX_ENTITIES - 1)
15464
+ ads: z52.array(adsActivationAdSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
15433
15465
  }).strict();
15434
15466
  var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
15435
- adGroups: z52.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_MAX_ENTITIES - 1)
15467
+ adGroups: z52.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
15436
15468
  }).strict();
15437
15469
  function compareAdsActivationEntityIds(left, right) {
15438
15470
  if (left < right) return -1;
@@ -15454,15 +15486,12 @@ function addCanonicalEntityOrderIssue(items, path, ctx) {
15454
15486
  var adsActivationManifestSchema = z52.object({
15455
15487
  campaign: adsActivationCampaignSchema
15456
15488
  }).strict().superRefine((manifest, ctx) => {
15457
- const entityCount = 1 + manifest.campaign.adGroups.reduce(
15458
- (count, group) => count + 1 + group.ads.length,
15459
- 0
15460
- );
15461
- if (entityCount > ADS_ACTIVATION_MAX_ENTITIES) {
15489
+ const entityCount = countAdsActivationManifestEntities(manifest);
15490
+ if (entityCount > ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES) {
15462
15491
  ctx.addIssue({
15463
15492
  code: "custom",
15464
15493
  path: ["campaign"],
15465
- message: `Activation manifests may contain at most ${ADS_ACTIVATION_MAX_ENTITIES} entities`
15494
+ message: `Activation manifests may contain at most ${ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES} entities`
15466
15495
  });
15467
15496
  }
15468
15497
  addCanonicalEntityOrderIssue(manifest.campaign.adGroups, ["campaign", "adGroups"], ctx);
@@ -16999,6 +17028,9 @@ export {
16999
17028
  AdsEntityStatuses,
17000
17029
  AdsEntityTypes,
17001
17030
  AdsActivationEntityTypes,
17031
+ ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
17032
+ ADS_ACTIVATION_MAX_ENTITIES,
17033
+ countAdsActivationManifestEntities,
17002
17034
  adsActivationManifestSchema,
17003
17035
  canonicalizeAdsActivationManifest,
17004
17036
  adsActivationManifestHashSchema,
@@ -5,11 +5,11 @@ import {
5
5
  installSkills,
6
6
  loadConfigRaw,
7
7
  saveConfigPatch
8
- } from "./chunk-FFXYNYPZ.js";
8
+ } from "./chunk-NFALEGSZ.js";
9
9
  import {
10
10
  SKILL_MANIFEST_FILENAME,
11
11
  SkillsClients
12
- } from "./chunk-A2AB7UK5.js";
12
+ } from "./chunk-3JW762Q4.js";
13
13
 
14
14
  // src/skills-autosync.ts
15
15
  import fs from "fs";
@@ -92,7 +92,7 @@ import {
92
92
  trafficConnectWordpressRequestSchema,
93
93
  trafficEventKindSchema,
94
94
  trafficSeriesGranularitySchema
95
- } from "./chunk-A2AB7UK5.js";
95
+ } from "./chunk-3JW762Q4.js";
96
96
 
97
97
  // src/config.ts
98
98
  import fs from "fs";
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  ADS_ACTIVATE_SCOPE,
3
+ ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
4
+ ADS_ACTIVATION_MAX_ENTITIES,
3
5
  ADS_APPROVE_SCOPE,
4
6
  ADS_WRITE_SCOPE,
5
7
  AGENT_PROVIDER_IDS,
@@ -251,6 +253,7 @@ import {
251
253
  conversionTrackingIntegrityReadEnvelopeSchema,
252
254
  conversionTrackingOptionsDtoSchema,
253
255
  cosineSimilarity,
256
+ countAdsActivationManifestEntities,
254
257
  createApiKeyRequestSchema,
255
258
  createTemplateLinkPairIndex,
256
259
  createUserRequestSchema,
@@ -639,7 +642,7 @@ import {
639
642
  wordpressSchemaDeployResultDtoSchema,
640
643
  wordpressSchemaStatusResultDtoSchema,
641
644
  wordpressStatusDtoSchema
642
- } from "./chunk-A2AB7UK5.js";
645
+ } from "./chunk-3JW762Q4.js";
643
646
 
644
647
  // src/intelligence-service.ts
645
648
  import { eq as eq62, desc as desc27, asc as asc11, and as and51, ne as ne8, or as or14, inArray as inArray22, gte as gte14, lte as lte12, isNull as isNull9, sql as sql25, exists } from "drizzle-orm";
@@ -20593,7 +20596,7 @@ function validateCron(expr) {
20593
20596
  }
20594
20597
  return true;
20595
20598
  }
20596
- function validateCronField(field, min, max2) {
20599
+ function validateCronField(field, min2, max2) {
20597
20600
  if (field === "*") return true;
20598
20601
  const segments = field.split(",");
20599
20602
  for (const segment of segments) {
@@ -20609,7 +20612,7 @@ function validateCronField(field, min, max2) {
20609
20612
  if (rangeParts.length > 2) return false;
20610
20613
  for (const part of rangeParts) {
20611
20614
  const num = parseInt(part, 10);
20612
- if (isNaN(num) || num < min || num > max2) return false;
20615
+ if (isNaN(num) || num < min2 || num > max2) return false;
20613
20616
  }
20614
20617
  }
20615
20618
  return true;
@@ -22353,10 +22356,10 @@ function buildCategoryCounts(counts2) {
22353
22356
  // ../api-routes/src/intelligence.ts
22354
22357
  import { eq as eq25, desc as desc9, and as and19, inArray as inArray10, like } from "drizzle-orm";
22355
22358
  var SEVERITY_RANK = { low: 0, medium: 1, high: 2, critical: 3 };
22356
- function severitiesAtOrAbove(min) {
22357
- const floor = SEVERITY_RANK[min];
22359
+ function severitiesAtOrAbove(min2) {
22360
+ const floor = SEVERITY_RANK[min2];
22358
22361
  if (floor === void 0) {
22359
- throw validationError(`Invalid severity "${min}". Use one of: low, medium, high, critical.`);
22362
+ throw validationError(`Invalid severity "${min2}". Use one of: low, medium, high, critical.`);
22360
22363
  }
22361
22364
  return Object.keys(SEVERITY_RANK).filter((s) => SEVERITY_RANK[s] >= floor);
22362
22365
  }
@@ -23335,7 +23338,7 @@ function winnabilityClassRank(winnabilityClass) {
23335
23338
  }
23336
23339
 
23337
23340
  // ../api-routes/src/gsc-totals.ts
23338
- import { and as and23, asc as asc4, eq as eq28, sql as sql9, max } from "drizzle-orm";
23341
+ import { and as and23, asc as asc4, eq as eq28, sql as sql9, max, min } from "drizzle-orm";
23339
23342
  var WINDOW_DAYS = { "7d": 7, "30d": 30, "90d": 90 };
23340
23343
  function resolveGscWindowRange(window, latestDataDate, today) {
23341
23344
  if (window === "all") {
@@ -23376,6 +23379,11 @@ function readLatestGscDataDate(db, projectId) {
23376
23379
  const dimensioned = db.select({ latest: max(gscSearchData.date) }).from(gscSearchData).where(eq28(gscSearchData.projectId, projectId)).get()?.latest ?? null;
23377
23380
  return [watermark, property, dimensioned].filter((d) => d !== null).reduce((maxDate, d) => maxDate === null || d > maxDate ? d : maxDate, null);
23378
23381
  }
23382
+ function readEarliestGscDataDate(db, projectId) {
23383
+ const property = db.select({ earliest: min(gscDailyTotals.date) }).from(gscDailyTotals).where(eq28(gscDailyTotals.projectId, projectId)).get()?.earliest ?? null;
23384
+ const dimensioned = db.select({ earliest: min(gscSearchData.date) }).from(gscSearchData).where(eq28(gscSearchData.projectId, projectId)).get()?.earliest ?? null;
23385
+ return [property, dimensioned].filter((d) => d !== null).reduce((earliest, d) => earliest === null || d < earliest ? d : earliest, null);
23386
+ }
23379
23387
  function readGscDailyTotals(db, projectId, startDate, endDate) {
23380
23388
  const rows = db.select({
23381
23389
  date: gscDailyTotals.date,
@@ -34269,7 +34277,7 @@ var routeCatalog = [
34269
34277
  method: "post",
34270
34278
  path: "/api/v1/projects/{name}/ads/activation-grants",
34271
34279
  summary: "Approve one exact paused OpenAI Ads campaign tree for activation",
34272
- description: "Human-only approval surface. The authenticated ads.approve key is recorded as approver and must differ from the named executor key. Canonry verifies account eligibility, exact parent-child membership, paused state, upstream timestamps, and ad review approval before issuing a short-lived single-use grant.",
34280
+ description: "Human-only approval surface. The authenticated ads.approve key is recorded as approver and must differ from the named executor key. Canonry verifies account eligibility, exact parent-child membership, paused state, upstream timestamps, and ad review approval before issuing a short-lived single-use grant. New grants are refused when the manifest exceeds the deployment's operational entity cap (default 100, tunable via CANONRY_ADS_ACTIVATION_MAX_ENTITIES to a whole number between 1 and the structural ceiling of 1000; a set-but-invalid value fails closed and refuses new grants until fixed).",
34273
34281
  tags: ["ads"],
34274
34282
  parameters: [nameParameter],
34275
34283
  requestBody: {
@@ -34324,7 +34332,7 @@ var routeCatalog = [
34324
34332
  method: "post",
34325
34333
  path: "/api/v1/projects/{name}/ads/campaigns/{id}/activate-tree",
34326
34334
  summary: "Execute a grant-bound OpenAI Ads campaign-tree activation",
34327
- description: "Requires ads.activate and a nonexpired single-use grant bound to the exact executor key, project, advertiser account, manifest hash, campaign, entity IDs, and upstream timestamps. Canonry activates ads first, then ad groups, then the campaign; every step is durably checkpointed and verified. Failure rolls back the campaign before children and ambiguous outcomes fail closed as unknown.",
34335
+ description: "Requires ads.activate and a nonexpired single-use grant bound to the exact executor key, project, advertiser account, manifest hash, campaign, entity IDs, and upstream timestamps. Canonry activates ads first, then ad groups, then the campaign; every step is durably checkpointed and verified. Failure rolls back the campaign before children and ambiguous outcomes fail closed as unknown. New executions are refused when the manifest exceeds the deployment's operational entity cap (default 100, tunable via CANONRY_ADS_ACTIVATION_MAX_ENTITIES to a whole number between 1 and the structural ceiling of 1000; a set-but-invalid value fails closed and refuses new executions until fixed); stored receipts replay and reconcile regardless.",
34328
34336
  tags: ["ads"],
34329
34337
  parameters: [
34330
34338
  nameParameter,
@@ -38093,6 +38101,7 @@ function computeGscPeriodComparison(daily, bounds) {
38093
38101
  const comparable = prior.source !== "dimensioned" && prior.source !== "mixed" && trailing.source !== "dimensioned" && trailing.source !== "mixed";
38094
38102
  return {
38095
38103
  days: periodDays,
38104
+ basis: bounds?.basis ?? "split-window",
38096
38105
  prior,
38097
38106
  trailing,
38098
38107
  comparable,
@@ -40495,12 +40504,19 @@ async function googleRoutes(app, opts) {
40495
40504
  gscToday()
40496
40505
  );
40497
40506
  const cutoffDate = startDate ? null : resolvedWindow.startDate;
40507
+ const reportedWindow = resolveReportedWindow(resolvedWindow, startDate, endDate);
40498
40508
  const windowStart = startDate ?? cutoffDate ?? "";
40499
40509
  const windowEnd = endDate ?? resolvedWindow.endDate ?? "9999-12-31";
40500
- const dailyTotals = readGscDailyTotals(app.db, project.id, windowStart, windowEnd);
40510
+ const priorPeriodStart = reportedWindow.startDate !== null && reportedWindow.endDate !== null ? (() => {
40511
+ const span = inclusiveDayCount(reportedWindow.startDate, reportedWindow.endDate);
40512
+ return span !== null && span > 0 ? shiftIsoCalendarDate(reportedWindow.startDate, -span) : null;
40513
+ })() : null;
40514
+ const earliestDataDate = priorPeriodStart === null ? null : readEarliestGscDataDate(app.db, project.id);
40515
+ const priorWindowIsSynced = priorPeriodStart !== null && earliestDataDate !== null && priorPeriodStart >= earliestDataDate;
40516
+ const fetchStart = priorWindowIsSynced ? priorPeriodStart : windowStart;
40517
+ const dailyTotals = readGscDailyTotals(app.db, project.id, fetchStart, windowEnd);
40501
40518
  const conditions = [eq40(gscSearchData.projectId, project.id)];
40502
- if (startDate) conditions.push(sql14`${gscSearchData.date} >= ${startDate}`);
40503
- else if (cutoffDate) conditions.push(sql14`${gscSearchData.date} >= ${cutoffDate}`);
40519
+ if (fetchStart) conditions.push(sql14`${gscSearchData.date} >= ${fetchStart}`);
40504
40520
  if (endDate) conditions.push(sql14`${gscSearchData.date} <= ${endDate}`);
40505
40521
  const dimensionedRows = app.db.select({
40506
40522
  date: gscSearchData.date,
@@ -40508,7 +40524,7 @@ async function googleRoutes(app, opts) {
40508
40524
  impressions: sql14`COALESCE(SUM(${gscSearchData.impressions}), 0)`
40509
40525
  }).from(gscSearchData).where(and32(...conditions)).groupBy(gscSearchData.date).orderBy(gscSearchData.date).all();
40510
40526
  const propertyDates = new Set(dailyTotals.map((d) => d.date));
40511
- const daily = mergeGscDailyTotalsWithFallback(
40527
+ const comparisonDaily = mergeGscDailyTotalsWithFallback(
40512
40528
  dailyTotals,
40513
40529
  dimensionedRows.map((r) => ({
40514
40530
  date: r.date,
@@ -40523,6 +40539,7 @@ async function googleRoutes(app, opts) {
40523
40539
  ctr: d.impressions > 0 ? d.clicks / d.impressions : 0,
40524
40540
  position: propertyDates.has(d.date) ? d.position : null
40525
40541
  }));
40542
+ const daily = fetchStart === windowStart ? comparisonDaily : comparisonDaily.filter((d) => d.date >= windowStart && d.date <= windowEnd);
40526
40543
  const totalClicks = daily.reduce((sum, d) => sum + d.clicks, 0);
40527
40544
  const totalImpressions = daily.reduce((sum, d) => sum + d.impressions, 0);
40528
40545
  let positionWeight = 0;
@@ -40538,10 +40555,15 @@ async function googleRoutes(app, opts) {
40538
40555
  const row = byDate.get(date);
40539
40556
  return row ? pick(row) : null;
40540
40557
  });
40541
- const reportedWindow = resolveReportedWindow(resolvedWindow, startDate, endDate);
40542
- const comparisonStart = reportedWindow.startDate ?? daily[0]?.date;
40543
40558
  const comparisonEnd = reportedWindow.endDate ?? daily[daily.length - 1]?.date;
40544
40559
  const comparisonEndsWithinKnownData = reportedWindow.latestDataDate !== null && comparisonEnd <= reportedWindow.latestDataDate;
40560
+ const taggedComparisonDaily = comparisonDaily.map((d) => ({
40561
+ ...d,
40562
+ fromPropertyTotals: propertyDates.has(d.date)
40563
+ }));
40564
+ const comparisonFor = (basis, startDate2) => startDate2 && comparisonEnd && comparisonEndsWithinKnownData ? computeGscPeriodComparison(taggedComparisonDaily, { startDate: startDate2, endDate: comparisonEnd, basis }) : null;
40565
+ const priorWindowComparison = priorWindowIsSynced ? comparisonFor("prior-window", priorPeriodStart) : null;
40566
+ const periodComparison = priorWindowComparison?.comparable ? priorWindowComparison : comparisonFor("split-window", reportedWindow.startDate ?? daily[0]?.date);
40545
40567
  return {
40546
40568
  totals: {
40547
40569
  clicks: totalClicks,
@@ -40583,12 +40605,7 @@ async function googleRoutes(app, opts) {
40583
40605
  // it goes negative for a metric that cannot be. Computed server-side for
40584
40606
  // the same UI/CLI parity reason as the fit: a percentage derived in a
40585
40607
  // chart component is invisible to an agent.
40586
- periodComparison: comparisonStart && comparisonEnd && comparisonEndsWithinKnownData ? computeGscPeriodComparison(
40587
- // The source tag is the comparison module's input, NOT part of the
40588
- // response: `daily` on the wire stays exactly what the DTO declares.
40589
- daily.map((d) => ({ ...d, fromPropertyTotals: propertyDates.has(d.date) })),
40590
- { startDate: comparisonStart, endDate: comparisonEnd }
40591
- ) : null
40608
+ periodComparison
40592
40609
  };
40593
40610
  });
40594
40611
  app.get("/projects/:name/google/gsc/top-pages", async (request) => {
@@ -43179,10 +43196,6 @@ async function googleMarketingRoutes(app, opts) {
43179
43196
  import crypto35 from "crypto";
43180
43197
  import { eq as eq43, and as and35, asc as asc8, desc as desc19, gt as gt2, gte as gte9, lt as lt8, lte as lte8, ne as ne5, inArray as inArray17, or as or10, isNull as isNull5, isNotNull as isNotNull2, sql as sql17 } from "drizzle-orm";
43181
43198
 
43182
- // ../api-routes/src/ads-activation-routes.ts
43183
- import crypto34 from "crypto";
43184
- import { and as and34, asc as asc7, eq as eq42, gt, isNotNull, isNull as isNull4, lte as lte7, or as or9, sql as sql16 } from "drizzle-orm";
43185
-
43186
43199
  // ../api-routes/src/ads-activation.ts
43187
43200
  import crypto33 from "crypto";
43188
43201
  var AdsActivationErrorCodes = {
@@ -43221,6 +43234,55 @@ var AdsActivationError = class extends Error {
43221
43234
  operation;
43222
43235
  entity;
43223
43236
  };
43237
+ function createMemoizedAdsActivationProvider(source) {
43238
+ const adGroupsByCampaignId = /* @__PURE__ */ new Map();
43239
+ const adsByAdGroupId = /* @__PURE__ */ new Map();
43240
+ const readThrough = (cache, parentId, load) => {
43241
+ const cached = cache.get(parentId);
43242
+ if (cached) return cached;
43243
+ const pending = load();
43244
+ cache.set(parentId, pending);
43245
+ pending.catch(() => {
43246
+ if (cache.get(parentId) === pending) cache.delete(parentId);
43247
+ });
43248
+ return pending;
43249
+ };
43250
+ const invalidate = () => {
43251
+ adGroupsByCampaignId.clear();
43252
+ adsByAdGroupId.clear();
43253
+ };
43254
+ const mutate = async (run) => {
43255
+ try {
43256
+ return await run();
43257
+ } finally {
43258
+ invalidate();
43259
+ }
43260
+ };
43261
+ const listAdGroups = (campaignId) => readThrough(adGroupsByCampaignId, campaignId, () => source.listAdGroups(campaignId));
43262
+ const listAds = (adGroupId) => readThrough(adsByAdGroupId, adGroupId, () => source.listAds(adGroupId));
43263
+ return {
43264
+ getAccount: () => source.getAccount(),
43265
+ getCampaign: (id) => source.getCampaign(id),
43266
+ listAdGroups,
43267
+ getAdGroup: async (id, campaignId) => {
43268
+ const entity = (await listAdGroups(campaignId)).find((candidate) => candidate.id === id);
43269
+ if (!entity) throw new Error("OpenAI Ads ad group was not found under the approved campaign");
43270
+ return entity;
43271
+ },
43272
+ listAds,
43273
+ getAd: async (id, adGroupId) => {
43274
+ const entity = (await listAds(adGroupId)).find((candidate) => candidate.id === id);
43275
+ if (!entity) throw new Error("OpenAI Ads ad was not found under the approved ad group");
43276
+ return entity;
43277
+ },
43278
+ activateCampaign: (id) => mutate(() => source.activateCampaign(id)),
43279
+ activateAdGroup: (id) => mutate(() => source.activateAdGroup(id)),
43280
+ activateAd: (id) => mutate(() => source.activateAd(id)),
43281
+ pauseCampaign: (id) => mutate(() => source.pauseCampaign(id)),
43282
+ pauseAdGroup: (id) => mutate(() => source.pauseAdGroup(id)),
43283
+ pauseAd: (id) => mutate(() => source.pauseAd(id))
43284
+ };
43285
+ }
43224
43286
  var DEFAULT_LEASE_MS = 5 * 6e4;
43225
43287
  var DEFAULT_ACTIVATION_VERIFICATION_RETRY_DELAYS_MS = [100, 250, 500, 1e3, 2e3, 2e3];
43226
43288
  var PROVIDER_PAUSED = "paused";
@@ -44517,6 +44579,8 @@ async function executeApprovedAdsActivation(dependencies, request) {
44517
44579
  }
44518
44580
 
44519
44581
  // ../api-routes/src/ads-activation-routes.ts
44582
+ import crypto34 from "crypto";
44583
+ import { and as and34, asc as asc7, eq as eq42, gt, isNotNull, isNull as isNull4, lte as lte7, or as or9, sql as sql16 } from "drizzle-orm";
44520
44584
  var MAX_ACTIVATION_GRANT_LIFETIME_MS = 24 * 60 * 60 * 1e3;
44521
44585
  var ACTIVATION_LEASE_MS = 5 * 6e4;
44522
44586
  var ACTIVATION_REVOCATION_SETTLEMENT_MS = ACTIVATION_LEASE_MS;
@@ -44934,6 +44998,40 @@ function countManifest(manifest) {
44934
44998
  adCount: manifest.campaign.adGroups.reduce((count2, group) => count2 + group.ads.length, 0)
44935
44999
  };
44936
45000
  }
45001
+ function resolveAdsActivationMaxEntities(env = process.env) {
45002
+ const raw = env.CANONRY_ADS_ACTIVATION_MAX_ENTITIES;
45003
+ if (raw === void 0 || raw.trim() === "") return ADS_ACTIVATION_MAX_ENTITIES;
45004
+ const trimmed = raw.trim();
45005
+ const parsed = /^\d+$/.test(trimmed) ? Number(trimmed) : Number.NaN;
45006
+ if (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES) {
45007
+ throw internalError(
45008
+ `CANONRY_ADS_ACTIVATION_MAX_ENTITIES is set to the invalid value "${raw}". It must be a whole number between 1 and ${ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES} (unset it to use the default of ${ADS_ACTIVATION_MAX_ENTITIES}). New ads activations are refused until the variable is fixed.`,
45009
+ {
45010
+ envVar: "CANONRY_ADS_ACTIVATION_MAX_ENTITIES",
45011
+ value: raw,
45012
+ min: 1,
45013
+ max: ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
45014
+ default: ADS_ACTIVATION_MAX_ENTITIES
45015
+ }
45016
+ );
45017
+ }
45018
+ return parsed;
45019
+ }
45020
+ function enforceAdsActivationOperationalCap(manifest) {
45021
+ const maxEntities = resolveAdsActivationMaxEntities();
45022
+ const entityCount = countAdsActivationManifestEntities(manifest);
45023
+ if (entityCount > maxEntities) {
45024
+ throw validationError(
45025
+ `New ads activations may contain at most ${maxEntities} entities (raise CANONRY_ADS_ACTIVATION_MAX_ENTITIES to change the operational cap)`,
45026
+ {
45027
+ entityCount,
45028
+ maxEntities,
45029
+ absoluteMaxEntities: ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
45030
+ envVar: "CANONRY_ADS_ACTIVATION_MAX_ENTITIES"
45031
+ }
45032
+ );
45033
+ }
45034
+ }
44937
45035
  function requireAuthenticatedKey(request) {
44938
45036
  if (!request.apiKey) {
44939
45037
  throw forbidden("Ads activation approval and execution require an authenticated API key");
@@ -45378,6 +45476,7 @@ function registerAdsActivationRoutes(app, opts) {
45378
45476
  const approver = requireAuthenticatedKey(request);
45379
45477
  const project = resolveProject(app.db, request.params.name);
45380
45478
  const body = parseBody3(adsActivationGrantCreateRequestSchema, request.body);
45479
+ enforceAdsActivationOperationalCap(body.manifest);
45381
45480
  const now = /* @__PURE__ */ new Date();
45382
45481
  const expiresAt = Date.parse(body.expiresAt);
45383
45482
  if (!Number.isFinite(expiresAt) || expiresAt <= now.getTime() || expiresAt > now.getTime() + MAX_ACTIVATION_GRANT_LIFETIME_MS) {
@@ -45540,6 +45639,9 @@ function registerAdsActivationRoutes(app, opts) {
45540
45639
  if (grant.manifestHash !== body.manifestHash) {
45541
45640
  throw validationError("The activation grant does not match the requested manifest hash");
45542
45641
  }
45642
+ if (!grant.operationId) {
45643
+ enforceAdsActivationOperationalCap(grant.manifest);
45644
+ }
45543
45645
  try {
45544
45646
  const terminal = terminalActivationResponse(app, opts, grant, body.operationKey);
45545
45647
  if (terminal) return terminal;
@@ -46986,20 +47088,14 @@ async function adsRoutes(app, opts) {
46986
47088
  entity: { ...entity, status: entity.status, updatedAt: entity.updatedAt }
46987
47089
  });
46988
47090
  },
46989
- provider: {
47091
+ // getAdGroup/getAd are list-derived (no single-entity upstream read),
47092
+ // so the memoized provider shares one list walk per parent across the
47093
+ // whole verification pass and clears its cache on every mutation —
47094
+ // see createMemoizedAdsActivationProvider for the invariants.
47095
+ provider: createMemoizedAdsActivationProvider({
46990
47096
  getAccount: refreshAccount,
46991
47097
  getCampaign: (id) => operator.getCampaign(apiKey, id),
46992
- getAdGroup: async (id, campaignId) => {
46993
- const entity = (await operator.listAdGroups(apiKey, campaignId)).find((candidate) => candidate.id === id);
46994
- if (!entity) throw new Error("OpenAI Ads ad group was not found under the approved campaign");
46995
- return entity;
46996
- },
46997
47098
  listAdGroups: (campaignId) => operator.listAdGroups(apiKey, campaignId),
46998
- getAd: async (id, adGroupId) => {
46999
- const entity = (await operator.listAds(apiKey, adGroupId)).find((candidate) => candidate.id === id);
47000
- if (!entity) throw new Error("OpenAI Ads ad was not found under the approved ad group");
47001
- return entity;
47002
- },
47003
47099
  listAds: (adGroupId) => operator.listAds(apiKey, adGroupId),
47004
47100
  activateCampaign: (id) => activateCampaign(apiKey, id),
47005
47101
  activateAdGroup: (id) => activateAdGroup(apiKey, id),
@@ -47007,7 +47103,7 @@ async function adsRoutes(app, opts) {
47007
47103
  pauseCampaign: (id) => operator.pauseCampaign(apiKey, id),
47008
47104
  pauseAdGroup: (id) => operator.pauseAdGroup(apiKey, id),
47009
47105
  pauseAd: (id) => operator.pauseAd(apiKey, id)
47010
- }
47106
+ })
47011
47107
  };
47012
47108
  },
47013
47109
  toOperationDto: operationDto
@@ -11,7 +11,7 @@ import {
11
11
  loadConfig,
12
12
  loadConfigRaw,
13
13
  saveConfigPatch
14
- } from "./chunk-FFXYNYPZ.js";
14
+ } from "./chunk-NFALEGSZ.js";
15
15
  import {
16
16
  CC_CACHE_DIR,
17
17
  DUCKDB_SPEC,
@@ -157,7 +157,7 @@ import {
157
157
  siteCrawlSnapshots,
158
158
  toAlertView,
159
159
  usageCounters
160
- } from "./chunk-5BZWU35I.js";
160
+ } from "./chunk-QPJC2H6J.js";
161
161
  import {
162
162
  AGENT_MEMORY_VALUE_MAX_BYTES,
163
163
  AGENT_PROVIDER_IDS,
@@ -295,7 +295,7 @@ import {
295
295
  validationError,
296
296
  winnabilityClassLabel,
297
297
  withRetry
298
- } from "./chunk-A2AB7UK5.js";
298
+ } from "./chunk-3JW762Q4.js";
299
299
 
300
300
  // src/telemetry.ts
301
301
  import crypto from "crypto";
@@ -11857,7 +11857,7 @@ function readStoredGroundingSources(rawResponse) {
11857
11857
  return result;
11858
11858
  }
11859
11859
  async function backfillInsightsCommand(project, opts) {
11860
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-CKGM2RUJ.js");
11860
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-WQPUIJO6.js");
11861
11861
  const config = loadConfig();
11862
11862
  const db = createClient(config.database);
11863
11863
  migrate(db);
package/dist/cli.js CHANGED
@@ -26,11 +26,11 @@ import {
26
26
  showFirstRunNotice,
27
27
  trackCliCommandFinished,
28
28
  trackEvent
29
- } from "./chunk-WG4EDZT3.js";
29
+ } from "./chunk-UD3YJQOV.js";
30
30
  import {
31
31
  autoSyncSkills,
32
32
  formatAutoSyncNotice
33
- } from "./chunk-LPUTKQDR.js";
33
+ } from "./chunk-A6XDLCKF.js";
34
34
  import {
35
35
  CliError,
36
36
  EXIT_SYSTEM_ERROR,
@@ -55,7 +55,7 @@ import {
55
55
  saveConfigPatch,
56
56
  systemError,
57
57
  usageError
58
- } from "./chunk-FFXYNYPZ.js";
58
+ } from "./chunk-NFALEGSZ.js";
59
59
  import {
60
60
  CLOUDFLARE_WORKER_BINDINGS,
61
61
  CLOUDFLARE_WORKER_GENERATED_MARKER,
@@ -69,7 +69,7 @@ import {
69
69
  projects,
70
70
  queries,
71
71
  renderReportHtml
72
- } from "./chunk-5BZWU35I.js";
72
+ } from "./chunk-QPJC2H6J.js";
73
73
  import {
74
74
  AdsDeliverySnapshotStatuses,
75
75
  AdsHistoricalCampaignRollupStatuses,
@@ -138,7 +138,7 @@ import {
138
138
  providerQuotaPolicySchema,
139
139
  resolveProviderInput,
140
140
  winnabilityClassSchema
141
- } from "./chunk-A2AB7UK5.js";
141
+ } from "./chunk-3JW762Q4.js";
142
142
 
143
143
  // src/cli.ts
144
144
  import { pathToFileURL } from "url";
@@ -7903,6 +7903,11 @@ No period comparison: period comparison needs property-level daily data. Sync ag
7903
7903
  `
7904
7904
  Last ${cmp.days} day${cmp.days === 1 ? "" : "s"} (${cmp.trailing.startDate} to ${cmp.trailing.endDate}) vs prior ${cmp.days} (${cmp.prior.startDate} to ${cmp.prior.endDate}):`
7905
7905
  );
7906
+ if (cmp.basis === "split-window") {
7907
+ console.log(
7908
+ ` (no equal-length period with synced data before this window, so it was split in two)`
7909
+ );
7910
+ }
7906
7911
  for (const [label, ratio, prior, trailing, inverted] of [
7907
7912
  ["Clicks", cmp.change.clicks, cmp.prior.clicks, cmp.trailing.clicks, false],
7908
7913
  ["Impressions", cmp.change.impressions, cmp.prior.impressions, cmp.trailing.impressions, false],
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-WG4EDZT3.js";
6
+ } from "./chunk-UD3YJQOV.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-FFXYNYPZ.js";
10
- import "./chunk-5BZWU35I.js";
11
- import "./chunk-A2AB7UK5.js";
9
+ } from "./chunk-NFALEGSZ.js";
10
+ import "./chunk-QPJC2H6J.js";
11
+ import "./chunk-3JW762Q4.js";
12
12
  export {
13
13
  GoogleMarketingRuntimeError,
14
14
  createGoogleMarketingCredentialStore,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-5BZWU35I.js";
4
- import "./chunk-A2AB7UK5.js";
3
+ } from "./chunk-QPJC2H6J.js";
4
+ import "./chunk-3JW762Q4.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  autoSyncSkills
3
- } from "./chunk-LPUTKQDR.js";
3
+ } from "./chunk-A6XDLCKF.js";
4
4
  import {
5
5
  createApiClient,
6
6
  createCanonryMcpServer
7
- } from "./chunk-FFXYNYPZ.js";
7
+ } from "./chunk-NFALEGSZ.js";
8
8
  import {
9
9
  isReadOnlyKey
10
- } from "./chunk-A2AB7UK5.js";
10
+ } from "./chunk-3JW762Q4.js";
11
11
 
12
12
  // src/mcp/cli.ts
13
13
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";