@canonry/canonry 7.1.1 → 7.2.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/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +5 -3
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +16 -1
- package/assets/assets/{AuditHistoryPanel-CZWzgyrD.js → AuditHistoryPanel-Duvyi8vx.js} +1 -1
- package/assets/assets/{BacklinksPage-D23A-ahd.js → BacklinksPage-CY5AllQu.js} +1 -1
- package/assets/assets/{HistoryPage-BKGVxmNz.js → HistoryPage-C0Gr0gcj.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-BSxn6_RB.js → MeasurementPropertyPage-DrAB6VKX.js} +1 -1
- package/assets/assets/ProjectPage-DSxvvnAd.js +8 -0
- package/assets/assets/{RunsPage-CeBBjLSE.js → RunsPage-DMxOrtfl.js} +1 -1
- package/assets/assets/{SettingsPage-Jp5Yp4cz.js → SettingsPage-sxiUNt2A.js} +1 -1
- package/assets/assets/{SiteHealthSection-DzVegBeN.js → SiteHealthSection--6tZe3hM.js} +3 -3
- package/assets/assets/{TrafficPage-B66AYwWk.js → TrafficPage-CvSQDNTi.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-CXtq1yES.js → TrafficSourceDetailPage-BaYeIBmc.js} +1 -1
- package/assets/assets/{extract-error-message-BVa0lOze.js → extract-error-message-76IWhqQF.js} +1 -1
- package/assets/assets/index-BlrH2zRW.js +86 -0
- package/assets/assets/index-HWSQgVum.css +1 -0
- package/assets/assets/{react-sigma_core.esm.min-60drsJa6.js → react-sigma_core.esm.min-CkAcKW2k.js} +1 -1
- package/assets/assets/{v2-overview-adapter-CLUi2Lkv.js → v2-overview-adapter-DnEE4E9w.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-2OQ6D26U.js → chunk-BYSSJEL7.js} +8 -4
- package/dist/{chunk-IAMECH2N.js → chunk-EQBYK77W.js} +3 -3
- package/dist/{chunk-MTSFSXCG.js → chunk-FDBQOQLP.js} +2 -2
- package/dist/{chunk-VDX3LYKL.js → chunk-RCQJI3UX.js} +16 -9
- package/dist/{chunk-U2S5ABOR.js → chunk-SVTVBPIT.js} +2 -2
- package/dist/{chunk-YGHPT5B2.js → chunk-TY3CJKKR.js} +24 -2
- package/dist/{chunk-22R5E5CY.js → chunk-UIDHHZH3.js} +7 -7
- package/dist/cli.js +32 -16
- package/dist/{demo-server-TIMYQLXS.js → demo-server-GWRYDPJC.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-YCMRTVCI.js → intelligence-service-3L2665AK.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +9 -9
- package/assets/assets/ProjectPage-D9W8G_1m.js +0 -8
- package/assets/assets/index-CMe_-fAB.css +0 -1
- package/assets/assets/index-DuhS0WLM.js +0 -86
package/assets/assets/{react-sigma_core.esm.min-60drsJa6.js → react-sigma_core.esm.min-CkAcKW2k.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--6tZe3hM.js";import"./index-BlrH2zRW.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-N6vOpZmh.js";import"./vendor-markdown-B4giJcws.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-CYlrwLJs.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 N,j as i}from"./vendor-tanstack-ZXXkndVj.js";import{Q as ae,eb as oe,B as le}from"./index-DuhS0WLM.js";import{M as ue}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as ce,g as J}from"./vendor-lucide-N6vOpZmh.js";const pe={ambiguous:"Property identity unverified"},Ae="No answer could be tied to one property";function Se(e){return e.denominator===null||e.denominator===void 0||e.unattributed===void 0||e.unattributed<=0?null:`${e.unattributed} of ${e.denominator+e.unattributed} answers could not be tied to one property`}const Ke="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function me({previewLength:e,highlight:r}){return o=>{if(e!==void 0&&Number.isFinite(e)){let d=Math.max(0,Math.floor(e));const c={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return d>0;const b=Array.from(f);if(b.length===0)return d>0;if(d===0)return c.omitted=!0,!1;const j=b.length>d,k=b.slice(0,d);if(j&&!/\s/.test(b[d])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>d-40&&(k.length=g)}return c.omitted||=j,n[s]=k.join(""),d=j?0:d-k.length,k.length===0?!1:(c.lastNode=n,c.field=s,!0)};p(o),c.omitted&&(c.lastNode?c.lastNode[c.field]=`${c.lastNode[c.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const d=c=>{["link","linkReference","code","inlineCode"].includes(c.type)||(c.type==="text"&&(c.data={...c.data,hName:"span"}),c.children?.forEach(d))};d(o)}}}function fe({headingLevel:e}){return r=>{const o=[],d=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(d)};d(r);const c=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-c;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=N.useState("idle"),d=N.useRef(!1),c=async()=>{if(!d.current){d.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{d.current=!1}}};return i.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[i.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{c()},children:r==="copying"?B.copying:B.copy}),i.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ee=N.memo(function({children:r,headingLevel:o=4,copyable:d=!1,highlightGroups:c,previewLength:p}){return i.jsxs("div",{className:"answer-markdown",children:[i.jsx(ue,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!c?.length}]],components:{p:({children:n})=>i.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>i.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>i.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>i.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>i.jsx("span",{children:typeof n=="string"&&c?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:i.jsx(N.Fragment,{children:oe(s,c)},f)):n}),a:({children:n,href:s})=>{const f=ae(s);return f?i.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):i.jsx("span",{children:n})},img:({alt:n})=>i.jsx("span",{children:n})},children:r}),d&&r.trim()?i.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",V="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,T={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Te({options:e,selected:r,onSelect:o,marketKey:d,label:c="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=N.useState(""),[j,k]=N.useState([]),[g,$]=N.useState(!1),C=N.useRef(null),I=N.useRef(null),a=N.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(j.at(-1)??""),G=h.get(j.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),w=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),F=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},A=(g?[]:l?y.filter(t=>x?F(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(w),S=s.find(t=>t.kind==="market"&&t.id===(d??(r.kind==="market"?r.id:void 0))),H=l&&S&&(l.marketKeys?.includes(S.id)||S.parentGroupIds?.includes(l.id))?S.id:void 0,L=n?H??he(l):void 0,D=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(w),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?F(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&w(t)),Y=l||g?[]:s.filter(t=>t.kind==="project"&&w(t));N.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},P=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ie=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(S?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(K=>{const q=h.get(K);return q?[P(q)]:[]}),v=m.find(K=>K.at(-1)===l?.id)??m.sort((K,q)=>q.length-K.length)[0]??[],Z=u?P(u):r.marketKeys?.length?[]:v;k(t?P(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},z=t=>{k(P(t)),$(!1),b(""),I.current?.focus()},R=(t,u=E(t))=>i.jsxs("div",{className:"flex items-stretch",children:[i.jsxs("button",{type:"button",className:V,"aria-label":t.kind==="group"&&!n?T.browse(E(t)):T.select(E(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!n?z(t):se(t),children:[i.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?i.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),i.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?i.jsx("button",{type:"button","aria-label":T.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:i.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),U=(t,u)=>u.length>0?i.jsxs("section",{"aria-label":t,className:"mt-2",children:[i.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>R(m))]}):null,Q=(t,u,m)=>u.length>0?i.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[i.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>R(v))]},`${l?.id??"root"}:${t}`):null;return i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{id:`${a}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:c}),i.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[i.jsxs("summary",{id:`${a}-value`,"aria-labelledby":`${a}-label ${a}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ie()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===d)?.label??(r.marketKeys?.length?T.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,i.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),i.jsxs("div",{className:"visibility-scope-menu",children:[l||g?i.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[i.jsx("button",{type:"button",className:V,"aria-label":`Back to ${G?.label??"all groups"}`,onClick:()=>{k(j.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(ce,{size:16,"aria-hidden":"true"}),G?.label??"All groups"]})}),i.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,i.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),i.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?R(l,"All properties in this group"):null,Y.map(t=>R(t)),l&&!x?Q("Subgroups",A,!0):U(l?"Subgroups":"Groups",A),x?U("Properties",D):Q(l&&A.length>0?"All properties":"Properties",D,!l||A.length===0),U("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?i.jsxs("button",{type:"button",className:`${V} mt-2 border-t border-default`,"aria-label":T.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[i.jsx("span",{children:"All properties"}),i.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&A.length+D.length+W.length+Y.length===0?i.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function we(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const d=new Map;if(!r)return d;const c=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=c.get(s.usageEdgeId);if(!f)continue;const b=d.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),d.set(f,b)}return d}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:pe.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function Ne(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 Pe({overview:e,activePlan:r,report:o,reportState:d=o?"ready":"loading",sort:c}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(a=>[a.stableKey,a])),s=new Map(p.querySnapshots.map(a=>[a.queryId,a.queryText])),f=new Map;for(const a of p.assignments){if(e.queryClass!=="all"&&a.queryClass!==e.queryClass)continue;const y=s.get(a.queryId);if(!y)continue;const h=f.get(a.targetKey)??new Set;h.add(y),f.set(a.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,j=e.measurement.displayedRunId===void 0||b?"ready":d==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const a of p.groups)for(const y of a.targetKeys)g.has(y)||g.set(y,a.label);const $=e.properties.items.map(a=>{const y=n.get(a.targetKey),h=k.get(a.targetKey)??[];return{id:a.targetKey,name:a.label,mentionCoverage:M(a.mentionCoverage),citationCoverage:M(a.citationCoverage),status:Ce(a),providers:a.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(a.targetKey),assignedQueries:[...f.get(a.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:j,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(a=>({name:a.label,coverage:{numerator:a.credits,denominator:e.namedShareOfVoice.denominator}})),I=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:Ne(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:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...c?{sort:c}:{}},availableGroups:p.groups.map(a=>({id:a.stableKey,label:a.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ee as A,T as M,Ae as U,pe as V,Ke as a,we as b,Pe as c,Te as d,ye as m,Se as u};
|
|
1
|
+
import{r as N,j as i}from"./vendor-tanstack-ZXXkndVj.js";import{Q as ae,ea as oe,B as le}from"./index-BlrH2zRW.js";import{M as ue}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as ce,g as J}from"./vendor-lucide-N6vOpZmh.js";const pe={ambiguous:"Property identity unverified"},Ae="No answer could be tied to one property";function Se(e){return e.denominator===null||e.denominator===void 0||e.unattributed===void 0||e.unattributed<=0?null:`${e.unattributed} of ${e.denominator+e.unattributed} answers could not be tied to one property`}const Ke="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function me({previewLength:e,highlight:r}){return o=>{if(e!==void 0&&Number.isFinite(e)){let d=Math.max(0,Math.floor(e));const c={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return d>0;const b=Array.from(f);if(b.length===0)return d>0;if(d===0)return c.omitted=!0,!1;const j=b.length>d,k=b.slice(0,d);if(j&&!/\s/.test(b[d])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>d-40&&(k.length=g)}return c.omitted||=j,n[s]=k.join(""),d=j?0:d-k.length,k.length===0?!1:(c.lastNode=n,c.field=s,!0)};p(o),c.omitted&&(c.lastNode?c.lastNode[c.field]=`${c.lastNode[c.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const d=c=>{["link","linkReference","code","inlineCode"].includes(c.type)||(c.type==="text"&&(c.data={...c.data,hName:"span"}),c.children?.forEach(d))};d(o)}}}function fe({headingLevel:e}){return r=>{const o=[],d=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(d)};d(r);const c=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-c;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=N.useState("idle"),d=N.useRef(!1),c=async()=>{if(!d.current){d.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{d.current=!1}}};return i.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[i.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{c()},children:r==="copying"?B.copying:B.copy}),i.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ee=N.memo(function({children:r,headingLevel:o=4,copyable:d=!1,highlightGroups:c,previewLength:p}){return i.jsxs("div",{className:"answer-markdown",children:[i.jsx(ue,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!c?.length}]],components:{p:({children:n})=>i.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>i.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>i.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>i.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>i.jsx("span",{children:typeof n=="string"&&c?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:i.jsx(N.Fragment,{children:oe(s,c)},f)):n}),a:({children:n,href:s})=>{const f=ae(s);return f?i.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):i.jsx("span",{children:n})},img:({alt:n})=>i.jsx("span",{children:n})},children:r}),d&&r.trim()?i.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",V="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,T={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Te({options:e,selected:r,onSelect:o,marketKey:d,label:c="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=N.useState(""),[j,k]=N.useState([]),[g,$]=N.useState(!1),C=N.useRef(null),I=N.useRef(null),a=N.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(j.at(-1)??""),G=h.get(j.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),w=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),F=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},A=(g?[]:l?y.filter(t=>x?F(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(w),S=s.find(t=>t.kind==="market"&&t.id===(d??(r.kind==="market"?r.id:void 0))),H=l&&S&&(l.marketKeys?.includes(S.id)||S.parentGroupIds?.includes(l.id))?S.id:void 0,L=n?H??he(l):void 0,D=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(w),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?F(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&w(t)),Y=l||g?[]:s.filter(t=>t.kind==="project"&&w(t));N.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},P=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ie=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(S?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(K=>{const q=h.get(K);return q?[P(q)]:[]}),v=m.find(K=>K.at(-1)===l?.id)??m.sort((K,q)=>q.length-K.length)[0]??[],Z=u?P(u):r.marketKeys?.length?[]:v;k(t?P(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},z=t=>{k(P(t)),$(!1),b(""),I.current?.focus()},R=(t,u=E(t))=>i.jsxs("div",{className:"flex items-stretch",children:[i.jsxs("button",{type:"button",className:V,"aria-label":t.kind==="group"&&!n?T.browse(E(t)):T.select(E(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!n?z(t):se(t),children:[i.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?i.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),i.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?i.jsx("button",{type:"button","aria-label":T.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:i.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),U=(t,u)=>u.length>0?i.jsxs("section",{"aria-label":t,className:"mt-2",children:[i.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>R(m))]}):null,Q=(t,u,m)=>u.length>0?i.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[i.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>R(v))]},`${l?.id??"root"}:${t}`):null;return i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{id:`${a}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:c}),i.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[i.jsxs("summary",{id:`${a}-value`,"aria-labelledby":`${a}-label ${a}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ie()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===d)?.label??(r.marketKeys?.length?T.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,i.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),i.jsxs("div",{className:"visibility-scope-menu",children:[l||g?i.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[i.jsx("button",{type:"button",className:V,"aria-label":`Back to ${G?.label??"all groups"}`,onClick:()=>{k(j.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(ce,{size:16,"aria-hidden":"true"}),G?.label??"All groups"]})}),i.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,i.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),i.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?R(l,"All properties in this group"):null,Y.map(t=>R(t)),l&&!x?Q("Subgroups",A,!0):U(l?"Subgroups":"Groups",A),x?U("Properties",D):Q(l&&A.length>0?"All properties":"Properties",D,!l||A.length===0),U("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?i.jsxs("button",{type:"button",className:`${V} mt-2 border-t border-default`,"aria-label":T.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[i.jsx("span",{children:"All properties"}),i.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&A.length+D.length+W.length+Y.length===0?i.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function we(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const d=new Map;if(!r)return d;const c=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=c.get(s.usageEdgeId);if(!f)continue;const b=d.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),d.set(f,b)}return d}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:pe.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function Ne(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 Pe({overview:e,activePlan:r,report:o,reportState:d=o?"ready":"loading",sort:c}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(a=>[a.stableKey,a])),s=new Map(p.querySnapshots.map(a=>[a.queryId,a.queryText])),f=new Map;for(const a of p.assignments){if(e.queryClass!=="all"&&a.queryClass!==e.queryClass)continue;const y=s.get(a.queryId);if(!y)continue;const h=f.get(a.targetKey)??new Set;h.add(y),f.set(a.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,j=e.measurement.displayedRunId===void 0||b?"ready":d==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const a of p.groups)for(const y of a.targetKeys)g.has(y)||g.set(y,a.label);const $=e.properties.items.map(a=>{const y=n.get(a.targetKey),h=k.get(a.targetKey)??[];return{id:a.targetKey,name:a.label,mentionCoverage:M(a.mentionCoverage),citationCoverage:M(a.citationCoverage),status:Ce(a),providers:a.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(a.targetKey),assignedQueries:[...f.get(a.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:j,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(a=>({name:a.label,coverage:{numerator:a.credits,denominator:e.namedShareOfVoice.denominator}})),I=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:Ne(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:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...c?{sort:c}:{}},availableGroups:p.groups.map(a=>({id:a.stableKey,label:a.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ee as A,T as M,Ae as U,pe as V,Ke as a,we as b,Pe as c,Te as d,ye as m,Se as u};
|
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-BlrH2zRW.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-ZXXkndVj.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-radix-twS1M3FF.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-D-cUuLZo.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-N6vOpZmh.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="./assets/vendor-markdown-B4giJcws.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-HWSQgVum.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|
|
25
25
|
<div id="root"></div>
|
|
@@ -111,6 +111,7 @@ import {
|
|
|
111
111
|
sentimentBackfillSelectionSchema,
|
|
112
112
|
sentimentCompareRequestSchema,
|
|
113
113
|
sentimentComparisonReadSchema,
|
|
114
|
+
sentimentEvidenceOutcomeFilterSchema,
|
|
114
115
|
sentimentEvidencePageReadSchema,
|
|
115
116
|
sentimentEvidenceRequestSchema,
|
|
116
117
|
sentimentJobReadSchema,
|
|
@@ -131,7 +132,7 @@ import {
|
|
|
131
132
|
trafficSeriesGranularitySchema,
|
|
132
133
|
visibilityCompareSelectionSchema,
|
|
133
134
|
visibilityReportRequestSchema
|
|
134
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-TY3CJKKR.js";
|
|
135
136
|
|
|
136
137
|
// src/cli-error.ts
|
|
137
138
|
function isMachineFormat(format) {
|
|
@@ -1220,7 +1221,10 @@ var sentimentJobInputSchema = projectInputSchema.extend({
|
|
|
1220
1221
|
attemptLimit: z3.number().int().min(1).max(200).optional().describe(`Attempt receipts per page, newest first (default ${SENTIMENT_ATTEMPT_PAGE_DEFAULT}).`),
|
|
1221
1222
|
attemptCursor: z3.string().min(1).max(4096).optional().describe("nextAttemptCursor from the previous page of this job.")
|
|
1222
1223
|
});
|
|
1223
|
-
var sentimentEvidenceInputSchema = sentimentEvidenceRequestSchema.safeExtend({
|
|
1224
|
+
var sentimentEvidenceInputSchema = sentimentEvidenceRequestSchema.safeExtend({
|
|
1225
|
+
project: projectNameSchema,
|
|
1226
|
+
outcome: sentimentEvidenceOutcomeFilterSchema.optional().describe('Keep only assessments with these outcomes, for example ["mixed","unfavorable"] for the criticism behind a branded score or the non-brand exceptions. Narrows the page; never changes how answers were scored. Keep it unchanged when following nextCursor.')
|
|
1227
|
+
});
|
|
1224
1228
|
var sentimentCompareInputSchema = sentimentCompareRequestSchema.safeExtend({ project: projectNameSchema });
|
|
1225
1229
|
var sentimentConfigureInputSchema = sentimentSettingsUpdateSchema.extend({ project: projectNameSchema }).refine(
|
|
1226
1230
|
(input) => input.enabled !== void 0,
|
|
@@ -1269,7 +1273,7 @@ var canonryMcpTools = [
|
|
|
1269
1273
|
defineTool({
|
|
1270
1274
|
name: "canonry_sentiment",
|
|
1271
1275
|
title: "Read sentiment and per-query scores",
|
|
1272
|
-
description: 'Read stored model-classified language about frozen Simple identities or Advanced Properties. Returns headline and per-query favorable/mixed/unfavorable rates, judged and selected assessment counts, rated and eligible answers with their share (ratedAnswerRate: answers with a favorable, mixed or unfavorable rating over every eligible answer, admitted or not; each answer counts once), exclusions, intervals and method limitations. Favorable % is favorable / (favorable + mixed + unfavorable); factual and unjudged answers do not enter that denominator. Select branded or non-brand explicitly and keep their metrics separate; the default is branded. Optional queryId selects one frozen query. Query rows are compact and paged: queryLimit (default 25) rows per page, then pass queryPage.nextCursor as queryCursor. Per-engine assessment verdicts and per-location scores are opt-in with include=["assessments","locations"], or come by default when queryId names one query. Advanced rows are per executionNodeKey; pass it to narrow evidence to that node. Optional runIds selects the exact grouped location runs instead of runId. A known subject absent from a non-brand answer is not unfavorable. Partial values are provisional. Never starts a classifier. Preserve the resolved evaluationDefinitionId and complete selection for later evidence reads.',
|
|
1276
|
+
description: 'Read stored model-classified language about frozen Simple identities or Advanced Properties. Returns headline and per-query favorable/mixed/unfavorable rates, judged and selected assessment counts, rated and eligible answers with their share (ratedAnswerRate: answers with a favorable, mixed or unfavorable rating over every eligible answer, admitted or not; each answer counts once), exclusions, intervals and method limitations. Favorable % is favorable / (favorable + mixed + unfavorable); factual and unjudged answers do not enter that denominator. Select branded or non-brand explicitly and keep their metrics separate; the default is branded. Optional queryId selects one frozen query. Query rows are compact and paged: queryLimit (default 25) rows per page, then pass queryPage.nextCursor as queryCursor. Per-engine assessment verdicts and per-location scores are opt-in with include=["assessments","locations"], or come by default when queryId names one query. Advanced rows are per executionNodeKey; pass it to narrow evidence to that node. Optional runIds selects the exact grouped location runs instead of runId. A known subject absent from a non-brand answer is not unfavorable. Branded reads carry criticizedProperties: total Properties with a mixed or unfavorable rating, and keys, the first five property breakdown keys, most criticized first ({total: 0, keys: []} with fewer than two Properties in view; absent for non-brand, disabled or unavailable reads); read their answers on canonry_sentiment_evidence with scope property, that scopeKey and outcome ["mixed","unfavorable"]. Partial values are provisional. Never starts a classifier. Preserve the resolved evaluationDefinitionId and complete selection for later evidence reads.',
|
|
1273
1277
|
access: "read",
|
|
1274
1278
|
tier: "monitoring",
|
|
1275
1279
|
inputSchema: sentimentInputSchema,
|
|
@@ -1284,7 +1288,7 @@ var canonryMcpTools = [
|
|
|
1284
1288
|
defineTool({
|
|
1285
1289
|
name: "canonry_sentiment_evidence",
|
|
1286
1290
|
title: "Read sentiment evidence",
|
|
1287
|
-
description: "Page stored answer-subject assessments and exact source quotations. Returns frozen identity/context, source hash, evaluator and engine provenance, exclusions, and optional complaint. Optional assessmentId selects the exact stored answer-subject verdict from query assessments without widening its scope. Keep assessmentId, queryClass, optional frozen queryId, exact runId or runIds, every other selection field and resolved evaluationDefinitionId unchanged when following nextCursor. Advanced market refinement uses exact frozen usage edges. No provider calls.",
|
|
1291
|
+
description: "Page stored answer-subject assessments and exact source quotations. Returns frozen identity/context, source hash, evaluator and engine provenance, exclusions, and optional complaint. Optional assessmentId selects the exact stored answer-subject verdict from query assessments without widening its scope. Optional outcome keeps only the listed outcomes; the page echoes it as selection.outcome. Keep assessmentId, outcome, queryClass, optional frozen queryId, exact runId or runIds, every other selection field and resolved evaluationDefinitionId unchanged when following nextCursor. Advanced market refinement uses exact frozen usage edges. No provider calls.",
|
|
1288
1292
|
access: "read",
|
|
1289
1293
|
tier: "monitoring",
|
|
1290
1294
|
inputSchema: sentimentEvidenceInputSchema,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
installSkills,
|
|
5
5
|
loadConfigRaw,
|
|
6
6
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FDBQOQLP.js";
|
|
8
8
|
import {
|
|
9
9
|
PACKAGE_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BYSSJEL7.js";
|
|
11
11
|
import {
|
|
12
12
|
SKILL_MANIFEST_FILENAME,
|
|
13
13
|
SkillsClients
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TY3CJKKR.js";
|
|
15
15
|
|
|
16
16
|
// src/skills-autosync.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PACKAGE_VERSION,
|
|
6
6
|
canonryMcpTools,
|
|
7
7
|
isMachineFormat
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BYSSJEL7.js";
|
|
9
9
|
import {
|
|
10
10
|
AGENT_PROVIDER_IDS,
|
|
11
11
|
CANONRY_NPM_PACKAGE_URL,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
skillsClientSchema,
|
|
51
51
|
upgradeCaveatFor,
|
|
52
52
|
upgradeCommandFor
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-TY3CJKKR.js";
|
|
54
54
|
|
|
55
55
|
// src/config.ts
|
|
56
56
|
import fs from "fs";
|
|
@@ -609,6 +609,7 @@ import {
|
|
|
609
609
|
queryTrackingProvenanceSchema,
|
|
610
610
|
queryTrackingWorkspaceResponseSchema,
|
|
611
611
|
quotaExceeded,
|
|
612
|
+
rankCriticizedProperties,
|
|
612
613
|
recommendationBriefDtoSchema,
|
|
613
614
|
recommendationExplainRequestSchema,
|
|
614
615
|
recommendationExplanationDtoSchema,
|
|
@@ -779,7 +780,7 @@ import {
|
|
|
779
780
|
wordpressSchemaDeployResultDtoSchema,
|
|
780
781
|
wordpressSchemaStatusResultDtoSchema,
|
|
781
782
|
wordpressStatusDtoSchema
|
|
782
|
-
} from "./chunk-
|
|
783
|
+
} from "./chunk-TY3CJKKR.js";
|
|
783
784
|
|
|
784
785
|
// src/intelligence-service.ts
|
|
785
786
|
import { eq as eq82, desc as desc36, asc as asc15, and as and69, ne as ne14, or as or19, inArray as inArray31, gte as gte22, lte as lte20, isNull as isNull16, sql as sql31, exists } from "drizzle-orm";
|
|
@@ -13805,7 +13806,8 @@ var SentimentService = class {
|
|
|
13805
13806
|
return { ...scoreAssessments(group.measured, group.eligible, options), queryId: group.queryId, queryText: group.queryText, queryClass: selection.queryClass, sourceSnapshotIds: [...new Set(group.eligible.map((item2) => item2.snapshotId))].sort(), assessments, locations, executionNodeKey: group.executionNodeKey };
|
|
13806
13807
|
});
|
|
13807
13808
|
const next = rows.limit !== null && from + rows.limit < ordered.length ? rowKey(page3.at(-1)) : null;
|
|
13808
|
-
|
|
13809
|
+
const criticizedProperties = selection.queryClass === "branded" && !disabled ? rankCriticizedProperties(breakdowns) : void 0;
|
|
13810
|
+
return { summary: { ...base, breakdowns, ...criticizedProperties ? { criticizedProperties } : {} }, queries: queries2, total: ordered.length, next };
|
|
13809
13811
|
}
|
|
13810
13812
|
readSelection(projectId, query, withInput = false) {
|
|
13811
13813
|
if (query.runId && query.runIds) throw validationError("Choose runId or runIds, not both.");
|
|
@@ -13830,7 +13832,7 @@ var SentimentService = class {
|
|
|
13830
13832
|
const unavailable5 = { state: "unsupported", reason: read.reason, provisional: true, score: aggregateSentiment([]).score };
|
|
13831
13833
|
return {
|
|
13832
13834
|
...result,
|
|
13833
|
-
summary: { ...result.summary, ...unavailable5, breakdowns: result.summary.breakdowns.map((row) => ({ ...row, ...unavailable5 })) },
|
|
13835
|
+
summary: { ...result.summary, ...unavailable5, breakdowns: result.summary.breakdowns.map((row) => ({ ...row, ...unavailable5 })), criticizedProperties: void 0 },
|
|
13834
13836
|
queries: result.queries.map((row) => ({ ...row, ...unavailable5, assessments: row.assessments.map((assessment) => ({ ...assessment, state: "unsupported", outcome: null, reason: read.reason })), locations: row.locations.map((location) => ({ ...location, ...unavailable5 })) }))
|
|
13835
13837
|
};
|
|
13836
13838
|
}
|
|
@@ -13868,11 +13870,12 @@ var SentimentService = class {
|
|
|
13868
13870
|
return { configured, branded, nonBrand, overall: overallSentiment(reads, !configured) };
|
|
13869
13871
|
}
|
|
13870
13872
|
evidence(projectId, query, limit, cursor) {
|
|
13871
|
-
const { assessmentId, ...sourceSelection } = query;
|
|
13873
|
+
const { assessmentId, outcome: outcome2, ...sourceSelection } = query;
|
|
13874
|
+
const outcomes = outcome2?.length ? new Set(outcome2) : null;
|
|
13872
13875
|
const settings = this.settings(projectId);
|
|
13873
13876
|
const disabled = !settings.enabled || !settings.installEnabled;
|
|
13874
13877
|
const read = disabled ? this.readSelection(projectId, sourceSelection) : this.readSelection(projectId, sourceSelection, true);
|
|
13875
|
-
const selection = { ...read.selection, ...assessmentId ? { assessmentId } : {} };
|
|
13878
|
+
const selection = { ...read.selection, ...assessmentId ? { assessmentId } : {}, ...outcomes ? { outcome: [...outcomes].sort() } : {} };
|
|
13876
13879
|
let after = "";
|
|
13877
13880
|
if (cursor) {
|
|
13878
13881
|
const token = this.verify(cursor);
|
|
@@ -13881,7 +13884,7 @@ var SentimentService = class {
|
|
|
13881
13884
|
}
|
|
13882
13885
|
const state = this.present(read, settings, null).summary.state;
|
|
13883
13886
|
if (disabled) return { state, selection, items: [], nextCursor: null };
|
|
13884
|
-
const items = read.items.filter((item2) => !assessmentId || item2.work.id === assessmentId).sort((a, b) => a.work.id.localeCompare(b.work.id)).filter((item2) => item2.work.id > after);
|
|
13887
|
+
const items = read.items.filter((item2) => (!assessmentId || item2.work.id === assessmentId) && (!outcomes || outcomes.has(item2.outcome))).sort((a, b) => a.work.id.localeCompare(b.work.id)).filter((item2) => item2.work.id > after);
|
|
13885
13888
|
const page3 = items.slice(0, limit);
|
|
13886
13889
|
return { state, selection, items: page3.map((item2) => item2.evidence), nextCursor: items.length > limit ? this.sign({ projectId, selection, fingerprint: read.fingerprint, after: page3.at(-1).work.id }) : null };
|
|
13887
13890
|
}
|
|
@@ -13898,8 +13901,8 @@ var SentimentService = class {
|
|
|
13898
13901
|
const fromUnits = units(fromItems), toUnits = units(toItems);
|
|
13899
13902
|
const common = new Set([...fromUnits.byUnit.keys()].filter((key) => toUnits.byUnit.has(key)));
|
|
13900
13903
|
const settings = this.settings(projectId);
|
|
13901
|
-
const fromSummary = withoutNodeKeys(this.aggregate(from.selection, fromItems.filter((item2) => common.has(fromUnits.byItem.get(item2))), from.source, settings, COMPACT_ROWS, fromItems));
|
|
13902
|
-
const toSummary = withoutNodeKeys(this.aggregate(to.selection, toItems.filter((item2) => common.has(toUnits.byItem.get(item2))), to.source, settings, COMPACT_ROWS, toItems));
|
|
13904
|
+
const fromSummary = withoutCriticizedProperties(withoutNodeKeys(this.aggregate(from.selection, fromItems.filter((item2) => common.has(fromUnits.byItem.get(item2))), from.source, settings, COMPACT_ROWS, fromItems)));
|
|
13905
|
+
const toSummary = withoutCriticizedProperties(withoutNodeKeys(this.aggregate(to.selection, toItems.filter((item2) => common.has(toUnits.byItem.get(item2))), to.source, settings, COMPACT_ROWS, toItems)));
|
|
13903
13906
|
const refusalReasons = [];
|
|
13904
13907
|
const expectedFrom = from.source.assessments.length, expectedTo = to.source.assessments.length;
|
|
13905
13908
|
if (fromItems.length < expectedFrom || toItems.length < expectedTo) refusalReasons.push("classification-coverage-gap");
|
|
@@ -13972,6 +13975,10 @@ function append2(map, key, value) {
|
|
|
13972
13975
|
function queryRowKey(edge) {
|
|
13973
13976
|
return `${"queryKey" in edge ? edge.queryKey : edge.queryId}\0${edge.executionNodeKey ?? ""}`;
|
|
13974
13977
|
}
|
|
13978
|
+
function withoutCriticizedProperties(summary3) {
|
|
13979
|
+
const { criticizedProperties: _criticized, ...rest } = summary3;
|
|
13980
|
+
return rest;
|
|
13981
|
+
}
|
|
13975
13982
|
function withoutNodeKeys({ summary: summary3, queries: queries2 }) {
|
|
13976
13983
|
return { ...summary3, queries: queries2.map(({ executionNodeKey: _node, ...row }) => row) };
|
|
13977
13984
|
}
|
|
@@ -37292,7 +37299,7 @@ var routeCatalog = [
|
|
|
37292
37299
|
path: "/api/v1/projects/{name}/sentiment/evidence",
|
|
37293
37300
|
summary: "Read verbatim sentiment evidence",
|
|
37294
37301
|
tags: ["sentiment"],
|
|
37295
|
-
parameters: [nameParameter, ...sentimentSelectionParameters, { name: "assessmentId", in: "query", description: "Exact stored assessment within the authorized source, subject, scope, and evaluator selection. Does not widen access.", schema: stringSchema }, { name: "cursor", in: "query", description: "Opaque cursor bound to every selection field and resolved evaluator ID.", schema: stringSchema }, { name: "limit", in: "query", description: "Page size only; does not change assessment identity.", schema: { type: "integer", minimum: 1, maximum: 100, default: 50 } }],
|
|
37302
|
+
parameters: [nameParameter, ...sentimentSelectionParameters, { name: "assessmentId", in: "query", description: "Exact stored assessment within the authorized source, subject, scope, and evaluator selection. Does not widen access.", schema: stringSchema }, { name: "outcome", in: "query", description: "Outcomes to keep, repeated or comma-separated (for example mixed,unfavorable). Narrows the page to assessments with these outcomes; never changes how they were scored.", style: "form", explode: true, schema: { type: "array", items: { type: "string", enum: [...sentimentOutcomeSchema.options] }, minItems: 1 } }, { name: "cursor", in: "query", description: "Opaque cursor bound to every selection field and resolved evaluator ID.", schema: stringSchema }, { name: "limit", in: "query", description: "Page size only; does not change assessment identity.", schema: { type: "integer", minimum: 1, maximum: 100, default: 50 } }],
|
|
37296
37303
|
responses: { 200: jsonResponse("Stored answer-subject evidence page.", "SentimentEvidencePage"), 400: errorResponse("Invalid cursor or selection."), 404: errorResponse("Project or selected source not found.") }
|
|
37297
37304
|
},
|
|
37298
37305
|
{
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
siteCrawlGraphNodes,
|
|
6
6
|
siteCrawlPages,
|
|
7
7
|
siteCrawlSnapshots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RCQJI3UX.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-TY3CJKKR.js";
|
|
17
17
|
|
|
18
18
|
// src/site-audit-factors.ts
|
|
19
19
|
function recordedSharePct(factor) {
|
|
@@ -15656,7 +15656,11 @@ var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
|
|
|
15656
15656
|
queryLimit: z51.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
|
|
15657
15657
|
queryCursor: z51.string().min(1).max(16384).optional()
|
|
15658
15658
|
}).superRefine(exclusiveSentimentRuns);
|
|
15659
|
-
var
|
|
15659
|
+
var sentimentEvidenceOutcomeFilterSchema = z51.preprocess((value) => {
|
|
15660
|
+
const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
|
|
15661
|
+
return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
|
|
15662
|
+
}, z51.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
|
|
15663
|
+
var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z51.string().min(1).max(16384).optional(), limit: z51.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
|
|
15660
15664
|
var sentimentCompareRequestSchema = sentimentSelectionBaseSchema.extend({ fromRunId: id, toRunId: id }).superRefine((value, ctx) => {
|
|
15661
15665
|
exclusiveSentimentRuns(value, ctx);
|
|
15662
15666
|
if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
|
|
@@ -15706,9 +15710,25 @@ var sentimentSummarySchema = z51.object({
|
|
|
15706
15710
|
evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
|
|
15707
15711
|
breakdowns: z51.array(sentimentBreakdownSchema),
|
|
15708
15712
|
queries: z51.array(sentimentQuerySummarySchema),
|
|
15713
|
+
/**
|
|
15714
|
+
* Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
|
|
15715
|
+
* ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
|
|
15716
|
+
* property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
|
|
15717
|
+
* Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
|
|
15718
|
+
*/
|
|
15719
|
+
criticizedProperties: z51.object({ total: count, keys: z51.array(z51.string()) }).strict().optional(),
|
|
15709
15720
|
/** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
|
|
15710
15721
|
queryPage: z51.object({ total: count, limit: count, nextCursor: z51.string().nullable() }).strict().optional()
|
|
15711
15722
|
}).strict();
|
|
15723
|
+
var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
|
|
15724
|
+
function rankCriticizedProperties(rows) {
|
|
15725
|
+
const properties = rows.filter((row) => row.dimension === "property");
|
|
15726
|
+
if (properties.length < 2) return { total: 0, keys: [] };
|
|
15727
|
+
const criticized = properties.filter((row) => row.coverage.counts.mixed + row.coverage.counts.unfavorable > 0);
|
|
15728
|
+
const criticism = (row) => row.coverage.counts.mixed + row.coverage.counts.unfavorable;
|
|
15729
|
+
criticized.sort((a, b) => criticism(b) - criticism(a) || b.coverage.counts.unfavorable - a.coverage.counts.unfavorable || a.coverage.counts.favorable - b.coverage.counts.favorable || a.label.localeCompare(b.label) || a.key.localeCompare(b.key));
|
|
15730
|
+
return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
|
|
15731
|
+
}
|
|
15712
15732
|
var sentimentSettingsUpdateSchema = z51.object({ enabled: z51.boolean().optional() }).strict();
|
|
15713
15733
|
var sentimentSettingsSchema = z51.object({
|
|
15714
15734
|
installEnabled: z51.boolean(),
|
|
@@ -15780,7 +15800,7 @@ var sentimentEvidenceItemSchema = z51.object({
|
|
|
15780
15800
|
returnedModel: z51.string().nullable(),
|
|
15781
15801
|
reason: z51.string().nullable()
|
|
15782
15802
|
}).strict();
|
|
15783
|
-
var sentimentEvidencePageSchema = z51.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional() }), items: z51.array(sentimentEvidenceItemSchema), nextCursor: z51.string().nullable() }).strict();
|
|
15803
|
+
var sentimentEvidencePageSchema = z51.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z51.array(sentimentOutcomeSchema).optional() }), items: z51.array(sentimentEvidenceItemSchema), nextCursor: z51.string().nullable() }).strict();
|
|
15784
15804
|
var sentimentComparisonSchema = z51.object({
|
|
15785
15805
|
from: sentimentSummarySchema,
|
|
15786
15806
|
to: sentimentSummarySchema,
|
|
@@ -20570,9 +20590,11 @@ export {
|
|
|
20570
20590
|
SENTIMENT_QUERY_PAGE_DEFAULT,
|
|
20571
20591
|
SENTIMENT_QUERY_PAGE_MAX,
|
|
20572
20592
|
sentimentSummaryRequestSchema,
|
|
20593
|
+
sentimentEvidenceOutcomeFilterSchema,
|
|
20573
20594
|
sentimentEvidenceRequestSchema,
|
|
20574
20595
|
sentimentCompareRequestSchema,
|
|
20575
20596
|
sentimentSummarySchema,
|
|
20597
|
+
rankCriticizedProperties,
|
|
20576
20598
|
sentimentSettingsUpdateSchema,
|
|
20577
20599
|
sentimentSettingsSchema,
|
|
20578
20600
|
sentimentBackfillSelectionSchema,
|
|
@@ -20,21 +20,21 @@ import {
|
|
|
20
20
|
saveConfig,
|
|
21
21
|
saveConfigPatch,
|
|
22
22
|
sentimentInstallReadiness
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FDBQOQLP.js";
|
|
24
24
|
import {
|
|
25
25
|
computeFactorAverages,
|
|
26
26
|
deleteSiteCrawlGraphLayout,
|
|
27
27
|
persistSiteCrawlGraphLayout,
|
|
28
28
|
prepareSiteCrawlGraphLayout,
|
|
29
29
|
recordedSharePct
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SVTVBPIT.js";
|
|
31
31
|
import {
|
|
32
32
|
CanonryMcpToolNames,
|
|
33
33
|
CliError,
|
|
34
34
|
PACKAGE_VERSION,
|
|
35
35
|
canonryMcpTools,
|
|
36
36
|
isMachineFormat
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-BYSSJEL7.js";
|
|
38
38
|
import {
|
|
39
39
|
CC_CACHE_DIR,
|
|
40
40
|
DUCKDB_SPEC,
|
|
@@ -216,7 +216,7 @@ import {
|
|
|
216
216
|
siteLivenessState,
|
|
217
217
|
toAlertView,
|
|
218
218
|
usageCounters
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-RCQJI3UX.js";
|
|
220
220
|
import {
|
|
221
221
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
222
222
|
AGENT_NONE,
|
|
@@ -424,7 +424,7 @@ import {
|
|
|
424
424
|
visibilityReportRequestSchema,
|
|
425
425
|
winnabilityClassLabel,
|
|
426
426
|
withRetry
|
|
427
|
-
} from "./chunk-
|
|
427
|
+
} from "./chunk-TY3CJKKR.js";
|
|
428
428
|
|
|
429
429
|
// src/runtime-context.ts
|
|
430
430
|
function cliRuntimeContext(env = process.env, stdio = process) {
|
|
@@ -7882,7 +7882,7 @@ function nonBlank(value) {
|
|
|
7882
7882
|
return trimmed ? trimmed : void 0;
|
|
7883
7883
|
}
|
|
7884
7884
|
function resolveBuildCommit(env = process.env) {
|
|
7885
|
-
const embedded = true ? "
|
|
7885
|
+
const embedded = true ? "fd79321b46c7ef7c816bf08e424f67b869e07a0b" : void 0;
|
|
7886
7886
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
7887
7887
|
}
|
|
7888
7888
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -14694,7 +14694,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
14694
14694
|
return result2;
|
|
14695
14695
|
}
|
|
14696
14696
|
async function backfillInsightsCommand(project, opts) {
|
|
14697
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
14697
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-3L2665AK.js");
|
|
14698
14698
|
const config = loadConfig();
|
|
14699
14699
|
const db = createClient(config.database);
|
|
14700
14700
|
migrate(db);
|
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-UIDHHZH3.js";
|
|
39
39
|
import {
|
|
40
40
|
autoSyncSkills,
|
|
41
41
|
formatAutoSyncNotice
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-EQBYK77W.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-FDBQOQLP.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-SVTVBPIT.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-BYSSJEL7.js";
|
|
78
78
|
import {
|
|
79
79
|
CLOUDFLARE_WORKER_BINDINGS,
|
|
80
80
|
CLOUDFLARE_WORKER_GENERATED_MARKER,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
projects,
|
|
90
90
|
queries,
|
|
91
91
|
runs
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-RCQJI3UX.js";
|
|
93
93
|
import {
|
|
94
94
|
AdsDeliverySnapshotStatuses,
|
|
95
95
|
AdsHistoricalCampaignRollupStatuses,
|
|
@@ -200,7 +200,7 @@ import {
|
|
|
200
200
|
visibilityCompareSelectionSchema,
|
|
201
201
|
visibilityReportRequestSchema,
|
|
202
202
|
winnabilityClassSchema
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-TY3CJKKR.js";
|
|
204
204
|
|
|
205
205
|
// src/cli.ts
|
|
206
206
|
import { pathToFileURL } from "url";
|
|
@@ -471,6 +471,19 @@ function ratedAnswersLine({ ratedAnswers, eligibleAnswers, ratedAnswerRate }) {
|
|
|
471
471
|
if (ratedAnswerRate === null || ratedAnswerRate === void 0) return `Rated: Unavailable \xB7 ${eligibleAnswers} eligible ${eligibleAnswers === 1 ? "answer" : "answers"}`;
|
|
472
472
|
return `Rated: ${formatPercent(ratedAnswerRate, RatioUnits.fraction)} \xB7 ${ratedAnswers} of ${eligibleAnswers} ${eligibleAnswers === 1 ? "answer" : "answers"} rated`;
|
|
473
473
|
}
|
|
474
|
+
var CRITICIZED_PROPERTIES_TITLE = "Most criticized properties";
|
|
475
|
+
function printCriticizedProperties(value) {
|
|
476
|
+
const ranked = value.criticizedProperties;
|
|
477
|
+
if (!ranked?.keys.length) return;
|
|
478
|
+
const rows = new Map(value.breakdowns.filter((row) => row.dimension === "property").map((row) => [row.key, row]));
|
|
479
|
+
const listed = ranked.keys.flatMap((key) => rows.get(key) ?? []);
|
|
480
|
+
if (listed.length === 0) return;
|
|
481
|
+
console.log(`${CRITICIZED_PROPERTIES_TITLE}: ${listed.length} of ${ranked.total}`);
|
|
482
|
+
for (const row of listed) {
|
|
483
|
+
const { favorable, mixed, unfavorable } = row.coverage.counts;
|
|
484
|
+
console.log(` ${row.label} (${row.key}): ${favorable} favorable \xB7 ${mixed} mixed \xB7 ${unfavorable} unfavorable \xB7 ${row.coverage.judged} judged`);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
474
487
|
function printSummary(value) {
|
|
475
488
|
const label = value.selection.queryClass === "branded" ? "Branded" : "Non-brand";
|
|
476
489
|
console.log(`${label} sentiment: ${value.state}${value.provisional ? " \xB7 provisional" : ""}`);
|
|
@@ -497,6 +510,7 @@ function printSummary(value) {
|
|
|
497
510
|
}
|
|
498
511
|
}
|
|
499
512
|
for (const row of value.breakdowns) if (row.dimension !== "query") console.log(`${row.dimension} ${row.label} \xB7 ${row.queryClass}: ${row.score.favorableDisplay} favorable \xB7 ${row.coverage.judged} of ${row.coverage.selected} judged`);
|
|
513
|
+
printCriticizedProperties(value);
|
|
500
514
|
if (value.queryPage) console.log(`Query rows: ${value.queries.length} of ${value.queryPage.total}`);
|
|
501
515
|
if (value.queryPage?.nextCursor) console.log(`Next query cursor: ${value.queryPage.nextCursor}`);
|
|
502
516
|
}
|
|
@@ -511,7 +525,8 @@ async function configureSentiment(project2, request, format) {
|
|
|
511
525
|
async function showSentimentEvidence(project2, query, format) {
|
|
512
526
|
const value = await createApiClient().getSentimentEvidence(project2, query);
|
|
513
527
|
if (machine(value, format)) return;
|
|
514
|
-
|
|
528
|
+
const outcomes = value.selection.outcome?.length ? ` \xB7 outcomes ${value.selection.outcome.join(", ")}` : "";
|
|
529
|
+
console.log(`${value.selection.queryClass} sentiment evidence: ${value.state} \xB7 definition ${value.selection.evaluationDefinitionId ?? "not measured"}${outcomes}`);
|
|
515
530
|
for (const item of value.items) {
|
|
516
531
|
console.log(`
|
|
517
532
|
${item.subject.displayName} \xB7 ${item.outcome} \xB7 ${item.context.provider} \xB7 run ${item.runId}`);
|
|
@@ -629,12 +644,13 @@ var SENTIMENT_CLI_COMMANDS = [
|
|
|
629
644
|
},
|
|
630
645
|
{
|
|
631
646
|
path: ["sentiment", "evidence"],
|
|
632
|
-
usage: "canonry sentiment evidence <project> [selection options] [--assessment-id <id>] [--cursor <cursor>] [--limit 1..100] [--format json]",
|
|
633
|
-
help: `${readSelectionHelp} Use --assessment-id from a query assessment to read that exact stored verdict; existing scope filters still apply. Keep all selection fields, including assessmentId and the returned evaluationDefinitionId, when following a cursor. JSONL preserves the entire page envelope, including empty state and next cursor.`,
|
|
634
|
-
options: { ...readSelectionOptions, "assessment-id": stringOption(), cursor: stringOption(), limit: stringOption() },
|
|
647
|
+
usage: "canonry sentiment evidence <project> [selection options] [--assessment-id <id>] [--outcome mixed,unfavorable] [--cursor <cursor>] [--limit 1..100] [--format json]",
|
|
648
|
+
help: `${readSelectionHelp} Use --assessment-id from a query assessment to read that exact stored verdict; existing scope filters still apply. --outcome keeps only assessments with those outcomes (comma-separated or repeated, for example --outcome mixed,unfavorable for the criticism behind a branded score or the non-brand exceptions); it never changes how they were scored. Keep all selection fields, including assessmentId, outcome and the returned evaluationDefinitionId, when following a cursor. JSONL preserves the entire page envelope, including empty state and next cursor.`,
|
|
649
|
+
options: { ...readSelectionOptions, "assessment-id": stringOption(), outcome: multiStringOption(), cursor: stringOption(), limit: stringOption() },
|
|
635
650
|
run: (input) => showSentimentEvidence(project(input, "evidence"), parse(sentimentEvidenceRequestSchema, {
|
|
636
651
|
...readSelection(input),
|
|
637
652
|
assessmentId: getString(input.values, "assessment-id"),
|
|
653
|
+
outcome: getStringArray(input.values, "outcome")?.join(","),
|
|
638
654
|
cursor: getString(input.values, "cursor"),
|
|
639
655
|
limit: getString(input.values, "limit")
|
|
640
656
|
}), input.format)
|
|
@@ -734,7 +750,7 @@ function parseDemoTrustedProxies(values) {
|
|
|
734
750
|
async function demoCommand(options) {
|
|
735
751
|
const { host, port } = parseDemoListenOptions(options);
|
|
736
752
|
const trustProxy = parseDemoTrustedProxies(options.trustProxy);
|
|
737
|
-
const { createDemoServer } = await import("./demo-server-
|
|
753
|
+
const { createDemoServer } = await import("./demo-server-GWRYDPJC.js");
|
|
738
754
|
const app = await createDemoServer({ trustProxy });
|
|
739
755
|
let stopping = false;
|
|
740
756
|
const stop = () => {
|
|
@@ -15110,11 +15126,11 @@ function renderHuman2(overview) {
|
|
|
15110
15126
|
printScore("Index coverage ", scores.indexCoverage);
|
|
15111
15127
|
printScore("Competitor press.", scores.competitorPressure);
|
|
15112
15128
|
printScore("Run status ", scores.runStatus);
|
|
15113
|
-
const
|
|
15114
|
-
if (overview.sentiment?.configured &&
|
|
15129
|
+
const brandedSentiment = overview.sentiment?.branded;
|
|
15130
|
+
if (overview.sentiment?.configured && brandedSentiment && brandedSentiment.coverage.judged > 0 && brandedSentiment.score.favorableRate !== null) {
|
|
15115
15131
|
console.log(`
|
|
15116
|
-
|
|
15117
|
-
console.log(` ${
|
|
15132
|
+
Sentiment: ${brandedSentiment.score.favorableDisplay} favorable \xB7 branded queries`);
|
|
15133
|
+
console.log(` ${brandedSentiment.coverage.counts.favorable} favorable / ${brandedSentiment.coverage.judged} judged${brandedSentiment.provisional ? " \xB7 provisional" : ""}`);
|
|
15118
15134
|
}
|
|
15119
15135
|
console.log(`
|
|
15120
15136
|
Queries cited: ${queryCounts.citedQueries}/${queryCounts.totalQueries} (${formatPercent(queryCounts.citedRate)})`);
|