@canonry/canonry 7.72.0 → 7.72.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/{AgentSetupPage-kkWYCvUB.js → AgentSetupPage-D39M9CRK.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-DL9cbtVz.js +4 -0
- package/assets/assets/{ProjectPage-CYBZBlk3.js → ProjectPage-DXh97uDN.js} +5 -5
- package/assets/assets/{RunsPage-D27pEHr4.js → RunsPage-BM4ETLsm.js} +1 -1
- package/assets/assets/SettingsPage-DpJTB2-Q.js +1 -0
- package/assets/assets/SiteHealthSection-CmlMQ17V.js +2 -0
- package/assets/assets/{TrafficPage-x01Zc1a-.js → TrafficPage-ClH3Dxnm.js} +4 -4
- package/assets/assets/{index-DtKWmlCj.js → index-MbApCekj.js} +15 -15
- package/assets/assets/{react-sigma_core.esm.min-CmaI5ZWC.js → react-sigma_core.esm.min-Bidr1Gxk.js} +1 -1
- package/assets/assets/service-BUi8JgGI.js +1 -0
- package/assets/index.html +1 -1
- package/dist/{backfill-ENGKBFKH.js → backfill-NE55YL6X.js} +2 -2
- package/dist/{chunk-VJFQNFOR.js → chunk-7KOAP47B.js} +9 -2
- package/dist/{chunk-BKIFKB7E.js → chunk-CF6BUJRK.js} +2 -2
- package/dist/{chunk-ZG4KG53J.js → chunk-G7SGQUW4.js} +14 -14
- package/dist/chunk-HZSE3WSG.js +269 -0
- package/dist/{chunk-L6WMECR5.js → chunk-IY4AJ6DN.js} +5 -268
- package/dist/{chunk-7OJQWLDI.js → chunk-NZLK3KHQ.js} +19 -2
- package/dist/{chunk-H6IQ4YCJ.js → chunk-P3UGNR2Y.js} +1 -1
- package/dist/{chunk-2PC54WLE.js → chunk-QKDKVPMR.js} +1 -1
- package/dist/{chunk-VH2KHJGT.js → chunk-UZKNS5PL.js} +11 -9
- package/dist/{cli-commands-5YNRJIN6.js → cli-commands-ARJWPTFW.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{dashboard-FI5KKIP4.js → dashboard-SVHZBVM6.js} +1 -1
- package/dist/{demo-DQSDWOTF.js → demo-GLV22DPY.js} +1 -1
- package/dist/{demo-server-32RKOBFE.js → demo-server-GPM4C4Q2.js} +3 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +6 -5
- package/dist/{init-O6PEZ2RT.js → init-Q33HEJJN.js} +1 -1
- package/dist/{intelligence-service-V2VS43H4.js → intelligence-service-LVRH4RJG.js} +3 -2
- package/dist/{serve-KS6ABZHU.js → serve-SJTQQQQE.js} +7 -6
- package/dist/{session-Q623G5DT.js → session-VHCKM3AI.js} +4 -3
- package/dist/{tools-GNTPFDAF.js → tools-4VRHKUBE.js} +2 -2
- package/package.json +1 -1
- package/assets/assets/MeasurementPropertyPage-BsUyf7NF.js +0 -4
- package/assets/assets/SettingsPage-CkI60Uw0.js +0 -1
- package/assets/assets/SiteHealthSection-BKHeLIQL.js +0 -2
- package/assets/assets/service-C_Ai7oQC.js +0 -1
package/assets/assets/{react-sigma_core.esm.min-CmaI5ZWC.js → react-sigma_core.esm.min-Bidr1Gxk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{ot as n}from"./vendor-lucide-BILL9eZH.js";import{c as r,l as i}from"./SiteHealthSection-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{ot as n}from"./vendor-lucide-BILL9eZH.js";import{c as r,l as i}from"./SiteHealthSection-CmlMQ17V.js";var a=e(n(),1);function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(e){if(typeof e==`string`)return o(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function c(e){if(Array.isArray(e))return e}function l(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function u(){throw 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 d(e,t){return c(e)||l(e,t)||s(e,t)||u()}function f(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(c)throw a}}}}function p(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function m(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function h(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function g(e,t,n){return e[6]=t,e[7]=n,e}function _(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function v(e,t){var n=Math.cos(t),r=Math.sin(t);return{x:n*e.x+r*e.y,y:-r*e.x+n*e.y}}function y(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function b(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function x(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=p(),f=Math.min(l,u)-2*r,v=b(t,n);return i?(_(d,g(p(),s,c)),_(d,m(p(),o)),_(d,h(p(),a)),_(d,m(p(),l/f/2/v,u/f/2/v))):(_(d,m(p(),f/l*2*v,f/u*2*v)),_(d,h(p(),-a)),_(d,m(p(),1/o)),_(d,g(p(),-s,-c))),d}function S(e,t,n){var r=y(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function C(e,t,n,r,i){return[Math.floor(t/i*r),Math.floor(e.drawingBufferHeight/i-n/i*r)]}var w={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`},T=new Int8Array(4),E=new Int32Array(T.buffer,0,1),D=new Float32Array(T.buffer,0,1),O=/^\s*rgba?\s*\(/,k=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function A(e){var t=0,n=0,r=0,i=1,a=e.toLowerCase();if(a===`transparent`)return{r:0,g:0,b:0,a:0};if(a in w)return A(w[a]);if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(O.test(e)){var o=e.match(k);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}function j(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=A(e),r=n.r,i=n.g,a=n.b,o=n.a;return t?[r/255*o,i/255*o,a/255*o,o]:[r/255,i/255,a/255,o]}var M={};for(var N in w)M[N]=F(w[N]),M[w[N]]=M[N];function P(e,t,n,r,i){return E[0]=r<<24|n<<16|t<<8|e,i&&(E[0]&=4278190079),D[0]}function F(e){if(e=e.toLowerCase(),M[e]!==void 0)return M[e];var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=P(n,r,i,a,!0);return M[e]=o,o}function I(e,t){D[0]=F(e);var n=E[0];return t&&(n|=16777216),[n&255,n>>8&255,n>>16&255,n>>24&255]}function ee(e){var t=e>>>8&255,n=e>>>16&255,r=e>>>24&255;return((e&255)<<24|r<<16|n<<8|t)>>>0}function te(e,t,n,r){return(n<<24|t<<16|e<<8|r)>>>0}function L(e,t,n,r,i,a){var o=d(C(e,n,r,i,a),2),s=o[0],c=o[1],l=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,c,1,1,e.RGBA,e.UNSIGNED_BYTE,l);var u=d(l,4);return[u[0],u[1],u[2],u[3]]}function ne(e){var t=A(e),n=t.r,r=t.g,i=t.b,a=t.a;return`vec4(${(n/255).toFixed(6)}, ${(r/255).toFixed(6)}, ${(i/255).toFixed(6)}, ${a.toFixed(6)})`}function re(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ie(e){var t=re(e,`string`);return typeof t==`symbol`?t:t+``}function R(e,t,n){return(t=ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ae(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function B(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ie(r.key),r)}}function V(e,t,n){return t&&oe(e.prototype,t),n&&oe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function se(e){return se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},se(e)}function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ce=function(){return!!e})()}function le(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function ue(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return le(e)}function H(e,t,n){return t=se(t),ue(e,ce()?Reflect.construct(t,n||[],se(e).constructor):t.apply(e,n))}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},de(e,t)}function U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&de(e,t)}function fe(e){if(Array.isArray(e))return o(e)}function pe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W(e){return fe(e)||pe(e)||s(e)||me()}function G(e){"@babel/helpers - typeof";return G=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},G(e)}function he(e){return G(e)===`object`&&e!==null&&`attribute`in e}function ge(){return{name:`circle`,glsl:`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{J as t,K as n,ot as r,q as i}from"./vendor-lucide-BILL9eZH.js";import{r as a}from"./vendor-markdown-DNTP_967.js";import{$o as o,Ga as s,Go as c,Jo as l,Ko as u,Qo as d,Xo as f,Yo as p,Za as m,Zo as h,a as g,as as _,cs as v,ds as y,es as b,fs as x,is as S,ls as C,ns as w,os as T,ps as E,pt as D,qo as O,rs as k,ss as A,us as j,vt as M}from"./ToneBadge-CmvL5mFG.js";import{x as N}from"./format-helpers-Bt4tx-f3.js";var P=e(r(),1),F=a(),I=`min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-label-14 text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,L=`flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-label-14 text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,R=e=>e.kind===`project`?`Whole site`:e.label,z={allMarkets:`All markets`,browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:`Browse all properties`},ee=e=>e?.kind===`group`&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,B=e=>`${e} ${e===1?`property`:`properties`}`;function V({options:e,selected:r,onSelect:a,marketKey:o,label:s=`Measurement scope`,labelVisibility:c=`visible`,allowGroupSelect:l=!0}){let u=[...e].sort((e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0})||e.id.localeCompare(t.id)),[d,f]=(0,P.useState)(``),[p,m]=(0,P.useState)([]),[h,g]=(0,P.useState)(!1),_=(0,P.useRef)(null),v=(0,P.useRef)(null),y=(0,P.useId)(),b=u.filter(e=>e.kind===`group`),x=new Map(b.map(e=>[e.id,e])),S=x.get(p.at(-1)??``),C=x.get(p.at(-2)??``),w=d.trim().toLocaleLowerCase(),T=b.filter(e=>!e.parentGroupIds?.some(e=>x.has(e))),E=u.filter(e=>e.kind===`property`),D=e=>(e.parentGroupIds??[]).map(e=>x.get(e)?.label).filter(Boolean).join(` · `),O=e=>`${R(e)} ${D(e)}`.toLocaleLowerCase().includes(w),k=e=>{let t=[...e.parentGroupIds??[]],n=new Set;for(;t.length;){let e=t.pop();if(e===S?.id)return!0;n.has(e)||(n.add(e),t.push(...x.get(e)?.parentGroupIds??[]))}return!1},A=(h?[]:S?b.filter(e=>w?k(e):e.parentGroupIds?.includes(S.id)):w?b:T).filter(O),j=u.find(e=>e.kind===`market`&&e.id===(o??(r.kind===`market`?r.id:void 0))),M=S&&j&&(S.marketKeys?.includes(j.id)||j.parentGroupIds?.includes(S.id))?j.id:void 0,N=l?M??ee(S):void 0,V=(S?E.filter(e=>e.parentGroupIds?.includes(S.id)&&(!N||e.marketKeys?.includes(N))):w||h||b.length===0?E:[]).filter(O),H=u.filter(e=>e.kind!==`market`||h||!l&&!S&&!w&&b.length>0||l&&S?.marketKeys?.length===1&&!w?!1:(S?w?k(e):e.parentGroupIds?.includes(S.id):w||!e.parentGroupIds?.some(e=>x.has(e)))&&O(e)),U=S||h?[]:u.filter(e=>e.kind===`project`&&O(e));(0,P.useEffect)(()=>{let e=e=>{_.current?.open&&e.target instanceof Node&&!_.current.contains(e.target)&&(_.current.open=!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let W=e=>{_.current&&(_.current.open=!1,_.current.querySelector(`summary`)?.focus());let t=l?e.kind===`property`?N:e.kind===`group`&&e.id===S?.id?M:void 0:void 0;t?a(e,t):a(e)},G=e=>{let t=[],n=x.get(e.parentGroupIds?.[0]??``);for(;n&&!t.includes(n.id)&&n.id!==e.id;)t.unshift(n.id),n=x.get(n.parentGroupIds?.[0]??``);return[...t,e.id]},K=()=>{let e=r.kind===`group`?x.get(r.id):void 0,t=x.get(j?.parentGroupIds?.[0]??``),n=(r.parentGroupIds??[]).flatMap(e=>{let t=x.get(e);return t?[G(t)]:[]}),i=n.find(e=>e.at(-1)===S?.id)??n.sort((e,t)=>t.length-e.length)[0]??[],a=t?G(t):r.marketKeys?.length?[]:i;m(e?G(e):a),g(r.kind===`property`&&a.length===0&&b.length>0),f(``)},q=e=>{m(G(e)),g(!1),f(``),v.current?.focus()},J=(e,t=R(e))=>(0,F.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,F.jsxs)(`button`,{type:`button`,className:L,"aria-label":e.kind===`group`&&!l?z.browse(R(e)):z.select(R(e)),"aria-current":r.kind===e.kind&&r.id===e.id?`true`:void 0,onClick:()=>e.kind===`group`&&!l?q(e):W(e),children:[(0,F.jsxs)(`span`,{className:`min-w-0 break-words`,children:[t,w&&D(e)?(0,F.jsx)(`span`,{className:`block text-label-13 text-secondary`,children:D(e)}):null]}),(0,F.jsx)(`span`,{className:`shrink-0 text-right text-label-13 text-secondary`,children:e.kind===`market`?l?`Query context`:`Market`:e.kind===`property`?`Property`:B(e.targetCount)})]}),l&&e.kind===`group`&&e.id!==S?.id&&u.some(t=>t.parentGroupIds?.includes(e.id))?(0,F.jsx)(`button`,{type:`button`,"aria-label":z.browse(e.label),title:`Browse ${e.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:()=>q(e),children:(0,F.jsx)(n,{size:18,"aria-hidden":`true`})}):null]},`${e.kind}:${e.id}`),Y=(e,t)=>t.length>0?(0,F.jsxs)(`section`,{"aria-label":e,className:`mt-2`,children:[(0,F.jsx)(`h3`,{className:`px-2 py-2 text-heading-14 text-secondary`,children:e}),t.map(e=>J(e))]}):null,X=(e,t,n)=>t.length>0?(0,F.jsxs)(`details`,{open:n,className:`mt-2 border-y border-default`,children:[(0,F.jsxs)(`summary`,{className:`min-h-11 cursor-pointer px-2 py-3 text-label-14 text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[e,` (`,t.length,`)`]}),t.map(e=>J(e))]},`${S?.id??`root`}:${e}`):null;return(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`span`,{id:`${y}-label`,className:c===`sr-only`?`sr-only`:`mb-1 block text-label-14-strong text-heading`,children:s}),(0,F.jsxs)(`details`,{ref:_,className:`relative`,onToggle:e=>{e.target===e.currentTarget&&e.currentTarget.open&&v.current?.focus()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,F.jsxs)(`summary`,{id:`${y}-value`,"aria-labelledby":`${y}-label ${y}-value`,className:`${I} visibility-scope-trigger`,onClick:()=>{_.current?.open||K()},children:[`${R(r)}${r.kind===`group`?` · ${B(r.targetCount)}`:r.kind===`property`?` · ${u.find(e=>e.kind===`market`&&e.id===o)?.label??(r.marketKeys?.length?z.allMarkets:`Property`)}`:r.kind===`market`?` · Market`:``}`,(0,F.jsx)(t,{size:16,"aria-hidden":`true`,className:`shrink-0 text-secondary`})]}),(0,F.jsxs)(`div`,{className:`visibility-scope-menu`,children:[S||h?(0,F.jsxs)(`div`,{className:`mb-2 border-b border-default pb-2`,children:[(0,F.jsx)(`button`,{type:`button`,className:L,"aria-label":`Back to ${C?.label??`all groups`}`,onClick:()=>{m(p.slice(0,-1)),g(!1),f(``),v.current?.focus()},children:(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(i,{size:16,"aria-hidden":`true`}),C?.label??`All groups`]})}),(0,F.jsx)(`p`,{className:`px-2 py-1 text-copy-14-strong text-heading`,"aria-live":`polite`,children:S?.label??`All properties`})]}):null,(0,F.jsx)(`input`,{ref:v,type:`search`,"aria-label":`Search scopes`,className:I,placeholder:S?`Search within this group`:h?`Search properties`:`Search groups or properties`,value:d,onChange:e=>f(e.target.value)}),(0,F.jsxs)(`div`,{className:`mt-2 max-h-80 overflow-y-auto`,children:[l&&S&&!w?J(S,`All properties in this group`):null,U.map(e=>J(e)),S&&!w?X(`Subgroups`,A,!0):Y(S?`Subgroups`:`Groups`,A),w?Y(`Properties`,V):X(S&&A.length>0?`All properties`:`Properties`,V,!S||A.length===0),Y(`Markets`,H),!S&&!h&&!w&&b.length>0&&E.length>0?(0,F.jsxs)(`button`,{type:`button`,className:`${L} mt-2 border-t border-default`,"aria-label":z.browseAll,onClick:()=>{g(!0),v.current?.focus()},children:[(0,F.jsx)(`span`,{children:`All properties`}),(0,F.jsx)(n,{size:18,"aria-hidden":`true`})]}):null,w&&A.length+V.length+H.length+U.length===0?(0,F.jsx)(`p`,{className:`py-3 text-copy-14 text-secondary`,children:`No matching scopes.`}):null]})]})]})]})}function H(e){let t=e[0];return!t||e.every(e=>e.mode===t.mode&&e.scope.kind===t.scope.kind&&e.scope.key===t.scope.key&&e.queryClass===t.queryClass&&e.measurement.displayedRunId===t.measurement.displayedRunId)}function U(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},...e.unchecked===void 0?{}:{unchecked:e.unchecked}}}function W(e){return e.kind===`exact`?e.url:e.kind===`prefix`?`https://${e.host}${e.pathPrefix===`/`?``:e.pathPrefix}/*`:`https://${e.host}/*`}function G(e){return e===`assigned`?`this-property`:e===`sibling`?`another-property`:e===`ownedUnmapped`?`owned-unassigned`:e===`external`?`external`:e===`ambiguous`?`multiple-properties`:`invalid-url`}function K(e){return e===`assigned`?`positive`:e===`external`?`neutral`:e===`invalid`?`negative`:`caution`}function q(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function J(e,t,n){let r=new Map;if(!t)return r;let i=new Map(e.usageEdges.map(e=>[q(e),e.targetKey])),a=new Map(e.assignments.map(e=>[`${e.targetKey}:${e.queryId}`,e.queryClass])),o=new Map(e.usageEdges.map(e=>[q(e),a.get(`${e.targetKey}:${e.queryId}`)]));for(let e of t.evidence){if(n&&o.get(e.usageEdgeId)!==n)continue;let t=i.get(e.usageEdgeId);if(!t)continue;let a=r.get(t)??[];a.push({id:`${e.observationId}:${e.expectedSlotId}:${e.usageEdgeId}:${e.sourceUrl}`,kind:G(e.classification),query:e.queryText,provider:e.provider,location:e.location,url:e.sourceUrl,tone:K(e.classification),historical:e.historical||e.bridged}),r.set(t,a)}return r}function Y(e){if(e.flags>0)return{label:`Review`,tone:`caution`};let t=[e.mentionCoverage,e.citationCoverage].filter(e=>e.state===`unavailable`).map(e=>e.reason);return t.includes(`no_completed_run`)?{label:`Not measured`,tone:`neutral`}:t.includes(`plan_v1`)?{label:`Update setup`,tone:`caution`}:t.includes(`evidence_incomplete`)?{label:`Evidence incomplete`,tone:`caution`}:t.includes(`identity_ambiguous`)?{label:N.ambiguous,tone:`caution`}:t.includes(`no_population`)?{label:`No queries`,tone:`neutral`}:t.includes(`not_applicable`)?{label:`Not applicable`,tone:`neutral`}:{label:`Complete`,tone:`positive`}}function X(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 te(e){if(!e)return``;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):``}function Z(e){let t=e.nextAction.count??e.flags.total;if(e.nextAction.kind===`review_flags`)return`${t} flagged ${t===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 ne({overview:e,activePlan:t,report:n,reportState:r=n?`ready`:`loading`,sort:i}){if(t.plan.schemaVersion!==2||e.mode!==`active-v2`)throw Error(`The current overview requires an active version-two setup.`);if(e.scope.kind!==`all`&&e.scope.kind!==`group`)throw Error(`The current overview requires an All Properties or group scope.`);let a=t.plan,o=new Map(a.targets.map(e=>[e.stableKey,e])),s=new Map(a.querySnapshots.map(e=>[e.queryId,e.queryText])),c=new Map;for(let t of a.assignments){if(e.queryClass!==`all`&&t.queryClass!==e.queryClass)continue;let n=s.get(t.queryId);if(!n)continue;let r=c.get(t.targetKey)??new Set;r.add(n),c.set(t.targetKey,r)}let l=n?.revision===t.revision&&n.run?.id===e.measurement.displayedRunId?n:null,u=e.measurement.displayedRunId===void 0||l?`ready`:r===`error`||n!=null?`error`:`loading`,d=J(a,l,e.queryClass===`all`?void 0:e.queryClass),f=new Map;for(let e of a.groups)for(let t of e.targetKeys)f.has(t)||f.set(t,e.label);let p=e.properties.items.map(e=>{let t=o.get(e.targetKey),n=d.get(e.targetKey)??[];return{id:e.targetKey,name:e.label,mentionCoverage:U(e.mentionCoverage),citationCoverage:U(e.citationCoverage),status:Y(e),providers:e.providers?.map(e=>({provider:e.provider,mentionCoverage:U(e.mentionCoverage),citationCoverage:U(e.citationCoverage)})),market:f.get(e.targetKey),assignedQueries:[...c.get(e.targetKey)??[]],urls:t?.urlMatchers.map(W)??[],evidence:n,evidenceState:u,historical:n.some(e=>e.historical)}}),m=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),h=e.properties.items.flatMap(e=>e.flags>0?[{id:`property:${e.targetKey}`,property:e.label,summary:`${e.flags} ${e.flags===1?`result needs`:`results need`} review.`,tone:`caution`,count:e.flags}]:[]);return{classReporting:`available`,latestMeasurement:{status:X(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:te(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:U(e.metrics.propertiesMentioned),mentionCoverage:U(e.metrics.mentionCoverage),citationCoverage:U(e.metrics.citationCoverage)},properties:p,...m?{shareOfVoice:m}:{}},propertyTotal:e.properties.totalEstimate??p.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...i?{sort:i}:{}},availableGroups:a.groups.map(e=>({id:e.stableKey,label:e.label})),...Z(e)?{nextActionText:Z(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:h}}function Q(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`web-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(e){return{"If-Match":e,"Idempotency-Key":Q()}}function re(e){return e instanceof g&&(e.statusCode===404||e.statusCode===409||e.statusCode===412)}function ie(e,t){return e instanceof g?t:(e instanceof Error?e.message.trim():``)||t}function ae(e){let t=`Could not calculate assignment impact.`;if(!(e instanceof g)||e.code!==`VALIDATION_ERROR`)return t;let n=e.message.trim();return e.details?.displayToOperator===!0&&n?n:t}var oe={loadSetup:e=>M(()=>m({client:D,path:{name:e}})),loadDraft:e=>M(()=>s({client:D,path:{name:e}})),createDraft:(e,t)=>M(()=>f({client:D,path:{name:e},headers:{"Idempotency-Key":Q()},body:{expectedActiveRevision:t}})),importSitemap:(e,t,n)=>M(()=>b({client:D,path:{name:e},headers:$(t),body:n})),applySitemapSelection:(e,t,n,r)=>M(()=>l({client:D,path:{name:e},headers:$(t),body:{selections:n,selectedTargetKeys:r}})),previewAssignments:(e,t)=>M(()=>w({client:D,path:{name:e},body:t})),applyAssignments:(e,t,n)=>M(()=>c({client:D,path:{name:e},headers:$(t),body:n})),replaceAssignments:(e,t,n)=>M(()=>C({client:D,path:{name:e},headers:$(t),body:n})),applyPairedAssignments:(e,t,n,r)=>M(()=>O({client:D,path:{name:e},headers:$(t),body:{pairs:n,...r?{contextOverride:r}:{}}})),previewMarketRouting:(e,t)=>M(()=>S({client:D,path:{name:e},body:t})),routeMarkets:(e,t,n)=>M(()=>j({client:D,path:{name:e},headers:$(t),body:n})),removeAssignment:(e,t,n,r)=>M(()=>T({client:D,path:{name:e},headers:$(t),body:{targetKeys:n,queryId:r}})),excludeTarget:(e,t,n)=>M(()=>o({client:D,path:{name:e},headers:$(t),body:{targetKey:n,cleanup:`assignments-and-group-memberships`}})),upsertTarget:(e,t,n)=>M(()=>E({client:D,path:{name:e},headers:$(t),body:{target:n}})),upsertGroup:(e,t,n)=>M(()=>x({client:D,path:{name:e},headers:$(t),body:{group:n}})),removeGroup:(e,t,n)=>M(()=>v({client:D,path:{name:e},headers:$(t),body:{groupKey:n}})),upsertCompetitor:(e,t,n)=>M(()=>y({client:D,path:{name:e},headers:$(t),body:n})),removeCompetitor:(e,t,n,r)=>M(()=>A({client:D,path:{name:e},headers:$(t),body:{groupKey:n,competitorKey:r}})),previewGroupMembership:(e,t)=>M(()=>k({client:D,path:{name:e},body:t})),applyGroupMembership:(e,t,n)=>M(()=>u({client:D,path:{name:e},headers:$(t),body:n})),compilePreview:e=>M(()=>p({client:D,path:{name:e}})),diffPreview:e=>M(()=>h({client:D,path:{name:e}})),publish:(e,t,n)=>M(()=>_({client:D,path:{name:e},headers:$(t),body:n})),discard:(e,t)=>M(()=>d({client:D,path:{name:e},headers:$(t)}))};export{ne as a,z as c,ie as i,V as l,ae as n,H as o,re as r,W as s,oe as t};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-MbApCekj.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-BILL9eZH.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-markdown-DNTP_967.js">
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
backfillSnapshotAttributionCommand,
|
|
11
11
|
backfillTrafficClassificationCommand,
|
|
12
12
|
replayQueryAuditLog
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CF6BUJRK.js";
|
|
14
14
|
import "./chunk-JO73L677.js";
|
|
15
15
|
import "./chunk-JE5QURTR.js";
|
|
16
16
|
import "./chunk-HGMYEDAQ.js";
|
|
@@ -18,7 +18,7 @@ import "./chunk-DRGCVTYH.js";
|
|
|
18
18
|
import {
|
|
19
19
|
backfillProjectAnswerMentions,
|
|
20
20
|
backfillProjectAnswerMentionsInChunks
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7KOAP47B.js";
|
|
22
22
|
import "./chunk-JEBY6MS6.js";
|
|
23
23
|
import "./chunk-BADJCT6U.js";
|
|
24
24
|
import "./chunk-O7WOCTBD.js";
|
|
@@ -7433,8 +7433,15 @@ var SentimentService = class {
|
|
|
7433
7433
|
result: sentimentResults.result,
|
|
7434
7434
|
returnedModel: sentimentResults.returnedModel
|
|
7435
7435
|
}).from(sentimentWorkItems).leftJoin(sentimentResults, eq15(sentimentResults.workItemId, sentimentWorkItems.id)).where(scope).all();
|
|
7436
|
-
const
|
|
7437
|
-
|
|
7436
|
+
const admitted = rows.filter((row) => allowed.has(`${row.snapshotId}:${row.sourceTextHash}:${row.subjectHash}`));
|
|
7437
|
+
const inputs = withInput ? /* @__PURE__ */ new Map() : null;
|
|
7438
|
+
if (inputs) {
|
|
7439
|
+
const ids = admitted.map((row) => row.id);
|
|
7440
|
+
for (let index = 0; index < ids.length; index += 500) {
|
|
7441
|
+
for (const row of this.db.select({ id: sentimentWorkItems.id, input: sentimentWorkItems.input }).from(sentimentWorkItems).where(and9(scope, inArray6(sentimentWorkItems.id, ids.slice(index, index + 500)))).all()) inputs.set(row.id, row.input);
|
|
7442
|
+
}
|
|
7443
|
+
}
|
|
7444
|
+
return admitted.flatMap(({ resultOutcome, result, returnedModel, ...work }) => {
|
|
7438
7445
|
const member = allowed.get(`${work.snapshotId}:${work.sourceTextHash}:${work.subjectHash}`);
|
|
7439
7446
|
if (!member) return [];
|
|
7440
7447
|
const edges = member.edges.filter((edge) => matchesSentimentEdge(edge, filter));
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
createRunCompetitorResolver,
|
|
24
24
|
readMarketCompetitorNames,
|
|
25
25
|
refreshSnapshotMentionIdentity
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-7KOAP47B.js";
|
|
27
27
|
import {
|
|
28
28
|
classifyAiUserFetch,
|
|
29
29
|
classifyCrawler
|
|
@@ -437,7 +437,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
|
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
async function backfillInsightsCommand(project, opts) {
|
|
440
|
-
const { IntelligenceService } = await import("./intelligence-service-
|
|
440
|
+
const { IntelligenceService } = await import("./intelligence-service-LVRH4RJG.js");
|
|
441
441
|
const config = loadConfig();
|
|
442
442
|
const db = createClient(config.database);
|
|
443
443
|
migrate(db);
|
|
@@ -696,7 +696,7 @@ var DEMO_CLI_COMMANDS = [{
|
|
|
696
696
|
options: { host: stringOption(), port: stringOption(), "trust-proxy": multiStringOption() },
|
|
697
697
|
allowPositionals: false,
|
|
698
698
|
run: async (input) => {
|
|
699
|
-
const { demoCommand } = await import("./demo-
|
|
699
|
+
const { demoCommand } = await import("./demo-GLV22DPY.js");
|
|
700
700
|
await demoCommand({
|
|
701
701
|
host: getString(input.values, "host"),
|
|
702
702
|
port: getString(input.values, "port"),
|
|
@@ -717,7 +717,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
717
717
|
allowPositionals: false,
|
|
718
718
|
supportsDryRun: true,
|
|
719
719
|
run: async (input) => {
|
|
720
|
-
const { backfillAnswerVisibilityCommand } = await import("./backfill-
|
|
720
|
+
const { backfillAnswerVisibilityCommand } = await import("./backfill-NE55YL6X.js");
|
|
721
721
|
await backfillAnswerVisibilityCommand({
|
|
722
722
|
project: getString(input.values, "project"),
|
|
723
723
|
dryRun: input.dryRun,
|
|
@@ -734,7 +734,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
734
734
|
allowPositionals: false,
|
|
735
735
|
supportsDryRun: true,
|
|
736
736
|
run: async (input) => {
|
|
737
|
-
const { backfillAnswerMentionsCommand } = await import("./backfill-
|
|
737
|
+
const { backfillAnswerMentionsCommand } = await import("./backfill-NE55YL6X.js");
|
|
738
738
|
await backfillAnswerMentionsCommand({
|
|
739
739
|
project: getString(input.values, "project"),
|
|
740
740
|
dryRun: input.dryRun,
|
|
@@ -752,7 +752,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
752
752
|
},
|
|
753
753
|
supportsDryRun: true,
|
|
754
754
|
run: async (input) => {
|
|
755
|
-
const { backfillInsightsCommand } = await import("./backfill-
|
|
755
|
+
const { backfillInsightsCommand } = await import("./backfill-NE55YL6X.js");
|
|
756
756
|
const usage = "canonry backfill insights <project> [--from-run <id>] [--to-run <id>] [--since <date>] [--dry-run] [--format json]";
|
|
757
757
|
const project3 = requireProject(input, "backfill insights", usage);
|
|
758
758
|
await backfillInsightsCommand(project3, {
|
|
@@ -772,7 +772,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
772
772
|
},
|
|
773
773
|
allowPositionals: false,
|
|
774
774
|
run: async (input) => {
|
|
775
|
-
const { backfillNormalizedPathsCommand } = await import("./backfill-
|
|
775
|
+
const { backfillNormalizedPathsCommand } = await import("./backfill-NE55YL6X.js");
|
|
776
776
|
await backfillNormalizedPathsCommand({
|
|
777
777
|
project: getString(input.values, "project"),
|
|
778
778
|
format: input.format
|
|
@@ -787,7 +787,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
787
787
|
},
|
|
788
788
|
allowPositionals: false,
|
|
789
789
|
run: async (input) => {
|
|
790
|
-
const { backfillAiReferralPathsCommand } = await import("./backfill-
|
|
790
|
+
const { backfillAiReferralPathsCommand } = await import("./backfill-NE55YL6X.js");
|
|
791
791
|
await backfillAiReferralPathsCommand({
|
|
792
792
|
project: getString(input.values, "project"),
|
|
793
793
|
format: input.format
|
|
@@ -799,7 +799,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
799
799
|
usage: "canonry backfill snapshot-attribution <project> [--dry-run] [--format json]",
|
|
800
800
|
supportsDryRun: true,
|
|
801
801
|
run: async (input) => {
|
|
802
|
-
const { backfillSnapshotAttributionCommand } = await import("./backfill-
|
|
802
|
+
const { backfillSnapshotAttributionCommand } = await import("./backfill-NE55YL6X.js");
|
|
803
803
|
const usage = "canonry backfill snapshot-attribution <project> [--dry-run] [--format json]";
|
|
804
804
|
const project3 = requireProject(input, "backfill snapshot-attribution", usage);
|
|
805
805
|
await backfillSnapshotAttributionCommand({
|
|
@@ -818,7 +818,7 @@ var BACKFILL_CLI_COMMANDS = [
|
|
|
818
818
|
allowPositionals: false,
|
|
819
819
|
supportsDryRun: true,
|
|
820
820
|
run: async (input) => {
|
|
821
|
-
const { backfillTrafficClassificationCommand } = await import("./backfill-
|
|
821
|
+
const { backfillTrafficClassificationCommand } = await import("./backfill-NE55YL6X.js");
|
|
822
822
|
await backfillTrafficClassificationCommand({
|
|
823
823
|
project: getString(input.values, "project"),
|
|
824
824
|
dryRun: input.dryRun,
|
|
@@ -1260,7 +1260,7 @@ var DASHBOARD_CLI_COMMANDS = [
|
|
|
1260
1260
|
usage: "canonry dashboard reset-password [--format json]",
|
|
1261
1261
|
help: "Clears the dashboard password from config.yaml, so the dashboard asks for a new one after a restart.\nLocal only: it edits the config file under CANONRY_CONFIG_DIR and does not call the server.",
|
|
1262
1262
|
run: async (input) => {
|
|
1263
|
-
const { resetDashboardPassword } = await import("./dashboard-
|
|
1263
|
+
const { resetDashboardPassword } = await import("./dashboard-SVHZBVM6.js");
|
|
1264
1264
|
await resetDashboardPassword({ format: input.format });
|
|
1265
1265
|
}
|
|
1266
1266
|
},
|
|
@@ -6829,7 +6829,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6829
6829
|
options: { access: stringOption() },
|
|
6830
6830
|
run: async (input) => {
|
|
6831
6831
|
if (input.positionals.length > 1) throw usageError("Expected at most one command group");
|
|
6832
|
-
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-NEZE5QU5.js"), import("./cli-commands-
|
|
6832
|
+
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-NEZE5QU5.js"), import("./cli-commands-ARJWPTFW.js")]);
|
|
6833
6833
|
printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
|
|
6834
6834
|
}
|
|
6835
6835
|
},
|
|
@@ -6878,7 +6878,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6878
6878
|
},
|
|
6879
6879
|
allowPositionals: false,
|
|
6880
6880
|
run: async (input) => {
|
|
6881
|
-
const { initCommand } = await import("./init-
|
|
6881
|
+
const { initCommand } = await import("./init-Q33HEJJN.js");
|
|
6882
6882
|
await initCommand({
|
|
6883
6883
|
force: getBoolean(input.values, "force"),
|
|
6884
6884
|
ref: getString(input.values, "ref"),
|
|
@@ -6933,7 +6933,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
6933
6933
|
allowPositionals: false,
|
|
6934
6934
|
run: async (input) => {
|
|
6935
6935
|
applyServerEnv(input.values);
|
|
6936
|
-
const { serveCommand } = await import("./serve-
|
|
6936
|
+
const { serveCommand } = await import("./serve-SJTQQQQE.js");
|
|
6937
6937
|
await serveCommand(input.format);
|
|
6938
6938
|
}
|
|
6939
6939
|
},
|
|
@@ -8251,8 +8251,8 @@ var AGENT_CLI_COMMANDS = [
|
|
|
8251
8251
|
"timeout-ms": stringOption()
|
|
8252
8252
|
},
|
|
8253
8253
|
run: async (input) => {
|
|
8254
|
-
const { coerceAgentProvider } = await import("./session-
|
|
8255
|
-
const { AERO_TOOL_PROFILES, isAeroToolProfile } = await import("./tools-
|
|
8254
|
+
const { coerceAgentProvider } = await import("./session-VHCKM3AI.js");
|
|
8255
|
+
const { AERO_TOOL_PROFILES, isAeroToolProfile } = await import("./tools-4VRHKUBE.js");
|
|
8256
8256
|
const { agentAsk } = await import("./agent-ask-OBHTCYFR.js");
|
|
8257
8257
|
const usage = `canonry agent ask <project> "<prompt>" [--provider ${AGENT_PROVIDER_IDS.join("|")}] [--model <id>] [--scope all|read-only] [--profile default|ads-operator] [--context <json>] [--conversation <id>] [--max-tool-calls <n>] [--timeout-ms <ms>] [--format json]`;
|
|
8258
8258
|
const project3 = requireProject(input, "agent.ask", usage);
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getRequestContext
|
|
3
|
+
} from "./chunk-BADJCT6U.js";
|
|
4
|
+
import {
|
|
5
|
+
diagnosticIdentity,
|
|
6
|
+
redactLogString,
|
|
7
|
+
redactLogValue
|
|
8
|
+
} from "./chunk-YXAKL5HM.js";
|
|
9
|
+
|
|
10
|
+
// ../api-routes/src/runtime-logger.ts
|
|
11
|
+
import { format } from "util";
|
|
12
|
+
var IS_TTY = process.stdout.isTTY === true;
|
|
13
|
+
var MAX_IDENTITY_LENGTH = 512;
|
|
14
|
+
var RESERVED_FIELDS = /* @__PURE__ */ new Set([
|
|
15
|
+
"ts",
|
|
16
|
+
"level",
|
|
17
|
+
"module",
|
|
18
|
+
"action",
|
|
19
|
+
"msg",
|
|
20
|
+
"requestId",
|
|
21
|
+
"actor",
|
|
22
|
+
"credentialId",
|
|
23
|
+
"userAgent",
|
|
24
|
+
"actorSession",
|
|
25
|
+
"__runtimeRequestId"
|
|
26
|
+
]);
|
|
27
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
28
|
+
function addLogListener(listener) {
|
|
29
|
+
listeners.add(listener);
|
|
30
|
+
return () => listeners.delete(listener);
|
|
31
|
+
}
|
|
32
|
+
function createLogger(module) {
|
|
33
|
+
const emit = (level, action, context) => {
|
|
34
|
+
const msg = context ? safeProperty(context, "msg") : void 0;
|
|
35
|
+
emitRuntimeLog({ level, module, action, context, ...typeof msg === "string" ? { msg } : {} });
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
info: (action, ctx) => emit("info", action, ctx),
|
|
39
|
+
warn: (action, ctx) => emit("warn", action, ctx),
|
|
40
|
+
error: (action, ctx) => emit("error", action, ctx)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function createFastifyLogger(options = {}) {
|
|
44
|
+
return buildFastifyLogger(options.module ?? "HTTP", options.enabled !== false, {});
|
|
45
|
+
}
|
|
46
|
+
var LEVELS = { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60, silent: Infinity };
|
|
47
|
+
function buildFastifyLogger(module, enabled, bindings, inheritedLevel = "info") {
|
|
48
|
+
let level = inheritedLevel;
|
|
49
|
+
const emit = (severity, args) => {
|
|
50
|
+
if (LEVELS[severity] >= LEVELS[level]) logFastify(severity, module, enabled, bindings, args);
|
|
51
|
+
};
|
|
52
|
+
const logger = {
|
|
53
|
+
get level() {
|
|
54
|
+
return level;
|
|
55
|
+
},
|
|
56
|
+
set level(value) {
|
|
57
|
+
if (Object.hasOwn(LEVELS, value)) level = value;
|
|
58
|
+
},
|
|
59
|
+
trace: (...args) => emit("trace", args),
|
|
60
|
+
debug: (...args) => emit("debug", args),
|
|
61
|
+
info: (...args) => emit("info", args),
|
|
62
|
+
warn: (...args) => emit("warn", args),
|
|
63
|
+
error: (...args) => emit("error", args),
|
|
64
|
+
fatal: (...args) => emit("fatal", args),
|
|
65
|
+
silent: () => void 0,
|
|
66
|
+
child: (childBindings) => buildFastifyLogger(module, enabled, mergeBindings(bindings, childBindings), level)
|
|
67
|
+
};
|
|
68
|
+
return logger;
|
|
69
|
+
}
|
|
70
|
+
function logFastify(level, module, enabled, bindings, args) {
|
|
71
|
+
const { context, msg } = normalizePinoArgs(args);
|
|
72
|
+
emitRuntimeLog({
|
|
73
|
+
level,
|
|
74
|
+
module,
|
|
75
|
+
action: `fastify.${level}`,
|
|
76
|
+
msg,
|
|
77
|
+
context: { ...bindings, ...context },
|
|
78
|
+
trustedRequestId: asBoundString(bindings.__runtimeRequestId),
|
|
79
|
+
enabled
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function normalizePinoArgs(args) {
|
|
83
|
+
const first = args[0];
|
|
84
|
+
const second = args[1];
|
|
85
|
+
if (typeof first === "string") return { context: {}, msg: safeFormat(first, args.slice(1)) };
|
|
86
|
+
if (first instanceof Error) {
|
|
87
|
+
return { context: { err: first }, msg: typeof second === "string" ? safeFormat(second, args.slice(2)) : void 0 };
|
|
88
|
+
}
|
|
89
|
+
if (isObject(first)) {
|
|
90
|
+
return { context: copyOwnData(first), msg: typeof second === "string" ? safeFormat(second, args.slice(2)) : void 0 };
|
|
91
|
+
}
|
|
92
|
+
return { context: {}, msg: typeof second === "string" ? safeFormat(second, args.slice(2)) : void 0 };
|
|
93
|
+
}
|
|
94
|
+
function emitRuntimeLog({
|
|
95
|
+
level,
|
|
96
|
+
module,
|
|
97
|
+
action,
|
|
98
|
+
msg,
|
|
99
|
+
context,
|
|
100
|
+
trustedRequestId,
|
|
101
|
+
enabled = true
|
|
102
|
+
}) {
|
|
103
|
+
const safeContext = sanitizeContext(context);
|
|
104
|
+
const error = safeContext.err ?? safeContext.error;
|
|
105
|
+
const errorMessage = typeof error === "string" ? error : isRecord(error) && typeof error.message === "string" ? error.message : void 0;
|
|
106
|
+
const message = errorMessage && errorMessage !== msg ? [msg, errorMessage].filter(Boolean).join(": ") : msg;
|
|
107
|
+
const entry = {
|
|
108
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
109
|
+
level,
|
|
110
|
+
module: boundText(module, "Runtime"),
|
|
111
|
+
action: boundText(action, "log"),
|
|
112
|
+
...message === void 0 ? {} : { msg: redactLogString(message) },
|
|
113
|
+
...safeContext,
|
|
114
|
+
...trustedAttribution(getRequestContext(trustedRequestId), trustedRequestId)
|
|
115
|
+
};
|
|
116
|
+
if (enabled) writeEntry(entry);
|
|
117
|
+
for (const listener of listeners) {
|
|
118
|
+
try {
|
|
119
|
+
listener(entry);
|
|
120
|
+
} catch {
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function sanitizeContext(context) {
|
|
125
|
+
if (!context) return {};
|
|
126
|
+
const output = {};
|
|
127
|
+
for (const key of safeKeys(context).slice(0, 100)) {
|
|
128
|
+
if (RESERVED_FIELDS.has(key)) continue;
|
|
129
|
+
const value = safeProperty(context, key);
|
|
130
|
+
if (key === "req" || key === "request") {
|
|
131
|
+
Object.assign(output, normalizeRequest(value));
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (key === "res" || key === "reply") {
|
|
135
|
+
Object.assign(output, normalizeReply(value));
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (key === "responseTime" || key === "duration") {
|
|
139
|
+
if (typeof value === "number" && Number.isFinite(value)) output.durationMs = value;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
output[key] = value;
|
|
143
|
+
}
|
|
144
|
+
delete output.__runtimeRequestId;
|
|
145
|
+
const redacted = redactLogValue(output);
|
|
146
|
+
return isRecord(redacted) ? redacted : {};
|
|
147
|
+
}
|
|
148
|
+
function trustedAttribution(context, trustedRequestId) {
|
|
149
|
+
const requestId = boundOptional(context?.requestId) ?? trustedRequestId;
|
|
150
|
+
const actor = diagnosticIdentity("actor", context?.actor);
|
|
151
|
+
const credentialId = diagnosticIdentity("credentialId", context?.credentialId);
|
|
152
|
+
const userAgent = boundOptional(context?.userAgent);
|
|
153
|
+
const actorSession = boundOptional(context?.actorSession);
|
|
154
|
+
const method = boundOptional(context?.method);
|
|
155
|
+
const route = boundOptional(context?.route);
|
|
156
|
+
return {
|
|
157
|
+
...requestId ? { requestId } : {},
|
|
158
|
+
...actor ? { actor } : {},
|
|
159
|
+
...credentialId ? { credentialId } : {},
|
|
160
|
+
...userAgent ? { userAgent } : {},
|
|
161
|
+
...actorSession ? { actorSession } : {},
|
|
162
|
+
...method ? { method } : {},
|
|
163
|
+
...route ? { route } : {},
|
|
164
|
+
...context?.statusCode === void 0 ? {} : { statusCode: context.statusCode }
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function mergeBindings(parent, child) {
|
|
168
|
+
const merged = { ...parent };
|
|
169
|
+
if (!isObject(child)) return merged;
|
|
170
|
+
for (const key of safeKeys(child).slice(0, 100)) {
|
|
171
|
+
const value = safeProperty(child, key);
|
|
172
|
+
if (key === "req" || key === "request") Object.assign(merged, normalizeRequest(value));
|
|
173
|
+
else if (key === "res" || key === "reply") Object.assign(merged, normalizeReply(value));
|
|
174
|
+
else if (key === "reqId") {
|
|
175
|
+
merged.reqId = value;
|
|
176
|
+
merged.__runtimeRequestId = value;
|
|
177
|
+
} else if (!RESERVED_FIELDS.has(key)) merged[key] = value;
|
|
178
|
+
}
|
|
179
|
+
return merged;
|
|
180
|
+
}
|
|
181
|
+
function normalizeRequest(value) {
|
|
182
|
+
if (!isObject(value)) return {};
|
|
183
|
+
const id = asBoundString(safeProperty(value, "id"));
|
|
184
|
+
const method = asBoundString(safeProperty(value, "method"));
|
|
185
|
+
const routeOptions = safeProperty(value, "routeOptions");
|
|
186
|
+
const route = isObject(routeOptions) ? asBoundString(safeProperty(routeOptions, "url")) : void 0;
|
|
187
|
+
return {
|
|
188
|
+
...id ? { reqId: id, __runtimeRequestId: id } : {},
|
|
189
|
+
...method ? { method } : {},
|
|
190
|
+
...route ? { route } : {}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function normalizeReply(value) {
|
|
194
|
+
if (!isObject(value)) return {};
|
|
195
|
+
const statusCode = safeProperty(value, "statusCode");
|
|
196
|
+
return typeof statusCode === "number" && Number.isFinite(statusCode) ? { statusCode } : {};
|
|
197
|
+
}
|
|
198
|
+
function writeEntry(entry) {
|
|
199
|
+
const stream = entry.level === "error" || entry.level === "fatal" ? process.stderr : process.stdout;
|
|
200
|
+
const line = IS_TTY ? formatTTY(entry) : JSON.stringify(entry);
|
|
201
|
+
try {
|
|
202
|
+
stream.write(`${line}
|
|
203
|
+
`);
|
|
204
|
+
} catch {
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function formatTTY(entry) {
|
|
208
|
+
const { ts, level, module, action, msg, ...context } = entry;
|
|
209
|
+
const levelTag = level === "fatal" || level === "error" ? "ERR" : level === "warn" ? "WRN" : "INF";
|
|
210
|
+
const parts = safeKeys(context).map((key) => `${key}=${safeDisplay(safeProperty(context, key))}`);
|
|
211
|
+
return `${ts.slice(11, 19)} ${levelTag} [${module}] ${action}${msg ? ` ${msg}` : ""}${parts.length ? ` ${parts.join(" ")}` : ""}`;
|
|
212
|
+
}
|
|
213
|
+
function safeDisplay(value) {
|
|
214
|
+
try {
|
|
215
|
+
return typeof value === "string" ? value : JSON.stringify(value);
|
|
216
|
+
} catch {
|
|
217
|
+
return "[UNSERIALIZABLE]";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function safeFormat(message, args) {
|
|
221
|
+
try {
|
|
222
|
+
return args.length ? format(message, ...args) : message;
|
|
223
|
+
} catch {
|
|
224
|
+
return message;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function isObject(value) {
|
|
228
|
+
return value !== null && typeof value === "object";
|
|
229
|
+
}
|
|
230
|
+
function isRecord(value) {
|
|
231
|
+
return isObject(value) && !Array.isArray(value);
|
|
232
|
+
}
|
|
233
|
+
function safeKeys(value) {
|
|
234
|
+
try {
|
|
235
|
+
return Object.keys(value);
|
|
236
|
+
} catch {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function safeProperty(value, key) {
|
|
241
|
+
try {
|
|
242
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
243
|
+
return descriptor && "value" in descriptor ? descriptor.value : void 0;
|
|
244
|
+
} catch {
|
|
245
|
+
return void 0;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function copyOwnData(value) {
|
|
249
|
+
const output = {};
|
|
250
|
+
for (const key of safeKeys(value)) output[key] = safeProperty(value, key);
|
|
251
|
+
return output;
|
|
252
|
+
}
|
|
253
|
+
function boundText(value, fallback) {
|
|
254
|
+
return boundOptional(value) ?? fallback;
|
|
255
|
+
}
|
|
256
|
+
function asBoundString(value) {
|
|
257
|
+
return typeof value === "string" ? boundOptional(value) : void 0;
|
|
258
|
+
}
|
|
259
|
+
function boundOptional(value) {
|
|
260
|
+
if (typeof value !== "string") return void 0;
|
|
261
|
+
const redacted = redactLogString(value).replace(/[\r\n]+/g, " ").trim().slice(0, MAX_IDENTITY_LENGTH);
|
|
262
|
+
return redacted || void 0;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
addLogListener,
|
|
267
|
+
createLogger,
|
|
268
|
+
createFastifyLogger
|
|
269
|
+
};
|