@ainyc/canonry 4.192.1 → 4.192.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/assets/agent-workspace/skills/canonry/SKILL.md +8 -1
  2. package/assets/assets/{AuditHistoryPanel-DvqnrQc_.js → AuditHistoryPanel-B5ujKofj.js} +1 -1
  3. package/assets/assets/{BacklinksPage-BCk2qBfC.js → BacklinksPage-DnJ7tbUQ.js} +1 -1
  4. package/assets/assets/{HistoryPage-IMlkx--Q.js → HistoryPage-uOpp9NS1.js} +1 -1
  5. package/assets/assets/MeasurementPropertyPage-R-EM27KG.js +1 -0
  6. package/assets/assets/ProjectPage-L4LCiofR.js +8 -0
  7. package/assets/assets/{RunRow-BherM7NU.js → RunRow-DzldP1Fv.js} +1 -1
  8. package/assets/assets/{RunsPage-B5G_OrmE.js → RunsPage-aAn7zPwn.js} +1 -1
  9. package/assets/assets/{SettingsPage-CMeCn5uk.js → SettingsPage-BdAhhAS6.js} +1 -1
  10. package/assets/assets/{SiteHealthSection-DZX1yv4k.js → SiteHealthSection-DOQWKbrE.js} +3 -3
  11. package/assets/assets/{TrafficPage-BV-HOztp.js → TrafficPage-BARq38mK.js} +1 -1
  12. package/assets/assets/{TrafficSourceDetailPage-9IN0q7bd.js → TrafficSourceDetailPage-DRhuS7fH.js} +1 -1
  13. package/assets/assets/{extract-error-message-c7zJp5uX.js → extract-error-message-DX4eQGO9.js} +1 -1
  14. package/assets/assets/index-CjEprBri.css +1 -0
  15. package/assets/assets/{index-D3KGn0S0.js → index-zF9YNhaN.js} +25 -25
  16. package/assets/assets/{react-sigma_core.esm.min-DxHkjhKC.js → react-sigma_core.esm.min-CcZJvxeL.js} +1 -1
  17. package/assets/assets/v2-overview-adapter-Jh4TgRVR.js +1 -0
  18. package/assets/index.html +2 -2
  19. package/dist/{chunk-T6GRXUOE.js → chunk-7773NNZY.js} +23 -1
  20. package/dist/{chunk-T4OO575U.js → chunk-ISDE2PZC.js} +4 -4
  21. package/dist/{chunk-QRNKMGVD.js → chunk-JXMRYJR5.js} +19 -0
  22. package/dist/{chunk-S5QNBQ72.js → chunk-KWUKYRS5.js} +2 -2
  23. package/dist/{chunk-V4ZLHKOG.js → chunk-ZGAVPLNP.js} +5 -5
  24. package/dist/cli.js +5 -5
  25. package/dist/index.js +4 -4
  26. package/dist/{intelligence-service-QYRQHSJH.js → intelligence-service-TJN37R37.js} +2 -2
  27. package/dist/mcp.js +3 -3
  28. package/package.json +10 -10
  29. package/assets/assets/MeasurementPropertyPage-1o1e5vmH.js +0 -1
  30. package/assets/assets/ProjectPage-BusVoYaC.js +0 -8
  31. package/assets/assets/index-BtTEcbcB.css +0 -1
  32. package/assets/assets/v2-overview-adapter-COMP5UGt.js +0 -1
