@ainyc/canonry 4.193.2 → 4.195.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.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/assets/agent-workspace/skills/canonry/SKILL.md +81 -1
  3. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +41 -0
  4. package/assets/assets/{AuditHistoryPanel-BBXiKuD1.js → AuditHistoryPanel-vWUtVXOI.js} +1 -1
  5. package/assets/assets/{BacklinksPage-CE_-DKWO.js → BacklinksPage-CSzuMEuv.js} +1 -1
  6. package/assets/assets/{HistoryPage-D-l4jMt5.js → HistoryPage-DtCTQ7CQ.js} +1 -1
  7. package/assets/assets/{MeasurementPropertyPage-fCJm3sW6.js → MeasurementPropertyPage-B7gTMWNs.js} +1 -1
  8. package/assets/assets/{ProjectPage-Cxrd8lZM.js → ProjectPage-Bsm0_jUY.js} +1 -1
  9. package/assets/assets/{RunRow-C2kmB04V.js → RunRow-D5k4Rdo4.js} +1 -1
  10. package/assets/assets/{RunsPage-B73hjh_l.js → RunsPage-DIXBB2Om.js} +1 -1
  11. package/assets/assets/{SettingsPage-Ba30Jfnn.js → SettingsPage-wYhBm6Az.js} +1 -1
  12. package/assets/assets/{SiteHealthSection-mjpxy6N9.js → SiteHealthSection-YebzsgDh.js} +3 -3
  13. package/assets/assets/{TrafficPage-BZ8H_c8u.js → TrafficPage-DtnSRFO8.js} +1 -1
  14. package/assets/assets/{TrafficSourceDetailPage-sCUyzPpH.js → TrafficSourceDetailPage-DYQ6mpYq.js} +1 -1
  15. package/assets/assets/{extract-error-message-G-MvSIBA.js → extract-error-message-BdChrkmo.js} +1 -1
  16. package/assets/assets/{index-CSktlkUv.js → index-C_E2NRYY.js} +26 -26
  17. package/assets/assets/{react-sigma_core.esm.min-CgN2Dnvk.js → react-sigma_core.esm.min-sKWUk_tG.js} +1 -1
  18. package/assets/assets/{v2-overview-adapter-OmeP2l8O.js → v2-overview-adapter-CkPt-sRK.js} +1 -1
  19. package/assets/index.html +1 -1
  20. package/dist/{chunk-5CXUV3ZX.js → chunk-3WODA4JF.js} +288 -7
  21. package/dist/{chunk-24JHDZ7H.js → chunk-B2XM6AQ6.js} +318 -33
  22. package/dist/{chunk-KJJMIWVD.js → chunk-H3RVNMOO.js} +91 -38
  23. package/dist/{chunk-LIMWYFHS.js → chunk-LJKAB4CX.js} +2 -2
  24. package/dist/{chunk-Q5KGSOT7.js → chunk-UMU3IBXM.js} +1231 -484
  25. package/dist/cli.js +252 -156
  26. package/dist/index.js +4 -4
  27. package/dist/{intelligence-service-6ORSU2M6.js → intelligence-service-MGQRJW4V.js} +2 -2
  28. package/dist/mcp.js +4 -4
  29. package/package.json +10 -10
