@canonry/canonry 5.34.0 → 6.0.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/aero/references/portfolio-analysis.md +15 -3
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +4 -8
- package/assets/assets/{AuditHistoryPanel-Ddg6JIi3.js → AuditHistoryPanel-Bz2NVB6-.js} +1 -1
- package/assets/assets/{BacklinksPage-DI9BmaYt.js → BacklinksPage-Dte5-usf.js} +1 -1
- package/assets/assets/{HistoryPage-CACIL005.js → HistoryPage-C1S4nw3I.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-D_i3t0DT.js → MeasurementPropertyPage-DWjsHZdt.js} +1 -1
- package/assets/assets/ProjectPage-CAJ9XvNt.js +8 -0
- package/assets/assets/RunsPage-D9wEJFfV.js +1 -0
- package/assets/assets/SettingsPage-CN3Gew7Y.js +1 -0
- package/assets/assets/SiteHealthSection-Bft5TfoU.js +4 -0
- package/assets/assets/TrafficPage-tkNvySQH.js +40 -0
- package/assets/assets/{TrafficSourceDetailPage-BPqNmuws.js → TrafficSourceDetailPage-RhRfPizo.js} +1 -1
- package/assets/assets/{extract-error-message-B7OeWj0x.js → extract-error-message-tfl_SU7q.js} +1 -1
- package/assets/assets/index-B11OXdEC.css +1 -0
- package/assets/assets/index-Cu_xgdb1.js +86 -0
- package/assets/assets/{react-sigma_core.esm.min-jiMNkILi.js → react-sigma_core.esm.min-BUu3mcQJ.js} +1 -1
- package/assets/assets/{v2-overview-adapter-Caj3bHQE.js → v2-overview-adapter-CzeGhaXn.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-VHPGBX4P.js → chunk-4NC5ZAC2.js} +3 -3
- package/dist/{chunk-NZCKJMLC.js → chunk-6M7HSNXJ.js} +2 -2
- package/dist/{chunk-AIAVZY6L.js → chunk-F4G7I7T7.js} +18 -132
- package/dist/{chunk-NOIK3FUO.js → chunk-HAALQW4R.js} +48 -15
- package/dist/{chunk-25H4K7KL.js → chunk-K4356AGP.js} +7 -7
- package/dist/{chunk-QTETJEHI.js → chunk-XGERCNUR.js} +6 -3
- package/dist/{chunk-G2K5KCUY.js → chunk-ZO62Z2WN.js} +27 -15
- package/dist/cli.js +13 -11
- package/dist/{demo-server-UI24OAHX.js → demo-server-54OUTZMY.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-ZKFLGJ23.js → intelligence-service-MEIAMMLT.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +12 -12
- package/assets/assets/ProjectPage-d1djqfh3.js +0 -8
- package/assets/assets/RunRow-CjhvvA6g.js +0 -1
- package/assets/assets/RunsPage-DuBhw2uc.js +0 -1
- package/assets/assets/SettingsPage-MUpfB0HH.js +0 -1
- package/assets/assets/SiteHealthSection-6qdXlFcO.js +0 -4
- package/assets/assets/TrafficPage--nGSOgqn.js +0 -40
- package/assets/assets/index-C4lreGwR.js +0 -86
- package/assets/assets/index-DX5M4MHr.css +0 -1
package/assets/assets/{react-sigma_core.esm.min-jiMNkILi.js → react-sigma_core.esm.min-BUu3mcQJ.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-Bft5TfoU.js";import"./index-Cu_xgdb1.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-llkUFBGR.js";import"./vendor-lucide-N6vOpZmh.js";import"./vendor-markdown-B4giJcws.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-B5okB5g-.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(r,n){return qt(r)||Yt(r,n)||Tt(r,n)||Xt()}var pe={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Ct=new Int8Array(4),be=new Int32Array(Ct.buffer,0,1),$t=new Float32Array(Ct.buffer,0,1),Kt=/^\s*rgba?\s*\(/,Jt=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function Qt(r){var n=0,i=0,e=0,t=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),e=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),e=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(t=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(Kt.test(r)){var a=r.match(Jt);a&&(n=+a[1],i=+a[2],e=+a[3],a[4]&&(t=+a[4]))}return{r:n,g:i,b:e,a:t}}var J={};for(var le in pe)J[le]=oe(pe[le]),J[pe[le]]=J[le];function Rt(r,n,i,e,t){return be[0]=e<<24|i<<16|n<<8|r,be[0]=be[0]&4278190079,$t[0]}function oe(r){if(r=r.toLowerCase(),typeof J[r]<"u")return J[r];var n=Qt(r),i=n.r,e=n.g,t=n.b,a=n.a;a=a*255|0;var o=Rt(i,e,t,a);return J[r]=o,o}var Ee={};function _t(r){if(typeof Ee[r]<"u")return Ee[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,e=r&255,t=255,a=Rt(n,i,e,t);return Ee[r]=a,a}function We(r,n,i,e){return i+(n<<8)+(r<<16)}function Ve(r,n,i,e,t,a){var o=Math.floor(i/a*t),s=Math.floor(r.drawingBufferHeight/a-e/a*t),l=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(o,s,1,1,r.RGBA,r.UNSIGNED_BYTE,l);var h=ee(l,4),u=h[0],d=h[1],f=h[2],g=h[3];return[u,d,f,g]}function c(r,n,i){return(n=ae(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function je(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.push.apply(i,e)}return i}function b(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?je(Object(i),!0).forEach(function(e){c(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function ei(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=Q(r))!==null;);return r}function Ae(){return Ae=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var e=ei(r,n);if(e){var t=Object.getOwnPropertyDescriptor(e,n);return t.get?t.get.call(arguments.length<3?r:i):t.value}},Ae.apply(null,arguments)}function wt(r,n,i,e){var t=Ae(Q(r.prototype),n,i);return typeof t=="function"?function(a){return t.apply(i,a)}:t}function ti(r){return r.normalized?1:r.size}function ye(r){var n=0;return r.forEach(function(i){return n+=ti(i)}),n}function xt(r,n,i){var e=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,t=n.createShader(e);if(t===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(t,i),n.compileShader(t);var a=n.getShaderParameter(t,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`loadShader: error while compiling the shader:
|
|
3
3
|
`.concat(o,`
|
|
4
4
|
`).concat(i))}return t}function ii(r,n){return xt("VERTEX",r,n)}function ri(r,n){return xt("FRAGMENT",r,n)}function ni(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var e,t;for(e=0,t=n.length;e<t;e++)r.attachShader(i,n[e]);r.linkProgram(i);var a=r.getProgramParameter(i,r.LINK_STATUS);if(!a){var o=r.getProgramInfoLog(i);throw r.deleteProgram(i),new Error("loadProgram: error while linking the program: ".concat(o))}return i}function Ze(r){var n=r.gl,i=r.buffer,e=r.program,t=r.vertexShader,a=r.fragmentShader;n.deleteShader(t),n.deleteShader(a),n.deleteProgram(e),n.deleteBuffer(i)}var qe=`#define PICKING_MODE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,j as a}from"./vendor-tanstack-ZXXkndVj.js";import{K as ie,fB as oe,B as le,aV as ue}from"./index-C4lreGwR.js";import{M as ce}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as pe,g as J}from"./vendor-lucide-N6vOpZmh.js";const 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 c=Math.max(0,Math.floor(e));const d={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return c>0;const b=Array.from(f);if(b.length===0)return c>0;if(c===0)return d.omitted=!0,!1;const N=b.length>c,k=b.slice(0,c);if(N&&!/\s/.test(b[c])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>c-40&&(k.length=g)}return d.omitted||=N,n[s]=k.join(""),c=N?0:c-k.length,k.length===0?!1:(d.lastNode=n,d.field=s,!0)};p(o),d.omitted&&(d.lastNode?d.lastNode[d.field]=`${d.lastNode[d.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const c=d=>{["link","linkReference","code","inlineCode"].includes(d.type)||(d.type==="text"&&(d.data={...d.data,hName:"span"}),d.children?.forEach(c))};c(o)}}}function fe({headingLevel:e}){return r=>{const o=[],c=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(c)};c(r);const d=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-d;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=j.useState("idle"),c=j.useRef(!1),d=async()=>{if(!c.current){c.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{c.current=!1}}};return a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[a.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{d()},children:r==="copying"?B.copying:B.copy}),a.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ae=j.memo(function({children:r,headingLevel:o=4,copyable:c=!1,highlightGroups:d,previewLength:p}){return a.jsxs("div",{className:"answer-markdown",children:[a.jsx(ce,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!d?.length}]],components:{p:({children:n})=>a.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>a.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>a.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>a.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>a.jsx("span",{children:typeof n=="string"&&d?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:a.jsx(j.Fragment,{children:oe(s,d)},f)):n}),a:({children:n,href:s})=>{const f=ie(s);return f?a.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):a.jsx("span",{children:n})},img:({alt:n})=>a.jsx("span",{children:n})},children:r}),c&&r.trim()?a.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",D="flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",E=e=>e.kind==="project"?"Whole site":e.label,R={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Se({options:e,selected:r,onSelect:o,marketKey:c,label:d="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=j.useState(""),[N,k]=j.useState([]),[g,$]=j.useState(!1),C=j.useRef(null),I=j.useRef(null),i=j.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(N.at(-1)??""),F=h.get(N.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),T=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),U=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},K=(g?[]:l?y.filter(t=>x?U(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(T),A=s.find(t=>t.kind==="market"&&t.id===(c??(r.kind==="market"?r.id:void 0))),H=l&&A&&(l.marketKeys?.includes(A.id)||A.parentGroupIds?.includes(l.id))?A.id:void 0,L=n?H??he(l):void 0,V=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(T),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?U(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&T(t)),z=l||g?[]:s.filter(t=>t.kind==="project"&&T(t));j.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},q=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ae=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(A?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(S=>{const w=h.get(S);return w?[q(w)]:[]}),v=m.find(S=>S.at(-1)===l?.id)??m.sort((S,w)=>w.length-S.length)[0]??[],Z=u?q(u):r.marketKeys?.length?[]:v;k(t?q(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},Y=t=>{k(q(t)),$(!1),b(""),I.current?.focus()},P=(t,u=E(t))=>a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!n?R.browse(E(t)):R.select(E(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!n?Y(t):se(t),children:[a.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?a.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),a.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?a.jsx("button",{type:"button","aria-label":R.browse(t.label),title:`Browse ${t.label}`,className:"flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",onClick:()=>Y(t),children:a.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,u)=>u.length>0?a.jsxs("section",{"aria-label":t,className:"mt-2",children:[a.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>P(m))]}):null,Q=(t,u,m)=>u.length>0?a.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[a.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>P(v))]},`${l?.id??"root"}:${t}`):null;return a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{id:`${i}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:d}),a.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[a.jsxs("summary",{id:`${i}-value`,"aria-labelledby":`${i}-label ${i}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ae()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===c)?.label??(r.marketKeys?.length?R.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,a.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),a.jsxs("div",{className:"visibility-scope-menu",children:[l||g?a.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[a.jsx("button",{type:"button",className:D,"aria-label":`Back to ${F?.label??"all groups"}`,onClick:()=>{k(N.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(pe,{size:16,"aria-hidden":"true"}),F?.label??"All groups"]})}),a.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,a.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),a.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?P(l,"All properties in this group"):null,z.map(t=>P(t)),l&&!x?Q("Subgroups",K,!0):G(l?"Subgroups":"Groups",K),x?G("Properties",V):Q(l&&K.length>0?"All properties":"Properties",V,!l||K.length===0),G("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?a.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":R.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[a.jsx("span",{children:"All properties"}),a.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&K.length+V.length+W.length+z.length===0?a.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Ee(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const c=new Map;if(!r)return c;const d=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=d.get(s.usageEdgeId);if(!f)continue;const b=c.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),c.set(f,b)}return c}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:ue.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function je(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function Ne(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function Re({overview:e,activePlan:r,report:o,reportState:c=o?"ready":"loading",sort:d}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(i=>[i.stableKey,i])),s=new Map(p.querySnapshots.map(i=>[i.queryId,i.queryText])),f=new Map;for(const i of p.assignments){if(e.queryClass!=="all"&&i.queryClass!==e.queryClass)continue;const y=s.get(i.queryId);if(!y)continue;const h=f.get(i.targetKey)??new Set;h.add(y),f.set(i.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,N=e.measurement.displayedRunId===void 0||b?"ready":c==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const i of p.groups)for(const y of i.targetKeys)g.has(y)||g.set(y,i.label);const $=e.properties.items.map(i=>{const y=n.get(i.targetKey),h=k.get(i.targetKey)??[];return{id:i.targetKey,name:i.label,mentionCoverage:M(i.mentionCoverage),citationCoverage:M(i.citationCoverage),status:Ce(i),providers:i.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(i.targetKey),assignedQueries:[...f.get(i.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:N,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(i=>({name:i.label,coverage:{numerator:i.credits,denominator:e.namedShareOfVoice.denominator}})),I=e.properties.items.flatMap(i=>i.flags>0?[{id:`property:${i.targetKey}`,property:i.label,summary:`${i.flags} ${i.flags===1?"result needs":"results need"} review.`,tone:"caution",count:i.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:je(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ne(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...d?{sort:d}:{}},availableGroups:p.groups.map(i=>({id:i.stableKey,label:i.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ae as A,R as M,Se as V,Ke as a,Ee as b,Re as c,ye as m};
|
|
1
|
+
import{r as j,j as a}from"./vendor-tanstack-ZXXkndVj.js";import{O as ie,fG as oe,B as le,aY as ue}from"./index-Cu_xgdb1.js";import{M as ce}from"./vendor-markdown-B4giJcws.js";import{C as de,$ as pe,g as J}from"./vendor-lucide-N6vOpZmh.js";const Ae="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function me({previewLength:e,highlight:r}){return o=>{if(e!==void 0&&Number.isFinite(e)){let c=Math.max(0,Math.floor(e));const d={field:"value",omitted:!1},p=n=>{if(n.type==="definition")return!0;if(n.children)return n.children=n.children.filter(p),n.children.length>0;const s=n.type==="image"||n.type==="imageReference"?"alt":"value",f=n[s];if(f===void 0)return c>0;const b=Array.from(f);if(b.length===0)return c>0;if(c===0)return d.omitted=!0,!1;const N=b.length>c,k=b.slice(0,c);if(N&&!/\s/.test(b[c])){let g=k.length-1;for(;g>=0&&!/\s/.test(k[g]);)g--;g>=0&&g>c-40&&(k.length=g)}return d.omitted||=N,n[s]=k.join(""),c=N?0:c-k.length,k.length===0?!1:(d.lastNode=n,d.field=s,!0)};p(o),d.omitted&&(d.lastNode?d.lastNode[d.field]=`${d.lastNode[d.field].trimEnd()}…`:o.children?.push({type:"paragraph",children:[{type:"text",value:"…"}]}))}if(r){const c=d=>{["link","linkReference","code","inlineCode"].includes(d.type)||(d.type==="text"&&(d.data={...d.data,hName:"span"}),d.children?.forEach(c))};c(o)}}}function fe({headingLevel:e}){return r=>{const o=[],c=p=>{p.type==="heading"&&p.depth&&o.push(p),p.children?.forEach(c)};c(r);const d=o.reduce((p,n)=>Math.min(p,n.depth),6);for(const p of o){const n=p.depth-d;p.depth=Math.min(6,e+n),p.data={...p.data,hProperties:{...p.data?.hProperties,"data-answer-heading-level":n+1}}}}}function ge({answer:e}){const[r,o]=j.useState("idle"),c=j.useRef(!1),d=async()=>{if(!c.current){c.current=!0,o("copying");try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}finally{c.current=!1}}};return a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[a.jsx(le,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{d()},children:r==="copying"?B.copying:B.copy}),a.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}const Ke=j.memo(function({children:r,headingLevel:o=4,copyable:c=!1,highlightGroups:d,previewLength:p}){return a.jsxs("div",{className:"answer-markdown",children:[a.jsx(ce,{remarkPlugins:[[fe,{headingLevel:o}],[me,{previewLength:p,highlight:!!d?.length}]],components:{p:({children:n})=>a.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>a.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:s})=>a.jsx("ol",{start:s,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>a.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),span:({children:n})=>a.jsx("span",{children:typeof n=="string"&&d?n.split(/(https?:\/\/[^\s<>]+)/i).map((s,f)=>f%2?s:a.jsx(j.Fragment,{children:oe(s,d)},f)):n}),a:({children:n,href:s})=>{const f=ie(s);return f?a.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):a.jsx("span",{children:n})},img:({alt:n})=>a.jsx("span",{children:n})},children:r}),c&&r.trim()?a.jsx(ge,{answer:r},r):null]})}),X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",D="flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",E=e=>e.kind==="project"?"Whole site":e.label,R={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},he=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Se({options:e,selected:r,onSelect:o,marketKey:c,label:d="Measurement scope",labelVisibility:p="visible",allowGroupSelect:n=!0}){const s=[...e].sort((t,u)=>t.label.localeCompare(u.label,void 0,{numeric:!0})||t.id.localeCompare(u.id)),[f,b]=j.useState(""),[N,k]=j.useState([]),[g,$]=j.useState(!1),C=j.useRef(null),I=j.useRef(null),i=j.useId(),y=s.filter(t=>t.kind==="group"),h=new Map(y.map(t=>[t.id,t])),l=h.get(N.at(-1)??""),F=h.get(N.at(-2)??""),x=f.trim().toLocaleLowerCase(),ne=y.filter(t=>!t.parentGroupIds?.some(u=>h.has(u))),_=s.filter(t=>t.kind==="property"),O=t=>(t.parentGroupIds??[]).map(u=>h.get(u)?.label).filter(Boolean).join(" · "),T=t=>`${E(t)} ${O(t)}`.toLocaleLowerCase().includes(x),U=t=>{const u=[...t.parentGroupIds??[]],m=new Set;for(;u.length;){const v=u.pop();if(v===l?.id)return!0;m.has(v)||(m.add(v),u.push(...h.get(v)?.parentGroupIds??[]))}return!1},A=(g?[]:l?y.filter(t=>x?U(t):t.parentGroupIds?.includes(l.id)):x?y:ne).filter(T),K=s.find(t=>t.kind==="market"&&t.id===(c??(r.kind==="market"?r.id:void 0))),H=l&&K&&(l.marketKeys?.includes(K.id)||K.parentGroupIds?.includes(l.id))?K.id:void 0,L=n?H??he(l):void 0,G=(l?_.filter(t=>t.parentGroupIds?.includes(l.id)&&(!L||t.marketKeys?.includes(L))):x||g||y.length===0?_:[]).filter(T),W=s.filter(t=>t.kind!=="market"||g||!n&&!l&&!x&&y.length>0||n&&l?.marketKeys?.length===1&&!x?!1:(l?x?U(t):t.parentGroupIds?.includes(l.id):x||!t.parentGroupIds?.some(m=>h.has(m)))&&T(t)),Y=l||g?[]:s.filter(t=>t.kind==="project"&&T(t));j.useEffect(()=>{const t=u=>{C.current?.open&&u.target instanceof Node&&!C.current.contains(u.target)&&(C.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const se=t=>{C.current&&(C.current.open=!1,C.current.querySelector("summary")?.focus());const u=n?t.kind==="property"?L:t.kind==="group"&&t.id===l?.id?H:void 0:void 0;u?o(t,u):o(t)},q=t=>{const u=[];let m=h.get(t.parentGroupIds?.[0]??"");for(;m&&!u.includes(m.id)&&m.id!==t.id;)u.unshift(m.id),m=h.get(m.parentGroupIds?.[0]??"");return[...u,t.id]},ae=()=>{const t=r.kind==="group"?h.get(r.id):void 0,u=h.get(K?.parentGroupIds?.[0]??""),m=(r.parentGroupIds??[]).flatMap(S=>{const w=h.get(S);return w?[q(w)]:[]}),v=m.find(S=>S.at(-1)===l?.id)??m.sort((S,w)=>w.length-S.length)[0]??[],Z=u?q(u):r.marketKeys?.length?[]:v;k(t?q(t):Z),$(r.kind==="property"&&Z.length===0&&y.length>0),b("")},z=t=>{k(q(t)),$(!1),b(""),I.current?.focus()},P=(t,u=E(t))=>a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{type:"button",className:D,"aria-label":t.kind==="group"&&!n?R.browse(E(t)):R.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:[a.jsxs("span",{className:"min-w-0 break-words",children:[u,x&&O(t)?a.jsx("span",{className:"block text-[13px] text-secondary",children:O(t)}):null]}),a.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?n?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),n&&t.kind==="group"&&t.id!==l?.id&&s.some(m=>m.parentGroupIds?.includes(t.id))?a.jsx("button",{type:"button","aria-label":R.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:a.jsx(J,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),V=(t,u)=>u.length>0?a.jsxs("section",{"aria-label":t,className:"mt-2",children:[a.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),u.map(m=>P(m))]}):null,Q=(t,u,m)=>u.length>0?a.jsxs("details",{open:m,className:"mt-2 border-y border-default",children:[a.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",u.length,")"]}),u.map(v=>P(v))]},`${l?.id??"root"}:${t}`):null;return a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{id:`${i}-label`,className:p==="sr-only"?"sr-only":"mb-1 block text-sm font-medium text-heading",children:d}),a.jsxs("details",{ref:C,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&I.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[a.jsxs("summary",{id:`${i}-value`,"aria-labelledby":`${i}-label ${i}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{C.current?.open||ae()},children:[`${E(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${s.find(t=>t.kind==="market"&&t.id===c)?.label??(r.marketKeys?.length?R.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,a.jsx(de,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),a.jsxs("div",{className:"visibility-scope-menu",children:[l||g?a.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[a.jsx("button",{type:"button",className:D,"aria-label":`Back to ${F?.label??"all groups"}`,onClick:()=>{k(N.slice(0,-1)),$(!1),b(""),I.current?.focus()},children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(pe,{size:16,"aria-hidden":"true"}),F?.label??"All groups"]})}),a.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:l?.label??"All properties"})]}):null,a.jsx("input",{ref:I,type:"search","aria-label":"Search scopes",className:X,placeholder:l?"Search within this group":g?"Search properties":"Search groups or properties",value:f,onChange:t=>b(t.target.value)}),a.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[n&&l&&!x?P(l,"All properties in this group"):null,Y.map(t=>P(t)),l&&!x?Q("Subgroups",A,!0):V(l?"Subgroups":"Groups",A),x?V("Properties",G):Q(l&&A.length>0?"All properties":"Properties",G,!l||A.length===0),V("Markets",W),!l&&!g&&!x&&y.length>0&&_.length>0?a.jsxs("button",{type:"button",className:`${D} mt-2 border-t border-default`,"aria-label":R.browseAll,onClick:()=>{$(!0),I.current?.focus()},children:[a.jsx("span",{children:"All properties"}),a.jsx(J,{size:18,"aria-hidden":"true"})]}):null,x&&A.length+G.length+W.length+Y.length===0?a.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}function Ee(e){const r=e[0];return r?e.every(o=>o.mode===r.mode&&o.scope.kind===r.scope.kind&&o.scope.key===r.scope.key&&o.queryClass===r.queryClass&&o.measurement.displayedRunId===r.measurement.displayedRunId):!0}function M(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator,...e.unattributed===void 0?{}:{unattributed:e.unattributed}}}function ye(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function be(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function xe(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function ke(e,r,o){const c=new Map;if(!r)return c;const d=new Map(e.usageEdges.map(s=>[te(s),s.targetKey])),p=new Map(e.assignments.map(s=>[`${s.targetKey}:${s.queryId}`,s.queryClass])),n=new Map(e.usageEdges.map(s=>[te(s),p.get(`${s.targetKey}:${s.queryId}`)]));for(const s of r.evidence){if(o&&n.get(s.usageEdgeId)!==o)continue;const f=d.get(s.usageEdgeId);if(!f)continue;const b=c.get(f)??[];b.push({id:`${s.observationId}:${s.expectedSlotId}:${s.usageEdgeId}:${s.sourceUrl}`,kind:be(s.classification),query:s.queryText,provider:s.provider,location:s.location,url:s.sourceUrl,tone:xe(s.classification),historical:s.historical||s.bridged}),c.set(f,b)}return c}function Ce(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(o=>o.state==="unavailable").map(o=>o.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("identity_ambiguous")?{label:ue.ambiguous,tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function je(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function Ne(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function Re({overview:e,activePlan:r,report:o,reportState:c=o?"ready":"loading",sort:d}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const p=r.plan,n=new Map(p.targets.map(i=>[i.stableKey,i])),s=new Map(p.querySnapshots.map(i=>[i.queryId,i.queryText])),f=new Map;for(const i of p.assignments){if(e.queryClass!=="all"&&i.queryClass!==e.queryClass)continue;const y=s.get(i.queryId);if(!y)continue;const h=f.get(i.targetKey)??new Set;h.add(y),f.set(i.targetKey,h)}const b=o?.revision===r.revision&&o.run?.id===e.measurement.displayedRunId?o:null,N=e.measurement.displayedRunId===void 0||b?"ready":c==="error"||o!=null?"error":"loading",k=ke(p,b,e.queryClass==="all"?void 0:e.queryClass),g=new Map;for(const i of p.groups)for(const y of i.targetKeys)g.has(y)||g.set(y,i.label);const $=e.properties.items.map(i=>{const y=n.get(i.targetKey),h=k.get(i.targetKey)??[];return{id:i.targetKey,name:i.label,mentionCoverage:M(i.mentionCoverage),citationCoverage:M(i.citationCoverage),status:Ce(i),providers:i.providers?.map(l=>({provider:l.provider,mentionCoverage:M(l.mentionCoverage),citationCoverage:M(l.citationCoverage)})),market:g.get(i.targetKey),assignedQueries:[...f.get(i.targetKey)??[]],urls:y?.urlMatchers.map(ye)??[],evidence:h,evidenceState:N,historical:h.some(l=>l.historical)}}),C=e.namedShareOfVoice?.entries.map(i=>({name:i.label,coverage:{numerator:i.credits,denominator:e.namedShareOfVoice.denominator}})),I=e.properties.items.flatMap(i=>i.flags>0?[{id:`property:${i.targetKey}`,property:i.label,summary:`${i.flags} ${i.flags===1?"result needs":"results need"} review.`,tone:"caution",count:i.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:je(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:Ne(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:M(e.metrics.propertiesMentioned),mentionCoverage:M(e.metrics.mentionCoverage),citationCoverage:M(e.metrics.citationCoverage)},properties:$,...C?{shareOfVoice:C}:{}},propertyTotal:e.properties.totalEstimate??$.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...d?{sort:d}:{}},availableGroups:p.groups.map(i=>({id:i.stableKey,label:i.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:I}}export{Ke as A,R as M,Se as V,Ae as a,Ee as b,Re as c,ye as m};
|
package/assets/index.html
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-Cu_xgdb1.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-ZXXkndVj.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-radix-twS1M3FF.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-llkUFBGR.js">
|
|
19
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-B11OXdEC.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|
|
25
25
|
<div id="root"></div>
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
installSkills,
|
|
5
5
|
loadConfigRaw,
|
|
6
6
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XGERCNUR.js";
|
|
8
8
|
import {
|
|
9
9
|
PACKAGE_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-K4356AGP.js";
|
|
11
11
|
import {
|
|
12
12
|
SKILL_MANIFEST_FILENAME,
|
|
13
13
|
SkillsClients
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HAALQW4R.js";
|
|
15
15
|
|
|
16
16
|
// src/skills-autosync.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
siteCrawlGraphNodes,
|
|
6
6
|
siteCrawlPages,
|
|
7
7
|
siteCrawlSnapshots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZO62Z2WN.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-HAALQW4R.js";
|
|
17
17
|
|
|
18
18
|
// src/site-audit-factors.ts
|
|
19
19
|
function recordedSharePct(factor) {
|
|
@@ -19,21 +19,21 @@ import {
|
|
|
19
19
|
runWithUsageTags,
|
|
20
20
|
saveConfigPatch,
|
|
21
21
|
sentimentInstallReadiness
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XGERCNUR.js";
|
|
23
23
|
import {
|
|
24
24
|
computeFactorAverages,
|
|
25
25
|
deleteSiteCrawlGraphLayout,
|
|
26
26
|
persistSiteCrawlGraphLayout,
|
|
27
27
|
prepareSiteCrawlGraphLayout,
|
|
28
28
|
recordedSharePct
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6M7HSNXJ.js";
|
|
30
30
|
import {
|
|
31
31
|
CanonryMcpToolNames,
|
|
32
32
|
CliError,
|
|
33
33
|
PACKAGE_VERSION,
|
|
34
34
|
canonryMcpTools,
|
|
35
35
|
isMachineFormat
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-K4356AGP.js";
|
|
37
37
|
import {
|
|
38
38
|
CC_CACHE_DIR,
|
|
39
39
|
DUCKDB_SPEC,
|
|
@@ -214,7 +214,7 @@ import {
|
|
|
214
214
|
siteLivenessState,
|
|
215
215
|
toAlertView,
|
|
216
216
|
usageCounters
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-ZO62Z2WN.js";
|
|
218
218
|
import {
|
|
219
219
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
220
220
|
AGENT_NONE,
|
|
@@ -414,7 +414,7 @@ import {
|
|
|
414
414
|
visibilityReportRequestSchema,
|
|
415
415
|
winnabilityClassLabel,
|
|
416
416
|
withRetry
|
|
417
|
-
} from "./chunk-
|
|
417
|
+
} from "./chunk-HAALQW4R.js";
|
|
418
418
|
|
|
419
419
|
// src/runtime-context.ts
|
|
420
420
|
function cliRuntimeContext(env = process.env, stdio = process) {
|
|
@@ -7830,7 +7830,7 @@ function nonBlank(value) {
|
|
|
7830
7830
|
return trimmed ? trimmed : void 0;
|
|
7831
7831
|
}
|
|
7832
7832
|
function resolveBuildCommit(env = process.env) {
|
|
7833
|
-
const embedded = true ? "
|
|
7833
|
+
const embedded = true ? "408113dd797bbfbe747b95111a724850117fb42b" : void 0;
|
|
7834
7834
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
7835
7835
|
}
|
|
7836
7836
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -14454,7 +14454,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
14454
14454
|
return result2;
|
|
14455
14455
|
}
|
|
14456
14456
|
async function backfillInsightsCommand(project, opts) {
|
|
14457
|
-
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-
|
|
14457
|
+
const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-MEIAMMLT.js");
|
|
14458
14458
|
const config = loadConfig();
|
|
14459
14459
|
const db = createClient(config.database);
|
|
14460
14460
|
migrate(db);
|
|
@@ -16687,19 +16687,9 @@ import { Agent } from "@earendil-works/pi-agent-core";
|
|
|
16687
16687
|
import "@earendil-works/pi-ai";
|
|
16688
16688
|
|
|
16689
16689
|
// src/agent/pi-models.ts
|
|
16690
|
-
import
|
|
16691
|
-
createProvider,
|
|
16692
|
-
envApiKeyAuth
|
|
16693
|
-
} from "@earendil-works/pi-ai";
|
|
16690
|
+
import "@earendil-works/pi-ai";
|
|
16694
16691
|
import { builtinModels } from "@earendil-works/pi-ai/providers/all";
|
|
16695
|
-
import { openAICompletionsApi } from "@earendil-works/pi-ai/api/openai-completions.lazy";
|
|
16696
16692
|
var aeroModels = builtinModels();
|
|
16697
|
-
aeroModels.setProvider(createProvider({
|
|
16698
|
-
id: "deepinfra",
|
|
16699
|
-
auth: { apiKey: envApiKeyAuth("DeepInfra", ["DEEPINFRA_TOKEN"]) },
|
|
16700
|
-
models: [],
|
|
16701
|
-
api: openAICompletionsApi()
|
|
16702
|
-
}));
|
|
16703
16693
|
var DEFAULT_MAX_RETRIES = 2;
|
|
16704
16694
|
var DEFAULT_MAX_OUTPUT_TOKENS = 32e3;
|
|
16705
16695
|
var CANONRY_USER_AGENT = "canonry";
|
|
@@ -16746,22 +16736,6 @@ var PROVIDER_MODELS = {
|
|
|
16746
16736
|
[LlmCapabilities.agent]: "glm-5.2",
|
|
16747
16737
|
[LlmCapabilities.analyze]: "glm-5-turbo",
|
|
16748
16738
|
[LlmCapabilities.classify]: "glm-5-turbo"
|
|
16749
|
-
},
|
|
16750
|
-
[AgentProviderIds.deepinfra]: {
|
|
16751
|
-
// DeepInfra `org/Model` slugs, resolved into a custom openai-completions
|
|
16752
|
-
// model rather than pi-ai's catalog.
|
|
16753
|
-
//
|
|
16754
|
-
// The agent tier is pinned explicitly: the dashboard picker sends a
|
|
16755
|
-
// provider and no model, so whatever sits here is what selecting DeepInfra
|
|
16756
|
-
// pins a session to.
|
|
16757
|
-
//
|
|
16758
|
-
// analyze + classify stay on GLM on purpose. Those tiers suppress the
|
|
16759
|
-
// reasoning trace through GLM's chat-template switch, and that branch
|
|
16760
|
-
// applies only to a model declared `reasoning: true`; moving them to
|
|
16761
|
-
// DeepSeek-V4-Flash (which is not) would quietly stop suppressing anything.
|
|
16762
|
-
[LlmCapabilities.agent]: "deepseek-ai/DeepSeek-V4-Flash",
|
|
16763
|
-
[LlmCapabilities.analyze]: "zai-org/GLM-5.2",
|
|
16764
|
-
[LlmCapabilities.classify]: "zai-org/GLM-5.2"
|
|
16765
16739
|
}
|
|
16766
16740
|
};
|
|
16767
16741
|
var AGENT_PROVIDERS = {
|
|
@@ -16788,72 +16762,6 @@ var AGENT_PROVIDERS = {
|
|
|
16788
16762
|
label: "Z.ai (GLM)",
|
|
16789
16763
|
defaultModel: PROVIDER_MODELS[AgentProviderIds.zai][LlmCapabilities.agent],
|
|
16790
16764
|
autoDetectPriority: 3
|
|
16791
|
-
},
|
|
16792
|
-
[AgentProviderIds.deepinfra]: {
|
|
16793
|
-
// `piAiProvider` is the canonical id here (not a pi-ai vendor) — it's the
|
|
16794
|
-
// `model.provider` string the agent loop hands to `getApiKey`, which
|
|
16795
|
-
// `resolveAgentId` maps straight back to the deepinfra config/env key.
|
|
16796
|
-
piAiProvider: AgentProviderIds.deepinfra,
|
|
16797
|
-
label: "DeepInfra (GLM / DeepSeek)",
|
|
16798
|
-
defaultModel: PROVIDER_MODELS[AgentProviderIds.deepinfra][LlmCapabilities.agent],
|
|
16799
|
-
autoDetectPriority: 4,
|
|
16800
|
-
openaiCompatible: {
|
|
16801
|
-
baseUrl: "https://api.deepinfra.com/v1/openai",
|
|
16802
|
-
baseUrlEnvVar: "DEEPINFRA_BASE_URL",
|
|
16803
|
-
apiKeyEnvVar: "DEEPINFRA_TOKEN",
|
|
16804
|
-
// DeepInfra serves open-weight models (GLM, DeepSeek) behind an
|
|
16805
|
-
// OpenAI-compatible vLLM endpoint. pi-ai's `detectCompat` has no rule
|
|
16806
|
-
// for api.deepinfra.com, so it would apply the strict OpenAI profile;
|
|
16807
|
-
// we set the same open-model profile pi-ai uses for deepseek.com /
|
|
16808
|
-
// cerebras / z.ai. `developer` role and `reasoning_effort` are
|
|
16809
|
-
// OpenAI-platform-isms these models reject, `store` is response
|
|
16810
|
-
// persistence DeepInfra doesn't implement, and DeepInfra documents
|
|
16811
|
-
// `max_tokens` (not `max_completion_tokens`) on its OpenAI route.
|
|
16812
|
-
compat: {
|
|
16813
|
-
supportsStore: false,
|
|
16814
|
-
supportsDeveloperRole: false,
|
|
16815
|
-
supportsReasoningEffort: false,
|
|
16816
|
-
maxTokensField: "max_tokens"
|
|
16817
|
-
},
|
|
16818
|
-
// Best-effort metadata. Costs are USD/1M tokens (DeepInfra published
|
|
16819
|
-
// rates: GLM-5.2 ~$0.95 in / $0.18 cached / $3.00 out; DeepSeek-V4-Flash
|
|
16820
|
-
// $0.09 in / $0.018 cached (0.2x input) / $0.18 out; DeepSeek-V4-Flash-0731
|
|
16821
|
-
// $0.06 in / $0.015 cached (0.25x input) / $0.18 out). cacheRead must carry
|
|
16822
|
-
// the cached rate, or cached input tokens are logged as free.
|
|
16823
|
-
// contextWindow is DeepInfra's 1M (fp4) serving window for these models;
|
|
16824
|
-
// it's descriptive (see OpenAiCompatibleModelMeta), so it documents the
|
|
16825
|
-
// real window rather than gating compaction.
|
|
16826
|
-
knownModels: {
|
|
16827
|
-
"zai-org/GLM-5.2": {
|
|
16828
|
-
contextWindow: 1048576,
|
|
16829
|
-
maxTokens: 98304,
|
|
16830
|
-
reasoning: true,
|
|
16831
|
-
cost: { input: 0.95, output: 3, cacheRead: 0.18, cacheWrite: 0 }
|
|
16832
|
-
},
|
|
16833
|
-
"deepseek-ai/DeepSeek-V4-Flash": {
|
|
16834
|
-
contextWindow: 1048576,
|
|
16835
|
-
maxTokens: 32768,
|
|
16836
|
-
reasoning: false,
|
|
16837
|
-
cost: { input: 0.09, output: 0.18, cacheRead: 0.018, cacheWrite: 0 }
|
|
16838
|
-
},
|
|
16839
|
-
"deepseek-ai/DeepSeek-V4-Flash-0731": {
|
|
16840
|
-
contextWindow: 1048576,
|
|
16841
|
-
maxTokens: 32768,
|
|
16842
|
-
reasoning: false,
|
|
16843
|
-
cost: { input: 0.06, output: 0.18, cacheRead: 0.015, cacheWrite: 0 }
|
|
16844
|
-
}
|
|
16845
|
-
},
|
|
16846
|
-
// Fallback for arbitrary `--model` slugs we don't ship as tiers. cost is
|
|
16847
|
-
// 0, so an unknown slug isn't cost-tracked by pi-ai's `calculateCost`;
|
|
16848
|
-
// contextWindow is 0 (unknown) because a guessed window would clamp a long
|
|
16849
|
-
// turn's output cap toward 1 token; the host enforces its real window.
|
|
16850
|
-
defaultModelMeta: {
|
|
16851
|
-
contextWindow: 0,
|
|
16852
|
-
maxTokens: 32768,
|
|
16853
|
-
reasoning: false,
|
|
16854
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }
|
|
16855
|
-
}
|
|
16856
|
-
}
|
|
16857
16765
|
}
|
|
16858
16766
|
};
|
|
16859
16767
|
function agentProvidersByPriority() {
|
|
@@ -16875,10 +16783,6 @@ function resolveModelForProvider(provider, modelId) {
|
|
|
16875
16783
|
function resolveModelForCapability(provider, capability, modelIdOverride) {
|
|
16876
16784
|
const entry = AGENT_PROVIDERS[provider];
|
|
16877
16785
|
const id = modelIdOverride ?? PROVIDER_MODELS[provider][capability];
|
|
16878
|
-
if (entry.openaiCompatible) {
|
|
16879
|
-
const suppressThinking = capability !== LlmCapabilities.agent;
|
|
16880
|
-
return buildOpenAiCompatibleModel(entry, id, suppressThinking);
|
|
16881
|
-
}
|
|
16882
16786
|
const model = aeroModels.getModel(entry.piAiProvider, id);
|
|
16883
16787
|
if (!model) {
|
|
16884
16788
|
throw new Error(
|
|
@@ -16892,31 +16796,8 @@ function resolveModelForCapability(provider, capability, modelIdOverride) {
|
|
|
16892
16796
|
}
|
|
16893
16797
|
return model;
|
|
16894
16798
|
}
|
|
16895
|
-
function buildOpenAiCompatibleModel(entry, id, suppressThinking = false) {
|
|
16896
|
-
const host = entry.openaiCompatible;
|
|
16897
|
-
if (!host) {
|
|
16898
|
-
throw new Error(`buildOpenAiCompatibleModel called for non-custom provider '${entry.piAiProvider}'`);
|
|
16899
|
-
}
|
|
16900
|
-
const meta = host.knownModels[id] ?? host.defaultModelMeta;
|
|
16901
|
-
const baseUrl = (host.baseUrlEnvVar ? process.env[host.baseUrlEnvVar] : void 0) || host.baseUrl;
|
|
16902
|
-
const compat = suppressThinking ? { ...host.compat, thinkingFormat: "chat-template", chatTemplateKwargs: { enable_thinking: { $var: "thinking.enabled" } } } : host.compat;
|
|
16903
|
-
return {
|
|
16904
|
-
id,
|
|
16905
|
-
name: id,
|
|
16906
|
-
api: "openai-completions",
|
|
16907
|
-
provider: entry.piAiProvider,
|
|
16908
|
-
baseUrl,
|
|
16909
|
-
reasoning: meta.reasoning,
|
|
16910
|
-
input: ["text"],
|
|
16911
|
-
cost: meta.cost,
|
|
16912
|
-
contextWindow: meta.contextWindow,
|
|
16913
|
-
maxTokens: meta.maxTokens,
|
|
16914
|
-
...compat ? { compat } : {}
|
|
16915
|
-
};
|
|
16916
|
-
}
|
|
16917
16799
|
function isAgentModelAvailable(provider, id) {
|
|
16918
|
-
|
|
16919
|
-
return !!entry.openaiCompatible || !!aeroModels.getModel(entry.piAiProvider, id);
|
|
16800
|
+
return !!aeroModels.getModel(AGENT_PROVIDERS[provider].piAiProvider, id);
|
|
16920
16801
|
}
|
|
16921
16802
|
function validateAgentProviderRegistry() {
|
|
16922
16803
|
for (const provider of listAgentProviders()) {
|
|
@@ -16952,7 +16833,6 @@ var CATALOG_API_KEY_ENV_VARS = {
|
|
|
16952
16833
|
};
|
|
16953
16834
|
function agentProviderApiKeyEnvVars(id) {
|
|
16954
16835
|
const entry = AGENT_PROVIDERS[id];
|
|
16955
|
-
if (entry.openaiCompatible) return [entry.openaiCompatible.apiKeyEnvVar];
|
|
16956
16836
|
return CATALOG_API_KEY_ENV_VARS[entry.piAiProvider] ?? [`${entry.piAiProvider.toUpperCase()}_API_KEY`];
|
|
16957
16837
|
}
|
|
16958
16838
|
function agentProviderApiKeyEnvVar(id) {
|
|
@@ -17181,6 +17061,9 @@ function render(schema, value, components, depth) {
|
|
|
17181
17061
|
if (rendered !== child) changed = true;
|
|
17182
17062
|
out[key] = rendered;
|
|
17183
17063
|
}
|
|
17064
|
+
if (typeof current.value === "number" && typeof out.value === "string" && Number.isInteger(current.numerator) && Number.isInteger(current.denominator)) {
|
|
17065
|
+
out.value = `${out.value} (${current.numerator}/${current.denominator})`;
|
|
17066
|
+
}
|
|
17184
17067
|
return changed ? out : current;
|
|
17185
17068
|
}
|
|
17186
17069
|
return current;
|
|
@@ -18409,7 +18292,7 @@ function buildAeroViewTool(options, validatedEvidence) {
|
|
|
18409
18292
|
}
|
|
18410
18293
|
};
|
|
18411
18294
|
}
|
|
18412
|
-
var AERO_RUNTIME_PROMPT = "\n\nNative Aero tools: when present, use aero_list_toolkits and aero_load_toolkit to discover and load task-specific tools before calling them. Otherwise use the exposed catalog. Start view-relative analysis with aero_inspect_view when available. Cite the returned source.href beside claims. Name the measurement date, class, numerator/denominator, and comparison limitations. Separate observations from possible explanations; do not infer causation. Never turn missing, incomplete, or truncated evidence into zero. A tool result that says it was truncated is partial: never list, rank, count or group items you did not see; say what was cut. Without current view context, resolve ambiguous references before making scoped claims.";
|
|
18295
|
+
var AERO_RUNTIME_PROMPT = "\n\nNative Aero tools: when present, use aero_list_toolkits and aero_load_toolkit to discover and load task-specific tools before calling them. Otherwise use the exposed catalog. Start view-relative analysis with aero_inspect_view when available. Cite the returned source.href beside claims. Name the measurement date, class, numerator/denominator, and comparison limitations. Separate observations from possible explanations; do not infer causation. Never turn missing, incomplete, or truncated evidence into zero. A tool result that says it was truncated is partial: never list, rank, count or group items you did not see; say what was cut. Claim a rank or superlative (first, second, top, most, largest, worst) only from a rank field or a list you saw in full. Without current view context, resolve ambiguous references before making scoped claims. Reply with the final answer only: no plan, no narration of what you will do next, and no draft before it.";
|
|
18413
18296
|
function aeroViewPrompt(context) {
|
|
18414
18297
|
return context ? `
|
|
18415
18298
|
|
|
@@ -18883,7 +18766,7 @@ Project shape: an Advanced Measurement plan on the legacy schema v1 (plan revisi
|
|
|
18883
18766
|
prompt: `
|
|
18884
18767
|
|
|
18885
18768
|
Project shape: an Advanced Measurement portfolio (plan revision ${version.revision}) with ${size}, ${queriesIn("branded")} branded and ${queriesIn("non-brand")} non-brand queries. This line settles the project type.
|
|
18886
|
-
Rules: measure per Property, group or market, never pool branded and non-brand, and a query shared by several Properties is one answer scored for each. Denominators count answers (queries x engines), not queries; label them answers. Group Properties only by the metro and submarkets the tools return, never by name. Names given instead were written in the answer text, not cited; cited domains are sources and never go under a named-instead heading. Name only engines a tool returned. Between two sweeps, a Property that moved ${MEASUREMENT_CHANGES_NOISE_ANSWERS} answers or fewer is within noise (withinNoise): never call it a gain, loss, trend or regression. Properties tied at the weakest rate are not ranked: they are listed by name, so say how many tie (tiedAtWeakest.count), give tiedAtWeakest.byMetro, and call the listed rows examples of the tie, not a ranked bottom list. A result with truncated true, a total above its rows, __partialLists or __truncation is partial: say how many of how many you saw, and never call those rows the biggest, all, or the full picture.
|
|
18769
|
+
Rules: measure per Property, group or market, never pool branded and non-brand, and a query shared by several Properties is one answer scored for each. Denominators count answers (queries x engines), not queries; label them answers. Group Properties only by the metro and submarkets the tools return, never by name. Names given instead were written in the answer text, not cited; cited domains are sources and never go under a named-instead heading. Name only engines a tool returned. Between two sweeps, a Property that moved ${MEASUREMENT_CHANGES_NOISE_ANSWERS} answers or fewer is within noise (withinNoise): never call it a gain, loss, trend or regression. Judge mention and citation separately (mentionWithinNoise, citationWithinNoise): a signal that moved ${MEASUREMENT_CHANGES_NOISE_ANSWERS} answers or fewer is within noise even when the Property's other signal moved more. Quote every coverage figure with its counts, headline and branded figures included; the value text carries them, as in 25.0% (6/24). A Property's citation coverage counts only citations of its own page: 0% does not mean your domain went uncited (weakestAnswerSources.ownDomainAnswers counts that). Property names often carry the brand, so that most listed Properties carry it is not a finding. Properties tied at the weakest rate are not ranked: they are listed by name, so say how many tie (tiedAtWeakest.count), give tiedAtWeakest.byMetro, and call the listed rows examples of the tie, not a ranked bottom list. A result with truncated true, a total above its rows, __partialLists or __truncation is partial: say how many of how many you saw, and never call those rows the biggest, all, or the full picture.
|
|
18887
18770
|
Route each question to its read:
|
|
18888
18771
|
${ADVANCED_ROUTES.map((route) => `- ${route}`).join("\n")}
|
|
18889
18772
|
canonry_visibility_report describes the whole project, not one Property. canonry_measurement_plan_get is plan structure with no metrics; do not read it for analysis.`,
|
|
@@ -19420,7 +19303,9 @@ ${lines.join("\n")}
|
|
|
19420
19303
|
*/
|
|
19421
19304
|
resolveTurnModel(preferences, current) {
|
|
19422
19305
|
const pinned = resolveConfiguredAgentProvider(this.opts.config);
|
|
19423
|
-
const
|
|
19306
|
+
const stored = coerceAgentProvider(current.provider ?? void 0);
|
|
19307
|
+
const provider = preferences?.provider ?? pinned ?? stored ?? detectAgentProvider(this.opts.config);
|
|
19308
|
+
if (!provider) throw new Error(missingProviderMessage());
|
|
19424
19309
|
const carried = !preferences?.provider && !pinned && provider === current.provider && current.modelId && isAgentModelAvailable(provider, current.modelId) ? current.modelId : void 0;
|
|
19425
19310
|
const pinnedModelId = provider === pinned ? this.opts.config.agent?.model ?? void 0 : void 0;
|
|
19426
19311
|
const modelId = preferences?.modelId ?? pinnedModelId ?? carried ?? getAgentProvider(provider).defaultModel;
|
|
@@ -19592,6 +19477,7 @@ ${lines.join("\n")}
|
|
|
19592
19477
|
});
|
|
19593
19478
|
return;
|
|
19594
19479
|
}
|
|
19480
|
+
this.resolveTurnModel(void 0, { provider: row.modelProvider, modelId: row.modelId });
|
|
19595
19481
|
const existing = parseJsonColumn(row.followUpQueue, []);
|
|
19596
19482
|
this.updateRow(projectId, { followUpQueue: JSON.stringify([...existing, message]) });
|
|
19597
19483
|
}
|
|
@@ -8062,8 +8062,16 @@ var measurementPortfolioAnswerSourcesSchema = z22.object({
|
|
|
8062
8062
|
properties: measurementDemoCountSchema,
|
|
8063
8063
|
answers: measurementDemoCountSchema,
|
|
8064
8064
|
domains: z22.array(measurementPortfolioCountedDomainSchema).max(MEASUREMENT_PORTFOLIO_ANSWER_SOURCES_LIMIT),
|
|
8065
|
-
domainTotal: measurementDemoCountSchema
|
|
8065
|
+
domainTotal: measurementDemoCountSchema,
|
|
8066
|
+
/**
|
|
8067
|
+
* Answers in the basis that cite any of the project's own domains, each
|
|
8068
|
+
* answer once. Optional only so an older server's response still parses.
|
|
8069
|
+
*/
|
|
8070
|
+
ownDomainAnswers: measurementDemoCountSchema.optional()
|
|
8066
8071
|
}).strict().superRefine((sources, ctx) => {
|
|
8072
|
+
if (sources.ownDomainAnswers !== void 0 && sources.ownDomainAnswers > sources.answers) {
|
|
8073
|
+
ctx.addIssue({ code: z22.ZodIssueCode.custom, path: ["ownDomainAnswers"], message: "Own-domain answers cannot exceed the basis" });
|
|
8074
|
+
}
|
|
8067
8075
|
if (sources.domains.length > sources.domainTotal) {
|
|
8068
8076
|
ctx.addIssue({ code: z22.ZodIssueCode.custom, path: ["domainTotal"], message: "Total cannot be smaller than the returned domains" });
|
|
8069
8077
|
}
|
|
@@ -8414,7 +8422,14 @@ var measurementChangedPropertySchema = measurementDemoPropertySchema.extend({
|
|
|
8414
8422
|
* whenever the denominator held. False when a metric was measured in one
|
|
8415
8423
|
* run only.
|
|
8416
8424
|
*/
|
|
8417
|
-
withinNoise: z22.boolean().optional()
|
|
8425
|
+
withinNoise: z22.boolean().optional(),
|
|
8426
|
+
/**
|
|
8427
|
+
* The same noise rule for each signal alone: a Property beyond noise overall
|
|
8428
|
+
* can still have one signal that moved two answers or fewer, which is not a
|
|
8429
|
+
* gain or loss on its own. Null when that signal cannot be sized.
|
|
8430
|
+
*/
|
|
8431
|
+
mentionWithinNoise: z22.boolean().nullable().optional(),
|
|
8432
|
+
citationWithinNoise: z22.boolean().nullable().optional()
|
|
8418
8433
|
}).strict();
|
|
8419
8434
|
var measurementChangesResponseSchema = z22.object({
|
|
8420
8435
|
current: measurementComparableRunSchema,
|
|
@@ -9262,6 +9277,14 @@ function formatDate(iso) {
|
|
|
9262
9277
|
return iso;
|
|
9263
9278
|
}
|
|
9264
9279
|
}
|
|
9280
|
+
var MONTH_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
9281
|
+
function formatCalendarDay(day, now = /* @__PURE__ */ new Date()) {
|
|
9282
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(day);
|
|
9283
|
+
const month = match ? MONTH_NAMES[Number(match[2]) - 1] : void 0;
|
|
9284
|
+
if (!match || !month) return day;
|
|
9285
|
+
const label = `${month} ${Number(match[3])}`;
|
|
9286
|
+
return Number(match[1]) === now.getFullYear() ? label : `${label}, ${match[1]}`;
|
|
9287
|
+
}
|
|
9265
9288
|
function formatIsoDate(iso) {
|
|
9266
9289
|
if (!iso) return "\u2014";
|
|
9267
9290
|
try {
|
|
@@ -9640,8 +9663,8 @@ function dayOf(value) {
|
|
|
9640
9663
|
function sortedUnique(days) {
|
|
9641
9664
|
return [...new Set(days.filter((d) => d !== null))].sort();
|
|
9642
9665
|
}
|
|
9643
|
-
function normalizeEngineChange(provider, entry) {
|
|
9644
|
-
const engine =
|
|
9666
|
+
function normalizeEngineChange(provider, entry, engineName) {
|
|
9667
|
+
const engine = engineName(provider);
|
|
9645
9668
|
const perChange = Array.isArray(entry.changes) ? entry.changes : [];
|
|
9646
9669
|
const changeCount = countOf(entry.changeCount) || perChange.length;
|
|
9647
9670
|
const unconfirmedCount = Math.min(
|
|
@@ -9677,8 +9700,8 @@ function joinNames(names) {
|
|
|
9677
9700
|
}
|
|
9678
9701
|
function whenPhrase(dates, count2) {
|
|
9679
9702
|
if (dates.length === 0) return null;
|
|
9680
|
-
if (dates.length === 1 && count2 <= 1) return `on ${dates[0]}`;
|
|
9681
|
-
return `more than once between ${dates[0]} and ${dates[dates.length - 1]}`;
|
|
9703
|
+
if (dates.length === 1 && count2 <= 1) return `on ${formatCalendarDay(dates[0])}`;
|
|
9704
|
+
return `more than once between ${formatCalendarDay(dates[0])} and ${formatCalendarDay(dates[dates.length - 1])}`;
|
|
9682
9705
|
}
|
|
9683
9706
|
function engineClause(change) {
|
|
9684
9707
|
const confirmedWhen = whenPhrase(change.confirmedDates, change.confirmedCount);
|
|
@@ -9700,10 +9723,11 @@ function uncheckedTailSentence(entries) {
|
|
|
9700
9723
|
const unchecked = entries.filter((e) => !e.checkedThroughPeriodEnd && e.knownGoodAsOf !== null);
|
|
9701
9724
|
if (unchecked.length === 0) return null;
|
|
9702
9725
|
const oldest = unchecked.map((e) => e.knownGoodAsOf).sort()[0];
|
|
9703
|
-
return `We last checked for model updates on ${oldest}, and this period runs past that date, so there may be later updates we do not know about.`;
|
|
9726
|
+
return `We last checked for model updates on ${formatCalendarDay(oldest)}, and this period runs past that date, so there may be later updates we do not know about.`;
|
|
9704
9727
|
}
|
|
9705
|
-
function buildModelChangeNotice(disclosures) {
|
|
9706
|
-
const
|
|
9728
|
+
function buildModelChangeNotice(disclosures, options = {}) {
|
|
9729
|
+
const engineName = options.engineName ?? answerEngineName;
|
|
9730
|
+
const entries = Object.entries(disclosures ?? {}).map(([provider, entry]) => normalizeEngineChange(provider, entry ?? {}, engineName)).sort((a, b) => a.engine.localeCompare(b.engine));
|
|
9707
9731
|
if (entries.length === 0) return null;
|
|
9708
9732
|
const changed = entries.filter((e) => e.confirmedCount + e.unconfirmedCount > 0);
|
|
9709
9733
|
if (changed.length === 0) {
|
|
@@ -9711,7 +9735,7 @@ function buildModelChangeNotice(disclosures) {
|
|
|
9711
9735
|
const plural = engines.length > 1;
|
|
9712
9736
|
const tail2 = uncheckedTailSentence(entries);
|
|
9713
9737
|
const checked = [...new Set(entries.map((e) => e.knownGoodAsOf).filter((d) => d !== null))].sort();
|
|
9714
|
-
const freshness = tail2 ?? (checked.length > 0 ? `We last checked for model updates on ${checked[0]}.` : null);
|
|
9738
|
+
const freshness = tail2 ?? (checked.length > 0 ? `We last checked for model updates on ${formatCalendarDay(checked[0])}.` : null);
|
|
9715
9739
|
return {
|
|
9716
9740
|
kind: "no-known-change",
|
|
9717
9741
|
text: `No model updates are on record for ${joinNames(engines)} in this period.`,
|
|
@@ -11720,8 +11744,7 @@ var ProviderIds = {
|
|
|
11720
11744
|
muse: "muse",
|
|
11721
11745
|
local: "local",
|
|
11722
11746
|
cdpChatgpt: "cdp:chatgpt",
|
|
11723
|
-
zai: "zai"
|
|
11724
|
-
deepinfra: "deepinfra"
|
|
11747
|
+
zai: "zai"
|
|
11725
11748
|
};
|
|
11726
11749
|
var PROVIDER_IDS = Object.values(ProviderIds);
|
|
11727
11750
|
var SweepProviderIds = {
|
|
@@ -11738,13 +11761,16 @@ var AgentProviderIds = {
|
|
|
11738
11761
|
claude: ProviderIds.claude,
|
|
11739
11762
|
openai: ProviderIds.openai,
|
|
11740
11763
|
gemini: ProviderIds.gemini,
|
|
11741
|
-
zai: ProviderIds.zai
|
|
11742
|
-
deepinfra: ProviderIds.deepinfra
|
|
11764
|
+
zai: ProviderIds.zai
|
|
11743
11765
|
};
|
|
11744
11766
|
var AGENT_PROVIDER_IDS = Object.values(AgentProviderIds);
|
|
11745
11767
|
function isAgentProviderId(value) {
|
|
11746
11768
|
return AGENT_PROVIDER_IDS.includes(value);
|
|
11747
11769
|
}
|
|
11770
|
+
var RETIRED_AGENT_PROVIDER_IDS = ["deepinfra"];
|
|
11771
|
+
function isRetiredAgentProviderId(value) {
|
|
11772
|
+
return RETIRED_AGENT_PROVIDER_IDS.includes(value);
|
|
11773
|
+
}
|
|
11748
11774
|
var LlmCapabilities = {
|
|
11749
11775
|
agent: "agent",
|
|
11750
11776
|
analyze: "analyze",
|
|
@@ -14048,6 +14074,12 @@ var sourceCategoryCountSchema = z43.object({
|
|
|
14048
14074
|
});
|
|
14049
14075
|
var sourceRankEntrySchema = z43.object({
|
|
14050
14076
|
domain: z43.string(),
|
|
14077
|
+
/**
|
|
14078
|
+
* 1-based position by `count` over the whole scope, before any `limit`.
|
|
14079
|
+
* Domains with equal counts share a rank (competition ranking: 1, 2, 2, 4).
|
|
14080
|
+
* Optional only so an older server's response still parses.
|
|
14081
|
+
*/
|
|
14082
|
+
rank: z43.number().int().positive().optional(),
|
|
14051
14083
|
count: z43.number().int(),
|
|
14052
14084
|
/** Share of the list's `totalCitedSlots`, 0..1 (at wire precision). */
|
|
14053
14085
|
percentage: fraction(),
|
|
@@ -15318,7 +15350,7 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
|
15318
15350
|
))
|
|
15319
15351
|
};
|
|
15320
15352
|
}
|
|
15321
|
-
var agentProviderIdSchema = z49.enum(["claude", "openai", "gemini", "zai"
|
|
15353
|
+
var agentProviderIdSchema = z49.enum(["claude", "openai", "gemini", "zai"]);
|
|
15322
15354
|
var agentProviderOptionDtoSchema = z49.object({
|
|
15323
15355
|
/** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
|
|
15324
15356
|
id: agentProviderIdSchema,
|
|
@@ -21694,6 +21726,7 @@ export {
|
|
|
21694
21726
|
AgentProviderIds,
|
|
21695
21727
|
AGENT_PROVIDER_IDS,
|
|
21696
21728
|
isAgentProviderId,
|
|
21729
|
+
isRetiredAgentProviderId,
|
|
21697
21730
|
LlmCapabilities,
|
|
21698
21731
|
LLM_CAPABILITIES,
|
|
21699
21732
|
providerSummaryEntryDtoSchema,
|