@@ -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-DZX1yv4k.js";import"./index-D3KGn0S0.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-CW2qe0uH.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.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-DOQWKbrE.js";import"./index-zF9YNhaN.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-CW2qe0uH.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.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
@@ -0,0 +1 @@
1
+ import{j as o,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{y as M,B as A}from"./index-zF9YNhaN.js";import{M as $}from"./vendor-markdown-B-Oq2NYq.js";const H="Sources",y={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function N({headingLevel:e}){return n=>{const r=[],s=i=>{i.type==="heading"&&i.depth&&r.push(i),i.children?.forEach(s)};s(n);const l=r.reduce((i,u)=>Math.min(i,u.depth),6);for(const i of r){const u=i.depth-l;i.depth=Math.min(6,e+u),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":u+1}}}}}function R({answer:e}){const[n,r]=C.useState("idle"),s=C.useRef(!1),l=async()=>{if(!s.current){s.current=!0,r("copying");try{await navigator.clipboard.writeText(e),r("copied")}catch{r("failed")}finally{s.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(A,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":n==="copying","aria-busy":n==="copying",onClick:()=>{l()},children:n==="copying"?y.copying:y.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:n==="copied"?y.copied:n==="failed"?y.failed:""})]})}function L({children:e,headingLevel:n=4,copyable:r=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx($,{remarkPlugins:[[N,{headingLevel:n}]],components:{p:({children:s})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:s}),ul:({children:s})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:s}),ol:({children:s,start:l})=>o.jsx("ol",{start:l,className:"mb-3 ml-5 list-decimal space-y-1",children:s}),pre:({children:s})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:s}),a:({children:s,href:l})=>{const i=M(l);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:s}):o.jsx("span",{children:s})},img:({alt:s})=>o.jsx("span",{children:s})},children:e}),r&&e.trim()?o.jsx(R,{answer:e},e):null]})}function F(e){const n=e[0];return n?e.every(r=>r.mode===n.mode&&r.scope.kind===n.scope.kind&&r.scope.key===n.scope.key&&r.queryClass===n.queryClass&&r.measurement.displayedRunId===n.measurement.displayedRunId):!0}function p(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}}function I(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function T(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function _(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function k(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function j(e,n,r){const s=new Map;if(!n)return s;const l=new Map(e.usageEdges.map(a=>[k(a),a.targetKey])),i=new Map(e.assignments.map(a=>[`${a.targetKey}:${a.queryId}`,a.queryClass])),u=new Map(e.usageEdges.map(a=>[k(a),i.get(`${a.targetKey}:${a.queryId}`)]));for(const a of n.evidence){if(r&&u.get(a.usageEdgeId)!==r)continue;const c=l.get(a.usageEdgeId);if(!c)continue;const m=s.get(c)??[];m.push({id:`${a.observationId}:${a.expectedSlotId}:${a.usageEdgeId}:${a.sourceUrl}`,kind:T(a.classification),query:a.queryText,provider:a.provider,location:a.location,url:a.sourceUrl,tone:_(a.classification),historical:a.historical||a.bridged}),s.set(c,m)}return s}function B(e){if(e.flags>0)return{label:"Review",tone:"caution"};const n=[e.mentionCoverage,e.citationCoverage].filter(r=>r.state==="unavailable").map(r=>r.reason);return n.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:n.includes("plan_v1")?{label:"Update setup",tone:"caution"}:n.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:n.includes("no_population")?{label:"No queries",tone:"neutral"}:n.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function O(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 U(e){if(!e)return"";const n=new Date(e);return Number.isFinite(n.getTime())?n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function q(e){const n=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${n} flagged ${n===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 W({overview:e,activePlan:n,report:r,reportState:s=r?"ready":"loading",sort:l}){if(n.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 i=n.plan,u=new Map(i.targets.map(t=>[t.stableKey,t])),a=new Map(i.querySnapshots.map(t=>[t.queryId,t.queryText])),c=new Map;for(const t of i.assignments){if(e.queryClass!=="all"&&t.queryClass!==e.queryClass)continue;const d=a.get(t.queryId);if(!d)continue;const g=c.get(t.targetKey)??new Set;g.add(d),c.set(t.targetKey,g)}const m=r?.revision===n.revision&&r.run?.id===e.measurement.displayedRunId?r:null,K=e.measurement.displayedRunId===void 0||m?"ready":s==="error"||r!=null?"error":"loading",S=j(i,m,e.queryClass==="all"?void 0:e.queryClass),h=new Map;for(const t of i.groups)for(const d of t.targetKeys)h.has(d)||h.set(d,t.label);const x=e.properties.items.map(t=>{const d=u.get(t.targetKey),g=S.get(t.targetKey)??[];return{id:t.targetKey,name:t.label,mentionCoverage:p(t.mentionCoverage),citationCoverage:p(t.citationCoverage),status:B(t),providers:t.providers?.map(f=>({provider:f.provider,mentionCoverage:p(f.mentionCoverage),citationCoverage:p(f.citationCoverage)})),market:h.get(t.targetKey),assignedQueries:[...c.get(t.targetKey)??[]],urls:d?.urlMatchers.map(I)??[],evidence:g,evidenceState:K,historical:g.some(f=>f.historical)}}),b=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),E=e.properties.items.flatMap(t=>t.flags>0?[{id:`property:${t.targetKey}`,property:t.label,summary:`${t.flags} ${t.flags===1?"result needs":"results need"} review.`,tone:"caution",count:t.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:O(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:U(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:p(e.metrics.propertiesMentioned),mentionCoverage:p(e.metrics.mentionCoverage),citationCoverage:p(e.metrics.citationCoverage)},properties:x,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...l?{sort:l}:{}},availableGroups:i.groups.map(t=>({id:t.stableKey,label:t.label})),...q(e)?{nextActionText:q(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:E}}export{L as A,H as a,F as b,W as c,I as m};
package/assets/index.html CHANGED
@@ -12,14 +12,14 @@
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-D3KGn0S0.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-zF9YNhaN.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-D-cUuLZo.js">
19
19
  <link rel="modulepreload" crossorigin href="./assets/vendor-lucide-CW2qe0uH.js">
20
20
  <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-B-Oq2NYq.js">
21
21
  <link rel="modulepreload" crossorigin href="./assets/vendor-yaml-GWJz5H2G.js">
22
- <link rel="stylesheet" crossorigin href="./assets/index-BtTEcbcB.css">
22
+ <link rel="stylesheet" crossorigin href="./assets/index-CjEprBri.css">
23
23
  </head>
24
24
  <body>
25
25
  <div id="root"></div>
@@ -689,7 +689,7 @@ import {
689
689
  wordpressSchemaDeployResultDtoSchema,
690
690
  wordpressSchemaStatusResultDtoSchema,
691
691
  wordpressStatusDtoSchema
692
- } from "./chunk-QRNKMGVD.js";
692
+ } from "./chunk-JXMRYJR5.js";
693
693
 
694
694
  // src/intelligence-service.ts
695
695
  import { eq as eq67, desc as desc29, asc as asc12, and as and57, ne as ne10, or as or15, inArray as inArray25, gte as gte18, lte as lte15, isNull as isNull12, sql as sql26, exists } from "drizzle-orm";
@@ -21731,6 +21731,26 @@ function compareWeakestMarket(a, b) {
21731
21731
  }
21732
21732
  return compareText13(a.label, b.label) || compareText13(a.groupKey, b.groupKey);
21733
21733
  }
21734
+ function mentionRanking(rows, limit) {
21735
+ const eligible = [];
21736
+ const excluded = [];
21737
+ for (const { targetKey, label, mentionCoverage, citationCoverage } of rows) {
21738
+ if (mentionCoverage.state === "unavailable") {
21739
+ excluded.push({ targetKey, label, reason: mentionCoverage.reason });
21740
+ } else {
21741
+ eligible.push({ targetKey, label, mentionCoverage, citationCoverage });
21742
+ }
21743
+ }
21744
+ const byLabel = (a, b) => compareText13(a.label, b.label) || compareText13(a.targetKey, b.targetKey);
21745
+ const byRate = (direction) => (a, b) => direction * (a.mentionCoverage.value - b.mentionCoverage.value) || byLabel(a, b);
21746
+ return {
21747
+ eligiblePropertyCount: eligible.length,
21748
+ strongest: [...eligible].sort(byRate(-1)).slice(0, limit),
21749
+ weakest: eligible.sort(byRate(1)).slice(0, limit),
21750
+ excluded: excluded.sort(byLabel),
21751
+ truncated: eligible.length > limit
21752
+ };
21753
+ }
21734
21754
  function portfolioResponse(db, active, plan, query) {
21735
21755
  const group = query.groupKey === void 0 ? void 0 : requireGroup2(plan, query.groupKey);
21736
21756
  const run = selectMeasurementQuestionRun(db, active.version.projectId, active, query.runId);
@@ -21764,6 +21784,7 @@ function portfolioResponse(db, active, plan, query) {
21764
21784
  citationCoverage: unavailable3("no_completed_run")
21765
21785
  },
21766
21786
  weakestProperties: rows2.slice(0, limit2),
21787
+ mentionRanking: mentionRanking(rows2, limit2),
21767
21788
  // Sorted through the same comparator as the measured branch. Plan order
21768
21789
  // is `stableKey`, so emitting it raw put markets in an order the schema
21769
21790
  // documents as worst-first and that changes the moment a run lands.
@@ -21815,6 +21836,7 @@ function portfolioResponse(db, active, plan, query) {
21815
21836
  citationCoverage: coverageMetric2(overview.citationCoverage)
21816
21837
  },
21817
21838
  weakestProperties: rows.slice(0, limit),
21839
+ mentionRanking: mentionRanking(ranked, limit),
21818
21840
  markets: marketRollup(plan, run, evaluator, group !== void 0),
21819
21841
  totalProperties: ranked.length,
21820
21842
  truncated: ranked.length > limit
@@ -14,7 +14,7 @@ import {
14
14
  loadConfig,
15
15
  loadConfigRaw,
16
16
  saveConfigPatch
17
- } from "./chunk-V4ZLHKOG.js";
17
+ } from "./chunk-ZGAVPLNP.js";
18
18
  import {
19
19
  CC_CACHE_DIR,
20
20
  DUCKDB_SPEC,
@@ -162,7 +162,7 @@ import {
162
162
  siteCrawlSnapshots,
163
163
  toAlertView,
164
164
  usageCounters
165
- } from "./chunk-T6GRXUOE.js";
165
+ } from "./chunk-7773NNZY.js";
166
166
  import {
167
167
  AGENT_MEMORY_VALUE_MAX_BYTES,
168
168
  AGENT_PROVIDER_IDS,
@@ -305,7 +305,7 @@ import {
305
305
  validationError,
306
306
  winnabilityClassLabel,
307
307
  withRetry
308
- } from "./chunk-QRNKMGVD.js";
308
+ } from "./chunk-JXMRYJR5.js";
309
309
 
310
310
  // src/telemetry.ts
311
311
  import crypto from "crypto";
@@ -12041,7 +12041,7 @@ function readStoredGroundingSources(rawResponse) {
12041
12041
  return result;
12042
12042
  }
12043
12043
  async function backfillInsightsCommand(project, opts) {
12044
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-QYRQHSJH.js");
12044
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-TJN37R37.js");
12045
12045
  const config = loadConfig();
12046
12046
  const db = createClient(config.database);
12047
12047
  migrate(db);
@@ -7023,6 +7023,23 @@ var measurementPortfolioMarketSchema = z18.object({
7023
7023
  mentionCoverage: measurementMetricValueSchema,
7024
7024
  citationCoverage: measurementMetricValueSchema
7025
7025
  }).strict();
7026
+ var measurementPortfolioMentionRankingSchema = z18.object({
7027
+ eligiblePropertyCount: measurementDemoCountSchema,
7028
+ strongest: z18.array(measurementDemoPropertySchema.extend({
7029
+ mentionCoverage: measurementMetricValueSchema.options[0],
7030
+ citationCoverage: measurementMetricValueSchema
7031
+ }).strict()).max(50),
7032
+ weakest: z18.array(measurementDemoPropertySchema.extend({
7033
+ mentionCoverage: measurementMetricValueSchema.options[0],
7034
+ citationCoverage: measurementMetricValueSchema
7035
+ }).strict()).max(50),
7036
+ /** All excluded Properties in this scope, independent of the ranked list limit. */
7037
+ excluded: z18.array(measurementDemoPropertySchema.extend({
7038
+ reason: measurementMetricUnavailableReasonSchema
7039
+ }).strict()),
7040
+ /** Each ranked list is limited; tied rates use stable label/key order. */
7041
+ truncated: z18.boolean()
7042
+ }).strict();
7026
7043
  var measurementPortfolioSummaryResponseSchema = z18.object({
7027
7044
  /** A null group key means no named reporting group; spot checks may still narrow the effective Property set. */
7028
7045
  portfolio: z18.object({
@@ -7038,6 +7055,8 @@ var measurementPortfolioSummaryResponseSchema = z18.object({
7038
7055
  citationCoverage: measurementMetricValueSchema
7039
7056
  }).strict(),
7040
7057
  weakestProperties: z18.array(measurementPortfolioWeakestPropertySchema),
7058
+ /** Descriptive mention ranking, using the response queryClass and scope; aggregate unavailability does not invalidate it. */
7059
+ mentionRanking: measurementPortfolioMentionRankingSchema,
7041
7060
  /**
7042
7061
  * Every named market, worst-first. Empty when the request already narrowed to
7043
7062
  * one group (a roll-up would only restate the scope) and when the plan defines
@@ -5,11 +5,11 @@ import {
5
5
  installSkills,
6
6
  loadConfigRaw,
7
7
  saveConfigPatch
8
- } from "./chunk-V4ZLHKOG.js";
8
+ } from "./chunk-ZGAVPLNP.js";
9
9
  import {
10
10
  SKILL_MANIFEST_FILENAME,
11
11
  SkillsClients
12
- } from "./chunk-QRNKMGVD.js";
12
+ } from "./chunk-JXMRYJR5.js";
13
13
 
14
14
  // src/skills-autosync.ts
15
15
  import fs from "fs";
@@ -104,7 +104,7 @@ import {
104
104
  trafficEventKindSchema,
105
105
  trafficSeriesGranularitySchema,
106
106
  visibilityReportRequestSchema
107
- } from "./chunk-QRNKMGVD.js";
107
+ } from "./chunk-JXMRYJR5.js";
108
108
 
109
109
  // src/cli-error.ts
110
110
  function isMachineFormat(format) {
@@ -8988,7 +8988,7 @@ var measurementOverviewInputSchema = z4.object({
8988
8988
  scope: measurementOverviewQuerySchema.shape.scope.describe("Read all Properties, one reporting group, or one Property."),
8989
8989
  groupKey: measurementOverviewQuerySchema.shape.groupKey.describe("Group stable key. Required only for group scope."),
8990
8990
  targetKey: measurementOverviewQuerySchema.shape.targetKey.describe("Property stable key. Required only for property scope."),
8991
- queryClass: measurementOverviewQuerySchema.shape.queryClass,
8991
+ queryClass: measurementOverviewQuerySchema.shape.queryClass.describe("Select non-brand for acquisition performance or branded for brand awareness. Omitted means all classes combined; always name the class in the report."),
8992
8992
  provider: measurementOverviewQuerySchema.shape.provider,
8993
8993
  location: measurementOverviewQuerySchema.shape.location,
8994
8994
  from: measurementOverviewQuerySchema.shape.from,
@@ -11016,7 +11016,7 @@ var canonryMcpTools = [
11016
11016
  defineTool({
11017
11017
  name: "canonry_measurement_overview",
11018
11018
  title: "Get Advanced Measurement overview",
11019
- description: "Return stored, revision-pinned Advanced Measurement metrics and a bounded page of Property rows for all Properties, one reporting group, or one Property. Filter by query class, provider, location, date window, run, or Property search; search filters rows without changing metric denominators. It ranks one run snapshot only and never infers a trend or compares across revisions. Choose label-asc (default), label-desc, citationCoverage-asc/desc, or mentionCoverage-asc/desc. For a coverage sort, unavailable rows form the first bucket in either direction; available rows then follow the requested numeric direction. The cursor is sort-aware, pins pagination to the active revision, displayed run, evidence snapshot, and filters even if a newer run completes, and must be reused unchanged with the same sort and filters. Legacy label cursors work only when sort is omitted, while any explicit sort needs a new sort-bound cursor. It never starts provider work or incurs provider cost; page size is at most 100, and it refuses invalid scope keys, cursor combinations, appended evidence, or a run pinned to another revision.",
11019
+ description: "For best/worst Property mention rankings, prefer canonry_measurement_portfolio_summary and its mentionRanking. An unavailable aggregate does not invalidate available Property metrics. Return stored, revision-pinned Advanced Measurement metrics and a bounded page of Property rows for all Properties, one reporting group, or one Property. Filter by query class, provider, location, date window, run, or Property search; search filters rows without changing metric denominators. It ranks one run snapshot only and never infers a trend or compares across revisions. Choose label-asc (default), label-desc, citationCoverage-asc/desc, or mentionCoverage-asc/desc. For a coverage sort, unavailable rows form the first bucket in either direction; available rows then follow the requested numeric direction. The cursor is sort-aware, pins pagination to the active revision, displayed run, evidence snapshot, and filters even if a newer run completes, and must be reused unchanged with the same sort and filters. Legacy label cursors work only when sort is omitted, while any explicit sort needs a new sort-bound cursor. It never starts provider work or incurs provider cost; page size is at most 100, and it refuses invalid scope keys, cursor combinations, appended evidence, or a run pinned to another revision.",
11020
11020
  access: "read",
11021
11021
  tier: "setup",
11022
11022
  inputSchema: measurementOverviewInputSchema,
@@ -11044,7 +11044,7 @@ var canonryMcpTools = [
11044
11044
  defineTool({
11045
11045
  name: "canonry_measurement_portfolio_summary",
11046
11046
  title: "Summarize measured Properties",
11047
- description: "Start here to rank the weakest measured Properties and their stored replacement names, and to compare every named market worst-first. Each market is scoped to the displayed run; markets may share Properties, so they never sum to the portfolio totals. Reads stored data only; it never starts provider work.",
11047
+ description: "Start here for best/worst Property mention performance. Defaults to non-brand questions; state the returned queryClass and keep branded comparisons separate unless all was requested. mentionRanking.strongest and .weakest rank every Property with an available mention rate before applying limit, independently of citation availability or an unavailable portfolio aggregate. mentionRanking.excluded names every excluded Property and its reason; flag those separately, never call all mention rankings unavailable because one identity is ambiguous. Report numerator/denominator with each rate. Rates may tie (stable label/key order); this is descriptive coverage, not a confidence-adjusted or unique-winner claim. weakestProperties retains combined mention/citation weaknesses with stored replacement names; markets compares every named market worst-first. Each market is scoped to the displayed run; markets may share Properties, so they never sum to portfolio totals. Reads stored data only; it never starts provider work.",
11048
11048
  access: "read",
11049
11049
  tier: "monitoring",
11050
11050
  inputSchema: measurementPortfolioSummaryInputSchema,
@@ -12780,7 +12780,7 @@ var OPERATIONS_GUIDE = {
12780
12780
  "guidance": "Read the stored report for the selected project and period. Retain evidence dates, scope, sample sizes, missing data, and separate mention/citation signals; do not generate fresh runs implicitly."
12781
12781
  }
12782
12782
  },
12783
- "markdown": "# Canonry Operations Guide v1\n\nCanonry is an agent-first AI visibility platform. MCP is the universal entry\npoint for connected agents. Host-native skills are optional upgrades, not a\nprerequisite or a permission mechanism.\n\n## Connect and choose a route\n\nRead the initialization guidance, then call `canonry_help` with an `intent`:\n`status`, `diagnose`, `measurement`, `integrations`, `reports`, or a short task\ndescription. Select an accessible project with `canonry_projects_list` before\nusing its exact name in project tools. Inspect each listed tool's input schema;\nhelp suggests tool names, not invented arguments or authorization.\n\nHelp returns a versioned, compact route: connection `mode`, available `next`\ntools, workflow guidance, approval boundaries, and this guide's URL. It performs\nno provider calls, reads no project data, and changes no permissions.\n`includeCatalog: true` additionally returns toolkit details when needed.\n\nHosted connections use a fixed catalog. Help only suggests tools offered by that\nconnection; it never tells a hosted agent to dynamically load a toolkit. A\nprogressive local stdio connection may return `loadToolkits`: call\n`canonry_load_toolkit` with one returned name, await it, then call help again.\nLoading only changes local tool discovery, never server authority.\n\nThe optional `canonry://agent-operations/v1` MCP resource contains this same\nguide. If the host cannot read resources or open links, continue through help.\nDo not install a plugin, local runtime, or skill merely to use connected MCP.\nAn installed Codex or Claude Canonry skill contains a generated copy of this\nguide plus links to host-native references. It does not replace runtime help.\n\n## Vocabulary and evidence\n\n- **Mentioned** means the brand appears in answer text. **Cited** means its\n domain appears in source links. Either, both, or neither can occur; never\n compute one signal from the other.\n- `answerMentioned: null` means not checked, not false. Missing runs and empty\n populations mean no measurement, not zero visibility.\n- Preserve project, time window, provider, requested/served model, location,\n sample size, and query class when comparing evidence. Use server-returned\n metrics; do not invent a score from incompatible populations.\n- Simple projects and Advanced portfolios share the workflow. For Advanced\n results, preserve Property, Target, market, plan revision, and class scope.\n Groups organize navigation; do not infer an unrequested fan-out.\n- Research is isolated evidence, not tracked measurement. A probe still spends\n quota and persists evidence but is excluded from normal tracking metrics.\n\n## Workflows\n\n**Status:** read the stored overview and freshness first. Say when evidence is\nmissing instead of silently creating it.\n\n**Diagnose:** inspect stored history and comparable evidence. Explain what\nchanged separately from why it might have changed. A hypothesis is not a\nmeasured cause. Propose bounded verification if stored evidence is insufficient.\n\n**Measurement:** inspect the existing setup and results before proposing edits.\nKeep research, query tracking, plan publication, and sweep execution separate.\nFor direct research, submit the final editable query text in one context. For a\nreviewed batch, submit each explicit destination with its final text and one\nidempotency key. Pattern substitution happens in the client before either\nrequest; choosing a market or Property records a destination only and never\nrewrites a query or creates an automatic fan-out. `research.run` does not\nauthorize saving patterns, changing tracking, publishing plans, or settings.\nUse a supported preview where available, inspect its exact destination and\nrevision, then seek approval for the actual change. A preview may itself require\nwrite permission; never treat a dry-run flag as a universal safety guarantee.\n\n**Integrations:** inspect stored connection state and snapshot freshness first.\nProvider configuration evidence does not prove a browser event fired or a\nconversion was recorded. Connection, resource selection, refresh/sync, and live\nreads are separate actions. Credentials belong in the operator's secure setup\nflow, never in chat, tool arguments, reports, or public guidance.\n\n**Reports:** use saved evidence for the requested period and scope. Keep mention\nand citation signals separate, include dates and sample sizes, and state missing\nor stale inputs. Preparing a report does not authorize new measurement.\n\n## Authority and approval\n\nStart with stored evidence. Before a live provider read, sweep, probe, research\nrun, sync, write, or externally visible action, obtain approval covering its\nexact target, action, and bounded work. Approval already given for that exact\noperation need not be asked for again, but does not extend to more projects,\nlarger batches, retries with new identities, or recurring work.\n\nHTTP GET and MCP `readOnlyHint` describe aspects of an operation, not its cost\nor permission. Provider discovery, account reads, and live diagnostics may\nconsume quota even when labeled read-only. If the tool's effect is unclear,\ninspect its description and request direction before calling it.\n\nAuthentication, role/scope checks, project restrictions, quotas, and guarded\napproval receipts are enforced by the server. Help, skills, resources, and tool\nvisibility cannot grant authority. Never change credentials, endpoints, or\nproject identifiers to work around a missing tool or a `403` response.\n\nFor guarded ads writes, inspect unresolved operation receipts before retrying.\nUse the receipt's supported recovery action; do not replay a mutation under a\nnew identity. An executor cannot create or widen its own human approval grant.\nOn ambiguous results, exhausted bounds, or refusal, stop and report what is\nknown and what permission or operator action is needed.\n\n## Version and source\n\nThis public, versioned document is the source for initialization guidance,\nintent routes, the optional resource, and generated Canonry `SKILL.md` files.\nGuide v1 may receive compatible clarifications; incompatible routing contracts\nrequire a new guide version. The running server's help describes its actual\ncatalog and remains usable without fetching this document.\n"
12783
+ "markdown": "# Canonry Operations Guide v1\n\nCanonry is an agent-first AI visibility platform. MCP is the universal entry\npoint for connected agents. Host-native skills are optional upgrades, not a\nprerequisite or a permission mechanism.\n\n## Connect and choose a route\n\nRead the initialization guidance, then call `canonry_help` with an `intent`:\n`status`, `diagnose`, `measurement`, `integrations`, `reports`, or a short task\ndescription. Select an accessible project with `canonry_projects_list` before\nusing its exact name in project tools. Inspect each listed tool's input schema;\nhelp suggests tool names, not invented arguments or authorization.\n\nHelp returns a versioned, compact route: connection `mode`, available `next`\ntools, workflow guidance, approval boundaries, and this guide's URL. It performs\nno provider calls, reads no project data, and changes no permissions.\n`includeCatalog: true` additionally returns toolkit details when needed.\n\nHosted connections use a fixed catalog. Help only suggests tools offered by that\nconnection; it never tells a hosted agent to dynamically load a toolkit. A\nprogressive local stdio connection may return `loadToolkits`: call\n`canonry_load_toolkit` with one returned name, await it, then call help again.\nLoading only changes local tool discovery, never server authority.\n\nThe optional `canonry://agent-operations/v1` MCP resource contains this same\nguide. If the host cannot read resources or open links, continue through help.\nDo not install a plugin, local runtime, or skill merely to use connected MCP.\nAn installed Codex or Claude Canonry skill contains a generated copy of this\nguide plus links to host-native references. It does not replace runtime help.\n\n## Vocabulary and evidence\n\n- **Mentioned** means the brand appears in answer text. **Cited** means its\n domain appears in source links. Either, both, or neither can occur; never\n compute one signal from the other.\n- `answerMentioned: null` means not checked, not false. Missing runs and empty\n populations mean no measurement, not zero visibility.\n- Preserve project, time window, provider, requested/served model, location,\n sample size, and query class when comparing evidence. Use server-returned\n metrics; do not invent a score from incompatible populations.\n- Simple projects and Advanced portfolios share the workflow. For Advanced\n results, preserve Property, Target, market, plan revision, and class scope.\n Groups organize navigation; do not infer an unrequested fan-out.\n- Research is isolated evidence, not tracked measurement. A probe still spends\n quota and persists evidence but is excluded from normal tracking metrics.\n\n## Workflows\n\n**Status:** read the stored overview and freshness first. Say when evidence is\nmissing instead of silently creating it.\n\n**Diagnose:** inspect stored history and comparable evidence. Explain what\nchanged separately from why it might have changed. A hypothesis is not a\nmeasured cause. Propose bounded verification if stored evidence is insufficient.\n\n**Measurement:** inspect the existing setup and results before proposing edits.\nKeep research, query tracking, plan publication, and sweep execution separate.\nFor direct research, submit the final editable query text in one context. For a\nreviewed batch, submit each explicit destination with its final text and one\nidempotency key. Pattern substitution happens in the client before either\nrequest; choosing a market or Property records a destination only and never\nrewrites a query or creates an automatic fan-out. `research.run` does not\nauthorize saving patterns, changing tracking, publishing plans, or settings.\nUse a supported preview where available, inspect its exact destination and\nrevision, then seek approval for the actual change. A preview may itself require\nwrite permission; never treat a dry-run flag as a universal safety guarantee.\n\n**Integrations:** inspect stored connection state and snapshot freshness first.\nProvider configuration evidence does not prove a browser event fired or a\nconversion was recorded. Connection, resource selection, refresh/sync, and live\nreads are separate actions. Credentials belong in the operator's secure setup\nflow, never in chat, tool arguments, reports, or public guidance.\n\n**Reports:** use saved evidence for the requested period and scope. Keep mention\nand citation signals separate, include dates and sample sizes, and state missing\nor stale inputs. For Advanced Property mention rankings, use\n`canonry_measurement_portfolio_summary` and its `mentionRanking.strongest`,\n`.weakest`, and `.excluded` lists. It defaults to non-brand questions; state the\nreturned class and report branded results separately. An unavailable portfolio\naggregate does not invalidate available Property mention rates. Flag excluded\nProperties individually; do not silently replace mention ranking with citation\nranking. Keep sample sizes and ties visible. Preparing a report does not\nauthorize new measurement.\n\n## Authority and approval\n\nStart with stored evidence. Before a live provider read, sweep, probe, research\nrun, sync, write, or externally visible action, obtain approval covering its\nexact target, action, and bounded work. Approval already given for that exact\noperation need not be asked for again, but does not extend to more projects,\nlarger batches, retries with new identities, or recurring work.\n\nHTTP GET and MCP `readOnlyHint` describe aspects of an operation, not its cost\nor permission. Provider discovery, account reads, and live diagnostics may\nconsume quota even when labeled read-only. If the tool's effect is unclear,\ninspect its description and request direction before calling it.\n\nAuthentication, role/scope checks, project restrictions, quotas, and guarded\napproval receipts are enforced by the server. Help, skills, resources, and tool\nvisibility cannot grant authority. Never change credentials, endpoints, or\nproject identifiers to work around a missing tool or a `403` response.\n\nFor guarded ads writes, inspect unresolved operation receipts before retrying.\nUse the receipt's supported recovery action; do not replay a mutation under a\nnew identity. An executor cannot create or widen its own human approval grant.\nOn ambiguous results, exhausted bounds, or refusal, stop and report what is\nknown and what permission or operator action is needed.\n\n## Version and source\n\nThis public, versioned document is the source for initialization guidance,\nintent routes, the optional resource, and generated Canonry `SKILL.md` files.\nGuide v1 may receive compatible clarifications; incompatible routing contracts\nrequire a new guide version. The running server's help describes its actual\ncatalog and remains usable without fetching this document.\n"
12784
12784
  };
12785
12785
 
12786
12786
  // src/mcp/operations-guide.ts
package/dist/cli.js CHANGED
@@ -28,11 +28,11 @@ import {
28
28
  trackCliCommandFinished,
29
29
  trackEvent,
30
30
  waitForServerRuntimeStartup
31
- } from "./chunk-T4OO575U.js";
31
+ } from "./chunk-ISDE2PZC.js";
32
32
  import {
33
33
  autoSyncSkills,
34
34
  formatAutoSyncNotice
35
- } from "./chunk-S5QNBQ72.js";
35
+ } from "./chunk-KWUKYRS5.js";
36
36
  import {
37
37
  CliError,
38
38
  EXIT_SYSTEM_ERROR,
@@ -58,7 +58,7 @@ import {
58
58
  saveConfigPatch,
59
59
  systemError,
60
60
  usageError
61
- } from "./chunk-V4ZLHKOG.js";
61
+ } from "./chunk-ZGAVPLNP.js";
62
62
  import {
63
63
  CLOUDFLARE_WORKER_BINDINGS,
64
64
  CLOUDFLARE_WORKER_GENERATED_MARKER,
@@ -72,7 +72,7 @@ import {
72
72
  projects,
73
73
  queries,
74
74
  renderReportHtml
75
- } from "./chunk-T6GRXUOE.js";
75
+ } from "./chunk-7773NNZY.js";
76
76
  import {
77
77
  AdsDeliverySnapshotStatuses,
78
78
  AdsHistoricalCampaignRollupStatuses,
@@ -148,7 +148,7 @@ import {
148
148
  shareOfVoiceReason,
149
149
  visibilityReportRequestSchema,
150
150
  winnabilityClassSchema
151
- } from "./chunk-QRNKMGVD.js";
151
+ } from "./chunk-JXMRYJR5.js";
152
152
 
153
153
  // src/cli.ts
154
154
  import { pathToFileURL } from "url";
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-T4OO575U.js";
6
+ } from "./chunk-ISDE2PZC.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-V4ZLHKOG.js";
10
- import "./chunk-T6GRXUOE.js";
11
- import "./chunk-QRNKMGVD.js";
9
+ } from "./chunk-ZGAVPLNP.js";
10
+ import "./chunk-7773NNZY.js";
11
+ import "./chunk-JXMRYJR5.js";
12
12
  export {
13
13
  GoogleMarketingRuntimeError,
14
14
  createGoogleMarketingCredentialStore,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-T6GRXUOE.js";
4
- import "./chunk-QRNKMGVD.js";
3
+ } from "./chunk-7773NNZY.js";
4
+ import "./chunk-JXMRYJR5.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-S5QNBQ72.js";
3
+ } from "./chunk-KWUKYRS5.js";
4
4
  import {
5
5
  createApiClient,
6
6
  createCanonryMcpServer
7
- } from "./chunk-V4ZLHKOG.js";
7
+ } from "./chunk-ZGAVPLNP.js";
8
8
  import {
9
9
  isReadOnlyKey
10
- } from "./chunk-QRNKMGVD.js";
10
+ } from "./chunk-JXMRYJR5.js";
11
11
 
12
12
  // src/mcp/cli.ts
13
13
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.192.1",
3
+ "version": "4.192.3",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "license": "FSL-1.1-ALv2",
@@ -71,31 +71,31 @@
71
71
  "tsup": "^8.5.1",
72
72
  "tsx": "^4.19.0",
73
73
  "@ainyc/canonry-web": "0.0.0",
74
- "@ainyc/canonry-api-client": "0.0.0",
75
74
  "@ainyc/canonry-config": "0.0.0",
76
- "@ainyc/canonry-contracts": "0.0.0",
75
+ "@ainyc/canonry-api-client": "0.0.0",
77
76
  "@ainyc/canonry-api-routes": "0.0.0",
78
- "@ainyc/canonry-integration-bing": "0.0.0",
77
+ "@ainyc/canonry-contracts": "0.0.0",
79
78
  "@ainyc/canonry-db": "0.0.0",
79
+ "@ainyc/canonry-integration-bing": "0.0.0",
80
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
80
81
  "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
81
82
  "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
82
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
83
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
84
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
85
83
  "@ainyc/canonry-integration-google": "0.0.0",
84
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
86
85
  "@ainyc/canonry-integration-google-ads": "0.0.0",
86
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
87
87
  "@ainyc/canonry-integration-google-places": "0.0.0",
88
88
  "@ainyc/canonry-integration-google-tag-manager": "0.0.0",
89
89
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
90
- "@ainyc/canonry-integration-wordpress": "0.0.0",
91
90
  "@ainyc/canonry-integration-traffic": "0.0.0",
91
+ "@ainyc/canonry-integration-wordpress": "0.0.0",
92
92
  "@ainyc/canonry-intelligence": "0.0.0",
93
93
  "@ainyc/canonry-provider-cdp": "0.0.0",
94
94
  "@ainyc/canonry-provider-gemini": "0.0.0",
95
95
  "@ainyc/canonry-provider-claude": "0.0.0",
96
- "@ainyc/canonry-provider-openai": "0.0.0",
96
+ "@ainyc/canonry-provider-local": "0.0.0",
97
97
  "@ainyc/canonry-provider-perplexity": "0.0.0",
98
- "@ainyc/canonry-provider-local": "0.0.0"
98
+ "@ainyc/canonry-provider-openai": "0.0.0"
99
99
  },
100
100
  "scripts": {
101
101
  "build": "pnpm run build:cli && pnpm run build:web",
@@ -1 +0,0 @@
1
- import{D as le,r as w,u as E,C as de,j as e,L as A}from"./vendor-tanstack-ZXXkndVj.js";import{v as ce,cC as he,dM as me,i as L,dN as xe,cK as pe,cl as ue,B as j,T as N,aw as z,ax as D,I as P,dO as je,dP as ye,dQ as be}from"./index-D3KGn0S0.js";import{j as ve,o as ge}from"./ChartPrimitives-Bxa_vFmq.js";import{m as Ne}from"./v2-overview-adapter-COMP5UGt.js";import{I as fe}from"./vendor-lucide-CW2qe0uH.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";const W=50,h={branded:{headline:"When they know your name",technical:"Branded queries"},"non-brand":{headline:"When they don't",technical:"Non-brand queries"}},we={plan_v1:"Setup update required",no_completed_run:"No completed measurement yet",no_population:"No queries of this type are assigned",evidence_incomplete:"Source evidence is incomplete",not_applicable:"Not applicable for this Property"},H={complete:{label:"Measured",tone:"positive"},partial:{label:"Partly measured",tone:"caution"},running:{label:"Measuring now",tone:"neutral"},queued:{label:"Measurement queued",tone:"neutral"},failed:{label:"Measurement failed",tone:"negative"},not_measured:{label:"Not measured",tone:"neutral"}},G={assigned:{label:"Matches this Property",tone:"positive"},sibling:{label:"Matches another Property",tone:"caution"},ownedUnmapped:{label:"Site URL not in a Property",tone:"caution"},external:{label:"External URL",tone:"neutral"},ambiguous:{label:"Matches multiple Properties",tone:"caution"},invalid:{label:"Invalid URL",tone:"negative"}};function Pe(s){return[...s].sort((t,a)=>+(a.classification==="assigned")-+(t.classification==="assigned"))}function Ce(s){return`${s.expectedSlotId}:${s.usageEdgeId}`}function Ee({row:s}){return s.mentioned===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(N,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"No mention signal for this Property"})]}):e.jsx(N,{tone:s.mentioned?"positive":"neutral",children:s.mentioned?"Mentioned":"Not mentioned"})}const Le="—";function Me({row:s}){return s.cited===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(N,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"Sources were not fully captured"})]}):e.jsx(N,{tone:s.cited?"positive":"neutral",children:s.cited?"Cited":"Not cited"})}function Re({row:s}){return s.cited===null&&s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"The sources for this answer were not fully captured, so none can be shown."}):s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"This answer returned no source URLs at all."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsxs("caption",{className:"sr-only",children:["Source URLs for ",s.queryText]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Match"}),e.jsx("th",{children:"URL"})]})}),e.jsx("tbody",{children:Pe(s.sources).map(t=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(N,{tone:G[t.classification].tone,children:G[t.classification].label})}),e.jsx("td",{className:"break-all text-secondary",children:t.sourceUrl})]},t.sourceUrl))})]})})}function Se({project:s,targetKey:t,row:a}){const n=E({...be({client:L,path:{name:s},query:{targetKey:t,resultId:a.observationId}})});if(n.isPending)return e.jsx("p",{className:"py-2 text-sm text-secondary",role:"status","aria-live":"polite",children:"Loading the answer…"});if(n.isError)return e.jsx("p",{className:"py-2 text-sm text-secondary",role:"alert",children:"Could not load this answer."});const o=n.data?.answer;return o==null||o.trim()===""?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"This answer was measured, but its text was not stored."}):e.jsxs("div",{className:"py-2",children:[e.jsxs("h4",{className:"mb-1 text-xs font-medium tracking-wide text-muted uppercase",children:["What ",a.provider," answered"]}),e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-sm leading-relaxed text-secondary",children:o})]})}function k(s){return we[s.reason]??"Not measured"}function T({metric:s,emphasis:t=!1}){if(s.state==="unavailable")return e.jsxs("span",{className:"inline-flex flex-col gap-0.5",children:[e.jsx("span",{className:t?"text-lg font-semibold text-secondary":"text-sm font-medium text-secondary",children:"Not measured"}),e.jsx("span",{className:"text-sm text-secondary",children:k(s)})]});const a=`${Math.round(s.value*100)}%`,n=s.numerator===void 0||s.denominator===void 0?null:`${s.numerator} of ${s.denominator}`;return e.jsxs("span",{className:"inline-flex flex-col gap-0.5 tabular-nums",children:[e.jsx("span",{className:t?"text-lg font-semibold text-heading":"text-sm font-medium text-primary",children:a}),n?e.jsx("span",{className:"text-xs text-muted",children:n}):null]})}function Y(s,t,a){return je({client:L,path:{name:s},query:{scope:"property",targetKey:t,queryClass:a}})}function Z(s){return s?.properties.items.at(0)}function Ae({measuredAt:s,unmeasuredReason:t,queryClass:a}){const n=s===void 0?null:s===null?"No completed sweep yet":`Measured ${ve(ge(s))}`;return n===null&&t===void 0?null:e.jsxs("p",{className:"supporting-copy",children:[[n,t].filter(Boolean).join(" · "),n!==null&&t===void 0?` · ${h[a].technical.toLocaleLowerCase()} only`:""]})}function Te({project:s,groups:t}){return t.length===0?null:e.jsxs("section",{"aria-labelledby":"property-market",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitive comparison"}),e.jsxs("h2",{id:"property-market",className:"text-base font-semibold text-heading",children:["Measured at the market level",e.jsx(P,{text:"Competitors are attached to a market rather than to a single Property, because one building has nobody to be compared against. Share of voice and competitor pressure are reported for the market this Property sits in."})]})]}),e.jsx(j,{asChild:!0,type:"button",size:"sm",variant:"outline",children:e.jsx(A,{to:"/projects/$projectName",params:{projectName:s},children:"Open measurement overview"})})]}),e.jsx("ul",{className:"flex flex-wrap gap-2",children:t.map(a=>e.jsxs("li",{className:"rounded-md border border-default px-3 py-1.5 text-sm text-strong",children:[a.label,e.jsxs("span",{className:"ml-2 text-xs text-muted",children:[a.competitors.length," ",a.competitors.length===1?"competitor":"competitors"]})]},a.stableKey))})]})}function S({label:s,metric:t,failed:a=!1}){if(t===void 0)return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsx("p",{className:"aeo-hero-row-value text-base font-semibold text-secondary",children:a?"Unavailable":"…"}),a?e.jsx("div",{}):e.jsx("div",{className:"aeo-hero-row-bar","aria-hidden":"true"}),e.jsx("p",{className:"aeo-hero-row-detail",children:a?"Could not be loaded":"Loading"})]});if(t.state==="unavailable"){const m=k(t);return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsx("p",{className:"aeo-hero-row-value text-base font-semibold text-secondary",children:"Not measured"}),e.jsx("div",{}),e.jsx("p",{className:"aeo-hero-row-detail",children:m==="Not measured"?"":m})]})}const n=Math.round(t.value*100),o=t.numerator===void 0||t.denominator===void 0?null:`${t.numerator} of ${t.denominator}`;return e.jsxs("div",{className:"aeo-hero-row",children:[e.jsx("p",{className:"aeo-hero-row-label",children:s}),e.jsxs("p",{className:"aeo-hero-row-value text-heading",children:[n,e.jsx("span",{className:"text-faint",children:"%"})]}),e.jsx("div",{className:"aeo-hero-row-bar","aria-hidden":"true",children:e.jsx("div",{className:"metric-card-bar-fill progress-fill-neutral",style:{width:`${n}%`}})}),e.jsx("p",{className:"aeo-hero-row-detail tabular-nums",children:o??""})]})}function ke({branded:s,nonBrand:t,brandedFailed:a=!1,nonBrandFailed:n=!1}){return e.jsxs("section",{"aria-labelledby":"property-coverage-hero",children:[e.jsx("h2",{id:"property-coverage-hero",className:"sr-only",children:"Coverage for this Property"}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Non-brand · the demand to earn"}),e.jsx(S,{label:"Mentioned",metric:t?.mentionCoverage,failed:n}),e.jsx(S,{label:"Cited",metric:t?.citationCoverage,failed:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Branded · already named"}),e.jsx(S,{label:"Mentioned",metric:s?.mentionCoverage,failed:a}),e.jsx(S,{label:"Cited",metric:s?.citationCoverage,failed:a})]})]})]})}function qe({branded:s,nonBrand:t,brandedError:a,nonBrandError:n,onRetry:o}){const m=[{queryClass:"branded",row:s,isError:a},{queryClass:"non-brand",row:t,isError:n}];return e.jsxs("section",{"aria-labelledby":"property-brand-contrast",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"The gap"}),e.jsxs("h2",{id:"property-brand-contrast",className:"text-base font-semibold text-heading",children:["Named versus not named",e.jsx(P,{text:"Branded queries already contain your name, so an answer engine has an easy path back to you. Non-brand queries describe the need instead, and that is the demand you have to earn. Each row is measured only over the queries assigned to this Property in that class; a class with no assigned query reads Not measured rather than 0%."})]})]})}),e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[560px]",children:[e.jsx("caption",{className:"sr-only",children:"Mention and citation coverage for this Property, split by query class"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Query type"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"})]})}),e.jsx("tbody",{children:m.map(({queryClass:r,row:l,isError:y})=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:"block font-medium text-heading",children:h[r].headline}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:h[r].technical}),l&&y?e.jsxs("span",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm text-caution",children:[e.jsx("span",{role:"status",children:"Refresh failed."}),e.jsxs(j,{type:"button",size:"sm",variant:"ghost",className:"h-11 px-3 text-sm md:h-11",onClick:()=>o(r),children:["Retry ",h[r].technical.toLocaleLowerCase()]})]}):null]}),l?e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx(T,{metric:l.mentionCoverage,emphasis:!0})}),e.jsx("td",{children:e.jsx(T,{metric:l.citationCoverage,emphasis:!0})})]}):y?e.jsx("td",{colSpan:2,children:e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{role:"alert",children:["Could not load ",h[r].technical.toLocaleLowerCase(),"."]}),e.jsxs(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>o(r),children:["Retry ",h[r].technical.toLocaleLowerCase()]})]})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})}),e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})})]})]},r))})]})})]})}function Be({row:s,queryClass:t,isError:a}){return e.jsxs("section",{"aria-labelledby":"property-providers",className:"page-section-divider",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsx("div",{children:e.jsxs("h2",{id:"property-providers",className:"text-base font-semibold text-heading",children:["Which engines answer for this Property",e.jsx(P,{text:"Each row is measured over the queries that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%."})]})})}),s===void 0&&a?e.jsxs("p",{className:"text-sm text-secondary",children:["Details for ",h[t].technical.toLocaleLowerCase()," are unavailable. Retry that query type above."]}):s===void 0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading…"}):s.providers.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No answer engine has measured ",h[t].technical.toLocaleLowerCase()," for this Property.",s.mentionCoverage.state==="unavailable"?` ${k(s.mentionCoverage)}.`:""]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[520px]",children:[e.jsx("caption",{className:"sr-only",children:"Per-engine mention and citation coverage"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Engine"}),e.jsx("th",{children:"Mentioned"}),e.jsx("th",{children:"Cited"})]})}),e.jsx("tbody",{children:s.providers.map(n=>e.jsxs("tr",{children:[e.jsx("td",{className:"font-medium text-heading",children:n.provider}),e.jsx("td",{children:e.jsx(T,{metric:n.mentionCoverage})}),e.jsx("td",{children:e.jsx(T,{metric:n.citationCoverage})})]},n.provider))})]})})]})}function Ue(s){const t=s.questions.join(" · ");return s.questionsTruncated?`${t} +${s.questionTotal-s.questions.length} more`:t}function Ie({project:s,targetKey:t,queryClass:a}){const n=E({...ye({client:L,path:{name:s},query:{targetKey:t,queryClass:a}})});if(n.isPending||n.isError)return null;const o=n.data?.competitors??[],m=n.data?.basis;return e.jsxs("section",{"aria-labelledby":"property-named-instead",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-named-instead",className:"text-base font-semibold text-heading",children:["Named instead of this Property",e.jsx(P,{text:"Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once."})]})}),o.length>0?e.jsxs("p",{className:"supporting-copy",children:[n.data?.total??o.length," named"]}):null]}),o.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No rival was named in the answers this Property missed. Nothing to compete with here yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"Names the engines gave instead of this Property"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Named"}),e.jsx("th",{children:"Answers"}),e.jsx("th",{children:"Engines"}),e.jsx("th",{children:"Queries"})]})}),e.jsx("tbody",{children:o.map(r=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-strong",children:r.name}),e.jsx("td",{className:"tabular-nums text-secondary",children:r.occurrences}),e.jsxs("td",{className:"text-secondary",children:[r.providers.join(", "),r.providersTruncated?` +${r.providerTotal-r.providers.length}`:""]}),e.jsx("td",{className:"text-right",children:e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[e.jsx("span",{className:"tabular-nums text-secondary",children:r.questionTotal}),e.jsx(P,{text:Ue(r)})]})})]},r.name))})]})}),m?.state==="available"?e.jsxs("p",{className:"supporting-copy mt-2",children:[m.targetMissResults," of ",m.answeredResults," answers to ",h[a].technical.toLocaleLowerCase()," did not name this Property."]}):null]})]})}function $e({questions:s,queryClass:t}){return e.jsxs("section",{"aria-labelledby":"property-questions",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-questions",className:"text-base font-semibold text-heading",children:[h[t].technical," assigned to this Property"]})}),e.jsxs("p",{className:"supporting-copy",children:[s.length," assigned"]})]}),s.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No ",h[t].technical.toLocaleLowerCase()," are assigned. Add one in advanced measurement setup to measure this class."]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"Queries assigned to this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"Query"})})}),e.jsx("tbody",{children:s.map(a=>e.jsx("tr",{children:e.jsx("td",{className:"text-secondary",children:a})},a))})]})})]})}function _e({urls:s}){return e.jsxs("section",{"aria-labelledby":"property-urls",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-urls",className:"text-base font-semibold text-heading",children:["URLs that count as this Property",e.jsx(P,{text:"A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either."})]})}),e.jsxs("p",{className:"supporting-copy",children:[s.length," configured"]})]}),s.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No URLs are configured for this Property."}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"URL matchers configured for this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"URL"})})}),e.jsx("tbody",{children:s.map(t=>e.jsx("tr",{children:e.jsx("td",{className:"break-all text-secondary",children:t})},t))})]})})]})}function Ye(){const{projectName:s,targetKey:t}=le({strict:!1}),[a,n]=w.useState("non-brand"),[o,m]=w.useState(new Set),r=s??"",l=t??"",y=!!r&&!!l,{canWrite:q}=ce(),C=E({...he({client:L,path:{name:r}}),enabled:y}),b=E({...Y(r,l,"branded"),enabled:y}),v=E({...Y(r,l,"non-brand"),enabled:y}),B=Z(b.data),U=Z(v.data),x=a==="branded"?b.data:v.data,f=a==="branded"?B:U,O=(a==="branded"?b.isError:v.isError)&&f===void 0,Q=x?.measurement.displayedRunId,J=f?.mentionCoverage.state==="unavailable"?k(f.mentionCoverage):void 0,X=x===void 0?void 0:x.measurement.completedAt??null,M={client:L,path:{name:r},query:{targetKey:l,queryClass:a,shape:me.answers,limit:W,...Q?{runId:Q}:{}}},d=de({...xe(M),enabled:y&&x!==void 0,initialPageParam:M,getNextPageParam:i=>i.answers?.nextCursor?{path:M.path,query:{...M.query,cursor:i.answers.nextCursor}}:void 0}),I=C.data?.active??null,p=I?.plan.schemaVersion===2?I.plan:null,ee=I!==null&&p===null,R=p?.targets.find(i=>i.stableKey===l)??null,se=w.useMemo(()=>{if(!p)return[];const i=new Map(p.querySnapshots.map(c=>[c.queryId,c.queryText]));return[...new Set(p.assignments.filter(c=>c.targetKey===l&&c.queryClass===a).flatMap(c=>{const u=i.get(c.queryId);return u===void 0?[]:[u]}))].sort((c,u)=>c.localeCompare(u))},[p,l,a]),te=w.useMemo(()=>R?.urlMatchers.map(Ne)??[],[R]),ae=w.useMemo(()=>p?.groups.filter(i=>i.targetKeys.includes(l))??[],[p,l]),g=w.useMemo(()=>(d.data?.pages??[]).flatMap(u=>u.answers?.items??[]),[d.data]),V=d.data?.pages[0]?.answers?.totalEstimate??g.length,ne=(d.data?.pages??[]).length>0&&(d.data?.pages??[]).every(i=>i.answers===void 0),re=d.data?.pages[0]?.measurement.state,$=e.jsxs(A,{to:"/projects/$projectName",params:{projectName:r},className:"inline-flex items-center gap-1 text-xs text-muted hover:text-strong",children:[e.jsx(fe,{className:"size-3.5","aria-hidden":"true"}),"Back to measurement overview"]});if(!y)return e.jsx("div",{className:"page-container",children:e.jsx("p",{className:"text-sm text-muted",children:"Missing project name or Property key in URL."})});if(!pe("portfolio",ue()?.projectTabs))return e.jsx("div",{className:"page-container",children:e.jsx("p",{className:"text-sm text-muted",children:"This view is not available here."})});if(C.isPending&&!C.isError)return e.jsx("div",{className:"page-container",children:e.jsxs("div",{role:"status","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading Property"}),e.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-subtle","aria-hidden":"true"})]})});const ie=C.isError&&C.data===void 0,F=b.isError&&b.data===void 0,K=v.isError&&v.data===void 0;return ie||F&&K?e.jsxs("div",{className:"page-container space-y-3",children:[$,e.jsx("p",{role:"alert",className:"text-sm text-negative",children:"Could not load this Property."}),e.jsx(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{C.refetch(),b.refetch(),v.refetch()},children:"Try again"})]}):!p||!R?e.jsxs("div",{className:"page-container space-y-3",children:[$,e.jsx("p",{role:"status",className:"text-sm text-secondary",children:p?"This Property is not in the published setup. It may have been renamed or removed.":"A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab."}),e.jsx(j,{asChild:!0,type:"button",variant:"outline",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(A,{to:"/projects/$projectName/portfolio",params:{projectName:r},children:q?ee?"Republish setup":"Open measurement setup":"View measurement setup"})})]}):e.jsxs("div",{className:"page-container space-y-8",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{className:"page-header-left",children:[$,e.jsx("h1",{className:"page-title mt-2",children:R.label}),e.jsxs("p",{className:"page-subtitle",children:["Property in ",r]})]}),e.jsxs("div",{className:"page-header-right",children:[x?e.jsx(N,{tone:H[x.measurement.state].tone,children:H[x.measurement.state].label}):null,f&&f.flags>0?e.jsxs(N,{tone:"caution",children:[f.flags," flagged"]}):null]})]}),e.jsx(ke,{branded:B,nonBrand:U,brandedFailed:F,nonBrandFailed:K}),e.jsx(qe,{branded:B,nonBrand:U,brandedError:b.isError,nonBrandError:v.isError,onRetry:i=>{i==="branded"?b.refetch():v.refetch()}}),x&&(x.measurement.state==="not_measured"||x.nextAction.kind==="run_measurement")?e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-y border-default py-4","aria-label":"Measurement next step",children:[e.jsx("p",{className:"text-sm text-secondary",children:D()?z:q?"Run a measurement from the project overview to collect this Property’s coverage and source evidence.":"This Property needs a new measurement before coverage and source evidence are available."}),e.jsx(j,{asChild:!0,type:"button",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(A,{to:"/projects/$projectName",params:{projectName:r},children:q?"Go to measurement overview":"View measurement overview"})})]}):null,e.jsxs("div",{className:"flex flex-wrap items-end gap-4 border-y border-default py-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"property-query-class",className:"block text-sm font-medium text-heading",children:"Query type"}),e.jsxs("select",{id:"property-query-class",value:a,onChange:i=>n(i.target.value==="branded"?"branded":"non-brand"),className:"h-11 rounded-md border border-default bg-surface px-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-mono-400",children:[e.jsx("option",{value:"non-brand",children:h["non-brand"].technical}),e.jsx("option",{value:"branded",children:h.branded.technical})]})]}),e.jsx(Ae,{measuredAt:X,unmeasuredReason:J,queryClass:a})]}),e.jsx(Be,{row:f,queryClass:a,isError:O}),e.jsx(Ie,{project:r,targetKey:l,queryClass:a}),e.jsx($e,{questions:se,queryClass:a}),e.jsx(_e,{urls:te}),e.jsx(Te,{project:r,groups:ae}),e.jsxs("section",{"aria-labelledby":"property-evidence",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsx("div",{children:e.jsxs("h2",{id:"property-evidence",className:"text-base font-semibold text-heading",children:["Answers the engines gave",e.jsx(P,{text:"One row per answer an engine gave for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent: an answer can name this Property without linking it, or link it without naming it. Answers that did neither are listed first, because those are what a gap is made of. Where the answer text was not stored the mention reads Not measured, never a zero. Open a row to read what the engine actually said, followed by the source URLs it returned, this Property's own first. The answer is where a miss becomes actionable: a query this Property was not named in may still have named a sibling building."})]})}),g.length>0?e.jsxs("p",{className:"supporting-copy",children:[g.length," of ",V]}):null]}),O?e.jsxs("p",{className:"text-sm text-secondary",children:["Evidence for ",h[a].technical.toLocaleLowerCase()," is unavailable. Retry that query type above."]}):d.isPending&&g.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading evidence…"}):d.isError&&g.length===0?e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsx("span",{role:"alert",children:"Evidence could not be loaded."}),e.jsx(j,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{d.refetch()},children:"Retry evidence"})]}):re==="not_measured"?e.jsx("p",{className:"text-sm text-secondary",children:D()?z:"Not measured yet. Run a measurement to collect the answers for this Property."}):ne?e.jsx("p",{role:"alert",className:"text-sm text-caution",children:"This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected."}):g.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No answers matched this Property in the displayed measurement."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[720px]",children:[e.jsx("caption",{className:"sr-only",children:"Answers measured for this Property"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Query"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"}),e.jsx("th",{children:"Sources"}),e.jsx("th",{children:e.jsx("span",{className:"sr-only",children:"Sources detail"})})]})}),e.jsx("tbody",{children:g.map(i=>{const c=Ce(i),u=o.has(c);return e.jsxs(w.Fragment,{children:[e.jsxs("tr",{children:[e.jsxs("td",{className:"text-secondary",children:[e.jsx("span",{className:"block",children:i.queryText}),e.jsx("span",{className:"mt-1 block text-xs text-muted",children:[i.provider,i.location].filter(Boolean).join(" · ")}),i.historical||i.bridged?e.jsx("span",{className:"mt-1 flex",children:e.jsx(N,{tone:"caution",children:"Historical"})}):null]}),e.jsx("td",{children:e.jsx(Ee,{row:i})}),e.jsx("td",{children:e.jsx(Me,{row:i})}),e.jsx("td",{className:"tabular-nums text-secondary",children:i.cited===null?Le:i.sources.length}),e.jsx("td",{className:"text-right",children:e.jsx(j,{type:"button",size:"sm",variant:"ghost","aria-expanded":u,onClick:()=>m(oe=>{const _=new Set(oe);return _.delete(c)||_.add(c),_}),children:u?`Hide the answer for ${i.queryText}`:`Read the answer for ${i.queryText}`})})]}),u?e.jsx("tr",{children:e.jsxs("td",{colSpan:5,className:"bg-surface-subtle px-4",children:[e.jsx(Se,{project:r,targetKey:l,row:i}),e.jsx(Re,{row:i})]})}):null]},c)})})]})}),d.hasNextPage?e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{children:["Showing ",g.length," of ",V]}),d.isFetchNextPageError?e.jsx("span",{role:"alert",children:"Could not load more evidence."}):null,e.jsx(j,{size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",disabled:d.isFetchingNextPage,onClick:()=>{d.fetchNextPage()},children:d.isFetchingNextPage?"Loading…":d.isFetchNextPageError?"Retry more evidence":`Show ${W} more`})]}):null]})]})]})}export{Ye as MeasurementPropertyPage};