@canonry/canonry 6.1.1 → 6.1.2

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 (29) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -1
  2. package/assets/assets/{AuditHistoryPanel-Dtt7cbYo.js → AuditHistoryPanel-D-W_kwEY.js} +1 -1
  3. package/assets/assets/{BacklinksPage-h25kHk3u.js → BacklinksPage-BeqCFRO3.js} +1 -1
  4. package/assets/assets/{HistoryPage-70YWNYBU.js → HistoryPage-wAPbY0z4.js} +1 -1
  5. package/assets/assets/{MeasurementPropertyPage-CBPQ3A99.js → MeasurementPropertyPage-BSOrkHCB.js} +1 -1
  6. package/assets/assets/{ProjectPage-Dbbxf8yl.js → ProjectPage-v0C7CwyA.js} +1 -1
  7. package/assets/assets/{RunsPage-B6LqcDRg.js → RunsPage-CxolaIps.js} +1 -1
  8. package/assets/assets/{SettingsPage-DNV6Is27.js → SettingsPage-BQqJz0Ms.js} +1 -1
  9. package/assets/assets/{SiteHealthSection-CWEIYXut.js → SiteHealthSection-C56kNcQQ.js} +3 -3
  10. package/assets/assets/{TrafficPage-ZZqGgMyL.js → TrafficPage-BDmWdYWf.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-_RMyqM86.js → TrafficSourceDetailPage-DZl3YNBs.js} +1 -1
  12. package/assets/assets/{extract-error-message-D-AaTlPU.js → extract-error-message-D0mBVEGn.js} +1 -1
  13. package/assets/assets/{index-BCKrocfL.js → index-DZ__RzGa.js} +21 -21
  14. package/assets/assets/{react-sigma_core.esm.min-CaRTZKvV.js → react-sigma_core.esm.min-BQNp33-g.js} +1 -1
  15. package/assets/assets/{v2-overview-adapter-C16fKgpq.js → v2-overview-adapter-XZbD7swG.js} +1 -1
  16. package/assets/index.html +2 -2
  17. package/dist/{chunk-QFI47QVP.js → chunk-3QBRDFI5.js} +11 -11
  18. package/dist/{chunk-LXHE4DVO.js → chunk-4MWLHTRS.js} +9 -0
  19. package/dist/{chunk-DMU3SFC4.js → chunk-6CR7DWLU.js} +12 -9
  20. package/dist/{chunk-HTTYBQN4.js → chunk-HB6XZOZ6.js} +2 -2
  21. package/dist/{chunk-B5W7HDCG.js → chunk-N7MRAN3G.js} +42 -17
  22. package/dist/{chunk-MJ3QINUW.js → chunk-TBAVVIVI.js} +3 -3
  23. package/dist/{chunk-PDOMOHOP.js → chunk-YOMLHHJS.js} +2 -2
  24. package/dist/cli.js +32 -13
  25. package/dist/{demo-server-VP6CP33U.js → demo-server-2622GU2H.js} +4 -4
  26. package/dist/index.js +6 -6
  27. package/dist/{intelligence-service-6F63MYQ5.js → intelligence-service-QUAOWEIA.js} +2 -2
  28. package/dist/mcp.js +4 -4
  29. package/package.json +14 -14