@@ -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-mjpxy6N9.js";import"./index-CSktlkUv.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-CW2qe0uH.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
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-YebzsgDh.js";import"./index-C_E2NRYY.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-CW2qe0uH.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(r,n){return qt(r)||Yt(r,n)||Tt(r,n)||Xt()}var pe={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Ct=new Int8Array(4),be=new Int32Array(Ct.buffer,0,1),$t=new Float32Array(Ct.buffer,0,1),Kt=/^\s*rgba?\s*\(/,Jt=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function Qt(r){var n=0,i=0,e=0,t=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),e=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),e=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(t=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(Kt.test(r)){var a=r.match(Jt);a&&(n=+a[1],i=+a[2],e=+a[3],a[4]&&(t=+a[4]))}return{r:n,g:i,b:e,a:t}}var J={};for(var le in pe)J[le]=oe(pe[le]),J[pe[le]]=J[le];function Rt(r,n,i,e,t){return be[0]=e<<24|i<<16|n<<8|r,be[0]=be[0]&4278190079,$t[0]}function oe(r){if(r=r.toLowerCase(),typeof J[r]<"u")return J[r];var n=Qt(r),i=n.r,e=n.g,t=n.b,a=n.a;a=a*255|0;var o=Rt(i,e,t,a);return J[r]=o,o}var Ee={};function _t(r){if(typeof Ee[r]<"u")return Ee[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,e=r&255,t=255,a=Rt(n,i,e,t);return Ee[r]=a,a}function We(r,n,i,e){return i+(n<<8)+(r<<16)}function Ve(r,n,i,e,t,a){var o=Math.floor(i/a*t),s=Math.floor(r.drawingBufferHeight/a-e/a*t),l=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(o,s,1,1,r.RGBA,r.UNSIGNED_BYTE,l);var h=ee(l,4),u=h[0],d=h[1],f=h[2],g=h[3];return[u,d,f,g]}function c(r,n,i){return(n=ae(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function je(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.push.apply(i,e)}return i}function b(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?je(Object(i),!0).forEach(function(e){c(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function ei(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=Q(r))!==null;);return r}function Ae(){return Ae=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var e=ei(r,n);if(e){var t=Object.getOwnPropertyDescriptor(e,n);return t.get?t.get.call(arguments.length<3?r:i):t.value}},Ae.apply(null,arguments)}function wt(r,n,i,e){var t=Ae(Q(r.prototype),n,i);return typeof t=="function"?function(a){return t.apply(i,a)}:t}function ti(r){return r.normalized?1:r.size}function ye(r){var n=0;return r.forEach(function(i){return n+=ti(i)}),n}function xt(r,n,i){var e=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,t=n.createShader(e);if(t===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(t,i),n.compileShader(t);var a=n.getShaderParameter(t,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`loadShader: error while compiling the shader:
3
3
  `.concat(o,`
4
4
  `).concat(i))}return t}function ii(r,n){return xt("VERTEX",r,n)}function ri(r,n){return xt("FRAGMENT",r,n)}function ni(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var e,t;for(e=0,t=n.length;e<t;e++)r.attachShader(i,n[e]);r.linkProgram(i);var a=r.getProgramParameter(i,r.LINK_STATUS);if(!a){var o=r.getProgramInfoLog(i);throw r.deleteProgram(i),new Error("loadProgram: error while linking the program: ".concat(o))}return i}function Ze(r){var n=r.gl,i=r.buffer,e=r.program,t=r.vertexShader,a=r.fragmentShader;n.deleteShader(t),n.deleteShader(a),n.deleteProgram(e),n.deleteBuffer(i)}var qe=`#define PICKING_MODE
@@ -1 +1 @@
1
- import{j as o,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{y as M,B as A}from"./index-CSktlkUv.js";import{M as $}from"./vendor-markdown-B-Oq2NYq.js";const H="Sources",y={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function N({headingLevel:e}){return n=>{const r=[],s=i=>{i.type==="heading"&&i.depth&&r.push(i),i.children?.forEach(s)};s(n);const l=r.reduce((i,u)=>Math.min(i,u.depth),6);for(const i of r){const u=i.depth-l;i.depth=Math.min(6,e+u),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":u+1}}}}}function R({answer:e}){const[n,r]=C.useState("idle"),s=C.useRef(!1),l=async()=>{if(!s.current){s.current=!0,r("copying");try{await navigator.clipboard.writeText(e),r("copied")}catch{r("failed")}finally{s.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(A,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":n==="copying","aria-busy":n==="copying",onClick:()=>{l()},children:n==="copying"?y.copying:y.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:n==="copied"?y.copied:n==="failed"?y.failed:""})]})}function L({children:e,headingLevel:n=4,copyable:r=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx($,{remarkPlugins:[[N,{headingLevel:n}]],components:{p:({children:s})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:s}),ul:({children:s})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:s}),ol:({children:s,start:l})=>o.jsx("ol",{start:l,className:"mb-3 ml-5 list-decimal space-y-1",children:s}),pre:({children:s})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:s}),a:({children:s,href:l})=>{const i=M(l);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:s}):o.jsx("span",{children:s})},img:({alt:s})=>o.jsx("span",{children:s})},children:e}),r&&e.trim()?o.jsx(R,{answer:e},e):null]})}function F(e){const n=e[0];return n?e.every(r=>r.mode===n.mode&&r.scope.kind===n.scope.kind&&r.scope.key===n.scope.key&&r.queryClass===n.queryClass&&r.measurement.displayedRunId===n.measurement.displayedRunId):!0}function p(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator}}function I(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function T(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function _(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function k(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function j(e,n,r){const s=new Map;if(!n)return s;const l=new Map(e.usageEdges.map(a=>[k(a),a.targetKey])),i=new Map(e.assignments.map(a=>[`${a.targetKey}:${a.queryId}`,a.queryClass])),u=new Map(e.usageEdges.map(a=>[k(a),i.get(`${a.targetKey}:${a.queryId}`)]));for(const a of n.evidence){if(r&&u.get(a.usageEdgeId)!==r)continue;const c=l.get(a.usageEdgeId);if(!c)continue;const m=s.get(c)??[];m.push({id:`${a.observationId}:${a.expectedSlotId}:${a.usageEdgeId}:${a.sourceUrl}`,kind:T(a.classification),query:a.queryText,provider:a.provider,location:a.location,url:a.sourceUrl,tone:_(a.classification),historical:a.historical||a.bridged}),s.set(c,m)}return s}function B(e){if(e.flags>0)return{label:"Review",tone:"caution"};const n=[e.mentionCoverage,e.citationCoverage].filter(r=>r.state==="unavailable").map(r=>r.reason);return n.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:n.includes("plan_v1")?{label:"Update setup",tone:"caution"}:n.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:n.includes("no_population")?{label:"No queries",tone:"neutral"}:n.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function O(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 U(e){if(!e)return"";const n=new Date(e);return Number.isFinite(n.getTime())?n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function q(e){const n=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${n} flagged ${n===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function W({overview:e,activePlan:n,report:r,reportState:s=r?"ready":"loading",sort:l}){if(n.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=n.plan,u=new Map(i.targets.map(t=>[t.stableKey,t])),a=new Map(i.querySnapshots.map(t=>[t.queryId,t.queryText])),c=new Map;for(const t of i.assignments){if(e.queryClass!=="all"&&t.queryClass!==e.queryClass)continue;const d=a.get(t.queryId);if(!d)continue;const g=c.get(t.targetKey)??new Set;g.add(d),c.set(t.targetKey,g)}const m=r?.revision===n.revision&&r.run?.id===e.measurement.displayedRunId?r:null,K=e.measurement.displayedRunId===void 0||m?"ready":s==="error"||r!=null?"error":"loading",S=j(i,m,e.queryClass==="all"?void 0:e.queryClass),h=new Map;for(const t of i.groups)for(const d of t.targetKeys)h.has(d)||h.set(d,t.label);const x=e.properties.items.map(t=>{const d=u.get(t.targetKey),g=S.get(t.targetKey)??[];return{id:t.targetKey,name:t.label,mentionCoverage:p(t.mentionCoverage),citationCoverage:p(t.citationCoverage),status:B(t),providers:t.providers?.map(f=>({provider:f.provider,mentionCoverage:p(f.mentionCoverage),citationCoverage:p(f.citationCoverage)})),market:h.get(t.targetKey),assignedQueries:[...c.get(t.targetKey)??[]],urls:d?.urlMatchers.map(I)??[],evidence:g,evidenceState:K,historical:g.some(f=>f.historical)}}),b=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),E=e.properties.items.flatMap(t=>t.flags>0?[{id:`property:${t.targetKey}`,property:t.label,summary:`${t.flags} ${t.flags===1?"result needs":"results need"} review.`,tone:"caution",count:t.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:O(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:U(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:p(e.metrics.propertiesMentioned),mentionCoverage:p(e.metrics.mentionCoverage),citationCoverage:p(e.metrics.citationCoverage)},properties:x,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...l?{sort:l}:{}},availableGroups:i.groups.map(t=>({id:t.stableKey,label:t.label})),...q(e)?{nextActionText:q(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:E}}export{L as A,H as a,F as b,W as c,I as m};
1
+ import{j as o,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{y as M,B as A}from"./index-C_E2NRYY.js";import{M as $}from"./vendor-markdown-B-Oq2NYq.js";const H="Sources",y={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function N({headingLevel:e}){return n=>{const r=[],s=i=>{i.type==="heading"&&i.depth&&r.push(i),i.children?.forEach(s)};s(n);const l=r.reduce((i,u)=>Math.min(i,u.depth),6);for(const i of r){const u=i.depth-l;i.depth=Math.min(6,e+u),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":u+1}}}}}function R({answer:e}){const[n,r]=C.useState("idle"),s=C.useRef(!1),l=async()=>{if(!s.current){s.current=!0,r("copying");try{await navigator.clipboard.writeText(e),r("copied")}catch{r("failed")}finally{s.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(A,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":n==="copying","aria-busy":n==="copying",onClick:()=>{l()},children:n==="copying"?y.copying:y.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:n==="copied"?y.copied:n==="failed"?y.failed:""})]})}function L({children:e,headingLevel:n=4,copyable:r=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx($,{remarkPlugins:[[N,{headingLevel:n}]],components:{p:({children:s})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:s}),ul:({children:s})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:s}),ol:({children:s,start:l})=>o.jsx("ol",{start:l,className:"mb-3 ml-5 list-decimal space-y-1",children:s}),pre:({children:s})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:s}),a:({children:s,href:l})=>{const i=M(l);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:s}):o.jsx("span",{children:s})},img:({alt:s})=>o.jsx("span",{children:s})},children:e}),r&&e.trim()?o.jsx(R,{answer:e},e):null]})}function F(e){const n=e[0];return n?e.every(r=>r.mode===n.mode&&r.scope.kind===n.scope.kind&&r.scope.key===n.scope.key&&r.queryClass===n.queryClass&&r.measurement.displayedRunId===n.measurement.displayedRunId):!0}function p(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator}}function I(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function T(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function _(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function k(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function j(e,n,r){const s=new Map;if(!n)return s;const l=new Map(e.usageEdges.map(a=>[k(a),a.targetKey])),i=new Map(e.assignments.map(a=>[`${a.targetKey}:${a.queryId}`,a.queryClass])),u=new Map(e.usageEdges.map(a=>[k(a),i.get(`${a.targetKey}:${a.queryId}`)]));for(const a of n.evidence){if(r&&u.get(a.usageEdgeId)!==r)continue;const c=l.get(a.usageEdgeId);if(!c)continue;const m=s.get(c)??[];m.push({id:`${a.observationId}:${a.expectedSlotId}:${a.usageEdgeId}:${a.sourceUrl}`,kind:T(a.classification),query:a.queryText,provider:a.provider,location:a.location,url:a.sourceUrl,tone:_(a.classification),historical:a.historical||a.bridged}),s.set(c,m)}return s}function B(e){if(e.flags>0)return{label:"Review",tone:"caution"};const n=[e.mentionCoverage,e.citationCoverage].filter(r=>r.state==="unavailable").map(r=>r.reason);return n.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:n.includes("plan_v1")?{label:"Update setup",tone:"caution"}:n.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:n.includes("no_population")?{label:"No queries",tone:"neutral"}:n.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function O(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 U(e){if(!e)return"";const n=new Date(e);return Number.isFinite(n.getTime())?n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function q(e){const n=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${n} flagged ${n===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function W({overview:e,activePlan:n,report:r,reportState:s=r?"ready":"loading",sort:l}){if(n.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=n.plan,u=new Map(i.targets.map(t=>[t.stableKey,t])),a=new Map(i.querySnapshots.map(t=>[t.queryId,t.queryText])),c=new Map;for(const t of i.assignments){if(e.queryClass!=="all"&&t.queryClass!==e.queryClass)continue;const d=a.get(t.queryId);if(!d)continue;const g=c.get(t.targetKey)??new Set;g.add(d),c.set(t.targetKey,g)}const m=r?.revision===n.revision&&r.run?.id===e.measurement.displayedRunId?r:null,K=e.measurement.displayedRunId===void 0||m?"ready":s==="error"||r!=null?"error":"loading",S=j(i,m,e.queryClass==="all"?void 0:e.queryClass),h=new Map;for(const t of i.groups)for(const d of t.targetKeys)h.has(d)||h.set(d,t.label);const x=e.properties.items.map(t=>{const d=u.get(t.targetKey),g=S.get(t.targetKey)??[];return{id:t.targetKey,name:t.label,mentionCoverage:p(t.mentionCoverage),citationCoverage:p(t.citationCoverage),status:B(t),providers:t.providers?.map(f=>({provider:f.provider,mentionCoverage:p(f.mentionCoverage),citationCoverage:p(f.citationCoverage)})),market:h.get(t.targetKey),assignedQueries:[...c.get(t.targetKey)??[]],urls:d?.urlMatchers.map(I)??[],evidence:g,evidenceState:K,historical:g.some(f=>f.historical)}}),b=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),E=e.properties.items.flatMap(t=>t.flags>0?[{id:`property:${t.targetKey}`,property:t.label,summary:`${t.flags} ${t.flags===1?"result needs":"results need"} review.`,tone:"caution",count:t.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:O(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:U(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:p(e.metrics.propertiesMentioned),mentionCoverage:p(e.metrics.mentionCoverage),citationCoverage:p(e.metrics.citationCoverage)},properties:x,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...l?{sort:l}:{}},availableGroups:i.groups.map(t=>({id:t.stableKey,label:t.label})),...q(e)?{nextActionText:q(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:E}}export{L as A,H as a,F as b,W as c,I as m};
package/assets/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-CSktlkUv.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-C_E2NRYY.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-ZXXkndVj.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-twS1M3FF.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-D-cUuLZo.js">
@@ -5655,6 +5655,10 @@ var auditLogEntrySchema = z9.object({
5655
5655
  userAgent: z9.string().nullable().optional(),
5656
5656
  /** Optional caller-supplied correlation key for grouping related mutations. */
5657
5657
  actorSession: z9.string().nullable().optional(),
5658
+ /** Server-issued request correlation id for an HTTP mutation. */
5659
+ requestId: z9.string().nullable().optional(),
5660
+ /** API credential id used to authenticate an HTTP mutation, when applicable. */
5661
+ credentialId: z9.string().nullable().optional(),
5658
5662
  createdAt: z9.string()
5659
5663
  });
5660
5664
 
@@ -5681,7 +5685,7 @@ function intersectScopes(authority, requested) {
5681
5685
  return effective.length > 0 ? effective : [READ_ONLY_SCOPE];
5682
5686
  }
5683
5687
  function isReadOnlyKey(scopes) {
5684
- return scopes.includes(READ_ONLY_SCOPE) && !scopes.some(grantsWrite);
5688
+ return scopes.some((scope) => scope === READ_ONLY_SCOPE || scope.endsWith(".read")) && !scopes.some(grantsWrite);
5685
5689
  }
5686
5690
 
5687
5691
  // ../contracts/src/api-keys.ts
@@ -8519,14 +8523,14 @@ function roundSignificant(value, sig = 6) {
8519
8523
  const factor = 10 ** (sig - magnitude);
8520
8524
  return (Math.round(value * factor) + 0) / factor;
8521
8525
  }
8522
- function wilsonInterval(successes, n, z61 = 1.96) {
8526
+ function wilsonInterval(successes, n, z62 = 1.96) {
8523
8527
  if (!Number.isFinite(n) || n <= 0) return null;
8524
8528
  const s = Math.max(0, Math.min(successes, n));
8525
8529
  const p = s / n;
8526
- const z210 = z61 * z61;
8530
+ const z210 = z62 * z62;
8527
8531
  const denom = 1 + z210 / n;
8528
8532
  const center = (p + z210 / (2 * n)) / denom;
8529
- const margin = z61 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
8533
+ const margin = z62 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
8530
8534
  return {
8531
8535
  low: round(Math.max(0, center - margin)),
8532
8536
  high: round(Math.min(1, center + margin))
@@ -10719,14 +10723,18 @@ var settingsDtoSchema = z32.object({
10719
10723
 
10720
10724
  // ../contracts/src/snapshot.ts
10721
10725
  import { z as z33 } from "zod";
10726
+ var snapshotProviderModeSchema = z33.enum(["all", "api", "browser"]);
10727
+ var SnapshotProviderModes = snapshotProviderModeSchema.enum;
10722
10728
  var snapshotAccuracySchema = z33.enum(["yes", "no", "unknown", "not-mentioned"]);
10723
10729
  var snapshotQueryListSchema = z33.array(z33.string().min(1));
10724
- var snapshotRequestSchema = z33.object({
10730
+ var snapshotRequestInputSchema = z33.object({
10725
10731
  companyName: z33.string().min(1),
10726
10732
  domain: z33.string().min(1),
10727
10733
  queries: snapshotQueryListSchema.optional(),
10728
10734
  phrases: snapshotQueryListSchema.optional(),
10729
- competitors: z33.array(z33.string().min(1)).optional().default([])
10735
+ competitors: z33.array(z33.string().min(1)).optional(),
10736
+ providers: z33.array(z33.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
10737
+ providerMode: snapshotProviderModeSchema.optional().describe("Filter providers by transport; defaults to all. Browser-only selection requires manual queries and uses no API provider for analysis.")
10730
10738
  }).superRefine((input, ctx) => {
10731
10739
  if (input.queries !== void 0 && input.phrases !== void 0) {
10732
10740
  ctx.addIssue({
@@ -10736,6 +10744,9 @@ var snapshotRequestSchema = z33.object({
10736
10744
  });
10737
10745
  }
10738
10746
  });
10747
+ var snapshotRequestSchema = snapshotRequestInputSchema.safeExtend({
10748
+ competitors: snapshotRequestInputSchema.shape.competitors.default([])
10749
+ });
10739
10750
  function resolveSnapshotRequestQueries(input) {
10740
10751
  return input.queries ?? input.phrases ?? [];
10741
10752
  }
@@ -17630,6 +17641,39 @@ function classifyProviderErrorMessages(messages) {
17630
17641
 
17631
17642
  // ../contracts/src/telemetry.ts
17632
17643
  import { z as z60 } from "zod";
17644
+ var telemetryEffectiveReasonSchema = z60.enum([
17645
+ "enabled",
17646
+ "configured_disabled",
17647
+ "CANONRY_TELEMETRY_DISABLED",
17648
+ "DO_NOT_TRACK",
17649
+ "CI",
17650
+ "NO_CONFIG",
17651
+ "CONFIG_UNAVAILABLE"
17652
+ ]);
17653
+ var telemetryTargetSchema = z60.enum(["server", "local"]);
17654
+ var telemetryStatusDtoSchema = z60.object({
17655
+ enabled: z60.boolean(),
17656
+ configuredEnabled: z60.boolean(),
17657
+ reason: telemetryEffectiveReasonSchema,
17658
+ anonymousId: z60.string().regex(/^[0-9a-f]{8}\.\.\.$/i).optional(),
17659
+ target: telemetryTargetSchema.optional()
17660
+ }).strict();
17661
+ function normalizeTelemetryStatus(status, target = "server") {
17662
+ const reason = telemetryEffectiveReasonSchema.safeParse(status.reason);
17663
+ const anonymousId = maskTelemetryAnonymousId(status.anonymousId);
17664
+ return telemetryStatusDtoSchema.parse({
17665
+ enabled: status.enabled,
17666
+ configuredEnabled: status.configuredEnabled ?? status.enabled,
17667
+ reason: reason.success ? reason.data : status.enabled ? "enabled" : "configured_disabled",
17668
+ target,
17669
+ ...anonymousId ? { anonymousId } : {}
17670
+ });
17671
+ }
17672
+ function maskTelemetryAnonymousId(value) {
17673
+ if (!value) return void 0;
17674
+ if (/^[0-9a-f]{8}\.\.\.$/i.test(value)) return value;
17675
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value) ? `${value.slice(0, 8)}...` : void 0;
17676
+ }
17633
17677
  var ONBOARDING_FLOW_VERSION = 1;
17634
17678
  var onboardingStepSchema = z60.enum([
17635
17679
  "system",
@@ -17743,6 +17787,228 @@ function isTrendBaseline(points) {
17743
17787
  return points.length < MIN_TREND_POINTS;
17744
17788
  }
17745
17789
 
17790
+ // ../contracts/src/operational-logs.ts
17791
+ import { z as z61 } from "zod";
17792
+ var operationalLogLevelSchema = z61.enum(["trace", "debug", "info", "warn", "error", "fatal"]);
17793
+ var diagnosticContextSchema = z61.object({
17794
+ runId: z61.string().min(1).max(256).optional(),
17795
+ projectId: z61.string().min(1).max(256).optional(),
17796
+ requestId: z61.string().min(1).max(256).optional(),
17797
+ actor: z61.string().min(1).max(512).optional(),
17798
+ credentialId: z61.string().min(1).max(512).optional(),
17799
+ userAgent: z61.string().min(1).max(512).optional(),
17800
+ actorSession: z61.string().min(1).max(512).optional(),
17801
+ method: z61.string().min(1).max(16).optional(),
17802
+ route: z61.string().min(1).max(256).optional(),
17803
+ operationId: z61.string().min(1).max(256).optional(),
17804
+ jobId: z61.string().min(1).max(256).optional(),
17805
+ taskId: z61.string().min(1).max(256).optional(),
17806
+ traceId: z61.string().min(1).max(256).optional(),
17807
+ errorCode: z61.string().min(1).max(128).optional(),
17808
+ attempt: z61.number().finite().optional(),
17809
+ count: z61.number().finite().optional(),
17810
+ total: z61.number().finite().optional(),
17811
+ progress: z61.number().finite().optional(),
17812
+ httpStatus: z61.number().finite().optional(),
17813
+ statusCode: z61.number().finite().optional(),
17814
+ durationMs: z61.number().finite().optional(),
17815
+ bytes: z61.number().finite().optional(),
17816
+ retryAfterMs: z61.number().finite().optional(),
17817
+ retriable: z61.boolean().optional(),
17818
+ retrying: z61.boolean().optional(),
17819
+ cancelled: z61.boolean().optional(),
17820
+ success: z61.boolean().optional()
17821
+ }).strict();
17822
+ var operationalLogEntryDtoSchema = z61.object({
17823
+ cursor: z61.string().min(1).max(512),
17824
+ ts: z61.string().datetime(),
17825
+ level: operationalLogLevelSchema,
17826
+ module: z61.string().min(1).max(256),
17827
+ action: z61.string().min(1).max(256),
17828
+ message: z61.string().max(4096).optional(),
17829
+ runId: z61.string().min(1).max(256).optional(),
17830
+ projectId: z61.string().min(1).max(256).optional(),
17831
+ context: diagnosticContextSchema
17832
+ }).strict();
17833
+ var logQuerySchema = z61.object({
17834
+ level: operationalLogLevelSchema.optional(),
17835
+ module: z61.string().trim().min(1).max(256).optional(),
17836
+ runId: z61.string().trim().min(1).max(256).optional(),
17837
+ projectId: z61.string().trim().min(1).max(256).optional(),
17838
+ actor: z61.string().trim().min(1).max(512).optional(),
17839
+ requestId: z61.string().trim().min(1).max(256).optional(),
17840
+ since: z61.string().datetime().optional(),
17841
+ until: z61.string().datetime().optional(),
17842
+ limit: z61.coerce.number().int().min(1).max(200).default(100),
17843
+ cursor: z61.string().trim().min(1).max(512).optional()
17844
+ }).strict().superRefine((query, ctx) => {
17845
+ if (query.since && query.until && Date.parse(query.since) > Date.parse(query.until)) {
17846
+ ctx.addIssue({ code: z61.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
17847
+ }
17848
+ });
17849
+ var operationalLogListDtoSchema = z61.object({
17850
+ entries: z61.array(operationalLogEntryDtoSchema),
17851
+ nextCursor: z61.string().min(1).max(512).nullable(),
17852
+ /** Matching entries left after this page. */
17853
+ truncated: z61.number().int().nonnegative(),
17854
+ /** Entries evicted by the active retention policy. */
17855
+ dropped: z61.number().int().nonnegative(),
17856
+ retention: z61.enum(["process", "durable"]),
17857
+ retentionPolicy: z61.object({
17858
+ maxEntries: z61.number().int().positive(),
17859
+ maxAgeSeconds: z61.number().int().positive()
17860
+ }).strict().optional(),
17861
+ /** Best-effort persistence failures observed by this store. */
17862
+ captureErrors: z61.number().int().nonnegative().optional(),
17863
+ observedAt: z61.string().datetime()
17864
+ }).strict();
17865
+
17866
+ // ../contracts/src/log-redaction.ts
17867
+ var REDACTED = "[REDACTED]";
17868
+ var TRUNCATED = "[TRUNCATED]";
17869
+ var CIRCULAR = "[CIRCULAR]";
17870
+ var UNREADABLE = "[UNREADABLE]";
17871
+ var OMITTED = "[OMITTED]";
17872
+ var MAX_DEPTH = 6;
17873
+ var MAX_ARRAY_ITEMS = 50;
17874
+ var MAX_OBJECT_KEYS = 100;
17875
+ var MAX_STRING_LENGTH = 4096;
17876
+ var secretKey = /api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential/i;
17877
+ var escapedSecretAssignment = /\\+["'][\w -]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w -]*\\+["']\s*:/i;
17878
+ var unsafeGraphKey = /^(?:req|res|request|reply|raw|socket|headers?|body|responsebody|apiresponse|rawresponse|provider(?:body|response)?)$/i;
17879
+ function isSensitiveDiagnosticQueryKey(key) {
17880
+ return secretKey.test(key) || /^key$/i.test(key);
17881
+ }
17882
+ function redactLogValue(value) {
17883
+ try {
17884
+ return redactValue(value, 0, /* @__PURE__ */ new WeakSet());
17885
+ } catch {
17886
+ return UNREADABLE;
17887
+ }
17888
+ }
17889
+ function redactLogString(value) {
17890
+ try {
17891
+ const clipped = value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}${TRUNCATED}` : value;
17892
+ if (escapedSecretAssignment.test(clipped)) return REDACTED;
17893
+ return redactEmbeddedUrls(clipped).replace(/\b((?:set-cookie|cookie)\s*[:=]\s*)[^\r\n]*(?:\r?\n[ \t][^\r\n]*)*/gi, `$1${REDACTED}`).replace(
17894
+ /(["']?[\w-]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w-]*["']?\s*[=:]\s*)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$))/gi,
17895
+ `$1${REDACTED}`
17896
+ ).replace(/\b(Bearer|Basic)\s+[^\s,;]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`).replace(
17897
+ /(api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential)\s*([=:])\s*(?!\[REDACTED\])[^\s&,'")\]}]+/gi,
17898
+ `$1$2${REDACTED}`
17899
+ ).slice(0, MAX_STRING_LENGTH);
17900
+ } catch {
17901
+ return UNREADABLE;
17902
+ }
17903
+ }
17904
+ function redactValue(value, depth, seen, key) {
17905
+ if (key && diagnosticIdentity(key, value) !== void 0) return value;
17906
+ if (key && secretKey.test(key)) return REDACTED;
17907
+ if (key && unsafeGraphKey.test(key)) return OMITTED;
17908
+ if (value === null || typeof value === "boolean") return value;
17909
+ if (typeof value === "number") return Number.isFinite(value) ? value : String(value);
17910
+ if (typeof value === "string") return redactLogString(value);
17911
+ if (typeof value === "bigint") return value.toString();
17912
+ if (typeof value === "undefined") return void 0;
17913
+ if (typeof value === "symbol" || typeof value === "function") return `[${typeof value}]`;
17914
+ if (depth >= MAX_DEPTH) return TRUNCATED;
17915
+ if (typeof value !== "object") return UNREADABLE;
17916
+ if (seen.has(value)) return CIRCULAR;
17917
+ seen.add(value);
17918
+ try {
17919
+ if (value instanceof Error) return redactError(value, depth, seen);
17920
+ if (Array.isArray(value)) {
17921
+ const output2 = [];
17922
+ const length = safeArrayLength(value);
17923
+ for (let index = 0; index < Math.min(length, MAX_ARRAY_ITEMS); index++) {
17924
+ output2.push(redactValue(safeProperty(value, String(index)), depth + 1, seen));
17925
+ }
17926
+ if (length > MAX_ARRAY_ITEMS) output2.push(TRUNCATED);
17927
+ return output2;
17928
+ }
17929
+ const output = {};
17930
+ const keys = safeKeys(value);
17931
+ for (const nestedKey of keys.slice(0, MAX_OBJECT_KEYS)) {
17932
+ output[nestedKey] = redactValue(safeProperty(value, nestedKey), depth + 1, seen, nestedKey);
17933
+ }
17934
+ if (keys.length > MAX_OBJECT_KEYS) output.__truncated = true;
17935
+ return output;
17936
+ } catch {
17937
+ return UNREADABLE;
17938
+ } finally {
17939
+ seen.delete(value);
17940
+ }
17941
+ }
17942
+ function diagnosticIdentity(key, value) {
17943
+ if (typeof value !== "string") return void 0;
17944
+ if (key === "actor" && /^(?:api-key|user):[\w.-]{1,256}$/.test(value)) return value;
17945
+ if (key === "credentialId" && /^[\w.-]{1,256}$/.test(value)) return value;
17946
+ return void 0;
17947
+ }
17948
+ function redactError(error, depth, seen) {
17949
+ const output = {
17950
+ name: redactLogString(safeErrorString(error, "name")),
17951
+ message: redactLogString(safeErrorString(error, "message"))
17952
+ };
17953
+ const stack = safeErrorString(error, "stack");
17954
+ if (stack) output.stack = redactLogString(stack);
17955
+ for (const key of safeKeys(error).slice(0, MAX_OBJECT_KEYS)) {
17956
+ output[key] = redactValue(safeProperty(error, key), depth + 1, seen, key);
17957
+ }
17958
+ return output;
17959
+ }
17960
+ function safeKeys(value) {
17961
+ try {
17962
+ return Object.keys(value);
17963
+ } catch {
17964
+ return [];
17965
+ }
17966
+ }
17967
+ function safeArrayLength(value) {
17968
+ try {
17969
+ return Number.isSafeInteger(value.length) && value.length >= 0 ? value.length : 0;
17970
+ } catch {
17971
+ return 0;
17972
+ }
17973
+ }
17974
+ function safeProperty(value, key) {
17975
+ try {
17976
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
17977
+ if (!descriptor || !("value" in descriptor)) return UNREADABLE;
17978
+ return descriptor.value;
17979
+ } catch {
17980
+ return UNREADABLE;
17981
+ }
17982
+ }
17983
+ function safeErrorString(error, key) {
17984
+ try {
17985
+ const value = error[key];
17986
+ return typeof value === "string" ? value : "";
17987
+ } catch {
17988
+ return UNREADABLE;
17989
+ }
17990
+ }
17991
+ function redactEmbeddedUrls(value) {
17992
+ return value.replace(/https?:\/\/[^\s<>"']+/gi, (candidate) => {
17993
+ if (candidate.includes(TRUNCATED)) return "[TRUNCATED_URL]";
17994
+ const suffix = candidate.match(/[),.;!?\]}]+$/)?.[0] ?? "";
17995
+ const rawUrl = suffix ? candidate.slice(0, -suffix.length) : candidate;
17996
+ try {
17997
+ const url = new URL(rawUrl);
17998
+ if (url.username || url.password) {
17999
+ url.username = REDACTED;
18000
+ url.password = REDACTED;
18001
+ }
18002
+ for (const key of [...url.searchParams.keys()]) {
18003
+ if (isSensitiveDiagnosticQueryKey(key)) url.searchParams.set(key, REDACTED);
18004
+ }
18005
+ return `${url.toString()}${suffix}`;
18006
+ } catch {
18007
+ return `[REDACTED_URL]${suffix}`;
18008
+ }
18009
+ });
18010
+ }
18011
+
17746
18012
  export {
17747
18013
  __export,
17748
18014
  apiKeyDtoSchema,
@@ -18131,6 +18397,8 @@ export {
18131
18397
  isAgentProviderId,
18132
18398
  LlmCapabilities,
18133
18399
  LLM_CAPABILITIES,
18400
+ providerSummaryEntryDtoSchema,
18401
+ integrationSettingsSummaryDtoSchema,
18134
18402
  settingsDtoSchema,
18135
18403
  runStatusSchema,
18136
18404
  RunStatuses,
@@ -18152,6 +18420,9 @@ export {
18152
18420
  runDetailDtoSchema,
18153
18421
  latestProjectRunDtoSchema,
18154
18422
  auditLogEntrySchema,
18423
+ snapshotProviderModeSchema,
18424
+ SnapshotProviderModes,
18425
+ snapshotRequestInputSchema,
18155
18426
  snapshotRequestSchema,
18156
18427
  resolveSnapshotRequestQueries,
18157
18428
  snapshotReportSchema,
@@ -18511,6 +18782,9 @@ export {
18511
18782
  serializeForInlineScript,
18512
18783
  classifyProviderErrorMessage,
18513
18784
  classifyProviderErrorMessages,
18785
+ telemetryStatusDtoSchema,
18786
+ normalizeTelemetryStatus,
18787
+ maskTelemetryAnonymousId,
18514
18788
  ONBOARDING_FLOW_VERSION,
18515
18789
  bucketOnboardingCount,
18516
18790
  onboardingTelemetryEventSchema,
@@ -18518,5 +18792,12 @@ export {
18518
18792
  telemetryEventAcceptedDtoSchema,
18519
18793
  isGhostTelemetryEvent,
18520
18794
  MIN_TREND_POINTS,
18521
- isTrendBaseline
18795
+ isTrendBaseline,
18796
+ operationalLogEntryDtoSchema,
18797
+ logQuerySchema,
18798
+ operationalLogListDtoSchema,
18799
+ isSensitiveDiagnosticQueryKey,
18800
+ redactLogValue,
18801
+ redactLogString,
18802
+ diagnosticIdentity
18522
18803
  };