@canonry/canonry 5.29.0 → 5.29.1
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.
- package/assets/assets/{AuditHistoryPanel-ru-RI1SR.js → AuditHistoryPanel-B_H7nIp7.js} +1 -1
- package/assets/assets/{BacklinksPage-BbVWtfAh.js → BacklinksPage-rhms6z2S.js} +1 -1
- package/assets/assets/{HistoryPage-CxIxsxIv.js → HistoryPage-CWPETgrG.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-Oju3oAP3.js → MeasurementPropertyPage-D9-54Je9.js} +1 -1
- package/assets/assets/{ProjectPage-ZsQo28yM.js → ProjectPage-eNVzxsZW.js} +1 -1
- package/assets/assets/{RunRow-D73cbxey.js → RunRow-DQPW7FIF.js} +1 -1
- package/assets/assets/{RunsPage-D9hOl6k6.js → RunsPage-BOM_RkNi.js} +1 -1
- package/assets/assets/{SettingsPage-By5cJJaC.js → SettingsPage-BDnT6wtM.js} +1 -1
- package/assets/assets/{SiteHealthSection-Gfyispq_.js → SiteHealthSection-lcZA1XpM.js} +3 -3
- package/assets/assets/{TrafficPage-8khxNXDL.js → TrafficPage-D4nGSfXx.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-FDe4jKLH.js → TrafficSourceDetailPage-CvZcCbic.js} +1 -1
- package/assets/assets/{extract-error-message-Co1hxrsc.js → extract-error-message-BJ3f0StM.js} +1 -1
- package/assets/assets/{index-DKScDg92.js → index-Cncchurw.js} +18 -18
- package/assets/assets/{react-sigma_core.esm.min-DxAxqyeI.js → react-sigma_core.esm.min-c7qzyLLe.js} +1 -1
- package/assets/assets/{v2-overview-adapter-DNbOwIJq.js → v2-overview-adapter-Dsd6dWtE.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-WPQB4UYX.js → chunk-ASYPQYVV.js} +3 -3
- package/dist/{chunk-DCGELKRW.js → chunk-FKL5EGOW.js} +68 -3
- package/dist/{chunk-7BW7BAD5.js → chunk-N2SVFXOB.js} +7 -7
- package/dist/{chunk-THMIDWMS.js → chunk-PTTVDWMN.js} +2 -2
- package/dist/{chunk-KGYHEYHX.js → chunk-RHZKOXDZ.js} +26 -17
- package/dist/{chunk-J6BJIOIN.js → chunk-WL2SHCPU.js} +1 -1
- package/dist/{chunk-VPIOF2PB.js → chunk-XWBQWAVE.js} +2 -2
- package/dist/cli.js +8 -8
- package/dist/{demo-server-EU6B4KNK.js → demo-server-VGUIDC5T.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-FVUNBN66.js → intelligence-service-IQA4U3RA.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +12 -12
package/assets/assets/{react-sigma_core.esm.min-DxAxqyeI.js → react-sigma_core.esm.min-c7qzyLLe.js}
RENAMED
|
@@ -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-
|
|
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-lcZA1XpM.js";import"./index-Cncchurw.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{j as s,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{E as ie,B as oe,aO as le}from"./index-DKScDg92.js";import{M as ue}from"./vendor-markdown-B4giJcws.js";import{C as ce,$ as de,g as J}from"./vendor-lucide-N6vOpZmh.js";const Ie="Sources",_={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function pe({headingLevel:e}){return n=>{const l=[],u=c=>{c.type==="heading"&&c.depth&&l.push(c),c.children?.forEach(u)};u(n);const f=l.reduce((c,p)=>Math.min(c,p.depth),6);for(const c of l){const p=c.depth-f;c.depth=Math.min(6,e+p),c.data={...c.data,hProperties:{...c.data?.hProperties,"data-answer-heading-level":p+1}}}}}function me({answer:e}){const[n,l]=C.useState("idle"),u=C.useRef(!1),f=async()=>{if(!u.current){u.current=!0,l("copying");try{await navigator.clipboard.writeText(e),l("copied")}catch{l("failed")}finally{u.current=!1}}};return s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[s.jsx(oe,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":n==="copying","aria-busy":n==="copying",onClick:()=>{f()},children:n==="copying"?_.copying:_.copy}),s.jsx("span",{role:"status",className:"text-sm text-secondary",children:n==="copied"?_.copied:n==="failed"?_.failed:""})]})}function Me({children:e,headingLevel:n=4,copyable:l=!1}){return s.jsxs("div",{className:"answer-markdown",children:[s.jsx(ue,{remarkPlugins:[[pe,{headingLevel:n}]],components:{p:({children:u})=>s.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:u}),ul:({children:u})=>s.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:u}),ol:({children:u,start:f})=>s.jsx("ol",{start:f,className:"mb-3 ml-5 list-decimal space-y-1",children:u}),pre:({children:u})=>s.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:u}),a:({children:u,href:f})=>{const c=ie(f);return c?s.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:u}):s.jsx("span",{children:u})},img:({alt:u})=>s.jsx("span",{children:u})},children:e}),l&&e.trim()?s.jsx(me,{answer:e},e):null]})}const 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,q={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},ge=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Ke({options:e,selected:n,onSelect:l,marketKey:u,label:f="Measurement scope",labelVisibility:c="visible",allowGroupSelect:p=!0}){const a=[...e].sort((t,o)=>t.label.localeCompare(o.label,void 0,{numeric:!0})||t.id.localeCompare(o.id)),[x,k]=C.useState(""),[I,M]=C.useState([]),[y,N]=C.useState(!1),b=C.useRef(null),v=C.useRef(null),r=C.useId(),g=a.filter(t=>t.kind==="group"),m=new Map(g.map(t=>[t.id,t])),i=m.get(I.at(-1)??""),U=m.get(I.at(-2)??""),h=x.trim().toLocaleLowerCase(),re=g.filter(t=>!t.parentGroupIds?.some(o=>m.has(o))),w=a.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(o=>m.get(o)?.label).filter(Boolean).join(" · "),R=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(h),F=t=>{const o=[...t.parentGroupIds??[]],d=new Set;for(;o.length;){const j=o.pop();if(j===i?.id)return!0;d.has(j)||(d.add(j),o.push(...m.get(j)?.parentGroupIds??[]))}return!1},K=(y?[]:i?g.filter(t=>h?F(t):t.parentGroupIds?.includes(i.id)):h?g:re).filter(R),S=a.find(t=>t.kind==="market"&&t.id===(u??(n.kind==="market"?n.id:void 0))),H=i&&S&&(i.marketKeys?.includes(S.id)||S.parentGroupIds?.includes(i.id))?S.id:void 0,L=p?H??ge(i):void 0,G=(i?w.filter(t=>t.parentGroupIds?.includes(i.id)&&(!L||t.marketKeys?.includes(L))):h||y||g.length===0?w:[]).filter(R),W=a.filter(t=>t.kind!=="market"||y||!p&&!i&&!h&&g.length>0||p&&i?.marketKeys?.length===1&&!h?!1:(i?h?F(t):t.parentGroupIds?.includes(i.id):h||!t.parentGroupIds?.some(d=>m.has(d)))&&R(t)),z=i||y?[]:a.filter(t=>t.kind==="project"&&R(t));C.useEffect(()=>{const t=o=>{b.current?.open&&o.target instanceof Node&&!b.current.contains(o.target)&&(b.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{b.current&&(b.current.open=!1,b.current.querySelector("summary")?.focus());const o=p?t.kind==="property"?L:t.kind==="group"&&t.id===i?.id?H:void 0:void 0;o?l(t,o):l(t)},T=t=>{const o=[];let d=m.get(t.parentGroupIds?.[0]??"");for(;d&&!o.includes(d.id)&&d.id!==t.id;)o.unshift(d.id),d=m.get(d.parentGroupIds?.[0]??"");return[...o,t.id]},ae=()=>{const t=n.kind==="group"?m.get(n.id):void 0,o=m.get(S?.parentGroupIds?.[0]??""),d=(n.parentGroupIds??[]).flatMap(A=>{const B=m.get(A);return B?[T(B)]:[]}),j=d.find(A=>A.at(-1)===i?.id)??d.sort((A,B)=>B.length-A.length)[0]??[],Z=o?T(o):n.marketKeys?.length?[]:j;M(t?T(t):Z),N(n.kind==="property"&&Z.length===0&&g.length>0),k("")},Y=t=>{M(T(t)),N(!1),k(""),v.current?.focus()},P=(t,o=E(t))=>s.jsxs("div",{className:"flex items-stretch",children:[s.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!p?q.browse(E(t)):q.select(E(t)),"aria-current":n.kind===t.kind&&n.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!p?Y(t):se(t),children:[s.jsxs("span",{className:"min-w-0 break-words",children:[o,h&&O(t)?s.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),s.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?p?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),p&&t.kind==="group"&&t.id!==i?.id&&a.some(d=>d.parentGroupIds?.includes(t.id))?s.jsx("button",{type:"button","aria-label":q.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:s.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),V=(t,o)=>o.length>0?s.jsxs("section",{"aria-label":t,className:"mt-2",children:[s.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),o.map(d=>P(d))]}):null,Q=(t,o,d)=>o.length>0?s.jsxs("details",{open:d,className:"mt-2 border-y border-default",children:[s.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," (",o.length,")"]}),o.map(j=>P(j))]},`${i?.id??"root"}:${t}`):null;return s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{id:`${r}-label`,className:c==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:f}),s.jsxs("details",{ref:b,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&v.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[s.jsxs("summary",{id:`${r}-value`,"aria-labelledby":`${r}-label ${r}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{b.current?.open||ae()},children:[`${E(n)}${n.kind==="group"?` · ${ee(n.targetCount)}`:n.kind==="property"?` · ${a.find(t=>t.kind==="market"&&t.id===u)?.label??(n.marketKeys?.length?q.allMarkets:"Property")}`:n.kind==="market"?" · Market":""}`,s.jsx(ce,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),s.jsxs("div",{className:"visibility-scope-menu",children:[i||y?s.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[s.jsx("button",{type:"button",className:D,"aria-label":`Back to ${U?.label??"all groups"}`,onClick:()=>{M(I.slice(0,-1)),N(!1),k(""),v.current?.focus()},children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(de,{size:16,"aria-hidden":"true"}),U?.label??"All groups"]})}),s.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:i?.label??"All properties"})]}):null,s.jsx("input",{ref:v,type:"search","aria-label":"Search scopes",className:X,placeholder:i?"Search within this group":y?"Search properties":"Search groups or properties",value:x,onChange:t=>k(t.target.value)}),s.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[p&&i&&!h?P(i,"All properties in this group"):null,z.map(t=>P(t)),i&&!h?Q("Subgroups",K,!0):V(i?"Subgroups":"Groups",K),h?V("Properties",G):Q(i&&K.length>0?"All properties":"Properties",G,!i||K.length===0),V("Markets",W),!i&&!y&&!h&&g.length>0&&w.length>0?s.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":q.browseAll,onClick:()=>{N(!0),v.current?.focus()},children:[s.jsx("span",{children:"All properties"}),s.jsx(J,{size:18,"aria-hidden":"true"})]}):null,h&&K.length+G.length+W.length+z.length===0?s.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Se(e){const n=e[0];return n?e.every(l=>l.mode===n.mode&&l.scope.kind===n.scope.kind&&l.scope.key===n.scope.key&&l.queryClass===n.queryClass&&l.measurement.displayedRunId===n.measurement.displayedRunId):!0}function $(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 fe(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function he(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function ye(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function be(e,n,l){const u=new Map;if(!n)return u;const f=new Map(e.usageEdges.map(a=>[te(a),a.targetKey])),c=new Map(e.assignments.map(a=>[`${a.targetKey}:${a.queryId}`,a.queryClass])),p=new Map(e.usageEdges.map(a=>[te(a),c.get(`${a.targetKey}:${a.queryId}`)]));for(const a of n.evidence){if(l&&p.get(a.usageEdgeId)!==l)continue;const x=f.get(a.usageEdgeId);if(!x)continue;const k=u.get(x)??[];k.push({id:`${a.observationId}:${a.expectedSlotId}:${a.usageEdgeId}:${a.sourceUrl}`,kind:he(a.classification),query:a.queryText,provider:a.provider,location:a.location,url:a.sourceUrl,tone:ye(a.classification),historical:a.historical||a.bridged}),u.set(x,k)}return u}function xe(e){if(e.flags>0)return{label:"Review",tone:"caution"};const n=[e.mentionCoverage,e.citationCoverage].filter(l=>l.state==="unavailable").map(l=>l.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("identity_ambiguous")?{label:le.ambiguous,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 ke(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 Ce(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 ne(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 Ae({overview:e,activePlan:n,report:l,reportState:u=l?"ready":"loading",sort:f}){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 c=n.plan,p=new Map(c.targets.map(r=>[r.stableKey,r])),a=new Map(c.querySnapshots.map(r=>[r.queryId,r.queryText])),x=new Map;for(const r of c.assignments){if(e.queryClass!=="all"&&r.queryClass!==e.queryClass)continue;const g=a.get(r.queryId);if(!g)continue;const m=x.get(r.targetKey)??new Set;m.add(g),x.set(r.targetKey,m)}const k=l?.revision===n.revision&&l.run?.id===e.measurement.displayedRunId?l:null,I=e.measurement.displayedRunId===void 0||k?"ready":u==="error"||l!=null?"error":"loading",M=be(c,k,e.queryClass==="all"?void 0:e.queryClass),y=new Map;for(const r of c.groups)for(const g of r.targetKeys)y.has(g)||y.set(g,r.label);const N=e.properties.items.map(r=>{const g=p.get(r.targetKey),m=M.get(r.targetKey)??[];return{id:r.targetKey,name:r.label,mentionCoverage:$(r.mentionCoverage),citationCoverage:$(r.citationCoverage),status:xe(r),providers:r.providers?.map(i=>({provider:i.provider,mentionCoverage:$(i.mentionCoverage),citationCoverage:$(i.citationCoverage)})),market:y.get(r.targetKey),assignedQueries:[...x.get(r.targetKey)??[]],urls:g?.urlMatchers.map(fe)??[],evidence:m,evidenceState:I,historical:m.some(i=>i.historical)}}),b=e.namedShareOfVoice?.entries.map(r=>({name:r.label,coverage:{numerator:r.credits,denominator:e.namedShareOfVoice.denominator}})),v=e.properties.items.flatMap(r=>r.flags>0?[{id:`property:${r.targetKey}`,property:r.label,summary:`${r.flags} ${r.flags===1?"result needs":"results need"} review.`,tone:"caution",count:r.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:ke(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ce(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:$(e.metrics.propertiesMentioned),mentionCoverage:$(e.metrics.mentionCoverage),citationCoverage:$(e.metrics.citationCoverage)},properties:N,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??N.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...f?{sort:f}:{}},availableGroups:c.groups.map(r=>({id:r.stableKey,label:r.label})),...ne(e)?{nextActionText:ne(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:v}}export{Me as A,q as M,Ke as V,Ie as a,Se as b,Ae as c,fe as m};
|
|
1
|
+
import{j as s,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{E as ie,B as oe,aO as le}from"./index-Cncchurw.js";import{M as ue}from"./vendor-markdown-B4giJcws.js";import{C as ce,$ as de,g as J}from"./vendor-lucide-N6vOpZmh.js";const Ie="Sources",_={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function pe({headingLevel:e}){return n=>{const l=[],u=c=>{c.type==="heading"&&c.depth&&l.push(c),c.children?.forEach(u)};u(n);const f=l.reduce((c,p)=>Math.min(c,p.depth),6);for(const c of l){const p=c.depth-f;c.depth=Math.min(6,e+p),c.data={...c.data,hProperties:{...c.data?.hProperties,"data-answer-heading-level":p+1}}}}}function me({answer:e}){const[n,l]=C.useState("idle"),u=C.useRef(!1),f=async()=>{if(!u.current){u.current=!0,l("copying");try{await navigator.clipboard.writeText(e),l("copied")}catch{l("failed")}finally{u.current=!1}}};return s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[s.jsx(oe,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":n==="copying","aria-busy":n==="copying",onClick:()=>{f()},children:n==="copying"?_.copying:_.copy}),s.jsx("span",{role:"status",className:"text-sm text-secondary",children:n==="copied"?_.copied:n==="failed"?_.failed:""})]})}function Me({children:e,headingLevel:n=4,copyable:l=!1}){return s.jsxs("div",{className:"answer-markdown",children:[s.jsx(ue,{remarkPlugins:[[pe,{headingLevel:n}]],components:{p:({children:u})=>s.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:u}),ul:({children:u})=>s.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:u}),ol:({children:u,start:f})=>s.jsx("ol",{start:f,className:"mb-3 ml-5 list-decimal space-y-1",children:u}),pre:({children:u})=>s.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:u}),a:({children:u,href:f})=>{const c=ie(f);return c?s.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:u}):s.jsx("span",{children:u})},img:({alt:u})=>s.jsx("span",{children:u})},children:e}),l&&e.trim()?s.jsx(me,{answer:e},e):null]})}const 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,q={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},ge=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Ke({options:e,selected:n,onSelect:l,marketKey:u,label:f="Measurement scope",labelVisibility:c="visible",allowGroupSelect:p=!0}){const a=[...e].sort((t,o)=>t.label.localeCompare(o.label,void 0,{numeric:!0})||t.id.localeCompare(o.id)),[x,k]=C.useState(""),[I,M]=C.useState([]),[y,N]=C.useState(!1),b=C.useRef(null),v=C.useRef(null),r=C.useId(),g=a.filter(t=>t.kind==="group"),m=new Map(g.map(t=>[t.id,t])),i=m.get(I.at(-1)??""),U=m.get(I.at(-2)??""),h=x.trim().toLocaleLowerCase(),re=g.filter(t=>!t.parentGroupIds?.some(o=>m.has(o))),w=a.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(o=>m.get(o)?.label).filter(Boolean).join(" · "),R=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(h),F=t=>{const o=[...t.parentGroupIds??[]],d=new Set;for(;o.length;){const j=o.pop();if(j===i?.id)return!0;d.has(j)||(d.add(j),o.push(...m.get(j)?.parentGroupIds??[]))}return!1},K=(y?[]:i?g.filter(t=>h?F(t):t.parentGroupIds?.includes(i.id)):h?g:re).filter(R),S=a.find(t=>t.kind==="market"&&t.id===(u??(n.kind==="market"?n.id:void 0))),H=i&&S&&(i.marketKeys?.includes(S.id)||S.parentGroupIds?.includes(i.id))?S.id:void 0,L=p?H??ge(i):void 0,G=(i?w.filter(t=>t.parentGroupIds?.includes(i.id)&&(!L||t.marketKeys?.includes(L))):h||y||g.length===0?w:[]).filter(R),W=a.filter(t=>t.kind!=="market"||y||!p&&!i&&!h&&g.length>0||p&&i?.marketKeys?.length===1&&!h?!1:(i?h?F(t):t.parentGroupIds?.includes(i.id):h||!t.parentGroupIds?.some(d=>m.has(d)))&&R(t)),z=i||y?[]:a.filter(t=>t.kind==="project"&&R(t));C.useEffect(()=>{const t=o=>{b.current?.open&&o.target instanceof Node&&!b.current.contains(o.target)&&(b.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{b.current&&(b.current.open=!1,b.current.querySelector("summary")?.focus());const o=p?t.kind==="property"?L:t.kind==="group"&&t.id===i?.id?H:void 0:void 0;o?l(t,o):l(t)},T=t=>{const o=[];let d=m.get(t.parentGroupIds?.[0]??"");for(;d&&!o.includes(d.id)&&d.id!==t.id;)o.unshift(d.id),d=m.get(d.parentGroupIds?.[0]??"");return[...o,t.id]},ae=()=>{const t=n.kind==="group"?m.get(n.id):void 0,o=m.get(S?.parentGroupIds?.[0]??""),d=(n.parentGroupIds??[]).flatMap(A=>{const B=m.get(A);return B?[T(B)]:[]}),j=d.find(A=>A.at(-1)===i?.id)??d.sort((A,B)=>B.length-A.length)[0]??[],Z=o?T(o):n.marketKeys?.length?[]:j;M(t?T(t):Z),N(n.kind==="property"&&Z.length===0&&g.length>0),k("")},Y=t=>{M(T(t)),N(!1),k(""),v.current?.focus()},P=(t,o=E(t))=>s.jsxs("div",{className:"flex items-stretch",children:[s.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!p?q.browse(E(t)):q.select(E(t)),"aria-current":n.kind===t.kind&&n.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!p?Y(t):se(t),children:[s.jsxs("span",{className:"min-w-0 break-words",children:[o,h&&O(t)?s.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),s.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?p?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),p&&t.kind==="group"&&t.id!==i?.id&&a.some(d=>d.parentGroupIds?.includes(t.id))?s.jsx("button",{type:"button","aria-label":q.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:s.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),V=(t,o)=>o.length>0?s.jsxs("section",{"aria-label":t,className:"mt-2",children:[s.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),o.map(d=>P(d))]}):null,Q=(t,o,d)=>o.length>0?s.jsxs("details",{open:d,className:"mt-2 border-y border-default",children:[s.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," (",o.length,")"]}),o.map(j=>P(j))]},`${i?.id??"root"}:${t}`):null;return s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{id:`${r}-label`,className:c==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:f}),s.jsxs("details",{ref:b,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&v.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[s.jsxs("summary",{id:`${r}-value`,"aria-labelledby":`${r}-label ${r}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{b.current?.open||ae()},children:[`${E(n)}${n.kind==="group"?` · ${ee(n.targetCount)}`:n.kind==="property"?` · ${a.find(t=>t.kind==="market"&&t.id===u)?.label??(n.marketKeys?.length?q.allMarkets:"Property")}`:n.kind==="market"?" · Market":""}`,s.jsx(ce,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),s.jsxs("div",{className:"visibility-scope-menu",children:[i||y?s.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[s.jsx("button",{type:"button",className:D,"aria-label":`Back to ${U?.label??"all groups"}`,onClick:()=>{M(I.slice(0,-1)),N(!1),k(""),v.current?.focus()},children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(de,{size:16,"aria-hidden":"true"}),U?.label??"All groups"]})}),s.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:i?.label??"All properties"})]}):null,s.jsx("input",{ref:v,type:"search","aria-label":"Search scopes",className:X,placeholder:i?"Search within this group":y?"Search properties":"Search groups or properties",value:x,onChange:t=>k(t.target.value)}),s.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[p&&i&&!h?P(i,"All properties in this group"):null,z.map(t=>P(t)),i&&!h?Q("Subgroups",K,!0):V(i?"Subgroups":"Groups",K),h?V("Properties",G):Q(i&&K.length>0?"All properties":"Properties",G,!i||K.length===0),V("Markets",W),!i&&!y&&!h&&g.length>0&&w.length>0?s.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":q.browseAll,onClick:()=>{N(!0),v.current?.focus()},children:[s.jsx("span",{children:"All properties"}),s.jsx(J,{size:18,"aria-hidden":"true"})]}):null,h&&K.length+G.length+W.length+z.length===0?s.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Se(e){const n=e[0];return n?e.every(l=>l.mode===n.mode&&l.scope.kind===n.scope.kind&&l.scope.key===n.scope.key&&l.queryClass===n.queryClass&&l.measurement.displayedRunId===n.measurement.displayedRunId):!0}function $(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 fe(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function he(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function ye(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function be(e,n,l){const u=new Map;if(!n)return u;const f=new Map(e.usageEdges.map(a=>[te(a),a.targetKey])),c=new Map(e.assignments.map(a=>[`${a.targetKey}:${a.queryId}`,a.queryClass])),p=new Map(e.usageEdges.map(a=>[te(a),c.get(`${a.targetKey}:${a.queryId}`)]));for(const a of n.evidence){if(l&&p.get(a.usageEdgeId)!==l)continue;const x=f.get(a.usageEdgeId);if(!x)continue;const k=u.get(x)??[];k.push({id:`${a.observationId}:${a.expectedSlotId}:${a.usageEdgeId}:${a.sourceUrl}`,kind:he(a.classification),query:a.queryText,provider:a.provider,location:a.location,url:a.sourceUrl,tone:ye(a.classification),historical:a.historical||a.bridged}),u.set(x,k)}return u}function xe(e){if(e.flags>0)return{label:"Review",tone:"caution"};const n=[e.mentionCoverage,e.citationCoverage].filter(l=>l.state==="unavailable").map(l=>l.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("identity_ambiguous")?{label:le.ambiguous,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 ke(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 Ce(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 ne(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 Ae({overview:e,activePlan:n,report:l,reportState:u=l?"ready":"loading",sort:f}){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 c=n.plan,p=new Map(c.targets.map(r=>[r.stableKey,r])),a=new Map(c.querySnapshots.map(r=>[r.queryId,r.queryText])),x=new Map;for(const r of c.assignments){if(e.queryClass!=="all"&&r.queryClass!==e.queryClass)continue;const g=a.get(r.queryId);if(!g)continue;const m=x.get(r.targetKey)??new Set;m.add(g),x.set(r.targetKey,m)}const k=l?.revision===n.revision&&l.run?.id===e.measurement.displayedRunId?l:null,I=e.measurement.displayedRunId===void 0||k?"ready":u==="error"||l!=null?"error":"loading",M=be(c,k,e.queryClass==="all"?void 0:e.queryClass),y=new Map;for(const r of c.groups)for(const g of r.targetKeys)y.has(g)||y.set(g,r.label);const N=e.properties.items.map(r=>{const g=p.get(r.targetKey),m=M.get(r.targetKey)??[];return{id:r.targetKey,name:r.label,mentionCoverage:$(r.mentionCoverage),citationCoverage:$(r.citationCoverage),status:xe(r),providers:r.providers?.map(i=>({provider:i.provider,mentionCoverage:$(i.mentionCoverage),citationCoverage:$(i.citationCoverage)})),market:y.get(r.targetKey),assignedQueries:[...x.get(r.targetKey)??[]],urls:g?.urlMatchers.map(fe)??[],evidence:m,evidenceState:I,historical:m.some(i=>i.historical)}}),b=e.namedShareOfVoice?.entries.map(r=>({name:r.label,coverage:{numerator:r.credits,denominator:e.namedShareOfVoice.denominator}})),v=e.properties.items.flatMap(r=>r.flags>0?[{id:`property:${r.targetKey}`,property:r.label,summary:`${r.flags} ${r.flags===1?"result needs":"results need"} review.`,tone:"caution",count:r.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:ke(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ce(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:$(e.metrics.propertiesMentioned),mentionCoverage:$(e.metrics.mentionCoverage),citationCoverage:$(e.metrics.citationCoverage)},properties:N,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??N.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...f?{sort:f}:{}},availableGroups:c.groups.map(r=>({id:r.stableKey,label:r.label})),...ne(e)?{nextActionText:ne(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:v}}export{Me as A,q as M,Ke as V,Ie as a,Se as b,Ae as c,fe as m};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-Cncchurw.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">
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
installSkills,
|
|
5
5
|
loadConfigRaw,
|
|
6
6
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XWBQWAVE.js";
|
|
8
8
|
import {
|
|
9
9
|
PACKAGE_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WL2SHCPU.js";
|
|
11
11
|
import {
|
|
12
12
|
SKILL_MANIFEST_FILENAME,
|
|
13
13
|
SkillsClients
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FKL5EGOW.js";
|
|
15
15
|
|
|
16
16
|
// src/skills-autosync.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -3964,13 +3964,70 @@ function formatGbpMetricLabel(metric) {
|
|
|
3964
3964
|
return GBP_METRIC_LABELS[metric] ?? humanizeMetricKey(metric);
|
|
3965
3965
|
}
|
|
3966
3966
|
|
|
3967
|
+
// ../contracts/src/answer-prose.ts
|
|
3968
|
+
var TOP_LEVEL_DOMAINS = new Set(tlds_default2.map((tld) => tld.toLowerCase()));
|
|
3969
|
+
var MARKUP_HINT = /[[【\uE200]|https?:\/\/|cite\uE202?turn/i;
|
|
3970
|
+
var LABEL = String.raw`(?:[^[\]\n]|\[[^[\]\n]{0,300}\]){0,300}`;
|
|
3971
|
+
var TARGET = String.raw`(?:[^()\s]|\([^()\s]{0,500}\))*(?:[ \t]{1,10}"[^"\n]{0,300}")?`;
|
|
3972
|
+
var INLINE_LINK = String.raw`\[${LABEL}\]\(${TARGET}\)`;
|
|
3973
|
+
var REFERENCE_LINK = String.raw`\[${LABEL}\]\[[^[\]\n]{0,100}\]`;
|
|
3974
|
+
var ANY_LINK = `(?:${INLINE_LINK}|${REFERENCE_LINK})`;
|
|
3975
|
+
var CHIP_SEPARATOR = String.raw`(?:\s{0,10}[,;&]\s{0,10}|\s{1,10}and\s{1,10}|\s{0,10})`;
|
|
3976
|
+
var PRIVATE_USE_CITATION = /\uE200(?:file)?cite\uE202[^\uE200\uE201\n]{0,500}\uE201/g;
|
|
3977
|
+
var BARE_CITE_TOKEN = /(?:file)?cite(?:turn\d{1,4}[a-z]{1,20}\d{1,4}){1,50}/gi;
|
|
3978
|
+
var LENTICULAR_CITATION = /【[^【】\n†]{0,100}†[^【】\n]{0,200}】/g;
|
|
3979
|
+
var IMAGE = new RegExp(String.raw`!\[${LABEL}\]\(${TARGET}\)`, "g");
|
|
3980
|
+
var CITATION_CHIP = new RegExp(String.raw`\(\s{0,10}${ANY_LINK}(?:${CHIP_SEPARATOR}${ANY_LINK}){0,50}\s{0,10}\)`, "g");
|
|
3981
|
+
var INLINE_LINK_CAPTURE = new RegExp(String.raw`\[(${LABEL})\]\(${TARGET}\)`, "g");
|
|
3982
|
+
var REFERENCE_LINK_CAPTURE = new RegExp(String.raw`\[(${LABEL})\]\[[^[\]\n]{0,100}\]`, "g");
|
|
3983
|
+
var FOOTNOTE_DEFINITION = /^[ \t]{0,3}\[\^[^[\]\n]{1,100}\]:[^\n]*/gm;
|
|
3984
|
+
var REFERENCE_DEFINITION = /^[ \t]{0,3}\[[^[\]\n]{1,100}\]:[ \t]*<?(?:https?:\/\/|www\.|[\p{L}\p{N}-]{1,63}\.[\p{L}\p{N}.-]{1,253}(?=[/?#>\s]|$))[^\n]*/gimu;
|
|
3985
|
+
var FOOTNOTE_MARKER = /\[\^[^[\]\s]{1,100}\]/g;
|
|
3986
|
+
var NUMERIC_MARKER = /\[\d{1,3}(?:[ \t]{0,3}[,–-][ \t]{0,3}\d{1,3}){0,20}(?:†[^[\]\n]{0,100})?\]/g;
|
|
3987
|
+
var URL_CHAR = String.raw`[\w\-.~:/?#@!$&*+,;=%]`;
|
|
3988
|
+
var BARE_URL = new RegExp(String.raw`\bhttps?:\/\/(?:${URL_CHAR}|\(${URL_CHAR}{0,500}\))+`, "gi");
|
|
3989
|
+
var CITATION_WORD = /^(?:\d{1,3}|sources?|links?|refs?|citations?)$/i;
|
|
3990
|
+
var LABEL_DECORATION_START = /^[\s*_`"'[\]^()]+/;
|
|
3991
|
+
var LABEL_DECORATION_END = /[\s*_`"'[\]()]+$/;
|
|
3992
|
+
var HOST_LABEL = /^[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?$/u;
|
|
3993
|
+
function isSourceAddress(value) {
|
|
3994
|
+
if (/\s/.test(value)) return false;
|
|
3995
|
+
if (/^(?:https?:\/\/|www\.)/i.test(value)) return true;
|
|
3996
|
+
const pathStart = value.search(/[/?#:]/);
|
|
3997
|
+
const host = (pathStart === -1 ? value : value.slice(0, pathStart)).replace(/\.$/, "");
|
|
3998
|
+
const labels = host.split(".");
|
|
3999
|
+
if (labels.length < 2) return false;
|
|
4000
|
+
if (!labels.every((label) => HOST_LABEL.test(label))) return false;
|
|
4001
|
+
if (!TOP_LEVEL_DOMAINS.has(labels[labels.length - 1].toLowerCase())) return false;
|
|
4002
|
+
return pathStart !== -1 || host === host.toLowerCase();
|
|
4003
|
+
}
|
|
4004
|
+
function isCitationLabel(label) {
|
|
4005
|
+
const core = label.replace(LABEL_DECORATION_START, "").replace(LABEL_DECORATION_END, "");
|
|
4006
|
+
if (core === "") return true;
|
|
4007
|
+
if (CITATION_WORD.test(core)) return true;
|
|
4008
|
+
return isSourceAddress(core);
|
|
4009
|
+
}
|
|
4010
|
+
function keepProseLabel(_match, label) {
|
|
4011
|
+
return isCitationLabel(label) ? " " : label;
|
|
4012
|
+
}
|
|
4013
|
+
function answerProseForMentions(text) {
|
|
4014
|
+
if (text == null) return null;
|
|
4015
|
+
if (!MARKUP_HINT.test(text)) return text;
|
|
4016
|
+
return text.replace(PRIVATE_USE_CITATION, " ").replace(BARE_CITE_TOKEN, " ").replace(LENTICULAR_CITATION, " ").replace(IMAGE, " ").replace(CITATION_CHIP, " ").replace(INLINE_LINK_CAPTURE, keepProseLabel).replace(REFERENCE_LINK_CAPTURE, keepProseLabel).replace(FOOTNOTE_DEFINITION, " ").replace(REFERENCE_DEFINITION, " ").replace(FOOTNOTE_MARKER, " ").replace(NUMERIC_MARKER, " ").replace(BARE_URL, " ");
|
|
4017
|
+
}
|
|
4018
|
+
function stripCitationChips(text) {
|
|
4019
|
+
if (!text.includes("](") && !text.includes("][")) return text;
|
|
4020
|
+
return text.replace(CITATION_CHIP, " ");
|
|
4021
|
+
}
|
|
4022
|
+
|
|
3967
4023
|
// ../contracts/src/answer-visibility.ts
|
|
3968
4024
|
var MIN_DOMAIN_BRAND_KEY_LENGTH = 4;
|
|
3969
4025
|
function extractAnswerMentions(answerText, brandNames, domains, answerDomains) {
|
|
3970
4026
|
if (!answerText) return { mentioned: false, matchedTerms: [] };
|
|
4027
|
+
const prose = answerProseForMentions(answerText);
|
|
3971
4028
|
const matchedTerms = [];
|
|
3972
4029
|
const matchedDomainTerms = /* @__PURE__ */ new Set();
|
|
3973
|
-
const extractedAnswerDomains = answerDomains ?? extractDomainsFromText(
|
|
4030
|
+
const extractedAnswerDomains = answerDomains ?? extractDomainsFromText(prose);
|
|
3974
4031
|
for (const domain of domains) {
|
|
3975
4032
|
const normalizedDomain = hostOf(domain);
|
|
3976
4033
|
if (!normalizedDomain || !normalizedDomain.includes(".")) continue;
|
|
@@ -3993,13 +4050,19 @@ function extractAnswerMentions(answerText, brandNames, domains, answerDomains) {
|
|
|
3993
4050
|
if (candidates.length > 0) {
|
|
3994
4051
|
const hits = matchedAliasKeys(
|
|
3995
4052
|
compileBrandAliases(candidates.map((c) => c.term)),
|
|
3996
|
-
|
|
4053
|
+
prose
|
|
3997
4054
|
);
|
|
3998
4055
|
for (const candidate of candidates) {
|
|
3999
4056
|
if (hits.has(candidate.key)) matchedTerms.push(candidate.term);
|
|
4000
4057
|
}
|
|
4001
4058
|
}
|
|
4002
|
-
const
|
|
4059
|
+
const seenTerms = /* @__PURE__ */ new Set();
|
|
4060
|
+
const unique = matchedTerms.filter((term) => {
|
|
4061
|
+
const folded = term.toLowerCase();
|
|
4062
|
+
if (seenTerms.has(folded)) return false;
|
|
4063
|
+
seenTerms.add(folded);
|
|
4064
|
+
return true;
|
|
4065
|
+
});
|
|
4003
4066
|
const domainBrandKeys = new Set(
|
|
4004
4067
|
[...matchedDomainTerms].map((domain) => brandKeyFromText(brandLabelFromDomain(domain))).filter(Boolean)
|
|
4005
4068
|
);
|
|
@@ -20807,6 +20870,8 @@ export {
|
|
|
20807
20870
|
gbpReviewListResponseSchema,
|
|
20808
20871
|
gbpSummaryDtoSchema,
|
|
20809
20872
|
formatGbpMetricLabel,
|
|
20873
|
+
answerProseForMentions,
|
|
20874
|
+
stripCitationChips,
|
|
20810
20875
|
MIN_DOMAIN_BRAND_KEY_LENGTH,
|
|
20811
20876
|
extractAnswerMentions,
|
|
20812
20877
|
determineAnswerMentioned,
|
|
@@ -17,21 +17,21 @@ import {
|
|
|
17
17
|
resolveOperatorApiKeyIds,
|
|
18
18
|
runWithUsageTags,
|
|
19
19
|
saveConfigPatch
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XWBQWAVE.js";
|
|
21
21
|
import {
|
|
22
22
|
computeFactorAverages,
|
|
23
23
|
deleteSiteCrawlGraphLayout,
|
|
24
24
|
persistSiteCrawlGraphLayout,
|
|
25
25
|
prepareSiteCrawlGraphLayout,
|
|
26
26
|
recordedSharePct
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PTTVDWMN.js";
|
|
28
28
|
import {
|
|
29
29
|
CanonryMcpToolNames,
|
|
30
30
|
CliError,
|
|
31
31
|
PACKAGE_VERSION,
|
|
32
32
|
canonryMcpTools,
|
|
33
33
|
isMachineFormat
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-WL2SHCPU.js";
|
|
35
35
|
import {
|
|
36
36
|
CC_CACHE_DIR,
|
|
37
37
|
DUCKDB_SPEC,
|
|
@@ -203,7 +203,7 @@ import {
|
|
|
203
203
|
siteLivenessState,
|
|
204
204
|
toAlertView,
|
|
205
205
|
usageCounters
|
|
206
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-RHZKOXDZ.js";
|
|
207
207
|
import {
|
|
208
208
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
209
209
|
AGENT_NONE,
|
|
@@ -392,7 +392,7 @@ import {
|
|
|
392
392
|
visibilityReportRequestSchema,
|
|
393
393
|
winnabilityClassLabel,
|
|
394
394
|
withRetry
|
|
395
|
-
} from "./chunk-
|
|
395
|
+
} from "./chunk-FKL5EGOW.js";
|
|
396
396
|
|
|
397
397
|
// src/runtime-context.ts
|
|
398
398
|
function cliRuntimeContext(env = process.env, stdio = process) {
|
|
@@ -7374,7 +7374,7 @@ function nonBlank(value) {
|
|
|
7374
7374
|
return trimmed ? trimmed : void 0;
|
|
7375
7375
|
}
|
|
7376
7376
|
function resolveBuildCommit(env = process.env) {
|
|
7377
|
-
const embedded = true ? "
|
|
7377
|
+
const embedded = true ? "0d21d82ed5ceafcb71d46bb38e37ed6c2825e50b" : void 0;
|
|
7378
7378
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
7379
7379
|
}
|
|
7380
7380
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -13984,7 +13984,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
13984
13984
|
return result2;
|
|
13985
13985
|
}
|
|
13986
13986
|
async function backfillInsightsCommand(project, opts) {
|
|
13987
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
13987
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-IQA4U3RA.js");
|
|
13988
13988
|
const config = loadConfig();
|
|
13989
13989
|
const db = createClient(config.database);
|
|
13990
13990
|
migrate(db);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
siteCrawlGraphNodes,
|
|
6
6
|
siteCrawlPages,
|
|
7
7
|
siteCrawlSnapshots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RHZKOXDZ.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-
|
|
16
|
+
} from "./chunk-FKL5EGOW.js";
|
|
17
17
|
|
|
18
18
|
// src/site-audit-factors.ts
|
|
19
19
|
function recordedSharePct(factor) {
|
|
@@ -214,6 +214,7 @@ import {
|
|
|
214
214
|
aggregateHarvestedQueries,
|
|
215
215
|
aiReferralClassCounts,
|
|
216
216
|
alreadyExists,
|
|
217
|
+
answerProseForMentions,
|
|
217
218
|
apiKeyDtoSchema,
|
|
218
219
|
apiKeyListDtoSchema,
|
|
219
220
|
applyHarvestSemanticNovelty,
|
|
@@ -783,6 +784,7 @@ import {
|
|
|
783
784
|
sourceBreakdownDtoSchema,
|
|
784
785
|
sourceBreakdownQuerySchema,
|
|
785
786
|
splitList,
|
|
787
|
+
stripCitationChips,
|
|
786
788
|
sumInfraHits,
|
|
787
789
|
summarizeCheckResults,
|
|
788
790
|
summarizeRunUsage,
|
|
@@ -836,7 +838,7 @@ import {
|
|
|
836
838
|
wordpressSchemaDeployResultDtoSchema,
|
|
837
839
|
wordpressSchemaStatusResultDtoSchema,
|
|
838
840
|
wordpressStatusDtoSchema
|
|
839
|
-
} from "./chunk-
|
|
841
|
+
} from "./chunk-FKL5EGOW.js";
|
|
840
842
|
|
|
841
843
|
// src/intelligence-service.ts
|
|
842
844
|
import { eq as eq79, desc as desc34, asc as asc14, and as and66, ne as ne13, or as or18, inArray as inArray29, gte as gte21, lte as lte18, isNull as isNull14, sql as sql29, exists } from "drizzle-orm";
|
|
@@ -9495,8 +9497,9 @@ function compileCompetitiveSignalResolver(competitorDomains) {
|
|
|
9495
9497
|
...evidence.citedDomains ?? [],
|
|
9496
9498
|
...(evidence.groundingSources ?? []).map((source) => source.uri)
|
|
9497
9499
|
];
|
|
9498
|
-
const
|
|
9499
|
-
const
|
|
9500
|
+
const prose = answerProseForMentions(evidence.answerText);
|
|
9501
|
+
const answerDomains2 = evidence.answerDomains ?? extractDomainsFromText(prose);
|
|
9502
|
+
const mentionedBrandKeys = matchedAliasKeys(domainBrandMatcher, prose);
|
|
9500
9503
|
const citedCompetitorDomains = [];
|
|
9501
9504
|
const mentionedCompetitorDomains = [];
|
|
9502
9505
|
for (const identity of identities) {
|
|
@@ -9640,7 +9643,7 @@ function buildMentionShare(snapshots, options) {
|
|
|
9640
9643
|
tally.snapshotsWithAnswerText++;
|
|
9641
9644
|
if (snap.projectMentioned) tally.projectMentionSnapshots++;
|
|
9642
9645
|
if (options.competitors.length === 0) continue;
|
|
9643
|
-
const prepared = prepareBrandMatchText(text2);
|
|
9646
|
+
const prepared = prepareBrandMatchText(answerProseForMentions(text2));
|
|
9644
9647
|
for (const competitor of options.competitors) {
|
|
9645
9648
|
const matcher = competitorMatchers.get(competitor.domain);
|
|
9646
9649
|
if (matcher && matcherMatchesText(matcher, prepared)) {
|
|
@@ -9906,7 +9909,7 @@ function buildCompetitorLandscapeHistory(options) {
|
|
|
9906
9909
|
for (const candidate of frozen.values()) putCandidate(eligibleCandidates, candidate);
|
|
9907
9910
|
combined = combineMatchers([...eligibleCandidates.values()].map((candidate) => candidate.matcher));
|
|
9908
9911
|
}
|
|
9909
|
-
const matchedKeys = matchedAliasKeys(combined, text2);
|
|
9912
|
+
const matchedKeys = matchedAliasKeys(combined, answerProseForMentions(text2));
|
|
9910
9913
|
if (matchedKeys.size > 0) {
|
|
9911
9914
|
for (const candidate of eligibleCandidates.values()) {
|
|
9912
9915
|
for (const key of candidate.matcher.keys) {
|
|
@@ -13318,8 +13321,8 @@ function aliasMatchesAt(textWords, aliasWords, start) {
|
|
|
13318
13321
|
}
|
|
13319
13322
|
return true;
|
|
13320
13323
|
}
|
|
13321
|
-
function containsAnyAlias(
|
|
13322
|
-
const textWords = words(
|
|
13324
|
+
function containsAnyAlias(prose, aliases) {
|
|
13325
|
+
const textWords = words(prose);
|
|
13323
13326
|
const candidates = aliases.map(words).filter((alias2) => alias2.length > 0);
|
|
13324
13327
|
for (let start = 0; start < textWords.length; start++) {
|
|
13325
13328
|
if (candidates.some((alias2) => aliasMatchesAt(textWords, alias2, start))) return true;
|
|
@@ -13461,6 +13464,7 @@ function prepareReport(input, options = {}, detailedEvidence = true) {
|
|
|
13461
13464
|
if (!source.complete) evidenceIncomplete.add(observation.id);
|
|
13462
13465
|
observationsBySlot.set(slot.id, {
|
|
13463
13466
|
input: observation,
|
|
13467
|
+
mentionText: answerProseForMentions(observation.answerText),
|
|
13464
13468
|
slot,
|
|
13465
13469
|
bridged: isBridged,
|
|
13466
13470
|
historical: source.historical,
|
|
@@ -13496,7 +13500,7 @@ function prepareReport(input, options = {}, detailedEvidence = true) {
|
|
|
13496
13500
|
const source = sourceAttribution(url);
|
|
13497
13501
|
return source.classification === "matched" ? source.matchedTargetIds : [];
|
|
13498
13502
|
}));
|
|
13499
|
-
const mentions = resolveMentionIdentity(observation.
|
|
13503
|
+
const mentions = resolveMentionIdentity(observation.mentionText, input.targets, aliasesByFirstWord, citedTargetIds, ambiguityPatterns);
|
|
13500
13504
|
observation.mentionedTargetIds = mentions.mentioned;
|
|
13501
13505
|
observation.unknownMentionTargetIds = mentions.unknown;
|
|
13502
13506
|
observation.citedTargetIds = citedTargetIds;
|
|
@@ -13675,7 +13679,7 @@ function buildSovForSlots(slots, competitors2, projectBrandNames, projectDomain,
|
|
|
13675
13679
|
return { domain: row.domain, own: row.own, presentIn: null, of: null, reason: "aliasless" };
|
|
13676
13680
|
}
|
|
13677
13681
|
const presentIn = selected.filter((slot) => {
|
|
13678
|
-
const answer = prepared.observationsBySlot.get(slot.id)?.
|
|
13682
|
+
const answer = prepared.observationsBySlot.get(slot.id)?.mentionText;
|
|
13679
13683
|
return answer !== null && answer !== void 0 && containsAnyAlias(answer, row.aliases);
|
|
13680
13684
|
}).length;
|
|
13681
13685
|
return { domain: row.domain, own: row.own, presentIn, of: selected.length };
|
|
@@ -13872,7 +13876,7 @@ function targetMentionRate(targets, slots, answered2, indexes) {
|
|
|
13872
13876
|
}
|
|
13873
13877
|
function presenceIn(slots, aliases, prepared) {
|
|
13874
13878
|
return slots.filter((slot) => {
|
|
13875
|
-
const answer = prepared.observationsBySlot.get(slot.id)?.
|
|
13879
|
+
const answer = prepared.observationsBySlot.get(slot.id)?.mentionText;
|
|
13876
13880
|
return answer !== null && answer !== void 0 && containsAnyAlias(answer, aliases);
|
|
13877
13881
|
}).length;
|
|
13878
13882
|
}
|
|
@@ -16236,7 +16240,7 @@ function buildMentionShareInputs(opts) {
|
|
|
16236
16240
|
snapshots: opts.snapshots.map((snap) => {
|
|
16237
16241
|
const queryText = (snap.queryId ? opts.queryTextById?.get(snap.queryId) : void 0) ?? snap.queryText ?? null;
|
|
16238
16242
|
const cachedAnswerDomains = !snap.answerText || !opts.answerDomainsByText ? void 0 : opts.answerDomainsByText.get(snap.answerText) ?? (() => {
|
|
16239
|
-
const domains = extractDomainsFromText(snap.answerText);
|
|
16243
|
+
const domains = extractDomainsFromText(answerProseForMentions(snap.answerText));
|
|
16240
16244
|
opts.answerDomainsByText.set(snap.answerText, domains);
|
|
16241
16245
|
return domains;
|
|
16242
16246
|
})();
|
|
@@ -25329,7 +25333,10 @@ function frozenCompetitorMatchers(competitors2) {
|
|
|
25329
25333
|
function exactCompetitorMatchers(plan) {
|
|
25330
25334
|
return frozenCompetitorMatchers(plan.groups.flatMap((group) => group.competitors));
|
|
25331
25335
|
}
|
|
25332
|
-
function
|
|
25336
|
+
function preparedAnswerProse(answerText) {
|
|
25337
|
+
return prepareBrandMatchText(answerProseForMentions(answerText));
|
|
25338
|
+
}
|
|
25339
|
+
function competitorSignals(snapshot, matchers, preparedAnswerText = preparedAnswerProse(snapshot.answerText)) {
|
|
25333
25340
|
const mentioned = preparedAnswerText === null ? [] : [...matchers].filter(([, matcher]) => matcherMatchesText(matcher, preparedAnswerText)).map(([domain]) => domain);
|
|
25334
25341
|
const citedDomains = new Set(snapshot.citedDomains.map((value) => {
|
|
25335
25342
|
try {
|
|
@@ -25547,7 +25554,7 @@ function frozenSimpleRun(run, definition, snapshots, includeEvidence = true) {
|
|
|
25547
25554
|
}
|
|
25548
25555
|
const slotId = `slot:simple:${query.queryId}:${provider}`;
|
|
25549
25556
|
if (!slotKeys.has(slotId)) throw new Error(`Frozen simple definition has no slot for stored snapshot ${snapshot.id}`);
|
|
25550
|
-
const preparedAnswerText =
|
|
25557
|
+
const preparedAnswerText = preparedAnswerProse(snapshot.answerText);
|
|
25551
25558
|
const mentioned = snapshot.answerText !== null ? matcherMatchesText(matcher, preparedAnswerText) : snapshot.answerMentioned === true;
|
|
25552
25559
|
const competitorSignalsForSnapshot = !includeEvidence || competitors2 === null ? { mentioned: [], cited: [] } : competitorSignals(snapshot, competitors2, preparedAnswerText);
|
|
25553
25560
|
observations.push({
|
|
@@ -28971,9 +28978,10 @@ async function analyticsRoutes(app) {
|
|
|
28971
28978
|
if (match) competitorsCiting.add(match);
|
|
28972
28979
|
}
|
|
28973
28980
|
if (!s.answerText) continue;
|
|
28981
|
+
const prose = prepareBrandMatchText(answerProseForMentions(s.answerText));
|
|
28974
28982
|
for (const competitor of competitorDomains) {
|
|
28975
28983
|
const matcher = competitorMatchers.get(competitor);
|
|
28976
|
-
if (matcher && matcherMatchesText(matcher,
|
|
28984
|
+
if (matcher && matcherMatchesText(matcher, prose)) competitorsMentioned.add(competitor);
|
|
28977
28985
|
}
|
|
28978
28986
|
}
|
|
28979
28987
|
const cons = consistencyMap.get(queryId);
|
|
@@ -36093,7 +36101,7 @@ function countPeriod(snaps, competitors2, queryClassOf, classificationAvailable,
|
|
|
36093
36101
|
snaps.map((s) => ({
|
|
36094
36102
|
// Share uses current identity; named-rate counts above deliberately keep
|
|
36095
36103
|
// their historical persisted-boolean semantics.
|
|
36096
|
-
projectMentioned: s.answerText ? matcherMatchesText(projectMatcher, s.answerText) : s.answerMentioned === true,
|
|
36104
|
+
projectMentioned: s.answerText ? matcherMatchesText(projectMatcher, answerProseForMentions(s.answerText)) : s.answerMentioned === true,
|
|
36097
36105
|
answerText: s.answerText,
|
|
36098
36106
|
queryClass: queryClassOf(s)
|
|
36099
36107
|
})),
|
|
@@ -37004,7 +37012,7 @@ async function compositeRoutes(app) {
|
|
|
37004
37012
|
const answerDomainsByText = /* @__PURE__ */ new Map();
|
|
37005
37013
|
for (const snapshot of trackedLatest) {
|
|
37006
37014
|
if (snapshot.answerText && !answerDomainsByText.has(snapshot.answerText)) {
|
|
37007
|
-
answerDomainsByText.set(snapshot.answerText, extractDomainsFromText(snapshot.answerText));
|
|
37015
|
+
answerDomainsByText.set(snapshot.answerText, extractDomainsFromText(answerProseForMentions(snapshot.answerText)));
|
|
37008
37016
|
}
|
|
37009
37017
|
}
|
|
37010
37018
|
const mentionShareInputs = buildMentionShareInputs({
|
|
@@ -89351,10 +89359,11 @@ function extractRecommendedCompetitors(answerText, ownDomains, citedDomains, com
|
|
|
89351
89359
|
"whyitstandsout",
|
|
89352
89360
|
"whywechoseit"
|
|
89353
89361
|
]);
|
|
89362
|
+
const scanText = stripCitationChips(answerText);
|
|
89354
89363
|
const seen2 = /* @__PURE__ */ new Map();
|
|
89355
89364
|
for (const pattern of candidatePatterns) {
|
|
89356
89365
|
let match;
|
|
89357
|
-
while ((match = pattern.exec(
|
|
89366
|
+
while ((match = pattern.exec(scanText)) !== null) {
|
|
89358
89367
|
const candidate = cleanCandidateName(match[1]);
|
|
89359
89368
|
const candidateKey2 = brandKeyFromText(candidate);
|
|
89360
89369
|
if (!candidateKey2) continue;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PACKAGE_VERSION,
|
|
6
6
|
canonryMcpTools,
|
|
7
7
|
isMachineFormat
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WL2SHCPU.js";
|
|
9
9
|
import {
|
|
10
10
|
AGENT_PROVIDER_IDS,
|
|
11
11
|
CANONRY_NPM_PACKAGE_URL,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
skillsClientSchema,
|
|
43
43
|
upgradeCaveatFor,
|
|
44
44
|
upgradeCommandFor
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-FKL5EGOW.js";
|
|
46
46
|
|
|
47
47
|
// src/config.ts
|
|
48
48
|
import fs from "fs";
|
package/dist/cli.js
CHANGED
|
@@ -35,11 +35,11 @@ import {
|
|
|
35
35
|
trackCliCommandFinished,
|
|
36
36
|
trackEvent,
|
|
37
37
|
waitForServerRuntimeStartup
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-N2SVFXOB.js";
|
|
39
39
|
import {
|
|
40
40
|
autoSyncSkills,
|
|
41
41
|
formatAutoSyncNotice
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-ASYPQYVV.js";
|
|
43
43
|
import {
|
|
44
44
|
configExists,
|
|
45
45
|
createApiClient,
|
|
@@ -56,13 +56,13 @@ import {
|
|
|
56
56
|
saveConfig,
|
|
57
57
|
saveConfigPatch,
|
|
58
58
|
shouldPrintServeSkillsNudge
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-XWBQWAVE.js";
|
|
60
60
|
import {
|
|
61
61
|
DEFAULT_DEMO_TRUSTED_PROXIES,
|
|
62
62
|
trustedProxiesProblem,
|
|
63
63
|
trustedProxyProblem
|
|
64
64
|
} from "./chunk-RB2F4D3Z.js";
|
|
65
|
-
import "./chunk-
|
|
65
|
+
import "./chunk-PTTVDWMN.js";
|
|
66
66
|
import {
|
|
67
67
|
CliError,
|
|
68
68
|
EXIT_SYSTEM_ERROR,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
runMeasurementDraftAction,
|
|
75
75
|
systemError,
|
|
76
76
|
usageError
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-WL2SHCPU.js";
|
|
78
78
|
import {
|
|
79
79
|
CLOUDFLARE_WORKER_BINDINGS,
|
|
80
80
|
CLOUDFLARE_WORKER_GENERATED_MARKER,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
queries,
|
|
90
90
|
renderReportHtml,
|
|
91
91
|
runs
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-RHZKOXDZ.js";
|
|
93
93
|
import {
|
|
94
94
|
AdsDeliverySnapshotStatuses,
|
|
95
95
|
AdsHistoricalCampaignRollupStatuses,
|
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
visibilityCompareSelectionSchema,
|
|
188
188
|
visibilityReportRequestSchema,
|
|
189
189
|
winnabilityClassSchema
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-FKL5EGOW.js";
|
|
191
191
|
|
|
192
192
|
// src/cli.ts
|
|
193
193
|
import { pathToFileURL } from "url";
|
|
@@ -452,7 +452,7 @@ function parseDemoTrustedProxies(values) {
|
|
|
452
452
|
async function demoCommand(options) {
|
|
453
453
|
const { host, port } = parseDemoListenOptions(options);
|
|
454
454
|
const trustProxy = parseDemoTrustedProxies(options.trustProxy);
|
|
455
|
-
const { createDemoServer } = await import("./demo-server-
|
|
455
|
+
const { createDemoServer } = await import("./demo-server-VGUIDC5T.js");
|
|
456
456
|
const app = await createDemoServer({ trustProxy });
|
|
457
457
|
let stopping = false;
|
|
458
458
|
const stop = () => {
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
computeFactorAverages,
|
|
6
6
|
layoutSiteCrawlGraphInput,
|
|
7
7
|
persistSiteCrawlGraphLayout
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PTTVDWMN.js";
|
|
9
9
|
import {
|
|
10
10
|
PACKAGE_VERSION,
|
|
11
11
|
canonryMcpTools
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WL2SHCPU.js";
|
|
13
13
|
import {
|
|
14
14
|
HISTORY_WINDOW_RUNS,
|
|
15
15
|
IntelligenceService,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
siteCrawlPages,
|
|
86
86
|
siteCrawlSnapshots,
|
|
87
87
|
trafficSources
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-RHZKOXDZ.js";
|
|
89
89
|
import {
|
|
90
90
|
RunKinds,
|
|
91
91
|
SiteCrawlFetchStates,
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
roundPreservingTotal,
|
|
113
113
|
siteAuditPageFactorSchema,
|
|
114
114
|
wilsonInterval
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-FKL5EGOW.js";
|
|
116
116
|
|
|
117
117
|
// src/demo-server.ts
|
|
118
118
|
import { dirname, join as join2 } from "path";
|