@@ -1,4 +1,4 @@
1
- import{g as Bt,t as S,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{e as Ht,G as Wt}from"./SiteHealthSection-CWEIYXut.js";import"./index-BCKrocfL.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-llkUFBGR.js";import"./vendor-lucide-N6vOpZmh.js";import"./vendor-markdown-B4giJcws.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-B5okB5g-.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-ZXXkndVj.js";import{e as Ht,G as Wt}from"./SiteHealthSection-C56kNcQQ.js";import"./index-DZ__RzGa.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-llkUFBGR.js";import"./vendor-lucide-N6vOpZmh.js";import"./vendor-markdown-B4giJcws.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-B5okB5g-.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
@@ -1 +1 @@
1
- import{r as j,j as a}from"./vendor-tanstack-ZXXkndVj.js";import{P as ie,fH as oe,B as le,aZ as ue}from"./index-BCKrocfL.js";import{M as ce}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as pe,g as J}from"./vendor-lucide-N6vOpZmh.js";const Ae="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function me({previewLength:e,highlight:r}){return o=>{if(e!==void 0&&Number.isFinite(e)){let c=Math.max(0,Math.floor(e));const d={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return c>0;const b=Array.from(f);if(b.length===0)return c>0;if(c===0)return d.omitted=!0,!1;const N=b.length>c,k=b.slice(0,c);if(N&&!/\s/.test(b[c])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>c-40&&(k.length=g)}return d.omitted||=N,n[s]=k.join(""),c=N?0:c-k.length,k.length===0?!1:(d.lastNode=n,d.field=s,!0)};p(o),d.omitted&&(d.lastNode?d.lastNode[d.field]=`${d.lastNode[d.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const c=d=>{["link","linkReference","code","inlineCode"].includes(d.type)||(d.type==="text"&&(d.data={...d.data,hName:"span"}),d.children?.forEach(c))};c(o)}}}function fe({headingLevel:e}){return r=>{const o=[],c=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(c)};c(r);const d=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-d;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=j.useState("idle"),c=j.useRef(!1),d=async()=>{if(!c.current){c.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{c.current=!1}}};return a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[a.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{d()},children:r==="copying"?B.copying:B.copy}),a.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ke=j.memo(function({children:r,headingLevel:o=4,copyable:c=!1,highlightGroups:d,previewLength:p}){return a.jsxs("div",{className:"answer-markdown",children:[a.jsx(ce,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!d?.length}]],components:{p:({children:n})=>a.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>a.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>a.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>a.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>a.jsx("span",{children:typeof n=="string"&&d?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:a.jsx(j.Fragment,{children:oe(s,d)},f)):n}),a:({children:n,href:s})=>{const f=ie(s);return f?a.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):a.jsx("span",{children:n})},img:({alt:n})=>a.jsx("span",{children:n})},children:r}),c&&r.trim()?a.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",D="flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",E=e=>e.kind==="project"?"Whole site":e.label,P={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Se({options:e,selected:r,onSelect:o,marketKey:c,label:d="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=j.useState(""),[N,k]=j.useState([]),[g,$]=j.useState(!1),C=j.useRef(null),I=j.useRef(null),i=j.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(N.at(-1)??""),F=h.get(N.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),R=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),U=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},A=(g?[]:l?y.filter(t=>x?U(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(R),K=s.find(t=>t.kind==="market"&&t.id===(c??(r.kind==="market"?r.id:void 0))),H=l&&K&&(l.marketKeys?.includes(K.id)||K.parentGroupIds?.includes(l.id))?K.id:void 0,L=n?H??he(l):void 0,V=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(R),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?U(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&R(t)),z=l||g?[]:s.filter(t=>t.kind==="project"&&R(t));j.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},T=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ae=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(K?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(S=>{const w=h.get(S);return w?[T(w)]:[]}),v=m.find(S=>S.at(-1)===l?.id)??m.sort((S,w)=>w.length-S.length)[0]??[],Z=u?T(u):r.marketKeys?.length?[]:v;k(t?T(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},Y=t=>{k(T(t)),$(!1),b(""),I.current?.focus()},q=(t,u=E(t))=>a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!n?P.browse(E(t)):P.select(E(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!n?Y(t):se(t),children:[a.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?a.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),a.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?a.jsx("button",{type:"button","aria-label":P.browse(t.label),title:`Browse ${t.label}`,className:"flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",onClick:()=>Y(t),children:a.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,u)=>u.length>0?a.jsxs("section",{"aria-label":t,className:"mt-2",children:[a.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>q(m))]}):null,Q=(t,u,m)=>u.length>0?a.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[a.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>q(v))]},`${l?.id??"root"}:${t}`):null;return a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{id:`${i}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:d}),a.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[a.jsxs("summary",{id:`${i}-value`,"aria-labelledby":`${i}-label ${i}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ae()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===c)?.label??(r.marketKeys?.length?P.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,a.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),a.jsxs("div",{className:"visibility-scope-menu",children:[l||g?a.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[a.jsx("button",{type:"button",className:D,"aria-label":`Back to ${F?.label??"all groups"}`,onClick:()=>{k(N.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(pe,{size:16,"aria-hidden":"true"}),F?.label??"All groups"]})}),a.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,a.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),a.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?q(l,"All properties in this group"):null,z.map(t=>q(t)),l&&!x?Q("Subgroups",A,!0):G(l?"Subgroups":"Groups",A),x?G("Properties",V):Q(l&&A.length>0?"All properties":"Properties",V,!l||A.length===0),G("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?a.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":P.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[a.jsx("span",{children:"All properties"}),a.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&A.length+V.length+W.length+z.length===0?a.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Ee(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const c=new Map;if(!r)return c;const d=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=d.get(s.usageEdgeId);if(!f)continue;const b=c.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),c.set(f,b)}return c}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:ue.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function je(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function Ne(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function Pe({overview:e,activePlan:r,report:o,reportState:c=o?"ready":"loading",sort:d}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(i=>[i.stableKey,i])),s=new Map(p.querySnapshots.map(i=>[i.queryId,i.queryText])),f=new Map;for(const i of p.assignments){if(e.queryClass!=="all"&&i.queryClass!==e.queryClass)continue;const y=s.get(i.queryId);if(!y)continue;const h=f.get(i.targetKey)??new Set;h.add(y),f.set(i.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,N=e.measurement.displayedRunId===void 0||b?"ready":c==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const i of p.groups)for(const y of i.targetKeys)g.has(y)||g.set(y,i.label);const $=e.properties.items.map(i=>{const y=n.get(i.targetKey),h=k.get(i.targetKey)??[];return{id:i.targetKey,name:i.label,mentionCoverage:M(i.mentionCoverage),citationCoverage:M(i.citationCoverage),status:Ce(i),providers:i.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(i.targetKey),assignedQueries:[...f.get(i.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:N,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(i=>({name:i.label,coverage:{numerator:i.credits,denominator:e.namedShareOfVoice.denominator}})),I=e.properties.items.flatMap(i=>i.flags>0?[{id:`property:${i.targetKey}`,property:i.label,summary:`${i.flags} ${i.flags===1?"result needs":"results need"} review.`,tone:"caution",count:i.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:je(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ne(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...d?{sort:d}:{}},availableGroups:p.groups.map(i=>({id:i.stableKey,label:i.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ke as A,P as M,Se as V,Ae as a,Ee as b,Pe as c,ye as m};
1
+ import{r as j,j as a}from"./vendor-tanstack-ZXXkndVj.js";import{P as ie,fH as oe,B as le,aZ as ue}from"./index-DZ__RzGa.js";import{M as ce}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as pe,g as J}from"./vendor-lucide-N6vOpZmh.js";const Ae="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function me({previewLength:e,highlight:r}){return o=>{if(e!==void 0&&Number.isFinite(e)){let c=Math.max(0,Math.floor(e));const d={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return c>0;const b=Array.from(f);if(b.length===0)return c>0;if(c===0)return d.omitted=!0,!1;const N=b.length>c,k=b.slice(0,c);if(N&&!/\s/.test(b[c])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>c-40&&(k.length=g)}return d.omitted||=N,n[s]=k.join(""),c=N?0:c-k.length,k.length===0?!1:(d.lastNode=n,d.field=s,!0)};p(o),d.omitted&&(d.lastNode?d.lastNode[d.field]=`${d.lastNode[d.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const c=d=>{["link","linkReference","code","inlineCode"].includes(d.type)||(d.type==="text"&&(d.data={...d.data,hName:"span"}),d.children?.forEach(c))};c(o)}}}function fe({headingLevel:e}){return r=>{const o=[],c=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(c)};c(r);const d=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-d;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=j.useState("idle"),c=j.useRef(!1),d=async()=>{if(!c.current){c.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{c.current=!1}}};return a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[a.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{d()},children:r==="copying"?B.copying:B.copy}),a.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ke=j.memo(function({children:r,headingLevel:o=4,copyable:c=!1,highlightGroups:d,previewLength:p}){return a.jsxs("div",{className:"answer-markdown",children:[a.jsx(ce,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!d?.length}]],components:{p:({children:n})=>a.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>a.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>a.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>a.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>a.jsx("span",{children:typeof n=="string"&&d?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:a.jsx(j.Fragment,{children:oe(s,d)},f)):n}),a:({children:n,href:s})=>{const f=ie(s);return f?a.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):a.jsx("span",{children:n})},img:({alt:n})=>a.jsx("span",{children:n})},children:r}),c&&r.trim()?a.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",D="flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",E=e=>e.kind==="project"?"Whole site":e.label,P={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Se({options:e,selected:r,onSelect:o,marketKey:c,label:d="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=j.useState(""),[N,k]=j.useState([]),[g,$]=j.useState(!1),C=j.useRef(null),I=j.useRef(null),i=j.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(N.at(-1)??""),F=h.get(N.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),R=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),U=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},A=(g?[]:l?y.filter(t=>x?U(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(R),K=s.find(t=>t.kind==="market"&&t.id===(c??(r.kind==="market"?r.id:void 0))),H=l&&K&&(l.marketKeys?.includes(K.id)||K.parentGroupIds?.includes(l.id))?K.id:void 0,L=n?H??he(l):void 0,V=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(R),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?U(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&R(t)),z=l||g?[]:s.filter(t=>t.kind==="project"&&R(t));j.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},T=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ae=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(K?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(S=>{const w=h.get(S);return w?[T(w)]:[]}),v=m.find(S=>S.at(-1)===l?.id)??m.sort((S,w)=>w.length-S.length)[0]??[],Z=u?T(u):r.marketKeys?.length?[]:v;k(t?T(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},Y=t=>{k(T(t)),$(!1),b(""),I.current?.focus()},q=(t,u=E(t))=>a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!n?P.browse(E(t)):P.select(E(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!n?Y(t):se(t),children:[a.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?a.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),a.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?a.jsx("button",{type:"button","aria-label":P.browse(t.label),title:`Browse ${t.label}`,className:"flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",onClick:()=>Y(t),children:a.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,u)=>u.length>0?a.jsxs("section",{"aria-label":t,className:"mt-2",children:[a.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>q(m))]}):null,Q=(t,u,m)=>u.length>0?a.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[a.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>q(v))]},`${l?.id??"root"}:${t}`):null;return a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{id:`${i}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:d}),a.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[a.jsxs("summary",{id:`${i}-value`,"aria-labelledby":`${i}-label ${i}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ae()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===c)?.label??(r.marketKeys?.length?P.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,a.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),a.jsxs("div",{className:"visibility-scope-menu",children:[l||g?a.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[a.jsx("button",{type:"button",className:D,"aria-label":`Back to ${F?.label??"all groups"}`,onClick:()=>{k(N.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(pe,{size:16,"aria-hidden":"true"}),F?.label??"All groups"]})}),a.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,a.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),a.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?q(l,"All properties in this group"):null,z.map(t=>q(t)),l&&!x?Q("Subgroups",A,!0):G(l?"Subgroups":"Groups",A),x?G("Properties",V):Q(l&&A.length>0?"All properties":"Properties",V,!l||A.length===0),G("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?a.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":P.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[a.jsx("span",{children:"All properties"}),a.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&A.length+V.length+W.length+z.length===0?a.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Ee(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const c=new Map;if(!r)return c;const d=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=d.get(s.usageEdgeId);if(!f)continue;const b=c.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),c.set(f,b)}return c}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:ue.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function je(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function Ne(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function Pe({overview:e,activePlan:r,report:o,reportState:c=o?"ready":"loading",sort:d}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(i=>[i.stableKey,i])),s=new Map(p.querySnapshots.map(i=>[i.queryId,i.queryText])),f=new Map;for(const i of p.assignments){if(e.queryClass!=="all"&&i.queryClass!==e.queryClass)continue;const y=s.get(i.queryId);if(!y)continue;const h=f.get(i.targetKey)??new Set;h.add(y),f.set(i.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,N=e.measurement.displayedRunId===void 0||b?"ready":c==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const i of p.groups)for(const y of i.targetKeys)g.has(y)||g.set(y,i.label);const $=e.properties.items.map(i=>{const y=n.get(i.targetKey),h=k.get(i.targetKey)??[];return{id:i.targetKey,name:i.label,mentionCoverage:M(i.mentionCoverage),citationCoverage:M(i.citationCoverage),status:Ce(i),providers:i.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(i.targetKey),assignedQueries:[...f.get(i.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:N,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(i=>({name:i.label,coverage:{numerator:i.credits,denominator:e.namedShareOfVoice.denominator}})),I=e.properties.items.flatMap(i=>i.flags>0?[{id:`property:${i.targetKey}`,property:i.label,summary:`${i.flags} ${i.flags===1?"result needs":"results need"} review.`,tone:"caution",count:i.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:je(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ne(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...d?{sort:d}:{}},availableGroups:p.groups.map(i=>({id:i.stableKey,label:i.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ke as A,P as M,Se as V,Ae as a,Ee as b,Pe as c,ye as m};
package/assets/index.html CHANGED
@@ -6,13 +6,13 @@
6
6
  <meta name="theme-color" content="#10141C" />
7
7
  <meta
8
8
  name="description"
9
- content="See how your brand and properties appear in AI answers. Track mentions, citations, and competitors over time."
9
+ content="An agent-first platform for AI visibility, technical SEO, search analytics, server traffic, and content workflows. Investigate, act, and measure results."
10
10
  />
11
11
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
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-BCKrocfL.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-DZ__RzGa.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-ZXXkndVj.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-twS1M3FF.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-llkUFBGR.js">
@@ -19,21 +19,21 @@ import {
19
19
  runWithUsageTags,
20
20
  saveConfigPatch,
21
21
  sentimentInstallReadiness
22
- } from "./chunk-PDOMOHOP.js";
22
+ } from "./chunk-YOMLHHJS.js";
23
23
  import {
24
24
  computeFactorAverages,
25
25
  deleteSiteCrawlGraphLayout,
26
26
  persistSiteCrawlGraphLayout,
27
27
  prepareSiteCrawlGraphLayout,
28
28
  recordedSharePct
29
- } from "./chunk-HTTYBQN4.js";
29
+ } from "./chunk-HB6XZOZ6.js";
30
30
  import {
31
31
  CanonryMcpToolNames,
32
32
  CliError,
33
33
  PACKAGE_VERSION,
34
34
  canonryMcpTools,
35
35
  isMachineFormat
36
- } from "./chunk-DMU3SFC4.js";
36
+ } from "./chunk-6CR7DWLU.js";
37
37
  import {
38
38
  CC_CACHE_DIR,
39
39
  DUCKDB_SPEC,
@@ -214,7 +214,7 @@ import {
214
214
  siteLivenessState,
215
215
  toAlertView,
216
216
  usageCounters
217
- } from "./chunk-B5W7HDCG.js";
217
+ } from "./chunk-N7MRAN3G.js";
218
218
  import {
219
219
  AGENT_MEMORY_VALUE_MAX_BYTES,
220
220
  AGENT_NONE,
@@ -414,7 +414,7 @@ import {
414
414
  visibilityReportRequestSchema,
415
415
  winnabilityClassLabel,
416
416
  withRetry
417
- } from "./chunk-LXHE4DVO.js";
417
+ } from "./chunk-4MWLHTRS.js";
418
418
 
419
419
  // src/runtime-context.ts
420
420
  function cliRuntimeContext(env = process.env, stdio = process) {
@@ -7830,7 +7830,7 @@ function nonBlank(value) {
7830
7830
  return trimmed ? trimmed : void 0;
7831
7831
  }
7832
7832
  function resolveBuildCommit(env = process.env) {
7833
- const embedded = true ? "fa1be433951042396fa94c96898efadbb4e1d212" : void 0;
7833
+ const embedded = true ? "3a39895ae1a89ddce3f2583ebf229d5acc875ab4" : void 0;
7834
7834
  return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
7835
7835
  }
7836
7836
  function resolveInstanceIdentity(env = process.env) {
@@ -14454,7 +14454,7 @@ function readStoredGroundingSources(rawResponse) {
14454
14454
  return result2;
14455
14455
  }
14456
14456
  async function backfillInsightsCommand(project, opts) {
14457
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-6F63MYQ5.js");
14457
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-QUAOWEIA.js");
14458
14458
  const config = loadConfig();
14459
14459
  const db = createClient(config.database);
14460
14460
  migrate(db);
@@ -15530,7 +15530,7 @@ var Scheduler = class {
15530
15530
  return;
15531
15531
  }
15532
15532
  const runId2 = crypto20.randomUUID();
15533
- const effectiveRequest = normalizeSiteAuditRunRequest({});
15533
+ const effectiveRequest = normalizeSiteAuditRunRequest({ maxPages: SITE_AUDIT_MAX_PAGE_LIMIT });
15534
15534
  this.db.transaction((tx) => {
15535
15535
  tx.insert(runs).values({
15536
15536
  id: runId2,
@@ -15553,7 +15553,7 @@ var Scheduler = class {
15553
15553
  nextRunAt
15554
15554
  });
15555
15555
  log15.info("site-audit.triggered", { runId: runId2, projectName: project.name });
15556
- this.callbacks.onSiteAuditRequested(runId2, projectId);
15556
+ this.callbacks.onSiteAuditRequested(runId2, projectId, { maxPages: effectiveRequest.maxPages });
15557
15557
  return;
15558
15558
  }
15559
15559
  const projectLocations = project.locations;
@@ -22468,8 +22468,8 @@ async function createServer(opts) {
22468
22468
  });
22469
22469
  })();
22470
22470
  },
22471
- onSiteAuditRequested: (runId, projectId) => {
22472
- runSiteAudit(runId, projectId);
22471
+ onSiteAuditRequested: (runId, projectId, auditOpts) => {
22472
+ runSiteAudit(runId, projectId, auditOpts);
22473
22473
  }
22474
22474
  });
22475
22475
  const providerSummary = API_ADAPTERS.map((adapter) => ({
@@ -12514,10 +12514,15 @@ var siteCrawlPageAuditSchema = z38.discriminatedUnion("state", [
12514
12514
  })
12515
12515
  ]);
12516
12516
  var siteCrawlPagesFilterStateSchema = z38.enum(["applied", "unavailable-legacy-scan"]);
12517
+ var siteCrawlCompletenessShape = {
12518
+ complete: z38.boolean(),
12519
+ termination: z38.string().nullable()
12520
+ };
12517
12521
  var siteCrawlPagesResponseSchema = z38.object({
12518
12522
  project: z38.string(),
12519
12523
  hasCrawlData: z38.boolean(),
12520
12524
  runId: z38.string().nullable(),
12525
+ ...siteCrawlCompletenessShape,
12521
12526
  total: z38.number().int().nonnegative(),
12522
12527
  nextCursor: z38.string().nullable(),
12523
12528
  /** Null when no `healthState` filter was requested. */
@@ -12537,6 +12542,7 @@ var siteCrawlStructureResponseSchema = z38.object({
12537
12542
  project: z38.string(),
12538
12543
  hasCrawlData: z38.boolean(),
12539
12544
  runId: z38.string().nullable(),
12545
+ ...siteCrawlCompletenessShape,
12540
12546
  parentPath: z38.string(),
12541
12547
  nextCursor: z38.string().nullable(),
12542
12548
  children: z38.array(siteCrawlStructureChildSchema).default([])
@@ -12650,6 +12656,7 @@ var siteCrawlGraphResponseSchema = z38.object({
12650
12656
  * and it can name a page that graph sampling left out of `nodes`.
12651
12657
  */
12652
12658
  rootNodeKey: z38.string().nullable(),
12659
+ ...siteCrawlCompletenessShape,
12653
12660
  layout: siteCrawlGraphLayoutSchema,
12654
12661
  /** Whether nav and footer links could be told apart for this scan. */
12655
12662
  templateDetection: siteHealthTemplateDetectionSchema,
@@ -12812,6 +12819,7 @@ var siteCrawlInternalLinksResponseSchema = z38.object({
12812
12819
  project: z38.string(),
12813
12820
  hasCrawlData: z38.boolean(),
12814
12821
  runId: z38.string().nullable(),
12822
+ ...siteCrawlCompletenessShape,
12815
12823
  /** Total links matching every requested filter, `linkKind` included. */
12816
12824
  total: z38.number().int().nonnegative(),
12817
12825
  nextCursor: z38.string().nullable(),
@@ -12825,6 +12833,7 @@ var siteCrawlNeighborsResponseSchema = z38.object({
12825
12833
  project: z38.string(),
12826
12834
  hasCrawlData: z38.boolean(),
12827
12835
  runId: z38.string().nullable(),
12836
+ ...siteCrawlCompletenessShape,
12828
12837
  nodeKey: z38.string().nullable(),
12829
12838
  url: z38.string().nullable(),
12830
12839
  /** Whether nav and footer links could be told apart for this scan. */
@@ -128,7 +128,7 @@ import {
128
128
  trafficSeriesGranularitySchema,
129
129
  visibilityCompareSelectionSchema,
130
130
  visibilityReportRequestSchema
131
- } from "./chunk-LXHE4DVO.js";
131
+ } from "./chunk-4MWLHTRS.js";
132
132
 
133
133
  // src/cli-error.ts
134
134
  function isMachineFormat(format) {
@@ -1083,13 +1083,16 @@ var technicalAeoTrendInputSchema = z3.object({
1083
1083
  project: projectNameSchema,
1084
1084
  limit: z3.number().int().positive().max(365).optional()
1085
1085
  });
1086
+ var crawlRunIdSchema = runIdSchema.optional().describe(
1087
+ "Historical crawl-bearing site-audit run ID. Omit for the newest scan with a crawl, complete or stopped at its budget."
1088
+ );
1086
1089
  var technicalAeoCrawlInputSchema = z3.object({
1087
1090
  project: projectNameSchema,
1088
- runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest persisted crawl.")
1091
+ runId: crawlRunIdSchema
1089
1092
  });
1090
1093
  var siteHealthPageAuditInputSchema = z3.object({
1091
1094
  project: projectNameSchema,
1092
- runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest persisted crawl."),
1095
+ runId: crawlRunIdSchema,
1093
1096
  nodeKey: z3.string().min(1).optional().describe("Exact crawl node key, as returned by Site Health page or subgraph reads."),
1094
1097
  url: z3.string().url().optional().describe("Exact page URL. Use this only when a crawl node key is unavailable.")
1095
1098
  }).refine((value) => Boolean(value.nodeKey || value.url), {
@@ -1103,7 +1106,7 @@ var SITE_HEALTH_MCP_MAX_NODES = 25;
1103
1106
  var SITE_HEALTH_MCP_MAX_EDGES = 50;
1104
1107
  var siteHealthSubgraphInputSchema = z3.object({
1105
1108
  project: projectNameSchema,
1106
- runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest complete crawl."),
1109
+ runId: crawlRunIdSchema,
1107
1110
  nodeKey: z3.string().min(1).optional().describe("Focus crawl node key. Omit with url to focus the crawl root."),
1108
1111
  url: z3.string().url().optional().describe("Focus canonical URL. Omit with nodeKey to focus the crawl root."),
1109
1112
  hops: z3.number().int().min(0).max(3).optional().describe("Neighborhood depth from the focus node. Keep this small."),
@@ -1115,7 +1118,7 @@ var siteHealthSubgraphInputSchema = z3.object({
1115
1118
  });
1116
1119
  var siteHealthPathInputSchema = z3.object({
1117
1120
  project: projectNameSchema,
1118
- runId: runIdSchema.optional().describe("Historical crawl-bearing site-audit run ID. Omit for the latest complete crawl."),
1121
+ runId: crawlRunIdSchema,
1119
1122
  fromNodeKey: z3.string().min(1).optional().describe("Origin node key. Omit with fromUrl to start at the crawl root."),
1120
1123
  fromUrl: z3.string().url().optional().describe("Origin URL. Omit with fromNodeKey to start at the crawl root."),
1121
1124
  toNodeKey: z3.string().min(1).optional().describe("Required destination node key."),
@@ -3637,7 +3640,7 @@ var canonryMcpTools = [
3637
3640
  defineTool({
3638
3641
  name: "canonry_technical_aeo_crawl_pages",
3639
3642
  title: "List Technical AEO crawl pages",
3640
- description: "Read one bounded, cursor-paged list of canonical crawl nodes. Filter crawler-derived indexability and audit state, then follow nextCursor; this is technical inventory eligibility, not a claim about Google index coverage.",
3643
+ description: "Read one bounded, cursor-paged list of canonical crawl nodes. Filter crawler-derived indexability and audit state, then follow nextCursor; this is technical inventory eligibility, not a claim about Google index coverage. `complete: false` means the crawl stopped at the budget named by `termination`, so a missing page or link is not proof it does not exist.",
3641
3644
  access: "read",
3642
3645
  tier: "monitoring",
3643
3646
  inputSchema: technicalAeoCrawlPagesInputSchema,
@@ -3657,7 +3660,7 @@ var canonryMcpTools = [
3657
3660
  defineTool({
3658
3661
  name: "canonry_technical_aeo_structure",
3659
3662
  title: "List Technical AEO site structure",
3660
- description: "Read one bounded level of the persisted site hierarchy below parentPath. Follow nextCursor for more siblings; request a child path separately rather than attempting to materialize the entire website tree.",
3663
+ description: "Read one bounded level of the persisted site hierarchy below parentPath. Follow nextCursor for more siblings; request a child path separately rather than attempting to materialize the entire website tree. `complete: false` means the crawl stopped at the budget named by `termination`, so a missing page or link is not proof it does not exist.",
3661
3664
  access: "read",
3662
3665
  tier: "monitoring",
3663
3666
  inputSchema: technicalAeoStructureInputSchema,
@@ -3673,7 +3676,7 @@ var canonryMcpTools = [
3673
3676
  defineTool({
3674
3677
  name: "canonry_technical_aeo_internal_links",
3675
3678
  title: "List Technical AEO internal links",
3676
- description: "Read a bounded, cursor-paged list of persisted internal crawl edges. Filter by source URL, target URL, followability, or link kind. Nav, header, and footer links are marked isTemplate; templateSource says which rule decided each one (placement, ubiquity, or unmeasured when neither had evidence) and templateDetection reports the same for the scan, so an empty content-only list is not evidence of no content links and two scans classified by different rules are never compared as if they were the same measurement. Use the neighbors tool for one page rather than loading a graph.",
3679
+ description: "Read a bounded, cursor-paged list of persisted internal crawl edges. Filter by source URL, target URL, followability, or link kind. Nav, header, and footer links are marked isTemplate; templateSource says which rule decided each one (placement, ubiquity, or unmeasured when neither had evidence) and templateDetection reports the same for the scan, so an empty content-only list is not evidence of no content links and two scans classified by different rules are never compared as if they were the same measurement. Use the neighbors tool for one page rather than loading a graph. `complete: false` means the crawl stopped at the budget named by `termination`, so a missing page or link is not proof it does not exist.",
3677
3680
  access: "read",
3678
3681
  tier: "monitoring",
3679
3682
  inputSchema: technicalAeoInternalLinksInputSchema,
@@ -3692,7 +3695,7 @@ var canonryMcpTools = [
3692
3695
  defineTool({
3693
3696
  name: "canonry_technical_aeo_link_neighbors",
3694
3697
  title: "Get Technical AEO page link neighbors",
3695
- description: "Read bounded inbound and outbound internal links for exactly one crawl node, selected by nodeKey or URL. Filter by link kind to separate editorial links from nav, header, and footer links. It returns independent truncation flags for inbound and outbound edges, not a transitive traversal.",
3698
+ description: "Read bounded inbound and outbound internal links for exactly one crawl node, selected by nodeKey or URL. Filter by link kind to separate editorial links from nav, header, and footer links. It returns independent truncation flags for inbound and outbound edges, not a transitive traversal. `complete: false` means the crawl stopped at the budget named by `termination`, so a missing page or link is not proof it does not exist.",
3696
3699
  access: "read",
3697
3700
  tier: "monitoring",
3698
3701
  inputSchema: technicalAeoLinkNeighborsInputSchema,
@@ -5,7 +5,7 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-B5W7HDCG.js";
8
+ } from "./chunk-N7MRAN3G.js";
9
9
  import {
10
10
  SITE_CRAWL_GRAPH_MAX_EDGES,
11
11
  SITE_CRAWL_GRAPH_MAX_NODES,
@@ -13,7 +13,7 @@ import {
13
13
  TEMPLATE_LINK_RATIO_THRESHOLD,
14
14
  factorStatusFromScore,
15
15
  roundPreservingTotal
16
- } from "./chunk-LXHE4DVO.js";
16
+ } from "./chunk-4MWLHTRS.js";
17
17
 
18
18
  // src/site-audit-factors.ts
19
19
  function recordedSharePct(factor) {
@@ -869,7 +869,7 @@ import {
869
869
  wordpressSchemaDeployResultDtoSchema,
870
870
  wordpressSchemaStatusResultDtoSchema,
871
871
  wordpressStatusDtoSchema
872
- } from "./chunk-LXHE4DVO.js";
872
+ } from "./chunk-4MWLHTRS.js";
873
873
 
874
874
  // src/intelligence-service.ts
875
875
  import { eq as eq82, desc as desc36, asc as asc15, and as and69, ne as ne14, or as or20, inArray as inArray32, gte as gte22, lte as lte20, isNull as isNull16, sql as sql31, exists } from "drizzle-orm";
@@ -46917,7 +46917,7 @@ var routeCatalog = [
46917
46917
  method: "get",
46918
46918
  path: "/api/v1/projects/{name}/technical-aeo/crawl",
46919
46919
  summary: "Get persisted Technical AEO crawl metadata",
46920
- description: "Returns the latest complete non-probe site-audit crawl, or the selected historical run (which may be partial). `hasCrawlData=false` never synthesizes a graph from legacy scorecard rows; `legacyAuditAvailable` says that the old score/pages/trend data can still be read separately.",
46920
+ description: "Returns the newest non-probe site-audit crawl, or the selected historical run. The default is the newest scan that published a crawl, whether it finished (`completed`) or stopped at its page, edge, depth, or duration budget (`partial`); `complete` and `termination` say which. Every crawl-scoped read without a `runId` resolves this same scan. `hasCrawlData=false` never synthesizes a graph from legacy scorecard rows; `legacyAuditAvailable` says that the old score/pages/trend data can still be read separately.",
46921
46921
  tags: ["technical-aeo"],
46922
46922
  parameters: [
46923
46923
  nameParameter,
@@ -46932,11 +46932,11 @@ var routeCatalog = [
46932
46932
  method: "get",
46933
46933
  path: "/api/v1/projects/{name}/technical-aeo/graph",
46934
46934
  summary: "Get a persisted Site Health graph projection",
46935
- description: "Returns the deterministic graph projection computed once when the latest complete or selected historical crawl was published. ForceAtlas2 positions and the exact internal-anchor edge sample are persisted, so reads run no layout physics and never rescan the crawl edge table. Nav, header, and footer links are excluded from the layout physics but retained in the sample and tagged `isTemplate`, so a viewer can draw them without a refetch and without any node moving. The response is bounded to 20,000 nodes / 50,000 edges; `layout`, `omittedNodes`, `omittedEdges`, and `sampled` disclose legacy/unavailable layouts and intentional truncation, and `templateDetection` says whether template links could be told apart at all and by which rule.",
46935
+ description: "Returns the deterministic graph projection computed once when the latest or selected historical crawl was published. ForceAtlas2 positions and the exact internal-anchor edge sample are persisted, so reads run no layout physics and never rescan the crawl edge table. Nav, header, and footer links are excluded from the layout physics but retained in the sample and tagged `isTemplate`, so a viewer can draw them without a refetch and without any node moving. The response is bounded to 20,000 nodes / 50,000 edges; `layout`, `omittedNodes`, `omittedEdges`, and `sampled` disclose legacy/unavailable layouts and intentional truncation, and `templateDetection` says whether template links could be told apart at all and by which rule.",
46936
46936
  tags: ["technical-aeo"],
46937
46937
  parameters: [
46938
46938
  nameParameter,
46939
- { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest complete crawl.", schema: stringSchema },
46939
+ { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest crawl.", schema: stringSchema },
46940
46940
  { name: "maxNodes", in: "query", description: "Maximum graph nodes. Defaults to and is capped at 20,000.", schema: { type: "integer", minimum: 1, maximum: 2e4 } },
46941
46941
  { name: "maxEdges", in: "query", description: "Maximum graph edges. Defaults to and is capped at 50,000.", schema: { type: "integer", minimum: 1, maximum: 5e4 } },
46942
46942
  linkKindParameter
@@ -46954,7 +46954,7 @@ var routeCatalog = [
46954
46954
  tags: ["technical-aeo"],
46955
46955
  parameters: [
46956
46956
  nameParameter,
46957
- { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest complete crawl.", schema: stringSchema },
46957
+ { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest crawl.", schema: stringSchema },
46958
46958
  { name: "nodeKey", in: "query", description: "Focus page canonical node key. Omit nodeKey and url to use the crawl root.", schema: stringSchema },
46959
46959
  { name: "url", in: "query", description: "Focus page canonical URL. Omit nodeKey and url to use the crawl root.", schema: stringSchema },
46960
46960
  { name: "hops", in: "query", description: "Undirected neighborhood radius. Defaults to 1; maximum 3.", schema: { type: "integer", minimum: 0, maximum: 3 } },
@@ -46974,7 +46974,7 @@ var routeCatalog = [
46974
46974
  tags: ["technical-aeo"],
46975
46975
  parameters: [
46976
46976
  nameParameter,
46977
- { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest complete crawl.", schema: stringSchema },
46977
+ { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest crawl.", schema: stringSchema },
46978
46978
  { name: "fromNodeKey", in: "query", description: "Source canonical node key. Omit both source selectors to start at the crawl root.", schema: stringSchema },
46979
46979
  { name: "fromUrl", in: "query", description: "Source canonical URL. Omit both source selectors to start at the crawl root.", schema: stringSchema },
46980
46980
  { name: "toNodeKey", in: "query", description: "Target canonical node key. Required when toUrl is omitted.", schema: stringSchema },
@@ -46991,7 +46991,7 @@ var routeCatalog = [
46991
46991
  method: "get",
46992
46992
  path: "/api/v1/projects/{name}/technical-aeo/changes",
46993
46993
  summary: "Compare canonical Site Health snapshots",
46994
- description: "Returns exact page and internal-link additions, removals, and semantic field changes between immutable complete crawl snapshots. Omitted toRunId selects the latest complete crawl; omitted fromRunId selects the complete crawl immediately before the target. ForceAtlas2 positions are presentation data and never count as a change. The first page includes exact post-filter summary counts; cursor pages set summary and total to null so they never repeat full snapshot joins or trust caller-carried counts. Results use a snapshot- and filter-bound keyset cursor.",
46994
+ description: "Returns exact page and internal-link additions, removals, and semantic field changes between immutable complete crawl snapshots. Omitted toRunId selects the latest complete crawl; omitted fromRunId selects the complete crawl immediately before the target. A crawl stopped at its budget is never compared: when every crawl is partial, the result is `partial-not-comparable` with the newest crawl as `toRunId`, and `no-crawl` means no scan published a crawl. ForceAtlas2 positions are presentation data and never count as a change. The first page includes exact post-filter summary counts; cursor pages set summary and total to null so they never repeat full snapshot joins or trust caller-carried counts. Results use a snapshot- and filter-bound keyset cursor.",
46995
46995
  tags: ["technical-aeo"],
46996
46996
  parameters: [
46997
46997
  nameParameter,
@@ -47016,7 +47016,7 @@ var routeCatalog = [
47016
47016
  tags: ["technical-aeo"],
47017
47017
  parameters: [
47018
47018
  nameParameter,
47019
- { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest complete crawl.", schema: stringSchema },
47019
+ { name: "runId", in: "query", description: "Historical site-audit run ID. Omit for the latest crawl.", schema: stringSchema },
47020
47020
  { name: "nodeKey", in: "query", description: "Exact canonical crawl node key. Required when url is omitted.", schema: stringSchema },
47021
47021
  { name: "url", in: "query", description: "Exact persisted crawl URL. Required when nodeKey is omitted.", schema: stringSchema }
47022
47022
  ],
@@ -88451,14 +88451,15 @@ async function technicalAeoRoutes(app, opts) {
88451
88451
  inArray31(runs.status, SURFACEABLE_STATUSES),
88452
88452
  notProbeRun()
88453
88453
  ];
88454
- if (runId) {
88455
- filters.push(eq78(siteCrawlSnapshots.runId, runId));
88456
- } else {
88457
- filters.push(eq78(siteCrawlSnapshots.complete, true), eq78(runs.status, RunStatuses.completed));
88458
- }
88454
+ if (runId) filters.push(eq78(siteCrawlSnapshots.runId, runId));
88459
88455
  return app.db.select({ snapshot: siteCrawlSnapshots, runStatus: runs.status }).from(siteCrawlSnapshots).innerJoin(runs, eq78(siteCrawlSnapshots.runId, runs.id)).where(and66(...filters)).orderBy(desc34(siteCrawlSnapshots.createdAt), desc34(siteCrawlSnapshots.runId)).limit(1).get();
88460
88456
  };
88461
88457
  const detailScopeFor = (projectId, snapshot) => snapshot.detailsAvailable && snapshot.attemptId ? { projectId, runId: snapshot.runId, attemptId: snapshot.attemptId } : null;
88458
+ const completenessOf = (snapshot) => ({
88459
+ complete: snapshot.complete,
88460
+ termination: snapshot.termination
88461
+ });
88462
+ const NO_CRAWL_COMPLETENESS = { complete: false, termination: null };
88462
88463
  const pageInScope = (scope, selector) => {
88463
88464
  if (!selector.nodeKey && !selector.url) return null;
88464
88465
  return app.db.select().from(siteCrawlPages).where(and66(
@@ -88646,6 +88647,7 @@ async function technicalAeoRoutes(app, opts) {
88646
88647
  project: project.name,
88647
88648
  hasCrawlData: false,
88648
88649
  runId: null,
88650
+ ...NO_CRAWL_COMPLETENESS,
88649
88651
  rootNodeKey: null,
88650
88652
  layout: { state: "unavailable", version: null, reason: "no-crawl" },
88651
88653
  // Nothing was classified because nothing was crawled.
@@ -88669,6 +88671,7 @@ async function technicalAeoRoutes(app, opts) {
88669
88671
  project: project.name,
88670
88672
  hasCrawlData: true,
88671
88673
  runId: snapshot.runId,
88674
+ ...completenessOf(snapshot),
88672
88675
  rootNodeKey: null,
88673
88676
  layout: { state: "unavailable", version: null, reason: "details-unavailable" },
88674
88677
  templateDetection,
@@ -88698,6 +88701,7 @@ async function technicalAeoRoutes(app, opts) {
88698
88701
  project: project.name,
88699
88702
  hasCrawlData: true,
88700
88703
  runId: snapshot.runId,
88704
+ ...completenessOf(snapshot),
88701
88705
  rootNodeKey,
88702
88706
  layout: { state: "unavailable", version: null, reason: "legacy-snapshot" },
88703
88707
  templateDetection,
@@ -88720,6 +88724,7 @@ async function technicalAeoRoutes(app, opts) {
88720
88724
  project: project.name,
88721
88725
  hasCrawlData: true,
88722
88726
  runId: snapshot.runId,
88727
+ ...completenessOf(snapshot),
88723
88728
  rootNodeKey,
88724
88729
  layout: {
88725
88730
  state: "unavailable",
@@ -88809,6 +88814,7 @@ async function technicalAeoRoutes(app, opts) {
88809
88814
  project: project.name,
88810
88815
  hasCrawlData: true,
88811
88816
  runId: snapshot.runId,
88817
+ ...completenessOf(snapshot),
88812
88818
  rootNodeKey,
88813
88819
  layout: {
88814
88820
  state: "ready",
@@ -89153,6 +89159,16 @@ async function technicalAeoRoutes(app, opts) {
89153
89159
  )).orderBy(desc34(siteCrawlSnapshots.createdAt), desc34(siteCrawlSnapshots.runId)).limit(1).get() : void 0;
89154
89160
  if (request.query.fromRunId && !beforeTarget) throw notFound("Site crawl run", request.query.fromRunId);
89155
89161
  if (!afterTarget) {
89162
+ const latestCrawl = resolveCrawl(project.id);
89163
+ if (latestCrawl) {
89164
+ return {
89165
+ project: project.name,
89166
+ state: "unavailable",
89167
+ reason: "partial-not-comparable",
89168
+ fromRunId: null,
89169
+ toRunId: latestCrawl.snapshot.runId
89170
+ };
89171
+ }
89156
89172
  return { project: project.name, state: "unavailable", reason: "no-crawl", fromRunId: null, toRunId: null };
89157
89173
  }
89158
89174
  if (!beforeTarget) {
@@ -89510,11 +89526,11 @@ async function technicalAeoRoutes(app, opts) {
89510
89526
  const target = resolveCrawl(project.id, request.query.runId);
89511
89527
  if (!target) {
89512
89528
  assertKnownAuditRun(project.id, request.query.runId);
89513
- return { project: project.name, hasCrawlData: false, runId: null, total: 0, nextCursor: null, healthStateFilter: null, pages: [] };
89529
+ return { project: project.name, hasCrawlData: false, runId: null, ...NO_CRAWL_COMPLETENESS, total: 0, nextCursor: null, healthStateFilter: null, pages: [] };
89514
89530
  }
89515
89531
  const snapshot = target.snapshot;
89516
89532
  if (!snapshot.detailsAvailable || !snapshot.attemptId) {
89517
- return { project: project.name, hasCrawlData: true, runId: snapshot.runId, total: 0, nextCursor: null, healthStateFilter: null, pages: [] };
89533
+ return { project: project.name, hasCrawlData: true, runId: snapshot.runId, ...completenessOf(snapshot), total: 0, nextCursor: null, healthStateFilter: null, pages: [] };
89518
89534
  }
89519
89535
  const filters = [
89520
89536
  eq78(siteCrawlPages.projectId, project.id),
@@ -89547,6 +89563,7 @@ async function technicalAeoRoutes(app, opts) {
89547
89563
  project: project.name,
89548
89564
  hasCrawlData: true,
89549
89565
  runId: snapshot.runId,
89566
+ ...completenessOf(snapshot),
89550
89567
  total: 0,
89551
89568
  nextCursor: null,
89552
89569
  healthStateFilter,
@@ -89561,6 +89578,7 @@ async function technicalAeoRoutes(app, opts) {
89561
89578
  project: project.name,
89562
89579
  hasCrawlData: true,
89563
89580
  runId: snapshot.runId,
89581
+ ...completenessOf(snapshot),
89564
89582
  total,
89565
89583
  nextCursor: nextOffset < total ? encodeCursor2(nextOffset) : null,
89566
89584
  healthStateFilter,
@@ -89573,11 +89591,11 @@ async function technicalAeoRoutes(app, opts) {
89573
89591
  const target = resolveCrawl(project.id, request.query.runId);
89574
89592
  if (!target) {
89575
89593
  assertKnownAuditRun(project.id, request.query.runId);
89576
- return { project: project.name, hasCrawlData: false, runId: null, parentPath, nextCursor: null, children: [] };
89594
+ return { project: project.name, hasCrawlData: false, runId: null, ...NO_CRAWL_COMPLETENESS, parentPath, nextCursor: null, children: [] };
89577
89595
  }
89578
89596
  const snapshot = target.snapshot;
89579
89597
  if (!snapshot.detailsAvailable || !snapshot.attemptId) {
89580
- return { project: project.name, hasCrawlData: true, runId: snapshot.runId, parentPath, nextCursor: null, children: [] };
89598
+ return { project: project.name, hasCrawlData: true, runId: snapshot.runId, ...completenessOf(snapshot), parentPath, nextCursor: null, children: [] };
89581
89599
  }
89582
89600
  const sourceRows = app.db.select({
89583
89601
  path: siteCrawlPages.path,
@@ -89622,6 +89640,7 @@ async function technicalAeoRoutes(app, opts) {
89622
89640
  project: project.name,
89623
89641
  hasCrawlData: true,
89624
89642
  runId: snapshot.runId,
89643
+ ...completenessOf(snapshot),
89625
89644
  parentPath,
89626
89645
  nextCursor: hasMore ? encodeCursor2(offset + visible.length) : null,
89627
89646
  children: visible.map(([path8, child]) => ({
@@ -89644,6 +89663,7 @@ async function technicalAeoRoutes(app, opts) {
89644
89663
  project: project.name,
89645
89664
  hasCrawlData: false,
89646
89665
  runId: null,
89666
+ ...NO_CRAWL_COMPLETENESS,
89647
89667
  total: 0,
89648
89668
  nextCursor: null,
89649
89669
  templateDetection: SiteHealthTemplateDetections["unavailable-legacy-scan"],
@@ -89658,6 +89678,7 @@ async function technicalAeoRoutes(app, opts) {
89658
89678
  project: project.name,
89659
89679
  hasCrawlData: true,
89660
89680
  runId: snapshot.runId,
89681
+ ...completenessOf(snapshot),
89661
89682
  total: 0,
89662
89683
  nextCursor: null,
89663
89684
  templateDetection,
@@ -89686,6 +89707,7 @@ async function technicalAeoRoutes(app, opts) {
89686
89707
  project: project.name,
89687
89708
  hasCrawlData: true,
89688
89709
  runId: snapshot.runId,
89710
+ ...completenessOf(snapshot),
89689
89711
  total,
89690
89712
  nextCursor: nextOffset < total ? encodeCursor2(nextOffset) : null,
89691
89713
  templateDetection,
@@ -89706,6 +89728,7 @@ async function technicalAeoRoutes(app, opts) {
89706
89728
  project: project.name,
89707
89729
  hasCrawlData: false,
89708
89730
  runId: null,
89731
+ ...NO_CRAWL_COMPLETENESS,
89709
89732
  nodeKey: request.query.nodeKey ?? null,
89710
89733
  url: request.query.url ?? null,
89711
89734
  templateDetection: SiteHealthTemplateDetections["unavailable-legacy-scan"],
@@ -89723,6 +89746,7 @@ async function technicalAeoRoutes(app, opts) {
89723
89746
  project: project.name,
89724
89747
  hasCrawlData: true,
89725
89748
  runId: snapshot.runId,
89749
+ ...completenessOf(snapshot),
89726
89750
  nodeKey: request.query.nodeKey ?? null,
89727
89751
  url: request.query.url ?? null,
89728
89752
  templateDetection,
@@ -89749,6 +89773,7 @@ async function technicalAeoRoutes(app, opts) {
89749
89773
  project: project.name,
89750
89774
  hasCrawlData: true,
89751
89775
  runId: snapshot.runId,
89776
+ ...completenessOf(snapshot),
89752
89777
  nodeKey: request.query.nodeKey ?? null,
89753
89778
  url: request.query.url ?? null,
89754
89779
  templateDetection,