@ainyc/canonry 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -15
- package/assets/assets/{AuditHistoryPanel-D5cOFMKE.js → AuditHistoryPanel-DNSskBJN.js} +1 -1
- package/assets/assets/{BacklinksPage-BiOj8ztV.js → BacklinksPage-COtLVzT8.js} +1 -1
- package/assets/assets/{HistoryPage-DDBCwooU.js → HistoryPage-D9e6cGrq.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-CMoU2yA_.js → MeasurementPropertyPage-BSs4ba4N.js} +1 -1
- package/assets/assets/ProjectPage-BbpGgwgd.js +8 -0
- package/assets/assets/{RunRow-BLBAwIot.js → RunRow-DRjXGgeI.js} +1 -1
- package/assets/assets/{RunsPage-BVgBbE1M.js → RunsPage-BXyqLNMQ.js} +1 -1
- package/assets/assets/{SettingsPage-DYtN-1_-.js → SettingsPage-DKmzGwx3.js} +1 -1
- package/assets/assets/SiteHealthSection-DuSY6jzY.js +4 -0
- package/assets/assets/{TrafficPage-D6QT_2hU.js → TrafficPage-Bc9NGm4L.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-BnLzF82w.js → TrafficSourceDetailPage-Bw8PCVl9.js} +1 -1
- package/assets/assets/{extract-error-message-DIzjGZxl.js → extract-error-message-rTGTNN_D.js} +1 -1
- package/assets/assets/index-CVK43vax.js +86 -0
- package/assets/assets/index-Hmnj0RO5.css +1 -0
- package/assets/assets/{react-sigma_core.esm.min-DTbIcdn4.js → react-sigma_core.esm.min-Xwhtf0bv.js} +1 -1
- package/assets/assets/{v2-overview-adapter-B_N4ilQV.js → v2-overview-adapter-BgGH6oLq.js} +1 -1
- package/assets/assets/vendor-lucide-CBIL4Nkq.js +1 -0
- package/assets/index.html +3 -3
- package/dist/{chunk-QAGZWYPI.js → chunk-2P52FD5B.js} +38 -11
- package/dist/{chunk-IOP36L3C.js → chunk-67OM5KEH.js} +21 -6
- package/dist/{chunk-C7PITYL3.js → chunk-L3FG66O7.js} +2 -2
- package/dist/{chunk-MNUFMEAX.js → chunk-P5YYRGFS.js} +2 -2
- package/dist/{chunk-HOOU4NS2.js → chunk-SLOTTXIL.js} +19 -7
- package/dist/{chunk-2U5IW3G5.js → chunk-Z6RA7LWY.js} +44 -2
- package/dist/cli.js +132 -65
- package/dist/{demo-server-Y7YWLPU7.js → demo-server-6QU77ZMV.js} +3 -3
- package/dist/index.js +5 -5
- package/dist/{intelligence-service-PR6T6JKY.js → intelligence-service-PHCK6A35.js} +2 -2
- package/dist/mcp.js +3 -3
- package/package.json +11 -11
- package/assets/assets/ProjectPage-CrFybBls.js +0 -8
- package/assets/assets/SiteHealthSection-ElUwcAS4.js +0 -4
- package/assets/assets/index-CoQVOsWw.js +0 -86
- package/assets/assets/index-DCLmKL1s.css +0 -1
- package/assets/assets/vendor-lucide-nVpYViBH.js +0 -1
package/assets/assets/{react-sigma_core.esm.min-DTbIcdn4.js → react-sigma_core.esm.min-Xwhtf0bv.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-DuSY6jzY.js";import"./index-CVK43vax.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-CBIL4Nkq.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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as k,j as o}from"./vendor-tanstack-ZXXkndVj.js";import{C as oe,J as le,f as Z}from"./vendor-lucide-nVpYViBH.js";import{z as ue,B as ce}from"./index-CoQVOsWw.js";import{M as de}from"./vendor-markdown-B-Oq2NYq.js";const U={queryClass:"all"},me=["all","non-brand","branded"];function ne(e){return typeof e=="string"&&me.includes(e)}function pe(e){const r=ne(e.class)?e.class:U.queryClass,s=e.scope;if(typeof s!="string"||s==="all"||s.length===0)return{scope:"all",queryClass:r};const n=s.startsWith("group:")?s.slice(6):"";return n?{scope:"group",groupKey:n,queryClass:r}:{scope:"all",queryClass:r}}function Ie(e,r){return r===null||e===null?!1:e!==r}function $e(e){return{scope:e.scope==="group"&&e.groupKey?`group:${e.groupKey}`:void 0,class:e.queryClass===U.queryClass?void 0:e.queryClass}}function ge(e,r){if(!(typeof e!="string"||e.length>16384||!r))try{const s=JSON.parse(e);if(typeof s!="object"||s===null||Array.isArray(s))return;const n=s,m=d=>typeof d=="string"&&d.trim().length>0,i=d=>d===null||m(d);return n.queryKey!==r||!m(n.provider)||n.queryClass!=="branded"&&n.queryClass!=="non-brand"&&n.queryClass!=="unknown"||!i(n.model)||!i(n.location)||!i(n.runId)||n.revision!==null&&(typeof n.revision!="number"||!Number.isSafeInteger(n.revision)||n.revision<=0)?void 0:{queryKey:r,queryClass:n.queryClass,provider:n.provider,model:n.model,location:n.location,runId:n.runId,revision:n.revision}}catch{return}}function Ae(e){const r=y=>typeof e[y]=="string"&&e[y]!==""?e[y]:void 0,s=pe({scope:r("scope"),class:r("class")}),n=r("measurementScope")??(s.scope==="group"?"group":"project"),m=r("measurementScopeKey")??(r("measurementScope")?void 0:s.groupKey),i=r("queryClass")??r("class"),d={measurementScope:m&&(n==="group"||n==="market"||n==="property")?n:"project",queryClass:i==="unknown"||ne(i)?i:U.queryClass};d.measurementScope!=="project"&&(d.measurementScopeKey=m);for(const[y,K]of[["measurementMarketKey","marketKey"],["measurementProvider","provider"],["measurementModel","model"],["measurementLocation","location"],["measurementFrom","from"],["measurementTo","to"],["measurementRunId","measurementRunId"],["measurementQueryKey","queryKey"]]){const b=r(y);b!==void 0&&(d[K]=b)}const l=Number(e.measurementRevision);Number.isSafeInteger(l)&&l>0&&(d.revision=l);const f=ge(e.measurementAnswer,d.queryKey);return f&&(d.answer=f),d}function Ee(e,r){const s={...e,...r};return["measurementScope","measurementScopeKey","measurementMarketKey","queryClass","measurementProvider","measurementModel","measurementLocation","measurementFrom","measurementTo","measurementRevision","measurementRunId"].some(n=>n in r)?(s.measurementQueryKey=r.measurementQueryKey,s.measurementAnswer=r.measurementAnswer):"measurementQueryKey"in r&&!("measurementAnswer"in r)&&(s.measurementAnswer=void 0),"measurementScope"in r&&(s.scope=void 0,"measurementMarketKey"in r||(s.measurementMarketKey=void 0),s.measurementQueryKey=void 0,r.measurementScope==="project"&&(s.measurementScopeKey=void 0)),"queryClass"in r&&(s.class=void 0),s}function we(e){return{...e,onboarding:void 0,manageQueries:void 0,siteHealthRunId:void 0,siteScan:void 0,setupProject:void 0}}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",Q="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",A=e=>e.kind==="project"?"Whole site":e.label,E={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},fe=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Re({options:e,selected:r,onSelect:s,marketKey:n,label:m="Measurement scope",allowGroupSelect:i=!0}){const d=[...e].sort((t,c)=>t.label.localeCompare(c.label,void 0,{numeric:!0})||t.id.localeCompare(c.id)),[l,f]=k.useState(""),[y,K]=k.useState([]),[b,C]=k.useState(!1),x=k.useRef(null),v=k.useRef(null),q=k.useId(),a=d.filter(t=>t.kind==="group"),g=new Map(a.map(t=>[t.id,t])),u=g.get(y.at(-1)??""),S=g.get(y.at(-2)??""),h=l.trim().toLocaleLowerCase(),se=a.filter(t=>!t.parentGroupIds?.some(c=>g.has(c))),_=d.filter(t=>t.kind==="property"),L=t=>(t.parentGroupIds??[]).map(c=>g.get(c)?.label).filter(Boolean).join(" · "),w=t=>`${A(t)} ${L(t)}`.toLocaleLowerCase().includes(h),D=t=>{const c=[...t.parentGroupIds??[]],p=new Set;for(;c.length;){const j=c.pop();if(j===u?.id)return!0;p.has(j)||(p.add(j),c.push(...g.get(j)?.parentGroupIds??[]))}return!1},M=(b?[]:u?a.filter(t=>h?D(t):t.parentGroupIds?.includes(u.id)):h?a:se).filter(w),I=d.find(t=>t.kind==="market"&&t.id===(n??(r.kind==="market"?r.id:void 0))),F=u&&I&&(u.marketKeys?.includes(I.id)||I.parentGroupIds?.includes(u.id))?I.id:void 0,V=i?F??fe(u):void 0,O=(u?_.filter(t=>t.parentGroupIds?.includes(u.id)&&(!V||t.marketKeys?.includes(V))):h||b||a.length===0?_:[]).filter(w),W=d.filter(t=>t.kind!=="market"||b||!i&&!u&&!h&&a.length>0||i&&u?.marketKeys?.length===1&&!h?!1:(u?h?D(t):t.parentGroupIds?.includes(u.id):h||!t.parentGroupIds?.some(p=>g.has(p)))&&w(t)),H=u||b?[]:d.filter(t=>t.kind==="project"&&w(t));k.useEffect(()=>{const t=c=>{x.current?.open&&c.target instanceof Node&&!x.current.contains(c.target)&&(x.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const ae=t=>{x.current&&(x.current.open=!1,x.current.querySelector("summary")?.focus());const c=i?t.kind==="property"?V:t.kind==="group"&&t.id===u?.id?F:void 0:void 0;c?s(t,c):s(t)},R=t=>{const c=[];let p=g.get(t.parentGroupIds?.[0]??"");for(;p&&!c.includes(p.id)&&p.id!==t.id;)c.unshift(p.id),p=g.get(p.parentGroupIds?.[0]??"");return[...c,t.id]},ie=()=>{const t=r.kind==="group"?g.get(r.id):void 0,c=g.get(I?.parentGroupIds?.[0]??""),p=(r.parentGroupIds??[]).flatMap($=>{const P=g.get($);return P?[R(P)]:[]}),j=p.find($=>$.at(-1)===u?.id)??p.sort(($,P)=>P.length-$.length)[0]??[],J=c?R(c):r.marketKeys?.length?[]:j;K(t?R(t):J),C(r.kind==="property"&&J.length===0&&a.length>0),f("")},z=t=>{K(R(t)),C(!1),f(""),v.current?.focus()},T=(t,c=A(t))=>o.jsxs("div",{className:"flex items-stretch",children:[o.jsxs("button",{type:"button",className:Q,"aria-label":t.kind==="group"&&!i?E.browse(A(t)):E.select(A(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!i?z(t):ae(t),children:[o.jsxs("span",{className:"min-w-0 break-words",children:[c,h&&L(t)?o.jsx("span",{className:"block text-[13px] text-secondary",children:L(t)}):null]}),o.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?i?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),i&&t.kind==="group"&&t.id!==u?.id&&d.some(p=>p.parentGroupIds?.includes(t.id))?o.jsx("button",{type:"button","aria-label":E.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:()=>z(t),children:o.jsx(Z,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,c)=>c.length>0?o.jsxs("section",{"aria-label":t,className:"mt-2",children:[o.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),c.map(p=>T(p))]}):null,Y=(t,c,p)=>c.length>0?o.jsxs("details",{open:p,className:"mt-2 border-y border-default",children:[o.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," (",c.length,")"]}),c.map(j=>T(j))]},`${u?.id??"root"}:${t}`):null;return o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{id:`${q}-label`,className:"mb-1 block text-sm font-medium text-heading",children:m}),o.jsxs("details",{ref:x,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:[o.jsxs("summary",{id:`${q}-value`,"aria-labelledby":`${q}-label ${q}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{x.current?.open||ie()},children:[`${A(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${d.find(t=>t.kind==="market"&&t.id===n)?.label??(r.marketKeys?.length?E.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,o.jsx(oe,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),o.jsxs("div",{className:"visibility-scope-menu",children:[u||b?o.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[o.jsx("button",{type:"button",className:Q,"aria-label":`Back to ${S?.label??"all groups"}`,onClick:()=>{K(y.slice(0,-1)),C(!1),f(""),v.current?.focus()},children:o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(le,{size:16,"aria-hidden":"true"}),S?.label??"All groups"]})}),o.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:u?.label??"All properties"})]}):null,o.jsx("input",{ref:v,type:"search","aria-label":"Search scopes",className:X,placeholder:u?"Search within this group":b?"Search properties":"Search groups or properties",value:l,onChange:t=>f(t.target.value)}),o.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[i&&u&&!h?T(u,"All properties in this group"):null,H.map(t=>T(t)),u&&!h?Y("Subgroups",M,!0):G(u?"Subgroups":"Groups",M),h?G("Properties",O):Y(u&&M.length>0?"All properties":"Properties",O,!u||M.length===0),G("Markets",W),!u&&!b&&!h&&a.length>0&&_.length>0?o.jsxs("button",{type:"button",className:`${Q} mt-2 border-t border-default`,"aria-label":E.browseAll,onClick:()=>{C(!0),v.current?.focus()},children:[o.jsx("span",{children:"All properties"}),o.jsx(Z,{size:18,"aria-hidden":"true"})]}):null,h&&M.length+O.length+W.length+H.length===0?o.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}const Te="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function ye({headingLevel:e}){return r=>{const s=[],n=i=>{i.type==="heading"&&i.depth&&s.push(i),i.children?.forEach(n)};n(r);const m=s.reduce((i,d)=>Math.min(i,d.depth),6);for(const i of s){const d=i.depth-m;i.depth=Math.min(6,e+d),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":d+1}}}}}function he({answer:e}){const[r,s]=k.useState("idle"),n=k.useRef(!1),m=async()=>{if(!n.current){n.current=!0,s("copying");try{await navigator.clipboard.writeText(e),s("copied")}catch{s("failed")}finally{n.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(ce,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{m()},children:r==="copying"?B.copying:B.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}function Pe({children:e,headingLevel:r=4,copyable:s=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx(de,{remarkPlugins:[[ye,{headingLevel:r}]],components:{p:({children:n})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:m})=>o.jsx("ol",{start:m,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),a:({children:n,href:m})=>{const i=ue(m);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):o.jsx("span",{children:n})},img:({alt:n})=>o.jsx("span",{children:n})},children:e}),s&&e.trim()?o.jsx(he,{answer:e},e):null]})}function Be(e){const r=e[0];return r?e.every(s=>s.mode===r.mode&&s.scope.kind===r.scope.kind&&s.scope.key===r.scope.key&&s.queryClass===r.queryClass&&s.measurement.displayedRunId===r.measurement.displayedRunId):!0}function N(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 be(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function xe(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function ke(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function Ce(e,r,s){const n=new Map;if(!r)return n;const m=new Map(e.usageEdges.map(l=>[te(l),l.targetKey])),i=new Map(e.assignments.map(l=>[`${l.targetKey}:${l.queryId}`,l.queryClass])),d=new Map(e.usageEdges.map(l=>[te(l),i.get(`${l.targetKey}:${l.queryId}`)]));for(const l of r.evidence){if(s&&d.get(l.usageEdgeId)!==s)continue;const f=m.get(l.usageEdgeId);if(!f)continue;const y=n.get(f)??[];y.push({id:`${l.observationId}:${l.expectedSlotId}:${l.usageEdgeId}:${l.sourceUrl}`,kind:xe(l.classification),query:l.queryText,provider:l.provider,location:l.location,url:l.sourceUrl,tone:ke(l.classification),historical:l.historical||l.bridged}),n.set(f,y)}return n}function ve(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(s=>s.state==="unavailable").map(s=>s.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function Se(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 je(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function _e({overview:e,activePlan:r,report:s,reportState:n=s?"ready":"loading",sort:m}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=r.plan,d=new Map(i.targets.map(a=>[a.stableKey,a])),l=new Map(i.querySnapshots.map(a=>[a.queryId,a.queryText])),f=new Map;for(const a of i.assignments){if(e.queryClass!=="all"&&a.queryClass!==e.queryClass)continue;const g=l.get(a.queryId);if(!g)continue;const u=f.get(a.targetKey)??new Set;u.add(g),f.set(a.targetKey,u)}const y=s?.revision===r.revision&&s.run?.id===e.measurement.displayedRunId?s:null,K=e.measurement.displayedRunId===void 0||y?"ready":n==="error"||s!=null?"error":"loading",b=Ce(i,y,e.queryClass==="all"?void 0:e.queryClass),C=new Map;for(const a of i.groups)for(const g of a.targetKeys)C.has(g)||C.set(g,a.label);const x=e.properties.items.map(a=>{const g=d.get(a.targetKey),u=b.get(a.targetKey)??[];return{id:a.targetKey,name:a.label,mentionCoverage:N(a.mentionCoverage),citationCoverage:N(a.citationCoverage),status:ve(a),providers:a.providers?.map(S=>({provider:S.provider,mentionCoverage:N(S.mentionCoverage),citationCoverage:N(S.citationCoverage)})),market:C.get(a.targetKey),assignedQueries:[...f.get(a.targetKey)??[]],urls:g?.urlMatchers.map(be)??[],evidence:u,evidenceState:K,historical:u.some(S=>S.historical)}}),v=e.namedShareOfVoice?.entries.map(a=>({name:a.label,coverage:{numerator:a.credits,denominator:e.namedShareOfVoice.denominator}})),q=e.properties.items.flatMap(a=>a.flags>0?[{id:`property:${a.targetKey}`,property:a.label,summary:`${a.flags} ${a.flags===1?"result needs":"results need"} review.`,tone:"caution",count:a.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:Se(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:je(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:N(e.metrics.propertiesMentioned),mentionCoverage:N(e.metrics.mentionCoverage),citationCoverage:N(e.metrics.citationCoverage)},properties:x,...v?{shareOfVoice:v}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...m?{sort:m}:{}},availableGroups:i.groups.map(a=>({id:a.stableKey,label:a.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:q}}export{Pe as A,E as M,Re as V,Te as a,Ee as b,pe as c,Be as d,_e as e,we as f,be as g,$e as m,Ae as p,Ie as s};
|
|
1
|
+
import{r as k,j as o}from"./vendor-tanstack-ZXXkndVj.js";import{C as oe,Y as le,f as Z}from"./vendor-lucide-CBIL4Nkq.js";import{z as ue,B as ce}from"./index-CVK43vax.js";import{M as de}from"./vendor-markdown-B-Oq2NYq.js";const U={queryClass:"all"},me=["all","non-brand","branded"];function ne(e){return typeof e=="string"&&me.includes(e)}function pe(e){const r=ne(e.class)?e.class:U.queryClass,s=e.scope;if(typeof s!="string"||s==="all"||s.length===0)return{scope:"all",queryClass:r};const n=s.startsWith("group:")?s.slice(6):"";return n?{scope:"group",groupKey:n,queryClass:r}:{scope:"all",queryClass:r}}function Ie(e,r){return r===null||e===null?!1:e!==r}function $e(e){return{scope:e.scope==="group"&&e.groupKey?`group:${e.groupKey}`:void 0,class:e.queryClass===U.queryClass?void 0:e.queryClass}}function ge(e,r){if(!(typeof e!="string"||e.length>16384||!r))try{const s=JSON.parse(e);if(typeof s!="object"||s===null||Array.isArray(s))return;const n=s,m=d=>typeof d=="string"&&d.trim().length>0,i=d=>d===null||m(d);return n.queryKey!==r||!m(n.provider)||n.queryClass!=="branded"&&n.queryClass!=="non-brand"&&n.queryClass!=="unknown"||!i(n.model)||!i(n.location)||!i(n.runId)||n.revision!==null&&(typeof n.revision!="number"||!Number.isSafeInteger(n.revision)||n.revision<=0)?void 0:{queryKey:r,queryClass:n.queryClass,provider:n.provider,model:n.model,location:n.location,runId:n.runId,revision:n.revision}}catch{return}}function Ae(e){const r=y=>typeof e[y]=="string"&&e[y]!==""?e[y]:void 0,s=pe({scope:r("scope"),class:r("class")}),n=r("measurementScope")??(s.scope==="group"?"group":"project"),m=r("measurementScopeKey")??(r("measurementScope")?void 0:s.groupKey),i=r("queryClass")??r("class"),d={measurementScope:m&&(n==="group"||n==="market"||n==="property")?n:"project",queryClass:i==="unknown"||ne(i)?i:U.queryClass};d.measurementScope!=="project"&&(d.measurementScopeKey=m);for(const[y,K]of[["measurementMarketKey","marketKey"],["measurementProvider","provider"],["measurementModel","model"],["measurementLocation","location"],["measurementFrom","from"],["measurementTo","to"],["measurementRunId","measurementRunId"],["measurementQueryKey","queryKey"]]){const b=r(y);b!==void 0&&(d[K]=b)}const l=Number(e.measurementRevision);Number.isSafeInteger(l)&&l>0&&(d.revision=l);const f=ge(e.measurementAnswer,d.queryKey);return f&&(d.answer=f),d}function Ee(e,r){const s={...e,...r};return["measurementScope","measurementScopeKey","measurementMarketKey","queryClass","measurementProvider","measurementModel","measurementLocation","measurementFrom","measurementTo","measurementRevision","measurementRunId"].some(n=>n in r)?(s.measurementQueryKey=r.measurementQueryKey,s.measurementAnswer=r.measurementAnswer):"measurementQueryKey"in r&&!("measurementAnswer"in r)&&(s.measurementAnswer=void 0),"measurementScope"in r&&(s.scope=void 0,"measurementMarketKey"in r||(s.measurementMarketKey=void 0),s.measurementQueryKey=void 0,r.measurementScope==="project"&&(s.measurementScopeKey=void 0)),"queryClass"in r&&(s.class=void 0),s}function we(e){return{...e,onboarding:void 0,manageQueries:void 0,siteHealthRunId:void 0,siteScan:void 0,setupProject:void 0}}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",Q="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",A=e=>e.kind==="project"?"Whole site":e.label,E={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},fe=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Re({options:e,selected:r,onSelect:s,marketKey:n,label:m="Measurement scope",allowGroupSelect:i=!0}){const d=[...e].sort((t,c)=>t.label.localeCompare(c.label,void 0,{numeric:!0})||t.id.localeCompare(c.id)),[l,f]=k.useState(""),[y,K]=k.useState([]),[b,C]=k.useState(!1),x=k.useRef(null),v=k.useRef(null),q=k.useId(),a=d.filter(t=>t.kind==="group"),g=new Map(a.map(t=>[t.id,t])),u=g.get(y.at(-1)??""),S=g.get(y.at(-2)??""),h=l.trim().toLocaleLowerCase(),se=a.filter(t=>!t.parentGroupIds?.some(c=>g.has(c))),_=d.filter(t=>t.kind==="property"),L=t=>(t.parentGroupIds??[]).map(c=>g.get(c)?.label).filter(Boolean).join(" · "),w=t=>`${A(t)} ${L(t)}`.toLocaleLowerCase().includes(h),D=t=>{const c=[...t.parentGroupIds??[]],p=new Set;for(;c.length;){const j=c.pop();if(j===u?.id)return!0;p.has(j)||(p.add(j),c.push(...g.get(j)?.parentGroupIds??[]))}return!1},M=(b?[]:u?a.filter(t=>h?D(t):t.parentGroupIds?.includes(u.id)):h?a:se).filter(w),I=d.find(t=>t.kind==="market"&&t.id===(n??(r.kind==="market"?r.id:void 0))),F=u&&I&&(u.marketKeys?.includes(I.id)||I.parentGroupIds?.includes(u.id))?I.id:void 0,V=i?F??fe(u):void 0,O=(u?_.filter(t=>t.parentGroupIds?.includes(u.id)&&(!V||t.marketKeys?.includes(V))):h||b||a.length===0?_:[]).filter(w),W=d.filter(t=>t.kind!=="market"||b||!i&&!u&&!h&&a.length>0||i&&u?.marketKeys?.length===1&&!h?!1:(u?h?D(t):t.parentGroupIds?.includes(u.id):h||!t.parentGroupIds?.some(p=>g.has(p)))&&w(t)),H=u||b?[]:d.filter(t=>t.kind==="project"&&w(t));k.useEffect(()=>{const t=c=>{x.current?.open&&c.target instanceof Node&&!x.current.contains(c.target)&&(x.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const ae=t=>{x.current&&(x.current.open=!1,x.current.querySelector("summary")?.focus());const c=i?t.kind==="property"?V:t.kind==="group"&&t.id===u?.id?F:void 0:void 0;c?s(t,c):s(t)},R=t=>{const c=[];let p=g.get(t.parentGroupIds?.[0]??"");for(;p&&!c.includes(p.id)&&p.id!==t.id;)c.unshift(p.id),p=g.get(p.parentGroupIds?.[0]??"");return[...c,t.id]},ie=()=>{const t=r.kind==="group"?g.get(r.id):void 0,c=g.get(I?.parentGroupIds?.[0]??""),p=(r.parentGroupIds??[]).flatMap($=>{const P=g.get($);return P?[R(P)]:[]}),j=p.find($=>$.at(-1)===u?.id)??p.sort(($,P)=>P.length-$.length)[0]??[],J=c?R(c):r.marketKeys?.length?[]:j;K(t?R(t):J),C(r.kind==="property"&&J.length===0&&a.length>0),f("")},z=t=>{K(R(t)),C(!1),f(""),v.current?.focus()},T=(t,c=A(t))=>o.jsxs("div",{className:"flex items-stretch",children:[o.jsxs("button",{type:"button",className:Q,"aria-label":t.kind==="group"&&!i?E.browse(A(t)):E.select(A(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!i?z(t):ae(t),children:[o.jsxs("span",{className:"min-w-0 break-words",children:[c,h&&L(t)?o.jsx("span",{className:"block text-[13px] text-secondary",children:L(t)}):null]}),o.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?i?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),i&&t.kind==="group"&&t.id!==u?.id&&d.some(p=>p.parentGroupIds?.includes(t.id))?o.jsx("button",{type:"button","aria-label":E.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:()=>z(t),children:o.jsx(Z,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,c)=>c.length>0?o.jsxs("section",{"aria-label":t,className:"mt-2",children:[o.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),c.map(p=>T(p))]}):null,Y=(t,c,p)=>c.length>0?o.jsxs("details",{open:p,className:"mt-2 border-y border-default",children:[o.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," (",c.length,")"]}),c.map(j=>T(j))]},`${u?.id??"root"}:${t}`):null;return o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{id:`${q}-label`,className:"mb-1 block text-sm font-medium text-heading",children:m}),o.jsxs("details",{ref:x,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:[o.jsxs("summary",{id:`${q}-value`,"aria-labelledby":`${q}-label ${q}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{x.current?.open||ie()},children:[`${A(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${d.find(t=>t.kind==="market"&&t.id===n)?.label??(r.marketKeys?.length?E.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,o.jsx(oe,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),o.jsxs("div",{className:"visibility-scope-menu",children:[u||b?o.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[o.jsx("button",{type:"button",className:Q,"aria-label":`Back to ${S?.label??"all groups"}`,onClick:()=>{K(y.slice(0,-1)),C(!1),f(""),v.current?.focus()},children:o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(le,{size:16,"aria-hidden":"true"}),S?.label??"All groups"]})}),o.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:u?.label??"All properties"})]}):null,o.jsx("input",{ref:v,type:"search","aria-label":"Search scopes",className:X,placeholder:u?"Search within this group":b?"Search properties":"Search groups or properties",value:l,onChange:t=>f(t.target.value)}),o.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[i&&u&&!h?T(u,"All properties in this group"):null,H.map(t=>T(t)),u&&!h?Y("Subgroups",M,!0):G(u?"Subgroups":"Groups",M),h?G("Properties",O):Y(u&&M.length>0?"All properties":"Properties",O,!u||M.length===0),G("Markets",W),!u&&!b&&!h&&a.length>0&&_.length>0?o.jsxs("button",{type:"button",className:`${Q} mt-2 border-t border-default`,"aria-label":E.browseAll,onClick:()=>{C(!0),v.current?.focus()},children:[o.jsx("span",{children:"All properties"}),o.jsx(Z,{size:18,"aria-hidden":"true"})]}):null,h&&M.length+O.length+W.length+H.length===0?o.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}const Te="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function ye({headingLevel:e}){return r=>{const s=[],n=i=>{i.type==="heading"&&i.depth&&s.push(i),i.children?.forEach(n)};n(r);const m=s.reduce((i,d)=>Math.min(i,d.depth),6);for(const i of s){const d=i.depth-m;i.depth=Math.min(6,e+d),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":d+1}}}}}function he({answer:e}){const[r,s]=k.useState("idle"),n=k.useRef(!1),m=async()=>{if(!n.current){n.current=!0,s("copying");try{await navigator.clipboard.writeText(e),s("copied")}catch{s("failed")}finally{n.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(ce,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{m()},children:r==="copying"?B.copying:B.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}function Pe({children:e,headingLevel:r=4,copyable:s=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx(de,{remarkPlugins:[[ye,{headingLevel:r}]],components:{p:({children:n})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:m})=>o.jsx("ol",{start:m,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),a:({children:n,href:m})=>{const i=ue(m);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):o.jsx("span",{children:n})},img:({alt:n})=>o.jsx("span",{children:n})},children:e}),s&&e.trim()?o.jsx(he,{answer:e},e):null]})}function Be(e){const r=e[0];return r?e.every(s=>s.mode===r.mode&&s.scope.kind===r.scope.kind&&s.scope.key===r.scope.key&&s.queryClass===r.queryClass&&s.measurement.displayedRunId===r.measurement.displayedRunId):!0}function N(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 be(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function xe(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function ke(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function Ce(e,r,s){const n=new Map;if(!r)return n;const m=new Map(e.usageEdges.map(l=>[te(l),l.targetKey])),i=new Map(e.assignments.map(l=>[`${l.targetKey}:${l.queryId}`,l.queryClass])),d=new Map(e.usageEdges.map(l=>[te(l),i.get(`${l.targetKey}:${l.queryId}`)]));for(const l of r.evidence){if(s&&d.get(l.usageEdgeId)!==s)continue;const f=m.get(l.usageEdgeId);if(!f)continue;const y=n.get(f)??[];y.push({id:`${l.observationId}:${l.expectedSlotId}:${l.usageEdgeId}:${l.sourceUrl}`,kind:xe(l.classification),query:l.queryText,provider:l.provider,location:l.location,url:l.sourceUrl,tone:ke(l.classification),historical:l.historical||l.bridged}),n.set(f,y)}return n}function ve(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(s=>s.state==="unavailable").map(s=>s.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function Se(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 je(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function _e({overview:e,activePlan:r,report:s,reportState:n=s?"ready":"loading",sort:m}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=r.plan,d=new Map(i.targets.map(a=>[a.stableKey,a])),l=new Map(i.querySnapshots.map(a=>[a.queryId,a.queryText])),f=new Map;for(const a of i.assignments){if(e.queryClass!=="all"&&a.queryClass!==e.queryClass)continue;const g=l.get(a.queryId);if(!g)continue;const u=f.get(a.targetKey)??new Set;u.add(g),f.set(a.targetKey,u)}const y=s?.revision===r.revision&&s.run?.id===e.measurement.displayedRunId?s:null,K=e.measurement.displayedRunId===void 0||y?"ready":n==="error"||s!=null?"error":"loading",b=Ce(i,y,e.queryClass==="all"?void 0:e.queryClass),C=new Map;for(const a of i.groups)for(const g of a.targetKeys)C.has(g)||C.set(g,a.label);const x=e.properties.items.map(a=>{const g=d.get(a.targetKey),u=b.get(a.targetKey)??[];return{id:a.targetKey,name:a.label,mentionCoverage:N(a.mentionCoverage),citationCoverage:N(a.citationCoverage),status:ve(a),providers:a.providers?.map(S=>({provider:S.provider,mentionCoverage:N(S.mentionCoverage),citationCoverage:N(S.citationCoverage)})),market:C.get(a.targetKey),assignedQueries:[...f.get(a.targetKey)??[]],urls:g?.urlMatchers.map(be)??[],evidence:u,evidenceState:K,historical:u.some(S=>S.historical)}}),v=e.namedShareOfVoice?.entries.map(a=>({name:a.label,coverage:{numerator:a.credits,denominator:e.namedShareOfVoice.denominator}})),q=e.properties.items.flatMap(a=>a.flags>0?[{id:`property:${a.targetKey}`,property:a.label,summary:`${a.flags} ${a.flags===1?"result needs":"results need"} review.`,tone:"caution",count:a.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:Se(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:je(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:N(e.metrics.propertiesMentioned),mentionCoverage:N(e.metrics.mentionCoverage),citationCoverage:N(e.metrics.citationCoverage)},properties:x,...v?{shareOfVoice:v}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...m?{sort:m}:{}},availableGroups:i.groups.map(a=>({id:a.stableKey,label:a.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:q}}export{Pe as A,E as M,Re as V,Te as a,Ee as b,pe as c,Be as d,_e as e,we as f,be as g,$e as m,Ae as p,Ie as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h}from"./vendor-tanstack-ZXXkndVj.js";const _=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,c)=>c?c.toUpperCase():o.toLowerCase()),y=a=>{const t=M(a);return t.charAt(0).toUpperCase()+t.slice(1)},r=(...a)=>a.filter((t,o,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===o).join(" ").trim(),m=a=>{for(const t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=h.forwardRef(({color:a="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:s="",children:n,iconNode:i,...d},k)=>h.createElement("svg",{ref:k,...v,width:t,height:t,stroke:a,strokeWidth:c?Number(o)*24/Number(t):o,className:r("lucide",s),...!n&&!m(d)&&{"aria-hidden":"true"},...d},[...i.map(([p,l])=>h.createElement(p,l)),...Array.isArray(n)?n:[n]]));const e=(a,t)=>{const o=h.forwardRef(({className:c,...s},n)=>h.createElement(x,{ref:n,iconNode:t,className:r(`lucide-${_(y(a))}`,`lucide-${a}`,c),...s}));return o.displayName=y(a),o};const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],u1=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],g1=e("arrow-right",g);const w=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],w1=e("arrow-up-right",w);const N=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],N1=e("arrow-up",N);const $=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],$1=e("bell",$);const f=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],f1=e("book-open",f);const z=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],z1=e("calendar-clock",z);const q=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],q1=e("chart-line",q);const C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],C1=e("check",C);const b=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],b1=e("chevron-down",b);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],A1=e("chevron-left",A);const j=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],j1=e("chevron-right",j);const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L1=e("circle-check",L);const H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],H1=e("circle-question-mark",H);const V=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],V1=e("cloud",V);const R=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],R1=e("copy",R);const P=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],P1=e("download",P);const Z=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Z1=e("external-link",Z);const E=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],E1=e("file-text",E);const S=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],S1=e("github",S);const U=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],U1=e("globe",U);const B=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],B1=e("history",B);const T=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],T1=e("layout-dashboard",T);const D=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],D1=e("link-2",D);const O=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],O1=e("loader-circle",O);const G=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],G1=e("map-pin",G);const I=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],I1=e("maximize-2",I);const W=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],W1=e("menu",W);const F=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],F1=e("minimize-2",F);const K=[["path",{d:"M5 12h14",key:"1ays0h"}]],K1=e("minus",K);const Q=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Q1=e("panel-left-close",Q);const J=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],J1=e("panel-left-open",J);const X=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],X1=e("pencil",X);const Y=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Y1=e("play",Y);const e1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],e2=e("plus",e1);const t1=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],t2=e("radar",t1);const a1=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],a2=e("radio",a1);const o1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],o2=e("refresh-cw",o1);const c1=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],c2=e("rocket",c1);const n1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],n2=e("rotate-ccw",n1);const h1=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],h2=e("scan-search",h1);const s1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],s2=e("search",s1);const d1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],d2=e("server",d1);const y1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],y2=e("settings-2",y1);const r1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r2=e("settings",r1);const i1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],i2=e("terminal",i1);const k1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],k2=e("trash-2",k1);const p1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],p2=e("triangle-alert",p1);const l1=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],l2=e("triangle",l1);const _1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],_2=e("unplug",_1);const M1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],M2=e("upload",M1);const m1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],m2=e("wrench",m1);const v1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],v2=e("x",v1);export{g1 as A,f1 as B,b1 as C,P1 as D,Z1 as E,E1 as F,S1 as G,B1 as H,H1 as I,K1 as J,X1 as K,O1 as L,F1 as M,k2 as N,V1 as O,Y1 as P,l2 as Q,a2 as R,s2 as S,p2 as T,_2 as U,u1 as V,m2 as W,v2 as X,A1 as Y,h2 as Z,y2 as _,w1 as a,n2 as b,I1 as c,N1 as d,C1 as e,j1 as f,R1 as g,T1 as h,U1 as i,t2 as j,D1 as k,r2 as l,c2 as m,J1 as n,Q1 as o,W1 as p,e2 as q,q1 as r,z1 as s,$1 as t,G1 as u,i2 as v,d2 as w,o2 as x,M2 as y,L1 as z};
|
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-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-CVK43vax.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
|
-
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-CBIL4Nkq.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-
|
|
22
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Hmnj0RO5.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|
|
25
25
|
<div id="root"></div>
|
|
@@ -174,6 +174,7 @@ import {
|
|
|
174
174
|
adsSyncResponseSchema,
|
|
175
175
|
adsUnresolvedOperationListQuerySchema,
|
|
176
176
|
adsUnresolvedOperationListResponseSchema,
|
|
177
|
+
agentPluginClientLabel,
|
|
177
178
|
agentProvidersResponseDtoSchema,
|
|
178
179
|
aggregateHarvestedQueries,
|
|
179
180
|
aiReferralClassCounts,
|
|
@@ -310,6 +311,8 @@ import {
|
|
|
310
311
|
forbidden,
|
|
311
312
|
formatAiReferralClassSummary,
|
|
312
313
|
formatAverageDelta,
|
|
314
|
+
formatCanonryPluginUpdateHint,
|
|
315
|
+
formatCanonryPluginVersionMismatch,
|
|
313
316
|
formatDate,
|
|
314
317
|
formatDateRange,
|
|
315
318
|
formatDeltaCopy,
|
|
@@ -706,7 +709,7 @@ import {
|
|
|
706
709
|
wordpressSchemaDeployResultDtoSchema,
|
|
707
710
|
wordpressSchemaStatusResultDtoSchema,
|
|
708
711
|
wordpressStatusDtoSchema
|
|
709
|
-
} from "./chunk-
|
|
712
|
+
} from "./chunk-Z6RA7LWY.js";
|
|
710
713
|
|
|
711
714
|
// src/intelligence-service.ts
|
|
712
715
|
import { eq as eq68, desc as desc30, asc as asc12, and as and58, ne as ne11, or as or16, inArray as inArray26, gte as gte18, lte as lte15, isNull as isNull12, sql as sql27, exists } from "drizzle-orm";
|
|
@@ -1386,7 +1389,17 @@ var doctorHealthState = sqliteTable("doctor_health_state", {
|
|
|
1386
1389
|
summary: text("summary").notNull(),
|
|
1387
1390
|
checkedAt: text("checked_at").notNull(),
|
|
1388
1391
|
/** When we last emitted for this (status, code). Null until first emit. */
|
|
1389
|
-
notifiedAt: text("notified_at")
|
|
1392
|
+
notifiedAt: text("notified_at"),
|
|
1393
|
+
/**
|
|
1394
|
+
* Every failing check from the last pass as sorted `status:code` pairs. The
|
|
1395
|
+
* headline code alone cannot see a second breach arriving UNDER an existing
|
|
1396
|
+
* one: a GBP outage opening beneath a standing GA warning left the worst code
|
|
1397
|
+
* unchanged, so it was graded, listed in the payload, and then never sent.
|
|
1398
|
+
* NULL on rows written before this column existed — unknown is not the same
|
|
1399
|
+
* as changed, so the trigger falls back to the code rule for one pass rather
|
|
1400
|
+
* than paging every already-degraded project the moment this ships.
|
|
1401
|
+
*/
|
|
1402
|
+
failingSignature: text("failing_signature")
|
|
1390
1403
|
});
|
|
1391
1404
|
var siteLivenessState = sqliteTable("site_liveness_state", {
|
|
1392
1405
|
projectId: text("project_id").primaryKey(),
|
|
@@ -3751,7 +3764,7 @@ var MIGRATION_VERSIONS = [
|
|
|
3751
3764
|
name: "gsc-integration",
|
|
3752
3765
|
statements: [
|
|
3753
3766
|
// google_connections (domain-scoped)
|
|
3754
|
-
// WARNING: access_token, refresh_token are authentication material; consider storing in config.yaml per
|
|
3767
|
+
// WARNING: access_token, refresh_token are authentication material; consider storing in config.yaml per AGENTS.md
|
|
3755
3768
|
`CREATE TABLE IF NOT EXISTS google_connections (
|
|
3756
3769
|
id TEXT PRIMARY KEY,
|
|
3757
3770
|
domain TEXT NOT NULL,
|
|
@@ -3904,7 +3917,7 @@ var MIGRATION_VERSIONS = [
|
|
|
3904
3917
|
name: "ga4-integration",
|
|
3905
3918
|
statements: [
|
|
3906
3919
|
// ga_connections
|
|
3907
|
-
// WARNING: private_key is authentication material; consider storing in config.yaml per
|
|
3920
|
+
// WARNING: private_key is authentication material; consider storing in config.yaml per AGENTS.md
|
|
3908
3921
|
`CREATE TABLE IF NOT EXISTS ga_connections (
|
|
3909
3922
|
id TEXT PRIMARY KEY,
|
|
3910
3923
|
project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
@@ -7322,6 +7335,17 @@ var MIGRATION_VERSIONS = [
|
|
|
7322
7335
|
notified_at TEXT
|
|
7323
7336
|
)`
|
|
7324
7337
|
]
|
|
7338
|
+
},
|
|
7339
|
+
{
|
|
7340
|
+
// A breach opening underneath an existing one never reached anyone: the
|
|
7341
|
+
// trigger keyed on the worst check's code, and a lower-ranked check going
|
|
7342
|
+
// bad does not change it. Existing rows get NULL, which the notifier reads
|
|
7343
|
+
// as "unknown" rather than "changed" so shipping this pages nobody.
|
|
7344
|
+
version: 157,
|
|
7345
|
+
name: "doctor-health-failing-signature",
|
|
7346
|
+
statements: [
|
|
7347
|
+
`ALTER TABLE doctor_health_state ADD COLUMN failing_signature TEXT`
|
|
7348
|
+
]
|
|
7325
7349
|
}
|
|
7326
7350
|
];
|
|
7327
7351
|
function addRunsMeasurementPlanVersionForeignKey(tx) {
|
|
@@ -78642,7 +78666,7 @@ function unverifiedPluginClients(state) {
|
|
|
78642
78666
|
return state.configuredClients.filter((client) => !state.verifiedClients.includes(client));
|
|
78643
78667
|
}
|
|
78644
78668
|
function displayPluginClients(clients) {
|
|
78645
|
-
return clients.map((client) => client
|
|
78669
|
+
return clients.map((client) => agentPluginClientLabel(client)).join(" + ");
|
|
78646
78670
|
}
|
|
78647
78671
|
var skillsInstalledCheck = {
|
|
78648
78672
|
id: "agent.skills.installed",
|
|
@@ -78657,7 +78681,7 @@ var skillsInstalledCheck = {
|
|
|
78657
78681
|
status: CheckStatuses.warn,
|
|
78658
78682
|
code: "agent.skills.plugin-unverified",
|
|
78659
78683
|
summary: `The Canonry plugin is enabled for ${displayPluginClients(unverifiedClients)}, but its cached manifest and skill assets could not be verified.`,
|
|
78660
|
-
remediation:
|
|
78684
|
+
remediation: `${formatCanonryPluginUpdateHint(unverifiedClients)} Or disable the stale plugin entry.`,
|
|
78661
78685
|
details: { delivery: "plugin", ...agentPlugin, unverifiedClients }
|
|
78662
78686
|
};
|
|
78663
78687
|
}
|
|
@@ -78735,7 +78759,7 @@ var skillsCurrentCheck = {
|
|
|
78735
78759
|
status: CheckStatuses.warn,
|
|
78736
78760
|
code: "agent.skills.plugin-unverified",
|
|
78737
78761
|
summary: `The Canonry plugin cache could not be verified for ${displayPluginClients(unverifiedClients)}; freshness cannot be assessed.`,
|
|
78738
|
-
remediation:
|
|
78762
|
+
remediation: `${formatCanonryPluginUpdateHint(unverifiedClients)} Or disable the stale plugin entry.`,
|
|
78739
78763
|
details: { delivery: "plugin", ...agentPlugin, unverifiedClients }
|
|
78740
78764
|
};
|
|
78741
78765
|
}
|
|
@@ -78753,12 +78777,15 @@ var skillsCurrentCheck = {
|
|
|
78753
78777
|
const bundledVersion2 = bundled[0].version;
|
|
78754
78778
|
const mismatchedClients = agentPlugin.verifiedClients.filter((client) => agentPlugin.verifiedClientVersions?.[client] !== bundledVersion2);
|
|
78755
78779
|
if (mismatchedClients.length > 0) {
|
|
78756
|
-
const versions = mismatchedClients.map((client) => `${client === "claude-code" ? "Claude Code" : "Codex"} v${agentPlugin.verifiedClientVersions?.[client] ?? "unknown"}`).join(", ");
|
|
78757
78780
|
return {
|
|
78758
78781
|
status: CheckStatuses.warn,
|
|
78759
78782
|
code: "agent.skills.plugin-version-mismatch",
|
|
78760
|
-
summary: `${
|
|
78761
|
-
|
|
78783
|
+
summary: `${formatCanonryPluginVersionMismatch({
|
|
78784
|
+
mismatchedClients,
|
|
78785
|
+
verifiedClientVersions: agentPlugin.verifiedClientVersions,
|
|
78786
|
+
runningVersion: bundledVersion2
|
|
78787
|
+
})}; plugin skills may be stale or incompatible.`,
|
|
78788
|
+
remediation: formatCanonryPluginUpdateHint(mismatchedClients),
|
|
78762
78789
|
details: { delivery: "plugin", bundledVersion: bundledVersion2, ...agentPlugin, mismatchedClients }
|
|
78763
78790
|
};
|
|
78764
78791
|
}
|
|
@@ -79915,7 +79942,7 @@ var SITE_REACHABILITY_CHECKS = [siteReachabilityCheck];
|
|
|
79915
79942
|
|
|
79916
79943
|
// ../api-routes/src/doctor/checks/gbp-auth.ts
|
|
79917
79944
|
import { and as and52, eq as eq60 } from "drizzle-orm";
|
|
79918
|
-
var RECENT_SYNC_WARN_DAYS2 =
|
|
79945
|
+
var RECENT_SYNC_WARN_DAYS2 = 4;
|
|
79919
79946
|
var RECENT_SYNC_FAIL_DAYS2 = 30;
|
|
79920
79947
|
function skippedNoProject3() {
|
|
79921
79948
|
return {
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
adsOperationReconcileRequestSchema,
|
|
27
27
|
adsPauseRequestSchema,
|
|
28
28
|
adsUnresolvedOperationListQuerySchema,
|
|
29
|
+
agentPluginClientLabel,
|
|
29
30
|
apiKeyDtoSchema,
|
|
30
31
|
backlinkSourceSchema,
|
|
31
32
|
canonicalizeGtmAccountId,
|
|
@@ -41,6 +42,8 @@ import {
|
|
|
41
42
|
discoveryCompetitorTypeSchema,
|
|
42
43
|
discoveryPromoteRequestSchema,
|
|
43
44
|
discoveryRunRequestSchema,
|
|
45
|
+
formatCanonryPluginUpdateHint,
|
|
46
|
+
formatCanonryPluginVersionMismatch,
|
|
44
47
|
gaMeasurementAnalysisWindowSchema,
|
|
45
48
|
gaMeasurementHostScopeSchema,
|
|
46
49
|
googleAdsMetricsWindowSchema,
|
|
@@ -127,7 +130,7 @@ import {
|
|
|
127
130
|
upgradeCaveatFor,
|
|
128
131
|
upgradeCommandFor,
|
|
129
132
|
visibilityReportRequestSchema
|
|
130
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-Z6RA7LWY.js";
|
|
131
134
|
|
|
132
135
|
// src/cli-error.ts
|
|
133
136
|
function isMachineFormat(format) {
|
|
@@ -653,7 +656,7 @@ function isConnectionFailure(message) {
|
|
|
653
656
|
return message.includes("fetch failed") || message.includes("ECONNREFUSED") || message.includes("connect ECONNREFUSED");
|
|
654
657
|
}
|
|
655
658
|
function connectionFailureMessage(target) {
|
|
656
|
-
return `Could not connect to canonry server at ${redactRequestTarget(target)}. Check that this URL is reachable and the server is running. For a local Canonry instance, start it with "canonry
|
|
659
|
+
return `Could not connect to canonry server at ${redactRequestTarget(target)}. Check that this URL is reachable and the server is running. For a local Canonry instance, start it with "canonry start" (a background daemon, stopped with "canonry stop"), or "canonry serve" to run it in the foreground.`;
|
|
657
660
|
}
|
|
658
661
|
function redactRequestTarget(target) {
|
|
659
662
|
try {
|
|
@@ -13615,6 +13618,11 @@ function emitInstallSummary(summary, format) {
|
|
|
13615
13618
|
Target: ${summary.targetDir}`);
|
|
13616
13619
|
console.log(summary.message);
|
|
13617
13620
|
}
|
|
13621
|
+
function shouldPrintServeSkillsNudge(nudge, updateAvailable) {
|
|
13622
|
+
if (!nudge) return false;
|
|
13623
|
+
if (nudge.source === "plugin" && updateAvailable) return false;
|
|
13624
|
+
return true;
|
|
13625
|
+
}
|
|
13618
13626
|
function getMissingUserSkillsNudge(home, agentPlugin) {
|
|
13619
13627
|
if (!home) return null;
|
|
13620
13628
|
const skillsBase = path2.join(home, ".claude", "skills");
|
|
@@ -13629,17 +13637,22 @@ function getMissingUserSkillsNudge(home, agentPlugin) {
|
|
|
13629
13637
|
const unverifiedClients = agentPlugin.configuredClients.filter((client2) => !agentPlugin.verifiedClients.includes(client2));
|
|
13630
13638
|
const mismatchedClients = agentPlugin.verifiedClients.filter((client2) => agentPlugin.verifiedClientVersions?.[client2] !== PACKAGE_VERSION);
|
|
13631
13639
|
if (unverifiedClients.length === 0 && mismatchedClients.length === 0) return null;
|
|
13632
|
-
const displayClients = (clients) => clients.map((client2) => client2
|
|
13640
|
+
const displayClients = (clients) => clients.map((client2) => agentPluginClientLabel(client2)).join(" + ");
|
|
13633
13641
|
const problems = [];
|
|
13634
13642
|
if (unverifiedClients.length > 0) {
|
|
13635
13643
|
problems.push(`The Canonry plugin is enabled for ${displayClients(unverifiedClients)}, but its cached manifest and skill assets could not be verified.`);
|
|
13636
13644
|
}
|
|
13637
13645
|
if (mismatchedClients.length > 0) {
|
|
13638
|
-
|
|
13639
|
-
|
|
13646
|
+
problems.push(`${formatCanonryPluginVersionMismatch({
|
|
13647
|
+
mismatchedClients,
|
|
13648
|
+
verifiedClientVersions: agentPlugin.verifiedClientVersions,
|
|
13649
|
+
runningVersion: PACKAGE_VERSION
|
|
13650
|
+
})}.`);
|
|
13640
13651
|
}
|
|
13652
|
+
const hintClients = [.../* @__PURE__ */ new Set([...unverifiedClients, ...mismatchedClients])];
|
|
13641
13653
|
return {
|
|
13642
|
-
message: `Tip: ${problems.join(" ")}
|
|
13654
|
+
message: `Tip: ${problems.join(" ")} ${formatCanonryPluginUpdateHint(hintClients)}`,
|
|
13655
|
+
source: "plugin",
|
|
13643
13656
|
missing,
|
|
13644
13657
|
installed
|
|
13645
13658
|
};
|
|
@@ -13648,6 +13661,7 @@ function getMissingUserSkillsNudge(home, agentPlugin) {
|
|
|
13648
13661
|
const fix = missing.length === BUNDLED_SKILL_NAMES.length ? "canonry skills install --user" : `canonry skills install ${missing.join(" ")} --user`;
|
|
13649
13662
|
return {
|
|
13650
13663
|
message: `Tip: ${missing.join(" + ")} skill${missing.length === 1 ? "" : "s"} not installed in ~/.claude/skills/. Run \`${fix}\` so Claude/Codex sessions on this host auto-load the canonry reference docs.`,
|
|
13664
|
+
source: "legacy-skills",
|
|
13651
13665
|
missing,
|
|
13652
13666
|
installed
|
|
13653
13667
|
};
|
|
@@ -13696,6 +13710,7 @@ export {
|
|
|
13696
13710
|
installSkills,
|
|
13697
13711
|
listSkills,
|
|
13698
13712
|
emitInstallSummary,
|
|
13713
|
+
shouldPrintServeSkillsNudge,
|
|
13699
13714
|
getMissingUserSkillsNudge,
|
|
13700
13715
|
parseSkillsClient,
|
|
13701
13716
|
runWithUsageTags,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
installSkills,
|
|
5
5
|
loadConfigRaw,
|
|
6
6
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-67OM5KEH.js";
|
|
8
8
|
import {
|
|
9
9
|
PACKAGE_VERSION
|
|
10
10
|
} from "./chunk-AOJU5LKX.js";
|
|
11
11
|
import {
|
|
12
12
|
SKILL_MANIFEST_FILENAME,
|
|
13
13
|
SkillsClients
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Z6RA7LWY.js";
|
|
15
15
|
|
|
16
16
|
// src/skills-autosync.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
siteCrawlGraphNodes,
|
|
6
6
|
siteCrawlPages,
|
|
7
7
|
siteCrawlSnapshots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2P52FD5B.js";
|
|
9
9
|
import {
|
|
10
10
|
SITE_CRAWL_GRAPH_MAX_EDGES,
|
|
11
11
|
SITE_CRAWL_GRAPH_MAX_NODES,
|
|
12
12
|
TEMPLATE_LINK_RATIO_THRESHOLD
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Z6RA7LWY.js";
|
|
14
14
|
|
|
15
15
|
// src/site-crawl-graph-layout.ts
|
|
16
16
|
import crypto from "crypto";
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
resolveOperatorApiKeyIds,
|
|
17
17
|
runWithUsageTags,
|
|
18
18
|
saveConfigPatch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-67OM5KEH.js";
|
|
20
20
|
import {
|
|
21
21
|
deleteSiteCrawlGraphLayout,
|
|
22
22
|
persistSiteCrawlGraphLayout,
|
|
23
23
|
prepareSiteCrawlGraphLayout
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-P5YYRGFS.js";
|
|
25
25
|
import {
|
|
26
26
|
PACKAGE_VERSION
|
|
27
27
|
} from "./chunk-AOJU5LKX.js";
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
siteLivenessState,
|
|
177
177
|
toAlertView,
|
|
178
178
|
usageCounters
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-2P52FD5B.js";
|
|
180
180
|
import {
|
|
181
181
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
182
182
|
AGENT_NONE,
|
|
@@ -329,7 +329,7 @@ import {
|
|
|
329
329
|
validationError,
|
|
330
330
|
winnabilityClassLabel,
|
|
331
331
|
withRetry
|
|
332
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-Z6RA7LWY.js";
|
|
333
333
|
|
|
334
334
|
// src/runtime-context.ts
|
|
335
335
|
function cliRuntimeContext(env = process.env, stdio = process) {
|
|
@@ -698,6 +698,13 @@ function readCachedUpdateAvailable() {
|
|
|
698
698
|
return null;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
+
var printedUpdateAvailable = null;
|
|
702
|
+
function notePrintedUpdateAvailable(update) {
|
|
703
|
+
printedUpdateAvailable = update;
|
|
704
|
+
}
|
|
705
|
+
function getPrintedUpdateAvailable() {
|
|
706
|
+
return printedUpdateAvailable;
|
|
707
|
+
}
|
|
701
708
|
var UPDATE_AVAILABLE_NOTICE_CODE = "UPDATE_AVAILABLE";
|
|
702
709
|
function formatUpdateNotice(update, opts) {
|
|
703
710
|
const caveat = upgradeCaveatFor(update.installMethod);
|
|
@@ -6461,7 +6468,7 @@ function nonBlank(value) {
|
|
|
6461
6468
|
return trimmed ? trimmed : void 0;
|
|
6462
6469
|
}
|
|
6463
6470
|
function resolveBuildCommit(env = process.env) {
|
|
6464
|
-
const embedded = true ? "
|
|
6471
|
+
const embedded = true ? "68347cdf6d0e86bc163041eb8cb2adb3f3ced312" : void 0;
|
|
6465
6472
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
6466
6473
|
}
|
|
6467
6474
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -11755,7 +11762,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
11755
11762
|
return result;
|
|
11756
11763
|
}
|
|
11757
11764
|
async function backfillInsightsCommand(project, opts) {
|
|
11758
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
11765
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-PHCK6A35.js");
|
|
11759
11766
|
const config = loadConfig();
|
|
11760
11767
|
const db = createClient(config.database);
|
|
11761
11768
|
migrate(db);
|
|
@@ -13101,6 +13108,7 @@ var Notifier = class {
|
|
|
13101
13108
|
const summary = noSignal ? `No health check produced a result (${report.checks.length} skipped) \u2014 health is unknown, not confirmed.` : worst?.summary ?? `All ${graded.length} health check(s) passing.`;
|
|
13102
13109
|
const previous = this.db.select().from(doctorHealthState).where(eq17(doctorHealthState.projectId, projectId)).get();
|
|
13103
13110
|
const previousStatus = previous?.status ?? null;
|
|
13111
|
+
const failingSignature = failing.map((c) => `${c.status}:${c.code}`).join(",");
|
|
13104
13112
|
let event = null;
|
|
13105
13113
|
if (previous === void 0) {
|
|
13106
13114
|
if (status !== "ok") event = "health.degraded";
|
|
@@ -13108,9 +13116,11 @@ var Notifier = class {
|
|
|
13108
13116
|
event = "health.recovered";
|
|
13109
13117
|
} else if (status !== "ok" && (previousStatus === "ok" || previous.code !== code)) {
|
|
13110
13118
|
event = "health.degraded";
|
|
13119
|
+
} else if (status !== "ok" && previous.failingSignature !== null && previous.failingSignature !== failingSignature) {
|
|
13120
|
+
event = "health.degraded";
|
|
13111
13121
|
}
|
|
13112
13122
|
const now = report.checkedAt;
|
|
13113
|
-
const observation = { projectId, status, code, summary, checkedAt: now };
|
|
13123
|
+
const observation = { projectId, status, code, summary, checkedAt: now, failingSignature };
|
|
13114
13124
|
if (previous === void 0) {
|
|
13115
13125
|
this.db.insert(doctorHealthState).values({ ...observation, notifiedAt: null }).run();
|
|
13116
13126
|
} else {
|
|
@@ -19499,6 +19509,8 @@ export {
|
|
|
19499
19509
|
formatAuditFactorScore,
|
|
19500
19510
|
checkLatestVersionForCli,
|
|
19501
19511
|
readCachedUpdateAvailable,
|
|
19512
|
+
notePrintedUpdateAvailable,
|
|
19513
|
+
getPrintedUpdateAvailable,
|
|
19502
19514
|
formatUpdateNotice,
|
|
19503
19515
|
listAgentProviders,
|
|
19504
19516
|
coerceAgentProvider,
|
|
@@ -15628,6 +15628,28 @@ function dedupeReportOpportunities(report) {
|
|
|
15628
15628
|
import { z as z54 } from "zod";
|
|
15629
15629
|
var codingAgentSchema = z54.enum(["claude", "codex"]);
|
|
15630
15630
|
var CodingAgents = codingAgentSchema.enum;
|
|
15631
|
+
function agentPluginClientLabel(client) {
|
|
15632
|
+
return client === "claude-code" ? "Claude Code" : "Codex";
|
|
15633
|
+
}
|
|
15634
|
+
function joinPluginSubjects(subjects) {
|
|
15635
|
+
if (subjects.length <= 1) return subjects[0] ?? "";
|
|
15636
|
+
if (subjects.length === 2) return `${subjects[0]} and ${subjects[1]}`;
|
|
15637
|
+
return `${subjects.slice(0, -1).join(", ")}, and ${subjects.at(-1)}`;
|
|
15638
|
+
}
|
|
15639
|
+
function formatCanonryPluginVersionMismatch(args) {
|
|
15640
|
+
const subjects = args.mismatchedClients.map((client) => {
|
|
15641
|
+
const version = args.verifiedClientVersions?.[client] ?? "unknown";
|
|
15642
|
+
return `the Canonry plugin for ${agentPluginClientLabel(client)} (v${version})`;
|
|
15643
|
+
});
|
|
15644
|
+
const verb = args.mismatchedClients.length === 1 ? "does" : "do";
|
|
15645
|
+
return `${joinPluginSubjects(subjects)} ${verb} not match this Canonry v${args.runningVersion}`;
|
|
15646
|
+
}
|
|
15647
|
+
function formatCanonryPluginUpdateHint(clients) {
|
|
15648
|
+
const names = [...new Set(clients.map(agentPluginClientLabel))];
|
|
15649
|
+
if (names.length === 0) return "Update or reinstall `canonry@canonry` in the affected client.";
|
|
15650
|
+
if (names.length === 1) return `Update or reinstall \`canonry@canonry\` in ${names[0]}.`;
|
|
15651
|
+
return `Update or reinstall \`canonry@canonry\` in ${joinPluginSubjects(names)}.`;
|
|
15652
|
+
}
|
|
15631
15653
|
var skillsClientSchema = z54.enum(["claude", "codex", "all"]);
|
|
15632
15654
|
var SkillsClients = skillsClientSchema.enum;
|
|
15633
15655
|
var SKILL_MANIFEST_FILENAME = ".canonry-skill-manifest.json";
|
|
@@ -17682,7 +17704,22 @@ var onboardingStepSchema = z60.enum([
|
|
|
17682
17704
|
"project",
|
|
17683
17705
|
"queries",
|
|
17684
17706
|
"competitors",
|
|
17685
|
-
"run"
|
|
17707
|
+
"run",
|
|
17708
|
+
// The "You're set" page every onboarding path now ends on. A new step value,
|
|
17709
|
+
// not a new event name: the canonry.ai collector allowlists event names and
|
|
17710
|
+
// silently drops unknown ones, while step is an open property there.
|
|
17711
|
+
"finish"
|
|
17712
|
+
]);
|
|
17713
|
+
var onboardingNextActionSchema = z60.enum([
|
|
17714
|
+
"copy_agent_command",
|
|
17715
|
+
"connect_server_traffic",
|
|
17716
|
+
"connect_search_console",
|
|
17717
|
+
"connect_analytics",
|
|
17718
|
+
"connect_business_profile",
|
|
17719
|
+
"set_schedule",
|
|
17720
|
+
"add_notification",
|
|
17721
|
+
"open_project",
|
|
17722
|
+
"review_page_health"
|
|
17686
17723
|
]);
|
|
17687
17724
|
var onboardingCountBucketSchema = z60.enum([
|
|
17688
17725
|
"0",
|
|
@@ -17741,7 +17778,9 @@ var onboardingTelemetryEventSchema = z60.discriminatedUnion("event", [
|
|
|
17741
17778
|
event: z60.literal("onboarding.step_completed"),
|
|
17742
17779
|
step: onboardingStepSchema,
|
|
17743
17780
|
method: z60.enum(["existing", "inline", "manual", "generated", "skipped", "automatic"]),
|
|
17744
|
-
countBucket: onboardingCountBucketSchema.optional()
|
|
17781
|
+
countBucket: onboardingCountBucketSchema.optional(),
|
|
17782
|
+
/** Set only with `step: 'finish'`: the next action the operator chose. */
|
|
17783
|
+
nextAction: onboardingNextActionSchema.optional()
|
|
17745
17784
|
}).strict(),
|
|
17746
17785
|
onboardingEventBaseSchema.extend({
|
|
17747
17786
|
event: z60.literal("onboarding.blocked"),
|
|
@@ -18738,6 +18777,9 @@ export {
|
|
|
18738
18777
|
dedupeReportActions,
|
|
18739
18778
|
dedupeReportOpportunities,
|
|
18740
18779
|
CodingAgents,
|
|
18780
|
+
agentPluginClientLabel,
|
|
18781
|
+
formatCanonryPluginVersionMismatch,
|
|
18782
|
+
formatCanonryPluginUpdateHint,
|
|
18741
18783
|
skillsClientSchema,
|
|
18742
18784
|
SkillsClients,
|
|
18743
18785
|
SKILL_MANIFEST_FILENAME,
|